Advertisement
Guest User

Untitled

a guest
Jan 25th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.74 KB | None | 0 0
  1. /* gf_test.c generated by valac 0.15.0.96-556a, the Vala compiler
  2.  * generated from gf_test.vala, do not modify */
  3.  
  4.  
  5. #include <glib.h>
  6. #include <glib-object.h>
  7. #include <gfreenect.h>
  8. #include <gio/gio.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12.  
  13.  
  14. #define TYPE_MAIN (main_get_type ())
  15. #define MAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN, Main))
  16. #define MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN, MainClass))
  17. #define IS_MAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN))
  18. #define IS_MAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN))
  19. #define MAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN, MainClass))
  20.  
  21. typedef struct _Main Main;
  22. typedef struct _MainClass MainClass;
  23. typedef struct _MainPrivate MainPrivate;
  24. #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
  25.  
  26. struct _Main {
  27.     GObject parent_instance;
  28.     MainPrivate * priv;
  29.     GFreenectDevice* device;
  30.     GAsyncReadyCallback cb;
  31.     gpointer cb_target;
  32.     GDestroyNotify cb_target_destroy_notify;
  33. };
  34.  
  35. struct _MainClass {
  36.     GObjectClass parent_class;
  37. };
  38.  
  39.  
  40. static gpointer main_parent_class = NULL;
  41.  
  42. GType main_get_type (void) G_GNUC_CONST;
  43. enum  {
  44.     MAIN_DUMMY_PROPERTY
  45. };
  46. Main* main_new (void);
  47. Main* main_construct (GType object_type);
  48. void main_on_device_ready (Main* self);
  49. static void _main_on_device_ready_gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
  50. static gint main_main (gchar** args, int args_length1);
  51. static void main_finalize (GObject* obj);
  52.  
  53.  
  54. static void _main_on_device_ready_gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
  55.     main_on_device_ready (self);
  56. }
  57.  
  58.  
  59. Main* main_construct (GType object_type) {
  60.     Main * self = NULL;
  61.     GFreenectDevice* _tmp0_;
  62.     self = (Main*) g_object_new (object_type, NULL);
  63.     _tmp0_ = gfreenect_device_new (0, (guint) 0, NULL, _main_on_device_ready_gasync_ready_callback, self);
  64.     _g_object_unref0 (self->device);
  65.     self->device = _tmp0_;
  66.     return self;
  67. }
  68.  
  69.  
  70. Main* main_new (void) {
  71.     return main_construct (TYPE_MAIN);
  72. }
  73.  
  74.  
  75. void main_on_device_ready (Main* self) {
  76.     FILE* _tmp0_;
  77.     g_return_if_fail (self != NULL);
  78.     _tmp0_ = stdout;
  79.     fprintf (_tmp0_, "Device ready ...\n");
  80. }
  81.  
  82.  
  83. static gint main_main (gchar** args, int args_length1) {
  84.     gint result = 0;
  85.     Main* _tmp0_;
  86.     Main* app;
  87.     _tmp0_ = main_new ();
  88.     app = _tmp0_;
  89.     result = 0;
  90.     _g_object_unref0 (app);
  91.     return result;
  92. }
  93.  
  94.  
  95. int main (int argc, char ** argv) {
  96.     g_type_init ();
  97.     return main_main (argv, argc);
  98. }
  99.  
  100.  
  101. static void main_class_init (MainClass * klass) {
  102.     main_parent_class = g_type_class_peek_parent (klass);
  103.     G_OBJECT_CLASS (klass)->finalize = main_finalize;
  104. }
  105.  
  106.  
  107. static void main_instance_init (Main * self) {
  108. }
  109.  
  110.  
  111. static void main_finalize (GObject* obj) {
  112.     Main * self;
  113.     self = MAIN (obj);
  114.     _g_object_unref0 (self->device);
  115.     (self->cb_target_destroy_notify == NULL) ? NULL : (self->cb_target_destroy_notify (self->cb_target), NULL);
  116.     self->cb = NULL;
  117.     self->cb_target = NULL;
  118.     self->cb_target_destroy_notify = NULL;
  119.     G_OBJECT_CLASS (main_parent_class)->finalize (obj);
  120. }
  121.  
  122.  
  123. GType main_get_type (void) {
  124.     static volatile gsize main_type_id__volatile = 0;
  125.     if (g_once_init_enter (&main_type_id__volatile)) {
  126.         static const GTypeInfo g_define_type_info = { sizeof (MainClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Main), 0, (GInstanceInitFunc) main_instance_init, NULL };
  127.         GType main_type_id;
  128.         main_type_id = g_type_register_static (G_TYPE_OBJECT, "Main", &g_define_type_info, 0);
  129.         g_once_init_leave (&main_type_id__volatile, main_type_id);
  130.     }
  131.     return main_type_id__volatile;
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement