glib2 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ package = GNOME2Package.new do |_package|
21
21
  :name => "glib",
22
22
  :download_site => :gnome,
23
23
  :label => "GLib",
24
- :version => "2.34.3",
24
+ :version => "2.36.0",
25
25
  :configure_args => [
26
26
  "LIBFFI_CFLAGS=-I#{libffi_include_dir}",
27
27
  "LIBFFI_LIBS=-L#{libffi_lib_dir} -lffi",
@@ -51,7 +51,7 @@ package = GNOME2Package.new do |_package|
51
51
  :name => "gnutls",
52
52
  :download_base_url => "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1",
53
53
  :label => "GnuTLS",
54
- :version => "3.1.5",
54
+ :version => "3.1.10",
55
55
  :configure_args => [
56
56
  "--with-libnettle-prefix=#{_package.win32.absolute_binary_dir}"
57
57
  ],
@@ -61,7 +61,7 @@ package = GNOME2Package.new do |_package|
61
61
  :name => "glib-networking",
62
62
  :download_site => :gnome,
63
63
  :label => "glib-networking",
64
- :version => "2.34.2",
64
+ :version => "2.36.0",
65
65
  :configure_args => [
66
66
  "--without-libproxy",
67
67
  "--without-gnome-proxy",
data/ext/glib2/rbglib.c CHANGED
@@ -1115,7 +1115,6 @@ union GDoubleIEEE754;
1115
1115
  Init_glib_io_channel_win32_socket();
1116
1116
  Init_glib_shell();
1117
1117
  Init_glib_shellerror();
1118
- Init_glib_completion();
1119
1118
  Init_glib_timer();
1120
1119
  Init_glib_unicode();
1121
1120
  Init_glib_utf8();
data/ext/glib2/rbglib.h CHANGED
@@ -35,7 +35,7 @@ extern "C" {
35
35
 
36
36
  #define RBGLIB_MAJOR_VERSION 1
37
37
  #define RBGLIB_MINOR_VERSION 2
38
- #define RBGLIB_MICRO_VERSION 5
38
+ #define RBGLIB_MICRO_VERSION 6
39
39
 
40
40
  #ifndef RSTRING_PTR
41
41
  # define RSTRING_PTR(s) (RSTRING(s)->ptr)
@@ -25,8 +25,6 @@
25
25
 
26
26
  #define RVAL2GCLOSURE(o) ((GClosure*)RVAL2BOXED(o, G_TYPE_CLOSURE))
27
27
  #define GCLOSURE2RVAL(o) (BOXED2RVAL(o, G_TYPE_CLOSURE))
28
- #define RVAL2GCOMPLETION(o) ((GCompletion*)RVAL2BOXED(o, G_TYPE_COMPLETION))
29
- #define GCOMPLETION2RVAL(o) (BOXED2RVAL(o, G_TYPE_COMPLETION))
30
28
  #define RVAL2GIOCHANNEL(o) ((GIOChannel*)RVAL2BOXED(o, G_TYPE_IO_CHANNEL))
31
29
  #define GIOCHANNEL2RVAL(o) (BOXED2RVAL(o, G_TYPE_IO_CHANNEL))
32
30
  #define RVAL2GKEYFILE(o) ((GKeyFile*)RVAL2BOXED(o, G_TYPE_KEY_FILE))
@@ -148,14 +148,15 @@ rg_remove_poll(VALUE self, VALUE fd)
148
148
  return self;
149
149
  }
150
150
 
151
+ #if GLIB_CHECK_VERSION(2, 28, 0)
151
152
  static VALUE
152
- rg_current_time(VALUE self)
153
+ rg_time(VALUE self)
153
154
  {
154
- GTimeVal timeval;
155
- g_source_get_current_time(_SELF(self), &timeval);
156
-
157
- return rb_assoc_new(LONG2NUM(timeval.tv_sec), LONG2NUM(timeval.tv_usec));
155
+ gint64 time;
156
+ time = g_source_get_time(_SELF(self));
157
+ return LL2NUM(time);
158
158
  }
159
+ #endif
159
160
 
160
161
  /* How can I implement them ?
161
162
  gboolean g_source_remove_by_funcs_user_data
@@ -189,7 +190,9 @@ Init_glib_source(void)
189
190
  RG_DEF_METHOD(set_callback, 0);
190
191
  RG_DEF_METHOD(add_poll, 1);
191
192
  RG_DEF_METHOD(remove_poll, 1);
192
- RG_DEF_METHOD(current_time, 0);
193
+ #if GLIB_CHECK_VERSION(2, 28, 0)
194
+ RG_DEF_METHOD(time, 0);
195
+ #endif
193
196
 
194
197
  /* GLib::Source.remove is moved to rbglib_maincontext.c */
195
198
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002-2006 Ruby-GNOME2 Project
5
5
  * Copyright (C) 2002,2003 Masahiro Sakai
6
6
  *
@@ -332,9 +332,11 @@ rg_invalidate(VALUE self)
332
332
  void
333
333
  Init_gobject_gclosure(void)
334
334
  {
335
+ VALUE RG_TARGET_NAMESPACE;
336
+
335
337
  init_rclosure();
336
338
 
337
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CLOSURE, "Closure", mGLib);
339
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CLOSURE, "Closure", mGLib);
338
340
 
339
341
  RG_DEF_METHOD(initialize, 0);
340
342
  RG_DEF_METHOD_P(in_marshal, 0);
@@ -141,7 +141,6 @@ G_GNUC_INTERNAL void Init_glib_io_channelerror(void);
141
141
  G_GNUC_INTERNAL void Init_glib_io_channel_win32_socket(void);
142
142
  G_GNUC_INTERNAL void Init_glib_shell(void);
143
143
  G_GNUC_INTERNAL void Init_glib_shellerror(void);
144
- G_GNUC_INTERNAL void Init_glib_completion(void);
145
144
  G_GNUC_INTERNAL void Init_glib_timer(void);
146
145
  G_GNUC_INTERNAL void Init_glib_unicode(void);
147
146
  G_GNUC_INTERNAL void Init_glib_utf8(void);
data/lib/glib-mkenums.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # C language enum description generation library like as glib-mkenums tool.
5
5
  #
6
- # Copyright(C) 2006-2008 Ruby-GNOME2 Project.
6
+ # Copyright(C) 2006-2013 Ruby-GNOME2 Project.
7
7
  #
8
8
  # This program is licenced under the same license of Ruby-GNOME2.
9
9
  #
@@ -29,8 +29,6 @@ module GLib
29
29
  end
30
30
 
31
31
  def parse_const_lines(const_lines)
32
- ret = ""
33
-
34
32
  if @options[:force_flags] or /<</ =~ const_lines
35
33
  @type = "flags"
36
34
  @Type = "Flags"
@@ -202,6 +202,7 @@ class GNOME2Package
202
202
  attr_accessor :packages, :dependencies, :build_packages, :build_dependencies
203
203
  attr_accessor :build_host
204
204
  attr_accessor :relative_binary_dir, :absolute_binary_dir
205
+ attr_accessor :support_concurrent_build
205
206
  def initialize(package)
206
207
  @package = package
207
208
  @packages = []
@@ -211,6 +212,7 @@ class GNOME2Package
211
212
  @build_host = "i686-w64-mingw32"
212
213
  @relative_binary_dir = File.join("vendor", "local")
213
214
  @absolute_binary_dir = File.expand_path(@relative_binary_dir)
215
+ @support_concurrent_build = true
214
216
  end
215
217
 
216
218
  def to_hash
@@ -221,6 +223,7 @@ class GNOME2Package
221
223
  :build_host => @build_host,
222
224
  :relative_binary_dir => @relative_binary_dir,
223
225
  :absolute_binary_dir => @absolute_binary_dir,
226
+ :support_concurrent_build => @support_concurrent_build,
224
227
  }
225
228
  end
226
229
  end
@@ -119,8 +119,10 @@ class GNOME2Win32BinaryBuildTask
119
119
  common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas"
120
120
  build_make_args = common_make_args.dup
121
121
  install_make_args = common_make_args.dup
122
- make_n_jobs = ENV["MAKE_N_JOBS"]
123
- build_make_args << "-j#{make_n_jobs}" if make_n_jobs
122
+ if package[:support_concurrent_build]
123
+ make_n_jobs = ENV["MAKE_N_JOBS"]
124
+ build_make_args << "-j#{make_n_jobs}" if make_n_jobs
125
+ end
124
126
  ENV["GREP_OPTIONS"] = "--text"
125
127
  sh("nice", "make", *build_make_args) or exit(false)
126
128
  sh("make", "install", *install_make_args) or exit(false)
@@ -0,0 +1,29 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2013 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
18
+
19
+ class TestGLibSource < Test::Unit::TestCase
20
+ include GLibTestUtils
21
+
22
+ def test_time
23
+ context = GLib::MainContext.default
24
+ source = GLib::Idle.source_new
25
+ source.attach(context)
26
+ time = source.time
27
+ assert_operator(0, :<, time)
28
+ end
29
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
12
+ date: 2013-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pkg-config
@@ -68,7 +68,6 @@ files:
68
68
  - ext/glib2/rbglib.h
