Printing a Gnome canvas (2nd episode)



Hi,

I have not written much code yet, being very busy thehe times, but I have perhaps found a solution to avoid making libgnomecanvas dependent to libgnomeprint. The drwoback is that it will add a new dependency to libgnomeprint. Here is my idea:

The only thing I need to print the canvas is a GnomePrintContext. If we have a parent type for GnomePrintContext, say GPrintContext, we just have to make GnomePrintContext a descendant of GPrintContext and put into GPrintContextClass pointers to almost every gnome_print_context_xxx(...). The default corresponding g_print_context_xxx just emit a warning.

Where to put this new type? There are et leat three possibilities: a separate library (just for that, it will be very thin), libgnomecanvas or glib. I don't think that the second option is the good one because other types could use the GPrintContext mechanism (may be PangoLayout (would be great in my opinion)). I don't know if the GLib option is acceptable (does GLib have something o do with printing?) so the separate library might be the best solution unless someone has a better idea.

Note that it would add other possibilities as GPrintContext might have several descendant which could be used to other things that printing. I think, as an example, to export procedures to vectorial graphics formats such as SVG.

Best regards,

Jean Bréfort
<jean brefort ac-dijon fr>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]