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 Gdk;                     use Gdk; 
  28. with Gdk.Device;              use Gdk.Device; 
  29. with Glib;                    use Glib; 
  30. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  31. with Glib.Object;             use Glib.Object; 
  32.  
  33. package Gdk.Drag_Contexts is 
  34.  
  35.    type Drag_Context_Record is new GObject_Record with null record; 
  36.    type Drag_Context is access all Drag_Context_Record'Class; 
  37.  
  38.    type Gdk_Drag_Action is mod 2 ** Integer'Size; 
  39.    pragma Convention (C, Gdk_Drag_Action); 
  40.    --  Used in Gdk.Drag_Contexts.Drag_Context to indicate what the destination 
  41.    --  should do with the dropped data. 
  42.  
  43.    Action_Default : constant Gdk_Drag_Action := 1; 
  44.    Action_Copy : constant Gdk_Drag_Action := 2; 
  45.    Action_Move : constant Gdk_Drag_Action := 4; 
  46.    Action_Link : constant Gdk_Drag_Action := 8; 
  47.    Action_Private : constant Gdk_Drag_Action := 16; 
  48.    Action_Ask : constant Gdk_Drag_Action := 32; 
  49.  
  50.    type Gdk_Drag_Protocol is ( 
  51.       Drag_Proto_None, 
  52.       Drag_Proto_Motif, 
  53.       Drag_Proto_Xdnd, 
  54.       Drag_Proto_Rootwin, 
  55.       Drag_Proto_Win32_Dropfiles, 
  56.       Drag_Proto_Ole2, 
  57.       Drag_Proto_Local); 
  58.    pragma Convention (C, Gdk_Drag_Protocol); 
  59.    --  Used in Gdk.Drag_Contexts.Drag_Context to indicate the protocol 
  60.    --  according to which DND is done. 
  61.  
  62.    ---------------------------- 
  63.    -- Enumeration Properties -- 
  64.    ---------------------------- 
  65.  
  66.    package Gdk_Drag_Action_Properties is 
  67.       new Generic_Internal_Discrete_Property (Gdk_Drag_Action); 
  68.    type Property_Gdk_Drag_Action is new Gdk_Drag_Action_Properties.Property; 
  69.  
  70.    package Gdk_Drag_Protocol_Properties is 
  71.       new Generic_Internal_Discrete_Property (Gdk_Drag_Protocol); 
  72.    type Property_Gdk_Drag_Protocol is new Gdk_Drag_Protocol_Properties.Property; 
  73.  
  74.    ------------------ 
  75.    -- Constructors -- 
  76.    ------------------ 
  77.  
  78.    function Get_Type return Glib.GType; 
  79.    pragma Import (C, Get_Type, "gdk_drag_context_get_type"); 
  80.  
  81.    ------------- 
  82.    -- Methods -- 
  83.    ------------- 
  84.  
  85.    function Get_Actions 
  86.       (Self : not null access Drag_Context_Record) return Gdk_Drag_Action; 
  87.    --  Determines the bitmask of actions proposed by the source if 
  88.    --  Gdk.Drag_Contexts.Get_Suggested_Action returns GDK_ACTION_ASK. 
  89.    --  Since: gtk+ 2.22 
  90.  
  91.    function Get_Dest_Window 
  92.       (Self : not null access Drag_Context_Record) return Gdk.Gdk_Window; 
  93.    --  Returns the destination windw for the DND operation. 
  94.    --  Since: gtk+ 3.0 
  95.  
  96.    function Get_Device 
  97.       (Self : not null access Drag_Context_Record) 
  98.        return Gdk.Device.Gdk_Device; 
  99.    --  Returns the Gdk.Device.Gdk_Device associated to the drag context. 
  100.  
  101.    procedure Set_Device 
  102.       (Self   : not null access Drag_Context_Record; 
  103.        Device : not null access Gdk.Device.Gdk_Device_Record'Class); 
  104.    --  Associates a Gdk.Device.Gdk_Device to Context, so all Drag and Drop 
  105.    --  events for Context are emitted as if they came from this device. 
  106.    --  "device": a Gdk.Device.Gdk_Device 
  107.  
  108.    function Get_Protocol 
  109.       (Self : not null access Drag_Context_Record) return Gdk_Drag_Protocol; 
  110.    --  Returns the drag protocol thats used by this context. 
  111.    --  Since: gtk+ 3.0 
  112.  
  113.    function Get_Selected_Action 
  114.       (Self : not null access Drag_Context_Record) return Gdk_Drag_Action; 
  115.    --  Determines the action chosen by the drag destination. 
  116.    --  Since: gtk+ 2.22 
  117.  
  118.    function Get_Source_Window 
  119.       (Self : not null access Drag_Context_Record) return Gdk.Gdk_Window; 
  120.    --  Returns the Gdk.Gdk_Window where the DND operation started. 
  121.    --  Since: gtk+ 2.22 
  122.  
  123.    function Get_Suggested_Action 
  124.       (Self : not null access Drag_Context_Record) return Gdk_Drag_Action; 
  125.    --  Determines the suggested drag action of the context. 
  126.    --  Since: gtk+ 2.22 
  127.  
  128. end Gdk.Drag_Contexts;