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

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libgitg.h"
#include <cairo-gobject.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include "config.h"

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

#define GITG_TYPE_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;
typedef struct _GitgAnimatedPanedPrivate GitgAnimatedPanedPrivate;

#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;
typedef struct _GitgHistoryPanedPrivate GitgHistoryPanedPrivate;

#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;
enum  {
	GITG_HISTORY_PANED_0_PROPERTY,
	GITG_HISTORY_PANED_INNER_ORIENTATION_PROPERTY,
	GITG_HISTORY_PANED_REFS_LIST_PROPERTY,
	GITG_HISTORY_PANED_COMMIT_LIST_VIEW_PROPERTY,
	GITG_HISTORY_PANED_PANED_PANELS_PROPERTY,
	GITG_HISTORY_PANED_STACK_PANEL_PROPERTY,
	GITG_HISTORY_PANED_NUM_PROPERTIES
};
static GParamSpec* gitg_history_paned_properties[GITG_HISTORY_PANED_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block42Data Block42Data;

struct _GitgAnimatedPaned {
	GtkPaned parent_instance;
	GitgAnimatedPanedPrivate * priv;
};

struct _GitgAnimatedPanedClass {
	GtkPanedClass parent_class;
};

struct _GitgHistoryPaned {
	GitgAnimatedPaned parent_instance;
	GitgHistoryPanedPrivate * priv;
};

struct _GitgHistoryPanedClass {
	GitgAnimatedPanedClass parent_class;
};

struct _GitgHistoryPanedPrivate {
	GtkBox* d_box_sidebar;
	GitgAnimatedPaned* d_paned_panels;
	GtkStackSwitcher* d_stack_switcher_panels;
	GitgHistoryRefsList* d_refs_list;
	GitgCommitListView* d_commit_list_view;
	GtkStack* d_stack_panel;
	GtkScrolledWindow* d_scrolled_window_commit_list;
};

struct _Block42Data {
	int _ref_count_;
	GitgHistoryPaned* self;
	GSettings* state_settings;
};

static gint GitgHistoryPaned_private_offset;
static gpointer gitg_history_paned_parent_class = NULL;

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_history_refs_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgHistoryRefsList, g_object_unref)
static void gitg_history_paned_store_paned_position (GitgHistoryPaned* self,
                                              GitgAnimatedPaned* paned,
                                              GSettings* settings,
                                              const gchar* key);
VALA_EXTERN gboolean gitg_animated_paned_get_is_animating (GitgAnimatedPaned* self);
VALA_EXTERN GitgHistoryPaned* gitg_history_paned_new (void);
VALA_EXTERN GitgHistoryPaned* gitg_history_paned_construct (GType object_type);
static gboolean gitg_history_paned_real_draw (GtkWidget* base,
                                       cairo_t* context);
VALA_EXTERN GtkOrientation gitg_history_paned_get_inner_orientation (GitgHistoryPaned* self);
VALA_EXTERN void gitg_history_paned_set_inner_orientation (GitgHistoryPaned* self,
                                               GtkOrientation value);
VALA_EXTERN GitgHistoryRefsList* gitg_history_paned_get_refs_list (GitgHistoryPaned* self);
VALA_EXTERN GitgCommitListView* gitg_history_paned_get_commit_list_view (GitgHistoryPaned* self);
VALA_EXTERN GtkPaned* gitg_history_paned_get_paned_panels (GitgHistoryPaned* self);
VALA_EXTERN GtkStack* gitg_history_paned_get_stack_panel (GitgHistoryPaned* self);
static GObject * gitg_history_paned_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static Block42Data* block42_data_ref (Block42Data* _data42_);
static void block42_data_unref (void * _userdata_);
static void _gitg_history_paned___lambda107_ (Block42Data* _data42_);
static void __gitg_history_paned___lambda107__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self);
static void _gitg_history_paned___lambda108_ (Block42Data* _data42_);
static void __gitg_history_paned___lambda108__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self);
static void gitg_history_paned_finalize (GObject * obj);
static GType gitg_history_paned_get_type_once (void);
static void _vala_gitg_history_paned_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_gitg_history_paned_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
gitg_history_paned_get_instance_private (GitgHistoryPaned* self)
{
	return G_STRUCT_MEMBER_P (self, GitgHistoryPaned_private_offset);
}

static void
gitg_history_paned_store_paned_position (GitgHistoryPaned* self,
                                         GitgAnimatedPaned* paned,
                                         GSettings* settings,
                                         const gchar* key)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkWidget* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (paned != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = gitg_animated_paned_get_is_animating (paned);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		return;
	}
	_tmp3_ = gtk_paned_get_child1 ((GtkPaned*) paned);
	_tmp4_ = gtk_widget_get_visible (_tmp3_);
	_tmp5_ = _tmp4_;
	if (!_tmp5_) {
		_tmp2_ = TRUE;
	} else {
		GtkWidget* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = gtk_paned_get_child2 ((GtkPaned*) paned);
		_tmp7_ = gtk_widget_get_visible (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp2_ = !_tmp8_;
	}
	if (_tmp2_) {
		return;
	}
	g_settings_set_int (settings, key, gtk_paned_get_position ((GtkPaned*) paned));
}

GitgHistoryPaned*
gitg_history_paned_construct (GType object_type)
{
	GitgHistoryPaned * self = NULL;
	self = (GitgHistoryPaned*) g_object_new (object_type, "orientation", GTK_ORIENTATION_HORIZONTAL, NULL);
	return self;
}

GitgHistoryPaned*
gitg_history_paned_new (void)
{
	return gitg_history_paned_construct (GITG_HISTORY_TYPE_PANED);
}

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

static gboolean
gitg_history_paned_real_draw (GtkWidget* base,
                              cairo_t* context)
{
	GitgHistoryPaned * self;
	gboolean ret = FALSE;
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GdkWindow* window = NULL;
	GtkBox* _tmp7_;
	GdkWindow* _tmp8_;
	GdkWindow* _tmp9_;
	GdkWindow* handlewin = NULL;
	GdkWindow* _tmp10_;
	GdkWindow* _tmp11_;
	GtkStyleContext* c = NULL;
	GtkStyleContext* _tmp12_;
	GtkStyleContext* _tmp13_;
	GtkStyleContext* _tmp14_;
	GtkAllocation alloc = {0};
	GtkStackSwitcher* _tmp15_;
	GtkAllocation _tmp16_ = {0};
	gint y = 0;
	GtkAllocation _tmp17_;
	GtkBox* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	gint hw = 0;
	gint w = 0;
	gint _tmp21_;
	gint _tmp22_;
	gint h = 0;
	GtkAllocation _tmp23_;
	GtkBox* _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	GtkStackSwitcher* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	GdkWindow* _tmp30_;
	GdkWindow* _tmp34_;
	GtkStyleContext* _tmp38_;
	gboolean result;
	self = (GitgHistoryPaned*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	ret = GTK_WIDGET_CLASS (gitg_history_paned_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GITG_TYPE_ANIMATED_PANED, GitgAnimatedPaned), context);
	_tmp1_ = gtk_paned_get_child1 ((GtkPaned*) self);
	_tmp2_ = gtk_widget_get_visible (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		_tmp0_ = TRUE;
	} else {
		GtkWidget* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = gtk_paned_get_child2 ((GtkPaned*) self);
		_tmp5_ = gtk_widget_get_visible (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = !_tmp6_;
	}
	if (_tmp0_) {
		result = ret;
		return result;
	}
	_tmp7_ = self->priv->d_box_sidebar;
	_tmp8_ = gtk_widget_get_window ((GtkWidget*) _tmp7_);
	_tmp9_ = _g_object_ref0 (_tmp8_);
	window = _tmp9_;
	_tmp10_ = gtk_paned_get_handle_window ((GtkPaned*) self);
	_tmp11_ = _g_object_ref0 (_tmp10_);
	handlewin = _tmp11_;
	_tmp12_ = gtk_widget_get_style_context ((GtkWidget*) self);
	_tmp13_ = _g_object_ref0 (_tmp12_);
	c = _tmp13_;
	_tmp14_ = c;
	gtk_style_context_save (_tmp14_);
	_tmp15_ = self->priv->d_stack_switcher_panels;
	gtk_widget_get_allocation ((GtkWidget*) _tmp15_, &_tmp16_);
	alloc = _tmp16_;
	_tmp17_ = alloc;
	_tmp18_ = self->priv->d_box_sidebar;
	_tmp19_ = gtk_box_get_spacing (_tmp18_);
	_tmp20_ = _tmp19_;
	y = _tmp17_.y - _tmp20_;
	hw = 1;
	_tmp21_ = gtk_paned_get_position ((GtkPaned*) self);
	_tmp22_ = _tmp21_;
	w = _tmp22_ + hw;
	_tmp23_ = alloc;
	_tmp24_ = self->priv->d_box_sidebar;
	_tmp25_ = gtk_box_get_spacing (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = self->priv->d_stack_switcher_panels;
	_tmp28_ = gtk_widget_get_margin_bottom ((GtkWidget*) _tmp27_);
	_tmp29_ = _tmp28_;
	h = (_tmp23_.height + _tmp26_) + _tmp29_;
	_tmp30_ = window;
	if (_tmp30_ != NULL) {
		gint wx = 0;
		GdkWindow* _tmp31_;
		gint _tmp32_ = 0;
		GtkStyleContext* _tmp33_;
		_tmp31_ = window;
		gdk_window_get_position (_tmp31_, &_tmp32_, NULL);
		wx = _tmp32_;
		_tmp33_ = c;
		gtk_render_frame (_tmp33_, context, (gdouble) wx, (gdouble) y, (gdouble) w, (gdouble) h);
	}
	_tmp34_ = handlewin;
	if (_tmp34_ != NULL) {
		gint hx = 0;
		GdkWindow* _tmp35_;
		gint _tmp36_ = 0;
		GtkStyleContext* _tmp37_;
		_tmp35_ = handlewin;
		gdk_window_get_position (_tmp35_, &_tmp36_, NULL);
		hx = _tmp36_;
		_tmp37_ = c;
		gtk_render_background (_tmp37_, context, (gdouble) hx, (gdouble) y, (gdouble) hw, (gdouble) h);
	}
	_tmp38_ = c;
	gtk_style_context_restore (_tmp38_);
	result = ret;
	_g_object_unref0 (c);
	_g_object_unref0 (handlewin);
	_g_object_unref0 (window);
	return result;
}

GtkOrientation
gitg_history_paned_get_inner_orientation (GitgHistoryPaned* self)
{
	GtkOrientation result;
	GitgAnimatedPaned* _tmp0_;
	GtkOrientation _tmp1_;
	GtkOrientation _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->d_paned_panels;
	_tmp1_ = gtk_orientable_get_orientation ((GtkOrientable*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
gitg_history_paned_set_inner_orientation (GitgHistoryPaned* self,
                                          GtkOrientation value)
{
	GitgAnimatedPaned* _tmp0_;
	GtkOrientation _tmp1_;
	GtkOrientation _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_paned_panels;
	_tmp1_ = gtk_orientable_get_orientation ((GtkOrientable*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != value) {
		GitgAnimatedPaned* _tmp3_;
		GitgAnimatedPaned* _tmp4_;
		GtkScrolledWindow* _tmp5_;
		GitgAnimatedPaned* _tmp6_;
		GtkStack* _tmp7_;
		GtkWidget* p1 = NULL;
		GtkWidget* p2 = NULL;
		GitgAnimatedPaned* _tmp16_;
		GtkWidget* _tmp17_;
		GitgAnimatedPaned* _tmp18_;
		GtkWidget* _tmp19_;
		_tmp3_ = self->priv->d_paned_panels;
		gtk_orientable_set_orientation ((GtkOrientable*) _tmp3_, value);
		_tmp4_ = self->priv->d_paned_panels;
		_tmp5_ = self->priv->d_scrolled_window_commit_list;
		gtk_container_remove ((GtkContainer*) _tmp4_, (GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->d_paned_panels;
		_tmp7_ = self->priv->d_stack_panel;
		gtk_container_remove ((GtkContainer*) _tmp6_, (GtkWidget*) _tmp7_);
		if (value == GTK_ORIENTATION_HORIZONTAL) {
			GtkStack* _tmp8_;
			GtkWidget* _tmp9_;
			GtkScrolledWindow* _tmp10_;
			GtkWidget* _tmp11_;
			_tmp8_ = self->priv->d_stack_panel;
			_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
			_g_object_unref0 (p1);
			p1 = _tmp9_;
			_tmp10_ = self->priv->d_scrolled_window_commit_list;
			_tmp11_ = _g_object_ref0 ((GtkWidget*) _tmp10_);
			_g_object_unref0 (p2);
			p2 = _tmp11_;
		} else {
			GtkScrolledWindow* _tmp12_;
			GtkWidget* _tmp13_;
			GtkStack* _tmp14_;
			GtkWidget* _tmp15_;
			_tmp12_ = self->priv->d_scrolled_window_commit_list;
			_tmp13_ = _g_object_ref0 ((GtkWidget*) _tmp12_);
			_g_object_unref0 (p1);
			p1 = _tmp13_;
			_tmp14_ = self->priv->d_stack_panel;
			_tmp15_ = _g_object_ref0 ((GtkWidget*) _tmp14_);
			_g_object_unref0 (p2);
			p2 = _tmp15_;
		}
		_tmp16_ = self->priv->d_paned_panels;
		_tmp17_ = p1;
		gtk_paned_pack1 ((GtkPaned*) _tmp16_, _tmp17_, TRUE, TRUE);
		_tmp18_ = self->priv->d_paned_panels;
		_tmp19_ = p2;
		gtk_paned_pack2 ((GtkPaned*) _tmp18_, _tmp19_, FALSE, FALSE);
		_g_object_unref0 (p2);
		_g_object_unref0 (p1);
	}
	g_object_notify_by_pspec ((GObject *) self, gitg_history_paned_properties[GITG_HISTORY_PANED_INNER_ORIENTATION_PROPERTY]);
}

GitgHistoryRefsList*
gitg_history_paned_get_refs_list (GitgHistoryPaned* self)
{
	GitgHistoryRefsList* result;
	GitgHistoryRefsList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_refs_list;
	result = _tmp0_;
	return result;
}

GitgCommitListView*
gitg_history_paned_get_commit_list_view (GitgHistoryPaned* self)
{
	GitgCommitListView* result;
	GitgCommitListView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_commit_list_view;
	result = _tmp0_;
	return result;
}

GtkPaned*
gitg_history_paned_get_paned_panels (GitgHistoryPaned* self)
{
	GtkPaned* result;
	GitgAnimatedPaned* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_paned_panels;
	result = (GtkPaned*) _tmp0_;
	return result;
}

GtkStack*
gitg_history_paned_get_stack_panel (GitgHistoryPaned* self)
{
	GtkStack* result;
	GtkStack* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_stack_panel;
	result = _tmp0_;
	return result;
}

static Block42Data*
block42_data_ref (Block42Data* _data42_)
{
	g_atomic_int_inc (&_data42_->_ref_count_);
	return _data42_;
}

static void
block42_data_unref (void * _userdata_)
{
	Block42Data* _data42_;
	_data42_ = (Block42Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data42_->_ref_count_)) {
		GitgHistoryPaned* self;
		self = _data42_->self;
		_g_object_unref0 (_data42_->state_settings);
		_g_object_unref0 (self);
		g_slice_free (Block42Data, _data42_);
	}
}

static void
_gitg_history_paned___lambda107_ (Block42Data* _data42_)
{
	GitgHistoryPaned* self;
	GSettings* _tmp0_;
	self = _data42_->self;
	_tmp0_ = _data42_->state_settings;
	gitg_history_paned_store_paned_position (self, (GitgAnimatedPaned*) self, _tmp0_, "paned-sidebar-position");
}

static void
__gitg_history_paned___lambda107__g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self)
{
	_gitg_history_paned___lambda107_ (self);
}

static void
_gitg_history_paned___lambda108_ (Block42Data* _data42_)
{
	GitgHistoryPaned* self;
	GitgAnimatedPaned* _tmp0_;
	GSettings* _tmp1_;
	self = _data42_->self;
	_tmp0_ = self->priv->d_paned_panels;
	_tmp1_ = _data42_->state_settings;
	gitg_history_paned_store_paned_position (self, _tmp0_, _tmp1_, "paned-panels-position");
}

static void
__gitg_history_paned___lambda108__g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self)
{
	_gitg_history_paned___lambda108_ (self);
}

static GObject *
gitg_history_paned_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GitgHistoryPaned * self;
	Block42Data* _data42_;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GitgAnimatedPaned* _tmp2_;
	GSettings* _tmp3_;
	GitgAnimatedPaned* _tmp4_;
	GSettings* interface_settings = NULL;
	GSettings* _tmp5_;
	GSettings* _tmp6_;
	GtkStackSwitcher* _tmp7_;
	GtkStack* _tmp8_;
	parent_class = G_OBJECT_CLASS (gitg_history_paned_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_HISTORY_TYPE_PANED, GitgHistoryPaned);
	_data42_ = g_slice_new0 (Block42Data);
	_data42_->_ref_count_ = 1;
	_data42_->self = g_object_ref (self);
	_tmp0_ = g_settings_new (APPLICATION_ID ".state.history");
	_data42_->state_settings = _tmp0_;
	_tmp1_ = _data42_->state_settings;
	gtk_paned_set_position ((GtkPaned*) self, g_settings_get_int (_tmp1_, "paned-sidebar-position"));
	_tmp2_ = self->priv->d_paned_panels;
	_tmp3_ = _data42_->state_settings;
	gtk_paned_set_position ((GtkPaned*) _tmp2_, g_settings_get_int (_tmp3_, "paned-panels-position"));
	g_signal_connect_data ((GObject*) self, "notify::position", (GCallback) __gitg_history_paned___lambda107__g_object_notify, block42_data_ref (_data42_), (GClosureNotify) block42_data_unref, 0);
	_tmp4_ = self->priv->d_paned_panels;
	g_signal_connect_data ((GObject*) _tmp4_, "notify::position", (GCallback) __gitg_history_paned___lambda108__g_object_notify, block42_data_ref (_data42_), (GClosureNotify) block42_data_unref, 0);
	_tmp5_ = g_settings_new (APPLICATION_ID ".preferences.interface");
	interface_settings = _tmp5_;
	_tmp6_ = interface_settings;
	g_settings_bind (_tmp6_, "orientation", (GObject*) self, "inner_orientation", G_SETTINGS_BIND_GET);
	_tmp7_ = self->priv->d_stack_switcher_panels;
	_tmp8_ = self->priv->d_stack_panel;
	gtk_stack_switcher_set_stack (_tmp7_, _tmp8_);
	_g_object_unref0 (interface_settings);
	block42_data_unref (_data42_);
	_data42_ = NULL;
	return obj;
}

static void
gitg_history_paned_class_init (GitgHistoryPanedClass * klass,
                               gpointer klass_data)
{
	gitg_history_paned_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgHistoryPaned_private_offset);
	((GtkWidgetClass *) klass)->draw = (gboolean (*) (GtkWidget*, cairo_t*)) gitg_history_paned_real_draw;
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_history_paned_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_history_paned_set_property;
	G_OBJECT_CLASS (klass)->constructor = gitg_history_paned_constructor;
	G_OBJECT_CLASS (klass)->finalize = gitg_history_paned_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_PANED_INNER_ORIENTATION_PROPERTY, gitg_history_paned_properties[GITG_HISTORY_PANED_INNER_ORIENTATION_PROPERTY] = g_param_spec_enum ("inner-orientation", "inner-orientation", "inner-orientation", gtk_orientation_get_type (), 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_PANED_REFS_LIST_PROPERTY, gitg_history_paned_properties[GITG_HISTORY_PANED_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_PANED_COMMIT_LIST_VIEW_PROPERTY, gitg_history_paned_properties[GITG_HISTORY_PANED_COMMIT_LIST_VIEW_PROPERTY] = g_param_spec_object ("commit-list-view", "commit-list-view", "commit-list-view", GITG_TYPE_COMMIT_LIST_VIEW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_PANED_PANED_PANELS_PROPERTY, gitg_history_paned_properties[GITG_HISTORY_PANED_PANED_PANELS_PROPERTY] = g_param_spec_object ("paned-panels", "paned-panels", "paned-panels", gtk_paned_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_HISTORY_PANED_STACK_PANEL_PROPERTY, gitg_history_paned_properties[GITG_HISTORY_PANED_STACK_PANEL_PROPERTY] = g_param_spec_object ("stack-panel", "stack-panel", "stack-panel", gtk_stack_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/gitg/ui/gitg-history-paned.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_box_sidebar", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_box_sidebar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_paned_panels", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_paned_panels));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_stack_switcher_panels", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_stack_switcher_panels));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_refs_list", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_refs_list));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_commit_list_view", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_commit_list_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_stack_panel", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_stack_panel));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "d_scrolled_window_commit_list", FALSE, GitgHistoryPaned_private_offset + G_STRUCT_OFFSET (GitgHistoryPanedPrivate, d_scrolled_window_commit_list));
}

static void
gitg_history_paned_instance_init (GitgHistoryPaned * self,
                                  gpointer klass)
{
	self->priv = gitg_history_paned_get_instance_private (self);
	g_type_ensure (GITG_TYPE_ANIMATED_PANED);
	g_type_ensure (GITG_HISTORY_TYPE_REFS_LIST);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
gitg_history_paned_finalize (GObject * obj)
{
	GitgHistoryPaned * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_HISTORY_TYPE_PANED, GitgHistoryPaned);
	G_OBJECT_CLASS (gitg_history_paned_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_history_paned_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgHistoryPanedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_history_paned_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgHistoryPaned), 0, (GInstanceInitFunc) gitg_history_paned_instance_init, NULL };
	GType gitg_history_paned_type_id;
	gitg_history_paned_type_id = g_type_register_static (GITG_TYPE_ANIMATED_PANED, "GitgHistoryPaned", &g_define_type_info, 0);
	GitgHistoryPaned_private_offset = g_type_add_instance_private (gitg_history_paned_type_id, sizeof (GitgHistoryPanedPrivate));
	return gitg_history_paned_type_id;
}

