diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 67309765..7403ad19 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -50,7 +50,7 @@ jobs: CC: gcc-9 CXX: g++-9 ruby: '2.5' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true @@ -61,7 +61,7 @@ jobs: CC: gcc-10 CXX: g++-10 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true @@ -72,7 +72,7 @@ jobs: CC: gcc-11 CXX: g++-11 ruby: '3.0' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true @@ -83,7 +83,7 @@ jobs: CC: gcc-12 CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true @@ -94,7 +94,7 @@ jobs: CC: gcc-12 CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true @@ -105,7 +105,7 @@ jobs: CC: gcc-12 CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index acf04df9..f1cf0279 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -52,7 +52,7 @@ jobs: - name: wxMac macOS 11 runner: macos-11 arch: x86_64 - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' ruby: '3.2' swig: '4' configure_flags: --disable-sys-libs @@ -61,7 +61,7 @@ jobs: - name: wxMac macOS 13 runner: macos-13 arch: x86_64 - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' ruby: '3.2' swig: '4' configure_flags: --disable-sys-libs @@ -70,7 +70,7 @@ jobs: - name: wxMac macOS 13 runner: macos-13 arch: x86_64 - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' ruby: '3.2' swig: '4' configure_flags: --disable-sys-libs @@ -79,7 +79,7 @@ jobs: - name: wxMac macOS 13 runner: macos-13 arch: x86_64 - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' ruby: '3.2' swig: '4' configure_flags: --disable-sys-libs @@ -88,7 +88,7 @@ jobs: - name: wxMac macOS 13 runner: macos-13 arch: x86_64 - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' ruby: '3.2' swig: '4' configure_flags: --disable-sys-libs diff --git a/.github/workflows/msw.yml b/.github/workflows/msw.yml index 895392ae..33968714 100644 --- a/.github/workflows/msw.yml +++ b/.github/workflows/msw.yml @@ -54,7 +54,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '2.7' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' wxw_type: embed wxr_type: develop @@ -62,7 +62,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' wxw_type: embed wxr_type: develop @@ -70,7 +70,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' wxw_type: develop wxr_type: develop @@ -78,7 +78,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' wxw_type: embed wxr_type: bingem @@ -86,7 +86,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' wxw_type: embed wxr_type: gem diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9cf76913..1b3f0bd7 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -82,7 +82,7 @@ jobs: - name: Generate wxRuby3 docs run: | - BUILD_CMD="bundle exec rake doc" + BUILD_CMD="bundle exec rake doc WXRUBY_FULLDOCS=1" /bin/bash -o pipefail -c "xvfb-run -a -s '-screen 0 1600x1200x24' $BUILD_CMD 2>&1 | tee -a gembuild.out" || rc=$? if [ -n "$rc" ]; then if fgrep -q '(core dumped)' gembuild.out; then @@ -96,10 +96,6 @@ jobs: run: | bundle exec yardoc - - name: Copy assets into HTML output folder - run: | - cp -r assets rdoc - - name: Setup Pages uses: actions/configure-pages@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 493a497c..a02ca4f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,7 @@ jobs: CC: gcc-12 CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' configure_flags: use_xvfb: true @@ -197,7 +197,7 @@ jobs: - name: wxMac macOS 13 runner: macos-13 arch: x86_64 - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' ruby: '3.2' swig: '4' configure_flags: --disable-sys-libs @@ -294,7 +294,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' steps: @@ -376,7 +376,7 @@ jobs: platform: 'x64' CXX: g++-12 ruby: '3.2' - wxWidgets: '3.2.2.1' + wxWidgets: '3.2.4' swig: '4' steps: diff --git a/.yardopts b/.yardopts index 4ebd756a..c5c6d6bd 100644 --- a/.yardopts +++ b/.yardopts @@ -3,6 +3,7 @@ --charset UTF-8 --markup markdown --readme README.md +--asset assets --title "wxRuby3 API Documentation" --output-dir rdoc --protected diff --git a/ext/wxruby3/include/wxruby-Config.h b/ext/wxruby3/include/wxruby-Config.h index b198fcf0..cb3f9ec9 100644 --- a/ext/wxruby3/include/wxruby-Config.h +++ b/ext/wxruby3/include/wxruby-Config.h @@ -456,7 +456,7 @@ class wxRbHashConfig : public wxConfigBase } #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG - virtual bool DoReadLongLong(const wxString& key, wxLongLong_t *pll) const + virtual bool DoReadLongLong(const wxString& key, wxLongLong_t *pll) const override { wxConfigPathChanger path(this, key); @@ -487,7 +487,7 @@ class wxRbHashConfig : public wxConfigBase } #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG - virtual bool DoReadDouble(const wxString& key, double* val) const + virtual bool DoReadDouble(const wxString& key, double* val) const override { wxConfigPathChanger path(this, key); @@ -517,7 +517,7 @@ class wxRbHashConfig : public wxConfigBase } } - virtual bool DoReadBool(const wxString& key, bool* val) const + virtual bool DoReadBool(const wxString& key, bool* val) const override { wxConfigPathChanger path(this, key); @@ -637,7 +637,7 @@ class wxRbHashConfig : public wxConfigBase } #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG - virtual bool DoWriteLongLong(const wxString& key, wxLongLong_t value) + virtual bool DoWriteLongLong(const wxString& key, wxLongLong_t value) override { wxConfigPathChanger path(this, key); wxString strName = path.Name(); @@ -675,7 +675,7 @@ class wxRbHashConfig : public wxConfigBase } #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG - virtual bool DoWriteDouble(const wxString& key, double value) + virtual bool DoWriteDouble(const wxString& key, double value) override { wxConfigPathChanger path(this, key); wxString strName = path.Name(); @@ -712,7 +712,7 @@ class wxRbHashConfig : public wxConfigBase return true; } - virtual bool DoWriteBool(const wxString& key, bool value) + virtual bool DoWriteBool(const wxString& key, bool value) override { wxConfigPathChanger path(this, key); wxString strName = path.Name(); diff --git a/lib/wx/doc/app.rb b/lib/wx/doc/app.rb index 4ab725be..3c9c35b3 100644 --- a/lib/wx/doc/app.rb +++ b/lib/wx/doc/app.rb @@ -5,42 +5,52 @@ # :startdoc: -class Wx::App - - # Set the menu item id for the About menu item. - # Default is {Wx::ID_ABOUT} - # @param [Integer] id - def set_mac_about_menu_itemid(id) end - alias :mac_about_menu_itemid= :set_mac_about_menu_itemid - - # Get the current menu item id for the About menu item. - # Default is {Wx::ID_ABOUT} - # @return [Integer] - def get_mac_about_menu_itemid(id) end - alias :mac_about_menu_itemid :get_mac_about_menu_itemid - - # Set the menu item id for the Preferences menu item. - # Default is {Wx::ID_PREFERENCES} - # @param [Integer] id - def set_mac_preferences_menu_itemid(id) end - alias :mac_preferences_menu_itemid= :set_mac_preferences_menu_itemid - - # Get the current menu item id for the Preferences menu item. - # Default is {Wx::ID_PREFERENCES} - # @return [Integer] - def get_mac_preferences_menu_itemid(id) end - alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid - - # Set the menu item id for the Exit menu item. - # Default is {Wx::ID_EXIT} - # @param [Integer] id - def set_mac_exit_menu_itemid(id) end - alias :mac_exit_menu_itemid= :set_mac_exit_menu_itemid - - # Get the current menu item id for the Exit menu item. - # Default is {Wx::ID_EXIT} - # @return [Integer] - def get_mac_exit_menu_itemid(id) end - alias :mac_exit_menu_itemid :get_mac_exit_menu_itemid - +module Wx + + class App + + # Set the menu item id for the About menu item. + # Default is {Wx::ID_ABOUT} + # @param [Integer] id + # @wxrb_require WXOSX + def set_mac_about_menu_itemid(id) end + alias :mac_about_menu_itemid= :set_mac_about_menu_itemid + + # Get the current menu item id for the About menu item. + # Default is {Wx::ID_ABOUT} + # @return [Integer] + # @wxrb_require WXOSX + def get_mac_about_menu_itemid(id) end + alias :mac_about_menu_itemid :get_mac_about_menu_itemid + + # Set the menu item id for the Preferences menu item. + # Default is {Wx::ID_PREFERENCES} + # @param [Integer] id + # @wxrb_require WXOSX + def set_mac_preferences_menu_itemid(id) end + alias :mac_preferences_menu_itemid= :set_mac_preferences_menu_itemid + + # Get the current menu item id for the Preferences menu item. + # Default is {Wx::ID_PREFERENCES} + # @return [Integer] + # @wxrb_require WXOSX + def get_mac_preferences_menu_itemid(id) end + alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid + + # Set the menu item id for the Exit menu item. + # Default is {Wx::ID_EXIT} + # @param [Integer] id + # @wxrb_require WXOSX + def set_mac_exit_menu_itemid(id) end + alias :mac_exit_menu_itemid= :set_mac_exit_menu_itemid + + # Get the current menu item id for the Exit menu item. + # Default is {Wx::ID_EXIT} + # @return [Integer] + # @wxrb_require WXOSX + def get_mac_exit_menu_itemid(id) end + alias :mac_exit_menu_itemid :get_mac_exit_menu_itemid + + end + end diff --git a/lib/wx/doc/art_locator.rb b/lib/wx/doc/art_locator.rb index 967c46b3..fd22da58 100644 --- a/lib/wx/doc/art_locator.rb +++ b/lib/wx/doc/art_locator.rb @@ -9,55 +9,59 @@ # :startdoc: -module Wx::ArtLocator +module Wx - # Default name of art folder. - ART_FOLDER = 'art' + module ArtLocator - class << self + # Default name of art folder. + ART_FOLDER = 'art' - # Returns the base name for the folder holding application art files. - # By default this returns ART_FOLDER - # @return [String] - def art_folder; end + class << self - # Sets the base name for the folder holding application art files. - # @param [String] name art folder base name - def art_folder=(name) end + # Returns the base name for the folder holding application art files. + # By default this returns ART_FOLDER + # @return [String] + def art_folder; end - # Adds one or more search paths to look for art files. - # By default ArtLocator#find_art will look only at locations of the caller's - # file path. If search paths have been added though these will be searched - # after the lookup in the caller's path has failed. - def add_search_path(*names) end - alias :add_search_paths :add_search_path + # Sets the base name for the folder holding application art files. + # @param [String] name art folder base name + def art_folder=(name) end - # Searches for the an art file for the given 'art_name'. - # By default the search will be performed at the following locations (in order): - # 1. /<#art_folder>/// - # 2. /<#art_folder>// - # 3. /<#art_folder>/ - # 4. / - # Where 'art_type' is any of :icon, :bitmap, :cursor, - # :image or nil. If 'art_type' is nil the first location will be skipped. - # In case 'art_path' == nil the absolute path to the folder holding the caller's - # code will be used which is determined through ::Kernel#caller_locations. - # If 'art_section' is also nil the basename of the caller's source file will be used. - # At each location the existence of a file with base name 'art_name' and each of the supported - # extensions for the given 'art_type' (see wxWidgets documentation) will be tested. If 'art_type' is nil - # all extensions for all supported bitmap types will be tested (similar to when 'art_type' is :image). - # If an optional Wx::BitmapType is specified through 'bmp_type' the tested extensions will - # be restricted to the extensions supported for specified the bitmap type. - # - # In case additional search paths have been specified through #add_search_path these will be - # searched after the lookup at 'art_path' fails. For each search path the same lookups - # will be performed (replacing 'art_path' by the search path). - # @param [String,Symbol] art_name base name for art file - # @param [Symbol,nil] art_type type of art to look for (:icon, :bitmap, :cursor, :image) - # @param [String,nil] art_path base path to look up the art file - # @param [String,nil] art_section optional owner folder name for art files - # @param [Wx::BitmapType,nil] bmp_type bitmap type of art file - def find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil) end + # Adds one or more search paths to look for art files. + # By default ArtLocator#find_art will look only at locations of the caller's + # file path. If search paths have been added though these will be searched + # after the lookup in the caller's path has failed. + def add_search_path(*names) end + alias :add_search_paths :add_search_path + + # Searches for the an art file for the given 'art_name'. + # By default the search will be performed at the following locations (in order): + # 1. /<#art_folder>/// + # 2. /<#art_folder>// + # 3. /<#art_folder>/ + # 4. / + # Where 'art_type' is any of :icon, :bitmap, :cursor, + # :image or nil. If 'art_type' is nil the first location will be skipped. + # In case 'art_path' == nil the absolute path to the folder holding the caller's + # code will be used which is determined through ::Kernel#caller_locations. + # If 'art_section' is also nil the basename of the caller's source file will be used. + # At each location the existence of a file with base name 'art_name' and each of the supported + # extensions for the given 'art_type' (see wxWidgets documentation) will be tested. If 'art_type' is nil + # all extensions for all supported bitmap types will be tested (similar to when 'art_type' is :image). + # If an optional Wx::BitmapType is specified through 'bmp_type' the tested extensions will + # be restricted to the extensions supported for specified the bitmap type. + # + # In case additional search paths have been specified through #add_search_path these will be + # searched after the lookup at 'art_path' fails. For each search path the same lookups + # will be performed (replacing 'art_path' by the search path). + # @param [String,Symbol] art_name base name for art file + # @param [Symbol,nil] art_type type of art to look for (:icon, :bitmap, :cursor, :image) + # @param [String,nil] art_path base path to look up the art file + # @param [String,nil] art_section optional owner folder name for art files + # @param [Wx::BitmapType,nil] bmp_type bitmap type of art file + def find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil) end + + end end diff --git a/lib/wx/doc/aui/auimanager.rb b/lib/wx/doc/aui/auimanager.rb index f02dce68..a5ece6ed 100644 --- a/lib/wx/doc/aui/auimanager.rb +++ b/lib/wx/doc/aui/auimanager.rb @@ -5,14 +5,22 @@ # :startdoc: -class Wx::AUI::AuiManager +module Wx - # Yield each pane to the given block. - # @yieldparam [Wx::AUI::AuiPaneInfo] pane the Aui pane info yielded - def each_pane; end + module AUI + + class AuiManager + + # Yield each pane to the given block. + # @yieldparam [Wx::AUI::AuiPaneInfo] pane the Aui pane info yielded + def each_pane; end + + # Returns an array of all panes managed by the frame manager. + # @return [Array] all managed panes + def get_all_panes; end + alias_method :all_panes, :get_all_panes + end + + end - # Returns an array of all panes managed by the frame manager. - # @return [Array] all managed panes - def get_all_panes; end - alias_method :all_panes, :get_all_panes end diff --git a/lib/wx/doc/aui/auinotebook.rb b/lib/wx/doc/aui/auinotebook.rb index ce11c7bc..3e012b6e 100644 --- a/lib/wx/doc/aui/auinotebook.rb +++ b/lib/wx/doc/aui/auinotebook.rb @@ -5,18 +5,26 @@ # :startdoc: -class Wx::AUI::AuiNotebook - - # Iterate each notebook page. - # Passes each page to the given block. - # Returns an Enumerator if no block given. - # @yieldparam [Wx::Window] page notebook page - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def each_page; end - - # Finds tab control and its tab index associated with a given window. - # @param [Wx::Window] page the notebook page window - # @return [Array, nil] tab control and index if found else nil - def find_tab(page) end +module Wx + + module AUI + + class AuiNotebook + + # Iterate each notebook page. + # Passes each page to the given block. + # Returns an Enumerator if no block given. + # @yieldparam [Wx::Window] page notebook page + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def each_page; end + + # Finds tab control and its tab index associated with a given window. + # @param [Wx::Window] page the notebook page window + # @return [Array, nil] tab control and index if found else nil + def find_tab(page) end + + end + + end end diff --git a/lib/wx/doc/clipboard.rb b/lib/wx/doc/clipboard.rb index 80c06f46..87c4cd29 100644 --- a/lib/wx/doc/clipboard.rb +++ b/lib/wx/doc/clipboard.rb @@ -5,14 +5,18 @@ # :startdoc: -class Wx::Clipboard +module Wx - alias :place :set_data - alias :fetch :get_data + class Clipboard - # Opens the global clipboard and passes the clipboard object to the block. - # @yieldparam [Wx::Clipboard] clip the global clipboard object - # @return [Object] block result - def self.open; end + alias :place :set_data + alias :fetch :get_data + + # Opens the global clipboard and passes the clipboard object to the block. + # @yieldparam [Wx::Clipboard] clip the global clipboard object + # @return [Object] block result + def self.open; end + + end end diff --git a/lib/wx/doc/colour_dialog.rb b/lib/wx/doc/colour_dialog.rb index d9e5e067..8d6f6cdb 100644 --- a/lib/wx/doc/colour_dialog.rb +++ b/lib/wx/doc/colour_dialog.rb @@ -5,17 +5,21 @@ # :startdoc: -class Wx::ColourDialog +module Wx - # Returns (a copy of) the colour data of the dialog. - # @return [Wx::ColourData] colour data copy - def get_colour_data; end - alias :colour_data :get_colour_data + class ColourDialog - # Updates the colour data for the dialog. - # @param [Wx::ColourData] clr_data the colour data to update the dialog with - # @return [void] - def set_colour_data(clr_data); end - alias :colour_data= :set_colour_data + # Returns (a copy of) the colour data of the dialog. + # @return [Wx::ColourData] colour data copy + def get_colour_data; end + alias :colour_data :get_colour_data + + # Updates the colour data for the dialog. + # @param [Wx::ColourData] clr_data the colour data to update the dialog with + # @return [void] + def set_colour_data(clr_data); end + alias :colour_data= :set_colour_data + + end end diff --git a/lib/wx/doc/controlwithitems.rb b/lib/wx/doc/controlwithitems.rb index 7b0a9235..e36b6921 100644 --- a/lib/wx/doc/controlwithitems.rb +++ b/lib/wx/doc/controlwithitems.rb @@ -5,19 +5,23 @@ # :startdoc: -class Wx::ControlWithItems +module Wx - # Yield each string to the given block. - # Returns an Enumerator if no block given. - # @yieldparam [String] string the string yielded - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def each_string; end + class ControlWithItems - # Returns true if the items in the control are sorted - # (style Wx::LB_SORT for list boxes or Wx::CB_SORT for combo boxes). - # This method is mostly meant for internal use only. - # @return [Boolean] true is sorted, false otherwise - def is_sorted; end - alias :sorted? :is_sorted + # Yield each string to the given block. + # Returns an Enumerator if no block given. + # @yieldparam [String] string the string yielded + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def each_string; end + + # Returns true if the items in the control are sorted + # (style Wx::LB_SORT for list boxes or Wx::CB_SORT for combo boxes). + # This method is mostly meant for internal use only. + # @return [Boolean] true is sorted, false otherwise + def is_sorted; end + alias :sorted? :is_sorted + + end end diff --git a/lib/wx/doc/data_object.rb b/lib/wx/doc/data_object.rb index 8b28bd5a..b005b7ad 100644 --- a/lib/wx/doc/data_object.rb +++ b/lib/wx/doc/data_object.rb @@ -27,7 +27,7 @@ def get_data_size(format) end # so the number of virtual functions to be implemented is reduced. # This class is the base class for {Wx::TextDataObject}, {Wx::FileDataObject}, {Wx::BitmapDataObject}, # {Wx::wxCustomDataObject} and others. - # === + # # # Category: Clipboard and Drag & Drop # @see Drag and Drop Overview @@ -74,7 +74,7 @@ def set_data(*) end # The objects which may be set must override {Wx::DataObjectSimpleBase#_set_data} (which # returns false). # Of course, the objects supporting both operations must override all three methods. - # === + # # # Category: Clipboard and Drag & Drop # @see Drag and Drop Overview diff --git a/lib/wx/doc/evthandler.rb b/lib/wx/doc/evthandler.rb index 01c498d6..957f45eb 100644 --- a/lib/wx/doc/evthandler.rb +++ b/lib/wx/doc/evthandler.rb @@ -9,112 +9,117 @@ -class Wx::EvtHandler - - # Removes all (Ruby) installed EventFilter-s. - # @return [void] - def self.clear_filters; end - - # Public method to register the mapping of a custom event type - # +konstant+ (which should be a unique integer; one will be created if - # not supplied) to a custom event class +klass+. If +meth+ and +arity+ - # are given, a convenience evt_handler method called +meth+ will be - # created, which accepts +arity+ arguments (specify both or neither). - # @param klass [Class] event class - # @param konstant [Integer] unique event type id (if nil a unique value will be autogenerated) - # @param meth [String,Symbol] optional event handler method name - # @param arity [Integer] event handler method arity (should be 0, 1 or 2 if not nil) - # @return [Integer] unique event type id - def self.register_class(klass, konstant = nil, meth = nil, arity = nil) end - - def connect(first_id, last_id, evt_type, handler) end - - def disconnect(first_id, last_id, evt_spec) end - - # Processes an event, searching event tables and calling zero or more suitable event handler function(s). - # - # Normally, your application would not call this function: it is called in the wxWidgets implementation to - # dispatch incoming user interface events to the framework (and application). - # - # However, you might need to call it if implementing new functionality (such as a new control) where you - # define new event types, as opposed to allowing the user to override virtual functions. - # - # In wxRuby this method can not be effectively overridden. - # In order to override default event processing define a try_before(event) or try_after(event) method - # as member of a derived EvtHandler class. - # - # The normal order of event table searching is as follows: - # - # 1. {Wx::App#filter_event} is called. If it returns anything but -1 (default) the processing stops here. - # 2. #try_before (if it exists, otherwise the C++ default implementation) is called (this is where {Wx::Validator} are taken into account for {Wx::Window} objects). If this returns true, the function exits. - # 3. If the object is disabled (via a call to {Wx::EvtHandler#set_evt_handler_enabled}) the function skips to step (7). - # 4. Dynamic event table of the handlers bound using Bind<>() is searched in the most-recently-bound to the most-early-bound order. If a handler is found, it is executed and the function returns true unless the handler used {Wx::Event#skip} to indicate that it didn't handle the event in which case the search continues. - # 5. Static events table of the handlers bound using event table macros is searched for this event handler in the order of appearance of event table macros in the source code. If this fails, the base class event table is tried, and so on until no more tables exist or an appropriate function was found. If a handler is found, the same logic as in the previous step applies. - # 6. The search is applied down the entire chain of event handlers (usually the chain has a length of one). This chain can be formed using {Wx::EvtHandler#set_next_handler} - # Note that in the case of Wx::Window you can build a stack of event handlers (see {Wx::Window#push_event_handler} for more info). If any of the handlers of the chain return true, the function exits. - # 7. #try_after (if it exists, otherwise the C++ default implementation) is called: for the {Wx::Window} object this may propagate the event to the window parent (recursively). If the event is still not processed, {#process_event} on the {Wx::THE_APP} object is called as the last step. - # - # Notice that steps (2)-(6) are performed in {#process_event_locally} which is called by this function. - # - # @param event [Wx::Event] Event to process. - # @return [true,false] true if event has been processed - def process_event(event) end - - # Process a command, supplying the window identifier, command event identifier, and member function or proc. - # @param [Integer] id window identifier - # @param [Integer] evt_id event type identifier - # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc - # @yieldparam [Wx::CommandEvent] event event to handle - def evt_command(id, evt_id, meth = nil, &block) end - - # Process a command for a range of window identifiers, supplying the minimum and maximum window identifiers, command event identifier, and member function or proc. - # @param [Integer] id1 minimum window identifier - # @param [Integer] id2 maximum window identifier - # @param [Integer] evt_id event type identifier - # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc - # @yieldparam [Wx::CommandEvent] event event to handle - def evt_command_range(id1, id2, evt_id, meth = nil, &block) end - - # Convenience evt_handler to listen to all mouse events. - # @yieldparam [Wx::MouseEvent] event event to handle - def evt_mouse_events(*args, &block) end - - # Convenience evt handler to listen to all scrollwin events - # (from Wx::ScrolledWindow). - # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc - # @yieldparam [Wx::ScrollWinEvent] event event to handle - def evt_scrollwin(meth = nil, &block) end - - # Convenience evt handler to listen to all scroll events - # (from Wx::Slider and Wx::ScrollBar). - # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc - # @yieldparam [Wx::ScrollWinEvent] event event to handle - def evt_scroll(meth = nil, &block) end - - # Convenience evt handler to listen to all scroll events - # (from Wx::Slider and Wx::ScrollBar) with an id. - # @param [Integer] id window identifier - # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc - # @yieldparam [Wx::ScrollWinEvent] event event to handle - def evt_scroll_command(id, meth = nil, &block) end - - # Processes Wx::WindowDestroyEvent events. - # In wxRuby Wx::Event#skipped will be forced to true after the provided - # handler has finished to make sure the event is propagated as it is - # required that Wx::App gets to handle the event in the end. - # @yieldparam [Wx::WindowDestroyEvent] event event to handle - def evt_window_destroy(&block) end - - # Processes {Wx::EVT_TIMER} events. See {Wx::TimerEvent}. - # @param [Integer,Wx::Enum,Wx::Timer] id timer id - # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc - # @yieldparam [Wx::TimerEvent] event the event to handle - def evt_timer(id, meth = nil, &block) end - - # Schedule a call for asynchronous execution (at idle time). - # @param meth [Symbol,String,Method,Proc] (name of) method or proc to call - # @param args [Array] optional arguments to pass to the call - # @return [void] - # @yield [*args] optional arguments - def call_after(meth = nil, *args, &block) end +module Wx + + class EvtHandler + + # Removes all (Ruby) installed EventFilter-s. + # @return [void] + def self.clear_filters; end + + # Public method to register the mapping of a custom event type + # +konstant+ (which should be a unique integer; one will be created if + # not supplied) to a custom event class +klass+. If +meth+ and +arity+ + # are given, a convenience evt_handler method called +meth+ will be + # created, which accepts +arity+ arguments (specify both or neither). + # @param klass [Class] event class + # @param konstant [Integer] unique event type id (if nil a unique value will be autogenerated) + # @param meth [String,Symbol] optional event handler method name + # @param arity [Integer] event handler method arity (should be 0, 1 or 2 if not nil) + # @return [Integer] unique event type id + def self.register_class(klass, konstant = nil, meth = nil, arity = nil) end + + def connect(first_id, last_id, evt_type, handler) end + + def disconnect(first_id, last_id, evt_spec) end + + # Processes an event, searching event tables and calling zero or more suitable event handler function(s). + # + # Normally, your application would not call this function: it is called in the wxWidgets implementation to + # dispatch incoming user interface events to the framework (and application). + # + # However, you might need to call it if implementing new functionality (such as a new control) where you + # define new event types, as opposed to allowing the user to override virtual functions. + # + # In wxRuby this method can not be effectively overridden. + # In order to override default event processing define a try_before(event) or try_after(event) method + # as member of a derived EvtHandler class. + # + # The normal order of event table searching is as follows: + # + # 1. {Wx::App#filter_event} is called. If it returns anything but -1 (default) the processing stops here. + # 2. #try_before (if it exists, otherwise the C++ default implementation) is called (this is where {Wx::Validator} are taken into account for {Wx::Window} objects). If this returns true, the function exits. + # 3. If the object is disabled (via a call to {Wx::EvtHandler#set_evt_handler_enabled}) the function skips to step (7). + # 4. Dynamic event table of the handlers bound using Bind<>() is searched in the most-recently-bound to the most-early-bound order. If a handler is found, it is executed and the function returns true unless the handler used {Wx::Event#skip} to indicate that it didn't handle the event in which case the search continues. + # 5. Static events table of the handlers bound using event table macros is searched for this event handler in the order of appearance of event table macros in the source code. If this fails, the base class event table is tried, and so on until no more tables exist or an appropriate function was found. If a handler is found, the same logic as in the previous step applies. + # 6. The search is applied down the entire chain of event handlers (usually the chain has a length of one). This chain can be formed using {Wx::EvtHandler#set_next_handler} + # Note that in the case of Wx::Window you can build a stack of event handlers (see {Wx::Window#push_event_handler} for more info). If any of the handlers of the chain return true, the function exits. + # 7. #try_after (if it exists, otherwise the C++ default implementation) is called: for the {Wx::Window} object this may propagate the event to the window parent (recursively). If the event is still not processed, {#process_event} on the {Wx::THE_APP} object is called as the last step. + # + # Notice that steps (2)-(6) are performed in {#process_event_locally} which is called by this function. + # + # @param event [Wx::Event] Event to process. + # @return [true,false] true if event has been processed + def process_event(event) end + + # Process a command, supplying the window identifier, command event identifier, and member function or proc. + # @param [Integer] id window identifier + # @param [Integer] evt_id event type identifier + # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc + # @yieldparam [Wx::CommandEvent] event event to handle + def evt_command(id, evt_id, meth = nil, &block) end + + # Process a command for a range of window identifiers, supplying the minimum and maximum window identifiers, command event identifier, and member function or proc. + # @param [Integer] id1 minimum window identifier + # @param [Integer] id2 maximum window identifier + # @param [Integer] evt_id event type identifier + # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc + # @yieldparam [Wx::CommandEvent] event event to handle + def evt_command_range(id1, id2, evt_id, meth = nil, &block) end + + # Convenience evt_handler to listen to all mouse events. + # @yieldparam [Wx::MouseEvent] event event to handle + def evt_mouse_events(*args, &block) end + + # Convenience evt handler to listen to all scrollwin events + # (from Wx::ScrolledWindow). + # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc + # @yieldparam [Wx::ScrollWinEvent] event event to handle + def evt_scrollwin(meth = nil, &block) end + + # Convenience evt handler to listen to all scroll events + # (from Wx::Slider and Wx::ScrollBar). + # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc + # @yieldparam [Wx::ScrollWinEvent] event event to handle + def evt_scroll(meth = nil, &block) end + + # Convenience evt handler to listen to all scroll events + # (from Wx::Slider and Wx::ScrollBar) with an id. + # @param [Integer] id window identifier + # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc + # @yieldparam [Wx::ScrollWinEvent] event event to handle + def evt_scroll_command(id, meth = nil, &block) end + + # Processes Wx::WindowDestroyEvent events. + # In wxRuby Wx::Event#skipped will be forced to true after the provided + # handler has finished to make sure the event is propagated as it is + # required that Wx::App gets to handle the event in the end. + # @yieldparam [Wx::WindowDestroyEvent] event event to handle + def evt_window_destroy(&block) end + + # Processes {Wx::EVT_TIMER} events. See {Wx::TimerEvent}. + # @param [Integer,Wx::Enum,Wx::Timer] id timer id + # @param [String,Symbol,Method,Proc] meth (name of) method or event handling proc + # @yieldparam [Wx::TimerEvent] event the event to handle + def evt_timer(id, meth = nil, &block) end + + # Schedule a call for asynchronous execution (at idle time). + # @param meth [Symbol,String,Method,Proc] (name of) method or proc to call + # @param args [Array] optional arguments to pass to the call + # @return [void] + # @yield [*args] optional arguments + def call_after(meth = nil, *args, &block) end + + end + end diff --git a/lib/wx/doc/font.rb b/lib/wx/doc/font.rb index d8c0ccc8..03dcb4fe 100644 --- a/lib/wx/doc/font.rb +++ b/lib/wx/doc/font.rb @@ -6,6 +6,7 @@ module Wx + class Font # @overload find_or_create_font(point_size, family, style, weight, underline=false, facename='', encoding=Wx::FontEncoding::FONTENCODING_DEFAULT) diff --git a/lib/wx/doc/gc_dc.rb b/lib/wx/doc/gc_dc.rb index b4e87d0d..c8c24b57 100644 --- a/lib/wx/doc/gc_dc.rb +++ b/lib/wx/doc/gc_dc.rb @@ -14,10 +14,15 @@ class GCDC < Wx::DC # Creates a Wx::GCDC instance for target and # passes the instance to the given block to draw on. # @overload draw_on(dc) - # @param [Wx::WindowDC,Wx::MemoryDC,Wx::PrinterDC] target DC to draw on + # @param [Wx::WindowDC,Wx::MemoryDC] target DC to draw on # @yieldparam [Wx::GCDC] dc GCDC instance to draw on # @return [Object] result from block # @overload draw_on(dc) + # @param [Wx::PrinterDC] target DC to draw on + # @yieldparam [Wx::GCDC] dc GCDC instance to draw on + # @return [Object] result from block + # @wxrb_require USE_PRINTING_ARCHITECTURE,WXMSW|WXOSX|USE_GTKPRINT + # @overload draw_on(gc) # @param [Wx::GraphicsContext] gc GraphicsContext to draw on # @yieldparam [Wx::GCDC] dc GCDC instance to draw on # @return [Object] result from block diff --git a/lib/wx/doc/graphics_context.rb b/lib/wx/doc/graphics_context.rb index c12a97ca..7fd585fb 100644 --- a/lib/wx/doc/graphics_context.rb +++ b/lib/wx/doc/graphics_context.rb @@ -35,6 +35,7 @@ class GraphicsContext # @see Printing Under Unix (GTK+) # @param printerDC [Wx::PrinterDC] # @return [Wx::GraphicsContext] + # @wxrb_require USE_PRINTING_ARCHITECTURE,WXMSW|WXOSX|USE_GTKPRINT # @overload self.draw_on(image) # Creates a {Wx::GraphicsContext} associated with a {Wx::Image} and passes that object to the given block. # Deletes the gc object after the block returns. diff --git a/lib/wx/doc/help_controller.rb b/lib/wx/doc/help_controller.rb index 0920f16e..9aaa4354 100644 --- a/lib/wx/doc/help_controller.rb +++ b/lib/wx/doc/help_controller.rb @@ -5,16 +5,20 @@ # :startdoc: -class Wx::HelpController +module Wx - # @return [void] Only does something for Wx::HTML::HtmlHelpController - def get_frame_parameters; end + class HelpController -end + # @return [void] Only does something for Wx::HTML::HtmlHelpController + def get_frame_parameters; end + + end + + class ExtHelpController -class Wx::ExtHelpController + # @return [void] Only does something for Wx::HTML::HtmlHelpController + def get_frame_parameters; end - # @return [void] Only does something for Wx::HTML::HtmlHelpController - def get_frame_parameters; end + end end diff --git a/lib/wx/doc/html/html_help_controller.rb b/lib/wx/doc/html/html_help_controller.rb index 294b0315..12c4a1f2 100644 --- a/lib/wx/doc/html/html_help_controller.rb +++ b/lib/wx/doc/html/html_help_controller.rb @@ -5,10 +5,18 @@ # :startdoc: -class Wx::HTML::HelpController +module Wx - # Returns the latest frame size and position settings and whether a new frame is drawn with each invocation. - # @return [Array(Wx::Frame,Wx::Size,Wx::Point,Boolean)] latest frame settings - def get_frame_parameters; end + module HTML + + class HelpController + + # Returns the latest frame size and position settings and whether a new frame is drawn with each invocation. + # @return [Array(Wx::Frame,Wx::Size,Wx::Point,Boolean)] latest frame settings + def get_frame_parameters; end + + end + + end end diff --git a/lib/wx/doc/list_ctrl.rb b/lib/wx/doc/list_ctrl.rb index ae4224bc..fa17ead6 100644 --- a/lib/wx/doc/list_ctrl.rb +++ b/lib/wx/doc/list_ctrl.rb @@ -5,34 +5,38 @@ # :startdoc: -class Wx::ListCtrl - - include Enumerable - - # Iterates all items in the list control passing each item (id) to the given block. - # @yieldparam [Integer] item - # @return [Object] result of last block iteration - def each(&block) end - - # Iterates all selected items in the list control (like #get_next_item(item, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED)) - # passing each item (id) to the given block. - # @yieldparam [Integer] item - # @return [Object] result of last block iteration - def each_selected(&block) end - - # Returns array of selected items. - # @return [Array] selected items - def get_selections; end - - # Call this function to sort the items in the list control. - # The sorting method will call the given block repeatedly to compare two items from the list - # passing the item data for each item as well as the `data` argument given to the #sort_items method. - # The block should return 0 if the items are equal, negative value if the first item is less than the second - # one and positive value if the first one is greater than the second one. - # @param [Object] data user data to pass on to the sorting block - # @yieldparam [Object] item_data1 data for first item - # @yieldparam [Object] item_data2 data for second item - # @yieldparam [Object] data propagated data argument - def sort_items(data = nil, &block) end +module Wx + + class ListCtrl + + include Enumerable + + # Iterates all items in the list control passing each item (id) to the given block. + # @yieldparam [Integer] item + # @return [Object] result of last block iteration + def each(&block) end + + # Iterates all selected items in the list control (like #get_next_item(item, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED)) + # passing each item (id) to the given block. + # @yieldparam [Integer] item + # @return [Object] result of last block iteration + def each_selected(&block) end + + # Returns array of selected items. + # @return [Array] selected items + def get_selections; end + + # Call this function to sort the items in the list control. + # The sorting method will call the given block repeatedly to compare two items from the list + # passing the item data for each item as well as the `data` argument given to the #sort_items method. + # The block should return 0 if the items are equal, negative value if the first item is less than the second + # one and positive value if the first one is greater than the second one. + # @param [Object] data user data to pass on to the sorting block + # @yieldparam [Object] item_data1 data for first item + # @yieldparam [Object] item_data2 data for second item + # @yieldparam [Object] data propagated data argument + def sort_items(data = nil, &block) end + + end end diff --git a/lib/wx/doc/menu.rb b/lib/wx/doc/menu.rb index 85375ac6..c696ffb2 100644 --- a/lib/wx/doc/menu.rb +++ b/lib/wx/doc/menu.rb @@ -5,12 +5,16 @@ # :startdoc: -class Wx::Menu +module Wx - # Yield each menu item to the given block. - # Returns an Enumerator if no block given. - # @yieldparam [Wx::MenuItem] item the menu item yielded - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def each_item; end + class Menu + + # Yield each menu item to the given block. + # Returns an Enumerator if no block given. + # @yieldparam [Wx::MenuItem] item the menu item yielded + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def each_item; end + + end end diff --git a/lib/wx/doc/pg/events.rb b/lib/wx/doc/pg/events.rb index 305e2925..7d3bff09 100644 --- a/lib/wx/doc/pg/events.rb +++ b/lib/wx/doc/pg/events.rb @@ -5,17 +5,21 @@ # :startdoc: -class Wx::EvtHandler +module Wx - # @!group PG Event handler methods + class EvtHandler - # Respond to {Wx::PG::EVT_PG_PAGE_CHANGED} event, generated when selected property page has been changed by the user. - # Processes a {Wx::PG::EVT_PG_PAGE_CHANGED} event. - # @param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] id window/control id - # @param [String,Symbol,Method,Proc] meth (name of) method or handler proc - # @yieldparam [Wx::PG::PropertyGridEvent] event the event to handle - def evt_pg_page_changed(id, meth = nil, &block) end + # @!group PG Event handler methods - # @!endgroup + # Respond to {Wx::PG::EVT_PG_PAGE_CHANGED} event, generated when selected property page has been changed by the user. + # Processes a {Wx::PG::EVT_PG_PAGE_CHANGED} event. + # @param [Integer,Wx::Enum,Wx::Window,Wx::MenuItem,Wx::ToolBarTool,Wx::Timer] id window/control id + # @param [String,Symbol,Method,Proc] meth (name of) method or handler proc + # @yieldparam [Wx::PG::PropertyGridEvent] event the event to handle + def evt_pg_page_changed(id, meth = nil, &block) end + + # @!endgroup + + end end diff --git a/lib/wx/doc/progress_dialog.rb b/lib/wx/doc/progress_dialog.rb index cb5b27bc..8ba9a3f3 100644 --- a/lib/wx/doc/progress_dialog.rb +++ b/lib/wx/doc/progress_dialog.rb @@ -5,39 +5,43 @@ # :startdoc: -class Wx::ProgressDialog +module Wx - # Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified. - # - # Returns false if the "Cancel" button has been pressed, true if neither "Cancel" nor - # "Skip" has been pressed and :skipped if "Skip" has been pressed. - # - # If false is returned, the application can either immediately destroy the dialog or ask the user for the confirmation - # and if the abort is not confirmed the dialog may be resumed with #resume method. - # - # If value is the maximum value for the dialog, the behaviour of the function depends on whether Wx::PD_AUTO_HIDE was - # used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was - # not, the dialog becomes a modal dialog and waits for the user to dismiss it, meaning that this function does not - # return until this happens. - # - # Notice that if newmsg is longer than the currently shown message, the dialog will be automatically made wider to - # account for it. However if the new message is shorter than the previous one, the dialog doesn't shrink back to - # avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you - # may call fit explicitly. An alternative would be to keep the number of lines of text constant in order to avoid - # jarring dialog size changes. You may also want to make the initial message, specified when creating the dialog, - # wide enough to avoid having to resize the dialog later, e.g. by appending a long string of unbreakable spaces - # (wxString(L'\u00a0', 100)) to it. - # @param [Integer] value The new value of the progress meter. It should be less than or equal to the maximum value given to the constructor. - # @param [String] newmsg The new messages for the progress dialog text, if it is empty (which is the default) the message is not changed. - # @return [Boolean,:skipped] - def update(value, newmsg = '') end + class ProgressDialog - # Like #update but makes the gauge control run in indeterminate mode. - # - # In indeterminate mode the remaining and the estimated time labels (if present) are set to "Unknown" or to newmsg - # (if it's non-empty). Each call to this function moves the progress bar a bit to indicate that some progress was done. - # @param [String] newmsg - # @return [Boolean,:skipped] - def pulse(newmsg = '') end + # Updates the dialog, setting the progress bar to the new value and updating the message if new one is specified. + # + # Returns false if the "Cancel" button has been pressed, true if neither "Cancel" nor + # "Skip" has been pressed and :skipped if "Skip" has been pressed. + # + # If false is returned, the application can either immediately destroy the dialog or ask the user for the confirmation + # and if the abort is not confirmed the dialog may be resumed with #resume method. + # + # If value is the maximum value for the dialog, the behaviour of the function depends on whether Wx::PD_AUTO_HIDE was + # used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was + # not, the dialog becomes a modal dialog and waits for the user to dismiss it, meaning that this function does not + # return until this happens. + # + # Notice that if newmsg is longer than the currently shown message, the dialog will be automatically made wider to + # account for it. However if the new message is shorter than the previous one, the dialog doesn't shrink back to + # avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you + # may call fit explicitly. An alternative would be to keep the number of lines of text constant in order to avoid + # jarring dialog size changes. You may also want to make the initial message, specified when creating the dialog, + # wide enough to avoid having to resize the dialog later, e.g. by appending a long string of unbreakable spaces + # (wxString(L'\u00a0', 100)) to it. + # @param [Integer] value The new value of the progress meter. It should be less than or equal to the maximum value given to the constructor. + # @param [String] newmsg The new messages for the progress dialog text, if it is empty (which is the default) the message is not changed. + # @return [Boolean,:skipped] + def update(value, newmsg = '') end + + # Like #update but makes the gauge control run in indeterminate mode. + # + # In indeterminate mode the remaining and the estimated time labels (if present) are set to "Unknown" or to newmsg + # (if it's non-empty). Each call to this function moves the progress bar a bit to indicate that some progress was done. + # @param [String] newmsg + # @return [Boolean,:skipped] + def pulse(newmsg = '') end + + end end diff --git a/lib/wx/doc/prt/page_setup_dialog.rb b/lib/wx/doc/prt/page_setup_dialog.rb index bf6f88bc..96dfb911 100644 --- a/lib/wx/doc/prt/page_setup_dialog.rb +++ b/lib/wx/doc/prt/page_setup_dialog.rb @@ -5,17 +5,25 @@ # :startdoc: -class Wx::PRT::PageSetupDialog - - # Returns (a copy of) the page setup data of the dialog. - # @return [Wx::PRT::PageSetupDialogData] page setup data copy - def get_page_setup_data; end - alias :page_setup_data :get_page_setup_data - - # Updates the page setup data for the dialog. - # @param [Wx::PRT::PageSetupDialogData] setup_data the page setup data to update the dialog with - # @return [void] - def set_page_setup_data(setup_data); end - alias :page_setup_data= :set_page_setup_data +module Wx + + module PRT + + class PageSetupDialog + + # Returns (a copy of) the page setup data of the dialog. + # @return [Wx::PRT::PageSetupDialogData] page setup data copy + def get_page_setup_data; end + alias :page_setup_data :get_page_setup_data + + # Updates the page setup data for the dialog. + # @param [Wx::PRT::PageSetupDialogData] setup_data the page setup data to update the dialog with + # @return [void] + def set_page_setup_data(setup_data); end + alias :page_setup_data= :set_page_setup_data + + end + + end end diff --git a/lib/wx/doc/prt/print_data.rb b/lib/wx/doc/prt/print_data.rb index c0b833ba..9e2c2757 100644 --- a/lib/wx/doc/prt/print_data.rb +++ b/lib/wx/doc/prt/print_data.rb @@ -5,11 +5,19 @@ # :startdoc: -class Wx::PRT::PrintDialogData +module Wx - # Returns (a copy of) the print data. - # @return [Wx::PRT::PrintData] print data copy - def get_print_data; end - alias :print_data :get_print_data + module PRT + + class PrintDialogData + + # Returns (a copy of) the print data. + # @return [Wx::PRT::PrintData] print data copy + def get_print_data; end + alias :print_data :get_print_data + + end + + end end diff --git a/lib/wx/doc/prt/print_dialog.rb b/lib/wx/doc/prt/print_dialog.rb index a48bcc92..168d784e 100644 --- a/lib/wx/doc/prt/print_dialog.rb +++ b/lib/wx/doc/prt/print_dialog.rb @@ -5,28 +5,36 @@ # :startdoc: -class Wx::PRT::PrintDialog - - # Returns (a copy of) the print data of the dialog. - # @return [Wx::PRT::PrintData] print data copy - def get_print_data; end - alias :print_data :get_print_data - - # Updates the print data for the dialog. - # @param [Wx::PRT::PrintData] prt_data the print data to update the dialog with - # @return [void] - def set_print_data(prt_data); end - alias :print_data= :set_print_data - - # Returns (a copy of) the print dialog data of the dialog. - # @return [Wx::PRT::PrintDialogData] print dialog data copy - def get_print_dialog_data; end - alias :print_dialog_data :get_print_dialog_data - - # Updates the print dialog data for the dialog. - # @param [Wx::PRT::PrintDialogData] prt_data the print dialog data to update the dialog with - # @return [void] - def set_print_dialog_data(prt_data); end - alias :print_dialog_data= :set_print_dialog_data +module Wx + + module PRT + + class PrintDialog + + # Returns (a copy of) the print data of the dialog. + # @return [Wx::PRT::PrintData] print data copy + def get_print_data; end + alias :print_data :get_print_data + + # Updates the print data for the dialog. + # @param [Wx::PRT::PrintData] prt_data the print data to update the dialog with + # @return [void] + def set_print_data(prt_data); end + alias :print_data= :set_print_data + + # Returns (a copy of) the print dialog data of the dialog. + # @return [Wx::PRT::PrintDialogData] print dialog data copy + def get_print_dialog_data; end + alias :print_dialog_data :get_print_dialog_data + + # Updates the print dialog data for the dialog. + # @param [Wx::PRT::PrintDialogData] prt_data the print dialog data to update the dialog with + # @return [void] + def set_print_dialog_data(prt_data); end + alias :print_dialog_data= :set_print_dialog_data + + end + + end end diff --git a/lib/wx/doc/prt/printer.rb b/lib/wx/doc/prt/printer.rb index b112a206..2be145b5 100644 --- a/lib/wx/doc/prt/printer.rb +++ b/lib/wx/doc/prt/printer.rb @@ -5,17 +5,25 @@ # :startdoc: -class Wx::PRT::Printer - - # Returns (a copy of) the print dialog data of the printer. - # @return [Wx::PRT::PrintDialogData] print dialog data copy - def get_print_dialog_data; end - alias :print_dialog_data :get_print_dialog_data - - # Updates the print dialog data for the printer. - # @param [Wx::PRT::PrintDialogData] prt_data the print dialog data to update the printer with - # @return [void] - def set_print_dialog_data(prt_data); end - alias :print_dialog_data= :set_print_dialog_data +module Wx + + module PRT + + class Printer + + # Returns (a copy of) the print dialog data of the printer. + # @return [Wx::PRT::PrintDialogData] print dialog data copy + def get_print_dialog_data; end + alias :print_dialog_data :get_print_dialog_data + + # Updates the print dialog data for the printer. + # @param [Wx::PRT::PrintDialogData] prt_data the print dialog data to update the printer with + # @return [void] + def set_print_dialog_data(prt_data); end + alias :print_dialog_data= :set_print_dialog_data + + end + + end end diff --git a/lib/wx/doc/radio_box.rb b/lib/wx/doc/radio_box.rb index 0f966746..f59a2d8f 100644 --- a/lib/wx/doc/radio_box.rb +++ b/lib/wx/doc/radio_box.rb @@ -5,22 +5,26 @@ # :startdoc: -class Wx::RadioBox +module Wx - # Enables od disables individual buttons. - # true if the item has been enabled or disabled or false if nothing was done because it already was in the requested state. - # @see Wx::Window#enable - # @param item [Integer] The zero-based position of the button to enable or disable. - # @param enable [true,false] true to enable, false to disable. - # @return [true,false] - def enable_item(item, enable=true) end + class RadioBox - # Shows or hides individual buttons. - # true if the item has been shown or hidden or false if nothing was done because it already was in the requested state. - # @see Wx::Window#show - # @param item [Integer] The zero-based position of the button to show or hide. - # @param show [true,false] true to show, false to hide. - # @return [true,false] - def show_item(item, show=true) end + # Enables od disables individual buttons. + # true if the item has been enabled or disabled or false if nothing was done because it already was in the requested state. + # @see Wx::Window#enable + # @param item [Integer] The zero-based position of the button to enable or disable. + # @param enable [true,false] true to enable, false to disable. + # @return [true,false] + def enable_item(item, enable=true) end + + # Shows or hides individual buttons. + # true if the item has been shown or hidden or false if nothing was done because it already was in the requested state. + # @see Wx::Window#show + # @param item [Integer] The zero-based position of the button to show or hide. + # @param show [true,false] true to show, false to hide. + # @return [true,false] + def show_item(item, show=true) end + + end end diff --git a/lib/wx/doc/rbn/ribbon_bar.rb b/lib/wx/doc/rbn/ribbon_bar.rb index 2a47bddf..6ea26ede 100644 --- a/lib/wx/doc/rbn/ribbon_bar.rb +++ b/lib/wx/doc/rbn/ribbon_bar.rb @@ -5,11 +5,19 @@ # :startdoc: -class Wx::RBN::RibbonBar +module Wx - # Iterate ribbon pages if block given or return enumerator. - # @yieldparam [Wx::RBN::RibbonPage] page A ribbon page instance - # @return [Object,Enumerator] result from last block execution or an enumerator - def pages; end + module RBN + + class RibbonBar + + # Iterate ribbon pages if block given or return enumerator. + # @yieldparam [Wx::RBN::RibbonPage] page A ribbon page instance + # @return [Object,Enumerator] result from last block execution or an enumerator + def pages; end + + end + + end end diff --git a/lib/wx/doc/rbn/ribbon_button_bar.rb b/lib/wx/doc/rbn/ribbon_button_bar.rb index db338f78..313cb8cc 100644 --- a/lib/wx/doc/rbn/ribbon_button_bar.rb +++ b/lib/wx/doc/rbn/ribbon_button_bar.rb @@ -5,11 +5,19 @@ # :startdoc: -class Wx::RBN::RibbonButtonBar +module Wx - # Iterate button items if block given else return enumerator. - # @yieldparam [Integer] button_id Id of a button item - # @return [Object,Enumerator] result from last block execution or an enumerator - def items; end + module RBN + + class RibbonButtonBar + + # Iterate button items if block given else return enumerator. + # @yieldparam [Integer] button_id Id of a button item + # @return [Object,Enumerator] result from last block execution or an enumerator + def items; end + + end + + end end diff --git a/lib/wx/doc/rbn/ribbon_gallery.rb b/lib/wx/doc/rbn/ribbon_gallery.rb index 45e0689b..5729ba8a 100644 --- a/lib/wx/doc/rbn/ribbon_gallery.rb +++ b/lib/wx/doc/rbn/ribbon_gallery.rb @@ -5,11 +5,19 @@ # :startdoc: -class Wx::RBN::RibbonGallery +module Wx - # Iterate gallery items if block given else return enumerator. - # @yieldparam [Integer] index Gallery item index - # @return [Object,Enumerator] result from last block execution or an enumerator - def items; end + module RBN + + class RibbonGallery + + # Iterate gallery items if block given else return enumerator. + # @yieldparam [Integer] index Gallery item index + # @return [Object,Enumerator] result from last block execution or an enumerator + def items; end + + end + + end end diff --git a/lib/wx/doc/rbn/ribbon_tool_bar.rb b/lib/wx/doc/rbn/ribbon_tool_bar.rb index 07c5ce31..54d3cf9c 100644 --- a/lib/wx/doc/rbn/ribbon_tool_bar.rb +++ b/lib/wx/doc/rbn/ribbon_tool_bar.rb @@ -5,11 +5,19 @@ # :startdoc: -class Wx::RBN::RibbonToolBar +module Wx - # Iterate tool items if block given or return enumerator. - # @yieldparam [Integer] tool_id A tool item id - # @return [Object,Enumerator] result from last block execution or an enumerator - def tools; end + module RBN + + class RibbonToolBar + + # Iterate tool items if block given or return enumerator. + # @yieldparam [Integer] tool_id A tool item id + # @return [Object,Enumerator] result from last block execution or an enumerator + def tools; end + + end + + end end diff --git a/lib/wx/doc/region_iterator.rb b/lib/wx/doc/region_iterator.rb index a7140e60..893184d4 100644 --- a/lib/wx/doc/region_iterator.rb +++ b/lib/wx/doc/region_iterator.rb @@ -5,33 +5,37 @@ # :startdoc: -class Wx::RegionIterator - - # Creates a Wx::RegionIterator and passes that to the given block. - # Removes the iterator after the block finishes. - # @param [Wx::Region] region - # @yieldparam [Wx::RegionIterator] region_it - def self.for_region(region) end - - # Creates a Wx::RegionIterator and iterates each rectangle in the region executing the given block - # for each iteration passing the region iterator. - # @param [Wx::Region] region - # @yieldparam [Wx::RegionIterator] region_it - def self.iterate(region) end - - alias :have_rects? :have_rects - - # Moves to the next rectangle of the iterated region. - # @return [void] - def next_rect; end - - # If a block is given the given block is called for each rectangle in the region passing the rectangle. - # If no block is given an Enumerator is returned. - # @overload each(&block) - # @yieldparam [Wx::Rect] rect - # @return [Object] - # @overload each() - # @return [Enumerator] - def each; end +module Wx + + class RegionIterator + + # Creates a Wx::RegionIterator and passes that to the given block. + # Removes the iterator after the block finishes. + # @param [Wx::Region] region + # @yieldparam [Wx::RegionIterator] region_it + def self.for_region(region) end + + # Creates a Wx::RegionIterator and iterates each rectangle in the region executing the given block + # for each iteration passing the region iterator. + # @param [Wx::Region] region + # @yieldparam [Wx::RegionIterator] region_it + def self.iterate(region) end + + alias :have_rects? :have_rects + + # Moves to the next rectangle of the iterated region. + # @return [void] + def next_rect; end + + # If a block is given the given block is called for each rectangle in the region passing the rectangle. + # If no block is given an Enumerator is returned. + # @overload each(&block) + # @yieldparam [Wx::Rect] rect + # @return [Object] + # @overload each() + # @return [Enumerator] + def each; end + + end end diff --git a/lib/wx/doc/rtc/richtext_buffer.rb b/lib/wx/doc/rtc/richtext_buffer.rb index 788c24d8..aa66d0f3 100644 --- a/lib/wx/doc/rtc/richtext_buffer.rb +++ b/lib/wx/doc/rtc/richtext_buffer.rb @@ -5,24 +5,32 @@ # :startdoc: -class Wx::RTC::RichTextBuffer - - # Iterates all RichTextFileHandler-s and passes each handler to the given block - # or returns an enumerator if no block given. - # @yieldparam [Wx::RTC::RichTextFileHandler] handler - # @return [Object,Enumerator] last result of given block or enumerator - def self.each_handler; end - - # Iterates all RichTextFieldType-s and passes each field type to the given block - # or returns an enumerator if no block given. - # @yieldparam [Wx::RTC::RichTextFieldType] field type - # @return [Object,Enumerator] last result of given block or enumerator - def self.each_field_type; end - - # Iterates all RichTextDrawingHandler-s and passes each handler to the given block - # or returns an enumerator if no block given. - # @yieldparam [Wx::RTC::RichTextDrawingHandler] handler - # @return [Object,Enumerator] last result of given block or enumerator - def self.each_drawing_handler; end +module Wx + + module RTC + + class RichTextBuffer + + # Iterates all RichTextFileHandler-s and passes each handler to the given block + # or returns an enumerator if no block given. + # @yieldparam [Wx::RTC::RichTextFileHandler] handler + # @return [Object,Enumerator] last result of given block or enumerator + def self.each_handler; end + + # Iterates all RichTextFieldType-s and passes each field type to the given block + # or returns an enumerator if no block given. + # @yieldparam [Wx::RTC::RichTextFieldType] field type + # @return [Object,Enumerator] last result of given block or enumerator + def self.each_field_type; end + + # Iterates all RichTextDrawingHandler-s and passes each handler to the given block + # or returns an enumerator if no block given. + # @yieldparam [Wx::RTC::RichTextDrawingHandler] handler + # @return [Object,Enumerator] last result of given block or enumerator + def self.each_drawing_handler; end + + end + + end end diff --git a/lib/wx/doc/rtc/richtext_printing.rb b/lib/wx/doc/rtc/richtext_printing.rb index 7c7312ec..fdbeb3f3 100644 --- a/lib/wx/doc/rtc/richtext_printing.rb +++ b/lib/wx/doc/rtc/richtext_printing.rb @@ -5,16 +5,24 @@ # :startdoc: -class Wx::RTC::RichTextPrinting +module Wx - # Returns (a copy of) the print data. - # @return [Wx::PRT::PrintData] print data copy - def get_print_data; end - alias :print_data :get_print_data + module RTC - # Returns (a copy of) the page setup data. - # @return [Wx::PRT::PageSetupDialogData] page setup data copy - def get_page_setup_data; end - alias :page_setup_data :get_page_setup_data + class RichTextPrinting + + # Returns (a copy of) the print data. + # @return [Wx::PRT::PrintData] print data copy + def get_print_data; end + alias :print_data :get_print_data + + # Returns (a copy of) the page setup data. + # @return [Wx::PRT::PageSetupDialogData] page setup data copy + def get_page_setup_data; end + alias :page_setup_data :get_page_setup_data + + end + + end end diff --git a/lib/wx/doc/rtc/richtext_style_sheet.rb b/lib/wx/doc/rtc/richtext_style_sheet.rb index 0be1ac41..9a10e3be 100644 --- a/lib/wx/doc/rtc/richtext_style_sheet.rb +++ b/lib/wx/doc/rtc/richtext_style_sheet.rb @@ -5,16 +5,24 @@ # :startdoc: -class Wx::RTC::RichTextStyleSheet +module Wx - # Copy ctor - # @param [Wx::RTC::RichTextStyleSheet] sheet - # @return [Wx::RTC::RichTextStyleSheet] - def initialize(sheet) end + module RTC - # Copy given style sheet - # @param [Wx::RTC::RichTextStyleSheet] sheet - # @return [void] - def copy(sheet) end + class RichTextStyleSheet + + # Copy ctor + # @param [Wx::RTC::RichTextStyleSheet] sheet + # @return [Wx::RTC::RichTextStyleSheet] + def initialize(sheet) end + + # Copy given style sheet + # @param [Wx::RTC::RichTextStyleSheet] sheet + # @return [void] + def copy(sheet) end + + end + + end end diff --git a/lib/wx/doc/sizer.rb b/lib/wx/doc/sizer.rb index 7fcc6346..d5f5e7d1 100644 --- a/lib/wx/doc/sizer.rb +++ b/lib/wx/doc/sizer.rb @@ -5,12 +5,16 @@ # :startdoc: -class Wx::Sizer +module Wx - # Yield each child item to the given block. - # Returns an Enumerator if no block given. - # @yieldparam [Wx::SizerItem] child the child item yielded - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def each_child; end + class Sizer + + # Yield each child item to the given block. + # Returns an Enumerator if no block given. + # @yieldparam [Wx::SizerItem] child the child item yielded + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def each_child; end + + end end diff --git a/lib/wx/doc/stream.rb b/lib/wx/doc/stream.rb index 200b3ebc..aaf27054 100644 --- a/lib/wx/doc/stream.rb +++ b/lib/wx/doc/stream.rb @@ -5,40 +5,44 @@ # :startdoc: -class Wx::InputStream - - # @overload read(size) - # Reads max size bytes from stream. - # @param [Integer] size max number of bytes to read - # @return [String,nil] string with bytes read (nil if none read) - # @overload read(output) - # Reads bytes from stream and writes these to output stream until eof or error. - # @param [IO,Wx::OutputStream] output output stream to write to - # @return [self] - def read(*args); end - - # Reads size bytes from stream (until eof or error). - # @param [Integer] size number of bytes to read - # @return [String,nil] string with bytes read (nil if none read) - def read_all(size); end - -end - -class Wx::OutputStream - - # @overload write(buffer) - # Writes some or all bytes from buffer to stream. - # @param [String] buffer string with bytes to write - # @return [Integer] number of bytes written - # @overload write(input) - # Write bytes read from input stream (until eof or error) - # @param [IO,Wx::InputStream] input input stream to read from - # @return [self] - def write(*args); end - - # Writes bytes from buffer to stream. - # @param [String] buffer string with bytes to write - # @return [Integer] number of bytes written - def write_all(buffer); end +module Wx + + class InputStream + + # @overload read(size) + # Reads max size bytes from stream. + # @param [Integer] size max number of bytes to read + # @return [String,nil] string with bytes read (nil if none read) + # @overload read(output) + # Reads bytes from stream and writes these to output stream until eof or error. + # @param [IO,Wx::OutputStream] output output stream to write to + # @return [self] + def read(*args); end + + # Reads size bytes from stream (until eof or error). + # @param [Integer] size number of bytes to read + # @return [String,nil] string with bytes read (nil if none read) + def read_all(size); end + + end + + class OutputStream + + # @overload write(buffer) + # Writes some or all bytes from buffer to stream. + # @param [String] buffer string with bytes to write + # @return [Integer] number of bytes written + # @overload write(input) + # Write bytes read from input stream (until eof or error) + # @param [IO,Wx::InputStream] input input stream to read from + # @return [self] + def write(*args); end + + # Writes bytes from buffer to stream. + # @param [String] buffer string with bytes to write + # @return [Integer] number of bytes written + def write_all(buffer); end + + end end diff --git a/lib/wx/doc/system_settings.rb b/lib/wx/doc/system_settings.rb index 9b10b4ed..f0bae2c1 100644 --- a/lib/wx/doc/system_settings.rb +++ b/lib/wx/doc/system_settings.rb @@ -5,31 +5,35 @@ # :startdoc: -class Wx::SystemSettings - - # Return the name of the current system appearance if available or empty string otherwise. - # - # This is currently only implemented for macOS and returns a not necessarily user-readable - # string such as "NSAppearanceNameAqua" there and an empty string under all the other platforms. - # @return [String] - def get_appearance_name; end - alias :appearance_name :get_appearance_name - - # Return true if the current system there is explicitly recognized as being a dark theme or if - # the default window background is dark. - # - # This method should be used to check whether custom colours more appropriate for the default (light) - # or dark appearance should be used. - # return [true,false] - def is_appearance_dark; end - alias :appearance_dark? :is_appearance_dark - - # Return true if the default window background is significantly darker than foreground. - # - # This is used by #is_appearance_dark if there is no platform-specific way to determine whether a dark - # mode is being used and is generally not very useful to call directly. - # return [true,false] - def is_appearance_using_dark_background; end - alias :appearance_using_dark_background? :is_appearance_using_dark_background +module Wx + + class SystemSettings + + # Return the name of the current system appearance if available or empty string otherwise. + # + # This is currently only implemented for macOS and returns a not necessarily user-readable + # string such as "NSAppearanceNameAqua" there and an empty string under all the other platforms. + # @return [String] + def get_appearance_name; end + alias :appearance_name :get_appearance_name + + # Return true if the current system there is explicitly recognized as being a dark theme or if + # the default window background is dark. + # + # This method should be used to check whether custom colours more appropriate for the default (light) + # or dark appearance should be used. + # return [true,false] + def is_appearance_dark; end + alias :appearance_dark? :is_appearance_dark + + # Return true if the default window background is significantly darker than foreground. + # + # This is used by #is_appearance_dark if there is no platform-specific way to determine whether a dark + # mode is being used and is generally not very useful to call directly. + # return [true,false] + def is_appearance_using_dark_background; end + alias :appearance_using_dark_background? :is_appearance_using_dark_background + + end end diff --git a/lib/wx/doc/text_validator.rb b/lib/wx/doc/text_validator.rb index 706dd3ab..81610434 100644 --- a/lib/wx/doc/text_validator.rb +++ b/lib/wx/doc/text_validator.rb @@ -5,14 +5,18 @@ # :startdoc: -class Wx::TextValidator +module Wx - # @overload initialize(validator) - # Copy constructor. - # @param [Wx::TextValidator] validator validator to copy - # @overload initialize(style=Wx::FILTER_NONE) - # Constructor taking a style. - # @param [Integer] style One or more of the {Wx::TextValidatorStyle} styles. See #set_style. - def initialize(*args) end + class TextValidator + + # @overload initialize(validator) + # Copy constructor. + # @param [Wx::TextValidator] validator validator to copy + # @overload initialize(style=Wx::FILTER_NONE) + # Constructor taking a style. + # @param [Integer] style One or more of the {Wx::TextValidatorStyle} styles. See #set_style. + def initialize(*args) end + + end end diff --git a/lib/wx/doc/textctrl.rb b/lib/wx/doc/textctrl.rb index f3a31246..17422547 100644 --- a/lib/wx/doc/textctrl.rb +++ b/lib/wx/doc/textctrl.rb @@ -23,6 +23,7 @@ module Wx # ```` # # This class is only available if `Wx.has_feature?(:USE_SPELLCHECK)` returns true. + # @wxrb_require USE_SPELLCHECK class TextProofOptions def initialize(schk=false, gchk=false, lang='')end @@ -79,6 +80,7 @@ def each_line; end # When using WXGTK, this method only works if gspell library was available during the wxWidgets library build. # @param [Wx::TextProofOptions] text_proof_options A Wx::TextProofOptions object specifying the desired behaviour of the proof checker (e.g. language to use, spell check, grammar check, etc.) and whether the proof checks should be enabled at all. By default, spelling checks for the current language are enabled. Passing Wx::TextProofOptions.disable disables all the checks. # @return [Boolean] true if proof checking has been successfully enabled or disabled, false otherwise (usually because the corresponding functionality is not available under the current platform or for this type of text control). + # @wxrb_require USE_SPELLCHECK # @overload enable_proof_check(spell_checking, grammar_checking, language) # Enable or disable native spell checking on this text control if it is available on the current platform. # Currently this is supported in WXMSW (when running under Windows 8 or later), WXGTK when using GTK 3 and wxOSX. @@ -89,11 +91,13 @@ def each_line; end # @param [Boolean] grammar_checking # @param [String] language # @return [Boolean] true if proof checking has been successfully enabled or disabled, false otherwise (usually because the corresponding functionality is not available under the current platform or for this type of text control). + # @wxrb_require USE_SPELLCHECK def enable_proof_check(*opts) end # Returns the current text proofing options. # Only available if `Wx.has_feature?(:USE_SPELLCHECK)` returns true. # @return [Wx::TextProofOptions] + # @wxrb_require USE_SPELLCHECK def get_proof_check_options; end end diff --git a/lib/wx/doc/tree_ctrl.rb b/lib/wx/doc/tree_ctrl.rb index 56d12b57..5882da00 100644 --- a/lib/wx/doc/tree_ctrl.rb +++ b/lib/wx/doc/tree_ctrl.rb @@ -5,87 +5,91 @@ # :startdoc: -class Wx::TreeCtrl +module Wx - # Yield each tree item id (recursively) to the given block. - # Starts at tree item specified or at root if none specified. - # Returns an Enumerator if no block given. - # @param [Wx::TreeItemId,nil] start_id - # @yieldparam [Wx::TreeItemId] child_id the child tree item id yielded - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def traverse(start_id=nil) end - alias :each :traverse + class TreeCtrl - # Returns the first child; call #get_next_child() for the next child. - # For this enumeration method a 'cookie' is returned which is opaque for the application but is necessary - # for the library to make these methods reentrant (i.e. allow more than one enumeration on one and the - # same object simultaneously). The cookie returned from (and passed to) #get_first_child() and #get_next_child() - # should be the same variable. - # - # Returns an invalid tree item (i.e. Wx::TreeItemId#ok? returns false) if there are no further children. - # @param [Wx::TreeItemId] parent_id the id of the parent tree item for which to iterate children - # @return [Array(Wx::TreeItemId, Object)] first child item id (if any) and cookie value - def get_first_child(parent_id) end + # Yield each tree item id (recursively) to the given block. + # Starts at tree item specified or at root if none specified. + # Returns an Enumerator if no block given. + # @param [Wx::TreeItemId,nil] start_id + # @yieldparam [Wx::TreeItemId] child_id the child tree item id yielded + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def traverse(start_id=nil) end + alias :each :traverse - # Returns the next child; call #get_first_child() for the first child. - # For this enumeration function you must pass in a 'cookie' parameter which is opaque for the application - # but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration - # on one and the same object simultaneously). The cookie returned from (and passed to) #get_first_child() - # and #get_next_child() should be the same variable. - # - # Returns an invalid tree item if there are no further children. - # @param [Wx::TreeItemId] parent_id the id of the parent tree item for which to iterate children - # @param [Object] cookie cookie value as returned from previous #get_first_cild or #get_next_child call. - # @return [Array(Wx::TreeItemId, Object)] first child item id (if any) and cookie value - def get_next_child(parent_id, cookie) end + # Returns the first child; call #get_next_child() for the next child. + # For this enumeration method a 'cookie' is returned which is opaque for the application but is necessary + # for the library to make these methods reentrant (i.e. allow more than one enumeration on one and the + # same object simultaneously). The cookie returned from (and passed to) #get_first_child() and #get_next_child() + # should be the same variable. + # + # Returns an invalid tree item (i.e. Wx::TreeItemId#ok? returns false) if there are no further children. + # @param [Wx::TreeItemId] parent_id the id of the parent tree item for which to iterate children + # @return [Array(Wx::TreeItemId, Object)] first child item id (if any) and cookie value + def get_first_child(parent_id) end - # Iterate all child items of the given parent and yield it's id to the given block. - # Returns an Enumerator if no block given. - # @param [Wx::TreeItemId] parent_id - # @yieldparam [Wx::TreeItemId] child_id the child tree item id yielded - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def each_item_child(parent_id) end + # Returns the next child; call #get_first_child() for the first child. + # For this enumeration function you must pass in a 'cookie' parameter which is opaque for the application + # but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration + # on one and the same object simultaneously). The cookie returned from (and passed to) #get_first_child() + # and #get_next_child() should be the same variable. + # + # Returns an invalid tree item if there are no further children. + # @param [Wx::TreeItemId] parent_id the id of the parent tree item for which to iterate children + # @param [Object] cookie cookie value as returned from previous #get_first_cild or #get_next_child call. + # @return [Array(Wx::TreeItemId, Object)] first child item id (if any) and cookie value + def get_next_child(parent_id, cookie) end - # Returns an array of tree item ids of the child items of the given parent. - # @param [Wx::TreeItemId] parent_id - # @return [Array] - def get_item_children(parent_id) end - alias :item_children :get_item_children + # Iterate all child items of the given parent and yield it's id to the given block. + # Returns an Enumerator if no block given. + # @param [Wx::TreeItemId] parent_id + # @yieldparam [Wx::TreeItemId] child_id the child tree item id yielded + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def each_item_child(parent_id) end - # Returns an array of tree item ids of the current child items of the root. - # Mainly useful for tree control using TR_HIDE_ROOT style where there are - # multiple root-like items. - # @return [Array] - def get_root_items; end + # Returns an array of tree item ids of the child items of the given parent. + # @param [Wx::TreeItemId] parent_id + # @return [Array] + def get_item_children(parent_id) end + alias :item_children :get_item_children - # Returns an array of tree item ids of the currently selected items. - # This function can be called only if the control has the wxTR_MULTIPLE style. - # @return [Array] - def get_selections; end + # Returns an array of tree item ids of the current child items of the root. + # Mainly useful for tree control using TR_HIDE_ROOT style where there are + # multiple root-like items. + # @return [Array] + def get_root_items; end - # Inserts an item before one identified by its position (pos). - # pos must be less than or equal to the number of children. - # The image and selImage parameters are an index within the normal image list specifying - # the image to use for unselected and selected items, respectively. If image > -1 and - # selImage is -1, the same image is used for both selected and unselected items. - # @param [Wx::TreeItemId] parent parent tree item id to insert child item for - # @param [Integer] pos child item's position to insert before - # @param [Integer] image image index for unselected item - # @param [Integer] selImage image index for selected item - # @param data [Object] - # @return [Wx::TreeItemId] id of inserted tree item - def insert_item_before(parent, pos, text, image=-1, selImage=-1, data=nil) end + # Returns an array of tree item ids of the currently selected items. + # This function can be called only if the control has the wxTR_MULTIPLE style. + # @return [Array] + def get_selections; end - # Starts editing the label of the given item. - # This function generates a EVT_TREE_BEGIN_LABEL_EDIT event which can be vetoed to prevent the editing from starting. - # If it does start, a text control, which can be retrieved using GetEditControl(), allowing the user to edit the - # label interactively is shown. - # When the editing ends, EVT_TREE_END_LABEL_EDIT event is sent and this event can be vetoed as well to prevent the - # label from changing. Note that this event is sent both when the user accepts (e.g. by pressing Enter) or cancels - # (e.g. by pressing Escape) and its handler can use wxTreeEvent::IsEditCancelled() to distinguish between these - # situations. - # @param [Wx::TreeItemId] item_id - # @return [void] - def edit_label(item_id) end + # Inserts an item before one identified by its position (pos). + # pos must be less than or equal to the number of children. + # The image and selImage parameters are an index within the normal image list specifying + # the image to use for unselected and selected items, respectively. If image > -1 and + # selImage is -1, the same image is used for both selected and unselected items. + # @param [Wx::TreeItemId] parent parent tree item id to insert child item for + # @param [Integer] pos child item's position to insert before + # @param [Integer] image image index for unselected item + # @param [Integer] selImage image index for selected item + # @param data [Object] + # @return [Wx::TreeItemId] id of inserted tree item + def insert_item_before(parent, pos, text, image=-1, selImage=-1, data=nil) end + + # Starts editing the label of the given item. + # This function generates a EVT_TREE_BEGIN_LABEL_EDIT event which can be vetoed to prevent the editing from starting. + # If it does start, a text control, which can be retrieved using GetEditControl(), allowing the user to edit the + # label interactively is shown. + # When the editing ends, EVT_TREE_END_LABEL_EDIT event is sent and this event can be vetoed as well to prevent the + # label from changing. Note that this event is sent both when the user accepts (e.g. by pressing Enter) or cancels + # (e.g. by pressing Escape) and its handler can use wxTreeEvent::IsEditCancelled() to distinguish between these + # situations. + # @param [Wx::TreeItemId] item_id + # @return [void] + def edit_label(item_id) end + + end end diff --git a/lib/wx/doc/treebook.rb b/lib/wx/doc/treebook.rb index 30d67e2a..454fe556 100644 --- a/lib/wx/doc/treebook.rb +++ b/lib/wx/doc/treebook.rb @@ -5,11 +5,15 @@ # :startdoc: -class Wx::Treebook +module Wx - # Returns the Wx::TreeCtrl used for this Treebook - # @return [Wx::TreeCtrl] the tree control - def get_tree_ctrl; end - alias :tree_ctrl :get_tree_ctrl + class Treebook + + # Returns the Wx::TreeCtrl used for this Treebook + # @return [Wx::TreeCtrl] the tree control + def get_tree_ctrl; end + alias :tree_ctrl :get_tree_ctrl + + end end diff --git a/lib/wx/doc/v_list_box.rb b/lib/wx/doc/v_list_box.rb index 46b09264..446bd631 100644 --- a/lib/wx/doc/v_list_box.rb +++ b/lib/wx/doc/v_list_box.rb @@ -5,11 +5,15 @@ # :startdoc: -class Wx::VListBox +module Wx - # Iterate selected items. Returns Enumerator if no block given. - # @yieldparam [Integer] sel selected item index - # @return [Enumerator,Object] if block given returns last return value of block, Enumerator otherwise - def each_selected; end + class VListBox + + # Iterate selected items. Returns Enumerator if no block given. + # @yieldparam [Integer] sel selected item index + # @return [Enumerator,Object] if block given returns last return value of block, Enumerator otherwise + def each_selected; end + + end end diff --git a/lib/wx/doc/variant.rb b/lib/wx/doc/variant.rb index 1b09aae3..c40b6507 100644 --- a/lib/wx/doc/variant.rb +++ b/lib/wx/doc/variant.rb @@ -5,165 +5,169 @@ # :startdoc: -class Wx::Variant - - include ::Enumerable - - # When a block is given iterates all items of a variant list passing - # each item to the block. - # Returns an enumerator when no block is given. - # @overload each(&block) - # @yieldparam item [Wx::Variant] variant list item - # @return [Object] result of last block execution - # @overload each - # @return [Enumerator] an enumerator - def each; end - - # Replaces the value of the current variant with the given value - # @overload assign(value) - # Equality test operator. - # @param value [Wx::Variant] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [String] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Integer] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [true,false] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Float] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Integer] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Integer] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Object] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Wx::Object] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Array] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Array] - # @return [self] - # @overload assign(value) - # Equality test operator. - # @param value [Time,Date,DateTime] - # @return [self] - def assign(*args) end - alias :<< :assign - - # Convert contained object to integer value if possible. - # Raises TypeError exception if incompatible. - # @return [Integer] integer value - def to_i; end - - # Convert contained object to floating point value if possible. - # Raises TypeError exception if incompatible. - # @return [Float] floating point value - def to_f; end - - # Convert contained object to string value if possible. - # Raises TypeError exception if incompatible. - # @return [String] string value - def to_s; end - - # Checks if Variant contains a String value (not null). - # @return [true,false] - def string?; end - - # Checks if Variant contains a boolean value (not null). - # @return [true,false] - def bool?; end - - # Checks if Variant contains a long value (not null). - # @return [true,false] - def long?; end - - # Checks if Variant contains a long long value (not null). - # @return [true,false] - def long_long?; end - - # Checks if Variant contains an unsigned long long value (not null). - # @return [true,false] - def u_long_long?; end - - # Checks if Variant contains an integer value (long|long long|unsigned long long). - # @return [true,false] - def integer?; end - - # Checks if Variant contains a (wx)DateTime value (not null). - # (Note that the DateTime values in question concern wxDateTime - # and not the Ruby DateTime class; in fact wxDateTime is normally - # returned as a Ruby Time value) - # @return [true,false] - def date_time?; end - - # Checks if Variant contains a double value (not null). - # @return [true,false] - def double?; end - - # Checks if Variant contains an integer value (integer | double). - # @return [true,false] - def numeric?; end - - # Checks if Variant contains a VariantList (array of Variant) value (not null). - # @return [true,false] - def list?; end - - # Checks if Variant contains an ArrayString (array of String) value (not null). - # @return [true,false] - def array_string?; end - - # Checks if Variant contains a Font value (not null). - # @return [true,false] - def font?; end - - # Returns font value. - # @return [Wx::Font] - def get_font; end - alias :font :get_font - - # Checks if Variant contains a Colour value (not null). - # @return [true,false] - def colour?; end - - # Returns colour value. - # @return [Wx::Colour] - def get_colour; end - alias :colour :get_colour - - # Checks if Variant contains a ColourPropertyValue value (not null). - # @return [true,false] - def colour_property_value?; end - - # Returns colour property value. - # @return [Wx::PG::ColourPropertyValue] - def get_colour_property_value; end - alias :colour_property_value :get_colour_property_value - - # Checks if Variant contains an unspecified Ruby object (not null or - # nil and not one of the other value types). - # @param [Class] klass the (base) class of the Ruby object to check - # @return [true,false] - def object?(klass=Object) end +module Wx + + class Variant + + include ::Enumerable + + # When a block is given iterates all items of a variant list passing + # each item to the block. + # Returns an enumerator when no block is given. + # @overload each(&block) + # @yieldparam item [Wx::Variant] variant list item + # @return [Object] result of last block execution + # @overload each + # @return [Enumerator] an enumerator + def each; end + + # Replaces the value of the current variant with the given value + # @overload assign(value) + # Equality test operator. + # @param value [Wx::Variant] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [String] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Integer] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [true,false] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Float] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Integer] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Integer] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Object] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Wx::Object] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Array] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Array] + # @return [self] + # @overload assign(value) + # Equality test operator. + # @param value [Time,Date,DateTime] + # @return [self] + def assign(*args) end + alias :<< :assign + + # Convert contained object to integer value if possible. + # Raises TypeError exception if incompatible. + # @return [Integer] integer value + def to_i; end + + # Convert contained object to floating point value if possible. + # Raises TypeError exception if incompatible. + # @return [Float] floating point value + def to_f; end + + # Convert contained object to string value if possible. + # Raises TypeError exception if incompatible. + # @return [String] string value + def to_s; end + + # Checks if Variant contains a String value (not null). + # @return [true,false] + def string?; end + + # Checks if Variant contains a boolean value (not null). + # @return [true,false] + def bool?; end + + # Checks if Variant contains a long value (not null). + # @return [true,false] + def long?; end + + # Checks if Variant contains a long long value (not null). + # @return [true,false] + def long_long?; end + + # Checks if Variant contains an unsigned long long value (not null). + # @return [true,false] + def u_long_long?; end + + # Checks if Variant contains an integer value (long|long long|unsigned long long). + # @return [true,false] + def integer?; end + + # Checks if Variant contains a (wx)DateTime value (not null). + # (Note that the DateTime values in question concern wxDateTime + # and not the Ruby DateTime class; in fact wxDateTime is normally + # returned as a Ruby Time value) + # @return [true,false] + def date_time?; end + + # Checks if Variant contains a double value (not null). + # @return [true,false] + def double?; end + + # Checks if Variant contains an integer value (integer | double). + # @return [true,false] + def numeric?; end + + # Checks if Variant contains a VariantList (array of Variant) value (not null). + # @return [true,false] + def list?; end + + # Checks if Variant contains an ArrayString (array of String) value (not null). + # @return [true,false] + def array_string?; end + + # Checks if Variant contains a Font value (not null). + # @return [true,false] + def font?; end + + # Returns font value. + # @return [Wx::Font] + def get_font; end + alias :font :get_font + + # Checks if Variant contains a Colour value (not null). + # @return [true,false] + def colour?; end + + # Returns colour value. + # @return [Wx::Colour] + def get_colour; end + alias :colour :get_colour + + # Checks if Variant contains a ColourPropertyValue value (not null). + # @return [true,false] + def colour_property_value?; end + + # Returns colour property value. + # @return [Wx::PG::ColourPropertyValue] + def get_colour_property_value; end + alias :colour_property_value :get_colour_property_value + + # Checks if Variant contains an unspecified Ruby object (not null or + # nil and not one of the other value types). + # @param [Class] klass the (base) class of the Ruby object to check + # @return [true,false] + def object?(klass=Object) end + + end end diff --git a/lib/wx/doc/window.rb b/lib/wx/doc/window.rb index aa2c0fb5..328df57b 100644 --- a/lib/wx/doc/window.rb +++ b/lib/wx/doc/window.rb @@ -5,58 +5,62 @@ # :startdoc: -class Wx::Window - - # Creates an appropriate (temporary) DC to paint on and - # passes that to the given block. Deletes the DC when the block returns. - # Creates a Wx::PaintDC when called from an evt_paint handler and a - # Wx::ClientDC otherwise. - # @yieldparam [Wx::PaintDC,Wx::ClientDC] dc dc to paint on - # @return [Object] result from block - def paint; end - - # Similar to #paint but this time creates a Wx::AutoBufferedPaintDC when called - # from an evt_paint handler and a Wx::ClientDC otherwise. - # @yieldparam [Wx::AutoBufferedPaintDC,Wx::ClientDC] dc dc to paint on - # @return [Object] result from block - def paint_buffered; end - - # Yield each child window to the given block. - # Returns an Enumerator if no block given. - # @yieldparam [Wx::Window] child the child window yielded - # @return [Object,Enumerator] last result of block or Enumerator if no block given. - def each_child; end - - # Locks the window from updates while executing the given block. - # @param [Proc] block - def locked(&block); end - - # Find the first child window with the given id recursively in the window hierarchy of this window. - # - # Window with the given id or nil if not found. - # @see Wx::Window.find_window_by_id - # @param id [Integer] - # @return [Wx::Window] - def find_window_by_id(id) end - - # Find the first child window with the given label recursively in the window hierarchy of this window. - # - # Window with the given label or nil if not found. - # @see Wx::Window.find_window_by_label - # @param label [String] - # @return [Wx::Window] - def find_window_by_label(label) end - - # Find the first child window with the given name (as given in a window constructor or {Wx::Window#create} function call) recursively in the window hierarchy of this window. - # - # Window with the given name or nil if not found. - # @param name [String] - # @return [Wx::Window] - def find_window_by_name(name) end - - # Switches the current sizer with the given sizer and detaches and returns the 'old' sizer. - # @param [Wx::Sizer] new_sizer new sizer for window - # @return [Wx::Sizer] previous window sizer - def switch_sizer(new_sizer) end +module Wx + + class Window + + # Creates an appropriate (temporary) DC to paint on and + # passes that to the given block. Deletes the DC when the block returns. + # Creates a Wx::PaintDC when called from an evt_paint handler and a + # Wx::ClientDC otherwise. + # @yieldparam [Wx::PaintDC,Wx::ClientDC] dc dc to paint on + # @return [Object] result from block + def paint; end + + # Similar to #paint but this time creates a Wx::AutoBufferedPaintDC when called + # from an evt_paint handler and a Wx::ClientDC otherwise. + # @yieldparam [Wx::AutoBufferedPaintDC,Wx::ClientDC] dc dc to paint on + # @return [Object] result from block + def paint_buffered; end + + # Yield each child window to the given block. + # Returns an Enumerator if no block given. + # @yieldparam [Wx::Window] child the child window yielded + # @return [Object,Enumerator] last result of block or Enumerator if no block given. + def each_child; end + + # Locks the window from updates while executing the given block. + # @param [Proc] block + def locked(&block); end + + # Find the first child window with the given id recursively in the window hierarchy of this window. + # + # Window with the given id or nil if not found. + # @see Wx::Window.find_window_by_id + # @param id [Integer] + # @return [Wx::Window] + def find_window_by_id(id) end + + # Find the first child window with the given label recursively in the window hierarchy of this window. + # + # Window with the given label or nil if not found. + # @see Wx::Window.find_window_by_label + # @param label [String] + # @return [Wx::Window] + def find_window_by_label(label) end + + # Find the first child window with the given name (as given in a window constructor or {Wx::Window#create} function call) recursively in the window hierarchy of this window. + # + # Window with the given name or nil if not found. + # @param name [String] + # @return [Wx::Window] + def find_window_by_name(name) end + + # Switches the current sizer with the given sizer and detaches and returns the 'old' sizer. + # @param [Wx::Sizer] new_sizer new sizer for window + # @return [Wx::Sizer] previous window sizer + def switch_sizer(new_sizer) end + + end end diff --git a/lib/wx/doc/window_disabler.rb b/lib/wx/doc/window_disabler.rb index 820046c4..313aa7e8 100644 --- a/lib/wx/doc/window_disabler.rb +++ b/lib/wx/doc/window_disabler.rb @@ -5,12 +5,16 @@ # :startdoc: -class Wx::WindowDisabler +module Wx - # Disables all top level windows of the application (maybe with the exception of one of them) in - # and enables them back after the given block has returned. - # @param [Wx::Window,nil] to_skip window to exclude from disabling - # @return [void] - def self.disable(to_skip = nil) end + class WindowDisabler + + # Disables all top level windows of the application (maybe with the exception of one of them) in + # and enables them back after the given block has returned. + # @param [Wx::Window,nil] to_skip window to exclude from disabling + # @return [void] + def self.disable(to_skip = nil) end + + end end diff --git a/rakelib/lib/config.rb b/rakelib/lib/config.rb index 1df39189..34389b5a 100644 --- a/rakelib/lib/config.rb +++ b/rakelib/lib/config.rb @@ -589,7 +589,7 @@ def any_feature_set?(*featureset) private :any_feature_set? def features_set?(*featureset) - featureset.all? do |feature| + featureset.flatten.all? do |feature| if AnyOf === feature any_feature_set?(*feature.features) else @@ -617,12 +617,16 @@ def _retrieve_features(wxwidgets_setup_h) if is_configured? && wxwidgets_setup_h File.read(wxwidgets_setup_h).scan(/^\s*#define\s+(wx\w+|__\w+__)\s+([01])/) do | define | - features[$1] = $2.to_i.zero? ? false : true + feat_val = $2.to_i.zero? ? false : true + feat_id = $1.sub(/\Awx/i, '').gsub(/\A__|__\Z/, '') + features[feat_id] = feat_val end # make sure correct platform defines are included as well which will not be the case always # (for example __WXMSW__ and __WXOSX__ are not in setup.h) - features['__WXMSW__'] = true if features['__GNUWIN32__'] - features['__WXOSX__'] = true if features['__DARWIN__'] + features['WXMSW'] = true if features['GNUWIN32'] + features['WXOSX'] = true if features['DARWIN'] + # prior to wxWidgets 3.3 this feature was not set for wxGTK builds + features['WXGTK'] = true if features['LINUX'] && !features['WXGTK'] && wx_port == :wxgtk end features diff --git a/rakelib/lib/config/linux.rb b/rakelib/lib/config/linux.rb index 434e139c..e0b042d4 100644 --- a/rakelib/lib/config/linux.rb +++ b/rakelib/lib/config/linux.rb @@ -57,7 +57,7 @@ def init_platform @dll_pfx = 'lib' if @wx_version - @extra_cflags.concat %w[-Wno-unused-function -Wno-conversion-null -Wno-maybe-uninitialized] + @extra_cflags.concat %w[-Wno-unused-function -Wno-conversion-null -Wno-maybe-uninitialized -Wno-format-security] @extra_cflags << ' -Wno-deprecated-declarations' unless @no_deprecated @ruby_ldflags << '-s' if @release_build # strip debug symbols for release build @@ -65,9 +65,6 @@ def init_platform # create a .so binary @extra_ldflags << '-shared' - # This class is not available on linux ports (wxGTK/wxQT/wxX11/wxMotif) - exclude_module('wxPrinterDC') - unless @wx_path.empty? libdirs = @wx_libs.select {|s| s.start_with?('-L')}.collect {|s| s.sub(/^-L/,'')} @exec_env['LD_LIBRARY_PATH'] = "#{ENV['LD_LIBRARY_PATH']}:#{dest_dir}:#{libdirs.join(':')}" diff --git a/rakelib/lib/config/macosx.rb b/rakelib/lib/config/macosx.rb index 7e7d7fcb..3638d861 100644 --- a/rakelib/lib/config/macosx.rb +++ b/rakelib/lib/config/macosx.rb @@ -65,7 +65,7 @@ def get_wx_libs end end # some weird thing with this; at least sometimes '--libs all' will not output media library even if feature active - if features_set?('wxUSE_MEDIACTRL') + if features_set?('USE_MEDIACTRL') lib_list = wx_config("--libs media").split(' ') until lib_list.empty? s = lib_list.shift diff --git a/rakelib/lib/config/unixish.rb b/rakelib/lib/config/unixish.rb index 744433fc..f2062426 100644 --- a/rakelib/lib/config/unixish.rb +++ b/rakelib/lib/config/unixish.rb @@ -136,7 +136,7 @@ def get_wx_libs wx_libset = ::Set.new wx_libset.merge wx_config("--libs all").split(' ') # some weird thing with this; at least sometimes '--libs all' will not output media library even if feature active - if features_set?('wxUSE_MEDIACTRL') + if features_set?('USE_MEDIACTRL') wx_libset.merge wx_config("--libs media").split(' ') end wx_libset.collect { |s| s.dup } diff --git a/rakelib/lib/core/package.rb b/rakelib/lib/core/package.rb index a2958c5f..ffb0240c 100644 --- a/rakelib/lib/core/package.rb +++ b/rakelib/lib/core/package.rb @@ -105,7 +105,7 @@ def add_director(spec) end def included_directors - directors.select { |dir| !Config.instance.excluded_module?(dir.spec) } + directors.select { |dir| Package.full_docs? || !Config.instance.excluded_module?(dir.spec) } end def director_for_class(class_name) @@ -248,7 +248,7 @@ def generate_initializer_src end # next initialize all modules with classes depending (bases AND mixins) on classes in any modules already - # selected until there are no more modules left or none that are left depend on any selected ones + # selecteduntil there are no more modules left or none that are left depend on any selected ones while dir_inx = inc_dirs.find_index { |dir| !dir.spec.initialize_at_end && is_dir_with_fulfilled_deps?(dir, cls_set) } dir = inc_dirs[dir_inx] modreg = Spec.module_registry[dir.spec.module_name] @@ -359,8 +359,7 @@ def generate_initializer_src # generate constant definitions for feature defines from setup.h fsrc.puts %Q{VALUE mWxSetup = rb_define_module_under(#{module_variable}, "Setup");} Config.instance.features.each do |feature, val| - const_name = rb_wx_name(feature).gsub(/\A__|__\Z/, '') - fsrc.puts %Q{rb_define_const(mWxSetup, "#{const_name}", Q#{val});} + fsrc.puts %Q{rb_define_const(mWxSetup, "#{feature}", Q#{val});} end else fsrc.puts %Q{#{module_variable} = rb_define_module_under(wxRuby_Core(), "#{name}");} @@ -523,10 +522,12 @@ def generate_event_list_docs # ---------------------------------------------------------------------------- - class Wx::EvtHandler + module Wx - __HEREDOC - fdoc.indent do + class EvtHandler + + __HEREDOC + fdoc.indent(2) do fdoc.doc.puts "@!group #{name} Event handler methods" fdoc.puts evts_handled = ::Set.new @@ -557,6 +558,8 @@ class Wx::EvtHandler fdoc.doc.puts '@!endgroup' end fdoc.puts + fdoc.puts ' end' + fdoc.puts fdoc.puts 'end' end end @@ -634,6 +637,10 @@ module Wx end private :generate_core_doc + def self.full_docs? + !!ENV['WXRUBY_FULLDOCS'] + end + def generate_docs # make sure all modules have been extracted from xml included_directors.each {|dir| dir.extract_interface(false, gendoc: true) } diff --git a/rakelib/lib/core/spec.rb b/rakelib/lib/core/spec.rb index 4538aa33..0cdc7b68 100644 --- a/rakelib/lib/core/spec.rb +++ b/rakelib/lib/core/spec.rb @@ -327,7 +327,12 @@ def include_mixin(cls, mixin_module) end def ignore(*names, ignore_doc: true) - names.flatten.each {|n| @ignores[n] = ignore_doc} + names.flatten.each { |n| @ignores[n] = {ignore: true, ignore_doc: ignore_doc} } + self + end + + def ignore_unless(feature_set, *names) + names.flatten.each { |n| @ignores[n] = {ignore: feature_set} } self end diff --git a/rakelib/lib/director.rb b/rakelib/lib/director.rb index 3fd9dec3..93546c42 100644 --- a/rakelib/lib/director.rb +++ b/rakelib/lib/director.rb @@ -94,7 +94,7 @@ def packages def each_package(&block) packages.each_value do |pkg| - pkg.each_package(&block) if Config.instance.features_set?(*pkg.required_features) + pkg.each_package(&block) if Package.full_docs? || Config.instance.features_set?(*pkg.required_features) end end @@ -269,7 +269,7 @@ def setup end def handle_item_ignore(defmod, fullname, ignore, ignoredoc) - action = ignore ? 'ignore' : 'regard' + action = (ignore==false) ? 'regard' : 'ignore' # find the item item = defmod.find_item(fullname) if item @@ -361,8 +361,8 @@ def process(gendoc: false) # extract the module definitions defmod = Extractor.extract_module(spec.package, spec.module_name, spec.name, spec.items, gendoc: gendoc) # handle ignores - spec.ignores.each_pair do |fullname, ignoredoc| - handle_item_ignore(defmod, fullname, true, ignoredoc) + spec.ignores.each_pair do |fullname, ignore_spec| + handle_item_ignore(defmod, fullname, ignore_spec[:ignore], ignore_spec[:ignore_doc]) end # handle regards spec.regards.each_pair do |fullname, regarddoc| diff --git a/rakelib/lib/director/accelerator.rb b/rakelib/lib/director/accelerator.rb index aff3b777..79fa9c93 100644 --- a/rakelib/lib/director/accelerator.rb +++ b/rakelib/lib/director/accelerator.rb @@ -47,9 +47,8 @@ def setup (TYPE($input) == T_STRING && RSTRING_LEN($input) == 1) ); __CODE end - unless Config.instance.features_set?('__WXMSW__') - spec.ignore('wxAcceleratorTable::wxAcceleratorTable(const wxString &)') - end + spec.ignore_unless('WXMSW', + 'wxAcceleratorTable::wxAcceleratorTable(const wxString &)') spec.add_swig_code <<~__HEREDOC %warnfilter(509) wxAcceleratorTable::wxAcceleratorTable; __HEREDOC diff --git a/rakelib/lib/director/app.rb b/rakelib/lib/director/app.rb index 914d346a..4a84c3d0 100644 --- a/rakelib/lib/director/app.rb +++ b/rakelib/lib/director/app.rb @@ -16,11 +16,14 @@ class App < EvtHandler def setup spec.items << 'wxAppConsole' << 'wxEventFilter' - if Config.platform == :mingw && Config.instance.wx_version >= '3.3.0' + if Config.instance.wx_version >= '3.3.0' spec.items << 'wxDarkModeSettings' - spec.disown 'wxDarkModeSettings *settings' - # wxDarkModeSettings does has have virt dtor; it's just not documented - spec.suppress_warning(514, 'wxDarkModeSettings') + spec.ignore_unless('WXMSW', 'wxDarkModeSettings', 'wxMenuColour') + if Config.instance.features_set?('WXMSW') + spec.disown 'wxDarkModeSettings *settings' + # wxDarkModeSettings does has have virt dtor; it's just not documented + spec.suppress_warning(514, 'wxDarkModeSettings') + end end spec.fold_bases('wxApp' => 'wxAppConsole', 'wxAppConsole' => 'wxEventFilter') spec.override_inheritance_chain('wxApp', %w[wxEvtHandler wxObject]) diff --git a/rakelib/lib/director/app_traits.rb b/rakelib/lib/director/app_traits.rb index 0c0f97ba..56df8189 100644 --- a/rakelib/lib/director/app_traits.rb +++ b/rakelib/lib/director/app_traits.rb @@ -38,8 +38,8 @@ def setup wxAppTraits::IsUsingUniversalWidgets wxAppTraits::ShowAssertDialog wxAppTraits::SafeMessageBox - wxAppTraits::GetAssertStackTrace ], ignore_doc: false + spec.ignore('wxAppTraits::GetAssertStackTrace', ignore_doc: 'USE_STACKWALKER') # redefine spec.extend_interface 'wxAppTraits', 'wxString GetDesktopEnvironment() const', @@ -48,21 +48,19 @@ def setup 'bool IsUsingUniversalWidgets() const', 'bool ShowAssertDialog(const wxString& msg)', 'bool SafeMessageBox(const wxString &text, const wxString &title)' - if Config.instance.features_set?('wxUSE_STACKWALKER') + if Config.instance.features_set?('USE_STACKWALKER') spec.extend_interface 'wxAppTraits', 'wxString GetAssertStackTrace()' end spec.map_apply 'int * OUTPUT' => ['int *major', 'int *minor', 'int *micro'] - unless Config.platform == :mingw - spec.ignore 'wxStandardPaths::DontIgnoreAppSubDir', - 'wxStandardPaths::IgnoreAppSubDir', - 'wxStandardPaths::IgnoreAppBuildSubDirs', - 'wxStandardPaths::MSWGetShellDir' - end - unless Config.platform == :linux - spec.ignore 'wxStandardPaths::SetInstallPrefix', - 'wxStandardPaths::GetInstallPrefix' - end + spec.ignore_unless('WXMSW', + 'wxStandardPaths::DontIgnoreAppSubDir', + 'wxStandardPaths::IgnoreAppSubDir', + 'wxStandardPaths::IgnoreAppBuildSubDirs', + 'wxStandardPaths::MSWGetShellDir') + spec.ignore_unless('WXGTK', + 'wxStandardPaths::SetInstallPrefix', + 'wxStandardPaths::GetInstallPrefix') end end diff --git a/rakelib/lib/director/data_format.rb b/rakelib/lib/director/data_format.rb index 8e0e6c31..2f714eab 100644 --- a/rakelib/lib/director/data_format.rb +++ b/rakelib/lib/director/data_format.rb @@ -20,7 +20,7 @@ def setup # The formal signature for these is NativeFormat; this is required on # MSVC as otherwise an impermissible implicit cast is tried, and so # doesn't compile - spec.ignore 'wxDataFormat::GetType' + spec.ignore 'wxDataFormat::GetType', ignore_doc: false spec.extend_interface 'wxDataFormat', 'typedef unsigned short NativeFormat', 'wxDataFormat::NativeFormat GetType() const' diff --git a/rakelib/lib/director/derived_dc.rb b/rakelib/lib/director/derived_dc.rb index 426e4c3e..f6f2602d 100644 --- a/rakelib/lib/director/derived_dc.rb +++ b/rakelib/lib/director/derived_dc.rb @@ -278,7 +278,7 @@ def setup # like all DC this should best always be a temporary stack object # we do not allow creation in Ruby but rather provide class # methods for block execution on a temp dc - unless Config.platform == :linux + if Config.instance.features_set?('USE_PRINTING_ARCHITECTURE', Director.AnyOf(*%w[WXMSW WXOSX USE_GTKPRINT])) spec.add_extend_code 'wxGCDC', <<~__HEREDOC static VALUE draw_on(const wxPrinterDC& dc) { diff --git a/rakelib/lib/director/dialog.rb b/rakelib/lib/director/dialog.rb index 584a277b..e517b4e9 100644 --- a/rakelib/lib/director/dialog.rb +++ b/rakelib/lib/director/dialog.rb @@ -24,6 +24,7 @@ def setup when 'wxDialog' spec.items << 'wxDialogLayoutAdapter' spec.gc_as_object 'wxDialogLayoutAdapter' + spec.suppress_warning(514, 'wxDialogLayoutAdapter') spec.disown 'wxDialogLayoutAdapter* adapter' spec.new_object 'wxDialog::SetLayoutAdapter' spec.ignore('wxDialog::GetContentWindow', diff --git a/rakelib/lib/director/drag_image.rb b/rakelib/lib/director/drag_image.rb index cc66ddf2..586207fc 100644 --- a/rakelib/lib/director/drag_image.rb +++ b/rakelib/lib/director/drag_image.rb @@ -15,9 +15,8 @@ class DragImage < Director include Typemap::TreeItemId def setup - unless Config.instance.features_set?('__WXUNIVERSAL__') - spec.ignore('wxDragImage::DoDrawImage', 'wxDragImage::GetImageRect', 'wxDragImage::UpdateBackingFromWindow') - end + # If wxRuby ever supports WXUNIVERSAL this should change to #ignore_unless + spec.ignore('wxDragImage::DoDrawImage', 'wxDragImage::GetImageRect', 'wxDragImage::UpdateBackingFromWindow') super end end # class DragImage diff --git a/rakelib/lib/director/event.rb b/rakelib/lib/director/event.rb index 87af9ac4..00f28069 100644 --- a/rakelib/lib/director/event.rb +++ b/rakelib/lib/director/event.rb @@ -195,8 +195,8 @@ class WXRUBY_EXPORT wxRubyCommandEvent : public wxCommandEvent } __HEREDOC spec.ignore 'wxQueueEvent' - spec.ignore('wxEVT_HOTKEY') unless Config.instance.features_set?('wxUSE_HOTKEY') - spec.ignore('wxEVT_MOUSE_CAPTURE_CHANGED', 'wxEVT_MOUSE_CAPTURE_LOST', 'wxEVT_DISPLAY_CHANGED') unless Config.instance.features_set?('__WXMSW__') + spec.ignore_unless('USE_HOTKEY', 'wxEVT_HOTKEY') + spec.ignore_unless('WXMSW', 'wxEVT_MOUSE_CAPTURE_CHANGED', 'wxEVT_MOUSE_CAPTURE_LOST', 'wxEVT_DISPLAY_CHANGED') # make sure this event constant definition exists spec.add_swig_code %Q{%constant wxEventType wxEVT_MENU_HIGHLIGHT_ALL = wxEVT_MENU_HIGHLIGHT;} # add event type constant missing from interface defs diff --git a/rakelib/lib/director/frame.rb b/rakelib/lib/director/frame.rb index 245ab225..fe3bdc98 100644 --- a/rakelib/lib/director/frame.rb +++ b/rakelib/lib/director/frame.rb @@ -21,17 +21,7 @@ def setup when 'wxFrame' spec.ignore %w[ wxFrame::OnCreateStatusBar wxFrame::OnCreateToolBar] - if Config.instance.features_set?(*%w[__WXMSW__ wxUSE_TASKBARBUTTON]) - spec.items << 'wxTaskBarButton' << 'wxThumbBarButton' - spec.no_proxy 'wxTaskBarButton' - spec.gc_as_untracked 'wxTaskBarButton', 'wxThumbBarButton' - spec.disown 'wxThumbBarButton *button' - # superfluous and causing trouble for disown policy (re-implemented in pure Ruby) - spec.ignore 'wxTaskBarButton::RemoveThumbBarButton(wxThumbBarButton*)', ignore_doc: false - spec.new_object 'wxTaskBarButton::RemoveThumbBarButton(int)' - else - spec.ignore('wxFrame::MSWGetTaskBarButton') - end + spec.ignore_unless(%w[WXMSW USE_TASKBARBUTTON], 'wxFrame::MSWGetTaskBarButton') # this reimplemented window base method need to be properly wrapped but # is missing from the XML docs spec.extend_interface('wxFrame', 'virtual void OnInternalIdle()') diff --git a/rakelib/lib/director/gdicommon.rb b/rakelib/lib/director/gdicommon.rb index 52ed4363..32bada8b 100644 --- a/rakelib/lib/director/gdicommon.rb +++ b/rakelib/lib/director/gdicommon.rb @@ -78,16 +78,14 @@ def setup wxPoint::x wxPoint::y wxRealPoint::x wxRealPoint::y ] - spec.ignore('wxStockCursor.wxCURSOR_DEFAULT') unless Config.instance.features_set?('__WXGTK__') - unless Config.instance.features_set?('__X__') - spec.ignore %w{ - wxStockCursor.wxCURSOR_CROSS_REVERSE - wxStockCursor.wxCURSOR_DOUBLE_ARROW - wxStockCursor.wxCURSOR_BASED_ARROW_UP - wxStockCursor.wxCURSOR_BASED_ARROW_DOWN - } - end - spec.ignore('wxStockCursor.wxCURSOR_COPY_ARROW') unless Config.instance.features_set?('__WXOSX__') + spec.ignore_unless('WXGTK', 'wxStockCursor.wxCURSOR_DEFAULT') + spec.ignore_unless 'WXX11', %w{ + wxStockCursor.wxCURSOR_CROSS_REVERSE + wxStockCursor.wxCURSOR_DOUBLE_ARROW + wxStockCursor.wxCURSOR_BASED_ARROW_UP + wxStockCursor.wxCURSOR_BASED_ARROW_DOWN + } + spec.ignore_unless('WXOSX', 'wxStockCursor.wxCURSOR_COPY_ARROW') spec.add_extend_code 'wxRect', <<~__HEREDOC wxRect add(const wxRect &rect) const { return (*(const wxRect*)$self) + rect; diff --git a/rakelib/lib/director/graphics_context.rb b/rakelib/lib/director/graphics_context.rb index 13df8f94..6dad28cb 100644 --- a/rakelib/lib/director/graphics_context.rb +++ b/rakelib/lib/director/graphics_context.rb @@ -34,9 +34,7 @@ def setup 'wxGraphicsContext::DrawLines(size_t, const wxPoint2DDouble *, wxPolygonFillMode)', 'wxGraphicsContext::StrokeLines(size_t, const wxPoint2DDouble *)', 'wxGraphicsContext::StrokeLines (size_t, const wxPoint2DDouble *, const wxPoint2DDouble *)' - if Config.platform == :linux - spec.ignore 'wxGraphicsContext::Create(const wxPrinterDC &)' - end + spec.ignore_unless(Config::AnyOf.new('WXMSW', 'WXOSX', 'USE_GTKPRINT'), 'wxGraphicsContext::Create(const wxPrinterDC &)') spec.add_header_code <<~__HEREDOC // special free funcs are needed to clean up Dashes array if it has been // set; wxWidgets does not do this automatically so will leak if not @@ -229,7 +227,7 @@ def setup __CODE end # add convenience method providing efficient gc memory management - unless Config.platform == :linux + if Config.instance.features_set?('USE_PRINTING_ARCHITECTURE', Director.AnyOf(*%w[WXMSW WXOSX USE_GTKPRINT])) spec.add_extend_code 'wxGraphicsContext', <<~__HEREDOC static VALUE draw_on(const wxPrinterDC& dc) { diff --git a/rakelib/lib/director/list_ctrl.rb b/rakelib/lib/director/list_ctrl.rb index 3534fee9..91ab2e38 100644 --- a/rakelib/lib/director/list_ctrl.rb +++ b/rakelib/lib/director/list_ctrl.rb @@ -55,12 +55,11 @@ def setup (void)self->EditLabel(item); } __HEREDOC - unless Config.instance.features_set?('wxHAS_LISTCTRL_COLUMN_ORDER') - spec.ignore %w[wxListCtrl::GetColumnIndexFromOrder - wxListCtrl::GetColumnOrder - wxListCtrl::GetColumnsOrder - wxListCtrl::SetColumnsOrder] - end + spec.ignore_unless 'HAS_LISTCTRL_COLUMN_ORDER', + %w[wxListCtrl::GetColumnIndexFromOrder + wxListCtrl::GetColumnOrder + wxListCtrl::GetColumnsOrder + wxListCtrl::SetColumnsOrder] # these are protected so ignored by default but we want them here spec.regard %w[ wxListCtrl::OnGetItemAttr diff --git a/rakelib/lib/director/locale.rb b/rakelib/lib/director/locale.rb index 3d221b93..de06eb9b 100644 --- a/rakelib/lib/director/locale.rb +++ b/rakelib/lib/director/locale.rb @@ -28,9 +28,7 @@ def setup wxLanguageInfo::DescriptionNative wxLanguageInfo::LayoutDirection ] - if Config.instance.features_set?('__WXMSW__') - spec.regard('wxLanguageInfo::WinLang', 'wxLanguageInfo::WinSublang') - end + spec.ignore_unless('WXMSW', 'wxLanguageInfo::WinLang', 'wxLanguageInfo::WinSublang') end end # class Locale diff --git a/rakelib/lib/director/log.rb b/rakelib/lib/director/log.rb index e4a68480..0cf1ca39 100644 --- a/rakelib/lib/director/log.rb +++ b/rakelib/lib/director/log.rb @@ -14,16 +14,13 @@ class Log < Director def setup spec.gc_as_object %w[wxLog wxLogChain wxLogInterposer wxLogWindow] - spec.items.concat(%w[wxLogBuffer wxLogChain wxLogGui wxLogStderr wxLogStream wxLogTextCtrl wxLogInterposer wxLogWindow wxLogNull wxLogRecordInfo]) + spec.items.concat(%w[wxLogBuffer wxLogChain wxLogGui wxLogStderr wxLogTextCtrl wxLogInterposer wxLogWindow wxLogNull wxLogRecordInfo]) spec.no_proxy(%w[wxLogBuffer wxLogGui wxLogStderr wxLogTextCtrl wxLogWindow]) spec.force_proxy(%w[wxLogInterposer]) spec.ignore 'wxLog::SetFormatter' spec.regard %w[wxLog::DoLogRecord wxLog::DoLogTextAtLevel wxLog::DoLogText] spec.ignore 'wxLogBuffer::Flush' spec.ignore 'wxLogGui::Flush' - if Config.instance.features_set?('wxUSE_STD_IOSTREAM') - spec.ignore 'wxLogStream' - end # wxLogStderr spec.ignore 'wxLogStderr::wxLogStderr' spec.add_extend_code 'wxLogStderr', <<~__HEREDOC diff --git a/rakelib/lib/director/menu_item.rb b/rakelib/lib/director/menu_item.rb index da16e228..66885938 100644 --- a/rakelib/lib/director/menu_item.rb +++ b/rakelib/lib/director/menu_item.rb @@ -21,11 +21,11 @@ def setup spec.ignore(%w[wxMenuItem::GetLabel wxMenuItem::GetName wxMenuItem::GetText wxMenuItem::SetText wxMenuItem::GetLabelFromText]) # ignore this as there is no implementation anymore spec.ignore 'wxMenuItem::GetAccelFromString' - spec.ignore('wxMenuItem::GetAccel') unless Config.instance.features_set?('wxUSE_ACCEL') + spec.ignore_unless('USE_ACCEL', 'wxMenuItem::GetAccel') spec.no_proxy 'wxMenuItem::GetAccel' spec.ignore 'wxMenuItem::GetBitmap(bool)' # not portable if Config.instance.wx_version >= '3.3.0' - spec.ignore('wxMenuItem::SetBackgroundColour','wxMenuItem::SetFont','wxMenuItem::SetTextColour') unless Config.instance.features_set?('__WXMSW__') + spec.ignore_unless('WXMSW', 'wxMenuItem::SetBackgroundColour','wxMenuItem::SetFont','wxMenuItem::SetTextColour') end super end diff --git a/rakelib/lib/director/pgproperties.rb b/rakelib/lib/director/pgproperties.rb index fac28e71..becaf46a 100644 --- a/rakelib/lib/director/pgproperties.rb +++ b/rakelib/lib/director/pgproperties.rb @@ -141,7 +141,7 @@ def setup spec.map_apply 'int * OUTPUT' => 'int* pIndex' end # for UIntProperty and IntProperty - if Config.instance.features_set?('wxUSE_LONGLONG') + if Config.instance.features_set?('USE_LONGLONG') # wxLongLong mapping to be considered before considering 'long' (see typecheck precedence) spec.map 'const wxLongLong&' => 'Integer' do map_in temp: 'wxLongLong tmp', code: <<~__CODE diff --git a/rakelib/lib/director/property_grid_interface.rb b/rakelib/lib/director/property_grid_interface.rb index ad50a2ec..79ba294d 100644 --- a/rakelib/lib/director/property_grid_interface.rb +++ b/rakelib/lib/director/property_grid_interface.rb @@ -39,16 +39,11 @@ def setup spec.extend_interface 'wxPropertyGridInterface', 'void SetPropertyValues(const wxVariant &list, const wxPGPropArgCls& defaultCategory = 0)' # optionals - unless Config.instance.features_set?('wxUSE_LONGLONG') - spec.ignore 'wxPropertyGridInterface::GetPropertyValueAsLongLong', - 'wxPropertyGridInterface::GetPropertyValueAsULongLong' - end - unless Config.instance.features_set?('wxUSE_DATETIME') - spec.ignore 'wxPropertyGridInterface::GetPropertyValueAsDateTime' - end - unless Config.instance.features_set?('wxUSE_VALIDATORS') - spec.ignore 'wxPropertyGridInterface::GetPropertyValidator' - end + spec.ignore_unless 'USE_LONGLONG', + 'wxPropertyGridInterface::GetPropertyValueAsLongLong', + 'wxPropertyGridInterface::GetPropertyValueAsULongLong' + spec.ignore_unless 'USE_DATETIME', 'wxPropertyGridInterface::GetPropertyValueAsDateTime' + spec.ignore_unless 'USE_VALIDATORS', 'wxPropertyGridInterface::GetPropertyValidator' # fix incorrect XML documentation spec.ignore 'wxPropertyGridInterface::SetPropertyImage', ignore_doc: false # ignore non-const BitmapBundle arg decl # and add correct decl diff --git a/rakelib/lib/director/richtext_ctrl.rb b/rakelib/lib/director/richtext_ctrl.rb index 9d27fc3d..98dc89d1 100644 --- a/rakelib/lib/director/richtext_ctrl.rb +++ b/rakelib/lib/director/richtext_ctrl.rb @@ -15,7 +15,7 @@ class Director class RichTextCtrl < Window include Typemap::RichText - if Config.instance.features_set?('wxUSE_DATETIME') + if Config.instance.features_set?('USE_DATETIME') include Typemap::DateTime end @@ -117,9 +117,7 @@ def setup wxRichTextCtrl::ProcessMouseMovement wxRichTextCtrl::ProcessBackKey ] - unless Config.instance.features_set?('wxUSE_DATETIME') - spec.ignore %w[wxRichTextCtrl::GetDragStartTime wxRichTextCtrl::SetDragStartTime] - end + spec.ignore_unless 'USE_DATETIME', %w[wxRichTextCtrl::GetDragStartTime wxRichTextCtrl::SetDragStartTime] spec.add_header_code 'extern VALUE wxRuby_RichTextObject2Ruby(const wxRichTextObject *wx_rto, int own);' spec.swig_import('swig/classes/include/wxTextAttr.h', 'swig/classes/include/wxRichTextObject.h', diff --git a/rakelib/lib/director/richtext_formatting_dialog.rb b/rakelib/lib/director/richtext_formatting_dialog.rb index 3d2f0089..4a999e9b 100644 --- a/rakelib/lib/director/richtext_formatting_dialog.rb +++ b/rakelib/lib/director/richtext_formatting_dialog.rb @@ -27,11 +27,13 @@ def setup wxRichTextFormattingDialog::SetStyle wxRichTextFormattingDialog::SetStyleDefinition ] - # add undocumented methods - spec.extend_interface 'wxRichTextFormattingDialog', - 'wxRichTextObject* GetObject() const', - 'void SetObject(wxRichTextObject* obj)', - 'virtual bool ApplyStyle(wxRichTextCtrl* ctrl, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO)' + if Config.instance.wx_version < '3.3.0' + # add undocumented methods + spec.extend_interface 'wxRichTextFormattingDialog', + 'wxRichTextObject* GetObject() const', + 'void SetObject(wxRichTextObject* obj)', + 'virtual bool ApplyStyle(wxRichTextCtrl* ctrl, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO)' + end spec.add_header_code 'extern VALUE wxRuby_RichTextObject2Ruby(const wxRichTextObject *wx_rto, int own);' spec.disown 'wxRichTextFormattingDialogFactory *factory' spec.suppress_warning(473, 'wxRichTextFormattingDialogFactory::CreatePage') diff --git a/rakelib/lib/director/static_box.rb b/rakelib/lib/director/static_box.rb index 42893c9b..b72f8ccc 100644 --- a/rakelib/lib/director/static_box.rb +++ b/rakelib/lib/director/static_box.rb @@ -16,11 +16,10 @@ class StaticBox < Window def setup super - if Config.instance.wx_port == :wxqt || Config.platform == :macosx - # missing from implementation currently - spec.ignore 'wxStaticBox::wxStaticBox(wxWindow *, wxWindowID, wxWindow *, const wxPoint &, const wxSize &, long, const wxString &)', - 'wxStaticBox::Create(wxWindow *, wxWindowID, wxWindow *, const wxPoint &, const wxSize &, long, const wxString &)' - end + # missing from implementation currently for WXOSX (and WXQT) + spec.ignore_unless(Config::AnyOf.new(*%w[WXMSW WXGTK]), + 'wxStaticBox::wxStaticBox(wxWindow *, wxWindowID, wxWindow *, const wxPoint &, const wxSize &, long, const wxString &)', + 'wxStaticBox::Create(wxWindow *, wxWindowID, wxWindow *, const wxPoint &, const wxSize &, long, const wxString &)') end end # class StaticBox diff --git a/rakelib/lib/director/task_bar_button.rb b/rakelib/lib/director/task_bar_button.rb new file mode 100644 index 00000000..b3a91e3d --- /dev/null +++ b/rakelib/lib/director/task_bar_button.rb @@ -0,0 +1,30 @@ +# Copyright (c) 2023 M.J.N. Corino, The Netherlands +# +# This software is released under the MIT license. + +### +# wxRuby3 wxWidgets interface director +### + +module WXRuby3 + + class Director + + class TaskBarButton < Director + + def setup + super + spec.items << 'wxThumbBarButton' + spec.no_proxy 'wxTaskBarButton' + spec.gc_as_untracked 'wxTaskBarButton', 'wxThumbBarButton' + spec.disown 'wxThumbBarButton *button' + # superfluous and causing trouble for disown policy (re-implemented in pure Ruby) + spec.ignore 'wxTaskBarButton::RemoveThumbBarButton(wxThumbBarButton*)', ignore_doc: false + spec.new_object 'wxTaskBarButton::RemoveThumbBarButton(int)' + end + + end + + end + +end diff --git a/rakelib/lib/director/textctrl.rb b/rakelib/lib/director/textctrl.rb index 1ab3f83b..4943dcd5 100644 --- a/rakelib/lib/director/textctrl.rb +++ b/rakelib/lib/director/textctrl.rb @@ -32,7 +32,7 @@ def setup # we will not wrap it but create a simplified interface when USE_SPELLCHECK is enabled which # we will complement in pure Ruby to provide Wx::TextProofOptions class spec.ignore('wxTextCtrl::EnableProofCheck', 'wxTextCtrl::GetProofCheckOptions') - if Config.instance.features_set?('wxUSE_SPELLCHECK') + if Config.instance.features_set?('USE_SPELLCHECK') spec.add_extend_code 'wxTextCtrl', <<~__HEREDOC VALUE DoEnableProofCheck(bool spelling, bool grammar, const wxString& language) { diff --git a/rakelib/lib/director/tool_tip.rb b/rakelib/lib/director/tool_tip.rb index 7eae684b..d909e817 100644 --- a/rakelib/lib/director/tool_tip.rb +++ b/rakelib/lib/director/tool_tip.rb @@ -13,7 +13,7 @@ class Director class ToolTip < Director def setup - spec.ignore('wxToolTip::SetMaxWidth') unless Config.instance.features_set?('__WXMSW__') + spec.ignore_unless('WXMSW', 'wxToolTip::SetMaxWidth') super end end # class ToolTip diff --git a/rakelib/lib/director/top_level_window.rb b/rakelib/lib/director/top_level_window.rb index b970a160..ff4b5622 100644 --- a/rakelib/lib/director/top_level_window.rb +++ b/rakelib/lib/director/top_level_window.rb @@ -41,15 +41,14 @@ def setup wxTopLevelWindow::RestoreToGeometry wxTopLevelWindow::GeometrySerializer } - unless Config.instance.features_set?('__WXUNIVERSAL__') - spec.ignore %w{ + # #ignore_unless if wxRuby one day supports 'WXUNIVERSAL' + spec.ignore %w{ wxTopLevelWindow::IsUsingNativeDecorations wxTopLevelWindow::UseNativeDecorations wxTopLevelWindow::UseNativeDecorationsByDefault } - end - spec.ignore('wxTopLevelWindow::MSWGetSystemMenu') unless Config.instance.features_set?('__WXMSW__') - spec.ignore('wxTopLevelWindow::OSXSetModified','wxTopLevelWindow::OSXIsModified') unless Config.instance.features_set?('__WXOSX__') + spec.ignore_unless('WXMSW', 'wxTopLevelWindow::MSWGetSystemMenu') + spec.ignore_unless('WXOSX', 'wxTopLevelWindow::OSXSetModified','wxTopLevelWindow::OSXIsModified') spec.swig_import 'swig/classes/include/wxDefs.h' # incorrectly documented here spec.override_events 'wxTopLevelWindow', diff --git a/rakelib/lib/director/tree_ctrl.rb b/rakelib/lib/director/tree_ctrl.rb index 77ef7bff..d1800aba 100644 --- a/rakelib/lib/director/tree_ctrl.rb +++ b/rakelib/lib/director/tree_ctrl.rb @@ -75,7 +75,7 @@ class WxRubyTreeCtrl : public wxTreeCtrl wxTreeCtrl::GetFocusedItem wxTreeCtrl::GetSelection ] - if Config.instance.features_set?('wxHAS_LAST_VISIBLE') + if Config.instance.features_set?('HAS_LAST_VISIBLE') spec.no_proxy 'wxTreeCtrl::GetLastVisible' end # simply a nuisance to support @@ -94,10 +94,9 @@ class WxRubyTreeCtrl : public wxTreeCtrl (void)self->EditLabel(item); } __HEREDOC - if [:wxmsw, :wxqt].include?(Config.instance.wx_port) - spec.ignore('wxTreeCtrl::SetButtonsImageList') - spec.ignore('wxTreeCtrl::GetButtonsImageList') - end + spec.ignore_unless(Config::AnyOf.new(*%w[WXGTK WXOSX]), + 'wxTreeCtrl::SetButtonsImageList', + 'wxTreeCtrl::GetButtonsImageList') # these reimplemented window base methods need to be properly wrapped but # are missing from the XML docs spec.extend_interface('wxTreeCtrl', diff --git a/rakelib/lib/director/variant.rb b/rakelib/lib/director/variant.rb index 8bfe9dc1..a339201f 100644 --- a/rakelib/lib/director/variant.rb +++ b/rakelib/lib/director/variant.rb @@ -227,7 +227,7 @@ def setup $1 = rb_obj_is_kind_of($input, rb_const_get(mWxPG, var_ColourPropertyValue_id())); __CODE end - if Config.instance.features_set?('wxUSE_LONGLONG') + if Config.instance.features_set?('USE_LONGLONG') # wxLongLong mapping to be considered before considering 'long' (see typecheck precedence) spec.map 'wxLongLong' => 'Integer' do map_in code: <<~__CODE diff --git a/rakelib/lib/director/window.rb b/rakelib/lib/director/window.rb index 2a538dbc..cf660260 100644 --- a/rakelib/lib/director/window.rb +++ b/rakelib/lib/director/window.rb @@ -109,15 +109,15 @@ def setup spec.ignore 'wxWindow::EnableTouchEvents' end if Config.instance.wx_version >= '3.3.0' - spec.ignore('wxWindow::MSWDisableComposited') unless Config.instance.features_set?('__WXMSW__') + spec.ignore_unless('WXMSW', 'wxWindow::MSWDisableComposited') end - if Config.instance.features_set?('wxUSE_ACCESSIBILITY') + if Config.instance.features_set?('USE_ACCESSIBILITY') spec.disown 'wxAccessible *accessible' else spec.ignore('wxWindow::SetAccessible', 'wxWindow::GetAccessible') end - spec.ignore(%w[wxWindow::RegisterHotKey wxWindow::UnregisterHotKey]) unless Config.instance.features_set?('wxUSE_HOTKEY') + spec.ignore_unless('USE_HOTKEY', %w[wxWindow::RegisterHotKey wxWindow::UnregisterHotKey]) spec.ignore('wxWindow::SetSize(int, int)') # not useful as the wxSize variant will also accept an array spec.swig_import %w{ swig/classes/include/wxObject.h diff --git a/rakelib/lib/extractor.rb b/rakelib/lib/extractor.rb index 30ec49d1..d7073f48 100644 --- a/rakelib/lib/extractor.rb +++ b/rakelib/lib/extractor.rb @@ -182,7 +182,7 @@ def initialize(element = nil) extract(element) if element end - attr_accessor :name, :rb_name, :ignored, :docs_ignored, :brief_doc, :detailed_doc, :deprecated, :only_for, :items + attr_accessor :name, :rb_name, :brief_doc, :detailed_doc, :deprecated, :only_for, :items def extra_attributes @extra_attributes ||= {} @@ -221,8 +221,10 @@ def extract(element) @detailed_doc = element.xpath('detaileddescription') if (el = @detailed_doc.at_xpath('para/onlyfor')) @only_for = el.text.strip.split(',').collect { |s| s.downcase } - @ignored = @only_for.none? { |s| Config.instance.wx_port == s.to_sym } - @docs_ignored = @ignored + unless @only_for.empty? + @ignored = [Config::AnyOf.new(*@only_for.collect { |s| s.upcase })] # transform to feature ids like 'WXGTK' + @docs_ignored = @ignored + end end end end @@ -256,12 +258,39 @@ def clear_deprecated end end + def get_ignore_val(val) + if val.is_a?(::Array) + val + elsif val.is_a?(Config::AnyOf) || val.is_a?(::String) + [val] + else + !!val + end + end + private :get_ignore_val + def ignore(val = true, ignore_doc: nil) - @ignored = !!val - @docs_ignored = ignore_doc.nil? ? @ignored : ignore_doc + @ignored = get_ignore_val(val) + @docs_ignored = if ignore_doc.nil? + @ignored + else + get_ignore_val(ignore_doc) + end self end + def ignored + @ignored == true || (@ignored.is_a?(::Array) && !Config.instance.features_set?(*@ignored)) + end + + def docs_ignored(fulldocs) + @docs_ignored == true || (!fulldocs && @docs_ignored.is_a?(::Array) && !Config.instance.features_set?(*@docs_ignored)) + end + + def required_features_doc + @docs_ignored.is_a?(::Array) ? @docs_ignored : nil + end + def find(name) # Locate and return an item within this item that has a matching name. # The name string can use a dotted notation to continue the search diff --git a/rakelib/lib/extractor/function.rb b/rakelib/lib/extractor/function.rb index 956be634..c7e17b92 100644 --- a/rakelib/lib/extractor/function.rb +++ b/rakelib/lib/extractor/function.rb @@ -75,14 +75,14 @@ def rb_decl_name "self.#{rb_method_name(rb_name || name)}" end - def rb_doc(xml_trans, type_maps) - ovls = all.select {|m| !m.docs_ignored && !m.deprecated } - ovl_docs = ovls.collect { |mo| mo.rb_doc_decl(xml_trans, type_maps) } - ovl_docs.inject({}) do |docs, (name, params, doc)| + def rb_doc(xml_trans, type_maps, fulldocs=false) + ovls = all.select {|m| !m.docs_ignored(fulldocs) && !m.deprecated } + ovl_docs = ovls.collect { |mo| [mo]+mo.rb_doc_decl(xml_trans, type_maps) } + ovl_docs.inject({}) do |docs, (movl, name, params, doc)| if docs.has_key?(name) - docs[name] << [params, doc] + docs[name] << [movl, params, doc] else - docs[name] = [[params, doc]] + docs[name] = [[movl, params, doc]] end docs end diff --git a/rakelib/lib/generate/analyzer.rb b/rakelib/lib/generate/analyzer.rb index 23e557ed..6e3cb4ea 100644 --- a/rakelib/lib/generate/analyzer.rb +++ b/rakelib/lib/generate/analyzer.rb @@ -87,7 +87,7 @@ def initialize(director, classdef, doc_gen = false) attr_reader :director, :classdef, :class_spec_name, :class_registry def item_ignored?(item) - @doc_gen ? item.docs_ignored : item.ignored + @doc_gen ? item.docs_ignored(Director::Package.full_docs?) : item.ignored end private :item_ignored? @@ -482,12 +482,17 @@ def gen_base_class_enum_typemaps(cls_spec_name, enum_maps) end end + def item_ignored(item, doc_gen) + doc_gen ? item.docs_ignored(Director::Package.full_docs?) : item.ignored + end + private :item_ignored + def preprocess(enum_maps, doc_gen = false) STDERR.puts "** Preprocessing #{module_name}" if Director.trace? def_items.each do |item| case item when Extractor::ClassDef - if !(doc_gen ? item.docs_ignored : item.ignored) && + if !item_ignored(item, doc_gen) && (!item.is_template? || template_as_class?(item.name)) && !is_folded_base?(item.name) clsproc = ClassProcessor.new(director, item, doc_gen) @@ -536,7 +541,7 @@ def check_interface_methods(director, doc_gen: false) errors = [] warnings = [] def_items.each do |item| - if Extractor::ClassDef === item && !(doc_gen ? item.docs_ignored : item.ignored) && + if Extractor::ClassDef === item && !item_ignored(item, doc_gen) && (!item.is_template? || template_as_class?(item.name)) && !is_folded_base?(item.name) intf_class_name = if item.is_template? || template_as_class?(item.name) diff --git a/rakelib/lib/generate/doc.rb b/rakelib/lib/generate/doc.rb index 0cbffad5..d25eb046 100644 --- a/rakelib/lib/generate/doc.rb +++ b/rakelib/lib/generate/doc.rb @@ -151,8 +151,10 @@ def _ident_to_ref(idstr) def text_to_doc(node) text = node.text # handle left-over doxygen tags + text.gsub!(/#(\w)/, '\#\1') text.gsub!(/@(end)?code/, '') - text.gsub!('@subsection', '==') + text.gsub!('@subsection', '##') + text = '' if text.strip == '##' # no empty headings text.gsub!('@remarks', '') text.gsub!(/@see.*\n/, '') text.gsub!('@ref', '') @@ -224,6 +226,10 @@ def programlisting_to_doc(node) end end + def onlyfor_to_doc(node) + '' # handled elsewhere + end + def simplesect_to_doc(node) case node['kind'] when 'since' # get rid of 'Since' notes @@ -233,6 +239,22 @@ def simplesect_to_doc(node) @see_list.concat node_to_doc(node).split(',') end '' + when 'note' + <<~__NOTE + +
+ Note: +

#{node_to_doc(node)}

+
+ __NOTE + when 'remark' + <<~__NOTE + +
+ Remark: +

#{node_to_doc(node)}

+
> + __NOTE else node_to_doc(node) end @@ -280,7 +302,9 @@ def _is_static_method?(clsnm, mtdname) def _ident_str_to_doc(s, ref_scope = nil) return s if no_idents? - return s if %w[wxRuby wxMSW wxOSX wxGTK wxX11 wxMac].any? { |w| s.start_with?(w) } + return s if s.start_with?('wxRuby') + return 'WXOSX' if s.start_with?('wxMac') + return s.sub(/\Awx/, 'WX') if %w[wxMSW wxOSX wxGTK wxX11 wxUNIVERSAL].any? { |w| s.start_with?(w) } nmlist = s.split('::') nm_str = nmlist.shift.to_s constnm = rb_wx_name(nm_str) @@ -409,7 +433,8 @@ def heading_to_doc(node) lvl = 1+(node['level'] || '1').to_i txt = node_to_doc(node) event_section(/Events emitted by this class|Events using this class/i =~ txt) - "#{'#' * lvl} #{txt}" + txt.strip! + txt.empty? ? txt : "#{'#' * lvl} #{txt}" end # transform all itemizedlist @@ -682,6 +707,36 @@ def run protected + def to_feature_text(feat) + if Config::AnyOf === feat + feat.features.collect { |f| f.is_a?(::Array) ? f.join('&') : f }.join('|') + else + feat + end + end + private :to_feature_text + + def gen_item_requirements(fdoc, item) + if item.required_features_doc + fdoc.doc.puts '@wxrb_require ' + item.required_features_doc.collect(&->(feat){ to_feature_text(feat) }).join(',') + end + end + + def has_class_requirements? + !(ifspec.requirements.empty? && ifspec.package.required_features.empty?) + end + + def get_class_requirements + ifspec.requirements + ifspec.package.required_features.to_a + end + private :get_class_requirements + + def gen_class_requirements(fdoc) + if has_class_requirements? + fdoc.doc.puts '@wxrb_require ' + get_class_requirements.collect(&->(feat){ to_feature_text(feat) }).join(',') + end + end + def get_constant_doc(const) @xml_trans.to_doc(const.brief_doc, item: const) end @@ -718,6 +773,7 @@ def get_enum_doc(enumdef) def gen_enum_doc(fdoc, enumname, enumdef, enum_table) fdoc.doc.puts get_enum_doc(enumdef) + gen_class_requirements(fdoc) fdoc.puts "class #{enumname} < Wx::Enum" fdoc.puts fdoc.indent do @@ -734,7 +790,7 @@ def gen_enum_doc(fdoc, enumname, enumdef, enum_table) def gen_constants_doc(fdoc) xref_table = package.all_modules.reduce(DocGenerator.constants_db) { |db, mod| db[mod] } - def_items.select {|itm| !itm.docs_ignored }.each do |item| + def_items.select {|itm| !itm.docs_ignored(Director::Package.full_docs?) }.each do |item| case item when Extractor::GlobalVarDef unless no_gen?(:variables) @@ -773,22 +829,24 @@ def gen_constants_doc(fdoc) end def get_function_doc(func) - func.rb_doc(@xml_trans, type_maps) + func.rb_doc(@xml_trans, type_maps, Director::Package.full_docs?) end def gen_functions_doc(fdoc) - def_items.select {|itm| !itm.docs_ignored }.each do |item| - if Extractor::FunctionDef === item && !item.docs_ignored + def_items.select {|itm| !itm.docs_ignored(Director::Package.full_docs?) }.each do |item| + if Extractor::FunctionDef === item get_method_doc(item).each_pair do |name, docs| if docs.size>1 # method with overloads? - docs.each do |params, ovl_doc| + docs.each do |ovl, params, ovl_doc| fdoc.doc.puts "@overload #{name}(#{params})" fdoc.doc.indent { fdoc.doc.puts ovl_doc } + fdoc.doc.indent { gen_item_requirements(fdoc, ovl) } end fdoc.puts "def #{name}(*args) end" else - params, doc = docs.shift + mtd, params, doc = docs.shift fdoc.doc.puts doc + gen_item_requirements(fdoc, mtd) if params.empty? fdoc.puts "def #{name}; end" else @@ -808,7 +866,7 @@ def get_class_doc(cls) end def get_method_doc(mtd) - mtd.rb_doc(@xml_trans, type_maps) + mtd.rb_doc(@xml_trans, type_maps, Director::Package.full_docs?) end def get_method_head(clsdef, mtdef) @@ -836,14 +894,16 @@ def gen_class_doc_members(fdoc, clsdef, cls_members, alias_methods) mtd_head = get_method_head(clsdef, cm) get_method_doc(mtd_head).each_pair do |name, docs| if docs.size>1 # method with overloads? - docs.each do |params, ovl_doc| + docs.each do |ovl, params, ovl_doc| fdoc.doc.puts "@overload #{name}(#{params})" fdoc.doc.indent { fdoc.doc.puts ovl_doc } + fdoc.doc.indent { gen_item_requirements(fdoc, ovl) } end fdoc.puts "def #{name}(*args) end" else - params, doc = docs.shift + mtd, params, doc = docs.shift fdoc.doc.puts doc + gen_item_requirements(fdoc, mtd) if params.empty? fdoc.puts "def #{name}; end" else @@ -898,7 +958,7 @@ def gen_class_doc_members(fdoc, clsdef, cls_members, alias_methods) def gen_class_doc(fdoc) const_table = package.all_modules.reduce(DocGenerator.constants_db) { |db, mod| db[mod] } - def_items.select {|itm| !itm.docs_ignored && Extractor::ClassDef === itm && !is_folded_base?(itm.name) }.each do |item| + def_items.select {|itm| !itm.docs_ignored(Director::Package.full_docs?) && Extractor::ClassDef === itm && !is_folded_base?(itm.name) }.each do |item| if !item.is_template? || template_as_class?(item.name) @xml_trans.for_class(item) do intf_class_name = if (item.is_template? && template_as_class?(item.name)) @@ -911,9 +971,11 @@ def gen_class_doc(fdoc) fdoc.doc.puts get_class_doc(item) if is_mixin?(item) fdoc.doc.puts "\n@note In wxRuby this is a mixin module instead of a (base) class." + gen_class_requirements(fdoc) fdoc.puts "module #{clsnm}" else fdoc.doc.puts "\n@note This class is untracked and should not be derived from nor instances extended!" unless is_tracked?(item) + gen_class_requirements(fdoc) basecls = ifspec.classdef_name(base_class(item, doc: true)) fdoc.puts "class #{clsnm} < #{basecls ? basecls.sub(/\Awx/, '') : '::Object'}" end diff --git a/rakelib/lib/generate/doc/busy_info.yaml b/rakelib/lib/generate/doc/busy_info.yaml index 5122e39e..33c416d5 100644 --- a/rakelib/lib/generate/doc/busy_info.yaml +++ b/rakelib/lib/generate/doc/busy_info.yaml @@ -47,8 +47,6 @@ but take care to not cause undesirable re-entrance when doing it (see {Wx::App#yield} for more details). The simplest way to do it is to use {Wx::WindowDisabler} class as illustrated in the above example. Note that a {Wx::BusyInfo} is always built with the {Wx::STAY_ON_TOP} window style (see {Wx::Frame} window styles for more info). - - === Category: Common Dialogs diff --git a/rakelib/lib/generate/doc/clipboard.yaml b/rakelib/lib/generate/doc/clipboard.yaml index 161ff402..6b242a49 100644 --- a/rakelib/lib/generate/doc/clipboard.yaml +++ b/rakelib/lib/generate/doc/clipboard.yaml @@ -37,7 +37,5 @@ clipboard managers will automatically flush the clipboard after each new piece of data is added, while others will not. The {Wx::Clipboard#flush} function will force the clipboard manager to flush the data. - === - Category: Clipboard and Drag & Drop @see Wx::DataObject diff --git a/rakelib/lib/generate/doc/cursor.yaml b/rakelib/lib/generate/doc/cursor.yaml index 9837504a..bcbfcd72 100644 --- a/rakelib/lib/generate/doc/cursor.yaml +++ b/rakelib/lib/generate/doc/cursor.yaml @@ -13,8 +13,6 @@ the cursor for a window, as in X, rather than to set it globally as in MS Windows, although a global {set_cursor} function is also available for MS Windows use. - === - Category: Graphics Device Interface (GDI) Predefined objects/pointers: - {Wx::NULL_CURSOR} diff --git a/rakelib/lib/generate/doc/panel.yaml b/rakelib/lib/generate/doc/panel.yaml new file mode 100644 index 00000000..d7d97482 --- /dev/null +++ b/rakelib/lib/generate/doc/panel.yaml @@ -0,0 +1,7 @@ +--- +:wxPanel: + :detail: + :pre: + :simplesect: + - :pattern: !ruby/regexp /Tab\s+traversal\s+is\s+implemented.*/ + :replace: '' diff --git a/rakelib/lib/specs/interfaces.rb b/rakelib/lib/specs/interfaces.rb index 1ccdeee5..2155695e 100644 --- a/rakelib/lib/specs/interfaces.rb +++ b/rakelib/lib/specs/interfaces.rb @@ -31,8 +31,8 @@ module WXRuby3 Director.Spec(pkg, 'wxMemoryDC', director: Director::DerivedDC) Director.Spec(pkg, 'wxMirrorDC', director: Director::DerivedDC) Director.Spec(pkg, 'wxScreenDC', director: Director::DerivedDC) - Director.Spec(pkg, 'wxSVGFileDC', director: Director::DerivedDC, requirements: %w[wxUSE_SVG]) - Director.Spec(pkg, 'wxGCDC', director: Director::DerivedDC, requirements: %w[wxUSE_GRAPHICS_CONTEXT]) + Director.Spec(pkg, 'wxSVGFileDC', director: Director::DerivedDC, requirements: %w[USE_SVG]) + Director.Spec(pkg, 'wxGCDC', director: Director::DerivedDC, requirements: %w[USE_GRAPHICS_CONTEXT]) Director.Spec(pkg, 'wxScaledDC', director: Director::DerivedDC) Director.Spec(pkg, 'wxWindow') Director.Spec(pkg, 'wxEventBlocker') @@ -40,10 +40,11 @@ module WXRuby3 Director.Spec(pkg, 'wxPopupWindow') Director.Spec(pkg, 'wxTopLevelWindow') Director.Spec(pkg, 'wxFrame') + Director.Spec(pkg, 'wxTaskBarButton', requirements: %w[WXMSW USE_TASKBARBUTTON]) Director.Spec(pkg, 'wxMiniFrame', director: Director::Frame) Director.Spec(pkg, 'wxGDIObject') - Director.Spec(pkg, 'wxGraphicsObject', requirements: %w[wxUSE_GRAPHICS_CONTEXT]) - Director.Spec(pkg, 'wxGraphicsContext', requirements: %w[wxUSE_GRAPHICS_CONTEXT]) + Director.Spec(pkg, 'wxGraphicsObject', requirements: %w[USE_GRAPHICS_CONTEXT]) + Director.Spec(pkg, 'wxGraphicsContext', requirements: %w[USE_GRAPHICS_CONTEXT]) Director.Spec(pkg, 'wxBrush') Director.Spec(pkg, 'wxPen') Director.Spec(pkg, 'wxPalette') @@ -67,7 +68,7 @@ module WXRuby3 Director.Spec(pkg, 'wxBoxSizer', director: Director::Sizer) Director.Spec(pkg, 'wxWrapSizer', director: Director::Sizer) Director.Spec(pkg, 'wxControl') - Director.Spec(pkg, 'wxStatusBar', requirements: %w[wxUSE_STATUSBAR]) + Director.Spec(pkg, 'wxStatusBar', requirements: %w[USE_STATUSBAR]) Director.Spec(pkg, 'wxTextEntry') Director.Spec(pkg, 'wxTextAttr') Director.Spec(pkg, 'wxTextCtrl') @@ -82,26 +83,26 @@ module WXRuby3 Director.Spec(pkg, 'wxRadioBox') Director.Spec(pkg, 'wxPanel') Director.Spec(pkg, 'wxWithImages') - Director.Spec(pkg, 'wxBookCtrlEvent', director: Director::Event, requirements: Director.AnyOf(*%w[wxUSE_AUI wxUSE_NOTEBOOK wxUSE_LISTBOOK wxUSE_CHOICEBOOK wxUSE_TOOLBOOK wxUSE_TREEBOOK])) - Director.Spec(pkg, 'wxBookCtrlBase', director: Director::BookCtrls, requirements: Director.AnyOf(*%w[wxUSE_AUI wxUSE_NOTEBOOK wxUSE_LISTBOOK wxUSE_CHOICEBOOK wxUSE_TOOLBOOK wxUSE_TREEBOOK])) - Director.Spec(pkg, 'wxNotebook', director: Director::BookCtrls, requirements: Director.AnyOf(*%w[wxUSE_NOTEBOOK])) + Director.Spec(pkg, 'wxBookCtrlEvent', director: Director::Event, requirements: Director.AnyOf(*%w[USE_AUI USE_NOTEBOOK USE_LISTBOOK USE_CHOICEBOOK USE_TOOLBOOK USE_TREEBOOK])) + Director.Spec(pkg, 'wxBookCtrlBase', director: Director::BookCtrls, requirements: Director.AnyOf(*%w[USE_AUI USE_NOTEBOOK USE_LISTBOOK USE_CHOICEBOOK USE_TOOLBOOK USE_TREEBOOK])) + Director.Spec(pkg, 'wxNotebook', director: Director::BookCtrls, requirements: Director.AnyOf(*%w[USE_NOTEBOOK])) Director.Spec(pkg, 'wxImageList') Director.Spec(pkg, 'wxListBox') Director.Spec(pkg, 'wxChoice') Director.Spec(pkg, 'wxStaticBox') Director.Spec(pkg, 'wxSearchCtrl') - Director.Spec(pkg, 'wxCollapsiblePane', requirements: %w[wxUSE_COLLPANE]) - Director.Spec(pkg, 'wxCollapsiblePaneEvent', requirements: %w[wxUSE_COLLPANE]) + Director.Spec(pkg, 'wxCollapsiblePane', requirements: %w[USE_COLLPANE]) + Director.Spec(pkg, 'wxCollapsiblePaneEvent', requirements: %w[USE_COLLPANE]) Director.Spec(pkg, 'wxStaticLine', director: Director::Window) Director.Spec(pkg, 'wxGauge', director: Director::Window) Director.Spec(pkg, 'wxSlider') Director.Spec(pkg, 'wxScrollBar') Director.Spec(pkg, 'wxStaticText', director: Director::Window) - Director.Spec(pkg, 'wxSpinButton', director: Director::Window, requirements: %w[wxUSE_SPINBTN]) - Director.Spec(pkg, 'wxSpinEvent', director: Director::Event, requirements: Director.AnyOf(*%w[wxUSE_SPINBTN wxUSE_SPINCTRL])) - Director.Spec(pkg, 'wxSpinCtrl', director: Director::Window, requirements: %w[wxUSE_SPINCTRL]) - Director.Spec(pkg, 'wxSpinCtrlDouble', director: Director::Window, requirements: %w[wxUSE_SPINBTN]).spec.do_not_generate(:enums, :variables, :defines) - Director.Spec(pkg, 'wxSpinDoubleEvent', director: Director::Event, requirements: %w[wxUSE_SPINBTN]).spec.do_not_generate(:enums, :variables, :defines) + Director.Spec(pkg, 'wxSpinButton', director: Director::Window, requirements: %w[USE_SPINBTN]) + Director.Spec(pkg, 'wxSpinEvent', director: Director::Event, requirements: Director.AnyOf(*%w[USE_SPINBTN USE_SPINCTRL])) + Director.Spec(pkg, 'wxSpinCtrl', director: Director::Window, requirements: %w[USE_SPINCTRL]) + Director.Spec(pkg, 'wxSpinCtrlDouble', director: Director::Window, requirements: %w[USE_SPINBTN]).spec.do_not_generate(:enums, :variables, :defines) + Director.Spec(pkg, 'wxSpinDoubleEvent', director: Director::Event, requirements: %w[USE_SPINBTN]).spec.do_not_generate(:enums, :variables, :defines) Director.Spec(pkg, 'wxStaticBitmap') Director.Spec(pkg, 'wxBitmapButton', director: Director::Button) Director.Spec(pkg, 'wxCommandLinkButton', director: Director::Button) @@ -112,15 +113,15 @@ module WXRuby3 Director.Spec(pkg, 'wxRadioButton', director: Director::Window) Director.Spec(pkg, 'wxToolTip') Director.Spec(pkg, 'wxLog') - Director.Spec(pkg, 'wxToolBar', requirements: %w[wxUSE_TOOLBAR]) + Director.Spec(pkg, 'wxToolBar', requirements: %w[USE_TOOLBAR]) Director.Spec(pkg, 'wxImage') Director.Spec(pkg, 'wxDragImage') Director.Spec(pkg, 'wxFont') - Director.Spec(pkg, 'wxFontData', requirements: %w[wxUSE_FONTDLG]) - Director.Spec(pkg, 'wxFontDialog', director: Director::Dialog, requirements: %w[wxUSE_FONTDLG]) + Director.Spec(pkg, 'wxFontData', requirements: %w[USE_FONTDLG]) + Director.Spec(pkg, 'wxFontDialog', director: Director::Dialog, requirements: %w[USE_FONTDLG]) Director.Spec(pkg, 'wxPickerBase') - Director.Spec(pkg, 'wxFontPickerEvent', director: Director::Event, requirements: %w[wxUSE_FONTDLG wxUSE_FONTPICKERCTRL]) - Director.Spec(pkg, 'wxFontPickerCtrl', requirements: %w[wxUSE_FONTDLG wxUSE_FONTPICKERCTRL]) + Director.Spec(pkg, 'wxFontPickerEvent', director: Director::Event, requirements: %w[USE_FONTDLG USE_FONTPICKERCTRL]) + Director.Spec(pkg, 'wxFontPickerCtrl', requirements: %w[USE_FONTDLG USE_FONTPICKERCTRL]) Director.Spec(pkg, 'wxLocale') Director.Spec(pkg, 'wxSystemSettings') Director.Spec(pkg, 'wxSystemOptions') @@ -130,107 +131,107 @@ module WXRuby3 Director.Spec(pkg, 'wxScrolledControl', director: Director::ScrolledT) Director.Spec(pkg, 'wxVScrolledWindow') Director.Spec(pkg, 'wxVListBox') - Director.Spec(pkg, 'wxFindReplaceData', requirements: %w[wxUSE_FINDREPLDLG]) - Director.Spec(pkg, 'wxFindReplaceDialog', director: Director::Dialog, requirements: %w[wxUSE_FINDREPLDLG]) - Director.Spec(pkg, 'wxFindDialogEvent', requirements: %w[wxUSE_FINDREPLDLG]) - Director.Spec(pkg, 'wxToolbook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_TOOLBOOK])) - Director.Spec(pkg, 'wxChoicebook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_CHOICEBOOK])) - Director.Spec(pkg, 'wxListbook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_LISTBOOK])) - Director.Spec(pkg, 'wxTreebook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_TREEBOOK])) - Director.Spec(pkg, 'wxSimplebook', director: Director::BookCtrls, requirements: Director.AnyOf(%w[wxUSE_AUI wxUSE_NOTEBOOK wxUSE_LISTBOOK wxUSE_CHOICEBOOK wxUSE_TOOLBOOK wxUSE_TREEBOOK])) - Director.Spec(pkg, 'wxColourDialog', director: Director::Dialog, requirements: %w[wxUSE_COLOURDLG]) - Director.Spec(pkg, 'wxColourPickerEvent', director: Director::Event, requirements: %w[wxUSE_COLOURPICKERCTRL wxUSE_COLOURDLG]) - Director.Spec(pkg, 'wxColourPickerCtrl', requirements: %w[wxUSE_COLOURPICKERCTRL wxUSE_COLOURDLG]) + Director.Spec(pkg, 'wxFindReplaceData', requirements: %w[USE_FINDREPLDLG]) + Director.Spec(pkg, 'wxFindReplaceDialog', director: Director::Dialog, requirements: %w[USE_FINDREPLDLG]) + Director.Spec(pkg, 'wxFindDialogEvent', requirements: %w[USE_FINDREPLDLG]) + Director.Spec(pkg, 'wxToolbook', director: Director::BookCtrls, requirements: %w[USE_TOOLBOOK]) + Director.Spec(pkg, 'wxChoicebook', director: Director::BookCtrls, requirements: %w[USE_CHOICEBOOK]) + Director.Spec(pkg, 'wxListbook', director: Director::BookCtrls, requirements: %w[USE_LISTBOOK]) + Director.Spec(pkg, 'wxTreebook', director: Director::BookCtrls, requirements: %w[USE_TREEBOOK]) + Director.Spec(pkg, 'wxSimplebook', director: Director::BookCtrls, requirements: Director.AnyOf(*%w[USE_AUI USE_NOTEBOOK USE_LISTBOOK USE_CHOICEBOOK USE_TOOLBOOK USE_TREEBOOK])) + Director.Spec(pkg, 'wxColourDialog', director: Director::Dialog, requirements: %w[USE_COLOURDLG]) + Director.Spec(pkg, 'wxColourPickerEvent', director: Director::Event, requirements: %w[USE_COLOURPICKERCTRL USE_COLOURDLG]) + Director.Spec(pkg, 'wxColourPickerCtrl', requirements: %w[USE_COLOURPICKERCTRL USE_COLOURDLG]) Director.Spec(pkg, 'wxTextEntryDialog', director: Director::Dialog) Director.Spec(pkg, 'wxNumberEntryDialog', director: Director::Dialog) Director.Spec(pkg, 'wxSingleChoiceDialog', director: Director::Dialog) Director.Spec(pkg, 'wxMultiChoiceDialog', director: Director::Dialog) Director.Spec(pkg, 'wxTipProvider') - Director.Spec(pkg, 'wxDirDialog', director: Director::Dialog, requirements: %w[wxUSE_DIRDLG]) - Director.Spec(pkg, 'wxFileDialog', director: Director::Dialog, requirements: %w[wxUSE_FILEDLG]) - Director.Spec(pkg, 'wxFileDialogCustomizeHook', requirements: %w[wxUSE_FILEDLG]) - Director.Spec(pkg, 'wxFileDialogCustomControl', requirements: %w[wxUSE_FILEDLG]) - Director.Spec(pkg, 'wxFileDirPickerEvent', director: Director::Event, requirements: Director.AnyOf(%w[wxUSE_DIRDLG wxUSE_DIRPICKERCTRL], %w[wxUSE_FILEDLG wxUSE_FILEPICKERCTRL])) - Director.Spec(pkg, 'wxDirPickerCtrl', requirements: %w[wxUSE_DIRDLG wxUSE_DIRPICKERCTRL]) - Director.Spec(pkg, 'wxFilePickerCtrl', requirements: %w[wxUSE_FILEDLG wxUSE_FILEPICKERCTRL]) - Director.Spec(pkg, 'wxFileCtrl', requirements: %w[wxUSE_FILECTRL]) - Director.Spec(pkg, 'wxFileCtrlEvent', requirements: %w[wxUSE_FILECTRL]) + Director.Spec(pkg, 'wxDirDialog', director: Director::Dialog, requirements: %w[USE_DIRDLG]) + Director.Spec(pkg, 'wxFileDialog', director: Director::Dialog, requirements: %w[USE_FILEDLG]) + Director.Spec(pkg, 'wxFileDialogCustomizeHook', requirements: %w[USE_FILEDLG]) + Director.Spec(pkg, 'wxFileDialogCustomControl', requirements: %w[USE_FILEDLG]) + Director.Spec(pkg, 'wxFileDirPickerEvent', director: Director::Event, requirements: Director.AnyOf(%w[USE_DIRDLG USE_DIRPICKERCTRL], %w[USE_FILEDLG USE_FILEPICKERCTRL])) + Director.Spec(pkg, 'wxDirPickerCtrl', requirements: %w[USE_DIRDLG USE_DIRPICKERCTRL]) + Director.Spec(pkg, 'wxFilePickerCtrl', requirements: %w[USE_FILEDLG USE_FILEPICKERCTRL]) + Director.Spec(pkg, 'wxFileCtrl', requirements: %w[USE_FILECTRL]) + Director.Spec(pkg, 'wxFileCtrlEvent', requirements: %w[USE_FILECTRL]) Director.Spec(pkg, 'wxProgressDialog', director: Director::Dialog) Director.Spec(pkg, 'wxWindowDisabler') - Director.Spec(pkg, 'wxBusyInfo', requirements: %w[wxUSE_BUSYINFO]) - Director.Spec(pkg, 'wxListCtrl', requirements: %w[wxUSE_LISTCTRL]) - Director.Spec(pkg, 'wxListEvent', director: Director::Event, requirements: %w[wxUSE_LISTCTRL]) + Director.Spec(pkg, 'wxBusyInfo', requirements: %w[USE_BUSYINFO]) + Director.Spec(pkg, 'wxListCtrl', requirements: %w[USE_LISTCTRL]) + Director.Spec(pkg, 'wxListEvent', director: Director::Event, requirements: %w[USE_LISTCTRL]) Director.Spec(pkg, 'wxHeaderCtrl') Director.Spec(pkg, 'wxHeaderCtrlEvent', director: Director::Event) Director.Spec(pkg, 'wxGridSizer', director: Director::Sizer) Director.Spec(pkg, 'wxFlexGridSizer', director: Director::Sizer) Director.Spec(pkg, 'wxGBSizerItem', director: Director::SizerItem) Director.Spec(pkg, 'wxGridBagSizer', director: Director::Sizer) - Director.Spec(pkg, 'wxSplitterEvent', requirements: %w[wxUSE_SPLITTER]) - Director.Spec(pkg, 'wxSplitterWindow', requirements: %w[wxUSE_SPLITTER]) - Director.Spec(pkg, 'wxTreeEvent', requirements: %w[wxUSE_TREECTRL]) - Director.Spec(pkg, 'wxTreeCtrl', requirements: %w[wxUSE_TREECTRL]) - Director.Spec(pkg, 'wxDateEvent', requirements: %w[wxUSE_DATETIME]) - Director.Spec(pkg, 'wxCalendarEvent', director: Director::DateEvent, requirements: %w[wxUSE_CALENDARCTRL]) - Director.Spec(pkg, 'wxCalendarDateAttr', requirements: %w[wxUSE_CALENDARCTRL]) - Director.Spec(pkg, 'wxCalendarCtrl', requirements: %w[wxUSE_CALENDARCTRL]) - Director.Spec(pkg, 'wxDatePickerCtrl', requirements: %w[wxUSE_DATEPICKCTRL]) - Director.Spec(pkg, 'wxTimePickerCtrl', requirements: %w[wxUSE_TIMEPICKCTRL]) - Director.Spec(pkg, 'wxTimerEvent', director: Director::Event, requirements: %w[wxUSE_TIMER]) - Director.Spec(pkg, 'wxTimer', requirements: %w[wxUSE_TIMER]) - Director.Spec(pkg, 'wxSashEvent', requirements: %w[wxUSE_SASH]) - Director.Spec(pkg, 'wxSashWindow', requirements: %w[wxUSE_SASH]) - Director.Spec(pkg, 'wxSashLayoutWindow', requirements: %w[wxUSE_SASH]) + Director.Spec(pkg, 'wxSplitterEvent', requirements: %w[USE_SPLITTER]) + Director.Spec(pkg, 'wxSplitterWindow', requirements: %w[USE_SPLITTER]) + Director.Spec(pkg, 'wxTreeEvent', requirements: %w[USE_TREECTRL]) + Director.Spec(pkg, 'wxTreeCtrl', requirements: %w[USE_TREECTRL]) + Director.Spec(pkg, 'wxDateEvent', requirements: %w[USE_DATETIME]) + Director.Spec(pkg, 'wxCalendarEvent', director: Director::DateEvent, requirements: %w[USE_CALENDARCTRL]) + Director.Spec(pkg, 'wxCalendarDateAttr', requirements: %w[USE_CALENDARCTRL]) + Director.Spec(pkg, 'wxCalendarCtrl', requirements: %w[USE_CALENDARCTRL]) + Director.Spec(pkg, 'wxDatePickerCtrl', requirements: %w[USE_DATEPICKCTRL]) + Director.Spec(pkg, 'wxTimePickerCtrl', requirements: %w[USE_TIMEPICKCTRL]) + Director.Spec(pkg, 'wxTimerEvent', director: Director::Event, requirements: %w[USE_TIMER]) + Director.Spec(pkg, 'wxTimer', requirements: %w[USE_TIMER]) + Director.Spec(pkg, 'wxSashEvent', requirements: %w[USE_SASH]) + Director.Spec(pkg, 'wxSashWindow', requirements: %w[USE_SASH]) + Director.Spec(pkg, 'wxSashLayoutWindow', requirements: %w[USE_SASH]) Director.Spec(pkg, 'wxQueryLayoutInfoEvent', director: Director::SashLayoutEvent) Director.Spec(pkg, 'wxCalculateLayoutEvent', director: Director::SashLayoutEvent) Director.Spec(pkg, 'wxEditableListBox') - Director.Spec(pkg, 'wxWizardEvent', director: Director::Event, requirements: %w[wxUSE_WIZARDDLG]) - Director.Spec(pkg, 'wxWizardPage', requirements: %w[wxUSE_WIZARDDLG]) - Director.Spec(pkg, 'wxWizardPageSimple', director: Director::WizardPage, requirements: %w[wxUSE_WIZARDDLG]) - Director.Spec(pkg, 'wxWizard', director: Director::Dialog, requirements: %w[wxUSE_WIZARDDLG]) - Director.Spec(pkg, 'wxCheckListBox', requirements: %w[wxUSE_CHECKLISTBOX]) - Director.Spec(pkg, 'wxRearrangeList', requirements: %w[wxUSE_CHECKLISTBOX]) - Director.Spec(pkg, 'wxRearrangeCtrl', director: Director::Window, requirements: %w[wxUSE_CHECKLISTBOX]) - Director.Spec(pkg, 'wxDataFormat', requirements: %w[wxUSE_CLIPBOARD]) - Director.Spec(pkg, 'wxDataObject', requirements: %w[wxUSE_CLIPBOARD]) - Director.Spec(pkg, 'wxDataObjectSimpleBase', requirements: %w[wxUSE_CLIPBOARD]) - Director.Spec(pkg, 'wxClipboard', requirements: %w[wxUSE_CLIPBOARD]) - Director.Spec(pkg, 'wxDragDrop', requirements: %w[wxUSE_DRAG_AND_DROP]) - Director.Spec(pkg, 'wxContextHelpButton', requirements: %w[wxUSE_HELP]) - Director.Spec(pkg, 'wxHelpProvider', requirements: %w[wxUSE_HELP]) - Director.Spec(pkg, 'wxHelpController', requirements: %w[wxUSE_HELP]) - Director.Spec(pkg, 'wxExtHelpController', director: Director::HelpController, requirements: %w[wxUSE_HELP]) - Director.Spec(pkg, 'wxTaskBarIconEvent', director: Director::Event, requirements: %w[wxUSE_TASKBARICON]) - Director.Spec(pkg, 'wxTaskBarIcon', requirements: %w[wxUSE_TASKBARICON]) - Director.Spec(pkg, 'wxFSFile', requirements: %[wxUSE_FILESYSTEM]) + Director.Spec(pkg, 'wxWizardEvent', director: Director::Event, requirements: %w[USE_WIZARDDLG]) + Director.Spec(pkg, 'wxWizardPage', requirements: %w[USE_WIZARDDLG]) + Director.Spec(pkg, 'wxWizardPageSimple', director: Director::WizardPage, requirements: %w[USE_WIZARDDLG]) + Director.Spec(pkg, 'wxWizard', director: Director::Dialog, requirements: %w[USE_WIZARDDLG]) + Director.Spec(pkg, 'wxCheckListBox', requirements: %w[USE_CHECKLISTBOX]) + Director.Spec(pkg, 'wxRearrangeList', requirements: %w[USE_CHECKLISTBOX]) + Director.Spec(pkg, 'wxRearrangeCtrl', director: Director::Window, requirements: %w[USE_CHECKLISTBOX]) + Director.Spec(pkg, 'wxDataFormat', requirements: %w[USE_CLIPBOARD]) + Director.Spec(pkg, 'wxDataObject', requirements: %w[USE_CLIPBOARD]) + Director.Spec(pkg, 'wxDataObjectSimpleBase', requirements: %w[USE_CLIPBOARD]) + Director.Spec(pkg, 'wxClipboard', requirements: %w[USE_CLIPBOARD]) + Director.Spec(pkg, 'wxDragDrop', requirements: %w[USE_DRAG_AND_DROP]) + Director.Spec(pkg, 'wxContextHelpButton', requirements: %w[USE_HELP]) + Director.Spec(pkg, 'wxHelpProvider', requirements: %w[USE_HELP]) + Director.Spec(pkg, 'wxHelpController', requirements: %w[USE_HELP]) + Director.Spec(pkg, 'wxExtHelpController', director: Director::HelpController, requirements: %w[USE_HELP]) + Director.Spec(pkg, 'wxTaskBarIconEvent', director: Director::Event, requirements: %w[USE_TASKBARICON]) + Director.Spec(pkg, 'wxTaskBarIcon', requirements: %w[USE_TASKBARICON]) + Director.Spec(pkg, 'wxFSFile', requirements: %[USE_FILESYSTEM]) Director.Spec(pkg, 'wxUtils') Director.Spec(pkg, 'wxDirFilterListCtrl') Director.Spec(pkg, 'wxGenericDirCtrl') - Director.Spec(pkg, 'wxMDIClientWindow', director: Director::Window, requirements: %w[wxUSE_MDI]) - Director.Spec(pkg, 'wxMDIFrame', requirements: %w[wxUSE_MDI]) - Director.Spec(pkg, 'wxAccessible', requirements: %w[wxUSE_ACCESSIBILITY]) - Director.Spec(pkg, 'wxAnimation', requirements: %w[wxUSE_ANIMATIONCTRL]) - Director.Spec(pkg, 'wxAnimationCtrl', requirements: %w[wxUSE_ANIMATIONCTRL]) - Director.Spec(pkg, 'wxMediaEvent', director: Director::Event, requirements: %w[wxUSE_MEDIACTRL]) - Director.Spec(pkg, 'wxMediaCtrl', requirements: %w[wxUSE_MEDIACTRL]) - Director.Spec(pkg, 'wxXmlNode', requirements: %w[wxUSE_XML]) - Director.Spec(pkg, 'wxXmlResource', requirements: %w[wxUSE_XRC]) - Director.Spec(pkg, 'wxVariant', requirements: %w[wxUSE_VARIANT]) + Director.Spec(pkg, 'wxMDIClientWindow', director: Director::Window, requirements: %w[USE_MDI]) + Director.Spec(pkg, 'wxMDIFrame', requirements: %w[USE_MDI]) + Director.Spec(pkg, 'wxAccessible', requirements: %w[USE_ACCESSIBILITY]) + Director.Spec(pkg, 'wxAnimation', requirements: %w[USE_ANIMATIONCTRL]) + Director.Spec(pkg, 'wxAnimationCtrl', requirements: %w[USE_ANIMATIONCTRL]) + Director.Spec(pkg, 'wxMediaEvent', director: Director::Event, requirements: %w[USE_MEDIACTRL]) + Director.Spec(pkg, 'wxMediaCtrl', requirements: %w[USE_MEDIACTRL]) + Director.Spec(pkg, 'wxXmlNode', requirements: %w[USE_XML]) + Director.Spec(pkg, 'wxXmlResource', requirements: %w[USE_XRC]) + Director.Spec(pkg, 'wxVariant', requirements: %w[USE_VARIANT]) Director.Spec(pkg, 'wxPlatformInfo') - Director.Spec(pkg, 'wxSplashScreen', requirements: %w[wxUSE_SPLASH]) - Director.Spec(pkg, 'wxUIActionSimulator', requirements: %w[wxUSE_UIACTIONSIMULATOR]) - Director.Spec(pkg, 'wxActivityIndicator', director: Director::Window, requirements: %w[wxUSE_ACTIVITYINDICATOR]) - Director.Spec(pkg, 'wxHyperlinkCtrl', requirements: %w[wxUSE_HYPERLINKCTRL]) - Director.Spec(pkg, 'wxHyperlinkEvent', requirements: %w[wxUSE_HYPERLINKCTRL]) - Director.Spec(pkg, 'wxBannerWindow', requirements: %w[wxUSE_BANNERWINDOW]) - Director.Spec(pkg, 'wxInfoBar', requirements: %w[wxUSE_INFOBAR]) - Director.Spec(pkg, 'wxFileSystem', requirements: %w[wxUSE_FILESYSTEM]) - Director.Spec(pkg, 'wxDialUpManager', requirements: %w[wxUSE_DIALUP_MANAGER]) - Director.Spec(pkg, 'wxDialUpEvent', requirements: %w[wxUSE_DIALUP_MANAGER]) + Director.Spec(pkg, 'wxSplashScreen', requirements: %w[USE_SPLASH]) + Director.Spec(pkg, 'wxUIActionSimulator', requirements: %w[USE_UIACTIONSIMULATOR]) + Director.Spec(pkg, 'wxActivityIndicator', director: Director::Window, requirements: %w[USE_ACTIVITYINDICATOR]) + Director.Spec(pkg, 'wxHyperlinkCtrl', requirements: %w[USE_HYPERLINKCTRL]) + Director.Spec(pkg, 'wxHyperlinkEvent', requirements: %w[USE_HYPERLINKCTRL]) + Director.Spec(pkg, 'wxBannerWindow', requirements: %w[USE_BANNERWINDOW]) + Director.Spec(pkg, 'wxInfoBar', requirements: %w[USE_INFOBAR]) + Director.Spec(pkg, 'wxFileSystem', requirements: %w[USE_FILESYSTEM]) + Director.Spec(pkg, 'wxDialUpManager', requirements: %w[USE_DIALUP_MANAGER]) + Director.Spec(pkg, 'wxDialUpEvent', requirements: %w[USE_DIALUP_MANAGER]) } - Director.Package('Wx::PRT', 'wxUSE_PRINTING_ARCHITECTURE') do |pkg| - Director.Spec(pkg, 'wxPrinterDC', director: Director::DerivedDC) + Director.Package('Wx::PRT', 'USE_PRINTING_ARCHITECTURE') do |pkg| + Director.Spec(pkg, 'wxPrinterDC', director: Director::DerivedDC, requirements: Director.AnyOf(*%w[WXMSW WXOSX USE_GTKPRINT])) Director.Spec(pkg, 'wxPostScriptDC', director: Director::DerivedDC) Director.Spec(pkg, 'wxPrintData') Director.Spec(pkg, 'wxPrintDialog') @@ -240,21 +241,21 @@ module WXRuby3 Director.Spec(pkg, 'wxPrinter') end - Director.Package('Wx::HTML', 'wxUSE_HTML') { |pkg| + Director.Package('Wx::HTML', 'USE_HTML') { |pkg| Director.Spec(pkg, 'wxHtmlWindow') - Director.Spec(pkg, 'wxHtmlHelpData', requirements: %w[wxUSE_HELP]) - Director.Spec(pkg, 'wxHtmlHelpWindow', requirements: %w[wxUSE_HELP]) + Director.Spec(pkg, 'wxHtmlHelpData', requirements: %w[USE_HELP]) + Director.Spec(pkg, 'wxHtmlHelpWindow', requirements: %w[USE_HELP]) Director.Spec(pkg, 'wxHtmlCellEvent', director: Director::HtmlEvent) Director.Spec(pkg, 'wxHtmlLinkEvent', director: Director::HtmlEvent) - Director.Spec(pkg, 'wxHtmlHelpController', director: Director::HelpController, requirements: %w[wxUSE_HELP]) + Director.Spec(pkg, 'wxHtmlHelpController', director: Director::HelpController, requirements: %w[USE_HELP]) Director.Spec(pkg, 'wxHtmlCell') - Director.Spec(pkg, 'wxHtmlEasyPrinting', requirements: %w[wxUSE_PRINTING_ARCHITECTURE]) - Director.Spec(pkg, 'wxHtmlPrintout', requirements: %w[wxUSE_PRINTING_ARCHITECTURE]) + Director.Spec(pkg, 'wxHtmlEasyPrinting', requirements: %w[USE_PRINTING_ARCHITECTURE]) + Director.Spec(pkg, 'wxHtmlPrintout', requirements: %w[USE_PRINTING_ARCHITECTURE]) Director.Spec(pkg, 'wxHtmlListBox') Director.Spec(pkg, 'wxHTMLDataObject') if Config.instance.wx_version >= '3.3' } - Director.Package('Wx::RTC', 'wxUSE_RICHTEXT', depends_on: ['Wx::HTML']) { |pkg| + Director.Package('Wx::RTC', 'USE_RICHTEXT', depends_on: ['Wx::HTML']) { |pkg| Director.Spec(pkg, 'wxRichTextObject') Director.Spec(pkg, 'wxRichTextImage') Director.Spec(pkg, 'wxRichTextCompositeObject') @@ -266,8 +267,8 @@ module WXRuby3 Director.Spec(pkg, 'wxRichTextFileHandler') Director.Spec(pkg, 'wxRichTextXMLHandler', director: Director::RichTextFileHandler) Director.Spec(pkg, 'wxRichTextHTMLHandler', director: Director::RichTextFileHandler) - Director.Spec(pkg, 'wxRichTextHeaderFooterData', requirements: %w[wxUSE_PRINTING_ARCHITECTURE]) - Director.Spec(pkg, 'wxRichTextPrinting', requirements: %w[wxUSE_PRINTING_ARCHITECTURE]) + Director.Spec(pkg, 'wxRichTextHeaderFooterData', requirements: %w[USE_PRINTING_ARCHITECTURE]) + Director.Spec(pkg, 'wxRichTextPrinting', requirements: %w[USE_PRINTING_ARCHITECTURE]) Director.Spec(pkg, 'wxSymbolPickerDialog', director: Director::Dialog) Director.Spec(pkg, 'wxRichTextFormattingDialog') Director.Spec(pkg, 'wxRichTextStyleOrganiserDialog') @@ -275,12 +276,12 @@ module WXRuby3 Director.Spec(pkg, 'wxRichTextBufferDataObject') } - Director.Package('Wx::STC', 'wxUSE_STC') { |pkg| + Director.Package('Wx::STC', 'USE_STC') { |pkg| Director.Spec(pkg, 'wxStyledTextEvent') Director.Spec(pkg, 'wxStyledTextCtrl') } - Director.Package('Wx::GRID', 'wxUSE_GRID') { |pkg| + Director.Package('Wx::GRID', 'USE_GRID') { |pkg| Director.Spec(pkg, 'wxGridEvent', director: Director::Event) Director.Spec(pkg, 'wxGridSizeEvent', director: Director::Event) Director.Spec(pkg, 'wxGridEditorCreatedEvent', director: Director::Event) @@ -311,7 +312,7 @@ module WXRuby3 Director.Spec(pkg, 'wxGridCtrl') } - Director.Package('Wx::AUI', 'wxUSE_AUI') { |pkg| + Director.Package('Wx::AUI', 'USE_AUI') { |pkg| Director.Spec(pkg, 'wxAuiPaneInfo') Director.Spec(pkg, 'wxAuiManagerEvent') Director.Spec(pkg, 'wxAuiDockArt') @@ -330,7 +331,7 @@ module WXRuby3 Director.Spec(pkg, 'wxAuiMDIChildFrame') } - Director.Package('Wx::PG', 'wxUSE_PROPGRID') { |pkg| + Director.Package('Wx::PG', 'USE_PROPGRID') { |pkg| Director.Spec(pkg, 'wxPGEditor') Director.Spec(pkg, 'wxPGMultiButton') Director.Spec(pkg, 'wxPGCell') @@ -347,7 +348,7 @@ module WXRuby3 Director.Spec(pkg, 'wxPropertyGridManager') } - Director.Package('Wx::RBN', 'wxUSE_RIBBON') { |pkg| + Director.Package('Wx::RBN', 'USE_RIBBON') { |pkg| Director.Spec(pkg, 'wxRibbonBarEvent') Director.Spec(pkg, 'wxRibbonButtonBarEvent') Director.Spec(pkg, 'wxRibbonGalleryEvent') diff --git a/rakelib/lib/typemap/common.rb b/rakelib/lib/typemap/common.rb index 440715a5..8250dbc7 100644 --- a/rakelib/lib/typemap/common.rb +++ b/rakelib/lib/typemap/common.rb @@ -684,7 +684,7 @@ module Common # add type mapping for wxVariant input args intypes = 'nil,String,Integer,Float,Time,Wx::Font,Wx::Colour,Wx::Variant,Array,Array,Object' - if Config.instance.features_set?('wxUSE_PROPGRID') + if Config.instance.features_set?('USE_PROPGRID') intypes << 'Wx::PG::ColourPropertyValue' end map 'const wxVariant&' => intypes do diff --git a/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css b/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css index cd86bc92..64ef3a90 100644 --- a/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +++ b/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css @@ -1,7 +1,79 @@ -blockquote { +div.wxrb-note { background: #f7f7f9; - border-left: .25em solid #e1e1e8; + border-left: .6em solid #f3ba6f; + border-radius: 3px; margin: 14px; padding-left: 14px; + padding-top: 10px; + padding-bottom: 10px; +} + +div.wxrb-remark { + background: #f7f7f9; + border-left: .6em solid #f6f4ab; + border-radius: 3px; + margin: 14px; + padding-left: 14px; + padding-top: 10px; + padding-bottom: 10px; +} + +div.wxrb-note p, +div.wxrb-remark p { + margin: 0; +} + +div.wxrb-logo { + float: right; + padding-top: 12px; +} + +div.wxrb-logo img { + vertical-align: middle; +} + +div.wxrb-logo span.wxrb-name { + font-size: large; + font-weight: bold; + margin-left: 10px; +} + +div.wxrb-logo span.wxrb-name a { + color: black; +} + +div.wxrb-logo span.wxrb-version { + font-size: medium; + font-weight: normal; + margin-right: 15px; +} + +div.wxrb-logo span.wxrb-wxver { + font-size: 0.9em; + font-weight: normal; + margin-right: 15px; +} + +div.wxrb-logo table { + display: inline; +} + +div.wxrb-logo table td { + margin: 0; +} + +.discussion div.note { + background: #f7f7f9; + border-left: .6em solid #f3ba6f; + margin: 14px; +} + +.tags span.wxrb-require { + border-radius: 5px; + border: 1px solid #E1E1E8; + padding: 0px 3px 0px 3px; + background: #f3ba6f; + font-weight: bold; + font-size: 0.9em; } diff --git a/rakelib/yard/templates/default/fulldoc/html/full_list.erb b/rakelib/yard/templates/default/fulldoc/html/full_list.erb new file mode 100644 index 00000000..3129ef2e --- /dev/null +++ b/rakelib/yard/templates/default/fulldoc/html/full_list.erb @@ -0,0 +1,38 @@ + + + + + + <% stylesheets_full_list.each do |stylesheet| %> + + <% end %> + + <% javascripts_full_list.each do |javascript| %> + + <% end %> + + <%= @list_title %> + + + +
+
+ <%= logo_and_version %> +

<%= @list_title %>

+
+ <% menu_lists.each do |list| %> + + <%= list[:title] %> + + <% end %> +
+ + +
+ +
    + <%= erb "full_list_#{@list_type}" %> +
+
+ + diff --git a/rakelib/yard/templates/default/fulldoc/html/setup.rb b/rakelib/yard/templates/default/fulldoc/html/setup.rb new file mode 100644 index 00000000..9ec31364 --- /dev/null +++ b/rakelib/yard/templates/default/fulldoc/html/setup.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +def init + # It seems YARD messes things up so that a number of classes are not properly + # registered in their enclosing namespaces. + # This hack makes sure that if that is the case we fix that here. + all_classes = Registry.all(:class) + all_classes.each do |c| + if (ns = c.namespace) + unless ns.children.any? { |nsc| nsc.path == c.path } + ns.children << c # class missing from child list of enclosing namespace -> add here + end + end + if (ns = Registry[c.namespace.path]) + unless ns.children.any? { |nsc| nsc.path == c.path } + ns.children << c # class missing from child list of enclosing namespace -> add here + end + end + end + super +end + +def stylesheets_full_list + super + %w(css/wxruby3.css) +end + +def logo_and_version + wxver = Registry['Wx::WXRUBY_VERSION'] + wxwver = Registry['Wx::WXWIDGETS_VERSION'] + <<~__HTML + + __HTML +end diff --git a/rakelib/yard/templates/default/tags/html/wxrb_require.erb b/rakelib/yard/templates/default/tags/html/wxrb_require.erb new file mode 100644 index 00000000..da52b01e --- /dev/null +++ b/rakelib/yard/templates/default/tags/html/wxrb_require.erb @@ -0,0 +1,10 @@ +<% if object.has_tag?(:wxrb_require) %> +

