This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Breakout session for the Boston2005 conference

The GTK+ team is going to have a working session on fixing printing for GTK+ 2.10. To try to split up the workload, we're going to break into the following working groups. We'll have a better summit if we're able to do some research on these topics ahead of time. Each group has a lead (listed below). There are other parts of the print infrastructure that I'm assuming exists, and isn't really covered here. There's information on general requirements at ProjectRidley/GnomePrintDialog

How GTK+ talks to the printing infrastructure (JodyGoldberg)

Open Issues:

Cairo's printing API (CarlWorth, KristianHogsberg)

Open Issues:

User test-case:

Discussion results (2005-10-08):

The API additions can be broken into three logically independent pieces:

typedef struct _cairo_document_properties cairo_document_properties_t;

cairo_public cairo_document_properties_t *
cairo_document_properties_create (void);

cairo_public void
cairo_document_properties_destroy (cairo_document_properties_t *properties);

cairo_public cairo_status_t
cairo_document_properties_status (cairo_document_properties_t *properties);

/* XXX: Need to double-check these names against the PDF reference */
cairo_public void
cairo_document_properties_set_title (cairo_document_properties_t *properties,
                                     const char                  *title);

cairo_public void
cairo_document_properties_set_subject (cairo_document_properties_t *properties,
                                       const char                  *subject);

cairo_public void
cairo_document_properties_set_author (cairo_document_properties_t *properties,
                                      const char                  *author);

cairo_public void
cairo_document_properties_set_producer (cairo_document_properties_t *properties,
                                        const char                  *producer);

/* XXX: Does cairo get to set creator as itself? */

/* XXX: Need to define an enum cairo_orientation_t here. PORTRAIT, LANDSCAPE, SEASCAPE? */
cairo_public void
cairo_document_properties_set_orientation (cairo_document_properties_t *properties,
                                           cairo_orientation_t          orientation);

cairo_public void
cairo_surface_set_document_properties (cairo_surface_t             *surface,
                                       cairo_document_properties_t *properties)

/* XXX: Need an enum cairo_paper_size_t here. Who has a "complete" list? */
cairo_public cairo_surface_t *
cairo_ps_surface_create_for_paper_size (const char        *filename,
                                        cairo_paper_size_t size);

cairo_public cairo_surface_t *
cairo_pdf_surface_create_for_paper_size (const char        *filename,
                                         cairo_paper_size_t size);

/* XXX: Again, double-check this terminology against what's in the PDF reference. */
cairo_public void
cairo_pdf_surface_set_page_label (cairo_surface_t *surface,
                                  const char      *label);

/* XXX: Do we even want this? What other random page-specific junk might PDF want? */
/* XXX: Need an enum cairo_pdf_transition_t here */
cairo_public void
cairo_pdf_surface_set_page_transition (cairo_surface_t       *surface,
                                       cairo_pdf_transition_t transition);

/* XXX: Need something to support URL links? */

/* XXX: Need something to provide a table-of-contents within the PDF document.
        Check the reference to see what it needs, and what the real terminology
        is, but we might just have three function calls something like:

        cairo_toc_create ()
        cairo_toc_add_tag ()
        cairo_pdf_surface_set_toc ()
*/

Evince as print preview (JonathanBlandford)

Open Issues:

Existing Examples:

Windows backend (TorLillqvist)

Open Issues:

Gtk print dialog and API (OwenTaylor)

Open Issues:

Existing Examples:

Draft API:

API mockup proposal thing:

void my_app_that_prints () {

    // Open problem: do we need a page setup dialog first?
    // The following code has no page setup dialog

    dialog = gtk_print_dialog_new ();
    gtk_print_dialog_run ();

    settings = gtk_print_dialog_get_printer_settings ();

    // settings can be stored, read, etc
    duplex = gtk_print_settings_get_duplex_mode (settings);

    job = gtk_print_job_new (settings);

    // what information belongs to the job vs the printer settings?
    dpi = gtk_print_job_get_dpi (job);
    margins = gtk_print_job_get_margins (job);

    cr = gtk_print_job_create_cairo (job);

    // draw first pagehere

    // to go to the next page, do we need to go through the job or can we call
    // cairo_show_page () directly ?
    gtk_print_job_show_page (job);

    // draw second page here

    gtk_print_job_end_document (job);

}

2024-10-23 10:58