merge the formfield patch from ooo-build
[ooovba.git] / vcl / unx / inc / salvd.h
blobb72cb37caddf91c769652bddb8dc0a41f799f0a4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: salvd.h,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SV_SALVD_H
32 #define _SV_SALVD_H
34 // -=-= #includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
35 #include <salstd.hxx>
36 #include <vcl/salvd.hxx>
38 // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
39 class SalDisplay;
40 class X11SalGraphics;
42 // -=-= SalVirDevData -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
43 class X11SalVirtualDevice : public SalVirtualDevice
45 SalDisplay *pDisplay_;
46 X11SalGraphics *pGraphics_;
49 Pixmap hDrawable_;
50 int m_nScreen;
52 int nDX_;
53 int nDY_;
54 USHORT nDepth_;
55 BOOL bGraphics_; // is Graphics used
56 BOOL bExternPixmap_;
58 public:
59 X11SalVirtualDevice();
60 virtual ~X11SalVirtualDevice();
62 BOOL Init( SalDisplay *pDisplay,
63 long nDX, long nDY,
64 USHORT nBitCount,
65 int nScreen,
66 Pixmap hDrawable = None,
67 void* pRenderFormat = NULL );
68 inline void InitGraphics( X11SalVirtualDevice *pVD );
70 inline Display *GetXDisplay() const;
71 inline SalDisplay *GetDisplay() const;
72 inline BOOL IsDisplay() const;
73 inline Pixmap GetDrawable() const { return hDrawable_; }
74 inline USHORT GetDepth() const { return nDepth_; }
75 int GetWidth() const { return nDX_; }
76 int GetHeight() const { return nDY_; }
77 int GetScreenNumber() const { return m_nScreen; }
79 virtual SalGraphics* GetGraphics();
80 virtual void ReleaseGraphics( SalGraphics* pGraphics );
82 // Set new size, without saving the old contents
83 virtual BOOL SetSize( long nNewDX, long nNewDY );
84 virtual void GetSize( long& rWidth, long& rHeight );
87 #ifdef _SV_SALDISP_HXX
89 inline void X11SalVirtualDevice::InitGraphics( X11SalVirtualDevice *pVD )
90 { pGraphics_->Init( pVD ); }
92 inline Display *X11SalVirtualDevice::GetXDisplay() const
93 { return pDisplay_->GetDisplay(); }
95 inline SalDisplay *X11SalVirtualDevice::GetDisplay() const
96 { return pDisplay_; }
98 inline BOOL X11SalVirtualDevice::IsDisplay() const
99 { return pDisplay_->IsDisplay(); }
101 #endif
103 #endif // _SV_SALVD_H