## 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-2009, 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.     --

32.     --  The aim of this package is to provide some services to connect a

33.     --  handler to a signal emitted by a Gtk Object. To understand the

34.     --  services provided by this package, some definitions are necessary:

35.     --

36.     --    Signal: A signal is a kind of message that an object wants to

37.     --    broadcast. All GObjects can emit signals. These messages are

38.     --    associated to certain events happening during the life of an

39.     --    object. For instance, when a user clicks on a button, the

40.     --    "clicked" signal is emitted by the button.

41.     --

42.     --    Handler (or callback): A handler is a function or procedure that

43.     --    the user "connects" to a signal for a particular object.

44.     --    Connecting a handler to a signal means associating this handler to

45.     --    the signal.  When the signal is emitted, all connected handlers

46.     --    are called back. Usually, the role of those callbacks is to do

47.     --    some processing triggered by a user action. For instance, when

48.     --    "clicked" signal is emitted by the "OK" button of a dialog, the

49.     --    connected handler can be used to close the dialog or recompute

50.     --    some value.

51.     --

52.     --    In GtkAda, the handlers are defined in a form as general as

53.     --    possible. The first argument is always an access to the object it

54.     --    has been connected to. The second object is a table of values

55.     --    (See Glib.Values for more details about this table). It is the

56.     --    responsibility of this handler to extract the values from it, and

57.     --    to convert them to the correct Ada type.

58.     --

59.     --    Because such handlers are not very convenient to use, this package

60.     --    also provides some services to connect a marshaller instead. It

61.     --    will then do the extraction work before calling the more

62.     --    programmer-friendly handler, as defined in Gtk.Marshallers (see

63.     --    Gtk.Marshallers for more details).

64.     --

65.     --  The subdivision of this package is identical to Gtk.Marshallers; it

66.     --  is made of four generic sub-packages, each representing one of the

67.     --  four possible kinds of handlers: they can return a value or not, and

68.     --  they can have some user specific data associated to them or not.

69.     --  Selecting the right package depends on the profile of the handler.

70.     --  For example, the handler for the "delete_event" signal of a

71.     --  Gtk_Window has a return value, and has an extra parameter (a Gint).

72.     --  All handlers also have a user_data field by default, but its usage

73.     --  is optional. To connect a handler to this signal, if the user_data

74.     --  field is not used, the Return_Callback generic should be

75.     --  instantiated. On the other hand, if the user_data field is

76.     --  necessary, then the User_Return_Callback generic should be used.

77.     --

78.     --  Note also that the real handler in Gtk+ should expect at least as

79.     --  many arguments as in the marshaller you are using. If your

80.     --  marshaller has one argument, the C handler must have at least one

81.     --  argument too.

82.     --

83.     --  The common generic parameter to all sub-packages is the widget type,

84.     --  which is the basic widget manipulated. This can be

85.     --  Glib.Object.GObject_Record type if you want to reduce the number of

86.     --  instantiations, but the conversion to the original type will have to be

87.     --  done inside the handler.

88.     --

89.     --  All sub-packages are organized in the same way.

90.     --

91.     --    First, the type "Handler" is defined. It represents the general

92.     --    form of the callbacks supported by the sub-package.

93.     --

94.     --    The corresponding sub-package of Gtk.Marshallers is instantiated.

95.     --

96.     --    A series of "Connect" procedures and functions is given. All cases

97.     --    are covered: the functions return the Handler_Id of the newly

98.     --    created association, while the procedures just connect the

99.     --    handler, dropping the Handler_Id; some services allow the user to

100.     --    connect a Handler while some others allow the usage of

101.     --    Marshallers, which are more convenient. Note that more than one

102.     --    handler may be connected to a signal; the handlers will then be

103.     --    invoked in the order of connection.

104.     --

105.     --    Some "Connect_Object" services are also provided. Those services

106.     --    never have a user_data. They accept an additional parameter called

107.     --    Slot_Object. When the callback in invoked, the Gtk Object emitting

108.     --    the signal is substituted by this Slot_Object.

109.     --    These callbacks are always automatically disconnected as soon as one

110.     --    of the two widgets involved is destroyed.

111.     --

112.     --    There are several methods to connect a handler. For each method,

113.     --    although the option of connecting a Handler is provided, the

114.     --    recommended way is to use Marshallers. Each connect service is

115.     --    documented below, in the first sub-package.

116.     --

117.     --    A series of "To_Marshaller" functions are provided. They return

118.     --    some marshallers for the most commonly used types in order to ease

119.     --    the usage of this package. Most of the time, it will not be

120.     --    necessary to use some other marshallers.

121.     --    For instance, if a signal is documented as receiving a single argument,

122.     --    the widget (for instance the "clicked" signal for a Gtk_Button), you

123.     --    will connect to it with:

124.     --        with Gtkada.Handlers;

125.     --        procedure On_Clicked (Button : access Gtk_Widget_Record'Class);

126.     --        ...

127.     --           Widget_Callback.Connect (Button, "clicked", On_Clicked'Access);

128.     --

129.     --    The simple form above also applies for most handlers that take one

130.     --    additional argument, for instance the "button_press_event" in

131.     --    gtk-widget.ads. Just declare your subprogram with the appropriate profile

132.     --    and connect it, as in:

133.     --        with Gtkada.Handlers;

134.     --        procedure On_Button (Widget : access Gtk_Widget_Record'Class;

135.     --                             Event  : Gdk_Event);

136.     --        ...

137.     --           Widget_Callback.Connect (Widget, "button_press_event",

138.     --                                    On_Button'Access);

139.     --

140.     --    More complex forms of handlers exists however in GtkAda, for which no

141.     --    predefined marshaller exists. In this case, you have to use the general

142.     --    form of callbacks. For instance, the "select_row" signal of Gtk.Clist.

143.     --        with Gtkada.Handlers;

144.     --        with Gtk.Arguments;

145.     --        procedure On_Select (Clist : access Gtk_Widget_Record'Class;

146.     --                             Args  : Glib.Values.GValues)

147.     --        is

148.     --           Row : constant Gint := To_Gint (Args, 1);

149.     --           Column : constant Gint := To_Gint (Args, 2);

150.     --           Event  : constant Gdk_Event := To_Event (Args, 3);

151.     --        begin

152.     --           ...

153.     --        end On_Select;

154.     --        ...

155.     --            Widget_Callback.Connect (Clist, "select_row", On_Select'Access);

156.     --

157.     --    As for the "To_Marshaller" functions, a series of "Emit_By_Name"

158.     --    procedures are also provided for the same most common types, to

159.     --    allow the user to easily emit signals. These procedures are mainly

160.     --    intended for people building new GObjects.

161.     --

162.     --  At the end of this package, some general services related to the

163.     --  management of signals and handlers are also provided. Each one of

164.     --  them is documented individually below.

165.     --

166.     --  IMPORTANT NOTE: These packages must be instantiated at library-level

167.     --

168.     --  </description>

169.     --  <c_version>2.8.17</c_version>

170.     --  <group>Signal handling</group>

172.     with Glib.ValuesTo API docTo specTo body;

173.     with Gdk.EventTo API docTo specTo body;

174.     with Glib.ObjectTo API docTo specTo body;

175.     with Gtk.MarshallersTo API docTo specTo body;

176.     pragma Elaborate_All (Gtk.MarshallersTo API docTo specTo body);

178.     with Gtk.NotebookTo API docTo specTo body;

179.     with Gtk.Tree_ModelTo API docTo specTo body;

180.     with Gtk.WidgetTo API docTo specTo body;

182.     with Unchecked_Conversion;

184.     package Gtk.HandlersTo API docTo specTo body is

186.        --  <doc_ignore>

188.        pragma Elaborate_Body;

190.        type GClosure is new Glib.C_ProxyTo API docTo spec;

192.        Null_Handler_Id : constant GulongTo API docTo spec := 0;

194.        type Handler_Id is record

195.           Id      : GulongTo API docTo spec := Null_Handler_IdTo API docTo spec;

196.           Closure : GClosureTo API docTo spec;

197.        end record;

198.        --  This uniquely identifies a connection widget<->signal.

199.        --  Closure is an internal data, that you should not use.

201.        ---------------------------------------------------------

202.        --  These handlers should return a value

203.        --  They do not have a User_Data

204.        ---------------------------------------------------------

206.        generic

207.           type Widget_Type is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

208.           type Return_Type is (<>);

209.        package Return_CallbackTo API docTo body is

211.           type Handler is access function

212.             (Widget : access Widget_TypeTo API docTo spec'Class;

213.              Params : Glib.Values.GValuesTo API docTo specTo body) return Return_TypeTo API docTo spec;

215.           type Simple_Handler is access function

216.             (Widget : access Widget_TypeTo API docTo spec'Class) return Return_TypeTo API docTo spec;

218.           package Marshallers is new Gtk.Marshallers.Return_MarshallersTo API docTo specTo body

219.             (Widget_TypeTo API docTo spec, Return_TypeTo API docTo spec);

221.           --  Connecting a handler to an object

223.           --  In all the Connect services below, the following arguments

224.           --  will be used:

225.           --    o Widget, Name: This represents the association (Gtk Object,

226.           --      Glib.Signal_Name) to which the handler is to be connected.

227.           --    o After: If this boolean is set to True, then the handler

228.           --      will be connected after all the default handlers. By

229.           --      default, it is set to False.

231.           procedure ConnectTo API docTo body

232.             (Widget : access Widget_TypeTo API docTo spec'Class;

233.              Name   : Glib.Signal_NameTo API docTo spec;

234.              MarshTo API docTo body  : Marshallers.MarshallerTo API docTo spec;

235.              After  : Boolean := False);

236.           --  Connects a Marshaller. The Handler_Id is dropped.

238.           procedure Object_ConnectTo API docTo body

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

240.              Name        : Glib.Signal_NameTo API docTo spec;

241.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

242.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

243.              After       : Boolean := False);

244.           --  Connect a Marshaller. The Handler_Id is dropped.

245.           --  This is automatically disconnected as soon as either Widget or

246.           --  Slot_Object is destroyed.

247.           --  Slot_Object *must* be of type Gtk_Object or one of its children.

249.           procedure ConnectTo API docTo body

250.             (Widget : access Widget_TypeTo API docTo spec'Class;

251.              Name   : Glib.Signal_NameTo API docTo spec;

252.              Cb     : Simple_HandlerTo API docTo spec;

253.              After  : Boolean := False);

254.           procedure Object_ConnectTo API docTo body

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

256.              Name        : Glib.Signal_NameTo API docTo spec;

257.              Cb          : Simple_HandlerTo API docTo spec;

258.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

259.              After       : Boolean := False);

260.           --  Same as above, except with a simple handle with no parameter. This

261.           --  is the same as using a To_Marshaller call to the above two

262.           --  procedures, except it is shorter to write.

264.           procedure ConnectTo API docTo body

265.             (Widget : access Widget_TypeTo API docTo spec'Class;

266.              Name   : Glib.Signal_NameTo API docTo spec;

267.              Cb     : HandlerTo API docTo spec;

268.              After  : Boolean := False);

269.           procedure Object_ConnectTo API docTo body

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

271.              Name        : Glib.Signal_NameTo API docTo spec;

272.              Cb          : HandlerTo API docTo spec;

273.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

274.              After       : Boolean := False);

275.           --  Connect a Handler. The Handler_Id is dropped.

276.           --  This is automatically disconnected as soon as either Widget or

277.           --  Slot_Object is destroyed.

278.           --  Slot_Object *must* be of type Gtk_Object or one of its children.

280.           pragma Inline (ConnectTo API docTo specTo body);

281.           pragma Inline (Object_ConnectTo API docTo specTo body);

283.           function ConnectTo API docTo body

284.             (Widget : access Widget_TypeTo API docTo spec'Class;

285.              Name   : Glib.Signal_NameTo API docTo spec;

286.              MarshTo API docTo body  : Marshallers.MarshallerTo API docTo spec;

287.              After  : Boolean := False) return Handler_IdTo API docTo spec;

288.           --  Connects a Marshaller. Returns the Handler_Id.

290.           function Object_ConnectTo API docTo body

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

292.              Name        : Glib.Signal_NameTo API docTo spec;

293.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

294.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

295.              After       : Boolean := False) return Handler_IdTo API docTo spec;

296.           --  Connect a Marshaller. Return the Handler_Id.

297.           --  This is automatically disconnected as soon as either Widget or

298.           --  Slot_Object is destroyed.

299.           --  Slot_Object *must* be of type Gtk_Object or one of its children.

301.           function ConnectTo API docTo body

302.             (Widget : access Widget_TypeTo API docTo spec'Class;

303.              Name   : Glib.Signal_NameTo API docTo spec;

304.              Cb     : HandlerTo API docTo spec;

305.              After  : Boolean := False) return Handler_IdTo API docTo spec;

306.           --  Connects a Handler. Returns the Handler_Id.

308.           function Object_ConnectTo API docTo body

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

310.              Name        : Glib.Signal_NameTo API docTo spec;

311.              Cb          : HandlerTo API docTo spec;

312.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

313.              After       : Boolean := False) return Handler_IdTo API docTo spec;

