## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --

5.     --                Copyright (C) 2000-2011, AdaCore                   --

6.     --                                                                   --

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

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

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

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

11.     --                                                                   --

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

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

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

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

16.     --                                                                   --

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

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

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

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

21.     --                                                                   --

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

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

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

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

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

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

28.     -----------------------------------------------------------------------

30.     --  <description>

31.     --  This widget provides a nice way for the user of your application to select

32.     --  fonts. It first searches on your system for the list of fonts available,

33.     --  and displays a set of boxes to select them based on their name, their

34.     --  weight, their size, etc. This widget is provided in two forms, one widget

35.     --  that can be embedded in any container, a Gtk_Font_Selection, whereas the

36.     --  other one comes directly in its own separate window (to be popped up as a

37.     --  dialog).

38.     --

39.     --  Some filters can be applied to the widget, when you want the user to

40.     --  select only a font only among a specific subset (like bitmap or true-type

41.     --  fonts for instance). There are two kinds of filters: a base filter, set in

42.     --  your application and that the user can not change; a user filter that can

43.     --  be modified interactively by the user.

44.     --

45.     --  </description>

46.     --  <screenshot>gtk-fontsel</screenshot>

47.     --  <group>Selectors</group>

48.     --  <testgtk>create_font_selection.adb</testgtk>

50.     pragma Warnings (Off, "*is already use-visible*");

51.     with GdkTo API docTo spec;             use GdkTo API docTo spec;

52.     with Gdk.FontTo API docTo specTo body;        use Gdk.FontTo API docTo specTo body;

53.     with GlibTo API docTo specTo body;            use GlibTo API docTo specTo body;

54.     with Glib.PropertiesTo API docTo specTo body; use Glib.PropertiesTo API docTo specTo body;

55.     with Glib.TypesTo API docTo specTo body;      use Glib.TypesTo API docTo specTo body;

56.     with Gtk.BoxTo API docTo specTo body;         use Gtk.BoxTo API docTo specTo body;

57.     with Gtk.BuildableTo API docTo specTo body;   use Gtk.BuildableTo API docTo specTo body;

58.     with Gtk.EnumsTo API docTo specTo body;       use Gtk.EnumsTo API docTo specTo body;

59.     with Gtk.OrientableTo API docTo specTo body;  use Gtk.OrientableTo API docTo specTo body;

60.     with Gtk.WidgetTo API docTo specTo body;      use Gtk.WidgetTo API docTo specTo body;

62.     package Gtk.Font_SelectionTo API docTo specTo body is

64.        type Gtk_Font_Selection_Record is new Gtk_Vbox_RecordTo API docTo spec with null record;

65.        type Gtk_Font_Selection is access all Gtk_Font_Selection_RecordTo API docTo spec'Class;

67.        ------------------

68.        -- Constructors --

69.        ------------------

71.        procedure Gtk_NewTo API docTo body (Fontsel : out Gtk_Font_SelectionTo API docTo spec);

72.        procedure InitializeTo API docTo body (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec'Class);

73.        --  Creates a new Gtk.Font_Selection.Gtk_Font_Selection.

75.        function Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

76.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_font_selection_get_type");

78.        -------------

79.        -- Methods --

80.        -------------

82.        function Get_Face_ListTo API docTo body

83.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec)

84.            return Gtk.Widget.Gtk_WidgetTo API docTo spec;

85.        --  This returns the Gtk.Treeview.Gtk_Treeview which lists all styles

86.        --  available for the selected font. For example, 'Regular', 'Bold', etc.

87.        --  Since: gtk+ 2.14

89.        function Get_Family_ListTo API docTo body

90.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec)

91.            return Gtk.Widget.Gtk_WidgetTo API docTo spec;

92.        --  This returns the Gtk.Treeview.Gtk_Treeview that lists font families,

93.        --  for example, 'Sans', 'Serif', etc.

94.        --  Since: gtk+ 2.14

96.        function Get_FontTo API docTo body

97.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec) return Gdk.Font.Gdk_FontTo API docTo spec;

98.        pragma Obsolescent (Get_FontTo API docTo specTo body);

99.        --  Gets the currently-selected font.

100.        --  Deprecated since 2.0, Use Gtk.Font_Selection.Get_Font_Name instead.

102.        function Get_Font_NameTo API docTo body

103.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec) return UTF8_StringTo API docTo spec;

104.        function Set_Font_NameTo API docTo body

105.           (Fontsel  : access Gtk_Font_Selection_RecordTo API docTo spec;

106.            Fontname : UTF8_StringTo API docTo spec) return Boolean;

107.        --  Sets the currently-selected font. Note that the Fontsel needs to know

108.        --  the screen in which it will appear for this to work; this can be

109.        --  guaranteed by simply making sure that the such font exists or if the

110.        --  Fontsel doesn't belong to a particular screen yet.

111.        --  "fontname": a font name like "Helvetica 12" or "Times Bold 18"

113.        function Get_Preview_EntryTo API docTo body

114.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec)

115.            return Gtk.Widget.Gtk_WidgetTo API docTo spec;

116.        --  This returns the Gtk.GEntry.Gtk_Entry used to display the font as a

117.        --  preview.

118.        --  Since: gtk+ 2.14

120.        function Get_Preview_TextTo API docTo body

121.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec) return UTF8_StringTo API docTo spec;

122.        procedure Set_Preview_TextTo API docTo body

123.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec;

124.            Text    : UTF8_StringTo API docTo spec);

125.        --  Sets the text displayed in the preview area. The Text is used to show

126.        --  how the selected font looks.

127.        --  "text": the text to display in the preview area

129.        function Get_SizeTo API docTo body

130.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec) return GintTo API docTo spec;

131.        --  The selected font size. or -1 if no font size is selected.

132.        --  Since: gtk+ 2.14

134.        function Get_Size_EntryTo API docTo body

135.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec)

136.            return Gtk.Widget.Gtk_WidgetTo API docTo spec;

137.        --  This returns the Gtk.GEntry.Gtk_Entry used to allow the user to edit

138.        --  the font number manually instead of selecting it from the list of font

139.        --  sizes.

140.        --  Since: gtk+ 2.14

142.        function Get_Size_ListTo API docTo body

143.           (Fontsel : access Gtk_Font_Selection_RecordTo API docTo spec)

144.            return Gtk.Widget.Gtk_WidgetTo API docTo spec;

145.        --  This returns the GtkTreeeView used to list font sizes.

146.        --  Since: gtk+ 2.14

148.        ---------------------

149.        -- Interfaces_Impl --

150.        ---------------------

152.        function Get_OrientationTo API docTo body

153.           (Self : access Gtk_Font_Selection_RecordTo API docTo spec)

154.            return Gtk.Enums.Gtk_OrientationTo API docTo spec;

155.        procedure Set_OrientationTo API docTo body

156.           (Self        : access Gtk_Font_Selection_RecordTo API docTo spec;

157.            OrientationTo API docTo body : Gtk.Enums.Gtk_OrientationTo API docTo spec);

159.        ----------------

160.        -- Interfaces --

161.        ----------------

162.        --  This class implements several interfaces. See Glib.Types

163.        --

164.        --  - "Buildable"

165.        --

166.        --  - "Orientable"

168.        package Implements_Buildable is new Glib.Types.ImplementsTo API docTo specTo body

169.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Font_Selection_RecordTo API docTo spec, Gtk_Font_SelectionTo API docTo spec);

170.        function "+"

171.          (Widget : access Gtk_Font_Selection_RecordTo API docTo spec'Class)

172.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

173.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

174.        function "-"

175.          (Interf : Gtk.Buildable.Gtk_BuildableTo API docTo spec)

176.        return Gtk_Font_SelectionTo API docTo spec

177.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

179.        package Implements_Orientable is new Glib.Types.ImplementsTo API docTo specTo body

180.          (Gtk.Orientable.Gtk_OrientableTo API docTo spec, Gtk_Font_Selection_RecordTo API docTo spec, Gtk_Font_SelectionTo API docTo spec);

181.        function "+"

182.          (Widget : access Gtk_Font_Selection_RecordTo API docTo spec'Class)

183.        return Gtk.Orientable.Gtk_OrientableTo API docTo spec

184.        renames Implements_Orientable.To_InterfaceTo API docTo specTo body;

185.        function "-"

186.          (Interf : Gtk.Orientable.Gtk_OrientableTo API docTo spec)

187.        return Gtk_Font_SelectionTo API docTo spec

188.        renames Implements_Orientable.To_ObjectTo API docTo specTo body;

190.        ----------------

191.        -- Properties --

192.        ----------------

193.        --  The following properties are defined for this widget. See

194.        --  Glib.Properties for more information on properties)

195.        --

196.        --  Name: Font_Property

197.        --  Type: Gdk.Font

198.        --  Flags: read-write

199.        --

200.        --  Name: Font_Name_Property

201.        --  Type: UTF8_String

202.        --  Flags: read-write

203.        --

204.        --  Name: Preview_Text_Property

205.        --  Type: UTF8_String

206.        --  Flags: read-write

208.        Font_Property : constant Glib.Properties.Property_BoxedTo API docTo spec;

209.        Font_Name_Property : constant Glib.Properties.Property_StringTo API docTo spec;

210.        Preview_Text_Property : constant Glib.Properties.Property_StringTo API docTo spec;

212.     private

213.        Font_PropertyTo API docTo spec : constant Glib.Properties.Property_BoxedTo API docTo spec :=

214.          Glib.Properties.BuildTo API docTo specTo body ("font");

215.        Font_Name_PropertyTo API docTo spec : constant Glib.Properties.Property_StringTo API docTo spec :=

216.          Glib.Properties.BuildTo API docTo specTo body ("font-name");

217.        Preview_Text_PropertyTo API docTo spec : constant Glib.Properties.Property_StringTo API docTo spec :=

218.          Glib.Properties.BuildTo API docTo specTo body ("preview-text");

219.     end Gtk.Font_SelectionTo API docTo specTo body;