gtk-High-level-Printing-API {RGtk2}R Documentation

GtkPrintOperation

Description

High-level Printing API

Methods and Functions

gtkPrintOperationNew()
gtkPrintOperationSetAllowAsync(object, allow.async)
gtkPrintOperationGetError(object, .errwarn = TRUE)
gtkPrintOperationSetDefaultPageSetup(object, default.page.setup = NULL)
gtkPrintOperationGetDefaultPageSetup(object)
gtkPrintOperationSetPrintSettings(object, print.settings = NULL)
gtkPrintOperationGetPrintSettings(object)
gtkPrintOperationSetJobName(object, job.name)
gtkPrintOperationSetNPages(object, n.pages)
gtkPrintOperationGetNPagesToPrint(object)
gtkPrintOperationSetCurrentPage(object, current.page)
gtkPrintOperationSetUseFullPage(object, full.page)
gtkPrintOperationSetUnit(object, unit)
gtkPrintOperationSetExportFilename(object, filename)
gtkPrintOperationSetShowProgress(object, show.progress)
gtkPrintOperationSetTrackPrintStatus(object, track.status)
gtkPrintOperationSetCustomTabLabel(object, label)
gtkPrintOperationRun(object, action, parent = NULL, .errwarn = TRUE)
gtkPrintOperationCancel(object)
gtkPrintOperationDrawPageFinish(object)
gtkPrintOperationSetDeferDrawing(object)
gtkPrintOperationGetStatus(object)
gtkPrintOperationGetStatusString(object)
gtkPrintOperationIsFinished(object)
gtkPrintOperationSetSupportSelection(object, support.selection)
gtkPrintOperationGetSupportSelection(object)
gtkPrintOperationSetHasSelection(object, has.selection)
gtkPrintOperationGetHasSelection(object)
gtkPrintOperationSetEmbedPageSetup(object, embed)
gtkPrintOperationGetEmbedPageSetup(object)
gtkPrintRunPageSetupDialog(parent, page.setup = NULL, settings)
gtkPrintRunPageSetupDialogAsync(parent, page.setup, settings, done.cb, data)
gtkPrintOperationPreviewEndPreview(object)
gtkPrintOperationPreviewIsSelected(object, page.nr)
gtkPrintOperationPreviewRenderPage(object, page.nr)
gtkPrintOperation()

Hierarchy

GObject
   +----GtkPrintOperation
GInterface
   +----GtkPrintOperationPreview

Implementations

GtkPrintOperationPreview is implemented by GtkPrintOperation.

Interfaces

GtkPrintOperation implements GtkPrintOperationPreview.

Detailed Description

GtkPrintOperation is the high-level, portable printing API. It looks a bit different than other GTK+ dialogs such as the GtkFileChooser, since some platforms don't expose enough infrastructure to implement a good print dialog. On such platforms, GtkPrintOperation uses the native print dialog. On platforms which do not provide a native print dialog, GTK+ uses its own, see

GtkPrintUnixDialog
. The typical way to use the high-level printing API is to create a GtkPrintOperation object with gtkPrintOperationNew when the user selects to print. Then you set some properties on it, e.g. the page size, any GtkPrintSettings from previous print operations, the number of pages, the current page, etc. Then you start the print operation by calling gtkPrintOperationRun. It will then show a dialog, let the user select a printer and options. When the user finished the dialog various signals will be emitted on the GtkPrintOperation, the main one being ::draw-page, which you are supposed to catch and render the page on the provided GtkPrintContext using Cairo. The high-level printing API
settings <- NULL
print_something <-
{
  op <- gtkPrintOperation()

  if (!is.null(settings)) 
    op$setPrintSettings(settings)

  gSignalConnect(op, "begin_print", begin_print)
  gSignalConnect(op, "draw_page", draw_page)

  res <- op$run("print-dialog", main_window)[[1]]

  if (res == "apply")
    settings <- op$getPrintSettings()
}
By default GtkPrintOperation uses an external application to do print preview. To implement a custom print preview, an application must connect to the preview signal. The functions gtkPrintOperationPrintPreviewRenderPage(), gtkPrintOperationPreviewEndPreview and gtkPrintOperationPreviewIsSelected are useful when implementing a print preview. Printing support was added in GTK+ 2.10.

Structures

Convenient Construction

gtkPrintOperation is the equivalent of gtkPrintOperationNew.

Enums and Flags

User Functions

GtkPageSetupDoneFunc(page.setup, data)

The type of function that is passed to gtkPrintRunPageSetupDialogAsync. This function will be called when the page setup dialog is dismissed, and also serves as destroy notify for data.

page.setup

the GtkPageSetup that has been

data

user data that has been passed to gtkPrintRunPageSetupDialogAsync.

Signals

Properties

Author(s)

Derived by RGtkGen from GTK+ documentation

References

http://library.gnome.org/devel//gtk/gtk-High-level-Printing-API.html

See Also

GtkPrintContext


[Package RGtk2 version 2.20.21 Index]