# 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 Icon < Director

      include Typemap::IOStreams

      def setup
        spec.items << 'wxIconBundle'
        spec.gc_as_untracked 'wxIcon'
        spec.gc_as_untracked 'wxIconBundle'
        spec.disable_proxies
        spec.require_app 'wxIcon', 'wxIconBundle'
        # disable as there is no way to distinguish char*/[] from wxString in Ruby
        # and anyway there is no real benefit compared to loading XPM by filename
        spec.ignore('wxIcon::wxIcon(const char *const *)', 'wxIcon::wxIcon(const char[],int,int)')
        # xml specs incorrectly list this method for MWS while it does not exist anymore
        spec.ignore('wxIcon::ConvertToDisabled')
        if Config.platform == :mingw
          spec.ignore 'wxIconBundle::wxIconBundle(const wxString &, WXHINSTANCE)',
                      'wxIconBundle::AddIcon(const wxString&,WXHINSTANCE)',
                      'wxIcon::CreateFromHICON'
        else
          spec.override_inheritance_chain('wxIcon', %w[wxBitmap wxGDIObject wxObject])
        end
        super
      end
    end # class Icon

  end # class Director

end # module WXRuby3
