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

/*
 * This file is part of gitg
 *
 * Copyright (C) 2012 - Jesse van den Kieboom
 *
 * 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 <gtk/gtk.h>
#include "libgitg-ext.h"
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include "libgitg.h"
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gdk/gdk.h>
#include "config.h"
#include <glib/gi18n-lib.h>
#include <libgit2-glib/ggit.h>
#include "libgitg/gitg-platform-support.h"
#include <libpeas/peas.h>

#define GITG_WINDOW_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_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 struct _GitgWindowPrivate GitgWindowPrivate;

#define GITG_TYPE_RECURSIVE_MONITOR (gitg_recursive_monitor_get_type ())
#define GITG_RECURSIVE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_RECURSIVE_MONITOR, GitgRecursiveMonitor))
#define GITG_RECURSIVE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_RECURSIVE_MONITOR, GitgRecursiveMonitorClass))
#define GITG_IS_RECURSIVE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_RECURSIVE_MONITOR))
#define GITG_IS_RECURSIVE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_RECURSIVE_MONITOR))
#define GITG_RECURSIVE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_RECURSIVE_MONITOR, GitgRecursiveMonitorClass))

typedef struct _GitgRecursiveMonitor GitgRecursiveMonitor;
typedef struct _GitgRecursiveMonitorClass GitgRecursiveMonitorClass;

#define GITG_TYPE_UI_ELEMENTS (gitg_ui_elements_get_type ())
#define GITG_UI_ELEMENTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_UI_ELEMENTS, GitgUIElements))
#define GITG_UI_ELEMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_UI_ELEMENTS, GitgUIElementsClass))
#define GITG_IS_UI_ELEMENTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_UI_ELEMENTS))
#define GITG_IS_UI_ELEMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_UI_ELEMENTS))
#define GITG_UI_ELEMENTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_UI_ELEMENTS, GitgUIElementsClass))

typedef struct _GitgUIElements GitgUIElements;
typedef struct _GitgUIElementsClass GitgUIElementsClass;

#define GITG_TYPE_REMOTE_MANAGER (gitg_remote_manager_get_type ())
#define GITG_REMOTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManager))
#define GITG_REMOTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManagerClass))
#define GITG_IS_REMOTE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REMOTE_MANAGER))
#define GITG_IS_REMOTE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REMOTE_MANAGER))
#define GITG_REMOTE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REMOTE_MANAGER, GitgRemoteManagerClass))

typedef struct _GitgRemoteManager GitgRemoteManager;
typedef struct _GitgRemoteManagerClass GitgRemoteManagerClass;

#define GITG_TYPE_NOTIFICATIONS (gitg_notifications_get_type ())
#define GITG_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_NOTIFICATIONS, GitgNotifications))
#define GITG_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_NOTIFICATIONS, GitgNotificationsClass))
#define GITG_IS_NOTIFICATIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_NOTIFICATIONS))
#define GITG_IS_NOTIFICATIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_NOTIFICATIONS))
#define GITG_NOTIFICATIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_NOTIFICATIONS, GitgNotificationsClass))

typedef struct _GitgNotifications GitgNotifications;
typedef struct _GitgNotificationsClass GitgNotificationsClass;

#define GITG_TYPE_PREFERENCES_DIALOG (gitg_preferences_dialog_get_type ())
#define GITG_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_PREFERENCES_DIALOG, GitgPreferencesDialog))
#define GITG_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_PREFERENCES_DIALOG, GitgPreferencesDialogClass))
#define GITG_IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_PREFERENCES_DIALOG))
#define GITG_IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_PREFERENCES_DIALOG))
#define GITG_PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_PREFERENCES_DIALOG, GitgPreferencesDialogClass))

typedef struct _GitgPreferencesDialog GitgPreferencesDialog;
typedef struct _GitgPreferencesDialogClass GitgPreferencesDialogClass;

#define GITG_TYPE_DASH_VIEW (gitg_dash_view_get_type ())
#define GITG_DASH_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DASH_VIEW, GitgDashView))
#define GITG_DASH_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_DASH_VIEW, GitgDashViewClass))
#define GITG_IS_DASH_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DASH_VIEW))
#define GITG_IS_DASH_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_DASH_VIEW))
#define GITG_DASH_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_DASH_VIEW, GitgDashViewClass))

typedef struct _GitgDashView GitgDashView;
typedef struct _GitgDashViewClass GitgDashViewClass;
typedef enum  {
	GITG_WINDOW_MODE_DASH,
	GITG_WINDOW_MODE_ACTIVITY
} GitgWindowMode;

#define GITG_WINDOW_TYPE_MODE (gitg_window_mode_get_type ())
enum  {
	GITG_WINDOW_0_PROPERTY,
	GITG_WINDOW_CURRENT_ACTIVITY_PROPERTY,
	GITG_WINDOW_MESSAGE_BUS_PROPERTY,
	GITG_WINDOW_REPOSITORY_PROPERTY,
	GITG_WINDOW_ENABLE_MONITORING_PROPERTY,
	GITG_WINDOW_ENVIRONMENT_PROPERTY,
	GITG_WINDOW_BUSY_PROPERTY,
	GITG_WINDOW_SELECTABLE_MODE_PROPERTY,
	GITG_WINDOW_REMOTE_LOOKUP_PROPERTY,
	GITG_WINDOW_NOTIFICATIONS_PROPERTY,
	GITG_WINDOW_NUM_PROPERTIES
};
static GParamSpec* gitg_window_properties[GITG_WINDOW_NUM_PROPERTIES];
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GITG_TYPE_CLONE_DIALOG (gitg_clone_dialog_get_type ())
#define GITG_CLONE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_CLONE_DIALOG, GitgCloneDialog))
#define GITG_CLONE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_CLONE_DIALOG, GitgCloneDialogClass))
#define GITG_IS_CLONE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_CLONE_DIALOG))
#define GITG_IS_CLONE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_CLONE_DIALOG))
#define GITG_CLONE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_CLONE_DIALOG, GitgCloneDialogClass))

typedef struct _GitgCloneDialog GitgCloneDialog;
typedef struct _GitgCloneDialogClass GitgCloneDialogClass;
typedef struct _Block84Data Block84Data;
typedef struct _Block85Data Block85Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef gboolean (*GitgRecursiveMonitorFilterFunc) (GFile* file, gpointer user_data);
typedef struct _Block86Data Block86Data;

#define GITG_TYPE_AUTHOR_DETAILS_DIALOG (gitg_author_details_dialog_get_type ())
#define GITG_AUTHOR_DETAILS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_AUTHOR_DETAILS_DIALOG, GitgAuthorDetailsDialog))
#define GITG_AUTHOR_DETAILS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_AUTHOR_DETAILS_DIALOG, GitgAuthorDetailsDialogClass))
#define GITG_IS_AUTHOR_DETAILS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_AUTHOR_DETAILS_DIALOG))
#define GITG_IS_AUTHOR_DETAILS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_AUTHOR_DETAILS_DIALOG))
#define GITG_AUTHOR_DETAILS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_AUTHOR_DETAILS_DIALOG, GitgAuthorDetailsDialogClass))

typedef struct _GitgAuthorDetailsDialog GitgAuthorDetailsDialog;
typedef struct _GitgAuthorDetailsDialogClass GitgAuthorDetailsDialogClass;
typedef struct _Block87Data Block87Data;
typedef gboolean (*GitgUIElementsForeachUIElementFunc) (GitgExtUIElement* element, gpointer user_data);

#define GITG_TYPE_APPLICATION (gitg_application_get_type ())
#define GITG_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_APPLICATION, GitgApplication))
#define GITG_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_APPLICATION, GitgApplicationClass))
#define GITG_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_APPLICATION))
#define GITG_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_APPLICATION))
#define GITG_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_APPLICATION, GitgApplicationClass))

typedef struct _GitgApplication GitgApplication;
typedef struct _GitgApplicationClass GitgApplicationClass;

#define GITG_TYPE_PLUGINS_ENGINE (gitg_plugins_engine_get_type ())
#define GITG_PLUGINS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_PLUGINS_ENGINE, GitgPluginsEngine))
#define GITG_PLUGINS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_PLUGINS_ENGINE, GitgPluginsEngineClass))
#define GITG_IS_PLUGINS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_PLUGINS_ENGINE))
#define GITG_IS_PLUGINS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_PLUGINS_ENGINE))
#define GITG_PLUGINS_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_PLUGINS_ENGINE, GitgPluginsEngineClass))

typedef struct _GitgPluginsEngine GitgPluginsEngine;
typedef struct _GitgPluginsEngineClass GitgPluginsEngineClass;

#define GITG_HISTORY_TYPE_ACTIVITY (gitg_history_activity_get_type ())
#define GITG_HISTORY_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivity))
#define GITG_HISTORY_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivityClass))
#define GITG_HISTORY_IS_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_HISTORY_TYPE_ACTIVITY))
#define GITG_HISTORY_IS_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_HISTORY_TYPE_ACTIVITY))
#define GITG_HISTORY_ACTIVITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivityClass))

typedef struct _GitgHistoryActivity GitgHistoryActivity;
typedef struct _GitgHistoryActivityClass GitgHistoryActivityClass;

#define GITG_COMMIT_TYPE_ACTIVITY (gitg_commit_activity_get_type ())
#define GITG_COMMIT_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivity))
#define GITG_COMMIT_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivityClass))
#define GITG_COMMIT_IS_ACTIVITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_ACTIVITY))
#define GITG_COMMIT_IS_ACTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_ACTIVITY))
#define GITG_COMMIT_ACTIVITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_ACTIVITY, GitgCommitActivityClass))

typedef struct _GitgCommitActivity GitgCommitActivity;
typedef struct _GitgCommitActivityClass GitgCommitActivityClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block88Data Block88Data;
typedef struct _Block89Data Block89Data;
typedef struct _GitgWindowUserQueryAsyncData GitgWindowUserQueryAsyncData;
typedef struct _Block90Data Block90Data;
typedef struct _Block91Data Block91Data;
enum  {
	GITG_WINDOW_CHANGE_TO_ACTIVITY_SIGNAL,
	GITG_WINDOW_CANCEL_SIGNAL,
	GITG_WINDOW_NUM_SIGNALS
};
static guint gitg_window_signals[GITG_WINDOW_NUM_SIGNALS] = {0};

struct _GitgWindow {
	GtkApplicationWindow parent_instance;
	GitgWindowPrivate * priv;
};

struct _GitgWindowClass {
	GtkApplicationWindowClass parent_class;
	gboolean (*change_to_activity) (GitgWindow* self, gint i);
	void (*cancel) (GitgWindow* self);
};

struct _GitgWindowPrivate {
	GSettings* d_state_settings;
	GSettings* d_interface_settings;
	GitgRepository* d_repository;
	GitgRecursiveMonitor* d_repository_monitor;
	GitgExtMessageBus* d_message_bus;
	gchar* d_action;
	GeeHashMap* d_environment;
	gboolean d_busy;
	GtkDialog* d_dialog;
	GtkWidget* d_select_actions;
	GBinding* d_selectable_mode_binding;
	GBinding* d_selectable_available_binding;
	GBinding* d_searchable_available_binding;
	GitgExtSelectionMode d_selectable_mode;
	GitgUIElements* d_activities;
	GitgRemoteManager* d_remote_manager;
	GitgNotifications* d_notifications;
	GitgPreferencesDialog* d_preferences;
	GtkShortcutsWindow* d_shortcuts;
	GtkHeaderBar* d_header_bar;
	GtkToggleButton* d_search_button;
	GtkMenuButton* d_gear_menu;
	GtkImage* gear_image;
	GMenuModel* d_activities_model;
	GMenuModel* d_dash_model;
	GtkGrid* d_grid_main;
	GtkGrid* d_grid_top;
	GtkToggleButton* d_select_button;
	GtkButton* d_select_cancel_button;
	GtkButton* d_dash_button;
	GtkButton* d_clone_button;
	GtkButton* d_add_button;
	GtkImage* dash_image;
	GtkStackSwitcher* d_activities_switcher;
	GtkSearchBar* d_search_bar;
	GtkSearchEntry* d_search_entry;
	GtkStack* d_main_stack;
	GitgDashView* d_dash_view;
	GtkStack* d_stack_activities;
	GtkInfoBar* d_infobar;
	GtkLabel* d_infobar_primary_label;
	GtkLabel* d_infobar_secondary_label;
	GtkOverlay* d_overlay;
	GitgWindowMode d_mode;
	gboolean d_enable_monitoring;
};

struct _Block84Data {
	int _ref_count_;
	GitgWindow* self;
	GitgCloneDialog* dlg;
};

struct _Block85Data {
	int _ref_count_;
	GitgWindow* self;
	GtkFileChooserDialog* chooser;
	GtkCheckButton* scan_all;
};

struct _Block86Data {
	int _ref_count_;
	GitgWindow* self;
	GtkFileChooserDialog* chooser;
};

struct _Block87Data {
	int _ref_count_;
	GitgWindow* self;
	gchar* default_activity;
	GitgExtActivity* def;
};

struct _Block88Data {
	int _ref_count_;
	GitgWindow* self;
	gchar* title;
	gchar* message;
	GtkMessageType type;
};

struct _Block89Data {
	int _ref_count_;
	GitgWindow* self;
	GSourceFunc cb;
	gpointer cb_target;
	GDestroyNotify cb_target_destroy_notify;
	GtkResponseType retval;
	gpointer _async_data_;
};

struct _GitgWindowUserQueryAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GitgWindow* self;
	GitgExtUserQuery* query;
	GtkResponseType result;
	Block89Data* _data89_;
};

struct _Block90Data {
	int _ref_count_;
	GitgWindow* self;
	GtkMessageDialog* dlg;
	gulong qid;
	GitgExtUserQuery* query;
};

struct _Block91Data {
	int _ref_count_;
	GitgWindow* self;
	GAction* selact;
};

static gint GitgWindow_private_offset;
static gpointer gitg_window_parent_class = NULL;
static GitgExtApplicationIface * gitg_window_gitg_ext_application_parent_iface = NULL;
static GInitableIface * gitg_window_g_initable_parent_iface = NULL;

VALA_EXTERN GType gitg_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgWindow, g_object_unref)
VALA_EXTERN GType gitg_recursive_monitor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRecursiveMonitor, g_object_unref)
VALA_EXTERN GType gitg_ui_elements_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgUIElements, g_object_unref)
VALA_EXTERN GType gitg_remote_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRemoteManager, g_object_unref)
VALA_EXTERN GType gitg_notifications_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgNotifications, g_object_unref)
VALA_EXTERN GType gitg_preferences_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgPreferencesDialog, g_object_unref)
VALA_EXTERN GType gitg_dash_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgDashView, g_object_unref)
static GType gitg_window_mode_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void gitg_window_on_search_activated (GitgWindow* self,
                                      GSimpleAction* action);
static void _gitg_window_on_search_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self);
static void gitg_window_on_gear_menu_activated (GitgWindow* self,
                                         GSimpleAction* action);
static void _gitg_window_on_gear_menu_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self);
static void gitg_window_on_open_repository (GitgWindow* self);
static void _gitg_window_on_open_repository_gsimple_action_activate_callback (GSimpleAction* action,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void gitg_window_on_close_activated (GitgWindow* self);
static void _gitg_window_on_close_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void gitg_window_on_reload_activated (GitgWindow* self);
static void _gitg_window_on_reload_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self);
static void gitg_window_on_repo_author_details_activated (GitgWindow* self);
static void _gitg_window_on_repo_author_details_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                     GVariant* parameter,
                                                                                     gpointer self);
static void gitg_window_on_preferences_activated (GitgWindow* self);
static void _gitg_window_on_preferences_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self);
static void gitg_window_on_select_activated (GitgWindow* self,
                                      GSimpleAction* action);
static void _gitg_window_on_select_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self);
static void gitg_window_on_shortcuts_activated (GitgWindow* self);
static void _gitg_window_on_shortcuts_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self);
static void gitg_window_dash_button_clicked (GitgWindow* self,
                                      GtkButton* dash);
static void _gitg_window_dash_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self);
static void gitg_window_clone_repository_clicked (GitgWindow* self);
VALA_EXTERN GType gitg_clone_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCloneDialog, g_object_unref)
static Block84Data* block84_data_ref (Block84Data* _data84_);
static void block84_data_unref (void * _userdata_);
VALA_EXTERN GitgCloneDialog* gitg_clone_dialog_new (GtkWindow* parent);
VALA_EXTERN GitgCloneDialog* gitg_clone_dialog_construct (GType object_type,
                                              GtkWindow* parent);
static void __lambda183_ (Block84Data* _data84_,
                   GtkDialog* d,
                   gint id);
VALA_EXTERN void gitg_dash_view_clone_repository (GitgDashView* self,
                                      const gchar* url,
                                      GFile* location,
                                      gboolean is_bare);
VALA_EXTERN const gchar* gitg_clone_dialog_get_url (GitgCloneDialog* self);
VALA_EXTERN GFile* gitg_clone_dialog_get_location (GitgCloneDialog* self);
VALA_EXTERN gboolean gitg_clone_dialog_get_is_bare (GitgCloneDialog* self);
static void ___lambda183__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
static void _gitg_window_clone_repository_clicked_gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self);
static void gitg_window_add_repository_clicked (GitgWindow* self);
static Block85Data* block85_data_ref (Block85Data* _data85_);
static void block85_data_unref (void * _userdata_);
static void __lambda184_ (Block85Data* _data85_,
                   GtkDialog* c,
                   gint id);
VALA_EXTERN void gitg_dash_view_add_repository_from_location (GitgDashView* self,
                                                  GFile* location,
                                                  gboolean scan_all);
static void ___lambda184__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
static void _gitg_window_add_repository_clicked_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self);
static void gitg_window_search_button_toggled (GitgWindow* self,
                                        GtkToggleButton* button);
static void _gitg_window_search_button_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                   gpointer self);
static void gitg_window_search_entry_changed (GitgWindow* self,
                                       GtkEditable* entry);
static void _gitg_window_search_entry_changed_gtk_editable_changed (GtkEditable* _sender,
                                                             gpointer self);
VALA_EXTERN gboolean gitg_window_on_key_pressed (GitgWindow* self,
                                     GtkWidget* widget,
                                     GdkEventKey* event);
VALA_EXTERN gconstpointer gitg_ui_elements_get_current (GitgUIElements* self);
static gboolean _gitg_window_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                 GdkEventKey* event,
                                                                 gpointer self);
static void gitg_window_real_style_updated (GtkWidget* base);
static gboolean gitg_window_real_delete_event (GtkWidget* base,
                                        GdkEventAny* event);
static GitgExtApplication* gitg_window_real_open_new (GitgExtApplication* base,
                                               GgitRepository* repository,
                                               const gchar* hint);
VALA_EXTERN GitgWindow* gitg_window_create_new (GtkApplication* app,
                                    GitgRepository* repository,
                                    const gchar* action);
static void gitg_window_update_title (GitgWindow* self);
static void gitg_window_repository_changed (GitgWindow* self);
VALA_EXTERN GitgRepositoryListBoxRow* gitg_dash_view_add_repository (GitgDashView* self,
                                                         GitgRepository* repository);
VALA_EXTERN void gitg_ui_elements_update (GitgUIElements* self);
static void gitg_window_activate_default_activity (GitgWindow* self);
static void gitg_window_on_current_activity_changed (GitgWindow* self);
static void gitg_window_real_realize (GtkWidget* base);
static gboolean ___lambda185_ (GitgWindow* self);
static gboolean ____lambda185__gsource_func (gpointer self);
static gboolean gitg_window_real_window_state_event (GtkWidget* base,
                                              GdkEventWindowState* event);
static gboolean gitg_window_real_configure_event (GtkWidget* base,
                                           GdkEventConfigure* event);
static GitgExtExternalChangeHint gitg_window_external_change_hint_from_file (GitgWindow* self,
                                                                      GFile* location);
static gboolean gitg_window_filter_repository_changes (GitgWindow* self,
                                                GFile* location);
static void gitg_window_set_repository_internal (GitgWindow* self,
                                          GitgRepository* repository);
VALA_EXTERN void gitg_recursive_monitor_cancel (GitgRecursiveMonitor* self);
static void gitg_window_update_enable_monitoring (GitgWindow* self);
VALA_EXTERN GitgRemoteManager* gitg_remote_manager_new (GitgWindow* window);
VALA_EXTERN GitgRemoteManager* gitg_remote_manager_construct (GType object_type,
                                                  GitgWindow* window);
VALA_EXTERN gboolean gitg_window_get_enable_monitoring (GitgWindow* self);
static gboolean _gitg_window_filter_repository_changes_gitg_recursive_monitor_filter_func (GFile* file,
                                                                                    gpointer self);
VALA_EXTERN GitgRecursiveMonitor* gitg_recursive_monitor_new (GFile* location,
                                                  GitgRecursiveMonitorFilterFunc filter_func,
                                                  gpointer filter_func_target,
                                                  GDestroyNotify filter_func_target_destroy_notify);
VALA_EXTERN GitgRecursiveMonitor* gitg_recursive_monitor_construct (GType object_type,
                                                        GFile* location,
                                                        GitgRecursiveMonitorFilterFunc filter_func,
                                                        gpointer filter_func_target,
                                                        GDestroyNotify filter_func_target_destroy_notify);
static void ___lambda153_ (GitgWindow* self,
                    GFile** files,
                    gint files_length1);
static void ____lambda153__gitg_recursive_monitor_changed (GitgRecursiveMonitor* _sender,
                                                    GFile** files,
                                                    gint files_length1,
                                                    gpointer self);
static Block86Data* block86_data_ref (Block86Data* _data86_);
static void block86_data_unref (void * _userdata_);
static void __lambda177_ (Block86Data* _data86_,
                   GtkDialog* c,
                   gint id);
static void ___lambda177__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
VALA_EXTERN GType gitg_author_details_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgAuthorDetailsDialog, g_object_unref)
VALA_EXTERN GitgAuthorDetailsDialog* gitg_author_details_dialog_new (GtkWindow* parent,
                                                         GgitConfig* config,
                                                         const gchar* repository_name);
VALA_EXTERN GitgAuthorDetailsDialog* gitg_author_details_dialog_construct (GType object_type,
                                                               GtkWindow* parent,
                                                               GgitConfig* config,
                                                               const gchar* repository_name);
VALA_EXTERN gpointer gitg_builder_load_object (GType t_type,
                                   GBoxedCopyFunc t_dup_func,
                                   GDestroyNotify t_destroy_func,
                                   const gchar* id,
                                   const gchar* object);
static void ___lambda179_ (GitgWindow* self,
                    GtkWidget* w);
static void ____lambda179__gtk_widget_destroy (GtkWidget* _sender,
                                        gpointer self);
static void ___lambda180_ (GitgWindow* self,
                    GtkWidget* w);
static void ____lambda180__gtk_widget_destroy (GtkWidget* _sender,
                                        gpointer self);
static gboolean gitg_window_activate_activity (GitgWindow* self,
                                        const gchar* action);
static Block87Data* block87_data_ref (Block87Data* _data87_);
static void block87_data_unref (void * _userdata_);
VALA_EXTERN void gitg_ui_elements_foreach (GitgUIElements* self,
                               GitgUIElementsForeachUIElementFunc func,
                               gpointer func_target);
static gboolean __lambda171_ (Block87Data* _data87_,
                       GitgExtUIElement* element);
static gboolean ___lambda171__gitg_ui_elements_foreach_ui_element_func (GitgExtUIElement* element,
                                                                 gpointer self);
VALA_EXTERN void gitg_ui_elements_set_current (GitgUIElements* self,
                                   gconstpointer value);
static gboolean ___lambda172_ (GitgWindow* self,
                        GitgExtUIElement* element);
static gboolean ____lambda172__gitg_ui_elements_foreach_ui_element_func (GitgExtUIElement* element,
                                                                  gpointer self);
static gboolean gitg_window_real_init (GInitable* base,
                                GCancellable* cancellable,
                                GError** error);
VALA_EXTERN GType gitg_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgApplication, g_object_unref)
VALA_EXTERN GSettings* gitg_application_get_state_settings (GitgApplication* self);
VALA_EXTERN GType gitg_plugins_engine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgPluginsEngine, g_object_unref)
VALA_EXTERN GitgPluginsEngine* gitg_plugins_engine_get_default (void);
VALA_EXTERN GitgHistoryActivity* gitg_history_activity_new (GitgExtApplication* application);
VALA_EXTERN GitgHistoryActivity* gitg_history_activity_construct (GType object_type,
                                                      GitgExtApplication* application);
VALA_EXTERN GType gitg_history_activity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryActivity, g_object_unref)
VALA_EXTERN GitgCommitActivity* gitg_commit_activity_new (GitgExtApplication* application);
VALA_EXTERN GitgCommitActivity* gitg_commit_activity_construct (GType object_type,
                                                    GitgExtApplication* application);
VALA_EXTERN GType gitg_commit_activity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActivity, g_object_unref)
VALA_EXTERN GitgUIElements* gitg_ui_elements_new_with_builtin (GType t_type,
                                                   GBoxedCopyFunc t_dup_func,
                                                   GDestroyNotify t_destroy_func,
                                                   gpointer* builtin,
                                                   gint builtin_length1,
                                                   PeasExtensionSet* extensions,
                                                   GtkStack* stack);
VALA_EXTERN GitgUIElements* gitg_ui_elements_construct_with_builtin (GType object_type,
                                                         GType t_type,
                                                         GBoxedCopyFunc t_dup_func,
                                                         GDestroyNotify t_destroy_func,
                                                         gpointer* builtin,
                                                         gint builtin_length1,
                                                         PeasExtensionSet* extensions,
                                                         GtkStack* stack);
VALA_EXTERN GitgUIElements* gitg_history_activity_get_d_panels (GitgHistoryActivity* self);
VALA_EXTERN gpointer* gitg_ui_elements_get_available_elements (GitgUIElements* self,
                                                   gint* result_length1);
VALA_EXTERN void gitg_application_register_shortcut (GitgApplication* self,
                                         const gchar* name,
                                         guint shortcut);
static void _gitg_window_on_current_activity_changed_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self);
VALA_EXTERN void gitg_window_set_environment (GitgWindow* self,
                                  gchar** environment,
                                  gint environment_length1);
VALA_EXTERN GitgWindow* gitg_window_new (void);
VALA_EXTERN GitgWindow* gitg_window_construct (GType object_type);
static GitgExtActivity* gitg_window_real_set_activity_by_id (GitgExtApplication* base,
                                                      const gchar* id);
VALA_EXTERN gpointer gitg_ui_elements_lookup (GitgUIElements* self,
                                  const gchar* id);
static GitgExtActivity* gitg_window_real_get_activity_by_id (GitgExtApplication* base,
                                                      const gchar* id);
static void gitg_window_real_open_repository (GitgExtApplication* base,
                                       GFile* path);
static void gitg_window_real_show_infobar (GitgExtApplication* base,
                                    const gchar* title,
                                    const gchar* message,
                                    GtkMessageType type);
static Block88Data* block88_data_ref (Block88Data* _data88_);
static void block88_data_unref (void * _userdata_);
static gboolean __lambda178_ (Block88Data* _data88_);
static gboolean ___lambda178__gsource_func (gpointer self);
static void gitg_window_real_user_query_async_data_free (gpointer _data);
static void gitg_window_real_user_query_async (GitgExtApplication* base,
                                        GitgExtUserQuery* query,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static gboolean gitg_window_real_user_query_async_co (GitgWindowUserQueryAsyncData* _data_);
static Block89Data* block89_data_ref (Block89Data* _data89_);
static void block89_data_unref (void * _userdata_);
static gboolean _gitg_window_real_user_query_async_co_gsource_func (gpointer self);
static gboolean __lambda186_ (Block89Data* _data89_,
                       GtkResponseType response);
static gboolean ___lambda186__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                                     GtkResponseType response_type,
                                                     gpointer self);
static void gitg_window_real_user_query (GitgExtApplication* base,
                                  GitgExtUserQuery* query);
static Block90Data* block90_data_ref (Block90Data* _data90_);
static void block90_data_unref (void * _userdata_);
static void __lambda187_ (Block90Data* _data90_);
static void ___lambda187__gitg_ext_user_query_quit (GitgExtUserQuery* _sender,
                                             gpointer self);
static void __lambda188_ (Block90Data* _data90_,
                   GtkDialog* w,
                   gint r);
static void ___lambda188__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
static GgitSignature* gitg_window_real_get_verified_committer (GitgExtApplication* base);
VALA_EXTERN void gitg_window_present (GitgWindow* self,
                          const gchar* hint,
                          GitgExtCommandLines* command_lines);
static void gitg_window_on_select_cancel_button_clicked (GitgWindow* self);
VALA_EXTERN void gitg_window_set_selectable_mode (GitgWindow* self,
                                      GitgExtSelectionMode value);
static void _gitg_window_on_select_cancel_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                      gpointer self);
VALA_EXTERN void gitg_window_set_enable_monitoring (GitgWindow* self,
                                        gboolean value);
VALA_EXTERN GitgExtSelectionMode gitg_window_get_selectable_mode (GitgWindow* self);
static gboolean gitg_window_real_change_to_activity (GitgWindow* self,
                                              gint i);
static void g_cclosure_user_marshal_BOOLEAN__INT (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data);
static void gitg_window_real_cancel (GitgWindow* self);
static GObject * gitg_window_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties);
static Block91Data* block91_data_ref (Block91Data* _data91_);
static void block91_data_unref (void * _userdata_);
VALA_EXTERN GitgNotifications* gitg_notifications_new (GtkOverlay* overlay);
VALA_EXTERN GitgNotifications* gitg_notifications_construct (GType object_type,
                                                 GtkOverlay* overlay);
static void _gitg_window___lambda189_ (Block91Data* _data91_);
static void __gitg_window___lambda189__g_object_notify (GObject* _sender,
                                                 GParamSpec* pspec,
                                                 gpointer self);
static void _gitg_window___lambda190_ (GitgWindow* self,
                                GtkInfoBar* w,
                                gint r);
static void __gitg_window___lambda190__gtk_info_bar_response (GtkInfoBar* _sender,
                                                       gint response_id,
                                                       gpointer self);
static void gitg_window_finalize (GObject * obj);
static GType gitg_window_get_type_once (void);
static void _vala_gitg_window_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_gitg_window_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);
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 gssize _vala_array_length (gpointer array);

static const GActionEntry GITG_WINDOW_win_entries[8] = {{"search", _gitg_window_on_search_activated_gsimple_action_activate_callback, NULL, "false", NULL}, {"gear-menu", _gitg_window_on_gear_menu_activated_gsimple_action_activate_callback, NULL, "false", NULL}, {"open-repository", _gitg_window_on_open_repository_gsimple_action_activate_callback}, {"close", _gitg_window_on_close_activated_gsimple_action_activate_callback}, {"reload", _gitg_window_on_reload_activated_gsimple_action_activate_callback}, {"author-details-repo", _gitg_window_on_repo_author_details_activated_gsimple_action_activate_callback}, {"preferences", _gitg_window_on_preferences_activated_gsimple_action_activate_callback}, {"select", _gitg_window_on_select_activated_gsimple_action_activate_callback, NULL, "false", NULL}};
static const GActionEntry GITG_WINDOW_shortcut_window_entries[1] = {{"shortcuts", _gitg_window_on_shortcuts_activated_gsimple_action_activate_callback}};

static inline gpointer
gitg_window_get_instance_private (GitgWindow* self)
{
	return G_STRUCT_MEMBER_P (self, GitgWindow_private_offset);
}

 G_GNUC_NO_INLINE static GType
gitg_window_mode_get_type_once (void)
{
	static const GEnumValue values[] = {{GITG_WINDOW_MODE_DASH, "GITG_WINDOW_MODE_DASH", "dash"}, {GITG_WINDOW_MODE_ACTIVITY, "GITG_WINDOW_MODE_ACTIVITY", "activity"}, {0, NULL, NULL}};
	GType gitg_window_mode_type_id;
	gitg_window_mode_type_id = g_enum_register_static ("GitgWindowMode", values);
	return gitg_window_mode_type_id;
}

static GType
gitg_window_mode_get_type (void)
{
	static gsize gitg_window_mode_type_id__once = 0;
	if (g_once_init_enter (&gitg_window_mode_type_id__once)) {
		GType gitg_window_mode_type_id;
		gitg_window_mode_type_id = gitg_window_mode_get_type_once ();
		g_once_init_leave (&gitg_window_mode_type_id__once, gitg_window_mode_type_id);
	}
	return gitg_window_mode_type_id__once;
}

static void
_gitg_window_on_search_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self)
{
	gitg_window_on_search_activated ((GitgWindow*) self, action);
}

static void
_gitg_window_on_gear_menu_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self)
{
	gitg_window_on_gear_menu_activated ((GitgWindow*) self, action);
}

static void
_gitg_window_on_open_repository_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	gitg_window_on_open_repository ((GitgWindow*) self);
}

static void
_gitg_window_on_close_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	gitg_window_on_close_activated ((GitgWindow*) self);
}

static void
_gitg_window_on_reload_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self)
{
	gitg_window_on_reload_activated ((GitgWindow*) self);
}

static void
_gitg_window_on_repo_author_details_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self)
{
	gitg_window_on_repo_author_details_activated ((GitgWindow*) self);
}

static void
_gitg_window_on_preferences_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self)
{
	gitg_window_on_preferences_activated ((GitgWindow*) self);
}

static void
_gitg_window_on_select_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self)
{
	gitg_window_on_select_activated ((GitgWindow*) self, action);
}

static void
_gitg_window_on_shortcuts_activated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self)
{
	gitg_window_on_shortcuts_activated ((GitgWindow*) self);
}

static void
gitg_window_dash_button_clicked (GitgWindow* self,
                                 GtkButton* dash)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (dash != NULL);
	gitg_ext_application_set_repository ((GitgExtApplication*) self, NULL);
}

static void
_gitg_window_dash_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                     gpointer self)
{
	gitg_window_dash_button_clicked ((GitgWindow*) self, _sender);
}

static Block84Data*
block84_data_ref (Block84Data* _data84_)
{
	g_atomic_int_inc (&_data84_->_ref_count_);
	return _data84_;
}

static void
block84_data_unref (void * _userdata_)
{
	Block84Data* _data84_;
	_data84_ = (Block84Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data84_->_ref_count_)) {
		GitgWindow* self;
		self = _data84_->self;
		_g_object_unref0 (_data84_->dlg);
		_g_object_unref0 (self);
		g_slice_free (Block84Data, _data84_);
	}
}

static void
__lambda183_ (Block84Data* _data84_,
              GtkDialog* d,
              gint id)
{
	GitgWindow* self;
	self = _data84_->self;
	g_return_if_fail (d != NULL);
	if (id == ((gint) GTK_RESPONSE_OK)) {
		GitgDashView* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		GFile* _tmp3_;
		GFile* _tmp4_;
		GFile* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp0_ = self->priv->d_dash_view;
		_tmp1_ = gitg_clone_dialog_get_url (_data84_->dlg);
		_tmp2_ = _tmp1_;
		_tmp3_ = gitg_clone_dialog_get_location (_data84_->dlg);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gitg_clone_dialog_get_is_bare (_data84_->dlg);
		_tmp7_ = _tmp6_;
		gitg_dash_view_clone_repository (_tmp0_, _tmp2_, _tmp5_, _tmp7_);
		_g_object_unref0 (_tmp5_);
	}
	gtk_widget_destroy ((GtkWidget*) d);
}

static void
___lambda183__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda183_ (self, _sender, response_id);
}

static void
gitg_window_clone_repository_clicked (GitgWindow* self)
{
	Block84Data* _data84_;
	GitgCloneDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data84_ = g_slice_new0 (Block84Data);
	_data84_->_ref_count_ = 1;
	_data84_->self = g_object_ref (self);
	_tmp0_ = gitg_clone_dialog_new ((GtkWindow*) self);
	g_object_ref_sink (_tmp0_);
	_data84_->dlg = _tmp0_;
	g_signal_connect_data ((GtkDialog*) _data84_->dlg, "response", (GCallback) ___lambda183__gtk_dialog_response, block84_data_ref (_data84_), (GClosureNotify) block84_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data84_->dlg);
	block84_data_unref (_data84_);
	_data84_ = NULL;
}

static void
_gitg_window_clone_repository_clicked_gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self)
{
	gitg_window_clone_repository_clicked ((GitgWindow*) self);
}

static Block85Data*
block85_data_ref (Block85Data* _data85_)
{
	g_atomic_int_inc (&_data85_->_ref_count_);
	return _data85_;
}

static void
block85_data_unref (void * _userdata_)
{
	Block85Data* _data85_;
	_data85_ = (Block85Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data85_->_ref_count_)) {
		GitgWindow* self;
		self = _data85_->self;
		_g_object_unref0 (_data85_->scan_all);
		_g_object_unref0 (_data85_->chooser);
		_g_object_unref0 (self);
		g_slice_free (Block85Data, _data85_);
	}
}

static void
__lambda184_ (Block85Data* _data85_,
              GtkDialog* c,
              gint id)
{
	GitgWindow* self;
	self = _data85_->self;
	g_return_if_fail (c != NULL);
	if (id == ((gint) GTK_RESPONSE_OK)) {
		GFile* file = NULL;
		GFile* _tmp0_;
		GFile* _tmp1_;
		GitgDashView* _tmp3_;
		GFile* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp0_ = gtk_file_chooser_get_file ((GtkFileChooser*) _data85_->chooser);
		file = _tmp0_;
		_tmp1_ = file;
		if (_tmp1_ == NULL) {
			GFile* _tmp2_;
			_tmp2_ = gtk_file_chooser_get_current_folder_file ((GtkFileChooser*) _data85_->chooser);
			_g_object_unref0 (file);
			file = _tmp2_;
		}
		_tmp3_ = self->priv->d_dash_view;
		_tmp4_ = file;
		_tmp5_ = gtk_toggle_button_get_active ((GtkToggleButton*) _data85_->scan_all);
		_tmp6_ = _tmp5_;
		gitg_dash_view_add_repository_from_location (_tmp3_, _tmp4_, _tmp6_);
		_g_object_unref0 (file);
	}
	gtk_widget_destroy ((GtkWidget*) c);
}

static void
___lambda184__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda184_ (self, _sender, response_id);
}

static void
gitg_window_add_repository_clicked (GitgWindow* self)
{
	Block85Data* _data85_;
	GtkFileChooserDialog* _tmp0_;
	GtkCheckButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_data85_ = g_slice_new0 (Block85Data);
	_data85_->_ref_count_ = 1;
	_data85_->self = g_object_ref (self);
	_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_ ("Add Repository"), (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _ ("_Cancel"), GTK_RESPONSE_CANCEL, _ ("_Add"), GTK_RESPONSE_OK, NULL);
	g_object_ref_sink (_tmp0_);
	_data85_->chooser = _tmp0_;
	_tmp1_ = (GtkCheckButton*) gtk_check_button_new_with_mnemonic (_ ("_Scan for all git repositories from this directory"));
	g_object_ref_sink (_tmp1_);
	_data85_->scan_all = _tmp1_;
	gtk_widget_set_halign ((GtkWidget*) _data85_->scan_all, GTK_ALIGN_END);
	gtk_widget_set_hexpand ((GtkWidget*) _data85_->scan_all, TRUE);
	gtk_widget_show ((GtkWidget*) _data85_->scan_all);
	gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _data85_->chooser, (GtkWidget*) _data85_->scan_all);
	gtk_window_set_modal ((GtkWindow*) _data85_->chooser, TRUE);
	gtk_dialog_set_default_response ((GtkDialog*) _data85_->chooser, (gint) GTK_RESPONSE_OK);
	g_signal_connect_data ((GtkDialog*) _data85_->chooser, "response", (GCallback) ___lambda184__gtk_dialog_response, block85_data_ref (_data85_), (GClosureNotify) block85_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data85_->chooser);
	block85_data_unref (_data85_);
	_data85_ = NULL;
}

static void
_gitg_window_add_repository_clicked_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self)
{
	gitg_window_add_repository_clicked ((GitgWindow*) self);
}

static void
gitg_window_search_button_toggled (GitgWindow* self,
                                   GtkToggleButton* button)
{
	GitgExtSearchable* searchable = NULL;
	GitgExtActivity* _tmp0_;
	GitgExtActivity* _tmp1_;
	GitgExtSearchable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = gitg_ext_application_get_current_activity ((GitgExtApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GITG_EXT_TYPE_SEARCHABLE) ? ((GitgExtSearchable*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	searchable = _tmp2_;
	if (gtk_toggle_button_get_active (button)) {
		GtkSearchEntry* _tmp3_;
		GtkSearchEntry* _tmp4_;
		GitgExtSearchable* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GitgExtSearchable* _tmp9_;
		GitgExtSearchable* _tmp10_;
		GtkSearchEntry* _tmp11_;
		_tmp3_ = self->priv->d_search_entry;
		gtk_entry_grab_focus_without_selecting ((GtkEntry*) _tmp3_);
		_tmp4_ = self->priv->d_search_entry;
		_tmp5_ = searchable;
		_tmp6_ = gitg_ext_searchable_get_search_text (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		gtk_entry_set_text ((GtkEntry*) _tmp4_, _tmp8_);
		_g_free0 (_tmp8_);
		_tmp9_ = searchable;
		gitg_ext_searchable_set_search_visible (_tmp9_, TRUE);
		_tmp10_ = searchable;
		_tmp11_ = self->priv->d_search_entry;
		gitg_ext_searchable_set_search_entry (_tmp10_, (GtkEntry*) _tmp11_);
	} else {
		GitgExtSearchable* _tmp12_;
		GitgExtSearchable* _tmp13_;
		_tmp12_ = searchable;
		gitg_ext_searchable_set_search_visible (_tmp12_, FALSE);
		_tmp13_ = searchable;
		gitg_ext_searchable_set_search_entry (_tmp13_, NULL);
	}
	_g_object_unref0 (searchable);
}

static void
_gitg_window_search_button_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                              gpointer self)
{
	gitg_window_search_button_toggled ((GitgWindow*) self, _sender);
}

static void
gitg_window_search_entry_changed (GitgWindow* self,
                                  GtkEditable* entry)
{
	GitgExtSearchable* searchable = NULL;
	GitgExtActivity* _tmp0_;
	GitgExtActivity* _tmp1_;
	GitgExtSearchable* _tmp2_;
	gchar* ntext = NULL;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	GitgExtSearchable* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gboolean _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entry != NULL);
	_tmp0_ = gitg_ext_application_get_current_activity ((GitgExtApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GITG_EXT_TYPE_SEARCHABLE) ? ((GitgExtSearchable*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	searchable = _tmp2_;
	_tmp3_ = gtk_entry_get_text (G_TYPE_CHECK_INSTANCE_CAST (entry, gtk_entry_get_type (), GtkEntry));
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup (_tmp4_);
	ntext = _tmp5_;
	_tmp6_ = ntext;
	_tmp7_ = searchable;
	_tmp8_ = gitg_ext_searchable_get_search_text (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strcmp0 (_tmp6_, _tmp10_) != 0;
	_g_free0 (_tmp10_);
	if (_tmp11_) {
		GitgExtSearchable* _tmp12_;
		const gchar* _tmp13_;
		_tmp12_ = searchable;
		_tmp13_ = ntext;
		gitg_ext_searchable_set_search_text (_tmp12_, _tmp13_);
	}
	_g_free0 (ntext);
	_g_object_unref0 (searchable);
}

static void
_gitg_window_search_entry_changed_gtk_editable_changed (GtkEditable* _sender,
                                                        gpointer self)
{
	gitg_window_search_entry_changed ((GitgWindow*) self, _sender);
}

gboolean
gitg_window_on_key_pressed (GitgWindow* self,
                            GtkWidget* widget,
                            GdkEventKey* event)
{
	gboolean ret = FALSE;
	GtkSearchBar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->d_search_bar;
	ret = gtk_search_bar_handle_event (_tmp0_, (GdkEvent*) event);
	if (ret) {
		GtkSearchBar* _tmp1_;
		_tmp1_ = self->priv->d_search_bar;
		g_object_set (_tmp1_, "search-mode-enabled", TRUE, NULL);
	} else {
		GitgUIElements* _tmp2_;
		gconstpointer _tmp3_;
		gconstpointer _tmp4_;
		_tmp2_ = self->priv->d_activities;
		_tmp3_ = gitg_ui_elements_get_current (_tmp2_);
		_tmp4_ = _tmp3_;
		ret = gitg_ext_activity_on_key_pressed ((GitgExtActivity*) _tmp4_, event);
	}
	result = ret;
	return result;
}

static gboolean
_gitg_window_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender,
                                                        GdkEventKey* event,
                                                        gpointer self)
{
	gboolean result;
	result = gitg_window_on_key_pressed ((GitgWindow*) self, _sender, event);
	return result;
}

static void
gitg_window_real_style_updated (GtkWidget* base)
{
	GitgWindow * self;
	gboolean dark = FALSE;
	GitgTheme* _tmp0_;
	GitgTheme* _tmp1_;
	gboolean _tmp2_;
	self = (GitgWindow*) base;
	GTK_WIDGET_CLASS (gitg_window_parent_class)->style_updated ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow));
	_tmp0_ = gitg_theme_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	_tmp2_ = gitg_theme_is_theme_dark (_tmp1_);
	_g_object_unref0 (_tmp1_);
	dark = _tmp2_;
	if (dark) {
		GtkStyleContext* _tmp3_;
		_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_add_class (_tmp3_, "dark");
	} else {
		GtkStyleContext* _tmp4_;
		_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_remove_class (_tmp4_, "dark");
	}
}

static gboolean
gitg_window_real_delete_event (GtkWidget* base,
                               GdkEventAny* event)
{
	GitgWindow * self;
	gboolean ret = FALSE;
	gboolean result;
	self = (GitgWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	ret = FALSE;
	if (GTK_WIDGET_CLASS (gitg_window_parent_class)->delete_event != NULL) {
		ret = GTK_WIDGET_CLASS (gitg_window_parent_class)->delete_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), event);
	}
	if (!ret) {
		gitg_ext_application_set_repository ((GitgExtApplication*) self, NULL);
	}
	result = ret;
	return result;
}

static void
gitg_window_on_close_activated (GitgWindow* self)
{
	g_return_if_fail (self != NULL);
	gtk_window_close ((GtkWindow*) self);
}

static void
gitg_window_on_search_activated (GitgWindow* self,
                                 GSimpleAction* action)
{
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = self->priv->d_search_button;
	_tmp1_ = gtk_widget_get_visible ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gboolean state = FALSE;
		GVariant* _tmp3_;
		GVariant* _tmp4_;
		gboolean _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		_tmp3_ = g_action_get_state ((GAction*) action);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_variant_get_boolean (_tmp4_);
		_g_variant_unref0 (_tmp4_);
		state = _tmp5_;
		_tmp6_ = g_variant_new_boolean (!state);
		g_variant_ref_sink (_tmp6_);
		_tmp7_ = _tmp6_;
		g_simple_action_set_state (action, _tmp7_);
		_g_variant_unref0 (_tmp7_);
	}
}

static void
gitg_window_on_gear_menu_activated (GitgWindow* self,
                                    GSimpleAction* action)
{
	gboolean state = FALSE;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	gboolean _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_action_get_state ((GAction*) action);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_get_boolean (_tmp1_);
	_g_variant_unref0 (_tmp1_);
	state = _tmp2_;
	_tmp3_ = g_variant_new_boolean (!state);
	g_variant_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	g_simple_action_set_state (action, _tmp4_);
	_g_variant_unref0 (_tmp4_);
}

static GitgExtApplication*
gitg_window_real_open_new (GitgExtApplication* base,
                           GgitRepository* repository,
                           const gchar* hint)
{
	GitgWindow * self;
	GitgWindow* window = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	GitgWindow* _tmp2_;
	GitgExtApplication* result;
	self = (GitgWindow*) base;
	g_return_val_if_fail (repository != NULL, NULL);
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gitg_window_create_new (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (repository, GITG_TYPE_REPOSITORY, GitgRepository), hint);
	window = _tmp2_;
	gtk_window_present ((GtkWindow*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow));
	result = (GitgExtApplication*) window;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
gitg_window_update_title (GitgWindow* self)
{
	gchar* windowtitle = NULL;
	gchar* _tmp0_;
	gchar* title = NULL;
	gchar* subtitle = NULL;
	GitgRepository* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("gitg");
	windowtitle = _tmp0_;
	subtitle = NULL;
	_tmp1_ = self->priv->d_repository;
	if (_tmp1_ != NULL) {
		GFile* workdir = NULL;
		GitgRepository* _tmp2_;
		GFile* _tmp3_;
		GFile* _tmp4_;
		gchar* head_name = NULL;
		const gchar* _tmp38_;
		_tmp2_ = self->priv->d_repository;
		_tmp3_ = ggit_repository_get_workdir ((GgitRepository*) _tmp2_);
		workdir = _tmp3_;
		_tmp4_ = workdir;
		if (_tmp4_ != NULL) {
			gchar* parent_path = NULL;
			GFile* _tmp5_;
			GFile* _tmp6_;
			GFile* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			GitgRepository* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			const gchar* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			gchar* _tmp17_;
			GitgRepository* _tmp18_;
			gchar* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			_tmp5_ = workdir;
			_tmp6_ = g_file_get_parent (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = gitg_utils_replace_home_dir_with_tilde (_tmp7_);
			_tmp9_ = _tmp8_;
			_g_object_unref0 (_tmp7_);
			parent_path = _tmp9_;
			_tmp10_ = self->priv->d_repository;
			_tmp11_ = gitg_repository_get_name (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = _tmp12_;
			_tmp14_ = string_to_string (_tmp13_);
			_tmp15_ = parent_path;
			_tmp16_ = string_to_string (_tmp15_);
			_tmp17_ = g_strconcat (_tmp14_, " (", _tmp16_, ")", NULL);
			_g_free0 (title);
			title = _tmp17_;
			_g_free0 (_tmp13_);
			_tmp18_ = self->priv->d_repository;
			_tmp19_ = gitg_repository_get_name (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = _tmp20_;
			_tmp22_ = string_to_string (_tmp21_);
			_tmp23_ = g_strconcat (_tmp22_, " - gitg", NULL);
			_g_free0 (windowtitle);
			windowtitle = _tmp23_;
			_g_free0 (_tmp21_);
			_g_free0 (parent_path);
		} else {
			GitgRepository* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			_tmp24_ = self->priv->d_repository;
			_tmp25_ = gitg_repository_get_name (_tmp24_);
			_tmp26_ = _tmp25_;
			_g_free0 (title);
			title = _tmp26_;
		}
		head_name = NULL;
		{
			GitgRef* head = NULL;
			GitgRepository* _tmp27_;
			GitgRepository* _tmp28_;
			GitgRepository* _tmp29_;
			GitgRef* _tmp30_;
			GitgRef* _tmp31_;
			GitgRef* _tmp32_;
			GitgParsedRefName* _tmp33_;
			GitgParsedRefName* _tmp34_;
			GitgParsedRefName* _tmp35_;
			gchar* _tmp36_;
			gchar* _tmp37_;
			_tmp27_ = gitg_ext_application_get_repository ((GitgExtApplication*) self);
			_tmp28_ = _tmp27_;
			_tmp29_ = _tmp28_;
			_tmp30_ = gitg_repository_get_head (_tmp29_, &_inner_error0_);
			_tmp31_ = _tmp30_;
			_g_object_unref0 (_tmp29_);
			head = _tmp31_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp32_ = head;
			_tmp33_ = gitg_ref_get_parsed_name (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = _tmp34_;
			_tmp36_ = gitg_parsed_ref_name_get_shortname (_tmp35_);
			_tmp37_ = _tmp36_;
			_g_free0 (head_name);
			head_name = _tmp37_;
			_g_object_unref0 (_tmp35_);
			_g_object_unref0 (head);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (head_name);
			_g_object_unref0 (workdir);
			_g_free0 (subtitle);
			_g_free0 (title);
			_g_free0 (windowtitle);
			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;
		}
		_tmp38_ = head_name;
		if (_tmp38_ != NULL) {
			const gchar* _tmp39_;
			gchar* _tmp40_;
			_tmp39_ = head_name;
			_tmp40_ = g_markup_escape_text (_tmp39_, (gssize) -1);
			_g_free0 (subtitle);
			subtitle = _tmp40_;
		}
		_g_free0 (head_name);
		_g_object_unref0 (workdir);
	} else {
		gchar* _tmp41_;
		_tmp41_ = g_strdup (_ ("Projects"));
		_g_free0 (title);
		title = _tmp41_;
	}
	if (gitg_platform_support_use_native_window_controls (NULL)) {
		GtkHeaderBar* _tmp42_;
		const gchar* _tmp43_;
		const gchar* _tmp44_;
		_tmp42_ = self->priv->d_header_bar;
		_tmp43_ = subtitle;
		gtk_header_bar_set_title (_tmp42_, _tmp43_);
		_tmp44_ = title;
		gtk_window_set_title ((GtkWindow*) self, _tmp44_);
	} else {
		const gchar* _tmp45_;
		GtkHeaderBar* _tmp46_;
		const gchar* _tmp47_;
		GtkHeaderBar* _tmp48_;
		const gchar* _tmp49_;
		_tmp45_ = windowtitle;
		gtk_window_set_title ((GtkWindow*) self, _tmp45_);
		_tmp46_ = self->priv->d_header_bar;
		_tmp47_ = title;
		gtk_header_bar_set_title (_tmp46_, _tmp47_);
		_tmp48_ = self->priv->d_header_bar;
		_tmp49_ = subtitle;
		gtk_header_bar_set_subtitle (_tmp48_, _tmp49_);
	}
	_g_free0 (subtitle);
	_g_free0 (title);
	_g_free0 (windowtitle);
}

static void
gitg_window_repository_changed (GitgWindow* self)
{
	GtkInfoBar* _tmp0_;
	GitgRepository* _tmp1_;
	GitgUIElements* _tmp32_;
	GitgRepository* _tmp33_;
	g_return_if_fail (self != NULL);
	gitg_window_update_title (self);
	_tmp0_ = self->priv->d_infobar;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	_tmp1_ = self->priv->d_repository;
	if (_tmp1_ != NULL) {
		GtkStack* _tmp2_;
		GtkStack* _tmp3_;
		GtkStack* _tmp4_;
		GtkStackSwitcher* _tmp5_;
		GtkButton* _tmp6_;
		GtkButton* _tmp7_;
		GtkButton* _tmp8_;
		GitgDashView* _tmp9_;
		GitgRepository* _tmp10_;
		GitgRepositoryListBoxRow* _tmp11_;
		GitgRepositoryListBoxRow* _tmp12_;
		GtkMenuButton* _tmp13_;
		GMenuModel* _tmp14_;
		GtkImage* _tmp15_;
		GtkMenuButton* _tmp16_;
		GtkMenuButton* _tmp17_;
		self->priv->d_mode = GITG_WINDOW_MODE_ACTIVITY;
		_tmp2_ = self->priv->d_main_stack;
		gtk_stack_set_transition_type (_tmp2_, GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT);
		_tmp3_ = self->priv->d_main_stack;
		_tmp4_ = self->priv->d_stack_activities;
		gtk_stack_set_visible_child (_tmp3_, (GtkWidget*) _tmp4_);
		_tmp5_ = self->priv->d_activities_switcher;
		gtk_widget_show ((GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->d_dash_button;
		gtk_widget_show ((GtkWidget*) _tmp6_);
		_tmp7_ = self->priv->d_clone_button;
		gtk_widget_hide ((GtkWidget*) _tmp7_);
		_tmp8_ = self->priv->d_add_button;
		gtk_widget_hide ((GtkWidget*) _tmp8_);
		_tmp9_ = self->priv->d_dash_view;
		_tmp10_ = self->priv->d_repository;
		_tmp11_ = gitg_dash_view_add_repository (_tmp9_, _tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp12_);
		_tmp13_ = self->priv->d_gear_menu;
		_tmp14_ = self->priv->d_activities_model;
		gtk_menu_button_set_menu_model (_tmp13_, _tmp14_);
		_tmp15_ = self->priv->gear_image;
		gtk_image_set_from_icon_name (_tmp15_, "view-more-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
		_tmp16_ = self->priv->d_gear_menu;
		gtk_widget_show ((GtkWidget*) _tmp16_);
		_tmp17_ = self->priv->d_gear_menu;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, TRUE);
	} else {
		GtkStack* _tmp18_;
		GtkStack* _tmp19_;
		GitgDashView* _tmp20_;
		GtkStackSwitcher* _tmp21_;
		GtkButton* _tmp22_;
		GtkButton* _tmp23_;
		GtkButton* _tmp24_;
		GtkMenuButton* _tmp25_;
		GMenuModel* _tmp26_;
		GtkImage* _tmp27_;
		GtkMenuButton* _tmp28_;
		GMenuModel* _tmp29_;
		GtkMenuButton* _tmp30_;
		GMenuModel* _tmp31_;
		self->priv->d_mode = GITG_WINDOW_MODE_DASH;
		_tmp18_ = self->priv->d_main_stack;
		gtk_stack_set_transition_type (_tmp18_, GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT);
		_tmp19_ = self->priv->d_main_stack;
		_tmp20_ = self->priv->d_dash_view;
		gtk_stack_set_visible_child (_tmp19_, (GtkWidget*) _tmp20_);
		_tmp21_ = self->priv->d_activities_switcher;
		gtk_widget_hide ((GtkWidget*) _tmp21_);
		_tmp22_ = self->priv->d_dash_button;
		gtk_widget_hide ((GtkWidget*) _tmp22_);
		_tmp23_ = self->priv->d_clone_button;
		gtk_widget_show ((GtkWidget*) _tmp23_);
		_tmp24_ = self->priv->d_add_button;
		gtk_widget_show ((GtkWidget*) _tmp24_);
		_tmp25_ = self->priv->d_gear_menu;
		_tmp26_ = self->priv->d_dash_model;
		gtk_menu_button_set_menu_model (_tmp25_, _tmp26_);
		_tmp27_ = self->priv->gear_image;
		gtk_image_set_from_icon_name (_tmp27_, "open-menu-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
		_tmp28_ = self->priv->d_gear_menu;
		_tmp29_ = self->priv->d_dash_model;
		gtk_widget_set_visible ((GtkWidget*) _tmp28_, _tmp29_ != NULL);
		_tmp30_ = self->priv->d_gear_menu;
		_tmp31_ = self->priv->d_dash_model;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp30_, _tmp31_ != NULL);
	}
	_tmp32_ = self->priv->d_activities;
	gitg_ui_elements_update (_tmp32_);
	_tmp33_ = self->priv->d_repository;
	if (_tmp33_ != NULL) {
		gitg_window_activate_default_activity (self);
	}
	if (self->priv->d_mode == GITG_WINDOW_MODE_DASH) {
		gitg_window_on_current_activity_changed (self);
	}
}

static gboolean
___lambda185_ (GitgWindow* self)
{
	gboolean result;
	gtk_window_set_interactive_debugging (TRUE);
	result = FALSE;
	return result;
}

static gboolean
____lambda185__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda185_ ((GitgWindow*) self);
	return result;
}

static void
gitg_window_real_realize (GtkWidget* base)
{
	GitgWindow * self;
	const gchar* _tmp0_;
	self = (GitgWindow*) base;
	_tmp0_ = g_getenv ("GITG_GTK_DEBUG_INTERACTIVE");
	if (_tmp0_ != NULL) {
		g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, ____lambda185__gsource_func, g_object_ref (self), g_object_unref);
	}
	GTK_WIDGET_CLASS (gitg_window_parent_class)->realize ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow));
}

static gboolean
gitg_window_real_window_state_event (GtkWidget* base,
                                     GdkEventWindowState* event)
{
	GitgWindow * self;
	GSettings* _tmp0_;
	gboolean result;
	self = (GitgWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->d_state_settings;
	g_settings_set_int (_tmp0_, "state", (gint) event->new_window_state);
	result = GTK_WIDGET_CLASS (gitg_window_parent_class)->window_state_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), event);
	return result;
}

static gboolean
gitg_window_real_configure_event (GtkWidget* base,
                                  GdkEventConfigure* event)
{
	GitgWindow * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = (GitgWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (gtk_widget_get_realized ((GtkWidget*) self)) {
		GdkWindow* _tmp1_;
		_tmp1_ = gtk_widget_get_window ((GtkWidget*) self);
		_tmp0_ = !((gdk_window_get_state (_tmp1_) & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint width = 0;
		gint height = 0;
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
		GSettings* _tmp4_;
		gtk_window_get_size ((GtkWindow*) self, &_tmp2_, &_tmp3_);
		width = _tmp2_;
		height = _tmp3_;
		_tmp4_ = self->priv->d_state_settings;
		g_settings_set (_tmp4_, "size", "(ii)", width, height);
	}
	result = GTK_WIDGET_CLASS (gitg_window_parent_class)->configure_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), event);
	return result;
}

static GitgExtExternalChangeHint
gitg_window_external_change_hint_from_file (GitgWindow* self,
                                            GFile* location)
{
	GFile* l = NULL;
	GitgRepository* _tmp0_;
	GFile* _tmp1_;
	GFile* refs = NULL;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile* index = NULL;
	GFile* _tmp4_;
	GFile* _tmp5_;
	GFile* head = NULL;
	GFile* _tmp6_;
	GFile* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	GFile* _tmp10_;
	GitgExtExternalChangeHint result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (location != NULL, 0U);
	_tmp0_ = self->priv->d_repository;
	_tmp1_ = ggit_repository_get_location ((GgitRepository*) _tmp0_);
	l = _tmp1_;
	_tmp2_ = l;
	_tmp3_ = g_file_get_child (_tmp2_, "refs");
	refs = _tmp3_;
	_tmp4_ = l;
	_tmp5_ = g_file_get_child (_tmp4_, "index");
	index = _tmp5_;
	_tmp6_ = l;
	_tmp7_ = g_file_get_child (_tmp6_, "HEAD");
	head = _tmp7_;
	_tmp10_ = refs;
	if (g_file_equal (location, _tmp10_)) {
		_tmp9_ = TRUE;
	} else {
		GFile* _tmp11_;
		_tmp11_ = refs;
		_tmp9_ = g_file_has_prefix (location, _tmp11_);
	}
	if (_tmp9_) {
		_tmp8_ = TRUE;
	} else {
		GFile* _tmp12_;
		_tmp12_ = head;
		_tmp8_ = g_file_equal (location, _tmp12_);
	}
	if (_tmp8_) {
		result = GITG_EXT_EXTERNAL_CHANGE_HINT_REFS;
		_g_object_unref0 (head);
		_g_object_unref0 (index);
		_g_object_unref0 (refs);
		_g_object_unref0 (l);
		return result;
	} else {
		GFile* _tmp13_;
		_tmp13_ = index;
		if (g_file_equal (location, _tmp13_)) {
			result = GITG_EXT_EXTERNAL_CHANGE_HINT_INDEX;
			_g_object_unref0 (head);
			_g_object_unref0 (index);
			_g_object_unref0 (refs);
			_g_object_unref0 (l);
			return result;
		} else {
			result = GITG_EXT_EXTERNAL_CHANGE_HINT_NONE;
			_g_object_unref0 (head);
			_g_object_unref0 (index);
			_g_object_unref0 (refs);
			_g_object_unref0 (l);
			return result;
		}
	}
}

static gboolean
gitg_window_filter_repository_changes (GitgWindow* self,
                                       GFile* location)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (location != NULL, FALSE);
	result = gitg_window_external_change_hint_from_file (self, location) != GITG_EXT_EXTERNAL_CHANGE_HINT_NONE;
	return result;
}

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

static void
gitg_window_set_repository_internal (GitgWindow* self,
                                     GitgRepository* repository)
{
	GitgRecursiveMonitor* _tmp0_;
	GitgRepository* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRemoteManager* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_repository_monitor;
	if (_tmp0_ != NULL) {
		GitgRecursiveMonitor* _tmp1_;
		_tmp1_ = self->priv->d_repository_monitor;
		gitg_recursive_monitor_cancel (_tmp1_);
		_g_object_unref0 (self->priv->d_repository_monitor);
		self->priv->d_repository_monitor = NULL;
	}
	_tmp2_ = _g_object_ref0 (repository);
	_g_object_unref0 (self->priv->d_repository);
	self->priv->d_repository = _tmp2_;
	_tmp3_ = self->priv->d_repository;
	if (_tmp3_ != NULL) {
		gitg_window_update_enable_monitoring (self);
	}
	_tmp4_ = gitg_remote_manager_new (self);
	_g_object_unref0 (self->priv->d_remote_manager);
	self->priv->d_remote_manager = _tmp4_;
	g_object_notify ((GObject*) self, "repository");
}

static gboolean
_gitg_window_filter_repository_changes_gitg_recursive_monitor_filter_func (GFile* file,
                                                                           gpointer self)
{
	gboolean result;
	result = gitg_window_filter_repository_changes ((GitgWindow*) self, file);
	return result;
}

static void
___lambda153_ (GitgWindow* self,
               GFile** files,
               gint files_length1)
{
	GitgExtExternalChangeHint hint = 0U;
	hint = GITG_EXT_EXTERNAL_CHANGE_HINT_NONE;
	{
		GFile** f_collection = NULL;
		gint f_collection_length1 = 0;
		gint _f_collection_size_ = 0;
		gint f_it = 0;
		f_collection = files;
		f_collection_length1 = files_length1;
		for (f_it = 0; f_it < f_collection_length1; f_it = f_it + 1) {
			GFile* _tmp0_;
			GFile* f = NULL;
			_tmp0_ = _g_object_ref0 (f_collection[f_it]);
			f = _tmp0_;
			{
				GFile* _tmp1_;
				_tmp1_ = f;
				hint |= gitg_window_external_change_hint_from_file (self, _tmp1_);
				_g_object_unref0 (f);
			}
		}
	}
	g_signal_emit_by_name ((GitgExtApplication*) self, "repository-changed-externally", hint);
}

static void
____lambda153__gitg_recursive_monitor_changed (GitgRecursiveMonitor* _sender,
                                               GFile** files,
                                               gint files_length1,
                                               gpointer self)
{
	___lambda153_ ((GitgWindow*) self, files, files_length1);
}

static void
gitg_window_update_enable_monitoring (GitgWindow* self)
{
	GitgRecursiveMonitor* _tmp0_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_repository_monitor;
	if (_tmp0_ != NULL) {
		GitgRecursiveMonitor* _tmp1_;
		_tmp1_ = self->priv->d_repository_monitor;
		gitg_recursive_monitor_cancel (_tmp1_);
		_g_object_unref0 (self->priv->d_repository_monitor);
		self->priv->d_repository_monitor = NULL;
	}
	_tmp3_ = gitg_window_get_enable_monitoring (self);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		GitgRepository* _tmp5_;
		_tmp5_ = self->priv->d_repository;
		_tmp2_ = _tmp5_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GitgRepository* _tmp6_;
		GFile* _tmp7_;
		GFile* _tmp8_;
		GitgRecursiveMonitor* _tmp9_;
		GitgRecursiveMonitor* _tmp10_;
		_tmp6_ = self->priv->d_repository;
		_tmp7_ = ggit_repository_get_location ((GgitRepository*) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gitg_recursive_monitor_new (_tmp8_, _gitg_window_filter_repository_changes_gitg_recursive_monitor_filter_func, g_object_ref (self), g_object_unref);
		_g_object_unref0 (self->priv->d_repository_monitor);
		self->priv->d_repository_monitor = _tmp9_;
		_g_object_unref0 (_tmp8_);
		_tmp10_ = self->priv->d_repository_monitor;
		g_signal_connect_object (_tmp10_, "changed", (GCallback) ____lambda153__gitg_recursive_monitor_changed, self, 0);
	}
}

static Block86Data*
block86_data_ref (Block86Data* _data86_)
{
	g_atomic_int_inc (&_data86_->_ref_count_);
	return _data86_;
}

static void
block86_data_unref (void * _userdata_)
{
	Block86Data* _data86_;
	_data86_ = (Block86Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data86_->_ref_count_)) {
		GitgWindow* self;
		self = _data86_->self;
		_g_object_unref0 (_data86_->chooser);
		_g_object_unref0 (self);
		g_slice_free (Block86Data, _data86_);
	}
}

static void
__lambda177_ (Block86Data* _data86_,
              GtkDialog* c,
              gint id)
{
	GitgWindow* self;
	self = _data86_->self;
	g_return_if_fail (c != NULL);
	if (id == ((gint) GTK_RESPONSE_OK)) {
		GFile* file = NULL;
		GFile* _tmp0_;
		GFile* _tmp1_;
		GFile* _tmp3_;
		_tmp0_ = gtk_file_chooser_get_file ((GtkFileChooser*) _data86_->chooser);
		file = _tmp0_;
		_tmp1_ = file;
		if (_tmp1_ == NULL) {
			GFile* _tmp2_;
			_tmp2_ = gtk_file_chooser_get_current_folder_file ((GtkFileChooser*) _data86_->chooser);
			_g_object_unref0 (file);
			file = _tmp2_;
		}
		_tmp3_ = file;
		gitg_ext_application_open_repository ((GitgExtApplication*) self, _tmp3_);
		_g_object_unref0 (file);
	}
	gtk_widget_destroy ((GtkWidget*) c);
}

static void
___lambda177__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda177_ (self, _sender, response_id);
}

static void
gitg_window_on_open_repository (GitgWindow* self)
{
	Block86Data* _data86_;
	GtkFileChooserDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data86_ = g_slice_new0 (Block86Data);
	_data86_->_ref_count_ = 1;
	_data86_->self = g_object_ref (self);
	_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_ ("Open Repository"), (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _ ("_Cancel"), GTK_RESPONSE_CANCEL, _ ("_Open"), GTK_RESPONSE_OK, NULL);
	g_object_ref_sink (_tmp0_);
	_data86_->chooser = _tmp0_;
	gtk_window_set_modal ((GtkWindow*) _data86_->chooser, TRUE);
	g_signal_connect_data ((GtkDialog*) _data86_->chooser, "response", (GCallback) ___lambda177__gtk_dialog_response, block86_data_ref (_data86_), (GClosureNotify) block86_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data86_->chooser);
	block86_data_unref (_data86_);
	_data86_ = NULL;
}

static void
gitg_window_on_reload_activated (GitgWindow* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GitgRepository* _tmp0_ = NULL;
		GitgRepository* _tmp1_;
		GitgRepository* _tmp2_;
		GitgRepository* _tmp3_;
		GFile* _tmp4_;
		GFile* _tmp5_;
		GitgRepository* _tmp6_;
		GitgRepository* _tmp7_;
		_tmp1_ = gitg_ext_application_get_repository ((GitgExtApplication*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = ggit_repository_get_location ((GgitRepository*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = gitg_repository_new (_tmp5_, NULL, &_inner_error0_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_g_object_unref0 (_tmp3_);
		_tmp0_ = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gitg_window_set_repository_internal (self, _tmp0_);
		gitg_window_update_title (self);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != 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;
	}
}

static void
gitg_window_on_repo_author_details_activated (GitgWindow* self)
{
	GgitConfig* repo_config = NULL;
	GitgAuthorDetailsDialog* author_details = NULL;
	GgitConfig* _tmp4_;
	GitgRepository* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GitgAuthorDetailsDialog* _tmp9_;
	GitgAuthorDetailsDialog* _tmp10_;
	GitgAuthorDetailsDialog* _tmp11_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	repo_config = NULL;
	{
		GgitConfig* _tmp0_ = NULL;
		GitgRepository* _tmp1_;
		GgitConfig* _tmp2_;
		GgitConfig* _tmp3_;
		_tmp1_ = self->priv->d_repository;
		_tmp2_ = ggit_repository_get_config ((GgitRepository*) _tmp1_, &_inner_error0_);
		_tmp0_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (repo_config);
		repo_config = _tmp3_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		_g_object_unref0 (repo_config);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (repo_config);
		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;
	}
	_tmp4_ = repo_config;
	_tmp5_ = self->priv->d_repository;
	_tmp6_ = gitg_repository_get_name (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = gitg_author_details_dialog_new ((GtkWindow*) self, _tmp4_, _tmp8_);
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	author_details = _tmp10_;
	_tmp11_ = author_details;
	gtk_widget_show ((GtkWidget*) _tmp11_);
	_g_object_unref0 (author_details);
	_g_object_unref0 (repo_config);
}

static void
___lambda179_ (GitgWindow* self,
               GtkWidget* w)
{
	g_return_if_fail (w != NULL);
	_g_object_unref0 (self->priv->d_preferences);
	self->priv->d_preferences = NULL;
}

static void
____lambda179__gtk_widget_destroy (GtkWidget* _sender,
                                   gpointer self)
{
	___lambda179_ ((GitgWindow*) self, _sender);
}

static void
gitg_window_on_preferences_activated (GitgWindow* self)
{
	GList* wnds = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	GList* _tmp2_;
	GitgPreferencesDialog* _tmp3_;
	GList* _tmp6_;
	GitgPreferencesDialog* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_application_get_windows (_tmp1_);
	wnds = _tmp2_;
	_tmp3_ = self->priv->d_preferences;
	if (_tmp3_ == NULL) {
		gpointer _tmp4_;
		GitgPreferencesDialog* _tmp5_;
		_tmp4_ = gitg_builder_load_object (GITG_TYPE_PREFERENCES_DIALOG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "ui/gitg-preferences.ui", "preferences");
		_g_object_unref0 (self->priv->d_preferences);
		self->priv->d_preferences = (GitgPreferencesDialog*) _tmp4_;
		_tmp5_ = self->priv->d_preferences;
		g_signal_connect_object ((GtkWidget*) _tmp5_, "destroy", (GCallback) ____lambda179__gtk_widget_destroy, self, 0);
	}
	_tmp6_ = wnds;
	if (_tmp6_ != NULL) {
		GitgPreferencesDialog* _tmp7_;
		GList* _tmp8_;
		gconstpointer _tmp9_;
		_tmp7_ = self->priv->d_preferences;
		_tmp8_ = wnds;
		_tmp9_ = _tmp8_->data;
		gtk_window_set_transient_for ((GtkWindow*) _tmp7_, (GtkWindow*) _tmp9_);
	}
	_tmp10_ = self->priv->d_preferences;
	gtk_window_present ((GtkWindow*) _tmp10_);
}

static void
___lambda180_ (GitgWindow* self,
               GtkWidget* w)
{
	g_return_if_fail (w != NULL);
	_g_object_unref0 (self->priv->d_shortcuts);
	self->priv->d_shortcuts = NULL;
}

static void
____lambda180__gtk_widget_destroy (GtkWidget* _sender,
                                   gpointer self)
{
	___lambda180_ ((GitgWindow*) self, _sender);
}

static void
gitg_window_on_shortcuts_activated (GitgWindow* self)
{
	GList* wnds = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	GList* _tmp2_;
	GtkShortcutsWindow* _tmp3_;
	GList* _tmp6_;
	GtkShortcutsWindow* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_application_get_windows (_tmp1_);
	wnds = _tmp2_;
	_tmp3_ = self->priv->d_shortcuts;
	if (_tmp3_ == NULL) {
		gpointer _tmp4_;
		GtkShortcutsWindow* _tmp5_;
		_tmp4_ = gitg_builder_load_object (gtk_shortcuts_window_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "ui/gitg-shortcuts.ui", "shortcuts-gitg");
		_g_object_unref0 (self->priv->d_shortcuts);
		self->priv->d_shortcuts = (GtkShortcutsWindow*) _tmp4_;
		_tmp5_ = self->priv->d_shortcuts;
		g_signal_connect_object ((GtkWidget*) _tmp5_, "destroy", (GCallback) ____lambda180__gtk_widget_destroy, self, 0);
	}
	_tmp6_ = wnds;
	if (_tmp6_ != NULL) {
		GtkShortcutsWindow* _tmp7_;
		GList* _tmp8_;
		gconstpointer _tmp9_;
		_tmp7_ = self->priv->d_shortcuts;
		_tmp8_ = wnds;
		_tmp9_ = _tmp8_->data;
		gtk_window_set_transient_for ((GtkWindow*) _tmp7_, (GtkWindow*) _tmp9_);
	}
	_tmp10_ = self->priv->d_shortcuts;
	gtk_window_present ((GtkWindow*) _tmp10_);
}

static void
gitg_window_on_current_activity_changed (GitgWindow* self)
{
	GitgExtActivity* current = NULL;
	GitgExtActivity* _tmp0_;
	GitgExtActivity* _tmp1_;
	GitgExtSearchable* searchable = NULL;
	GitgExtActivity* _tmp2_;
	GitgExtSearchable* _tmp3_;
	GitgExtSearchable* _tmp4_;
	GitgExtSelectable* selectable = NULL;
	GitgExtActivity* _tmp23_;
	GitgExtSelectable* _tmp24_;
	GitgExtSelectable* _tmp25_;
	g_return_if_fail (self != NULL);
	g_object_notify ((GObject*) self, "current_activity");
	_tmp0_ = gitg_ext_application_get_current_activity ((GitgExtApplication*) self);
	_tmp1_ = _tmp0_;
	current = _tmp1_;
	_tmp2_ = current;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, GITG_EXT_TYPE_SEARCHABLE) ? ((GitgExtSearchable*) _tmp2_) : NULL);
	searchable = _tmp3_;
	_g_object_unref0 (self->priv->d_searchable_available_binding);
	self->priv->d_searchable_available_binding = NULL;
	_tmp4_ = searchable;
	if (_tmp4_ != NULL) {
		GtkToggleButton* _tmp5_;
		GtkSearchEntry* _tmp6_;
		GitgExtSearchable* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		GtkToggleButton* _tmp11_;
		GitgExtSearchable* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		GitgExtSearchable* _tmp15_;
		GtkToggleButton* _tmp16_;
		GBinding* _tmp17_;
		GBinding* _tmp18_;
		_tmp5_ = self->priv->d_search_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp5_, TRUE);
		_tmp6_ = self->priv->d_search_entry;
		_tmp7_ = searchable;
		_tmp8_ = gitg_ext_searchable_get_search_text (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		gtk_entry_set_text ((GtkEntry*) _tmp6_, _tmp10_);
		_g_free0 (_tmp10_);
		_tmp11_ = self->priv->d_search_button;
		_tmp12_ = searchable;
		_tmp13_ = gitg_ext_searchable_get_search_visible (_tmp12_);
		_tmp14_ = _tmp13_;
		gtk_toggle_button_set_active (_tmp11_, _tmp14_);
		_tmp15_ = searchable;
		_tmp16_ = self->priv->d_search_button;
		_tmp17_ = g_object_bind_property_with_closures ((GObject*) _tmp15_, "search-available", (GObject*) _tmp16_, "sensitive", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (self->priv->d_searchable_available_binding);
		self->priv->d_searchable_available_binding = _tmp18_;
	} else {
		GtkToggleButton* _tmp19_;
		GtkToggleButton* _tmp20_;
		GtkToggleButton* _tmp21_;
		GtkSearchEntry* _tmp22_;
		_tmp19_ = self->priv->d_search_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp19_, FALSE);
		_tmp20_ = self->priv->d_search_button;
		gtk_toggle_button_set_active (_tmp20_, FALSE);
		_tmp21_ = self->priv->d_search_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp21_, FALSE);
		_tmp22_ = self->priv->d_search_entry;
		gtk_entry_set_text ((GtkEntry*) _tmp22_, "");
	}
	_tmp23_ = current;
	_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, GITG_EXT_TYPE_SELECTABLE) ? ((GitgExtSelectable*) _tmp23_) : NULL);
	selectable = _tmp24_;
	_g_object_unref0 (self->priv->d_selectable_mode_binding);
	self->priv->d_selectable_mode_binding = NULL;
	_g_object_unref0 (self->priv->d_selectable_available_binding);
	self->priv->d_selectable_available_binding = NULL;
	_tmp25_ = selectable;
	if (_tmp25_ != NULL) {
		GtkToggleButton* _tmp26_;
		gchar* tooltip = NULL;
		GitgExtSelectable* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		const gchar* _tmp30_;
		GtkToggleButton* _tmp32_;
		const gchar* _tmp33_;
		GitgExtSelectable* _tmp34_;
		GBinding* _tmp35_;
		GBinding* _tmp36_;
		GitgExtSelectable* _tmp37_;
		GtkToggleButton* _tmp38_;
		GBinding* _tmp39_;
		GBinding* _tmp40_;
		_tmp26_ = self->priv->d_select_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp26_, TRUE);
		_tmp27_ = selectable;
		_tmp28_ = gitg_ext_selectable_get_selectable_mode_tooltip (_tmp27_);
		_tmp29_ = _tmp28_;
		tooltip = _tmp29_;
		_tmp30_ = tooltip;
		if (_tmp30_ == NULL) {
			gchar* _tmp31_;
			_tmp31_ = g_strdup (_ ("Select items"));
			_g_free0 (tooltip);
			tooltip = _tmp31_;
		}
		_tmp32_ = self->priv->d_select_button;
		_tmp33_ = tooltip;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp32_, _tmp33_);
		_tmp34_ = selectable;
		_tmp35_ = g_object_bind_property_with_closures ((GObject*) _tmp34_, "selectable-mode", (GObject*) self, "selectable-mode", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp36_ = _g_object_ref0 (_tmp35_);
		_g_object_unref0 (self->priv->d_selectable_mode_binding);
		self->priv->d_selectable_mode_binding = _tmp36_;
		_tmp37_ = selectable;
		_tmp38_ = self->priv->d_select_button;
		_tmp39_ = g_object_bind_property_with_closures ((GObject*) _tmp37_, "selectable-available", (GObject*) _tmp38_, "sensitive", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp40_ = _g_object_ref0 (_tmp39_);
		_g_object_unref0 (self->priv->d_selectable_available_binding);
		self->priv->d_selectable_available_binding = _tmp40_;
		_g_free0 (tooltip);
	} else {
		GtkToggleButton* _tmp41_;
		GtkToggleButton* _tmp42_;
		GtkToggleButton* _tmp43_;
		_tmp41_ = self->priv->d_select_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp41_, FALSE);
		_tmp42_ = self->priv->d_select_button;
		gtk_toggle_button_set_active (_tmp42_, FALSE);
		_tmp43_ = self->priv->d_select_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp43_, FALSE);
	}
	_g_object_unref0 (selectable);
	_g_object_unref0 (searchable);
	_g_object_unref0 (current);
}

static Block87Data*
block87_data_ref (Block87Data* _data87_)
{
	g_atomic_int_inc (&_data87_->_ref_count_);
	return _data87_;
}

static void
block87_data_unref (void * _userdata_)
{
	Block87Data* _data87_;
	_data87_ = (Block87Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data87_->_ref_count_)) {
		GitgWindow* self;
		self = _data87_->self;
		_g_object_unref0 (_data87_->def);
		_g_free0 (_data87_->default_activity);
		_g_object_unref0 (self);
		g_slice_free (Block87Data, _data87_);
	}
}

static gboolean
__lambda171_ (Block87Data* _data87_,
              GitgExtUIElement* element)
{
	GitgWindow* self;
	GitgExtActivity* activity = NULL;
	GitgExtActivity* _tmp0_;
	GitgExtActivity* _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	self = _data87_->self;
	g_return_val_if_fail (element != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (element, GITG_EXT_TYPE_ACTIVITY, GitgExtActivity));
	activity = _tmp0_;
	_tmp1_ = activity;
	_tmp2_ = _data87_->default_activity;
	if (gitg_ext_activity_is_default_for (_tmp1_, _tmp2_)) {
		GitgExtActivity* _tmp3_;
		GitgExtActivity* _tmp4_;
		_tmp3_ = activity;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		_g_object_unref0 (_data87_->def);
		_data87_->def = _tmp4_;
	}
	result = TRUE;
	_g_object_unref0 (activity);
	return result;
}

static gboolean
___lambda171__gitg_ui_elements_foreach_ui_element_func (GitgExtUIElement* element,
                                                        gpointer self)
{
	gboolean result;
	result = __lambda171_ (self, element);
	return result;
}

static gboolean
gitg_window_activate_activity (GitgWindow* self,
                               const gchar* action)
{
	Block87Data* _data87_;
	gboolean _tmp0_ = FALSE;
	GitgUIElements* _tmp4_;
	GitgExtActivity* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_data87_ = g_slice_new0 (Block87Data);
	_data87_->_ref_count_ = 1;
	_data87_->self = g_object_ref (self);
	if (action == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (action, "") == 0;
	}
	if (_tmp0_) {
		GSettings* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->d_interface_settings;
		_tmp2_ = g_settings_get_string (_tmp1_, "default-activity");
		_g_free0 (_data87_->default_activity);
		_data87_->default_activity = _tmp2_;
	} else {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (action);
		_g_free0 (_data87_->default_activity);
		_data87_->default_activity = _tmp3_;
	}
	_data87_->def = NULL;
	_tmp4_ = self->priv->d_activities;
	gitg_ui_elements_foreach (_tmp4_, ___lambda171__gitg_ui_elements_foreach_ui_element_func, _data87_);
	_tmp5_ = _data87_->def;
	if (_tmp5_ != NULL) {
		GitgUIElements* _tmp6_;
		GitgExtActivity* _tmp7_;
		_tmp6_ = self->priv->d_activities;
		_tmp7_ = _data87_->def;
		gitg_ui_elements_set_current (_tmp6_, _tmp7_);
		result = TRUE;
		block87_data_unref (_data87_);
		_data87_ = NULL;
		return result;
	}
	result = FALSE;
	block87_data_unref (_data87_);
	_data87_ = NULL;
	return result;
}

static gboolean
___lambda172_ (GitgWindow* self,
               GitgExtUIElement* element)
{
	GitgExtActivity* activity = NULL;
	GitgExtActivity* _tmp0_;
	GitgExtActivity* _tmp1_;
	gboolean result;
	g_return_val_if_fail (element != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (element, GITG_EXT_TYPE_ACTIVITY, GitgExtActivity));
	activity = _tmp0_;
	_tmp1_ = activity;
	if (gitg_ext_activity_is_default_for (_tmp1_, "")) {
		GitgUIElements* _tmp2_;
		GitgExtActivity* _tmp3_;
		_tmp2_ = self->priv->d_activities;
		_tmp3_ = activity;
		gitg_ui_elements_set_current (_tmp2_, _tmp3_);
		result = FALSE;
		_g_object_unref0 (activity);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (activity);
	return result;
}

static gboolean
____lambda172__gitg_ui_elements_foreach_ui_element_func (GitgExtUIElement* element,
                                                         gpointer self)
{
	gboolean result;
	result = ___lambda172_ ((GitgWindow*) self, element);
	return result;
}

static void
gitg_window_activate_default_activity (GitgWindow* self)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_action;
	if (!gitg_window_activate_activity (self, _tmp0_)) {
		GitgUIElements* _tmp1_;
		_tmp1_ = self->priv->d_activities;
		gitg_ui_elements_foreach (_tmp1_, ____lambda172__gitg_ui_elements_foreach_ui_element_func, self);
	}
}

static void
_gitg_window_on_current_activity_changed_g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self)
{
	gitg_window_on_current_activity_changed ((GitgWindow*) self);
}

static gboolean
gitg_window_real_init (GInitable* base,
                       GCancellable* cancellable,
                       GError** error)
{
	GitgWindow * self;
	GitgApplication* app = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	GitgApplication* _tmp2_;
	GitgApplication* _tmp3_;
	GSettings* _tmp4_;
	GSettings* _tmp5_;
	GitgExtMessageBus* _tmp6_;
	GitgPluginsEngine* engine = NULL;
	GitgPluginsEngine* _tmp7_;
	GitgExtActivity** builtins = NULL;
	GitgHistoryActivity* _tmp8_;
	GitgCommitActivity* _tmp9_;
	GitgExtActivity** _tmp10_;
	gint builtins_length1;
	gint _builtins_size_;
	PeasExtensionSet* extset = NULL;
	GitgPluginsEngine* _tmp11_;
	PeasExtensionSet* _tmp12_;
	GitgExtActivity** _tmp13_;
	gint _tmp13__length1;
	PeasExtensionSet* _tmp14_;
	GtkStack* _tmp15_;
	GitgUIElements* _tmp16_;
	GitgUIElements* history_panels = NULL;
	GitgExtActivity** _tmp17_;
	gint _tmp17__length1;
	GitgExtActivity* _tmp18_;
	GitgUIElements* _tmp19_;
	GitgUIElements* _tmp20_;
	GitgUIElements* _tmp21_;
	GitgUIElements* _tmp22_;
	gint _tmp23_ = 0;
	gpointer* _tmp24_;
	GitgUIElements* _tmp35_;
	GdkWindowState window_state = 0U;
	GSettings* _tmp36_;
	gint width = 0;
	gint height = 0;
	GSettings* _tmp37_;
	gint _tmp38_ = 0;
	gint _tmp39_ = 0;
	gboolean result;
	self = (GitgWindow*) base;
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (GITG_IS_APPLICATION (_tmp1_) ? ((GitgApplication*) _tmp1_) : NULL);
	app = _tmp2_;
	_tmp3_ = app;
	_tmp4_ = gitg_application_get_state_settings (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (self->priv->d_state_settings);
	self->priv->d_state_settings = _tmp5_;
	_tmp6_ = gitg_ext_message_bus_new ();
	_g_object_unref0 (self->priv->d_message_bus);
	self->priv->d_message_bus = _tmp6_;
	_tmp7_ = gitg_plugins_engine_get_default ();
	engine = _tmp7_;
	_tmp8_ = gitg_history_activity_new ((GitgExtApplication*) self);
	_tmp9_ = gitg_commit_activity_new ((GitgExtApplication*) self);
	_tmp10_ = g_new0 (GitgExtActivity*, 2 + 1);
	_tmp10_[0] = (GitgExtActivity*) _tmp8_;
	_tmp10_[1] = (GitgExtActivity*) _tmp9_;
	builtins = _tmp10_;
	builtins_length1 = 2;
	_builtins_size_ = builtins_length1;
	_tmp11_ = engine;
	_tmp12_ = peas_extension_set_new ((PeasEngine*) _tmp11_, GITG_EXT_TYPE_ACTIVITY, "application", self, NULL);
	extset = _tmp12_;
	_tmp13_ = builtins;
	_tmp13__length1 = builtins_length1;
	_tmp14_ = extset;
	_tmp15_ = self->priv->d_stack_activities;
	_tmp16_ = gitg_ui_elements_new_with_builtin (GITG_EXT_TYPE_ACTIVITY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp13_, _tmp13__length1, _tmp14_, _tmp15_);
	_g_object_unref0 (self->priv->d_activities);
	self->priv->d_activities = _tmp16_;
	_tmp17_ = builtins;
	_tmp17__length1 = builtins_length1;
	_tmp18_ = _tmp17_[0];
	_tmp19_ = gitg_history_activity_get_d_panels (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivity));
	_tmp20_ = _tmp19_;
	_tmp21_ = _g_object_ref0 (_tmp20_);
	history_panels = _tmp21_;
	_tmp22_ = history_panels;
	_tmp24_ = gitg_ui_elements_get_available_elements (_tmp22_, &_tmp23_);
	{
		GitgExtHistoryPanel** element_collection = NULL;
		gint element_collection_length1 = 0;
		gint _element_collection_size_ = 0;
		gint element_it = 0;
		element_collection = _tmp24_;
		element_collection_length1 = _tmp23_;
		for (element_it = 0; element_it < element_collection_length1; element_it = element_it + 1) {
			GitgExtHistoryPanel* _tmp25_;
			GitgExtHistoryPanel* element = NULL;
			_tmp25_ = _g_object_ref0 (element_collection[element_it]);
			element = _tmp25_;
			{
				GitgApplication* _tmp26_;
				GitgExtHistoryPanel* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				GitgExtHistoryPanel* _tmp31_;
				guint* _tmp32_;
				guint* _tmp33_;
				guint* _tmp34_;
				_tmp26_ = app;
				_tmp27_ = element;
				_tmp28_ = gitg_ext_ui_element_get_display_name ((GitgExtUIElement*) _tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = _tmp29_;
				_tmp31_ = element;
				_tmp32_ = gitg_ext_ui_element_get_shortcut ((GitgExtUIElement*) _tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = _tmp33_;
				gitg_application_register_shortcut (_tmp26_, _tmp30_, *_tmp34_);
				_g_free0 (_tmp34_);
				_g_free0 (_tmp30_);
				_g_object_unref0 (element);
			}
		}
		element_collection = (_vala_array_free (element_collection, element_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	_tmp35_ = self->priv->d_activities;
	g_signal_connect_object ((GObject*) _tmp35_, "notify::current", (GCallback) _gitg_window_on_current_activity_changed_g_object_notify, self, 0);
	_tmp36_ = self->priv->d_state_settings;
	window_state = (GdkWindowState) g_settings_get_int (_tmp36_, "state");
	if ((window_state & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED) {
		gtk_window_maximize ((GtkWindow*) self);
	}
	_tmp37_ = self->priv->d_state_settings;
	g_settings_get (_tmp37_, "size", "(ii)", &_tmp38_, &_tmp39_);
	width = _tmp38_;
	height = _tmp39_;
	gtk_window_resize ((GtkWindow*) self, width, height);
	if (g_strcmp0 (PROFILE, "development") == 0) {
		GtkStyleContext* _tmp40_;
		_tmp40_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_add_class (_tmp40_, "devel");
	}
	result = TRUE;
	_g_object_unref0 (history_panels);
	_g_object_unref0 (extset);
	builtins = (_vala_array_free (builtins, builtins_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (engine);
	_g_object_unref0 (app);
	return result;
}

void
gitg_window_set_environment (GitgWindow* self,
                             gchar** environment,
                             gint environment_length1)
{
	GeeHashMap* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = 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);
	_g_object_unref0 (self->priv->d_environment);
	self->priv->d_environment = _tmp0_;
	{
		gchar** e_collection = NULL;
		gint e_collection_length1 = 0;
		gint _e_collection_size_ = 0;
		gint e_it = 0;
		e_collection = environment;
		e_collection_length1 = environment_length1;
		for (e_it = 0; e_it < e_collection_length1; e_it = e_it + 1) {
			gchar* _tmp1_;
			gchar* e = NULL;
			_tmp1_ = g_strdup (e_collection[e_it]);
			e = _tmp1_;
			{
				gchar** parts = NULL;
				const gchar* _tmp2_;
				gchar** _tmp3_;
				gchar** _tmp4_;
				gint parts_length1;
				gint _parts_size_;
				gchar** _tmp5_;
				gint _tmp5__length1;
				_tmp2_ = e;
				_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, "=", 2);
				parts = _tmp4_;
				parts_length1 = _vala_array_length (_tmp3_);
				_parts_size_ = parts_length1;
				_tmp5_ = parts;
				_tmp5__length1 = parts_length1;
				if (_tmp5__length1 == 1) {
					GeeHashMap* _tmp6_;
					gchar** _tmp7_;
					gint _tmp7__length1;
					const gchar* _tmp8_;
					_tmp6_ = self->priv->d_environment;
					_tmp7_ = parts;
					_tmp7__length1 = parts_length1;
					_tmp8_ = _tmp7_[0];
					gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, _tmp8_, "");
				} else {
					GeeHashMap* _tmp9_;
					gchar** _tmp10_;
					gint _tmp10__length1;
					const gchar* _tmp11_;
					gchar** _tmp12_;
					gint _tmp12__length1;
					const gchar* _tmp13_;
					_tmp9_ = self->priv->d_environment;
					_tmp10_ = parts;
					_tmp10__length1 = parts_length1;
					_tmp11_ = _tmp10_[0];
					_tmp12_ = parts;
					_tmp12__length1 = parts_length1;
					_tmp13_ = _tmp12_[1];
					gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, _tmp11_, _tmp13_);
				}
				parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (e);
			}
		}
	}
}

GitgWindow*
gitg_window_create_new (GtkApplication* app,
                        GitgRepository* repository,
                        const gchar* action)
{
	GitgWindow* ret = NULL;
	GitgWindow* _tmp0_;
	GitgWindow* _tmp1_;
	GitgWindow* _tmp7_;
	GError* _inner_error0_ = NULL;
	GitgWindow* result;
	g_return_val_if_fail (app != NULL, NULL);
	_tmp0_ = gitg_window_new ();
	g_object_ref_sink (_tmp0_);
	ret = _tmp0_;
	_tmp1_ = ret;
	if (_tmp1_ != NULL) {
		GitgWindow* _tmp2_;
		GitgWindow* _tmp3_;
		GitgWindow* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = ret;
		gtk_window_set_application ((GtkWindow*) _tmp2_, app);
		_tmp3_ = ret;
		gitg_window_set_repository_internal (_tmp3_, repository);
		_tmp4_ = ret;
		_tmp5_ = g_strdup (action);
		_g_free0 (_tmp4_->priv->d_action);
		_tmp4_->priv->d_action = _tmp5_;
	}
	{
		GitgWindow* _tmp6_;
		_tmp6_ = ret;
		g_initable_init (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, g_initable_get_type (), GInitable), NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (ret);
		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;
	}
	_tmp7_ = ret;
	gitg_window_repository_changed (_tmp7_);
	result = ret;
	return result;
}

static GitgExtActivity*
gitg_window_real_set_activity_by_id (GitgExtApplication* base,
                                     const gchar* id)
{
	GitgWindow * self;
	GitgExtActivity* v = NULL;
	GitgUIElements* _tmp0_;
	gpointer _tmp1_;
	GitgExtActivity* _tmp2_;
	GitgUIElements* _tmp5_;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	GitgExtActivity* _tmp8_;
	GitgExtActivity* result;
	self = (GitgWindow*) base;
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = self->priv->d_activities;
	_tmp1_ = gitg_ui_elements_lookup (_tmp0_, id);
	v = (GitgExtActivity*) _tmp1_;
	_tmp2_ = v;
	if (_tmp2_ != NULL) {
		GitgUIElements* _tmp3_;
		GitgExtActivity* _tmp4_;
		_tmp3_ = self->priv->d_activities;
		_tmp4_ = v;
		gitg_ui_elements_set_current (_tmp3_, _tmp4_);
	}
	_tmp5_ = self->priv->d_activities;
	_tmp6_ = gitg_ui_elements_get_current (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = v;
	if (((GitgExtActivity*) _tmp7_) == _tmp8_) {
		result = v;
		return result;
	} else {
		result = NULL;
		_g_object_unref0 (v);
		return result;
	}
}

static GitgExtActivity*
gitg_window_real_get_activity_by_id (GitgExtApplication* base,
                                     const gchar* id)
{
	GitgWindow * self;
	GitgUIElements* _tmp0_;
	gpointer _tmp1_;
	GitgExtActivity* result;
	self = (GitgWindow*) base;
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = self->priv->d_activities;
	_tmp1_ = gitg_ui_elements_lookup (_tmp0_, id);
	result = (GitgExtActivity*) _tmp1_;
	return result;
}

static void
gitg_window_real_open_repository (GitgExtApplication* base,
                                  GFile* path)
{
	GitgWindow * self;
	GFile* repo = NULL;
	GitgRepository* repository = NULL;
	gboolean _tmp0_ = FALSE;
	GitgRepository* _tmp1_;
	GitgRepository* _tmp18_;
	GError* _inner_error0_ = NULL;
	self = (GitgWindow*) base;
	g_return_if_fail (path != NULL);
	repository = NULL;
	_tmp1_ = self->priv->d_repository;
	if (_tmp1_ != NULL) {
		GitgRepository* _tmp2_;
		GFile* _tmp3_;
		GFile* _tmp4_;
		_tmp2_ = self->priv->d_repository;
		_tmp3_ = ggit_repository_get_location ((GgitRepository*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = g_file_equal (_tmp4_, path);
		_g_object_unref0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		_g_object_unref0 (repository);
		_g_object_unref0 (repo);
		return;
	}
	{
		GFile* _tmp5_ = NULL;
		GFile* _tmp6_;
		GFile* _tmp7_;
		_tmp6_ = ggit_repository_discover (path, &_inner_error0_);
		_tmp5_ = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp7_ = _tmp5_;
		_tmp5_ = NULL;
		_g_object_unref0 (repo);
		repo = _tmp7_;
		_g_object_unref0 (_tmp5_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		gchar* repo_name = NULL;
		gchar* _tmp8_;
		gchar* title = NULL;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		GError* _tmp12_;
		const gchar* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = g_file_get_basename (path);
		repo_name = _tmp8_;
		_tmp9_ = repo_name;
		_tmp10_ = g_strdup_printf (_ ("“%s” is not a Git repository."), _tmp9_);
		title = _tmp10_;
		_tmp11_ = title;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		gitg_ext_application_show_infobar ((GitgExtApplication*) self, _tmp11_, _tmp13_, GTK_MESSAGE_WARNING);
		_g_free0 (title);
		_g_free0 (repo_name);
		_g_error_free0 (e);
		_g_object_unref0 (repository);
		_g_object_unref0 (repo);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (repository);
		_g_object_unref0 (repo);
		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;
	}
	{
		GitgRepository* _tmp14_ = NULL;
		GFile* _tmp15_;
		GitgRepository* _tmp16_;
		GitgRepository* _tmp17_;
		_tmp15_ = repo;
		_tmp16_ = gitg_repository_new (_tmp15_, NULL, &_inner_error0_);
		_tmp14_ = _tmp16_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		_tmp17_ = _tmp14_;
		_tmp14_ = NULL;
		_g_object_unref0 (repository);
		repository = _tmp17_;
		_g_object_unref0 (_tmp14_);
	}
	goto __finally1;
	__catch1_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (repository);
		_g_object_unref0 (repo);
		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;
	}
	_tmp18_ = repository;
	gitg_ext_application_set_repository ((GitgExtApplication*) self, _tmp18_);
	_g_object_unref0 (repository);
	_g_object_unref0 (repo);
}

static Block88Data*
block88_data_ref (Block88Data* _data88_)
{
	g_atomic_int_inc (&_data88_->_ref_count_);
	return _data88_;
}

static void
block88_data_unref (void * _userdata_)
{
	Block88Data* _data88_;
	_data88_ = (Block88Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data88_->_ref_count_)) {
		GitgWindow* self;
		self = _data88_->self;
		_g_free0 (_data88_->title);
		_g_free0 (_data88_->message);
		_g_object_unref0 (self);
		g_slice_free (Block88Data, _data88_);
	}
}

static gboolean
__lambda178_ (Block88Data* _data88_)
{
	GitgWindow* self;
	gchar* primary = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* secondary = NULL;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkInfoBar* _tmp10_;
	GtkInfoBar* _tmp11_;
	gboolean result;
	self = _data88_->self;
	_tmp0_ = g_markup_escape_text (_data88_->title, (gssize) -1);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("<b>%s</b>", _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	primary = _tmp3_;
	_tmp4_ = g_markup_escape_text (_data88_->message, (gssize) -1);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup_printf ("<small>%s</small>", _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	secondary = _tmp7_;
	_tmp8_ = self->priv->d_infobar_primary_label;
	gtk_label_set_label (_tmp8_, primary);
	_tmp9_ = self->priv->d_infobar_secondary_label;
	gtk_label_set_label (_tmp9_, secondary);
	_tmp10_ = self->priv->d_infobar;
	gtk_info_bar_set_message_type (_tmp10_, _data88_->type);
	_tmp11_ = self->priv->d_infobar;
	gtk_widget_show ((GtkWidget*) _tmp11_);
	result = FALSE;
	_g_free0 (secondary);
	_g_free0 (primary);
	return result;
}

static gboolean
___lambda178__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda178_ (self);
	return result;
}

static void
gitg_window_real_show_infobar (GitgExtApplication* base,
                               const gchar* title,
                               const gchar* message,
                               GtkMessageType type)
{
	GitgWindow * self;
	Block88Data* _data88_;
	gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GitgWindow*) base;
	g_return_if_fail (title != NULL);
	g_return_if_fail (message != NULL);
	_data88_ = g_slice_new0 (Block88Data);
	_data88_->_ref_count_ = 1;
	_data88_->self = g_object_ref (self);
	_tmp0_ = g_strdup (title);
	_g_free0 (_data88_->title);
	_data88_->title = _tmp0_;
	_tmp1_ = g_strdup (message);
	_g_free0 (_data88_->message);
	_data88_->message = _tmp1_;
	_data88_->type = type;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda178__gsource_func, block88_data_ref (_data88_), block88_data_unref);
	block88_data_unref (_data88_);
	_data88_ = NULL;
}

static void
gitg_window_real_user_query_async_data_free (gpointer _data)
{
	GitgWindowUserQueryAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->query);
	_g_object_unref0 (_data_->self);
	g_slice_free (GitgWindowUserQueryAsyncData, _data_);
}

static void
gitg_window_real_user_query_async (GitgExtApplication* base,
                                   GitgExtUserQuery* query,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	GitgWindow * self;
	GitgWindowUserQueryAsyncData* _data_;
	GitgWindow* _tmp0_;
	GitgExtUserQuery* _tmp1_;
	g_return_if_fail (query != NULL);
	self = (GitgWindow*) base;
	_data_ = g_slice_new0 (GitgWindowUserQueryAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, gitg_window_real_user_query_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (query);
	_g_object_unref0 (_data_->query);
	_data_->query = _tmp1_;
	gitg_window_real_user_query_async_co (_data_);
}

static GtkResponseType
gitg_window_user_query_finish (GitgExtApplication* base,
                               GAsyncResult* _res_)
{
	GtkResponseType result;
	GitgWindowUserQueryAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static Block89Data*
block89_data_ref (Block89Data* _data89_)
{
	g_atomic_int_inc (&_data89_->_ref_count_);
	return _data89_;
}

static void
block89_data_unref (void * _userdata_)
{
	Block89Data* _data89_;
	_data89_ = (Block89Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data89_->_ref_count_)) {
		GitgWindow* self;
		self = _data89_->self;
		(_data89_->cb_target_destroy_notify == NULL) ? NULL : (_data89_->cb_target_destroy_notify (_data89_->cb_target), NULL);
		_data89_->cb = NULL;
		_data89_->cb_target = NULL;
		_data89_->cb_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block89Data, _data89_);
	}
}

static gboolean
_gitg_window_real_user_query_async_co_gsource_func (gpointer self)
{
	gboolean result;
	result = gitg_window_real_user_query_async_co (self);
	return result;
}

static gboolean
__lambda186_ (Block89Data* _data89_,
              GtkResponseType response)
{
	GitgWindow* self;
	GSourceFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	gboolean result;
	self = _data89_->self;
	_data89_->retval = response;
	_tmp0_ = _data89_->cb;
	_tmp0__target = _data89_->cb_target;
	_tmp0__target_destroy_notify = _data89_->cb_target_destroy_notify;
	_data89_->cb = NULL;
	_data89_->cb_target = NULL;
	_data89_->cb_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify);
	result = TRUE;
	return result;
}

static gboolean
___lambda186__gitg_ext_user_query_response (GitgExtUserQuery* _sender,
                                            GtkResponseType response_type,
                                            gpointer self)
{
	gboolean result;
	result = __lambda186_ (self, response_type);
	return result;
}

static gboolean
gitg_window_real_user_query_async_co (GitgWindowUserQueryAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data89_ = g_slice_new0 (Block89Data);
	_data_->_data89_->_ref_count_ = 1;
	_data_->_data89_->self = g_object_ref (_data_->self);
	_data_->_data89_->_async_data_ = _data_;
	_data_->_data89_->cb = _gitg_window_real_user_query_async_co_gsource_func;
	_data_->_data89_->cb_target = _data_;
	_data_->_data89_->cb_target_destroy_notify = NULL;
	_data_->_data89_->retval = 0;
	g_signal_connect_data (_data_->query, "response", (GCallback) ___lambda186__gitg_ext_user_query_response, block89_data_ref (_data_->_data89_), (GClosureNotify) block89_data_unref, 0);
	gitg_ext_application_user_query ((GitgExtApplication*) _data_->self, _data_->query);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data89_->retval;
	block89_data_unref (_data_->_data89_);
	_data_->_data89_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block90Data*
block90_data_ref (Block90Data* _data90_)
{
	g_atomic_int_inc (&_data90_->_ref_count_);
	return _data90_;
}

static void
block90_data_unref (void * _userdata_)
{
	Block90Data* _data90_;
	_data90_ = (Block90Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data90_->_ref_count_)) {
		GitgWindow* self;
		self = _data90_->self;
		_g_object_unref0 (_data90_->dlg);
		_g_object_unref0 (_data90_->query);
		_g_object_unref0 (self);
		g_slice_free (Block90Data, _data90_);
	}
}

static void
__lambda187_ (Block90Data* _data90_)
{
	GitgWindow* self;
	GtkMessageDialog* _tmp0_;
	self = _data90_->self;
	_tmp0_ = _data90_->dlg;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
	g_signal_handler_disconnect ((GObject*) _data90_->query, _data90_->qid);
}

static void
___lambda187__gitg_ext_user_query_quit (GitgExtUserQuery* _sender,
                                        gpointer self)
{
	__lambda187_ (self);
}

static void
__lambda188_ (Block90Data* _data90_,
              GtkDialog* w,
              gint r)
{
	GitgWindow* self;
	GtkMessageDialog* _tmp0_;
	gboolean _tmp1_ = FALSE;
	self = _data90_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = _data90_->dlg;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, FALSE);
	g_signal_emit_by_name (_data90_->query, "response", (GtkResponseType) r, &_tmp1_);
	if (_tmp1_) {
		GtkMessageDialog* _tmp2_;
		_tmp2_ = _data90_->dlg;
		gtk_widget_destroy ((GtkWidget*) _tmp2_);
		g_signal_handler_disconnect ((GObject*) _data90_->query, _data90_->qid);
	}
}

static void
___lambda188__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda188_ (self, _sender, response_id);
}

static void
gitg_window_real_user_query (GitgExtApplication* base,
                             GitgExtUserQuery* query)
{
	GitgWindow * self;
	Block90Data* _data90_;
	GitgExtUserQuery* _tmp0_;
	GtkMessageType _tmp1_;
	GtkMessageType _tmp2_;
	GtkMessageDialog* _tmp3_;
	gchar* primary = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkMessageDialog* _tmp10_;
	const gchar* _tmp11_;
	GtkMessageDialog* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	GtkMessageDialog* _tmp18_;
	GtkResponseType _tmp19_;
	GtkResponseType _tmp20_;
	gint _tmp21_ = 0;
	GitgExtUserQueryResponse** _tmp22_;
	GtkMessageDialog* _tmp41_;
	GtkDialog* _tmp42_;
	GtkMessageDialog* _tmp43_;
	gulong _tmp44_;
	GtkMessageDialog* _tmp45_;
	GtkMessageDialog* _tmp46_;
	self = (GitgWindow*) base;
	g_return_if_fail (query != NULL);
	_data90_ = g_slice_new0 (Block90Data);
	_data90_->_ref_count_ = 1;
	_data90_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (query);
	_g_object_unref0 (_data90_->query);
	_data90_->query = _tmp0_;
	_tmp1_ = gitg_ext_user_query_get_message_type (_data90_->query);
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_MODAL, _tmp2_, GTK_BUTTONS_NONE, "");
	g_object_ref_sink (_tmp3_);
	_data90_->dlg = _tmp3_;
	_tmp4_ = gitg_ext_user_query_get_title (_data90_->query);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_markup_escape_text (_tmp5_, (gssize) -1);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("<b>%s</b>", _tmp7_);
	_tmp9_ = _tmp8_;
	_g_free0 (_tmp7_);
	primary = _tmp9_;
	_tmp10_ = _data90_->dlg;
	_tmp11_ = primary;
	gtk_message_dialog_set_markup (_tmp10_, _tmp11_);
	_tmp12_ = _data90_->dlg;
	_tmp13_ = gitg_ext_user_query_get_message (_data90_->query);
	_tmp14_ = _tmp13_;
	gtk_message_dialog_format_secondary_text (_tmp12_, "%s", _tmp14_);
	_tmp15_ = gitg_ext_user_query_get_message_use_markup (_data90_->query);
	_tmp16_ = _tmp15_;
	if (_tmp16_) {
		GtkMessageDialog* _tmp17_;
		_tmp17_ = _data90_->dlg;
		g_object_set (_tmp17_, "secondary-use-markup", TRUE, NULL);
	}
	_tmp18_ = _data90_->dlg;
	_tmp19_ = gitg_ext_user_query_get_default_response (_data90_->query);
	_tmp20_ = _tmp19_;
	gtk_dialog_set_default_response ((GtkDialog*) _tmp18_, (gint) _tmp20_);
	_tmp22_ = gitg_ext_user_query_get_responses (_data90_->query, &_tmp21_);
	{
		GitgExtUserQueryResponse** response_collection = NULL;
		gint response_collection_length1 = 0;
		gint _response_collection_size_ = 0;
		gint response_it = 0;
		response_collection = _tmp22_;
		response_collection_length1 = _tmp21_;
		for (response_it = 0; response_it < response_collection_length1; response_it = response_it + 1) {
			GitgExtUserQueryResponse* _tmp23_;
			GitgExtUserQueryResponse* response = NULL;
			_tmp23_ = _g_object_ref0 (response_collection[response_it]);
			response = _tmp23_;
			{
				GtkWidget* button = NULL;
				GtkMessageDialog* _tmp24_;
				GitgExtUserQueryResponse* _tmp25_;
				const gchar* _tmp26_;
				GitgExtUserQueryResponse* _tmp27_;
				GtkWidget* _tmp28_;
				GtkWidget* _tmp29_;
				GitgExtUserQueryResponse* _tmp30_;
				GtkResponseType _tmp31_;
				GtkResponseType _tmp32_;
				_tmp24_ = _data90_->dlg;
				_tmp25_ = response;
				_tmp26_ = _tmp25_->text;
				_tmp27_ = response;
				_tmp28_ = gtk_dialog_add_button ((GtkDialog*) _tmp24_, _tmp26_, (gint) _tmp27_->response_type);
				_tmp29_ = _g_object_ref0 (_tmp28_);
				button = _tmp29_;
				_tmp30_ = response;
				_tmp31_ = gitg_ext_user_query_get_default_response (_data90_->query);
				_tmp32_ = _tmp31_;
				if (_tmp30_->response_type == _tmp32_) {
					GtkWidget* _tmp33_;
					GtkWidget* _tmp34_;
					gboolean _tmp35_;
					gboolean _tmp36_;
					_tmp33_ = button;
					gtk_widget_set_can_default (_tmp33_, TRUE);
					_tmp34_ = button;
					g_object_set (_tmp34_, "has-default", TRUE, NULL);
					_tmp35_ = gitg_ext_user_query_get_default_is_destructive (_data90_->query);
					_tmp36_ = _tmp35_;
					if (_tmp36_) {
						GtkWidget* _tmp37_;
						GtkStyleContext* _tmp38_;
						_tmp37_ = button;
						_tmp38_ = gtk_widget_get_style_context (_tmp37_);
						gtk_style_context_add_class (_tmp38_, GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
					} else {
						GtkWidget* _tmp39_;
						GtkStyleContext* _tmp40_;
						_tmp39_ = button;
						_tmp40_ = gtk_widget_get_style_context (_tmp39_);
						gtk_style_context_add_class (_tmp40_, GTK_STYLE_CLASS_SUGGESTED_ACTION);
					}
				}
				_g_object_unref0 (button);
				_g_object_unref0 (response);
			}
		}
		response_collection = (_vala_array_free (response_collection, response_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	_tmp41_ = _data90_->dlg;
	_tmp42_ = _g_object_ref0 ((GtkDialog*) _tmp41_);
	_g_object_unref0 (self->priv->d_dialog);
	self->priv->d_dialog = _tmp42_;
	_tmp43_ = _data90_->dlg;
	g_object_add_weak_pointer ((GObject*) _tmp43_, &self->priv->d_dialog);
	_data90_->qid = (gulong) 0;
	_tmp44_ = g_signal_connect_data (_data90_->query, "quit", (GCallback) ___lambda187__gitg_ext_user_query_quit, block90_data_ref (_data90_), (GClosureNotify) block90_data_unref, 0);
	_data90_->qid = _tmp44_;
	_tmp45_ = _data90_->dlg;
	g_signal_connect_data ((GtkDialog*) _tmp45_, "response", (GCallback) ___lambda188__gtk_dialog_response, block90_data_ref (_data90_), (GClosureNotify) block90_data_unref, 0);
	_tmp46_ = _data90_->dlg;
	gtk_widget_show ((GtkWidget*) _tmp46_);
	_g_free0 (primary);
	block90_data_unref (_data90_);
	_data90_ = NULL;
}

static GgitSignature*
gitg_window_real_get_verified_committer (GitgExtApplication* base)
{
	GitgWindow * self;
	gchar* user = NULL;
	gchar* email = NULL;
	GgitSignature* committer = NULL;
	gboolean _tmp18_ = FALSE;
	const gchar* _tmp19_;
	GError* _inner_error0_ = NULL;
	GgitSignature* result;
	self = (GitgWindow*) base;
	user = NULL;
	email = NULL;
	committer = NULL;
	{
		GgitSignature* _tmp0_ = NULL;
		GitgRepository* _tmp1_;
		GitgRepository* _tmp2_;
		GitgRepository* _tmp3_;
		GeeMap* _tmp4_;
		GeeMap* _tmp5_;
		GeeMap* _tmp6_;
		GgitSignature* _tmp7_;
		GgitSignature* _tmp8_;
		GgitSignature* _tmp9_;
		GgitSignature* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		GgitSignature* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		_tmp1_ = gitg_ext_application_get_repository ((GitgExtApplication*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gitg_ext_application_get_environment ((GitgExtApplication*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gitg_repository_get_signature_with_environment (_tmp3_, _tmp6_, "COMMITTER", &_inner_error0_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (_tmp3_);
		_tmp0_ = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp9_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (committer);
		committer = _tmp9_;
		_tmp10_ = committer;
		_tmp11_ = ggit_signature_get_name (_tmp10_);
		_tmp12_ = g_strdup (_tmp11_);
		_g_free0 (user);
		user = _tmp12_;
		_tmp13_ = committer;
		_tmp14_ = ggit_signature_get_email (_tmp13_);
		_tmp15_ = g_strdup (_tmp14_);
		_g_free0 (email);
		email = _tmp15_;
		_tmp16_ = user;
		if (g_strcmp0 (_tmp16_, "") == 0) {
			_g_free0 (user);
			user = NULL;
		}
		_tmp17_ = email;
		if (g_strcmp0 (_tmp17_, "") == 0) {
			_g_free0 (email);
			email = NULL;
		}
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (committer);
		_g_free0 (email);
		_g_free0 (user);
		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;
	}
	_tmp19_ = user;
	if (_tmp19_ == NULL) {
		_tmp18_ = TRUE;
	} else {
		const gchar* _tmp20_;
		_tmp20_ = email;
		_tmp18_ = _tmp20_ == NULL;
	}
	if (_tmp18_) {
		gchar* secmsg = NULL;
		gboolean _tmp21_ = FALSE;
		const gchar* _tmp22_;
		const gchar* _tmp28_;
		_tmp22_ = user;
		if (_tmp22_ == NULL) {
			const gchar* _tmp23_;
			_tmp23_ = email;
			_tmp21_ = _tmp23_ == NULL;
		} else {
			_tmp21_ = FALSE;
		}
		if (_tmp21_) {
			gchar* _tmp24_;
			_tmp24_ = g_strdup (_ ("Your user name and email are not configured yet. Please go to the user" \
" configuration and provide your name and email."));
			_g_free0 (secmsg);
			secmsg = _tmp24_;
		} else {
			const gchar* _tmp25_;
			_tmp25_ = user;
			if (_tmp25_ == NULL) {
				gchar* _tmp26_;
				_tmp26_ = g_strdup (_ ("Your user name is not configured yet. Please go to the user configurat" \
"ion and provide your name."));
				_g_free0 (secmsg);
				secmsg = _tmp26_;
			} else {
				gchar* _tmp27_;
				_tmp27_ = g_strdup (_ ("Your email is not configured yet. Please go to the user configuration " \
"and provide your email."));
				_g_free0 (secmsg);
				secmsg = _tmp27_;
			}
		}
		_tmp28_ = secmsg;
		gitg_ext_application_show_infobar ((GitgExtApplication*) self, _ ("Missing author details"), _tmp28_, GTK_MESSAGE_ERROR);
		result = NULL;
		_g_free0 (secmsg);
		_g_object_unref0 (committer);
		_g_free0 (email);
		_g_free0 (user);
		return result;
	}
	result = committer;
	_g_free0 (email);
	_g_free0 (user);
	return result;
}

void
gitg_window_present (GitgWindow* self,
                     const gchar* hint,
                     GitgExtCommandLines* command_lines)
{
	g_return_if_fail (self != NULL);
	if (hint != NULL) {
		gitg_window_activate_activity (self, hint);
	}
	if (command_lines != NULL) {
		gitg_ext_command_lines_apply (command_lines, (GitgExtApplication*) self);
	}
	gtk_window_present ((GtkWindow*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow));
}

static void
gitg_window_on_select_activated (GitgWindow* self,
                                 GSimpleAction* action)
{
	gboolean st = FALSE;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	gboolean _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_action_get_state ((GAction*) action);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_get_boolean (_tmp1_);
	_g_variant_unref0 (_tmp1_);
	st = _tmp2_;
	_tmp3_ = g_variant_new_boolean (!st);
	g_variant_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	g_simple_action_set_state (action, _tmp4_);
	_g_variant_unref0 (_tmp4_);
}

static void
gitg_window_on_select_cancel_button_clicked (GitgWindow* self)
{
	g_return_if_fail (self != NULL);
	gitg_window_set_selectable_mode (self, GITG_EXT_SELECTION_MODE_NORMAL);
}

static void
_gitg_window_on_select_cancel_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self)
{
	gitg_window_on_select_cancel_button_clicked ((GitgWindow*) self);
}

GitgWindow*
gitg_window_construct (GType object_type)
{
	GitgWindow * self = NULL;
	self = (GitgWindow*) g_object_new (object_type, NULL);
	return self;
}

GitgWindow*
gitg_window_new (void)
{
	return gitg_window_construct (GITG_TYPE_WINDOW);
}

static GitgExtActivity*
gitg_window_real_get_current_activity (GitgExtApplication* base)
{
	GitgExtActivity* result;
	GitgWindow* self;
	self = (GitgWindow*) base;
	if (self->priv->d_mode == GITG_WINDOW_MODE_ACTIVITY) {
		GitgUIElements* _tmp0_;
		gconstpointer _tmp1_;
		gconstpointer _tmp2_;
		GitgExtActivity* _tmp3_;
		_tmp0_ = self->priv->d_activities;
		_tmp1_ = gitg_ui_elements_get_current (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _g_object_ref0 ((GitgExtActivity*) _tmp2_);
		result = _tmp3_;
		return result;
	} else {
		GitgDashView* _tmp4_;
		GitgExtActivity* _tmp5_;
		_tmp4_ = self->priv->d_dash_view;
		_tmp5_ = _g_object_ref0 ((GitgExtActivity*) _tmp4_);
		result = _tmp5_;
		return result;
	}
}

static GitgExtMessageBus*
gitg_window_real_get_message_bus (GitgExtApplication* base)
{
	GitgExtMessageBus* result;
	GitgWindow* self;
	GitgExtMessageBus* _tmp0_;
	GitgExtMessageBus* _tmp1_;
	self = (GitgWindow*) base;
	_tmp0_ = self->priv->d_message_bus;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static GitgRepository*
gitg_window_real_get_repository (GitgExtApplication* base)
{
	GitgRepository* result;
	GitgWindow* self;
	GitgRepository* _tmp0_;
	GitgRepository* _tmp1_;
	self = (GitgWindow*) base;
	_tmp0_ = self->priv->d_repository;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gitg_window_real_set_repository (GitgExtApplication* base,
                                 GitgRepository* value)
{
	GitgWindow* self;
	self = (GitgWindow*) base;
	gitg_window_set_repository_internal (self, value);
	gitg_window_repository_changed (self);
}

gboolean
gitg_window_get_enable_monitoring (GitgWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->d_enable_monitoring;
	return result;
}

void
gitg_window_set_enable_monitoring (GitgWindow* self,
                                   gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->d_enable_monitoring = value;
	gitg_window_update_enable_monitoring (self);
	g_object_notify_by_pspec ((GObject *) self, gitg_window_properties[GITG_WINDOW_ENABLE_MONITORING_PROPERTY]);
}

static GeeMap*
gitg_window_real_get_environment (GitgExtApplication* base)
{
	GeeMap* result;
	GitgWindow* self;
	GeeHashMap* _tmp0_;
	GeeMap* _tmp1_;
	self = (GitgWindow*) base;
	_tmp0_ = self->priv->d_environment;
	_tmp1_ = _g_object_ref0 ((GeeMap*) _tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
gitg_window_real_get_busy (GitgExtApplication* base)
{
	gboolean result;
	GitgWindow* self;
	self = (GitgWindow*) base;
	result = self->priv->d_busy;
	return result;
}

static void
gitg_window_real_set_busy (GitgExtApplication* base,
                           gboolean value)
{
	GitgWindow* self;
	GdkWindow* win = NULL;
	GtkDialog* _tmp0_;
	self = (GitgWindow*) base;
	self->priv->d_busy = value;
	_tmp0_ = self->priv->d_dialog;
	if (_tmp0_ != NULL) {
		GtkDialog* _tmp1_;
		GdkWindow* _tmp2_;
		GdkWindow* _tmp3_;
		_tmp1_ = self->priv->d_dialog;
		_tmp2_ = gtk_widget_get_window ((GtkWidget*) _tmp1_);
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_g_object_unref0 (win);
		win = _tmp3_;
	} else {
		GdkWindow* _tmp4_;
		GdkWindow* _tmp5_;
		_tmp4_ = gtk_widget_get_window ((GtkWidget*) self);
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_g_object_unref0 (win);
		win = _tmp5_;
	}
	if (self->priv->d_busy) {
		GdkWindow* _tmp6_;
		GdkDisplay* _tmp7_;
		GdkCursor* _tmp8_;
		GdkCursor* _tmp9_;
		_tmp6_ = win;
		_tmp7_ = gtk_widget_get_display ((GtkWidget*) self);
		_tmp8_ = gdk_cursor_new_for_display (_tmp7_, GDK_WATCH);
		_tmp9_ = _tmp8_;
		gdk_window_set_cursor (_tmp6_, _tmp9_);
		_g_object_unref0 (_tmp9_);
	} else {
		GdkWindow* _tmp10_;
		_tmp10_ = win;
		gdk_window_set_cursor (_tmp10_, NULL);
	}
	_g_object_unref0 (win);
	g_object_notify_by_pspec ((GObject *) self, gitg_window_properties[GITG_WINDOW_BUSY_PROPERTY]);
}

GitgExtSelectionMode
gitg_window_get_selectable_mode (GitgWindow* self)
{
	GitgExtSelectionMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->d_selectable_mode;
	return result;
}

void
gitg_window_set_selectable_mode (GitgWindow* self,
                                 GitgExtSelectionMode value)
{
	GitgExtSelectable* selectable = NULL;
	GitgExtActivity* _tmp0_;
	GitgExtActivity* _tmp1_;
	GitgExtSelectable* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GitgExtSelectable* _tmp4_;
	GitgExtSelectable* _tmp5_;
	GtkStyleContext* ctx = NULL;
	GtkHeaderBar* _tmp6_;
	GtkStyleContext* _tmp7_;
	GtkStyleContext* _tmp8_;
	gboolean issel = FALSE;
	GitgExtSearchable* searchable = NULL;
	GitgExtActivity* _tmp20_;
	GitgExtActivity* _tmp21_;
	GitgExtSearchable* _tmp22_;
	gboolean _tmp23_ = FALSE;
	GtkHeaderBar* _tmp24_;
	gboolean _tmp25_ = FALSE;
	GtkToggleButton* _tmp27_;
	GtkMenuButton* _tmp28_;
	GtkToggleButton* _tmp29_;
	gboolean _tmp30_ = FALSE;
	GtkButton* _tmp32_;
	gboolean _tmp33_ = FALSE;
	GtkButton* _tmp35_;
	gboolean _tmp36_ = FALSE;
	GtkButton* _tmp38_;
	gboolean _tmp39_ = FALSE;
	GtkStackSwitcher* _tmp41_;
	GtkButton* _tmp42_;
	GtkToggleButton* _tmp43_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gitg_ext_application_get_current_activity ((GitgExtApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GITG_EXT_TYPE_SELECTABLE) ? ((GitgExtSelectable*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	selectable = _tmp2_;
	_tmp4_ = selectable;
	if (_tmp4_ == NULL) {
		_tmp3_ = TRUE;
	} else {
		_tmp3_ = self->priv->d_selectable_mode == value;
	}
	if (_tmp3_) {
		_g_object_unref0 (selectable);
		return;
	}
	self->priv->d_selectable_mode = value;
	_tmp5_ = selectable;
	gitg_ext_selectable_set_selectable_mode (_tmp5_, value);
	_tmp6_ = self->priv->d_header_bar;
	_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
	_tmp8_ = _g_object_ref0 (_tmp7_);
	ctx = _tmp8_;
	if (self->priv->d_selectable_mode == GITG_EXT_SELECTION_MODE_SELECTION) {
		GtkStyleContext* _tmp9_;
		GitgExtSelectable* _tmp10_;
		GtkWidget* _tmp11_;
		GtkWidget* _tmp12_;
		GtkWidget* _tmp13_;
		_tmp9_ = ctx;
		gtk_style_context_add_class (_tmp9_, "selection-mode");
		_tmp10_ = selectable;
		_tmp11_ = gitg_ext_selectable_get_action_widget (_tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (self->priv->d_select_actions);
		self->priv->d_select_actions = _tmp12_;
		_tmp13_ = self->priv->d_select_actions;
		if (_tmp13_ != NULL) {
			GtkGrid* _tmp14_;
			GtkWidget* _tmp15_;
			GtkWidget* _tmp16_;
			_tmp14_ = self->priv->d_grid_main;
			_tmp15_ = self->priv->d_select_actions;
			gtk_grid_attach (_tmp14_, _tmp15_, 0, 3, 1, 1);
			_tmp16_ = self->priv->d_select_actions;
			gtk_widget_show (_tmp16_);
		}
	} else {
		GtkStyleContext* _tmp17_;
		GtkWidget* _tmp18_;
		_tmp17_ = ctx;
		gtk_style_context_remove_class (_tmp17_, "selection-mode");
		_tmp18_ = self->priv->d_select_actions;
		if (_tmp18_ != NULL) {
			GtkWidget* _tmp19_;
			_tmp19_ = self->priv->d_select_actions;
			gtk_widget_destroy (_tmp19_);
			_g_object_unref0 (self->priv->d_select_actions);
			self->priv->d_select_actions = NULL;
		}
	}
	issel = self->priv->d_selectable_mode == GITG_EXT_SELECTION_MODE_SELECTION;
	_tmp20_ = gitg_ext_application_get_current_activity ((GitgExtApplication*) self);
	_tmp21_ = _tmp20_;
	_tmp22_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, GITG_EXT_TYPE_SEARCHABLE) ? ((GitgExtSearchable*) _tmp21_) : NULL;
	if (_tmp22_ == NULL) {
		_g_object_unref0 (_tmp21_);
	}
	searchable = _tmp22_;
	if (!gitg_platform_support_use_native_window_controls (NULL)) {
		_tmp23_ = !issel;
	} else {
		_tmp23_ = FALSE;
	}
	_tmp24_ = self->priv->d_header_bar;
	gtk_header_bar_set_show_close_button (_tmp24_, _tmp23_);
	if (!issel) {
		GitgExtSearchable* _tmp26_;
		_tmp26_ = searchable;
		_tmp25_ = _tmp26_ != NULL;
	} else {
		_tmp25_ = FALSE;
	}
	_tmp27_ = self->priv->d_search_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp27_, _tmp25_);
	_tmp28_ = self->priv->d_gear_menu;
	gtk_widget_set_visible ((GtkWidget*) _tmp28_, !issel);
	_tmp29_ = self->priv->d_select_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp29_, !issel);
	if (!issel) {
		GitgRepository* _tmp31_;
		_tmp31_ = self->priv->d_repository;
		_tmp30_ = _tmp31_ != NULL;
	} else {
		_tmp30_ = FALSE;
	}
	_tmp32_ = self->priv->d_dash_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp32_, _tmp30_);
	if (!issel) {
		GitgRepository* _tmp34_;
		_tmp34_ = self->priv->d_repository;
		_tmp33_ = _tmp34_ == NULL;
	} else {
		_tmp33_ = FALSE;
	}
	_tmp35_ = self->priv->d_clone_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp35_, _tmp33_);
	if (!issel) {
		GitgRepository* _tmp37_;
		_tmp37_ = self->priv->d_repository;
		_tmp36_ = _tmp37_ == NULL;
	} else {
		_tmp36_ = FALSE;
	}
	_tmp38_ = self->priv->d_add_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp38_, _tmp36_);
	if (!issel) {
		GitgRepository* _tmp40_;
		_tmp40_ = self->priv->d_repository;
		_tmp39_ = _tmp40_ != NULL;
	} else {
		_tmp39_ = FALSE;
	}
	_tmp41_ = self->priv->d_activities_switcher;
	gtk_widget_set_visible ((GtkWidget*) _tmp41_, _tmp39_);
	_tmp42_ = self->priv->d_select_cancel_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp42_, issel);
	_tmp43_ = self->priv->d_select_button;
	gtk_toggle_button_set_active (_tmp43_, issel);
	_g_object_unref0 (searchable);
	_g_object_unref0 (ctx);
	_g_object_unref0 (selectable);
	g_object_notify_by_pspec ((GObject *) self, gitg_window_properties[GITG_WINDOW_SELECTABLE_MODE_PROPERTY]);
}

static GitgExtRemoteLookup*
gitg_window_real_get_remote_lookup (GitgExtApplication* base)
{
	GitgExtRemoteLookup* result;
	GitgWindow* self;
	GitgRemoteManager* _tmp0_;
	GitgExtRemoteLookup* _tmp1_;
	self = (GitgWindow*) base;
	_tmp0_ = self->priv->d_remote_manager;
	_tmp1_ = _g_object_ref0 ((GitgExtRemoteLookup*) _tmp0_);
	result = _tmp1_;
	return result;
}

static GitgExtNotifications*
gitg_window_real_get_notifications (GitgExtApplication* base)
{
	GitgExtNotifications* result;
	GitgWindow* self;
	GitgNotifications* _tmp0_;
	GitgExtNotifications* _tmp1_;
	self = (GitgWindow*) base;
	_tmp0_ = self->priv->d_notifications;
	_tmp1_ = _g_object_ref0 ((GitgExtNotifications*) _tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
gitg_window_real_change_to_activity (GitgWindow* self,
                                     gint i)
{
	GitgExtActivity** elems = NULL;
	GitgUIElements* _tmp0_;
	gint _tmp1_ = 0;
	gpointer* _tmp2_;
	gint elems_length1;
	gint _elems_size_;
	gint _tmp3_;
	GitgExtActivity** _tmp4_;
	gint _tmp4__length1;
	GitgUIElements* _tmp5_;
	GitgExtActivity** _tmp6_;
	gint _tmp6__length1;
	GitgExtActivity* _tmp7_;
	gboolean result;
	if (self->priv->d_selectable_mode == GITG_EXT_SELECTION_MODE_SELECTION) {
		result = FALSE;
		return result;
	}
	if (i == 0) {
		if (self->priv->d_mode == GITG_WINDOW_MODE_ACTIVITY) {
			gitg_ext_application_set_repository ((GitgExtApplication*) self, NULL);
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
	if (self->priv->d_mode != GITG_WINDOW_MODE_ACTIVITY) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->d_activities;
	_tmp2_ = gitg_ui_elements_get_available_elements (_tmp0_, &_tmp1_);
	elems = _tmp2_;
	elems_length1 = _tmp1_;
	_elems_size_ = elems_length1;
	_tmp3_ = i;
	i = _tmp3_ - 1;
	_tmp4_ = elems;
	_tmp4__length1 = elems_length1;
	if (i >= _tmp4__length1) {
		result = FALSE;
		elems = (_vala_array_free (elems, elems_length1, (GDestroyNotify) g_object_unref), NULL);
		return result;
	}
	_tmp5_ = self->priv->d_activities;
	_tmp6_ = elems;
	_tmp6__length1 = elems_length1;
	_tmp7_ = _tmp6_[i];
	gitg_ui_elements_set_current (_tmp5_, _tmp7_);
	result = TRUE;
	elems = (_vala_array_free (elems, elems_length1, (GDestroyNotify) g_object_unref), NULL);
	return result;
}

static void
g_cclosure_user_marshal_BOOLEAN__INT (GClosure * closure,
                                      GValue * return_value,
                                      guint n_param_values,
                                      const GValue * param_values,
                                      gpointer invocation_hint,
                                      gpointer marshal_data)
{
	typedef gboolean (*GMarshalFunc_BOOLEAN__INT) (gpointer data1, gint arg_1, gpointer data2);
	register GMarshalFunc_BOOLEAN__INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	gboolean v_return;
	cc = (GCClosure *) closure;
	g_return_if_fail (return_value != NULL);
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_BOOLEAN__INT) (marshal_data ? marshal_data : cc->callback);
	v_return = callback (data1, g_value_get_int (param_values + 1), data2);
	g_value_set_boolean (return_value, v_return);
}

static void
gitg_window_real_cancel (GitgWindow* self)
{
	GtkInfoBar* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->d_infobar;
	_tmp1_ = gtk_widget_get_visible ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkInfoBar* _tmp3_;
		_tmp3_ = self->priv->d_infobar;
		gtk_widget_hide ((GtkWidget*) _tmp3_);
	} else {
		gitg_window_set_selectable_mode (self, GITG_EXT_SELECTION_MODE_NORMAL);
	}
}

static Block91Data*
block91_data_ref (Block91Data* _data91_)
{
	g_atomic_int_inc (&_data91_->_ref_count_);
	return _data91_;
}

static void
block91_data_unref (void * _userdata_)
{
	Block91Data* _data91_;
	_data91_ = (Block91Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data91_->_ref_count_)) {
		GitgWindow* self;
		self = _data91_->self;
		_g_object_unref0 (_data91_->selact);
		_g_object_unref0 (self);
		g_slice_free (Block91Data, _data91_);
	}
}

static void
_gitg_window___lambda189_ (Block91Data* _data91_)
{
	GitgWindow* self;
	gboolean st = FALSE;
	GAction* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	gboolean _tmp3_;
	self = _data91_->self;
	_tmp0_ = _data91_->selact;
	_tmp1_ = g_action_get_state (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_get_boolean (_tmp2_);
	_g_variant_unref0 (_tmp2_);
	st = _tmp3_;
	if (st) {
		gitg_window_set_selectable_mode (self, GITG_EXT_SELECTION_MODE_SELECTION);
	} else {
		gitg_window_set_selectable_mode (self, GITG_EXT_SELECTION_MODE_NORMAL);
	}
}

static void
__gitg_window___lambda189__g_object_notify (GObject* _sender,
                                            GParamSpec* pspec,
                                            gpointer self)
{
	_gitg_window___lambda189_ (self);
}

static void
_gitg_window___lambda190_ (GitgWindow* self,
                           GtkInfoBar* w,
                           gint r)
{
	GtkInfoBar* _tmp0_;
	g_return_if_fail (w != NULL);
	_tmp0_ = self->priv->d_infobar;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}

static void
__gitg_window___lambda190__gtk_info_bar_response (GtkInfoBar* _sender,
                                                  gint response_id,
                                                  gpointer self)
{
	_gitg_window___lambda190_ ((GitgWindow*) self, _sender, response_id);
}

static GObject *
gitg_window_constructor (GType type,
                         guint n_construct_properties,
                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GitgWindow * self;
	Block91Data* _data91_;
	GtkOverlay* _tmp5_;
	GitgNotifications* _tmp6_;
	GAction* _tmp7_;
	GAction* _tmp8_;
	GAction* _tmp9_;
	GSettings* _tmp10_;
	gpointer _tmp11_;
	GitgDashView* _tmp12_;
	gpointer _tmp13_;
	GtkSearchBar* _tmp14_;
	GtkSearchEntry* _tmp15_;
	GtkToggleButton* _tmp16_;
	GtkSearchBar* _tmp17_;
	GtkStackSwitcher* _tmp18_;
	GtkStack* _tmp19_;
	GeeHashMap* _tmp20_;
	gchar** _tmp21_;
	gchar** _tmp22_;
	gboolean _tmp28_ = FALSE;
	const gchar* _tmp29_;
	GtkHeaderBar* _tmp31_;
	GtkStackSwitcher* _tmp32_;
	GtkHeaderBar* _tmp33_;
	GtkToggleButton* _tmp34_;
	GtkHeaderBar* _tmp35_;
	GtkToggleButton* _tmp36_;
	GtkHeaderBar* _tmp37_;
	GtkMenuButton* _tmp38_;
	GtkHeaderBar* _tmp39_;
	GtkMenuButton* _tmp40_;
	GtkHeaderBar* _tmp41_;
	GtkStackSwitcher* _tmp42_;
	GtkHeaderBar* _tmp43_;
	GtkToggleButton* _tmp44_;
	GtkHeaderBar* _tmp45_;
	GtkToggleButton* _tmp46_;
	GtkInfoBar* _tmp47_;
	GtkBindingSet* bset = NULL;
	GObjectClass* _tmp48_;
	GtkBindingSet* _tmp49_;
	GtkBindingSet* _tmp53_;
	GSettings* _tmp54_;
	parent_class = G_OBJECT_CLASS (gitg_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_WINDOW, GitgWindow);
	_data91_ = g_slice_new0 (Block91Data);
	_data91_->_ref_count_ = 1;
	_data91_->self = g_object_ref (self);
	if (gitg_platform_support_use_native_window_controls (NULL)) {
		GtkGrid* _tmp0_;
		GtkHeaderBar* _tmp1_;
		gtk_window_set_titlebar ((GtkWindow*) self, NULL);
		_tmp0_ = self->priv->d_grid_top;
		_tmp1_ = self->priv->d_header_bar;
		gtk_grid_attach (_tmp0_, (GtkWidget*) _tmp1_, 0, 0, 1, 1);
	} else {
		GtkHeaderBar* _tmp2_;
		GtkHeaderBar* _tmp3_;
		GtkStyleContext* _tmp4_;
		_tmp2_ = self->priv->d_header_bar;
		gtk_header_bar_set_show_close_button (_tmp2_, TRUE);
		_tmp3_ = self->priv->d_header_bar;
		_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
		gtk_style_context_add_class (_tmp4_, "titlebar");
	}
	g_action_map_add_action_entries ((GActionMap*) self, GITG_WINDOW_win_entries, (gint) G_N_ELEMENTS (GITG_WINDOW_win_entries), self);
	g_action_map_add_action_entries ((GActionMap*) self, GITG_WINDOW_shortcut_window_entries, (gint) G_N_ELEMENTS (GITG_WINDOW_shortcut_window_entries), self);
	_tmp5_ = self->priv->d_overlay;
	_tmp6_ = gitg_notifications_new (_tmp5_);
	_g_object_unref0 (self->priv->d_notifications);
	self->priv->d_notifications = _tmp6_;
	_tmp7_ = g_action_map_lookup_action ((GActionMap*) self, "select");
	_tmp8_ = _g_object_ref0 (_tmp7_);
	_data91_->selact = _tmp8_;
	_tmp9_ = _data91_->selact;
	g_signal_connect_data ((GObject*) _tmp9_, "notify::state", (GCallback) __gitg_window___lambda189__g_object_notify, block91_data_ref (_data91_), (GClosureNotify) block91_data_unref, 0);
	_tmp10_ = g_settings_new (APPLICATION_ID ".preferences.interface");
	_g_object_unref0 (self->priv->d_interface_settings);
	self->priv->d_interface_settings = _tmp10_;
	_tmp11_ = gitg_builder_load_object (g_menu_model_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "ui/gitg-menus.ui", "win-menu-dash");
	_g_object_unref0 (self->priv->d_dash_model);
	self->priv->d_dash_model = (GMenuModel*) _tmp11_;
	_tmp12_ = self->priv->d_dash_view;
	gitg_ext_ui_element_set_application ((GitgExtUIElement*) _tmp12_, (GitgExtApplication*) self);
	_tmp13_ = gitg_builder_load_object (g_menu_model_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "ui/gitg-menus.ui", "win-menu-views");
	_g_object_unref0 (self->priv->d_activities_model);
	self->priv->d_activities_model = (GMenuModel*) _tmp13_;
	_tmp14_ = self->priv->d_search_bar;
	_tmp15_ = self->priv->d_search_entry;
	gtk_search_bar_connect_entry (_tmp14_, (GtkEntry*) _tmp15_);
	_tmp16_ = self->priv->d_search_button;
	_tmp17_ = self->priv->d_search_bar;
	g_object_bind_property_with_closures ((GObject*) _tmp16_, "active", (GObject*) _tmp17_, "search-mode-enabled", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp18_ = self->priv->d_activities_switcher;
	_tmp19_ = self->priv->d_stack_activities;
	gtk_stack_switcher_set_stack (_tmp18_, _tmp19_);
	_tmp20_ = 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);
	_g_object_unref0 (self->priv->d_environment);
	self->priv->d_environment = _tmp20_;
	_tmp22_ = _tmp21_ = g_listenv ();
	{
		gchar** e_collection = NULL;
		gint e_collection_length1 = 0;
		gint _e_collection_size_ = 0;
		gint e_it = 0;
		e_collection = _tmp22_;
		e_collection_length1 = _vala_array_length (_tmp21_);
		for (e_it = 0; e_it < e_collection_length1; e_it = e_it + 1) {
			gchar* _tmp23_;
			gchar* e = NULL;
			_tmp23_ = g_strdup (e_collection[e_it]);
			e = _tmp23_;
			{
				GeeHashMap* _tmp24_;
				const gchar* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_;
				_tmp24_ = self->priv->d_environment;
				_tmp25_ = e;
				_tmp26_ = e;
				_tmp27_ = g_getenv (_tmp26_);
				gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, _tmp25_, _tmp27_);
				_g_free0 (e);
			}
		}
		e_collection = (_vala_array_free (e_collection, e_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp29_ = gtk_check_version ((guint) 3, (guint) 13, (guint) 2);
	if (_tmp29_ != NULL) {
		_tmp28_ = gtk_widget_get_direction ((GtkWidget*) self) == GTK_TEXT_DIR_RTL;
	} else {
		_tmp28_ = FALSE;
	}
	if (_tmp28_) {
		GtkImage* _tmp30_;
		_tmp30_ = self->priv->dash_image;
		g_object_set (_tmp30_, "icon-name", "go-previous-rtl-symbolic", NULL);
	}
	_tmp31_ = self->priv->d_header_bar;
	_tmp32_ = self->priv->d_activities_switcher;
	gtk_container_remove ((GtkContainer*) _tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = self->priv->d_header_bar;
	_tmp34_ = self->priv->d_search_button;
	gtk_container_remove ((GtkContainer*) _tmp33_, (GtkWidget*) _tmp34_);
	_tmp35_ = self->priv->d_header_bar;
	_tmp36_ = self->priv->d_select_button;
	gtk_container_remove ((GtkContainer*) _tmp35_, (GtkWidget*) _tmp36_);
	_tmp37_ = self->priv->d_header_bar;
	_tmp38_ = self->priv->d_gear_menu;
	gtk_container_remove ((GtkContainer*) _tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = self->priv->d_header_bar;
	_tmp40_ = self->priv->d_gear_menu;
	gtk_header_bar_pack_end (_tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = self->priv->d_header_bar;
	_tmp42_ = self->priv->d_activities_switcher;
	gtk_header_bar_pack_end (_tmp41_, (GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->d_header_bar;
	_tmp44_ = self->priv->d_select_button;
	gtk_header_bar_pack_end (_tmp43_, (GtkWidget*) _tmp44_);
	_tmp45_ = self->priv->d_header_bar;
	_tmp46_ = self->priv->d_search_button;
	gtk_header_bar_pack_end (_tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = self->priv->d_infobar;
	g_signal_connect_object (_tmp47_, "response", (GCallback) __gitg_window___lambda190__gtk_info_bar_response, self, 0);
	_tmp48_ = G_OBJECT_GET_CLASS ((GObject*) self);
	_tmp49_ = gtk_binding_set_by_class ((gpointer) _tmp48_);
	bset = _tmp49_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp50_ = FALSE;
			_tmp50_ = TRUE;
			while (TRUE) {
				GtkBindingSet* _tmp52_;
				if (!_tmp50_) {
					gint _tmp51_;
					_tmp51_ = i;
					i = _tmp51_ + 1;
				}
				_tmp50_ = FALSE;
				if (!(i < 10)) {
					break;
				}
				_tmp52_ = bset;
				gtk_binding_entry_add_signal (_tmp52_, GDK_KEY_0 + i, GDK_MOD1_MASK, "change-to-activity", (guint) 1, G_TYPE_INT, i, NULL);
			}
		}
	}
	_tmp53_ = bset;
	gtk_binding_entry_add_signal (_tmp53_, GDK_KEY_Escape, 0, "cancel", (guint) 0, NULL);
	_tmp54_ = self->priv->d_interface_settings;
	g_settings_bind (_tmp54_, "enable-monitoring", (GObject*) self, "enable-monitoring", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	block91_data_unref (_data91_);
	_data91_ = NULL;
	return obj;
}

static void
gitg_window_class_init (GitgWindowClass * klass,
                        gpointer klass_data)
{
	gitg_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgWindow_private_offset);
	((GtkWidgetClass *) klass)->style_updated = (void (*) (GtkWidget*)) gitg_window_real_style_updated;
	((GtkWidgetClass *) klass)->delete_event = (gboolean (*) (GtkWidget*, GdkEventAny*)) gitg_window_real_delete_event;
	((GtkWidgetClass *) klass)->realize = (void (*) (GtkWidget*)) gitg_window_real_realize;
	((GtkWidgetClass *) klass)->window_state_event = (gboolean (*) (GtkWidget*, GdkEventWindowState*)) gitg_window_real_window_state_event;
	((GtkWidgetClass *) klass)->configure_event = (gboolean (*) (GtkWidget*, GdkEventConfigure*)) gitg_window_real_configure_event;
	((GitgWindowClass *) klass)->change_to_activity = gitg_window_real_change_to_activity;
	((GitgWindowClass *) klass)->cancel = gitg_window_real_cancel;
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_window_set_property;
	G_OBJECT_CLASS (klass)->constructor = gitg_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = gitg_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_CURRENT_ACTIVITY_PROPERTY, gitg_window_properties[GITG_WINDOW_CURRENT_ACTIVITY_PROPERTY] = g_param_spec_object ("current-activity", "current-activity", "current-activity", GITG_EXT_TYPE_ACTIVITY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_MESSAGE_BUS_PROPERTY, gitg_window_properties[GITG_WINDOW_MESSAGE_BUS_PROPERTY] = g_param_spec_object ("message-bus", "message-bus", "message-bus", GITG_EXT_TYPE_MESSAGE_BUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_REPOSITORY_PROPERTY, gitg_window_properties[GITG_WINDOW_REPOSITORY_PROPERTY] = g_param_spec_object ("repository", "repository", "repository", GITG_TYPE_REPOSITORY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_ENABLE_MONITORING_PROPERTY, gitg_window_properties[GITG_WINDOW_ENABLE_MONITORING_PROPERTY] = g_param_spec_boolean ("enable-monitoring", "enable-monitoring", "enable-monitoring", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_ENVIRONMENT_PROPERTY, gitg_window_properties[GITG_WINDOW_ENVIRONMENT_PROPERTY] = g_param_spec_object ("environment", "environment", "environment", GEE_TYPE_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_BUSY_PROPERTY, gitg_window_properties[GITG_WINDOW_BUSY_PROPERTY] = g_param_spec_boolean ("busy", "busy", "busy", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_SELECTABLE_MODE_PROPERTY, gitg_window_properties[GITG_WINDOW_SELECTABLE_MODE_PROPERTY] = g_param_spec_enum ("selectable-mode", "selectable-mode", "selectable-mode", GITG_EXT_TYPE_SELECTION_MODE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_REMOTE_LOOKUP_PROPERTY, gitg_window_properties[GITG_WINDOW_REMOTE_LOOKUP_PROPERTY] = g_param_spec_object ("remote-lookup", "remote-lookup", "remote-lookup", GITG_EXT_TYPE_REMOTE_LOOKUP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_WINDOW_NOTIFICATIONS_PROPERTY, gitg_window_properties[GITG_WINDOW_NOTIFICATIONS_PROPERTY] = g_param_spec_object ("notifications", "notifications", "notifications", GITG_EXT_TYPE_NOTIFICATIONS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/gitg/ui/gitg-window.ui");
	gitg_window_signals[GITG_WINDOW_CHANGE_TO_ACTIVITY_SIGNAL] = g_signal_new ("change-to-activity", GITG_TYPE_WINDOW, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GitgWindowClass, change_to_activity), NULL, NULL, g_cclosure_user_marshal_BOOLEAN__INT, G_TYPE_BOOLEAN, 1, G_TYPE_INT);
	gitg_window_signals[GITG_WINDOW_CANCEL_SIGNAL] = g_signal_new ("cancel", GITG_TYPE_WINDOW, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GitgWindowClass, cancel), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_header_bar", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_search_button", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_search_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_gear_menu", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_gear_menu));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "gear_image", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, gear_image));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_grid_main", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_grid_main));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_grid_top", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_grid_top));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_select_button", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_select_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_select_cancel_button", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_select_cancel_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_dash_button", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_dash_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_clone_button", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_clone_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_add_button", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_add_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "dash_image", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, dash_image));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_activities_switcher", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_activities_switcher));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_search_bar", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_search_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_search_entry", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_search_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_main_stack", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_main_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_dash_view", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_dash_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_stack_activities", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_stack_activities));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_infobar", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_infobar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_infobar_primary_label", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_infobar_primary_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_infobar_secondary_label", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_infobar_secondary_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_overlay", FALSE, GitgWindow_private_offset + G_STRUCT_OFFSET (GitgWindowPrivate, d_overlay));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "dash_button_clicked", G_CALLBACK(_gitg_window_dash_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "clone_repository_clicked", G_CALLBACK(_gitg_window_clone_repository_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "add_repository_clicked", G_CALLBACK(_gitg_window_add_repository_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "search_button_toggled", G_CALLBACK(_gitg_window_search_button_toggled_gtk_toggle_button_toggled));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "search_entry_changed", G_CALLBACK(_gitg_window_search_entry_changed_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_key_pressed", G_CALLBACK(_gitg_window_on_key_pressed_gtk_widget_key_press_event));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_select_cancel_button_clicked", G_CALLBACK(_gitg_window_on_select_cancel_button_clicked_gtk_button_clicked));
}

static void
gitg_window_gitg_ext_application_interface_init (GitgExtApplicationIface * iface,
                                                 gpointer iface_data)
{
	gitg_window_gitg_ext_application_parent_iface = g_type_interface_peek_parent (iface);
	iface->open_new = (GitgExtApplication* (*) (GitgExtApplication*, GgitRepository*, const gchar*)) gitg_window_real_open_new;
	iface->set_activity_by_id = (GitgExtActivity* (*) (GitgExtApplication*, const gchar*)) gitg_window_real_set_activity_by_id;
	iface->get_activity_by_id = (GitgExtActivity* (*) (GitgExtApplication*, const gchar*)) gitg_window_real_get_activity_by_id;
	iface->open_repository = (void (*) (GitgExtApplication*, GFile*)) gitg_window_real_open_repository;
	iface->show_infobar = (void (*) (GitgExtApplication*, const gchar*, const gchar*, GtkMessageType)) gitg_window_real_show_infobar;
	iface->user_query_async = (void (*) (GitgExtApplication*, GitgExtUserQuery*, GAsyncReadyCallback, gpointer)) gitg_window_real_user_query_async;
	iface->user_query_finish = (GtkResponseType (*) (GitgExtApplication*, GAsyncResult*)) gitg_window_user_query_finish;
	iface->user_query = (void (*) (GitgExtApplication*, GitgExtUserQuery*)) gitg_window_real_user_query;
	iface->get_verified_committer = (GgitSignature* (*) (GitgExtApplication*)) gitg_window_real_get_verified_committer;
	iface->get_current_activity = gitg_window_real_get_current_activity;
	iface->get_message_bus = gitg_window_real_get_message_bus;
	iface->get_repository = gitg_window_real_get_repository;
	iface->set_repository = gitg_window_real_set_repository;
	iface->get_environment = gitg_window_real_get_environment;
	iface->get_busy = gitg_window_real_get_busy;
	iface->set_busy = gitg_window_real_set_busy;
	iface->get_remote_lookup = gitg_window_real_get_remote_lookup;
	iface->get_notifications = gitg_window_real_get_notifications;
}

static void
gitg_window_g_initable_interface_init (GInitableIface * iface,
                                       gpointer iface_data)
{
	gitg_window_g_initable_parent_iface = g_type_interface_peek_parent (iface);
	iface->init = (gboolean (*) (GInitable*, GCancellable*, GError**)) gitg_window_real_init;
}

static void
gitg_window_instance_init (GitgWindow * self,
                           gpointer klass)
{
	self->priv = gitg_window_get_instance_private (self);
	g_type_ensure (GITG_TYPE_DASH_VIEW);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
gitg_window_finalize (GObject * obj)
{
	GitgWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_WINDOW, GitgWindow);
	_g_object_unref0 (self->priv->d_state_settings);
	_g_object_unref0 (self->priv->d_interface_settings);
	_g_object_unref0 (self->priv->d_repository);
	_g_object_unref0 (self->priv->d_repository_monitor);
	_g_object_unref0 (self->priv->d_message_bus);
	_g_free0 (self->priv->d_action);
	_g_object_unref0 (self->priv->d_environment);
	_g_object_unref0 (self->priv->d_dialog);
	_g_object_unref0 (self->priv->d_select_actions);
	_g_object_unref0 (self->priv->d_selectable_mode_binding);
	_g_object_unref0 (self->priv->d_selectable_available_binding);
	_g_object_unref0 (self->priv->d_searchable_available_binding);
	_g_object_unref0 (self->priv->d_activities);
	_g_object_unref0 (self->priv->d_remote_manager);
	_g_object_unref0 (self->priv->d_notifications);
	_g_object_unref0 (self->priv->d_preferences);
	_g_object_unref0 (self->priv->d_shortcuts);
	_g_object_unref0 (self->priv->d_activities_model);
	_g_object_unref0 (self->priv->d_dash_model);
	G_OBJECT_CLASS (gitg_window_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgWindow), 0, (GInstanceInitFunc) gitg_window_instance_init, NULL };
	static const GInterfaceInfo gitg_ext_application_info = { (GInterfaceInitFunc) gitg_window_gitg_ext_application_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo g_initable_info = { (GInterfaceInitFunc) gitg_window_g_initable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gitg_window_type_id;
	gitg_window_type_id = g_type_register_static (gtk_application_window_get_type (), "GitgWindow", &g_define_type_info, 0);
	g_type_add_interface_static (gitg_window_type_id, GITG_EXT_TYPE_APPLICATION, &gitg_ext_application_info);
	g_type_add_interface_static (gitg_window_type_id, g_initable_get_type (), &g_initable_info);
	GitgWindow_private_offset = g_type_add_instance_private (gitg_window_type_id, sizeof (GitgWindowPrivate));
	return gitg_window_type_id;
}

GType
gitg_window_get_type (void)
{
	static gsize gitg_window_type_id__once = 0;
	if (g_once_init_enter (&gitg_window_type_id__once)) {
		GType gitg_window_type_id;
		gitg_window_type_id = gitg_window_get_type_once ();
		g_once_init_leave (&gitg_window_type_id__once, gitg_window_type_id);
	}
	return gitg_window_type_id__once;
}

static void
_vala_gitg_window_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	GitgWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_WINDOW, GitgWindow);
	switch (property_id) {
		case GITG_WINDOW_CURRENT_ACTIVITY_PROPERTY:
		g_value_take_object (value, gitg_ext_application_get_current_activity ((GitgExtApplication*) self));
		break;
		case GITG_WINDOW_MESSAGE_BUS_PROPERTY:
		g_value_take_object (value, gitg_ext_application_get_message_bus ((GitgExtApplication*) self));
		break;
		case GITG_WINDOW_REPOSITORY_PROPERTY:
		g_value_take_object (value, gitg_ext_application_get_repository ((GitgExtApplication*) self));
		break;
		case GITG_WINDOW_ENABLE_MONITORING_PROPERTY:
		g_value_set_boolean (value, gitg_window_get_enable_monitoring (self));
		break;
		case GITG_WINDOW_ENVIRONMENT_PROPERTY:
		g_value_take_object (value, gitg_ext_application_get_environment ((GitgExtApplication*) self));
		break;
		case GITG_WINDOW_BUSY_PROPERTY:
		g_value_set_boolean (value, gitg_ext_application_get_busy ((GitgExtApplication*) self));
		break;
		case GITG_WINDOW_SELECTABLE_MODE_PROPERTY:
		g_value_set_enum (value, gitg_window_get_selectable_mode (self));
		break;
		case GITG_WINDOW_REMOTE_LOOKUP_PROPERTY:
		g_value_take_object (value, gitg_ext_application_get_remote_lookup ((GitgExtApplication*) self));
		break;
		case GITG_WINDOW_NOTIFICATIONS_PROPERTY:
		g_value_take_object (value, gitg_ext_application_get_notifications ((GitgExtApplication*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_window_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	GitgWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_WINDOW, GitgWindow);
	switch (property_id) {
		case GITG_WINDOW_REPOSITORY_PROPERTY:
		gitg_ext_application_set_repository ((GitgExtApplication*) self, g_value_get_object (value));
		break;
		case GITG_WINDOW_ENABLE_MONITORING_PROPERTY:
		gitg_window_set_enable_monitoring (self, g_value_get_boolean (value));
		break;
		case GITG_WINDOW_BUSY_PROPERTY:
		gitg_ext_application_set_busy ((GitgExtApplication*) self, g_value_get_boolean (value));
		break;
		case GITG_WINDOW_SELECTABLE_MODE_PROPERTY:
		gitg_window_set_selectable_mode (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

