atk 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,14 +56,14 @@ atk_text_rectangle_get_type(void)
56
56
  static VALUE
57
57
  rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
58
58
  {
59
- AtkTextRectangle new;
59
+ AtkTextRectangle rectangle;
60
60
 
61
- new.x = NUM2INT(x);
62
- new.y = NUM2INT(y);
63
- new.width = NUM2INT(width);
64
- new.height = NUM2INT(height);
61
+ rectangle.x = NUM2INT(x);
62
+ rectangle.y = NUM2INT(y);
63
+ rectangle.width = NUM2INT(width);
64
+ rectangle.height = NUM2INT(height);
65
65
 
66
- G_INITIALIZE(self, &new);
66
+ G_INITIALIZE(self, g_boxed_copy(ATK_TYPE_TEXT_RECTANGLE, &rectangle));
67
67
  return Qnil;
68
68
  }
69
69
 
@@ -0,0 +1,21 @@
1
+ # Copyright (C) 2013 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
+ require "test-unit"
18
+ require "test/unit/notify"
19
+
20
+ module AtkTestUtils
21
+ end
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
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
+ ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
20
+ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
21
+
22
+ glib_base = File.join(ruby_gnome2_base, "glib2")
23
+ atk_base = File.join(ruby_gnome2_base, "atk")
24
+
25
+ modules = [
26
+ [glib_base, "glib2"],
27
+ [atk_base, "atk"]
28
+ ]
29
+ modules.each do |target, module_name|
30
+ if system("which make > /dev/null")
31
+ `make -C #{target.dump} > /dev/null` or exit(false)
32
+ end
33
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
34
+ $LOAD_PATH.unshift(File.join(target, "lib"))
35
+ end
36
+
37
+ $LOAD_PATH.unshift(File.join(glib_base, "test"))
38
+ require "glib-test-init"
39
+
40
+ $LOAD_PATH.unshift(File.join(atk_base, "test"))
41
+ require "atk-test-utils"
42
+
43
+ require "atk"
44
+
45
+ exit Test::Unit::AutoRunner.run(true)
@@ -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 TestAtkRectangle < Test::Unit::TestCase
20
+ include AtkTestUtils
21
+
22
+ def test_width
23
+ rectangle = Atk::TextRectangle.new(0, 10, 20, 30)
24
+ assert_equal(20, rectangle.width)
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atk
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: glib2
@@ -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
  description: Ruby/ATK is a Ruby binding of ATK-1.0.x.
31
31
  email: ruby-gnome2-devel-en@lists.sourceforge.net
32
32
  executables: []
@@ -74,6 +74,9 @@ files:
74
74
  - ext/atk/rbatktextrectangle.c
75
75
  - ext/atk/rbatkutil.c
76
76
  - ext/atk/rbatkvalue.c
77
+ - test/atk-test-utils.rb
78
+ - test/run-test.rb
79
+ - test/test-text-rectangle.rb
77
80
  homepage: http://ruby-gnome2.sourceforge.jp/
78
81
  licenses: []
79
82
  post_install_message: