## 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-2013, 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.     --  An accel group represents a group of keyboard accelerators, generally

32.     --  attached to a toplevel window. Accelerators are different from mnemonics.

33.     --  Accelerators are shortcuts for activating a menu item. They appear

34.     --  alongside the menu item they are a shortcut for. Mnemonics are shortcuts

35.     --  for GUI elements, such as buttons. They appear as underline characters.

36.     --  Menu items can have both.

37.     --

38.     --  </description>

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

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

42.     with Gdk.TypesTo API docTo spec;       use Gdk.TypesTo API docTo spec;

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

44.     with Glib.ObjectTo API docTo specTo body;     use Glib.ObjectTo API docTo specTo body;

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

47.     package Gtk.Accel_GroupTo API docTo specTo body is

49.        type Gtk_Accel_Group_Record is new GObject_RecordTo API docTo specTo body with null record;

50.        type Gtk_Accel_Group is access all Gtk_Accel_Group_RecordTo API docTo spec'Class;

52.        type Gtk_Accel_Flags is new GuintTo API docTo spec;

53.        Accel_Visible : constant Gtk_Accel_FlagsTo API docTo spec := 2 ** 0;

54.        Accel_Locked  : constant Gtk_Accel_FlagsTo API docTo spec := 2 ** 1;

55.        Accel_Mask    : constant Gtk_Accel_FlagsTo API docTo spec := 16#07#;

57.        type Gtk_Accel_Key is record

58.           Accel_Key  : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

59.           Accel_Mods : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec;

60.           Flags      : Gtk_Accel_FlagsTo API docTo spec;

61.        end record;

62.        pragma Convention (C, Gtk_Accel_KeyTo API docTo spec);

64.        type Gtk_Accel_Group_Activate is access function

65.          (Accel_Group   : access Gtk_Accel_Group_RecordTo API docTo spec'Class;

66.           Acceleratable : Glib.Object.GObjectTo API docTo spec;

67.           Keyval        : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

68.           Modifier      : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return Boolean;

70.        type C_Gtk_Accel_Group_Activate is access function

71.          (Accel_Group   : System.Address;

72.           Acceleratable : System.Address;

73.           Keyval        : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

74.           Modifier      : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return Boolean;

75.        pragma Convention (C, C_Gtk_Accel_Group_ActivateTo API docTo spec);

76.        --  Same as Gtk_Accel_Group_Activate, but passing directly the C values.

77.        --  You must use Get_User_Data to convert to the Ada types.

79.        type C_Gtk_Accel_Group_Find_Func is access function

80.          (Key           : access Gtk_Accel_KeyTo API docTo spec;

81.           Closure       : C_Gtk_Accel_Group_ActivateTo API docTo spec;

82.           Data          : System.Address) return Boolean;

83.        pragma Convention (C, C_Gtk_Accel_Group_Find_FuncTo API docTo spec);

84.        --  When a match is found, must return True.

85.        --  Must not modify Key

87.        ------------------

88.        -- Constructors --

89.        ------------------

91.        procedure Gtk_NewTo API docTo body (Accel_Group : out Gtk_Accel_GroupTo API docTo spec);

92.        procedure InitializeTo API docTo body (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec'Class);

93.        --  Creates a new Gtk.Accel_Group.Gtk_Accel_Group. Remember to call

94.        --  Gtk.Window.Add_Accel_Group to active the group.

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

97.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_accel_group_get_type");

99.        -------------

100.        -- Methods --

101.        -------------

103.        function ActivateTo API docTo body

104.           (Accel_Group   : access Gtk_Accel_Group_RecordTo API docTo spec;

105.            Accel_Quark   : GQuarkTo API docTo spec;

106.            Acceleratable : access Glib.Object.GObject_RecordTo API docTo specTo body'Class;

107.            Accel_Key     : GuintTo API docTo spec;

108.            Accel_Mods    : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return Boolean;

109.        --  Finds the first accelerator in Accel_Group that matches Accel_Key and

110.        --  Accel_Mods, and activates it.

111.        --  "accel_quark": the quark for the accelerator name

112.        --  "acceleratable": the GObject, usually a Gtk.Window.Gtk_Window, on which

113.        --  to activate the accelerator.

114.        --  "accel_key": accelerator keyval from a key event

115.        --  "accel_mods": keyboard state mask from a key event

117.        procedure ConnectTo API docTo body

118.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec;

119.            Accel_Key   : GuintTo API docTo spec;

120.            Accel_Mods  : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec;

121.            Accel_Flags : Gtk_Accel_FlagsTo API docTo spec;

122.            Closure     : C_Gtk_Accel_Group_ActivateTo API docTo spec);

123.        --  Installs an accelerator in this group. When Accel_Group is being

124.        --  activated in response to a call to

125.        --  Gtk.Accel_Group.Accel_Groups_Activate, Closure will be invoked if the

126.        --  Accel_Key and Accel_Mods from Gtk.Accel_Group.Accel_Groups_Activate

127.        --  match those of this connection. The signature used for the Closure is

128.        --  that of GtkAccelGroupActivate. Note that, due to implementation details,

129.        --  a single closure can only be connected to one accelerator group.

130.        --  "accel_key": key value of the accelerator

131.        --  "accel_mods": modifier combination of the accelerator

132.        --  "accel_flags": a flag mask to configure this accelerator

133.        --  "closure": closure to be executed upon accelerator activation

135.        procedure Connect_By_PathTo API docTo body

136.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec;

137.            Accel_Path  : UTF8_StringTo API docTo spec;

138.            Closure     : C_Gtk_Accel_Group_ActivateTo API docTo spec);

139.        --  Installs an accelerator in this group, using an accelerator path to

140.        --  look up the appropriate key and modifiers (see Gtk.Accel_Map.Add_Entry).

141.        --  When Accel_Group is being activated in response to a call to

142.        --  Gtk.Accel_Group.Accel_Groups_Activate, Closure will be invoked if the

143.        --  Accel_Key and for the path. The signature used for the Closure is that

144.        --  of GtkAccelGroupActivate. Note that Accel_Path string will be stored in

145.        --  a GQuark. Therefore, if you pass a static string, you can save some

146.        --  memory by interning it first with g_intern_static_string.

147.        --  "accel_path": path used for determining key and modifiers.

148.        --  "closure": closure to be executed upon accelerator activation

150.        function DisconnectTo API docTo body

151.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec;

152.            Closure     : C_Gtk_Accel_Group_ActivateTo API docTo spec) return Boolean;

153.        --  Removes an accelerator previously installed through

154.        --  Gtk.Accel_Group.Connect. Since 2.20 Closure can be null.

155.        --  "closure": the closure to remove from this accelerator group, or null

156.        --  to remove all closures

158.        function Disconnect_KeyTo API docTo body

159.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec;

160.            Accel_Key   : GuintTo API docTo spec;

161.            Accel_Mods  : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return Boolean;

162.        --  Removes an accelerator previously installed through

163.        --  Gtk.Accel_Group.Connect.

164.        --  "accel_key": key value of the accelerator

165.        --  "accel_mods": modifier combination of the accelerator

167.        function FindTo API docTo body

168.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec;

169.            Find_Func   : C_Gtk_Accel_Group_Find_FuncTo API docTo spec;

170.            Data        : System.Address) return Gtk_Accel_KeyTo API docTo spec;

171.        --  Finds the first entry in an accelerator group for which

172.        --  "find_func": a function to filter the entries of Accel_Group with

173.        --  "data": data to pass to Find_Func

175.        function Get_Is_LockedTo API docTo body

176.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec) return Boolean;

177.        --  Locks are added and removed using Gtk.Accel_Group.Lock and

178.        --  Gtk.Accel_Group.Unlock. False otherwise.

179.        --  Since: gtk+ 2.14

181.        function Get_Modifier_MaskTo API docTo body

182.           (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec)

183.            return Gdk.Types.Gdk_Modifier_TypeTo API docTo spec;

184.        --  Gets a Gdk.Types.Gdk_Modifier_Type representing the mask for this

185.        --  Since: gtk+ 2.14

187.        procedure LockTo API docTo body (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec);

