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,41 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
#define _SELF(value) G_CONVERTER_OUTPUT_STREAM(RVAL2GOBJ(value))
|
24
|
-
|
25
|
-
static VALUE
|
26
|
-
converteroutputstream_initialize(VALUE self, VALUE base_stream, VALUE converter)
|
27
|
-
{
|
28
|
-
G_INITIALIZE(self,
|
29
|
-
g_converter_output_stream_new(RVAL2GOUTPUTSTREAM(base_stream),
|
30
|
-
RVAL2GCONVERTER(converter)));
|
31
|
-
|
32
|
-
return Qnil;
|
33
|
-
}
|
34
|
-
|
35
|
-
void
|
36
|
-
Init_gconverteroutputstream(VALUE glib)
|
37
|
-
{
|
38
|
-
VALUE converteroutputstream = G_DEF_CLASS(G_TYPE_CONVERTER_OUTPUT_STREAM, "ConverterOutputStream", glib);
|
39
|
-
|
40
|
-
rb_define_method(converteroutputstream, "initialize", converteroutputstream_initialize, 2);
|
41
|
-
}
|
data/ext/gio2/gdesktopappinfo.c
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
#ifdef HAVE_GIO_UNIX
|
24
|
-
#include <gio/gdesktopappinfo.h>
|
25
|
-
|
26
|
-
#define _SELF(value) G_DESKTOP_APP_INFO(RVAL2GOBJ(value))
|
27
|
-
|
28
|
-
#define RVAL2GKEYFILE(value) \
|
29
|
-
((GKeyFile *)(RVAL2BOXED((value), G_TYPE_KEY_FILE)))
|
30
|
-
|
31
|
-
static VALUE
|
32
|
-
desktopappinfo_new_from_filename(G_GNUC_UNUSED VALUE self, VALUE filename)
|
33
|
-
{
|
34
|
-
return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_filename(RVAL2CSTR(filename)));
|
35
|
-
}
|
36
|
-
|
37
|
-
static VALUE
|
38
|
-
desktopappinfo_new_from_keyfile(G_GNUC_UNUSED VALUE self, VALUE keyfile)
|
39
|
-
{
|
40
|
-
return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_keyfile(RVAL2GKEYFILE(keyfile)));
|
41
|
-
}
|
42
|
-
|
43
|
-
static VALUE
|
44
|
-
desktopappinfo_initialize(VALUE self, VALUE desktop_id)
|
45
|
-
{
|
46
|
-
G_INITIALIZE(self, g_desktop_app_info_new(RVAL2CSTR(desktop_id)));
|
47
|
-
|
48
|
-
return Qnil;
|
49
|
-
}
|
50
|
-
|
51
|
-
static VALUE
|
52
|
-
desktopappinfo_get_filename(VALUE self)
|
53
|
-
{
|
54
|
-
return CSTR2RVAL(g_desktop_app_info_get_filename(_SELF(self)));
|
55
|
-
}
|
56
|
-
|
57
|
-
static VALUE
|
58
|
-
desktopappinfo_get_is_hidden(VALUE self)
|
59
|
-
{
|
60
|
-
return CBOOL2RVAL(g_desktop_app_info_get_is_hidden(_SELF(self)));
|
61
|
-
}
|
62
|
-
|
63
|
-
static VALUE
|
64
|
-
desktopappinfo_set_desktop_env(G_GNUC_UNUSED VALUE self, VALUE desktop_env)
|
65
|
-
{
|
66
|
-
g_desktop_app_info_set_desktop_env(RVAL2CSTR(desktop_env));
|
67
|
-
|
68
|
-
return self;
|
69
|
-
}
|
70
|
-
|
71
|
-
/* TODO: g_desktop_app_info_lookup_get_default_for_uri_scheme ()? */
|
72
|
-
#endif
|
73
|
-
|
74
|
-
void
|
75
|
-
Init_gdesktopappinfo(G_GNUC_UNUSED VALUE glib)
|
76
|
-
{
|
77
|
-
#ifdef HAVE_GIO_UNIX
|
78
|
-
VALUE desktopappinfo = G_DEF_CLASS(G_TYPE_DESKTOP_APP_INFO, "DesktopAppInfo", glib);
|
79
|
-
|
80
|
-
rb_define_singleton_method(desktopappinfo, "new_from_filename", desktopappinfo_new_from_filename, 1);
|
81
|
-
rb_define_singleton_method(desktopappinfo, "new_from_keyfile", desktopappinfo_new_from_keyfile, 1);
|
82
|
-
rb_define_singleton_method(desktopappinfo, "set_desktop_env", desktopappinfo_set_desktop_env, 1);
|
83
|
-
|
84
|
-
rb_define_method(desktopappinfo, "initialize", desktopappinfo_initialize, 1);
|
85
|
-
rb_define_method(desktopappinfo, "filename", desktopappinfo_get_filename, 0);
|
86
|
-
rb_define_method(desktopappinfo, "hidden?", desktopappinfo_get_is_hidden, 0);
|
87
|
-
#endif
|
88
|
-
}
|
data/ext/gio2/gemblem.c
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
#define RVAL2GEMBLEMORIGIN(value) \
|
24
|
-
RVAL2GENUM((value), G_TYPE_EMBLEM_ORIGIN)
|
25
|
-
|
26
|
-
static VALUE
|
27
|
-
emblem_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 glib)
|
45
|
-
{
|
46
|
-
VALUE emblem = G_DEF_CLASS(G_TYPE_EMBLEM, "Emblem", glib);
|
47
|
-
|
48
|
-
G_DEF_CLASS(G_TYPE_EMBLEM_ORIGIN, "Origin", emblem);
|
49
|
-
G_DEF_CONSTANTS(emblem, G_TYPE_EMBLEM_ORIGIN, "G_EMBLEM_");
|
50
|
-
|
51
|
-
rb_define_method(emblem, "initialize", emblem_initialize, -1);
|
52
|
-
}
|
data/ext/gio2/gemblemedicon.c
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
#define _SELF(value) G_EMBLEMED_ICON(RVAL2GOBJ(value))
|
24
|
-
|
25
|
-
static VALUE
|
26
|
-
emblemedicon_initialize(VALUE self, VALUE icon, VALUE emblem)
|
27
|
-
{
|
28
|
-
G_INITIALIZE(self, g_emblemed_icon_new(RVAL2GICON(icon), RVAL2GEMBLEM(emblem)));
|
29
|
-
|
30
|
-
return Qnil;
|
31
|
-
}
|
32
|
-
|
33
|
-
static VALUE
|
34
|
-
emblemedicon_get_icon(VALUE self)
|
35
|
-
{
|
36
|
-
return GOBJ2RVAL(g_emblemed_icon_get_icon(_SELF(self)));
|
37
|
-
}
|
38
|
-
|
39
|
-
static VALUE
|
40
|
-
emblemedicon_get_emblems(VALUE self)
|
41
|
-
{
|
42
|
-
return GLIST2ARY_FREE(g_emblemed_icon_get_emblems(_SELF(self)));
|
43
|
-
}
|
44
|
-
|
45
|
-
static VALUE
|
46
|
-
emblemedicon_add_emblem(VALUE self, VALUE emblem)
|
47
|
-
{
|
48
|
-
g_emblemed_icon_add_emblem(_SELF(self), RVAL2GEMBLEM(emblem));
|
49
|
-
|
50
|
-
return self;
|
51
|
-
}
|
52
|
-
|
53
|
-
void
|
54
|
-
Init_gemblemedicon(VALUE glib)
|
55
|
-
{
|
56
|
-
VALUE emblemedicon = G_DEF_CLASS(G_TYPE_EMBLEMED_ICON, "EmblemedIcon", glib);
|
57
|
-
|
58
|
-
rb_define_method(emblemedicon, "initialize", emblemedicon_initialize, 2);
|
59
|
-
rb_define_method(emblemedicon, "icon", emblemedicon_get_icon, 0);
|
60
|
-
rb_define_method(emblemedicon, "emblems", emblemedicon_get_emblems, 0);
|
61
|
-
rb_define_method(emblemedicon, "add_emblem", emblemedicon_add_emblem, 1);
|
62
|
-
rb_define_alias(emblemedicon, "<<", "add_emblem");
|
63
|
-
}
|
data/ext/gio2/gfileattribute.c
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
void
|
24
|
-
Init_gfileattribute(VALUE glib)
|
25
|
-
{
|
26
|
-
VALUE fileattribute;
|
27
|
-
|
28
|
-
fileattribute = rb_define_module_under(glib, "FileAttribute");
|
29
|
-
|
30
|
-
rb_define_const(fileattribute, "STANDARD_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TYPE));
|
31
|
-
rb_define_const(fileattribute, "STANDARD_IS_HIDDEN", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN));
|
32
|
-
rb_define_const(fileattribute, "STANDARD_IS_BACKUP", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP));
|
33
|
-
rb_define_const(fileattribute, "STANDARD_IS_SYMLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
|
34
|
-
rb_define_const(fileattribute, "STANDARD_IS_VIRTUAL", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL));
|
35
|
-
rb_define_const(fileattribute, "STANDARD_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_NAME));
|
36
|
-
rb_define_const(fileattribute, "STANDARD_DISPLAY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME));
|
37
|
-
rb_define_const(fileattribute, "STANDARD_EDIT_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME));
|
38
|
-
rb_define_const(fileattribute, "STANDARD_COPY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_COPY_NAME));
|
39
|
-
rb_define_const(fileattribute, "STANDARD_DESCRIPTION", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION));
|
40
|
-
rb_define_const(fileattribute, "STANDARD_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ICON));
|
41
|
-
rb_define_const(fileattribute, "STANDARD_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE));
|
42
|
-
rb_define_const(fileattribute, "STANDARD_FAST_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE));
|
43
|
-
rb_define_const(fileattribute, "STANDARD_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SIZE));
|
44
|
-
rb_define_const(fileattribute, "STANDARD_ALLOCATED_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
|
45
|
-
rb_define_const(fileattribute, "STANDARD_SYMLINK_TARGET", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
|
46
|
-
rb_define_const(fileattribute, "STANDARD_TARGET_URI", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TARGET_URI));
|
47
|
-
rb_define_const(fileattribute, "STANDARD_SORT_ORDER", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER));
|
48
|
-
rb_define_const(fileattribute, "ETAG_VALUE", CSTR2RVAL(G_FILE_ATTRIBUTE_ETAG_VALUE));
|
49
|
-
rb_define_const(fileattribute, "ID_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILE));
|
50
|
-
rb_define_const(fileattribute, "ID_FILESYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILESYSTEM));
|
51
|
-
rb_define_const(fileattribute, "ACCESS_CAN_READ", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_READ));
|
52
|
-
rb_define_const(fileattribute, "ACCESS_CAN_WRITE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE));
|
53
|
-
rb_define_const(fileattribute, "ACCESS_CAN_EXECUTE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE));
|
54
|
-
rb_define_const(fileattribute, "ACCESS_CAN_DELETE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE));
|
55
|
-
rb_define_const(fileattribute, "ACCESS_CAN_TRASH", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH));
|
56
|
-
rb_define_const(fileattribute, "ACCESS_CAN_RENAME", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME));
|
57
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_MOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT));
|
58
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_UNMOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT));
|
59
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_EJECT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT));
|
60
|
-
rb_define_const(fileattribute, "MOUNTABLE_UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE));
|
61
|
-
rb_define_const(fileattribute, "MOUNTABLE_UNIX_DEVICE_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE));
|
62
|
-
rb_define_const(fileattribute, "MOUNTABLE_HAL_UDI", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI));
|
63
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_POLL", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL));
|
64
|
-
rb_define_const(fileattribute, "MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC));
|
65
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_START", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START));
|
66
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_START_DEGRADED", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED));
|
67
|
-
rb_define_const(fileattribute, "MOUNTABLE_CAN_STOP", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP));
|
68
|
-
rb_define_const(fileattribute, "MOUNTABLE_START_STOP_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE));
|
69
|
-
rb_define_const(fileattribute, "TIME_MODIFIED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED));
|
70
|
-
rb_define_const(fileattribute, "TIME_MODIFIED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC));
|
71
|
-
rb_define_const(fileattribute, "TIME_ACCESS", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS));
|
72
|
-
rb_define_const(fileattribute, "TIME_ACCESS_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS_USEC));
|
73
|
-
rb_define_const(fileattribute, "TIME_CHANGED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED));
|
74
|
-
rb_define_const(fileattribute, "TIME_CHANGED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED_USEC));
|
75
|
-
rb_define_const(fileattribute, "TIME_CREATED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED));
|
76
|
-
rb_define_const(fileattribute, "TIME_CREATED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED_USEC));
|
77
|
-
rb_define_const(fileattribute, "UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_DEVICE));
|
78
|
-
rb_define_const(fileattribute, "UNIX_INODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_INODE));
|
79
|
-
rb_define_const(fileattribute, "UNIX_MODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_MODE));
|
80
|
-
rb_define_const(fileattribute, "UNIX_NLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_NLINK));
|
81
|
-
rb_define_const(fileattribute, "UNIX_UID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_UID));
|
82
|
-
rb_define_const(fileattribute, "UNIX_GID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_GID));
|
83
|
-
rb_define_const(fileattribute, "UNIX_RDEV", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_RDEV));
|
84
|
-
rb_define_const(fileattribute, "UNIX_BLOCK_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE));
|
85
|
-
rb_define_const(fileattribute, "UNIX_BLOCKS", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCKS));
|
86
|
-
rb_define_const(fileattribute, "UNIX_IS_MOUNTPOINT", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT));
|
87
|
-
rb_define_const(fileattribute, "DOS_IS_ARCHIVE", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE));
|
88
|
-
rb_define_const(fileattribute, "DOS_IS_SYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_SYSTEM));
|
89
|
-
rb_define_const(fileattribute, "OWNER_USER", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER));
|
90
|
-
rb_define_const(fileattribute, "OWNER_USER_REAL", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER_REAL));
|
91
|
-
rb_define_const(fileattribute, "OWNER_GROUP", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_GROUP));
|
92
|
-
rb_define_const(fileattribute, "THUMBNAIL_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAIL_PATH));
|
93
|
-
rb_define_const(fileattribute, "THUMBNAILING_FAILED", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAILING_FAILED));
|
94
|
-
rb_define_const(fileattribute, "PREVIEW_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_PREVIEW_ICON));
|
95
|
-
rb_define_const(fileattribute, "FILESYSTEM_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_SIZE));
|
96
|
-
rb_define_const(fileattribute, "FILESYSTEM_FREE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_FREE));
|
97
|
-
rb_define_const(fileattribute, "FILESYSTEM_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_TYPE));
|
98
|
-
rb_define_const(fileattribute, "FILESYSTEM_READONLY", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_READONLY));
|
99
|
-
rb_define_const(fileattribute, "FILESYSTEM_USE_PREVIEW", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW));
|
100
|
-
rb_define_const(fileattribute, "GVFS_BACKEND", CSTR2RVAL(G_FILE_ATTRIBUTE_GVFS_BACKEND));
|
101
|
-
rb_define_const(fileattribute, "SELINUX_CONTEXT", CSTR2RVAL(G_FILE_ATTRIBUTE_SELINUX_CONTEXT));
|
102
|
-
rb_define_const(fileattribute, "TRASH_ITEM_COUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT));
|
103
|
-
rb_define_const(fileattribute, "TRASH_DELETION_DATE", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_DELETION_DATE));
|
104
|
-
rb_define_const(fileattribute, "TRASH_ORIG_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ORIG_PATH));
|
105
|
-
|
106
|
-
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_TYPE, "Type", fileattribute);
|
107
|
-
G_DEF_CONSTANTS(fileattribute, G_TYPE_FILE_ATTRIBUTE_TYPE, "G_FILE_ATTRIBUTE_");
|
108
|
-
|
109
|
-
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_STATUS, "Status", fileattribute);
|
110
|
-
G_DEF_CONSTANTS(fileattribute, G_TYPE_FILE_ATTRIBUTE_STATUS, "G_FILE_ATTRIBUTE_");
|
111
|
-
}
|
@@ -1,89 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
static GFileAttributeInfo *
|
24
|
-
fileattributeinfo_copy(const GFileAttributeInfo *info)
|
25
|
-
{
|
26
|
-
return (GFileAttributeInfo *)info;
|
27
|
-
}
|
28
|
-
|
29
|
-
static void
|
30
|
-
fileattributeinfo_free(G_GNUC_UNUSED GFileAttributeInfo *info)
|
31
|
-
{
|
32
|
-
return;
|
33
|
-
}
|
34
|
-
|
35
|
-
GType
|
36
|
-
g_file_attribute_info_get_type(void)
|
37
|
-
{
|
38
|
-
static GType our_type = 0;
|
39
|
-
|
40
|
-
if (our_type == 0)
|
41
|
-
our_type = g_boxed_type_register_static("GFileAttributeInfo",
|
42
|
-
(GBoxedCopyFunc)fileattributeinfo_copy,
|
43
|
-
(GBoxedFreeFunc)fileattributeinfo_free);
|
44
|
-
|
45
|
-
return our_type;
|
46
|
-
}
|
47
|
-
|
48
|
-
#define RVAL2GFILEATTRIBUTEINFO(object) \
|
49
|
-
((GFileAttributeInfo *)(RVAL2BOXED(object, G_TYPE_FILE_ATTRIBUTE_INFO)))
|
50
|
-
|
51
|
-
#define _SELF(value) RVAL2GFILEATTRIBUTEINFO(value)
|
52
|
-
|
53
|
-
#define GFILEATTRIBUTEINFOFLAGS2RVAL(value) \
|
54
|
-
GFLAGS2RVAL((value), G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS)
|
55
|
-
|
56
|
-
static VALUE
|
57
|
-
fileattributeinfo_name(VALUE self)
|
58
|
-
{
|
59
|
-
return CSTR2RVAL(_SELF(self)->name);
|
60
|
-
}
|
61
|
-
|
62
|
-
static VALUE
|
63
|
-
fileattributeinfo_type(VALUE self)
|
64
|
-
{
|
65
|
-
return GFILEATTRIBUTETYPE2RVAL(_SELF(self)->type);
|
66
|
-
}
|
67
|
-
|
68
|
-
static VALUE
|
69
|
-
fileattributeinfo_flags(VALUE self)
|
70
|
-
{
|
71
|
-
return GFILEATTRIBUTEINFOFLAGS2RVAL(_SELF(self)->flags);
|
72
|
-
}
|
73
|
-
|
74
|
-
void
|
75
|
-
Init_gfileattributeinfo(VALUE glib)
|
76
|
-
{
|
77
|
-
VALUE fileattributeinfo;
|
78
|
-
|
79
|
-
fileattributeinfo = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO, "FileAttributeInfo", glib);
|
80
|
-
|
81
|
-
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "Flags", fileattributeinfo);
|
82
|
-
G_DEF_CONSTANTS(fileattributeinfo, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "G_FILE_ATTRIBUTE_INFO_");
|
83
|
-
|
84
|
-
rbgobj_boxed_not_copy_obj(G_TYPE_FILE_ATTRIBUTE_INFO);
|
85
|
-
|
86
|
-
rb_define_method(fileattributeinfo, "name", fileattributeinfo_name, 0);
|
87
|
-
rb_define_method(fileattributeinfo, "type", fileattributeinfo_type, 0);
|
88
|
-
rb_define_method(fileattributeinfo, "flags", fileattributeinfo_flags, 0);
|
89
|
-
}
|
@@ -1,109 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
#define RVAL2GFILEATTRIBUTEINFOFLAGS(value) \
|
24
|
-
RVAL2GFLAGS((value), G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS)
|
25
|
-
|
26
|
-
#define RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(value) \
|
27
|
-
RVAL2TYPE_WITH_DEFAULT((value), \
|
28
|
-
RVAL2GFILEATTRIBUTEINFOFLAGS, \
|
29
|
-
G_FILE_ATTRIBUTE_INFO_NONE)
|
30
|
-
|
31
|
-
GType
|
32
|
-
g_file_attribute_info_list_get_type(void)
|
33
|
-
{
|
34
|
-
static GType our_type = 0;
|
35
|
-
if (our_type == 0)
|
36
|
-
our_type = g_boxed_type_register_static("GFileAttributeInfoList",
|
37
|
-
(GBoxedCopyFunc)g_file_attribute_info_list_ref,
|
38
|
-
(GBoxedFreeFunc)g_file_attribute_info_list_unref);
|
39
|
-
return our_type;
|
40
|
-
}
|
41
|
-
|
42
|
-
#define RVAL2GFILEATTRIBUTEINFOLIST(object) \
|
43
|
-
((GFileAttributeInfoList *)(RVAL2BOXED(object, G_TYPE_FILE_ATTRIBUTE_INFO_LIST)))
|
44
|
-
|
45
|
-
#define _SELF(value) RVAL2GFILEATTRIBUTEINFOLIST(value)
|
46
|
-
|
47
|
-
static VALUE
|
48
|
-
fileattributeinfolist_initialize(VALUE self)
|
49
|
-
{
|
50
|
-
G_INITIALIZE(self, g_file_attribute_info_list_new());
|
51
|
-
|
52
|
-
return Qnil;
|
53
|
-
}
|
54
|
-
|
55
|
-
static VALUE
|
56
|
-
fileattributeinfolist_dup(VALUE self)
|
57
|
-
{
|
58
|
-
return GFILEATTRIBUTEINFOLIST2RVAL(g_file_attribute_info_list_dup(_SELF(self)));
|
59
|
-
}
|
60
|
-
|
61
|
-
static VALUE
|
62
|
-
fileattributeinfolist_lookup(VALUE self, VALUE name)
|
63
|
-
{
|
64
|
-
/* TODO: How do we deal with the const? */
|
65
|
-
return GFILEATTRIBUTEINFO2RVAL((GFileAttributeInfo *)g_file_attribute_info_list_lookup(_SELF(self),
|
66
|
-
RVAL2CSTR(name)));
|
67
|
-
}
|
68
|
-
|
69
|
-
static VALUE
|
70
|
-
fileattributeinfolist_add(int argc, VALUE *argv, VALUE self)
|
71
|
-
{
|
72
|
-
VALUE name, type, flags;
|
73
|
-
|
74
|
-
rb_scan_args(argc, argv, "21", &name, &type, &flags);
|
75
|
-
|
76
|
-
g_file_attribute_info_list_add(_SELF(self),
|
77
|
-
RVAL2CSTR(name),
|
78
|
-
RVAL2GFILEATTRIBUTETYPE(type),
|
79
|
-
RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(flags));
|
80
|
-
|
81
|
-
return self;
|
82
|
-
}
|
83
|
-
|
84
|
-
static VALUE
|
85
|
-
fileattributeinfolist_each(VALUE self)
|
86
|
-
{
|
87
|
-
GFileAttributeInfoList *list = RVAL2GFILEATTRIBUTEINFOLIST(self);
|
88
|
-
int i;
|
89
|
-
|
90
|
-
for (i = 0; i < list->n_infos; i++)
|
91
|
-
rb_yield(GFILEATTRIBUTEINFO2RVAL(&list->infos[i]));
|
92
|
-
|
93
|
-
return self;
|
94
|
-
}
|
95
|
-
|
96
|
-
void
|
97
|
-
Init_fileattributeinfolist(VALUE glib)
|
98
|
-
{
|
99
|
-
VALUE fileattributeinfolist = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_LIST, "FileAttributeInfoList", glib);
|
100
|
-
|
101
|
-
rb_include_module(fileattributeinfolist, rb_mEnumerable);
|
102
|
-
|
103
|
-
rb_define_method(fileattributeinfolist, "initialize", fileattributeinfolist_initialize, 0);
|
104
|
-
rb_define_method(fileattributeinfolist, "dup", fileattributeinfolist_dup, 0);
|
105
|
-
rb_define_method(fileattributeinfolist, "lookup", fileattributeinfolist_lookup, 1);
|
106
|
-
rb_define_alias(fileattributeinfolist, "[]", "lookup");
|
107
|
-
rb_define_method(fileattributeinfolist, "add", fileattributeinfolist_add, 3);
|
108
|
-
rb_define_method(fileattributeinfolist, "each", fileattributeinfolist_each, 0);
|
109
|
-
}
|
@@ -1,90 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby" -*- */
|
2
|
-
/*
|
3
|
-
* Ruby/GIO: a Ruby binding of gio-2.0.x.
|
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.
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "gio2.h"
|
22
|
-
|
23
|
-
GType
|
24
|
-
g_file_attribute_matcher_get_type(void)
|
25
|
-
{
|
26
|
-
static GType our_type = 0;
|
27
|
-
if (our_type == 0)
|
28
|
-
our_type = g_boxed_type_register_static("GFileAttributeMatcher",
|
29
|
-
(GBoxedCopyFunc)g_file_attribute_matcher_ref,
|
30
|
-
(GBoxedFreeFunc)g_file_attribute_matcher_unref);
|
31
|
-
return our_type;
|
32
|
-
}
|
33
|
-
|
34
|
-
#define _SELF(value) RVAL2GFILEATTRIBUTEMATCHER(value)
|
35
|
-
|
36
|
-
static VALUE
|
37
|
-
fileattributematcher_initialize(VALUE self, VALUE attributes)
|
38
|
-
{
|
39
|
-
G_INITIALIZE(self, g_file_attribute_matcher_new(RVAL2CSTR(attributes)));
|
40
|
-
|
41
|
-
return Qnil;
|
42
|
-
}
|
43
|
-
|
44
|
-
static VALUE
|
45
|
-
fileattributematcher_matches(VALUE self, VALUE attribute)
|
46
|
-
{
|
47
|
-
return CBOOL2RVAL(g_file_attribute_matcher_matches(_SELF(self), RVAL2CSTR(attribute)));
|
48
|
-
}
|
49
|
-
|
50
|
-
static VALUE
|
51
|
-
fileattributematcher_matches_only(VALUE self, VALUE attribute)
|
52
|
-
{
|
53
|
-
return CBOOL2RVAL(g_file_attribute_matcher_matches_only(_SELF(self), RVAL2CSTR(attribute)));
|
54
|
-
}
|
55
|
-
|
56
|
-
static VALUE
|
57
|
-
fileattributematcher_enumerate_namespace(VALUE self, VALUE ns)
|
58
|
-
{
|
59
|
-
const char *match;
|
60
|
-
gboolean matches_all = g_file_attribute_matcher_enumerate_namespace(_SELF(self),
|
61
|
-
RVAL2CSTR(ns));
|
62
|
-
if (!rb_block_given_p())
|
63
|
-
return CBOOL2RVAL(matches_all);
|
64
|
-
|
65
|
-
while ((match = g_file_attribute_matcher_enumerate_next(_SELF(self))) != NULL)
|
66
|
-
rb_yield(CSTR2RVAL(match));
|
67
|
-
|
68
|
-
return self;
|
69
|
-
}
|
70
|
-
|
71
|
-
static VALUE
|
72
|
-
fileattributematcher_enumerate_next(VALUE self)
|
73
|
-
{
|
74
|
-
return CSTR2RVAL(g_file_attribute_matcher_enumerate_next(_SELF(self)));
|
75
|
-
}
|
76
|
-
|
77
|
-
void
|
78
|
-
Init_gfileattributematcher(VALUE glib)
|
79
|
-
{
|
80
|
-
VALUE fileattributematcher = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_MATCHER, "FileAttributeMatcher", glib);
|
81
|
-
|
82
|
-
rb_define_method(fileattributematcher, "initialize", fileattributematcher_initialize, 1);
|
83
|
-
rb_define_method(fileattributematcher, "matches?", fileattributematcher_matches, 1);
|
84
|
-
/* TODO: Is this confusing when we have both #matches and
|
85
|
-
* #matches_only? What does #=~ call? */
|
86
|
-
rb_define_alias(fileattributematcher, "=~", "matches?");
|
87
|
-
rb_define_method(fileattributematcher, "matches_only?", fileattributematcher_matches_only, 1);
|
88
|
-
rb_define_method(fileattributematcher, "enumerate_namespace", fileattributematcher_enumerate_namespace, 1);
|
89
|
-
rb_define_method(fileattributematcher, "enumerate_next", fileattributematcher_enumerate_next, 0);
|
90
|
-
}
|