gio2 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +26 -9
- data/ext/gio2/extconf.rb +38 -28
- data/ext/gio2/rb-gio2-pollable-source.c +59 -0
- data/ext/gio2/{rbgiofilteroutputstream.c → rb-gio2.c} +9 -5
- data/ext/gio2/{gio2.c → rb-gio2.h} +5 -10
- data/extconf.rb +22 -6
- data/lib/1.9/gio2.so +0 -0
- data/lib/2.0/gio2.so +0 -0
- data/lib/2.1/gio2.so +0 -0
- data/lib/gio2/deprecated.rb +16 -0
- data/lib/gio2/inet-address.rb +33 -0
- data/lib/gio2/input-stream.rb +39 -0
- data/lib/gio2/loader.rb +244 -0
- data/lib/gio2/output-stream.rb +24 -0
- data/lib/gio2/pollable-input-stream.rb +51 -0
- data/lib/gio2/pollable-output-stream.rb +32 -0
- data/lib/gio2/resources.rb +62 -0
- data/lib/gio2.rb +38 -143
- data/test/fixture/content-type/x-content/unix-software/autorun.sh +1 -0
- data/test/fixture/resource/Rakefile +32 -0
- data/test/fixture/resource/logo.png +0 -0
- data/test/fixture/resource/ruby-gio2.gresource +0 -0
- data/test/fixture/resource/ruby-gio2.gresource.xml +6 -0
- data/test/gio2-test-utils/fixture.rb +24 -0
- data/test/gio2-test-utils/socket-client.rb +59 -0
- data/test/gio2-test-utils.rb +21 -0
- data/test/run-test.rb +45 -9
- data/test/test-buffered-input-stream.rb +23 -0
- data/test/test-charset-converter.rb +23 -0
- data/test/test-content-type.rb +31 -0
- data/test/test-data-input-stream.rb +21 -0
- data/test/test-file-enumerator.rb +26 -0
- data/test/test-file-monitor.rb +33 -0
- data/test/test-file.rb +28 -0
- data/test/test-inet-address.rb +34 -0
- data/test/test-input-stream.rb +36 -0
- data/test/test-output-stream.rb +39 -0
- data/test/test-pollable-input-stream.rb +54 -0
- data/test/test-pollable-output-stream.rb +53 -0
- data/test/test-resources.rb +58 -0
- metadata +49 -107
- data/README +0 -34
- data/ext/gio2/depend +0 -11
- data/ext/gio2/gio2.def +0 -2
- data/ext/gio2/gio2.h +0 -30
- data/ext/gio2/rbgio.c +0 -133
- data/ext/gio2/rbgio2.h +0 -158
- data/ext/gio2/rbgio2conversions.h +0 -154
- data/ext/gio2/rbgio2private.h +0 -148
- data/ext/gio2/rbgioappinfo.c +0 -317
- data/ext/gio2/rbgioapplaunchcontext.c +0 -81
- data/ext/gio2/rbgioasyncinitable.c +0 -246
- data/ext/gio2/rbgioasyncresult.c +0 -41
- data/ext/gio2/rbgiobufferedinputstream.c +0 -167
- data/ext/gio2/rbgiobufferedoutputstream.c +0 -50
- data/ext/gio2/rbgiocancellable.c +0 -180
- data/ext/gio2/rbgiocharsetconverter.c +0 -57
- data/ext/gio2/rbgiocontenttype.c +0 -131
- data/ext/gio2/rbgioconverter.c +0 -113
- data/ext/gio2/rbgioconverterinputstream.c +0 -43
- data/ext/gio2/rbgioconverteroutputstream.c +0 -43
- data/ext/gio2/rbgiodatainputstream.c +0 -309
- data/ext/gio2/rbgiodataoutputstream.c +0 -186
- data/ext/gio2/rbgiodesktopappinfo.c +0 -87
- data/ext/gio2/rbgiodrive.c +0 -266
- data/ext/gio2/rbgioemblem.c +0 -52
- data/ext/gio2/rbgioemblemedicon.c +0 -65
- data/ext/gio2/rbgiofile.c +0 -2045
- data/ext/gio2/rbgiofileattribute.c +0 -114
- data/ext/gio2/rbgiofileattributeinfo.c +0 -86
- data/ext/gio2/rbgiofileattributeinfolist.c +0 -108
- data/ext/gio2/rbgiofileattributematcher.c +0 -95
- data/ext/gio2/rbgiofiledescriptorbased.c +0 -45
- data/ext/gio2/rbgiofileenumerator.c +0 -166
- data/ext/gio2/rbgiofileicon.c +0 -41
- data/ext/gio2/rbgiofileinfo.c +0 -617
- data/ext/gio2/rbgiofileinputstream.c +0 -91
- data/ext/gio2/rbgiofileiostream.c +0 -98
- data/ext/gio2/rbgiofilemonitor.c +0 -46
- data/ext/gio2/rbgiofilenamecompleter.c +0 -73
- data/ext/gio2/rbgiofileoutputstream.c +0 -98
- data/ext/gio2/rbgiofilterinputstream.c +0 -28
- data/ext/gio2/rbgioicon.c +0 -69
- data/ext/gio2/rbgioinetaddress.c +0 -118
- data/ext/gio2/rbgioinetsocketaddress.c +0 -41
- data/ext/gio2/rbgioinitable.c +0 -199
- data/ext/gio2/rbgioinputstream.c +0 -341
- data/ext/gio2/rbgioio.c +0 -73
- data/ext/gio2/rbgioiomodule.c +0 -45
- data/ext/gio2/rbgioiomodules.c +0 -47
- data/ext/gio2/rbgioioscheduler.c +0 -102
- data/ext/gio2/rbgioioschedulerjob.c +0 -121
- data/ext/gio2/rbgioiostream.c +0 -107
- data/ext/gio2/rbgioloadableicon.c +0 -92
- data/ext/gio2/rbgiomemoryinputstream.c +0 -67
- data/ext/gio2/rbgiomemoryoutputstream.c +0 -44
- data/ext/gio2/rbgiomount.c +0 -286
- data/ext/gio2/rbgiomountoperation.c +0 -53
- data/ext/gio2/rbgionetworkaddress.c +0 -59
- data/ext/gio2/rbgionetworkservice.c +0 -45
- data/ext/gio2/rbgiooutputstream.c +0 -331
- data/ext/gio2/rbgioresolver.c +0 -230
- data/ext/gio2/rbgioseekable.c +0 -91
- data/ext/gio2/rbgiosimpleasyncresult.c +0 -152
- data/ext/gio2/rbgiosocket.c +0 -390
- data/ext/gio2/rbgiosocketaddress.c +0 -34
- data/ext/gio2/rbgiosocketaddressenumerator.c +0 -83
- data/ext/gio2/rbgiosocketclient.c +0 -207
- data/ext/gio2/rbgiosocketconnectable.c +0 -41
- data/ext/gio2/rbgiosocketconnection.c +0 -66
- data/ext/gio2/rbgiosocketconnectionfactory.c +0 -39
- data/ext/gio2/rbgiosocketcontrolmessage.c +0 -82
- data/ext/gio2/rbgiosocketlistener.c +0 -246
- data/ext/gio2/rbgiosocketservice.c +0 -66
- data/ext/gio2/rbgiosrvtarget.c +0 -76
- data/ext/gio2/rbgiotcpconnection.c +0 -28
- data/ext/gio2/rbgiothemedicon.c +0 -83
- data/ext/gio2/rbgiothreadedsocketservice.c +0 -43
- data/ext/gio2/rbgiotlscertificate.c +0 -89
- data/ext/gio2/rbgiounixconnection.c +0 -71
- data/ext/gio2/rbgiounixfdlist.c +0 -115
- data/ext/gio2/rbgiounixfdmessage.c +0 -74
- data/ext/gio2/rbgiounixinputstream.c +0 -51
- data/ext/gio2/rbgiounixmount.c +0 -164
- data/ext/gio2/rbgiounixmountmonitor.c +0 -65
- data/ext/gio2/rbgiounixmountpoint.c +0 -136
- data/ext/gio2/rbgiounixmountpoints.c +0 -58
- data/ext/gio2/rbgiounixmounts.c +0 -58
- data/ext/gio2/rbgiounixoutputstream.c +0 -51
- data/ext/gio2/rbgiounixsocketaddress.c +0 -69
- data/ext/gio2/rbgiovfs.c +0 -84
- data/ext/gio2/rbgiovolume.c +0 -193
- data/ext/gio2/rbgiovolumemonitor.c +0 -77
- data/ext/gio2/rbgiozlibcompressor.c +0 -52
- data/ext/gio2/rbgiozlibdecompressor.c +0 -45
- data/ext/gio2/util.c +0 -303
- data/test/test_bufferedinputstream.rb +0 -9
- data/test/test_charsetconverter.rb +0 -9
- data/test/test_datainputstream.rb +0 -7
- data/test/test_fileenumerator.rb +0 -8
- data/test/test_filemonitor.rb +0 -17
- data/test/test_inetaddress.rb +0 -8
@@ -1,114 +0,0 @@
|
|
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 mFileAttribute
|
25
|
-
|
26
|
-
void
|
27
|
-
Init_gfileattribute(VALUE mGio)
|
28
|
-
{
|
29
|
-
VALUE RG_TARGET_NAMESPACE;
|
30
|
-
|
31
|
-
RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "FileAttribute");
|
32
|
-
|
33
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TYPE));
|
34
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_HIDDEN", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN));
|
35
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_BACKUP", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP));
|
36
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_SYMLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
|
37
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_VIRTUAL", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL));
|
38
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_NAME));
|
39
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_DISPLAY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME));
|
40
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_EDIT_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME));
|
41
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_COPY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_COPY_NAME));
|
42
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_DESCRIPTION", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION));
|
43
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ICON));
|
44
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE));
|
45
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_FAST_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE));
|
46
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SIZE));
|
47
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_ALLOCATED_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
|
48
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SYMLINK_TARGET", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
|
49
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_TARGET_URI", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TARGET_URI));
|
50
|
-
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SORT_ORDER", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER));
|
51
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ETAG_VALUE", CSTR2RVAL(G_FILE_ATTRIBUTE_ETAG_VALUE));
|
52
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ID_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILE));
|
53
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ID_FILESYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILESYSTEM));
|
54
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_READ", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_READ));
|
55
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_WRITE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE));
|
56
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_EXECUTE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE));
|
57
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_DELETE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE));
|
58
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_TRASH", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH));
|
59
|
-
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_RENAME", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME));
|
60
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_MOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT));
|
61
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_UNMOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT));
|
62
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_EJECT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT));
|
63
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE));
|
64
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_UNIX_DEVICE_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE));
|
65
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_HAL_UDI", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI));
|
66
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_POLL", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL));
|
67
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC));
|
68
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_START", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START));
|
69
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_START_DEGRADED", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED));
|
70
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_STOP", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP));
|
71
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_START_STOP_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE));
|
72
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_MODIFIED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED));
|
73
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_MODIFIED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC));
|
74
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_ACCESS", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS));
|
75
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_ACCESS_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS_USEC));
|
76
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CHANGED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED));
|
77
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CHANGED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED_USEC));
|
78
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CREATED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED));
|
79
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CREATED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED_USEC));
|
80
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_DEVICE));
|
81
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_INODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_INODE));
|
82
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_MODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_MODE));
|
83
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_NLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_NLINK));
|
84
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_UID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_UID));
|
85
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_GID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_GID));
|
86
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_RDEV", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_RDEV));
|
87
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_BLOCK_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE));
|
88
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_BLOCKS", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCKS));
|
89
|
-
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_IS_MOUNTPOINT", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT));
|
90
|
-
rb_define_const(RG_TARGET_NAMESPACE, "DOS_IS_ARCHIVE", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE));
|
91
|
-
rb_define_const(RG_TARGET_NAMESPACE, "DOS_IS_SYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_SYSTEM));
|
92
|
-
rb_define_const(RG_TARGET_NAMESPACE, "OWNER_USER", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER));
|
93
|
-
rb_define_const(RG_TARGET_NAMESPACE, "OWNER_USER_REAL", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER_REAL));
|
94
|
-
rb_define_const(RG_TARGET_NAMESPACE, "OWNER_GROUP", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_GROUP));
|
95
|
-
rb_define_const(RG_TARGET_NAMESPACE, "THUMBNAIL_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAIL_PATH));
|
96
|
-
rb_define_const(RG_TARGET_NAMESPACE, "THUMBNAILING_FAILED", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAILING_FAILED));
|
97
|
-
rb_define_const(RG_TARGET_NAMESPACE, "PREVIEW_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_PREVIEW_ICON));
|
98
|
-
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_SIZE));
|
99
|
-
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_FREE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_FREE));
|
100
|
-
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_TYPE));
|
101
|
-
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_READONLY", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_READONLY));
|
102
|
-
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_USE_PREVIEW", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW));
|
103
|
-
rb_define_const(RG_TARGET_NAMESPACE, "GVFS_BACKEND", CSTR2RVAL(G_FILE_ATTRIBUTE_GVFS_BACKEND));
|
104
|
-
rb_define_const(RG_TARGET_NAMESPACE, "SELINUX_CONTEXT", CSTR2RVAL(G_FILE_ATTRIBUTE_SELINUX_CONTEXT));
|
105
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TRASH_ITEM_COUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT));
|
106
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TRASH_DELETION_DATE", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_DELETION_DATE));
|
107
|
-
rb_define_const(RG_TARGET_NAMESPACE, "TRASH_ORIG_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ORIG_PATH));
|
108
|
-
|
109
|
-
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_TYPE, "Type", RG_TARGET_NAMESPACE);
|
110
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_TYPE, "G_FILE_ATTRIBUTE_");
|
111
|
-
|
112
|
-
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_STATUS, "Status", RG_TARGET_NAMESPACE);
|
113
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_STATUS, "G_FILE_ATTRIBUTE_");
|
114
|
-
}
|
@@ -1,86 +0,0 @@
|
|
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 cFileAttributeInfo
|
25
|
-
|
26
|
-
static GFileAttributeInfo *
|
27
|
-
fileattributeinfo_copy(const GFileAttributeInfo *info)
|
28
|
-
{
|
29
|
-
return (GFileAttributeInfo *)info;
|
30
|
-
}
|
31
|
-
|
32
|
-
static void
|
33
|
-
fileattributeinfo_free(G_GNUC_UNUSED GFileAttributeInfo *info)
|
34
|
-
{
|
35
|
-
return;
|
36
|
-
}
|
37
|
-
|
38
|
-
GType
|
39
|
-
g_file_attribute_info_get_type(void)
|
40
|
-
{
|
41
|
-
static GType our_type = 0;
|
42
|
-
|
43
|
-
if (our_type == 0)
|
44
|
-
our_type = g_boxed_type_register_static("GFileAttributeInfo",
|
45
|
-
(GBoxedCopyFunc)fileattributeinfo_copy,
|
46
|
-
(GBoxedFreeFunc)fileattributeinfo_free);
|
47
|
-
|
48
|
-
return our_type;
|
49
|
-
}
|
50
|
-
|
51
|
-
#define _SELF(value) RVAL2GFILEATTRIBUTEINFO(value)
|
52
|
-
|
53
|
-
static VALUE
|
54
|
-
rg_name(VALUE self)
|
55
|
-
{
|
56
|
-
return CSTR2RVAL(_SELF(self)->name);
|
57
|
-
}
|
58
|
-
|
59
|
-
static VALUE
|
60
|
-
rg_type(VALUE self)
|
61
|
-
{
|
62
|
-
return GFILEATTRIBUTETYPE2RVAL(_SELF(self)->type);
|
63
|
-
}
|
64
|
-
|
65
|
-
static VALUE
|
66
|
-
rg_flags(VALUE self)
|
67
|
-
{
|
68
|
-
return GFILEATTRIBUTEINFOFLAGS2RVAL(_SELF(self)->flags);
|
69
|
-
}
|
70
|
-
|
71
|
-
void
|
72
|
-
Init_gfileattributeinfo(VALUE mGio)
|
73
|
-
{
|
74
|
-
VALUE RG_TARGET_NAMESPACE;
|
75
|
-
|
76
|
-
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO, "FileAttributeInfo", mGio);
|
77
|
-
|
78
|
-
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
79
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "G_FILE_ATTRIBUTE_INFO_");
|
80
|
-
|
81
|
-
rbgobj_boxed_not_copy_obj(G_TYPE_FILE_ATTRIBUTE_INFO);
|
82
|
-
|
83
|
-
RG_DEF_METHOD(name, 0);
|
84
|
-
RG_DEF_METHOD(type, 0);
|
85
|
-
RG_DEF_METHOD(flags, 0);
|
86
|
-
}
|
@@ -1,108 +0,0 @@
|
|
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 cFileAttributeInfoList
|
25
|
-
|
26
|
-
#define RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(value) \
|
27
|
-
RVAL2TYPE_WITH_DEFAULT((value), \
|
28
|
-
RVAL2GFILEATTRIBUTEINFOFLAGS, \
|
29
|
-
G_FILE_ATTRIBUTE_INFO_NONE)
|
30
|
-
|
31
|
-
#if !GLIB_CHECK_VERSION(2, 34, 0)
|
32
|
-
GType
|
33
|
-
g_file_attribute_info_list_get_type(void)
|
34
|
-
{
|
35
|
-
static GType our_type = 0;
|
36
|
-
if (our_type == 0)
|
37
|
-
our_type = g_boxed_type_register_static("GFileAttributeInfoList",
|
38
|
-
(GBoxedCopyFunc)g_file_attribute_info_list_ref,
|
39
|
-
(GBoxedFreeFunc)g_file_attribute_info_list_unref);
|
40
|
-
return our_type;
|
41
|
-
}
|
42
|
-
#endif
|
43
|
-
|
44
|
-
#define _SELF(value) RVAL2GFILEATTRIBUTEINFOLIST(value)
|
45
|
-
|
46
|
-
static VALUE
|
47
|
-
rg_initialize(VALUE self)
|
48
|
-
{
|
49
|
-
G_INITIALIZE(self, g_file_attribute_info_list_new());
|
50
|
-
|
51
|
-
return Qnil;
|
52
|
-
}
|
53
|
-
|
54
|
-
static VALUE
|
55
|
-
rg_dup(VALUE self)
|
56
|
-
{
|
57
|
-
return GFILEATTRIBUTEINFOLIST2RVAL(g_file_attribute_info_list_dup(_SELF(self)));
|
58
|
-
}
|
59
|
-
|
60
|
-
static VALUE
|
61
|
-
rg_lookup(VALUE self, VALUE name)
|
62
|
-
{
|
63
|
-
/* TODO: How do we deal with the const? */
|
64
|
-
return GFILEATTRIBUTEINFO2RVAL((GFileAttributeInfo *)g_file_attribute_info_list_lookup(_SELF(self),
|
65
|
-
RVAL2CSTR(name)));
|
66
|
-
}
|
67
|
-
|
68
|
-
static VALUE
|
69
|
-
rg_add(int argc, VALUE *argv, VALUE self)
|
70
|
-
{
|
71
|
-
VALUE name, type, flags;
|
72
|
-
|
73
|
-
rb_scan_args(argc, argv, "21", &name, &type, &flags);
|
74
|
-
|
75
|
-
g_file_attribute_info_list_add(_SELF(self),
|
76
|
-
RVAL2CSTR(name),
|
77
|
-
RVAL2GFILEATTRIBUTETYPE(type),
|
78
|
-
RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(flags));
|
79
|
-
|
80
|
-
return self;
|
81
|
-
}
|
82
|
-
|
83
|
-
static VALUE
|
84
|
-
rg_each(VALUE self)
|
85
|
-
{
|
86
|
-
GFileAttributeInfoList *list = RVAL2GFILEATTRIBUTEINFOLIST(self);
|
87
|
-
int i;
|
88
|
-
|
89
|
-
for (i = 0; i < list->n_infos; i++)
|
90
|
-
rb_yield(GFILEATTRIBUTEINFO2RVAL(&list->infos[i]));
|
91
|
-
|
92
|
-
return self;
|
93
|
-
}
|
94
|
-
|
95
|
-
void
|
96
|
-
Init_fileattributeinfolist(VALUE mGio)
|
97
|
-
{
|
98
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_LIST, "FileAttributeInfoList", mGio);
|
99
|
-
|
100
|
-
rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable);
|
101
|
-
|
102
|
-
RG_DEF_METHOD(initialize, 0);
|
103
|
-
RG_DEF_METHOD(dup, 0);
|
104
|
-
RG_DEF_METHOD(lookup, 1);
|
105
|
-
RG_DEF_ALIAS("[]", "lookup");
|
106
|
-
RG_DEF_METHOD(add, 3);
|
107
|
-
RG_DEF_METHOD(each, 0);
|
108
|
-
}
|
@@ -1,95 +0,0 @@
|
|
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 cFileAttributeMatcher
|
25
|
-
|
26
|
-
#if !GLIB_CHECK_VERSION(2, 34, 0)
|
27
|
-
GType
|
28
|
-
g_file_attribute_matcher_get_type(void)
|
29
|
-
{
|
30
|
-
static GType our_type = 0;
|
31
|
-
if (our_type == 0)
|
32
|
-
our_type = g_boxed_type_register_static("GFileAttributeMatcher",
|
33
|
-
(GBoxedCopyFunc)g_file_attribute_matcher_ref,
|
34
|
-
(GBoxedFreeFunc)g_file_attribute_matcher_unref);
|
35
|
-
return our_type;
|
36
|
-
}
|
37
|
-
#endif
|
38
|
-
|
39
|
-
#define _SELF(value) RVAL2GFILEATTRIBUTEMATCHER(value)
|
40
|
-
|
41
|
-
static VALUE
|
42
|
-
rg_initialize(VALUE self, VALUE attributes)
|
43
|
-
{
|
44
|
-
G_INITIALIZE(self, g_file_attribute_matcher_new(RVAL2CSTR(attributes)));
|
45
|
-
|
46
|
-
return Qnil;
|
47
|
-
}
|
48
|
-
|
49
|
-
static VALUE
|
50
|
-
rg_matches_p(VALUE self, VALUE attribute)
|
51
|
-
{
|
52
|
-
return CBOOL2RVAL(g_file_attribute_matcher_matches(_SELF(self), RVAL2CSTR(attribute)));
|
53
|
-
}
|
54
|
-
|
55
|
-
static VALUE
|
56
|
-
rg_matches_only_p(VALUE self, VALUE attribute)
|
57
|
-
{
|
58
|
-
return CBOOL2RVAL(g_file_attribute_matcher_matches_only(_SELF(self), RVAL2CSTR(attribute)));
|
59
|
-
}
|
60
|
-
|
61
|
-
static VALUE
|
62
|
-
rg_enumerate_namespace(VALUE self, VALUE ns)
|
63
|
-
{
|
64
|
-
const char *match;
|
65
|
-
gboolean matches_all = g_file_attribute_matcher_enumerate_namespace(_SELF(self),
|
66
|
-
RVAL2CSTR(ns));
|
67
|
-
if (!rb_block_given_p())
|
68
|
-
return CBOOL2RVAL(matches_all);
|
69
|
-
|
70
|
-
while ((match = g_file_attribute_matcher_enumerate_next(_SELF(self))) != NULL)
|
71
|
-
rb_yield(CSTR2RVAL(match));
|
72
|
-
|
73
|
-
return self;
|
74
|
-
}
|
75
|
-
|
76
|
-
static VALUE
|
77
|
-
rg_enumerate_next(VALUE self)
|
78
|
-
{
|
79
|
-
return CSTR2RVAL(g_file_attribute_matcher_enumerate_next(_SELF(self)));
|
80
|
-
}
|
81
|
-
|
82
|
-
void
|
83
|
-
Init_gfileattributematcher(VALUE mGio)
|
84
|
-
{
|
85
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_MATCHER, "FileAttributeMatcher", mGio);
|
86
|
-
|
87
|
-
RG_DEF_METHOD(initialize, 1);
|
88
|
-
RG_DEF_METHOD_P(matches, 1);
|
89
|
-
/* TODO: Is this confusing when we have both #matches and
|
90
|
-
* #matches_only? What does #=~ call? */
|
91
|
-
RG_DEF_ALIAS("=~", "matches?");
|
92
|
-
RG_DEF_METHOD_P(matches_only, 1);
|
93
|
-
RG_DEF_METHOD(enumerate_namespace, 1);
|
94
|
-
RG_DEF_METHOD(enumerate_next, 0);
|
95
|
-
}
|
@@ -1,45 +0,0 @@
|
|
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
|
-
#ifdef HAVE_GIO_UNIX
|
25
|
-
#include <gio/gfiledescriptorbased.h>
|
26
|
-
|
27
|
-
#define RG_TARGET_NAMESPACE mFileDescriptorBased
|
28
|
-
#define _SELF(value) RVAL2GFILEDESCRIPTORBASED(value)
|
29
|
-
|
30
|
-
static VALUE
|
31
|
-
rg_fd(VALUE self)
|
32
|
-
{
|
33
|
-
return FD2RVAL(g_file_descriptor_based_get_fd(_SELF(self)));
|
34
|
-
}
|
35
|
-
#endif
|
36
|
-
|
37
|
-
void
|
38
|
-
Init_gfiledescriptorbased(G_GNUC_UNUSED VALUE mGio)
|
39
|
-
{
|
40
|
-
#ifdef HAVE_GIO_UNIX
|
41
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_FILE_DESCRIPTOR_BASED, "FileDescriptorBased", mGio);
|
42
|
-
|
43
|
-
RG_DEF_METHOD(fd, 0);
|
44
|
-
#endif
|
45
|
-
}
|
@@ -1,166 +0,0 @@
|
|
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 cFileEnumerator
|
25
|
-
#define _SELF(value) RVAL2GFILEENUMERATOR(value)
|
26
|
-
|
27
|
-
static VALUE
|
28
|
-
rg_next_file(int argc, VALUE *argv, VALUE self)
|
29
|
-
{
|
30
|
-
VALUE cancellable;
|
31
|
-
GError *error = NULL;
|
32
|
-
GFileInfo *info;
|
33
|
-
|
34
|
-
rb_scan_args(argc, argv, "01", &cancellable);
|
35
|
-
info = g_file_enumerator_next_file(_SELF(self),
|
36
|
-
RVAL2GCANCELLABLE(cancellable),
|
37
|
-
&error);
|
38
|
-
if (error != NULL)
|
39
|
-
rbgio_raise_error(error);
|
40
|
-
|
41
|
-
return GOBJ2RVAL_UNREF(info);
|
42
|
-
}
|
43
|
-
|
44
|
-
static VALUE
|
45
|
-
rg_close(int argc, VALUE *argv, VALUE self)
|
46
|
-
{
|
47
|
-
VALUE cancellable;
|
48
|
-
GError *error = NULL;
|
49
|
-
|
50
|
-
rb_scan_args(argc, argv, "01", &cancellable);
|
51
|
-
if (!g_file_enumerator_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
|
52
|
-
rbgio_raise_error(error);
|
53
|
-
|
54
|
-
return self;
|
55
|
-
}
|
56
|
-
|
57
|
-
static VALUE
|
58
|
-
rg_next_files_async(int argc, VALUE *argv, VALUE self)
|
59
|
-
{
|
60
|
-
VALUE rbnum_files, rbio_priority, rbcancellable, block;
|
61
|
-
int num_files;
|
62
|
-
int io_priority;
|
63
|
-
GCancellable *cancellable;
|
64
|
-
|
65
|
-
rb_scan_args(argc, argv, "12&", &rbnum_files, &rbio_priority, &rbcancellable, &block);
|
66
|
-
num_files = NUM2INT(rbnum_files);
|
67
|
-
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
68
|
-
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
69
|
-
SAVE_BLOCK(block);
|
70
|
-
g_file_enumerator_next_files_async(_SELF(self),
|
71
|
-
num_files,
|
72
|
-
io_priority,
|
73
|
-
cancellable,
|
74
|
-
rbgio_async_ready_callback,
|
75
|
-
(gpointer)block);
|
76
|
-
|
77
|
-
return self;
|
78
|
-
}
|
79
|
-
|
80
|
-
static VALUE
|
81
|
-
rg_next_files_finish(VALUE self, VALUE result)
|
82
|
-
{
|
83
|
-
GError *error = NULL;
|
84
|
-
GList *files = g_file_enumerator_next_files_finish(_SELF(self),
|
85
|
-
RVAL2GASYNCRESULT(result),
|
86
|
-
&error);
|
87
|
-
if (error != NULL)
|
88
|
-
rbgio_raise_error(error);
|
89
|
-
|
90
|
-
return GLIST2ARY_FREE(files);
|
91
|
-
}
|
92
|
-
|
93
|
-
static VALUE
|
94
|
-
rg_close_async(int argc, VALUE *argv, VALUE self)
|
95
|
-
{
|
96
|
-
VALUE rbio_priority, rbcancellable, block;
|
97
|
-
int io_priority;
|
98
|
-
GCancellable *cancellable;
|
99
|
-
|
100
|
-
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
101
|
-
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
102
|
-
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
103
|
-
SAVE_BLOCK(block);
|
104
|
-
g_file_enumerator_close_async(_SELF(self),
|
105
|
-
io_priority,
|
106
|
-
cancellable,
|
107
|
-
rbgio_async_ready_callback,
|
108
|
-
(gpointer)block);
|
109
|
-
|
110
|
-
return self;
|
111
|
-
}
|
112
|
-
|
113
|
-
static VALUE
|
114
|
-
rg_close_finish(VALUE self, VALUE result)
|
115
|
-
{
|
116
|
-
GError *error = NULL;
|
117
|
-
if (!g_file_enumerator_close_finish(_SELF(self),
|
118
|
-
RVAL2GASYNCRESULT(result),
|
119
|
-
&error))
|
120
|
-
rbgio_raise_error(error);
|
121
|
-
|
122
|
-
return Qnil;
|
123
|
-
}
|
124
|
-
|
125
|
-
static VALUE
|
126
|
-
rg_closed_p(VALUE self)
|
127
|
-
{
|
128
|
-
return CBOOL2RVAL(g_file_enumerator_is_closed(_SELF(self)));
|
129
|
-
}
|
130
|
-
|
131
|
-
static VALUE
|
132
|
-
rg_has_pending_p(VALUE self)
|
133
|
-
{
|
134
|
-
return CBOOL2RVAL(g_file_enumerator_has_pending(_SELF(self)));
|
135
|
-
}
|
136
|
-
|
137
|
-
static VALUE
|
138
|
-
rg_set_pending(VALUE self, VALUE pending)
|
139
|
-
{
|
140
|
-
g_file_enumerator_set_pending(_SELF(self), RVAL2CBOOL(pending));
|
141
|
-
|
142
|
-
return self;
|
143
|
-
}
|
144
|
-
|
145
|
-
static VALUE
|
146
|
-
rg_container(VALUE self)
|
147
|
-
{
|
148
|
-
return GOBJ2RVAL(g_file_enumerator_get_container(_SELF(self)));
|
149
|
-
}
|
150
|
-
|
151
|
-
void
|
152
|
-
Init_gfileenumerator(VALUE mGio)
|
153
|
-
{
|
154
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ENUMERATOR, "FileEnumerator", mGio);
|
155
|
-
|
156
|
-
RG_DEF_METHOD(next_file, -1);
|
157
|
-
RG_DEF_METHOD(close, -1);
|
158
|
-
RG_DEF_METHOD(next_files_async, -1);
|
159
|
-
RG_DEF_METHOD(next_files_finish, 1);
|
160
|
-
RG_DEF_METHOD(close_async, -1);
|
161
|
-
RG_DEF_METHOD(close_finish, 1);
|
162
|
-
RG_DEF_METHOD_P(closed, 0);
|
163
|
-
RG_DEF_METHOD_P(has_pending, 0);
|
164
|
-
RG_DEF_METHOD(set_pending, 1);
|
165
|
-
RG_DEF_METHOD(container, 0);
|
166
|
-
}
|
data/ext/gio2/rbgiofileicon.c
DELETED
@@ -1,41 +0,0 @@
|
|
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 cFileIcon
|
25
|
-
#define _SELF(value) RVAL2GFILEICON(value)
|
26
|
-
|
27
|
-
static VALUE
|
28
|
-
rg_initialize(VALUE self, VALUE file)
|
29
|
-
{
|
30
|
-
G_INITIALIZE(self, g_file_icon_new(RVAL2GFILE(file)));
|
31
|
-
|
32
|
-
return Qnil;
|
33
|
-
}
|
34
|
-
|
35
|
-
void
|
36
|
-
Init_gfileicon(VALUE mGio)
|
37
|
-
{
|
38
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ICON, "FileIcon", mGio);
|
39
|
-
|
40
|
-
RG_DEF_METHOD(initialize, 1);
|
41
|
-
}
|