1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  5. --                     Copyright (C) 1998-2014, AdaCore                     -- 
  6. --                                                                          -- 
  7. -- This library is free software;  you can redistribute it and/or modify it -- 
  8. -- under terms of the  GNU General Public License  as published by the Free -- 
  9. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  10. -- version. This library is distributed in the hope that it will be useful, -- 
  11. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  12. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  13. --                                                                          -- 
  14. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  15. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  16. -- version 3.1, as published by the Free Software Foundation.               -- 
  17. --                                                                          -- 
  18. -- You should have received a copy of the GNU General Public License and    -- 
  19. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  20. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  21. -- <http://www.gnu.org/licenses/>.                                          -- 
  22. --                                                                          -- 
  23. ------------------------------------------------------------------------------ 
  24.  
  25. --  <group>Gdk, the low-level API</group> 
  26.  
  27. with Glib; use Glib; 
  28. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  29. pragma Elaborate_All (Glib.Generic_Properties); 
  30.  
  31. package Gdk.Types is 
  32.  
  33.    Current_Time : constant Guint32 := 0; 
  34.    --  Represents the current time in timestamps stored in events 
  35.  
  36.    type Gdk_Point is record 
  37.       X : Gint; 
  38.       Y : Gint; 
  39.    end record; 
  40.    pragma Convention (C, Gdk_Point); 
  41.  
  42.    type Gdk_Points_Array is array (Positive range <>) of Gdk_Point; 
  43.    pragma Convention (C, Gdk_Points_Array); 
  44.  
  45.    type Gdk_Segment is record 
  46.       X1 : Gint; 
  47.       Y1 : Gint; 
  48.       X2 : Gint; 
  49.       Y2 : Gint; 
  50.    end record; 
  51.    pragma Convention (C, Gdk_Segment); 
  52.  
  53.    type Gdk_Segments_Array is array (Positive range <>) of Gdk_Segment; 
  54.    pragma Convention (C, Gdk_Segments_Array); 
  55.  
  56.    --  See at the end of the package a list of all the types that 
  57.    --  have not been "bound". 
  58.  
  59.    type Gdk_Atom is new C_Proxy; 
  60.    --  This type represents a property of the X-server, that can be 
  61.    --  manipulated through functions in Gdk.Property. They have an associated 
  62.    --  name, that can be printed, as well as a value whose type may vary. 
  63.    --  See the program xlsatoms on any X-Window machine to list all the atoms 
  64.    --  known by the Xserver. 
  65.  
  66.    Gdk_None : constant Gdk_Atom := null; 
  67.    --  No atom constant. 
  68.  
  69.    type Gdk_Atom_Array is array (Natural range <>) of Gdk_Atom; 
  70.  
  71.    type Gdk_Axis_Use is 
  72.      (Axis_Ignore, 
  73.       Axis_X, 
  74.       Axis_Y, 
  75.       Axis_Pressure, 
  76.       Axis_X_Tilt, 
  77.       Axis_Y_Tilt, 
  78.       Axis_Last); 
  79.    pragma Convention (C, Gdk_Axis_Use); 
  80.  
  81.    type Gdk_Byte_Order is (Lsb_First, Msb_First); 
  82.    pragma Convention (C, Gdk_Byte_Order); 
  83.  
  84.    type Gdk_Extension_Mode is 
  85.      (Extension_Events_None, Extension_Events_All, Extension_Events_Cursor); 
  86.    pragma Convention (C, Gdk_Extension_Mode); 
  87.  
  88.    type Gdk_IC_Attributes_Type is new Guint; 
  89.    Ic_Style                : constant Gdk_IC_Attributes_Type; 
  90.    Ic_Client_Window        : constant Gdk_IC_Attributes_Type; 
  91.    Ic_Focus_Window         : constant Gdk_IC_Attributes_Type; 
  92.    Ic_Filter_Events        : constant Gdk_IC_Attributes_Type; 
  93.    Ic_Spot_Location        : constant Gdk_IC_Attributes_Type; 
  94.    Ic_Line_Spacing         : constant Gdk_IC_Attributes_Type; 
  95.    Ic_Cursor               : constant Gdk_IC_Attributes_Type; 
  96.    Ic_Preedit_Fontset      : constant Gdk_IC_Attributes_Type; 
  97.    Ic_Preedit_Area         : constant Gdk_IC_Attributes_Type; 
  98.    Ic_Preedit_Area_Needed  : constant Gdk_IC_Attributes_Type; 
  99.    Ic_Preedit_Foreground   : constant Gdk_IC_Attributes_Type; 
  100.    Ic_Preedit_Background   : constant Gdk_IC_Attributes_Type; 
  101.    Ic_Preedit_Pixmap       : constant Gdk_IC_Attributes_Type; 
  102.    Ic_Preedit_Colormap     : constant Gdk_IC_Attributes_Type; 
  103.    Ic_Status_Fontset       : constant Gdk_IC_Attributes_Type; 
  104.    Ic_Status_Area          : constant Gdk_IC_Attributes_Type; 
  105.    Ic_Status_Area_Needed   : constant Gdk_IC_Attributes_Type; 
  106.    Ic_Status_Foreground    : constant Gdk_IC_Attributes_Type; 
  107.    Ic_Status_Background    : constant Gdk_IC_Attributes_Type; 
  108.    Ic_Status_Pixmap        : constant Gdk_IC_Attributes_Type; 
  109.    Ic_Status_Colormap      : constant Gdk_IC_Attributes_Type; 
  110.    Ic_All_Req              : constant Gdk_IC_Attributes_Type; 
  111.    Ic_Preedit_Area_Req     : constant Gdk_IC_Attributes_Type; 
  112.    Ic_Preedit_Position_Req : constant Gdk_IC_Attributes_Type; 
  113.    Ic_Status_Area_Req      : constant Gdk_IC_Attributes_Type; 
  114.  
  115.    type Gdk_IM_Style is new Guint; 
  116.    Im_Preedit_Area      : constant Gdk_IM_Style; 
  117.    Im_Preedit_Callbacks : constant Gdk_IM_Style; 
  118.    Im_Preedit_Position  : constant Gdk_IM_Style; 
  119.    Im_Preedit_Nothing   : constant Gdk_IM_Style; 
  120.    Im_Preedit_None      : constant Gdk_IM_Style; 
  121.    Im_Preedit_Mask      : constant Gdk_IM_Style; 
  122.    Im_Status_Area       : constant Gdk_IM_Style; 
  123.    Im_Status_Callbacks  : constant Gdk_IM_Style; 
  124.    Im_Status_Nothing    : constant Gdk_IM_Style; 
  125.    Im_Status_None       : constant Gdk_IM_Style; 
  126.    Im_Status_Mask       : constant Gdk_IM_Style; 
  127.  
  128.    type Gdk_Input_Condition is (Input_Read, Input_Write, Input_Exception); 
  129.    pragma Convention (C, Gdk_Input_Condition); 
  130.  
  131.    type Gdk_Input_Mode is (Mode_Disabled, Mode_Screen, Mode_Window); 
  132.    pragma Convention (C, Gdk_Input_Mode); 
  133.  
  134.    type Gdk_Input_Source is 
  135.      (Source_Mouse, 
  136.       Source_Pen, 
  137.       Source_Eraser, 
  138.       Source_Cursor, 
  139.       Source_Keyboard, 
  140.       Source_Touchscreen, 
  141.       Source_Touchpad); 
  142.    pragma Convention (C, Gdk_Input_Source); 
  143.  
  144.    type Gdk_Grab_Status is 
  145.      (Grab_Success,   --  successfully grabbed 
  146.       Grab_Already_Grabbed,   --  resource actively grabbed by another client 
  147.       Grab_Invalid_Time,      --  resource grabbed more recently than the 
  148.                               --  specified time 
  149.       Grab_Not_Viewable,      --  grab window or confine_to_window are not 
  150.                               --  viewable 
  151.       Grab_Frozen);           --  resource is frozen by an active grab of 
  152.                               --  another client 
  153.    --  Indicates the success or reason of failure for a grab attempt 
  154.  
  155.    type Gdk_Grab_Ownership is 
  156.      (Ownership_None, 
  157.       Ownership_Window, 
  158.       Ownership_Application); 
  159.    --  Defines how device grabs interact with other devices: 
  160.    --     None: all other devices' events are allowed 
  161.    --     Window: other devices' events are blocked for the grab window 
  162.    --     Application: other devices' events are blocked for the whole app. 
  163.  
  164.    type Gdk_Key_Type is new Guint; 
  165.    --  see Gdk.Types.Keysyms for key type constants 
  166.  
  167.    type Gdk_Modifier_Type is new Guint; 
  168.    Shift_Mask    : constant Gdk_Modifier_Type; 
  169.    Lock_Mask     : constant Gdk_Modifier_Type; 
  170.    Control_Mask  : constant Gdk_Modifier_Type; 
  171.    Mod1_Mask     : constant Gdk_Modifier_Type; 
  172.    Mod2_Mask     : constant Gdk_Modifier_Type; 
  173.    Mod3_Mask     : constant Gdk_Modifier_Type; 
  174.    Mod4_Mask     : constant Gdk_Modifier_Type; 
  175.    Mod5_Mask     : constant Gdk_Modifier_Type; 
  176.    Button1_Mask  : constant Gdk_Modifier_Type; 
  177.    Button2_Mask  : constant Gdk_Modifier_Type; 
  178.    Button3_Mask  : constant Gdk_Modifier_Type; 
  179.    Button4_Mask  : constant Gdk_Modifier_Type; 
  180.    Button5_Mask  : constant Gdk_Modifier_Type; 
  181.    Super_Mask    : constant Gdk_Modifier_Type; 
  182.    Hyper_Mask    : constant Gdk_Modifier_Type; 
  183.    Meta_Mask     : constant Gdk_Modifier_Type; 
  184.    Release_Mask  : constant Gdk_Modifier_Type; 
  185.    Modifier_Mask : constant Gdk_Modifier_Type; 
  186.  
  187.    function Primary_Mod_Mask return Gdk_Modifier_Type; 
  188.  
  189.    type Gdk_Modifier_Intent is 
  190.       (Primary_Accelerator, 
  191.        Context_Menu, 
  192.        Extend_Selection, 
  193.        Modify_Selection, 
  194.        No_Text_Input, 
  195.        Shift_Group); 
  196.    --  This enum is used with gdk_keymap_get_modifier_mask() and 
  197.    --  gdk_get_modifier_mask() in order to determine what modifiers the 
  198.    --  currently used windowing system backend uses for particular 
  199.    --  purposes. For example, on X11/Windows, the Control key is used for 
  200.    --  invoking menu shortcuts (accelerators), whereas on Apple computers 
  201.    --  it's the Command key (which correspond to %GDK_CONTROL_MASK and 
  202.    --  GDK_MOD2_MASK, respectively). 
  203.  
  204.    subtype Gdk_WChar is Standard.Wide_Character; 
  205.    subtype Gdk_WString is Standard.Wide_String; 
  206.    --  Gdk does not define a Gdk_WString type, but uses pointers 
  207.    --  to Gdk_WChar instead. 
  208.  
  209.    ---------------- 
  210.    -- Properties -- 
  211.    ---------------- 
  212.    --  The following packages and types are used to represent properties of 
  213.    --  the given type. They are used in the packages that use these properties 
  214.  
  215.    package Extension_Mode_Properties is new Generic_Internal_Discrete_Property 
  216.      (Gdk_Extension_Mode); 
  217.  
  218.    type Property_Gdk_Extension_Mode is new Extension_Mode_Properties.Property; 
  219.  
  220. private 
  221.  
  222.    ------------------------- 
  223.    --  Private constants  -- 
  224.    ------------------------- 
  225.  
  226.    Ic_Style                : constant Gdk_IC_Attributes_Type := 2 ** 0; 
  227.    Ic_Client_Window        : constant Gdk_IC_Attributes_Type := 2 ** 1; 
  228.    Ic_Focus_Window         : constant Gdk_IC_Attributes_Type := 2 ** 2; 
  229.    Ic_Filter_Events        : constant Gdk_IC_Attributes_Type := 2 ** 3; 
  230.    Ic_Spot_Location        : constant Gdk_IC_Attributes_Type := 2 ** 4; 
  231.    Ic_Line_Spacing         : constant Gdk_IC_Attributes_Type := 2 ** 5; 
  232.    Ic_Cursor               : constant Gdk_IC_Attributes_Type := 2 ** 6; 
  233.    Ic_Preedit_Fontset      : constant Gdk_IC_Attributes_Type := 2 ** 10; 
  234.    Ic_Preedit_Area         : constant Gdk_IC_Attributes_Type := 2 ** 11; 
  235.    Ic_Preedit_Area_Needed  : constant Gdk_IC_Attributes_Type := 2 ** 12; 
  236.    Ic_Preedit_Foreground   : constant Gdk_IC_Attributes_Type := 2 ** 13; 
  237.    Ic_Preedit_Background   : constant Gdk_IC_Attributes_Type := 2 ** 14; 
  238.    Ic_Preedit_Pixmap       : constant Gdk_IC_Attributes_Type := 2 ** 15; 
  239.    Ic_Preedit_Colormap     : constant Gdk_IC_Attributes_Type := 2 ** 16; 
  240.    Ic_Status_Fontset       : constant Gdk_IC_Attributes_Type := 2 ** 21; 
  241.    Ic_Status_Area          : constant Gdk_IC_Attributes_Type := 2 ** 22; 
  242.    Ic_Status_Area_Needed   : constant Gdk_IC_Attributes_Type := 2 ** 23; 
  243.    Ic_Status_Foreground    : constant Gdk_IC_Attributes_Type := 2 ** 24; 
  244.    Ic_Status_Background    : constant Gdk_IC_Attributes_Type := 2 ** 25; 
  245.    Ic_Status_Pixmap        : constant Gdk_IC_Attributes_Type := 2 ** 26; 
  246.    Ic_Status_Colormap      : constant Gdk_IC_Attributes_Type := 2 ** 27; 
  247.    Ic_All_Req              : constant Gdk_IC_Attributes_Type := 
  248.      Ic_Style or Ic_Client_Window; 
  249.    Ic_Preedit_Area_Req     : constant Gdk_IC_Attributes_Type := 
  250.      Ic_Preedit_Area or Ic_Preedit_Fontset; 
  251.    Ic_Preedit_Position_Req : constant Gdk_IC_Attributes_Type := 
  252.      Ic_Preedit_Area or Ic_Spot_Location or Ic_Preedit_Fontset; 
  253.    Ic_Status_Area_Req      : constant Gdk_IC_Attributes_Type := 
  254.      Ic_Status_Area or Ic_Status_Fontset; 
  255.  
  256.    Im_Preedit_Area      : constant Gdk_IM_Style := 16#0001#; 
  257.    Im_Preedit_Callbacks : constant Gdk_IM_Style := 16#0002#; 
  258.    Im_Preedit_Position  : constant Gdk_IM_Style := 16#0004#; 
  259.    Im_Preedit_Nothing   : constant Gdk_IM_Style := 16#0008#; 
  260.    Im_Preedit_None      : constant Gdk_IM_Style := 16#0010#; 
  261.    Im_Preedit_Mask      : constant Gdk_IM_Style := 16#001F#; 
  262.    Im_Status_Area       : constant Gdk_IM_Style := 16#0100#; 
  263.    Im_Status_Callbacks  : constant Gdk_IM_Style := 16#0200#; 
  264.    Im_Status_Nothing    : constant Gdk_IM_Style := 16#0400#; 
  265.    Im_Status_None       : constant Gdk_IM_Style := 16#0800#; 
  266.    Im_Status_Mask       : constant Gdk_IM_Style := 16#0F00#; 
  267.  
  268.    Shift_Mask   : constant Gdk_Modifier_Type := 2 ** 0; 
  269.    Lock_Mask    : constant Gdk_Modifier_Type := 2 ** 1; 
  270.    Control_Mask : constant Gdk_Modifier_Type := 2 ** 2; 
  271.    Mod1_Mask    : constant Gdk_Modifier_Type := 2 ** 3; 
  272.    Mod2_Mask    : constant Gdk_Modifier_Type := 2 ** 4; 
  273.    Mod3_Mask    : constant Gdk_Modifier_Type := 2 ** 5; 
  274.    Mod4_Mask    : constant Gdk_Modifier_Type := 2 ** 6; 
  275.    Mod5_Mask    : constant Gdk_Modifier_Type := 2 ** 7; 
  276.    Button1_Mask : constant Gdk_Modifier_Type := 2 ** 8; 
  277.    Button2_Mask : constant Gdk_Modifier_Type := 2 ** 9; 
  278.    Button3_Mask : constant Gdk_Modifier_Type := 2 ** 10; 
  279.    Button4_Mask : constant Gdk_Modifier_Type := 2 ** 11; 
  280.    Button5_Mask : constant Gdk_Modifier_Type := 2 ** 12; 
  281.    Super_Mask    : constant Gdk_Modifier_Type := 2 ** 26; 
  282.    Hyper_Mask    : constant Gdk_Modifier_Type := 2 ** 27; 
  283.    Meta_Mask     : constant Gdk_Modifier_Type := 2 ** 28; 
  284.    Release_Mask  : constant Gdk_Modifier_Type := 2 ** 30; 
  285.    Modifier_Mask : constant Gdk_Modifier_Type := 16#5C001FFF#; 
  286.  
  287.    pragma Import (C, Primary_Mod_Mask, "ada_gdk_get_default_modifier"); 
  288.  
  289.    ------------------------------ 
  290.    --  Representation clauses  -- 
  291.    ------------------------------ 
  292.  
  293.    for Gdk_Input_Condition use 
  294.      (Input_Read      => 2 ** 0, 
  295.       Input_Write     => 2 ** 1, 
  296.       Input_Exception => 2 ** 2); 
  297. end Gdk.Types; 
  298.  
  299. --  The following types were not bound because it did not seem 
  300. --  to be necessary (yet). 
  301. -- 
  302. --  + GdkColorContextMode 
  303. --  + GdkCrossingMode 
  304. --  + GdkFilterReturn 
  305. --  + GdkFontType 
  306. --  + GdkNotifyType 
  307. --  + GdkPropertyState 
  308. --  + GdkStatus