gdk3 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +18 -4
  3. data/lib/gdk3/atom.rb +26 -0
  4. data/lib/gdk3/cairo.rb +60 -0
  5. data/lib/gdk3/color.rb +27 -0
  6. data/lib/gdk3/deprecated.rb +14 -16
  7. data/lib/gdk3/event.rb +38 -0
  8. data/lib/gdk3/loader.rb +266 -0
  9. data/lib/gdk3/rectangle.rb +38 -0
  10. data/lib/gdk3/rgba.rb +32 -0
  11. data/lib/gdk3/window-attr.rb +28 -0
  12. data/lib/gdk3/window.rb +21 -0
  13. data/lib/gdk3.rb +61 -2
  14. data/test/run-test.rb +15 -6
  15. data/test/test-gdk-cairo.rb +41 -0
  16. data/test/test-gdk-event-type.rb +25 -0
  17. data/test/test-gdk-event.rb +47 -49
  18. data/test/test-gdk-keyval.rb +21 -0
  19. data/test/test-gdk-pixbuf.rb +49 -0
  20. data/test/test-gdk-rectangle.rb +35 -4
  21. data/test/test-gdk-rgba.rb +6 -1
  22. data/test/test-gdk-window-attr.rb +1 -1
  23. metadata +23 -51
  24. data/ext/gdk3/depend +0 -11
  25. data/ext/gdk3/extconf.rb +0 -130
  26. data/ext/gdk3/gdk3.def +0 -12
  27. data/ext/gdk3/init.c +0 -35
  28. data/ext/gdk3/rbgdk.c +0 -491
  29. data/ext/gdk3/rbgdk3.h +0 -73
  30. data/ext/gdk3/rbgdk3conversions.h +0 -121
  31. data/ext/gdk3/rbgdk3private.h +0 -85
  32. data/ext/gdk3/rbgdkatom.c +0 -122
  33. data/ext/gdk3/rbgdkcairo.c +0 -91
  34. data/ext/gdk3/rbgdkcolor.c +0 -137
  35. data/ext/gdk3/rbgdkconst.c +0 -33
  36. data/ext/gdk3/rbgdkcursor.c +0 -92
  37. data/ext/gdk3/rbgdkdevice.c +0 -253
  38. data/ext/gdk3/rbgdkdevicemanager.c +0 -39
  39. data/ext/gdk3/rbgdkdisplay.c +0 -434
  40. data/ext/gdk3/rbgdkdisplaymanager.c +0 -55
  41. data/ext/gdk3/rbgdkdragcontext.c +0 -191
  42. data/ext/gdk3/rbgdkevent.c +0 -1173
  43. data/ext/gdk3/rbgdkgeometry.c +0 -253
  44. data/ext/gdk3/rbgdkkeymap.c +0 -151
  45. data/ext/gdk3/rbgdkkeyval.c +0 -108
  46. data/ext/gdk3/rbgdkpango.c +0 -197
  47. data/ext/gdk3/rbgdkpangorenderer.c +0 -144
  48. data/ext/gdk3/rbgdkpixbuf.c +0 -176
  49. data/ext/gdk3/rbgdkproperty.c +0 -305
  50. data/ext/gdk3/rbgdkrectangle.c +0 -140
  51. data/ext/gdk3/rbgdkrgb.c +0 -199
  52. data/ext/gdk3/rbgdkrgba.c +0 -142
  53. data/ext/gdk3/rbgdkscreen.c +0 -443
  54. data/ext/gdk3/rbgdkselection.c +0 -146
  55. data/ext/gdk3/rbgdkthreads.c +0 -77
  56. data/ext/gdk3/rbgdktimecoord.c +0 -133
  57. data/ext/gdk3/rbgdkvisual.c +0 -251
  58. data/ext/gdk3/rbgdkwindow.c +0 -1069
  59. data/ext/gdk3/rbgdkwindowattr.c +0 -191
  60. data/ext/gdk3/rbgdkx11.c +0 -102
  61. data/ext/gdk3/rbgdkx11x11window.c +0 -66
  62. data/extconf.rb +0 -49
  63. data/lib/gdk3/base.rb +0 -59
