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

/*  This file is part of corebird, a Gtk+ linux Twitter client.
 *  Copyright (C) 2013 Timm Bäder
 *
 *  corebird is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  corebird is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with corebird.  If not, see <http://www.gnu.org/licenses/>.
 */

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


#define TYPE_MAX_SIZE_CONTAINER (max_size_container_get_type ())
#define MAX_SIZE_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer))
#define MAX_SIZE_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAX_SIZE_CONTAINER, MaxSizeContainerClass))
#define IS_MAX_SIZE_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAX_SIZE_CONTAINER))
#define IS_MAX_SIZE_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAX_SIZE_CONTAINER))
#define MAX_SIZE_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAX_SIZE_CONTAINER, MaxSizeContainerClass))

typedef struct _MaxSizeContainer MaxSizeContainer;
typedef struct _MaxSizeContainerClass MaxSizeContainerClass;
typedef struct _MaxSizeContainerPrivate MaxSizeContainerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _MaxSizeContainer {
	GtkBin parent_instance;
	MaxSizeContainerPrivate * priv;
};

struct _MaxSizeContainerClass {
	GtkBinClass parent_class;
};

struct _MaxSizeContainerPrivate {
	GdkWindow* event_window;
	gint _max_size;
};


static gpointer max_size_container_parent_class = NULL;

GType max_size_container_get_type (void) G_GNUC_CONST;
#define MAX_SIZE_CONTAINER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MAX_SIZE_CONTAINER, MaxSizeContainerPrivate))
enum  {
	MAX_SIZE_CONTAINER_DUMMY_PROPERTY,
	MAX_SIZE_CONTAINER_MAX_SIZE
};
static void max_size_container_real_add (GtkContainer* base, GtkWidget* widget);
static GtkSizeRequestMode max_size_container_real_get_request_mode (GtkWidget* base);
static void max_size_container_real_get_preferred_height_for_width (GtkWidget* base, gint width, gint* min_height, gint* nat_height);
gint max_size_container_get_max_size (MaxSizeContainer* self);
static void max_size_container_real_size_allocate (GtkWidget* base, GtkAllocation* alloc);
static void max_size_container_real_realize (GtkWidget* base);
static void max_size_container_real_unrealize (GtkWidget* base);
static void max_size_container_real_map (GtkWidget* base);
static void max_size_container_real_unmap (GtkWidget* base);
MaxSizeContainer* max_size_container_new (void);
MaxSizeContainer* max_size_container_construct (GType object_type);
void max_size_container_set_max_size (MaxSizeContainer* self, gint value);
static void max_size_container_finalize (GObject * obj);
static void _vala_max_size_container_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_max_size_container_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static void max_size_container_real_add (GtkContainer* base, GtkWidget* widget) {
	MaxSizeContainer * self;
	GtkWidget* _tmp0_;
	GdkWindow* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	g_return_if_fail (GTK_IS_WIDGET (widget));
	_tmp0_ = widget;
	GTK_CONTAINER_CLASS (max_size_container_parent_class)->add (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), gtk_container_get_type (), GtkContainer), _tmp0_);
	_tmp1_ = self->priv->event_window;
	if (_tmp1_ != NULL) {
		GtkWidget* _tmp2_;
		GdkWindow* _tmp3_;
		_tmp2_ = widget;
		_tmp3_ = self->priv->event_window;
		gtk_widget_set_parent_window (_tmp2_, _tmp3_);
	}
}


static GtkSizeRequestMode max_size_container_real_get_request_mode (GtkWidget* base) {
	MaxSizeContainer * self;
	GtkSizeRequestMode result = 0;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}


static void max_size_container_real_get_preferred_height_for_width (GtkWidget* base, gint width, gint* min_height, gint* nat_height) {
	MaxSizeContainer * self;
	gint _vala_min_height = 0;
	gint _vala_nat_height = 0;
	gint min_child_height = 0;
	gint nat_child_height = 0;
	GtkWidget* _tmp0_;
	gint _tmp1_;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	_tmp0_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
	_tmp1_ = width;
	gtk_widget_get_preferred_height_for_width (_tmp0_, _tmp1_, &_tmp2_, &_tmp3_);
	min_child_height = _tmp2_;
	nat_child_height = _tmp3_;
	_tmp4_ = max_size_container_get_max_size (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = min_child_height;
	if (_tmp5_ >= _tmp6_) {
		gint _tmp7_;
		gint _tmp8_;
		_tmp7_ = min_child_height;
		_vala_min_height = _tmp7_;
		_tmp8_ = nat_child_height;
		_vala_nat_height = _tmp8_;
	} else {
		gint _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		_tmp9_ = max_size_container_get_max_size (self);
		_tmp10_ = _tmp9_;
		_vala_nat_height = _tmp10_;
		_tmp11_ = max_size_container_get_max_size (self);
		_tmp12_ = _tmp11_;
		_vala_min_height = _tmp12_;
	}
	if (min_height) {
		*min_height = _vala_min_height;
	}
	if (nat_height) {
		*nat_height = _vala_nat_height;
	}
}


static void max_size_container_real_size_allocate (GtkWidget* base, GtkAllocation* alloc) {
	MaxSizeContainer * self;
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	GtkAllocation child_alloc = {0};
	GtkAllocation _tmp16_ = {0};
	GtkAllocation _tmp17_;
	gint _tmp18_;
	GtkAllocation _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	GtkAllocation _tmp23_;
	gint _tmp24_;
	GdkWindow* _tmp33_;
	GtkAllocation _tmp43_;
	gboolean _tmp44_ = FALSE;
	GtkWidget* _tmp45_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	g_return_if_fail (alloc != NULL);
	_tmp1_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		GtkWidget* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
		_tmp3_ = gtk_widget_get_visible (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = !_tmp4_;
	}
	if (_tmp0_) {
		GdkWindow* _tmp5_;
		GtkAllocation _tmp15_;
		_tmp5_ = self->priv->event_window;
		if (_tmp5_ != NULL) {
			GdkWindow* _tmp6_;
			GtkAllocation _tmp7_;
			gint _tmp8_;
			GtkAllocation _tmp9_;
			gint _tmp10_;
			GtkAllocation _tmp11_;
			gint _tmp12_;
			GtkAllocation _tmp13_;
			gint _tmp14_;
			_tmp6_ = self->priv->event_window;
			_tmp7_ = *alloc;
			_tmp8_ = _tmp7_.x;
			_tmp9_ = *alloc;
			_tmp10_ = _tmp9_.y;
			_tmp11_ = *alloc;
			_tmp12_ = _tmp11_.width;
			_tmp13_ = *alloc;
			_tmp14_ = _tmp13_.height;
			gdk_window_move_resize (_tmp6_, _tmp8_, _tmp10_, _tmp12_, _tmp14_);
		}
		_tmp15_ = *alloc;
		gtk_widget_set_allocation (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), &_tmp15_);
		return;
	}
	child_alloc = _tmp16_;
	_tmp17_ = *alloc;
	_tmp18_ = _tmp17_.x;
	child_alloc.x = _tmp18_;
	_tmp19_ = *alloc;
	_tmp20_ = _tmp19_.width;
	child_alloc.width = _tmp20_;
	_tmp21_ = max_size_container_get_max_size (self);
	_tmp22_ = _tmp21_;
	_tmp23_ = *alloc;
	_tmp24_ = _tmp23_.height;
	if (_tmp22_ >= _tmp24_) {
		GtkAllocation _tmp25_;
		gint _tmp26_;
		GtkAllocation _tmp27_;
		gint _tmp28_;
		_tmp25_ = *alloc;
		_tmp26_ = _tmp25_.y;
		child_alloc.y = _tmp26_;
		_tmp27_ = *alloc;
		_tmp28_ = _tmp27_.height;
		child_alloc.height = _tmp28_;
	} else {
		GtkAllocation _tmp29_;
		gint _tmp30_;
		gint _tmp31_;
		gint _tmp32_;
		_tmp29_ = *alloc;
		_tmp30_ = _tmp29_.y;
		child_alloc.y = _tmp30_;
		_tmp31_ = max_size_container_get_max_size (self);
		_tmp32_ = _tmp31_;
		child_alloc.height = _tmp32_;
	}
	_tmp33_ = self->priv->event_window;
	if (_tmp33_ != NULL) {
		GdkWindow* _tmp34_;
		GtkAllocation _tmp35_;
		gint _tmp36_;
		GtkAllocation _tmp37_;
		gint _tmp38_;
		GtkAllocation _tmp39_;
		gint _tmp40_;
		GtkAllocation _tmp41_;
		gint _tmp42_;
		_tmp34_ = self->priv->event_window;
		_tmp35_ = child_alloc;
		_tmp36_ = _tmp35_.x;
		_tmp37_ = child_alloc;
		_tmp38_ = _tmp37_.y;
		_tmp39_ = child_alloc;
		_tmp40_ = _tmp39_.width;
		_tmp41_ = child_alloc;
		_tmp42_ = _tmp41_.height;
		gdk_window_move_resize (_tmp34_, _tmp36_, _tmp38_, _tmp40_, _tmp42_);
	}
	_tmp43_ = child_alloc;
	gtk_widget_set_allocation (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), &_tmp43_);
	_tmp45_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
	if (_tmp45_ != NULL) {
		GtkWidget* _tmp46_;
		gboolean _tmp47_;
		gboolean _tmp48_;
		_tmp46_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
		_tmp47_ = gtk_widget_get_visible (_tmp46_);
		_tmp48_ = _tmp47_;
		_tmp44_ = _tmp48_;
	} else {
		_tmp44_ = FALSE;
	}
	if (_tmp44_) {
		gint min_height = 0;
		gint nat_height = 0;
		GtkWidget* _tmp49_;
		GtkAllocation _tmp50_;
		gint _tmp51_;
		gint _tmp52_ = 0;
		gint _tmp53_ = 0;
		GtkAllocation _tmp54_;
		gint _tmp55_;
		gint _tmp56_;
		gint _tmp57_;
		GtkWidget* _tmp58_;
		GtkAllocation _tmp59_;
		gboolean _tmp60_;
		_tmp49_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
		_tmp50_ = *alloc;
		_tmp51_ = _tmp50_.width;
		gtk_widget_get_preferred_height_for_width (_tmp49_, _tmp51_, &_tmp52_, &_tmp53_);
		min_height = _tmp52_;
		nat_height = _tmp53_;
		_tmp54_ = child_alloc;
		_tmp55_ = _tmp54_.height;
		_tmp56_ = min_height;
		_tmp57_ = MAX (_tmp55_, _tmp56_);
		child_alloc.height = _tmp57_;
		_tmp58_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
		_tmp59_ = child_alloc;
		gtk_widget_size_allocate (_tmp58_, &_tmp59_);
		_tmp60_ = gtk_widget_get_realized (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		if (_tmp60_) {
			GtkWidget* _tmp61_;
			_tmp61_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
			gtk_widget_show (_tmp61_);
		}
	}
}


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


