gtk3 2.1.0-x86-mingw32 → 2.2.0-x86-mingw32
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.
- checksums.yaml +4 -4
- data/ext/gtk3/extconf.rb +1 -1
- data/ext/gtk3/rbgtk-about-dialog.c +0 -6
- data/ext/gtk3/rbgtk-accessible.c +0 -16
- data/ext/gtk3/rbgtk-entry.c +4 -18
- data/ext/gtk3/rbgtk-header-bar.c +58 -0
- data/ext/gtk3/rbgtk-icon-view.c +30 -5
- data/ext/gtk3/rbgtk-level-bar.c +88 -0
- data/ext/gtk3/rbgtk-link-button.c +0 -6
- data/ext/gtk3/rbgtk-menu-button.c +41 -0
- data/ext/gtk3/rbgtk-revealer.c +42 -0
- data/ext/gtk3/rbgtk-search-bar.c +59 -0
- data/ext/gtk3/rbgtk-search-entry.c +42 -0
- data/ext/gtk3/rbgtk-stack.c +106 -0
- data/ext/gtk3/rbgtk-tree-selection.c +7 -22
- data/ext/gtk3/rbgtk.c +24 -3
- data/ext/gtk3/rbgtk3conversions.h +25 -2
- data/ext/gtk3/rbgtk3private.h +23 -3
- data/lib/1.9/gtk3.so +0 -0
- data/lib/2.0/gtk3.so +0 -0
- data/lib/2.1/gtk3.so +0 -0
- data/sample/gtk-demo/appwindow.rb +95 -95
- data/sample/gtk-demo/cairo-operator.rb +8 -8
- data/sample/gtk-demo/drawingarea.rb +74 -99
- data/sample/gtk-demo/pixbufs.rb +48 -57
- data/sample/misc/alpha-demo.rb +1 -1
- data/sample/misc/assistant.rb +45 -51
- data/sample/misc/cairo-pong.rb +26 -24
- data/sample/misc/composited-windows.rb +2 -2
- data/sample/misc/dnd.rb +23 -23
- data/sample/misc/drag-move.rb +19 -11
- data/sample/misc/drawing.rb +1 -1
- data/sample/misc/mouse-gesture.rb +3 -3
- data/sample/misc/pangorenderer.rb +1 -1
- data/sample/misc/properties.rb +1 -0
- data/sample/misc/to_drawable.rb +1 -1
- data/sample/misc/tooltips.rb +1 -1
- data/test/test_gtk_accessible.rb +31 -0
- data/test/test_gtk_entry.rb +36 -0
- data/test/test_gtk_header_bar.rb +66 -0
- data/test/test_gtk_icon_view.rb +41 -0
- data/test/test_gtk_level_bar.rb +82 -0
- data/test/test_gtk_list_store.rb +2 -1
- data/test/test_gtk_menu_button.rb +49 -0
- data/test/test_gtk_revealer.rb +57 -0
- data/test/test_gtk_search_bar.rb +55 -0
- data/test/test_gtk_search_entry.rb +34 -0
- data/test/test_gtk_stack.rb +115 -0
- data/test/test_gtk_tree_selection.rb +31 -0
- metadata +31 -14
@@ -0,0 +1,82 @@
|
|
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 TestGtkLevelBar < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
only_gtk_version(3, 6, 0)
|
22
|
+
end
|
23
|
+
|
24
|
+
class TestConstructor < self
|
25
|
+
def test_no_arguments
|
26
|
+
level_bar = Gtk::LevelBar.new
|
27
|
+
assert_equal([
|
28
|
+
0.0,
|
29
|
+
1.0,
|
30
|
+
],
|
31
|
+
[
|
32
|
+
level_bar.min_value,
|
33
|
+
level_bar.max_value,
|
34
|
+
])
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_min_max_value
|
38
|
+
min_value = 1.0
|
39
|
+
max_value = 20.0
|
40
|
+
level_bar = Gtk::LevelBar.new(min_value, max_value)
|
41
|
+
assert_equal([
|
42
|
+
min_value,
|
43
|
+
max_value,
|
44
|
+
],
|
45
|
+
[
|
46
|
+
level_bar.min_value,
|
47
|
+
level_bar.max_value,
|
48
|
+
])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class TestAccessor < self
|
53
|
+
def setup
|
54
|
+
super
|
55
|
+
@level_bar = Gtk::LevelBar.new
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_min_value
|
59
|
+
@level_bar.min_value = 1.0
|
60
|
+
assert_equal(1.0, @level_bar.min_value)
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_max_value
|
64
|
+
@level_bar.max_value = 20.0
|
65
|
+
assert_equal(20.0, @level_bar.max_value)
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_value
|
69
|
+
@level_bar.value = 1.0
|
70
|
+
assert_equal(1.0, @level_bar.value)
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_offset_value
|
74
|
+
@level_bar.add_offset_value(Gtk::LevelBar::OFFSET_LOW, 0.10)
|
75
|
+
assert_equal(0.10, @level_bar.get_offset_value(Gtk::LevelBar::OFFSET_LOW))
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_get_nonexistent_offset_value
|
79
|
+
assert_nil(@level_bar.get_offset_value("nonexistent"))
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/test/test_gtk_list_store.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -77,6 +77,7 @@ class TestGtkListStore < Test::Unit::TestCase
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_iter_gc
|
80
|
+
GC.start
|
80
81
|
n_iterators = count_objects(Gtk::TreeIter)
|
81
82
|
50.times do |i|
|
82
83
|
iter = @store.append
|
@@ -0,0 +1,49 @@
|
|
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 TestGtkMenuButton < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
only_gtk_version(3, 6, 0)
|
22
|
+
@menu_button = Gtk::MenuButton.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_popup
|
26
|
+
assert_nil(@menu_button.popup)
|
27
|
+
popup = Gtk::Menu.new
|
28
|
+
@menu_button.popup = popup
|
29
|
+
assert_equal(popup, @menu_button.popup)
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_menu_model
|
33
|
+
assert_nil(@menu_button.menu_model)
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_direction
|
37
|
+
assert_equal(Gtk::Arrow::Type::DOWN, @menu_button.direction)
|
38
|
+
@menu_button.direction = :up
|
39
|
+
assert_equal(Gtk::Arrow::Type::UP, @menu_button.direction)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_align_widget
|
43
|
+
assert_nil(@menu_button.align_widget)
|
44
|
+
align_widget = Gtk::Box.new(:horizontal)
|
45
|
+
align_widget.add(@menu_button)
|
46
|
+
@menu_button.align_widget = align_widget
|
47
|
+
assert_equal(align_widget, @menu_button.align_widget)
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,57 @@
|
|
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 TestGtkRevealer < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
only_gtk_version(3, 10, 0)
|
22
|
+
@revealer = Gtk::Revealer.new
|
23
|
+
end
|
24
|
+
|
25
|
+
class RevealChild < self
|
26
|
+
def setup
|
27
|
+
super
|
28
|
+
@revealer.reveal_child = true
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_reveal_child
|
32
|
+
assert_true(@revealer.reveal_child?)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_child_revealed
|
36
|
+
assert_true(@revealer.child_revealed?)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_transition_duration_accessors
|
41
|
+
duration = 500
|
42
|
+
@revealer.transition_duration = duration
|
43
|
+
assert_equal(duration, @revealer.transition_duration)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_transition_type_accessors
|
47
|
+
revealer_transition_type = Gtk::Revealer::TransitionType::SLIDE_UP
|
48
|
+
@revealer.transition_type = revealer_transition_type
|
49
|
+
assert_equal(revealer_transition_type, @revealer.transition_type)
|
50
|
+
end
|
51
|
+
|
52
|
+
class TestEnum < self
|
53
|
+
def test_transition_type
|
54
|
+
assert_const_defined(Gtk::Revealer::TransitionType, :CROSSFADE)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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 TestGtkSearchBar < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
only_gtk_version(3, 10, 0)
|
22
|
+
@search_bar = Gtk::SearchBar.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_connect_entry
|
26
|
+
entry = Gtk::SearchEntry.new
|
27
|
+
assert_equal(@search_bar, @search_bar.connect_entry(entry))
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_search_mode_enabled_accessors
|
31
|
+
entry = Gtk::SearchEntry.new
|
32
|
+
@search_bar.connect_entry(entry)
|
33
|
+
@search_bar.search_mode_enabled = true
|
34
|
+
assert_true(@search_bar.search_mode_enabled?)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_show_close_button_accessors
|
38
|
+
@search_bar.show_close_button = true
|
39
|
+
assert_true(@search_bar.show_close_button?)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_handle_event
|
43
|
+
window = Gtk::Window.new
|
44
|
+
key_press_event = Gdk::EventKey.new(:key_press)
|
45
|
+
key_press_event.keyval = Gdk::Keyval::GDK_KEY_a
|
46
|
+
entry = Gtk::SearchEntry.new
|
47
|
+
@search_bar.add(entry)
|
48
|
+
@search_bar.connect_entry(entry)
|
49
|
+
window.add(@search_bar)
|
50
|
+
window.show_all
|
51
|
+
key_press_event.window = window.window
|
52
|
+
assert_equal(Gdk::Event::STOP,
|
53
|
+
@search_bar.handle_event?(key_press_event))
|
54
|
+
end
|
55
|
+
end
|
@@ -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 TestGtkSearchEntry < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
only_gtk_version(3, 6, 0)
|
22
|
+
@search_entry = Gtk::SearchEntry.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_search_changed_signal
|
26
|
+
only_gtk_version(3, 10, 0)
|
27
|
+
called = false
|
28
|
+
@search_entry.signal_connect("search-changed") do
|
29
|
+
called = true
|
30
|
+
end
|
31
|
+
@search_entry.signal_emit("search-changed")
|
32
|
+
assert_true(called)
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,115 @@
|
|
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 TestGtkStack < Test::Unit::TestCase
|
18
|
+
include GtkTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
only_gtk_version(3, 10, 0)
|
22
|
+
@stack = Gtk::Stack.new
|
23
|
+
end
|
24
|
+
|
25
|
+
class TestAdd < self
|
26
|
+
def setup
|
27
|
+
super
|
28
|
+
@child = Gtk::EventBox.new
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_return_value
|
32
|
+
assert_equal(@stack, @stack.add(@child))
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_added
|
36
|
+
@stack.add(@child)
|
37
|
+
assert_equal([@child], @stack.children)
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_name
|
41
|
+
widget_name = "set widget name"
|
42
|
+
@stack.add(@child, widget_name)
|
43
|
+
assert_equal(widget_name,
|
44
|
+
@stack.child_get_property(@child, "name"))
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_name_add_title
|
48
|
+
widget_name = "set widget name"
|
49
|
+
widget_title = "set widget title"
|
50
|
+
@stack.add(@child, widget_name, widget_title)
|
51
|
+
assert_equal([
|
52
|
+
widget_name,
|
53
|
+
widget_title,
|
54
|
+
],
|
55
|
+
[
|
56
|
+
@stack.child_get_property(@child, "name"),
|
57
|
+
@stack.child_get_property(@child, "title"),
|
58
|
+
])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_homogeneous_accessors
|
63
|
+
@stack.homogeneous = false
|
64
|
+
assert_false(@stack.homogeneous?)
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_transition_duration_accessors
|
68
|
+
duration = 500
|
69
|
+
@stack.transition_duration = duration
|
70
|
+
assert_equal(duration, @stack.transition_duration)
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_transition_type_accessors
|
74
|
+
stack_transition_type = Gtk::Stack::TransitionType::SLIDE_UP
|
75
|
+
@stack.transition_type = stack_transition_type
|
76
|
+
assert_equal(stack_transition_type, @stack.transition_type)
|
77
|
+
end
|
78
|
+
|
79
|
+
class TestVisibleChild < self
|
80
|
+
def setup
|
81
|
+
super
|
82
|
+
@visible_widget = Gtk::EventBox.new
|
83
|
+
@visible_widget.show
|
84
|
+
@visible_widget_name = "visible widget"
|
85
|
+
@stack.add(@visible_widget, @visible_widget_name)
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_assign
|
89
|
+
assert_not_respond_to(@stack, :visible_child=)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_widget
|
93
|
+
@stack.set_visible_child(@visible_widget)
|
94
|
+
assert_equal(@visible_widget, @stack.visible_child)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_name
|
98
|
+
@stack.set_visible_child(@visible_widget_name)
|
99
|
+
assert_equal(@visible_widget_name,
|
100
|
+
@stack.visible_child_name)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_name_and_transition_type
|
104
|
+
@stack.set_visible_child(@visible_widget_name, :crossfade)
|
105
|
+
assert_equal(@visible_widget_name,
|
106
|
+
@stack.visible_child_name)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
class TestEnum < self
|
111
|
+
def test_transition_type
|
112
|
+
assert_const_defined(Gtk::Stack::TransitionType, :CROSSFADE)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014 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 TestGtkTreeSelection < Test::Unit::TestCase
|
20
|
+
include GtkTestUtils
|
21
|
+
|
22
|
+
def setup
|
23
|
+
@tree = Gtk::TreeView.new
|
24
|
+
@selection = @tree.selection
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_mode_accessors
|
28
|
+
@selection.mode = Gtk::SelectionMode::MULTIPLE
|
29
|
+
assert_equal(Gtk::SelectionMode::MULTIPLE, @selection.mode)
|
30
|
+
end
|
31
|
+
end
|