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

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "granite.h"
#include <glib.h>
#include <stdlib.h>
#include <string.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_MODE_BUTTON_VIEW (mode_button_view_get_type ())
#define MODE_BUTTON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MODE_BUTTON_VIEW, ModeButtonView))
#define MODE_BUTTON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MODE_BUTTON_VIEW, ModeButtonViewClass))
#define IS_MODE_BUTTON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MODE_BUTTON_VIEW))
#define IS_MODE_BUTTON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MODE_BUTTON_VIEW))
#define MODE_BUTTON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MODE_BUTTON_VIEW, ModeButtonViewClass))

typedef struct _ModeButtonView ModeButtonView;
typedef struct _ModeButtonViewClass ModeButtonViewClass;
typedef struct _ModeButtonViewPrivate ModeButtonViewPrivate;
enum  {
	MODE_BUTTON_VIEW_0_PROPERTY,
	MODE_BUTTON_VIEW_NUM_PROPERTIES
};
static GParamSpec* mode_button_view_properties[MODE_BUTTON_VIEW_NUM_PROPERTIES];
typedef struct _Block9Data Block9Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ModeButtonView {
	GtkGrid parent_instance;
	ModeButtonViewPrivate * priv;
};

struct _ModeButtonViewClass {
	GtkGridClass parent_class;
};

struct _Block9Data {
	int _ref_count_;
	ModeButtonView* self;
	GraniteWidgetsModeButton* icon_mode;
	GraniteWidgetsModeButton* text_mode;
};

static gpointer mode_button_view_parent_class = NULL;

VALA_EXTERN GType mode_button_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModeButtonView, g_object_unref)
VALA_EXTERN ModeButtonView* mode_button_view_new (void);
VALA_EXTERN ModeButtonView* mode_button_view_construct (GType object_type);
static GObject * mode_button_view_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static void _mode_button_view___lambda11_ (Block9Data* _data9_);
static void __mode_button_view___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self);
static GType mode_button_view_get_type_once (void);

ModeButtonView*
mode_button_view_construct (GType object_type)
{
	ModeButtonView * self = NULL;
	self = (ModeButtonView*) g_object_new (object_type, NULL);
	return self;
}

