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
data/ext/gtk2/rbgdkevent.c
CHANGED
@@ -1,16 +1,26 @@
|
|
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
|
|
@@ -238,25 +248,25 @@ gdkevent ## type ## _initialize(int argc, VALUE *argv, VALUE self)\
|
|
238
248
|
|
239
249
|
/* GdkEvent Singleton Methods */
|
240
250
|
static VALUE
|
241
|
-
gdkevent_s_events_pending(VALUE self)
|
251
|
+
gdkevent_s_events_pending(G_GNUC_UNUSED VALUE self)
|
242
252
|
{
|
243
253
|
return CBOOL2RVAL(gdk_events_pending());
|
244
254
|
}
|
245
255
|
|
246
256
|
static VALUE
|
247
|
-
gdkevent_s_peek(VALUE self)
|
257
|
+
gdkevent_s_peek(G_GNUC_UNUSED VALUE self)
|
248
258
|
{
|
249
259
|
return make_gdkevent(gdk_event_peek());
|
250
260
|
}
|
251
261
|
|
252
262
|
static VALUE
|
253
|
-
gdkevent_s_get(VALUE self)
|
263
|
+
gdkevent_s_get(G_GNUC_UNUSED VALUE self)
|
254
264
|
{
|
255
265
|
return make_gdkevent(gdk_event_get());
|
256
266
|
}
|
257
267
|
|
258
268
|
static VALUE
|
259
|
-
gdkevent_s_get_graphics_expose(VALUE self, VALUE window)
|
269
|
+
gdkevent_s_get_graphics_expose(G_GNUC_UNUSED VALUE self, VALUE window)
|
260
270
|
{
|
261
271
|
return make_gdkevent(gdk_event_get_graphics_expose(GDK_WINDOW(RVAL2GOBJ(window))));
|
262
272
|
}
|
@@ -338,7 +348,7 @@ gdkevent_s_handler_set(VALUE self)
|
|
338
348
|
}
|
339
349
|
|
340
350
|
static VALUE
|
341
|
-
gdkevent_s_get_show_events(VALUE self)
|
351
|
+
gdkevent_s_get_show_events(G_GNUC_UNUSED VALUE self)
|
342
352
|
{
|
343
353
|
return CBOOL2RVAL(gdk_get_show_events());
|
344
354
|
}
|
@@ -368,11 +378,11 @@ gdkevent_screen(VALUE self)
|
|
368
378
|
type: String, Integer, Gdk::Color.
|
369
379
|
*/
|
370
380
|
static VALUE
|
371
|
-
gdkevent_s_setting_get(int argc, VALUE *argv, VALUE self)
|
381
|
+
gdkevent_s_setting_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
372
382
|
{
|
373
383
|
VALUE name, type;
|
374
384
|
GType gtype;
|
375
|
-
GValue val =
|
385
|
+
GValue val = G_VALUE_INIT;
|
376
386
|
gboolean ret;
|
377
387
|
VALUE value;
|
378
388
|
|
@@ -647,7 +657,7 @@ gdkevent_g2r(const GValue *values)
|
|
647
657
|
}
|
648
658
|
|
649
659
|
void
|
650
|
-
Init_gtk_gdk_event()
|
660
|
+
Init_gtk_gdk_event(VALUE mGdk)
|
651
661
|
{
|
652
662
|
VALUE ev;
|
653
663
|
VALUE gdkEvent;
|
data/ext/gtk2/rbgdkgc.c
CHANGED
@@ -1,25 +1,36 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002-2004 Ruby-GNOME2 Project Team
|
5
|
+
* Copyright (C) 2002,2003 Masao Mutoh
|
6
|
+
* Copyright (C) 2001 Neil Conway
|
7
|
+
*
|
8
|
+
* This library is free software; you can redistribute it and/or
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
10
|
+
* License as published by the Free Software Foundation; either
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
12
|
+
*
|
13
|
+
* This library is distributed in the hope that it will be useful,
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16
|
+
* Lesser General Public License for more details.
|
17
|
+
*
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
19
|
+
* License along with this library; if not, write to the Free Software
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
21
|
+
* MA 02110-1301 USA
|
22
|
+
*/
|
13
23
|
|
14
24
|
#include "global.h"
|
15
25
|
|
26
|
+
#define RG_TARGET_NAMESPACE cGC
|
16
27
|
#define _SELF(s) (GDK_GC(RVAL2GOBJ(s)))
|
17
28
|
|
18
|
-
static VALUE
|
29
|
+
static VALUE RG_TARGET_NAMESPACE;
|
19
30
|
static VALUE gdkDrawable;
|
20
31
|
|
21
32
|
static VALUE
|
22
|
-
|
33
|
+
rg_initialize(VALUE self, VALUE win)
|
23
34
|
{
|
24
35
|
G_INITIALIZE(self, gdk_gc_new(GDK_DRAWABLE(RVAL2GOBJ(win))));
|
25
36
|
return Qnil;
|
@@ -37,89 +48,89 @@ void gdk_gc_get_values (GdkGC *gc,
|
|
37
48
|
*/
|
38
49
|
|
39
50
|
static VALUE
|
40
|
-
|
51
|
+
rg_set_foreground(VALUE self, VALUE color)
|
41
52
|
{
|
42
53
|
gdk_gc_set_foreground(_SELF(self), RVAL2GDKCOLOR(color));
|
43
54
|
return self;
|
44
55
|
}
|
45
56
|
|
46
57
|
static VALUE
|
47
|
-
|
58
|
+
rg_set_background(VALUE self, VALUE color)
|
48
59
|
{
|
49
60
|
gdk_gc_set_background(_SELF(self), RVAL2GDKCOLOR(color));
|
50
61
|
return self;
|
51
62
|
}
|
52
63
|
|
53
64
|
static VALUE
|
54
|
-
|
65
|
+
rg_set_rgb_fg_color(VALUE self, VALUE color)
|
55
66
|
{
|
56
67
|
gdk_gc_set_rgb_fg_color(_SELF(self), RVAL2GDKCOLOR(color));
|
57
68
|
return self;
|
58
69
|
}
|
59
70
|
|
60
71
|
static VALUE
|
61
|
-
|
72
|
+
rg_set_rgb_bg_color(VALUE self, VALUE color)
|
62
73
|
{
|
63
74
|
gdk_gc_set_rgb_bg_color(_SELF(self), RVAL2GDKCOLOR(color));
|
64
75
|
return self;
|
65
76
|
}
|
66
77
|
|
67
78
|
static VALUE
|
68
|
-
|
79
|
+
rg_set_function(VALUE self, VALUE func)
|
69
80
|
{
|
70
81
|
GdkFunction f;
|
71
82
|
f = (GdkFunction)(RVAL2GENUM(func, GDK_TYPE_FUNCTION));
|
72
83
|
if (f > GDK_SET)
|
73
84
|
rb_raise(rb_eArgError, "function out of range");
|
74
|
-
|
85
|
+
|
75
86
|
gdk_gc_set_function(_SELF(self), f);
|
76
87
|
return self;
|
77
88
|
}
|
78
89
|
|
79
90
|
static VALUE
|
80
|
-
|
91
|
+
rg_set_fill(VALUE self, VALUE fill)
|
81
92
|
{
|
82
93
|
gdk_gc_set_fill(_SELF(self), RVAL2GENUM(fill, GDK_TYPE_FILL));
|
83
94
|
return self;
|
84
95
|
}
|
85
96
|
|
86
97
|
static VALUE
|
87
|
-
|
98
|
+
rg_set_tile(VALUE self, VALUE tile)
|
88
99
|
{
|
89
100
|
gdk_gc_set_tile(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(tile)));
|
90
101
|
return self;
|
91
102
|
}
|
92
103
|
|
93
104
|
static VALUE
|
94
|
-
|
105
|
+
rg_set_stipple(VALUE self, VALUE stipple)
|
95
106
|
{
|
96
107
|
gdk_gc_set_stipple(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(stipple)));
|
97
108
|
return self;
|
98
109
|
}
|
99
110
|
|
100
111
|
static VALUE
|
101
|
-
|
112
|
+
rg_set_ts_origin(VALUE self, VALUE x, VALUE y)
|
102
113
|
{
|
103
114
|
gdk_gc_set_ts_origin(_SELF(self), NUM2INT(x), NUM2INT(y));
|
104
115
|
return self;
|
105
116
|
}
|
106
117
|
|
107
118
|
static VALUE
|
108
|
-
|
119
|
+
rg_set_clip_origin(VALUE self, VALUE x, VALUE y)
|
109
120
|
{
|
110
121
|
gdk_gc_set_clip_origin(_SELF(self), NUM2INT(x), NUM2INT(y));
|
111
122
|
return self;
|
112
123
|
}
|
113
124
|
|
114
125
|
static VALUE
|
115
|
-
|
126
|
+
rg_set_clip_mask(VALUE self, VALUE mask)
|
116
127
|
{
|
117
128
|
gdk_gc_set_clip_mask(_SELF(self), GDK_BITMAP(RVAL2GOBJ(mask)));
|
118
129
|
return self;
|
119
130
|
}
|
120
131
|
|
121
132
|
static VALUE
|
122
|
-
|
133
|
+
rg_set_clip_rectangle(VALUE self, VALUE rectangle)
|
123
134
|
{
|
124
135
|
gdk_gc_set_clip_rectangle(_SELF(self),
|
125
136
|
(GdkRectangle*)RVAL2BOXED(rectangle, GDK_TYPE_RECTANGLE));
|
@@ -127,7 +138,7 @@ gdkgc_set_clip_rectangle(VALUE self, VALUE rectangle)
|
|
127
138
|
}
|
128
139
|
|
129
140
|
static VALUE
|
130
|
-
|
141
|
+
rg_set_clip_region(VALUE self, VALUE region)
|
131
142
|
{
|
132
143
|
gdk_gc_set_clip_region(_SELF(self),
|
133
144
|
(GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION));
|
@@ -135,21 +146,21 @@ gdkgc_set_clip_region(VALUE self, VALUE region)
|
|
135
146
|
}
|
136
147
|
|
137
148
|
static VALUE
|
138
|
-
|
149
|
+
rg_set_subwindow_mode(VALUE self, VALUE mode)
|
139
150
|
{
|
140
151
|
gdk_gc_set_subwindow(_SELF(self), RVAL2GENUM(mode, GDK_TYPE_SUBWINDOW_MODE));
|
141
152
|
return self;
|
142
153
|
}
|
143
154
|
|
144
155
|
static VALUE
|
145
|
-
|
156
|
+
rg_set_exposures(VALUE self, VALUE exposures)
|
146
157
|
{
|
147
158
|
gdk_gc_set_exposures(_SELF(self), RVAL2CBOOL(exposures));
|
148
159
|
return self;
|
149
160
|
}
|
150
161
|
|
151
162
|
static VALUE
|
152
|
-
|
163
|
+
rg_set_line_attributes(VALUE self, VALUE line_width, VALUE line_style, VALUE cap_style, VALUE join_style)
|
153
164
|
{
|
154
165
|
gdk_gc_set_line_attributes(_SELF(self), NUM2INT(line_width),
|
155
166
|
RVAL2GENUM(line_style, GDK_TYPE_LINE_STYLE),
|
@@ -159,45 +170,41 @@ gdkgc_set_line_attributes(VALUE self, VALUE line_width, VALUE line_style, VALUE
|
|
159
170
|
}
|
160
171
|
|
161
172
|
static VALUE
|
162
|
-
|
173
|
+
rg_set_dashes(VALUE self, VALUE rbdash_offset, VALUE rbdash_list)
|
163
174
|
{
|
164
|
-
|
165
|
-
|
175
|
+
GdkGC *gc = _SELF(self);
|
176
|
+
gint dash_offset = NUM2INT(rbdash_offset);
|
177
|
+
long n;
|
178
|
+
gint8 *dash_list = RVAL2GINT8S(rbdash_list, n);
|
166
179
|
|
167
|
-
|
180
|
+
gdk_gc_set_dashes(gc, dash_offset, dash_list, n);
|
168
181
|
|
169
|
-
|
170
|
-
for (i = 0; i < RARRAY_LEN(dash_list); i++) {
|
171
|
-
Check_Type(RARRAY_PTR(dash_list)[i], T_FIXNUM);
|
172
|
-
buf[i] = (gint8)NUM2CHR(RARRAY_PTR(dash_list)[i]);
|
173
|
-
}
|
174
|
-
gdk_gc_set_dashes(_SELF(self), NUM2INT(dash_offset),
|
175
|
-
(gint8*)buf, RARRAY_LEN(dash_list));
|
182
|
+
g_free(dash_list);
|
176
183
|
|
177
184
|
return self;
|
178
185
|
}
|
179
186
|
|
180
187
|
static VALUE
|
181
|
-
|
188
|
+
rg_copy(VALUE self, VALUE dst)
|
182
189
|
{
|
183
190
|
if (RVAL2CBOOL(rb_obj_is_kind_of(dst, gdkDrawable))) {
|
184
191
|
VALUE args[1];
|
185
192
|
args[0] = dst;
|
186
|
-
dst = rb_class_new_instance(1, args,
|
193
|
+
dst = rb_class_new_instance(1, args, RG_TARGET_NAMESPACE);
|
187
194
|
}
|
188
195
|
gdk_gc_copy(_SELF(dst), _SELF(self));
|
189
196
|
return dst;
|
190
197
|
}
|
191
198
|
|
192
199
|
static VALUE
|
193
|
-
|
200
|
+
rg_set_colormap(VALUE self, VALUE colormap)
|
194
201
|
{
|
195
|
-
gdk_gc_set_colormap(_SELF(self), GDK_COLORMAP(RVAL2GOBJ(
|
202
|
+
gdk_gc_set_colormap(_SELF(self), GDK_COLORMAP(RVAL2GOBJ(colormap)));
|
196
203
|
return self;
|
197
204
|
}
|
198
205
|
|
199
206
|
static VALUE
|
200
|
-
|
207
|
+
rg_foreground(VALUE self)
|
201
208
|
{
|
202
209
|
GdkGCValues val;
|
203
210
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -206,7 +213,7 @@ gdkgc_get_foreground(VALUE self)
|
|
206
213
|
}
|
207
214
|
|
208
215
|
static VALUE
|
209
|
-
|
216
|
+
rg_background(VALUE self)
|
210
217
|
{
|
211
218
|
GdkGCValues val;
|
212
219
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -215,7 +222,7 @@ gdkgc_get_background(VALUE self)
|
|
215
222
|
}
|
216
223
|
|
217
224
|
static VALUE
|
218
|
-
|
225
|
+
rg_function(VALUE self)
|
219
226
|
{
|
220
227
|
GdkGCValues val;
|
221
228
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -224,7 +231,7 @@ gdkgc_get_function(VALUE self)
|
|
224
231
|
}
|
225
232
|
|
226
233
|
static VALUE
|
227
|
-
|
234
|
+
rg_fill(VALUE self)
|
228
235
|
{
|
229
236
|
GdkGCValues val;
|
230
237
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -233,7 +240,7 @@ gdkgc_get_fill(VALUE self)
|
|
233
240
|
}
|
234
241
|
|
235
242
|
static VALUE
|
236
|
-
|
243
|
+
rg_tile(VALUE self)
|
237
244
|
{
|
238
245
|
GdkGCValues val;
|
239
246
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -242,7 +249,7 @@ gdkgc_get_tile(VALUE self)
|
|
242
249
|
}
|
243
250
|
|
244
251
|
static VALUE
|
245
|
-
|
252
|
+
rg_stipple(VALUE self)
|
246
253
|
{
|
247
254
|
GdkGCValues val;
|
248
255
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -251,7 +258,7 @@ gdkgc_get_stipple(VALUE self)
|
|
251
258
|
}
|
252
259
|
|
253
260
|
static VALUE
|
254
|
-
|
261
|
+
rg_ts_origin(VALUE self)
|
255
262
|
{
|
256
263
|
GdkGCValues val;
|
257
264
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -259,9 +266,9 @@ gdkgc_get_ts_origin(VALUE self)
|
|
259
266
|
return rb_ary_new3(2, INT2NUM(val.ts_x_origin),
|
260
267
|
INT2NUM(val.ts_y_origin));
|
261
268
|
}
|
262
|
-
|
269
|
+
|
263
270
|
static VALUE
|
264
|
-
|
271
|
+
rg_clip_origin(VALUE self)
|
265
272
|
{
|
266
273
|
GdkGCValues val;
|
267
274
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -271,7 +278,7 @@ gdkgc_get_clip_origin(VALUE self)
|
|
271
278
|
}
|
272
279
|
|
273
280
|
static VALUE
|
274
|
-
|
281
|
+
rg_clip_mask(VALUE self)
|
275
282
|
{
|
276
283
|
GdkGCValues val;
|
277
284
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -280,7 +287,7 @@ gdkgc_get_clip_mask(VALUE self)
|
|
280
287
|
}
|
281
288
|
|
282
289
|
static VALUE
|
283
|
-
|
290
|
+
rg_subwindow_mode(VALUE self)
|
284
291
|
{
|
285
292
|
GdkGCValues val;
|
286
293
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -289,7 +296,7 @@ gdkgc_get_subwindow(VALUE self)
|
|
289
296
|
}
|
290
297
|
|
291
298
|
static VALUE
|
292
|
-
|
299
|
+
rg_exposures_p(VALUE self)
|
293
300
|
{
|
294
301
|
GdkGCValues val;
|
295
302
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -298,7 +305,7 @@ gdkgc_get_exposures(VALUE self)
|
|
298
305
|
}
|
299
306
|
|
300
307
|
static VALUE
|
301
|
-
|
308
|
+
rg_line_attributes(VALUE self)
|
302
309
|
{
|
303
310
|
GdkGCValues val;
|
304
311
|
gdk_gc_get_values(_SELF(self), &val);
|
@@ -310,13 +317,13 @@ gdkgc_get_line_attributes(VALUE self)
|
|
310
317
|
}
|
311
318
|
|
312
319
|
static VALUE
|
313
|
-
|
320
|
+
rg_colormap(VALUE self)
|
314
321
|
{
|
315
322
|
return GOBJ2RVAL(gdk_gc_get_colormap(_SELF(self)));
|
316
323
|
}
|
317
324
|
|
318
325
|
static VALUE
|
319
|
-
|
326
|
+
rg_offset(VALUE self, VALUE x, VALUE y)
|
320
327
|
{
|
321
328
|
gdk_gc_offset(_SELF(self), NUM2INT(x), NUM2INT(y));
|
322
329
|
return self;
|
@@ -324,92 +331,92 @@ gdkgc_offset(VALUE self, VALUE x, VALUE y)
|
|
324
331
|
|
325
332
|
#if GTK_CHECK_VERSION(2,2,0)
|
326
333
|
static VALUE
|
327
|
-
|
334
|
+
rg_screen(VALUE self)
|
328
335
|
{
|
329
336
|
return GOBJ2RVAL(gdk_gc_get_screen(_SELF(self)));
|
330
337
|
}
|
331
338
|
#endif
|
332
339
|
|
333
340
|
void
|
334
|
-
Init_gtk_gdk_gc()
|
341
|
+
Init_gtk_gdk_gc(VALUE mGdk)
|
335
342
|
{
|
336
|
-
|
343
|
+
RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_GC, "GC", mGdk);
|
337
344
|
gdkDrawable = rb_const_get(mGdk, rb_intern("Drawable"));
|
338
|
-
|
345
|
+
|
339
346
|
rbgobj_add_abstract_but_create_instance_class(GDK_TYPE_GC);
|
340
347
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
348
|
+
RG_DEF_METHOD(initialize, 1);
|
349
|
+
RG_DEF_METHOD(set_foreground, 1);
|
350
|
+
RG_DEF_METHOD(set_background, 1);
|
351
|
+
RG_DEF_METHOD(set_rgb_fg_color, 1);
|
352
|
+
RG_DEF_METHOD(set_rgb_bg_color, 1);
|
353
|
+
RG_DEF_METHOD(set_function, 1);
|
354
|
+
RG_DEF_METHOD(set_fill, 1);
|
355
|
+
RG_DEF_METHOD(set_tile, 1);
|
356
|
+
RG_DEF_METHOD(set_stipple, 1);
|
357
|
+
RG_DEF_METHOD(set_ts_origin, 2);
|
358
|
+
RG_DEF_METHOD(set_clip_origin, 2);
|
359
|
+
RG_DEF_METHOD(set_clip_mask, 1);
|
360
|
+
RG_DEF_METHOD(set_clip_rectangle, 1);
|
361
|
+
RG_DEF_METHOD(set_clip_region, 1);
|
362
|
+
RG_DEF_METHOD(set_subwindow_mode, 1);
|
363
|
+
RG_DEF_METHOD(set_exposures, 1);
|
364
|
+
RG_DEF_METHOD(set_line_attributes, 4);
|
365
|
+
RG_DEF_METHOD(set_dashes, 2);
|
366
|
+
RG_DEF_METHOD(copy, 1);
|
367
|
+
RG_DEF_METHOD(set_colormap, 1);
|
368
|
+
|
369
|
+
RG_DEF_METHOD(foreground, 0);
|
370
|
+
RG_DEF_METHOD(background, 0);
|
371
|
+
RG_DEF_METHOD(function, 0);
|
372
|
+
RG_DEF_METHOD(fill, 0);
|
373
|
+
RG_DEF_METHOD(tile, 0);
|
374
|
+
RG_DEF_METHOD(stipple, 0);
|
375
|
+
RG_DEF_METHOD(ts_origin, 0);
|
376
|
+
RG_DEF_METHOD(clip_origin, 0);
|
377
|
+
RG_DEF_METHOD(clip_mask, 0);
|
378
|
+
RG_DEF_METHOD(subwindow_mode, 0);
|
379
|
+
RG_DEF_METHOD_P(exposures, 0);
|
380
|
+
RG_DEF_METHOD(line_attributes, 0);
|
381
|
+
|
382
|
+
RG_DEF_METHOD(colormap, 0);
|
383
|
+
RG_DEF_METHOD(offset, 2);
|
377
384
|
|
378
385
|
#if GTK_CHECK_VERSION(2,2,0)
|
379
|
-
|
386
|
+
RG_DEF_METHOD(screen, 0);
|
380
387
|
#endif
|
381
388
|
|
382
|
-
G_DEF_SETTERS(
|
389
|
+
G_DEF_SETTERS(RG_TARGET_NAMESPACE);
|
383
390
|
|
384
391
|
/* GdkGCValuesMask */
|
385
392
|
/* Don't need them.
|
386
|
-
G_DEF_CLASS(GDK_TYPE_GC_VALUES_MASK, "ValuesMask",
|
387
|
-
G_DEF_CONSTANTS(
|
393
|
+
G_DEF_CLASS(GDK_TYPE_GC_VALUES_MASK, "ValuesMask", RG_TARGET_NAMESPACE);
|
394
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_GC_VALUES_MASK, "GDK_GC_");
|
388
395
|
*/
|
389
396
|
|
390
397
|
/* GdkFunction */
|
391
|
-
G_DEF_CLASS(GDK_TYPE_FUNCTION, "Function",
|
392
|
-
G_DEF_CONSTANTS(
|
398
|
+
G_DEF_CLASS(GDK_TYPE_FUNCTION, "Function", RG_TARGET_NAMESPACE);
|
399
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_FUNCTION, "GDK_");
|
393
400
|
|
394
401
|
/* GdkFill */
|
395
|
-
G_DEF_CLASS(GDK_TYPE_FILL, "Fill",
|
396
|
-
G_DEF_CONSTANTS(
|
402
|
+
G_DEF_CLASS(GDK_TYPE_FILL, "Fill", RG_TARGET_NAMESPACE);
|
403
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_FILL, "GDK_");
|
397
404
|
|
398
405
|
/* GdkSubwindowMode */
|
399
|
-
G_DEF_CLASS(GDK_TYPE_SUBWINDOW_MODE, "SubWindowMode",
|
400
|
-
G_DEF_CONSTANTS(
|
406
|
+
G_DEF_CLASS(GDK_TYPE_SUBWINDOW_MODE, "SubWindowMode", RG_TARGET_NAMESPACE);
|
407
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_SUBWINDOW_MODE, "GDK_");
|
401
408
|
|
402
409
|
/* GdkLineStyle */
|
403
|
-
G_DEF_CLASS(GDK_TYPE_LINE_STYLE, "LineStyle",
|
404
|
-
G_DEF_CONSTANTS(
|
410
|
+
G_DEF_CLASS(GDK_TYPE_LINE_STYLE, "LineStyle", RG_TARGET_NAMESPACE);
|
411
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_LINE_STYLE, "GDK_");
|
405
412
|
|
406
413
|
/* GdkCapStyle */
|
407
|
-
G_DEF_CLASS(GDK_TYPE_CAP_STYLE, "CapStyle",
|
408
|
-
G_DEF_CONSTANTS(
|
414
|
+
G_DEF_CLASS(GDK_TYPE_CAP_STYLE, "CapStyle", RG_TARGET_NAMESPACE);
|
415
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_CAP_STYLE, "GDK_");
|
409
416
|
|
410
417
|
/* GdkJoinStyle */
|
411
|
-
G_DEF_CLASS(GDK_TYPE_JOIN_STYLE, "JoinStyle",
|
412
|
-
G_DEF_CONSTANTS(
|
418
|
+
G_DEF_CLASS(GDK_TYPE_JOIN_STYLE, "JoinStyle", RG_TARGET_NAMESPACE);
|
419
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_JOIN_STYLE, "GDK_");
|
413
420
|
|
414
421
|
#ifdef GDK_WINDOWING_X11
|
415
422
|
G_DEF_CLASS3("GdkGCX11", "GCX11", mGdk);
|