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-2006 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. --  <description> 
  31. --  This widget is a base class for all the widgets that require an 
  32. --  alignment and padding. 
  33. --  This widget can not be instantiated directly. 
  34. --  </description> 
  35. --  <c_version>2.8.17</c_version> 
  36. --  <group>Abstract base classes</group> 
  37.  
  38. with Glib.Properties; 
  39. with Gtk.Widget; 
  40.  
  41. package Gtk.Misc is 
  42.  
  43.    type Gtk_Misc_Record is new Widget.Gtk_Widget_Record with private; 
  44.    type Gtk_Misc is access all Gtk_Misc_Record'Class; 
  45.  
  46.    function Get_Type return Gtk.Gtk_Type; 
  47.    --  Return the internal value associated with a Gtk_Misc. 
  48.  
  49.    procedure Set_Alignment 
  50.      (Misc : access Gtk_Misc_Record; Xalign : Gfloat; Yalign : Gfloat); 
  51.    procedure Get_Alignment 
  52.      (Misc : access Gtk_Misc_Record; Xalign : out Gfloat; Yalign : out Gfloat); 
  53.    --  Modify the alignment for the widget. 
  54.    --  Xalign and Yalign are both values between 0.0 and 1.0 that specify the 
  55.    --  alignment: if Xalign is 0.0, the widget will be left aligned; if it is 
  56.    --  0.5, the widget will be centered; if it is 1.0 the widget will be 
  57.    --  right aligned. Yalign is from top (0.0) to bottom (1.0). 
  58.    --  Both Xalign and Yalign will be constrained to the range 0.0 .. 1.0 
  59.    --  Note that if the widget fills its allocated area, these two parameters 
  60.    --  won't have any effect. 
  61.  
  62.    procedure Set_Padding 
  63.      (Misc : access Gtk_Misc_Record; Xpad : Gint; Ypad : Gint); 
  64.    procedure Get_Padding 
  65.      (Misc : access Gtk_Misc_Record; Xpad : out Gint; Ypad : out Gint); 
  66.    --  Set the padding (i.e. the extra spaces on the side of the widget). 
  67.    --  If Xpad or Ypad is negative, they will be changed to 0. 
  68.  
  69.    ---------------- 
  70.    -- Properties -- 
  71.    ---------------- 
  72.  
  73.    --  <properties> 
  74.    --  The following properties are defined for this widget. See 
  75.    --  Glib.Properties for more information on properties. 
  76.    -- 
  77.    --  - Name:  Xalign_Property 
  78.    --    Type:  Gfloat 
  79.    --    Flags: read-write 
  80.    --    Descr: The horizontal alignment, from 0 (left) to 1 (right) 
  81.    --    See also: Set_Alignment 
  82.    -- 
  83.    --  - Name:  Yalign_Property 
  84.    --    Type:  Gfloat 
  85.    --    Flags: read-write 
  86.    --    Descr: The vertical alignment, from 0 (left) to 1 (right) 
  87.    --    See also: Set_Alignment 
  88.    -- 
  89.    --  - Name:  Xpad_Property 
  90.    --    Type:  Gint 
  91.    --    Flags: read-write 
  92.    --    Descr: The amount of space to add on the left and right of the widget, 
  93.    --           in pixels 
  94.    --    See also: Set_Padding 
  95.    -- 
  96.    --  - Name:  Ypad_Property 
  97.    --    Type:  Gint 
  98.    --    Flags: read-write 
  99.    --    Descr: The amount of space to add on the top and bottom of the widget, 
  100.    --           in pixels 
  101.    --    See also: Set_Padding 
  102.    -- 
  103.    --  </properties> 
  104.  
  105.    Xalign_Property : constant Glib.Properties.Property_Float; 
  106.    Yalign_Property : constant Glib.Properties.Property_Float; 
  107.    Xpad_Property   : constant Glib.Properties.Property_Int; 
  108.    Ypad_Property   : constant Glib.Properties.Property_Int; 
  109.  
  110.    ------------- 
  111.    -- Signals -- 
  112.    ------------- 
  113.  
  114.    --  <signals> 
  115.    --  The following new signals are defined for this widget: 
  116.    -- 
  117.    --  </signals> 
  118.  
  119. private 
  120.    type Gtk_Misc_Record is new Widget.Gtk_Widget_Record with null record; 
  121.  
  122.    Xalign_Property : constant Glib.Properties.Property_Float := 
  123.      Glib.Properties.Build ("xalign"); 
  124.    Yalign_Property : constant Glib.Properties.Property_Float := 
  125.      Glib.Properties.Build ("yalign"); 
  126.    Xpad_Property   : constant Glib.Properties.Property_Int := 
  127.      Glib.Properties.Build ("xpad"); 
  128.    Ypad_Property   : constant Glib.Properties.Property_Int := 
  129.      Glib.Properties.Build ("ypad"); 
  130.  
  131.    pragma Import (C, Get_Type, "gtk_misc_get_type"); 
  132. end Gtk.Misc;