Re: Printing a Gnome canvas



Hi Jean,

On Sun, 2002-12-01 at 20:31, Jean Bréfort wrote:
> I think that Gnome is missing a straitforward method to print the 
> contents of the canvas. Others before me raised that problem.
> I propose the following solution:

	There are a number of issues with printing a canvas; however - I don't
think any are particularly insuperable.

	It's worth asking yourself what the future of the canvas is; I suppose
- but either way, hopefully whatever work you do will be transferable.

> Add a function to ask the canvas to print itself, something like:
>  >    gnome_canvas_print (GnomeCanvas *canvas, GnomePrintContext *pc);
> with probably some more parameters as width and height.

	It's not really feasible to make the canvas ( in the core platform )
depend on libgnomeprint[ui] which has a highish degree of instability /
API/ABI churn.

> Add a print pointer in GnomeCanvasItemClass with the same extra parameters
>  >    void (*print) (GnomeCanvasItem *item, GnomePrintContext *pc);
> so that each item type will print itself.

	So you have the nub of the problem :-) the good thing is, that with
GObject we can retro-fit an existing GObjectClass with a new
'GTypeInterface' ( see glib/gobject/gtype.h ).

	This will allow us to associate the print functionality separate to
both the canvas, and libgnomeprint - which is presumably the best way to
develop it.

> I don't know if this is really possible and it would add a dependance to 
> libgnomeprint for libgnomecanvas. I suspect difficulties with the text 
> items. May be I can help to implement such a thing as I need such an 
> architecture or equivalent for GChemPaint, so I must do the work anyway.

	So - that's great; I suggest that you create a nice
GnomeCanvasPrintable interface, and write your 'foo_gnome_canvas_print'
method inside GChemPaint [ and fit whatever objects you're interested in
with print interfaces ], then we can look at folding it back into the
core as/when it works.

	It'd be a nice feature to have though :-) [ although, as you say there
are some interesting issues with screen vs. print fonts ].

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers



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