1161f4cd1SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5161f4cd1SAndrew Rist * distributed with this work for additional information 6161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10161f4cd1SAndrew Rist * 11161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12161f4cd1SAndrew Rist * 13161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17161f4cd1SAndrew Rist * specific language governing permissions and limitations 18161f4cd1SAndrew Rist * under the License. 19161f4cd1SAndrew Rist * 20161f4cd1SAndrew Rist *************************************************************/ 21161f4cd1SAndrew Rist 22161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _PSPRINT_PRINTERGFX_HXX_ 25cdf0e10cSrcweir #define _PSPRINT_PRINTERGFX_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "vcl/helper.hxx" 28cdf0e10cSrcweir #include "sallayout.hxx" 29cdf0e10cSrcweir #include "osl/file.hxx" 30cdf0e10cSrcweir #include "tools/gen.hxx" 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <list> 33cdf0e10cSrcweir #include <hash_map> 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace psp { 36cdf0e10cSrcweir 37cdf0e10cSrcweir // forwards 38*ee206fdaSHerbert Dürr struct JobData; 39cdf0e10cSrcweir 40cdf0e10cSrcweir /* 41cdf0e10cSrcweir * lightweight container to handle RGB values 42cdf0e10cSrcweir */ 43cdf0e10cSrcweir 44cdf0e10cSrcweir class PrinterColor 45cdf0e10cSrcweir { 46cdf0e10cSrcweir public: 47cdf0e10cSrcweir 48cdf0e10cSrcweir enum ColorSpace { eInvalid, eRGB }; 49cdf0e10cSrcweir 50cdf0e10cSrcweir private: 51cdf0e10cSrcweir 52cdf0e10cSrcweir sal_uInt8 mnRed; 53cdf0e10cSrcweir sal_uInt8 mnGreen; 54cdf0e10cSrcweir sal_uInt8 mnBlue; 55cdf0e10cSrcweir ColorSpace meColorspace; 56cdf0e10cSrcweir 57cdf0e10cSrcweir public: 58cdf0e10cSrcweir PrinterColor()59cdf0e10cSrcweir PrinterColor () : 60cdf0e10cSrcweir meColorspace(eInvalid) 61cdf0e10cSrcweir {} PrinterColor(sal_uInt16 nRed,sal_uInt16 nGreen,sal_uInt16 nBlue)62cdf0e10cSrcweir PrinterColor (sal_uInt16 nRed, sal_uInt16 nGreen, 63cdf0e10cSrcweir sal_uInt16 nBlue) : 64cdf0e10cSrcweir mnRed (nRed), 65cdf0e10cSrcweir mnGreen (nGreen), 66cdf0e10cSrcweir mnBlue (nBlue), 67cdf0e10cSrcweir meColorspace (eRGB) 68cdf0e10cSrcweir {} PrinterColor(sal_uInt32 nRGB)69cdf0e10cSrcweir PrinterColor (sal_uInt32 nRGB) : 70cdf0e10cSrcweir mnRed ((nRGB & 0x00ff0000) >> 16), 71cdf0e10cSrcweir mnGreen ((nRGB & 0x0000ff00) >> 8), 72cdf0e10cSrcweir mnBlue ((nRGB & 0x000000ff) ), 73cdf0e10cSrcweir meColorspace (eRGB) 74cdf0e10cSrcweir {} ~PrinterColor()75cdf0e10cSrcweir ~PrinterColor () 76cdf0e10cSrcweir {} 77cdf0e10cSrcweir Is() const78cdf0e10cSrcweir sal_Bool Is () const 79cdf0e10cSrcweir { return meColorspace != eInvalid; } 80cdf0e10cSrcweir GetColorSpace() const81cdf0e10cSrcweir ColorSpace GetColorSpace () const 82cdf0e10cSrcweir { return meColorspace; } GetRed() const83cdf0e10cSrcweir sal_uInt16 GetRed () const 84cdf0e10cSrcweir { return mnRed; } GetGreen() const85cdf0e10cSrcweir sal_uInt16 GetGreen () const 86cdf0e10cSrcweir { return mnGreen; } GetBlue() const87cdf0e10cSrcweir sal_uInt16 GetBlue () const 88cdf0e10cSrcweir { return mnBlue; } operator ==(const PrinterColor & aColor) const89cdf0e10cSrcweir sal_Bool operator== (const PrinterColor& aColor) const 90cdf0e10cSrcweir { 91cdf0e10cSrcweir return aColor.Is() && this->Is() 92cdf0e10cSrcweir && mnRed == aColor.mnRed 93cdf0e10cSrcweir && mnGreen == aColor.mnGreen 94cdf0e10cSrcweir && mnBlue == aColor.mnBlue; 95cdf0e10cSrcweir } operator !=(const PrinterColor & aColor) const96cdf0e10cSrcweir sal_Bool operator!= (const PrinterColor& aColor) const 97cdf0e10cSrcweir { return ! (aColor==*this); } operator =(const PrinterColor & aColor)98cdf0e10cSrcweir PrinterColor& operator= (const PrinterColor& aColor) 99cdf0e10cSrcweir { 100cdf0e10cSrcweir meColorspace = aColor.meColorspace; 101cdf0e10cSrcweir mnRed = aColor.mnRed; 102cdf0e10cSrcweir mnGreen = aColor.mnGreen; 103cdf0e10cSrcweir mnBlue = aColor.mnBlue; 104cdf0e10cSrcweir 105cdf0e10cSrcweir return *this; 106cdf0e10cSrcweir } 107cdf0e10cSrcweir operator =(sal_uInt32 nRGB)108cdf0e10cSrcweir PrinterColor& operator= (sal_uInt32 nRGB) 109cdf0e10cSrcweir { 110cdf0e10cSrcweir meColorspace = eRGB; 111cdf0e10cSrcweir mnBlue = (nRGB & 0x000000ff); 112cdf0e10cSrcweir mnGreen = (nRGB & 0x0000ff00) >> 8; 113cdf0e10cSrcweir mnRed = (nRGB & 0x00ff0000) >> 16; 114cdf0e10cSrcweir 115cdf0e10cSrcweir return *this; 116cdf0e10cSrcweir } 117cdf0e10cSrcweir }; 118cdf0e10cSrcweir 119cdf0e10cSrcweir /* 120cdf0e10cSrcweir * forward declarations 121cdf0e10cSrcweir */ 122cdf0e10cSrcweir 123cdf0e10cSrcweir class Font3; 124cdf0e10cSrcweir class GlyphSet; 125cdf0e10cSrcweir class PrinterJob; 126cdf0e10cSrcweir class PrintFontManager; 127*ee206fdaSHerbert Dürr struct KernPair; 128cdf0e10cSrcweir struct CharacterMetric; 129cdf0e10cSrcweir 130cdf0e10cSrcweir /* 131cdf0e10cSrcweir * Bitmap Interface, this has to be filled with your actual bitmap implementation 132cdf0e10cSrcweir * sample implementations can be found in: 133cdf0e10cSrcweir * psprint/workben/cui/pspdem.cxx 134cdf0e10cSrcweir * vcl/unx/source/gdi/salgdi2.cxx 135cdf0e10cSrcweir */ 136cdf0e10cSrcweir 137cdf0e10cSrcweir class PrinterBmp 138cdf0e10cSrcweir { 139cdf0e10cSrcweir public: 140cdf0e10cSrcweir 141cdf0e10cSrcweir virtual ~PrinterBmp () = 0; 142cdf0e10cSrcweir virtual sal_uInt32 GetPaletteColor (sal_uInt32 nIdx) const = 0; 143cdf0e10cSrcweir virtual sal_uInt32 GetPaletteEntryCount () const = 0; 144cdf0e10cSrcweir virtual sal_uInt32 GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const = 0; 145cdf0e10cSrcweir virtual sal_uInt8 GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const = 0; 146cdf0e10cSrcweir virtual sal_uInt8 GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const = 0; 147cdf0e10cSrcweir virtual sal_uInt32 GetWidth () const = 0; 148cdf0e10cSrcweir virtual sal_uInt32 GetHeight () const = 0; 149cdf0e10cSrcweir virtual sal_uInt32 GetDepth () const = 0; 150cdf0e10cSrcweir }; 151cdf0e10cSrcweir 152cdf0e10cSrcweir typedef enum { 153cdf0e10cSrcweir InvalidType = 0, 154cdf0e10cSrcweir TrueColorImage, 155cdf0e10cSrcweir MonochromeImage, 156cdf0e10cSrcweir PaletteImage, 157cdf0e10cSrcweir GrayScaleImage 158cdf0e10cSrcweir } ImageType; 159cdf0e10cSrcweir 160cdf0e10cSrcweir /* 161cdf0e10cSrcweir * printer raster operations 162cdf0e10cSrcweir */ 163cdf0e10cSrcweir 164cdf0e10cSrcweir struct GraphicsStatus 165cdf0e10cSrcweir { 166cdf0e10cSrcweir rtl::OString maFont; 167cdf0e10cSrcweir rtl_TextEncoding maEncoding; 168cdf0e10cSrcweir bool mbArtItalic; 169cdf0e10cSrcweir bool mbArtBold; 170cdf0e10cSrcweir sal_Int32 mnTextHeight; 171cdf0e10cSrcweir sal_Int32 mnTextWidth; 172cdf0e10cSrcweir PrinterColor maColor; 173cdf0e10cSrcweir double mfLineWidth; 174cdf0e10cSrcweir 175cdf0e10cSrcweir GraphicsStatus(); 176cdf0e10cSrcweir }; 177cdf0e10cSrcweir 178cdf0e10cSrcweir class Font3; 179cdf0e10cSrcweir 180cdf0e10cSrcweir class PrinterGfx 181cdf0e10cSrcweir { 182cdf0e10cSrcweir private: 183cdf0e10cSrcweir 184cdf0e10cSrcweir /* common settings */ 185cdf0e10cSrcweir 186cdf0e10cSrcweir double mfScaleX; 187cdf0e10cSrcweir double mfScaleY; 188cdf0e10cSrcweir 189cdf0e10cSrcweir sal_uInt32 mnDpi; 190cdf0e10cSrcweir sal_uInt16 mnDepth; 191cdf0e10cSrcweir 192cdf0e10cSrcweir sal_uInt16 mnPSLevel; 193cdf0e10cSrcweir sal_Bool mbColor; 194cdf0e10cSrcweir sal_Bool mbUploadPS42Fonts; 195cdf0e10cSrcweir 196cdf0e10cSrcweir osl::File* mpPageHeader; 197cdf0e10cSrcweir osl::File* mpPageBody; 198cdf0e10cSrcweir TranslateCoordinates(sal_Int32 & rXOut,sal_Int32 & rYOut,sal_Int32 nXIn,sal_Int32 nYIn)199cdf0e10cSrcweir void TranslateCoordinates (sal_Int32 &rXOut, sal_Int32 &rYOut, 200cdf0e10cSrcweir sal_Int32 nXIn, sal_Int32 nYIn ) 201cdf0e10cSrcweir { rXOut = nXIn; rYOut = nYIn; } TranslateCoordinates(Point & rOut,const Point & rIn)202cdf0e10cSrcweir void TranslateCoordinates (Point& rOut, const Point& rIn) 203cdf0e10cSrcweir { rOut = rIn; } 204cdf0e10cSrcweir 205cdf0e10cSrcweir /* text/font related data, for a type1 font it has to be checked 206cdf0e10cSrcweir whether this font has already been downloaded. A TrueType font 207cdf0e10cSrcweir will be converted into one or more Type3 fonts, containing glyphs 208cdf0e10cSrcweir in no particular order. In addition to the existence of the 209cdf0e10cSrcweir glyph in one of the subfonts, the mapping from unicode to the 210cdf0e10cSrcweir glyph has to be remembered */ 211cdf0e10cSrcweir 212cdf0e10cSrcweir std::list< sal_Int32 > maPS1Font; 213cdf0e10cSrcweir std::list< GlyphSet > maPS3Font; 214cdf0e10cSrcweir 215cdf0e10cSrcweir sal_Int32 mnFontID; 216cdf0e10cSrcweir sal_Int32 mnFallbackID; 217cdf0e10cSrcweir sal_Int32 mnTextAngle; 218cdf0e10cSrcweir bool mbTextVertical; 219cdf0e10cSrcweir PrintFontManager& mrFontMgr; 220cdf0e10cSrcweir 221cdf0e10cSrcweir /* bitmap drawing implementation */ 222cdf0e10cSrcweir 223cdf0e10cSrcweir sal_Bool mbCompressBmp; 224cdf0e10cSrcweir 225cdf0e10cSrcweir void DrawPS1GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea); 226cdf0e10cSrcweir void writePS2ImageHeader (const Rectangle& rArea, psp::ImageType nType); 227cdf0e10cSrcweir void writePS2Colorspace (const PrinterBmp& rBitmap, psp::ImageType nType); 228cdf0e10cSrcweir void DrawPS2GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea); 229cdf0e10cSrcweir void DrawPS2PaletteImage (const PrinterBmp& rBitmap, const Rectangle& rArea); 230cdf0e10cSrcweir void DrawPS2TrueColorImage (const PrinterBmp& rBitmap, const Rectangle& rArea); 231cdf0e10cSrcweir void DrawPS2MonoImage (const PrinterBmp& rBitmap, const Rectangle& rArea); 232cdf0e10cSrcweir 233cdf0e10cSrcweir /* clip region */ 234cdf0e10cSrcweir 235cdf0e10cSrcweir std::list< Rectangle > maClipRegion; 236cdf0e10cSrcweir sal_Bool JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it, 237cdf0e10cSrcweir Point& aOldPoint, sal_Int32& nColumn ); 238cdf0e10cSrcweir 239cdf0e10cSrcweir /* color settings */ 240cdf0e10cSrcweir PrinterColor maFillColor; 241cdf0e10cSrcweir PrinterColor maTextColor; 242cdf0e10cSrcweir PrinterColor maLineColor; 243cdf0e10cSrcweir 244cdf0e10cSrcweir /* graphics state */ 245cdf0e10cSrcweir GraphicsStatus maVirtualStatus; 246cdf0e10cSrcweir std::list< GraphicsStatus > maGraphicsStack; currentState()247cdf0e10cSrcweir GraphicsStatus& currentState() { return maGraphicsStack.front(); } 248cdf0e10cSrcweir 249cdf0e10cSrcweir /* font / font substitution */ 250cdf0e10cSrcweir friend class Font3; 251cdf0e10cSrcweir const ::std::hash_map< fontID, fontID >* mpFontSubstitutes; 252cdf0e10cSrcweir int getCharWidth (sal_Bool b_vert, sal_Unicode n_char, 253cdf0e10cSrcweir CharacterMetric *p_bbox); 254cdf0e10cSrcweir fontID getCharMetric (const Font3 &rFont, sal_Unicode n_char, 255cdf0e10cSrcweir CharacterMetric *p_bbox); 256cdf0e10cSrcweir fontID getFontSubstitute () const; getFallbackID() const257cdf0e10cSrcweir fontID getFallbackID () const { return mnFallbackID; } 258cdf0e10cSrcweir 259cdf0e10cSrcweir bool mbStrictSO52Compatibility; 260cdf0e10cSrcweir public: 261cdf0e10cSrcweir /* grahics status update */ 262cdf0e10cSrcweir void PSSetColor (); 263cdf0e10cSrcweir void PSSetLineWidth (); 264cdf0e10cSrcweir void PSSetFont (); 265cdf0e10cSrcweir 266cdf0e10cSrcweir /* graphics status functions */ PSSetColor(const PrinterColor & rColor)267cdf0e10cSrcweir void PSSetColor (const PrinterColor& rColor) 268cdf0e10cSrcweir { maVirtualStatus.maColor = rColor; } 269cdf0e10cSrcweir 270cdf0e10cSrcweir void PSUploadPS1Font (sal_Int32 nFontID); PSSetFont(const rtl::OString & rName,rtl_TextEncoding nEncoding=RTL_TEXTENCODING_DONTKNOW)271cdf0e10cSrcweir void PSSetFont (const rtl::OString& rName, 272cdf0e10cSrcweir rtl_TextEncoding nEncoding = RTL_TEXTENCODING_DONTKNOW) 273cdf0e10cSrcweir { maVirtualStatus.maFont = rName; maVirtualStatus.maEncoding = nEncoding; } 274cdf0e10cSrcweir 275cdf0e10cSrcweir /* graphics status stack */ 276cdf0e10cSrcweir void PSGSave (); 277cdf0e10cSrcweir void PSGRestore (); 278cdf0e10cSrcweir 279cdf0e10cSrcweir 280cdf0e10cSrcweir /* PS helpers */ 281cdf0e10cSrcweir enum pspath_t { moveto = 0, lineto = 1 }; 282cdf0e10cSrcweir void PSBinLineTo (const Point& rCurrent, Point& rOld, 283cdf0e10cSrcweir sal_Int32& nColumn); 284cdf0e10cSrcweir void PSBinMoveTo (const Point& rCurrent, Point& rOld, 285cdf0e10cSrcweir sal_Int32& nColumn); 286cdf0e10cSrcweir void PSBinStartPath (); 287cdf0e10cSrcweir void PSBinEndPath (); 288cdf0e10cSrcweir void PSBinCurrentPath (sal_uInt32 nPoints, const Point* pPath); 289cdf0e10cSrcweir void PSBinPath (const Point& rCurrent, Point& rOld, 290cdf0e10cSrcweir pspath_t eType, sal_Int32& nColumn); 291cdf0e10cSrcweir 292cdf0e10cSrcweir void PSRotate (sal_Int32 nAngle); 293cdf0e10cSrcweir void PSTranslate (const Point& rPoint); 294cdf0e10cSrcweir void PSMoveTo (const Point& rPoint); 295cdf0e10cSrcweir void PSRMoveTo (sal_Int32 nDx, sal_Int32 nDy = 0); 296cdf0e10cSrcweir void PSScale (double fScaleX, double fScaleY); 297cdf0e10cSrcweir void PSLineTo(const Point& rPoint ); 298cdf0e10cSrcweir void PSPointOp (const Point& rPoint, const sal_Char* pOperator); 299cdf0e10cSrcweir void PSHexString (const sal_uChar* pString, sal_Int16 nLen); 300cdf0e10cSrcweir void PSDeltaArray (const sal_Int32 *pArray, sal_Int16 nEntries); 301cdf0e10cSrcweir void PSShowText (const sal_uChar* pString, 302cdf0e10cSrcweir sal_Int16 nGlyphs, sal_Int16 nBytes, 303cdf0e10cSrcweir const sal_Int32* pDeltaArray = NULL); 304cdf0e10cSrcweir void PSComment (const sal_Char* pComment ); 305cdf0e10cSrcweir void LicenseWarning (const Point& rPoint, const sal_Unicode* pStr, 306cdf0e10cSrcweir sal_Int16 nLen, const sal_Int32* pDeltaArray); 307cdf0e10cSrcweir 308cdf0e10cSrcweir void OnEndPage (); 309cdf0e10cSrcweir void OnEndJob (); 310cdf0e10cSrcweir void writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppliedFonts, std::list< rtl::OString >& rNeededFonts ); GetFontMgr()311cdf0e10cSrcweir PrintFontManager& GetFontMgr () { return mrFontMgr; } 312cdf0e10cSrcweir 313cdf0e10cSrcweir void drawVerticalizedText (const Point& rPoint, 314cdf0e10cSrcweir const sal_Unicode* pStr, 315cdf0e10cSrcweir sal_Int16 nLen, 316cdf0e10cSrcweir const sal_Int32* pDeltaArray ); 317cdf0e10cSrcweir void drawText (const Point& rPoint, 318cdf0e10cSrcweir const sal_Unicode* pStr, sal_Int16 nLen, 319cdf0e10cSrcweir const sal_Int32* pDeltaArray = NULL); 320cdf0e10cSrcweir 321cdf0e10cSrcweir void drawGlyphs( const Point& rPoint, 322cdf0e10cSrcweir sal_GlyphId* pGlyphIds, 323cdf0e10cSrcweir sal_Unicode* pUnicodes, 324cdf0e10cSrcweir sal_Int16 nLen, 325cdf0e10cSrcweir sal_Int32* pDeltaArray ); 326cdf0e10cSrcweir public: 327cdf0e10cSrcweir PrinterGfx(); 328cdf0e10cSrcweir ~PrinterGfx(); 329cdf0e10cSrcweir sal_Bool Init (PrinterJob &rPrinterSpec); 330cdf0e10cSrcweir sal_Bool Init (const JobData& rData); 331cdf0e10cSrcweir void Clear(); 332cdf0e10cSrcweir 333cdf0e10cSrcweir // query depth and size 334cdf0e10cSrcweir void GetResolution (sal_Int32 &rDpiX, sal_Int32 &rDpiY) const; 335cdf0e10cSrcweir sal_uInt16 GetBitCount (); 336cdf0e10cSrcweir 337cdf0e10cSrcweir // clip region 338cdf0e10cSrcweir void ResetClipRegion (); 339cdf0e10cSrcweir void BeginSetClipRegion (sal_uInt32); 340cdf0e10cSrcweir sal_Bool UnionClipRegion (sal_Int32 nX, sal_Int32 nY, 341cdf0e10cSrcweir sal_Int32 nDX, sal_Int32 nDY); 342cdf0e10cSrcweir void EndSetClipRegion (); 343cdf0e10cSrcweir 344cdf0e10cSrcweir // set xy color SetLineColor(const PrinterColor & rLineColor=PrinterColor ())345cdf0e10cSrcweir void SetLineColor (const PrinterColor& rLineColor = PrinterColor()) 346cdf0e10cSrcweir { maLineColor = rLineColor; } SetFillColor(const PrinterColor & rFillColor=PrinterColor ())347cdf0e10cSrcweir void SetFillColor (const PrinterColor& rFillColor = PrinterColor()) 348cdf0e10cSrcweir { maFillColor = rFillColor; } 349cdf0e10cSrcweir 350cdf0e10cSrcweir // drawing primitives 351cdf0e10cSrcweir void DrawPixel (const Point& rPoint, const PrinterColor& rPixelColor); DrawPixel(const Point & rPoint)352cdf0e10cSrcweir void DrawPixel (const Point& rPoint) 353cdf0e10cSrcweir { DrawPixel (rPoint, maLineColor); } 354cdf0e10cSrcweir void DrawLine (const Point& rFrom, const Point& rTo); 355cdf0e10cSrcweir void DrawRect (const Rectangle& rRectangle); 356cdf0e10cSrcweir void DrawPolyLine (sal_uInt32 nPoints, const Point* pPath ); 357cdf0e10cSrcweir void DrawPolygon (sal_uInt32 nPoints, const Point* pPath); 358cdf0e10cSrcweir void DrawPolyPolygon (sal_uInt32 nPoly, 359cdf0e10cSrcweir const sal_uInt32 *pPolygonSize, 360cdf0e10cSrcweir const Point** pPolygonList); 361cdf0e10cSrcweir void DrawPolyLineBezier (sal_uInt32 nPoints, 362cdf0e10cSrcweir const Point* pPath, 363cdf0e10cSrcweir const sal_uInt8* pFlgAry ); 364cdf0e10cSrcweir void DrawPolygonBezier (sal_uInt32 nPoints, 365cdf0e10cSrcweir const Point* pPath, 366cdf0e10cSrcweir const sal_uInt8* pFlgAry); 367cdf0e10cSrcweir void DrawPolyPolygonBezier (sal_uInt32 nPoly, 368cdf0e10cSrcweir const sal_uInt32* pPoints, 369cdf0e10cSrcweir const Point* const* pPtAry, 370cdf0e10cSrcweir const sal_uInt8* const* pFlgAry); 371cdf0e10cSrcweir 372cdf0e10cSrcweir // eps 373cdf0e10cSrcweir sal_Bool DrawEPS ( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize); 374cdf0e10cSrcweir 375cdf0e10cSrcweir // image drawing 376cdf0e10cSrcweir void DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc, 377cdf0e10cSrcweir const PrinterBmp& rBitmap); 378cdf0e10cSrcweir void DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc, 379cdf0e10cSrcweir const PrinterBmp& rBitmap, 380cdf0e10cSrcweir const PrinterBmp& rTransBitmap); 381cdf0e10cSrcweir void DrawMask (const Rectangle& rDest, const Rectangle& rSrc, 382cdf0e10cSrcweir const PrinterBmp &rBitmap, PrinterColor& rMaskColor); 383cdf0e10cSrcweir 384cdf0e10cSrcweir // font and text handling 385cdf0e10cSrcweir sal_uInt16 SetFont ( 386cdf0e10cSrcweir sal_Int32 nFontID, 387cdf0e10cSrcweir sal_Int32 nPointHeight, 388cdf0e10cSrcweir sal_Int32 nPointWidth, 389cdf0e10cSrcweir sal_Int32 nAngle, 390cdf0e10cSrcweir bool bVertical, 391cdf0e10cSrcweir bool bArtItalic, 392cdf0e10cSrcweir bool bArtBold 393cdf0e10cSrcweir ); 394cdf0e10cSrcweir sal_uInt16 SetFallbackFont ( sal_Int32 nFontID ); GetFontAngle() const395cdf0e10cSrcweir sal_Int32 GetFontAngle () const 396cdf0e10cSrcweir { return mnTextAngle; } GetFontID() const397cdf0e10cSrcweir sal_Int32 GetFontID () const 398cdf0e10cSrcweir { return mnFontID; } GetFontVertical() const399cdf0e10cSrcweir bool GetFontVertical() const 400cdf0e10cSrcweir { return mbTextVertical; } GetFontHeight() const401cdf0e10cSrcweir sal_Int32 GetFontHeight () const 402cdf0e10cSrcweir { return maVirtualStatus.mnTextHeight; } GetFontWidth() const403cdf0e10cSrcweir sal_Int32 GetFontWidth () const 404cdf0e10cSrcweir { return maVirtualStatus.mnTextWidth; } GetArtificialItalic() const405cdf0e10cSrcweir bool GetArtificialItalic() const 406cdf0e10cSrcweir { return maVirtualStatus.mbArtItalic; } GetArtificialBold() const407cdf0e10cSrcweir bool GetArtificialBold() const 408cdf0e10cSrcweir { return maVirtualStatus.mbArtBold; } 409cdf0e10cSrcweir void DrawText (const Point& rPoint, 410cdf0e10cSrcweir const sal_Unicode* pStr, sal_Int16 nLen, 411cdf0e10cSrcweir const sal_Int32* pDeltaArray = NULL); SetTextColor(PrinterColor & rTextColor)412cdf0e10cSrcweir void SetTextColor (PrinterColor& rTextColor) 413cdf0e10cSrcweir { maTextColor = rTextColor; } 414cdf0e10cSrcweir sal_Int32 GetCharWidth (sal_uInt16 nFrom, sal_uInt16 nTo, 415cdf0e10cSrcweir long *pWidthArray); 416cdf0e10cSrcweir const ::std::list< KernPair >& getKernPairs( bool bVertical = false ) const; 417cdf0e10cSrcweir // advanced font handling 418cdf0e10cSrcweir sal_Bool GetGlyphBoundRect (sal_Unicode c, Rectangle& rOutRect); 419cdf0e10cSrcweir sal_uInt32 GetGlyphOutline (sal_Unicode c, 420cdf0e10cSrcweir sal_uInt16 **ppPolySizes, Point **ppPoints, 421cdf0e10cSrcweir sal_uInt8 **ppFlags); 422cdf0e10cSrcweir 423cdf0e10cSrcweir // for CTL 424cdf0e10cSrcweir void DrawGlyphs( const Point& rPoint, 425cdf0e10cSrcweir sal_GlyphId* pGlyphIds, 426cdf0e10cSrcweir sal_Unicode* pUnicodes, 427cdf0e10cSrcweir sal_Int16 nLen, 428cdf0e10cSrcweir sal_Int32* pDeltaArray ); 429cdf0e10cSrcweir 430cdf0e10cSrcweir bool getStrictSO52Compatibility() const; 431cdf0e10cSrcweir void setStrictSO52Compatibility( bool ); 432cdf0e10cSrcweir }; 433cdf0e10cSrcweir 434cdf0e10cSrcweir } /* namespace psp */ 435cdf0e10cSrcweir 436cdf0e10cSrcweir 437cdf0e10cSrcweir #endif /* _PSPRINT_PRINTERGFX_HXX_ */ 438cdf0e10cSrcweir 439