# 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 AuiToolBarArt < Director def setup super spec.items << 'wxAuiDefaultToolBarArt' spec.gc_as_object spec.extend_interface('wxAuiToolBarArt', 'virtual ~wxAuiToolBarArt ()') spec.suppress_warning(473, 'wxAuiToolBarArt::Clone', 'wxAuiDefaultToolBarArt::Clone') spec.map 'const wxAuiToolBarItemArray&' => 'Array,nil' do map_in temp: 'wxAuiToolBarItemArray tmp', code: <<~__CODE if (!NIL_P($input)) { if (TYPE($input) == T_ARRAY) { for (int i=0; i(ptr)); } } else { VALUE msg = rb_inspect($input); rb_raise(rb_eArgError, "$symname : expected array for $argnum but got %s", StringValuePtr(msg)); } } $1 = &tmp; __CODE map_directorin code: <<~__CODE $input = rb_ary_new(); for (size_t i = 0; i < $1.GetCount(); i++) { wxAuiToolBarItem& tbi = $1.Item(i); rb_ary_push($input, SWIG_NewPointerObj(SWIG_as_voidptr(&tbi), SWIGTYPE_p_wxAuiToolBarItem, 0)); } __CODE end spec.do_not_generate(:variables, :defines, :enums, :functions) end end # class AuiToolBarArt end # class Director end # module WXRuby3