314.           --  Connect a Handler. Returns the Handler_Id.

315.           --  This is automatically disconnected as soon as either Widget or

316.           --  Slot_Object is destroyed.

317.           --  Slot_Object *must* be of type Gtk_Object or one of its children.

319.           --  Some convenient functions to create marshallers

321.           package Gint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

322.             (GintTo API docTo spec, Glib.Values.Get_IntTo API docTo specTo body);

323.           package Guint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

324.             (GuintTo API docTo spec, Glib.Values.Get_UintTo API docTo specTo body);

325.           package Event_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

326.             (Gdk.Event.Gdk_EventTo API docTo spec, Gdk.Event.Get_EventTo API docTo specTo body);

327.           package Widget_Marshaller is new Marshallers.Generic_Widget_MarshallerTo API docTo specTo body

328.             (Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body, Gtk.Widget.Gtk_WidgetTo API docTo spec);

329.           package Notebook_Page_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

330.             (Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec, Gtk.Notebook.Get_Notebook_PageTo API docTo specTo body);

332.           function To_Marshaller

333.             (Cb : Gint_Marshaller.HandlerTo API docTo spec)

334.              return Marshallers.MarshallerTo API docTo spec renames Gint_Marshaller.To_MarshallerTo API docTo specTo body;

336.           function To_Marshaller

337.             (Cb : Guint_Marshaller.HandlerTo API docTo spec)

338.              return Marshallers.MarshallerTo API docTo spec renames Guint_Marshaller.To_MarshallerTo API docTo specTo body;

340.           function To_Marshaller

341.             (Cb : Event_Marshaller.HandlerTo API docTo spec)

342.              return Marshallers.MarshallerTo API docTo spec renames Event_Marshaller.To_MarshallerTo API docTo specTo body;

344.           function To_Marshaller

345.             (Cb : Widget_Marshaller.HandlerTo API docTo spec)

346.              return Marshallers.MarshallerTo API docTo spec renames Widget_Marshaller.To_MarshallerTo API docTo specTo body;

348.           function To_Marshaller

349.             (Cb : Marshallers.Void_Marshaller.HandlerTo API docTo spec)

350.              return Marshallers.MarshallerTo API docTo spec

351.              renames Marshallers.Void_Marshaller.To_MarshallerTo API docTo specTo body;

353.           function To_Marshaller

354.             (Cb : Notebook_Page_Marshaller.HandlerTo API docTo spec)

355.              return Marshallers.MarshallerTo API docTo spec

356.              renames Notebook_Page_Marshaller.To_MarshallerTo API docTo specTo body;

358.           --  Emitting a signal

360.           function Emit_By_Name

361.             (Object : access Widget_TypeTo API docTo spec'Class;

362.              Name   : Glib.Signal_NameTo API docTo spec;

363.              Param  : GintTo API docTo spec)

364.              return Return_TypeTo API docTo spec renames Gint_Marshaller.Emit_By_NameTo API docTo specTo body;

366.           function Emit_By_Name

367.             (Object : access Widget_TypeTo API docTo spec'Class;

368.              Name   : Glib.Signal_NameTo API docTo spec;

369.              Param  : GuintTo API docTo spec)

370.              return Return_TypeTo API docTo spec renames Guint_Marshaller.Emit_By_NameTo API docTo specTo body;

372.           function Emit_By_NameTo API docTo body

373.             (Object : access Widget_TypeTo API docTo spec'Class;

374.              Name   : Glib.Signal_NameTo API docTo spec;

375.              Param  : Gdk.Event.Gdk_EventTo API docTo spec) return Return_TypeTo API docTo spec;

377.           function Emit_By_Name

