gtk3 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +0 -1
- data/ext/gtk3/extconf.rb +4 -1
- data/ext/gtk3/rbgtk-action-group.c +2 -1
- data/ext/gtk3/rbgtk-binding-set.c +0 -10
- data/ext/gtk3/rbgtk-cell-renderer.c +10 -7
- data/ext/gtk3/rbgtk-cell-view.c +0 -14
- data/ext/gtk3/rbgtk-container.c +12 -8
- data/ext/gtk3/rbgtk-file-chooser.c +4 -7
- data/ext/gtk3/rbgtk-icon-info.c +2 -2
- data/ext/gtk3/rbgtk-style-properties.c +12 -13
- data/ext/gtk3/rbgtk-style-provider.c +12 -13
- data/ext/gtk3/rbgtk-widget.c +11 -21
- data/ext/gtk3/rbgtk.c +36 -1
- data/ext/gtk3/rbgtk3conversions.h +9 -2
- data/ext/gtk3/rbgtk3private.h +1 -7
- data/lib/gtk3/deprecated.rb +4 -1
- data/sample/gtk-demo/colorsel.rb +23 -25
- data/sample/gtk-demo/common.rb +8 -8
- data/sample/gtk-demo/css_accordion.css +53 -0
- data/sample/gtk-demo/css_accordion.rb +75 -0
- data/sample/gtk-demo/main.rb +83 -83
- data/sample/gtk-demo/reset.css +69 -0
- data/test/test_gc.rb +1 -1
- data/test/test_gtk.rb +23 -0
- data/test/test_gtk_about_dialog.rb +0 -1
- data/test/test_gtk_buildable.rb +3 -13
- data/test/test_gtk_builder.rb +3 -25
- data/test/test_gtk_container.rb +32 -0
- data/test/test_gtk_css_provider.rb +27 -0
- data/test/test_gtk_entry.rb +0 -2
- data/test/test_gtk_icon_theme.rb +11 -10
- data/test/test_gtk_image.rb +2 -2
- data/test/test_gtk_list_store.rb +0 -4
- data/test/test_gtk_style_context.rb +30 -0
- data/test/test_gtk_style_properties.rb +38 -0
- data/test/test_gtk_widget.rb +3 -11
- metadata +28 -35
- data/test/test_gtk_rc_style.rb +0 -14
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 008001edd9893b2eb3f2fd9e4560107ab9580b29
|
4
|
+
data.tar.gz: 6c1603cd67b6d32fafb039ffd303a3d4304dfd80
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2af2b63fc528e416299d78f2d0784d52911a8da25364df68213aa0f6f00ae409a0c5bc8e32230a90d98d837b4b3f5a30f8d796dd41df55b61045a1258f7ab9bf
|
7
|
+
data.tar.gz: 34f398f7001a7489697320fc2ba78027caf8915cb9fc857571ca135fcaec516bcee0702778c7898247a220d9106e43a5fb251c61629bd92c20d7b08b633d5632
|
data/Rakefile
CHANGED
data/ext/gtk3/extconf.rb
CHANGED
@@ -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-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2004-2006 Masao Mutoh
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -325,6 +325,7 @@ rbg_rval2gtkradioactionentries_body(VALUE value)
|
|
325
325
|
args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]);
|
326
326
|
case 1:
|
327
327
|
args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]);
|
328
|
+
break;
|
328
329
|
default:
|
329
330
|
rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..6)", n);
|
330
331
|
}
|
@@ -126,15 +126,6 @@ rg_add_signal(int argc, VALUE *argv, VALUE self)
|
|
126
126
|
return self;
|
127
127
|
}
|
128
128
|
|
129
|
-
static VALUE
|
130
|
-
rg_add_path(VALUE self, VALUE path_type, VALUE path_pattern, VALUE priority)
|
131
|
-
{
|
132
|
-
gtk_binding_set_add_path(_SELF(self), RVAL2GTKPATHTYPE(path_type),
|
133
|
-
RVAL2CSTR(path_pattern),
|
134
|
-
RVAL2GTKPATHPRIORITYTYPE(priority));
|
135
|
-
return self;
|
136
|
-
}
|
137
|
-
|
138
129
|
static VALUE
|
139
130
|
rg_entry_remove(VALUE self, VALUE keyval, VALUE modifiers)
|
140
131
|
{
|
@@ -158,7 +149,6 @@ Init_gtk_bindings(VALUE mGtk)
|
|
158
149
|
RG_DEF_METHOD(activate, 3);
|
159
150
|
RG_DEF_METHOD(add_signal, -1);
|
160
151
|
RG_DEF_ALIAS("entry_add_signal", "add_signal");
|
161
|
-
RG_DEF_METHOD(add_path, 3);
|
162
152
|
RG_DEF_METHOD(entry_remove, 2);
|
163
153
|
RG_DEF_METHOD(entry_skip, 2);
|
164
154
|
}
|
@@ -25,14 +25,17 @@
|
|
25
25
|
#define _SELF(s) (RVAL2GTKCELLRENDERER(s))
|
26
26
|
|
27
27
|
static VALUE
|
28
|
-
|
28
|
+
rg_get_preferred_size(VALUE self, VALUE widget)
|
29
29
|
{
|
30
|
-
|
30
|
+
GtkRequisition minimum_size, natural_size;
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
gtk_cell_renderer_get_preferred_size(_SELF(self),
|
33
|
+
RVAL2GTKWIDGET(widget),
|
34
|
+
&minimum_size, &natural_size);
|
35
|
+
|
36
|
+
return rb_ary_new3(2,
|
37
|
+
GTKREQUISITION2RVAL(&minimum_size),
|
38
|
+
GTKREQUISITION2RVAL(&natural_size));
|
36
39
|
}
|
37
40
|
|
38
41
|
/* TODO
|
@@ -101,7 +104,7 @@ Init_gtk_cellrenderer(VALUE mGtk)
|
|
101
104
|
{
|
102
105
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER, "CellRenderer", mGtk);
|
103
106
|
|
104
|
-
RG_DEF_METHOD(
|
107
|
+
RG_DEF_METHOD(get_preferred_size, 1);
|
105
108
|
/* TODO
|
106
109
|
RG_DEF_METHOD(render, 6);
|
107
110
|
*/
|
data/ext/gtk3/rbgtk-cell-view.c
CHANGED
@@ -75,19 +75,6 @@ rg_displayed_row(VALUE self)
|
|
75
75
|
return GTKTREEPATH2RVAL(gtk_cell_view_get_displayed_row(_SELF(self)));
|
76
76
|
}
|
77
77
|
|
78
|
-
static VALUE
|
79
|
-
rg_get_size_of_row(VALUE self, VALUE path)
|
80
|
-
{
|
81
|
-
GtkRequisition req;
|
82
|
-
gboolean ret = gtk_cell_view_get_size_of_row(_SELF(self),
|
83
|
-
RVAL2GTKTREEPATH(path),
|
84
|
-
&req);
|
85
|
-
if (! ret)
|
86
|
-
rb_raise(rb_eRuntimeError, "Can't get the value");
|
87
|
-
|
88
|
-
return rb_ary_assoc(INT2NUM(req.width), INT2NUM(req.height));
|
89
|
-
}
|
90
|
-
|
91
78
|
/* Use Gtk::CellView#background_gdk(Gdk::Color) instead.
|
92
79
|
void gtk_cell_view_set_background_color
|
93
80
|
(GtkCellView *cell_view,
|
@@ -105,5 +92,4 @@ Init_gtk_cellview(VALUE mGtk)
|
|
105
92
|
RG_DEF_METHOD(initialize, -1);
|
106
93
|
RG_DEF_METHOD(set_displayed_row, 1);
|
107
94
|
RG_DEF_METHOD(displayed_row, 0);
|
108
|
-
RG_DEF_METHOD(get_size_of_row, 1);
|
109
95
|
}
|
data/ext/gtk3/rbgtk-container.c
CHANGED
@@ -146,7 +146,7 @@ rg_child_type(VALUE self)
|
|
146
146
|
return GTYPE2CLASS(gtk_container_child_type(_SELF(self)));
|
147
147
|
}
|
148
148
|
|
149
|
-
/*
|
149
|
+
/*
|
150
150
|
void gtk_container_child_get (GtkContainer *container,
|
151
151
|
GtkWidget *child,
|
152
152
|
const gchar *first_prop_name,
|
@@ -229,7 +229,7 @@ rg_child_get_property(VALUE self, VALUE child, VALUE prop_name)
|
|
229
229
|
}
|
230
230
|
}
|
231
231
|
g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec));
|
232
|
-
gtk_container_child_get_property(RVAL2GTKCONTAINER(self),
|
232
|
+
gtk_container_child_get_property(RVAL2GTKCONTAINER(self),
|
233
233
|
RVAL2GTKWIDGET(child),
|
234
234
|
name , &gval);
|
235
235
|
ret = getter ? getter(&gval) : GVAL2RVAL(&gval);
|
@@ -282,7 +282,7 @@ rg_child_set_property(VALUE self, VALUE child, VALUE prop_name, VALUE val)
|
|
282
282
|
|
283
283
|
G_CHILD_ADD(child, val);
|
284
284
|
|
285
|
-
gtk_container_child_set_property(RVAL2GTKCONTAINER(self),
|
285
|
+
gtk_container_child_set_property(RVAL2GTKCONTAINER(self),
|
286
286
|
RVAL2GTKWIDGET(child), name, &gval);
|
287
287
|
|
288
288
|
g_value_unset(&gval);
|
@@ -312,7 +312,7 @@ rg_add(int argc, VALUE *argv, VALUE self)
|
|
312
312
|
ary = rb_funcall(properties, rb_intern("to_a"), 0);
|
313
313
|
|
314
314
|
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
315
|
-
rg_child_set_property(self, other,
|
315
|
+
rg_child_set_property(self, other,
|
316
316
|
RARRAY_PTR(RARRAY_PTR(ary)[i])[0],
|
317
317
|
RARRAY_PTR(RARRAY_PTR(ary)[i])[1]);
|
318
318
|
}
|
@@ -345,9 +345,13 @@ rg_propagate_expose(VALUE self, VALUE child, VALUE event)
|
|
345
345
|
static VALUE
|
346
346
|
rg_focus_chain(VALUE self)
|
347
347
|
{
|
348
|
-
gboolean
|
348
|
+
gboolean set_explicitly;
|
349
349
|
GList *glist = NULL;
|
350
|
-
|
350
|
+
|
351
|
+
set_explicitly = gtk_container_get_focus_chain(_SELF(self), &glist);
|
352
|
+
if (!set_explicitly) {
|
353
|
+
return Qnil;
|
354
|
+
}
|
351
355
|
return GOBJGLIST2RVAL_FREE(glist, g_list_free, NULL);
|
352
356
|
}
|
353
357
|
|
@@ -458,7 +462,7 @@ rg_s_install_child_property(int argc, VALUE *argv, VALUE self)
|
|
458
462
|
rb_class2name(self));
|
459
463
|
|
460
464
|
gclass = GTK_CONTAINER_CLASS(g_type_class_ref(cinfo->gtype));
|
461
|
-
gtk_container_class_install_child_property(gclass,
|
465
|
+
gtk_container_class_install_child_property(gclass,
|
462
466
|
NIL_P(prop_id) ? 1 : NUM2UINT(prop_id),
|
463
467
|
pspec);
|
464
468
|
|
@@ -663,7 +667,7 @@ rg_s_type_register(int argc, VALUE* argv, VALUE self)
|
|
663
667
|
VALUE s = rb_funcall(self, rb_intern("name"), 0);
|
664
668
|
|
665
669
|
if (strlen(StringValuePtr(s)) == 0)
|
666
|
-
rb_raise(rb_eTypeError, "can't determine type name");
|
670
|
+
rb_raise(rb_eTypeError, "can't determine type name");
|
667
671
|
|
668
672
|
type_name = rb_funcall(
|
669
673
|
rb_eval_string("lambda{|x| x.gsub(/::/,'') }"),
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C)
|
4
|
-
* Copyright (C) 2005,2006 Ruby-GNOME2 Project Team
|
3
|
+
* Copyright (C) 2005-2013 Ruby-GNOME2 Project Team
|
5
4
|
* Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh
|
6
5
|
*
|
7
6
|
* This library is free software; you can redistribute it and/or
|
@@ -289,10 +288,9 @@ rg_preview_file(VALUE self)
|
|
289
288
|
static VALUE
|
290
289
|
rg_select_file(VALUE self, VALUE file)
|
291
290
|
{
|
292
|
-
gboolean result;
|
293
291
|
GError *error = NULL;
|
294
292
|
|
295
|
-
|
293
|
+
gtk_file_chooser_select_file(_SELF(self), RVAL2GFILE(file), &error);
|
296
294
|
if (error)
|
297
295
|
RAISE_GERROR(error);
|
298
296
|
|
@@ -315,10 +313,9 @@ rg_set_current_folder_file(VALUE self, VALUE file)
|
|
315
313
|
static VALUE
|
316
314
|
rg_set_file(VALUE self, VALUE file)
|
317
315
|
{
|
318
|
-
gboolean result;
|
319
316
|
GError *error = NULL;
|
320
317
|
|
321
|
-
|
318
|
+
gtk_file_chooser_set_file(_SELF(self), RVAL2GFILE(file), &error);
|
322
319
|
if (error)
|
323
320
|
RAISE_GERROR(error);
|
324
321
|
|
@@ -376,7 +373,7 @@ Init_gtk_file_chooser(VALUE mGtk)
|
|
376
373
|
RG_DEF_METHOD(unselect_file, 1);
|
377
374
|
|
378
375
|
G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_ACTION, "Action", RG_TARGET_NAMESPACE);
|
379
|
-
G_DEF_ERROR(GTK_FILE_CHOOSER_ERROR, "FileChooserError", mGtk, rb_eRuntimeError,
|
376
|
+
G_DEF_ERROR(GTK_FILE_CHOOSER_ERROR, "FileChooserError", mGtk, rb_eRuntimeError,
|
380
377
|
GTK_TYPE_FILE_CHOOSER_ERROR);
|
381
378
|
G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_CONFIRMATION, "Confirmation", RG_TARGET_NAMESPACE);
|
382
379
|
|
data/ext/gtk3/rbgtk-icon-info.c
CHANGED
@@ -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-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2004 Masao Mutoh
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -100,7 +100,7 @@ rg_display_name(VALUE self)
|
|
100
100
|
}
|
101
101
|
|
102
102
|
void
|
103
|
-
|
103
|
+
Init_gtk_icon_info(VALUE mGtk)
|
104
104
|
{
|
105
105
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_INFO, "IconInfo", mGtk);
|
106
106
|
|
@@ -43,19 +43,18 @@ static VALUE
|
|
43
43
|
rg_get_property(VALUE self, VALUE property, VALUE state)
|
44
44
|
{
|
45
45
|
GValue value = G_VALUE_INIT;
|
46
|
-
gboolean
|
47
|
-
VALUE
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
if (
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
return ret;
|
46
|
+
gboolean exist;
|
47
|
+
VALUE rb_value = Qnil;
|
48
|
+
|
49
|
+
exist = gtk_style_properties_get_property(_SELF(self),
|
50
|
+
RVAL2CSTR(property),
|
51
|
+
RVAL2GTKSTATEFLAGS(state),
|
52
|
+
&value);
|
53
|
+
if (exist) {
|
54
|
+
rb_value = GVAL2RVAL_UNSET(&value);
|
55
|
+
}
|
56
|
+
|
57
|
+
return rb_value;
|
59
58
|
}
|
60
59
|
|
61
60
|
static VALUE
|
@@ -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-2013 Ruby-GNOME2 Project Team
|
4
4
|
*
|
5
5
|
* This library is free software; you can redistribute it and/or
|
6
6
|
* modify it under the terms of the GNU Lesser General Public
|
@@ -41,20 +41,19 @@ static VALUE
|
|
41
41
|
rg_get_style_property(VALUE self, VALUE path, VALUE state, VALUE pspec)
|
42
42
|
{
|
43
43
|
GValue value = G_VALUE_INIT;
|
44
|
-
gboolean
|
45
|
-
VALUE
|
44
|
+
gboolean exist;
|
45
|
+
VALUE property = Qnil;
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
if (
|
53
|
-
|
54
|
-
|
55
|
-
}
|
47
|
+
exist = gtk_style_provider_get_style_property(_SELF(self),
|
48
|
+
RVAL2GTKWIDGETPATH(path),
|
49
|
+
RVAL2GTKSTATEFLAGS(state),
|
50
|
+
RVAL2GPARAMSPEC(pspec),
|
51
|
+
&value);
|
52
|
+
if (exist) {
|
53
|
+
property = GVAL2RVAL_UNSET(&value);
|
54
|
+
}
|
56
55
|
|
57
|
-
return
|
56
|
+
return property;
|
58
57
|
}
|
59
58
|
|
60
59
|
void
|
data/ext/gtk3/rbgtk-widget.c
CHANGED
@@ -144,7 +144,7 @@ rg_remove_accelerator(VALUE self, VALUE accel, VALUE key, VALUE mod)
|
|
144
144
|
static VALUE
|
145
145
|
rg_set_accel_path(VALUE self, VALUE accel_path, VALUE accel_group)
|
146
146
|
{
|
147
|
-
gtk_widget_set_accel_path(_SELF(self), RVAL2CSTR(accel_path),
|
147
|
+
gtk_widget_set_accel_path(_SELF(self), RVAL2CSTR(accel_path),
|
148
148
|
RVAL2GTKACCELGROUP(accel_group));
|
149
149
|
return self;
|
150
150
|
}
|
@@ -202,7 +202,7 @@ rg_grab_default(VALUE self)
|
|
202
202
|
static VALUE
|
203
203
|
rg_set_parent_window(VALUE self, VALUE parent_window)
|
204
204
|
{
|
205
|
-
gtk_widget_set_parent_window(_SELF(self),
|
205
|
+
gtk_widget_set_parent_window(_SELF(self),
|
206
206
|
RVAL2GDKWINDOW(parent_window));
|
207
207
|
return self;
|
208
208
|
}
|
@@ -238,15 +238,6 @@ rg_visual(VALUE self)
|
|
238
238
|
return GOBJ2RVAL(gtk_widget_get_visual(_SELF(self)));
|
239
239
|
}
|
240
240
|
|
241
|
-
static VALUE
|
242
|
-
rg_pointer(VALUE self)
|
243
|
-
{
|
244
|
-
int x, y;
|
245
|
-
|
246
|
-
gtk_widget_get_pointer(_SELF(self), &x, &y);
|
247
|
-
return rb_assoc_new(INT2FIX(x), INT2FIX(y));
|
248
|
-
}
|
249
|
-
|
250
241
|
static VALUE
|
251
242
|
rg_ancestor_p(VALUE self, VALUE ancestor)
|
252
243
|
{
|
@@ -406,10 +397,10 @@ rg_s_install_style_property(VALUE self, VALUE spec)
|
|
406
397
|
if (rb_block_given_p()){
|
407
398
|
VALUE func = rb_block_proc();
|
408
399
|
rb_hash_aset(style_prop_func_table, spec, func);
|
409
|
-
gtk_widget_class_install_style_property_parser(gclass, pspec,
|
400
|
+
gtk_widget_class_install_style_property_parser(gclass, pspec,
|
410
401
|
(GtkRcPropertyParser)rc_property_parser);
|
411
402
|
} else {
|
412
|
-
gtk_widget_class_install_style_property(gclass, pspec);
|
403
|
+
gtk_widget_class_install_style_property(gclass, pspec);
|
413
404
|
}
|
414
405
|
return self;
|
415
406
|
}
|
@@ -471,7 +462,7 @@ rg_s_style_properties(int argc, VALUE *argv, VALUE self)
|
|
471
462
|
static VALUE
|
472
463
|
rg_region_intersect(VALUE self, VALUE region)
|
473
464
|
{
|
474
|
-
return CRREGION2RVAL(gtk_widget_region_intersect(_SELF(self),
|
465
|
+
return CRREGION2RVAL(gtk_widget_region_intersect(_SELF(self),
|
475
466
|
RVAL2CRREGION(region)));
|
476
467
|
}
|
477
468
|
|
@@ -796,7 +787,7 @@ static VALUE
|
|
796
787
|
widget_signal_size_request(G_GNUC_UNUSED guint num, const GValue *values)
|
797
788
|
{
|
798
789
|
GtkRequisition* req = (GtkRequisition*)g_value_get_boxed(&values[1]);
|
799
|
-
return rb_ary_new3(2, GVAL2RVAL(&values[0]),
|
790
|
+
return rb_ary_new3(2, GVAL2RVAL(&values[0]),
|
800
791
|
rb_ary_new3(2, INT2NUM(req->width), INT2NUM(req->height)));
|
801
792
|
}
|
802
793
|
static VALUE
|
@@ -1167,10 +1158,10 @@ rg_drag_dest_set(VALUE self, VALUE flags, VALUE targets, VALUE actions)
|
|
1167
1158
|
static VALUE
|
1168
1159
|
rg_drag_dest_set_proxy(VALUE self, VALUE proxy_window, VALUE protocol, VALUE use_coordinates)
|
1169
1160
|
{
|
1170
|
-
gtk_drag_dest_set_proxy(_SELF(self),
|
1161
|
+
gtk_drag_dest_set_proxy(_SELF(self),
|
1171
1162
|
RVAL2GDKWINDOW(proxy_window),
|
1172
|
-
RVAL2GDKDRAGPROTOCOL(protocol),
|
1173
|
-
RVAL2CBOOL(use_coordinates));
|
1163
|
+
RVAL2GDKDRAGPROTOCOL(protocol),
|
1164
|
+
RVAL2CBOOL(use_coordinates));
|
1174
1165
|
return self;
|
1175
1166
|
}
|
1176
1167
|
|
@@ -1205,7 +1196,7 @@ rg_drag_dest_get_target_list(VALUE self)
|
|
1205
1196
|
static VALUE
|
1206
1197
|
rg_drag_dest_set_target_list(VALUE self, VALUE target_list)
|
1207
1198
|
{
|
1208
|
-
gtk_drag_dest_set_target_list(_SELF(self),
|
1199
|
+
gtk_drag_dest_set_target_list(_SELF(self),
|
1209
1200
|
NIL_P(target_list) ? NULL : RVAL2GTKTARGETLIST(target_list));
|
1210
1201
|
|
1211
1202
|
return self;
|
@@ -1282,7 +1273,7 @@ rg_drag_begin(VALUE self, VALUE target_list, VALUE actions, VALUE button, VALUE
|
|
1282
1273
|
static VALUE
|
1283
1274
|
rg_drag_threshold_p(VALUE self, VALUE start_x, VALUE start_y, VALUE current_x, VALUE current_y)
|
1284
1275
|
{
|
1285
|
-
return CBOOL2RVAL(gtk_drag_check_threshold(_SELF(self),
|
1276
|
+
return CBOOL2RVAL(gtk_drag_check_threshold(_SELF(self),
|
1286
1277
|
NUM2INT(start_x), NUM2INT(start_y),
|
1287
1278
|
NUM2INT(current_x), NUM2INT(current_y)));
|
1288
1279
|
}
|
@@ -1422,7 +1413,6 @@ Init_gtk_widget(VALUE mGtk)
|
|
1422
1413
|
RG_DEF_METHOD(toplevel, 0);
|
1423
1414
|
RG_DEF_METHOD(get_ancestor, 1);
|
1424
1415
|
RG_DEF_METHOD(visual, 0);
|
1425
|
-
RG_DEF_METHOD(pointer, 0);
|
1426
1416
|
RG_DEF_METHOD_P(ancestor, 1);
|
1427
1417
|
RG_DEF_METHOD(translate_coordinates, 3);
|
1428
1418
|
RG_DEF_METHOD(hide_on_delete, 0);
|
data/ext/gtk3/rbgtk.c
CHANGED
@@ -314,6 +314,40 @@ rg_s_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE m
|
|
314
314
|
return CBOOL2RVAL(ret == NULL);
|
315
315
|
}
|
316
316
|
|
317
|
+
static VALUE
|
318
|
+
rg_s_show_uri(G_GNUC_UNUSED VALUE self, VALUE rb_uri_or_options)
|
319
|
+
{
|
320
|
+
VALUE rb_screen = Qnil;
|
321
|
+
VALUE rb_uri = Qnil;
|
322
|
+
VALUE rb_timestamp = Qnil;
|
323
|
+
GdkScreen *screen = NULL;
|
324
|
+
const gchar *uri = NULL;
|
325
|
+
guint32 timestamp = GDK_CURRENT_TIME;
|
326
|
+
GError *error = NULL;
|
327
|
+
|
328
|
+
if (TYPE(rb_uri_or_options) == T_HASH) {
|
329
|
+
rbg_scan_options(rb_uri_or_options,
|
330
|
+
"screen", &rb_screen,
|
331
|
+
"uri", &rb_uri,
|
332
|
+
"timestamp", &rb_timestamp,
|
333
|
+
NULL);
|
334
|
+
} else {
|
335
|
+
rb_uri = rb_uri_or_options;
|
336
|
+
}
|
337
|
+
|
338
|
+
screen = RVAL2GOBJ(rb_screen);
|
339
|
+
uri = StringValueCStr(rb_uri);
|
340
|
+
if (!NIL_P(rb_timestamp)) {
|
341
|
+
timestamp = NUM2UINT(rb_timestamp);
|
342
|
+
}
|
343
|
+
|
344
|
+
if (!gtk_show_uri(screen, uri, timestamp, &error)) {
|
345
|
+
RAISE_GERROR(error);
|
346
|
+
}
|
347
|
+
|
348
|
+
return self;
|
349
|
+
}
|
350
|
+
|
317
351
|
void
|
318
352
|
Init_gtk(void)
|
319
353
|
{
|
@@ -355,6 +389,7 @@ Init_gtk(void)
|
|
355
389
|
RG_DEF_SMETHOD(propagate_event, 2);
|
356
390
|
RG_DEF_SMETHOD(check_version, 3);
|
357
391
|
RG_DEF_SMETHOD_P(check_version, 3);
|
392
|
+
RG_DEF_SMETHOD(show_uri, 1);
|
358
393
|
|
359
394
|
rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_RESIZE", INT2FIX(GTK_PRIORITY_RESIZE));
|
360
395
|
|
@@ -442,7 +477,7 @@ Init_gtk(void)
|
|
442
477
|
Init_gtk_handle_box(RG_TARGET_NAMESPACE);
|
443
478
|
Init_gtk_hsv(RG_TARGET_NAMESPACE);
|
444
479
|
Init_gtk_icon_factory(RG_TARGET_NAMESPACE);
|
445
|
-
|
480
|
+
Init_gtk_icon_info(RG_TARGET_NAMESPACE);
|
446
481
|
Init_gtk_icon_set(RG_TARGET_NAMESPACE);
|
447
482
|
Init_gtk_icon_size(RG_TARGET_NAMESPACE);
|
448
483
|
Init_gtk_icon_source(RG_TARGET_NAMESPACE);
|