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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>

#define TOOTLE_WIDGETS_TYPE_TIMELINE_MENU (tootle_widgets_timeline_menu_get_type ())
#define TOOTLE_WIDGETS_TIMELINE_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_TIMELINE_MENU, TootleWidgetsTimelineMenu))
#define TOOTLE_WIDGETS_TIMELINE_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_TIMELINE_MENU, TootleWidgetsTimelineMenuClass))
#define TOOTLE_WIDGETS_IS_TIMELINE_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_TIMELINE_MENU))
#define TOOTLE_WIDGETS_IS_TIMELINE_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_TIMELINE_MENU))
#define TOOTLE_WIDGETS_TIMELINE_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_TIMELINE_MENU, TootleWidgetsTimelineMenuClass))

typedef struct _TootleWidgetsTimelineMenu TootleWidgetsTimelineMenu;
typedef struct _TootleWidgetsTimelineMenuClass TootleWidgetsTimelineMenuClass;
typedef struct _TootleWidgetsTimelineMenuPrivate TootleWidgetsTimelineMenuPrivate;
enum  {
	TOOTLE_WIDGETS_TIMELINE_MENU_0_PROPERTY,
	TOOTLE_WIDGETS_TIMELINE_MENU_NUM_PROPERTIES
};
static GParamSpec* tootle_widgets_timeline_menu_properties[TOOTLE_WIDGETS_TIMELINE_MENU_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _TootleWidgetsTimelineMenu {
	GtkMenuButton parent_instance;
	TootleWidgetsTimelineMenuPrivate * priv;
	GtkLabel* title;
	GtkLabel* subtitle;
};

struct _TootleWidgetsTimelineMenuClass {
	GtkMenuButtonClass parent_class;
};

static gpointer tootle_widgets_timeline_menu_parent_class = NULL;

GType tootle_widgets_timeline_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsTimelineMenu, g_object_unref)
TootleWidgetsTimelineMenu* tootle_widgets_timeline_menu_new (const gchar* id);
TootleWidgetsTimelineMenu* tootle_widgets_timeline_menu_construct (GType object_type,
                                                                   const gchar* id);
#define BUILD_RESOURCES "/com/github/bleakgrey/tootle/"
static void tootle_widgets_timeline_menu_finalize (GObject * obj);
static GType tootle_widgets_timeline_menu_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

TootleWidgetsTimelineMenu*
tootle_widgets_timeline_menu_construct (GType object_type,
                                        const gchar* id)
{
	TootleWidgetsTimelineMenu * self = NULL;
	GtkBuilder* builder = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkBuilder* _tmp3_;
	GtkBuilder* _tmp4_;
	GObject* _tmp5_;
	g_return_val_if_fail (id != NULL, NULL);
	self = (TootleWidgetsTimelineMenu*) g_object_new (object_type, NULL);
	_tmp0_ = string_to_string (BUILD_RESOURCES);
	_tmp1_ = g_strconcat (_tmp0_, "ui/menus.ui", NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_builder_new_from_resource (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	builder = _tmp4_;
	_tmp5_ = gtk_builder_get_object (builder, id);
	gtk_menu_button_set_menu_model ((GtkMenuButton*) self, G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, g_menu_model_get_type ()) ? ((GMenuModel*) _tmp5_) : NULL);
	_g_object_unref0 (builder);
	return self;
}

TootleWidgetsTimelineMenu*
tootle_widgets_timeline_menu_new (const gchar* id)
{
	return tootle_widgets_timeline_menu_construct (TOOTLE_WIDGETS_TYPE_TIMELINE_MENU, id);
}

static void
tootle_widgets_timeline_menu_class_init (TootleWidgetsTimelineMenuClass * klass,
                                         gpointer klass_data)
{
	tootle_widgets_timeline_menu_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = tootle_widgets_timeline_menu_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/com/github/bleakgrey/tootle/ui/widgets/timeline_menu.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, G_STRUCT_OFFSET (TootleWidgetsTimelineMenu, title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "subtitle", FALSE, G_STRUCT_OFFSET (TootleWidgetsTimelineMenu, subtitle));
}

static void
tootle_widgets_timeline_menu_instance_init (TootleWidgetsTimelineMenu * self,
                                            gpointer klass)
{
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tootle_widgets_timeline_menu_finalize (GObject * obj)
{
	TootleWidgetsTimelineMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_WIDGETS_TYPE_TIMELINE_MENU, TootleWidgetsTimelineMenu);
	G_OBJECT_CLASS (tootle_widgets_timeline_menu_parent_class)->finalize (obj);
}

static GType
tootle_widgets_timeline_menu_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleWidgetsTimelineMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_widgets_timeline_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleWidgetsTimelineMenu), 0, (GInstanceInitFunc) tootle_widgets_timeline_menu_instance_init, NULL };
	GType tootle_widgets_timeline_menu_type_id;
	tootle_widgets_timeline_menu_type_id = g_type_register_static (gtk_menu_button_get_type (), "TootleWidgetsTimelineMenu", &g_define_type_info, 0);
	return tootle_widgets_timeline_menu_type_id;
}

GType
tootle_widgets_timeline_menu_get_type (void)
{
	static volatile gsize tootle_widgets_timeline_menu_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_widgets_timeline_menu_type_id__volatile)) {
		GType tootle_widgets_timeline_menu_type_id;
		tootle_widgets_timeline_menu_type_id = tootle_widgets_timeline_menu_get_type_once ();
		g_once_init_leave (&tootle_widgets_timeline_menu_type_id__volatile, tootle_widgets_timeline_menu_type_id);
	}
	return tootle_widgets_timeline_menu_type_id__volatile;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

