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/rbgdkscreen.c
CHANGED
@@ -1,14 +1,24 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2003-2006 Ruby-GNOME2 Project Team
|
5
|
+
* Copyright (C) 2003 Geoff Youngs
|
6
|
+
*
|
7
|
+
* This library is free software; you can redistribute it and/or
|
8
|
+
* modify it under the terms of the GNU Lesser General Public
|
9
|
+
* License as published by the Free Software Foundation; either
|
10
|
+
* version 2.1 of the License, or (at your option) any later version.
|
11
|
+
*
|
12
|
+
* This library is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
* Lesser General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public
|
18
|
+
* License along with this library; if not, write to the Free Software
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
+
* MA 02110-1301 USA
|
21
|
+
*/
|
12
22
|
|
13
23
|
#include "global.h"
|
14
24
|
#ifdef HAVE_RB_CAIRO_H
|
@@ -16,24 +26,26 @@
|
|
16
26
|
#endif
|
17
27
|
|
18
28
|
#if GTK_CHECK_VERSION(2,2,0)
|
29
|
+
|
30
|
+
#define RG_TARGET_NAMESPACE cScreen
|
19
31
|
#define _SELF(i) GDK_SCREEN(RVAL2GOBJ(i))
|
20
32
|
|
21
33
|
static ID id_new;
|
22
34
|
|
23
35
|
static VALUE
|
24
|
-
|
36
|
+
rg_s_default(G_GNUC_UNUSED VALUE self)
|
25
37
|
{
|
26
38
|
return GOBJ2RVAL(gdk_screen_get_default());
|
27
39
|
}
|
28
40
|
|
29
41
|
static VALUE
|
30
|
-
|
42
|
+
rg_default_colormap(VALUE self)
|
31
43
|
{
|
32
44
|
return GOBJ2RVAL(gdk_screen_get_default_colormap(_SELF(self)));
|
33
45
|
}
|
34
46
|
|
35
47
|
static VALUE
|
36
|
-
|
48
|
+
rg_set_default_colormap(VALUE self, VALUE colormap)
|
37
49
|
{
|
38
50
|
gdk_screen_set_default_colormap(_SELF(self),
|
39
51
|
GDK_COLORMAP(RVAL2GOBJ(colormap)));
|
@@ -41,38 +53,38 @@ gdkscreen_set_default_colormap(VALUE self, VALUE colormap)
|
|
41
53
|
}
|
42
54
|
|
43
55
|
static VALUE
|
44
|
-
|
56
|
+
rg_system_colormap(VALUE self)
|
45
57
|
{
|
46
58
|
return GOBJ2RVAL(gdk_screen_get_system_colormap(_SELF(self)));
|
47
59
|
}
|
48
60
|
|
49
61
|
static VALUE
|
50
|
-
|
62
|
+
rg_system_visual(VALUE self)
|
51
63
|
{
|
52
64
|
return GOBJ2RVAL(gdk_screen_get_system_visual(_SELF(self)));
|
53
65
|
}
|
54
66
|
|
55
67
|
static VALUE
|
56
|
-
|
68
|
+
rg_rgb_colormap(VALUE self)
|
57
69
|
{
|
58
70
|
return GOBJ2RVAL(gdk_screen_get_rgb_colormap(_SELF(self)));
|
59
71
|
}
|
60
72
|
|
61
73
|
static VALUE
|
62
|
-
|
74
|
+
rg_rgb_visual(VALUE self)
|
63
75
|
{
|
64
76
|
return GOBJ2RVAL(gdk_screen_get_rgb_visual(_SELF(self)));
|
65
77
|
}
|
66
78
|
|
67
79
|
#if GTK_CHECK_VERSION(2,8,0)
|
68
80
|
static VALUE
|
69
|
-
|
81
|
+
rg_rgba_colormap(VALUE self)
|
70
82
|
{
|
71
83
|
return GOBJ2RVAL(gdk_screen_get_rgba_colormap(_SELF(self)));
|
72
84
|
}
|
73
85
|
|
74
86
|
static VALUE
|
75
|
-
|
87
|
+
rg_rgba_visual(VALUE self)
|
76
88
|
{
|
77
89
|
return GOBJ2RVAL(gdk_screen_get_rgba_visual(_SELF(self)));
|
78
90
|
}
|
@@ -80,64 +92,64 @@ gdkscreen_get_rgba_visual(VALUE self)
|
|
80
92
|
|
81
93
|
#if GTK_CHECK_VERSION(2,10,0)
|
82
94
|
static VALUE
|
83
|
-
|
95
|
+
rg_composited_p(VALUE self)
|
84
96
|
{
|
85
97
|
return CBOOL2RVAL(gdk_screen_is_composited(_SELF(self)));
|
86
98
|
}
|
87
99
|
#endif
|
88
100
|
|
89
101
|
static VALUE
|
90
|
-
|
102
|
+
rg_root_window(VALUE self)
|
91
103
|
{
|
92
104
|
return GOBJ2RVAL(gdk_screen_get_root_window(_SELF(self)));
|
93
105
|
}
|
94
106
|
|
95
107
|
static VALUE
|
96
|
-
|
108
|
+
rg_display(VALUE self)
|
97
109
|
{
|
98
110
|
return GOBJ2RVAL(gdk_screen_get_display(_SELF(self)));
|
99
111
|
}
|
100
112
|
|
101
113
|
static VALUE
|
102
|
-
|
114
|
+
rg_number(VALUE self)
|
103
115
|
{
|
104
116
|
return INT2NUM(gdk_screen_get_number(_SELF(self)));
|
105
117
|
}
|
106
118
|
static VALUE
|
107
|
-
|
119
|
+
rg_width(VALUE self)
|
108
120
|
{
|
109
121
|
return INT2NUM(gdk_screen_get_width(_SELF(self)));
|
110
122
|
}
|
111
123
|
static VALUE
|
112
|
-
|
124
|
+
rg_height(VALUE self)
|
113
125
|
{
|
114
126
|
return INT2NUM(gdk_screen_get_height(_SELF(self)));
|
115
127
|
}
|
116
128
|
static VALUE
|
117
|
-
|
129
|
+
rg_width_mm(VALUE self)
|
118
130
|
{
|
119
131
|
return INT2NUM(gdk_screen_get_width_mm(_SELF(self)));
|
120
132
|
}
|
121
133
|
static VALUE
|
122
|
-
|
134
|
+
rg_height_mm(VALUE self)
|
123
135
|
{
|
124
136
|
return INT2NUM(gdk_screen_get_height_mm(_SELF(self)));
|
125
137
|
}
|
126
138
|
|
127
139
|
static VALUE
|
128
|
-
|
140
|
+
rg_visuals(VALUE self)
|
129
141
|
{
|
130
142
|
return GLIST2ARYF(gdk_screen_list_visuals(_SELF(self)));
|
131
143
|
}
|
132
144
|
|
133
145
|
static VALUE
|
134
|
-
|
146
|
+
rg_toplevel_windows(VALUE self)
|
135
147
|
{
|
136
148
|
return GLIST2ARYF(gdk_screen_get_toplevel_windows(_SELF(self)));
|
137
149
|
}
|
138
150
|
|
139
151
|
static VALUE
|
140
|
-
|
152
|
+
rg_display_name(VALUE self)
|
141
153
|
{
|
142
154
|
gchar* name = gdk_screen_make_display_name(_SELF(self));
|
143
155
|
VALUE ret = CSTR2RVAL(name);
|
@@ -146,13 +158,13 @@ gdkscreen_make_display_name(VALUE self)
|
|
146
158
|
}
|
147
159
|
|
148
160
|
static VALUE
|
149
|
-
|
161
|
+
rg_n_monitors(VALUE self)
|
150
162
|
{
|
151
163
|
return INT2NUM(gdk_screen_get_n_monitors(_SELF(self)));
|
152
164
|
}
|
153
165
|
|
154
166
|
static VALUE
|
155
|
-
|
167
|
+
rg_monitor_geometry(VALUE self, VALUE num)
|
156
168
|
{
|
157
169
|
GdkRectangle rect;
|
158
170
|
gdk_screen_get_monitor_geometry(_SELF(self), NUM2INT(num), &rect);
|
@@ -160,7 +172,7 @@ gdkscreen_monitor_geometry(VALUE self, VALUE num)
|
|
160
172
|
}
|
161
173
|
|
162
174
|
static VALUE
|
163
|
-
|
175
|
+
rg_get_monitor(int argc, VALUE *argv, VALUE self)
|
164
176
|
{
|
165
177
|
VALUE arg1, arg2;
|
166
178
|
VALUE ret;
|
@@ -179,7 +191,7 @@ gdkscreen_get_monitor(int argc, VALUE *argv, VALUE self)
|
|
179
191
|
}
|
180
192
|
|
181
193
|
static VALUE
|
182
|
-
|
194
|
+
rg_broadcast_client_message(VALUE self, VALUE event)
|
183
195
|
{
|
184
196
|
gdk_screen_broadcast_client_message(_SELF(self), RVAL2GEV(event));
|
185
197
|
return self;
|
@@ -189,11 +201,11 @@ gdkscreen_broadcast_client_message(VALUE self, VALUE event)
|
|
189
201
|
type: String, Integer, Gdk::Color.
|
190
202
|
*/
|
191
203
|
static VALUE
|
192
|
-
|
204
|
+
rg_get_setting(int argc, VALUE *argv, VALUE self)
|
193
205
|
{
|
194
206
|
VALUE name, type;
|
195
207
|
GType gtype;
|
196
|
-
GValue val =
|
208
|
+
GValue val = G_VALUE_INIT;
|
197
209
|
gboolean ret;
|
198
210
|
VALUE value;
|
199
211
|
|
@@ -227,20 +239,14 @@ gdkscreen_set_font_options(VALUE self, VALUE options)
|
|
227
239
|
}
|
228
240
|
#endif
|
229
241
|
|
230
|
-
/* Defined as properties
|
231
|
-
void gdk_screen_set_font_options (GdkScreen *screen,
|
232
|
-
const cairo_font_options_t *options);
|
233
|
-
gdouble gdk_screen_get_resolution (GdkScreen *screen);
|
234
|
-
*/
|
235
|
-
|
236
242
|
static VALUE
|
237
|
-
|
243
|
+
rg_active_window(VALUE self)
|
238
244
|
{
|
239
245
|
return GOBJ2RVAL(gdk_screen_get_active_window(_SELF(self)));
|
240
246
|
}
|
241
247
|
|
242
248
|
static VALUE
|
243
|
-
|
249
|
+
rg_window_stack(VALUE self)
|
244
250
|
{
|
245
251
|
GList* list = gdk_screen_get_window_stack(_SELF(self));
|
246
252
|
VALUE ary = rb_ary_new();
|
@@ -264,7 +270,7 @@ child_setup(gpointer func)
|
|
264
270
|
}
|
265
271
|
|
266
272
|
static VALUE
|
267
|
-
|
273
|
+
rg_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
|
268
274
|
{
|
269
275
|
GError *err = NULL;
|
270
276
|
gboolean ret;
|
@@ -279,7 +285,7 @@ gdkscreen_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE
|
|
279
285
|
}
|
280
286
|
|
281
287
|
gargv = (gchar **)RVAL2STRV(argv);
|
282
|
-
genvp = (gchar **)
|
288
|
+
genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp);
|
283
289
|
ret = gdk_spawn_on_screen(_SELF(self),
|
284
290
|
NIL_P(working_directory) ? NULL : RVAL2CSTR(working_directory),
|
285
291
|
gargv, genvp, NUM2INT(flags),
|
@@ -289,12 +295,12 @@ gdkscreen_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE
|
|
289
295
|
g_free(genvp);
|
290
296
|
if (!ret)
|
291
297
|
RAISE_GERROR(err);
|
292
|
-
|
298
|
+
|
293
299
|
return INT2NUM(child_pid);
|
294
300
|
}
|
295
301
|
|
296
302
|
static VALUE
|
297
|
-
|
303
|
+
rg_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags)
|
298
304
|
{
|
299
305
|
GError *err = NULL;
|
300
306
|
gboolean ret;
|
@@ -310,7 +316,7 @@ gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE
|
|
310
316
|
}
|
311
317
|
|
312
318
|
gargv = (gchar **)RVAL2STRV(argv);
|
313
|
-
genvp = (gchar **)
|
319
|
+
genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp);
|
314
320
|
ret = gdk_spawn_on_screen_with_pipes(_SELF(self),
|
315
321
|
NIL_P(working_directory) ? NULL : RVAL2CSTR(working_directory),
|
316
322
|
gargv, genvp, NUM2INT(flags),
|
@@ -322,7 +328,7 @@ gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE
|
|
322
328
|
g_free(genvp);
|
323
329
|
if (!ret)
|
324
330
|
RAISE_GERROR(err);
|
325
|
-
|
331
|
+
|
326
332
|
return rb_ary_new3(4, INT2NUM(child_pid),
|
327
333
|
rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_input)),
|
328
334
|
rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_output)),
|
@@ -330,14 +336,14 @@ gdkscreen_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE
|
|
330
336
|
}
|
331
337
|
|
332
338
|
static VALUE
|
333
|
-
|
339
|
+
rg_spawn_command_line_on_screen(G_GNUC_UNUSED VALUE self, VALUE command_line)
|
334
340
|
{
|
335
341
|
GError *err = NULL;
|
336
342
|
VALUE ret;
|
337
343
|
|
338
344
|
ret = CBOOL2RVAL(g_spawn_command_line_async(RVAL2CSTR(command_line), &err));
|
339
345
|
if (!ret) RAISE_GERROR(err);
|
340
|
-
|
346
|
+
|
341
347
|
return ret;
|
342
348
|
}
|
343
349
|
#endif
|
@@ -346,24 +352,24 @@ gdkscreen_spawn_command_line_on_screen(VALUE self, VALUE command_line)
|
|
346
352
|
#ifdef GDK_WINDOWING_X11
|
347
353
|
#include <gdk/gdkx.h>
|
348
354
|
static VALUE
|
349
|
-
|
355
|
+
rg_xnumber(VALUE self)
|
350
356
|
{
|
351
357
|
return INT2NUM(GDK_SCREEN_XNUMBER(_SELF(self)));
|
352
358
|
}
|
353
359
|
static VALUE
|
354
|
-
|
360
|
+
rg_supports_net_wm_hint_p(VALUE self, VALUE property)
|
355
361
|
{
|
356
362
|
return CBOOL2RVAL(gdk_x11_screen_supports_net_wm_hint(_SELF(self),
|
357
363
|
RVAL2ATOM(property)));
|
358
364
|
}
|
359
365
|
|
360
366
|
static VALUE
|
361
|
-
|
367
|
+
rg_window_manager_name(VALUE self)
|
362
368
|
{
|
363
369
|
return CSTR2RVAL(gdk_x11_screen_get_window_manager_name(_SELF(self)));
|
364
370
|
}
|
365
371
|
static VALUE
|
366
|
-
|
372
|
+
rg_screen_number(VALUE self)
|
367
373
|
{
|
368
374
|
return INT2NUM(gdk_x11_screen_get_screen_number(_SELF(self)));
|
369
375
|
}
|
@@ -372,67 +378,67 @@ gdkscreen_get_screen_number(VALUE self)
|
|
372
378
|
#endif
|
373
379
|
|
374
380
|
void
|
375
|
-
Init_gtk_gdk_screen()
|
381
|
+
Init_gtk_gdk_screen(VALUE mGdk)
|
376
382
|
{
|
377
383
|
#if GTK_CHECK_VERSION(2,2,0)
|
378
|
-
VALUE
|
384
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_SCREEN, "Screen", mGdk);
|
379
385
|
|
380
386
|
id_new = rb_intern("new");
|
381
387
|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
G_DEF_SETTER(
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
388
|
+
RG_DEF_SMETHOD(default, 0);
|
389
|
+
RG_DEF_METHOD(default_colormap, 0);
|
390
|
+
RG_DEF_METHOD(set_default_colormap, 1);
|
391
|
+
G_DEF_SETTER(RG_TARGET_NAMESPACE, "default_colormap");
|
392
|
+
RG_DEF_METHOD(system_colormap, 0);
|
393
|
+
RG_DEF_METHOD(system_visual, 0);
|
394
|
+
RG_DEF_METHOD(rgb_colormap, 0);
|
395
|
+
RG_DEF_METHOD(rgb_visual, 0);
|
390
396
|
#if GTK_CHECK_VERSION(2,8,0)
|
391
|
-
|
392
|
-
|
397
|
+
RG_DEF_METHOD(rgba_colormap, 0);
|
398
|
+
RG_DEF_METHOD(rgba_visual, 0);
|
393
399
|
#endif
|
394
400
|
#if GTK_CHECK_VERSION(2,10,0)
|
395
|
-
|
401
|
+
RG_DEF_METHOD_P(composited, 0);
|
396
402
|
#endif
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
403
|
+
RG_DEF_METHOD(root_window, 0);
|
404
|
+
RG_DEF_METHOD(display, 0);
|
405
|
+
RG_DEF_METHOD(number, 0);
|
406
|
+
RG_DEF_METHOD(width, 0);
|
407
|
+
RG_DEF_METHOD(height, 0);
|
408
|
+
RG_DEF_METHOD(width_mm, 0);
|
409
|
+
RG_DEF_METHOD(height_mm, 0);
|
410
|
+
RG_DEF_METHOD(visuals, 0);
|
411
|
+
RG_DEF_METHOD(toplevel_windows, 0);
|
412
|
+
RG_DEF_METHOD(display_name, 0);
|
413
|
+
RG_DEF_METHOD(n_monitors, 0);
|
414
|
+
RG_DEF_METHOD(monitor_geometry, 1);
|
415
|
+
RG_DEF_METHOD(get_monitor, -1);
|
416
|
+
RG_DEF_METHOD(broadcast_client_message, 1);
|
417
|
+
RG_DEF_METHOD(get_setting, -1);
|
412
418
|
#if GTK_CHECK_VERSION(2,10,0)
|
413
419
|
#ifdef HAVE_RB_CAIRO_H
|
414
|
-
G_REPLACE_GET_PROPERTY(
|
415
|
-
G_REPLACE_SET_PROPERTY(
|
420
|
+
G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_get_font_options, 0);
|
421
|
+
G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_set_font_options, 1);
|
416
422
|
#endif
|
417
|
-
|
418
|
-
|
423
|
+
RG_DEF_METHOD(active_window, 0);
|
424
|
+
RG_DEF_METHOD(window_stack, 0);
|
419
425
|
#endif
|
420
426
|
|
421
427
|
#if GTK_CHECK_VERSION(2,4,0)
|
422
|
-
|
423
|
-
|
424
|
-
|
428
|
+
RG_DEF_METHOD(spawn_on_screen, 4);
|
429
|
+
RG_DEF_METHOD(spawn_on_screen_with_pipes, 4);
|
430
|
+
RG_DEF_METHOD(spawn_command_line_on_screen, 1);
|
425
431
|
#endif
|
426
432
|
|
427
433
|
#ifdef GDK_WINDOWING_X11
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
434
|
+
RG_DEF_METHOD(xnumber, 0);
|
435
|
+
RG_DEF_METHOD_P(supports_net_wm_hint, 0);
|
436
|
+
RG_DEF_METHOD(window_manager_name, 0);
|
437
|
+
RG_DEF_METHOD(screen_number, 0);
|
432
438
|
#endif
|
433
439
|
|
434
|
-
|
440
|
+
#ifdef GDK_WINDOWING_X11
|
435
441
|
G_DEF_CLASS3("GdkScreenX11", "ScreenX11", mGdk);
|
436
|
-
|
442
|
+
#endif
|
437
443
|
#endif
|
438
444
|
}
|