gtk3 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gtk3/extconf.rb +1 -1
  3. data/ext/gtk3/rbgtk-about-dialog.c +0 -6
  4. data/ext/gtk3/rbgtk-accessible.c +0 -16
  5. data/ext/gtk3/rbgtk-entry.c +4 -18
  6. data/ext/gtk3/rbgtk-header-bar.c +58 -0
  7. data/ext/gtk3/rbgtk-icon-view.c +30 -5
  8. data/ext/gtk3/rbgtk-level-bar.c +88 -0
  9. data/ext/gtk3/rbgtk-link-button.c +0 -6
  10. data/ext/gtk3/rbgtk-menu-button.c +41 -0
  11. data/ext/gtk3/rbgtk-revealer.c +42 -0
  12. data/ext/gtk3/rbgtk-search-bar.c +59 -0
  13. data/ext/gtk3/rbgtk-search-entry.c +42 -0
  14. data/ext/gtk3/rbgtk-stack.c +106 -0
  15. data/ext/gtk3/rbgtk-tree-selection.c +7 -22
  16. data/ext/gtk3/rbgtk.c +24 -3
  17. data/ext/gtk3/rbgtk3conversions.h +25 -2
  18. data/ext/gtk3/rbgtk3private.h +23 -3
  19. data/lib/1.9/gtk3.so +0 -0
  20. data/lib/2.0/gtk3.so +0 -0
  21. data/lib/2.1/gtk3.so +0 -0
  22. data/sample/gtk-demo/appwindow.rb +95 -95
  23. data/sample/gtk-demo/cairo-operator.rb +8 -8
  24. data/sample/gtk-demo/drawingarea.rb +74 -99
  25. data/sample/gtk-demo/pixbufs.rb +48 -57
  26. data/sample/misc/alpha-demo.rb +1 -1
  27. data/sample/misc/assistant.rb +45 -51
  28. data/sample/misc/cairo-pong.rb +26 -24
  29. data/sample/misc/composited-windows.rb +2 -2
  30. data/sample/misc/dnd.rb +23 -23
  31. data/sample/misc/drag-move.rb +19 -11
  32. data/sample/misc/drawing.rb +1 -1
  33. data/sample/misc/mouse-gesture.rb +3 -3
  34. data/sample/misc/pangorenderer.rb +1 -1
  35. data/sample/misc/properties.rb +1 -0
  36. data/sample/misc/to_drawable.rb +1 -1
  37. data/sample/misc/tooltips.rb +1 -1
  38. data/test/test_gtk_accessible.rb +31 -0
  39. data/test/test_gtk_entry.rb +36 -0
  40. data/test/test_gtk_header_bar.rb +66 -0
  41. data/test/test_gtk_icon_view.rb +41 -0
  42. data/test/test_gtk_level_bar.rb +82 -0
  43. data/test/test_gtk_list_store.rb +2 -1
  44. data/test/test_gtk_menu_button.rb +49 -0
  45. data/test/test_gtk_revealer.rb +57 -0
  46. data/test/test_gtk_search_bar.rb +55 -0
  47. data/test/test_gtk_search_entry.rb +34 -0
  48. data/test/test_gtk_stack.rb +115 -0
  49. data/test/test_gtk_tree_selection.rb +31 -0
  50. metadata +31 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ebf76a042ddb41e81e9e56c26d2c98f91bf17d1
4
- data.tar.gz: eb4e4c710d4b653ac9fdb6ed5a746c21312c1881
3
+ metadata.gz: 0f6d6217e6325b767b3c7d594029b027fdcc1e51
4
+ data.tar.gz: c84ec4e9131dc3a869190e80de472d00a9bc99ed
5
5
  SHA512:
6
- metadata.gz: e94ef8feffafb396a51f8f7b9c829f38a675ed32afe84192d2ff074e330cdf658280eae93d3e8d3d231fbd9cfe5f651f4b65e2989d3587b843c116d034306526
7
- data.tar.gz: bb87b706672653a66f232838dd90b2c88e8dc1a4ed28d2f3e1e5aafb40579cde9bb650c2b7155f249d7345c153faf639fe6cbcc9c65db4b1086a81b2f274a61f
6
+ metadata.gz: 834e73dd8b445a8a9f569f5ed40045a8d268e1fc9bd13a9e91f34a0d0fd78038139c4235b2b407f99a6e34fbb368396338694a300b693e2b9f2bdf6ba5f4bfb2
7
+ data.tar.gz: 09ce6d62e5de8794323805f705496db886797186609fc2dd95b7093e849f6266a5676df7f8cd9d43a13ca8883a7dd5ba5c1d078c1f1f72ca25c27f56c4c4bc6c
data/ext/gtk3/extconf.rb CHANGED
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  have_func("rb_errinfo")
35
35
 
