/* gitg-history.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-history.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 <glib-object.h>
#include "libgitg-ext.h"
#include "libgitg.h"
#include <gee.h>
#include <libgit2-glib/ggit.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <stdio.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <libpeas/peas.h>
#include <glib/gi18n-lib.h>

#define GITG_HISTORY_ACTIVITY_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

typedef enum  {
	GITG_HISTORY_DEFAULT_SELECTION_CURRENT_BRANCH,
	GITG_HISTORY_DEFAULT_SELECTION_ALL_BRANCHES,
	GITG_HISTORY_DEFAULT_SELECTION_ALL_COMMITS
} GitgHistoryDefaultSelection;

#define GITG_HISTORY_TYPE_DEFAULT_SELECTION (gitg_history_default_selection_get_type ())

#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;
typedef struct _GitgHistoryActivityPrivate GitgHistoryActivityPrivate;

#define GITG_TYPE_ANIMATED_PANED (gitg_animated_paned_get_type ())
#define GITG_ANIMATED_PANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_ANIMATED_PANED, GitgAnimatedPaned))
#define GITG_ANIMATED_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_ANIMATED_PANED, GitgAnimatedPanedClass))
#define GITG_IS_ANIMATED_PANED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_ANIMATED_PANED))
#define GITG_IS_ANIMATED_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_ANIMATED_PANED))
#define GITG_ANIMATED_PANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_ANIMATED_PANED, GitgAnimatedPanedClass))

typedef struct _GitgAnimatedPaned GitgAnimatedPaned;
typedef struct _GitgAnimatedPanedClass GitgAnimatedPanedClass;

#define GITG_HISTORY_TYPE_PANED (gitg_history_paned_get_type ())
#define GITG_HISTORY_PANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_HISTORY_TYPE_PANED, GitgHistoryPaned))
#define GITG_HISTORY_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_HISTORY_TYPE_PANED, GitgHistoryPanedClass))
#define GITG_HISTORY_IS_PANED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_HISTORY_TYPE_PANED))
#define GITG_HISTORY_IS_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_HISTORY_TYPE_PANED))
#define GITG_HISTORY_PANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_HISTORY_TYPE_PANED, GitgHistoryPanedClass))

typedef struct _GitgHistoryPaned GitgHistoryPaned;
typedef struct _GitgHistoryPanedClass GitgHistoryPanedClass;

#define GITG_TYPE_POPUP_MENU (gitg_popup_menu_get_type ())
#define GITG_POPUP_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_POPUP_MENU, GitgPopupMenu))
#define GITG_POPUP_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_POPUP_MENU, GitgPopupMenuClass))
#define GITG_IS_POPUP_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_POPUP_MENU))
#define GITG_IS_POPUP_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_POPUP_MENU))
#define GITG_POPUP_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_POPUP_MENU, GitgPopupMenuClass))

typedef struct _GitgPopupMenu GitgPopupMenu;
typedef struct _GitgPopupMenuClass GitgPopupMenuClass;

#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;
enum  {
	GITG_HISTORY_ACTIVITY_0_PROPERTY,
	GITG_HISTORY_ACTIVITY_APPLICATION_PROPERTY,
	GITG_HISTORY_ACTIVITY_D_PANELS_PROPERTY,
	GITG_HISTORY_ACTIVITY_ID_PROPERTY,
	GITG_HISTORY_ACTIVITY_REPOSITORY_PROPERTY,
	GITG_HISTORY_ACTIVITY_AVAILABLE_PROPERTY,
	GITG_HISTORY_ACTIVITY_DISPLAY_NAME_PROPERTY,
	GITG_HISTORY_ACTIVITY_DESCRIPTION_PROPERTY,
	GITG_HISTORY_ACTIVITY_ICON_PROPERTY,
	GITG_HISTORY_ACTIVITY_WIDGET_PROPERTY,
	GITG_HISTORY_ACTIVITY_ENABLED_PROPERTY,
	GITG_HISTORY_ACTIVITY_REFS_LIST_PROPERTY,
	GITG_HISTORY_ACTIVITY_SEARCH_AVAILABLE_PROPERTY,
	GITG_HISTORY_ACTIVITY_SEARCH_ENTRY_PROPERTY,
	GITG_HISTORY_ACTIVITY_SEARCH_TEXT_PROPERTY,
	GITG_HISTORY_ACTIVITY_SEARCH_VISIBLE_PROPERTY,
	GITG_HISTORY_ACTIVITY_NUM_PROPERTIES
};
static GParamSpec* gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_GgitOId_free0(var) ((var == NULL) ? NULL : (var = (_vala_GgitOId_free (var), NULL)))
#define _gitg_when_mapped_unref0(var) ((var == NULL) ? NULL : (var = (gitg_when_mapped_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block46Data Block46Data;
#define __vala_GtkTreePath_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL)))

#define GITG_HISTORY_TYPE_REFS_LIST (gitg_history_refs_list_get_type ())
#define GITG_HISTORY_REFS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_HISTORY_TYPE_REFS_LIST, GitgHistoryRefsList))
#define GITG_HISTORY_REFS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_HISTORY_TYPE_REFS_LIST, GitgHistoryRefsListClass))
#define GITG_HISTORY_IS_REFS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_HISTORY_TYPE_REFS_LIST))
#define GITG_HISTORY_IS_REFS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_HISTORY_TYPE_REFS_LIST))
#define GITG_HISTORY_REFS_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_HISTORY_TYPE_REFS_LIST, GitgHistoryRefsListClass))

typedef struct _GitgHistoryRefsList GitgHistoryRefsList;
typedef struct _GitgHistoryRefsListClass GitgHistoryRefsListClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block47Data Block47Data;
typedef struct _Block48Data Block48Data;

#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_TYPE_ADD_REMOTE_ACTION (gitg_add_remote_action_get_type ())
#define GITG_ADD_REMOTE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_ADD_REMOTE_ACTION, GitgAddRemoteAction))
#define GITG_ADD_REMOTE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_ADD_REMOTE_ACTION, GitgAddRemoteActionClass))
#define GITG_IS_ADD_REMOTE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_ADD_REMOTE_ACTION))
#define GITG_IS_ADD_REMOTE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_ADD_REMOTE_ACTION))
#define GITG_ADD_REMOTE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_ADD_REMOTE_ACTION, GitgAddRemoteActionClass))

typedef struct _GitgAddRemoteAction GitgAddRemoteAction;
typedef struct _GitgAddRemoteActionClass GitgAddRemoteActionClass;
typedef struct _Block49Data Block49Data;

#define GITG_HISTORY_TYPE_ACTION_INTERFACE (gitg_history_action_interface_get_type ())
#define GITG_HISTORY_ACTION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_HISTORY_TYPE_ACTION_INTERFACE, GitgHistoryActionInterface))
#define GITG_HISTORY_ACTION_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_HISTORY_TYPE_ACTION_INTERFACE, GitgHistoryActionInterfaceClass))
#define GITG_HISTORY_IS_ACTION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_HISTORY_TYPE_ACTION_INTERFACE))
#define GITG_HISTORY_IS_ACTION_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_HISTORY_TYPE_ACTION_INTERFACE))
#define GITG_HISTORY_ACTION_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_HISTORY_TYPE_ACTION_INTERFACE, GitgHistoryActionInterfaceClass))

typedef struct _GitgHistoryActionInterface GitgHistoryActionInterface;
typedef struct _GitgHistoryActionInterfaceClass GitgHistoryActionInterfaceClass;

#define GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH (gitg_commit_action_create_branch_get_type ())
#define GITG_COMMIT_ACTION_CREATE_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranch))
#define GITG_COMMIT_ACTION_CREATE_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranchClass))
#define GITG_IS_COMMIT_ACTION_CREATE_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH))
#define GITG_IS_COMMIT_ACTION_CREATE_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH))
#define GITG_COMMIT_ACTION_CREATE_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_BRANCH, GitgCommitActionCreateBranchClass))

typedef struct _GitgCommitActionCreateBranch GitgCommitActionCreateBranch;
typedef struct _GitgCommitActionCreateBranchClass GitgCommitActionCreateBranchClass;

#define GITG_TYPE_COMMIT_ACTION_CREATE_TAG (gitg_commit_action_create_tag_get_type ())
#define GITG_COMMIT_ACTION_CREATE_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_TAG, GitgCommitActionCreateTag))
#define GITG_COMMIT_ACTION_CREATE_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_TAG, GitgCommitActionCreateTagClass))
#define GITG_IS_COMMIT_ACTION_CREATE_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_TAG))
#define GITG_IS_COMMIT_ACTION_CREATE_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_TAG))
#define GITG_COMMIT_ACTION_CREATE_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_TAG, GitgCommitActionCreateTagClass))

typedef struct _GitgCommitActionCreateTag GitgCommitActionCreateTag;
typedef struct _GitgCommitActionCreateTagClass GitgCommitActionCreateTagClass;

#define GITG_TYPE_COMMIT_ACTION_CREATE_PATCH (gitg_commit_action_create_patch_get_type ())
#define GITG_COMMIT_ACTION_CREATE_PATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatch))
#define GITG_COMMIT_ACTION_CREATE_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatchClass))
#define GITG_IS_COMMIT_ACTION_CREATE_PATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH))
#define GITG_IS_COMMIT_ACTION_CREATE_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH))
#define GITG_COMMIT_ACTION_CREATE_PATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT_ACTION_CREATE_PATCH, GitgCommitActionCreatePatchClass))

typedef struct _GitgCommitActionCreatePatch GitgCommitActionCreatePatch;
typedef struct _GitgCommitActionCreatePatchClass GitgCommitActionCreatePatchClass;

#define GITG_TYPE_COMMIT_ACTION_CHERRY_PICK (gitg_commit_action_cherry_pick_get_type ())
#define GITG_COMMIT_ACTION_CHERRY_PICK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_COMMIT_ACTION_CHERRY_PICK, GitgCommitActionCherryPick))
#define GITG_COMMIT_ACTION_CHERRY_PICK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_COMMIT_ACTION_CHERRY_PICK, GitgCommitActionCherryPickClass))
#define GITG_IS_COMMIT_ACTION_CHERRY_PICK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_COMMIT_ACTION_CHERRY_PICK))
#define GITG_IS_COMMIT_ACTION_CHERRY_PICK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_COMMIT_ACTION_CHERRY_PICK))
#define GITG_COMMIT_ACTION_CHERRY_PICK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_COMMIT_ACTION_CHERRY_PICK, GitgCommitActionCherryPickClass))

typedef struct _GitgCommitActionCherryPick GitgCommitActionCherryPick;
typedef struct _GitgCommitActionCherryPickClass GitgCommitActionCherryPickClass;
typedef struct _Block50Data Block50Data;

#define GITG_TYPE_REF_ACTION_CREATE_BRANCH (gitg_ref_action_create_branch_get_type ())
#define GITG_REF_ACTION_CREATE_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_CREATE_BRANCH, GitgRefActionCreateBranch))
#define GITG_REF_ACTION_CREATE_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_CREATE_BRANCH, GitgRefActionCreateBranchClass))
#define GITG_IS_REF_ACTION_CREATE_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_CREATE_BRANCH))
#define GITG_IS_REF_ACTION_CREATE_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_CREATE_BRANCH))
#define GITG_REF_ACTION_CREATE_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_CREATE_BRANCH, GitgRefActionCreateBranchClass))

typedef struct _GitgRefActionCreateBranch GitgRefActionCreateBranch;
typedef struct _GitgRefActionCreateBranchClass GitgRefActionCreateBranchClass;

#define GITG_TYPE_REF_ACTION_CREATE_TAG (gitg_ref_action_create_tag_get_type ())
#define GITG_REF_ACTION_CREATE_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_CREATE_TAG, GitgRefActionCreateTag))
#define GITG_REF_ACTION_CREATE_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_CREATE_TAG, GitgRefActionCreateTagClass))
#define GITG_IS_REF_ACTION_CREATE_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_CREATE_TAG))
#define GITG_IS_REF_ACTION_CREATE_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_CREATE_TAG))
#define GITG_REF_ACTION_CREATE_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_CREATE_TAG, GitgRefActionCreateTagClass))

typedef struct _GitgRefActionCreateTag GitgRefActionCreateTag;
typedef struct _GitgRefActionCreateTagClass GitgRefActionCreateTagClass;

#define GITG_TYPE_REF_ACTION_CREATE_PATCH (gitg_ref_action_create_patch_get_type ())
#define GITG_REF_ACTION_CREATE_PATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_CREATE_PATCH, GitgRefActionCreatePatch))
#define GITG_REF_ACTION_CREATE_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_CREATE_PATCH, GitgRefActionCreatePatchClass))
#define GITG_IS_REF_ACTION_CREATE_PATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_CREATE_PATCH))
#define GITG_IS_REF_ACTION_CREATE_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_CREATE_PATCH))
#define GITG_REF_ACTION_CREATE_PATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_CREATE_PATCH, GitgRefActionCreatePatchClass))

typedef struct _GitgRefActionCreatePatch GitgRefActionCreatePatch;
typedef struct _GitgRefActionCreatePatchClass GitgRefActionCreatePatchClass;

#define GITG_TYPE_REF_ACTION_CHECKOUT (gitg_ref_action_checkout_get_type ())
#define GITG_REF_ACTION_CHECKOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_CHECKOUT, GitgRefActionCheckout))
#define GITG_REF_ACTION_CHECKOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_CHECKOUT, GitgRefActionCheckoutClass))
#define GITG_IS_REF_ACTION_CHECKOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_CHECKOUT))
#define GITG_IS_REF_ACTION_CHECKOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_CHECKOUT))
#define GITG_REF_ACTION_CHECKOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_CHECKOUT, GitgRefActionCheckoutClass))

typedef struct _GitgRefActionCheckout GitgRefActionCheckout;
typedef struct _GitgRefActionCheckoutClass GitgRefActionCheckoutClass;

#define GITG_TYPE_REF_ACTION_RENAME (gitg_ref_action_rename_get_type ())
#define GITG_REF_ACTION_RENAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_RENAME, GitgRefActionRename))
#define GITG_REF_ACTION_RENAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_RENAME, GitgRefActionRenameClass))
#define GITG_IS_REF_ACTION_RENAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_RENAME))
#define GITG_IS_REF_ACTION_RENAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_RENAME))
#define GITG_REF_ACTION_RENAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_RENAME, GitgRefActionRenameClass))

typedef struct _GitgRefActionRename GitgRefActionRename;
typedef struct _GitgRefActionRenameClass GitgRefActionRenameClass;

#define GITG_TYPE_REF_ACTION_DELETE (gitg_ref_action_delete_get_type ())
#define GITG_REF_ACTION_DELETE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_DELETE, GitgRefActionDelete))
#define GITG_REF_ACTION_DELETE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_DELETE, GitgRefActionDeleteClass))
#define GITG_IS_REF_ACTION_DELETE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_DELETE))
#define GITG_IS_REF_ACTION_DELETE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_DELETE))
#define GITG_REF_ACTION_DELETE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_DELETE, GitgRefActionDeleteClass))

typedef struct _GitgRefActionDelete GitgRefActionDelete;
typedef struct _GitgRefActionDeleteClass GitgRefActionDeleteClass;

#define GITG_TYPE_REF_ACTION_COPY_NAME (gitg_ref_action_copy_name_get_type ())
#define GITG_REF_ACTION_COPY_NAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_COPY_NAME, GitgRefActionCopyName))
#define GITG_REF_ACTION_COPY_NAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_COPY_NAME, GitgRefActionCopyNameClass))
#define GITG_IS_REF_ACTION_COPY_NAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_COPY_NAME))
#define GITG_IS_REF_ACTION_COPY_NAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_COPY_NAME))
#define GITG_REF_ACTION_COPY_NAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_COPY_NAME, GitgRefActionCopyNameClass))

typedef struct _GitgRefActionCopyName GitgRefActionCopyName;
typedef struct _GitgRefActionCopyNameClass GitgRefActionCopyNameClass;

#define GITG_TYPE_REF_ACTION_FETCH (gitg_ref_action_fetch_get_type ())
#define GITG_REF_ACTION_FETCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_FETCH, GitgRefActionFetch))
#define GITG_REF_ACTION_FETCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_FETCH, GitgRefActionFetchClass))
#define GITG_IS_REF_ACTION_FETCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_FETCH))
#define GITG_IS_REF_ACTION_FETCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_FETCH))
#define GITG_REF_ACTION_FETCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_FETCH, GitgRefActionFetchClass))

typedef struct _GitgRefActionFetch GitgRefActionFetch;
typedef struct _GitgRefActionFetchClass GitgRefActionFetchClass;

#define GITG_TYPE_REF_ACTION_PUSH (gitg_ref_action_push_get_type ())
#define GITG_REF_ACTION_PUSH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_PUSH, GitgRefActionPush))
#define GITG_REF_ACTION_PUSH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_PUSH, GitgRefActionPushClass))
#define GITG_IS_REF_ACTION_PUSH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_PUSH))
#define GITG_IS_REF_ACTION_PUSH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_PUSH))
#define GITG_REF_ACTION_PUSH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_PUSH, GitgRefActionPushClass))

typedef struct _GitgRefActionPush GitgRefActionPush;
typedef struct _GitgRefActionPushClass GitgRefActionPushClass;

#define GITG_TYPE_REF_ACTION_MERGE (gitg_ref_action_merge_get_type ())
#define GITG_REF_ACTION_MERGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_REF_ACTION_MERGE, GitgRefActionMerge))
#define GITG_REF_ACTION_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_REF_ACTION_MERGE, GitgRefActionMergeClass))
#define GITG_IS_REF_ACTION_MERGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_REF_ACTION_MERGE))
#define GITG_IS_REF_ACTION_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_REF_ACTION_MERGE))
#define GITG_REF_ACTION_MERGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_REF_ACTION_MERGE, GitgRefActionMergeClass))

typedef struct _GitgRefActionMerge GitgRefActionMerge;
typedef struct _GitgRefActionMergeClass GitgRefActionMergeClass;

#define GITG_HISTORY_TYPE_REF_HEADER (gitg_history_ref_header_get_type ())
#define GITG_HISTORY_REF_HEADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_HISTORY_TYPE_REF_HEADER, GitgHistoryRefHeader))
#define GITG_HISTORY_REF_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_HISTORY_TYPE_REF_HEADER, GitgHistoryRefHeaderClass))
#define GITG_HISTORY_IS_REF_HEADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_HISTORY_TYPE_REF_HEADER))
#define GITG_HISTORY_IS_REF_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_HISTORY_TYPE_REF_HEADER))
#define GITG_HISTORY_REF_HEADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_HISTORY_TYPE_REF_HEADER, GitgHistoryRefHeaderClass))

typedef struct _GitgHistoryRefHeader GitgHistoryRefHeader;
typedef struct _GitgHistoryRefHeaderClass GitgHistoryRefHeaderClass;

#define GITG_HISTORY_TYPE_REF_ROW (gitg_history_ref_row_get_type ())
#define GITG_HISTORY_REF_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_HISTORY_TYPE_REF_ROW, GitgHistoryRefRow))
#define GITG_HISTORY_REF_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_HISTORY_TYPE_REF_ROW, GitgHistoryRefRowClass))
#define GITG_HISTORY_IS_REF_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_HISTORY_TYPE_REF_ROW))
#define GITG_HISTORY_IS_REF_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_HISTORY_TYPE_REF_ROW))
#define GITG_HISTORY_REF_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_HISTORY_TYPE_REF_ROW, GitgHistoryRefRowClass))

typedef struct _GitgHistoryRefRow GitgHistoryRefRow;
typedef struct _GitgHistoryRefRowClass GitgHistoryRefRowClass;

struct _GitgHistoryActivity {
	GObject parent_instance;
	GitgHistoryActivityPrivate * priv;
};

struct _GitgHistoryActivityClass {
	GObjectClass parent_class;
};

struct _GitgHistoryActivityPrivate {
	GitgExtApplication* _application;
	GitgCommitModel* d_commit_list_model;
	GeeHashSet* d_selected;
	GgitOId* d_scroll_to;
	gfloat d_scroll_y;
	gulong d_insertsig;
	GSettings* d_settings;
	guint d_walker_update_idle_id;
	gulong d_refs_list_selection_id;
	gulong d_refs_list_changed_id;
	gulong d_externally_changed_id;
	gulong d_commits_changed_id;
	GitgWhenMapped* d_reload_when_mapped;
	GitgHistoryPaned* d_main;
	GitgPopupMenu* d_refs_list_popup;
	GitgPopupMenu* d_commit_list_popup;
	gchar** d_mainline;
	gint d_mainline_length1;
	gint _d_mainline_size_;
	gboolean d_ignore_external;
	GitgUIElements* _d_panels;
	GitgRepository* d_repository;
	gchar* _search_text;
	gboolean _search_visible;
};

struct _Block46Data {
	int _ref_count_;
	GitgHistoryActivity* self;
	gboolean breakit;
	GitgExtForeachCommitSelectionFunc func;
	gpointer func_target;
};

struct _Block47Data {
	int _ref_count_;
	GitgHistoryActivity* self;
	GitgCommitListView* view;
	gdouble vadj;
	GtkTreePath* startp;
	GtkTreePath* endp;
	gboolean isvis;
	gulong sid;
};

struct _Block48Data {
	int _ref_count_;
	GitgHistoryActivity* self;
	GtkClipboard* clip;
};

struct _Block49Data {
	int _ref_count_;
	GitgHistoryActivity* self;
	GeeLinkedList* actions;
};

struct _Block50Data {
	int _ref_count_;
	GitgHistoryActivity* self;
	GeeLinkedList* actions;
	gboolean addedsep;
	GtkCheckMenuItem* item;
	gint pos;
	GitgRef* reference;
};

static gint GitgHistoryActivity_private_offset;
static gpointer gitg_history_activity_parent_class = NULL;
static GitgExtUIElementIface * gitg_history_activity_gitg_ext_ui_element_parent_iface = NULL;
static GitgExtActivityIface * gitg_history_activity_gitg_ext_activity_parent_iface = NULL;
static GitgExtSearchableIface * gitg_history_activity_gitg_ext_searchable_parent_iface = NULL;
static GitgExtHistoryIface * gitg_history_activity_gitg_ext_history_parent_iface = NULL;

VALA_EXTERN GType gitg_history_default_selection_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType gitg_history_activity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryActivity, g_object_unref)
VALA_EXTERN GType gitg_animated_paned_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgAnimatedPaned, g_object_unref)
VALA_EXTERN GType gitg_history_paned_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryPaned, g_object_unref)
VALA_EXTERN GType gitg_popup_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgPopupMenu, g_object_unref)
VALA_EXTERN GType gitg_ui_elements_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgUIElements, g_object_unref)
static void _vala_GgitOId_free (GgitOId* self);
VALA_EXTERN GitgHistoryActivity* gitg_history_activity_new (GitgExtApplication* application);
VALA_EXTERN GitgHistoryActivity* gitg_history_activity_construct (GType object_type,
                                                      GitgExtApplication* application);
static void gitg_history_activity_real_foreach_selected (GitgExtHistory* base,
                                                  GitgExtForeachCommitSelectionFunc func,
                                                  gpointer func_target);
static Block46Data* block46_data_ref (Block46Data* _data46_);
static void block46_data_unref (void * _userdata_);
VALA_EXTERN GitgCommitListView* gitg_history_paned_get_commit_list_view (GitgHistoryPaned* self);
static void __lambda109_ (Block46Data* _data46_,
                   GtkTreeModel* model,
                   GtkTreePath* path,
                   GtkTreeIter* iter);
static void ___lambda109__gtk_tree_selection_foreach_func (GtkTreeModel* model,
                                                    GtkTreePath* path,
                                                    GtkTreeIter* iter,
                                                    gpointer self);
static void gitg_history_activity_real_select (GitgExtHistory* base,
                                        GitgCommit* commit);
static void _vala_GtkTreePath_free (GtkTreePath* self);
static void gitg_history_activity_repository_changed_externally (GitgHistoryActivity* self,
                                                          GitgExtExternalChangeHint hint);
static void gitg_history_activity_reload_when_mapped (GitgHistoryActivity* self);
static void gitg_history_activity_repository_commits_changed (GitgHistoryActivity* self);
static void ___lambda110_ (GitgHistoryActivity* self);
static void gitg_history_activity_reload (GitgHistoryActivity* self);
static void ____lambda110__gitg_when_mapped_on_mapped (gpointer self);
static void gitg_history_activity_real_dispose (GObject* base);
VALA_EXTERN GType gitg_history_refs_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryRefsList, g_object_unref)
VALA_EXTERN GitgHistoryRefsList* gitg_history_paned_get_refs_list (GitgHistoryPaned* self);
static void gitg_history_activity_update_sort_mode (GitgHistoryActivity* self);
static void gitg_history_activity_on_commit_model_started (GitgHistoryActivity* self,
                                                    GitgCommitModel* model);
static void gitg_history_activity_on_row_inserted_select (GitgHistoryActivity* self,
                                                   GtkTreeModel* model,
                                                   GtkTreePath* path,
                                                   GtkTreeIter* iter);
static void _gitg_history_activity_on_row_inserted_select_gtk_tree_model_row_inserted (GtkTreeModel* _sender,
                                                                                GtkTreePath* path,
                                                                                GtkTreeIter* iter,
                                                                                gpointer self);
static void gitg_history_activity_scroll_into_view (GitgHistoryActivity* self);
static void __vala_GtkTreePath_free0_ (gpointer var);
static inline void _g_list_free___vala_GtkTreePath_free0_ (GList* self);
static GtkTreePath* _vala_GtkTreePath_copy (GtkTreePath* self);
static void gitg_history_activity_on_commit_model_finished (GitgHistoryActivity* self,
                                                     GitgCommitModel* model);
static void gitg_history_activity_on_commit_model_begin_clear (GitgHistoryActivity* self,
                                                        GitgCommitModel* model);
static void gitg_history_activity_on_commit_model_end_clear (GitgHistoryActivity* self,
                                                      GitgCommitModel* model);
static gboolean gitg_history_activity_real_is_default_for (GitgExtActivity* base,
                                                    const gchar* action);
static gint gitg_history_activity_real_negotiate_order (GitgExtUIElement* base,
                                                 GitgExtUIElement* other);
static void gitg_history_activity_store_changed_mainline (GitgHistoryActivity* self);
static void gitg_history_activity_store_mainline (GitgHistoryActivity* self,
                                           GgitConfig* config,
                                           const gchar* mainline);
static void gitg_history_activity_reload_mainline (GitgHistoryActivity* self);
static GgitOId* gitg_history_activity_id_for_ref (GitgHistoryActivity* self,
                                           GgitRef* r);
static void _vala_array_add15 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static Block47Data* block47_data_ref (Block47Data* _data47_);
static void block47_data_unref (void * _userdata_);
static void __lambda111_ (Block47Data* _data47_,
                   GtkTreeModel* model,
                   GtkTreePath* path,
                   GtkTreeIter* iter);
static void ___lambda111__gtk_tree_selection_foreach_func (GtkTreeModel* model,
                                                    GtkTreePath* path,
                                                    GtkTreeIter* iter,
                                                    gpointer self);
VALA_EXTERN GitgRepository* gitg_history_activity_get_repository (GitgHistoryActivity* self);
VALA_EXTERN void gitg_history_refs_list_set_repository (GitgHistoryRefsList* self,
                                            GitgRepository* value);
static void __lambda112_ (Block47Data* _data47_,
                   GtkAllocation* a);
static void ___lambda112__gtk_widget_size_allocate (GtkWidget* _sender,
                                             GtkAllocation* allocation,
                                             gpointer self);
static gboolean gitg_history_activity_real_on_key_pressed (GitgExtActivity* base,
                                                    GdkEventKey* event);
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);
static gboolean _uint_equal (const guint * s1,
                      const guint * s2);
static void gitg_history_activity_build_ui (GitgHistoryActivity* self);
VALA_EXTERN GitgHistoryPaned* gitg_history_paned_new (void);
VALA_EXTERN GitgHistoryPaned* gitg_history_paned_construct (GType object_type);
VALA_EXTERN void gitg_history_refs_list_set_application (GitgHistoryRefsList* self,
                                             GitgExtApplication* value);
static void __lambda113_ (GitgHistoryActivity* self,
                   GtkTreeSelection* sel);
static Block48Data* block48_data_ref (Block48Data* _data48_);
static void block48_data_unref (void * _userdata_);
static gboolean __lambda114_ (Block48Data* _data48_,
                       GgitCommit* commit);
static gboolean ___lambda114__gitg_ext_foreach_commit_selection_func (GgitCommit* object,
                                                               gpointer self);
static void ___lambda113__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                               gpointer self);
static void gitg_history_activity_on_ref_list_row_activated (GitgHistoryActivity* self,
                                                      GtkListBoxRow* row);
static void _gitg_history_activity_on_ref_list_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                  GtkListBoxRow* row,
                                                                                  gpointer 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 GtkStack* gitg_history_paned_get_stack_panel (GitgHistoryPaned* self);
VALA_EXTERN GitgUIElements* gitg_ui_elements_new (GType t_type,
                                      GBoxedCopyFunc t_dup_func,
                                      GDestroyNotify t_destroy_func,
                                      PeasExtensionSet* extensions,
                                      GtkStack* stack);
VALA_EXTERN GitgUIElements* gitg_ui_elements_construct (GType object_type,
                                            GType t_type,
                                            GBoxedCopyFunc t_dup_func,
                                            GDestroyNotify t_destroy_func,
                                            PeasExtensionSet* extensions,
                                            GtkStack* stack);
VALA_EXTERN GitgPopupMenu* gitg_popup_menu_new (GtkWidget* widget);
VALA_EXTERN GitgPopupMenu* gitg_popup_menu_construct (GType object_type,
                                          GtkWidget* widget);
static GtkMenu* gitg_history_activity_on_refs_list_populate_menu (GitgHistoryActivity* self,
                                                           GdkEventButton* event);
static GtkMenu* _gitg_history_activity_on_refs_list_populate_menu_gitg_popup_menu_populate_menu (GitgPopupMenu* _sender,
                                                                                          GdkEventButton* event,
                                                                                          gpointer self);
static void gitg_history_activity_update_walker_idle (GitgHistoryActivity* self);
static void _gitg_history_activity_update_walker_idle_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void _gitg_history_activity_update_walker_idle_gitg_history_refs_list_changed (GitgHistoryRefsList* _sender,
                                                                               gpointer self);
static GtkMenu* gitg_history_activity_on_commit_list_populate_menu (GitgHistoryActivity* self,
                                                             GdkEventButton* event);
static GtkMenu* _gitg_history_activity_on_commit_list_populate_menu_gitg_popup_menu_populate_menu (GitgPopupMenu* _sender,
                                                                                            GdkEventButton* event,
                                                                                            gpointer self);
static GdkRectangle* gitg_history_activity_on_commit_list_request_menu_position (GitgHistoryActivity* self);
static GdkRectangle* _gitg_history_activity_on_commit_list_request_menu_position_gitg_popup_menu_request_menu_position (GitgPopupMenu* _sender,
                                                                                                                 gpointer self);
static gboolean gitg_history_activity_search_filter_func (GitgHistoryActivity* self,
                                                   GtkTreeModel* model,
                                                   gint column,
                                                   const gchar* key,
                                                   GtkTreeIter* iter);
static gboolean _gitg_history_activity_search_filter_func_gtk_tree_view_search_equal_func (GtkTreeModel* model,
                                                                                    gint column,
                                                                                    const gchar* key,
                                                                                    GtkTreeIter* iter,
                                                                                    gpointer self);
static void _gitg_history_activity_on_commit_model_begin_clear_gitg_commit_model_begin_clear (GitgCommitModel* _sender,
                                                                                       gpointer self);
static void _gitg_history_activity_on_commit_model_end_clear_gitg_commit_model_end_clear (GitgCommitModel* _sender,
                                                                                   gpointer self);
VALA_EXTERN GitgAddRemoteAction* gitg_add_remote_action_new (GitgExtApplication* application);
VALA_EXTERN GitgAddRemoteAction* gitg_add_remote_action_construct (GType object_type,
                                                       GitgExtApplication* application);
VALA_EXTERN GType gitg_add_remote_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgAddRemoteAction, g_object_unref)
VALA_EXTERN void gitg_history_refs_list_set_remotes_actions (GitgHistoryRefsList* self,
                                                 GeeLinkedList* value);
static gboolean ___lambda127_ (GitgHistoryActivity* self);
static void gitg_history_activity_update_walker (GitgHistoryActivity* self);
static gboolean ____lambda127__gsource_func (gpointer self);
static GtkMenu* gitg_history_activity_popup_on_ref (GitgHistoryActivity* self,
                                             GdkEventButton* event);
static GtkMenu* gitg_history_activity_popup_menu_for_ref (GitgHistoryActivity* self,
                                                   GitgRef* reference);
static GtkMenu* gitg_history_activity_popup_menu_for_commit (GitgHistoryActivity* self,
                                                      GdkEventButton* event);
static GtkMenu* gitg_history_activity_popup_menu_for_selection (GitgHistoryActivity* self);
static GdkRectangle* _vala_GdkRectangle_copy (GdkRectangle* self);
static void gitg_history_activity_add_ref_action (GitgHistoryActivity* self,
                                           GeeLinkedList* actions,
                                           GitgExtRefAction* action);
static GtkMenu* gitg_history_activity_populate_menu_for_commit (GitgHistoryActivity* self,
                                                         GitgCommit* commit);
static Block49Data* block49_data_ref (Block49Data* _data49_);
static void block49_data_unref (void * _userdata_);
VALA_EXTERN GType gitg_history_action_interface_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryActionInterface, g_object_unref)
VALA_EXTERN GitgHistoryActionInterface* gitg_history_action_interface_new (GitgExtApplication* application,
                                                               GitgHistoryRefsList* refs_list);
VALA_EXTERN GitgHistoryActionInterface* gitg_history_action_interface_construct (GType object_type,
                                                                     GitgExtApplication* application,
                                                                     GitgHistoryRefsList* refs_list);
static void __lambda128_ (GitgHistoryActivity* self);
static void ___lambda128__gitg_history_action_interface_updated (GitgHistoryActionInterface* _sender,
                                                          gpointer self);
static void gitg_history_activity_add_commit_action (GitgHistoryActivity* self,
                                              GeeLinkedList* actions,
                                              GitgExtCommitAction* action);
VALA_EXTERN GitgCommitActionCreateBranch* gitg_commit_action_create_branch_new (GitgExtApplication* application,
                                                                    GitgExtRefActionInterface* action_interface,
                                                                    GitgCommit* commit);
VALA_EXTERN GitgCommitActionCreateBranch* gitg_commit_action_create_branch_construct (GType object_type,
                                                                          GitgExtApplication* application,
                                                                          GitgExtRefActionInterface* action_interface,
                                                                          GitgCommit* commit);
VALA_EXTERN GType gitg_commit_action_create_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActionCreateBranch, g_object_unref)
VALA_EXTERN GitgCommitActionCreateTag* gitg_commit_action_create_tag_new (GitgExtApplication* application,
                                                              GitgExtRefActionInterface* action_interface,
                                                              GitgCommit* commit);
VALA_EXTERN GitgCommitActionCreateTag* gitg_commit_action_create_tag_construct (GType object_type,
                                                                    GitgExtApplication* application,
                                                                    GitgExtRefActionInterface* action_interface,
                                                                    GitgCommit* commit);
VALA_EXTERN GType gitg_commit_action_create_tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActionCreateTag, g_object_unref)
VALA_EXTERN GitgCommitActionCreatePatch* gitg_commit_action_create_patch_new (GitgExtApplication* application,
                                                                  GitgExtRefActionInterface* action_interface,
                                                                  GitgCommit* commit);
VALA_EXTERN GitgCommitActionCreatePatch* gitg_commit_action_create_patch_construct (GType object_type,
                                                                        GitgExtApplication* application,
                                                                        GitgExtRefActionInterface* action_interface,
                                                                        GitgCommit* commit);
VALA_EXTERN GType gitg_commit_action_create_patch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActionCreatePatch, g_object_unref)
VALA_EXTERN GitgCommitActionCherryPick* gitg_commit_action_cherry_pick_new (GitgExtApplication* application,
                                                                GitgExtRefActionInterface* action_interface,
                                                                GitgCommit* commit);
VALA_EXTERN GitgCommitActionCherryPick* gitg_commit_action_cherry_pick_construct (GType object_type,
                                                                      GitgExtApplication* application,
                                                                      GitgExtRefActionInterface* action_interface,
                                                                      GitgCommit* commit);
VALA_EXTERN GType gitg_commit_action_cherry_pick_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitActionCherryPick, g_object_unref)
static void __lambda129_ (Block49Data* _data49_,
                   PeasExtensionSet* extset,
                   PeasPluginInfo* info,
                   PeasExtension* extension);
static void ___lambda129__peas_extension_set_foreach_func (PeasExtensionSet* set,
                                                    PeasPluginInfo* info,
                                                    PeasExtension* exten,
                                                    gpointer self);
static Block50Data* block50_data_ref (Block50Data* _data50_);
static void block50_data_unref (void * _userdata_);
static void __lambda115_ (GitgHistoryActivity* self);
static void ___lambda115__gitg_history_action_interface_updated (GitgHistoryActionInterface* _sender,
                                                          gpointer self);
VALA_EXTERN GitgRefActionCreateBranch* gitg_ref_action_create_branch_new (GitgExtApplication* application,
                                                              GitgExtRefActionInterface* action_interface,
                                                              GitgRef* reference);
VALA_EXTERN GitgRefActionCreateBranch* gitg_ref_action_create_branch_construct (GType object_type,
                                                                    GitgExtApplication* application,
                                                                    GitgExtRefActionInterface* action_interface,
                                                                    GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_create_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionCreateBranch, g_object_unref)
VALA_EXTERN GitgRefActionCreateTag* gitg_ref_action_create_tag_new (GitgExtApplication* application,
                                                        GitgExtRefActionInterface* action_interface,
                                                        GitgRef* reference);
VALA_EXTERN GitgRefActionCreateTag* gitg_ref_action_create_tag_construct (GType object_type,
                                                              GitgExtApplication* application,
                                                              GitgExtRefActionInterface* action_interface,
                                                              GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_create_tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionCreateTag, g_object_unref)
VALA_EXTERN GitgRefActionCreatePatch* gitg_ref_action_create_patch_new (GitgExtApplication* application,
                                                            GitgExtRefActionInterface* action_interface,
                                                            GitgRef* reference);
VALA_EXTERN GitgRefActionCreatePatch* gitg_ref_action_create_patch_construct (GType object_type,
                                                                  GitgExtApplication* application,
                                                                  GitgExtRefActionInterface* action_interface,
                                                                  GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_create_patch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionCreatePatch, g_object_unref)
VALA_EXTERN GitgRefActionCheckout* gitg_ref_action_checkout_new (GitgExtApplication* application,
                                                     GitgExtRefActionInterface* action_interface,
                                                     GitgRef* reference);
VALA_EXTERN GitgRefActionCheckout* gitg_ref_action_checkout_construct (GType object_type,
                                                           GitgExtApplication* application,
                                                           GitgExtRefActionInterface* action_interface,
                                                           GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_checkout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionCheckout, g_object_unref)
VALA_EXTERN GitgRefActionRename* gitg_ref_action_rename_new (GitgExtApplication* application,
                                                 GitgExtRefActionInterface* action_interface,
                                                 GitgRef* reference);
VALA_EXTERN GitgRefActionRename* gitg_ref_action_rename_construct (GType object_type,
                                                       GitgExtApplication* application,
                                                       GitgExtRefActionInterface* action_interface,
                                                       GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_rename_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionRename, g_object_unref)
VALA_EXTERN GitgRefActionDelete* gitg_ref_action_delete_new (GitgExtApplication* application,
                                                 GitgExtRefActionInterface* action_interface,
                                                 GitgRef* reference);
VALA_EXTERN GitgRefActionDelete* gitg_ref_action_delete_construct (GType object_type,
                                                       GitgExtApplication* application,
                                                       GitgExtRefActionInterface* action_interface,
                                                       GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_delete_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionDelete, g_object_unref)
VALA_EXTERN GitgRefActionCopyName* gitg_ref_action_copy_name_new (GitgExtApplication* application,
                                                      GitgExtRefActionInterface* action_interface,
                                                      GitgRef* reference);
VALA_EXTERN GitgRefActionCopyName* gitg_ref_action_copy_name_construct (GType object_type,
                                                            GitgExtApplication* application,
                                                            GitgExtRefActionInterface* action_interface,
                                                            GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_copy_name_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionCopyName, g_object_unref)
VALA_EXTERN GType gitg_ref_action_fetch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionFetch, g_object_unref)
VALA_EXTERN GitgRefActionFetch* gitg_ref_action_fetch_new (GitgExtApplication* application,
                                               GitgExtRefActionInterface* action_interface,
                                               GitgRef* reference,
                                               const gchar* remote_name);
VALA_EXTERN GitgRefActionFetch* gitg_ref_action_fetch_construct (GType object_type,
                                                     GitgExtApplication* application,
                                                     GitgExtRefActionInterface* action_interface,
                                                     GitgRef* reference,
                                                     const gchar* remote_name);
VALA_EXTERN GType gitg_ref_action_push_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionPush, g_object_unref)
VALA_EXTERN GitgRefActionPush* gitg_ref_action_push_new (GitgExtApplication* application,
                                             GitgExtRefActionInterface* action_interface,
                                             GitgRef* reference);
VALA_EXTERN GitgRefActionPush* gitg_ref_action_push_construct (GType object_type,
                                                   GitgExtApplication* application,
                                                   GitgExtRefActionInterface* action_interface,
                                                   GitgRef* reference);
VALA_EXTERN GType gitg_ref_action_merge_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgRefActionMerge, g_object_unref)
VALA_EXTERN GitgRefActionMerge* gitg_ref_action_merge_new (GitgExtApplication* application,
                                               GitgExtRefActionInterface* action_interface,
                                               GitgRef* reference);
VALA_EXTERN GitgRefActionMerge* gitg_ref_action_merge_construct (GType object_type,
                                                     GitgExtApplication* application,
                                                     GitgExtRefActionInterface* action_interface,
                                                     GitgRef* reference);
static void __lambda125_ (Block50Data* _data50_,
                   PeasExtensionSet* extset,
                   PeasPluginInfo* info,
                   PeasExtension* extension);
static void ___lambda125__peas_extension_set_foreach_func (PeasExtensionSet* set,
                                                    PeasPluginInfo* info,
                                                    PeasExtension* exten,
                                                    gpointer self);
static void __lambda126_ (Block50Data* _data50_);
static void _vala_array_add16 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static void _vala_array_add17 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static gchar** _vala_array_dup17 (gchar** self,
                           gssize length);
static void ___lambda126__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
VALA_EXTERN gint gitg_history_refs_list_y_in_window (GitgHistoryRefsList* self,
                                         gint y,
                                         GdkWindow* origin);
VALA_EXTERN GeeList* gitg_history_refs_list_get_selection (GitgHistoryRefsList* self);
VALA_EXTERN GType gitg_history_ref_header_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryRefHeader, g_object_unref)
VALA_EXTERN GeeLinkedList* gitg_history_ref_header_get_actions (GitgHistoryRefHeader* self);
static GgitOId* _vala_GgitOId_copy (GgitOId* self);
VALA_EXTERN gboolean gitg_history_refs_list_get_is_all (GitgHistoryRefsList* self);
VALA_EXTERN gboolean gitg_history_refs_list_get_is_header (GitgHistoryRefsList* self);
static void _vala_array_add18 (GgitOId** * array,
                        gint* length,
                        gint* size,
                        GgitOId* value);
static void _vala_array_add19 (GgitOId** * array,
                        gint* length,
                        gint* size,
                        GgitOId* value);
static void _vala_array_add20 (GgitOId** * array,
                        gint* length,
                        gint* size,
                        GgitOId* value);
VALA_EXTERN GType gitg_history_ref_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryRefRow, g_object_unref)
VALA_EXTERN GitgRef* gitg_history_ref_row_get_reference (GitgHistoryRefRow* self);
static gchar* gitg_history_activity_normalize (GitgHistoryActivity* self,
                                        const gchar* s);
VALA_EXTERN void gitg_history_activity_set_repository (GitgHistoryActivity* self,
                                           GitgRepository* value);
VALA_EXTERN GitgHistoryRefsList* gitg_history_activity_get_refs_list (GitgHistoryActivity* self);
static GObject * gitg_history_activity_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _gitg_history_activity___lambda135_ (GitgHistoryActivity* self,
                                          GSettings* s,
                                          const gchar* k);
static void __gitg_history_activity___lambda135__g_settings_changed (GSettings* _sender,
                                                              const gchar* key,
                                                              gpointer self);
static void _gitg_history_activity___lambda136_ (GitgHistoryActivity* self,
                                          GSettings* s,
                                          const gchar* k);
static void __gitg_history_activity___lambda136__g_settings_changed (GSettings* _sender,
                                                              const gchar* key,
                                                              gpointer self);
static void _gitg_history_activity___lambda137_ (GitgHistoryActivity* self,
                                          GSettings* s,
                                          const gchar* k);
static void __gitg_history_activity___lambda137__g_settings_changed (GSettings* _sender,
                                                              const gchar* key,
                                                              gpointer self);
static void _gitg_history_activity_on_commit_model_started_gitg_commit_model_started (GitgCommitModel* _sender,
                                                                               gpointer self);
static void _gitg_history_activity_on_commit_model_finished_gitg_commit_model_finished (GitgCommitModel* _sender,
                                                                                 gpointer self);
static void _gitg_history_activity_repository_changed_externally_gitg_ext_application_repository_changed_externally (GitgExtApplication* _sender,
                                                                                                              GitgExtExternalChangeHint hint,
                                                                                                              gpointer self);
static void _gitg_history_activity_repository_commits_changed_gitg_ext_application_repository_commits_changed (GitgExtApplication* _sender,
                                                                                                        gpointer self);
static void gitg_history_activity_finalize (GObject * obj);
static GType gitg_history_activity_get_type_once (void);
static void _vala_gitg_history_activity_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_gitg_history_activity_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);

 G_GNUC_NO_INLINE static GType
gitg_history_default_selection_get_type_once (void)
{
	static const GEnumValue values[] = {{GITG_HISTORY_DEFAULT_SELECTION_CURRENT_BRANCH, "GITG_HISTORY_DEFAULT_SELECTION_CURRENT_BRANCH", "current-branch"}, {GITG_HISTORY_DEFAULT_SELECTION_ALL_BRANCHES, "GITG_HISTORY_DEFAULT_SELECTION_ALL_BRANCHES", "all-branches"}, {GITG_HISTORY_DEFAULT_SELECTION_ALL_COMMITS, "GITG_HISTORY_DEFAULT_SELECTION_ALL_COMMITS", "all-commits"}, {0, NULL, NULL}};
	GType gitg_history_default_selection_type_id;
	gitg_history_default_selection_type_id = g_enum_register_static ("GitgHistoryDefaultSelection", values);
	return gitg_history_default_selection_type_id;
}

GType
gitg_history_default_selection_get_type (void)
{
	static gsize gitg_history_default_selection_type_id__once = 0;
	if (g_once_init_enter (&gitg_history_default_selection_type_id__once)) {
		GType gitg_history_default_selection_type_id;
		gitg_history_default_selection_type_id = gitg_history_default_selection_get_type_once ();
		g_once_init_leave (&gitg_history_default_selection_type_id__once, gitg_history_default_selection_type_id);
	}
	return gitg_history_default_selection_type_id__once;
}

static inline gpointer
gitg_history_activity_get_instance_private (GitgHistoryActivity* self)
{
	return G_STRUCT_MEMBER_P (self, GitgHistoryActivity_private_offset);
}

static void
_vala_GgitOId_free (GgitOId* self)
{
	g_boxed_free (ggit_oid_get_type (), self);
}

GitgHistoryActivity*
gitg_history_activity_construct (GType object_type,
                                 GitgExtApplication* application)
{
	GitgHistoryActivity * self = NULL;
	g_return_val_if_fail (application != NULL, NULL);
	self = (GitgHistoryActivity*) g_object_new (object_type, "application", application, NULL);
	return self;
}

GitgHistoryActivity*
gitg_history_activity_new (GitgExtApplication* application)
{
	return gitg_history_activity_construct (GITG_HISTORY_TYPE_ACTIVITY, application);
}

static Block46Data*
block46_data_ref (Block46Data* _data46_)
{
	g_atomic_int_inc (&_data46_->_ref_count_);
	return _data46_;
}

static void
block46_data_unref (void * _userdata_)
{
	Block46Data* _data46_;
	_data46_ = (Block46Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data46_->_ref_count_)) {
		GitgHistoryActivity* self;
		self = _data46_->self;
		_g_object_unref0 (self);
		g_slice_free (Block46Data, _data46_);
	}
}

static void
__lambda109_ (Block46Data* _data46_,
              GtkTreeModel* model,
              GtkTreePath* path,
              GtkTreeIter* iter)
{
	GitgHistoryActivity* self;
	self = _data46_->self;
	g_return_if_fail (model != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (iter != NULL);
	if (!_data46_->breakit) {
		GitgCommit* c = NULL;
		GitgCommitModel* _tmp0_;
		GtkTreeIter _tmp1_;
		GitgCommit* _tmp2_;
		GitgCommit* _tmp3_;
		_tmp0_ = self->priv->d_commit_list_model;
		_tmp1_ = *iter;
		_tmp2_ = gitg_commit_model_commit_from_iter (_tmp0_, &_tmp1_);
		c = _tmp2_;
		_tmp3_ = c;
		if (_tmp3_ != NULL) {
			GitgCommit* _tmp4_;
			_tmp4_ = c;
			_data46_->breakit = !_data46_->func ((GgitCommit*) _tmp4_, _data46_->func_target);
		}
		_g_object_unref0 (c);
	}
}

static void
___lambda109__gtk_tree_selection_foreach_func (GtkTreeModel* model,
                                               GtkTreePath* path,
                                               GtkTreeIter* iter,
                                               gpointer self)
{
	__lambda109_ (self, model, path, iter);
}

static void
gitg_history_activity_real_foreach_selected (GitgExtHistory* base,
                                             GitgExtForeachCommitSelectionFunc func,
                                             gpointer func_target)
{
	GitgHistoryActivity * self;
	Block46Data* _data46_;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GtkTreeSelection* _tmp3_;
	self = (GitgHistoryActivity*) base;
	_data46_ = g_slice_new0 (Block46Data);
	_data46_->_ref_count_ = 1;
	_data46_->self = g_object_ref (self);
	_data46_->func = func;
	_data46_->func_target = func_target;
	_data46_->breakit = FALSE;
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp2_);
	gtk_tree_selection_selected_foreach (_tmp3_, ___lambda109__gtk_tree_selection_foreach_func, _data46_);
	block46_data_unref (_data46_);
	_data46_ = NULL;
}

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

static void
_vala_GtkTreePath_free (GtkTreePath* self)
{
	g_boxed_free (gtk_tree_path_get_type (), self);
}

static void
gitg_history_activity_real_select (GitgExtHistory* base,
                                   GitgCommit* commit)
{
	GitgHistoryActivity * self;
	GitgCommitModel* model = NULL;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GtkTreeModel* _tmp3_;
	GtkTreeModel* _tmp4_;
	GitgCommitModel* _tmp5_;
	GtkTreePath* path = NULL;
	GitgCommitModel* _tmp6_;
	GtkTreePath* _tmp7_;
	GtkTreePath* _tmp8_;
	self = (GitgHistoryActivity*) base;
	g_return_if_fail (commit != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_tree_view_get_model ((GtkTreeView*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GITG_TYPE_COMMIT_MODEL, GitgCommitModel));
	model = _tmp5_;
	_tmp6_ = model;
	_tmp7_ = gitg_commit_model_path_from_commit (_tmp6_, commit);
	path = _tmp7_;
	_tmp8_ = path;
	if (_tmp8_ != NULL) {
		GtkTreeSelection* sel = NULL;
		GitgHistoryPaned* _tmp9_;
		GitgCommitListView* _tmp10_;
		GitgCommitListView* _tmp11_;
		GtkTreeSelection* _tmp12_;
		GtkTreeSelection* _tmp13_;
		GtkTreeSelection* _tmp14_;
		GtkTreePath* _tmp15_;
		GitgHistoryPaned* _tmp16_;
		GitgCommitListView* _tmp17_;
		GitgCommitListView* _tmp18_;
		GtkTreePath* _tmp19_;
		_tmp9_ = self->priv->d_main;
		_tmp10_ = gitg_history_paned_get_commit_list_view (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp11_);
		_tmp13_ = _g_object_ref0 (_tmp12_);
		sel = _tmp13_;
		_tmp14_ = sel;
		_tmp15_ = path;
		gtk_tree_selection_select_path (_tmp14_, _tmp15_);
		_tmp16_ = self->priv->d_main;
		_tmp17_ = gitg_history_paned_get_commit_list_view (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = path;
		gtk_tree_view_scroll_to_cell ((GtkTreeView*) _tmp18_, _tmp19_, NULL, TRUE, 0.5f, (gfloat) 0);
		_g_object_unref0 (sel);
	} else {
		FILE* _tmp20_;
		GgitOId* _tmp21_;
		GgitOId* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		_tmp20_ = stderr;
		_tmp21_ = ggit_object_get_id ((GgitObject*) commit);
		_tmp22_ = _tmp21_;
		_tmp23_ = ggit_oid_to_string (_tmp22_);
		_tmp24_ = _tmp23_;
		fprintf (_tmp20_, "Failed to lookup tree path for commit '%s'\n", _tmp24_);
		_g_free0 (_tmp24_);
		__vala_GgitOId_free0 (_tmp22_);
	}
	__vala_GtkTreePath_free0 (path);
	_g_object_unref0 (model);
}

static void
gitg_history_activity_repository_changed_externally (GitgHistoryActivity* self,
                                                     GitgExtExternalChangeHint hint)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GitgHistoryPaned* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->d_main;
	if (_tmp2_ != NULL) {
		_tmp1_ = (hint & GITG_EXT_EXTERNAL_CHANGE_HINT_REFS) != 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = !self->priv->d_ignore_external;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gitg_history_activity_reload_when_mapped (self);
	}
	self->priv->d_ignore_external = FALSE;
}

static void
gitg_history_activity_repository_commits_changed (GitgHistoryActivity* self)
{
	GitgHistoryPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	if (_tmp0_ != NULL) {
		self->priv->d_ignore_external = TRUE;
		gitg_history_activity_reload_when_mapped (self);
	}
}

static void
___lambda110_ (GitgHistoryActivity* self)
{
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	gitg_history_activity_reload (self);
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_application_window_get_type (), GtkApplicationWindow);
	g_action_group_activate_action ((GActionGroup*) _tmp2_, "reload", NULL);
	_g_object_unref0 (_tmp2_);
}

static void
____lambda110__gitg_when_mapped_on_mapped (gpointer self)
{
	___lambda110_ ((GitgHistoryActivity*) self);
}

static void
gitg_history_activity_reload_when_mapped (GitgHistoryActivity* self)
{
	GitgHistoryPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	if (_tmp0_ != NULL) {
		GitgHistoryPaned* _tmp1_;
		GitgWhenMapped* _tmp2_;
		GitgWhenMapped* _tmp3_;
		_tmp1_ = self->priv->d_main;
		_tmp2_ = gitg_when_mapped_new ((GtkWidget*) _tmp1_);
		_gitg_when_mapped_unref0 (self->priv->d_reload_when_mapped);
		self->priv->d_reload_when_mapped = _tmp2_;
		_tmp3_ = self->priv->d_reload_when_mapped;
		gitg_when_mapped_update (_tmp3_, ____lambda110__gitg_when_mapped_on_mapped, g_object_ref (self), g_object_unref, (GObject*) self);
	}
}

static void
gitg_history_activity_real_dispose (GObject* base)
{
	GitgHistoryActivity * self;
	GitgCommitModel* _tmp12_;
	self = (GitgHistoryActivity*) base;
	if (self->priv->d_refs_list_selection_id != ((gulong) 0)) {
		GitgHistoryPaned* _tmp0_;
		GitgHistoryRefsList* _tmp1_;
		GitgHistoryRefsList* _tmp2_;
		_tmp0_ = self->priv->d_main;
		_tmp1_ = gitg_history_paned_get_refs_list (_tmp0_);
		_tmp2_ = _tmp1_;
		g_signal_handler_disconnect ((GObject*) _tmp2_, self->priv->d_refs_list_selection_id);
		self->priv->d_refs_list_selection_id = (gulong) 0;
	}
	if (self->priv->d_refs_list_changed_id != ((gulong) 0)) {
		GitgHistoryPaned* _tmp3_;
		GitgHistoryRefsList* _tmp4_;
		GitgHistoryRefsList* _tmp5_;
		_tmp3_ = self->priv->d_main;
		_tmp4_ = gitg_history_paned_get_refs_list (_tmp3_);
		_tmp5_ = _tmp4_;
		g_signal_handler_disconnect ((GObject*) _tmp5_, self->priv->d_refs_list_changed_id);
		self->priv->d_refs_list_changed_id = (gulong) 0;
	}
	if (self->priv->d_walker_update_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->d_walker_update_idle_id);
		self->priv->d_walker_update_idle_id = (guint) 0;
	}
	if (self->priv->d_externally_changed_id != ((gulong) 0)) {
		GitgExtApplication* _tmp6_;
		GitgExtApplication* _tmp7_;
		GitgExtApplication* _tmp8_;
		_tmp6_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		g_signal_handler_disconnect ((GObject*) _tmp8_, self->priv->d_externally_changed_id);
		_g_object_unref0 (_tmp8_);
		self->priv->d_externally_changed_id = (gulong) 0;
	}
	if (self->priv->d_commits_changed_id != ((gulong) 0)) {
		GitgExtApplication* _tmp9_;
		GitgExtApplication* _tmp10_;
		GitgExtApplication* _tmp11_;
		_tmp9_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		g_signal_handler_disconnect ((GObject*) _tmp11_, self->priv->d_commits_changed_id);
		_g_object_unref0 (_tmp11_);
		self->priv->d_commits_changed_id = (gulong) 0;
	}
	_tmp12_ = self->priv->d_commit_list_model;
	gitg_commit_model_set_repository (_tmp12_, NULL);
	G_OBJECT_CLASS (gitg_history_activity_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

static void
gitg_history_activity_update_sort_mode (GitgHistoryActivity* self)
{
	GSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_settings;
	if (g_settings_get_boolean (_tmp0_, "topological-order")) {
		GitgCommitModel* _tmp1_;
		_tmp1_ = self->priv->d_commit_list_model;
		gitg_commit_model_set_sort_mode (_tmp1_, GGIT_SORT_TOPOLOGICAL);
	} else {
		GitgCommitModel* _tmp2_;
		_tmp2_ = self->priv->d_commit_list_model;
		gitg_commit_model_set_sort_mode (_tmp2_, GGIT_SORT_TIME | GGIT_SORT_TOPOLOGICAL);
	}
}

static void
_gitg_history_activity_on_row_inserted_select_gtk_tree_model_row_inserted (GtkTreeModel* _sender,
                                                                           GtkTreePath* path,
                                                                           GtkTreeIter* iter,
                                                                           gpointer self)
{
	gitg_history_activity_on_row_inserted_select ((GitgHistoryActivity*) self, _sender, path, iter);
}

static void
gitg_history_activity_on_commit_model_started (GitgHistoryActivity* self,
                                               GitgCommitModel* model)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	if (self->priv->d_insertsig == ((gulong) 0)) {
		GitgCommitModel* _tmp0_;
		gulong _tmp1_;
		_tmp0_ = self->priv->d_commit_list_model;
		_tmp1_ = g_signal_connect_object ((GtkTreeModel*) _tmp0_, "row-inserted", (GCallback) _gitg_history_activity_on_row_inserted_select_gtk_tree_model_row_inserted, self, 0);
		self->priv->d_insertsig = _tmp1_;
	}
}

static void
gitg_history_activity_on_row_inserted_select (GitgHistoryActivity* self,
                                              GtkTreeModel* model,
                                              GtkTreePath* path,
                                              GtkTreeIter* iter)
{
	GitgCommit* commit = NULL;
	GitgCommitModel* _tmp0_;
	GitgCommit* _tmp1_;
	GtkTreeSelection* sel = NULL;
	GitgHistoryPaned* _tmp2_;
	GitgCommitListView* _tmp3_;
	GitgCommitListView* _tmp4_;
	GtkTreeSelection* _tmp5_;
	GtkTreeSelection* _tmp6_;
	gboolean _tmp7_ = FALSE;
	GeeHashSet* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gboolean _tmp24_ = FALSE;
	GeeHashSet* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->d_commit_list_model;
	_tmp1_ = gitg_commit_model_commit_from_path (_tmp0_, path);
	commit = _tmp1_;
	_tmp2_ = self->priv->d_main;
	_tmp3_ = gitg_history_paned_get_commit_list_view (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp4_);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	sel = _tmp6_;
	_tmp8_ = self->priv->d_selected;
	_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == 0) {
		_tmp7_ = TRUE;
	} else {
		GeeHashSet* _tmp11_;
		GitgCommit* _tmp12_;
		GgitOId* _tmp13_;
		GgitOId* _tmp14_;
		_tmp11_ = self->priv->d_selected;
		_tmp12_ = commit;
		_tmp13_ = ggit_object_get_id ((GgitObject*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp7_ = gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp11_, _tmp14_);
		__vala_GgitOId_free0 (_tmp14_);
	}
	if (_tmp7_) {
		GtkTreeSelection* _tmp15_;
		GitgCommit* _tmp16_;
		GgitOId* _tmp17_;
		GgitOId* _tmp18_;
		GgitOId* _tmp19_;
		gboolean _tmp20_;
		_tmp15_ = sel;
		gtk_tree_selection_select_path (_tmp15_, path);
		_tmp16_ = commit;
		_tmp17_ = ggit_object_get_id ((GgitObject*) _tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = self->priv->d_scroll_to;
		_tmp20_ = ggit_oid_equal (_tmp18_, _tmp19_);
		__vala_GgitOId_free0 (_tmp18_);
		if (_tmp20_) {
			GitgHistoryPaned* _tmp21_;
			GitgCommitListView* _tmp22_;
			GitgCommitListView* _tmp23_;
			_tmp21_ = self->priv->d_main;
			_tmp22_ = gitg_history_paned_get_commit_list_view (_tmp21_);
			_tmp23_ = _tmp22_;
			gtk_tree_view_scroll_to_cell ((GtkTreeView*) _tmp23_, path, NULL, TRUE, self->priv->d_scroll_y, (gfloat) 0);
			__vala_GgitOId_free0 (self->priv->d_scroll_to);
			self->priv->d_scroll_to = NULL;
		}
	}
	_tmp25_ = self->priv->d_selected;
	_tmp26_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp25_);
	_tmp27_ = _tmp26_;
	if (_tmp27_ == 0) {
		_tmp24_ = TRUE;
	} else {
		gboolean _tmp28_ = FALSE;
		GtkTreeSelection* _tmp29_;
		_tmp29_ = sel;
		if (gtk_tree_selection_count_selected_rows (_tmp29_) != 0) {
			gboolean _tmp30_ = FALSE;
			GtkTreeSelection* _tmp31_;
			GtkSelectionMode _tmp32_;
			GtkSelectionMode _tmp33_;
			_tmp31_ = sel;
			_tmp32_ = gtk_tree_selection_get_mode (_tmp31_);
			_tmp33_ = _tmp32_;
			if (_tmp33_ == GTK_SELECTION_SINGLE) {
				_tmp30_ = TRUE;
			} else {
				GtkTreeSelection* _tmp34_;
				GtkSelectionMode _tmp35_;
				GtkSelectionMode _tmp36_;
				_tmp34_ = sel;
				_tmp35_ = gtk_tree_selection_get_mode (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp30_ = _tmp36_ == GTK_SELECTION_BROWSE;
			}
			_tmp28_ = _tmp30_;
		} else {
			_tmp28_ = FALSE;
		}
		_tmp24_ = _tmp28_;
	}
	if (_tmp24_) {
		GeeHashSet* _tmp37_;
		GitgCommitModel* _tmp38_;
		_tmp37_ = self->priv->d_selected;
		gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp37_);
		_tmp38_ = self->priv->d_commit_list_model;
		g_signal_handler_disconnect ((GObject*) _tmp38_, self->priv->d_insertsig);
		self->priv->d_insertsig = (gulong) 0;
	}
	_g_object_unref0 (sel);
	_g_object_unref0 (commit);
}

static void
__vala_GtkTreePath_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL));
}

static inline void
_g_list_free___vala_GtkTreePath_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) __vala_GtkTreePath_free0_);
}

static GtkTreePath*
_vala_GtkTreePath_copy (GtkTreePath* self)
{
	return g_boxed_copy (gtk_tree_path_get_type (), self);
}

static gpointer
__vala_GtkTreePath_copy0 (gpointer self)
{
	return self ? _vala_GtkTreePath_copy (self) : NULL;
}

static void
gitg_history_activity_scroll_into_view (GitgHistoryActivity* self)
{
	GitgHistoryPaned* _tmp0_;
	GtkTreeSelection* sel = NULL;
	GitgHistoryPaned* _tmp1_;
	GitgCommitListView* _tmp2_;
	GitgCommitListView* _tmp3_;
	GtkTreeSelection* _tmp4_;
	GtkTreeSelection* _tmp5_;
	GtkTreeModel* m = NULL;
	GList* rows = NULL;
	GtkTreeSelection* _tmp6_;
	GtkTreeModel* _tmp7_ = NULL;
	GList* _tmp8_;
	GtkTreeModel* _tmp9_;
	GList* _tmp10_;
	GtkTreePath* row = NULL;
	GList* _tmp11_;
	gconstpointer _tmp12_;
	GtkTreePath* _tmp13_;
	GtkTreePath* startp = NULL;
	GtkTreePath* endp = NULL;
	GitgHistoryPaned* _tmp14_;
	GitgCommitListView* _tmp15_;
	GitgCommitListView* _tmp16_;
	GtkTreePath* _tmp17_ = NULL;
	GtkTreePath* _tmp18_ = NULL;
	gboolean _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_main;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->d_main;
	_tmp2_ = gitg_history_paned_get_commit_list_view (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp3_);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	sel = _tmp5_;
	_tmp6_ = sel;
	_tmp8_ = gtk_tree_selection_get_selected_rows (_tmp6_, &_tmp7_);
	_g_object_unref0 (m);
	_tmp9_ = _g_object_ref0 (_tmp7_);
	m = _tmp9_;
	rows = _tmp8_;
	_tmp10_ = rows;
	if (_tmp10_ == NULL) {
		(rows == NULL) ? NULL : (rows = (_g_list_free___vala_GtkTreePath_free0_ (rows), NULL));
		_g_object_unref0 (m);
		_g_object_unref0 (sel);
		return;
	}
	_tmp11_ = rows;
	_tmp12_ = _tmp11_->data;
	_tmp13_ = __vala_GtkTreePath_copy0 ((GtkTreePath*) _tmp12_);
	row = _tmp13_;
	_tmp14_ = self->priv->d_main;
	_tmp15_ = gitg_history_paned_get_commit_list_view (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp19_ = gtk_tree_view_get_visible_range ((GtkTreeView*) _tmp16_, &_tmp17_, &_tmp18_);
	__vala_GtkTreePath_free0 (startp);
	startp = _tmp17_;
	__vala_GtkTreePath_free0 (endp);
	endp = _tmp18_;
	if (_tmp19_) {
		gboolean _tmp20_ = FALSE;
		GtkTreePath* _tmp21_;
		GtkTreePath* _tmp22_;
		_tmp21_ = row;
		_tmp22_ = startp;
		if (gtk_tree_path_compare (_tmp21_, _tmp22_) < 0) {
			_tmp20_ = TRUE;
		} else {
			GtkTreePath* _tmp23_;
			GtkTreePath* _tmp24_;
			_tmp23_ = row;
			_tmp24_ = endp;
			_tmp20_ = gtk_tree_path_compare (_tmp23_, _tmp24_) > 0;
		}
		if (_tmp20_) {
			GitgHistoryPaned* _tmp25_;
			GitgCommitListView* _tmp26_;
			GitgCommitListView* _tmp27_;
			GtkTreePath* _tmp28_;
			_tmp25_ = self->priv->d_main;
			_tmp26_ = gitg_history_paned_get_commit_list_view (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = row;
			gtk_tree_view_scroll_to_cell ((GtkTreeView*) _tmp27_, _tmp28_, NULL, TRUE, (gfloat) 0, (gfloat) 0);
		}
	}
	__vala_GtkTreePath_free0 (endp);
	__vala_GtkTreePath_free0 (startp);
	__vala_GtkTreePath_free0 (row);
	(rows == NULL) ? NULL : (rows = (_g_list_free___vala_GtkTreePath_free0_ (rows), NULL));
	_g_object_unref0 (m);
	_g_object_unref0 (sel);
}

static void
gitg_history_activity_on_commit_model_finished (GitgHistoryActivity* self,
                                                GitgCommitModel* model)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	if (self->priv->d_insertsig != ((gulong) 0)) {
		GitgCommitModel* _tmp0_;
		_tmp0_ = self->priv->d_commit_list_model;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->d_insertsig);
		self->priv->d_insertsig = (gulong) 0;
	}
	gitg_history_activity_scroll_into_view (self);
}

static void
gitg_history_activity_on_commit_model_begin_clear (GitgHistoryActivity* self,
                                                   GitgCommitModel* model)
{
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_tree_view_set_model ((GtkTreeView*) _tmp2_, NULL);
}

static void
gitg_history_activity_on_commit_model_end_clear (GitgHistoryActivity* self,
                                                 GitgCommitModel* model)
{
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GitgCommitModel* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->d_commit_list_model;
	gtk_tree_view_set_model ((GtkTreeView*) _tmp2_, (GtkTreeModel*) _tmp3_);
}

static gboolean
gitg_history_activity_real_is_default_for (GitgExtActivity* base,
                                           const gchar* action)
{
	GitgHistoryActivity * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = (GitgHistoryActivity*) base;
	g_return_val_if_fail (action != NULL, FALSE);
	if (g_strcmp0 (action, "") == 0) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (action, "history") == 0;
	}
	result = _tmp0_;
	return result;
}

static gint
gitg_history_activity_real_negotiate_order (GitgExtUIElement* base,
                                            GitgExtUIElement* other)
{
	GitgHistoryActivity * self;
	gint result;
	self = (GitgHistoryActivity*) base;
	g_return_val_if_fail (other != NULL, -1);
	result = -1;
	return result;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
gitg_history_activity_store_changed_mainline (GitgHistoryActivity* self)
{
	GitgRepository* repo = NULL;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgRepository* _tmp3_;
	GitgRepository* _tmp4_;
	GitgRepository* _tmp5_;
	GitgRepository* _tmp6_;
	GgitConfig* config = NULL;
	GgitConfig* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = gitg_ext_application_get_repository (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	repo = _tmp5_;
	_tmp6_ = repo;
	if (_tmp6_ == NULL) {
		_g_object_unref0 (repo);
		return;
	}
	{
		GgitConfig* _tmp7_ = NULL;
		GitgRepository* _tmp8_;
		GgitConfig* _tmp9_;
		GgitConfig* _tmp10_;
		_tmp8_ = repo;
		_tmp9_ = ggit_repository_get_config ((GgitRepository*) _tmp8_, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		_g_object_unref0 (config);
		config = _tmp10_;
		_g_object_unref0 (_tmp7_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		_g_object_unref0 (config);
		_g_object_unref0 (repo);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (config);
		_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;
	}
	_tmp11_ = config;
	_tmp12_ = self->priv->d_mainline;
	_tmp12__length1 = self->priv->d_mainline_length1;
	_tmp13_ = _vala_g_strjoinv (",", _tmp12_, (gint) _tmp12__length1);
	_tmp14_ = _tmp13_;
	gitg_history_activity_store_mainline (self, _tmp11_, _tmp14_);
	_g_free0 (_tmp14_);
	_g_object_unref0 (config);
	_g_object_unref0 (repo);
}

static void
gitg_history_activity_store_mainline (GitgHistoryActivity* self,
                                      GgitConfig* config,
                                      const gchar* mainline)
{
	gboolean _tmp0_ = FALSE;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (mainline != NULL);
	if (config != NULL) {
		_tmp0_ = strlen (mainline) > ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		{
			ggit_config_set_string (config, "gitg.mainline", mainline, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			FILE* _tmp1_;
			GError* _tmp2_;
			const gchar* _tmp3_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp1_ = stderr;
			_tmp2_ = e;
			_tmp3_ = _tmp2_->message;
			fprintf (_tmp1_, "Failed to set gitg.mainline: %s\n", _tmp3_);
			_g_error_free0 (e);
		}
		__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
_vala_array_add15 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
gitg_history_activity_reload_mainline (GitgHistoryActivity* self)
{
	GeeHashSet* uniq = NULL;
	GeeHashSet* _tmp0_;
	gchar** _tmp1_;
	GitgRepository* repository = NULL;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgExtApplication* _tmp4_;
	GitgRepository* _tmp5_;
	GitgRepository* _tmp6_;
	GitgRepository* _tmp7_;
	GitgRepository* _tmp8_;
	GgitConfig* config = NULL;
	GitgRepository* _tmp9_;
	GgitConfig* _tmp10_;
	gchar** ref_names = NULL;
	gchar** _tmp11_;
	gint ref_names_length1;
	gint _ref_names_size_;
	gchar* default_branch = NULL;
	gchar** _tmp28_;
	gint _tmp28__length1;
	GgitConfig* _tmp47_;
	gchar** _tmp48_;
	gint _tmp48__length1;
	gchar* _tmp49_;
	gchar* _tmp50_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_gitg_when_mapped_unref0 (self->priv->d_reload_when_mapped);
	self->priv->d_reload_when_mapped = NULL;
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	uniq = _tmp0_;
	_tmp1_ = g_new0 (gchar*, 0 + 1);
	self->priv->d_mainline = (_vala_array_free (self->priv->d_mainline, self->priv->d_mainline_length1, (GDestroyNotify) g_free), NULL);
	self->priv->d_mainline = _tmp1_;
	self->priv->d_mainline_length1 = 0;
	self->priv->_d_mainline_size_ = self->priv->d_mainline_length1;
	_tmp2_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp5_ = gitg_ext_application_get_repository (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_g_object_unref0 (_tmp4_);
	repository = _tmp7_;
	_tmp8_ = repository;
	if (_tmp8_ == NULL) {
		_g_object_unref0 (repository);
		_g_object_unref0 (uniq);
		return;
	}
	_tmp9_ = repository;
	_tmp10_ = ggit_repository_get_config ((GgitRepository*) _tmp9_, &_inner_error0_);
	config = _tmp10_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (repository);
		_g_object_unref0 (uniq);
		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;
	}
	_tmp11_ = g_new0 (gchar*, 0 + 1);
	ref_names = _tmp11_;
	ref_names_length1 = 0;
	_ref_names_size_ = ref_names_length1;
	{
		GgitConfig* _tmp12_ = NULL;
		GgitConfig* _tmp13_;
		GgitConfig* _tmp14_;
		const gchar* _tmp15_ = NULL;
		const gchar* _tmp16_;
		gchar** _tmp17_;
		gchar** _tmp18_;
		_tmp13_ = config;
		_tmp14_ = ggit_config_snapshot (_tmp13_, &_inner_error0_);
		_tmp12_ = _tmp14_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp16_ = ggit_config_get_string (_tmp12_, "gitg.mainline", &_inner_error0_);
		_tmp15_ = _tmp16_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp12_);
			goto __catch0_g_error;
		}
		_tmp18_ = _tmp17_ = g_strsplit (_tmp15_, ",", 0);
		ref_names = (_vala_array_free (ref_names, ref_names_length1, (GDestroyNotify) g_free), NULL);
		ref_names = _tmp18_;
		ref_names_length1 = _vala_array_length (_tmp17_);
		_ref_names_size_ = ref_names_length1;
		_g_object_unref0 (_tmp12_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		{
			GgitConfig* _tmp19_ = NULL;
			GgitConfig* _tmp20_;
			GgitConfig* _tmp21_;
			const gchar* _tmp22_ = NULL;
			const gchar* _tmp23_;
			gchar* _tmp24_;
			const gchar* _tmp25_;
			gchar* _tmp26_;
			gchar** _tmp27_;
			_tmp20_ = config;
			_tmp21_ = ggit_config_snapshot (_tmp20_, &_inner_error0_);
			_tmp19_ = _tmp21_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			_tmp23_ = ggit_config_get_string (_tmp19_, "init.defaultBranch", &_inner_error0_);
			_tmp22_ = _tmp23_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (_tmp19_);
				goto __catch1_g_error;
			}
			_tmp24_ = g_strdup (_tmp22_);
			_g_free0 (default_branch);
			default_branch = _tmp24_;
			_tmp25_ = default_branch;
			_tmp26_ = g_strdup_printf ("refs/heads/%s", _tmp25_);
			_tmp27_ = g_new0 (gchar*, 1 + 1);
			_tmp27_[0] = _tmp26_;
			ref_names = (_vala_array_free (ref_names, ref_names_length1, (GDestroyNotify) g_free), NULL);
			ref_names = _tmp27_;
			ref_names_length1 = 1;
			_ref_names_size_ = ref_names_length1;
			_g_object_unref0 (_tmp19_);
		}
		goto __finally1;
		__catch1_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (default_branch);
			ref_names = (_vala_array_free (ref_names, ref_names_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (config);
			_g_object_unref0 (repository);
			_g_object_unref0 (uniq);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (default_branch);
		ref_names = (_vala_array_free (ref_names, ref_names_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (config);
		_g_object_unref0 (repository);
		_g_object_unref0 (uniq);
		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;
	}
	_tmp28_ = ref_names;
	_tmp28__length1 = ref_names_length1;
	{
		gchar** name_collection = NULL;
		gint name_collection_length1 = 0;
		gint _name_collection_size_ = 0;
		gint name_it = 0;
		name_collection = _tmp28_;
		name_collection_length1 = _tmp28__length1;
		for (name_it = 0; name_it < name_collection_length1; name_it = name_it + 1) {
			gchar* _tmp29_;
			gchar* name = NULL;
			_tmp29_ = g_strdup (name_collection[name_it]);
			name = _tmp29_;
			{
				GitgRef* r = NULL;
				GgitOId* id = NULL;
				GitgRef* _tmp39_;
				GgitOId* _tmp40_;
				gboolean _tmp41_ = FALSE;
				GgitOId* _tmp42_;
				{
					GitgRef* _tmp30_ = NULL;
					GitgRepository* _tmp31_;
					const gchar* _tmp32_;
					GitgRef* _tmp33_;
					GitgRef* _tmp34_;
					_tmp31_ = repository;
					_tmp32_ = name;
					_tmp33_ = gitg_repository_lookup_reference (_tmp31_, _tmp32_, &_inner_error0_);
					_tmp30_ = _tmp33_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch2_g_error;
					}
					_tmp34_ = _tmp30_;
					_tmp30_ = NULL;
					_g_object_unref0 (r);
					r = _tmp34_;
					_g_object_unref0 (_tmp30_);
				}
				goto __finally2;
				__catch2_g_error:
				{
					GError* e = NULL;
					FILE* _tmp35_;
					const gchar* _tmp36_;
					GError* _tmp37_;
					const gchar* _tmp38_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp35_ = stderr;
					_tmp36_ = name;
					_tmp37_ = e;
					_tmp38_ = _tmp37_->message;
					fprintf (_tmp35_, "Failed to lookup reference (%s): %s\n", _tmp36_, _tmp38_);
					_g_error_free0 (e);
					_g_object_unref0 (r);
					_g_free0 (name);
					continue;
				}
				__finally2:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (r);
					_g_free0 (name);
					_g_free0 (default_branch);
					ref_names = (_vala_array_free (ref_names, ref_names_length1, (GDestroyNotify) g_free), NULL);
					_g_object_unref0 (config);
					_g_object_unref0 (repository);
					_g_object_unref0 (uniq);
					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;
				}
				_tmp39_ = r;
				_tmp40_ = gitg_history_activity_id_for_ref (self, (GgitRef*) _tmp39_);
				id = _tmp40_;
				_tmp42_ = id;
				if (_tmp42_ != NULL) {
					GeeHashSet* _tmp43_;
					const gchar* _tmp44_;
					_tmp43_ = uniq;
					_tmp44_ = name;
					_tmp41_ = gee_abstract_collection_add ((GeeAbstractCollection*) _tmp43_, _tmp44_);
				} else {
					_tmp41_ = FALSE;
				}
				if (_tmp41_) {
					const gchar* _tmp45_;
					gchar* _tmp46_;
					_tmp45_ = name;
					_tmp46_ = g_strdup (_tmp45_);
					_vala_array_add15 (&self->priv->d_mainline, &self->priv->d_mainline_length1, &self->priv->_d_mainline_size_, _tmp46_);
				}
				__vala_GgitOId_free0 (id);
				_g_object_unref0 (r);
				_g_free0 (name);
			}
		}
	}
	_tmp47_ = config;
	_tmp48_ = self->priv->d_mainline;
	_tmp48__length1 = self->priv->d_mainline_length1;
	_tmp49_ = _vala_g_strjoinv (",", _tmp48_, (gint) _tmp48__length1);
	_tmp50_ = _tmp49_;
	gitg_history_activity_store_mainline (self, _tmp47_, _tmp50_);
	_g_free0 (_tmp50_);
	_g_free0 (default_branch);
	ref_names = (_vala_array_free (ref_names, ref_names_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (config);
	_g_object_unref0 (repository);
	_g_object_unref0 (uniq);
}

static Block47Data*
block47_data_ref (Block47Data* _data47_)
{
	g_atomic_int_inc (&_data47_->_ref_count_);
	return _data47_;
}

static void
block47_data_unref (void * _userdata_)
{
	Block47Data* _data47_;
	_data47_ = (Block47Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data47_->_ref_count_)) {
		GitgHistoryActivity* self;
		self = _data47_->self;
		__vala_GtkTreePath_free0 (_data47_->endp);
		__vala_GtkTreePath_free0 (_data47_->startp);
		_g_object_unref0 (_data47_->view);
		_g_object_unref0 (self);
		g_slice_free (Block47Data, _data47_);
	}
}

static void
__lambda111_ (Block47Data* _data47_,
              GtkTreeModel* model,
              GtkTreePath* path,
              GtkTreeIter* iter)
{
	GitgHistoryActivity* self;
	GitgCommit* c = NULL;
	GitgCommitModel* _tmp0_;
	GtkTreeIter _tmp1_;
	GitgCommit* _tmp2_;
	GitgCommit* _tmp3_;
	self = _data47_->self;
	g_return_if_fail (model != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = self->priv->d_commit_list_model;
	_tmp1_ = *iter;
	_tmp2_ = gitg_commit_model_commit_from_iter (_tmp0_, &_tmp1_);
	c = _tmp2_;
	_tmp3_ = c;
	if (_tmp3_ != NULL) {
		GeeHashSet* _tmp4_;
		GitgCommit* _tmp5_;
		GgitOId* _tmp6_;
		GgitOId* _tmp7_;
		gboolean _tmp8_ = FALSE;
		GgitOId* _tmp9_;
		_tmp4_ = self->priv->d_selected;
		_tmp5_ = c;
		_tmp6_ = ggit_object_get_id ((GgitObject*) _tmp5_);
		_tmp7_ = _tmp6_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp7_);
		__vala_GgitOId_free0 (_tmp7_);
		_tmp9_ = self->priv->d_scroll_to;
		if (_tmp9_ == NULL) {
			gboolean _tmp10_ = FALSE;
			if (!_data47_->isvis) {
				_tmp10_ = TRUE;
			} else {
				gboolean _tmp11_ = FALSE;
				if (gtk_tree_path_compare (_data47_->startp, path) <= 0) {
					_tmp11_ = gtk_tree_path_compare (_data47_->endp, path) >= 0;
				} else {
					_tmp11_ = FALSE;
				}
				_tmp10_ = _tmp11_;
			}
			_tmp8_ = _tmp10_;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			GitgCommit* _tmp21_;
			GgitOId* _tmp22_;
			if (_data47_->isvis) {
				GdkRectangle rect = {0};
				GdkRectangle visrect = {0};
				GdkRectangle _tmp12_ = {0};
				GdkRectangle _tmp13_ = {0};
				gint x = 0;
				gint y = 0;
				GdkRectangle _tmp14_;
				GdkRectangle _tmp15_;
				gint _tmp16_ = 0;
				gint _tmp17_ = 0;
				GdkRectangle _tmp18_;
				GdkRectangle _tmp19_;
				GdkRectangle _tmp20_;
				gtk_tree_view_get_cell_area ((GtkTreeView*) _data47_->view, path, NULL, &_tmp12_);
				rect = _tmp12_;
				gtk_tree_view_get_visible_rect ((GtkTreeView*) _data47_->view, &_tmp13_);
				visrect = _tmp13_;
				_tmp14_ = visrect;
				_tmp15_ = visrect;
				gtk_tree_view_convert_tree_to_bin_window_coords ((GtkTreeView*) _data47_->view, _tmp14_.x, _tmp15_.y, &_tmp16_, &_tmp17_);
				x = _tmp16_;
				y = _tmp17_;
				_tmp18_ = rect;
				_tmp19_ = rect;
				_tmp20_ = visrect;
				self->priv->d_scroll_y = ((gfloat) (((_tmp18_.y + (_tmp19_.height / 2.0)) - y) + 2)) / ((gfloat) _tmp20_.height);
			} else {
				self->priv->d_scroll_y = 0.5f;
			}
			_tmp21_ = c;
			_tmp22_ = ggit_object_get_id ((GgitObject*) _tmp21_);
			__vala_GgitOId_free0 (self->priv->d_scroll_to);
			self->priv->d_scroll_to = _tmp22_;
		}
	}
	_g_object_unref0 (c);
}

static void
___lambda111__gtk_tree_selection_foreach_func (GtkTreeModel* model,
                                               GtkTreePath* path,
                                               GtkTreeIter* iter,
                                               gpointer self)
{
	__lambda111_ (self, model, path, iter);
}

static void
__lambda112_ (Block47Data* _data47_,
              GtkAllocation* a)
{
	GitgHistoryActivity* self;
	GitgHistoryPaned* _tmp0_;
	GitgHistoryRefsList* _tmp1_;
	GitgHistoryRefsList* _tmp2_;
	GtkAdjustment* _tmp3_;
	self = _data47_->self;
	g_return_if_fail (a != NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_refs_list (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_list_box_get_adjustment ((GtkListBox*) _tmp2_);
	gtk_adjustment_set_value (_tmp3_, _data47_->vadj);
	if (_data47_->sid != ((gulong) 0)) {
		GitgHistoryPaned* _tmp4_;
		GitgHistoryRefsList* _tmp5_;
		GitgHistoryRefsList* _tmp6_;
		_tmp4_ = self->priv->d_main;
		_tmp5_ = gitg_history_paned_get_refs_list (_tmp4_);
		_tmp6_ = _tmp5_;
		g_signal_handler_disconnect ((GObject*) _tmp6_, _data47_->sid);
	}
}

static void
___lambda112__gtk_widget_size_allocate (GtkWidget* _sender,
                                        GtkAllocation* allocation,
                                        gpointer self)
{
	__lambda112_ (self, allocation);
}

static void
gitg_history_activity_reload (GitgHistoryActivity* self)
{
	Block47Data* _data47_;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GitgCommitListView* _tmp3_;
	GitgHistoryPaned* _tmp4_;
	GitgHistoryRefsList* _tmp5_;
	GitgHistoryRefsList* _tmp6_;
	GtkAdjustment* _tmp7_;
	GeeHashSet* _tmp8_;
	GtkTreePath* _tmp9_ = NULL;
	GtkTreePath* _tmp10_ = NULL;
	gboolean _tmp11_;
	GtkTreeSelection* _tmp12_;
	GitgCommitModel* _tmp13_;
	GitgRepository* _tmp14_;
	GitgRepository* _tmp15_;
	GitgHistoryPaned* _tmp16_;
	GitgHistoryRefsList* _tmp17_;
	GitgHistoryRefsList* _tmp18_;
	GitgRepository* _tmp19_;
	GitgRepository* _tmp20_;
	GitgHistoryPaned* _tmp21_;
	GitgHistoryRefsList* _tmp22_;
	GitgHistoryRefsList* _tmp23_;
	gulong _tmp24_;
	g_return_if_fail (self != NULL);
	_data47_ = g_slice_new0 (Block47Data);
	_data47_->_ref_count_ = 1;
	_data47_->self = g_object_ref (self);
	if (self->priv->d_walker_update_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->d_walker_update_idle_id);
		self->priv->d_walker_update_idle_id = (guint) 0;
	}
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data47_->view = _tmp3_;
	_tmp4_ = self->priv->d_main;
	_tmp5_ = gitg_history_paned_get_refs_list (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gtk_list_box_get_adjustment ((GtkListBox*) _tmp6_);
	_data47_->vadj = gtk_adjustment_get_value (_tmp7_);
	gitg_history_activity_reload_mainline (self);
	_tmp8_ = self->priv->d_selected;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp8_);
	__vala_GgitOId_free0 (self->priv->d_scroll_to);
	self->priv->d_scroll_to = NULL;
	_tmp11_ = gtk_tree_view_get_visible_range ((GtkTreeView*) _data47_->view, &_tmp9_, &_tmp10_);
	__vala_GtkTreePath_free0 (_data47_->startp);
	_data47_->startp = _tmp9_;
	__vala_GtkTreePath_free0 (_data47_->endp);
	_data47_->endp = _tmp10_;
	_data47_->isvis = _tmp11_;
	_tmp12_ = gtk_tree_view_get_selection ((GtkTreeView*) _data47_->view);
	gtk_tree_selection_selected_foreach (_tmp12_, ___lambda111__gtk_tree_selection_foreach_func, _data47_);
	_tmp13_ = self->priv->d_commit_list_model;
	_tmp14_ = gitg_history_activity_get_repository (self);
	_tmp15_ = _tmp14_;
	gitg_commit_model_set_repository (_tmp13_, _tmp15_);
	_tmp16_ = self->priv->d_main;
	_tmp17_ = gitg_history_paned_get_refs_list (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = gitg_history_activity_get_repository (self);
	_tmp20_ = _tmp19_;
	gitg_history_refs_list_set_repository (_tmp18_, _tmp20_);
	_data47_->sid = (gulong) 0;
	_tmp21_ = self->priv->d_main;
	_tmp22_ = gitg_history_paned_get_refs_list (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = g_signal_connect_data ((GtkWidget*) _tmp23_, "size-allocate", (GCallback) ___lambda112__gtk_widget_size_allocate, block47_data_ref (_data47_), (GClosureNotify) block47_data_unref, 0);
	_data47_->sid = _tmp24_;
	block47_data_unref (_data47_);
	_data47_ = NULL;
}

static gboolean
_uint_equal (const guint * s1,
             const guint * s2)
{
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	return (*s1) == (*s2);
}

static gboolean
gitg_history_activity_real_on_key_pressed (GitgExtActivity* base,
                                           GdkEventKey* event)
{
	GitgHistoryActivity * self;
	GdkModifierType mmask = 0U;
	gboolean result;
	self = (GitgHistoryActivity*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	mmask = gtk_accelerator_get_default_mod_mask ();
	if ((mmask & event->state) == GDK_MOD1_MASK) {
		GitgUIElements* _tmp0_;
		GitgUIElements* _tmp1_;
		gint _tmp2_ = 0;
		gpointer* _tmp3_;
		_tmp0_ = gitg_history_activity_get_d_panels (self);
		_tmp1_ = _tmp0_;
		_tmp3_ = gitg_ui_elements_get_available_elements (_tmp1_, &_tmp2_);
		{
			GitgExtHistoryPanel** element_collection = NULL;
			gint element_collection_length1 = 0;
			gint _element_collection_size_ = 0;
			gint element_it = 0;
			element_collection = _tmp3_;
			element_collection_length1 = _tmp2_;
			for (element_it = 0; element_it < element_collection_length1; element_it = element_it + 1) {
				GitgExtHistoryPanel* _tmp4_;
				GitgExtHistoryPanel* element = NULL;
				_tmp4_ = _g_object_ref0 (element_collection[element_it]);
				element = _tmp4_;
				{
					GitgExtHistoryPanel* panel = NULL;
					GitgExtHistoryPanel* _tmp5_;
					GitgExtHistoryPanel* _tmp6_;
					guint* key = NULL;
					GitgExtHistoryPanel* _tmp7_;
					guint* _tmp8_;
					guint* _tmp9_;
					gboolean _tmp10_ = FALSE;
					guint* _tmp11_;
					_tmp5_ = element;
					_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GITG_EXT_TYPE_HISTORY_PANEL, GitgExtHistoryPanel));
					panel = _tmp6_;
					_tmp7_ = panel;
					_tmp8_ = gitg_ext_ui_element_get_shortcut ((GitgExtUIElement*) _tmp7_);
					_tmp9_ = _tmp8_;
					key = _tmp9_;
					_tmp11_ = key;
					if (_tmp11_ != NULL) {
						guint* _tmp12_;
						guint _tmp13_;
						_tmp12_ = key;
						_tmp13_ = gdk_keyval_to_lower (event->keyval);
						_tmp10_ = _uint_equal (_tmp12_, &_tmp13_) == TRUE;
					} else {
						_tmp10_ = FALSE;
					}
					if (_tmp10_) {
						GitgExtHistoryPanel* _tmp14_;
						_tmp14_ = panel;
						g_signal_emit_by_name ((GitgExtUIElement*) _tmp14_, "activate");
						result = TRUE;
						_g_free0 (key);
						_g_object_unref0 (panel);
						_g_object_unref0 (element);
						element_collection = (_vala_array_free (element_collection, element_collection_length1, (GDestroyNotify) g_object_unref), NULL);
						return result;
					}
					_g_free0 (key);
					_g_object_unref0 (panel);
					_g_object_unref0 (element);
				}
			}
			element_collection = (_vala_array_free (element_collection, element_collection_length1, (GDestroyNotify) g_object_unref), NULL);
		}
	}
	result = FALSE;
	return result;
}

static Block48Data*
block48_data_ref (Block48Data* _data48_)
{
	g_atomic_int_inc (&_data48_->_ref_count_);
	return _data48_;
}

static void
block48_data_unref (void * _userdata_)
{
	Block48Data* _data48_;
	_data48_ = (Block48Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data48_->_ref_count_)) {
		GitgHistoryActivity* self;
		self = _data48_->self;
		_g_object_unref0 (_data48_->clip);
		_g_object_unref0 (self);
		g_slice_free (Block48Data, _data48_);
	}
}

static gboolean
__lambda114_ (Block48Data* _data48_,
              GgitCommit* commit)
{
	GitgHistoryActivity* self;
	GgitOId* _tmp0_;
	GgitOId* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean result;
	self = _data48_->self;
	g_return_val_if_fail (commit != NULL, FALSE);
	_tmp0_ = ggit_object_get_id ((GgitObject*) commit);
	_tmp1_ = _tmp0_;
	_tmp2_ = ggit_oid_to_string (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_clipboard_set_text (_data48_->clip, _tmp3_, -1);
	_g_free0 (_tmp3_);
	__vala_GgitOId_free0 (_tmp1_);
	result = FALSE;
	return result;
}

static gboolean
___lambda114__gitg_ext_foreach_commit_selection_func (GgitCommit* object,
                                                      gpointer self)
{
	gboolean result;
	result = __lambda114_ (self, object);
	return result;
}

static void
__lambda113_ (GitgHistoryActivity* self,
              GtkTreeSelection* sel)
{
	Block48Data* _data48_;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GtkWidget* _tmp2_;
	GtkClipboard* _tmp3_;
	GtkClipboard* _tmp4_;
	GtkClipboard* _tmp5_;
	g_return_if_fail (sel != NULL);
	_data48_ = g_slice_new0 (Block48Data);
	_data48_->_ref_count_ = 1;
	_data48_->self = g_object_ref (self);
	g_signal_emit_by_name ((GitgExtHistory*) self, "selection-changed");
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget);
	_tmp3_ = gtk_widget_get_clipboard (_tmp2_, GDK_SELECTION_PRIMARY);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	_data48_->clip = _tmp5_;
	gitg_ext_history_foreach_selected ((GitgExtHistory*) self, ___lambda114__gitg_ext_foreach_commit_selection_func, _data48_);
	block48_data_unref (_data48_);
	_data48_ = NULL;
}

static void
___lambda113__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                          gpointer self)
{
	__lambda113_ ((GitgHistoryActivity*) self, _sender);
}

static void
_gitg_history_activity_on_ref_list_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                             GtkListBoxRow* row,
                                                                             gpointer self)
{
	gitg_history_activity_on_ref_list_row_activated ((GitgHistoryActivity*) self, row);
}

static GtkMenu*
_gitg_history_activity_on_refs_list_populate_menu_gitg_popup_menu_populate_menu (GitgPopupMenu* _sender,
                                                                                 GdkEventButton* event,
                                                                                 gpointer self)
{
	GtkMenu* result;
	result = gitg_history_activity_on_refs_list_populate_menu ((GitgHistoryActivity*) self, event);
	return result;
}

static void
_gitg_history_activity_update_walker_idle_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	gitg_history_activity_update_walker_idle ((GitgHistoryActivity*) self);
}

static void
_gitg_history_activity_update_walker_idle_gitg_history_refs_list_changed (GitgHistoryRefsList* _sender,
                                                                          gpointer self)
{
	gitg_history_activity_update_walker_idle ((GitgHistoryActivity*) self);
}

static GtkMenu*
_gitg_history_activity_on_commit_list_populate_menu_gitg_popup_menu_populate_menu (GitgPopupMenu* _sender,
                                                                                   GdkEventButton* event,
                                                                                   gpointer self)
{
	GtkMenu* result;
	result = gitg_history_activity_on_commit_list_populate_menu ((GitgHistoryActivity*) self, event);
	return result;
}

static GdkRectangle*
_gitg_history_activity_on_commit_list_request_menu_position_gitg_popup_menu_request_menu_position (GitgPopupMenu* _sender,
                                                                                                   gpointer self)
{
	GdkRectangle* result;
	result = gitg_history_activity_on_commit_list_request_menu_position ((GitgHistoryActivity*) self);
	return result;
}

static gboolean
_gitg_history_activity_search_filter_func_gtk_tree_view_search_equal_func (GtkTreeModel* model,
                                                                           gint column,
                                                                           const gchar* key,
                                                                           GtkTreeIter* iter,
                                                                           gpointer self)
{
	gboolean result;
	result = gitg_history_activity_search_filter_func ((GitgHistoryActivity*) self, model, column, key, iter);
	return result;
}

static void
_gitg_history_activity_on_commit_model_begin_clear_gitg_commit_model_begin_clear (GitgCommitModel* _sender,
                                                                                  gpointer self)
{
	gitg_history_activity_on_commit_model_begin_clear ((GitgHistoryActivity*) self, _sender);
}

static void
_gitg_history_activity_on_commit_model_end_clear_gitg_commit_model_end_clear (GitgCommitModel* _sender,
                                                                              gpointer self)
{
	gitg_history_activity_on_commit_model_end_clear ((GitgHistoryActivity*) self, _sender);
}

static void
gitg_history_activity_build_ui (GitgHistoryActivity* self)
{
	GitgHistoryPaned* _tmp0_;
	GitgHistoryPaned* _tmp1_;
	GitgHistoryRefsList* _tmp2_;
	GitgHistoryRefsList* _tmp3_;
	GitgExtApplication* _tmp4_;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgHistoryPaned* _tmp7_;
	GitgCommitListView* _tmp8_;
	GitgCommitListView* _tmp9_;
	GitgCommitModel* _tmp10_;
	GitgHistoryPaned* _tmp11_;
	GitgCommitListView* _tmp12_;
	GitgCommitListView* _tmp13_;
	GtkTreeSelection* _tmp14_;
	GitgHistoryPaned* _tmp15_;
	GitgHistoryRefsList* _tmp16_;
	GitgHistoryRefsList* _tmp17_;
	GitgPluginsEngine* engine = NULL;
	GitgPluginsEngine* _tmp18_;
	PeasExtensionSet* extset = NULL;
	GitgExtApplication* _tmp19_;
	GitgExtApplication* _tmp20_;
	GitgExtApplication* _tmp21_;
	PeasExtensionSet* _tmp22_;
	PeasExtensionSet* _tmp23_;
	GitgHistoryPaned* _tmp24_;
	GtkStack* _tmp25_;
	GtkStack* _tmp26_;
	GitgUIElements* _tmp27_;
	GitgHistoryPaned* _tmp28_;
	GitgHistoryRefsList* _tmp29_;
	GitgHistoryRefsList* _tmp30_;
	GitgPopupMenu* _tmp31_;
	GitgPopupMenu* _tmp32_;
	GitgHistoryPaned* _tmp33_;
	GitgHistoryRefsList* _tmp34_;
	GitgHistoryRefsList* _tmp35_;
	gulong _tmp36_;
	GitgHistoryPaned* _tmp37_;
	GitgHistoryRefsList* _tmp38_;
	GitgHistoryRefsList* _tmp39_;
	gulong _tmp40_;
	GitgHistoryPaned* _tmp41_;
	GitgCommitListView* _tmp42_;
	GitgCommitListView* _tmp43_;
	GitgPopupMenu* _tmp44_;
	GitgPopupMenu* _tmp45_;
	GitgPopupMenu* _tmp46_;
	GitgHistoryPaned* _tmp47_;
	GitgCommitListView* _tmp48_;
	GitgCommitListView* _tmp49_;
	GitgCommitModel* _tmp50_;
	GitgCommitModel* _tmp51_;
	GeeLinkedList* actions = NULL;
	GeeLinkedList* _tmp52_;
	GitgExtApplication* _tmp53_;
	GitgExtApplication* _tmp54_;
	GitgExtApplication* _tmp55_;
	GitgAddRemoteAction* _tmp56_;
	GitgAddRemoteAction* _tmp57_;
	GitgHistoryPaned* _tmp58_;
	GitgHistoryRefsList* _tmp59_;
	GitgHistoryRefsList* _tmp60_;
	GitgExtApplication* _tmp61_;
	GitgExtApplication* _tmp62_;
	GitgExtApplication* _tmp63_;
	GitgHistoryPaned* _tmp64_;
	GitgHistoryRefsList* _tmp65_;
	GitgHistoryRefsList* _tmp66_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gitg_history_paned_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->d_main);
	self->priv->d_main = _tmp0_;
	_tmp1_ = self->priv->d_main;
	_tmp2_ = gitg_history_paned_get_refs_list (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	gitg_history_refs_list_set_application (_tmp3_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = self->priv->d_main;
	_tmp8_ = gitg_history_paned_get_commit_list_view (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->d_commit_list_model;
	gtk_tree_view_set_model ((GtkTreeView*) _tmp9_, (GtkTreeModel*) _tmp10_);
	_tmp11_ = self->priv->d_main;
	_tmp12_ = gitg_history_paned_get_commit_list_view (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp13_);
	g_signal_connect_object (_tmp14_, "changed", (GCallback) ___lambda113__gtk_tree_selection_changed, self, 0);
	_tmp15_ = self->priv->d_main;
	_tmp16_ = gitg_history_paned_get_refs_list (_tmp15_);
	_tmp17_ = _tmp16_;
	g_signal_connect_object ((GtkListBox*) _tmp17_, "row-activated", (GCallback) _gitg_history_activity_on_ref_list_row_activated_gtk_list_box_row_activated, self, 0);
	_tmp18_ = gitg_plugins_engine_get_default ();
	engine = _tmp18_;
	_tmp19_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp20_ = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp22_ = peas_extension_set_new ((PeasEngine*) engine, GITG_EXT_TYPE_HISTORY_PANEL, "history", self, "application", _tmp21_, NULL);
	_tmp23_ = _tmp22_;
	_g_object_unref0 (_tmp21_);
	extset = _tmp23_;
	_tmp24_ = self->priv->d_main;
	_tmp25_ = gitg_history_paned_get_stack_panel (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = gitg_ui_elements_new (GITG_EXT_TYPE_HISTORY_PANEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, extset, _tmp26_);
	_g_object_unref0 (self->priv->_d_panels);
	self->priv->_d_panels = _tmp27_;
	_tmp28_ = self->priv->d_main;
	_tmp29_ = gitg_history_paned_get_refs_list (_tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = gitg_popup_menu_new ((GtkWidget*) _tmp30_);
	_g_object_unref0 (self->priv->d_refs_list_popup);
	self->priv->d_refs_list_popup = _tmp31_;
	_tmp32_ = self->priv->d_refs_list_popup;
	g_signal_connect_object (_tmp32_, "populate-menu", (GCallback) _gitg_history_activity_on_refs_list_populate_menu_gitg_popup_menu_populate_menu, self, 0);
	_tmp33_ = self->priv->d_main;
	_tmp34_ = gitg_history_paned_get_refs_list (_tmp33_);
	_tmp35_ = _tmp34_;
	_tmp36_ = g_signal_connect_object ((GObject*) _tmp35_, "notify::selection", (GCallback) _gitg_history_activity_update_walker_idle_g_object_notify, self, 0);
	self->priv->d_refs_list_selection_id = _tmp36_;
	_tmp37_ = self->priv->d_main;
	_tmp38_ = gitg_history_paned_get_refs_list (_tmp37_);
	_tmp39_ = _tmp38_;
	_tmp40_ = g_signal_connect_object (_tmp39_, "changed", (GCallback) _gitg_history_activity_update_walker_idle_gitg_history_refs_list_changed, self, 0);
	self->priv->d_refs_list_changed_id = _tmp40_;
	_tmp41_ = self->priv->d_main;
	_tmp42_ = gitg_history_paned_get_commit_list_view (_tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = gitg_popup_menu_new ((GtkWidget*) _tmp43_);
	_g_object_unref0 (self->priv->d_commit_list_popup);
	self->priv->d_commit_list_popup = _tmp44_;
	_tmp45_ = self->priv->d_commit_list_popup;
	g_signal_connect_object (_tmp45_, "populate-menu", (GCallback) _gitg_history_activity_on_commit_list_populate_menu_gitg_popup_menu_populate_menu, self, 0);
	_tmp46_ = self->priv->d_commit_list_popup;
	g_signal_connect_object (_tmp46_, "request-menu-position", (GCallback) _gitg_history_activity_on_commit_list_request_menu_position_gitg_popup_menu_request_menu_position, self, 0);
	_tmp47_ = self->priv->d_main;
	_tmp48_ = gitg_history_paned_get_commit_list_view (_tmp47_);
	_tmp49_ = _tmp48_;
	gtk_tree_view_set_search_equal_func ((GtkTreeView*) _tmp49_, _gitg_history_activity_search_filter_func_gtk_tree_view_search_equal_func, g_object_ref (self), g_object_unref);
	_tmp50_ = self->priv->d_commit_list_model;
	g_signal_connect_object (_tmp50_, "begin-clear", (GCallback) _gitg_history_activity_on_commit_model_begin_clear_gitg_commit_model_begin_clear, self, 0);
	_tmp51_ = self->priv->d_commit_list_model;
	g_signal_connect_object (_tmp51_, "end-clear", (GCallback) _gitg_history_activity_on_commit_model_end_clear_gitg_commit_model_end_clear, self, 0);
	_tmp52_ = gee_linked_list_new (GITG_EXT_TYPE_ACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	actions = _tmp52_;
	_tmp53_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp54_ = _tmp53_;
	_tmp55_ = _tmp54_;
	_tmp56_ = gitg_add_remote_action_new (_tmp55_);
	_tmp57_ = _tmp56_;
	gee_abstract_collection_add ((GeeAbstractCollection*) actions, (GitgExtAction*) _tmp57_);
	_g_object_unref0 (_tmp57_);
	_g_object_unref0 (_tmp55_);
	_tmp58_ = self->priv->d_main;
	_tmp59_ = gitg_history_paned_get_refs_list (_tmp58_);
	_tmp60_ = _tmp59_;
	gitg_history_refs_list_set_remotes_actions (_tmp60_, actions);
	_tmp61_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp62_ = _tmp61_;
	_tmp63_ = _tmp62_;
	_tmp64_ = self->priv->d_main;
	_tmp65_ = gitg_history_paned_get_refs_list (_tmp64_);
	_tmp66_ = _tmp65_;
	g_object_bind_property_with_closures ((GObject*) _tmp63_, "repository", (GObject*) _tmp66_, "repository", 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)));
	_g_object_unref0 (_tmp63_);
	_g_object_unref0 (actions);
	_g_object_unref0 (extset);
	_g_object_unref0 (engine);
}

static gboolean
___lambda127_ (GitgHistoryActivity* self)
{
	gboolean result;
	self->priv->d_walker_update_idle_id = (guint) 0;
	gitg_history_activity_update_walker (self);
	result = FALSE;
	return result;
}

static gboolean
____lambda127__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda127_ ((GitgHistoryActivity*) self);
	return result;
}

static void
gitg_history_activity_update_walker_idle (GitgHistoryActivity* self)
{
	GitgRepository* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_repository;
	if (_tmp0_ == NULL) {
		return;
	}
	if (self->priv->d_walker_update_idle_id == ((guint) 0)) {
		self->priv->d_walker_update_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda127__gsource_func, g_object_ref (self), g_object_unref);
	}
}

static GtkMenu*
gitg_history_activity_popup_on_ref (GitgHistoryActivity* self,
                                    GdkEventButton* event)
{
	gint cell_x = 0;
	gint cell_y = 0;
	gint cell_w = 0;
	GtkTreePath* path = NULL;
	GtkTreeViewColumn* column = NULL;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GtkTreePath* _tmp3_ = NULL;
	GtkTreeViewColumn* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gboolean _tmp7_;
	GtkTreeViewColumn* _tmp8_;
	GitgCellRendererLanes* cell = NULL;
	GitgHistoryPaned* _tmp9_;
	GitgCommitListView* _tmp10_;
	GitgCommitListView* _tmp11_;
	GtkTreeViewColumn* _tmp12_;
	GtkTreePath* _tmp13_;
	gint _tmp14_ = 0;
	GtkCellRenderer* _tmp15_;
	GitgCellRendererLanes* _tmp16_;
	GitgCellRendererLanes* _tmp17_;
	GitgRef* reference = NULL;
	GitgCellRendererLanes* _tmp18_;
	GitgHistoryPaned* _tmp19_;
	GitgCommitListView* _tmp20_;
	GitgCommitListView* _tmp21_;
	GitgRef* _tmp22_;
	GitgRef* _tmp23_;
	GitgRef* _tmp24_;
	GtkMenu* _tmp25_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (event == NULL) {
		result = NULL;
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp7_ = gtk_tree_view_get_path_at_pos ((GtkTreeView*) _tmp2_, (gint) event->x, (gint) event->y, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
	__vala_GtkTreePath_free0 (path);
	path = _tmp3_;
	_g_object_unref0 (column);
	_tmp8_ = _g_object_ref0 (_tmp4_);
	column = _tmp8_;
	cell_x = _tmp5_;
	cell_y = _tmp6_;
	if (!_tmp7_) {
		result = NULL;
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp9_ = self->priv->d_main;
	_tmp10_ = gitg_history_paned_get_commit_list_view (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = column;
	_tmp13_ = path;
	_tmp15_ = gitg_commit_list_view_find_cell_at_pos (_tmp11_, _tmp12_, _tmp13_, cell_x, &_tmp14_);
	cell_w = _tmp14_;
	_tmp16_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GITG_TYPE_CELL_RENDERER_LANES) ? ((GitgCellRendererLanes*) _tmp15_) : NULL;
	if (_tmp16_ == NULL) {
		_g_object_unref0 (_tmp15_);
	}
	cell = _tmp16_;
	_tmp17_ = cell;
	if (_tmp17_ == NULL) {
		result = NULL;
		_g_object_unref0 (cell);
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp18_ = cell;
	_tmp19_ = self->priv->d_main;
	_tmp20_ = gitg_history_paned_get_commit_list_view (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = gitg_cell_renderer_lanes_get_ref_at_pos (_tmp18_, (GtkWidget*) _tmp21_, cell_x, cell_w, NULL);
	reference = _tmp22_;
	_tmp23_ = reference;
	if (_tmp23_ == NULL) {
		result = NULL;
		_g_object_unref0 (reference);
		_g_object_unref0 (cell);
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp24_ = reference;
	_tmp25_ = gitg_history_activity_popup_menu_for_ref (self, _tmp24_);
	result = _tmp25_;
	_g_object_unref0 (reference);
	_g_object_unref0 (cell);
	_g_object_unref0 (column);
	__vala_GtkTreePath_free0 (path);
	return result;
}

static GtkMenu*
gitg_history_activity_on_commit_list_populate_menu (GitgHistoryActivity* self,
                                                    GdkEventButton* event)
{
	GtkMenu* ret = NULL;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	GtkMenu* _tmp3_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gitg_history_activity_popup_on_ref (self, event);
	ret = _tmp0_;
	_tmp1_ = ret;
	if (_tmp1_ == NULL) {
		GtkMenu* _tmp2_;
		_tmp2_ = gitg_history_activity_popup_menu_for_commit (self, event);
		_g_object_unref0 (ret);
		ret = _tmp2_;
	}
	_tmp3_ = ret;
	if (_tmp3_ == NULL) {
		GtkMenu* _tmp4_;
		_tmp4_ = gitg_history_activity_popup_menu_for_selection (self);
		_g_object_unref0 (ret);
		ret = _tmp4_;
	}
	result = ret;
	return result;
}

static GdkRectangle*
_vala_GdkRectangle_copy (GdkRectangle* self)
{
	return g_boxed_copy (gdk_rectangle_get_type (), self);
}

static gpointer
__vala_GdkRectangle_copy0 (gpointer self)
{
	return self ? _vala_GdkRectangle_copy (self) : NULL;
}

static GdkRectangle*
gitg_history_activity_on_commit_list_request_menu_position (GitgHistoryActivity* self)
{
	GtkTreeSelection* selection = NULL;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GtkTreeSelection* _tmp3_;
	GtkTreeSelection* _tmp4_;
	GtkTreeModel* model = NULL;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp5_;
	GtkTreeModel* _tmp6_ = NULL;
	GtkTreeIter _tmp7_ = {0};
	gboolean _tmp8_;
	GtkTreeModel* _tmp9_;
	GtkTreePath* path = NULL;
	GtkTreeModel* _tmp10_;
	GtkTreeIter _tmp11_;
	GtkTreePath* _tmp12_;
	GdkRectangle rect = {0};
	GdkRectangle _tmp13_ = {0};
	GitgHistoryPaned* _tmp14_;
	GitgCommitListView* _tmp15_;
	GitgCommitListView* _tmp16_;
	GtkTreePath* _tmp17_;
	GdkRectangle _tmp18_ = {0};
	GitgHistoryPaned* _tmp19_;
	GitgCommitListView* _tmp20_;
	GitgCommitListView* _tmp21_;
	GdkRectangle _tmp22_;
	GdkRectangle _tmp23_;
	gint _tmp24_ = 0;
	gint _tmp25_ = 0;
	GdkRectangle* _tmp26_;
	GdkRectangle* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	selection = _tmp4_;
	_tmp5_ = selection;
	_tmp8_ = gtk_tree_selection_get_selected (_tmp5_, &_tmp6_, &_tmp7_);
	_g_object_unref0 (model);
	_tmp9_ = _g_object_ref0 (_tmp6_);
	model = _tmp9_;
	iter = _tmp7_;
	if (!_tmp8_) {
		result = NULL;
		_g_object_unref0 (model);
		_g_object_unref0 (selection);
		return result;
	}
	_tmp10_ = model;
	_tmp11_ = iter;
	_tmp12_ = gtk_tree_model_get_path (_tmp10_, &_tmp11_);
	path = _tmp12_;
	_tmp13_.x = 0;
	rect = _tmp13_;
	_tmp14_ = self->priv->d_main;
	_tmp15_ = gitg_history_paned_get_commit_list_view (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = path;
	gtk_tree_view_get_cell_area ((GtkTreeView*) _tmp16_, _tmp17_, NULL, &_tmp18_);
	rect = _tmp18_;
	_tmp19_ = self->priv->d_main;
	_tmp20_ = gitg_history_paned_get_commit_list_view (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = rect;
	_tmp23_ = rect;
	gtk_tree_view_convert_bin_window_to_widget_coords ((GtkTreeView*) _tmp21_, _tmp22_.x, _tmp23_.y, &_tmp24_, &_tmp25_);
	rect.x = _tmp24_;
	rect.y = _tmp25_;
	_tmp26_ = __vala_GdkRectangle_copy0 (&rect);
	result = _tmp26_;
	__vala_GtkTreePath_free0 (path);
	_g_object_unref0 (model);
	_g_object_unref0 (selection);
	return result;
}

static void
gitg_history_activity_add_ref_action (GitgHistoryActivity* self,
                                      GeeLinkedList* actions,
                                      GitgExtRefAction* action)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (actions != NULL);
	if (action != NULL) {
		gboolean _tmp1_;
		gboolean _tmp2_;
		_tmp1_ = gitg_ext_ui_element_get_available ((GitgExtUIElement*) action);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gee_abstract_collection_add ((GeeAbstractCollection*) actions, action);
	}
}

static Block49Data*
block49_data_ref (Block49Data* _data49_)
{
	g_atomic_int_inc (&_data49_->_ref_count_);
	return _data49_;
}

static void
block49_data_unref (void * _userdata_)
{
	Block49Data* _data49_;
	_data49_ = (Block49Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data49_->_ref_count_)) {
		GitgHistoryActivity* self;
		self = _data49_->self;
		_g_object_unref0 (_data49_->actions);
		_g_object_unref0 (self);
		g_slice_free (Block49Data, _data49_);
	}
}

static void
__lambda128_ (GitgHistoryActivity* self)
{
	self->priv->d_ignore_external = TRUE;
}

static void
___lambda128__gitg_history_action_interface_updated (GitgHistoryActionInterface* _sender,
                                                     gpointer self)
{
	__lambda128_ ((GitgHistoryActivity*) self);
}

static void
__lambda129_ (Block49Data* _data49_,
              PeasExtensionSet* extset,
              PeasPluginInfo* info,
              PeasExtension* extension)
{
	GitgHistoryActivity* self;
	GeeLinkedList* _tmp0_;
	self = _data49_->self;
	g_return_if_fail (extset != NULL);
	g_return_if_fail (info != NULL);
	g_return_if_fail (extension != NULL);
	_tmp0_ = _data49_->actions;
	gitg_history_activity_add_commit_action (self, _tmp0_, G_TYPE_CHECK_INSTANCE_TYPE (extension, GITG_EXT_TYPE_COMMIT_ACTION) ? ((GitgExtCommitAction*) extension) : NULL);
}

static void
___lambda129__peas_extension_set_foreach_func (PeasExtensionSet* set,
                                               PeasPluginInfo* info,
                                               PeasExtension* exten,
                                               gpointer self)
{
	__lambda129_ (self, set, info, exten);
}

static GtkMenu*
gitg_history_activity_populate_menu_for_commit (GitgHistoryActivity* self,
                                                GitgCommit* commit)
{
	Block49Data* _data49_;
	GitgHistoryActionInterface* af = NULL;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	GitgExtApplication* _tmp2_;
	GitgHistoryPaned* _tmp3_;
	GitgHistoryRefsList* _tmp4_;
	GitgHistoryRefsList* _tmp5_;
	GitgHistoryActionInterface* _tmp6_;
	GitgHistoryActionInterface* _tmp7_;
	GitgHistoryActionInterface* _tmp8_;
	GeeLinkedList* _tmp9_;
	GeeLinkedList* _tmp10_;
	GitgExtApplication* _tmp11_;
	GitgExtApplication* _tmp12_;
	GitgExtApplication* _tmp13_;
	GitgHistoryActionInterface* _tmp14_;
	GitgCommitActionCreateBranch* _tmp15_;
	GitgCommitActionCreateBranch* _tmp16_;
	GeeLinkedList* _tmp17_;
	GitgExtApplication* _tmp18_;
	GitgExtApplication* _tmp19_;
	GitgExtApplication* _tmp20_;
	GitgHistoryActionInterface* _tmp21_;
	GitgCommitActionCreateTag* _tmp22_;
	GitgCommitActionCreateTag* _tmp23_;
	GeeLinkedList* _tmp24_;
	GitgExtApplication* _tmp25_;
	GitgExtApplication* _tmp26_;
	GitgExtApplication* _tmp27_;
	GitgHistoryActionInterface* _tmp28_;
	GitgCommitActionCreatePatch* _tmp29_;
	GitgCommitActionCreatePatch* _tmp30_;
	GeeLinkedList* _tmp31_;
	GitgExtApplication* _tmp32_;
	GitgExtApplication* _tmp33_;
	GitgExtApplication* _tmp34_;
	GitgHistoryActionInterface* _tmp35_;
	GitgCommitActionCherryPick* _tmp36_;
	GitgCommitActionCherryPick* _tmp37_;
	PeasExtensionSet* exts = NULL;
	GitgPluginsEngine* _tmp38_;
	GitgPluginsEngine* _tmp39_;
	GitgExtApplication* _tmp40_;
	GitgExtApplication* _tmp41_;
	GitgExtApplication* _tmp42_;
	GitgHistoryActionInterface* _tmp43_;
	PeasExtensionSet* _tmp44_;
	PeasExtensionSet* _tmp45_;
	PeasExtensionSet* _tmp46_;
	GeeLinkedList* _tmp47_;
	gint _tmp48_;
	gint _tmp49_;
	GtkMenu* menu = NULL;
	GtkMenu* _tmp50_;
	GtkMenu* _tmp61_;
	GeeLinkedList* _tmp62_;
	GeeLinkedList* _tmp63_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (commit != NULL, NULL);
	_data49_ = g_slice_new0 (Block49Data);
	_data49_->_ref_count_ = 1;
	_data49_->self = g_object_ref (self);
	_tmp0_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->d_main;
	_tmp4_ = gitg_history_paned_get_refs_list (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = gitg_history_action_interface_new (_tmp2_, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (_tmp2_);
	af = _tmp7_;
	_tmp8_ = af;
	g_signal_connect_object (_tmp8_, "updated", (GCallback) ___lambda128__gitg_history_action_interface_updated, self, 0);
	_tmp9_ = gee_linked_list_new (GITG_EXT_TYPE_COMMIT_ACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data49_->actions = _tmp9_;
	_tmp10_ = _data49_->actions;
	_tmp11_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp14_ = af;
	_tmp15_ = gitg_commit_action_create_branch_new (_tmp13_, (GitgExtRefActionInterface*) _tmp14_, commit);
	_tmp16_ = _tmp15_;
	gitg_history_activity_add_commit_action (self, _tmp10_, (GitgExtCommitAction*) _tmp16_);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (_tmp13_);
	_tmp17_ = _data49_->actions;
	_tmp18_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp19_ = _tmp18_;
	_tmp20_ = _tmp19_;
	_tmp21_ = af;
	_tmp22_ = gitg_commit_action_create_tag_new (_tmp20_, (GitgExtRefActionInterface*) _tmp21_, commit);
	_tmp23_ = _tmp22_;
	gitg_history_activity_add_commit_action (self, _tmp17_, (GitgExtCommitAction*) _tmp23_);
	_g_object_unref0 (_tmp23_);
	_g_object_unref0 (_tmp20_);
	_tmp24_ = _data49_->actions;
	_tmp25_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp26_ = _tmp25_;
	_tmp27_ = _tmp26_;
	_tmp28_ = af;
	_tmp29_ = gitg_commit_action_create_patch_new (_tmp27_, (GitgExtRefActionInterface*) _tmp28_, commit);
	_tmp30_ = _tmp29_;
	gitg_history_activity_add_commit_action (self, _tmp24_, (GitgExtCommitAction*) _tmp30_);
	_g_object_unref0 (_tmp30_);
	_g_object_unref0 (_tmp27_);
	_tmp31_ = _data49_->actions;
	_tmp32_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp33_ = _tmp32_;
	_tmp34_ = _tmp33_;
	_tmp35_ = af;
	_tmp36_ = gitg_commit_action_cherry_pick_new (_tmp34_, (GitgExtRefActionInterface*) _tmp35_, commit);
	_tmp37_ = _tmp36_;
	gitg_history_activity_add_commit_action (self, _tmp31_, (GitgExtCommitAction*) _tmp37_);
	_g_object_unref0 (_tmp37_);
	_g_object_unref0 (_tmp34_);
	_tmp38_ = gitg_plugins_engine_get_default ();
	_tmp39_ = _tmp38_;
	_tmp40_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp41_ = _tmp40_;
	_tmp42_ = _tmp41_;
	_tmp43_ = af;
	_tmp44_ = peas_extension_set_new ((PeasEngine*) _tmp39_, GITG_EXT_TYPE_COMMIT_ACTION, "application", _tmp42_, "action_interface", _tmp43_, "commit", commit, NULL);
	_tmp45_ = _tmp44_;
	_g_object_unref0 (_tmp42_);
	_g_object_unref0 (_tmp39_);
	exts = _tmp45_;
	_tmp46_ = exts;
	peas_extension_set_foreach (_tmp46_, ___lambda129__peas_extension_set_foreach_func, _data49_);
	_tmp47_ = _data49_->actions;
	_tmp48_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp47_);
	_tmp49_ = _tmp48_;
	if (_tmp49_ == 0) {
		result = NULL;
		_g_object_unref0 (exts);
		_g_object_unref0 (af);
		block49_data_unref (_data49_);
		_data49_ = NULL;
		return result;
	}
	_tmp50_ = (GtkMenu*) gtk_menu_new ();
	g_object_ref_sink (_tmp50_);
	menu = _tmp50_;
	{
		GeeLinkedList* _ac_list = NULL;
		GeeLinkedList* _tmp51_;
		gint _ac_size = 0;
		GeeLinkedList* _tmp52_;
		gint _tmp53_;
		gint _tmp54_;
		gint _ac_index = 0;
		_tmp51_ = _data49_->actions;
		_ac_list = _tmp51_;
		_tmp52_ = _ac_list;
		_tmp53_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp52_);
		_tmp54_ = _tmp53_;
		_ac_size = _tmp54_;
		_ac_index = -1;
		while (TRUE) {
			gint _tmp55_;
			gint _tmp56_;
			GitgExtCommitAction* ac = NULL;
			GeeLinkedList* _tmp57_;
			gpointer _tmp58_;
			GitgExtCommitAction* _tmp59_;
			GtkMenu* _tmp60_;
			_ac_index = _ac_index + 1;
			_tmp55_ = _ac_index;
			_tmp56_ = _ac_size;
			if (!(_tmp55_ < _tmp56_)) {
				break;
			}
			_tmp57_ = _ac_list;
			_tmp58_ = gee_abstract_list_get ((GeeAbstractList*) _tmp57_, _ac_index);
			ac = (GitgExtCommitAction*) _tmp58_;
			_tmp59_ = ac;
			_tmp60_ = menu;
			gitg_ext_action_populate_menu ((GitgExtAction*) _tmp59_, _tmp60_);
			_g_object_unref0 (ac);
		}
	}
	_tmp61_ = menu;
	_tmp62_ = _data49_->actions;
	_tmp63_ = _g_object_ref0 (_tmp62_);
	g_object_set_data_full ((GObject*) _tmp61_, "gitg-ext-actions", _tmp63_, g_object_unref);
	result = menu;
	_g_object_unref0 (exts);
	_g_object_unref0 (af);
	block49_data_unref (_data49_);
	_data49_ = NULL;
	return result;
}

static GtkMenu*
gitg_history_activity_popup_menu_for_selection (GitgHistoryActivity* self)
{
	GtkTreeSelection* selection = NULL;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GtkTreeSelection* _tmp3_;
	GtkTreeSelection* _tmp4_;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp5_;
	GtkTreeIter _tmp6_ = {0};
	gboolean _tmp7_;
	GitgCommit* commit = NULL;
	GitgCommitModel* _tmp8_;
	GtkTreeIter _tmp9_;
	GitgCommit* _tmp10_;
	GitgCommit* _tmp11_;
	GitgCommit* _tmp12_;
	GtkMenu* _tmp13_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	selection = _tmp4_;
	_tmp5_ = selection;
	_tmp7_ = gtk_tree_selection_get_selected (_tmp5_, NULL, &_tmp6_);
	iter = _tmp6_;
	if (!_tmp7_) {
		result = NULL;
		_g_object_unref0 (selection);
		return result;
	}
	_tmp8_ = self->priv->d_commit_list_model;
	_tmp9_ = iter;
	_tmp10_ = gitg_commit_model_commit_from_iter (_tmp8_, &_tmp9_);
	commit = _tmp10_;
	_tmp11_ = commit;
	if (_tmp11_ == NULL) {
		result = NULL;
		_g_object_unref0 (commit);
		_g_object_unref0 (selection);
		return result;
	}
	_tmp12_ = commit;
	_tmp13_ = gitg_history_activity_populate_menu_for_commit (self, _tmp12_);
	result = _tmp13_;
	_g_object_unref0 (commit);
	_g_object_unref0 (selection);
	return result;
}

static GtkMenu*
gitg_history_activity_popup_menu_for_commit (GitgHistoryActivity* self,
                                             GdkEventButton* event)
{
	gint cell_x = 0;
	gint cell_y = 0;
	GtkTreePath* path = NULL;
	GtkTreeViewColumn* column = NULL;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	GtkTreePath* _tmp3_ = NULL;
	GtkTreeViewColumn* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gboolean _tmp7_;
	GtkTreeViewColumn* _tmp8_;
	GitgCommit* commit = NULL;
	GitgCommitModel* _tmp9_;
	GtkTreePath* _tmp10_;
	GitgCommit* _tmp11_;
	GitgCommit* _tmp12_;
	GitgHistoryPaned* _tmp13_;
	GitgCommitListView* _tmp14_;
	GitgCommitListView* _tmp15_;
	GtkTreeSelection* _tmp16_;
	GtkTreePath* _tmp17_;
	GitgCommit* _tmp18_;
	GtkMenu* _tmp19_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (event == NULL) {
		result = NULL;
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp7_ = gtk_tree_view_get_path_at_pos ((GtkTreeView*) _tmp2_, (gint) event->x, (gint) event->y, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
	__vala_GtkTreePath_free0 (path);
	path = _tmp3_;
	_g_object_unref0 (column);
	_tmp8_ = _g_object_ref0 (_tmp4_);
	column = _tmp8_;
	cell_x = _tmp5_;
	cell_y = _tmp6_;
	if (!_tmp7_) {
		result = NULL;
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp9_ = self->priv->d_commit_list_model;
	_tmp10_ = path;
	_tmp11_ = gitg_commit_model_commit_from_path (_tmp9_, _tmp10_);
	commit = _tmp11_;
	_tmp12_ = commit;
	if (_tmp12_ == NULL) {
		result = NULL;
		_g_object_unref0 (commit);
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp13_ = self->priv->d_main;
	_tmp14_ = gitg_history_paned_get_commit_list_view (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = gtk_tree_view_get_selection ((GtkTreeView*) _tmp15_);
	_tmp17_ = path;
	gtk_tree_selection_select_path (_tmp16_, _tmp17_);
	_tmp18_ = commit;
	_tmp19_ = gitg_history_activity_populate_menu_for_commit (self, _tmp18_);
	result = _tmp19_;
	_g_object_unref0 (commit);
	_g_object_unref0 (column);
	__vala_GtkTreePath_free0 (path);
	return result;
}

static Block50Data*
block50_data_ref (Block50Data* _data50_)
{
	g_atomic_int_inc (&_data50_->_ref_count_);
	return _data50_;
}

static void
block50_data_unref (void * _userdata_)
{
	Block50Data* _data50_;
	_data50_ = (Block50Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data50_->_ref_count_)) {
		GitgHistoryActivity* self;
		self = _data50_->self;
		_g_object_unref0 (_data50_->item);
		_g_object_unref0 (_data50_->actions);
		_g_object_unref0 (_data50_->reference);
		_g_object_unref0 (self);
		g_slice_free (Block50Data, _data50_);
	}
}

static void
__lambda115_ (GitgHistoryActivity* self)
{
	self->priv->d_ignore_external = TRUE;
}

static void
___lambda115__gitg_history_action_interface_updated (GitgHistoryActionInterface* _sender,
                                                     gpointer self)
{
	__lambda115_ ((GitgHistoryActivity*) self);
}

static void
__lambda125_ (Block50Data* _data50_,
              PeasExtensionSet* extset,
              PeasPluginInfo* info,
              PeasExtension* extension)
{
	GitgHistoryActivity* self;
	GeeLinkedList* _tmp1_;
	self = _data50_->self;
	g_return_if_fail (extset != NULL);
	g_return_if_fail (info != NULL);
	g_return_if_fail (extension != NULL);
	if (!_data50_->addedsep) {
		GeeLinkedList* _tmp0_;
		_tmp0_ = _data50_->actions;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, NULL);
		_data50_->addedsep = TRUE;
	}
	_tmp1_ = _data50_->actions;
	gitg_history_activity_add_ref_action (self, _tmp1_, G_TYPE_CHECK_INSTANCE_TYPE (extension, GITG_EXT_TYPE_REF_ACTION) ? ((GitgExtRefAction*) extension) : NULL);
}

static void
___lambda125__peas_extension_set_foreach_func (PeasExtensionSet* set,
                                               PeasPluginInfo* info,
                                               PeasExtension* exten,
                                               gpointer self)
{
	__lambda125_ (self, set, info, exten);
}

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

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

static gchar**
_vala_array_dup17 (gchar** self,
                   gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
__lambda126_ (Block50Data* _data50_)
{
	GitgHistoryActivity* self;
	GtkCheckMenuItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data50_->self;
	_tmp0_ = _data50_->item;
	_tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = ggit_ref_get_name ((GgitRef*) _data50_->reference);
		_tmp4_ = g_strdup (_tmp3_);
		_vala_array_add16 (&self->priv->d_mainline, &self->priv->d_mainline_length1, &self->priv->_d_mainline_size_, _tmp4_);
	} else {
		gchar** nml = NULL;
		gchar** _tmp5_;
		gint _tmp5__length1;
		gchar** _tmp6_;
		gint nml_length1;
		gint _nml_size_;
		gchar** _tmp13_;
		gint _tmp13__length1;
		gchar** _tmp14_;
		gint _tmp14__length1;
		_tmp5_ = self->priv->d_mainline;
		_tmp5__length1 = self->priv->d_mainline_length1;
		_tmp6_ = g_new0 (gchar*, (_tmp5__length1 - 1) + 1);
		nml = _tmp6_;
		nml_length1 = _tmp5__length1 - 1;
		_nml_size_ = nml_length1;
		nml_length1 = 0;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp7_ = FALSE;
				_tmp7_ = TRUE;
				while (TRUE) {
					gchar** _tmp9_;
					gint _tmp9__length1;
					if (!_tmp7_) {
						gint _tmp8_;
						_tmp8_ = i;
						i = _tmp8_ + 1;
					}
					_tmp7_ = FALSE;
					_tmp9_ = self->priv->d_mainline;
					_tmp9__length1 = self->priv->d_mainline_length1;
					if (!(i < _tmp9__length1)) {
						break;
					}
					if (i != _data50_->pos) {
						gchar** _tmp10_;
						gint _tmp10__length1;
						const gchar* _tmp11_;
						gchar* _tmp12_;
						_tmp10_ = self->priv->d_mainline;
						_tmp10__length1 = self->priv->d_mainline_length1;
						_tmp11_ = _tmp10_[i];
						_tmp12_ = g_strdup (_tmp11_);
						_vala_array_add17 (&nml, &nml_length1, &_nml_size_, _tmp12_);
					}
				}
			}
		}
		_tmp13_ = nml;
		_tmp13__length1 = nml_length1;
		_tmp14_ = (_tmp13_ != NULL) ? _vala_array_dup17 (_tmp13_, _tmp13__length1) : _tmp13_;
		_tmp14__length1 = _tmp13__length1;
		self->priv->d_mainline = (_vala_array_free (self->priv->d_mainline, self->priv->d_mainline_length1, (GDestroyNotify) g_free), NULL);
		self->priv->d_mainline = _tmp14_;
		self->priv->d_mainline_length1 = _tmp14__length1;
		self->priv->_d_mainline_size_ = self->priv->d_mainline_length1;
		nml = (_vala_array_free (nml, nml_length1, (GDestroyNotify) g_free), NULL);
	}
	gitg_history_activity_store_changed_mainline (self);
	gitg_history_activity_update_walker (self);
}

static void
___lambda126__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	__lambda126_ (self);
}

static GtkMenu*
gitg_history_activity_popup_menu_for_ref (GitgHistoryActivity* self,
                                          GitgRef* reference)
{
	Block50Data* _data50_;
	GitgRef* _tmp0_;
	GeeLinkedList* _tmp1_;
	GitgHistoryActionInterface* af = NULL;
	GitgExtApplication* _tmp2_;
	GitgExtApplication* _tmp3_;
	GitgExtApplication* _tmp4_;
	GitgHistoryPaned* _tmp5_;
	GitgHistoryRefsList* _tmp6_;
	GitgHistoryRefsList* _tmp7_;
	GitgHistoryActionInterface* _tmp8_;
	GitgHistoryActionInterface* _tmp9_;
	GitgHistoryActionInterface* _tmp10_;
	GeeLinkedList* _tmp11_;
	GitgExtApplication* _tmp12_;
	GitgExtApplication* _tmp13_;
	GitgExtApplication* _tmp14_;
	GitgHistoryActionInterface* _tmp15_;
	GitgRefActionCreateBranch* _tmp16_;
	GitgRefActionCreateBranch* _tmp17_;
	GeeLinkedList* _tmp18_;
	GitgExtApplication* _tmp19_;
	GitgExtApplication* _tmp20_;
	GitgExtApplication* _tmp21_;
	GitgHistoryActionInterface* _tmp22_;
	GitgRefActionCreateTag* _tmp23_;
	GitgRefActionCreateTag* _tmp24_;
	GeeLinkedList* _tmp25_;
	GitgExtApplication* _tmp26_;
	GitgExtApplication* _tmp27_;
	GitgExtApplication* _tmp28_;
	GitgHistoryActionInterface* _tmp29_;
	GitgRefActionCreatePatch* _tmp30_;
	GitgRefActionCreatePatch* _tmp31_;
	GeeLinkedList* _tmp32_;
	GitgExtApplication* _tmp33_;
	GitgExtApplication* _tmp34_;
	GitgExtApplication* _tmp35_;
	GitgHistoryActionInterface* _tmp36_;
	GitgRefActionCheckout* _tmp37_;
	GitgRefActionCheckout* _tmp38_;
	GeeLinkedList* _tmp39_;
	GitgExtApplication* _tmp40_;
	GitgExtApplication* _tmp41_;
	GitgExtApplication* _tmp42_;
	GitgHistoryActionInterface* _tmp43_;
	GitgRefActionRename* _tmp44_;
	GitgRefActionRename* _tmp45_;
	GeeLinkedList* _tmp46_;
	GitgExtApplication* _tmp47_;
	GitgExtApplication* _tmp48_;
	GitgExtApplication* _tmp49_;
	GitgHistoryActionInterface* _tmp50_;
	GitgRefActionDelete* _tmp51_;
	GitgRefActionDelete* _tmp52_;
	GeeLinkedList* _tmp53_;
	GitgExtApplication* _tmp54_;
	GitgExtApplication* _tmp55_;
	GitgExtApplication* _tmp56_;
	GitgHistoryActionInterface* _tmp57_;
	GitgRefActionCopyName* _tmp58_;
	GitgRefActionCopyName* _tmp59_;
	GitgRefActionFetch* fetch = NULL;
	GitgExtApplication* _tmp60_;
	GitgExtApplication* _tmp61_;
	GitgExtApplication* _tmp62_;
	GitgHistoryActionInterface* _tmp63_;
	GitgRefActionFetch* _tmp64_;
	GitgRefActionFetch* _tmp65_;
	GitgRefActionFetch* _tmp66_;
	gboolean _tmp67_;
	gboolean _tmp68_;
	GeeLinkedList* _tmp70_;
	GitgRefActionFetch* _tmp71_;
	GitgRefActionPush* push = NULL;
	GitgExtApplication* _tmp72_;
	GitgExtApplication* _tmp73_;
	GitgExtApplication* _tmp74_;
	GitgHistoryActionInterface* _tmp75_;
	GitgRefActionPush* _tmp76_;
	GitgRefActionPush* _tmp77_;
	GitgRefActionPush* _tmp78_;
	gboolean _tmp79_;
	gboolean _tmp80_;
	GeeLinkedList* _tmp82_;
	GitgRefActionPush* _tmp83_;
	GitgRefActionMerge* merge = NULL;
	GitgExtApplication* _tmp84_;
	GitgExtApplication* _tmp85_;
	GitgExtApplication* _tmp86_;
	GitgHistoryActionInterface* _tmp87_;
	GitgRefActionMerge* _tmp88_;
	GitgRefActionMerge* _tmp89_;
	GitgRefActionMerge* _tmp90_;
	gboolean _tmp91_;
	gboolean _tmp92_;
	PeasExtensionSet* exts = NULL;
	GitgPluginsEngine* _tmp96_;
	GitgPluginsEngine* _tmp97_;
	GitgExtApplication* _tmp98_;
	GitgExtApplication* _tmp99_;
	GitgExtApplication* _tmp100_;
	GitgHistoryActionInterface* _tmp101_;
	PeasExtensionSet* _tmp102_;
	PeasExtensionSet* _tmp103_;
	PeasExtensionSet* _tmp104_;
	GeeLinkedList* _tmp105_;
	gboolean _tmp106_;
	gboolean _tmp107_;
	GtkMenu* menu = NULL;
	GtkMenu* _tmp108_;
	GtkSeparatorMenuItem* sep = NULL;
	GtkSeparatorMenuItem* _tmp124_;
	GtkSeparatorMenuItem* _tmp125_;
	GtkMenu* _tmp126_;
	GtkSeparatorMenuItem* _tmp127_;
	GtkCheckMenuItem* _tmp128_;
	gchar** _tmp129_;
	gint _tmp129__length1;
	GtkCheckMenuItem* _tmp135_;
	GtkCheckMenuItem* _tmp136_;
	GtkMenu* _tmp137_;
	GtkCheckMenuItem* _tmp138_;
	GtkMenu* _tmp139_;
	GeeLinkedList* _tmp140_;
	GeeLinkedList* _tmp141_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (reference != NULL, NULL);
	_data50_ = g_slice_new0 (Block50Data);
	_data50_->_ref_count_ = 1;
	_data50_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (reference);
	_g_object_unref0 (_data50_->reference);
	_data50_->reference = _tmp0_;
	_tmp1_ = gee_linked_list_new (GITG_EXT_TYPE_REF_ACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data50_->actions = _tmp1_;
	_tmp2_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->d_main;
	_tmp6_ = gitg_history_paned_get_refs_list (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = gitg_history_action_interface_new (_tmp4_, _tmp7_);
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp4_);
	af = _tmp9_;
	_tmp10_ = af;
	g_signal_connect_object (_tmp10_, "updated", (GCallback) ___lambda115__gitg_history_action_interface_updated, self, 0);
	_tmp11_ = _data50_->actions;
	_tmp12_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_;
	_tmp15_ = af;
	_tmp16_ = gitg_ref_action_create_branch_new (_tmp14_, (GitgExtRefActionInterface*) _tmp15_, _data50_->reference);
	_tmp17_ = _tmp16_;
	gitg_history_activity_add_ref_action (self, _tmp11_, (GitgExtRefAction*) _tmp17_);
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp14_);
	_tmp18_ = _data50_->actions;
	_tmp19_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp20_ = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp22_ = af;
	_tmp23_ = gitg_ref_action_create_tag_new (_tmp21_, (GitgExtRefActionInterface*) _tmp22_, _data50_->reference);
	_tmp24_ = _tmp23_;
	gitg_history_activity_add_ref_action (self, _tmp18_, (GitgExtRefAction*) _tmp24_);
	_g_object_unref0 (_tmp24_);
	_g_object_unref0 (_tmp21_);
	_tmp25_ = _data50_->actions;
	_tmp26_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = _tmp27_;
	_tmp29_ = af;
	_tmp30_ = gitg_ref_action_create_patch_new (_tmp28_, (GitgExtRefActionInterface*) _tmp29_, _data50_->reference);
	_tmp31_ = _tmp30_;
	gitg_history_activity_add_ref_action (self, _tmp25_, (GitgExtRefAction*) _tmp31_);
	_g_object_unref0 (_tmp31_);
	_g_object_unref0 (_tmp28_);
	_tmp32_ = _data50_->actions;
	_tmp33_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp34_ = _tmp33_;
	_tmp35_ = _tmp34_;
	_tmp36_ = af;
	_tmp37_ = gitg_ref_action_checkout_new (_tmp35_, (GitgExtRefActionInterface*) _tmp36_, _data50_->reference);
	_tmp38_ = _tmp37_;
	gitg_history_activity_add_ref_action (self, _tmp32_, (GitgExtRefAction*) _tmp38_);
	_g_object_unref0 (_tmp38_);
	_g_object_unref0 (_tmp35_);
	_tmp39_ = _data50_->actions;
	_tmp40_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp41_ = _tmp40_;
	_tmp42_ = _tmp41_;
	_tmp43_ = af;
	_tmp44_ = gitg_ref_action_rename_new (_tmp42_, (GitgExtRefActionInterface*) _tmp43_, _data50_->reference);
	_tmp45_ = _tmp44_;
	gitg_history_activity_add_ref_action (self, _tmp39_, (GitgExtRefAction*) _tmp45_);
	_g_object_unref0 (_tmp45_);
	_g_object_unref0 (_tmp42_);
	_tmp46_ = _data50_->actions;
	_tmp47_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp48_ = _tmp47_;
	_tmp49_ = _tmp48_;
	_tmp50_ = af;
	_tmp51_ = gitg_ref_action_delete_new (_tmp49_, (GitgExtRefActionInterface*) _tmp50_, _data50_->reference);
	_tmp52_ = _tmp51_;
	gitg_history_activity_add_ref_action (self, _tmp46_, (GitgExtRefAction*) _tmp52_);
	_g_object_unref0 (_tmp52_);
	_g_object_unref0 (_tmp49_);
	_tmp53_ = _data50_->actions;
	_tmp54_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp55_ = _tmp54_;
	_tmp56_ = _tmp55_;
	_tmp57_ = af;
	_tmp58_ = gitg_ref_action_copy_name_new (_tmp56_, (GitgExtRefActionInterface*) _tmp57_, _data50_->reference);
	_tmp59_ = _tmp58_;
	gitg_history_activity_add_ref_action (self, _tmp53_, (GitgExtRefAction*) _tmp59_);
	_g_object_unref0 (_tmp59_);
	_g_object_unref0 (_tmp56_);
	_tmp60_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp61_ = _tmp60_;
	_tmp62_ = _tmp61_;
	_tmp63_ = af;
	_tmp64_ = gitg_ref_action_fetch_new (_tmp62_, (GitgExtRefActionInterface*) _tmp63_, _data50_->reference, NULL);
	_tmp65_ = _tmp64_;
	_g_object_unref0 (_tmp62_);
	fetch = _tmp65_;
	_tmp66_ = fetch;
	_tmp67_ = gitg_ext_ui_element_get_available ((GitgExtUIElement*) _tmp66_);
	_tmp68_ = _tmp67_;
	if (_tmp68_) {
		GeeLinkedList* _tmp69_;
		_tmp69_ = _data50_->actions;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp69_, NULL);
	}
	_tmp70_ = _data50_->actions;
	_tmp71_ = fetch;
	gitg_history_activity_add_ref_action (self, _tmp70_, (GitgExtRefAction*) _tmp71_);
	_tmp72_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp73_ = _tmp72_;
	_tmp74_ = _tmp73_;
	_tmp75_ = af;
	_tmp76_ = gitg_ref_action_push_new (_tmp74_, (GitgExtRefActionInterface*) _tmp75_, _data50_->reference);
	_tmp77_ = _tmp76_;
	_g_object_unref0 (_tmp74_);
	push = _tmp77_;
	_tmp78_ = push;
	_tmp79_ = gitg_ext_ui_element_get_available ((GitgExtUIElement*) _tmp78_);
	_tmp80_ = _tmp79_;
	if (_tmp80_) {
		GeeLinkedList* _tmp81_;
		_tmp81_ = _data50_->actions;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp81_, NULL);
	}
	_tmp82_ = _data50_->actions;
	_tmp83_ = push;
	gitg_history_activity_add_ref_action (self, _tmp82_, (GitgExtRefAction*) _tmp83_);
	_tmp84_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp85_ = _tmp84_;
	_tmp86_ = _tmp85_;
	_tmp87_ = af;
	_tmp88_ = gitg_ref_action_merge_new (_tmp86_, (GitgExtRefActionInterface*) _tmp87_, _data50_->reference);
	_tmp89_ = _tmp88_;
	_g_object_unref0 (_tmp86_);
	merge = _tmp89_;
	_tmp90_ = merge;
	_tmp91_ = gitg_ext_ui_element_get_available ((GitgExtUIElement*) _tmp90_);
	_tmp92_ = _tmp91_;
	if (_tmp92_) {
		GeeLinkedList* _tmp93_;
		GeeLinkedList* _tmp94_;
		GitgRefActionMerge* _tmp95_;
		_tmp93_ = _data50_->actions;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp93_, NULL);
		_tmp94_ = _data50_->actions;
		_tmp95_ = merge;
		gitg_history_activity_add_ref_action (self, _tmp94_, (GitgExtRefAction*) _tmp95_);
	}
	_tmp96_ = gitg_plugins_engine_get_default ();
	_tmp97_ = _tmp96_;
	_tmp98_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp99_ = _tmp98_;
	_tmp100_ = _tmp99_;
	_tmp101_ = af;
	_tmp102_ = peas_extension_set_new ((PeasEngine*) _tmp97_, GITG_EXT_TYPE_REF_ACTION, "application", _tmp100_, "action_interface", _tmp101_, "reference", _data50_->reference, NULL);
	_tmp103_ = _tmp102_;
	_g_object_unref0 (_tmp100_);
	_g_object_unref0 (_tmp97_);
	exts = _tmp103_;
	_data50_->addedsep = FALSE;
	_tmp104_ = exts;
	peas_extension_set_foreach (_tmp104_, ___lambda125__peas_extension_set_foreach_func, _data50_);
	_tmp105_ = _data50_->actions;
	_tmp106_ = gee_collection_get_is_empty ((GeeCollection*) _tmp105_);
	_tmp107_ = _tmp106_;
	if (_tmp107_) {
		result = NULL;
		_g_object_unref0 (exts);
		_g_object_unref0 (merge);
		_g_object_unref0 (push);
		_g_object_unref0 (fetch);
		_g_object_unref0 (af);
		block50_data_unref (_data50_);
		_data50_ = NULL;
		return result;
	}
	_tmp108_ = (GtkMenu*) gtk_menu_new ();
	g_object_ref_sink (_tmp108_);
	menu = _tmp108_;
	{
		GeeLinkedList* _ac_list = NULL;
		GeeLinkedList* _tmp109_;
		gint _ac_size = 0;
		GeeLinkedList* _tmp110_;
		gint _tmp111_;
		gint _tmp112_;
		gint _ac_index = 0;
		_tmp109_ = _data50_->actions;
		_ac_list = _tmp109_;
		_tmp110_ = _ac_list;
		_tmp111_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp110_);
		_tmp112_ = _tmp111_;
		_ac_size = _tmp112_;
		_ac_index = -1;
		while (TRUE) {
			gint _tmp113_;
			gint _tmp114_;
			GitgExtRefAction* ac = NULL;
			GeeLinkedList* _tmp115_;
			gpointer _tmp116_;
			GitgExtRefAction* _tmp117_;
			_ac_index = _ac_index + 1;
			_tmp113_ = _ac_index;
			_tmp114_ = _ac_size;
			if (!(_tmp113_ < _tmp114_)) {
				break;
			}
			_tmp115_ = _ac_list;
			_tmp116_ = gee_abstract_list_get ((GeeAbstractList*) _tmp115_, _ac_index);
			ac = (GitgExtRefAction*) _tmp116_;
			_tmp117_ = ac;
			if (_tmp117_ != NULL) {
				GitgExtRefAction* _tmp118_;
				GtkMenu* _tmp119_;
				_tmp118_ = ac;
				_tmp119_ = menu;
				gitg_ext_action_populate_menu ((GitgExtAction*) _tmp118_, _tmp119_);
			} else {
				GtkSeparatorMenuItem* sep = NULL;
				GtkSeparatorMenuItem* _tmp120_;
				GtkSeparatorMenuItem* _tmp121_;
				GtkMenu* _tmp122_;
				GtkSeparatorMenuItem* _tmp123_;
				_tmp120_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
				g_object_ref_sink (_tmp120_);
				sep = _tmp120_;
				_tmp121_ = sep;
				gtk_widget_show ((GtkWidget*) _tmp121_);
				_tmp122_ = menu;
				_tmp123_ = sep;
				gtk_menu_shell_append ((GtkMenuShell*) _tmp122_, (GtkMenuItem*) _tmp123_);
				_g_object_unref0 (sep);
			}
			_g_object_unref0 (ac);
		}
	}
	_tmp124_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
	g_object_ref_sink (_tmp124_);
	sep = _tmp124_;
	_tmp125_ = sep;
	gtk_widget_show ((GtkWidget*) _tmp125_);
	_tmp126_ = menu;
	_tmp127_ = sep;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp126_, (GtkMenuItem*) _tmp127_);
	_tmp128_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_ ("Mainline"));
	g_object_ref_sink (_tmp128_);
	_data50_->item = _tmp128_;
	_data50_->pos = 0;
	_tmp129_ = self->priv->d_mainline;
	_tmp129__length1 = self->priv->d_mainline_length1;
	{
		gchar** ml_collection = NULL;
		gint ml_collection_length1 = 0;
		gint _ml_collection_size_ = 0;
		gint ml_it = 0;
		ml_collection = _tmp129_;
		ml_collection_length1 = _tmp129__length1;
		for (ml_it = 0; ml_it < ml_collection_length1; ml_it = ml_it + 1) {
			gchar* _tmp130_;
			gchar* ml = NULL;
			_tmp130_ = g_strdup (ml_collection[ml_it]);
			ml = _tmp130_;
			{
				const gchar* _tmp131_;
				const gchar* _tmp132_;
				gint _tmp134_;
				_tmp131_ = ml;
				_tmp132_ = ggit_ref_get_name ((GgitRef*) _data50_->reference);
				if (g_strcmp0 (_tmp131_, _tmp132_) == 0) {
					GtkCheckMenuItem* _tmp133_;
					_tmp133_ = _data50_->item;
					gtk_check_menu_item_set_active (_tmp133_, TRUE);
					_g_free0 (ml);
					break;
				}
				_data50_->pos = _data50_->pos + 1;
				_tmp134_ = _data50_->pos;
				_g_free0 (ml);
			}
		}
	}
	_tmp135_ = _data50_->item;
	g_signal_connect_data ((GtkMenuItem*) _tmp135_, "activate", (GCallback) ___lambda126__gtk_menu_item_activate, block50_data_ref (_data50_), (GClosureNotify) block50_data_unref, 0);
	_tmp136_ = _data50_->item;
	gtk_widget_show ((GtkWidget*) _tmp136_);
	_tmp137_ = menu;
	_tmp138_ = _data50_->item;
	gtk_menu_shell_append ((GtkMenuShell*) _tmp137_, (GtkMenuItem*) _tmp138_);
	_tmp139_ = menu;
	_tmp140_ = _data50_->actions;
	_tmp141_ = _g_object_ref0 (_tmp140_);
	g_object_set_data_full ((GObject*) _tmp139_, "gitg-ext-actions", _tmp141_, g_object_unref);
	result = menu;
	_g_object_unref0 (sep);
	_g_object_unref0 (exts);
	_g_object_unref0 (merge);
	_g_object_unref0 (push);
	_g_object_unref0 (fetch);
	_g_object_unref0 (af);
	block50_data_unref (_data50_);
	_data50_ = NULL;
	return result;
}

static GtkMenu*
gitg_history_activity_on_refs_list_populate_menu (GitgHistoryActivity* self,
                                                  GdkEventButton* event)
{
	GtkListBoxRow* selection = NULL;
	GeeList* references = NULL;
	GitgHistoryPaned* _tmp15_;
	GitgHistoryRefsList* _tmp16_;
	GitgHistoryRefsList* _tmp17_;
	GeeList* _tmp18_;
	GeeList* _tmp19_;
	gboolean _tmp20_ = FALSE;
	GeeList* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	GeeList* _tmp62_;
	gpointer _tmp63_;
	GitgRef* _tmp64_;
	GtkMenu* _tmp65_;
	GtkMenu* _tmp66_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	selection = NULL;
	if (event != NULL) {
		gint y = 0;
		GitgHistoryPaned* _tmp0_;
		GitgHistoryRefsList* _tmp1_;
		GitgHistoryRefsList* _tmp2_;
		GdkWindow* _tmp3_;
		GtkListBoxRow* row = NULL;
		GitgHistoryPaned* _tmp4_;
		GitgHistoryRefsList* _tmp5_;
		GitgHistoryRefsList* _tmp6_;
		GtkListBoxRow* _tmp7_;
		GtkListBoxRow* _tmp8_;
		GtkListBoxRow* _tmp9_;
		GtkListBoxRow* _tmp10_;
		GitgHistoryPaned* _tmp11_;
		GitgHistoryRefsList* _tmp12_;
		GitgHistoryRefsList* _tmp13_;
		GtkListBoxRow* _tmp14_;
		_tmp0_ = self->priv->d_main;
		_tmp1_ = gitg_history_paned_get_refs_list (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = event->window;
		y = gitg_history_refs_list_y_in_window (_tmp2_, (gint) event->y, _tmp3_);
		_tmp4_ = self->priv->d_main;
		_tmp5_ = gitg_history_paned_get_refs_list (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = gtk_list_box_get_row_at_y ((GtkListBox*) _tmp6_, y);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		row = _tmp8_;
		_tmp9_ = row;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_g_object_unref0 (selection);
		selection = _tmp10_;
		_tmp11_ = self->priv->d_main;
		_tmp12_ = gitg_history_paned_get_refs_list (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = row;
		gtk_list_box_select_row ((GtkListBox*) _tmp13_, _tmp14_);
		_g_object_unref0 (row);
	}
	_tmp15_ = self->priv->d_main;
	_tmp16_ = gitg_history_paned_get_refs_list (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = gitg_history_refs_list_get_selection (_tmp17_);
	_tmp19_ = _tmp18_;
	references = _tmp19_;
	_tmp21_ = references;
	_tmp22_ = gee_collection_get_is_empty ((GeeCollection*) _tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_) {
		_tmp20_ = TRUE;
	} else {
		GeeList* _tmp24_;
		gpointer _tmp25_;
		GitgRef* _tmp26_;
		GeeList* _tmp27_;
		gpointer _tmp28_;
		GitgRef* _tmp29_;
		_tmp24_ = references;
		_tmp25_ = gee_list_first (_tmp24_);
		_tmp26_ = (GitgRef*) _tmp25_;
		_tmp27_ = references;
		_tmp28_ = gee_list_last (_tmp27_);
		_tmp29_ = (GitgRef*) _tmp28_;
		_tmp20_ = _tmp26_ != _tmp29_;
		_g_object_unref0 (_tmp29_);
		_g_object_unref0 (_tmp26_);
	}
	if (_tmp20_) {
		GeeLinkedList* actions = NULL;
		gboolean _tmp30_ = FALSE;
		gboolean _tmp31_ = FALSE;
		gboolean _tmp32_ = FALSE;
		GtkListBoxRow* _tmp33_;
		actions = NULL;
		_tmp33_ = selection;
		if (_tmp33_ != NULL) {
			GtkListBoxRow* _tmp34_;
			_tmp34_ = selection;
			_tmp32_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp34_) == GITG_HISTORY_TYPE_REF_HEADER;
		} else {
			_tmp32_ = FALSE;
		}
		if (_tmp32_) {
			GtkListBoxRow* _tmp35_;
			GeeLinkedList* _tmp36_;
			GeeLinkedList* _tmp37_;
			GeeLinkedList* _tmp38_;
			GeeLinkedList* _tmp39_;
			_tmp35_ = selection;
			_tmp36_ = gitg_history_ref_header_get_actions (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GITG_HISTORY_TYPE_REF_HEADER, GitgHistoryRefHeader));
			_tmp37_ = _tmp36_;
			_tmp38_ = _g_object_ref0 (_tmp37_);
			_g_object_unref0 (actions);
			actions = _tmp38_;
			_tmp39_ = actions;
			_tmp31_ = _tmp39_ != NULL;
		} else {
			_tmp31_ = FALSE;
		}
		if (_tmp31_) {
			GeeLinkedList* _tmp40_;
			gint _tmp41_;
			gint _tmp42_;
			_tmp40_ = actions;
			_tmp41_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp40_);
			_tmp42_ = _tmp41_;
			_tmp30_ = _tmp42_ > 0;
		} else {
			_tmp30_ = FALSE;
		}
		if (_tmp30_) {
			GtkMenu* menu = NULL;
			GtkMenu* _tmp43_;
			GtkMenu* _tmp59_;
			GeeLinkedList* _tmp60_;
			GeeLinkedList* _tmp61_;
			_tmp43_ = (GtkMenu*) gtk_menu_new ();
			g_object_ref_sink (_tmp43_);
			menu = _tmp43_;
			{
				GeeLinkedList* _ac_list = NULL;
				GeeLinkedList* _tmp44_;
				gint _ac_size = 0;
				GeeLinkedList* _tmp45_;
				gint _tmp46_;
				gint _tmp47_;
				gint _ac_index = 0;
				_tmp44_ = actions;
				_ac_list = _tmp44_;
				_tmp45_ = _ac_list;
				_tmp46_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp45_);
				_tmp47_ = _tmp46_;
				_ac_size = _tmp47_;
				_ac_index = -1;
				while (TRUE) {
					gint _tmp48_;
					gint _tmp49_;
					GitgExtAction* ac = NULL;
					GeeLinkedList* _tmp50_;
					gpointer _tmp51_;
					GitgExtAction* _tmp52_;
					_ac_index = _ac_index + 1;
					_tmp48_ = _ac_index;
					_tmp49_ = _ac_size;
					if (!(_tmp48_ < _tmp49_)) {
						break;
					}
					_tmp50_ = _ac_list;
					_tmp51_ = gee_abstract_list_get ((GeeAbstractList*) _tmp50_, _ac_index);
					ac = (GitgExtAction*) _tmp51_;
					_tmp52_ = ac;
					if (_tmp52_ != NULL) {
						GitgExtAction* _tmp53_;
						GtkMenu* _tmp54_;
						_tmp53_ = ac;
						_tmp54_ = menu;
						gitg_ext_action_populate_menu (_tmp53_, _tmp54_);
					} else {
						GtkSeparatorMenuItem* sep = NULL;
						GtkSeparatorMenuItem* _tmp55_;
						GtkSeparatorMenuItem* _tmp56_;
						GtkMenu* _tmp57_;
						GtkSeparatorMenuItem* _tmp58_;
						_tmp55_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
						g_object_ref_sink (_tmp55_);
						sep = _tmp55_;
						_tmp56_ = sep;
						gtk_widget_show ((GtkWidget*) _tmp56_);
						_tmp57_ = menu;
						_tmp58_ = sep;
						gtk_menu_shell_append ((GtkMenuShell*) _tmp57_, (GtkMenuItem*) _tmp58_);
						_g_object_unref0 (sep);
					}
					_g_object_unref0 (ac);
				}
			}
			_tmp59_ = menu;
			_tmp60_ = actions;
			_tmp61_ = _g_object_ref0 (_tmp60_);
			g_object_set_data_full ((GObject*) _tmp59_, "gitg-ext-actions", _tmp61_, g_object_unref);
			result = menu;
			_g_object_unref0 (actions);
			_g_object_unref0 (references);
			_g_object_unref0 (selection);
			return result;
		} else {
			result = NULL;
			_g_object_unref0 (actions);
			_g_object_unref0 (references);
			_g_object_unref0 (selection);
			return result;
		}
		_g_object_unref0 (actions);
	}
	_tmp62_ = references;
	_tmp63_ = gee_list_first (_tmp62_);
	_tmp64_ = (GitgRef*) _tmp63_;
	_tmp65_ = gitg_history_activity_popup_menu_for_ref (self, _tmp64_);
	_tmp66_ = _tmp65_;
	_g_object_unref0 (_tmp64_);
	result = _tmp66_;
	_g_object_unref0 (references);
	_g_object_unref0 (selection);
	return result;
}

static GgitOId*
gitg_history_activity_id_for_ref (GitgHistoryActivity* self,
                                  GgitRef* r)
{
	GgitOId* id = NULL;
	GError* _inner_error0_ = NULL;
	GgitOId* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (r != NULL, NULL);
	id = NULL;
	{
		GgitRef* resolved = NULL;
		GgitRef* _tmp0_;
		GgitRef* _tmp1_;
		_tmp0_ = ggit_ref_resolve (r, &_inner_error0_);
		resolved = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = resolved;
		if (ggit_ref_is_tag (_tmp1_)) {
			GgitTag* t = NULL;
			GitgExtApplication* _tmp2_;
			GitgExtApplication* _tmp3_;
			GitgExtApplication* _tmp4_;
			GitgRepository* _tmp5_;
			GitgRepository* _tmp6_;
			GitgRepository* _tmp7_;
			GgitRef* _tmp8_;
			GgitOId* _tmp9_;
			GgitOId* _tmp10_;
			gpointer _tmp11_;
			GgitTag* _tmp12_;
			GgitTag* _tmp13_;
			GgitOId* _tmp14_;
			_tmp2_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
			_tmp3_ = _tmp2_;
			_tmp4_ = _tmp3_;
			_tmp5_ = gitg_ext_application_get_repository (_tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp8_ = resolved;
			_tmp9_ = ggit_ref_get_target (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = gitg_repository_lookup (_tmp7_, ggit_tag_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp10_, &_inner_error0_);
			_tmp12_ = (GgitTag*) _tmp11_;
			__vala_GgitOId_free0 (_tmp10_);
			_g_object_unref0 (_tmp7_);
			_g_object_unref0 (_tmp4_);
			t = _tmp12_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (resolved);
				goto __catch0_g_error;
			}
			_tmp13_ = t;
			_tmp14_ = ggit_tag_get_target_id (_tmp13_);
			__vala_GgitOId_free0 (id);
			id = _tmp14_;
			_g_object_unref0 (t);
		} else {
			GgitRef* _tmp15_;
			GgitOId* _tmp16_;
			_tmp15_ = resolved;
			_tmp16_ = ggit_ref_get_target (_tmp15_);
			__vala_GgitOId_free0 (id);
			id = _tmp16_;
		}
		_g_object_unref0 (resolved);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		__vala_GgitOId_free0 (id);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = id;
	return result;
}

static GgitOId*
_vala_GgitOId_copy (GgitOId* self)
{
	return g_boxed_copy (ggit_oid_get_type (), self);
}

static gpointer
__vala_GgitOId_copy0 (gpointer self)
{
	return self ? _vala_GgitOId_copy (self) : NULL;
}

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

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

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

static void
gitg_history_activity_update_walker (GitgHistoryActivity* self)
{
	GeeHashSet* _tmp0_;
	GeeHashSet* include = NULL;
	GeeHashSet* _tmp1_;
	gboolean isall = FALSE;
	GitgHistoryPaned* _tmp2_;
	GitgHistoryRefsList* _tmp3_;
	GitgHistoryRefsList* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean isheader = FALSE;
	GitgHistoryPaned* _tmp7_;
	GitgHistoryRefsList* _tmp8_;
	GitgHistoryRefsList* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GeeHashSet* perm_uniq = NULL;
	GeeHashSet* _tmp12_;
	GgitOId** permanent = NULL;
	GgitOId** _tmp13_;
	gint permanent_length1;
	gint _permanent_size_;
	GitgExtApplication* _tmp14_;
	GitgExtApplication* _tmp15_;
	GitgExtApplication* _tmp16_;
	GitgRepository* _tmp17_;
	GitgRepository* _tmp18_;
	GitgRepository* _tmp19_;
	gboolean _tmp20_;
	gboolean show_upstream_with_branch = FALSE;
	GSettings* _tmp57_;
	GitgCommitModel* _tmp93_;
	GgitOId** _tmp94_;
	gint _tmp94__length1;
	GitgCommitModel* _tmp95_;
	GeeHashSet* _tmp96_;
	gint _tmp97_ = 0;
	gpointer* _tmp98_;
	GgitOId** _tmp99_;
	gint _tmp99__length1;
	GitgCommitModel* _tmp100_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_selected;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp0_);
	_tmp1_ = gee_hash_set_new (ggit_oid_get_type (), (GBoxedCopyFunc) _vala_GgitOId_copy, (GDestroyNotify) _vala_GgitOId_free, (GeeHashDataFunc) ggit_oid_hash, NULL, NULL, (GeeEqualDataFunc) ggit_oid_equal, NULL, NULL);
	include = _tmp1_;
	_tmp2_ = self->priv->d_main;
	_tmp3_ = gitg_history_paned_get_refs_list (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = gitg_history_refs_list_get_is_all (_tmp4_);
	_tmp6_ = _tmp5_;
	isall = _tmp6_;
	_tmp7_ = self->priv->d_main;
	_tmp8_ = gitg_history_paned_get_refs_list (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = gitg_history_refs_list_get_is_header (_tmp9_);
	_tmp11_ = _tmp10_;
	isheader = _tmp11_;
	_tmp12_ = gee_hash_set_new (ggit_oid_get_type (), (GBoxedCopyFunc) _vala_GgitOId_copy, (GDestroyNotify) _vala_GgitOId_free, (GeeHashDataFunc) ggit_oid_hash, NULL, NULL, (GeeEqualDataFunc) ggit_oid_equal, NULL, NULL);
	perm_uniq = _tmp12_;
	_tmp13_ = g_new0 (GgitOId*, 0 + 1);
	permanent = _tmp13_;
	permanent_length1 = 0;
	_permanent_size_ = permanent_length1;
	_tmp14_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_;
	_tmp17_ = gitg_ext_application_get_repository (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_;
	_tmp20_ = _tmp19_ != NULL;
	_g_object_unref0 (_tmp19_);
	_g_object_unref0 (_tmp16_);
	if (_tmp20_) {
		gchar** _tmp21_;
		gint _tmp21__length1;
		GSettings* _tmp40_;
		_tmp21_ = self->priv->d_mainline;
		_tmp21__length1 = self->priv->d_mainline_length1;
		{
			gchar** ml_collection = NULL;
			gint ml_collection_length1 = 0;
			gint _ml_collection_size_ = 0;
			gint ml_it = 0;
			ml_collection = _tmp21_;
			ml_collection_length1 = _tmp21__length1;
			for (ml_it = 0; ml_it < ml_collection_length1; ml_it = ml_it + 1) {
				gchar* _tmp22_;
				gchar* ml = NULL;
				_tmp22_ = g_strdup (ml_collection[ml_it]);
				ml = _tmp22_;
				{
					GgitOId* id = NULL;
					gboolean _tmp34_ = FALSE;
					GgitOId* _tmp35_;
					{
						GitgRef* _tmp23_ = NULL;
						GitgExtApplication* _tmp24_;
						GitgExtApplication* _tmp25_;
						GitgExtApplication* _tmp26_;
						GitgRepository* _tmp27_;
						GitgRepository* _tmp28_;
						GitgRepository* _tmp29_;
						const gchar* _tmp30_;
						GitgRef* _tmp31_;
						GitgRef* _tmp32_;
						GgitOId* _tmp33_;
						_tmp24_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
						_tmp25_ = _tmp24_;
						_tmp26_ = _tmp25_;
						_tmp27_ = gitg_ext_application_get_repository (_tmp26_);
						_tmp28_ = _tmp27_;
						_tmp29_ = _tmp28_;
						_tmp30_ = ml;
						_tmp31_ = gitg_repository_lookup_reference (_tmp29_, _tmp30_, &_inner_error0_);
						_tmp32_ = _tmp31_;
						_g_object_unref0 (_tmp29_);
						_g_object_unref0 (_tmp26_);
						_tmp23_ = _tmp32_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						_tmp33_ = gitg_history_activity_id_for_ref (self, (GgitRef*) _tmp23_);
						__vala_GgitOId_free0 (id);
						id = _tmp33_;
						_g_object_unref0 (_tmp23_);
					}
					goto __finally0;
					__catch0_g_error:
					{
						g_clear_error (&_inner_error0_);
						__vala_GgitOId_free0 (id);
						_g_free0 (ml);
						continue;
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						__vala_GgitOId_free0 (id);
						_g_free0 (ml);
						permanent = (_vala_array_free (permanent, permanent_length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
						_g_object_unref0 (perm_uniq);
						_g_object_unref0 (include);
						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;
					}
					_tmp35_ = id;
					if (_tmp35_ != NULL) {
						GeeHashSet* _tmp36_;
						GgitOId* _tmp37_;
						_tmp36_ = perm_uniq;
						_tmp37_ = id;
						_tmp34_ = gee_abstract_collection_add ((GeeAbstractCollection*) _tmp36_, _tmp37_);
					} else {
						_tmp34_ = FALSE;
					}
					if (_tmp34_) {
						GgitOId* _tmp38_;
						GgitOId* _tmp39_;
						_tmp38_ = id;
						_tmp39_ = __vala_GgitOId_copy0 (_tmp38_);
						_vala_array_add18 (&permanent, &permanent_length1, &_permanent_size_, _tmp39_);
					}
					__vala_GgitOId_free0 (id);
					_g_free0 (ml);
				}
			}
		}
		_tmp40_ = self->priv->d_settings;
		if (g_settings_get_boolean (_tmp40_, "mainline-head")) {
			{
				GitgRef* _tmp41_ = NULL;
				GitgExtApplication* _tmp42_;
				GitgExtApplication* _tmp43_;
				GitgExtApplication* _tmp44_;
				GitgRepository* _tmp45_;
				GitgRepository* _tmp46_;
				GitgRepository* _tmp47_;
				GitgRef* _tmp48_;
				GitgRef* _tmp49_;
				GgitOId* head = NULL;
				GgitOId* _tmp50_;
				gboolean _tmp51_ = FALSE;
				GgitOId* _tmp52_;
				_tmp42_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
				_tmp43_ = _tmp42_;
				_tmp44_ = _tmp43_;
				_tmp45_ = gitg_ext_application_get_repository (_tmp44_);
				_tmp46_ = _tmp45_;
				_tmp47_ = _tmp46_;
				_tmp48_ = gitg_repository_get_head (_tmp47_, &_inner_error0_);
				_tmp49_ = _tmp48_;
				_g_object_unref0 (_tmp47_);
				_g_object_unref0 (_tmp44_);
				_tmp41_ = _tmp49_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
				_tmp50_ = gitg_history_activity_id_for_ref (self, (GgitRef*) _tmp41_);
				head = _tmp50_;
				_tmp52_ = head;
				if (_tmp52_ != NULL) {
					GeeHashSet* _tmp53_;
					GgitOId* _tmp54_;
					_tmp53_ = perm_uniq;
					_tmp54_ = head;
					_tmp51_ = gee_abstract_collection_add ((GeeAbstractCollection*) _tmp53_, _tmp54_);
				} else {
					_tmp51_ = FALSE;
				}
				if (_tmp51_) {
					GgitOId* _tmp55_;
					GgitOId* _tmp56_;
					_tmp55_ = head;
					_tmp56_ = __vala_GgitOId_copy0 (_tmp55_);
					_vala_array_add19 (&permanent, &permanent_length1, &_permanent_size_, _tmp56_);
				}
				__vala_GgitOId_free0 (head);
				_g_object_unref0 (_tmp41_);
			}
			goto __finally1;
			__catch1_g_error:
			{
				g_clear_error (&_inner_error0_);
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				permanent = (_vala_array_free (permanent, permanent_length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
				_g_object_unref0 (perm_uniq);
				_g_object_unref0 (include);
				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;
			}
		}
	}
	_tmp57_ = self->priv->d_settings;
	show_upstream_with_branch = g_settings_get_boolean (_tmp57_, "show-upstream-with-branch");
	{
		GeeList* _r_list = NULL;
		GitgHistoryPaned* _tmp58_;
		GitgHistoryRefsList* _tmp59_;
		GitgHistoryRefsList* _tmp60_;
		GeeList* _tmp61_;
		GeeList* _tmp62_;
		gint _r_size = 0;
		GeeList* _tmp63_;
		gint _tmp64_;
		gint _tmp65_;
		gint _r_index = 0;
		_tmp58_ = self->priv->d_main;
		_tmp59_ = gitg_history_paned_get_refs_list (_tmp58_);
		_tmp60_ = _tmp59_;
		_tmp61_ = gitg_history_refs_list_get_selection (_tmp60_);
		_tmp62_ = _tmp61_;
		_r_list = _tmp62_;
		_tmp63_ = _r_list;
		_tmp64_ = gee_collection_get_size ((GeeCollection*) _tmp63_);
		_tmp65_ = _tmp64_;
		_r_size = _tmp65_;
		_r_index = -1;
		while (TRUE) {
			gint _tmp66_;
			gint _tmp67_;
			GitgRef* r = NULL;
			GeeList* _tmp68_;
			gpointer _tmp69_;
			GgitOId* id = NULL;
			GitgRef* _tmp70_;
			GgitOId* _tmp71_;
			GgitOId* _tmp72_;
			_r_index = _r_index + 1;
			_tmp66_ = _r_index;
			_tmp67_ = _r_size;
			if (!(_tmp66_ < _tmp67_)) {
				break;
			}
			_tmp68_ = _r_list;
			_tmp69_ = gee_list_get (_tmp68_, _r_index);
			r = (GitgRef*) _tmp69_;
			_tmp70_ = r;
			_tmp71_ = gitg_history_activity_id_for_ref (self, (GgitRef*) _tmp70_);
			id = _tmp71_;
			_tmp72_ = id;
			if (_tmp72_ != NULL) {
				GeeHashSet* _tmp73_;
				GgitOId* _tmp74_;
				gboolean _tmp82_ = FALSE;
				_tmp73_ = include;
				_tmp74_ = id;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp73_, _tmp74_);
				if (!isall) {
					GeeHashSet* _tmp75_;
					GgitOId* _tmp76_;
					gboolean _tmp77_ = FALSE;
					_tmp75_ = self->priv->d_selected;
					_tmp76_ = id;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp75_, _tmp76_);
					if (!isheader) {
						GeeHashSet* _tmp78_;
						GgitOId* _tmp79_;
						_tmp78_ = perm_uniq;
						_tmp79_ = id;
						_tmp77_ = gee_abstract_collection_add ((GeeAbstractCollection*) _tmp78_, _tmp79_);
					} else {
						_tmp77_ = FALSE;
					}
					if (_tmp77_) {
						GgitOId* _tmp80_;
						GgitOId* _tmp81_;
						_tmp80_ = id;
						_tmp81_ = __vala_GgitOId_copy0 (_tmp80_);
						_vala_array_add20 (&permanent, &permanent_length1, &_permanent_size_, _tmp81_);
					}
				}
				if (show_upstream_with_branch) {
					GitgRef* _tmp83_;
					_tmp83_ = r;
					_tmp82_ = ggit_ref_is_branch ((GgitRef*) _tmp83_);
				} else {
					_tmp82_ = FALSE;
				}
				if (_tmp82_) {
					GitgBranch* branch = NULL;
					GitgRef* _tmp84_;
					GitgBranch* _tmp85_;
					_tmp84_ = r;
					_tmp85_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp84_, GITG_TYPE_BRANCH) ? ((GitgBranch*) _tmp84_) : NULL);
					branch = _tmp85_;
					{
						GitgRef* _tmp86_ = NULL;
						GitgBranch* _tmp87_;
						GitgRef* _tmp88_;
						GgitOId* upid = NULL;
						GgitOId* _tmp89_;
						GgitOId* _tmp90_;
						_tmp87_ = branch;
						_tmp88_ = gitg_branch_get_upstream (_tmp87_, &_inner_error0_);
						_tmp86_ = _tmp88_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch2_g_error;
						}
						_tmp89_ = gitg_history_activity_id_for_ref (self, (GgitRef*) _tmp86_);
						upid = _tmp89_;
						_tmp90_ = upid;
						if (_tmp90_ != NULL) {
							GeeHashSet* _tmp91_;
							GgitOId* _tmp92_;
							_tmp91_ = include;
							_tmp92_ = upid;
							gee_abstract_collection_add ((GeeAbstractCollection*) _tmp91_, _tmp92_);
						}
						__vala_GgitOId_free0 (upid);
						_g_object_unref0 (_tmp86_);
					}
					goto __finally2;
					__catch2_g_error:
					{
						g_clear_error (&_inner_error0_);
					}
					__finally2:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (branch);
						__vala_GgitOId_free0 (id);
						_g_object_unref0 (r);
						_g_object_unref0 (_r_list);
						permanent = (_vala_array_free (permanent, permanent_length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
						_g_object_unref0 (perm_uniq);
						_g_object_unref0 (include);
						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;
					}
					_g_object_unref0 (branch);
				}
			}
			__vala_GgitOId_free0 (id);
			_g_object_unref0 (r);
		}
		_g_object_unref0 (_r_list);
	}
	_tmp93_ = self->priv->d_commit_list_model;
	_tmp94_ = permanent;
	_tmp94__length1 = permanent_length1;
	gitg_commit_model_set_permanent_lanes (_tmp93_, _tmp94_, (gint) _tmp94__length1);
	_tmp95_ = self->priv->d_commit_list_model;
	_tmp96_ = include;
	_tmp98_ = gee_collection_to_array ((GeeCollection*) _tmp96_, &_tmp97_);
	_tmp99_ = _tmp98_;
	_tmp99__length1 = _tmp97_;
	gitg_commit_model_set_include (_tmp95_, _tmp99_, (gint) _tmp97_);
	_tmp99_ = (_vala_array_free (_tmp99_, _tmp99__length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
	_tmp100_ = self->priv->d_commit_list_model;
	gitg_commit_model_reload (_tmp100_);
	permanent = (_vala_array_free (permanent, permanent_length1, (GDestroyNotify) _vala_GgitOId_free), NULL);
	_g_object_unref0 (perm_uniq);
	_g_object_unref0 (include);
}

static void
gitg_history_activity_on_ref_list_row_activated (GitgHistoryActivity* self,
                                                 GtkListBoxRow* row)
{
	GitgHistoryRefRow* ref_row = NULL;
	GitgHistoryRefRow* _tmp0_;
	GitgHistoryRefRow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GitgHistoryRefRow* _tmp3_;
	GitgRef* _tmp4_;
	GitgRef* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (GITG_HISTORY_IS_REF_ROW (row) ? ((GitgHistoryRefRow*) row) : NULL);
	ref_row = _tmp0_;
	_tmp1_ = ref_row;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (ref_row);
		return;
	}
	_tmp3_ = ref_row;
	_tmp4_ = gitg_history_ref_row_get_reference (_tmp3_);
	_tmp5_ = _tmp4_;
	if (ggit_ref_is_branch ((GgitRef*) _tmp5_)) {
		_tmp2_ = TRUE;
	} else {
		GitgHistoryRefRow* _tmp6_;
		GitgRef* _tmp7_;
		GitgRef* _tmp8_;
		_tmp6_ = ref_row;
		_tmp7_ = gitg_history_ref_row_get_reference (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = ggit_ref_is_remote ((GgitRef*) _tmp8_);
	}
	if (_tmp2_) {
		GitgHistoryActionInterface* af = NULL;
		GitgExtApplication* _tmp9_;
		GitgExtApplication* _tmp10_;
		GitgExtApplication* _tmp11_;
		GitgHistoryPaned* _tmp12_;
		GitgHistoryRefsList* _tmp13_;
		GitgHistoryRefsList* _tmp14_;
		GitgHistoryActionInterface* _tmp15_;
		GitgHistoryActionInterface* _tmp16_;
		GitgRefActionCheckout* checkout = NULL;
		GitgExtApplication* _tmp17_;
		GitgExtApplication* _tmp18_;
		GitgExtApplication* _tmp19_;
		GitgHistoryActionInterface* _tmp20_;
		GitgHistoryRefRow* _tmp21_;
		GitgRef* _tmp22_;
		GitgRef* _tmp23_;
		GitgRefActionCheckout* _tmp24_;
		GitgRefActionCheckout* _tmp25_;
		GitgRefActionCheckout* _tmp26_;
		_tmp9_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		_tmp12_ = self->priv->d_main;
		_tmp13_ = gitg_history_paned_get_refs_list (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = gitg_history_action_interface_new (_tmp11_, _tmp14_);
		_tmp16_ = _tmp15_;
		_g_object_unref0 (_tmp11_);
		af = _tmp16_;
		_tmp17_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
		_tmp18_ = _tmp17_;
		_tmp19_ = _tmp18_;
		_tmp20_ = af;
		_tmp21_ = ref_row;
		_tmp22_ = gitg_history_ref_row_get_reference (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = gitg_ref_action_checkout_new (_tmp19_, (GitgExtRefActionInterface*) _tmp20_, _tmp23_);
		_tmp25_ = _tmp24_;
		_g_object_unref0 (_tmp19_);
		checkout = _tmp25_;
		_tmp26_ = checkout;
		g_signal_emit_by_name ((GitgExtUIElement*) _tmp26_, "activate");
		_g_object_unref0 (checkout);
		_g_object_unref0 (af);
	}
	_g_object_unref0 (ref_row);
}

static void
gitg_history_activity_add_commit_action (GitgHistoryActivity* self,
                                         GeeLinkedList* actions,
                                         GitgExtCommitAction* action)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (actions != NULL);
	if (action != NULL) {
		gboolean _tmp1_;
		gboolean _tmp2_;
		_tmp1_ = gitg_ext_ui_element_get_available ((GitgExtUIElement*) action);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gee_abstract_collection_add ((GeeAbstractCollection*) actions, action);
	}
}

static gchar*
gitg_history_activity_normalize (GitgHistoryActivity* self,
                                 const gchar* s)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = g_utf8_normalize (s, (gssize) -1, G_NORMALIZE_ALL);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_utf8_casefold (_tmp1_, (gssize) -1);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

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

static gboolean
gitg_history_activity_search_filter_func (GitgHistoryActivity* self,
                                          GtkTreeModel* model,
                                          gint column,
                                          const gchar* key,
                                          GtkTreeIter* iter)
{
	GitgCommit* c = NULL;
	GitgCommitModel* _tmp0_;
	GtkTreeIter _tmp1_;
	GitgCommit* _tmp2_;
	GitgCommit* _tmp3_;
	GgitOId* _tmp4_;
	GgitOId* _tmp5_;
	gboolean _tmp6_;
	gchar* nkey = NULL;
	gchar* _tmp7_;
	gchar* subject = NULL;
	GitgCommit* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* message = NULL;
	GitgCommit* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	GgitSignature* author = NULL;
	GitgCommit* _tmp18_;
	GgitSignature* _tmp19_;
	gboolean _tmp20_ = FALSE;
	GgitSignature* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	gboolean _tmp26_;
	GgitSignature* committer = NULL;
	GitgCommit* _tmp32_;
	GgitSignature* _tmp33_;
	gboolean _tmp34_ = FALSE;
	GgitSignature* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	const gchar* _tmp39_;
	gboolean _tmp40_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = self->priv->d_commit_list_model;
	_tmp1_ = *iter;
	_tmp2_ = gitg_commit_model_commit_from_iter (_tmp0_, &_tmp1_);
	c = _tmp2_;
	_tmp3_ = c;
	_tmp4_ = ggit_object_get_id ((GgitObject*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = ggit_oid_has_prefix (_tmp5_, key);
	__vala_GgitOId_free0 (_tmp5_);
	if (_tmp6_) {
		result = FALSE;
		_g_object_unref0 (c);
		return result;
	}
	_tmp7_ = gitg_history_activity_normalize (self, key);
	nkey = _tmp7_;
	_tmp8_ = c;
	_tmp9_ = ggit_commit_get_subject ((GgitCommit*) _tmp8_);
	_tmp10_ = gitg_history_activity_normalize (self, _tmp9_);
	subject = _tmp10_;
	_tmp11_ = subject;
	_tmp12_ = nkey;
	if (string_contains (_tmp11_, _tmp12_)) {
		result = FALSE;
		_g_free0 (subject);
		_g_free0 (nkey);
		_g_object_unref0 (c);
		return result;
	}
	_tmp13_ = c;
	_tmp14_ = ggit_commit_get_message ((GgitCommit*) _tmp13_);
	_tmp15_ = gitg_history_activity_normalize (self, _tmp14_);
	message = _tmp15_;
	_tmp16_ = message;
	_tmp17_ = nkey;
	if (string_contains (_tmp16_, _tmp17_)) {
		result = FALSE;
		_g_free0 (message);
		_g_free0 (subject);
		_g_free0 (nkey);
		_g_object_unref0 (c);
		return result;
	}
	_tmp18_ = c;
	_tmp19_ = ggit_commit_get_author ((GgitCommit*) _tmp18_);
	author = _tmp19_;
	_tmp21_ = author;
	_tmp22_ = ggit_signature_get_name (_tmp21_);
	_tmp23_ = g_utf8_strdown (_tmp22_, (gssize) -1);
	_tmp24_ = _tmp23_;
	_tmp25_ = nkey;
	_tmp26_ = string_contains (_tmp24_, _tmp25_);
	_g_free0 (_tmp24_);
	if (_tmp26_) {
		_tmp20_ = TRUE;
	} else {
		GgitSignature* _tmp27_;
		const gchar* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		const gchar* _tmp31_;
		_tmp27_ = author;
		_tmp28_ = ggit_signature_get_email (_tmp27_);
		_tmp29_ = g_utf8_strdown (_tmp28_, (gssize) -1);
		_tmp30_ = _tmp29_;
		_tmp31_ = nkey;
		_tmp20_ = string_contains (_tmp30_, _tmp31_);
		_g_free0 (_tmp30_);
	}
	if (_tmp20_) {
		result = FALSE;
		_g_object_unref0 (author);
		_g_free0 (message);
		_g_free0 (subject);
		_g_free0 (nkey);
		_g_object_unref0 (c);
		return result;
	}
	_tmp32_ = c;
	_tmp33_ = ggit_commit_get_committer ((GgitCommit*) _tmp32_);
	committer = _tmp33_;
	_tmp35_ = committer;
	_tmp36_ = ggit_signature_get_name (_tmp35_);
	_tmp37_ = g_utf8_strdown (_tmp36_, (gssize) -1);
	_tmp38_ = _tmp37_;
	_tmp39_ = nkey;
	_tmp40_ = string_contains (_tmp38_, _tmp39_);
	_g_free0 (_tmp38_);
	if (_tmp40_) {
		_tmp34_ = TRUE;
	} else {
		GgitSignature* _tmp41_;
		const gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		const gchar* _tmp45_;
		_tmp41_ = committer;
		_tmp42_ = ggit_signature_get_email (_tmp41_);
		_tmp43_ = g_utf8_strdown (_tmp42_, (gssize) -1);
		_tmp44_ = _tmp43_;
		_tmp45_ = nkey;
		_tmp34_ = string_contains (_tmp44_, _tmp45_);
		_g_free0 (_tmp44_);
	}
	if (_tmp34_) {
		result = FALSE;
		_g_object_unref0 (committer);
		_g_object_unref0 (author);
		_g_free0 (message);
		_g_free0 (subject);
		_g_free0 (nkey);
		_g_object_unref0 (c);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (committer);
	_g_object_unref0 (author);
	_g_free0 (message);
	_g_free0 (subject);
	_g_free0 (nkey);
	_g_object_unref0 (c);
	return result;
}

static GitgExtApplication*
gitg_history_activity_real_get_application (GitgExtUIElement* base)
{
	GitgExtApplication* result;
	GitgHistoryActivity* self;
	GitgExtApplication* _tmp0_;
	GitgExtApplication* _tmp1_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = self->priv->_application;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gitg_history_activity_real_set_application (GitgExtUIElement* base,
                                            GitgExtApplication* value)
{
	GitgHistoryActivity* self;
	GitgExtApplication* old_value;
	self = (GitgHistoryActivity*) base;
	old_value = gitg_history_activity_real_get_application (base);
	if (old_value != value) {
		GitgExtApplication* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_application);
		self->priv->_application = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_APPLICATION_PROPERTY]);
	}
	_g_object_unref0 (old_value);
}

GitgUIElements*
gitg_history_activity_get_d_panels (GitgHistoryActivity* self)
{
	GitgUIElements* result;
	GitgUIElements* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_d_panels;
	result = _tmp0_;
	return result;
}

static gchar*
gitg_history_activity_real_get_id (GitgExtUIElement* base)
{
	gchar* result;
	GitgHistoryActivity* self;
	gchar* _tmp0_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = g_strdup ("/org/gnome/gitg/Activities/History");
	result = _tmp0_;
	return result;
}

GitgRepository*
gitg_history_activity_get_repository (GitgHistoryActivity* self)
{
	GitgRepository* result;
	GitgRepository* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_repository;
	result = _tmp0_;
	return result;
}

void
gitg_history_activity_set_repository (GitgHistoryActivity* self,
                                      GitgRepository* value)
{
	GitgRepository* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_repository;
	if (_tmp0_ != value) {
		GitgRepository* _tmp1_;
		_tmp1_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->d_repository);
		self->priv->d_repository = _tmp1_;
		gitg_history_activity_reload (self);
	}
	g_object_notify_by_pspec ((GObject *) self, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_REPOSITORY_PROPERTY]);
}

static gboolean
gitg_history_activity_real_get_available (GitgExtUIElement* base)
{
	gboolean result;
	GitgHistoryActivity* self;
	self = (GitgHistoryActivity*) base;
	result = TRUE;
	return result;
}

static gchar*
gitg_history_activity_real_get_display_name (GitgExtUIElement* base)
{
	gchar* result;
	GitgHistoryActivity* self;
	gchar* _tmp0_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = g_strdup (_ ("History"));
	result = _tmp0_;
	return result;
}

static gchar*
gitg_history_activity_real_get_description (GitgExtUIElement* base)
{
	gchar* result;
	GitgHistoryActivity* self;
	gchar* _tmp0_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = g_strdup (_ ("Examine the history of the repository"));
	result = _tmp0_;
	return result;
}

static gchar*
gitg_history_activity_real_get_icon (GitgExtUIElement* base)
{
	gchar* result;
	GitgHistoryActivity* self;
	gchar* _tmp0_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = g_strdup ("view-list-symbolic");
	result = _tmp0_;
	return result;
}

static GtkWidget*
gitg_history_activity_real_get_widget (GitgExtUIElement* base)
{
	GtkWidget* result;
	GitgHistoryActivity* self;
	GitgHistoryPaned* _tmp0_;
	GitgHistoryPaned* _tmp1_;
	GtkWidget* _tmp2_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = self->priv->d_main;
	if (_tmp0_ == NULL) {
		gitg_history_activity_build_ui (self);
	}
	_tmp1_ = self->priv->d_main;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	result = _tmp2_;
	return result;
}

static gboolean
gitg_history_activity_real_get_enabled (GitgExtUIElement* base)
{
	gboolean result;
	GitgHistoryActivity* self;
	self = (GitgHistoryActivity*) base;
	result = TRUE;
	return result;
}

GitgHistoryRefsList*
gitg_history_activity_get_refs_list (GitgHistoryActivity* self)
{
	GitgHistoryRefsList* result;
	GitgHistoryPaned* _tmp0_;
	GitgHistoryRefsList* _tmp1_;
	GitgHistoryRefsList* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_refs_list (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static gboolean
gitg_history_activity_real_get_search_available (GitgExtSearchable* base)
{
	gboolean result;
	GitgHistoryActivity* self;
	self = (GitgHistoryActivity*) base;
	result = TRUE;
	return result;
}

static void
gitg_history_activity_real_set_search_entry (GitgExtSearchable* base,
                                             GtkEntry* value)
{
	GitgHistoryActivity* self;
	GitgHistoryPaned* _tmp0_;
	GitgCommitListView* _tmp1_;
	GitgCommitListView* _tmp2_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = self->priv->d_main;
	_tmp1_ = gitg_history_paned_get_commit_list_view (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_tree_view_set_search_entry ((GtkTreeView*) _tmp2_, value);
	if (value != NULL) {
		GitgHistoryPaned* _tmp3_;
		GitgCommitListView* _tmp4_;
		GitgCommitListView* _tmp5_;
		_tmp3_ = self->priv->d_main;
		_tmp4_ = gitg_history_paned_get_commit_list_view (_tmp3_);
		_tmp5_ = _tmp4_;
		gtk_tree_view_set_search_column ((GtkTreeView*) _tmp5_, 0);
	} else {
		GitgHistoryPaned* _tmp6_;
		GitgCommitListView* _tmp7_;
		GitgCommitListView* _tmp8_;
		_tmp6_ = self->priv->d_main;
		_tmp7_ = gitg_history_paned_get_commit_list_view (_tmp6_);
		_tmp8_ = _tmp7_;
		gtk_tree_view_set_search_column ((GtkTreeView*) _tmp8_, -1);
	}
	g_object_notify_by_pspec ((GObject *) self, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_ENTRY_PROPERTY]);
}

static gchar*
gitg_history_activity_real_get_search_text (GitgExtSearchable* base)
{
	gchar* result;
	GitgHistoryActivity* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GitgHistoryActivity*) base;
	_tmp0_ = self->priv->_search_text;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gitg_history_activity_real_set_search_text (GitgExtSearchable* base,
                                            const gchar* value)
{
	GitgHistoryActivity* self;
	gchar* old_value;
	self = (GitgHistoryActivity*) base;
	old_value = gitg_history_activity_real_get_search_text (base);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_search_text);
		self->priv->_search_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_TEXT_PROPERTY]);
	}
	_g_free0 (old_value);
}

static gboolean
gitg_history_activity_real_get_search_visible (GitgExtSearchable* base)
{
	gboolean result;
	GitgHistoryActivity* self;
	self = (GitgHistoryActivity*) base;
	result = self->priv->_search_visible;
	return result;
}

static void
gitg_history_activity_real_set_search_visible (GitgExtSearchable* base,
                                               gboolean value)
{
	GitgHistoryActivity* self;
	gboolean old_value;
	self = (GitgHistoryActivity*) base;
	old_value = gitg_history_activity_real_get_search_visible (base);
	if (old_value != value) {
		self->priv->_search_visible = value;
		g_object_notify_by_pspec ((GObject *) self, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_VISIBLE_PROPERTY]);
	}
}

static void
_gitg_history_activity___lambda135_ (GitgHistoryActivity* self,
                                     GSettings* s,
                                     const gchar* k)
{
	g_return_if_fail (s != NULL);
	g_return_if_fail (k != NULL);
	gitg_history_activity_update_sort_mode (self);
}

static void
__gitg_history_activity___lambda135__g_settings_changed (GSettings* _sender,
                                                         const gchar* key,
                                                         gpointer self)
{
	_gitg_history_activity___lambda135_ ((GitgHistoryActivity*) self, _sender, key);
}

static void
_gitg_history_activity___lambda136_ (GitgHistoryActivity* self,
                                     GSettings* s,
                                     const gchar* k)
{
	g_return_if_fail (s != NULL);
	g_return_if_fail (k != NULL);
	gitg_history_activity_update_walker (self);
}

static void
__gitg_history_activity___lambda136__g_settings_changed (GSettings* _sender,
                                                         const gchar* key,
                                                         gpointer self)
{
	_gitg_history_activity___lambda136_ ((GitgHistoryActivity*) self, _sender, key);
}

static void
_gitg_history_activity___lambda137_ (GitgHistoryActivity* self,
                                     GSettings* s,
                                     const gchar* k)
{
	g_return_if_fail (s != NULL);
	g_return_if_fail (k != NULL);
	gitg_history_activity_update_walker (self);
}

static void
__gitg_history_activity___lambda137__g_settings_changed (GSettings* _sender,
                                                         const gchar* key,
                                                         gpointer self)
{
	_gitg_history_activity___lambda137_ ((GitgHistoryActivity*) self, _sender, key);
}

static void
_gitg_history_activity_on_commit_model_started_gitg_commit_model_started (GitgCommitModel* _sender,
                                                                          gpointer self)
{
	gitg_history_activity_on_commit_model_started ((GitgHistoryActivity*) self, _sender);
}

static void
_gitg_history_activity_on_commit_model_finished_gitg_commit_model_finished (GitgCommitModel* _sender,
                                                                            gpointer self)
{
	gitg_history_activity_on_commit_model_finished ((GitgHistoryActivity*) self, _sender);
}

static void
_gitg_history_activity_repository_changed_externally_gitg_ext_application_repository_changed_externally (GitgExtApplication* _sender,
                                                                                                         GitgExtExternalChangeHint hint,
                                                                                                         gpointer self)
{
	gitg_history_activity_repository_changed_externally ((GitgHistoryActivity*) self, hint);
}

static void
_gitg_history_activity_repository_commits_changed_gitg_ext_application_repository_commits_changed (GitgExtApplication* _sender,
                                                                                                   gpointer self)
{
	gitg_history_activity_repository_commits_changed ((GitgHistoryActivity*) self);
}

static GObject *
gitg_history_activity_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GitgHistoryActivity * self;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	GeeHashSet* _tmp4_;
	GitgExtApplication* _tmp5_;
	GitgExtApplication* _tmp6_;
	GitgExtApplication* _tmp7_;
	GitgRepository* _tmp8_;
	GitgRepository* _tmp9_;
	GitgRepository* _tmp10_;
	GitgCommitModel* _tmp11_;
	GitgCommitModel* _tmp12_;
	GitgCommitModel* _tmp13_;
	GitgExtApplication* _tmp14_;
	GitgExtApplication* _tmp15_;
	GitgExtApplication* _tmp16_;
	GitgRepository* _tmp17_;
	GitgRepository* _tmp18_;
	GitgExtApplication* _tmp19_;
	GitgExtApplication* _tmp20_;
	GitgExtApplication* _tmp21_;
	GitgExtApplication* _tmp22_;
	GitgExtApplication* _tmp23_;
	GitgExtApplication* _tmp24_;
	gulong _tmp25_;
	GitgExtApplication* _tmp26_;
	GitgExtApplication* _tmp27_;
	GitgExtApplication* _tmp28_;
	gulong _tmp29_;
	parent_class = G_OBJECT_CLASS (gitg_history_activity_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivity);
	_tmp0_ = g_settings_new (APPLICATION_ID ".preferences.history");
	_g_object_unref0 (self->priv->d_settings);
	self->priv->d_settings = _tmp0_;
	_tmp1_ = self->priv->d_settings;
	g_signal_connect_object (_tmp1_, "changed::topological-order", (GCallback) __gitg_history_activity___lambda135__g_settings_changed, self, 0);
	_tmp2_ = self->priv->d_settings;
	g_signal_connect_object (_tmp2_, "changed::mainline-head", (GCallback) __gitg_history_activity___lambda136__g_settings_changed, self, 0);
	_tmp3_ = self->priv->d_settings;
	g_signal_connect_object (_tmp3_, "changed::show-upstream-with-branch", (GCallback) __gitg_history_activity___lambda137__g_settings_changed, self, 0);
	_tmp4_ = gee_hash_set_new (ggit_oid_get_type (), (GBoxedCopyFunc) _vala_GgitOId_copy, (GDestroyNotify) _vala_GgitOId_free, (GeeHashDataFunc) ggit_oid_hash, NULL, NULL, (GeeEqualDataFunc) ggit_oid_equal, NULL, NULL);
	_g_object_unref0 (self->priv->d_selected);
	self->priv->d_selected = _tmp4_;
	_tmp5_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = gitg_ext_application_get_repository (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp11_ = gitg_commit_model_new (_tmp10_);
	_g_object_unref0 (self->priv->d_commit_list_model);
	self->priv->d_commit_list_model = _tmp11_;
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp7_);
	_tmp12_ = self->priv->d_commit_list_model;
	g_signal_connect_object (_tmp12_, "started", (GCallback) _gitg_history_activity_on_commit_model_started_gitg_commit_model_started, self, 0);
	_tmp13_ = self->priv->d_commit_list_model;
	g_signal_connect_object (_tmp13_, "finished", (GCallback) _gitg_history_activity_on_commit_model_finished_gitg_commit_model_finished, self, 0);
	gitg_history_activity_update_sort_mode (self);
	_tmp14_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_;
	_tmp17_ = gitg_ext_application_get_repository (_tmp16_);
	_tmp18_ = _tmp17_;
	_g_object_unref0 (self->priv->d_repository);
	self->priv->d_repository = _tmp18_;
	_g_object_unref0 (_tmp16_);
	_tmp19_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp20_ = _tmp19_;
	_tmp21_ = _tmp20_;
	g_object_bind_property_with_closures ((GObject*) _tmp21_, "repository", (GObject*) self, "repository", 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)));
	_g_object_unref0 (_tmp21_);
	gitg_history_activity_reload_mainline (self);
	_tmp22_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp23_ = _tmp22_;
	_tmp24_ = _tmp23_;
	_tmp25_ = g_signal_connect_object (_tmp24_, "repository-changed-externally", (GCallback) _gitg_history_activity_repository_changed_externally_gitg_ext_application_repository_changed_externally, self, 0);
	self->priv->d_externally_changed_id = _tmp25_;
	_g_object_unref0 (_tmp24_);
	_tmp26_ = gitg_ext_ui_element_get_application ((GitgExtUIElement*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = _tmp27_;
	_tmp29_ = g_signal_connect_object (_tmp28_, "repository-commits-changed", (GCallback) _gitg_history_activity_repository_commits_changed_gitg_ext_application_repository_commits_changed, self, 0);
	self->priv->d_commits_changed_id = _tmp29_;
	_g_object_unref0 (_tmp28_);
	return obj;
}

static void
gitg_history_activity_class_init (GitgHistoryActivityClass * klass,
                                  gpointer klass_data)
{
	gitg_history_activity_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgHistoryActivity_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) gitg_history_activity_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_history_activity_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_history_activity_set_property;
	G_OBJECT_CLASS (klass)->constructor = gitg_history_activity_constructor;
	G_OBJECT_CLASS (klass)->finalize = gitg_history_activity_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_APPLICATION_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_APPLICATION_PROPERTY] = g_param_spec_object ("application", "application", "application", GITG_EXT_TYPE_APPLICATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_D_PANELS_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_D_PANELS_PROPERTY] = g_param_spec_object ("d-panels", "d-panels", "d-panels", GITG_TYPE_UI_ELEMENTS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_ID_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_REPOSITORY_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_REPOSITORY_PROPERTY] = g_param_spec_object ("repository", "repository", "repository", GITG_TYPE_REPOSITORY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_AVAILABLE_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_AVAILABLE_PROPERTY] = g_param_spec_boolean ("available", "available", "available", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_DISPLAY_NAME_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_DESCRIPTION_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_ICON_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_ICON_PROPERTY] = g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_WIDGET_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_WIDGET_PROPERTY] = g_param_spec_object ("widget", "widget", "widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_ENABLED_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_REFS_LIST_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_REFS_LIST_PROPERTY] = g_param_spec_object ("refs-list", "refs-list", "refs-list", GITG_HISTORY_TYPE_REFS_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_SEARCH_AVAILABLE_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_AVAILABLE_PROPERTY] = g_param_spec_boolean ("search-available", "search-available", "search-available", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_SEARCH_ENTRY_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_ENTRY_PROPERTY] = g_param_spec_object ("search-entry", "search-entry", "search-entry", gtk_entry_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_SEARCH_TEXT_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_TEXT_PROPERTY] = g_param_spec_string ("search-text", "search-text", "search-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_ACTIVITY_SEARCH_VISIBLE_PROPERTY, gitg_history_activity_properties[GITG_HISTORY_ACTIVITY_SEARCH_VISIBLE_PROPERTY] = g_param_spec_boolean ("search-visible", "search-visible", "search-visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gitg_history_activity_gitg_ext_ui_element_interface_init (GitgExtUIElementIface * iface,
                                                          gpointer iface_data)
{
	gitg_history_activity_gitg_ext_ui_element_parent_iface = g_type_interface_peek_parent (iface);
	iface->negotiate_order = (gint (*) (GitgExtUIElement*, GitgExtUIElement*)) gitg_history_activity_real_negotiate_order;
	iface->get_application = gitg_history_activity_real_get_application;
	iface->set_application = gitg_history_activity_real_set_application;
	iface->get_id = gitg_history_activity_real_get_id;
	iface->get_available = gitg_history_activity_real_get_available;
	iface->get_display_name = gitg_history_activity_real_get_display_name;
	iface->get_description = gitg_history_activity_real_get_description;
	iface->get_icon = gitg_history_activity_real_get_icon;
	iface->get_widget = gitg_history_activity_real_get_widget;
	iface->get_enabled = gitg_history_activity_real_get_enabled;
}

static void
gitg_history_activity_gitg_ext_activity_interface_init (GitgExtActivityIface * iface,
                                                        gpointer iface_data)
{
	gitg_history_activity_gitg_ext_activity_parent_iface = g_type_interface_peek_parent (iface);
	iface->is_default_for = (gboolean (*) (GitgExtActivity*, const gchar*)) gitg_history_activity_real_is_default_for;
	iface->on_key_pressed = (gboolean (*) (GitgExtActivity*, GdkEventKey*)) gitg_history_activity_real_on_key_pressed;
}

static void
gitg_history_activity_gitg_ext_searchable_interface_init (GitgExtSearchableIface * iface,
                                                          gpointer iface_data)
{
	gitg_history_activity_gitg_ext_searchable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_search_available = gitg_history_activity_real_get_search_available;
	iface->set_search_entry = gitg_history_activity_real_set_search_entry;
	iface->get_search_text = gitg_history_activity_real_get_search_text;
	iface->set_search_text = gitg_history_activity_real_set_search_text;
	iface->get_search_visible = gitg_history_activity_real_get_search_visible;
	iface->set_search_visible = gitg_history_activity_real_set_search_visible;
}

static void
gitg_history_activity_gitg_ext_history_interface_init (GitgExtHistoryIface * iface,
                                                       gpointer iface_data)
{
	gitg_history_activity_gitg_ext_history_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach_selected = (void (*) (GitgExtHistory*, GitgExtForeachCommitSelectionFunc, gpointer)) gitg_history_activity_real_foreach_selected;
	iface->select = (void (*) (GitgExtHistory*, GitgCommit*)) gitg_history_activity_real_select;
}

static void
gitg_history_activity_instance_init (GitgHistoryActivity * self,
                                     gpointer klass)
{
	gchar* _tmp0_;
	self->priv = gitg_history_activity_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_search_text = _tmp0_;
}

static void
gitg_history_activity_finalize (GObject * obj)
{
	GitgHistoryActivity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivity);
	_g_object_unref0 (self->priv->_application);
	_g_object_unref0 (self->priv->d_commit_list_model);
	_g_object_unref0 (self->priv->d_selected);
	__vala_GgitOId_free0 (self->priv->d_scroll_to);
	_g_object_unref0 (self->priv->d_settings);
	_gitg_when_mapped_unref0 (self->priv->d_reload_when_mapped);
	_g_object_unref0 (self->priv->d_main);
	_g_object_unref0 (self->priv->d_refs_list_popup);
	_g_object_unref0 (self->priv->d_commit_list_popup);
	self->priv->d_mainline = (_vala_array_free (self->priv->d_mainline, self->priv->d_mainline_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->_d_panels);
	_g_object_unref0 (self->priv->d_repository);
	_g_free0 (self->priv->_search_text);
	G_OBJECT_CLASS (gitg_history_activity_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_history_activity_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgHistoryActivityClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_history_activity_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgHistoryActivity), 0, (GInstanceInitFunc) gitg_history_activity_instance_init, NULL };
	static const GInterfaceInfo gitg_ext_ui_element_info = { (GInterfaceInitFunc) gitg_history_activity_gitg_ext_ui_element_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gitg_ext_activity_info = { (GInterfaceInitFunc) gitg_history_activity_gitg_ext_activity_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gitg_ext_searchable_info = { (GInterfaceInitFunc) gitg_history_activity_gitg_ext_searchable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gitg_ext_history_info = { (GInterfaceInitFunc) gitg_history_activity_gitg_ext_history_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gitg_history_activity_type_id;
	gitg_history_activity_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgHistoryActivity", &g_define_type_info, 0);
	g_type_add_interface_static (gitg_history_activity_type_id, GITG_EXT_TYPE_UI_ELEMENT, &gitg_ext_ui_element_info);
	g_type_add_interface_static (gitg_history_activity_type_id, GITG_EXT_TYPE_ACTIVITY, &gitg_ext_activity_info);
	g_type_add_interface_static (gitg_history_activity_type_id, GITG_EXT_TYPE_SEARCHABLE, &gitg_ext_searchable_info);
	g_type_add_interface_static (gitg_history_activity_type_id, GITG_EXT_TYPE_HISTORY, &gitg_ext_history_info);
	GitgHistoryActivity_private_offset = g_type_add_instance_private (gitg_history_activity_type_id, sizeof (GitgHistoryActivityPrivate));
	return gitg_history_activity_type_id;
}

GType
gitg_history_activity_get_type (void)
{
	static gsize gitg_history_activity_type_id__once = 0;
	if (g_once_init_enter (&gitg_history_activity_type_id__once)) {
		GType gitg_history_activity_type_id;
		gitg_history_activity_type_id = gitg_history_activity_get_type_once ();
		g_once_init_leave (&gitg_history_activity_type_id__once, gitg_history_activity_type_id);
	}
	return gitg_history_activity_type_id__once;
}

static void
_vala_gitg_history_activity_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	GitgHistoryActivity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivity);
	switch (property_id) {
		case GITG_HISTORY_ACTIVITY_APPLICATION_PROPERTY:
		g_value_take_object (value, gitg_ext_ui_element_get_application ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_D_PANELS_PROPERTY:
		g_value_set_object (value, gitg_history_activity_get_d_panels (self));
		break;
		case GITG_HISTORY_ACTIVITY_ID_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_id ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_REPOSITORY_PROPERTY:
		g_value_set_object (value, gitg_history_activity_get_repository (self));
		break;
		case GITG_HISTORY_ACTIVITY_AVAILABLE_PROPERTY:
		g_value_set_boolean (value, gitg_ext_ui_element_get_available ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_display_name ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_DESCRIPTION_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_description ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_ICON_PROPERTY:
		g_value_take_string (value, gitg_ext_ui_element_get_icon ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_WIDGET_PROPERTY:
		g_value_take_object (value, gitg_ext_ui_element_get_widget ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_ENABLED_PROPERTY:
		g_value_set_boolean (value, gitg_ext_ui_element_get_enabled ((GitgExtUIElement*) self));
		break;
		case GITG_HISTORY_ACTIVITY_REFS_LIST_PROPERTY:
		g_value_set_object (value, gitg_history_activity_get_refs_list (self));
		break;
		case GITG_HISTORY_ACTIVITY_SEARCH_AVAILABLE_PROPERTY:
		g_value_set_boolean (value, gitg_ext_searchable_get_search_available ((GitgExtSearchable*) self));
		break;
		case GITG_HISTORY_ACTIVITY_SEARCH_TEXT_PROPERTY:
		g_value_take_string (value, gitg_ext_searchable_get_search_text ((GitgExtSearchable*) self));
		break;
		case GITG_HISTORY_ACTIVITY_SEARCH_VISIBLE_PROPERTY:
		g_value_set_boolean (value, gitg_ext_searchable_get_search_visible ((GitgExtSearchable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_history_activity_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	GitgHistoryActivity * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_HISTORY_TYPE_ACTIVITY, GitgHistoryActivity);
	switch (property_id) {
		case GITG_HISTORY_ACTIVITY_APPLICATION_PROPERTY:
		gitg_ext_ui_element_set_application ((GitgExtUIElement*) self, g_value_get_object (value));
		break;
		case GITG_HISTORY_ACTIVITY_REPOSITORY_PROPERTY:
		gitg_history_activity_set_repository (self, g_value_get_object (value));
		break;
		case GITG_HISTORY_ACTIVITY_SEARCH_ENTRY_PROPERTY:
		gitg_ext_searchable_set_search_entry ((GitgExtSearchable*) self, g_value_get_object (value));
		break;
		case GITG_HISTORY_ACTIVITY_SEARCH_TEXT_PROPERTY:
		gitg_ext_searchable_set_search_text ((GitgExtSearchable*) self, g_value_get_string (value));
		break;
		case GITG_HISTORY_ACTIVITY_SEARCH_VISIBLE_PROPERTY:
		gitg_ext_searchable_set_search_visible ((GitgExtSearchable*) self, g_value_get_boolean (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;
}

