⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wg__renderedstring_8h-source.html

📁 一个小巧的嵌入式图形系统wGUI, 可以用VC编译
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>wg_renderedstring.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; </center><hr><h1>wg_renderedstring.h</h1><div class="fragment"><pre>00001 <span class="comment">// wg_renderedstring.h</span>00002 <span class="comment">//</span>00003 <span class="comment">// CRenderedString interface</span>00004 <span class="comment">// CRenderedString uses the FreeType 2 library</span>00005 <span class="comment">//</span>00006 <span class="comment">//</span>00007 <span class="comment">// Copyright (c) 2002 Rob Wiskow</span>00008 <span class="comment">// rob-dev@boxedchaos.com</span>00009 <span class="comment">//</span>00010 <span class="comment">// This library is free software; you can redistribute it and/or</span>00011 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>00012 <span class="comment">// License as published by the Free Software Foundation; either</span>00013 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>00014 <span class="comment">//</span>00015 <span class="comment">// This library is distributed in the hope that it will be useful,</span>00016 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>00017 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>00018 <span class="comment">// Lesser General Public License for more details.</span>00019 <span class="comment">//</span>00020 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>00021 <span class="comment">// License along with this library; if not, write to the Free Software</span>00022 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>00023 <span class="comment">//</span>00024 00025 00026 <span class="preprocessor">#ifndef _WG_RENDEREDSTRING_H_</span>00027 <span class="preprocessor"></span><span class="preprocessor">#define _WG_RENDEREDSTRING_H_</span>00028 <span class="preprocessor"></span>00029 <span class="preprocessor">#include "wg_fontengine.h"</span>00030 <span class="preprocessor">#include &lt;vector&gt;</span>00031 <span class="preprocessor">#include "wg_rect.h"</span>00032 <span class="preprocessor">#include "wg_color.h"</span>00033 <span class="preprocessor">#include "SDL.h"</span>00034 00035 00036 <span class="keyword">namespace </span>wGui00037 {00038 00039 <span class="preprocessor">#ifdef WIN32</span>00040 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(push)</span>00041 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(disable: 4512)</span>00042 <span class="preprocessor"></span><span class="preprocessor">#endif // WIN32</span>00043 <span class="preprocessor"></span>00046 <a name="l00047"></a><a class="code" href="classwGui_1_1CRenderedString.html">00047</a> <span class="keyword">class </span><a class="code" href="classwGui_1_1CRenderedString.html">CRenderedString</a>00048 {00049 <span class="keyword">public</span>:<a name="l00051"></a><a class="code" href="classwGui_1_1CRenderedString.html#s7">00051</a>      <span class="keyword">enum</span> <a class="code" href="classwGui_1_1CRenderedString.html#s7">EVAlign</a>00052      {00053           <a class="code" href="classwGui_1_1CRenderedString.html#s7s0">VALIGN_NORMAL</a>,  00054           <a class="code" href="classwGui_1_1CRenderedString.html#s7s1">VALIGN_CENTER</a>,  00055           <a class="code" href="classwGui_1_1CRenderedString.html#s7s2">VALIGN_TOP</a>,  00056           <a class="code" href="classwGui_1_1CRenderedString.html#s7s3">VALIGN_BOTTOM</a>  00057      };00058 <a name="l00060"></a><a class="code" href="classwGui_1_1CRenderedString.html#s8">00060</a>      <span class="keyword">enum</span> <a class="code" href="classwGui_1_1CRenderedString.html#s8">EHAlign</a>00061      {00062           <a class="code" href="classwGui_1_1CRenderedString.html#s8s4">HALIGN_LEFT</a>,  00063           <a class="code" href="classwGui_1_1CRenderedString.html#s8s5">HALIGN_CENTER</a>,  00064           <a class="code" href="classwGui_1_1CRenderedString.html#s8s6">HALIGN_RIGHT</a>  00065      };00066 00072      <a class="code" href="classwGui_1_1CRenderedString.html#a0">CRenderedString</a>(CFontEngine* pFontEngine, <span class="keyword">const</span> std::string&amp; sString, <a class="code" href="classwGui_1_1CRenderedString.html#s7">EVAlign</a> eVertAlign = <a class="code" href="classwGui_1_1CRenderedString.html#s7s0">VALIGN_NORMAL</a>, <a class="code" href="classwGui_1_1CRenderedString.html#s8">EHAlign</a> eHorzAlign = <a class="code" href="classwGui_1_1CRenderedString.html#s8s4">HALIGN_LEFT</a>);00073 00079      <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CRenderedString.html#a1">Draw</a>(SDL_Surface* pSurface, <span class="keyword">const</span> CRect&amp; BoundingRect, <span class="keyword">const</span> CPoint&amp; OriginPoint, <span class="keyword">const</span> CRGBColor&amp; FontColor = DEFAULT_LINE_COLOR) <span class="keyword">const</span>;00080 00085      <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CRenderedString.html#a2">GetMetrics</a>(CPoint* pBoundedDimensions, CPoint* pOriginOffset, std::vector&lt;CRect&gt;* pCharacterRects = 0) <span class="keyword">const</span>;00086 <a name="l00089"></a><a class="code" href="classwGui_1_1CRenderedString.html#a3">00089</a>      <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classwGui_1_1CRenderedString.html#a3">GetLength</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> static_cast&lt;unsigned int&gt;(<a class="code" href="classwGui_1_1CRenderedString.html#n1">m_sString</a>.size()); }00090 00093      <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classwGui_1_1CRenderedString.html#a4">GetMaxFontHeight</a>();00094 <a name="l00097"></a><a class="code" href="classwGui_1_1CRenderedString.html#a5">00097</a>      <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CRenderedString.html#a5">SetMaskChar</a>(<span class="keywordtype">char</span> MaskChar) { <a class="code" href="classwGui_1_1CRenderedString.html#n2">m_MaskChar</a> = MaskChar; }00098 00099 00100 <span class="keyword">protected</span>:<a name="l00101"></a><a class="code" href="classwGui_1_1CRenderedString.html#n0">00101</a>      <a class="code" href="classwGui_1_1CFontEngine.html">CFontEngine</a>* <a class="code" href="classwGui_1_1CRenderedString.html#n0">m_pFontEngine</a>;  <a name="l00102"></a><a class="code" href="classwGui_1_1CRenderedString.html#n1">00102</a>      std::string <a class="code" href="classwGui_1_1CRenderedString.html#n1">m_sString</a>;  <a name="l00103"></a><a class="code" href="classwGui_1_1CRenderedString.html#n2">00103</a>      <span class="keywordtype">char</span> <a class="code" href="classwGui_1_1CRenderedString.html#n2">m_MaskChar</a>;  00104 00105 00106 <span class="keyword">private</span>:00107      <a class="code" href="classwGui_1_1CRenderedString.html#s7">EVAlign</a> m_eVertAlign;  00108      <a class="code" href="classwGui_1_1CRenderedString.html#s8">EHAlign</a> m_eHorzAlign;  00109      <span class="keyword">mutable</span> <a class="code" href="classwGui_1_1CPoint.html">CPoint</a> m_CachedBoundedDimensions;  00110      <span class="keyword">mutable</span> <a class="code" href="classwGui_1_1CPoint.html">CPoint</a> m_OriginOffset;  00111      <span class="keyword">mutable</span> std::vector&lt;CRect&gt; m_CachedCharacterRects;  00112      <span class="keyword">mutable</span> <span class="keywordtype">bool</span> m_bCachedMetricsValid;  00113      <span class="keywordtype">int</span> m_MaxFontHeight; 00114 };00115 00116 <span class="preprocessor">#ifdef WIN32</span>00117 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(pop)</span>00118 <span class="preprocessor"></span><span class="preprocessor">#endif // WIN32</span>00119 <span class="preprocessor"></span>00120 }00121 00122 <span class="preprocessor">#endif  // _WG_RENDEREDSTRING_H_</span></pre></div><hr><address style="align: right;"><small>Generated on Sat Oct 25 12:43:24 2003 for wGui by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -