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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <gdk/gdk.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 DINO_UI_TYPE_FIXED_RATIO_PICTURE (dino_ui_fixed_ratio_picture_get_type ())
#define DINO_UI_FIXED_RATIO_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPicture))
#define DINO_UI_FIXED_RATIO_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPictureClass))
#define DINO_UI_IS_FIXED_RATIO_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_FIXED_RATIO_PICTURE))
#define DINO_UI_IS_FIXED_RATIO_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_FIXED_RATIO_PICTURE))
#define DINO_UI_FIXED_RATIO_PICTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPictureClass))

typedef struct _DinoUiFixedRatioPicture DinoUiFixedRatioPicture;
typedef struct _DinoUiFixedRatioPictureClass DinoUiFixedRatioPictureClass;
typedef struct _DinoUiFixedRatioPicturePrivate DinoUiFixedRatioPicturePrivate;
enum  {
	DINO_UI_FIXED_RATIO_PICTURE_0_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_MIN_WIDTH_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_MAX_WIDTH_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_MIN_HEIGHT_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_MAX_HEIGHT_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_FILE_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_PAINTABLE_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_CONTENT_FIT_PROPERTY,
	DINO_UI_FIXED_RATIO_PICTURE_NUM_PROPERTIES
};
static GParamSpec* dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _DinoUiFixedRatioPicture {
	GtkWidget parent_instance;
	DinoUiFixedRatioPicturePrivate * priv;
};

struct _DinoUiFixedRatioPictureClass {
	GtkWidgetClass parent_class;
};

struct _DinoUiFixedRatioPicturePrivate {
	gint _min_width;
	gint _max_width;
	gint _min_height;
	gint _max_height;
	GtkPicture* inner;
};

static gint DinoUiFixedRatioPicture_private_offset;
static gpointer dino_ui_fixed_ratio_picture_parent_class = NULL;

VALA_EXTERN GType dino_ui_fixed_ratio_picture_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiFixedRatioPicture, g_object_unref)
static void dino_ui_fixed_ratio_picture_measure_target_size (DinoUiFixedRatioPicture* self,
                                                      gint* width,
                                                      gint* height);
VALA_EXTERN gint dino_ui_fixed_ratio_picture_get_min_width (DinoUiFixedRatioPicture* self);
VALA_EXTERN gint dino_ui_fixed_ratio_picture_get_min_height (DinoUiFixedRatioPicture* self);
VALA_EXTERN gint dino_ui_fixed_ratio_picture_get_max_width (DinoUiFixedRatioPicture* self);
VALA_EXTERN gint dino_ui_fixed_ratio_picture_get_max_height (DinoUiFixedRatioPicture* self);
static void dino_ui_fixed_ratio_picture_real_measure (GtkWidget* base,
                                               GtkOrientation orientation,
                                               gint for_size,
                                               gint* minimum,
                                               gint* natural,
                                               gint* minimum_baseline,
                                               gint* natural_baseline);
static void dino_ui_fixed_ratio_picture_real_size_allocate (GtkWidget* base,
                                                     gint width,
                                                     gint height,
                                                     gint baseline);
static GtkSizeRequestMode dino_ui_fixed_ratio_picture_real_get_request_mode (GtkWidget* base);
static void dino_ui_fixed_ratio_picture_real_dispose (GObject* base);
VALA_EXTERN DinoUiFixedRatioPicture* dino_ui_fixed_ratio_picture_new (void);
VALA_EXTERN DinoUiFixedRatioPicture* dino_ui_fixed_ratio_picture_construct (GType object_type);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_min_width (DinoUiFixedRatioPicture* self,
                                                gint value);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_max_width (DinoUiFixedRatioPicture* self,
                                                gint value);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_min_height (DinoUiFixedRatioPicture* self,
                                                 gint value);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_max_height (DinoUiFixedRatioPicture* self,
                                                 gint value);
VALA_EXTERN GFile* dino_ui_fixed_ratio_picture_get_file (DinoUiFixedRatioPicture* self);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_file (DinoUiFixedRatioPicture* self,
                                           GFile* value);
