type Gtk_Print_Operation_Record is new Glib.Object.GObject_Record with private;
type Gtk_Print_Operation is access all Gtk_Print_Operation_Record'Class;
type Gtk_Print_Status is (Status_Initial, Status_Preparing, Status_Generating_Data, Status_Sending_Data, Status_Pending, Status_Pending_Issue, Status_Printing, Status_Finished, Status_Finished_Aborted);
type Gtk_Print_Operation_Result is (Result_Error, Result_Apply, Result_Cancel, Result_In_Progress);
type Gtk_Print_Operation_Action is (Action_Print_Dialog, Action_Print, Action_Preview, Action_Export);
Allow_Async_Property : constant Glib.Properties.Property_Boolean;
Current_Page_Property : constant Glib.Properties.Property_Int;
Custom_Tab_Label_Property : constant Glib.Properties.Property_String;
Default_Page_Setup_Property : constant Glib.Properties.Property_Object;
Export_Filename_Property : constant Glib.Properties.Property_String;
Job_Name_Property : constant Glib.Properties.Property_String;
N_Pages_Property : constant Glib.Properties.Property_Int;
Print_Settings_Property : constant Glib.Properties.Property_Object;
Show_Progress_Property : constant Glib.Properties.Property_Boolean;
Status_Property : constant Glib.Properties.Property_Enum;
Status_String_Property : constant Glib.Properties.Property_String;
Track_Print_Status_Property : constant Glib.Properties.Property_Boolean;
Unit_Property : constant Glib.Properties.Property_Enum;
Use_Full_Page_Property : constant Glib.Properties.Property_Boolean;
procedure Gtk_New
( | Widget | : out Gtk_Print_Operation); |
procedure Initialize
( | Widget | : access Gtk_Print_Operation_Record'Class); |
function Get_Type return GType;
function Error_Quark return GQuark;
function Run
( | Op | : access Gtk_Print_Operation_Record; |
Action | : Gtk_Print_Operation_Action; | |
Parent | : access Gtk.Window.Gtk_Window_Record'Class; | |
Error | : Glib.Error.GError := null) return Gtk_Print_Operation_Result; |
procedure Cancel
( | Op | : access Gtk_Print_Operation_Record); |
procedure Draw_Page_Finish
( | Op | : access Gtk_Print_Operation_Record); |
procedure Get_Error
( | Op | : access Gtk_Print_Operation_Record; |
Error | : Glib.Error.GError); |
function Get_Print_Settings
( | Op | : access Gtk_Print_Operation_Record) return Gtk.Print_Settings.Gtk_Print_Settings; |
procedure Set_Print_Settings
( | Op | : access Gtk_Print_Operation_Record; |
Print_Settings | : access Gtk.Print_Settings.Gtk_Print_Settings_Record'Class); |
function Get_Status
( | Op | : access Gtk_Print_Operation_Record) return Gtk_Print_Status; |
function Get_Status
( | Op | : access Gtk_Print_Operation_Record) return String; |
function Is_Finished
( | Op | : access Gtk_Print_Operation_Record) return Boolean; |
procedure Set_Allow_Async
( | Op | : access Gtk_Print_Operation_Record; |
Allow_Async | : Boolean); |
procedure Set_Current_Page
( | Op | : access Gtk_Print_Operation_Record; |
Current_Page | : Gint); |
procedure Set_Custom_Tab_Label
( | Op | : access Gtk_Print_Operation_Record; |
Label | : String); |
procedure Set_Defer_Drawing
( | Op | : access Gtk_Print_Operation_Record); |
procedure Set_Export_Filename
( | Op | : access Gtk_Print_Operation_Record; |
Filename | : String); |
procedure Set_Job_Name
( | Op | : access Gtk_Print_Operation_Record; |
Job_Name | : String); |
procedure Set_N_Pages
( | Op | : access Gtk_Print_Operation_Record; |
N_Pages | : Gint); |
procedure Set_Show_Progress
( | Op | : access Gtk_Print_Operation_Record; |
Show_Progress | : Boolean); |
procedure Set_Track_Print_Status
( | Op | : access Gtk_Print_Operation_Record; |
Track_Status | : Boolean); |
procedure Set_Unit
( | Op | : access Gtk_Print_Operation_Record; |
Unit | : Gtk.Enums.Gtk_Unit); |
procedure Set_Use_Full_Page
( | Op | : access Gtk_Print_Operation_Record; |
Full_Page | : Boolean); |
function Get_Default_Page_Setup
( | Op | : access Gtk_Print_Operation_Record) return Gtk.Page_Setup.Gtk_Page_Setup; |
procedure Set_Default_Page_Setup
( | Op | : access Gtk_Print_Operation_Record; |
Default_Page_Setup | : access Gtk.Page_Setup.Gtk_Page_Setup_Record'Class); |
function Run_Page_Setup_Dialog
( | Parent | : access Gtk.Window.Gtk_Window_Record'Class; |
Page_Setup | : access Gtk.Page_Setup.Gtk_Page_Setup_Record'Class; | |
Settings | : access Gtk.Print_Settings.Gtk_Print_Settings_Record'Class) return Gtk.Page_Setup.Gtk_Page_Setup; |
Gtk_Print_Operation is the high-level, portable printing API. It looks a bit different than other GTK+ dialogs such as the Gtk_File_Chooser, since some platforms don't expose enough infrastructure to implement a good print dialog. On such platforms, Gtk_Print_Operation uses the native print dialog. On platforms which do not provide a native print dialog, GTK+ uses its own, see Gtk_Print_Unix_Dialog.
The typical way to use the high-level printing API is to create a Gtk_Print_Operation object with Gtk_New when the user selects to print.
Then you set some properties on it, e.g. the page size, any Gtk_Print_Settings from previous print operations, the number of pages, the current page, etc.
Then you start the print operation by calling Run. 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 Gtk_Print_Operation, the main one being draw-page, which you are supposed to catch and render the page on the provided Gtk_Print_Context using Cairo.
Note: on UNIX/Linux, Gtk+ is loading at run-time the libraries for printing support. You will need to point the environment variable GTK_EXE_PREFIX to the root directory of your Gtk+ install before calling Run.
Binding from C File version 2.16.6