glib2 1.0.0-x86-mingw32 → 1.0.1-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.
- data/ChangeLog +107 -0
- data/ext/glib2/glib2.def +12 -1
- data/ext/glib2/rbglib.c +258 -69
- data/ext/glib2/rbglib.h +25 -5
- data/ext/glib2/rbglib_bookmarkfile.c +507 -519
- data/ext/glib2/rbglib_completion.c +4 -4
- data/ext/glib2/rbglib_error.c +1 -1
- data/ext/glib2/rbglib_i18n.c +1 -10
- data/ext/glib2/rbglib_iochannel.c +5 -1
- data/ext/glib2/rbglib_keyfile.c +103 -114
- data/ext/glib2/rbglib_maincontext.c +45 -13
- data/ext/glib2/rbglib_messages.c +2 -1
- data/ext/glib2/rbglib_shell.c +11 -19
- data/ext/glib2/rbglib_spawn.c +28 -110
- data/ext/glib2/rbglib_utils.c +5 -20
- data/ext/glib2/rbgobj_closure.c +3 -2
- data/ext/glib2/rbgobj_enums.c +37 -17
- data/ext/glib2/rbgobj_object.c +3 -3
- data/ext/glib2/rbgobj_param.c +2 -1
- data/ext/glib2/rbgobj_signal.c +9 -10
- data/ext/glib2/rbgobj_strv.c +9 -32
- data/ext/glib2/rbgobj_type.c +7 -6
- data/ext/glib2/rbgobj_typeinterface.c +142 -142
- data/ext/glib2/rbgobj_value.c +2 -1
- data/ext/glib2/rbgobj_valuearray.c +20 -15
- data/ext/glib2/rbgobj_valuetypes.c +3 -2
- data/ext/glib2/rbgobject.c +12 -12
- data/ext/glib2/rbgprivate.h +4 -0
- data/ext/glib2/rbgutil.h +14 -0
- data/ext/glib2/rbgutil_callback.c +22 -14
- data/lib/1.8/glib2.so +0 -0
- data/lib/1.9/glib2.so +0 -0
- data/lib/glib2.rb +30 -20
- data/lib/mkmf-gnome2.rb +6 -2
- data/test/glib-test-init.rb +1 -0
- metadata +4 -4
data/ext/glib2/rbgobj_value.c
CHANGED
@@ -302,7 +302,8 @@ rbgobj_gc_mark_gvalue(GValue* value)
|
|
302
302
|
|
303
303
|
/**********************************************************************/
|
304
304
|
|
305
|
-
void
|
305
|
+
void
|
306
|
+
Init_gobject_gvalue()
|
306
307
|
{
|
307
308
|
id_to_s = rb_intern("to_s");
|
308
309
|
qRValueToGValueFunc = g_quark_from_static_string("__ruby_r2g_func__");
|
@@ -12,46 +12,51 @@
|
|
12
12
|
#include "rbgprivate.h"
|
13
13
|
|
14
14
|
static VALUE
|
15
|
-
value_array_to_ruby(const GValue*
|
15
|
+
value_array_to_ruby(const GValue *from)
|
16
16
|
{
|
17
17
|
VALUE ary;
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
guint i;
|
19
|
+
|
20
|
+
GValueArray *array = (GValueArray *)g_value_get_boxed(from);
|
21
|
+
if (array == NULL)
|
21
22
|
return Qnil;
|
22
23
|
|
23
24
|
ary = rb_ary_new();
|
24
|
-
for (i = 0
|
25
|
-
rb_ary_push(ary, GVAL2RVAL(g_value_array_get_nth(
|
26
|
-
|
25
|
+
for (i = 0; i < array->n_values; i++)
|
26
|
+
rb_ary_push(ary, GVAL2RVAL(g_value_array_get_nth(array, i)));
|
27
|
+
|
27
28
|
return ary;
|
28
29
|
}
|
29
30
|
|
30
31
|
static void
|
31
|
-
value_array_from_ruby(VALUE from, GValue*
|
32
|
+
value_array_from_ruby(const VALUE from, GValue *to)
|
32
33
|
{
|
33
34
|
int i;
|
34
|
-
GValueArray *
|
35
|
+
GValueArray *array;
|
35
36
|
|
36
37
|
if (NIL_P(from)) {
|
37
38
|
g_value_set_boxed(to, NULL);
|
39
|
+
|
38
40
|
return;
|
39
41
|
}
|
40
42
|
|
41
43
|
Check_Type(from, T_ARRAY);
|
42
44
|
|
43
|
-
array = g_value_array_new(
|
45
|
+
array = g_value_array_new(RARRAY_LEN(from));
|
44
46
|
|
45
47
|
for (i = 0; i < RARRAY_LEN(from); i++) {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
GValue v = { 0, };
|
49
|
+
g_value_init(&v, RVAL2GTYPE(RARRAY_PTR(from)[i]));
|
50
|
+
rbgobj_rvalue_to_gvalue(RARRAY_PTR(from)[i], &v);
|
51
|
+
|
52
|
+
g_value_array_append(array, &v);
|
50
53
|
}
|
54
|
+
|
51
55
|
g_value_set_boxed(to, array);
|
52
56
|
}
|
53
57
|
|
54
|
-
void
|
58
|
+
void
|
59
|
+
Init_gobject_value_array()
|
55
60
|
{
|
56
61
|
/* ValueArray is treated as Array */
|
57
62
|
rbgobj_register_g2r_func(G_TYPE_VALUE_ARRAY, value_array_to_ruby);
|
@@ -204,7 +204,8 @@ value_transform_any_ruby(const GValue *src_value,
|
|
204
204
|
g_value_set_ruby_value(dest_value, GVAL2RVAL(src_value));
|
205
205
|
}
|
206
206
|
|
207
|
-
GType
|
207
|
+
GType
|
208
|
+
rbgobj_ruby_value_get_type()
|
208
209
|
{
|
209
210
|
static GType our_type = 0;
|
210
211
|
|
@@ -229,7 +230,7 @@ GType rbgobj_ruby_value_get_type()
|
|
229
230
|
G_TYPE_PARAM,
|
230
231
|
G_TYPE_OBJECT,
|
231
232
|
};
|
232
|
-
|
233
|
+
size_t i;
|
233
234
|
|
234
235
|
our_type = g_boxed_type_register_static(
|
235
236
|
"VALUE",
|
data/ext/glib2/rbgobject.c
CHANGED
@@ -250,7 +250,7 @@ rbgobj_define_property_accessors(VALUE klass)
|
|
250
250
|
{
|
251
251
|
GType gtype;
|
252
252
|
GParamSpec** pspecs = NULL;
|
253
|
-
|
253
|
+
guint i;
|
254
254
|
GString* source;
|
255
255
|
guint n_properties = 0;
|
256
256
|
gtype = CLASS2GTYPE(klass);
|
@@ -353,17 +353,17 @@ Init_gobject()
|
|
353
353
|
|
354
354
|
/* Not defined properties. They are already used as methods of Object */
|
355
355
|
prop_exclude_list = g_hash_table_new(g_str_hash, g_str_equal);
|
356
|
-
g_hash_table_insert(prop_exclude_list, "class", "class");
|
357
|
-
g_hash_table_insert(prop_exclude_list, "clone", "clone");
|
358
|
-
g_hash_table_insert(prop_exclude_list, "dup", "dup");
|
359
|
-
g_hash_table_insert(prop_exclude_list, "extend", "extend");
|
360
|
-
g_hash_table_insert(prop_exclude_list, "freeze", "freeze");
|
361
|
-
g_hash_table_insert(prop_exclude_list, "hash", "hash");
|
362
|
-
g_hash_table_insert(prop_exclude_list, "method", "method");
|
363
|
-
g_hash_table_insert(prop_exclude_list, "methods", "methods");
|
364
|
-
g_hash_table_insert(prop_exclude_list, "object_id", "object_id");
|
365
|
-
g_hash_table_insert(prop_exclude_list, "taint", "taint");
|
366
|
-
g_hash_table_insert(prop_exclude_list, "untaint", "untaint");
|
356
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"class", (gpointer)"class");
|
357
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"clone", (gpointer)"clone");
|
358
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"dup", (gpointer)"dup");
|
359
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"extend", (gpointer)"extend");
|
360
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"freeze", (gpointer)"freeze");
|
361
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"hash", (gpointer)"hash");
|
362
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"method", (gpointer)"method");
|
363
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"methods", (gpointer)"methods");
|
364
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"object_id", (gpointer)"object_id");
|
365
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"taint", (gpointer)"taint");
|
366
|
+
g_hash_table_insert(prop_exclude_list, (gpointer)"untaint", (gpointer)"untaint");
|
367
367
|
|
368
368
|
/* IDs */
|
369
369
|
id_relatives = rb_intern("__relatives__");
|
data/ext/glib2/rbgprivate.h
CHANGED
data/ext/glib2/rbgutil.h
CHANGED
@@ -28,6 +28,20 @@ extern "C" {
|
|
28
28
|
"def " name "=(val); set_" name "(val); val; end\n"))
|
29
29
|
#define G_DEF_SETTERS(klass) rbgutil_def_setters(klass)
|
30
30
|
|
31
|
+
#define G_REPLACE_SET_PROPERTY(klass, name, function, args) \
|
32
|
+
rb_undef_method(klass, "set_" name); \
|
33
|
+
rb_define_method(klass, "set_" name, function, args); \
|
34
|
+
rb_undef_method(klass, name "="); \
|
35
|
+
G_DEF_SETTER(klass, name)
|
36
|
+
|
37
|
+
#define G_REPLACE_GET_PROPERTY(klass, name, function, args) \
|
38
|
+
rb_undef_method(klass, name); \
|
39
|
+
rb_define_method(klass, name, function, args)
|
40
|
+
|
41
|
+
#define G_REPLACE_ACTION(klass, name, function, args) \
|
42
|
+
rb_undef_method(klass, name); \
|
43
|
+
rb_define_method(klass, name, function, args)
|
44
|
+
|
31
45
|
#define G_SET_PROPERTIES(self, hash) (rbgutil_set_properties(self, hash))
|
32
46
|
#define G_SET_SYMBOL_PROPERTY(gtype, name) \
|
33
47
|
rbgobj_register_property_getter(gtype, name, rbgutil_sym_g2r_func)
|
@@ -12,20 +12,19 @@
|
|
12
12
|
|
13
13
|
#include "rbgprivate.h"
|
14
14
|
|
15
|
-
#ifdef
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
15
|
+
#ifdef G_OS_WIN32
|
16
|
+
# ifdef HAVE_IO_H
|
17
|
+
# include <io.h>
|
18
|
+
# define pipe(phandles) _pipe(phandles, 128, _O_BINARY)
|
19
|
+
# endif
|
20
|
+
#else
|
21
|
+
# ifdef HAVE_UNISTD_H
|
22
|
+
# include <unistd.h>
|
23
|
+
# endif
|
21
24
|
#endif
|
22
25
|
#include <fcntl.h>
|
23
26
|
#include <errno.h>
|
24
27
|
|
25
|
-
#ifndef HAVE_RB_ERRINFO
|
26
|
-
# define rb_errinfo() (ruby_errinfo)
|
27
|
-
#endif
|
28
|
-
|
29
28
|
#ifndef HAVE_RUBY_NATIVE_THREAD_P
|
30
29
|
# define ruby_native_thread_p() is_ruby_native_thread()
|
31
30
|
#endif
|
@@ -119,10 +118,18 @@ mainloop(void)
|
|
119
118
|
static void
|
120
119
|
queue_callback_request(CallbackRequest *request)
|
121
120
|
{
|
121
|
+
ssize_t written;
|
122
|
+
|
122
123
|
g_async_queue_push(callback_request_queue, request);
|
123
|
-
write(callback_pipe_fds[1],
|
124
|
-
|
125
|
-
|
124
|
+
written = write(callback_pipe_fds[1],
|
125
|
+
CALLBACK_PIPE_READY_MESSAGE,
|
126
|
+
CALLBACK_PIPE_READY_MESSAGE_SIZE);
|
127
|
+
if (written != CALLBACK_PIPE_READY_MESSAGE_SIZE) {
|
128
|
+
rb_warn("couldn't write all callback pipe ready message: "
|
129
|
+
"message-size: %d, written: %" G_GSSIZE_FORMAT,
|
130
|
+
CALLBACK_PIPE_READY_MESSAGE_SIZE,
|
131
|
+
written);
|
132
|
+
}
|
126
133
|
}
|
127
134
|
|
128
135
|
static VALUE
|
@@ -211,7 +218,8 @@ rbgutil_stop_callback_dispatch_thread(void)
|
|
211
218
|
#endif
|
212
219
|
}
|
213
220
|
|
214
|
-
void
|
221
|
+
void
|
222
|
+
Init_gutil_callback()
|
215
223
|
{
|
216
224
|
id_exit_application = rb_intern("exit_application");
|
217
225
|
rbgutil_eGLibCallbackNotInitializedError =
|
data/lib/1.8/glib2.so
CHANGED
Binary file
|
data/lib/1.9/glib2.so
CHANGED
Binary file
|
data/lib/glib2.rb
CHANGED
@@ -33,29 +33,39 @@ module GLib
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def __add_one_arg_setter(klass)
|
36
|
-
#for Instance methods.
|
37
|
-
|
38
|
-
|
39
|
-
if
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
36
|
+
# for Instance methods.
|
37
|
+
method_names = klass.instance_methods(false)
|
38
|
+
method_names.each do |method_name|
|
39
|
+
next if /\Aset_/ !~ method_name
|
40
|
+
property_name = $POSTMATCH
|
41
|
+
next if klass.method_defined?("#{property_name}=")
|
42
|
+
next if klass.instance_method(method_name).arity != 1
|
43
|
+
begin
|
44
|
+
klass.module_eval("def #{property_name}=(val); set_#{property_name}(val); val; end\n")
|
45
|
+
rescue SyntaxError
|
46
|
+
if $DEBUG
|
47
|
+
$stderr.puts "Couldn't create #{klass}\##{property_name}=(v)."
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
|
52
|
+
# for Class methods/Module functions.
|
53
|
+
if klass.method(:methods).arity == -1
|
54
|
+
method_names = klass.methods(false)
|
50
55
|
else
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
method_names = klass.methods
|
57
|
+
end
|
58
|
+
singleton_klass = (class << klass; self; end)
|
59
|
+
method_names.each do |method_name|
|
60
|
+
next if /\Aset_/ !~ method_name
|
61
|
+
property_name = $POSTMATCH
|
62
|
+
next if singleton_klass.method_defined?("#{property_name}=")
|
63
|
+
next if klass.method(method_name).arity != 1
|
64
|
+
begin
|
65
|
+
klass.module_eval("def self.#{property_name}=(val); set_#{property_name}(val); val; end\n")
|
66
|
+
rescue SyntaxError
|
67
|
+
if $DEBUG
|
68
|
+
$stderr.puts "Couldn't create #{klass}.#{property_name}=(v)."
|
59
69
|
end
|
60
70
|
end
|
61
71
|
end
|
@@ -83,7 +93,7 @@ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
|
|
83
93
|
vendor_dir = base_dir + "vendor" + "local"
|
84
94
|
GLib.prepend_environment_path(vendor_dir + "bin")
|
85
95
|
begin
|
86
|
-
major, minor,
|
96
|
+
major, minor, _ = RUBY_VERSION.split(/\./)
|
87
97
|
require "#{major}.#{minor}/glib2.so"
|
88
98
|
rescue LoadError
|
89
99
|
require 'glib2.so'
|
data/lib/mkmf-gnome2.rb
CHANGED
@@ -79,7 +79,9 @@ end
|
|
79
79
|
def add_depend_package(target_name, target_srcdir, top_srcdir, options={})
|
80
80
|
begin
|
81
81
|
require 'rubygems'
|
82
|
-
gem_spec = Gem.
|
82
|
+
gem_spec = (Gem::Specification.respond_to?(:find_by_name) ?
|
83
|
+
Gem::Specification.find_by_name(target_name) :
|
84
|
+
Gem.source_index.find_name(target_name)).last
|
83
85
|
if gem_spec
|
84
86
|
target_source_dir = File.join(gem_spec.full_gem_path, "ext/#{target_name}")
|
85
87
|
target_build_dir = target_source_dir
|
@@ -383,7 +385,9 @@ def check_cairo(options={})
|
|
383
385
|
if rcairo_source_dir.nil?
|
384
386
|
begin
|
385
387
|
require 'rubygems'
|
386
|
-
cairo_gem_spec = Gem.
|
388
|
+
cairo_gem_spec = (Gem::Specification.respond_to?(:find_by_name) ?
|
389
|
+
Gem::Specification.find_by_name('cairo') :
|
390
|
+
Gem.source_index.find_name('cairo')).last
|
387
391
|
if cairo_gem_spec
|
388
392
|
rcairo_source_dir = cairo_gem_spec.full_gem_path
|
389
393
|
end
|
data/test/glib-test-init.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: x86-mingw32
|
12
12
|
authors:
|
13
13
|
- The Ruby-GNOME2 Proejct Team
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-09-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: pkg-config
|