Advertisement
Guest User

window.c

a guest
Oct 10th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 10.79 KB | None | 0 0
  1. /* window.c generated by valac 0.14.0.34-0d07f, the Vala compiler
  2.  * generated from window.vala, do not modify */
  3.  
  4.  
  5. #include <glib.h>
  6. #include <glib-object.h>
  7. #include <gtk/gtk.h>
  8. #include <cairo.h>
  9. #include <pango/pango.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <meta/theme.h>
  13. #include <meta/main.h>
  14. #include <gdk-pixbuf/gdk-pixbuf.h>
  15.  
  16.  
  17. #define TYPE_TEST (test_get_type ())
  18. #define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test))
  19. #define TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST, TestClass))
  20. #define IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST))
  21. #define IS_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST))
  22. #define TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST, TestClass))
  23.  
  24. typedef struct _Test Test;
  25. typedef struct _TestClass TestClass;
  26. typedef struct _TestPrivate TestPrivate;
  27. #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
  28. #define _meta_theme_free0(var) ((var == NULL) ? NULL : (var = (meta_theme_free (var), NULL)))
  29.  
  30. struct _Test {
  31.     GtkDrawingArea parent_instance;
  32.     TestPrivate * priv;
  33. };
  34.  
  35. struct _TestClass {
  36.     GtkDrawingAreaClass parent_class;
  37. };
  38.  
  39.  
  40. static gpointer test_parent_class = NULL;
  41.  
  42. GType test_get_type (void) G_GNUC_CONST;
  43. enum  {
  44.     TEST_DUMMY_PROPERTY
  45. };
  46. Test* test_new (void);
  47. Test* test_construct (GType object_type);
  48. static gboolean test_on_draw (Test* self, cairo_t* cairo_cx);
  49. static gboolean _test_on_draw_gtk_widget_draw (GtkWidget* _sender, cairo_t* cr, gpointer self);
  50. gint _vala_main (gchar** args, int args_length1);
  51.  
  52.  
  53. static gboolean _test_on_draw_gtk_widget_draw (GtkWidget* _sender, cairo_t* cr, gpointer self) {
  54.     gboolean result;
  55.     result = test_on_draw (self, cr);
  56. #line 5 "/home/and471/Desktop/window.vala"
  57.     return result;
  58. #line 59 "window.c"
  59. }
  60.  
  61.  
  62. Test* test_construct (GType object_type) {
  63.     Test * self = NULL;
  64. #line 3 "/home/and471/Desktop/window.vala"
  65.     self = (Test*) g_object_new (object_type, NULL);
  66. #line 5 "/home/and471/Desktop/window.vala"
  67.     g_signal_connect_object ((GtkWidget*) self, "draw", (GCallback) _test_on_draw_gtk_widget_draw, self, 0);
  68. #line 3 "/home/and471/Desktop/window.vala"
  69.     return self;
  70. #line 71 "window.c"
  71. }
  72.  
  73.  
  74. Test* test_new (void) {
  75. #line 3 "/home/and471/Desktop/window.vala"
  76.     return test_construct (TYPE_TEST);
  77. #line 78 "window.c"
  78. }
  79.  
  80.  
  81. static gboolean test_on_draw (Test* self, cairo_t* cairo_cx) {
  82.     gboolean result = FALSE;
  83.     PangoContext* _tmp0_ = NULL;
  84.     PangoLayout* _tmp1_;
  85.     PangoLayout* layout;
  86.     PangoLayout* _tmp2_;
  87.     gint _tmp3_;
  88.     gint _tmp4_;
  89.     MetaTheme* _tmp5_ = NULL;
  90.     MetaTheme* theme;
  91.     MetaButtonLayout button_layout = {0};
  92.     MetaButtonFunction _tmp6_;
  93.     MetaButtonState* _tmp7_ = NULL;
  94.     MetaButtonState* button_states;
  95.     gint button_states_length1;
  96.     gint _button_states_size_;
  97.     GtkIconTheme* _tmp8_ = NULL;
  98.     GdkPixbuf* _tmp9_ = NULL;
  99.     GdkPixbuf* _tmp10_;
  100.     GtkIconTheme* _tmp11_ = NULL;
  101.     GdkPixbuf* _tmp12_ = NULL;
  102.     GdkPixbuf* _tmp13_;
  103.     MetaTheme* _tmp14_;
  104.     cairo_t* _tmp15_;
  105.     PangoLayout* _tmp16_;
  106.     MetaButtonLayout _tmp17_;
  107.     MetaButtonState* _tmp18_;
  108.     gint _tmp18__length1;
  109.     GdkPixbuf* _tmp19_;
  110.     GdkPixbuf* _tmp20_;
  111.     GError * _inner_error_ = NULL;
  112. #line 8 "/home/and471/Desktop/window.vala"
  113.     g_return_val_if_fail (self != NULL, FALSE);
  114. #line 8 "/home/and471/Desktop/window.vala"
  115.     g_return_val_if_fail (cairo_cx != NULL, FALSE);
  116. #line 11 "/home/and471/Desktop/window.vala"
  117.     _tmp0_ = gtk_widget_get_pango_context ((GtkWidget*) self);
  118. #line 11 "/home/and471/Desktop/window.vala"
  119.     _tmp1_ = pango_layout_new (_tmp0_);
  120. #line 11 "/home/and471/Desktop/window.vala"
  121.     layout = _tmp1_;
  122. #line 12 "/home/and471/Desktop/window.vala"
  123.     _tmp2_ = layout;
  124. #line 12 "/home/and471/Desktop/window.vala"
  125.     _tmp3_ = strlen ("Hi");
  126. #line 12 "/home/and471/Desktop/window.vala"
  127.     _tmp4_ = _tmp3_;
  128. #line 12 "/home/and471/Desktop/window.vala"
  129.     pango_layout_set_text (_tmp2_, "Hi", _tmp4_);
  130. #line 14 "/home/and471/Desktop/window.vala"
  131.     _tmp5_ = meta_theme_load ("Adwaita", &_inner_error_);
  132. #line 14 "/home/and471/Desktop/window.vala"
  133.     theme = _tmp5_;
  134. #line 14 "/home/and471/Desktop/window.vala"
  135.     if (_inner_error_ != NULL) {
  136. #line 14 "/home/and471/Desktop/window.vala"
  137.         _g_object_unref0 (layout);
  138. #line 14 "/home/and471/Desktop/window.vala"
  139.         g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
  140. #line 14 "/home/and471/Desktop/window.vala"
  141.         g_clear_error (&_inner_error_);
  142. #line 14 "/home/and471/Desktop/window.vala"
  143.         return FALSE;
  144. #line 145 "window.c"
  145.     }
  146. #line 16 "/home/and471/Desktop/window.vala"
  147.     memset (&button_layout, 0, sizeof (MetaButtonLayout));
  148. #line 17 "/home/and471/Desktop/window.vala"
  149.     button_layout.left_buttons[0] = META_BUTTON_FUNCTION_CLOSE;
  150. #line 17 "/home/and471/Desktop/window.vala"
  151.     _tmp6_ = button_layout.left_buttons[0];
  152. #line 19 "/home/and471/Desktop/window.vala"
  153.     _tmp7_ = g_new0 (MetaButtonState, 1);
  154. #line 19 "/home/and471/Desktop/window.vala"
  155.     _tmp7_[0] = META_BUTTON_STATE_NORMAL;
  156. #line 19 "/home/and471/Desktop/window.vala"
  157.     button_states = _tmp7_;
  158. #line 19 "/home/and471/Desktop/window.vala"
  159.     button_states_length1 = 1;
  160. #line 19 "/home/and471/Desktop/window.vala"
  161.     _button_states_size_ = button_states_length1;
  162. #line 30 "/home/and471/Desktop/window.vala"
  163.     _tmp8_ = gtk_icon_theme_get_default ();
  164. #line 30 "/home/and471/Desktop/window.vala"
  165.     _tmp9_ = gtk_icon_theme_load_icon (_tmp8_, "folder", 16, GTK_ICON_LOOKUP_FORCE_SVG, &_inner_error_);
  166. #line 30 "/home/and471/Desktop/window.vala"
  167.     _tmp10_ = _tmp9_;
  168. #line 30 "/home/and471/Desktop/window.vala"
  169.     if (_inner_error_ != NULL) {
  170. #line 30 "/home/and471/Desktop/window.vala"
  171.         button_states = (g_free (button_states), NULL);
  172. #line 30 "/home/and471/Desktop/window.vala"
  173.         _meta_theme_free0 (theme);
  174. #line 30 "/home/and471/Desktop/window.vala"
  175.         _g_object_unref0 (layout);
  176. #line 30 "/home/and471/Desktop/window.vala"
  177.         g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
  178. #line 30 "/home/and471/Desktop/window.vala"
  179.         g_clear_error (&_inner_error_);
  180. #line 30 "/home/and471/Desktop/window.vala"
  181.         return FALSE;
  182. #line 183 "window.c"
  183.     }
  184. #line 31 "/home/and471/Desktop/window.vala"
  185.     _tmp11_ = gtk_icon_theme_get_default ();
  186. #line 31 "/home/and471/Desktop/window.vala"
  187.     _tmp12_ = gtk_icon_theme_load_icon (_tmp11_, "folder", 16, GTK_ICON_LOOKUP_FORCE_SVG, &_inner_error_);
  188. #line 31 "/home/and471/Desktop/window.vala"
  189.     _tmp13_ = _tmp12_;
  190. #line 31 "/home/and471/Desktop/window.vala"
  191.     if (_inner_error_ != NULL) {
  192. #line 31 "/home/and471/Desktop/window.vala"
  193.         button_states = (g_free (button_states), NULL);
  194. #line 31 "/home/and471/Desktop/window.vala"
  195.         _meta_theme_free0 (theme);
  196. #line 31 "/home/and471/Desktop/window.vala"
  197.         _g_object_unref0 (layout);
  198. #line 31 "/home/and471/Desktop/window.vala"
  199.         g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
  200. #line 31 "/home/and471/Desktop/window.vala"
  201.         g_clear_error (&_inner_error_);
  202. #line 31 "/home/and471/Desktop/window.vala"
  203.         return FALSE;
  204. #line 205 "window.c"
  205.     }
  206. #line 21 "/home/and471/Desktop/window.vala"
  207.     _tmp14_ = theme;
  208. #line 21 "/home/and471/Desktop/window.vala"
  209.     _tmp15_ = cairo_cx;
  210. #line 21 "/home/and471/Desktop/window.vala"
  211.     _tmp16_ = layout;
  212. #line 21 "/home/and471/Desktop/window.vala"
  213.     _tmp17_ = button_layout;
  214. #line 21 "/home/and471/Desktop/window.vala"
  215.     _tmp18_ = button_states;
  216. #line 21 "/home/and471/Desktop/window.vala"
  217.     _tmp18__length1 = button_states_length1;
  218. #line 21 "/home/and471/Desktop/window.vala"
  219.     _tmp19_ = _tmp10_;
  220. #line 21 "/home/and471/Desktop/window.vala"
  221.     _tmp20_ = _tmp13_;
  222. #line 21 "/home/and471/Desktop/window.vala"
  223.     meta_theme_draw_frame (_tmp14_, (GtkWidget*) self, _tmp15_, META_FRAME_TYPE_NORMAL, META_FRAME_HAS_FOCUS, 400, 50, _tmp16_, 20, &_tmp17_, _tmp18_, _tmp19_, _tmp20_);
  224. #line 21 "/home/and471/Desktop/window.vala"
  225.     _g_object_unref0 (_tmp20_);
  226. #line 21 "/home/and471/Desktop/window.vala"
  227.     _g_object_unref0 (_tmp19_);
  228. #line 32 "/home/and471/Desktop/window.vala"
  229.     result = FALSE;
  230. #line 32 "/home/and471/Desktop/window.vala"
  231.     button_states = (g_free (button_states), NULL);
  232. #line 32 "/home/and471/Desktop/window.vala"
  233.     _meta_theme_free0 (theme);
  234. #line 32 "/home/and471/Desktop/window.vala"
  235.     _g_object_unref0 (layout);
  236. #line 32 "/home/and471/Desktop/window.vala"
  237.     return result;
  238. #line 239 "window.c"
  239. }
  240.  
  241.  
  242. static void test_class_init (TestClass * klass) {
  243. #line 1 "/home/and471/Desktop/window.vala"
  244.     test_parent_class = g_type_class_peek_parent (klass);
  245. #line 246 "window.c"
  246. }
  247.  
  248.  
  249. static void test_instance_init (Test * self) {
  250. }
  251.  
  252.  
  253. GType test_get_type (void) {
  254.     static volatile gsize test_type_id__volatile = 0;
  255.     if (g_once_init_enter (&test_type_id__volatile)) {
  256.         static const GTypeInfo g_define_type_info = { sizeof (TestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Test), 0, (GInstanceInitFunc) test_instance_init, NULL };
  257.         GType test_type_id;
  258.         test_type_id = g_type_register_static (GTK_TYPE_DRAWING_AREA, "Test", &g_define_type_info, 0);
  259.         g_once_init_leave (&test_type_id__volatile, test_type_id);
  260.     }
  261.     return test_type_id__volatile;
  262. }
  263.  
  264.  
  265. gint _vala_main (gchar** args, int args_length1) {
  266.     gint result = 0;
  267.     Test* _tmp0_;
  268.     Test* _tmp1_;
  269.     Test* t;
  270.     GtkWindow* _tmp2_;
  271.     GtkWindow* _tmp3_;
  272.     GtkWindow* w;
  273. #line 37 "/home/and471/Desktop/window.vala"
  274.     gtk_init (&args_length1, &args);
  275. #line 39 "/home/and471/Desktop/window.vala"
  276.     _tmp0_ = test_new ();
  277. #line 39 "/home/and471/Desktop/window.vala"
  278.     _tmp1_ = g_object_ref_sink (_tmp0_);
  279. #line 39 "/home/and471/Desktop/window.vala"
  280.     t = _tmp1_;
  281. #line 40 "/home/and471/Desktop/window.vala"
  282.     _tmp2_ = (GtkWindow*) gtk_window_new (GTK_WINDOW_TOPLEVEL);
  283. #line 40 "/home/and471/Desktop/window.vala"
  284.     _tmp3_ = g_object_ref_sink (_tmp2_);
  285. #line 40 "/home/and471/Desktop/window.vala"
  286.     w = _tmp3_;
  287. #line 41 "/home/and471/Desktop/window.vala"
  288.     gtk_container_add ((GtkContainer*) w, (GtkWidget*) t);
  289. #line 43 "/home/and471/Desktop/window.vala"
  290.     gtk_widget_show_all ((GtkWidget*) w);
  291. #line 44 "/home/and471/Desktop/window.vala"
  292.     gtk_main ();
  293. #line 45 "/home/and471/Desktop/window.vala"
  294.     result = 0;
  295. #line 45 "/home/and471/Desktop/window.vala"
  296.     _g_object_unref0 (w);
  297. #line 45 "/home/and471/Desktop/window.vala"
  298.     _g_object_unref0 (t);
  299. #line 45 "/home/and471/Desktop/window.vala"
  300.     return result;
  301. #line 302 "window.c"
  302. }
  303.  
  304.  
  305. int main (int argc, char ** argv) {
  306. #line 36 "/home/and471/Desktop/window.vala"
  307.     g_type_init ();
  308. #line 36 "/home/and471/Desktop/window.vala"
  309.     return _vala_main (argv, argc);
  310. #line 311 "window.c"
  311. }
  312.  
  313.  
  314.  
  315.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement