gtk2 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8766d633f9cf8ae10270d80c39614435d47731e8
4
- data.tar.gz: 85951de288b05a4fddaea6bad2b7661d3e576a2b
3
+ metadata.gz: 1bbad66db4dc62467dffc4b796ecc313c4a8d67e
4
+ data.tar.gz: 7eaebb9d25f79263729263ca4790f8a0eba435f6
5
5
  SHA512:
6
- metadata.gz: a27385913d6caff16a69ad965126fcdff8e327ab3543a104abea1451653986cf1a1c0856b2b5fe42d65c39c184e82ad630426847464d6c0a425cea87eb9a5923
7
- data.tar.gz: 57e13eedfa987015b4a18ee9db104e585da58b7b4aea1e1976044e75450c02591eaa5daa6cc54ca309f85d059cd6101d50882acb934a31e764707d4d6a678e61
6
+ metadata.gz: 2314f7bad7851a9f647e687e8419f195ff6e0a8724383e82a467d9e783e0304b4cb9182c6eb69f311ae3285c2ec1b32f1e515c483b2d2e89fc9ce99987bbaeda
7
+ data.tar.gz: 54e8d50f59d5d19fc8c63abcc78a3b1572a3d4c671015c5f63fb0051c91eb85a895f9f816256078e030baa15be37d12e36a2ecb7575efb38e0a087480bb35890
@@ -245,12 +245,12 @@ rg_m_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
245
245
  ret = rb_ary_new();
246
246
 
