gtk3 3.0.9 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gtk3/rb-gtk3-private.h +1 -0
  3. data/ext/gtk3/rb-gtk3-spin-button.c +85 -0
  4. data/ext/gtk3/rb-gtk3.c +3 -0
  5. data/lib/gtk3/deprecated.rb +0 -8
  6. data/lib/gtk3/loader.rb +1 -7
  7. data/lib/gtk3/tree-model.rb +2 -0
  8. data/sample/gtk-demo/TODO +10 -10
  9. data/sample/gtk-demo/assistant.rb +44 -39
  10. data/sample/gtk-demo/builder.rb +71 -50
  11. data/sample/gtk-demo/button_box.rb +39 -28
  12. data/sample/gtk-demo/clipboard.rb +139 -46
  13. data/sample/gtk-demo/colorsel.rb +50 -36
  14. data/sample/gtk-demo/css_accordion.rb +18 -17
  15. data/sample/gtk-demo/css_basics.rb +60 -47
  16. data/sample/gtk-demo/css_multiplebgs.rb +92 -71
  17. data/sample/gtk-demo/css_pixbufs.rb +61 -48
  18. data/sample/gtk-demo/css_shadows.rb +63 -50
  19. data/sample/gtk-demo/cursors.rb +95 -64
  20. data/sample/gtk-demo/dialog.rb +95 -78
  21. data/sample/gtk-demo/drawingarea.rb +138 -171
  22. data/sample/gtk-demo/editable_cells.rb +169 -130
  23. data/sample/gtk-demo/entry_buffer.rb +15 -13
  24. data/sample/gtk-demo/entry_completion.rb +22 -17
  25. data/sample/gtk-demo/expander.rb +39 -31
  26. data/sample/gtk-demo/filtermodel.rb +67 -63
  27. data/sample/gtk-demo/font_features.rb +91 -60
  28. data/sample/gtk-demo/glarea.rb +277 -0
  29. data/sample/gtk-demo/headerbar.rb +17 -15
  30. data/sample/gtk-demo/hypertext.rb +146 -167
  31. data/sample/gtk-demo/iconview.rb +132 -91
  32. data/sample/gtk-demo/iconview_edit.rb +49 -38
  33. data/sample/gtk-demo/infobar.rb +81 -62
  34. data/sample/gtk-demo/links.rb +35 -30
  35. data/sample/gtk-demo/list_store.rb +169 -114
  36. data/sample/gtk-demo/listbox.rb +183 -0
  37. data/sample/gtk-demo/main.rb +32 -21
  38. data/sample/gtk-demo/markup.rb +65 -52
  39. data/sample/gtk-demo/menus.rb +57 -58
  40. data/sample/gtk-demo/modelbutton.rb +11 -9
  41. data/sample/gtk-demo/modelbutton.ui +3 -0
  42. data/sample/gtk-demo/overlay.rb +39 -32
  43. data/sample/gtk-demo/overlay2.rb +68 -54
  44. data/sample/gtk-demo/panes.rb +56 -68
  45. data/sample/gtk-demo/pickers.rb +46 -45
  46. data/sample/gtk-demo/pixbufs.rb +27 -25
  47. data/sample/gtk-demo/popover.rb +70 -63
  48. data/sample/gtk-demo/printing.rb +94 -69
  49. data/sample/gtk-demo/revealer.rb +46 -38
  50. data/sample/gtk-demo/rotated_text.rb +75 -54
  51. data/sample/gtk-demo/scale.rb +10 -8
  52. data/sample/gtk-demo/search_entry.rb +195 -0
  53. data/sample/gtk-demo/search_entry2.rb +71 -59
  54. data/sample/gtk-demo/sidebar.rb +20 -19
  55. data/sample/gtk-demo/sizegroup.rb +36 -35
  56. data/sample/gtk-demo/spinbutton.rb +128 -0
  57. data/sample/gtk-demo/spinner.rb +55 -40
  58. data/sample/gtk-demo/stack.rb +11 -8
  59. data/sample/gtk-demo/textmask.rb +14 -13
  60. data/sample/gtk-demo/textscroll.rb +16 -12
  61. data/sample/gtk-demo/theming_style_classes.rb +14 -12
  62. data/sample/gtk-demo/transparent.rb +17 -13
  63. data/sample/misc/treemodelfilter.rb +1 -1
  64. metadata +21 -16
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015 Ruby-GNOME2 Project Team
1
+ # Copyright (c) 2015-2016 Ruby-GNOME2 Project Team
2
2
  # This program is licenced under the same licence as Ruby-GNOME2.
