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_CAIRO_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 GRID_COCOA_PANGO = 0x205,
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 AllCarets
00348 {
00349 friend class GR_Graphics;
00350 public:
00351 AllCarets(GR_Graphics * pG,
00352 GR_Caret ** pCaret,
00353 UT_GenericVector<GR_Caret *>* vecCarets );
00354 virtual ~AllCarets(){}
00355 GR_Caret * getBaseCaret(void);
00356 void enable(void);
00357 void disable(bool bNoMulti = false);
00358 void setBlink(bool bBlink);
00359 void JustErase(UT_sint32 xPoint,UT_sint32 yPoint);
00360 void setWindowSize(UT_uint32 width, UT_uint32 height);
00361 void setCoords(UT_sint32 x, UT_sint32 y, UT_uint32 h,
00362 UT_sint32 x2 = 0, UT_sint32 y2 = 0, UT_uint32 h2 = 0,
00363 bool bPointDirection = false,
00364 const UT_RGBColor * pClr = NULL);
00365 void setInsertMode (bool mode);
00366 void forceDraw(void);
00367
00368 private:
00369 GR_Graphics * m_pG;
00370 GR_Caret ** m_pLocalCaret;
00371 UT_GenericVector<GR_Caret *>* m_vecCarets;
00372 };
00373
00374
00375 class ABI_EXPORT GR_Graphics
00376 {
00377 friend class GR_Painter;
00378 friend class GR_Caret;
00379 friend class AllCarets;
00380 public:
00381 virtual ~GR_Graphics();
00382
00383
00384
00385
00386
00387 virtual UT_uint32 getClassId() = 0;
00388
00389 virtual GR_Capability getCapability() {UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return GRCAP_UNKNOWN;}
00390 #if 0
00391
00392
00393 static const char * graphicsDescriptor(void){UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return "???";}
00394 static GR_Graphics * graphicsAllocator(GR_AllocInfo&){UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return NULL;}
00395 #endif
00396
00397 AllCarets * allCarets(void);
00398
00399 UT_sint32 tdu(UT_sint32 layoutUnits) const;
00400 UT_sint32 tlu(UT_sint32 deviceUnits) const;
00401 double tduD(double layoutUnits) const;
00402 double tluD(double deviceUnits) const;
00403 void antiAliasAlways(bool bAntiAlias)
00404 { m_bAntiAliasAlways = bAntiAlias;}
00405 bool getAntiAliasAlways(void)
00406 { return m_bAntiAliasAlways;}
00407
00412 UT_sint32 ftlu(UT_sint32 fontUnits) const;
00413 double ftluD(double fontUnits) const;
00414
00415 virtual void setFont(const GR_Font* pFont) = 0;
00416 virtual void clearFont(void) = 0;
00417 virtual UT_uint32 getFontAscent() = 0;
00418 virtual UT_uint32 getFontDescent() = 0;
00419 virtual UT_uint32 getFontHeight() = 0;
00420 void invalidateCache(void);
00421 virtual bool canQuickPrint(void) const { return false;}
00422 virtual UT_uint32 measureString(const UT_UCSChar*s,
00423 int iOffset,
00424 int num,
00425 UT_GrowBufElement* pWidths, UT_uint32 *height = 0);
00426
00427 virtual UT_sint32 measureUnRemappedChar(const UT_UCSChar c, UT_uint32 * height = 0) = 0;
00428 virtual void getCoverage(UT_NumberVector& coverage) = 0;
00429
00430
00431 virtual UT_uint32 getFontAscent(const GR_Font *) = 0;
00432 virtual UT_uint32 getFontDescent(const GR_Font *) = 0;
00433 virtual UT_uint32 getFontHeight(const GR_Font *) = 0;
00434 virtual double getResolutionRatio(void) const {return 1.0;}
00435
00436 void getMaxCharacterDimension (const UT_UCSChar*s, UT_uint32 Length, UT_uint32 &width, UT_uint32 &height);
00437
00438 virtual void setColor(const UT_RGBColor& clr) = 0;
00439 virtual void getColor(UT_RGBColor& clr) = 0;
00440 virtual GR_Font* getGUIFont() = 0;
00441
00442 GR_Font* findFont(const char* pszFontFamily,
00443 const char* pszFontStyle,
00444 const char* pszFontVariant,
00445 const char* pszFontWeight,
00446 const char* pszFontStretch,
00447 const char* pszFontSize,
00448 const char* pszLang);
00449
00450
00451
00452
00453
00454 #ifdef XAP_HAVE_GR_findNearestFont
00455 static const char* findNearestFont(const char* pszFontFamily,
00456 const char* pszFontStyle,
00457 const char* pszFontVariant,
00458 const char* pszFontWeight,
00459 const char* pszFontStretch,
00460 const char* pszFontSize,
00461 const char* pszLang);
00462 #else
00463 static const char* findNearestFont(const char* pszFontFamily,
00464 const char* ,
00465 const char* ,
00466 const char* ,
00467 const char* ,
00468 const char* ,
00469 const char* )
00470 {return pszFontFamily;}
00471 #endif
00472
00473 const char * invertDimension(UT_Dimension, double) const;
00474
00475 bool scaleDimensions(const char * szLeftIn,
00476 const char * szWidthIn,
00477 UT_uint32 iWidthAvail,
00478 UT_sint32 * piLeft,
00479 UT_uint32 * piWidth) const;
00480
00481 virtual GR_Image* createNewImage(const char* pszName,
00482 const UT_ByteBuf* pBB,
00483 const std::string& mimetype,
00484 UT_sint32 iWidth,
00485 UT_sint32 iHeight,
00486 GR_Image::GRType iType = GR_Image::GRT_Raster);
00487
00488 virtual void setLineWidth(UT_sint32) = 0;
00489
00490 virtual void setClipRect(const UT_Rect* pRect) = 0;
00491 const UT_Rect * getClipRect(void) const { return m_pRect;}
00492 virtual void scroll(UT_sint32, UT_sint32) = 0;
00493 virtual void scroll(UT_sint32 x_dest,
00494 UT_sint32 y_dest,
00495 UT_sint32 x_src,
00496 UT_sint32 y_src,
00497 UT_sint32 width,
00498 UT_sint32 height) = 0;
00499
00500 typedef enum { DGP_SCREEN, DGP_PAPER, DGP_OPAQUEOVERLAY } Properties;
00501
00502 typedef enum
00503 {
00504 JOIN_MITER,
00505 JOIN_ROUND,
00506 JOIN_BEVEL
00507 } JoinStyle ;
00508
00509 typedef enum
00510 {
00511 CAP_BUTT,
00512 CAP_ROUND,
00513 CAP_PROJECTING
00514 } CapStyle ;
00515
00516 typedef enum
00517 {
00518 LINE_SOLID,
00519 LINE_ON_OFF_DASH,
00520 LINE_DOUBLE_DASH,
00521 LINE_DOTTED
00522 } LineStyle ;
00523
00524 virtual void setLineProperties ( double inWidthPixels,
00525 JoinStyle inJoinStyle = JOIN_MITER,
00526 CapStyle inCapStyle = CAP_BUTT,
00527 LineStyle inLineStyle = LINE_SOLID ) ;
00528
00529 virtual bool queryProperties(GR_Graphics::Properties gp) const = 0;
00530
00531
00532 virtual bool startPrint(void) = 0;
00533
00534 virtual bool startPage(const char * szPageLabel,
00535 UT_uint32 pageNumber,
00536 bool bPortrait,
00537 UT_uint32 iWidth,
00538 UT_uint32 iHeight) = 0;
00539
00540 virtual bool endPrint(void) = 0;
00541
00542 virtual void flush(void);
00543
00544
00545
00546 typedef enum { GR_COLORSPACE_COLOR,
00547 GR_COLORSPACE_GRAYSCALE,
00548 GR_COLORSPACE_BW
00549 } ColorSpace;
00550
00551 virtual void setColorSpace(GR_Graphics::ColorSpace c) = 0;
00552 virtual GR_Graphics::ColorSpace getColorSpace(void) const = 0;
00553
00554
00555
00556 typedef enum { GR_CURSOR_INVALID=0,
00557 GR_CURSOR_DEFAULT,
00558 GR_CURSOR_IBEAM,
00559 GR_CURSOR_RIGHTARROW,
00560 GR_CURSOR_IMAGE,
00561 GR_CURSOR_IMAGESIZE_NW,
00562 GR_CURSOR_IMAGESIZE_N,
00563 GR_CURSOR_IMAGESIZE_NE,
00564 GR_CURSOR_IMAGESIZE_E,
00565 GR_CURSOR_IMAGESIZE_SE,
00566 GR_CURSOR_IMAGESIZE_S,
00567 GR_CURSOR_IMAGESIZE_SW,
00568 GR_CURSOR_IMAGESIZE_W,
00569 GR_CURSOR_LEFTRIGHT,
00570 GR_CURSOR_UPDOWN,
00571 GR_CURSOR_EXCHANGE,
00572 GR_CURSOR_GRAB,
00573 GR_CURSOR_LINK,
00574 GR_CURSOR_WAIT,
00575 GR_CURSOR_LEFTARROW,
00576 GR_CURSOR_VLINE_DRAG,
00577 GR_CURSOR_HLINE_DRAG,
00578 GR_CURSOR_CROSSHAIR,
00579 GR_CURSOR_DOWNARROW,
00580 GR_CURSOR_DRAGTEXT,
00581 GR_CURSOR_COPYTEXT
00582 } Cursor;
00583
00584 virtual void setCursor(GR_Graphics::Cursor c) = 0;
00585 virtual GR_Graphics::Cursor getCursor(void) const = 0;
00586
00587 virtual void setZoomPercentage(UT_uint32 iZoom);
00588 inline UT_uint32 getZoomPercentage(void) const {return m_iZoomPercentage; }
00589 static UT_uint32 getResolution(void) { return UT_LAYOUT_RESOLUTION; }
00590 inline void setPortrait (bool b) {m_bIsPortrait = b;}
00591 inline bool isPortrait (void) const {return m_bIsPortrait;}
00592
00593 typedef enum { CLR3D_Foreground=0,
00594 CLR3D_Background=1,
00595 CLR3D_BevelUp=2,
00596 CLR3D_BevelDown=3,
00597 CLR3D_Highlight=4
00598 } GR_Color3D;
00599 #define COUNT_3D_COLORS 5
00600
00601 virtual void setColor3D(GR_Color3D c) = 0;
00602 virtual bool getColor3D(GR_Color3D , UT_RGBColor & )
00603 { return false; }
00604
00605
00606
00607
00608
00609 bool isSpawnedRedraw(void) const;
00610 void setSpawnedRedraw(bool exposeState);
00611
00612 void setPendingRect(UT_sint32 x,
00613 UT_sint32 y,
00614 UT_sint32 width,
00615 UT_sint32 height);
00616
00617 void unionPendingRect( UT_Rect * pRect);
00618 void setRecentRect( UT_Rect * pRect);
00619 const UT_Rect * getPendingRect(void) const;
00620 bool isExposePending(void) const;
00621 void setExposePending(bool bExposePending);
00622 bool isExposedAreaAccessed(void) const;
00623 void setExposedAreaAccessed(bool bAccessedState);
00624 void setDontRedraw( bool bDontRedraw);
00625 bool isDontRedraw(void);
00626 void doRepaint(UT_Rect * rClip);
00627 void setDoMerge( bool bMergeState);
00628 bool doMerge(void) const;
00629
00630 const GR_Transform & getTransform() const {return m_Transform;}
00631
00632
00633 bool setTransform(const GR_Transform & tr)
00634 {
00635 bool ret = _setTransform(tr);
00636 if(!ret)
00637 return false;
00638 m_Transform = tr;
00639 return true;
00640 }
00641
00642 void createCaret()
00643 {
00644 UT_ASSERT_HARMLESS(!m_pCaret);
00645 m_pCaret = new GR_Caret(this);
00646 }
00647
00648 GR_Caret * createCaret(const std::string& sID);
00649 GR_Caret * getCaret(const std::string& sID) const;
00650 GR_Caret * getNthCaret(UT_sint32 i) const;
00651 void removeCaret(const std::string& sID);
00652
00653 virtual void saveRectangle(UT_Rect & r, UT_uint32 iIndx) = 0;
00654 virtual void restoreRectangle(UT_uint32 iIndx) = 0;
00655 virtual UT_uint32 getDeviceResolution(void) const = 0;
00656
00657
00658
00659
00660
00661 UT_sint32 getPrevYOffset(void) const { return m_iPrevYOffset;}
00662 UT_sint32 getPrevXOffset(void) const { return m_iPrevXOffset;}
00663 void setPrevYOffset(UT_sint32 y) { m_iPrevYOffset = y;}
00664 void setPrevXOffset(UT_sint32 x) { m_iPrevXOffset = x;}
00665
00666 UT_sint32 _tduX(UT_sint32 layoutUnits) const;
00667
00668
00670
00671
00672
00673 virtual bool itemize(UT_TextIterator & text, GR_Itemization & I) VIRTUAL_SFX;
00674
00675
00676
00677 virtual bool shape(GR_ShapingInfo & si, GR_RenderInfo *& ri) VIRTUAL_SFX;
00678
00679
00680
00681
00682 virtual void prepareToRenderChars(GR_RenderInfo & ri) VIRTUAL_SFX;
00683 virtual void renderChars(GR_RenderInfo & ri) VIRTUAL_SFX;
00684
00685 virtual void appendRenderedCharsToBuff(GR_RenderInfo & ri, UT_GrowBuf & buf) const VIRTUAL_SFX;
00686 virtual void measureRenderedCharWidths(GR_RenderInfo & ri) VIRTUAL_SFX;
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701 virtual bool canBreak(GR_RenderInfo & ri, UT_sint32 &iNext, bool bAfter) VIRTUAL_SFX;
00702
00703
00704
00705 virtual bool needsSpecialCaretPositioning(GR_RenderInfo & ) VIRTUAL_SFX {return false;}
00706
00707
00708
00709
00710
00711
00712
00713 virtual UT_uint32 adjustCaretPosition(GR_RenderInfo & ri, bool bForward) VIRTUAL_SFX;
00714
00715
00716
00717
00718
00719
00720
00721
00722 virtual void adjustDeletePosition(GR_RenderInfo & ri) VIRTUAL_SFX;
00723
00724
00725
00726
00727
00728 virtual bool nativeBreakInfoForRightEdge() VIRTUAL_SFX {return true;}
00729
00730 virtual UT_sint32 resetJustification(GR_RenderInfo & ri, bool bPermanent) VIRTUAL_SFX;
00731 virtual UT_sint32 countJustificationPoints(const GR_RenderInfo & ri) const VIRTUAL_SFX;
00732 virtual void justify(GR_RenderInfo & ri) VIRTUAL_SFX;
00733
00734 virtual UT_uint32 XYToPosition(const GR_RenderInfo & ri, UT_sint32 x, UT_sint32 y) const VIRTUAL_SFX;
00735 virtual void positionToXY(const GR_RenderInfo & ri,
00736 UT_sint32& x, UT_sint32& y,
00737 UT_sint32& x2, UT_sint32& y2,
00738 UT_sint32& height, bool& bDirection) const VIRTUAL_SFX;
00739
00740 virtual UT_sint32 getTextWidth(GR_RenderInfo & ri) VIRTUAL_SFX;
00741
00742
00743
00744
00745
00746 virtual const UT_VersionInfo & getVersion() const {UT_ASSERT_HARMLESS( UT_NOT_IMPLEMENTED ); return s_Version;}
00747 UT_uint32 getPaintCount(void) const
00748 { return m_paintCount;}
00749
00750 static GR_Graphics* newNullGraphics();
00751
00752 protected:
00753
00754 GR_Graphics();
00755 GR_Caret * getCaret() { return m_pCaret; }
00756
00757
00758 virtual void _beginPaint () {}
00759 virtual void _endPaint () {}
00760
00761 UT_sint32 _tduY(UT_sint32 layoutUnits) const;
00762 UT_sint32 _tduR(UT_sint32 layoutUnits) const;
00763
00764 void _destroyFonts ();
00765
00766 virtual GR_Font* _findFont(const char* pszFontFamily,
00767 const char* pszFontStyle,
00768 const char* pszFontVariant,
00769 const char* pszFontWeight,
00770 const char* pszFontStretch,
00771 const char* pszFontSize,
00772 const char* pszLang) = 0;
00773
00774
00775 virtual void drawLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2) = 0;
00776 #if XAP_DONTUSE_XOR
00777 #else
00778 virtual void xorLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2) = 0;
00779 #endif
00780 virtual void invertRect(const UT_Rect* pRect) = 0;
00781 #if XAP_DONTUSE_XOR
00782 #else
00783 void xorRect(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
00784 void xorRect(const UT_Rect& r);
00785 #endif
00786
00787 virtual void fillRect(GR_Image *pImg, const UT_Rect &src, const UT_Rect & dest);
00788 virtual void fillRect(const UT_RGBColor& c, const UT_Rect &r);
00789 virtual void fillRect(const UT_RGBColor& c, UT_sint32 x, UT_sint32 y,
00790 UT_sint32 w, UT_sint32 h) = 0;
00791
00792 virtual void clearArea(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h) = 0;
00793 virtual void drawImage(GR_Image* pImg, UT_sint32 xDest, UT_sint32 yDest);
00794 virtual void fillRect(GR_Color3D c, UT_Rect &r) = 0;
00795 virtual void fillRect(GR_Color3D c,
00796 UT_sint32 x, UT_sint32 y,
00797 UT_sint32 w, UT_sint32 h) = 0;
00798 virtual void polygon(UT_RGBColor& c, UT_Point *pts, UT_uint32 nPoints);
00799 virtual void polyLine(UT_Point * pts, UT_uint32 nPoints) = 0;
00800 virtual void drawGlyph(UT_uint32 glyph_idx, UT_sint32 xoff, UT_sint32 yoff) = 0;
00801 virtual void drawChars(const UT_UCSChar* pChars,
00802 int iCharOffset,
00803 int iLength,
00804 UT_sint32 xoff,
00805 UT_sint32 yoff,
00806 int* pCharWidths = NULL) = 0;
00807
00808 virtual void drawCharsRelativeToBaseline(const UT_UCSChar* pChars,
00809 int iCharOffset,
00810 int iLength,
00811 UT_sint32 xoff,
00812 UT_sint32 yoff,
00813 int* pCharWidths = NULL);
00814
00815 virtual GR_Image * genImageFromRectangle(const UT_Rect & r) = 0;
00816 private:
00817 virtual bool _setTransform(const GR_Transform & )
00818 {
00819 UT_ASSERT_HARMLESS( UT_NOT_IMPLEMENTED );
00820 return false;
00821 }
00822
00823
00824 void beginPaint ();
00825 void endPaint ();
00826
00827 public:
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838 UT_uint32 m_iRasterPosition;
00839
00840 protected:
00841 UT_uint32 m_iZoomPercentage;
00842 UT_uint32 m_iFontAllocNo;
00843
00844 static XAP_PrefsScheme *m_pPrefsScheme;
00845 static UT_uint32 m_uTick;
00846
00847 const UT_Rect * m_pRect;
00848
00849 bool m_bHave3DColors;
00850
00851 private:
00852 GR_Caret * m_pCaret;
00853 bool _PtInPolygon(UT_Point * pts,UT_uint32 nPoints,UT_sint32 x,UT_sint32 y);
00854 bool m_bIsPortrait;
00855 bool m_bSpawnedRedraw;
00856 UT_Rect m_PendingExposeArea;
00857 UT_Rect m_RecentExposeArea;
00858 bool m_bExposePending;
00859 bool m_bIsExposedAreaAccessed;
00860 bool m_bDontRedraw;
00861 bool m_bDoMerge;
00862
00863
00864
00865
00866 UT_sint32 m_iPrevYOffset;
00867 UT_sint32 m_iPrevXOffset;
00868 GR_Transform m_Transform;
00869
00870 UT_GenericStringMap<GR_Font*> m_hashFontCache;
00871
00872 UT_uint32 m_paintCount;
00873
00874 static UT_VersionInfo s_Version;
00875 static UT_uint32 s_iInstanceCount;
00876 static UT_UCS4Char s_cDefaultGlyph;
00877 UT_GenericVector<GR_Caret *> m_vecCarets;
00878 AllCarets m_AllCarets;
00879 bool m_bAntiAliasAlways;
00880 };
00881
00882 #endif