/* rb-sample-vala-plugin.c generated by valac 0.32.1, the Vala compiler
 * generated from rb-sample-vala-plugin.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <libpeas/peas.h>
#include <stdio.h>


#define TYPE_SAMPLE_VALA_PLUGIN (sample_vala_plugin_get_type ())
#define SAMPLE_VALA_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SAMPLE_VALA_PLUGIN, SampleValaPlugin))
#define SAMPLE_VALA_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SAMPLE_VALA_PLUGIN, SampleValaPluginClass))
#define IS_SAMPLE_VALA_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SAMPLE_VALA_PLUGIN))
#define IS_SAMPLE_VALA_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SAMPLE_VALA_PLUGIN))
#define SAMPLE_VALA_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SAMPLE_VALA_PLUGIN, SampleValaPluginClass))

typedef struct _SampleValaPlugin SampleValaPlugin;
typedef struct _SampleValaPluginClass SampleValaPluginClass;
typedef struct _SampleValaPluginPrivate SampleValaPluginPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _SampleValaPlugin {
	PeasExtensionBase parent_instance;
	SampleValaPluginPrivate * priv;
};

struct _SampleValaPluginClass {
	PeasExtensionBaseClass parent_class;
};

struct _SampleValaPluginPrivate {
	GObject* _object;
};


static gpointer sample_vala_plugin_parent_class = NULL;
static PeasActivatableInterface* sample_vala_plugin_peas_activatable_parent_iface = NULL;
static GType sample_vala_plugin_type_id = 0;

GType sample_vala_plugin_get_type (void) G_GNUC_CONST;
GType sample_vala_plugin_register_type (GTypeModule * module);
#define SAMPLE_VALA_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SAMPLE_VALA_PLUGIN, SampleValaPluginPrivate))
enum  {
	SAMPLE_VALA_PLUGIN_DUMMY_PROPERTY,
	SAMPLE_VALA_PLUGIN_OBJECT
};
static void sample_vala_plugin_real_activate (PeasActivatable* base);
static void sample_vala_plugin_real_deactivate (PeasActivatable* base);
static void sample_vala_plugin_real_update_state (PeasActivatable* base);
SampleValaPlugin* sample_vala_plugin_new (void);
SampleValaPlugin* sample_vala_plugin_construct (GType object_type);
static void sample_vala_plugin_finalize (GObject* obj);
static void _vala_sample_vala_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_sample_vala_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
void peas_register_types (GTypeModule* module);


static void sample_vala_plugin_real_activate (PeasActivatable* base) {
	SampleValaPlugin * self;
	FILE* _tmp0_ = NULL;
	self = (SampleValaPlugin*) base;
	_tmp0_ = stdout;
	fprintf (_tmp0_, "Hello world\n");
}


static void sample_vala_plugin_real_deactivate (PeasActivatable* base) {
	SampleValaPlugin * self;
	FILE* _tmp0_ = NULL;
	self = (SampleValaPlugin*) base;
	_tmp0_ = stdout;
	fprintf (_tmp0_, "Goodbye world\n");
}


static void sample_vala_plugin_real_update_state (PeasActivatable* base) {
	SampleValaPlugin * self;
	FILE* _tmp0_ = NULL;
	self = (SampleValaPlugin*) base;
	_tmp0_ = stdout;
	fprintf (_tmp0_, "Update world\n");
}


SampleValaPlugin* sample_vala_plugin_construct (GType object_type) {
	SampleValaPlugin * self = NULL;
	self = (SampleValaPlugin*) g_object_new (object_type, NULL);
	return self;
}


SampleValaPlugin* sample_vala_plugin_new (void) {
	return sample_vala_plugin_construct (TYPE_SAMPLE_VALA_PLUGIN);
}


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


static GObject* sample_vala_plugin_real_get_object (PeasActivatable* base) {
	GObject* result;
	SampleValaPlugin* self;
	GObject* _tmp0_ = NULL;
	GObject* _tmp1_ = NULL;
	self = (SampleValaPlugin*) base;
	_tmp0_ = self->priv->_object;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


static void sample_vala_plugin_real_set_object (PeasActivatable* base, GObject* value) {
	SampleValaPlugin* self;
	GObject* _tmp0_ = NULL;
	GObject* _tmp1_ = NULL;
	self = (SampleValaPlugin*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_object);
	self->priv->_object = _tmp1_;
	g_object_notify ((GObject *) self, "object");
}


static void sample_vala_plugin_class_init (SampleValaPluginClass * klass) {
	sample_vala_plugin_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (SampleValaPluginPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_sample_vala_plugin_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sample_vala_plugin_set_property;
	G_OBJECT_CLASS (klass)->finalize = sample_vala_plugin_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SAMPLE_VALA_PLUGIN_OBJECT, g_param_spec_object ("object", "object", "object", G_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void sample_vala_plugin_peas_activatable_interface_init (PeasActivatableInterface * iface) {
	sample_vala_plugin_peas_activatable_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate = (void (*)(PeasActivatable*)) sample_vala_plugin_real_activate;
	iface->deactivate = (void (*)(PeasActivatable*)) sample_vala_plugin_real_deactivate;
	iface->update_state = (void (*)(PeasActivatable*)) sample_vala_plugin_real_update_state;
}


static void sample_vala_plugin_instance_init (SampleValaPlugin * self) {
	self->priv = SAMPLE_VALA_PLUGIN_GET_PRIVATE (self);
}


static void sample_vala_plugin_finalize (GObject* obj) {
	SampleValaPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SAMPLE_VALA_PLUGIN, SampleValaPlugin);
	_g_object_unref0 (self->priv->_object);
	G_OBJECT_CLASS (sample_vala_plugin_parent_class)->finalize (obj);
}


GType sample_vala_plugin_get_type (void) {
	return sample_vala_plugin_type_id;
}


GType sample_vala_plugin_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (SampleValaPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sample_vala_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SampleValaPlugin), 0, (GInstanceInitFunc) sample_vala_plugin_instance_init, NULL };
	static const GInterfaceInfo peas_activatable_info = { (GInterfaceInitFunc) sample_vala_plugin_peas_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	sample_vala_plugin_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "SampleValaPlugin", &g_define_type_info, 0);
	g_type_module_add_interface (module, sample_vala_plugin_type_id, peas_activatable_get_type (), &peas_activatable_info);
	return sample_vala_plugin_type_id;
}


static void _vala_sample_vala_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	SampleValaPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SAMPLE_VALA_PLUGIN, SampleValaPlugin);
	switch (property_id) {
		case SAMPLE_VALA_PLUGIN_OBJECT:
		g_value_take_object (value, sample_vala_plugin_real_get_object ((PeasActivatable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_sample_vala_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	SampleValaPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SAMPLE_VALA_PLUGIN, SampleValaPlugin);
	switch (property_id) {
		case SAMPLE_VALA_PLUGIN_OBJECT:
		sample_vala_plugin_real_set_object ((PeasActivatable*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


void peas_register_types (GTypeModule* module) {
	PeasObjectModule* objmodule = NULL;
	GTypeModule* _tmp0_ = NULL;
	PeasObjectModule* _tmp1_ = NULL;
	FILE* _tmp2_ = NULL;
	g_return_if_fail (module != NULL);
	sample_vala_plugin_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_;
	_tmp2_ = stdout;
	fprintf (_tmp2_, "Registering plugin %s\n", "SampleValaPlugin");
	peas_object_module_register_extension_type (objmodule, peas_activatable_get_type (), TYPE_SAMPLE_VALA_PLUGIN);
	_g_object_unref0 (objmodule);
}



