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

/*
 * Copyright 2019 elementary, Inc. (https://elementary.io)
 * Copyright 2011-2013 Maxwell Barvian <maxwell@elementaryos.org>
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include "granite.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>

#define GRANITE_WIDGETS_COMPOSITED_WINDOW_STYLESHEET ".composited { background-color: rgba (0,0,0,0); }"
#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

enum  {
	GRANITE_WIDGETS_COMPOSITED_WINDOW_0_PROPERTY,
	GRANITE_WIDGETS_COMPOSITED_WINDOW_NUM_PROPERTIES
};
static GParamSpec* granite_widgets_composited_window_properties[GRANITE_WIDGETS_COMPOSITED_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer granite_widgets_composited_window_parent_class = NULL;
static GtkBuildableIface * granite_widgets_composited_window_gtk_buildable_parent_iface = NULL;

static GObject * granite_widgets_composited_window_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties);
static GType granite_widgets_composited_window_get_type_once (void);

GraniteWidgetsCompositedWindow*
granite_widgets_composited_window_construct (GType object_type)
{
	GraniteWidgetsCompositedWindow * self = NULL;
	self = (GraniteWidgetsCompositedWindow*) g_object_new (object_type, NULL);
	return self;
}

GraniteWidgetsCompositedWindow*
granite_widgets_composited_window_new (void)
{
	return granite_widgets_composited_window_construct (GRANITE_WIDGETS_TYPE_COMPOSITED_WINDOW);
}

static GObject *
granite_widgets_composited_window_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GraniteWidgetsCompositedWindow * self;
	GdkScreen* _tmp0_;
	GdkVisual* _tmp1_;
	GtkCssProvider* _tmp2_;
	GtkCssProvider* _tmp3_;
	parent_class = G_OBJECT_CLASS (granite_widgets_composited_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRANITE_WIDGETS_TYPE_COMPOSITED_WINDOW, GraniteWidgetsCompositedWindow);
	gtk_widget_set_app_paintable ((GtkWidget*) self, TRUE);
	gtk_window_set_decorated ((GtkWindow*) self, FALSE);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	_tmp0_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp1_ = gdk_screen_get_rgba_visual (_tmp0_);
	gtk_widget_set_visual ((GtkWidget*) self, _tmp1_);
	_tmp2_ = granite_widgets_utils_set_theming ((GtkWidget*) self, GRANITE_WIDGETS_COMPOSITED_WINDOW_STYLESHEET, GRANITE_STYLE_CLASS_COMPOSITED, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
	return obj;
}

static void
granite_widgets_composited_window_class_init (GraniteWidgetsCompositedWindowClass * klass,
                                              gpointer klass_data)
{
	granite_widgets_composited_window_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = granite_widgets_composited_window_constructor;
}

static void
granite_widgets_composited_window_gtk_buildable_interface_init (GtkBuildableIface * iface,
                                                                gpointer iface_data)
{
	granite_widgets_composited_window_gtk_buildable_parent_iface = g_type_interface_peek_parent (iface);
}

static void
granite_widgets_composited_window_instance_init (GraniteWidgetsCompositedWindow * self,
                                                 gpointer klass)
{
}

/**
     * CompositedWindow is an invisible window without decorations or background.
     *
     * It is useful for handling different situations where the user has to
     * "pick" something or select an area on the screen, although it can be used in other scenarios too.
     * Most of the times the window will act as a surface to receive mouse / key press events from the user.
     *
     * CompositedWindow does not and will not try to set any default size. You are responsible to
     * set it's size to e.g: the window's //screen// size to have the window cover the enire //screen// area.
     *
     * Note that you should provide a way for the user to exit the window since it's invisible.
     * You can do that by connecting to {@link Gtk.Widget.key_press_event} signal and seeing if
     * e.g: the user pressed an Escape key. You should always {@link Gtk.Widget.destroy} the window after
     * it's not needed.
     *
     * Do not forget to call {@link Gtk.Widget.show_all} to actually start receiving events.
     */
static GType
granite_widgets_composited_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraniteWidgetsCompositedWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) granite_widgets_composited_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraniteWidgetsCompositedWindow), 0, (GInstanceInitFunc) granite_widgets_composited_window_instance_init, NULL };
	static const GInterfaceInfo gtk_buildable_info = { (GInterfaceInitFunc) granite_widgets_composited_window_gtk_buildable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType granite_widgets_composited_window_type_id;
	granite_widgets_composited_window_type_id = g_type_register_static (gtk_window_get_type (), "GraniteWidgetsCompositedWindow", &g_define_type_info, 0);
	g_type_add_interface_static (granite_widgets_composited_window_type_id, gtk_buildable_get_type (), &gtk_buildable_info);
	return granite_widgets_composited_window_type_id;
}

GType
granite_widgets_composited_window_get_type (void)
{
	static volatile gsize granite_widgets_composited_window_type_id__once = 0;
	if (g_once_init_enter (&granite_widgets_composited_window_type_id__once)) {
		GType granite_widgets_composited_window_type_id;
		granite_widgets_composited_window_type_id = granite_widgets_composited_window_get_type_once ();
		g_once_init_leave (&granite_widgets_composited_window_type_id__once, granite_widgets_composited_window_type_id);
	}
	return granite_widgets_composited_window_type_id__once;
}

