1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2009, AdaCore                   -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  A Gtk_Cell_Renderer_Pixbuf can be used to render an image in a cell. It 
  26. --  allows to render either a given Gdk_Pixbuf (set via the pixbuf property) or 
  27. --  a stock icon (set via the stock-id property). 
  28. -- 
  29. --  To support the tree view, Gtk_Cell_Renderer_Pixbuf also supports rendering 
  30. --  two alternative pixbufs, when the is-expander property is TRUE. If the 
  31. --  is-expanded property is TRUE and the pixbuf-expander-open property is set 
  32. --  to a pixbuf, it renders that pixbuf, if the is-expanded property is FALSE 
  33. --  and the pixbuf-expander-closed property is set to a pixbuf, it renders that 
  34. --  one. 
  35. --  </description> 
  36. --  <c_version>2.14</c_version> 
  37. --  <group>Trees and Lists</group> 
  38.  
  39. with Glib.Properties; 
  40. with Gtk.Cell_Renderer; 
  41.  
  42. package Gtk.Cell_Renderer_Pixbuf is 
  43.  
  44.    type Gtk_Cell_Renderer_Pixbuf_Record is 
  45.      new Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record with private; 
  46.    type Gtk_Cell_Renderer_Pixbuf is 
  47.      access all Gtk_Cell_Renderer_Pixbuf_Record'Class; 
  48.  
  49.    procedure Gtk_New (Widget : out Gtk_Cell_Renderer_Pixbuf); 
  50.    procedure Initialize 
  51.      (Widget : access Gtk_Cell_Renderer_Pixbuf_Record'Class); 
  52.    --  Creates or initializes a new renderer 
  53.  
  54.    function Get_Type return Gtk.Gtk_Type; 
  55.    --  Return the internal value associated with this widget. 
  56.  
  57.    ------------- 
  58.    -- Signals -- 
  59.    ------------- 
  60.  
  61.    --  <signals> 
  62.    --  The following new signals are defined for this widget: 
  63.    --  </signals> 
  64.  
  65.    ---------------- 
  66.    -- Properties -- 
  67.    ---------------- 
  68.  
  69.    --  <properties> 
  70.    --  The following properties are defined for this widget. See 
  71.    --  Glib.Properties for more information on properties. 
  72.    -- 
  73.    --  Name:  Follow_State_Property 
  74.    --  Type:  Boolean 
  75.    --  Descr: Whether the rendered pixbuf should be 
  76.    -- 
  77.    --  Name:  Gicon_Property 
  78.    --  Type:  Object 
  79.    --  Descr: The GIcon being displayed 
  80.    -- 
  81.    --  Name:  Icon_Name_Property 
  82.    --  Type:  String 
  83.    --  Descr: The name of the icon from the icon theme 
  84.    -- 
  85.    --  Name:  Pixbuf_Property 
  86.    --  Type:  Object 
  87.    --  Descr: The pixbuf to render 
  88.    -- 
  89.    --  Name:  Pixbuf_Expander_Closed_Property 
  90.    --  Type:  Object 
  91.    --  Descr: Pixbuf for closed expander 
  92.    -- 
  93.    --  Name:  Pixbuf_Expander_Open_Property 
  94.    --  Type:  Object 
  95.    --  Descr: Pixbuf for open expander 
  96.    -- 
  97.    --  Name:  Stock_Detail_Property 
  98.    --  Type:  String 
  99.    --  Descr: Render detail to pass to the theme engine 
  100.    -- 
  101.    --  Name:  Stock_Id_Property 
  102.    --  Type:  String 
  103.    --  Descr: The stock ID of the stock icon to render 
  104.    -- 
  105.    --  Name:  Stock_Size_Property 
  106.    --  Type:  Uint 
  107.    --  Descr: The GtkIconSize value that specifies the size of the rendered 
  108.    --         icon 
  109.    -- 
  110.    --  </properties> 
  111.  
  112.    Follow_State_Property           : constant Glib.Properties.Property_Boolean; 
  113.    Gicon_Property                  : constant Glib.Properties.Property_Object; 
  114.    Icon_Name_Property              : constant Glib.Properties.Property_String; 
  115.    Pixbuf_Property                 : constant Glib.Properties.Property_Object; 
  116.    Pixbuf_Expander_Closed_Property : constant Glib.Properties.Property_Object; 
  117.    Pixbuf_Expander_Open_Property   : constant Glib.Properties.Property_Object; 
  118.    Stock_Detail_Property           : constant Glib.Properties.Property_String; 
  119.    Stock_Id_Property               : constant Glib.Properties.Property_String; 
  120.    Stock_Size_Property             : constant Glib.Properties.Property_Uint; 
  121.  
  122. private 
  123.    type Gtk_Cell_Renderer_Pixbuf_Record is 
  124.      new Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record with null record; 
  125.  
  126.    Follow_State_Property : constant Glib.Properties.Property_Boolean := 
  127.      Glib.Properties.Build ("follow-state"); 
  128.    Gicon_Property : constant Glib.Properties.Property_Object := 
  129.      Glib.Properties.Build ("gicon"); 
  130.    Icon_Name_Property : constant Glib.Properties.Property_String := 
  131.      Glib.Properties.Build ("icon-name"); 
  132.    Pixbuf_Property : constant Glib.Properties.Property_Object := 
  133.      Glib.Properties.Build ("pixbuf"); 
  134.    Pixbuf_Expander_Closed_Property : constant Glib.Properties.Property_Object 
  135.      := Glib.Properties.Build ("pixbuf-expander-closed"); 
  136.    Pixbuf_Expander_Open_Property : constant Glib.Properties.Property_Object := 
  137.      Glib.Properties.Build ("pixbuf-expander-open"); 
  138.    Stock_Detail_Property : constant Glib.Properties.Property_String := 
  139.      Glib.Properties.Build ("stock-detail"); 
  140.    Stock_Id_Property : constant Glib.Properties.Property_String := 
  141.      Glib.Properties.Build ("stock-id"); 
  142.    Stock_Size_Property : constant Glib.Properties.Property_Uint := 
  143.      Glib.Properties.Build ("stock-size"); 
  144.  
  145.    pragma Import (C, Get_Type, "gtk_cell_renderer_pixbuf_get_type"); 
  146. end Gtk.Cell_Renderer_Pixbuf;