Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SV_SALVD_H
30 : : #define _SV_SALVD_H
31 : :
32 : : #include <unx/salstd.hxx>
33 : : #include <unx/saltype.h>
34 : : #include <salvd.hxx>
35 : :
36 : : // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
37 : : class SalDisplay;
38 : : class X11SalGraphics;
39 : :
40 : : // -=-= SalVirDevData -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
41 : : class X11SalVirtualDevice : public SalVirtualDevice
42 : : {
43 : : SalDisplay *pDisplay_;
44 : : X11SalGraphics *pGraphics_;
45 : :
46 : :
47 : : Pixmap hDrawable_;
48 : : SalX11Screen m_nXScreen;
49 : :
50 : : int nDX_;
51 : : int nDY_;
52 : : sal_uInt16 nDepth_;
53 : : sal_Bool bGraphics_; // is Graphics used
54 : : sal_Bool bExternPixmap_;
55 : :
56 : : public:
57 : : X11SalVirtualDevice();
58 : : virtual ~X11SalVirtualDevice();
59 : :
60 : : sal_Bool Init( SalDisplay *pDisplay,
61 : : long nDX, long nDY,
62 : : sal_uInt16 nBitCount,
63 : : SalX11Screen nXScreen,
64 : : Pixmap hDrawable = None,
65 : : XRenderPictFormat* pXRenderFormat = NULL );
66 : : inline void InitGraphics( X11SalVirtualDevice *pVD );
67 : :
68 : : inline Display *GetXDisplay() const;
69 : : inline SalDisplay *GetDisplay() const;
70 : : inline sal_Bool IsDisplay() const;
71 : 0 : inline Pixmap GetDrawable() const { return hDrawable_; }
72 : 0 : inline sal_uInt16 GetDepth() const { return nDepth_; }
73 : 0 : int GetWidth() const { return nDX_; }
74 : 0 : int GetHeight() const { return nDY_; }
75 : 0 : SalX11Screen GetXScreenNumber() const { return m_nXScreen; }
76 : :
77 : : virtual SalGraphics* GetGraphics();
78 : : virtual void ReleaseGraphics( SalGraphics* pGraphics );
79 : :
80 : : // Set new size, without saving the old contents
81 : : virtual sal_Bool SetSize( long nNewDX, long nNewDY );
82 : : virtual void GetSize( long& rWidth, long& rHeight );
83 : : };
84 : :
85 : : #ifdef _SV_SALDISP_HXX
86 : :
87 : 0 : inline void X11SalVirtualDevice::InitGraphics( X11SalVirtualDevice *pVD )
88 : 0 : { pGraphics_->Init( pVD ); }
89 : :
90 : 0 : inline Display *X11SalVirtualDevice::GetXDisplay() const
91 : 0 : { return pDisplay_->GetDisplay(); }
92 : :
93 : 0 : inline SalDisplay *X11SalVirtualDevice::GetDisplay() const
94 : 0 : { return pDisplay_; }
95 : :
96 : : inline sal_Bool X11SalVirtualDevice::IsDisplay() const
97 : : { return pDisplay_->IsDisplay(); }
98 : :
99 : : #endif
100 : :
101 : : #endif // _SV_SALVD_H
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|