glib2 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/glib2/extconf.rb +1 -0
- data/ext/glib2/glib2.def +23 -0
- data/ext/glib2/rbgcompat.h +19 -5
- data/ext/glib2/rbglib.c +607 -160
- data/ext/glib2/rbglib.h +81 -26
- data/ext/glib2/rbglib2conversions.h +57 -0
- data/ext/glib2/rbglib_bookmarkfile.c +117 -107
- data/ext/glib2/rbglib_completion.c +37 -26
- data/ext/glib2/rbglib_convert.c +42 -30
- data/ext/glib2/rbglib_error.c +20 -10
- data/ext/glib2/rbglib_fileutils.c +48 -37
- data/ext/glib2/rbglib_i18n.c +24 -14
- data/ext/glib2/rbglib_int64.c +24 -16
- data/ext/glib2/rbglib_iochannel.c +146 -204
- data/ext/glib2/rbglib_iochannel_win32_socket.c +56 -0
- data/ext/glib2/rbglib_iochannelerror.c +49 -0
- data/ext/glib2/rbglib_keyfile.c +171 -182
- data/ext/glib2/rbglib_maincontext.c +107 -92
- data/ext/glib2/rbglib_mainloop.c +34 -21
- data/ext/glib2/rbglib_messages.c +53 -44
- data/ext/glib2/rbglib_pollfd.c +37 -26
- data/ext/glib2/rbglib_shell.c +29 -22
- data/ext/glib2/rbglib_shellerror.c +34 -0
- data/ext/glib2/rbglib_source.c +49 -36
- data/ext/glib2/rbglib_spawn.c +50 -61
- data/ext/glib2/rbglib_spawnerror.c +53 -0
- data/ext/glib2/rbglib_threads.c +28 -16
- data/ext/glib2/rbglib_timer.c +35 -24
- data/ext/glib2/rbglib_ucs4.c +79 -0
- data/ext/glib2/rbglib_unichar.c +209 -0
- data/ext/glib2/rbglib_unicode.c +34 -584
- data/ext/glib2/rbglib_utf16.c +78 -0
- data/ext/glib2/rbglib_utf8.c +259 -0
- data/ext/glib2/rbglib_utils.c +95 -91
- data/ext/glib2/rbglib_win32.c +52 -45
- data/ext/glib2/rbglibdeprecated.c +56 -0
- data/ext/glib2/rbglibdeprecated.h +34 -0
- data/ext/glib2/rbgobj_boxed.c +40 -33
- data/ext/glib2/rbgobj_closure.c +45 -34
- data/ext/glib2/rbgobj_convert.c +19 -9
- data/ext/glib2/rbgobj_enumflags.c +109 -0
- data/ext/glib2/rbgobj_enums.c +67 -646
- data/ext/glib2/rbgobj_flags.c +522 -0
- data/ext/glib2/rbgobj_fundamental.c +19 -6
- data/ext/glib2/rbgobj_object.c +90 -81
- data/ext/glib2/rbgobj_param.c +78 -83
- data/ext/glib2/rbgobj_paramspecs.c +20 -12
- data/ext/glib2/rbgobj_signal.c +248 -193
- data/ext/glib2/rbgobj_strv.c +20 -10
- data/ext/glib2/rbgobj_type.c +153 -149
- data/ext/glib2/rbgobj_typeinstance.c +49 -39
- data/ext/glib2/rbgobj_typeinterface.c +37 -27
- data/ext/glib2/rbgobj_typemodule.c +39 -29
- data/ext/glib2/rbgobj_typeplugin.c +36 -26
- data/ext/glib2/rbgobj_value.c +41 -11
- data/ext/glib2/rbgobj_valuearray.c +59 -23
- data/ext/glib2/rbgobj_valuetypes.c +27 -17
- data/ext/glib2/rbgobject.c +26 -40
- data/ext/glib2/rbgobject.h +38 -20
- data/ext/glib2/rbgprivate.h +87 -5
- data/ext/glib2/rbgutil.c +52 -238
- data/ext/glib2/rbgutil.h +55 -42
- data/ext/glib2/rbgutil_callback.c +47 -12
- data/ext/glib2/rbgutil_list.c +173 -0
- data/ext/glib2/rbgutil_list.h +85 -0
- data/ext/glib2/rbgutildeprecated.c +252 -0
- data/ext/glib2/rbgutildeprecated.h +63 -0
- data/lib/glib-mkenums.rb +2 -2
- data/lib/glib2.rb +2 -25
- data/lib/glib2/deprecatable.rb +149 -0
- data/lib/gnome2-raketask.rb +45 -15
- data/lib/gnome2-win32-binary-downloader.rb +1 -1
- data/lib/mkmf-gnome2.rb +37 -18
- data/test/test_flags.rb +129 -0
- data/test/test_key_file.rb +6 -2
- data/test/test_spawn.rb +33 -0
- metadata +26 -7
- data/ChangeLog +0 -3513
@@ -1,39 +1,49 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002-2006 Ruby-GNOME2 Project Team
|
5
|
+
* Copyright (C) 2002,2003 Masahiro Sakai
|
6
|
+
*
|
7
|
+
* This library is free software; you can redistribute it and/or
|
8
|
+
* modify it under the terms of the GNU Lesser General Public
|
9
|
+
* License as published by the Free Software Foundation; either
|
10
|
+
* version 2.1 of the License, or (at your option) any later version.
|
11
|
+
*
|
12
|
+
* This library is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
* Lesser General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public
|
18
|
+
* License along with this library; if not, write to the Free Software
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
+
* MA 02110-1301 USA
|
21
|
+
*/
|
14
22
|
|
15
23
|
#include "rbgprivate.h"
|
16
24
|
|
17
|
-
|
25
|
+
#define RG_TARGET_NAMESPACE cInstantiatable
|
26
|
+
|
27
|
+
VALUE RG_TARGET_NAMESPACE;
|
18
28
|
|
19
29
|
typedef void (*ClassInfoCallbackFunc) (gpointer instance,
|
20
|
-
|
21
|
-
|
30
|
+
const RGObjClassInfo *class_info,
|
31
|
+
gpointer user_data);
|
22
32
|
|
23
|
-
static VALUE
|
24
|
-
instantiatable_s_allocate(VALUE klass)
|
33
|
+
static G_GNUC_NORETURN VALUE
|
34
|
+
instantiatable_s_allocate(G_GNUC_UNUSED VALUE klass)
|
25
35
|
{
|
26
36
|
rb_raise(rb_eTypeError, "abstract class");
|
27
37
|
}
|
28
38
|
|
29
39
|
static VALUE
|
30
|
-
|
40
|
+
rg_gtype(VALUE self)
|
31
41
|
{
|
32
42
|
return rbgobj_gtype_new(G_TYPE_FROM_INSTANCE(rbgobj_instance_from_ruby_object(self)));
|
33
43
|
}
|
34
44
|
|
35
|
-
static VALUE
|
36
|
-
|
45
|
+
static G_GNUC_NORETURN VALUE
|
46
|
+
rg_clone(VALUE self)
|
37
47
|
{
|
38
48
|
rb_raise(rb_eTypeError, "can't clone %s", rb_class2name(CLASS_OF(self)));
|
39
49
|
}
|
@@ -51,35 +61,35 @@ each_cinfo(gpointer instance, ClassInfoCallbackFunc func, gpointer user_data)
|
|
51
61
|
{
|
52
62
|
guint i;
|
53
63
|
for (i = 0; i < n_interfaces; i++) {
|
54
|
-
|
64
|
+
const RGObjClassInfo *info;
|
55
65
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
66
|
+
info = GTYPE2CINFO_NO_CREATE(interfaces[i]);
|
67
|
+
if (info)
|
68
|
+
func(instance, info, user_data);
|
69
|
+
}
|
60
70
|
}
|
61
71
|
g_free(interfaces);
|
62
72
|
|
63
73
|
{
|
64
74
|
GType type;
|
65
75
|
for (type = gtype; type != G_TYPE_INVALID; type = g_type_parent(type)) {
|
66
|
-
|
76
|
+
const RGObjClassInfo *info;
|
67
77
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
78
|
+
info = GTYPE2CINFO_NO_CREATE(type);
|
79
|
+
if (info)
|
80
|
+
func(instance, info, user_data);
|
81
|
+
}
|
72
82
|
}
|
73
83
|
}
|
74
84
|
|
75
85
|
static void
|
76
|
-
call_cinfo_free(gpointer instance, const RGObjClassInfo *cinfo, gpointer user_data)
|
86
|
+
call_cinfo_free(gpointer instance, const RGObjClassInfo *cinfo, G_GNUC_UNUSED gpointer user_data)
|
77
87
|
{
|
78
88
|
if (cinfo->free) cinfo->free(instance);
|
79
89
|
}
|
80
90
|
|
81
91
|
static void
|
82
|
-
call_cinfo_mark(gpointer instance, const RGObjClassInfo *cinfo, gpointer user_data)
|
92
|
+
call_cinfo_mark(gpointer instance, const RGObjClassInfo *cinfo, G_GNUC_UNUSED gpointer user_data)
|
83
93
|
{
|
84
94
|
if (cinfo->mark) cinfo->mark(instance);
|
85
95
|
}
|
@@ -106,13 +116,13 @@ rbgobj_gc_mark_instance(gpointer instance)
|
|
106
116
|
/**********************************************************************/
|
107
117
|
|
108
118
|
void
|
109
|
-
Init_gobject_typeinstance()
|
119
|
+
Init_gobject_typeinstance(void)
|
110
120
|
{
|
111
121
|
/* should be renamed to GLib::Instance? */
|
112
|
-
|
113
|
-
rb_extend_object(
|
122
|
+
RG_TARGET_NAMESPACE = rb_define_class_under(mGLib, "Instantiatable", rb_cObject);
|
123
|
+
rb_extend_object(RG_TARGET_NAMESPACE, mMetaInterface);
|
114
124
|
|
115
|
-
rb_define_alloc_func(
|
116
|
-
|
117
|
-
|
118
|
-
}
|
125
|
+
rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))instantiatable_s_allocate);
|
126
|
+
RG_DEF_METHOD(gtype, 0);
|
127
|
+
RG_DEF_METHOD(clone, 0);
|
128
|
+
}
|
@@ -1,24 +1,34 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002-2006 Ruby-GNOME2 Project Team
|
5
|
+
* Copyright (C) 2002,2003 Masahiro Sakai
|
6
|
+
*
|
7
|
+
* This library is free software; you can redistribute it and/or
|
8
|
+
* modify it under the terms of the GNU Lesser General Public
|
9
|
+
* License as published by the Free Software Foundation; either
|
10
|
+
* version 2.1 of the License, or (at your option) any later version.
|
11
|
+
*
|
12
|
+
* This library is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
* Lesser General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public
|
18
|
+
* License along with this library; if not, write to the Free Software
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
+
* MA 02110-1301 USA
|
21
|
+
*/
|
14
22
|
|
15
23
|
#include "rbgprivate.h"
|
16
24
|
|
25
|
+
#define RG_TARGET_NAMESPACE mMetaInterface
|
26
|
+
|
17
27
|
VALUE rbgobj_mInterface;
|
18
|
-
VALUE
|
28
|
+
VALUE RG_TARGET_NAMESPACE;
|
19
29
|
|
20
30
|
static VALUE
|
21
|
-
|
31
|
+
rg_append_features(G_GNUC_UNUSED VALUE self, VALUE klass)
|
22
32
|
{
|
23
33
|
if (!rb_obj_is_kind_of(klass, cInstantiatable))
|
24
34
|
rb_raise(rb_eTypeError, "Not a subclass of GLib::Instantiatable");
|
@@ -28,7 +38,7 @@ interface_s_append_features(VALUE self, VALUE klass)
|
|
28
38
|
#if GLIB_CHECK_VERSION(2,4,0)
|
29
39
|
|
30
40
|
static VALUE
|
31
|
-
|
41
|
+
rg_install_property(VALUE self, VALUE pspec_obj)
|
32
42
|
{
|
33
43
|
const RGObjClassInfo* cinfo = rbgobj_lookup_class(self);
|
34
44
|
gpointer ginterface;
|
@@ -47,7 +57,7 @@ interface_s_install_property(VALUE self, VALUE pspec_obj)
|
|
47
57
|
}
|
48
58
|
|
49
59
|
static VALUE
|
50
|
-
|
60
|
+
rg_property(VALUE self, VALUE property_name)
|
51
61
|
{
|
52
62
|
gpointer ginterface;
|
53
63
|
const char* name;
|
@@ -82,7 +92,7 @@ interface_s_property(VALUE self, VALUE property_name)
|
|
82
92
|
}
|
83
93
|
|
84
94
|
static VALUE
|
85
|
-
|
95
|
+
rg_properties(int argc, VALUE* argv, VALUE self)
|
86
96
|
{
|
87
97
|
guint n_properties;
|
88
98
|
GParamSpec** props;
|
@@ -119,9 +129,9 @@ rbgobj_init_interface(VALUE interf)
|
|
119
129
|
{
|
120
130
|
static VALUE rb_mGLibInterface = Qnil;
|
121
131
|
|
122
|
-
rb_extend_object(interf,
|
132
|
+
rb_extend_object(interf, RG_TARGET_NAMESPACE);
|
123
133
|
if (CLASS2GTYPE(interf) == G_TYPE_INTERFACE) {
|
124
|
-
|
134
|
+
rb_mGLibInterface = interf;
|
125
135
|
} else {
|
126
136
|
rb_extend_object(interf, rb_mGLibInterface);
|
127
137
|
rb_include_module(interf, rb_mGLibInterface);
|
@@ -130,16 +140,16 @@ rbgobj_init_interface(VALUE interf)
|
|
130
140
|
}
|
131
141
|
|
132
142
|
void
|
133
|
-
Init_gobject_typeinterface()
|
143
|
+
Init_gobject_typeinterface(void)
|
134
144
|
{
|
135
|
-
|
136
|
-
rb_define_method(
|
137
|
-
|
145
|
+
RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "MetaInterface");
|
146
|
+
rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
|
147
|
+
RG_DEF_METHOD(append_features, 1);
|
138
148
|
#if GLIB_CHECK_VERSION(2,4,0)
|
139
|
-
|
140
|
-
|
141
|
-
|
149
|
+
RG_DEF_METHOD(install_property, 1);
|
150
|
+
RG_DEF_METHOD(property, 1);
|
151
|
+
RG_DEF_METHOD(properties, -1);
|
142
152
|
#endif
|
143
153
|
|
144
154
|
rbgobj_mInterface = G_DEF_INTERFACE(G_TYPE_INTERFACE, "Interface", mGLib);
|
145
|
-
}
|
155
|
+
}
|
@@ -1,39 +1,49 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002,2003 Masahiro Sakai
|
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
|
+
*/
|
13
21
|
|
14
22
|
#include "rbgprivate.h"
|
15
23
|
|
24
|
+
#define RG_TARGET_NAMESPACE cTypeModule
|
25
|
+
|
16
26
|
static VALUE
|
17
|
-
|
27
|
+
rg_use(VALUE self)
|
18
28
|
{
|
19
29
|
return CBOOL2RVAL(g_type_module_use(G_TYPE_MODULE(RVAL2GOBJ(self))));
|
20
30
|
}
|
21
31
|
|
22
32
|
static VALUE
|
23
|
-
|
33
|
+
rg_unuse(VALUE self)
|
24
34
|
{
|
25
35
|
g_type_module_unuse(G_TYPE_MODULE(RVAL2GOBJ(self)));
|
26
36
|
return self;
|
27
37
|
}
|
28
38
|
|
29
39
|
static VALUE
|
30
|
-
|
40
|
+
rg_name(VALUE self)
|
31
41
|
{
|
32
42
|
return rb_str_new2(G_TYPE_MODULE(RVAL2GOBJ(self))->name);
|
33
43
|
}
|
34
44
|
|
35
45
|
static VALUE
|
36
|
-
|
46
|
+
rg_operator_set_name(VALUE self, VALUE name)
|
37
47
|
{
|
38
48
|
g_type_module_set_name(G_TYPE_MODULE(RVAL2GOBJ(self)), StringValuePtr(name));
|
39
49
|
return name;
|
@@ -41,22 +51,22 @@ set_name(VALUE self, VALUE name)
|
|
41
51
|
|
42
52
|
#if 0
|
43
53
|
GType g_type_module_register_type (GTypeModule *module,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
54
|
+
GType parent_type,
|
55
|
+
const gchar *type_name,
|
56
|
+
const GTypeInfo *type_info,
|
57
|
+
GTypeFlags flags);
|
48
58
|
void g_type_module_add_interface (GTypeModule *module,
|
49
|
-
|
50
|
-
|
51
|
-
|
59
|
+
GType instance_type,
|
60
|
+
GType interface_type,
|
61
|
+
const GInterfaceInfo *interface_info);
|
52
62
|
#endif
|
53
63
|
|
54
64
|
void
|
55
|
-
Init_gobject_gtypemodule()
|
65
|
+
Init_gobject_gtypemodule(void)
|
56
66
|
{
|
57
|
-
VALUE
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
}
|
67
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TYPE_MODULE, "TypeModule", mGLib);
|
68
|
+
RG_DEF_METHOD(use, 0);
|
69
|
+
RG_DEF_METHOD(unuse, 0);
|
70
|
+
RG_DEF_METHOD(name, 0);
|
71
|
+
RG_DEF_METHOD_OPERATOR("name=", set_name, 1);
|
72
|
+
}
|
@@ -1,47 +1,57 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002,2003 Masahiro Sakai
|
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
|
+
*/
|
13
21
|
|
14
22
|
#include "rbgprivate.h"
|
15
23
|
|
24
|
+
#define RG_TARGET_NAMESPACE mTypePlugin
|
25
|
+
|
16
26
|
static VALUE
|
17
|
-
|
27
|
+
rg_use(VALUE self)
|
18
28
|
{
|
19
29
|
g_type_plugin_use(G_TYPE_PLUGIN(RVAL2GOBJ(self)));
|
20
30
|
return self;
|
21
31
|
}
|
22
32
|
|
23
33
|
static VALUE
|
24
|
-
|
34
|
+
rg_unuse(VALUE self)
|
25
35
|
{
|
26
36
|
g_type_plugin_unuse(G_TYPE_PLUGIN(RVAL2GOBJ(self)));
|
27
37
|
return self;
|
28
38
|
}
|
29
39
|
|
30
40
|
#if 0
|
31
|
-
void
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
void
|
36
|
-
|
37
|
-
|
38
|
-
|
41
|
+
void g_type_plugin_complete_type_info (GTypePlugin *plugin,
|
42
|
+
GType g_type,
|
43
|
+
GTypeInfo *info,
|
44
|
+
GTypeValueTable *value_table);
|
45
|
+
void g_type_plugin_complete_interface_info (GTypePlugin *plugin,
|
46
|
+
GType interface_type,
|
47
|
+
GType instance_type,
|
48
|
+
GInterfaceInfo *info);
|
39
49
|
#endif
|
40
50
|
|
41
51
|
void
|
42
|
-
Init_gobject_gtypeplugin()
|
52
|
+
Init_gobject_gtypeplugin(void)
|
43
53
|
{
|
44
|
-
VALUE
|
45
|
-
|
46
|
-
|
47
|
-
}
|
54
|
+
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_TYPE_PLUGIN, "TypePlugin", mGLib);
|
55
|
+
RG_DEF_METHOD(use, 0);
|
56
|
+
RG_DEF_METHOD(unuse, 0);
|
57
|
+
}
|
data/ext/glib2/rbgobj_value.c
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
+
* Copyright (C) 2002,2003 Masahiro Sakai
|
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
|
+
*/
|
12
21
|
|
13
22
|
#include "rbgprivate.h"
|
14
23
|
|
@@ -126,6 +135,27 @@ rbgobj_gvalue_to_rvalue(const GValue* value)
|
|
126
135
|
}
|
127
136
|
}
|
128
137
|
|
138
|
+
static VALUE
|
139
|
+
rbgobj_gvalue_to_rvalue_unset_body(VALUE value)
|
140
|
+
{
|
141
|
+
return GVAL2RVAL((GValue *)value);
|
142
|
+
}
|
143
|
+
|
144
|
+
static VALUE
|
145
|
+
rbgobj_gvalue_to_rvalue_unset_ensure(VALUE value)
|
146
|
+
{
|
147
|
+
g_value_unset((GValue *)value);
|
148
|
+
|
149
|
+
return Qnil;
|
150
|
+
}
|
151
|
+
|
152
|
+
VALUE
|
153
|
+
rbgobj_gvalue_to_rvalue_unset(GValue *value)
|
154
|
+
{
|
155
|
+
return rb_ensure(rbgobj_gvalue_to_rvalue_unset_body, (VALUE)value,
|
156
|
+
rbgobj_gvalue_to_rvalue_unset_ensure, (VALUE)value);
|
157
|
+
}
|
158
|
+
|
129
159
|
void
|
130
160
|
rbgobj_initialize_gvalue(GValue *result, VALUE value)
|
131
161
|
{
|
@@ -303,7 +333,7 @@ rbgobj_gc_mark_gvalue(GValue* value)
|
|
303
333
|
/**********************************************************************/
|
304
334
|
|
305
335
|
void
|
306
|
-
Init_gobject_gvalue()
|
336
|
+
Init_gobject_gvalue(void)
|
307
337
|
{
|
308
338
|
id_to_s = rb_intern("to_s");
|
309
339
|
qRValueToGValueFunc = g_quark_from_static_string("__ruby_r2g_func__");
|