## 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-2008, AdaCore                   --

6.     --                                                                   --

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

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

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

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

11.     --                                                                   --

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

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

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

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

16.     --                                                                   --

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

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

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

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

21.     --                                                                   --

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

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

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

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

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

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

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

30.     --  <description>

31.     --  This package provides functions dealing with events from the window system.

32.     --  In GtkAda applications, the events are handled automatically in

33.     --  Gtk.Main.Do_Event, and passed on to the appropriate widgets, so these

34.     --  functions are rarely needed.

35.     --

36.     --  !! Warning !! This is one of the only package that requires manual

37.     --  memory management in some cases. If you use the function Allocate,

38.     --  you have to use the function Free too...

39.     --  </description>

40.     --  <c_version>1.3.6</c_version>

41.     --  <group>Gdk, the low-level API</group>

43.     with System;

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

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

46.     pragma Elaborate_All (Glib.Generic_PropertiesTo API docTo specTo body);

47.     with Glib.ValuesTo API docTo specTo body;

48.     with Gdk.RectangleTo API docTo specTo body;

49.     with Gdk.RegionTo API docTo specTo body;

50.     with Gdk.TypesTo API docTo spec;

52.     package Gdk.EventTo API docTo specTo body is

54.        -----------------------------

55.        -- Definition of the types --

56.        -----------------------------

58.        type Gdk_Event_Type is

59.          (Nothing,

60.           --  No event occurred.

62.           Delete,

63.           --  A window delete event was sent by the window manager. The specified

64.           --  window should be deleted.

66.           Destroy,

67.           --  A window has been destroyed.

69.           Expose,

70.           --  Part of a window has been uncovered.

72.           Motion_Notify,

73.           Button_Press,

74.           --  A mouse button was pressed.

76.           Gdk_2button_Press,

77.           --  Double-click

79.           Gdk_3button_Press,

80.           --  Triple-click

82.           Button_Release,

83.           --  A mouse button was released.

85.           Key_Press,

86.           --  A key was pressed.

88.           Key_Release,

89.           --  A key was released.

91.           Enter_Notify,

92.           --  A window was entered.

94.           Leave_Notify,

95.           --  A window was exited.

97.           Focus_Change,

98.           --  The focus window has changed. (The focus window gets keyboard events)

100.           Configure,

101.           Map,

102.           --  A window has been mapped. (It is now visible on the screen).

104.           Unmap,

105.           --  A window has been unmapped. (It is no longer visible on the screen).

107.           Property_Notify,

108.           Selection_Clear,

109.           Selection_Request,

110.           Selection_Notify,

111.           Proximity_In,

112.           Proximity_Out,

113.           Drag_Enter,

114.           Drag_Leave,

115.           Drag_Motion,

116.           Drag_Status,

117.           Drop_Start,

118.           Drop_Finished,

119.           Client_Event,

120.           Visibility_Notify,

121.           No_Expose,

122.           Scroll,

123.           --  A mouse wheel was scrolled either up or down.

125.           Window_State,

126.           Setting,

128.           Owner_Change,

129.           --  Emitted when the owner of a selection has changed

130.           --  Added in gtk+ 2.6

131.           --  See Gdk.Display.Supports_Selection_Notification

133.           Grab_Broken

134.           --  A pointer or keyboard grab was broken

135.           --  Added in gtk+ 2.8

136.           );

137.        pragma Convention (CTo API docTo spec, Gdk_Event_TypeTo API docTo spec);

139.        type Gdk_Event_Mask is mod 2 ** 32;

140.        --  Note that you need to change the event mask of a widget if you want

141.        --  to be able to get some events. To change this mask, the widget

142.        --  must first be Unrealized.

144.        Exposure_Mask            : constant Gdk_Event_MaskTo API docTo spec := 2 ** 1;

146.        Pointer_Motion_Mask      : constant Gdk_Event_MaskTo API docTo spec := 2 ** 2;

147.        --  Every time the mouse moves, GtkAda will send a Motion_Notify event.

148.        --  These events will be sent as fast as possible, and your application

149.        --  needs to be able to respond as fast as possible (generally about

150.        --  200 events per second).

152.        Pointer_Motion_Hint_Mask : constant Gdk_Event_MaskTo API docTo spec := 2 ** 3;

153.        --  GtkAda will only send one Motion_Notify event when the mouse moves.

154.        --  The handler should call Gdk.Window.Get_Pointer, to get the current

155.        --  position and signals GtkAda that it is ready to get another

156.        --  Motion_Notify signal. No new Motion_Notify will be sent until

157.        --  Get_Pointer has been called.

159.        Button_Motion_Mask       : constant Gdk_Event_MaskTo API docTo spec := 2 ** 4;

160.        Button1_Motion_Mask      : constant Gdk_Event_MaskTo API docTo spec := 2 ** 5;