378.             (Object : access Widget_TypeTo API docTo spec'Class;

379.              Name   : Glib.Signal_NameTo API docTo spec;

380.              Param  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

381.              return Return_TypeTo API docTo spec renames Widget_Marshaller.Emit_By_NameTo API docTo specTo body;

383.           function Emit_By_Name

384.             (Object : access Widget_TypeTo API docTo spec'Class;

385.              Name   : Glib.Signal_NameTo API docTo spec)

386.              return Return_TypeTo API docTo spec renames Marshallers.Void_Marshaller.Emit_By_NameTo API docTo specTo body;

388.           function Emit_By_Name

389.             (Object : access Widget_TypeTo API docTo spec'Class;

390.              Name   : Glib.Signal_NameTo API docTo spec;

391.              Param  : Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec)

392.              return Return_TypeTo API docTo spec renames Notebook_Page_Marshaller.Emit_By_NameTo API docTo specTo body;

394.        private

395.           --  <doc_ignore>

396.           type Acc is access all Widget_TypeTo API docTo spec'Class;

397.           --  This type has to be declared at library level, otherwise

398.           --  Program_Error might be raised when trying to cast from the

399.           --  parameter of Marshaller to another type.

401.           type Data_Type_Record is record

402.              Func   : HandlerTo API docTo spec;

403.              --  User's callback

405.              Proxy  : Marshallers.Handler_ProxyTo API docTo spec := null;

406.              --  Handler_Proxy to use

408.              Object : Acc := null;

409.              --  Slot Object for Object_Connect

410.           end record;

411.           type Data_Type_Access is access all Data_Type_Record;

412.           pragma Convention (C, Data_Type_Access);

413.           --  Data passed to the C handler

415.           function Convert is new Unchecked_Conversion

416.             (Data_Type_Access, System.Address);

417.           function Convert is new Unchecked_Conversion

418.             (System.Address, Data_Type_Access);

420.           procedure Free_Data (Data : Data_Type_Access);

421.           pragma Convention (C, Free_Data);

422.           --  Free the memory associated with the callback's data

424.           procedure First_Marshaller

425.             (Closure         : GClosureTo API docTo spec;

426.              Return_Value    : Glib.Values.GValueTo API docTo specTo body;

427.              N_Params        : GuintTo API docTo spec;

428.              Params          : System.Address;

429.              Invocation_Hint : System.Address;

430.              User_Data       : System.Address);

431.           pragma Convention (C, First_Marshaller);

432.           --  First level marshaller. This is the function that is actually

433.           --  called by gtk+. It then calls the Ada functions as required.

434.           --  </doc_ignore>

436.        end Return_CallbackTo API docTo specTo body;

438.        ---------------------------------------------------------

439.        --  These handlers should return a value

440.        --  They require a User_Data

441.        --  See also the package User_Callback_With_Setup

442.        ---------------------------------------------------------

444.        generic

445.           type Widget_Type is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

446.           type Return_Type is (<>);

447.           type User_Type (<>) is private;

448.        package User_Return_CallbackTo API docTo body is

450.           type Handler is access function

451.             (Widget    : access Widget_TypeTo API docTo spec'Class;

452.              Params    : Glib.Values.GValuesTo API docTo specTo body;

453.              User_Data : User_TypeTo API docTo spec) return Return_TypeTo API docTo spec;

454.           type Simple_Handler is access function

455.             (Widget    : access Widget_TypeTo API docTo spec'Class;

456.              User_Data : User_TypeTo API docTo spec) return Return_TypeTo API docTo spec;

458.           package Marshallers is new Gtk.Marshallers.User_Return_MarshallersTo API docTo specTo body

459.             (Widget_TypeTo API docTo spec, Return_TypeTo API docTo spec, User_TypeTo API docTo spec);

461.           --  Connecting a handler to an object

463.           procedure ConnectTo API docTo body

464.             (Widget    : access Widget_TypeTo API docTo spec'Class;

465.              Name      : Glib.Signal_NameTo API docTo spec;

466.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

467.              User_Data : User_TypeTo API docTo spec;

468.              After     : Boolean := False);

469.           procedure Object_ConnectTo API docTo body

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

471.              Name        : Glib.Signal_NameTo API docTo spec;

472.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

473.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

474.              User_Data   : User_TypeTo API docTo spec;

475.              After       : Boolean := False);

477.           procedure ConnectTo API docTo body

478.             (Widget    : access Widget_TypeTo API docTo spec'Class;

479.              Name      : Glib.Signal_NameTo API docTo spec;

480.              Cb        : Simple_HandlerTo API docTo spec;

481.              User_Data : User_TypeTo API docTo spec;

482.              After     : Boolean := False);

483.           procedure Object_ConnectTo API docTo body

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

485.              Name        : Glib.Signal_NameTo API docTo spec;

486.              Cb          : Simple_HandlerTo API docTo spec;

487.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

488.              User_Data   : User_TypeTo API docTo spec;

489.              After       : Boolean := False);

491.           procedure ConnectTo API docTo body

492.             (Widget    : access Widget_TypeTo API docTo spec'Class;

493.              Name      : Glib.Signal_NameTo API docTo spec;

494.              Cb        : HandlerTo API docTo spec;

495.              User_Data : User_TypeTo API docTo spec;

496.              After     : Boolean := False);

497.           procedure Object_ConnectTo API docTo body

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

499.              Name        : Glib.Signal_NameTo API docTo spec;

500.              Cb          : HandlerTo API docTo spec;

501.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

502.              User_Data   : User_TypeTo API docTo spec;

503.              After       : Boolean := False);

505.           pragma Inline (ConnectTo API docTo specTo body);

507.           function ConnectTo API docTo body

508.             (Widget    : access Widget_TypeTo API docTo spec'Class;

509.              Name      : Glib.Signal_NameTo API docTo spec;

510.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

511.              User_Data : User_TypeTo API docTo spec;

512.              After     : Boolean := False) return Handler_IdTo API docTo spec;

514.           function Object_ConnectTo API docTo body

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

516.              Name        : Glib.Signal_NameTo API docTo spec;

517.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

518.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

519.              User_Data   : User_TypeTo API docTo spec;

520.              After       : Boolean := False) return Handler_IdTo API docTo spec;

522.           function ConnectTo API docTo body

523.             (Widget    : access Widget_TypeTo API docTo spec'Class;

524.              Name      : Glib.Signal_NameTo API docTo spec;

525.              Cb        : HandlerTo API docTo spec;

526.              User_Data : User_TypeTo API docTo spec;

527.              After     : Boolean := False) return Handler_IdTo API docTo spec;

529.           function Object_ConnectTo API docTo body

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

531.              Name        : Glib.Signal_NameTo API docTo spec;

532.              Cb          : HandlerTo API docTo spec;

533.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

534.              User_Data   : User_TypeTo API docTo spec;

535.              After       : Boolean := False) return Handler_IdTo API docTo spec;

537.           --  Some convenient functions to create marshallers

539.           package Gint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

540.             (GintTo API docTo spec, Glib.Values.Get_IntTo API docTo specTo body);

541.           package Guint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

542.             (GuintTo API docTo spec, Glib.Values.Get_UintTo API docTo specTo body);

543.           package Event_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

544.             (Gdk.Event.Gdk_EventTo API docTo spec, Gdk.Event.Get_EventTo API docTo specTo body);

545.           package Widget_Marshaller is new Marshallers.Generic_Widget_MarshallerTo API docTo specTo body

546.             (Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body, Gtk.Widget.Gtk_WidgetTo API docTo spec);

547.           package Notebook_Page_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

548.             (Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec, Gtk.Notebook.Get_Notebook_PageTo API docTo specTo body);

550.           function To_Marshaller

551.             (Cb : Gint_Marshaller.HandlerTo API docTo spec)

552.              return Marshallers.MarshallerTo API docTo spec renames Gint_Marshaller.To_MarshallerTo API docTo specTo body;

554.           function To_Marshaller

555.             (Cb : Guint_Marshaller.HandlerTo API docTo spec)

556.              return Marshallers.MarshallerTo API docTo spec renames Guint_Marshaller.To_MarshallerTo API docTo specTo body;

558.           function To_Marshaller

559.             (Cb : Event_Marshaller.HandlerTo API docTo spec)

560.              return Marshallers.MarshallerTo API docTo spec renames Event_Marshaller.To_MarshallerTo API docTo specTo body;

562.           function To_Marshaller

563.             (Cb : Widget_Marshaller.HandlerTo API docTo spec)

564.              return Marshallers.MarshallerTo API docTo spec renames Widget_Marshaller.To_MarshallerTo API docTo specTo body;

566.           function To_Marshaller

567.             (Cb : Marshallers.Void_Marshaller.HandlerTo API docTo spec)

568.              return Marshallers.MarshallerTo API docTo spec

569.              renames Marshallers.Void_Marshaller.To_MarshallerTo API docTo specTo body;

571.           function To_Marshaller

572.             (Cb : Notebook_Page_Marshaller.HandlerTo API docTo spec)

573.              return Marshallers.MarshallerTo API docTo spec

574.              renames Notebook_Page_Marshaller.To_MarshallerTo API docTo specTo body;

576.           --  Emitting a signal

578.           function Emit_By_Name

579.             (Object : access Widget_TypeTo API docTo spec'Class;

580.              Name   : Glib.Signal_NameTo API docTo spec;

581.              Param  : GintTo API docTo spec)

582.              return Return_TypeTo API docTo spec renames Gint_Marshaller.Emit_By_NameTo API docTo specTo body;

584.           function Emit_By_Name

585.             (Object : access Widget_TypeTo API docTo spec'Class;

586.              Name   : Glib.Signal_NameTo API docTo spec;

587.              Param  : GuintTo API docTo spec)

588.              return Return_TypeTo API docTo spec renames Guint_Marshaller.Emit_By_NameTo API docTo specTo body;

590.           function Emit_By_NameTo API docTo body

591.             (Object : access Widget_TypeTo API docTo spec'Class;

592.              Name   : Glib.Signal_NameTo API docTo spec;

593.              Param  : Gdk.Event.Gdk_EventTo API docTo spec) return Return_TypeTo API docTo spec;

595.           function Emit_By_Name