@@ -1,191 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2003 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
- /*****************************************/
25
- static GdkWindowAttr*
26
- attr_copy(const GdkWindowAttr* win)
27
- {
28
- GdkWindowAttr* new_win;
29
- g_return_val_if_fail (win != NULL, NULL);
30
- new_win = g_new(GdkWindowAttr, 1);
31
- *new_win = *win;
32
- return new_win;
33
- }
34
-
35
- GType
36
- gdk_windowattr_get_type(void)
37
- {
38
- static GType our_type = 0;
39
- if (our_type == 0)
40
- our_type = g_boxed_type_register_static ("GdkWindowAttr",
41
- (GBoxedCopyFunc)attr_copy,
42
- (GBoxedFreeFunc)g_free);
43
- return our_type;
44
- }
45
- /*****************************************/
46
-
47
- #define RG_TARGET_NAMESPACE cWindowAttr
48
- #define _SELF(w) (RVAL2GDKWINDOWATTR(w))
49
-
50
- static VALUE
51
- rg_initialize(VALUE self, VALUE width, VALUE height, VALUE wclass,
52
- VALUE window_type)
53
- {
54
- GdkWindowAttr attribute;
55
- attribute.width = NUM2INT(width);
56
- attribute.height = NUM2INT(height);
57
- attribute.wclass = RVAL2GDKWINDOWWINDOWCLASS(wclass);
58
- attribute.window_type = RVAL2GDKWINDOWTYPE(window_type);
59
- G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_WINDOW_ATTR, &attribute));
60
- return Qnil;
61
- }
62
-
63
- #define ATTR_STR(name)\
64
- static VALUE \
65
- attr_get_ ## name (VALUE self)\
66
- {\
67
- return CSTR2RVAL(_SELF(self)->name);\
68
- }\
69
- static VALUE \
70
- attr_set_ ## name (VALUE self, VALUE val)\
71
- {\
72
- _SELF(self)->name = (gchar *)RVAL2CSTR(val);\
73
- return self;\
74
- }
75
-
76
- #define ATTR_INT(name)\
77
- static VALUE \
78
- attr_get_ ## name (VALUE self)\
79
- {\
80
- return INT2NUM(_SELF(self)->name);\
81
- }\
82
- static VALUE \
83
- attr_set_ ## name (VALUE self, VALUE val)\
84
- {\
85
- _SELF(self)->name = NUM2INT(val);\
86
- return self;\
87
- }
88
-
89
- ATTR_STR(title);
90
- ATTR_INT(event_mask);
91
- ATTR_INT(x);
92
- ATTR_INT(y);
93
- ATTR_INT(width);
94
- ATTR_INT(height);
95
-
96
- static VALUE
97
- rg_wclass(VALUE self)
98
- {
99
- return GDKWINDOWWINDOWCLASS2RVAL(_SELF(self)->wclass);
100
- }
101
- static VALUE
102
- rg_set_wclass(VALUE self, VALUE val)
103
- {
104
- _SELF(self)->wclass = RVAL2GDKWINDOWWINDOWCLASS(val);
105
- return self;
106
- }
107
-
108
- static VALUE
109
- rg_visual(VALUE self)
110
- {
111
- return GOBJ2RVAL(_SELF(self)->visual);
112
- }
113
- static VALUE
114
- rg_set_visual(VALUE self, VALUE val)
115
- {
116
- _SELF(self)->visual = RVAL2GDKVISUAL(val);
117
- return self;
118
- }
119
-
120
- static VALUE
121
- rg_window_type(VALUE self)
122
- {
123
- return GDKWINDOWTYPE2RVAL(_SELF(self)->window_type);
124
- }
125
- static VALUE
126
- rg_set_window_type(VALUE self, VALUE val)
127
- {
128
- _SELF(self)->window_type = RVAL2GDKWINDOWTYPE(val);
129
- return self;
130
- }
131
-
132
- static VALUE
133
- rg_cursor(VALUE self)
134
- {
135
- return GDKCURSOR2RVAL(_SELF(self)->cursor);
136
- }
137
- static VALUE
138
- rg_set_cursor(VALUE self, VALUE val)
139
- {
140
- _SELF(self)->cursor = RVAL2GDKCURSOR(val);
141
- return self;
142
- }
143
-
144
- ATTR_STR(wmclass_name);
145
- ATTR_STR(wmclass_class);
146
-
147
- static VALUE
148
- rg_override_redirect(VALUE self)
149
- {
150
- return CBOOL2RVAL(_SELF(self)->override_redirect);
151
- }
152
- static VALUE
153
- rg_set_override_redirect(VALUE self, VALUE val)
154
- {
155
- _SELF(self)->override_redirect = RVAL2CBOOL(val);
156
- return self;
157
- }
158
-
159
- void
160
- Init_gdk_windowattr(VALUE mGdk)
161
- {
162
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_WINDOW_ATTR, "WindowAttr", mGdk);
163
-
164
- RG_DEF_METHOD(initialize, 4);
165
- rbg_define_method(RG_TARGET_NAMESPACE, "title", attr_get_title, 0);
166
- rbg_define_method(RG_TARGET_NAMESPACE, "set_title", attr_set_title, 1);
167
- rbg_define_method(RG_TARGET_NAMESPACE, "event_mask", attr_get_event_mask, 0);
168
- rbg_define_method(RG_TARGET_NAMESPACE, "set_event_mask", attr_set_event_mask, 1);
169
- rbg_define_method(RG_TARGET_NAMESPACE, "x", attr_get_x, 0);
170
- rbg_define_method(RG_TARGET_NAMESPACE, "set_x", attr_set_x, 1);
171
- rbg_define_method(RG_TARGET_NAMESPACE, "y", attr_get_y, 0);
172
- rbg_define_method(RG_TARGET_NAMESPACE, "set_y", attr_set_y, 1);
173
- rbg_define_method(RG_TARGET_NAMESPACE, "width", attr_get_width, 0);
174
- rbg_define_method(RG_TARGET_NAMESPACE, "set_width", attr_set_width, 1);
175
- rbg_define_method(RG_TARGET_NAMESPACE, "height", attr_get_height, 0);
176
- rbg_define_method(RG_TARGET_NAMESPACE, "set_height", attr_set_height, 1);
177
- RG_DEF_METHOD(wclass, 0);
178
- RG_DEF_METHOD(set_wclass, 1);
179
- RG_DEF_METHOD(visual, 0);
180
- RG_DEF_METHOD(set_visual, 1);
181
- RG_DEF_METHOD(window_type, 0);
182
- RG_DEF_METHOD(set_window_type, 1);
183
- RG_DEF_METHOD(cursor, 0);
184
- RG_DEF_METHOD(set_cursor, 1);
185
- rbg_define_method(RG_TARGET_NAMESPACE, "wmclass_name", attr_get_wmclass_name, 0);
186
- rbg_define_method(RG_TARGET_NAMESPACE, "set_wmclass_name", attr_set_wmclass_name, 1);
187
- rbg_define_method(RG_TARGET_NAMESPACE, "wmclass_class", attr_get_wmclass_class, 0);
188
- rbg_define_method(RG_TARGET_NAMESPACE, "set_wmclass_class", attr_set_wmclass_class, 1);
189
- RG_DEF_METHOD(override_redirect, 0);
190
- RG_DEF_METHOD(set_override_redirect, 1);
191
- }
data/ext/gdk3/rbgdkx11.c DELETED
@@ -1,102 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 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
- #ifdef GDK_WINDOWING_X11
24
-
25
- #define RG_TARGET_NAMESPACE mGdkX11
26
-
27
- /* deprecated
28
- static VALUE
29
- rg_s_xid_table_lookup(int argc, VALUE *argv, VALUE self)
30
- {
31
- VALUE arg[2];
32
- GdkPixmap* win = NULL;
33
-
34
- rb_scan_args(argc, argv, "11", &arg[0], &arg[1]);
35
-
36
- switch(argc)
37
- {
38
- case 1:
39
- win = gdk_xid_table_lookup(NUM2UINT(arg[0]));
40
- break;
41
- case 2:
42
- win = gdk_xid_table_lookup_for_display(RVAL2GOBJ(arg[0]), NUM2UINT(arg[1]));
43
- break;
44
- }
45
- if (win == NULL)
46
- return Qnil;
47
- else {
48
- return GOBJ2RVAL(win);
49
- }
50
- }
51
- */
52
-
53
- /* deprecated
54
- static VALUE
55
- rg_s_net_wm_supports_p(VALUE self, VALUE property)
56
- {
57
- return CBOOL2RVAL(gdk_net_wm_supports(RVAL2ATOM(property)));
58
- }
59
- */
60
-
61
- static VALUE
62
- rg_s_default_screen(G_GNUC_UNUSED VALUE self)
63
- {
64
- return INT2NUM(gdk_x11_get_default_screen());
65
- }
66
-
67
- static VALUE
68
- rg_s_grab_server(G_GNUC_UNUSED VALUE self)
69
- {
70
- gdk_x11_grab_server();
71
- return Qnil;
72
- }
73
-
74
- static VALUE
75
- rg_s_ungrab_server(G_GNUC_UNUSED VALUE self)
76
- {
77
- gdk_x11_ungrab_server();
78
- return Qnil;
79
- }
80
- #endif
81
-
82
- void
83
- Init_gdkx11(void)
84
- {
85
- #ifdef GDK_WINDOWING_X11
86
- VALUE RG_TARGET_NAMESPACE = rb_define_module("GdkX11");
87
-
88
- /* deprecated
89
- RG_DEF_SMETHOD(xid_table_lookup, -1);
90
- */
91
- /* deprecated
92
- RG_DEF_SMETHOD_P(net_wm_supports, 1);
93
- */
94
-
95
- RG_DEF_SMETHOD(default_screen, 0);
96
- RG_DEF_SMETHOD(grab_server, 0);
97
-
98
- RG_DEF_SMETHOD(ungrab_server, 0);
99
-
100
- Init_gdkx11_x11window(RG_TARGET_NAMESPACE);
101
- #endif
102
- }
@@ -1,66 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2012 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
- #ifdef GDK_WINDOWING_X11
24
- #define RG_TARGET_NAMESPACE cX11Window
25
- #define _SELF(self) (RVAL2GDKX11WINDOW(self))
26
-
27
- static VALUE
28
- rg_xid(VALUE self)
29
- {
30
- return ULONG2NUM(gdk_x11_window_get_xid(_SELF(self)));
31
- }
32
-
33
- static VALUE
34
- rg_move_to_current_desktop(VALUE self)
35
- {
36
- gdk_x11_window_move_to_current_desktop(_SELF(self));
37
-
38
- return self;
39
- }
40
-
41
- static VALUE
42
- rg_server_time(VALUE self)
43
- {
44
- return UINT2NUM(gdk_x11_get_server_time(_SELF(self)));
45
- }
46
-
47
- static VALUE
48
- rg_set_user_time(VALUE self, VALUE time)
49
- {
50
- gdk_x11_window_set_user_time(_SELF(self), NUM2UINT(time));
51
- return Qnil;
52
- }
53
- #endif
54
-
55
- void
56
- Init_gdkx11_x11window(VALUE mGdkX11)
57
- {
58
- #ifdef GDK_WINDOWING_X11
59
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_X11_WINDOW, "X11Window", mGdkX11);
60
-
61
- RG_DEF_METHOD(xid, 0);
62
- RG_DEF_METHOD(move_to_current_desktop, 0);
63
- RG_DEF_METHOD(server_time, 0);
64
- RG_DEF_METHOD(set_user_time, 1);
65
- #endif
66
- }
data/extconf.rb DELETED
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'pathname'
4
- require 'mkmf'
5
- require 'rbconfig'
6
- require 'fileutils'
7
-
8
- package = "gdk3"
9
-
10
- base_dir = Pathname(__FILE__).dirname.expand_path
11
- ext_dir = base_dir + "ext" + package
12
- mkmf_gnome2_dir = base_dir + 'lib'
13
-
14
- ruby = File.join(RbConfig::CONFIG['bindir'],
15
- RbConfig::CONFIG['ruby_install_name'] +
16
- RbConfig::CONFIG["EXEEXT"])
17
-
18
- build_dir = Pathname("ext") + package
19
- FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
20
- extconf_rb_path = ext_dir + "extconf.rb"
21
- system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
22
-
23
- create_makefile(package)
24
- FileUtils.mv("Makefile", "Makefile.lib")
25
-
26
- File.open("Makefile", "w") do |makefile|
27
- makefile.puts(<<-EOM)
28
- all:
29
- (cd ext/#{package} && $(MAKE))
30
- $(MAKE) -f Makefile.lib
31
-
32
- install:
33
- (cd ext/#{package} && $(MAKE) install)
34
- $(MAKE) -f Makefile.lib install
35
-
36
- site-install:
37
- (cd ext/#{package} && $(MAKE) site-install)
38
- $(MAKE) -f Makefile.lib site-install
39
-
40
- clean:
41
- (cd ext/#{package} && $(MAKE) clean)
42
- $(MAKE) -f Makefile.lib clean
43
-
44
- distclean:
45
- (cd ext/#{package} && $(MAKE) distclean)
46
- $(MAKE) -f Makefile.lib distclean
47
- @rm -f Makefile.lib
48
- EOM
49
- end
data/lib/gdk3/base.rb DELETED
@@ -1,59 +0,0 @@
1
- =begin
2
- Copyright (c) 2006-2011 Ruby-GNOME2 Project Team
3
- This program is licenced under the same licence as Ruby-GNOME2.
4
- =end
5
-
6
- require 'glib2'
7
- require 'pango'
8
- require 'gdk_pixbuf2'
9
-
10
- base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path
11
- vendor_dir = base_dir + "vendor" + "local"
12
- vendor_bin_dir = vendor_dir + "bin"
13
- GLib.prepend_dll_path(vendor_bin_dir)
14
- begin
15
- major, minor, _ = RUBY_VERSION.split(/\./)
16
- require "#{major}.#{minor}/gdk3.so"
17
- rescue LoadError
18
- require "gdk3.so"
19
- end
20
-
21
- if vendor_dir.exist?
22
- begin
23
- require "gobject-introspection"
24
- vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
25
- GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
26
- rescue LoadError
27
- end
28
- end
29
-
30
- module Gdk
31
- LOG_DOMAIN = "Gdk"
32
- end
33
-
34
- if Gdk.cairo_available?
35
- module Cairo
36
- class Context
37
- if method_defined?(:set_source_color)
38
- alias_method :set_source_not_gdk_color, :set_source_color
39
- def set_source_color(color)
40
- if color.is_a?(Gdk::Color)
41
- set_source_gdk_color(color)
42
- else
43
- set_source_not_gdk_color(color)
44
- end
45
- end
46
- else
47
- alias_method :set_source_color, :set_source_gdk_color
48
- end
49
-
50
- def source_color=(color)
51
- set_source_color(color)
52
- color
53
- end
54
- end
55
- end
56
- end
57
-
58
- GLib::Log.set_log_domain(Gdk::LOG_DOMAIN)
59
-