On 16.03.2010, at 23:58, Matthias Melcher wrote: > Fl_Gl_Printer is used by casting from Fl_Virtual_Printer, which is kind of > dangerous. We should remove public access to Fl_Gl_Printer since it is only > needed internally to access protected members of Fl_Printer. Adding a member > variable to Fl_Gl_Printer would generate mysterious crashes!!!!
Yes, I can see this. Looking at the code, I also think that we could eventually remove Fl_Gl_Printer completely and use a local (static) function to achieve what is needed. We would perhaps not even need any reference (friend) anywhere in Fl_(Virtual_)Printer. Maybe. > Fl_Widget::as_window was defined "const" which is wrong (event though the > function itself does not change any members of the class, it does return a > non-const pointer, so the function itself can not be const either). Thanks for the correction and explanation. It would have been much easier without the "const" (no cast needed), but I thought it would be correct, and someone else also proposed it. You can learn something every day. > Anyway, I hope my code is readable and gives a good example how "static > plugins" are useful. I think that I understood most of it, but the plugin manager together with Fl_Preferences ... I'll have to look how this works to understand it fully. But it's a brilliant idea and construction. Albrecht _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