161.        Button2_Motion_Mask      : constant Gdk_Event_MaskTo API docTo spec := 2 ** 6;

162.        Button3_Motion_Mask      : constant Gdk_Event_MaskTo API docTo spec := 2 ** 7;

163.        Button_Press_Mask        : constant Gdk_Event_MaskTo API docTo spec := 2 ** 8;

164.        Button_Release_Mask      : constant Gdk_Event_MaskTo API docTo spec := 2 ** 9;

165.        Key_Press_Mask           : constant Gdk_Event_MaskTo API docTo spec := 2 ** 10;

166.        Key_Release_Mask         : constant Gdk_Event_MaskTo API docTo spec := 2 ** 11;

167.        Enter_Notify_Mask        : constant Gdk_Event_MaskTo API docTo spec := 2 ** 12;

168.        Leave_Notify_Mask        : constant Gdk_Event_MaskTo API docTo spec := 2 ** 13;

169.        Focus_Change_Mask        : constant Gdk_Event_MaskTo API docTo spec := 2 ** 14;

170.        Structure_Mask           : constant Gdk_Event_MaskTo API docTo spec := 2 ** 15;

171.        Property_Change_Mask     : constant Gdk_Event_MaskTo API docTo spec := 2 ** 16;

172.        Visibility_Notify_Mask   : constant Gdk_Event_MaskTo API docTo spec := 2 ** 17;

173.        Proximity_In_Mask        : constant Gdk_Event_MaskTo API docTo spec := 2 ** 18;

174.        Proximity_Out_Mask       : constant Gdk_Event_MaskTo API docTo spec := 2 ** 19;

175.        Substructure_Mask        : constant Gdk_Event_MaskTo API docTo spec := 2 ** 20;

176.        Scroll_Mask              : constant Gdk_Event_MaskTo API docTo spec := 2 ** 21;

177.        All_Events_Mask          : constant Gdk_Event_MaskTo API docTo spec := 16#3FFFFE#;

179.        type Gdk_Visibility_State is

180.          (Visibility_Unobscured,

181.           Visibility_Partial,

182.           Visibility_Fully_Obscured);

183.        pragma Convention (CTo API docTo spec, Gdk_Visibility_StateTo API docTo spec);

185.        type Gdk_Scroll_Direction is

186.          (Scroll_Up,

187.           Scroll_Down,

188.           Scroll_Left,

189.           Scroll_Right);

190.        pragma Convention (CTo API docTo spec, Gdk_Scroll_DirectionTo API docTo spec);

192.        type Gdk_Notify_Type is

193.          (Notify_Ancestor,

194.           Notify_Virtual,

195.           Notify_Inferior,

196.           Notify_Non_Linear,

197.           Notify_Non_Linear_Virtual,

198.           Notify_Unknown);

199.        pragma Convention (CTo API docTo spec, Gdk_Notify_TypeTo API docTo spec);

201.        type Gdk_Crossing_Mode is (Crossing_Normal, Crossing_Grab, Crossing_Ungrab);

202.        pragma Convention (CTo API docTo spec, Gdk_Crossing_ModeTo API docTo spec);

204.        type Gdk_Property_State is (Property_New_Value, Property_Delete);

205.        pragma Convention (CTo API docTo spec, Gdk_Property_StateTo API docTo spec);

207.        type Gdk_Window_State is mod 2 ** 32;

208.        --  State of a Window. Default is 0.

210.        Window_State_Withdraw  : constant Gdk_Window_StateTo API docTo spec := 2 ** 0;

212.        Window_State_Iconified : constant Gdk_Window_StateTo API docTo spec := 2 ** 1;

213.        --  Window is iconified on the desktop

215.        Window_State_Maximized : constant Gdk_Window_StateTo API docTo spec := 2 ** 2;

216.        --  Window is maximized on the desktop

218.        Window_State_Sticky    : constant Gdk_Window_StateTo API docTo spec := 2 ** 3;

220.        type Gdk_Setting_Action is

221.          (Setting_Action_New,

222.           Setting_Action_Changed,

223.           Setting_Action_Deleted);

224.        pragma Convention (CTo API docTo spec, Gdk_Setting_ActionTo API docTo spec);

226.        type Gdk_Device_Id is new Guint32To API docTo spec;

227.        --  This type is specific to GtkAda. In Gdk, guint32 is used instead.

229.        type Gdk_Event is new Gdk.C_ProxyTo API docTo spec;

231.        subtype Gdk_Event_Any is Gdk_EventTo API docTo spec;

232.        --  Change from GtkAda1.2.3: There is no longer a tagged type

233.        --  hierarchy, only one type.

234.        --  However there are now a few runtime tests for each of the

235.        --  function, to check whether a given field is available or not.

236.        --

