gio2 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/gio2/extconf.rb +4 -42
- data/ext/gio2/gio2.c +18 -117
- data/ext/gio2/gio2.h +20 -339
- data/ext/gio2/rbgio.c +132 -0
- data/ext/gio2/rbgio2.h +156 -0
- data/ext/gio2/rbgio2conversions.h +154 -0
- data/ext/gio2/rbgio2private.h +147 -0
- data/ext/gio2/{gappinfo.c → rbgioappinfo.c} +81 -82
- data/ext/gio2/rbgioapplaunchcontext.c +81 -0
- data/ext/gio2/{gasyncinitable.c → rbgioasyncinitable.c} +33 -30
- data/ext/gio2/rbgioasyncresult.c +41 -0
- data/ext/gio2/{gbufferedinputstream.c → rbgiobufferedinputstream.c} +37 -35
- data/ext/gio2/rbgiobufferedoutputstream.c +50 -0
- data/ext/gio2/rbgiocancellable.c +180 -0
- data/ext/gio2/rbgiocharsetconverter.c +57 -0
- data/ext/gio2/rbgiocontenttype.c +131 -0
- data/ext/gio2/{gconverter.c → rbgioconverter.c} +24 -28
- data/ext/gio2/rbgioconverterinputstream.c +43 -0
- data/ext/gio2/rbgioconverteroutputstream.c +43 -0
- data/ext/gio2/{gdatainputstream.c → rbgiodatainputstream.c} +49 -58
- data/ext/gio2/{gdataoutputstream.c → rbgiodataoutputstream.c} +39 -37
- data/ext/gio2/rbgiodesktopappinfo.c +87 -0
- data/ext/gio2/{gdrive.c → rbgiodrive.c} +75 -76
- data/ext/gio2/rbgioemblem.c +52 -0
- data/ext/gio2/rbgioemblemedicon.c +65 -0
- data/ext/gio2/{gfile.c → rbgiofile.c} +256 -266
- data/ext/gio2/rbgiofileattribute.c +114 -0
- data/ext/gio2/rbgiofileattributeinfo.c +86 -0
- data/ext/gio2/rbgiofileattributeinfolist.c +106 -0
- data/ext/gio2/rbgiofileattributematcher.c +93 -0
- data/ext/gio2/rbgiofiledescriptorbased.c +45 -0
- data/ext/gio2/{gfileenumerator.c → rbgiofileenumerator.c} +42 -40
- data/ext/gio2/rbgiofileicon.c +41 -0
- data/ext/gio2/{gfileinfo.c → rbgiofileinfo.c} +159 -163
- data/ext/gio2/{gfileinputstream.c → rbgiofileinputstream.c} +26 -25
- data/ext/gio2/{gfileiostream.c → rbgiofileiostream.c} +28 -26
- data/ext/gio2/rbgiofilemonitor.c +46 -0
- data/ext/gio2/rbgiofilenamecompleter.c +74 -0
- data/ext/gio2/{gfileoutputstream.c → rbgiofileoutputstream.c} +28 -26
- data/ext/gio2/rbgiofilterinputstream.c +28 -0
- data/ext/gio2/rbgiofilteroutputstream.c +28 -0
- data/ext/gio2/rbgioicon.c +69 -0
- data/ext/gio2/rbgioinetaddress.c +118 -0
- data/ext/gio2/rbgioinetsocketaddress.c +41 -0
- data/ext/gio2/{ginitable.c → rbgioinitable.c} +29 -25
- data/ext/gio2/{ginputstream.c → rbgioinputstream.c} +50 -48
- data/ext/gio2/rbgioio.c +73 -0
- data/ext/gio2/rbgioiomodule.c +45 -0
- data/ext/gio2/rbgioiomodules.c +47 -0
- data/ext/gio2/rbgioioscheduler.c +102 -0
- data/ext/gio2/rbgioioschedulerjob.c +121 -0
- data/ext/gio2/rbgioiostream.c +108 -0
- data/ext/gio2/{gloadableicon.c → rbgioloadableicon.c} +26 -24
- data/ext/gio2/rbgiomemoryinputstream.c +67 -0
- data/ext/gio2/rbgiomemoryoutputstream.c +44 -0
- data/ext/gio2/{gmount.c → rbgiomount.c} +70 -68
- data/ext/gio2/rbgiomountoperation.c +53 -0
- data/ext/gio2/rbgionetworkaddress.c +59 -0
- data/ext/gio2/rbgionetworkservice.c +45 -0
- data/ext/gio2/{goutputstream.c → rbgiooutputstream.c} +61 -62
- data/ext/gio2/{gresolver.c → rbgioresolver.c} +50 -48
- data/ext/gio2/rbgioseekable.c +91 -0
- data/ext/gio2/rbgiosimpleasyncresult.c +155 -0
- data/ext/gio2/{gsocket.c → rbgiosocket.c} +74 -76
- data/ext/gio2/rbgiosocketaddress.c +34 -0
- data/ext/gio2/rbgiosocketaddressenumerator.c +83 -0
- data/ext/gio2/{gsocketclient.c → rbgiosocketclient.c} +41 -39
- data/ext/gio2/rbgiosocketconnectable.c +41 -0
- data/ext/gio2/rbgiosocketconnection.c +66 -0
- data/ext/gio2/rbgiosocketconnectionfactory.c +39 -0
- data/ext/gio2/rbgiosocketcontrolmessage.c +82 -0
- data/ext/gio2/{gsocketlistener.c → rbgiosocketlistener.c} +49 -47
- data/ext/gio2/rbgiosocketservice.c +66 -0
- data/ext/gio2/rbgiosrvtarget.c +76 -0
- data/ext/gio2/rbgiotcpconnection.c +28 -0
- data/ext/gio2/rbgiothemedicon.c +83 -0
- data/ext/gio2/rbgiothreadedsocketservice.c +43 -0
- data/ext/gio2/rbgiounixconnection.c +71 -0
- data/ext/gio2/rbgiounixfdlist.c +115 -0
- data/ext/gio2/rbgiounixfdmessage.c +74 -0
- data/ext/gio2/rbgiounixinputstream.c +51 -0
- data/ext/gio2/rbgiounixmount.c +164 -0
- data/ext/gio2/rbgiounixmountmonitor.c +66 -0
- data/ext/gio2/rbgiounixmountpoint.c +136 -0
- data/ext/gio2/rbgiounixmountpoints.c +58 -0
- data/ext/gio2/rbgiounixmounts.c +58 -0
- data/ext/gio2/rbgiounixoutputstream.c +51 -0
- data/ext/gio2/rbgiounixsocketaddress.c +69 -0
- data/ext/gio2/rbgiovfs.c +84 -0
- data/ext/gio2/rbgiovolume.c +193 -0
- data/ext/gio2/rbgiovolumemonitor.c +77 -0
- data/ext/gio2/rbgiozlibcompressor.c +52 -0
- data/ext/gio2/rbgiozlibdecompressor.c +45 -0
- data/ext/gio2/util.c +57 -60
- data/lib/gio2/deprecated.rb +102 -0
- data/lib/gio2.rb +14 -12
- metadata +100 -88
- data/ChangeLog +0 -129
- data/ext/gio2/gapplaunchcontext.c +0 -79
- data/ext/gio2/gasyncresult.c +0 -39
- data/ext/gio2/gbufferedoutputstream.c +0 -48
- data/ext/gio2/gcancellable.c +0 -177
- data/ext/gio2/gcharsetconverter.c +0 -55
- data/ext/gio2/gcontenttype.c +0 -128
- data/ext/gio2/gconverterinputstream.c +0 -41
- data/ext/gio2/gconverteroutputstream.c +0 -41
- data/ext/gio2/gdesktopappinfo.c +0 -88
- data/ext/gio2/gemblem.c +0 -52
- data/ext/gio2/gemblemedicon.c +0 -63
- data/ext/gio2/gfileattribute.c +0 -111
- data/ext/gio2/gfileattributeinfo.c +0 -89
- data/ext/gio2/gfileattributeinfolist.c +0 -109
- data/ext/gio2/gfileattributematcher.c +0 -90
- data/ext/gio2/gfiledescriptorbased.c +0 -42
- data/ext/gio2/gfileicon.c +0 -39
- data/ext/gio2/gfilemonitor.c +0 -44
- data/ext/gio2/gfilenamecompleter.c +0 -72
- data/ext/gio2/gfilterinputstream.c +0 -27
- data/ext/gio2/gfilteroutputstream.c +0 -27
- data/ext/gio2/gicon.c +0 -67
- data/ext/gio2/ginetaddress.c +0 -116
- data/ext/gio2/ginetsocketaddress.c +0 -38
- data/ext/gio2/gioerror.c +0 -70
- data/ext/gio2/giomodule.c +0 -63
- data/ext/gio2/gioscheduler.c +0 -193
- data/ext/gio2/giostream.c +0 -106
- data/ext/gio2/gmemoryinputstream.c +0 -65
- data/ext/gio2/gmemoryoutputstream.c +0 -41
- data/ext/gio2/gmountoperation.c +0 -66
- data/ext/gio2/gnetworkaddress.c +0 -57
- data/ext/gio2/gnetworkservice.c +0 -43
- data/ext/gio2/gseekable.c +0 -89
- data/ext/gio2/gsimpleasyncresult.c +0 -153
- data/ext/gio2/gsocketaddress.c +0 -33
- data/ext/gio2/gsocketconnectable.c +0 -97
- data/ext/gio2/gsocketconnection.c +0 -75
- data/ext/gio2/gsocketcontrolmessage.c +0 -80
- data/ext/gio2/gsocketservice.c +0 -64
- data/ext/gio2/gsrvtarget.c +0 -77
- data/ext/gio2/gtcpconnection.c +0 -27
- data/ext/gio2/gthemedicon.c +0 -81
- data/ext/gio2/gthreadedsocketservice.c +0 -40
- data/ext/gio2/gunixconnection.c +0 -69
- data/ext/gio2/gunixfdlist.c +0 -112
- data/ext/gio2/gunixfdmessage.c +0 -72
- data/ext/gio2/gunixinputstream.c +0 -49
- data/ext/gio2/gunixmounts.c +0 -343
- data/ext/gio2/gunixoutputstream.c +0 -49
- data/ext/gio2/gunixsocketaddress.c +0 -67
- data/ext/gio2/gvfs.c +0 -82
- data/ext/gio2/gvolume.c +0 -191
- data/ext/gio2/gvolumemonitor.c +0 -75
- data/ext/gio2/gzlibcompressor.c +0 -50
- data/ext/gio2/gzlibdecompressor.c +0 -43
@@ -1,92 +1,91 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
4
|
-
*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
5
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
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
10
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
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
15
|
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
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
|
19
20
|
*/
|
20
21
|
|
21
|
-
#include "
|
22
|
+
#include "rbgio2private.h"
|
22
23
|
|
23
|
-
#define
|
24
|
-
|
25
|
-
#define GDRIVESTARTSTOPTYPE2RVAL(value) \
|
26
|
-
GENUM2RVAL((value), G_TYPE_DRIVE_START_STOP_TYPE)
|
24
|
+
#define RG_TARGET_NAMESPACE mDrive
|
25
|
+
#define _SELF(value) RVAL2GDRIVE(value)
|
27
26
|
|
28
27
|
static VALUE
|
29
|
-
|
28
|
+
rg_name(VALUE self)
|
30
29
|
{
|
31
30
|
return CSTR2RVAL_FREE(g_drive_get_name(_SELF(self)));
|
32
31
|
}
|
33
32
|
|
34
33
|
static VALUE
|
35
|
-
|
34
|
+
rg_icon(VALUE self)
|
36
35
|
{
|
37
36
|
return GOBJ2RVAL_UNREF(g_drive_get_icon(_SELF(self)));
|
38
37
|
}
|
39
38
|
|
40
39
|
static VALUE
|
41
|
-
|
40
|
+
rg_has_volumes_p(VALUE self)
|
42
41
|
{
|
43
42
|
return CBOOL2RVAL(g_drive_has_volumes(_SELF(self)));
|
44
43
|
}
|
45
44
|
|
46
45
|
static VALUE
|
47
|
-
|
46
|
+
rg_volumes(VALUE self)
|
48
47
|
{
|
49
48
|
return GLIST2ARY_FREE(g_drive_get_volumes(_SELF(self)));
|
50
49
|
}
|
51
50
|
|
52
51
|
static VALUE
|
53
|
-
|
52
|
+
rg_can_eject_p(VALUE self)
|
54
53
|
{
|
55
54
|
return CBOOL2RVAL(g_drive_can_eject(_SELF(self)));
|
56
55
|
}
|
57
56
|
|
58
57
|
static VALUE
|
59
|
-
|
58
|
+
rg_start_stop_type(VALUE self)
|
60
59
|
{
|
61
60
|
return GDRIVESTARTSTOPTYPE2RVAL(g_drive_get_start_stop_type(_SELF(self)));
|
62
61
|
}
|
63
62
|
|
64
63
|
static VALUE
|
65
|
-
|
64
|
+
rg_can_start_p(VALUE self)
|
66
65
|
{
|
67
66
|
return CBOOL2RVAL(g_drive_can_start(_SELF(self)));
|
68
67
|
}
|
69
68
|
|
70
69
|
static VALUE
|
71
|
-
|
70
|
+
rg_can_start_degraded_p(VALUE self)
|
72
71
|
{
|
73
72
|
return CBOOL2RVAL(g_drive_can_start_degraded(_SELF(self)));
|
74
73
|
}
|
75
74
|
|
76
75
|
static VALUE
|
77
|
-
|
76
|
+
rg_can_stop_p(VALUE self)
|
78
77
|
{
|
79
78
|
return CBOOL2RVAL(g_drive_can_stop(_SELF(self)));
|
80
79
|
}
|
81
80
|
|
82
81
|
static VALUE
|
83
|
-
|
82
|
+
rg_can_poll_for_media_p(VALUE self)
|
84
83
|
{
|
85
84
|
return CBOOL2RVAL(g_drive_can_poll_for_media(_SELF(self)));
|
86
85
|
}
|
87
86
|
|
88
87
|
static VALUE
|
89
|
-
|
88
|
+
rg_poll_for_media(int argc, VALUE *argv, VALUE self)
|
90
89
|
{
|
91
90
|
VALUE rbcancellable, block;
|
92
91
|
GCancellable *cancellable;
|
@@ -115,25 +114,25 @@ boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
|
|
115
114
|
}
|
116
115
|
|
117
116
|
static VALUE
|
118
|
-
|
117
|
+
rg_poll_for_media_finish(VALUE self, VALUE result)
|
119
118
|
{
|
120
119
|
return boolean_finish_method(g_drive_poll_for_media_finish, self, result);
|
121
120
|
}
|
122
121
|
|
123
122
|
static VALUE
|
124
|
-
|
123
|
+
rg_has_media_p(VALUE self)
|
125
124
|
{
|
126
125
|
return CBOOL2RVAL(g_drive_has_media(_SELF(self)));
|
127
126
|
}
|
128
127
|
|
129
128
|
static VALUE
|
130
|
-
|
129
|
+
rg_media_check_automatic_p(VALUE self)
|
131
130
|
{
|
132
131
|
return CBOOL2RVAL(g_drive_is_media_check_automatic(_SELF(self)));
|
133
132
|
}
|
134
133
|
|
135
134
|
static VALUE
|
136
|
-
|
135
|
+
rg_media_removable_p(VALUE self)
|
137
136
|
{
|
138
137
|
return CBOOL2RVAL(g_drive_is_media_removable(_SELF(self)));
|
139
138
|
}
|
@@ -169,19 +168,19 @@ eject_stop_method(EjectStopMethod method, int argc, VALUE *argv, VALUE self)
|
|
169
168
|
}
|
170
169
|
|
171
170
|
static VALUE
|
172
|
-
|
171
|
+
rg_eject_with_operation(int argc, VALUE *argv, VALUE self)
|
173
172
|
{
|
174
173
|
return eject_stop_method(g_drive_eject_with_operation, argc, argv, self);
|
175
174
|
}
|
176
175
|
|
177
176
|
static VALUE
|
178
|
-
|
177
|
+
rg_eject_with_operation_finish(VALUE self, VALUE result)
|
179
178
|
{
|
180
179
|
return boolean_finish_method(g_drive_eject_with_operation_finish, self, result);
|
181
180
|
}
|
182
181
|
|
183
182
|
static VALUE
|
184
|
-
|
183
|
+
rg_start(int argc, VALUE *argv, VALUE self)
|
185
184
|
{
|
186
185
|
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
187
186
|
GDriveStartFlags flags;
|
@@ -200,68 +199,68 @@ drive_start(int argc, VALUE *argv, VALUE self)
|
|
200
199
|
}
|
201
200
|
|
202
201
|
static VALUE
|
203
|
-
|
202
|
+
rg_start_finish(VALUE self, VALUE result)
|
204
203
|
{
|
205
204
|
return boolean_finish_method(g_drive_start_finish, self, result);
|
206
205
|
}
|
207
206
|
|
208
207
|
static VALUE
|
209
|
-
|
208
|
+
rg_stop(int argc, VALUE *argv, VALUE self)
|
210
209
|
{
|
211
210
|
return eject_stop_method(g_drive_stop, argc, argv, self);
|
212
211
|
}
|
213
212
|
|
214
213
|
static VALUE
|
215
|
-
|
214
|
+
rg_stop_finish(VALUE self, VALUE result)
|
216
215
|
{
|
217
216
|
return boolean_finish_method(g_drive_stop_finish, self, result);
|
218
217
|
}
|
219
218
|
|
220
219
|
static VALUE
|
221
|
-
|
220
|
+
rg_enumerate_identifiers(VALUE self)
|
222
221
|
{
|
223
|
-
return
|
222
|
+
return STRV2RVAL_FREE(g_drive_enumerate_identifiers(_SELF(self)));
|
224
223
|
}
|
225
224
|
|
226
225
|
static VALUE
|
227
|
-
|
226
|
+
rg_get_identifier(VALUE self, VALUE kind)
|
228
227
|
{
|
229
228
|
return CSTR2RVAL_FREE(g_drive_get_identifier(_SELF(self), RVAL2CSTR(kind)));
|
230
229
|
}
|
231
230
|
|
232
231
|
void
|
233
|
-
Init_gdrive(VALUE
|
232
|
+
Init_gdrive(VALUE mGio)
|
234
233
|
{
|
235
|
-
VALUE
|
236
|
-
|
237
|
-
G_DEF_CLASS(G_TYPE_DRIVE_START_FLAGS, "StartFlags",
|
238
|
-
G_DEF_CONSTANTS(
|
239
|
-
|
240
|
-
G_DEF_CLASS(G_TYPE_DRIVE_START_STOP_TYPE, "StartStopType",
|
241
|
-
G_DEF_CONSTANTS(
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
234
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_DRIVE, "Drive", mGio);
|
235
|
+
|
236
|
+
G_DEF_CLASS(G_TYPE_DRIVE_START_FLAGS, "StartFlags", RG_TARGET_NAMESPACE);
|
237
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_FLAGS, "G_DRIVE_");
|
238
|
+
|
239
|
+
G_DEF_CLASS(G_TYPE_DRIVE_START_STOP_TYPE, "StartStopType", RG_TARGET_NAMESPACE);
|
240
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_STOP_TYPE, "G_DRIVE_");
|
241
|
+
|
242
|
+
RG_DEF_METHOD(name, 0);
|
243
|
+
RG_DEF_METHOD(icon, 0);
|
244
|
+
RG_DEF_METHOD_P(has_volumes, 0);
|
245
|
+
RG_DEF_METHOD(volumes, 0);
|
246
|
+
RG_DEF_METHOD_P(can_eject, 0);
|
247
|
+
RG_DEF_METHOD(start_stop_type, 0);
|
248
|
+
RG_DEF_METHOD_P(can_start, 0);
|
249
|
+
RG_DEF_METHOD_P(can_start_degraded, 0);
|
250
|
+
RG_DEF_METHOD_P(can_stop, 0);
|
251
|
+
RG_DEF_METHOD_P(can_poll_for_media, 0);
|
252
|
+
RG_DEF_METHOD(poll_for_media, -1);
|
253
|
+
RG_DEF_METHOD(poll_for_media_finish, 1);
|
254
|
+
RG_DEF_METHOD_P(has_media, 0);
|
255
|
+
RG_DEF_METHOD_P(media_check_automatic, 0);
|
256
|
+
RG_DEF_METHOD_P(media_removable, 0);
|
257
|
+
RG_DEF_METHOD(eject_with_operation, -1);
|
258
|
+
RG_DEF_METHOD(eject_with_operation_finish, 1);
|
259
|
+
RG_DEF_METHOD(start, -1);
|
260
|
+
RG_DEF_METHOD(start_finish, 1);
|
261
|
+
RG_DEF_METHOD(stop, -1);
|
262
|
+
RG_DEF_METHOD(stop_finish, 1);
|
263
|
+
RG_DEF_METHOD(enumerate_identifiers, -1);
|
264
|
+
RG_DEF_ALIAS("identifiers", "enumerate_identifiers");
|
265
|
+
RG_DEF_METHOD(get_identifier, 1);
|
267
266
|
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbgio2private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cEmblem
|
25
|
+
|
26
|
+
static VALUE
|
27
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
28
|
+
{
|
29
|
+
VALUE rbicon, origin;
|
30
|
+
GIcon *icon;
|
31
|
+
GEmblem *emblem;
|
32
|
+
|
33
|
+
rb_scan_args(argc, argv, "11", &rbicon, &origin);
|
34
|
+
icon = RVAL2GICON(rbicon);
|
35
|
+
emblem = NIL_P(origin) ?
|
36
|
+
g_emblem_new(icon) :
|
37
|
+
g_emblem_new_with_origin(icon, RVAL2GEMBLEMORIGIN(origin));
|
38
|
+
G_INITIALIZE(self, emblem);
|
39
|
+
|
40
|
+
return Qnil;
|
41
|
+
}
|
42
|
+
|
43
|
+
void
|
44
|
+
Init_gemblem(VALUE mGio)
|
45
|
+
{
|
46
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEM, "Emblem", mGio);
|
47
|
+
|
48
|
+
G_DEF_CLASS(G_TYPE_EMBLEM_ORIGIN, "Origin", RG_TARGET_NAMESPACE);
|
49
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_EMBLEM_ORIGIN, "G_EMBLEM_");
|
50
|
+
|
51
|
+
RG_DEF_METHOD(initialize, -1);
|
52
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
|
5
|
+
*
|
6
|
+
* This library is free software; you can redistribute it and/or
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
8
|
+
* License as published by the Free Software Foundation; either
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
10
|
+
*
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
* Lesser General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
17
|
+
* License along with this library; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
+
* MA 02110-1301 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "rbgio2private.h"
|
23
|
+
|
24
|
+
#define RG_TARGET_NAMESPACE cEmblemedIcon
|
25
|
+
#define _SELF(value) RVAL2GEMBLEMEDICON(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self, VALUE icon, VALUE emblem)
|
29
|
+
{
|
30
|
+
G_INITIALIZE(self, g_emblemed_icon_new(RVAL2GICON(icon), RVAL2GEMBLEM(emblem)));
|
31
|
+
|
32
|
+
return Qnil;
|
33
|
+
}
|
34
|
+
|
35
|
+
static VALUE
|
36
|
+
rg_icon(VALUE self)
|
37
|
+
{
|
38
|
+
return GOBJ2RVAL(g_emblemed_icon_get_icon(_SELF(self)));
|
39
|
+
}
|
40
|
+
|
41
|
+
static VALUE
|
42
|
+
rg_emblems(VALUE self)
|
43
|
+
{
|
44
|
+
return GLIST2ARY_FREE(g_emblemed_icon_get_emblems(_SELF(self)));
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rg_add_emblem(VALUE self, VALUE emblem)
|
49
|
+
{
|
50
|
+
g_emblemed_icon_add_emblem(_SELF(self), RVAL2GEMBLEM(emblem));
|
51
|
+
|
52
|
+
return self;
|
53
|
+
}
|
54
|
+
|
55
|
+
void
|
56
|
+
Init_gemblemedicon(VALUE mGio)
|
57
|
+
{
|
58
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEMED_ICON, "EmblemedIcon", mGio);
|
59
|
+
|
60
|
+
RG_DEF_METHOD(initialize, 2);
|
61
|
+
RG_DEF_METHOD(icon, 0);
|
62
|
+
RG_DEF_METHOD(emblems, 0);
|
63
|
+
RG_DEF_METHOD(add_emblem, 1);
|
64
|
+
RG_DEF_ALIAS("<<", "add_emblem");
|
65
|
+
}
|