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

/*-
 * Copyright 2017–2022 elementary, Inc. (https://elementary.io)
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>
#include <pantheon-wayland.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <granite-7.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 SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW (shortcut_overlay_main_window_get_type ())
#define SHORTCUT_OVERLAY_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW, ShortcutOverlayMainWindow))
#define SHORTCUT_OVERLAY_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW, ShortcutOverlayMainWindowClass))
#define SHORTCUT_OVERLAY_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW))
#define SHORTCUT_OVERLAY_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW))
#define SHORTCUT_OVERLAY_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW, ShortcutOverlayMainWindowClass))

typedef struct _ShortcutOverlayMainWindow ShortcutOverlayMainWindow;
typedef struct _ShortcutOverlayMainWindowClass ShortcutOverlayMainWindowClass;
typedef struct _ShortcutOverlayMainWindowPrivate ShortcutOverlayMainWindowPrivate;
enum  {
	SHORTCUT_OVERLAY_MAIN_WINDOW_0_PROPERTY,
	SHORTCUT_OVERLAY_MAIN_WINDOW_NUM_PROPERTIES
};
static GParamSpec* shortcut_overlay_main_window_properties[SHORTCUT_OVERLAY_MAIN_WINDOW_NUM_PROPERTIES];

#define SHORTCUT_OVERLAY_TYPE_SHORTCUTS_VIEW (shortcut_overlay_shortcuts_view_get_type ())
#define SHORTCUT_OVERLAY_SHORTCUTS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHORTCUT_OVERLAY_TYPE_SHORTCUTS_VIEW, ShortcutOverlayShortcutsView))
#define SHORTCUT_OVERLAY_SHORTCUTS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHORTCUT_OVERLAY_TYPE_SHORTCUTS_VIEW, ShortcutOverlayShortcutsViewClass))
#define SHORTCUT_OVERLAY_IS_SHORTCUTS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHORTCUT_OVERLAY_TYPE_SHORTCUTS_VIEW))
#define SHORTCUT_OVERLAY_IS_SHORTCUTS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHORTCUT_OVERLAY_TYPE_SHORTCUTS_VIEW))
#define SHORTCUT_OVERLAY_SHORTCUTS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHORTCUT_OVERLAY_TYPE_SHORTCUTS_VIEW, ShortcutOverlayShortcutsViewClass))

typedef struct _ShortcutOverlayShortcutsView ShortcutOverlayShortcutsView;
typedef struct _ShortcutOverlayShortcutsViewClass ShortcutOverlayShortcutsViewClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ShortcutOverlayMainWindow {
	GtkWindow parent_instance;
	ShortcutOverlayMainWindowPrivate * priv;
};

struct _ShortcutOverlayMainWindowClass {
	GtkWindowClass parent_class;
};

static gpointer shortcut_overlay_main_window_parent_class = NULL;
static PantheonWaylandExtendedBehaviorIface * shortcut_overlay_main_window_pantheon_wayland_extended_behavior_parent_iface = NULL;

VALA_EXTERN GType shortcut_overlay_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShortcutOverlayMainWindow, g_object_unref)
VALA_EXTERN ShortcutOverlayMainWindow* shortcut_overlay_main_window_new (GtkApplication* application);
VALA_EXTERN ShortcutOverlayMainWindow* shortcut_overlay_main_window_construct (GType object_type,
                                                                   GtkApplication* application);
static GObject * shortcut_overlay_main_window_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
VALA_EXTERN GType shortcut_overlay_shortcuts_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShortcutOverlayShortcutsView, g_object_unref)
VALA_EXTERN ShortcutOverlayShortcutsView* shortcut_overlay_shortcuts_view_new (void);
VALA_EXTERN ShortcutOverlayShortcutsView* shortcut_overlay_shortcuts_view_construct (GType object_type);
static void _shortcut_overlay_main_window___lambda4_ (ShortcutOverlayMainWindow* self);
static void __shortcut_overlay_main_window___lambda4__gtk_widget_realize (GtkWidget* _sender,
                                                                   gpointer self);
static GType shortcut_overlay_main_window_get_type_once (void);

ShortcutOverlayMainWindow*
shortcut_overlay_main_window_construct (GType object_type,
                                        GtkApplication* application)
{
	ShortcutOverlayMainWindow * self = NULL;
	g_return_val_if_fail (application != NULL, NULL);
	self = (ShortcutOverlayMainWindow*) g_object_new (object_type, "application", application, "resizable", FALSE, "title", _ ("Shortcuts"), NULL);
	return self;
}

ShortcutOverlayMainWindow*
shortcut_overlay_main_window_new (GtkApplication* application)
{
	return shortcut_overlay_main_window_construct (SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW, application);
}

static void
_shortcut_overlay_main_window___lambda4_ (ShortcutOverlayMainWindow* self)
{
	pantheon_wayland_extended_behavior_connect_to_shell ((PantheonWaylandExtendedBehavior*) self);
	pantheon_wayland_extended_behavior_set_keep_above ((PantheonWaylandExtendedBehavior*) self);
	pantheon_wayland_extended_behavior_make_centered ((PantheonWaylandExtendedBehavior*) self);
}

static void
__shortcut_overlay_main_window___lambda4__gtk_widget_realize (GtkWidget* _sender,
                                                              gpointer self)
{
	_shortcut_overlay_main_window___lambda4_ ((ShortcutOverlayMainWindow*) self);
}

static GObject *
shortcut_overlay_main_window_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ShortcutOverlayMainWindow * self;
	ShortcutOverlayShortcutsView* shortcuts_view = NULL;
	ShortcutOverlayShortcutsView* _tmp0_;
	GtkLinkButton* settings_button = NULL;
	GtkLinkButton* _tmp1_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	ShortcutOverlayShortcutsView* _tmp4_;
	GtkBox* _tmp5_;
	GtkLinkButton* _tmp6_;
	GtkBox* _tmp7_;
	GtkHeaderBar* titlebar = NULL;
	GtkHeaderBar* _tmp8_;
	GtkHeaderBar* _tmp9_;
	GtkHeaderBar* _tmp10_;
	GtkHeaderBar* _tmp11_;
	GtkWidget* _tmp12_;
	GtkWidget* _tmp13_;
	parent_class = G_OBJECT_CLASS (shortcut_overlay_main_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SHORTCUT_OVERLAY_TYPE_MAIN_WINDOW, ShortcutOverlayMainWindow);
	_tmp0_ = shortcut_overlay_shortcuts_view_new ();
	g_object_ref_sink (_tmp0_);
	shortcuts_view = _tmp0_;
	_tmp1_ = (GtkLinkButton*) gtk_link_button_new_with_label ("settings://input/keyboard/shortcuts", _ ("Keyboard Settings…"));
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp1_);
	settings_button = _tmp1_;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp2_);
	box = _tmp2_;
	_tmp3_ = box;
	_tmp4_ = shortcuts_view;
	gtk_box_append (_tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = box;
	_tmp6_ = settings_button;
	gtk_box_append (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = box;
	gtk_window_set_child ((GtkWindow*) self, (GtkWidget*) _tmp7_);
	_tmp8_ = (GtkHeaderBar*) gtk_header_bar_new ();
	g_object_ref_sink (_tmp8_);
	titlebar = _tmp8_;
	_tmp9_ = titlebar;
	gtk_widget_add_css_class ((GtkWidget*) _tmp9_, GRANITE_STYLE_CLASS_FLAT);
	_tmp10_ = titlebar;
	gtk_widget_add_css_class ((GtkWidget*) _tmp10_, GRANITE_STYLE_CLASS_DEFAULT_DECORATION);
	_tmp11_ = titlebar;
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) _tmp11_);
	_tmp12_ = gtk_window_get_child ((GtkWindow*) self);
	_tmp13_ = _tmp12_;
	g_signal_connect_object (_tmp13_, "realize", (GCallback) __shortcut_overlay_main_window___lambda4__gtk_widget_realize, self, 0);
	_g_object_unref0 (titlebar);
	_g_object_unref0 (box);
	_g_object_unref0 (settings_button);
	_g_object_unref0 (shortcuts_view);
	return obj;
}

static void
shortcut_overlay_main_window_class_init (ShortcutOverlayMainWindowClass * klass,
                                         gpointer klass_data)
{
	shortcut_overlay_main_window_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = shortcut_overlay_main_window_constructor;
}

static void
shortcut_overlay_main_window_pantheon_wayland_extended_behavior_interface_init (PantheonWaylandExtendedBehaviorIface * iface,
                                                                                gpointer iface_data)
{
	shortcut_overlay_main_window_pantheon_wayland_extended_behavior_parent_iface = g_type_interface_peek_parent (iface);
}

static void
shortcut_overlay_main_window_instance_init (ShortcutOverlayMainWindow * self,
                                            gpointer klass)
{
}

static GType
shortcut_overlay_main_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ShortcutOverlayMainWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) shortcut_overlay_main_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShortcutOverlayMainWindow), 0, (GInstanceInitFunc) shortcut_overlay_main_window_instance_init, NULL };
	static const GInterfaceInfo pantheon_wayland_extended_behavior_info = { (GInterfaceInitFunc) shortcut_overlay_main_window_pantheon_wayland_extended_behavior_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType shortcut_overlay_main_window_type_id;
	shortcut_overlay_main_window_type_id = g_type_register_static (gtk_window_get_type (), "ShortcutOverlayMainWindow", &g_define_type_info, 0);
	g_type_add_interface_static (shortcut_overlay_main_window_type_id, PANTHEON_WAYLAND_TYPE_EXTENDED_BEHAVIOR, &pantheon_wayland_extended_behavior_info);
	return shortcut_overlay_main_window_type_id;
}

GType
shortcut_overlay_main_window_get_type (void)
{
	static volatile gsize shortcut_overlay_main_window_type_id__once = 0;
	if (g_once_init_enter (&shortcut_overlay_main_window_type_id__once)) {
		GType shortcut_overlay_main_window_type_id;
		shortcut_overlay_main_window_type_id = shortcut_overlay_main_window_get_type_once ();
		g_once_init_leave (&shortcut_overlay_main_window_type_id__once, shortcut_overlay_main_window_type_id);
	}
	return shortcut_overlay_main_window_type_id__once;
}

