## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --                 Copyright (C) 2001-2011, AdaCore                  --

5.     --                                                                   --

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

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

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

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

10.     --                                                                   --

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

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

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

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

15.     --                                                                   --

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

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

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

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

20.     --                                                                   --

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

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

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

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

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

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

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

29.     --  <description>

30.     --  This widget organizes its children into resizable panes. Within each

31.     --  pane, multiple children can be put, and they will be accessible through

32.     --  a notebook.

33.     --  </description>

34.     --  <group>Layout containers</group>

36.     with Ada.Tags;

37.     with GNAT.Strings;

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

39.     with Glib.MainTo API docTo specTo body;

40.     with Glib.Xml_IntTo API docTo spec;

41.     with Gdk.ColorTo API docTo specTo body;

42.     with Gdk.CursorTo API docTo specTo body;

43.     with Gdk.EventTo API docTo specTo body;

44.     with Gdk.PixbufTo API docTo specTo body;

45.     with Gdk.RectangleTo API docTo specTo body;

46.     with Gtk.Accel_GroupTo API docTo specTo body;

47.     with Gtk.BoxTo API docTo specTo body;

48.     with Gtk.EnumsTo API docTo specTo body;

49.     with Gtk.Event_BoxTo API docTo specTo body;

50.     with Gtk.HandlersTo API docTo specTo body;

51.     with Gtk.LabelTo API docTo specTo body;

52.     with Gtk.MenuTo API docTo specTo body;

53.     with Gtk.Menu_ItemTo API docTo specTo body;

54.     with Gtk.NotebookTo API docTo specTo body;

55.     with Gtk.StyleTo API docTo specTo body;

56.     with Gtk.Check_Menu_ItemTo API docTo specTo body;

57.     with Gtk.Radio_Menu_ItemTo API docTo specTo body;

58.     with Gtk.WidgetTo API docTo specTo body;

59.     with Gtk.WindowTo API docTo specTo body;

60.     with Gtkada.HandlersTo API docTo spec;

61.     with Gtkada.Multi_PanedTo API docTo specTo body;

62.     with Pango.FontTo API docTo specTo body;

63.     with Pango.LayoutTo API docTo specTo body;

65.     package Gtkada.MDITo API docTo specTo body is

67.        type MDI_Window_RecordTo API docTo body is new Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body with private;

68.        type MDI_Window is access all MDI_Window_RecordTo API docTo specTo body'Class;

69.        --  Although this widget is implemented as a gtk_layout, you shouldn't

70.        --  use the standard Gtk_Layout functions like Put and Move yourself.

72.        type MDI_Child_RecordTo API docTo body is new Gtk.Event_Box.Gtk_Event_Box_RecordTo API docTo spec

73.          with private;

74.        type MDI_Child is access all MDI_Child_RecordTo API docTo specTo body'Class;

75.        pragma No_Strict_Aliasing (MDI_ChildTo API docTo spec);

76.        --  A child of the MDI, that encapsulates the widgets you have put in the

77.        --  MDI window.

78.        --  You can easily convert from this to the initial widget using the

79.        --  functions Find_MDI_Child and Get_Widget.

81.        type MDI_Child_Array is array (Natural range <>) of MDI_ChildTo API docTo spec;

82.        No_Children : constant MDI_Child_ArrayTo API docTo spec := (1 .. 0 => null);

84.        type State_Type is (Normal, Floating, Invisible);

85.        --  This type indicates the state of an item in the MDI:

86.        --  - Normal: the item can be manipulated (moved and resized) by the user.

87.        --      It is found either in the middle notebook (maximized items), or

88.        --      in the layout.

89.        --  - Floating: the item has its own toplevel window, and is thus managed

90.        --      by the window manager.

91.        --  - Invisible: the child was part of a previously displayed perspective,

92.        --      but is no longer in the current perspective. We still keep it to

93.        --      reuse it when switching back to the previous perspective.

95.        procedure Gtk_NewTo API docTo body

96.          (MDI   : out MDI_WindowTo API docTo spec;

97.           Group : access Gtk.Accel_Group.Gtk_Accel_Group_RecordTo API docTo spec'Class;

98.           Independent_Perspectives : Boolean := False);

99.        --  Create a new MDI window.

100.        --  Note that it is recommended that you modify the style (Set_Background

101.        --  in State_Normal) to have a different color.

102.        --  You should call Setup_Toplevel_Window once you have added the MDI to a

103.        --  toplevel widget, so that focus is correctly handled when the toplevel

104.        --  window gains the focus

105.        --  When Independent_Perspectives is True, switching perspectives will not

106.        --  preserve any window. Otherwise, the windows that are in the central

107.        --  area will be preserved in the new perspective.

109.        procedure InitializeTo API docTo body

110.          (MDI   : access MDI_Window_RecordTo API docTo specTo body'Class;

111.           Group : access Gtk.Accel_Group.Gtk_Accel_Group_RecordTo API docTo spec'Class;

112.           Independent_Perspectives : Boolean := False);

113.        --  Internal initialization function.

114.        --  See the section "Creating your own widgets" in the documentation.

116.        procedure Setup_Toplevel_WindowTo API docTo body

117.          (MDI    : access MDI_Window_RecordTo API docTo specTo body;

118.           Parent : access Gtk.Window.Gtk_Window_RecordTo API docTo specTo body'Class);

119.        --  Setup Parent to properly handle focus when the window manager changes

120.        --  the window that currently has the focus.

121.        --  Parent must be the toplevel window that contains the MDI.

123.        type Show_Tabs_Policy_Enum is (Always, Never, Automatic);

124.        type Title_Bars_Policy     is (Always, Never, Central_Only);

126.        procedure ConfigureTo API docTo body

127.          (MDI                       : access MDI_Window_RecordTo API docTo specTo body;

128.           Opaque_Resize             : Boolean := False;

129.           Close_Floating_Is_Unfloat : Boolean := True;

130.           Title_Font         : Pango.Font.Pango_Font_DescriptionTo API docTo spec := null;

131.           Background_ColorTo API docTo body   : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

132.           Title_Bar_ColorTo API docTo body    : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

133.           Focus_Title_ColorTo API docTo body  : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

134.           Draw_Title_BarsTo API docTo body    : Title_Bars_PolicyTo API docTo spec   := Always;

135.           Tabs_PositionTo API docTo body      : Gtk.Enums.Gtk_Position_TypeTo API docTo spec := Gtk.Enums.Pos_Bottom;

136.           Show_Tabs_PolicyTo API docTo body   : Show_Tabs_Policy_EnumTo API docTo spec := Automatic);

137.        --  Change the setup of the MDI.

138.        --  Close_Floating_Is_Unfloat, if True, means that closing a floating child

139.        --  will put it back in the MDI instead of destroying it (unless its flag

140.        --  Always_Destroy_Float is set).

141.        --  Title_Font is the font used in the title bars (if null, "sans 8"

142.        --  is used).

143.        --  The colors, when Null_Color, will not change the current setup.

144.        --  If Draw_Title_Bars is False, then no extra title bar will be displayed

145.        --  for the MDI children when they are maximized. This saves space on the

146.        --  screen. However, the notebook tabs will be highlighted with

147.        --  Title_Bar_Color in exchange.

148.        --  Tabs_Position indicates where the notebook tabs should be put.

149.        --  Show_Tabs_Policy indicates when the notebook tabs should be displayed.

151.        function Independent_PerspectivesTo API docTo body

152.          (MDI : access MDI_Window_RecordTo API docTo specTo body) return Boolean;

153.        --  Whether the MDI is using independent perspectives

155.        -------------

156.        -- Windows --

157.        -------------

159.        type Child_Flags is mod 2 ** 5;

160.        Destroy_Button       : constant Child_FlagsTo API docTo spec := 2 ** 2;

161.        Float_As_Transient   : constant Child_FlagsTo API docTo spec := 2 ** 3;

162.        Always_Destroy_Float : constant Child_FlagsTo API docTo spec := 2 ** 4;

163.        All_Buttons          : constant Child_FlagsTo API docTo spec := Destroy_ButtonTo API docTo spec;

164.        --  Special flags to set up the widgets:

165.        --  The first is the buttons that should be displayed in the title

166.        --  bar of the MDI children.

167.        --  If Float_As_Transient is set, then the child will be set up as a

168.        --  transient window when floating: on most window managers, it will stay on

169.        --  top of the MDI, but the window will have less decorations in its title

170.        --  bar, in particular no destroy button. In such a case, <Esc> will close

171.        --  the window, or unfloat it depending on the MDI's setup, as is the case

172.        --  for all dialogs in GtkAda. The MDI's setup will be ignored (and the

173.        --  child always destroyed when Esc is pressed) if Always_Destroy_Float is

174.        --  true.

176.        type Child_Group is new Positive;

177.        Group_Default : constant Child_GroupTo API docTo spec := 1;

178.        Group_Any     : constant Child_GroupTo API docTo spec := Child_GroupTo API docTo spec'Last;

179.        --  This type can be used to help group windows by type within the MDI.

180.        --  Group_Default as a special status when computing the initial position

181.        --  for a window. But you can create your own groups as needed, so that for

182.        --  instance editors tend to be grouped with other editors, graphs with

183.        --  other graphs,... depending on your application.

184.        --  The group has an impact when the last window from a notebook is closed:

185.        --  If the window belongs to Group_Default, and it is the last of its group,

186.        --  then the space currently occupied by that window is not reclaimed, and

187.        --  therefore an empty area will exist in the MDI. The idea is that for

188.        --  instance editors typically play a special role in an integrated

189.        --  development environment, and the users like to have them in the center

190.        --  of the window. When closing the last editor, they do not want the side

191.        --  windows (browsers, consoles,...) to take up that space that should

192.        --  really only be used for editors.

193.        --  To get such a behavior, editors should belong to Group_Default, and all

194.        --  other windows to custom groups.

195.        --

196.        --  Do not use Group_Any, it is used internally with special meanings.

198.        procedure Gtk_NewTo API docTo body

199.          (Child        : out MDI_ChildTo API docTo spec;

200.           Widget       : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

201.           Flags        : Child_FlagsTo API docTo spec := All_ButtonsTo API docTo spec;

202.           Group        : Child_GroupTo API docTo spec := Group_DefaultTo API docTo spec;

203.           Focus_Widget : Gtk.Widget.Gtk_WidgetTo API docTo spec := null);

204.        --  Create a new MDI child that contains widget.

205.        --  Widget mustn't be of type Gtk_Window.

206.        --

207.        --  You shouldn't access Widget directly afterwards, but should manipulate

208.        --  Child only. However, as a special exception, you can still pass Widget

209.        --  as a parameter to the subprograms in this package to manipulate it (e.g.

210.        --  in Raise_Child, ...)

211.        --

212.        --  Note: You might have to call Set_Size_Request on Widget to set its

213.        --  initial size. This won't prevent it from being resized by the user.

214.        --

215.        --  If Focus_Widget is not null, this is the widget that gets the keyboard

216.        --  focus when the child is selected.

218.        procedure InitializeTo API docTo body

219.          (Child        : access MDI_Child_RecordTo API docTo specTo body'Class;

220.           Widget       : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

221.           Flags        : Child_FlagsTo API docTo spec := All_ButtonsTo API docTo spec;

222.           Group        : Child_GroupTo API docTo spec := Group_DefaultTo API docTo spec;

223.           Focus_Widget : Gtk.Widget.Gtk_WidgetTo API docTo spec := null);

224.        --  Internal initialization function.

225.        --  See the section "Creating your own widgets" in the documentation.

227.        type Child_Position is

228.          (Position_Automatic,

229.           Position_Bottom,

230.           Position_Top,

231.           Position_Left,

232.           Position_Right);

233.        subtype Side_Position is Child_PositionTo API docTo spec

234.           range Position_Bottom .. Position_Right;

235.        --  The initial position of windows within the MDI.

236.        --  In all cases, the initial location for a window is computed with the

237.        --  following algorithm. This algorithm is designed with the notion of

238.        --  groups of windows in mind, so that some windows (typically editors) have

239.        --  a special status.

240.        --     - If another window with the same Group is already in the MDI, the

241.        --       new window is put on top of it.

242.        --     - Otherwise, if Position_Automatic, if an empty area exists within

243.        --       the MDI, the new window is put in that area.

244.        --     - Else if the Position is Bottom .. Right, the new window is put

245.        --       below all others (resp. to the top, left or right)

246.        --     - Else the window is put on top of the currently selected window

248.        procedure PutTo API docTo body

249.          (MDI              : access MDI_Window_RecordTo API docTo specTo body;

250.           Child            : access MDI_Child_RecordTo API docTo specTo body'Class;

251.           Initial_PositionTo API docTo body : Child_PositionTo API docTo spec := Position_Automatic);

252.        --  Add a new child to the MDI window, and return its embedding widget.

253.        --  Calling Put does not give the focus to the newly inserted widget.

254.        --  To do that, you should call Set_Focus_Child.

256.        procedure Set_SizeTo API docTo body

257.          (MDI        : access MDI_Window_RecordTo API docTo specTo body;

258.           Child      : access MDI_Child_RecordTo API docTo specTo body'Class;

259.           Width      : Glib.GintTo API docTo spec;

260.           Height     : Glib.GintTo API docTo spec;

261.           Fixed_Size : Boolean := False);

262.        --  Forces a new size for a child. If Width or Height is left to -1, the

263.        --  matching size will be computed from the child's requisition. If they are

264.        --  left to 0, the corresponding length is left to its current value.

265.        --  If Fixed_Size is True, then the widget will not be resized when the MDI

266.        --  itself is resized (unless the user has first moved one of the handles to

267.        --  manually resize it). Otherwise, it will grow proportionally with the

268.        --  rest of the MDI.

270.        procedure CloseTo API docTo body

271.          (MDI   : access MDI_Window_RecordTo API docTo specTo body;

272.           Child : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

273.           Force : Boolean := False);

274.        --  Close the child that contains Child, and remove its window from the

275.        --  MDI. See also Close_Child if you need to close a MDI_Child itself.

276.        --  This first checks through a delete_event callback whether the child

277.        --  accepts to be closed.

278.        --  "delete_event" is not sent, and the child is automatically closed, if

279.        --  Force is set to True.

281.        procedure Set_TitleTo API docTo body

282.          (Child       : access MDI_Child_RecordTo API docTo specTo body;

283.           Title       : UTF8_StringTo API docTo spec;

284.           Short_Title : UTF8_StringTo API docTo spec := "");

285.        --  Set the title for a child. Title is the title put in titlebar of

286.        --  the children, whereas Short_Title is the name of the notebook tab when

287.        --  children are maximized. By default, it is the same as Title.

288.        --

289.        --  The default title is the empty string.

290.        --  This title will be the one used for the window when the child is set to

291.        --  floating state.

293.        function Get_MDITo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body) return MDI_WindowTo API docTo spec;

294.        --  Return the MDI to which Child is associated. In Child is a floating

295.        --  child, it might not be in the MDI window itself.

297.        function Get_TitleTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body) return UTF8_StringTo API docTo spec;

298.        --  Return the title for a specific child

300.        function Get_Short_TitleTo API docTo body

301.          (Child : access MDI_Child_RecordTo API docTo specTo body) return UTF8_StringTo API docTo spec;

302.        --  Return the name of the notebook tab used when children are maximized.

304.        function Has_Title_BarTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body) return Boolean;

305.        --  Whether a title bar is currently displayed for Child

307.        function Get_StateTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body) return State_TypeTo API docTo spec;

308.        --  Return the current state of the child

310.        procedure Set_IconTo API docTo body

311.          (Child : access MDI_Child_RecordTo API docTo specTo body;

312.           Icon  : Gdk.Pixbuf.Gdk_PixbufTo API docTo spec);

313.        --  Associate an icon with Child. This icon is visible in the title bar, the

314.        --  notebook tabs, the Window menu and the interactive selection dialog.

315.        --  The icon is updated dynamically on the screen.

317.        function Get_IconTo API docTo body

318.          (Child : access MDI_Child_RecordTo API docTo specTo body) return Gdk.Pixbuf.Gdk_PixbufTo API docTo spec;

319.        --  Returns the icon associated with Child

321.        ---------------------------

322.        -- Drag and Drop support --

323.        ---------------------------

325.        function Dnd_DataTo API docTo body

326.          (Child : access MDI_Child_RecordTo API docTo specTo body; Copy : Boolean) return MDI_ChildTo API docTo spec;

327.        --  When a drag-and-drop operation took place to move a child from one

328.        --  position to the next, this function is called to know what child should

329.        --  be moved.

330.        --  As a result, the implementor can choose whether a copy of the child

331.        --  should be returned (creating a new view for an editor for instance), or

332.        --  if the child itself should be moved (the default).

333.        --  The returned MDI_Child must have been added to the MDI before it is

334.        --  returned.

335.        --  Copy is set to true if a copy operation was requested, to False if a

336.        --  simple move operation was requested. It can be ignored if Child doesn't

337.        --  know how to create a copy of itself for instance.

339.        procedure Set_Dnd_MessageTo API docTo body

340.          (MDI     : access MDI_Window_RecordTo API docTo specTo body;

341.           Message : String);

342.        --  Override the message that is displayed in the popup window while

343.        --  performing a drag. By default, this message mentions:

344.        --     "... will be (preserved|hidden) when changing perspective"

345.        --     "Use shift to create a new view for editors"

346.        --  so might not be suitable for all applications.

347.        --  Through this function you can override the message. If you insert the

348.        --  special sequence "(#)" in the message, it will be replaced either with

349.        --  "preserved" or "hidden" depending on where the drop occurs (the central

350.        --  area or the perspectives). It could also be replaced by an empty string

351.        --  if the MDI was configured with independent perspectives.

352.        --  You can use markup like "<b>...</b>" to put keywords in bold.

353.        --

354.        --  Passing an empty string for Message will restore the default message.

356.        procedure Child_Drag_BeginTo API docTo body

357.          (Child  : access MDI_Child_RecordTo API docTo specTo body'Class;

358.           Event  : Gdk.Event.Gdk_EventTo API docTo spec);

359.        --  Starts a drag-and-drop operation for the child, so that it can be put in

360.        --  some other place on the desktop. This should only be called when a

361.        --  handler for the "button_press_event" signal, passing the event itself in

362.        --  parameter.

363.        --  The Child is immediately raised and gains the focus.

365.        procedure Cancel_Child_DragTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body'Class);

366.        --  Cancel a drag operation started by Child_Drag_Begin.

367.        --  It doesn't call Child_Drag_Finished.

369.        procedure Child_Drag_FinishedTo API docTo body (Child  : access MDI_Child_RecordTo API docTo specTo body);

370.        --  Called when a drag operation is either aborted or completed. It should

371.        --  be overriden if special cleanup should be done.

373.        -----------

374.        -- Menus --

375.        -----------

377.        type Tab_Contextual_Menu_Factory is access procedure

