1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <vcl/sysdata.hxx>
12 #include <unx/salunx.h>
13 #include <unx/saldata.hxx>
14 #include <unx/saldisp.hxx>
15 #include <unx/salgdi.h>
16 #include <unx/salvd.h>
18 #include <opengl/x11/salvd.hxx>
20 void X11SalGraphics::Init( X11OpenGLSalVirtualDevice
*pDevice
)
22 SalDisplay
*pDisplay
= pDevice
->GetDisplay();
24 m_nXScreen
= pDevice
->GetXScreenNumber();
25 m_pColormap
= &pDisplay
->GetColormap( m_nXScreen
);
30 bWindow_
= pDisplay
->IsDisplay();
36 X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics
* pGraphics
,
39 const SystemGraphicsData
*pData
) :
43 // TODO Do we really need the requested bit count?
44 if( !nBitCount
&& pGraphics
)
45 nBitCount
= pGraphics
->GetBitCount();
47 // TODO Check where a VirtualDevice is created from SystemGraphicsData
48 assert( pData
== NULL
); (void)pData
;
50 mpDisplay
= vcl_sal::getSalDisplay(GetGenericData());
52 mnXScreen
= pGraphics
? static_cast<X11SalGraphics
*>(pGraphics
)->GetScreenNumber() :
53 vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen();
56 mpGraphics
= new X11SalGraphics();
57 mpGraphics
->SetLayout( SalLayoutFlags::NONE
);
58 mpGraphics
->Init( this );
61 X11OpenGLSalVirtualDevice::~X11OpenGLSalVirtualDevice()
67 SalGraphics
* X11OpenGLSalVirtualDevice::AcquireGraphics()
78 void X11OpenGLSalVirtualDevice::ReleaseGraphics( SalGraphics
* )
84 bool X11OpenGLSalVirtualDevice::SetSize( long nDX
, long nDY
)
92 mpGraphics
->Init( this );
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */