gtk2 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,7 @@ static VALUE
75
75
  rg_initialize(VALUE self, VALUE num)
76
76
  {
77
77
  guint atom = FIX2INT(num);
78
- if (atom == 0){
78
+ if (atom == 0) {
79
79
  /* This is a trick for passing 0(NULL) */
80
80
  G_INITIALIZE(self, GUINT_TO_POINTER(1));
81
81
  _SELF(self) = GUINT_TO_POINTER(GDK_NONE);
@@ -32,13 +32,14 @@ VALUE RG_TARGET_NAMESPACE = Qnil;
32
32
  static VALUE
33
33
  rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue)
34
34
  {
35
- GdkColor c;
36
- c.pixel = 0;
37
- c.red = NUM2INT(red);
38
- c.green = NUM2INT(green);
39
- c.blue = NUM2INT(blue);
35
+ GdkColor color;
36
+
37
+ color.pixel = 0;
38
+ color.red = NUM2INT(red);
39
+ color.green = NUM2INT(green);
40
+ color.blue = NUM2INT(blue);
40
41
 
41
- G_INITIALIZE(self, &c);
42
+ G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_COLOR, &color));
42
43
 
43
44
  return Qnil;
44
45
  }
@@ -53,8 +53,9 @@ gdk_geometry_get_type(void)
53
53
  static VALUE
54
54
  rg_initialize(VALUE self)
55
55
  {
56
- GdkGeometry g;
57
- G_INITIALIZE(self, &g);
56
+ GdkGeometry geometry;
57
+ memset(&geometry, 0, sizeof(GdkGeometry));
58
+ G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_GEOMETRY, &geometry));
58
59
  return Qnil;
59
60
  }
60
61
 
@@ -30,14 +30,14 @@
30
30
  static VALUE
31
31
  rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
32
32
  {
33
- GdkRectangle new;
33
+ GdkRectangle rectangle;
34
34
 
35
- new.x = NUM2INT(x);
36
- new.y = NUM2INT(y);
37
- new.width = NUM2INT(width);
38
- new.height = NUM2INT(height);
35
+ rectangle.x = NUM2INT(x);
36
+ rectangle.y = NUM2INT(y);
37
+ rectangle.width = NUM2INT(width);
38
+ rectangle.height = NUM2INT(height);
39
39
 
40
- G_INITIALIZE(self, &new);
40
+ G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_RECTANGLE, &rectangle));
41
41
  return Qnil;
42
42
  }
43
43
 
@@ -51,12 +51,12 @@ static VALUE
51
51
  rg_initialize(VALUE self, VALUE width, VALUE height, VALUE wclass,
52
52
  VALUE window_type)
53
53
  {
54
- GdkWindowAttr w;
55
- w.width = NUM2INT(width);
56
- w.height = NUM2INT(height);
57
- w.wclass = RVAL2GENUM(wclass, GDK_TYPE_WINDOW_CLASS);
58
- w.window_type = RVAL2GENUM(window_type, GDK_TYPE_WINDOW_TYPE);
59
- G_INITIALIZE(self, &w);
54
+ GdkWindowAttr attribute;
55
+ attribute.width = NUM2INT(width);
56
+ attribute.height = NUM2INT(height);
57
+ attribute.wclass = RVAL2GENUM(wclass, GDK_TYPE_WINDOW_CLASS);
58
+ attribute.window_type = RVAL2GENUM(window_type, GDK_TYPE_WINDOW_TYPE);
59
+ G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_WINDOW_ATTR, &attribute));
60
60
  return Qnil;
61
61
  }
62
62
 
@@ -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,2003 OGASAWARA, Takeshi
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -57,7 +57,8 @@ static VALUE
57
57
  rg_initialize(VALUE self)
58
58
  {
59
59
  GtkAccelGroupEntry key;
60
- G_INITIALIZE(self, &key);
60
+ memset(&key, 0, sizeof(GtkAccelGroupEntry));
61
+ G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ACCEL_GROUP_ENTRY, &key));
61
62
  return Qnil;
62
63
  }
63
64
 
@@ -59,7 +59,8 @@ static VALUE
59
59
  rg_initialize(VALUE self)
60
60
  {
61
61
  GtkAccelKey key;
62
- G_INITIALIZE(self, &key);
62
+ memset(&key, 0, sizeof(GtkAccelKey));
63
+ G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ACCEL_KEY, &key));
63
64
  return Qnil;
64
65
  }
65
66
 
@@ -47,14 +47,14 @@ gtk_allocation_get_type(void)
47
47
  static VALUE
48
48
  rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
49
49
  {
50
- GtkAllocation new;
50
+ GtkAllocation allocation;
51
51
 
52
- new.x = NUM2INT(x);
53
- new.y = NUM2INT(y);
54
- new.width = NUM2INT(width);
55
- new.height = NUM2INT(height);
52
+ allocation.x = NUM2INT(x);
53
+ allocation.y = NUM2INT(y);
54
+ allocation.width = NUM2INT(width);
55
+ allocation.height = NUM2INT(height);
56
56
 
57
- G_INITIALIZE(self, &new);
57
+ G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ALLOCATION, &allocation));
58
58
  return Qnil;
59
59
  }
60
60
 
@@ -58,7 +58,7 @@ rg_initialize(VALUE self, VALUE left, VALUE right, VALUE top, VALUE bottom)
58
58
  border.top = NUM2INT(top);
59
59
  border.bottom = NUM2INT(bottom);
60
60
 
61
- G_INITIALIZE(self, &border);
61
+ G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_BORDER, &border));
62
62
  return Qnil;
63
63
  }
64
64
 