3
3
  #
4
4
  =begin
@@ -6,57 +6,72 @@
6
6
 
7
7
  GtkSpinner allows to show that background activity is on-going.
8
8
  =end
9
- module SpinnerDemo
10
- def self.run_demo(main_window)
11
- window = Gtk::Dialog.new(:title => "Spinner",
12
- :parent => main_window,
13
- :flags => nil,
14
- :buttons => [[:close, :none]])
9
+ class SpinnerDemo
10
+ def initialize(main_window)
11
+ @window = Gtk::Dialog.new(:title => "Spinner",
12
+ :parent => main_window,
13
+ :flags => nil,
14
+ :buttons => [[:close, :none]])
15
15
 
16
- window.set_resizable(false)
17
- window.signal_connect("response") { window.destroy }
18
- window.signal_connect("destroy") { window.destroy }
16
+ @window.resizable = false
17
+ @window.signal_connect("response") { @window.destroy }
18
+ @window.signal_connect("destroy") { @window.destroy }
19
19
 
20
- content_area = window.content_area
21
-
22
- vbox = Gtk::Box.new(:vertical, 5)
23
- content_area.pack_start(vbox, :expand => true, :fill => true, :padding => 0)
24
- vbox.set_border_width(5)
25
-
26
- # Sensitive
27
- hbox = Gtk::Box.new(:horizontal, 5)
28
- spinner_sensitive = Gtk::Spinner.new
29
- hbox.add(spinner_sensitive)
30
- hbox.add(Gtk::Entry.new)
31
- vbox.add(hbox)
32
-
33
- # Disabled
34
- hbox = Gtk::Box.new(:horizontal, 5)
35
- spinner_insensitive = Gtk::Spinner.new
36
- hbox.add(spinner_insensitive)
37
- hbox.add(Gtk::Entry.new)
38
- vbox.add(hbox)
39
- hbox.set_sensitive(false)
20
+ initialize_vertical_box
21
+ initialize_sensitive_box
22
+ initialize_insensitive_box
40
23
 
41
24
  button = Gtk::Button.new(:stock_id => :media_play)
42
25
  button.signal_connect "clicked" do
43
- spinner_sensitive.start
44
- spinner_insensitive.start
26
+ @spinner_sensitive.start
27
+ @spinner_insensitive.start
45
28
  end
46
- vbox.add(button)
29
+ @vbox.add(button)
47
30
 
48
31
  button = Gtk::Button.new(:stock_id => :media_stop)
49
32
  button.signal_connect "clicked" do
50
- spinner_sensitive.stop
51
- spinner_insensitive.stop
33
+ @spinner_sensitive.stop
34
+ @spinner_insensitive.stop
52
35
  end
53
- vbox.add(button)
36
+ @vbox.add(button)
37
+ end
54
38
 
55
- if !window.visible?
56
- window.show_all
39
+ def run
40
+ if !@window.visible?
41
+ @window.show_all
57
42
  else
58
- window.destroy
43
+ @window.destroy
59
44
  end
60
- window
45
+ @window
46
+ end
47
+
48
+ private
49
+
50
+ def initialize_vertical_box
51
+ content_area = @window.content_area
52
+
53
+ @vbox = Gtk::Box.new(:vertical, 5)
54
+ content_area.pack_start(@vbox,
55
+ :expand => true, :fill => true, :padding => 0)
56
+ @vbox.border_width = 5
57
+ end
58
+
59
+ def initialize_sensitive_box
60
+ # Sensitive
61
+ hbox = Gtk::Box.new(:horizontal, 5)
62
+ @spinner_sensitive = Gtk::Spinner.new
63
+ hbox.add(@spinner_sensitive)
64
+ hbox.add(Gtk::Entry.new)
65
+ @vbox.add(hbox)
66
+ end
67
+
68
+ def initialize_insensitive_box
69
+ # Disabled
70
+ hbox = Gtk::Box.new(:horizontal, 5)
71
+ @spinner_insensitive = Gtk::Spinner.new
72
+ hbox.add(@spinner_insensitive)
73
+ hbox.add(Gtk::Entry.new)
74
+ hbox.sensitive = false
75
+ @vbox.add(hbox)
61
76
  end