378.          (Child : access MDI_Child_RecordTo API docTo specTo body'Class;

379.           Menu  : access Gtk.Menu.Gtk_Menu_RecordTo API docTo specTo body'Class);

381.        procedure Set_Tab_Contextual_Menu_FactoryTo API docTo body

382.          (MDI     : access MDI_Window_RecordTo API docTo specTo body;

383.           Factory : Tab_Contextual_Menu_FactoryTo API docTo spec);

384.        --  Set (or unset if Factory is null) the callback to create the contextual

385.        --  menu entries when the user clicks on a notebook tab.

386.        --  Factory should add entries to Menu (which already contains the default

387.        --  entries, but you can remove them if needed).

389.        ------------------------

390.        -- Selecting children --

391.        ------------------------

393.        procedure Highlight_ChildTo API docTo body

394.          (Child : access MDI_Child_RecordTo API docTo specTo body; Highlight : Boolean := True);

395.        --  Highlight the child until it is selected by the user.

396.        --  The color of its menu label and of the text in the notebook tabs is

397.        --  changed.

398.        --  Nothing is done if the child is already fully visible (either in the

399.        --  active page in one of the notebooks, or the child that has the selection

400.        --  in the layout).

401.        --  This is meant to be used as a graphical note to the user that the child

402.        --  has been updated and the user should look at it.

404.        function Get_Focus_ChildTo API docTo body

405.          (MDI : access MDI_Window_RecordTo API docTo specTo body) return MDI_ChildTo API docTo spec;

406.        --  Return the child that currently has the MDI focus.

407.        --  null is returned if no child has the focus.

409.        procedure Set_Focus_ChildTo API docTo body

410.          (MDI        : access MDI_Window_RecordTo API docTo specTo body;

411.           Containing : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

412.        --  Give the focus to the child containing Containing. This will not

413.        --  Grab_Focus for the child in all cases, since you might want to give the

414.        --  focus to some specific part of your widget (an entry field,...) in some

415.        --  cases.

417.        procedure Set_Focus_ChildTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body);

418.        --  Make Child the active widget, and raise it at the top.

420.        procedure Check_Interactive_Selection_DialogTo API docTo body

421.          (MDI          : access MDI_Window_RecordTo API docTo specTo body;

422.           Event        : Gdk.Event.Gdk_EventTo API docTo spec;

423.           Move_To_Next : Boolean;

424.           Only_Group   : Child_GroupTo API docTo spec := Group_AnyTo API docTo spec);

425.        --  Open the interactive dialog for selecting windows.

426.        --  This dialog should be open as a result of a key press event.

427.        --  Move_To_Next indicates whether we want to select the next child (True)

428.        --  or the previous child (False).

429.        --  This dialog will be closed only when the key that opened it is fully

430.        --  released. For instance, if the dialog was opened as a result of

431.        --  pressing Ctrl-Tab, the dialog will only be closed when Ctrl itself is

432.        --  released.

433.        --  You can call this procedure even if a dialog is currently open. This

434.        --  simply forces a move to the next or previous child. In fact, it is

435.        --  your responsability to call this procedure when the user presses

436.        --  the keys to move between children.

437.        --

438.        --  If Event is null, then no dialog is displayed. Instead, the next or

439.        --  previous visible child is immediately selected. In such a mode, windows

440.        --  that are not on top of their respective notebook are ignored. This can

441.        --  be used to emulate Emacs's behavior for goto-other-window.

442.        --

443.        --  If Only_Group is specified, then only the windows from that group will

444.        --  be shown in the dialog.

446.        --  This function is not internal to the MDI since connecting to the

447.        --  key_press_event and key_release_event should be done in the gtk_window

448.        --  that contains the MDI. Otherwise, some events are intercepted by gtk+,

449.        --  for instance the key_release_events, and the key_press_events for some

450.        --  specified keys.

451.        --  It also gives the choice to the application of whether this feature is

452.        --  wanted or not.

454.        -----------------------------------------

455.        -- MDI_Child and encapsulated children --

456.        -----------------------------------------

458.        function Get_WidgetTo API docTo body

459.          (Child : access MDI_Child_RecordTo API docTo specTo body) return Gtk.Widget.Gtk_WidgetTo API docTo spec;

460.        --  Return the widget that Child encapsulates. This is the widget you

461.        --  initially Put() in MDI.

463.        function Find_MDI_ChildTo API docTo body

464.          (MDI    : access MDI_Window_RecordTo API docTo specTo body;

465.           Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class) return MDI_ChildTo API docTo spec;

466.        --  Return the MDI_Child that encapsulates Widget.

467.        --  Widget must be the exact same one you gave in argument to Put.

468.        --  If the child is currently not visible in the perspective (for instance

469.        --  it was created for another perspective, but is not present in the

470.        --  current one), it is inserted automatically back in the MDI.

472.        function Find_MDI_Child_From_WidgetTo API docTo body

473.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class) return MDI_ChildTo API docTo spec;

474.        --  Return the MDI child that encapsulate the parent of Widget.

475.        --  As opposed to Find_MDI_Child, Widget can be anywhere within the

476.        --  widget tree. This function properly handles floating children

477.        --  If the child is currently not visible in the perspective (for instance

478.        --  it was created for another perspective, but is not present in the

479.        --  current one), it is inserted automatically back in the MDI.

481.        function Find_MDI_Child_By_TagTo API docTo body

482.          (MDI : access MDI_Window_RecordTo API docTo specTo body;

483.           Tag : Ada.Tags.Tag;

484.           Visible_Only : Boolean := False) return MDI_ChildTo API docTo spec;

485.        --  Return the first child matching Tag

486.        --  If the child is currently not visible in the perspective (for instance

487.        --  it was created for another perspective, but is not present in the

488.        --  current one), it is inserted automatically back in the MDI.

489.        --  If Visible_Only is True, an invisible child is not returned. This is

490.        --  useful to check whether a child is currently visible.

492.        function Find_MDI_Child_By_NameTo API docTo body

493.          (MDI  : access MDI_Window_RecordTo API docTo specTo body;

494.           Name : String) return MDI_ChildTo API docTo spec;

495.        --  Return the first child matching Name.

496.        --  If the child is currently not visible in the perspective (for instance

497.        --  it was created for another perspective, but is not present in the

498.        --  current one), it is inserted automatically back in the MDI.

500.        type Child_IteratorTo API docTo body is private;

502.        function First_ChildTo API docTo body

503.          (MDI               : access MDI_Window_RecordTo API docTo specTo body;

504.           Group_By_Notebook : Boolean := False;

505.           Visible_Only      : Boolean := True) return Child_IteratorTo API docTo specTo body;

506.        --  Return an access to the first child of the MDI.

507.        --

508.        --  If Group_By_Notebook is True, then the children are reported one after

509.        --  the other, but all the widget from the same notebook are reported in the

510.        --  same order as the notebook pages. Floating children do not belong to a

511.        --  notebook, and are also reported together. To find out to which notebook

512.        --  a child belongs, use Get_Notebook below.

513.        --

514.        --  If Group_By_Notebook is False, it is garanteed that the first child is

515.        --  the one that currently has the focus in the MDI. The children are

516.        --  returned in the order in which they last had the focus.

517.        --

518.        --  If Visible_Only is true, then only those children currently visible in

519.        --  the perspective are returned. The children that were part of a former

520.        --  perspective are not returned.

522.        procedure NextTo API docTo body (IteratorTo API docTo body : in out Child_IteratorTo API docTo specTo body);

523.        --  Move to the next child in the MDI

525.        function Get_NotebookTo API docTo body

526.          (IteratorTo API docTo body : Child_IteratorTo API docTo specTo body) return Gtk.Notebook.Gtk_NotebookTo API docTo spec;

527.        --  Return the notebook to which the current child belongs. null is returned

528.        --  for floating children

530.        function GetTo API docTo body (IteratorTo API docTo body : Child_IteratorTo API docTo specTo body) return MDI_ChildTo API docTo spec;

531.        --  Return the child pointed to by Iterator.

532.        --  If Iterator is no longer valid, null is returned.

534.        -----------------------------------

535.        -- Floating and closing children --

536.        -----------------------------------

538.        procedure Float_ChildTo API docTo body

