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

/* vim:set et sts=4 sw=4:
 *
 * ibus - The Input Bus
 *
 * Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

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


#define TYPE_CANDIDATE_AREA (candidate_area_get_type ())
#define CANDIDATE_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CANDIDATE_AREA, CandidateArea))
#define CANDIDATE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CANDIDATE_AREA, CandidateAreaClass))
#define IS_CANDIDATE_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CANDIDATE_AREA))
#define IS_CANDIDATE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CANDIDATE_AREA))
#define CANDIDATE_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CANDIDATE_AREA, CandidateAreaClass))

typedef struct _CandidateArea CandidateArea;
typedef struct _CandidateAreaClass CandidateAreaClass;
typedef struct _CandidateAreaPrivate CandidateAreaPrivate;
#define _pango_attribute_destroy0(var) ((var == NULL) ? NULL : (var = (pango_attribute_destroy (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_PangoAttrList_free0(var) ((var == NULL) ? NULL : (var = (_vala_PangoAttrList_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

#define TYPE_VSEPARATOR (vseparator_get_type ())
#define VSEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VSEPARATOR, VSeparator))
#define VSEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VSEPARATOR, VSeparatorClass))
#define IS_VSEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VSEPARATOR))
#define IS_VSEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VSEPARATOR))
#define VSEPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VSEPARATOR, VSeparatorClass))

typedef struct _VSeparator VSeparator;
typedef struct _VSeparatorClass VSeparatorClass;

#define TYPE_HSEPARATOR (hseparator_get_type ())
#define HSEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HSEPARATOR, HSeparator))
#define HSEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HSEPARATOR, HSeparatorClass))
#define IS_HSEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HSEPARATOR))
#define IS_HSEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HSEPARATOR))
#define HSEPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HSEPARATOR, HSeparatorClass))

typedef struct _HSeparator HSeparator;
typedef struct _HSeparatorClass HSeparatorClass;
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _CandidateArea {
	GtkBox parent_instance;
	CandidateAreaPrivate * priv;
};

struct _CandidateAreaClass {
	GtkBoxClass parent_class;
};

struct _CandidateAreaPrivate {
	gboolean m_vertical;
	GtkLabel** m_labels;
	gint m_labels_length1;
	gint _m_labels_size_;
	GtkLabel** m_candidates;
	gint m_candidates_length1;
	gint _m_candidates_size_;
	GtkWidget** m_widgets;
	gint m_widgets_length1;
	gint _m_widgets_size_;
	IBusText** m_ibus_candidates;
	gint m_ibus_candidates_length1;
	gint _m_ibus_candidates_size_;
	guint m_focus_candidate;
	gboolean m_show_cursor;
};

struct _Block1Data {
	int _ref_count_;
	CandidateArea * self;
	gint i;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	gint index;
};

struct _Block3Data {
	int _ref_count_;
	CandidateArea * self;
	gint index;
};


static gpointer candidate_area_parent_class = NULL;

GType candidate_area_get_type (void) G_GNUC_CONST;
#define CANDIDATE_AREA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CANDIDATE_AREA, CandidateAreaPrivate))
enum  {
	CANDIDATE_AREA_DUMMY_PROPERTY
};
CandidateArea* candidate_area_new (gboolean vertical);
CandidateArea* candidate_area_construct (GType object_type, gboolean vertical);
void candidate_area_set_vertical (CandidateArea* self, gboolean vertical, gboolean force);
static void candidate_area_recreate_ui (CandidateArea* self);
void candidate_area_set_candidates (CandidateArea* self, IBusText** candidates, int candidates_length1, guint focus_candidate, gboolean show_cursor);
void candidate_area_set_labels (CandidateArea* self, IBusText** labels, int labels_length1);
static IBusText** _vala_array_dup1 (IBusText** self, int length);
PangoAttrList* get_pango_attr_list_from_ibus_text (IBusText* text);
static void _vala_PangoAttrList_free (PangoAttrList* self);
static void __lambda2_ (CandidateArea* self, GtkButton* b);
static void ___lambda2__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda3_ (CandidateArea* self, GtkButton* b);
static void ___lambda3__gtk_button_clicked (GtkButton* _sender, gpointer self);
VSeparator* vseparator_new (void);
VSeparator* vseparator_construct (GType object_type);
GType vseparator_get_type (void) G_GNUC_CONST;
HSeparator* hseparator_new (void);
HSeparator* hseparator_construct (GType object_type);
GType hseparator_get_type (void) G_GNUC_CONST;
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _vala_array_add1 (GtkLabel*** array, int* length, int* size, GtkLabel* value);
static void _vala_array_add2 (GtkLabel*** array, int* length, int* size, GtkLabel* value);
static gboolean ______lambda4_ (Block2Data* _data2_, GtkWidget* w, GdkEventButton* e);
static gboolean _______lambda4__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static void _vala_array_add3 (GtkWidget*** array, int* length, int* size, GtkWidget* value);
static gboolean ______lambda5_ (Block2Data* _data2_, GtkWidget* w, GdkEventButton* e);
static gboolean _______lambda5__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static void _vala_array_add4 (GtkWidget*** array, int* length, int* size, GtkWidget* value);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void _vala_array_add5 (GtkLabel*** array, int* length, int* size, GtkLabel* value);
static void _vala_array_add6 (GtkLabel*** array, int* length, int* size, GtkLabel* value);
static gboolean ______lambda6_ (Block3Data* _data3_, GtkWidget* w, GdkEventButton* e);
static gboolean _______lambda6__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static void _vala_array_add7 (GtkWidget*** array, int* length, int* size, GtkWidget* value);
static void g_cclosure_user_marshal_VOID__UINT_UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void candidate_area_finalize (GObject* obj);
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 const gchar* CANDIDATE_AREA_LABELS[16] = {"1.", "2.", "3.", "4.", "5.", "6.", "7.", "8.", "9.", "0.", "a.", "b.", "c.", "d.", "e.", "f."};
static const gchar* CANDIDATE_AREA_PREV_PAGE_ICONS[2] = {GTK_STOCK_GO_BACK, GTK_STOCK_GO_UP};
static const gchar* CANDIDATE_AREA_NEXT_PAGE_ICONS[2] = {GTK_STOCK_GO_FORWARD, GTK_STOCK_GO_DOWN};

CandidateArea* candidate_area_construct (GType object_type, gboolean vertical) {
	CandidateArea * self = NULL;
	gboolean _tmp0_;
	self = (CandidateArea*) g_object_new (object_type, NULL);
	_tmp0_ = vertical;
	candidate_area_set_vertical (self, _tmp0_, TRUE);
	return self;
}


CandidateArea* candidate_area_new (gboolean vertical) {
	return candidate_area_construct (TYPE_CANDIDATE_AREA, vertical);
}


void candidate_area_set_vertical (CandidateArea* self, gboolean vertical, gboolean force) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkOrientation _tmp6_ = 0;
	gboolean _tmp7_;
	GtkOrientation _tmp8_;
	IBusText** _tmp9_;
	gint _tmp9__length1;
	g_return_if_fail (self != NULL);
	_tmp1_ = force;
	if (!_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = self->priv->m_vertical;
		_tmp3_ = vertical;
		_tmp0_ = _tmp2_ == _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		return;
	}
	_tmp5_ = vertical;
	self->priv->m_vertical = _tmp5_;
	_tmp7_ = vertical;
	if (_tmp7_) {
		_tmp6_ = GTK_ORIENTATION_VERTICAL;
	} else {
		_tmp6_ = GTK_ORIENTATION_HORIZONTAL;
	}
	_tmp8_ = _tmp6_;
	gtk_orientable_set_orientation ((GtkOrientable*) self, _tmp8_);
	candidate_area_recreate_ui (self);
	_tmp9_ = self->priv->m_ibus_candidates;
	_tmp9__length1 = self->priv->m_ibus_candidates_length1;
	if (_tmp9__length1 > 0) {
		IBusText** _tmp10_;
		gint _tmp10__length1;
		IBusText** _tmp11_;
		gint _tmp11__length1;
		guint _tmp12_;
		gboolean _tmp13_;
		_tmp10_ = self->priv->m_ibus_candidates;
		_tmp10__length1 = self->priv->m_ibus_candidates_length1;
		self->priv->m_ibus_candidates = NULL;
		_tmp11_ = _tmp10_;
		_tmp11__length1 = _tmp10__length1;
		_tmp12_ = self->priv->m_focus_candidate;
		_tmp13_ = self->priv->m_show_cursor;
		candidate_area_set_candidates (self, _tmp11_, _tmp10__length1, _tmp12_, _tmp13_);
		_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_object_unref), NULL);
		gtk_widget_show_all ((GtkWidget*) self);
	}
}


void candidate_area_set_labels (CandidateArea* self, IBusText** labels, int labels_length1) {
	gint i = 0;
	g_return_if_fail (self != NULL);
	{
		gboolean _tmp0_;
		i = 0;
		_tmp0_ = TRUE;
		while (TRUE) {
			gboolean _tmp1_;
			gint _tmp3_;
			IBusText** _tmp4_;
			gint _tmp4__length1;
			gint _tmp5_ = 0;
			GtkLabel** _tmp6_;
			gint _tmp6__length1;
			gint _tmp7_;
			GtkLabel* _tmp8_;
			IBusText** _tmp9_;
			gint _tmp9__length1;
			gint _tmp10_;
			IBusText* _tmp11_;
			const gchar* _tmp12_ = NULL;
			_tmp1_ = _tmp0_;
			if (!_tmp1_) {
				gint _tmp2_;
				_tmp2_ = i;
				i = _tmp2_ + 1;
			}
			_tmp0_ = FALSE;
			_tmp3_ = i;
			_tmp4_ = labels;
			_tmp4__length1 = labels_length1;
			_tmp5_ = MIN (16, _tmp4__length1);
			if (!(_tmp3_ < _tmp5_)) {
				break;
			}
			_tmp6_ = self->priv->m_labels;
			_tmp6__length1 = self->priv->m_labels_length1;
			_tmp7_ = i;
			_tmp8_ = _tmp6_[_tmp7_];
			_tmp9_ = labels;
			_tmp9__length1 = labels_length1;
			_tmp10_ = i;
			_tmp11_ = _tmp9_[_tmp10_];
			_tmp12_ = ibus_text_get_text (_tmp11_);
			gtk_label_set_text (_tmp8_, _tmp12_);
		}
	}
	{
		gboolean _tmp13_;
		_tmp13_ = TRUE;
		while (TRUE) {
			gboolean _tmp14_;
			gint _tmp16_;
			GtkLabel** _tmp17_;
			gint _tmp17__length1;
			gint _tmp18_;
			GtkLabel* _tmp19_;
			gint _tmp20_;
			const gchar* _tmp21_;
			_tmp14_ = _tmp13_;
			if (!_tmp14_) {
				gint _tmp15_;
				_tmp15_ = i;
				i = _tmp15_ + 1;
			}
			_tmp13_ = FALSE;
			_tmp16_ = i;
			if (!(_tmp16_ < 16)) {
				break;
			}
			_tmp17_ = self->priv->m_labels;
			_tmp17__length1 = self->priv->m_labels_length1;
			_tmp18_ = i;
			_tmp19_ = _tmp17_[_tmp18_];
			_tmp20_ = i;
			_tmp21_ = CANDIDATE_AREA_LABELS[_tmp20_];
			gtk_label_set_text (_tmp19_, _tmp21_);
		}
	}
}


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


static IBusText** _vala_array_dup1 (IBusText** self, int length) {
	IBusText** result;
	int i;
	result = g_new0 (IBusText*, length + 1);
	for (i = 0; i < length; i++) {
		IBusText* _tmp0_;
		_tmp0_ = _g_object_ref0 (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static void _vala_PangoAttrList_free (PangoAttrList* self) {
	g_boxed_free (pango_attr_list_get_type (), self);
}


void candidate_area_set_candidates (CandidateArea* self, IBusText** candidates, int candidates_length1, guint focus_candidate, gboolean show_cursor) {
	IBusText** _tmp0_;
	gint _tmp0__length1;
	IBusText** _tmp1_;
	gint _tmp1__length1;
	guint _tmp2_;
	gboolean _tmp3_;
	IBusText** _tmp4_;
	gint _tmp4__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = candidates;
	_tmp0__length1 = candidates_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->m_ibus_candidates = (_vala_array_free (self->priv->m_ibus_candidates, self->priv->m_ibus_candidates_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->m_ibus_candidates = _tmp1_;
	self->priv->m_ibus_candidates_length1 = _tmp1__length1;
	self->priv->_m_ibus_candidates_size_ = self->priv->m_ibus_candidates_length1;
	_tmp2_ = focus_candidate;
	self->priv->m_focus_candidate = _tmp2_;
	_tmp3_ = show_cursor;
	self->priv->m_show_cursor = _tmp3_;
	_tmp4_ = candidates;
	_tmp4__length1 = candidates_length1;
	_vala_assert (_tmp4__length1 < 16, "candidates.length < 16");
	{
		gint i;
		i = 0;
		{
			gboolean _tmp5_;
			_tmp5_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_;
				gint _tmp8_;
				GtkLabel** _tmp9_;
				gint _tmp9__length1;
				gint _tmp10_;
				GtkLabel* _tmp11_;
				GtkLabel* _tmp12_;
				GtkLabel* label;
				gboolean visible;
				gint _tmp13_;
				IBusText** _tmp14_;
				gint _tmp14__length1;
				gboolean _tmp84_;
				_tmp6_ = _tmp5_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp8_ = i;
				if (!(_tmp8_ < 16)) {
					break;
				}
				_tmp9_ = self->priv->m_candidates;
				_tmp9__length1 = self->priv->m_candidates_length1;
				_tmp10_ = i;
				_tmp11_ = _tmp9_[_tmp10_];
				_tmp12_ = _g_object_ref0 (_tmp11_);
				label = _tmp12_;
				visible = FALSE;
				_tmp13_ = i;
				_tmp14_ = candidates;
				_tmp14__length1 = candidates_length1;
				if (_tmp13_ < _tmp14__length1) {
					IBusText** _tmp15_;
					gint _tmp15__length1;
					gint _tmp16_;
					IBusText* _tmp17_;
					PangoAttrList* _tmp18_ = NULL;
					PangoAttrList* attrs;
					gboolean _tmp19_ = FALSE;
					gint _tmp20_;
					guint _tmp21_;
					gboolean _tmp23_;
					GtkLabel* _tmp73_;
					IBusText** _tmp74_;
					gint _tmp74__length1;
					gint _tmp75_;
					IBusText* _tmp76_;
					const gchar* _tmp77_ = NULL;
					GtkLabel* _tmp78_;
					PangoAttrList* _tmp79_;
					_tmp15_ = candidates;
					_tmp15__length1 = candidates_length1;
					_tmp16_ = i;
					_tmp17_ = _tmp15_[_tmp16_];
					_tmp18_ = get_pango_attr_list_from_ibus_text (_tmp17_);
					attrs = _tmp18_;
					_tmp20_ = i;
					_tmp21_ = focus_candidate;
					if (((guint) _tmp20_) == _tmp21_) {
						gboolean _tmp22_;
						_tmp22_ = show_cursor;
						_tmp19_ = _tmp22_;
					} else {
						_tmp19_ = FALSE;
					}
					_tmp23_ = _tmp19_;
					if (_tmp23_) {
						GtkLabel** _tmp24_;
						gint _tmp24__length1;
						gint _tmp25_;
						GtkLabel* _tmp26_;
						GtkStyleContext* _tmp27_ = NULL;
						GtkStyleContext* _tmp28_;
						GtkStyleContext* context;
						GtkStyleContext* _tmp29_;
						GdkRGBA _tmp30_ = {0};
						GdkRGBA color;
						GdkRGBA _tmp31_;
						gdouble _tmp32_;
						guint16 _tmp33_;
						GdkRGBA _tmp34_;
						gdouble _tmp35_;
						guint16 _tmp36_;
						GdkRGBA _tmp37_;
						gdouble _tmp38_;
						guint16 _tmp39_;
						PangoAttribute* _tmp40_ = NULL;
						PangoAttribute* pango_attr;
						PangoAttribute* _tmp41_;
						PangoAttribute* _tmp42_;
						IBusText** _tmp43_;
						gint _tmp43__length1;
						gint _tmp44_;
						IBusText* _tmp45_;
						const gchar* _tmp46_ = NULL;
						gint _tmp47_;
						gint _tmp48_;
						PangoAttrList* _tmp49_;
						PangoAttribute* _tmp50_;
						GtkStyleContext* _tmp51_;
						GdkRGBA _tmp52_ = {0};
						GdkRGBA _tmp53_;
						gdouble _tmp54_;
						guint16 _tmp55_;
						GdkRGBA _tmp56_;
						gdouble _tmp57_;
						guint16 _tmp58_;
						GdkRGBA _tmp59_;
						gdouble _tmp60_;
						guint16 _tmp61_;
						PangoAttribute* _tmp62_ = NULL;
						PangoAttribute* _tmp63_;
						PangoAttribute* _tmp64_;
						IBusText** _tmp65_;
						gint _tmp65__length1;
						gint _tmp66_;
						IBusText* _tmp67_;
						const gchar* _tmp68_ = NULL;
						gint _tmp69_;
						gint _tmp70_;
						PangoAttrList* _tmp71_;
						PangoAttribute* _tmp72_;
						_tmp24_ = self->priv->m_candidates;
						_tmp24__length1 = self->priv->m_candidates_length1;
						_tmp25_ = i;
						_tmp26_ = _tmp24_[_tmp25_];
						_tmp27_ = gtk_widget_get_style_context ((GtkWidget*) _tmp26_);
						_tmp28_ = _g_object_ref0 (_tmp27_);
						context = _tmp28_;
						_tmp29_ = context;
						gtk_style_context_get_color (_tmp29_, GTK_STATE_FLAG_SELECTED, &_tmp30_);
						color = _tmp30_;
						_tmp31_ = color;
						_tmp32_ = _tmp31_.red;
						_tmp33_ = G_MAXUINT16;
						_tmp34_ = color;
						_tmp35_ = _tmp34_.green;
						_tmp36_ = G_MAXUINT16;
						_tmp37_ = color;
						_tmp38_ = _tmp37_.blue;
						_tmp39_ = G_MAXUINT16;
						_tmp40_ = pango_attr_foreground_new ((guint16) (_tmp32_ * _tmp33_), (guint16) (_tmp35_ * _tmp36_), (guint16) (_tmp38_ * _tmp39_));
						pango_attr = _tmp40_;
						_tmp41_ = pango_attr;
						_tmp41_->start_index = (guint) 0;
						_tmp42_ = pango_attr;
						_tmp43_ = candidates;
						_tmp43__length1 = candidates_length1;
						_tmp44_ = i;
						_tmp45_ = _tmp43_[_tmp44_];
						_tmp46_ = ibus_text_get_text (_tmp45_);
						_tmp47_ = strlen (_tmp46_);
						_tmp48_ = _tmp47_;
						_tmp42_->end_index = (guint) _tmp48_;
						_tmp49_ = attrs;
						_tmp50_ = pango_attr;
						pango_attr = NULL;
						pango_attr_list_insert (_tmp49_, _tmp50_);
						_tmp51_ = context;
						gtk_style_context_get_background_color (_tmp51_, GTK_STATE_FLAG_SELECTED, &_tmp52_);
						color = _tmp52_;
						_tmp53_ = color;
						_tmp54_ = _tmp53_.red;
						_tmp55_ = G_MAXUINT16;
						_tmp56_ = color;
						_tmp57_ = _tmp56_.green;
						_tmp58_ = G_MAXUINT16;
						_tmp59_ = color;
						_tmp60_ = _tmp59_.blue;
						_tmp61_ = G_MAXUINT16;
						_tmp62_ = pango_attr_background_new ((guint16) (_tmp54_ * _tmp55_), (guint16) (_tmp57_ * _tmp58_), (guint16) (_tmp60_ * _tmp61_));
						_pango_attribute_destroy0 (pango_attr);
						pango_attr = _tmp62_;
						_tmp63_ = pango_attr;
						_tmp63_->start_index = (guint) 0;
						_tmp64_ = pango_attr;
						_tmp65_ = candidates;
						_tmp65__length1 = candidates_length1;
						_tmp66_ = i;
						_tmp67_ = _tmp65_[_tmp66_];
						_tmp68_ = ibus_text_get_text (_tmp67_);
						_tmp69_ = strlen (_tmp68_);
						_tmp70_ = _tmp69_;
						_tmp64_->end_index = (guint) _tmp70_;
						_tmp71_ = attrs;
						_tmp72_ = pango_attr;
						pango_attr = NULL;
						pango_attr_list_insert (_tmp71_, _tmp72_);
						_pango_attribute_destroy0 (pango_attr);
						_g_object_unref0 (context);
					}
					_tmp73_ = label;
					_tmp74_ = candidates;
					_tmp74__length1 = candidates_length1;
					_tmp75_ = i;
					_tmp76_ = _tmp74_[_tmp75_];
					_tmp77_ = ibus_text_get_text (_tmp76_);
					gtk_label_set_text (_tmp73_, _tmp77_);
					_tmp78_ = label;
					_tmp79_ = attrs;
					gtk_label_set_attributes (_tmp78_, _tmp79_);
					visible = TRUE;
					__vala_PangoAttrList_free0 (attrs);
				} else {
					GtkLabel* _tmp80_;
					GtkLabel* _tmp81_;
					PangoAttrList* _tmp82_;
					PangoAttrList* _tmp83_;
					_tmp80_ = label;
					gtk_label_set_text (_tmp80_, "");
					_tmp81_ = label;
					_tmp82_ = pango_attr_list_new ();
					_tmp83_ = _tmp82_;
					gtk_label_set_attributes (_tmp81_, _tmp83_);
					__vala_PangoAttrList_free0 (_tmp83_);
				}
				_tmp84_ = self->priv->m_vertical;
				if (_tmp84_) {
					GtkWidget** _tmp85_;
					gint _tmp85__length1;
					gint _tmp86_;
					GtkWidget* _tmp87_;
					gboolean _tmp88_;
					GtkWidget** _tmp89_;
					gint _tmp89__length1;
					gint _tmp90_;
					GtkWidget* _tmp91_;
					gboolean _tmp92_;
					_tmp85_ = self->priv->m_widgets;
					_tmp85__length1 = self->priv->m_widgets_length1;
					_tmp86_ = i;
					_tmp87_ = _tmp85_[_tmp86_ * 2];
					_tmp88_ = visible;
					gtk_widget_set_visible (_tmp87_, _tmp88_);
					_tmp89_ = self->priv->m_widgets;
					_tmp89__length1 = self->priv->m_widgets_length1;
					_tmp90_ = i;
					_tmp91_ = _tmp89_[(_tmp90_ * 2) + 1];
					_tmp92_ = visible;
					gtk_widget_set_visible (_tmp91_, _tmp92_);
				} else {
					GtkWidget** _tmp93_;
					gint _tmp93__length1;
					gint _tmp94_;
					GtkWidget* _tmp95_;
					gboolean _tmp96_;
					_tmp93_ = self->priv->m_widgets;
					_tmp93__length1 = self->priv->m_widgets_length1;
					_tmp94_ = i;
					_tmp95_ = _tmp93_[_tmp94_];
					_tmp96_ = visible;
					gtk_widget_set_visible (_tmp95_, _tmp96_);
				}
				_g_object_unref0 (label);
			}
		}
	}
}


static void __lambda2_ (CandidateArea* self, GtkButton* b) {
	g_return_if_fail (b != NULL);
	g_signal_emit_by_name (self, "page-up");
}


static void ___lambda2__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda2_ (self, _sender);
}


static void __lambda3_ (CandidateArea* self, GtkButton* b) {
	g_return_if_fail (b != NULL);
	g_signal_emit_by_name (self, "page-down");
}


static void ___lambda3__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda3_ (self, _sender);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		CandidateArea * self;
		self = _data1_->self;
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		CandidateArea * self;
		self = _data2_->_data1_->self;
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}


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


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


static gboolean ______lambda4_ (Block2Data* _data2_, GtkWidget* w, GdkEventButton* e) {
	Block1Data* _data1_;
	CandidateArea * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GdkEventButton _tmp1_;
	guint _tmp2_;
	GdkEventButton _tmp3_;
	GdkModifierType _tmp4_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = _data1_->i;
	_tmp1_ = *e;
	_tmp2_ = _tmp1_.button;
	_tmp3_ = *e;
	_tmp4_ = _tmp3_.state;
	g_signal_emit_by_name (self, "candidate-clicked", (guint) _tmp0_, _tmp2_, (guint) _tmp4_);
	result = TRUE;
	return result;
}


static gboolean _______lambda4__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = ______lambda4_ (self, _sender, event);
	return result;
}


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


static gboolean ______lambda5_ (Block2Data* _data2_, GtkWidget* w, GdkEventButton* e) {
	Block1Data* _data1_;
	CandidateArea * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GdkEventButton _tmp1_;
	guint _tmp2_;
	GdkEventButton _tmp3_;
	GdkModifierType _tmp4_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = _data2_->index;
	_tmp1_ = *e;
	_tmp2_ = _tmp1_.button;
	_tmp3_ = *e;
	_tmp4_ = _tmp3_.state;
	g_signal_emit_by_name (self, "candidate-clicked", (guint) _tmp0_, _tmp2_, (guint) _tmp4_);
	result = TRUE;
	return result;
}


static gboolean _______lambda5__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = ______lambda5_ (self, _sender, event);
	return result;
}


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


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		CandidateArea * self;
		self = _data3_->self;
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}


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


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


static gboolean ______lambda6_ (Block3Data* _data3_, GtkWidget* w, GdkEventButton* e) {
	CandidateArea * self;
	gboolean result = FALSE;
	gint _tmp0_;
	GdkEventButton _tmp1_;
	guint _tmp2_;
	GdkEventButton _tmp3_;
	GdkModifierType _tmp4_;
	self = _data3_->self;
	g_return_val_if_fail (w != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = _data3_->index;
	_tmp1_ = *e;
	_tmp2_ = _tmp1_.button;
	_tmp3_ = *e;
	_tmp4_ = _tmp3_.state;
	g_signal_emit_by_name (self, "candidate-clicked", (guint) _tmp0_, _tmp2_, (guint) _tmp4_);
	result = TRUE;
	return result;
}


static gboolean _______lambda6__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = ______lambda6_ (self, _sender, event);
	return result;
}


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


static void candidate_area_recreate_ui (CandidateArea* self) {
	GList* _tmp0_ = NULL;
	GtkButton* _tmp3_;
	GtkButton* prev_button;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkOrientation _tmp6_;
	GtkOrientation _tmp7_;
	const gchar* _tmp8_;
	GtkImage* _tmp9_;
	GtkImage* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* next_button;
	GtkButton* _tmp13_;
	GtkButton* _tmp14_;
	GtkOrientation _tmp15_;
	GtkOrientation _tmp16_;
	const gchar* _tmp17_;
	GtkImage* _tmp18_;
	GtkImage* _tmp19_;
	GtkButton* _tmp20_;
	gboolean _tmp21_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp0_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* _tmp1_;
			GtkWidget* w = NULL;
			_tmp1_ = _g_object_ref0 ((GtkWidget*) w_it->data);
			w = _tmp1_;
			{
				GtkWidget* _tmp2_;
				_tmp2_ = w;
				gtk_widget_destroy (_tmp2_);
				_g_object_unref0 (w);
			}
		}
		_g_list_free0 (w_collection);
	}
	_tmp3_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp3_);
	prev_button = _tmp3_;
	_tmp4_ = prev_button;
	g_signal_connect_object (_tmp4_, "clicked", (GCallback) ___lambda2__gtk_button_clicked, self, 0);
	_tmp5_ = prev_button;
	_tmp6_ = gtk_orientable_get_orientation ((GtkOrientable*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = CANDIDATE_AREA_PREV_PAGE_ICONS[_tmp7_];
	_tmp9_ = (GtkImage*) gtk_image_new_from_stock (_tmp8_, GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	gtk_button_set_image (_tmp5_, (GtkWidget*) _tmp10_);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = prev_button;
	gtk_button_set_relief (_tmp11_, GTK_RELIEF_NONE);
	_tmp12_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp12_);
	next_button = _tmp12_;
	_tmp13_ = next_button;
	g_signal_connect_object (_tmp13_, "clicked", (GCallback) ___lambda3__gtk_button_clicked, self, 0);
	_tmp14_ = next_button;
	_tmp15_ = gtk_orientable_get_orientation ((GtkOrientable*) self);
	_tmp16_ = _tmp15_;
	_tmp17_ = CANDIDATE_AREA_NEXT_PAGE_ICONS[_tmp16_];
	_tmp18_ = (GtkImage*) gtk_image_new_from_stock (_tmp17_, GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp18_);
	_tmp19_ = _tmp18_;
	gtk_button_set_image (_tmp14_, (GtkWidget*) _tmp19_);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = next_button;
	gtk_button_set_relief (_tmp20_, GTK_RELIEF_NONE);
	_tmp21_ = self->priv->m_vertical;
	if (_tmp21_) {
		GtkBox* _tmp22_;
		GtkBox* candidates_hbox;
		GtkBox* _tmp23_;
		GtkBox* _tmp24_;
		GtkBox* labels_vbox;
		GtkBox* _tmp25_;
		GtkBox* _tmp26_;
		GtkBox* candidates_vbox;
		GtkBox* _tmp27_;
		GtkBox* _tmp28_;
		GtkBox* _tmp29_;
		GtkBox* _tmp30_;
		VSeparator* _tmp31_;
		VSeparator* _tmp32_;
		GtkBox* _tmp33_;
		GtkBox* _tmp34_;
		HSeparator* _tmp35_;
		HSeparator* _tmp36_;
		GtkBox* _tmp37_;
		GtkBox* buttons_hbox;
		GtkLabel* _tmp38_;
		GtkLabel* state_label;
		GtkLabel* _tmp39_;
		GtkBox* _tmp40_;
		GtkLabel* _tmp41_;
		GtkBox* _tmp42_;
		GtkButton* _tmp43_;
		GtkBox* _tmp44_;
		GtkButton* _tmp45_;
		GtkBox* _tmp46_;
		GtkLabel** _tmp47_ = NULL;
		GtkLabel** _tmp48_ = NULL;
		GtkWidget** _tmp49_ = NULL;
		_tmp22_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
		g_object_ref_sink (_tmp22_);
		candidates_hbox = _tmp22_;
		_tmp23_ = candidates_hbox;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp23_, FALSE, FALSE, (guint) 0);
		_tmp24_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
		g_object_ref_sink (_tmp24_);
		labels_vbox = _tmp24_;
		_tmp25_ = labels_vbox;
		gtk_box_set_homogeneous (_tmp25_, TRUE);
		_tmp26_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
		g_object_ref_sink (_tmp26_);
		candidates_vbox = _tmp26_;
		_tmp27_ = candidates_vbox;
		gtk_box_set_homogeneous (_tmp27_, TRUE);
		_tmp28_ = candidates_hbox;
		_tmp29_ = labels_vbox;
		gtk_box_pack_start (_tmp28_, (GtkWidget*) _tmp29_, FALSE, FALSE, (guint) 4);
		_tmp30_ = candidates_hbox;
		_tmp31_ = vseparator_new ();
		g_object_ref_sink (_tmp31_);
		_tmp32_ = _tmp31_;
		gtk_box_pack_start (_tmp30_, (GtkWidget*) _tmp32_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp32_);
		_tmp33_ = candidates_hbox;
		_tmp34_ = candidates_vbox;
		gtk_box_pack_start (_tmp33_, (GtkWidget*) _tmp34_, TRUE, TRUE, (guint) 4);
		_tmp35_ = hseparator_new ();
		g_object_ref_sink (_tmp35_);
		_tmp36_ = _tmp35_;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp36_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp36_);
		_tmp37_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
		g_object_ref_sink (_tmp37_);
		buttons_hbox = _tmp37_;
		_tmp38_ = (GtkLabel*) gtk_label_new (NULL);
		g_object_ref_sink (_tmp38_);
		state_label = _tmp38_;
		_tmp39_ = state_label;
		gtk_widget_set_size_request ((GtkWidget*) _tmp39_, 20, -1);
		_tmp40_ = buttons_hbox;
		_tmp41_ = state_label;
		gtk_box_pack_start (_tmp40_, (GtkWidget*) _tmp41_, TRUE, TRUE, (guint) 0);
		_tmp42_ = buttons_hbox;
		_tmp43_ = prev_button;
		gtk_box_pack_start (_tmp42_, (GtkWidget*) _tmp43_, FALSE, FALSE, (guint) 0);
		_tmp44_ = buttons_hbox;
		_tmp45_ = next_button;
		gtk_box_pack_start (_tmp44_, (GtkWidget*) _tmp45_, FALSE, FALSE, (guint) 0);
		_tmp46_ = buttons_hbox;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp46_, FALSE, FALSE, (guint) 0);
		_tmp47_ = g_new0 (GtkLabel*, 0 + 1);
		self->priv->m_labels = (_vala_array_free (self->priv->m_labels, self->priv->m_labels_length1, (GDestroyNotify) g_object_unref), NULL);
		self->priv->m_labels = _tmp47_;
		self->priv->m_labels_length1 = 0;
		self->priv->_m_labels_size_ = self->priv->m_labels_length1;
		_tmp48_ = g_new0 (GtkLabel*, 0 + 1);
		self->priv->m_candidates = (_vala_array_free (self->priv->m_candidates, self->priv->m_candidates_length1, (GDestroyNotify) g_object_unref), NULL);
		self->priv->m_candidates = _tmp48_;
		self->priv->m_candidates_length1 = 0;
		self->priv->_m_candidates_size_ = self->priv->m_candidates_length1;
		_tmp49_ = g_new0 (GtkWidget*, 0 + 1);
		self->priv->m_widgets = (_vala_array_free (self->priv->m_widgets, self->priv->m_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
		self->priv->m_widgets = _tmp49_;
		self->priv->m_widgets_length1 = 0;
		self->priv->_m_widgets_size_ = self->priv->m_widgets_length1;
		{
			Block1Data* _data1_;
			_data1_ = g_slice_new0 (Block1Data);
			_data1_->_ref_count_ = 1;
			_data1_->self = g_object_ref (self);
			_data1_->i = 0;
			{
				gboolean _tmp50_;
				_tmp50_ = TRUE;
				while (TRUE) {
					Block2Data* _data2_;
					gboolean _tmp51_;
					gint _tmp53_;
					gint _tmp54_;
					const gchar* _tmp55_;
					GtkLabel* _tmp56_;
					GtkLabel* label;
					GtkLabel* _tmp57_;
					GtkLabel* _tmp58_;
					GtkLabel** _tmp59_;
					gint _tmp59__length1;
					GtkLabel* _tmp60_;
					GtkLabel* _tmp61_;
					GtkLabel* _tmp62_;
					GtkLabel* candidate;
					GtkLabel* _tmp63_;
					GtkLabel* _tmp64_;
					GtkLabel** _tmp65_;
					gint _tmp65__length1;
					GtkLabel* _tmp66_;
					GtkLabel* _tmp67_;
					GtkLabel* _tmp68_;
					GValue _tmp69_ = {0};
					GtkLabel* _tmp70_;
					GValue _tmp71_ = {0};
					gint _tmp72_;
					GtkEventBox* _tmp73_;
					GtkEventBox* label_ebox;
					GtkEventBox* _tmp74_;
					GtkEventBox* _tmp75_;
					GtkEventBox* _tmp76_;
					GtkLabel* _tmp77_;
					GtkBox* _tmp78_;
					GtkEventBox* _tmp79_;
					GtkWidget** _tmp80_;
					gint _tmp80__length1;
					GtkEventBox* _tmp81_;
					GtkWidget* _tmp82_;
					GtkEventBox* _tmp83_;
					GtkEventBox* candidate_ebox;
					GtkEventBox* _tmp84_;
					GtkEventBox* _tmp85_;
					GtkEventBox* _tmp86_;
					GtkLabel* _tmp87_;
					GtkBox* _tmp88_;
					GtkEventBox* _tmp89_;
					GtkWidget** _tmp90_;
					gint _tmp90__length1;
					GtkEventBox* _tmp91_;
					GtkWidget* _tmp92_;
					_data2_ = g_slice_new0 (Block2Data);
					_data2_->_ref_count_ = 1;
					_data2_->_data1_ = block1_data_ref (_data1_);
					_tmp51_ = _tmp50_;
					if (!_tmp51_) {
						gint _tmp52_;
						_tmp52_ = _data1_->i;
						_data1_->i = _tmp52_ + 1;
					}
					_tmp50_ = FALSE;
					_tmp53_ = _data1_->i;
					if (!(_tmp53_ < 16)) {
						block2_data_unref (_data2_);
						_data2_ = NULL;
						break;
					}
					_tmp54_ = _data1_->i;
					_tmp55_ = CANDIDATE_AREA_LABELS[_tmp54_];
					_tmp56_ = (GtkLabel*) gtk_label_new (_tmp55_);
					g_object_ref_sink (_tmp56_);
					label = _tmp56_;
					_tmp57_ = label;
					gtk_misc_set_alignment ((GtkMisc*) _tmp57_, 0.0f, 0.5f);
					_tmp58_ = label;
					gtk_widget_show ((GtkWidget*) _tmp58_);
					_tmp59_ = self->priv->m_labels;
					_tmp59__length1 = self->priv->m_labels_length1;
					_tmp60_ = label;
					_tmp61_ = _g_object_ref0 (_tmp60_);
					_vala_array_add1 (&self->priv->m_labels, &self->priv->m_labels_length1, &self->priv->_m_labels_size_, _tmp61_);
					_tmp62_ = (GtkLabel*) gtk_label_new ("test");
					g_object_ref_sink (_tmp62_);
					candidate = _tmp62_;
					_tmp63_ = candidate;
					gtk_misc_set_alignment ((GtkMisc*) _tmp63_, 0.0f, 0.5f);
					_tmp64_ = candidate;
					gtk_widget_show ((GtkWidget*) _tmp64_);
					_tmp65_ = self->priv->m_candidates;
					_tmp65__length1 = self->priv->m_candidates_length1;
					_tmp66_ = candidate;
					_tmp67_ = _g_object_ref0 (_tmp66_);
					_vala_array_add2 (&self->priv->m_candidates, &self->priv->m_candidates_length1, &self->priv->_m_candidates_size_, _tmp67_);
					_tmp68_ = label;
					g_value_init (&_tmp69_, G_TYPE_INT);
					g_value_set_int (&_tmp69_, 8);
					g_object_set_property ((GObject*) _tmp68_, "xpad", &_tmp69_);
					G_IS_VALUE (&_tmp69_) ? (g_value_unset (&_tmp69_), NULL) : NULL;
					_tmp70_ = candidate;
					g_value_init (&_tmp71_, G_TYPE_INT);
					g_value_set_int (&_tmp71_, 8);
					g_object_set_property ((GObject*) _tmp70_, "xpad", &_tmp71_);
					G_IS_VALUE (&_tmp71_) ? (g_value_unset (&_tmp71_), NULL) : NULL;
					_tmp72_ = _data1_->i;
					_data2_->index = _tmp72_;
					_tmp73_ = (GtkEventBox*) gtk_event_box_new ();
					g_object_ref_sink (_tmp73_);
					label_ebox = _tmp73_;
					_tmp74_ = label_ebox;
					gtk_widget_set_no_show_all ((GtkWidget*) _tmp74_, TRUE);
					_tmp75_ = label_ebox;
					g_signal_connect_data ((GtkWidget*) _tmp75_, "button-press-event", (GCallback) _______lambda4__gtk_widget_button_press_event, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
					_tmp76_ = label_ebox;
					_tmp77_ = label;
					gtk_container_add ((GtkContainer*) _tmp76_, (GtkWidget*) _tmp77_);
					_tmp78_ = labels_vbox;
					_tmp79_ = label_ebox;
					gtk_box_pack_start (_tmp78_, (GtkWidget*) _tmp79_, FALSE, FALSE, (guint) 2);
					_tmp80_ = self->priv->m_widgets;
					_tmp80__length1 = self->priv->m_widgets_length1;
					_tmp81_ = label_ebox;
					_tmp82_ = _g_object_ref0 ((GtkWidget*) _tmp81_);
					_vala_array_add3 (&self->priv->m_widgets, &self->priv->m_widgets_length1, &self->priv->_m_widgets_size_, _tmp82_);
					_tmp83_ = (GtkEventBox*) gtk_event_box_new ();
					g_object_ref_sink (_tmp83_);
					candidate_ebox = _tmp83_;
					_tmp84_ = candidate_ebox;
					gtk_widget_set_no_show_all ((GtkWidget*) _tmp84_, TRUE);
					_tmp85_ = candidate_ebox;
					g_signal_connect_data ((GtkWidget*) _tmp85_, "button-press-event", (GCallback) _______lambda5__gtk_widget_button_press_event, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
					_tmp86_ = candidate_ebox;
					_tmp87_ = candidate;
					gtk_container_add ((GtkContainer*) _tmp86_, (GtkWidget*) _tmp87_);
					_tmp88_ = candidates_vbox;
					_tmp89_ = candidate_ebox;
					gtk_box_pack_start (_tmp88_, (GtkWidget*) _tmp89_, FALSE, FALSE, (guint) 2);
					_tmp90_ = self->priv->m_widgets;
					_tmp90__length1 = self->priv->m_widgets_length1;
					_tmp91_ = candidate_ebox;
					_tmp92_ = _g_object_ref0 ((GtkWidget*) _tmp91_);
					_vala_array_add4 (&self->priv->m_widgets, &self->priv->m_widgets_length1, &self->priv->_m_widgets_size_, _tmp92_);
					_g_object_unref0 (candidate_ebox);
					_g_object_unref0 (label_ebox);
					_g_object_unref0 (candidate);
					_g_object_unref0 (label);
					block2_data_unref (_data2_);
					_data2_ = NULL;
				}
			}
			block1_data_unref (_data1_);
			_data1_ = NULL;
		}
		_g_object_unref0 (state_label);
		_g_object_unref0 (buttons_hbox);
		_g_object_unref0 (candidates_vbox);
		_g_object_unref0 (labels_vbox);
		_g_object_unref0 (candidates_hbox);
	} else {
		GtkBox* _tmp93_;
		GtkBox* hbox;
		GtkBox* _tmp94_;
		GtkLabel** _tmp95_ = NULL;
		GtkLabel** _tmp96_ = NULL;
		GtkWidget** _tmp97_ = NULL;
		GtkBox* _tmp133_;
		VSeparator* _tmp134_;
		VSeparator* _tmp135_;
		GtkBox* _tmp136_;
		GtkButton* _tmp137_;
		GtkBox* _tmp138_;
		GtkButton* _tmp139_;
		_tmp93_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
		g_object_ref_sink (_tmp93_);
		hbox = _tmp93_;
		_tmp94_ = hbox;
		gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp94_);
		_tmp95_ = g_new0 (GtkLabel*, 0 + 1);
		self->priv->m_labels = (_vala_array_free (self->priv->m_labels, self->priv->m_labels_length1, (GDestroyNotify) g_object_unref), NULL);
		self->priv->m_labels = _tmp95_;
		self->priv->m_labels_length1 = 0;
		self->priv->_m_labels_size_ = self->priv->m_labels_length1;
		_tmp96_ = g_new0 (GtkLabel*, 0 + 1);
		self->priv->m_candidates = (_vala_array_free (self->priv->m_candidates, self->priv->m_candidates_length1, (GDestroyNotify) g_object_unref), NULL);
		self->priv->m_candidates = _tmp96_;
		self->priv->m_candidates_length1 = 0;
		self->priv->_m_candidates_size_ = self->priv->m_candidates_length1;
		_tmp97_ = g_new0 (GtkWidget*, 0 + 1);
		self->priv->m_widgets = (_vala_array_free (self->priv->m_widgets, self->priv->m_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
		self->priv->m_widgets = _tmp97_;
		self->priv->m_widgets_length1 = 0;
		self->priv->_m_widgets_size_ = self->priv->m_widgets_length1;
		{
			gint i;
			i = 0;
			{
				gboolean _tmp98_;
				_tmp98_ = TRUE;
				while (TRUE) {
					Block3Data* _data3_;
					gboolean _tmp99_;
					gint _tmp101_;
					gint _tmp102_;
					const gchar* _tmp103_;
					GtkLabel* _tmp104_;
					GtkLabel* label;
					GtkLabel* _tmp105_;
					GtkLabel* _tmp106_;
					GtkLabel** _tmp107_;
					gint _tmp107__length1;
					GtkLabel* _tmp108_;
					GtkLabel* _tmp109_;
					GtkLabel* _tmp110_;
					GtkLabel* candidate;
					GtkLabel* _tmp111_;
					GtkLabel* _tmp112_;
					GtkLabel** _tmp113_;
					gint _tmp113__length1;
					GtkLabel* _tmp114_;
					GtkLabel* _tmp115_;
					GtkBox* _tmp116_;
					GtkBox* candidate_hbox;
					GtkBox* _tmp117_;
					GtkBox* _tmp118_;
					GtkLabel* _tmp119_;
					GtkBox* _tmp120_;
					GtkLabel* _tmp121_;
					gint _tmp122_;
					GtkEventBox* _tmp123_;
					GtkEventBox* ebox;
					GtkEventBox* _tmp124_;
					GtkEventBox* _tmp125_;
					GtkEventBox* _tmp126_;
					GtkBox* _tmp127_;
					GtkBox* _tmp128_;
					GtkEventBox* _tmp129_;
					GtkWidget** _tmp130_;
					gint _tmp130__length1;
					GtkEventBox* _tmp131_;
					GtkWidget* _tmp132_;
					_data3_ = g_slice_new0 (Block3Data);
					_data3_->_ref_count_ = 1;
					_data3_->self = g_object_ref (self);
					_tmp99_ = _tmp98_;
					if (!_tmp99_) {
						gint _tmp100_;
						_tmp100_ = i;
						i = _tmp100_ + 1;
					}
					_tmp98_ = FALSE;
					_tmp101_ = i;
					if (!(_tmp101_ < 16)) {
						block3_data_unref (_data3_);
						_data3_ = NULL;
						break;
					}
					_tmp102_ = i;
					_tmp103_ = CANDIDATE_AREA_LABELS[_tmp102_];
					_tmp104_ = (GtkLabel*) gtk_label_new (_tmp103_);
					g_object_ref_sink (_tmp104_);
					label = _tmp104_;
					_tmp105_ = label;
					gtk_misc_set_alignment ((GtkMisc*) _tmp105_, 0.0f, 0.5f);
					_tmp106_ = label;
					gtk_widget_show ((GtkWidget*) _tmp106_);
					_tmp107_ = self->priv->m_labels;
					_tmp107__length1 = self->priv->m_labels_length1;
					_tmp108_ = label;
					_tmp109_ = _g_object_ref0 (_tmp108_);
					_vala_array_add5 (&self->priv->m_labels, &self->priv->m_labels_length1, &self->priv->_m_labels_size_, _tmp109_);
					_tmp110_ = (GtkLabel*) gtk_label_new ("test");
					g_object_ref_sink (_tmp110_);
					candidate = _tmp110_;
					_tmp111_ = candidate;
					gtk_misc_set_alignment ((GtkMisc*) _tmp111_, 0.0f, 0.5f);
					_tmp112_ = candidate;
					gtk_widget_show ((GtkWidget*) _tmp112_);
					_tmp113_ = self->priv->m_candidates;
					_tmp113__length1 = self->priv->m_candidates_length1;
					_tmp114_ = candidate;
					_tmp115_ = _g_object_ref0 (_tmp114_);
					_vala_array_add6 (&self->priv->m_candidates, &self->priv->m_candidates_length1, &self->priv->_m_candidates_size_, _tmp115_);
					_tmp116_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
					g_object_ref_sink (_tmp116_);
					candidate_hbox = _tmp116_;
					_tmp117_ = candidate_hbox;
					gtk_widget_show ((GtkWidget*) _tmp117_);
					_tmp118_ = candidate_hbox;
					_tmp119_ = label;
					gtk_box_pack_start (_tmp118_, (GtkWidget*) _tmp119_, FALSE, FALSE, (guint) 2);
					_tmp120_ = candidate_hbox;
					_tmp121_ = candidate;
					gtk_box_pack_start (_tmp120_, (GtkWidget*) _tmp121_, FALSE, FALSE, (guint) 2);
					_tmp122_ = i;
					_data3_->index = _tmp122_;
					_tmp123_ = (GtkEventBox*) gtk_event_box_new ();
					g_object_ref_sink (_tmp123_);
					ebox = _tmp123_;
					_tmp124_ = ebox;
					gtk_widget_set_no_show_all ((GtkWidget*) _tmp124_, TRUE);
					_tmp125_ = ebox;
					g_signal_connect_data ((GtkWidget*) _tmp125_, "button-press-event", (GCallback) _______lambda6__gtk_widget_button_press_event, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
					_tmp126_ = ebox;
					_tmp127_ = candidate_hbox;
					gtk_container_add ((GtkContainer*) _tmp126_, (GtkWidget*) _tmp127_);
					_tmp128_ = hbox;
					_tmp129_ = ebox;
					gtk_box_pack_start (_tmp128_, (GtkWidget*) _tmp129_, FALSE, FALSE, (guint) 4);
					_tmp130_ = self->priv->m_widgets;
					_tmp130__length1 = self->priv->m_widgets_length1;
					_tmp131_ = ebox;
					_tmp132_ = _g_object_ref0 ((GtkWidget*) _tmp131_);
					_vala_array_add7 (&self->priv->m_widgets, &self->priv->m_widgets_length1, &self->priv->_m_widgets_size_, _tmp132_);
					_g_object_unref0 (ebox);
					_g_object_unref0 (candidate_hbox);
					_g_object_unref0 (candidate);
					_g_object_unref0 (label);
					block3_data_unref (_data3_);
					_data3_ = NULL;
				}
			}
		}
		_tmp133_ = hbox;
		_tmp134_ = vseparator_new ();
		g_object_ref_sink (_tmp134_);
		_tmp135_ = _tmp134_;
		gtk_box_pack_start (_tmp133_, (GtkWidget*) _tmp135_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp135_);
		_tmp136_ = hbox;
		_tmp137_ = prev_button;
		gtk_box_pack_start (_tmp136_, (GtkWidget*) _tmp137_, FALSE, FALSE, (guint) 0);
		_tmp138_ = hbox;
		_tmp139_ = next_button;
		gtk_box_pack_start (_tmp138_, (GtkWidget*) _tmp139_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (hbox);
	}
	_g_object_unref0 (next_button);
	_g_object_unref0 (prev_button);
}


static void g_cclosure_user_marshal_VOID__UINT_UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__UINT_UINT_UINT) (gpointer data1, guint arg_1, guint arg_2, guint arg_3, gpointer data2);
	register GMarshalFunc_VOID__UINT_UINT_UINT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__UINT_UINT_UINT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_uint (param_values + 2), g_value_get_uint (param_values + 3), data2);
}


static void candidate_area_class_init (CandidateAreaClass * klass) {
	candidate_area_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (CandidateAreaPrivate));
	G_OBJECT_CLASS (klass)->finalize = candidate_area_finalize;
	g_signal_new ("candidate_clicked", TYPE_CANDIDATE_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_UINT_UINT, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
	g_signal_new ("page_up", TYPE_CANDIDATE_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("page_down", TYPE_CANDIDATE_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("cursor_up", TYPE_CANDIDATE_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("cursor_down", TYPE_CANDIDATE_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void candidate_area_instance_init (CandidateArea * self) {
	self->priv = CANDIDATE_AREA_GET_PRIVATE (self);
}


static void candidate_area_finalize (GObject* obj) {
	CandidateArea * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CANDIDATE_AREA, CandidateArea);
	self->priv->m_labels = (_vala_array_free (self->priv->m_labels, self->priv->m_labels_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->m_candidates = (_vala_array_free (self->priv->m_candidates, self->priv->m_candidates_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->m_widgets = (_vala_array_free (self->priv->m_widgets, self->priv->m_widgets_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->m_ibus_candidates = (_vala_array_free (self->priv->m_ibus_candidates, self->priv->m_ibus_candidates_length1, (GDestroyNotify) g_object_unref), NULL);
	G_OBJECT_CLASS (candidate_area_parent_class)->finalize (obj);
}


GType candidate_area_get_type (void) {
	static volatile gsize candidate_area_type_id__volatile = 0;
	if (g_once_init_enter (&candidate_area_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (CandidateAreaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) candidate_area_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CandidateArea), 0, (GInstanceInitFunc) candidate_area_instance_init, NULL };
		GType candidate_area_type_id;
		candidate_area_type_id = g_type_register_static (GTK_TYPE_BOX, "CandidateArea", &g_define_type_info, 0);
		g_once_init_leave (&candidate_area_type_id__volatile, candidate_area_type_id);
	}
	return candidate_area_type_id__volatile;
}


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



