## 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.     --  The Gtk_Cell_Renderer is a base class of a set of objects used for

31.     --  rendering a cell to a Gdk_Drawable. These objects are used primarily by the

32.     --  Gtk_Tree_View widget, though they aren't tied to them in any specific way.

33.     --  It is worth noting that Gtk_Cell_Renderer is not a Gtk_Widget and cannot be

34.     --  treated as such.

35.     --

36.     --  The primary use of a Gtk_Cell_Renderer is for drawing a certain graphical

37.     --  elements on a Gdk_Drawable. Typically, one cell renderer is used to draw

38.     --  many cells on the screen. To this extent, it isn't expected that

39.     --  Cell_Renderer keep any permanent state around. Instead, any state is set

40.     --  just prior to use using GObjects property system. Then, the cell is

41.     --  measured using Get_Size(). Finally, the cell is rendered in the correct

42.     --  location using Render().

43.     --

44.     --  There are a number of rules that must be followed when writing a new

45.     --  Gtk_Cell_Renderer. First and formost, it's important that a certain set of

46.     --  properties will always yield a cell renderer of the same size, barring

47.     --  GtkStyle change. The Gtk_Cell_Renderer also has a number of generic

48.     --  properties that are expected to be honored by all children.

49.     --

50.     --  Beyond merely rendering a cell, cell renderers can optionally provide

51.     --  active user interface elements. A cell renderer can be activatable like

52.     --  Gtk_Cell_Renderer_Toggle, which toggles when it gets activated by a mouse

53.     --  click, or it can be editable like Gtk_Cell_Renderer_Text, which allows the

54.     --  user to edit the text using a Gtk_Entry. To make a cell renderer

55.     --  activatable or editable, you have to implement the activate or

56.     --  start_editing virtual functions, respectively.

57.     --  </description>

58.     --  <c_version>2.14</c_version>

59.     --  <group>Trees and Lists</group>

61.     with Glib.ObjectTo API docTo specTo body;

63.     with Gdk.EventTo API docTo specTo body;

64.     with Gdk.RectangleTo API docTo specTo body;

65.     with Gdk.WindowTo API docTo specTo body;

66.     with GtkTo API docTo spec;

67.     with Gtk.Cell_EditableTo API docTo spec;

68.     with Gtk.WidgetTo API docTo specTo body;

69.     with Glib.PropertiesTo API docTo specTo body;

70.     with Glib.Generic_PropertiesTo API docTo specTo body;

71.     with Glib.GlistTo API docTo specTo body;

72.     pragma Elaborate_All (Glib.GlistTo API docTo specTo body);

74.     package Gtk.Cell_RendererTo API docTo specTo body is

76.        type Gtk_Cell_Renderer_RecordTo API docTo body is

77.          new Glib.Object.GObject_RecordTo API docTo specTo body with private;

78.        type Gtk_Cell_Renderer is access all Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

80.        function ConvertTo API docTo body (R : Gtk_Cell_RendererTo API docTo spec) return System.Address;

81.        function ConvertTo API docTo body (R : System.Address) return Gtk_Cell_RendererTo API docTo spec;

82.        package Cell_Renderer_List is

83.           new Glib.Glist.Generic_ListTo API docTo specTo body (Gtk_Cell_RendererTo API docTo spec);

85.        type Gtk_Cell_Renderer_State is mod 2 ** 32;

86.        Cell_Renderer_Selected    : constant Gtk_Cell_Renderer_StateTo API docTo spec;

87.        Cell_Renderer_Prelit      : constant Gtk_Cell_Renderer_StateTo API docTo spec;

88.        Cell_Renderer_Insensitive : constant Gtk_Cell_Renderer_StateTo API docTo spec;

89.        Cell_Renderer_Sorted      : constant Gtk_Cell_Renderer_StateTo API docTo spec;

90.        Cell_Renderer_Focused     : constant Gtk_Cell_Renderer_StateTo API docTo spec;

91.        --  Identifies how a cell should be renderer. Prelit is used when the mouse

92.        --  is hovering over a particular cell. Sorted is used when the cell is in

93.        --  a sort row.

95.        type Gtk_Cell_Renderer_Mode is

96.          (Cell_Renderer_Mode_Inert,

97.           Cell_Renderer_Mode_Activatable,

98.           Cell_Renderer_Mode_Editable);

99.        for Gtk_Cell_Renderer_ModeTo API docTo spec'Size use Glib.GintTo API docTo spec'Size;

100.        --  Identifies how the user can interact with a particular cell. If

101.        --  Activatable, the cell can be clicked. If Editable, the cell can be

102.        --  modified

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

