wxruby3 1.3.1 → 1.5.0

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.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +16 -12
  3. data/README.md +4 -3
  4. data/ext/wxruby3/include/wxRubyApp.h +9 -9
  5. data/ext/wxruby3/swig/mark_free_impl.i +47 -11
  6. data/ext/wxruby3/swig/wx.i +30 -12
  7. data/lib/wx/aui/auifloatframe.rb +1 -1
  8. data/lib/wx/aui/auimanager.rb +5 -16
  9. data/lib/wx/aui/auinotebook.rb +1 -1
  10. data/lib/wx/aui/require.rb +0 -2
  11. data/lib/wx/core/acceleratortable.rb +1 -1
  12. data/lib/wx/core/animation.rb +2 -2
  13. data/lib/wx/core/app.rb +1 -1
  14. data/lib/wx/core/artprovider.rb +4 -4
  15. data/lib/wx/core/bitmap.rb +1 -1
  16. data/lib/wx/core/bitmap_combobox.rb +2 -2
  17. data/lib/wx/core/clientdc.rb +1 -1
  18. data/lib/wx/core/clipboard.rb +4 -4
  19. data/lib/wx/core/colour.rb +1 -1
  20. data/lib/wx/core/combobox.rb +1 -1
  21. data/lib/wx/core/config.rb +7 -7
  22. data/lib/wx/core/controlwithitems.rb +3 -3
  23. data/lib/wx/core/data_object.rb +4 -4
  24. data/lib/wx/core/dataformat.rb +9 -3
  25. data/lib/wx/core/dialog.rb +3 -2
  26. data/lib/wx/core/event.rb +3 -3
  27. data/lib/wx/core/evthandler.rb +325 -289
  28. data/lib/wx/core/file_dialog.rb +1 -1
  29. data/lib/wx/core/find_replace_dialog.rb +2 -2
  30. data/lib/wx/core/functions.rb +1 -1
  31. data/lib/wx/core/genericdirctrl.rb +1 -1
  32. data/lib/wx/core/geometry.rb +2 -2
  33. data/lib/wx/core/graphics_pen_info.rb +1 -1
  34. data/lib/wx/core/helpprovider.rb +1 -1
  35. data/lib/wx/core/icon.rb +1 -1
  36. data/lib/wx/core/image.rb +2 -2
  37. data/lib/wx/core/imagelist.rb +1 -1
  38. data/lib/wx/core/locale.rb +5 -5
  39. data/lib/wx/core/log.rb +8 -8
  40. data/lib/wx/core/menu.rb +3 -3
  41. data/lib/wx/core/module_ext.rb +16 -0
  42. data/lib/wx/core/owner_drawn_combobox.rb +3 -3
  43. data/lib/wx/core/pen_info.rb +1 -1
  44. data/lib/wx/core/persistence_manager.rb +2 -2
  45. data/lib/wx/core/rect.rb +1 -1
  46. data/lib/wx/core/secret_store.rb +1 -1
  47. data/lib/wx/core/simplehelpprovider.rb +1 -1
  48. data/lib/wx/core/sizer.rb +8 -8
  49. data/lib/wx/core/splash_screen.rb +1 -1
  50. data/lib/wx/core/standard_paths.rb +1 -1
  51. data/lib/wx/core/task_bar_button.rb +1 -1
  52. data/lib/wx/core/text_entry.rb +1 -1
  53. data/lib/wx/core/textctrl.rb +2 -2
  54. data/lib/wx/core/timer.rb +2 -2
  55. data/lib/wx/core/tree_ctrl.rb +1 -1
  56. data/lib/wx/core/v_list_box.rb +1 -1
  57. data/lib/wx/core/validator.rb +2 -2
  58. data/lib/wx/core/variant.rb +2 -2
  59. data/lib/wx/core/window.rb +48 -2
  60. data/lib/wx/core/xmlresource.rb +4 -4
  61. data/lib/wx/core.rb +2 -0
  62. data/lib/wx/doc/evthandler.rb +1 -23
  63. data/lib/wx/doc/tip_window.rb +22 -0
  64. data/lib/wx/grid/grid.rb +3 -3
  65. data/lib/wx/grid/require.rb +0 -2
  66. data/lib/wx/html/htmlhelpcontroller.rb +1 -1
  67. data/lib/wx/html/htmlwindow.rb +1 -1
  68. data/lib/wx/html/require.rb +0 -2
  69. data/lib/wx/html/simple_html_listbox.rb +3 -3
  70. data/lib/wx/keyword_ctors.rb +14 -7
  71. data/lib/wx/keyword_defs.rb +7 -7
  72. data/lib/wx/pg/pg_properties.rb +1 -1
  73. data/lib/wx/pg/pg_property.rb +3 -3
  74. data/lib/wx/pg/property_grid.rb +2 -2
  75. data/lib/wx/pg/property_grid_interface.rb +2 -2
  76. data/lib/wx/pg/require.rb +0 -2
  77. data/lib/wx/prt/previewframe.rb +1 -1
  78. data/lib/wx/prt/require.rb +0 -2
  79. data/lib/wx/rbn/ribbon_control.rb +1 -1
  80. data/lib/wx/rbn/ribbon_page.rb +1 -1
  81. data/lib/wx/rbn/ribbon_panel.rb +1 -1
  82. data/lib/wx/rtc/require.rb +0 -2
  83. data/lib/wx/rtc/rich_text_composite_object.rb +1 -1
  84. data/lib/wx/rtc/rich_text_ctrl.rb +1 -1
  85. data/lib/wx/rtc/rich_text_paragraph.rb +1 -1
  86. data/lib/wx/rtc/richtext_buffer.rb +3 -3
  87. data/lib/wx/rtc/richtext_formatting_dialog.rb +2 -2
  88. data/lib/wx/rtc/richtext_style_organiser_dialog.rb +1 -1
  89. data/lib/wx/rtc/symbol_picker_dialog.rb +1 -1
  90. data/lib/wx/stc/require.rb +0 -2
  91. data/lib/wx/stc/styled_text_ctrl.rb +1 -1
  92. data/lib/wx/version.rb +1 -1
  93. data/lib/wx/wxruby/base.rb +8 -2
  94. data/lib/wx/wxruby/cmd/setup.rb +61 -37
  95. data/rakelib/gem.rb +8 -4
  96. data/rakelib/lib/config/macosx.rb +31 -4
  97. data/rakelib/lib/config/mingw.rb +1 -1
  98. data/rakelib/lib/config/pkgman/linux.rb +9 -1
  99. data/rakelib/lib/core/package.rb +68 -49
  100. data/rakelib/lib/director/about_dialog_info.rb +1 -0
  101. data/rakelib/lib/director/aui_manager.rb +63 -57
  102. data/rakelib/lib/director/aui_notebook.rb +7 -0
  103. data/rakelib/lib/director/colour.rb +1 -1
  104. data/rakelib/lib/director/data_format.rb +1 -1
  105. data/rakelib/lib/director/event.rb +1 -0
  106. data/rakelib/lib/director/event_handler.rb +82 -46
  107. data/rakelib/lib/director/events.rb +5 -3
  108. data/rakelib/lib/director/functions.rb +0 -3
  109. data/rakelib/lib/director/grid_ctrl.rb +24 -0
  110. data/rakelib/lib/director/html_printout.rb +2 -0
  111. data/rakelib/lib/director/list_ctrl.rb +14 -10
  112. data/rakelib/lib/director/locale.rb +2 -0
  113. data/rakelib/lib/director/num_validator.rb +7 -0
  114. data/rakelib/lib/director/print_data.rb +7 -0
  115. data/rakelib/lib/director/printer.rb +2 -0
  116. data/rakelib/lib/director/richtext_printing.rb +2 -0
  117. data/rakelib/lib/director/splitter_window.rb +17 -0
  118. data/rakelib/lib/director/textctrl.rb +21 -4
  119. data/rakelib/lib/director/tip_window.rb +34 -0
  120. data/rakelib/lib/director/window.rb +9 -1
  121. data/rakelib/lib/director.rb +0 -1
  122. data/rakelib/lib/generate/doc/evt_handler.yaml +31 -12
  123. data/rakelib/lib/specs/interfaces.rb +9 -0
  124. data/rakelib/lib/typemap/print_page_range.rb +97 -0
  125. data/tests/test_combo_ctrl.rb +1 -0
  126. data/tests/test_event_handling.rb +158 -31
  127. metadata +7 -5
