Guest User

Untitled

a guest
Feb 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.02 KB | None | 0 0
  1. /* plugin.c generated by valac 0.11.6.96-3939, the Vala compiler
  2. * generated from plugin.vala, do not modify */
  3.  
  4.  
  5. #include <glib.h>
  6. #include <glib-object.h>
  7. #include <libpeas/peas.h>
  8. #include <gtk/gtk.h>
  9. #include <libpeas-gtk/peas-gtk.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12.  
  13.  
  14. #define PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN (peas_demo_vala_hello_plugin_get_type ())
  15. #define PEAS_DEMO_VALA_HELLO_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN, PeasDemoValaHelloPlugin))
  16. #define PEAS_DEMO_VALA_HELLO_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN, PeasDemoValaHelloPluginClass))
  17. #define PEAS_DEMO_IS_VALA_HELLO_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN))
  18. #define PEAS_DEMO_IS_VALA_HELLO_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN))
  19. #define PEAS_DEMO_VALA_HELLO_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN, PeasDemoValaHelloPluginClass))
  20.  
  21. typedef struct _PeasDemoValaHelloPlugin PeasDemoValaHelloPlugin;
  22. typedef struct _PeasDemoValaHelloPluginClass PeasDemoValaHelloPluginClass;
  23. typedef struct _PeasDemoValaHelloPluginPrivate PeasDemoValaHelloPluginPrivate;
  24. #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
  25.  
  26. #define PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG (peas_demo_vala_plugin_config_get_type ())
  27. #define PEAS_DEMO_VALA_PLUGIN_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG, PeasDemoValaPluginConfig))
  28. #define PEAS_DEMO_VALA_PLUGIN_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG, PeasDemoValaPluginConfigClass))
  29. #define PEAS_DEMO_IS_VALA_PLUGIN_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG))
  30. #define PEAS_DEMO_IS_VALA_PLUGIN_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG))
  31. #define PEAS_DEMO_VALA_PLUGIN_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG, PeasDemoValaPluginConfigClass))
  32.  
  33. typedef struct _PeasDemoValaPluginConfig PeasDemoValaPluginConfig;
  34. typedef struct _PeasDemoValaPluginConfigClass PeasDemoValaPluginConfigClass;
  35. typedef struct _PeasDemoValaPluginConfigPrivate PeasDemoValaPluginConfigPrivate;
  36. #define _g_free0(var) (var = (g_free (var), NULL))
  37.  
  38. struct _PeasDemoValaHelloPlugin {
  39. PeasExtensionBase parent_instance;
  40. PeasDemoValaHelloPluginPrivate * priv;
  41. };
  42.  
  43. struct _PeasDemoValaHelloPluginClass {
  44. PeasExtensionBaseClass parent_class;
  45. };
  46.  
  47. struct _PeasDemoValaHelloPluginPrivate {
  48. GtkWidget* label;
  49. GObject* _object;
  50. };
  51.  
  52. struct _PeasDemoValaPluginConfig {
  53. PeasExtensionBase parent_instance;
  54. PeasDemoValaPluginConfigPrivate * priv;
  55. };
  56.  
  57. struct _PeasDemoValaPluginConfigClass {
  58. PeasExtensionBaseClass parent_class;
  59. };
  60.  
  61.  
  62. static gpointer peas_demo_vala_hello_plugin_parent_class = NULL;
  63. static PeasActivatableInterface* peas_demo_vala_hello_plugin_peas_activatable_parent_iface = NULL;
  64. static GType peas_demo_vala_hello_plugin_type_id = 0;
  65. static gpointer peas_demo_vala_plugin_config_parent_class = NULL;
  66. static PeasGtkConfigurableInterface* peas_demo_vala_plugin_config_peas_gtk_configurable_parent_iface = NULL;
  67. static GType peas_demo_vala_plugin_config_type_id = 0;
  68.  
  69. GType peas_demo_vala_hello_plugin_get_type (void) G_GNUC_CONST;
  70. GType peas_demo_vala_hello_plugin_register_type (GTypeModule * module);
  71. #define PEAS_DEMO_VALA_HELLO_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN, PeasDemoValaHelloPluginPrivate))
  72. enum {
  73. PEAS_DEMO_VALA_HELLO_PLUGIN_DUMMY_PROPERTY,
  74. PEAS_DEMO_VALA_HELLO_PLUGIN_OBJECT
  75. };
  76. PeasDemoValaHelloPlugin* peas_demo_vala_hello_plugin_new (void);
  77. PeasDemoValaHelloPlugin* peas_demo_vala_hello_plugin_construct (GType object_type);
  78. static void peas_demo_vala_hello_plugin_real_activate (PeasActivatable* base);
  79. GObject* peas_demo_vala_hello_plugin_get_object (PeasDemoValaHelloPlugin* self);
  80. static void peas_demo_vala_hello_plugin_real_deactivate (PeasActivatable* base);
  81. static void peas_demo_vala_hello_plugin_real_update_state (PeasActivatable* base);
  82. static void peas_demo_vala_hello_plugin_set_object (PeasDemoValaHelloPlugin* self, GObject* value);
  83. static void peas_demo_vala_hello_plugin_finalize (GObject* obj);
  84. static void _vala_peas_demo_vala_hello_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
  85. static void _vala_peas_demo_vala_hello_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
  86. GType peas_demo_vala_plugin_config_get_type (void) G_GNUC_CONST;
  87. GType peas_demo_vala_plugin_config_register_type (GTypeModule * module);
  88. enum {
  89. PEAS_DEMO_VALA_PLUGIN_CONFIG_DUMMY_PROPERTY
  90. };
  91. PeasDemoValaPluginConfig* peas_demo_vala_plugin_config_new (void);
  92. PeasDemoValaPluginConfig* peas_demo_vala_plugin_config_construct (GType object_type);
  93. static GtkWidget* peas_demo_vala_plugin_config_real_create_configure_widget (PeasGtkConfigurable* base);
  94. void peas_register_types (GTypeModule* module);
  95.  
  96.  
  97. PeasDemoValaHelloPlugin* peas_demo_vala_hello_plugin_construct (GType object_type) {
  98. PeasDemoValaHelloPlugin * self = NULL;
  99. self = (PeasDemoValaHelloPlugin*) g_object_new (object_type, NULL);
  100. g_debug ("plugin.vala:8: constructed");
  101. return self;
  102. }
  103.  
  104.  
  105. PeasDemoValaHelloPlugin* peas_demo_vala_hello_plugin_new (void) {
  106. return peas_demo_vala_hello_plugin_construct (PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN);
  107. }
  108.  
  109.  
  110. static gpointer _g_object_ref0 (gpointer self) {
  111. return self ? g_object_ref (self) : NULL;
  112. }
  113.  
  114.  
  115. static void peas_demo_vala_hello_plugin_real_activate (PeasActivatable* base) {
  116. PeasDemoValaHelloPlugin * self;
  117. GObject* _tmp0_;
  118. GtkWindow* _tmp1_;
  119. GtkWindow* window;
  120. GtkLabel* _tmp2_ = NULL;
  121. GtkWidget* _tmp3_ = NULL;
  122. GtkWidget* _tmp4_;
  123. GtkBox* _tmp5_;
  124. GtkBox* box;
  125. self = (PeasDemoValaHelloPlugin*) base;
  126. _tmp0_ = self->priv->_object;
  127. _tmp1_ = _g_object_ref0 (GTK_IS_WINDOW (_tmp0_) ? ((GtkWindow*) _tmp0_) : NULL);
  128. window = _tmp1_;
  129. g_debug ("plugin.vala:14: activated");
  130. _tmp2_ = (GtkLabel*) gtk_label_new ("Hello World from Vala!");
  131. _g_object_unref0 (self->priv->label);
  132. self->priv->label = (GtkWidget*) g_object_ref_sink (_tmp2_);
  133. _tmp3_ = gtk_bin_get_child ((GtkBin*) window);
  134. _tmp4_ = _tmp3_;
  135. _tmp5_ = _g_object_ref0 (GTK_IS_BOX (_tmp4_) ? ((GtkBox*) _tmp4_) : NULL);
  136. box = _tmp5_;
  137. gtk_box_pack_start (box, self->priv->label, TRUE, TRUE, (guint) 0);
  138. gtk_widget_show (self->priv->label);
  139. _g_object_unref0 (box);
  140. _g_object_unref0 (window);
  141. }
  142.  
  143.  
  144. static void peas_demo_vala_hello_plugin_real_deactivate (PeasActivatable* base) {
  145. PeasDemoValaHelloPlugin * self;
  146. GObject* _tmp0_;
  147. GtkWindow* _tmp1_;
  148. GtkWindow* window;
  149. GtkWidget* _tmp2_ = NULL;
  150. GtkWidget* _tmp3_;
  151. GtkBox* _tmp4_;
  152. GtkBox* box;
  153. self = (PeasDemoValaHelloPlugin*) base;
  154. _tmp0_ = self->priv->_object;
  155. _tmp1_ = _g_object_ref0 (GTK_IS_WINDOW (_tmp0_) ? ((GtkWindow*) _tmp0_) : NULL);
  156. window = _tmp1_;
  157. g_debug ("plugin.vala:25: deactivated");
  158. _tmp2_ = gtk_bin_get_child ((GtkBin*) window);
  159. _tmp3_ = _tmp2_;
  160. _tmp4_ = _g_object_ref0 (GTK_IS_BOX (_tmp3_) ? ((GtkBox*) _tmp3_) : NULL);
  161. box = _tmp4_;
  162. gtk_container_remove ((GtkContainer*) box, self->priv->label);
  163. _g_object_unref0 (box);
  164. _g_object_unref0 (window);
  165. }
  166.  
  167.  
  168. static void peas_demo_vala_hello_plugin_real_update_state (PeasActivatable* base) {
  169. PeasDemoValaHelloPlugin * self;
  170. self = (PeasDemoValaHelloPlugin*) base;
  171. g_debug ("plugin.vala:31: update_state");
  172. }
  173.  
  174.  
  175. GObject* peas_demo_vala_hello_plugin_get_object (PeasDemoValaHelloPlugin* self) {
  176. GObject* result;
  177. g_return_val_if_fail (self != NULL, NULL);
  178. result = self->priv->_object;
  179. return result;
  180. }
  181.  
  182.  
  183. static void peas_demo_vala_hello_plugin_set_object (PeasDemoValaHelloPlugin* self, GObject* value) {
  184. GObject* _tmp0_;
  185. g_return_if_fail (self != NULL);
  186. _tmp0_ = _g_object_ref0 (value);
  187. _g_object_unref0 (self->priv->_object);
  188. self->priv->_object = _tmp0_;
  189. g_object_notify ((GObject *) self, "object");
  190. }
  191.  
  192.  
  193. static void peas_demo_vala_hello_plugin_class_init (PeasDemoValaHelloPluginClass * klass) {
  194. peas_demo_vala_hello_plugin_parent_class = g_type_class_peek_parent (klass);
  195. g_type_class_add_private (klass, sizeof (PeasDemoValaHelloPluginPrivate));
  196. G_OBJECT_CLASS (klass)->get_property = _vala_peas_demo_vala_hello_plugin_get_property;
  197. G_OBJECT_CLASS (klass)->set_property = _vala_peas_demo_vala_hello_plugin_set_property;
  198. G_OBJECT_CLASS (klass)->finalize = peas_demo_vala_hello_plugin_finalize;
  199. g_object_class_install_property (G_OBJECT_CLASS (klass), PEAS_DEMO_VALA_HELLO_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));
  200. }
  201.  
  202.  
  203. static void peas_demo_vala_hello_plugin_peas_activatable_interface_init (PeasActivatableInterface * iface) {
  204. peas_demo_vala_hello_plugin_peas_activatable_parent_iface = g_type_interface_peek_parent (iface);
  205. iface->activate = (void (*)(PeasActivatable*)) peas_demo_vala_hello_plugin_real_activate;
  206. iface->deactivate = (void (*)(PeasActivatable*)) peas_demo_vala_hello_plugin_real_deactivate;
  207. iface->update_state = (void (*)(PeasActivatable*)) peas_demo_vala_hello_plugin_real_update_state;
  208. }
  209.  
  210.  
  211. static void peas_demo_vala_hello_plugin_instance_init (PeasDemoValaHelloPlugin * self) {
  212. self->priv = PEAS_DEMO_VALA_HELLO_PLUGIN_GET_PRIVATE (self);
  213. }
  214.  
  215.  
  216. static void peas_demo_vala_hello_plugin_finalize (GObject* obj) {
  217. PeasDemoValaHelloPlugin * self;
  218. self = PEAS_DEMO_VALA_HELLO_PLUGIN (obj);
  219. _g_object_unref0 (self->priv->label);
  220. _g_object_unref0 (self->priv->_object);
  221. G_OBJECT_CLASS (peas_demo_vala_hello_plugin_parent_class)->finalize (obj);
  222. }
  223.  
  224.  
  225. GType peas_demo_vala_hello_plugin_get_type (void) {
  226. return peas_demo_vala_hello_plugin_type_id;
  227. }
  228.  
  229.  
  230. GType peas_demo_vala_hello_plugin_register_type (GTypeModule * module) {
  231. static const GTypeInfo g_define_type_info = { sizeof (PeasDemoValaHelloPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) peas_demo_vala_hello_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PeasDemoValaHelloPlugin), 0, (GInstanceInitFunc) peas_demo_vala_hello_plugin_instance_init, NULL };
  232. static const GInterfaceInfo peas_activatable_info = { (GInterfaceInitFunc) peas_demo_vala_hello_plugin_peas_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
  233. peas_demo_vala_hello_plugin_type_id = g_type_module_register_type (module, PEAS_TYPE_EXTENSION_BASE, "PeasDemoValaHelloPlugin", &g_define_type_info, 0);
  234. g_type_module_add_interface (module, peas_demo_vala_hello_plugin_type_id, PEAS_TYPE_ACTIVATABLE, &peas_activatable_info);
  235. return peas_demo_vala_hello_plugin_type_id;
  236. }
  237.  
  238.  
  239. static void _vala_peas_demo_vala_hello_plugin_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
  240. PeasDemoValaHelloPlugin * self;
  241. self = PEAS_DEMO_VALA_HELLO_PLUGIN (object);
  242. switch (property_id) {
  243. case PEAS_DEMO_VALA_HELLO_PLUGIN_OBJECT:
  244. g_value_set_object (value, peas_demo_vala_hello_plugin_get_object (self));
  245. break;
  246. default:
  247. G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
  248. break;
  249. }
  250. }
  251.  
  252.  
  253. static void _vala_peas_demo_vala_hello_plugin_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
  254. PeasDemoValaHelloPlugin * self;
  255. self = PEAS_DEMO_VALA_HELLO_PLUGIN (object);
  256. switch (property_id) {
  257. case PEAS_DEMO_VALA_HELLO_PLUGIN_OBJECT:
  258. peas_demo_vala_hello_plugin_set_object (self, g_value_get_object (value));
  259. break;
  260. default:
  261. G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
  262. break;
  263. }
  264. }
  265.  
  266.  
  267. PeasDemoValaPluginConfig* peas_demo_vala_plugin_config_construct (GType object_type) {
  268. PeasDemoValaPluginConfig * self = NULL;
  269. self = (PeasDemoValaPluginConfig*) g_object_new (object_type, NULL);
  270. g_debug ("plugin.vala:38: config constructed");
  271. return self;
  272. }
  273.  
  274.  
  275. PeasDemoValaPluginConfig* peas_demo_vala_plugin_config_new (void) {
  276. return peas_demo_vala_plugin_config_construct (PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG);
  277. }
  278.  
  279.  
  280. static GtkWidget* peas_demo_vala_plugin_config_real_create_configure_widget (PeasGtkConfigurable* base) {
  281. PeasDemoValaPluginConfig * self;
  282. GtkWidget* result = NULL;
  283. gchar* _tmp0_;
  284. gchar* text;
  285. GtkLabel* _tmp1_ = NULL;
  286. self = (PeasDemoValaPluginConfig*) base;
  287. _tmp0_ = g_strdup ("This is a configuration dialog for the ValaHello plugin.");
  288. text = _tmp0_;
  289. g_debug ("plugin.vala:43: config create widget");
  290. _tmp1_ = (GtkLabel*) gtk_label_new (text);
  291. result = (GtkWidget*) g_object_ref_sink (_tmp1_);
  292. _g_free0 (text);
  293. return result;
  294. }
  295.  
  296.  
  297. static void peas_demo_vala_plugin_config_class_init (PeasDemoValaPluginConfigClass * klass) {
  298. peas_demo_vala_plugin_config_parent_class = g_type_class_peek_parent (klass);
  299. }
  300.  
  301.  
  302. static void peas_demo_vala_plugin_config_peas_gtk_configurable_interface_init (PeasGtkConfigurableInterface * iface) {
  303. peas_demo_vala_plugin_config_peas_gtk_configurable_parent_iface = g_type_interface_peek_parent (iface);
  304. iface->create_configure_widget = (GtkWidget* (*)(PeasGtkConfigurable*)) peas_demo_vala_plugin_config_real_create_configure_widget;
  305. }
  306.  
  307.  
  308. static void peas_demo_vala_plugin_config_instance_init (PeasDemoValaPluginConfig * self) {
  309. }
  310.  
  311.  
  312. GType peas_demo_vala_plugin_config_get_type (void) {
  313. return peas_demo_vala_plugin_config_type_id;
  314. }
  315.  
  316.  
  317. GType peas_demo_vala_plugin_config_register_type (GTypeModule * module) {
  318. static const GTypeInfo g_define_type_info = { sizeof (PeasDemoValaPluginConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) peas_demo_vala_plugin_config_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PeasDemoValaPluginConfig), 0, (GInstanceInitFunc) peas_demo_vala_plugin_config_instance_init, NULL };
  319. static const GInterfaceInfo peas_gtk_configurable_info = { (GInterfaceInitFunc) peas_demo_vala_plugin_config_peas_gtk_configurable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
  320. peas_demo_vala_plugin_config_type_id = g_type_module_register_type (module, PEAS_TYPE_EXTENSION_BASE, "PeasDemoValaPluginConfig", &g_define_type_info, 0);
  321. g_type_module_add_interface (module, peas_demo_vala_plugin_config_type_id, PEAS_GTK_TYPE_CONFIGURABLE, &peas_gtk_configurable_info);
  322. return peas_demo_vala_plugin_config_type_id;
  323. }
  324.  
  325.  
  326. void peas_register_types (GTypeModule* module) {
  327. GTypeModule* _tmp0_;
  328. PeasObjectModule* _tmp1_;
  329. PeasObjectModule* objmodule;
  330. g_return_if_fail (module != NULL);
  331. peas_demo_vala_hello_plugin_register_type (module);
  332. peas_demo_vala_plugin_config_register_type (module);
  333. _tmp0_ = module;
  334. _tmp1_ = _g_object_ref0 (PEAS_IS_OBJECT_MODULE (_tmp0_) ? ((PeasObjectModule*) _tmp0_) : NULL);
  335. objmodule = _tmp1_;
  336. peas_object_module_register_extension_type (objmodule, PEAS_TYPE_ACTIVATABLE, PEAS_DEMO_TYPE_VALA_HELLO_PLUGIN);
  337. peas_object_module_register_extension_type (objmodule, PEAS_GTK_TYPE_CONFIGURABLE, PEAS_DEMO_TYPE_VALA_PLUGIN_CONFIG);
  338. _g_object_unref0 (objmodule);
  339. }
Add Comment
Please, Sign In to add comment