105.        --  Return the internal value associated with Gtk_Cell_Renderer

107.        procedure Get_SizeTo API docTo body

108.          (Cell      : access Gtk_Cell_Renderer_RecordTo API docTo specTo body;

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

110.           Cell_AreaTo API docTo body : out Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

111.           X_Offset  : out GintTo API docTo spec;

112.           Y_Offset  : out GintTo API docTo spec;

113.           Width     : out GintTo API docTo spec;

114.           Height    : out GintTo API docTo spec);

115.        --  Obtain the width and height needed to render the cell.

116.        --  Used by view widgets to determine the appropriate size for the Cell_Area

117.        --  passed to Render. Fill in the x and y offsets (if set) of the cell

118.        --  relative to this location. Please note that the values set in Width and

119.        --  Height, as well as those in X_Offset and Y_Offset are inclusive of the

120.        --  Xpad and Ypad properties.

121.        --  Widget: the widget the renderer is rendering to.

122.        --  Cell_Area: The area a cell will be allocated.

123.        --  X_Offset: X offset of cell relative to Cell_Area.

124.        --  Y_Offset: Y offset of cell relative to Cell_Area.

125.        --  Width: Width needed to render a cell.

126.        --  Height: Height needed to render a cell.

128.        procedure RenderTo API docTo body

129.          (Cell            : access Gtk_Cell_Renderer_RecordTo API docTo specTo body;

130.           Window          : Gdk.Window.Gdk_WindowTo API docTo spec;

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

132.           Background_AreaTo API docTo body : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

133.           Cell_AreaTo API docTo body       : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

134.           Expose_AreaTo API docTo body     : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

135.           Flags           : Gtk_Cell_Renderer_StateTo API docTo spec);

136.        --  Invokes the virtual render function of the Gtk_Cell_Renderer. The three

137.        --  passed-in rectangles are areas of Window. Most renderers will draw

138.        --  within Cell_Area; the Xalign, Yalign, Xpad, and Ypad fields of the

139.        --  GtkCellRenderer should be honored with respect to Cell_Area.

140.        --  Background_Area includes the blank space around the cell, and also the

141.        --  area containing the tree expander; so the Background_Area rectangles

142.        --  for all cells tile to cover the entire Window.  Expose_Area is a clip

143.        --  rectangle.

145.        function ActivateTo API docTo body

146.          (Cell            : access Gtk_Cell_Renderer_RecordTo API docTo specTo body;

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

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

149.           Path            : UTF8_StringTo API docTo spec;

150.           Background_AreaTo API docTo body : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

151.           Cell_AreaTo API docTo body       : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

152.           Flags           : Gtk_Cell_Renderer_StateTo API docTo spec) return Boolean;

153.        --  Passes an activate event to the cell renderer for possible processing.

154.        --  Some cell renderers may use events;

155.        --  for example, Gtk_Cell_Renderer_Toggle toggles when it gets a

156.        --  mouse click.

158.        function Start_EditingTo API docTo body

159.          (Cell            : access Gtk_Cell_Renderer_RecordTo API docTo specTo body;

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

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

162.           Path            : UTF8_StringTo API docTo spec;

163.           Background_AreaTo API docTo body : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

164.           Cell_AreaTo API docTo body       : Gdk.Rectangle.Gdk_RectangleTo API docTo spec;

165.           Flags           : Gtk_Cell_Renderer_StateTo API docTo spec)

166.           return Gtk.Cell_Editable.Gtk_Cell_EditableTo API docTo spec;

167.        --  Passes an activate event to the cell renderer for possible processing.

168.        --  Cell: a Gtk_Cell_Renderer

169.        --  Event: a Gdk_Event

170.        --  Widget: widget that received the event

171.        --  Path: widget-dependent string representation of the event location;

172.        --  e.g. for Gtk_Tree_View, a string representation of Gtk_Tree_Path

173.        --  Background_Area: background area as passed to Render

174.        --  Cell_Area: cell area as passed to Render

176.        procedure Set_Fixed_SizeTo API docTo body

177.          (Cell   : access Gtk_Cell_Renderer_RecordTo API docTo specTo body;

178.           Width  : GintTo API docTo spec;

179.           Height : GintTo API docTo spec);

180.        procedure Get_Fixed_SizeTo API docTo body

181.          (Cell   : access Gtk_Cell_Renderer_RecordTo API docTo specTo body;

182.           Width  : out GintTo API docTo spec;

183.           Height : out GintTo API docTo spec);

184.        --  Sets the renderer size to be explicit, independent of the

185.        --  properties set.

187.        -------------

188.        -- Signals --

189.        -------------