@@ -60,9 +60,10 @@ gtk_recent_data_get_type(void)
60
60
 
61
61
  static VALUE
62
62
  rg_initialize(VALUE self)
63
- {
63
+ {
64
64
  GtkRecentData data;
65
- G_INITIALIZE(self, &data);
65
+ memset(&data, 0, sizeof(GtkRecentData));
66
+ G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_RECENT_DATA, &data));
66
67
  return Qnil;
67
68
  }
68
69
 
@@ -37,7 +37,7 @@ rf_copy(const GtkRecentFilterInfo* info)
37
37
  static void
38
38
  rf_free(GtkRecentFilterInfo* boxed)
39
39
  {
40
- if (boxed){
40
+ if (boxed) {
41
41
  g_free(boxed->applications);
42
42
  g_free(boxed->groups);
43
43
  g_free(boxed);
@@ -61,9 +61,10 @@ gtk_recent_filter_info_get_type(void)
61
61
 
62
62
  static VALUE
63
63
  rg_initialize(VALUE self)
64
- {
64
+ {
65
65
  GtkRecentFilterInfo finfo;
66
- G_INITIALIZE(self, &finfo);
66
+ memset(&finfo, 0, sizeof(GtkRecentFilterInfo));
67
+ G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_RECENT_FILTER_INFO, &finfo));
67
68
  return Qnil;
68
69
  }
69
70
 
@@ -0,0 +1,24 @@
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 TestGdkGeometry < Test::Unit::TestCase
20
+ def test_min_width
21
+ geometry = Gdk::Geometry.new
22
+ assert_equal(0, geometry.min_width)
23
+ end
24
+ end
@@ -0,0 +1,24 @@
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 TestGdkRectangle < Test::Unit::TestCase
20
+ def test_width
21
+ rectangle = Gdk::Rectangle.new(0, 10, 20, 30)
22
+ assert_equal(20, rectangle.width)
23
+ end
24
+ end
@@ -0,0 +1,24 @@
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 TestGtkAccelGroupEntry < Test::Unit::TestCase
20
+ def test_accel_path
21
+ entry = Gtk::AccelGroupEntry.new
22
+ assert_nil(entry.accel_path)
23
+ end
24
+ end
@@ -0,0 +1,24 @@
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 TestGtkAccelKey < Test::Unit::TestCase
20
+ def test_flags
21
+ key = Gtk::AccelKey.new
22
+ assert_equal(0, key.flags)
23
+ end
24
+ end
@@ -0,0 +1,24 @@
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 TestGtkAllocation < Test::Unit::TestCase
20
+ def test_width
21
+ allocation = Gtk::Allocation.new(0, 10, 20, 30)
22
+ assert_equal(20, allocation.width)
23
+ end
24
+ end
@@ -0,0 +1,24 @@
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 TestGtkBorder < Test::Unit::TestCase
20
+ def test_left
21
+ border = Gtk::Border.new(10, 15, 20, 25)
22
+ assert_equal(10, border.left)
23
+ end
24
+ end
@@ -0,0 +1,24 @@
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 TestGtkRecentData < Test::Unit::TestCase
20
+ def test_mime_type
21
+ data = Gtk::RecentData.new
22
+ assert_nil(data.mime_type)
23
+ end
24
+ end
@@ -0,0 +1,26 @@
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 TestGtkRecentFilterInfo < Test::Unit::TestCase
20
+ include GtkTestUtils
21
+
22
+ def test_contains
23
+ info = Gtk::RecentFilterInfo.new
24
+ assert_equal(Gtk::RecentFilter::Flags.new, info.contains)
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
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-24 00:00:00.000000000 Z
12
+ date: 2013-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: atk
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2.4
21
+ version: 1.2.5
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2.4
29
+ version: 1.2.5
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: pango
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: 1.2.4
37
+ version: 1.2.5
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: 1.2.4
45
+ version: 1.2.5
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: gdk_pixbuf2
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 1.2.4
53
+ version: 1.2.5
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2.4
61
+ version: 1.2.5
62
62
  description: Ruby/GTK2 is a Ruby binding of GTK+-2.x.
63
63
  email: ruby-gnome2-devel-en@lists.sourceforge.net
64
64
  executables: []
@@ -513,12 +513,18 @@ files:
513
513
  - test/test_gdk_display.rb
514
514
  - test/test_gdk_event.rb
515
515
  - test/test_gdk_gc.rb
516
+ - test/test_gdk_geometry.rb
516
517
  - test/test_gdk_keymap.rb
517
518
  - test/test_gdk_pango.rb
519
+ - test/test_gdk_rectangle.rb
518
520
  - test/test_gdk_selection_data.rb
519
521
  - test/test_gdk_window.rb
520
522
  - test/test_gdk_window_attribute.rb
521
523
  - test/test_gtk_about_dialog.rb
524
+ - test/test_gtk_accel_group_entry.rb
525
+ - test/test_gtk_accel_key.rb
526
+ - test/test_gtk_allocation.rb
527
+ - test/test_gtk_border.rb
522
528
  - test/test_gtk_buildable.rb
523
529
  - test/test_gtk_builder.rb
524
530
  - test/test_gtk_entry.rb
@@ -527,6 +533,8 @@ files:
527
533
  - test/test_gtk_list_store.rb
528
534
  - test/test_gtk_menu_item.rb
529
535
  - test/test_gtk_rc_style.rb
536
+ - test/test_gtk_recent_data.rb
537
+ - test/test_gtk_recent_filter_info.rb
530
538
  - test/test_gtk_tree_path.rb
531
539
  - test/test_gtk_unix_print.rb
532
540
  - test/test_gtk_widget.rb