VALA_EXTERN GdkPaintable* dino_ui_fixed_ratio_picture_get_paintable (DinoUiFixedRatioPicture* self);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_paintable (DinoUiFixedRatioPicture* self,
                                                GdkPaintable* value);
VALA_EXTERN GtkContentFit dino_ui_fixed_ratio_picture_get_content_fit (DinoUiFixedRatioPicture* self);
VALA_EXTERN void dino_ui_fixed_ratio_picture_set_content_fit (DinoUiFixedRatioPicture* self,
                                                  GtkContentFit value);
static GObject * dino_ui_fixed_ratio_picture_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _gtk_widget_queue_resize_g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self);
static void dino_ui_fixed_ratio_picture_finalize (GObject * obj);
static GType dino_ui_fixed_ratio_picture_get_type_once (void);
static void _vala_dino_ui_fixed_ratio_picture_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_dino_ui_fixed_ratio_picture_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_fixed_ratio_picture_get_instance_private (DinoUiFixedRatioPicture* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiFixedRatioPicture_private_offset);
}

static void
dino_ui_fixed_ratio_picture_measure_target_size (DinoUiFixedRatioPicture* self,
                                                 gint* width,
                                                 gint* height)
{
	gint _vala_width = 0;
	gint _vala_height = 0;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp9_;
	gint _tmp10_;
	GtkPicture* _tmp11_;
	gint _tmp17_;
	GtkPicture* _tmp18_;
	gint _tmp24_;
	g_return_if_fail (self != NULL);
	g_object_get ((GtkWidget*) self, "width-request", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != -1) {
		gint _tmp3_;
		gint _tmp4_;
		g_object_get ((GtkWidget*) self, "height-request", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ != -1;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		g_object_get ((GtkWidget*) self, "width-request", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		_vala_width = _tmp6_;
		g_object_get ((GtkWidget*) self, "height-request", &_tmp7_, NULL);
		_tmp8_ = _tmp7_;
		_vala_height = _tmp8_;
		if (width) {
			*width = _vala_width;
		}
		if (height) {
			*height = _vala_height;
		}
		return;
	}
	_tmp9_ = self->priv->_min_width;
	_vala_width = _tmp9_;
	_tmp10_ = self->priv->_min_height;
	_vala_height = _tmp10_;
	_tmp11_ = self->priv->inner;
	if (gtk_widget_should_layout ((GtkWidget*) _tmp11_)) {
		gint child_min = 0;
		gint child_nat = 0;
		gint child_min_baseline = 0;
		gint child_nat_baseline = 0;
		GtkPicture* _tmp12_;
		gint _tmp13_ = 0;
		gint _tmp14_ = 0;
		gint _tmp15_ = 0;
		gint _tmp16_ = 0;
		child_min = 0;
		child_nat = 0;
		child_min_baseline = -1;
		child_nat_baseline = -1;
		_tmp12_ = self->priv->inner;
		gtk_widget_measure ((GtkWidget*) _tmp12_, GTK_ORIENTATION_HORIZONTAL, -1, &_tmp13_, &_tmp14_, &_tmp15_, &_tmp16_);
		child_min = _tmp13_;
		child_nat = _tmp14_;
		child_min_baseline = _tmp15_;
		child_nat_baseline = _tmp16_;
		_vala_width = MAX (child_nat, _vala_width);
	}
	_tmp17_ = self->priv->_max_width;
	_vala_width = MIN (_vala_width, _tmp17_);
	_tmp18_ = self->priv->inner;
	if (gtk_widget_should_layout ((GtkWidget*) _tmp18_)) {
		gint child_min = 0;
		gint child_nat = 0;
		gint child_min_baseline = 0;
		gint child_nat_baseline = 0;
		GtkPicture* _tmp19_;
		gint _tmp20_ = 0;
		gint _tmp21_ = 0;
		gint _tmp22_ = 0;
		gint _tmp23_ = 0;
		child_min = 0;
		child_nat = 0;
		child_min_baseline = -1;
		child_nat_baseline = -1;
		_tmp19_ = self->priv->inner;
		gtk_widget_measure ((GtkWidget*) _tmp19_, GTK_ORIENTATION_VERTICAL, _vala_width, &_tmp20_, &_tmp21_, &_tmp22_, &_tmp23_);
		child_min = _tmp20_;
		child_nat = _tmp21_;
		child_min_baseline = _tmp22_;
		child_nat_baseline = _tmp23_;
		_vala_height = MAX (child_nat, _vala_height);
	}
	_tmp24_ = self->priv->_max_height;
	if (_vala_height > _tmp24_) {
		gint _tmp25_;
		gint _tmp26_;
		GtkPicture* _tmp27_;
		gint _tmp34_;
		_tmp25_ = self->priv->_max_height;
		_vala_height = _tmp25_;
		_tmp26_ = self->priv->_min_width;
		_vala_width = _tmp26_;
		_tmp27_ = self->priv->inner;
		if (gtk_widget_should_layout ((GtkWidget*) _tmp27_)) {
			gint child_min = 0;
			gint child_nat = 0;
			gint child_min_baseline = 0;
			gint child_nat_baseline = 0;
			GtkPicture* _tmp28_;
			gint _tmp29_;
			gint _tmp30_ = 0;
			gint _tmp31_ = 0;
			gint _tmp32_ = 0;
			gint _tmp33_ = 0;
			child_min = 0;
			child_nat = 0;
			child_min_baseline = -1;
			child_nat_baseline = -1;
			_tmp28_ = self->priv->inner;
			_tmp29_ = self->priv->_max_height;
			gtk_widget_measure ((GtkWidget*) _tmp28_, GTK_ORIENTATION_HORIZONTAL, _tmp29_, &_tmp30_, &_tmp31_, &_tmp32_, &_tmp33_);
			child_min = _tmp30_;
			child_nat = _tmp31_;
			child_min_baseline = _tmp32_;
			child_nat_baseline = _tmp33_;
			_vala_width = MAX (child_nat, _vala_width);
		}
		_tmp34_ = self->priv->_max_width;
		_vala_width = MIN (_vala_width, _tmp34_);
	}
	if (width) {
		*width = _vala_width;
	}
	if (height) {
		*height = _vala_height;
	}
}

static void
dino_ui_fixed_ratio_picture_real_measure (GtkWidget* base,
                                          GtkOrientation orientation,
                                          gint for_size,
                                          gint* minimum,
                                          gint* natural,
                                          gint* minimum_baseline,
                                          gint* natural_baseline)
{
	DinoUiFixedRatioPicture * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	gint width = 0;
	gint height = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	self = (DinoUiFixedRatioPicture*) base;
	_vala_minimum_baseline = -1;
	_vala_natural_baseline = -1;
	dino_ui_fixed_ratio_picture_measure_target_size (self, &_tmp0_, &_tmp1_);
	width = _tmp0_;
	height = _tmp1_;
	if (orientation == GTK_ORIENTATION_HORIZONTAL) {
		gint _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		_tmp2_ = self->priv->_min_width;
		_vala_minimum = _tmp2_;
		_tmp3_ = self->priv->_min_width;
		_tmp4_ = self->priv->_max_width;
		_vala_natural = MAX (_tmp3_, MIN (width, _tmp4_));
	} else {
		if (for_size == -1) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			_tmp5_ = self->priv->_min_height;
			_vala_minimum = _tmp5_;
			_tmp6_ = self->priv->_min_height;
			_tmp7_ = self->priv->_max_height;
			_vala_natural = MAX (_tmp6_, MIN (height, _tmp7_));
		} else {
			gint _tmp8_;
			_tmp8_ = self->priv->_min_height;
			_vala_natural = MAX (_tmp8_, MIN ((height * for_size) / width, height));
			_vala_minimum = _vala_natural;
		}
	}
	if (minimum) {
		*minimum = _vala_minimum;
	}
	if (natural) {
		*natural = _vala_natural;
	}
	if (minimum_baseline) {
		*minimum_baseline = _vala_minimum_baseline;
	}
	if (natural_baseline) {
		*natural_baseline = _vala_natural_baseline;
	}
}

static void
dino_ui_fixed_ratio_picture_real_size_allocate (GtkWidget* base,
                                                gint width,
                                                gint height,
                                                gint baseline)
{
	DinoUiFixedRatioPicture * self;
	GtkPicture* _tmp0_;
	self = (DinoUiFixedRatioPicture*) base;
	_tmp0_ = self->priv->inner;
	if (gtk_widget_should_layout ((GtkWidget*) _tmp0_)) {
		GtkPicture* _tmp1_;
		_tmp1_ = self->priv->inner;
		gtk_widget_allocate ((GtkWidget*) _tmp1_, width, height, baseline, NULL);
	}
}

static GtkSizeRequestMode
dino_ui_fixed_ratio_picture_real_get_request_mode (GtkWidget* base)
{
	DinoUiFixedRatioPicture * self;
	GtkSizeRequestMode result;
	self = (DinoUiFixedRatioPicture*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}

static void
dino_ui_fixed_ratio_picture_real_dispose (GObject* base)
{
	DinoUiFixedRatioPicture * self;
	GtkPicture* _tmp0_;
	self = (DinoUiFixedRatioPicture*) base;
	_tmp0_ = self->priv->inner;
	gtk_widget_unparent ((GtkWidget*) _tmp0_);
	G_OBJECT_CLASS (dino_ui_fixed_ratio_picture_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

DinoUiFixedRatioPicture*
dino_ui_fixed_ratio_picture_construct (GType object_type)
{
	DinoUiFixedRatioPicture * self = NULL;
	self = (DinoUiFixedRatioPicture*) g_object_new (object_type, NULL);
	return self;
}

DinoUiFixedRatioPicture*
dino_ui_fixed_ratio_picture_new (void)
{
	return dino_ui_fixed_ratio_picture_construct (DINO_UI_TYPE_FIXED_RATIO_PICTURE);
}

gint
dino_ui_fixed_ratio_picture_get_min_width (DinoUiFixedRatioPicture* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_min_width;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_min_width (DinoUiFixedRatioPicture* self,
                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_fixed_ratio_picture_get_min_width (self);
	if (old_value != value) {
		self->priv->_min_width = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MIN_WIDTH_PROPERTY]);
	}
}

gint
dino_ui_fixed_ratio_picture_get_max_width (DinoUiFixedRatioPicture* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_max_width;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_max_width (DinoUiFixedRatioPicture* self,
                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_fixed_ratio_picture_get_max_width (self);
	if (old_value != value) {
		self->priv->_max_width = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MAX_WIDTH_PROPERTY]);
	}
}

gint
dino_ui_fixed_ratio_picture_get_min_height (DinoUiFixedRatioPicture* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_min_height;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_min_height (DinoUiFixedRatioPicture* self,
                                            gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_fixed_ratio_picture_get_min_height (self);
	if (old_value != value) {
		self->priv->_min_height = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MIN_HEIGHT_PROPERTY]);
	}
}

gint
dino_ui_fixed_ratio_picture_get_max_height (DinoUiFixedRatioPicture* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_max_height;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_max_height (DinoUiFixedRatioPicture* self,
                                            gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_fixed_ratio_picture_get_max_height (self);
	if (old_value != value) {
		self->priv->_max_height = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MAX_HEIGHT_PROPERTY]);
	}
}

