gtk3 2.2.0-x86-mingw32 → 2.2.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gtk3/extconf.rb +3 -2
  3. data/ext/gtk3/rbgtk-color-button.c +7 -1
  4. data/ext/gtk3/rbgtk-dialog.c +26 -6
  5. data/ext/gtk3/rbgtk-image.c +1 -0
  6. data/ext/gtk3/rbgtk-selection-data.c +4 -5
  7. data/ext/gtk3/rbgtk-stack-switcher.c +41 -0
  8. data/ext/gtk3/rbgtk-window.c +8 -0
  9. data/ext/gtk3/rbgtk.c +158 -0
  10. data/ext/gtk3/rbgtk3.h +33 -0
  11. data/ext/gtk3/rbgtk3conversions.h +60 -1
  12. data/ext/gtk3/rbgtk3private.h +1 -1
  13. data/lib/2.0/gtk3.so +0 -0
  14. data/lib/gtk3.rb +1 -0
  15. data/sample/gtk-demo/cairo-arc-negative.rb +1 -1
  16. data/sample/gtk-demo/cairo-arc.rb +1 -1
  17. data/sample/gtk-demo/cairo-clip-image.rb +6 -6
  18. data/sample/gtk-demo/cairo-clip-rectangle.rb +2 -2
  19. data/sample/gtk-demo/cairo-curve-rectangle.rb +2 -2
  20. data/sample/gtk-demo/cairo-curve-to.rb +2 -2
  21. data/sample/gtk-demo/cairo-dash.rb +1 -1
  22. data/sample/gtk-demo/cairo-fill-and-stroke.rb +1 -1
  23. data/sample/gtk-demo/cairo-fill-and-stroke2.rb +2 -2
  24. data/sample/gtk-demo/cairo-gradient.rb +1 -1
  25. data/sample/gtk-demo/cairo-image-pattern.rb +5 -5
  26. data/sample/gtk-demo/cairo-image.rb +4 -4
  27. data/sample/gtk-demo/cairo-line-cap.rb +8 -8
  28. data/sample/gtk-demo/cairo-line-join.rb +3 -3
  29. data/sample/gtk-demo/cairo-long-lines.rb +3 -3
  30. data/sample/gtk-demo/cairo-pattern-fill.rb +11 -11
  31. data/sample/gtk-demo/cairo-self-intersect.rb +2 -2
  32. data/sample/gtk-demo/cairo-text-align-center.rb +4 -4
  33. data/sample/gtk-demo/cairo-text-extents.rb +5 -5
  34. data/sample/gtk-demo/cairo-text.rb +3 -3
  35. data/sample/gtk-demo/common.rb +0 -1
  36. data/sample/gtk-demo/dialog.rb +23 -23
  37. data/sample/gtk-demo/drawingarea.rb +5 -1
  38. data/sample/gtk-demo/editable_cells.rb +28 -28
  39. data/sample/gtk-demo/entry_completion.rb +3 -3
  40. data/sample/gtk-demo/images.rb +75 -75
  41. data/sample/gtk-demo/item_factory.rb +40 -40
  42. data/sample/gtk-demo/list_store.rb +13 -13
  43. data/sample/gtk-demo/menus.rb +34 -34
  44. data/sample/gtk-demo/panes.rb +28 -28
  45. data/sample/gtk-demo/rotated_text.rb +41 -53
  46. data/sample/gtk-demo/sizegroup.rb +17 -17
  47. data/sample/gtk-demo/spinner.rb +1 -1
  48. data/sample/gtk-demo/textview.rb +137 -137
  49. data/sample/gtk-demo/theming.ui +319 -0
  50. data/sample/gtk-demo/theming_style_classes.rb +48 -0
  51. data/sample/gtk-demo/tree_store.rb +127 -127
  52. data/sample/misc/assistant.rb +6 -66
  53. data/sample/misc/bindings.rb +22 -32
  54. data/sample/misc/button.rb +8 -5
  55. data/sample/misc/buttonbox.rb +2 -2
  56. data/sample/misc/checkbutton.rb +4 -1
  57. data/sample/misc/colorselection.rb +7 -10
  58. data/sample/misc/combo_check.rb +34 -26
  59. data/sample/misc/combobox.rb +10 -11
  60. data/sample/misc/cursor.rb +3 -1
  61. data/sample/misc/dialog.rb +12 -12
  62. data/sample/misc/dialog2.rb +13 -16
  63. data/sample/misc/drawing.rb +40 -21
  64. data/sample/misc/statusicon.rb +28 -45
  65. data/sample/misc/threads.rb +16 -18
  66. data/sample/misc/tree_progress.rb +10 -12
  67. data/test/run-test.rb +17 -9
  68. data/test/test_gtk_search_bar.rb +1 -1
  69. data/test/test_gtk_stack_switcher.rb +30 -0
  70. metadata +26 -24
  71. data/lib/1.9/gtk3.so +0 -0
  72. data/lib/2.1/gtk3.so +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f6d6217e6325b767b3c7d594029b027fdcc1e51