62
77
  end
@@ -10,19 +10,22 @@ with nice transitions when the visible child changes.
10
10
  GtkStackSwitcher adds buttons to control which child is visible.
11
11
  =end
12
12
 
13
- module StackDemo
14
- def self.run_demo(main_window)
13
+ class StackDemo
14
+ def initialize(main_window)
15
15
  builder = Gtk::Builder.new(:resource => "/stack/stack.ui")
16
16
  builder.connect_signals {}
17
- window = builder["window1"]
18
- window.screen = main_window.screen
17
+ @window = builder["window1"]
18
+ @window.screen = main_window.screen
19
19
 
20
- window.signal_connect("destroy") { window.destroyed(window) }
20
+ @window.signal_connect("destroy") { window.destroyed(window) }
21
+ end
21
22
 
22
- if !window.visible?
23
- window.show_all
23
+ def run
24
+ if !@window.visible?
25
+ @window.show_all
24
26
  else
25
- window.destroy
27
+ @window.destroy
26
28
  end
29
+ @window
27
30
  end
28
31
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015 Ruby-GNOME2 Project Team
1
+ # Copyright (c) 2015-2016 Ruby-GNOME2 Project Team
2
2
  # This program is licenced under the same licence as Ruby-GNOME2.
3
3
  #
4
4
  =begin
@@ -7,16 +7,16 @@
7
7
  This demo shows how to use PangoCairo to draw text with more than
8
8
  just a single color.
9
9
  =end
10
- module TextmaskDemo
11
- def self.run_demo(_main_window)
12
- window = Gtk::Window.new(:toplevel)
13
- window.set_resizable(true)
14
- window.set_size_request(400, 200)
15
- window.set_title("Text Mask")
10
+ class TextmaskDemo
11
+ def initialize(_main_window)
12
+ @window = Gtk::Window.new(:toplevel)
13
+ @window.resizable = true
14
+ @window.set_size_request(400, 200)
15
+ @window.title = "Text Mask"
16
16
 
17
17
  da = Gtk::DrawingArea.new
18
18
 
19
- window.add(da)
19
+ @window.add(da)
20
20
 
21
21
  da.signal_connect "draw" do |_widget, cr|
22
22
  cr.save
@@ -49,13 +49,14 @@ module TextmaskDemo
49
49
  cr.restore
50
50
  true
51
51
  end
52
+ end
52
53
 
53
- if !window.visible?
54
- window.show_all
54
+ def run
55
+ if !@window.visible?
56
+ @window.show_all
55
57
  else
56
- window.destroy
58
+ @window.destroy
57
59
  end
58
-
59
- window
60
+ @window
60
61
  end
61
62
  end
@@ -8,29 +8,33 @@
8
8
  GtkTextMarks to keep a text view scrolled to the bottom
9
9
  while appending text.
10
10
  =end
11
- module TextscrollDemo
12
- def self.run_demo(main_window)
13
- window = Gtk::Window.new(:toplevel)
14
- window.screen = main_window.screen
11
+ class TextscrollDemo
12
+ def initialize(main_window)
13
+ @window = Gtk::Window.new(:toplevel)
14
+ @window.screen = main_window.screen
15
15
 
16
- window.set_default_size(600, 400)
16
+ @window.set_default_size(600, 400)
17
17
 
18
18
  hbox = Gtk::Box.new(:horizontal, 6)
19
19
  hbox.homogeneous = true
20
- window.add(hbox)
20
+ @window.add(hbox)
21
21
 
22
22
  create_text_view(hbox, true)
23
23
  create_text_view(hbox, false)
24
+ end
24
25
 