data/rakelib/gem.rb CHANGED
@@ -214,16 +214,18 @@ module WXRuby3
214
214
  end
215
215
  elsif uri.scheme == 'http' || uri.scheme == 'https'
216
216
  # download the binary release package
217
- $stdout.puts "Downloading #{uri.path}..."
217
+ $stdout.puts "Downloading #{uri}..."
218
218
  filename = File.basename(uri.path)
219
- if WXRuby3.config.download_file(uri.path, filename)
219
+ if WXRuby3.config.download_file(uri.to_s, filename)
220
220
  sha_file = File.basename(filename, '.*')+DIGEST_EXT
221
- uri.path = File.join(File.dirname(uri.path), sha_file)
222
- unless WXRuby3.config.download_file(uri.path, sha_file)
221
+ sha_uri = File.join(File.dirname(uri.to_s), sha_file)
222
+ unless WXRuby3.config.download_file(sha_uri, sha_file)
223
223
  $stderr.puts "ERROR: Unable to download digest signature for binary release package : #{package}"
224
224
  exit(1)
225
225
  end
226
226
  exit(1) unless install_bin_pkg(filename)
227
+ # cleanup, remove downloaded files
228
+ FileUtils.rm_f([filename, sha_file])
227
229
  true
228
230
  else
229
231
  $stderr.puts "ERROR: Unable to download binary release package (#{package})!"
