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

/*
 * Copyright 2019-2021 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include "granite-7.h"
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.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_DEMO_PAGE (demo_page_get_type ())
#define DEMO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEMO_PAGE, DemoPage))
#define DEMO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEMO_PAGE, DemoPageClass))
#define IS_DEMO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEMO_PAGE))
#define IS_DEMO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEMO_PAGE))
#define DEMO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEMO_PAGE, DemoPageClass))

typedef struct _DemoPage DemoPage;
typedef struct _DemoPageClass DemoPageClass;
typedef struct _DemoPagePrivate DemoPagePrivate;

#define TYPE_ACCEL_LABEL_VIEW (accel_label_view_get_type ())
#define ACCEL_LABEL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ACCEL_LABEL_VIEW, AccelLabelView))
#define ACCEL_LABEL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ACCEL_LABEL_VIEW, AccelLabelViewClass))
#define IS_ACCEL_LABEL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ACCEL_LABEL_VIEW))
#define IS_ACCEL_LABEL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ACCEL_LABEL_VIEW))
#define ACCEL_LABEL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ACCEL_LABEL_VIEW, AccelLabelViewClass))

typedef struct _AccelLabelView AccelLabelView;
typedef struct _AccelLabelViewClass AccelLabelViewClass;
typedef struct _AccelLabelViewPrivate AccelLabelViewPrivate;
enum  {
	ACCEL_LABEL_VIEW_0_PROPERTY,
	ACCEL_LABEL_VIEW_NUM_PROPERTIES
};
static GParamSpec* accel_label_view_properties[ACCEL_LABEL_VIEW_NUM_PROPERTIES];

#define ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM (accel_label_view_popover_menu_item_get_type ())
#define ACCEL_LABEL_VIEW_POPOVER_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM, AccelLabelViewPopoverMenuItem))
#define ACCEL_LABEL_VIEW_POPOVER_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM, AccelLabelViewPopoverMenuItemClass))
#define ACCEL_LABEL_VIEW_IS_POPOVER_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM))
#define ACCEL_LABEL_VIEW_IS_POPOVER_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM))
#define ACCEL_LABEL_VIEW_POPOVER_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM, AccelLabelViewPopoverMenuItemClass))

typedef struct _AccelLabelViewPopoverMenuItem AccelLabelViewPopoverMenuItem;
typedef struct _AccelLabelViewPopoverMenuItemClass AccelLabelViewPopoverMenuItemClass;
typedef struct _AccelLabelViewPopoverMenuItemPrivate AccelLabelViewPopoverMenuItemPrivate;
enum  {
	ACCEL_LABEL_VIEW_POPOVER_MENU_ITEM_0_PROPERTY,
	ACCEL_LABEL_VIEW_POPOVER_MENU_ITEM_NUM_PROPERTIES
};
static GParamSpec* accel_label_view_popover_menu_item_properties[ACCEL_LABEL_VIEW_POPOVER_MENU_ITEM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _DemoPage {
	GraniteToolBox parent_instance;
	DemoPagePrivate * priv;
};

struct _DemoPageClass {
	GraniteToolBoxClass parent_class;
};

struct _AccelLabelView {
	DemoPage parent_instance;
	AccelLabelViewPrivate * priv;
};

struct _AccelLabelViewClass {
	DemoPageClass parent_class;
};

struct _AccelLabelViewPopoverMenuItem {
	GtkButton parent_instance;
	AccelLabelViewPopoverMenuItemPrivate * priv;
};

struct _AccelLabelViewPopoverMenuItemClass {
	GtkButtonClass parent_class;
};

static gpointer accel_label_view_parent_class = NULL;
static gpointer accel_label_view_popover_menu_item_parent_class = NULL;

VALA_EXTERN GType demo_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DemoPage, g_object_unref)
VALA_EXTERN GType accel_label_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AccelLabelView, g_object_unref)
VALA_EXTERN AccelLabelView* accel_label_view_new (void);
VALA_EXTERN AccelLabelView* accel_label_view_construct (GType object_type);
VALA_EXTERN DemoPage* demo_page_new (void);
VALA_EXTERN DemoPage* demo_page_construct (GType object_type);
static GType accel_label_view_popover_menu_item_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AccelLabelViewPopoverMenuItem, g_object_unref)
static AccelLabelViewPopoverMenuItem* accel_label_view_popover_menu_item_new (void);
static AccelLabelViewPopoverMenuItem* accel_label_view_popover_menu_item_construct (GType object_type);
static GType accel_label_view_popover_menu_item_get_type_once (void);
static GObject * accel_label_view_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static GVariant* _variant_new1 (const gchar* value);
static GVariant* _variant_new2 (const gchar* value);
VALA_EXTERN void demo_page_set_child (DemoPage* self,
                          GtkWidget* value);
static GType accel_label_view_get_type_once (void);

AccelLabelView*
accel_label_view_construct (GType object_type)
{
	AccelLabelView * self = NULL;
	self = (AccelLabelView*) demo_page_construct (object_type);
	return self;
}

AccelLabelView*
accel_label_view_new (void)
{
	return accel_label_view_construct (TYPE_ACCEL_LABEL_VIEW);
}

static AccelLabelViewPopoverMenuItem*
accel_label_view_popover_menu_item_construct (GType object_type)
{
	AccelLabelViewPopoverMenuItem * self = NULL;
	self = (AccelLabelViewPopoverMenuItem*) g_object_new (object_type, NULL);
	return self;
}

static AccelLabelViewPopoverMenuItem*
accel_label_view_popover_menu_item_new (void)
{
	return accel_label_view_popover_menu_item_construct (ACCEL_LABEL_VIEW_TYPE_POPOVER_MENU_ITEM);
}

static void
accel_label_view_popover_menu_item_base_init (AccelLabelViewPopoverMenuItemClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "modelbutton");
}

static void
accel_label_view_popover_menu_item_class_init (AccelLabelViewPopoverMenuItemClass * klass,
                                               gpointer klass_data)
{
	accel_label_view_popover_menu_item_parent_class = g_type_class_peek_parent (klass);
}

static void
accel_label_view_popover_menu_item_instance_init (AccelLabelViewPopoverMenuItem * self,
                                                  gpointer klass)
{
}

static GType
accel_label_view_popover_menu_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AccelLabelViewPopoverMenuItemClass), (GBaseInitFunc) accel_label_view_popover_menu_item_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) accel_label_view_popover_menu_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AccelLabelViewPopoverMenuItem), 0, (GInstanceInitFunc) accel_label_view_popover_menu_item_instance_init, NULL };
	GType accel_label_view_popover_menu_item_type_id;
	accel_label_view_popover_menu_item_type_id = g_type_register_static (gtk_button_get_type (), "AccelLabelViewPopoverMenuItem", &g_define_type_info, 0);
	return accel_label_view_popover_menu_item_type_id;
}

static GType
accel_label_view_popover_menu_item_get_type (void)
{
	static volatile gsize accel_label_view_popover_menu_item_type_id__once = 0;
	if (g_once_init_enter (&accel_label_view_popover_menu_item_type_id__once)) {
		GType accel_label_view_popover_menu_item_type_id;
		accel_label_view_popover_menu_item_type_id = accel_label_view_popover_menu_item_get_type_once ();
		g_once_init_leave (&accel_label_view_popover_menu_item_type_id__once, accel_label_view_popover_menu_item_type_id);
	}
	return accel_label_view_popover_menu_item_type_id__once;
}

static GVariant*
_variant_new1 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GVariant*
_variant_new2 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GObject *
accel_label_view_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	AccelLabelView * self;
	GtkLabel* accellabel_label = NULL;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GraniteAccelLabel* copy_label = NULL;
	GraniteAccelLabel* _tmp2_;
	GtkLabel* popover_label = NULL;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	AccelLabelViewPopoverMenuItem* lock_button = NULL;
	GraniteAccelLabel* _tmp5_;
	AccelLabelViewPopoverMenuItem* _tmp6_ = NULL;
	AccelLabelViewPopoverMenuItem* logout_button = NULL;
	GraniteAccelLabel* _tmp7_;
	AccelLabelViewPopoverMenuItem* _tmp8_ = NULL;
	GMenuItem* lock_item = NULL;
	GMenuItem* _tmp9_;
	GMenuItem* _tmp10_;
	GVariant* _tmp11_;
	GMenuItem* logout_item = NULL;
	GMenuItem* _tmp12_;
	GMenuItem* _tmp13_;
	GVariant* _tmp14_;
	GMenu* menu_model = NULL;
	GMenu* _tmp15_;
	GMenu* _tmp16_;
	GMenuItem* _tmp17_;
	GMenu* _tmp18_;
	GMenuItem* _tmp19_;
	GtkPopoverMenu* popover = NULL;
	GMenu* _tmp20_;
	GtkPopoverMenu* _tmp21_ = NULL;
	GtkPopoverMenu* _tmp22_;
	AccelLabelViewPopoverMenuItem* _tmp23_;
	GtkPopoverMenu* _tmp24_;
	AccelLabelViewPopoverMenuItem* _tmp25_;
	GtkMenuButton* popover_button = NULL;
	GtkMenuButton* _tmp26_;
	GtkMenuButton* _tmp27_;
	GtkPopoverMenu* _tmp28_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp29_ = NULL;
	GtkGrid* _tmp30_;
	GtkLabel* _tmp31_;
	GtkGrid* _tmp32_;
	GraniteAccelLabel* _tmp33_;
	GtkGrid* _tmp34_;
	GtkLabel* _tmp35_;
	GtkGrid* _tmp36_;
	GtkMenuButton* _tmp37_;
	GtkGrid* _tmp38_;
	parent_class = G_OBJECT_CLASS (accel_label_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ACCEL_LABEL_VIEW, AccelLabelView);
	_tmp0_ = (GtkLabel*) gtk_label_new ("AccelLabel:");
	g_object_ref_sink (_tmp0_);
	accellabel_label = _tmp0_;
	_tmp1_ = accellabel_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	_tmp2_ = granite_accel_label_new ("Copy", "<Ctrl>C");
	g_object_ref_sink (_tmp2_);
	copy_label = _tmp2_;
	_tmp3_ = (GtkLabel*) gtk_label_new ("In a Popover:");
	g_object_ref_sink (_tmp3_);
	popover_label = _tmp3_;
	_tmp4_ = popover_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp4_, GTK_ALIGN_END);
	_tmp5_ = granite_accel_label_new ("Lock", "<Super>L");
	g_object_ref_sink (_tmp5_);
	_tmp6_ = accel_label_view_popover_menu_item_new ();
	gtk_button_set_child ((GtkButton*) _tmp6_, (GtkWidget*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	g_object_ref_sink (_tmp6_);
	lock_button = _tmp6_;
	_tmp7_ = granite_accel_label_new ("Log Out…", "<Ctrl><Alt>Delete");
	g_object_ref_sink (_tmp7_);
	_tmp8_ = accel_label_view_popover_menu_item_new ();
	gtk_button_set_child ((GtkButton*) _tmp8_, (GtkWidget*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	logout_button = _tmp8_;
	_tmp9_ = g_menu_item_new (NULL, NULL);
	lock_item = _tmp9_;
	_tmp10_ = lock_item;
	_tmp11_ = _variant_new1 ("lock");
	g_menu_item_set_attribute_value (_tmp10_, "custom", _tmp11_);
	_g_variant_unref0 (_tmp11_);
	_tmp12_ = g_menu_item_new (NULL, NULL);
	logout_item = _tmp12_;
	_tmp13_ = logout_item;
	_tmp14_ = _variant_new2 ("logout");
	g_menu_item_set_attribute_value (_tmp13_, "custom", _tmp14_);
	_g_variant_unref0 (_tmp14_);
	_tmp15_ = g_menu_new ();
	menu_model = _tmp15_;
	_tmp16_ = menu_model;
	_tmp17_ = lock_item;
	g_menu_append_item (_tmp16_, _tmp17_);
	_tmp18_ = menu_model;
	_tmp19_ = logout_item;
	g_menu_append_item (_tmp18_, _tmp19_);
	_tmp20_ = menu_model;
	_tmp21_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) _tmp20_);
	gtk_popover_set_has_arrow ((GtkPopover*) _tmp21_, FALSE);
	g_object_ref_sink (_tmp21_);
	popover = _tmp21_;
	_tmp22_ = popover;
	_tmp23_ = lock_button;
	gtk_popover_menu_add_child (_tmp22_, (GtkWidget*) _tmp23_, "lock");
	_tmp24_ = popover;
	_tmp25_ = logout_button;
	gtk_popover_menu_add_child (_tmp24_, (GtkWidget*) _tmp25_, "logout");
	_tmp26_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp26_);
	popover_button = _tmp26_;
	_tmp27_ = popover_button;
	_tmp28_ = popover;
	gtk_menu_button_set_popover (_tmp27_, (GtkPopover*) _tmp28_);
	_tmp29_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp29_, 12);
	gtk_grid_set_row_spacing (_tmp29_, 12);
	gtk_widget_set_halign ((GtkWidget*) _tmp29_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp29_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp29_);
	grid = _tmp29_;
	_tmp30_ = grid;
	_tmp31_ = accellabel_label;
	gtk_grid_attach (_tmp30_, (GtkWidget*) _tmp31_, 0, 0, 1, 1);
	_tmp32_ = grid;
	_tmp33_ = copy_label;
	gtk_grid_attach (_tmp32_, (GtkWidget*) _tmp33_, 1, 0, 1, 1);
	_tmp34_ = grid;
	_tmp35_ = popover_label;
	gtk_grid_attach (_tmp34_, (GtkWidget*) _tmp35_, 0, 1, 1, 1);
	_tmp36_ = grid;
	_tmp37_ = popover_button;
	gtk_grid_attach (_tmp36_, (GtkWidget*) _tmp37_, 1, 1, 1, 1);
	_tmp38_ = grid;
	demo_page_set_child ((DemoPage*) self, (GtkWidget*) _tmp38_);
	_g_object_unref0 (grid);
	_g_object_unref0 (popover_button);
	_g_object_unref0 (popover);
	_g_object_unref0 (menu_model);
	_g_object_unref0 (logout_item);
	_g_object_unref0 (lock_item);
	_g_object_unref0 (logout_button);
	_g_object_unref0 (lock_button);
	_g_object_unref0 (popover_label);
	_g_object_unref0 (copy_label);
	_g_object_unref0 (accellabel_label);
	return obj;
}

static void
accel_label_view_class_init (AccelLabelViewClass * klass,
                             gpointer klass_data)
{
	accel_label_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = accel_label_view_constructor;
}

static void
accel_label_view_instance_init (AccelLabelView * self,
                                gpointer klass)
{
}

static GType
accel_label_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AccelLabelViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) accel_label_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AccelLabelView), 0, (GInstanceInitFunc) accel_label_view_instance_init, NULL };
	GType accel_label_view_type_id;
	accel_label_view_type_id = g_type_register_static (TYPE_DEMO_PAGE, "AccelLabelView", &g_define_type_info, 0);
	return accel_label_view_type_id;
}

GType
accel_label_view_get_type (void)
{
	static volatile gsize accel_label_view_type_id__once = 0;
	if (g_once_init_enter (&accel_label_view_type_id__once)) {
		GType accel_label_view_type_id;
		accel_label_view_type_id = accel_label_view_get_type_once ();
		g_once_init_leave (&accel_label_view_type_id__once, accel_label_view_type_id);
	}
	return accel_label_view_type_id__once;
}

