En 13/07/2010 11:46:47, Albrecht Schlosser <[email protected]> escribió:
> On 13.07.2010, at 02:44, Domingo Alvarez Duarte wrote: >> I've managed to have Fl_Clock printed correctly on generated pdf using a >> flag on fl_vertex.cxx "fl_is_pdf" and changing the angle sign of the >> argument to fl_rotate when generating pdfs. >> >> But doing this I could see that the actual implementation isn't thread >> safe, in fact only one thread can use the fl_vertex.cxx functions at a >> time and should leave the matrix stack as it was before. > > I believe that all drawing is not thread safe by design. This is not > intended, and I don't think that it will be possible. > >> Probably pdf, postcript and direct printing will be executed as >> background tasks or independent threads on some applications to don't >> block the user interface but the actual implementation doesn't permit >> it. > > I don't think that this is possible. FLTK's "Fl_Device-Philosophy" ;-) > is that there is a static "current device" variable (among others). > Therefore you can't do anything parallel to the main FLTK thread, > because you would need to change the static variables... > >> Probably everything on fl_vertex.cxx should be non static members of >> Fl_Graphics_Driver class, this way multithread using different derived >> Fl_Graphics_Driver can work properly. >> >> Can this be made ? > > Independent of what I wrote before, such changes might be worth > investigating, but they wouldn't help to make parallel printing > possible, IMHO. Disclaimer: I didn't check the code so far... > > Albrecht Parallel printing is possible if there is no static data like the matrix stack on fl_vertex.cxx, because we don't need a widget to appear on the screen to print it, I'm currently use an fresh instance of Fl_Help_View without any parent to layout the data and use printer.print_widget(view_html) to print it and delete it after printing (also the Fl_Help_View use some static data that should be moved to the class instance), also forms created with fluid can be used to print without showing then on screen. Static variables by individual virtual devices are less problematic than global static ones, although still not a good solution. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
