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

/*
 * This file is part of budgie-desktop
 * 
 * Copyright (C) 2015-2016 Ikey Doherty <ikey@solus-project.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.
 */

#include <glib.h>
#include <glib-object.h>
#include <libpeas/peas.h>
#include <plugin.h>
#include <stdlib.h>
#include <string.h>
#include <libwnck/libwnck.h>
#include <gtk/gtk.h>


#define TYPE_TASKLIST_PLUGIN (tasklist_plugin_get_type ())
#define TASKLIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASKLIST_PLUGIN, TasklistPlugin))
#define TASKLIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASKLIST_PLUGIN, TasklistPluginClass))
#define IS_TASKLIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASKLIST_PLUGIN))
#define IS_TASKLIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASKLIST_PLUGIN))
#define TASKLIST_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASKLIST_PLUGIN, TasklistPluginClass))

typedef struct _TasklistPlugin TasklistPlugin;
typedef struct _TasklistPluginClass TasklistPluginClass;
typedef struct _TasklistPluginPrivate TasklistPluginPrivate;

#define TYPE_TASKLIST_APPLET (tasklist_applet_get_type ())
#define TASKLIST_APPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASKLIST_APPLET, TasklistApplet))
#define TASKLIST_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASKLIST_APPLET, TasklistAppletClass))
#define IS_TASKLIST_APPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASKLIST_APPLET))
#define IS_TASKLIST_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASKLIST_APPLET))
#define TASKLIST_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASKLIST_APPLET, TasklistAppletClass))

typedef struct _TasklistApplet TasklistApplet;
typedef struct _TasklistAppletClass TasklistAppletClass;
typedef struct _TasklistAppletPrivate TasklistAppletPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _TasklistPlugin {
	PeasExtensionBase parent_instance;
	TasklistPluginPrivate * priv;
};

struct _TasklistPluginClass {
	PeasExtensionBaseClass parent_class;
};

struct _TasklistApplet {
	BudgieApplet parent_instance;
	TasklistAppletPrivate * priv;
};

struct _TasklistAppletClass {
	BudgieAppletClass parent_class;
};

struct _TasklistAppletPrivate {
	WnckTasklist* tlist;
};


static gpointer tasklist_plugin_parent_class = NULL;
static BudgiePluginIface* tasklist_plugin_budgie_plugin_parent_iface = NULL;
static GType tasklist_plugin_type_id = 0;
static gpointer tasklist_applet_parent_class = NULL;
static GType tasklist_applet_type_id = 0;

#define icon_size 32
GType tasklist_plugin_get_type (void) G_GNUC_CONST;
GType tasklist_plugin_register_type (GTypeModule * module);
enum  {
	TASKLIST_PLUGIN_DUMMY_PROPERTY
};
static BudgieApplet* tasklist_plugin_real_get_panel_widget (BudgiePlugin* base, const gchar* uuid);
TasklistApplet* tasklist_applet_new (void);
TasklistApplet* tasklist_applet_construct (GType object_type);
GType tasklist_applet_get_type (void) G_GNUC_CONST;
GType tasklist_applet_register_type (GTypeModule * module);
TasklistPlugin* tasklist_plugin_new (void);
TasklistPlugin* tasklist_plugin_construct (GType object_type);
#define TASKLIST_APPLET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TASKLIST_APPLET, TasklistAppletPrivate))
enum  {
	TASKLIST_APPLET_DUMMY_PROPERTY
};
static void tasklist_applet_finalize (GObject* obj);
void peas_register_types (GTypeModule* module);


