/* 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-xkb - IBus XKB
 *
 * Copyright(c) 2012 Takao Fujiwara <takao.fujiwara1@gmail.com>
 * 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 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 program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  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);
static void candidate_area_recreate_ui (CandidateArea* self);
void candidate_area_set_vertical (CandidateArea* self, gboolean vertical);
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."};

CandidateArea* candidate_area_construct (GType object_type, gboolean vertical) {
	CandidateArea * self = NULL;
	GtkOrientation _tmp0_ = 0;
	gboolean _tmp1_;
	GtkOrientation _tmp2_;
	gboolean _tmp3_;
	_tmp1_ = vertical;
	if (_tmp1_) {
		_tmp0_ = GTK_ORIENTATION_VERTICAL;
	} else {
		_tmp0_ = GTK_ORIENTATION_HORIZONTAL;
	}
	_tmp2_ = _tmp0_;
	self = (CandidateArea*) g_object_new (object_type, "orientation", _tmp2_, NULL);
	_tmp3_ = vertical;
	self->priv->m_vertical = _tmp3_;
	candidate_area_recreate_ui (self);
	gtk_widget_show_all ((GtkWidget*) self);
	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 _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	IBusText** _tmp3_;
	gint _tmp3__length1;
	IBusText** _tmp4_;
	gint _tmp4__length1;
	guint _tmp5_;
	gboolean _tmp6_;
	GtkLabel** _tmp7_;
	gint _tmp7__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->m_vertical;
	_tmp1_ = vertical;
	if (_tmp0_ == _tmp1_) {
		return;
	}
	_tmp2_ = vertical;
	self->priv->m_vertical = _tmp2_;
	candidate_area_recreate_ui (self);
	_tmp3_ = self->priv->m_ibus_candidates;
	_tmp3__length1 = self->priv->m_ibus_candidates_length1;
	self->priv->m_ibus_candidates = NULL;
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _tmp3__length1;
	_tmp5_ = self->priv->m_focus_candidate;
	_tmp6_ = self->priv->m_show_cursor;
	candidate_area_set_candidates (self, _tmp4_, _tmp3__length1, _tmp5_, _tmp6_);
	_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp7_ = self->priv->m_candidates;
	_tmp7__length1 = self->priv->m_candidates_length1;
	if (_tmp7__length1 > 0) {
		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_;
	GtkImage* _tmp6_;
	GtkImage* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* next_button;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkImage* _tmp12_;
	GtkImage* _tmp13_;
	GtkButton* _tmp14_;
	gboolean _tmp15_;
	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_ = (GtkImage*) gtk_image_new_from_icon_name (GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	gtk_button_set_image (_tmp5_, (GtkWidget*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = prev_button;
	gtk_button_set_relief (_tmp8_, GTK_RELIEF_NONE);
	_tmp9_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp9_);
	next_button = _tmp9_;
	_tmp10_ = next_button;
	g_signal_connect_object (_tmp10_, "clicked", (GCallback) ___lambda3__gtk_button_clicked, self, 0);
	_tmp11_ = next_button;
	_tmp12_ = (GtkImage*) gtk_image_new_from_icon_name (GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp12_);
	_tmp13_ = _tmp12_;
	gtk_button_set_image (_tmp11_, (GtkWidget*) _tmp13_);
	_g_object_unref0 (_tmp13_);
	_tmp14_ = next_button;
	gtk_button_set_relief (_tmp14_, GTK_RELIEF_NONE);
	_tmp15_ = self->priv->m_vertical;
	if (_tmp15_) {
		GtkHBox* _tmp16_;
		GtkHBox* candidates_hbox;
		GtkHBox* _tmp17_;
		GtkVBox* _tmp18_;
		GtkVBox* labels_vbox;
		GtkVBox* _tmp19_;
		GtkVBox* candidates_vbox;
		GtkHBox* _tmp20_;
		GtkVBox* _tmp21_;
		GtkHBox* _tmp22_;
		VSeparator* _tmp23_;
		VSeparator* _tmp24_;
		GtkHBox* _tmp25_;
		GtkVBox* _tmp26_;
		HSeparator* _tmp27_;
		HSeparator* _tmp28_;
		GtkHBox* _tmp29_;
		GtkHBox* buttons_hbox;
		GtkLabel* _tmp30_;
		GtkLabel* state_label;
		GtkLabel* _tmp31_;
		GtkHBox* _tmp32_;
		GtkLabel* _tmp33_;
		GtkHBox* _tmp34_;
		GtkButton* _tmp35_;
		GtkHBox* _tmp36_;
		GtkButton* _tmp37_;
		GtkHBox* _tmp38_;
		GtkLabel** _tmp39_ = NULL;
		GtkLabel** _tmp40_ = NULL;
		GtkWidget** _tmp41_ = NULL;
		_tmp16_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
		g_object_ref_sink (_tmp16_);
		candidates_hbox = _tmp16_;
		_tmp17_ = candidates_hbox;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp17_, FALSE, FALSE, (guint) 0);
		_tmp18_ = (GtkVBox*) gtk_vbox_new (TRUE, 0);
		g_object_ref_sink (_tmp18_);
		labels_vbox = _tmp18_;
		_tmp19_ = (GtkVBox*) gtk_vbox_new (TRUE, 0);
		g_object_ref_sink (_tmp19_);
		candidates_vbox = _tmp19_;
		_tmp20_ = candidates_hbox;
		_tmp21_ = labels_vbox;
		gtk_box_pack_start ((GtkBox*) _tmp20_, (GtkWidget*) _tmp21_, FALSE, FALSE, (guint) 4);
		_tmp22_ = candidates_hbox;
		_tmp23_ = vseparator_new ();
		g_object_ref_sink (_tmp23_);
		_tmp24_ = _tmp23_;
		gtk_box_pack_start ((GtkBox*) _tmp22_, (GtkWidget*) _tmp24_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp24_);
		_tmp25_ = candidates_hbox;
		_tmp26_ = candidates_vbox;
		gtk_box_pack_start ((GtkBox*) _tmp25_, (GtkWidget*) _tmp26_, TRUE, TRUE, (guint) 4);
		_tmp27_ = hseparator_new ();
		g_object_ref_sink (_tmp27_);
		_tmp28_ = _tmp27_;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp28_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp28_);
		_tmp29_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
		g_object_ref_sink (_tmp29_);
		buttons_hbox = _tmp29_;
		_tmp30_ = (GtkLabel*) gtk_label_new (NULL);
		g_object_ref_sink (_tmp30_);
		state_label = _tmp30_;
		_tmp31_ = state_label;
		gtk_widget_set_size_request ((GtkWidget*) _tmp31_, 20, -1);
		_tmp32_ = buttons_hbox;
		_tmp33_ = state_label;
		gtk_box_pack_start ((GtkBox*) _tmp32_, (GtkWidget*) _tmp33_, TRUE, TRUE, (guint) 0);
		_tmp34_ = buttons_hbox;
		_tmp35_ = prev_button;
		gtk_box_pack_start ((GtkBox*) _tmp34_, (GtkWidget*) _tmp35_, FALSE, FALSE, (guint) 0);
		_tmp36_ = buttons_hbox;
		_tmp37_ = next_button;
		gtk_box_pack_start ((GtkBox*) _tmp36_, (GtkWidget*) _tmp37_, FALSE, FALSE, (guint) 0);
		_tmp38_ = buttons_hbox;
		gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp38_, FALSE, FALSE, (guint) 0);
		_tmp39_ = 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 = _tmp39_;
		self->priv->m_labels_length1 = 0;
		self->priv->_m_labels_size_ = self->priv->m_labels_length1;
		_tmp40_ = 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 = _tmp40_;
		self->priv->m_candidates_length1 = 0;
		self->priv->_m_candidates_size_ = self->priv->m_candidates_length1;
		_tmp41_ = 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 = _tmp41_;
		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 _tmp42_;
				_tmp42_ = TRUE;
				while (TRUE) {
					Block2Data* _data2_;
					gboolean _tmp43_;
					gint _tmp45_;
					gint _tmp46_;
					const gchar* _tmp47_;
					GtkLabel* _tmp48_;
					GtkLabel* label;
					GtkLabel* _tmp49_;
					GtkLabel* _tmp50_;
					GtkLabel** _tmp51_;
					gint _tmp51__length1;
					GtkLabel* _tmp52_;
					GtkLabel* _tmp53_;
					GtkLabel* _tmp54_;
					GtkLabel* candidate;
					GtkLabel* _tmp55_;
					GtkLabel* _tmp56_;
					GtkLabel** _tmp57_;
					gint _tmp57__length1;
					GtkLabel* _tmp58_;
					GtkLabel* _tmp59_;
					GtkLabel* _tmp60_;
					GValue _tmp61_ = {0};
					GtkLabel* _tmp62_;
					GValue _tmp63_ = {0};
					gint _tmp64_;
					GtkEventBox* _tmp65_;
					GtkEventBox* label_ebox;
					GtkEventBox* _tmp66_;
					GtkEventBox* _tmp67_;
					GtkEventBox* _tmp68_;
					GtkLabel* _tmp69_;
					GtkVBox* _tmp70_;
					GtkEventBox* _tmp71_;
					GtkWidget** _tmp72_;
					gint _tmp72__length1;
					GtkEventBox* _tmp73_;
					GtkWidget* _tmp74_;
					GtkEventBox* _tmp75_;
					GtkEventBox* candidate_ebox;
					GtkEventBox* _tmp76_;
					GtkEventBox* _tmp77_;
					GtkEventBox* _tmp78_;
					GtkLabel* _tmp79_;
					GtkVBox* _tmp80_;
					GtkEventBox* _tmp81_;
					GtkWidget** _tmp82_;
					gint _tmp82__length1;
					GtkEventBox* _tmp83_;
					GtkWidget* _tmp84_;
					_data2_ = g_slice_new0 (Block2Data);
					_data2_->_ref_count_ = 1;
					_data2_->_data1_ = block1_data_ref (_data1_);
					_tmp43_ = _tmp42_;
					if (!_tmp43_) {
						gint _tmp44_;
						_tmp44_ = _data1_->i;
						_data1_->i = _tmp44_ + 1;
					}
					_tmp42_ = FALSE;
					_tmp45_ = _data1_->i;
					if (!(_tmp45_ < 16)) {
						block2_data_unref (_data2_);
						_data2_ = NULL;
						break;
					}
					_tmp46_ = _data1_->i;
					_tmp47_ = CANDIDATE_AREA_LABELS[_tmp46_];
					_tmp48_ = (GtkLabel*) gtk_label_new (_tmp47_);
					g_object_ref_sink (_tmp48_);
					label = _tmp48_;
					_tmp49_ = label;
					gtk_misc_set_alignment ((GtkMisc*) _tmp49_, 0.0f, 0.5f);
					_tmp50_ = label;
					gtk_widget_show ((GtkWidget*) _tmp50_);
					_tmp51_ = self->priv->m_labels;
					_tmp51__length1 = self->priv->m_labels_length1;
					_tmp52_ = label;
					_tmp53_ = _g_object_ref0 (_tmp52_);
					_vala_array_add1 (&self->priv->m_labels, &self->priv->m_labels_length1, &self->priv->_m_labels_size_, _tmp53_);
					_tmp54_ = (GtkLabel*) gtk_label_new ("test");
					g_object_ref_sink (_tmp54_);
					candidate = _tmp54_;
					_tmp55_ = candidate;
					gtk_misc_set_alignment ((GtkMisc*) _tmp55_, 0.0f, 0.5f);
					_tmp56_ = candidate;
					gtk_widget_show ((GtkWidget*) _tmp56_);
					_tmp57_ = self->priv->m_candidates;
					_tmp57__length1 = self->priv->m_candidates_length1;
					_tmp58_ = candidate;
					_tmp59_ = _g_object_ref0 (_tmp58_);
					_vala_array_add2 (&self->priv->m_candidates, &self->priv->m_candidates_length1, &self->priv->_m_candidates_size_, _tmp59_);
					_tmp60_ = label;
					g_value_init (&_tmp61_, G_TYPE_INT);
					g_value_set_int (&_tmp61_, 8);
					g_object_set_property ((GObject*) _tmp60_, "xpad", &_tmp61_);
					G_IS_VALUE (&_tmp61_) ? (g_value_unset (&_tmp61_), NULL) : NULL;
					_tmp62_ = candidate;
					g_value_init (&_tmp63_, G_TYPE_INT);
					g_value_set_int (&_tmp63_, 8);
					g_object_set_property ((GObject*) _tmp62_, "xpad", &_tmp63_);
					G_IS_VALUE (&_tmp63_) ? (g_value_unset (&_tmp63_), NULL) : NULL;
					_tmp64_ = _data1_->i;
					_data2_->index = _tmp64_;
					_tmp65_ = (GtkEventBox*) gtk_event_box_new ();
					g_object_ref_sink (_tmp65_);
					label_ebox = _tmp65_;
					_tmp66_ = label_ebox;
					gtk_widget_set_no_show_all ((GtkWidget*) _tmp66_, TRUE);
					_tmp67_ = label_ebox;
					g_signal_connect_data ((GtkWidget*) _tmp67_, "button-press-event", (GCallback) _______lambda4__gtk_widget_button_press_event, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
					_tmp68_ = label_ebox;
					_tmp69_ = label;
					gtk_container_add ((GtkContainer*) _tmp68_, (GtkWidget*) _tmp69_);
					_tmp70_ = labels_vbox;
					_tmp71_ = label_ebox;
					gtk_box_pack_start ((GtkBox*) _tmp70_, (GtkWidget*) _tmp71_, FALSE, FALSE, (guint) 2);
					_tmp72_ = self->priv->m_widgets;
					_tmp72__length1 = self->priv->m_widgets_length1;
					_tmp73_ = label_ebox;
					_tmp74_ = _g_object_ref0 ((GtkWidget*) _tmp73_);
					_vala_array_add3 (&self->priv->m_widgets, &self->priv->m_widgets_length1, &self->priv->_m_widgets_size_, _tmp74_);
					_tmp75_ = (GtkEventBox*) gtk_event_box_new ();
					g_object_ref_sink (_tmp75_);
					candidate_ebox = _tmp75_;
					_tmp76_ = candidate_ebox;
					gtk_widget_set_no_show_all ((GtkWidget*) _tmp76_, TRUE);
					_tmp77_ = candidate_ebox;
					g_signal_connect_data ((GtkWidget*) _tmp77_, "button-press-event", (GCallback) _______lambda5__gtk_widget_button_press_event, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
					_tmp78_ = candidate_ebox;
					_tmp79_ = candidate;
					gtk_container_add ((GtkContainer*) _tmp78_, (GtkWidget*) _tmp79_);
					_tmp80_ = candidates_vbox;
					_tmp81_ = candidate_ebox;
					gtk_box_pack_start ((GtkBox*) _tmp80_, (GtkWidget*) _tmp81_, FALSE, FALSE, (guint) 2);
					_tmp82_ = self->priv->m_widgets;
					_tmp82__length1 = self->priv->m_widgets_length1;
					_tmp83_ = candidate_ebox;
					_tmp84_ = _g_object_ref0 ((GtkWidget*) _tmp83_);
					_vala_array_add4 (&self->priv->m_widgets, &self->priv->m_widgets_length1, &self->priv->_m_widgets_size_, _tmp84_);
					_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 {
		GtkHBox* _tmp85_;
		GtkHBox* hbox;
		GtkHBox* _tmp86_;
		GtkLabel** _tmp87_ = NULL;
		GtkLabel** _tmp88_ = NULL;
		GtkWidget** _tmp89_ = NULL;
		GtkHBox* _tmp125_;
		VSeparator* _tmp126_;
		VSeparator* _tmp127_;
		GtkHBox* _tmp128_;
		GtkButton* _tmp129_;
		GtkHBox* _tmp130_;
		GtkButton* _tmp131_;
		_tmp85_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
		g_object_ref_sink (_tmp85_);
		hbox = _tmp85_;
		_tmp86_ = hbox;
		gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp86_);
		_tmp87_ = 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 = _tmp87_;
		self->priv->m_labels_length1 = 0;
		self->priv->_m_labels_size_ = self->priv->m_labels_length1;
		_tmp88_ = 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 = _tmp88_;
		self->priv->m_candidates_length1 = 0;
		self->priv->_m_candidates_size_ = self->priv->m_candidates_length1;
		_tmp89_ = 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 = _tmp89_;
		self->priv->m_widgets_length1 = 0;
		self->priv->_m_widgets_size_ = self->priv->m_widgets_length1;
		{
			gint i;
			i = 0;
			{
				gboolean _tmp90_;
				_tmp90_ = TRUE;
				while (TRUE) {
					Block3Data* _data3_;
					gboolean _tmp91_;
					gint _tmp93_;
					gint _tmp94_;
					const gchar* _tmp95_;
					GtkLabel* _tmp96_;
					GtkLabel* label;
					GtkLabel* _tmp97_;
					GtkLabel* _tmp98_;
					GtkLabel** _tmp99_;
					gint _tmp99__length1;
					GtkLabel* _tmp100_;
					GtkLabel* _tmp101_;
					GtkLabel* _tmp102_;
					GtkLabel* candidate;
					GtkLabel* _tmp103_;
					GtkLabel* _tmp104_;
					GtkLabel** _tmp105_;
					gint _tmp105__length1;
					GtkLabel* _tmp106_;
					GtkLabel* _tmp107_;
					GtkHBox* _tmp108_;
					GtkHBox* candidate_hbox;
					GtkHBox* _tmp109_;
					GtkHBox* _tmp110_;
					GtkLabel* _tmp111_;
					GtkHBox* _tmp112_;
					GtkLabel* _tmp113_;
					gint _tmp114_;
					GtkEventBox* _tmp115_;
					GtkEventBox* ebox;
					GtkEventBox* _tmp116_;
					GtkEventBox* _tmp117_;
					GtkEventBox* _tmp118_;
					GtkHBox* _tmp119_;
					GtkHBox* _tmp120_;
					GtkEventBox* _tmp121_;
					GtkWidget** _tmp122_;
					gint _tmp122__length1;
					GtkEventBox* _tmp123_;
					GtkWidget* _tmp124_;
					_data3_ = g_slice_new0 (Block3Data);
					_data3_->_ref_count_ = 1;
					_data3_->self = g_object_ref (self);
					_tmp91_ = _tmp90_;
					if (!_tmp91_) {
						gint _tmp92_;
						_tmp92_ = i;
						i = _tmp92_ + 1;
					}
					_tmp90_ = FALSE;
					_tmp93_ = i;
					if (!(_tmp93_ < 16)) {
						block3_data_unref (_data3_);
						_data3_ = NULL;
						break;
					}
					_tmp94_ = i;
					_tmp95_ = CANDIDATE_AREA_LABELS[_tmp94_];
					_tmp96_ = (GtkLabel*) gtk_label_new (_tmp95_);
					g_object_ref_sink (_tmp96_);
					label = _tmp96_;
					_tmp97_ = label;
					gtk_misc_set_alignment ((GtkMisc*) _tmp97_, 0.0f, 0.5f);
					_tmp98_ = label;
					gtk_widget_show ((GtkWidget*) _tmp98_);
					_tmp99_ = self->priv->m_labels;
					_tmp99__length1 = self->priv->m_labels_length1;
					_tmp100_ = label;
					_tmp101_ = _g_object_ref0 (_tmp100_);
					_vala_array_add5 (&self->priv->m_labels, &self->priv->m_labels_length1, &self->priv->_m_labels_size_, _tmp101_);
					_tmp102_ = (GtkLabel*) gtk_label_new ("test");
					g_object_ref_sink (_tmp102_);
					candidate = _tmp102_;
					_tmp103_ = candidate;
					gtk_misc_set_alignment ((GtkMisc*) _tmp103_, 0.0f, 0.5f);
					_tmp104_ = candidate;
					gtk_widget_show ((GtkWidget*) _tmp104_);
					_tmp105_ = self->priv->m_candidates;
					_tmp105__length1 = self->priv->m_candidates_length1;
					_tmp106_ = candidate;
					_tmp107_ = _g_object_ref0 (_tmp106_);
					_vala_array_add6 (&self->priv->m_candidates, &self->priv->m_candidates_length1, &self->priv->_m_candidates_size_, _tmp107_);
					_tmp108_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
					g_object_ref_sink (_tmp108_);
					candidate_hbox = _tmp108_;
					_tmp109_ = candidate_hbox;
					gtk_widget_show ((GtkWidget*) _tmp109_);
					_tmp110_ = candidate_hbox;
					_tmp111_ = label;
					gtk_box_pack_start ((GtkBox*) _tmp110_, (GtkWidget*) _tmp111_, FALSE, FALSE, (guint) 2);
					_tmp112_ = candidate_hbox;
					_tmp113_ = candidate;
					gtk_box_pack_start ((GtkBox*) _tmp112_, (GtkWidget*) _tmp113_, FALSE, FALSE, (guint) 2);
					_tmp114_ = i;
					_data3_->index = _tmp114_;
					_tmp115_ = (GtkEventBox*) gtk_event_box_new ();
					g_object_ref_sink (_tmp115_);
					ebox = _tmp115_;
					_tmp116_ = ebox;
					gtk_widget_set_no_show_all ((GtkWidget*) _tmp116_, TRUE);
					_tmp117_ = ebox;
					g_signal_connect_data ((GtkWidget*) _tmp117_, "button-press-event", (GCallback) _______lambda6__gtk_widget_button_press_event, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
					_tmp118_ = ebox;
					_tmp119_ = candidate_hbox;
					gtk_container_add ((GtkContainer*) _tmp118_, (GtkWidget*) _tmp119_);
					_tmp120_ = hbox;
					_tmp121_ = ebox;
					gtk_box_pack_start ((GtkBox*) _tmp120_, (GtkWidget*) _tmp121_, FALSE, FALSE, (guint) 4);
					_tmp122_ = self->priv->m_widgets;
					_tmp122__length1 = self->priv->m_widgets_length1;
					_tmp123_ = ebox;
					_tmp124_ = _g_object_ref0 ((GtkWidget*) _tmp123_);
					_vala_array_add7 (&self->priv->m_widgets, &self->priv->m_widgets_length1, &self->priv->_m_widgets_size_, _tmp124_);
					_g_object_unref0 (ebox);
					_g_object_unref0 (candidate_hbox);
					_g_object_unref0 (candidate);
					_g_object_unref0 (label);
					block3_data_unref (_data3_);
					_data3_ = NULL;
				}
			}
		}
		_tmp125_ = hbox;
		_tmp126_ = vseparator_new ();
		g_object_ref_sink (_tmp126_);
		_tmp127_ = _tmp126_;
		gtk_box_pack_start ((GtkBox*) _tmp125_, (GtkWidget*) _tmp127_, FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp127_);
		_tmp128_ = hbox;
		_tmp129_ = prev_button;
		gtk_box_pack_start ((GtkBox*) _tmp128_, (GtkWidget*) _tmp129_, FALSE, FALSE, (guint) 0);
		_tmp130_ = hbox;
		_tmp131_ = next_button;
		gtk_box_pack_start ((GtkBox*) _tmp130_, (GtkWidget*) _tmp131_, 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);
}