@@ -241,6 +243,8 @@ module WXRuby3
241
243
  exit(1)
242
244
  end
243
245
  exit(1) unless install_bin_pkg(bin_pkg_name+BINPKG_EXT)
246
+ # cleanup, remove downloaded files
247
+ FileUtils.rm_f([bin_pkg_name+BINPKG_EXT, bin_pkg_name+DIGEST_EXT])
244
248
  true
245
249
  else
246
250
  if prebuilt_only
@@ -158,10 +158,37 @@ module WXRuby3
158
158
  private
159
159
 
160
160
  def wx_configure
161
- bash("./configure --with-macosx-version-min=#{WXRuby3.config.sysinfo.os.release}.0 " +
162
- "--disable-optimise --disable-sys-libs --without-liblzma --without-regex " +
163
- "--prefix=`pwd`/install --disable-tests --without-subdirs --disable-debug_info " +
164
- "CFLAGS=\"-Wno-unused-but-set-variable\"")
161
+ wxw_ver = nil
162
+ if WXRuby3.config.sysinfo.os.release >= '15'
163
+ # try to detect wxWidgets version
164
+ verfile = File.join(ext_path, 'wxWidgets', 'include', 'wx', 'version.h')
165
+ if File.exist?(verfile)
166
+ v_major = v_minor = v_release = nil
167
+ File.foreach(verfile) do |line|
168
+ case line
169
+ when /\#define\s+wxMAJOR_VERSION\s+(\d+)/
170
+ v_major = $1.to_i
171
+ when /\#define\s+wxMINOR_VERSION\s+(\d+)/
172
+ v_minor = $1.to_i
173
+ when /\#define\s+wxRELEASE_NUMBER\s+(\d+)/
174
+ v_release = $1.to_i
175
+ end
176
+ end
177
+ wxw_ver = "#{v_major}.#{v_minor}.#{v_release}"
178
+ end
179
+ end
180
+ if WXRuby3.config.sysinfo.os.release >= '15' && (wxw_ver.nil? || wxw_ver <= '3.2.6')
181
+ # circumvent compilation problems on MacOS 15 or higher with older wxWidgets releases
182
+ bash("./configure " +
183
+ "--disable-optimise --disable-sys-libs --without-liblzma --without-regex " +
184
+ "--prefix=`pwd`/install --disable-tests --without-subdirs --disable-debug_info " +
185
+ "CFLAGS=\"-Wno-unused-but-set-variable\"")
186
+ else
187
+ bash("./configure --with-macosx-version-min=#{WXRuby3.config.sysinfo.os.release}.0 " +
188
+ "--disable-optimise --disable-sys-libs --without-liblzma --without-regex " +
189
+ "--prefix=`pwd`/install --disable-tests --without-subdirs --disable-debug_info " +
190
+ "CFLAGS=\"-Wno-unused-but-set-variable\"")
191
+ end
165
192
  end
166
193
 
167
194
  def wx_make
@@ -98,7 +98,7 @@ module WXRuby3
98
98
  private
99
99
 
100
100
  def wx_configure
101
- bash('./configure --prefix=`pwd`/install --disable-tests --without-subdirs --without-regex --with-expat=builtin --with-zlib=builtin --disable-debug_info')
101
+ bash('./configure --prefix=`pwd`/install --disable-tests --without-subdirs --without-regex --without-libcurl --with-expat=builtin --with-zlib=builtin --disable-debug_info')
102
102
  end
