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

/*
* Copyright (c) 2016 Felipe Escoto (https://github.com/Philip-Scott/Spice-up)
*
* 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 2 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authored by: Felipe Escoto <felescoto95@hotmail.com>
*/

#include <gtk/gtk.h>
#include <glib-object.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 SPICE_WIDGETS_TYPE_TOOLBAR (spice_widgets_toolbar_get_type ())
#define SPICE_WIDGETS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbar))
#define SPICE_WIDGETS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbarClass))
#define SPICE_WIDGETS_IS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_WIDGETS_TYPE_TOOLBAR))
#define SPICE_WIDGETS_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_WIDGETS_TYPE_TOOLBAR))
#define SPICE_WIDGETS_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbarClass))

typedef struct _SpiceWidgetsToolbar SpiceWidgetsToolbar;
typedef struct _SpiceWidgetsToolbarClass SpiceWidgetsToolbarClass;
typedef struct _SpiceWidgetsToolbarPrivate SpiceWidgetsToolbarPrivate;

#define SPICE_TYPE_CANVAS_ITEM (spice_canvas_item_get_type ())
#define SPICE_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItem))
#define SPICE_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItemClass))
#define SPICE_IS_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_CANVAS_ITEM))
#define SPICE_IS_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_CANVAS_ITEM))
#define SPICE_CANVAS_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItemClass))

typedef struct _SpiceCanvasItem SpiceCanvasItem;
typedef struct _SpiceCanvasItemClass SpiceCanvasItemClass;
enum  {
	SPICE_WIDGETS_TOOLBAR_0_PROPERTY,
	SPICE_WIDGETS_TOOLBAR_NUM_PROPERTIES
};
static GParamSpec* spice_widgets_toolbar_properties[SPICE_WIDGETS_TOOLBAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _SpiceWidgetsToolbar {
	GtkBox parent_instance;
	SpiceWidgetsToolbarPrivate * priv;
	gboolean init;
	gboolean selecting;
	SpiceCanvasItem* item;
};

struct _SpiceWidgetsToolbarClass {
	GtkBoxClass parent_class;
	void (*item_selected) (SpiceWidgetsToolbar* self, SpiceCanvasItem* item, gboolean new_item);
	void (*update_properties) (SpiceWidgetsToolbar* self);
};

static gpointer spice_widgets_toolbar_parent_class = NULL;

VALA_EXTERN GType spice_widgets_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceWidgetsToolbar, g_object_unref)
VALA_EXTERN GType spice_canvas_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceCanvasItem, g_object_unref)
VALA_EXTERN void spice_widgets_toolbar_item_selected (SpiceWidgetsToolbar* self,
                                          SpiceCanvasItem* item,
                                          gboolean new_item);
VALA_EXTERN void spice_widgets_toolbar_update_properties (SpiceWidgetsToolbar* self);
VALA_EXTERN void spice_widgets_toolbar_select_item (SpiceWidgetsToolbar* self,
                                        SpiceCanvasItem* item_,
                                        gboolean new_item);
static void spice_widgets_toolbar_real_item_selected (SpiceWidgetsToolbar* self,
                                               SpiceCanvasItem* item,
                                               gboolean new_item);
static void spice_widgets_toolbar_real_update_properties (SpiceWidgetsToolbar* self);
VALA_EXTERN SpiceWidgetsToolbar* spice_widgets_toolbar_construct (GType object_type);
static GObject * spice_widgets_toolbar_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void spice_widgets_toolbar_finalize (GObject * obj);
static GType spice_widgets_toolbar_get_type_once (void);

static gpointer
_g_object_ref0 (gpointer self)
{
#line 35 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	return self ? g_object_ref (self) : NULL;
#line 118 "Toolbar.c"
}

void
spice_widgets_toolbar_select_item (SpiceWidgetsToolbar* self,
                                   SpiceCanvasItem* item_,
                                   gboolean new_item)
{
	SpiceCanvasItem* _tmp0_;
	gboolean _tmp1_ = FALSE;
#line 33 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	g_return_if_fail (self != NULL);
#line 34 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self->selecting = TRUE;
#line 35 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	_tmp0_ = _g_object_ref0 (item_);
#line 35 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	_g_object_unref0 (self->item);
#line 35 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self->item = _tmp0_;
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	if (new_item) {
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
		_tmp1_ = self->init;
#line 142 "Toolbar.c"
	} else {
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
		_tmp1_ = FALSE;
#line 146 "Toolbar.c"
	}
#line 36 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	spice_widgets_toolbar_item_selected (self, item_, _tmp1_);
#line 37 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self->selecting = FALSE;
#line 38 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self->init = TRUE;
#line 154 "Toolbar.c"
}

static void
spice_widgets_toolbar_real_item_selected (SpiceWidgetsToolbar* self,
                                          SpiceCanvasItem* item,
                                          gboolean new_item)
{
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	g_critical ("Type `%s' does not implement abstract method `spice_widgets_toolbar_item_selected'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	return;
#line 166 "Toolbar.c"
}

void
spice_widgets_toolbar_item_selected (SpiceWidgetsToolbar* self,
                                     SpiceCanvasItem* item,
                                     gboolean new_item)
{
	SpiceWidgetsToolbarClass* _klass_;
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	g_return_if_fail (self != NULL);
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	_klass_ = SPICE_WIDGETS_TOOLBAR_GET_CLASS (self);
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	if (_klass_->item_selected) {
#line 41 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
		_klass_->item_selected (self, item, new_item);
#line 183 "Toolbar.c"
	}
}

static void
spice_widgets_toolbar_real_update_properties (SpiceWidgetsToolbar* self)
{
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	g_critical ("Type `%s' does not implement abstract method `spice_widgets_toolbar_update_properties'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	return;
#line 194 "Toolbar.c"
}

void
spice_widgets_toolbar_update_properties (SpiceWidgetsToolbar* self)
{
	SpiceWidgetsToolbarClass* _klass_;
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	g_return_if_fail (self != NULL);
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	_klass_ = SPICE_WIDGETS_TOOLBAR_GET_CLASS (self);
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	if (_klass_->update_properties) {
#line 43 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
		_klass_->update_properties (self);
#line 209 "Toolbar.c"
	}
}

SpiceWidgetsToolbar*
spice_widgets_toolbar_construct (GType object_type)
{
	SpiceWidgetsToolbar * self = NULL;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self = (SpiceWidgetsToolbar*) g_object_new (object_type, NULL);
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	return self;
#line 221 "Toolbar.c"
}

static GObject *
spice_widgets_toolbar_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SpiceWidgetsToolbar * self;
#line 27 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	parent_class = G_OBJECT_CLASS (spice_widgets_toolbar_parent_class);
#line 27 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 27 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbar);
#line 28 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_HORIZONTAL);
#line 29 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	gtk_box_set_spacing ((GtkBox*) self, 12);
#line 30 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 6);
#line 27 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	return obj;
#line 246 "Toolbar.c"
}

static void
spice_widgets_toolbar_class_init (SpiceWidgetsToolbarClass * klass,
                                  gpointer klass_data)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	spice_widgets_toolbar_parent_class = g_type_class_peek_parent (klass);
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	((SpiceWidgetsToolbarClass *) klass)->item_selected = (void (*) (SpiceWidgetsToolbar*, SpiceCanvasItem*, gboolean)) spice_widgets_toolbar_real_item_selected;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	((SpiceWidgetsToolbarClass *) klass)->update_properties = (void (*) (SpiceWidgetsToolbar*)) spice_widgets_toolbar_real_update_properties;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	G_OBJECT_CLASS (klass)->constructor = spice_widgets_toolbar_constructor;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	G_OBJECT_CLASS (klass)->finalize = spice_widgets_toolbar_finalize;
#line 263 "Toolbar.c"
}

static void
spice_widgets_toolbar_instance_init (SpiceWidgetsToolbar * self,
                                     gpointer klass)
{
#line 23 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self->init = FALSE;
#line 24 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self->selecting = FALSE;
#line 274 "Toolbar.c"
}

static void
spice_widgets_toolbar_finalize (GObject * obj)
{
	SpiceWidgetsToolbar * self;
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_WIDGETS_TYPE_TOOLBAR, SpiceWidgetsToolbar);
#line 25 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	_g_object_unref0 (self->item);
#line 22 "../Spice-up-1.9.1/src/Widgets/Toolbars/Toolbar.vala"
	G_OBJECT_CLASS (spice_widgets_toolbar_parent_class)->finalize (obj);
#line 287 "Toolbar.c"
}

static GType
spice_widgets_toolbar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpiceWidgetsToolbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spice_widgets_toolbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpiceWidgetsToolbar), 0, (GInstanceInitFunc) spice_widgets_toolbar_instance_init, NULL };
	GType spice_widgets_toolbar_type_id;
	spice_widgets_toolbar_type_id = g_type_register_static (gtk_box_get_type (), "SpiceWidgetsToolbar", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return spice_widgets_toolbar_type_id;
}

GType
spice_widgets_toolbar_get_type (void)
{
	static volatile gsize spice_widgets_toolbar_type_id__once = 0;
	if (g_once_init_enter (&spice_widgets_toolbar_type_id__once)) {
		GType spice_widgets_toolbar_type_id;
		spice_widgets_toolbar_type_id = spice_widgets_toolbar_get_type_once ();
		g_once_init_leave (&spice_widgets_toolbar_type_id__once, spice_widgets_toolbar_type_id);
	}
	return spice_widgets_toolbar_type_id__once;
}

