## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --

5.     --                Copyright (C) 2000-2013, AdaCore                   --

6.     --                                                                   --

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

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

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

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

11.     --                                                                   --

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

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

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

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

16.     --                                                                   --

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

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

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

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

21.     --                                                                   --

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

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

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

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

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

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

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

30.     --  <description>

31.     --  This package provides support for drawing points, lines, arcs and text onto

32.     --  what are called 'drawables'. Drawables, as the name suggests, are things

33.     --  which support drawing onto them, and are either Gdk_Window or

34.     --  Gdk_Pixmap objects.

35.     --

36.     --  Many of the drawing operations take a Gdk_GC argument, which represents a

37.     --  graphics context. This Gdk_GC contains a number of drawing attributes such

38.     --  as foreground color, background color and line width, and is used to

39.     --  reduce the number of arguments needed for each drawing operation.

40.     --  See Gdk.GC for more information.

41.     --

42.     --  </description>

43.     --  <c_version>1.3.6</c_version>

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

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

47.     with Gdk.TypesTo API docTo spec;

48.     with Pango.LayoutTo API docTo specTo body;

50.     package Gdk.DrawableTo API docTo specTo body is

52.        subtype Gdk_Drawable is Gdk.Gdk_DrawableTo API docTo spec;

53.        --  A screen area that can be drawn upon.

55.        Null_Drawable : constant Gdk_DrawableTo API docTo spec;

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

58.        --  Return the internal value associated with a Gdk_Drawable.

60.        procedure Get_SizeTo API docTo body

61.          (Drawable : Gdk_DrawableTo API docTo spec;

62.           Width    : out GintTo API docTo spec;

63.           Height   : out GintTo API docTo spec);

64.        --  Return the width and height of a given drawable.

66.        procedure Set_ColormapTo API docTo body

67.          (Drawable : Gdk_DrawableTo API docTo spec; Colormap : Gdk.Gdk_ColormapTo API docTo spec);

69.        function Get_ColormapTo API docTo body

70.          (Drawable : Gdk_DrawableTo API docTo spec) return Gdk.Gdk_ColormapTo API docTo spec;

72.        function Get_VisualTo API docTo body (Drawable : Gdk_DrawableTo API docTo spec) return Gdk.Gdk_VisualTo API docTo spec;

74.        function Get_DepthTo API docTo body (Drawable : Gdk_DrawableTo API docTo spec) return GintTo API docTo spec;

76.        procedure RefTo API docTo body (Drawable : Gdk_DrawableTo API docTo spec);

78.        procedure UnrefTo API docTo body (Drawable : Gdk_DrawableTo API docTo spec);

80.        procedure Draw_PointTo API docTo body

81.          (Drawable : Gdk_DrawableTo API docTo spec;

82.           GC       : Gdk.Gdk_GCTo API docTo spec;

83.           X        : GintTo API docTo spec;

84.           Y        : GintTo API docTo spec);

85.        --  Draw a point, using the foreground color and other attributes of the Gc.

87.        procedure Draw_LineTo API docTo body

88.          (Drawable : Gdk_DrawableTo API docTo spec;

89.           GC       : Gdk.Gdk_GCTo API docTo spec;

90.           X1       : GintTo API docTo spec;

91.           Y1       : GintTo API docTo spec;

92.           X2       : GintTo API docTo spec;

93.           Y2       : GintTo API docTo spec);

94.        --  Draw a line, using the foreground color and other attributes of the Gc.

95.        --  (X1, Y1) is coordinate of the start point.

96.        --  (X2, Y2) is coordinate of the end point.

98.        procedure Draw_RectangleTo API docTo body

99.          (Drawable : Gdk_DrawableTo API docTo spec;

100.           GC       : Gdk.Gdk_GCTo API docTo spec;

101.           Filled   : Boolean := False;

102.           X        : GintTo API docTo spec;

103.           Y        : GintTo API docTo spec;

104.           Width    : GintTo API docTo spec;

105.           Height   : GintTo API docTo spec);

