1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, 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.  
  24. pragma Ada_2005; 
  25.  
  26. pragma Warnings (Off, "*is already use-visible*"); 
  27. with Glib;               use Glib; 
  28. with Glib.Types;         use Glib.Types; 
  29. with Gtk.Selection_Data; use Gtk.Selection_Data; 
  30. with Gtk.Tree_Model;     use Gtk.Tree_Model; 
  31.  
  32. package Gtk.Tree_Drag_Dest is 
  33.  
  34.    type Gtk_Tree_Drag_Dest is new Glib.Types.GType_Interface; 
  35.    Null_Gtk_Tree_Drag_Dest : constant Gtk_Tree_Drag_Dest; 
  36.  
  37.    ------------------ 
  38.    -- Constructors -- 
  39.    ------------------ 
  40.  
  41.    function Get_Type return Glib.GType; 
  42.    pragma Import (C, Get_Type, "gtk_tree_drag_dest_get_type"); 
  43.  
  44.    ------------- 
  45.    -- Methods -- 
  46.    ------------- 
  47.  
  48.    function Drag_Data_Received 
  49.       (Self           : Gtk_Tree_Drag_Dest; 
  50.        Dest           : Gtk.Tree_Model.Gtk_Tree_Path; 
  51.        Selection_Data : Gtk.Selection_Data.Gtk_Selection_Data) 
  52.        return Boolean; 
  53.    --  Asks the Gtk.Tree_Drag_Dest.Gtk_Tree_Drag_Dest to insert a row before 
  54.    --  the path Dest, deriving the contents of the row from Selection_Data. If 
  55.    --  Dest is outside the tree so that inserting before it is impossible, 
  56.    --  False will be returned. Also, False may be returned if the new row is 
  57.    --  not created for some model-specific reason. Should robustly handle a 
  58.    --  Dest no longer found in the model! 
  59.    --  "dest": row to drop in front of 
  60.    --  "selection_data": data to drop 
  61.  
  62.    function Row_Drop_Possible 
  63.       (Self           : Gtk_Tree_Drag_Dest; 
  64.        Dest_Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  65.        Selection_Data : Gtk.Selection_Data.Gtk_Selection_Data) 
  66.        return Boolean; 
  67.    --  Determines whether a drop is possible before the given Dest_Path, at 
  68.    --  the same depth as Dest_Path. i.e., can we drop the data in 
  69.    --  Selection_Data at that location. Dest_Path does not have to exist; the 
  70.    --  return value will almost certainly be False if the parent of Dest_Path 
  71.    --  doesn't exist, though. 
  72.    --  "dest_path": destination row 
  73.    --  "selection_data": the data being dragged 
  74.  
  75.    ---------------- 
  76.    -- Interfaces -- 
  77.    ---------------- 
  78.    --  This class implements several interfaces. See Glib.Types 
  79.    -- 
  80.    --  - "Gtk_Tree_Drag_Dest" 
  81.  
  82.    function "+" (W : Gtk_Tree_Drag_Dest) return Gtk_Tree_Drag_Dest; 
  83.    pragma Inline ("+"); 
  84.  
  85. private 
  86.  
  87. Null_Gtk_Tree_Drag_Dest : constant Gtk_Tree_Drag_Dest := 
  88.    Gtk_Tree_Drag_Dest (Glib.Types.Null_Interface); 
  89. end Gtk.Tree_Drag_Dest;