237.        --  Fields common to all events: Window, Send_Event, Event_Type

239.        subtype Gdk_Event_Expose is Gdk_EventTo API docTo spec;

240.        --  The window needs to be redrawn. For efficiency, gtk gives you the

241.        --  smallest area that you need to redraw.

242.        --  Relevant fields: Area, Region, Count

243.        --  Type: Expose

245.        subtype Gdk_Event_No_Expose is Gdk_EventTo API docTo spec;

246.        --  Indicate that the source region was completely available when parts of

247.        --  a drawable were copied.

248.        --  This is also emitted when a gc whose "exposures" attribute is set to

249.        --  False in a call to Copy_Area or Draw_Pixmap. See the documentation for

250.        --  Gdk.GC.Set_Exposures.

251.        --  No Relevent fields except the common ones

252.        --  Type: No_Expose

254.        subtype Gdk_Event_Visibility is Gdk_EventTo API docTo spec;

255.        --  The visibility state of the window (partially visibly, fully visible,

256.        --  hidden). This event almost never need to be used, since other events

257.        --  are generated at the same time, like expose_events

258.        --  Relevant fields: Visibility_State

259.        --  type: Visibility_Notify

261.        subtype Gdk_Event_Motion is Gdk_EventTo API docTo spec;

262.        --  The mouse has moved

263.        --  Relevant fields: Time, X, Y, Axes, State, Is_Hint, Device_Id,

264.        --  X_Root, Y_Root

265.        --  Type: Motion_Notify

267.        subtype Gdk_Event_Button is Gdk_EventTo API docTo spec;

268.        --  A button was pressed or released.

269.        --  Relevant fields: Time, X, Y, Axes, State, Button, Device_Id,

270.        --  X_Root, Y_Root, Window.

271.        --  Type: Button_Press, Gdk_2Button_Press, Gdk_3Button_Press or

272.        --  Button_Release.

274.        subtype Gdk_Event_Scroll is Gdk_EventTo API docTo spec;

275.        --  A button was pressed or released.

276.        --  Relevant fields: Time, X, Y, State, Direction, Device_Id, X_Root, Y_Root

277.        --  Type: Scroll

279.        subtype Gdk_Event_Key is Gdk_EventTo API docTo spec;

280.        --  A keyboard key was pressed

281.        --  Relevant fields: Time, State, Key_Val, String, Hardware_Keycode, Group

282.        --  Type: Key_Press, Key_Release

284.        subtype Gdk_Event_Crossing is Gdk_EventTo API docTo spec;

285.        --  The mouse has been moved in or out of the window

286.        --  Relevant fields: SubWindow, Time, X, Y, X_Root, Y_Root, Mode,

287.        --  Detail, Focus, State

288.        --  Type: Enter_Notify, Leave_Notify

290.        subtype Gdk_Event_Focus is Gdk_EventTo API docTo spec;

291.        --  The focus has changed for a window.

292.        --  Relevant fields: in

293.        --  Type: Focus_Change

295.        subtype Gdk_Event_Configure is Gdk_EventTo API docTo spec;

296.        --  The window configuration has changed: either it was remapped,

297.        --  resized, moved, ...

298.        --  Note that you usually don't have to redraw your window when you

299.        --  receive such an event, since it is followed by an Gdk_Event_Expose.

300.        --  Relevant fields: X, Y, Width, Height

301.        --  Type: Configure

303.        subtype Gdk_Event_Property is Gdk_EventTo API docTo spec;

304.        --  Some property of the window was modified. GtkAda provides a higher

305.        --  level interface, and you almost never need to use this event.

306.        --  Relevent fields: Atom, Time, Property_State

307.        --  Type: Property_Notify

309.        subtype Gdk_Event_Selection is Gdk_EventTo API docTo spec;

310.        --  This is how X11 implements a simple cut-and-paste mechanism. However,

311.        --  GtkAda provides a higher level interface to the selection mechanism,

312.        --  so this event will almost never be used.

313.        --  Relevant fields: Selection, Target, Property, Time, Requestor

314.        --  Type: Selection_Clear, Selection_Request, Selection_Notify

316.        subtype Gdk_Event_Proximity is Gdk_EventTo API docTo spec;

317.        --  This event type will be used pretty rarely. It only is

318.        --  important for XInput aware programs that are drawing their own

319.        --  cursor. This is only used with non standard input devices, like

320.        --  graphic tablets.

321.        --  Relevant fields: Time, Device_Id

322.        --  Type: Proximity_In, Proximity_Out

324.        subtype Gdk_Event_Client is Gdk_EventTo API docTo spec;

325.        --  This is an event used to send arbitrary data from one X application

326.        --  to another. This event too is almost never used, and is not documented

327.        --  here. Please consult an X11 documentation for more information.

328.        --  Relevant fields: Message_Type, Data

329.        --  Type: Client_Event

331.        subtype Gdk_Event_Setting is Gdk_EventTo API docTo spec;

332.        --  ???

333.        --  Relevant fields: Action, Name.

334.        --  Type: ???

336.        subtype Gdk_Event_Window_State is Gdk_EventTo API docTo spec;

337.        --  ???

338.        --  Relevant fields: Changed_Mask, New_Window_State.

339.        --  Type: Delete, Destroy, Map, Unmap ???

341.        subtype Gdk_Event_DND is Gdk_EventTo API docTo spec;

342.        --  ???

343.        --  Relevant fields: Context, Time, X_Root, Y_Root

344.        --  Type: Drag_Enter, Drag_Leave, Drag_Motion, Drag_Status, Drop_Start,

345.        --  Drop_Finished

347.        ----------------------------------------

348.        -- Specific definition for the fields --

349.        ----------------------------------------

351.        type Gdk_Event_Client_Data_Format is

352.          (Char_Array, Short_Array, Long_Array);

353.        for Gdk_Event_Client_Data_FormatTo API docTo spec use

354.          (Char_Array  => 8, Short_Array => 16, Long_Array  => 32);

355.        --  Values extracted from the XClientMessageEvent man page.

357.        Number_Of_Characters : constant := 20;

358.        Number_Of_Shorts     : constant := 10;

359.        Number_Of_Longs      : constant := 5;

361.        type Gdk_Event_Client_Data

362.          (Format : Gdk_Event_Client_Data_FormatTo API docTo spec) is

363.        record

364.           case Format is

365.              when Char_Array =>

366.                 B : String (1 .. Number_Of_CharactersTo API docTo spec);

367.              when Short_Array =>

368.                 S : Gshort_ArrayTo API docTo spec (1 .. Number_Of_ShortsTo API docTo spec);

369.              when Long_Array =>

370.                 L : Glong_ArrayTo API docTo spec (1 .. Number_Of_LongsTo API docTo spec);

371.           end case;

372.        end record;

374.        -----------------------------------

375.        -- Access to fields of the event --

376.        -----------------------------------

377.        --  The following functions can be used to retrieve some specific fields

378.        --  from an event. Some of these fields do not exist for all the types of

379.        --  events (see the description of each event for a list of the relevant

380.        --  fields).

381.        --  Note also that you can not pass a null event to them. The parameter must

382.        --  be a correct event, or the result is undefined.

384.        Invalid_Field : exception;

385.        --  If a field does not exist for the event you gave, an exception

386.        --  Invalid_Field is raised

388.        function Get_Event_TypeTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk_Event_TypeTo API docTo spec;

389.        --  The type of the event.

391.        function Get_Send_EventTo API docTo body (Event : Gdk_EventTo API docTo spec) return Boolean;

392.        --  Set to true if the event was generated by the application, False

393.        --  if generated by the X server/Win32.

395.        function Get_WindowTo API docTo body    (Event : Gdk_EventTo API docTo spec) return Gdk.Gdk_WindowTo API docTo spec;

396.        --  The window the event occured on.

397.        --  See the function Gdk.Window.Get_User_Data to get the actual widget.

399.        function Get_TimeTo API docTo body      (Event : Gdk_EventTo API docTo spec) return Guint32To API docTo spec;

400.        --  Time when the event occured.

402.        function Get_XTo API docTo body         (Event : Gdk_EventTo API docTo spec) return GdoubleTo API docTo spec;

403.        --  Horizontal coordinate of the mouse when the event occured.

404.        --  The coordinates are relative to the parent window.

406.        function Get_YTo API docTo body         (Event : Gdk_EventTo API docTo spec) return GdoubleTo API docTo spec;

407.        --  Vertical coordinate of the mouse when the event occured.

408.        --  The coordinates are relative to the parent window.

410.        function Get_X_RootTo API docTo body    (Event : Gdk_EventTo API docTo spec) return GdoubleTo API docTo spec;

411.        --  Horizontal coordinate of the mouse when the event occured.

412.        --  Relative to the root window.

414.        function Get_Y_RootTo API docTo body    (Event : Gdk_EventTo API docTo spec) return GdoubleTo API docTo spec;

415.        --  Vertical coordinate of the mouse when the event occured.

416.        --  Relative to the root window.

418.        function Get_ButtonTo API docTo body    (Event : Gdk_EventTo API docTo spec) return GuintTo API docTo spec;

419.        --  Number of the button that was pressed.

421.        function Get_StateTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_Modifier_TypeTo API docTo spec;

422.        --  State of the mouse buttons and keyboard keys just prior to the event.

424.        function Get_SubwindowTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Gdk_WindowTo API docTo spec;

425.        --  Child window for the event.

426.        --  For an Enter_Notify_Event, this is set to the initial window for the

