## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --                 Copyright (C) 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.     --  Utility functions that mimic Gtk.Style drawing methods, but using Cairo

31.     --  instead of Gdk. This allow smooth transition to Gtk3 that will get rid

32.     --  of those Gdk drawing methods and only use Cairo.

33.     --  </description>

34.     --  <group>Configuration and Themes</group>

36.     with GlibTo API docTo specTo body;

38.     with CairoTo API docTo specTo body;

40.     with Pango.LayoutTo API docTo specTo body;

42.     with Gdk.ColorTo API docTo specTo body;

43.     with Gdk.PixbufTo API docTo specTo body;

45.     with Gtk.EnumsTo API docTo specTo body;

46.     with Gtk.StyleTo API docTo specTo body;

48.     package Gtkada.StyleTo API docTo specTo body is

50.        --------------------

51.        -- Color handling --

52.        --------------------

54.        subtype Cairo_Color_Val is Glib.GdoubleTo API docTo spec range 0.0 .. 1.0;

55.        --  In cairo, the color components are expressed as percents.

57.        type Cairo_Color is record

58.           R, G, B : Cairo_Color_ValTo API docTo spec;

59.           Alpha   : Cairo_Color_ValTo API docTo spec := 1.0;

60.        end record;

62.        type HSV_Color is record

63.           H, S, V, A : Cairo_Color_ValTo API docTo spec;

64.        end record;

65.        --  Used when manipulating Cairo color. The HSV color space is useful when