static void max_size_container_real_realize (GtkWidget* base) {
	MaxSizeContainer * self;
	GtkAllocation alloc = {0};
	GtkAllocation _tmp0_ = {0};
	GdkWindowAttr attr = {0};
	GdkWindowAttr _tmp1_ = {0};
	GtkAllocation _tmp2_;
	gint _tmp3_;
	GtkAllocation _tmp4_;
	gint _tmp5_;
	GtkAllocation _tmp6_;
	gint _tmp7_;
	GtkAllocation _tmp8_;
	gint _tmp9_;
	GdkVisual* _tmp10_;
	gint _tmp11_;
	GdkWindowAttributesType attr_mask = 0;
	GdkWindow* window = NULL;
	GdkWindow* _tmp12_;
	GdkWindow* _tmp13_;
	GdkWindow* _tmp14_;
	GdkWindow* _tmp15_;
	GdkWindow* _tmp16_;
	GdkWindow* _tmp17_;
	GdkWindowAttr _tmp18_;
	GdkWindowAttributesType _tmp19_;
	GdkWindow* _tmp20_;
	GdkWindow* _tmp21_;
	GtkWidget* _tmp22_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	GTK_WIDGET_CLASS (max_size_container_parent_class)->realize (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), gtk_widget_get_type (), GtkWidget));
	gtk_widget_get_allocation (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), &_tmp0_);
	alloc = _tmp0_;
	attr = _tmp1_;
	_tmp2_ = alloc;
	_tmp3_ = _tmp2_.x;
	attr.x = _tmp3_;
	_tmp4_ = alloc;
	_tmp5_ = _tmp4_.y;
	attr.y = _tmp5_;
	_tmp6_ = alloc;
	_tmp7_ = _tmp6_.width;
	attr.width = _tmp7_;
	_tmp8_ = alloc;
	_tmp9_ = _tmp8_.height;
	attr.height = _tmp9_;
	attr.window_type = GDK_WINDOW_CHILD;
	_tmp10_ = gtk_widget_get_visual (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	attr.visual = _tmp10_;
	attr.wclass = GDK_INPUT_OUTPUT;
	_tmp11_ = gtk_widget_get_events (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	attr.event_mask = _tmp11_;
	attr_mask = GDK_WA_X | GDK_WA_Y;
	_tmp12_ = gtk_widget_get_parent_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp13_ = _g_object_ref0 (_tmp12_);
	window = _tmp13_;
	_tmp14_ = window;
	_tmp15_ = _g_object_ref0 (_tmp14_);
	gtk_widget_set_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp15_);
	_tmp16_ = window;
	g_object_ref (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, G_TYPE_OBJECT, GObject));
	_tmp17_ = window;
	_tmp18_ = attr;
	_tmp19_ = attr_mask;
	_tmp20_ = gdk_window_new (_tmp17_, &_tmp18_, _tmp19_);
	_g_object_unref0 (self->priv->event_window);
	self->priv->event_window = _tmp20_;
	_tmp21_ = self->priv->event_window;
	gtk_widget_register_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp21_);
	_tmp22_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
	if (_tmp22_ != NULL) {
		GtkWidget* _tmp23_;
		GdkWindow* _tmp24_;
		_tmp23_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin));
		_tmp24_ = self->priv->event_window;
		gtk_widget_set_parent_window (_tmp23_, _tmp24_);
	}
	_g_object_unref0 (window);
}


static void max_size_container_real_unrealize (GtkWidget* base) {
	MaxSizeContainer * self;
	GdkWindow* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	_tmp0_ = self->priv->event_window;
	if (_tmp0_ != NULL) {
		GdkWindow* _tmp1_;
		GdkWindow* _tmp2_;
		GdkWindow* _tmp3_;
		_tmp1_ = self->priv->event_window;
		gtk_widget_unregister_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp1_);
		_tmp2_ = self->priv->event_window;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		gdk_window_destroy (_tmp3_);
		_g_object_unref0 (self->priv->event_window);
		self->priv->event_window = NULL;
	}
	GTK_WIDGET_CLASS (max_size_container_parent_class)->unrealize (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), gtk_widget_get_type (), GtkWidget));
}


static void max_size_container_real_map (GtkWidget* base) {
	MaxSizeContainer * self;
	GdkWindow* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	GTK_WIDGET_CLASS (max_size_container_parent_class)->map (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), gtk_widget_get_type (), GtkWidget));
	_tmp0_ = self->priv->event_window;
	if (_tmp0_ != NULL) {
		GdkWindow* _tmp1_;
		_tmp1_ = self->priv->event_window;
		gdk_window_show (_tmp1_);
	}
}


static void max_size_container_real_unmap (GtkWidget* base) {
	MaxSizeContainer * self;
	GdkWindow* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	_tmp0_ = self->priv->event_window;
	if (_tmp0_ != NULL) {
		GdkWindow* _tmp1_;
		_tmp1_ = self->priv->event_window;
		gdk_window_hide (_tmp1_);
	}
	GTK_WIDGET_CLASS (max_size_container_parent_class)->unmap (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), gtk_widget_get_type (), GtkWidget));
}


MaxSizeContainer* max_size_container_construct (GType object_type) {
	MaxSizeContainer * self = NULL;
	self = (MaxSizeContainer*) g_object_new (object_type, NULL);
	return self;
}


MaxSizeContainer* max_size_container_new (void) {
	return max_size_container_construct (TYPE_MAX_SIZE_CONTAINER);
}


gint max_size_container_get_max_size (MaxSizeContainer* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (IS_MAX_SIZE_CONTAINER (self), 0);
	_tmp0_ = self->priv->_max_size;
	result = _tmp0_;
	return result;
}


void max_size_container_set_max_size (MaxSizeContainer* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (IS_MAX_SIZE_CONTAINER (self));
	_tmp0_ = value;
	self->priv->_max_size = _tmp0_;
	gtk_widget_queue_resize (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	g_object_notify ((GObject *) self, "max-size");
}


static void max_size_container_class_init (MaxSizeContainerClass * klass) {
	max_size_container_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (MaxSizeContainerPrivate));
	((GtkContainerClass *) klass)->add = (void (*) (GtkContainer *, GtkWidget*)) max_size_container_real_add;
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget *)) max_size_container_real_get_request_mode;
	((GtkWidgetClass *) klass)->get_preferred_height_for_width = (void (*) (GtkWidget *, gint, gint*, gint*)) max_size_container_real_get_preferred_height_for_width;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget *, GtkAllocation*)) max_size_container_real_size_allocate;
	((GtkWidgetClass *) klass)->realize = (void (*) (GtkWidget *)) max_size_container_real_realize;
	((GtkWidgetClass *) klass)->unrealize = (void (*) (GtkWidget *)) max_size_container_real_unrealize;
	((GtkWidgetClass *) klass)->map = (void (*) (GtkWidget *)) max_size_container_real_map;
	((GtkWidgetClass *) klass)->unmap = (void (*) (GtkWidget *)) max_size_container_real_unmap;
	G_OBJECT_CLASS (klass)->get_property = _vala_max_size_container_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_max_size_container_set_property;
	G_OBJECT_CLASS (klass)->finalize = max_size_container_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAX_SIZE_CONTAINER_MAX_SIZE, g_param_spec_int ("max-size", "max-size", "max-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void max_size_container_instance_init (MaxSizeContainer * self) {
	self->priv = MAX_SIZE_CONTAINER_GET_PRIVATE (self);
	self->priv->event_window = NULL;
	self->priv->_max_size = 0;
}


static void max_size_container_finalize (GObject * obj) {
	MaxSizeContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	_g_object_unref0 (self->priv->event_window);
	G_OBJECT_CLASS (max_size_container_parent_class)->finalize (obj);
}


GType max_size_container_get_type (void) {
	static volatile gsize max_size_container_type_id__volatile = 0;
	if (g_once_init_enter (&max_size_container_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MaxSizeContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) max_size_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MaxSizeContainer), 0, (GInstanceInitFunc) max_size_container_instance_init, NULL };
		GType max_size_container_type_id;
		max_size_container_type_id = g_type_register_static (gtk_bin_get_type (), "MaxSizeContainer", &g_define_type_info, 0);
		g_once_init_leave (&max_size_container_type_id__volatile, max_size_container_type_id);
	}
	return max_size_container_type_id__volatile;
}


static void _vala_max_size_container_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	MaxSizeContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	switch (property_id) {
		case MAX_SIZE_CONTAINER_MAX_SIZE:
		g_value_set_int (value, max_size_container_get_max_size (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_max_size_container_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	MaxSizeContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MAX_SIZE_CONTAINER, MaxSizeContainer);
	switch (property_id) {
		case MAX_SIZE_CONTAINER_MAX_SIZE:
		max_size_container_set_max_size (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