36
- ["glib2", "gio2", "atk", "pango", "gdk_pixbuf2", "gdk3"].each do |package|
36
+ ["glib2", "atk", "pango", "gdk_pixbuf2", "gdk3"].each do |package|
37
37
  directory = "#{package}#{version_suffix}"
38
38
  build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
39
39
  add_depend_package(package, "#{directory}/ext/#{package}",
@@ -31,12 +31,6 @@ rg_initialize(VALUE self)
31
31
  return Qnil;
32
32
  }
33
33
 
34
- static void
35
- activate_link_func(GtkAboutDialog *about, const gchar *link, gpointer func)
36
- {
37
- rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(about), CSTR2RVAL(link));
38
- }
39
-
40
34
  typedef struct {
41
35
  const char *name;
42
36
  gpointer value;
@@ -31,26 +31,10 @@ rg_connect_widget_destroyed(VALUE self)
31
31
  return self;
32
32
  }
33
33
 
34
- static VALUE
35
- rg_widget(VALUE self)
36
- {
37
- return GOBJ2RVAL(gtk_accessible_get_widget(_SELF(self)));
38
- }
39
-
40
- static VALUE
41
- rg_set_widget(VALUE self, VALUE widget)
42
- {
43
- gtk_accessible_set_widget(_SELF(self), RVAL2GTKWIDGET(widget));
44
-
45
- return self;
46
- }
47
-
48
34
  void
49
35
  Init_gtk_accessible(VALUE mGtk)
50
36
  {
51
37
  VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCESSIBLE, "Accessible", mGtk);
52
38
 
53
39
  RG_DEF_METHOD(connect_widget_destroyed, 0);
54
- RG_DEF_METHOD(widget, 0);
55
- RG_DEF_METHOD(set_widget, 1);
56
40
  }
@@ -48,22 +48,6 @@ rg_layout_offsets(VALUE self)
48
48
  return rb_ary_new3(2, INT2NUM(x), INT2NUM(y));
49
49
  }
50
50
 
51
- static VALUE
52
- rg_set_completion(VALUE self, VALUE completion)
53
- {
54
- gtk_entry_set_completion(_SELF(self), RVAL2GTKENTRYCOMPLETION(completion));
55
-
56
- G_CHILD_SET(self, rb_intern("completion"), completion);
57
-
58
- return self;
59
- }
60
-
61
- static VALUE
62
- rg_completion(VALUE self)
63
- {
64
- return GOBJ2RVAL(gtk_entry_get_completion(_SELF(self)));
65
- }
66
-
67
51
  static VALUE
68
52
  rg_layout_index_to_text_index(VALUE self, VALUE layout_index)
69
53
  {
@@ -174,11 +158,13 @@ Init_gtk_entry(VALUE mGtk)
174
158
  {
175
159
  VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ENTRY, "Entry", mGtk);
176
160
 
161
+ #if GTK_CHECK_VERSION(3, 6, 0)
162
+ G_DEF_CLASS(GTK_TYPE_INPUT_PURPOSE, "InputPurpose", mGtk);
163
+ G_DEF_CLASS(GTK_TYPE_INPUT_HINTS, "InputHints", mGtk);
164
+ #endif
177
165
  RG_DEF_METHOD(initialize, 0);
178
166
  RG_DEF_METHOD(layout, 0);
179
167
  RG_DEF_METHOD(layout_offsets, 0);
180
- RG_DEF_METHOD(set_completion, 1);
181
- RG_DEF_METHOD(completion, 0);
182
168
  RG_DEF_METHOD(layout_index_to_text_index, 1);
183
169
  RG_DEF_METHOD(text_index_to_layout_index, 1);
184
170
  RG_DEF_METHOD(cursor_hadjustment, 0);
@@ -0,0 +1,58 @@
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 cHeaderBar
26
+ #define _SELF(self) (RVAL2GTKHEADERBAR(self))
27
+
28
+ static VALUE
29
+ rg_initialize(VALUE self)
30
+ {
31
+ RBGTK_INITIALIZE(self, gtk_header_bar_new());
32
+ return Qnil;
33
+ }
34
+
35
+ static VALUE
36
+ rg_pack_start(VALUE self, VALUE child_widget)
37
+ {
38
+ gtk_header_bar_pack_start(_SELF(self), RVAL2GTKWIDGET(child_widget));
39
+ return Qnil;
40
+ }
41
+
42
+ static VALUE
43
+ rg_pack_end(VALUE self, VALUE child_widget)
44
+ {
45
+ gtk_header_bar_pack_end(_SELF(self), RVAL2GTKWIDGET(child_widget));
46
+ return Qnil;
47
+ }
48
+
49
+ void
50
+ Init_gtk_header_bar(VALUE mGtk)
51
+ {
52
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HEADER_BAR, "HeaderBar", mGtk);
53
+
54
+ RG_DEF_METHOD(initialize, 0);
55
+ RG_DEF_METHOD(pack_start, 1);
56
+ RG_DEF_METHOD(pack_end, 1);
57
+ }
58
+ #endif
@@ -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) 2005 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
36
36
  RBGTK_INITIALIZE(self, gtk_icon_view_new());