103
103
 
104
104
  def wx_make
@@ -30,6 +30,13 @@ module WXRuby3
30
30
  self
31
31
  end
32
32
 
33
+ def alias(distro, release, alias_distro, alias_release)
34
+ if @dependencies.has_key?(distro) && @dependencies[distro].has_key?(release)
35
+ @dependencies[alias_distro][alias_release] = @dependencies[distro][release]
36
+ end
37
+ self
38
+ end
39
+
33
40
  def get(distro, release: nil)
34
41
  @dependencies[distro][release]
35
42
  end
@@ -37,7 +44,8 @@ module WXRuby3
37
44
 
38
45
  PLATFORM_DEPS = {
39
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])
40
- .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'),
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'),
41
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]),
42
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]),
43
51
  arch: PlatformDependencies.new(%w[pkg-config gtk3 webkit2gtk gspell libunwind gstreamer curl libsecret libnotify libpng12])
@@ -526,28 +526,6 @@ module WXRuby3
526
526
  end
527
527
  end
528
528
 
529
- def generate_event_types(fout, item, evts_handled)
530
- fout.puts " # from #{item.name}"
531
- item.event_types.each do |evt_hnd, evt_type, evt_arity, evt_klass, _|
532
- evh_name = evt_hnd.downcase
533
- unless evts_handled.include?(evh_name)
534
- evt_klass ||= if item.event
535
- item.name
536
- else
537
- raise "Don't know Event class for #{evh_name} event type (from #{item.name})"
538
- end
539
- fout.puts ' '+<<~__HEREDOC.split("\n").join("\n ")
540
- self.register_event_type EventType[
541
- '#{evh_name}', #{evt_arity},
542
- #{fullname}::#{evt_type},
543
- #{fullname}::#{evt_klass.sub(/\Awx/i, '')}
544
- ] if #{fullname}.const_defined?(:#{evt_type})
545
- __HEREDOC
546
- evts_handled << evh_name
547
- end
548
- end
549
- end
550
-
551
529
  class << self
552
530
  # need to share these over all packages since events may be defined in multiple
553
531
  def generated_events
@@ -561,6 +539,46 @@ module WXRuby3
561
539
  end
562
540
  @event_list_packages
563
541
  end
542
+
543
+ # some event handler (catch-all) macros need custom coding so we need to skip
544
+ # them when generating
545
+ def ignored_event_handlers
546
+ @ignored_event_handlers ||= Set.new
547
+ end
548
+
549
+ def full_docs?
550
+ if @full_docs.nil?
551
+ @full_docs = !!ENV['WXRUBY_FULLDOCS']
552
+ end
553
+ @full_docs
554
+ end
555
+ end
556
+
557
+ def generate_event_types(fout, item, evts_handled)
558
+ fout.puts " # from #{item.name}"
559
+ item.event_types.each do |evt_hnd, evt_type, evt_arity, evt_klass, _|
560
+ unless Package.ignored_event_handlers.include?(evt_hnd)
561
+ evh_name = evt_hnd.downcase
562
+ unless evts_handled.include?(evh_name)
563
+ evt_klass ||= item.name if item.event
564
+ # skip if we do not have an actually existing event class
565
+ if (item.event && item.name == evt_klass) ||
566
+ (evt_klass && included_directors.any? { |dir| dir.defmod.find_item(evt_klass) })
567
+
568
+ evt_klass ||= item.name
569
+ fout.puts ' '+<<~__HEREDOC.split("\n").join("\n ")
570
+ self.register_event_type EventType[
571
+ '#{evh_name}', #{evt_arity},
572
+ #{fullname}::#{evt_type},
573
+ #{fullname}::#{evt_klass.sub(/\Awx/i, '')}
574
+ ]
575
+ __HEREDOC
576
+ evts_handled << evh_name
577
+
578
+ end
579
+ end
580
+ end
581
+ end
564
582
  end
565
583
 
566
584
  def generate_event_list
@@ -635,31 +653,36 @@ module WXRuby3
635
653
  item.event_types.each do |evt_hnd, evt_type, evt_arity, evt_klass, evt_nodoc|
636
654
  evh_name = evt_hnd.downcase
637
655
  unless evts_handled.include?(evh_name)
638
- evt_klass ||= item.name
639
- evh_args, evh_docstr = evt_nodoc ? nil : find_event_doc(evh_name)
640
- fdoc.doc.puts evh_docstr if evh_docstr
641
- fdoc.doc.puts "Processes a {#{fullname}::#{evt_type}} event." unless /Process.*\s(event|command)/ =~ evh_docstr
642
- case evt_arity
643
- when 0
644
- evh_args = 'meth = nil, &block' unless evh_args
645
- when 1
646
- evh_args = 'id, meth = nil, &block' unless evh_args
647
- argnms = evh_args.split(',')
648
- fdoc.doc.puts "@param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] #{argnms.shift.strip} window/control id"
649
- when 2
650
- evh_args = 'first_id, last_id, meth = nil, &block' unless evh_args
651
- argnms = evh_args.split(',')
652
- fdoc.doc.puts "@param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] #{argnms.shift.strip} first window/control id of range"
653
- fdoc.doc.puts "@param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] #{argnms.shift.strip} last window/control id of range"
654
- end
655
- fdoc.doc.puts "@param [String,Symbol,Method,Proc] meth (name of) method or handler proc"
656
- #fdoc.doc.puts "@param [Proc] block handler block"
657
- fdoc.doc.puts "@yieldparam [#{fullname}::#{evt_klass.sub(/\Awx/i, '')}] event the event to handle"
656
+ evt_klass ||= item.name if item.event
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) })
660
+
661
+ evh_args, evh_docstr = evt_nodoc ? nil : find_event_doc(evh_name)
662
+ fdoc.doc.puts evh_docstr if evh_docstr
663
+ fdoc.doc.puts "Processes a {#{fullname}::#{evt_type}} event." unless /Process.*\s(event|command)/ =~ evh_docstr
664
+ case evt_arity
665
+ when 0
666
+ evh_args = 'meth = nil, &block' unless evh_args
667
+ when 1
668
+ evh_args = 'id, meth = nil, &block' unless evh_args
669
+ argnms = evh_args.split(',')
670
+ fdoc.doc.puts "@param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] #{argnms.shift.strip} window/control id"
671
+ when 2
672
+ evh_args = 'first_id, last_id, meth = nil, &block' unless evh_args
673
+ argnms = evh_args.split(',')
674
+ fdoc.doc.puts "@param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] #{argnms.shift.strip} first window/control id of range"
675
+ fdoc.doc.puts "@param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] #{argnms.shift.strip} last window/control id of range"
676
+ end
677
+ fdoc.doc.puts "@param [String,Symbol,Method,Proc] meth (name of) method or handler proc"
678
+ #fdoc.doc.puts "@param [Proc] block handler block"
679
+ fdoc.doc.puts "@yieldparam [#{fullname}::#{evt_klass.sub(/\Awx/i, '')}] event the event to handle"
658
680
 
659
- fdoc.puts "def #{evh_name}(#{evh_args}) end"
660
- fdoc.puts
681
+ fdoc.puts "def #{evh_name}(#{evh_args}) end"
682
+ fdoc.puts
661
683
 
662
- evts_handled << evh_name
684
+ evts_handled << evh_name
685
+ end
663
686
  end
664
687
  end
665
688
  end
@@ -788,10 +811,6 @@ module WXRuby3
788
811
  end
789
812
  private :generate_core_doc
790
813
 
791
- def self.full_docs?
792
- !!ENV['WXRUBY_FULLDOCS']
793
- end
794
-
795
814
  def generate_docs
796
815
  # make sure all modules have been extracted from xml
797
816
  included_directors.each {|dir| dir.extract_interface(false, gendoc: true) }
@@ -19,6 +19,7 @@ module WXRuby3
19
19
  map_check code: ''
20
20
  end
21
21
  super
22
+ spec.ignore 'wxGenericAboutBox' # wrapped with wxGenericAboutDialog
22
23
  end
23
24
  end # class AboutDialogInfo
24
25
 
