Sha256: c4543b550ef8c9c641085e7c3866fd75ae6c470bf5d913087b64ad6abefe23cc

Contents?: true

Size: 1.46 KB

Versions: 16

Compression:

Stored size: 1.46 KB

Contents

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

      def setup
        super
        spec.gc_never
        spec.disable_proxies
        spec.make_abstract 'wxRegionIterator'
        # not useful in wxRuby
        spec.ignore 'wxRegionIterator::Reset(const wxRegion &)',
                    'wxRegionIterator::operator bool'
        # add iteration control methods
        spec.add_extend_code 'wxRegionIterator', <<~__HEREDOC
          void next_rect()
          {
            $self->operator ++();
          }
          __HEREDOC
        # add custom factory method
        spec.add_extend_code 'wxRegionIterator', <<~__HEREDOC
          static void for_region(const wxRegion& region) 
          {
            wxRegionIterator region_it(region);
            if (rb_block_given_p())
            {
              wxRegionIterator *p_region_it = &region_it;
              VALUE rb_region_it = SWIG_NewPointerObj(SWIG_as_voidptr(p_region_it), SWIGTYPE_p_wxRegionIterator, 0);
              rb_yield(rb_region_it);
              SWIG_RubyRemoveTracking((void *)p_region_it);
              DATA_PTR(rb_region_it) = NULL;
            }
          }
          __HEREDOC
        spec.do_not_generate :functions, :variables, :defines, :enums
      end
    end # class RegionIterator

  end # class Director

end # module WXRuby3

Version data entries

16 entries across 16 versions & 1 rubygems

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