FTGL 2.1.3~rc5
FTLayout.h
Go to the documentation of this file.
00001 /*
00002  * FTGL - OpenGL font library
00003  *
00004  * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
00005  * Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
00006  * Copyright (c) 2008 Sean Morrison <learner@brlcad.org>
00007  *
00008  * Permission is hereby granted, free of charge, to any person obtaining
00009  * a copy of this software and associated documentation files (the
00010  * "Software"), to deal in the Software without restriction, including
00011  * without limitation the rights to use, copy, modify, merge, publish,
00012  * distribute, sublicense, and/or sell copies of the Software, and to
00013  * permit persons to whom the Software is furnished to do so, subject to
00014  * the following conditions:
00015  *
00016  * The above copyright notice and this permission notice shall be
00017  * included in all copies or substantial portions of the Software.
00018  *
00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00020  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00021  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00022  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00023  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00024  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00025  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00026  */
00027 
00028 #ifndef __ftgl__
00029 #   warning This header is deprecated. Please use <FTGL/ftgl.h> from now.
00030 #   include <FTGL/ftgl.h>
00031 #endif
00032 
00033 #ifndef __FTLayout__
00034 #define __FTLayout__
00035 
00036 #ifdef __cplusplus
00037 
00038 
00039 class FTLayoutImpl;
00040 
00052 class FTGL_EXPORT FTLayout
00053 {
00054     protected:
00055         FTLayout();
00056 
00057     private:
00064         FTLayout(FTLayoutImpl *pImpl);
00065 
00066         /* Allow our internal subclasses to access the private constructor */
00067         friend class FTSimpleLayout;
00068 
00069     public:
00073         virtual ~FTLayout();
00074 
00085         virtual FTBBox BBox(const char* string, const int len = -1,
00086                             FTPoint position = FTPoint()) = 0;
00087 
00098         virtual FTBBox BBox(const wchar_t* string, const int len = -1,
00099                             FTPoint position = FTPoint()) = 0;
00100 
00111         virtual void Render(const char *string, const int len = -1,
00112                             FTPoint position = FTPoint(),
00113                             int renderMode = FTGL::RENDER_ALL) = 0;
00114 
00125         virtual void Render(const wchar_t *string, const int len = -1,
00126                             FTPoint position = FTPoint(),
00127                             int renderMode = FTGL::RENDER_ALL) = 0;
00128 
00134         virtual FT_Error Error() const;
00135 
00136     private:
00140         FTLayoutImpl *impl;
00141 };
00142 
00143 #endif //__cplusplus
00144 
00145 FTGL_BEGIN_C_DECLS
00146 
00150 struct _FTGLlayout;
00151 typedef struct _FTGLlayout FTGLlayout;
00152 
00158 FTGL_EXPORT void ftglDestroyLayout(FTGLlayout* layout);
00159 
00168 FTGL_EXPORT void ftglGetLayoutBBox(FTGLlayout *layout, const char* string,
00169                                    float bounds[6]);
00170 
00178 FTGL_EXPORT void ftglRenderLayout(FTGLlayout *layout, const char *string,
00179                                   int mode);
00180 
00187 FTGL_EXPORT FT_Error ftglGetLayoutError(FTGLlayout* layout);
00188 
00189 FTGL_END_C_DECLS
00190 
00191 #endif  /* __FTLayout__ */
00192