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

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

#include "granite.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.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  {
	GRANITE_HEADER_LABEL_0_PROPERTY,
	GRANITE_HEADER_LABEL_NUM_PROPERTIES
};
static GParamSpec* granite_header_label_properties[GRANITE_HEADER_LABEL_NUM_PROPERTIES];

static gpointer granite_header_label_parent_class = NULL;

static GObject * granite_header_label_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static GType granite_header_label_get_type_once (void);

/**
     * Create a new HeaderLabel
     */
GraniteHeaderLabel*
granite_header_label_construct (GType object_type,
                                const gchar* label)
{
	GraniteHeaderLabel * self = NULL;
	g_return_val_if_fail (label != NULL, NULL);
	self = (GraniteHeaderLabel*) g_object_new (object_type, "label", label, NULL);
	return self;
}

GraniteHeaderLabel*
granite_header_label_new (const gchar* label)
{
	return granite_header_label_construct (GRANITE_TYPE_HEADER_LABEL, label);
}

static GObject *
granite_header_label_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GraniteHeaderLabel * self;
	GtkStyleContext* _tmp0_;
	parent_class = G_OBJECT_CLASS (granite_header_label_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRANITE_TYPE_HEADER_LABEL, GraniteHeaderLabel);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_START);
	gtk_label_set_xalign ((GtkLabel*) self, (gfloat) 0);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, GRANITE_STYLE_CLASS_H4_LABEL);
	return obj;
}

static void
granite_header_label_class_init (GraniteHeaderLabelClass * klass,
                                 gpointer klass_data)
{
	granite_header_label_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = granite_header_label_constructor;
}

static void
granite_header_label_instance_init (GraniteHeaderLabel * self,
                                    gpointer klass)
{
}

/**
 * HeaderLabel is a start-aligned Gtk.Label with the Granite H4 style class
 */
static GType
granite_header_label_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraniteHeaderLabelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) granite_header_label_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraniteHeaderLabel), 0, (GInstanceInitFunc) granite_header_label_instance_init, NULL };
	GType granite_header_label_type_id;
	granite_header_label_type_id = g_type_register_static (gtk_label_get_type (), "GraniteHeaderLabel", &g_define_type_info, 0);
	return granite_header_label_type_id;
}

GType
granite_header_label_get_type (void)
{
	static volatile gsize granite_header_label_type_id__once = 0;
	if (g_once_init_enter (&granite_header_label_type_id__once)) {
		GType granite_header_label_type_id;
		granite_header_label_type_id = granite_header_label_get_type_once ();
		g_once_init_leave (&granite_header_label_type_id__once, granite_header_label_type_id);
	}
	return granite_header_label_type_id__once;
}

