/* itemhelp.c generated by valac 0.22.1, the Vala compiler
 * generated from itemhelp.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_ITEM_HELP (item_help_get_type ())
#define ITEM_HELP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ITEM_HELP, ItemHelp))
#define ITEM_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ITEM_HELP, ItemHelpClass))
#define IS_ITEM_HELP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ITEM_HELP))
#define IS_ITEM_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ITEM_HELP))
#define ITEM_HELP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ITEM_HELP, ItemHelpClass))

typedef struct _ItemHelp ItemHelp;
typedef struct _ItemHelpClass ItemHelpClass;
typedef struct _ItemHelpPrivate ItemHelpPrivate;

#define TYPE_MENU_MODEL (menu_model_get_type ())
#define MENU_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MENU_MODEL, MenuModel))
#define MENU_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MENU_MODEL, MenuModelClass))
#define IS_MENU_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MENU_MODEL))
#define IS_MENU_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MENU_MODEL))
#define MENU_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MENU_MODEL, MenuModelClass))

typedef struct _MenuModel MenuModel;
typedef struct _MenuModelClass MenuModelClass;

#define TYPE_INDICATOR (indicator_get_type ())
#define INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_INDICATOR, Indicator))
#define INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_INDICATOR, IndicatorClass))
#define IS_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_INDICATOR))
#define IS_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_INDICATOR))
#define INDICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_INDICATOR, IndicatorClass))

typedef struct _Indicator Indicator;
typedef struct _IndicatorClass IndicatorClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_PROVIDERS (providers_get_type ())
#define PROVIDERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROVIDERS, Providers))
#define PROVIDERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROVIDERS, ProvidersClass))
#define IS_PROVIDERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROVIDERS))
#define IS_PROVIDERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROVIDERS))
#define PROVIDERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROVIDERS, ProvidersClass))

typedef struct _Providers Providers;
typedef struct _ProvidersClass ProvidersClass;

#define TYPE_PROVIDER (provider_get_type ())
#define PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROVIDER, Provider))
#define PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROVIDER, ProviderClass))
#define IS_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROVIDER))
#define IS_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROVIDER))
#define PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROVIDER, ProviderClass))

typedef struct _Provider Provider;
typedef struct _ProviderClass ProviderClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_EXPRESSION_CACHE (expression_cache_get_type ())
#define EXPRESSION_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPRESSION_CACHE, ExpressionCache))
#define EXPRESSION_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPRESSION_CACHE, ExpressionCacheClass))
#define IS_EXPRESSION_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPRESSION_CACHE))
#define IS_EXPRESSION_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPRESSION_CACHE))
#define EXPRESSION_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPRESSION_CACHE, ExpressionCacheClass))

typedef struct _ExpressionCache ExpressionCache;
typedef struct _ExpressionCacheClass ExpressionCacheClass;

struct _ItemHelp {
	GObject parent_instance;
	ItemHelpPrivate * priv;
};

struct _ItemHelpClass {
	GObjectClass parent_class;
};

struct _ItemHelpPrivate {
	GtkDialog* items;
	MenuModel* menumodel;
	GtkTreeStore* itemstore;
	GtkTreeView* itemview;
	Indicator* _indicator;
};


static gpointer item_help_parent_class = NULL;

GType item_help_get_type (void) G_GNUC_CONST;
GType menu_model_get_type (void) G_GNUC_CONST;
GType indicator_get_type (void) G_GNUC_CONST;
#define ITEM_HELP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ITEM_HELP, ItemHelpPrivate))
enum  {
	ITEM_HELP_DUMMY_PROPERTY,
	ITEM_HELP_INDICATOR
};
ItemHelp* item_help_new (Indicator* indicator);
ItemHelp* item_help_construct (GType object_type, Indicator* indicator);
void item_help_show (ItemHelp* self);
GObject* utils_get_ui (const gchar* objectid, GObject* signalhandlers, gchar** additional, int additional_length1, GtkBuilder** builder);
Indicator* item_help_get_indicator (ItemHelp* self);
GType providers_get_type (void) G_GNUC_CONST;
Providers* indicator_get_providers (Indicator* self);
MenuModel* menu_model_new (Providers* providers);
MenuModel* menu_model_construct (GType object_type, Providers* providers);
GType provider_get_type (void) G_GNUC_CONST;
Provider** providers_get_providers (Providers* self, int* result_length1);
const gchar* provider_get_id (Provider* self);
gchar** provider_get_keys (Provider* self, int* result_length1);
static gchar** _vala_array_dup15 (gchar** self, int length);
gchar provider_get_displaytype (Provider* self);
static void _vala_array_add12 (gchar*** array, int* length, int* size, gchar* value);
void menu_model_set_expressions (MenuModel* self, gchar** value, int value_length1);
void item_help_update (ItemHelp* self);
void item_help_on_itemhelpdialog_destroy (GtkWidget* source, ItemHelp* self);
void item_help_on_itemhelpdialog_response (GtkDialog* source, gint response, ItemHelp* self);
void menu_model_update (MenuModel* self);
static gboolean __lambda15_ (ItemHelp* self, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter);
GType expression_cache_get_type (void) G_GNUC_CONST;
ExpressionCache* menu_model_expression (MenuModel* self, guint index);
gchar* expression_cache_label (ExpressionCache* self);
static gboolean ___lambda15__gtk_tree_model_foreach_func (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer self);
static void item_help_set_indicator (ItemHelp* self, Indicator* value);
static void item_help_finalize (GObject* obj);
static void _vala_item_help_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_item_help_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);


ItemHelp* item_help_construct (GType object_type, Indicator* indicator) {
	ItemHelp * self = NULL;
	Indicator* _tmp0_ = NULL;
	g_return_val_if_fail (IS_INDICATOR (indicator), NULL);
	_tmp0_ = indicator;
	self = (ItemHelp*) g_object_new (object_type, "indicator", _tmp0_, NULL);
	return self;
}


ItemHelp* item_help_new (Indicator* indicator) {
	return item_help_construct (TYPE_ITEM_HELP, indicator);
}


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


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


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


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


void item_help_show (ItemHelp* self) {
	GtkDialog* _tmp0_ = NULL;
	GtkBuilder* builder = NULL;
	gchar* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	GtkBuilder* _tmp5_ = NULL;
	GObject* _tmp6_ = NULL;
	GtkDialog* _tmp7_ = NULL;
	GtkDialog* _tmp8_ = NULL;
	GtkBuilder* _tmp9_ = NULL;
	GObject* _tmp10_ = NULL;
	GtkBuilder* _tmp11_ = NULL;
	GObject* _tmp12_ = NULL;
	GtkTreeStore* _tmp13_ = NULL;
	Indicator* _tmp14_ = NULL;
	Providers* _tmp15_ = NULL;
	Providers* _tmp16_ = NULL;
	MenuModel* _tmp17_ = NULL;
	gchar** expressions = NULL;
	gchar** _tmp18_ = NULL;
	gint expressions_length1 = 0;
	gint _expressions_size_ = 0;
	Indicator* _tmp19_ = NULL;
	Providers* _tmp20_ = NULL;
	Providers* _tmp21_ = NULL;
	Provider** _tmp22_ = NULL;
	gint _tmp22__length1 = 0;
	Provider** _tmp23_ = NULL;
	gint _tmp23__length1 = 0;
	MenuModel* _tmp81_ = NULL;
	gchar** _tmp82_ = NULL;
	gint _tmp82__length1 = 0;
	GtkTreeView* _tmp83_ = NULL;
	GtkDialog* _tmp84_ = NULL;
	g_return_if_fail (IS_ITEM_HELP (self));
	_tmp0_ = self->priv->items;
	if (_tmp0_ != NULL) {
		GtkDialog* _tmp1_ = NULL;
		_tmp1_ = self->priv->items;
		gtk_window_present (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_WINDOW, GtkWindow));
		return;
	}
	_tmp2_ = g_strdup ("itemhelpstore");
	_tmp3_ = g_new0 (gchar*, 1 + 1);
	_tmp3_[0] = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp4__length1 = 1;
	_tmp6_ = utils_get_ui ("itemhelpdialog", G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), _tmp4_, 1, &_tmp5_);
	_g_object_unref0 (builder);
	builder = _tmp5_;
	_tmp7_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, GTK_TYPE_DIALOG) ? ((GtkDialog*) _tmp6_) : NULL;
	if (_tmp7_ == NULL) {
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (self->priv->items);
	self->priv->items = _tmp7_;
	_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	_tmp8_ = self->priv->items;
	g_return_if_fail (_tmp8_ != NULL);
	_tmp9_ = builder;
	_tmp10_ = gtk_builder_get_object (_tmp9_, "itemhelpstore");
	self->priv->itemstore = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GTK_TYPE_TREE_STORE) ? ((GtkTreeStore*) _tmp10_) : NULL;
	_tmp11_ = builder;
	_tmp12_ = gtk_builder_get_object (_tmp11_, "itemhelpview");
	self->priv->itemview = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GTK_TYPE_TREE_VIEW) ? ((GtkTreeView*) _tmp12_) : NULL;
	_tmp13_ = self->priv->itemstore;
	gtk_tree_store_clear (_tmp13_);
	_tmp14_ = self->priv->_indicator;
	_tmp15_ = indicator_get_providers (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = menu_model_new (_tmp16_);
	_g_object_unref0 (self->priv->menumodel);
	self->priv->menumodel = _tmp17_;
	_tmp18_ = g_new0 (gchar*, 0 + 1);
	expressions = _tmp18_;
	expressions_length1 = 0;
	_expressions_size_ = expressions_length1;
	_tmp19_ = self->priv->_indicator;
	_tmp20_ = indicator_get_providers (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = providers_get_providers (_tmp21_, &_tmp22__length1);
	_tmp23_ = _tmp22_;
	_tmp23__length1 = _tmp22__length1;
	{
		Provider** provider_collection = NULL;
		gint provider_collection_length1 = 0;
		gint _provider_collection_size_ = 0;
		gint provider_it = 0;
		provider_collection = _tmp23_;
		provider_collection_length1 = _tmp23__length1;
		for (provider_it = 0; provider_it < _tmp23__length1; provider_it = provider_it + 1) {
			Provider* _tmp24_ = NULL;
			Provider* provider = NULL;
			_tmp24_ = _g_object_ref0 (provider_collection[provider_it]);
			provider = _tmp24_;
			{
				GtkTreeIter parent = {0};
				GtkTreeStore* _tmp25_ = NULL;
				Provider* _tmp26_ = NULL;
				const gchar* _tmp27_ = NULL;
				const gchar* _tmp28_ = NULL;
				GtkTreeIter _tmp29_ = {0};
				gchar** keys = NULL;
				Provider* _tmp30_ = NULL;
				gchar** _tmp31_ = NULL;
				gint _tmp31__length1 = 0;
				gchar** _tmp32_ = NULL;
				gint _tmp32__length1 = 0;
				gchar** _tmp33_ = NULL;
				gint _tmp33__length1 = 0;
				gint keys_length1 = 0;
				gint _keys_size_ = 0;
				_tmp25_ = self->priv->itemstore;
				_tmp26_ = provider;
				_tmp27_ = provider_get_id (_tmp26_);
				_tmp28_ = _tmp27_;
				gtk_tree_store_insert_with_values (_tmp25_, &_tmp29_, NULL, -1, 0, _tmp28_, 3, -1, -1);
				parent = _tmp29_;
				_tmp30_ = provider;
				_tmp31_ = provider_get_keys (_tmp30_, &_tmp31__length1);
				_tmp32_ = _tmp31_;
				_tmp32__length1 = _tmp31__length1;
				_tmp33_ = (_tmp32_ != NULL) ? _vala_array_dup15 (_tmp32_, _tmp32__length1) : ((gpointer) _tmp32_);
				_tmp33__length1 = _tmp32__length1;
				keys = _tmp33_;
				keys_length1 = _tmp33__length1;
				_keys_size_ = keys_length1;
				{
					guint i = 0U;
					guint isize = 0U;
					gchar** _tmp34_ = NULL;
					gint _tmp34__length1 = 0;
					i = (guint) 0;
					_tmp34_ = keys;
					_tmp34__length1 = keys_length1;
					isize = (guint) _tmp34__length1;
					{
						gboolean _tmp35_ = FALSE;
						_tmp35_ = TRUE;
						while (TRUE) {
							gboolean _tmp36_ = FALSE;
							guint _tmp38_ = 0U;
							guint _tmp39_ = 0U;
							gchar* variable = NULL;
							Provider* _tmp40_ = NULL;
							const gchar* _tmp41_ = NULL;
							const gchar* _tmp42_ = NULL;
							const gchar* _tmp43_ = NULL;
							gchar** _tmp44_ = NULL;
							gint _tmp44__length1 = 0;
							guint _tmp45_ = 0U;
							const gchar* _tmp46_ = NULL;
							const gchar* _tmp47_ = NULL;
							gchar* _tmp48_ = NULL;
							gchar* expression = NULL;
							gchar* _tmp49_ = NULL;
							Provider* _tmp50_ = NULL;
							gchar _tmp51_ = '\0';
							gchar _tmp52_ = '\0';
							gchar** _tmp71_ = NULL;
							gint _tmp71__length1 = 0;
							const gchar* _tmp72_ = NULL;
							gchar* _tmp73_ = NULL;
							GtkTreeStore* _tmp74_ = NULL;
							GtkTreeIter _tmp75_ = {0};
							gchar** _tmp76_ = NULL;
							gint _tmp76__length1 = 0;
							guint _tmp77_ = 0U;
							const gchar* _tmp78_ = NULL;
							const gchar* _tmp79_ = NULL;
							gchar** _tmp80_ = NULL;
							gint _tmp80__length1 = 0;
							_tmp36_ = _tmp35_;
							if (!_tmp36_) {
								guint _tmp37_ = 0U;
								_tmp37_ = i;
								i = _tmp37_ + 1;
							}
							_tmp35_ = FALSE;
							_tmp38_ = i;
							_tmp39_ = isize;
							if (!(_tmp38_ < _tmp39_)) {
								break;
							}
							_tmp40_ = provider;
							_tmp41_ = provider_get_id (_tmp40_);
							_tmp42_ = _tmp41_;
							_tmp43_ = string_to_string (_tmp42_);
							_tmp44_ = keys;
							_tmp44__length1 = keys_length1;
							_tmp45_ = i;
							_tmp46_ = _tmp44_[_tmp45_];
							_tmp47_ = string_to_string (_tmp46_);
							_tmp48_ = g_strconcat (_tmp43_, ".", _tmp47_, NULL);
							variable = _tmp48_;
							_tmp49_ = g_strdup ("");
							expression = _tmp49_;
							_tmp50_ = provider;
							_tmp51_ = provider_get_displaytype (_tmp50_);
							_tmp52_ = _tmp51_;
							switch (_tmp52_) {
								case 'd':
								{
									const gchar* _tmp53_ = NULL;
									const gchar* _tmp54_ = NULL;
									gchar* _tmp55_ = NULL;
									_tmp53_ = variable;
									_tmp54_ = string_to_string (_tmp53_);
									_tmp55_ = g_strconcat ("$", "(decimals(", _tmp54_, ",2))", NULL);
									_g_free0 (expression);
									expression = _tmp55_;
									break;
								}
								case 'p':
								{
									const gchar* _tmp56_ = NULL;
									const gchar* _tmp57_ = NULL;
									gchar* _tmp58_ = NULL;
									_tmp56_ = variable;
									_tmp57_ = string_to_string (_tmp56_);
									_tmp58_ = g_strconcat ("$", "(percent(", _tmp57_, "))", NULL);
									_g_free0 (expression);
									expression = _tmp58_;
									break;
								}
								case 's':
								{
									const gchar* _tmp59_ = NULL;
									const gchar* _tmp60_ = NULL;
									gchar* _tmp61_ = NULL;
									_tmp59_ = variable;
									_tmp60_ = string_to_string (_tmp59_);
									_tmp61_ = g_strconcat ("$", "(speed(", _tmp60_, "))", NULL);
									_g_free0 (expression);
									expression = _tmp61_;
									break;
								}
								case 'i':
								{
									const gchar* _tmp62_ = NULL;
									const gchar* _tmp63_ = NULL;
									gchar* _tmp64_ = NULL;
									_tmp62_ = variable;
									_tmp63_ = string_to_string (_tmp62_);
									_tmp64_ = g_strconcat ("$", "(size(", _tmp63_, "))", NULL);
									_g_free0 (expression);
									expression = _tmp64_;
									break;
								}
								case 'f':
								{
									const gchar* _tmp65_ = NULL;
									const gchar* _tmp66_ = NULL;
									gchar* _tmp67_ = NULL;
									_tmp65_ = variable;
									_tmp66_ = string_to_string (_tmp65_);
									_tmp67_ = g_strconcat ("$", "(frequency(", _tmp66_, "))", NULL);
									_g_free0 (expression);
									expression = _tmp67_;
									break;
								}
								default:
								{
									const gchar* _tmp68_ = NULL;
									const gchar* _tmp69_ = NULL;
									gchar* _tmp70_ = NULL;
									_tmp68_ = variable;
									_tmp69_ = string_to_string (_tmp68_);
									_tmp70_ = g_strconcat ("$", "(", _tmp69_, ")", NULL);
									_g_free0 (expression);
									expression = _tmp70_;
									break;
								}
							}
							_tmp71_ = expressions;
							_tmp71__length1 = expressions_length1;
							_tmp72_ = expression;
							_tmp73_ = g_strdup (_tmp72_);
							_vala_array_add12 (&expressions, &expressions_length1, &_expressions_size_, _tmp73_);
							_tmp74_ = self->priv->itemstore;
							_tmp75_ = parent;
							_tmp76_ = keys;
							_tmp76__length1 = keys_length1;
							_tmp77_ = i;
							_tmp78_ = _tmp76_[_tmp77_];
							_tmp79_ = expression;
							_tmp80_ = expressions;
							_tmp80__length1 = expressions_length1;
							gtk_tree_store_insert_with_values (_tmp74_, NULL, &_tmp75_, -1, 0, _tmp78_, 1, _tmp79_, 3, _tmp80__length1 - 1, -1);
							_g_free0 (expression);
							_g_free0 (variable);
						}
					}
				}
				keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (provider);
			}
		}
	}
	_tmp81_ = self->priv->menumodel;
	_tmp82_ = expressions;
	_tmp82__length1 = expressions_length1;
	menu_model_set_expressions (_tmp81_, _tmp82_, _tmp82__length1);
	item_help_update (self);
	_tmp83_ = self->priv->itemview;
	gtk_tree_view_expand_all (_tmp83_);
	_tmp84_ = self->priv->items;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp84_, GTK_TYPE_WIDGET, GtkWidget));
	expressions = (_vala_array_free (expressions, expressions_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (builder);
}


void item_help_on_itemhelpdialog_destroy (GtkWidget* source, ItemHelp* self) {
	g_return_if_fail (IS_ITEM_HELP (self));
	g_return_if_fail (GTK_IS_WIDGET (source));
	_g_object_unref0 (self->priv->items);
	self->priv->items = NULL;
	_g_object_unref0 (self->priv->menumodel);
	self->priv->menumodel = NULL;
}


void item_help_on_itemhelpdialog_response (GtkDialog* source, gint response, ItemHelp* self) {
	gint _tmp0_ = 0;
	g_return_if_fail (IS_ITEM_HELP (self));
	g_return_if_fail (GTK_IS_DIALOG (source));
	_tmp0_ = response;
	switch (_tmp0_) {
		case 0:
		{
			GtkDialog* _tmp1_ = NULL;
			_tmp1_ = source;
			gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_WIDGET, GtkWidget));
			return;
		}
		default:
		break;
	}
}


static gboolean __lambda15_ (ItemHelp* self, GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter) {
	gboolean result = FALSE;
	gint index = 0;
	GtkTreeModel* _tmp0_ = NULL;
	GtkTreeIter _tmp1_ = {0};
	gint _tmp2_ = 0;
	g_return_val_if_fail (GTK_IS_TREE_MODEL (model), FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = model;
	_tmp1_ = *iter;
	gtk_tree_model_get (_tmp0_, &_tmp1_, 3, &index, -1);
	_tmp2_ = index;
	if (_tmp2_ >= 0) {
		GtkTreeStore* _tmp3_ = NULL;
		GtkTreeIter _tmp4_ = {0};
		MenuModel* _tmp5_ = NULL;
		gint _tmp6_ = 0;
		ExpressionCache* _tmp7_ = NULL;
		ExpressionCache* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		_tmp3_ = self->priv->itemstore;
		_tmp4_ = *iter;
		_tmp5_ = self->priv->menumodel;
		_tmp6_ = index;
		_tmp7_ = menu_model_expression (_tmp5_, (guint) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = expression_cache_label (_tmp8_);
		_tmp10_ = _tmp9_;
		gtk_tree_store_set (_tmp3_, &_tmp4_, 2, _tmp10_, -1);
		_g_free0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda15__gtk_tree_model_foreach_func (GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer self) {
	gboolean result;
	result = __lambda15_ (self, model, path, iter);
	return result;
}


void item_help_update (ItemHelp* self) {
	GtkDialog* _tmp0_ = NULL;
	MenuModel* _tmp1_ = NULL;
	GtkTreeStore* _tmp2_ = NULL;
	g_return_if_fail (IS_ITEM_HELP (self));
	_tmp0_ = self->priv->items;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->menumodel;
	menu_model_update (_tmp1_);
	_tmp2_ = self->priv->itemstore;
	gtk_tree_model_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_TREE_MODEL, GtkTreeModel), ___lambda15__gtk_tree_model_foreach_func, self);
}


Indicator* item_help_get_indicator (ItemHelp* self) {
	Indicator* result;
	Indicator* _tmp0_ = NULL;
	g_return_val_if_fail (IS_ITEM_HELP (self), NULL);
	_tmp0_ = self->priv->_indicator;
	result = _tmp0_;
	return result;
}


static void item_help_set_indicator (ItemHelp* self, Indicator* value) {
	Indicator* _tmp0_ = NULL;
	Indicator* _tmp1_ = NULL;
	g_return_if_fail (IS_ITEM_HELP (self));
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_indicator);
	self->priv->_indicator = _tmp1_;
	g_object_notify ((GObject *) self, "indicator");
}


static void item_help_class_init (ItemHelpClass * klass) {
	item_help_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ItemHelpPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_item_help_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_item_help_set_property;
	G_OBJECT_CLASS (klass)->finalize = item_help_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ITEM_HELP_INDICATOR, g_param_spec_object ("indicator", "indicator", "indicator", TYPE_INDICATOR, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void item_help_instance_init (ItemHelp * self) {
	self->priv = ITEM_HELP_GET_PRIVATE (self);
}


static void item_help_finalize (GObject* obj) {
	ItemHelp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ITEM_HELP, ItemHelp);
	_g_object_unref0 (self->priv->items);
	_g_object_unref0 (self->priv->menumodel);
	_g_object_unref0 (self->priv->_indicator);
	G_OBJECT_CLASS (item_help_parent_class)->finalize (obj);
}


/******************************************************************************
 * Copyright (C) 2011-2013  Michael Hofmann <mh21@mh21.de>                    *
 *                                                                            *
 * This program 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 3 of the License, or          *
 * (at your option) any later version.                                        *
 *                                                                            *
 * This program 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 this program; if not, write to the Free Software Foundation, Inc.,    *
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                *
 ******************************************************************************/
GType item_help_get_type (void) {
	static volatile gsize item_help_type_id__volatile = 0;
	if (g_once_init_enter (&item_help_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ItemHelpClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) item_help_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ItemHelp), 0, (GInstanceInitFunc) item_help_instance_init, NULL };
		GType item_help_type_id;
		item_help_type_id = g_type_register_static (G_TYPE_OBJECT, "ItemHelp", &g_define_type_info, 0);
		g_once_init_leave (&item_help_type_id__volatile, item_help_type_id);
	}
	return item_help_type_id__volatile;
}


static void _vala_item_help_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ItemHelp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_ITEM_HELP, ItemHelp);
	switch (property_id) {
		case ITEM_HELP_INDICATOR:
		g_value_set_object (value, item_help_get_indicator (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_item_help_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ItemHelp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_ITEM_HELP, ItemHelp);
	switch (property_id) {
		case ITEM_HELP_INDICATOR:
		item_help_set_indicator (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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