4
- data.tar.gz: c84ec4e9131dc3a869190e80de472d00a9bc99ed
3
+ metadata.gz: f580d436a4b36979d100900726c268fbca3c3687
4
+ data.tar.gz: aef4f58f36c261b32d55ad62e5f34d5a91a194fb
5
5
  SHA512:
6
- metadata.gz: 834e73dd8b445a8a9f569f5ed40045a8d268e1fc9bd13a9e91f34a0d0fd78038139c4235b2b407f99a6e34fbb368396338694a300b693e2b9f2bdf6ba5f4bfb2
7
- data.tar.gz: 09ce6d62e5de8794323805f705496db886797186609fc2dd95b7093e849f6266a5676df7f8cd9d43a13ca8883a7dd5ba5c1d078c1f1f72ca25c27f56c4c4bc6c
6
+ metadata.gz: a8269e86a746480a1369cec163b1893b4b3fc77a4df9b237fa8a02613549d2b6158cbf601be68532d7af2c359148dc55bdaf521fd68d937fc8b07b0a9238d2dd
7
+ data.tar.gz: c86c4191c530449c7ce199d82b940d8f388b3a8bc8e0970b342d4beb23d2930203ae03c33ea0be555e3cc3ca374ef4d1f1ada4527fcc3d3c520dd20d612c23f5
data/ext/gtk3/extconf.rb CHANGED
@@ -33,9 +33,10 @@ end
33
33
 
34
34
  have_func("rb_errinfo")
35
35
 
36
- ["glib2", "atk", "pango", "gdk_pixbuf2", "gdk3"].each do |package|
36
+ ["glib2", "cairo-gobject", "atk", "pango", "gdk_pixbuf2", "gdk3"].each do |package|
37
+ depended_module_name = package.gsub(/-/, "_")
37
38
  directory = "#{package}#{version_suffix}"
38
- build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
39
+ build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{depended_module_name}/#{RUBY_VERSION}"
39
40
  add_depend_package(package, "#{directory}/ext/#{package}",
40
41
  top_dir.to_s,
41
42
  :top_build_dir => top_build_dir.to_s,
@@ -34,7 +34,13 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
34
34
  if (NIL_P(color)){
35
35
  widget = gtk_color_button_new();
36
36
  } else {
37
- widget = gtk_color_button_new_with_color(RVAL2GDKCOLOR(color));
37
+ GType gtype = RVAL2GTYPE(color);
38
+
39
+ if (gtype == GDK_TYPE_COLOR) {
40
+ widget = gtk_color_button_new_with_color(RVAL2GDKCOLOR(color));
41
+ } else {
42
+ widget = gtk_color_button_new_with_rgba(RVAL2GDKRGBA(color));
43
+ }
38
44
  }
39
45
 
40
46
  RBGTK_INITIALIZE(self, widget);
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2014 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team
5
5
  * Copyright (C) 1998-2000 Yukihiro Matsumoto,
6
6
  * Daisuke Kanda,
@@ -74,15 +74,35 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
74
74
  return Qnil;
75
75
  }