427.        --  pointer; for an Leave_Notify_Event this is set to the window occupied

428.        --  by the pointer in its last position.

430.        function Get_ModeTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk_Crossing_ModeTo API docTo spec;

431.        --  Return the mode of an Event.

432.        --  Set to indicate whether the events are normal events, pseudo-motion

433.        --  events when a grab activates or pseudo-motion events when a grab

434.        --  deativates.

436.        function Get_DetailTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk_Notify_TypeTo API docTo spec;

437.        --  Set to indicate the notify details.

438.        --  Most applications can ignore events with a Notify Virtual or a

439.        --  Notify_Non_Linear_Virtual detail.

441.        function Get_FocusTo API docTo body (Event : Gdk_EventTo API docTo spec) return Boolean;

442.        --  Set to true if the window for the event is the focus window.

444.        function Get_WidthTo API docTo body (Event : Gdk_EventTo API docTo spec) return GintTo API docTo spec;

445.        --  Get the width in a configure event.

447.        function Get_HeightTo API docTo body (Event : Gdk_EventTo API docTo spec) return GintTo API docTo spec;

448.        --  Get the height in a configure event.

450.        function Get_DirectionTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk_Scroll_DirectionTo API docTo spec;

451.        --  Get the direction in a scroll event.

453.        function Get_Device_IdTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk_Device_IdTo API docTo spec;

454.        --  Set to a constant for now in the gtk+ source... Probably useless.

455.        --  Since multiple input devices can be used at the same time, like a mouse

456.        --  and a graphic tablet, this indicates which one generated the event.

458.        function Get_AreaTo API docTo body (Event : Gdk_EventTo API docTo spec) return Rectangle.Gdk_RectangleTo API docTo spec;

459.        --  The minimal area on which the event applies.

460.        --  For Expose_Events, this is the minimal area to redraw.

462.        function Get_RegionTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Region.Gdk_RegionTo API docTo spec;

463.        --  Return the region to which the event applies.

464.        --  Do not free the returned value

466.        function Get_CountTo API docTo body (Event : Gdk_EventTo API docTo spec) return GintTo API docTo spec;

467.        --  Number of Expose_Events that are to follow this one.

468.        --  Most applications can ignore the event if Count is not 0, which also

469.        --  allows for optimizations.

471.        function Get_InTo API docTo body (Event : Gdk_EventTo API docTo spec) return Boolean;

472.        --  True if the window has gained the focus, False otherwise.

474.        function Get_Is_HintTo API docTo body (Event : Gdk_EventTo API docTo spec) return Boolean;

475.        --  ???

477.        function Get_Key_ValTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_Key_TypeTo API docTo spec;

478.        --  Code of the key that was pressed (and that generated the event).

480.        function Get_GroupTo API docTo body (Event : Gdk_EventTo API docTo spec) return Guint8To API docTo spec;

481.        --  Group of the key that was pressed;

483.        function Get_Hardware_KeycodeTo API docTo body (Event : Gdk_EventTo API docTo spec) return Guint16To API docTo spec;

484.        --  Hardware key code of the key that was pressed.

486.        function Get_StringTo API docTo body  (Event : Gdk_EventTo API docTo spec) return String;

487.        --  Symbol of the key that was pressed, as a string.

489.        function Get_AtomTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

490.        --  Indicate which property has changed.

491.        --  ??? Atom should not be a Guint

493.        function Get_Property_StateTo API docTo body (Event : Gdk_EventTo API docTo spec) return GuintTo API docTo spec;

494.        --  ??? The return type should be changed.

496.        function Get_Visibility_StateTo API docTo body

497.          (Event : Gdk_EventTo API docTo spec) return Gdk_Visibility_StateTo API docTo spec;

498.        --  Return the new visibility state for the window.

500.        function Get_SelectionTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

501.        --  What was selected in the window...

503.        function Get_TargetTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

504.        --  ???

506.        function Get_PropertyTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

507.        --  ???

509.        function Get_RequestorTo API docTo body (Event : Gdk_EventTo API docTo spec) return Guint32To API docTo spec;

510.        --  ???

512.        function Get_Message_TypeTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

513.        --  ???

515.        function Get_DataTo API docTo body (Event : Gdk_EventTo API docTo spec) return Gdk_Event_Client_DataTo API docTo spec;

516.        --  ???

518.        --------------------------------------

519.        -- Modifying the fields of an event --

520.        --------------------------------------

522.        procedure Set_WindowTo API docTo body (Event : Gdk_EventTo API docTo spec; Win : Gdk.Gdk_WindowTo API docTo spec);

523.        --  Set the Window field of an event.

525.        procedure Set_XTo API docTo body      (Event : Gdk_EventTo API docTo spec; X : GdoubleTo API docTo spec);

526.        --  Set the X field of an event.

528.        procedure Set_YTo API docTo body      (Event : Gdk_EventTo API docTo spec; Y : GdoubleTo API docTo spec);

529.        --  Set the Y field of an event.

531.        procedure Set_XrootTo API docTo body  (Event : Gdk_EventTo API docTo spec; Xroot : GdoubleTo API docTo spec);

532.        --  Set the Xroot field of an event.

534.        procedure Set_YrootTo API docTo body  (Event : Gdk_EventTo API docTo spec; Yroot : GdoubleTo API docTo spec);

535.        --  Set the Yroot field of an event.

537.        procedure Set_WidthTo API docTo body  (Event : Gdk_EventTo API docTo spec; Width : GintTo API docTo spec);

538.        --  Set the Width field of an event.

540.        procedure Set_HeightTo API docTo body (Event : Gdk_EventTo API docTo spec; Height : GintTo API docTo spec);

541.        --  Set the Height field of an event.

543.        procedure Set_ButtonTo API docTo body (Event : Gdk_EventTo API docTo spec; Button : GuintTo API docTo spec);

544.        --  Set the Button field of an event.

546.        procedure Set_TimeTo API docTo body (Event : Gdk_EventTo API docTo spec; Time : Guint32To API docTo spec);

547.        --  Set the time for the event.

548.        --  If Time is 0, then it is set to the current time.

550.        procedure Set_StateTo API docTo body

551.          (Event : Gdk_EventTo API docTo spec; State : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec);

552.        --  Set the State field of an event.

554.        procedure Set_SubwindowTo API docTo body (Event : Gdk_EventTo API docTo spec; Window : Gdk.Gdk_WindowTo API docTo spec);

555.        --  Set the Subwindow field of an event.

557.        procedure Set_ModeTo API docTo body (Event : Gdk_EventTo API docTo spec; ModeTo API docTo body : Gdk_Crossing_ModeTo API docTo spec);

558.        --  Set the Mode field of an event.

560.        procedure Set_DetailTo API docTo body (Event : Gdk_EventTo API docTo spec; DetailTo API docTo body : Gdk_Notify_TypeTo API docTo spec);

561.        --  Set the Detail field of an event.

563.        procedure Set_FocusTo API docTo body (Event : Gdk_EventTo API docTo spec; Has_Focus : Boolean);

564.        --  Set the Focus field of an event.

566.        procedure Set_AreaTo API docTo body  (Event : Gdk_EventTo API docTo spec; AreaTo API docTo body : Rectangle.Gdk_RectangleTo API docTo spec);

567.        --  Set the Area field of an event.

569.        procedure Set_InTo API docTo body    (Event : Gdk_EventTo API docTo spec; Focus_In : Boolean);

570.        --  Set the In field of an event.

572.        procedure Set_Is_HintTo API docTo body (Event : Gdk_EventTo API docTo spec; Is_Hint : Boolean);

573.        --  Set the Is_Hint field of an event.

575.        procedure Set_Key_ValTo API docTo body (Event : Gdk_EventTo API docTo spec; Key : Gdk.Types.Gdk_Key_TypeTo API docTo spec);

576.        --  Set the Key_Val field of an event.

578.        procedure Set_GroupTo API docTo body (Event : Gdk_EventTo API docTo spec; Group : Guint8To API docTo spec);

579.        --  Set the group field of a key event.

581.        procedure Set_Hardware_KeycodeTo API docTo body (Event : Gdk_EventTo API docTo spec; Keycode : Guint16To API docTo spec);

582.        --  Set the hardware key code field of a key event.

584.        procedure Set_DirectionTo API docTo body

585.          (Event : Gdk_EventTo API docTo spec; DirectionTo API docTo body : Gdk_Scroll_DirectionTo API docTo spec);

586.        --  Set the direction field of a scroll event.

588.        procedure Set_AtomTo API docTo body (Event : Gdk_EventTo API docTo spec; Atom : Gdk.Types.Gdk_AtomTo API docTo spec);

589.        --  Set the Atom field of an event.

591.        procedure Set_Property_StateTo API docTo body (Event : Gdk_EventTo API docTo spec; State : GuintTo API docTo spec);

592.        --  Set the Property_State field of an event.

594.        procedure Set_Visibility_StateTo API docTo body

595.          (Event : Gdk_EventTo API docTo spec; StateTo API docTo body : Gdk_Visibility_StateTo API docTo spec);

596.        --  Set the Visibility_State field of an event.

598.        procedure Set_SelectionTo API docTo body (Event : Gdk_EventTo API docTo spec; Selection : Gdk.Types.Gdk_AtomTo API docTo spec);

599.        --  Set the Selection field of an event.

601.        procedure Set_TargetTo API docTo body (Event : Gdk_EventTo API docTo spec; Target : Gdk.Types.Gdk_AtomTo API docTo spec);

