00001 /* Copyright (C) 2005 The cairomm Development Team 00002 * 00003 * This library is free software; you can redistribute it and/or 00004 * modify it under the terms of the GNU Library General Public 00005 * License as published by the Free Software Foundation; either 00006 * version 2 of the License, or (at your option) any later version. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Library General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Library General Public 00014 * License along with this library; if not, write to the Free 00015 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00016 */ 00017 00018 #ifndef __CAIROMM_FONTOPTIONS_H 00019 #define __CAIROMM_FONTOPTIONS_H 00020 00021 #include <cairomm/enums.h> 00022 #include <string> 00023 #include <cairo/cairo.h> 00024 00025 00026 namespace Cairo 00027 { 00028 00029 typedef cairo_antialias_t Antialias; 00030 typedef cairo_subpixel_order_t SubpixelOrder; 00031 typedef cairo_hint_style_t HintStyle; 00032 typedef cairo_hint_metrics_t HintMetrics; 00033 00036 class FontOptions 00037 { 00038 public: 00039 FontOptions(); 00040 explicit FontOptions(cairo_font_options_t* cobject, bool take_ownership = false); 00041 FontOptions(const FontOptions& src); 00042 00043 virtual ~FontOptions(); 00044 00045 FontOptions& operator=(const FontOptions& src); 00046 00047 bool operator ==(const FontOptions& src) const; 00048 //bool operator !=(const FontOptions& src) const; 00049 00050 void merge(const FontOptions& other); 00051 00052 unsigned long hash() const; 00053 00054 void set_antialias(Antialias antialias); 00055 Antialias get_antialias() const; 00056 00057 void set_subpixel_order(SubpixelOrder subpixel_order); 00058 SubpixelOrder get_subpixel_order() const; 00059 00060 void set_hint_style(HintStyle hint_style); 00061 HintStyle get_hint_style() const; 00062 00063 void set_hint_metrics(HintMetrics hint_metrics); 00064 HintMetrics get_hint_metrics() const; 00065 00066 typedef cairo_font_options_t cobject; 00067 inline cobject* cobj() { return m_cobject; } 00068 inline const cobject* cobj() const { return m_cobject; } 00069 00070 #ifndef DOXYGEN_IGNORE_THIS 00071 00072 inline ErrorStatus get_status() const 00073 { return cairo_font_options_status(const_cast<cairo_font_options_t*>(cobj())); } 00074 #endif //DOXYGEN_IGNORE_THIS 00075 00076 protected: 00077 00078 cobject* m_cobject; 00079 }; 00080 00081 } // namespace Cairo 00082 00083 #endif //__CAIROMM_FONTOPTIONS_H 00084