gdk3 2.2.0 → 2.2.1
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.
- checksums.yaml +4 -4
- data/Rakefile +18 -4
- data/lib/gdk3/atom.rb +26 -0
- data/lib/gdk3/cairo.rb +60 -0
- data/lib/gdk3/color.rb +27 -0
- data/lib/gdk3/deprecated.rb +14 -16
- data/lib/gdk3/event.rb +38 -0
- data/lib/gdk3/loader.rb +266 -0
- data/lib/gdk3/rectangle.rb +38 -0
- data/lib/gdk3/rgba.rb +32 -0
- data/lib/gdk3/window-attr.rb +28 -0
- data/lib/gdk3/window.rb +21 -0
- data/lib/gdk3.rb +61 -2
- data/test/run-test.rb +15 -6
- data/test/test-gdk-cairo.rb +41 -0
- data/test/test-gdk-event-type.rb +25 -0
- data/test/test-gdk-event.rb +47 -49
- data/test/test-gdk-keyval.rb +21 -0
- data/test/test-gdk-pixbuf.rb +49 -0
- data/test/test-gdk-rectangle.rb +35 -4
- data/test/test-gdk-rgba.rb +6 -1
- data/test/test-gdk-window-attr.rb +1 -1
- metadata +23 -51
- data/ext/gdk3/depend +0 -11
- data/ext/gdk3/extconf.rb +0 -130
- data/ext/gdk3/gdk3.def +0 -12
- data/ext/gdk3/init.c +0 -35
- data/ext/gdk3/rbgdk.c +0 -491
- data/ext/gdk3/rbgdk3.h +0 -73
- data/ext/gdk3/rbgdk3conversions.h +0 -121
- data/ext/gdk3/rbgdk3private.h +0 -85
- data/ext/gdk3/rbgdkatom.c +0 -122
- data/ext/gdk3/rbgdkcairo.c +0 -91
- data/ext/gdk3/rbgdkcolor.c +0 -137
- data/ext/gdk3/rbgdkconst.c +0 -33
- data/ext/gdk3/rbgdkcursor.c +0 -92
- data/ext/gdk3/rbgdkdevice.c +0 -253
- data/ext/gdk3/rbgdkdevicemanager.c +0 -39
- data/ext/gdk3/rbgdkdisplay.c +0 -434
- data/ext/gdk3/rbgdkdisplaymanager.c +0 -55
- data/ext/gdk3/rbgdkdragcontext.c +0 -191
- data/ext/gdk3/rbgdkevent.c +0 -1173
- data/ext/gdk3/rbgdkgeometry.c +0 -253
- data/ext/gdk3/rbgdkkeymap.c +0 -151
- data/ext/gdk3/rbgdkkeyval.c +0 -108
- data/ext/gdk3/rbgdkpango.c +0 -197
- data/ext/gdk3/rbgdkpangorenderer.c +0 -144
- data/ext/gdk3/rbgdkpixbuf.c +0 -176
- data/ext/gdk3/rbgdkproperty.c +0 -305
- data/ext/gdk3/rbgdkrectangle.c +0 -140
- data/ext/gdk3/rbgdkrgb.c +0 -199
- data/ext/gdk3/rbgdkrgba.c +0 -142
- data/ext/gdk3/rbgdkscreen.c +0 -443
- data/ext/gdk3/rbgdkselection.c +0 -146
- data/ext/gdk3/rbgdkthreads.c +0 -77
- data/ext/gdk3/rbgdktimecoord.c +0 -133
- data/ext/gdk3/rbgdkvisual.c +0 -251
- data/ext/gdk3/rbgdkwindow.c +0 -1069
- data/ext/gdk3/rbgdkwindowattr.c +0 -191
- data/ext/gdk3/rbgdkx11.c +0 -102
- data/ext/gdk3/rbgdkx11x11window.c +0 -66
- data/extconf.rb +0 -49
- data/lib/gdk3/base.rb +0 -59
data/ext/gdk3/rbgdkscreen.c
DELETED
@@ -1,443 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2003-2006 Ruby-GNOME2 Project Team
|
5
|
-
* Copyright (C) 2003 Geoff Youngs
|
6
|
-
*
|
7
|
-
* This library is free software; you can redistribute it and/or
|
8
|
-
* modify it under the terms of the GNU Lesser General Public
|
9
|
-
* License as published by the Free Software Foundation; either
|
10
|
-
* version 2.1 of the License, or (at your option) any later version.
|
11
|
-
*
|
12
|
-
* This library is distributed in the hope that it will be useful,
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
* Lesser General Public License for more details.
|
16
|
-
*
|
17
|
-
* You should have received a copy of the GNU Lesser General Public
|
18
|
-
* License along with this library; if not, write to the Free Software
|
19
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
-
* MA 02110-1301 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
#include "rbgdk3private.h"
|
24
|
-
#ifdef HAVE_RB_CAIRO_H
|
25
|
-
#include <rb_cairo.h>
|
26
|
-
#endif
|
27
|
-
|
28
|
-
#define RG_TARGET_NAMESPACE cScreen
|
29
|
-
#define _SELF(i) RVAL2GDKSCREEN(i)
|
30
|
-
|
31
|
-
static ID id_new;
|
32
|
-
|
33
|
-
static VALUE
|
34
|
-
rg_s_default(G_GNUC_UNUSED VALUE self)
|
35
|
-
{
|
36
|
-
return GOBJ2RVAL(gdk_screen_get_default());
|
37
|
-
}
|
38
|
-
|
39
|
-
/* deprecated
|
40
|
-
static VALUE
|
41
|
-
rg_default_colormap(VALUE self)
|
42
|
-
{
|
43
|
-
return GOBJ2RVAL(gdk_screen_get_default_colormap(_SELF(self)));
|
44
|
-
}
|
45
|
-
|
46
|
-
static VALUE
|
47
|
-
rg_set_default_colormap(VALUE self, VALUE colormap)
|
48
|
-
{
|
49
|
-
gdk_screen_set_default_colormap(_SELF(self),
|
50
|
-
RVAL2GDKCOLORMAP(colormap));
|
51
|
-
return self;
|
52
|
-
}
|
53
|
-
|
54
|
-
static VALUE
|
55
|
-
rg_system_colormap(VALUE self)
|
56
|
-
{
|
57
|
-
return GOBJ2RVAL(gdk_screen_get_system_colormap(_SELF(self)));
|
58
|
-
}
|
59
|
-
*/
|
60
|
-
|
61
|
-
static VALUE
|
62
|
-
rg_system_visual(VALUE self)
|
63
|
-
{
|
64
|
-
return GOBJ2RVAL(gdk_screen_get_system_visual(_SELF(self)));
|
65
|
-
}
|
66
|
-
|
67
|
-
/* deprecated
|
68
|
-
static VALUE
|
69
|
-
rg_rgb_colormap(VALUE self)
|
70
|
-
{
|
71
|
-
return GOBJ2RVAL(gdk_screen_get_rgb_colormap(_SELF(self)));
|
72
|
-
}
|
73
|
-
|
74
|
-
static VALUE
|
75
|
-
rg_rgb_visual(VALUE self)
|
76
|
-
{
|
77
|
-
return GOBJ2RVAL(gdk_screen_get_rgb_visual(_SELF(self)));
|
78
|
-
}
|
79
|
-
*/
|
80
|
-
|
81
|
-
/* deprecated
|
82
|
-
static VALUE
|
83
|
-
rg_rgba_colormap(VALUE self)
|
84
|
-
{
|
85
|
-
return GOBJ2RVAL(gdk_screen_get_rgba_colormap(_SELF(self)));
|
86
|
-
}
|
87
|
-
*/
|
88
|
-
|
89
|
-
static VALUE
|
90
|
-
rg_rgba_visual(VALUE self)
|
91
|
-
{
|
92
|
-
return GOBJ2RVAL(gdk_screen_get_rgba_visual(_SELF(self)));
|
93
|
-
}
|
94
|
-
|
95
|
-
static VALUE
|
96
|
-
rg_composited_p(VALUE self)
|
97
|
-
{
|
98
|
-
return CBOOL2RVAL(gdk_screen_is_composited(_SELF(self)));
|
99
|
-
}
|
100
|
-
|
101
|
-
static VALUE
|
102
|
-
rg_root_window(VALUE self)
|
103
|
-
{
|
104
|
-
return GOBJ2RVAL(gdk_screen_get_root_window(_SELF(self)));
|
105
|
-
}
|
106
|
-
|
107
|
-
static VALUE
|
108
|
-
rg_display(VALUE self)
|
109
|
-
{
|
110
|
-
return GOBJ2RVAL(gdk_screen_get_display(_SELF(self)));
|
111
|
-
}
|
112
|
-
|
113
|
-
static VALUE
|
114
|
-
rg_number(VALUE self)
|
115
|
-
{
|
116
|
-
return INT2NUM(gdk_screen_get_number(_SELF(self)));
|
117
|
-
}
|
118
|
-
static VALUE
|
119
|
-
rg_width(VALUE self)
|
120
|
-
{
|
121
|
-
return INT2NUM(gdk_screen_get_width(_SELF(self)));
|
122
|
-
}
|
123
|
-
static VALUE
|
124
|
-
rg_height(VALUE self)
|
125
|
-
{
|
126
|
-
return INT2NUM(gdk_screen_get_height(_SELF(self)));
|
127
|
-
}
|
128
|
-
static VALUE
|
129
|
-
rg_width_mm(VALUE self)
|
130
|
-
{
|
131
|
-
return INT2NUM(gdk_screen_get_width_mm(_SELF(self)));
|
132
|
-
}
|
133
|
-
static VALUE
|
134
|
-
rg_height_mm(VALUE self)
|
135
|
-
{
|
136
|
-
return INT2NUM(gdk_screen_get_height_mm(_SELF(self)));
|
137
|
-
}
|
138
|
-
|
139
|
-
static VALUE
|
140
|
-
rg_visuals(VALUE self)
|
141
|
-
{
|
142
|
-
return GOBJGLIST2RVAL_FREE(gdk_screen_list_visuals(_SELF(self)),
|
143
|
-
g_list_free, NULL);
|
144
|
-
}
|
145
|
-
|
146
|
-
static VALUE
|
147
|
-
rg_toplevel_windows(VALUE self)
|
148
|
-
{
|
149
|
-
return GOBJGLIST2RVAL_FREE(gdk_screen_get_toplevel_windows(_SELF(self)),
|
150
|
-
g_list_free, NULL);
|
151
|
-
}
|
152
|
-
|
153
|
-
static VALUE
|
154
|
-
rg_display_name(VALUE self)
|
155
|
-
{
|
156
|
-
gchar* name = gdk_screen_make_display_name(_SELF(self));
|
157
|
-
VALUE ret = CSTR2RVAL(name);
|
158
|
-
g_free(name);
|
159
|
-
return ret;
|
160
|
-
}
|
161
|
-
|
162
|
-
static VALUE
|
163
|
-
rg_n_monitors(VALUE self)
|
164
|
-
{
|
165
|
-
return INT2NUM(gdk_screen_get_n_monitors(_SELF(self)));
|
166
|
-
}
|
167
|
-
|
168
|
-
static VALUE
|
169
|
-
rg_monitor_geometry(VALUE self, VALUE num)
|
170
|
-
{
|
171
|
-
GdkRectangle rect;
|
172
|
-
gdk_screen_get_monitor_geometry(_SELF(self), NUM2INT(num), &rect);
|
173
|
-
return GDKRECTANGLE2RVAL(&rect);
|
174
|
-
}
|
175
|
-
|
176
|
-
static VALUE
|
177
|
-
rg_get_monitor(int argc, VALUE *argv, VALUE self)
|
178
|
-
{
|
179
|
-
VALUE arg1, arg2;
|
180
|
-
VALUE ret;
|
181
|
-
|
182
|
-
rb_scan_args(argc, argv, "11", &arg1, &arg2);
|
183
|
-
if (argc == 2){
|
184
|
-
ret = INT2NUM(gdk_screen_get_monitor_at_point(_SELF(self),
|
185
|
-
NUM2INT(arg1), NUM2INT(arg2)));
|
186
|
-
} else if (argc == 1){
|
187
|
-
ret = INT2NUM(gdk_screen_get_monitor_at_window(_SELF(self),
|
188
|
-
RVAL2GDKWINDOW(arg1)));
|
189
|
-
} else {
|
190
|
-
rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc);
|
191
|
-
}
|
192
|
-
return ret;
|
193
|
-
}
|
194
|
-
|
195
|
-
/* deprecated
|
196
|
-
static VALUE
|
197
|
-
rg_broadcast_client_message(VALUE self, VALUE event)
|
198
|
-
{
|
199
|
-
gdk_screen_broadcast_client_message(_SELF(self), RVAL2GEV(event));
|
200
|
-
return self;
|
201
|
-
}
|
202
|
-
*/
|
203
|
-
|
204
|
-
/*
|
205
|
-
type: String, Integer, Gdk::Color.
|
206
|
-
*/
|
207
|
-
static VALUE
|
208
|
-
rg_get_setting(int argc, VALUE *argv, VALUE self)
|
209
|
-
{
|
210
|
-
VALUE name, type;
|
211
|
-
GType gtype;
|
212
|
-
GValue val = G_VALUE_INIT;
|
213
|
-
gboolean ret;
|
214
|
-
VALUE value;
|
215
|
-
|
216
|
-
rb_scan_args(argc, argv, "11", &name, &type);
|
217
|
-
if (NIL_P(type))
|
218
|
-
gtype = G_TYPE_STRING;
|
219
|
-
else
|
220
|
-
gtype = CLASS2GTYPE(type);
|
221
|
-
|
222
|
-
g_value_init(&val, gtype);
|
223
|
-
ret = gdk_screen_get_setting(_SELF(self), RVAL2CSTR(name), &val);
|
224
|
-
value = ret ? GVAL2RVAL(&val) : Qnil;
|
225
|
-
g_value_unset(&val);
|
226
|
-
return value;
|
227
|
-
}
|
228
|
-
|
229
|
-
#ifdef HAVE_RB_CAIRO_H
|
230
|
-
static VALUE
|
231
|
-
gdkscreen_get_font_options(VALUE self)
|
232
|
-
{
|
233
|
-
return CRFONTOPTIONS2RVAL((cairo_font_options_t *)gdk_screen_get_font_options(_SELF(self)));
|
234
|
-
}
|
235
|
-
|
236
|
-
static VALUE
|
237
|
-
gdkscreen_set_font_options(VALUE self, VALUE options)
|
238
|
-
{
|
239
|
-
gdk_screen_set_font_options(_SELF(self),
|
240
|
-
(const cairo_font_options_t *)RVAL2CRFONTOPTIONS(options));
|
241
|
-
return self;
|
242
|
-
}
|
243
|
-
#endif
|
244
|
-
|
245
|
-
static VALUE
|
246
|
-
rg_active_window(VALUE self)
|
247
|
-
{
|
248
|
-
return GOBJ2RVAL(gdk_screen_get_active_window(_SELF(self)));
|
249
|
-
}
|
250
|
-
|
251
|
-
static VALUE
|
252
|
-
rg_window_stack(VALUE self)
|
253
|
-
{
|
254
|
-
GList* list = gdk_screen_get_window_stack(_SELF(self));
|
255
|
-
VALUE ary = rb_ary_new();
|
256
|
-
while (list) {
|
257
|
-
rb_ary_push(ary, GOBJ2RVAL(list->data));
|
258
|
-
g_object_unref(list->data);
|
259
|
-
list = list->next;
|
260
|
-
}
|
261
|
-
g_list_free(list);
|
262
|
-
return ary;
|
263
|
-
}
|
264
|
-
|
265
|
-
static void
|
266
|
-
child_setup(gpointer func)
|
267
|
-
{
|
268
|
-
if (! NIL_P(func)){
|
269
|
-
rb_funcall((VALUE)func, id_call, 0);
|
270
|
-
}
|
271
|
-
}
|
272
|
-
|
273
|
-
/* deprecated
|
274
|
-
static VALUE
|
275
|
-
rg_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
|
276
|
-
{
|
277
|
-
GError *err = NULL;
|
278
|
-
gboolean ret;
|
279
|
-
gint child_pid;
|
280
|
-
VALUE func = Qnil;
|
281
|
-
gchar **gargv;
|
282
|
-
gchar **genvp;
|
283
|
-
|
284
|
-
if (rb_block_given_p()) {
|
285
|
-
func = rb_block_proc();
|
286
|
-
G_RELATIVE(self, func);
|
287
|
-
}
|
288
|
-
|
289
|
-
gargv = (gchar **)RVAL2STRV(argv);
|
290
|
-
genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp);
|
291
|
-
ret = gdk_spawn_on_screen(_SELF(self),
|
292
|
-
RVAL2CSTR_ACCEPT_NIL(working_directory),
|
293
|
-
gargv, genvp, NUM2INT(flags),
|
294
|
-
(GSpawnChildSetupFunc)child_setup, (gpointer)func,
|
295
|
-
&child_pid, &err);
|
296
|
-
g_free(gargv);
|
297
|
-
g_free(genvp);
|
298
|
-
if (!ret)
|
299
|
-
RAISE_GERROR(err);
|
300
|
-
|
301
|
-
return INT2NUM(child_pid);
|
302
|
-
}
|
303
|
-
|
304
|
-
static VALUE
|
305
|
-
rg_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
|
306
|
-
{
|
307
|
-
GError *err = NULL;
|
308
|
-
gboolean ret;
|
309
|
-
gint child_pid;
|
310
|
-
VALUE func = Qnil;
|
311
|
-
gchar **gargv;
|
312
|
-
gchar **genvp;
|
313
|
-
gint standard_input, standard_output, standard_error;
|
314
|
-
|
315
|
-
if (rb_block_given_p()) {
|
316
|
-
func = rb_block_proc();
|
317
|
-
G_RELATIVE(self, func);
|
318
|
-
}
|
319
|
-
|
320
|
-
gargv = (gchar **)RVAL2STRV(argv);
|
321
|
-
genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp);
|
322
|
-
ret = gdk_spawn_on_screen_with_pipes(_SELF(self),
|
323
|
-
RVAL2CSTR_ACCEPT_NIL(working_directory),
|
324
|
-
gargv, genvp, NUM2INT(flags),
|
325
|
-
(GSpawnChildSetupFunc)child_setup, (gpointer)func,
|
326
|
-
&child_pid,
|
327
|
-
&standard_input, &standard_output,
|
328
|
-
&standard_error, &err);
|
329
|
-
g_free(gargv);
|
330
|
-
g_free(genvp);
|
331
|
-
if (!ret)
|
332
|
-
RAISE_GERROR(err);
|
333
|
-
|
334
|
-
return rb_ary_new3(4, INT2NUM(child_pid),
|
335
|
-
rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_input)),
|
336
|
-
rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_output)),
|
337
|
-
rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_error)));
|
338
|
-
}
|
339
|
-
*/
|
340
|
-
|
341
|
-
static VALUE
|
342
|
-
rg_spawn_command_line_on_screen(G_GNUC_UNUSED VALUE self, VALUE command_line)
|
343
|
-
{
|
344
|
-
GError *err = NULL;
|
345
|
-
VALUE ret;
|
346
|
-
|
347
|
-
ret = CBOOL2RVAL(g_spawn_command_line_async(RVAL2CSTR(command_line), &err));
|
348
|
-
if (!ret) RAISE_GERROR(err);
|
349
|
-
|
350
|
-
return ret;
|
351
|
-
}
|
352
|
-
|
353
|
-
/* From X Window System Interaction */
|
354
|
-
#ifdef GDK_WINDOWING_X11
|
355
|
-
#include <gdk/gdkx.h>
|
356
|
-
static VALUE
|
357
|
-
rg_xnumber(VALUE self)
|
358
|
-
{
|
359
|
-
return INT2NUM(GDK_SCREEN_XNUMBER(_SELF(self)));
|
360
|
-
}
|
361
|
-
static VALUE
|
362
|
-
rg_supports_net_wm_hint_p(VALUE self, VALUE property)
|
363
|
-
{
|
364
|
-
return CBOOL2RVAL(gdk_x11_screen_supports_net_wm_hint(_SELF(self),
|
365
|
-
RVAL2ATOM(property)));
|
366
|
-
}
|
367
|
-
|
368
|
-
static VALUE
|
369
|
-
rg_window_manager_name(VALUE self)
|
370
|
-
{
|
371
|
-
return CSTR2RVAL(gdk_x11_screen_get_window_manager_name(_SELF(self)));
|
372
|
-
}
|
373
|
-
static VALUE
|
374
|
-
rg_screen_number(VALUE self)
|
375
|
-
{
|
376
|
-
return INT2NUM(gdk_x11_screen_get_screen_number(_SELF(self)));
|
377
|
-
}
|
378
|
-
#endif
|
379
|
-
|
380
|
-
void
|
381
|
-
Init_gdk_screen(VALUE mGdk)
|
382
|
-
{
|
383
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_SCREEN, "Screen", mGdk);
|
384
|
-
|
385
|
-
id_new = rb_intern("new");
|
386
|
-
|
387
|
-
RG_DEF_SMETHOD(default, 0);
|
388
|
-
/* deprecated
|
389
|
-
RG_DEF_METHOD(default_colormap, 0);
|
390
|
-
RG_DEF_METHOD(set_default_colormap, 1);
|
391
|
-
RG_DEF_METHOD(system_colormap, 0);
|
392
|
-
*/
|
393
|
-
RG_DEF_METHOD(system_visual, 0);
|
394
|
-
/* deprecated
|
395
|
-
RG_DEF_METHOD(rgb_colormap, 0);
|
396
|
-
RG_DEF_METHOD(rgb_visual, 0);
|
397
|
-
*/
|
398
|
-
/* deprecated
|
399
|
-
RG_DEF_METHOD(rgba_colormap, 0);
|
400
|
-
*/
|
401
|
-
RG_DEF_METHOD(rgba_visual, 0);
|
402
|
-
RG_DEF_METHOD_P(composited, 0);
|
403
|
-
RG_DEF_METHOD(root_window, 0);
|
404
|
-
RG_DEF_METHOD(display, 0);
|
405
|
-
RG_DEF_METHOD(number, 0);
|
406
|
-
RG_DEF_METHOD(width, 0);
|
407
|
-
RG_DEF_METHOD(height, 0);
|
408
|
-
RG_DEF_METHOD(width_mm, 0);
|
409
|
-
RG_DEF_METHOD(height_mm, 0);
|
410
|
-
RG_DEF_METHOD(visuals, 0);
|
411
|
-
RG_DEF_METHOD(toplevel_windows, 0);
|
412
|
-
RG_DEF_METHOD(display_name, 0);
|
413
|
-
RG_DEF_METHOD(n_monitors, 0);
|
414
|
-
RG_DEF_METHOD(monitor_geometry, 1);
|
415
|
-
RG_DEF_METHOD(get_monitor, -1);
|
416
|
-
/* deprecated
|
417
|
-
RG_DEF_METHOD(broadcast_client_message, 1);
|
418
|
-
*/
|
419
|
-
RG_DEF_METHOD(get_setting, -1);
|
420
|
-
#ifdef HAVE_RB_CAIRO_H
|
421
|
-
G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_get_font_options, 0);
|
422
|
-
G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_set_font_options, 1);
|
423
|
-
#endif
|
424
|
-
RG_DEF_METHOD(active_window, 0);
|
425
|
-
RG_DEF_METHOD(window_stack, 0);
|
426
|
-
|
427
|
-
/* deprecated
|
428
|
-
RG_DEF_METHOD(spawn_on_screen, 4);
|
429
|
-
RG_DEF_METHOD(spawn_on_screen_with_pipes, 4);
|
430
|
-
*/
|
431
|
-
RG_DEF_METHOD(spawn_command_line_on_screen, 1);
|
432
|
-
|
433
|
-
#ifdef GDK_WINDOWING_X11
|
434
|
-
RG_DEF_METHOD(xnumber, 0);
|
435
|
-
RG_DEF_METHOD_P(supports_net_wm_hint, 0);
|
436
|
-
RG_DEF_METHOD(window_manager_name, 0);
|
437
|
-
RG_DEF_METHOD(screen_number, 0);
|
438
|
-
#endif
|
439
|
-
|
440
|
-
#ifdef GDK_WINDOWING_X11
|
441
|
-
G_DEF_CLASS3("GdkScreenX11", "ScreenX11", mGdk);
|
442
|
-
#endif
|
443
|
-
}
|
data/ext/gdk3/rbgdkselection.c
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2002-2004 Masao Mutoh
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU Lesser General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 2.1 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
-
* MA 02110-1301 USA
|
20
|
-
*/
|
21
|
-
|
22
|
-
#include "rbgdk3private.h"
|
23
|
-
|
24
|
-
#define RG_TARGET_NAMESPACE mSelection
|
25
|
-
|
26
|
-
static VALUE
|
27
|
-
rg_s_owner_set(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
28
|
-
{
|
29
|
-
VALUE owner, selection, time, send_event;
|
30
|
-
int ret;
|
31
|
-
|
32
|
-
if (argc == 4){
|
33
|
-
rb_scan_args(argc, argv, "40", &owner, &selection, &time, &send_event);
|
34
|
-
ret = gdk_selection_owner_set(RVAL2GDKWINDOW(owner),
|
35
|
-
RVAL2ATOM(selection),
|
36
|
-
NUM2UINT(time), RVAL2CBOOL(send_event));
|
37
|
-
} else {
|
38
|
-
VALUE display = Qnil;
|
39
|
-
rb_scan_args(argc, argv, "50", &display, &owner, &selection, &time, &send_event);
|
40
|
-
ret = gdk_selection_owner_set_for_display(RVAL2GDKDISPLAYOBJECT(display),
|
41
|
-
RVAL2GDKWINDOW(owner),
|
42
|
-
RVAL2ATOM(selection),
|
43
|
-
NUM2UINT(time), RVAL2CBOOL(send_event));
|
44
|
-
}
|
45
|
-
return CBOOL2RVAL(ret);
|
46
|
-
}
|
47
|
-
|
48
|
-
static VALUE
|
49
|
-
rg_s_owner_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
50
|
-
{
|
51
|
-
VALUE selection;
|
52
|
-
|
53
|
-
if (argc == 1) {
|
54
|
-
rb_scan_args(argc, argv, "10", &selection);
|
55
|
-
return GOBJ2RVAL(gdk_selection_owner_get(RVAL2ATOM(selection)));
|
56
|
-
} else {
|
57
|
-
VALUE display = Qnil;
|
58
|
-
rb_scan_args(argc, argv, "20", &display, &selection);
|
59
|
-
return GOBJ2RVAL(gdk_selection_owner_get_for_display(RVAL2GDKDISPLAYOBJECT(display),
|
60
|
-
RVAL2ATOM(selection)));
|
61
|
-
}
|
62
|
-
}
|
63
|
-
|
64
|
-
static VALUE
|
65
|
-
rg_s_convert(VALUE self, VALUE requestor, VALUE selection, VALUE target, VALUE time)
|
66
|
-
{
|
67
|
-
gdk_selection_convert(RVAL2GDKWINDOW(requestor),
|
68
|
-
RVAL2ATOM(selection),
|
69
|
-
RVAL2ATOM(target), NUM2INT(time));
|
70
|
-
return self;
|
71
|
-
}
|
72
|
-
|
73
|
-
static VALUE
|
74
|
-
rg_s_property_get(G_GNUC_UNUSED VALUE self, VALUE requestor)
|
75
|
-
{
|
76
|
-
guchar *data;
|
77
|
-
GdkAtom prop_type;
|
78
|
-
gint prop_format;
|
79
|
-
VALUE ary;
|
80
|
-
|
81
|
-
gdk_selection_property_get(RVAL2GDKWINDOW(requestor), &data,
|
82
|
-
&prop_type, &prop_format);
|
83
|
-
|
84
|
-
ary = rb_ary_new3(3, CSTR2RVAL((const char*)data), GDKATOM2RVAL(prop_type),
|
85
|
-
INT2NUM(prop_format));
|
86
|
-
g_free(data);
|
87
|
-
return ary;
|
88
|
-
}
|
89
|
-
|
90
|
-
static VALUE
|
91
|
-
rg_s_send_notify(int argc, VALUE *argv, VALUE self)
|
92
|
-
{
|
93
|
-
VALUE requestor, selection, target, property, time;
|
94
|
-
|
95
|
-
if (argc == 5) {
|
96
|
-
rb_scan_args(argc, argv, "50", &requestor, &selection, &target, &property, &time);
|
97
|
-
gdk_selection_send_notify(RVAL2GDKWINDOW(requestor), RVAL2ATOM(selection),
|
98
|
-
RVAL2ATOM(target),
|
99
|
-
NIL_P(property) ? GDK_NONE : RVAL2ATOM(property),
|
100
|
-
NUM2INT(time));
|
101
|
-
} else {
|
102
|
-
VALUE display = Qnil;
|
103
|
-
rb_scan_args(argc, argv, "60", &display, &requestor, &selection, &target, &property, &time);
|
104
|
-
gdk_selection_send_notify_for_display(RVAL2GDKDISPLAYOBJECT(display),
|
105
|
-
RVAL2GDKWINDOW(requestor), RVAL2ATOM(selection),
|
106
|
-
RVAL2ATOM(target),
|
107
|
-
NIL_P(property) ? GDK_NONE : RVAL2ATOM(property),
|
108
|
-
NUM2INT(time));
|
109
|
-
}
|
110
|
-
return self;
|
111
|
-
}
|
112
|
-
|
113
|
-
void
|
114
|
-
Init_gdk_selection(VALUE mGdk)
|
115
|
-
{
|
116
|
-
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Selection");
|
117
|
-
|
118
|
-
RG_DEF_SMETHOD(owner_set, -1);
|
119
|
-
RG_DEF_SMETHOD(owner_get, -1);
|
120
|
-
RG_DEF_SMETHOD(convert, 4);
|
121
|
-
RG_DEF_SMETHOD(property_get, 1);
|
122
|
-
RG_DEF_SMETHOD(send_notify, -1);
|
123
|
-
|
124
|
-
/* Constants */
|
125
|
-
rb_define_const(RG_TARGET_NAMESPACE, "PRIMARY", GDKATOM2RVAL(GDK_SELECTION_PRIMARY));
|
126
|
-
rb_define_const(RG_TARGET_NAMESPACE, "SECONDARY", GDKATOM2RVAL(GDK_SELECTION_SECONDARY));
|
127
|
-
rb_define_const(RG_TARGET_NAMESPACE, "CLIPBOARD", GDKATOM2RVAL(GDK_SELECTION_CLIPBOARD));
|
128
|
-
|
129
|
-
/* GdkSelectionType */
|
130
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_ATOM", GDKATOM2RVAL(GDK_SELECTION_TYPE_ATOM));
|
131
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BITMAP", GDKATOM2RVAL(GDK_SELECTION_TYPE_BITMAP));
|
132
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_COLORMAP", GDKATOM2RVAL(GDK_SELECTION_TYPE_COLORMAP));
|
133
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_DRAWABLE", GDKATOM2RVAL(GDK_SELECTION_TYPE_DRAWABLE));
|
134
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_INTEGER", GDKATOM2RVAL(GDK_SELECTION_TYPE_INTEGER));
|
135
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_PIXMAP", GDKATOM2RVAL(GDK_SELECTION_TYPE_PIXMAP));
|
136
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_WINDOW", GDKATOM2RVAL(GDK_SELECTION_TYPE_WINDOW));
|
137
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRING", GDKATOM2RVAL(GDK_SELECTION_TYPE_STRING));
|
138
|
-
|
139
|
-
/* GdkTarget */
|
140
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TARGET_BITMAP", GDKATOM2RVAL(GDK_TARGET_BITMAP));
|
141
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TARGET_COLORMAP", GDKATOM2RVAL(GDK_TARGET_COLORMAP));
|
142
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TARGET_DRAWABLE", GDKATOM2RVAL(GDK_TARGET_DRAWABLE));
|
143
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TARGET_PIXMAP", GDKATOM2RVAL(GDK_TARGET_PIXMAP));
|
144
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TARGET_STRING", GDKATOM2RVAL(GDK_TARGET_STRING));
|
145
|
-
|
146
|
-
}
|
data/ext/gdk3/rbgdkthreads.c
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2003-2005 Masao Mutoh
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU Lesser General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 2.1 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
-
* MA 02110-1301 USA
|
20
|
-
*/
|
21
|
-
|
22
|
-
#include "rbgdk3private.h"
|
23
|
-
|
24
|
-
#ifdef G_THREADS_ENABLED
|
25
|
-
|
26
|
-
#define RG_TARGET_NAMESPACE mThreads
|
27
|
-
|
28
|
-
static VALUE
|
29
|
-
rg_s_init(VALUE self)
|
30
|
-
{
|
31
|
-
#ifndef GDK_WINDOWING_WIN32
|
32
|
-
if (!g_thread_supported()){
|
33
|
-
g_thread_init(NULL);
|
34
|
-
}
|
35
|
-
gdk_threads_init();
|
36
|
-
#endif
|
37
|
-
return self;
|
38
|
-
}
|
39
|
-
|
40
|
-
static VALUE
|
41
|
-
rg_s_enter(VALUE self)
|
42
|
-
{
|
43
|
-
gdk_threads_enter();
|
44
|
-
return self;
|
45
|
-
}
|
46
|
-
|
47
|
-
static VALUE
|
48
|
-
rg_s_leave(VALUE self)
|
49
|
-
{
|
50
|
-
gdk_threads_leave();
|
51
|
-
return self;
|
52
|
-
}
|
53
|
-
|
54
|
-
static VALUE
|
55
|
-
rg_s_synchronize(G_GNUC_UNUSED VALUE self)
|
56
|
-
{
|
57
|
-
VALUE func = rb_block_proc();
|
58
|
-
gdk_threads_enter();
|
59
|
-
func = rb_block_proc();
|
60
|
-
rb_funcall(func, id_call, 0);
|
61
|
-
gdk_threads_leave();
|
62
|
-
return Qnil;
|
63
|
-
}
|
64
|
-
#endif
|
65
|
-
|
66
|
-
void
|
67
|
-
Init_gdk_threads(VALUE mGdk)
|
68
|
-
{
|
69
|
-
#ifdef G_THREADS_ENABLED
|
70
|
-
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Threads");
|
71
|
-
|
72
|
-
RG_DEF_SMETHOD(init, 0);
|
73
|
-
RG_DEF_SMETHOD(enter, 0);
|
74
|
-
RG_DEF_SMETHOD(leave, 0);
|
75
|
-
RG_DEF_SMETHOD(synchronize, 0);
|
76
|
-
#endif
|
77
|
-
}
|