/* reorder-pages-dialog.c generated by valac 0.56.19, the Vala compiler
 * generated from reorder-pages-dialog.vala, do not modify */

/*
 * Copyright (C) 2023 Bartłomiej Maryńczak
 * Author: Bartłomiej Maryńczak <marynczakbartlomiej@gmail.com>,
 *
 * This program 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. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.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 TYPE_REORDER_PAGES_ITEM (reorder_pages_item_get_type ())
#define REORDER_PAGES_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_REORDER_PAGES_ITEM, ReorderPagesItem))
#define REORDER_PAGES_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_REORDER_PAGES_ITEM, ReorderPagesItemClass))
#define IS_REORDER_PAGES_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_REORDER_PAGES_ITEM))
#define IS_REORDER_PAGES_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_REORDER_PAGES_ITEM))
#define REORDER_PAGES_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_REORDER_PAGES_ITEM, ReorderPagesItemClass))

typedef struct _ReorderPagesItem ReorderPagesItem;
typedef struct _ReorderPagesItemClass ReorderPagesItemClass;
typedef struct _ReorderPagesItemPrivate ReorderPagesItemPrivate;
enum  {
	REORDER_PAGES_ITEM_0_PROPERTY,
	REORDER_PAGES_ITEM_LABEL_PROPERTY,
	REORDER_PAGES_ITEM_BEFORE_PROPERTY,
	REORDER_PAGES_ITEM_AFTER_PROPERTY,
	REORDER_PAGES_ITEM_NUM_PROPERTIES
};
static GParamSpec* reorder_pages_item_properties[REORDER_PAGES_ITEM_NUM_PROPERTIES];

#define TYPE_REORDER_PAGES_DIALOG (reorder_pages_dialog_get_type ())
#define REORDER_PAGES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_REORDER_PAGES_DIALOG, ReorderPagesDialog))
#define REORDER_PAGES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_REORDER_PAGES_DIALOG, ReorderPagesDialogClass))
#define IS_REORDER_PAGES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_REORDER_PAGES_DIALOG))
#define IS_REORDER_PAGES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_REORDER_PAGES_DIALOG))
#define REORDER_PAGES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_REORDER_PAGES_DIALOG, ReorderPagesDialogClass))

typedef struct _ReorderPagesDialog ReorderPagesDialog;
typedef struct _ReorderPagesDialogClass ReorderPagesDialogClass;
typedef struct _ReorderPagesDialogPrivate ReorderPagesDialogPrivate;
enum  {
	REORDER_PAGES_DIALOG_0_PROPERTY,
	REORDER_PAGES_DIALOG_NUM_PROPERTIES
};
static GParamSpec* reorder_pages_dialog_properties[REORDER_PAGES_DIALOG_NUM_PROPERTIES];

struct _ReorderPagesItem {
	GtkButton parent_instance;
	ReorderPagesItemPrivate * priv;
};

struct _ReorderPagesItemClass {
	GtkButtonClass parent_class;
};

struct _ReorderPagesItemPrivate {
	GtkLabel* title;
	GtkImage* before_image;
	GtkImage* after_image;
};

struct _ReorderPagesDialog {
	GtkWindow parent_instance;
	ReorderPagesDialogPrivate * priv;
	ReorderPagesItem* combine_sides;
	ReorderPagesItem* combine_sides_rev;
	ReorderPagesItem* flip_odd;
	ReorderPagesItem* flip_even;
	ReorderPagesItem* reverse;
};

struct _ReorderPagesDialogClass {
	GtkWindowClass parent_class;
};

static gint ReorderPagesItem_private_offset;
static gpointer reorder_pages_item_parent_class = NULL;
static gpointer reorder_pages_dialog_parent_class = NULL;

VALA_EXTERN GType reorder_pages_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ReorderPagesItem, g_object_unref)
VALA_EXTERN ReorderPagesItem* reorder_pages_item_new (void);
VALA_EXTERN ReorderPagesItem* reorder_pages_item_construct (GType object_type);
VALA_EXTERN const gchar* reorder_pages_item_get_label (ReorderPagesItem* self);
VALA_EXTERN void reorder_pages_item_set_label (ReorderPagesItem* self,
                                   const gchar* value);
VALA_EXTERN const gchar* reorder_pages_item_get_before (ReorderPagesItem* self);
VALA_EXTERN void reorder_pages_item_set_before (ReorderPagesItem* self,
                                    const gchar* value);
VALA_EXTERN const gchar* reorder_pages_item_get_after (ReorderPagesItem* self);
VALA_EXTERN void reorder_pages_item_set_after (ReorderPagesItem* self,
                                   const gchar* value);
static void reorder_pages_item_finalize (GObject * obj);
static GType reorder_pages_item_get_type_once (void);
static void _vala_reorder_pages_item_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_reorder_pages_item_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
VALA_EXTERN GType reorder_pages_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ReorderPagesDialog, g_object_unref)
VALA_EXTERN ReorderPagesDialog* reorder_pages_dialog_new (void);
VALA_EXTERN ReorderPagesDialog* reorder_pages_dialog_construct (GType object_type);
static void reorder_pages_dialog_finalize (GObject * obj);
static GType reorder_pages_dialog_get_type_once (void);

static inline gpointer
reorder_pages_item_get_instance_private (ReorderPagesItem* self)
{
	return G_STRUCT_MEMBER_P (self, ReorderPagesItem_private_offset);
}

ReorderPagesItem*
reorder_pages_item_construct (GType object_type)
{
	ReorderPagesItem * self = NULL;
	self = (ReorderPagesItem*) g_object_new (object_type, NULL);
	return self;
}

ReorderPagesItem*
reorder_pages_item_new (void)
{
	return reorder_pages_item_construct (TYPE_REORDER_PAGES_ITEM);
}

const gchar*
reorder_pages_item_get_label (ReorderPagesItem* self)
{
	const gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->title;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
reorder_pages_item_set_label (ReorderPagesItem* self,
                              const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title;
	gtk_label_set_label (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, reorder_pages_item_properties[REORDER_PAGES_ITEM_LABEL_PROPERTY]);
}

const gchar*
reorder_pages_item_get_before (ReorderPagesItem* self)
{
	const gchar* result;
	GtkImage* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->before_image;
	_tmp1_ = gtk_image_get_icon_name (_tmp0_);
	result = _tmp1_;
	return result;
}

void
reorder_pages_item_set_before (ReorderPagesItem* self,
                               const gchar* value)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->before_image;
	g_object_set (_tmp0_, "icon-name", value, NULL);
	g_object_notify_by_pspec ((GObject *) self, reorder_pages_item_properties[REORDER_PAGES_ITEM_BEFORE_PROPERTY]);
}

const gchar*
reorder_pages_item_get_after (ReorderPagesItem* self)
{
	const gchar* result;
	GtkImage* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->after_image;
	_tmp1_ = gtk_image_get_icon_name (_tmp0_);
	result = _tmp1_;
	return result;
}

void
reorder_pages_item_set_after (ReorderPagesItem* self,
                              const gchar* value)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->after_image;
	g_object_set (_tmp0_, "icon-name", value, NULL);
	g_object_notify_by_pspec ((GObject *) self, reorder_pages_item_properties[REORDER_PAGES_ITEM_AFTER_PROPERTY]);
}

static void
reorder_pages_item_class_init (ReorderPagesItemClass * klass,
                               gpointer klass_data)
{
	reorder_pages_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ReorderPagesItem_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_reorder_pages_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_reorder_pages_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = reorder_pages_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), REORDER_PAGES_ITEM_LABEL_PROPERTY, reorder_pages_item_properties[REORDER_PAGES_ITEM_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), REORDER_PAGES_ITEM_BEFORE_PROPERTY, reorder_pages_item_properties[REORDER_PAGES_ITEM_BEFORE_PROPERTY] = g_param_spec_string ("before", "before", "before", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), REORDER_PAGES_ITEM_AFTER_PROPERTY, reorder_pages_item_properties[REORDER_PAGES_ITEM_AFTER_PROPERTY] = g_param_spec_string ("after", "after", "after", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/SimpleScan/ui/reorder-pages-item.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, ReorderPagesItem_private_offset + G_STRUCT_OFFSET (ReorderPagesItemPrivate, title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "before_image", FALSE, ReorderPagesItem_private_offset + G_STRUCT_OFFSET (ReorderPagesItemPrivate, before_image));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "after_image", FALSE, ReorderPagesItem_private_offset + G_STRUCT_OFFSET (ReorderPagesItemPrivate, after_image));
}

static void
reorder_pages_item_instance_init (ReorderPagesItem * self,
                                  gpointer klass)
{
	self->priv = reorder_pages_item_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
reorder_pages_item_finalize (GObject * obj)
{
	ReorderPagesItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_REORDER_PAGES_ITEM, ReorderPagesItem);
	G_OBJECT_CLASS (reorder_pages_item_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
reorder_pages_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ReorderPagesItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) reorder_pages_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ReorderPagesItem), 0, (GInstanceInitFunc) reorder_pages_item_instance_init, NULL };
	GType reorder_pages_item_type_id;
	reorder_pages_item_type_id = g_type_register_static (gtk_button_get_type (), "ReorderPagesItem", &g_define_type_info, G_TYPE_FLAG_NONE);
	ReorderPagesItem_private_offset = g_type_add_instance_private (reorder_pages_item_type_id, sizeof (ReorderPagesItemPrivate));
	return reorder_pages_item_type_id;
}

GType
reorder_pages_item_get_type (void)
{
	static gsize reorder_pages_item_type_id__once = 0;
	if (g_once_init_enter (&reorder_pages_item_type_id__once)) {
		GType reorder_pages_item_type_id;
		reorder_pages_item_type_id = reorder_pages_item_get_type_once ();
		g_once_init_leave (&reorder_pages_item_type_id__once, reorder_pages_item_type_id);
	}
	return reorder_pages_item_type_id__once;
}

static void
_vala_reorder_pages_item_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	ReorderPagesItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_REORDER_PAGES_ITEM, ReorderPagesItem);
	switch (property_id) {
		case REORDER_PAGES_ITEM_LABEL_PROPERTY:
		g_value_set_string (value, reorder_pages_item_get_label (self));
		break;
		case REORDER_PAGES_ITEM_BEFORE_PROPERTY:
		g_value_set_string (value, reorder_pages_item_get_before (self));
		break;
		case REORDER_PAGES_ITEM_AFTER_PROPERTY:
		g_value_set_string (value, reorder_pages_item_get_after (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_reorder_pages_item_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	ReorderPagesItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_REORDER_PAGES_ITEM, ReorderPagesItem);
	switch (property_id) {
		case REORDER_PAGES_ITEM_LABEL_PROPERTY:
		reorder_pages_item_set_label (self, g_value_get_string (value));
		break;
		case REORDER_PAGES_ITEM_BEFORE_PROPERTY:
		reorder_pages_item_set_before (self, g_value_get_string (value));
		break;
		case REORDER_PAGES_ITEM_AFTER_PROPERTY:
		reorder_pages_item_set_after (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

ReorderPagesDialog*
reorder_pages_dialog_construct (GType object_type)
{
	ReorderPagesDialog * self = NULL;
	self = (ReorderPagesDialog*) g_object_new (object_type, NULL);
	gtk_widget_class_add_binding_action (G_TYPE_INSTANCE_GET_CLASS (self, gtk_widget_get_type (), GtkWidgetClass), GDK_KEY_Escape, 0, "window.close", NULL, NULL);
	return self;
}

ReorderPagesDialog*
reorder_pages_dialog_new (void)
{
	return reorder_pages_dialog_construct (TYPE_REORDER_PAGES_DIALOG);
}

static void
reorder_pages_dialog_class_init (ReorderPagesDialogClass * klass,
                                 gpointer klass_data)
{
	reorder_pages_dialog_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = reorder_pages_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/SimpleScan/ui/reorder-pages-dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "combine_sides", FALSE, G_STRUCT_OFFSET (ReorderPagesDialog, combine_sides));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "combine_sides_rev", FALSE, G_STRUCT_OFFSET (ReorderPagesDialog, combine_sides_rev));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "flip_odd", FALSE, G_STRUCT_OFFSET (ReorderPagesDialog, flip_odd));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "flip_even", FALSE, G_STRUCT_OFFSET (ReorderPagesDialog, flip_even));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reverse", FALSE, G_STRUCT_OFFSET (ReorderPagesDialog, reverse));
}

static void
reorder_pages_dialog_instance_init (ReorderPagesDialog * self,
                                    gpointer klass)
{
	g_type_ensure (TYPE_REORDER_PAGES_ITEM);
	g_type_ensure (TYPE_REORDER_PAGES_ITEM);
	g_type_ensure (TYPE_REORDER_PAGES_ITEM);
	g_type_ensure (TYPE_REORDER_PAGES_ITEM);
	g_type_ensure (TYPE_REORDER_PAGES_ITEM);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
reorder_pages_dialog_finalize (GObject * obj)
{
	ReorderPagesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_REORDER_PAGES_DIALOG, ReorderPagesDialog);
	G_OBJECT_CLASS (reorder_pages_dialog_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
reorder_pages_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ReorderPagesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) reorder_pages_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ReorderPagesDialog), 0, (GInstanceInitFunc) reorder_pages_dialog_instance_init, NULL };
	GType reorder_pages_dialog_type_id;
	reorder_pages_dialog_type_id = g_type_register_static (gtk_window_get_type (), "ReorderPagesDialog", &g_define_type_info, G_TYPE_FLAG_NONE);
	return reorder_pages_dialog_type_id;
}

GType
reorder_pages_dialog_get_type (void)
{
	static gsize reorder_pages_dialog_type_id__once = 0;
	if (g_once_init_enter (&reorder_pages_dialog_type_id__once)) {
		GType reorder_pages_dialog_type_id;
		reorder_pages_dialog_type_id = reorder_pages_dialog_get_type_once ();
		g_once_init_leave (&reorder_pages_dialog_type_id__once, reorder_pages_dialog_type_id);
	}
	return reorder_pages_dialog_type_id__once;
}

