/* 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 <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <graphene-gobject.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_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;
};

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)
static void gala_daemon_window_real_snapshot (GtkWidget* base,
                                       GtkSnapshot* snapshot);
VALA_EXTERN GalaDaemonWindow* gala_daemon_window_new (void);
VALA_EXTERN GalaDaemonWindow* gala_daemon_window_construct (GType object_type);
static GObject * gala_daemon_window_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static void _gtk_window_close_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                   gint n_press,
                                                   gdouble x,
                                                   gdouble y,
                                                   gpointer self);
static GType gala_daemon_window_get_type_once (void);

static void
gala_daemon_window_real_snapshot (GtkWidget* base,
                                  GtkSnapshot* snapshot)
{
	GalaDaemonWindow * self;
	GdkRGBA _tmp0_ = {0};
	graphene_rect_t _tmp1_ = {0};
	self = (GalaDaemonWindow*) base;
	g_return_if_fail (snapshot != NULL);
	GTK_WIDGET_CLASS (gala_daemon_window_parent_class)->snapshot ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), snapshot);
	_tmp0_.red = (gfloat) 0;
	_tmp0_.green = (gfloat) 0;
	_tmp0_.blue = (gfloat) 0;
	_tmp0_.alpha = (gfloat) 0;
	_tmp1_.origin = (graphene_point_t) {(gfloat) 0, (gfloat) 0};
	_tmp1_.size = (graphene_size_t) {(gfloat) 0, (gfloat) 0};
	gtk_snapshot_append_color (snapshot, &_tmp0_, &_tmp1_);
}

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

GalaDaemonWindow*
gala_daemon_window_new (void)
{
	return gala_daemon_window_construct (GALA_DAEMON_TYPE_WINDOW);
}

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

static void
_gtk_window_close_gtk_gesture_click_released (GtkGestureClick* _sender,
                                              gint n_press,
                                              gdouble x,
                                              gdouble y,
                                              gpointer self)
{
	gtk_window_close ((GtkWindow*) self);
}

static GObject *
gala_daemon_window_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GalaDaemonWindow * self;
	GtkBox* _tmp0_ = NULL;
	GtkBox* _tmp1_;
	GtkGestureClick* controller = NULL;
	GtkGestureClick* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	GtkGestureClick* _tmp5_;
	GtkEventController* _tmp6_;
	GtkGestureClick* _tmp7_;
	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_window_set_title ((GtkWindow*) self, "MODAL");
	gtk_window_set_hide_on_close ((GtkWindow*) self, TRUE);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	gtk_window_set_child ((GtkWindow*) self, (GtkWidget*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = (GtkGestureClick*) gtk_gesture_click_new ();
	controller = _tmp2_;
	_tmp3_ = gtk_window_get_child ((GtkWindow*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = controller;
	_tmp6_ = _g_object_ref0 ((GtkEventController*) _tmp5_);
	gtk_widget_add_controller (_tmp4_, _tmp6_);
	_tmp7_ = controller;
	g_signal_connect_object (_tmp7_, "released", (GCallback) _gtk_window_close_gtk_gesture_click_released, (GtkWindow*) self, 0);
	_g_object_unref0 (controller);
	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);
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) gala_daemon_window_real_snapshot;
	G_OBJECT_CLASS (klass)->constructor = gala_daemon_window_constructor;
}

static void
gala_daemon_window_instance_init (GalaDaemonWindow * self,
                                  gpointer klass)
{
}

 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);
	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;
}

