Re: Highlevel printing API - proposal



On Wed, 2006-01-25 at 13:58 -0500, Matthias Clasen wrote:
> On 1/25/06, Alexander Larsson <alexl redhat com> wrote:
>           resources
> >
> > When this is done the job is sent to the spooler, and the function
> > returns. We could add some form of feedback on the printing progress as
> > other signals on the object. At this point you should get the new
> > printer settings object and save that for the next print operation.
> >
> 
> How can this be used in an asynchronous fashion if the run() function
> does not return untll the print is spooled ? Can I bring up a print dialog,
> then do some other things with the application before going back to the
> print dialog and print ?

This is a complicated question, i.e. can I have a non-modal dialog and
modify the to-be printed document while the print dialog is up. What if
properties of the document that are reflected in the UI of the print
dialog changes? I.e. page count, page sizes, data for an inline
preview? 

Another problem could be that the print operation stored some data from
the document to use for printing, but then that changes before the print
commences, which could cause problems. If you only do such things from
the begin_print handler it should be ok though.

Then there might be technical issues with having a non-modal printing
dialog open on some platforms, especially in parallel with gtk+ dialogs
running. Hopefully we can avoid such problems.

I think these things are solvable though, and by an addition like:
egg_print_operation_run_async ()
egg_print_operation_cancel ()
we could allow the print dialog to run async.

I've also been thinking of adding something like.
egg_print_operation_set_render_in_thread ()
which would do the actual render operation in a thread too, to avoid
blocking the app. Of course, this requires a certain amount of
threadsafeness in the app, and a way for it to either freeze document
editing or snapshot the document state to avoid inconsistancies in the
printed document.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an old-fashioned playboy romance novelist with a robot buddy named 
Sparky. She's an enchanted extravagent barmaid who hides her beauty behind a 
pair of thick-framed spectacles. They fight crime! 




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