gtk2 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +66 -1
- data/ext/gtk2/extconf.rb +0 -96
- data/ext/gtk2/global.h +274 -13
- data/ext/gtk2/gtk2.def +5 -3
- data/ext/gtk2/init.c +263 -19
- data/ext/gtk2/rbgdk.c +245 -89
- data/ext/gtk2/rbgdk.h +32 -6
- data/ext/gtk2/rbgdkatom.c +38 -28
- data/ext/gtk2/rbgdkcairo.c +32 -42
- data/ext/gtk2/rbgdkcolor.c +52 -42
- data/ext/gtk2/rbgdkcolormap.c +42 -37
- data/ext/gtk2/rbgdkconst.c +23 -13
- data/ext/gtk2/rbgdkconversions.h +19 -6
- data/ext/gtk2/rbgdkcursor.c +37 -25
- data/ext/gtk2/rbgdkdevice.c +77 -67
- data/ext/gtk2/rbgdkdisplay.c +158 -150
- data/ext/gtk2/rbgdkdisplaymanager.c +27 -15
- data/ext/gtk2/rbgdkdragcontext.c +121 -70
- data/ext/gtk2/rbgdkdraw.c +252 -160
- data/ext/gtk2/rbgdkevent.c +30 -20
- data/ext/gtk2/rbgdkgc.c +123 -116
- data/ext/gtk2/rbgdkgeometry.c +77 -68
- data/ext/gtk2/rbgdkimage.c +58 -47
- data/ext/gtk2/rbgdkinput.c +33 -26
- data/ext/gtk2/rbgdkkeymap.c +38 -27
- data/ext/gtk2/rbgdkkeyval.c +44 -32
- data/ext/gtk2/rbgdkpango.c +66 -39
- data/ext/gtk2/rbgdkpangorenderer.c +63 -35
- data/ext/gtk2/rbgdkpixbuf.c +36 -25
- data/ext/gtk2/rbgdkpixmap.c +65 -49
- data/ext/gtk2/rbgdkproperty.c +66 -60
- data/ext/gtk2/rbgdkrectangle.c +54 -46
- data/ext/gtk2/rbgdkregion.c +144 -79
- data/ext/gtk2/rbgdkrgb.c +74 -58
- data/ext/gtk2/rbgdkscreen.c +103 -97
- data/ext/gtk2/rbgdkselection.c +49 -39
- data/ext/gtk2/rbgdkthreads.c +32 -19
- data/ext/gtk2/rbgdktimecoord.c +60 -38
- data/ext/gtk2/rbgdkvisual.c +79 -71
- data/ext/gtk2/rbgdkwindow.c +284 -305
- data/ext/gtk2/rbgdkwindowattr.c +69 -58
- data/ext/gtk2/rbgdkx11.c +41 -28
- data/ext/gtk2/rbgtk.c +498 -19
- data/ext/gtk2/rbgtk.h +35 -20
- data/ext/gtk2/rbgtkaboutdialog.c +33 -80
- data/ext/gtk2/rbgtkaccelerator.c +36 -23
- data/ext/gtk2/rbgtkaccelgroup.c +50 -40
- data/ext/gtk2/rbgtkaccelgroupentry.c +32 -20
- data/ext/gtk2/rbgtkaccelkey.c +40 -28
- data/ext/gtk2/rbgtkaccellabel.c +30 -18
- data/ext/gtk2/rbgtkaccelmap.c +55 -42
- data/ext/gtk2/rbgtkaccessible.c +25 -14
- data/ext/gtk2/rbgtkaction.c +68 -68
- data/ext/gtk2/rbgtkactiongroup.c +317 -195
- data/ext/gtk2/rbgtkadjustment.c +33 -46
- data/ext/gtk2/rbgtkalignment.c +36 -24
- data/ext/gtk2/rbgtkallocation.c +53 -42
- data/ext/gtk2/rbgtkarrow.c +34 -22
- data/ext/gtk2/rbgtkaspectframe.c +32 -20
- data/ext/gtk2/rbgtkassistant.c +81 -61
- data/ext/gtk2/rbgtkbbox.c +32 -20
- data/ext/gtk2/rbgtkbin.c +28 -16
- data/ext/gtk2/rbgtkbindingset.c +42 -35
- data/ext/gtk2/rbgtkborder.c +34 -23
- data/ext/gtk2/rbgtkbox.c +40 -29
- data/ext/gtk2/rbgtkbuildable.c +57 -45
- data/ext/gtk2/rbgtkbuilder.c +53 -38
- data/ext/gtk2/rbgtkbutton.c +41 -55
- data/ext/gtk2/rbgtkcalendar.c +51 -40
- data/ext/gtk2/rbgtkcelleditable.c +28 -17
- data/ext/gtk2/rbgtkcelllayout.c +41 -30
- data/ext/gtk2/rbgtkcellrenderer.c +43 -32
- data/ext/gtk2/rbgtkcellrendereraccel.c +26 -18
- data/ext/gtk2/rbgtkcellrenderercombo.c +25 -17
- data/ext/gtk2/rbgtkcellrendererpixbuf.c +24 -17
- data/ext/gtk2/rbgtkcellrendererprogress.c +25 -17
- data/ext/gtk2/rbgtkcellrendererspin.c +24 -16
- data/ext/gtk2/rbgtkcellrendererspinner.c +23 -11
- data/ext/gtk2/rbgtkcellrenderertext.c +28 -21
- data/ext/gtk2/rbgtkcellrenderertoggle.c +24 -16
- data/ext/gtk2/rbgtkcellview.c +34 -33
- data/ext/gtk2/rbgtkcheckbutton.c +28 -16
- data/ext/gtk2/rbgtkcheckmenuitem.c +31 -19
- data/ext/gtk2/rbgtkclipboard.c +123 -77
- data/ext/gtk2/rbgtkcolorbutton.c +26 -31
- data/ext/gtk2/rbgtkcolorsel.c +109 -55
- data/ext/gtk2/rbgtkcolorselectiondialog.c +28 -19
- data/ext/gtk2/rbgtkcombo.c +43 -32
- data/ext/gtk2/rbgtkcombobox.c +44 -83
- data/ext/gtk2/rbgtkcomboboxentry.c +26 -21
- data/ext/gtk2/rbgtkconst.c +23 -13
- data/ext/gtk2/rbgtkcontainer.c +153 -100
- data/ext/gtk2/rbgtkconversions.h +19 -6
- data/ext/gtk2/rbgtkcurve.c +46 -36
- data/ext/gtk2/rbgtkdialog.c +104 -70
- data/ext/gtk2/rbgtkdrag.c +173 -121
- data/ext/gtk2/rbgtkdrawingarea.c +28 -16
- data/ext/gtk2/rbgtkeditable.c +63 -51
- data/ext/gtk2/rbgtkentry.c +48 -85
- data/ext/gtk2/rbgtkentrycompletion.c +42 -55
- data/ext/gtk2/rbgtkeventbox.c +28 -16
- data/ext/gtk2/rbgtkexpander.c +26 -35
- data/ext/gtk2/rbgtkfilechooser.c +87 -143
- data/ext/gtk2/rbgtkfilechooserbutton.c +26 -32
- data/ext/gtk2/rbgtkfilechooserdialog.c +25 -15
- data/ext/gtk2/rbgtkfilechooserwidget.c +26 -15
- data/ext/gtk2/rbgtkfilefilter.c +45 -35
- data/ext/gtk2/rbgtkfilesel.c +54 -43
- data/ext/gtk2/rbgtkfilesystemerror.c +51 -0
- data/ext/gtk2/rbgtkfixed.c +36 -25
- data/ext/gtk2/rbgtkfontbutton.c +26 -37
- data/ext/gtk2/rbgtkfontselection.c +27 -15
- data/ext/gtk2/rbgtkfontselectiondialog.c +43 -32
- data/ext/gtk2/rbgtkframe.c +39 -28
- data/ext/gtk2/rbgtkgamma.c +32 -20
- data/ext/gtk2/rbgtkhandlebox.c +31 -19
- data/ext/gtk2/rbgtkhbbox.c +28 -16
- data/ext/gtk2/rbgtkhbox.c +29 -17
- data/ext/gtk2/rbgtkhpaned.c +28 -16
- data/ext/gtk2/rbgtkhruler.c +28 -16
- data/ext/gtk2/rbgtkhscale.c +28 -16
- data/ext/gtk2/rbgtkhscrollbar.c +28 -16
- data/ext/gtk2/rbgtkhseparator.c +28 -16
- data/ext/gtk2/rbgtkiconfactory.c +35 -23
- data/ext/gtk2/rbgtkiconinfo.c +42 -30
- data/ext/gtk2/rbgtkiconset.c +31 -19
- data/ext/gtk2/rbgtkiconsize.c +38 -25
- data/ext/gtk2/rbgtkiconsource.c +62 -50
- data/ext/gtk2/rbgtkicontheme.c +95 -95
- data/ext/gtk2/rbgtkiconview.c +87 -121
- data/ext/gtk2/rbgtkimage.c +31 -40
- data/ext/gtk2/rbgtkimagemenuitem.c +26 -14
- data/ext/gtk2/rbgtkimcontext.c +46 -34
- data/ext/gtk2/rbgtkimcontextsimple.c +47 -24
- data/ext/gtk2/rbgtkimmulticontext.c +26 -14
- data/ext/gtk2/rbgtkinputdialog.c +28 -16
- data/ext/gtk2/rbgtkinvisible.c +24 -18
- data/ext/gtk2/rbgtkitem.c +32 -20
- data/ext/gtk2/rbgtkitemfactory.c +65 -57
- data/ext/gtk2/rbgtklabel.c +46 -57
- data/ext/gtk2/rbgtklayout.c +40 -29
- data/ext/gtk2/rbgtklinkbutton.c +26 -15
- data/ext/gtk2/rbgtkliststore.c +145 -102
- data/ext/gtk2/rbgtkmacros.h +19 -6
- data/ext/gtk2/rbgtkmenu.c +47 -59
- data/ext/gtk2/rbgtkmenubar.c +30 -30
- data/ext/gtk2/rbgtkmenuitem.c +34 -41
- data/ext/gtk2/rbgtkmenushell.c +43 -42
- data/ext/gtk2/rbgtkmenutoolbutton.c +27 -16
- data/ext/gtk2/rbgtkmessagedialog.c +31 -25
- data/ext/gtk2/rbgtkmisc.c +33 -22
- data/ext/gtk2/rbgtknotebook.c +98 -134
- data/ext/gtk2/rbgtkobject.c +46 -81
- data/ext/gtk2/rbgtkoptionmenu.c +35 -23
- data/ext/gtk2/rbgtkpagesetup.c +64 -54
- data/ext/gtk2/rbgtkpagesetupunixdialog.c +34 -27
- data/ext/gtk2/rbgtkpaned.c +46 -36
- data/ext/gtk2/rbgtkpapersize.c +60 -54
- data/ext/gtk2/rbgtkplug.c +32 -20
- data/ext/gtk2/rbgtkprintcontext.c +43 -35
- data/ext/gtk2/rbgtkprinter.c +36 -37
- data/ext/gtk2/rbgtkprintjob.c +36 -37
- data/ext/gtk2/rbgtkprintoperation.c +44 -33
- data/ext/gtk2/rbgtkprintoperationpreview.c +30 -18
- data/ext/gtk2/rbgtkprintsettings.c +248 -192
- data/ext/gtk2/rbgtkprintunixdialog.c +33 -45
- data/ext/gtk2/rbgtkprogress.c +23 -13
- data/ext/gtk2/rbgtkprogressbar.c +47 -46
- data/ext/gtk2/rbgtkradioaction.c +84 -39
- data/ext/gtk2/rbgtkradiobutton.c +33 -21
- data/ext/gtk2/rbgtkradiomenuitem.c +86 -45
- data/ext/gtk2/rbgtkradiotoolbutton.c +99 -53
- data/ext/gtk2/rbgtkrange.c +36 -56
- data/ext/gtk2/rbgtkrc.c +61 -49
- data/ext/gtk2/rbgtkrcstyle.c +59 -48
- data/ext/gtk2/rbgtkrecentaction.c +28 -16
- data/ext/gtk2/rbgtkrecentchooser.c +58 -92
- data/ext/gtk2/rbgtkrecentchooserdialog.c +29 -18
- data/ext/gtk2/rbgtkrecentchoosermenu.c +25 -21
- data/ext/gtk2/rbgtkrecentchooserwidget.c +24 -13
- data/ext/gtk2/rbgtkrecentdata.c +47 -36
- data/ext/gtk2/rbgtkrecentfilter.c +55 -46
- data/ext/gtk2/rbgtkrecentfilterinfo.c +51 -40
- data/ext/gtk2/rbgtkrecentinfo.c +66 -56
- data/ext/gtk2/rbgtkrecentmanager.c +47 -43
- data/ext/gtk2/rbgtkruler.c +35 -30
- data/ext/gtk2/rbgtkscale.c +29 -18
- data/ext/gtk2/rbgtkscalebutton.c +27 -27
- data/ext/gtk2/rbgtkscrollbar.c +23 -13
- data/ext/gtk2/rbgtkscrolledwindow.c +44 -60
- data/ext/gtk2/rbgtkselection.c +87 -67
- data/ext/gtk2/rbgtkselectiondata.c +74 -65
- data/ext/gtk2/rbgtkseparator.c +23 -13
- data/ext/gtk2/rbgtkseparatormenuitem.c +25 -13
- data/ext/gtk2/rbgtkseparatortoolitem.c +26 -21
- data/ext/gtk2/rbgtksettings.c +123 -103
- data/ext/gtk2/rbgtksizegroup.c +33 -30
- data/ext/gtk2/rbgtksocket.c +32 -20
- data/ext/gtk2/rbgtkspinbutton.c +48 -38
- data/ext/gtk2/rbgtkspinner.c +27 -14
- data/ext/gtk2/rbgtkstatusbar.c +36 -31
- data/ext/gtk2/rbgtkstatusicon.c +31 -44
- data/ext/gtk2/rbgtkstock.c +137 -125
- data/ext/gtk2/rbgtkstyle.c +177 -161
- data/ext/gtk2/rbgtktable.c +58 -47
- data/ext/gtk2/rbgtktargetlist.c +56 -36
- data/ext/gtk2/rbgtktearoffmenuitem.c +28 -16
- data/ext/gtk2/rbgtktextappearance.c +44 -34
- data/ext/gtk2/rbgtktextattributes.c +54 -42
- data/ext/gtk2/rbgtktextbuffer.c +188 -191
- data/ext/gtk2/rbgtktextchild.c +29 -18
- data/ext/gtk2/rbgtktextiter.c +153 -145
- data/ext/gtk2/rbgtktextmark.c +33 -30
- data/ext/gtk2/rbgtktexttag.c +34 -22
- data/ext/gtk2/rbgtktexttagtable.c +36 -25
- data/ext/gtk2/rbgtktextview.c +85 -73
- data/ext/gtk2/rbgtktoggleaction.c +27 -22
- data/ext/gtk2/rbgtktogglebutton.c +37 -26
- data/ext/gtk2/rbgtktoggletoolbutton.c +26 -20
- data/ext/gtk2/rbgtktoolbar.c +66 -69
- data/ext/gtk2/rbgtktoolbutton.c +27 -40
- data/ext/gtk2/rbgtktoolitem.c +60 -62
- data/ext/gtk2/rbgtktooltip.c +36 -25
- data/ext/gtk2/rbgtktooltips.c +42 -34
- data/ext/gtk2/rbgtktreedragdest.c +20 -11
- data/ext/gtk2/rbgtktreedragsource.c +20 -11
- data/ext/gtk2/rbgtktreeiter.c +58 -47
- data/ext/gtk2/rbgtktreemodel.c +83 -65
- data/ext/gtk2/rbgtktreemodelfilter.c +47 -35
- data/ext/gtk2/rbgtktreemodelsort.c +38 -27
- data/ext/gtk2/rbgtktreepath.c +55 -44
- data/ext/gtk2/rbgtktreerowreference.c +60 -42
- data/ext/gtk2/rbgtktreeselection.c +61 -52
- data/ext/gtk2/rbgtktreesortable.c +52 -42
- data/ext/gtk2/rbgtktreestore.c +88 -67
- data/ext/gtk2/rbgtktreeview.c +157 -185
- data/ext/gtk2/rbgtktreeviewcolumn.c +57 -62
- data/ext/gtk2/rbgtkuimanager.c +61 -61
- data/ext/gtk2/rbgtkvbbox.c +28 -16
- data/ext/gtk2/rbgtkvbox.c +29 -17
- data/ext/gtk2/rbgtkviewport.c +28 -16
- data/ext/gtk2/rbgtkvolumebutton.c +28 -16
- data/ext/gtk2/rbgtkvpaned.c +28 -16
- data/ext/gtk2/rbgtkvruler.c +28 -16
- data/ext/gtk2/rbgtkvscale.c +28 -16
- data/ext/gtk2/rbgtkvscrollbar.c +28 -16
- data/ext/gtk2/rbgtkvseparator.c +28 -16
- data/ext/gtk2/rbgtkwidget.c +284 -296
- data/ext/gtk2/rbgtkwindow.c +156 -214
- data/ext/gtk2/rbgtkwindowgroup.c +35 -24
- data/sample/testgtk/labels.rb +1 -0
- data/sample/testgtk/testgtk.rb +2 -0
- metadata +16 -17
- data/ChangeLog +0 -6902
- data/ext/gtk2/rbgtkmain.c +0 -493
@@ -1,22 +1,33 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
+
*/
|
11
21
|
|
12
22
|
#include "global.h"
|
13
23
|
|
14
24
|
#if GTK_CHECK_VERSION(2,6,0)
|
15
25
|
|
26
|
+
#define RG_TARGET_NAMESPACE cPangoRenderer
|
16
27
|
#define _SELF(s) (GDK_PANGO_RENDERER(RVAL2GOBJ(s)))
|
17
28
|
|
18
29
|
static VALUE
|
19
|
-
|
30
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
20
31
|
{
|
21
32
|
VALUE screen;
|
22
33
|
GdkScreen* gscreen;
|
@@ -35,7 +46,7 @@ prenderer_initialize(int argc, VALUE *argv, VALUE self)
|
|
35
46
|
}
|
36
47
|
|
37
48
|
static VALUE
|
38
|
-
|
49
|
+
rg_s_get_default(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
39
50
|
{
|
40
51
|
VALUE screen;
|
41
52
|
GdkScreen* gscreen;
|
@@ -51,14 +62,14 @@ prenderer_s_get_default(int argc, VALUE *argv, VALUE self)
|
|
51
62
|
}
|
52
63
|
|
53
64
|
static VALUE
|
54
|
-
|
65
|
+
rg_s_default(G_GNUC_UNUSED VALUE self)
|
55
66
|
{
|
56
67
|
GdkScreen* gscreen = gdk_screen_get_default();
|
57
68
|
return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen));
|
58
69
|
}
|
59
70
|
|
60
71
|
static VALUE
|
61
|
-
|
72
|
+
rg_set_drawable(VALUE self, VALUE drawable)
|
62
73
|
{
|
63
74
|
gdk_pango_renderer_set_drawable(_SELF(self),
|
64
75
|
GDK_DRAWABLE(RVAL2GOBJ(drawable)));
|
@@ -66,56 +77,73 @@ prenderer_set_drawable(VALUE self, VALUE drawable)
|
|
66
77
|
}
|
67
78
|
|
68
79
|
static VALUE
|
69
|
-
|
80
|
+
rg_set_gc(VALUE self, VALUE gc)
|
70
81
|
{
|
71
82
|
gdk_pango_renderer_set_gc(_SELF(self),
|
72
83
|
NIL_P(gc) ? NULL : GDK_GC(RVAL2GOBJ(gc)));
|
73
84
|
return self;
|
74
85
|
}
|
75
86
|
|
87
|
+
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
|
76
88
|
static VALUE
|
77
|
-
|
89
|
+
rg_set_stipple(VALUE self, VALUE part, VALUE stipple)
|
78
90
|
{
|
79
|
-
#if HAVE_PANGO_RENDER_PART_GET_TYPE
|
80
91
|
gdk_pango_renderer_set_stipple(_SELF(self), RVAL2GENUM(part, PANGO_TYPE_RENDER_PART),
|
81
92
|
NIL_P(stipple) ? NULL : GDK_BITMAP(RVAL2GOBJ(stipple)));
|
93
|
+
|
94
|
+
return self;
|
95
|
+
}
|
82
96
|
#else
|
83
|
-
|
84
|
-
|
97
|
+
static VALUE
|
98
|
+
prenderer_set_stipple(G_GNUC_UNUSED VALUE self,
|
99
|
+
G_GNUC_UNUSED VALUE part,
|
100
|
+
G_GNUC_UNUSED VALUE stipple)
|
101
|
+
{
|
102
|
+
rb_warning("Gdk::PangoRender#set_tipple is not supported (Require pango-1.8.1 or later");
|
103
|
+
|
85
104
|
return self;
|
86
105
|
}
|
106
|
+
#endif
|
87
107
|
|
108
|
+
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
|
88
109
|
static VALUE
|
89
|
-
|
110
|
+
rg_set_override_color(VALUE self, VALUE part, VALUE color)
|
90
111
|
{
|
91
|
-
|
92
|
-
gdk_pango_renderer_set_override_color(_SELF(self),
|
112
|
+
gdk_pango_renderer_set_override_color(_SELF(self),
|
93
113
|
RVAL2GENUM(part, PANGO_TYPE_RENDER_PART),
|
94
114
|
RVAL2GDKCOLOR(color));
|
115
|
+
|
116
|
+
return self;
|
117
|
+
}
|
95
118
|
#else
|
96
|
-
|
97
|
-
|
119
|
+
static VALUE
|
120
|
+
prenderer_set_override_color(G_GNUC_UNUSED VALUE self,
|
121
|
+
G_GNUC_UNUSED VALUE part,
|
122
|
+
G_GNUC_UNUSED VALUE color)
|
123
|
+
{
|
124
|
+
rb_warning("Gdk::PangoRender#set_override_color is not supported (Require pango-1.8.1 or later");
|
125
|
+
|
98
126
|
return self;
|
99
127
|
}
|
100
128
|
#endif
|
101
129
|
|
130
|
+
#endif
|
131
|
+
|
102
132
|
void
|
103
|
-
Init_gtk_gdk_pangorenderer()
|
133
|
+
Init_gtk_gdk_pangorenderer(VALUE mGdk)
|
104
134
|
{
|
105
135
|
#if GTK_CHECK_VERSION(2,6,0)
|
106
|
-
VALUE
|
136
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PANGO_RENDERER, "PangoRenderer", mGdk);
|
107
137
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
138
|
+
RG_DEF_METHOD(initialize, -1);
|
139
|
+
RG_DEF_METHOD(set_drawable, 1);
|
140
|
+
RG_DEF_METHOD(set_gc, 1);
|
141
|
+
RG_DEF_METHOD(set_stipple, 2);
|
142
|
+
RG_DEF_METHOD(set_override_color, 2);
|
113
143
|
|
114
|
-
|
115
|
-
|
144
|
+
RG_DEF_SMETHOD(get_default, -1);
|
145
|
+
RG_DEF_SMETHOD(default, 0);
|
116
146
|
|
117
|
-
G_DEF_SETTERS(
|
147
|
+
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
118
148
|
#endif
|
119
149
|
}
|
120
|
-
|
121
|
-
|
data/ext/gtk2/rbgdkpixbuf.c
CHANGED
@@ -1,20 +1,31 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
+
*/
|
11
21
|
|
12
22
|
#include "global.h"
|
13
23
|
|
24
|
+
#define RG_TARGET_NAMESPACE cPixbuf
|
14
25
|
#define _SELF(s) GDK_PIXBUF(RVAL2GOBJ(s))
|
15
26
|
|
16
27
|
static VALUE
|
17
|
-
|
28
|
+
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)
|
18
29
|
{
|
19
30
|
gdk_pixbuf_render_threshold_alpha(_SELF(self), GDK_BITMAP(RVAL2GOBJ(bitmap)),
|
20
31
|
NUM2INT(src_x), NUM2INT(src_y),
|
@@ -25,7 +36,7 @@ pixbuf_render_threshold_alpha(VALUE self, VALUE bitmap, VALUE src_x, VALUE src_y
|
|
25
36
|
}
|
26
37
|
|
27
38
|
static VALUE
|
28
|
-
|
39
|
+
rg_render_to_drawable(int argc, VALUE *argv, VALUE self)
|
29
40
|
{
|
30
41
|
VALUE gc, src_x, src_y, dest_x, dest_y, width, height,
|
31
42
|
dither, x_dither, y_dither;
|
@@ -53,9 +64,9 @@ pixbuf_render_to_drawable(int argc, VALUE *argv, VALUE self)
|
|
53
64
|
rb_raise(rb_eArgError, "arguments 7 must be non nil");
|
54
65
|
|
55
66
|
gdk_pixbuf_render_to_drawable(_SELF(self),
|
56
|
-
|
57
|
-
|
58
|
-
|
67
|
+
GDK_DRAWABLE(RVAL2GOBJ(self)),
|
68
|
+
GDK_GC(RVAL2GOBJ(gc)),
|
69
|
+
NUM2INT(src_x), NUM2INT(src_y),
|
59
70
|
NUM2INT(dest_x), NUM2INT(dest_y),
|
60
71
|
NUM2INT(width), NUM2INT(height),
|
61
72
|
NIL_P(dither) ? GDK_RGB_DITHER_NONE : RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER),
|
@@ -65,7 +76,7 @@ pixbuf_render_to_drawable(int argc, VALUE *argv, VALUE self)
|
|
65
76
|
}
|
66
77
|
|
67
78
|
static VALUE
|
68
|
-
|
79
|
+
rg_render_pixmap_and_mask(int argc, VALUE *argv, VALUE self)
|
69
80
|
{
|
70
81
|
VALUE colormap_or_alpha, alpha;
|
71
82
|
GdkPixmap *pixmap;
|
@@ -93,7 +104,7 @@ pixbuf_render_pixmap_and_mask(int argc, VALUE *argv, VALUE self)
|
|
93
104
|
}
|
94
105
|
|
95
106
|
static VALUE
|
96
|
-
|
107
|
+
rg_s_from_drawable(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
97
108
|
{
|
98
109
|
VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y;
|
99
110
|
GdkPixbuf* buf;
|
@@ -118,9 +129,9 @@ pixbuf_s_from_drawable(int argc, VALUE *argv, VALUE self)
|
|
118
129
|
return dest;
|
119
130
|
}
|
120
131
|
}
|
121
|
-
|
132
|
+
|
122
133
|
static VALUE
|
123
|
-
|
134
|
+
rg_s_from_image(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
124
135
|
{
|
125
136
|
VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y;
|
126
137
|
GdkPixbuf* buf;
|
@@ -147,17 +158,17 @@ pixbuf_s_from_image(int argc, VALUE *argv, VALUE self)
|
|
147
158
|
}
|
148
159
|
|
149
160
|
void
|
150
|
-
Init_gtk_gdk_pixbuf()
|
161
|
+
Init_gtk_gdk_pixbuf(VALUE mGdk)
|
151
162
|
{
|
152
163
|
/*
|
153
164
|
* This defines Gdk::Pixbuf methods of GDK side.
|
154
165
|
*/
|
155
|
-
VALUE
|
166
|
+
VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_PIXBUF);
|
156
167
|
|
157
|
-
|
158
|
-
|
159
|
-
|
168
|
+
RG_DEF_METHOD(render_threshold_alpha, 8);
|
169
|
+
RG_DEF_METHOD(render_to_drawable, -1);
|
170
|
+
RG_DEF_METHOD(render_pixmap_and_mask, -1);
|
160
171
|
|
161
|
-
|
162
|
-
|
172
|
+
RG_DEF_SMETHOD(from_drawable, -1);
|
173
|
+
RG_DEF_SMETHOD(from_image, -1);
|
163
174
|
}
|
data/ext/gtk2/rbgdkpixmap.c
CHANGED
@@ -1,39 +1,51 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002-2004 Ruby-GNOME2 Project Team
|
5
|
+
* Copyright (C) 1998-2000 Yukihiro Matsumoto,
|
6
|
+
* Daisuke Kanda,
|
7
|
+
* Hiroshi Igarashi
|
8
|
+
*
|
9
|
+
* This library is free software; you can redistribute it and/or
|
10
|
+
* modify it under the terms of the GNU Lesser General Public
|
11
|
+
* License as published by the Free Software Foundation; either
|
12
|
+
* version 2.1 of the License, or (at your option) any later version.
|
13
|
+
*
|
14
|
+
* This library is distributed in the hope that it will be useful,
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
17
|
+
* Lesser General Public License for more details.
|
18
|
+
*
|
19
|
+
* You should have received a copy of the GNU Lesser General Public
|
20
|
+
* License along with this library; if not, write to the Free Software
|
21
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
22
|
+
* MA 02110-1301 USA
|
23
|
+
*/
|
14
24
|
|
15
25
|
#include "global.h"
|
16
26
|
#ifdef HAVE_XREADBITMAPFILEDATA
|
17
27
|
#include <X11/Xlib.h>
|
18
28
|
#endif /* HAVE_XREADBITMAPFILEDATA */
|
19
29
|
|
30
|
+
#define RG_TARGET_NAMESPACE cPixmap
|
31
|
+
|
20
32
|
static VALUE
|
21
|
-
|
33
|
+
rg_initialize(VALUE self, VALUE win, VALUE w, VALUE h, VALUE depth)
|
22
34
|
{
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
35
|
+
G_INITIALIZE(self, gdk_pixmap_new(GDK_WINDOW(RVAL2GOBJ(win)),
|
36
|
+
NUM2INT(w), NUM2INT(h),
|
37
|
+
NUM2INT(depth)));
|
38
|
+
return Qnil;
|
27
39
|
}
|
28
40
|
|
29
41
|
static VALUE
|
30
|
-
|
42
|
+
rg_s_create_from_data(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
31
43
|
{
|
32
44
|
VALUE win, data, w, h, depth, fg, bg, ret;
|
33
45
|
|
34
46
|
rb_scan_args(argc, argv, "43", &win, &data, &w, &h, &depth, &fg, &bg);
|
35
47
|
|
36
|
-
|
48
|
+
StringValue(data);
|
37
49
|
if (NIL_P(depth)){
|
38
50
|
ret = GOBJ2RVAL(gdk_bitmap_create_from_data(NIL_P(win) ? NULL : GDK_WINDOW(RVAL2GOBJ(win)),
|
39
51
|
RVAL2CSTR(data), NUM2INT(w), NUM2INT(h)));
|
@@ -41,14 +53,14 @@ gdkpmap_create_from_data(int argc, VALUE *argv, VALUE self)
|
|
41
53
|
ret = GOBJ2RVAL(gdk_pixmap_create_from_data(NIL_P(win) ? NULL : GDK_WINDOW(RVAL2GOBJ(win)),
|
42
54
|
RVAL2CSTR(data), NUM2INT(w), NUM2INT(h),
|
43
55
|
NUM2INT(depth),
|
44
|
-
|
45
|
-
|
56
|
+
RVAL2GDKCOLOR(fg),
|
57
|
+
RVAL2GDKCOLOR(bg)));
|
46
58
|
}
|
47
59
|
return ret;
|
48
60
|
}
|
49
61
|
|
50
62
|
static VALUE
|
51
|
-
|
63
|
+
rg_s_create_from_xpm(G_GNUC_UNUSED VALUE self, VALUE win, VALUE color, VALUE fname)
|
52
64
|
{
|
53
65
|
GdkPixmap *result;
|
54
66
|
GdkBitmap *mask;
|
@@ -64,7 +76,7 @@ gdkpmap_create_from_xpm(VALUE self, VALUE win, VALUE color, VALUE fname)
|
|
64
76
|
}
|
65
77
|
|
66
78
|
static VALUE
|
67
|
-
|
79
|
+
rg_s_create_from_xpm_d(G_GNUC_UNUSED VALUE self, VALUE win, VALUE tcolor, VALUE data)
|
68
80
|
{
|
69
81
|
GdkPixmap *result;
|
70
82
|
GdkBitmap *mask;
|
@@ -81,7 +93,7 @@ gdkpmap_create_from_xpm_d(VALUE self, VALUE win, VALUE tcolor, VALUE data)
|
|
81
93
|
}
|
82
94
|
|
83
95
|
static VALUE
|
84
|
-
|
96
|
+
rg_s_colormap_create_from_xpm(G_GNUC_UNUSED VALUE self, VALUE win, VALUE colormap, VALUE tcolor, VALUE fname)
|
85
97
|
{
|
86
98
|
GdkPixmap *result;
|
87
99
|
GdkBitmap *mask;
|
@@ -98,7 +110,7 @@ gdkpmap_colormap_create_from_xpm(VALUE self, VALUE win, VALUE colormap, VALUE tc
|
|
98
110
|
}
|
99
111
|
|
100
112
|
static VALUE
|
101
|
-
|
113
|
+
rg_s_colormap_create_from_xpm_d(G_GNUC_UNUSED VALUE self, VALUE win, VALUE colormap, VALUE tcolor, VALUE data)
|
102
114
|
{
|
103
115
|
GdkPixmap *result;
|
104
116
|
GdkBitmap *mask;
|
@@ -115,14 +127,14 @@ gdkpmap_colormap_create_from_xpm_d(VALUE self, VALUE win, VALUE colormap, VALUE
|
|
115
127
|
|
116
128
|
#ifdef HAVE_XREADBITMAPFILEDATA
|
117
129
|
static VALUE
|
118
|
-
|
130
|
+
rg_s_create_from_xbm(VALUE self, VALUE win, VALUE fname)
|
119
131
|
{
|
120
132
|
GdkBitmap *new;
|
121
133
|
unsigned char *data;
|
122
134
|
unsigned int width, height;
|
123
135
|
int x, y;
|
124
136
|
|
125
|
-
|
137
|
+
StringValue(fname);
|
126
138
|
if (XReadBitmapFileData(RVAL2CSTR(fname), &width, &height, &data, &x, &y))
|
127
139
|
rb_raise(rb_eArgError, "Bitmap not created from %s", RVAL2CSTR(fname));
|
128
140
|
|
@@ -141,13 +153,13 @@ gdkpmap_create_from_xbm(VALUE self, VALUE win, VALUE fname)
|
|
141
153
|
*/
|
142
154
|
|
143
155
|
static VALUE
|
144
|
-
|
156
|
+
rg_s_foreign_new(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
145
157
|
{
|
146
158
|
VALUE arg[5];
|
147
159
|
GdkPixmap* win = NULL;
|
148
|
-
|
160
|
+
|
149
161
|
rb_scan_args(argc, argv, "14", &arg[0], &arg[1], &arg[2], &arg[3], &arg[4]);
|
150
|
-
|
162
|
+
|
151
163
|
switch(argc)
|
152
164
|
{
|
153
165
|
case 1:
|
@@ -174,31 +186,35 @@ gdkpmap_foreign_new(int argc, VALUE *argv, VALUE self)
|
|
174
186
|
rb_warn("Not supported. GTK+-2.10.0 or later.");
|
175
187
|
#endif
|
176
188
|
break;
|
189
|
+
default:
|
190
|
+
break;
|
177
191
|
}
|
178
192
|
return win ? GOBJ2RVAL(win) : Qnil;
|
179
193
|
}
|
180
194
|
|
181
195
|
static VALUE
|
182
|
-
|
196
|
+
rg_s_lookup(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
183
197
|
{
|
184
198
|
VALUE arg[2];
|
185
199
|
GdkPixmap* win = NULL;
|
186
|
-
|
200
|
+
|
187
201
|
rb_scan_args(argc, argv, "11", &arg[0], &arg[1]);
|
188
202
|
|
189
203
|
switch(argc)
|
190
204
|
{
|
191
205
|
case 1:
|
192
|
-
|
193
|
-
|
206
|
+
win = gdk_pixmap_lookup(RVAL2GDKNATIVEWINDOW(arg[0]));
|
207
|
+
break;
|
194
208
|
case 2:
|
195
209
|
#if GTK_CHECK_VERSION(2,2,0)
|
196
|
-
|
210
|
+
win = gdk_pixmap_lookup_for_display(RVAL2GOBJ(arg[0]), RVAL2GDKNATIVEWINDOW(arg[1]));
|
197
211
|
#else
|
198
|
-
|
212
|
+
win = gdk_pixmap_lookup(RVAL2GDKNATIVEWINDOW(arg[1]));
|
199
213
|
rb_warn("Not supported in GTK+-2.0.x.");
|
200
214
|
#endif
|
201
|
-
|
215
|
+
break;
|
216
|
+
default:
|
217
|
+
break;
|
202
218
|
}
|
203
219
|
if (win == NULL)
|
204
220
|
return Qnil;
|
@@ -208,18 +224,18 @@ gdkpmap_lookup(int argc, VALUE *argv, VALUE self)
|
|
208
224
|
}
|
209
225
|
|
210
226
|
void
|
211
|
-
Init_gtk_gdk_pixmap()
|
227
|
+
Init_gtk_gdk_pixmap(VALUE mGdk)
|
212
228
|
{
|
213
|
-
VALUE
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
229
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXMAP, "Pixmap", mGdk);
|
230
|
+
|
231
|
+
RG_DEF_METHOD(initialize, 4);
|
232
|
+
RG_DEF_SMETHOD(create_from_data, -1);
|
233
|
+
RG_DEF_SMETHOD(create_from_xpm, 3);
|
234
|
+
RG_DEF_SMETHOD(create_from_xpm_d, 3);
|
235
|
+
RG_DEF_SMETHOD(colormap_create_from_xpm, 4);
|
236
|
+
RG_DEF_SMETHOD(colormap_create_from_xpm_d, 4);
|
221
237
|
#ifdef HAVE_XREADBITMAPFILEDATA
|
222
|
-
|
238
|
+
RG_DEF_SMETHOD(create_from_xbm, 2);
|
223
239
|
#endif /* HAVE_XREADBITMAPFILEDATA */
|
224
240
|
#ifdef GDK_WINDOWING_X11
|
225
241
|
G_DEF_CLASS3("GdkPixmapImplX11", "PixmapImplX11", mGdk);
|
@@ -229,7 +245,7 @@ Init_gtk_gdk_pixmap()
|
|
229
245
|
G_DEF_CLASS3("GdkPixmapFB", "PixmapFB", mGdk);
|
230
246
|
#endif
|
231
247
|
|
232
|
-
|
233
|
-
|
248
|
+
RG_DEF_SMETHOD(foreign_new, -1);
|
249
|
+
RG_DEF_SMETHOD(lookup, -1);
|
234
250
|
|
235
251
|
}
|