gtk4 3.5.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/gtk4.gemspec +1 -5
  3. data/lib/gtk4/{menu-item.rb → application.rb} +11 -10
  4. data/lib/gtk4/box.rb +1 -1
  5. data/lib/gtk4/builder.rb +14 -61
  6. data/lib/gtk4/button.rb +1 -2
  7. data/lib/gtk4/combo-box.rb +1 -6
  8. data/lib/gtk4/deprecated.rb +234 -246
  9. data/lib/gtk4/dialog.rb +10 -21
  10. data/lib/gtk4/{action.rb → entry.rb} +11 -8
  11. data/lib/gtk4/{gdk-drag-context.rb → gdk-display.rb} +12 -10
  12. data/lib/gtk4/icon-theme.rb +9 -12
  13. data/lib/gtk4/image.rb +12 -56
  14. data/lib/gtk4/list-store.rb +8 -0
  15. data/lib/gtk4/loader.rb +153 -27
  16. data/lib/gtk4/message-dialog.rb +1 -1
  17. data/lib/gtk4/paned.rb +17 -11
  18. data/lib/gtk4/{clipboard.rb → response-type.rb} +11 -6
  19. data/lib/gtk4/ruby-builder-scope.rb +47 -0
  20. data/lib/gtk4/scale-button.rb +6 -13
  21. data/lib/gtk4/stack.rb +23 -27
  22. data/lib/gtk4/style-context.rb +20 -4
  23. data/lib/gtk4/text-buffer.rb +14 -10
  24. data/lib/gtk4/{style-properties.rb → tree-model-sort.rb} +7 -9
  25. data/lib/gtk4/tree-model.rb +21 -1
  26. data/lib/gtk4/{target-list.rb → tree-sortable.rb} +8 -11
  27. data/lib/gtk4/tree-view-column.rb +9 -1
  28. data/lib/gtk4/version.rb +2 -2
  29. data/lib/gtk4/widget.rb +44 -71
  30. data/lib/gtk4.rb +4 -35
  31. data/sample/demos/README.md +4 -0
  32. data/sample/examples/README.md +4 -0
  33. data/sample/{action-namespace.rb → examples/action-namespace.rb} +0 -0
  34. data/sample/{builder.rb → examples/builder.rb} +0 -0
  35. data/sample/{builder.ui → examples/builder.ui} +0 -0
  36. data/sample/{drawing.rb → examples/drawing.rb} +0 -0
  37. data/sample/{grid_packing.rb → examples/grid_packing.rb} +0 -0
  38. data/sample/{hello_world.rb → examples/hello_world.rb} +0 -0
  39. data/sample/{utils.rb → examples/utils.rb} +0 -0
  40. data/sample/getting-started/README.md +4 -0
  41. metadata +26 -92
  42. data/lib/gtk4/action-group.rb +0 -131
  43. data/lib/gtk4/calendar.rb +0 -30
  44. data/lib/gtk4/check-menu-item.rb +0 -34
  45. data/lib/gtk4/container.rb +0 -62
  46. data/lib/gtk4/icon-size.rb +0 -32
  47. data/lib/gtk4/image-menu-item.rb +0 -37
  48. data/lib/gtk4/radio-action.rb +0 -28
  49. data/lib/gtk4/radio-button.rb +0 -49
  50. data/lib/gtk4/recent-chooser-dialog.rb +0 -38
  51. data/lib/gtk4/selection-data.rb +0 -42
  52. data/lib/gtk4/stock-item.rb +0 -36
  53. data/lib/gtk4/stock.rb +0 -70
  54. data/lib/gtk4/table.rb +0 -43
  55. data/lib/gtk4/target-entry.rb +0 -27
  56. data/lib/gtk4/toggle-action.rb +0 -27
  57. data/lib/gtk4/tool-button.rb +0 -36
  58. data/lib/gtk4/ui-manager.rb +0 -35
  59. data/lib/gtk4/window.rb +0 -42
  60. data/test/fixture/gnome-logo-icon.png +0 -0
  61. data/test/gtk-test-utils.rb +0 -36
  62. data/test/run-test.rb +0 -42
  63. data/test/test-gtk-box.rb +0 -36
  64. data/test/test-gtk-button.rb +0 -46
  65. data/test/test-gtk-dialog.rb +0 -74
  66. data/test/test-gtk-menu-item.rb +0 -42
  67. data/test/test-gtk-message-dialog.rb +0 -62
  68. data/test/test-gtk-version.rb +0 -47
  69. data/test/test-gtk-window.rb +0 -34
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2a8598c03d71cd53ce61b8273ea3cb86f02514591dc8eea8721de1f659ddac6
4
- data.tar.gz: 8992b13dbacce51fafced675f1ec1ed809a93d3a3fd9fe90c1ae7c7a8f911260
3
+ metadata.gz: de023553f78e80f657467bf0a4180750463785a135f79cf9276bc10b00b91027
4
+ data.tar.gz: b6a6e7a6ec94fb6027f049043513f8e101b348430ea1ef4dd405fc20abc10c88
5
5
  SHA512:
6
- metadata.gz: 01fcbd2f2dfbd316b6961c5fa30df7164b48989f83319f1931987a06e51b96fc308c46d6b5080bd034d40c35d4915518d897f0ba250a457d8cb93d4b6a1fdfef
7
- data.tar.gz: 792b5f2f82f6aa02d03c4fd79e9bc962beac20f3fe550249fbd9068774e102d51c5b1f6e2d984dad6ace3b3edb7cfa221a0930b299f21859341278447595b277
6
+ metadata.gz: 30e0eea79cd1177703457ab30f33fbf8dd68ec5e447104ebbd0cd12ef7db5e81d981180823841705e86a6dccecd8b1a5b53bbe923dc1117d06799571134bcbca
7
+ data.tar.gz: 0515cb09dc45ef50a2f5b0cdbeccc9d82bd64b943a5f2b907bb0d1fa951091040f94788e02d81a214f252e87567493d9a4ca7c4198597a421527f0481e129a25
data/gtk4.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2018 Ruby-GNOME Project Team
3
+ # Copyright (C) 2018-2022 Ruby-GNOME Project Team
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -36,11 +36,7 @@ Gem::Specification.new do |s|
36
36
  ]
37
37
  s.files += Dir.glob("lib/**/*.rb")
38
38
  s.files += Dir.glob("sample/**/*")
39
- s.files += Dir.glob("test/**/*")
40
39
 
41
- s.add_runtime_dependency("gio2", "= #{s.version}")
42
40
  s.add_runtime_dependency("atk", "= #{s.version}")
43
- s.add_runtime_dependency("pango", "= #{s.version}")
44
- s.add_runtime_dependency("gdk_pixbuf2", "= #{s.version}")
45
41
  s.add_runtime_dependency("gdk4", "= #{s.version}")
46
42
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2018 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
@@ -15,19 +15,20 @@
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
  module Gtk
18
- class MenuItem
18
+ class Application
19
19
  alias_method :initialize_raw, :initialize
20
- def initialize(options={})
21
- label = options[:label]
22
-
23
- if label
24
- if options[:use_underline]
25
- initialize_new_with_mnemonic(label)
20
+ def initialize(*args)
21
+ case args.size
22
+ when 0
23
+ initialize_raw(nil, :flags_none)
24
+ when 1
25
+ if args[0].is_a?(String)
26
+ initialize_raw(args[0], :flags_none)
26
27
  else
27
- initialize_new_with_label(label)
28
+ initialize_raw(nil, args[0])
28
29
  end
29
30
  else
30
- initialize_raw
31
+ initialize_raw(*args)
31
32
  end
32
33
  end
33
34
  end
