## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --                    Copyright (C) 2010-2013, AdaCore               --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU General Public               --

8.     -- License as published by the Free Software Foundation; either      --

9.     -- version 2 of the License, or (at your option) any later version.  --

10.     --                                                                   --

11.     -- This library is distributed in the hope that it will be useful,   --

12.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

13.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

14.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU General Public         --

17.     -- License along with this library; if not, write to the             --

18.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

19.     -- Boston, MA 02111-1307, USA.                                       --

20.     --                                                                   --

21.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  Gtk_Paper_Size handles paper sizes. It uses the standard called

31.     --  "PWG 5101.1-2002 PWG: Standard for Media Standardized Names" to name the

32.     --  paper sizes (and to get the data for the page sizes). In addition to

33.     --  standard paper sizes, Gtk_Paper_Size allows to construct custom paper

34.     --  sizes with arbitrary dimensions.

35.     --

36.     --  The Gtk_Paper_Size object stores not only the dimensions (width and height)

37.     --  of a paper size and its name, it also provides default print margins.

38.     --  </description>

39.     --  <c_version>2.16.6</c_version>

41.     with Ada.Unchecked_Conversion;

43.     with Glib.GlistTo API docTo specTo body;

44.     with Glib.Key_FileTo API docTo specTo body;

45.     with Gtk.EnumsTo API docTo specTo body;

47.     package Gtk.Paper_SizeTo API docTo specTo body is

49.        type Gtk_Paper_Size is new Glib.C_ProxyTo API docTo spec;

51.        function Convert is

52.          new Ada.Unchecked_Conversion (Gtk_Paper_SizeTo API docTo spec, System.Address);

53.        function Convert is

54.          new Ada.Unchecked_Conversion (System.Address, Gtk_Paper_SizeTo API docTo spec);

55.        package Gtk_Paper_Size_Glist is

56.          new Glib.Glist.Generic_ListTo API docTo specTo body (Gtk_Paper_SizeTo API docTo spec);

58.        function Get_TypeTo API docTo body return GTypeTo API docTo spec;

60.        procedure Gtk_NewTo API docTo body

61.          (Widget : out Gtk_Paper_SizeTo API docTo spec;

62.           Name   : String);

63.        --  Creates a new Gtk_Paper_Size object by parsing a PWG 5101.1-2002

64.        --  paper name.

65.        --

66.        --  If Name is "", the default paper size is returned; see Get_Default.

68.        procedure Gtk_New_CustomTo API docTo body

69.          (Widget       : out Gtk_Paper_SizeTo API docTo spec;

70.           Name         : String;

71.           Display_Name : String;

72.           Width        : GdoubleTo API docTo spec;

73.           Height       : GdoubleTo API docTo spec;

74.           UnitTo API docTo body         : Gtk.Enums.Gtk_UnitTo API docTo spec);

75.        --  Creates a new Gtk_Paper_Size object with the given parameters:

76.        --

77.        --  Name:         the paper name

78.        --  Display_Name: the human-readable name

79.        --  Width:        the paper width, in units of Unit

80.        --  Height:       the paper height, in units of Unit

81.        --  Unit:         the unit for Width and Height

83.        procedure Gtk_New_From_Key_FileTo API docTo body

84.          (Widget     : out Gtk_Paper_SizeTo API docTo spec;

85.           Key_File   : Glib.Key_File.G_Key_FileTo API docTo spec;

86.           Group_Name : String := "");

87.        --  Reads a paper size from the group Group_Name in the key file

88.        --  Key_File.  Will set Widget to null in case of error.

90.        procedure Gtk_New_From_PpdTo API docTo body

91.          (Widget           : out Gtk_Paper_SizeTo API docTo spec;

92.           Ppd_Name         : String;

93.           Ppd_Display_Name : String := "";

94.           Width            : GdoubleTo API docTo spec;

95.           Height           : GdoubleTo API docTo spec);

96.        --  Creates a new Gtk_Paper_Size object by using PPD information:

97.        --

98.        --  Ppd_Name:         a PPD paper name

99.        --  Ppd_Display_Name: the corresponding human-readable name

100.        --  Width:            the paper width, in points

101.        --  Height:           the paper height in points

102.        --

103.        --  If Ppd_Name is not a recognized PPD paper name,

104.        --  Ppd_Display_Name, Width and Height are used to

105.        --  construct a custom Gtk_Paper_Size object.

107.        procedure To_Key_FileTo API docTo body

108.          (Size       : Gtk_Paper_SizeTo API docTo spec;

109.           Key_File   : Glib.Key_File.G_Key_FileTo API docTo spec;

110.           Group_Name : String := "");

111.        --  This function adds the paper size from Size to Key_File,

112.        --  within the group Group_Name.

114.        function CopyTo API docTo body (Other : Gtk_Paper_SizeTo API docTo spec) return Gtk_Paper_SizeTo API docTo spec;

115.        --  Copies an existing Gtk_Paper_Size.

117.        procedure FreeTo API docTo body (Size : Gtk_Paper_SizeTo API docTo spec);

118.        --  Free the given Gtk_Paper_Size object.

120.        function Get_DefaultTo API docTo body return String;

121.        --  Returns the name of the default paper size, which

122.        --  depends on the current locale.

124.        function Get_NameTo API docTo body (Size : Gtk_Paper_SizeTo API docTo spec) return String;

125.        --  Gets the name of the Gtk_Paper_Size.

