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

/*
* Copyright 2021 elementary, Inc. (https://elementary.io)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/

#include "granite-7.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
#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_DEMO_PAGE (demo_page_get_type ())
#define DEMO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEMO_PAGE, DemoPage))
#define DEMO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEMO_PAGE, DemoPageClass))
#define IS_DEMO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEMO_PAGE))
#define IS_DEMO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEMO_PAGE))
#define DEMO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEMO_PAGE, DemoPageClass))

typedef struct _DemoPage DemoPage;
typedef struct _DemoPageClass DemoPageClass;
typedef struct _DemoPagePrivate DemoPagePrivate;

#define TYPE_HYPER_TEXT_VIEW_GRID (hyper_text_view_grid_get_type ())
#define HYPER_TEXT_VIEW_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HYPER_TEXT_VIEW_GRID, HyperTextViewGrid))
#define HYPER_TEXT_VIEW_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HYPER_TEXT_VIEW_GRID, HyperTextViewGridClass))
#define IS_HYPER_TEXT_VIEW_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HYPER_TEXT_VIEW_GRID))
#define IS_HYPER_TEXT_VIEW_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HYPER_TEXT_VIEW_GRID))
#define HYPER_TEXT_VIEW_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HYPER_TEXT_VIEW_GRID, HyperTextViewGridClass))

typedef struct _HyperTextViewGrid HyperTextViewGrid;
typedef struct _HyperTextViewGridClass HyperTextViewGridClass;
typedef struct _HyperTextViewGridPrivate HyperTextViewGridPrivate;
enum  {
	HYPER_TEXT_VIEW_GRID_0_PROPERTY,
	HYPER_TEXT_VIEW_GRID_NUM_PROPERTIES
};
static GParamSpec* hyper_text_view_grid_properties[HYPER_TEXT_VIEW_GRID_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _DemoPage {
	GraniteToolBox parent_instance;
	DemoPagePrivate * priv;
};

struct _DemoPageClass {
	GraniteToolBoxClass parent_class;
};

struct _HyperTextViewGrid {
	DemoPage parent_instance;
	HyperTextViewGridPrivate * priv;
};

struct _HyperTextViewGridClass {
	DemoPageClass parent_class;
};

static gpointer hyper_text_view_grid_parent_class = NULL;

VALA_EXTERN GType demo_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DemoPage, g_object_unref)
VALA_EXTERN GType hyper_text_view_grid_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (HyperTextViewGrid, g_object_unref)
VALA_EXTERN HyperTextViewGrid* hyper_text_view_grid_new (void);
VALA_EXTERN HyperTextViewGrid* hyper_text_view_grid_construct (GType object_type);
VALA_EXTERN DemoPage* demo_page_new (void);
VALA_EXTERN DemoPage* demo_page_construct (GType object_type);
static GObject * hyper_text_view_grid_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
VALA_EXTERN void demo_page_set_child (DemoPage* self,
                          GtkWidget* value);
static GType hyper_text_view_grid_get_type_once (void);

HyperTextViewGrid*
hyper_text_view_grid_construct (GType object_type)
{
	HyperTextViewGrid * self = NULL;
	self = (HyperTextViewGrid*) demo_page_construct (object_type);
	return self;
}

HyperTextViewGrid*
hyper_text_view_grid_new (void)
{
	return hyper_text_view_grid_construct (TYPE_HYPER_TEXT_VIEW_GRID);
}

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

static GObject *
hyper_text_view_grid_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	HyperTextViewGrid * self;
	GraniteHeaderLabel* hypertext_label = NULL;
	GraniteHeaderLabel* _tmp0_;
	GraniteHyperTextView* hypertext_textview = NULL;
	GraniteHyperTextView* _tmp1_;
	GraniteHyperTextView* _tmp2_;
	GtkTextBuffer* _tmp3_;
	GtkTextBuffer* _tmp4_;
	GtkScrolledWindow* hypertext_scrolled_window = NULL;
	GraniteHyperTextView* _tmp5_;
	GtkWidget* _tmp6_;
	GtkScrolledWindow* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	GraniteBox* box = NULL;
	GraniteBox* _tmp9_ = NULL;
	GraniteBox* _tmp10_;
	GraniteHeaderLabel* _tmp11_;
	GraniteBox* _tmp12_;
	GtkScrolledWindow* _tmp13_;
	GraniteBox* _tmp14_;
	parent_class = G_OBJECT_CLASS (hyper_text_view_grid_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_HYPER_TEXT_VIEW_GRID, HyperTextViewGrid);
	_tmp0_ = granite_header_label_new ("Hold Ctrl and click to follow the link");
	g_object_ref_sink (_tmp0_);
	hypertext_label = _tmp0_;
	_tmp1_ = granite_hyper_text_view_new ();
	g_object_ref_sink (_tmp1_);
	hypertext_textview = _tmp1_;
	_tmp2_ = hypertext_textview;
	_tmp3_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp2_);
	_tmp4_ = _tmp3_;
	g_object_set (_tmp4_, "text", "elementary OS - https://elementary.io/\n" \
"The fast, open and privacy-respecting replacement for Windows and macO" \
"S.", NULL);
	_tmp5_ = hypertext_textview;
	_tmp6_ = _g_object_ref0 ((GtkWidget*) _tmp5_);
	_tmp7_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set ((GtkWidget*) _tmp7_, "height-request", 300, NULL);
	g_object_set ((GtkWidget*) _tmp7_, "width-request", 600, NULL);
	gtk_scrolled_window_set_child (_tmp7_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	gtk_scrolled_window_set_has_frame (_tmp7_, TRUE);
	g_object_ref_sink (_tmp7_);
	hypertext_scrolled_window = _tmp7_;
	_tmp8_ = 12;
	_tmp9_ = granite_box_new (GTK_ORIENTATION_VERTICAL, GRANITE_BOX_SPACING_NONE);
	gtk_widget_set_halign ((GtkWidget*) _tmp9_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp9_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp9_, _tmp8_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp9_, _tmp8_);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp9_, _tmp8_);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp9_, _tmp8_);
	g_object_ref_sink (_tmp9_);
	box = _tmp9_;
	_tmp10_ = box;
	_tmp11_ = hypertext_label;
	gtk_box_append ((GtkBox*) _tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = box;
	_tmp13_ = hypertext_scrolled_window;
	gtk_box_append ((GtkBox*) _tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = box;
	demo_page_set_child ((DemoPage*) self, (GtkWidget*) _tmp14_);
	_g_object_unref0 (box);
	_g_object_unref0 (hypertext_scrolled_window);
	_g_object_unref0 (hypertext_textview);
	_g_object_unref0 (hypertext_label);
	return obj;
}

static void
hyper_text_view_grid_class_init (HyperTextViewGridClass * klass,
                                 gpointer klass_data)
{
	hyper_text_view_grid_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = hyper_text_view_grid_constructor;
}

static void
hyper_text_view_grid_instance_init (HyperTextViewGrid * self,
                                    gpointer klass)
{
}

static GType
hyper_text_view_grid_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (HyperTextViewGridClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hyper_text_view_grid_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HyperTextViewGrid), 0, (GInstanceInitFunc) hyper_text_view_grid_instance_init, NULL };
	GType hyper_text_view_grid_type_id;
	hyper_text_view_grid_type_id = g_type_register_static (TYPE_DEMO_PAGE, "HyperTextViewGrid", &g_define_type_info, 0);
	return hyper_text_view_grid_type_id;
}

GType
hyper_text_view_grid_get_type (void)
{
	static volatile gsize hyper_text_view_grid_type_id__once = 0;
	if (g_once_init_enter (&hyper_text_view_grid_type_id__once)) {
		GType hyper_text_view_grid_type_id;
		hyper_text_view_grid_type_id = hyper_text_view_grid_get_type_once ();
		g_once_init_leave (&hyper_text_view_grid_type_id__once, hyper_text_view_grid_type_id);
	}
	return hyper_text_view_grid_type_id__once;
}

