1 /* Copyright (C) 2005 The cairomm Development Team
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.
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.
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
19 #ifndef __CAIROMM_FONTFACE_H
20 #define __CAIROMM_FONTFACE_H
22 #include <cairomm/enums.h>
30 * This is a reference-counted object that should be used via Cairo::RefPtr.
36 //TODO?: FontFace(cairo_font_face_t *target);
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.
44 explicit FontFace(cairo_font_face_t* cobject, bool has_reference = false);
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);
52 void set_user_data(const cairo_user_data_key_t *key, void *user_data, cairo_destroy_func_t destroy);
55 FontType get_type() const;
57 typedef cairo_font_face_t cobject;
58 inline cobject* cobj() { return m_cobject; }
59 inline const cobject* cobj() const { return m_cobject; }
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
67 void reference() const;
68 void unreference() const;
77 #endif //__CAIROMM_FONTFACE_H