gdk3 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/Rakefile +53 -0
  2. data/ext/gdk3/depend +11 -0
  3. data/ext/gdk3/extconf.rb +127 -0
  4. data/ext/gdk3/gdk3.def +12 -0
  5. data/ext/gdk3/init.c +35 -0
  6. data/ext/gdk3/rbgdk.c +540 -0
  7. data/ext/gdk3/rbgdk3.h +71 -0
  8. data/ext/gdk3/rbgdk3conversions.h +118 -0
  9. data/ext/gdk3/rbgdk3private.h +93 -0
  10. data/ext/gdk3/rbgdkatom.c +122 -0
  11. data/ext/gdk3/rbgdkcairo.c +95 -0
  12. data/ext/gdk3/rbgdkcolor.c +137 -0
  13. data/ext/gdk3/rbgdkconst.c +33 -0
  14. data/ext/gdk3/rbgdkcursor.c +99 -0
  15. data/ext/gdk3/rbgdkdevice.c +197 -0
  16. data/ext/gdk3/rbgdkdisplay.c +482 -0
  17. data/ext/gdk3/rbgdkdisplaymanager.c +55 -0
  18. data/ext/gdk3/rbgdkdragcontext.c +191 -0
  19. data/ext/gdk3/rbgdkdraw.c +520 -0
  20. data/ext/gdk3/rbgdkevent.c +926 -0
  21. data/ext/gdk3/rbgdkgeometry.c +252 -0
  22. data/ext/gdk3/rbgdkkeymap.c +151 -0
  23. data/ext/gdk3/rbgdkkeyval.c +108 -0
  24. data/ext/gdk3/rbgdkpango.c +197 -0
  25. data/ext/gdk3/rbgdkpangorenderer.c +144 -0
  26. data/ext/gdk3/rbgdkpixbuf.c +176 -0
  27. data/ext/gdk3/rbgdkproperty.c +305 -0
  28. data/ext/gdk3/rbgdkrectangle.c +140 -0
  29. data/ext/gdk3/rbgdkrgb.c +199 -0
  30. data/ext/gdk3/rbgdkrgba.c +142 -0
  31. data/ext/gdk3/rbgdkscreen.c +443 -0
  32. data/ext/gdk3/rbgdkselection.c +146 -0
  33. data/ext/gdk3/rbgdkthreads.c +77 -0
  34. data/ext/gdk3/rbgdktimecoord.c +133 -0
  35. data/ext/gdk3/rbgdkvisual.c +251 -0
  36. data/ext/gdk3/rbgdkwindow.c +1044 -0
  37. data/ext/gdk3/rbgdkwindowattr.c +191 -0
  38. data/ext/gdk3/rbgdkx11.c +102 -0
  39. data/ext/gdk3/rbgdkx11x11window.c +66 -0
  40. data/extconf.rb +49 -0
  41. data/lib/gdk3.rb +3 -0
  42. data/lib/gdk3/base.rb +50 -0
  43. data/lib/gdk3/deprecated.rb +152 -0
  44. metadata +156 -0