data/lib/gtk4/box.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2014-2018 Ruby-GNOME 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
data/lib/gtk4/builder.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015-2016 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2015-2022 Ruby-GNOME 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
@@ -14,68 +14,28 @@
14
14
  # License along with this library; if not, write to the Free Software
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
+ require_relative "ruby-builder-scope"
18
+
17
19
  module Gtk
18
20
  class Builder
19
- class << self
20
- def connect_signal(builder,
21
- object,
22
- signal_name,
23
- handler_name,
24
- connect_object,
25
- flags,
26
- &block)
27
- handler_name = normalize_handler_name(handler_name)
28
- if connect_object
29
- handler = connect_object.method(handler_name)
30
- else
31
- handler = block.call(handler_name)
32
- end
33
-
34
- unless handler
35
- $stderr.puts("Undefined handler: #{handler_name}") if $DEBUG
36
- return
37
- end
38
-
39
- if flags.is_a?(Integer)
40
- flags = GLib::ConnectFlags.new(flags)
41
- end
42
-
43
- if flags.after?
44
- signal_connect_method = :signal_connect_after
45
- else
46
- signal_connect_method = :signal_connect
47
- end
48
-
49
- if handler.arity.zero?
50
- object.__send__(signal_connect_method, signal_name) do
51
- handler.call
52
- end
53
- else
54
- object.__send__(signal_connect_method, signal_name, &handler)
55
- end
56
- end
57
-
58
- private
59
- def normalize_handler_name(name)
60
- name.gsub(/[-\s]+/, "_")
61
- end
62
- end
63
-
64
21
  alias_method :initialize_raw, :initialize
65
22
  def initialize(options={})
66
- path = options[:path] || options[:file]
67
- resource = options[:resource]
68
- string = options[:string]
23
+ object = options[:object]
24
+ path = options[:path] || options[:file]
25
+ resource = options[:resource]
26
+ string = options[:string]
27
+
28
+ initialize_new
29
+ set_current_object(object) if object
30
+ set_scope(RubyBuilderScope.new)
69
31
 
70
32
  if path
71
33
  path = path.to_path if path.respond_to?(:to_path)
72
- initialize_new_from_file(path)
34
+ add_from_file(path)
73
35
  elsif resource
74
- initialize_new_from_resource(resource)
36
+ add_from_resource(resource)
75
37
  elsif string
76
- initialize_new_from_string(string, string.bytesize)
77
- else
78
- initialize_raw
38
+ add_from_string(string)
79
39
  end
80
40
  end
81
41
 
@@ -144,12 +104,5 @@ module Gtk
144
104
  add(target)
145
105
  self
146
106
  end
147
-
148
- alias_method :connect_signals_raw, :connect_signals
149
- def connect_signals(&block)
150
- connect_signals_raw do |*args|
151
- self.class.connect_signal(*args, &block)
152
- end
153
- end
154
107
  end
155
108
  end
data/lib/gtk4/button.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2014-2022 Ruby-GNOME 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
@@ -28,7 +28,6 @@ module Gtk
28
28
  end
29
29
  end
30
30
  icon_name = options[:icon_name]
31
- icon_size = options[:icon_size] || :button
32
31
 
33
32
  if label
34
33
  if use_underline
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2015-2022 Ruby-GNOME 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
@@ -20,21 +20,16 @@ module Gtk
20
20
  def initialize(options={})
21
21
  entry = options[:entry]
22
22
  model = options[:model]
23
- area = options[:area]
24
23
 
25
24
  if entry
26
25
  if model
27
26
  initialize_new_with_model_and_entry(model)
28
- elsif area
29
- initialize_new_with_area_and_entry(area)
30
27
  else
31
28
  initialize_new_with_entry
32
29
  end
33
30
  else
34
31
  if model
35
32
  initialize_new_with_model(model)
36
- elsif area
37
- initialize_new_with_area(area)
38
33
  else
39
34
  initialize_new
40
35
  end