wxruby3 1.1.1 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '079f38ae02dfcba5a96738f73c678e0d9a5396920739cb370c47d79b6bb81adf'
4
- data.tar.gz: 510b7637e541b981deb048d4b0aa3898ea8152900b570ead984dcb9c6daee534
3
+ metadata.gz: 4bac7565182a0ae6badaee56d7b323459bdc2b198281a50639fafd6fcb2d2499
4
+ data.tar.gz: 5dc08857adaf213871ec7fce09117bac4cc19f00cac50638de552dc2219ea803
5
5
  SHA512:
6
- metadata.gz: 4b3c4ad6e1c31636d658cd9f0d986c57caf6bc6f72af19af449b7d371c3b9af45b229533f1ae3593b7c23b2b29bf74dfaac8e88740fcca0699dc093f40b29d8f
7
- data.tar.gz: 827044bb4256d7afc741e77209096cd527f2c77688c0b619fd72cf1ad0bf03992de4e3c60ec93e17795835345b15932ae2773381de85177d941d8b205ab120f7
6
+ metadata.gz: cbd4920bcc8ae2085ed85b49ee218642c1eb8a58c6bae7132fd653f479e5af6a60c716f61a9ad38bfdcc5cdc1e3560eb4152365127414bf0c401f266b39228c9
7
+ data.tar.gz: 60bba874185fe173a83d8878e458721a3f3fe58cbf484be2826c100a6009dff062972af7ecbaa9bc7dd3095d100aafdf326ac2dd994e1e50e7939654673d2466
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.1.1'
6
+ WXRUBY_VERSION = '1.2.0'
7
7
  end
@@ -218,10 +218,6 @@ module WXRuby3
218
218
  @ruby_libs << "-L#{RB_CONFIG['libdir']}" # add ruby lib dir
219
219
  # add ruby defined shared ruby lib(s); not any other flags
220
220
  @ruby_libs.concat RB_CONFIG['LIBRUBYARG_SHARED'].split(' ').select { |s| s.start_with?('-l')}
221
-
222
- # maintain minimum compatibility with ABI 3.0.1
223
- @wx_abi_version = [ @wx_version, "3.0.1" ].min
224
- @wx_cppflags << "-DwxABI_VERSION=%s" % @wx_abi_version.tr(".", "0")
225
221
  end
226
222
  end
227
223
  end
@@ -728,10 +728,6 @@ module WXRuby3
728
728
  @wx_version || ''
729
729
  end
730
730
 
731
- def wx_abi_version
732
- @wx_abi_version || ''
733
- end
734
-
735
731
  def mingw?
736
732
  @platform == :mingw
737
733
  end
@@ -114,11 +114,20 @@ module WXRuby3
114
114
  directors.select { |dir| Package.full_docs? || !Config.instance.excluded_module?(dir.spec) }
115
115
  end
116
116
 
117
- def director_for_class(class_name)
118
- dir = included_directors.detect { |dir| dir.spec.module_name == class_name || dir.spec.items.include?(class_name) }
119
- subpackages.each_value.detect { |spkg| dir = spkg.director_for_class(class_name) } if dir.nil?
120
- dependencies.detect { |pkgdep| dir = pkgdep.director_for_class(class_name) } if dir.nil?
121
- dir = parent.director_for_class(class_name) if dir.nil? && parent
117
+ def director_for_class(class_name, pkg_stack=[])
118
+ dir = included_directors.detect { |dir| dir.spec.module_name == class_name || dir.spec.items.include?(dir.spec.classdef_name(class_name)) }
119
+ pkg_stack << self
120
+ subpackages.each_value.detect do |spkg|
121
+ unless pkg_stack.include?(spkg) # should never happen
122
+ dir = spkg.director_for_class(class_name, pkg_stack)
123
+ end
124
+ end if dir.nil?
125
+ dependencies.detect do |pkgdep|
126
+ unless pkg_stack.include?(pkgdep)
127
+ dir = pkgdep.director_for_class(class_name)
128
+ end
129
+ end if dir.nil?
130
+ dir = parent.director_for_class(class_name) if dir.nil? && parent && !pkg_stack.include?(parent)
122
131
  dir
123
132
  end
124
133
 
@@ -69,7 +69,7 @@ module WXRuby3
69
69
  wxExit
70
70
  }
71
71
  spec.ignore 'wxApp::GetGUIInstance'
72
- unless Config.instance.wx_abi_version >= '3.2.1' || Config.instance.wx_version < '3.2.1'
72
+ unless Config.instance.wx_version < '3.2.1'
73
73
  spec.ignore 'wxApp::GTKAllowDiagnosticsControl'
74
74
  end
75
75
  spec.add_extend_code 'wxApp', <<~__HEREDOC
