gtk4 3.5.1 → 4.0.0

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: cce55c2f56959bfc15e9ed120d45ddebd1daea787b57f7d92db7015bba88b6d7
4
- data.tar.gz: 0213cd69a90cfdd489b80b6fbac78be96bdae3f81a64a2ee981a03f4ad8b8b1c
3
+ metadata.gz: c84a869080297426c7c1fbefc969297ff60e03894c45b5d8ce05a122400fe5a7
4
+ data.tar.gz: 5578d4efda703de68e8baf0d30c6c75c3eb810a6bbe738568bfa177cce5feed3
5
5
  SHA512:
6
- metadata.gz: a0d128e02eb352a9d5a4e15a5050da728ea07a17dcc0c18b93e059044b5b9318346e472f2412fc83d43cec1e7a5339aa28c3af9eacc1d33d6e486ae99a2ef4ae
7
- data.tar.gz: e931f40790d8aca9d83d9276d5d1e613cb5638859fc105aa386bc6a79059bfa2508537c2bfe2ad6653ad018616f9deed30da6cdd7e97cfdac81327a75fe9e8c5
6
+ metadata.gz: 121cdd7ccec72f012d2fcf868c86b6f50c67a4f925c0aa9ae01c4a5ff5257238d396e6f63ac96416bcfb84ef5da60eba38049d433165edc4a5086b0cf88f5d3b
7
+ data.tar.gz: 185d150347fd21714210ab497d3e88c6d0308df953de001d11e17dbf79fd768733873ec0fe7ce499ee1d85419833958bb21dbea389acb6f3b8d6492630eb16bd
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