ModeButtonView*
mode_button_view_new (void)
{
	return mode_button_view_construct (TYPE_MODE_BUTTON_VIEW);
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		ModeButtonView* self;
		self = _data9_->self;
		_g_object_unref0 (_data9_->text_mode);
		_g_object_unref0 (_data9_->icon_mode);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

static void
_mode_button_view___lambda11_ (Block9Data* _data9_)
{
	ModeButtonView* self;
	GraniteWidgetsModeButton* _tmp0_;
	GraniteWidgetsModeButton* _tmp1_;
	self = _data9_->self;
	_tmp0_ = _data9_->icon_mode;
	granite_widgets_mode_button_set_selected (_tmp0_, -1);
	_tmp1_ = _data9_->text_mode;
	granite_widgets_mode_button_set_selected (_tmp1_, -1);
}

static void
__mode_button_view___lambda11__gtk_button_clicked (GtkButton* _sender,
                                                   gpointer self)
{
	_mode_button_view___lambda11_ (self);
}

static GObject *
mode_button_view_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ModeButtonView * self;
	Block9Data* _data9_;
	GtkLabel* mode_button_label = NULL;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkStyleContext* _tmp3_;
	GraniteWidgetsModeButton* _tmp4_;
	GraniteWidgetsModeButton* _tmp5_;
	GraniteWidgetsModeButton* _tmp6_;
	GraniteWidgetsModeButton* _tmp7_;
	GraniteWidgetsModeButton* _tmp8_;
	GraniteWidgetsModeButton* _tmp9_;
	GraniteWidgetsModeButton* _tmp10_;
	GtkButton* clear_button = NULL;
	GtkButton* _tmp11_;
	GtkLabel* mode_switch_label = NULL;
	GtkLabel* _tmp12_;
	GtkLabel* _tmp13_;
	GtkLabel* _tmp14_;
	GtkLabel* _tmp15_;
	GtkStyleContext* _tmp16_;
	GraniteModeSwitch* mode_switch = NULL;
	GraniteModeSwitch* _tmp17_;
	GraniteModeSwitch* _tmp18_;
	GraniteModeSwitch* _tmp19_;
	GraniteModeSwitch* _tmp20_;
	GraniteHeaderLabel* switchbutton_header = NULL;
	GraniteHeaderLabel* _tmp21_ = NULL;
	GraniteSwitchModelButton* header_switchmodelbutton = NULL;
	GraniteSwitchModelButton* _tmp22_;
	GraniteSwitchModelButton* _tmp23_;
	GtkStyleContext* _tmp24_;
	GraniteSwitchModelButton* switchmodelbutton = NULL;
	GraniteSwitchModelButton* _tmp25_;
	GraniteSwitchModelButton* description_switchmodelbutton = NULL;
	gchar* _tmp26_;
	GraniteSwitchModelButton* _tmp27_ = NULL;
	GtkGrid* switchbutton_grid = NULL;
	GtkGrid* _tmp28_ = NULL;
	GtkGrid* _tmp29_;
	GraniteSwitchModelButton* _tmp30_;
	GtkGrid* _tmp31_;
	GraniteSwitchModelButton* _tmp32_;
	GtkGrid* _tmp33_;
	GraniteSwitchModelButton* _tmp34_;
	GtkGrid* _tmp35_;
	GtkPopover* switchbutton_popover = NULL;
	GtkPopover* _tmp36_;
	GtkPopover* _tmp37_;
	GtkGrid* _tmp38_;
	GtkMenuButton* popover_button = NULL;
	GtkMenuButton* _tmp39_ = NULL;
	GtkMenuButton* _tmp40_;
	GtkPopover* _tmp41_;
	GtkLabel* _tmp42_;
	GraniteWidgetsModeButton* _tmp43_;
	GraniteWidgetsModeButton* _tmp44_;
	GtkButton* _tmp45_;
	GtkLabel* _tmp46_;
	GraniteModeSwitch* _tmp47_;
	GraniteHeaderLabel* _tmp48_;
	GtkMenuButton* _tmp49_;
	GtkButton* _tmp50_;
	parent_class = G_OBJECT_CLASS (mode_button_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MODE_BUTTON_VIEW, ModeButtonView);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	_tmp0_ = (GtkLabel*) gtk_label_new ("ModeButton");
	g_object_ref_sink (_tmp0_);
	mode_button_label = _tmp0_;
	_tmp1_ = mode_button_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	_tmp2_ = mode_button_label;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	gtk_style_context_add_class (_tmp3_, GRANITE_STYLE_CLASS_H4_LABEL);
	_tmp4_ = granite_widgets_mode_button_new ();
	g_object_ref_sink (_tmp4_);
	_data9_->icon_mode = _tmp4_;
	_tmp5_ = _data9_->icon_mode;
	granite_widgets_mode_button_append_icon (_tmp5_, "view-grid-symbolic", GTK_ICON_SIZE_BUTTON);
	_tmp6_ = _data9_->icon_mode;
	granite_widgets_mode_button_append_icon (_tmp6_, "view-list-symbolic", GTK_ICON_SIZE_BUTTON);
	_tmp7_ = _data9_->icon_mode;
	granite_widgets_mode_button_append_icon (_tmp7_, "view-column-symbolic", GTK_ICON_SIZE_BUTTON);
	_tmp8_ = granite_widgets_mode_button_new ();
	g_object_ref_sink (_tmp8_);
	_data9_->text_mode = _tmp8_;
	_tmp9_ = _data9_->text_mode;
	granite_widgets_mode_button_append_text (_tmp9_, "Foo");
	_tmp10_ = _data9_->text_mode;
	granite_widgets_mode_button_append_text (_tmp10_, "Bar");
	_tmp11_ = (GtkButton*) gtk_button_new_with_label ("Clear Selected");
	g_object_ref_sink (_tmp11_);
	clear_button = _tmp11_;
	_tmp12_ = (GtkLabel*) gtk_label_new ("ModeSwitch");
	g_object_ref_sink (_tmp12_);
	mode_switch_label = _tmp12_;
	_tmp13_ = mode_switch_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_START);
	_tmp14_ = mode_switch_label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp14_, 12);
	_tmp15_ = mode_switch_label;
	_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) _tmp15_);
	gtk_style_context_add_class (_tmp16_, GRANITE_STYLE_CLASS_H4_LABEL);
	_tmp17_ = granite_mode_switch_new_from_icon_name ("display-brightness-symbolic", "weather-clear-night-symbolic");
	g_object_ref_sink (_tmp17_);
	mode_switch = _tmp17_;
	_tmp18_ = mode_switch;
	granite_mode_switch_set_primary_icon_tooltip_text (_tmp18_, "Light background");
	_tmp19_ = mode_switch;
	granite_mode_switch_set_secondary_icon_tooltip_text (_tmp19_, "Dark background");
	_tmp20_ = mode_switch;
	gtk_widget_set_valign ((GtkWidget*) _tmp20_, GTK_ALIGN_CENTER);
	_tmp21_ = granite_header_label_new ("SwitchModelButton");
	gtk_widget_set_margin_top ((GtkWidget*) _tmp21_, 12);
	g_object_ref_sink (_tmp21_);
	switchbutton_header = _tmp21_;
	_tmp22_ = granite_switch_model_button_new ("Header");
	g_object_ref_sink (_tmp22_);
	header_switchmodelbutton = _tmp22_;
	_tmp23_ = header_switchmodelbutton;
	_tmp24_ = gtk_widget_get_style_context ((GtkWidget*) _tmp23_);
	gtk_style_context_add_class (_tmp24_, GRANITE_STYLE_CLASS_H4_LABEL);
	_tmp25_ = granite_switch_model_button_new ("Default");
	g_object_ref_sink (_tmp25_);
	switchmodelbutton = _tmp25_;
	_tmp26_ = g_strdup ("A description of additional affects related to the activation state of" \
" this switch");
	_tmp27_ = granite_switch_model_button_new ("With Description");
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp27_, TRUE);
	granite_switch_model_button_set_description (_tmp27_, _tmp26_);
	_g_free0 (_tmp26_);
	g_object_ref_sink (_tmp27_);
	description_switchmodelbutton = _tmp27_;
	_tmp28_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp28_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp28_, 3);
	g_object_ref_sink (_tmp28_);
	switchbutton_grid = _tmp28_;
	_tmp29_ = switchbutton_grid;
	_tmp30_ = header_switchmodelbutton;
	gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp30_, 0, 0, 1, 1);
	_tmp31_ = switchbutton_grid;
	_tmp32_ = switchmodelbutton;
	gtk_grid_attach (_tmp31_, (GtkWidget*) _tmp32_, 0, 1, 1, 1);
	_tmp33_ = switchbutton_grid;
	_tmp34_ = description_switchmodelbutton;
	gtk_grid_attach (_tmp33_, (GtkWidget*) _tmp34_, 0, 2, 1, 1);
	_tmp35_ = switchbutton_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp35_);
	_tmp36_ = (GtkPopover*) gtk_popover_new (NULL);
	g_object_ref_sink (_tmp36_);
	switchbutton_popover = _tmp36_;
	_tmp37_ = switchbutton_popover;
	_tmp38_ = switchbutton_grid;
	gtk_container_add ((GtkContainer*) _tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_direction (_tmp39_, GTK_ARROW_UP);
	g_object_ref_sink (_tmp39_);
	popover_button = _tmp39_;
	_tmp40_ = popover_button;
	_tmp41_ = switchbutton_popover;
	gtk_menu_button_set_popover (_tmp40_, _tmp41_);
	gtk_grid_set_column_spacing ((GtkGrid*) self, 12);
	gtk_grid_set_row_spacing ((GtkGrid*) self, 6);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp42_ = mode_button_label;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp42_);
	_tmp43_ = _data9_->icon_mode;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp43_);
	_tmp44_ = _data9_->text_mode;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp44_);
	_tmp45_ = clear_button;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp45_);
	_tmp46_ = mode_switch_label;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp46_);
	_tmp47_ = mode_switch;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp47_);
	_tmp48_ = switchbutton_header;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp48_);
	_tmp49_ = popover_button;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp49_);
	_tmp50_ = clear_button;
	g_signal_connect_data (_tmp50_, "clicked", (GCallback) __mode_button_view___lambda11__gtk_button_clicked, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
	_g_object_unref0 (popover_button);
	_g_object_unref0 (switchbutton_popover);
	_g_object_unref0 (switchbutton_grid);
	_g_object_unref0 (description_switchmodelbutton);
	_g_object_unref0 (switchmodelbutton);
	_g_object_unref0 (header_switchmodelbutton);
	_g_object_unref0 (switchbutton_header);
	_g_object_unref0 (mode_switch);
	_g_object_unref0 (mode_switch_label);
	_g_object_unref0 (clear_button);
	_g_object_unref0 (mode_button_label);
	block9_data_unref (_data9_);
	_data9_ = NULL;
	return obj;
}

static void
mode_button_view_class_init (ModeButtonViewClass * klass,
                             gpointer klass_data)
{
	mode_button_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = mode_button_view_constructor;
}

static void
mode_button_view_instance_init (ModeButtonView * self,
                                gpointer klass)
{
}

static GType
mode_button_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ModeButtonViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mode_button_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ModeButtonView), 0, (GInstanceInitFunc) mode_button_view_instance_init, NULL };
	GType mode_button_view_type_id;
	mode_button_view_type_id = g_type_register_static (gtk_grid_get_type (), "ModeButtonView", &g_define_type_info, 0);
	return mode_button_view_type_id;
}

GType
mode_button_view_get_type (void)
{
	static volatile gsize mode_button_view_type_id__once = 0;
	if (g_once_init_enter (&mode_button_view_type_id__once)) {
		GType mode_button_view_type_id;
		mode_button_view_type_id = mode_button_view_get_type_once ();
		g_once_init_leave (&mode_button_view_type_id__once, mode_button_view_type_id);
	}
	return mode_button_view_type_id__once;
}

