gtk2 0.90.7 → 0.90.8
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +62 -0
- data/ext/gtk2/extconf.rb +2 -2
- data/ext/gtk2/rbgdk.c +30 -61
- data/ext/gtk2/rbgdkatom.c +6 -14
- data/ext/gtk2/rbgdkcairo.c +4 -8
- data/ext/gtk2/rbgdkcolor.c +11 -27
- data/ext/gtk2/rbgdkcolormap.c +8 -16
- data/ext/gtk2/rbgdkcursor.c +5 -12
- data/ext/gtk2/rbgdkdevice.c +16 -32
- data/ext/gtk2/rbgdkdisplay.c +49 -100
- data/ext/gtk2/rbgdkdisplaymanager.c +3 -6
- data/ext/gtk2/rbgdkdragcontext.c +21 -48
- data/ext/gtk2/rbgdkdraw.c +27 -60
- data/ext/gtk2/rbgdkevent.c +51 -113
- data/ext/gtk2/rbgdkgc.c +35 -70
- data/ext/gtk2/rbgdkgeometry.c +24 -50
- data/ext/gtk2/rbgdkimage.c +14 -28
- data/ext/gtk2/rbgdkinput.c +3 -8
- data/ext/gtk2/rbgdkkeymap.c +7 -14
- data/ext/gtk2/rbgdkkeyval.c +9 -18
- data/ext/gtk2/rbgdkpango.c +8 -18
- data/ext/gtk2/rbgdkpangorenderer.c +7 -18
- data/ext/gtk2/rbgdkpixbuf.c +5 -20
- data/ext/gtk2/rbgdkpixmap.c +9 -24
- data/ext/gtk2/rbgdkproperty.c +8 -28
- data/ext/gtk2/rbgdkrectangle.c +12 -24
- data/ext/gtk2/rbgdkregion.c +15 -33
- data/ext/gtk2/rbgdkrgb.c +11 -26
- data/ext/gtk2/rbgdkscreen.c +37 -78
- data/ext/gtk2/rbgdkselection.c +5 -16
- data/ext/gtk2/rbgdkthreads.c +4 -8
- data/ext/gtk2/rbgdktimecoord.c +5 -10
- data/ext/gtk2/rbgdkvisual.c +25 -50
- data/ext/gtk2/rbgdkwindow.c +102 -211
- data/ext/gtk2/rbgdkwindowattr.c +16 -32
- data/ext/gtk2/rbgdkx11.c +5 -12
- data/ext/gtk2/rbgtk.c +9 -10
- data/ext/gtk2/rbgtkaboutdialog.c +5 -12
- data/ext/gtk2/rbgtkaccelerator.c +6 -12
- data/ext/gtk2/rbgtkaccelgroup.c +14 -32
- data/ext/gtk2/rbgtkaccelgroupentry.c +4 -8
- data/ext/gtk2/rbgtkaccelkey.c +7 -14
- data/ext/gtk2/rbgtkaccellabel.c +3 -6
- data/ext/gtk2/rbgtkaccelmap.c +12 -28
- data/ext/gtk2/rbgtkaccessible.c +1 -2
- data/ext/gtk2/rbgtkaction.c +20 -42
- data/ext/gtk2/rbgtkactiongroup.c +15 -39
- data/ext/gtk2/rbgtkadjustment.c +14 -28
- data/ext/gtk2/rbgtkalignment.c +4 -8
- data/ext/gtk2/rbgtkallocation.c +13 -26
- data/ext/gtk2/rbgtkarrow.c +2 -4
- data/ext/gtk2/rbgtkaspectframe.c +2 -4
- data/ext/gtk2/rbgtkassistant.c +23 -47
- data/ext/gtk2/rbgtkbbox.c +2 -4
- data/ext/gtk2/rbgtkbin.c +1 -2
- data/ext/gtk2/rbgtkbindingset.c +8 -18
- data/ext/gtk2/rbgtkborder.c +4 -8
- data/ext/gtk2/rbgtkbox.c +8 -23
- data/ext/gtk2/rbgtkbutton.c +8 -18
- data/ext/gtk2/rbgtkcalendar.c +11 -24
- data/ext/gtk2/rbgtkcelleditable.c +3 -6
- data/ext/gtk2/rbgtkcelllayout.c +9 -22
- data/ext/gtk2/rbgtkcellrenderer.c +8 -19
- data/ext/gtk2/rbgtkcellrendereraccel.c +1 -2
- data/ext/gtk2/rbgtkcellrenderercombo.c +1 -2
- data/ext/gtk2/rbgtkcellrendererpixbuf.c +1 -2
- data/ext/gtk2/rbgtkcellrendererprogress.c +1 -2
- data/ext/gtk2/rbgtkcellrendererspin.c +1 -2
- data/ext/gtk2/rbgtkcellrendererspinner.c +35 -0
- data/ext/gtk2/rbgtkcellrenderertext.c +2 -4
- data/ext/gtk2/rbgtkcellrenderertoggle.c +1 -2
- data/ext/gtk2/rbgtkcellview.c +6 -14
- data/ext/gtk2/rbgtkcheckbutton.c +1 -4
- data/ext/gtk2/rbgtkcheckmenuitem.c +2 -6
- data/ext/gtk2/rbgtkclipboard.c +30 -75
- data/ext/gtk2/rbgtkcolorbutton.c +1 -4
- data/ext/gtk2/rbgtkcolorsel.c +10 -24
- data/ext/gtk2/rbgtkcolorselectiondialog.c +5 -12
- data/ext/gtk2/rbgtkcombo.c +7 -16
- data/ext/gtk2/rbgtkcombobox.c +14 -32
- data/ext/gtk2/rbgtkcomboboxentry.c +1 -4
- data/ext/gtk2/rbgtkcontainer.c +27 -70
- data/ext/gtk2/rbgtkcurve.c +6 -12
- data/ext/gtk2/rbgtkdialog.c +14 -32
- data/ext/gtk2/rbgtkdrag.c +31 -68
- data/ext/gtk2/rbgtkdrawingarea.c +1 -2
- data/ext/gtk2/rbgtkeditable.c +13 -26
- data/ext/gtk2/rbgtkentry.c +7 -14
- data/ext/gtk2/rbgtkentrycompletion.c +10 -23
- data/ext/gtk2/rbgtkeventbox.c +1 -2
- data/ext/gtk2/rbgtkexpander.c +1 -4
- data/ext/gtk2/rbgtkfilechooser.c +30 -60
- data/ext/gtk2/rbgtkfilechooserbutton.c +1 -4
- data/ext/gtk2/rbgtkfilechooserdialog.c +1 -4
- data/ext/gtk2/rbgtkfilechooserwidget.c +1 -4
- data/ext/gtk2/rbgtkfilefilter.c +10 -21
- data/ext/gtk2/rbgtkfilesel.c +14 -30
- data/ext/gtk2/rbgtkfixed.c +5 -10
- data/ext/gtk2/rbgtkfontbutton.c +1 -4
- data/ext/gtk2/rbgtkfontselection.c +1 -2
- data/ext/gtk2/rbgtkfontselectiondialog.c +9 -20
- data/ext/gtk2/rbgtkframe.c +3 -8
- data/ext/gtk2/rbgtkgamma.c +3 -6
- data/ext/gtk2/rbgtkhandlebox.c +2 -4
- data/ext/gtk2/rbgtkhbbox.c +1 -2
- data/ext/gtk2/rbgtkhbox.c +1 -4
- data/ext/gtk2/rbgtkhpaned.c +1 -2
- data/ext/gtk2/rbgtkhruler.c +1 -2
- data/ext/gtk2/rbgtkhscale.c +1 -4
- data/ext/gtk2/rbgtkhscrollbar.c +1 -4
- data/ext/gtk2/rbgtkhseparator.c +1 -2
- data/ext/gtk2/rbgtkiconfactory.c +6 -12
- data/ext/gtk2/rbgtkiconinfo.c +8 -16
- data/ext/gtk2/rbgtkiconset.c +4 -12
- data/ext/gtk2/rbgtkiconsize.c +6 -12
- data/ext/gtk2/rbgtkiconsource.c +17 -34
- data/ext/gtk2/rbgtkicontheme.c +16 -32
- data/ext/gtk2/rbgtkiconview.c +23 -50
- data/ext/gtk2/rbgtkimage.c +3 -10
- data/ext/gtk2/rbgtkimagemenuitem.c +1 -4
- data/ext/gtk2/rbgtkimcontext.c +11 -22
- data/ext/gtk2/rbgtkimcontextsimple.c +2 -4
- data/ext/gtk2/rbgtkimmulticontext.c +2 -4
- data/ext/gtk2/rbgtkinputdialog.c +1 -2
- data/ext/gtk2/rbgtkinvisible.c +3 -8
- data/ext/gtk2/rbgtkitem.c +3 -6
- data/ext/gtk2/rbgtkitemfactory.c +13 -34
- data/ext/gtk2/rbgtklabel.c +10 -26
- data/ext/gtk2/rbgtklayout.c +6 -14
- data/ext/gtk2/rbgtklinkbutton.c +3 -10
- data/ext/gtk2/rbgtkliststore.c +15 -36
- data/ext/gtk2/rbgtkmain.c +32 -68
- data/ext/gtk2/rbgtkmenu.c +21 -46
- data/ext/gtk2/rbgtkmenubar.c +1 -2
- data/ext/gtk2/rbgtkmenuitem.c +12 -26
- data/ext/gtk2/rbgtkmenushell.c +9 -18
- data/ext/gtk2/rbgtkmenutoolbutton.c +2 -8
- data/ext/gtk2/rbgtkmessagedialog.c +4 -10
- data/ext/gtk2/rbgtkmisc.c +4 -8
- data/ext/gtk2/rbgtknotebook.c +53 -79
- data/ext/gtk2/rbgtkobject.c +7 -14
- data/ext/gtk2/rbgtkoptionmenu.c +4 -8
- data/ext/gtk2/rbgtkpaned.c +10 -20
- data/ext/gtk2/rbgtkplug.c +3 -8
- data/ext/gtk2/rbgtkprintsettings.c +1 -4
- data/ext/gtk2/rbgtkprogressbar.c +2 -4
- data/ext/gtk2/rbgtkradioaction.c +4 -8
- data/ext/gtk2/rbgtkradiobutton.c +3 -8
- data/ext/gtk2/rbgtkradiomenuitem.c +4 -10
- data/ext/gtk2/rbgtkradiotoolbutton.c +3 -8
- data/ext/gtk2/rbgtkrange.c +4 -8
- data/ext/gtk2/rbgtkrc.c +16 -34
- data/ext/gtk2/rbgtkrcstyle.c +13 -26
- data/ext/gtk2/rbgtkrecentaction.c +1 -4
- data/ext/gtk2/rbgtkrecentchooser.c +18 -38
- data/ext/gtk2/rbgtkrecentchooserdialog.c +1 -4
- data/ext/gtk2/rbgtkrecentchoosermenu.c +1 -4
- data/ext/gtk2/rbgtkrecentchooserwidget.c +1 -4
- data/ext/gtk2/rbgtkrecentdata.c +7 -14
- data/ext/gtk2/rbgtkrecentfilter.c +14 -29
- data/ext/gtk2/rbgtkrecentfilterinfo.c +11 -22
- data/ext/gtk2/rbgtkrecentinfo.c +21 -42
- data/ext/gtk2/rbgtkrecentmanager.c +11 -24
- data/ext/gtk2/rbgtkruler.c +6 -12
- data/ext/gtk2/rbgtkscale.c +2 -4
- data/ext/gtk2/rbgtkscalebutton.c +6 -14
- data/ext/gtk2/rbgtkscrolledwindow.c +9 -20
- data/ext/gtk2/rbgtkselection.c +10 -22
- data/ext/gtk2/rbgtkselectiondata.c +19 -41
- data/ext/gtk2/rbgtkseparatormenuitem.c +1 -2
- data/ext/gtk2/rbgtkseparatortoolitem.c +1 -2
- data/ext/gtk2/rbgtksettings.c +10 -22
- data/ext/gtk2/rbgtksizegroup.c +4 -8
- data/ext/gtk2/rbgtksocket.c +4 -8
- data/ext/gtk2/rbgtkspinbutton.c +9 -20
- data/ext/gtk2/rbgtkspinner.c +51 -0
- data/ext/gtk2/rbgtkstatusbar.c +7 -14
- data/ext/gtk2/rbgtkstatusicon.c +5 -10
- data/ext/gtk2/rbgtkstock.c +5 -13
- data/ext/gtk2/rbgtkstyle.c +51 -139
- data/ext/gtk2/rbgtktable.c +14 -33
- data/ext/gtk2/rbgtktargetlist.c +9 -18
- data/ext/gtk2/rbgtktearoffmenuitem.c +1 -2
- data/ext/gtk2/rbgtktextappearance.c +11 -22
- data/ext/gtk2/rbgtktextattributes.c +16 -32
- data/ext/gtk2/rbgtktextbuffer.c +69 -162
- data/ext/gtk2/rbgtktextchild.c +3 -8
- data/ext/gtk2/rbgtktextiter.c +34 -81
- data/ext/gtk2/rbgtktextmark.c +7 -14
- data/ext/gtk2/rbgtktexttag.c +4 -10
- data/ext/gtk2/rbgtktexttagtable.c +7 -15
- data/ext/gtk2/rbgtktextview.c +30 -62
- data/ext/gtk2/rbgtktoggleaction.c +4 -8
- data/ext/gtk2/rbgtktogglebutton.c +4 -10
- data/ext/gtk2/rbgtktoggletoolbutton.c +3 -8
- data/ext/gtk2/rbgtktoolbar.c +20 -46
- data/ext/gtk2/rbgtktoolbutton.c +1 -4
- data/ext/gtk2/rbgtktoolitem.c +16 -34
- data/ext/gtk2/rbgtktooltip.c +5 -10
- data/ext/gtk2/rbgtktooltips.c +7 -14
- data/ext/gtk2/rbgtktreeiter.c +14 -29
- data/ext/gtk2/rbgtktreemodel.c +16 -37
- data/ext/gtk2/rbgtktreemodelfilter.c +13 -36
- data/ext/gtk2/rbgtktreemodelsort.c +8 -16
- data/ext/gtk2/rbgtktreepath.c +13 -28
- data/ext/gtk2/rbgtktreerowreference.c +9 -20
- data/ext/gtk2/rbgtktreeselection.c +20 -47
- data/ext/gtk2/rbgtktreesortable.c +7 -18
- data/ext/gtk2/rbgtktreestore.c +17 -40
- data/ext/gtk2/rbgtktreeview.c +58 -138
- data/ext/gtk2/rbgtktreeviewcolumn.c +20 -46
- data/ext/gtk2/rbgtkuimanager.c +12 -26
- data/ext/gtk2/rbgtkvbbox.c +1 -2
- data/ext/gtk2/rbgtkvbox.c +1 -4
- data/ext/gtk2/rbgtkviewport.c +1 -2
- data/ext/gtk2/rbgtkvolumebutton.c +1 -2
- data/ext/gtk2/rbgtkvpaned.c +1 -2
- data/ext/gtk2/rbgtkvruler.c +1 -2
- data/ext/gtk2/rbgtkvscale.c +1 -4
- data/ext/gtk2/rbgtkvscrollbar.c +1 -4
- data/ext/gtk2/rbgtkvseparator.c +1 -2
- data/ext/gtk2/rbgtkwidget.c +126 -264
- data/ext/gtk2/rbgtkwindow.c +69 -142
- data/ext/gtk2/rbgtkwindowgroup.c +3 -6
- data/lib/gtk2/base.rb +1 -2
- data/sample/gtk-demo/main.rb +2 -0
- data/sample/gtk-demo/textview.rb +1 -0
- metadata +15 -17
- data/ext/gtk2/Makefile +0 -169
- data/ext/gtk2/rbgdkkeysyms.h +0 -2174
- data/ext/gtk2/rbgtkinits.c +0 -473
- data/ext/gtk2/ruby-gtk2.pc +0 -3
data/ext/gtk2/rbgdkevent.c
CHANGED
@@ -25,8 +25,7 @@ static VALUE gdkevents[34];
|
|
25
25
|
/***********************************************/
|
26
26
|
|
27
27
|
VALUE
|
28
|
-
make_gdkevent(ev)
|
29
|
-
GdkEvent *ev;
|
28
|
+
make_gdkevent(GdkEvent *ev)
|
30
29
|
{
|
31
30
|
VALUE obj;
|
32
31
|
if (ev == NULL) return Qnil;
|
@@ -37,8 +36,7 @@ make_gdkevent(ev)
|
|
37
36
|
}
|
38
37
|
|
39
38
|
GdkEvent*
|
40
|
-
get_gdkevent(event)
|
41
|
-
VALUE event;
|
39
|
+
get_gdkevent(VALUE event)
|
42
40
|
{
|
43
41
|
return NIL_P(event) ? NULL : RVAL2BOXED(event, GDK_TYPE_EVENT);
|
44
42
|
}
|
@@ -46,14 +44,12 @@ get_gdkevent(event)
|
|
46
44
|
/***********************************************/
|
47
45
|
#define ATTR_STR(type, name)\
|
48
46
|
static VALUE \
|
49
|
-
gdkevent ## type ## _ ## name (self)\
|
50
|
-
VALUE self;\
|
47
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
51
48
|
{\
|
52
49
|
return CSTR2RVAL(get_gdkevent(self)->type.name);\
|
53
50
|
}\
|
54
51
|
static VALUE \
|
55
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
56
|
-
VALUE self, val;\
|
52
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
57
53
|
{\
|
58
54
|
get_gdkevent(self)->type.name = RVAL2CSTR(val);\
|
59
55
|
return self;\
|
@@ -61,14 +57,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
61
57
|
|
62
58
|
#define ATTR_INT(type, name)\
|
63
59
|
static VALUE \
|
64
|
-
gdkevent ## type ## _ ## name (self)\
|
65
|
-
VALUE self;\
|
60
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
66
61
|
{\
|
67
62
|
return INT2NUM(get_gdkevent(self)->type.name);\
|
68
63
|
}\
|
69
64
|
static VALUE \
|
70
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
71
|
-
VALUE self, val;\
|
65
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
72
66
|
{\
|
73
67
|
get_gdkevent(self)->type.name = NUM2INT(val);\
|
74
68
|
return self;\
|
@@ -76,14 +70,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
76
70
|
|
77
71
|
#define ATTR_UINT(type, name)\
|
78
72
|
static VALUE \
|
79
|
-
gdkevent ## type ## _ ## name (self)\
|
80
|
-
VALUE self;\
|
73
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
81
74
|
{\
|
82
75
|
return UINT2NUM(get_gdkevent(self)->type.name);\
|
83
76
|
}\
|
84
77
|
static VALUE \
|
85
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
86
|
-
VALUE self, val;\
|
78
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
87
79
|
{\
|
88
80
|
get_gdkevent(self)->type.name = NUM2UINT(val);\
|
89
81
|
return self;\
|
@@ -91,14 +83,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
91
83
|
|
92
84
|
#define ATTR_FLOAT(type, name)\
|
93
85
|
static VALUE \
|
94
|
-
gdkevent ## type ## _ ## name (self)\
|
95
|
-
VALUE self;\
|
86
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
96
87
|
{\
|
97
88
|
return rb_float_new(get_gdkevent(self)->type.name);\
|
98
89
|
}\
|
99
90
|
static VALUE \
|
100
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
101
|
-
VALUE self, val;\
|
91
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
102
92
|
{\
|
103
93
|
get_gdkevent(self)->type.name = NUM2DBL(val);\
|
104
94
|
return self;\
|
@@ -106,14 +96,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
106
96
|
|
107
97
|
#define ATTR_GOBJ(type, name)\
|
108
98
|
static VALUE \
|
109
|
-
gdkevent ## type ## _ ## name (self)\
|
110
|
-
VALUE self;\
|
99
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
111
100
|
{\
|
112
101
|
return GOBJ2RVAL(get_gdkevent(self)->type.name);\
|
113
102
|
}\
|
114
103
|
static VALUE \
|
115
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
116
|
-
VALUE self, val;\
|
104
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
117
105
|
{\
|
118
106
|
GdkEvent *event;\
|
119
107
|
event = get_gdkevent(self);\
|
@@ -127,14 +115,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
127
115
|
|
128
116
|
#define ATTR_BOOL(type, name)\
|
129
117
|
static VALUE \
|
130
|
-
gdkevent ## type ## _ ## name (self)\
|
131
|
-
VALUE self;\
|
118
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
132
119
|
{\
|
133
120
|
return CBOOL2RVAL(get_gdkevent(self)->type.name);\
|
134
121
|
}\
|
135
122
|
static VALUE \
|
136
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
137
|
-
VALUE self, val;\
|
123
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
138
124
|
{\
|
139
125
|
get_gdkevent(self)->type.name = RVAL2CBOOL(val);\
|
140
126
|
return self;\
|
@@ -142,15 +128,13 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
142
128
|
|
143
129
|
#define ATTR_ATOM(type, name)\
|
144
130
|
static VALUE \
|
145
|
-
gdkevent ## type ## _ ## name (self)\
|
146
|
-
VALUE self;\
|
131
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
147
132
|
{\
|
148
133
|
GdkAtom atom = get_gdkevent(self)->type.name;\
|
149
134
|
return BOXED2RVAL(atom, GDK_TYPE_ATOM);\
|
150
135
|
}\
|
151
136
|
static VALUE \
|
152
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
153
|
-
VALUE self, val;\
|
137
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
154
138
|
{\
|
155
139
|
get_gdkevent(self)->type.name = RVAL2ATOM(val);\
|
156
140
|
return self;\
|
@@ -158,14 +142,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
158
142
|
|
159
143
|
#define ATTR_FLAGS(type, name, gtype)\
|
160
144
|
static VALUE \
|
161
|
-
gdkevent ## type ## _ ## name (self)\
|
162
|
-
VALUE self;\
|
145
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
163
146
|
{\
|
164
147
|
return GFLAGS2RVAL(get_gdkevent(self)->type.name, gtype);\
|
165
148
|
}\
|
166
149
|
static VALUE \
|
167
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
168
|
-
VALUE self, val;\
|
150
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
169
151
|
{\
|
170
152
|
get_gdkevent(self)->type.name = RVAL2GFLAGS(val, gtype);\
|
171
153
|
return self;\
|
@@ -173,14 +155,12 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
173
155
|
|
174
156
|
#define ATTR_ENUM(type, name, gtype)\
|
175
157
|
static VALUE \
|
176
|
-
gdkevent ## type ## _ ## name (self)\
|
177
|
-
VALUE self;\
|
158
|
+
gdkevent ## type ## _ ## name (VALUE self)\
|
178
159
|
{\
|
179
160
|
return GENUM2RVAL(get_gdkevent(self)->type.name, gtype);\
|
180
161
|
}\
|
181
162
|
static VALUE \
|
182
|
-
gdkevent ## type ## _set_ ## name (self, val)\
|
183
|
-
VALUE self, val;\
|
163
|
+
gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\
|
184
164
|
{\
|
185
165
|
get_gdkevent(self)->type.name = RVAL2GENUM(val, gtype);\
|
186
166
|
return self;\
|
@@ -188,8 +168,7 @@ gdkevent ## type ## _set_ ## name (self, val)\
|
|
188
168
|
|
189
169
|
#define ATTR_AXES(type, gdkklass) \
|
190
170
|
static VALUE \
|
191
|
-
gdkevent ##type ## _axes(self)\
|
192
|
-
VALUE self;\
|
171
|
+
gdkevent ##type ## _axes(VALUE self)\
|
193
172
|
{\
|
194
173
|
gdkklass type = get_gdkevent(self)->type;\
|
195
174
|
return type.axes ? rb_ary_new3(2, \
|
@@ -197,8 +176,7 @@ gdkevent ##type ## _axes(self)\
|
|
197
176
|
rb_float_new(type.axes[1])) : Qnil;\
|
198
177
|
} \
|
199
178
|
static VALUE \
|
200
|
-
gdkevent ## type ## _set_axes(self, x, y)\
|
201
|
-
VALUE self, x, y;\
|
179
|
+
gdkevent ## type ## _set_axes(VALUE self, VALUE x, VALUE y)\
|
202
180
|
{\
|
203
181
|
gdkklass val = get_gdkevent(self)->type;\
|
204
182
|
val.axes[0] = NUM2DBL(x);\
|
@@ -215,10 +193,7 @@ gdkevent ## type ## _set_axes(self, x, y)\
|
|
215
193
|
#if GTK_CHECK_VERSION(2,2,0)
|
216
194
|
#define GDKEVENT_INIT(type, default_gtype) \
|
217
195
|
static VALUE \
|
218
|
-
gdkevent ## type ## _initialize(argc, argv, self)\
|
219
|
-
int argc;\
|
220
|
-
VALUE *argv;\
|
221
|
-
VALUE self;\
|
196
|
+
gdkevent ## type ## _initialize(int argc, VALUE *argv, VALUE self)\
|
222
197
|
{\
|
223
198
|
VALUE type;\
|
224
199
|
GdkEventType gtype;\
|
@@ -236,10 +211,7 @@ gdkevent ## type ## _initialize(argc, argv, self)\
|
|
236
211
|
#else
|
237
212
|
#define GDKEVENT_INIT(type, default_gtype) \
|
238
213
|
static VALUE \
|
239
|
-
gdkevent ## type ## _initialize(argc, argv, self)\
|
240
|
-
int argc;\
|
241
|
-
VALUE *argv;\
|
242
|
-
VALUE self;\
|
214
|
+
gdkevent ## type ## _initialize(int argc, VALUE *argv, VALUE self)\
|
243
215
|
{\
|
244
216
|
rb_raise(rb_eRuntimeError, "Gdk::Event.new is not supported in this environment.");\
|
245
217
|
return Qnil;\
|
@@ -253,29 +225,25 @@ gdkevent ## type ## _initialize(argc, argv, self)\
|
|
253
225
|
|
254
226
|
/* GdkEvent Singleton Methods */
|
255
227
|
static VALUE
|
256
|
-
gdkevent_s_events_pending(self)
|
257
|
-
VALUE self;
|
228
|
+
gdkevent_s_events_pending(VALUE self)
|
258
229
|
{
|
259
230
|
return CBOOL2RVAL(gdk_events_pending());
|
260
231
|
}
|
261
232
|
|
262
233
|
static VALUE
|
263
|
-
gdkevent_s_peek(self)
|
264
|
-
VALUE self;
|
234
|
+
gdkevent_s_peek(VALUE self)
|
265
235
|
{
|
266
236
|
return make_gdkevent(gdk_event_peek());
|
267
237
|
}
|
268
238
|
|
269
239
|
static VALUE
|
270
|
-
gdkevent_s_get(self)
|
271
|
-
VALUE self;
|
240
|
+
gdkevent_s_get(VALUE self)
|
272
241
|
{
|
273
242
|
return make_gdkevent(gdk_event_get());
|
274
243
|
}
|
275
244
|
|
276
245
|
static VALUE
|
277
|
-
gdkevent_s_get_graphics_expose(self, window)
|
278
|
-
VALUE self, window;
|
246
|
+
gdkevent_s_get_graphics_expose(VALUE self, VALUE window)
|
279
247
|
{
|
280
248
|
return make_gdkevent(gdk_event_get_graphics_expose(GDK_WINDOW(RVAL2GOBJ(window))));
|
281
249
|
}
|
@@ -283,8 +251,7 @@ gdkevent_s_get_graphics_expose(self, window)
|
|
283
251
|
/* GdkEvent */
|
284
252
|
#if GTK_CHECK_VERSION(2,2,0)
|
285
253
|
static VALUE
|
286
|
-
gdkevent_initialize(self, type)
|
287
|
-
VALUE self, type;
|
254
|
+
gdkevent_initialize(VALUE self, VALUE type)
|
288
255
|
{
|
289
256
|
GdkEventType gtype = RVAL2GENUM(type, GDK_TYPE_EVENT_TYPE);
|
290
257
|
if (RBASIC(self)->klass != gdkevents[gtype])
|
@@ -296,15 +263,13 @@ gdkevent_initialize(self, type)
|
|
296
263
|
#endif
|
297
264
|
|
298
265
|
static VALUE
|
299
|
-
gdkevent_type(self)
|
300
|
-
VALUE self;
|
266
|
+
gdkevent_type(VALUE self)
|
301
267
|
{
|
302
268
|
return GENUM2RVAL(get_gdkevent(self)->type, GDK_TYPE_EVENT_TYPE);
|
303
269
|
}
|
304
270
|
|
305
271
|
static VALUE
|
306
|
-
gdkevent_put(self)
|
307
|
-
VALUE self;
|
272
|
+
gdkevent_put(VALUE self)
|
308
273
|
{
|
309
274
|
gdk_event_put(get_gdkevent(self));
|
310
275
|
return self;
|
@@ -317,8 +282,7 @@ gboolean gdk_event_get_state (GdkEvent *event,
|
|
317
282
|
*/
|
318
283
|
|
319
284
|
static VALUE
|
320
|
-
gdkevent_get_axis(self, axis_use)
|
321
|
-
VALUE self, axis_use;
|
285
|
+
gdkevent_get_axis(VALUE self, VALUE axis_use)
|
322
286
|
{
|
323
287
|
gdouble value;
|
324
288
|
gboolean ret = gdk_event_get_axis(get_gdkevent(self),
|
@@ -327,8 +291,7 @@ gdkevent_get_axis(self, axis_use)
|
|
327
291
|
}
|
328
292
|
|
329
293
|
static VALUE
|
330
|
-
gdkevent_get_coords(self)
|
331
|
-
VALUE self;
|
294
|
+
gdkevent_get_coords(VALUE self)
|
332
295
|
{
|
333
296
|
gdouble x_win, y_win;
|
334
297
|
gboolean ret = gdk_event_get_coords(get_gdkevent(self), &x_win, &y_win);
|
@@ -337,8 +300,7 @@ gdkevent_get_coords(self)
|
|
337
300
|
}
|
338
301
|
|
339
302
|
static VALUE
|
340
|
-
gdkevent_get_root_coords(self)
|
341
|
-
VALUE self;
|
303
|
+
gdkevent_get_root_coords(VALUE self)
|
342
304
|
{
|
343
305
|
gdouble x_root, y_root;
|
344
306
|
gboolean ret = gdk_event_get_root_coords(get_gdkevent(self), &x_root, &y_root);
|
@@ -347,16 +309,13 @@ gdkevent_get_root_coords(self)
|
|
347
309
|
}
|
348
310
|
|
349
311
|
static void
|
350
|
-
handler_func(event, func)
|
351
|
-
GdkEvent* event;
|
352
|
-
gpointer func;
|
312
|
+
handler_func(GdkEvent *event, gpointer func)
|
353
313
|
{
|
354
314
|
rb_funcall((VALUE)func, id_call, 1, make_gdkevent(event));
|
355
315
|
}
|
356
316
|
|
357
317
|
static VALUE
|
358
|
-
gdkevent_s_handler_set(self)
|
359
|
-
VALUE self;
|
318
|
+
gdkevent_s_handler_set(VALUE self)
|
360
319
|
{
|
361
320
|
volatile VALUE func = rb_block_proc();
|
362
321
|
G_RELATIVE(self, func);
|
@@ -366,31 +325,27 @@ gdkevent_s_handler_set(self)
|
|
366
325
|
}
|
367
326
|
|
368
327
|
static VALUE
|
369
|
-
gdkevent_s_get_show_events(self)
|
370
|
-
VALUE self;
|
328
|
+
gdkevent_s_get_show_events(VALUE self)
|
371
329
|
{
|
372
330
|
return CBOOL2RVAL(gdk_get_show_events());
|
373
331
|
}
|
374
332
|
|
375
333
|
static VALUE
|
376
|
-
gdkevent_s_set_show_events(self, show_events)
|
377
|
-
VALUE self, show_events;
|
334
|
+
gdkevent_s_set_show_events(VALUE self, VALUE show_events)
|
378
335
|
{
|
379
336
|
gdk_set_show_events(RVAL2CBOOL(show_events));
|
380
337
|
return self;
|
381
338
|
}
|
382
339
|
#if GTK_CHECK_VERSION(2,2,0)
|
383
340
|
static VALUE
|
384
|
-
gdkevent_set_screen(self, screen)
|
385
|
-
VALUE self, screen;
|
341
|
+
gdkevent_set_screen(VALUE self, VALUE screen)
|
386
342
|
{
|
387
343
|
gdk_event_set_screen(get_gdkevent(self), GDK_SCREEN(RVAL2GOBJ(screen)));
|
388
344
|
return self;
|
389
345
|
}
|
390
346
|
|
391
347
|
static VALUE
|
392
|
-
gdkevent_screen(self)
|
393
|
-
VALUE self;
|
348
|
+
gdkevent_screen(VALUE self)
|
394
349
|
{
|
395
350
|
return GOBJ2RVAL(gdk_event_get_screen(get_gdkevent(self)));
|
396
351
|
}
|
@@ -400,10 +355,7 @@ gdkevent_screen(self)
|
|
400
355
|
type: String, Integer, Gdk::Color.
|
401
356
|
*/
|
402
357
|
static VALUE
|
403
|
-
gdkevent_s_setting_get(argc, argv, self)
|
404
|
-
int argc;
|
405
|
-
VALUE* argv;
|
406
|
-
VALUE self;
|
358
|
+
gdkevent_s_setting_get(int argc, VALUE *argv, VALUE self)
|
407
359
|
{
|
408
360
|
VALUE name, type;
|
409
361
|
GType gtype;
|
@@ -481,15 +433,13 @@ gdkeventmotion_request_motions(VALUE self)
|
|
481
433
|
|
482
434
|
/* GdkEventExpose */
|
483
435
|
static VALUE
|
484
|
-
gdkeventexpose_area(self)
|
485
|
-
VALUE self;
|
436
|
+
gdkeventexpose_area(VALUE self)
|
486
437
|
{
|
487
438
|
return BOXED2RVAL(&get_gdkevent(self)->expose.area, GDK_TYPE_RECTANGLE);
|
488
439
|
}
|
489
440
|
|
490
441
|
static VALUE
|
491
|
-
gdkeventexpose_set_area(self, rect)
|
492
|
-
VALUE self, rect;
|
442
|
+
gdkeventexpose_set_area(VALUE self, VALUE rect)
|
493
443
|
{
|
494
444
|
GdkRectangle* grect = (GdkRectangle*)RVAL2BOXED(rect, GDK_TYPE_RECTANGLE);
|
495
445
|
GdkEventExpose event = get_gdkevent(self)->expose;
|
@@ -501,14 +451,12 @@ gdkeventexpose_set_area(self, rect)
|
|
501
451
|
}
|
502
452
|
|
503
453
|
static VALUE
|
504
|
-
gdkeventexpose_region(self)
|
505
|
-
VALUE self;
|
454
|
+
gdkeventexpose_region(VALUE self)
|
506
455
|
{
|
507
456
|
return BOXED2RVAL(get_gdkevent(self)->expose.region, GDK_TYPE_REGION);
|
508
457
|
}
|
509
458
|
static VALUE
|
510
|
-
gdkeventexpose_set_region(self, region)
|
511
|
-
VALUE self, region;
|
459
|
+
gdkeventexpose_set_region(VALUE self, VALUE region)
|
512
460
|
{
|
513
461
|
get_gdkevent(self)->expose.region = RVAL2BOXED(region, GDK_TYPE_REGION);
|
514
462
|
return self;
|
@@ -572,15 +520,13 @@ ATTR_ATOM(client, message_type);
|
|
572
520
|
GDKEVENT_INIT(client, GDK_CLIENT_EVENT);
|
573
521
|
|
574
522
|
static VALUE
|
575
|
-
gdkeventclient_data_format(self)
|
576
|
-
VALUE self;
|
523
|
+
gdkeventclient_data_format(VALUE self)
|
577
524
|
{
|
578
525
|
return INT2NUM(get_gdkevent(self)->client.data_format);
|
579
526
|
}
|
580
527
|
|
581
528
|
static VALUE
|
582
|
-
gdkeventclient_data(self)
|
583
|
-
VALUE self;
|
529
|
+
gdkeventclient_data(VALUE self)
|
584
530
|
{
|
585
531
|
int i;
|
586
532
|
VALUE ary = Qnil;
|
@@ -605,10 +551,7 @@ gdkeventclient_data(self)
|
|
605
551
|
}
|
606
552
|
|
607
553
|
static VALUE
|
608
|
-
gdkeventclient_send_client_message(argc, argv, self)
|
609
|
-
int argc;
|
610
|
-
VALUE *argv;
|
611
|
-
VALUE self;
|
554
|
+
gdkeventclient_send_client_message(int argc, VALUE *argv, VALUE self)
|
612
555
|
{
|
613
556
|
VALUE xid, display;
|
614
557
|
rb_scan_args(argc, argv, "11", &xid, &display);
|
@@ -629,26 +572,21 @@ gdkeventclient_send_client_message(argc, argv, self)
|
|
629
572
|
}
|
630
573
|
|
631
574
|
static VALUE
|
632
|
-
gdkeventclient_send_clientmessage_toall(self)
|
633
|
-
VALUE self;
|
575
|
+
gdkeventclient_send_clientmessage_toall(VALUE self)
|
634
576
|
{
|
635
577
|
gdk_event_send_clientmessage_toall(get_gdkevent(self));
|
636
578
|
return self;
|
637
579
|
}
|
638
580
|
|
639
581
|
static GdkFilterReturn
|
640
|
-
filter_func(xevent, event, func)
|
641
|
-
GdkXEvent* xevent;
|
642
|
-
GdkEvent* event;
|
643
|
-
gpointer func;
|
582
|
+
filter_func(GdkXEvent *xevent, GdkEvent *event, gpointer func)
|
644
583
|
{
|
645
584
|
VALUE ret = rb_funcall((VALUE)func, id_call, 2, LONG2NUM((glong)xevent), make_gdkevent(event));
|
646
585
|
return RVAL2GENUM(ret, GDK_TYPE_FILTER_RETURN);
|
647
586
|
}
|
648
587
|
|
649
588
|
static VALUE
|
650
|
-
gdkevent_s_add_client_message_filter(self, message_type)
|
651
|
-
VALUE self, message_type;
|
589
|
+
gdkevent_s_add_client_message_filter(VALUE self, VALUE message_type)
|
652
590
|
{
|
653
591
|
volatile VALUE func = rb_block_proc();
|
654
592
|
G_RELATIVE(self, func);
|