gio2 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32
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/1.8/gio2.so +0 -0
- data/lib/1.9/gio2.so +0 -0
- 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,37 +1,36 @@
|
|
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
|
|
24
|
+
#define RG_TARGET_NAMESPACE mAppInfo
|
23
25
|
#define _SELF(value) RVAL2GAPPINFO(value)
|
24
26
|
|
25
|
-
#define RVAL2GAPPINFOCREATEFLAGS(value) \
|
26
|
-
RVAL2GFLAGS((value), G_TYPE_APP_INFO_CREATE_FLAGS)
|
27
|
-
|
28
27
|
#define RVAL2GAPPINFOCREATEFLAGSDEFAULT(value) \
|
29
28
|
RVAL2TYPE_WITH_DEFAULT((value), \
|
30
29
|
RVAL2GAPPINFOCREATEFLAGS, \
|
31
30
|
G_APP_INFO_CREATE_NONE)
|
32
31
|
|
33
32
|
static VALUE
|
34
|
-
|
33
|
+
rg_s_create_from_commandline(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
35
34
|
{
|
36
35
|
VALUE commandline, application_name, flags;
|
37
36
|
GError *error = NULL;
|
@@ -49,7 +48,7 @@ appinfo_create_from_commandline(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
|
49
48
|
}
|
50
49
|
|
51
50
|
static VALUE
|
52
|
-
|
51
|
+
rg_s_reset_type_associations(VALUE self, VALUE content_type)
|
53
52
|
{
|
54
53
|
g_app_info_reset_type_associations(RVAL2CSTR(content_type));
|
55
54
|
|
@@ -57,25 +56,25 @@ appinfo_reset_type_associations(VALUE self, VALUE content_type)
|
|
57
56
|
}
|
58
57
|
|
59
58
|
static VALUE
|
60
|
-
|
59
|
+
rg_s_get_all_for_type(G_GNUC_UNUSED VALUE self, VALUE content_type)
|
61
60
|
{
|
62
61
|
return GLIST2ARY_FREE(g_app_info_get_all_for_type(RVAL2CSTR(content_type)));
|
63
62
|
}
|
64
63
|
|
65
64
|
static VALUE
|
66
|
-
|
65
|
+
rg_s_all(int argc, VALUE *argv, VALUE self)
|
67
66
|
{
|
68
67
|
VALUE content_type;
|
69
68
|
|
70
69
|
rb_scan_args(argc, argv, "01", &content_type);
|
71
70
|
if (!NIL_P(content_type))
|
72
|
-
return
|
71
|
+
return rg_s_get_all_for_type(self, content_type);
|
73
72
|
|
74
73
|
return GLIST2ARY_FREE(g_app_info_get_all());
|
75
74
|
}
|
76
75
|
|
77
76
|
static VALUE
|
78
|
-
|
77
|
+
rg_s_get_default_for_type(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
79
78
|
{
|
80
79
|
VALUE content_type, must_support_uris;
|
81
80
|
|
@@ -86,13 +85,13 @@ appinfo_get_default_for_type(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
|
86
85
|
}
|
87
86
|
|
88
87
|
static VALUE
|
89
|
-
|
88
|
+
rg_s_get_default_for_uri_scheme(G_GNUC_UNUSED VALUE self, VALUE uri_scheme)
|
90
89
|
{
|
91
90
|
return GOBJ2RVAL_UNREF(g_app_info_get_default_for_uri_scheme(RVAL2CSTR(uri_scheme)));
|
92
91
|
}
|
93
92
|
|
94
93
|
static VALUE
|
95
|
-
|
94
|
+
rg_s_launch_default_for_uri(int argc, VALUE *argv, VALUE self)
|
96
95
|
{
|
97
96
|
VALUE uri, launch_context;
|
98
97
|
GError *error;
|
@@ -107,55 +106,55 @@ appinfo_launch_default_for_uri(int argc, VALUE *argv, VALUE self)
|
|
107
106
|
}
|
108
107
|
|
109
108
|
static VALUE
|
110
|
-
|
109
|
+
rg_dup(VALUE self)
|
111
110
|
{
|
112
111
|
return GOBJ2RVAL_UNREF(g_app_info_dup(_SELF(self)));
|
113
112
|
}
|
114
113
|
|
115
114
|
static VALUE
|
116
|
-
|
115
|
+
rg_equal_p(VALUE self, VALUE other)
|
117
116
|
{
|
118
117
|
return CBOOL2RVAL(g_app_info_equal(_SELF(self), _SELF(other)));
|
119
118
|
}
|
120
119
|
|
121
120
|
static VALUE
|
122
|
-
|
121
|
+
rg_id(VALUE self)
|
123
122
|
{
|
124
123
|
return CSTR2RVAL(g_app_info_get_id(_SELF(self)));
|
125
124
|
}
|
126
125
|
|
127
126
|
static VALUE
|
128
|
-
|
127
|
+
rg_name(VALUE self)
|
129
128
|
{
|
130
129
|
return CSTR2RVAL(g_app_info_get_name(_SELF(self)));
|
131
130
|
}
|
132
131
|
|
133
132
|
static VALUE
|
134
|
-
|
133
|
+
rg_display_name(VALUE self)
|
135
134
|
{
|
136
135
|
return CSTR2RVAL(g_app_info_get_display_name(_SELF(self)));
|
137
136
|
}
|
138
137
|
|
139
138
|
static VALUE
|
140
|
-
|
139
|
+
rg_description(VALUE self)
|
141
140
|
{
|
142
141
|
return CSTR2RVAL(g_app_info_get_description(_SELF(self)));
|
143
142
|
}
|
144
143
|
|
145
144
|
static VALUE
|
146
|
-
|
145
|
+
rg_executable(VALUE self)
|
147
146
|
{
|
148
147
|
return CSTR2RVAL(g_app_info_get_executable(_SELF(self)));
|
149
148
|
}
|
150
149
|
|
151
150
|
static VALUE
|
152
|
-
|
151
|
+
rg_commandline(VALUE self)
|
153
152
|
{
|
154
153
|
return CSTR2RVAL(g_app_info_get_commandline(_SELF(self)));
|
155
154
|
}
|
156
155
|
|
157
156
|
static VALUE
|
158
|
-
|
157
|
+
rg_icon(VALUE self)
|
159
158
|
{
|
160
159
|
return GOBJ2RVAL(g_app_info_get_icon(_SELF(self)));
|
161
160
|
}
|
@@ -187,49 +186,49 @@ launch_method(LaunchMethod method, int argc, VALUE *argv, VALUE self)
|
|
187
186
|
}
|
188
187
|
|
189
188
|
static VALUE
|
190
|
-
|
189
|
+
rg_launch(int argc, VALUE *argv, VALUE self)
|
191
190
|
{
|
192
191
|
return launch_method(g_app_info_launch, argc, argv, self);
|
193
192
|
}
|
194
193
|
|
195
194
|
static VALUE
|
196
|
-
|
195
|
+
rg_supports_files_p(VALUE self)
|
197
196
|
{
|
198
197
|
return CBOOL2RVAL(g_app_info_supports_files(_SELF(self)));
|
199
198
|
}
|
200
199
|
|
201
200
|
static VALUE
|
202
|
-
|
201
|
+
rg_supports_uris_p(VALUE self)
|
203
202
|
{
|
204
203
|
return CBOOL2RVAL(g_app_info_supports_uris(_SELF(self)));
|
205
204
|
}
|
206
205
|
|
207
206
|
static VALUE
|
208
|
-
|
207
|
+
rg_launch_uris(int argc, VALUE *argv, VALUE self)
|
209
208
|
{
|
210
209
|
return launch_method(g_app_info_launch_uris, argc, argv, self);
|
211
210
|
}
|
212
211
|
|
213
212
|
static VALUE
|
214
|
-
|
213
|
+
rg_should_show_p(VALUE self)
|
215
214
|
{
|
216
215
|
return CBOOL2RVAL(g_app_info_should_show(_SELF(self)));
|
217
216
|
}
|
218
217
|
|
219
218
|
static VALUE
|
220
|
-
|
219
|
+
rg_can_delete_p(VALUE self)
|
221
220
|
{
|
222
221
|
return CBOOL2RVAL(g_app_info_can_delete(_SELF(self)));
|
223
222
|
}
|
224
223
|
|
225
224
|
static VALUE
|
226
|
-
|
225
|
+
rg_delete(VALUE self)
|
227
226
|
{
|
228
227
|
return CBOOL2RVAL(g_app_info_delete(_SELF(self)));
|
229
228
|
}
|
230
229
|
|
231
230
|
static VALUE
|
232
|
-
|
231
|
+
rg_set_as_default_for_type(VALUE self, VALUE value)
|
233
232
|
{
|
234
233
|
GError *error = NULL;
|
235
234
|
|
@@ -240,7 +239,7 @@ appinfo_set_as_default_for_type(VALUE self, VALUE value)
|
|
240
239
|
}
|
241
240
|
|
242
241
|
static VALUE
|
243
|
-
|
242
|
+
rg_set_as_default_for_extension(VALUE self, VALUE value)
|
244
243
|
{
|
245
244
|
GError *error = NULL;
|
246
245
|
|
@@ -251,7 +250,7 @@ appinfo_set_as_default_for_extension(VALUE self, VALUE value)
|
|
251
250
|
}
|
252
251
|
|
253
252
|
static VALUE
|
254
|
-
|
253
|
+
rg_add_supports_type(VALUE self, VALUE value)
|
255
254
|
{
|
256
255
|
GError *error = NULL;
|
257
256
|
|
@@ -262,7 +261,7 @@ appinfo_add_supports_type(VALUE self, VALUE value)
|
|
262
261
|
}
|
263
262
|
|
264
263
|
static VALUE
|
265
|
-
|
264
|
+
rg_remove_supports_type(VALUE self, VALUE value)
|
266
265
|
{
|
267
266
|
GError *error = NULL;
|
268
267
|
|
@@ -273,46 +272,46 @@ appinfo_remove_supports_type(VALUE self, VALUE value)
|
|
273
272
|
}
|
274
273
|
|
275
274
|
static VALUE
|
276
|
-
|
275
|
+
rg_can_remove_supports_type_p(VALUE self)
|
277
276
|
{
|
278
277
|
return CBOOL2RVAL(g_app_info_can_remove_supports_type(_SELF(self)));
|
279
278
|
}
|
280
279
|
|
281
280
|
void
|
282
|
-
Init_gappinfo(VALUE
|
281
|
+
Init_gappinfo(VALUE mGio)
|
283
282
|
{
|
284
|
-
VALUE
|
285
|
-
|
286
|
-
G_DEF_CLASS(G_TYPE_APP_INFO_CREATE_FLAGS, "CreateFlags",
|
287
|
-
G_DEF_CONSTANTS(
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
283
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_APP_INFO, "AppInfo", mGio);
|
284
|
+
|
285
|
+
G_DEF_CLASS(G_TYPE_APP_INFO_CREATE_FLAGS, "CreateFlags", RG_TARGET_NAMESPACE);
|
286
|
+
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_APP_INFO_CREATE_FLAGS, "G_APP_INFO_");
|
287
|
+
|
288
|
+
RG_DEF_SMETHOD(create_from_commandline, -1);
|
289
|
+
RG_DEF_SMETHOD(reset_type_associations, -1);
|
290
|
+
RG_DEF_SMETHOD(all, 0);
|
291
|
+
RG_DEF_SMETHOD(get_all_for_type, 1);
|
292
|
+
RG_DEF_SMETHOD(get_default_for_type, -1);
|
293
|
+
RG_DEF_SMETHOD(get_default_for_uri_scheme, 1);
|
294
|
+
RG_DEF_SMETHOD(launch_default_for_uri, 0);
|
295
|
+
|
296
|
+
RG_DEF_METHOD(dup, 0);
|
297
|
+
RG_DEF_METHOD_P(equal, 1);
|
298
|
+
RG_DEF_METHOD(id, 0);
|
299
|
+
RG_DEF_METHOD(name, 0);
|
300
|
+
RG_DEF_METHOD(display_name, 0);
|
301
|
+
RG_DEF_METHOD(description, 0);
|
302
|
+
RG_DEF_METHOD(executable, 0);
|
303
|
+
RG_DEF_METHOD(commandline, 0);
|
304
|
+
RG_DEF_METHOD(icon, 0);
|
305
|
+
RG_DEF_METHOD(launch, -1);
|
306
|
+
RG_DEF_METHOD_P(supports_files, 0);
|
307
|
+
RG_DEF_METHOD_P(supports_uris, 0);
|
308
|
+
RG_DEF_METHOD(launch_uris, -1);
|
309
|
+
RG_DEF_METHOD_P(should_show, 0);
|
310
|
+
RG_DEF_METHOD_P(can_delete, 0);
|
311
|
+
RG_DEF_METHOD(delete, 0);
|
312
|
+
RG_DEF_METHOD(set_as_default_for_type, 1);
|
313
|
+
RG_DEF_METHOD(set_as_default_for_extension, 1);
|
314
|
+
RG_DEF_METHOD(add_supports_type, 1);
|
315
|
+
RG_DEF_METHOD_P(can_remove_supports_type, 1);
|
316
|
+
RG_DEF_METHOD(remove_supports_type, 1);
|
318
317
|
}
|
@@ -0,0 +1,81 @@
|
|
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 cAppLaunchContext
|
25
|
+
#define _SELF(value) RVAL2GAPPLAUNCHCONTEXT(value)
|
26
|
+
|
27
|
+
static VALUE
|
28
|
+
rg_initialize(VALUE self)
|
29
|
+
{
|
30
|
+
G_INITIALIZE(self, g_app_launch_context_new());
|
31
|
+
|
32
|
+
return Qnil;
|
33
|
+
}
|
34
|
+
|
35
|
+
typedef char *(*GetMethod)(GAppLaunchContext *, GAppInfo *, GList *);
|
36
|
+
|
37
|
+
static VALUE
|
38
|
+
get_value_by(GetMethod method, int argc, VALUE *argv, VALUE self)
|
39
|
+
{
|
40
|
+
VALUE info, rbfiles;
|
41
|
+
GList *files;
|
42
|
+
char *value;
|
43
|
+
|
44
|
+
rb_scan_args(argc, argv, "11", &info, &rbfiles);
|
45
|
+
files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles);
|
46
|
+
value = method(_SELF(self), RVAL2GAPPINFO(info), files);
|
47
|
+
g_list_free(files);
|
48
|
+
|
49
|
+
return CSTR2RVAL_FREE(value);
|
50
|
+
}
|
51
|
+
|
52
|
+
static VALUE
|
53
|
+
rg_get_display(int argc, VALUE *argv, VALUE self)
|
54
|
+
{
|
55
|
+
return get_value_by(g_app_launch_context_get_display, argc, argv, self);
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
rg_get_startup_notify_id(int argc, VALUE *argv, VALUE self)
|
60
|
+
{
|
61
|
+
return get_value_by(g_app_launch_context_get_startup_notify_id, argc, argv, self);
|
62
|
+
}
|
63
|
+
|
64
|
+
static VALUE
|
65
|
+
rg_launch_failed(VALUE self, VALUE sn_id)
|
66
|
+
{
|
67
|
+
g_app_launch_context_launch_failed(_SELF(self), RVAL2CSTR(sn_id));
|
68
|
+
|
69
|
+
return self;
|
70
|
+
}
|
71
|
+
|
72
|
+
void
|
73
|
+
Init_gapplaunchcontext(VALUE mGio)
|
74
|
+
{
|
75
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_APP_LAUNCH_CONTEXT, "AppLaunchContext", mGio);
|
76
|
+
|
77
|
+
RG_DEF_METHOD(initialize, 0);
|
78
|
+
RG_DEF_METHOD(get_display, -1);
|
79
|
+
RG_DEF_METHOD(get_startup_notify_id, -1);
|
80
|
+
RG_DEF_METHOD(launch_failed, 1);
|
81
|
+
}
|
@@ -1,29 +1,31 @@
|
|
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
|
+
#define RG_TARGET_NAMESPACE mAsyncInitable
|
25
|
+
#define _SELF(value) RVAL2GASYNCINITABLE(value)
|
24
26
|
|
25
27
|
static VALUE
|
26
|
-
|
28
|
+
rg_init_async(int argc, VALUE *argv, VALUE self)
|
27
29
|
{
|
28
30
|
VALUE rbio_priority, rbcancellable, block;
|
29
31
|
int io_priority;
|
@@ -43,7 +45,7 @@ asyncinitable_init_async(int argc, VALUE *argv, VALUE self)
|
|
43
45
|
}
|
44
46
|
|
45
47
|
static VALUE
|
46
|
-
|
48
|
+
rg_init_finish(VALUE self, VALUE result)
|
47
49
|
{
|
48
50
|
GError *error = NULL;
|
49
51
|
|
@@ -55,9 +57,9 @@ asyncinitable_init_finish(VALUE self, VALUE result)
|
|
55
57
|
return self;
|
56
58
|
}
|
57
59
|
|
58
|
-
/* NOTE: We don
|
60
|
+
/* NOTE: We don't implement g_async_initable_new_async. */
|
59
61
|
|
60
|
-
/* NOTE: We don
|
62
|
+
/* NOTE: We don't implement g_async_initable_new_valist_async. */
|
61
63
|
|
62
64
|
struct rbgio_gasyncinitable_new_async_data {
|
63
65
|
GObjectClass *gclass;
|
@@ -134,6 +136,8 @@ rbgio_gasyncinitable_new_async_ensure(struct rbgio_gasyncinitable_new_async_data
|
|
134
136
|
if (G_IS_VALUE(&data->parameters[i].value))
|
135
137
|
g_value_unset(&data->parameters[i].value);
|
136
138
|
|
139
|
+
g_free(data->parameters);
|
140
|
+
|
137
141
|
return Qnil;
|
138
142
|
}
|
139
143
|
|
@@ -180,7 +184,7 @@ rbgio_gasyncinitable_new_async(GType type,
|
|
180
184
|
data.rbparameters = parameters;
|
181
185
|
data.index = 0;
|
182
186
|
data.n_parameters = RVAL2GUINT(rb_funcall(parameters, s_id_length, 0));
|
183
|
-
data.parameters =
|
187
|
+
data.parameters = g_new(GParameter, data.n_parameters);
|
184
188
|
|
185
189
|
rb_ensure(rbgio_gasyncinitable_new_async_body, (VALUE)&data,
|
186
190
|
rbgio_gasyncinitable_new_async_ensure, (VALUE)&data);
|
@@ -189,7 +193,7 @@ rbgio_gasyncinitable_new_async(GType type,
|
|
189
193
|
}
|
190
194
|
|
191
195
|
static VALUE
|
192
|
-
|
196
|
+
rg_initialize(int argc, VALUE *argv, VALUE self)
|
193
197
|
{
|
194
198
|
const RGObjClassInfo* info;
|
195
199
|
VALUE io_priority, cancellable, parameters, block;
|
@@ -211,9 +215,8 @@ asyncinitable_initialize(int argc, VALUE *argv, VALUE self)
|
|
211
215
|
return self;
|
212
216
|
}
|
213
217
|
|
214
|
-
|
215
218
|
static VALUE
|
216
|
-
|
219
|
+
rg_initialize_finish(VALUE self, VALUE result)
|
217
220
|
{
|
218
221
|
GError *error = NULL;
|
219
222
|
GObject *object;
|
@@ -232,12 +235,12 @@ asyncinitable_initialize_finish(VALUE self, VALUE result)
|
|
232
235
|
}
|
233
236
|
|
234
237
|
void
|
235
|
-
Init_gasyncinitable(VALUE
|
238
|
+
Init_gasyncinitable(VALUE mGio)
|
236
239
|
{
|
237
|
-
VALUE
|
240
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ASYNC_INITABLE, "AsyncInitable", mGio);
|
238
241
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
242
|
+
RG_DEF_METHOD(init_async, -1);
|
243
|
+
RG_DEF_METHOD(init_finish, 1);
|
244
|
+
RG_DEF_METHOD(initialize, -1);
|
245
|
+
RG_DEF_METHOD(initialize_finish, 1);
|
243
246
|
}
|
@@ -0,0 +1,41 @@
|
|
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 mAsyncResult
|
25
|
+
#define _SELF(value) RVAL2GASYNCRESULT(value)
|
26
|
+
|
27
|
+
/* NOTE: g_async_result_get_user_data isn't of any use from Ruby. */
|
28
|
+
|
29
|
+
static VALUE
|
30
|
+
rg_source_object(VALUE self)
|
31
|
+
{
|
32
|
+
return GOBJ2RVAL_UNREF(g_async_result_get_source_object(_SELF(self)));
|
33
|
+
}
|
34
|
+
|
35
|
+
void
|
36
|
+
Init_gasyncresult(VALUE mGio)
|
37
|
+
{
|
38
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ASYNC_RESULT, "AsyncResult", mGio);
|
39
|
+
|
40
|
+
RG_DEF_METHOD(source_object, 0);
|
41
|
+
}
|