37
37
  } else {
38
38
  G_CHILD_SET(self, id_model, model);
39
- RBGTK_INITIALIZE(self,
39
+ RBGTK_INITIALIZE(self,
40
40
  gtk_icon_view_new_with_model(RVAL2GTKTREEMODEL(model)));
41
41
  }
42
42
  return Qnil;
@@ -59,12 +59,34 @@ rg_selected_each(VALUE self)
59
59
  {
60
60
  VALUE func = rb_block_proc();
61
61
  G_RELATIVE(self, func);
62
- gtk_icon_view_selected_foreach(_SELF(self),
63
- (GtkIconViewForeachFunc)iview_foreach_func,
62
+ gtk_icon_view_selected_foreach(_SELF(self),
63
+ (GtkIconViewForeachFunc)iview_foreach_func,
64
64
  (gpointer)func);
65
65
  return self;
66
66
  }
67
67
 
68
+ #if GTK_CHECK_VERSION(3, 6, 0)
69
+ static VALUE
70
+ rg_get_cell_rect(int argc, VALUE *argv, VALUE self)
71
+ {
72
+ VALUE path, cell;
73
+ GdkRectangle rectangle;
74
+ gboolean found;
75
+
76
+ rb_scan_args(argc, argv, "11", &path, &cell);
77
+
78
+ found = gtk_icon_view_get_cell_rect(_SELF(self),
79
+ RVAL2GTKTREEPATH(path),
80
+ RVAL2GTKCELLRENDERER(cell),
81
+ &rectangle);
82
+ if (!found) {
83
+ return Qnil;
84
+ }
85
+
86
+ return GDKRECTANGLE2RVAL(&rectangle);
87
+ }
88
+ #endif
89
+
68
90
  static VALUE
69
91
  rg_select_path(VALUE self, VALUE path)
70
92
  {
@@ -247,6 +269,9 @@ Init_gtk_iconview(VALUE mGtk)
247
269
  RG_DEF_METHOD(get_path_at_pos, 2);
248
270
  RG_DEF_ALIAS("get_path", "get_path_at_pos");
249
271
  RG_DEF_METHOD(selected_each, 0);
272
+ #if GTK_CHECK_VERSION(3, 6, 0)
273
+ RG_DEF_METHOD(get_cell_rect, -1);
274
+ #endif
250
275
  RG_DEF_METHOD(select_path, 1);
251
276
  RG_DEF_METHOD(unselect_path, 1);
252
277
  RG_DEF_METHOD_P(path_is_selected, 1);
@@ -256,7 +281,7 @@ Init_gtk_iconview(VALUE mGtk)
256
281
  RG_DEF_METHOD(enable_model_drag_dest, 2);
257
282
  RG_DEF_METHOD(enable_model_drag_source, 3);
258
283
  RG_DEF_METHOD(cursor, 0);
259
- RG_DEF_METHOD(get_dest_item, 2);
284
+ RG_DEF_METHOD(get_dest_item, 2);
260
285
  RG_DEF_METHOD(drag_dest_item, 0);
261
286
  RG_DEF_METHOD(get_item, 2);
262
287
  RG_DEF_METHOD(visible_range, 0);
@@ -0,0 +1,88 @@
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, 6, 0)
24
+
25
+ #define RG_TARGET_NAMESPACE cLevelBar
26
+ #define _SELF(self) (RVAL2GTKLEVELBAR(self))
27
+
28
+ static VALUE
29
+ rg_initialize(int argc, VALUE *argv, VALUE self)
30
+ {
31
+ VALUE min_value, max_value;
32
+ GtkWidget* widget = NULL;
33
+
34
+ rb_scan_args(argc, argv, "02", &min_value, &max_value);
35
+ if (argc == 0) {
36
+ widget = gtk_level_bar_new();
37
+ } else {
38
+ widget = gtk_level_bar_new_for_interval(NUM2DBL(min_value),
39
+ NUM2DBL(max_value));
40
+ }
41
+
42
+ RBGTK_INITIALIZE(self, widget);
43
+ return Qnil;
44
+ }
45
+
46
+ static VALUE
47
+ rg_add_offset_value(VALUE self, VALUE name, VALUE value)
48
+ {
49
+ gtk_level_bar_add_offset_value(_SELF(self),
50
+ RVAL2CSTR(name), NUM2DBL(value));
51
+ return self;
52
+ }
53
+
54
+ static VALUE
55
+ rg_remove_offset_value(VALUE self, VALUE name)
56
+ {
57
+ gtk_level_bar_remove_offset_value(_SELF(self), RVAL2CSTR(name));
58
+ return self;
59
+ }
60
+
61
+ static VALUE
62
+ rg_get_offset_value(VALUE self, VALUE name)
63
+ {
64
+ gdouble value;
65
+ gboolean found;
66
+ found = gtk_level_bar_get_offset_value(_SELF(self),
67
+ RVAL2CSTR_ACCEPT_NIL(name),
68
+ &value);
69
+ if (found) {
70
+ return DBL2NUM(value);
71
+ } else {
72
+ return Qnil;
73
+ }
74
+ }
75
+
76
+ void
77
+ Init_gtk_level_bar(VALUE mGtk)
78
+ {
79
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LEVEL_BAR, "LevelBar", mGtk);
80
+ G_DEF_CLASS(GTK_TYPE_LEVEL_BAR_MODE, "Mode", RG_TARGET_NAMESPACE);
81
+ rb_define_const(RG_TARGET_NAMESPACE, "OFFSET_LOW", CSTR2RVAL(GTK_LEVEL_BAR_OFFSET_LOW));
82
+ rb_define_const(RG_TARGET_NAMESPACE, "OFFSET_HIGH", CSTR2RVAL(GTK_LEVEL_BAR_OFFSET_HIGH));
83
+ RG_DEF_METHOD(initialize, -1);
84
+ RG_DEF_METHOD(add_offset_value, 2);
85
+ RG_DEF_METHOD(remove_offset_value, 1);
86
+ RG_DEF_METHOD(get_offset_value, 1);
87
+ }
88
+ #endif
@@ -40,12 +40,6 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
40
40
  return Qnil;
41
41
  }
