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

/*
* Copyright (c) 2017 Robert San <robertsanseries@gmail.com>
*
* 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., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#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 CIANO_VIEWS_TYPE_CONVERTER_VIEW (ciano_views_converter_view_get_type ())
#define CIANO_VIEWS_CONVERTER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CIANO_VIEWS_TYPE_CONVERTER_VIEW, CianoViewsConverterView))
#define CIANO_VIEWS_CONVERTER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CIANO_VIEWS_TYPE_CONVERTER_VIEW, CianoViewsConverterViewClass))
#define CIANO_VIEWS_IS_CONVERTER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CIANO_VIEWS_TYPE_CONVERTER_VIEW))
#define CIANO_VIEWS_IS_CONVERTER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CIANO_VIEWS_TYPE_CONVERTER_VIEW))
#define CIANO_VIEWS_CONVERTER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CIANO_VIEWS_TYPE_CONVERTER_VIEW, CianoViewsConverterViewClass))

typedef struct _CianoViewsConverterView CianoViewsConverterView;
typedef struct _CianoViewsConverterViewClass CianoViewsConverterViewClass;
typedef struct _CianoViewsConverterViewPrivate CianoViewsConverterViewPrivate;

#define CIANO_WIDGETS_TYPE_HEADER_BAR (ciano_widgets_header_bar_get_type ())
#define CIANO_WIDGETS_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CIANO_WIDGETS_TYPE_HEADER_BAR, CianoWidgetsHeaderBar))
#define CIANO_WIDGETS_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CIANO_WIDGETS_TYPE_HEADER_BAR, CianoWidgetsHeaderBarClass))
#define CIANO_WIDGETS_IS_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CIANO_WIDGETS_TYPE_HEADER_BAR))
#define CIANO_WIDGETS_IS_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CIANO_WIDGETS_TYPE_HEADER_BAR))
#define CIANO_WIDGETS_HEADER_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CIANO_WIDGETS_TYPE_HEADER_BAR, CianoWidgetsHeaderBarClass))

typedef struct _CianoWidgetsHeaderBar CianoWidgetsHeaderBar;
typedef struct _CianoWidgetsHeaderBarClass CianoWidgetsHeaderBarClass;

#define CIANO_WIDGETS_TYPE_SOURCE_LIST (ciano_widgets_source_list_get_type ())
#define CIANO_WIDGETS_SOURCE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CIANO_WIDGETS_TYPE_SOURCE_LIST, CianoWidgetsSourceList))
#define CIANO_WIDGETS_SOURCE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CIANO_WIDGETS_TYPE_SOURCE_LIST, CianoWidgetsSourceListClass))
#define CIANO_WIDGETS_IS_SOURCE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CIANO_WIDGETS_TYPE_SOURCE_LIST))
#define CIANO_WIDGETS_IS_SOURCE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CIANO_WIDGETS_TYPE_SOURCE_LIST))
#define CIANO_WIDGETS_SOURCE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CIANO_WIDGETS_TYPE_SOURCE_LIST, CianoWidgetsSourceListClass))

typedef struct _CianoWidgetsSourceList CianoWidgetsSourceList;
typedef struct _CianoWidgetsSourceListClass CianoWidgetsSourceListClass;

#define CIANO_WIDGETS_TYPE_SOURCE_LIST_SIDEBAR (ciano_widgets_source_list_sidebar_get_type ())
#define CIANO_WIDGETS_SOURCE_LIST_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CIANO_WIDGETS_TYPE_SOURCE_LIST_SIDEBAR, CianoWidgetsSourceListSidebar))
#define CIANO_WIDGETS_SOURCE_LIST_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CIANO_WIDGETS_TYPE_SOURCE_LIST_SIDEBAR, CianoWidgetsSourceListSidebarClass))
#define CIANO_WIDGETS_IS_SOURCE_LIST_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CIANO_WIDGETS_TYPE_SOURCE_LIST_SIDEBAR))
#define CIANO_WIDGETS_IS_SOURCE_LIST_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CIANO_WIDGETS_TYPE_SOURCE_LIST_SIDEBAR))
#define CIANO_WIDGETS_SOURCE_LIST_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CIANO_WIDGETS_TYPE_SOURCE_LIST_SIDEBAR, CianoWidgetsSourceListSidebarClass))

typedef struct _CianoWidgetsSourceListSidebar CianoWidgetsSourceListSidebar;
typedef struct _CianoWidgetsSourceListSidebarClass CianoWidgetsSourceListSidebarClass;

#define CIANO_WIDGETS_TYPE_LIST_CONVERSION (ciano_widgets_list_conversion_get_type ())
#define CIANO_WIDGETS_LIST_CONVERSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CIANO_WIDGETS_TYPE_LIST_CONVERSION, CianoWidgetsListConversion))
#define CIANO_WIDGETS_LIST_CONVERSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CIANO_WIDGETS_TYPE_LIST_CONVERSION, CianoWidgetsListConversionClass))
#define CIANO_WIDGETS_IS_LIST_CONVERSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CIANO_WIDGETS_TYPE_LIST_CONVERSION))
#define CIANO_WIDGETS_IS_LIST_CONVERSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CIANO_WIDGETS_TYPE_LIST_CONVERSION))
#define CIANO_WIDGETS_LIST_CONVERSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CIANO_WIDGETS_TYPE_LIST_CONVERSION, CianoWidgetsListConversionClass))

typedef struct _CianoWidgetsListConversion CianoWidgetsListConversion;
typedef struct _CianoWidgetsListConversionClass CianoWidgetsListConversionClass;
enum  {
	CIANO_VIEWS_CONVERTER_VIEW_0_PROPERTY,
	CIANO_VIEWS_CONVERTER_VIEW_NUM_PROPERTIES
};
static GParamSpec* ciano_views_converter_view_properties[CIANO_VIEWS_CONVERTER_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _CianoViewsConverterView {
	GtkGrid parent_instance;
	CianoViewsConverterViewPrivate * priv;
	CianoWidgetsHeaderBar* headerbar;
	CianoWidgetsSourceListSidebar* source_list;
	CianoWidgetsListConversion* list_conversion;
};

struct _CianoViewsConverterViewClass {
	GtkGridClass parent_class;
};

struct _CianoViewsConverterViewPrivate {
	GtkApplicationWindow* app;
};

static gint CianoViewsConverterView_private_offset;
static gpointer ciano_views_converter_view_parent_class = NULL;

VALA_EXTERN GType ciano_views_converter_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CianoViewsConverterView, g_object_unref)
VALA_EXTERN GType ciano_widgets_header_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CianoWidgetsHeaderBar, g_object_unref)
VALA_EXTERN GType ciano_widgets_source_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CianoWidgetsSourceList, g_object_unref)
VALA_EXTERN GType ciano_widgets_source_list_sidebar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CianoWidgetsSourceListSidebar, g_object_unref)
VALA_EXTERN GType ciano_widgets_list_conversion_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CianoWidgetsListConversion, g_object_unref)
VALA_EXTERN CianoViewsConverterView* ciano_views_converter_view_new (GtkApplicationWindow* app);
VALA_EXTERN CianoViewsConverterView* ciano_views_converter_view_construct (GType object_type,
                                                               GtkApplicationWindow* app);
VALA_EXTERN CianoWidgetsHeaderBar* ciano_widgets_header_bar_new (void);
VALA_EXTERN CianoWidgetsHeaderBar* ciano_widgets_header_bar_construct (GType object_type);
VALA_EXTERN CianoWidgetsSourceListSidebar* ciano_widgets_source_list_sidebar_new (void);
VALA_EXTERN CianoWidgetsSourceListSidebar* ciano_widgets_source_list_sidebar_construct (GType object_type);
VALA_EXTERN CianoWidgetsListConversion* ciano_widgets_list_conversion_new (void);
VALA_EXTERN CianoWidgetsListConversion* ciano_widgets_list_conversion_construct (GType object_type);
static void ciano_views_converter_view_finalize (GObject * obj);
static GType ciano_views_converter_view_get_type_once (void);

static inline gpointer
ciano_views_converter_view_get_instance_private (CianoViewsConverterView* self)
{
	return G_STRUCT_MEMBER_P (self, CianoViewsConverterView_private_offset);
}

/**
         * Constructs a new {@code ConverterView} object responsible for putting
         * together the main structure of the application: header bar, list of options
         * on the left and list of conversions on the right.
         *
         * @see Ciano.Widgets.HeaderBar
         * @see Ciano.Widgets.SourceListSidebar
         * @see Ciano.Widgets.ListConversion
         * @param {@code Gtk.ApplicationWindow} app
         */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