69
69
  - ext/glib2/rbglib2conversions.h
70
70
  - ext/glib2/rbglib_bookmarkfile.c
71
- - ext/glib2/rbglib_completion.c
72
71
  - ext/glib2/rbglib_convert.c
73
72
  - ext/glib2/rbglib_error.c
74
73
  - ext/glib2/rbglib_fileutils.c
@@ -129,7 +128,6 @@ files:
129
128
  - ext/glib2/rbgutildeprecated.c
130
129
  - ext/glib2/rbgutildeprecated.h
131
130
  - sample/bookmarkfile.rb
132
- - sample/completion.rb
133
131
  - sample/idle.rb
134
132
  - sample/iochannel.rb
135
133
  - sample/keyfile.rb
@@ -153,6 +151,7 @@ files:
153
151
  - test/test_mkenums.rb
154
152
  - test/test_poll_fd.rb
155
153
  - test/test_signal.rb
154
+ - test/test_source.rb
156
155
  - test/test_spawn.rb
157
156
  - test/test_timeout.rb
158
157
  - test/test_unicode.rb
@@ -1,195 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2005,2006 Masao Mutoh
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
- */
21
-
22
- #include "rbgprivate.h"
23
-
24
- static ID id_compfunc;
25
- static ID id_call;
26
- static ID id_to_s;
27
- static ID id_clear;
28
- static ID id_items_internal;
29
-
30
- /*****************************************/
31
- static GCompletion*
32
- completion_copy(GCompletion *comp)
33
- {
34
- GCompletion* new_comp;
35
- g_return_val_if_fail (comp != NULL, NULL);
36
-
37
- new_comp = g_new(GCompletion, 1);
38
- *new_comp = *comp;
39
- return new_comp;
40
- }
41
-
42
- static GType
43
- g_completion_get_type(void)
44
- {
45
- static GType our_type = 0;
46
- if (our_type == 0)
47
- our_type = g_boxed_type_register_static ("GCompletion",
48
- (GBoxedCopyFunc)completion_copy,
49
- (GBoxedFreeFunc)g_completion_free);
50
- return our_type;
51
- }
52
- /*****************************************/
53
-
54
- #define G_TYPE_COMPLETION (g_completion_get_type())
55
-
56
- #define RG_TARGET_NAMESPACE cCompletion
57
- #define _SELF(s) ((GCompletion*)RVAL2BOXED(s, G_TYPE_COMPLETION))
58
-
59
- /* data should be [self, data] */
60
- static gchar *
61
- comp_func(gpointer compdata)
62
- {
63
- VALUE ret;
64
- VALUE self = RARRAY_PTR((VALUE)compdata)[0];
65
- VALUE data = RARRAY_PTR((VALUE)compdata)[1];
66
-
67
- VALUE func = rb_ivar_get(self, id_compfunc);
68
-
69
- if (NIL_P(func)){
70
- ret = rb_funcall(data, id_to_s, 0);
71
- } else {
72
- ret = rb_funcall(func, id_call, 1, data);
73
- }
74
- return (gchar *)RVAL2CSTR(ret);
75
- }
76
-
77
- static VALUE
78
- rg_initialize(VALUE self)
79
- {
80
- VALUE block = Qnil;
81
-
82
- if (rb_block_given_p()) {
83
- block = rb_block_proc();
84
- }
85
-
86
- rb_ivar_set(self, id_compfunc, block);
87
- /* This is used for memory management(GC) */
88
- rb_ivar_set(self, id_items_internal, rb_hash_new());
89
-
90
- G_INITIALIZE(self, g_completion_new((GCompletionFunc)comp_func));
91
-
92
- return Qnil;
93
- }
94
-
95
- static VALUE
96
- rg_add_items(VALUE self, VALUE items)
97
- {
98
- gint i, len;
99
- GList* list = (GList*)NULL;
100
- VALUE items_internal = rb_ivar_get(self, id_items_internal);
101
-
102
- items = rb_ary_to_ary(items);
103
- len = RARRAY_LEN(items);
104
- for (i = 0; i < len; i ++){
105
- VALUE data = RARRAY_PTR(items)[i];
106
- VALUE item = rb_assoc_new(self, data);
107
- list = g_list_append(list, (gpointer)item);
108
- rb_hash_aset(items_internal, data, item);
109
- }
110
- g_completion_add_items(_SELF(self), list);
111
-
112
- return self;
113
- }
114
-
115
- static VALUE
116
- rg_remove_items(VALUE self, VALUE items)
117
- {
118
- gint i, len;
119
- GList* list = (GList*)NULL;
120
- VALUE items_internal = rb_ivar_get(self, id_items_internal);
121
-
122
- items = rb_ary_to_ary(items);
123
- len = RARRAY_LEN(items);
124
- for (i = 0; i < len; i ++){
125
- VALUE data = RARRAY_PTR(items)[i];
126
- VALUE item = rb_hash_aref(items_internal, data);
127
- list = g_list_append(list, (gpointer)item);
128
- rb_hash_delete(items_internal, data);
129
- }
130
- g_completion_remove_items(_SELF(self), list);
131
-
132
- return self;
133
- }
134
-
135
- static VALUE
136
- rg_clear_items(VALUE self)
137
- {
138
- VALUE items_internal = rb_ivar_get(self, id_items_internal);
139
- rb_funcall(items_internal, id_clear, 0);
140
- g_completion_clear_items(_SELF(self));
141
- return self;
142
- }
143
-
144
- static VALUE
145
- rg_items(VALUE self)
146
- {
147
- return rb_ivar_get(self, id_items_internal);
148
- }
149
-
150
- static VALUE
151
- rg_complete(VALUE self, VALUE prefix)
152
- {
153
- gchar* new_prefix;
154
- VALUE ary = rb_ary_new();
155
- #if GLIB_CHECK_VERSION(2,4,0)
156
- GList* list = g_completion_complete_utf8(_SELF(self),
157
- (const gchar*)RVAL2CSTR(prefix),
158
- &new_prefix);
159
- #else
160
- GList* list = g_completion_complete(_SELF(self),
161
- RVAL2CSTR(prefix),
162
- &new_prefix);
163
- #endif
164
- while (list) {
165
- rb_ary_push(ary, RARRAY_PTR((VALUE)list->data)[1]);
166
- list = list->next;
167
- }
168
-
169
- return rb_assoc_new(ary, new_prefix ? CSTR2RVAL(new_prefix) : Qnil);
170
- }
171
-
172
- /* We don't use this.
173
- void g_completion_set_compare (GCompletion *cmp,
174
- GCompletionStrncmpFunc strncmp_func);
175
- */
176
-
177
- void
178
- Init_glib_completion(void)
179
- {
180
- VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_COMPLETION, "Completion", mGLib);
181
-
182
- id_call = rb_intern("call");
183
- id_to_s = rb_intern("to_s");
184
- id_clear = rb_intern("clear");
185
- id_compfunc = rb_intern("completion_proc");
186
- id_items_internal = rb_intern("items_internal");
187
-
188
- RG_DEF_METHOD(initialize, 0);
189
- RG_DEF_METHOD(add_items, 1);
190
- RG_DEF_METHOD(remove_items, 1);
191
- RG_DEF_METHOD(clear_items, 0);
192
- RG_DEF_METHOD(complete, 1);
193
-
194
- RG_DEF_METHOD(items, 0);
195
- }
data/sample/completion.rb DELETED
@@ -1,45 +0,0 @@
1
- =begin
2
- completion.rb - Sample for GLib::Completion
3
-
4
- Copyright (C) 2005 Ruby-GNOME2 Project Team
5
- This program is licenced under the same licence as Ruby-GNOME2.
6
-
7
- $Id: completion.rb,v 1.1 2005/10/14 19:10:07 mutoh Exp $
8
- =end
9
-
10
- require 'glib2'
11
-
12
- ###########################
13
- # Simple String completion
14
- ###########################
15
- ary = ["a_", "a_ab", "aac", "aabc", "aabcd"]
16
- comp = GLib::Completion.new
17
- comp.add_items(ary)
18
- p comp.complete("a_")
19
- p comp.complete("aab")
20
-
21
- puts "-----------"
22
-
23
-
24
- ############################
25
- # Class completion and UTF-8
26
- ############################
27
- class Test
28
- def initialize(str)
29
- @str = str
30
- end
31
- def value
32
- @str
33
- end
34
- end
35
-
36
- ary2 = [Test.new("あ_"), Test.new("あ_あい"),
37
- Test.new("ああab"), Test.new("ああabc"), Test.new("ああbcd")]
38
-
39
- comp2 = GLib::Completion.new {|data|
40
- data.value
41
- }
42
-
43
- comp2.add_items(ary2)
44
- puts %Q$["#{comp2.complete("あ_").join(', "')}"]$
45
- puts %Q$["#{comp2.complete("ああa").join(', "')}"]$