Re: [Gnome-print] GnomePrintContext -> GnomePrintMaster
- From: Bryan Buchanan <bryanb webbtide com au>
- To: gnome-print <gnome-print helixcode com>
- Subject: Re: [Gnome-print] GnomePrintContext -> GnomePrintMaster
- Date: Sat, 08 Dec 2001 21:58:10 +1000
Lauris Kaplinski wrote:
> Hello!
>
> 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
Lauris,
Thanks.
Would it be a good (or bad !) idea to modify gnome_print_master_new()
to take a valid GnomePrintContext as an arguement ?
Bryan
>
>
> 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 - Gnome-print@ximian.com
> > http://lists.ximian.com/mailman/listinfo/gnome-print
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]