191.        --  <signals>

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

193.        --

194.        --  - "editing-canceled"

195.        --    procedure Handler (Cell : access Gtk_Cell_Renderer_Record'Class);

196.        --    This signal gets emitted when the user cancels the process of editing

197.        --    cell. For example, an editable cell renderer could be written to

198.        --    cancel editing when the user presses Escape.

199.        --

200.        --  - "editing-started"

201.        --    procedure Handler

202.        --       (Cell     : access Gtk_Cell_Renderer_Record'Class;

203.        --        Editable : Gtk_Cell_Editable

204.        --        Path     : String)

205.        --    This signal gets emitted when a cell starts to be edited. The indended

206.        --    use of this signal is to do special setup on editable, e.g. adding a

207.        --    GtkEntryCompletion or setting up additional columns in a GtkComboBox.

208.        --    Note that GTK+ doesn't guarantee that cell renderers will continue to

209.        --    use the same kind of widget for editing in future releases, therefore

210.        --    you should check the type of editable before doing any specific setup,

211.        --    as in the following example:

212.        --  </signals>

214.        Signal_Editing_Canceled : constant Glib.Signal_NameTo API docTo spec := "editing-canceled";

215.        Signal_Editing_Started  : constant Glib.Signal_NameTo API docTo spec := "editing-started";

217.        ----------------

218.        -- Properties --

219.        ----------------

221.        --  The following properties are defined for this cell_renderer and its

222.        --  children:

223.        --  <properties>

224.        --

225.        --   Attribute             Type in Model             Mode

226.        --   =========             =============             ====

227.        --

228.        --   "mode"                Gtk_Cell_Renderer_Mode    Read / Write

229.        --   "visible"             Boolean                   Read / Write

230.        --   "xalign"              Gfloat                    Read / Write

231.        --   "yalign"              Gfloat                    Read / Write

232.        --   "xpad"                Guint                     Read / Write

233.        --   "ypad"                Guint                     Read / Write

234.        --   "width"               Gint                      Read / Write

235.        --   "height"              Gint                      Read / Write

236.        --   "is_expander"         Boolean                   Read / Write

237.        --   "is_expanded"         Boolean                   Read / Write

238.        --   "cell_background_gdk" Gdk_Color                 Read / Write

239.        --   "cell_background"     String                    Write

240.        --

241.        --  Name:  Cell_Background_Property

242.        --  Type:  String

243.        --  Descr: Cell background color as a string

244.        --

245.        --  Name:  Cell_Background_Gdk_Property

246.        --  Type:  Boxed

247.        --  Descr: Cell background color as a GdkColor

248.        --

249.        --  Name:  Editing_Property

250.        --  Type:  Boolean

251.        --  Descr: Whether the cell renderer is currently in editing mode

252.        --

253.        --  Name:  Height_Property

254.        --  Type:  Int

255.        --  Descr: The fixed height

256.        --

257.        --  Name:  Is_Expanded_Property

258.        --  Type:  Boolean

259.        --  Descr: Row is an expander row, and is expanded

260.        --

261.        --  Name:  Is_Expander_Property

262.        --  Type:  Boolean

263.        --  Descr: Row has children

264.        --

265.        --  Name:  Mode_Property

266.        --  Type:  Enum

267.        --  Descr: Editable mode of the CellRenderer

268.        --

269.        --  Name:  Sensitive_Property

270.        --  Type:  Boolean

271.        --  Descr: Display the cell sensitive

272.        --

273.        --  Name:  Visible_Property

274.        --  Type:  Boolean

275.        --  Descr: Display the cell

276.        --

277.        --  Name:  Width_Property

278.        --  Type:  Int

279.        --  Descr: The fixed width

280.        --

281.        --  Name:  Xalign_Property

282.        --  Type:  Float

283.        --  Descr: The x-align

284.        --

285.        --  Name:  Xpad_Property

286.        --  Type:  Uint

287.        --  Descr: The xpad

288.        --

289.        --  Name:  Yalign_Property

290.        --  Type:  Float

291.        --  Descr: The y-align

292.        --

293.        --  Name:  Ypad_Property

294.        --  Type:  Uint

295.        --  Descr: The ypad

297.        --   </properties>

299.        package Cell_Renderer_Mode_Properties is new

300.          Glib.Generic_Properties.Generic_Internal_Discrete_PropertyTo API docTo specTo body

301.            (Gtk_Cell_Renderer_ModeTo API docTo spec);

302.        type Property_Cell_Renderer_Mode is

303.          new Cell_Renderer_Mode_Properties.PropertyTo API docTo spec;

305.        Cell_Background_Property     : constant Glib.Properties.Property_StringTo API docTo spec;

306.        --  Cell_Background_Gdk_Property : constant Glib.Properties.Property_Boxed;

307.        Editing_Property             : constant Glib.Properties.Property_BooleanTo API docTo spec;

308.        Height_Property              : constant Glib.Properties.Property_IntTo API docTo spec;

309.        Is_Expanded_Property         : constant Glib.Properties.Property_BooleanTo API docTo spec;

310.        Is_Expander_Property         : constant Glib.Properties.Property_BooleanTo API docTo spec;

311.        Mode_Property                : constant Property_Cell_Renderer_ModeTo API docTo spec;

312.        Sensitive_Property           : constant Glib.Properties.Property_BooleanTo API docTo spec;

313.        Visible_Property             : constant Glib.Properties.Property_BooleanTo API docTo spec;

314.        Width_Property               : constant Glib.Properties.Property_IntTo API docTo spec;

315.        Xalign_Property              : constant Glib.Properties.Property_FloatTo API docTo spec;

316.        Xpad_Property                : constant Glib.Properties.Property_UintTo API docTo spec;

317.        Yalign_Property              : constant Glib.Properties.Property_FloatTo API docTo spec;

318.        Ypad_Property                : constant Glib.Properties.Property_UintTo API docTo spec;

320.     private

321.        type Gtk_Cell_Renderer_RecordTo API docTo spec is

322.          new Glib.Object.GObject_RecordTo API docTo specTo body with null record;

324.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_cell_renderer_get_type");

326.        Cell_Background_PropertyTo API docTo spec : constant Glib.Properties.Property_StringTo API docTo spec :=

327.          Glib.Properties.BuildTo API docTo specTo body ("cell-background");

328.        --  Cell_Background_Gdk_Property : constant Glib.Properties.Property_Boxed

329.        --    := Glib.Properties.Build ("cell-background-gdk");

330.        Editing_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

331.          Glib.Properties.BuildTo API docTo specTo body ("editing");

332.        Height_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

333.          Glib.Properties.BuildTo API docTo specTo body ("height");

334.        Is_Expanded_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

335.          Glib.Properties.BuildTo API docTo specTo body ("is-expanded");

336.        Is_Expander_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

337.          Glib.Properties.BuildTo API docTo specTo body ("is-expander");

338.        Mode_PropertyTo API docTo spec : constant Property_Cell_Renderer_ModeTo API docTo spec :=

339.          BuildTo API docTo specTo body ("mode");

340.        Sensitive_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

341.          Glib.Properties.BuildTo API docTo specTo body ("sensitive");

342.        Visible_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

343.          Glib.Properties.BuildTo API docTo specTo body ("visible");

344.        Width_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

345.          Glib.Properties.BuildTo API docTo specTo body ("width");

346.        Xalign_PropertyTo API docTo spec : constant Glib.Properties.Property_FloatTo API docTo spec :=

347.          Glib.Properties.BuildTo API docTo specTo body ("xalign");

348.        Xpad_PropertyTo API docTo spec : constant Glib.Properties.Property_UintTo API docTo spec :=

349.          Glib.Properties.BuildTo API docTo specTo body ("xpad");

350.        Yalign_PropertyTo API docTo spec : constant Glib.Properties.Property_FloatTo API docTo spec :=

351.          Glib.Properties.BuildTo API docTo specTo body ("yalign");

352.        Ypad_PropertyTo API docTo spec : constant Glib.Properties.Property_UintTo API docTo spec :=

353.          Glib.Properties.BuildTo API docTo specTo body ("ypad");

355.        Cell_Renderer_SelectedTo API docTo spec    : constant Gtk_Cell_Renderer_StateTo API docTo spec := 2 ** 0;

356.        Cell_Renderer_PrelitTo API docTo spec      : constant Gtk_Cell_Renderer_StateTo API docTo spec := 2 ** 1;

357.        Cell_Renderer_InsensitiveTo API docTo spec : constant Gtk_Cell_Renderer_StateTo API docTo spec := 2 ** 2;

358.        Cell_Renderer_SortedTo API docTo spec      : constant Gtk_Cell_Renderer_StateTo API docTo spec := 2 ** 3;

359.        Cell_Renderer_FocusedTo API docTo spec     : constant Gtk_Cell_Renderer_StateTo API docTo spec := 2 ** 4;

360.     end Gtk.Cell_RendererTo API docTo specTo body;

362.     --  The following subprograms never had a binding, are now obsolescent

363.     --  No binding: gtk_cell_renderer_editing_canceled

364.     --  No binding: gtk_cell_renderer_stop_editing