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

/*
* Copyright 2019-2022 elementary, Inc. (https://elementary.io)
*
* 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 3 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>
#include <float.h>
#include <math.h>
#include <granite-7.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_ABSTRACT_VIEW (abstract_view_get_type ())
#define ABSTRACT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ABSTRACT_VIEW, AbstractView))
#define ABSTRACT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ABSTRACT_VIEW, AbstractViewClass))
#define IS_ABSTRACT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ABSTRACT_VIEW))
#define IS_ABSTRACT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ABSTRACT_VIEW))
#define ABSTRACT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ABSTRACT_VIEW, AbstractViewClass))

typedef struct _AbstractView AbstractView;
typedef struct _AbstractViewClass AbstractViewClass;
typedef struct _AbstractViewPrivate AbstractViewPrivate;
enum  {
	ABSTRACT_VIEW_0_PROPERTY,
	ABSTRACT_VIEW_NUM_PROPERTIES
};
static GParamSpec* abstract_view_properties[ABSTRACT_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _AbstractView {
	GtkBox parent_instance;
	AbstractViewPrivate * priv;
	GtkBox* button_box;
	GtkGrid* content_area;
	GtkImage* badge;
	GtkLabel* primary_label;
	GtkLabel* secondary_label;
};

struct _AbstractViewClass {
	GtkBoxClass parent_class;
};

static gpointer abstract_view_parent_class = NULL;

VALA_EXTERN GType abstract_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AbstractView, g_object_unref)
VALA_EXTERN AbstractView* abstract_view_construct (GType object_type);
static GObject * abstract_view_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties);
static void abstract_view_finalize (GObject * obj);
static GType abstract_view_get_type_once (void);

AbstractView*
abstract_view_construct (GType object_type)
{
	AbstractView * self = NULL;
	self = (AbstractView*) g_object_new (object_type, NULL);
	return self;
}

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

static GObject *
abstract_view_constructor (GType type,
                           guint n_construct_properties,
                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	AbstractView * self;
	GtkImage* image = NULL;
	GtkImage* _tmp0_ = NULL;
	GtkImage* _tmp1_ = NULL;
	GtkOverlay* overlay = NULL;
	GtkImage* _tmp2_;
	GtkWidget* _tmp3_;
	GtkOverlay* _tmp4_ = NULL;
	GtkOverlay* _tmp5_;
	GtkImage* _tmp6_;
	GtkLabel* _tmp7_ = NULL;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_ = NULL;
	GtkGrid* _tmp10_ = NULL;
	GtkBox* _tmp11_ = NULL;
	GtkBox* _tmp12_;
	GtkGrid* message_grid = NULL;
	GtkGrid* _tmp13_ = NULL;
	GtkGrid* _tmp14_;
	GtkOverlay* _tmp15_;
	GtkGrid* _tmp16_;
	GtkLabel* _tmp17_;
	GtkGrid* _tmp18_;
	GtkLabel* _tmp19_;
	GtkGrid* _tmp20_;
	GtkGrid* _tmp21_;
	GtkGrid* _tmp22_;
	GtkGrid* _tmp23_;
	GtkBox* _tmp24_;
	parent_class = G_OBJECT_CLASS (abstract_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ABSTRACT_VIEW, AbstractView);
	_tmp0_ = (GtkImage*) gtk_image_new_from_icon_name ("io.elementary.sideload");
	gtk_image_set_pixel_size (_tmp0_, 48);
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp0_);
	image = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new ();
	gtk_image_set_pixel_size (_tmp1_, 24);
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->badge);
	self->badge = _tmp1_;
	_tmp2_ = image;
	_tmp3_ = _g_object_ref0 ((GtkWidget*) _tmp2_);
	_tmp4_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_overlay_set_child (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp4_);
	overlay = _tmp4_;
	_tmp5_ = overlay;
	_tmp6_ = self->badge;
	gtk_overlay_add_overlay (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_label_set_max_width_chars (_tmp7_, 1);
	gtk_label_set_selectable (_tmp7_, TRUE);
	gtk_label_set_wrap (_tmp7_, TRUE);
	gtk_label_set_xalign (_tmp7_, (gfloat) 0);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->primary_label);
	self->primary_label = _tmp7_;
	_tmp8_ = self->primary_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp8_, GRANITE_STYLE_CLASS_TITLE_LABEL);
	_tmp9_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp9_, 18);
	gtk_label_set_max_width_chars (_tmp9_, 50);
	gtk_label_set_selectable (_tmp9_, TRUE);
	gtk_label_set_use_markup (_tmp9_, TRUE);
	gtk_label_set_width_chars (_tmp9_, 50);
	gtk_label_set_wrap (_tmp9_, TRUE);
	gtk_label_set_xalign (_tmp9_, (gfloat) 0);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->secondary_label);
	self->secondary_label = _tmp9_;
	_tmp10_ = (GtkGrid*) gtk_grid_new ();
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp10_, GTK_ORIENTATION_VERTICAL);
	gtk_grid_set_row_spacing (_tmp10_, 6);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->content_area);
	self->content_area = _tmp10_;
	_tmp11_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_box_set_homogeneous (_tmp11_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp11_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp11_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->button_box);
	self->button_box = _tmp11_;
	_tmp12_ = self->button_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "dialog-action-area");
	_tmp13_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp13_, 12);
	gtk_grid_set_row_spacing (_tmp13_, 6);
	g_object_ref_sink (_tmp13_);
	message_grid = _tmp13_;
	_tmp14_ = message_grid;
	_tmp15_ = overlay;
	gtk_grid_attach (_tmp14_, (GtkWidget*) _tmp15_, 0, 0, 1, 2);
	_tmp16_ = message_grid;
	_tmp17_ = self->primary_label;
	gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 1, 0, 1, 1);
	_tmp18_ = message_grid;
	_tmp19_ = self->secondary_label;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 1, 1, 1, 1);
	_tmp20_ = message_grid;
	_tmp21_ = self->content_area;
	gtk_grid_attach (_tmp20_, (GtkWidget*) _tmp21_, 1, 2, 1, 1);
	_tmp22_ = message_grid;
	gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "dialog-content-area");
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp23_ = message_grid;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp23_);
	_tmp24_ = self->button_box;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp24_);
	gtk_widget_add_css_class ((GtkWidget*) self, "dialog-vbox");
	_g_object_unref0 (message_grid);
	_g_object_unref0 (overlay);
	_g_object_unref0 (image);
	return obj;
}

static void
abstract_view_class_init (AbstractViewClass * klass,
                          gpointer klass_data)
{
	abstract_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = abstract_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = abstract_view_finalize;
}

static void
abstract_view_instance_init (AbstractView * self,
                             gpointer klass)
{
}

static void
abstract_view_finalize (GObject * obj)
{
	AbstractView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ABSTRACT_VIEW, AbstractView);
	_g_object_unref0 (self->button_box);
	_g_object_unref0 (self->content_area);
	_g_object_unref0 (self->badge);
	_g_object_unref0 (self->primary_label);
	_g_object_unref0 (self->secondary_label);
	G_OBJECT_CLASS (abstract_view_parent_class)->finalize (obj);
}

static GType
abstract_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AbstractViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) abstract_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AbstractView), 0, (GInstanceInitFunc) abstract_view_instance_init, NULL };
	GType abstract_view_type_id;
	abstract_view_type_id = g_type_register_static (gtk_box_get_type (), "AbstractView", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return abstract_view_type_id;
}

GType
abstract_view_get_type (void)
{
	static volatile gsize abstract_view_type_id__once = 0;
	if (g_once_init_enter (&abstract_view_type_id__once)) {
		GType abstract_view_type_id;
		abstract_view_type_id = abstract_view_get_type_once ();
		g_once_init_leave (&abstract_view_type_id__once, abstract_view_type_id);
	}
	return abstract_view_type_id__once;
}