66.        --  wanting to shade a color (change it's value), (de)saturate it, or modify

67.        --  its hue.

69.        function To_HSVTo API docTo body (ColorTo API docTo body   : Cairo_ColorTo API docTo spec) return HSV_ColorTo API docTo spec;

70.        function To_CairoTo API docTo body (HSVTo API docTo body : HSV_ColorTo API docTo spec) return Cairo_ColorTo API docTo spec;

71.        function To_CairoTo API docTo body (ColorTo API docTo body : Gdk.Color.Gdk_ColorTo API docTo specTo body) return Cairo_ColorTo API docTo spec;

72.        --  Translations between one color definition to another

74.        function ShadeTo API docTo body

75.          (ColorTo API docTo body : Gdk.Color.Gdk_ColorTo API docTo specTo body;

76.           Value : Glib.GdoubleTo API docTo spec) return Cairo_ColorTo API docTo spec;

77.        function ShadeTo API docTo body

78.          (ColorTo API docTo body : Cairo_ColorTo API docTo spec;

79.           Value : Glib.GdoubleTo API docTo spec) return Cairo_ColorTo API docTo spec;

80.        --  Modifies the lightning of the color by the specified value

82.        procedure Set_Source_ColorTo API docTo body

83.          (Cr : Cairo.Cairo_ContextTo API docTo spec; ColorTo API docTo body : Cairo_ColorTo API docTo spec);

85.        -----------------------------

86.        -- Extra path manipulation --

87.        -----------------------------

89.        procedure Rounded_RectangleTo API docTo body

90.          (Cr         : Cairo.Cairo_ContextTo API docTo spec;

91.           X, Y, W, H : Glib.GdoubleTo API docTo spec;

92.           Radius     : Glib.GdoubleTo API docTo spec);

93.        --  Draws a rounded rectangle at coordinate X, Y with W and H size.

94.        --  If Radius > 0, then the corner will be rounded.

96.        -------------------------

97.        -- Drawing subprograms --

98.        -------------------------

100.        procedure Draw_ShadowTo API docTo body

101.          (Cr                  : Cairo.Cairo_ContextTo API docTo spec;

102.           Style               : Gtk.Style.Gtk_StyleTo API docTo spec;

103.           Shadow_TypeTo API docTo body         : Gtk.Enums.Gtk_Shadow_TypeTo API docTo spec;

104.           X, Y, Width, Height : Glib.GintTo API docTo spec;

105.           Corner_Radius       : Glib.GdoubleTo API docTo spec := 0.0);

106.        --  Draws a Frame of size Width x Height at position (X, Y) and (X2, Y2)

107.        --  using the specified color.

108.        --  Corner_Radius allows you to draw a rounded frame if set to a value > 0.

109.        --

110.        --  Additional drawing styles can be specified by using Cairo.Set_Line_XXXX

111.        --  on the Cairo_Context before calling this procedure.

113.        procedure Draw_RectangleTo API docTo body

114.          (Cr                  : Cairo.Cairo_ContextTo API docTo spec;

115.           ColorTo API docTo body               : Cairo_ColorTo API docTo spec;

116.           Filled              : Boolean;

117.           X, Y, Width, Height : Glib.GintTo API docTo spec;

118.           Corner_Radius       : Glib.GdoubleTo API docTo spec := 0.0);

119.        procedure Draw_RectangleTo API docTo body

120.          (Cr                  : Cairo.Cairo_ContextTo API docTo spec;

121.           ColorTo API docTo body               : Gdk.Color.Gdk_ColorTo API docTo specTo body;

122.           Filled              : Boolean;

123.           X, Y, Width, Height : Glib.GintTo API docTo spec;

124.           Corner_Radius       : Glib.GdoubleTo API docTo spec := 0.0);

125.        --  Draws a rectangle of size Width x Height at position (X, Y) and (X2, Y2)

126.        --  using the specified color.

127.        --  Corner_Radius allows you to draw a rounded rectangle if set to a

128.        --  value > 0.0

129.        --

130.        --  Additional drawing styles can be specified by using Cairo.Set_Line_XXXX

131.        --  on the Cairo_Context before calling this procedure.

133.        procedure Draw_LineTo API docTo body

134.          (Cr             : Cairo.Cairo_ContextTo API docTo spec;

135.           ColorTo API docTo body          : Cairo_ColorTo API docTo spec;

136.           X1, Y1, X2, Y2 : Glib.GintTo API docTo spec);

137.        procedure Draw_LineTo API docTo body

138.          (Cr             : Cairo.Cairo_ContextTo API docTo spec;

139.           ColorTo API docTo body          : Gdk.Color.Gdk_ColorTo API docTo specTo body;

140.           X1, Y1, X2, Y2 : Glib.GintTo API docTo spec);

141.        --  Draws a line between (X1, Y1) and (X2, Y2) using the specified color.

142.        --

143.        --  Additional drawing styles can be specified by using Cairo.Set_Line_XXXX

144.        --  on the Cairo_Context before calling this procedure.

146.        procedure Draw_LayoutTo API docTo body

147.          (Cr     : Cairo.Cairo_ContextTo API docTo spec;

148.           ColorTo API docTo body  : Cairo_ColorTo API docTo spec;

149.           X, Y   : Glib.GintTo API docTo spec;

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

151.        procedure Draw_LayoutTo API docTo body

152.          (Cr     : Cairo.Cairo_ContextTo API docTo spec;

153.           ColorTo API docTo body  : Gdk.Color.Gdk_ColorTo API docTo specTo body;

154.           X, Y   : Glib.GintTo API docTo spec;

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

156.        --  Draws the Pango layout at position (X, Y) using Color.

158.        procedure Draw_PixbufTo API docTo body

159.          (Cr     : Cairo.Cairo_ContextTo API docTo spec;

160.           Pixbuf : Gdk.Pixbuf.Gdk_PixbufTo API docTo spec;

161.           X, Y   : Glib.GintTo API docTo spec);

162.        --  Draws a pixbuf at coordinate X, Y

163.        --

164.        --  Note that Gdk_Pixmap or Gdk_Bitmap are not supported, as those

165.        --  are server-side images, so depend on a surface attached to a screen.

166.        --  As a result, those would not be drawn on a non-screen surface (such as

167.        --  an internal Image_Surface).

169.     end Gtkada.StyleTo API docTo specTo body;