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. --  <description> 
  25. --  The Gdk.Gdk_Cursor structure represents a cursor. Its contents are 
  26. --  private. 
  27. -- 
  28. --  </description> 
  29. pragma Ada_2005; 
  30.  
  31. pragma Warnings (Off, "*is already use-visible*"); 
  32. with Gdk.Display;             use Gdk.Display; 
  33. with Glib;                    use Glib; 
  34. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  35. with Glib.Object;             use Glib.Object; 
  36. with Glib.Properties;         use Glib.Properties; 
  37.  
  38. package Gdk.Cursor is 
  39.  
  40.    type Gdk_Cursor_Type is ( 
  41.       Blank_Cursor, 
  42.       Cursor_Is_Pixmap, 
  43.       X_Cursor, 
  44.       Arrow, 
  45.       Based_Arrow_Down, 
  46.       Based_Arrow_Up, 
  47.       Boat, 
  48.       Bogosity, 
  49.       Bottom_Left_Corner, 
  50.       Bottom_Right_Corner, 
  51.       Bottom_Side, 
  52.       Bottom_Tee, 
  53.       Box_Spiral, 
  54.       Center_Ptr, 
  55.       Circle, 
  56.       Clock, 
  57.       Coffee_Mug, 
  58.       Cross, 
  59.       Cross_Reverse, 
  60.       Crosshair, 
  61.       Diamond_Cross, 
  62.       Dot, 
  63.       Dotbox, 
  64.       Double_Arrow, 
  65.       Draft_Large, 
  66.       Draft_Small, 
  67.       Draped_Box, 
  68.       Exchange, 
  69.       Fleur, 
  70.       Gobbler, 
  71.       Gumby, 
  72.       Hand1, 
  73.       Hand2, 
  74.       Heart, 
  75.       Icon, 
  76.       Iron_Cross, 
  77.       Left_Ptr, 
  78.       Left_Side, 
  79.       Left_Tee, 
  80.       Leftbutton, 
  81.       Ll_Angle, 
  82.       Lr_Angle, 
  83.       Man, 
  84.       Middlebutton, 
  85.       Mouse, 
  86.       Pencil, 
  87.       Pirate, 
  88.       Plus, 
  89.       Question_Arrow, 
  90.       Right_Ptr, 
  91.       Right_Side, 
  92.       Right_Tee, 
  93.       Rightbutton, 
  94.       Rtl_Logo, 
  95.       Sailboat, 
  96.       Sb_Down_Arrow, 
  97.       Sb_H_Double_Arrow, 
  98.       Sb_Left_Arrow, 
  99.       Sb_Right_Arrow, 
  100.       Sb_Up_Arrow, 
  101.       Sb_V_Double_Arrow, 
  102.       Shuttle, 
  103.       Sizing, 
  104.       Spider, 
  105.       Spraycan, 
  106.       Star, 
  107.       Target, 
  108.       Tcross, 
  109.       Top_Left_Arrow, 
  110.       Top_Left_Corner, 
  111.       Top_Right_Corner, 
  112.       Top_Side, 
  113.       Top_Tee, 
  114.       Trek, 
  115.       Ul_Angle, 
  116.       Umbrella, 
  117.       Ur_Angle, 
  118.       Watch, 
  119.       Xterm, 
  120.       Last_Cursor); 
  121.    pragma Convention (C, Gdk_Cursor_Type); 
  122.    --  The standard cursors available. 
  123.  
  124.    for Gdk_Cursor_Type use ( 
  125.       Blank_Cursor => -2, 
  126.       Cursor_Is_Pixmap => -1, 
  127.       X_Cursor => 0, 
  128.       Arrow => 2, 
  129.       Based_Arrow_Down => 4, 
  130.       Based_Arrow_Up => 6, 
  131.       Boat => 8, 
  132.       Bogosity => 10, 
  133.       Bottom_Left_Corner => 12, 
  134.       Bottom_Right_Corner => 14, 
  135.       Bottom_Side => 16, 
  136.       Bottom_Tee => 18, 
  137.       Box_Spiral => 20, 
  138.       Center_Ptr => 22, 
  139.       Circle => 24, 
  140.       Clock => 26, 
  141.       Coffee_Mug => 28, 
  142.       Cross => 30, 
  143.       Cross_Reverse => 32, 
  144.       Crosshair => 34, 
  145.       Diamond_Cross => 36, 
  146.       Dot => 38, 
  147.       Dotbox => 40, 
  148.       Double_Arrow => 42, 
  149.       Draft_Large => 44, 
  150.       Draft_Small => 46, 
  151.       Draped_Box => 48, 
  152.       Exchange => 50, 
  153.       Fleur => 52, 
  154.       Gobbler => 54, 
  155.       Gumby => 56, 
  156.       Hand1 => 58, 
  157.       Hand2 => 60, 
  158.       Heart => 62, 
  159.       Icon => 64, 
  160.       Iron_Cross => 66, 
  161.       Left_Ptr => 68, 
  162.       Left_Side => 70, 
  163.       Left_Tee => 72, 
  164.       Leftbutton => 74, 
  165.       Ll_Angle => 76, 
  166.       Lr_Angle => 78, 
  167.       Man => 80, 
  168.       Middlebutton => 82, 
  169.       Mouse => 84, 
  170.       Pencil => 86, 
  171.       Pirate => 88, 
  172.       Plus => 90, 
  173.       Question_Arrow => 92, 
  174.       Right_Ptr => 94, 
  175.       Right_Side => 96, 
  176.       Right_Tee => 98, 
  177.       Rightbutton => 100, 
  178.       Rtl_Logo => 102, 
  179.       Sailboat => 104, 
  180.       Sb_Down_Arrow => 106, 
  181.       Sb_H_Double_Arrow => 108, 
  182.       Sb_Left_Arrow => 110, 
  183.       Sb_Right_Arrow => 112, 
  184.       Sb_Up_Arrow => 114, 
  185.       Sb_V_Double_Arrow => 116, 
  186.       Shuttle => 118, 
  187.       Sizing => 120, 
  188.       Spider => 122, 
  189.       Spraycan => 124, 
  190.       Star => 126, 
  191.       Target => 128, 
  192.       Tcross => 130, 
  193.       Top_Left_Arrow => 132, 
  194.       Top_Left_Corner => 134, 
  195.       Top_Right_Corner => 136, 
  196.       Top_Side => 138, 
  197.       Top_Tee => 140, 
  198.       Trek => 142, 
  199.       Ul_Angle => 144, 
  200.       Umbrella => 146, 
  201.       Ur_Angle => 148, 
  202.       Watch => 150, 
  203.       Xterm => 152, 
  204.       Last_Cursor => 153); 
  205.  
  206.    ---------------------------- 
  207.    -- Enumeration Properties -- 
  208.    ---------------------------- 
  209.  
  210.    package Gdk_Cursor_Type_Properties is 
  211.       new Generic_Internal_Discrete_Property (Gdk_Cursor_Type); 
  212.    type Property_Gdk_Cursor_Type is new Gdk_Cursor_Type_Properties.Property; 
  213.  
  214.    ------------------ 
  215.    -- Constructors -- 
  216.    ------------------ 
  217.  
  218.    procedure Gdk_New (Self : out Gdk_Cursor; Cursor_Type : Gdk_Cursor_Type); 
  219.    --  Creates a new cursor from the set of builtin cursors for the default 
  220.    --  display. See gdk_cursor_new_for_display. 
  221.    --  To make the cursor invisible, use Gdk.Blank_Cursor. 
  222.    --  "cursor_type": cursor to create 
  223.  
  224.    function Gdk_Cursor_New (Cursor_Type : Gdk_Cursor_Type) return Gdk_Cursor; 
  225.    --  Creates a new cursor from the set of builtin cursors for the default 
  226.    --  display. See gdk_cursor_new_for_display. 
  227.    --  To make the cursor invisible, use Gdk.Blank_Cursor. 
  228.    --  "cursor_type": cursor to create 
  229.  
  230.    procedure Gdk_New_For_Display 
  231.       (Self        : out Gdk_Cursor; 
  232.        Display     : not null access Gdk.Display.Gdk_Display_Record'Class; 
  233.        Cursor_Type : Gdk_Cursor_Type); 
  234.    --  Creates a new cursor from the set of builtin cursors. Some useful ones 
  235.    --  are: 
  236.    --     * <inlinegraphic format="PNG" 
  237.    --  fileref="right_ptr.png"></inlinegraphic> GDK_RIGHT_PTR (right-facing 
  238.    --  arrow) 
  239.    --     * <inlinegraphic format="PNG" 
  240.    --  fileref="crosshair.png"></inlinegraphic> GDK_CROSSHAIR (crosshair) 
  241.    --     * <inlinegraphic format="PNG" fileref="xterm.png"></inlinegraphic> 
  242.    --  GDK_XTERM (I-beam) 
  243.    --     * <inlinegraphic format="PNG" fileref="watch.png"></inlinegraphic> 
  244.    --  GDK_WATCH (busy) 
  245.    --     * <inlinegraphic format="PNG" fileref="fleur.png"></inlinegraphic> 
  246.    --  GDK_FLEUR (for moving objects) 
  247.    --     * <inlinegraphic format="PNG" fileref="hand1.png"></inlinegraphic> 
  248.    --  GDK_HAND1 (a right-pointing hand) 
  249.    --     * <inlinegraphic format="PNG" fileref="hand2.png"></inlinegraphic> 
  250.    --  GDK_HAND2 (a left-pointing hand) 
  251.    --     * <inlinegraphic format="PNG" 
  252.    --  fileref="left_side.png"></inlinegraphic> GDK_LEFT_SIDE (resize left 
  253.    --  side) 
  254.    --     * <inlinegraphic format="PNG" 
  255.    --  fileref="right_side.png"></inlinegraphic> GDK_RIGHT_SIDE (resize right 
  256.    --  side) 
  257.    --     * <inlinegraphic format="PNG" 
  258.    --  fileref="top_left_corner.png"></inlinegraphic> GDK_TOP_LEFT_CORNER 
  259.    --  (resize northwest corner) 
  260.    --     * <inlinegraphic format="PNG" 
  261.    --  fileref="top_right_corner.png"></inlinegraphic> GDK_TOP_RIGHT_CORNER 
  262.    --  (resize northeast corner) 
  263.    --     * <inlinegraphic format="PNG" 
  264.    --  fileref="bottom_left_corner.png"></inlinegraphic> GDK_BOTTOM_LEFT_CORNER 
  265.    --  (resize southwest corner) 
  266.    --     * <inlinegraphic format="PNG" 
  267.    --  fileref="bottom_right_corner.png"></inlinegraphic> 
  268.    --  GDK_BOTTOM_RIGHT_CORNER (resize southeast corner) 
  269.    --     * <inlinegraphic format="PNG" 
  270.    --  fileref="top_side.png"></inlinegraphic> GDK_TOP_SIDE (resize top side) 
  271.    --     * <inlinegraphic format="PNG" 
  272.    --  fileref="bottom_side.png"></inlinegraphic> GDK_BOTTOM_SIDE (resize 
  273.    --  bottom side) 
  274.    --     * <inlinegraphic format="PNG" 
  275.    --  fileref="sb_h_double_arrow.png"></inlinegraphic> GDK_SB_H_DOUBLE_ARROW 
  276.    --  (move vertical splitter) 
  277.    --     * <inlinegraphic format="PNG" 
  278.    --  fileref="sb_v_double_arrow.png"></inlinegraphic> GDK_SB_V_DOUBLE_ARROW 
  279.    --  (move horizontal splitter) 
  280.    --     * GDK_BLANK_CURSOR (Blank cursor). Since 2.16 
  281.    --  Since: gtk+ 2.2 
  282.    --  "display": the Gdk.Display.Gdk_Display for which the cursor will be 
  283.    --  created 
  284.    --  "cursor_type": cursor to create 
  285.  
  286.    function Gdk_Cursor_New_For_Display 
  287.       (Display     : not null access Gdk.Display.Gdk_Display_Record'Class; 
  288.        Cursor_Type : Gdk_Cursor_Type) return Gdk_Cursor; 
  289.    --  Creates a new cursor from the set of builtin cursors. Some useful ones 
  290.    --  are: 
  291.    --     * <inlinegraphic format="PNG" 
  292.    --  fileref="right_ptr.png"></inlinegraphic> GDK_RIGHT_PTR (right-facing 
  293.    --  arrow) 
  294.    --     * <inlinegraphic format="PNG" 
  295.    --  fileref="crosshair.png"></inlinegraphic> GDK_CROSSHAIR (crosshair) 
  296.    --     * <inlinegraphic format="PNG" fileref="xterm.png"></inlinegraphic> 
  297.    --  GDK_XTERM (I-beam) 
  298.    --     * <inlinegraphic format="PNG" fileref="watch.png"></inlinegraphic> 
  299.    --  GDK_WATCH (busy) 
  300.    --     * <inlinegraphic format="PNG" fileref="fleur.png"></inlinegraphic> 
  301.    --  GDK_FLEUR (for moving objects) 
  302.    --     * <inlinegraphic format="PNG" fileref="hand1.png"></inlinegraphic> 
  303.    --  GDK_HAND1 (a right-pointing hand) 
  304.    --     * <inlinegraphic format="PNG" fileref="hand2.png"></inlinegraphic> 
  305.    --  GDK_HAND2 (a left-pointing hand) 
  306.    --     * <inlinegraphic format="PNG" 
  307.    --  fileref="left_side.png"></inlinegraphic> GDK_LEFT_SIDE (resize left 
  308.    --  side) 
  309.    --     * <inlinegraphic format="PNG" 
  310.    --  fileref="right_side.png"></inlinegraphic> GDK_RIGHT_SIDE (resize right 
  311.    --  side) 
  312.    --     * <inlinegraphic format="PNG" 
  313.    --  fileref="top_left_corner.png"></inlinegraphic> GDK_TOP_LEFT_CORNER 
  314.    --  (resize northwest corner) 
  315.    --     * <inlinegraphic format="PNG" 
  316.    --  fileref="top_right_corner.png"></inlinegraphic> GDK_TOP_RIGHT_CORNER 
  317.    --  (resize northeast corner) 
  318.    --     * <inlinegraphic format="PNG" 
  319.    --  fileref="bottom_left_corner.png"></inlinegraphic> GDK_BOTTOM_LEFT_CORNER 
  320.    --  (resize southwest corner) 
  321.    --     * <inlinegraphic format="PNG" 
  322.    --  fileref="bottom_right_corner.png"></inlinegraphic> 
  323.    --  GDK_BOTTOM_RIGHT_CORNER (resize southeast corner) 
  324.    --     * <inlinegraphic format="PNG" 
  325.    --  fileref="top_side.png"></inlinegraphic> GDK_TOP_SIDE (resize top side) 
  326.    --     * <inlinegraphic format="PNG" 
  327.    --  fileref="bottom_side.png"></inlinegraphic> GDK_BOTTOM_SIDE (resize 
  328.    --  bottom side) 
  329.    --     * <inlinegraphic format="PNG" 
  330.    --  fileref="sb_h_double_arrow.png"></inlinegraphic> GDK_SB_H_DOUBLE_ARROW 
  331.    --  (move vertical splitter) 
  332.    --     * <inlinegraphic format="PNG" 
  333.    --  fileref="sb_v_double_arrow.png"></inlinegraphic> GDK_SB_V_DOUBLE_ARROW 
  334.    --  (move horizontal splitter) 
  335.    --     * GDK_BLANK_CURSOR (Blank cursor). Since 2.16 
  336.    --  Since: gtk+ 2.2 
  337.    --  "display": the Gdk.Display.Gdk_Display for which the cursor will be 
  338.    --  created 
  339.    --  "cursor_type": cursor to create 
  340.  
  341.    procedure Gdk_New_From_Name 
  342.       (Self    : out Gdk_Cursor; 
  343.        Display : not null access Gdk.Display.Gdk_Display_Record'Class; 
  344.        Name    : UTF8_String); 
  345.    --  Creates a new cursor by looking up Name in the current cursor theme. 
  346.    --  Since: gtk+ 2.8 
  347.    --  "display": the Gdk.Display.Gdk_Display for which the cursor will be 
  348.    --  created 
  349.    --  "name": the name of the cursor 
  350.  
  351.    function Gdk_Cursor_New_From_Name 
  352.       (Display : not null access Gdk.Display.Gdk_Display_Record'Class; 
  353.        Name    : UTF8_String) return Gdk_Cursor; 
  354.    --  Creates a new cursor by looking up Name in the current cursor theme. 
  355.    --  Since: gtk+ 2.8 
  356.    --  "display": the Gdk.Display.Gdk_Display for which the cursor will be 
  357.    --  created 
  358.    --  "name": the name of the cursor 
  359.  
  360.    function Get_Type return Glib.GType; 
  361.    pragma Import (C, Get_Type, "gdk_cursor_get_type"); 
  362.  
  363.    ------------- 
  364.    -- Methods -- 
  365.    ------------- 
  366.  
  367.    function Get_Cursor_Type (Self : Gdk.Gdk_Cursor) return Gdk_Cursor_Type; 
  368.    pragma Import (C, Get_Cursor_Type, "gdk_cursor_get_cursor_type"); 
  369.    --  Returns the cursor type for this cursor. 
  370.    --  Since: gtk+ 2.22 
  371.  
  372.    function Get_Display 
  373.       (Self : Gdk.Gdk_Cursor) return Gdk.Display.Gdk_Display; 
  374.    --  Returns the display on which the Gdk.Gdk_Cursor is defined. 
  375.    --  Since: gtk+ 2.2 
  376.  
  377.    ---------------------- 
  378.    -- GtkAda additions -- 
  379.    ---------------------- 
  380.  
  381.    procedure Ref (Self : Gdk.Gdk_Cursor); 
  382.    pragma Import (C, Ref, "g_object_ref"); 
  383.  
  384.    procedure Unref (Self : Gdk.Gdk_Cursor); 
  385.    pragma Import (C, Unref, "g_object_unref"); 
  386.  
  387.    ---------------- 
  388.    -- Properties -- 
  389.    ---------------- 
  390.    --  The following properties are defined for this widget. See 
  391.    --  Glib.Properties for more information on properties) 
  392.  
  393.    Cursor_Type_Property : constant Glib.Properties.Property_Boxed; 
  394.    --  Type: Cursor_Type 
  395.  
  396.    Display_Property : constant Glib.Properties.Property_Boxed; 
  397.    --  Type: Display 
  398.  
  399. private 
  400.    Display_Property : constant Glib.Properties.Property_Boxed := 
  401.      Glib.Properties.Build ("display"); 
  402.    Cursor_Type_Property : constant Glib.Properties.Property_Boxed := 
  403.      Glib.Properties.Build ("cursor-type"); 
  404. end Gdk.Cursor;