wxruby3 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba2a7c48f9f24e515c6891a059c0b1801f91bd11fe0dcc4d2d82c76fb810da0b
4
- data.tar.gz: 9bb9ada532a116f6826dc394a0f418f278115c65b7c80702f15c80274bc44628
3
+ metadata.gz: c66a3ae46adfde4f69fe289722d28b319f88a13d368babf85d8486d70ec89b81
4
+ data.tar.gz: 9ada796fe609d8fadb1f4b6436d787c2e3570863eacfd65772156cf2ba4baab3
5
5
  SHA512:
6
- metadata.gz: ed03bde1136e78acd711d2b1ffc696306840ca3f5032d8cd90b64f4eba005772c8de0a475035c0441537302f33a28b981f391f992715ef72207ed451b3e4bf74
7
- data.tar.gz: a4e78a5adafd2cc15e05b113a2146de556bf86312d3cc2f7709b13103ecc7248c150127ff710547e63deb8055e4cf220df7ec963265a3e5b07582bbf6b5802be
6
+ metadata.gz: 0f22f743031fe5e16981b8c01b09b9e0d505839f330b48ef25715dc73044d85cbe5a211a107d93a41203b8cc0214fad0a9f5b152f6d82f4828e08c0cef136965
7
+ data.tar.gz: f04a7c5176ac19c6a7702bb61f24c9c88c643e65d345618c8a96733bd60dcbb3a0933245fc1bb4b0354881f0b4d875d2379d2982e5e7d50f3fbe1d713d01f46a
data/lib/wx/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # This software is released under the MIT license.
4
4
 
5
5
  module Wx
6
- WXRUBY_VERSION = '1.5.0'
6
+ WXRUBY_VERSION = '1.5.1'
7
7
  end
@@ -109,7 +109,15 @@ module WXRuby3
109
109
  doxygen = get_cfg_string("doxygen")
110
110
  doxygen = nix_path(doxygen) unless doxygen == 'doxygen'
111
111
  chdir(File.join(ext_path, 'wxWidgets', 'docs', 'doxygen')) do
112
- unless bash({ 'DOXYGEN' => doxygen, 'WX_SKIP_DOXYGEN_VERSION_CHECK' => '1' }, './regen.sh', 'xml')
112
+ exec_env = { 'DOXYGEN' => doxygen, 'WX_SKIP_DOXYGEN_VERSION_CHECK' => '1' }
113
+ # check if we're using an MSYS version or a native Windows version
114
+ if WXRuby3.config.sysinfo.os.pkgman && WXRuby3.config.sysinfo.os.pkgman.installed?('doxygen')
115
+ # The latest MSYS version doxygen generated *nix paths instead of Windows paths in the XML files
116
+ # to be sure the paths are shortened to relative paths we need to set WXWIDGETS to the *nix
117
+ # root path for wxWidgets as well and not the Windows root path as the regen.sh script still does.
118
+ exec_env['WXWIDGETS'] = nix_path(File.join(ext_path, 'wxWidgets'))
119
+ end
120
+ unless bash(exec_env, './regen.sh', 'xml')
113
121
  $stderr.puts 'ERROR: Failed to generate wxWidgets XML API specifications for parsing by wxRuby3.'
114
122
  exit(1)
115
123
  end
@@ -21,7 +21,7 @@ module WXRuby3
21
21
  end
22
22
 
23
23
  def add(distro, *deps, release: nil)
24
- @dependencies[distro] ||= ::Hash.new
24
+ @dependencies[distro] = ::Hash.new(@dependencies.default.default) unless @dependencies.has_key?(distro)
25
25
  if release
26
26
  @dependencies[distro][release] = deps.flatten
27
27
  else
