• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

xap_Draw_Symbol.h

Go to the documentation of this file.
00001 /* AbiSource Application Framework
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (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 General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 
00021 #ifndef XAP_DRAW_SYMBOL_H
00022 #define XAP_DRAW_SYMBOL_H
00023 
00024 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
00025  * so even if it's commented out in-file that's still a lot of work for
00026  * the preprocessor to do...
00027  */
00028 #ifndef UT_TYPES_H
00029 #include "ut_types.h"
00030 #endif
00031 #include "ut_misc.h"
00032 
00033 #include "xap_Preview.h"
00034 
00035 class GR_Font;
00036 
00037 class ABI_EXPORT XAP_Draw_Symbol : public XAP_Preview
00038 {
00039 public:
00040 
00041     XAP_Draw_Symbol(GR_Graphics * gc);
00042     virtual ~XAP_Draw_Symbol();
00043 
00044     // data twiddlers
00045     void                        setSelectedFont(const char *font);
00046     void                        setFontString();
00047     void                        setFontStringarea();
00048     void                        setFontToGC(GR_Graphics *p_gc, UT_uint32 MaxWidthAllowable, UT_uint32 MaxHeightAllowable);
00049     void                        setFontfont(GR_Font * font);
00050     void                        setWindowSize(UT_uint32 width, UT_uint32 height);
00051     void                        setAreaSize(UT_uint32 width, UT_uint32 height);
00052     void                        setAreaGc(GR_Graphics *);
00053     void                        setRow(UT_uint32 row);
00054 
00055     const char*                 getSelectedFont();
00056     UT_uint32                   getSymbolRows ();
00057 
00058     // where all the Symbol-specific drawing happens
00059 
00060     void                        draw(const UT_Rect *clip=NULL);
00061     void                        drawarea(UT_UCSChar c, UT_UCSChar p);
00062 
00063     UT_UCSChar                  calcSymbol(UT_uint32 x, UT_uint32 y);
00064     UT_UCSChar                  calcSymbolFromCoords(UT_uint32 x, UT_uint32 y);
00065     void                        setCurrent(UT_UCSChar c);
00066     UT_UCSChar                  getCurrent() { return m_CurrentSymbol; }
00067 
00068     void                        onLeftButtonDown(UT_sint32 x, UT_sint32 y);
00069     void                        calculatePosition(UT_UCSChar c, UT_uint32 &x, UT_uint32 &y);
00070     GR_Graphics *               getGraphics(void){return m_areagc;};
00071 
00072 protected:
00073     GR_Graphics *               m_areagc;
00074     GR_Font *                   m_pFont;    // so we can delete it
00075 
00076     UT_uint32                   m_drawWidth;
00077     UT_uint32                   m_drawHeight;
00078     UT_uint32                   m_drawareaWidth;
00079     UT_uint32                   m_drawareaHeight;
00080     UT_sint32                   m_start_base;
00081     UT_sint32           m_start_nb_char;
00082 
00083     UT_UCSChar                  m_CurrentSymbol;
00084     UT_UCSChar                  m_PreviousSymbol;
00085 
00086 private:
00087 
00088     UT_NumberVector             m_vCharSet;
00089     UT_String               m_stFont;
00090 };
00091 
00092 #endif /* XAP_Draw_Symbol_H */
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1