wxruby3 1.4.2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db9a443c40a2d1cd6ea3d993fe894ad61d1ce737c2a871877ef88ca06d39a629
4
- data.tar.gz: 43cd46e0283fb6c6706362caa9c6c098bc2cff55216e1d98509c04912afdcf6b
3
+ metadata.gz: ba2a7c48f9f24e515c6891a059c0b1801f91bd11fe0dcc4d2d82c76fb810da0b
4
+ data.tar.gz: 9bb9ada532a116f6826dc394a0f418f278115c65b7c80702f15c80274bc44628
5
5
  SHA512:
6
- metadata.gz: 67d5f62560609aa87f68563a8a51304e87242ca9a084d74ce7f4b2bb65e8765a0d349530c04716d5e34a22e0d62a61e1a2f127fc4a6ebc05f0b4b1591357fd66
7
- data.tar.gz: bafef4ef1d2f06912ccb0c0dad7d86ed236b6c81862c0309e05fad54de634448d18d78f78bef43d70d1952abaeb38fafb86c7624f015597e6ed5aa46e3dbc602
6
+ metadata.gz: ed03bde1136e78acd711d2b1ffc696306840ca3f5032d8cd90b64f4eba005772c8de0a475035c0441537302f33a28b981f391f992715ef72207ed451b3e4bf74
7
+ data.tar.gz: a4e78a5adafd2cc15e05b113a2146de556bf86312d3cc2f7709b13103ecc7248c150127ff710547e63deb8055e4cf220df7ec963265a3e5b07582bbf6b5802be
@@ -298,6 +298,14 @@ module Wx
298
298
  evt_mousewheel(*args, &block)
299
299
  end
300
300
 
301
+ # Convenience evt_handler to listen to all joystick events.
302
+ def evt_joystick_events(*args, &block)
303
+ evt_joy_button_down(*args, &block)
304
+ evt_joy_button_up(*args, &block)
305
+ evt_joy_move(*args, &block)
306
+ evt_joy_zmove(*args, &block)
307
+ end
308
+
301
309
  # Convenience evt handler to listen to all scrollwin events.
302
310
  def evt_scrollwin(meth = nil, &block)
303
311
  evt_scrollwin_top(meth, &block)
@@ -99,29 +99,6 @@ module Wx
99
99
  # @yieldparam [Wx::CommandEvent] event event to handle
100
100
  def evt_command_range(id1, id2, evt_id, meth = nil, &block) end
101
101
 
102
- # Convenience evt_handler to listen to all mouse events.
103
- # @yieldparam [Wx::MouseEvent] event event to handle
104
- def evt_mouse_events(*args, &block) end
105
-
106
- # Convenience evt handler to listen to all scrollwin events
107
- # (from Wx::ScrolledWindow).
108
- # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
109
- # @yieldparam [Wx::ScrollWinEvent] event event to handle
110
- def evt_scrollwin(meth = nil, &block) end
111
-
112
- # Convenience evt handler to listen to all scroll events
113
- # (from Wx::Slider and Wx::ScrollBar).
114
- # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
115
- # @yieldparam [Wx::ScrollWinEvent] event event to handle
116
- def evt_scroll(meth = nil, &block) end
117
-
118
- # Convenience evt handler to listen to all scroll events
119
- # (from Wx::Slider and Wx::ScrollBar) with an id.
120
- # @param [Integer] id window identifier
121
- # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc
122
- # @yieldparam [Wx::ScrollWinEvent] event event to handle
123
- def evt_scroll_command(id, meth = nil, &block) end
124
-
125
102
  # Processes Wx::WindowDestroyEvent events.
126
103
  # In wxRuby Wx::Event#skipped will be forced to true after the provided
127
104
  # handler has finished to make sure the event is propagated as it is
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.4.2'
6
+ WXRUBY_VERSION = '1.5.0'
7
7
  end
@@ -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
@@ -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) }
@@ -23,10 +23,12 @@ module WXRuby3
23
23
  wxSizeEvent wxMoveEvent wxPaintEvent wxEraseEvent wxFocusEvent wxActivateEvent
24
24
  wxInitDialogEvent wxMenuEvent wxCloseEvent wxShowEvent wxIconizeEvent wxMaximizeEvent
25
25
  wxFullScreenEvent wxJoystickEvent wxDropFilesEvent wxUpdateUIEvent wxSysColourChangedEvent
26
- wxMouseCaptureChangedEvent wxMouseCaptureLostEvent wxDisplayChangedEvent wxDPIChangedEvent
27
- wxPaletteChangedEvent wxQueryNewPaletteEvent wxNavigationKeyEvent wxWindowCreateEvent
28
- wxWindowDestroyEvent wxHelpEvent wxClipboardTextEvent wxContextMenuEvent wxChildFocusEvent
26
+ wxDPIChangedEvent wxPaletteChangedEvent wxQueryNewPaletteEvent wxNavigationKeyEvent
27
+ wxWindowCreateEvent wxWindowDestroyEvent wxHelpEvent wxClipboardTextEvent wxContextMenuEvent wxChildFocusEvent
29
28
  ])
29
+ if Config.instance.features_set?('WXMSW')
30
+ spec.items.concat %w[wxMouseCaptureChangedEvent wxMouseCaptureLostEvent wxDisplayChangedEvent]
31
+ end
30
32
  spec.fold_bases('wxMouseEvent' => %w[wxMouseState wxKeyboardState], 'wxKeyEvent' => 'wxKeyboardState')
31
33
  spec.ignore 'wxShowEvent::GetShow', 'wxIconizeEvent::Iconized'
32
34
  spec.ignore 'wxKeyEvent::GetPosition(wxCoord *,wxCoord *) const'
@@ -554,9 +554,33 @@ module WXRuby3
554
554
  '%constant char* wxGRID_VALUE_DATE = "date";',
555
555
  '%constant char* wxGRID_VALUE_TEXT = "string";',
556
556
  '%constant char* wxGRID_VALUE_LONG = "long";'
557
+ # fix naming mismatch with #evt_grid_cmd_col_size
558
+ spec.add_swig_code '%constant int EVT_GRID_CMD_COL_SIZE = wxEVT_GRID_COL_SIZE;',
559
+ '%constant int EVT_GRID_CMD_ROW_SIZE = wxEVT_GRID_ROW_SIZE;',
560
+ '%constant int EVT_GRID_CMD_EDITOR_CREATED = wxEVT_GRID_EDITOR_CREATED;',
561
+ '%constant int EVT_GRID_CMD_RANGE_SELECTING = wxEVT_GRID_RANGE_SELECTING;',
562
+ '%constant int EVT_GRID_CMD_RANGE_SELECTED = wxEVT_GRID_RANGE_SELECTED;'
563
+ end
564
+
565
+ def doc_generator
566
+ GridCtrlDocGenerator.new(self)
557
567
  end
558
568
  end # class GridCtrl
559
569
 
560
570
  end # class Director
561
571
 
572
+ class GridCtrlDocGenerator < DocGenerator
573
+
574
+ protected def gen_constants_doc(fdoc)
575
+ super
576
+ xref_table = package.all_modules.reduce(DocGenerator.constants_db) { |db, mod| db[mod] }
577
+ gen_constant_doc(fdoc, 'EVT_GRID_CMD_COL_SIZE', xref_table['EVT_GRID_COL_SIZE'], 'wxRuby specific alias for Wx::EVT_GRID_COL_SIZE')
578
+ gen_constant_doc(fdoc, 'EVT_GRID_CMD_ROW_SIZE', xref_table['EVT_GRID_ROW_SIZE'], 'wxRuby specific alias for Wx::EVT_GRID_ROW_SIZE')
579
+ gen_constant_doc(fdoc, 'EVT_GRID_CMD_EDITOR_CREATED', xref_table['EVT_GRID_EDITOR_CREATED'], 'wxRuby specific alias for Wx::EVT_GRID_EDITOR_CREATED')
580
+ gen_constant_doc(fdoc, 'EVT_GRID_CMD_RANGE_SELECTING', xref_table['EVT_GRID_RANGE_SELECTING'], 'wxRuby specific alias for Wx::wxEVT_GRID_RANGE_SELECTING')
581
+ gen_constant_doc(fdoc, 'EVT_GRID_CMD_RANGE_SELECTED', xref_table['EVT_GRID_RANGE_SELECTED'], 'wxRuby specific alias for Wx::wxEVT_GRID_RANGE_SELECTED')
582
+ end
583
+
584
+ end
585
+
562
586
  end # module WXRuby3
@@ -12,6 +12,8 @@ module WXRuby3
12
12
 
13
13
  class HtmlPrintout < Director
14
14
 
15
+ include Typemap::PrintPageRange
16
+
15
17
  def setup
16
18
  super
17
19
  spec.override_inheritance_chain('wxHtmlPrintout', {'wxPrintout' => 'wxPrinter'}, 'wxObject')
@@ -12,6 +12,8 @@ module WXRuby3
12
12
 
13
13
  class PrintData < Director
14
14
 
15
+ include Typemap::PrintPageRange
16
+
15
17
  def setup
16
18
  super
17
19
  spec.gc_as_untracked
@@ -21,6 +23,11 @@ module WXRuby3
21
23
  # only keep the const version
22
24
  spec.ignore 'wxPageSetupDialogData::GetPrintData'
23
25
  spec.regard 'wxPageSetupDialogData::GetPrintData() const'
26
+ if Config.instance.wx_version >= '3.3.0'
27
+ # new since 3.3.0
28
+ spec.items << 'wxPrintPageRange'
29
+ spec.regard 'wxPrintPageRange::fromPage', 'wxPrintPageRange::toPage' # include public attributes
30
+ end
24
31
  # for GetPrintData methods
25
32
  spec.map 'wxPrintData&' => 'Wx::PrintData' do
26
33
  map_out code: '$result = SWIG_NewPointerObj(SWIG_as_voidptr(new wxPrintData(*$1)), SWIGTYPE_p_wxPrintData, SWIG_POINTER_OWN);'
@@ -12,6 +12,8 @@ module WXRuby3
12
12
 
13
13
  class Printer < Director
14
14
 
15
+ include Typemap::PrintPageRange
16
+
15
17
  def setup
16
18
  super
17
19
  spec.items << 'wxPrintout' << 'wxPrintPreview'
@@ -12,6 +12,8 @@ module WXRuby3
12
12
 
13
13
  class RichTextPrinting < Director
14
14
 
15
+ include Typemap::PrintPageRange
16
+
15
17
  def setup
16
18
  spec.items << 'wxRichTextPrintout'
17
19
  super
@@ -20,9 +20,26 @@ module WXRuby3
20
20
  # is missing from the XML docs
21
21
  spec.extend_interface('wxSplitterWindow', 'virtual void OnInternalIdle()')
22
22
  super
23
+ # fix naming mismatch with #evt_splitter_dclick
24
+ spec.add_swig_code '%constant int EVT_SPLITTER_DCLICK = wxEVT_SPLITTER_DOUBLECLICKED;'
23
25
  end
26
+
27
+ def doc_generator
28
+ SplitterWindowDocGenerator.new(self)
29
+ end
30
+
24
31
  end # class SplitterWindow
25
32
 
26
33
  end # class Director
27
34
 
35
+ class SplitterWindowDocGenerator < DocGenerator
36
+
37
+ protected def gen_constants_doc(fdoc)
38
+ super
39
+ xref_table = package.all_modules.reduce(DocGenerator.constants_db) { |db, mod| db[mod] }
40
+ gen_constant_doc(fdoc, 'EVT_SPLITTER_DCLICK', xref_table['EVT_SPLITTER_DOUBLECLICKED'], 'wxRuby specific alias for Wx::EVT_SPLITTER_DOUBLECLICKED')
41
+ end
42
+
43
+ end
44
+
28
45
  end # module WXRuby3