@@ -18,48 +18,53 @@ 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' << 'wxAuiDockInfo' << 'wxAuiDeserializer'
22
- spec.gc_as_untracked 'wxAuiSerializer', 'wxAuiDockInfo'
23
- spec.regard 'wxAuiDockInfo::rect',
24
- 'wxAuiDockInfo::dock_direction',
25
- 'wxAuiDockInfo::dock_layer',
26
- 'wxAuiDockInfo::dock_row',
27
- 'wxAuiDockInfo::size',
28
- 'wxAuiDockInfo::min_size',
29
- 'wxAuiDockInfo::resizable',
30
- 'wxAuiDockInfo::toolbar',
31
- 'wxAuiDockInfo::fixed',
32
- 'wxAuiDockInfo::reserved1'
33
- spec.make_readonly 'wxAuiDockInfo::rect',
34
- 'wxAuiDockInfo::dock_direction',
35
- 'wxAuiDockInfo::dock_layer',
36
- 'wxAuiDockInfo::dock_row',
37
- 'wxAuiDockInfo::size',
38
- 'wxAuiDockInfo::min_size',
39
- 'wxAuiDockInfo::resizable',
40
- 'wxAuiDockInfo::toolbar',
41
- 'wxAuiDockInfo::fixed',
42
- 'wxAuiDockInfo::reserved1'
43
- spec.add_extend_code 'wxAuiDockInfo', <<~__HEREDOC
44
- VALUE each_pane()
21
+ spec.items << 'wxAuiSerializer' << 'wxAuiDockLayoutInfo' << 'wxAuiPaneLayoutInfo' << 'wxAuiTabLayoutInfo' << 'wxAuiDeserializer'
22
+ spec.gc_as_untracked 'wxAuiSerializer', 'wxAuiDeserializer', 'wxAuiDockLayoutInfo', 'wxAuiPaneLayoutInfo', 'wxAuiTabLayoutInfo'
23
+ spec.regard 'wxAuiDockLayoutInfo::dock_direction',
24
+ 'wxAuiDockLayoutInfo::dock_layer',
25
+ 'wxAuiDockLayoutInfo::dock_row',
26
+ 'wxAuiDockLayoutInfo::dock_pos',
27
+ 'wxAuiDockLayoutInfo::dock_proportion',
28
+ 'wxAuiDockLayoutInfo::dock_size',
29
+ 'wxAuiPaneLayoutInfo::name',
30
+ 'wxAuiPaneLayoutInfo::floating_pos',
31
+ 'wxAuiPaneLayoutInfo::floating_size',
32
+ 'wxAuiPaneLayoutInfo::is_maximized'
33
+ spec.add_extend_code 'wxAuiTabLayoutInfo', <<~__HEREDOC
34
+ VALUE get_pages()
45
35
  {
46
- wxAuiPaneInfoPtrArray panes = self->panes;
47
- VALUE rc = Qnil;
48
- for (wxAuiPaneInfo* pane : panes)
36
+ VALUE rc = rb_ary_new();
37
+ for (int page : self->pages)
49
38
  {
50
- VALUE r_pane = SWIG_NewPointerObj(pane, SWIGTYPE_p_wxAuiPaneInfo, 0);
51
- rc = rb_yield(r_pane);
52
- }
39
+ rb_ary_push(rc, INT2NUM(page));
40
+ }
53
41
  return rc;
54
42
  }
43
+
44
+ void set_pages(VALUE rb_pages)
45
+ {
46
+ if (TYPE(rb_pages) == T_ARRAY)
47
+ {
48
+ std::vector<int> pgs;
49
+ for (int i = 0; i < RARRAY_LEN(rb_pages); i++)
50
+ {
51
+ pgs.push_back(NUM2INT(rb_ary_entry(rb_pages, i)));
52
+ }
53
+ self->pages = pgs;
54
+ }
55
+ else
56
+ {
57
+ rb_raise(rb_eTypeError, "Expected Array of Integer for 1");
58
+ }
59
+ }
55
60
  __HEREDOC
56
- spec.map 'std::vector<wxAuiPaneInfo>' => 'Array<Wx::AuiPaneInfo>' do
61
+ spec.map 'std::vector<wxAuiPaneLayoutInfo>' => 'Array<Wx::AuiPaneLayoutInfo>' do
57
62
  map_out code: <<~__CODE
58
63
  $result = rb_ary_new();
59
- std::vector<wxAuiPaneInfo>& panes = (std::vector<wxAuiPaneInfo>&)$1;
60
- for (const wxAuiPaneInfo& pane : panes)
64
+ std::vector<wxAuiPaneLayoutInfo>& panes = (std::vector<wxAuiPaneLayoutInfo>&)$1;
65
+ for (const wxAuiPaneLayoutInfo& pane : panes)
61
66
  {
62
- VALUE r_pane = SWIG_NewPointerObj(new wxAuiPaneInfo(pane), SWIGTYPE_p_wxAuiPaneInfo, SWIG_POINTER_OWN);
67
+ VALUE r_pane = SWIG_NewPointerObj(new wxAuiPaneLayoutInfo(pane), SWIGTYPE_p_wxAuiPaneLayoutInfo, SWIG_POINTER_OWN);
63
68
  rb_ary_push($result, r_pane);
64
69
  }
