1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  A Gtk_Cell_Renderer_Pixbuf can be used to render an image in a cell. It 
  31. --  allows to render either a given Gdk_Pixbuf (set via the pixbuf property) or 
  32. --  a stock icon (set via the stock-id property). 
  33. -- 
  34. --  To support the tree view, Gtk_Cell_Renderer_Pixbuf also supports rendering 
  35. --  two alternative pixbufs, when the is-expander property is TRUE. If the 
  36. --  is-expanded property is TRUE and the pixbuf-expander-open property is set 
  37. --  to a pixbuf, it renders that pixbuf, if the is-expanded property is FALSE 
  38. --  and the pixbuf-expander-closed property is set to a pixbuf, it renders that 
  39. --  one. 
  40. --  </description> 
  41. --  <c_version>2.14</c_version> 
  42. --  <group>Trees and Lists</group> 
  43.  
  44. with Glib.Properties; 
  45. with Gtk.Cell_Renderer; 
  46.  
  47. package Gtk.Cell_Renderer_Pixbuf is 
  48.  
  49.    type Gtk_Cell_Renderer_Pixbuf_Record is 
  50.      new Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record with private; 
  51.    type Gtk_Cell_Renderer_Pixbuf is 
  52.      access all Gtk_Cell_Renderer_Pixbuf_Record'Class; 
  53.  
  54.    procedure Gtk_New (Widget : out Gtk_Cell_Renderer_Pixbuf); 
  55.    procedure Initialize 
  56.      (Widget : access Gtk_Cell_Renderer_Pixbuf_Record'Class); 
  57.    --  Creates or initializes a new renderer 
  58.  
  59.    function Get_Type return Gtk.Gtk_Type; 
  60.    --  Return the internal value associated with this widget. 
  61.  
  62.    ------------- 
  63.    -- Signals -- 
  64.    ------------- 
  65.  
  66.    --  <signals> 
  67.    --  The following new signals are defined for this widget: 
  68.    --  </signals> 
  69.  
  70.    ---------------- 
  71.    -- Properties -- 
  72.    ---------------- 
  73.  
  74.    --  <properties> 
  75.    --  The following properties are defined for this widget. See 
  76.    --  Glib.Properties for more information on properties. 
  77.    -- 
  78.    --  Name:  Follow_State_Property 
  79.    --  Type:  Boolean 
  80.    --  Descr: Whether the rendered pixbuf should be 
  81.    -- 
  82.    --  Name:  Gicon_Property 
  83.    --  Type:  Object 
  84.    --  Descr: The GIcon being displayed 
  85.    -- 
  86.    --  Name:  Icon_Name_Property 
  87.    --  Type:  String 
  88.    --  Descr: The name of the icon from the icon theme 
  89.    -- 
  90.    --  Name:  Pixbuf_Property 
  91.    --  Type:  Object 
  92.    --  Descr: The pixbuf to render 
  93.    -- 
  94.    --  Name:  Pixbuf_Expander_Closed_Property 
  95.    --  Type:  Object 
  96.    --  Descr: Pixbuf for closed expander 
  97.    -- 
  98.    --  Name:  Pixbuf_Expander_Open_Property 
  99.    --  Type:  Object 
  100.    --  Descr: Pixbuf for open expander 
  101.    -- 
  102.    --  Name:  Stock_Detail_Property 
  103.    --  Type:  String 
  104.    --  Descr: Render detail to pass to the theme engine 
  105.    -- 
  106.    --  Name:  Stock_Id_Property 
  107.    --  Type:  String 
  108.    --  Descr: The stock ID of the stock icon to render 
  109.    -- 
  110.    --  Name:  Stock_Size_Property 
  111.    --  Type:  Uint 
  112.    --  Descr: The GtkIconSize value that specifies the size of the rendered 
  113.    --         icon 
  114.    -- 
  115.    --  </properties> 
  116.  
  117.    Follow_State_Property           : constant Glib.Properties.Property_Boolean; 
  118.    Gicon_Property                  : constant Glib.Properties.Property_Object; 
  119.    Icon_Name_Property              : constant Glib.Properties.Property_String; 
  120.    Pixbuf_Property                 : constant Glib.Properties.Property_Object; 
  121.    Pixbuf_Expander_Closed_Property : constant Glib.Properties.Property_Object; 
  122.    Pixbuf_Expander_Open_Property   : constant Glib.Properties.Property_Object; 
  123.    Stock_Detail_Property           : constant Glib.Properties.Property_String; 
  124.    Stock_Id_Property               : constant Glib.Properties.Property_String; 
  125.    Stock_Size_Property             : constant Glib.Properties.Property_Uint; 
  126.  
  127. private 
  128.    type Gtk_Cell_Renderer_Pixbuf_Record is 
  129.      new Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record with null record; 
  130.  
  131.    Follow_State_Property : constant Glib.Properties.Property_Boolean := 
  132.      Glib.Properties.Build ("follow-state"); 
  133.    Gicon_Property : constant Glib.Properties.Property_Object := 
  134.      Glib.Properties.Build ("gicon"); 
  135.    Icon_Name_Property : constant Glib.Properties.Property_String := 
  136.      Glib.Properties.Build ("icon-name"); 
  137.    Pixbuf_Property : constant Glib.Properties.Property_Object := 
  138.      Glib.Properties.Build ("pixbuf"); 
  139.    Pixbuf_Expander_Closed_Property : constant Glib.Properties.Property_Object 
  140.      := Glib.Properties.Build ("pixbuf-expander-closed"); 
  141.    Pixbuf_Expander_Open_Property : constant Glib.Properties.Property_Object := 
  142.      Glib.Properties.Build ("pixbuf-expander-open"); 
  143.    Stock_Detail_Property : constant Glib.Properties.Property_String := 
  144.      Glib.Properties.Build ("stock-detail"); 
  145.    Stock_Id_Property : constant Glib.Properties.Property_String := 
  146.      Glib.Properties.Build ("stock-id"); 
  147.    Stock_Size_Property : constant Glib.Properties.Property_Uint := 
  148.      Glib.Properties.Build ("stock-size"); 
  149.  
  150.    pragma Import (C, Get_Type, "gtk_cell_renderer_pixbuf_get_type"); 
  151. end Gtk.Cell_Renderer_Pixbuf;