/* menu-box.c generated by valac 0.17.1.6-d284, the Vala compiler
 * generated from menu-box.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <cairo.h>
#include <float.h>
#include <math.h>


#define BOXES_TYPE_MENU_BOX (boxes_menu_box_get_type ())
#define BOXES_MENU_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MENU_BOX, BoxesMenuBox))
#define BOXES_MENU_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MENU_BOX, BoxesMenuBoxClass))
#define BOXES_IS_MENU_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MENU_BOX))
#define BOXES_IS_MENU_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MENU_BOX))
#define BOXES_MENU_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MENU_BOX, BoxesMenuBoxClass))

typedef struct _BoxesMenuBox BoxesMenuBox;
typedef struct _BoxesMenuBoxClass BoxesMenuBoxClass;
typedef struct _BoxesMenuBoxPrivate BoxesMenuBoxPrivate;

#define BOXES_MENU_BOX_TYPE_ITEM (boxes_menu_box_item_get_type ())
#define BOXES_MENU_BOX_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_MENU_BOX_TYPE_ITEM, BoxesMenuBoxItem))
#define BOXES_MENU_BOX_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_MENU_BOX_TYPE_ITEM, BoxesMenuBoxItemClass))
#define BOXES_MENU_BOX_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_MENU_BOX_TYPE_ITEM))
#define BOXES_MENU_BOX_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_MENU_BOX_TYPE_ITEM))
#define BOXES_MENU_BOX_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_MENU_BOX_TYPE_ITEM, BoxesMenuBoxItemClass))

typedef struct _BoxesMenuBoxItem BoxesMenuBoxItem;
typedef struct _BoxesMenuBoxItemClass BoxesMenuBoxItemClass;
typedef struct _Block19Data Block19Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _BoxesMenuBoxItemPrivate BoxesMenuBoxItemPrivate;

struct _BoxesMenuBox {
	GtkBox parent_instance;
	BoxesMenuBoxPrivate * priv;
};

struct _BoxesMenuBoxClass {
	GtkBoxClass parent_class;
};

struct _Block19Data {
	int _ref_count_;
	BoxesMenuBox * self;
	BoxesMenuBoxItem* item;
};

struct _BoxesMenuBoxItem {
	GtkEventBox parent_instance;
	BoxesMenuBoxItemPrivate * priv;
};

struct _BoxesMenuBoxItemClass {
	GtkEventBoxClass parent_class;
};

struct _BoxesMenuBoxItemPrivate {
	gboolean _in_item;
	gboolean _selectable;
	GtkAlignment* alignment;
};


static gpointer boxes_menu_box_parent_class = NULL;
static gpointer boxes_menu_box_item_parent_class = NULL;

GType boxes_menu_box_get_type (void) G_GNUC_CONST;
enum  {
	BOXES_MENU_BOX_DUMMY_PROPERTY
};
BoxesMenuBox* boxes_menu_box_new (GtkOrientation orientation, gint spacing);
BoxesMenuBox* boxes_menu_box_construct (GType object_type, GtkOrientation orientation, gint spacing);
static void boxes_menu_box_real_add (GtkContainer* base, GtkWidget* widget);
GType boxes_menu_box_item_get_type (void) G_GNUC_CONST;
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static gboolean ___lambda49_ (Block19Data* _data19_, GdkEventKey* event);
static gboolean ____lambda49__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
static gboolean ___lambda50_ (Block19Data* _data19_);
static gboolean ____lambda50__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static gboolean boxes_menu_box_real_draw (GtkWidget* base, cairo_t* cr);
#define BOXES_MENU_BOX_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_MENU_BOX_TYPE_ITEM, BoxesMenuBoxItemPrivate))
enum  {
	BOXES_MENU_BOX_ITEM_DUMMY_PROPERTY,
	BOXES_MENU_BOX_ITEM_SELECTABLE
};
BoxesMenuBoxItem* boxes_menu_box_item_new (GtkWidget* child, gboolean selectable);
BoxesMenuBoxItem* boxes_menu_box_item_construct (GType object_type, GtkWidget* child, gboolean selectable);
void boxes_menu_box_item_set_selectable (BoxesMenuBoxItem* self, gboolean value);
static gboolean boxes_menu_box_item_get_in_item (BoxesMenuBoxItem* self);
static void boxes_menu_box_item_set_in_item (BoxesMenuBoxItem* self, gboolean value);
gboolean boxes_menu_box_item_get_selectable (BoxesMenuBoxItem* self);
static GObject * boxes_menu_box_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static gboolean _boxes_menu_box_item___lambda47_ (BoxesMenuBoxItem* self);
static gboolean __boxes_menu_box_item___lambda47__gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static gboolean _boxes_menu_box_item___lambda48_ (BoxesMenuBoxItem* self);
static gboolean __boxes_menu_box_item___lambda48__gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static void boxes_menu_box_item_finalize (GObject* obj);
static void _vala_boxes_menu_box_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_menu_box_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


BoxesMenuBox* boxes_menu_box_construct (GType object_type, GtkOrientation orientation, gint spacing) {
	BoxesMenuBox * self = NULL;
	GtkOrientation _tmp0_;
	gint _tmp1_;
	_tmp0_ = orientation;
	_tmp1_ = spacing;
	self = (BoxesMenuBox*) g_object_new (object_type, "orientation", _tmp0_, "spacing", _tmp1_, NULL);
	return self;
}


BoxesMenuBox* boxes_menu_box_new (GtkOrientation orientation, gint spacing) {
	return boxes_menu_box_construct (BOXES_TYPE_MENU_BOX, orientation, spacing);
}


static Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		BoxesMenuBox * self;
		self = _data19_->self;
		_g_object_unref0 (_data19_->item);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}


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


static gboolean ___lambda49_ (Block19Data* _data19_, GdkEventKey* event) {
	BoxesMenuBox * self;
	gboolean result = FALSE;
	GdkEventKey _tmp0_;
	guint _tmp1_;
	self = _data19_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = *event;
	_tmp1_ = _tmp0_.keyval;
	if (_tmp1_ == ((guint) GDK_KEY_Return)) {
		BoxesMenuBoxItem* _tmp2_;
		_tmp2_ = _data19_->item;
		g_signal_emit_by_name (self, "selected", (GtkWidget*) _tmp2_);
	}
	result = FALSE;
	return result;
}


static gboolean ____lambda49__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = ___lambda49_ (self, event);
	return result;
}


static gboolean ___lambda50_ (Block19Data* _data19_) {
	BoxesMenuBox * self;
	gboolean result = FALSE;
	BoxesMenuBoxItem* _tmp0_;
	BoxesMenuBoxItem* _tmp1_;
	self = _data19_->self;
	_tmp0_ = _data19_->item;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	_tmp1_ = _data19_->item;
	g_signal_emit_by_name (self, "selected", (GtkWidget*) _tmp1_);
	result = TRUE;
	return result;
}


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


static void boxes_menu_box_real_add (GtkContainer* base, GtkWidget* widget) {
	BoxesMenuBox * self;
	Block19Data* _data19_;
	GtkWidget* _tmp0_;
	BoxesMenuBoxItem* _tmp1_;
	BoxesMenuBoxItem* _tmp2_;
	GtkWidget* _tmp5_;
	self = (BoxesMenuBox*) base;
	g_return_if_fail (widget != NULL);
	_data19_ = g_slice_new0 (Block19Data);
	_data19_->_ref_count_ = 1;
	_data19_->self = g_object_ref (self);
	_tmp0_ = widget;
	_tmp1_ = _g_object_ref0 (BOXES_MENU_BOX_IS_ITEM (_tmp0_) ? ((BoxesMenuBoxItem*) _tmp0_) : NULL);
	_data19_->item = _tmp1_;
	_tmp2_ = _data19_->item;
	if (_tmp2_ != NULL) {
		BoxesMenuBoxItem* _tmp3_;
		BoxesMenuBoxItem* _tmp4_;
		_tmp3_ = _data19_->item;
		g_signal_connect_data ((GtkWidget*) _tmp3_, "key-press-event", (GCallback) ____lambda49__gtk_widget_key_press_event, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
		_tmp4_ = _data19_->item;
		g_signal_connect_data ((GtkWidget*) _tmp4_, "button-press-event", (GCallback) ____lambda50__gtk_widget_button_press_event, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
	}
	_tmp5_ = widget;
	GTK_CONTAINER_CLASS (boxes_menu_box_parent_class)->add ((GtkContainer*) GTK_BOX (self), _tmp5_);
	block19_data_unref (_data19_);
	_data19_ = NULL;
}


static gboolean boxes_menu_box_real_draw (GtkWidget* base, cairo_t* cr) {
	BoxesMenuBox * self;
	gboolean result = FALSE;
	GList* _tmp0_ = NULL;
	cairo_t* _tmp46_;
	gboolean _tmp47_ = FALSE;
	self = (BoxesMenuBox*) base;
	g_return_val_if_fail (cr != NULL, FALSE);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp0_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				gint position;
				GtkAllocation child_allocation = {0};
				GtkAllocation allocation = {0};
				GtkWidget* _tmp1_;
				GList* _tmp2_ = NULL;
				GList* _tmp3_;
				guint _tmp4_ = 0U;
				gint _tmp5_;
				gboolean _tmp6_;
				gboolean last;
				GtkWidget* _tmp7_;
				GtkAllocation _tmp8_ = {0};
				GtkAllocation _tmp9_ = {0};
				gint _tmp10_;
				GtkAllocation _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				GtkAllocation _tmp14_;
				gint _tmp15_;
				GtkWidget* _tmp16_;
				GtkStyleContext* _tmp17_ = NULL;
				GtkStyleContext* _tmp18_;
				GtkStyleContext* ctxt;
				GtkJunctionSides junction;
				GtkOrientation _tmp19_;
				GtkOrientation _tmp20_;
				GtkStyleContext* _tmp29_;
				GtkStyleContext* _tmp30_;
				GtkWidget* _tmp31_;
				GtkStateFlags _tmp32_ = 0;
				GtkStyleContext* _tmp33_;
				GtkJunctionSides _tmp34_;
				GtkStyleContext* _tmp35_;
				cairo_t* _tmp36_;
				GtkAllocation _tmp37_;
				gint _tmp38_;
				GtkAllocation _tmp39_;
				gint _tmp40_;
				GtkAllocation _tmp41_;
				gint _tmp42_;
				GtkAllocation _tmp43_;
				gint _tmp44_;
				GtkStyleContext* _tmp45_;
				position = 0;
				_tmp1_ = child;
				gtk_container_child_get ((GtkContainer*) self, _tmp1_, "position", &position, NULL);
				_tmp2_ = gtk_container_get_children ((GtkContainer*) self);
				_tmp3_ = _tmp2_;
				_tmp4_ = g_list_length (_tmp3_);
				_tmp5_ = position;
				_tmp6_ = _tmp4_ == ((guint) (_tmp5_ + 1));
				_g_list_free0 (_tmp3_);
				last = _tmp6_;
				_tmp7_ = child;
				gtk_widget_get_allocation (_tmp7_, &_tmp8_);
				child_allocation = _tmp8_;
				gtk_widget_get_allocation ((GtkWidget*) self, &_tmp9_);
				allocation = _tmp9_;
				_tmp10_ = child_allocation.x;
				_tmp11_ = allocation;
				_tmp12_ = _tmp11_.x;
				child_allocation.x = _tmp10_ - _tmp12_;
				_tmp13_ = child_allocation.y;
				_tmp14_ = allocation;
				_tmp15_ = _tmp14_.y;
				child_allocation.y = _tmp13_ - _tmp15_;
				_tmp16_ = child;
				_tmp17_ = gtk_widget_get_style_context (_tmp16_);
				_tmp18_ = _g_object_ref0 (_tmp17_);
				ctxt = _tmp18_;
				junction = 0;
				_tmp19_ = gtk_orientable_get_orientation ((GtkOrientable*) self);
				_tmp20_ = _tmp19_;
				if (_tmp20_ == GTK_ORIENTATION_VERTICAL) {
					gboolean _tmp21_;
					gint _tmp23_;
					_tmp21_ = last;
					if (!_tmp21_) {
						GtkJunctionSides _tmp22_;
						_tmp22_ = junction;
						junction = _tmp22_ | GTK_JUNCTION_BOTTOM;
					}
					_tmp23_ = position;
					if (_tmp23_ != 0) {
						GtkJunctionSides _tmp24_;
						_tmp24_ = junction;
						junction = _tmp24_ | GTK_JUNCTION_TOP;
					}
				} else {
					gboolean _tmp25_;
					gint _tmp27_;
					_tmp25_ = last;
					if (!_tmp25_) {
						GtkJunctionSides _tmp26_;
						_tmp26_ = junction;
						junction = _tmp26_ | GTK_JUNCTION_RIGHT;
					}
					_tmp27_ = position;
					if (_tmp27_ != 0) {
						GtkJunctionSides _tmp28_;
						_tmp28_ = junction;
						junction = _tmp28_ | GTK_JUNCTION_LEFT;
					}
				}
				_tmp29_ = ctxt;
				gtk_style_context_save (_tmp29_);
				_tmp30_ = ctxt;
				_tmp31_ = child;
				_tmp32_ = gtk_widget_get_state_flags (_tmp31_);
				gtk_style_context_set_state (_tmp30_, _tmp32_);
				_tmp33_ = ctxt;
				_tmp34_ = junction;
				gtk_style_context_set_junction_sides (_tmp33_, _tmp34_);
				_tmp35_ = ctxt;
				_tmp36_ = cr;
				_tmp37_ = child_allocation;
				_tmp38_ = _tmp37_.x;
				_tmp39_ = child_allocation;
				_tmp40_ = _tmp39_.y;
				_tmp41_ = child_allocation;
				_tmp42_ = _tmp41_.width;
				_tmp43_ = child_allocation;
				_tmp44_ = _tmp43_.height;
				gtk_render_background (_tmp35_, _tmp36_, (gdouble) _tmp38_, (gdouble) _tmp40_, (gdouble) _tmp42_, (gdouble) _tmp44_);
				_tmp45_ = ctxt;
				gtk_style_context_restore (_tmp45_);
				_g_object_unref0 (ctxt);
			}
		}
		_g_list_free0 (child_collection);
	}
	_tmp46_ = cr;
	_tmp47_ = GTK_WIDGET_CLASS (boxes_menu_box_parent_class)->draw ((GtkWidget*) GTK_BOX (self), _tmp46_);
	result = _tmp47_;
	return result;
}


BoxesMenuBoxItem* boxes_menu_box_item_construct (GType object_type, GtkWidget* child, gboolean selectable) {
	BoxesMenuBoxItem * self = NULL;
	GtkAlignment* _tmp0_;
	GtkWidget* _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (child != NULL, NULL);
	self = (BoxesMenuBoxItem*) g_object_new (object_type, NULL);
	_tmp0_ = self->priv->alignment;
	_tmp1_ = child;
	gtk_container_add ((GtkContainer*) _tmp0_, _tmp1_);
	_tmp2_ = selectable;
	boxes_menu_box_item_set_selectable (self, _tmp2_);
	return self;
}


BoxesMenuBoxItem* boxes_menu_box_item_new (GtkWidget* child, gboolean selectable) {
	return boxes_menu_box_item_construct (BOXES_MENU_BOX_TYPE_ITEM, child, selectable);
}


static gboolean boxes_menu_box_item_get_in_item (BoxesMenuBoxItem* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_in_item;
	result = _tmp0_;
	return result;
}


static void boxes_menu_box_item_set_in_item (BoxesMenuBoxItem* self, gboolean value) {
	gboolean _tmp0_;
	GtkStateFlags _tmp1_ = 0;
	GtkStateFlags flags;
	GtkStateFlags _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp8_;
	GtkStateFlags _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_in_item = _tmp0_;
	_tmp1_ = gtk_widget_get_state_flags ((GtkWidget*) self);
	flags = _tmp1_;
	_tmp2_ = flags;
	flags = _tmp2_ & (~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE));
	_tmp4_ = boxes_menu_box_item_get_in_item (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp6_ = boxes_menu_box_item_get_selectable (self);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_;
	} else {
		_tmp3_ = FALSE;
	}
	_tmp8_ = _tmp3_;
	if (_tmp8_) {
		GtkStateFlags _tmp9_;
		_tmp9_ = flags;
		flags = _tmp9_ | GTK_STATE_FLAG_PRELIGHT;
	}
	_tmp10_ = flags;
	gtk_widget_set_state_flags ((GtkWidget*) self, _tmp10_, TRUE);
}


gboolean boxes_menu_box_item_get_selectable (BoxesMenuBoxItem* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_selectable;
	result = _tmp0_;
	return result;
}


void boxes_menu_box_item_set_selectable (BoxesMenuBoxItem* self, gboolean value) {
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_selectable = _tmp0_;
	_tmp1_ = value;
	g_object_set ((GtkWidget*) self, "can-focus", _tmp1_, NULL);
	g_object_notify ((GObject *) self, "selectable");
}


static gboolean _boxes_menu_box_item___lambda47_ (BoxesMenuBoxItem* self) {
	gboolean result = FALSE;
	boxes_menu_box_item_set_in_item (self, TRUE);
	result = TRUE;
	return result;
}


static gboolean __boxes_menu_box_item___lambda47__gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = _boxes_menu_box_item___lambda47_ (self);
	return result;
}


static gboolean _boxes_menu_box_item___lambda48_ (BoxesMenuBoxItem* self) {
	gboolean result = FALSE;
	boxes_menu_box_item_set_in_item (self, FALSE);
	result = TRUE;
	return result;
}


static gboolean __boxes_menu_box_item___lambda48__gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = _boxes_menu_box_item___lambda48_ (self);
	return result;
}


static GObject * boxes_menu_box_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	BoxesMenuBoxItem * self;
	GtkStyleContext* _tmp0_ = NULL;
	GtkAlignment* _tmp1_;
	GtkAlignment* _tmp2_;
	GtkAlignment* _tmp3_;
	parent_class = G_OBJECT_CLASS (boxes_menu_box_item_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = BOXES_MENU_BOX_ITEM (obj);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, "menuitem");
	gtk_event_box_set_visible_window ((GtkEventBox*) self, FALSE);
	_tmp1_ = (GtkAlignment*) gtk_alignment_new (0.0f, 0.0f, 1.0f, 1.0f);
	_tmp2_ = g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->alignment);
	self->priv->alignment = _tmp2_;
	_tmp3_ = self->priv->alignment;
	g_object_set ((GtkContainer*) self, "child", (GtkWidget*) _tmp3_, NULL);
	g_signal_connect_object ((GtkWidget*) self, "enter-notify-event", (GCallback) __boxes_menu_box_item___lambda47__gtk_widget_enter_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "leave-notify-event", (GCallback) __boxes_menu_box_item___lambda48__gtk_widget_leave_notify_event, self, 0);
	return obj;
}


static void boxes_menu_box_item_class_init (BoxesMenuBoxItemClass * klass) {
	boxes_menu_box_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesMenuBoxItemPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_menu_box_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_menu_box_item_set_property;
	G_OBJECT_CLASS (klass)->constructor = boxes_menu_box_item_constructor;
	G_OBJECT_CLASS (klass)->finalize = boxes_menu_box_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MENU_BOX_ITEM_SELECTABLE, g_param_spec_boolean ("selectable", "selectable", "selectable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void boxes_menu_box_item_instance_init (BoxesMenuBoxItem * self) {
	self->priv = BOXES_MENU_BOX_ITEM_GET_PRIVATE (self);
}


static void boxes_menu_box_item_finalize (GObject* obj) {
	BoxesMenuBoxItem * self;
	self = BOXES_MENU_BOX_ITEM (obj);
	_g_object_unref0 (self->priv->alignment);
	G_OBJECT_CLASS (boxes_menu_box_item_parent_class)->finalize (obj);
}


GType boxes_menu_box_item_get_type (void) {
	static volatile gsize boxes_menu_box_item_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_menu_box_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesMenuBoxItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_menu_box_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesMenuBoxItem), 0, (GInstanceInitFunc) boxes_menu_box_item_instance_init, NULL };
		GType boxes_menu_box_item_type_id;
		boxes_menu_box_item_type_id = g_type_register_static (GTK_TYPE_EVENT_BOX, "BoxesMenuBoxItem", &g_define_type_info, 0);
		g_once_init_leave (&boxes_menu_box_item_type_id__volatile, boxes_menu_box_item_type_id);
	}
	return boxes_menu_box_item_type_id__volatile;
}


static void _vala_boxes_menu_box_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesMenuBoxItem * self;
	self = BOXES_MENU_BOX_ITEM (object);
	switch (property_id) {
		case BOXES_MENU_BOX_ITEM_SELECTABLE:
		g_value_set_boolean (value, boxes_menu_box_item_get_selectable (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_menu_box_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesMenuBoxItem * self;
	self = BOXES_MENU_BOX_ITEM (object);
	switch (property_id) {
		case BOXES_MENU_BOX_ITEM_SELECTABLE:
		boxes_menu_box_item_set_selectable (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void boxes_menu_box_class_init (BoxesMenuBoxClass * klass) {
	boxes_menu_box_parent_class = g_type_class_peek_parent (klass);
	GTK_CONTAINER_CLASS (klass)->add = boxes_menu_box_real_add;
	GTK_WIDGET_CLASS (klass)->draw = boxes_menu_box_real_draw;
	g_signal_new ("selected", BOXES_TYPE_MENU_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
}


static void boxes_menu_box_instance_init (BoxesMenuBox * self) {
}


GType boxes_menu_box_get_type (void) {
	static volatile gsize boxes_menu_box_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_menu_box_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesMenuBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_menu_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesMenuBox), 0, (GInstanceInitFunc) boxes_menu_box_instance_init, NULL };
		GType boxes_menu_box_type_id;
		boxes_menu_box_type_id = g_type_register_static (GTK_TYPE_BOX, "BoxesMenuBox", &g_define_type_info, 0);
		g_once_init_leave (&boxes_menu_box_type_id__volatile, boxes_menu_box_type_id);
	}
	return boxes_menu_box_type_id__volatile;
}



