search for: directorout

Displaying 12 results from an estimated 12 matches for "directorout".

2005 Oct 06
9
Grid.GetTextExtent
Wow. Look what SWIG does to GetTextExtent in Grid.cpp: void SwigDirector_wxGrid::GetTextExtent(wxString const &string, int *x, int *y, int *descent, int *externalLeading, wxFont const *font) const { ... if (swig_get_up()) { wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font); return; } obj0 = rb_str_new2((const char *)(&string)->mb_str());
2005 Oct 09
0
[Fwd: Re: [Swig] Re: Object return problem]
...nterserv.com> CC: Swig@cs.uchicago.edu References: <4347277E.1030700@mindspring.com> <4349911B.70200@interserv.com> Hi guys, I just figured out the answer. wxWindow uses directors (as almost all our wxruby classes do), and the swig error message hints at the problem. We need to use directorout typemaps, rather than just plain "out". I inserted this, and it seemed to work: %typemap(directorout) wxString { $result = wxString(STR2CSTR($1), wxConvUTF8); } Typemaps are sure a confusing feature. They''re great, and powerful. But I hope for SWIG v3 they can be completely ov...
2007 Mar 17
0
[888] branches/wxruby2/wxwidgets_282/swig/shared/treeitemid_typemaps.i: Fix compile warning for TreeItemId typemap (Artur Kuptel)
...ot; </ins><span class="cx"> %typemap(out) wxTreeItemId "$result = LONG2NUM( (long)$1.m_pItem );" </span><span class="cx"> %typemap(directorin) wxTreeItemId& "$input = LONG2NUM( (long)$1.m_pItem );" </span><del>-%typemap(directorout) wxTreeItemId& "$result = new wxTreeItemId(NUM2LONG($1));" </del><ins>+%typemap(directorout) wxTreeItemId& "$result = new wxTreeItemId((void*)NUM2LONG($1));" </ins><span class="cx"> %typemap(freearg) wxTreeItemId& "delete $1;&qu...
2005 Oct 09
1
[Fwd: Re: [Swig] typemap + default argument bug?]
(Mostly for Roy): I saw this on the SWIG list, and wonder if it might be related to the problems we have been seeing where multi-arg typemaps end up invoking the wrong wrapper methods. (Not the newly-discovered directorout stuff). Perhaps if we switched to "compactdefaultargs" things would start to work more sanely. Looking at this section of the SWIG docs, it looks like it should be safe, and might at least make it easier to diagnose any problems, if it doesn''t fix them outright: http://www...
2007 Jun 25
0
[1069] trunk/wxruby2/swig/typemap.i: Fix big memory leak in methods taking wxString as a parameter
...amp;nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$1 = new wxString(StringValuePtr($input), wxConvUTF8); -} - -%typemap(in) wxString* { -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$1 = new wxString(StringValuePtr($input), wxConvUTF8); -} - -%typemap(directorout) wxString, wxString& "$result = wxString(StringValuePtr($input), wxConvUTF8);"; - </del><ins>+// include SWIG''s built-in typemaps, eg for OUTPUT/INPUT </ins><span class="cx"> %include "typemaps.i" </span><span class="c...
2006 Aug 24
4
typemap.i patch
This patch adds %directorout typemaps for the GetTextExtent functions _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2008 Jan 17
1
wxSockets
Hello guys, Alright Alex..... I need a few tips on where to start. I know that I''m going to need to rewrite the wxSocket header files, in order to incorperate them into wxRuby. But some advice on stuff such as wxSocketClient::new/connect, where it takes a wxIPAddress, and so forth. I know they are pretty friviolous structures for holding information about Addresses in which to make
2006 Apr 27
5
Major Breakthrough?
Attached are patches to make the textctrl.rb sample work fully. Note the new %directorargout typemap I added to fix wxWindows calling into SWIG. I don''t know if this can fix all such problems or not. Let me know what you think. I also rubified the sample a little bit more. Also, note that I fix the << operator so the function can be called. I hope I did this right. Roy
2007 Jan 23
0
[853] trunk/wxruby2/swig: Replace deprecated STR2CSTR with StringValuePtr
...put), wxConvUTF8); </del><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp$1 = new wxString(StringValuePtr($input), wxConvUTF8); </ins><span class="cx"> } </span><span class="cx"> </span><del>-%typemap(directorout) wxString, wxString& "$result = wxString(STR2CSTR($input), wxConvUTF8);"; </del><ins>+%typemap(directorout) wxString, wxString& "$result = wxString(StringValuePtr($input), wxConvUTF8);"; </ins><span class="cx"> </span><span cla...
2006 Aug 15
0
Problem with directors and Ruby
...It''s entirely possible I just misunderstand something about the way this is supposed to work but I''ve pored over the help files many times. Interestingly, if you change -ruby to -python then it appears to correctly generate the code for obj1. You may also want to look at my directorout typemap I''ve included which tries to get the results from the Ruby call so it can pass them back to the returning function if called from C++. I believe I''ve done that part correctly but I''m always happy to be educated if I''ve done this the hard/wrong way R...
2005 Sep 13
3
Swig hates us...
Swig is making mincemeat out of ComboBox.new. Because of the way it''s picking the ''correct'' one to call it''s calling with a null name instead of a default name. How did we fix this before?
2007 Jan 05
0
[831] trunk/wxruby2: Use simple ruby Integers to represent TreeItemIds
...tree +// item ids into simple + +%typemap(in) wxTreeItemId& "$1 = new wxTreeItemId(NUM2LONG($input));" +%typemap(out) wxTreeItemId "$result = LONG2NUM( (long)$1.m_pItem );" +%typemap(directorin) wxTreeItemId& "$input = LONG2NUM( (long)$1.m_pItem );" +%typemap(directorout) wxTreeItemId& "$result = new wxTreeItemId(NUM2LONG($1));" +%typemap(freearg) wxTreeItemId& "delete $1;" + + </ins></span></pre> </div> </div> </body> </html>