glib2 4.2.5 → 4.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ext/glib2/extconf.rb +2 -2
- data/ext/glib2/glib2.def +2 -4
- data/ext/glib2/rbglib-variant.c +1 -1
- data/ext/glib2/rbglib.c +10 -6
- data/ext/glib2/rbglib.h +1 -1
- data/ext/glib2/rbglib_fileutils.c +5 -4
- data/ext/glib2/rbglib_maincontext.c +12 -21
- data/ext/glib2/rbglib_unichar.c +31 -31
- data/ext/glib2/rbglib_unicode.c +2 -2
- data/ext/glib2/rbglib_utils.c +2 -2
- data/ext/glib2/rbglib_win32.c +4 -4
- data/ext/glib2/rbgobj_boxed.c +7 -7
- data/ext/glib2/rbgobj_enums.c +3 -4
- data/ext/glib2/rbgobj_flags.c +11 -11
- data/ext/glib2/rbgobj_object.c +99 -113
- data/ext/glib2/rbgobj_param.c +24 -24
- data/ext/glib2/rbgobj_paramspecs.c +18 -18
- data/ext/glib2/rbgobj_signal.c +26 -26
- data/ext/glib2/rbgobj_type.c +9 -17
- data/ext/glib2/rbgobj_typeinstance.c +88 -4
- data/ext/glib2/rbgobj_typeinterface.c +6 -6
- data/ext/glib2/rbgobj_value.c +13 -4
- data/ext/glib2/rbgobj_valuetypes.c +5 -5
- data/ext/glib2/rbgobject.c +20 -7
- data/ext/glib2/rbgobject.h +1 -2
- data/ext/glib2/rbgprivate.h +5 -1
- data/ext/glib2/rbgutil.c +20 -37
- data/ext/glib2/rbgutil.h +25 -7
- data/lib/glib2/deprecated.rb +11 -1
- data/lib/glib2/value.rb +46 -0
- data/lib/glib2.rb +2 -1
- data/test/test-value.rb +38 -3
- data/test/test-variant.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e278dde163e8d497ede015df6d5b274379bfe750ac7ffd56da075f131788363d
|
4
|
+
data.tar.gz: 8eb2125a49ae54dab3551f626e3ed16cba35637782f0237094ec9408f3afe3eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213be1775836e0fc704ecda13ccc0acec168a663c7d7febcf469ad09231d6a61e6096e980fdbbc7187001024dff57dcc43e43f9620f6cc51241e3664b57f0f6d
|
7
|
+
data.tar.gz: 1b3d657906865e78ef16f13585f8c32c5881f59096496c076c178df2ec653068dda7d2529d75266d203639172dd87e7e673ac01c661185bb3e3cf651c57f41e2
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Ruby/GLib2
|
2
2
|
|
3
|
-
Ruby/GLib2 is a Ruby binding of GLib 2.
|
3
|
+
Ruby/GLib2 is a Ruby binding of GLib 2.56 or later.
|
4
4
|
|
5
5
|
## Requirements
|
6
6
|
|
7
7
|
* Ruby >= 2.5: https://www.ruby-lang.org/
|
8
8
|
* pkg-config.rb: https://github.com/ruby-gnome/pkg-config
|
9
|
-
* GLib >= 2.
|
9
|
+
* GLib >= 2.56: https://www.gtk.org/
|
10
10
|
|
11
11
|
## Install
|
12
12
|
|
@@ -16,7 +16,7 @@ gem install glib2
|
|
16
16
|
|
17
17
|
## Copying
|
18
18
|
|
19
|
-
Copyright (
|
19
|
+
Copyright (C) 2002-2025 Ruby-GNOME Project Team
|
20
20
|
|
21
21
|
This program is free software.
|
22
22
|
You can distribute/modify this program under the terms of
|
data/ext/glib2/extconf.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2002-
|
1
|
+
# Copyright (C) 2002-2025 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -26,7 +26,7 @@ package_id = "gobject-2.0"
|
|
26
26
|
|
27
27
|
require "mkmf-gnome"
|
28
28
|
|
29
|
-
unless required_pkg_config_package([package_id, 2,
|
29
|
+
unless required_pkg_config_package([package_id, 2, 56, 0],
|
30
30
|
:alt_linux => "glib2-devel",
|
31
31
|
:arch_linux => "glib2",
|
32
32
|
:conda => "glib",
|
data/ext/glib2/glib2.def
CHANGED
@@ -20,7 +20,6 @@ EXPORTS
|
|
20
20
|
rbgobj_instance_unref
|
21
21
|
rbgobj_get_ruby_object_from_gobject
|
22
22
|
rbgobj_create_object
|
23
|
-
rbgobj_gobject_new
|
24
23
|
rbgobj_gobject_initialize
|
25
24
|
rbgobj_boxed_alloc_func
|
26
25
|
rbgobj_boxed_create
|
@@ -132,9 +131,8 @@ EXPORTS
|
|
132
131
|
rbg_gslist2rval_with_type
|
133
132
|
rbg_rval2glist
|
134
133
|
rbg_rval2gslist
|
135
|
-
|
136
|
-
|
137
|
-
rbg_define_singleton_method
|
134
|
+
rbg_define_setter_alias_if_need
|
135
|
+
rbg_define_singleton_setter_alias_if_need
|
138
136
|
rbg_to_array
|
139
137
|
rbg_to_hash
|
140
138
|
rbg_check_array_type
|
data/ext/glib2/rbglib-variant.c
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-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME 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
|
@@ -23,16 +23,18 @@
|
|
23
23
|
#include "rbgprivate.h"
|
24
24
|
#include "rbglib.h"
|
25
25
|
|
26
|
-
#define RG_TARGET_NAMESPACE
|
26
|
+
#define RG_TARGET_NAMESPACE rbg_mGLib()
|
27
27
|
|
28
28
|
static ID id_inspect;
|
29
29
|
|
30
|
-
VALUE
|
30
|
+
VALUE mGLib;
|
31
31
|
|
32
32
|
VALUE
|
33
33
|
rbg_mGLib(void)
|
34
34
|
{
|
35
|
-
|
35
|
+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
36
|
+
return mGLib;
|
37
|
+
G_GNUC_END_IGNORE_DEPRECATIONS
|
36
38
|
}
|
37
39
|
|
38
40
|
const gchar *
|
@@ -1105,7 +1107,9 @@ Init_glib2(void)
|
|
1105
1107
|
|
1106
1108
|
id_inspect = rb_intern("inspect");
|
1107
1109
|
|
1108
|
-
|
1110
|
+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
1111
|
+
mGLib = rb_define_module("GLib");
|
1112
|
+
G_GNUC_END_IGNORE_DEPRECATIONS
|
1109
1113
|
|
1110
1114
|
setlocale (LC_CTYPE, "");
|
1111
1115
|
#ifdef LC_MESSAGES
|
@@ -1157,7 +1161,7 @@ Init_glib2(void)
|
|
1157
1161
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXINT16", INT2FIX(G_MAXINT16));
|
1158
1162
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT16", UINT2NUM(G_MAXUINT16));
|
1159
1163
|
|
1160
|
-
rb_define_const(RG_TARGET_NAMESPACE, "MININT32",
|
1164
|
+
rb_define_const(RG_TARGET_NAMESPACE, "MININT32", INT2NUM(G_MININT32));
|
1161
1165
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXINT32", INT2NUM(G_MAXINT32));
|
1162
1166
|
rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT32", UINT2NUM(G_MAXUINT32));
|
1163
1167
|
|
data/ext/glib2/rbglib.h
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME Project Team
|
4
4
|
* Copyright (C) 2004 Masao Mutoh
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -50,7 +50,7 @@ void g_dir_close (GDir *dir);
|
|
50
50
|
*/
|
51
51
|
|
52
52
|
static VALUE
|
53
|
-
|
53
|
+
rg_s_format_size(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
54
54
|
{
|
55
55
|
VALUE rb_size, rb_options;
|
56
56
|
|
@@ -98,6 +98,7 @@ Init_glib_fileutils(void)
|
|
98
98
|
rb_define_const(RG_TARGET_NAMESPACE, "PERM", INT2NUM(G_FILE_ERROR_PERM));
|
99
99
|
rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(G_FILE_ERROR_FAILED));
|
100
100
|
|
101
|
-
|
102
|
-
|
101
|
+
#undef RG_TARGET_NAMESPACE
|
102
|
+
#define RG_TARGET_NAMESPACE rbg_mGLib()
|
103
|
+
RG_DEF_SMETHOD(format_size, -1);
|
103
104
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME Project Team
|
4
4
|
* Copyright (C) 2005 Masao Mutoh
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -104,12 +104,6 @@ rg_poll(GPollFD *ufds, guint nfsd, gint timeout)
|
|
104
104
|
return info.result;
|
105
105
|
}
|
106
106
|
|
107
|
-
static VALUE
|
108
|
-
ruby_source_set_priority (G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE priority)
|
109
|
-
{
|
110
|
-
return Qnil;
|
111
|
-
}
|
112
|
-
|
113
107
|
static void
|
114
108
|
restore_poll_func(G_GNUC_UNUSED VALUE data)
|
115
109
|
{
|
@@ -510,12 +504,9 @@ Init_glib_main_context(void)
|
|
510
504
|
|
511
505
|
main_thread = g_thread_self();
|
512
506
|
|
513
|
-
rbg_define_singleton_method(rbg_mGLib(), "set_ruby_thread_priority",
|
514
|
-
ruby_source_set_priority, 1);
|
515
|
-
|
516
507
|
mGLibSource = rb_const_get(rbg_mGLib(), rb_intern("Source"));
|
517
|
-
|
518
|
-
|
508
|
+
rb_define_singleton_method(mGLibSource, "remove", source_remove, 1);
|
509
|
+
rb_define_singleton_method(mGLibSource, "current", source_current_source, 0);
|
519
510
|
/*
|
520
511
|
id_poll_func = rb_intern("__poll_func__");
|
521
512
|
*/
|
@@ -540,15 +531,15 @@ Init_glib_main_context(void)
|
|
540
531
|
RG_DEF_METHOD(add_poll, 2);
|
541
532
|
RG_DEF_METHOD(remove_poll, 1);
|
542
533
|
RG_DEF_SMETHOD(depth, 0);
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
534
|
+
rb_define_singleton_method(timeout, "source_new", timeout_source_new, 1);
|
535
|
+
rb_define_singleton_method(timeout, "source_new_seconds", timeout_source_new_seconds, 1);
|
536
|
+
rb_define_singleton_method(timeout, "add", timeout_add, -1);
|
537
|
+
rb_define_singleton_method(timeout, "add_seconds", timeout_add_seconds, -1);
|
538
|
+
rb_define_singleton_method(idle, "source_new", idle_source_new, 0);
|
539
|
+
rb_define_singleton_method(idle, "add", idle_add, -1);
|
540
|
+
|
541
|
+
rb_define_singleton_method(child_watch, "source_new", child_watch_source_new, 1);
|
542
|
+
rb_define_singleton_method(child_watch, "add", child_watch_add, 1);
|
552
543
|
|
553
544
|
default_poll_func = g_main_context_get_poll_func(NULL);
|
554
545
|
g_main_context_set_poll_func(NULL, rg_poll);
|
data/ext/glib2/rbglib_unichar.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME Project Team
|
4
4
|
* Copyright (C) 2006 Kouhei Sutou
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -187,36 +187,36 @@ Init_glib_unichar(void)
|
|
187
187
|
{
|
188
188
|
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(rbg_mGLib(), "UniChar");
|
189
189
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
190
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "alnum?",
|
191
|
+
rbglib_m_unichar_isalnum, 1);
|
192
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "alpha?",
|
193
|
+
rbglib_m_unichar_isalpha, 1);
|
194
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "cntrl?",
|
195
|
+
rbglib_m_unichar_iscntrl, 1);
|
196
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "digit?",
|
197
|
+
rbglib_m_unichar_isdigit, 1);
|
198
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "graph?",
|
199
|
+
rbglib_m_unichar_isgraph, 1);
|
200
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "lower?",
|
201
|
+
rbglib_m_unichar_islower, 1);
|
202
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "print?",
|
203
|
+
rbglib_m_unichar_isprint, 1);
|
204
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "punct?",
|
205
|
+
rbglib_m_unichar_ispunct, 1);
|
206
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "space?",
|
207
|
+
rbglib_m_unichar_isspace, 1);
|
208
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "upper?",
|
209
|
+
rbglib_m_unichar_isupper, 1);
|
210
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "xdigit?",
|
211
|
+
rbglib_m_unichar_isxdigit, 1);
|
212
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "title?",
|
213
|
+
rbglib_m_unichar_istitle, 1);
|
214
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "defined?",
|
215
|
+
rbglib_m_unichar_isdefined, 1);
|
216
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "wide?",
|
217
|
+
rbglib_m_unichar_iswide, 1);
|
218
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "wide_cjk?",
|
219
|
+
rbglib_m_unichar_iswide_cjk, 1);
|
220
220
|
|
221
221
|
RG_DEF_SMETHOD(to_upper, 1);
|
222
222
|
RG_DEF_SMETHOD(to_lower, 1);
|
data/ext/glib2/rbglib_unicode.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME Project Team
|
4
4
|
* Copyright (C) 2006 Kouhei Sutou
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -67,7 +67,7 @@ Init_glib_unicode(void)
|
|
67
67
|
|
68
68
|
G_DEF_CLASS(G_TYPE_NORMALIZE_MODE, "NormalizeMode", rbg_mGLib());
|
69
69
|
|
70
|
-
|
70
|
+
rb_define_singleton_method(rbg_mGLib(), "charset", rbglib_m_charset, 0);
|
71
71
|
|
72
72
|
RG_DEF_SMETHOD(canonical_ordering, 1);
|
73
73
|
}
|
data/ext/glib2/rbglib_utils.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2004-
|
3
|
+
* Copyright (C) 2004-2025 Ruby-GNOME Project Team
|
4
4
|
* Copyright (C) 2004 Pascal Terjan
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -308,7 +308,7 @@ Init_glib_utils(void)
|
|
308
308
|
RG_DEF_SMETHOD(prgname, 0);
|
309
309
|
RG_DEF_SMETHOD(set_prgname, 1);
|
310
310
|
RG_DEF_SMETHOD(getenv, 1);
|
311
|
-
RG_DEF_SMETHOD(setenv,
|
311
|
+
RG_DEF_SMETHOD(setenv, 3);
|
312
312
|
RG_DEF_SMETHOD(unsetenv, 1);
|
313
313
|
RG_DEF_SMETHOD(listenv, 0);
|
314
314
|
RG_DEF_SMETHOD(host_name, 0);
|
data/ext/glib2/rbglib_win32.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME Project Team
|
4
4
|
* Copyright (C) 2006 Kouhei Sutou
|
5
5
|
*
|
6
6
|
* This library is free software; you can redistribute it and/or
|
@@ -96,12 +96,12 @@ Init_glib_win32(void)
|
|
96
96
|
RG_DEF_SMETHOD(locale, 0);
|
97
97
|
RG_DEF_SMETHOD(version, 0);
|
98
98
|
/* Deprecated */
|
99
|
-
|
99
|
+
rb_define_singleton_method(rbg_mGLib(), "win32_locale", rbglib_m_win32_locale_deprecated, 0);
|
100
100
|
|
101
101
|
RG_DEF_SMETHOD(locale_filename_from_utf8, 1);
|
102
102
|
/* Deprecated */
|
103
|
-
|
104
|
-
|
103
|
+
rb_define_singleton_method(rbg_mGLib(), "win32_locale_filename_from_utf8",
|
104
|
+
rbglib_m_win32_locale_filename_from_utf8_deprecated, 1);
|
105
105
|
|
106
106
|
RG_DEF_SMETHOD(get_package_installation_directory_of_module, -1);
|
107
107
|
#endif
|
data/ext/glib2/rbgobj_boxed.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2011-
|
3
|
+
* Copyright (C) 2011-2025 Ruby-GNOME 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
|
@@ -319,13 +319,13 @@ Init_gobject_gboxed(void)
|
|
319
319
|
rbgobj_register_r2g_func(G_TYPE_BOXED, boxed_from_ruby);
|
320
320
|
|
321
321
|
rb_define_alloc_func(RG_TARGET_NAMESPACE, rbgobj_boxed_alloc_func);
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
322
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
|
323
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE,
|
324
|
+
"to_s",
|
325
|
+
rbgutil_generic_s_to_s_gtype_name_fallback,
|
326
|
+
0);
|
327
327
|
RG_DEF_SALIAS("inspect", "to_s");
|
328
|
-
|
328
|
+
rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
|
329
329
|
RG_DEF_METHOD(initialize, 0);
|
330
330
|
RG_DEF_METHOD(inspect, 0);
|
331
331
|
RG_DEF_METHOD(initialize_copy, 1);
|
data/ext/glib2/rbgobj_enums.c
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C)
|
4
|
-
* Copyright (C) 2004-2006 Ruby-GNOME Project Team
|
3
|
+
* Copyright (C) 2004-2025 Ruby-GNOME Project Team
|
5
4
|
* Copyright (C) 2002,2003 Masahiro Sakai
|
6
5
|
*
|
7
6
|
* This library is free software; you can redistribute it and/or
|
@@ -417,8 +416,8 @@ Init_gobject_genums(void)
|
|
417
416
|
|
418
417
|
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ENUM, "Enum", rbg_mGLib());
|
419
418
|
|
420
|
-
|
421
|
-
|
419
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
|
420
|
+
rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
|
422
421
|
|
423
422
|
RG_DEF_SMETHOD(range, 0);
|
424
423
|
RG_DEF_SMETHOD(values, 0);
|
data/ext/glib2/rbgobj_flags.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C) 2004-
|
3
|
+
* Copyright (C) 2004-2025 Ruby-GNOME 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
|
@@ -546,13 +546,13 @@ Init_gobject_gflags(void)
|
|
546
546
|
|
547
547
|
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FLAGS, "Flags", rbg_mGLib());
|
548
548
|
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
549
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0);
|
550
|
+
rb_define_singleton_method(RG_TARGET_NAMESPACE,
|
551
|
+
"to_s",
|
552
|
+
rbgutil_generic_s_to_s_gtype_name_fallback,
|
553
|
+
0);
|
554
554
|
RG_DEF_SALIAS("inspect", "to_s");
|
555
|
-
|
555
|
+
rb_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0);
|
556
556
|
|
557
557
|
RG_DEF_SMETHOD(mask, 0);
|
558
558
|
RG_DEF_SMETHOD(values, 0);
|
@@ -567,7 +567,7 @@ Init_gobject_gflags(void)
|
|
567
567
|
RG_DEF_METHOD(nick, 0);
|
568
568
|
|
569
569
|
/*
|
570
|
-
|
570
|
+
rb_define_method(RG_TARGET_NAMESPACE, "inspect", flags_inspect, 0);
|
571
571
|
*/
|
572
572
|
|
573
573
|
RG_DEF_METHOD_OPERATOR("<=>", flags_compare, 1);
|
@@ -577,9 +577,9 @@ Init_gobject_gflags(void)
|
|
577
577
|
RG_DEF_METHOD_OPERATOR(">", flags_gt, 1);
|
578
578
|
RG_DEF_METHOD_OPERATOR("<", flags_lt, 1);
|
579
579
|
RG_DEF_METHOD_OPERATOR("~", flags_not, 0);
|
580
|
-
|
581
|
-
|
582
|
-
|
580
|
+
rb_define_method(RG_TARGET_NAMESPACE, "&", flags_and, 1);
|
581
|
+
rb_define_method(RG_TARGET_NAMESPACE, "|", flags_or, 1);
|
582
|
+
rb_define_method(RG_TARGET_NAMESPACE, "^", flags_xor, 1);
|
583
583
|
RG_DEF_METHOD_OPERATOR("-", flags_minus, 1);
|
584
584
|
|
585
585
|
RG_DEF_METHOD_P(empty, 0);
|