1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --                     Copyright (C) 2001-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. --  <group>Gdk, the low-level API</group> 
  25. with Glib; use Glib; 
  26. with Gdk.Drag_Contexts; use Gdk.Drag_Contexts; 
  27. with Gdk.Types; use Gdk.Types; 
  28. with Gdk.Screen; 
  29. with Gtk; 
  30. with Gtk.Target_List; 
  31.  
  32. package Gdk.Dnd is 
  33.  
  34.    type Gdk_Atom_Array is array (Natural range <>) of Gdk.Types.Gdk_Atom; 
  35.    function Get_Targets (Context : Drag_Context) return Gdk_Atom_Array; 
  36.    --  Return the list of targets supported by this context. 
  37.  
  38.    subtype Drag_Action is Gdk.Drag_Contexts.Gdk_Drag_Action; 
  39.    subtype Drag_Protocol is Gdk.Drag_Contexts.Gdk_Drag_Protocol; 
  40.  
  41.    Action_Any     : constant Drag_Action := 2 ** 8 - 1; 
  42.  
  43.    procedure Drag_Status 
  44.      (Context : Drag_Context; 
  45.       Action  : Drag_Action; 
  46.       Time    : Guint32); 
  47.  
  48.    procedure Drop_Reply 
  49.      (Context : Drag_Context; 
  50.       Ok      : Boolean; 
  51.       Time    : Guint32); 
  52.  
  53.    procedure Drop_Finish 
  54.      (Context : Drag_Context; 
  55.       Success : Boolean; 
  56.       Time    : Guint32); 
  57.    --  Clean up from the drag, and display snapback, if necessary. 
  58.  
  59.    function Drag_Get_Selection (Context : Drag_Context) return Gdk_Atom; 
  60.  
  61.    function Drag_Begin 
  62.      (Window  : Gdk.Gdk_Window; 
  63.       Targets : Gtk.Target_List.Gtk_Target_List) return Drag_Context; 
  64.  
  65.    function Drag_Context_Get_Protocol 
  66.      (Context  : Drag_Context; 
  67.       Protocol : Drag_Protocol) return Drag_Protocol; 
  68.    --  Return which drag protocol is recognized by a given context. 
  69.  
  70.    procedure Drag_Find_Window_For_Screen 
  71.      (Context     : Drag_Context; 
  72.       Drag_Window : Gdk.Gdk_Window; 
  73.       Screen      : Gdk.Screen.Gdk_Screen; 
  74.       X_Root      : Gint; 
  75.       Y_Root      : Gint; 
  76.       Dest_Window : Gdk.Gdk_Window; 
  77.       Protocol    : Drag_Protocol); 
  78.  
  79.    function Drag_Motion 
  80.      (Context          : Drag_Context; 
  81.       Dest_Window      : Gdk.Gdk_Window; 
  82.       Protocol         : Drag_Protocol; 
  83.       X_Root           : Gint; 
  84.       Y_Root           : Gint; 
  85.       Suggested_Action : Drag_Action; 
  86.       Possible_Actions : Drag_Action; 
  87.       Time             : Guint32) return Boolean; 
  88.  
  89.    procedure Drag_Drop (Context : Drag_Context; Time : Guint32); 
  90.  
  91.    procedure Drag_Abort (Context : Drag_Context; Time : Guint32); 
  92.  
  93. end Gdk.Dnd;