Sha256: 890ddef19e2bcb2d1c633ed7f248afba24fc17c4e8c00fe596103be0f152f103

Contents?: true

Size: 1.76 KB

Versions: 9

Compression:

Stored size: 1.76 KB

Contents

###
# wxRuby3 HtmlCell typemap definition
# Copyright (c) M.J.N. Corino, The Netherlands
###

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

9 entries across 9 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.rc.2 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.rc.1 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.beta.14 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.beta.13 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.beta.11 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.beta.10 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.beta.9 rakelib/lib/typemap/html_cell.rb
wxruby3-0.9.0.pre.beta.8 rakelib/lib/typemap/html_cell.rb