602.        --  Set the Target field of an event.

604.        procedure Set_PropertyTo API docTo body (Event : Gdk_EventTo API docTo spec; Property : Gdk.Types.Gdk_AtomTo API docTo spec);

605.        --  Set the Property field of an event.

607.        procedure Set_RequestorTo API docTo body (Event : Gdk_EventTo API docTo spec; Requestor : Guint32To API docTo spec);

608.        --  Set the Requestor field of an event.

610.        procedure Set_Message_TypeTo API docTo body (Event : Gdk_EventTo API docTo spec; Typ : Gdk.Types.Gdk_AtomTo API docTo spec);

611.        --  Set the Message_Type field of an event.

613.        procedure Set_StringTo API docTo body (Event : Gdk_EventTo API docTo spec; Str : String);

614.        --  Set the string associated with an event.

616.        -----------------------

617.        -- General functions --

618.        -----------------------

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

621.        --  Return the type corresponding to a Gdk_Event.

623.        procedure Deep_CopyTo API docTo body (From : Gdk_EventTo API docTo spec; To : out Gdk_EventTo API docTo spec);

624.        --  Deep copy for an event. The C structure is itself duplicated.

625.        --  You need to deallocated it yourself with a call to Free below.

627.        procedure Get_Graphics_ExposeTo API docTo body

628.          (Event  : out Gdk_Event_ExposeTo API docTo spec;

629.           Window : Gdk.Gdk_WindowTo API docTo spec);

630.        --  Waits for a GraphicsExpose or NoExpose event

631.        --  If it gets a GraphicsExpose event, it returns a pointer to it,

632.        --  otherwise it returns an event for which Is_Created is False.

633.        --

634.        --  This function can be used to implement scrolling: you must call

635.        --  Gdk.GC.Set_Exposures with True on the GC you are using for the

636.        --  drawing, so that a events are generated for obscured areas and every

637.        --  time a new part of the widget is drawn. However, there is a race

638.        --  condition if multiple scrolls happen before you have finished

639.        --  processing the first one. A workaround is to call Get_Graphics_Expose

640.        --  after every scroll until it returns a null event.

642.        function Events_PendingTo API docTo body return Boolean;

643.        --  Is there any event pending on the queue ?

645.        procedure GetTo API docTo body (Event : out Gdk_EventTo API docTo spec);

646.        --  Get the next event on the queue.

648.        procedure PeekTo API docTo body (Event : out Gdk_EventTo API docTo spec);

649.        --  Look at the next event on the queue, but leave if there.

651.        procedure PutTo API docTo body (Event : Gdk_EventTo API docTo spec);

652.        --  Add an event on the queue - Better to use Gtk.Signal.Emit_By_Name

654.        procedure Set_Show_EventsTo API docTo body (Show_Events : Boolean := True);

655.        --  For debug purposes, you can choose whether you want to see the events

656.        --  GtkAda receives.

658.        function Get_Show_EventsTo API docTo body return Boolean;

659.        --  Return the current state of Show_Events.

661.        procedure Send_Client_Message_To_AllTo API docTo body (Event : Gdk_EventTo API docTo spec);

662.        --  Low level routine to send an Event to every window.

664.        function Send_Client_MessageTo API docTo body

665.          (Event : Gdk_EventTo API docTo spec;

666.           Xid   : Guint32To API docTo spec) return Boolean;

667.        --  Low level routine to send an Event to a specified X window.

669.        procedure AllocateTo API docTo body

670.          (Event      : out Gdk_EventTo API docTo spec;

671.           Event_TypeTo API docTo body : Gdk_Event_TypeTo API docTo spec;

672.           Window     : Gdk.Gdk_WindowTo API docTo spec);

673.        --  Create an event, whose fields are uninitialized.

674.        --  You need to use the function Set_* above to modify them, before you can

675.        --  send the event with Emit_By_Name.

676.        --  !!Note!!: The event has to be freed if you have called this function.

677.        --  Use the function Free below.

679.        procedure FreeTo API docTo body (Event : in out Gdk_EventTo API docTo spec);

680.        --  Free the memory (and C structure) associated with an event.

681.        --  You need to call this function only if the event was created through

682.        --  Allocate, not if it was created by GtkAda itself (or you would get

683.        --  a segmentation fault).

685.        type Event_Handler_Func is access procedure

686.          (Event : Gdk_EventTo API docTo spec; Data : System.Address);

687.        pragma Convention (CTo API docTo spec, Event_Handler_FuncTo API docTo spec);

688.        --  Function that can be used as a new event handler.

689.        --  This function should dispatch all the events properly, since it replaces

690.        --  completly the default event handler. However, it can call

691.        --  Gtk.Main.Do_Event to take care of the events it does not know how to

