gtk2 2.0.2 → 2.0.3
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 +7 -0
- data/README +2 -2
- data/Rakefile +5 -3
- data/ext/gtk2/extconf.rb +5 -2
- data/ext/gtk2/global.h +1 -8
- data/ext/gtk2/rbgdk.c +1 -16
- data/ext/gtk2/rbgdkcairo.c +0 -8
- data/ext/gtk2/rbgdkcolormap.c +0 -4
- data/ext/gtk2/rbgdkcursor.c +0 -18
- data/ext/gtk2/rbgdkdisplay.c +7 -45
- data/ext/gtk2/rbgdkdisplaymanager.c +0 -5
- data/ext/gtk2/rbgdkdragcontext.c +0 -13
- data/ext/gtk2/rbgdkdraw.c +2 -26
- data/ext/gtk2/rbgdkevent.c +631 -324
- data/ext/gtk2/rbgdkgc.c +0 -5
- data/ext/gtk2/rbgdkkeymap.c +2 -4
- data/ext/gtk2/rbgdkpango.c +0 -5
- data/ext/gtk2/rbgdkpangorenderer.c +0 -6
- data/ext/gtk2/rbgdkpixbuf.c +0 -3
- data/ext/gtk2/rbgdkpixmap.c +3 -18
- data/ext/gtk2/rbgdkproperty.c +0 -41
- data/ext/gtk2/rbgdkscreen.c +0 -22
- data/ext/gtk2/rbgdkselection.c +0 -13
- data/ext/gtk2/rbgdkvisual.c +0 -4
- data/ext/gtk2/rbgdkwindow.c +2 -71
- data/ext/gtk2/rbgdkx11.c +1 -6
- data/ext/gtk2/rbgtkaboutdialog.c +0 -5
- data/ext/gtk2/rbgtkaccelerator.c +0 -4
- data/ext/gtk2/rbgtkaccelgroup.c +0 -8
- data/ext/gtk2/rbgtkaccelmap.c +0 -15
- data/ext/gtk2/rbgtkaction.c +0 -14
- data/ext/gtk2/rbgtkactiongroup.c +0 -9
- data/ext/gtk2/rbgtkalignment.c +0 -4
- data/ext/gtk2/rbgtkassistant.c +0 -6
- data/ext/gtk2/rbgtkbbox.c +0 -4
- data/ext/gtk2/rbgtkbutton.c +0 -4
- data/ext/gtk2/rbgtkcalendar.c +0 -8
- data/ext/gtk2/rbgtkcelllayout.c +0 -5
- data/ext/gtk2/rbgtkcellrenderer.c +0 -8
- data/ext/gtk2/rbgtkcellrendereraccel.c +0 -6
- data/ext/gtk2/rbgtkcellrenderercombo.c +0 -6
- data/ext/gtk2/rbgtkcellrendererprogress.c +0 -6
- data/ext/gtk2/rbgtkcellrendererspin.c +0 -6
- data/ext/gtk2/rbgtkcellview.c +0 -5
- data/ext/gtk2/rbgtkclipboard.c +0 -48
- data/ext/gtk2/rbgtkcolorbutton.c +0 -6
- data/ext/gtk2/rbgtkcolorsel.c +0 -4
- data/ext/gtk2/rbgtkcombobox.c +0 -12
- data/ext/gtk2/rbgtkcomboboxentry.c +0 -6
- data/ext/gtk2/rbgtkconst.c +0 -2
- data/ext/gtk2/rbgtkdialog.c +0 -10
- data/ext/gtk2/rbgtkdrag.c +0 -24
- data/ext/gtk2/rbgtkentry.c +0 -4
- data/ext/gtk2/rbgtkentrycompletion.c +0 -10
- data/ext/gtk2/rbgtkexpander.c +0 -6
- data/ext/gtk2/rbgtkfilechooser.c +0 -10
- data/ext/gtk2/rbgtkfilechooserbutton.c +0 -6
- data/ext/gtk2/rbgtkfilechooserdialog.c +0 -8
- data/ext/gtk2/rbgtkfilechooserwidget.c +0 -6
- data/ext/gtk2/rbgtkfilefilter.c +0 -11
- data/ext/gtk2/rbgtkfilesystemerror.c +0 -2
- data/ext/gtk2/rbgtkfontbutton.c +0 -6
- data/ext/gtk2/rbgtkiconinfo.c +0 -5
- data/ext/gtk2/rbgtkiconsize.c +0 -4
- data/ext/gtk2/rbgtkicontheme.c +0 -11
- data/ext/gtk2/rbgtkiconview.c +0 -9
- data/ext/gtk2/rbgtkimage.c +0 -8
- data/ext/gtk2/rbgtkinvisible.c +0 -4
- data/ext/gtk2/rbgtklinkbutton.c +0 -5
- data/ext/gtk2/rbgtkliststore.c +0 -14
- data/ext/gtk2/rbgtkmenu.c +0 -12
- data/ext/gtk2/rbgtkmenubar.c +0 -2
- data/ext/gtk2/rbgtkmenushell.c +0 -4
- data/ext/gtk2/rbgtkmenutoolbutton.c +0 -5
- data/ext/gtk2/rbgtkmessagedialog.c +0 -4
- data/ext/gtk2/rbgtknotebook.c +0 -9
- data/ext/gtk2/rbgtkpagesetup.c +0 -5
- data/ext/gtk2/rbgtkpapersize.c +0 -6
- data/ext/gtk2/rbgtkprintcontext.c +0 -5
- data/ext/gtk2/rbgtkprintoperation.c +0 -5
- data/ext/gtk2/rbgtkprintoperationpreview.c +0 -5
- data/ext/gtk2/rbgtkprintsettings.c +0 -5
- data/ext/gtk2/rbgtkradioaction.c +0 -18
- data/ext/gtk2/rbgtkradiotoolbutton.c +0 -6
- data/ext/gtk2/rbgtkrange.c +0 -2
- data/ext/gtk2/rbgtkrc.c +0 -4
- data/ext/gtk2/rbgtkrecentchooser.c +0 -6
- data/ext/gtk2/rbgtkrecentchooserdialog.c +0 -5
- data/ext/gtk2/rbgtkrecentchoosermenu.c +0 -6
- data/ext/gtk2/rbgtkrecentchooserwidget.c +0 -5
- data/ext/gtk2/rbgtkrecentdata.c +0 -6
- data/ext/gtk2/rbgtkrecentfilter.c +0 -5
- data/ext/gtk2/rbgtkrecentfilterinfo.c +0 -6
- data/ext/gtk2/rbgtkrecentinfo.c +0 -5
- data/ext/gtk2/rbgtkrecentmanager.c +0 -5
- data/ext/gtk2/rbgtkscale.c +0 -6
- data/ext/gtk2/rbgtkscrolledwindow.c +0 -9
- data/ext/gtk2/rbgtkselection.c +0 -8
- data/ext/gtk2/rbgtkselectiondata.c +2 -14
- data/ext/gtk2/rbgtkseparatortoolitem.c +0 -6
- data/ext/gtk2/rbgtksettings.c +0 -4
- data/ext/gtk2/rbgtksizegroup.c +0 -5
- data/ext/gtk2/rbgtkstatusicon.c +0 -5
- data/ext/gtk2/rbgtkstock.c +0 -38
- data/ext/gtk2/rbgtkstyle.c +0 -8
- data/ext/gtk2/rbgtktargetlist.c +0 -34
- data/ext/gtk2/rbgtktextbuffer.c +0 -12
- data/ext/gtk2/rbgtktextiter.c +0 -8
- data/ext/gtk2/rbgtktextview.c +0 -4
- data/ext/gtk2/rbgtktoggleaction.c +0 -7
- data/ext/gtk2/rbgtktoggletoolbutton.c +0 -6
- data/ext/gtk2/rbgtktoolbar.c +0 -6
- data/ext/gtk2/rbgtktoolbutton.c +0 -6
- data/ext/gtk2/rbgtktoolitem.c +0 -9
- data/ext/gtk2/rbgtktooltips.c +0 -4
- data/ext/gtk2/rbgtktreeiter.c +0 -4
- data/ext/gtk2/rbgtktreemodelfilter.c +0 -5
- data/ext/gtk2/rbgtktreemodelsort.c +0 -4
- data/ext/gtk2/rbgtktreerowreference.c +0 -4
- data/ext/gtk2/rbgtktreeselection.c +0 -4
- data/ext/gtk2/rbgtktreestore.c +0 -19
- data/ext/gtk2/rbgtktreeview.c +0 -24
- data/ext/gtk2/rbgtktreeviewcolumn.c +0 -10
- data/ext/gtk2/rbgtkuimanager.c +0 -6
- data/ext/gtk2/rbgtkwidget.c +1 -31
- data/ext/gtk2/rbgtkwindow.c +2 -47
- data/sample/gtk-demo/common.rb +6 -1
- data/sample/gtk-demo/main.rb +89 -85
- data/test/test_gtk_icon_theme.rb +11 -6
- metadata +14 -22
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 1783a7ac794f49ce1efb7192ddeaf54f4c6caad4
|
|
4
|
+
data.tar.gz: 139bc23e2a95289fb327f0e2af296e9a765e3b0b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fb2edfc129d3c155aee1965a1a48079b517244bcff272bd56cf38df10b62aff5422324722499d6f6c5d66e7422fd11e7b55c41a9da12d58dde3d1a504e094987
|
|
7
|
+
data.tar.gz: 1a60b2424ea1ead0144f56b04d0ab776882fbfe19530c946a1b608eeac0de11a0542b50f80821ce0ea95303fbe7a4f9aacf24f3f464e595633e35f4ab8d90828
|
data/README
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Ruby/GTK2
|
|
2
2
|
=========
|
|
3
|
-
Ruby/GTK2 is a Ruby binding of GTK+-2.
|
|
3
|
+
Ruby/GTK2 is a Ruby binding of GTK+-2.10.x.
|
|
4
4
|
|
|
5
5
|
Requirements
|
|
6
6
|
------------
|
|
@@ -12,7 +12,7 @@ Requirements
|
|
|
12
12
|
|
|
13
13
|
Install
|
|
14
14
|
-------
|
|
15
|
-
0. install ruby-1.
|
|
15
|
+
0. install ruby-1.9.x or later, GTK+-2.10.x, Ruby/GLib2, Ruby/Pango
|
|
16
16
|
(and cairo/rcairo).
|
|
17
17
|
1. ruby extconf.rb
|
|
18
18
|
(To use rcairo on Win32, set CAIRO_PATH as a environment variable first)
|
data/Rakefile
CHANGED
|
@@ -17,24 +17,26 @@ package = GNOME2Package.new do |_package|
|
|
|
17
17
|
:name => "gtk+",
|
|
18
18
|
:download_site => :gnome,
|
|
19
19
|
:label => "gtk+",
|
|
20
|
-
:version => "2.24.
|
|
20
|
+
:version => "2.24.22",
|
|
21
21
|
:compression_method => "xz",
|
|
22
22
|
:windows => {
|
|
23
23
|
:configure_args => [],
|
|
24
24
|
:need_autoreconf => true,
|
|
25
25
|
:patches => [
|
|
26
|
-
"gtk+-2.24.
|
|
26
|
+
"gtk+-2.24.22-add-missing-exeext.diff",
|
|
27
27
|
],
|
|
28
|
+
:built_file => "bin/libgtk-win32-2.0-0.dll",
|
|
28
29
|
},
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
:name => "hicolor-icon-theme",
|
|
32
33
|
:download_base_url => "http://icon-theme.freedesktop.org/releases",
|
|
33
34
|
:label => "gtk-hi-color-icon-theme",
|
|
34
|
-
:version => "0.
|
|
35
|
+
:version => "0.13",
|
|
35
36
|
:windows => {
|
|
36
37
|
:configure_args => [],
|
|
37
38
|
:build_concurrently => false,
|
|
39
|
+
:built_file => "share/icons/hicolor/index.theme",
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
42
|
]
|
data/ext/gtk2/extconf.rb
CHANGED
|
@@ -54,11 +54,14 @@ rcairo_source_dir_names.each do |rcairo_source_dir_name|
|
|
|
54
54
|
break
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
unless check_cairo(rcairo_options)
|
|
59
|
+
exit(false)
|
|
60
|
+
end
|
|
58
61
|
|
|
59
62
|
setup_win32(module_name, base_dir)
|
|
60
63
|
|
|
61
|
-
unless required_pkg_config_package(package_id,
|
|
64
|
+
unless required_pkg_config_package([package_id, 2, 10, 0],
|
|
62
65
|
:debian => "libgtk2.0-dev",
|
|
63
66
|
:redhat => "gtk2-devel",
|
|
64
67
|
:homebrew => "gtk+",
|
data/ext/gtk2/global.h
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C)
|
|
4
|
-
* Copyright (C) 2002,2003 Ruby-GNOME2 Project Team
|
|
3
|
+
* Copyright (C) 2002-2013 Ruby-GNOME2 Project Team
|
|
5
4
|
* Copyright (C) 1998-2000 Yukihiro Matsumoto,
|
|
6
5
|
* Daisuke Kanda,
|
|
7
6
|
* Hiroshi Igarashi
|
|
@@ -47,12 +46,6 @@
|
|
|
47
46
|
# define G_VALUE_INIT { 0, { { 0 } } }
|
|
48
47
|
#endif
|
|
49
48
|
|
|
50
|
-
#if GTK_CHECK_VERSION(2,8,0) && defined(HAVE_RB_CAIRO_H)
|
|
51
|
-
# define CAIRO_AVAILABLE 1
|
|
52
|
-
#else
|
|
53
|
-
# define CAIRO_AVAILABLE 0
|
|
54
|
-
#endif
|
|
55
|
-
|
|
56
49
|
extern ID id_relative_callbacks;
|
|
57
50
|
extern ID id_call;
|
|
58
51
|
extern VALUE treeiter_set_value_table;
|
data/ext/gtk2/rbgdk.c
CHANGED
|
@@ -171,13 +171,11 @@ rbgdk_rval2gdkpixbufglist(VALUE value)
|
|
|
171
171
|
return args.result;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
175
174
|
static VALUE
|
|
176
175
|
rg_m_display_arg_name(G_GNUC_UNUSED VALUE self)
|
|
177
176
|
{
|
|
178
177
|
return CSTR2RVAL(gdk_get_display_arg_name());
|
|
179
178
|
}
|
|
180
|
-
#endif
|
|
181
179
|
|
|
182
180
|
static VALUE
|
|
183
181
|
rg_m_set_locale(G_GNUC_UNUSED VALUE self)
|
|
@@ -192,7 +190,6 @@ rg_m_set_sm_client_id(VALUE self, VALUE id)
|
|
|
192
190
|
return self;
|
|
193
191
|
}
|
|
194
192
|
|
|
195
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
196
193
|
static VALUE
|
|
197
194
|
rg_m_notify_startup_complete(int argc, VALUE *argv, VALUE self)
|
|
198
195
|
{
|
|
@@ -213,7 +210,6 @@ rg_m_notify_startup_complete(int argc, VALUE *argv, VALUE self)
|
|
|
213
210
|
}
|
|
214
211
|
return self;
|
|
215
212
|
}
|
|
216
|
-
#endif
|
|
217
213
|
|
|
218
214
|
static VALUE
|
|
219
215
|
rg_m_program_class(G_GNUC_UNUSED VALUE self)
|
|
@@ -262,11 +258,8 @@ rbgdk_x_io_error(Display *display)
|
|
|
262
258
|
const gchar* disp;
|
|
263
259
|
const gchar* error;
|
|
264
260
|
|
|
265
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
266
261
|
disp = display ? DisplayString(display) : gdk_get_display_arg_name();
|
|
267
|
-
|
|
268
|
-
disp = DisplayString(display);
|
|
269
|
-
#endif
|
|
262
|
+
|
|
270
263
|
if (! disp)
|
|
271
264
|
disp = "(none)";
|
|
272
265
|
|
|
@@ -462,11 +455,7 @@ rg_m_target(G_GNUC_UNUSED VALUE self)
|
|
|
462
455
|
static VALUE
|
|
463
456
|
rg_m_cairo_available_p(G_GNUC_UNUSED VALUE self)
|
|
464
457
|
{
|
|
465
|
-
#if CAIRO_AVAILABLE
|
|
466
458
|
return Qtrue;
|
|
467
|
-
#else
|
|
468
|
-
return Qfalse;
|
|
469
|
-
#endif
|
|
470
459
|
}
|
|
471
460
|
|
|
472
461
|
void
|
|
@@ -474,14 +463,10 @@ Init_gtk_gdk(void)
|
|
|
474
463
|
{
|
|
475
464
|
RG_TARGET_NAMESPACE = rb_define_module("Gdk");
|
|
476
465
|
|
|
477
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
478
466
|
RG_DEF_MODFUNC(display_arg_name, 0);
|
|
479
|
-
#endif
|
|
480
467
|
RG_DEF_MODFUNC(set_locale, 0);
|
|
481
468
|
RG_DEF_MODFUNC(set_sm_client_id, 1);
|
|
482
|
-
#if GTK_CHECK_VERSION(2, 2, 0)
|
|
483
469
|
RG_DEF_MODFUNC(notify_startup_complete, -1);
|
|
484
|
-
#endif
|
|
485
470
|
RG_DEF_MODFUNC(program_class, 0);
|
|
486
471
|
RG_DEF_MODFUNC(set_program_class, 1);
|
|
487
472
|
RG_DEF_MODFUNC(display, 0);
|
data/ext/gtk2/rbgdkcairo.c
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
#include "global.h"
|
|
23
23
|
|
|
24
|
-
#if CAIRO_AVAILABLE
|
|
25
24
|
#include <gdk/gdkcairo.h>
|
|
26
25
|
#include <rb_cairo.h>
|
|
27
26
|
|
|
@@ -51,7 +50,6 @@ rg_set_source_pixbuf(int argc, VALUE *argv, VALUE self)
|
|
|
51
50
|
return self;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
#if GTK_CHECK_VERSION(2,10,0)
|
|
55
53
|
static VALUE
|
|
56
54
|
rg_set_source_pixmap(VALUE self, VALUE pixmap, VALUE pixmap_x, VALUE pixmap_y)
|
|
57
55
|
{
|
|
@@ -60,7 +58,6 @@ rg_set_source_pixmap(VALUE self, VALUE pixmap, VALUE pixmap_x, VALUE pixmap_y)
|
|
|
60
58
|
rb_cairo_check_status(cairo_status(_SELF(self)));
|
|
61
59
|
return self;
|
|
62
60
|
}
|
|
63
|
-
#endif
|
|
64
61
|
|
|
65
62
|
static VALUE
|
|
66
63
|
rg_gdk_rectangle(VALUE self, VALUE rectangle)
|
|
@@ -78,20 +75,15 @@ rg_gdk_region(VALUE self, VALUE region)
|
|
|
78
75
|
rb_cairo_check_status(cairo_status(_SELF(self)));
|
|
79
76
|
return self;
|
|
80
77
|
}
|
|
81
|
-
#endif
|
|
82
78
|
|
|
83
79
|
void
|
|
84
80
|
Init_gtk_gdk_cairo(void)
|
|
85
81
|
{
|
|
86
|
-
#if CAIRO_AVAILABLE
|
|
87
82
|
RG_DEF_METHOD(set_source_gdk_color, 1);
|
|
88
83
|
RG_DEF_METHOD(set_source_pixbuf, -1);
|
|
89
|
-
#if GTK_CHECK_VERSION(2,10,0)
|
|
90
84
|
RG_DEF_METHOD(set_source_pixmap, 3);
|
|
91
|
-
#endif
|
|
92
85
|
RG_DEF_METHOD(gdk_rectangle, 1);
|
|
93
86
|
RG_DEF_METHOD(gdk_region, 1);
|
|
94
87
|
|
|
95
88
|
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
|
96
|
-
#endif
|
|
97
89
|
}
|
data/ext/gtk2/rbgdkcolormap.c
CHANGED
|
@@ -86,13 +86,11 @@ rg_visual(VALUE self)
|
|
|
86
86
|
return GOBJ2RVAL(gdk_colormap_get_visual(_SELF(self)));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
90
89
|
static VALUE
|
|
91
90
|
rg_screen(VALUE self)
|
|
92
91
|
{
|
|
93
92
|
return GOBJ2RVAL(gdk_colormap_get_screen(_SELF(self)));
|
|
94
93
|
}
|
|
95
|
-
#endif
|
|
96
94
|
|
|
97
95
|
static VALUE
|
|
98
96
|
rg_colors(VALUE self)
|
|
@@ -132,8 +130,6 @@ Init_gtk_gdk_colormap(VALUE mGdk)
|
|
|
132
130
|
RG_DEF_METHOD(free_color, 1);
|
|
133
131
|
RG_DEF_METHOD(query_color, 1);
|
|
134
132
|
RG_DEF_METHOD(visual, 0);
|
|
135
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
136
133
|
RG_DEF_METHOD(screen, 0);
|
|
137
|
-
#endif
|
|
138
134
|
RG_DEF_METHOD(colors, 0);
|
|
139
135
|
}
|
data/ext/gtk2/rbgdkcursor.c
CHANGED
|
@@ -33,30 +33,20 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
33
33
|
rb_scan_args(argc, argv, "10", &type);
|
|
34
34
|
cursor = gdk_cursor_new(RVAL2GENUM(type, GDK_TYPE_CURSOR_TYPE));
|
|
35
35
|
} else if (argc == 2) {
|
|
36
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
37
36
|
VALUE display, type_or_name;
|
|
38
37
|
rb_scan_args(argc, argv, "20", &display, &type_or_name);
|
|
39
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
40
38
|
if (TYPE(type_or_name) == T_STRING)
|
|
41
39
|
cursor = gdk_cursor_new_from_name(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)),
|
|
42
40
|
RVAL2CSTR(type_or_name));
|
|
43
41
|
else
|
|
44
|
-
#endif
|
|
45
42
|
cursor = gdk_cursor_new_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)),
|
|
46
43
|
RVAL2GENUM(type_or_name, GDK_TYPE_CURSOR_TYPE));
|
|
47
|
-
#else
|
|
48
|
-
rb_raise(rb_eRuntimeError, "Gdk::Cursor.new(display, cursor_type) has been supported since GTK+-2.2.");
|
|
49
|
-
#endif
|
|
50
44
|
} else if (argc == 4) {
|
|
51
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
52
45
|
VALUE display, pixbuf, x, y;
|
|
53
46
|
rb_scan_args(argc, argv, "40", &display, &pixbuf, &x, &y);
|
|
54
47
|
cursor = gdk_cursor_new_from_pixbuf(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)),
|
|
55
48
|
GDK_PIXBUF(RVAL2GOBJ(pixbuf)),
|
|
56
49
|
NUM2INT(x), NUM2INT(y));
|
|
57
|
-
#else
|
|
58
|
-
rb_raise(rb_eRuntimeError, "Gdk::Cursor.new(pixbuf) has been supported since GTK+-2.4.");
|
|
59
|
-
#endif
|
|
60
50
|
} else if (argc == 6) {
|
|
61
51
|
VALUE pixmap, mask, fg, bg, x, y;
|
|
62
52
|
rb_scan_args(argc, argv, "60", &pixmap, &mask, &fg, &bg, &x, &y);
|
|
@@ -71,13 +61,11 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
71
61
|
return Qnil;
|
|
72
62
|
}
|
|
73
63
|
|
|
74
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
75
64
|
static VALUE
|
|
76
65
|
rg_display(VALUE self)
|
|
77
66
|
{
|
|
78
67
|
return GOBJ2RVAL(gdk_cursor_get_display((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_CURSOR)));
|
|
79
68
|
}
|
|
80
|
-
#endif
|
|
81
69
|
|
|
82
70
|
static VALUE
|
|
83
71
|
rg_pixmap_p(VALUE self)
|
|
@@ -92,13 +80,11 @@ rg_cursor_type(VALUE self)
|
|
|
92
80
|
return GENUM2RVAL(((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_CURSOR))->type, GDK_TYPE_CURSOR_TYPE);
|
|
93
81
|
}
|
|
94
82
|
|
|
95
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
96
83
|
static VALUE
|
|
97
84
|
rg_image(VALUE self)
|
|
98
85
|
{
|
|
99
86
|
return GOBJ2RVAL(gdk_cursor_get_image((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_CURSOR)));
|
|
100
87
|
}
|
|
101
|
-
#endif
|
|
102
88
|
|
|
103
89
|
void
|
|
104
90
|
Init_gtk_gdk_cursor(VALUE mGdk)
|
|
@@ -106,14 +92,10 @@ Init_gtk_gdk_cursor(VALUE mGdk)
|
|
|
106
92
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_CURSOR, "Cursor", mGdk);
|
|
107
93
|
|
|
108
94
|
RG_DEF_METHOD(initialize, -1);
|
|
109
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
110
95
|
RG_DEF_METHOD(display, 0);
|
|
111
|
-
#endif
|
|
112
96
|
RG_DEF_METHOD_P(pixmap, 0);
|
|
113
97
|
RG_DEF_METHOD(cursor_type, 0);
|
|
114
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
115
98
|
RG_DEF_METHOD(image, 0);
|
|
116
|
-
#endif
|
|
117
99
|
|
|
118
100
|
G_DEF_CLASS(GDK_TYPE_CURSOR_TYPE, "Type", RG_TARGET_NAMESPACE);
|
|
119
101
|
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_CURSOR_TYPE, "GDK_");
|
data/ext/gtk2/rbgdkdisplay.c
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C)
|
|
4
|
-
* Copyright (C) 2002-2005 Ruby-GNOME2 Project Team
|
|
3
|
+
* Copyright (C) 2002-2013 Ruby-GNOME2 Project Team
|
|
5
4
|
*
|
|
6
5
|
* This library is free software; you can redistribute it and/or
|
|
7
6
|
* modify it under the terms of the GNU Lesser General Public
|
|
@@ -21,8 +20,6 @@
|
|
|
21
20
|
|
|
22
21
|
#include "global.h"
|
|
23
22
|
|
|
24
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
25
|
-
|
|
26
23
|
#define RG_TARGET_NAMESPACE cDisplay
|
|
27
24
|
#define _SELF(i) GDK_DISPLAY_OBJECT(RVAL2GOBJ(i))
|
|
28
25
|
|
|
@@ -38,7 +35,7 @@ rg_s_open(G_GNUC_UNUSED VALUE self, VALUE display_name)
|
|
|
38
35
|
{
|
|
39
36
|
GdkDisplay* gdisplay = gdk_display_open(RVAL2CSTR(display_name));
|
|
40
37
|
if (! gdisplay) {
|
|
41
|
-
rb_raise(rb_eRuntimeError, "The display `%s' could not be opened.",
|
|
38
|
+
rb_raise(rb_eRuntimeError, "The display `%s' could not be opened.",
|
|
42
39
|
RVAL2CSTR(display_name));
|
|
43
40
|
} else {
|
|
44
41
|
VALUE display;
|
|
@@ -122,14 +119,12 @@ rg_sync(VALUE self)
|
|
|
122
119
|
return self;
|
|
123
120
|
}
|
|
124
121
|
|
|
125
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
126
122
|
static VALUE
|
|
127
123
|
rg_flush(VALUE self)
|
|
128
124
|
{
|
|
129
125
|
gdk_display_flush(_SELF(self));
|
|
130
126
|
return self;
|
|
131
127
|
}
|
|
132
|
-
#endif
|
|
133
128
|
|
|
134
129
|
static VALUE
|
|
135
130
|
rg_devices(VALUE self)
|
|
@@ -160,8 +155,8 @@ rg_put_event(VALUE self, VALUE event)
|
|
|
160
155
|
static GdkFilterReturn
|
|
161
156
|
filter_func(GdkXEvent xevent, GdkEvent event, gpointer func)
|
|
162
157
|
{
|
|
163
|
-
return GENUM2RVAL(rb_funcall((VALUE)func, id_call, 2,
|
|
164
|
-
????, GEV2RVAL(event)),
|
|
158
|
+
return GENUM2RVAL(rb_funcall((VALUE)func, id_call, 2,
|
|
159
|
+
????, GEV2RVAL(event)),
|
|
165
160
|
GDK_TYPE_FILTER_RETURN);
|
|
166
161
|
}
|
|
167
162
|
|
|
@@ -219,7 +214,6 @@ rg_closed_p(VALUE self)
|
|
|
219
214
|
return CBOOL2RVAL(_SELF(self)->closed);
|
|
220
215
|
}
|
|
221
216
|
|
|
222
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
223
217
|
static VALUE
|
|
224
218
|
rg_button_x(VALUE self)
|
|
225
219
|
{
|
|
@@ -248,7 +242,6 @@ rg_double_click_distance(VALUE self)
|
|
|
248
242
|
{
|
|
249
243
|
return UINT2NUM(_SELF(self)->double_click_distance);
|
|
250
244
|
}
|
|
251
|
-
#endif
|
|
252
245
|
|
|
253
246
|
static VALUE
|
|
254
247
|
rg_pointer(VALUE self)
|
|
@@ -278,7 +271,6 @@ GdkDisplayPointerHooks* gdk_display_set_pointer_hooks
|
|
|
278
271
|
const GdkDisplayPointerHooks *new_hooks);
|
|
279
272
|
*/
|
|
280
273
|
|
|
281
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
282
274
|
static VALUE
|
|
283
275
|
rg_supports_cursor_color_p(VALUE self)
|
|
284
276
|
{
|
|
@@ -310,9 +302,7 @@ rg_default_group(VALUE self)
|
|
|
310
302
|
{
|
|
311
303
|
return GOBJ2RVAL(gdk_display_get_default_group(_SELF(self)));
|
|
312
304
|
}
|
|
313
|
-
#endif
|
|
314
305
|
|
|
315
|
-
#if GTK_CHECK_VERSION(2,6,0)
|
|
316
306
|
static VALUE
|
|
317
307
|
rg_supports_selection_notification_p(VALUE self)
|
|
318
308
|
{
|
|
@@ -322,7 +312,7 @@ rg_supports_selection_notification_p(VALUE self)
|
|
|
322
312
|
static VALUE
|
|
323
313
|
rg_request_selection_notification_p(VALUE self, VALUE selection)
|
|
324
314
|
{
|
|
325
|
-
return CBOOL2RVAL(gdk_display_request_selection_notification(_SELF(self),
|
|
315
|
+
return CBOOL2RVAL(gdk_display_request_selection_notification(_SELF(self),
|
|
326
316
|
RVAL2ATOM(selection)));
|
|
327
317
|
}
|
|
328
318
|
|
|
@@ -347,7 +337,6 @@ rg_store_clipboard(VALUE self, VALUE rbclipboard_window, VALUE rbtime_, VALUE rb
|
|
|
347
337
|
|
|
348
338
|
return self;
|
|
349
339
|
}
|
|
350
|
-
#endif
|
|
351
340
|
|
|
352
341
|
static VALUE
|
|
353
342
|
rg_core_pointer(VALUE self)
|
|
@@ -355,14 +344,12 @@ rg_core_pointer(VALUE self)
|
|
|
355
344
|
return GOBJ2RVAL(gdk_display_get_core_pointer(_SELF(self)));
|
|
356
345
|
}
|
|
357
346
|
|
|
358
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
359
347
|
static VALUE
|
|
360
348
|
rg_warp_pointer(VALUE self, VALUE screen, VALUE x, VALUE y)
|
|
361
349
|
{
|
|
362
350
|
gdk_display_warp_pointer(_SELF(self), RVAL2GOBJ(screen), NUM2INT(x), NUM2INT(y));
|
|
363
351
|
return self;
|
|
364
352
|
}
|
|
365
|
-
#endif
|
|
366
353
|
|
|
367
354
|
#ifdef GDK_WINDOWING_X11
|
|
368
355
|
static VALUE
|
|
@@ -377,7 +364,6 @@ rg_ungrab(VALUE self)
|
|
|
377
364
|
gdk_x11_display_ungrab(_SELF(self));
|
|
378
365
|
return self;
|
|
379
366
|
}
|
|
380
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
381
367
|
static VALUE
|
|
382
368
|
rg_register_standard_event_type(VALUE self, VALUE event_base, VALUE n_events)
|
|
383
369
|
{
|
|
@@ -385,8 +371,7 @@ rg_register_standard_event_type(VALUE self, VALUE event_base, VALUE n_events)
|
|
|
385
371
|
NUM2INT(event_base), NUM2INT(n_events));
|
|
386
372
|
return self;
|
|
387
373
|
}
|
|
388
|
-
|
|
389
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
374
|
+
|
|
390
375
|
static VALUE
|
|
391
376
|
rg_user_time(VALUE self)
|
|
392
377
|
{
|
|
@@ -466,10 +451,6 @@ rg_startup_notification_id(VALUE self)
|
|
|
466
451
|
}
|
|
467
452
|
# endif
|
|
468
453
|
|
|
469
|
-
#endif
|
|
470
|
-
#endif
|
|
471
|
-
|
|
472
|
-
#if GTK_CHECK_VERSION(2,10,0)
|
|
473
454
|
static VALUE
|
|
474
455
|
rg_supports_shapes_p(VALUE self)
|
|
475
456
|
{
|
|
@@ -481,7 +462,6 @@ rg_supports_input_shapes_p(VALUE self)
|
|
|
481
462
|
{
|
|
482
463
|
return CBOOL2RVAL(gdk_display_supports_input_shapes(_SELF(self)));
|
|
483
464
|
}
|
|
484
|
-
#endif
|
|
485
465
|
|
|
486
466
|
#if GTK_CHECK_VERSION(2, 12, 0)
|
|
487
467
|
static VALUE
|
|
@@ -498,10 +478,9 @@ rg_trigger_tooltip_query(VALUE self)
|
|
|
498
478
|
}
|
|
499
479
|
#endif
|
|
500
480
|
|
|
501
|
-
void
|
|
481
|
+
void
|
|
502
482
|
Init_gtk_gdk_display(VALUE mGdk)
|
|
503
483
|
{
|
|
504
|
-
#if GTK_CHECK_VERSION(2,2,0)
|
|
505
484
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY, "Display", mGdk);
|
|
506
485
|
|
|
507
486
|
RG_DEF_SMETHOD(open, 1);
|
|
@@ -518,9 +497,7 @@ Init_gtk_gdk_display(VALUE mGdk)
|
|
|
518
497
|
|
|
519
498
|
RG_DEF_METHOD(beep, 0);
|
|
520
499
|
RG_DEF_METHOD(sync, 0);
|
|
521
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
522
500
|
RG_DEF_METHOD(flush, 0);
|
|
523
|
-
#endif
|
|
524
501
|
RG_DEF_METHOD(close, 0);
|
|
525
502
|
|
|
526
503
|
RG_DEF_METHOD(devices, 0);
|
|
@@ -533,43 +510,31 @@ Init_gtk_gdk_display(VALUE mGdk)
|
|
|
533
510
|
RG_DEF_METHOD(button_window, 0);
|
|
534
511
|
RG_DEF_METHOD(button_number, 0);
|
|
535
512
|
RG_DEF_METHOD_P(closed, 0);
|
|
536
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
537
513
|
RG_DEF_METHOD(button_x, 0);
|
|
538
514
|
RG_DEF_METHOD(button_y, 0);
|
|
539
515
|
RG_DEF_METHOD(set_double_click_distance, 1);
|
|
540
516
|
RG_DEF_METHOD(double_click_distance, 0);
|
|
541
|
-
#endif
|
|
542
517
|
RG_DEF_METHOD(pointer, 0);
|
|
543
518
|
RG_DEF_METHOD(window_at_pointer, 0);
|
|
544
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
545
519
|
RG_DEF_METHOD_P(supports_cursor_color, 0);
|
|
546
520
|
RG_DEF_METHOD_P(supports_cursor_alpha, 0);
|
|
547
521
|
RG_DEF_METHOD(default_cursor_size, 0);
|
|
548
522
|
RG_DEF_METHOD(maximal_cursor_size, 0);
|
|
549
523
|
RG_DEF_METHOD(default_group, 0);
|
|
550
|
-
#endif
|
|
551
|
-
#if GTK_CHECK_VERSION(2,6,0)
|
|
552
524
|
RG_DEF_METHOD_P(supports_selection_notification, 0);
|
|
553
525
|
RG_DEF_METHOD_P(request_selection_notification, 1);
|
|
554
526
|
RG_DEF_METHOD_P(supports_clipboard_persistence, 0);
|
|
555
527
|
RG_DEF_METHOD(store_clipboard, 3);
|
|
556
|
-
#endif
|
|
557
528
|
RG_DEF_METHOD(core_pointer, 0);
|
|
558
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
559
529
|
RG_DEF_METHOD(warp_pointer, 3);
|
|
560
|
-
#endif
|
|
561
530
|
|
|
562
531
|
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
|
563
532
|
#ifdef GDK_WINDOWING_X11
|
|
564
533
|
RG_DEF_METHOD(grab, 0);
|
|
565
534
|
RG_DEF_METHOD(ungrab, 0);
|
|
566
|
-
#if GTK_CHECK_VERSION(2,4,0)
|
|
567
535
|
RG_DEF_METHOD(register_standard_event_type, 2);
|
|
568
|
-
#endif
|
|
569
|
-
#if GTK_CHECK_VERSION(2,8,0)
|
|
570
536
|
RG_DEF_METHOD(user_time, 0);
|
|
571
537
|
RG_DEF_METHOD(set_cursor_theme, 2);
|
|
572
|
-
#endif
|
|
573
538
|
# if GTK_CHECK_VERSION(2, 12, 0)
|
|
574
539
|
/*
|
|
575
540
|
RG_DEF_METHOD(broadcast_startup_message, -1);
|
|
@@ -578,12 +543,9 @@ Init_gtk_gdk_display(VALUE mGdk)
|
|
|
578
543
|
# endif
|
|
579
544
|
G_DEF_CLASS3("GdkDisplayX11", "DisplayX11", mGdk);
|
|
580
545
|
#endif
|
|
581
|
-
#endif
|
|
582
546
|
|
|
583
|
-
#if GTK_CHECK_VERSION(2,10,0)
|
|
584
547
|
RG_DEF_METHOD_P(supports_shapes, 0);
|
|
585
548
|
RG_DEF_METHOD_P(supports_input_shapes, 0);
|
|
586
|
-
#endif
|
|
587
549
|
#if GTK_CHECK_VERSION(2, 12, 0)
|
|
588
550
|
RG_DEF_METHOD_P(supports_composite, 0);
|
|
589
551
|
RG_DEF_METHOD(trigger_tooltip_query, 0);
|