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

/*-
 * Copyright 2015-2019 elementary, Inc. (https://elementary.io)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Library General Public License as published by
 * the Free Software Foundation, either version 2.1 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 Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "keyboard.h"
#include <glib-object.h>
#include <gtk/gtk.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

enum  {
	KEYBOARD_WIDGETS_KEYBOARD_ICON_0_PROPERTY,
	KEYBOARD_WIDGETS_KEYBOARD_ICON_NUM_PROPERTIES
};
static GParamSpec* keyboard_widgets_keyboard_icon_properties[KEYBOARD_WIDGETS_KEYBOARD_ICON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer keyboard_widgets_keyboard_icon_parent_class = NULL;

static GObject * keyboard_widgets_keyboard_icon_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
static GType keyboard_widgets_keyboard_icon_get_type_once (void);

KeyboardWidgetsKeyboardIcon*
keyboard_widgets_keyboard_icon_construct (GType object_type)
{
	KeyboardWidgetsKeyboardIcon * self = NULL;
	self = (KeyboardWidgetsKeyboardIcon*) g_object_new (object_type, NULL);
	return self;
}

KeyboardWidgetsKeyboardIcon*
keyboard_widgets_keyboard_icon_new (void)
{
	return keyboard_widgets_keyboard_icon_construct (KEYBOARD_WIDGETS_TYPE_KEYBOARD_ICON);
}

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

static GObject *
keyboard_widgets_keyboard_icon_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	KeyboardWidgetsKeyboardIcon * self;
	GtkCssProvider* provider = NULL;
	GtkCssProvider* _tmp0_;
	GtkCssProvider* _tmp1_;
	GtkStyleContext* style_context = NULL;
	GtkStyleContext* _tmp2_;
	GtkStyleContext* _tmp3_;
	GtkStyleContext* _tmp4_;
	GtkStyleContext* _tmp5_;
	GtkCssProvider* _tmp6_;
	parent_class = G_OBJECT_CLASS (keyboard_widgets_keyboard_icon_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, KEYBOARD_WIDGETS_TYPE_KEYBOARD_ICON, KeyboardWidgetsKeyboardIcon);
	gtk_widget_set_margin_top ((GtkWidget*) self, 2);
	gtk_widget_set_margin_bottom ((GtkWidget*) self, 2);
	gtk_widget_set_margin_start ((GtkWidget*) self, 2);
	gtk_widget_set_margin_end ((GtkWidget*) self, 2);
	gtk_widget_set_size_request ((GtkWidget*) self, 20, 20);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp0_ = gtk_css_provider_new ();
	provider = _tmp0_;
	_tmp1_ = provider;
	gtk_css_provider_load_from_resource (_tmp1_, "/io/elementary/desktop/wingpanel/keyboard/KeyboardIcon.css");
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) self);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	style_context = _tmp3_;
	_tmp4_ = style_context;
	gtk_style_context_add_class (_tmp4_, "keyboard-icon");
	_tmp5_ = style_context;
	_tmp6_ = provider;
	gtk_style_context_add_provider (_tmp5_, (GtkStyleProvider*) _tmp6_, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_g_object_unref0 (style_context);
	_g_object_unref0 (provider);
	return obj;
}

static void
keyboard_widgets_keyboard_icon_class_init (KeyboardWidgetsKeyboardIconClass * klass,
                                           gpointer klass_data)
{
	keyboard_widgets_keyboard_icon_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = keyboard_widgets_keyboard_icon_constructor;
}

static void
keyboard_widgets_keyboard_icon_instance_init (KeyboardWidgetsKeyboardIcon * self,
                                              gpointer klass)
{
}

static GType
keyboard_widgets_keyboard_icon_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (KeyboardWidgetsKeyboardIconClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) keyboard_widgets_keyboard_icon_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (KeyboardWidgetsKeyboardIcon), 0, (GInstanceInitFunc) keyboard_widgets_keyboard_icon_instance_init, NULL };
	GType keyboard_widgets_keyboard_icon_type_id;
	keyboard_widgets_keyboard_icon_type_id = g_type_register_static (gtk_label_get_type (), "KeyboardWidgetsKeyboardIcon", &g_define_type_info, 0);
	return keyboard_widgets_keyboard_icon_type_id;
}

GType
keyboard_widgets_keyboard_icon_get_type (void)
{
	static volatile gsize keyboard_widgets_keyboard_icon_type_id__once = 0;
	if (g_once_init_enter (&keyboard_widgets_keyboard_icon_type_id__once)) {
		GType keyboard_widgets_keyboard_icon_type_id;
		keyboard_widgets_keyboard_icon_type_id = keyboard_widgets_keyboard_icon_get_type_once ();
		g_once_init_leave (&keyboard_widgets_keyboard_icon_type_id__once, keyboard_widgets_keyboard_icon_type_id);
	}
	return keyboard_widgets_keyboard_icon_type_id__once;
}

