00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GR_GRAPHICS_H
00023 #define GR_GRAPHICS_H
00024
00025 #include "xap_Features.h"
00026
00027 #include "ut_types.h"
00028 #include "ut_units.h"
00029 #include "ut_growbuf.h"
00030 #include "ut_misc.h"
00031 #include "gr_Image.h"
00032 #include "gr_Caret.h"
00033 #include "gr_Transform.h"
00034 #include "gr_CharWidthsCache.h"
00035 #include "ut_hash.h"
00036 #include "ut_vector.h"
00037 #include "ut_TextIterator.h"
00038
00039 #ifdef ABI_GRAPHICS_PLUGIN
00040 #define VIRTUAL_SFX = 0
00041 #else
00042 #define VIRTUAL_SFX
00043 #endif
00044
00045 class UT_RGBColor;
00046 class XAP_PrefsScheme;
00047 class XAP_Frame;
00048 class UT_String;
00049 class GR_RenderInfo;
00050 class GR_Itemization;
00051 class GR_ShapingInfo;
00052
00053
00068 class GR_Graphics;
00069 class GR_Painter;
00070 class GR_Caret;
00071
00072 typedef enum {
00073 GR_FONT_UNSET=0,
00074 GR_FONT_UNIX,
00075 GR_FONT_UNIX_PANGO,
00076 GR_FONT_WIN32,
00077 GR_FONT_WIN32_USP
00078 } GrFontType;
00079
00080 class ABI_EXPORT GR_Font
00081 {
00082 friend class GR_Graphics;
00083 friend class UT_GenericStringMap<GR_Font*>;
00084
00085 public:
00086
00087
00088 virtual ~GR_Font();
00089
00090
00091 typedef enum { FF_Unknown = 0, FF_Roman, FF_Swiss, FF_Modern,
00092 FF_Script, FF_Decorative, FF_Technical, FF_BiDi, FF_Last } FontFamilyEnum;
00093 typedef enum { FP_Unknown = 0, FP_Fixed, FP_Variable } FontPitchEnum;
00094
00095
00096
00097 static void s_getGenericFontProperties(const char * szFontName,
00098 FontFamilyEnum * pff,
00099 FontPitchEnum * pfp,
00100 bool * pbTrueType);
00101
00102 virtual const char* getFamily() const { return NULL; }
00103 UT_uint32 getAllocNumber() const {return m_iAllocNo;}
00108 virtual UT_sint32 measureUnremappedCharForCache(UT_UCSChar cChar) const = 0;
00109 virtual const UT_String & hashKey(void) const;
00110 UT_sint32 getCharWidthFromCache (UT_UCSChar c) const;
00111
00112
00113 virtual GR_CharWidths* newFontWidths(void) const;
00114
00115
00116
00117
00118
00119 virtual bool doesGlyphExist(UT_UCS4Char g) const;
00120
00121
00122
00123
00124
00125
00126
00127 virtual bool glyphBox(UT_UCS4Char g, UT_Rect & rec, GR_Graphics * pG) = 0;
00128 static bool s_doesGlyphExist(UT_UCS4Char g, void *instance)
00129 {
00130 UT_return_val_if_fail(instance, false);
00131 GR_Font * pThis = static_cast<GR_Font*>(instance);
00132 return pThis->doesGlyphExist(g);
00133 }
00134
00135 GrFontType getType()const {return m_eType;}
00136
00137 protected:
00138
00139 GR_Font();
00140
00141 GR_CharWidths * _getCharWidths() const {return m_pCharWidths;}
00146 mutable UT_String m_hashKey;
00147
00148 GrFontType m_eType;
00149
00150 private:
00151
00152 static UT_uint32 s_iAllocCount;
00153 UT_uint32 m_iAllocNo;
00154 mutable GR_CharWidths* m_pCharWidths;
00155 };
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 enum GR_GraphicsId
00181 {
00182
00183
00184 GRID_DEFAULT = 0x0,
00185 GRID_DEFAULT_PRINT = 0x1,
00186
00187 GRID_LAST_DEFAULT = 0xff,
00188
00189
00190
00191 GRID_COCOA = 0x102,
00192 GRID_WIN32 = 0x104,
00193 GRID_UNIX = 0x105,
00194 GRID_UNIX_PS = 0x106,
00195 GRID_UNIX_NULL = 0x107,
00196
00197
00198
00199 GRID_LAST_BUILT_IN = 0x200,
00200
00201
00202
00203
00204 GRID_UNIX_PANGO = 0x201,
00205 GRID_WIN32_UNISCRIBE = 0x202,
00206 GRID_UNIX_PANGO_PRINT = 0x203,
00207 GRID_UNIX_PANGO_PIXMAP = 0x204,
00208
00209
00210 GRID_LAST_EXTENSION = 0x0000ffff,
00211
00212
00213
00214 GRID_UNKNOWN = 0xffffffff
00215 };
00216
00217
00218 enum GR_Capability
00219 {
00220 GRCAP_UNKNOWN = 0,
00221 GRCAP_SCREEN_ONLY = 1,
00222 GRCAP_PRINTER_ONLY = 2,
00223 GRCAP_SCREEN_AND_PRINTER = 3
00224 };
00225
00269 class ABI_EXPORT GR_AllocInfo
00270 {
00271 public:
00272 virtual ~GR_AllocInfo() {}
00273
00274 virtual GR_GraphicsId getType() const {UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return GRID_UNKNOWN;}
00275 virtual bool isPrinterGraphics()const {UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return false;}
00276 };
00277
00278 typedef GR_Graphics * (*GR_Allocator)(GR_AllocInfo&);
00279 typedef const char * (*GR_Descriptor)(void);
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289 class ABI_EXPORT GR_GraphicsFactory
00290 {
00291
00292 public:
00293 GR_GraphicsFactory(){};
00294 virtual ~GR_GraphicsFactory(){};
00295
00296 UT_uint32 getClassCount() const {return m_vClassIds.getItemCount();}
00297
00298 bool registerClass(GR_Allocator, GR_Descriptor, UT_uint32 iClassId);
00299 UT_uint32 registerPluginClass(GR_Allocator, GR_Descriptor);
00300
00301 void registerAsDefault(UT_uint32 iClassId, bool bScreen)
00302 {
00303 if(bScreen)
00304 m_iDefaultScreen = iClassId;
00305 else
00306 m_iDefaultPrinter = iClassId;
00307 }
00308
00309 UT_uint32 getDefaultClass(bool bScreen) const {if(bScreen) return m_iDefaultScreen; else return m_iDefaultPrinter;}
00310 bool unregisterClass(UT_uint32 iClassId);
00311 bool isRegistered(UT_uint32 iClassId) const;
00312
00313 GR_Graphics * newGraphics(UT_uint32 iClassId, GR_AllocInfo ¶m) const;
00314 const char * getClassDescription(UT_uint32 iClassId) const;
00315
00316
00317 private:
00318 UT_GenericVector<GR_Allocator> m_vAllocators;
00319 UT_GenericVector<GR_Descriptor> m_vDescriptors;
00320 UT_NumberVector m_vClassIds;
00321
00322 UT_uint32 m_iDefaultScreen;
00323 UT_uint32 m_iDefaultPrinter;
00324 };
00325
00326
00327 enum GRShapingResult
00328 {
00329 GRSR_BufferClean = 0x00,
00330 GRSR_None = 0x01,
00331 GRSR_ContextSensitive = 0x02,
00332 GRSR_Ligatures = 0x04,
00333 GRSR_ContextSensitiveAndLigatures = 0x06,
00334 GRSR_Unknown = 0xef,
00335 GRSR_Error = 0xff
00336 };
00337
00338
00339
00340
00341
00342
00343
00344 #define GR_OC_LEFT_FLUSHED 0x40000000 // flip bit 31
00345 #define GR_OC_MAX_WIDTH 0x3fffffff
00346
00347 class ABI_EXPORT GR_Graphics
00348 {
00349 friend class GR_Painter;
00350 friend class GR_Caret;
00351
00352 public:
00353 virtual ~GR_Graphics();
00354
00355
00356
00357
00358 static UT_uint32 s_getClassId() {UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return GRID_UNKNOWN;}
00359 virtual UT_uint32 getClassId() {return s_getClassId();}
00360
00361 virtual GR_Capability getCapability() {UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return GRCAP_UNKNOWN;}
00362 #if 0
00363
00364
00365 static const char * graphicsDescriptor(void){UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return "???";}
00366 static GR_Graphics * graphicsAllocator(GR_AllocInfo&){UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return NULL;}
00367 #endif
00368
00369 UT_sint32 tdu(UT_sint32 layoutUnits) const;
00370 UT_sint32 tlu(UT_sint32 deviceUnits) const;
00371 double tduD(double layoutUnits) const;
00372 double tluD(double deviceUnits) const;
00377 UT_sint32 ftlu(UT_sint32 fontUnits) const;
00378 double ftluD(double fontUnits) const;
00379
00380 virtual void setFont(const GR_Font* pFont) = 0;
00381 virtual void clearFont(void) = 0;
00382 virtual UT_uint32 getFontAscent() = 0;
00383 virtual UT_uint32 getFontDescent() = 0;
00384 virtual UT_uint32 getFontHeight() = 0;
00385 void invalidateCache(void);
00386 virtual bool canQuickPrint(void) { return false;}
00387 virtual UT_uint32 measureString(const UT_UCSChar*s,
00388 int iOffset,
00389 int num,
00390 UT_GrowBufElement* pWidths, UT_uint32 *height = 0);
00391
00392 virtual UT_sint32 measureUnRemappedChar(const UT_UCSChar c, UT_uint32 * height = 0) = 0;
00393 virtual void getCoverage(UT_NumberVector& coverage) = 0;
00394
00395
00396 virtual UT_uint32 getFontAscent(const GR_Font *) = 0;
00397 virtual UT_uint32 getFontDescent(const GR_Font *) = 0;
00398 virtual UT_uint32 getFontHeight(const GR_Font *) = 0;
00399 virtual double getResolutionRatio(void)
00400 {return 1.0;}
00401
00402 void getMaxCharacterDimension (const UT_UCSChar*s, UT_uint32 Length, UT_uint32 &width, UT_uint32 &height);
00403
00404 virtual void setColor(const UT_RGBColor& clr) = 0;
00405 virtual void getColor(UT_RGBColor& clr) = 0;
00406 virtual GR_Font* getGUIFont() = 0;
00407
00408 GR_Font* findFont(const char* pszFontFamily,
00409 const char* pszFontStyle,
00410 const char* pszFontVariant,
00411 const char* pszFontWeight,
00412 const char* pszFontStretch,
00413 const char* pszFontSize,
00414 const char* pszLang);
00415
00416
00417
00418
00419
00420 #ifdef XAP_HAVE_GR_findNearestFont
00421 static const char* findNearestFont(const char* pszFontFamily,
00422 const char* pszFontStyle,
00423 const char* pszFontVariant,
00424 const char* pszFontWeight,
00425 const char* pszFontStretch,
00426 const char* pszFontSize,
00427 const char* pszLang);
00428 #else
00429 static const char* findNearestFont(const char* pszFontFamily,
00430 const char* ,
00431 const char* ,
00432 const char* ,
00433 const char* ,
00434 const char* ,
00435 const char* )
00436 {return pszFontFamily;}
00437 #endif
00438
00439 const char * invertDimension(UT_Dimension, double) const;
00440
00441 bool scaleDimensions(const char * szLeftIn,
00442 const char * szWidthIn,
00443 UT_uint32 iWidthAvail,
00444 UT_sint32 * piLeft,
00445 UT_uint32 * piWidth) const;
00446
00447 virtual GR_Image* createNewImage(const char* pszName,
00448 const UT_ByteBuf* pBB,
00449 UT_sint32 iWidth,
00450 UT_sint32 iHeight,
00451 GR_Image::GRType iType = GR_Image::GRT_Raster);
00452
00453 virtual void setLineWidth(UT_sint32) = 0;
00454
00455 virtual void setClipRect(const UT_Rect* pRect) = 0;
00456 const UT_Rect * getClipRect(void) const { return m_pRect;}
00457 virtual void scroll(UT_sint32, UT_sint32) = 0;
00458 virtual void scroll(UT_sint32 x_dest,
00459 UT_sint32 y_dest,
00460 UT_sint32 x_src,
00461 UT_sint32 y_src,
00462 UT_sint32 width,
00463 UT_sint32 height) = 0;
00464
00465 typedef enum { DGP_SCREEN, DGP_PAPER, DGP_OPAQUEOVERLAY } Properties;
00466
00467 typedef enum
00468 {
00469 JOIN_MITER,
00470 JOIN_ROUND,
00471 JOIN_BEVEL
00472 } JoinStyle ;
00473
00474 typedef enum
00475 {
00476 CAP_BUTT,
00477 CAP_ROUND,
00478 CAP_PROJECTING
00479 } CapStyle ;
00480
00481 typedef enum
00482 {
00483 LINE_SOLID,
00484 LINE_ON_OFF_DASH,
00485 LINE_DOUBLE_DASH,
00486 LINE_DOTTED
00487 } LineStyle ;
00488
00489 virtual void setLineProperties ( double inWidthPixels,
00490 JoinStyle inJoinStyle = JOIN_MITER,
00491 CapStyle inCapStyle = CAP_BUTT,
00492 LineStyle inLineStyle = LINE_SOLID ) ;
00493
00494 virtual bool queryProperties(GR_Graphics::Properties gp) const = 0;
00495
00496
00497 virtual bool startPrint(void) = 0;
00498
00499 virtual bool startPage(const char * szPageLabel,
00500 UT_uint32 pageNumber,
00501 bool bPortrait,
00502 UT_uint32 iWidth,
00503 UT_uint32 iHeight) = 0;
00504
00505 virtual bool endPrint(void) = 0;
00506
00507 virtual void flush(void);
00508
00509
00510
00511 typedef enum { GR_COLORSPACE_COLOR,
00512 GR_COLORSPACE_GRAYSCALE,
00513 GR_COLORSPACE_BW
00514 } ColorSpace;
00515
00516 virtual void setColorSpace(GR_Graphics::ColorSpace c) = 0;
00517 virtual GR_Graphics::ColorSpace getColorSpace(void) const = 0;
00518
00519
00520
00521 typedef enum { GR_CURSOR_INVALID=0,
00522 GR_CURSOR_DEFAULT,
00523 GR_CURSOR_IBEAM,
00524 GR_CURSOR_RIGHTARROW,
00525 GR_CURSOR_IMAGE,
00526 GR_CURSOR_IMAGESIZE_NW,
00527 GR_CURSOR_IMAGESIZE_N,
00528 GR_CURSOR_IMAGESIZE_NE,
00529 GR_CURSOR_IMAGESIZE_E,
00530 GR_CURSOR_IMAGESIZE_SE,
00531 GR_CURSOR_IMAGESIZE_S,
00532 GR_CURSOR_IMAGESIZE_SW,
00533 GR_CURSOR_IMAGESIZE_W,
00534 GR_CURSOR_LEFTRIGHT,
00535 GR_CURSOR_UPDOWN,
00536 GR_CURSOR_EXCHANGE,
00537 GR_CURSOR_GRAB,
00538 GR_CURSOR_LINK,
00539 GR_CURSOR_WAIT,
00540 GR_CURSOR_LEFTARROW,
00541 GR_CURSOR_VLINE_DRAG,
00542 GR_CURSOR_HLINE_DRAG,
00543 GR_CURSOR_CROSSHAIR,
00544 GR_CURSOR_DOWNARROW,
00545 GR_CURSOR_DRAGTEXT,
00546 GR_CURSOR_COPYTEXT
00547 } Cursor;
00548
00549 virtual void setCursor(GR_Graphics::Cursor c) = 0;
00550 virtual GR_Graphics::Cursor getCursor(void) const = 0;
00551
00552 virtual void setZoomPercentage(UT_uint32 iZoom);
00553 inline UT_uint32 getZoomPercentage(void) const {return m_iZoomPercentage; }
00554 static UT_uint32 getResolution(void) { return UT_LAYOUT_RESOLUTION; }
00555 inline void setPortrait (bool b) {m_bIsPortrait = b;}
00556 inline bool isPortrait (void) const {return m_bIsPortrait;}
00557
00558 typedef enum { CLR3D_Foreground=0,
00559 CLR3D_Background=1,
00560 CLR3D_BevelUp=2,
00561 CLR3D_BevelDown=3,
00562 CLR3D_Highlight=4
00563 } GR_Color3D;
00564 #define COUNT_3D_COLORS 5
00565
00566 virtual void setColor3D(GR_Color3D c) = 0;
00567 virtual bool getColor3D(GR_Color3D , UT_RGBColor & )
00568 { return false; }
00569
00570
00571
00572
00573
00574 bool isSpawnedRedraw(void) const;
00575 void setSpawnedRedraw(bool exposeState);
00576
00577 void setPendingRect(UT_sint32 x,
00578 UT_sint32 y,
00579 UT_sint32 width,
00580 UT_sint32 height);
00581
00582 void unionPendingRect( UT_Rect * pRect);
00583 void setRecentRect( UT_Rect * pRect);
00584 const UT_Rect * getPendingRect(void) const;
00585 bool isExposePending(void) const;
00586 void setExposePending(bool bExposePending);
00587 bool isExposedAreaAccessed(void) const;
00588 void setExposedAreaAccessed(bool bAccessedState);
00589 void setDontRedraw( bool bDontRedraw);
00590 bool isDontRedraw(void);
00591 void doRepaint(UT_Rect * rClip);
00592 void setDoMerge( bool bMergeState);
00593 bool doMerge(void) const;
00594
00595 const GR_Transform & getTransform() const {return m_Transform;}
00596
00597
00598 bool setTransform(const GR_Transform & tr)
00599 {
00600 bool ret = _setTransform(tr);
00601 if(!ret)
00602 return false;
00603 m_Transform = tr;
00604 return true;
00605 }
00606
00607 void createCaret()
00608 {
00609 UT_ASSERT_HARMLESS(!m_pCaret);
00610 m_pCaret = new GR_Caret(this);
00611 }
00612
00613 GR_Caret * getCaret() { return m_pCaret; }
00614 GR_Caret * createCaret(UT_sint32 iID);
00615 GR_Caret * getCaret(UT_sint32 iID);
00616 GR_Caret * getNthCaret(UT_sint32 i);
00617
00618 virtual void saveRectangle(UT_Rect & r, UT_uint32 iIndx) = 0;
00619 virtual void restoreRectangle(UT_uint32 iIndx) = 0;
00620 virtual UT_uint32 getDeviceResolution(void) const = 0;
00621
00622
00623
00624
00625
00626 UT_sint32 getPrevYOffset(void) const { return m_iPrevYOffset;}
00627 UT_sint32 getPrevXOffset(void) const { return m_iPrevXOffset;}
00628 void setPrevYOffset(UT_sint32 y) { m_iPrevYOffset = y;}
00629 void setPrevXOffset(UT_sint32 x) { m_iPrevXOffset = x;}
00630
00631 UT_sint32 _tduX(UT_sint32 layoutUnits) const;
00632
00633
00635
00636
00637
00638 virtual bool itemize(UT_TextIterator & text, GR_Itemization & I) VIRTUAL_SFX;
00639
00640
00641
00642 virtual bool shape(GR_ShapingInfo & si, GR_RenderInfo *& ri) VIRTUAL_SFX;
00643
00644
00645
00646
00647 virtual void prepareToRenderChars(GR_RenderInfo & ri) VIRTUAL_SFX;
00648 virtual void renderChars(GR_RenderInfo & ri) VIRTUAL_SFX;
00649
00650 virtual void appendRenderedCharsToBuff(GR_RenderInfo & ri, UT_GrowBuf & buf) const VIRTUAL_SFX;
00651 virtual void measureRenderedCharWidths(GR_RenderInfo & ri) VIRTUAL_SFX;
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666 virtual bool canBreak(GR_RenderInfo & ri, UT_sint32 &iNext, bool bAfter) VIRTUAL_SFX;
00667
00668
00669
00670 virtual bool needsSpecialCaretPositioning(GR_RenderInfo & ) VIRTUAL_SFX {return false;}
00671
00672
00673
00674
00675
00676
00677
00678 virtual UT_uint32 adjustCaretPosition(GR_RenderInfo & ri, bool bForward) VIRTUAL_SFX;
00679
00680
00681
00682
00683
00684
00685
00686
00687 virtual void adjustDeletePosition(GR_RenderInfo & ri) VIRTUAL_SFX;
00688
00689
00690
00691
00692
00693 virtual bool nativeBreakInfoForRightEdge() VIRTUAL_SFX {return true;}
00694
00695 virtual UT_sint32 resetJustification(GR_RenderInfo & ri, bool bPermanent) VIRTUAL_SFX;
00696 virtual UT_sint32 countJustificationPoints(const GR_RenderInfo & ri) const VIRTUAL_SFX;
00697 virtual void justify(GR_RenderInfo & ri) VIRTUAL_SFX;
00698
00699 virtual UT_uint32 XYToPosition(const GR_RenderInfo & ri, UT_sint32 x, UT_sint32 y) const VIRTUAL_SFX;
00700 virtual void positionToXY(const GR_RenderInfo & ri,
00701 UT_sint32& x, UT_sint32& y,
00702 UT_sint32& x2, UT_sint32& y2,
00703 UT_sint32& height, bool& bDirection) const VIRTUAL_SFX;
00704
00705 virtual UT_sint32 getTextWidth(GR_RenderInfo & ri) VIRTUAL_SFX;
00706
00707
00708
00709
00710
00711 virtual const UT_VersionInfo & getVersion() const {UT_ASSERT_HARMLESS( UT_NOT_IMPLEMENTED ); return s_Version;}
00712 UT_uint32 getPaintCount(void) const
00713 { return m_paintCount;}
00714
00715 static GR_Graphics* newNullGraphics();
00716
00717 protected:
00718
00719 GR_Graphics();
00720
00721
00722 virtual void _beginPaint () {}
00723 virtual void _endPaint () {}
00724
00725 UT_sint32 _tduY(UT_sint32 layoutUnits) const;
00726 UT_sint32 _tduR(UT_sint32 layoutUnits) const;
00727
00728 void _destroyFonts ();
00729
00730 virtual GR_Font* _findFont(const char* pszFontFamily,
00731 const char* pszFontStyle,
00732 const char* pszFontVariant,
00733 const char* pszFontWeight,
00734 const char* pszFontStretch,
00735 const char* pszFontSize,
00736 const char* pszLang) = 0;
00737
00738
00739 virtual void drawLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2) = 0;
00740 #if XAP_DONTUSE_XOR
00741 #else
00742 virtual void xorLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2) = 0;
00743 #endif
00744 virtual void invertRect(const UT_Rect* pRect) = 0;
00745 #if XAP_DONTUSE_XOR
00746 #else
00747 void xorRect(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
00748 void xorRect(const UT_Rect& r);
00749 #endif
00750
00751 virtual void fillRect(GR_Image *pImg, const UT_Rect &src, const UT_Rect & dest);
00752 virtual void fillRect(const UT_RGBColor& c, const UT_Rect &r);
00753 virtual void fillRect(const UT_RGBColor& c, UT_sint32 x, UT_sint32 y,
00754 UT_sint32 w, UT_sint32 h) = 0;
00755
00756 virtual void clearArea(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h) = 0;
00757 virtual void drawImage(GR_Image* pImg, UT_sint32 xDest, UT_sint32 yDest);
00758 virtual void fillRect(GR_Color3D c, UT_Rect &r) = 0;
00759 virtual void fillRect(GR_Color3D c,
00760 UT_sint32 x, UT_sint32 y,
00761 UT_sint32 w, UT_sint32 h) = 0;
00762 virtual void polygon(UT_RGBColor& c, UT_Point *pts, UT_uint32 nPoints);
00763 virtual void polyLine(UT_Point * pts, UT_uint32 nPoints) = 0;
00764 virtual void drawGlyph(UT_uint32 glyph_idx, UT_sint32 xoff, UT_sint32 yoff) = 0;
00765 virtual void drawChars(const UT_UCSChar* pChars,
00766 int iCharOffset,
00767 int iLength,
00768 UT_sint32 xoff,
00769 UT_sint32 yoff,
00770 int* pCharWidths = NULL) = 0;
00771
00772 virtual void drawCharsRelativeToBaseline(const UT_UCSChar* pChars,
00773 int iCharOffset,
00774 int iLength,
00775 UT_sint32 xoff,
00776 UT_sint32 yoff,
00777 int* pCharWidths = NULL);
00778
00779 virtual GR_Image * genImageFromRectangle(const UT_Rect & r) = 0;
00780
00781 private:
00782 virtual bool _setTransform(const GR_Transform & )
00783 {
00784 UT_ASSERT_HARMLESS( UT_NOT_IMPLEMENTED );
00785 return false;
00786 }
00787
00788
00789 void beginPaint ();
00790 void endPaint ();
00791
00792 public:
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803 UT_uint32 m_iRasterPosition;
00804
00805 protected:
00806 UT_uint32 m_iZoomPercentage;
00807 UT_uint32 m_iFontAllocNo;
00808
00809 static XAP_PrefsScheme *m_pPrefsScheme;
00810 static UT_uint32 m_uTick;
00811
00812 const UT_Rect * m_pRect;
00813
00814 bool m_bHave3DColors;
00815
00816 private:
00817 GR_Caret * m_pCaret;
00818 bool _PtInPolygon(UT_Point * pts,UT_uint32 nPoints,UT_sint32 x,UT_sint32 y);
00819 bool m_bIsPortrait;
00820 bool m_bSpawnedRedraw;
00821 UT_Rect m_PendingExposeArea;
00822 UT_Rect m_RecentExposeArea;
00823 bool m_bExposePending;
00824 bool m_bIsExposedAreaAccessed;
00825 bool m_bDontRedraw;
00826 bool m_bDoMerge;
00827
00828
00829
00830
00831 UT_sint32 m_iPrevYOffset;
00832 UT_sint32 m_iPrevXOffset;
00833 GR_Transform m_Transform;
00834
00835 UT_GenericStringMap<GR_Font*> m_hashFontCache;
00836
00837 UT_uint32 m_paintCount;
00838
00839 static UT_VersionInfo s_Version;
00840 static UT_uint32 s_iInstanceCount;
00841 static UT_UCS4Char s_cDefaultGlyph;
00842 UT_GenericVector<GR_Caret *> m_vecCarets;
00843 };
00844
00845 #endif