GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

glyph.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_PANGO_GLYPH_HH 00025 #define GFC_PANGO_GLYPH_HH 00026 00027 #ifndef GFC_G_BOXED_HH 00028 #include <gfc/glib/boxed.hh> 00029 #endif 00030 00031 #ifndef GFC_PANGO_TYPES_HH 00032 #include <gfc/pango/types.hh> 00033 #endif 00034 00035 #ifndef __PANGO_GLYPH_H__ 00036 #include <pango/pango-glyph.h> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace Pango { 00046 00047 class Analysis; 00048 class Font; 00049 class Rectangle; 00050 00057 00058 typedef PangoGlyphUnit GlyphUnit; 00059 00065 00066 class GlyphGeometry 00067 { 00068 PangoGlyphGeometry geometry_; 00069 00070 public: 00071 PangoGlyphGeometry* pango_glyph_geometry() const; 00073 00074 GlyphUnit width() const; 00076 00077 GlyphUnit x_offset() const; 00079 00080 GlyphUnit y_offset() const; 00082 }; 00083 00089 00090 class GlyphVisAttr 00091 { 00092 PangoGlyphVisAttr attr_; 00093 00094 public: 00095 PangoGlyphVisAttr* pango_glyph_vis_attr() const; 00097 00098 bool is_cluster_start() const; 00103 }; 00104 00109 00110 class GlyphInfo 00111 { 00112 PangoGlyphInfo info_; 00113 00114 public: 00115 PangoGlyphInfo* pango_glyph_info() const { return const_cast<PangoGlyphInfo*>(&info_); } 00117 00118 Glyph glpyh() const; 00120 00121 const GlyphGeometry& geometry() const; 00123 00124 const GlyphVisAttr& attr() const; 00127 }; 00128 00134 00135 class GlyphString : public G::Boxed 00136 { 00137 public: 00140 00141 GlyphString(); 00143 00144 GlyphString(const char *text, int length, const Analysis& analysis); 00153 00154 GlyphString(const String& text, const Analysis& analysis); 00162 00163 explicit GlyphString(PangoGlyphString *string); 00171 00172 GlyphString(PangoGlyphString *string, bool copy); 00184 00185 GlyphString(const GlyphString& src); 00188 00189 virtual ~GlyphString(); 00191 00192 GlyphString& operator=(const GlyphString& src); 00195 00199 00200 PangoGlyphString* pango_glyph_string() const; 00202 00203 operator PangoGlyphString* () const; 00205 00206 int size() const; 00208 00209 std::vector<GlyphInfo> glyphs() const; 00211 00212 int* log_clusters() const; 00215 00216 void extents(const Font& font, Rectangle *ink_rect, Rectangle *logical_rect, int start = 0, int end = -1) const; 00233 00234 void get_logical_widths(const char *text, int length, int embedding_level, std::vector<int>& logical_widths) const; 00244 00245 void get_logical_widths(const String& text, int embedding_level, std::vector<int>& logical_widths) const; 00254 00258 00259 void set_size(int length); 00262 00263 int index_to_x(const char *text, int length, const Analysis& analysis, int index, bool trailing); 00274 00275 int index_to_x(const String& text, const Analysis& analysis, int index, bool trailing); 00285 00286 void x_to_index(const char *text, int length, const Analysis& analysis, int x_pos, int *index, bool *trailing); 00300 00301 void x_to_index(const String& text, const Analysis& analysis, int x_pos, int *index, bool *trailing); 00314 00316 }; 00317 00318 } // namespace Pango 00319 00320 } // namespace GFC 00321 00322 #include <gfc/pango/inline/glyph.inl> 00323 00324 #endif // GFC_PANGO_GLYPH_HH 00325

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8