1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010-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 set of utilities to manipulate font options. 
  31. --  </description> 
  32. -- 
  33. --  <c_version>1.8.8</c_version> 
  34. --  <group>Cairo</group> 
  35.  
  36. package Cairo.Font_Options is 
  37.  
  38.    function Create return Cairo_Font_Options; 
  39.    --  Allocates a new font options object with all options initialized 
  40.    --  to default values. 
  41.    -- 
  42.    --  Return value: a newly allocated Cairo_Font_Options. Free with 
  43.    --  Cairo.Font_Options.Destroy. If memory cannot be allocated, then a 
  44.    --  special error object is returned where all operations on the object do 
  45.    --  nothing. You can check for this with Cairo.Font_Options.Status. 
  46.  
  47.    function Copy 
  48.      (Original : Cairo_Font_Options) 
  49.       return     Cairo_Font_Options; 
  50.    --  Original: a Cairo_Font_Options 
  51.    -- 
  52.    --  Allocates a new font options object copying the option values from 
  53.    --  original. 
  54.    -- 
  55.    --  Return value: a newly allocated Cairo_Font_Options. Free with 
  56.    --  Cairo.Font_Options.Destroy. If memory cannot be allocated, then a 
  57.    --  special error object is returned where all operations on the object do 
  58.    --  nothing. You can check for this with Cairo.Font_Options.Status. 
  59.  
  60.    procedure Destroy (Options : Cairo_Font_Options); 
  61.    --  Options: a Cairo_Font_Options 
  62.    -- 
  63.    --  Destroys a Cairo_Font_Options object created with 
  64.    --  Cairo.Font_Options.Create or Cairo.Font_Options.Copy. 
  65.  
  66.    function Status (Options : Cairo_Font_Options) return Cairo_Status; 
  67.    --  Options: a Cairo_Font_Options 
  68.    -- 
  69.    --  Checks whether an error has previously occurred for this 
  70.    --  font options object 
  71.    -- 
  72.    --  Return value: Cairo_Status_Success or Cairo_Status_No_Memory 
  73.  
  74.    procedure Merge 
  75.      (Options : Cairo_Font_Options; 
  76.       Other   : Cairo_Font_Options); 
  77.    --  Options: a Cairo_Font_Options 
  78.    --  Other: anOther Cairo_Font_Options 
  79.    -- 
  80.    --  Merges non-default options from other into options, replacing 
  81.    --  existing values. This operation can be thought of as somewhat 
  82.    --  similar to compositing other onto options with the operation 
  83.    --  of Cairo_Operation_Over. 
  84.  
  85.    function Equal 
  86.      (Options : Cairo_Font_Options; 
  87.       Other   : Cairo_Font_Options) 
  88.       return    Cairo_Bool; 
  89.    --  Options: a Cairo_Font_Options 
  90.    --  Other: another Cairo_Font_Options 
  91.    -- 
  92.    --  Compares two font options objects for equality. 
  93.    -- 
  94.    --  Return value: True if all fields of the two font options objects match. 
  95.    --  Note that this function will return False if either object is in 
  96.    --  error. 
  97.  
  98.    function Hash 
  99.      (Options : Cairo_Font_Options) 
  100.       return    Gulong; 
  101.    --  Options: a Cairo_Font_Options 
  102.    -- 
  103.    --  Compute a hash for the font options object; this value will 
  104.    --  be useful when storing an object containing a Cairo_Font_Options 
  105.    --  in a hash table. 
  106.    -- 
  107.    --  Return value: the hash value for the font options object. 
  108.    --  The return value can be cast to a 32-bit type if a 
  109.    --  32-bit hash value is needed. 
  110.  
  111.    procedure Set_Antialias 
  112.      (Options   : Cairo_Font_Options; 
  113.       Antialias : Cairo_Antialias); 
  114.    --  Options: a Cairo_Font_Options 
  115.    --  Antialias: the new Antialiasing mode 
  116.    -- 
  117.    --  Sets the antialiasing mode for the font options object. This 
  118.    --  specifies the type of antialiasing to do when rendering text. 
  119.  
  120.    function Get_Antialias 
  121.      (Options : Cairo_Font_Options) 
  122.       return    Cairo_Antialias; 
  123.    --  Options: a Cairo_Font_Options 
  124.    -- 
  125.    --  Gets the antialiasing mode for the font options object. 
  126.    -- 
  127.    --  Return value: the antialiasing mode 
  128.  
  129.    procedure Set_Subpixel_Order 
  130.      (Options        : Cairo_Font_Options; 
  131.       Subpixel_Order : Cairo_Subpixel_Order); 
  132.    --  Options: a Cairo_Font_Options 
  133.    --  Subpixel_Order: the new subpixel order 
  134.    -- 
  135.    --  Sets the subpixel order for the font options object. The subpixel 
  136.    --  order specifies the order of color elements within each pixel on 
  137.    --  the display device when rendering with an antialiasing mode of 
  138.    --  Cairo_Antialias_Subpixel. See the documentation for 
  139.    --  Cairo_Subpixel_Order for full details. 
  140.  
  141.    function Get_Subpixel_Order 
  142.      (Options : Cairo_Font_Options) 
  143.       return    Cairo_Subpixel_Order; 
  144.    --  Options: a Cairo_Font_Options 
  145.    -- 
  146.    --  Gets the subpixel order for the font options object. 
  147.    --  See the documentation for Cairo_Subpixel_Order for full details. 
  148.    -- 
  149.    --  Return value: the subpixel order for the font options object 
  150.  
  151.    procedure Set_Hint_Style 
  152.      (Options    : Cairo_Font_Options; 
  153.       Hint_Style : Cairo_Hint_Style); 
  154.    --  Options: a Cairo_Font_Options 
  155.    --  Hint_Style: the new hint style 
  156.    -- 
  157.    --  Sets the hint style for font outlines for the font options object. 
  158.    --  This controls whether to fit font outlines to the pixel grid, 
  159.    --  and if so, whether to optimize for fidelity or contrast. 
  160.    --  See the documentation for Cairo_Hint_Style for full details. 
  161.  
  162.    function Get_Hint_Style 
  163.      (Options : Cairo_Font_Options) 
  164.       return    Cairo_Hint_Style; 
  165.    --  Options: a Cairo_Font_Options 
  166.    -- 
  167.    --  Gets the hint style for font outlines for the font options object. 
  168.    --  See the documentation for Cairo_Hint_Style for full details. 
  169.    -- 
  170.    --  Return value: the hint style for the font options object 
  171.  
  172.    procedure Set_Hint_Metrics 
  173.      (Options      : Cairo_Font_Options; 
  174.       Hint_Metrics : Cairo_Hint_Metrics); 
  175.    --  Options: a Cairo_Font_Options 
  176.    --  Hint_Metrics: the new metrics hinting mode 
  177.    -- 
  178.    --  Sets the metrics hinting mode for the font options object. This 
  179.    --  controls whether metrics are quantized to integer values in 
  180.    --  device units. 
  181.    --  See the documentation for Cairo_Hint_Metrics for full details. 
  182.  
  183.    function Get_Hint_Metrics 
  184.      (Options : Cairo_Font_Options) 
  185.       return    Cairo_Hint_Metrics; 
  186.    --  Options: a Cairo_Font_Options 
  187.    -- 
  188.    --  Gets the metrics hinting mode for the font options object. 
  189.    --  See the documentation for Cairo_Hint_Metrics for full details. 
  190.    -- 
  191.    --  Return value: the metrics hinting mode for the font options object 
  192.  
  193. private 
  194.  
  195.    pragma Import (C, Create, "cairo_font_options_create"); 
  196.    pragma Import (C, Copy, "cairo_font_options_copy"); 
  197.    pragma Import (C, Destroy, "cairo_font_options_destroy"); 
  198.    pragma Import (C, Status, "cairo_font_options_status"); 
  199.    pragma Import (C, Merge, "cairo_font_options_merge"); 
  200.    pragma Import (C, Equal, "cairo_font_options_equal"); 
  201.    pragma Import (C, Hash, "cairo_font_options_hash"); 
  202.    pragma Import (C, Set_Antialias, "cairo_font_options_set_antialias"); 
  203.    pragma Import (C, Get_Antialias, "cairo_font_options_get_antialias"); 
  204.    pragma Import 
  205.      (C, 
  206.       Set_Subpixel_Order, 
  207.       "cairo_font_options_set_subpixel_order"); 
  208.    pragma Import 
  209.      (C, 
  210.       Get_Subpixel_Order, 
  211.       "cairo_font_options_get_subpixel_order"); 
  212.    pragma Import (C, Set_Hint_Style, "cairo_font_options_set_hint_style"); 
  213.    pragma Import (C, Get_Hint_Style, "cairo_font_options_get_hint_style"); 
  214.    pragma Import (C, Set_Hint_Metrics, "cairo_font_options_set_hint_metrics"); 
  215.    pragma Import (C, Get_Hint_Metrics, "cairo_font_options_get_hint_metrics"); 
  216.  
  217. end Cairo.Font_Options;