Gtk.Paper_Size

Entities

Tagged Types

Constants

Subprograms

Generic Instantiations

Description

GtkPaperSize handles paper sizes. It uses the standard called PWG 5101.1-2002 PWG: Standard for Media Standardized Names to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, GtkPaperSize allows to construct custom paper sizes with arbitrary dimensions.

The Gtk.Paper_Size.Gtk_Paper_Size object stores not only the dimensions (width and height) of a paper size and its name, it also provides default [print margins][print-margins].

Printing support has been added in GTK+ 2.10.

Convert

function Convert (R : Gtk.Paper_Size.Gtk_Paper_Size) return System.Address
Parameters
R
Return Value

Convert

function Convert (R : System.Address) return Gtk.Paper_Size.Gtk_Paper_Size
Parameters
R
Return Value

Copy

function Copy (Widget : Gtk_Paper_Size) return Gtk_Paper_Size

Copies an existing Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Return Value

a copy of Other

Free

procedure Free (Widget : Gtk_Paper_Size)

Free the given Gtk.Paper_Size.Gtk_Paper_Size object. Since: gtk+ 2.10

Parameters
Widget

From_Object

function From_Object (Object : System.Address) return Gtk_Paper_Size
Parameters
Object
Return Value

From_Object_Free

function From_Object_Free (B : access Gtk_Paper_Size'Class) return Gtk_Paper_Size
Parameters
B
Return Value

Get_Default

function Get_Default return UTF8_String

Returns the name of the default paper size, which depends on the current locale. Since: gtk+ 2.10

Return Value

the name of the default paper size. The string is owned by GTK+ and should not be modified.

Get_Default_Bottom_Margin

function Get_Default_Bottom_Margin
   (Widget : Gtk_Paper_Size;
    Unit   : Gtk.Enums.Gtk_Unit) return Gdouble

Gets the default bottom margin for the Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Unit

the unit for the return value, not Gtk.Enums.None

Return Value

the default bottom margin

Get_Default_Left_Margin

function Get_Default_Left_Margin
   (Widget : Gtk_Paper_Size;
    Unit   : Gtk.Enums.Gtk_Unit) return Gdouble

Gets the default left margin for the Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Unit

the unit for the return value, not Gtk.Enums.None

Return Value

the default left margin

Get_Default_Right_Margin

function Get_Default_Right_Margin
   (Widget : Gtk_Paper_Size;
    Unit   : Gtk.Enums.Gtk_Unit) return Gdouble

Gets the default right margin for the Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Unit

the unit for the return value, not Gtk.Enums.None

Return Value

the default right margin

Get_Default_Top_Margin

function Get_Default_Top_Margin
   (Widget : Gtk_Paper_Size;
    Unit   : Gtk.Enums.Gtk_Unit) return Gdouble

Gets the default top margin for the Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Unit

the unit for the return value, not Gtk.Enums.None

Return Value

the default top margin

Get_Display_Name

function Get_Display_Name (Widget : Gtk_Paper_Size) return UTF8_String

Gets the human-readable name of the Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Return Value

the human-readable name of Size

Get_Height

function Get_Height
   (Widget : Gtk_Paper_Size;
    Unit   : Gtk.Enums.Gtk_Unit) return Gdouble

Gets the paper height of the Gtk.Paper_Size.Gtk_Paper_Size, in units of Unit. Since: gtk+ 2.10

Parameters
Widget
Unit

the unit for the return value, not Gtk.Enums.None

Return Value

the paper height

Get_Name

function Get_Name (Widget : Gtk_Paper_Size) return UTF8_String

Gets the name of the Gtk.Paper_Size.Gtk_Paper_Size. Since: gtk+ 2.10

Parameters
Widget
Return Value

the name of Size

Get_Paper_Sizes

function Get_Paper_Sizes
   (Include_Custom : Boolean) return Gtk_Paper_Size_Glist.Glist

Creates a list of known paper sizes. Since: gtk+ 2.12

Parameters
Include_Custom

whether to include custom paper sizes as defined in the page setup dialog

Return Value

Get_Ppd_Name

function Get_Ppd_Name (Widget : Gtk_Paper_Size) return UTF8_String

Gets the PPD name of the Gtk.Paper_Size.Gtk_Paper_Size, which may be null. Since: gtk+ 2.10

Parameters
Widget
Return Value

the PPD name of Size

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Width

function Get_Width
   (Widget : Gtk_Paper_Size;
    Unit   : Gtk.Enums.Gtk_Unit) return Gdouble

Gets the paper width of the Gtk.Paper_Size.Gtk_Paper_Size, in units of Unit. Since: gtk+ 2.10

Parameters
Widget
Unit

the unit for the return value, not Gtk.Enums.None

Return Value

the paper width

Gtk_New

procedure Gtk_New (Widget : out Gtk_Paper_Size; Name : UTF8_String := "")

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object by parsing a PWG 5101.1-2002 paper name. If Name is null, the default paper size is returned, see Gtk.Paper_Size.Get_Default. Since: gtk+ 2.10

Parameters
Widget
Name

a paper size name, or null

Gtk_New_Custom

procedure Gtk_New_Custom
   (Widget       : out Gtk_Paper_Size;
    Name         : UTF8_String;
    Display_Name : UTF8_String;
    Width        : Gdouble;
    Height       : Gdouble;
    Unit         : Gtk.Enums.Gtk_Unit)

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object with the given parameters. Since: gtk+ 2.10

Parameters
Widget
Name

the paper name

Display_Name

the human-readable name

Width

the paper width, in units of Unit

Height

the paper height, in units of Unit

Unit

the unit for Width and Height. not Gtk.Enums.None.

Gtk_New_From_Gvariant

procedure Gtk_New_From_Gvariant
   (Widget  : out Gtk_Paper_Size;
    Variant : Glib.Variant.Gvariant)

Deserialize a paper size from an a{sv} variant in the format produced by Gtk.Paper_Size.To_Gvariant. Since: gtk+ 3.22

Parameters
Widget
Variant

an a{sv} Glib.Variant.Gvariant

Gtk_New_From_Ipp

procedure Gtk_New_From_Ipp
   (Widget   : out Gtk_Paper_Size;
    Ipp_Name : UTF8_String;
    Width    : Gdouble;
    Height   : Gdouble)

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object by using IPP information. If Ipp_Name is not a recognized paper name, Width and Height are used to construct a custom Gtk.Paper_Size.Gtk_Paper_Size object. Since: gtk+ 3.16

Parameters
Widget
Ipp_Name

an IPP paper name

Width

the paper width, in points

Height

the paper height in points

Gtk_New_From_Key_File

procedure Gtk_New_From_Key_File
   (Widget     : out Gtk_Paper_Size;
    Key_File   : Glib.Key_File.G_Key_File;
    Group_Name : UTF8_String := "")

Reads a paper size from the group Group_Name in the key file Key_File. Since: gtk+ 2.12

Parameters
Widget
Key_File

the Gkey.File.Gkey_File to retrieve the papersize from

Group_Name

the name of the group in the key file to read, or null to read the first group

Gtk_New_From_Ppd

procedure Gtk_New_From_Ppd
   (Widget           : out Gtk_Paper_Size;
    Ppd_Name         : UTF8_String;
    Ppd_Display_Name : UTF8_String;
    Width            : Gdouble;
    Height           : Gdouble)

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object by using PPD information. If Ppd_Name is not a recognized PPD paper name, Ppd_Display_Name, Width and Height are used to construct a custom Gtk.Paper_Size.Gtk_Paper_Size object. Since: gtk+ 2.10

Parameters
Widget
Ppd_Name

a PPD paper name

Ppd_Display_Name

the corresponding human-readable name

Width

the paper width, in points

Height

the paper height in points

Gtk_Paper_Name_A3

Gtk_Paper_Name_A3        : constant String := "iso_a3";

Gtk_Paper_Name_A4

Gtk_Paper_Name_A4        : constant String := "iso_a4";

Gtk_Paper_Name_A5

Gtk_Paper_Name_A5        : constant String := "iso_a5";

Gtk_Paper_Name_B5

Gtk_Paper_Name_B5        : constant String := "iso_b5";

Gtk_Paper_Name_Executive

Gtk_Paper_Name_Executive : constant String := "na_executive";

Gtk_Paper_Name_Legal

Gtk_Paper_Name_Legal     : constant String := "na_legal";

Gtk_Paper_Name_Letter

Gtk_Paper_Name_Letter    : constant String := "na_letter";

Gtk_Paper_Size

type Gtk_Paper_Size is new Glib.C_Boxed with null record;

Gtk_Paper_Size_Glist

package Gtk_Paper_Size_Glist is new Generic_List (Gtk.Paper_Size.Gtk_Paper_Size);

Gtk_Paper_Size_New

function Gtk_Paper_Size_New
   (Name : UTF8_String := "") return Gtk_Paper_Size

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object by parsing a PWG 5101.1-2002 paper name. If Name is null, the default paper size is returned, see Gtk.Paper_Size.Get_Default. Since: gtk+ 2.10

Parameters
Name

a paper size name, or null

Return Value

Gtk_Paper_Size_New_Custom

function Gtk_Paper_Size_New_Custom
   (Name         : UTF8_String;
    Display_Name : UTF8_String;
    Width        : Gdouble;
    Height       : Gdouble;
    Unit         : Gtk.Enums.Gtk_Unit) return Gtk_Paper_Size

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object with the given parameters. Since: gtk+ 2.10

Parameters
Name

the paper name

Display_Name

the human-readable name

Width

the paper width, in units of Unit

Height

the paper height, in units of Unit

Unit

the unit for Width and Height. not Gtk.Enums.None.

Return Value

Gtk_Paper_Size_New_From_Gvariant

function Gtk_Paper_Size_New_From_Gvariant
   (Variant : Glib.Variant.Gvariant) return Gtk_Paper_Size

Deserialize a paper size from an a{sv} variant in the format produced by Gtk.Paper_Size.To_Gvariant. Since: gtk+ 3.22

Parameters
Variant

an a{sv} Glib.Variant.Gvariant

Return Value

Gtk_Paper_Size_New_From_Ipp

function Gtk_Paper_Size_New_From_Ipp
   (Ipp_Name : UTF8_String;
    Width    : Gdouble;
    Height   : Gdouble) return Gtk_Paper_Size

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object by using IPP information. If Ipp_Name is not a recognized paper name, Width and Height are used to construct a custom Gtk.Paper_Size.Gtk_Paper_Size object. Since: gtk+ 3.16

Parameters
Ipp_Name

an IPP paper name

Width

the paper width, in points

Height

the paper height in points

Return Value

Gtk_Paper_Size_New_From_Key_File

function Gtk_Paper_Size_New_From_Key_File
   (Key_File   : Glib.Key_File.G_Key_File;
    Group_Name : UTF8_String := "") return Gtk_Paper_Size

Reads a paper size from the group Group_Name in the key file Key_File. Since: gtk+ 2.12

Parameters
Key_File

the Gkey.File.Gkey_File to retrieve the papersize from

Group_Name

the name of the group in the key file to read, or null to read the first group

Return Value

Gtk_Paper_Size_New_From_Ppd

function Gtk_Paper_Size_New_From_Ppd
   (Ppd_Name         : UTF8_String;
    Ppd_Display_Name : UTF8_String;
    Width            : Gdouble;
    Height           : Gdouble) return Gtk_Paper_Size

Creates a new Gtk.Paper_Size.Gtk_Paper_Size object by using PPD information. If Ppd_Name is not a recognized PPD paper name, Ppd_Display_Name, Width and Height are used to construct a custom Gtk.Paper_Size.Gtk_Paper_Size object. Since: gtk+ 2.10

Parameters
Ppd_Name

a PPD paper name

Ppd_Display_Name

the corresponding human-readable name

Width

the paper width, in points

Height

the paper height in points

Return Value

Is_Custom

function Is_Custom (Widget : Gtk_Paper_Size) return Boolean

Returns True if Size is not a standard paper size.

Parameters
Widget
Return Value

whether Size is a custom paper size.

Is_Equal

function Is_Equal
   (Widget : Gtk_Paper_Size;
    Size2  : Gtk_Paper_Size) return Boolean

Compares two Gtk.Paper_Size.Gtk_Paper_Size objects. Since: gtk+ 2.10

Parameters
Widget
Size2

another Gtk.Paper_Size.Gtk_Paper_Size object

Return Value

True, if Size1 and Size2 represent the same paper size

Is_Ipp

function Is_Ipp (Widget : Gtk_Paper_Size) return Boolean

Returns True if Size is an IPP standard paper size.

Parameters
Widget
Return Value

whether Size is not an IPP custom paper size.

Null_Gtk_Paper_Size

Null_Gtk_Paper_Size : constant Gtk_Paper_Size;

Set_Size

procedure Set_Size
   (Widget : Gtk_Paper_Size;
    Width  : Gdouble;
    Height : Gdouble;
    Unit   : Gtk.Enums.Gtk_Unit)

Changes the dimensions of a Size to Width x Height. Since: gtk+ 2.10

Parameters
Widget
Width

the new width in units of Unit

Height

the new height in units of Unit

Unit

the unit for Width and Height

To_Gvariant

function To_Gvariant
   (Widget : Gtk_Paper_Size) return Glib.Variant.Gvariant

Serialize a paper size to an a{sv} variant. Since: gtk+ 3.22

Parameters
Widget
Return Value

a new, floating, Glib.Variant.Gvariant

To_Key_File

procedure To_Key_File
   (Widget     : Gtk_Paper_Size;
    Key_File   : Glib.Key_File.G_Key_File;
    Group_Name : UTF8_String)

This function adds the paper size from Size to Key_File. Since: gtk+ 2.12

Parameters
Widget
Key_File

the Gkey.File.Gkey_File to save the paper size to

Group_Name

the group to add the settings to in Key_File