596.             (Object : access Widget_TypeTo API docTo spec'Class;

597.              Name   : Glib.Signal_NameTo API docTo spec;

598.              Param  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

599.              return Return_TypeTo API docTo spec renames Widget_Marshaller.Emit_By_NameTo API docTo specTo body;

601.           function Emit_By_Name

602.             (Object : access Widget_TypeTo API docTo spec'Class;

603.              Name   : Glib.Signal_NameTo API docTo spec)

604.              return Return_TypeTo API docTo spec renames Marshallers.Void_Marshaller.Emit_By_NameTo API docTo specTo body;

606.           function Emit_By_Name

607.             (Object : access Widget_TypeTo API docTo spec'Class;

608.              Name   : Glib.Signal_NameTo API docTo spec;

609.              Param  : Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec)

610.              return Return_TypeTo API docTo spec renames Notebook_Page_Marshaller.Emit_By_NameTo API docTo specTo body;

612.        private

613.           --  <doc_ignore>

614.           type Acc is access all Widget_TypeTo API docTo spec'Class;

615.           --  This type has to be declared at library level, otherwise

616.           --  Program_Error might be raised when trying to cast from the

617.           --  parameter of Marshaller to another type.

619.           type User_Access is access User_TypeTo API docTo spec;

620.           type Data_Type_Record is record

621.              Func   : HandlerTo API docTo spec;

622.              --  User's callback

624.              Proxy  : Marshallers.Handler_ProxyTo API docTo spec := null;

625.              --  Handler_Proxy to use

627.              User   : User_Access := null;

628.              Object : Acc := null;

629.              --  Slot Object for Object_Connect

630.           end record;

631.           type Data_Type_Access is access all Data_Type_Record;

632.           pragma Convention (C, Data_Type_Access);

633.           --  Data passed to the C handler

635.           function Convert is new Unchecked_Conversion

636.             (Data_Type_Access, System.Address);

637.           function Convert is new Unchecked_Conversion

638.             (System.Address, Data_Type_Access);

640.           procedure Free_Data (Data : Data_Type_Access);

641.           pragma Convention (C, Free_Data);

642.           --  Free the memory associated with the callback's data

644.           procedure First_Marshaller

645.             (Closure         : GClosureTo API docTo spec;

646.              Return_Value    : Glib.Values.GValueTo API docTo specTo body;

647.              N_Params        : GuintTo API docTo spec;

648.              Params          : System.Address;

649.              Invocation_Hint : System.Address;

650.              User_Data       : System.Address);

651.           pragma Convention (C, First_Marshaller);

652.           --  First level marshaller. This is the function that is actually

653.           --  called by gtk+. It then calls the Ada functions as required.

654.           --  </doc_ignore>

656.        end User_Return_CallbackTo API docTo specTo body;

658.        -------------------------------------

659.        -- User_Return_Callback_With_Setup --

660.        -------------------------------------

661.        --  This package is basically the same as User_Return_Callback, except that

662.        --  an extra function (Setup) is called after a handler has been

663.        --  connected. Typical usage is to automatically call Add_Watch (see below)

664.        --  in case the User_Type is (or contains) widgets.

666.        generic

667.           type Widget_Type is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

668.           type Return_Type is (<>);

669.           type User_Type (<>) is private;

670.           with procedure Setup (User_Data : User_TypeTo API docTo spec; Id : Handler_IdTo API docTo spec);

671.        package User_Return_Callback_With_SetupTo API docTo body is

673.           package Internal_Cb is new User_Return_CallbackTo API docTo specTo body

674.             (Widget_TypeTo API docTo spec, Return_TypeTo API docTo spec, User_TypeTo API docTo spec);

676.           subtype Handler is Internal_Cb.HandlerTo API docTo spec;

677.           subtype Simple_Handler is Internal_Cb.Simple_HandlerTo API docTo spec;

678.           package Marshallers renames Internal_Cb.MarshallersTo API docTo spec;

680.           --  Connecting a handler to an object

682.           procedure ConnectTo API docTo body

683.             (Widget    : access Widget_TypeTo API docTo spec'Class;

684.              Name      : Glib.Signal_NameTo API docTo spec;

685.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

686.              User_Data : User_TypeTo API docTo spec;

687.              After     : Boolean := False);

688.           procedure Object_ConnectTo API docTo body

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

690.              Name        : Glib.Signal_NameTo API docTo spec;

691.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

692.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

693.              User_Data   : User_TypeTo API docTo spec;

694.              After       : Boolean := False);

696.           procedure ConnectTo API docTo body

697.             (Widget    : access Widget_TypeTo API docTo spec'Class;

698.              Name      : Glib.Signal_NameTo API docTo spec;

699.              Cb        : HandlerTo API docTo spec;

700.              User_Data : User_TypeTo API docTo spec;

701.              After     : Boolean := False);

702.           procedure Object_ConnectTo API docTo body

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

704.              Name        : Glib.Signal_NameTo API docTo spec;

705.              Cb          : HandlerTo API docTo spec;

706.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

707.              User_Data   : User_TypeTo API docTo spec;

708.              After       : Boolean := False);

710.           procedure ConnectTo API docTo body

711.             (Widget    : access Widget_TypeTo API docTo spec'Class;

712.              Name      : Glib.Signal_NameTo API docTo spec;

713.              Cb        : Simple_HandlerTo API docTo spec;

714.              User_Data : User_TypeTo API docTo spec;

715.              After     : Boolean := False);

716.           procedure Object_ConnectTo API docTo body

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

718.              Name        : Glib.Signal_NameTo API docTo spec;

719.              Cb          : Simple_HandlerTo API docTo spec;

720.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

721.              User_Data   : User_TypeTo API docTo spec;

722.              After       : Boolean := False);

724.           pragma Inline (ConnectTo API docTo specTo body);

726.           function ConnectTo API docTo body

727.             (Widget    : access Widget_TypeTo API docTo spec'Class;

728.              Name      : Glib.Signal_NameTo API docTo spec;

729.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

730.              User_Data : User_TypeTo API docTo spec;

731.              After     : Boolean := False) return Handler_IdTo API docTo spec;

733.           function Object_ConnectTo API docTo body

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

735.              Name        : Glib.Signal_NameTo API docTo spec;

736.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

737.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

738.              User_Data   : User_TypeTo API docTo spec;

739.              After       : Boolean := False) return Handler_IdTo API docTo spec;

741.           function ConnectTo API docTo body

742.             (Widget    : access Widget_TypeTo API docTo spec'Class;

743.              Name      : Glib.Signal_NameTo API docTo spec;

744.              Cb        : HandlerTo API docTo spec;

745.              User_Data : User_TypeTo API docTo spec;

746.              After     : Boolean := False) return Handler_IdTo API docTo spec;

748.           function Object_ConnectTo API docTo body

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

750.              Name        : Glib.Signal_NameTo API docTo spec;

751.              Cb          : HandlerTo API docTo spec;

752.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

753.              User_Data   : User_TypeTo API docTo spec;

754.              After       : Boolean := False) return Handler_IdTo API docTo spec;

756.           --  Some convenient functions to create marshallers

758.           package Gint_Marshaller renames Internal_Cb.Gint_MarshallerTo API docTo spec;

759.           package Guint_Marshaller renames Internal_Cb.Guint_MarshallerTo API docTo spec;

760.           package Event_Marshaller renames Internal_Cb.Event_MarshallerTo API docTo spec;

761.           package Widget_Marshaller renames Internal_Cb.Widget_MarshallerTo API docTo spec;

762.           package Notebook_Page_Marshaller

763.             renames Internal_Cb.Notebook_Page_MarshallerTo API docTo spec;

765.           function To_Marshaller

766.             (Cb : Gint_Marshaller.HandlerTo API docTo spec)

767.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

768.              renames Internal_Cb.To_MarshallerTo API docTo spec;

769.           function To_Marshaller

770.             (Cb : Guint_Marshaller.HandlerTo API docTo spec)

771.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

772.              renames Internal_Cb.To_MarshallerTo API docTo spec;

773.           function To_Marshaller

774.             (Cb : Event_Marshaller.HandlerTo API docTo spec)

775.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

776.              renames Internal_Cb.To_MarshallerTo API docTo spec;

777.           function To_Marshaller

778.             (Cb : Widget_Marshaller.HandlerTo API docTo spec)

779.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

780.              renames Internal_Cb.To_MarshallerTo API docTo spec;

781.           function To_Marshaller

782.             (Cb : Internal_Cb.Marshallers.Void_Marshaller.HandlerTo API docTo spec)

783.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

784.              renames Internal_Cb.To_MarshallerTo API docTo spec;

785.           function To_Marshaller

786.             (Cb : Notebook_Page_Marshaller.HandlerTo API docTo spec)

787.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

788.              renames Internal_Cb.To_MarshallerTo API docTo spec;

790.           --  Emitting a signal

792.           function Emit_By_Name

793.             (Object : access Widget_TypeTo API docTo spec'Class;

794.              Name   : Glib.Signal_NameTo API docTo spec;

795.              Param  : GintTo API docTo spec) return Return_TypeTo API docTo spec renames Internal_Cb.Emit_By_NameTo API docTo spec;

797.           function Emit_By_Name

798.             (Object : access Widget_TypeTo API docTo spec'Class;

799.              Name   : Glib.Signal_NameTo API docTo spec;

800.              Param  : GuintTo API docTo spec) return Return_TypeTo API docTo spec renames Internal_Cb.Emit_By_NameTo API docTo spec;

802.           function Emit_By_Name

803.             (Object : access Widget_TypeTo API docTo spec'Class;

804.              Name   : Glib.Signal_NameTo API docTo spec;

805.              Param  : Gdk.Event.Gdk_EventTo API docTo spec) return Return_TypeTo API docTo spec