539.          (Child : access MDI_Child_RecordTo API docTo specTo body'Class; Float : Boolean);

540.        --  Change the floating state of a child

542.        function Is_FloatingTo API docTo body

543.          (Child : access MDI_Child_RecordTo API docTo specTo body'Class) return Boolean;

544.        --  Return True if Child is currently in a separate window

546.        procedure Close_ChildTo API docTo body

547.          (Child : access MDI_Child_RecordTo API docTo specTo body'Class;

548.           Force : Boolean := False);

549.        --  Same as Close, but applies directly to a MDI_Child.

551.        procedure Set_All_Floating_ModeTo API docTo body

552.          (MDI : access MDI_Window_RecordTo API docTo specTo body; All_Floating : Boolean);

553.        --  If All_Floating is set to true, the MDI will have a size of 0x0, and all

554.        --  children are set to floating. This can be used if you wish to let the

555.        --  window manager handle the windows. If All_Floating is True, children

556.        --  can no longer be maximized.

558.        procedure Use_Short_Titles_For_FloatsTo API docTo body

559.          (MDI : access MDI_Window_RecordTo API docTo specTo body; Short_Titles : Boolean);

560.        --  If Short_Titles is set to true, only short titles will ever be used

561.        --  either in the title bars (in notebooks) or as the title for floating

562.        --  windows.

564.        ---------------------------

565.        -- Reorganizing children --

566.        ---------------------------

568.        procedure Raise_ChildTo API docTo body

569.          (Child : access MDI_Child_RecordTo API docTo specTo body'Class; Give_Focus : Boolean := True);

570.        --  Put Child in the foreground.

571.        --  Note that this does not give the focus to this child, unless

572.        --  Give_Focus is set to True. If Child and the current focus child are in

573.        --  the same notebook, Child will always gain the focus, so that the focus

574.        --  is not left on an invisible window.

576.        function Is_RaisedTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body'Class) return Boolean;

577.        --  Whether the child is currently raised, ie fully visible to the user

579.        procedure Lower_ChildTo API docTo body (Child : access MDI_Child_RecordTo API docTo specTo body'Class);

580.        --  Put Child in the background.

581.        --  If the children are maximized, this selected the next page from the

582.        --  notebook.

584.        type Split_Mode is

585.          (Before, Before_Reuse,

586.           After,  After_Reuse,

587.           Any_Side_Reuse);

588.        --  How a child should be split:

589.        --  If "Before", the child is put above or to the left of its current

590.        --  position. A new window is created to containing it. If the "_Reuse"

591.        --  version is used, and a window already exist at that position, the child

592.        --  will be put in it instead of creating a new one.

593.        --  Any_Side_Reuse indicates that the child will be put on either side,

594.        --  depending on where a window already exists. If there is no window on the

595.        --  side, a new one is created.

597.        procedure SplitTo API docTo body

598.          (MDI           : access MDI_Window_RecordTo API docTo specTo body;

599.           OrientationTo API docTo body   : Gtk.Enums.Gtk_OrientationTo API docTo spec;

600.           Child         : MDI_ChildTo API docTo spec := null;

601.           ModeTo API docTo body          : Split_ModeTo API docTo spec := Before;

602.           Width, Height : Glib.GintTo API docTo spec := 0);

603.        --  Split the notebook containing Child (by default, the current focus

604.        --  child).

605.        --  Mode indicates in which direction the splitting should occur. If you

606.        --  are splitting a child in the central area, splitting will never reuse

607.        --  a window outside of the central area.

608.        --  Width and Height indicate the desired geometry for the splitted area,

609.        --  0 indicate a 50/50 split.

611.        ----------------------

612.        -- Desktop Handling --

613.        ----------------------

614.        --  The MDI provides a way to save desktops, i.e the list of children

615.        --  currently open in the MDI and their location. It can then restore the

616.        --  desktop at some later point.

617.        --

618.        --  Desktops require support from the widgets that are put in the MDI. They

619.        --  need to register a function to save them and a function to recreate

620.        --  them. Using Ada streams for this didn't prove workable since some

621.        --  children might need extra parameters not available to them through

622.        --  streams. This is why the following subprograms are in a generic package,

623.        --  so that you can pass whatever parameter(s) is needed in your

624.        --  application.

625.        --

626.        --  Desktops are saved and restored in XML trees.

627.        --

628.        --  If you need your application to load a "default desktop" when the user

629.        --  hasn't defined one, it is recommended that you distribute an actual

630.        --  file containing this desktop. You could also create the XML tree in

631.        --  memory yourself, and thus hard-code the default desktop if need be.

633.        generic

634.           type User_Data is private;

635.           --  Generic type of parameter that is passed to all the children's save

636.           --  and restore functions.

638.           --  This package needs to be instantiated at library level

640.        package DesktopTo API docTo body is

642.           function Create_MenuTo API docTo body

643.             (MDI               : access MDI_Window_RecordTo API docTo specTo body'Class;

644.              Accel_Path_Prefix : String := "<gtkada>";

645.              User              : User_DataTo API docTo spec) return Gtk.Menu.Gtk_MenuTo API docTo spec;

646.           --  Create a dynamic menu that can then be inserted into a menu bar. This

647.           --  menu is dynamic, ie its content will changed based on the focus

648.           --  child.

649.           --  If this function is called several times, the same menu is returned

650.           --  every time. Accel_Path_Prefix must be the same for every call.

651.           --  Accel_Path_Prefix is used so that the key shortcuts associated with

652.           --  these menu items can be changed dynamically by the user (see

653.           --  gtk-accel_map.ads). The prefix must start with "<" and end with ">".

654.           --  User is used for the callbacks on perspective changes, and passed to

655.           --  Load_Perspective

657.           type Save_Desktop_Function is access function

658.             (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

659.              User   : User_DataTo API docTo spec) return Glib.Xml_Int.Node_PtrTo API docTo spec;

660.           --  A general function that dumps the parameters of a widget into an XML

661.           --  tree.

662.           --

663.           --  Note: you should register one such function for all the widget types

664.           --  you will put in the MDI and that need to be saved when a desktop is

665.           --  saved. The MDI will call all the registered functions one after the

666.           --  other. Therefore, your function should return null if Widget is not

667.           --  of a type that is it can handle.

669.           type Load_Desktop_Function is access function

670.             (MDI : MDI_WindowTo API docTo spec; Node : Glib.Xml_Int.Node_PtrTo API docTo spec; User : User_DataTo API docTo spec)

671.              return MDI_ChildTo API docTo spec;

672.           --  A general function that loads a widget from an XML tree.

673.           --

674.           --  As for Save_Desktop_Function, this function should return null if it

675.           --  doesn't know how to handle Node or if Node doesn't describe a widget

676.           --  type that it can handle.

677.           --

678.           --  This function returns an MDI_Widget that has been put in the MDI.

680.           procedure Register_Desktop_FunctionsTo API docTo body

681.             (Save : Save_Desktop_FunctionTo API docTo spec;

682.              Load : Load_Desktop_FunctionTo API docTo spec);

683.           --  Register a set of functions to save and load desktops for some

684.           --  specific widget types. This can be called multiple times.

685.           --  Neither Save nor Load can be null.

687.           function Restore_DesktopTo API docTo body

688.             (MDI          : access MDI_Window_RecordTo API docTo specTo body'Class;

689.              Perspectives : Glib.Xml_Int.Node_PtrTo API docTo spec;

690.              From_Tree    : Glib.Xml_Int.Node_PtrTo API docTo spec;

691.              User         : User_DataTo API docTo spec) return Boolean;

692.           --  Restore the contents of the MDI from its saved XML tree.

693.           --  Perspectives is the list of perspectives. It is cloned as needed, so

694.           --  the caller is still responsible for freeing it. The first perspective

695.           --  is loaded.

696.           --  From_Tree is the part of the desktop that describes the editor area.

697.           --  User is passed as a parameter to all of the Load_Desktop_Function

698.           --  registered by the widgets.

699.           --  Return False if the desktop couldn't be loaded

700.           --  It also restores the size and position of the toplevel window that

701.           --  contains the MDI

703.           procedure Load_PerspectiveTo API docTo body

704.             (MDI          : access MDI_Window_RecordTo API docTo specTo body'Class;

705.              Name         : String;

706.              User         : User_DataTo API docTo spec);

707.           --  Replace the current perspective by another one. This preserves the

708.           --  editor area.

709.           --  If the perspective does not exist, nothing is done, unless no

710.           --  perspective is currently loaded (in which case we load the first

711.           --  on in the list).

713.           procedure Create_PerspectiveTo API docTo body

714.             (MDI          : access MDI_Window_RecordTo API docTo specTo body'Class;

715.              Name         : String;

716.              User         : User_DataTo API docTo spec);

717.           --  Create a new perspective with the current desktop layout. If another

718.           --  perspective with the same name exists, it is replaced.

720.           procedure Define_PerspectiveTo API docTo body

721.             (MDI          : access MDI_Window_RecordTo API docTo specTo body'Class;

722.              XML          : Glib.Xml_Int.Node_PtrTo API docTo spec;

723.              User         : User_DataTo API docTo spec);

724.           --  Define a new perspective (in the same format as returned by

725.           --  Save_Desktop, the central area is under control of the user so you

726.           --  cannot change it).

727.           --  If such a perspective already exists, nothing is done (since the user

728.           --  might have modified it already).

729.           --  XML's root node is the <perspective> node, including its "name"

730.           --  attribute.

731.           --  XML must be freed by the caller.

733.           procedure Save_DesktopTo API docTo body

734.             (MDI          : access MDI_Window_RecordTo API docTo specTo body'Class;

735.              User         : User_DataTo API docTo spec;

736.              Perspectives : out Glib.Xml_Int.Node_PtrTo API docTo spec;

737.              Central      : out Glib.Xml_Int.Node_PtrTo API docTo spec);

738.           --  Return XML representations of the perspectives and central area. Both

739.           --  nodes need to be freed by the caller, and can be saved in a file (to

740.           --  be passed to Restore_Desktop later on).

741.           --  This function calls each of the registered function for the children

742.           --  of the MDI.

743.           --  It also saves the size and position of the toplevel window that

744.           --  contains the MDI

746.           function Get_XML_ContentTo API docTo body

747.             (MDI : access MDI_Window_RecordTo API docTo specTo body'Class;

748.              Tag : String) return Glib.Xml_Int.Node_PtrTo API docTo spec;

749.           --  Return the first XML subtree starting with 'Tag'. This allows a

750.           --  module to retrieve its content after the 'Load_Desktop' call.

752.           procedure Free_Registered_Desktop_FunctionsTo API docTo body;

753.           --  Free the memory allocated for the registered functions.

755.        private

756.           type Register_Node_Record;

757.           type Register_Node is access Register_Node_Record;

758.           type Register_Node_Record is record

759.              Save : Save_Desktop_FunctionTo API docTo spec;

760.              Load : Load_Desktop_FunctionTo API docTo spec;

761.              Next : Register_Node;

762.           end record;

764.           type Perspective_Menu_Item_Record

765.             is new Gtk.Radio_Menu_Item.Gtk_Radio_Menu_Item_RecordTo API docTo specTo body

766.           with record

767.              MDI  : MDI_WindowTo API docTo spec;

768.              Name : Natural;

769.              User : User_DataTo API docTo spec;

770.           end record;

771.           type Perspective_Menu_Item

772.             is access all Perspective_Menu_Item_Record'Class;

774.           procedure Change_Perspective

775.             (Item : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

776.           CP_Access : constant

777.             Gtkada.Handlers.Widget_Callback.Marshallers.MarshallerTo API docTo spec :=

778.             Gtkada.Handlers.Widget_Callback.To_MarshallerTo API docTo spec

779.               (Change_Perspective'Access);

780.           --  Internal, but needed so that we can have a 'Access on a callback

782.           procedure Create_Perspective_CB

783.             (Item : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

784.           CreateP_Access : constant

785.             Gtkada.Handlers.Widget_Callback.Marshallers.MarshallerTo API docTo spec :=

786.             Gtkada.Handlers.Widget_Callback.To_MarshallerTo API docTo spec

787.               (Create_Perspective_CB'Access);

789.           Registers : Register_Node;

790.           --  Global variable that contains the list of functions that have been

791.           --  registered.

792.        end DesktopTo API docTo specTo body;

794.        function Desktop_Was_LoadedTo API docTo body (MDI : access MDI_Window_RecordTo API docTo specTo body) return Boolean;

795.        --  Return True if a desktop was loaded, False if the MDI is only the result

796.        --  of calls to Gtk_New and Put.

798.        function List_Of_PerspectivesTo API docTo body

799.          (MDI : access MDI_Window_RecordTo API docTo specTo body)

800.           return GNAT.Strings.String_List_Access;

801.        --  Return the list of perspectives known to the MDI. The caller must not

802.        --  free the list

804.        function Current_PerspectiveTo API docTo body

805.          (MDI : access MDI_Window_RecordTo API docTo specTo body'Class) return String;

806.        --  Return the name of the currently displayed perspective

808.        -------------

809.        -- Signals --

810.        -------------

812.        --  <signals>

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

814.        --

815.        --  - "child_selected"

816.        --    procedure Handler

817.        --       (MDI : access MDI_Window_Record'Class; Child : System.Address);

818.        --

819.        --    This signal is emitted when a new child has gained the focus. Convert

820.        --    Child to a MDI_Child by calling Gtk.Arguments.To_Object. This can be

821.        --    used to change some global information at the MDI level. You should

822.        --    connect to "selected" (see below) instead if you want to change some

823.        --    information at the child level.

824.        --    Child might be null if no child has the focus anymore

825.        --

826.        --  - "float_child"

827.        --    procedure Handler

828.        --       (MDI : access MDI_Window_Record'Class; Child : System.Address);

829.        --

830.        --    A child was set as floating in the MDI. A similar signal is emitted on

831.        --    the child itself.

832.        --

833.        --  - "child_title_changed"

834.        --    procedure Handler

835.        --      (MDI : access MDI_Window_Record'Class; Child : System.Address);

836.        --

837.        --    Emitted when the title of a child is changed. This signal is not

838.        --    emitted if Set_Title is called for a child that hasn't been put in the

839.        --    MDI yet.

840.        --

841.        --  - "child_added"

842.        --     procedure Handler

843.        --       (MDI : access MDI_Window_Record'Class; Child : System.Address);

844.        --     Emitted when a new child is added. You cannot use the "add" signal

845.        --     since in fact the children are added to notebooks that are part of

846.        --     the MDI, and thus "add" is only emitted when a new notebook is

847.        --     created.

848.        --

849.        --  - "child_removed"

850.        --     procedure Handler

851.        --       (MDI : access MDI_Window_Record'Class; Child : System.Address);

852.        --     Emitted when a new child is removed. You cannot use the "remove"

853.        --     signal since in fact the children are removed from notebooks that are

854.        --     part of the MDI, and thus "remove" is only emitted when a new

855.        --     notebook is destroyed.

856.        --     When this signal is emitted, Child no longer contains a widget, and

857.        --     is no longer part of the children, although you can still access its

858.        --     titles.

859.        --

860.        --  - "child_icon_changed"

861.        --     procedure Handler

862.        --       (MDI : access MDI_Window_Record'Class; Child : System.Address);

863.        --     Emitted when the icon for Child has changed

864.        --

865.        --  - "children_reorganized"

866.        --     procedure Handler (MDI : access MDI_Window_Record'Class);

867.        --     Emitted when the children have been reorganized: either a split

868.        --     occurred, or a window was dropped into another position

869.        --

870.        --  - "perspective_changed"

871.        --     procedure Handler (MDI : access MDI_Window_Record'Class);

872.        --     Called when the user has selected a new perspective. One use is to

873.        --     save the new desktop to a file.

874.        --

875.        --  </signals>

876.        --

877.        --  <signals>

878.        --  The following new signals are defined for the MDI_Child_Record object:

879.        --

880.        --  - "delete_event"

881.        --    function Handler (Child : access Gtk_Widget_Record'Class)

882.        --                     return Boolean;

883.        --

884.        --    This signal is emitted for each item in the MDI window before it is

885.        --    actually deleted. The child is destroyed only if the handler returns

886.        --    False.

887.        --    Note that the Child passed in argument is exactly the one you passed

888.        --    to Put to insert it in the MDI window.

889.        --    Note that this is also the signal to use to prevent top level

890.        --    Gtk_Window from being destroyed.

891.        --

892.        --  - "selected"

893.        --    procedure Handler (Child : access MDI_Child_Record'Class);

894.        --

895.        --    This is emitted when the child is selected, ie gains the

896.        --    MDI focus. You should probably also connect to the "grab_focus" signal

897.        --    to be informed when the child gets the keyboard focus. This can be

898.        --    used to transfer the focus to some specific part of the

899.        --    widget. Connecting to "grab_focus" should be done with the After

900.        --    parameter set to True.

901.        --

902.        --  - "float_child"

903.        --    procedure Handler (Child : access MDI_Child_Record'Class);

904.        --

905.        --    Emitted when a child is set as floating

906.        --

907.        --  - "unfloat_child"

908.        --    procedure Handler (Child : access MDI_Child_Record'Class);

909.        --

910.        --    Emitted when a child is put back in the main MDI window

911.        --

912.        --  - "child_state_changed"

913.        --    procedure Handler (Child : access MDI_Child_Record'Class);

914.        --

915.        --    Emitted when the state of the child has changed. See the function

916.        --    Get_State. In particular, this signal can be detected when a child is

917.        --    removed from the current perspective (the new state is "invisible"),

918.        --    and when it is put back (the new state is "normal" or "floating").

919.        --

920.        --  </signals>

922.        Signal_Child_Selected       : constant Signal_NameTo API docTo spec := "child_selected";

923.        Signal_Float_Child          : constant Signal_NameTo API docTo spec := "float_child";

924.        Signal_Child_Title_Changed  : constant Signal_NameTo API docTo spec := "child_title_changed";

925.        Signal_Child_Added          : constant Signal_NameTo API docTo spec := "child_added";

926.        Signal_Child_Removed        : constant Signal_NameTo API docTo spec := "child_removed";

927.        Signal_Child_Icon_Changed   : constant Signal_NameTo API docTo spec := "child_icon_changed";

928.        Signal_Delete_Event         : constant Signal_NameTo API docTo spec := "delete_event";

929.        Signal_Selected             : constant Signal_NameTo API docTo spec := "selected";

930.        Signal_Unfloat_Child        : constant Signal_NameTo API docTo spec := "unfloat_child";

931.        Signal_Perspective_Changed  : constant Signal_NameTo API docTo spec := "perspective_changed";

932.        Signal_Children_Reorganized : constant Signal_NameTo API docTo spec :=

933.                                        "children_reorganized";

934.        Signal_Child_State_Changed  : constant Signal_NameTo API docTo spec := "child_state_changed";

936.     private

937.        type String_Access is access all UTF8_StringTo API docTo spec;

939.        type MDI_Child_RecordTo API docTo spec is new Gtk.Event_Box.Gtk_Event_Box_RecordTo API docTo spec with record

940.           Initial       : Gtk.Widget.Gtk_WidgetTo API docTo spec;

941.           --  The widget we use to build this child.

943.           Main_Box      : Gtk.Box.Gtk_BoxTo API docTo spec;

944.           --  The main container.

946.           State         : State_TypeTo API docTo spec := Normal;

948.           Group         : Child_GroupTo API docTo spec := Group_DefaultTo API docTo spec;

950.           Title         : String_Access;

951.           Short_Title   : String_Access;

952.           --  Title of the item, as it appears in the title bar.

953.           --  These are UTF8-Encoded

955.           XML_Node_Name : String_Access;

956.           --  The name of the XML node when this child is saved in a desktop (if

957.           --  we know it). This is used to reuse a child when switching

958.           --  perspectives.

960.           MDI           : MDI_WindowTo API docTo spec;

961.           --  The MDI to which the child belongs. We cannot get this information

962.           --  directly from Get_Parent since some children are actually floating

963.           --  and do not belong to the MDI anymore.

965.           Menu_Item     : Gtk.Radio_Menu_Item.Gtk_Radio_Menu_ItemTo API docTo spec;

966.           --  The item in the dynamic menu that represents this child.

968.           Flags         : Child_FlagsTo API docTo spec;

970.           Focus_Widget  : Gtk.Widget.Gtk_WidgetTo API docTo spec;

971.           --  The widget which should actually get the keyboard focus

973.           Icon          : Gdk.Pixbuf.Gdk_PixbufTo API docTo spec;

975.           Title_Box     : Gtk.Box.Gtk_BoxTo API docTo spec;

976.           --  Box that contains the title. It will be resized whenever the title

977.           --  font changes.

979.           Tab_Label     : Gtk.Label.Gtk_LabelTo API docTo spec;

980.           --  label used when child is in a notebook, null if not in a notebook

981.        end record;

983.        type Child_IteratorTo API docTo spec (Group_By_Notebook : Boolean := False) is record

984.           Visible_Only : Boolean;

986.           case Group_By_Notebook is

987.              when False =>

988.                 Iter : Gtk.Widget.Widget_List.GlistTo API docTo specTo body;

990.              when True =>

991.                 MDI                 : MDI_WindowTo API docTo spec;

993.                 --  While iterating children

994.                 Paned_Iter          : Gtkada.Multi_Paned.Child_IteratorTo API docTo specTo body;

996.                 --  Whether we have already visited the children of the central

997.                 --  area. This is True while iterating them, False afterward

998.                 In_Central          : Boolean;

1000.                 --  While iterating the pages of a specific notebook (notebook is

1001.                 --  set to null when returning floating children)

1002.                 Notebook            : Gtk.Notebook.Gtk_NotebookTo API docTo spec;

1003.                 Notebook_Page       : Glib.GintTo API docTo spec;

1005.                 --  While iterating the floating children

1006.                 Floating_Iter       : Gtk.Widget.Widget_List.GlistTo API docTo specTo body;

1007.           end case;

1008.        end record;

1010.        type Drag_Status is (No_Drag, In_Pre_Drag, In_Drag);

1012.        type MDI_Window_RecordTo API docTo spec is new Gtkada.Multi_Paned.Gtkada_Multi_Paned_RecordTo API docTo specTo body

1013.        with record

1014.           Items : Gtk.Widget.Widget_List.GlistTo API docTo specTo body := Gtk.Widget.Widget_List.Null_ListTo API docTo specTo body;

1015.           --  The list of all MDI children. This includes children in the editor

1016.           --  area, even though they are technically in a separate multi_paned.

1017.           --  Warning: this list might contain items which are in fact invisible in

1018.           --  the MDI (in fact that are not even children of the MDI), if they

1019.           --  existed in a previous perspective but no longer in the current one.

1021.           Desktop_Was_Loaded : Boolean := False;

1022.           --  True if a desktop was loaded

1024.           Loading_Desktop : Boolean := False;

1025.           --  Whether we are currently loading the desktop. This impacts a number

1026.           --  of focus and sizing parameters, so that the desktop can be restored

1027.           --  as accurately as possible.

1029.           Delay_Before_Focus_Id : Glib.Main.G_Source_IdTo API docTo spec := Glib.Main.No_Source_IdTo API docTo spec;

1030.           Delay_Before_Focus : Glib.GuintTo API docTo spec := 700;

1031.           --  Delay in ms before a floating window gains the GPS focus, after the

1032.           --  "focus_in" event. In all floating mode, this ensures that when the

1033.           --  user is passing briefly over floating windows they do not gain the

1034.           --  focus, thus potentially leaving the focus to the window that had it

1035.           --  at the beginning of the move.

1036.           --  Set to 0 to remove any delay.

1038.           Focus_Child : MDI_ChildTo API docTo spec := null;

1039.           --  The child that currently has the focus. Some default actions will

1040.           --  apply to this child only.

1042.           Dnd_Message : String_Access;

1043.           --  The message displayed during a dnd operation (see Set_Dnd_Message)

1045.           Accel_Path_Prefix  : String_Access;

1046.           --  The Accel path used for the dynamic menu

1048.           Menu               : Gtk.Menu.Gtk_MenuTo API docTo spec;

1049.           Float_Menu_Item    : Gtk.Check_Menu_Item.Gtk_Check_Menu_ItemTo API docTo spec;

1050.           Float_Menu_Item_Id : Gtk.Handlers.Handler_IdTo API docTo spec;

1051.           Close_Menu_Item    : Gtk.Menu_Item.Gtk_Menu_ItemTo API docTo spec;

1052.           --  The dynamic menu used to provide access to the most common

1053.           --  functions of MDI.

1055.           Tab_Factory : Tab_Contextual_Menu_FactoryTo API docTo spec;

1056.           --  Build the contextual menu when right-clicking on tabs

1058.           Title_Layout        : Pango.Layout.Pango_LayoutTo API docTo spec;

1059.           --  Layout used to draw titles in the MDI children

1061.           Title_Bar_Height    : Glib.GintTo API docTo spec;

1062.           --  Height of the title bar for all the children

1064.           Close_Floating_Is_Unfloat : Boolean;

1065.           --  True if destroying a floating window will put the child back in the

1066.           --  MDI instead of destroying it. False if the child should be destroyed

1067.           --  (provided it accepts so in its delete_event handler).

1069.           Highlight_Style : Gtk.Style.Gtk_StyleTo API docTo spec;

1070.           --  Style to use to highlight the tabs and menus for the highlighted

1071.           --  children.

1073.           Background_Color  : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

1074.           Title_Bar_Color   : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

1075.           Focus_Title_Color : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

1076.           Default_Title_Color : Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

1078.           Cursor_Cross      : Gdk.Cursor.Gdk_CursorTo API docTo spec;

1079.           Cursor_Fleur      : Gdk.Cursor.Gdk_CursorTo API docTo spec;

1080.           --  Cached cursors

1082.           Draw_Title_Bars   : Title_Bars_PolicyTo API docTo spec := Always;

1083.           Tabs_Position     : Gtk.Enums.Gtk_Position_TypeTo API docTo spec := Gtk.Enums.Pos_Bottom;

1084.           Show_Tabs_Policy  : Show_Tabs_Policy_EnumTo API docTo spec := Automatic;

1086.           Selection_Dialog : Gtk.Widget.Gtk_WidgetTo API docTo spec;

1087.           --  The interactive dialog for selecting new children.

1089.           Dnd_Window       : Gtk.Window.Gtk_WindowTo API docTo spec;

1090.           Dnd_Window_Label : Gtk.Label.Gtk_LabelTo API docTo spec;

1091.           --  The small window displayed while a drag-and-drop operation is

1092.           --  taking place.

1094.           Group : Gtk.Accel_Group.Gtk_Accel_GroupTo API docTo spec;

1096.           All_Floating_Mode : Boolean := False;

1097.           --  Set to true if all windows should be set to floating

1099.           Independent_Perspectives : Boolean := False;

1100.           --  See documentation for Configure.

1102.           Use_Short_Titles_For_Floats : Boolean := False;

1103.           --  Set to true if all floating children should use their short titles

1105.           --  Handling of Dnd

1106.           Drag_Start_X, Drag_Start_Y : GintTo API docTo spec;

1107.           In_Drag           : Drag_Status := No_Drag;

1108.           Dnd_Rectangle     : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;  --  Highlighted area

1109.           Dnd_Target        : Gdk.Gdk_WindowTo API docTo spec;     --  The current target for DND

1110.           Dnd_Target_Window : Gtk.Window.Gtk_WindowTo API docTo spec;  --  The overlay window

1112.           --  Loaded perspectives

1113.           Perspective_Menu_Item  : Gtk.Menu_Item.Gtk_Menu_ItemTo API docTo spec;

1114.           Perspectives           : Glib.Xml_Int.Node_PtrTo API docTo spec;

1115.           View_Contents          : Glib.Xml_Int.Node_PtrTo API docTo spec;

1116.           Perspective_Names      : GNAT.Strings.String_List_Access;

1117.           Central                : Gtkada.Multi_Paned.Gtkada_Multi_PanedTo API docTo spec;

1119.           Current_Perspective    : Glib.Xml_Int.Node_PtrTo API docTo spec;

1120.           --  pointer into Perspectives

1121.        end record;

1123.        pragma Inline (Get_WidgetTo API docTo specTo body);

1124.        pragma Inline (Get_Focus_ChildTo API docTo specTo body);

1125.        pragma Inline (GetTo API docTo specTo body);

1126.        pragma Inline (NextTo API docTo specTo body);

1127.        pragma Inline (First_ChildTo API docTo specTo body);

1129.     end Gtkada.MDITo API docTo specTo body;