@@ -0,0 +1,197 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2003,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
+ #include "rbpango.h"
24
+
25
+ #define RG_TARGET_NAMESPACE mPango
26
+
27
+ static VALUE
28
+ rg_s_context(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
29
+ {
30
+ VALUE screen, ret;
31
+ rb_scan_args(argc, argv, "01", &screen);
32
+ if (NIL_P(screen)){
33
+ ret = GOBJ2RVAL(gdk_pango_context_get());
34
+ } else {
35
+ ret = GOBJ2RVAL(gdk_pango_context_get_for_screen(RVAL2GDKSCREEN(screen)));
36
+ }
37
+ return ret;
38
+ }
39
+
40
+ /* deprecated
41
+ static VALUE
42
+ gdkpango_context_set_colormap(VALUE self, VALUE colormap)
43
+ {
44
+ gdk_pango_context_set_colormap(RVAL2PANGOCONTEXT(self),
45
+ RVAL2GDKCOLORMAP(colormap));
46
+ return self;
47
+ }
48
+
49
+ static VALUE
50
+ gdkpango_attr_embossed_initialize(VALUE self, VALUE embossed)
51
+ {
52
+ DATA_PTR(self) = gdk_pango_attr_embossed_new(RVAL2CBOOL(embossed));
53
+ return Qnil;
54
+ }
55
+
56
+ static VALUE
57
+ gdkpango_attr_embossed_value(VALUE self)
58
+ {
59
+ return CBOOL2RVAL(((GdkPangoAttrEmbossed*)RVAL2ATTR(self))->embossed);
60
+ }
61
+ */
62
+
63
+ /* deprecated
64
+ static VALUE
65
+ gdkpango_attr_stipple_initialize(VALUE self, VALUE stipple)
66
+ {
67
+ DATA_PTR(self) = gdk_pango_attr_stipple_new(RVAL2GDKBITMAP(stipple));
68
+ return Qnil;
69
+ }
70
+
71
+ static VALUE
72
+ gdkpango_attr_stipple_value(VALUE self)
73
+ {
74
+ return GOBJ2RVAL(((GdkPangoAttrStipple*)RVAL2ATTR(self))->stipple);
75
+ }
76
+ */
77
+
78
+ static VALUE
79
+ gdkpango_layout_get_clip_region(VALUE self, VALUE rbx_origin, VALUE rby_origin, VALUE rbindex_ranges)
80
+ {
81
+ PangoLayout *layout = RVAL2PANGOLAYOUT(self);
82
+ gint x_origin = NUM2INT(rbx_origin);
83
+ gint y_origin = NUM2INT(rby_origin);
84
+ long n;
85
+ gint *index_ranges = RVAL2GINTS(rbindex_ranges, n);
86
+ cairo_region_t *result;
87
+
88
+ if (n % 2 != 0) {
89
+ g_free(index_ranges);
90
+
91
+ rb_raise(rb_eArgError,
92
+ "an even number of byte indexes must be given");
93
+ }
94
+
95
+ result = gdk_pango_layout_get_clip_region(layout, x_origin, y_origin, index_ranges, n / 2);
96
+
97
+ g_free(index_ranges);
98
+
99
+ return CRREGION2RVAL(result);
100
+ }
101
+
102
+ static VALUE
103
+ gdkpango_layout_line_get_clip_region(VALUE self, VALUE rbx_origin, VALUE rby_origin, VALUE rbindex_ranges)
104
+ {
105
+ PangoLayoutLine *line = RVAL2PANGOLAYOUTLINE(self);
106
+ gint x_origin = NUM2INT(rbx_origin);
107
+ gint y_origin = NUM2INT(rby_origin);
108
+ long n;
109
+ gint *index_ranges = RVAL2GINTS(rbindex_ranges, n);
110
+ cairo_region_t *result;
111
+
112
+ if (n % 2 != 0) {
113
+ g_free(index_ranges);
114
+
115
+ rb_raise(rb_eArgError,
116
+ "an even number of byte indexes must be given");
117
+ }
118
+
119
+ result = gdk_pango_layout_line_get_clip_region(line, x_origin, y_origin, index_ranges, n / 2);
120
+
121
+ g_free(index_ranges);
122
+
123
+ return CRREGION2RVAL(result);
124
+ }
125
+
126
+ /* deprecated
127
+ static VALUE
128
+ gdkpango_attr_emboss_color_initialize(VALUE self, VALUE color)
129
+ {
130
+ DATA_PTR(self) = gdk_pango_attr_emboss_color_new(RVAL2GDKCOLOR(color));
131
+ return Qnil;
132
+ }
133
+
134
+ static VALUE
135
+ gdkpango_attr_emboss_color_value(VALUE self)
136
+ {
137
+ return PANGOCOLOR2RVAL(&(((GdkPangoAttrEmbossColor *)RVAL2ATTR(self))->color));
138
+ }
139
+ */
140
+
141
+ void
142
+ Init_gdk_pango(VALUE mGdk)
143
+ {
144
+ /* deprecated
145
+ VALUE klass;
146
+ PangoAttribute* tmpattr;
147
+ GdkColor color;
148
+ */
149
+
150
+ VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Pango");
151
+ /* deprecated
152
+ VALUE context = GTYPE2CLASS(PANGO_TYPE_CONTEXT);
153
+ */
154
+ VALUE layout = GTYPE2CLASS(PANGO_TYPE_LAYOUT);
155
+ VALUE layoutline = GTYPE2CLASS(PANGO_TYPE_LAYOUT_LINE);
156
+ /* deprecated
157
+ VALUE pattr = ATTRTYPE2CLASS(CSTR2RVAL("Attribute"));
158
+ VALUE pattrbool = ATTRTYPE2CLASS(CSTR2RVAL("AttrBool"));
159
+ VALUE pattr_color = ATTRTYPE2CLASS(CSTR2RVAL("AttrColor"));
160
+ */
161
+
162
+ RG_DEF_SMETHOD(context, -1);
163
+
164
+ /* deprecated
165
+ rbg_define_method(context, "set_colormap", gdkpango_context_set_colormap, 1);
166
+ */
167
+ rbg_define_method(layout, "get_clip_region", gdkpango_layout_get_clip_region, 3);
168
+ rbg_define_method(layoutline, "get_clip_region", gdkpango_layout_line_get_clip_region, 3);
169
+
170
+ /* deprecated
171
+ klass = rb_define_class_under(mGdk, "PangoAttrEmbossed", pattrbool);
172
+ rbg_define_method(klass, "initialize", gdkpango_attr_embossed_initialize, 1);
173
+ tmpattr = gdk_pango_attr_embossed_new(TRUE);
174
+ rbg_define_method(klass, "value", gdkpango_attr_embossed_value, 0);
175
+ RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass);
176
+ pango_attribute_destroy(tmpattr);
177
+ */
178
+
179
+ /* deprecated
180
+ klass = rb_define_class_under(mGdk, "PangoAttrStipple", pattr);
181
+ rbg_define_method(klass, "initialize", gdkpango_attr_stipple_initialize, 1);
182
+ rbg_define_method(klass, "value", gdkpango_attr_stipple_value, 0);
183
+ tmpattr = gdk_pango_attr_stipple_new(NULL);
184
+ RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass);
185
+ pango_attribute_destroy(tmpattr);
186
+ */
187
+
188
+ /* deprecated
189
+ klass = rb_define_class_under(mGdk, "PangoAttrEmbossColor", pattr_color);
190
+ rbg_define_method(klass, "initialize",
191
+ gdkpango_attr_emboss_color_initialize, 1);
192
+ rbg_define_method(klass, "value", gdkpango_attr_emboss_color_value, 0);
193
+ tmpattr = gdk_pango_attr_emboss_color_new(&color);
194
+ RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass);
195
+ pango_attribute_destroy(tmpattr);
196
+ */
197
+ }
@@ -0,0 +1,144 @@
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
+ /* deprecated
23
+ #include "rbgdk3private.h"
24
+
25
+ #define RG_TARGET_NAMESPACE cPangoRenderer
26
+ #define _SELF(s) (RVAL2GDKPANGORENDERER(s))
27
+
28
+ static VALUE
29
+ rg_initialize(int argc, VALUE *argv, VALUE self)
30
+ {
31
+ VALUE screen;
32
+ GdkScreen* gscreen;
33
+
34
+ rb_scan_args(argc, argv, "01", &screen);
35
+
36
+ if (NIL_P(screen)){
37
+ gscreen = gdk_screen_get_default();
38
+ } else {
39
+ gscreen = RVAL2GDKSCREEN(screen);
40
+ }
41
+
42
+ G_INITIALIZE(self, gdk_pango_renderer_new(gscreen));
43
+
44
+ return Qnil;
45
+ }
46
+
47
+ static VALUE
48
+ rg_s_get_default(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
49
+ {
50
+ VALUE screen;
51
+ GdkScreen* gscreen;
52
+
53
+ rb_scan_args(argc, argv, "01", &screen);
54
+
55
+ if (NIL_P(screen)){
56
+ gscreen = gdk_screen_get_default();
57
+ } else {
58
+ gscreen = RVAL2GDKSCREEN(screen);
59
+ }
60
+ return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen));
61
+ }
62
+
63
+ static VALUE
64
+ rg_s_default(G_GNUC_UNUSED VALUE self)
65
+ {
66
+ GdkScreen* gscreen = gdk_screen_get_default();
67
+ return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen));
68
+ }
69
+
70
+ static VALUE
71
+ rg_set_drawable(VALUE self, VALUE drawable)
72
+ {
73
+ gdk_pango_renderer_set_drawable(_SELF(self),
74
+ RVAL2GDKDRAWABLE(drawable));
75
+ return self;
76
+ }
77
+
78
+ static VALUE
79
+ rg_set_gc(VALUE self, VALUE gc)
80
+ {
81
+ gdk_pango_renderer_set_gc(_SELF(self),
82
+ NIL_P(gc) ? NULL : RVAL2GDKGC(gc));
83
+ return self;
84
+ }
85
+
86
+ #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
87
+ static VALUE
88
+ rg_set_stipple(VALUE self, VALUE part, VALUE stipple)
89
+ {
90
+ gdk_pango_renderer_set_stipple(_SELF(self), RVAL2PANGORENDERPART(part),
91
+ NIL_P(stipple) ? NULL : RVAL2GDKBITMAP(stipple));
92
+
93
+ return self;
94
+ }
95
+ #else
96
+ static VALUE
97
+ prenderer_set_stipple(G_GNUC_UNUSED VALUE self,
98
+ G_GNUC_UNUSED VALUE part,
99
+ G_GNUC_UNUSED VALUE stipple)
100
+ {
101
+ rb_warning("Gdk::PangoRender#set_tipple is not supported (Require pango-1.8.1 or later");
102
+
103
+ return self;
104
+ }
105
+ #endif
106
+
107
+ #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
108
+ static VALUE
109
+ rg_set_override_color(VALUE self, VALUE part, VALUE color)
110
+ {
111
+ gdk_pango_renderer_set_override_color(_SELF(self),
112
+ RVAL2PANGORENDERPART(part),
113
+ RVAL2GDKCOLOR(color));
114
+
115
+ return self;
116
+ }
117
+ #else
118
+ static VALUE
119
+ prenderer_set_override_color(G_GNUC_UNUSED VALUE self,
120
+ G_GNUC_UNUSED VALUE part,
121
+ G_GNUC_UNUSED VALUE color)
122
+ {
123
+ rb_warning("Gdk::PangoRender#set_override_color is not supported (Require pango-1.8.1 or later");
124
+
125
+ return self;
126
+ }
127
+ #endif
128
+
129
+ void
130
+ Init_gdk_pangorenderer(VALUE mGdk)
131
+ {
132
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PANGO_RENDERER, "PangoRenderer", mGdk);
133
+
134
+ RG_DEF_METHOD(initialize, -1);
135
+ RG_DEF_METHOD(set_drawable, 1);
136
+ RG_DEF_METHOD(set_gc, 1);
137
+ RG_DEF_METHOD(set_stipple, 2);
138
+ RG_DEF_METHOD(set_override_color, 2);
139
+
140
+ RG_DEF_SMETHOD(get_default, -1);
141
+ RG_DEF_SMETHOD(default, 0);
142
+ }
143
+ */
144
+
@@ -0,0 +1,176 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,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
+ #define RG_TARGET_NAMESPACE cPixbuf
25
+ #define _SELF(s) RVAL2GDKPIXBUF(s)
26
+
27
+ /* deprecated
28
+ static VALUE
29
+ rg_render_threshold_alpha(VALUE self, VALUE bitmap, VALUE src_x, VALUE src_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height, VALUE alpha_threshold)
30
+ {
31
+ gdk_pixbuf_render_threshold_alpha(_SELF(self), RVAL2GDKBITMAP(bitmap),
32
+ NUM2INT(src_x), NUM2INT(src_y),
33
+ NUM2INT(dest_x), NUM2INT(dest_y),
34
+ NUM2INT(width), NUM2INT(height),
35
+ NUM2INT(alpha_threshold));
36
+ return self;
37
+ }
38
+
39
+ static VALUE
40
+ rg_render_to_drawable(int argc, VALUE *argv, VALUE self)
41
+ {
42
+ VALUE gc, src_x, src_y, dest_x, dest_y, width, height,
43
+ dither, x_dither, y_dither;
44
+
45
+ rb_warn("Gdk::Pixbuf#render_to_drawable is obsolete. Use Gdk::Drawable#draw_pixbuf instead.");
46
+
47
+ rb_scan_args(argc, argv, "73", &gc, &src_x, &src_y, &dest_x, &dest_y,
48
+ &width, &height, &dither, &x_dither, &y_dither);
49
+
50
+ if (NIL_P(gc))
51
+ rb_raise(rb_eArgError, "arguments 1 must be non nil");
52
+ if (NIL_P(src_x))
53
+ rb_raise(rb_eArgError, "arguments 2 must be non nil");
54
+ if (NIL_P(src_y))
55
+ rb_raise(rb_eArgError, "arguments 3 must be non nil");
56
+ if (NIL_P(dest_x))
57
+ rb_raise(rb_eArgError, "arguments 4 must be non nil");
58
+ if (NIL_P(dest_y))
59
+ rb_raise(rb_eArgError, "arguments 5 must be non nil");
60
+ if (NIL_P(width))
61
+ rb_raise(rb_eArgError, "arguments 6 must be non nil");
62
+ if (NIL_P(height))
63
+ rb_raise(rb_eArgError, "arguments 7 must be non nil");
64
+
65
+ gdk_pixbuf_render_to_drawable(_SELF(self),
66
+ RVAL2GDKDRAWABLE(self),
67
+ RVAL2GDKGC(gc),
68
+ NUM2INT(src_x), NUM2INT(src_y),
69
+ NUM2INT(dest_x), NUM2INT(dest_y),
70
+ NUM2INT(width), NUM2INT(height),
71
+ NIL_P(dither) ? GDK_RGB_DITHER_NONE : RVAL2GDKRGBDITHER(dither),
72
+ NIL_P(x_dither) ? 0 : NUM2INT(x_dither),
73
+ NIL_P(y_dither) ? 0 : NUM2INT(y_dither));
74
+ return self;
75
+ }
76
+
77
+ static VALUE
78
+ rg_render_pixmap_and_mask(int argc, VALUE *argv, VALUE self)
79
+ {
80
+ VALUE colormap_or_alpha, alpha;
81
+ GdkPixmap *pixmap;
82
+ GdkBitmap *mask;
83
+
84
+ rb_scan_args(argc, argv, "11", &colormap_or_alpha, &alpha);
85
+
86
+ if (rb_obj_is_kind_of(colormap_or_alpha, GTYPE2CLASS(GDK_TYPE_COLORMAP))){
87
+ gdk_pixbuf_render_pixmap_and_mask_for_colormap(_SELF(self),
88
+ RVAL2GOBJ(colormap_or_alpha),
89
+ &pixmap,
90
+ &mask,
91
+ NIL_P(alpha)?0:NUM2INT(alpha));
92
+ } else {
93
+ gdk_pixbuf_render_pixmap_and_mask(_SELF(self),
94
+ &pixmap,
95
+ &mask,
96
+ NIL_P(colormap_or_alpha)?
97
+ 0:NUM2INT(colormap_or_alpha));
98
+ }
99
+
100
+ return rb_ary_new3(2,
101
+ pixmap ? GOBJ2RVAL(pixmap) : Qnil,
102
+ mask ? GOBJ2RVAL(mask) : Qnil);
103
+ }
104
+
105
+ static VALUE
106
+ rg_s_from_drawable(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
107
+ {
108
+ VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y;
109
+ GdkPixbuf* buf;
110
+
111
+ rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height,
112
+ &dest, &dest_x, &dest_y);
113
+
114
+ buf = gdk_pixbuf_get_from_drawable(RVAL2GDKPIXBUF(dest),
115
+ RVAL2GDKDRAWABLE(src),
116
+ RVAL2GDKCOLORMAP(cmap),
117
+ NUM2INT(src_x), NUM2INT(src_y),
118
+ NIL_P(dest_x) ? 0 : NUM2INT(dest_x),
119
+ NIL_P(dest_y) ? 0 : NUM2INT(dest_y),
120
+ NUM2INT(width), NUM2INT(height));
121
+ if (NIL_P(dest)) {
122
+ if (buf) {
123
+ return GOBJ2RVALU(buf);
124
+ } else {
125
+ return Qnil;
126
+ }
127
+ } else {
128
+ return dest;
129
+ }
130
+ }
131
+
132
+ static VALUE
133
+ rg_s_from_image(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
134
+ {
135
+ VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y;
136
+ GdkPixbuf* buf;
137
+
138
+ rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height,
139
+ &dest, &dest_x, &dest_y);
140
+
141
+ buf = gdk_pixbuf_get_from_image(RVAL2GDKPIXBUF(dest),
142
+ RVAL2GDKIMAGE(src),
143
+ RVAL2GDKCOLORMAP(cmap),
144
+ NUM2INT(src_x), NUM2INT(src_y),
145
+ NIL_P(dest_x) ? 0 : NUM2INT(dest_x),
146
+ NIL_P(dest_y) ? 0 : NUM2INT(dest_y),
147
+ NUM2INT(width), NUM2INT(height));
148
+ if (NIL_P(dest)) {
149
+ if (buf) {
150
+ return GOBJ2RVAL(buf);
151
+ } else {
152
+ return Qnil;
153
+ }
154
+ } else {
155
+ return dest;
156
+ }
157
+ }
158
+ */
159
+
160
+ void
161
+ Init_gdk_pixbuf(VALUE mGdk)
162
+ {
163
+ /*
164
+ * This defines Gdk::Pixbuf methods of GDK side.
165
+ */
166
+ VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_PIXBUF);
167
+
168
+ /* deprecated
169
+ RG_DEF_METHOD(render_threshold_alpha, 8);
170
+ RG_DEF_METHOD(render_to_drawable, -1);
171
+ RG_DEF_METHOD(render_pixmap_and_mask, -1);
172
+
173
+ RG_DEF_SMETHOD(from_drawable, -1);
174
+ RG_DEF_SMETHOD(from_image, -1);
175
+ */
176
+ }