76
76
 
77
+ static gboolean
78
+ destroy_dialog(gpointer user_data)
79
+ {
80
+ GtkWidget *dialog = user_data;
81
+ gtk_widget_destroy(dialog);
82
+ return G_SOURCE_REMOVE;
83
+ }
84
+
77
85
  static VALUE
78
86
  rg_run(VALUE self)
79
87
  {
80
- if (rb_block_given_p()){
81
- VALUE ret = INT2NUM(gtk_dialog_run(_SELF(self)));
82
- rb_yield(ret);
83
- return ret;
88
+ GtkDialog *dialog;
89
+ GSource *interrupt_source;
90
+ VALUE response;
91
+
92
+ dialog = _SELF(self);
93
+ interrupt_source = rbg_interrupt_source_new();
94
+ g_source_set_callback(interrupt_source, destroy_dialog, dialog, NULL);
95
+ g_source_attach(interrupt_source, NULL);
96
+ response = INT2NUM(gtk_dialog_run(dialog));
97
+ g_source_destroy(interrupt_source);
98
+ g_source_unref(interrupt_source);
99
+
100
+ rb_thread_check_ints();
101
+
102
+ if (rb_block_given_p()) {
103
+ return rb_yield(response);
84
104
  } else {
85
- return INT2NUM(gtk_dialog_run(_SELF(self)));
105
+ return response;
86
106
  }
87
107
  }
88
108
 
@@ -72,6 +72,7 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
72
72
  rb_raise(rb_eArgError, "Invalid arguments.");
73
73
 
74
74
  RBGTK_INITIALIZE(self, widget);
75
+ g_object_unref(widget);
75
76
 
76
77
  return Qnil;
77
78
  }