CianoViewsConverterView*
ciano_views_converter_view_construct (GType object_type,
                                      GtkApplicationWindow* app)
{
	CianoViewsConverterView * self = NULL;
	GtkApplicationWindow* _tmp0_;
	GtkApplicationWindow* _tmp1_;
	GtkApplicationWindow* _tmp2_;
	GtkApplicationWindow* _tmp3_;
	GtkApplicationWindow* _tmp4_;
	GtkApplicationWindow* _tmp5_;
	GtkStyleContext* _tmp6_;
	CianoWidgetsHeaderBar* _tmp7_;
	GtkApplicationWindow* _tmp8_;
	CianoWidgetsHeaderBar* _tmp9_;
	CianoWidgetsSourceListSidebar* _tmp10_;
	GtkFrame* frame = NULL;
	GtkFrame* _tmp11_;
	CianoWidgetsSourceListSidebar* _tmp12_;
	CianoWidgetsListConversion* _tmp13_;
	GtkPaned* paned = NULL;
	GtkPaned* _tmp14_;
	CianoWidgetsListConversion* _tmp15_;
	g_return_val_if_fail (app != NULL, NULL);
	self = (CianoViewsConverterView*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (app);
	_g_object_unref0 (self->priv->app);
	self->priv->app = _tmp0_;
	_tmp1_ = self->priv->app;
	gtk_window_set_default_size ((GtkWindow*) _tmp1_, 800, 600);
	_tmp2_ = self->priv->app;
	gtk_widget_set_size_request ((GtkWidget*) _tmp2_, 640, 480);
	_tmp3_ = self->priv->app;
	gtk_window_set_deletable ((GtkWindow*) _tmp3_, TRUE);
	_tmp4_ = self->priv->app;
	gtk_window_set_resizable ((GtkWindow*) _tmp4_, TRUE);
	_tmp5_ = self->priv->app;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_add_class (_tmp6_, "window-background-color");
	_tmp7_ = ciano_widgets_header_bar_new ();
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->headerbar);
	self->headerbar = _tmp7_;
	_tmp8_ = self->priv->app;
	_tmp9_ = self->headerbar;
	gtk_window_set_titlebar ((GtkWindow*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = ciano_widgets_source_list_sidebar_new ();
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->source_list);
	self->source_list = _tmp10_;
	_tmp11_ = (GtkFrame*) gtk_frame_new (NULL);
	g_object_ref_sink (_tmp11_);
	frame = _tmp11_;
	_tmp12_ = self->source_list;
	gtk_container_add ((GtkContainer*) frame, (GtkWidget*) _tmp12_);
	g_object_set ((GtkWidget*) frame, "width-request", 185, NULL);
	_tmp13_ = ciano_widgets_list_conversion_new ();
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->list_conversion);
	self->list_conversion = _tmp13_;
	_tmp14_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp14_);
	paned = _tmp14_;
	gtk_paned_pack1 (paned, (GtkWidget*) frame, FALSE, FALSE);
	_tmp15_ = self->list_conversion;
	gtk_paned_pack2 (paned, (GtkWidget*) _tmp15_, TRUE, FALSE);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) paned);
	_g_object_unref0 (paned);
	_g_object_unref0 (frame);
	return self;
}

