Sha256: cf31e5533bb7365fe67e7eba1f08342258a264f6fe4843b7c7cf0e225e4b61de

Contents?: true

Size: 1.82 KB

Versions: 16

Compression:

Stored size: 1.82 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

###
# wxRuby3 HtmlCell typemap definition
###

require_relative '../core/mapping'

module WXRuby3

  module Typemap

    # Typemaps for converting returned HtmlCell references to
    # either the base Wx::HTML::HtmlCell or Wx::HTML::HtmlContainerCell
    module HtmlCell

      include Typemap::Module

      define do

        map 'wxHtmlCell*' => 'Wx::HTML::HtmlCell,Wx::HTML::HtmlContainerCell' do
          map_out code: <<~__CODE
            // attempt a dynamic cast to wxHtmlContainerCell 
            wxHtmlContainerCell* con_cell = dynamic_cast<wxHtmlContainerCell*> ($1);
            if (con_cell)
            {
              swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(rb_eval_string("Wx::HTML::HtmlContainerCell"));
              $result = SWIG_NewPointerObj(con_cell, swig_type, 0);
            }
            else
            {
              swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(rb_eval_string("Wx::HTML::HtmlCell"));
              $result = SWIG_NewPointerObj($1, swig_type, 0);
            }
            __CODE
          map_directorin code: <<~__CODE
            // attempt a dynamic cast to wxHtmlContainerCell 
            wxHtmlContainerCell* con_cell = dynamic_cast<wxHtmlContainerCell*> ($1);
            if (con_cell)
            {
              swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(rb_eval_string("Wx::HTML::HtmlContainerCell"));
              $input = SWIG_NewPointerObj(con_cell, swig_type, 0);
            }
            else
            {
              swig_type_info* swig_type = wxRuby_GetSwigTypeForClass(rb_eval_string("Wx::HTML::HtmlCell"));
              $input = SWIG_NewPointerObj($1, swig_type, 0);
            }
            __CODE
        end

      end

    end

  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wxruby3-1.3.1 rakelib/lib/typemap/html_cell.rb
wxruby3-1.3.0 rakelib/lib/typemap/html_cell.rb
wxruby3-1.2.1 rakelib/lib/typemap/html_cell.rb
wxruby3-1.2.0 rakelib/lib/typemap/html_cell.rb
wxruby3-1.1.2 rakelib/lib/typemap/html_cell.rb
wxruby3-1.1.1 rakelib/lib/typemap/html_cell.rb
wxruby3-1.1.0 rakelib/lib/typemap/html_cell.rb
wxruby3-1.0.1 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.8 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.7 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.5 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.4 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.3 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.2 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.1 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0 rakelib/lib/typemap/html_cell.rb