@@ -45,7 +45,7 @@ module WXRuby3
45
45
  PLATFORM_DEPS = {
46
46
  debian: PlatformDependencies.new(%w[libgtk-3-dev libwebkit2gtk-4.0-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev])
47
47
  .add('ubuntu', %w[libgtk-3-dev libwebkit2gtk-4.1-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev], release: '24.04')
48
- .alias('ubuntu', '24.04', 'linuxmint', '22'),
48
+ .alias('ubuntu', '24.04', 'linuxmint', '22').alias('ubuntu', '24.04', 'linuxmint', '22.1'),
49
49
  rhel: PlatformDependencies.new(%w[expat-devel findutils gspell-devel gstreamer1-plugins-base-devel gtk3-devel libcurl-devel libjpeg-devel libnotify-devel libpng-devel libSM-devel libsecret-devel libtiff-devel SDL-devel webkit2gtk4.1-devel zlib-devel]),
50
50
  suse: PlatformDependencies.new(%w[gtk3-devel webkit2gtk3-devel gspell-devel gstreamer-devel gstreamer-plugins-base-devel libcurl-devel libsecret-devel libnotify-devel libSDL-devel zlib-devel libjpeg-devel libpng-devel]),
51
51
  arch: PlatformDependencies.new(%w[pkg-config gtk3 webkit2gtk gspell libunwind gstreamer curl libsecret libnotify libpng12])
@@ -655,8 +655,8 @@ module WXRuby3
655
655
  unless evts_handled.include?(evh_name)
656
656
  evt_klass ||= item.name if item.event
657
657
  # skip if we do not have an actually existing event class (for this platform)
658
- if Package.full_docs? || (item.event && item.name == evt_klass) ||
659
- (evt_klass && included_directors.any? { |dir| dir.defmod.find_item(evt_klass) })
658
+ if (item.event && item.name == evt_klass) ||
659
+ (evt_klass && (Package.full_docs? || included_directors.any? { |dir| dir.defmod.find_item(evt_klass) }))
660
660
 
661
661
  evh_args, evh_docstr = evt_nodoc ? nil : find_event_doc(evh_name)
662
662
  fdoc.doc.puts evh_docstr if evh_docstr
@@ -18,8 +18,13 @@ module WXRuby3
18
18
  super
19
19
  spec.gc_as_object 'wxAuiManager'
20
20
  if Config.instance.wx_version >= '3.3.0'
21
- spec.items << 'wxAuiSerializer' << 'wxAuiDockLayoutInfo' << 'wxAuiPaneLayoutInfo' << 'wxAuiTabLayoutInfo' << 'wxAuiDeserializer'
22
- spec.gc_as_untracked 'wxAuiSerializer', 'wxAuiDeserializer', 'wxAuiDockLayoutInfo', 'wxAuiPaneLayoutInfo', 'wxAuiTabLayoutInfo'
21
+ spec.items << 'wxAuiBookSerializer' << 'wxAuiSerializer' <<
22
+ 'wxAuiDockLayoutInfo' << 'wxAuiPaneLayoutInfo' << 'wxAuiTabLayoutInfo' <<
23
+ 'wxAuiBookDeserializer' << 'wxAuiDeserializer'
24
+ spec.gc_as_untracked 'wxAuiBookSerializer', 'wxAuiSerializer', 'wxAuiBookDeserializer', 'wxAuiDeserializer',
25
+ 'wxAuiDockLayoutInfo', 'wxAuiPaneLayoutInfo', 'wxAuiTabLayoutInfo'
26
+ spec.make_abstract 'wxAuiBookSerializer'
27
+ spec.make_abstract 'wxAuiBookDeserializer'
23
28
  spec.regard 'wxAuiDockLayoutInfo::dock_direction',
24
29
  'wxAuiDockLayoutInfo::dock_layer',
25
30
  'wxAuiDockLayoutInfo::dock_row',
@@ -61,8 +66,8 @@ module WXRuby3
61
66
  spec.map 'std::vector<wxAuiPaneLayoutInfo>' => 'Array<Wx::AuiPaneLayoutInfo>' do
62
67
  map_out code: <<~__CODE
63
68
  $result = rb_ary_new();
64
- std::vector<wxAuiPaneLayoutInfo>& panes = (std::vector<wxAuiPaneLayoutInfo>&)$1;
65
- for (const wxAuiPaneLayoutInfo& pane : panes)
69
+ std::vector<wxAuiPaneLayoutInfo>* panes = (std::vector<wxAuiPaneLayoutInfo>*)&$1;
70
+ for (const wxAuiPaneLayoutInfo& pane : *panes)
66
71
  {
67
72
  VALUE r_pane = SWIG_NewPointerObj(new wxAuiPaneLayoutInfo(pane), SWIGTYPE_p_wxAuiPaneLayoutInfo, SWIG_POINTER_OWN);
68
73
  rb_ary_push($result, r_pane);
@@ -88,8 +93,8 @@ module WXRuby3
88
93
  spec.map 'std::vector<wxAuiTabLayoutInfo>' => 'Array<Wx::AuiTabLayoutInfo>' do
89
94
  map_out code: <<~__CODE
90
95
  $result = rb_ary_new();
91
- std::vector<wxAuiTabLayoutInfo>& tabs = (std::vector<wxAuiTabLayoutInfo>&)$1;
92
- for (const wxAuiTabLayoutInfo& tab : tabs)
96
+ std::vector<wxAuiTabLayoutInfo>* tabs = (std::vector<wxAuiTabLayoutInfo>*)&$1;
97
+ for (const wxAuiTabLayoutInfo& tab : *tabs)
93
98
  {
94
99
  VALUE r_tab = SWIG_NewPointerObj(new wxAuiTabLayoutInfo(tab), SWIGTYPE_p_wxAuiTabLayoutInfo, SWIG_POINTER_OWN);
95
100
  rb_ary_push($result, r_tab);
@@ -23,14 +23,25 @@ module WXRuby3
23
23
  wxAuiNotebookPage::caption
24
24
  wxAuiNotebookPage::tooltip
25
25
  wxAuiNotebookPage::bitmap
26
- wxAuiNotebookPage::rect
27
26
  wxAuiNotebookPage::active]
28
27
  if Config.instance.wx_version >= '3.3.0'
29
28
  spec.items << 'wxAuiNotebookPosition'
30
- spec.regard 'wxAuiNotebookPosition::tabctrl',
31
- 'wxAuiNotebookPosition::page'
32
- spec.make_readonly 'wxAuiNotebookPosition::tabctrl',
33
- 'wxAuiNotebookPosition::page'
29
+ spec.regard 'wxAuiNotebookPosition::tabCtrl',
30
+ 'wxAuiNotebookPosition::tabIdx'
31
+ spec.make_readonly 'wxAuiNotebookPosition::tabCtrl',
32
+ 'wxAuiNotebookPosition::tabIdx'
33
+
34
+ spec.map 'std::vector<wxAuiTabCtrl*>' => 'Array<Wx::AuiTabCtrl>' do
35
+ map_out code: <<~__CODE
36
+ $result = rb_ary_new();
37
+ std::vector<wxAuiTabCtrl*>* tabctrls = (std::vector<wxAuiTabCtrl*>*)&$1;
38
+ for (wxAuiTabCtrl* tabctrl : *tabctrls)
39
+ {
40
+ VALUE r_tabctrl = SWIG_NewPointerObj(SWIG_as_voidptr(tabctrl), SWIGTYPE_p_wxAuiTabCtrl, 0);
41
+ rb_ary_push($result, r_tabctrl);
42
+ }
43
+ __CODE
44
+ end
34
45
  end
35
46
  # reset type mapping done in BookCtrls as the non-const arg is used for query-ing here (FindTab)
36
47
  # (wxWidgets should have made this a const arg)
@@ -19,6 +19,9 @@ module WXRuby3
19
19
  spec.make_abstract 'wxPGCellData' # there is never any need to create an instance in Ruby
20
20
  spec.no_proxy 'wxPGCellData'
21
21
  spec.gc_never 'wxPGCellData'
22
+ # wxPGChoiceEntry are always passed by value and never transfer ownership
23
+ # so we do not need tracking or special free function
24
+ spec.gc_as_untracked 'wxPGChoiceEntry'
22
25
  spec.do_not_generate :variables, :enums, :defines, :functions # with PGProperty
23
26
  # add method for correctly wrapping PGCell output references
24
27
  spec.add_header_code <<~__CODE
@@ -49,6 +49,13 @@ module WXRuby3
49
49
  'wxPGChoices::wxPGChoices(size_t, const wxString *, const long *)',
50
50
  'wxPGChoices::wxPGChoices(const wxChar **, const long *)',
51
51
  'wxPGChoices::GetId'
52
+ # type mapping for wxPGChoiceEntry output references to make sure to always return managed copies
53
+ # (uses reference counted data internally)
54
+ spec.map "wxPGChoiceEntry&", as: "Wx::PGChoiceEntry" do
55
+ map_out code: <<~__CODE
56
+ $result = SWIG_NewPointerObj((new wxPGChoiceEntry(*static_cast< const wxPGChoiceEntry* >($1))), SWIGTYPE_p_wxPGChoiceEntry, SWIG_POINTER_OWN);
57
+ __CODE
58
+ end
52
59
  # replace by extension
53
60
  spec.ignore 'wxPGChoices::operator[]', ignore_doc: false
54
61
  spec.add_extend_code 'wxPGChoices', <<~__HEREDOC
@@ -190,7 +190,7 @@ module WXRuby3
190
190
  # methods).
191
191
  spec.ignore 'wxPropertyGridInterface::RefreshGrid', ignore_doc: false
192
192
  spec.add_extend_code 'wxPropertyGridInterface', <<~__HEREDOC
193
- void RefreshGrid(VALUE rb_state)
193
+ void RefreshGrid(VALUE rb_state = Qnil)
194
194
  {
195
195
  wxPropertyGridPageState *state = 0;
196
196
  if (!NIL_P(rb_state))
@@ -475,6 +475,26 @@ module WXRuby3
475
475
  map_typecheck precedence: 'INT32_ARRAY', code: '$1 = (TYPE($input) == T_ARRAY);'
476
476
  end
477
477
 
478
+ map 'std::vector<size_t>' => 'Array<Integer>' do
479
+ map_out code: <<~__CODE
480
+ $result = rb_ary_new();
481
+ std::vector<size_t>* vec = (std::vector<size_t>*)&$1;
482
+ for (size_t i : *vec)
483
+ {
484
+ rb_ary_push($result, INT2NUM(i));
485
+ }
486
+ __CODE
487
+ map_directorout code: <<~__CODE
488
+ if (TYPE($input) == T_ARRAY)
489
+ {
490
+ for (int i = 0; i < RARRAY_LEN($input); i++)
491
+ {
492
+ $result.push_back(NUM2INT(rb_ary_entry($input,i)));
493
+ }
494
+ }
495
+ __CODE
496
+ end
497
+
478
498
  # various enumerator type mappings
479
499
 
480
500
  map *%w[wxEdge wxRelationship wxKeyCode], as: 'Integer' do
@@ -17,6 +17,8 @@ class FileDialogTests < Test::Unit::TestCase
17
17
  end
18
18
  end
19
19
 
20
+ # temporary as wxw >= 3.3.0 introduced a bug
21
+ if Wx::WXWIDGETS_VERSION < '3.3.0'
20
22
  def test_file_dialog
21
23
  dlg = Wx::FileDialog.new(nil, 'Select file')
22
24
  assert_kind_of(Wx::FileDialog, dlg)
@@ -24,6 +26,7 @@ class FileDialogTests < Test::Unit::TestCase
24
26
  assert_kind_of(Wx::Window, dlg)
25
27
  assert_equal(Wx::ID_OK, dialog_tester(dlg))
26
28
  end
29
+ end
27
30
 
28
31
  class FileDialogTestCustomization < Wx::FileDialogCustomizeHook
29
32
 
data/tests/test_pg.rb CHANGED
@@ -9,18 +9,26 @@ class PGChoicesTests < WxRuby::Test::GUITests
9
9
  def test_enum_labels
10
10
  texts = %w[Red Blue Green Yellow Black White]
11
11
  choices = Wx::PG::PGChoices.new(texts)
12
- choices.each_label { |lbl| assert_equal(texts.shift, lbl) }
12
+ GC.start
13
+ choices.each_label do |lbl|
14
+ assert_equal(texts.shift, lbl)
15
+ GC.start
16
+ end
13
17
  end
14
18
 
15
19
  def test_enum_entries
16
20
  texts = %w[Flag1 Flag2 Flag3 Flag4]
17
21
  choices = Wx::PG::PGChoices.new
22
+ GC.start
18
23
  texts.each_with_index do |s, i|
19
24
  choices.add(s, 1 << i)
20
25
  end
21
26
  choices.each_entry.each_with_index do |entry, ix|
27
+ GC.start
22
28
  assert_equal(1 << ix, entry.value)
29
+ GC.start
23
30
  assert_equal(texts[ix], entry.get_text)
31
+ GC.start
24
32
  end
25
33
  end
26
34
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wxruby3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-30 00:00:00.000000000 Z
10
+ date: 2025-02-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: nokogiri