@@ -43,6 +43,55 @@ module WXRuby3
43
43
  spec.add_swig_code '%markfunc wxDropSource "mark_wxDropSource";',
44
44
  '%markfunc wxDropTarget "mark_wxDropTarget";'
45
45
  spec.extend_interface 'wxDropSource', 'virtual ~wxDropSource()' # correct interface omission
46
+ # make Ruby director and wrappers use custom implementation
47
+ spec.use_class_implementation('wxDropTarget', 'wxRubyDropTarget')
48
+ spec.make_concrete('wxDropTarget')
49
+ spec.no_proxy %w[wxDropTarget::OnData] # prevent director overload; custom impl handles this
50
+ spec.add_header_code <<~__HEREDOC
51
+ class wxRubyDropTarget : public wxDropTarget
52
+ {
53
+ public:
54
+ wxRubyDropTarget(wxDataObject *dataObject = nullptr ) : wxDropTarget(dataObject) {}
55
+
56
+ virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult dflt) override
57
+ {
58
+ static WxRuby_ID on_data_id("on_data");
59
+ wxDragResult c_result = wxDragError;
60
+ VALUE SWIGUNUSED result;
61
+
62
+ VALUE rb_x = INT2NUM(static_cast< int >(x));
63
+ VALUE rb_y = INT2NUM(static_cast< int >(y));
64
+ VALUE rb_dflt = wxRuby_GetEnumValueObject("DragResult", static_cast<int>(dflt));
65
+ if (rb_dflt == Qnil)
66
+ {
67
+ std::cerr << "Unexpected argument error: invalid value for Wx::DragResult in wxDropTarget::OnData [" << dflt << "]" << std::endl;
68
+ }
69
+ else
70
+ {
71
+ VALUE self = SWIG_RubyInstanceFor(this);
72
+ bool ex = false;
73
+ result = wxRuby_Funcall(ex, self, rb_intern("on_data"), 3,rb_x, rb_y, rb_dflt);
74
+ if (ex)
75
+ {
76
+ wxRuby_PrintException(result);
77
+ }
78
+ else
79
+ {
80
+ int eval;
81
+ if (!wxRuby_GetEnumValue("DragResult", result, eval))
82
+ {
83
+ std::cerr << "Type Error: invalid value for Wx::DragResult returned from Wx::DropTarget#on_data" << std::endl;
84
+ }
85
+ else
86
+ {
87
+ c_result = static_cast<wxDragResult>(eval);
88
+ }
89
+ }
90
+ }
91
+ return (wxDragResult) c_result;
92
+ }
93
+ };
94
+ __HEREDOC
46
95
  spec.ignore %w[wxFileDropTarget::OnDrop wxTextDropTarget::OnDrop]
47
96
  spec.no_proxy %w[wxFileDropTarget::OnDrop wxFileDropTarget::OnData]
48
97
  spec.no_proxy %w[wxTextDropTarget::OnDrop wxTextDropTarget::OnData]
@@ -61,6 +61,9 @@ module WXRuby3
61
61
  spec.ignore 'wxGetEmailAddress(char *,int)',
62
62
  'wxGetUserId(char *,int)',
63
63
  'wxGetUserName(char *,int)'
64
+ if Config.instance.wx_version >= '3.3.0'
65
+ spec.ignore_unless('WXMSW', 'wxMSWIsOnSecureScreen')
66
+ end
64
67
  spec.map 'wxMemorySize' => 'Integer' do
65
68
  map_out code: <<~__CODE
66
69
  $result = LL2NUM(wxLongLongNative($1).GetValue());
@@ -703,7 +703,7 @@ module WXRuby3
703
703
  fdoc.puts
704
704
  mod_indent = 0
705
705
  package.all_modules.each do |modnm|
706
- fdoc.iputs("module #{package.fullname}", mod_indent)
706
+ fdoc.iputs("module #{modnm}", mod_indent)
707
707
  fdoc.puts
708
708
  mod_indent += 1
709
709
  end
@@ -628,7 +628,12 @@ module WXRuby3
628
628
  end
629
629
 
630
630
  def run
631
- member_map = collect_methods rescue $!
631
+ begin
632
+ member_map = collect_methods
633
+ rescue Exception
634
+ STDERR.puts "#{$!}\n#{$!.backtrace.join("\n")}"
635
+ exit(1)
636
+ end
632
637
  return if member_map.empty?
633
638
 
634
639
  # create re match list for class names
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wxruby3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-13 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -1191,7 +1191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1191
1191
  - !ruby/object:Gem::Version
1192
1192
  version: '0'
1193
1193
  requirements: []
1194
- rubygems_version: 3.5.11
1194
+ rubygems_version: 3.5.16
1195
1195
  signing_key:
1196
1196
  specification_version: 4
1197
1197
  summary: wxWidgets extension for Ruby