glib2 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +4 -4
- data/Rakefile +31 -10
- data/ext/glib2/extconf.rb +2 -1
- data/ext/glib2/glib2.def +1 -0
- data/ext/glib2/rbglib.c +6 -5
- data/ext/glib2/rbglib.h +3 -3
- data/ext/glib2/rbglib_bookmarkfile.c +0 -5
- data/ext/glib2/rbglib_error.c +8 -11
- data/ext/glib2/rbglib_gettext.c +48 -0
- data/ext/glib2/rbglib_i18n.c +0 -4
- data/ext/glib2/rbglib_keyfile.c +0 -20
- data/ext/glib2/rbglib_maincontext.c +0 -14
- data/ext/glib2/rbglib_source.c +0 -4
- data/ext/glib2/rbglib_timer.c +0 -4
- data/ext/glib2/rbglib_unichar.c +0 -8
- data/ext/glib2/rbglib_utf8.c +0 -2
- data/ext/glib2/rbglib_utils.c +0 -16
- data/ext/glib2/rbglib_win32.c +0 -7
- data/ext/glib2/rbgobj_object.c +8 -12
- data/ext/glib2/rbgobj_strv.c +0 -4
- data/ext/glib2/rbgobj_typeinterface.c +0 -6
- data/ext/glib2/rbgobj_value.c +12 -0
- data/ext/glib2/rbgobject.c +20 -18
- data/ext/glib2/rbgobject.h +1 -0
- data/ext/glib2/rbgprivate.h +5 -2
- data/lib/glib2.rb +4 -0
- data/lib/gnome2/rake/external-package.rb +20 -3
- data/lib/gnome2/rake/native-binary-build-task.rb +47 -30
- data/lib/gnome2/rake/package-task.rb +11 -1
- data/lib/gnome2/rake/source-download-task.rb +2 -1
- data/lib/gnome2/rake/win32-binary-build-task.rb +28 -3
- data/lib/mkmf-gnome2.rb +2 -8
- metadata +13 -18
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 51cb310b1487ddff56bbd1779b3d01fc2c57f129
|
4
|
+
data.tar.gz: 56ef55006002b7182b07307ddd5f23a406e6247d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fb2cc0a1746d30cf284a1f37f74c750c8a665d02d9d91683b87568f5b6b933a894c227987ee083f0d247b3cd1239f2979f4fb36f736972780a615f5ea169e8b1
|
7
|
+
data.tar.gz: 2f7dc9409805337147693951158b2929571b7fed0c767699dbbce2052c2fba011bd8a7324db730c649e619f4c6182a512e6c0cd2fb49dd9f0b111f1637f1676b
|
data/README
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Ruby/GLib2
|
2
2
|
==========
|
3
|
-
Ruby/GLib2 is a Ruby binding of GLib-2.x.
|
3
|
+
Ruby/GLib2 is a Ruby binding of GLib-2.12.x.
|
4
4
|
|
5
5
|
Requirements
|
6
6
|
------------
|
7
7
|
|
8
|
-
Ruby >= 1.
|
8
|
+
Ruby >= 1.9.x: http://www.ruby-lang.org/
|
9
9
|
pkg-config.rb: http://github.com/rcairo/pkg-config
|
10
|
-
GLib >= 2.x: http://www.gtk.org/
|
10
|
+
GLib >= 2.12.x: http://www.gtk.org/
|
11
11
|
|
12
12
|
Install (RubyGems)
|
13
13
|
------------------
|
@@ -21,7 +21,7 @@ Windows:
|
|
21
21
|
Install (traditional)
|
22
22
|
---------------------
|
23
23
|
|
24
|
-
Install ruby-1.
|
24
|
+
Install ruby-1.9.x or later, pkg-config.rb and GLib-2.12.x.
|
25
25
|
|
26
26
|
% ruby extconf.rb
|
27
27
|
% make
|
data/Rakefile
CHANGED
@@ -3,27 +3,33 @@
|
|
3
3
|
$LOAD_PATH.unshift("./lib")
|
4
4
|
require 'gnome2-raketask'
|
5
5
|
|
6
|
+
bin_dir = nil
|
6
7
|
include_dir = nil
|
7
8
|
glib2_include_dir = nil
|
8
9
|
libffi_lib_dir = nil
|
9
10
|
|
11
|
+
build_host = nil
|
12
|
+
|
10
13
|
package = GNOME2Package.new do |_package|
|
14
|
+
bin_dir = (_package.windows.absolute_binary_dir + "bin").to_s
|
11
15
|
include_dir = (_package.windows.absolute_binary_dir + "include").to_s
|
12
16
|
glib2_include_dir = File.join(include_dir, "glib-2.0")
|
13
17
|
libffi_lib_dir = (_package.windows.absolute_binary_dir + "lib").to_s
|
14
18
|
|
19
|
+
build_host = _package.windows.build_host
|
20
|
+
|
15
21
|
_package.summary = "Ruby/GLib2 is a Ruby binding of GLib-2.x."
|
16
22
|
_package.description = "Ruby/GLib2 is a Ruby binding of GLib-2.x."
|
17
23
|
_package.dependency.gem.runtime = [["pkg-config", ">= 0"]]
|
18
24
|
_package.dependency.gem.development = [["test-unit", ">= 2"]]
|
19
25
|
_package.win32.packages = []
|
20
|
-
_package.win32.dependencies = ["
|
26
|
+
_package.win32.dependencies = ["libffi", "gettext-runtime"]
|
21
27
|
_package.external_packages = [
|
22
28
|
{
|
23
29
|
:name => "glib",
|
24
30
|
:download_site => :gnome,
|
25
31
|
:label => "GLib",
|
26
|
-
:version => "2.
|
32
|
+
:version => "2.38.2",
|
27
33
|
:compression_method => "xz",
|
28
34
|
:windows => {
|
29
35
|
:configure_args => [
|
@@ -32,48 +38,57 @@ package = GNOME2Package.new do |_package|
|
|
32
38
|
"--disable-modular-tests",
|
33
39
|
],
|
34
40
|
:need_autoreconf => true,
|
41
|
+
:patches => [
|
42
|
+
"glib-2.38.2-add-missing-exeext.diff",
|
43
|
+
],
|
44
|
+
:built_file => "bin/libglib-2.0-0.dll",
|
35
45
|
},
|
36
46
|
},
|
37
47
|
{
|
38
48
|
:name => "gmp",
|
39
|
-
:download_base_url => "ftp://ftp.gmplib.org/pub/gmp-5.1.
|
49
|
+
:download_base_url => "ftp://ftp.gmplib.org/pub/gmp-5.1.3",
|
40
50
|
:label => "GNU MP",
|
41
|
-
:version => "5.1.
|
51
|
+
:version => "5.1.3",
|
42
52
|
:compression_method => "xz",
|
43
53
|
:windows => {
|
44
54
|
:configure_args => [
|
45
55
|
"--disable-static",
|
46
56
|
"--enable-shared",
|
47
57
|
],
|
58
|
+
:built_file => "bin/libgmp-10.dll",
|
48
59
|
},
|
49
60
|
},
|
50
61
|
{
|
51
62
|
:name => "nettle",
|
52
63
|
:download_base_url => "http://www.lysator.liu.se/~nisse/archive",
|
53
64
|
:label => "Nettle",
|
54
|
-
:version => "2.7",
|
65
|
+
:version => "2.7.1",
|
55
66
|
:windows => {
|
56
67
|
:configure_args => [],
|
68
|
+
:built_file => "bin/libnettle-4-7.dll",
|
57
69
|
},
|
58
70
|
},
|
59
71
|
{
|
60
72
|
:name => "gnutls",
|
61
|
-
:download_base_url => "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.
|
73
|
+
:download_base_url => "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2",
|
62
74
|
:label => "GnuTLS",
|
63
|
-
:version => "3.
|
75
|
+
:version => "3.2.7",
|
64
76
|
:compression_method => "xz",
|
65
77
|
:windows => {
|
66
78
|
:configure_args => [
|
67
|
-
"--
|
79
|
+
"--disable-cxx",
|
68
80
|
],
|
69
81
|
:use_cc_environment_variable => false,
|
82
|
+
:patches => [
|
83
|
+
],
|
84
|
+
:built_file => "bin/libgnutls-28.dll",
|
70
85
|
},
|
71
86
|
},
|
72
87
|
{
|
73
88
|
:name => "glib-networking",
|
74
89
|
:download_site => :gnome,
|
75
90
|
:label => "glib-networking",
|
76
|
-
:version => "2.
|
91
|
+
:version => "2.38.2",
|
77
92
|
:compression_method => "xz",
|
78
93
|
:windows => {
|
79
94
|
:configure_args => [
|
@@ -81,9 +96,15 @@ package = GNOME2Package.new do |_package|
|
|
81
96
|
"--without-gnome-proxy",
|
82
97
|
"--without-ca-certificates",
|
83
98
|
],
|
99
|
+
:built_file => "lib/gio/modules/libgiognutls.dll",
|
84
100
|
},
|
85
101
|
},
|
86
102
|
]
|
103
|
+
_package.cross_compiling do |spec|
|
104
|
+
if /mingw|mswin/ =~ spec.platform.to_s
|
105
|
+
spec.add_runtime_dependency("cairo", ">= 1.12.8")
|
106
|
+
end
|
107
|
+
end
|
87
108
|
end
|
88
109
|
package.define_tasks
|
89
110
|
|
@@ -116,7 +137,7 @@ namespace :win32 do
|
|
116
137
|
end
|
117
138
|
end
|
118
139
|
|
119
|
-
namespace :
|
140
|
+
namespace :builder do
|
120
141
|
namespace :build do
|
121
142
|
namespace :glib do
|
122
143
|
task :after => [
|
data/ext/glib2/extconf.rb
CHANGED
@@ -16,7 +16,7 @@ require 'mkmf-gnome2'
|
|
16
16
|
|
17
17
|
setup_win32(module_name, base_dir)
|
18
18
|
|
19
|
-
unless required_pkg_config_package(package_id,
|
19
|
+
unless required_pkg_config_package([package_id, 2, 12, 0],
|
20
20
|
:debian => "libglib2.0-dev",
|
21
21
|
:redhat => "glib2-devel",
|
22
22
|
:homebrew => "glib",
|
@@ -47,6 +47,7 @@ have_func("ruby_native_thread_p", ruby_header)
|
|
47
47
|
have_func("rb_thread_call_with_gvl", ruby_header)
|
48
48
|
have_func("rb_str_new_cstr", ruby_header)
|
49
49
|
have_func("rb_gc_register_mark_object", ruby_header)
|
50
|
+
have_func("rb_exc_new_str", ruby_header)
|
50
51
|
|
51
52
|
have_var("curr_thread", [ruby_header, "node.h"])
|
52
53
|
have_var("rb_curr_thread", [ruby_header, "node.h"])
|
data/ext/glib2/glib2.def
CHANGED
data/ext/glib2/rbglib.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
3
|
+
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
4
|
* Copyright (C) 2002,2003 Masahiro Sakai
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -1029,7 +1029,6 @@ Init_glib2(void)
|
|
1029
1029
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXLONG", INT2NUM(G_MAXLONG));
|
1030
1030
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXULONG", UINT2NUM(G_MAXULONG));
|
1031
1031
|
|
1032
|
-
#if GLIB_CHECK_VERSION(2,4,0)
|
1033
1032
|
rb_define_const(RG_TARGET_NAMESPACE, "MININT8", INT2FIX(G_MININT8));
|
1034
1033
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXINT8", INT2FIX(G_MAXINT8));
|
1035
1034
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT8", UINT2NUM(G_MAXUINT8));
|
@@ -1041,13 +1040,13 @@ Init_glib2(void)
|
|
1041
1040
|
rb_define_const(RG_TARGET_NAMESPACE, "MININT32", INT2FIX(G_MININT32));
|
1042
1041
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXINT32", INT2NUM(G_MAXINT32));
|
1043
1042
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT32", UINT2NUM(G_MAXUINT32));
|
1044
|
-
|
1043
|
+
|
1045
1044
|
rb_define_const(RG_TARGET_NAMESPACE, "MININT64", INT2FIX(G_MININT64));
|
1046
1045
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXINT64", LL2NUM(G_MAXINT64));
|
1047
1046
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT64", ULL2NUM(G_MAXUINT64));
|
1048
|
-
|
1047
|
+
|
1049
1048
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXSIZE", UINT2NUM(G_MAXSIZE));
|
1050
|
-
|
1049
|
+
|
1051
1050
|
rb_define_const(RG_TARGET_NAMESPACE, "MINFLOAT", INT2FIX(G_MINFLOAT));
|
1052
1051
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXFLOAT", DBL2NUM(G_MAXFLOAT));
|
1053
1052
|
|
@@ -1121,6 +1120,8 @@ union GDoubleIEEE754;
|
|
1121
1120
|
/* Init_mem(); */
|
1122
1121
|
Init_gutil();
|
1123
1122
|
Init_gutil_callback();
|
1123
|
+
|
1124
|
+
Init_glib_gettext();
|
1124
1125
|
Init_glib_int64();
|
1125
1126
|
Init_glib_error();
|
1126
1127
|
Init_glib_threads();
|
data/ext/glib2/rbglib.h
CHANGED
@@ -35,7 +35,7 @@ extern "C" {
|
|
35
35
|
|
36
36
|
#define RBGLIB_MAJOR_VERSION 2
|
37
37
|
#define RBGLIB_MINOR_VERSION 0
|
38
|
-
#define RBGLIB_MICRO_VERSION
|
38
|
+
#define RBGLIB_MICRO_VERSION 3
|
39
39
|
|
40
40
|
#ifndef RSTRING_PTR
|
41
41
|
# define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
@@ -51,8 +51,8 @@ extern "C" {
|
|
51
51
|
# define DBL2NUM(v) (rb_float_new(v))
|
52
52
|
#endif
|
53
53
|
|
54
|
-
#
|
55
|
-
|
54
|
+
#ifndef RBASIC_CLASS
|
55
|
+
# define RBASIC_CLASS(obj) (RBASIC(obj)->klass)
|
56
56
|
#endif
|
57
57
|
|
58
58
|
#ifndef G_SOURCE_REMOVE
|
@@ -21,7 +21,6 @@
|
|
21
21
|
|
22
22
|
#include "rbgprivate.h"
|
23
23
|
|
24
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
25
24
|
/************************************************/
|
26
25
|
static GBookmarkFile*
|
27
26
|
bookmarkfile_copy(const GBookmarkFile* file)
|
@@ -498,12 +497,9 @@ rg_move_item(VALUE self, VALUE old_uri, VALUE new_uri)
|
|
498
497
|
return self;
|
499
498
|
}
|
500
499
|
|
501
|
-
#endif
|
502
|
-
|
503
500
|
void
|
504
501
|
Init_glib_bookmark_file(void)
|
505
502
|
{
|
506
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
507
503
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BOOKMARK_FILE, "BookmarkFile", mGLib);
|
508
504
|
|
509
505
|
G_DEF_ERROR(G_BOOKMARK_FILE_ERROR, "BookmarkFileError", mGLib,
|
@@ -547,5 +543,4 @@ Init_glib_bookmark_file(void)
|
|
547
543
|
RG_DEF_METHOD(remove_application, 2);
|
548
544
|
RG_DEF_METHOD(remove_item, 1);
|
549
545
|
RG_DEF_METHOD(move_item, 2);
|
550
|
-
#endif
|
551
546
|
}
|
data/ext/glib2/rbglib_error.c
CHANGED
@@ -31,22 +31,19 @@ VALUE
|
|
31
31
|
rbgerr_gerror2exception(GError *error)
|
32
32
|
{
|
33
33
|
VALUE exc = Qnil;
|
34
|
-
VALUE
|
34
|
+
VALUE exception_klass = Qnil;
|
35
35
|
|
36
|
-
if (!
|
36
|
+
if (!error) {
|
37
37
|
return rb_exc_new2(rb_eRuntimeError, "GError parameter doesn't have a value.");
|
38
38
|
}
|
39
39
|
|
40
|
-
|
41
|
-
if (NIL_P(
|
42
|
-
|
43
|
-
rb_ivar_set(exc, id_domain, CSTR2RVAL(g_quark_to_string(error->domain)));
|
44
|
-
rb_ivar_set(exc, id_code, INT2NUM(error->code));
|
45
|
-
} else {
|
46
|
-
exc = rb_exc_new2(klass, error->message);
|
47
|
-
rb_ivar_set(exc, id_domain, CSTR2RVAL(g_quark_to_string(error->domain)));
|
48
|
-
rb_ivar_set(exc, id_code, INT2NUM(error->code));
|
40
|
+
exception_klass = rb_hash_aref(gerror_table, UINT2NUM(error->domain));
|
41
|
+
if (NIL_P(exception_klass)) {
|
42
|
+
exception_klass = generic_error;
|
49
43
|
}
|
44
|
+
exc = rb_exc_new_str(exception_klass, CSTR2RVAL(error->message));
|
45
|
+
rb_ivar_set(exc, id_domain, CSTR2RVAL(g_quark_to_string(error->domain)));
|
46
|
+
rb_ivar_set(exc, id_code, INT2NUM(error->code));
|
50
47
|
g_error_free(error);
|
51
48
|
return exc;
|
52
49
|
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2013 Ruby-GNOME2 Project Team
|
4
|
+
*
|
5
|
+
* This library is free software; you can redistribute it and/or
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
7
|
+
* License as published by the Free Software Foundation; either
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
* Lesser General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
16
|
+
* License along with this library; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "rbgprivate.h"
|
22
|
+
#include "rbglib.h"
|
23
|
+
|
24
|
+
#include <libintl.h>
|
25
|
+
|
26
|
+
#define RG_TARGET_NAMESPACE mGetText
|
27
|
+
|
28
|
+
static VALUE
|
29
|
+
rg_s_bindtextdomain(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
30
|
+
{
|
31
|
+
VALUE domain_name;
|
32
|
+
VALUE directory;
|
33
|
+
const char *current_directory = NULL;
|
34
|
+
|
35
|
+
rb_scan_args(argc, argv, "11", &domain_name, &directory);
|
36
|
+
current_directory = bindtextdomain(RVAL2CSTR(domain_name),
|
37
|
+
RVAL2CSTR_ACCEPT_NIL(directory));
|
38
|
+
return CSTR2RVAL(current_directory);
|
39
|
+
}
|
40
|
+
|
41
|
+
void
|
42
|
+
Init_glib_gettext(void)
|
43
|
+
{
|
44
|
+
VALUE RG_TARGET_NAMESPACE;
|
45
|
+
|
46
|
+
RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "GetText");
|
47
|
+
RG_DEF_SMETHOD(bindtextdomain, -1);
|
48
|
+
}
|
data/ext/glib2/rbglib_i18n.c
CHANGED
@@ -26,19 +26,15 @@
|
|
26
26
|
|
27
27
|
#define RG_TARGET_NAMESPACE mGLib
|
28
28
|
|
29
|
-
#if GLIB_CHECK_VERSION(2,6,0)
|
30
29
|
static VALUE
|
31
30
|
rg_s_language_names(G_GNUC_UNUSED VALUE self)
|
32
31
|
{
|
33
32
|
return STRV2RVAL((const gchar **)g_get_language_names());
|
34
33
|
}
|
35
|
-
#endif
|
36
34
|
|
37
35
|
void
|
38
36
|
Init_glib_i18n(void)
|
39
37
|
{
|
40
38
|
/* glib/gi18n.h */
|
41
|
-
#if GLIB_CHECK_VERSION(2,6,0)
|
42
39
|
RG_DEF_SMETHOD(language_names, 0);
|
43
|
-
#endif
|
44
40
|
}
|
data/ext/glib2/rbglib_keyfile.c
CHANGED
@@ -21,7 +21,6 @@
|
|
21
21
|
|
22
22
|
#include "rbgprivate.h"
|
23
23
|
|
24
|
-
#if GLIB_CHECK_VERSION(2,6,0)
|
25
24
|
#if !GLIB_CHECK_VERSION(2,31,2)
|
26
25
|
/************************************************/
|
27
26
|
static GKeyFile*
|
@@ -312,7 +311,6 @@ rg_get_integer(VALUE self, VALUE group_name, VALUE key)
|
|
312
311
|
return INT2NUM(ret);
|
313
312
|
}
|
314
313
|
|
315
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
316
314
|
static VALUE
|
317
315
|
rg_get_double(VALUE self, VALUE group_name, VALUE key)
|
318
316
|
{
|
@@ -326,7 +324,6 @@ rg_get_double(VALUE self, VALUE group_name, VALUE key)
|
|
326
324
|
|
327
325
|
return rb_float_new(ret);
|
328
326
|
}
|
329
|
-
#endif
|
330
327
|
|
331
328
|
static VALUE
|
332
329
|
rg_get_string_list(VALUE self, VALUE group_name, VALUE key)
|
@@ -422,7 +419,6 @@ rg_get_integer_list(VALUE self, VALUE group_name, VALUE key)
|
|
422
419
|
return ary;
|
423
420
|
}
|
424
421
|
|
425
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
426
422
|
static VALUE
|
427
423
|
rg_get_double_list(VALUE self, VALUE group_name, VALUE key)
|
428
424
|
{
|
@@ -443,7 +439,6 @@ rg_get_double_list(VALUE self, VALUE group_name, VALUE key)
|
|
443
439
|
}
|
444
440
|
return ary;
|
445
441
|
}
|
446
|
-
#endif
|
447
442
|
|
448
443
|
static VALUE
|
449
444
|
rg_get_comment(VALUE self, VALUE group_name, VALUE key)
|
@@ -505,7 +500,6 @@ rg_set_integer(VALUE self, VALUE group_name, VALUE key, VALUE value)
|
|
505
500
|
return self;
|
506
501
|
}
|
507
502
|
|
508
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
509
503
|
static VALUE
|
510
504
|
rg_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value)
|
511
505
|
{
|
@@ -514,7 +508,6 @@ rg_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value)
|
|
514
508
|
NUM2DBL(value));
|
515
509
|
return self;
|
516
510
|
}
|
517
|
-
#endif
|
518
511
|
|
519
512
|
static VALUE
|
520
513
|
rg_set_string_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
|
@@ -581,7 +574,6 @@ rg_set_integer_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
|
|
581
574
|
return self;
|
582
575
|
}
|
583
576
|
|
584
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
585
577
|
static VALUE
|
586
578
|
rg_set_double_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
|
587
579
|
{
|
@@ -595,7 +587,6 @@ rg_set_double_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist)
|
|
595
587
|
|
596
588
|
return self;
|
597
589
|
}
|
598
|
-
#endif
|
599
590
|
|
600
591
|
static VALUE
|
601
592
|
rg_set_comment(VALUE self, VALUE group_name, VALUE key, VALUE comment)
|
@@ -657,12 +648,10 @@ rg_remove_comment(VALUE self, VALUE group_name, VALUE key)
|
|
657
648
|
|
658
649
|
return self;
|
659
650
|
}
|
660
|
-
#endif
|
661
651
|
|
662
652
|
void
|
663
653
|
Init_glib_keyfile(void)
|
664
654
|
{
|
665
|
-
#if GLIB_CHECK_VERSION(2,6,0)
|
666
655
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_KEY_FILE, "KeyFile", mGLib);
|
667
656
|
G_DEF_ERROR(G_KEY_FILE_ERROR, "KeyFileError", mGLib,
|
668
657
|
rb_eRuntimeError, G_TYPE_KEY_FILE_ERROR);
|
@@ -686,32 +675,24 @@ Init_glib_keyfile(void)
|
|
686
675
|
RG_DEF_METHOD(get_locale_string, -1);
|
687
676
|
RG_DEF_METHOD(get_boolean, 2);
|
688
677
|
RG_DEF_METHOD(get_integer, 2);
|
689
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
690
678
|
RG_DEF_METHOD(get_double, 2);
|
691
|
-
#endif
|
692
679
|
RG_DEF_METHOD(get_string_list, 2);
|
693
680
|
RG_DEF_METHOD(get_locale_string_list, -1);
|
694
681
|
RG_DEF_METHOD(get_boolean_list, 2);
|
695
682
|
RG_DEF_METHOD(get_integer_list, 2);
|
696
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
697
683
|
RG_DEF_METHOD(get_double_list, 2);
|
698
|
-
#endif
|
699
684
|
RG_DEF_METHOD(get_comment, 2);
|
700
685
|
RG_DEF_METHOD(set_value, 3);
|
701
686
|
RG_DEF_METHOD(set_string, 3);
|
702
687
|
RG_DEF_METHOD(set_locale_string, 4);
|
703
688
|
RG_DEF_METHOD(set_boolean, 3);
|
704
689
|
RG_DEF_METHOD(set_integer, 3);
|
705
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
706
690
|
RG_DEF_METHOD(set_double, 3);
|
707
|
-
#endif
|
708
691
|
RG_DEF_METHOD(set_string_list, 3);
|
709
692
|
RG_DEF_METHOD(set_locale_string_list, 4);
|
710
693
|
RG_DEF_METHOD(set_boolean_list, 3);
|
711
694
|
RG_DEF_METHOD(set_integer_list, 3);
|
712
|
-
#if GLIB_CHECK_VERSION(2,12,0)
|
713
695
|
RG_DEF_METHOD(set_double_list, 3);
|
714
|
-
#endif
|
715
696
|
RG_DEF_METHOD(set_comment, 3);
|
716
697
|
RG_DEF_METHOD(remove_group, 1);
|
717
698
|
RG_DEF_METHOD(remove_key, 2);
|
@@ -771,5 +752,4 @@ Init_glib_keyfile(void)
|
|
771
752
|
rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_DIRECTORY",
|
772
753
|
CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_DIRECTORY));
|
773
754
|
#endif
|
774
|
-
#endif
|
775
755
|
}
|