There are several functions that take the parameters (int *x, int *y) In some cases x & y are simply return values. In some cases x & y are both input and output. How are we going to handle this properly? One method would be to change the header files to something like xin or xout. I don''t really like that method as it''ll break as soon as header files change. I was checking to see if we could apply a typemap based off a specific regexp, but I don''t see a way to do that. Any thoughts?
Roy Sutton wrote:> There are several functions that take the parameters (int *x, int *y) > > In some cases x & y are simply return values. In some cases x & y are > both input and output. How are we going to handle this properly?Seems like we need to flag them in each .i file, instead of relying on generic typemaps.> One > method would be to change the header files to something like xin or > xout. I don''t really like that method as it''ll break as soon as header > files change.Agreed.> I was checking to see if we could apply a typemap based > off a specific regexp, but I don''t see a way to do that. > > Any thoughts?It would help if you could list a couple methods of each type (inout or outonly). I''m not sure if %apply will help us cut some of the duplicate code. Other than that, nothing jumps out at me. Kevin
The crash when you click on the scroll window example is caused by GetViewStart which takes two int pointers to return the coordinate. http://www.wxwindows.org/manuals/2.6.1/wx_wxscrolledwindow.html#wxscrolledwindowgetviewstart An example of one where the two pointers are used as parameters: http://www.wxwindows.org/manuals/2.6.1/wx_wxwindow.html#wxwindowclienttoscreen Roy Kevin Smith wrote:> Roy Sutton wrote: >> There are several functions that take the parameters (int *x, int *y) >> >> In some cases x & y are simply return values. In some cases x & y >> are both input and output. How are we going to handle this properly? > > Seems like we need to flag them in each .i file, instead of relying on > generic typemaps. > >> One method would be to change the header files to something like xin >> or xout. I don''t really like that method as it''ll break as soon as >> header files change. > > Agreed. > >> I was checking to see if we could apply a typemap based off a >> specific regexp, but I don''t see a way to do that. >> >> Any thoughts? > > It would help if you could list a couple methods of each type (inout > or outonly). > > I''m not sure if %apply will help us cut some of the duplicate code. > Other than that, nothing jumps out at me. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Roy Sutton wrote:> An example of one where the two pointers are used as parameters: > > http://www.wxwindows.org/manuals/2.6.1/wx_wxwindow.html#wxwindowclienttoscreenI think we should follow wxPython here, and have a separate method that takes (x,y) and returns the values. When in doubt, we should match wxPython. If they haven''t already figured out a solution, we can try to come up with one on a case-by-case basis. Cheers, Kevin
That really wasn''t my beef. I think we need to go in and change the header files to read either: int *INPUT int *OUTPUT int *INOUT (I think that''s it) If we do this, SWIG has a typemap already made up for this (I believe). Then we don''t even have to fix those functions with manual typemaps. I realize we''re hoping to fix the whole header file issue later, but we do need something that works now, I think. Roy Kevin Smith wrote:> Roy Sutton wrote: > >> An example of one where the two pointers are used as parameters: >> >> http://www.wxwindows.org/manuals/2.6.1/wx_wxwindow.html#wxwindowclienttoscreen >> > > I think we should follow wxPython here, and have a separate method that > takes (x,y) and returns the values. > > When in doubt, we should match wxPython. If they haven''t already figured > out a solution, we can try to come up with one on a case-by-case basis. > > Cheers, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >