## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

2.     --          GtkAda - Ada95 binding for the Gimp Toolkit              --

3.     --                                                                   --

4.     --                     Copyright (C) 1998-2000                       --

5.     --        Emmanuel Briot, Joel Brobecker and Arnaud Charlet          --

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.     --

32.     --  This package provides GtkAda specific types and their associated functions.

33.     --

34.     --  </description>

36.     with Interfaces.C.Strings;

38.     package Gtkada.TypesTo API docTo specTo body is

40.        pragma Preelaborate;

42.        Data_Error : exception;

44.        subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr;

45.        subtype Chars_Ptr_Array is Interfaces.C.Strings.chars_ptr_array;

47.        procedure g_freeTo API docTo body (Mem : Chars_PtrTo API docTo spec);

48.        --  Free a C string returned from Gtk

50.        Null_Ptr : Chars_PtrTo API docTo spec renames Interfaces.C.Strings.Null_Ptr;

52.        function Null_ArrayTo API docTo body return Chars_Ptr_ArrayTo API docTo spec;

53.        --  Return a null array.

54.        pragma Inline (Null_ArrayTo API docTo specTo body);

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

57.        --  Handling of arrays of Strings  --

58.        -------------------------------------

59.        --  The following functions provide a very convenient way to create

60.        --  C arrays of null terminated strings in Ada.

61.        --

62.        --  You can either create such a String on the fly, or declare a variable:

63.        --

64.        --     Signals : Chars_Ptr_Array := "clicked" + "missed" + "new signal";

65.        --

66.        --  which corresponds to the C declaration:

67.        --

68.        --     char *signals[] = @{"clicked", "missed", "new signal"@};

69.        --

70.        --  Note that you still need to manually call Free (Signals) if you want to

71.        --  release the memory dynamically allocated by the "+" functions.

73.        function "+"To API docTo body (S1, S2 : String) return Chars_Ptr_ArrayTo API docTo spec;

74.        --  Create an array containing S1 and S2.

75.        --  Note that this function allocates memory to store S1 and S2 as null

76.        --  terminated Strings. The user is responsible for calling Free on the

77.        --  resulting array.

79.        function "+"To API docTo body (S1 : Chars_Ptr_ArrayTo API docTo spec; S2 : String) return Chars_Ptr_ArrayTo API docTo spec;

80.        --  Append S2 to S1.

81.        --  Note that this function allocates memory to store S2 as a null

82.        --  terminated Strings. The user is responsible for calling Free on the

83.        --  resulting array.

85.        function "+"To API docTo body (S1 : Chars_Ptr_ArrayTo API docTo spec; S2 : Chars_PtrTo API docTo spec) return Chars_Ptr_ArrayTo API docTo spec;

86.        --  Append S2 to S1.

87.        --  Note that this function allocates memory to store S2 as a null

88.        --  terminated Strings. The user is responsible for calling Free on the

89.        --  resulting array.

91.        function "+"To API docTo body (S1 : Chars_PtrTo API docTo spec; S2 : String) return Chars_Ptr_ArrayTo API docTo spec;

92.        --  Create an array containing S1 and S2.

93.        --  Note that this function allocates memory to store S2 as a null

94.        --  terminated string. The user is responsible for calling Free on the

95.        --  resulting array.

97.        procedure FreeTo API docTo body (A : in out Chars_Ptr_ArrayTo API docTo spec);

98.        --  Free all the strings in A.

100.     private

101.        pragma Import (C, g_freeTo API docTo spec, "g_free");

102.     end Gtkada.TypesTo API docTo specTo body;