806.              renames Internal_Cb.Emit_By_NameTo API docTo specTo body;

808.           function Emit_By_Name

809.             (Object : access Widget_TypeTo API docTo spec'Class;

810.              Name   : Glib.Signal_NameTo API docTo spec;

811.              Param  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

812.              return Return_TypeTo API docTo spec renames Internal_Cb.Emit_By_NameTo API docTo spec;

814.           function Emit_By_Name

815.             (Object : access Widget_TypeTo API docTo spec'Class;

816.              Name   : Glib.Signal_NameTo API docTo spec)

817.              return Return_TypeTo API docTo spec renames Internal_Cb.Emit_By_NameTo API docTo spec;

819.           function Emit_By_Name

820.             (Object : access Widget_TypeTo API docTo spec'Class;

821.              Name   : Glib.Signal_NameTo API docTo spec;

822.              Param  : Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec)

823.              return Return_TypeTo API docTo spec renames Internal_Cb.Emit_By_NameTo API docTo spec;

825.        end User_Return_Callback_With_SetupTo API docTo specTo body;

827.        ---------------------------------------------------------

828.        --  These handlers do not return a value

829.        --  They do not have a User_Data

830.        ---------------------------------------------------------

832.        generic

833.           type Widget_Type is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

834.        package CallbackTo API docTo body is

836.           type Handler is access procedure

837.             (Widget : access Widget_TypeTo API docTo spec'Class;

838.              Params : Glib.Values.GValuesTo API docTo specTo body);

839.           type Simple_Handler is access procedure

840.             (Widget : access Widget_TypeTo API docTo spec'Class);

842.           package Marshallers is new

843.             Gtk.Marshallers.Void_MarshallersTo API docTo specTo body (Widget_TypeTo API docTo spec);

845.           --  Connecting a handler to an object

847.           procedure ConnectTo API docTo body

848.             (Widget : access Widget_TypeTo API docTo spec'Class;

849.              Name   : Glib.Signal_NameTo API docTo spec;

850.              MarshTo API docTo body  : Marshallers.MarshallerTo API docTo spec;

851.              After  : Boolean := False);

852.           procedure Object_ConnectTo API docTo body

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

854.              Name        : Glib.Signal_NameTo API docTo spec;

855.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

856.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

857.              After       : Boolean := False);

859.           procedure ConnectTo API docTo body

860.             (Widget : access Widget_TypeTo API docTo spec'Class;

861.              Name   : Glib.Signal_NameTo API docTo spec;

862.              Cb     : HandlerTo API docTo spec;

863.              After  : Boolean := False);

864.           procedure Object_ConnectTo API docTo body

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

866.              Name        : Glib.Signal_NameTo API docTo spec;

867.              Cb          : HandlerTo API docTo spec;

868.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

869.              After       : Boolean := False);

871.           procedure ConnectTo API docTo body

872.             (Widget : access Widget_TypeTo API docTo spec'Class;

873.              Name   : Glib.Signal_NameTo API docTo spec;

874.              Cb     : Simple_HandlerTo API docTo spec;

875.              After  : Boolean := False);

876.           procedure Object_ConnectTo API docTo body

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

878.              Name        : Glib.Signal_NameTo API docTo spec;

879.              Cb          : Simple_HandlerTo API docTo spec;

880.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

881.              After       : Boolean := False);

883.           pragma Inline (ConnectTo API docTo specTo body);

884.           pragma Inline (Object_ConnectTo API docTo specTo body);

886.           function ConnectTo API docTo body

887.             (Widget : access Widget_TypeTo API docTo spec'Class;

888.              Name   : Glib.Signal_NameTo API docTo spec;

889.              MarshTo API docTo body  : Marshallers.MarshallerTo API docTo spec;

890.              After  : Boolean := False) return Handler_IdTo API docTo spec;

892.           function Object_ConnectTo API docTo body

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

894.              Name        : Glib.Signal_NameTo API docTo spec;

895.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

896.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

897.              After       : Boolean := False) return Handler_IdTo API docTo spec;

899.           function ConnectTo API docTo body

900.             (Widget : access Widget_TypeTo API docTo spec'Class;

901.              Name   : Glib.Signal_NameTo API docTo spec;

902.              Cb     : HandlerTo API docTo spec;

903.              After  : Boolean := False) return Handler_IdTo API docTo spec;

905.           function Object_ConnectTo API docTo body

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

907.              Name        : Glib.Signal_NameTo API docTo spec;

908.              Cb          : HandlerTo API docTo spec;

909.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

910.              After       : Boolean := False) return Handler_IdTo API docTo spec;

912.           --  Some convenient functions to create marshallers

914.           package Gint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

915.             (GintTo API docTo spec, Glib.Values.Get_IntTo API docTo specTo body);

916.           package Guint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

917.             (GuintTo API docTo spec, Glib.Values.Get_UintTo API docTo specTo body);

918.           package Event_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

919.             (Gdk.Event.Gdk_EventTo API docTo spec, Gdk.Event.Get_EventTo API docTo specTo body);

920.           package Widget_Marshaller is new Marshallers.Generic_Widget_MarshallerTo API docTo specTo body

921.             (Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body, Gtk.Widget.Gtk_WidgetTo API docTo spec);

922.           package Notebook_Page_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

923.             (Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec, Gtk.Notebook.Get_Notebook_PageTo API docTo specTo body);

924.           package Tree_Path_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

925.             (Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec, Gtk.Tree_Model.Get_Tree_PathTo API docTo specTo body);

926.           package Tree_Iter_Tree_Path_Marshaller is

927.              new Marshallers.Generic_Marshaller_2To API docTo specTo body

928.                    (Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body, Gtk.Tree_Model.Get_Tree_IterTo API docTo specTo body,

929.                     Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec, Gtk.Tree_Model.Get_Tree_PathTo API docTo specTo body);

930.           package Tree_Path_Tree_Iter_Marshaller is

931.              new Marshallers.Generic_Marshaller_2To API docTo specTo body

932.                    (Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec, Gtk.Tree_Model.Get_Tree_PathTo API docTo specTo body,

933.                     Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body, Gtk.Tree_Model.Get_Tree_IterTo API docTo specTo body);

935.           function To_Marshaller

936.             (Cb : Gint_Marshaller.HandlerTo API docTo spec)

937.              return Marshallers.MarshallerTo API docTo spec renames Gint_Marshaller.To_MarshallerTo API docTo specTo body;

939.           function To_Marshaller

940.             (Cb : Guint_Marshaller.HandlerTo API docTo spec)

941.              return Marshallers.MarshallerTo API docTo spec renames Guint_Marshaller.To_MarshallerTo API docTo specTo body;

943.           function To_Marshaller

944.             (Cb : Event_Marshaller.HandlerTo API docTo spec)

945.              return Marshallers.MarshallerTo API docTo spec renames Event_Marshaller.To_MarshallerTo API docTo specTo body;

947.           function To_Marshaller

948.             (Cb : Widget_Marshaller.HandlerTo API docTo spec)

949.              return Marshallers.MarshallerTo API docTo spec renames Widget_Marshaller.To_MarshallerTo API docTo specTo body;

951.           function To_Marshaller

952.             (Cb : Marshallers.Void_Marshaller.HandlerTo API docTo spec)

953.              return Marshallers.MarshallerTo API docTo spec

954.              renames Marshallers.Void_Marshaller.To_MarshallerTo API docTo specTo body;

956.           function To_Marshaller

957.             (Cb : Notebook_Page_Marshaller.HandlerTo API docTo spec)

958.              return Marshallers.MarshallerTo API docTo spec

959.              renames Notebook_Page_Marshaller.To_MarshallerTo API docTo specTo body;

961.           function To_Marshaller

962.             (Cb : Tree_Path_Marshaller.HandlerTo API docTo spec)

963.              return Marshallers.MarshallerTo API docTo spec

964.              renames Tree_Path_Marshaller.To_MarshallerTo API docTo specTo body;

966.           function To_Marshaller

967.             (Cb : Tree_Iter_Tree_Path_Marshaller.HandlerTo API docTo spec)

968.              return Marshallers.MarshallerTo API docTo spec

969.              renames Tree_Iter_Tree_Path_Marshaller.To_MarshallerTo API docTo specTo body;

971.           function To_Marshaller

972.             (Cb : Tree_Path_Tree_Iter_Marshaller.HandlerTo API docTo spec)

973.              return Marshallers.MarshallerTo API docTo spec

974.              renames Tree_Path_Tree_Iter_Marshaller.To_MarshallerTo API docTo specTo body;

976.           --  Emitting a signal

978.           procedure Emit_By_Name

979.             (Object : access Widget_TypeTo API docTo spec'Class;

980.              Name   : Glib.Signal_NameTo API docTo spec;

981.              Param  : GintTo API docTo spec) renames Gint_Marshaller.Emit_By_NameTo API docTo specTo body;

983.           procedure Emit_By_Name

984.             (Object : access Widget_TypeTo API docTo spec'Class;

985.              Name   : Glib.Signal_NameTo API docTo spec;

986.              Param  : GuintTo API docTo spec) renames Guint_Marshaller.Emit_By_NameTo API docTo specTo body;

988.           procedure Emit_By_NameTo API docTo body

