Index

Package: Paper_Size

Description

package Gtk.Paper_Size is

Gtk_Paper_Size 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, Gtk_Paper_Size allows to construct custom paper sizes with arbitrary dimensions.

The 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.

Binding from C File version 2.16.6

Packages

Gtk_Paper_Size_Glist (new Glib.Glist.Generic_List)

package Gtk_Paper_Size_Glist is
     new Glib.Glist.Generic_List (Gtk_Paper_Size);

Types

Gtk_Paper_Size

type Gtk_Paper_Size is new Glib.C_Proxy;

Constants & Global variables

Gtk_Paper_Name_A3 (String)

Gtk_Paper_Name_A3        : constant String := "iso_a3";
Common names, from PWG 5101.1-2002 PWG: Standard for Media Standardized Names

Gtk_Paper_Name_A4 (String)

Gtk_Paper_Name_A4        : constant String := "iso_a4";

Gtk_Paper_Name_A5 (String)

Gtk_Paper_Name_A5        : constant String := "iso_a5";

Gtk_Paper_Name_B5 (String)

Gtk_Paper_Name_B5        : constant String := "iso_b5";

Gtk_Paper_Name_Letter (String)

Gtk_Paper_Name_Letter    : constant String := "na_letter";

Gtk_Paper_Name_Executive (String)

Gtk_Paper_Name_Executive : constant String := "na_executive";

Gtk_Paper_Name_Legal (String)

Gtk_Paper_Name_Legal     : constant String := "na_legal";

Subprograms & Entries

Convert

function Convert is new Ada.Unchecked_Conversion 
(Gtk_Paper_Size, System.Address);

Convert

function Convert is new Ada.Unchecked_Conversion 
(System.Address, Gtk_Paper_Size);

Get_Type

function Get_Type return GType;

Gtk_New

procedure Gtk_New 
(Widget: out Gtk_Paper_Size;
Name: String);
Creates a new Gtk_Paper_Size object by parsing a PWG 5101.1-2002 paper name. If Name is "", the default paper size is returned; see Get_Default.

Gtk_New_Custom

procedure Gtk_New_Custom 
(Widget: out Gtk_Paper_Size;
Name: String;
Display_Name: String;
Width: Gdouble;
Height: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Creates a new Gtk_Paper_Size object with the given 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

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: String := "");
Reads a paper size from the group Group_Name in the key file Key_File. Will set Widget to null in case of error.

Gtk_New_From_Ppd

procedure Gtk_New_From_Ppd 
(Widget: out Gtk_Paper_Size;
Ppd_Name: String;
Ppd_Display_Name: String := "";
Width: Gdouble;
Height: Gdouble);
Creates a new Gtk_Paper_Size object by using PPD information: 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 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 object.

To_Key_File

procedure To_Key_File 
(Size: Gtk_Paper_Size;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: String := "");
This function adds the paper size from Size to Key_File, within the group Group_Name.

Copy

function Copy 
(Other: Gtk_Paper_Size) return Gtk_Paper_Size;
Copies an existing Gtk_Paper_Size.

Free

procedure Free 
(Size: Gtk_Paper_Size);
Free the given Gtk_Paper_Size object.

Get_Default

function Get_Default return String;
Returns the name of the default paper size, which depends on the current locale.

Get_Name

function Get_Name 
(Size: Gtk_Paper_Size) return String;
Gets the name of the Gtk_Paper_Size.

Get_Display_Name

function Get_Display_Name 
(Size: Gtk_Paper_Size) return String;
Gets the human-readable name of the Gtk_Paper_Size.

Get_Ppd_Name

function Get_Ppd_Name 
(Size: Gtk_Paper_Size) return String;
Gets the PPD name of the Gtk_Paper_Size.

Is_Custom

function Is_Custom 
(Size: Gtk_Paper_Size) return Boolean;
Returns True if Size is not a standard paper size.

Get_Width

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

Get_Height

function Get_Height 
(Size: Gtk_Paper_Size;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Gets the paper width/height of the Gtk_Paper_Size, in units of Unit.

Set_Size

procedure Set_Size 
(Size: Gtk_Paper_Size;
Width: Gdouble;
Height: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Changes the dimensions of a Size to Width x Height.

Get_Paper_Sizes

function Get_Paper_Sizes 
(Include_Custom: Boolean) return Gtk_Paper_Size_Glist.Glist;
Creates a list of known paper sizes. The caller must specify whether to include custom paper sizes as defined in the page setup dialog

=

function "=" 
(Size1, Size2: Gtk_Paper_Size) return Boolean;
Compares two Gtk_Paper_Size objects.

Get_Default_Bottom_Margin

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

Get_Default_Left_Margin

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

Get_Default_Right_Margin

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

Get_Default_Top_Margin

function Get_Default_Top_Margin 
(Size: Gtk_Paper_Size;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;
Gets the default bottom/left/right/top margin for the Gtk_Paper_Size, using the units specified by Unit.