glib2 2.2.5 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7e949298ce137e91f0c483674d00ecf223360e5
4
- data.tar.gz: 631153ad8255b6e980ab84a72a584b638d3b7b63
3
+ metadata.gz: f3350aed00d1e10329978c1547d477341e7a5344
4
+ data.tar.gz: 533b7ac7dccd7cc39d00cfe78eaa41d759fad8f1
5
5
  SHA512:
6
- metadata.gz: 14de6f353a8cc06e27ef8d5b318979c760d6173ecd7c88d676ecaa48eef5d3da41fd99e1249c2132af76b9b5301ef51cd5d7f9b4804eda75b2f87d210310db73
7
- data.tar.gz: 9d064c4df47b03609136ab7eb8d83fe28dc9d18c46db55e46c7ec41a524f87092c7ed3befa6b24ebecf5591528e11df80414b5887fab9cb2ca2c4cd022b79cd2
6
+ metadata.gz: 2a8471eeed482a55d90eabe8a042664d37cf36240916f08a49a7256010f1c37871f5608e57514e33450a17025116c48ee939e01f4f3d390647ca23f40c88aaff
7
+ data.tar.gz: 4e5307bcd6e7862e5ca7ad05c172c98f121895f72eb8753e32e9781cd38c21a104a1913b05d220095683ee98c87cdc94adcb0c46495244a4dde4a4d78b7a85df
data/Rakefile CHANGED
@@ -1,4 +1,20 @@
1
1
  # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2011-2015 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, MA 02110-1301 USA
2
18
 
3
19
  $LOAD_PATH.unshift("./lib")
4
20
  require 'gnome2/rake/package-task'
@@ -38,7 +54,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
38
54
  :name => "gettext",
39
55
  :download_site => :gnu,
40
56
  :label => "gettext-runtime",
41
- :version => "0.19.2",
57
+ :version => "0.19.5",
42
58
  :base_dir_in_package => "gettext-runtime",