65
70
  __CODE
@@ -70,24 +75,24 @@ module WXRuby3
70
75
  {
71
76
  void *ptr;
72
77
  VALUE r_pane = rb_ary_entry($input, i);
73
- int res = SWIG_ConvertPtr(r_pane, &ptr, SWIGTYPE_p_wxAuiPaneInfo, 0);
78
+ int res = SWIG_ConvertPtr(r_pane, &ptr, SWIGTYPE_p_wxAuiPaneLayoutInfo, 0);
74
79
  if (!SWIG_IsOK(res) || !ptr) {
75
- Swig::DirectorTypeMismatchException::raise(swig_get_self(), "load_panes", rb_eTypeError, "in return value. Expected Array of Wx::AuiPaneInfo");
80
+ Swig::DirectorTypeMismatchException::raise(swig_get_self(), "load_panes", rb_eTypeError, "in return value. Expected Array of Wx::AuiPaneLayoutInfo");
76
81
  }
77
- wxAuiPaneInfo *pane = reinterpret_cast< wxAuiPaneInfo * >(ptr);
82
+ wxAuiPaneLayoutInfo *pane = reinterpret_cast< wxAuiPaneLayoutInfo * >(ptr);
78
83
  $result.push_back(*pane);
79
84
  }
80
85
  }
81
86
  __CODE
82
87
  end
83
- spec.map 'std::vector<wxAuiDockInfo>' => 'Array<Wx::AuiDockInfo>' do
88
+ spec.map 'std::vector<wxAuiTabLayoutInfo>' => 'Array<Wx::AuiTabLayoutInfo>' do
84
89
  map_out code: <<~__CODE
85
90
  $result = rb_ary_new();
86
- std::vector<wxAuiDockInfo>& docks = (std::vector<wxAuiDockInfo>&)$1;
87
- for (const wxAuiDockInfo& dock : docks)
91
+ std::vector<wxAuiTabLayoutInfo>& tabs = (std::vector<wxAuiTabLayoutInfo>&)$1;
92
+ for (const wxAuiTabLayoutInfo& tab : tabs)
88
93
  {
89
- VALUE r_dock = SWIG_NewPointerObj(new wxAuiDockInfo(dock), SWIGTYPE_p_wxAuiDockInfo, SWIG_POINTER_OWN);
90
- rb_ary_push($result, r_dock);
94
+ VALUE r_tab = SWIG_NewPointerObj(new wxAuiTabLayoutInfo(tab), SWIGTYPE_p_wxAuiTabLayoutInfo, SWIG_POINTER_OWN);
95
+ rb_ary_push($result, r_tab);
91
96
  }
92
97
  __CODE
93
98
  map_directorout code: <<~__CODE
@@ -96,13 +101,13 @@ module WXRuby3
96
101
  for (int i = 0; i < RARRAY_LEN($input); i++)
97
102
  {
98
103
  void *ptr;
99
- VALUE r_dock = rb_ary_entry($input, i);
100
- int res = SWIG_ConvertPtr(r_dock, &ptr, SWIGTYPE_p_wxAuiDockInfo, 0);
104
+ VALUE r_tab = rb_ary_entry($input, i);
105
+ int res = SWIG_ConvertPtr(r_tab, &ptr, SWIGTYPE_p_wxAuiTabLayoutInfo, 0);
101
106
  if (!SWIG_IsOK(res) || !ptr) {
102
- Swig::DirectorTypeMismatchException::raise(swig_get_self(), "load_docks", rb_eTypeError, "in return value. Expected Array of Wx::AuiDockInfo");
107
+ Swig::DirectorTypeMismatchException::raise(swig_get_self(), "load_docks", rb_eTypeError, "in return value. Expected Array of Wx::AuiTabLayoutInfo");
103
108
  }
104
- wxAuiDockInfo *dock = reinterpret_cast< wxAuiDockInfo * >(ptr);
105
- $result.push_back(*dock);
109
+ wxAuiTabLayoutInfo *tab = reinterpret_cast< wxAuiTabLayoutInfo * >(ptr);
110
+ $result.push_back(*tab);
106
111
  }
107
112
  }
108
113
  __CODE
@@ -215,17 +220,18 @@ module WXRuby3
215
220
 
216
221
  def gen_class_doc_members(fdoc, clsdef, cls_members, alias_methods)