25
- if !window.visible?
26
- window.show_all
26
+ def run
27
+ if !@window.visible?
28
+ @window.show_all
27
29
  else
28
- window.destroy
30
+ @window.destroy
29
31
  end
30
- window
32
+ @window
31
33
  end
32
34
 
33
- def self.create_text_view(hbox, to_end)
35
+ private
36
+
37
+ def create_text_view(hbox, to_end)
34
38
  swindow = Gtk::ScrolledWindow.new
35
39
  hbox.pack_start(swindow, :fill => true, :expand => true, :padding => 0)
36
40
  textview = Gtk::TextView.new
@@ -39,7 +43,7 @@ module TextscrollDemo
39
43
  textview.signal_connect("destroy") { GLib::Source.remove(timeout) }
40
44
  end
41
45
 
42
- def self.setup_scroll(textview, to_end)
46
+ def setup_scroll(textview, to_end)
43
47
  buffer = textview.buffer
44
48
  end_iter = buffer.end_iter
45
49
  count = 0
@@ -30,24 +30,26 @@ of GTK+ are used for certain effects: primary toolbars,
30
30
  inline toolbars and linked buttons.
31
31
  =end
32
32
 
33
- module ThemingStyleClassesDemo
34
- def self.run_demo(main_window)
35
- window = Gtk::Window.new(:toplevel)
36
- window.screen = main_window.screen
37
- window.title = "Style Classes"
38
- window.resizable = false
39
- window.border_width = 12
33
+ class ThemingStyleClassesDemo
34
+ def initialize(main_window)
35
+ @window = Gtk::Window.new(:toplevel)
36
+ @window.screen = main_window.screen
37
+ @window.title = "Style Classes"
38
+ @window.resizable = false
39
+ @window.border_width = 12
40
40
 
41
41
  builder = Gtk::Builder.new(:resource => "/theming_style_classes/theming.ui")
42
42
  grid = builder["grid"]
43
43
  grid.show_all
44
- window.add(grid)
44
+ @window.add(grid)
45
+ end
45
46
 
46
- if !window.visible?
47
- window.show_all
47
+ def run
48
+ if !@window.visible?
49
+ @window.show_all
48
50
  else
49
- window.destroy
51
+ @window.destroy
50
52
  end
51
- window
53
+ @window
52
54
  end
53
55
  end
@@ -6,17 +6,17 @@
6
6
 
7
7
  Use transparent background on GdkWindows to create a shadow effect on a GtkOverlay widget.
8
8
  =end
9
- module TransparentDemo
9
+ class TransparentDemo
10
10
  SHADOW_OFFSET_X = 7
11
11
  SHADOW_OFFSET_Y = 7
12
12
  SHADOW_RADIUS = 5
13
13
 
14
- def self.run_demo(main_window)
15
- window = Gtk::Window.new(:toplevel)
16
- window.screen = main_window.screen
17
- window.set_default_size(450, 450)
18
- window.title = "Transparency"
19
- window.border_width = 0
14
+ def initialize(main_window)
15
+ @window = Gtk::Window.new(:toplevel)
16
+ @window.screen = main_window.screen
17
+ @window.set_default_size(450, 450)
18
+ @window.title = "Transparency"
19
+ @window.border_width = 0
20
20
 
21
21
  view = Gtk::TextView.new
22
22
  sw = Gtk::ScrolledWindow.new
@@ -25,7 +25,7 @@ module TransparentDemo
25
25
 
26
26
  overlay = Gtk::Overlay.new
27
27
  overlay.add(sw)
28
- window.add(overlay)
28
+ @window.add(overlay)
29
29
 
30
30
  entry = Gtk::Entry.new
31
31
  css = <<-CSS
@@ -51,16 +51,20 @@ module TransparentDemo
51
51
  entry.valign = :center
52
52
  entry.halign = :start
53
53
  overlay.show_all
54
+ end
54
55
 
55
- if !window.visible?
56
- window.show_all
56
+ def run
57
+ if !@window.visible?
58
+ @window.show_all
57
59
  else
58
- window.destroy
60
+ @window.destroy
59
61
  end
60
- window
62
+ @window
61
63
  end
