This patch allows PrinterDC to go merrily by on Linux. I''m not sure it''s the best solution to the problem so I submit it for your approval. Roy -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: PrinterDC.i.patch Url: http://rubyforge.org/pipermail/wxruby-development/attachments/20061024/585c15f2/attachment.pl
Roy Sutton wrote:> This patch allows PrinterDC to go merrily by on Linux.Thanks for debugging this and the patch.> I''m not sure it''s the best solution to the problem so I submit it for > your approval.Nor am I. We''re going to have more of this type of problem when we start supporting wx-2.8 only classes. So I wonder what the best option is. Off the top off my head: 1) hack rakefile so it removes the unwanted classes from the dependency chain (requires some work, perhaps object-orienting the code that returns lists of classes so it can be subclassed on different platforms, and perhaps has a mix-in for different wx versions. Once it''s done it''s done; but also means the configuration is somewhat removed from the class) 2) find some flag that can be added to the .i file way for SWIG to halt, or signal to the postprocessors that the class should be removed: #ifdef __WXGTK__ %dontprocessme #endif ... (also needs some work, may confuse rake and make it repeatedly try to SWIG classes it shouldn''t. but maybe puts the configuration closer to the class; easier to add piecemeal) Thoughts? I think I marginally lean towards 1). alex
Kevin Smith
2006-Oct-26 12:36 UTC
[Wxruby-development] Handling platform-only classes (was: PrinterDC.i Patch)
Alex Fenton wrote:> 1) hack rakefile so it removes the unwanted classes from the dependency > chain(snip)> > 2) find some flag that can be added to the .i file way for SWIG to halt, > or signal to the postprocessors that the class should be removed:(snip)> > Thoughts? I think I marginally lean towards 1).I think I agree. The simplest would be to just have a list of excluded classes in the platform-specific rakefiles. When constructing the list of classes, take the list of .i files minus the list of files not available on this platform. Kevin
This patch excludes PrinterDC on Linux, and also creates a general way to hide classes that aren''t supported (eg between versions). I haven''t tested it on Linux, but the principle seems to work. alex Roy Sutton wrote:> This patch allows PrinterDC to go merrily by on Linux. I''m not sure > it''s the best solution to the problem so I submit it for your approval. > > Roy > ------------------------------------------------------------------------ > > Index: wxruby2/swig/classes/PrinterDC.i > ==================================================================> --- wxruby2/swig/classes/PrinterDC.i (revision 710) > +++ wxruby2/swig/classes/PrinterDC.i (working copy) > @@ -5,7 +5,23 @@ > > %module(directors="1") wxPrinterDC > > +#ifdef __WXGTK__ > + > +%{ > +class wxPrinterDC > +{ > +}; > +%} > + > +class wxPrinterDC > +{ > +}; > + > +#else > + > %import "include/wxObject.h" > %import "include/wxDC.h" > > %include "include/wxPrinterDC.h" > + > +#endif // __WXGTK__ > > ------------------------------------------------------------------------ > > _______________________________________________ > Wxruby-development mailing list > Wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >-------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rake_excl_classes.patch Url: http://rubyforge.org/pipermail/wxruby-development/attachments/20061030/27f1625a/attachment.pl
> I haven''t tested it on Linux, but the principle seems to work.Looks like it should work. Isn''t the #ifdef __WXGTK__ #endif redundant with the the $excluded_classes being used? Or am I missing something? On another note over the weekend I setup FreeBSD 6.1 under Parallels and got the SVN HEAD of wxRuby2 to work just fine, the only change I had to make was the #ifdef __WXGTK__ in PrinterDC.i. I did not test scintilla on FreeBSD yet. Sean
Sean Long wrote:> Looks like it should work. > > Isn''t the #ifdef __WXGTK__ #endif redundant with the the > $excluded_classes being used? Or am I missing something? >Yes, this replaces the patch to PrinterDC.i. I think it''s a neater way to solve the same problem.> On another note over the weekend I setup FreeBSD 6.1 under Parallels > and got the SVN HEAD of wxRuby2 to work just fine, the only change I > had to make was the #ifdef __WXGTK__ in PrinterDC.i.Cool, good to try on another platform. I am starting to develop an irrational desire to get a new intel mac... Please feel free to commit the rake changes if you get a chance to try them on BSD Thanks alex