188.        --  Locks the given accelerator group. Locking an acelerator group prevents

189.        --  the accelerators contained within it to be changed during runtime. Refer

190.        --  to Gtk.Accel_Map.Change_Entry about runtime accelerator changes. If

191.        --  called more than once, Accel_Group remains locked until

192.        --  Gtk.Accel_Group.Unlock has been called an equivalent number of times.

194.        procedure UnlockTo API docTo body (Accel_Group : access Gtk_Accel_Group_RecordTo API docTo spec);

195.        --  Undoes the last call to Gtk.Accel_Group.Lock on this Accel_Group.

197.        ---------------

198.        -- Functions --

199.        ---------------

201.        function From_Accel_ClosureTo API docTo body

202.           (Closure : C_Gtk_Accel_Group_ActivateTo API docTo spec)

203.            return Gtk.Accel_Group.Gtk_Accel_GroupTo API docTo spec;

204.        --  Finds the Gtk.Accel_Group.Gtk_Accel_Group to which Closure is

205.        --  connected; see Gtk.Accel_Group.Connect.

206.        --  "closure": a GClosure

208.        function Accel_Groups_ActivateTo API docTo body

209.           (Object     : access Glib.Object.GObject_RecordTo API docTo specTo body'Class;

210.            Accel_Key  : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

211.            Accel_Mods : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return Boolean;

212.        --  Finds the first accelerator in any Gtk.Accel_Group.Gtk_Accel_Group

213.        --  attached to Object that matches Accel_Key and Accel_Mods, and activates

214.        --  that accelerator.

215.        --  "object": the GObject, usually a Gtk.Window.Gtk_Window, on which to

216.        --  activate the accelerator.

217.        --  "accel_key": accelerator keyval from a key event

218.        --  "accel_mods": keyboard state mask from a key event

220.        function From_ObjectTo API docTo body

221.           (Object : access Glib.Object.GObject_RecordTo API docTo specTo body'Class)

222.            return Glib.Object.Object_List.GSlistTo API docTo specTo body;

223.        --  Gets a list of all accel groups which are attached to Object.

224.        --  "object": a GObject, usually a Gtk.Window.Gtk_Window

226.        function Accelerator_ValidTo API docTo body

227.           (Keyval    : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

228.            Modifiers : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return Boolean;

229.        --  Determines whether a given keyval and modifier mask constitute a valid

230.        --  keyboard accelerator. For example, the GDK_a keyval plus

231.        --  GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator. But, you

232.        --  can't, for instance, use the GDK_Control_L keyval as an accelerator.

233.        --  "keyval": a GDK keyval

234.        --  "modifiers": modifier mask

236.        procedure Accelerator_ParseTo API docTo body

237.           (Accelerator      : UTF8_StringTo API docTo spec;

238.            Accelerator_Key  : out Gdk.Types.Gdk_Key_TypeTo API docTo spec;

239.            Accelerator_Mods : out Gdk.Types.Gdk_Modifier_TypeTo API docTo spec);

240.        --  Parses a string representing an accelerator. The format looks like

241.        --  "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or "&lt;Release&gt;z"

242.        --  (the last one is for key release). The parser is fairly liberal and

243.        --  allows lower or upper case, and also abbreviations such as "&lt;Ctl&gt;"

244.        --  and "&lt;Ctrl&gt;". Key names are parsed using gdk_keyval_from_name. For

245.        --  character keys the name is not the symbol, but the lowercase name, e.g.

246.        --  one would use "&lt;Ctrl&gt;minus" instead of "&lt;Ctrl&gt;-". If the

247.        --  parse fails, Accelerator_Key and Accelerator_Mods will be set to 0

248.        --  (zero).

249.        --  "accelerator": string representing an accelerator

250.        --  "accelerator_key": return location for accelerator keyval

251.        --  "accelerator_mods": return location for accelerator modifier mask

253.        function Accelerator_NameTo API docTo body

254.           (Accelerator_Key  : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

255.            Accelerator_Mods : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return UTF8_StringTo API docTo spec;

256.        --  Converts an accelerator keyval and modifier mask into a string

257.        --  parseable by Gtk.Accel_Group.Accelerator_Parse. For example, if you pass

258.        --  in GDK_q and GDK_CONTROL_MASK, this function returns "&lt;Control&gt;q".

259.        --  If you need to display accelerators in the user interface, see

260.        --  Gtk.Accel_Group.Accelerator_Get_Label.

261.        --  "accelerator_key": accelerator keyval

262.        --  "accelerator_mods": accelerator modifier mask

264.        function Accelerator_Get_LabelTo API docTo body

265.           (Accelerator_Key  : Gdk.Types.Gdk_Key_TypeTo API docTo spec;

266.            Accelerator_Mods : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec) return UTF8_StringTo API docTo spec;

267.        --  Converts an accelerator keyval and modifier mask into a string which

268.        --  can be used to represent the accelerator to the user.

269.        --  Since: gtk+ 2.6

270.        --  "accelerator_key": accelerator keyval

271.        --  "accelerator_mods": accelerator modifier mask

273.        procedure Set_Default_Mod_MaskTo API docTo body

274.           (Default_Mod_Mask : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec);

275.        function Get_Default_Mod_MaskTo API docTo body return Gdk.Types.Gdk_Modifier_TypeTo API docTo spec;

276.        --  Gets the value set by Gtk.Accel_Group.Set_Default_Mod_Mask.

278.        ----------------

279.        -- Properties --

280.        ----------------

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

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

283.        --

284.        --  Name: Is_Locked_Property

285.        --  Type: Boolean

286.        --  Flags: read-write

287.        --

288.        --  Name: Modifier_Mask_Property

289.        --  Type: Gdk.ModifierType

290.        --  Flags: read-write

292.        Is_Locked_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

293.        Modifier_Mask_Property : constant Glib.Properties.Property_BoxedTo API docTo spec;

295.        -------------

296.        -- Signals --

297.        -------------

298.        --  The following new signals are defined for this widget:

299.        --

300.        --  "accel-activate"

301.        --     function Handler

302.        --       (Self          : access Gtk_Accel_Group_Record'Class;

303.        --        Acceleratable : Glib.Object.GObject;

304.        --        Keyval        : Guint;

305.        --        Modifier      : Gdk.ModifierType) return Boolean;

306.        --    --  "acceleratable": the object on which the accelerator was activated

307.        --    --  "keyval": the accelerator keyval

308.        --    --  "modifier": the modifier combination of the accelerator

309.        --  The accel-activate signal is an implementation detail of

310.        --  Gtk.Accel_Group.Gtk_Accel_Group and not meant to be used by

311.        --  applications.

312.        --  Returns True if the accelerator was activated

313.        --

314.        --  "accel-changed"

315.        --     procedure Handler

316.        --       (Self          : access Gtk_Accel_Group_Record'Class;

317.        --        Keyval        : Guint;

318.        --        Modifier      : Gdk.ModifierType;

319.        --        Accel_Closure : System.Address);

320.        --    --  "keyval": the accelerator keyval

321.        --    --  "modifier": the modifier combination of the accelerator

322.        --    --  "accel_closure": the GClosure of the accelerator

323.        --  The accel-changed signal is emitted when a GtkAccelGroupEntry is added

324.        --  to or removed from the accel group. Widgets like

325.        --  Gtk.Accellabel.Gtk_Accellabel which display an associated accelerator

326.        --  should connect to this signal, and rebuild their visual representation

327.        --  if the Accel_Closure is theirs.

329.        Signal_Accel_Activate : constant Glib.Signal_NameTo API docTo spec := "accel-activate";

330.        Signal_Accel_Changed : constant Glib.Signal_NameTo API docTo spec := "accel-changed";

332.     private

333.        Is_Locked_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

334.          Glib.Properties.BuildTo API docTo specTo body ("is-locked");

335.        Modifier_Mask_PropertyTo API docTo spec : constant Glib.Properties.Property_BoxedTo API docTo spec :=

336.          Glib.Properties.BuildTo API docTo specTo body ("modifier-mask");

337.     end Gtk.Accel_GroupTo API docTo specTo body;