Re: Printing lines, shapes and pixmaps from a gnome canvas



Hi Jean,

On Sat, 2003-01-18 at 14:38, Jean Bréfort wrote:
> I am currently working on adding a print function to the Gnome Canvas,
> so that when a canvas has been filled, a simple call to
> gnome_canvas_print(canvas, pc) will print it (it must fit on one page).

	Sounds like this is a great idea. I tend to think though, that it's
better not to do this as an extra function, but instead to add a GObject
GInterface such as 'GPrintable' or something - such that objects can
implement that to flag that they support printing (?). Then eg. an
embedded widget can implement it if it feels that it can print itself -
otherwise perhaps not. [ A stock widget is almost never a good WYSIWYG
item ].

>     When I first tried, pixmaps did not appeared in the preview. I could 
> trace the problem to the -1 in the transform matrix (note that it works 

	When I first played with images, I wasn't aware of the fact that you
had to concat a scale matrix before doing anything ;-) otherwise it
turns up at 1x1 point or something crazy ;-) I assume you got that
right.

> It works for preview, but if I try to really print (the primitives page 
> in canvas_demo), the programs did nothing for about four minutes and the 
> stopped. The messages are (4 min betwwen the two messages):
...
> with strace, things end with:
> 
>     brk(0x19853000)                         = 0x19853000
>     brk(0x19854000)                         = 0x19854000
>     brk(0x19855000)                         = 0x19855000
>     brk(0x19856000)                         = 0x19856000
>     brk(0x19857000)                         = 0x19857000
> +++ killed by SIGKILL +++

	It ran out of space and got OOM killed I guess. The way to find this is
to run it in gdb:

	gdb foo-test
	r
	... wait until it's into the long run ...
	<control>-C
	bt

	And post a stack-trace and/or it'll become obvious where the problem is
I guess. It'd be great to fix that loop asap.

> What other things remain to be done?
>     * Widgets items: I don't know if it is interesting to print widgets, 
> or even if it is possible; copying a drawable into a pixmap to print it 
> later only works if the widget is visible on the screen (if I have 
> correctly understood the docs).

	Yes - you want to ignore widgets entirely - unless they have your
special printing interface [ IMHO ].

> Current state of the code is available upon request.

	It sounds like you're doing some great work :-) keep it up, it'd be
worth posting a link to some place where you've uploaded the code so
interested people can have a poke.

	Regards,

		Michael.

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




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