GFile*
dino_ui_fixed_ratio_picture_get_file (DinoUiFixedRatioPicture* self)
{
	GFile* result;
	GtkPicture* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->inner;
	_tmp1_ = gtk_picture_get_file (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_file (DinoUiFixedRatioPicture* self,
                                      GFile* value)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->inner;
	gtk_picture_set_file (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_FILE_PROPERTY]);
}

GdkPaintable*
dino_ui_fixed_ratio_picture_get_paintable (DinoUiFixedRatioPicture* self)
{
	GdkPaintable* result;
	GtkPicture* _tmp0_;
	GdkPaintable* _tmp1_;
	GdkPaintable* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->inner;
	_tmp1_ = gtk_picture_get_paintable (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_paintable (DinoUiFixedRatioPicture* self,
                                           GdkPaintable* value)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->inner;
	gtk_picture_set_paintable (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_PAINTABLE_PROPERTY]);
}

GtkContentFit
dino_ui_fixed_ratio_picture_get_content_fit (DinoUiFixedRatioPicture* self)
{
	GtkContentFit result;
	GtkPicture* _tmp0_;
	GtkContentFit _tmp1_;
	GtkContentFit _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->inner;
	_tmp1_ = gtk_picture_get_content_fit (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
dino_ui_fixed_ratio_picture_set_content_fit (DinoUiFixedRatioPicture* self,
                                             GtkContentFit value)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->inner;
	gtk_picture_set_content_fit (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_CONTENT_FIT_PROPERTY]);
}

