2.12 <GtkPrintOperationPreview>

Interface: <GtkPrintOperationPreview>

The interface that is used to implement print preview.

A <GtkPrintOperationPreview> object is passed to the print-operation:preview signal by <GtkPrintOperation>.

Procedures

Method: print-operation-preview:end-preview self
Method: end-preview self

Ends a preview.

This function must be called to finish a custom print preview.

self

Passed: a <GtkPrintOperationPreview>.

a <GtkPrintOperationPreview>

Method: print-operation-preview:is-selected? self page-nr ⇒ %return
Method: is-selected? self page-nr ⇒ %return

Returns whether the given page is included in the set of pages that have been selected for printing.

self

Passed: a <GtkPrintOperationPreview>.

a <GtkPrintOperationPreview>

page-nr

Passed: a 32-bit integer.

a page number

%return

Returned: a boolean.

#t if the page has been selected for printing

Method: print-operation-preview:render-page self page-nr
Method: render-page self page-nr

Renders a page to the preview.

This is using the print context that was passed to the print-operation:preview handler together with self.

A custom print preview should use this function to render the currently selected page.

Note that this function requires a suitable cairo context to be associated with the print context.

self

Passed: a <GtkPrintOperationPreview>.

a <GtkPrintOperationPreview>

page-nr

Passed: a 32-bit integer.

the page to render

Signals

Signal: print-operation-preview:got-page-size

Connect a handler with (connect object print-operation-preview:got-page-size handler). It is called as (handler self context page-setup).

Emitted once for each page that gets rendered to the preview.

A handler for this signal should update the context according to page-setup and set up a suitable cairo context, using print-context:set-cairo-context.

self

Passed: a <GtkPrintOperationPreview>.

context

Passed: a <GtkPrintContext>.

the current <GtkPrintContext>

page-setup

Passed: a <GtkPageSetup>.

the <GtkPageSetup> for the current page

Signal: print-operation-preview:ready

Connect a handler with (connect object print-operation-preview:ready handler). It is called as (handler self context).

The ::ready signal gets emitted once per preview operation, before the first page is rendered.

A handler for this signal can be used for setup tasks.

self

Passed: a <GtkPrintOperationPreview>.

context

Passed: a <GtkPrintContext>.

the current <GtkPrintContext>

Virtual methods

Virtual method: print-operation-preview:do-end-preview implementor self

Ends a preview.

This function must be called to finish a custom print preview.

To override it in a new class, give register-type #:vfuncs `((end-preview . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: a class that implements <GtkPrintOperationPreview>, or its GType number.

self

Passed: a <GtkPrintOperationPreview>.

a <GtkPrintOperationPreview>

Virtual method: print-operation-preview:do-got-page-size implementor self context page-setup

To override it in a new class, give register-type #:vfuncs `((got-page-size . ,procedure)). The procedure is called as (procedure self context page-setup).

implementor

Passed: the class whose implementation to call: a class that implements <GtkPrintOperationPreview>, or its GType number.

self

Passed: a <GtkPrintOperationPreview>.

context

Passed: a <GtkPrintContext>.

page-setup

Passed: a <GtkPageSetup>.

Virtual method: print-operation-preview:do-is-selected implementor self page-nr ⇒ %return

Returns whether the given page is included in the set of pages that have been selected for printing.

To override it in a new class, give register-type #:vfuncs `((is-selected . ,procedure)). The procedure is called as (procedure self page-nr) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkPrintOperationPreview>, or its GType number.

self

Passed: a <GtkPrintOperationPreview>.

a <GtkPrintOperationPreview>

page-nr

Passed: a 32-bit integer.

a page number

%return

Returned: a boolean.

#t if the page has been selected for printing

Virtual method: print-operation-preview:do-ready implementor self context

To override it in a new class, give register-type #:vfuncs `((ready . ,procedure)). The procedure is called as (procedure self context).

implementor

Passed: the class whose implementation to call: a class that implements <GtkPrintOperationPreview>, or its GType number.

self

Passed: a <GtkPrintOperationPreview>.

context

Passed: a <GtkPrintContext>.

Virtual method: print-operation-preview:do-render-page implementor self page-nr

Renders a page to the preview.

This is using the print context that was passed to the print-operation:preview handler together with self.

A custom print preview should use this function to render the currently selected page.

Note that this function requires a suitable cairo context to be associated with the print context.

To override it in a new class, give register-type #:vfuncs `((render-page . ,procedure)). The procedure is called as (procedure self page-nr).

implementor

Passed: the class whose implementation to call: a class that implements <GtkPrintOperationPreview>, or its GType number.

self

Passed: a <GtkPrintOperationPreview>.

a <GtkPrintOperationPreview>

page-nr

Passed: a 32-bit integer.

the page to render