@@ -36,20 +36,19 @@ rbgtk_atom2selectiondata(VALUE type, VALUE size, VALUE src, GdkAtom *gtype,
36
36
  GdkAtom ntype = RVAL2ATOM(type);
37
37
 
38
38
  if(ntype == GDK_SELECTION_TYPE_INTEGER){
39
- int *i;
40
- i = ALLOC(int);
39
+ glong *i;
40
+ i = ALLOC(glong);
41
41
  *i = NUM2INT(src);
42
42
  dat = i;
43
- fmt = sizeof(int) * 8;
43
+ fmt = 32;
44
44
  len = 1;
45
45
  } else if(ntype == GDK_SELECTION_TYPE_STRING) {
46
46
  dat = (void *)RVAL2CSTR(src);
47
+ fmt = 8;
47
48
  if (NIL_P(size)) {
48
- fmt = sizeof(char) * 8;
49
49
  len = RSTRING_LEN(src);
50
50
  } else {
51
51
  len = NUM2UINT(size);
52
- fmt = (RSTRING_LEN(src) / len) * 8;
53
52
  }
54
53
  /* TODO
55
54
  } else if(ntype == compound_text){
@@ -0,0 +1,41 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2014 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #include "rbgtk3private.h"
22
+
23
+ #if GTK_CHECK_VERSION(3, 10, 0)
24
+
25
+ #define RG_TARGET_NAMESPACE cStackSwitcher
26
+
27
+ static VALUE
28
+ rg_initialize(VALUE self)
29
+ {
30
+ RBGTK_INITIALIZE(self, gtk_stack_switcher_new());
31
+ return Qnil;
32
+ }
33
+
34
+ void
35
+ Init_gtk_stack_switcher(VALUE mGtk)
36
+ {
37
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STACK_SWITCHER, "StackSwitcher", mGtk);
38
+
39
+ RG_DEF_METHOD(initialize, 0);
40
+ }
41
+ #endif
@@ -485,6 +485,13 @@ rg_set_default_geometry(VALUE self, VALUE width, VALUE height)
485
485
  return self;
486
486
  }
487
487
 
488
+ static VALUE
489
+ rg_set_titlebar(VALUE self, VALUE titlebar)
490
+ {
491
+ gtk_window_set_titlebar(_SELF(self), RVAL2GTKWIDGET(titlebar));
492
+ return self;
493
+ }
494
+
488
495
  void
489
496
  Init_gtk_window(VALUE mGtk)
490
497
  {
@@ -544,6 +551,7 @@ Init_gtk_window(VALUE mGtk)
544
551
  RG_DEF_METHOD(propagate_key_event, 1);
545
552
  RG_DEF_METHOD(resize_to_geometry, 2);
546
553
  RG_DEF_METHOD(set_default_geometry, 2);
554
+ RG_DEF_METHOD(set_titlebar, 1);
547
555
 
548
556
  G_DEF_CLASS(GTK_TYPE_WINDOW_POSITION, "Position", RG_TARGET_NAMESPACE);
549
557
  G_DEF_CLASS(GTK_TYPE_WINDOW_TYPE, "Type", RG_TARGET_NAMESPACE);
data/ext/gtk3/rbgtk.c CHANGED
@@ -28,6 +28,146 @@
28
28
  #endif
29
29
  #include <locale.h>
30
30
 
31
+ /* TODO: REMOVE ME */
32
+ /*
33
+ * They are temporary. They will be needless after Ruby/GTK3
34
+ * is based on Ruby/GObjectIntrospection.
35
+ */
36
+ /* From Ruby/GDK3 - start */
37
+ static GdkGeometry*
38
+ geo_copy(const GdkGeometry* geo)
39
+ {
40
+ GdkGeometry* new_geo;
41
+ g_return_val_if_fail (geo != NULL, NULL);
42
+ new_geo = g_new(GdkGeometry, 1);
43
+ *new_geo = *geo;
44
+ return new_geo;
45
+ }
46
+
47
+ GType
48
+ gdk_geometry_get_type(void)
49
+ {
50
+ static GType our_type = 0;
51
+ if (our_type == 0)
52
+ our_type = g_boxed_type_register_static ("GdkGeometry",
53
+ (GBoxedCopyFunc)geo_copy,
54
+ (GBoxedFreeFunc)g_free);
55
+ return our_type;
56
+ }
57
+
58
+ static GdkAtomData *
59
+ gdk_atom_copy(const GdkAtom atom)
60
+ {
61
+ GdkAtomData* data;
62
+ data = g_new(GdkAtomData, 1);
63
+ data->atom = atom;
64
+ return data;
65
+ }
66
+
67
+ GType
68
+ gdk_atom_get_type(void)
69
+ {
70
+ static GType our_type = 0;
71
+ if (our_type == 0)
72
+ our_type = g_boxed_type_register_static ("GdkAtomData",
73
+ (GBoxedCopyFunc)gdk_atom_copy,
74
+ (GBoxedFreeFunc)g_free);
75
+ return our_type;
76
+ }
77
+
78
+ struct rbgdk_rval2gdkatoms_args {
79
+ VALUE ary;
80
+ long n;
81
+ GdkAtom *result;
82
+ };
83
+
84
+ static VALUE
85
+ rbgdk_rval2gdkatoms_body(VALUE value)
86
+ {
87
+ long i;
88
+ struct rbgdk_rval2gdkatoms_args *args = (struct rbgdk_rval2gdkatoms_args *)value;
89
+
90
+ for (i = 0; i < args->n; i++)
91
+ args->result[i] = RVAL2ATOM(RARRAY_PTR(args->ary)[i]);
92
+
93
+ return Qnil;
94
+ }
95
+
96
+ static G_GNUC_NORETURN VALUE
97
+ rbgdk_rval2gdkatoms_rescue(VALUE value)
98
+ {
99
+ g_free(((struct rbgdk_rval2gdkatoms_args *)value)->result);
100
+
101
+ rb_exc_raise(rb_errinfo());
102
+ }
103
+
104
+ GdkAtom *
105
+ rbgdk_rval2gdkatoms(VALUE value, long *n)
106
+ {
107
+ struct rbgdk_rval2gdkatoms_args args;
108
+
109
+ args.ary = rb_ary_to_ary(value);
110
+ args.n = RARRAY_LEN(args.ary);
111
+ args.result = g_new(GdkAtom, args.n + 1);
112
+
113
+ rb_rescue(rbgdk_rval2gdkatoms_body, (VALUE)&args,
114
+ rbgdk_rval2gdkatoms_rescue, (VALUE)&args);
115
+
116
+ *n = args.n;
117
+
118
+ return args.result;
119
+ }
120
+
121
+ struct rval2gdkpixbufglist_args {
122
+ VALUE ary;
123
+ long n;
124
+ GList *result;
125
+ };
126
+
127
+ static VALUE
128
+ rbgdk_rval2gdkpixbufglist_body(VALUE value)
129
+ {
130
+ long i;
131
+ struct rval2gdkpixbufglist_args *args = (struct rval2gdkpixbufglist_args *)value;
132
+
133
+ for (i = 0; i < args->n; i++)
134
+ args->result = g_list_append(args->result, RVAL2GDKPIXBUF(RARRAY_PTR(args->ary)[i]));
135
+
136
+ return Qnil;
137
+ }
138
+
139
+ static G_GNUC_NORETURN VALUE
140
+ rbgdk_rval2gdkpixbufglist_rescue(VALUE value)
141
+ {
142
+ g_list_free(((struct rval2gdkpixbufglist_args *)value)->result);
143
+
144
+ rb_exc_raise(rb_errinfo());
145
+ }
146
+
147
+ GList *
148
+ rbgdk_rval2gdkpixbufglist(VALUE value)
149
+ {
150
+ struct rval2gdkpixbufglist_args args;
151
+
152
+ args.ary = rb_ary_to_ary(value);
153
+ args.n = RARRAY_LEN(args.ary);
154
+ args.result = NULL;
155
+
156
+ rb_rescue(rbgdk_rval2gdkpixbufglist_body, (VALUE)&args,
157
+ rbgdk_rval2gdkpixbufglist_rescue, (VALUE)&args);
158
+
159
+ return args.result;
160
+ }
161
+
162
+ GdkAtom
163
+ rbgdk_rval2gdkatom(VALUE atom)
164
+ {
165
+ if (TYPE(atom) == T_STRING)
166
+ return gdk_atom_intern(RVAL2CSTR(atom), FALSE);
167
+ return (RVAL2GDKATOM(atom))->atom;
168
+ }
169
+ /* From Ruby/GDK3 - end */
170
+
31
171
  #define RG_TARGET_NAMESPACE mGtk
32
172
 
33
173
  static VALUE RG_TARGET_NAMESPACE;
@@ -179,10 +319,27 @@ rg_s_init(int argc, VALUE *argv, VALUE self)
179
319
  gtk_init()
180
320
  */
181
321
 
322
+ static gboolean
323
+ quit_loop(G_GNUC_UNUSED gpointer user_data)
324
+ {
325
+ gtk_main_quit();
326
+ return G_SOURCE_REMOVE;
327
+ }
328
+
182
329
  static VALUE
183
330
  rg_s_main(G_GNUC_UNUSED VALUE self)
184
331
  {
332
+ GSource *interrupt_source;
333
+
334
+ interrupt_source = rbg_interrupt_source_new();
335
+ g_source_set_callback(interrupt_source, quit_loop, NULL, NULL);
336
+ g_source_attach(interrupt_source, NULL);
185
337
  gtk_main();
338
+ g_source_destroy(interrupt_source);
339
+ g_source_unref(interrupt_source);
340
+
341
+ rb_thread_check_ints();
342
+
186
343
  return Qnil;
187
344
  }
188
345
 
@@ -569,6 +726,7 @@ Init_gtk(void)
569
726
  Init_gtk_spinner(RG_TARGET_NAMESPACE);
570
727
  #if GTK_CHECK_VERSION(3, 10, 0)
571
728
  Init_gtk_stack(RG_TARGET_NAMESPACE);
729
+ Init_gtk_stack_switcher(RG_TARGET_NAMESPACE);
572
730
  #endif
573
731
  Init_gtk_statusbar(RG_TARGET_NAMESPACE);
574
732
  Init_gtk_status_icon(RG_TARGET_NAMESPACE);
data/ext/gtk3/rbgtk3.h CHANGED
@@ -30,6 +30,39 @@
30
30
  #include <rbgobject.h>
31
31
  #include "rbgtk3conversions.h"
32
32
 
33
+ /* TODO: REMOVE ME */
34
+ /*
35
+ * They are temporary. They will be needless after Ruby/GTK3
36
+ * is based on Ruby/GObjectIntrospection.
37
+ */
38
+ /* From rbgdk3.h - start */
39
+ #include <gdk/gdk.h>
40
+ #ifdef GDK_WINDOWING_X11
41
+ # include <gdk/gdkx.h>
42
+ #endif
43
+ #ifdef GDK_WINDOWING_WIN32
44
+ # include <gdk/gdkwin32.h>
45
+ #endif
46
+
47
+ #define RVAL2GDKPIXBUFGLIST(value) rbgdk_rval2gdkpixbufglist(value)
48
+ #define RVAL2ATOM(atom) rbgdk_rval2gdkatom(atom)
49
+ #define RVAL2GDKATOMS(value, n) rbgdk_rval2gdkatoms(value, n)
50
+
51
+ #define GDK_TYPE_GEOMETRY (gdk_geometry_get_type())
52
+ #define GDK_TYPE_ATOM (gdk_atom_get_type())
53
+
54
+ typedef struct {
55
+ GdkAtom atom;
56
+ } GdkAtomData;
57
+
58
+ GType gdk_atom_get_type(void);
59
+ GType gdk_geometry_get_type(void);
60
+
61
+ GList *rbgdk_rval2gdkpixbufglist(VALUE value);
62
+ GdkAtom rbgdk_rval2gdkatom(VALUE atom);
63
+ GdkAtom *rbgdk_rval2gdkatoms(VALUE value, long *n);
64
+ /* From rbgdk3.h - end */
65
+
33
66
  #define RBGTK_MAJOR_VERSION RBGLIB_MAJOR_VERSION
34
67
  #define RBGTK_MINOR_VERSION RBGLIB_MINOR_VERSION
35
68
  #define RBGTK_MICRO_VERSION RBGLIB_MICRO_VERSION
@@ -366,7 +366,7 @@
366
366
  #define RVAL2GTKUIMANAGERITEMTYPE(o) (RVAL2GFLAGS(o, GTK_TYPE_UI_MANAGER_ITEM_TYPE))
367
367
  #define GTKUIMANAGERITEMTYPE2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_UI_MANAGER_ITEM_TYPE))
368
368
 
369
- /* For GIO. They are temporary. They will be needless after Ruby/GDK3
369
+ /* For GIO. They are temporary. They will be needless after Ruby/GTK3
370
370
  * is based on Ruby/GObjectIntrospection.
371
371
  */
372
372
  #define RVAL2GFILE(o) (G_FILE(RVAL2GOBJ(o)))
@@ -374,4 +374,63 @@
374
374
  #define RVAL2GPERMISSION(o) (G_PERMISSION(RVAL2GOBJ(o)))
375
375
  #define RVAL2GAPPLICATIONFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_APPLICATION_FLAGS))
376
376
 
377
+ /* For GDK. They are temporary. They will be needless after Ruby/GTK3
378
+ * is based on Ruby/GObjectIntrospection.
379
+ */
380
+ #define RVAL2GDKCOLOR(o) ((GdkColor*)RVAL2BOXED(o, GDK_TYPE_COLOR))
381
+ #define GDKCOLOR2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_COLOR))
382
+
383
+ #define RVAL2GDKRGBA(o) ((GdkRGBA*)RVAL2BOXED(o, GDK_TYPE_RGBA))
384
+ #define GDKRGBA2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_RGBA))
385
+
386
+ #define RVAL2GDKMODIFIERTYPE(o) (RVAL2GFLAGS(o, GDK_TYPE_MODIFIER_TYPE))
387
+
388
+ #define RVAL2GDKDRAGCONTEXT(o) (GDK_DRAG_CONTEXT(RVAL2GOBJ(o)))
389
+
390
+ #define RVAL2GDKSCREEN(o) (GDK_SCREEN(RVAL2GOBJ(o)))
391
+
392
+ #define RVAL2GDKWINDOW(o) (GDK_WINDOW(RVAL2GOBJ(o)))
393
+
394
+ #define GDKEVENT2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_EVENT))
395
+ #define RVAL2GDKEVENT(o) ((GdkEvent *)RVAL2BOXED(o, GDK_TYPE_EVENT))
396
+ #define GEV2RVAL(ev) GDKEVENT2RVAL(ev)
397
+ #define RVAL2GEV(ev) RVAL2GDKEVENT(ev)
398
+
399
+ #define GDKMODIFIERTYPE2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_MODIFIER_TYPE))
400
+
401
+ #define GDKRECTANGLE2RVAL(o) (BOXED2RVAL(o, CAIRO_GOBJECT_TYPE_RECTANGLE_INT))
402
+ #define RVAL2GDKRECTANGLE(o) ((GdkRectangle*)RVAL2BOXED(o, CAIRO_GOBJECT_TYPE_RECTANGLE_INT))
403
+
404
+ #define RVAL2GDKDISPLAYOBJECT(o) (GDK_DISPLAY_OBJECT(RVAL2GOBJ(o)))
405
+
406
+ #define GDKATOM2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_ATOM))
407
+ #define RVAL2GDKATOM(o) ((GdkAtomData*)RVAL2BOXED(o, GDK_TYPE_ATOM))
408
+
409
+ #define RVAL2GDKEVENTKEY(o) ((GdkEventKey*)RVAL2GDKEVENT(o))
410
+
411
+ #define RVAL2GDKDRAGACTION(o) (RVAL2GFLAGS(o, GDK_TYPE_DRAG_ACTION))
412
+
413
+ #define RVAL2GDKGEOMETRY(o) ((GdkGeometry*)RVAL2BOXED(o, GDK_TYPE_GEOMETRY))
414
+
415
+ #define RVAL2GDKWINDOWHINTS(o) (RVAL2GFLAGS(o, GDK_TYPE_WINDOW_HINTS))
416
+
417
+ #define RVAL2GDKWINDOWEDGE(o) (RVAL2GENUM(o, GDK_TYPE_WINDOW_EDGE))
418
+
419
+ #define RVAL2GDKDEVICE(o) (GDK_DEVICE(RVAL2GOBJ(o)))
420
+
421
+ #define RVAL2GDKEVENTMASK(o) (RVAL2GFLAGS(o, GDK_TYPE_EVENT_MASK))
422
+ #define GDKEVENTMASK2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_EVENT_MASK))
423
+
424
+ #define RVAL2GDKVISUAL(o) (GDK_VISUAL(RVAL2GOBJ(o)))
425
+
426
+ #define RVAL2GDKDRAGPROTOCOL(o) (RVAL2GENUM(o, GDK_TYPE_DRAG_PROTOCOL))
427
+
377
428
  #endif /* __RBGTK3CONVERSIONS_H__ */
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+