diff options
author | Michael Meeks <michael.meeks@suse.com> | 2011-09-29 16:14:34 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-10-25 13:41:48 +0100 |
commit | 46ef233ba8b7372796f5f3e6044d0d12193dfcc8 (patch) | |
tree | 4db3de84fa8f07c5a109134b581c666ce2b813fc /vcl/inc/headless | |
parent | b26a596c5b43834f90de7fb5c6bed824c8d2b2ba (diff) |
headless: move backend to top-level, and enable for all platforms
Diffstat (limited to 'vcl/inc/headless')
-rw-r--r-- | vcl/inc/headless/svpbmp.hxx | 72 | ||||
-rw-r--r-- | vcl/inc/headless/svpdummies.hxx | 100 | ||||
-rw-r--r-- | vcl/inc/headless/svpelement.hxx | 49 | ||||
-rw-r--r-- | vcl/inc/headless/svpframe.hxx | 132 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 189 | ||||
-rw-r--r-- | vcl/inc/headless/svpinst.hxx | 203 | ||||
-rw-r--r-- | vcl/inc/headless/svpprn.hxx | 56 | ||||
-rw-r--r-- | vcl/inc/headless/svppspgraphics.hxx | 189 | ||||
-rw-r--r-- | vcl/inc/headless/svpvd.hxx | 62 |
9 files changed, 1052 insertions, 0 deletions
diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx new file mode 100644 index 000000000000..b3adb3b9951f --- /dev/null +++ b/vcl/inc/headless/svpbmp.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SVP_SVBMP_HXX +#define SVP_SVBMP_HXX + +#include <salbmp.hxx> +#include "svpelement.hxx" + +class SvpSalBitmap : public SalBitmap, public SvpElement +{ + basebmp::BitmapDeviceSharedPtr m_aBitmap; +public: + SvpSalBitmap() {} + virtual ~SvpSalBitmap(); + + const basebmp::BitmapDeviceSharedPtr& getBitmap() const { return m_aBitmap; } + void setBitmap( const basebmp::BitmapDeviceSharedPtr& rSrc ) { m_aBitmap = rSrc; } + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aBitmap; } + + // SalBitmap + virtual bool Create( const Size& rSize, + sal_uInt16 nBitCount, + const BitmapPalette& rPal ); + virtual bool Create( const SalBitmap& rSalBmp ); + virtual bool Create( const SalBitmap& rSalBmp, + SalGraphics* pGraphics ); + virtual bool Create( const SalBitmap& rSalBmp, + sal_uInt16 nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); + virtual void Destroy(); + virtual Size GetSize() const; + virtual sal_uInt16 GetBitCount() const; + + virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); + virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + virtual bool GetSystemData( BitmapSystemData& rData ); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpdummies.hxx b/vcl/inc/headless/svpdummies.hxx new file mode 100644 index 000000000000..bc46e9b22f70 --- /dev/null +++ b/vcl/inc/headless/svpdummies.hxx @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPDUMMIES_HXX + +#include <vcl/sysdata.hxx> + +#include <salobj.hxx> +#include <salimestatus.hxx> +#include <salsys.hxx> + +class SalGraphics; + +class SvpSalObject : public SalObject +{ +public: + SystemChildData m_aSystemChildData; + + SvpSalObject(); + virtual ~SvpSalObject(); + + // overload all pure virtual methods + virtual void ResetClipRegion(); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uLong nRects ); + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void EndSetClipRegion(); + + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); + virtual void Show( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); + virtual void GrabFocus(); + + virtual void SetBackground(); + virtual void SetBackground( SalColor nSalColor ); + + virtual const SystemEnvData* GetSystemData() const; + + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); +}; + +class SvpImeStatus : public SalI18NImeStatus +{ + public: + SvpImeStatus() {} + virtual ~SvpImeStatus(); + + virtual bool canToggle(); + virtual void toggle(); +}; + +class SvpSalSystem : public SalSystem +{ + public: + SvpSalSystem() {} + virtual ~SvpSalSystem(); + // get info about the display + virtual unsigned int GetDisplayScreenCount(); + virtual bool IsMultiDisplay(); + virtual unsigned int GetDefaultDisplayNumber(); + virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + virtual rtl::OUString GetScreenName( unsigned int nScreen ); + + + virtual int ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton); +}; + + +#endif // _SVP_SVPDUMMIES_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpelement.hxx b/vcl/inc/headless/svpelement.hxx new file mode 100644 index 000000000000..c7f647cf3a03 --- /dev/null +++ b/vcl/inc/headless/svpelement.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPELEMENT_HXX +#define _SVP_SVPELEMENT_HXX + +#include <basebmp/bitmapdevice.hxx> + +#define SVP_DEFAULT_BITMAP_FORMAT basebmp::Format::TWENTYFOUR_BIT_TC_MASK + +class SvpElement +{ + protected: + SvpElement(); + virtual ~SvpElement(); + public: + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const = 0; + + static sal_uInt32 getBitCountFromScanlineFormat( sal_Int32 nFormat ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx new file mode 100644 index 000000000000..e57381780f61 --- /dev/null +++ b/vcl/inc/headless/svpframe.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPFRAME_HXX + +#include <vcl/sysdata.hxx> + +#include <salframe.hxx> +#include "svpelement.hxx" + +#include <list> + +class SvpSalInstance; +class SvpSalGraphics; + +class SvpSalFrame : public SalFrame, public SvpElement +{ + SvpSalInstance* m_pInstance; + SvpSalFrame* m_pParent; // pointer to parent frame + std::list< SvpSalFrame* > m_aChildren; // List of child frames + sal_uLong m_nStyle; + bool m_bVisible; + long m_nMinWidth; + long m_nMinHeight; + long m_nMaxWidth; + long m_nMaxHeight; + + SystemEnvData m_aSystemChildData; + + basebmp::BitmapDeviceSharedPtr m_aFrame; + std::list< SvpSalGraphics* > m_aGraphics; + + static SvpSalFrame* s_pFocusFrame; +public: + SvpSalFrame( SvpSalInstance* pInstance, + SalFrame* pParent, + sal_uLong nSalFrameStyle, + SystemParentData* pSystemParent = NULL ); + virtual ~SvpSalFrame(); + + void GetFocus(); + void LoseFocus(); + void PostPaint() const; + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; } + + // SalFrame + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + + virtual sal_Bool PostEvent( void* pData ); + + virtual void SetTitle( const XubString& rTitle ); + virtual void SetIcon( sal_uInt16 nIcon ); + virtual void SetMenu( SalMenu* pMenu ); + virtual void DrawMenuBar(); + + virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); + virtual void Enable( sal_Bool bEnable ); + virtual void SetMinClientSize( long nWidth, long nHeight ); + virtual void SetMaxClientSize( long nWidth, long nHeight ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); + virtual void GetClientSize( long& rWidth, long& rHeight ); + virtual void GetWorkArea( Rectangle& rRect ); + virtual SalFrame* GetParent() const; + virtual void SetWindowState( const SalFrameState* pState ); + virtual sal_Bool GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ); + virtual void StartPresentation( sal_Bool bStart ); + virtual void SetAlwaysOnTop( sal_Bool bOnTop ); + virtual void ToTop( sal_uInt16 nFlags ); + virtual void SetPointer( PointerStyle ePointerStyle ); + virtual void CaptureMouse( sal_Bool bMouse ); + virtual void SetPointerPos( long nX, long nY ); + using SalFrame::Flush; + virtual void Flush(); + virtual void Sync(); + virtual void SetInputContext( SalInputContext* pContext ); + virtual void EndExtTextInput( sal_uInt16 nFlags ); + virtual String GetKeyName( sal_uInt16 nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); + virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual LanguageType GetInputLanguage(); + virtual SalBitmap* SnapShot(); + virtual void UpdateSettings( AllSettings& rSettings ); + virtual void Beep( SoundType eSoundType ); + virtual const SystemEnvData* GetSystemData() const; + virtual SalPointerState GetPointerState(); + virtual SalIndicatorState GetIndicatorState(); + virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); + virtual void SetParent( SalFrame* pNewParent ); + virtual bool SetPluginParent( SystemParentData* pNewParent ); + virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); + virtual void ResetClipRegion(); + virtual void BeginSetClipRegion( sal_uLong nRects ); + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void EndSetClipRegion(); + + /*TODO: functional implementation */ + virtual void SetScreenNumber( unsigned int nScreen ) { (void)nScreen; } + virtual void SetApplicationID(const rtl::OUString &rApplicationID) { (void) rApplicationID; } +}; +#endif // _SVP_SVPFRAME_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx new file mode 100644 index 000000000000..007c4b55ddee --- /dev/null +++ b/vcl/inc/headless/svpgdi.hxx @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPGDI_HXX +#define _SVP_SVPGDI_HXX + +#include <basebmp/bitmapdevice.hxx> +#include <basebmp/color.hxx> + +#include <salgdi.hxx> +#include <sallayout.hxx> + +class ServerFont; + +class SvpSalGraphics : public SalGraphics +{ + basebmp::BitmapDeviceSharedPtr m_aDevice; + basebmp::BitmapDeviceSharedPtr m_aOrigDevice; + + bool m_bUseLineColor; + basebmp::Color m_aLineColor; + bool m_bUseFillColor; + basebmp::Color m_aFillColor; + basebmp::Color m_aTextColor; + + basebmp::DrawMode m_aDrawMode; + + ServerFont* m_pServerFont[ MAX_FALLBACK ]; + sal_uInt32 m_eTextFmt; + + basebmp::BitmapDeviceSharedPtr m_aClipMap; + +protected: + Region m_aClipRegion; + basegfx::B2IVector GetSize() { return m_aOrigDevice->getSize(); } +private: + bool m_bClipSetup; + struct ClipUndoHandle { + SvpSalGraphics &m_rGfx; + basebmp::BitmapDeviceSharedPtr m_aDevice; + ClipUndoHandle( SvpSalGraphics *pGfx ) : m_rGfx( *pGfx ) {} + ~ClipUndoHandle(); + }; + ClipUndoHandle ensureClipFor( const basegfx::B2IRange &aRange ); + void ensureClip(); + +protected: + virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); + virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); + +public: + SvpSalGraphics(); + virtual ~SvpSalGraphics(); + + const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } + void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ); + + // overload all pure virtual methods + virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); + virtual sal_uInt16 GetBitCount() const; + virtual long GetGraphicsWidth() const; + + virtual void ResetClipRegion(); + virtual bool setClipRegion( const Region& ); + + virtual void SetLineColor(); + virtual void SetLineColor( SalColor nSalColor ); + virtual void SetFillColor(); + virtual void SetFillColor( SalColor nSalColor ); + + virtual void SetXORMode( bool bSet, bool ); + + virtual void SetROPLineColor( SalROPColor nROPColor ); + virtual void SetROPFillColor( SalROPColor nROPColor ); + + virtual void SetTextColor( SalColor nSalColor ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + virtual void GetDevFontList( ImplDevFontList* ); + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + sal_Int32* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo + ); + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + 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 bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolyPolygon( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + PCONSTSALPOINT* pPtAry ); + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + const SalPoint* const* pPtAry, + const sal_uInt8* const* pFlgAry ); + + virtual void copyArea( long nDestX, + long nDestY, + long nSrcX, + long nSrcY, + long nSrcWidth, + long nSrcHeight, + sal_uInt16 nFlags ); + 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 ); + virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx new file mode 100644 index 000000000000..34a9c7f8ba2e --- /dev/null +++ b/vcl/inc/headless/svpinst.hxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SALINST_HXX +#define _SVP_SALINST_HXX + +#include <vcl/solarmutex.hxx> + +#include <osl/mutex.hxx> +#include <osl/thread.hxx> +#include <salinst.hxx> +#include <salwtype.hxx> +#include <saltimer.hxx> +#include <generic/geninst.h> + +#include <list> + +#include <time.h> // timeval + +#define VIRTUAL_DESKTOP_WIDTH 1024 +#define VIRTUAL_DESKTOP_HEIGHT 768 +#define VIRTUAL_DESKTOP_DEPTH 24 + +// ------------------------------------------------------------------------- +// SalYieldMutex +// ------------------------------------------------------------------------- + +class SvpSalYieldMutex : public ::vcl::SolarMutexObject +{ +protected: + sal_uLong mnCount; + oslThreadIdentifier mnThreadId; + +public: + SvpSalYieldMutex(); + + virtual void acquire(); + virtual void release(); + virtual sal_Bool tryToAcquire(); + + sal_uLong GetAcquireCount() const { return mnCount; } + oslThreadIdentifier GetThreadId() const { return mnThreadId; } +}; + +// --------------- +// - SalTimer - +// --------------- +class SvpSalInstance; +class SvpSalTimer : public SalTimer +{ + SvpSalInstance* m_pInstance; +public: + SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {} + virtual ~SvpSalTimer(); + + // overload all pure virtual methods + virtual void Start( sal_uLong nMS ); + virtual void Stop(); +}; + +// --------------- +// - SalInstance - +// --------------- +class SvpSalFrame; +class SvpSalInstance : public SalGenericInstance +{ + timeval m_aTimeout; + sal_uLong m_nTimeoutMS; + int m_pTimeoutFDS[2]; + SvpSalYieldMutex m_aYieldMutex; + + // internal event queue + struct SalUserEvent + { + const SalFrame* m_pFrame; + void* m_pData; + sal_uInt16 m_nEvent; + + SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) + : m_pFrame( pFrame ), + m_pData( pData ), + m_nEvent( nEvent ) + {} + }; + + oslMutex m_aEventGuard; + std::list< SalUserEvent > m_aUserEvents; + + std::list< SalFrame* > m_aFrames; + + bool isFrameAlive( const SalFrame* pFrame ) const; + +public: + static SvpSalInstance* s_pDefaultInstance; + + SvpSalInstance(); + virtual ~SvpSalInstance(); + + void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + + void StartTimer( sal_uLong nMS ); + void StopTimer(); + void Wakeup(); + + void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); } + void deregisterFrame( SalFrame* pFrame ); + const std::list< SalFrame* >& getFrames() const { return m_aFrames; } + + bool CheckTimeout( bool bExecuteTimers = true ); + + // Frame + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); + virtual void DestroyFrame( SalFrame* pFrame ); + + // Object (System Child Window) + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); + virtual void DestroyObject( SalObject* pObject ); + + // VirtualDevice + // nDX and nDY in Pixel + // nBitCount: 0 == Default(=as window) / 1 == Mono + // pData allows for using a system dependent graphics or device context + virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, + long nDX, long nDY, + sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); + virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); + + // Printer + // pSetupData->mpDriverData can be 0 + // pSetupData must be updatet with the current + // JobSetup + virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pSetupData ); + virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); + virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); + virtual void DestroyPrinter( SalPrinter* pPrinter ); + + virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); + virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); + virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); + virtual String GetDefaultPrinter(); + virtual void PostPrintersChanged(); + + // SalTimer + virtual SalTimer* CreateSalTimer(); + // SalI18NImeStatus + virtual SalI18NImeStatus* CreateI18NImeStatus(); + // SalSystem + virtual SalSystem* CreateSalSystem(); + // SalBitmap + virtual SalBitmap* CreateSalBitmap(); + + // YieldMutex + virtual osl::SolarMutex* GetYieldMutex(); + virtual sal_uLong ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uLong nCount ); + virtual bool CheckYieldMutex(); + + // wait next event and dispatch + // must returned by UserEvent (SalFrame::PostEvent) + // and timer + virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); + virtual bool AnyInput( sal_uInt16 nType ); + + // may return NULL to disable session management + virtual SalSession* CreateSalSession(); + + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + + virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); + +}; + +#endif // _SV_SALINST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpprn.hxx b/vcl/inc/headless/svpprn.hxx new file mode 100644 index 000000000000..67861f6e6cb5 --- /dev/null +++ b/vcl/inc/headless/svpprn.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPPRN_HXX +#define _SVP_SVPPRN_HXX + +#include "vcl/jobdata.hxx" +#include "generic/printergfx.hxx" +#include "generic/printerjob.hxx" +#include "generic/genprn.h" + +#include "vclpluginapi.h" + +class PspGraphics; + +class SvpSalInfoPrinter : public PspSalInfoPrinter +{ +public: + virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); +}; + +class SvpSalPrinter : public PspSalPrinter +{ +public: + SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {} +}; + +#endif // _SVP_SVPPRN_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svppspgraphics.hxx b/vcl/inc/headless/svppspgraphics.hxx new file mode 100644 index 000000000000..1ce9109918d5 --- /dev/null +++ b/vcl/inc/headless/svppspgraphics.hxx @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_PSPGRAPHICS_HXX +#define _SVP_PSPGRAPHICS_HXX + + +#include "vcl/fontmanager.hxx" + +#include "sallayout.hxx" +#include "salgdi.hxx" + +namespace psp { struct JobData; class PrinterGfx; } + +class ServerFont; +class ImplDevFontAttributes; +class SalInfoPrinter; + +class PspGraphics : public SalGraphics +{ + psp::JobData* m_pJobData; + psp::PrinterGfx* m_pPrinterGfx; + String* m_pPhoneNr; + bool m_bSwallowFaxNo; + String m_aPhoneCollection; + bool m_bPhoneCollectionActive; + + ServerFont* m_pServerFont[ MAX_FALLBACK ]; + bool m_bFontVertical; + SalInfoPrinter* m_pInfoPrinter; + +protected: + virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); + virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); + +public: + PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter ) + : m_pJobData( pJob ), + m_pPrinterGfx( pGfx ), + m_pPhoneNr( pPhone ), + m_bSwallowFaxNo( bSwallow ), + m_bPhoneCollectionActive( false ), + m_bFontVertical( false ), + m_pInfoPrinter( pInfoPrinter ) + { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; } + virtual ~PspGraphics(); + + // helper methods for sharing with X11SalGraphics + static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ); + static void DoFreeEmbedFontData( const void* pData, long nLen ); + static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded ); + static void DoGetGlyphWidths( psp::fontID aFont, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& ); + static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& ); + + // overload all pure virtual methods + virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); + virtual sal_uInt16 GetBitCount() const; + virtual long GetGraphicsWidth() const; + + virtual void ResetClipRegion(); + virtual bool setClipRegion( const Region& ); + + virtual void SetLineColor(); + virtual void SetLineColor( SalColor nSalColor ); + virtual void SetFillColor(); + virtual void SetFillColor( SalColor nSalColor ); + virtual void SetXORMode( bool bSet, bool ); + virtual void SetROPLineColor( SalROPColor nROPColor ); + virtual void SetROPFillColor( SalROPColor nROPColor ); + + virtual void SetTextColor( SalColor nSalColor ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + virtual void GetDevFontList( ImplDevFontList* ); + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + sal_Int32* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo + ); + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + 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( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual void drawPolyPolygon( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + PCONSTSALPOINT* pPtAry ); + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + const SalPoint* const* pPtAry, + const sal_uInt8* const* pFlgAry ); + + virtual void copyArea( long nDestX, + long nDestY, + long nSrcX, + long nSrcY, + long nSrcWidth, + long nSrcHeight, + sal_uInt16 nFlags ); + 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 ); + virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); + virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; +}; + +#endif // _SVP_PSPGRAPHICS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/headless/svpvd.hxx b/vcl/inc/headless/svpvd.hxx new file mode 100644 index 000000000000..211cf36846f9 --- /dev/null +++ b/vcl/inc/headless/svpvd.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPVD_HXX +#define _SVP_SVPVD_HXX + +#include <salvd.hxx> +#include "svpelement.hxx" + +#include <list> + +class SvpSalGraphics; + +class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement +{ + sal_uInt16 m_nBitCount; + basebmp::BitmapDeviceSharedPtr m_aDevice; + std::list< SvpSalGraphics* > m_aGraphics; + +public: + SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} + virtual ~SvpSalVirtualDevice(); + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } + + // SalVirtualDevice + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +#endif // _SVP_SVPVD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |