xref: /aoo41x/main/vcl/inc/unx/salgdi.h (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SV_SALGDI_H
29*cdf0e10cSrcweir #define _SV_SALGDI_H
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
32*cdf0e10cSrcweir #include "tools/fract.hxx"
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include "vcl/salgtype.hxx"
35*cdf0e10cSrcweir #include "vcl/vclenum.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include "salstd.hxx"
38*cdf0e10cSrcweir #include "salgdi.hxx"
39*cdf0e10cSrcweir #include "sallayout.hxx"
40*cdf0e10cSrcweir #include "vclpluginapi.h"
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir #include <deque>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
45*cdf0e10cSrcweir struct  ImplFontMetricData;
46*cdf0e10cSrcweir struct  ImplFontSelectData;
47*cdf0e10cSrcweir class   SalBitmap;
48*cdf0e10cSrcweir class   SalColormap;
49*cdf0e10cSrcweir class   SalDisplay;
50*cdf0e10cSrcweir class   SalFrame;
51*cdf0e10cSrcweir class   X11SalVirtualDevice;
52*cdf0e10cSrcweir class   SalPolyLine;
53*cdf0e10cSrcweir class   PspSalPrinter;
54*cdf0e10cSrcweir class   PspSalInfoPrinter;
55*cdf0e10cSrcweir class   ServerFont;
56*cdf0e10cSrcweir class   ImplLayoutArgs;
57*cdf0e10cSrcweir class   X11FontLayout;
58*cdf0e10cSrcweir class   ServerFontLayout;
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir namespace basegfx {
61*cdf0e10cSrcweir     class B2DTrapezoid;
62*cdf0e10cSrcweir }
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir // -=-= SalGraphicsData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir class CairoFontsCache
67*cdf0e10cSrcweir {
68*cdf0e10cSrcweir private:
69*cdf0e10cSrcweir     static int mnRefCount;
70*cdf0e10cSrcweir     typedef std::deque< std::pair<void *, void*> > LRUFonts;
71*cdf0e10cSrcweir     static LRUFonts maLRUFonts;
72*cdf0e10cSrcweir public:
73*cdf0e10cSrcweir     CairoFontsCache();
74*cdf0e10cSrcweir     static void  CacheFont(void *pFont, void *pId);
75*cdf0e10cSrcweir     static void* FindCachedFont(void *pId);
76*cdf0e10cSrcweir     ~CairoFontsCache();
77*cdf0e10cSrcweir };
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir class VCLPLUG_GEN_PUBLIC X11SalGraphics : public SalGraphics
80*cdf0e10cSrcweir {
81*cdf0e10cSrcweir     friend class            X11FontLayout;
82*cdf0e10cSrcweir     friend class            ServerFontLayout;
83*cdf0e10cSrcweir protected:
84*cdf0e10cSrcweir     SalFrame*				m_pFrame; // the SalFrame which created this Graphics or NULL
85*cdf0e10cSrcweir     X11SalVirtualDevice*	m_pVDev;  // the SalVirtualDevice which created this Graphics or NULL
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     const SalColormap*      m_pColormap;
88*cdf0e10cSrcweir     SalColormap    *m_pDeleteColormap;
89*cdf0e10cSrcweir     Drawable        hDrawable_;     // use
90*cdf0e10cSrcweir     int             m_nScreen;
91*cdf0e10cSrcweir     void*           m_pRenderFormat;
92*cdf0e10cSrcweir     XID             m_aRenderPicture;
93*cdf0e10cSrcweir     CairoFontsCache m_aCairoFontsCache;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir     XLIB_Region     pPaintRegion_;
96*cdf0e10cSrcweir     XLIB_Region     mpClipRegion;
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir     GC              pPenGC_;        // Pen attributes
99*cdf0e10cSrcweir     SalColor        nPenColor_;
100*cdf0e10cSrcweir     Pixel           nPenPixel_;
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir     GC              pFontGC_;       // Font attributes
103*cdf0e10cSrcweir     ServerFont*             mpServerFont[ MAX_FALLBACK ];
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir     SalColor        nTextColor_;
106*cdf0e10cSrcweir     Pixel           nTextPixel_;
107*cdf0e10cSrcweir     sal_Bool            bFontVertical_;
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir     sal_Bool            bDisableGraphite_;
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     GC              pBrushGC_;      // Brush attributes
112*cdf0e10cSrcweir     SalColor        nBrushColor_;
113*cdf0e10cSrcweir     Pixel           nBrushPixel_;
114*cdf0e10cSrcweir     Pixmap          hBrush_;        // Dither
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir     GC				pMonoGC_;
117*cdf0e10cSrcweir     GC				pCopyGC_;
118*cdf0e10cSrcweir     GC				pMaskGC_;
119*cdf0e10cSrcweir     GC				pInvertGC_;
120*cdf0e10cSrcweir     GC				pInvert50GC_;
121*cdf0e10cSrcweir     GC				pStippleGC_;
122*cdf0e10cSrcweir     GC				pTrackingGC_;
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir     sal_Bool			bWindow_ : 1;		// is Window
125*cdf0e10cSrcweir     sal_Bool			bPrinter_ : 1;		// is Printer
126*cdf0e10cSrcweir     sal_Bool			bVirDev_ : 1;		// is VirDev
127*cdf0e10cSrcweir     sal_Bool			bPenGC_ : 1;		// is Pen GC valid
128*cdf0e10cSrcweir     sal_Bool			bFontGC_ : 1;		// is Font GC valid
129*cdf0e10cSrcweir     sal_Bool			bBrushGC_ : 1;		// is Brush GC valid
130*cdf0e10cSrcweir     sal_Bool			bMonoGC_ : 1;		// is Mono GC valid
131*cdf0e10cSrcweir     sal_Bool			bCopyGC_ : 1;		// is Copy GC valid
132*cdf0e10cSrcweir     sal_Bool			bInvertGC_ : 1;		// is Invert GC valid
133*cdf0e10cSrcweir     sal_Bool			bInvert50GC_ : 1;	// is Invert50 GC valid
134*cdf0e10cSrcweir     sal_Bool			bStippleGC_ : 1;	// is Stipple GC valid
135*cdf0e10cSrcweir     sal_Bool            bTrackingGC_ : 1;   // is Tracking GC valid
136*cdf0e10cSrcweir     bool			bXORMode_ : 1;		// is ROP XOR Mode set
137*cdf0e10cSrcweir     sal_Bool			bDitherBrush_ : 1;	// is solid or tile
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     using SalGraphics::SetClipRegion;
140*cdf0e10cSrcweir     void			SetClipRegion( GC          pGC,
141*cdf0e10cSrcweir                                    XLIB_Region pXReg = NULL ) const;
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir     GC				GetTrackingGC();
144*cdf0e10cSrcweir     GC				GetInvertGC();
145*cdf0e10cSrcweir     GC				GetInvert50GC();
146*cdf0e10cSrcweir     GC				CreateGC( Drawable      hDrawable,
147*cdf0e10cSrcweir                               unsigned long nMask = GCGraphicsExposures );
148*cdf0e10cSrcweir     GC				SelectPen();
149*cdf0e10cSrcweir     GC				SelectBrush();
150*cdf0e10cSrcweir     void			DrawLines( sal_uIntPtr              nPoints,
151*cdf0e10cSrcweir                                const SalPolyLine &rPoints,
152*cdf0e10cSrcweir                                GC				  pGC,
153*cdf0e10cSrcweir                                bool bClose
154*cdf0e10cSrcweir                                );
155*cdf0e10cSrcweir     sal_Bool			GetDitherPixmap ( SalColor nSalColor );
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir     inline	GC				GetMonoGC( Pixmap hPixmap );
158*cdf0e10cSrcweir     inline	GC				GetCopyGC();
159*cdf0e10cSrcweir     inline	GC				GetStippleGC();
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir     int 			Clip      ( XLIB_Region   pRegion,
162*cdf0e10cSrcweir                                 int          &nX,
163*cdf0e10cSrcweir                                 int          &nY,
164*cdf0e10cSrcweir                                 unsigned int &nDX,
165*cdf0e10cSrcweir                                 unsigned int &nDY,
166*cdf0e10cSrcweir                                 int          &nSrcX,
167*cdf0e10cSrcweir                                 int          &nSrcY ) const;
168*cdf0e10cSrcweir     int				Clip      ( int          &nX,
169*cdf0e10cSrcweir                                 int          &nY,
170*cdf0e10cSrcweir                                 unsigned int &nDX,
171*cdf0e10cSrcweir                                 unsigned int &nDY,
172*cdf0e10cSrcweir                                 int          &nSrcX,
173*cdf0e10cSrcweir                                 int          &nSrcY ) const;
174*cdf0e10cSrcweir     GC				SetMask   ( int          &nX,
175*cdf0e10cSrcweir                                 int          &nY,
176*cdf0e10cSrcweir                                 unsigned int &nDX,
177*cdf0e10cSrcweir                                 unsigned int &nDY,
178*cdf0e10cSrcweir                                 int          &nSrcX,
179*cdf0e10cSrcweir                                 int          &nSrcY,
180*cdf0e10cSrcweir                                 Pixmap        hClipMask );
181*cdf0e10cSrcweir     using SalGraphics::DrawBitmap;
182*cdf0e10cSrcweir     void            DrawBitmap( const SalTwoRect *pPosAry,
183*cdf0e10cSrcweir                                 SalGraphics      *pThis,
184*cdf0e10cSrcweir                                 const SalBitmap  &rSalBitmap,
185*cdf0e10cSrcweir                                 const SalBitmap  &rTransparentBitmap,
186*cdf0e10cSrcweir                                 SalColor          nTransparentColor );
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir     GC                      GetFontGC();
189*cdf0e10cSrcweir     bool                    setFont( const ImplFontSelectData* pEntry, int nFallbackLevel );
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir     void                    drawMaskedBitmap( const SalTwoRect* pPosAry,
192*cdf0e10cSrcweir                                               const SalBitmap& rSalBitmap,
193*cdf0e10cSrcweir                                               const SalBitmap& rTransparentBitmap );
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir protected:
196*cdf0e10cSrcweir     void                    DrawPrinterString( const SalLayout& );
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir     void                    DrawServerFontString( const ServerFontLayout& );
199*cdf0e10cSrcweir     void                    DrawServerSimpleFontString( const ServerFontLayout& );
200*cdf0e10cSrcweir     void                    DrawServerAAFontString( const ServerFontLayout& );
201*cdf0e10cSrcweir     bool                    DrawServerAAForcedString( const ServerFontLayout& );
202*cdf0e10cSrcweir     void                    DrawCairoAAFontString( const ServerFontLayout& );
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir     void freeResources();
205*cdf0e10cSrcweir public:
206*cdf0e10cSrcweir                             X11SalGraphics();
207*cdf0e10cSrcweir     virtual				~X11SalGraphics();
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir             void            Init( SalFrame *pFrame, Drawable aDrawable, int nScreen );
210*cdf0e10cSrcweir             void            Init( X11SalVirtualDevice *pVirtualDevice, SalColormap* pColormap = NULL, bool bDeleteColormap = false );
211*cdf0e10cSrcweir             void            Init( class ImplSalPrinterData *pPrinter );
212*cdf0e10cSrcweir             void            DeInit();
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir     inline  const SalDisplay*   GetDisplay() const;
215*cdf0e10cSrcweir     inline  Display*            GetXDisplay() const;
216*cdf0e10cSrcweir     inline  const SalVisual&    GetVisual() const;
217*cdf0e10cSrcweir     inline  Drawable        GetDrawable() const { return hDrawable_; }
218*cdf0e10cSrcweir     void                    SetDrawable( Drawable d, int nScreen );
219*cdf0e10cSrcweir     XID                     GetXRenderPicture();
220*cdf0e10cSrcweir     void*                   GetXRenderFormat() const { return m_pRenderFormat; }
221*cdf0e10cSrcweir     inline  void            SetXRenderFormat( void* pRenderFormat ) { m_pRenderFormat = pRenderFormat; }
222*cdf0e10cSrcweir     inline  const SalColormap&    GetColormap() const { return *m_pColormap; }
223*cdf0e10cSrcweir     using SalGraphics::GetPixel;
224*cdf0e10cSrcweir     inline  Pixel           GetPixel( SalColor nSalColor ) const;
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir     int                     GetScreenNumber() const { return m_nScreen; }
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir     // overload all pure virtual methods
229*cdf0e10cSrcweir     virtual void			GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
230*cdf0e10cSrcweir     virtual sal_uInt16			GetBitCount();
231*cdf0e10cSrcweir     virtual long			GetGraphicsWidth() const;
232*cdf0e10cSrcweir     virtual long			GetGraphicsHeight() const;
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir     virtual void			ResetClipRegion();
235*cdf0e10cSrcweir     virtual bool            setClipRegion( const Region& );
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     virtual void			SetLineColor();
238*cdf0e10cSrcweir     virtual void			SetLineColor( SalColor nSalColor );
239*cdf0e10cSrcweir     virtual void			SetFillColor();
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir     virtual void          	SetFillColor( SalColor nSalColor );
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir     virtual void			SetXORMode( bool bSet, bool );
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir     virtual void			SetROPLineColor( SalROPColor nROPColor );
246*cdf0e10cSrcweir     virtual void			SetROPFillColor( SalROPColor nROPColor );
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir     virtual void			SetTextColor( SalColor nSalColor );
249*cdf0e10cSrcweir     virtual sal_uInt16			SetFont( ImplFontSelectData*, int nFallbackLevel );
250*cdf0e10cSrcweir     virtual void			GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
251*cdf0e10cSrcweir     virtual sal_uLong			GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* );
252*cdf0e10cSrcweir     virtual const ImplFontCharMap* GetImplFontCharMap() const;
253*cdf0e10cSrcweir     virtual void			GetDevFontList( ImplDevFontList* );
254*cdf0e10cSrcweir     virtual void			GetDevFontSubstList( OutputDevice* );
255*cdf0e10cSrcweir     virtual bool			AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
256*cdf0e10cSrcweir     virtual sal_Bool			CreateFontSubset( const rtl::OUString& rToFile,
257*cdf0e10cSrcweir                                               const ImplFontData*,
258*cdf0e10cSrcweir                                               sal_Int32* pGlyphIDs,
259*cdf0e10cSrcweir                                               sal_uInt8* pEncoding,
260*cdf0e10cSrcweir                                               sal_Int32* pWidths,
261*cdf0e10cSrcweir                                               int nGlyphs,
262*cdf0e10cSrcweir                                               FontSubsetInfo& rInfo
263*cdf0e10cSrcweir                                               );
264*cdf0e10cSrcweir     virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
265*cdf0e10cSrcweir     virtual const void*	GetEmbedFontData( const ImplFontData*,
266*cdf0e10cSrcweir                                           const sal_Ucs* pUnicodes,
267*cdf0e10cSrcweir                                           sal_Int32* pWidths,
268*cdf0e10cSrcweir                                           FontSubsetInfo& rInfo,
269*cdf0e10cSrcweir                                           long* pDataLen );
270*cdf0e10cSrcweir     virtual void			FreeEmbedFontData( const void* pData, long nDataLen );
271*cdf0e10cSrcweir     virtual void            GetGlyphWidths( const ImplFontData*,
272*cdf0e10cSrcweir                                             bool bVertical,
273*cdf0e10cSrcweir                                             Int32Vector& rWidths,
274*cdf0e10cSrcweir                                             Ucs2UIntMap& rUnicodeEnc );
275*cdf0e10cSrcweir     virtual sal_Bool			GetGlyphBoundRect( long nIndex, Rectangle& );
276*cdf0e10cSrcweir     virtual sal_Bool			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
277*cdf0e10cSrcweir     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
278*cdf0e10cSrcweir     virtual void			DrawServerFontLayout( const ServerFontLayout& );
279*cdf0e10cSrcweir     virtual bool            supportsOperation( OutDevSupportType ) const;
280*cdf0e10cSrcweir     virtual void			drawPixel( long nX, long nY );
281*cdf0e10cSrcweir     virtual void			drawPixel( long nX, long nY, SalColor nSalColor );
282*cdf0e10cSrcweir     virtual void			drawLine( long nX1, long nY1, long nX2, long nY2 );
283*cdf0e10cSrcweir     virtual void			drawRect( long nX, long nY, long nWidth, long nHeight );
284*cdf0e10cSrcweir     void                    drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry, bool bClose );
285*cdf0e10cSrcweir     virtual void			drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
286*cdf0e10cSrcweir     virtual void			drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
287*cdf0e10cSrcweir     virtual void			drawPolyPolygon( sal_uInt32 nPoly,
288*cdf0e10cSrcweir                                              const sal_uInt32* pPoints,
289*cdf0e10cSrcweir                                              PCONSTSALPOINT* pPtAry );
290*cdf0e10cSrcweir     virtual bool			drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
291*cdf0e10cSrcweir     virtual bool			drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin );
292*cdf0e10cSrcweir     virtual bool			drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir #if 1 // TODO: remove these obselete methods
295*cdf0e10cSrcweir     virtual sal_Bool		drawPolyLineBezier( sal_uIntPtr nPoints,
296*cdf0e10cSrcweir                                                 const SalPoint* pPtAry,
297*cdf0e10cSrcweir                                                 const sal_uInt8* pFlgAry );
298*cdf0e10cSrcweir     virtual sal_Bool		drawPolygonBezier( sal_uIntPtr nPoints,
299*cdf0e10cSrcweir                                                const SalPoint* pPtAry,
300*cdf0e10cSrcweir                                                const sal_uInt8* pFlgAry );
301*cdf0e10cSrcweir     virtual sal_Bool		drawPolyPolygonBezier( sal_uInt32 nPoly,
302*cdf0e10cSrcweir                                                    const sal_uInt32* pPoints,
303*cdf0e10cSrcweir                                                    const SalPoint* const* pPtAry,
304*cdf0e10cSrcweir                                                    const sal_uInt8* const* pFlgAry );
305*cdf0e10cSrcweir #endif
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir     virtual void			copyArea( long nDestX,
308*cdf0e10cSrcweir                                       long nDestY,
309*cdf0e10cSrcweir                                       long nSrcX,
310*cdf0e10cSrcweir                                       long nSrcY,
311*cdf0e10cSrcweir                                       long nSrcWidth,
312*cdf0e10cSrcweir                                       long nSrcHeight,
313*cdf0e10cSrcweir                                       sal_uInt16 nFlags );
314*cdf0e10cSrcweir     virtual void			copyBits( const SalTwoRect* pPosAry,
315*cdf0e10cSrcweir                                       SalGraphics* pSrcGraphics );
316*cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
317*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap );
318*cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
319*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
320*cdf0e10cSrcweir                                         SalColor nTransparentColor );
321*cdf0e10cSrcweir     virtual void			drawBitmap( const SalTwoRect* pPosAry,
322*cdf0e10cSrcweir                                         const SalBitmap& rSalBitmap,
323*cdf0e10cSrcweir                                         const SalBitmap& rMaskBitmap );
324*cdf0e10cSrcweir     virtual void			drawMask( const SalTwoRect* pPosAry,
325*cdf0e10cSrcweir                                       const SalBitmap& rSalBitmap,
326*cdf0e10cSrcweir                                       SalColor nMaskColor );
327*cdf0e10cSrcweir     virtual SalBitmap*		getBitmap( long nX, long nY, long nWidth, long nHeight );
328*cdf0e10cSrcweir     virtual SalColor		getPixel( long nX, long nY );
329*cdf0e10cSrcweir     virtual void			invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
330*cdf0e10cSrcweir     virtual void			invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir     virtual sal_Bool			drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir     virtual bool 			drawAlphaBitmap( const SalTwoRect&,
335*cdf0e10cSrcweir                                              const SalBitmap& rSourceBitmap,
336*cdf0e10cSrcweir                                              const SalBitmap& rAlphaBitmap );
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir     virtual bool		    drawAlphaRect( long nX, long nY, long nWidth,
339*cdf0e10cSrcweir                                            long nHeight, sal_uInt8 nTransparency );
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir     virtual SystemGraphicsData GetGraphicsData() const;
342*cdf0e10cSrcweir     virtual SystemFontData     GetSysFontData( int nFallbacklevel ) const;
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir     /*  use to handle GraphicsExpose/NoExpose after XCopyArea & friends
345*cdf0e10cSrcweir      *  if pFrame is not NULL, corresponding Paint events are generated
346*cdf0e10cSrcweir      *  and dispatched to pFrame
347*cdf0e10cSrcweir      *
348*cdf0e10cSrcweir      *  it is imperative to eat up graphics exposes even in case you don't need
349*cdf0e10cSrcweir      *  them because the next one using XCopyArea can depend on them
350*cdf0e10cSrcweir      */
351*cdf0e10cSrcweir     void YieldGraphicsExpose();
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir     // do XCopyArea or XGet/PutImage depending on screen numbers
354*cdf0e10cSrcweir     // signature is like XCopyArea with screen numbers added
355*cdf0e10cSrcweir     static void CopyScreenArea( Display* pDisplay,
356*cdf0e10cSrcweir                                 Drawable aSrc, int nScreenSrc, int nSrcDepth,
357*cdf0e10cSrcweir                                 Drawable aDest, int nScreenDest, int nDestDepth,
358*cdf0e10cSrcweir                                 GC aDestGC,
359*cdf0e10cSrcweir                                 int src_x, int src_y,
360*cdf0e10cSrcweir                                 unsigned int w, unsigned int h,
361*cdf0e10cSrcweir                                 int dest_x, int dest_y );
362*cdf0e10cSrcweir     static void releaseGlyphPeer();
363*cdf0e10cSrcweir };
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir inline const SalDisplay *X11SalGraphics::GetDisplay() const
367*cdf0e10cSrcweir { return GetColormap().GetDisplay(); }
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir inline const SalVisual& X11SalGraphics::GetVisual() const
370*cdf0e10cSrcweir { return GetColormap().GetVisual(); }
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir inline Display *X11SalGraphics::GetXDisplay() const
373*cdf0e10cSrcweir { return GetColormap().GetXDisplay(); }
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const
376*cdf0e10cSrcweir { return GetColormap().GetPixel( nSalColor ); }
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir // -=-= Shortcuts =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir #ifdef DBG_UTIL
382*cdf0e10cSrcweir #define stderr0( s )			fprintf( stderr, s )
383*cdf0e10cSrcweir #else
384*cdf0e10cSrcweir #define stderr0( s )			;
385*cdf0e10cSrcweir #endif
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir #endif // _SV_SALGDI_H
388*cdf0e10cSrcweir 
389