@@ -24,11 +24,28 @@ module WXRuby3
24
24
  spec.ignore 'wxTextCtrl::GTKGetTextBuffer',
25
25
  'wxTextCtrl::GTKGetEditable'
26
26
  end
27
- if Config.instance.wx_version >= '3.3.0' && Config.instance.wx_port == :wxmsw
27
+ if Config.instance.wx_version >= '3.3.0'
28
28
  spec.items << 'wxTextSearch' << 'wxTextSearchResult'
29
- spec.regard 'wxTextSearchResult::m_start', 'wxTextSearchResult::m_end'
30
- spec.make_readonly 'wxTextSearchResult::m_start', 'wxTextSearchResult::m_end'
31
- spec.rename_for_ruby 'start' => 'wxTextSearchResult::m_start',
29
+ spec.regard 'wxTextSearch::m_searchValue',
30
+ 'wxTextSearch::m_startingPosition',
31
+ 'wxTextSearch::m_matchCase',
32
+ 'wxTextSearch::m_wholeWord',
33
+ 'wxTextSearch::m_direction',
34
+ 'wxTextSearchResult::m_start',
35
+ 'wxTextSearchResult::m_end'
36
+ spec.make_readonly 'wxTextSearch::m_searchValue',
37
+ 'wxTextSearch::m_startingPosition',
38
+ 'wxTextSearch::m_matchCase',
39
+ 'wxTextSearch::m_wholeWord',
40
+ 'wxTextSearch::m_direction',
41
+ 'wxTextSearchResult::m_start',
42
+ 'wxTextSearchResult::m_end'
43
+ spec.rename_for_ruby 'get_search_value' => 'wxTextSearch::m_searchValue',
44
+ 'get_starting_position' => 'wxTextSearch::m_startingPosition',
45
+ 'match_case?' => 'wxTextSearch::m_matchCase',
46
+ 'whole_word?' => 'wxTextSearch::m_wholeWord',
47
+ 'get_direction' => 'wxTextSearch::m_direction',
48
+ 'start' => 'wxTextSearchResult::m_start',
32
49
  'end' => 'wxTextSearchResult::m_end'
33
50
  end
34
51
  if Config.instance.wx_port == :wxqt
@@ -8,6 +8,14 @@
8
8
 
9
9
  module WXRuby3
10
10
 
