Re: [Gnome-print] GnomePrintContext -> GnomePrintMaster


GnomePrintMaster is intended to be semi-opaque interface to
printing engine. You cannot access its members directly, and
this most probably will remain so in future.

If you have more complex needs, the best solution would be
to use GnomePrintMaster building blocks directly. All, that
is happening behind-the-scenes is:

- New master creates GnomePrintMeta context
- All printing goes to that metafile
- Now, for either preview or actual printing, that metafile is
  rerendered to requested context (preview, actual printer)

So, I think, the best solution would be to create 4 metafiles
for each square, render those to separate print preview
canvases, and on-request render selected to actual output
context (which you can create, using GnomePrintDialog).

Still, be cautious, as metafile duplicates all images in-memory
uncompressed, so keeping it alive can be quite memory-consuming.
It may be better, to define printing callback for your application,
and re-call it for either creating preview, or producing output.

Best wishes,
Lauris Kaplinski

On Thu, 2001-12-06 at 13:18, Bryan Buchanan wrote:
> Hi,
> How can I get a GnomePrintContext used as a gnome_print_preview_new()
> into a GnomePrintMaster object ?
> The general flow of logic (from the example programs) seems to be:
> gpd = gnome_print_dialog_new()
> gpm = gnome_print_master_new()
> gnome_print_master_set_printer(gpm, gnome_print_dialog_get_printer(gpd))
> pc = gnome_print_master_get_context(gpm)
> ... gnome_print*() functions
> gnome_print_master_close()
> if(preview)gnome_print_master_preview_new(gpm, "...")
> gnome_print_master_print()
> Alternatively, I can create a canvas object as part of my UI, and have
> pc = gnome_print_preview_new(my_canvas, "paper")
> ...gnome_print*() functions
> If I create a GnomePrintContext in this manner, how can I then get a
> GnomePrintMaster object to know about this ?
> (As an example of why you might want to do this, suppose you had a
> screen with 4 squares, each being a canvas which can be drawn to.  I'd
> like to draw something in each square, then from a menu choose an option
> to print square 1, or 2, etc).
> Bryan
> _______________________________________________
> Gnome-print maillist  -

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