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

/*
 * Copyright 2026 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authored by: Leonhard Kargl <leo.kargl@proton.me>
 */

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

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

#define GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW (gala_daemon_ibus_candidate_window_get_type ())
#define GALA_DAEMON_IBUS_CANDIDATE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindow))
#define GALA_DAEMON_IBUS_CANDIDATE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindowClass))
#define GALA_DAEMON_IS_IBUS_CANDIDATE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW))
#define GALA_DAEMON_IS_IBUS_CANDIDATE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW))
#define GALA_DAEMON_IBUS_CANDIDATE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindowClass))

typedef struct _GalaDaemonIBusCandidateWindow GalaDaemonIBusCandidateWindow;
typedef struct _GalaDaemonIBusCandidateWindowClass GalaDaemonIBusCandidateWindowClass;
typedef struct _GalaDaemonIBusCandidateWindowPrivate GalaDaemonIBusCandidateWindowPrivate;

#define GALA_DAEMON_TYPE_CANDIDATE_AREA (gala_daemon_candidate_area_get_type ())
#define GALA_DAEMON_CANDIDATE_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_CANDIDATE_AREA, GalaDaemonCandidateArea))
#define GALA_DAEMON_CANDIDATE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_CANDIDATE_AREA, GalaDaemonCandidateAreaClass))
#define GALA_DAEMON_IS_CANDIDATE_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_CANDIDATE_AREA))
#define GALA_DAEMON_IS_CANDIDATE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_CANDIDATE_AREA))
#define GALA_DAEMON_CANDIDATE_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_CANDIDATE_AREA, GalaDaemonCandidateAreaClass))

typedef struct _GalaDaemonCandidateArea GalaDaemonCandidateArea;
typedef struct _GalaDaemonCandidateAreaClass GalaDaemonCandidateAreaClass;
enum  {
	GALA_DAEMON_IBUS_CANDIDATE_WINDOW_0_PROPERTY,
	GALA_DAEMON_IBUS_CANDIDATE_WINDOW_SERVICE_PROPERTY,
	GALA_DAEMON_IBUS_CANDIDATE_WINDOW_NUM_PROPERTIES
};
static GParamSpec* gala_daemon_ibus_candidate_window_properties[GALA_DAEMON_IBUS_CANDIDATE_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GalaDaemonIBusCandidateWindow {
	GtkWindow parent_instance;
	GalaDaemonIBusCandidateWindowPrivate * priv;
};

struct _GalaDaemonIBusCandidateWindowClass {
	GtkWindowClass parent_class;
};

struct _GalaDaemonIBusCandidateWindowPrivate {
	IBusPanelService* _service;
	GtkLabel* preedit_text;
	GtkLabel* auxiliary_text;
	GalaDaemonCandidateArea* candidate_area;
};

static gint GalaDaemonIBusCandidateWindow_private_offset;
static gpointer gala_daemon_ibus_candidate_window_parent_class = NULL;

VALA_EXTERN GType gala_daemon_ibus_candidate_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonIBusCandidateWindow, g_object_unref)
VALA_EXTERN GType gala_daemon_candidate_area_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonCandidateArea, g_object_unref)
VALA_EXTERN GalaDaemonIBusCandidateWindow* gala_daemon_ibus_candidate_window_new (IBusPanelService* service);
VALA_EXTERN GalaDaemonIBusCandidateWindow* gala_daemon_ibus_candidate_window_construct (GType object_type,
                                                                            IBusPanelService* service);
static void gala_daemon_ibus_candidate_window_update_visibility (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_show_preedit_text (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_hide_preedit_text (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_update_preedit_text (GalaDaemonIBusCandidateWindow* self,
                                                               IBusText* text,
                                                               guint cursor_pos,
                                                               gboolean visible);
static void gala_daemon_ibus_candidate_window_on_show_auxiliary_text (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_hide_auxiliary_text (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_update_auxiliary_text (GalaDaemonIBusCandidateWindow* self,
                                                                 IBusText* text,
                                                                 gboolean visible);
static void gala_daemon_ibus_candidate_window_on_show_lookup_table (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_hide_lookup_table (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_on_update_lookup_table (GalaDaemonIBusCandidateWindow* self,
                                                               IBusLookupTable* table,
                                                               gboolean visible);
VALA_EXTERN void gala_daemon_candidate_area_update (GalaDaemonCandidateArea* self,
                                        IBusLookupTable* table);
VALA_EXTERN IBusPanelService* gala_daemon_ibus_candidate_window_get_service (GalaDaemonIBusCandidateWindow* self);
static void gala_daemon_ibus_candidate_window_set_service (GalaDaemonIBusCandidateWindow* self,
                                                    IBusPanelService* value);
static GObject * gala_daemon_ibus_candidate_window_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties);
VALA_EXTERN GalaDaemonCandidateArea* gala_daemon_candidate_area_new (IBusPanelService* service);
VALA_EXTERN GalaDaemonCandidateArea* gala_daemon_candidate_area_construct (GType object_type,
                                                               IBusPanelService* service);
static void _gala_daemon_ibus_candidate_window_on_show_preedit_text_ibus_panel_service_show_preedit_text (IBusPanelService* _sender,
                                                                                                   gpointer self);
static void _gala_daemon_ibus_candidate_window_on_hide_preedit_text_ibus_panel_service_hide_preedit_text (IBusPanelService* _sender,
                                                                                                   gpointer self);
static void _gala_daemon_ibus_candidate_window_on_update_preedit_text_ibus_panel_service_update_preedit_text (IBusPanelService* _sender,
                                                                                                       IBusText* text,
                                                                                                       guint cursor_pos,
                                                                                                       gboolean visible,
                                                                                                       gpointer self);
static void _gala_daemon_ibus_candidate_window_on_show_auxiliary_text_ibus_panel_service_show_auxiliary_text (IBusPanelService* _sender,
                                                                                                       gpointer self);
static void _gala_daemon_ibus_candidate_window_on_hide_auxiliary_text_ibus_panel_service_hide_auxiliary_text (IBusPanelService* _sender,
                                                                                                       gpointer self);
static void _gala_daemon_ibus_candidate_window_on_update_auxiliary_text_ibus_panel_service_update_auxiliary_text (IBusPanelService* _sender,
                                                                                                           IBusText* text,
                                                                                                           gboolean visible,
                                                                                                           gpointer self);
static void _gala_daemon_ibus_candidate_window_on_show_lookup_table_ibus_panel_service_show_lookup_table (IBusPanelService* _sender,
                                                                                                   gpointer self);
static void _gala_daemon_ibus_candidate_window_on_hide_lookup_table_ibus_panel_service_hide_lookup_table (IBusPanelService* _sender,
                                                                                                   gpointer self);
static void _gala_daemon_ibus_candidate_window_on_update_lookup_table_ibus_panel_service_update_lookup_table (IBusPanelService* _sender,
                                                                                                       IBusLookupTable* lookup_table,
                                                                                                       gboolean visible,
                                                                                                       gpointer self);
static void _gtk_widget_hide_ibus_panel_service_focus_out (IBusPanelService* _sender,
                                                    const gchar* input_context_path,
                                                    gpointer self);
static void gala_daemon_ibus_candidate_window_finalize (GObject * obj);
static GType gala_daemon_ibus_candidate_window_get_type_once (void);
static void _vala_gala_daemon_ibus_candidate_window_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);
static void _vala_gala_daemon_ibus_candidate_window_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec);

static inline gpointer
gala_daemon_ibus_candidate_window_get_instance_private (GalaDaemonIBusCandidateWindow* self)
{
	return G_STRUCT_MEMBER_P (self, GalaDaemonIBusCandidateWindow_private_offset);
}

GalaDaemonIBusCandidateWindow*
gala_daemon_ibus_candidate_window_construct (GType object_type,
                                             IBusPanelService* service)
{
	GalaDaemonIBusCandidateWindow * self = NULL;
	g_return_val_if_fail (service != NULL, NULL);
	self = (GalaDaemonIBusCandidateWindow*) g_object_new (object_type, "service", service, NULL);
	return self;
}

GalaDaemonIBusCandidateWindow*
gala_daemon_ibus_candidate_window_new (IBusPanelService* service)
{
	return gala_daemon_ibus_candidate_window_construct (GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, service);
}

static void
gala_daemon_ibus_candidate_window_update_visibility (GalaDaemonIBusCandidateWindow* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkLabel* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean is_visible = FALSE;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->preedit_text;
	_tmp3_ = gtk_widget_get_visible ((GtkWidget*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp1_ = TRUE;
	} else {
		GtkLabel* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->priv->auxiliary_text;
		_tmp6_ = gtk_widget_get_visible ((GtkWidget*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GalaDaemonCandidateArea* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->candidate_area;
		_tmp9_ = gtk_widget_get_visible ((GtkWidget*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = _tmp10_;
	}
	is_visible = _tmp0_;
	if (is_visible) {
		gtk_window_present ((GtkWindow*) self);
	} else {
		gtk_widget_hide ((GtkWidget*) self);
	}
}

static void
gala_daemon_ibus_candidate_window_on_show_preedit_text (GalaDaemonIBusCandidateWindow* self)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->preedit_text;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_hide_preedit_text (GalaDaemonIBusCandidateWindow* self)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->preedit_text;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_update_preedit_text (GalaDaemonIBusCandidateWindow* self,
                                                          IBusText* text,
                                                          guint cursor_pos,
                                                          gboolean visible)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->preedit_text;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, visible);
	_tmp1_ = self->priv->preedit_text;
	_tmp2_ = text->text;
	gtk_label_set_label (_tmp1_, _tmp2_);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_show_auxiliary_text (GalaDaemonIBusCandidateWindow* self)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->auxiliary_text;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_hide_auxiliary_text (GalaDaemonIBusCandidateWindow* self)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->auxiliary_text;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_update_auxiliary_text (GalaDaemonIBusCandidateWindow* self,
                                                            IBusText* text,
                                                            gboolean visible)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->auxiliary_text;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, visible);
	_tmp1_ = self->priv->auxiliary_text;
	_tmp2_ = text->text;
	gtk_label_set_label (_tmp1_, _tmp2_);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_show_lookup_table (GalaDaemonIBusCandidateWindow* self)
{
	GalaDaemonCandidateArea* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->candidate_area;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_hide_lookup_table (GalaDaemonIBusCandidateWindow* self)
{
	GalaDaemonCandidateArea* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->candidate_area;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	gala_daemon_ibus_candidate_window_update_visibility (self);
}

static void
gala_daemon_ibus_candidate_window_on_update_lookup_table (GalaDaemonIBusCandidateWindow* self,
                                                          IBusLookupTable* table,
                                                          gboolean visible)
{
	GalaDaemonCandidateArea* _tmp0_;
	GalaDaemonCandidateArea* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (table != NULL);
	_tmp0_ = self->priv->candidate_area;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, visible);
	gala_daemon_ibus_candidate_window_update_visibility (self);
	_tmp1_ = self->priv->candidate_area;
	gala_daemon_candidate_area_update (_tmp1_, table);
}

IBusPanelService*
gala_daemon_ibus_candidate_window_get_service (GalaDaemonIBusCandidateWindow* self)
{
	IBusPanelService* result;
	IBusPanelService* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_service;
	result = _tmp0_;
	return result;
}

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

static void
gala_daemon_ibus_candidate_window_set_service (GalaDaemonIBusCandidateWindow* self,
                                               IBusPanelService* value)
{
	IBusPanelService* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_ibus_candidate_window_get_service (self);
	if (old_value != value) {
		IBusPanelService* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_service);
		self->priv->_service = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_ibus_candidate_window_properties[GALA_DAEMON_IBUS_CANDIDATE_WINDOW_SERVICE_PROPERTY]);
	}
}

static void
_gala_daemon_ibus_candidate_window_on_show_preedit_text_ibus_panel_service_show_preedit_text (IBusPanelService* _sender,
                                                                                              gpointer self)
{
	gala_daemon_ibus_candidate_window_on_show_preedit_text ((GalaDaemonIBusCandidateWindow*) self);
}

static void
_gala_daemon_ibus_candidate_window_on_hide_preedit_text_ibus_panel_service_hide_preedit_text (IBusPanelService* _sender,
                                                                                              gpointer self)
{
	gala_daemon_ibus_candidate_window_on_hide_preedit_text ((GalaDaemonIBusCandidateWindow*) self);
}

static void
_gala_daemon_ibus_candidate_window_on_update_preedit_text_ibus_panel_service_update_preedit_text (IBusPanelService* _sender,
                                                                                                  IBusText* text,
                                                                                                  guint cursor_pos,
                                                                                                  gboolean visible,
                                                                                                  gpointer self)
{
	gala_daemon_ibus_candidate_window_on_update_preedit_text ((GalaDaemonIBusCandidateWindow*) self, text, cursor_pos, visible);
}

static void
_gala_daemon_ibus_candidate_window_on_show_auxiliary_text_ibus_panel_service_show_auxiliary_text (IBusPanelService* _sender,
                                                                                                  gpointer self)
{
	gala_daemon_ibus_candidate_window_on_show_auxiliary_text ((GalaDaemonIBusCandidateWindow*) self);
}

static void
_gala_daemon_ibus_candidate_window_on_hide_auxiliary_text_ibus_panel_service_hide_auxiliary_text (IBusPanelService* _sender,
                                                                                                  gpointer self)
{
	gala_daemon_ibus_candidate_window_on_hide_auxiliary_text ((GalaDaemonIBusCandidateWindow*) self);
}

static void
_gala_daemon_ibus_candidate_window_on_update_auxiliary_text_ibus_panel_service_update_auxiliary_text (IBusPanelService* _sender,
                                                                                                      IBusText* text,
                                                                                                      gboolean visible,
                                                                                                      gpointer self)
{
	gala_daemon_ibus_candidate_window_on_update_auxiliary_text ((GalaDaemonIBusCandidateWindow*) self, text, visible);
}

static void
_gala_daemon_ibus_candidate_window_on_show_lookup_table_ibus_panel_service_show_lookup_table (IBusPanelService* _sender,
                                                                                              gpointer self)
{
	gala_daemon_ibus_candidate_window_on_show_lookup_table ((GalaDaemonIBusCandidateWindow*) self);
}

static void
_gala_daemon_ibus_candidate_window_on_hide_lookup_table_ibus_panel_service_hide_lookup_table (IBusPanelService* _sender,
                                                                                              gpointer self)
{
	gala_daemon_ibus_candidate_window_on_hide_lookup_table ((GalaDaemonIBusCandidateWindow*) self);
}

static void
_gala_daemon_ibus_candidate_window_on_update_lookup_table_ibus_panel_service_update_lookup_table (IBusPanelService* _sender,
                                                                                                  IBusLookupTable* lookup_table,
                                                                                                  gboolean visible,
                                                                                                  gpointer self)
{
	gala_daemon_ibus_candidate_window_on_update_lookup_table ((GalaDaemonIBusCandidateWindow*) self, lookup_table, visible);
}

static void
_gtk_widget_hide_ibus_panel_service_focus_out (IBusPanelService* _sender,
                                               const gchar* input_context_path,
                                               gpointer self)
{
	gtk_widget_hide ((GtkWidget*) self);
}

static GObject *
gala_daemon_ibus_candidate_window_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaDaemonIBusCandidateWindow * self;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	IBusPanelService* _tmp2_;
	GalaDaemonCandidateArea* _tmp3_ = NULL;
	GraniteBox* content_box = NULL;
	GraniteBox* _tmp4_ = NULL;
	GraniteBox* _tmp5_;
	GtkLabel* _tmp6_;
	GraniteBox* _tmp7_;
	GtkLabel* _tmp8_;
	GraniteBox* _tmp9_;
	GalaDaemonCandidateArea* _tmp10_;
	GtkGrid* _tmp11_ = NULL;
	GtkGrid* _tmp12_;
	GraniteBox* _tmp13_;
	IBusPanelService* _tmp14_;
	IBusPanelService* _tmp15_;
	IBusPanelService* _tmp16_;
	IBusPanelService* _tmp17_;
	IBusPanelService* _tmp18_;
	IBusPanelService* _tmp19_;
	IBusPanelService* _tmp20_;
	IBusPanelService* _tmp21_;
	IBusPanelService* _tmp22_;
	IBusPanelService* _tmp23_;
	parent_class = G_OBJECT_CLASS (gala_daemon_ibus_candidate_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindow);
	_tmp0_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->preedit_text);
	self->priv->preedit_text = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->auxiliary_text);
	self->priv->auxiliary_text = _tmp1_;
	_tmp2_ = self->priv->_service;
	_tmp3_ = gala_daemon_candidate_area_new (_tmp2_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, TRUE);
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, FALSE);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->candidate_area);
	self->priv->candidate_area = _tmp3_;
	_tmp4_ = granite_box_new (GTK_ORIENTATION_VERTICAL, GRANITE_BOX_SPACING_SINGLE);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp4_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp4_, 6);
	g_object_ref_sink (_tmp4_);
	content_box = _tmp4_;
	_tmp5_ = content_box;
	_tmp6_ = self->priv->preedit_text;
	gtk_box_append ((GtkBox*) _tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = content_box;
	_tmp8_ = self->priv->auxiliary_text;
	gtk_box_append ((GtkBox*) _tmp7_, (GtkWidget*) _tmp8_);
	_tmp9_ = content_box;
	_tmp10_ = self->priv->candidate_area;
	gtk_box_append ((GtkBox*) _tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp11_, FALSE);
	g_object_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) _tmp12_);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = content_box;
	gtk_window_set_child ((GtkWindow*) self, (GtkWidget*) _tmp13_);
	gtk_window_set_title ((GtkWindow*) self, "IBUS_CANDIDATE");
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	_tmp14_ = self->priv->_service;
	g_signal_connect_object (_tmp14_, "show-preedit-text", (GCallback) _gala_daemon_ibus_candidate_window_on_show_preedit_text_ibus_panel_service_show_preedit_text, self, 0);
	_tmp15_ = self->priv->_service;
	g_signal_connect_object (_tmp15_, "hide-preedit-text", (GCallback) _gala_daemon_ibus_candidate_window_on_hide_preedit_text_ibus_panel_service_hide_preedit_text, self, 0);
	_tmp16_ = self->priv->_service;
	g_signal_connect_object (_tmp16_, "update-preedit-text", (GCallback) _gala_daemon_ibus_candidate_window_on_update_preedit_text_ibus_panel_service_update_preedit_text, self, 0);
	_tmp17_ = self->priv->_service;
	g_signal_connect_object (_tmp17_, "show-auxiliary-text", (GCallback) _gala_daemon_ibus_candidate_window_on_show_auxiliary_text_ibus_panel_service_show_auxiliary_text, self, 0);
	_tmp18_ = self->priv->_service;
	g_signal_connect_object (_tmp18_, "hide-auxiliary-text", (GCallback) _gala_daemon_ibus_candidate_window_on_hide_auxiliary_text_ibus_panel_service_hide_auxiliary_text, self, 0);
	_tmp19_ = self->priv->_service;
	g_signal_connect_object (_tmp19_, "update-auxiliary-text", (GCallback) _gala_daemon_ibus_candidate_window_on_update_auxiliary_text_ibus_panel_service_update_auxiliary_text, self, 0);
	_tmp20_ = self->priv->_service;
	g_signal_connect_object (_tmp20_, "show-lookup-table", (GCallback) _gala_daemon_ibus_candidate_window_on_show_lookup_table_ibus_panel_service_show_lookup_table, self, 0);
	_tmp21_ = self->priv->_service;
	g_signal_connect_object (_tmp21_, "hide-lookup-table", (GCallback) _gala_daemon_ibus_candidate_window_on_hide_lookup_table_ibus_panel_service_hide_lookup_table, self, 0);
	_tmp22_ = self->priv->_service;
	g_signal_connect_object (_tmp22_, "update-lookup-table", (GCallback) _gala_daemon_ibus_candidate_window_on_update_lookup_table_ibus_panel_service_update_lookup_table, self, 0);
	_tmp23_ = self->priv->_service;
	g_signal_connect_object (_tmp23_, "focus-out", (GCallback) _gtk_widget_hide_ibus_panel_service_focus_out, (GtkWidget*) self, 0);
	_g_object_unref0 (content_box);
	return obj;
}

static void
gala_daemon_ibus_candidate_window_class_init (GalaDaemonIBusCandidateWindowClass * klass,
                                              gpointer klass_data)
{
	gala_daemon_ibus_candidate_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaDaemonIBusCandidateWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_daemon_ibus_candidate_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_daemon_ibus_candidate_window_set_property;
	G_OBJECT_CLASS (klass)->constructor = gala_daemon_ibus_candidate_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_daemon_ibus_candidate_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_IBUS_CANDIDATE_WINDOW_SERVICE_PROPERTY, gala_daemon_ibus_candidate_window_properties[GALA_DAEMON_IBUS_CANDIDATE_WINDOW_SERVICE_PROPERTY] = g_param_spec_object ("service", "service", "service", ibus_panel_service_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_daemon_ibus_candidate_window_instance_init (GalaDaemonIBusCandidateWindow * self,
                                                 gpointer klass)
{
	self->priv = gala_daemon_ibus_candidate_window_get_instance_private (self);
}

static void
gala_daemon_ibus_candidate_window_finalize (GObject * obj)
{
	GalaDaemonIBusCandidateWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindow);
	_g_object_unref0 (self->priv->_service);
	_g_object_unref0 (self->priv->preedit_text);
	_g_object_unref0 (self->priv->auxiliary_text);
	_g_object_unref0 (self->priv->candidate_area);
	G_OBJECT_CLASS (gala_daemon_ibus_candidate_window_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_daemon_ibus_candidate_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDaemonIBusCandidateWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_daemon_ibus_candidate_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDaemonIBusCandidateWindow), 0, (GInstanceInitFunc) gala_daemon_ibus_candidate_window_instance_init, NULL };
	GType gala_daemon_ibus_candidate_window_type_id;
	gala_daemon_ibus_candidate_window_type_id = g_type_register_static (gtk_window_get_type (), "GalaDaemonIBusCandidateWindow", &g_define_type_info, G_TYPE_FLAG_NONE);
	GalaDaemonIBusCandidateWindow_private_offset = g_type_add_instance_private (gala_daemon_ibus_candidate_window_type_id, sizeof (GalaDaemonIBusCandidateWindowPrivate));
	return gala_daemon_ibus_candidate_window_type_id;
}