42
42
 
43
- static void
44
- link_func(GtkLinkButton *button, const gchar *link, gpointer func)
45
- {
46
- rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(button), CSTR2RVAL(link));
47
- }
48
-
49
43
  void
50
44
  Init_gtk_link_button(VALUE mGtk)
51
45
  {
@@ -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,6,0)
24
+
25
+ #define RG_TARGET_NAMESPACE cMenuButton
26
+
27
+ static VALUE
28
+ rg_initialize(VALUE self)
29
+ {
30
+ RBGTK_INITIALIZE(self, gtk_menu_button_new());
31
+ return Qnil;
32
+ }
33
+
34
+ void
35
+ Init_gtk_menu_button(VALUE mGtk)
36
+ {
37
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_BUTTON, "MenuButton", mGtk);
38
+
39
+ RG_DEF_METHOD(initialize, 0);
40
+ }
41
+ #endif
@@ -0,0 +1,42 @@
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 cRevealer
26
+
27
+ static VALUE
28
+ rg_initialize(VALUE self)
29
+ {
30
+ RBGTK_INITIALIZE(self, gtk_revealer_new());
31
+ return Qnil;
32
+ }
33
+
34
+ void
35
+ Init_gtk_revealer(VALUE mGtk)
36
+ {
37
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_REVEALER, "Revealer", mGtk);
38
+
39
+ G_DEF_CLASS(GTK_TYPE_REVEALER_TRANSITION_TYPE, "TransitionType", RG_TARGET_NAMESPACE);
40
+ RG_DEF_METHOD(initialize, 0);
41
+ }
42
+ #endif
@@ -0,0 +1,59 @@
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 cSearchBar
26
+ #define _SELF(self) (RVAL2GTKSEARCHBAR(self))
27
+
28
+ static VALUE
29
+ rg_initialize(VALUE self)
30
+ {
31
+ RBGTK_INITIALIZE(self, gtk_search_bar_new());
32
+ return Qnil;
33
+ }
34
+
35
+ static VALUE
36
+ rg_connect_entry(VALUE self, VALUE entry)
37
+ {
38
+ gtk_search_bar_connect_entry(_SELF(self), RVAL2GTKENTRY(entry));
39
+ return self;
40
+ }
41
+
42
+ static VALUE
43
+ rg_handle_event_p(VALUE self, VALUE event)
44
+ {
45
+ gboolean handle = gtk_search_bar_handle_event(_SELF(self),
46
+ RVAL2GDKEVENT(event));
47
+ return CBOOL2RVAL(handle);
48
+ }
49
+
50
+ void
51
+ Init_gtk_search_bar(VALUE mGtk)
52
+ {
53
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SEARCH_BAR, "SearchBar", mGtk);
54
+
55
+ RG_DEF_METHOD(initialize, 0);
56
+ RG_DEF_METHOD(connect_entry, 1);
57
+ RG_DEF_METHOD_P(handle_event, 1);
58
+ }
59
+ #endif