rollback to 3428, before the mysterious removal of libs/* at 3431/3432
[ardour.git] / libs / cairomm / cairomm / fontoptions.h
1 /* Copyright (C) 2005 The cairomm Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Library General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16  * 02110-1301, USA.
17  */
18
19 #ifndef __CAIROMM_FONTOPTIONS_H
20 #define __CAIROMM_FONTOPTIONS_H
21
22 #include <cairomm/enums.h>
23 #include <string>
24 #include <cairo.h>
25
26
27 namespace Cairo
28 {
29
30 /** How a font should be rendered.
31  */
32 class FontOptions
33 {
34 public:
35   FontOptions();
36   explicit FontOptions(cairo_font_options_t* cobject, bool take_ownership = false);
37   FontOptions(const FontOptions& src);
38
39   virtual ~FontOptions();
40
41   FontOptions& operator=(const FontOptions& src);
42
43   bool operator ==(const FontOptions& src) const;
44   //bool operator !=(const FontOptions& src) const;
45
46   void merge(const FontOptions& other);
47
48   unsigned long hash() const;
49
50   void set_antialias(Antialias antialias);
51   Antialias get_antialias() const;
52
53   void set_subpixel_order(SubpixelOrder subpixel_order);
54   SubpixelOrder get_subpixel_order() const;
55
56   void set_hint_style(HintStyle hint_style);
57   HintStyle get_hint_style() const;
58
59   void set_hint_metrics(HintMetrics hint_metrics);
60   HintMetrics get_hint_metrics() const;
61
62   typedef cairo_font_options_t cobject;
63   inline cobject* cobj() { return m_cobject; }
64   inline const cobject* cobj() const { return m_cobject; }
65
66   #ifndef DOXYGEN_IGNORE_THIS
67   ///For use only by the cairomm implementation.
68   inline ErrorStatus get_status() const
69   { return cairo_font_options_status(const_cast<cairo_font_options_t*>(cobj())); }
70   #endif //DOXYGEN_IGNORE_THIS
71
72 protected:
73
74   cobject* m_cobject;
75 };
76
77 } // namespace Cairo
78
79 #endif //__CAIROMM_FONTOPTIONS_H
80
81 // vim: ts=2 sw=2 et