43
59
  :windows => {
44
60
  :built_file => "bin/libintl-8.dll",
@@ -57,7 +73,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
57
73
  :name => "glib",
58
74
  :download_site => :gnome,
59
75
  :label => "GLib",
60
- :version => "2.42.1",
76
+ :version => "2.44.1",
61
77
  :compression_method => "xz",
62
78
  :windows => {
63
79
  :need_autoreconf => true,
@@ -85,33 +101,62 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
85
101
  :name => "nettle",
86
102
  :download_base_url => "http://www.lysator.liu.se/~nisse/archive",
87
103
  :label => "Nettle",
88
- :version => "2.7.1",
104
+ :version => "3.1.1",
89
105
  :windows => {
90
106
  :configure_args => [],
91
- :built_file => "bin/libnettle-4-7.dll",
107
+ :built_file => "bin/libnettle-6-1.dll",
108
+ },
109
+ },
110
+ {
111
+ :name => "libtasn1",
112
+ :download_site => :gnu,
113
+ :label => "Libtasn1",
114
+ :version => "4.6",
115
+ :windows => {
116
+ :built_file => "bin/libtasn1-6.dll",
117
+ },
118
+ },
119
+ {
120
+ :name => "libidn",
121
+ :download_site => :gnu,
122
+ :label => "Libidn",
123
+ :version => "1.32",
124
+ :windows => {
125
+ :built_file => "bin/libidn-11.dll",
126
+ },
127
+ },
128
+ {
129
+ :name => "p11-kit",
130
+ :download_base_url => "http://p11-glue.freedesktop.org/releases",
131
+ :label => "p11-kit",
132
+ :version => "0.23.1",
133
+ :windows => {
134
+ :built_file => "bin/libp11-kit-0.dll",
92
135
  },
93
136
  },
94
137
  {
95
138
  :name => "gnutls",
96
- :download_base_url => "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2",
139
+ :download_base_url => "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4",
97
140
  :label => "GnuTLS",
98
- :version => "3.2.21",
141
+ :version => "3.4.4",
99
142
  :compression_method => "xz",
100
143
  :windows => {
101
144
  :configure_args => [
102
145
  "--disable-cxx",
146
+ "--disable-tools",
147
+ "--disable-doc",
103
148
  ],
104
149
  :use_cc_environment_variable => false,
105
150
  :patches => [
106
151
  ],
107
- :built_file => "bin/libgnutls-28.dll",
152
+ :built_file => "bin/libgnutls-30.dll",
108
153
  },
109
154
  },
110
155
  {
111
156
  :name => "glib-networking",
112
157
  :download_site => :gnome,
113
158
  :label => "glib-networking",
114
- :version => "2.42.1",
159
+ :version => "2.44.0",
115
160
  :compression_method => "xz",
116
161
  :windows => {
117
162
  :configure_args => [
@@ -61,7 +61,7 @@ ignore_headers = [
61
61
  "gmain.h",
62
62
  "gscanner.h",
63
63
  ]
64
- unless (/mingw|cygwin|mswin/ === RUBY_PLATFORM)
64
+ unless windows_platform?
65
65
  ignore_headers << "gwin32.h"
66
66
  end
67
67
  headers = include_paths.split.inject([]) do |result, path|
@@ -52,6 +52,8 @@ EXPORTS
52
52
  rbgobj_register_class
53
53
  rbgobj_register_property_getter
54
54
  rbgobj_register_property_setter
55
+ rbgobj_class_init_func
56
+ rbgobj_register_type
55
57
  rbgobj_set_signal_func
56
58
  rbgobj_get_signal_func
57
59
  rbgobj_add_constants
@@ -67,6 +69,7 @@ EXPORTS
67
69
  rbg_rval_inspect
68
70
  rbg_string_value_ptr
69
71
  rbg_rval2cstr
72
+ rbg_rval2cstr_ptr
70
73
  rbg_rval2cstr_accept_nil
71
74
  rbg_rval2cstr_accept_symbol
72
75
  rbg_rval2cstr_accept_symbol_accept_nil
@@ -101,6 +104,8 @@ EXPORTS
101
104
  rbg_gslist2rval
102
105
  rbg_glist2rval_with_type
103
106
  rbg_gslist2rval_with_type
107
+ rbg_rval2glist
108
+ rbg_rval2gslist
104
109
  rbg_define_method
105
110
  rbg_define_singleton_method
106
111
  rbg_to_array
@@ -110,6 +115,7 @@ EXPORTS
110
115
  rbg_scan_options
111
116
  rbg_inspect
112
117
  rbg_interrupt_source_new
118
+ rbg_name_to_nick
113
119
  rbgutil_id_module_eval DATA
114
120
  rbgutil_def_setters
115
121
  rbgutil_glist2ary
@@ -140,6 +146,8 @@ EXPORTS
140
146
  rbglib_uint64_to_num
141
147
  rbglib_num_to_int64
142
148
  rbglib_int64_to_num
149
+ rbg_variant_to_ruby
150
+ rbg_variant_from_ruby
143
151
 
144
152
  g_source_get_type
145
153
  g_connect_flags_get_type
@@ -0,0 +1,296 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2015 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
+
23
+ #define RG_TARGET_NAMESPACE cVariantType
24
+
25
+ #define _SELF(s) (RVAL2GVARIANTTYPE(s))
26
+
27
+ static VALUE RG_TARGET_NAMESPACE;
28
+
29
+ static VALUE
30
+ rg_s_valid_p(G_GNUC_UNUSED VALUE klass, VALUE rb_string)
31
+ {
32
+ gboolean is_valid;
33
+
34
+ is_valid = g_variant_type_string_is_valid(StringValueCStr(rb_string));
35
+
36
+ return CBOOL2RVAL(is_valid);
37
+ }
38
+
39
+ static VALUE
40
+ rg_s_scan(G_GNUC_UNUSED VALUE klass, VALUE rb_string)
41
+ {
42
+ gboolean found;
43
+ const gchar *string;
44
+ const gchar *end;
45
+
46
+ string = StringValueCStr(rb_string);
47
+ found = g_variant_type_string_scan(string, NULL, &end);
48
+
49
+ if (!found) {
50
+ return Qnil;
51
+ }
52
+
53
+ return CSTR2RVAL(end);
54
+ }
55
+
56
+ static VALUE
57
+ rg_initialize(VALUE self, VALUE rb_string)
58
+ {
59
+ GVariantType *variant_type;
60
+ const gchar *string;
61
+
62
+ string = StringValueCStr(rb_string);
63
+ if (!g_variant_type_string_is_valid(string)) {
64
+ rb_raise(rb_eArgError,
65
+ "invalid type string: %s", rbg_inspect(rb_string));
66
+ }
67
+
68
+ variant_type = g_variant_type_new(string);
69
+ G_INITIALIZE(self, variant_type);
70
+
71
+ return Qnil;
72
+ }
73
+
74
+ static VALUE
75
+ rg_to_s(VALUE self)
76
+ {
77
+ GVariantType *variant_type;
78
+ const gchar *string;
79
+ gsize string_length;
80
+
81
+ variant_type = _SELF(self);
82
+ string = g_variant_type_peek_string(variant_type);
83
+ string_length = g_variant_type_get_string_length(variant_type);
84
+
85
+ return CSTR2RVAL_LEN(string, string_length);
86
+ }
87
+
88
+ static VALUE
89
+ rg_definite_p(VALUE self)
90
+ {
91
+ GVariantType *variant_type;
92
+
93
+ variant_type = _SELF(self);
94
+ return CBOOL2RVAL(g_variant_type_is_definite(variant_type));
95
+ }
96
+
97
+ static VALUE
98
+ rg_container_p(VALUE self)
99
+ {
100
+ GVariantType *variant_type;
101
+
102
+ variant_type = _SELF(self);
103
+ return CBOOL2RVAL(g_variant_type_is_container(variant_type));
104
+ }
105
+
106
+ static VALUE
107
+ rg_basic_p(VALUE self)
108
+ {
109
+ GVariantType *variant_type;
110
+
111
+ variant_type = _SELF(self);
112
+ return CBOOL2RVAL(g_variant_type_is_basic(variant_type));
113
+ }
114
+
115
+ static VALUE
116
+ rg_maybe_p(VALUE self)
117
+ {
118
+ GVariantType *variant_type;
119
+
120
+ variant_type = _SELF(self);
121
+ return CBOOL2RVAL(g_variant_type_is_maybe(variant_type));
122
+ }
123
+
124
+ static VALUE
125
+ rg_array_p(VALUE self)
126
+ {
127
+ GVariantType *variant_type;
128
+
129
+ variant_type = _SELF(self);
130
+ return CBOOL2RVAL(g_variant_type_is_array(variant_type));
131
+ }
132
+
133
+ static VALUE
134
+ rg_tuple_p(VALUE self)
135
+ {
136
+ GVariantType *variant_type;
137
+
138
+ variant_type = _SELF(self);
139
+ return CBOOL2RVAL(g_variant_type_is_tuple(variant_type));
140
+ }
141
+
142
+ static VALUE
143
+ rg_dict_entry_p(VALUE self)
144
+ {
145
+ GVariantType *variant_type;
146
+
147
+ variant_type = _SELF(self);
148
+ return CBOOL2RVAL(g_variant_type_is_dict_entry(variant_type));
149
+ }
150
+
151
+ static VALUE
152
+ rg_variant_p(VALUE self)
153
+ {
154
+ GVariantType *variant_type;
155
+
156
+ variant_type = _SELF(self);
157
+ return CBOOL2RVAL(g_variant_type_is_variant(variant_type));
158
+ }
159
+
160
+ static VALUE
161
+ rg_operator_eq(VALUE self, VALUE other)
162
+ {
163
+ GVariantType *variant_type1;
164
+ GVariantType *variant_type2;
165
+
166
+ if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE)))
167
+ return Qfalse;
168
+
169
+ variant_type1 = _SELF(self);
170
+ variant_type2 = _SELF(other);
171
+ return CBOOL2RVAL(g_variant_type_equal(variant_type1, variant_type2));
172
+ }
173
+
174
+ static VALUE
175
+ rg_hash(VALUE self)
176
+ {
177
+ GVariantType *variant_type;
178
+
179
+ variant_type = _SELF(self);
180
+ return UINT2NUM(g_variant_type_hash(variant_type));
181
+ }
182
+
183
+ static VALUE
184
+ rg_is_subtype_of_p(VALUE self, VALUE rb_subtype)
185
+ {
186
+ GVariantType *variant_type;
187
+ GVariantType *sub_variant_type;
188
+
189
+ if (!RVAL2CBOOL(rb_obj_is_kind_of(rb_subtype, RG_TARGET_NAMESPACE)))
190
+ return Qfalse;
191
+
192
+ variant_type = _SELF(self);
193
+ sub_variant_type = _SELF(rb_subtype);
194
+ return CBOOL2RVAL(g_variant_type_is_subtype_of(variant_type,
195
+ sub_variant_type));
196
+ }
197
+
198
+ static VALUE
199
+ rg_element(VALUE self)
200
+ {
201
+ GVariantType *variant_type;
202
+ const GVariantType *element;
203
+
204
+ variant_type = _SELF(self);
205
+ if (!(g_variant_type_is_array(variant_type) ||
206
+ g_variant_type_is_maybe(variant_type))) {
207
+ rb_raise(rb_eArgError,
208
+ "must be array or maybe type: <%.*s>",
209
+ (int)g_variant_type_get_string_length(variant_type),
210
+ g_variant_type_peek_string(variant_type));
211
+ }
212
+
213
+ element = g_variant_type_element(variant_type);
214
+ return GVARIANTTYPE2RVAL((GVariantType *)element);
215
+ }
216
+
217
+ void
218
+ Init_glib_variant_type(void)
219
+ {
220
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VARIANT_TYPE, "VariantType", mGLib);
221
+
222
+ RG_DEF_SMETHOD_P(valid, 1);
223
+ RG_DEF_SMETHOD(scan, 1);
224
+
225
+ RG_DEF_METHOD(initialize, 1);
226
+ RG_DEF_METHOD(to_s, 0);
227
+
228
+ RG_DEF_METHOD_P(definite, 0);
229
+ RG_DEF_METHOD_P(container, 0);
230
+ RG_DEF_METHOD_P(basic, 0);
231
+ RG_DEF_METHOD_P(maybe, 0);
232
+ RG_DEF_METHOD_P(array, 0);
233
+ RG_DEF_METHOD_P(tuple, 0);
234
+ RG_DEF_METHOD_P(dict_entry, 0);
235
+ RG_DEF_METHOD_P(variant, 0);
236
+
237
+ RG_DEF_METHOD_OPERATOR("==", eq, 1);
238
+
239
+ RG_DEF_METHOD(hash, 0);
240
+ RG_DEF_ALIAS("eql?", "==");
241
+
242
+ RG_DEF_METHOD_P(is_subtype_of, 1);
243
+
244
+ RG_DEF_METHOD(element, 0);
245
+
246
+ {
247
+ ID id_new;
248
+
249
+ CONST_ID(id_new, "new");
250
+
251
+ #define DEF_TYPE(name) do { \
252
+ const GVariantType *type = G_VARIANT_TYPE_ ## name; \
253
+ const gchar *type_string; \
254
+ gsize type_string_length; \
255
+ VALUE rb_type_string; \
256
+ \
257
+ type_string = g_variant_type_peek_string(type); \
258
+ type_string_length = g_variant_type_get_string_length(type); \
259
+ rb_type_string = rb_str_new(type_string, \
260
+ type_string_length); \
261
+ rb_define_const(RG_TARGET_NAMESPACE, G_STRINGIFY(name), \
262
+ rb_funcall(RG_TARGET_NAMESPACE, id_new, 1, \
263
+ rb_type_string)); \
264
+ } while (0)
265
+
266
+ DEF_TYPE(BOOLEAN);
267
+ DEF_TYPE(BYTE);
268
+ DEF_TYPE(INT16);
269
+ DEF_TYPE(UINT16);
270
+ DEF_TYPE(INT32);
271
+ DEF_TYPE(UINT32);
272
+ DEF_TYPE(INT64);
273
+ DEF_TYPE(UINT64);
274
+ DEF_TYPE(HANDLE);
275
+ DEF_TYPE(DOUBLE);
276
+ DEF_TYPE(STRING);
277
+ DEF_TYPE(OBJECT_PATH);
278
+ DEF_TYPE(SIGNATURE);
279
+ DEF_TYPE(VARIANT);
280
+ DEF_TYPE(ANY);
281
+ DEF_TYPE(BASIC);
282
+ DEF_TYPE(MAYBE);
283
+ DEF_TYPE(ARRAY);
284
+ DEF_TYPE(TUPLE);
285
+ DEF_TYPE(UNIT);
286
+ DEF_TYPE(DICT_ENTRY);
287
+ DEF_TYPE(DICTIONARY);
288
+ DEF_TYPE(STRING_ARRAY);
289
+ DEF_TYPE(OBJECT_PATH_ARRAY);
290
+ DEF_TYPE(BYTESTRING);
291
+ DEF_TYPE(BYTESTRING_ARRAY);
292
+ DEF_TYPE(VARDICT);
293
+
294
+ #undef DEF_TYPE
295
+ }
296
+ }