247
247
  if(rtype != GDK_SELECTION_TYPE_ATOM){
248
- for(j = 0; j < (rlen/sizeof(unsigned long)); j++){
249
- rb_ary_push(ret, INT2FIX(((unsigned long*)rdat)[j]));
248
+ for(j = 0; j < (rlen/sizeof(glong)); j++){
249
+ rb_ary_push(ret, INT2FIX(((glong*)rdat)[j]));
250
250
  }
251
251
  } else {
252
- for(j = 0; j < (rlen/sizeof(unsigned long)); j++){
253
- rb_ary_push(ret, BOXED2RVAL((GdkAtom)((unsigned long*)rdat)[j], GDK_TYPE_ATOM));
252
+ for(j = 0; j < (rlen/sizeof(glong)); j++){
253
+ rb_ary_push(ret, BOXED2RVAL((GdkAtom)((glong*)rdat)[j], GDK_TYPE_ATOM));
254
254
  }
255
255
  }
256
256
  break;
@@ -208,10 +208,27 @@ gtk_init()
208
208
  gtk_exit()
209
209
  */
210
210
 
211
+ static gboolean
212
+ quit_loop(G_GNUC_UNUSED gpointer user_data)
213
+ {
214
+ gtk_main_quit();
215
+ return G_SOURCE_REMOVE;
216
+ }
217
+
211
218
  static VALUE
212
219
  rg_m_main(G_GNUC_UNUSED VALUE self)
213
220
  {
221
+ GSource *interrupt_source;
222
+
223
+ interrupt_source = rbg_interrupt_source_new();
224
+ g_source_set_callback(interrupt_source, quit_loop, NULL, NULL);
225
+ g_source_attach(interrupt_source, NULL);
214
226
  gtk_main();
227
+ g_source_destroy(interrupt_source);
228
+ g_source_unref(interrupt_source);
229
+
230
+ rb_thread_check_ints();
231
+
215
232
  return Qnil;
216
233
  }
217
234
 
@@ -1,7 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
- * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2002-2014 Ruby-GNOME2 Project Team
5
4
  * Copyright (C) 1998-2000 Yukihiro Matsumoto,
6
5
  * Daisuke Kanda,
7
6
  * Hiroshi Igarashi
@@ -126,15 +125,35 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
126
125
  return Qnil;
127
126
  }
128
127
 
128
+ static gboolean
129
+ destroy_dialog(gpointer user_data)
130
+ {
131
+ GtkWidget *dialog = user_data;
132
+ gtk_widget_destroy(dialog);
133
+ return G_SOURCE_REMOVE;
134
+ }
135
+
129
136
  static VALUE
130
137
  rg_run(VALUE self)
131
138
  {
132
- if (rb_block_given_p()){
133
- VALUE ret = INT2NUM(gtk_dialog_run(_SELF(self)));
134
- rb_yield(ret);
135
- return ret;
139
+ GtkDialog *dialog;
140
+ GSource *interrupt_source;
141
+ VALUE response;
142
+
143
+ dialog = _SELF(self);
144
+ interrupt_source = rbg_interrupt_source_new();
145
+ g_source_set_callback(interrupt_source, destroy_dialog, dialog, NULL);
146
+ g_source_attach(interrupt_source, NULL);
147
+ response = INT2NUM(gtk_dialog_run(dialog));
148
+ g_source_destroy(interrupt_source);
149
+ g_source_unref(interrupt_source);
150
+
151
+ rb_thread_check_ints();
152
+
153
+ if (rb_block_given_p()) {
154
+ return rb_yield(response);
136
155
  } else {
137
- return INT2NUM(gtk_dialog_run(_SELF(self)));
156
+ return response;
138
157
  }
139
158
  }
140
159
 
@@ -36,20 +36,19 @@ rbgtk_atom2selectiondata(VALUE type, VALUE size, VALUE src, GdkAtom *gtype,
36
36
  GdkAtom ntype = RVAL2ATOM(type);
37
37
 
38
38
  if(ntype == GDK_SELECTION_TYPE_INTEGER){
39
- int *i;
40
- i = ALLOC(int);
39
+ glong *i;
40
+ i = ALLOC(glong);
41
41
  *i = NUM2INT(src);
42
42
  dat = i;
43
- fmt = sizeof(int) * 8;
43
+ fmt = 32;
44
44
  len = 1;
45
45
  } else if(ntype == GDK_SELECTION_TYPE_STRING) {
46
46
  dat = (void *)RVAL2CSTR(src);
47
+ fmt = 8;
47
48
  if (NIL_P(size)) {
48
- fmt = sizeof(char) * 8;
49
49
  len = RSTRING_LEN(src);
50
50
  } else {
51
51
  len = NUM2UINT(size);
52
- fmt = (RSTRING_LEN(src) / len) * 8;
53
52
  }
54
53
  } else if(ntype == compound_text){
55
54
  guchar* str = (guchar*)dat;
@@ -0,0 +1,34 @@
1
+ # Copyright (C) 2014 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestGdkPixbuf < Test::Unit::TestCase
18
+ def test_from_drawable
19
+ colormap = nil
20
+ gdk_window = Gdk::Window.default_root_window
21
+ src_x = 0
22
+ src_y = 0
23
+ width, height = gdk_window.size
24
+
25
+ assert_nothing_raised do
26
+ Gdk::Pixbuf.from_drawable(colormap,
27
+ gdk_window,
28
+ src_x,
29
+ src_y,
30
+ width,
31
+ height)
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-09 00:00:00.000000000 Z
11
+ date: 2014-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atk
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.0
19
+ version: 2.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.0
26
+ version: 2.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pango
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.0
33
+ version: 2.2.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.2.0
40
+ version: 2.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gdk_pixbuf2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.0
47
+ version: 2.2.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.0
54
+ version: 2.2.1
55
55
  description: Ruby/GTK2 is a Ruby binding of GTK+-2.x.
56
56
  email: ruby-gnome2-devel-en@lists.sourceforge.net
57
57
  executables: []
@@ -61,9 +61,6 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - README
63
63
  - Rakefile
64
- - extconf.rb
65
- - lib/gtk2.rb
66
- - lib/gtk2/base.rb
67
64
  - ext/gtk2/depend
68
65
  - ext/gtk2/extconf.rb
69
66
  - ext/gtk2/global.h
@@ -315,6 +312,9 @@ files:
315
312
  - ext/gtk2/rbgtkwidget.c
316
313
  - ext/gtk2/rbgtkwindow.c
317
314
  - ext/gtk2/rbgtkwindowgroup.c
315
+ - extconf.rb
316
+ - lib/gtk2.rb
317
+ - lib/gtk2/base.rb
318
318
  - sample/gtk-demo/README
319
319
  - sample/gtk-demo/alphatest.png
320
320
  - sample/gtk-demo/apple-red.png
@@ -509,6 +509,7 @@ files:
509
509
  - test/test_gdk_geometry.rb
510
510
  - test/test_gdk_keymap.rb
511
511
  - test/test_gdk_pango.rb
512
+ - test/test_gdk_pixbuf.rb
512
513
  - test/test_gdk_rectangle.rb
513
514
  - test/test_gdk_selection_data.rb
514
515
  - test/test_gdk_window.rb
@@ -542,17 +543,17 @@ require_paths:
542
543
  - lib
543
544
  required_ruby_version: !ruby/object:Gem::Requirement
544
545
  requirements:
545
- - - '>='
546
+ - - ">="
546
547
  - !ruby/object:Gem::Version
547
548
  version: 1.9.3
548
549
  required_rubygems_version: !ruby/object:Gem::Requirement
549
550
  requirements:
550
- - - '>='
551
+ - - ">="
551
552
  - !ruby/object:Gem::Version
552
553
  version: '0'
553
554
  requirements: []
554
555
  rubyforge_project:
555
- rubygems_version: 2.0.14
556
+ rubygems_version: 2.2.2
556
557
  signing_key:
557
558
  specification_version: 4
558
559
  summary: Ruby/GTK2 is a Ruby binding of GTK+-2.x.