1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2011, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  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 Pack (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 Pack (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.    pragma Convention (C, Gdk_Input_Source); 
  140.  
  141.    type Gdk_Key_Type is new Guint; 
  142.    --  see Gdk.Types.Keysyms for key type constants 
  143.  
  144.    type Gdk_Modifier_Type is new Guint; 
  145.    Shift_Mask    : constant Gdk_Modifier_Type; 
  146.    Lock_Mask     : constant Gdk_Modifier_Type; 
  147.    Control_Mask  : constant Gdk_Modifier_Type; 
  148.    Mod1_Mask     : constant Gdk_Modifier_Type; 
  149.    Mod2_Mask     : constant Gdk_Modifier_Type; 
  150.    Mod3_Mask     : constant Gdk_Modifier_Type; 
  151.    Mod4_Mask     : constant Gdk_Modifier_Type; 
  152.    Mod5_Mask     : constant Gdk_Modifier_Type; 
  153.    Button1_Mask  : constant Gdk_Modifier_Type; 
  154.    Button2_Mask  : constant Gdk_Modifier_Type; 
  155.    Button3_Mask  : constant Gdk_Modifier_Type; 
  156.    Button4_Mask  : constant Gdk_Modifier_Type; 
  157.    Button5_Mask  : constant Gdk_Modifier_Type; 
  158.    Release_Mask  : constant Gdk_Modifier_Type; 
  159.    Modifier_Mask : constant Gdk_Modifier_Type; 
  160.  
  161.    Default_Modifier_Mask : constant Gdk_Modifier_Type; 
  162.  
  163.    subtype Gdk_WChar is Standard.Wide_Character; 
  164.    subtype Gdk_WString is Standard.Wide_String; 
  165.    --  Gdk does not define a Gdk_WString type, but uses pointers 
  166.    --  to Gdk_WChar instead. 
  167.  
  168.    ---------------- 
  169.    -- Properties -- 
  170.    ---------------- 
  171.    --  The following packages and types are used to represent properties of 
  172.    --  the given type. They are used in the packages that use these properties 
  173.  
  174.    package Extension_Mode_Properties is new Generic_Internal_Discrete_Property 
  175.      (Gdk_Extension_Mode); 
  176.  
  177.    type Property_Gdk_Extension_Mode is new Extension_Mode_Properties.Property; 
  178.  
  179. private 
  180.  
  181.    ------------------------- 
  182.    --  Private constants  -- 
  183.    ------------------------- 
  184.  
  185.    Ic_Style                : constant Gdk_IC_Attributes_Type := 2 ** 0; 
  186.    Ic_Client_Window        : constant Gdk_IC_Attributes_Type := 2 ** 1; 
  187.    Ic_Focus_Window         : constant Gdk_IC_Attributes_Type := 2 ** 2; 
  188.    Ic_Filter_Events        : constant Gdk_IC_Attributes_Type := 2 ** 3; 
  189.    Ic_Spot_Location        : constant Gdk_IC_Attributes_Type := 2 ** 4; 
  190.    Ic_Line_Spacing         : constant Gdk_IC_Attributes_Type := 2 ** 5; 
  191.    Ic_Cursor               : constant Gdk_IC_Attributes_Type := 2 ** 6; 
  192.    Ic_Preedit_Fontset      : constant Gdk_IC_Attributes_Type := 2 ** 10; 
  193.    Ic_Preedit_Area         : constant Gdk_IC_Attributes_Type := 2 ** 11; 
  194.    Ic_Preedit_Area_Needed  : constant Gdk_IC_Attributes_Type := 2 ** 12; 
  195.    Ic_Preedit_Foreground   : constant Gdk_IC_Attributes_Type := 2 ** 13; 
  196.    Ic_Preedit_Background   : constant Gdk_IC_Attributes_Type := 2 ** 14; 
  197.    Ic_Preedit_Pixmap       : constant Gdk_IC_Attributes_Type := 2 ** 15; 
  198.    Ic_Preedit_Colormap     : constant Gdk_IC_Attributes_Type := 2 ** 16; 
  199.    Ic_Status_Fontset       : constant Gdk_IC_Attributes_Type := 2 ** 21; 
  200.    Ic_Status_Area          : constant Gdk_IC_Attributes_Type := 2 ** 22; 
  201.    Ic_Status_Area_Needed   : constant Gdk_IC_Attributes_Type := 2 ** 23; 
  202.    Ic_Status_Foreground    : constant Gdk_IC_Attributes_Type := 2 ** 24; 
  203.    Ic_Status_Background    : constant Gdk_IC_Attributes_Type := 2 ** 25; 
  204.    Ic_Status_Pixmap        : constant Gdk_IC_Attributes_Type := 2 ** 26; 
  205.    Ic_Status_Colormap      : constant Gdk_IC_Attributes_Type := 2 ** 27; 
  206.    Ic_All_Req              : constant Gdk_IC_Attributes_Type := 
  207.      Ic_Style or Ic_Client_Window; 
  208.    Ic_Preedit_Area_Req     : constant Gdk_IC_Attributes_Type := 
  209.      Ic_Preedit_Area or Ic_Preedit_Fontset; 
  210.    Ic_Preedit_Position_Req : constant Gdk_IC_Attributes_Type := 
  211.      Ic_Preedit_Area or Ic_Spot_Location or Ic_Preedit_Fontset; 
  212.    Ic_Status_Area_Req      : constant Gdk_IC_Attributes_Type := 
  213.      Ic_Status_Area or Ic_Status_Fontset; 
  214.  
  215.    Im_Preedit_Area      : constant Gdk_IM_Style := 16#0001#; 
  216.    Im_Preedit_Callbacks : constant Gdk_IM_Style := 16#0002#; 
  217.    Im_Preedit_Position  : constant Gdk_IM_Style := 16#0004#; 
  218.    Im_Preedit_Nothing   : constant Gdk_IM_Style := 16#0008#; 
  219.    Im_Preedit_None      : constant Gdk_IM_Style := 16#0010#; 
  220.    Im_Preedit_Mask      : constant Gdk_IM_Style := 16#001F#; 
  221.    Im_Status_Area       : constant Gdk_IM_Style := 16#0100#; 
  222.    Im_Status_Callbacks  : constant Gdk_IM_Style := 16#0200#; 
  223.    Im_Status_Nothing    : constant Gdk_IM_Style := 16#0400#; 
  224.    Im_Status_None       : constant Gdk_IM_Style := 16#0800#; 
  225.    Im_Status_Mask       : constant Gdk_IM_Style := 16#0F00#; 
  226.  
  227.    Shift_Mask   : constant Gdk_Modifier_Type := 2 ** 0; 
  228.    Lock_Mask    : constant Gdk_Modifier_Type := 2 ** 1; 
  229.    Control_Mask : constant Gdk_Modifier_Type := 2 ** 2; 
  230.    Mod1_Mask    : constant Gdk_Modifier_Type := 2 ** 3; 
  231.    Mod2_Mask    : constant Gdk_Modifier_Type := 2 ** 4; 
  232.    Mod3_Mask    : constant Gdk_Modifier_Type := 2 ** 5; 
  233.    Mod4_Mask    : constant Gdk_Modifier_Type := 2 ** 6; 
  234.    Mod5_Mask    : constant Gdk_Modifier_Type := 2 ** 7; 
  235.    Button1_Mask : constant Gdk_Modifier_Type := 2 ** 8; 
  236.    Button2_Mask : constant Gdk_Modifier_Type := 2 ** 9; 
  237.    Button3_Mask : constant Gdk_Modifier_Type := 2 ** 10; 
  238.    Button4_Mask : constant Gdk_Modifier_Type := 2 ** 11; 
  239.    Button5_Mask : constant Gdk_Modifier_Type := 2 ** 12; 
  240.    Release_Mask  : constant Gdk_Modifier_Type := 2 ** 13; 
  241.    Modifier_Mask : constant Gdk_Modifier_Type := 16#3FFF#; 
  242.  
  243.    function Internal_Defaut_Modifier_Mask return Gdk_Modifier_Type; 
  244.    pragma Import 
  245.      (C, Internal_Defaut_Modifier_Mask, "ada_gdk_get_default_modifier"); 
  246.    Default_Modifier_Mask : constant Gdk_Modifier_Type := 
  247.                              Internal_Defaut_Modifier_Mask; 
  248.  
  249.    ------------------------------ 
  250.    --  Representation clauses  -- 
  251.    ------------------------------ 
  252.  
  253.    for Gdk_Input_Condition use 
  254.      (Input_Read      => 2 ** 0, 
  255.       Input_Write     => 2 ** 1, 
  256.       Input_Exception => 2 ** 2); 
  257. end Gdk.Types; 
  258.  
  259. --  The following types were not bound because it did not seem 
  260. --  to be necessary (yet). 
  261. -- 
  262. --  + GdkColorContextMode 
  263. --  + GdkCrossingMode 
  264. --  + GdkFilterReturn 
  265. --  + GdkFontType 
  266. --  + GdkNotifyType 
  267. --  + GdkPropertyState 
  268. --  + GdkStatus