1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --                     Copyright (C) 2010-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  A set of utilities to manipulate font options. 
  26. --  </description> 
  27. -- 
  28. --  <c_version>1.8.8</c_version> 
  29. --  <group>Cairo</group> 
  30.  
  31. package Cairo.Font_Options is 
  32.  
  33.    function Create return Cairo_Font_Options; 
  34.    --  Allocates a new font options object with all options initialized 
  35.    --  to default values. 
  36.    -- 
  37.    --  Return value: a newly allocated Cairo_Font_Options. Free with 
  38.    --  Cairo.Font_Options.Destroy. If memory cannot be allocated, then a 
  39.    --  special error object is returned where all operations on the object do 
  40.    --  nothing. You can check for this with Cairo.Font_Options.Status. 
  41.  
  42.    function Copy 
  43.      (Original : Cairo_Font_Options) 
  44.       return     Cairo_Font_Options; 
  45.    --  Original: a Cairo_Font_Options 
  46.    -- 
  47.    --  Allocates a new font options object copying the option values from 
  48.    --  original. 
  49.    -- 
  50.    --  Return value: a newly allocated Cairo_Font_Options. Free with 
  51.    --  Cairo.Font_Options.Destroy. If memory cannot be allocated, then a 
  52.    --  special error object is returned where all operations on the object do 
  53.    --  nothing. You can check for this with Cairo.Font_Options.Status. 
  54.  
  55.    procedure Destroy (Options : Cairo_Font_Options); 
  56.    --  Options: a Cairo_Font_Options 
  57.    -- 
  58.    --  Destroys a Cairo_Font_Options object created with 
  59.    --  Cairo.Font_Options.Create or Cairo.Font_Options.Copy. 
  60.  
  61.    function Status (Options : Cairo_Font_Options) return Cairo_Status; 
  62.    --  Options: a Cairo_Font_Options 
  63.    -- 
  64.    --  Checks whether an error has previously occurred for this 
  65.    --  font options object 
  66.    -- 
  67.    --  Return value: Cairo_Status_Success or Cairo_Status_No_Memory 
  68.  
  69.    procedure Merge 
  70.      (Options : Cairo_Font_Options; 
  71.       Other   : Cairo_Font_Options); 
  72.    --  Options: a Cairo_Font_Options 
  73.    --  Other: anOther Cairo_Font_Options 
  74.    -- 
  75.    --  Merges non-default options from other into options, replacing 
  76.    --  existing values. This operation can be thought of as somewhat 
  77.    --  similar to compositing other onto options with the operation 
  78.    --  of Cairo_Operation_Over. 
  79.  
  80.    function Equal 
  81.      (Options : Cairo_Font_Options; 
  82.       Other   : Cairo_Font_Options) 
  83.       return    Boolean; 
  84.    --  Options: a Cairo_Font_Options 
  85.    --  Other: another Cairo_Font_Options 
  86.    -- 
  87.    --  Compares two font options objects for equality. 
  88.    -- 
  89.    --  Return value: True if all fields of the two font options objects match. 
  90.    --  Note that this function will return False if either object is in 
  91.    --  error. 
  92.  
  93.    function Hash 
  94.      (Options : Cairo_Font_Options) 
  95.       return    Gulong; 
  96.    --  Options: a Cairo_Font_Options 
  97.    -- 
  98.    --  Compute a hash for the font options object; this value will 
  99.    --  be useful when storing an object containing a Cairo_Font_Options 
  100.    --  in a hash table. 
  101.    -- 
  102.    --  Return value: the hash value for the font options object. 
  103.    --  The return value can be cast to a 32-bit type if a 
  104.    --  32-bit hash value is needed. 
  105.  
  106.    procedure Set_Antialias 
  107.      (Options   : Cairo_Font_Options; 
  108.       Antialias : Cairo_Antialias); 
  109.    --  Options: a Cairo_Font_Options 
  110.    --  Antialias: the new Antialiasing mode 
  111.    -- 
  112.    --  Sets the antialiasing mode for the font options object. This 
  113.    --  specifies the type of antialiasing to do when rendering text. 
  114.  
  115.    function Get_Antialias 
  116.      (Options : Cairo_Font_Options) 
  117.       return    Cairo_Antialias; 
  118.    --  Options: a Cairo_Font_Options 
  119.    -- 
  120.    --  Gets the antialiasing mode for the font options object. 
  121.    -- 
  122.    --  Return value: the antialiasing mode 
  123.  
  124.    procedure Set_Subpixel_Order 
  125.      (Options        : Cairo_Font_Options; 
  126.       Subpixel_Order : Cairo_Subpixel_Order); 
  127.    --  Options: a Cairo_Font_Options 
  128.    --  Subpixel_Order: the new subpixel order 
  129.    -- 
  130.    --  Sets the subpixel order for the font options object. The subpixel 
  131.    --  order specifies the order of color elements within each pixel on 
  132.    --  the display device when rendering with an antialiasing mode of 
  133.    --  Cairo_Antialias_Subpixel. See the documentation for 
  134.    --  Cairo_Subpixel_Order for full details. 
  135.  
  136.    function Get_Subpixel_Order 
  137.      (Options : Cairo_Font_Options) 
  138.       return    Cairo_Subpixel_Order; 
  139.    --  Options: a Cairo_Font_Options 
  140.    -- 
  141.    --  Gets the subpixel order for the font options object. 
  142.    --  See the documentation for Cairo_Subpixel_Order for full details. 
  143.    -- 
  144.    --  Return value: the subpixel order for the font options object 
  145.  
  146.    procedure Set_Hint_Style 
  147.      (Options    : Cairo_Font_Options; 
  148.       Hint_Style : Cairo_Hint_Style); 
  149.    --  Options: a Cairo_Font_Options 
  150.    --  Hint_Style: the new hint style 
  151.    -- 
  152.    --  Sets the hint style for font outlines for the font options object. 
  153.    --  This controls whether to fit font outlines to the pixel grid, 
  154.    --  and if so, whether to optimize for fidelity or contrast. 
  155.    --  See the documentation for Cairo_Hint_Style for full details. 
  156.  
  157.    function Get_Hint_Style 
  158.      (Options : Cairo_Font_Options) 
  159.       return    Cairo_Hint_Style; 
  160.    --  Options: a Cairo_Font_Options 
  161.    -- 
  162.    --  Gets the hint style for font outlines for the font options object. 
  163.    --  See the documentation for Cairo_Hint_Style for full details. 
  164.    -- 
  165.    --  Return value: the hint style for the font options object 
  166.  
  167.    procedure Set_Hint_Metrics 
  168.      (Options      : Cairo_Font_Options; 
  169.       Hint_Metrics : Cairo_Hint_Metrics); 
  170.    --  Options: a Cairo_Font_Options 
  171.    --  Hint_Metrics: the new metrics hinting mode 
  172.    -- 
  173.    --  Sets the metrics hinting mode for the font options object. This 
  174.    --  controls whether metrics are quantized to integer values in 
  175.    --  device units. 
  176.    --  See the documentation for Cairo_Hint_Metrics for full details. 
  177.  
  178.    function Get_Hint_Metrics 
  179.      (Options : Cairo_Font_Options) 
  180.       return    Cairo_Hint_Metrics; 
  181.    --  Options: a Cairo_Font_Options 
  182.    -- 
  183.    --  Gets the metrics hinting mode for the font options object. 
  184.    --  See the documentation for Cairo_Hint_Metrics for full details. 
  185.    -- 
  186.    --  Return value: the metrics hinting mode for the font options object 
  187.  
  188. private 
  189.  
  190.    pragma Import (C, Create, "cairo_font_options_create"); 
  191.    pragma Import (C, Copy, "cairo_font_options_copy"); 
  192.    pragma Import (C, Destroy, "cairo_font_options_destroy"); 
  193.    pragma Import (C, Status, "cairo_font_options_status"); 
  194.    pragma Import (C, Merge, "cairo_font_options_merge"); 
  195.    pragma Import (C, Hash, "cairo_font_options_hash"); 
  196.    pragma Import (C, Set_Antialias, "cairo_font_options_set_antialias"); 
  197.    pragma Import (C, Get_Antialias, "cairo_font_options_get_antialias"); 
  198.    pragma Import 
  199.      (C, 
  200.       Set_Subpixel_Order, 
  201.       "cairo_font_options_set_subpixel_order"); 
  202.    pragma Import 
  203.      (C, 
  204.       Get_Subpixel_Order, 
  205.       "cairo_font_options_get_subpixel_order"); 
  206.    pragma Import (C, Set_Hint_Style, "cairo_font_options_set_hint_style"); 
  207.    pragma Import (C, Get_Hint_Style, "cairo_font_options_get_hint_style"); 
  208.    pragma Import (C, Set_Hint_Metrics, "cairo_font_options_set_hint_metrics"); 
  209.    pragma Import (C, Get_Hint_Metrics, "cairo_font_options_get_hint_metrics"); 
  210.  
  211. end Cairo.Font_Options;