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-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <group>Gdk, the low-level API</group> 
  31.  
  32. with Glib; use Glib; 
  33. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  34. pragma Elaborate_All (Glib.Generic_Properties); 
  35.  
  36. package Gdk.Types is 
  37.  
  38.    Current_Time : constant Guint32 := 0; 
  39.    --  Represents the current time in timestamps stored in events 
  40.  
  41.    type Gdk_Point is record 
  42.       X : Gint; 
  43.       Y : Gint; 
  44.    end record; 
  45.    pragma Convention (C, Gdk_Point); 
  46.  
  47.    type Gdk_Points_Array is array (Positive range <>) of Gdk_Point; 
  48.    pragma Pack (Gdk_Points_Array); 
  49.  
  50.    type Gdk_Segment is record 
  51.       X1 : Gint; 
  52.       Y1 : Gint; 
  53.       X2 : Gint; 
  54.       Y2 : Gint; 
  55.    end record; 
  56.    pragma Convention (C, Gdk_Segment); 
  57.  
  58.    type Gdk_Segments_Array is array (Positive range <>) of Gdk_Segment; 
  59.    pragma Pack (Gdk_Segments_Array); 
  60.  
  61.    --  See at the end of the package a list of all the types that 
  62.    --  have not been "bound". 
  63.  
  64.    type Gdk_Atom is new C_Proxy; 
  65.    --  This type represents a property of the X-server, that can be 
  66.    --  manipulated through functions in Gdk.Property. They have an associated 
  67.    --  name, that can be printed, as well as a value whose type may vary. 
  68.    --  See the program xlsatoms on any X-Window machine to list all the atoms 
  69.    --  known by the Xserver. 
  70.  
  71.    Gdk_None : constant Gdk_Atom := null; 
  72.    --  No atom constant. 
  73.  
  74.    type Gdk_Atom_Array is array (Natural range <>) of Gdk_Atom; 
  75.  
  76.    type Gdk_Axis_Use is 
  77.      (Axis_Ignore, 
  78.       Axis_X, 
  79.       Axis_Y, 
  80.       Axis_Pressure, 
  81.       Axis_X_Tilt, 
  82.       Axis_Y_Tilt, 
  83.       Axis_Last); 
  84.    pragma Convention (C, Gdk_Axis_Use); 
  85.  
  86.    type Gdk_Byte_Order is (Lsb_First, Msb_First); 
  87.    pragma Convention (C, Gdk_Byte_Order); 
  88.  
  89.    type Gdk_Extension_Mode is 
  90.      (Extension_Events_None, Extension_Events_All, Extension_Events_Cursor); 
  91.    pragma Convention (C, Gdk_Extension_Mode); 
  92.  
  93.    type Gdk_IC_Attributes_Type is new Guint; 
  94.    Ic_Style                : constant Gdk_IC_Attributes_Type; 
  95.    Ic_Client_Window        : constant Gdk_IC_Attributes_Type; 
  96.    Ic_Focus_Window         : constant Gdk_IC_Attributes_Type; 
  97.    Ic_Filter_Events        : constant Gdk_IC_Attributes_Type; 
  98.    Ic_Spot_Location        : constant Gdk_IC_Attributes_Type; 
  99.    Ic_Line_Spacing         : constant Gdk_IC_Attributes_Type; 
  100.    Ic_Cursor               : constant Gdk_IC_Attributes_Type; 
  101.    Ic_Preedit_Fontset      : constant Gdk_IC_Attributes_Type; 
  102.    Ic_Preedit_Area         : constant Gdk_IC_Attributes_Type; 
  103.    Ic_Preedit_Area_Needed  : constant Gdk_IC_Attributes_Type; 
  104.    Ic_Preedit_Foreground   : constant Gdk_IC_Attributes_Type; 
  105.    Ic_Preedit_Background   : constant Gdk_IC_Attributes_Type; 
  106.    Ic_Preedit_Pixmap       : constant Gdk_IC_Attributes_Type; 
  107.    Ic_Preedit_Colormap     : constant Gdk_IC_Attributes_Type; 
  108.    Ic_Status_Fontset       : constant Gdk_IC_Attributes_Type; 
  109.    Ic_Status_Area          : constant Gdk_IC_Attributes_Type; 
  110.    Ic_Status_Area_Needed   : constant Gdk_IC_Attributes_Type; 
  111.    Ic_Status_Foreground    : constant Gdk_IC_Attributes_Type; 
  112.    Ic_Status_Background    : constant Gdk_IC_Attributes_Type; 
  113.    Ic_Status_Pixmap        : constant Gdk_IC_Attributes_Type; 
  114.    Ic_Status_Colormap      : constant Gdk_IC_Attributes_Type; 
  115.    Ic_All_Req              : constant Gdk_IC_Attributes_Type; 
  116.    Ic_Preedit_Area_Req     : constant Gdk_IC_Attributes_Type; 
  117.    Ic_Preedit_Position_Req : constant Gdk_IC_Attributes_Type; 
  118.    Ic_Status_Area_Req      : constant Gdk_IC_Attributes_Type; 
  119.  
  120.    type Gdk_IM_Style is new Guint; 
  121.    Im_Preedit_Area      : constant Gdk_IM_Style; 
  122.    Im_Preedit_Callbacks : constant Gdk_IM_Style; 
  123.    Im_Preedit_Position  : constant Gdk_IM_Style; 
  124.    Im_Preedit_Nothing   : constant Gdk_IM_Style; 
  125.    Im_Preedit_None      : constant Gdk_IM_Style; 
  126.    Im_Preedit_Mask      : constant Gdk_IM_Style; 
  127.    Im_Status_Area       : constant Gdk_IM_Style; 
  128.    Im_Status_Callbacks  : constant Gdk_IM_Style; 
  129.    Im_Status_Nothing    : constant Gdk_IM_Style; 
  130.    Im_Status_None       : constant Gdk_IM_Style; 
  131.    Im_Status_Mask       : constant Gdk_IM_Style; 
  132.  
  133.    type Gdk_Input_Condition is (Input_Read, Input_Write, Input_Exception); 
  134.    pragma Convention (C, Gdk_Input_Condition); 
  135.  
  136.    type Gdk_Input_Mode is (Mode_Disabled, Mode_Screen, Mode_Window); 
  137.    pragma Convention (C, Gdk_Input_Mode); 
  138.  
  139.    type Gdk_Input_Source is 
  140.      (Source_Mouse, 
  141.       Source_Pen, 
  142.       Source_Eraser, 
  143.       Source_Cursor); 
  144.    pragma Convention (C, Gdk_Input_Source); 
  145.  
  146.    type Gdk_Key_Type is new Guint; 
  147.    --  see Gdk.Types.Keysyms for key type constants 
  148.  
  149.    type Gdk_Modifier_Type is new Guint; 
  150.    Shift_Mask    : constant Gdk_Modifier_Type; 
  151.    Lock_Mask     : constant Gdk_Modifier_Type; 
  152.    Control_Mask  : constant Gdk_Modifier_Type; 
  153.    Mod1_Mask     : constant Gdk_Modifier_Type; 
  154.    Mod2_Mask     : constant Gdk_Modifier_Type; 
  155.    Mod3_Mask     : constant Gdk_Modifier_Type; 
  156.    Mod4_Mask     : constant Gdk_Modifier_Type; 
  157.    Mod5_Mask     : constant Gdk_Modifier_Type; 
  158.    Button1_Mask  : constant Gdk_Modifier_Type; 
  159.    Button2_Mask  : constant Gdk_Modifier_Type; 
  160.    Button3_Mask  : constant Gdk_Modifier_Type; 
  161.    Button4_Mask  : constant Gdk_Modifier_Type; 
  162.    Button5_Mask  : constant Gdk_Modifier_Type; 
  163.    Release_Mask  : constant Gdk_Modifier_Type; 
  164.    Modifier_Mask : constant Gdk_Modifier_Type; 
  165.    Meta_Mask     : constant Gdk_Modifier_Type; 
  166.  
  167.    Default_Modifier_Mask : constant Gdk_Modifier_Type; 
  168.  
  169.    subtype Gdk_WChar is Standard.Wide_Character; 
  170.    subtype Gdk_WString is Standard.Wide_String; 
  171.    --  Gdk does not define a Gdk_WString type, but uses pointers 
  172.    --  to Gdk_WChar instead. 
  173.  
  174.    ---------------- 
  175.    -- Properties -- 
  176.    ---------------- 
  177.    --  The following packages and types are used to represent properties of 
  178.    --  the given type. They are used in the packages that use these properties 
  179.  
  180.    package Extension_Mode_Properties is new Generic_Internal_Discrete_Property 
  181.      (Gdk_Extension_Mode); 
  182.  
  183.    type Property_Gdk_Extension_Mode is new Extension_Mode_Properties.Property; 
  184.  
  185. private 
  186.  
  187.    ------------------------- 
  188.    --  Private constants  -- 
  189.    ------------------------- 
  190.  
  191.    Ic_Style                : constant Gdk_IC_Attributes_Type := 2 ** 0; 
  192.    Ic_Client_Window        : constant Gdk_IC_Attributes_Type := 2 ** 1; 
  193.    Ic_Focus_Window         : constant Gdk_IC_Attributes_Type := 2 ** 2; 
  194.    Ic_Filter_Events        : constant Gdk_IC_Attributes_Type := 2 ** 3; 
  195.    Ic_Spot_Location        : constant Gdk_IC_Attributes_Type := 2 ** 4; 
  196.    Ic_Line_Spacing         : constant Gdk_IC_Attributes_Type := 2 ** 5; 
  197.    Ic_Cursor               : constant Gdk_IC_Attributes_Type := 2 ** 6; 
  198.    Ic_Preedit_Fontset      : constant Gdk_IC_Attributes_Type := 2 ** 10; 
  199.    Ic_Preedit_Area         : constant Gdk_IC_Attributes_Type := 2 ** 11; 
  200.    Ic_Preedit_Area_Needed  : constant Gdk_IC_Attributes_Type := 2 ** 12; 
  201.    Ic_Preedit_Foreground   : constant Gdk_IC_Attributes_Type := 2 ** 13; 
  202.    Ic_Preedit_Background   : constant Gdk_IC_Attributes_Type := 2 ** 14; 
  203.    Ic_Preedit_Pixmap       : constant Gdk_IC_Attributes_Type := 2 ** 15; 
  204.    Ic_Preedit_Colormap     : constant Gdk_IC_Attributes_Type := 2 ** 16; 
  205.    Ic_Status_Fontset       : constant Gdk_IC_Attributes_Type := 2 ** 21; 
  206.    Ic_Status_Area          : constant Gdk_IC_Attributes_Type := 2 ** 22; 
  207.    Ic_Status_Area_Needed   : constant Gdk_IC_Attributes_Type := 2 ** 23; 
  208.    Ic_Status_Foreground    : constant Gdk_IC_Attributes_Type := 2 ** 24; 
  209.    Ic_Status_Background    : constant Gdk_IC_Attributes_Type := 2 ** 25; 
  210.    Ic_Status_Pixmap        : constant Gdk_IC_Attributes_Type := 2 ** 26; 
  211.    Ic_Status_Colormap      : constant Gdk_IC_Attributes_Type := 2 ** 27; 
  212.    Ic_All_Req              : constant Gdk_IC_Attributes_Type := 
  213.      Ic_Style or Ic_Client_Window; 
  214.    Ic_Preedit_Area_Req     : constant Gdk_IC_Attributes_Type := 
  215.      Ic_Preedit_Area or Ic_Preedit_Fontset; 
  216.    Ic_Preedit_Position_Req : constant Gdk_IC_Attributes_Type := 
  217.      Ic_Preedit_Area or Ic_Spot_Location or Ic_Preedit_Fontset; 
  218.    Ic_Status_Area_Req      : constant Gdk_IC_Attributes_Type := 
  219.      Ic_Status_Area or Ic_Status_Fontset; 
  220.  
  221.    Im_Preedit_Area      : constant Gdk_IM_Style := 16#0001#; 
  222.    Im_Preedit_Callbacks : constant Gdk_IM_Style := 16#0002#; 
  223.    Im_Preedit_Position  : constant Gdk_IM_Style := 16#0004#; 
  224.    Im_Preedit_Nothing   : constant Gdk_IM_Style := 16#0008#; 
  225.    Im_Preedit_None      : constant Gdk_IM_Style := 16#0010#; 
  226.    Im_Preedit_Mask      : constant Gdk_IM_Style := 16#001F#; 
  227.    Im_Status_Area       : constant Gdk_IM_Style := 16#0100#; 
  228.    Im_Status_Callbacks  : constant Gdk_IM_Style := 16#0200#; 
  229.    Im_Status_Nothing    : constant Gdk_IM_Style := 16#0400#; 
  230.    Im_Status_None       : constant Gdk_IM_Style := 16#0800#; 
  231.    Im_Status_Mask       : constant Gdk_IM_Style := 16#0F00#; 
  232.  
  233.    Shift_Mask   : constant Gdk_Modifier_Type := 2 ** 0; 
  234.    Lock_Mask    : constant Gdk_Modifier_Type := 2 ** 1; 
  235.    Control_Mask : constant Gdk_Modifier_Type := 2 ** 2; 
  236.    Mod1_Mask    : constant Gdk_Modifier_Type := 2 ** 3; 
  237.    Mod2_Mask    : constant Gdk_Modifier_Type := 2 ** 4; 
  238.    Mod3_Mask    : constant Gdk_Modifier_Type := 2 ** 5; 
  239.    Mod4_Mask    : constant Gdk_Modifier_Type := 2 ** 6; 
  240.    Mod5_Mask    : constant Gdk_Modifier_Type := 2 ** 7; 
  241.    Button1_Mask : constant Gdk_Modifier_Type := 2 ** 8; 
  242.    Button2_Mask : constant Gdk_Modifier_Type := 2 ** 9; 
  243.    Button3_Mask : constant Gdk_Modifier_Type := 2 ** 10; 
  244.    Button4_Mask : constant Gdk_Modifier_Type := 2 ** 11; 
  245.    Button5_Mask : constant Gdk_Modifier_Type := 2 ** 12; 
  246.    Release_Mask  : constant Gdk_Modifier_Type := 2 ** 13; 
  247.    Meta_Mask     : constant Gdk_Modifier_Type := 2 ** 28; 
  248.    Modifier_Mask : constant Gdk_Modifier_Type := 16#3FFF#; 
  249.  
  250.    function Internal_Defaut_Modifier_Mask return Gdk_Modifier_Type; 
  251.    pragma Import 
  252.      (C, Internal_Defaut_Modifier_Mask, "ada_gdk_get_default_modifier"); 
  253.    Default_Modifier_Mask : constant Gdk_Modifier_Type := 
  254.                              Internal_Defaut_Modifier_Mask; 
  255.  
  256.    ------------------------------ 
  257.    --  Representation clauses  -- 
  258.    ------------------------------ 
  259.  
  260.    for Gdk_Input_Condition use 
  261.      (Input_Read      => 2 ** 0, 
  262.       Input_Write     => 2 ** 1, 
  263.       Input_Exception => 2 ** 2); 
  264. end Gdk.Types; 
  265.  
  266. --  The following types were not bound because it did not seem 
  267. --  to be necessary (yet). 
  268. -- 
  269. --  + GdkColorContextMode 
  270. --  + GdkCrossingMode 
  271. --  + GdkFilterReturn 
  272. --  + GdkFontType 
  273. --  + GdkNotifyType 
  274. --  + GdkPropertyState 
  275. --  + GdkStatus