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