989.              (Object : access Widget_TypeTo API docTo spec'Class;

990.               Name   : Glib.Signal_NameTo API docTo spec;

991.               Param  : Gdk.Event.Gdk_EventTo API docTo spec);

993.           procedure Emit_By_Name

994.             (Object : access Widget_TypeTo API docTo spec'Class;

995.              Name   : Glib.Signal_NameTo API docTo spec;

996.              Param  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

997.              renames Widget_Marshaller.Emit_By_NameTo API docTo specTo body;

999.           procedure Emit_By_Name

1000.             (Object : access Widget_TypeTo API docTo spec'Class;

1001.              Name   : Glib.Signal_NameTo API docTo spec)

1002.              renames Marshallers.Void_Marshaller.Emit_By_NameTo API docTo specTo body;

1004.           procedure Emit_By_Name

1005.             (Object : access Widget_TypeTo API docTo spec'Class;

1006.              Name   : Glib.Signal_NameTo API docTo spec;

1007.              Param  : Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec)

1008.              renames Notebook_Page_Marshaller.Emit_By_NameTo API docTo specTo body;

1010.           procedure Emit_By_Name is

1011.             new Tree_Path_Marshaller.Emit_By_Name_GenericTo API docTo specTo body

1012.                   (Gtk.Tree_Model.To_AddressTo API docTo specTo body);

1014.           procedure Emit_By_Name is

1015.             new Tree_Iter_Tree_Path_Marshaller.Emit_By_Name_GenericTo API docTo specTo body

1016.                   (Gtk.Tree_Model.To_AddressTo API docTo specTo body,

1017.                    Gtk.Tree_Model.To_AddressTo API docTo specTo body);

1019.           procedure Emit_By_Name is

1020.             new Tree_Path_Tree_Iter_Marshaller.Emit_By_Name_GenericTo API docTo specTo body

1021.                   (Gtk.Tree_Model.To_AddressTo API docTo specTo body,

1022.                    Gtk.Tree_Model.To_AddressTo API docTo specTo body);

1024.        private

1025.           --  <doc_ignore>

1026.           type Acc is access all Widget_TypeTo API docTo spec'Class;

1027.           --  This type has to be declared at library level, otherwise

1028.           --  Program_Error might be raised when trying to cast from the

1029.           --  parameter of Marshaller to another type.

1031.           type Data_Type_Record is record

1032.              Func   : HandlerTo API docTo spec;             --  User's callback

1033.              Proxy  : Marshallers.Handler_ProxyTo API docTo spec := null;  --  Handler_Proxy to use

1034.              Object : Acc := null;         --  Slot Object for Object_Connect

1035.           end record;

1036.           type Data_Type_Access is access all Data_Type_Record;

1037.           pragma Convention (C, Data_Type_Access);

1038.           --  Data passed to the C handler

1040.           function Convert is new Unchecked_Conversion

1041.             (Data_Type_Access, System.Address);

1042.           function Convert is new Unchecked_Conversion

1043.             (System.Address, Data_Type_Access);

1045.           procedure Free_Data (Data : Data_Type_Access);

1046.           pragma Convention (C, Free_Data);

1047.           --  Free the memory associated with the callback's data

1049.           procedure First_Marshaller

1050.             (Closure         : GClosureTo API docTo spec;

1051.              Return_Value    : Glib.Values.GValueTo API docTo specTo body;

1052.              N_Params        : GuintTo API docTo spec;

1053.              Params          : System.Address;

1054.              Invocation_Hint : System.Address;

1055.              User_Data       : System.Address);

1056.           pragma Convention (C, First_Marshaller);

1057.           --  First level marshaller. This is the function that is actually

1058.           --  called by gtk+. It then calls the Ada functions as required.

1059.           --  </doc_ignore>

1061.        end CallbackTo API docTo specTo body;

1063.        ---------------------------------------------------------

1064.        --  These handlers do not return a value

1065.        --  They require a User_Data

1066.        --  See also the package User_Callback_With_Setup

1067.        ---------------------------------------------------------

1069.        generic

1070.           type Widget_Type is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

1071.           type User_Type (<>) is private;

1072.        package User_CallbackTo API docTo body is

1074.           type Handler is access procedure

1075.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1076.              Params    : Glib.Values.GValuesTo API docTo specTo body;

1077.              User_Data : User_TypeTo API docTo spec);

1078.           type Simple_Handler is access procedure

1079.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1080.              User_Data : User_TypeTo API docTo spec);

1082.           package Marshallers is new

1083.             Gtk.Marshallers.User_Void_MarshallersTo API docTo specTo body (Widget_TypeTo API docTo spec, User_TypeTo API docTo spec);

1085.           --  Connecting a handler to an object

1087.           procedure ConnectTo API docTo body

1088.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1089.              Name      : Glib.Signal_NameTo API docTo spec;

1090.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

1091.              User_Data : User_TypeTo API docTo spec;

1092.              After     : Boolean := False);

1093.           procedure Object_ConnectTo API docTo body

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

1095.              Name        : Glib.Signal_NameTo API docTo spec;

1096.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

1097.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1098.              User_Data   : User_TypeTo API docTo spec;

1099.              After       : Boolean := False);

1101.           procedure ConnectTo API docTo body

1102.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1103.              Name      : Glib.Signal_NameTo API docTo spec;

1104.              Cb        : HandlerTo API docTo spec;

1105.              User_Data : User_TypeTo API docTo spec;

1106.              After     : Boolean := False);

1107.           procedure Object_ConnectTo API docTo body

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

1109.              Name        : Glib.Signal_NameTo API docTo spec;

1110.              Cb          : HandlerTo API docTo spec;

1111.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1112.              User_Data   : User_TypeTo API docTo spec;

1113.              After       : Boolean := False);

1115.           procedure ConnectTo API docTo body

1116.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1117.              Name      : Glib.Signal_NameTo API docTo spec;

1118.              Cb        : Simple_HandlerTo API docTo spec;

1119.              User_Data : User_TypeTo API docTo spec;

1120.              After     : Boolean := False);

1121.           procedure Object_ConnectTo API docTo body

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

1123.              Name        : Glib.Signal_NameTo API docTo spec;

1124.              Cb          : Simple_HandlerTo API docTo spec;

1125.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1126.              User_Data   : User_TypeTo API docTo spec;

1127.              After       : Boolean := False);

1129.           pragma Inline (ConnectTo API docTo specTo body);

1131.           function ConnectTo API docTo body

1132.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1133.              Name      : Glib.Signal_NameTo API docTo spec;

1134.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

1135.              User_DataTo API docTo body : User_TypeTo API docTo spec;

1136.              After     : Boolean := False) return Handler_IdTo API docTo spec;

1138.           function Object_ConnectTo API docTo body

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

1140.              Name        : Glib.Signal_NameTo API docTo spec;

1141.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

1142.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1143.              User_Data   : User_TypeTo API docTo spec;

1144.              After       : Boolean := False) return Handler_IdTo API docTo spec;

1146.           function ConnectTo API docTo body

1147.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1148.              Name      : Glib.Signal_NameTo API docTo spec;

1149.              Cb        : HandlerTo API docTo spec;

1150.              User_Data : User_TypeTo API docTo spec;

1151.              After     : Boolean := False) return Handler_IdTo API docTo spec;

1153.           function Object_ConnectTo API docTo body

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

1155.              Name        : Glib.Signal_NameTo API docTo spec;

1156.              Cb          : HandlerTo API docTo spec;

1157.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1158.              User_Data   : User_TypeTo API docTo spec;

1159.              After       : Boolean := False) return Handler_IdTo API docTo spec;

1161.           --  Some convenient functions to create marshallers

1163.           package Gint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

1164.             (GintTo API docTo spec, Glib.Values.Get_IntTo API docTo specTo body);

1165.           package Guint_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

1166.             (GuintTo API docTo spec, Glib.Values.Get_UintTo API docTo specTo body);

1167.           package Event_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

1168.             (Gdk.Event.Gdk_EventTo API docTo spec, Gdk.Event.Get_EventTo API docTo specTo body);

1169.           package Widget_Marshaller is new Marshallers.Generic_Widget_MarshallerTo API docTo specTo body

1170.             (Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body, Gtk.Widget.Gtk_WidgetTo API docTo spec);

1171.           package Notebook_Page_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

1172.             (Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec, Gtk.Notebook.Get_Notebook_PageTo API docTo specTo body);

1173.           package Tree_Path_Marshaller is new Marshallers.Generic_MarshallerTo API docTo specTo body

1174.             (Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec, Gtk.Tree_Model.Get_Tree_PathTo API docTo specTo body);

1175.           package Tree_Iter_Tree_Path_Marshaller is

1176.              new Marshallers.Generic_Marshaller_2To API docTo specTo body

1177.                    (Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body, Gtk.Tree_Model.Get_Tree_IterTo API docTo specTo body,

1178.                     Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec, Gtk.Tree_Model.Get_Tree_PathTo API docTo specTo body);

1179.           package Tree_Path_Tree_Iter_Marshaller is

1180.              new Marshallers.Generic_Marshaller_2To API docTo specTo body

