glib2 0.20.0 → 0.90.2

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.
Files changed (175) hide show
  1. data/ChangeLog +92 -0
  2. data/README +22 -10
  3. data/Rakefile +54 -72
  4. data/ext/glib2/depend +10 -0
  5. data/ext/glib2/extconf.rb +61 -0
  6. data/ext/glib2/glib2.def +89 -0
  7. data/{src → ext/glib2}/rbgcompat.h +0 -0
  8. data/{src → ext/glib2}/rbglib.c +17 -7
  9. data/{src → ext/glib2}/rbglib.h +2 -2
  10. data/{src → ext/glib2}/rbglib_bookmarkfile.c +0 -0
  11. data/{src → ext/glib2}/rbglib_completion.c +0 -0
  12. data/{src → ext/glib2}/rbglib_convert.c +0 -0
  13. data/{src → ext/glib2}/rbglib_error.c +0 -0
  14. data/{src → ext/glib2}/rbglib_fileutils.c +0 -0
  15. data/{src → ext/glib2}/rbglib_i18n.c +0 -0
  16. data/{src → ext/glib2}/rbglib_int64.c +0 -0
  17. data/{src → ext/glib2}/rbglib_iochannel.c +0 -0
  18. data/{src → ext/glib2}/rbglib_keyfile.c +0 -0
  19. data/{src → ext/glib2}/rbglib_maincontext.c +1 -3
  20. data/{src → ext/glib2}/rbglib_mainloop.c +0 -0
  21. data/{src → ext/glib2}/rbglib_messages.c +0 -0
  22. data/{src → ext/glib2}/rbglib_pollfd.c +0 -0
  23. data/{src → ext/glib2}/rbglib_shell.c +0 -0
  24. data/{src → ext/glib2}/rbglib_source.c +0 -0
  25. data/{src → ext/glib2}/rbglib_spawn.c +0 -0
  26. data/{src → ext/glib2}/rbglib_threads.c +0 -0
  27. data/{src → ext/glib2}/rbglib_timer.c +0 -0
  28. data/{src → ext/glib2}/rbglib_unicode.c +0 -0
  29. data/{src → ext/glib2}/rbglib_utils.c +0 -0
  30. data/{src → ext/glib2}/rbglib_win32.c +0 -0
  31. data/{src → ext/glib2}/rbgobj_boxed.c +0 -0
  32. data/{src → ext/glib2}/rbgobj_closure.c +0 -0
  33. data/{src → ext/glib2}/rbgobj_convert.c +0 -0
  34. data/{src → ext/glib2}/rbgobj_enums.c +0 -0
  35. data/{src → ext/glib2}/rbgobj_fundamental.c +0 -0
  36. data/{src → ext/glib2}/rbgobj_object.c +0 -0
  37. data/{src → ext/glib2}/rbgobj_param.c +0 -0
  38. data/{src → ext/glib2}/rbgobj_paramspecs.c +0 -0
  39. data/{src → ext/glib2}/rbgobj_signal.c +0 -0
  40. data/{src → ext/glib2}/rbgobj_strv.c +0 -0
  41. data/{src → ext/glib2}/rbgobj_type.c +0 -0
  42. data/{src → ext/glib2}/rbgobj_typeinstance.c +0 -0
  43. data/{src → ext/glib2}/rbgobj_typeinterface.c +0 -0
  44. data/{src → ext/glib2}/rbgobj_typemodule.c +0 -0
  45. data/{src → ext/glib2}/rbgobj_typeplugin.c +0 -0
  46. data/{src → ext/glib2}/rbgobj_value.c +0 -0
  47. data/{src → ext/glib2}/rbgobj_valuearray.c +0 -0
  48. data/{src → ext/glib2}/rbgobj_valuetypes.c +0 -0
  49. data/{src → ext/glib2}/rbgobject.c +0 -0
  50. data/{src → ext/glib2}/rbgobject.h +0 -0
  51. data/{src → ext/glib2}/rbgprivate.h +0 -0
  52. data/ext/glib2/rbgutil.c +316 -0
  53. data/{src → ext/glib2}/rbgutil.h +9 -9
  54. data/{src → ext/glib2}/rbgutil_callback.c +0 -0
  55. data/extconf.rb +48 -60
  56. data/{src/lib → lib}/glib-mkenums.rb +2 -2
  57. data/{src/lib → lib}/glib2.rb +28 -9
  58. data/lib/gnome2-win32-binary-downloader.rb +92 -0
  59. data/{src/lib → lib}/mkmf-gnome2.rb +76 -89
  60. data/test-unit/COPYING +56 -0
  61. data/test-unit/GPL +340 -0
  62. data/test-unit/History.txt +232 -0
  63. data/test-unit/Manifest.txt +110 -0
  64. data/test-unit/PSFL +271 -0
  65. data/test-unit/README.txt +75 -0
  66. data/test-unit/Rakefile +53 -0
  67. data/test-unit/TODO +5 -0
  68. data/test-unit/bin/testrb +5 -0
  69. data/test-unit/html/bar.png +0 -0
  70. data/test-unit/html/bar.svg +153 -0
  71. data/test-unit/html/developer.png +0 -0
  72. data/test-unit/html/developer.svg +469 -0
  73. data/test-unit/html/famfamfam-logo.png +0 -0
  74. data/test-unit/html/favicon.ico +0 -0
  75. data/test-unit/html/favicon.png +0 -0
  76. data/test-unit/html/favicon.svg +82 -0
  77. data/test-unit/html/heading-mark.png +0 -0
  78. data/test-unit/html/heading-mark.svg +393 -0
  79. data/test-unit/html/index.html +247 -0
  80. data/test-unit/html/index.html.ja +270 -0
  81. data/test-unit/html/install.png +0 -0
  82. data/test-unit/html/install.svg +636 -0
  83. data/test-unit/html/jp.png +0 -0
  84. data/test-unit/html/kinotan-failure.png +0 -0
  85. data/test-unit/html/kinotan-pass.png +0 -0
  86. data/test-unit/html/logo.png +0 -0
  87. data/test-unit/html/logo.svg +483 -0
  88. data/test-unit/html/reference.png +0 -0
  89. data/test-unit/html/rubyforge.png +0 -0
  90. data/test-unit/html/tango-logo.png +0 -0
  91. data/test-unit/html/test-unit.css +339 -0
  92. data/test-unit/html/tutorial.png +0 -0
  93. data/test-unit/html/tutorial.svg +559 -0
  94. data/test-unit/html/us.png +0 -0
  95. data/test-unit/images/color-diff.png +0 -0
  96. data/test-unit/lib/test/unit.rb +328 -0
  97. data/test-unit/lib/test/unit/assertionfailederror.rb +25 -0
  98. data/test-unit/lib/test/unit/assertions.rb +1334 -0
  99. data/test-unit/lib/test/unit/attribute.rb +125 -0
  100. data/test-unit/lib/test/unit/autorunner.rb +363 -0
  101. data/test-unit/lib/test/unit/collector.rb +36 -0
  102. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  103. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  104. data/test-unit/lib/test/unit/collector/load.rb +144 -0
  105. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  106. data/test-unit/lib/test/unit/color-scheme.rb +106 -0
  107. data/test-unit/lib/test/unit/color.rb +96 -0
  108. data/test-unit/lib/test/unit/diff.rb +740 -0
  109. data/test-unit/lib/test/unit/error.rb +130 -0
  110. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  111. data/test-unit/lib/test/unit/failure.rb +136 -0
  112. data/test-unit/lib/test/unit/fixture.rb +176 -0
  113. data/test-unit/lib/test/unit/notification.rb +129 -0
  114. data/test-unit/lib/test/unit/omission.rb +191 -0
  115. data/test-unit/lib/test/unit/pending.rb +150 -0
  116. data/test-unit/lib/test/unit/priority.rb +180 -0
  117. data/test-unit/lib/test/unit/runner/console.rb +52 -0
  118. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  119. data/test-unit/lib/test/unit/runner/tap.rb +8 -0
  120. data/test-unit/lib/test/unit/testcase.rb +483 -0
  121. data/test-unit/lib/test/unit/testresult.rb +121 -0
  122. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  123. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  124. data/test-unit/lib/test/unit/ui/console/testrunner.rb +430 -0
  125. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +63 -0
  126. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +82 -0
  127. data/test-unit/lib/test/unit/ui/testrunner.rb +53 -0
  128. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  129. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  130. data/test-unit/lib/test/unit/util/backtracefilter.rb +42 -0
  131. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  132. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  133. data/test-unit/lib/test/unit/util/output.rb +31 -0
  134. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  135. data/test-unit/lib/test/unit/version.rb +7 -0
  136. data/test-unit/sample/adder.rb +13 -0
  137. data/test-unit/sample/subtracter.rb +12 -0
  138. data/test-unit/sample/test_adder.rb +20 -0
  139. data/test-unit/sample/test_subtracter.rb +20 -0
  140. data/test-unit/sample/test_user.rb +23 -0
  141. data/test-unit/test/collector/test-descendant.rb +133 -0
  142. data/test-unit/test/collector/test-load.rb +442 -0
  143. data/test-unit/test/collector/test_dir.rb +406 -0
  144. data/test-unit/test/collector/test_objectspace.rb +100 -0
  145. data/test-unit/test/run-test.rb +15 -0
  146. data/test-unit/test/test-attribute.rb +86 -0
  147. data/test-unit/test/test-color-scheme.rb +69 -0
  148. data/test-unit/test/test-color.rb +47 -0
  149. data/test-unit/test/test-diff.rb +518 -0
  150. data/test-unit/test/test-emacs-runner.rb +60 -0
  151. data/test-unit/test/test-fixture.rb +287 -0
  152. data/test-unit/test/test-notification.rb +33 -0
  153. data/test-unit/test/test-omission.rb +81 -0
  154. data/test-unit/test/test-pending.rb +70 -0
  155. data/test-unit/test/test-priority.rb +119 -0
  156. data/test-unit/test/test-testcase.rb +544 -0
  157. data/test-unit/test/test_assertions.rb +1197 -0
  158. data/test-unit/test/test_error.rb +26 -0
  159. data/test-unit/test/test_failure.rb +33 -0
  160. data/test-unit/test/test_testresult.rb +113 -0
  161. data/test-unit/test/test_testsuite.rb +129 -0
  162. data/test-unit/test/testunit-test-util.rb +14 -0
  163. data/test-unit/test/ui/test_tap.rb +33 -0
  164. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  165. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  166. data/test-unit/test/util/test-output.rb +11 -0
  167. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  168. data/test-unit/test/util/test_observable.rb +102 -0
  169. data/test-unit/test/util/test_procwrapper.rb +36 -0
  170. data/test/run-test.rb +2 -6
  171. metadata +197 -100
  172. data/src/glib-enum-types.c +0 -1032
  173. data/src/glib-enum-types.h +0 -140
  174. data/src/lib/pkg-config.rb +0 -137
  175. data/src/rbgutil.c +0 -222
@@ -1,140 +0,0 @@
1
-
2
- /* Generated by glib-mkenums.rb ($Id$) */
3
-
4
- #ifndef __GLIB_ENUM_TYPES_H__
5
- #define __GLIB_ENUM_TYPES_H__
6
-
7
- #include <glib-object.h>
8
-
9
- G_BEGIN_DECLS
10
-
11
- /* enumerations from "/opt/local/include/glib-2.0/glib/gbookmarkfile.h" */
12
- GType g_bookmark_file_error_get_type (void);
13
- #define G_TYPE_BOOKMARK_FILE_ERROR (g_bookmark_file_error_get_type())
14
-
15
- /* enumerations from "/opt/local/include/glib-2.0/glib/gchecksum.h" */
16
- GType g_checksum_type_get_type (void);
17
- #define G_TYPE_CHECKSUM_TYPE (g_checksum_type_get_type())
18
-
19
- /* enumerations from "/opt/local/include/glib-2.0/glib/gconvert.h" */
20
- GType g_convert_error_get_type (void);
21
- #define G_TYPE_CONVERT_ERROR (g_convert_error_get_type())
22
-
23
- /* enumerations from "/opt/local/include/glib-2.0/glib/gdate.h" */
24
- GType g_date_dmy_get_type (void);
25
- #define G_TYPE_DATE_DMY (g_date_dmy_get_type())
26
- GType g_date_weekday_get_type (void);
27
- #define G_TYPE_DATE_WEEKDAY (g_date_weekday_get_type())
28
- GType g_date_month_get_type (void);
29
- #define G_TYPE_DATE_MONTH (g_date_month_get_type())
30
-
31
- /* enumerations from "/opt/local/include/glib-2.0/glib/gfileutils.h" */
32
- GType g_file_error_get_type (void);
33
- #define G_TYPE_FILE_ERROR (g_file_error_get_type())
34
- GType g_file_test_get_type (void);
35
- #define G_TYPE_FILE_TEST (g_file_test_get_type())
36
-
37
- /* enumerations from "/opt/local/include/glib-2.0/glib/ghook.h" */
38
- GType g_hook_flag_mask_get_type (void);
39
- #define G_TYPE_HOOK_FLAG_MASK (g_hook_flag_mask_get_type())
40
-
41
- /* enumerations from "/opt/local/include/glib-2.0/glib/gkeyfile.h" */
42
- GType g_key_file_error_get_type (void);
43
- #define G_TYPE_KEY_FILE_ERROR (g_key_file_error_get_type())
44
- GType g_key_file_flags_get_type (void);
45
- #define G_TYPE_KEY_FILE_FLAGS (g_key_file_flags_get_type())
46
-
47
- /* enumerations from "/opt/local/include/glib-2.0/glib/gmarkup.h" */
48
- GType g_markup_error_get_type (void);
49
- #define G_TYPE_MARKUP_ERROR (g_markup_error_get_type())
50
- GType g_markup_parse_flags_get_type (void);
51
- #define G_TYPE_MARKUP_PARSE_FLAGS (g_markup_parse_flags_get_type())
52
- GType g_markup_collect_type_get_type (void);
53
- #define G_TYPE_MARKUP_COLLECT_TYPE (g_markup_collect_type_get_type())
54
-
55
- /* enumerations from "/opt/local/include/glib-2.0/glib/gmessages.h" */
56
- GType g_log_level_flags_get_type (void);
57
- #define G_TYPE_LOG_LEVEL_FLAGS (g_log_level_flags_get_type())
58
-
59
- /* enumerations from "/opt/local/include/glib-2.0/glib/gnode.h" */
60
- GType g_traverse_flags_get_type (void);
61
- #define G_TYPE_TRAVERSE_FLAGS (g_traverse_flags_get_type())
62
- GType g_traverse_type_get_type (void);
63
- #define G_TYPE_TRAVERSE_TYPE (g_traverse_type_get_type())
64
-
65
- /* enumerations from "/opt/local/include/glib-2.0/glib/goption.h" */
66
- GType g_option_flags_get_type (void);
67
- #define G_TYPE_OPTION_FLAGS (g_option_flags_get_type())
68
- GType g_option_arg_get_type (void);
69
- #define G_TYPE_OPTION_ARG (g_option_arg_get_type())
70
- GType g_option_error_get_type (void);
71
- #define G_TYPE_OPTION_ERROR (g_option_error_get_type())
72
-
73
- /* enumerations from "/opt/local/include/glib-2.0/glib/gregex.h" */
74
- GType g_regex_error_get_type (void);
75
- #define G_TYPE_REGEX_ERROR (g_regex_error_get_type())
76
- GType g_regex_compile_flags_get_type (void);
77
- #define G_TYPE_REGEX_COMPILE_FLAGS (g_regex_compile_flags_get_type())
78
- GType g_regex_match_flags_get_type (void);
79
- #define G_TYPE_REGEX_MATCH_FLAGS (g_regex_match_flags_get_type())
80
-
81
- /* enumerations from "/opt/local/include/glib-2.0/glib/gshell.h" */
82
- GType g_shell_error_get_type (void);
83
- #define G_TYPE_SHELL_ERROR (g_shell_error_get_type())
84
-
85
- /* enumerations from "/opt/local/include/glib-2.0/glib/gslice.h" */
86
- GType g_slice_config_get_type (void);
87
- #define G_TYPE_SLICE_CONFIG (g_slice_config_get_type())
88
-
89
- /* enumerations from "/opt/local/include/glib-2.0/glib/gspawn.h" */
90
- GType g_spawn_error_get_type (void);
91
- #define G_TYPE_SPAWN_ERROR (g_spawn_error_get_type())
92
- GType g_spawn_flags_get_type (void);
93
- #define G_TYPE_SPAWN_FLAGS (g_spawn_flags_get_type())
94
-
95
- /* enumerations from "/opt/local/include/glib-2.0/glib/gstrfuncs.h" */
96
- GType g_ascii_type_get_type (void);
97
- #define G_TYPE_ASCII_TYPE (g_ascii_type_get_type())
98
-
99
- /* enumerations from "/opt/local/include/glib-2.0/glib/gtestutils.h" */
100
- GType g_test_trap_flags_get_type (void);
101
- #define G_TYPE_TEST_TRAP_FLAGS (g_test_trap_flags_get_type())
102
- GType g_test_log_type_get_type (void);
103
- #define G_TYPE_TEST_LOG_TYPE (g_test_log_type_get_type())
104
-
105
- /* enumerations from "/opt/local/include/glib-2.0/glib/gthread.h" */
106
- GType g_thread_error_get_type (void);
107
- #define G_TYPE_THREAD_ERROR (g_thread_error_get_type())
108
- GType g_thread_priority_get_type (void);
109
- #define G_TYPE_THREAD_PRIORITY (g_thread_priority_get_type())
110
- GType g_once_status_get_type (void);
111
- #define G_TYPE_ONCE_STATUS (g_once_status_get_type())
112
-
113
- /* enumerations from "/opt/local/include/glib-2.0/glib/gunicode.h" */
114
- GType g_unicode_type_get_type (void);
115
- #define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type())
116
- GType g_unicode_break_type_get_type (void);
117
- #define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type())
118
- GType g_unicode_script_get_type (void);
119
- #define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type())
120
- GType g_normalize_mode_get_type (void);
121
- #define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type())
122
-
123
- /* enumerations from "/opt/local/include/glib-2.0/glib/gutils.h" */
124
- GType g_user_directory_get_type (void);
125
- #define G_TYPE_USER_DIRECTORY (g_user_directory_get_type())
126
-
127
- /* enumerations from "/opt/local/include/glib-2.0/gobject/gsignal.h" */
128
- GType g_signal_flags_get_type (void);
129
- #define G_TYPE_SIGNAL_FLAGS (g_signal_flags_get_type())
130
- GType g_connect_flags_get_type (void);
131
- #define G_TYPE_CONNECT_FLAGS (g_connect_flags_get_type())
132
- GType g_signal_match_type_get_type (void);
133
- #define G_TYPE_SIGNAL_MATCH_TYPE (g_signal_match_type_get_type())
134
-
135
- G_END_DECLS
136
-
137
- #endif /* __GLIB_ENUM_TYPES_H__ */
138
-
139
- /* Generated data ends here */
140
-
@@ -1,137 +0,0 @@
1
- #
2
- # pkg-config.rb
3
- #
4
- # Wrapper of pkg-config tool.
5
- #
6
- # Copyright(C) 2003-2005 Ruby-GNOME2 Project.
7
- #
8
- # This file is part of Ruby/GLib2.
9
- #
10
- # Ruby/GLib2 is free software: you can redistribute it and/or modify
11
- # it under the terms of the GNU Lesser General Public License as published by
12
- # the Free Software Foundation, either version 2.1 of the License.
13
- #
14
- # Foobar is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Foobar. If not, see <http://www.gnu.org/licenses/>.
21
-
22
-
23
- require 'mkmf'
24
- require 'shellwords'
25
-
26
- module PKGConfig
27
- @@cmd = with_config('pkg-config', ENV["PKG_CONFIG"] || 'pkg-config')
28
- if /mswin32/ =~ RUBY_PLATFORM and /^cl\b/ =~ Config::CONFIG['CC']
29
- @@cmd += ' --msvc-syntax'
30
- end
31
-
32
- @@list = {}
33
- `#{@@cmd} --list-all`.chomp.split(/\n/).each{|v|
34
- pkg, name, desc = /(\S+?)\s+(.*?)\s-\s(.*)/.match(v).to_a[1..3]
35
- @@list[pkg] = [name, desc]
36
- }
37
-
38
- module_function
39
- def exist?(pkg)
40
- system("#{@@cmd} --exists #{pkg}")
41
- end
42
-
43
- def libs(pkg)
44
- `#{@@cmd} --libs #{pkg}`.chomp
45
- end
46
-
47
- def libs_only_L(pkg)
48
- `#{@@cmd} --libs-only-L #{pkg}`.chomp
49
- end
50
-
51
- def libs_only_l(pkg)
52
- `#{@@cmd} --libs-only-l #{pkg}`.chomp
53
- end
54
-
55
- def cflags(pkg)
56
- `#{@@cmd} --cflags #{pkg}`.chomp
57
- end
58
-
59
- def cflags_only_I(pkg)
60
- `#{@@cmd} --cflags-only-I #{pkg}`.chomp
61
- end
62
-
63
- def cflags_only_other(pkg)
64
- `#{@@cmd} --cflags-only-other #{pkg}`.chomp
65
- end
66
-
67
- def variable(pkg, var)
68
- `#{@@cmd} --variable=#{var} #{pkg}`.chomp
69
- end
70
-
71
- def modversion(pkg)
72
- `#{@@cmd} --modversion #{pkg}`.chomp
73
- end
74
-
75
- def version
76
- `#{@@cmd} --version`.chomp
77
- end
78
-
79
- def list_all
80
- # Returns [pkg, name, description]
81
- @@list.keys.collect{|key| [key] + @@list[key]}.sort
82
- end
83
-
84
- def name(pkg)
85
- @@list[pkg][0]
86
- end
87
-
88
- def description(pkg)
89
- @@list[pkg][1]
90
- end
91
-
92
- def provides(pkg)
93
- `#{@@cmd} --print-provides #{pkg}`.chomp
94
- end
95
-
96
- def requires(pkg)
97
- `#{@@cmd} --print-requires #{pkg}`.chomp.gsub("\n", ", ")
98
- end
99
-
100
- def check_version?(pkg, major = 0, minor = 0, micro = 0)
101
- return false unless exist?(pkg)
102
- ver = modversion(pkg).split(".").collect{|item| item.to_i}
103
- (0..2).each {|i| ver[i] = 0 unless ver[i]}
104
-
105
- (ver[0] > major ||
106
- (ver[0] == major && ver[1] > minor) ||
107
- (ver[0] == major && ver[1] == minor &&
108
- ver[2] >= micro))
109
- end
110
-
111
- def have_package(pkg, major = nil, minor = 0, micro = 0)
112
- if major.nil?
113
- STDOUT.print("checking for #{pkg}... ")
114
- else
115
- STDOUT.print("checking for #{pkg} version (>= #{major}.#{minor}.#{micro})... ")
116
- end
117
- major ||= 0
118
- STDOUT.flush
119
- if check_version?(pkg, major, minor, micro)
120
- STDOUT.print "yes\n"
121
- libraries = libs_only_l(pkg)
122
- dldflags = libs(pkg)
123
- dldflags = (Shellwords.shellwords(dldflags) - Shellwords.shellwords(libraries)).map{|s| /\s/ =~ s ? "\"#{s}\"" : s }.join(' ')
124
- $libs += ' ' + libraries
125
- if /mswin32/ =~ RUBY_PLATFORM
126
- $DLDFLAGS += ' ' + dldflags
127
- else
128
- $LDFLAGS += ' ' + dldflags
129
- end
130
- $CFLAGS += ' ' + cflags(pkg)
131
- true
132
- else
133
- STDOUT.print "no\n"
134
- false
135
- end
136
- end
137
- end
@@ -1,222 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbgutil.c -
5
-
6
- $Author: sakai $
7
- $Date: 2007/07/07 08:15:26 $
8
-
9
- Copyright (C) 2002-2004 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbgprivate.h"
13
-
14
- ID rbgutil_id_module_eval;
15
-
16
- static ID id_add_one_arg_setter;
17
- static ID id_set_property;
18
- static ID id_to_a;
19
- static ID id_allocate;
20
-
21
- void
22
- rbgutil_set_properties(self, hash)
23
- VALUE self, hash;
24
- {
25
- int i;
26
- VALUE ary;
27
- GObject* obj;
28
-
29
- Check_Type(hash, T_HASH);
30
- ary = rb_funcall(hash, id_to_a, 0);
31
- obj = RVAL2GOBJ(self);
32
-
33
- g_object_freeze_notify(obj);
34
- for (i = 0; i < RARRAY_LEN(ary); i++) {
35
- rb_funcall(self, id_set_property, 2,
36
- RARRAY_PTR(RARRAY_PTR(ary)[i])[0],
37
- RARRAY_PTR(RARRAY_PTR(ary)[i])[1]);
38
- }
39
- g_object_thaw_notify(obj);
40
- }
41
-
42
- VALUE
43
- rbgutil_glist2ary(list)
44
- GList *list;
45
- {
46
- VALUE ary = rb_ary_new();
47
- while (list) {
48
- rb_ary_push(ary, GOBJ2RVAL(list->data));
49
- list = list->next;
50
- }
51
- return ary;
52
- }
53
-
54
- VALUE
55
- rbgutil_glist2ary_and_free(list)
56
- GList *list;
57
- {
58
- VALUE ary = rb_ary_new();
59
- while (list) {
60
- rb_ary_push(ary, GOBJ2RVAL(list->data));
61
- list = list->next;
62
- }
63
- g_list_free(list);
64
- return ary;
65
- }
66
-
67
- VALUE
68
- rbgutil_glist2ary_boxed(list, gtype)
69
- GList *list;
70
- GType gtype;
71
- {
72
- VALUE ary = rb_ary_new();
73
- while (list) {
74
- rb_ary_push(ary, BOXED2RVAL(list->data, gtype));
75
- list = list->next;
76
- }
77
- return ary;
78
- }
79
-
80
- VALUE
81
- rbgutil_glist2ary_boxed_and_free(list, gtype)
82
- GList *list;
83
- GType gtype;
84
- {
85
- VALUE ary = rb_ary_new();
86
- while (list) {
87
- rb_ary_push(ary, BOXED2RVAL(list->data, gtype));
88
- list = list->next;
89
- }
90
- g_list_free(list);
91
- return ary;
92
- }
93
-
94
- VALUE
95
- rbgutil_glist2ary_string(GList *list)
96
- {
97
- VALUE array;
98
-
99
- array = rb_ary_new();
100
- while (list) {
101
- rb_ary_push(array, CSTR2RVAL(list->data));
102
- list = g_list_next(list);
103
- }
104
- return array;
105
- }
106
-
107
- VALUE
108
- rbgutil_glist2ary_string_and_free(GList *list)
109
- {
110
- VALUE array;
111
- GList *node;
112
-
113
- array = rb_ary_new();
114
- for (node = list; node; node = g_list_next(node)) {
115
- gchar *string = node->data;
116
-
117
- rb_ary_push(array, CSTR2RVAL(string));
118
- g_free(string);
119
- }
120
- g_list_free(list);
121
- return array;
122
- }
123
-
124
- VALUE
125
- rbgutil_gslist2ary(list)
126
- GSList *list;
127
- {
128
- VALUE ary = rb_ary_new();
129
- while (list) {
130
- rb_ary_push(ary, GOBJ2RVAL(list->data));
131
- list = list->next;
132
- }
133
- return ary;
134
- }
135
-
136
- VALUE
137
- rbgutil_gslist2ary_boxed(list, gtype)
138
- GSList *list;
139
- GType gtype;
140
- {
141
- VALUE ary = rb_ary_new();
142
- while (list) {
143
- rb_ary_push(ary, BOXED2RVAL(list->data, gtype));
144
- list = list->next;
145
- }
146
- return ary;
147
- }
148
-
149
- VALUE
150
- rbgutil_gslist2ary_and_free(GSList *list)
151
- {
152
- GSList *node;
153
- VALUE ary;
154
-
155
- ary = rb_ary_new();
156
- for (node = list; node; node = g_slist_next(node)) {
157
- rb_ary_push(ary, GOBJ2RVAL(node->data));
158
- }
159
- g_slist_free(list);
160
- return ary;
161
- }
162
-
163
- VALUE
164
- rbgutil_gslist2ary_boxed_and_free(GSList *list, GType gtype)
165
- {
166
- GSList *node;
167
- VALUE ary;
168
-
169
- ary = rb_ary_new();
170
- for (node = list; node; node = g_slist_next(node)) {
171
- rb_ary_push(ary, BOXED2RVAL(node->data, gtype));
172
- }
173
- g_slist_free(list);
174
- return ary;
175
- }
176
-
177
- VALUE
178
- rbgutil_def_setters(klass)
179
- VALUE klass;
180
- {
181
- return rb_funcall(mGLib, id_add_one_arg_setter, 1, klass);
182
- }
183
-
184
- VALUE
185
- rbgutil_sym_g2r_func(from)
186
- const GValue *from;
187
- {
188
- const gchar *str = g_value_get_string(from);
189
- return str ? ID2SYM(rb_intern(str)) : Qnil;
190
- }
191
-
192
- VALUE
193
- rbgutil_generic_s_gtype(VALUE klass)
194
- {
195
- return rbgobj_gtype_new(CLASS2GTYPE(klass));
196
- }
197
-
198
- VALUE
199
- rbgutil_generic_gtype(VALUE self)
200
- {
201
- return generic_s_gtype(CLASS_OF(self));
202
- }
203
-
204
- VALUE
205
- rbgutil_string_set_utf8_encoding(VALUE string)
206
- {
207
- #ifdef HAVE_RB_STR_ENCODE
208
- if (!NIL_P(string))
209
- rb_enc_associate(string, rb_utf8_encoding());
210
- #endif
211
- return string;
212
- }
213
-
214
- void
215
- Init_gutil()
216
- {
217
- rbgutil_id_module_eval = rb_intern("module_eval");
218
- id_set_property = rb_intern("set_property");
219
- id_to_a = rb_intern("to_a");
220
- id_add_one_arg_setter = rb_intern("__add_one_arg_setter");
221
- id_allocate = rb_intern("allocate");
222
- }