static void
_gtk_widget_queue_resize_g_object_notify (GObject* _sender,
                                          GParamSpec* pspec,
                                          gpointer self)
{
	gtk_widget_queue_resize ((GtkWidget*) self);
}

static GObject *
dino_ui_fixed_ratio_picture_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiFixedRatioPicture * self;
	GtkPicture* _tmp0_;
	parent_class = G_OBJECT_CLASS (dino_ui_fixed_ratio_picture_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPicture);
	gtk_widget_class_set_css_name (G_TYPE_INSTANCE_GET_CLASS (self, gtk_widget_get_type (), GtkWidgetClass), "picture");
	gtk_widget_add_css_class ((GtkWidget*) self, "fixed-ratio");
	_tmp0_ = self->priv->inner;
	gtk_widget_insert_after ((GtkWidget*) _tmp0_, (GtkWidget*) self, NULL);
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _gtk_widget_queue_resize_g_object_notify, (GtkWidget*) self, 0);
	return obj;
}

static void
dino_ui_fixed_ratio_picture_class_init (DinoUiFixedRatioPictureClass * klass,
                                        gpointer klass_data)
{
	dino_ui_fixed_ratio_picture_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiFixedRatioPicture_private_offset);
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) dino_ui_fixed_ratio_picture_real_measure;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) dino_ui_fixed_ratio_picture_real_size_allocate;
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) dino_ui_fixed_ratio_picture_real_get_request_mode;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dino_ui_fixed_ratio_picture_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_fixed_ratio_picture_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_fixed_ratio_picture_set_property;
	G_OBJECT_CLASS (klass)->constructor = dino_ui_fixed_ratio_picture_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_fixed_ratio_picture_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_MIN_WIDTH_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MIN_WIDTH_PROPERTY] = g_param_spec_int ("min-width", "min-width", "min-width", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_MAX_WIDTH_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MAX_WIDTH_PROPERTY] = g_param_spec_int ("max-width", "max-width", "max-width", G_MININT, G_MAXINT, G_MAXINT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_MIN_HEIGHT_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MIN_HEIGHT_PROPERTY] = g_param_spec_int ("min-height", "min-height", "min-height", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_MAX_HEIGHT_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_MAX_HEIGHT_PROPERTY] = g_param_spec_int ("max-height", "max-height", "max-height", G_MININT, G_MAXINT, G_MAXINT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_FILE_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_FILE_PROPERTY] = g_param_spec_object ("file", "file", "file", g_file_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_PAINTABLE_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_PAINTABLE_PROPERTY] = g_param_spec_object ("paintable", "paintable", "paintable", gdk_paintable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_FIXED_RATIO_PICTURE_CONTENT_FIT_PROPERTY, dino_ui_fixed_ratio_picture_properties[DINO_UI_FIXED_RATIO_PICTURE_CONTENT_FIT_PROPERTY] = g_param_spec_enum ("content-fit", "content-fit", "content-fit", gtk_content_fit_get_type (), 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_fixed_ratio_picture_instance_init (DinoUiFixedRatioPicture * self,
                                           gpointer klass)
{
	GtkPicture* _tmp0_;
	self->priv = dino_ui_fixed_ratio_picture_get_instance_private (self);
	self->priv->_min_width = -1;
	self->priv->_max_width = G_MAXINT;
	self->priv->_min_height = -1;
	self->priv->_max_height = G_MAXINT;
	_tmp0_ = (GtkPicture*) gtk_picture_new ();
	g_object_ref_sink (_tmp0_);
	self->priv->inner = _tmp0_;
}

static void
dino_ui_fixed_ratio_picture_finalize (GObject * obj)
{
	DinoUiFixedRatioPicture * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPicture);
	_g_object_unref0 (self->priv->inner);
	G_OBJECT_CLASS (dino_ui_fixed_ratio_picture_parent_class)->finalize (obj);
}

static GType
dino_ui_fixed_ratio_picture_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiFixedRatioPictureClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_fixed_ratio_picture_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiFixedRatioPicture), 0, (GInstanceInitFunc) dino_ui_fixed_ratio_picture_instance_init, NULL };
	GType dino_ui_fixed_ratio_picture_type_id;
	dino_ui_fixed_ratio_picture_type_id = g_type_register_static (gtk_widget_get_type (), "DinoUiFixedRatioPicture", &g_define_type_info, 0);
	DinoUiFixedRatioPicture_private_offset = g_type_add_instance_private (dino_ui_fixed_ratio_picture_type_id, sizeof (DinoUiFixedRatioPicturePrivate));
	return dino_ui_fixed_ratio_picture_type_id;
}

