/* WorkspacesApplet.c generated by valac 0.32.1, the Vala compiler
 * generated from WorkspacesApplet.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_WORKSPACES_PLUGIN (workspaces_plugin_get_type ())
#define WORKSPACES_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WORKSPACES_PLUGIN, WorkspacesPlugin))
#define WORKSPACES_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WORKSPACES_PLUGIN, WorkspacesPluginClass))
#define IS_WORKSPACES_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WORKSPACES_PLUGIN))
#define IS_WORKSPACES_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WORKSPACES_PLUGIN))
#define WORKSPACES_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WORKSPACES_PLUGIN, WorkspacesPluginClass))

typedef struct _WorkspacesPlugin WorkspacesPlugin;
typedef struct _WorkspacesPluginClass WorkspacesPluginClass;
typedef struct _WorkspacesPluginPrivate WorkspacesPluginPrivate;

#define TYPE_WORKSPACES_APPLET (workspaces_applet_get_type ())
#define WORKSPACES_APPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WORKSPACES_APPLET, WorkspacesApplet))
#define WORKSPACES_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WORKSPACES_APPLET, WorkspacesAppletClass))
#define IS_WORKSPACES_APPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WORKSPACES_APPLET))
#define IS_WORKSPACES_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WORKSPACES_APPLET))
#define WORKSPACES_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WORKSPACES_APPLET, WorkspacesAppletClass))

typedef struct _WorkspacesApplet WorkspacesApplet;
typedef struct _WorkspacesAppletClass WorkspacesAppletClass;
typedef struct _WorkspacesAppletPrivate WorkspacesAppletPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _WorkspacesPlugin {
	PeasExtensionBase parent_instance;
	WorkspacesPluginPrivate * priv;
};

struct _WorkspacesPluginClass {
	PeasExtensionBaseClass parent_class;
};

struct _WorkspacesApplet {
	BudgieApplet parent_instance;
	WorkspacesAppletPrivate * priv;
};

struct _WorkspacesAppletClass {
	BudgieAppletClass parent_class;
};

struct _WorkspacesAppletPrivate {
	WnckPager* widget;
};


static gpointer workspaces_plugin_parent_class = NULL;
static BudgiePluginIface* workspaces_plugin_budgie_plugin_parent_iface = NULL;
static GType workspaces_plugin_type_id = 0;
static gpointer workspaces_applet_parent_class = NULL;
static GType workspaces_applet_type_id = 0;

GType workspaces_plugin_get_type (void) G_GNUC_CONST;
GType workspaces_plugin_register_type (GTypeModule * module);
enum  {
	WORKSPACES_PLUGIN_DUMMY_PROPERTY
};
static BudgieApplet* workspaces_plugin_real_get_panel_widget (BudgiePlugin* base, const gchar* uuid);
WorkspacesApplet* workspaces_applet_new (void);
WorkspacesApplet* workspaces_applet_construct (GType object_type);
GType workspaces_applet_get_type (void) G_GNUC_CONST;
GType workspaces_applet_register_type (GTypeModule * module);
WorkspacesPlugin* workspaces_plugin_new (void);
WorkspacesPlugin* workspaces_plugin_construct (GType object_type);
#define WORKSPACES_APPLET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_WORKSPACES_APPLET, WorkspacesAppletPrivate))
enum  {
	WORKSPACES_APPLET_DUMMY_PROPERTY
};
static void workspaces_applet_finalize (GObject* obj);
void peas_register_types (GTypeModule* module);


static BudgieApplet* workspaces_plugin_real_get_panel_widget (BudgiePlugin* base, const gchar* uuid) {
	WorkspacesPlugin * self;
	BudgieApplet* result = NULL;
	WorkspacesApplet* _tmp0_ = NULL;
	self = (WorkspacesPlugin*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = workspaces_applet_new ();
	g_object_ref_sink (_tmp0_);
	result = (BudgieApplet*) _tmp0_;
	return result;
}


WorkspacesPlugin* workspaces_plugin_construct (GType object_type) {
	WorkspacesPlugin * self = NULL;
	self = (WorkspacesPlugin*) g_object_new (object_type, NULL);
	return self;
}


WorkspacesPlugin* workspaces_plugin_new (void) {
	return workspaces_plugin_construct (TYPE_WORKSPACES_PLUGIN);
}


static void workspaces_plugin_class_init (WorkspacesPluginClass * klass) {
	workspaces_plugin_parent_class = g_type_class_peek_parent (klass);
}


static void workspaces_plugin_budgie_plugin_interface_init (BudgiePluginIface * iface) {
	workspaces_plugin_budgie_plugin_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_panel_widget = (BudgieApplet* (*)(BudgiePlugin*, const gchar*)) workspaces_plugin_real_get_panel_widget;
}


static void workspaces_plugin_instance_init (WorkspacesPlugin * self) {
}


GType workspaces_plugin_get_type (void) {
	return workspaces_plugin_type_id;
}


GType workspaces_plugin_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (WorkspacesPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) workspaces_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WorkspacesPlugin), 0, (GInstanceInitFunc) workspaces_plugin_instance_init, NULL };
	static const GInterfaceInfo budgie_plugin_info = { (GInterfaceInitFunc) workspaces_plugin_budgie_plugin_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	workspaces_plugin_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "WorkspacesPlugin", &g_define_type_info, 0);
	g_type_module_add_interface (module, workspaces_plugin_type_id, budgie_plugin_get_type (), &budgie_plugin_info);
	return workspaces_plugin_type_id;
}


WorkspacesApplet* workspaces_applet_construct (GType object_type) {
	WorkspacesApplet * self = NULL;
	WnckPager* _tmp0_ = NULL;
	WnckPager* _tmp1_ = NULL;
	WnckPager* _tmp2_ = NULL;
	self = (WorkspacesApplet*) g_object_new (object_type, NULL);
	_tmp0_ = (WnckPager*) wnck_pager_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->widget);
	self->priv->widget = _tmp0_;
	_tmp1_ = self->priv->widget;
	gtk_widget_set_size_request ((GtkWidget*) _tmp1_, 0, 0);
	_tmp2_ = self->priv->widget;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp2_);
	gtk_widget_show_all ((GtkWidget*) self);
	return self;
}


WorkspacesApplet* workspaces_applet_new (void) {
	return workspaces_applet_construct (TYPE_WORKSPACES_APPLET);
}


static void workspaces_applet_class_init (WorkspacesAppletClass * klass) {
	workspaces_applet_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (WorkspacesAppletPrivate));
	G_OBJECT_CLASS (klass)->finalize = workspaces_applet_finalize;
}


static void workspaces_applet_instance_init (WorkspacesApplet * self) {
	self->priv = WORKSPACES_APPLET_GET_PRIVATE (self);
}


static void workspaces_applet_finalize (GObject* obj) {
	WorkspacesApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_WORKSPACES_APPLET, WorkspacesApplet);
	_g_object_unref0 (self->priv->widget);
	G_OBJECT_CLASS (workspaces_applet_parent_class)->finalize (obj);
}


GType workspaces_applet_get_type (void) {
	return workspaces_applet_type_id;
}


GType workspaces_applet_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (WorkspacesAppletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) workspaces_applet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WorkspacesApplet), 0, (GInstanceInitFunc) workspaces_applet_instance_init, NULL };
	workspaces_applet_type_id = g_type_module_register_type (module, budgie_applet_get_type (), "WorkspacesApplet", &g_define_type_info, 0);
	return workspaces_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);
	workspaces_plugin_register_type (module);
	workspaces_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_WORKSPACES_PLUGIN);
	_g_object_unref0 (objmodule);
}



