File: rb-sample-vala-plugin.c

package info (click to toggle)
rhythmbox 2.97-2.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 40,820 kB
  • sloc: ansic: 117,691; xml: 28,786; sh: 11,150; python: 3,862; makefile: 2,561
file content (219 lines) | stat: -rw-r--r-- 8,177 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/* rb-sample-vala-plugin.c generated by valac 0.15.1.37-d2de1, 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_;
	self = (SampleValaPlugin*) base;
	_tmp0_ = stdout;
	fprintf (_tmp0_, "Hello world\n");
}


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


static void sample_vala_plugin_real_update_state (PeasActivatable* base) {
	SampleValaPlugin * self;
	FILE* _tmp0_;
	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_;
	GObject* _tmp1_;
	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_;
	GObject* _tmp1_;
	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 = SAMPLE_VALA_PLUGIN (obj);
	_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 = SAMPLE_VALA_PLUGIN (object);
	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 = SAMPLE_VALA_PLUGIN (object);
	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) {
	GTypeModule* _tmp0_;
	PeasObjectModule* _tmp1_;
	PeasObjectModule* objmodule;
	FILE* _tmp2_;
	g_return_if_fail (module != NULL);
	sample_vala_plugin_register_type (module);
	_tmp0_ = module;
	_tmp1_ = _g_object_ref0 (PEAS_IS_OBJECT_MODULE (_tmp0_) ? ((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);
}