692.        --  handle.

693.        --  See also Gtk.Main.Get_Event_Widget to get the widget from the event.

695.        procedure Event_Handler_SetTo API docTo body

696.          (Func : Event_Handler_FuncTo API docTo spec; Data : System.Address);

697.        --  Set up a new event handler.

698.        --  This handler replaces the default GtkAda event handler, and thus should

699.        --  make sure that all events are correctly handled.

700.        --

701.        --  Note that managing the memory for Data is your responsability, and

702.        --  Data is passed as is to Func.

704.        function From_AddressTo API docTo body (C : System.Address) return Gdk_EventTo API docTo spec;

705.        --  Convert a C handler to the matching Event structure.

707.        function To_AddressTo API docTo body (C : Gdk_EventTo API docTo spec) return System.Address;

708.        --  Convert an event to the underlying C handler.

710.        function Is_CreatedTo API docTo body (E : Gdk_EventTo API docTo spec) return Boolean;

711.        --  Return True if the underlying C event has been created.

713.        --------------------

714.        -- GValue support --

715.        --------------------

717.        function Get_EventTo API docTo body (ValueTo API docTo body : Glib.Values.GValueTo API docTo specTo body) return Gdk_EventTo API docTo spec;

718.        --  Convert a value into a Gdk_Event.

720.        ----------------

721.        -- Properties --

722.        ----------------

723.        --  The following packages and types are used to represent properties of

724.        --  the given type. They are used in the packages that use these properties

726.        package Event_Mask_Properties is new Generic_Internal_Discrete_PropertyTo API docTo specTo body

727.          (Gdk_Event_MaskTo API docTo spec);

729.        type Property_Gdk_Event_Mask is new Event_Mask_Properties.PropertyTo API docTo spec;

731.        -------------------

732.        -- Design issues --

733.        -------------------

734.        --  See gdk-event.adb for some of the design issues behing that package.

736.        ---------------------

737.        -- Event Recording --

738.        ---------------------

740.        procedure Set_Follow_EventsTo API docTo body (Follow_Events : Boolean := True);

741.        --  Set whether windows should follow events that they normally don't

742.        --  (such as motion events) for event recording purposes.

743.        --  This function is used in cunjonction with GtkAda.Macro

745.        function Get_Follow_EventsTo API docTo body return Boolean;

746.        --  Return follow_events value.

747.        --  See Set_Follow_Events for more details.

749.     private

751.        for Gdk_Event_TypeTo API docTo spec use

752.          (Nothing => -1,

753.           Delete => 0,

754.           Destroy => 1,

755.           Expose => 2,

756.           Motion_Notify => 3,

757.           Button_Press => 4,

758.           Gdk_2button_Press => 5,

759.           Gdk_3button_Press => 6,

760.           Button_Release => 7,

761.           Key_Press => 8,

762.           Key_Release => 9,

763.           Enter_Notify => 10,

764.           Leave_Notify => 11,

765.           Focus_Change => 12,

766.           Configure => 13,

767.           Map => 14,

768.           Unmap => 15,

769.           Property_Notify => 16,

770.           Selection_Clear => 17,

771.           Selection_Request => 18,

772.           Selection_Notify => 19,

773.           Proximity_In => 20,

774.           Proximity_Out => 21,

775.           Drag_Enter => 22,

776.           Drag_Leave => 23,

777.           Drag_Motion => 24,

778.           Drag_Status => 25,

779.           Drop_Start => 26,

780.           Drop_Finished => 27,

781.           Client_Event => 28,

782.           Visibility_Notify => 29,

783.           No_Expose => 30,

784.           Scroll => 31,

785.           Window_State => 32,

786.           Setting => 33,

787.           Owner_Change => 34,

788.           Grab_Broken => 35);

790.        pragma Import (CTo API docTo spec, Get_TypeTo API docTo spec, "gdk_event_get_type");

791.        pragma Import (CTo API docTo spec, Get_Event_TypeTo API docTo spec, "ada_gdk_event_get_type");

792.        pragma Import (CTo API docTo spec, Get_WindowTo API docTo spec, "ada_gdk_event_get_window");

793.        pragma Import (CTo API docTo spec, Get_TimeTo API docTo spec, "gdk_event_get_time");

794.        pragma Import (CTo API docTo spec, PutTo API docTo spec, "gdk_event_put");

795.        pragma Import (CTo API docTo spec, Get_RegionTo API docTo spec, "ada_gdk_event_get_region");

796.        pragma Import

797.          (CTo API docTo spec, Send_Client_Message_To_AllTo API docTo spec, "gdk_event_send_clientmessage_toall");

798.        pragma Import (CTo API docTo spec, Set_WindowTo API docTo spec, "ada_gdk_event_set_window");

800.     end Gdk.EventTo API docTo specTo body;