summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2003-11-18 13:48:47 +0000
committerKurt Zenker <kz@openoffice.org>2003-11-18 13:48:47 +0000
commit1ce2c9c062444cccfd801d8f868212615a9aa14f (patch)
treec85d2ba22108f587f9000e34122d31bcddb2a763 /vcl
parent4ae1e4a71b3968e89b32aa5ae598fb28878be13c (diff)
INTEGRATION: CWS vclplug (1.8.136); FILE MERGED
2003/10/24 13:35:04 pl 1.8.136.1: #21232# win port of virtualiing sal part
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/inc/salgdi.h162
1 files changed, 157 insertions, 5 deletions
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 26771fd1b683..95e1dde0d383 100644
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -2,9 +2,9 @@
*
* $RCSfile: salgdi.h,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: vg $ $Date: 2003-05-28 12:35:06 $
+ * last change: $Author: kz $ $Date: 2003-11-18 14:48:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,9 @@
#ifndef _SV_SALLAYOUT_HXX
#include <sallayout.hxx>
#endif
+#ifndef _SV_SALGDI_HXX
+#include <salgdi.hxx>
+#endif
#include "boost/scoped_ptr.hpp"
@@ -100,7 +103,7 @@ public:
// - SalGraphicsData -
// -------------------
-class SalGraphicsData
+class WinSalGraphics : public SalGraphics
{
public:
HDC mhDC; // HDC
@@ -141,11 +144,160 @@ public:
// SalGraphics::GetTextLayout, to cache data derived from mhDC's font;
// flushed whenever a new font is selected into mhDC:
boost::scoped_ptr< ImplTextLayoutCache > mxTextLayoutCache;
+public:
+ WinSalGraphics();
+ virtual ~WinSalGraphics();
+
+protected:
+ virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ // draw --> LineColor and FillColor and RasterOp and ClipRegion
+ virtual void drawPixel( long nX, long nY );
+ virtual void drawPixel( long nX, long nY, SalColor nSalColor );
+ virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
+ virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
+ virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry );
+ virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
+
+ // CopyArea --> No RasterOp, but ClipRegion
+ virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+ long nSrcHeight, USHORT nFlags );
+
+ // CopyBits and DrawBitmap --> RasterOp and ClipRegion
+ // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
+ virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
+ const SalBitmap& rSalBitmap,
+ SalColor nTransparentColor );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
+ const SalBitmap& rSalBitmap,
+ const SalBitmap& rTransparentBitmap );
+ virtual void drawMask( const SalTwoRect* pPosAry,
+ const SalBitmap& rSalBitmap,
+ SalColor nMaskColor );
+
+ virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
+ virtual SalColor getPixel( long nX, long nY );
+
+ // invert --> ClipRegion (only Windows or VirDevs)
+ virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
+ virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+
+public:
+ // public SalGraphics methods, the interface to teh independent vcl part
+
+ // get device resolution
+ virtual void GetResolution( long& rDPIX, long& rDPIY );
+ // get resolution for fonts (an implementations specific adjustment,
+ // ideally would be the same as the Resolution)
+ virtual void GetScreenFontResolution( long& rDPIX, long& rDPIY );
+ // get the depth of the device
+ virtual USHORT GetBitCount();
+ // get the width of the device
+ virtual long GetGraphicsWidth();
+
+ // set the clip region to empty
+ virtual void ResetClipRegion();
+ // begin setting the clip region, add rectangles to the
+ // region with the UnionClipRegion call
+ virtual void BeginSetClipRegion( ULONG nCount );
+ // all rectangles were added and the clip region should be set now
+ virtual void EndSetClipRegion();
+
+ // set the line color to transparent (= don't draw lines)
+ virtual void SetLineColor();
+ // set the line color to a specific color
+ virtual void SetLineColor( SalColor nSalColor );
+ // set the fill color to transparent (= don't fill)
+ virtual void SetFillColor();
+ // set the fill color to a specific color, shapes will be
+ // filled accordingly
+ virtual void SetFillColor( SalColor nSalColor );
+ // enable/disable XOR drawing
+ virtual void SetXORMode( BOOL bSet );
+ // set line color for raster operations
+ virtual void SetROPLineColor( SalROPColor nROPColor );
+ // set fill color for raster operations
+ virtual void SetROPFillColor( SalROPColor nROPColor );
+ // set the text color to a specific color
+ virtual void SetTextColor( SalColor nSalColor );
+ // set the font
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ // get the current font's etrics
+ virtual void GetFontMetric( ImplFontMetricData* );
+ // get kernign pairs of the current font
+ // return only PairCount if (pKernPairs == NULL)
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ // get the repertoire of the current font; the code pairs returned
+ // contain unicode ranges. if pCodePairs is NULL return only the
+ // number of pairs which would be filled
+ virtual ULONG GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
+ // graphics must fill supplied font list
+ virtual void GetDevFontList( ImplDevFontList* );
+ // graphics should call ImplAddDevFontSubstitute on supplied
+ // OutputDevice for all its device specific preferred font substitutions
+ virtual void GetDevFontSubstList( OutputDevice* );
+ virtual ImplFontData* AddTempDevFont( const String& rFileURL, const String& rFontName );
+ // CreateFontSubset: a method to get a subset of glyhps of a font
+ // inside a new valid font file
+ // returns TRUE if creation of subset was successfull
+ // parameters: rToFile: contains a osl file URL to write the subset to
+ // pFont: describes from which font to create a subset
+ // pGlyphIDs: the glyph ids to be extracted
+ // pEncoding: the character code corresponding to each glyph
+ // pWidths: the advance widths of the correspoding glyphs (in PS font units)
+ // nGlyphs: the number of glyphs
+ // rInfo: additional outgoing information
+ // implementation note: encoding 0 with glyph id 0 should be added implicitly
+ // as "undefined character"
+ virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ ImplFontData* pFont,
+ long* pGlyphIDs,
+ sal_uInt8* pEncoding,
+ sal_Int32* pWidths,
+ int nGlyphs,
+ FontSubsetInfo& rInfo // out parameter
+ );
+
+ // GetFontEncodingVector: a method to get the encoding map Unicode
+ // to font encoded character; this is only used for type1 fonts and
+ // may return NULL in case of unknown encoding vector
+ // if ppNonEncoded is set and non encoded characters (that is type1
+ // glyphs with only a name) exist it is set to the corresponding
+ // map for non encoded glyphs; the encoding vector contains -1
+ // as encoding for these cases
+ virtual const std::map< sal_Unicode, sal_Int32 >* GetFontEncodingVector( ImplFontData* pFont, const std::map< sal_Unicode, rtl::OString >** ppNonEncoded );
+
+ // GetEmbedFontData: gets the font data for a font marked
+ // embeddable by GetDevFontList or NULL in case of error
+ // parameters: pFont: describes the font in question
+ // pWidths: the widths of all glyphs from char code 0 to 255
+ // pWidths MUST support at least 256 members;
+ // rInfo: additional outgoing information
+ // pDataLen: out parameter, contains the byte length of the returned buffer
+ virtual const void* GetEmbedFontData( ImplFontData* pFont,
+ sal_Int32* pWidths,
+ FontSubsetInfo& rInfo,
+ long* pDataLen );
+ // frees the font data again
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+
+ virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, PolyPolygon& );
+
+ virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
};
// Init/Deinit Graphics
-void ImplSalInitGraphics( SalGraphicsData* mpData );
-void ImplSalDeInitGraphics( SalGraphicsData* mpData );
+void ImplSalInitGraphics( WinSalGraphics* mpData );
+void ImplSalDeInitGraphics( WinSalGraphics* mpData );
void ImplUpdateSysColorEntries();
int ImplIsSysColorEntry( SalColor nSalColor );
void ImplGetLogFontFromFontSelect( HDC hDC,