1181.                    (Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec, Gtk.Tree_Model.Get_Tree_PathTo API docTo specTo body,

1182.                     Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body, Gtk.Tree_Model.Get_Tree_IterTo API docTo specTo body);

1184.           function To_Marshaller

1185.             (Cb : Gint_Marshaller.HandlerTo API docTo spec)

1186.              return Marshallers.MarshallerTo API docTo spec renames Gint_Marshaller.To_MarshallerTo API docTo specTo body;

1188.           function To_Marshaller

1189.             (Cb : Guint_Marshaller.HandlerTo API docTo spec)

1190.              return Marshallers.MarshallerTo API docTo spec renames Guint_Marshaller.To_MarshallerTo API docTo specTo body;

1192.           function To_Marshaller

1193.             (Cb : Event_Marshaller.HandlerTo API docTo spec)

1194.              return Marshallers.MarshallerTo API docTo spec renames Event_Marshaller.To_MarshallerTo API docTo specTo body;

1196.           function To_Marshaller

1197.             (Cb : Widget_Marshaller.HandlerTo API docTo spec)

1198.              return Marshallers.MarshallerTo API docTo spec renames Widget_Marshaller.To_MarshallerTo API docTo specTo body;

1200.           function To_Marshaller

1201.             (Cb : Marshallers.Void_Marshaller.HandlerTo API docTo spec)

1202.              return Marshallers.MarshallerTo API docTo spec

1203.              renames Marshallers.Void_Marshaller.To_MarshallerTo API docTo specTo body;

1205.           function To_Marshaller

1206.             (Cb : Notebook_Page_Marshaller.HandlerTo API docTo spec)

1207.              return Marshallers.MarshallerTo API docTo spec

1208.              renames Notebook_Page_Marshaller.To_MarshallerTo API docTo specTo body;

1210.           function To_Marshaller

1211.             (Cb : Tree_Path_Marshaller.HandlerTo API docTo spec)

1212.              return Marshallers.MarshallerTo API docTo spec

1213.              renames Tree_Path_Marshaller.To_MarshallerTo API docTo specTo body;

1215.           function To_Marshaller

1216.             (Cb : Tree_Iter_Tree_Path_Marshaller.HandlerTo API docTo spec)

1217.              return Marshallers.MarshallerTo API docTo spec

1218.              renames Tree_Iter_Tree_Path_Marshaller.To_MarshallerTo API docTo specTo body;

1220.           function To_Marshaller

1221.             (Cb : Tree_Path_Tree_Iter_Marshaller.HandlerTo API docTo spec)

1222.              return Marshallers.MarshallerTo API docTo spec

1223.              renames Tree_Path_Tree_Iter_Marshaller.To_MarshallerTo API docTo specTo body;

1225.           --  Emitting a signal

1227.           procedure Emit_By_Name

1228.             (Object : access Widget_TypeTo API docTo spec'Class;

1229.              Name   : Glib.Signal_NameTo API docTo spec;

1230.              Param  : GintTo API docTo spec) renames Gint_Marshaller.Emit_By_NameTo API docTo specTo body;

1232.           procedure Emit_By_Name

1233.             (Object : access Widget_TypeTo API docTo spec'Class;

1234.              Name   : Glib.Signal_NameTo API docTo spec;

1235.              Param  : GuintTo API docTo spec) renames Guint_Marshaller.Emit_By_NameTo API docTo specTo body;

1237.           procedure Emit_By_NameTo API docTo body

1238.             (Object : access Widget_TypeTo API docTo spec'Class;

1239.              Name   : Glib.Signal_NameTo API docTo spec;

1240.              Param  : Gdk.Event.Gdk_EventTo API docTo spec);

1242.           procedure Emit_By_Name

1243.             (Object : access Widget_TypeTo API docTo spec'Class;

1244.              Name   : Glib.Signal_NameTo API docTo spec;

1245.              Param  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

1246.              renames Widget_Marshaller.Emit_By_NameTo API docTo specTo body;

1248.           procedure Emit_By_Name

1249.             (Object : access Widget_TypeTo API docTo spec'Class;

1250.              Name   : Glib.Signal_NameTo API docTo spec)

1251.              renames Marshallers.Void_Marshaller.Emit_By_NameTo API docTo specTo body;

1253.           procedure Emit_By_Name

1254.             (Object : access Widget_TypeTo API docTo spec'Class;

1255.              Name   : Glib.Signal_NameTo API docTo spec;

1256.              Param  : Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec)

1257.              renames Notebook_Page_Marshaller.Emit_By_NameTo API docTo specTo body;

1259.           procedure Emit_By_Name is

1260.             new Tree_Path_Marshaller.Emit_By_Name_GenericTo API docTo specTo body

1261.                   (Gtk.Tree_Model.To_AddressTo API docTo specTo body);

1263.           procedure Emit_By_Name is

1264.             new Tree_Iter_Tree_Path_Marshaller.Emit_By_Name_GenericTo API docTo specTo body

1265.                   (Gtk.Tree_Model.To_AddressTo API docTo specTo body,

1266.                    Gtk.Tree_Model.To_AddressTo API docTo specTo body);

1268.           procedure Emit_By_Name is

1269.             new Tree_Path_Tree_Iter_Marshaller.Emit_By_Name_GenericTo API docTo specTo body

1270.                   (Gtk.Tree_Model.To_AddressTo API docTo specTo body,

1271.                    Gtk.Tree_Model.To_AddressTo API docTo specTo body);

1273.        private

1274.           --  <doc_ignore>

1275.           type Acc is access all Widget_TypeTo API docTo spec'Class;

1276.           --  This type has to be declared at library level, otherwise

1277.           --  Program_Error might be raised when trying to cast from the

1278.           --  parameter of Marshaller to another type.

1280.           type User_Access is access User_TypeTo API docTo spec;

1281.           type Data_Type_Record is record

1282.              Func   : HandlerTo API docTo spec;

1283.              --  User's callback

1285.              Proxy  : Marshallers.Handler_ProxyTo API docTo spec := null;

1286.              --  Handler_Proxy to use

1288.              User   : User_Access := null;

1289.              Object : Acc := null;

1290.              --  Slot_Object for Object_Connect

1291.           end record;

1292.           type Data_Type_Access is access all Data_Type_Record;

1293.           pragma Convention (C, Data_Type_Access);

1294.           --  Data passed to the C handler

1296.           function Convert is new Unchecked_Conversion

1297.             (Data_Type_Access, System.Address);

1298.           function Convert is new Unchecked_Conversion

1299.             (System.Address, Data_Type_Access);

1301.           procedure Free_Data (Data : Data_Type_Access);

1302.           pragma Convention (C, Free_Data);

1303.           --  Free the memory associated with the callback's data

1305.           procedure First_Marshaller

1306.             (Closure         : GClosureTo API docTo spec;

1307.              Return_Value    : Glib.Values.GValueTo API docTo specTo body;

1308.              N_Params        : GuintTo API docTo spec;

1309.              Params          : System.Address;

1310.              Invocation_Hint : System.Address;

1311.              User_Data       : System.Address);

1312.           pragma Convention (C, First_Marshaller);

1313.           --  First level marshaller. This is the function that is actually

1314.           --  called by gtk+. It then calls the Ada functions as required.

1315.           --  </doc_ignore>

1317.        end User_CallbackTo API docTo specTo body;

1319.        ------------------------------

1320.        -- User_Callback_With_Setup --

1321.        ------------------------------

1322.        --  This package is basically the same as User_Callback, except that an

1323.        --  extra function (Setup) is called after a handler has been

1324.        --  connected. Typical usage is to automatically call Add_Watch (see below)

1325.        --  in case the User_Type is (or contains) widgets.

1327.        generic

1328.           type Widget_Type is new Glib.Object.GObject_RecordTo API docTo specTo body with private;

1329.           type User_Type (<>) is private;

1330.           with procedure Setup (User_Data : User_TypeTo API docTo spec; Id : Handler_IdTo API docTo spec);

1331.        package User_Callback_With_SetupTo API docTo body is

1333.           package Internal_Cb is new User_CallbackTo API docTo specTo body (Widget_TypeTo API docTo spec, User_TypeTo API docTo spec);

1334.           package Marshallers renames Internal_Cb.MarshallersTo API docTo spec;

1336.           subtype Handler is Internal_Cb.HandlerTo API docTo spec;

1337.           subtype Simple_Handler is Internal_Cb.Simple_HandlerTo API docTo spec;

1339.           --  Connecting a handler to an object

1341.           procedure ConnectTo API docTo body

1342.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1343.              Name      : Glib.Signal_NameTo API docTo spec;

1344.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

1345.              User_Data : User_TypeTo API docTo spec;

1346.              After     : Boolean := False);

1347.           procedure Object_ConnectTo API docTo body

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

1349.              Name        : Glib.Signal_NameTo API docTo spec;

1350.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

1351.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1352.              User_Data   : User_TypeTo API docTo spec;

1353.              After       : Boolean := False);

1355.           procedure ConnectTo API docTo body

1356.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1357.              Name      : Glib.Signal_NameTo API docTo spec;

1358.              Cb        : HandlerTo API docTo spec;

1359.              User_Data : User_TypeTo API docTo spec;

1360.              After     : Boolean := False);

1361.           procedure Object_ConnectTo API docTo body

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

