xref: /aoo4110/main/vcl/inc/unx/salvd.h (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SALVD_H
25 #define _SV_SALVD_H
26 
27 // -=-= #includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
28 #include <unx/salstd.hxx>
29 #include <salvd.hxx>
30 
31 // -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
32 class SalDisplay;
33 class X11SalGraphics;
34 
35 // -=-= SalVirDevData -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
36 class X11SalVirtualDevice : public SalVirtualDevice
37 {
38     SalDisplay		*pDisplay_;
39     X11SalGraphics	*pGraphics_;
40 
41 
42     Pixmap			hDrawable_;
43     int             m_nScreen;
44 
45     int				nDX_;
46     int				nDY_;
47     sal_uInt16			nDepth_;
48     sal_Bool			bGraphics_;			// is Graphics used
49 	sal_Bool            bExternPixmap_;
50 
51 public:
52 	X11SalVirtualDevice();
53     virtual ~X11SalVirtualDevice();
54 
55     sal_Bool			Init( SalDisplay *pDisplay,
56                           long nDX, long nDY,
57                           sal_uInt16 nBitCount,
58                           int nScreen,
59 						  Pixmap hDrawable = None,
60 						  void* pRenderFormat = NULL );
61 	inline	void			InitGraphics( X11SalVirtualDevice *pVD );
62 
63 	inline	Display		   *GetXDisplay() const;
64 	inline	SalDisplay	   *GetDisplay() const;
65 	inline	sal_Bool			IsDisplay() const;
GetDrawable() const66 	inline	Pixmap			GetDrawable() const { return hDrawable_; }
GetDepth() const67 	inline	sal_uInt16			GetDepth() const { return nDepth_; }
GetWidth() const68     int						GetWidth() const { return nDX_; }
GetHeight() const69     int						GetHeight() const { return nDY_; }
GetScreenNumber() const70     int                     GetScreenNumber() const { return m_nScreen; }
71 
72     virtual SalGraphics*	GetGraphics();
73     virtual void			ReleaseGraphics( SalGraphics* pGraphics );
74 
75                             // Set new size, without saving the old contents
76     virtual sal_Bool			SetSize( long nNewDX, long nNewDY );
77     virtual void			GetSize( long& rWidth, long& rHeight );
78 };
79 
80 #ifdef _SV_SALDISP_HXX
81 
InitGraphics(X11SalVirtualDevice * pVD)82 inline void X11SalVirtualDevice::InitGraphics( X11SalVirtualDevice *pVD )
83 { pGraphics_->Init( pVD ); }
84 
GetXDisplay() const85 inline Display *X11SalVirtualDevice::GetXDisplay() const
86 { return pDisplay_->GetDisplay(); }
87 
GetDisplay() const88 inline SalDisplay *X11SalVirtualDevice::GetDisplay() const
89 { return pDisplay_; }
90 
IsDisplay() const91 inline sal_Bool X11SalVirtualDevice::IsDisplay() const
92 { return pDisplay_->IsDisplay(); }
93 
94 #endif
95 
96 #endif // _SV_SALVD_H
97 
98