Requires:

+
    + <% wxruby_requires.each do |req| %> +
  • + <%= req.join(' or ') %> +
  • + <% end %> +
+<% end %> diff --git a/rakelib/yard/templates/default/tags/setup.rb b/rakelib/yard/templates/default/tags/setup.rb new file mode 100644 index 00000000..2202324e --- /dev/null +++ b/rakelib/yard/templates/default/tags/setup.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +def wxrb_require + erb('wxrb_require') +end + +def wxruby_requires + object.tags(:wxrb_require).inject([]) do |list, tag| + tag.text.split(',').each do |feature| + list << feature.split('|').collect do |s| + s.split('&').collect { |ss| %Q[#{ss.strip}] }.join('&') + end + end + list + end +end diff --git a/rakelib/yard/yard-custom-templates.rb b/rakelib/yard/yard-custom-templates.rb index 286de577..d5acdfe5 100644 --- a/rakelib/yard/yard-custom-templates.rb +++ b/rakelib/yard/yard-custom-templates.rb @@ -1,2 +1,5 @@ +YARD::Tags::Library.define_tag("Requirements", :wxrb_require) +YARD::Tags::Library.visible_tags.place(:wxrb_require).before(:author) + YARD::Templates::Engine.register_template_path File.join(__dir__, 'templates') diff --git a/samples/treectrl/treectrl.rb b/samples/treectrl/treectrl.rb index 4ddca7e8..0126be28 100755 --- a/samples/treectrl/treectrl.rb +++ b/samples/treectrl/treectrl.rb @@ -369,7 +369,7 @@ def add_test_items_to_tree(num_children, depth) set_item_font(root_id, Wx::ITALIC_FONT) end - ids = get_children(root_id) + ids = get_item_children(root_id) # make the first item blue set_item_text_colour(ids[0], Wx::BLUE)