217
222
  super
218
- if Config.instance.wx_version >= '3.3.0' && clsdef.name == 'wxAuiDockInfo'
219
- fdoc.doc.puts 'Yield each pane to the given block.'
220
- fdoc.doc.puts 'If no block passed returns an Enumerator.'
221
- fdoc.doc.puts '@yieldparam [Wx::AUI::AuiPaneInfo] pane the Aui pane info yielded'
222
- fdoc.doc.puts '@return [::Object, ::Enumerator] result of last block execution or enumerator'
223
- fdoc.puts 'def each_pane; end'
223
+ if Config.instance.wx_version >= '3.3.0' && clsdef.name == 'wxAuiTabLayoutInfo'
224
+ fdoc.doc.puts 'Returns the indices of the pages in this tab control in their order on screen.'
225
+ fdoc.doc.puts 'If this array is empty, it means that the tab control contains all notebook pages in natural order.'
226
+ fdoc.doc.puts '@return [::Array<Integer>] indices of the pages in this tab control'
227
+ fdoc.puts 'def get_pages; end'
228
+ fdoc.puts 'alias :pages :get_pages'
224
229
  fdoc.puts
225
- fdoc.doc.puts 'Returns an array of Wx::AuiPaneInfo for all panes managed by the frame manager.'
226
- fdoc.doc.puts '@return [Array<Wx::AUI::AuiPaneInfo>] info for all managed panes'
227
- fdoc.puts 'def get_panes; end'
228
- fdoc.puts 'alias_method :panes, :get_panes'
230
+ fdoc.doc.puts 'Set the indices of the pages in this tab control in their order on screen.'
231
+ fdoc.doc.puts 'If this array is empty, it means that the tab control contains all notebook pages in natural order.'
232
+ fdoc.doc.puts '@param [::Array<Integer>] pages indices of the pages in this tab control'
233
+ fdoc.puts 'def set_pages(pages) end'
234
+ fdoc.puts 'alias :pages= :set_pages'
229
235
  end
230
236
  end
231
237
 
@@ -25,6 +25,13 @@ module WXRuby3
25
25
  wxAuiNotebookPage::bitmap
26
26
  wxAuiNotebookPage::rect
27
27
  wxAuiNotebookPage::active]
28
+ if Config.instance.wx_version >= '3.3.0'
29
+ spec.items << 'wxAuiNotebookPosition'
30
+ spec.regard 'wxAuiNotebookPosition::tabctrl',
31
+ 'wxAuiNotebookPosition::page'
32
+ spec.make_readonly 'wxAuiNotebookPosition::tabctrl',
33
+ 'wxAuiNotebookPosition::page'
34
+ end
28
35
  # reset type mapping done in BookCtrls as the non-const arg is used for query-ing here (FindTab)
29
36
  # (wxWidgets should have made this a const arg)
30
37
  spec.map_apply 'SWIGTYPE *' => 'wxWindow* page'
@@ -16,7 +16,7 @@ module WXRuby3
16
16
  spec.gc_as_untracked('wxColour')
17
17
  spec.require_app 'wxColour::wxColour(const wxColour&)'
18
18
  spec.ignore(%w[
19
- wxColour::GetPixel wxTransparentColour wxColour::operator!=
19
+ wxColour::GetPixel wxTransparentColour wxColour::operator!= wxColour::operator==
20
20
  wxBLACK wxBLUE wxCYAN wxGREEN wxYELLOW wxLIGHT_GREY wxRED wxWHITE
21
21
  ])
22
22
  spec.map 'unsigned char *' => 'Integer' do
@@ -15,7 +15,7 @@ module WXRuby3
15
15
  def setup
16
16
  super
17
17
  spec.gc_as_object
18
- spec.ignore 'wxDataFormat::operator ==(wxDataFormatId)'
18
+ spec.ignore 'wxDataFormat::operator=='
19
19
  if Config.platform == :mingw
20
20
  # The formal signature for these is NativeFormat; this is required on
21
21
  # MSVC as otherwise an impermissible implicit cast is tried, and so
@@ -47,6 +47,7 @@ module WXRuby3
47
47
  if (class_name == "wxEvent" || class_name == "wxCommandEvent")
48
48
  {
49
49
  // special clones for Ruby derived events are already managed and tracked
50
+ // (this also covers Wx::AsyncProcCallEvent)
50
51
  return SWIG_RubyInstanceFor((void *)wx_evt);
51
52
  }
52
53