* added files in patch for ardour-3.0 to compile on OS X thanks to Sakari Bergen
[ardour.git] / libs / cairomm / cairomm / fontface.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_FONTFACE_H
20 #define __CAIROMM_FONTFACE_H
21
22 #include <cairomm/enums.h>
23 #include <cairo.h>
24
25
26 namespace Cairo
27 {
28
29 /**
30  * This is a reference-counted object that should be used via Cairo::RefPtr.
31  */
32 class FontFace
33 {
34 protected:
35
36   //TODO?: FontFace(cairo_font_face_t *target);
37
38 public:
39
40   /** Create a C++ wrapper for the C instance. This C++ instance should then be given to a RefPtr.
41    * @param cobject The C instance.
42    * @param has_reference Whether we already have a reference. Otherwise, the constructor will take an extra reference.
43    */
44   explicit FontFace(cairo_font_face_t* cobject, bool has_reference = false);
45
46
47   virtual ~FontFace();
48
49   /* Don't wrap these until we know what they are good for.
50   void* get_user_data(const cairo_user_data_key_t *key);
51
52   void set_user_data(const cairo_user_data_key_t *key, void *user_data, cairo_destroy_func_t destroy);
53   */
54
55   FontType get_type() const;
56
57   typedef cairo_font_face_t cobject;
58   inline cobject* cobj() { return m_cobject; }
59   inline const cobject* cobj() const { return m_cobject; }
60
61   #ifndef DOXYGEN_IGNORE_THIS
62   ///For use only by the cairomm implementation.
63   inline ErrorStatus get_status() const
64   { return cairo_font_face_status(const_cast<cairo_font_face_t*>(cobj())); }
65   #endif //DOXYGEN_IGNORE_THIS
66
67   void reference() const;
68   void unreference() const;
69
70 protected:
71
72   cobject* m_cobject;
73 };
74
75 } // namespace Cairo
76
77 #endif //__CAIROMM_FONTFACE_H
78
79 // vim: ts=2 sw=2 et