/* Window.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from Window.vala, do not modify */

/*
 * Copyright 2024 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 <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 GALA_DAEMON_TYPE_WINDOW (gala_daemon_window_get_type ())
#define GALA_DAEMON_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindow))
#define GALA_DAEMON_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindowClass))
#define GALA_DAEMON_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_WINDOW))
#define GALA_DAEMON_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_WINDOW))
#define GALA_DAEMON_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindowClass))

typedef struct _GalaDaemonWindow GalaDaemonWindow;
typedef struct _GalaDaemonWindowClass GalaDaemonWindowClass;
typedef struct _GalaDaemonWindowPrivate GalaDaemonWindowPrivate;
enum  {
	GALA_DAEMON_WINDOW_0_PROPERTY,
	GALA_DAEMON_WINDOW_WIDTH_PROPERTY,
	GALA_DAEMON_WINDOW_HEIGHT_PROPERTY,
	GALA_DAEMON_WINDOW_CONTENT_PROPERTY,
	GALA_DAEMON_WINDOW_NUM_PROPERTIES
};
static GParamSpec* gala_daemon_window_properties[GALA_DAEMON_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GalaDaemonWindow {
	GtkWindow parent_instance;
	GalaDaemonWindowPrivate * priv;
};

struct _GalaDaemonWindowClass {
	GtkWindowClass parent_class;
};

struct _GalaDaemonWindowPrivate {
	gint _width;
	gint _height;
	GtkBox* _content;
};

static gint GalaDaemonWindow_private_offset;
static gpointer gala_daemon_window_parent_class = NULL;

VALA_EXTERN GType gala_daemon_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonWindow, g_object_unref)
VALA_EXTERN GalaDaemonWindow* gala_daemon_window_new (gint width,
                                          gint height);
VALA_EXTERN GalaDaemonWindow* gala_daemon_window_construct (GType object_type,
                                                gint width,
                                                gint height);
VALA_EXTERN gint gala_daemon_window_get_width (GalaDaemonWindow* self);
static void gala_daemon_window_set_width (GalaDaemonWindow* self,
                                   gint value);
VALA_EXTERN gint gala_daemon_window_get_height (GalaDaemonWindow* self);
static void gala_daemon_window_set_height (GalaDaemonWindow* self,
                                    gint value);
VALA_EXTERN GtkBox* gala_daemon_window_get_content (GalaDaemonWindow* self);
static void gala_daemon_window_set_content (GalaDaemonWindow* self,
                                     GtkBox* value);
static GObject * gala_daemon_window_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static gboolean _gala_daemon_window___lambda15_ (GalaDaemonWindow* self);
static gboolean __gala_daemon_window___lambda15__gtk_widget_button_press_event (GtkWidget* _sender,
                                                                         GdkEventButton* event,
                                                                         gpointer self);
static void gala_daemon_window_finalize (GObject * obj);
static GType gala_daemon_window_get_type_once (void);
static void _vala_gala_daemon_window_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_gala_daemon_window_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
gala_daemon_window_get_instance_private (GalaDaemonWindow* self)
{
	return G_STRUCT_MEMBER_P (self, GalaDaemonWindow_private_offset);
}

GalaDaemonWindow*
gala_daemon_window_construct (GType object_type,
                              gint width,
                              gint height)
{
	GalaDaemonWindow * self = NULL;
	self = (GalaDaemonWindow*) g_object_new (object_type, "width", width, "height", height, NULL);
	return self;
}

GalaDaemonWindow*
gala_daemon_window_new (gint width,
                        gint height)
{
	return gala_daemon_window_construct (GALA_DAEMON_TYPE_WINDOW, width, height);
}

gint
gala_daemon_window_get_width (GalaDaemonWindow* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_width;
	return result;
}

static void
gala_daemon_window_set_width (GalaDaemonWindow* self,
                              gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_window_get_width (self);
	if (old_value != value) {
		self->priv->_width = value;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_window_properties[GALA_DAEMON_WINDOW_WIDTH_PROPERTY]);
	}
}

gint
gala_daemon_window_get_height (GalaDaemonWindow* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_height;
	return result;
}

static void
gala_daemon_window_set_height (GalaDaemonWindow* self,
                               gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_window_get_height (self);
	if (old_value != value) {
		self->priv->_height = value;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_window_properties[GALA_DAEMON_WINDOW_HEIGHT_PROPERTY]);
	}
}

GtkBox*
gala_daemon_window_get_content (GalaDaemonWindow* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	result = _tmp0_;
	return result;
}

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

static void
gala_daemon_window_set_content (GalaDaemonWindow* self,
                                GtkBox* value)
{
	GtkBox* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_window_get_content (self);
	if (old_value != value) {
		GtkBox* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_content);
		self->priv->_content = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_window_properties[GALA_DAEMON_WINDOW_CONTENT_PROPERTY]);
	}
}

static gboolean
_gala_daemon_window___lambda15_ (GalaDaemonWindow* self)
{
	gboolean result;
	gtk_window_close ((GtkWindow*) self);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
__gala_daemon_window___lambda15__gtk_widget_button_press_event (GtkWidget* _sender,
                                                                GdkEventButton* event,
                                                                gpointer self)
{
	gboolean result;
	result = _gala_daemon_window___lambda15_ ((GalaDaemonWindow*) self);
	return result;
}

static GObject *
gala_daemon_window_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaDaemonWindow * self;
	gint _tmp0_;
	gint _tmp1_;
	GtkBox* _tmp2_ = NULL;
	GtkBox* _tmp3_;
	GdkScreen* _tmp4_;
	GdkVisual* _tmp5_;
	parent_class = G_OBJECT_CLASS (gala_daemon_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindow);
	gtk_window_set_decorated ((GtkWindow*) self, FALSE);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	gtk_window_set_deletable ((GtkWindow*) self, FALSE);
	gtk_widget_set_can_focus ((GtkWidget*) self, FALSE);
	gtk_widget_input_shape_combine_region ((GtkWidget*) self, NULL);
	gtk_window_set_accept_focus ((GtkWindow*) self, FALSE);
	gtk_window_set_skip_taskbar_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_skip_pager_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_type_hint ((GtkWindow*) self, GDK_WINDOW_TYPE_HINT_DOCK);
	gtk_window_set_keep_above ((GtkWindow*) self, TRUE);
	gtk_window_set_title ((GtkWindow*) self, "MODAL");
	_tmp0_ = self->priv->_width;
	_tmp1_ = self->priv->_height;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp2_, TRUE);
	g_object_set ((GtkWidget*) _tmp2_, "width-request", _tmp0_, NULL);
	g_object_set ((GtkWidget*) _tmp2_, "height-request", _tmp1_, NULL);
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	gala_daemon_window_set_content (self, _tmp3_);
	g_object_set ((GtkContainer*) self, "child", (GtkWidget*) _tmp3_, NULL);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp5_ = gdk_screen_get_rgba_visual (_tmp4_);
	gtk_widget_set_visual ((GtkWidget*) self, _tmp5_);
	gtk_widget_show_all ((GtkWidget*) self);
	gtk_window_move ((GtkWindow*) self, 0, 0);
	g_signal_connect_object ((GtkWidget*) self, "button-press-event", (GCallback) __gala_daemon_window___lambda15__gtk_widget_button_press_event, self, 0);
	return obj;
}

static void
gala_daemon_window_base_init (GalaDaemonWindowClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "daemon-window");
}

static void
gala_daemon_window_class_init (GalaDaemonWindowClass * klass,
                               gpointer klass_data)
{
	gala_daemon_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaDaemonWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_daemon_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_daemon_window_set_property;
	G_OBJECT_CLASS (klass)->constructor = gala_daemon_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = gala_daemon_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_WINDOW_WIDTH_PROPERTY, gala_daemon_window_properties[GALA_DAEMON_WINDOW_WIDTH_PROPERTY] = g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_WINDOW_HEIGHT_PROPERTY, gala_daemon_window_properties[GALA_DAEMON_WINDOW_HEIGHT_PROPERTY] = g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_WINDOW_CONTENT_PROPERTY, gala_daemon_window_properties[GALA_DAEMON_WINDOW_CONTENT_PROPERTY] = g_param_spec_object ("content", "content", "content", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_daemon_window_instance_init (GalaDaemonWindow * self,
                                  gpointer klass)
{
	self->priv = gala_daemon_window_get_instance_private (self);
}

static void
gala_daemon_window_finalize (GObject * obj)
{
	GalaDaemonWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindow);
	_g_object_unref0 (self->priv->_content);
	G_OBJECT_CLASS (gala_daemon_window_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_daemon_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDaemonWindowClass), (GBaseInitFunc) gala_daemon_window_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_daemon_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDaemonWindow), 0, (GInstanceInitFunc) gala_daemon_window_instance_init, NULL };
	GType gala_daemon_window_type_id;
	gala_daemon_window_type_id = g_type_register_static (gtk_window_get_type (), "GalaDaemonWindow", &g_define_type_info, 0);
	GalaDaemonWindow_private_offset = g_type_add_instance_private (gala_daemon_window_type_id, sizeof (GalaDaemonWindowPrivate));
	return gala_daemon_window_type_id;
}

GType
gala_daemon_window_get_type (void)
{
	static gsize gala_daemon_window_type_id__once = 0;
	if (g_once_init_enter (&gala_daemon_window_type_id__once)) {
		GType gala_daemon_window_type_id;
		gala_daemon_window_type_id = gala_daemon_window_get_type_once ();
		g_once_init_leave (&gala_daemon_window_type_id__once, gala_daemon_window_type_id);
	}
	return gala_daemon_window_type_id__once;
}

static void
_vala_gala_daemon_window_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	GalaDaemonWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindow);
	switch (property_id) {
		case GALA_DAEMON_WINDOW_WIDTH_PROPERTY:
		g_value_set_int (value, gala_daemon_window_get_width (self));
		break;
		case GALA_DAEMON_WINDOW_HEIGHT_PROPERTY:
		g_value_set_int (value, gala_daemon_window_get_height (self));
		break;
		case GALA_DAEMON_WINDOW_CONTENT_PROPERTY:
		g_value_set_object (value, gala_daemon_window_get_content (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_daemon_window_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	GalaDaemonWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_WINDOW, GalaDaemonWindow);
	switch (property_id) {
		case GALA_DAEMON_WINDOW_WIDTH_PROPERTY:
		gala_daemon_window_set_width (self, g_value_get_int (value));
		break;
		case GALA_DAEMON_WINDOW_HEIGHT_PROPERTY:
		gala_daemon_window_set_height (self, g_value_get_int (value));
		break;
		case GALA_DAEMON_WINDOW_CONTENT_PROPERTY:
		gala_daemon_window_set_content (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