static BudgieApplet* tasklist_plugin_real_get_panel_widget (BudgiePlugin* base, const gchar* uuid) {
	TasklistPlugin * self;
	BudgieApplet* result = NULL;
	TasklistApplet* _tmp0_ = NULL;
	self = (TasklistPlugin*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = tasklist_applet_new ();
	g_object_ref_sink (_tmp0_);
	result = (BudgieApplet*) _tmp0_;
	return result;
}


TasklistPlugin* tasklist_plugin_construct (GType object_type) {
	TasklistPlugin * self = NULL;
	self = (TasklistPlugin*) g_object_new (object_type, NULL);
	return self;
}


TasklistPlugin* tasklist_plugin_new (void) {
	return tasklist_plugin_construct (TYPE_TASKLIST_PLUGIN);
}


static void tasklist_plugin_class_init (TasklistPluginClass * klass) {
	tasklist_plugin_parent_class = g_type_class_peek_parent (klass);
}


static void tasklist_plugin_budgie_plugin_interface_init (BudgiePluginIface * iface) {
	tasklist_plugin_budgie_plugin_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_panel_widget = (BudgieApplet* (*)(BudgiePlugin*, const gchar*)) tasklist_plugin_real_get_panel_widget;
}


static void tasklist_plugin_instance_init (TasklistPlugin * self) {
}


GType tasklist_plugin_get_type (void) {
	return tasklist_plugin_type_id;
}


GType tasklist_plugin_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (TasklistPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tasklist_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TasklistPlugin), 0, (GInstanceInitFunc) tasklist_plugin_instance_init, NULL };
	static const GInterfaceInfo budgie_plugin_info = { (GInterfaceInitFunc) tasklist_plugin_budgie_plugin_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	tasklist_plugin_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "TasklistPlugin", &g_define_type_info, 0);
	g_type_module_add_interface (module, tasklist_plugin_type_id, budgie_plugin_get_type (), &budgie_plugin_info);
	return tasklist_plugin_type_id;
}


TasklistApplet* tasklist_applet_construct (GType object_type) {
	TasklistApplet * self = NULL;
	WnckTasklist* _tmp0_ = NULL;
	WnckTasklist* _tmp1_ = NULL;
	WnckTasklist* _tmp2_ = NULL;
	self = (TasklistApplet*) g_object_new (object_type, NULL);
	_tmp0_ = (WnckTasklist*) wnck_tasklist_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->tlist);
	self->priv->tlist = _tmp0_;
	_tmp1_ = self->priv->tlist;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->tlist;
	wnck_tasklist_set_grouping (_tmp2_, WNCK_TASKLIST_AUTO_GROUP);
	gtk_widget_show_all ((GtkWidget*) self);
	return self;
}


TasklistApplet* tasklist_applet_new (void) {
	return tasklist_applet_construct (TYPE_TASKLIST_APPLET);
}


static void tasklist_applet_class_init (TasklistAppletClass * klass) {
	tasklist_applet_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (TasklistAppletPrivate));
	G_OBJECT_CLASS (klass)->finalize = tasklist_applet_finalize;
}


static void tasklist_applet_instance_init (TasklistApplet * self) {
	self->priv = TASKLIST_APPLET_GET_PRIVATE (self);
}


static void tasklist_applet_finalize (GObject* obj) {
	TasklistApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TASKLIST_APPLET, TasklistApplet);
	_g_object_unref0 (self->priv->tlist);
	G_OBJECT_CLASS (tasklist_applet_parent_class)->finalize (obj);
}


GType tasklist_applet_get_type (void) {
	return tasklist_applet_type_id;
}


GType tasklist_applet_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (TasklistAppletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tasklist_applet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TasklistApplet), 0, (GInstanceInitFunc) tasklist_applet_instance_init, NULL };
	tasklist_applet_type_id = g_type_module_register_type (module, budgie_applet_get_type (), "TasklistApplet", &g_define_type_info, 0);
	return tasklist_applet_type_id;
}


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


void peas_register_types (GTypeModule* module) {
	PeasObjectModule* objmodule = NULL;
	GTypeModule* _tmp0_ = NULL;
	PeasObjectModule* _tmp1_ = NULL;
	g_return_if_fail (module != NULL);
	tasklist_plugin_register_type (module);
	tasklist_applet_register_type (module);
	_tmp0_ = module;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, peas_object_module_get_type ()) ? ((PeasObjectModule*) _tmp0_) : NULL);
	objmodule = _tmp1_;
	peas_object_module_register_extension_type (objmodule, budgie_plugin_get_type (), TYPE_TASKLIST_PLUGIN);
	_g_object_unref0 (objmodule);
}