GType
gala_daemon_ibus_candidate_window_get_type (void)
{
	static gsize gala_daemon_ibus_candidate_window_type_id__once = 0;
	if (g_once_init_enter (&gala_daemon_ibus_candidate_window_type_id__once)) {
		GType gala_daemon_ibus_candidate_window_type_id;
		gala_daemon_ibus_candidate_window_type_id = gala_daemon_ibus_candidate_window_get_type_once ();
		g_once_init_leave (&gala_daemon_ibus_candidate_window_type_id__once, gala_daemon_ibus_candidate_window_type_id);
	}
	return gala_daemon_ibus_candidate_window_type_id__once;
}

static void
_vala_gala_daemon_ibus_candidate_window_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	GalaDaemonIBusCandidateWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindow);
	switch (property_id) {
		case GALA_DAEMON_IBUS_CANDIDATE_WINDOW_SERVICE_PROPERTY:
		g_value_set_object (value, gala_daemon_ibus_candidate_window_get_service (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_daemon_ibus_candidate_window_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec)
{
	GalaDaemonIBusCandidateWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_IBUS_CANDIDATE_WINDOW, GalaDaemonIBusCandidateWindow);
	switch (property_id) {
		case GALA_DAEMON_IBUS_CANDIDATE_WINDOW_SERVICE_PROPERTY:
		gala_daemon_ibus_candidate_window_set_service (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