127.        function Get_Display_NameTo API docTo body

128.          (Size : Gtk_Paper_SizeTo API docTo spec) return String;

129.        --  Gets the human-readable name of the Gtk_Paper_Size.

131.        function Get_Ppd_NameTo API docTo body (Size : Gtk_Paper_SizeTo API docTo spec) return String;

132.        --  Gets the PPD name of the Gtk_Paper_Size.

134.        function Is_CustomTo API docTo body (Size : Gtk_Paper_SizeTo API docTo spec) return Boolean;

135.        --  Returns True if Size is not a standard paper size.

137.        -----------

138.        -- Sizes --

139.        -----------

141.        function Get_WidthTo API docTo body

142.          (Size : Gtk_Paper_SizeTo API docTo spec;

143.           Unit : Gtk.Enums.Gtk_UnitTo API docTo spec)

144.           return GdoubleTo API docTo spec;

145.        function Get_HeightTo API docTo body

146.          (Size : Gtk_Paper_SizeTo API docTo spec;

147.           Unit : Gtk.Enums.Gtk_UnitTo API docTo spec)

148.           return GdoubleTo API docTo spec;

149.        --  Gets the paper width/height of the Gtk_Paper_Size, in units of Unit.

151.        procedure Set_SizeTo API docTo body

152.          (Size   : Gtk_Paper_SizeTo API docTo spec;

153.           Width  : GdoubleTo API docTo spec;

154.           Height : GdoubleTo API docTo spec;

155.           Unit   : Gtk.Enums.Gtk_UnitTo API docTo spec);

156.        --  Changes the dimensions of a Size to Width x Height.

158.        function Get_Paper_SizesTo API docTo body

159.          (Include_Custom : Boolean)

160.           return Gtk_Paper_Size_Glist.GlistTo API docTo specTo body;

161.        --  Creates a list of known paper sizes.  The caller must specify whether

162.        --  to include custom paper sizes as defined in the page setup dialog

164.        function "="To API docTo body (Size1, Size2 : Gtk_Paper_SizeTo API docTo spec) return Boolean;

165.        --  Compares two Gtk_Paper_Size objects.

167.        -------------

168.        -- Margins --

169.        -------------

171.        function Get_Default_Bottom_MarginTo API docTo body

172.          (Size : Gtk_Paper_SizeTo API docTo spec;

173.           Unit : Gtk.Enums.Gtk_UnitTo API docTo spec)

174.           return GdoubleTo API docTo spec;

175.        function Get_Default_Left_MarginTo API docTo body

176.          (Size : Gtk_Paper_SizeTo API docTo spec;

177.           Unit : Gtk.Enums.Gtk_UnitTo API docTo spec)

178.           return GdoubleTo API docTo spec;

179.        function Get_Default_Right_MarginTo API docTo body

180.          (Size : Gtk_Paper_SizeTo API docTo spec;

181.           Unit : Gtk.Enums.Gtk_UnitTo API docTo spec)

182.           return GdoubleTo API docTo spec;

183.        function Get_Default_Top_MarginTo API docTo body

184.          (Size : Gtk_Paper_SizeTo API docTo spec;

185.           Unit : Gtk.Enums.Gtk_UnitTo API docTo spec)

186.           return GdoubleTo API docTo spec;

187.        --  Gets the default bottom/left/right/top margin for the Gtk_Paper_Size,

188.        --  using the units specified by Unit.

190.        --  Common names, from PWG 5101.1-2002 PWG: Standard for Media Standardized

191.        --  Names

192.        Gtk_Paper_Name_A3        : constant String := "iso_a3";

193.        Gtk_Paper_Name_A4        : constant String := "iso_a4";

194.        Gtk_Paper_Name_A5        : constant String := "iso_a5";

195.        Gtk_Paper_Name_B5        : constant String := "iso_b5";

196.        Gtk_Paper_Name_Letter    : constant String := "na_letter";

197.        Gtk_Paper_Name_Executive : constant String := "na_executive";

198.        Gtk_Paper_Name_Legal     : constant String := "na_legal";

200.     private

202.        type Gtk_Paper_Size_Record is

203.          new Glib.Object.GObject_RecordTo API docTo specTo body with null record;

205.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_paper_size_get_type");

206.        pragma Import (C, CopyTo API docTo spec, "gtk_paper_size_copy");

207.        pragma Import (C, FreeTo API docTo spec, "gtk_paper_size_free");

208.        pragma Import (C, Get_Default_Bottom_MarginTo API docTo spec,

209.                       "gtk_paper_size_get_default_bottom_margin");

210.        pragma Import (C, Get_Default_Left_MarginTo API docTo spec,

211.                       "gtk_paper_size_get_default_left_margin");

212.        pragma Import (C, Get_Default_Right_MarginTo API docTo spec,

213.                       "gtk_paper_size_get_default_right_margin");

214.        pragma Import (C, Get_Default_Top_MarginTo API docTo spec,

215.                       "gtk_paper_size_get_default_top_margin");

216.        pragma Import (C, Get_HeightTo API docTo spec, "gtk_paper_size_get_height");

217.        pragma Import (C, Get_WidthTo API docTo spec, "gtk_paper_size_get_width");

218.        pragma Import (C, Set_SizeTo API docTo spec, "gtk_paper_size_set_size");

220.     end Gtk.Paper_SizeTo API docTo specTo body;