gdk3 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 +6 -2
- data/ext/gdk3/extconf.rb +4 -1
- data/ext/gdk3/gdk3.def +2 -2
- data/ext/gdk3/rbgdk.c +5 -51
- data/ext/gdk3/rbgdk3.h +6 -4
- data/ext/gdk3/rbgdk3conversions.h +5 -2
- data/ext/gdk3/rbgdk3private.h +1 -6
- data/ext/gdk3/rbgdkcairo.c +0 -4
- data/ext/gdk3/rbgdkdevice.c +60 -4
- data/ext/gdk3/rbgdkdevicemanager.c +39 -0
- data/ext/gdk3/rbgdkdisplay.c +8 -63
- data/ext/gdk3/rbgdkevent.c +644 -396
- data/ext/gdk3/rbgdkwindow.c +29 -32
- data/lib/gdk3/deprecated.rb +13 -1
- data/test/test-gdk-event.rb +598 -0
- data/test/test-gdk-rgba.rb +2 -2
- metadata +14 -18
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 515e58969322acc068898a33890c32c64fc2db3b
|
4
|
+
data.tar.gz: 3963f892f9bab2a5a1b20a6cb225fbcb2e235e81
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d77b921fa1e1f56bc875dfe601035400010bbf24260c9e8129a826e191a78f5758a6d041f2d4040ec5af32de0efbab739371a4c8517451cf86f2262a7faba558
|
7
|
+
data.tar.gz: f487d9c51c11b8fd0fb8ddfbe84f598119feee03662ea8ada1130cef4e70395a361236e5f962e783c91ae91b321d255ede465252c6c90c19f0be41a1063942ef
|
data/Rakefile
CHANGED
@@ -26,15 +26,19 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
26
26
|
:name => "gtk+",
|
27
27
|
:download_site => :gnome,
|
28
28
|
:label => "GTK+",
|
29
|
-
:version => "3.
|
29
|
+
:version => "3.10.6",
|
30
30
|
:compression_method => "xz",
|
31
31
|
:windows => {
|
32
32
|
:configure_args => [
|
33
33
|
"--enable-introspection",
|
34
34
|
],
|
35
|
+
:patches => [
|
36
|
+
"gdk+-3.10.6-remove-def-use.diff",
|
37
|
+
],
|
38
|
+
:need_autoreconf => true,
|
39
|
+
:built_file => "bin/libgdk-3-0.dll",
|
35
40
|
},
|
36
41
|
}
|
37
42
|
]
|
38
|
-
package.required_ruby_version = ">= 1.9.2"
|
39
43
|
end
|
40
44
|
package_task.define
|
data/ext/gdk3/extconf.rb
CHANGED
data/ext/gdk3/gdk3.def
CHANGED
data/ext/gdk3/rbgdk.c
CHANGED
@@ -228,7 +228,7 @@ rg_s_display(G_GNUC_UNUSED VALUE self)
|
|
228
228
|
return CSTR2RVAL(gdk_get_display());
|
229
229
|
}
|
230
230
|
|
231
|
-
#ifdef HAVE_X11_XLIB_H
|
231
|
+
#ifdef HAVE_X11_XLIB_H
|
232
232
|
#ifdef HAVE_XGETERRORTEXT
|
233
233
|
#include <X11/Xlib.h>
|
234
234
|
#include <errno.h>
|
@@ -262,12 +262,12 @@ rbgdk_x_io_error(Display *display)
|
|
262
262
|
|
263
263
|
error = g_strerror(errno_saved);
|
264
264
|
|
265
|
-
rb_funcall((VALUE)rb_x_io_error, id_call, 3, CSTR2RVAL(disp),
|
265
|
+
rb_funcall((VALUE)rb_x_io_error, id_call, 3, CSTR2RVAL(disp),
|
266
266
|
INT2NUM(errno), CSTR2RVAL(error));
|
267
267
|
return 0;
|
268
268
|
}
|
269
|
-
#endif
|
270
|
-
#endif
|
269
|
+
#endif
|
270
|
+
#endif
|
271
271
|
|
272
272
|
static VALUE
|
273
273
|
rg_s_set_x_error_handler(VALUE self)
|
@@ -326,44 +326,6 @@ rg_s_screen_height_mm(G_GNUC_UNUSED VALUE self)
|
|
326
326
|
return INT2NUM(gdk_screen_height_mm());
|
327
327
|
}
|
328
328
|
|
329
|
-
static VALUE
|
330
|
-
rg_s_pointer_grab(G_GNUC_UNUSED VALUE self, VALUE win, VALUE owner_events, VALUE event_mask, VALUE confine_to, VALUE cursor, VALUE time)
|
331
|
-
{
|
332
|
-
return GDKGRABSTATUS2RVAL(gdk_pointer_grab(RVAL2GDKWINDOW(win),
|
333
|
-
RVAL2CBOOL(owner_events),
|
334
|
-
RVAL2GDKEVENTMASK(event_mask),
|
335
|
-
NIL_P(confine_to) ? NULL : RVAL2GDKWINDOW(confine_to),
|
336
|
-
NIL_P(cursor) ? NULL : RVAL2GDKCURSOR(cursor),
|
337
|
-
NUM2INT(time)));
|
338
|
-
}
|
339
|
-
|
340
|
-
static VALUE
|
341
|
-
rg_s_pointer_ungrab(VALUE self, VALUE time)
|
342
|
-
{
|
343
|
-
gdk_pointer_ungrab(NUM2INT(time));
|
344
|
-
return self;
|
345
|
-
}
|
346
|
-
|
347
|
-
static VALUE
|
348
|
-
rg_s_keyboard_grab(G_GNUC_UNUSED VALUE self, VALUE win, VALUE owner_events, VALUE time)
|
349
|
-
{
|
350
|
-
return GDKGRABSTATUS2RVAL(gdk_keyboard_grab(RVAL2GDKWINDOW(win),
|
351
|
-
RVAL2CBOOL(owner_events), NUM2INT(time)));
|
352
|
-
}
|
353
|
-
|
354
|
-
static VALUE
|
355
|
-
rg_s_keyboard_ungrab(VALUE self, VALUE time)
|
356
|
-
{
|
357
|
-
gdk_keyboard_ungrab(NUM2INT(time));
|
358
|
-
return self;
|
359
|
-
}
|
360
|
-
|
361
|
-
static VALUE
|
362
|
-
rg_s_pointer_is_grabbed_p(G_GNUC_UNUSED VALUE self)
|
363
|
-
{
|
364
|
-
return CBOOL2RVAL(gdk_pointer_is_grabbed());
|
365
|
-
}
|
366
|
-
|
367
329
|
static VALUE
|
368
330
|
rg_s_set_double_click_time(VALUE self, VALUE msec)
|
369
331
|
{
|
@@ -451,11 +413,7 @@ rg_s_target(G_GNUC_UNUSED VALUE self)
|
|
451
413
|
static VALUE
|
452
414
|
rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self)
|
453
415
|
{
|
454
|
-
#if CAIRO_AVAILABLE
|
455
416
|
return Qtrue;
|
456
|
-
#else
|
457
|
-
return Qfalse;
|
458
|
-
#endif
|
459
417
|
}
|
460
418
|
|
461
419
|
void
|
@@ -484,11 +442,6 @@ Init_gdk(void)
|
|
484
442
|
RG_DEF_SMETHOD(beep, 0);
|
485
443
|
RG_DEF_SMETHOD(flush, 0);
|
486
444
|
RG_DEF_SMETHOD(set_double_click_time, 1);
|
487
|
-
RG_DEF_SMETHOD(pointer_grab, 6);
|
488
|
-
RG_DEF_SMETHOD(pointer_ungrab, 1);
|
489
|
-
RG_DEF_SMETHOD(keyboard_grab, 3);
|
490
|
-
RG_DEF_SMETHOD(keyboard_ungrab, 1);
|
491
|
-
RG_DEF_SMETHOD_P(pointer_is_grabbed, 0);
|
492
445
|
RG_DEF_SMETHOD(error_trap_push, 0);
|
493
446
|
RG_DEF_SMETHOD(error_trap_pop, 0);
|
494
447
|
RG_DEF_SMETHOD_P(windowing_x11, 0);
|
@@ -509,6 +462,7 @@ Init_gdk(void)
|
|
509
462
|
Init_gdk_const(RG_TARGET_NAMESPACE);
|
510
463
|
Init_gdk_cursor(RG_TARGET_NAMESPACE);
|
511
464
|
Init_gdk_device(RG_TARGET_NAMESPACE);
|
465
|
+
Init_gdk_device_manager(RG_TARGET_NAMESPACE);
|
512
466
|
Init_gdk_display(RG_TARGET_NAMESPACE);
|
513
467
|
Init_gdk_display_manager(RG_TARGET_NAMESPACE);
|
514
468
|
Init_gdk_dragcontext(RG_TARGET_NAMESPACE);
|
data/ext/gdk3/rbgdk3.h
CHANGED
@@ -41,8 +41,10 @@
|
|
41
41
|
|
42
42
|
#define RVAL2GDKPIXBUFGLIST(value) rbgdk_rval2gdkpixbufglist(value)
|
43
43
|
|
44
|
-
|
45
|
-
#define
|
44
|
+
/* for backword compatibility. TODO: remove me. */
|
45
|
+
#define GEV2RVAL(ev) GDKEVENT2RVAL(ev)
|
46
|
+
#define RVAL2GEV(ev) RVAL2GDKEVENT(ev)
|
47
|
+
|
46
48
|
#define RVAL2ATOM(atom) (get_gdkatom(atom))
|
47
49
|
|
48
50
|
#define GDK_TYPE_GEOMETRY (gdk_geometry_get_type())
|
@@ -65,7 +67,7 @@ extern GType gdk_geometry_get_type(void);
|
|
65
67
|
extern GType gdk_timecoord_get_type(void);
|
66
68
|
|
67
69
|
extern GdkAtom get_gdkatom(VALUE atom);
|
68
|
-
extern VALUE
|
69
|
-
extern GdkEvent*
|
70
|
+
extern VALUE rbgdk_gdkevent2rval(GdkEvent *event);
|
71
|
+
extern GdkEvent *rbgdk_rval2gdkevent(VALUE event);
|
70
72
|
|
71
73
|
#endif /* __RBGDK3_H__ */
|
@@ -25,6 +25,7 @@
|
|
25
25
|
#define RVAL2GDKDEVICE(o) (GDK_DEVICE(RVAL2GOBJ(o)))
|
26
26
|
#define RVAL2GDKDISPLAY(o) (GDK_DISPLAY(RVAL2GOBJ(o)))
|
27
27
|
#define RVAL2GDKDISPLAYMANAGER(o) (GDK_DISPLAY_MANAGER(RVAL2GOBJ(o)))
|
28
|
+
#define RVAL2GDKDEVICEMANAGER(o) (GDK_DEVICE_MANAGER(RVAL2GOBJ(o)))
|
28
29
|
#define RVAL2GDKDISPLAYOBJECT(o) (GDK_DISPLAY_OBJECT(RVAL2GOBJ(o)))
|
29
30
|
#define RVAL2GDKDRAGCONTEXT(o) (GDK_DRAG_CONTEXT(RVAL2GOBJ(o)))
|
30
31
|
#define RVAL2GDKDRAWABLE(o) (GDK_DRAWABLE(RVAL2GOBJ(o)))
|
@@ -42,8 +43,8 @@
|
|
42
43
|
#define GDKCOLOR2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_COLOR))
|
43
44
|
#define RVAL2GDKCURSOR(o) ((GdkCursor*)RVAL2BOXED(o, GDK_TYPE_CURSOR))
|
44
45
|
#define GDKCURSOR2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_CURSOR))
|
45
|
-
#define RVAL2GDKEVENT(o) ((
|
46
|
-
#define GDKEVENT2RVAL(o) (
|
46
|
+
#define RVAL2GDKEVENT(o) (rbgdk_rval2gdkevent(o))
|
47
|
+
#define GDKEVENT2RVAL(o) (rbgdk_gdkevent2rval(o))
|
47
48
|
#define RVAL2GDKGEOMETRY(o) ((GdkGeometry*)RVAL2BOXED(o, GDK_TYPE_GEOMETRY))
|
48
49
|
#define GDKGEOMETRY2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_GEOMETRY))
|
49
50
|
#define RVAL2GDKRECTANGLE(o) ((GdkRectangle*)RVAL2BOXED(o, GDK_TYPE_RECTANGLE))
|
@@ -77,6 +78,8 @@
|
|
77
78
|
#define GDKINPUTMODE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_INPUT_MODE))
|
78
79
|
#define RVAL2GDKINPUTSOURCE(o) (RVAL2GENUM(o, GDK_TYPE_INPUT_SOURCE))
|
79
80
|
#define GDKINPUTSOURCE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_INPUT_SOURCE))
|
81
|
+
#define RVAL2GDKGRABOWNERSHIP(o) (RVAL2GENUM(o, GDK_TYPE_GRAB_OWNERSHIP))
|
82
|
+
#define GDKGRABOWNERSHIP2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_GRAB_OWNERSHIP))
|
80
83
|
#define RVAL2GDKPROPMODE(o) (RVAL2GENUM(o, GDK_TYPE_PROP_MODE))
|
81
84
|
#define GDKPROPMODE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_PROP_MODE))
|
82
85
|
#define RVAL2GDKRGBDITHER(o) (RVAL2GENUM(o, GDK_TYPE_RGB_DITHER))
|
data/ext/gdk3/rbgdk3private.h
CHANGED
@@ -44,12 +44,6 @@
|
|
44
44
|
# define G_VALUE_INIT { 0, { { 0 } } }
|
45
45
|
#endif
|
46
46
|
|
47
|
-
#if defined(HAVE_RB_CAIRO_H)
|
48
|
-
# define CAIRO_AVAILABLE 1
|
49
|
-
#else
|
50
|
-
# define CAIRO_AVAILABLE 0
|
51
|
-
#endif
|
52
|
-
|
53
47
|
extern ID id_call;
|
54
48
|
|
55
49
|
G_GNUC_INTERNAL void Init_gdk(void);
|
@@ -59,6 +53,7 @@ G_GNUC_INTERNAL void Init_gdk_color(VALUE mGdk);
|
|
59
53
|
G_GNUC_INTERNAL void Init_gdk_const(VALUE mGdk);
|
60
54
|
G_GNUC_INTERNAL void Init_gdk_cursor(VALUE mGdk);
|
61
55
|
G_GNUC_INTERNAL void Init_gdk_device(VALUE mGdk);
|
56
|
+
G_GNUC_INTERNAL void Init_gdk_device_manager(VALUE mGdk);
|
62
57
|
G_GNUC_INTERNAL void Init_gdk_display(VALUE mGdk);
|
63
58
|
G_GNUC_INTERNAL void Init_gdk_display_manager(VALUE mGdk);
|
64
59
|
G_GNUC_INTERNAL void Init_gdk_dragcontext(VALUE mGdk);
|
data/ext/gdk3/rbgdkcairo.c
CHANGED
@@ -21,7 +21,6 @@
|
|
21
21
|
|
22
22
|
#include "rbgdk3private.h"
|
23
23
|
|
24
|
-
#if CAIRO_AVAILABLE
|
25
24
|
#include <gdk/gdk.h>
|
26
25
|
#include <rb_cairo.h>
|
27
26
|
|
@@ -78,12 +77,10 @@ rg_gdk_region(VALUE self, VALUE region)
|
|
78
77
|
rb_cairo_check_status(cairo_status(_SELF(self)));
|
79
78
|
return self;
|
80
79
|
}
|
81
|
-
#endif
|
82
80
|
|
83
81
|
void
|
84
82
|
Init_gdk_cairo(void)
|
85
83
|
{
|
86
|
-
#if CAIRO_AVAILABLE
|
87
84
|
RG_DEF_METHOD(set_source_gdk_color, 1);
|
88
85
|
RG_DEF_METHOD(set_source_pixbuf, -1);
|
89
86
|
/* deprecated
|
@@ -91,5 +88,4 @@ Init_gdk_cairo(void)
|
|
91
88
|
*/
|
92
89
|
RG_DEF_METHOD(gdk_rectangle, 1);
|
93
90
|
RG_DEF_METHOD(gdk_region, 1);
|
94
|
-
#endif
|
95
91
|
}
|
data/ext/gdk3/rbgdkdevice.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) 2003-2006 Masao Mutoh
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -70,7 +70,7 @@ rg_set_key(VALUE self, VALUE index, VALUE keyval, VALUE modifiers)
|
|
70
70
|
static VALUE
|
71
71
|
rg_set_axis_use(VALUE self, VALUE index, VALUE use)
|
72
72
|
{
|
73
|
-
gdk_device_set_axis_use(_SELF(self), NUM2UINT(index),
|
73
|
+
gdk_device_set_axis_use(_SELF(self), NUM2UINT(index),
|
74
74
|
RVAL2GDKAXISUSE(use));
|
75
75
|
return self;
|
76
76
|
}
|
@@ -137,6 +137,56 @@ rg_mode(VALUE self)
|
|
137
137
|
return GDKINPUTMODE2RVAL(gdk_device_get_mode(_SELF(self)));
|
138
138
|
}
|
139
139
|
|
140
|
+
static VALUE
|
141
|
+
rg_get_window_at_position(G_GNUC_UNUSED VALUE self)
|
142
|
+
{
|
143
|
+
gint x, y;
|
144
|
+
GdkWindow *win = gdk_device_get_window_at_position(_SELF(self), &x ,&y);
|
145
|
+
return rb_ary_new3(3, GOBJ2RVAL(win), INT2FIX(x), INT2FIX(y));
|
146
|
+
}
|
147
|
+
|
148
|
+
static VALUE
|
149
|
+
rg_ungrab(int argc, VALUE *argv, VALUE self)
|
150
|
+
{
|
151
|
+
VALUE rb_time;
|
152
|
+
guint32 time = GDK_CURRENT_TIME;
|
153
|
+
|
154
|
+
rb_scan_args(argc, argv, "01", &rb_time);
|
155
|
+
if (!NIL_P(rb_time)) {
|
156
|
+
time = NUM2UINT(GDK_CURRENT_TIME);
|
157
|
+
}
|
158
|
+
gdk_device_ungrab(_SELF(self), time);
|
159
|
+
return self;
|
160
|
+
}
|
161
|
+
|
162
|
+
static VALUE
|
163
|
+
rg_get_position(VALUE self)
|
164
|
+
{
|
165
|
+
GdkScreen *screen;
|
166
|
+
gint x, y;
|
167
|
+
gdk_device_get_position(_SELF(self), &screen, &x, &y);
|
168
|
+
return rb_ary_new3(3, GOBJ2RVAL(screen), INT2NUM(x), INT2NUM(y));
|
169
|
+
}
|
170
|
+
|
171
|
+
static VALUE
|
172
|
+
rg_warp(VALUE self, VALUE screen, VALUE x, VALUE y)
|
173
|
+
{
|
174
|
+
gdk_device_warp(_SELF(self), RVAL2GDKSCREEN(screen), NUM2INT(x), NUM2INT(y));
|
175
|
+
return self;
|
176
|
+
}
|
177
|
+
|
178
|
+
static VALUE
|
179
|
+
rg_grab(VALUE self, VALUE win, VALUE grab_ownership, VALUE owner_events, VALUE event_mask, VALUE cursor, VALUE time)
|
180
|
+
{
|
181
|
+
return GDKGRABSTATUS2RVAL(gdk_device_grab(_SELF(self),
|
182
|
+
RVAL2GDKWINDOW(win),
|
183
|
+
RVAL2GDKGRABOWNERSHIP(grab_ownership),
|
184
|
+
RVAL2CBOOL(owner_events),
|
185
|
+
RVAL2GDKEVENTMASK(event_mask),
|
186
|
+
RVAL2GDKCURSOR(cursor),
|
187
|
+
NUM2INT(time)));
|
188
|
+
}
|
189
|
+
|
140
190
|
/* deprecated
|
141
191
|
static VALUE
|
142
192
|
rg_axes(VALUE self)
|
@@ -146,7 +196,7 @@ rg_axes(VALUE self)
|
|
146
196
|
GdkDeviceAxis* axes = _SELF(self)->axes;
|
147
197
|
|
148
198
|
for (i = 0; i < _SELF(self)->num_axes; i++){
|
149
|
-
rb_ary_push(ary, rb_ary_new3(3, GDKAXISUSE2RVAL(axes[i].use),
|
199
|
+
rb_ary_push(ary, rb_ary_new3(3, GDKAXISUSE2RVAL(axes[i].use),
|
150
200
|
rb_float_new(axes[i].min), rb_float_new(axes[i].max)));
|
151
201
|
}
|
152
202
|
return ary;
|
@@ -167,7 +217,7 @@ rg_keys(VALUE self)
|
|
167
217
|
}
|
168
218
|
*/
|
169
219
|
|
170
|
-
void
|
220
|
+
void
|
171
221
|
Init_gdk_device(VALUE mGdk)
|
172
222
|
{
|
173
223
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DEVICE, "Device", mGdk);
|
@@ -186,6 +236,12 @@ Init_gdk_device(VALUE mGdk)
|
|
186
236
|
RG_DEF_METHOD(get_history, 3);
|
187
237
|
RG_DEF_METHOD(get_axis, 2);
|
188
238
|
RG_DEF_METHOD(mode, 0);
|
239
|
+
RG_DEF_METHOD(get_window_at_position, 0);
|
240
|
+
RG_DEF_METHOD(ungrab, -1);
|
241
|
+
RG_DEF_METHOD(get_position, 0);
|
242
|
+
RG_DEF_METHOD(warp, 3);
|
243
|
+
RG_DEF_METHOD(grab, 6);
|
244
|
+
|
189
245
|
/* deprecated
|
190
246
|
RG_DEF_METHOD(axes, 0);
|
191
247
|
RG_DEF_METHOD(keys, 0);
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2013 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 "rbgdk3private.h"
|
22
|
+
|
23
|
+
#define RG_TARGET_NAMESPACE cDeviceManager
|
24
|
+
#define _SELF(obj) RVAL2GDKDEVICEMANAGER(obj)
|
25
|
+
|
26
|
+
static VALUE
|
27
|
+
rg_devices(VALUE self)
|
28
|
+
{
|
29
|
+
return GOBJGLIST2RVAL_FREE(gdk_device_manager_list_devices(_SELF(self), GDK_TYPE_DEVICE),
|
30
|
+
g_list_free, NULL);
|
31
|
+
}
|
32
|
+
|
33
|
+
void
|
34
|
+
Init_gdk_device_manager(VALUE mGdk)
|
35
|
+
{
|
36
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY_MANAGER, "DeviceManager", mGdk);
|
37
|
+
|
38
|
+
RG_DEF_METHOD(devices, 0);
|
39
|
+
}
|
data/ext/gdk3/rbgdkdisplay.c
CHANGED
@@ -36,7 +36,7 @@ rg_s_open(G_GNUC_UNUSED VALUE self, VALUE display_name)
|
|
36
36
|
{
|
37
37
|
GdkDisplay* gdisplay = gdk_display_open(RVAL2CSTR(display_name));
|
38
38
|
if (! gdisplay) {
|
39
|
-
rb_raise(rb_eRuntimeError, "The display `%s' could not be opened.",
|
39
|
+
rb_raise(rb_eRuntimeError, "The display `%s' could not be opened.",
|
40
40
|
RVAL2CSTR(display_name));
|
41
41
|
} else {
|
42
42
|
VALUE display;
|
@@ -87,23 +87,9 @@ rg_default_screen(VALUE self)
|
|
87
87
|
}
|
88
88
|
|
89
89
|
static VALUE
|
90
|
-
|
90
|
+
rg_device_is_grabbed_p(VALUE self, VALUE device)
|
91
91
|
{
|
92
|
-
|
93
|
-
return self;
|
94
|
-
}
|
95
|
-
|
96
|
-
static VALUE
|
97
|
-
rg_keyboard_ungrab(VALUE self, VALUE time)
|
98
|
-
{
|
99
|
-
gdk_display_keyboard_ungrab(_SELF(self), NUM2ULONG(time));
|
100
|
-
return self;
|
101
|
-
}
|
102
|
-
|
103
|
-
static VALUE
|
104
|
-
rg_pointer_grabbed_p(VALUE self)
|
105
|
-
{
|
106
|
-
return CBOOL2RVAL(gdk_display_pointer_is_grabbed(_SELF(self)));
|
92
|
+
return CBOOL2RVAL(gdk_display_device_is_grabbed(_SELF(self), RVAL2GDKDEVICE(device)));
|
107
93
|
}
|
108
94
|
|
109
95
|
static VALUE
|
@@ -127,12 +113,6 @@ rg_flush(VALUE self)
|
|
127
113
|
return self;
|
128
114
|
}
|
129
115
|
|
130
|
-
static VALUE
|
131
|
-
rg_devices(VALUE self)
|
132
|
-
{
|
133
|
-
return rbgutil_glist2ary(gdk_display_list_devices(_SELF(self)));
|
134
|
-
}
|
135
|
-
|
136
116
|
static VALUE
|
137
117
|
rg_event(VALUE self)
|
138
118
|
{
|
@@ -156,8 +136,8 @@ rg_put_event(VALUE self, VALUE event)
|
|
156
136
|
static GdkFilterReturn
|
157
137
|
filter_func(GdkXEvent xevent, GdkEvent event, gpointer func)
|
158
138
|
{
|
159
|
-
return GENUM2RVAL(rb_funcall((VALUE)func, id_call, 2,
|
160
|
-
????, GEV2RVAL(event)),
|
139
|
+
return GENUM2RVAL(rb_funcall((VALUE)func, id_call, 2,
|
140
|
+
????, GEV2RVAL(event)),
|
161
141
|
GDK_TYPE_FILTER_RETURN);
|
162
142
|
}
|
163
143
|
|
@@ -192,28 +172,6 @@ rg_set_double_click_distance(VALUE self, VALUE distance)
|
|
192
172
|
return self;
|
193
173
|
}
|
194
174
|
|
195
|
-
static VALUE
|
196
|
-
rg_pointer(VALUE self)
|
197
|
-
{
|
198
|
-
GdkScreen *screen;
|
199
|
-
int x,y;
|
200
|
-
GdkModifierType mask;
|
201
|
-
|
202
|
-
gdk_display_get_pointer(_SELF(self), &screen, &x, &y, &mask);
|
203
|
-
|
204
|
-
return rb_ary_new3(4, GOBJ2RVAL(screen), INT2NUM(x), INT2NUM(y), INT2NUM(mask));
|
205
|
-
}
|
206
|
-
static VALUE
|
207
|
-
rg_window_at_pointer(VALUE self)
|
208
|
-
{
|
209
|
-
GdkWindow *window;
|
210
|
-
int x,y;
|
211
|
-
|
212
|
-
window = gdk_display_get_window_at_pointer(_SELF(self), &x, &y);
|
213
|
-
|
214
|
-
return rb_ary_new3(3, GOBJ2RVAL(window), INT2NUM(x), INT2NUM(y));
|
215
|
-
}
|
216
|
-
|
217
175
|
/* Don't implement this.
|
218
176
|
GdkDisplayPointerHooks* gdk_display_set_pointer_hooks
|
219
177
|
(GdkDisplay *display,
|
@@ -261,7 +219,7 @@ rg_supports_selection_notification_p(VALUE self)
|
|
261
219
|
static VALUE
|
262
220
|
rg_request_selection_notification_p(VALUE self, VALUE selection)
|
263
221
|
{
|
264
|
-
return CBOOL2RVAL(gdk_display_request_selection_notification(_SELF(self),
|
222
|
+
return CBOOL2RVAL(gdk_display_request_selection_notification(_SELF(self),
|
265
223
|
RVAL2ATOM(selection)));
|
266
224
|
}
|
267
225
|
|
@@ -295,13 +253,6 @@ rg_core_pointer(VALUE self)
|
|
295
253
|
}
|
296
254
|
*/
|
297
255
|
|
298
|
-
static VALUE
|
299
|
-
rg_warp_pointer(VALUE self, VALUE screen, VALUE x, VALUE y)
|
300
|
-
{
|
301
|
-
gdk_display_warp_pointer(_SELF(self), RVAL2GDKSCREEN(screen), NUM2INT(x), NUM2INT(y));
|
302
|
-
return self;
|
303
|
-
}
|
304
|
-
|
305
256
|
#ifdef GDK_WINDOWING_X11
|
306
257
|
static VALUE
|
307
258
|
rg_grab(VALUE self)
|
@@ -419,7 +370,7 @@ rg_supports_composite_p(VALUE self)
|
|
419
370
|
return CBOOL2RVAL(gdk_display_supports_composite(_SELF(self)));
|
420
371
|
}
|
421
372
|
|
422
|
-
void
|
373
|
+
void
|
423
374
|
Init_gdk_display(VALUE mGdk)
|
424
375
|
{
|
425
376
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY, "Display", mGdk);
|
@@ -432,24 +383,19 @@ Init_gdk_display(VALUE mGdk)
|
|
432
383
|
RG_DEF_ALIAS("[]", "get_screen");
|
433
384
|
RG_DEF_METHOD(default_screen, 0);
|
434
385
|
|
435
|
-
|
436
|
-
RG_DEF_METHOD(keyboard_ungrab, 1);
|
437
|
-
RG_DEF_METHOD_P(pointer_grabbed, 0);
|
386
|
+
RG_DEF_METHOD_P(device_is_grabbed, 1);
|
438
387
|
|
439
388
|
RG_DEF_METHOD(beep, 0);
|
440
389
|
RG_DEF_METHOD(sync, 0);
|
441
390
|
RG_DEF_METHOD(flush, 0);
|
442
391
|
RG_DEF_METHOD(close, 0);
|
443
392
|
|
444
|
-
RG_DEF_METHOD(devices, 0);
|
445
393
|
RG_DEF_METHOD(event, 0);
|
446
394
|
RG_DEF_METHOD(peek_event, 0);
|
447
395
|
RG_DEF_METHOD(put_event, 1);
|
448
396
|
RG_DEF_METHOD(set_double_click_time, 1);
|
449
397
|
RG_DEF_METHOD_P(closed, 0);
|
450
398
|
RG_DEF_METHOD(set_double_click_distance, 1);
|
451
|
-
RG_DEF_METHOD(pointer, 0);
|
452
|
-
RG_DEF_METHOD(window_at_pointer, 0);
|
453
399
|
RG_DEF_METHOD_P(supports_cursor_color, 0);
|
454
400
|
RG_DEF_METHOD_P(supports_cursor_alpha, 0);
|
455
401
|
RG_DEF_METHOD(default_cursor_size, 0);
|
@@ -462,7 +408,6 @@ Init_gdk_display(VALUE mGdk)
|
|
462
408
|
/* deprecated
|
463
409
|
RG_DEF_METHOD(core_pointer, 0);
|
464
410
|
*/
|
465
|
-
RG_DEF_METHOD(warp_pointer, 3);
|
466
411
|
#ifdef GDK_WINDOWING_X11
|
467
412
|
RG_DEF_METHOD(grab, 0);
|
468
413
|
RG_DEF_METHOD(ungrab, 0);
|