/* gitg-ui-utils.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-ui-utils.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2026 - Alberto Fanjul
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "config.h"
#include <gtk/gtk.h>
#include <gee.h>
#include <libgit2-glib/ggit.h>
#include <glib/gi18n-lib.h>
#include "libgitg.h"
#include <stdio.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>

#define GITG_UI_UTILS_version VERSION
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GITG_TYPE_UI_UTILS (gitg_ui_utils_get_type ())
#define GITG_UI_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_UI_UTILS, GitgUiUtils))
#define GITG_UI_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_UI_UTILS, GitgUiUtilsClass))
#define GITG_IS_UI_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_UI_UTILS))
#define GITG_IS_UI_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_UI_UTILS))
#define GITG_UI_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_UI_UTILS, GitgUiUtilsClass))

typedef struct _GitgUiUtils GitgUiUtils;
typedef struct _GitgUiUtilsClass GitgUiUtilsClass;
typedef struct _GitgUiUtilsPrivate GitgUiUtilsPrivate;

#define GITG_TYPE_RESULT_DIALOG (gitg_result_dialog_get_type ())
#define GITG_RESULT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_RESULT_DIALOG, GitgResultDialog))
#define GITG_RESULT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_RESULT_DIALOG, GitgResultDialogClass))
#define GITG_IS_RESULT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_RESULT_DIALOG))
#define GITG_IS_RESULT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_RESULT_DIALOG))
#define GITG_RESULT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_RESULT_DIALOG, GitgResultDialogClass))

typedef struct _GitgResultDialog GitgResultDialog;
typedef struct _GitgResultDialogClass GitgResultDialogClass;
typedef struct _Block99Data Block99Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef GtkMenuItem* (*GitgUiUtilsBuildMenuItem) (const gchar* action_prefix, GeeHashMap* item_groups, gpointer user_data);
typedef struct _Block100Data Block100Data;
typedef struct _Block101Data Block101Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define GITG_TYPE_WINDOW (gitg_window_get_type ())
#define GITG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_WINDOW, GitgWindow))
#define GITG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_WINDOW, GitgWindowClass))
#define GITG_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_WINDOW))
#define GITG_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_WINDOW))
#define GITG_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_WINDOW, GitgWindowClass))

typedef struct _GitgWindow GitgWindow;
typedef struct _GitgWindowClass GitgWindowClass;
typedef GeeHashMap* (*GitgUiUtilsBuildObjectVars) (gpointer user_data);
typedef struct _Block102Data Block102Data;
typedef struct _Block103Data Block103Data;
typedef void (*GitgUiUtilsUpdateTreeViewColumnsCallBack) (GtkTreeView* treeview, gpointer user_data);
typedef struct _Block104Data Block104Data;
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))

#define GITG_TYPE_DRAG_LIST_BOX (gitg_drag_list_box_get_type ())
#define GITG_DRAG_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DRAG_LIST_BOX, GitgDragListBox))
#define GITG_DRAG_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_DRAG_LIST_BOX, GitgDragListBoxClass))
#define GITG_IS_DRAG_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DRAG_LIST_BOX))
#define GITG_IS_DRAG_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_DRAG_LIST_BOX))
#define GITG_DRAG_LIST_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_DRAG_LIST_BOX, GitgDragListBoxClass))

typedef struct _GitgDragListBox GitgDragListBox;
typedef struct _GitgDragListBoxClass GitgDragListBoxClass;
typedef struct _Block105Data Block105Data;

#define GITG_TYPE_LIST_ROW (gitg_list_row_get_type ())
#define GITG_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_LIST_ROW, GitgListRow))
#define GITG_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_LIST_ROW, GitgListRowClass))
#define GITG_IS_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_LIST_ROW))
#define GITG_IS_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_LIST_ROW))
#define GITG_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_LIST_ROW, GitgListRowClass))

typedef struct _GitgListRow GitgListRow;
typedef struct _GitgListRowClass GitgListRowClass;

#define GITG_TYPE_LIST_BOX_ROW_DN_D (gitg_list_box_row_dn_d_get_type ())
#define GITG_LIST_BOX_ROW_DN_D(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnD))
#define GITG_LIST_BOX_ROW_DN_D_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnDClass))
#define GITG_IS_LIST_BOX_ROW_DN_D(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_LIST_BOX_ROW_DN_D))
#define GITG_IS_LIST_BOX_ROW_DN_D_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_LIST_BOX_ROW_DN_D))
#define GITG_LIST_BOX_ROW_DN_D_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_LIST_BOX_ROW_DN_D, GitgListBoxRowDnDClass))

typedef struct _GitgListBoxRowDnD GitgListBoxRowDnD;
typedef struct _GitgListBoxRowDnDClass GitgListBoxRowDnDClass;
typedef struct _Block106Data Block106Data;
typedef struct _GitgParamSpecUiUtils GitgParamSpecUiUtils;

struct _GitgUiUtils {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GitgUiUtilsPrivate * priv;
};

struct _GitgUiUtilsClass {
	GTypeClass parent_class;
	void (*finalize) (GitgUiUtils *self);
};

struct _Block99Data {
	int _ref_count_;
	GitgResultDialog* dlg;
};

struct _Block100Data {
	int _ref_count_;
	GtkMenu* menu;
	gchar* type;
	GitgUiUtilsBuildMenuItem build_menu_item;
	gpointer build_menu_item_target;
};

struct _Block101Data {
	int _ref_count_;
	Block100Data * _data100_;
	GeeHashMap* item_groups;
};

struct _Block102Data {
	int _ref_count_;
	gchar* command;
	gboolean show_output;
	gboolean show_error;
	GeeHashMap* dialog_vars;
	GeeHashMap* object_vars;
	GitgWindow* parent;
};

struct _Block103Data {
	int _ref_count_;
	GtkEntry* entry;
	GtkButton* ok_button;
};

struct _Block104Data {
	int _ref_count_;
	GtkTreeView* treeview;
	GitgUiUtilsUpdateTreeViewColumnsCallBack callback;
	gpointer callback_target;
};

struct _Block105Data {
	int _ref_count_;
	GListStore* list_model;
	GitgDragListBox* listbox;
	GtkTreeView* treeview;
};

struct _Block106Data {
	int _ref_count_;
	GSettings* settings;
	GtkSwitch* switch_show_col_headers;
	GtkTreeView* treeview;
};

struct _GitgParamSpecUiUtils {
	GParamSpec parent_instance;
};

static gpointer gitg_ui_utils_parent_class = NULL;

VALA_EXTERN gpointer gitg_ui_utils_ref (gpointer instance);
VALA_EXTERN void gitg_ui_utils_unref (gpointer instance);
VALA_EXTERN GParamSpec* gitg_param_spec_ui_utils (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags);
VALA_EXTERN void gitg_value_set_ui_utils (GValue* value,
                              gpointer v_object);
VALA_EXTERN void gitg_value_take_ui_utils (GValue* value,
                               gpointer v_object);
VALA_EXTERN gpointer gitg_value_get_ui_utils (const GValue* value);
VALA_EXTERN GType gitg_ui_utils_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgUiUtils, gitg_ui_utils_unref)
VALA_EXTERN GtkDialog* gitg_ui_utils_build_dialog (GtkWindow* parent,
                                       GeeHashMap* dialog_vars,
                                       const gchar* stdout_data,
                                       const gchar* stderr_data);
VALA_EXTERN GType gitg_result_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgResultDialog, g_object_unref)
static Block99Data* block99_data_ref (Block99Data* _data99_);
static void block99_data_unref (void * _userdata_);
VALA_EXTERN GitgResultDialog* gitg_result_dialog_new (GtkWindow* parent,
                                          const gchar* title,
                                          const gchar* label_text);
VALA_EXTERN GitgResultDialog* gitg_result_dialog_construct (GType object_type,
                                                GtkWindow* parent,
                                                const gchar* title,
                                                const gchar* label_text);
static void __lambda116_ (Block99Data* _data99_,
                   GtkDialog* d,
                   gint resp);
static void ___lambda116__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
VALA_EXTERN void gitg_result_dialog_append_message (GitgResultDialog* self,
                                        const gchar* message);
VALA_EXTERN void gitg_ui_utils_add_custom_actions (GtkMenu* menu,
                                       const gchar* type,
                                       GgitConfig* config,
                                       GRegex* regex_custom_actions,
                                       GRegex* regex_custom_actions_group,
                                       GitgUiUtilsBuildMenuItem build_menu_item,
                                       gpointer build_menu_item_target);
static Block100Data* block100_data_ref (Block100Data* _data100_);
static void block100_data_unref (void * _userdata_);
static Block101Data* block101_data_ref (Block101Data* _data101_);
static void block101_data_unref (void * _userdata_);
static gint ___lambda117_ (Block101Data* _data101_,
                    GMatchInfo* match_info,
                    const gchar* val);
static gint ____lambda117__ggit_config_match_callback (GMatchInfo* match_info,
                                                const gchar* value,
                                                gpointer self);
static gint ___lambda118_ (Block101Data* _data101_,
                    GMatchInfo* match_info,
                    const gchar* val);
static gint ____lambda118__ggit_config_match_callback (GMatchInfo* match_info,
                                                const gchar* value,
                                                gpointer self);
VALA_EXTERN gchar* gitg_ui_utils_render_template (const gchar* tmpl,
                                      GeeHashMap* object_vars,
                                      GeeHashMap* dialog_vars);
VALA_EXTERN gchar* gitg_ui_utils_run_entry_dialog (GtkWindow* parent,
                                       GeeHashMap* vars);
VALA_EXTERN gchar* gitg_ui_utils_run_question_dialog (GtkWindow* parent,
                                          GeeHashMap* vars);
static gchar* gitg_ui_utils_get_config_string (GgitConfig* conf,
                                        const gchar* key,
                                        const gchar* def);
static gboolean gitg_ui_utils_get_config_bool (GgitConfig* conf,
                                        const gchar* key,
                                        gboolean def);
static void gitg_ui_utils_add_from_config (GeeHashMap* input_vars,
                                    GgitConfig* config,
                                    const gchar* prefix,
                                    const gchar* key,
                                    const gchar* def);
VALA_EXTERN GType gitg_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgWindow, g_object_unref)
VALA_EXTERN GtkMenuItem* gitg_ui_utils_build_custom_action (GitgWindow* parent,
                                                GgitConfig* conf,
                                                const gchar* action_key_prefix,
                                                GeeHashMap* groups,
                                                GitgUiUtilsBuildObjectVars build_object_vars,
                                                gpointer build_object_vars_target);
static Block102Data* block102_data_ref (Block102Data* _data102_);
static void block102_data_unref (void * _userdata_);
VALA_EXTERN GtkAccelGroup* gitg_window_get_accel_group (GitgWindow* self);
static void __lambda197_ (Block102Data* _data102_);
static void ___lambda197__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
VALA_EXTERN gchar* gitg_ui_utils_get (GeeHashMap* map,
                          const gchar* key,
                          const gchar* def);
static Block103Data* block103_data_ref (Block103Data* _data103_);
static void block103_data_unref (void * _userdata_);
static void __lambda119_ (Block103Data* _data103_);
static void ___lambda119__gtk_editable_changed (GtkEditable* _sender,
                                         gpointer self);
static gboolean ___lambda120_ (Block103Data* _data103_);
static gboolean ____lambda120__gsource_func (gpointer self);
VALA_EXTERN void gitg_ui_utils_store_visible_columns_on_gsettings (GtkTreeView* treeview);
static void _vala_array_add31 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN GtkTreeView* gitg_ui_utils_build_treeview_visible_columns (gchar** visible_columns,
                                                           gint visible_columns_length1,
                                                           GitgUiUtilsUpdateTreeViewColumnsCallBack callback,
                                                           gpointer callback_target);
static Block104Data* block104_data_ref (Block104Data* _data104_);
static void block104_data_unref (void * _userdata_);
static void ______lambda198_ (Block104Data* _data104_);
static void _______lambda198__g_object_notify (GObject* _sender,
                                        GParamSpec* pspec,
                                        gpointer self);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
static void _____lambda199_ (Block104Data* _data104_);
static void ______lambda199__g_object_notify (GObject* _sender,
                                       GParamSpec* pspec,
                                       gpointer self);
VALA_EXTERN GType gitg_drag_list_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgDragListBox, g_object_unref)
VALA_EXTERN GitgDragListBox* gitg_ui_utils_build_listbox_visible_columns (GtkTreeView* treeview);
static Block105Data* block105_data_ref (Block105Data* _data105_);
static void block105_data_unref (void * _userdata_);
VALA_EXTERN GType gitg_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgListRow, g_object_unref)
VALA_EXTERN GitgDragListBox* gitg_drag_list_box_new (GListStore* model);
VALA_EXTERN GitgDragListBox* gitg_drag_list_box_construct (GType object_type,
                                               GListStore* model);
static void __lambda161_ (Block105Data* _data105_,
                   gint from,
                   gint to);
VALA_EXTERN void gitg_ui_utils_sync_listbox_actions (GListStore* list_model,
                                         GitgDragListBox* listbox);
static void ___lambda161__gitg_drag_list_box_row_reorder (GitgDragListBox* _sender,
                                                   gint from,
                                                   gint to,
                                                   gpointer self);
static void __lambda162_ (Block105Data* _data105_,
                   guint p,
                   guint r,
                   guint a);
static void ___lambda162__g_list_model_items_changed (GListModel* _sender,
                                               guint position,
                                               guint removed,
                                               guint added,
                                               gpointer self);
VALA_EXTERN GitgListRow* gitg_list_row_new (const gchar* name,
                                GtkTreeViewColumn* col);
VALA_EXTERN GitgListRow* gitg_list_row_construct (GType object_type,
                                      const gchar* name,
                                      GtkTreeViewColumn* col);
static void __lambda163_ (Block105Data* _data105_);
VALA_EXTERN GType gitg_list_box_row_dn_d_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgListBoxRowDnD, g_object_unref)
VALA_EXTERN const gchar* gitg_list_box_row_dn_d_get_title (GitgListBoxRowDnD* self);
static void ___lambda163__gtk_tree_view_columns_changed (GtkTreeView* _sender,
                                                  gpointer self);
VALA_EXTERN GtkBox* gitg_ui_utils_build_switch_show_headers (GtkTreeView* treeview);
static Block106Data* block106_data_ref (Block106Data* _data106_);
static void block106_data_unref (void * _userdata_);
static gboolean __lambda166_ (Block106Data* _data106_,
                       gboolean state);
static gboolean ___lambda166__gtk_switch_state_set (GtkSwitch* _sender,
                                             gboolean state,
                                             gpointer self);
VALA_EXTERN void gitg_ui_utils_sync_row_actions (GListStore* list_model,
                                     GitgListBoxRowDnD* row,
                                     gint pos);
VALA_EXTERN void gitg_list_box_row_dn_d_enable_up (GitgListBoxRowDnD* self,
                                       gboolean flag);
VALA_EXTERN void gitg_list_box_row_dn_d_enable_down (GitgListBoxRowDnD* self,
                                         gboolean flag);
VALA_EXTERN GitgUiUtils* gitg_ui_utils_new (void);
VALA_EXTERN GitgUiUtils* gitg_ui_utils_construct (GType object_type);
static void gitg_ui_utils_finalize (GitgUiUtils * obj);
static GType gitg_ui_utils_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static Block99Data*
block99_data_ref (Block99Data* _data99_)
{
	g_atomic_int_inc (&_data99_->_ref_count_);
	return _data99_;
}

static void
block99_data_unref (void * _userdata_)
{
	Block99Data* _data99_;
	_data99_ = (Block99Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data99_->_ref_count_)) {
		_g_object_unref0 (_data99_->dlg);
		g_slice_free (Block99Data, _data99_);
	}
}

static void
__lambda116_ (Block99Data* _data99_,
              GtkDialog* d,
              gint resp)
{
	g_return_if_fail (d != NULL);
	gtk_widget_destroy ((GtkWidget*) _data99_->dlg);
}

static void
___lambda116__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda116_ (self, _sender, response_id);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

GtkDialog*
gitg_ui_utils_build_dialog (GtkWindow* parent,
                            GeeHashMap* dialog_vars,
                            const gchar* stdout_data,
                            const gchar* stderr_data)
{
	Block99Data* _data99_;
	gpointer _tmp0_;
	gchar* _tmp1_;
	gpointer _tmp2_;
	gchar* _tmp3_;
	GitgResultDialog* _tmp4_;
	GitgResultDialog* _tmp5_;
	GtkDialog* _tmp6_;
	GtkDialog* result;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (dialog_vars != NULL, NULL);
	_data99_ = g_slice_new0 (Block99Data);
	_data99_->_ref_count_ = 1;
	_tmp0_ = gee_abstract_map_get ((GeeAbstractMap*) dialog_vars, "dialog-title");
	_tmp1_ = (gchar*) _tmp0_;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) dialog_vars, "dialog-label");
	_tmp3_ = (gchar*) _tmp2_;
	_tmp4_ = gitg_result_dialog_new (parent, _tmp1_, _tmp3_);
	g_object_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	_data99_->dlg = _tmp5_;
	g_signal_connect_data ((GtkDialog*) _data99_->dlg, "response", (GCallback) ___lambda116__gtk_dialog_response, block99_data_ref (_data99_), (GClosureNotify) block99_data_unref, 0);
	gitg_result_dialog_append_message (_data99_->dlg, stdout_data);
	gitg_result_dialog_append_message (_data99_->dlg, stderr_data);
	_tmp6_ = _g_object_ref0 ((GtkDialog*) _data99_->dlg);
	result = _tmp6_;
	block99_data_unref (_data99_);
	_data99_ = NULL;
	return result;
}

static Block100Data*
block100_data_ref (Block100Data* _data100_)
{
	g_atomic_int_inc (&_data100_->_ref_count_);
	return _data100_;
}

static void
block100_data_unref (void * _userdata_)
{
	Block100Data* _data100_;
	_data100_ = (Block100Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data100_->_ref_count_)) {
		_g_object_unref0 (_data100_->menu);
		_g_free0 (_data100_->type);
		g_slice_free (Block100Data, _data100_);
	}
}

static Block101Data*
block101_data_ref (Block101Data* _data101_)
{
	g_atomic_int_inc (&_data101_->_ref_count_);
	return _data101_;
}

static void
block101_data_unref (void * _userdata_)
{
	Block101Data* _data101_;
	_data101_ = (Block101Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data101_->_ref_count_)) {
		_g_object_unref0 (_data101_->item_groups);
		block100_data_unref (_data101_->_data100_);
		_data101_->_data100_ = NULL;
		g_slice_free (Block101Data, _data101_);
	}
}

static gint
___lambda117_ (Block101Data* _data101_,
               GMatchInfo* match_info,
               const gchar* val)
{
	Block100Data* _data100_;
	GeeHashMap* _tmp0_;
	gint result;
	_data100_ = _data101_->_data100_;
	g_return_val_if_fail (match_info != NULL, -1);
	g_return_val_if_fail (val != NULL, -1);
	_tmp0_ = _data101_->item_groups;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, val)) {
		GtkMenuItem* item_group = NULL;
		GtkMenuItem* _tmp1_;
		GeeHashMap* _tmp2_;
		GtkMenuItem* _tmp3_;
		_tmp1_ = (GtkMenuItem*) gtk_menu_item_new_with_label (val);
		g_object_ref_sink (_tmp1_);
		item_group = _tmp1_;
		_tmp2_ = _data101_->item_groups;
		_tmp3_ = item_group;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp2_, val, _tmp3_);
		_g_object_unref0 (item_group);
	}
	result = 0;
	return result;
}

static gint
____lambda117__ggit_config_match_callback (GMatchInfo* match_info,
                                           const gchar* value,
                                           gpointer self)
{
	gint result;
	result = ___lambda117_ (self, match_info, value);
	return result;
}

static gint
___lambda118_ (Block101Data* _data101_,
               GMatchInfo* match_info,
               const gchar* val)
{
	Block100Data* _data100_;
	gchar* group = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* custom_link_regexp = NULL;
	gchar* _tmp2_;
	gchar* action_key_prefix = NULL;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GError* _inner_error0_ = NULL;
	gint result;
	_data100_ = _data101_->_data100_;
	g_return_val_if_fail (match_info != NULL, -1);
	g_return_val_if_fail (val != NULL, -1);
	_tmp0_ = g_match_info_fetch (match_info, 1);
	group = _tmp0_;
	_tmp1_ = group;
	g_debug ("gitg-ui-utils.vala:63: found custom action group: %s", _tmp1_);
	_tmp2_ = g_strdup (val);
	custom_link_regexp = _tmp2_;
	g_debug ("gitg-ui-utils.vala:65: found custom action value: %s", val);
	_tmp3_ = group;
	_tmp4_ = g_strdup_printf ("gitg.actions.%s.%s.", _data100_->type, _tmp3_);
	action_key_prefix = _tmp4_;
	{
		GtkMenuItem* item = NULL;
		const gchar* _tmp5_;
		GeeHashMap* _tmp6_;
		GtkMenuItem* _tmp7_;
		GtkMenuItem* _tmp8_;
		_tmp5_ = action_key_prefix;
		_tmp6_ = _data101_->item_groups;
		_tmp7_ = _data100_->build_menu_item (_tmp5_, _tmp6_, _data100_->build_menu_item_target);
		item = _tmp7_;
		_tmp8_ = item;
		if (_tmp8_ != NULL) {
			GtkMenuItem* _tmp9_;
			GtkMenuItem* _tmp10_;
			gint items = 0;
			gconstpointer _tmp11_;
			gint _tmp12_;
			_tmp9_ = item;
			gtk_widget_show ((GtkWidget*) _tmp9_);
			_tmp10_ = item;
			gtk_menu_shell_append ((GtkMenuShell*) _data100_->menu, _tmp10_);
			_tmp11_ = g_object_get_data ((GObject*) _data100_->menu, "items");
			items = (gint) ((gintptr) _tmp11_);
			items = items + 1;
			_tmp12_ = items;
			g_object_set_data_full ((GObject*) _data100_->menu, "items", (gpointer) ((gintptr) _tmp12_), NULL);
		}
		_g_object_unref0 (item);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		g_warning ("gitg-ui-utils.vala:78: Cannot read git config: %s", _tmp14_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gint _tmp15_ = -1;
		_g_free0 (action_key_prefix);
		_g_free0 (custom_link_regexp);
		_g_free0 (group);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp15_;
	}
	result = 0;
	_g_free0 (action_key_prefix);
	_g_free0 (custom_link_regexp);
	_g_free0 (group);
	return result;
}

static gint
____lambda118__ggit_config_match_callback (GMatchInfo* match_info,
                                           const gchar* value,
                                           gpointer self)
{
	gint result;
	result = ___lambda118_ (self, match_info, value);
	return result;
}

void
gitg_ui_utils_add_custom_actions (GtkMenu* menu,
                                  const gchar* type,
                                  GgitConfig* config,
                                  GRegex* regex_custom_actions,
                                  GRegex* regex_custom_actions_group,
                                  GitgUiUtilsBuildMenuItem build_menu_item,
                                  gpointer build_menu_item_target)
{
	Block100Data* _data100_;
	GtkMenu* _tmp0_;
	gchar* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (menu != NULL);
	g_return_if_fail (type != NULL);
	g_return_if_fail (config != NULL);
	g_return_if_fail (regex_custom_actions != NULL);
	g_return_if_fail (regex_custom_actions_group != NULL);
	_data100_ = g_slice_new0 (Block100Data);
	_data100_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (menu);
	_g_object_unref0 (_data100_->menu);
	_data100_->menu = _tmp0_;
	_tmp1_ = g_strdup (type);
	_g_free0 (_data100_->type);
	_data100_->type = _tmp1_;
	_data100_->build_menu_item = build_menu_item;
	_data100_->build_menu_item_target = build_menu_item_target;
	g_object_set_data_full ((GObject*) _data100_->menu, "items", (gpointer) ((gintptr) 0), NULL);
	{
		Block101Data* _data101_;
		GeeHashMap* _tmp2_;
		GRegex* _tmp3_;
		_data101_ = g_slice_new0 (Block101Data);
		_data101_->_ref_count_ = 1;
		_data101_->_data100_ = block100_data_ref (_data100_);
		_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, gtk_menu_item_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_data101_->item_groups = _tmp2_;
		ggit_config_match_foreach (config, regex_custom_actions_group, ____lambda117__ggit_config_match_callback, _data101_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			block101_data_unref (_data101_);
			_data101_ = NULL;
			goto __catch0_g_error;
		}
		_tmp3_ = regex_custom_actions;
		ggit_config_match_foreach (config, _tmp3_, ____lambda118__ggit_config_match_callback, _data101_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			block101_data_unref (_data101_);
			_data101_ = NULL;
			goto __catch0_g_error;
		}
		{
			GeeIterator* _item_it = NULL;
			GeeHashMap* _tmp4_;
			GeeCollection* _tmp5_;
			GeeCollection* _tmp6_;
			GeeCollection* _tmp7_;
			GeeIterator* _tmp8_;
			GeeIterator* _tmp9_;
			_tmp4_ = _data101_->item_groups;
			_tmp5_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_);
			_tmp9_ = _tmp8_;
			_g_object_unref0 (_tmp7_);
			_item_it = _tmp9_;
			while (TRUE) {
				GeeIterator* _tmp10_;
				GtkMenuItem* item = NULL;
				GeeIterator* _tmp11_;
				gpointer _tmp12_;
				GtkMenuItem* _tmp13_;
				gconstpointer _tmp14_;
				_tmp10_ = _item_it;
				if (!gee_iterator_next (_tmp10_)) {
					break;
				}
				_tmp11_ = _item_it;
				_tmp12_ = gee_iterator_get (_tmp11_);
				item = (GtkMenuItem*) _tmp12_;
				_tmp13_ = item;
				_tmp14_ = g_object_get_data ((GObject*) _tmp13_, "items");
				if (((gint) ((gintptr) _tmp14_)) > 0) {
					GtkMenuItem* _tmp15_;
					gint items = 0;
					gconstpointer _tmp16_;
					gint _tmp17_;
					GtkMenuItem* _tmp18_;
					_tmp15_ = item;
					gtk_menu_shell_append ((GtkMenuShell*) _data100_->menu, _tmp15_);
					_tmp16_ = g_object_get_data ((GObject*) _data100_->menu, "items");
					items = (gint) ((gintptr) _tmp16_);
					items = items + 1;
					_tmp17_ = items;
					g_object_set_data_full ((GObject*) _data100_->menu, "items", (gpointer) ((gintptr) _tmp17_), NULL);
					_tmp18_ = item;
					gtk_widget_show ((GtkWidget*) _tmp18_);
				}
				_g_object_unref0 (item);
			}
			_g_object_unref0 (_item_it);
		}
		block101_data_unref (_data101_);
		_data101_ = NULL;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = e;
		_tmp20_ = _tmp19_->message;
		g_warning ("gitg-ui-utils.vala:93: Cannot read git config: %s", _tmp20_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		block100_data_unref (_data100_);
		_data100_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	block100_data_unref (_data100_);
	_data100_ = NULL;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

gchar*
gitg_ui_utils_render_template (const gchar* tmpl,
                               GeeHashMap* object_vars,
                               GeeHashMap* dialog_vars)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* placeholder = NULL;
	gchar* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	gchar* result;
	g_return_val_if_fail (tmpl != NULL, NULL);
	g_return_val_if_fail (object_vars != NULL, NULL);
	g_return_val_if_fail (dialog_vars != NULL, NULL);
	_tmp0_ = g_strdup (tmpl);
	_result_ = _tmp0_;
	{
		GeeIterator* _k_it = NULL;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) object_vars);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_k_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gchar* k = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			gchar* placeholder = NULL;
			const gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			gchar* val = NULL;
			const gchar* _tmp14_;
			gpointer _tmp15_;
			const gchar* _tmp16_;
			gchar* tmp = NULL;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			gchar* _tmp20_;
			const gchar* _tmp21_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			gchar* _tmp29_;
			const gchar* _tmp30_;
			_tmp6_ = _k_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _k_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			k = (gchar*) _tmp8_;
			_tmp9_ = k;
			_tmp10_ = g_strconcat ("${", _tmp9_, NULL);
			_tmp11_ = _tmp10_;
			_tmp12_ = g_strconcat (_tmp11_, "}", NULL);
			_tmp13_ = _tmp12_;
			_g_free0 (_tmp11_);
			placeholder = _tmp13_;
			_tmp14_ = k;
			_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) object_vars, _tmp14_);
			val = (gchar*) _tmp15_;
			_tmp16_ = val;
			if (_tmp16_ == NULL) {
				_g_free0 (val);
				_g_free0 (placeholder);
				_g_free0 (k);
				continue;
			}
			_tmp17_ = _result_;
			_tmp18_ = placeholder;
			_tmp19_ = val;
			_tmp20_ = string_replace (_tmp17_, _tmp18_, _tmp19_);
			tmp = _tmp20_;
			_tmp21_ = tmp;
			if (_tmp21_ != NULL) {
				const gchar* _tmp22_;
				gchar* _tmp23_;
				_tmp22_ = tmp;
				_tmp23_ = g_strdup (_tmp22_);
				_g_free0 (_result_);
				_result_ = _tmp23_;
			}
			_tmp24_ = k;
			_tmp25_ = g_strconcat ("$", _tmp24_, NULL);
			_g_free0 (placeholder);
			placeholder = _tmp25_;
			_tmp26_ = _result_;
			_tmp27_ = placeholder;
			_tmp28_ = val;
			_tmp29_ = string_replace (_tmp26_, _tmp27_, _tmp28_);
			_g_free0 (tmp);
			tmp = _tmp29_;
			_tmp30_ = tmp;
			if (_tmp30_ != NULL) {
				const gchar* _tmp31_;
				gchar* _tmp32_;
				_tmp31_ = tmp;
				_tmp32_ = g_strdup (_tmp31_);
				_g_free0 (_result_);
				_result_ = _tmp32_;
			}
			_g_free0 (tmp);
			_g_free0 (val);
			_g_free0 (placeholder);
			_g_free0 (k);
		}
		_g_object_unref0 (_k_it);
	}
	_tmp33_ = g_strdup ("$input");
	placeholder = _tmp33_;
	_tmp34_ = _result_;
	_tmp35_ = placeholder;
	if (string_contains (_tmp34_, _tmp35_)) {
		gchar* replacement = NULL;
		gchar* _tmp36_;
		const gchar* _tmp37_;
		_tmp36_ = gitg_ui_utils_run_entry_dialog (NULL, dialog_vars);
		replacement = _tmp36_;
		_tmp37_ = replacement;
		if (_tmp37_ != NULL) {
			gchar* tmp = NULL;
			const gchar* _tmp38_;
			const gchar* _tmp39_;
			const gchar* _tmp40_;
			gchar* _tmp41_;
			const gchar* _tmp42_;
			_tmp38_ = _result_;
			_tmp39_ = placeholder;
			_tmp40_ = replacement;
			_tmp41_ = string_replace (_tmp38_, _tmp39_, _tmp40_);
			tmp = _tmp41_;
			_tmp42_ = tmp;
			if (_tmp42_ != NULL) {
				const gchar* _tmp43_;
				gchar* _tmp44_;
				_tmp43_ = tmp;
				_tmp44_ = g_strdup (_tmp43_);
				_g_free0 (_result_);
				_result_ = _tmp44_;
			}
			_g_free0 (tmp);
		} else {
			_g_free0 (_result_);
			_result_ = NULL;
		}
		_g_free0 (replacement);
	}
	_tmp45_ = g_strdup ("$question");
	_g_free0 (placeholder);
	placeholder = _tmp45_;
	_tmp46_ = _result_;
	_tmp47_ = placeholder;
	if (string_contains (_tmp46_, _tmp47_)) {
		gchar* replacement = NULL;
		gchar* _tmp48_;
		const gchar* _tmp49_;
		_tmp48_ = gitg_ui_utils_run_question_dialog (NULL, dialog_vars);
		replacement = _tmp48_;
		_tmp49_ = replacement;
		if (_tmp49_ != NULL) {
			gchar* tmp = NULL;
			const gchar* _tmp50_;
			const gchar* _tmp51_;
			const gchar* _tmp52_;
			gchar* _tmp53_;
			const gchar* _tmp54_;
			_tmp50_ = _result_;
			_tmp51_ = placeholder;
			_tmp52_ = replacement;
			_tmp53_ = string_replace (_tmp50_, _tmp51_, _tmp52_);
			tmp = _tmp53_;
			_tmp54_ = tmp;
			if (_tmp54_ != NULL) {
				const gchar* _tmp55_;
				gchar* _tmp56_;
				_tmp55_ = tmp;
				_tmp56_ = g_strdup (_tmp55_);
				_g_free0 (_result_);
				_result_ = _tmp56_;
			}
			_g_free0 (tmp);
		} else {
			_g_free0 (_result_);
			_result_ = NULL;
		}
		_g_free0 (replacement);
	}
	result = _result_;
	_g_free0 (placeholder);
	return result;
}

static gchar*
gitg_ui_utils_get_config_string (GgitConfig* conf,
                                 const gchar* key,
                                 const gchar* def)
{
	gchar* val = NULL;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (conf != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	{
		const gchar* _tmp0_ = NULL;
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = ggit_config_get_string (conf, key, &_inner_error0_);
		_tmp0_ = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = g_strdup (_tmp0_);
		_g_free0 (val);
		val = _tmp2_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp3_;
		g_clear_error (&_inner_error0_);
		_tmp3_ = g_strdup (def);
		_g_free0 (val);
		val = _tmp3_;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (val);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = val;
	return result;
}

static gboolean
gitg_ui_utils_get_config_bool (GgitConfig* conf,
                               const gchar* key,
                               gboolean def)
{
	gboolean val = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (conf != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = ggit_config_get_bool (conf, key, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		val = _tmp0_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		val = def;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp1_ = FALSE;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp1_;
	}
	result = val;
	return result;
}

static void
gitg_ui_utils_add_from_config (GeeHashMap* input_vars,
                               GgitConfig* config,
                               const gchar* prefix,
                               const gchar* key,
                               const gchar* def)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (input_vars != NULL);
	g_return_if_fail (config != NULL);
	g_return_if_fail (prefix != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = g_strconcat (prefix, key, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = gitg_ui_utils_get_config_string (config, _tmp1_, def);
	_tmp3_ = _tmp2_;
	gee_abstract_map_set ((GeeAbstractMap*) input_vars, key, _tmp3_);
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
}

static Block102Data*
block102_data_ref (Block102Data* _data102_)
{
	g_atomic_int_inc (&_data102_->_ref_count_);
	return _data102_;
}

static void
block102_data_unref (void * _userdata_)
{
	Block102Data* _data102_;
	_data102_ = (Block102Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data102_->_ref_count_)) {
		_g_object_unref0 (_data102_->object_vars);
		_g_object_unref0 (_data102_->dialog_vars);
		_g_free0 (_data102_->command);
		_g_object_unref0 (_data102_->parent);
		g_slice_free (Block102Data, _data102_);
	}
}

static void
__lambda197_ (Block102Data* _data102_)
{
	gchar* cmd = NULL;
	const gchar* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gint exit_status = 0;
	gchar* stdout_data = NULL;
	gchar* stderr_data = NULL;
	gboolean spawned = FALSE;
	const gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	gboolean _tmp9_;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp20_ = FALSE;
	GError* _inner_error0_ = NULL;
	_tmp0_ = _data102_->command;
	_tmp1_ = _data102_->object_vars;
	_tmp2_ = _data102_->dialog_vars;
	_tmp3_ = gitg_ui_utils_render_template (_tmp0_, _tmp1_, _tmp2_);
	cmd = _tmp3_;
	_tmp4_ = cmd;
	if (_tmp4_ == NULL) {
		_g_free0 (cmd);
		return;
	}
	_tmp5_ = cmd;
	_tmp9_ = g_spawn_command_line_sync (_tmp5_, &_tmp6_, &_tmp7_, &_tmp8_, &_inner_error0_);
	_g_free0 (stdout_data);
	stdout_data = _tmp6_;
	_g_free0 (stderr_data);
	stderr_data = _tmp7_;
	exit_status = _tmp8_;
	spawned = _tmp9_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (stderr_data);
		_g_free0 (stdout_data);
		_g_free0 (cmd);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	if (!spawned) {
		FILE* _tmp10_;
		const gchar* _tmp11_;
		_tmp10_ = stderr;
		_tmp11_ = stderr_data;
		fprintf (_tmp10_, "Failed to start command: %s\n", _tmp11_);
		_g_free0 (stderr_data);
		_g_free0 (stdout_data);
		_g_free0 (cmd);
		return;
	}
	if (_data102_->show_output) {
		const gchar* _tmp13_;
		_tmp13_ = stdout_data;
		_tmp12_ = _tmp13_ != NULL;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		FILE* _tmp14_;
		const gchar* _tmp15_;
		GtkDialog* dlg = NULL;
		GeeHashMap* _tmp16_;
		const gchar* _tmp17_;
		GtkDialog* _tmp18_;
		GtkDialog* _tmp19_;
		_tmp14_ = stdout;
		_tmp15_ = stdout_data;
		fprintf (_tmp14_, "%s", _tmp15_);
		_tmp16_ = _data102_->dialog_vars;
		_tmp17_ = stdout_data;
		_tmp18_ = gitg_ui_utils_build_dialog ((GtkWindow*) _data102_->parent, _tmp16_, _tmp17_, NULL);
		dlg = _tmp18_;
		_tmp19_ = dlg;
		gtk_widget_show ((GtkWidget*) _tmp19_);
		_g_object_unref0 (dlg);
	}
	if (exit_status != 0) {
		_tmp20_ = _data102_->show_error;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		FILE* _tmp21_;
		const gchar* _tmp22_;
		FILE* _tmp23_;
		const gchar* _tmp24_;
		GtkDialog* dlg = NULL;
		GeeHashMap* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		GtkDialog* _tmp28_;
		GtkDialog* _tmp29_;
		_tmp21_ = stdout;
		_tmp22_ = stdout_data;
		fprintf (_tmp21_, "%s", _tmp22_);
		_tmp23_ = stdout;
		_tmp24_ = stderr_data;
		fprintf (_tmp23_, "%s", _tmp24_);
		_tmp25_ = _data102_->dialog_vars;
		_tmp26_ = stdout_data;
		_tmp27_ = stderr_data;
		_tmp28_ = gitg_ui_utils_build_dialog ((GtkWindow*) _data102_->parent, _tmp25_, _tmp26_, _tmp27_);
		dlg = _tmp28_;
		_tmp29_ = dlg;
		gtk_widget_show ((GtkWidget*) _tmp29_);
		_g_object_unref0 (dlg);
	}
	_g_free0 (stderr_data);
	_g_free0 (stdout_data);
	_g_free0 (cmd);
}

static void
___lambda197__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	__lambda197_ (self);
}

GtkMenuItem*
gitg_ui_utils_build_custom_action (GitgWindow* parent,
                                   GgitConfig* conf,
                                   const gchar* action_key_prefix,
                                   GeeHashMap* groups,
                                   GitgUiUtilsBuildObjectVars build_object_vars,
                                   gpointer build_object_vars_target)
{
	Block102Data* _data102_;
	GitgWindow* _tmp0_;
	gchar* name = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* description = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* available = NULL;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* enabled = NULL;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* shortcut = NULL;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gboolean _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gboolean _tmp30_;
	GeeHashMap* _tmp31_;
	GeeHashMap* _tmp32_;
	GeeHashMap* _tmp33_;
	GeeHashMap* _tmp34_;
	GeeHashMap* _tmp35_;
	GeeHashMap* _tmp36_;
	GeeHashMap* _tmp37_;
	GeeHashMap* _tmp38_;
	GeeHashMap* _tmp39_;
	GeeHashMap* _tmp40_;
	GeeHashMap* _tmp41_;
	gpointer _tmp42_;
	gchar* _tmp43_;
	gboolean _tmp44_;
	GeeHashMap* _tmp68_;
	GeeHashMap* _tmp69_;
	GeeHashMap* _tmp70_;
	GeeHashMap* _tmp71_;
	GeeHashMap* _tmp72_;
	GeeHashMap* _tmp73_;
	const gchar* _tmp78_;
	GtkMenuItem* item = NULL;
	const gchar* _tmp96_;
	GtkMenuItem* _tmp97_;
	gboolean enabled_is_flag = FALSE;
	gboolean _tmp102_ = FALSE;
	GtkMenuItem* item_result = NULL;
	GtkMenuItem* _tmp120_;
	GtkMenuItem* _tmp121_;
	GtkMenuItem* _tmp147_;
	const gchar* _tmp148_;
	const gchar* _tmp149_;
	GtkMenuItem* _tmp156_;
	GError* _inner_error0_ = NULL;
	GtkMenuItem* result;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (conf != NULL, NULL);
	g_return_val_if_fail (action_key_prefix != NULL, NULL);
	g_return_val_if_fail (groups != NULL, NULL);
	_data102_ = g_slice_new0 (Block102Data);
	_data102_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data102_->parent);
	_data102_->parent = _tmp0_;
	_tmp1_ = g_strconcat (action_key_prefix, "name", NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = gitg_ui_utils_get_config_string (conf, _tmp2_, "");
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	name = _tmp4_;
	_tmp5_ = g_strconcat (action_key_prefix, "description", NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = gitg_ui_utils_get_config_string (conf, _tmp6_, "");
	_tmp8_ = _tmp7_;
	_g_free0 (_tmp6_);
	description = _tmp8_;
	_tmp9_ = g_strconcat (action_key_prefix, "command", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = gitg_ui_utils_get_config_string (conf, _tmp10_, "");
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	_data102_->command = _tmp12_;
	_tmp13_ = g_strconcat (action_key_prefix, "available", NULL);
	_tmp14_ = _tmp13_;
	_tmp15_ = gitg_ui_utils_get_config_string (conf, _tmp14_, "");
	_tmp16_ = _tmp15_;
	_g_free0 (_tmp14_);
	available = _tmp16_;
	_tmp17_ = g_strconcat (action_key_prefix, "enabled", NULL);
	_tmp18_ = _tmp17_;
	_tmp19_ = gitg_ui_utils_get_config_string (conf, _tmp18_, "");
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp18_);
	enabled = _tmp20_;
	_tmp21_ = g_strconcat (action_key_prefix, "shortcut", NULL);
	_tmp22_ = _tmp21_;
	_tmp23_ = gitg_ui_utils_get_config_string (conf, _tmp22_, NULL);
	_tmp24_ = _tmp23_;
	_g_free0 (_tmp22_);
	shortcut = _tmp24_;
	_tmp25_ = g_strconcat (action_key_prefix, "show-output", NULL);
	_tmp26_ = _tmp25_;
	_tmp27_ = gitg_ui_utils_get_config_bool (conf, _tmp26_, FALSE);
	_g_free0 (_tmp26_);
	_data102_->show_output = _tmp27_;
	_tmp28_ = g_strconcat (action_key_prefix, "show-error", NULL);
	_tmp29_ = _tmp28_;
	_tmp30_ = gitg_ui_utils_get_config_bool (conf, _tmp29_, TRUE);
	_g_free0 (_tmp29_);
	_data102_->show_error = _tmp30_;
	_tmp31_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_data102_->dialog_vars = _tmp31_;
	_tmp32_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp32_, conf, action_key_prefix, "dialog-title", _ ("Output"));
	_tmp33_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp33_, conf, action_key_prefix, "dialog-label", _ ("Results:"));
	_tmp34_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp34_, conf, action_key_prefix, "input-title", _ ("Input"));
	_tmp35_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp35_, conf, action_key_prefix, "input-label", _ ("Value:"));
	_tmp36_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp36_, conf, action_key_prefix, "input-placeholder", NULL);
	_tmp37_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp37_, conf, action_key_prefix, "input-text", NULL);
	_tmp38_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp38_, conf, action_key_prefix, "input-yes", NULL);
	_tmp39_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp39_, conf, action_key_prefix, "input-no", NULL);
	_tmp40_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp40_, conf, action_key_prefix, "input-history", "false");
	_tmp41_ = _data102_->dialog_vars;
	_tmp42_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp41_, "input-history");
	_tmp43_ = (gchar*) _tmp42_;
	_tmp44_ = g_strcmp0 ("false", _tmp43_) == 0;
	_g_free0 (_tmp43_);
	if (_tmp44_) {
		GeeHashMap* _tmp45_;
		_tmp45_ = _data102_->dialog_vars;
		gee_map_remove ((GeeMap*) _tmp45_, "input-history", NULL);
	} else {
		gchar* input_history_path = NULL;
		GeeHashMap* _tmp46_;
		gpointer _tmp47_;
		const gchar* _tmp48_;
		gchar* group = NULL;
		gchar* _tmp50_;
		gchar* _tmp51_;
		gchar* _tmp52_;
		gchar* _tmp53_;
		const gchar* _tmp54_;
		const gchar* _tmp55_;
		gchar* _tmp56_;
		gchar* _tmp57_;
		gchar* _tmp58_;
		const gchar* _tmp59_;
		const gchar* _tmp60_;
		gchar* _tmp61_;
		gchar* _tmp62_;
		gchar* _tmp63_;
		GeeHashMap* _tmp64_;
		const gchar* _tmp65_;
		gchar* _tmp66_;
		gchar* _tmp67_;
		_tmp46_ = _data102_->dialog_vars;
		_tmp47_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp46_, "input-history");
		input_history_path = (gchar*) _tmp47_;
		_tmp48_ = input_history_path;
		if (g_strcmp0 ("true", _tmp48_) == 0) {
			gchar* _tmp49_;
			_tmp49_ = g_strdup ("~/.config/gitg/history/$group.$name");
			_g_free0 (input_history_path);
			input_history_path = _tmp49_;
		}
		_tmp50_ = g_strconcat (action_key_prefix, "group", NULL);
		_tmp51_ = _tmp50_;
		_tmp52_ = gitg_ui_utils_get_config_string (conf, _tmp51_, "");
		_tmp53_ = _tmp52_;
		_g_free0 (_tmp51_);
		group = _tmp53_;
		_tmp54_ = input_history_path;
		_tmp55_ = group;
		_tmp56_ = g_utf8_strdown (_tmp55_, (gssize) -1);
		_tmp57_ = _tmp56_;
		_tmp58_ = string_replace (_tmp54_, "$group.", _tmp57_);
		_g_free0 (input_history_path);
		input_history_path = _tmp58_;
		_g_free0 (_tmp57_);
		_tmp59_ = input_history_path;
		_tmp60_ = name;
		_tmp61_ = g_utf8_strdown (_tmp60_, (gssize) -1);
		_tmp62_ = _tmp61_;
		_tmp63_ = string_replace (_tmp59_, "$name", _tmp62_);
		_g_free0 (input_history_path);
		input_history_path = _tmp63_;
		_g_free0 (_tmp62_);
		_tmp64_ = _data102_->dialog_vars;
		_tmp65_ = input_history_path;
		_tmp66_ = gitg_utils_expand_home_dir (_tmp65_);
		_tmp67_ = _tmp66_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp64_, "input-history", _tmp67_);
		_g_free0 (_tmp67_);
		_g_free0 (group);
		_g_free0 (input_history_path);
	}
	_tmp68_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp68_, conf, action_key_prefix, "question-title", _ ("Question"));
	_tmp69_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp69_, conf, action_key_prefix, "question-message", _ ("Are you sure?"));
	_tmp70_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp70_, conf, action_key_prefix, "question-yes", NULL);
	_tmp71_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp71_, conf, action_key_prefix, "question-no", NULL);
	_tmp72_ = _data102_->dialog_vars;
	gitg_ui_utils_add_from_config (_tmp72_, conf, action_key_prefix, "question-level", NULL);
	_tmp73_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_data102_->object_vars = _tmp73_;
	if (build_object_vars != NULL) {
		GeeHashMap* _tmp74_;
		_tmp74_ = build_object_vars (build_object_vars_target);
		_g_object_unref0 (_data102_->object_vars);
		_data102_->object_vars = _tmp74_;
	}
	{
		gboolean available_flag = FALSE;
		gchar* _tmp75_;
		gchar* _tmp76_;
		gboolean _tmp77_;
		_tmp75_ = g_strconcat (action_key_prefix, "available", NULL);
		_tmp76_ = _tmp75_;
		_tmp77_ = ggit_config_get_bool (conf, _tmp76_, &_inner_error0_);
		_g_free0 (_tmp76_);
		available_flag = _tmp77_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!available_flag) {
			result = NULL;
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			return result;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (shortcut);
		_g_free0 (enabled);
		_g_free0 (available);
		_g_free0 (description);
		_g_free0 (name);
		block102_data_unref (_data102_);
		_data102_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp78_ = available;
	if (g_strcmp0 (_tmp78_, "") != 0) {
		gchar* available_command = NULL;
		const gchar* _tmp79_;
		GeeHashMap* _tmp80_;
		GeeHashMap* _tmp81_;
		gchar* _tmp82_;
		const gchar* _tmp83_;
		gint exit_status = 0;
		gchar* stdout_data = NULL;
		gchar* stderr_data = NULL;
		gboolean spawned = FALSE;
		const gchar* _tmp84_;
		gchar* _tmp85_ = NULL;
		gchar* _tmp86_ = NULL;
		gint _tmp87_ = 0;
		gboolean _tmp88_;
		_tmp79_ = available;
		_tmp80_ = _data102_->object_vars;
		_tmp81_ = _data102_->dialog_vars;
		_tmp82_ = gitg_ui_utils_render_template (_tmp79_, _tmp80_, _tmp81_);
		available_command = _tmp82_;
		_tmp83_ = available_command;
		if (_tmp83_ == NULL) {
			result = NULL;
			_g_free0 (available_command);
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			return result;
		}
		_tmp84_ = available_command;
		_tmp88_ = g_spawn_command_line_sync (_tmp84_, &_tmp85_, &_tmp86_, &_tmp87_, &_inner_error0_);
		_g_free0 (stdout_data);
		stdout_data = _tmp85_;
		_g_free0 (stderr_data);
		stderr_data = _tmp86_;
		exit_status = _tmp87_;
		spawned = _tmp88_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (stderr_data);
			_g_free0 (stdout_data);
			_g_free0 (available_command);
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		if (!spawned) {
			FILE* _tmp89_;
			const gchar* _tmp90_;
			const gchar* _tmp91_;
			_tmp89_ = stderr;
			_tmp90_ = name;
			_tmp91_ = stderr_data;
			fprintf (_tmp89_, "Failed to check available action %s\n: %s\n", _tmp90_, _tmp91_);
			result = NULL;
			_g_free0 (stderr_data);
			_g_free0 (stdout_data);
			_g_free0 (available_command);
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			return result;
		}
		if (exit_status != 0) {
			result = NULL;
			_g_free0 (stderr_data);
			_g_free0 (stdout_data);
			_g_free0 (available_command);
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			return result;
		}
		_g_free0 (stderr_data);
		_g_free0 (stdout_data);
		_g_free0 (available_command);
	} else {
		gboolean available_flag = FALSE;
		available_flag = FALSE;
		{
			gboolean _tmp92_ = FALSE;
			gchar* _tmp93_;
			gchar* _tmp94_;
			gboolean _tmp95_;
			_tmp93_ = g_strconcat (action_key_prefix, "available", NULL);
			_tmp94_ = _tmp93_;
			_tmp95_ = ggit_config_get_bool (conf, _tmp94_, &_inner_error0_);
			_g_free0 (_tmp94_);
			_tmp92_ = _tmp95_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			available_flag = _tmp92_;
		}
		goto __finally1;
		__catch1_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		if (!available_flag) {
			result = NULL;
			_g_free0 (shortcut);
			_g_free0 (enabled);
			_g_free0 (available);
			_g_free0 (description);
			_g_free0 (name);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			return result;
		}
	}
	_tmp96_ = name;
	_tmp97_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp96_);
	g_object_ref_sink (_tmp97_);
	item = _tmp97_;
	enabled_is_flag = FALSE;
	{
		gboolean enabled_flag = FALSE;
		gchar* _tmp98_;
		gchar* _tmp99_;
		gboolean _tmp100_;
		_tmp98_ = g_strconcat (action_key_prefix, "enabled", NULL);
		_tmp99_ = _tmp98_;
		_tmp100_ = ggit_config_get_bool (conf, _tmp99_, &_inner_error0_);
		_g_free0 (_tmp99_);
		enabled_flag = _tmp100_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch2_g_error;
		}
		if (!enabled_flag) {
			GtkMenuItem* _tmp101_;
			_tmp101_ = item;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp101_, FALSE);
		}
		enabled_is_flag = TRUE;
	}
	goto __finally2;
	__catch2_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (item);
		_g_free0 (shortcut);
		_g_free0 (enabled);
		_g_free0 (available);
		_g_free0 (description);
		_g_free0 (name);
		block102_data_unref (_data102_);
		_data102_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	if (!enabled_is_flag) {
		const gchar* _tmp103_;
		_tmp103_ = enabled;
		_tmp102_ = g_strcmp0 (_tmp103_, "") != 0;
	} else {
		_tmp102_ = FALSE;
	}
	if (_tmp102_) {
		gchar* enabled_command = NULL;
		const gchar* _tmp104_;
		GeeHashMap* _tmp105_;
		GeeHashMap* _tmp106_;
		gchar* _tmp107_;
		const gchar* _tmp108_;
		_tmp104_ = enabled;
		_tmp105_ = _data102_->object_vars;
		_tmp106_ = _data102_->dialog_vars;
		_tmp107_ = gitg_ui_utils_render_template (_tmp104_, _tmp105_, _tmp106_);
		enabled_command = _tmp107_;
		_tmp108_ = enabled_command;
		if (_tmp108_ == NULL) {
			GtkMenuItem* _tmp109_;
			_tmp109_ = item;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp109_, FALSE);
		} else {
			gint exit_status = 0;
			gchar* stdout_data = NULL;
			gchar* stderr_data = NULL;
			gboolean spawned = FALSE;
			const gchar* _tmp110_;
			gchar* _tmp111_ = NULL;
			gchar* _tmp112_ = NULL;
			gint _tmp113_ = 0;
			gboolean _tmp114_;
			_tmp110_ = enabled_command;
			_tmp114_ = g_spawn_command_line_sync (_tmp110_, &_tmp111_, &_tmp112_, &_tmp113_, &_inner_error0_);
			_g_free0 (stdout_data);
			stdout_data = _tmp111_;
			_g_free0 (stderr_data);
			stderr_data = _tmp112_;
			exit_status = _tmp113_;
			spawned = _tmp114_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (stderr_data);
				_g_free0 (stdout_data);
				_g_free0 (enabled_command);
				_g_object_unref0 (item);
				_g_free0 (shortcut);
				_g_free0 (enabled);
				_g_free0 (available);
				_g_free0 (description);
				_g_free0 (name);
				block102_data_unref (_data102_);
				_data102_ = NULL;
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
			if (!spawned) {
				FILE* _tmp115_;
				const gchar* _tmp116_;
				const gchar* _tmp117_;
				GtkMenuItem* _tmp118_;
				_tmp115_ = stderr;
				_tmp116_ = name;
				_tmp117_ = stderr_data;
				fprintf (_tmp115_, "Failed to check enabled action %s\n: %s\n", _tmp116_, _tmp117_);
				_tmp118_ = item;
				gtk_widget_set_sensitive ((GtkWidget*) _tmp118_, FALSE);
			} else {
				if (exit_status != 0) {
					GtkMenuItem* _tmp119_;
					_tmp119_ = item;
					gtk_widget_set_sensitive ((GtkWidget*) _tmp119_, FALSE);
				}
			}
			_g_free0 (stderr_data);
			_g_free0 (stdout_data);
		}
		_g_free0 (enabled_command);
	}
	_tmp120_ = item;
	_tmp121_ = _g_object_ref0 (_tmp120_);
	item_result = _tmp121_;
	{
		gchar* group = NULL;
		gchar* _tmp122_;
		gchar* _tmp123_;
		const gchar* _tmp124_;
		gchar* _tmp125_;
		gchar* _tmp126_;
		GtkMenuItem* item_group = NULL;
		const gchar* _tmp127_;
		gpointer _tmp128_;
		GtkMenu* submenu = NULL;
		GtkMenuItem* _tmp129_;
		GtkMenu* _tmp130_;
		GtkMenu* _tmp131_;
		GtkMenu* _tmp140_;
		GtkMenuItem* _tmp141_;
		gint items = 0;
		GtkMenuItem* _tmp142_;
		gconstpointer _tmp143_;
		GtkMenuItem* _tmp144_;
		gint _tmp145_;
		GtkMenuItem* _tmp146_;
		_tmp122_ = g_strconcat (action_key_prefix, "group", NULL);
		_tmp123_ = _tmp122_;
		_tmp124_ = ggit_config_get_string (conf, _tmp123_, &_inner_error0_);
		_tmp125_ = g_strdup (_tmp124_);
		_tmp126_ = _tmp125_;
		_g_free0 (_tmp123_);
		group = _tmp126_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch3_g_error;
		}
		_tmp127_ = group;
		_tmp128_ = gee_abstract_map_get ((GeeAbstractMap*) groups, _tmp127_);
		item_group = (GtkMenuItem*) _tmp128_;
		_tmp129_ = item_group;
		_tmp130_ = gtk_menu_item_get_submenu (_tmp129_);
		_tmp131_ = _tmp130_;
		if (_tmp131_ != NULL) {
			GtkMenuItem* _tmp132_;
			GtkMenu* _tmp133_;
			GtkMenu* _tmp134_;
			GtkMenu* _tmp135_;
			_tmp132_ = item_group;
			_tmp133_ = gtk_menu_item_get_submenu (_tmp132_);
			_tmp134_ = _tmp133_;
			_tmp135_ = _g_object_ref0 (_tmp134_);
			_g_object_unref0 (submenu);
			submenu = _tmp135_;
		} else {
			GtkMenu* _tmp136_;
			GtkMenuItem* _tmp137_;
			GtkMenu* _tmp138_;
			GtkMenuItem* _tmp139_;
			_tmp136_ = (GtkMenu*) gtk_menu_new ();
			g_object_ref_sink (_tmp136_);
			_g_object_unref0 (submenu);
			submenu = _tmp136_;
			_tmp137_ = item_group;
			_tmp138_ = submenu;
			gtk_menu_item_set_submenu (_tmp137_, _tmp138_);
			_tmp139_ = item_group;
			g_object_set_data_full ((GObject*) _tmp139_, "items", (gpointer) ((gintptr) 0), NULL);
		}
		_tmp140_ = submenu;
		_tmp141_ = item;
		gtk_container_add ((GtkContainer*) _tmp140_, (GtkWidget*) _tmp141_);
		_tmp142_ = item_group;
		_tmp143_ = g_object_get_data ((GObject*) _tmp142_, "items");
		items = (gint) ((gintptr) _tmp143_);
		_tmp144_ = item_group;
		items = items + 1;
		_tmp145_ = items;
		g_object_set_data_full ((GObject*) _tmp144_, "items", (gpointer) ((gintptr) _tmp145_), NULL);
		_tmp146_ = item;
		gtk_widget_show ((GtkWidget*) _tmp146_);
		_g_object_unref0 (item_result);
		item_result = NULL;
		_g_object_unref0 (submenu);
		_g_object_unref0 (item_group);
		_g_free0 (group);
	}
	goto __finally3;
	__catch3_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally3:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (item_result);
		_g_object_unref0 (item);
		_g_free0 (shortcut);
		_g_free0 (enabled);
		_g_free0 (available);
		_g_free0 (description);
		_g_free0 (name);
		block102_data_unref (_data102_);
		_data102_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp147_ = item;
	_tmp148_ = description;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp147_, _tmp148_);
	_tmp149_ = shortcut;
	if (_tmp149_ != NULL) {
		guint key = 0U;
		GdkModifierType mods = 0U;
		const gchar* _tmp150_;
		guint _tmp151_ = 0U;
		GdkModifierType _tmp152_ = 0U;
		GtkAccelGroup* accel_group = NULL;
		GtkAccelGroup* _tmp153_;
		_tmp150_ = shortcut;
		gtk_accelerator_parse (_tmp150_, &_tmp151_, &_tmp152_);
		key = _tmp151_;
		mods = _tmp152_;
		_tmp153_ = gitg_window_get_accel_group (_data102_->parent);
		accel_group = _tmp153_;
		if (key != ((guint) 0)) {
			GtkMenuItem* _tmp154_;
			GtkAccelGroup* _tmp155_;
			_tmp154_ = item;
			_tmp155_ = accel_group;
			gtk_widget_add_accelerator ((GtkWidget*) _tmp154_, "activate", _tmp155_, key, mods, GTK_ACCEL_VISIBLE);
		}
		_g_object_unref0 (accel_group);
	}
	_tmp156_ = item;
	g_signal_connect_data (_tmp156_, "activate", (GCallback) ___lambda197__gtk_menu_item_activate, block102_data_ref (_data102_), (GClosureNotify) block102_data_unref, 0);
	result = item_result;
	_g_object_unref0 (item);
	_g_free0 (shortcut);
	_g_free0 (enabled);
	_g_free0 (available);
	_g_free0 (description);
	_g_free0 (name);
	block102_data_unref (_data102_);
	_data102_ = NULL;
	return result;
}

gchar*
gitg_ui_utils_get (GeeHashMap* map,
                   const gchar* key,
                   const gchar* def)
{
	gboolean _tmp0_ = FALSE;
	gboolean has_key_not_null = FALSE;
	gchar* _tmp3_ = NULL;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (map != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	if (gee_abstract_map_has_key ((GeeAbstractMap*) map, key)) {
		gpointer _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) map, key);
		_tmp2_ = (gchar*) _tmp1_;
		_tmp0_ = _tmp2_ != NULL;
		_g_free0 (_tmp2_);
	} else {
		_tmp0_ = FALSE;
	}
	has_key_not_null = _tmp0_;
	if (has_key_not_null) {
		gpointer _tmp4_;
		_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) map, key);
		_g_free0 (_tmp3_);
		_tmp3_ = (gchar*) _tmp4_;
	} else {
		gchar* _tmp5_;
		_tmp5_ = g_strdup (def);
		_g_free0 (_tmp3_);
		_tmp3_ = _tmp5_;
	}
	_tmp6_ = _tmp3_;
	_tmp3_ = NULL;
	result = _tmp6_;
	_g_free0 (_tmp3_);
	return result;
}

gchar*
gitg_ui_utils_run_question_dialog (GtkWindow* parent,
                                   GeeHashMap* vars)
{
	gchar* title = NULL;
	gchar* _tmp0_;
	gchar* message = NULL;
	gchar* _tmp1_;
	gchar* level = NULL;
	gchar* _tmp2_;
	gchar* cancel = NULL;
	gchar* _tmp3_;
	gchar* yes = NULL;
	gchar* _tmp4_;
	GtkMessageType type = 0;
	gchar* icon_name = NULL;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GQuark _tmp8_ = 0U;
	static GQuark _tmp7_label0 = 0;
	static GQuark _tmp7_label1 = 0;
	static GQuark _tmp7_label2 = 0;
	static GQuark _tmp7_label3 = 0;
	GtkMessageDialog* dialog = NULL;
	const gchar* _tmp14_;
	GtkMessageDialog* _tmp15_;
	GtkImage* img = NULL;
	const gchar* _tmp16_;
	GtkImage* _tmp17_;
	GtkMessageDialog* _tmp18_;
	GtkImage* _tmp19_;
	GtkMessageDialog* _tmp20_;
	GtkMessageDialog* _tmp21_;
	GtkMessageDialog* _tmp22_;
	gint response = 0;
	GtkMessageDialog* _tmp23_;
	gchar* _result_ = NULL;
	GtkMessageDialog* _tmp25_;
	gchar* result;
	g_return_val_if_fail (vars != NULL, NULL);
	_tmp0_ = gitg_ui_utils_get (vars, "question-title", _ ("Input"));
	title = _tmp0_;
	_tmp1_ = gitg_ui_utils_get (vars, "question-message", "");
	message = _tmp1_;
	_tmp2_ = gitg_ui_utils_get (vars, "question-level", "info");
	level = _tmp2_;
	_tmp3_ = gitg_ui_utils_get (vars, "question-no", _ ("Cancel"));
	cancel = _tmp3_;
	_tmp4_ = gitg_ui_utils_get (vars, "question-yes", _ ("Ok"));
	yes = _tmp4_;
	_tmp5_ = level;
	_tmp6_ = _tmp5_;
	_tmp8_ = (NULL == _tmp6_) ? 0 : g_quark_from_string (_tmp6_);
	if (_tmp8_ == ((0 != _tmp7_label0) ? _tmp7_label0 : (_tmp7_label0 = g_quark_from_static_string ("info")))) {
		switch (0) {
			default:
			{
				gchar* _tmp9_;
				type = GTK_MESSAGE_INFO;
				_tmp9_ = g_strdup ("dialog-information-symbolic");
				_g_free0 (icon_name);
				icon_name = _tmp9_;
				break;
			}
		}
	} else if (_tmp8_ == ((0 != _tmp7_label1) ? _tmp7_label1 : (_tmp7_label1 = g_quark_from_static_string ("warning")))) {
		switch (0) {
			default:
			{
				gchar* _tmp10_;
				type = GTK_MESSAGE_WARNING;
				_tmp10_ = g_strdup ("dialog-warning-symbolic");
				_g_free0 (icon_name);
				icon_name = _tmp10_;
				break;
			}
		}
	} else if (_tmp8_ == ((0 != _tmp7_label2) ? _tmp7_label2 : (_tmp7_label2 = g_quark_from_static_string ("error")))) {
		switch (0) {
			default:
			{
				gchar* _tmp11_;
				type = GTK_MESSAGE_ERROR;
				_tmp11_ = g_strdup ("dialog-error-symbolic");
				_g_free0 (icon_name);
				icon_name = _tmp11_;
				break;
			}
		}
	} else if (_tmp8_ == ((0 != _tmp7_label3) ? _tmp7_label3 : (_tmp7_label3 = g_quark_from_static_string ("other")))) {
		switch (0) {
			default:
			{
				gchar* _tmp12_;
				type = GTK_MESSAGE_OTHER;
				_tmp12_ = g_strdup ("dialog-question-symbolic");
				_g_free0 (icon_name);
				icon_name = _tmp12_;
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar* _tmp13_;
				type = GTK_MESSAGE_INFO;
				_tmp13_ = g_strdup ("dialog-information-symbolic");
				_g_free0 (icon_name);
				icon_name = _tmp13_;
				break;
			}
		}
	}
	_tmp14_ = message;
	_tmp15_ = (GtkMessageDialog*) gtk_message_dialog_new (parent, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_OK_CANCEL, "%s", _tmp14_);
	g_object_ref_sink (_tmp15_);
	dialog = _tmp15_;
	_tmp16_ = icon_name;
	_tmp17_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp16_, (GtkIconSize) GTK_ICON_SIZE_DIALOG);
	g_object_ref_sink (_tmp17_);
	img = _tmp17_;
	_tmp18_ = dialog;
	_tmp19_ = img;
	gtk_message_dialog_set_image (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = dialog;
	gtk_window_set_default_size ((GtkWindow*) _tmp20_, 360, 120);
	_tmp21_ = dialog;
	gtk_window_set_resizable ((GtkWindow*) _tmp21_, FALSE);
	_tmp22_ = dialog;
	gtk_widget_show_all ((GtkWidget*) _tmp22_);
	_tmp23_ = dialog;
	response = gtk_dialog_run ((GtkDialog*) _tmp23_);
	_result_ = NULL;
	if (response == ((gint) GTK_RESPONSE_OK)) {
		gchar* _tmp24_;
		_tmp24_ = g_strdup ("");
		_g_free0 (_result_);
		_result_ = _tmp24_;
	}
	_tmp25_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp25_);
	result = _result_;
	_g_object_unref0 (img);
	_g_object_unref0 (dialog);
	_g_free0 (icon_name);
	_g_free0 (yes);
	_g_free0 (cancel);
	_g_free0 (level);
	_g_free0 (message);
	_g_free0 (title);
	return result;
}

static Block103Data*
block103_data_ref (Block103Data* _data103_)
{
	g_atomic_int_inc (&_data103_->_ref_count_);
	return _data103_;
}

static void
block103_data_unref (void * _userdata_)
{
	Block103Data* _data103_;
	_data103_ = (Block103Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data103_->_ref_count_)) {
		_g_object_unref0 (_data103_->ok_button);
		_g_object_unref0 (_data103_->entry);
		g_slice_free (Block103Data, _data103_);
	}
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
__lambda119_ (Block103Data* _data103_)
{
	GtkButton* _tmp0_;
	_tmp0_ = _data103_->ok_button;
	if (_tmp0_ != NULL) {
		GtkButton* _tmp1_;
		GtkEntry* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp1_ = _data103_->ok_button;
		_tmp2_ = _data103_->entry;
		_tmp3_ = gtk_entry_get_text (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = string_strip (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = strlen (_tmp6_);
		_tmp8_ = _tmp7_;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, _tmp8_ > 0);
		_g_free0 (_tmp6_);
	}
}

static void
___lambda119__gtk_editable_changed (GtkEditable* _sender,
                                    gpointer self)
{
	__lambda119_ (self);
}

static gboolean
___lambda120_ (Block103Data* _data103_)
{
	GtkEntry* _tmp0_;
	gboolean result;
	_tmp0_ = _data103_->entry;
	gtk_widget_set_can_focus ((GtkWidget*) _tmp0_, TRUE);
	result = FALSE;
	return result;
}

static gboolean
____lambda120__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda120_ (self);
	return result;
}

gchar*
gitg_ui_utils_run_entry_dialog (GtkWindow* parent,
                                GeeHashMap* vars)
{
	Block103Data* _data103_;
	gchar* title = NULL;
	gchar* _tmp0_;
	gchar* cancel = NULL;
	gchar* _tmp1_;
	gchar* yes = NULL;
	gchar* _tmp2_;
	gchar* label_text = NULL;
	gchar* _tmp3_;
	gchar* placeholder_text = NULL;
	gchar* _tmp4_;
	gboolean force_show_placeholder = FALSE;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	gchar* initial_text = NULL;
	gchar* _tmp8_;
	gchar* history_path = NULL;
	gchar* _tmp9_;
	GtkDialog* dialog = NULL;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GtkDialog* _tmp13_;
	GtkDialog* _tmp14_;
	GtkDialog* _tmp15_;
	GtkBox* content = NULL;
	GtkDialog* _tmp16_;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	GtkBox* box = NULL;
	GtkBox* _tmp19_;
	GtkBox* _tmp20_;
	GtkBox* _tmp21_;
	GtkBox* _tmp22_;
	GtkBox* _tmp23_;
	GtkBox* _tmp24_;
	GtkBox* _tmp25_;
	GtkLabel* lbl = NULL;
	const gchar* _tmp26_;
	GtkLabel* _tmp27_;
	GtkLabel* _tmp28_;
	GtkBox* _tmp29_;
	GtkLabel* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp35_;
	const gchar* _tmp39_;
	GtkEntry* _tmp42_;
	GtkBox* _tmp43_;
	GtkEntry* _tmp44_;
	GtkDialog* _tmp45_;
	GtkWidget* _tmp46_;
	GtkButton* _tmp47_;
	GtkButton* _tmp48_;
	GtkEntry* _tmp58_;
	GtkDialog* _tmp59_;
	gboolean _tmp60_ = FALSE;
	gint response = 0;
	GtkDialog* _tmp62_;
	gchar* _result_ = NULL;
	GtkDialog* _tmp66_;
	gchar* result;
	g_return_val_if_fail (vars != NULL, NULL);
	_data103_ = g_slice_new0 (Block103Data);
	_data103_->_ref_count_ = 1;
	_tmp0_ = gitg_ui_utils_get (vars, "input-title", _ ("Input"));
	title = _tmp0_;
	_tmp1_ = gitg_ui_utils_get (vars, "input-no", _ ("Cancel"));
	cancel = _tmp1_;
	_tmp2_ = gitg_ui_utils_get (vars, "input-yes", _ ("Ok"));
	yes = _tmp2_;
	_tmp3_ = gitg_ui_utils_get (vars, "input-label", _ ("Value"));
	label_text = _tmp3_;
	_tmp4_ = gitg_ui_utils_get (vars, "input-placeholder", NULL);
	placeholder_text = _tmp4_;
	_tmp5_ = gitg_ui_utils_get (vars, "input-force-show-placeholder", "false");
	_tmp6_ = _tmp5_;
	_tmp7_ = bool_parse (_tmp6_);
	_g_free0 (_tmp6_);
	force_show_placeholder = _tmp7_;
	_tmp8_ = gitg_ui_utils_get (vars, "input-text", NULL);
	initial_text = _tmp8_;
	_tmp9_ = gitg_ui_utils_get (vars, "input-history", NULL);
	history_path = _tmp9_;
	_tmp10_ = title;
	_tmp11_ = cancel;
	_tmp12_ = yes;
	_tmp13_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp10_, parent, (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT) | GTK_DIALOG_USE_HEADER_BAR, _tmp11_, GTK_RESPONSE_CANCEL, _tmp12_, GTK_RESPONSE_OK, NULL);
	g_object_ref_sink (_tmp13_);
	dialog = _tmp13_;
	_tmp14_ = dialog;
	gtk_window_set_default_size ((GtkWindow*) _tmp14_, 360, 120);
	_tmp15_ = dialog;
	gtk_window_set_resizable ((GtkWindow*) _tmp15_, FALSE);
	_tmp16_ = dialog;
	_tmp17_ = gtk_dialog_get_content_area (_tmp16_);
	_tmp18_ = _g_object_ref0 (_tmp17_);
	content = _tmp18_;
	_tmp19_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	g_object_ref_sink (_tmp19_);
	box = _tmp19_;
	_tmp20_ = box;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp20_, 12);
	_tmp21_ = box;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp21_, 12);
	_tmp22_ = box;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp22_, 12);
	_tmp23_ = box;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp23_, 12);
	_tmp24_ = content;
	_tmp25_ = box;
	gtk_box_pack_start (_tmp24_, (GtkWidget*) _tmp25_, TRUE, TRUE, (guint) 0);
	_tmp26_ = label_text;
	_tmp27_ = (GtkLabel*) gtk_label_new (_tmp26_);
	g_object_ref_sink (_tmp27_);
	lbl = _tmp27_;
	_tmp28_ = lbl;
	gtk_widget_set_halign ((GtkWidget*) _tmp28_, GTK_ALIGN_START);
	_tmp29_ = box;
	_tmp30_ = lbl;
	gtk_box_pack_start (_tmp29_, (GtkWidget*) _tmp30_, FALSE, FALSE, (guint) 0);
	_tmp31_ = history_path;
	if (_tmp31_ != NULL) {
		const gchar* _tmp32_;
		GitgEntryHistory* _tmp33_;
		_tmp32_ = history_path;
		_tmp33_ = gitg_entry_history_new (_tmp32_);
		g_object_ref_sink (_tmp33_);
		_g_object_unref0 (_data103_->entry);
		_data103_->entry = (GtkEntry*) _tmp33_;
	} else {
		GtkEntry* _tmp34_;
		_tmp34_ = (GtkEntry*) gtk_entry_new ();
		g_object_ref_sink (_tmp34_);
		_g_object_unref0 (_data103_->entry);
		_data103_->entry = _tmp34_;
	}
	_tmp35_ = placeholder_text;
	if (_tmp35_ != NULL) {
		GtkEntry* _tmp36_;
		const gchar* _tmp37_;
		_tmp36_ = _data103_->entry;
		_tmp37_ = placeholder_text;
		gtk_entry_set_placeholder_text (_tmp36_, _tmp37_);
		if (force_show_placeholder) {
			GtkEntry* _tmp38_;
			_tmp38_ = _data103_->entry;
			gtk_widget_set_can_focus ((GtkWidget*) _tmp38_, FALSE);
		}
	}
	_tmp39_ = initial_text;
	if (_tmp39_ != NULL) {
		GtkEntry* _tmp40_;
		const gchar* _tmp41_;
		_tmp40_ = _data103_->entry;
		_tmp41_ = initial_text;
		gtk_entry_set_text (_tmp40_, _tmp41_);
	}
	_tmp42_ = _data103_->entry;
	gtk_entry_set_activates_default (_tmp42_, TRUE);
	_tmp43_ = box;
	_tmp44_ = _data103_->entry;
	gtk_box_pack_start (_tmp43_, (GtkWidget*) _tmp44_, FALSE, FALSE, (guint) 0);
	_tmp45_ = dialog;
	_tmp46_ = gtk_dialog_get_widget_for_response (_tmp45_, (gint) GTK_RESPONSE_OK);
	_tmp47_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, gtk_button_get_type ()) ? ((GtkButton*) _tmp46_) : NULL);
	_data103_->ok_button = _tmp47_;
	_tmp48_ = _data103_->ok_button;
	if (_tmp48_ != NULL) {
		GtkDialog* _tmp49_;
		GtkButton* _tmp50_;
		GtkEntry* _tmp51_;
		const gchar* _tmp52_;
		const gchar* _tmp53_;
		gchar* _tmp54_;
		gchar* _tmp55_;
		gint _tmp56_;
		gint _tmp57_;
		_tmp49_ = dialog;
		gtk_dialog_set_default_response (_tmp49_, (gint) GTK_RESPONSE_OK);
		_tmp50_ = _data103_->ok_button;
		_tmp51_ = _data103_->entry;
		_tmp52_ = gtk_entry_get_text (_tmp51_);
		_tmp53_ = _tmp52_;
		_tmp54_ = string_strip (_tmp53_);
		_tmp55_ = _tmp54_;
		_tmp56_ = strlen (_tmp55_);
		_tmp57_ = _tmp56_;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp50_, _tmp57_ > 0);
		_g_free0 (_tmp55_);
	}
	_tmp58_ = _data103_->entry;
	g_signal_connect_data ((GtkEditable*) _tmp58_, "changed", (GCallback) ___lambda119__gtk_editable_changed, block103_data_ref (_data103_), (GClosureNotify) block103_data_unref, 0);
	_tmp59_ = dialog;
	gtk_widget_show_all ((GtkWidget*) _tmp59_);
	if (force_show_placeholder) {
		const gchar* _tmp61_;
		_tmp61_ = placeholder_text;
		_tmp60_ = _tmp61_ != NULL;
	} else {
		_tmp60_ = FALSE;
	}
	if (_tmp60_) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda120__gsource_func, block103_data_ref (_data103_), block103_data_unref);
	}
	_tmp62_ = dialog;
	response = gtk_dialog_run (_tmp62_);
	_result_ = NULL;
	if (response == ((gint) GTK_RESPONSE_OK)) {
		GtkEntry* _tmp63_;
		const gchar* _tmp64_;
		gchar* _tmp65_;
		_tmp63_ = _data103_->entry;
		_tmp64_ = gtk_entry_get_text (_tmp63_);
		_tmp65_ = g_strdup (_tmp64_);
		_g_free0 (_result_);
		_result_ = _tmp65_;
	}
	_tmp66_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp66_);
	result = _result_;
	_g_object_unref0 (lbl);
	_g_object_unref0 (box);
	_g_object_unref0 (content);
	_g_object_unref0 (dialog);
	_g_free0 (history_path);
	_g_free0 (initial_text);
	_g_free0 (placeholder_text);
	_g_free0 (label_text);
	_g_free0 (yes);
	_g_free0 (cancel);
	_g_free0 (title);
	block103_data_unref (_data103_);
	_data103_ = NULL;
	return result;
}

static void
_vala_array_add31 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

void
gitg_ui_utils_store_visible_columns_on_gsettings (GtkTreeView* treeview)
{
	gchar** visible_columns = NULL;
	gchar** _tmp0_;
	gint visible_columns_length1;
	gint _visible_columns_size_;
	GList* _tmp1_;
	GSettings* settings = NULL;
	GSettings* _tmp10_;
	gchar** _tmp11_;
	gint _tmp11__length1;
	g_return_if_fail (treeview != NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	visible_columns = _tmp0_;
	visible_columns_length1 = 0;
	_visible_columns_size_ = visible_columns_length1;
	g_print ("storing columns [");
	_tmp1_ = gtk_tree_view_get_columns (treeview);
	{
		GList* col_collection = NULL;
		GList* col_it = NULL;
		col_collection = _tmp1_;
		for (col_it = col_collection; col_it != NULL; col_it = col_it->next) {
			GtkTreeViewColumn* col = NULL;
			col = (GtkTreeViewColumn*) col_it->data;
			{
				GtkTreeViewColumn* _tmp2_;
				gboolean _tmp3_;
				gboolean _tmp4_;
				GitgCommitModelColumns cmc = 0;
				GtkTreeViewColumn* _tmp5_;
				gconstpointer _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				_tmp2_ = col;
				_tmp3_ = gtk_tree_view_column_get_visible (_tmp2_);
				_tmp4_ = _tmp3_;
				if (!_tmp4_) {
					continue;
				}
				_tmp5_ = col;
				_tmp6_ = g_object_get_data ((GObject*) _tmp5_, "enum");
				cmc = (GitgCommitModelColumns) ((gintptr) _tmp6_);
				_tmp7_ = gitg_commit_model_columns_nick (cmc);
				_tmp8_ = _tmp7_;
				g_print ("%s,", _tmp8_);
				_g_free0 (_tmp8_);
				_tmp9_ = gitg_commit_model_columns_nick (cmc);
				_vala_array_add31 (&visible_columns, &visible_columns_length1, &_visible_columns_size_, _tmp9_);
			}
		}
		(col_collection == NULL) ? NULL : (col_collection = (g_list_free (col_collection), NULL));
	}
	g_print ("]\n");
	_tmp10_ = g_settings_new (APPLICATION_ID ".preferences.general");
	settings = _tmp10_;
	_tmp11_ = visible_columns;
	_tmp11__length1 = visible_columns_length1;
	g_settings_set_strv (settings, "visible-columns", _tmp11_);
	_g_object_unref0 (settings);
	visible_columns = (_vala_array_free (visible_columns, visible_columns_length1, (GDestroyNotify) g_free), NULL);
}

static Block104Data*
block104_data_ref (Block104Data* _data104_)
{
	g_atomic_int_inc (&_data104_->_ref_count_);
	return _data104_;
}

static void
block104_data_unref (void * _userdata_)
{
	Block104Data* _data104_;
	_data104_ = (Block104Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data104_->_ref_count_)) {
		_g_object_unref0 (_data104_->treeview);
		g_slice_free (Block104Data, _data104_);
	}
}

static void
______lambda198_ (Block104Data* _data104_)
{
	GtkTreeView* _tmp0_;
	_tmp0_ = _data104_->treeview;
	_data104_->callback (_tmp0_, _data104_->callback_target);
}

static void
_______lambda198__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self)
{
	______lambda198_ (self);
}

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static void
_____lambda199_ (Block104Data* _data104_)
{
	GtkTreeView* _tmp0_;
	_tmp0_ = _data104_->treeview;
	_data104_->callback (_tmp0_, _data104_->callback_target);
}

static void
______lambda199__g_object_notify (GObject* _sender,
                                  GParamSpec* pspec,
                                  gpointer self)
{
	_____lambda199_ (self);
}

GtkTreeView*
gitg_ui_utils_build_treeview_visible_columns (gchar** visible_columns,
                                              gint visible_columns_length1,
                                              GitgUiUtilsUpdateTreeViewColumnsCallBack callback,
                                              gpointer callback_target)
{
	Block104Data* _data104_;
	GtkTreeView* _tmp0_;
	GEnumClass* ec = NULL;
	GTypeClass* _tmp1_;
	GEnumClass* enum_class = NULL;
	GTypeClass* _tmp17_;
	guint non_visible_columns = 0U;
	GEnumClass* _tmp18_;
	GitgCommitModelColumns* enum_columns = NULL;
	GitgCommitModelColumns* _tmp19_;
	gint enum_columns_length1;
	gint _enum_columns_size_;
	GtkTreeView* _tmp40_;
	GtkTreeView* _tmp41_;
	GtkTreeView* result;
	_data104_ = g_slice_new0 (Block104Data);
	_data104_->_ref_count_ = 1;
	_data104_->callback = callback;
	_data104_->callback_target = callback_target;
	_tmp0_ = (GtkTreeView*) gtk_tree_view_new ();
	g_object_ref_sink (_tmp0_);
	_data104_->treeview = _tmp0_;
	_tmp1_ = g_type_class_ref (GITG_TYPE_COMMIT_MODEL_COLUMNS);
	ec = (GEnumClass*) _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GEnumValue* ev = NULL;
				GEnumClass* _tmp4_;
				const gchar* _tmp5_;
				GEnumValue* _tmp6_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(i < visible_columns_length1)) {
					break;
				}
				_tmp4_ = ec;
				_tmp5_ = visible_columns[i];
				ev = g_enum_get_value_by_nick (_tmp4_, _tmp5_);
				_tmp6_ = ev;
				if (_tmp6_ != NULL) {
					GitgCommitModelColumns cmc = 0;
					GEnumValue* _tmp7_;
					GtkTreeViewColumn* column = NULL;
					GtkTreeViewColumn* _tmp8_;
					GtkTreeViewColumn* _tmp9_;
					GtkTreeViewColumn* _tmp10_;
					gchar* _tmp11_;
					gchar* _tmp12_;
					GtkTreeViewColumn* _tmp13_;
					GtkTreeViewColumn* _tmp14_;
					GtkTreeView* _tmp15_;
					GtkTreeViewColumn* _tmp16_;
					_tmp7_ = ev;
					cmc = (GitgCommitModelColumns) (*_tmp7_).value;
					_tmp8_ = gtk_tree_view_column_new ();
					g_object_ref_sink (_tmp8_);
					column = _tmp8_;
					_tmp9_ = column;
					g_object_set_data_full ((GObject*) _tmp9_, "enum", (gpointer) ((gintptr) cmc), NULL);
					_tmp10_ = column;
					_tmp11_ = gitg_commit_model_columns_name (cmc);
					_tmp12_ = _tmp11_;
					gtk_tree_view_column_set_title (_tmp10_, _tmp12_);
					_g_free0 (_tmp12_);
					_tmp13_ = column;
					gtk_tree_view_column_set_visible (_tmp13_, TRUE);
					_tmp14_ = column;
					g_signal_connect_data ((GObject*) _tmp14_, "notify::visible", (GCallback) _______lambda198__g_object_notify, block104_data_ref (_data104_), (GClosureNotify) block104_data_unref, 0);
					_tmp15_ = _data104_->treeview;
					_tmp16_ = column;
					gtk_tree_view_append_column (_tmp15_, _tmp16_);
					_g_object_unref0 (column);
				}
			}
		}
	}
	_tmp17_ = g_type_class_ref (GITG_TYPE_COMMIT_MODEL_COLUMNS);
	enum_class = (GEnumClass*) _tmp17_;
	_tmp18_ = enum_class;
	non_visible_columns = (_tmp18_->n_values - 2) - visible_columns_length1;
	_tmp19_ = g_new0 (GitgCommitModelColumns, non_visible_columns);
	enum_columns = _tmp19_;
	enum_columns_length1 = non_visible_columns;
	_enum_columns_size_ = enum_columns_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp20_ = FALSE;
			_tmp20_ = TRUE;
			while (TRUE) {
				GEnumClass* _tmp22_;
				GEnumValue enum_value = {0};
				GEnumClass* _tmp23_;
				GEnumValue* _tmp24_;
				gint _tmp24__length1;
				GEnumValue _tmp25_;
				GitgCommitModelColumns cmc = 0;
				GEnumValue _tmp26_;
				gboolean _tmp27_ = FALSE;
				gboolean _tmp28_ = FALSE;
				GtkTreeViewColumn* column = NULL;
				GtkTreeViewColumn* _tmp31_;
				GtkTreeViewColumn* _tmp32_;
				GtkTreeViewColumn* _tmp33_;
				gchar* _tmp34_;
				gchar* _tmp35_;
				GtkTreeViewColumn* _tmp36_;
				GtkTreeViewColumn* _tmp37_;
				GtkTreeView* _tmp38_;
				GtkTreeViewColumn* _tmp39_;
				if (!_tmp20_) {
					gint _tmp21_;
					_tmp21_ = i;
					i = _tmp21_ + 1;
				}
				_tmp20_ = FALSE;
				_tmp22_ = enum_class;
				if (!(((guint) i) < _tmp22_->n_values)) {
					break;
				}
				_tmp23_ = enum_class;
				_tmp24_ = _tmp23_->values;
				_tmp24__length1 = _tmp23_->n_values;
				_tmp25_ = _tmp24_[i];
				enum_value = _tmp25_;
				_tmp26_ = enum_value;
				cmc = (GitgCommitModelColumns) _tmp26_.value;
				if (cmc == GITG_COMMIT_MODEL_COLUMNS_NUM) {
					_tmp28_ = TRUE;
				} else {
					_tmp28_ = cmc == GITG_COMMIT_MODEL_COLUMNS_COMMIT;
				}
				if (_tmp28_) {
					_tmp27_ = TRUE;
				} else {
					GEnumValue _tmp29_;
					const gchar* _tmp30_;
					_tmp29_ = enum_value;
					_tmp30_ = _tmp29_.value_nick;
					_tmp27_ = _vala_string_array_contains (visible_columns, visible_columns_length1, _tmp30_);
				}
				if (_tmp27_) {
					continue;
				}
				_tmp31_ = gtk_tree_view_column_new ();
				g_object_ref_sink (_tmp31_);
				column = _tmp31_;
				_tmp32_ = column;
				g_object_set_data_full ((GObject*) _tmp32_, "enum", (gpointer) ((gintptr) cmc), NULL);
				_tmp33_ = column;
				_tmp34_ = gitg_commit_model_columns_name (cmc);
				_tmp35_ = _tmp34_;
				gtk_tree_view_column_set_title (_tmp33_, _tmp35_);
				_g_free0 (_tmp35_);
				_tmp36_ = column;
				gtk_tree_view_column_set_visible (_tmp36_, FALSE);
				_tmp37_ = column;
				g_signal_connect_data ((GObject*) _tmp37_, "notify::visible", (GCallback) ______lambda199__g_object_notify, block104_data_ref (_data104_), (GClosureNotify) block104_data_unref, 0);
				_tmp38_ = _data104_->treeview;
				_tmp39_ = column;
				gtk_tree_view_append_column (_tmp38_, _tmp39_);
				_g_object_unref0 (column);
			}
		}
	}
	_tmp40_ = _data104_->treeview;
	_tmp41_ = _g_object_ref0 (_tmp40_);
	result = _tmp41_;
	enum_columns = (g_free (enum_columns), NULL);
	_g_type_class_unref0 (enum_class);
	_g_type_class_unref0 (ec);
	block104_data_unref (_data104_);
	_data104_ = NULL;
	return result;
}

static Block105Data*
block105_data_ref (Block105Data* _data105_)
{
	g_atomic_int_inc (&_data105_->_ref_count_);
	return _data105_;
}

static void
block105_data_unref (void * _userdata_)
{
	Block105Data* _data105_;
	_data105_ = (Block105Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data105_->_ref_count_)) {
		_g_object_unref0 (_data105_->listbox);
		_g_object_unref0 (_data105_->list_model);
		_g_object_unref0 (_data105_->treeview);
		g_slice_free (Block105Data, _data105_);
	}
}

static void
__lambda161_ (Block105Data* _data105_,
              gint from,
              gint to)
{
	GListStore* _tmp0_;
	GitgDragListBox* _tmp1_;
	GList* cols = NULL;
	GList* _tmp2_;
	gint n = 0;
	GList* _tmp3_;
	GtkTreeViewColumn* col = NULL;
	GList* _tmp4_;
	gconstpointer _tmp5_;
	GtkTreeViewColumn* _tmp6_;
	GtkTreeViewColumn** without = NULL;
	GtkTreeViewColumn** _tmp7_;
	gint without_length1;
	gint _without_size_;
	gint j = 0;
	GtkTreeViewColumn* base_col = NULL;
	GtkTreeViewColumn* _tmp25_;
	GtkTreeViewColumn* _tmp26_;
	_tmp0_ = _data105_->list_model;
	_tmp1_ = _data105_->listbox;
	gitg_ui_utils_sync_listbox_actions (_tmp0_, _tmp1_);
	_tmp2_ = gtk_tree_view_get_columns (_data105_->treeview);
	cols = _tmp2_;
	_tmp3_ = cols;
	n = (gint) g_list_length (_tmp3_);
	if (n == 0) {
		(cols == NULL) ? NULL : (cols = (g_list_free (cols), NULL));
		return;
	}
	_tmp4_ = cols;
	_tmp5_ = g_list_nth_data (_tmp4_, (guint) from);
	_tmp6_ = _g_object_ref0 ((GtkTreeViewColumn*) _tmp5_);
	col = _tmp6_;
	_tmp7_ = g_new0 (GtkTreeViewColumn*, (n - 1) + 1);
	without = _tmp7_;
	without_length1 = n - 1;
	_without_size_ = without_length1;
	j = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				GtkTreeViewColumn* current_col = NULL;
				GList* _tmp10_;
				gconstpointer _tmp11_;
				GtkTreeViewColumn* _tmp12_;
				GtkTreeViewColumn* _tmp13_;
				GtkTreeViewColumn* _tmp14_;
				GtkTreeViewColumn* _tmp15_;
				gboolean _tmp16_;
				gboolean _tmp17_;
				GtkTreeViewColumn** _tmp18_;
				gint _tmp18__length1;
				gint _tmp19_;
				GtkTreeViewColumn* _tmp20_;
				GtkTreeViewColumn* _tmp21_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = i;
					i = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				if (!(i < n)) {
					break;
				}
				_tmp10_ = cols;
				_tmp11_ = g_list_nth_data (_tmp10_, (guint) i);
				_tmp12_ = _g_object_ref0 ((GtkTreeViewColumn*) _tmp11_);
				current_col = _tmp12_;
				_tmp13_ = current_col;
				_tmp14_ = col;
				if (_tmp13_ == _tmp14_) {
					_g_object_unref0 (current_col);
					continue;
				}
				_tmp15_ = current_col;
				_tmp16_ = gtk_tree_view_column_get_visible (_tmp15_);
				_tmp17_ = _tmp16_;
				if (!_tmp17_) {
					_g_object_unref0 (current_col);
					continue;
				}
				_tmp18_ = without;
				_tmp18__length1 = without_length1;
				_tmp19_ = j;
				j = _tmp19_ + 1;
				_tmp20_ = current_col;
				_tmp21_ = _g_object_ref0 (_tmp20_);
				_g_object_unref0 (_tmp18_[_tmp19_]);
				_tmp18_[_tmp19_] = _tmp21_;
				_g_object_unref0 (current_col);
			}
		}
	}
	base_col = NULL;
	if (to > 0) {
		GtkTreeViewColumn** _tmp22_;
		gint _tmp22__length1;
		GtkTreeViewColumn* _tmp23_;
		GtkTreeViewColumn* _tmp24_;
		_tmp22_ = without;
		_tmp22__length1 = without_length1;
		_tmp23_ = _tmp22_[to - 1];
		_tmp24_ = _g_object_ref0 (_tmp23_);
		_g_object_unref0 (base_col);
		base_col = _tmp24_;
	}
	_tmp25_ = col;
	_tmp26_ = base_col;
	gtk_tree_view_move_column_after (_data105_->treeview, _tmp25_, _tmp26_);
	_g_object_unref0 (base_col);
	without = (_vala_array_free (without, without_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (col);
	(cols == NULL) ? NULL : (cols = (g_list_free (cols), NULL));
}

static void
___lambda161__gitg_drag_list_box_row_reorder (GitgDragListBox* _sender,
                                              gint from,
                                              gint to,
                                              gpointer self)
{
	__lambda161_ (self, from, to);
}

static void
__lambda162_ (Block105Data* _data105_,
              guint p,
              guint r,
              guint a)
{
	GListStore* _tmp0_;
	GitgDragListBox* _tmp1_;
	_tmp0_ = _data105_->list_model;
	_tmp1_ = _data105_->listbox;
	gitg_ui_utils_sync_listbox_actions (_tmp0_, _tmp1_);
}

static void
___lambda162__g_list_model_items_changed (GListModel* _sender,
                                          guint position,
                                          guint removed,
                                          guint added,
                                          gpointer self)
{
	__lambda162_ (self, position, removed, added);
}

static void
__lambda163_ (Block105Data* _data105_)
{
	GList* cols = NULL;
	GList* _tmp0_;
	_tmp0_ = gtk_tree_view_get_columns (_data105_->treeview);
	cols = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GList* _tmp3_;
				gchar* title = NULL;
				GList* _tmp4_;
				gconstpointer _tmp5_;
				const gchar* _tmp6_;
				const gchar* _tmp7_;
				gchar* _tmp8_;
				GList* children = NULL;
				GitgDragListBox* _tmp9_;
				GList* _tmp10_;
				gint from = 0;
				GitgListBoxRowDnD* rowj = NULL;
				gint to = 0;
				GitgListRow* list_row = NULL;
				GListStore* _tmp23_;
				GObject* _tmp24_;
				GListStore* _tmp25_;
				GListStore* _tmp26_;
				GitgListRow* _tmp27_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = cols;
				if (!(((guint) i) < g_list_length (_tmp3_))) {
					break;
				}
				_tmp4_ = cols;
				_tmp5_ = g_list_nth_data (_tmp4_, (guint) i);
				_tmp6_ = gtk_tree_view_column_get_title ((GtkTreeViewColumn*) _tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = g_strdup (_tmp7_);
				title = _tmp8_;
				_tmp9_ = _data105_->listbox;
				_tmp10_ = gtk_container_get_children ((GtkContainer*) _tmp9_);
				children = _tmp10_;
				from = -1;
				rowj = NULL;
				{
					gint j = 0;
					j = 0;
					{
						gboolean _tmp11_ = FALSE;
						_tmp11_ = TRUE;
						while (TRUE) {
							GList* _tmp13_;
							GitgDragListBox* _tmp14_;
							GtkListBoxRow* _tmp15_;
							GitgListBoxRowDnD* _tmp16_;
							gchar* row_title = NULL;
							GitgListBoxRowDnD* _tmp17_;
							const gchar* _tmp18_;
							const gchar* _tmp19_;
							gchar* _tmp20_;
							const gchar* _tmp21_;
							const gchar* _tmp22_;
							if (!_tmp11_) {
								gint _tmp12_;
								_tmp12_ = j;
								j = _tmp12_ + 1;
							}
							_tmp11_ = FALSE;
							_tmp13_ = children;
							if (!(((guint) j) < g_list_length (_tmp13_))) {
								break;
							}
							_tmp14_ = _data105_->listbox;
							_tmp15_ = gtk_list_box_get_row_at_index ((GtkListBox*) _tmp14_, j);
							_tmp16_ = _g_object_ref0 (GITG_IS_LIST_BOX_ROW_DN_D (_tmp15_) ? ((GitgListBoxRowDnD*) _tmp15_) : NULL);
							_g_object_unref0 (rowj);
							rowj = _tmp16_;
							_tmp17_ = rowj;
							_tmp18_ = gitg_list_box_row_dn_d_get_title (_tmp17_);
							_tmp19_ = _tmp18_;
							_tmp20_ = g_strdup (_tmp19_);
							row_title = _tmp20_;
							_tmp21_ = row_title;
							_tmp22_ = title;
							if (g_strcmp0 (_tmp21_, _tmp22_) == 0) {
								from = j;
								_g_free0 (row_title);
								break;
							}
							_g_free0 (row_title);
						}
					}
				}
				if (from == -1) {
					_g_object_unref0 (rowj);
					(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
					_g_free0 (title);
					continue;
				}
				to = i;
				if (to == from) {
					_g_object_unref0 (rowj);
					(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
					_g_free0 (title);
					continue;
				}
				_tmp23_ = _data105_->list_model;
				_tmp24_ = g_list_model_get_item ((GListModel*) _tmp23_, (guint) from);
				list_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GITG_TYPE_LIST_ROW, GitgListRow);
				_tmp25_ = _data105_->list_model;
				g_list_store_remove (_tmp25_, (guint) from);
				_tmp26_ = _data105_->list_model;
				_tmp27_ = list_row;
				g_list_store_insert (_tmp26_, (guint) to, (GObject*) _tmp27_);
				_g_object_unref0 (list_row);
				_g_object_unref0 (rowj);
				(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
				_g_free0 (title);
			}
		}
	}
	(cols == NULL) ? NULL : (cols = (g_list_free (cols), NULL));
}

static void
___lambda163__gtk_tree_view_columns_changed (GtkTreeView* _sender,
                                             gpointer self)
{
	__lambda163_ (self);
}

GitgDragListBox*
gitg_ui_utils_build_listbox_visible_columns (GtkTreeView* treeview)
{
	Block105Data* _data105_;
	GtkTreeView* _tmp0_;
	GListStore* _tmp1_;
	GListStore* _tmp2_;
	GitgDragListBox* _tmp3_;
	GitgDragListBox* _tmp4_;
	GitgDragListBox* _tmp5_;
	GListStore* _tmp6_;
	GListStore* _tmp7_;
	GitgDragListBox* _tmp8_;
	GList* _tmp9_;
	GitgDragListBox* _tmp17_;
	GitgDragListBox* _tmp18_;
	GitgDragListBox* result;
	g_return_val_if_fail (treeview != NULL, NULL);
	_data105_ = g_slice_new0 (Block105Data);
	_data105_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (treeview);
	_g_object_unref0 (_data105_->treeview);
	_data105_->treeview = _tmp0_;
	_tmp1_ = g_list_store_new (GITG_TYPE_LIST_ROW);
	_data105_->list_model = _tmp1_;
	_tmp2_ = _data105_->list_model;
	_tmp3_ = gitg_drag_list_box_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_data105_->listbox = _tmp3_;
	_tmp4_ = _data105_->listbox;
	gtk_list_box_set_selection_mode ((GtkListBox*) _tmp4_, GTK_SELECTION_NONE);
	_tmp5_ = _data105_->listbox;
	g_signal_connect_data (_tmp5_, "row-reorder", (GCallback) ___lambda161__gitg_drag_list_box_row_reorder, block105_data_ref (_data105_), (GClosureNotify) block105_data_unref, 0);
	_tmp6_ = _data105_->list_model;
	g_signal_connect_data ((GListModel*) _tmp6_, "items-changed", (GCallback) ___lambda162__g_list_model_items_changed, block105_data_ref (_data105_), (GClosureNotify) block105_data_unref, 0);
	_tmp7_ = _data105_->list_model;
	_tmp8_ = _data105_->listbox;
	gitg_ui_utils_sync_listbox_actions (_tmp7_, _tmp8_);
	_tmp9_ = gtk_tree_view_get_columns (_data105_->treeview);
	{
		GList* column_collection = NULL;
		GList* column_it = NULL;
		column_collection = _tmp9_;
		for (column_it = column_collection; column_it != NULL; column_it = column_it->next) {
			GtkTreeViewColumn* column = NULL;
			column = (GtkTreeViewColumn*) column_it->data;
			{
				GListStore* _tmp10_;
				GtkTreeViewColumn* _tmp11_;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				GtkTreeViewColumn* _tmp14_;
				GitgListRow* _tmp15_;
				GitgListRow* _tmp16_;
				_tmp10_ = _data105_->list_model;
				_tmp11_ = column;
				_tmp12_ = gtk_tree_view_column_get_title (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = column;
				_tmp15_ = gitg_list_row_new (_tmp13_, _tmp14_);
				_tmp16_ = _tmp15_;
				g_list_store_append (_tmp10_, (GObject*) _tmp16_);
				_g_object_unref0 (_tmp16_);
			}
		}
		(column_collection == NULL) ? NULL : (column_collection = (g_list_free (column_collection), NULL));
	}
	g_signal_connect_data (_data105_->treeview, "columns-changed", (GCallback) ___lambda163__gtk_tree_view_columns_changed, block105_data_ref (_data105_), (GClosureNotify) block105_data_unref, 0);
	_tmp17_ = _data105_->listbox;
	_tmp18_ = _g_object_ref0 (_tmp17_);
	result = _tmp18_;
	block105_data_unref (_data105_);
	_data105_ = NULL;
	return result;
}

static Block106Data*
block106_data_ref (Block106Data* _data106_)
{
	g_atomic_int_inc (&_data106_->_ref_count_);
	return _data106_;
}

static void
block106_data_unref (void * _userdata_)
{
	Block106Data* _data106_;
	_data106_ = (Block106Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data106_->_ref_count_)) {
		_g_object_unref0 (_data106_->switch_show_col_headers);
		_g_object_unref0 (_data106_->settings);
		_g_object_unref0 (_data106_->treeview);
		g_slice_free (Block106Data, _data106_);
	}
}

static gboolean
__lambda166_ (Block106Data* _data106_,
              gboolean state)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	_tmp0_ = gtk_switch_get_active (_data106_->switch_show_col_headers);
	_tmp1_ = _tmp0_;
	gtk_tree_view_set_headers_visible (_data106_->treeview, _tmp1_);
	_tmp2_ = gtk_tree_view_get_headers_visible (_data106_->treeview);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_data106_->settings, "columns-header-visible", _tmp3_);
	result = FALSE;
	return result;
}

static gboolean
___lambda166__gtk_switch_state_set (GtkSwitch* _sender,
                                    gboolean state,
                                    gpointer self)
{
	gboolean result;
	result = __lambda166_ (self, state);
	return result;
}

GtkBox*
gitg_ui_utils_build_switch_show_headers (GtkTreeView* treeview)
{
	Block106Data* _data106_;
	GtkTreeView* _tmp0_;
	GSettings* _tmp1_;
	GtkSwitch* _tmp2_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp3_;
	GtkBox* box = NULL;
	GtkBox* _tmp4_;
	GtkBox* result;
	g_return_val_if_fail (treeview != NULL, NULL);
	_data106_ = g_slice_new0 (Block106Data);
	_data106_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (treeview);
	_g_object_unref0 (_data106_->treeview);
	_data106_->treeview = _tmp0_;
	_tmp1_ = g_settings_new (APPLICATION_ID ".preferences.general");
	_data106_->settings = _tmp1_;
	_tmp2_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp2_);
	_data106_->switch_show_col_headers = _tmp2_;
	_tmp3_ = (GtkLabel*) gtk_label_new ("Show column headers");
	g_object_ref_sink (_tmp3_);
	label = _tmp3_;
	g_signal_connect_data (_data106_->switch_show_col_headers, "state-set", (GCallback) ___lambda166__gtk_switch_state_set, block106_data_ref (_data106_), (GClosureNotify) block106_data_unref, 0);
	gtk_switch_set_active (_data106_->switch_show_col_headers, g_settings_get_boolean (_data106_->settings, "columns-header-visible"));
	_tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	g_object_ref_sink (_tmp4_);
	box = _tmp4_;
	gtk_box_pack_start (box, (GtkWidget*) _data106_->switch_show_col_headers, FALSE, FALSE, (guint) 0);
	gtk_box_pack_start (box, (GtkWidget*) label, FALSE, FALSE, (guint) 0);
	result = box;
	_g_object_unref0 (label);
	block106_data_unref (_data106_);
	_data106_ = NULL;
	return result;
}

void
gitg_ui_utils_sync_row_actions (GListStore* list_model,
                                GitgListBoxRowDnD* row,
                                gint pos)
{
	gboolean up = FALSE;
	gboolean down = FALSE;
	gint count = 0;
	g_return_if_fail (list_model != NULL);
	g_return_if_fail (row != NULL);
	up = TRUE;
	down = TRUE;
	count = (gint) g_list_model_get_n_items ((GListModel*) list_model);
	if (pos == 0) {
		up = FALSE;
	}
	if (pos == (count - 1)) {
		down = FALSE;
	}
	gitg_list_box_row_dn_d_enable_up (row, up);
	gitg_list_box_row_dn_d_enable_down (row, down);
}

void
gitg_ui_utils_sync_listbox_actions (GListStore* list_model,
                                    GitgDragListBox* listbox)
{
	gint pos = 0;
	GitgListBoxRowDnD* row = NULL;
	GtkListBoxRow* _tmp0_;
	GitgListBoxRowDnD* _tmp1_;
	g_return_if_fail (list_model != NULL);
	g_return_if_fail (listbox != NULL);
	pos = 0;
	_tmp0_ = gtk_list_box_get_row_at_index ((GtkListBox*) listbox, pos);
	_tmp1_ = _g_object_ref0 (GITG_IS_LIST_BOX_ROW_DN_D (_tmp0_) ? ((GitgListBoxRowDnD*) _tmp0_) : NULL);
	row = _tmp1_;
	while (TRUE) {
		GitgListBoxRowDnD* _tmp2_;
		GitgListBoxRowDnD* _tmp3_;
		gint _tmp4_;
		GtkListBoxRow* _tmp5_;
		GitgListBoxRowDnD* _tmp6_;
		_tmp2_ = row;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = row;
		gitg_ui_utils_sync_row_actions (list_model, _tmp3_, pos);
		pos = pos + 1;
		_tmp4_ = pos;
		_tmp5_ = gtk_list_box_get_row_at_index ((GtkListBox*) listbox, _tmp4_);
		_tmp6_ = _g_object_ref0 (GITG_IS_LIST_BOX_ROW_DN_D (_tmp5_) ? ((GitgListBoxRowDnD*) _tmp5_) : NULL);
		_g_object_unref0 (row);
		row = _tmp6_;
	}
	_g_object_unref0 (row);
}

GitgUiUtils*
gitg_ui_utils_construct (GType object_type)
{
	GitgUiUtils* self = NULL;
	self = (GitgUiUtils*) g_type_create_instance (object_type);
	return self;
}

GitgUiUtils*
gitg_ui_utils_new (void)
{
	return gitg_ui_utils_construct (GITG_TYPE_UI_UTILS);
}

static void
gitg_value_ui_utils_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
gitg_value_ui_utils_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		gitg_ui_utils_unref (value->data[0].v_pointer);
	}
}

static void
gitg_value_ui_utils_copy_value (const GValue* src_value,
                                GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gitg_ui_utils_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
gitg_value_ui_utils_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
gitg_value_ui_utils_collect_value (GValue* value,
                                   guint n_collect_values,
                                   GTypeCValue* collect_values,
                                   guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		GitgUiUtils * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gitg_ui_utils_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
gitg_value_ui_utils_lcopy_value (const GValue* value,
                                 guint n_collect_values,
                                 GTypeCValue* collect_values,
                                 guint collect_flags)
{
	GitgUiUtils ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gitg_ui_utils_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
gitg_param_spec_ui_utils (const gchar* name,
                          const gchar* nick,
                          const gchar* blurb,
                          GType object_type,
                          GParamFlags flags)
{
	GitgParamSpecUiUtils* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GITG_TYPE_UI_UTILS), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
gitg_value_get_ui_utils (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GITG_TYPE_UI_UTILS), NULL);
	return value->data[0].v_pointer;
}

void
gitg_value_set_ui_utils (GValue* value,
                         gpointer v_object)
{
	GitgUiUtils * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GITG_TYPE_UI_UTILS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GITG_TYPE_UI_UTILS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gitg_ui_utils_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gitg_ui_utils_unref (old);
	}
}

void
gitg_value_take_ui_utils (GValue* value,
                          gpointer v_object)
{
	GitgUiUtils * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GITG_TYPE_UI_UTILS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GITG_TYPE_UI_UTILS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gitg_ui_utils_unref (old);
	}
}

static void
gitg_ui_utils_class_init (GitgUiUtilsClass * klass,
                          gpointer klass_data)
{
	gitg_ui_utils_parent_class = g_type_class_peek_parent (klass);
	((GitgUiUtilsClass *) klass)->finalize = gitg_ui_utils_finalize;
}

static void
gitg_ui_utils_instance_init (GitgUiUtils * self,
                             gpointer klass)
{
	self->ref_count = 1;
}

static void
gitg_ui_utils_finalize (GitgUiUtils * obj)
{
	GitgUiUtils * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_UI_UTILS, GitgUiUtils);
	g_signal_handlers_destroy (self);
}

 G_GNUC_NO_INLINE static GType
gitg_ui_utils_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { gitg_value_ui_utils_init, gitg_value_ui_utils_free_value, gitg_value_ui_utils_copy_value, gitg_value_ui_utils_peek_pointer, "p", gitg_value_ui_utils_collect_value, "p", gitg_value_ui_utils_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GitgUiUtilsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_ui_utils_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgUiUtils), 0, (GInstanceInitFunc) gitg_ui_utils_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType gitg_ui_utils_type_id;
	gitg_ui_utils_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GitgUiUtils", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return gitg_ui_utils_type_id;
}

GType
gitg_ui_utils_get_type (void)
{
	static gsize gitg_ui_utils_type_id__once = 0;
	if (g_once_init_enter (&gitg_ui_utils_type_id__once)) {
		GType gitg_ui_utils_type_id;
		gitg_ui_utils_type_id = gitg_ui_utils_get_type_once ();
		g_once_init_leave (&gitg_ui_utils_type_id__once, gitg_ui_utils_type_id);
	}
	return gitg_ui_utils_type_id__once;
}

gpointer
gitg_ui_utils_ref (gpointer instance)
{
	GitgUiUtils * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
gitg_ui_utils_unref (gpointer instance)
{
	GitgUiUtils * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GITG_UI_UTILS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