1363.              Name        : Glib.Signal_NameTo API docTo spec;

1364.              Cb          : HandlerTo API docTo spec;

1365.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1366.              User_Data   : User_TypeTo API docTo spec;

1367.              After       : Boolean := False);

1369.           procedure ConnectTo API docTo body

1370.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1371.              Name      : Glib.Signal_NameTo API docTo spec;

1372.              Cb        : Simple_HandlerTo API docTo spec;

1373.              User_Data : User_TypeTo API docTo spec;

1374.              After     : Boolean := False);

1375.           procedure Object_ConnectTo API docTo body

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

1377.              Name        : Glib.Signal_NameTo API docTo spec;

1378.              Cb          : Simple_HandlerTo API docTo spec;

1379.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1380.              User_Data   : User_TypeTo API docTo spec;

1381.              After       : Boolean := False);

1383.           pragma Inline (ConnectTo API docTo specTo body);

1385.           function ConnectTo API docTo body

1386.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1387.              Name      : Glib.Signal_NameTo API docTo spec;

1388.              MarshTo API docTo body     : Marshallers.MarshallerTo API docTo spec;

1389.              User_Data : User_TypeTo API docTo spec;

1390.              After     : Boolean := False) return Handler_IdTo API docTo spec;

1392.           function Object_ConnectTo API docTo body

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

1394.              Name        : Glib.Signal_NameTo API docTo spec;

1395.              MarshTo API docTo body       : Marshallers.MarshallerTo API docTo spec;

1396.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1397.              User_Data   : User_TypeTo API docTo spec;

1398.              After       : Boolean := False) return Handler_IdTo API docTo spec;

1400.           function ConnectTo API docTo body

1401.             (Widget    : access Widget_TypeTo API docTo spec'Class;

1402.              Name      : Glib.Signal_NameTo API docTo spec;

1403.              Cb        : HandlerTo API docTo spec;

1404.              User_Data : User_TypeTo API docTo spec;

1405.              After     : Boolean := False) return Handler_IdTo API docTo spec;

1407.           function Object_ConnectTo API docTo body

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

1409.              Name        : Glib.Signal_NameTo API docTo spec;

1410.              Cb          : HandlerTo API docTo spec;

1411.              Slot_Object : access Widget_TypeTo API docTo spec'Class;

1412.              User_Data   : User_TypeTo API docTo spec;

1413.              After       : Boolean := False) return Handler_IdTo API docTo spec;

1415.           --  Some convenient functions to create marshallers

1417.           package Gint_Marshaller renames Internal_Cb.Gint_MarshallerTo API docTo spec;

1418.           package Guint_Marshaller renames Internal_Cb.Guint_MarshallerTo API docTo spec;

1419.           package Event_Marshaller renames Internal_Cb.Event_MarshallerTo API docTo spec;

1420.           package Widget_Marshaller renames Internal_Cb.Widget_MarshallerTo API docTo spec;

1421.           package Notebook_Page_Marshaller

1422.             renames Internal_Cb.Notebook_Page_MarshallerTo API docTo spec;

1424.           function To_Marshaller

1425.             (Cb : Gint_Marshaller.HandlerTo API docTo spec)

1426.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

1427.              renames Internal_Cb.To_MarshallerTo API docTo spec;

1428.           function To_Marshaller

1429.             (Cb : Guint_Marshaller.HandlerTo API docTo spec)

1430.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

1431.              renames Internal_Cb.To_MarshallerTo API docTo spec;

1432.           function To_Marshaller

1433.             (Cb : Event_Marshaller.HandlerTo API docTo spec)

1434.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

1435.              renames Internal_Cb.To_MarshallerTo API docTo spec;

1436.           function To_Marshaller

1437.             (Cb : Widget_Marshaller.HandlerTo API docTo spec)

1438.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

1439.              renames Internal_Cb.To_MarshallerTo API docTo spec;

1440.           function To_Marshaller

1441.             (Cb : Internal_Cb.Marshallers.Void_Marshaller.HandlerTo API docTo spec)

1442.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

1443.              renames Internal_Cb.To_MarshallerTo API docTo spec;

1444.           function To_Marshaller

1445.             (Cb : Notebook_Page_Marshaller.HandlerTo API docTo spec)

1446.              return Internal_Cb.Marshallers.MarshallerTo API docTo spec

1447.              renames Internal_Cb.To_MarshallerTo API docTo spec;

1449.           --  Emitting a signal

1451.           procedure Emit_By_Name

1452.             (Object : access Widget_TypeTo API docTo spec'Class;

1453.              Name   : Glib.Signal_NameTo API docTo spec;

1454.              Param  : GintTo API docTo spec) renames Internal_Cb.Emit_By_NameTo API docTo spec;

1456.           procedure Emit_By_Name

1457.             (Object : access Widget_TypeTo API docTo spec'Class;

1458.              Name   : Glib.Signal_NameTo API docTo spec;

1459.              Param  : GuintTo API docTo spec) renames Internal_Cb.Emit_By_NameTo API docTo spec;

1461.           procedure Emit_By_Name

1462.             (Object : access Widget_TypeTo API docTo spec'Class;

1463.              Name   : Glib.Signal_NameTo API docTo spec;

1464.              Param  : Gdk.Event.Gdk_EventTo API docTo spec) renames Internal_Cb.Emit_By_NameTo API docTo specTo body;

1466.           procedure Emit_By_Name

1467.             (Object : access Widget_TypeTo API docTo spec'Class;

1468.              Name   : Glib.Signal_NameTo API docTo spec;

1469.              Param  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

1470.              renames Internal_Cb.Emit_By_NameTo API docTo spec;

1472.           procedure Emit_By_Name

1473.             (Object : access Widget_TypeTo API docTo spec'Class;

1474.              Name   : Glib.Signal_NameTo API docTo spec) renames Internal_Cb.Emit_By_NameTo API docTo spec;

1476.           procedure Emit_By_Name

1477.             (Object : access Widget_TypeTo API docTo spec'Class;

1478.              Name   : Glib.Signal_NameTo API docTo spec;

1479.              Param  : Gtk.Notebook.Gtk_Notebook_PageTo API docTo spec)

1480.              renames Internal_Cb.Emit_By_NameTo API docTo spec;

1482.        end User_Callback_With_SetupTo API docTo specTo body;

1484.        ------------------------------------------------------------------

1485.        --  General functions

1486.        ------------------------------------------------------------------

1488.        procedure Add_WatchTo API docTo body

1489.          (IdTo API docTo body : Handler_IdTo API docTo spec; Object : access Glib.Object.GObject_RecordTo API docTo specTo body'Class);

1490.        --  Make sure that when Object is destroyed, the handler Id is also

1491.        --  destroyed. This function should mostly be used in cases where you use a

1492.        --  User_Data that is Object. If you don't destroy the callback at the same

1493.        --  time, then the next time the callback is called it will try to access

1494.        --  some invalid memory (Object being destroyed), and you will likely get a

1495.        --  Storage_Error.

1497.        procedure DisconnectTo API docTo body

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

1499.           IdTo API docTo body     : in out Handler_IdTo API docTo spec);

1500.        --  Disconnect the handler identified by the given Handler_Id.

1502.        procedure Emit_Stop_By_NameTo API docTo body

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

1504.           Name   : Glib.Signal_NameTo API docTo spec);

1505.        --  During a signal emission, invoking this procedure will halt the

1506.        --  emission.

1508.        procedure Handler_BlockTo API docTo body

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

1510.           IdTo API docTo body  : Handler_IdTo API docTo spec);

1511.        --  Blocks temporily the signal. For each call to this procedure,

1512.        --  a call to Handler_Unblock must be performed in order to really

1513.        --  unblock the signal.

1515.        procedure Handlers_DestroyTo API docTo body

1516.          (Obj : access Glib.Object.GObject_RecordTo API docTo specTo body'Class);

1517.        --  Destroys all the handlers associated to the given object.

1519.        procedure Handler_UnblockTo API docTo body

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

1521.           IdTo API docTo body  : Handler_IdTo API docTo spec);

1522.        --  See Handler_Block.

1524.        --  </doc_ignore>

1526.     end Gtk.HandlersTo API docTo specTo body;

1528.     --  <example>

1529.     --  --  This example connects the "delete_event" signal to a widget.

1530.     --  --  The handlers for this signal get an extra argument which is

1531.     --  --  the Gdk_Event that generated the signal.

1532.     --

1533.     --  with Gtk.Handlers;    use Gtk.Handlers;

1534.     --  with Gtk.Marshallers; use Gtk.Marshallers;

1535.     --

1536.     --  function My_Cb (Widget : access Gtk_Widget_Record'Class;

1537.     --                  Event  : Gdk.Event.Gdk_Event)

1538.     --                  return Gint;

1539.     --  --  your own function

1540.     --

1541.     --  package Return_Widget_Cb is new Gtk.Handlers.Return_Callback

1542.     --     (Gtk.Widget.Gtk_Widget_Record, Gint);

1543.     --

1544.     --  Return_Widget_Cb.Connect (W, "delete_event",

1545.     --     Return_Widget_Cb.To_Marshaller (My_Cb'Access));

1546.     --

1547.     --  </example>