GType
dino_ui_fixed_ratio_picture_get_type (void)
{
	static volatile gsize dino_ui_fixed_ratio_picture_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_fixed_ratio_picture_type_id__once)) {
		GType dino_ui_fixed_ratio_picture_type_id;
		dino_ui_fixed_ratio_picture_type_id = dino_ui_fixed_ratio_picture_get_type_once ();
		g_once_init_leave (&dino_ui_fixed_ratio_picture_type_id__once, dino_ui_fixed_ratio_picture_type_id);
	}
	return dino_ui_fixed_ratio_picture_type_id__once;
}

static void
_vala_dino_ui_fixed_ratio_picture_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	DinoUiFixedRatioPicture * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPicture);
	switch (property_id) {
		case DINO_UI_FIXED_RATIO_PICTURE_MIN_WIDTH_PROPERTY:
		g_value_set_int (value, dino_ui_fixed_ratio_picture_get_min_width (self));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_MAX_WIDTH_PROPERTY:
		g_value_set_int (value, dino_ui_fixed_ratio_picture_get_max_width (self));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_MIN_HEIGHT_PROPERTY:
		g_value_set_int (value, dino_ui_fixed_ratio_picture_get_min_height (self));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_MAX_HEIGHT_PROPERTY:
		g_value_set_int (value, dino_ui_fixed_ratio_picture_get_max_height (self));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_FILE_PROPERTY:
		g_value_set_object (value, dino_ui_fixed_ratio_picture_get_file (self));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_PAINTABLE_PROPERTY:
		g_value_set_object (value, dino_ui_fixed_ratio_picture_get_paintable (self));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_CONTENT_FIT_PROPERTY:
		g_value_set_enum (value, dino_ui_fixed_ratio_picture_get_content_fit (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_fixed_ratio_picture_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	DinoUiFixedRatioPicture * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_FIXED_RATIO_PICTURE, DinoUiFixedRatioPicture);
	switch (property_id) {
		case DINO_UI_FIXED_RATIO_PICTURE_MIN_WIDTH_PROPERTY:
		dino_ui_fixed_ratio_picture_set_min_width (self, g_value_get_int (value));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_MAX_WIDTH_PROPERTY:
		dino_ui_fixed_ratio_picture_set_max_width (self, g_value_get_int (value));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_MIN_HEIGHT_PROPERTY:
		dino_ui_fixed_ratio_picture_set_min_height (self, g_value_get_int (value));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_MAX_HEIGHT_PROPERTY:
		dino_ui_fixed_ratio_picture_set_max_height (self, g_value_get_int (value));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_FILE_PROPERTY:
		dino_ui_fixed_ratio_picture_set_file (self, g_value_get_object (value));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_PAINTABLE_PROPERTY:
		dino_ui_fixed_ratio_picture_set_paintable (self, g_value_get_object (value));
		break;
		case DINO_UI_FIXED_RATIO_PICTURE_CONTENT_FIT_PROPERTY:
		dino_ui_fixed_ratio_picture_set_content_fit (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

