Index

Package: Page_Setup

Description

package Gtk.Page_Setup is

A GtkPageSetup object stores the page size, orientation and margins. The idea is that you can get one of these from the page setup dialog and then pass it to the Gtk.Print_Operation.Gtk_Print_Operation when printing. The benefit of splitting this out of the Gtk.Print_Settings.Gtk_Print_Settings is that these affect the actual layout of the page, and thus need to be set long before user prints. <para id="print-margins"> The margins specified in this object are the "print margins", i.e. the parts of the page that the printer cannot print on. These are different from the layout margins that a word processor uses; they are typically used to determine the *minimal* size for the layout margins.

To obtain a Gtk.Page_Setup.Gtk_Page_Setup use Gtk.Page_Setup.Gtk_New to get the defaults, or use gtk_print_run_page_setup_dialog to show the page setup dialog and receive the resulting page setup. == A page setup dialog == static GtkPrintSettings *settings = NULL; static GtkPageSetup *page_setup = NULL; static void do_page_setup (void) { GtkPageSetup *new_page_setup; if (settings == NULL) settings = gtk_print_settings_new (<!-- -->); new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window), page_setup, settings); if (page_setup) g_object_unref (page_setup); page_setup = new_page_setup; } Printing support was added in GTK+ 2.10.

Classes

Gtk_Page_Setup_Record

type Gtk_Page_Setup_Record is new GObject_Record with null record;

Ancestors:

Primitive operations:

Get_Bottom_Margin
Get_Left_Margin
Get_Orientation
Get_Page_Height
Get_Page_Width
Get_Paper_Height
Get_Paper_Size
Get_Paper_Width
Get_Right_Margin
Get_Top_Margin
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Load_Key_File
Set_Bottom_Margin
Set_Left_Margin
Set_Orientation
Set_Paper_Size
Set_Paper_Size_And_Default_Margins
Set_Right_Margin
Set_Top_Margin

Types

Gtk_Page_Setup

type Gtk_Page_Setup is access all Gtk_Page_Setup_Record'Class;

Subprograms & Entries

Gtk_New

procedure Gtk_New 
(Self: out Gtk_Page_Setup);

Initialize