CianoViewsConverterView*
ciano_views_converter_view_new (GtkApplicationWindow* app)
{
	return ciano_views_converter_view_construct (CIANO_VIEWS_TYPE_CONVERTER_VIEW, app);
}

static void
ciano_views_converter_view_class_init (CianoViewsConverterViewClass * klass,
                                       gpointer klass_data)
{
	ciano_views_converter_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CianoViewsConverterView_private_offset);
	G_OBJECT_CLASS (klass)->finalize = ciano_views_converter_view_finalize;
}

static void
ciano_views_converter_view_instance_init (CianoViewsConverterView * self,
                                          gpointer klass)
{
	self->priv = ciano_views_converter_view_get_instance_private (self);
}

static void
ciano_views_converter_view_finalize (GObject * obj)
{
	CianoViewsConverterView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CIANO_VIEWS_TYPE_CONVERTER_VIEW, CianoViewsConverterView);
	_g_object_unref0 (self->priv->app);
	_g_object_unref0 (self->headerbar);
	_g_object_unref0 (self->source_list);
	_g_object_unref0 (self->list_conversion);
	G_OBJECT_CLASS (ciano_views_converter_view_parent_class)->finalize (obj);
}

/**
     * The {@code Settings} class is responsible for defining all 
     * the texts that are displayed in the application and must be translated.
     *
     * @see Gtk.Grid
     * @since 0.1.0
     */
static GType
ciano_views_converter_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CianoViewsConverterViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ciano_views_converter_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CianoViewsConverterView), 0, (GInstanceInitFunc) ciano_views_converter_view_instance_init, NULL };
	GType ciano_views_converter_view_type_id;
	ciano_views_converter_view_type_id = g_type_register_static (gtk_grid_get_type (), "CianoViewsConverterView", &g_define_type_info, 0);
	CianoViewsConverterView_private_offset = g_type_add_instance_private (ciano_views_converter_view_type_id, sizeof (CianoViewsConverterViewPrivate));
	return ciano_views_converter_view_type_id;
}

GType
ciano_views_converter_view_get_type (void)
{
	static volatile gsize ciano_views_converter_view_type_id__once = 0;
	if (g_once_init_enter (&ciano_views_converter_view_type_id__once)) {
		GType ciano_views_converter_view_type_id;
		ciano_views_converter_view_type_id = ciano_views_converter_view_get_type_once ();
		g_once_init_leave (&ciano_views_converter_view_type_id__once, ciano_views_converter_view_type_id);
	}
	return ciano_views_converter_view_type_id__once;
}