GType
gitg_history_paned_get_type (void)
{
	static gsize gitg_history_paned_type_id__once = 0;
	if (g_once_init_enter (&gitg_history_paned_type_id__once)) {
		GType gitg_history_paned_type_id;
		gitg_history_paned_type_id = gitg_history_paned_get_type_once ();
		g_once_init_leave (&gitg_history_paned_type_id__once, gitg_history_paned_type_id);
	}
	return gitg_history_paned_type_id__once;
}

static void
_vala_gitg_history_paned_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	GitgHistoryPaned * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_HISTORY_TYPE_PANED, GitgHistoryPaned);
	switch (property_id) {
		case GITG_HISTORY_PANED_INNER_ORIENTATION_PROPERTY:
		g_value_set_enum (value, gitg_history_paned_get_inner_orientation (self));
		break;
		case GITG_HISTORY_PANED_REFS_LIST_PROPERTY:
		g_value_set_object (value, gitg_history_paned_get_refs_list (self));
		break;
		case GITG_HISTORY_PANED_COMMIT_LIST_VIEW_PROPERTY:
		g_value_set_object (value, gitg_history_paned_get_commit_list_view (self));
		break;
		case GITG_HISTORY_PANED_PANED_PANELS_PROPERTY:
		g_value_set_object (value, gitg_history_paned_get_paned_panels (self));
		break;
		case GITG_HISTORY_PANED_STACK_PANEL_PROPERTY:
		g_value_set_object (value, gitg_history_paned_get_stack_panel (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_history_paned_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	GitgHistoryPaned * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_HISTORY_TYPE_PANED, GitgHistoryPaned);
	switch (property_id) {
		case GITG_HISTORY_PANED_INNER_ORIENTATION_PROPERTY:
		gitg_history_paned_set_inner_orientation (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