procedure Initialize 
(Self: not null access Gtk_Page_Setup_Record'Class);
Creates a new Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10

Gtk_Page_Setup_New

function Gtk_Page_Setup_New return Gtk_Page_Setup;
Creates a new Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10

Gtk_New_From_File

procedure Gtk_New_From_File 
(Self: out Gtk_Page_Setup;
File_Name: UTF8_String);

Initialize_From_File

procedure Initialize_From_File 
(Self: not null access Gtk_Page_Setup_Record'Class;
File_Name: UTF8_String);
Reads the page setup from the file File_Name. Returns a new Gtk.Page_Setup.Gtk_Page_Setup object with the restored page setup, or null if an error occurred. See Gtk.Page_Setup.To_File. Since: gtk+ 2.12 "file_name": the filename to read the page setup from

Gtk_Page_Setup_New_From_File

function Gtk_Page_Setup_New_From_File 
(File_Name: UTF8_String) return Gtk_Page_Setup;
Reads the page setup from the file File_Name. Returns a new Gtk.Page_Setup.Gtk_Page_Setup object with the restored page setup, or null if an error occurred. See Gtk.Page_Setup.To_File. Since: gtk+ 2.12 "file_name": the filename to read the page setup from

Gtk_New_From_Key_File

procedure Gtk_New_From_Key_File 
(Self: out Gtk_Page_Setup;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: UTF8_String := "");

Initialize_From_Key_File

procedure Initialize_From_Key_File 
(Self: not null access Gtk_Page_Setup_Record'Class;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: UTF8_String := "");
Reads the page setup from the group Group_Name in the key file Key_File. Returns a new Gtk.Page_Setup.Gtk_Page_Setup object with the restored page setup, or null if an error occurred. Since: gtk+ 2.12 "key_file": the Gkey.File.Gkey_File to retrieve the page_setup from "group_name": the name of the group in the key_file to read, or null to use the default name "Page Setup"

Gtk_Page_Setup_New_From_Key_File

function Gtk_Page_Setup_New_From_Key_File 
(Key_File: Glib.Key_File.G_Key_File;
Group_Name: UTF8_String := "") return Gtk_Page_Setup;
Reads the page setup from the group Group_Name in the key file Key_File. Returns a new Gtk.Page_Setup.Gtk_Page_Setup object with the restored page setup, or null if an error occurred. Since: gtk+ 2.12 "key_file": the Gkey.File.Gkey_File to retrieve the page_setup from "group_name": the name of the group in the key_file to read, or null to use the default name "Page Setup"

Get_Type

function Get_Type return Glib.GType;

Copy

function Copy 
(Self: not null access Gtk_Page_Setup_Record) return Gtk_Page_Setup;
Copies a Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10

Get_Bottom_Margin

function Get_Bottom_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Gets the bottom margin in units of Unit. Since: gtk+ 2.10 "unit": the unit for the return value

Set_Bottom_Margin

procedure Set_Bottom_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Margin: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Sets the bottom margin of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10 "margin": the new bottom margin in units of Unit "unit": the units for Margin

Get_Left_Margin

function Get_Left_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Gets the left margin in units of Unit. Since: gtk+ 2.10 "unit": the unit for the return value

Set_Left_Margin

procedure Set_Left_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Margin: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Sets the left margin of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10 "margin": the new left margin in units of Unit "unit": the units for Margin

Get_Orientation

function Get_Orientation 
(Self: not null access Gtk_Page_Setup_Record) return Gtk.Enums.Gtk_Page_Orientation;
Gets the page orientation of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10

Set_Orientation

procedure Set_Orientation 
(Self: not null access Gtk_Page_Setup_Record;
Orientation: Gtk.Enums.Gtk_Page_Orientation);
Sets the page orientation of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10 "orientation": a Gtk.Enums.Gtk_Page_Orientation value

Get_Page_Height

function Get_Page_Height 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Returns the page height in units of Unit. Note that this function takes orientation and margins into consideration. See Gtk.Page_Setup.Get_Paper_Height. Since: gtk+ 2.10 "unit": the unit for the return value

Get_Page_Width

function Get_Page_Width 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Returns the page width in units of Unit. Note that this function takes orientation and margins into consideration. See Gtk.Page_Setup.Get_Paper_Width. Since: gtk+ 2.10 "unit": the unit for the return value

Get_Paper_Height

function Get_Paper_Height 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Returns the paper height in units of Unit. Note that this function takes orientation, but not margins into consideration. See Gtk.Page_Setup.Get_Page_Height. Since: gtk+ 2.10 "unit": the unit for the return value

Get_Paper_Size

function Get_Paper_Size 
(Self: not null access Gtk_Page_Setup_Record) return Gtk.Paper_Size.Gtk_Paper_Size;
Gets the paper size of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10

Set_Paper_Size

procedure Set_Paper_Size 
(Self: not null access Gtk_Page_Setup_Record;
Size: Gtk.Paper_Size.Gtk_Paper_Size);
Sets the paper size of the Gtk.Page_Setup.Gtk_Page_Setup without changing the margins. See Gtk.Page_Setup.Set_Paper_Size_And_Default_Margins. Since: gtk+ 2.10 "size": a Gtk.Paper_Size.Gtk_Paper_Size

Get_Paper_Width

function Get_Paper_Width 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Returns the paper width in units of Unit. Note that this function takes orientation, but not margins into consideration. See Gtk.Page_Setup.Get_Page_Width. Since: gtk+ 2.10 "unit": the unit for the return value

Get_Right_Margin

function Get_Right_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Gets the right margin in units of Unit. Since: gtk+ 2.10 "unit": the unit for the return value

Set_Right_Margin

procedure Set_Right_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Margin: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Sets the right margin of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10 "margin": the new right margin in units of Unit "unit": the units for Margin

Get_Top_Margin

function Get_Top_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Gets the top margin in units of Unit. Since: gtk+ 2.10 "unit": the unit for the return value

Set_Top_Margin

procedure Set_Top_Margin 
(Self: not null access Gtk_Page_Setup_Record;
Margin: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Sets the top margin of the Gtk.Page_Setup.Gtk_Page_Setup. Since: gtk+ 2.10 "margin": the new top margin in units of Unit "unit": the units for Margin

Load_File

function Load_File 
(Self: not null access Gtk_Page_Setup_Record;
File_Name: UTF8_String) return Boolean;
Reads the page setup from the file File_Name. See Gtk.Page_Setup.To_File. Since: gtk+ 2.14 "file_name": the filename to read the page setup from

Load_Key_File

function Load_Key_File 
(Self: not null access Gtk_Page_Setup_Record;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: UTF8_String := "") return Boolean;
Reads the page setup from the group Group_Name in the key file Key_File. Since: gtk+ 2.14 "key_file": the Gkey.File.Gkey_File to retrieve the page_setup from "group_name": the name of the group in the key_file to read, or null to use the default name "Page Setup"

Set_Paper_Size_And_Default_Margins

procedure Set_Paper_Size_And_Default_Margins 
(Self: not null access Gtk_Page_Setup_Record;
Size: Gtk.Paper_Size.Gtk_Paper_Size);
Sets the paper size of the Gtk.Page_Setup.Gtk_Page_Setup and modifies the margins according to the new paper size. Since: gtk+ 2.10 "size": a Gtk.Paper_Size.Gtk_Paper_Size

To_File

function To_File 
(Self: not null access Gtk_Page_Setup_Record;
File_Name: UTF8_String) return Boolean;
This function saves the information from Setup to File_Name. Since: gtk+ 2.12 "file_name": the file to save to

To_Key_File

procedure To_Key_File 
(Self: not null access Gtk_Page_Setup_Record;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: UTF8_String);
This function adds the page setup from Setup to Key_File. Since: gtk+ 2.12 "key_file": the Gkey.File.Gkey_File to save the page setup to "group_name": the group to add the settings to in Key_File, or null to use the default name "Page Setup"