Hi Hazen > >>> I am working on an application which requires plots to be displayed > >>> within the context of the program's windows. In practice this means > >>> that I needed plplot to have the ability to plot to a supplied X > >>> Drawable rather than to an X window which plplot creates and manages > >>> itself. > >> > >> Another thought along this line. How about a driver that would plot > >> to a supplied cairo context? This is easy to get from e.g. Gdk, and > >> it might provide some extra flexibility. Gtk on Windows might for > >> example benefit from this approach. This driver could be called just > >> "cairo" to emphasize its generic nature. > > > > It's a fair thought and probably not all that difficult to do. The > > existing cairo framework could be used, with an extension like I did for > > X Drawables being used to pass in an externally created cairo context. > > > > I could look into this in more detail but I won't have a lot of time > > over the next few weeks. If no one else beats me to it I'll pick up on > > this when time allows. > > I've started on this, and decided to call the device "extcairo" for > Cairo external context driver.
Sounds fine. > While working on this, I noticed that for the xcairo driver with external > drawable you clear the drawable before plotting. Any thoughts on whether > it might be better to leave that to the end user in case they don't want > the current contents of the drawable erased? This is the approach that > Doug has taken with the memcairo driver. Really? I didn't think the drawable was being cleared although this could be the result of a memory of things I observed partway though the development of the external drawable code. In any case, I think arguments could be made that the "clearing to the background colour" should at least be made an option, as you stated above. Having said that, things are as they are because this is the behaviour of the current cairo-based devices. Admittedly a pre-existing drawable is different from one created by plplot but even so, consistency can sometimes be a good thing. The other thing to bear in mind is that "clearing to the background colour" will be the usual operational mode I would imagine, so an argument could be raised that the "don't clear" behaviour should be an opt-in option - possibly set using a new escape function or perhaps via a new "flags" option to the PLXcairoDrawableInfo structure. If we went with the latter though, PLXcairoDrawableInfo really needs to be made available to applications. Currently there's only 2 members - the display and the drawable - and it's not too hard for users to hack up their own structure to pass in. However, once we go beyond this PLXcairoDrawableInfo really must be publically available so users can't get it wrong. For what it's worth I think the PLXcairoDrawableInfo definition should be public anyway but from what I've been lead to believe there are issues with this - something about compilation of the plplot headers when X isn't on the system. Regards jonathan ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel