1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --      Copyright (C) 2000 E. Briot, J. Brobecker and A. Charlet     -- 
  5. --                 Copyright (C) 2000-2008, 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. --  A Gtk_Font_Combo is a small toolbar used to select fonts. 
  27. --  This widget takes less real-estate on the screen than a 
  28. --  Gtk_Font_Selection widget, and thus can be kept permanently on the 
  29. --  screen. 
  30. --  This widget only works with postscript fonts (see Gtk.Extra.PsFont). 
  31. --  </description> 
  32. --  <c_version>gtkextra 2.1.1</c_version> 
  33. --  <group>GtkExtra, additional widgets</group> 
  34.  
  35. with Glib; 
  36. with Gtk.Toolbar; 
  37. with Gdk.Font; 
  38. with Pango.Font; 
  39.  
  40. package Gtk.Extra.Font_Combo is 
  41.  
  42.    type Gtk_Font_Combo_Record is new Gtk.Toolbar.Gtk_Toolbar_Record 
  43.      with private; 
  44.    type Gtk_Font_Combo is access all Gtk_Font_Combo_Record'Class; 
  45.  
  46.    procedure Gtk_New (Widget : out Gtk_Font_Combo); 
  47.    --  Create a new combo box 
  48.  
  49.    procedure Initialize (Widget : access Gtk_Font_Combo_Record'Class); 
  50.    --  Internal initialization function. 
  51.    --  See the section "Creating your own widgets" in the documentation. 
  52.  
  53.    function Get_Type return Glib.GType; 
  54.    --  Return the internal value associated with a Gtk_Font_Combo. 
  55.  
  56.    procedure Font_Combo_Select 
  57.      (Font_Combo : access Gtk_Font_Combo_Record; 
  58.       Family     : String; 
  59.       Bold       : Boolean; 
  60.       Italic     : Boolean; 
  61.       Height     : Gint); 
  62.    --  Selects a new font 
  63.    --  Family is the name of the postscript font. 
  64.  
  65.    procedure Font_Combo_Select_Nth 
  66.      (Font_Combo : access Gtk_Font_Combo_Record; 
  67.       N          : Gint; 
  68.       Bold       : Boolean; 
  69.       Italic     : Boolean; 
  70.       Height     : Gint); 
  71.    --  Selects the nth font in the combo box. 
  72.  
  73.    function Get_Font_Height 
  74.      (Font_Combo : access Gtk_Font_Combo_Record) return Glib.Gint; 
  75.    --  Return the height of the selected font 
  76.  
  77.    function Get_GdkFont 
  78.      (Font_Combo : access Gtk_Font_Combo_Record) return Gdk.Font.Gdk_Font; 
  79.    --  Return the selected font. 
  80.  
  81.    function Get_Font_Description 
  82.      (Font_Combo : access Gtk_Font_Combo_Record) 
  83.      return Pango.Font.Pango_Font_Description; 
  84.    --  Return the selected font. 
  85.  
  86.    ------------- 
  87.    -- Signals -- 
  88.    ------------- 
  89.  
  90.    --  <signals> 
  91.    --  The following new signals are defined for this widget: 
  92.    -- 
  93.    --  - "changed" 
  94.    --  procedure Handler (Combo : access Gtk_Font_Combo_Record'Class); 
  95.    -- 
  96.    --  Emitted when a new font was selected by the user. 
  97.    --  </signals> 
  98.  
  99. private 
  100.    type Gtk_Font_Combo_Record is new Gtk.Toolbar.Gtk_Toolbar_Record 
  101.      with null record; 
  102.    pragma Import (C, Get_Type, "gtk_font_combo_get_type"); 
  103.  
  104.    --  Unbound: 
  105.    --     gtk_font_combo_get_psfont 
  106. end Gtk.Extra.Font_Combo;