/* gitg-ui-elements.c generated by valac 0.32.1, the Vala compiler
 * generated from gitg-ui-elements.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.h>
#include <glib-object.h>
#include <libpeas/peas.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include "libgitg-ext/libgitg-ext.h"
#include <gtk/gtk.h>


#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;
typedef struct _GitgUIElementsPrivate GitgUIElementsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _t_destroy_func0(var) (((var == NULL) || (t_destroy_func == NULL)) ? NULL : (var = (t_destroy_func (var), NULL)))

struct _GitgUIElements {
	GObject parent_instance;
	GitgUIElementsPrivate * priv;
};

struct _GitgUIElementsClass {
	GObjectClass parent_class;
};

struct _GitgUIElementsPrivate {
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	PeasExtensionSet* d_extensions;
	GeeHashMap* d_elements;
	GList* d_available_elements;
	GitgExtUIElement* d_current;
	GtkStack* d_stack;
	GeeHashMap* d_builtin_elements;
};

typedef gboolean (*GitgUIElementsForeachUIElementFunc) (GitgExtUIElement* element, void* user_data);

static gpointer gitg_ui_elements_parent_class = NULL;

GType gitg_ui_elements_get_type (void) G_GNUC_CONST;
#define GITG_UI_ELEMENTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GITG_TYPE_UI_ELEMENTS, GitgUIElementsPrivate))
enum  {
	GITG_UI_ELEMENTS_DUMMY_PROPERTY,
	GITG_UI_ELEMENTS_T_TYPE,
	GITG_UI_ELEMENTS_T_DUP_FUNC,
	GITG_UI_ELEMENTS_T_DESTROY_FUNC,
	GITG_UI_ELEMENTS_CURRENT
};
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
void gitg_ui_elements_update (GitgUIElements* self);
static gboolean gitg_ui_elements_is_available (GitgUIElements* self, GitgExtUIElement* element);
static void gitg_ui_elements_remove_available (GitgUIElements* self, GitgExtUIElement* e);
static void gitg_ui_elements_add_available (GitgUIElements* self, GitgExtUIElement* e);
static void gitg_ui_elements_set_first_enabled_current (GitgUIElements* self);
static void gitg_ui_elements_set_current_impl (GitgUIElements* self, GitgExtUIElement* element);
gpointer gitg_ui_elements_lookup (GitgUIElements* self, const gchar* id);
static gboolean gitg_ui_elements_order_after (GitgUIElements* self, GitgExtUIElement* a, GitgExtUIElement* b);
static void gitg_ui_elements_available_changed (GitgUIElements* self, GObject* o, GParamSpec* spec);
static void gitg_ui_elements_enabled_changed (GitgUIElements* self, GObject* o, GParamSpec* spec);
static void gitg_ui_elements_on_element_activate (GitgUIElements* self, GitgExtUIElement* e);
static void gitg_ui_elements_add_ui_element (GitgUIElements* self, GitgExtUIElement* e);
static void _gitg_ui_elements_available_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _gitg_ui_elements_enabled_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _gitg_ui_elements_on_element_activate_gitg_ext_ui_element_activate (GitgExtUIElement* _sender, gpointer self);
static void gitg_ui_elements_remove_ui_element (GitgUIElements* self, GitgExtUIElement* e);
static void gitg_ui_elements_extension_initial (GitgUIElements* self, PeasExtensionSet* s, PeasPluginInfo* info, GObject* obj);
static void gitg_ui_elements_extension_added (GitgUIElements* self, PeasExtensionSet* s, PeasPluginInfo* info, GObject* obj);
static void gitg_ui_elements_extension_removed (GitgUIElements* self, PeasExtensionSet* s, PeasPluginInfo* info, GObject* obj);
void gitg_ui_elements_foreach (GitgUIElements* self, GitgUIElementsForeachUIElementFunc func, void* func_target);
static void gitg_ui_elements_on_visible_child_changed (GitgUIElements* self, GObject* obj, GParamSpec* pspec);
GitgUIElements* gitg_ui_elements_new_with_builtin (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, gpointer* builtin, int builtin_length1, PeasExtensionSet* extensions, GtkStack* stack);
GitgUIElements* gitg_ui_elements_construct_with_builtin (GType object_type, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, gpointer* builtin, int builtin_length1, PeasExtensionSet* extensions, GtkStack* stack);
static void _gitg_ui_elements_extension_initial_peas_extension_set_foreach_func (PeasExtensionSet* set, PeasPluginInfo* info, PeasExtension* exten, gpointer self);
static void _gitg_ui_elements_extension_added_peas_extension_set_extension_added (PeasExtensionSet* _sender, PeasPluginInfo* info, GObject* exten, gpointer self);
static void _gitg_ui_elements_extension_removed_peas_extension_set_extension_removed (PeasExtensionSet* _sender, PeasPluginInfo* info, GObject* exten, gpointer self);
static void _gitg_ui_elements_on_visible_child_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
GitgUIElements* gitg_ui_elements_new (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, PeasExtensionSet* extensions, GtkStack* stack);
GitgUIElements* gitg_ui_elements_construct (GType object_type, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, PeasExtensionSet* extensions, GtkStack* stack);
gconstpointer gitg_ui_elements_get_current (GitgUIElements* self);
void gitg_ui_elements_set_current (GitgUIElements* self, gconstpointer value);
gpointer* gitg_ui_elements_get_available_elements (GitgUIElements* self, int* result_length1);
static void _vala_array_add20 (gpointer** array, int* length, int* size, gpointer value);
static void gitg_ui_elements_finalize (GObject* obj);
static void _vala_gitg_ui_elements_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gitg_ui_elements_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static void _g_object_unref0_ (gpointer var) {
#line 27 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 129 "gitg-ui-elements.c"
}


static void _g_list_free__g_object_unref0_ (GList* self) {
#line 27 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
#line 27 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_list_free (self);
#line 138 "gitg-ui-elements.c"
}


void gitg_ui_elements_update (GitgUIElements* self) {
#line 69 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 145 "gitg-ui-elements.c"
	{
		GeeIterator* _elem_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp0_ = self->priv->d_elements;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp2_ = _tmp1_;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp3_ = _tmp2_;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp5_ = _tmp4_;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_object_unref0 (_tmp3_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_elem_it = _tmp5_;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		while (TRUE) {
#line 172 "gitg-ui-elements.c"
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GitgExtUIElement* elem = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			gboolean wasavail = FALSE;
			GitgExtUIElement* _tmp10_ = NULL;
			gboolean _tmp11_ = FALSE;
			gboolean isavail = FALSE;
			GitgExtUIElement* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
			gboolean _tmp14_ = FALSE;
			gboolean _tmp15_ = FALSE;
			gboolean _tmp16_ = FALSE;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp6_ = _elem_it;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			if (!_tmp7_) {
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				break;
#line 195 "gitg-ui-elements.c"
			}
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp8_ = _elem_it;
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			elem = (GitgExtUIElement*) _tmp9_;
#line 74 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp10_ = elem;
#line 74 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp11_ = gitg_ui_elements_is_available (self, _tmp10_);
#line 74 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			wasavail = _tmp11_;
#line 75 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp12_ = elem;
#line 75 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp13_ = gitg_ext_ui_element_get_available (_tmp12_);
#line 75 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp14_ = _tmp13_;
#line 75 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			isavail = _tmp14_;
#line 77 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp16_ = wasavail;
#line 77 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			if (_tmp16_) {
#line 221 "gitg-ui-elements.c"
				gboolean _tmp17_ = FALSE;
#line 77 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp17_ = isavail;
#line 77 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp15_ = !_tmp17_;
#line 227 "gitg-ui-elements.c"
			} else {
#line 77 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp15_ = FALSE;
#line 231 "gitg-ui-elements.c"
			}
#line 77 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			if (_tmp15_) {
#line 235 "gitg-ui-elements.c"
				GitgExtUIElement* _tmp18_ = NULL;
#line 79 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp18_ = elem;
#line 79 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				gitg_ui_elements_remove_available (self, _tmp18_);
#line 241 "gitg-ui-elements.c"
			} else {
				gboolean _tmp19_ = FALSE;
				gboolean _tmp20_ = FALSE;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp20_ = wasavail;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				if (!_tmp20_) {
#line 249 "gitg-ui-elements.c"
					gboolean _tmp21_ = FALSE;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_tmp21_ = isavail;
#line 81 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_tmp19_ = _tmp21_;
#line 255 "gitg-ui-elements.c"
				} else {
#line 81 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_tmp19_ = FALSE;
#line 259 "gitg-ui-elements.c"
				}
#line 81 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				if (_tmp19_) {
#line 263 "gitg-ui-elements.c"
					GitgExtUIElement* _tmp22_ = NULL;
#line 83 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_tmp22_ = elem;
#line 83 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					gitg_ui_elements_add_available (self, _tmp22_);
#line 269 "gitg-ui-elements.c"
				} else {
					gboolean _tmp23_ = FALSE;
#line 85 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_tmp23_ = wasavail;
#line 85 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					if (_tmp23_) {
#line 276 "gitg-ui-elements.c"
						gboolean _tmp24_ = FALSE;
						GitgExtUIElement* _tmp25_ = NULL;
						gboolean _tmp26_ = FALSE;
						gboolean _tmp27_ = FALSE;
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
						_tmp25_ = elem;
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
						_tmp26_ = gitg_ext_ui_element_get_enabled (_tmp25_);
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
						_tmp27_ = _tmp26_;
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
						if (!_tmp27_) {
#line 289 "gitg-ui-elements.c"
							GitgExtUIElement* _tmp28_ = NULL;
							GitgExtUIElement* _tmp29_ = NULL;
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
							_tmp28_ = self->priv->d_current;
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
							_tmp29_ = elem;
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
							_tmp24_ = _tmp28_ == _tmp29_;
#line 298 "gitg-ui-elements.c"
						} else {
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
							_tmp24_ = FALSE;
#line 302 "gitg-ui-elements.c"
						}
#line 87 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
						if (_tmp24_) {
#line 89 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
							_g_object_unref0 (self->priv->d_current);
#line 89 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
							self->priv->d_current = NULL;
#line 310 "gitg-ui-elements.c"
						}
					}
				}
			}
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_g_object_unref0 (elem);
#line 317 "gitg-ui-elements.c"
		}
#line 72 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_object_unref0 (_elem_it);
#line 321 "gitg-ui-elements.c"
	}
#line 94 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_set_first_enabled_current (self);
#line 325 "gitg-ui-elements.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return self ? g_object_ref (self) : NULL;
#line 332 "gitg-ui-elements.c"
}


static void gitg_ui_elements_set_first_enabled_current (GitgUIElements* self) {
	GitgExtUIElement* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
#line 97 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 99 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_current;
#line 99 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp0_ != NULL) {
#line 101 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return;
#line 347 "gitg-ui-elements.c"
	}
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = self->priv->d_available_elements;
#line 351 "gitg-ui-elements.c"
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		item_collection = _tmp1_;
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
#line 359 "gitg-ui-elements.c"
			GitgExtUIElement* _tmp2_ = NULL;
			GitgExtUIElement* item = NULL;
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp2_ = _g_object_ref0 ((GitgExtUIElement*) item_it->data);
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			item = _tmp2_;
#line 366 "gitg-ui-elements.c"
			{
				GitgExtUIElement* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				gboolean _tmp5_ = FALSE;
#line 106 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp3_ = item;
#line 106 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp4_ = gitg_ext_ui_element_get_enabled (_tmp3_);
#line 106 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp5_ = _tmp4_;
#line 106 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				if (_tmp5_) {
#line 379 "gitg-ui-elements.c"
					GitgExtUIElement* _tmp6_ = NULL;
#line 108 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_tmp6_ = item;
#line 108 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					gitg_ui_elements_set_current_impl (self, _tmp6_);
#line 109 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					_g_object_unref0 (item);
#line 109 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					break;
#line 389 "gitg-ui-elements.c"
				}
#line 104 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_g_object_unref0 (item);
#line 393 "gitg-ui-elements.c"
			}
		}
	}
}


gpointer gitg_ui_elements_lookup (GitgUIElements* self, const gchar* id) {
	gpointer result = NULL;
	GeeHashMap* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
#line 114 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 114 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 116 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_elements;
#line 116 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = id;
#line 116 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
#line 116 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	result = (gpointer) ((GitgExtUIElement*) _tmp2_);
#line 116 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return result;
#line 419 "gitg-ui-elements.c"
}


static gboolean gitg_ui_elements_is_available (GitgUIElements* self, GitgExtUIElement* element) {
	gboolean result = FALSE;
	GList* _tmp0_ = NULL;
	GitgExtUIElement* _tmp1_ = NULL;
	GList* _tmp2_ = NULL;
#line 119 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 119 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (element != NULL, FALSE);
#line 121 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_available_elements;
#line 121 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = element;
#line 121 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = g_list_find (_tmp0_, _tmp1_);
#line 121 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	result = _tmp2_ != NULL;
#line 121 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return result;
#line 442 "gitg-ui-elements.c"
}


static void gitg_ui_elements_set_current_impl (GitgUIElements* self, GitgExtUIElement* element) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GitgExtUIElement* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GitgExtUIElement* _tmp15_ = NULL;
	GitgExtUIElement* _tmp16_ = NULL;
	GitgExtUIElement* _tmp17_ = NULL;
	GitgExtUIElement* _tmp18_ = NULL;
	GtkStack* _tmp19_ = NULL;
	GitgExtUIElement* _tmp25_ = NULL;
#line 124 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 124 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (element != NULL);
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = element;
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = gitg_ext_ui_element_get_available (_tmp3_);
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp5_ = _tmp4_;
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (!_tmp5_) {
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp2_ = TRUE;
#line 473 "gitg-ui-elements.c"
	} else {
		GitgExtUIElement* _tmp6_ = NULL;
		gboolean _tmp7_ = FALSE;
		gboolean _tmp8_ = FALSE;
#line 127 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp6_ = element;
#line 127 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp7_ = gitg_ext_ui_element_get_enabled (_tmp6_);
#line 127 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp8_ = _tmp7_;
#line 127 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp2_ = !_tmp8_;
#line 486 "gitg-ui-elements.c"
	}
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp2_) {
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp1_ = TRUE;
#line 492 "gitg-ui-elements.c"
	} else {
		gboolean _tmp9_ = FALSE;
		GitgExtUIElement* _tmp10_ = NULL;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp10_ = self->priv->d_current;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		if (_tmp10_ != NULL) {
#line 500 "gitg-ui-elements.c"
			GitgExtUIElement* _tmp11_ = NULL;
			GitgExtUIElement* _tmp12_ = NULL;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp11_ = self->priv->d_current;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp12_ = element;
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp9_ = _tmp11_ == _tmp12_;
#line 509 "gitg-ui-elements.c"
		} else {
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp9_ = FALSE;
#line 513 "gitg-ui-elements.c"
		}
#line 128 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp1_ = _tmp9_;
#line 517 "gitg-ui-elements.c"
	}
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp1_) {
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp0_ = TRUE;
#line 523 "gitg-ui-elements.c"
	} else {
		GitgExtUIElement* _tmp13_ = NULL;
		gboolean _tmp14_ = FALSE;
#line 129 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp13_ = element;
#line 129 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp14_ = gitg_ui_elements_is_available (self, _tmp13_);
#line 129 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp0_ = !_tmp14_;
#line 533 "gitg-ui-elements.c"
	}
#line 126 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp0_) {
#line 131 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return;
#line 539 "gitg-ui-elements.c"
	}
#line 134 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp15_ = self->priv->d_current;
#line 134 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp16_ = element;
#line 134 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp15_ == _tmp16_) {
#line 136 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return;
#line 549 "gitg-ui-elements.c"
	}
#line 139 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp17_ = element;
#line 139 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp18_ = _g_object_ref0 (_tmp17_);
#line 139 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_current);
#line 139 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_current = _tmp18_;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp19_ = self->priv->d_stack;
#line 141 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp19_ != NULL) {
#line 563 "gitg-ui-elements.c"
		GtkStack* _tmp20_ = NULL;
		GitgExtUIElement* _tmp21_ = NULL;
		GtkWidget* _tmp22_ = NULL;
		GtkWidget* _tmp23_ = NULL;
		GtkWidget* _tmp24_ = NULL;
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp20_ = self->priv->d_stack;
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp21_ = element;
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp22_ = gitg_ext_ui_element_get_widget (_tmp21_);
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp23_ = _tmp22_;
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp24_ = _tmp23_;
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		gtk_stack_set_visible_child (_tmp20_, _tmp24_);
#line 143 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_object_unref0 (_tmp24_);
#line 583 "gitg-ui-elements.c"
	}
#line 146 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_object_notify ((GObject*) self, "current");
#line 147 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp25_ = element;
#line 147 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_emit_by_name (_tmp25_, "activate");
#line 591 "gitg-ui-elements.c"
}


static void gitg_ui_elements_remove_available (GitgUIElements* self, GitgExtUIElement* e) {
	GitgExtUIElement* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	GitgExtUIElement* _tmp2_ = NULL;
	GitgExtUIElement* _tmp3_ = NULL;
	GtkStack* _tmp4_ = NULL;
	GitgExtUIElement* _tmp5_ = NULL;
	GtkWidget* _tmp6_ = NULL;
	GtkWidget* _tmp7_ = NULL;
	GtkWidget* _tmp8_ = NULL;
	GitgExtUIElement* _tmp9_ = NULL;
#line 150 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 150 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (e != NULL);
#line 152 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = e;
#line 152 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = gitg_ui_elements_is_available (self, _tmp0_);
#line 152 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (!_tmp1_) {
#line 154 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return;
#line 618 "gitg-ui-elements.c"
	}
#line 157 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = e;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = self->priv->d_current;
#line 157 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp2_ == _tmp3_) {
#line 159 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_object_unref0 (self->priv->d_current);
#line 159 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		self->priv->d_current = NULL;
#line 630 "gitg-ui-elements.c"
	}
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = self->priv->d_stack;
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp5_ = e;
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = gitg_ext_ui_element_get_widget (_tmp5_);
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp7_ = _tmp6_;
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp8_ = _tmp7_;
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gtk_container_remove ((GtkContainer*) _tmp4_, _tmp8_);
#line 162 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (_tmp8_);
#line 163 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp9_ = e;
#line 163 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_available_elements = g_list_remove (self->priv->d_available_elements, _tmp9_);
#line 650 "gitg-ui-elements.c"
}


static gboolean gitg_ui_elements_order_after (GitgUIElements* self, GitgExtUIElement* a, GitgExtUIElement* b) {
	gboolean result = FALSE;
	gboolean ab = FALSE;
	GeeHashMap* _tmp0_ = NULL;
	GitgExtUIElement* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean bb = FALSE;
	GeeHashMap* _tmp7_ = NULL;
	GitgExtUIElement* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_ = FALSE;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	GitgExtUIElement* _tmp37_ = NULL;
	GitgExtUIElement* _tmp38_ = NULL;
	gint _tmp39_ = 0;
#line 166 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (a != NULL, FALSE);
#line 166 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (b != NULL, FALSE);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_builtin_elements;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = a;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = gitg_ext_ui_element_get_id (_tmp1_);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = _tmp2_;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = _tmp3_;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp5_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp4_);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = _tmp5_;
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp4_);
#line 168 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	ab = _tmp6_;
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp7_ = self->priv->d_builtin_elements;
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp8_ = b;
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp9_ = gitg_ext_ui_element_get_id (_tmp8_);
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp10_ = _tmp9_;
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp11_ = _tmp10_;
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp12_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp7_, _tmp11_);
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp13_ = _tmp12_;
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp11_);
#line 169 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	bb = _tmp13_;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp14_ = ab;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp15_ = bb;
#line 171 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp14_ != _tmp15_) {
#line 727 "gitg-ui-elements.c"
		gboolean _tmp16_ = FALSE;
		gboolean _tmp17_ = FALSE;
#line 173 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp17_ = ab;
#line 173 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		if (_tmp17_) {
#line 173 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp16_ = FALSE;
#line 736 "gitg-ui-elements.c"
		} else {
#line 173 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp16_ = TRUE;
#line 740 "gitg-ui-elements.c"
		}
#line 173 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		result = _tmp16_;
#line 173 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return result;
#line 746 "gitg-ui-elements.c"
	}
#line 176 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp19_ = ab;
#line 176 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp19_) {
#line 752 "gitg-ui-elements.c"
		gboolean _tmp20_ = FALSE;
#line 176 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp20_ = bb;
#line 176 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp18_ = _tmp20_;
#line 758 "gitg-ui-elements.c"
	} else {
#line 176 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp18_ = FALSE;
#line 762 "gitg-ui-elements.c"
	}
#line 176 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp18_) {
#line 766 "gitg-ui-elements.c"
		gint ai = 0;
		GeeHashMap* _tmp21_ = NULL;
		GitgExtUIElement* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gpointer _tmp26_ = NULL;
		gint _tmp27_ = 0;
		gint bi = 0;
		GeeHashMap* _tmp28_ = NULL;
		GitgExtUIElement* _tmp29_ = NULL;
		gchar* _tmp30_ = NULL;
		gchar* _tmp31_ = NULL;
		gchar* _tmp32_ = NULL;
		gpointer _tmp33_ = NULL;
		gint _tmp34_ = 0;
		gint _tmp35_ = 0;
		gint _tmp36_ = 0;
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp21_ = self->priv->d_builtin_elements;
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp22_ = a;
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp23_ = gitg_ext_ui_element_get_id (_tmp22_);
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp24_ = _tmp23_;
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp25_ = _tmp24_;
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp26_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp21_, _tmp25_);
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp27_ = (gint) ((gintptr) _tmp26_);
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_free0 (_tmp25_);
#line 178 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		ai = _tmp27_;
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp28_ = self->priv->d_builtin_elements;
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp29_ = b;
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp30_ = gitg_ext_ui_element_get_id (_tmp29_);
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp31_ = _tmp30_;
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp32_ = _tmp31_;
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp33_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp28_, _tmp32_);
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp34_ = (gint) ((gintptr) _tmp33_);
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_free0 (_tmp32_);
#line 179 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		bi = _tmp34_;
#line 181 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp35_ = ai;
#line 181 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp36_ = bi;
#line 181 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		result = _tmp35_ > _tmp36_;
#line 181 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return result;
#line 829 "gitg-ui-elements.c"
	}
#line 184 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp37_ = a;
#line 184 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp38_ = b;
#line 184 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp39_ = gitg_ext_ui_element_negotiate_order (_tmp37_, _tmp38_);
#line 184 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	result = _tmp39_ > 0;
#line 184 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return result;
#line 841 "gitg-ui-elements.c"
}


static void gitg_ui_elements_add_available (GitgUIElements* self, GitgExtUIElement* e) {
	gint insert_position = 0;
	GList* item = NULL;
	GList* _tmp0_ = NULL;
	GitgExtUIElement* _tmp10_ = NULL;
	GitgExtUIElement* _tmp11_ = NULL;
	gint _tmp12_ = 0;
	GtkStack* _tmp13_ = NULL;
	GitgExtUIElement* _tmp14_ = NULL;
	GtkWidget* _tmp15_ = NULL;
	GtkWidget* _tmp16_ = NULL;
	GtkWidget* _tmp17_ = NULL;
	GitgExtUIElement* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	GitgExtUIElement* _tmp22_ = NULL;
	gchar* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	gchar* _tmp25_ = NULL;
	GitgExtUIElement* _tmp26_ = NULL;
	gchar* _tmp27_ = NULL;
	gchar* _tmp28_ = NULL;
	gchar* _tmp29_ = NULL;
	gint _tmp30_ = 0;
#line 187 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 187 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (e != NULL);
#line 189 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	insert_position = 0;
#line 190 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_available_elements;
#line 190 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	item = _tmp0_;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	while (TRUE) {
#line 882 "gitg-ui-elements.c"
		gboolean _tmp1_ = FALSE;
		GList* _tmp2_ = NULL;
		GList* _tmp7_ = NULL;
		GList* _tmp8_ = NULL;
		gint _tmp9_ = 0;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp2_ = item;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		if (_tmp2_ != NULL) {
#line 892 "gitg-ui-elements.c"
			GitgExtUIElement* _tmp3_ = NULL;
			GList* _tmp4_ = NULL;
			gconstpointer _tmp5_ = NULL;
			gboolean _tmp6_ = FALSE;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp3_ = e;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp4_ = item;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp5_ = _tmp4_->data;
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp6_ = gitg_ui_elements_order_after (self, _tmp3_, (GitgExtUIElement*) _tmp5_);
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp1_ = _tmp6_;
#line 907 "gitg-ui-elements.c"
		} else {
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp1_ = FALSE;
#line 911 "gitg-ui-elements.c"
		}
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		if (!_tmp1_) {
#line 192 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			break;
#line 917 "gitg-ui-elements.c"
		}
#line 194 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp7_ = item;
#line 194 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp8_ = _tmp7_->next;
#line 194 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		item = _tmp8_;
#line 195 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp9_ = insert_position;
#line 195 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		insert_position = _tmp9_ + 1;
#line 929 "gitg-ui-elements.c"
	}
#line 198 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp10_ = e;
#line 198 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp11_ = _g_object_ref0 (_tmp10_);
#line 198 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp12_ = insert_position;
#line 198 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_available_elements = g_list_insert (self->priv->d_available_elements, _tmp11_, _tmp12_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp13_ = self->priv->d_stack;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp14_ = e;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp15_ = gitg_ext_ui_element_get_widget (_tmp14_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp16_ = _tmp15_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp17_ = _tmp16_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp18_ = e;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp19_ = gitg_ext_ui_element_get_id (_tmp18_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp20_ = _tmp19_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp21_ = _tmp20_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp22_ = e;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp23_ = gitg_ext_ui_element_get_description (_tmp22_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp24_ = _tmp23_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp25_ = _tmp24_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp26_ = e;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp27_ = gitg_ext_ui_element_get_icon (_tmp26_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp28_ = _tmp27_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp29_ = _tmp28_;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp30_ = insert_position;
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gtk_container_add_with_properties ((GtkContainer*) _tmp13_, _tmp17_, "name", _tmp21_, "title", _tmp25_, "icon-name", _tmp29_, "position", _tmp30_, NULL);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp29_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp25_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp21_);
#line 200 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (_tmp17_);
#line 985 "gitg-ui-elements.c"
}


static void gitg_ui_elements_available_changed (GitgUIElements* self, GObject* o, GParamSpec* spec) {
#line 207 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 207 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (o != NULL);
#line 207 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (spec != NULL);
#line 209 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_update (self);
#line 998 "gitg-ui-elements.c"
}


static void gitg_ui_elements_enabled_changed (GitgUIElements* self, GObject* o, GParamSpec* spec) {
	GitgExtUIElement* e = NULL;
	GObject* _tmp0_ = NULL;
	GitgExtUIElement* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	GtkWidget* _tmp3_ = NULL;
	GtkWidget* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
#line 212 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 212 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (o != NULL);
#line 212 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (spec != NULL);
#line 214 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = o;
#line 214 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GITG_EXT_TYPE_UI_ELEMENT) ? ((GitgExtUIElement*) _tmp0_) : NULL);
#line 214 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	e = _tmp1_;
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = gitg_ext_ui_element_get_widget (e);
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = _tmp2_;
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = _tmp3_;
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp5_ = gitg_ext_ui_element_get_enabled (e);
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = _tmp5_;
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gtk_widget_set_sensitive (_tmp4_, _tmp6_);
#line 215 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (_tmp4_);
#line 212 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (e);
#line 1039 "gitg-ui-elements.c"
}


static void gitg_ui_elements_on_element_activate (GitgUIElements* self, GitgExtUIElement* e) {
	GitgExtUIElement* _tmp0_ = NULL;
#line 218 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 218 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (e != NULL);
#line 220 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = e;
#line 220 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_set_current_impl (self, _tmp0_);
#line 1053 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_available_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 232 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_available_changed ((GitgUIElements*) self, _sender, pspec);
#line 1060 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_enabled_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 233 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_enabled_changed ((GitgUIElements*) self, _sender, pspec);
#line 1067 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_on_element_activate_gitg_ext_ui_element_activate (GitgExtUIElement* _sender, gpointer self) {
#line 235 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_on_element_activate ((GitgUIElements*) self, _sender);
#line 1074 "gitg-ui-elements.c"
}


static void gitg_ui_elements_add_ui_element (GitgUIElements* self, GitgExtUIElement* e) {
	GeeHashMap* _tmp0_ = NULL;
	GitgExtUIElement* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	GitgExtUIElement* _tmp5_ = NULL;
	GitgExtUIElement* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	GitgExtUIElement* _tmp10_ = NULL;
	GitgExtUIElement* _tmp11_ = NULL;
	GitgExtUIElement* _tmp12_ = NULL;
#line 223 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 223 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (e != NULL);
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_elements;
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = e;
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = gitg_ext_ui_element_get_id (_tmp1_);
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = _tmp2_;
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = _tmp3_;
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp5_ = e;
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp4_, _tmp5_);
#line 225 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp4_);
#line 227 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = e;
#line 227 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp7_ = gitg_ext_ui_element_get_available (_tmp6_);
#line 227 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp8_ = _tmp7_;
#line 227 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp8_) {
#line 1119 "gitg-ui-elements.c"
		GitgExtUIElement* _tmp9_ = NULL;
#line 229 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp9_ = e;
#line 229 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		gitg_ui_elements_add_available (self, _tmp9_);
#line 1125 "gitg-ui-elements.c"
	}
#line 232 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp10_ = e;
#line 232 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_connect_object ((GObject*) _tmp10_, "notify::available", (GCallback) _gitg_ui_elements_available_changed_g_object_notify, self, 0);
#line 233 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp11_ = e;
#line 233 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_connect_object ((GObject*) _tmp11_, "notify::enabled", (GCallback) _gitg_ui_elements_enabled_changed_g_object_notify, self, 0);
#line 235 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp12_ = e;
#line 235 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_connect_object (_tmp12_, "activate", (GCallback) _gitg_ui_elements_on_element_activate_gitg_ext_ui_element_activate, self, 0);
#line 1139 "gitg-ui-elements.c"
}


static void gitg_ui_elements_remove_ui_element (GitgUIElements* self, GitgExtUIElement* e) {
	GitgExtUIElement* _tmp0_ = NULL;
	GitgExtUIElement* _tmp1_ = NULL;
	guint _tmp2_ = 0U;
	GQuark _tmp3_ = 0U;
	GitgExtUIElement* _tmp4_ = NULL;
	guint _tmp5_ = 0U;
	GeeHashMap* _tmp6_ = NULL;
	GitgExtUIElement* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
#line 238 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 238 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (e != NULL);
#line 240 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = e;
#line 240 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_remove_available (self, _tmp0_);
#line 242 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = e;
#line 242 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_parse_name ("notify::available", G_TYPE_OBJECT, &_tmp2_, &_tmp3_, TRUE);
#line 242 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_handlers_disconnect_matched ((GObject*) _tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, _tmp3_, NULL, (GCallback) _gitg_ui_elements_available_changed_g_object_notify, self);
#line 243 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = e;
#line 243 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_parse_name ("activate", GITG_EXT_TYPE_UI_ELEMENT, &_tmp5_, NULL, FALSE);
#line 243 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _gitg_ui_elements_on_element_activate_gitg_ext_ui_element_activate, self);
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = self->priv->d_elements;
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp7_ = e;
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp8_ = gitg_ext_ui_element_get_id (_tmp7_);
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp9_ = _tmp8_;
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp10_ = _tmp9_;
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp6_, _tmp10_, NULL);
#line 245 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (_tmp10_);
#line 1189 "gitg-ui-elements.c"
}


static void gitg_ui_elements_extension_initial (GitgUIElements* self, PeasExtensionSet* s, PeasPluginInfo* info, GObject* obj) {
	GObject* _tmp0_ = NULL;
#line 248 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 248 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (s != NULL);
#line 248 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (info != NULL);
#line 248 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (obj != NULL);
#line 252 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = obj;
#line 252 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_add_ui_element (self, G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GITG_EXT_TYPE_UI_ELEMENT) ? ((GitgExtUIElement*) _tmp0_) : NULL);
#line 1207 "gitg-ui-elements.c"
}


static void gitg_ui_elements_extension_added (GitgUIElements* self, PeasExtensionSet* s, PeasPluginInfo* info, GObject* obj) {
	GObject* _tmp0_ = NULL;
#line 255 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 255 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (s != NULL);
#line 255 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (info != NULL);
#line 255 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (obj != NULL);
#line 259 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = obj;
#line 259 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_add_ui_element (self, G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GITG_EXT_TYPE_UI_ELEMENT) ? ((GitgExtUIElement*) _tmp0_) : NULL);
#line 260 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_set_first_enabled_current (self);
#line 1227 "gitg-ui-elements.c"
}


static void gitg_ui_elements_extension_removed (GitgUIElements* self, PeasExtensionSet* s, PeasPluginInfo* info, GObject* obj) {
	GObject* _tmp0_ = NULL;
#line 263 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 263 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (s != NULL);
#line 263 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (info != NULL);
#line 263 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (obj != NULL);
#line 267 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = obj;
#line 267 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_remove_ui_element (self, G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GITG_EXT_TYPE_UI_ELEMENT) ? ((GitgExtUIElement*) _tmp0_) : NULL);
#line 1245 "gitg-ui-elements.c"
}


void gitg_ui_elements_foreach (GitgUIElements* self, GitgUIElementsForeachUIElementFunc func, void* func_target) {
	GList* vals = NULL;
	GList* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	GList* _tmp2_ = NULL;
#line 272 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 274 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_available_elements;
#line 274 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = g_list_copy (_tmp0_);
#line 274 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	vals = _tmp1_;
#line 276 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = vals;
#line 1264 "gitg-ui-elements.c"
	{
		GList* val_collection = NULL;
		GList* val_it = NULL;
#line 276 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		val_collection = _tmp2_;
#line 276 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		for (val_it = val_collection; val_it != NULL; val_it = val_it->next) {
#line 1272 "gitg-ui-elements.c"
			GitgExtUIElement* val = NULL;
#line 276 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			val = (GitgExtUIElement*) val_it->data;
#line 1276 "gitg-ui-elements.c"
			{
				GitgUIElementsForeachUIElementFunc _tmp3_ = NULL;
				void* _tmp3__target = NULL;
				GitgExtUIElement* _tmp4_ = NULL;
				gboolean _tmp5_ = FALSE;
#line 278 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp3_ = func;
#line 278 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp3__target = func_target;
#line 278 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp4_ = val;
#line 278 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp5_ = _tmp3_ (_tmp4_, _tmp3__target);
#line 278 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				if (!_tmp5_) {
#line 280 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
					break;
#line 1294 "gitg-ui-elements.c"
				}
			}
		}
	}
#line 272 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_list_free0 (vals);
#line 1301 "gitg-ui-elements.c"
}


static void gitg_ui_elements_on_visible_child_changed (GitgUIElements* self, GObject* obj, GParamSpec* pspec) {
	gchar* name = NULL;
	GtkStack* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
#line 285 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 285 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (obj != NULL);
#line 285 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (pspec != NULL);
#line 287 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_stack;
#line 287 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = gtk_stack_get_visible_child_name (_tmp0_);
#line 287 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 287 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	name = _tmp2_;
#line 289 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = name;
#line 289 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp3_ != NULL) {
#line 1329 "gitg-ui-elements.c"
		GeeHashMap* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		gpointer _tmp6_ = NULL;
		GitgExtUIElement* _tmp7_ = NULL;
#line 291 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp4_ = self->priv->d_elements;
#line 291 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp5_ = name;
#line 291 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp4_, _tmp5_);
#line 291 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp7_ = (GitgExtUIElement*) _tmp6_;
#line 291 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		gitg_ui_elements_set_current_impl (self, _tmp7_);
#line 291 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_g_object_unref0 (_tmp7_);
#line 1346 "gitg-ui-elements.c"
	}
#line 285 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_free0 (name);
#line 1350 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_extension_initial_peas_extension_set_foreach_func (PeasExtensionSet* set, PeasPluginInfo* info, PeasExtension* exten, gpointer self) {
#line 316 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_extension_initial ((GitgUIElements*) self, set, info, exten);
#line 1357 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_extension_added_peas_extension_set_extension_added (PeasExtensionSet* _sender, PeasPluginInfo* info, GObject* exten, gpointer self) {
#line 319 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_extension_added ((GitgUIElements*) self, _sender, info, exten);
#line 1364 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_extension_removed_peas_extension_set_extension_removed (PeasExtensionSet* _sender, PeasPluginInfo* info, GObject* exten, gpointer self) {
#line 320 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_extension_removed ((GitgUIElements*) self, _sender, info, exten);
#line 1371 "gitg-ui-elements.c"
}


static void _gitg_ui_elements_on_visible_child_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 324 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_on_visible_child_changed ((GitgUIElements*) self, _sender, pspec);
#line 1378 "gitg-ui-elements.c"
}


GitgUIElements* gitg_ui_elements_construct_with_builtin (GType object_type, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, gpointer* builtin, int builtin_length1, PeasExtensionSet* extensions, GtkStack* stack) {
	GitgUIElements * self = NULL;
	PeasExtensionSet* _tmp0_ = NULL;
	PeasExtensionSet* _tmp1_ = NULL;
	GtkStack* _tmp2_ = NULL;
	GtkStack* _tmp3_ = NULL;
	GeeHashMap* _tmp4_ = NULL;
	GeeHashMap* _tmp5_ = NULL;
	gint i = 0;
	gpointer* _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	PeasExtensionSet* _tmp17_ = NULL;
	PeasExtensionSet* _tmp18_ = NULL;
	PeasExtensionSet* _tmp19_ = NULL;
	GtkStack* _tmp20_ = NULL;
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (extensions != NULL, NULL);
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self = (GitgUIElements*) g_object_new (object_type, NULL);
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->t_type = t_type;
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->t_dup_func = t_dup_func;
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->t_destroy_func = t_destroy_func;
#line 299 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = extensions;
#line 299 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 299 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_extensions);
#line 299 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_extensions = _tmp1_;
#line 300 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = stack;
#line 300 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 300 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_stack);
#line 300 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_stack = _tmp3_;
#line 301 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp4_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_INT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 301 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_builtin_elements);
#line 301 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_builtin_elements = _tmp4_;
#line 303 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp5_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, GITG_EXT_TYPE_UI_ELEMENT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 303 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_elements);
#line 303 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->d_elements = _tmp5_;
#line 305 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	i = 0;
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = builtin;
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6__length1 = builtin_length1;
#line 1441 "gitg-ui-elements.c"
	{
		gpointer* b_collection = NULL;
		gint b_collection_length1 = 0;
		gint _b_collection_size_ = 0;
		gint b_it = 0;
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		b_collection = _tmp6_;
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		b_collection_length1 = _tmp6__length1;
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		for (b_it = 0; b_it < _tmp6__length1; b_it = b_it + 1) {
#line 1453 "gitg-ui-elements.c"
			gpointer _tmp7_ = NULL;
			gpointer b = NULL;
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp7_ = ((b_collection[b_it] != NULL) && (t_dup_func != NULL)) ? t_dup_func ((gpointer) b_collection[b_it]) : ((gpointer) b_collection[b_it]);
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			b = _tmp7_;
#line 1460 "gitg-ui-elements.c"
			{
				GitgExtUIElement* elem = NULL;
				gconstpointer _tmp8_ = NULL;
				GitgExtUIElement* _tmp9_ = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GitgExtUIElement* _tmp11_ = NULL;
				gchar* _tmp12_ = NULL;
				gchar* _tmp13_ = NULL;
				gchar* _tmp14_ = NULL;
				gint _tmp15_ = 0;
				GitgExtUIElement* _tmp16_ = NULL;
#line 309 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp8_ = b;
#line 309 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GITG_EXT_TYPE_UI_ELEMENT, GitgExtUIElement));
#line 309 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				elem = _tmp9_;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp10_ = self->priv->d_builtin_elements;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp11_ = elem;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp12_ = gitg_ext_ui_element_get_id (_tmp11_);
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp13_ = _tmp12_;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp14_ = _tmp13_;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp15_ = i;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				i = _tmp15_ + 1;
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				gee_abstract_map_set ((GeeAbstractMap*) _tmp10_, _tmp14_, (gpointer) ((gintptr) _tmp15_));
#line 311 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_g_free0 (_tmp14_);
#line 312 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp16_ = elem;
#line 312 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				gitg_ui_elements_add_ui_element (self, _tmp16_);
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_g_object_unref0 (elem);
#line 307 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_t_destroy_func0 (b);
#line 1504 "gitg-ui-elements.c"
			}
		}
	}
#line 316 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp17_ = self->priv->d_extensions;
#line 316 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	peas_extension_set_foreach (_tmp17_, _gitg_ui_elements_extension_initial_peas_extension_set_foreach_func, self);
#line 317 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_set_first_enabled_current (self);
#line 319 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp18_ = self->priv->d_extensions;
#line 319 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_connect_object (_tmp18_, "extension-added", (GCallback) _gitg_ui_elements_extension_added_peas_extension_set_extension_added, self, 0);
#line 320 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp19_ = self->priv->d_extensions;
#line 320 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_signal_connect_object (_tmp19_, "extension-removed", (GCallback) _gitg_ui_elements_extension_removed_peas_extension_set_extension_removed, self, 0);
#line 322 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp20_ = self->priv->d_stack;
#line 322 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp20_ != NULL) {
#line 1526 "gitg-ui-elements.c"
		GtkStack* _tmp21_ = NULL;
#line 324 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp21_ = self->priv->d_stack;
#line 324 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		g_signal_connect_object ((GObject*) _tmp21_, "notify::visible-child", (GCallback) _gitg_ui_elements_on_visible_child_changed_g_object_notify, self, 0);
#line 1532 "gitg-ui-elements.c"
	}
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return self;
#line 1536 "gitg-ui-elements.c"
}


GitgUIElements* gitg_ui_elements_new_with_builtin (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, gpointer* builtin, int builtin_length1, PeasExtensionSet* extensions, GtkStack* stack) {
#line 295 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return gitg_ui_elements_construct_with_builtin (GITG_TYPE_UI_ELEMENTS, t_type, t_dup_func, t_destroy_func, builtin, builtin_length1, extensions, stack);
#line 1543 "gitg-ui-elements.c"
}


GitgUIElements* gitg_ui_elements_construct (GType object_type, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, PeasExtensionSet* extensions, GtkStack* stack) {
	GitgUIElements * self = NULL;
	gpointer* _tmp0_ = NULL;
	gpointer* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	PeasExtensionSet* _tmp2_ = NULL;
	GtkStack* _tmp3_ = NULL;
#line 328 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (extensions != NULL, NULL);
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = g_new0 (gpointer, 0);
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = _tmp0_;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1__length1 = 0;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp2_ = extensions;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp3_ = stack;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self = (GitgUIElements*) gitg_ui_elements_construct_with_builtin (object_type, t_type, t_dup_func, t_destroy_func, _tmp1_, 0, _tmp2_, _tmp3_);
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->t_type = t_type;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->t_dup_func = t_dup_func;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv->t_destroy_func = t_destroy_func;
#line 331 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = (_vala_array_free (_tmp1_, _tmp1__length1, (GDestroyNotify) t_destroy_func), NULL);
#line 328 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return self;
#line 1578 "gitg-ui-elements.c"
}


GitgUIElements* gitg_ui_elements_new (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, PeasExtensionSet* extensions, GtkStack* stack) {
#line 328 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return gitg_ui_elements_construct (GITG_TYPE_UI_ELEMENTS, t_type, t_dup_func, t_destroy_func, extensions, stack);
#line 1585 "gitg-ui-elements.c"
}


gconstpointer gitg_ui_elements_get_current (GitgUIElements* self) {
	gconstpointer result;
	GitgExtUIElement* _tmp0_ = NULL;
#line 34 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 36 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = self->priv->d_current;
#line 36 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp0_ != NULL) {
#line 1598 "gitg-ui-elements.c"
		GitgExtUIElement* _tmp1_ = NULL;
#line 38 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp1_ = self->priv->d_current;
#line 38 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		result = (gconstpointer) _tmp1_;
#line 38 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return result;
#line 1606 "gitg-ui-elements.c"
	} else {
#line 42 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		result = NULL;
#line 42 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		return result;
#line 1612 "gitg-ui-elements.c"
	}
}


void gitg_ui_elements_set_current (GitgUIElements* self, gconstpointer value) {
	gconstpointer _tmp0_ = NULL;
#line 45 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_if_fail (self != NULL);
#line 47 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = value;
#line 47 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (_tmp0_ != NULL) {
#line 1625 "gitg-ui-elements.c"
		gconstpointer _tmp1_ = NULL;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		_tmp1_ = value;
#line 49 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		gitg_ui_elements_set_current_impl (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GITG_EXT_TYPE_UI_ELEMENT, GitgExtUIElement));
#line 1631 "gitg-ui-elements.c"
	}
#line 45 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_object_notify ((GObject *) self, "current");
#line 1635 "gitg-ui-elements.c"
}


static void _vala_array_add20 (gpointer** array, int* length, int* size, gpointer value) {
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if ((*length) == (*size)) {
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		*array = g_renew (gpointer, *array, (*size) + 1);
#line 1646 "gitg-ui-elements.c"
	}
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	(*array)[(*length)++] = value;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	(*array)[*length] = NULL;
#line 1652 "gitg-ui-elements.c"
}


gpointer* gitg_ui_elements_get_available_elements (GitgUIElements* self, int* result_length1) {
	gpointer* result;
	gpointer* ret = NULL;
	gpointer* _tmp0_ = NULL;
	gint ret_length1 = 0;
	gint _ret_size_ = 0;
	GList* _tmp1_ = NULL;
	gpointer* _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
#line 56 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 58 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp0_ = g_new0 (gpointer, 0);
#line 58 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	ret = _tmp0_;
#line 58 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	ret_length1 = 0;
#line 58 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_ret_size_ = ret_length1;
#line 60 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp1_ = self->priv->d_available_elements;
#line 1677 "gitg-ui-elements.c"
	{
		GList* elem_collection = NULL;
		GList* elem_it = NULL;
#line 60 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		elem_collection = _tmp1_;
#line 60 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		for (elem_it = elem_collection; elem_it != NULL; elem_it = elem_it->next) {
#line 1685 "gitg-ui-elements.c"
			GitgExtUIElement* _tmp2_ = NULL;
			GitgExtUIElement* elem = NULL;
#line 60 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			_tmp2_ = _g_object_ref0 ((GitgExtUIElement*) elem_it->data);
#line 60 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
			elem = _tmp2_;
#line 1692 "gitg-ui-elements.c"
			{
				gpointer* _tmp3_ = NULL;
				gint _tmp3__length1 = 0;
				GitgExtUIElement* _tmp4_ = NULL;
				gpointer _tmp5_ = NULL;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp3_ = ret;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp3__length1 = ret_length1;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp4_ = elem;
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_tmp5_ = ((((gconstpointer) _tmp4_) != NULL) && (self->priv->t_dup_func != NULL)) ? self->priv->t_dup_func ((gpointer) ((gconstpointer) _tmp4_)) : ((gpointer) ((gconstpointer) _tmp4_));
#line 62 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_vala_array_add20 (&ret, &ret_length1, &_ret_size_, _tmp5_);
#line 60 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
				_g_object_unref0 (elem);
#line 1710 "gitg-ui-elements.c"
			}
		}
	}
#line 65 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6_ = ret;
#line 65 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_tmp6__length1 = ret_length1;
#line 65 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	if (result_length1) {
#line 65 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		*result_length1 = _tmp6__length1;
#line 1722 "gitg-ui-elements.c"
	}
#line 65 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	result = _tmp6_;
#line 65 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	return result;
#line 1728 "gitg-ui-elements.c"
}


static void gitg_ui_elements_class_init (GitgUIElementsClass * klass) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	gitg_ui_elements_parent_class = g_type_class_peek_parent (klass);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_type_class_add_private (klass, sizeof (GitgUIElementsPrivate));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_ui_elements_get_property;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_ui_elements_set_property;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	G_OBJECT_CLASS (klass)->finalize = gitg_ui_elements_finalize;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_UI_ELEMENTS_T_TYPE, g_param_spec_gtype ("t-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_UI_ELEMENTS_T_DUP_FUNC, g_param_spec_pointer ("t-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_UI_ELEMENTS_T_DESTROY_FUNC, g_param_spec_pointer ("t-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_UI_ELEMENTS_CURRENT, g_param_spec_pointer ("current", "current", "current", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 1751 "gitg-ui-elements.c"
}


static void gitg_ui_elements_instance_init (GitgUIElements * self) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self->priv = GITG_UI_ELEMENTS_GET_PRIVATE (self);
#line 1758 "gitg-ui-elements.c"
}


static void gitg_ui_elements_finalize (GObject* obj) {
	GitgUIElements * self;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_UI_ELEMENTS, GitgUIElements);
#line 25 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_extensions);
#line 26 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_elements);
#line 27 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	__g_list_free__g_object_unref0_0 (self->priv->d_available_elements);
#line 28 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_current);
#line 29 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_stack);
#line 30 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	_g_object_unref0 (self->priv->d_builtin_elements);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	G_OBJECT_CLASS (gitg_ui_elements_parent_class)->finalize (obj);
#line 1780 "gitg-ui-elements.c"
}


GType gitg_ui_elements_get_type (void) {
	static volatile gsize gitg_ui_elements_type_id__volatile = 0;
	if (g_once_init_enter (&gitg_ui_elements_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GitgUIElementsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_ui_elements_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgUIElements), 0, (GInstanceInitFunc) gitg_ui_elements_instance_init, NULL };
		GType gitg_ui_elements_type_id;
		gitg_ui_elements_type_id = g_type_register_static (G_TYPE_OBJECT, "GitgUIElements", &g_define_type_info, 0);
		g_once_init_leave (&gitg_ui_elements_type_id__volatile, gitg_ui_elements_type_id);
	}
	return gitg_ui_elements_type_id__volatile;
}


static void _vala_gitg_ui_elements_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GitgUIElements * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_UI_ELEMENTS, GitgUIElements);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	switch (property_id) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		case GITG_UI_ELEMENTS_CURRENT:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		g_value_set_pointer (value, gitg_ui_elements_get_current (self));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 1807 "gitg-ui-elements.c"
		default:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 1813 "gitg-ui-elements.c"
	}
}


static void _vala_gitg_ui_elements_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GitgUIElements * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_UI_ELEMENTS, GitgUIElements);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
	switch (property_id) {
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		case GITG_UI_ELEMENTS_CURRENT:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		gitg_ui_elements_set_current (self, g_value_get_pointer (value));
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		case GITG_UI_ELEMENTS_T_TYPE:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		self->priv->t_type = g_value_get_gtype (value);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		case GITG_UI_ELEMENTS_T_DUP_FUNC:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		self->priv->t_dup_func = g_value_get_pointer (value);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		case GITG_UI_ELEMENTS_T_DESTROY_FUNC:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		self->priv->t_destroy_func = g_value_get_pointer (value);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 1847 "gitg-ui-elements.c"
		default:
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 23 "/home/jesse/dev/gitg/gitg/gitg-ui-elements.vala"
		break;
#line 1853 "gitg-ui-elements.c"
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