106.        --  Draw a rectangular outline or filled rectangle.

107.        --  Note that a rectangle drawn filled is 1 pixel smaller in both dimensions

108.        --  than a rectangle outlined. Calling

109.        --  Draw_Rectangle (Window, Gc, True, 0, 0, 20, 20) results in a filled

110.        --  rectangle 20 pixels wide and 20 pixels high. Calling

111.        --  Draw_Rectangle (Window, Gc, False, 0, 0, 20, 20) results in an outlined

112.        --  rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which

113.        --  makes it 21 pixels wide and 21 pixels high.

114.        --

115.        --  (X, Y) represents the coordinate of the top-left edge of the rectangle.

117.        procedure Draw_ArcTo API docTo body

118.          (Drawable : Gdk_DrawableTo API docTo spec;

119.           GC       : Gdk.Gdk_GCTo API docTo spec;

120.           Filled   : Boolean := False;

121.           X        : GintTo API docTo spec;

122.           Y        : GintTo API docTo spec;

123.           Width    : GintTo API docTo spec;

124.           Height   : GintTo API docTo spec;

125.           Angle1   : GintTo API docTo spec;

126.           Angle2   : GintTo API docTo spec);

127.        --  Draws an arc or a filled 'pie slice'.

128.        --  The arc is defined by the bounding rectangle of the entire ellipse, and

129.        --  the start and end angles of the part of the ellipse to be drawn.

130.        --  Filled is True if the arc should be filled, producing a 'pie slice'.

131.        --  (X, Y) represent the coordinate of the top-left edge of the bounding

132.        --  rectangle.

133.        --  Angle1 is the start angle of the arc, relative to the 3 o'clock

134.        --  position, counter-clockwise, in 1/64ths of a degree.

135.        --  Angle2 is the end angle of the arc, relative to angle1, in 1/64ths of a

136.        --  degree.

138.        procedure Draw_PolygonTo API docTo body

139.          (Drawable : Gdk_DrawableTo API docTo spec;

140.           GC       : Gdk.Gdk_GCTo API docTo spec;

141.           Filled   : Boolean;

142.           Points   : Gdk.Types.Gdk_Points_ArrayTo API docTo spec);

143.        --  Draw an outlined or filled polygon.

144.        --  Filled is True if the polygon should be filled. The polygon is closed

145.        --  automatically, connecting the last point to the first point if

146.        --  necessary.

147.        --  Points is an array of Gdk_Point specifying the points making up the

148.        --  polygon.

150.        procedure Draw_TextTo API docTo body

151.          (Drawable    : Gdk_DrawableTo API docTo spec;

152.           Font        : Gdk.Gdk_FontTo API docTo spec;

153.           GC          : Gdk.Gdk_GCTo API docTo spec;

154.           X           : GintTo API docTo spec;

155.           Y           : GintTo API docTo spec;

156.           Text        : UTF8_StringTo API docTo spec);

157.        --  Draw a string in the given font or fontset.

158.        --  X is the x coordinate of the left edge of the text.

159.        --  Y is the y coordinate of the baseline of the text.

160.        --

161.        --  You should use Gtk.Widget.Create_Pango_Layout instead to handle

162.        --  internationalization.

164.        procedure Draw_TextTo API docTo body

165.          (Drawable    : Gdk_DrawableTo API docTo spec;

166.           Font        : Gdk.Gdk_FontTo API docTo spec;

167.           GC          : Gdk.Gdk_GCTo API docTo spec;

168.           X           : GintTo API docTo spec;

169.           Y           : GintTo API docTo spec;

170.           Wide_Text   : Gdk.Types.Gdk_WStringTo API docTo spec);

171.        --  Draw a wide string in the given font of fontset.

172.        --  If the font is a 1-byte font, the string is converted into 1-byte

173.        --  characters (discarding the high bytes) before output.

175.        procedure Draw_DrawableTo API docTo body

176.          (Drawable : Gdk_DrawableTo API docTo spec;

177.           GC       : Gdk.Gdk_GCTo API docTo spec;

178.           Src      : Gdk_DrawableTo API docTo spec;

179.           Xsrc     : GintTo API docTo spec;

180.           Ysrc     : GintTo API docTo spec;

181.           Xdest    : GintTo API docTo spec;

182.           Ydest    : GintTo API docTo spec;

183.           Width    : GintTo API docTo spec := -1;

184.           Height   : GintTo API docTo spec := -1);

185.        --  Draw a pixmap, or a part of a pixmap, onto another drawable.

186.        --  Src is the source Gdk_Drawable to draw.

187.        --  Xsrc is the left edge of the source rectangle within Src.

188.        --  Ysrc is the top of the source rectangle within Src.

189.        --  Xdest is the x coordinate of the destination within Src.

190.        --  Ydest is the y coordinate of the destination within Src.

191.        --  Width is the width of the area to be copied, or -1 to make the area

192.        --  extend to the right edge of the source pixmap.

193.        --  Height is the height of the area to be copied, or -1 to make the area

194.        --  extend to the bottom edge of the source pixmap.

196.        procedure Draw_LayoutTo API docTo body

197.          (Drawable : Gdk_DrawableTo API docTo spec;

198.           GC       : Gdk.Gdk_GCTo API docTo spec;

199.           X        : GintTo API docTo spec;

200.           Y        : GintTo API docTo spec;

201.           Layout   : Pango.Layout.Pango_LayoutTo API docTo spec);

202.        --  Display the layout and its text in Drawable. This method should be

203.        --  preferred over Draw_Text.

205.        procedure Draw_Pixmap

206.          (Drawable : Gdk_DrawableTo API docTo spec;

207.           GC       : Gdk.Gdk_GCTo API docTo spec;

208.           Src      : Gdk_DrawableTo API docTo spec;

209.           Xsrc     : GintTo API docTo spec;

210.           Ysrc     : GintTo API docTo spec;

211.           Xdest    : GintTo API docTo spec;

212.           Ydest    : GintTo API docTo spec;

213.           Width    : GintTo API docTo spec := -1;

214.           Height   : GintTo API docTo spec := -1) renames Draw_DrawableTo API docTo specTo body;

215.        --  Deprecated, use Draw_Drawable instead.

217.        procedure Draw_ImageTo API docTo body

218.          (Drawable : Gdk_DrawableTo API docTo spec;

219.           GC       : Gdk.Gdk_GCTo API docTo spec;

220.           Image    : Gdk.Gdk_ImageTo API docTo spec;

221.           Xsrc     : GintTo API docTo spec;

222.           Ysrc     : GintTo API docTo spec;

223.           Xdest    : GintTo API docTo spec;

224.           Ydest    : GintTo API docTo spec;

225.           Width    : GintTo API docTo spec := -1;

226.           Height   : GintTo API docTo spec := -1);

227.        --  Draw a Gdk_Image onto a Drawable.

228.        --  The depth of the Gdk_Image must match the depth of the Gdk_Drawable.

229.        --  Image is the Gdk_Image to draw.

230.        --  Xsrc is the left edge of the source rectangle within Image.

231.        --  Ysrc is the top of the source rectangle within Image.

232.        --  Xdest is the x coordinate of the destination within Drawable.

233.        --  Ydest is the y coordinate of the destination within Drawable.

234.        --  Width is the width of the area to be copied, or -1 to make the area

235.        --  extend to the right edge of image.

236.        --  Height is the height of the area to be copied, or -1 to make the area

237.        --  extend to the bottom edge of image.

239.        procedure Draw_PointsTo API docTo body

240.          (Drawable : Gdk_DrawableTo API docTo spec;

241.           GC       : Gdk.Gdk_GCTo API docTo spec;

242.           Points   : Gdk.Types.Gdk_Points_ArrayTo API docTo spec);

243.        --  Draw a number of points.

244.        --  Use the foreground color and other attributes of the Gc.

246.        procedure Draw_SegmentsTo API docTo body

247.          (Drawable : in Gdk_DrawableTo API docTo spec;

248.           GC       : in Gdk.Gdk_GCTo API docTo spec;

249.           Segs     : in Gdk.Types.Gdk_Segments_ArrayTo API docTo spec);

250.        --  Draw a number of unconnected lines.

252.        procedure Draw_LinesTo API docTo body

253.          (Drawable : Gdk_DrawableTo API docTo spec;

254.           GC       : Gdk.Gdk_GCTo API docTo spec;

255.           Points   : Gdk.Types.Gdk_Points_ArrayTo API docTo spec);

256.        --  Draw a series of lines connecting the given points.

257.        --  The way in which joins between lines are drawn is determined by the

258.        --  Cap_Style value in the Gdk_GC. This can be set with

259.        --  Gdk.Gc.Set_Line_Attributes.

261.        function Get_ImageTo API docTo body

262.          (Drawable : Gdk_DrawableTo API docTo spec;

263.           X        : GintTo API docTo spec;

264.           Y        : GintTo API docTo spec;

265.           Width    : GintTo API docTo spec;

266.           Height   : GintTo API docTo spec) return Gdk_ImageTo API docTo spec;

268.        function Get_Clip_RegionTo API docTo body (Drawable : Gdk_DrawableTo API docTo spec) return Gdk.Gdk_RegionTo API docTo spec;

270.        function Get_Visible_RegionTo API docTo body (Drawable : Gdk_DrawableTo API docTo spec) return Gdk.Gdk_RegionTo API docTo spec;

272.     private

273.        Null_DrawableTo API docTo spec : constant Gdk_DrawableTo API docTo spec := null;

274.        pragma Import (C, Get_TypeTo API docTo spec, "gdk_drawable_get_type");

275.        pragma Import (C, Get_DepthTo API docTo spec, "gdk_drawable_get_depth");

276.        pragma Import (C, RefTo API docTo spec, "gdk_drawable_ref");

277.        pragma Import (C, UnrefTo API docTo spec, "gdk_drawable_unref");

278.        pragma Import (C, Get_SizeTo API docTo spec, "gdk_drawable_get_size");

279.        pragma Import (C, Get_ColormapTo API docTo spec, "gdk_drawable_get_colormap");

280.        pragma Import (C, Get_VisualTo API docTo spec, "gdk_drawable_get_visual");

281.        pragma Import (C, Set_ColormapTo API docTo spec, "gdk_drawable_set_colormap");

282.        pragma Import (C, Draw_DrawableTo API docTo spec, "gdk_draw_drawable");

283.        pragma Import (C, Draw_LineTo API docTo spec, "gdk_draw_line");

284.        pragma Import (C, Draw_PointTo API docTo spec, "gdk_draw_point");

285.        pragma Import (C, Draw_ImageTo API docTo spec, "gdk_draw_image");

286.        pragma Import (C, Get_ImageTo API docTo spec, "gdk_drawable_get_image");

287.        pragma Import (C, Get_Clip_RegionTo API docTo spec, "gdk_drawable_get_clip_region");

288.        pragma Import (C, Get_Visible_RegionTo API docTo spec, "gdk_drawable_get_visible_region");

289.     end Gdk.DrawableTo API docTo specTo body;

291.     --  <example>

292.     --  <include>../examples/documentation/draw.adb</include>

293.     --  </example>

295.     --  missing pango related functions:

296.     --  gdk_draw_glyphs

297.     --  gdk_draw_layout_line

298.     --  gdk_draw_layout_line_with_colors

299.     --  gdk_draw_layout_with_colors