Sha256: 8bced830fe495958c7b19c6469676915d4f98542a2bcc841da95bc7323d9d387

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

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

###
# wxRuby3 Common typemap definitions
###

require_relative '../core/mapping'

module WXRuby3

  module Typemap

    # Deals with GetAllFormats
    module ConfigBase

      include Typemap::Module

      define do

        map 'wxConfigBase*' => 'Wx::ConfigBase' do

          map_in code: <<~__CODE
            $1 = nullptr;
            if (!NIL_P($input))
            {
              $1 = wxRuby_Ruby2ConfigBase($input);
              if ($1 == nullptr)
              {
                VALUE msg = rb_inspect($input);
                rb_raise(rb_eArgError, "Expected Wx::ConfigBase or Hash for %d but got %s",
                                        $argnum-1, StringValuePtr(msg));
              }
            }
            __CODE

          map_typecheck precedence: 'POINTER', code: <<~__CODE
            $1 = wxRuby_IsRubyConfig($input);
            __CODE


          map_directorin code: <<~__CODE
            $input = wxRuby_ConfigBase2Ruby($1);
            __CODE

        end

      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wxruby3-0.9.3 rakelib/lib/typemap/config.rb
wxruby3-0.9.2 rakelib/lib/typemap/config.rb
wxruby3-0.9.1 rakelib/lib/typemap/config.rb
wxruby3-0.9.0 rakelib/lib/typemap/config.rb