62
64
 
63
- def self.draw_shadow_box(cr, rect, radius, transparency)
65
+ private
66
+
67
+ def draw_shadow_box(cr, rect, radius, transparency)
64
68
  x0 = rect[0]
65
69
  x1 = rect[0] + radius
66
70
  x2 = rect[0] + rect[2] - radius
@@ -17,7 +17,7 @@ column2 = Gtk::TreeViewColumn.new("data2",
17
17
  Gtk::CellRendererText.new,
18
18
  :text => 1)
19
19
 
20
- mf = Gtk::TreeModelFilter.new(:child_model => ls)
20
+ mf = ls.create_filter
21
21
 
22
22
  mf.set_visible_func do |_model, iter|
23
23
  /a/ =~ iter[0]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.9
4
+ version: 3.1.0
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: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glib2
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.9
19
+ version: 3.1.0
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: 3.0.9
26
+ version: 3.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gio2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.9
33
+ version: 3.1.0
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: 3.0.9
40
+ version: 3.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: atk
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.0.9
47
+ version: 3.1.0
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: 3.0.9
54
+ version: 3.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pango
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 3.0.9
61
+ version: 3.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 3.0.9
68
+ version: 3.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: gdk_pixbuf2
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 3.0.9
75
+ version: 3.1.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 3.0.9
82
+ version: 3.1.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: gdk3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 3.0.9
89
+ version: 3.1.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 3.0.9
96
+ version: 3.1.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: gobject-introspection
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 3.0.9
103
+ version: 3.1.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 3.0.9
110
+ version: 3.1.0
111
111
  description: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
112
112
  email: ruby-gnome2-devel-en@lists.sourceforge.net
113
113
  executables: []
@@ -121,6 +121,7 @@ files:
121
121
  - ext/gtk3/rb-gtk3-cell-layout.c
122
122
  - ext/gtk3/rb-gtk3-container.c
123
123
  - ext/gtk3/rb-gtk3-private.h
124
+ - ext/gtk3/rb-gtk3-spin-button.c
124
125
  - ext/gtk3/rb-gtk3-tree-model.c
125
126
  - ext/gtk3/rb-gtk3-tree-view.c
126
127
  - ext/gtk3/rb-gtk3-widget.c
@@ -293,6 +294,7 @@ files:
293
294
  - sample/gtk-demo/font_features.rb
294
295
  - sample/gtk-demo/glarea-fragment.glsl
295
296
  - sample/gtk-demo/glarea-vertex.glsl
297
+ - sample/gtk-demo/glarea.rb
296
298
  - sample/gtk-demo/gnome-applets.png
297
299
  - sample/gtk-demo/gnome-calendar.png
298
300
  - sample/gtk-demo/gnome-foot.png
@@ -316,6 +318,7 @@ files:
316
318
  - sample/gtk-demo/item_factory.rb
317
319
  - sample/gtk-demo/links.rb
318
320
  - sample/gtk-demo/list_store.rb
321
+ - sample/gtk-demo/listbox.rb
319
322
  - sample/gtk-demo/listbox.ui
320
323
  - sample/gtk-demo/main.rb
321
324
  - sample/gtk-demo/main.ui
@@ -357,6 +360,7 @@ files:
357
360
  - sample/gtk-demo/scale.rb
358
361
  - sample/gtk-demo/scale.ui
359
362
  - sample/gtk-demo/se_resize_cursor.png
363
+ - sample/gtk-demo/search_entry.rb
360
364
  - sample/gtk-demo/search_entry2.rb
361
365
  - sample/gtk-demo/shortcuts-boxes.ui
362
366
  - sample/gtk-demo/shortcuts-builder.ui
@@ -365,6 +369,7 @@ files:
365
369
  - sample/gtk-demo/shortcuts.ui
366
370
  - sample/gtk-demo/sidebar.rb
367
371
  - sample/gtk-demo/sizegroup.rb
372
+ - sample/gtk-demo/spinbutton.rb
368
373
  - sample/gtk-demo/spinbutton.ui
369
374
  - sample/gtk-demo/spinner.rb
370
375
  - sample/gtk-demo/stack.rb