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