11
+ Director::Package.ignored_event_handlers.merge(%w[
12
+ EVT_SCROLL
13
+ EVT_COMMAND_SCROLL
14
+ EVT_SCROLLWIN
15
+ EVT_MOUSE_EVENTS
16
+ EVT_JOYSTICK_EVENTS
17
+ ])
18
+
11
19
  Director.Package('Wx') { |pkg|
12
20
  Director.Spec(pkg, 'wxDefs')
13
21
  Director.Spec(pkg, 'wxFunctions')
@@ -0,0 +1,97 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ ###
6
+ # wxRuby3 PrintPageRange array typemap definition
7
+ ###
8
+
9
+ require_relative '../core/mapping'
10
+
11
+ module WXRuby3
12
+
13
+ module Typemap
14
+
15
+ # Typemaps for converting returned PGCell references to
16
+ # either the correct wxRuby class
17
+ module PrintPageRange
18
+
19
+ include Typemap::Module
20
+
21
+ define do
22
+
23
+ if Config.instance.wx_version >= '3.3.0'
24
+ map 'const std::vector<wxPrintPageRange> &' => 'Array<Wx::PRT::PrintPageRange>' do
25
+ map_out code: <<~__CODE
26
+ $result = rb_ary_new();
27
+ for (const wxPrintPageRange& range : *$1)
28
+ {
29
+ VALUE r_range = SWIG_NewPointerObj(new wxPrintPageRange(range), SWIGTYPE_p_wxPrintPageRange, SWIG_POINTER_OWN);
30
+ rb_ary_push($result, r_range);
31
+ }
32
+ __CODE
33
+ map_in temp: 'std::vector<wxPrintPageRange> tmp', code: <<~__CODE
34
+ if (TYPE($input) == T_ARRAY)
35
+ {
36
+ $1 = &tmp;
37
+ for (int i = 0; i < RARRAY_LEN($input); i++)
38
+ {
39
+ void *ptr;
40
+ VALUE r_range = rb_ary_entry($input, i);
41
+ int res = SWIG_ConvertPtr(r_range, &ptr, SWIGTYPE_p_wxPrintPageRange, 0);
42
+ if (!SWIG_IsOK(res) || !ptr) {
43
+ rb_raise(rb_eTypeError, "Expected Array of Wx::PRT::PrintPageRange for 1");
44
+ }
45
+ wxPrintPageRange *range = reinterpret_cast< wxPrintPageRange * >(ptr);
46
+ $1->push_back(*range);
47
+ }
48
+ }
49
+ else {
50
+ rb_raise(rb_eArgError, "Expected Array of Wx::PRT::PrintPageRange for 1");
51
+ }
52
+ __CODE
53
+ end
54
+
55
+ map 'std::vector<wxPrintPageRange> &' => 'Array<Wx::PRT::PrintPageRange>' do
56
+
57
+ map_in temp: 'std::vector<wxPrintPageRange> tmp_vector', code: '$1 = &tmp_vector;'
58
+
59
+ map_argout code: <<~__CODE
60
+ for (const wxPrintPageRange& range : *$1)
61
+ {
62
+ VALUE r_range = SWIG_NewPointerObj(new wxPrintPageRange(range), SWIGTYPE_p_wxPrintPageRange, SWIG_POINTER_OWN);
63
+ rb_ary_push($input, r_range);
64
+ }
65
+ __CODE
66
+
67
+ map_directorin code: '$input = rb_ary_new();'
68
+
69
+ map_directorargout code: <<~__CODE
70
+ for (int i = 0; i < RARRAY_LEN($result); i++)
71
+ {
72
+ void *ptr;
73
+ VALUE r_range = rb_ary_entry($result, i);
74
+ int res = SWIG_ConvertPtr(r_range, &ptr, SWIGTYPE_p_wxPrintPageRange, 0);
75
+ if (!SWIG_IsOK(res) || !ptr) {
76
+ Swig::DirectorTypeMismatchException::raise(swig_get_self(), "$symname", rb_eTypeError,
77
+ "expected Array of Wx::PRT::PrintPageRange in argument 1");
78
+ }
79
+ wxPrintPageRange *range = reinterpret_cast< wxPrintPageRange * >(ptr);
80
+ $1.push_back(*range);
81
+ }
82
+ __CODE
83
+
84
+ end
85
+ end
86
+ # Doc only mapping def
87
+ map 'std::vector<wxPrintPageRange> &' => 'Array<Wx::PRT::PrintPageRange>', swig: false do
88
+ map_in
89
+ end
90
+
91
+ end
92
+
93
+ end
94
+
95
+ end
96
+
97
+ end
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.4.2
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2024-12-29 00:00:00.000000000 Z
10
+ date: 2025-01-30 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: nokogiri
@@ -820,6 +820,7 @@ files:
820
820
  - rakelib/lib/typemap/pgprop_arg.rb
821
821
  - rakelib/lib/typemap/pgproperty.rb
822
822
  - rakelib/lib/typemap/points_list.rb
823
+ - rakelib/lib/typemap/print_page_range.rb
823
824
  - rakelib/lib/typemap/richtext.rb
824
825
  - rakelib/lib/typemap/tree_itemid.rb
825
826
  - rakelib/lib/util/string.rb