1------------------------------------------------------------------------------
2--                                                                          --
3--      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       --
4--                     Copyright (C) 2000-2015, AdaCore                     --
5--                                                                          --
6-- This library is free software;  you can redistribute it and/or modify it --
7-- under terms of the  GNU General Public License  as published by the Free --
8-- Software  Foundation;  either version 3,  or (at your  option) any later --
9-- version. This library is distributed in the hope that it will be useful, --
10-- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- --
11-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            --
12--                                                                          --
13-- As a special exception under Section 7 of GPL version 3, you are granted --
14-- additional permissions described in the GCC Runtime Library Exception,   --
15-- version 3.1, as published by the Free Software Foundation.               --
16--                                                                          --
17-- You should have received a copy of the GNU General Public License and    --
18-- a copy of the GCC Runtime Library Exception along with this program;     --
19-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
20-- <http://www.gnu.org/licenses/>.                                          --
21--                                                                          --
22------------------------------------------------------------------------------
23
24pragma Style_Checks (Off);
25pragma Warnings (Off, "*is already use-visible*");
26
27package body Gtk.Target_Entry is
28
29   function From_Object_Free (B : access Gtk_Target_Entry) return Gtk_Target_Entry is
30      Result : constant Gtk_Target_Entry := B.all;
31   begin
32      Glib.g_free (B.all'Address);
33      return Result;
34   end From_Object_Free;
35
36   -------------
37   -- Gtk_New --
38   -------------
39
40   procedure Gtk_New
41      (Target_Entry : out Gtk_Target_Entry;
42       Target       : UTF8_String;
43       Flags        : Gtk.Enums.Gtk_Target_Flags;
44       Info         : Guint)
45   is
46      function Internal
47         (Target : Interfaces.C.Strings.chars_ptr;
48          Flags  : Gtk.Enums.Gtk_Target_Flags;
49          Info   : Guint) return Gtk_Target_Entry;
50      pragma Import (C, Internal, "gtk_target_entry_new");
51      Tmp_Target : Interfaces.C.Strings.chars_ptr := New_String (Target);
52      Tmp_Return : Gtk_Target_Entry;
53   begin
54      Tmp_Return := Internal (Tmp_Target, Flags, Info);
55      Free (Tmp_Target);
56      Target_Entry := Tmp_Return;
57   end Gtk_New;
58
59   --------------------------
60   -- Gtk_Target_Entry_New --
61   --------------------------
62
63   function Gtk_Target_Entry_New
64      (Target : UTF8_String;
65       Flags  : Gtk.Enums.Gtk_Target_Flags;
66       Info   : Guint) return Gtk_Target_Entry
67   is
68      function Internal
69         (Target : Interfaces.C.Strings.chars_ptr;
70          Flags  : Gtk.Enums.Gtk_Target_Flags;
71          Info   : Guint) return Gtk_Target_Entry;
72      pragma Import (C, Internal, "gtk_target_entry_new");
73      Tmp_Target   : Interfaces.C.Strings.chars_ptr := New_String (Target);
74      Tmp_Return   : Gtk_Target_Entry;
75      Target_Entry : Gtk_Target_Entry;
76   begin
77      Tmp_Return := Internal (Tmp_Target, Flags, Info);
78      Free (Tmp_Target);
79      Target_Entry := Tmp_Return;
80      return Target_Entry;
81   end Gtk_Target_Entry_New;
82
83end Gtk.Target_Entry;
84