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/saldisp.hxx>
14 #include <unx/salgdi.h>
15 #include <unx/salvd.h>
17 #include <opengl/x11/salvd.hxx>
19 void X11SalGraphics::Init( X11OpenGLSalVirtualDevice
*pDevice
)
21 SalDisplay
*pDisplay
= pDevice
->GetDisplay();
23 m_nXScreen
= pDevice
->GetXScreenNumber();
24 m_pColormap
= &pDisplay
->GetColormap( m_nXScreen
);
29 bWindow_
= pDisplay
->IsDisplay();
35 X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics
const * pGraphics
,
37 const SystemGraphicsData
*pData
,
38 X11SalGraphics
* pNewGraphics
) :
39 mpGraphics(pNewGraphics
),
45 // TODO Check where a VirtualDevice is created from SystemGraphicsData
46 assert( pData
== nullptr ); (void)pData
;
48 mpDisplay
= vcl_sal::getSalDisplay(GetGenericUnixSalData());
49 mnXScreen
= pGraphics
? static_cast<X11SalGraphics
const *>(pGraphics
)->GetScreenNumber() :
50 vcl_sal::getSalDisplay(GetGenericUnixSalData())->GetDefaultXScreen();
53 mpGraphics
->Init( this );
56 X11OpenGLSalVirtualDevice::~X11OpenGLSalVirtualDevice()
60 SalGraphics
* X11OpenGLSalVirtualDevice::AcquireGraphics()
68 return mpGraphics
.get();
71 void X11OpenGLSalVirtualDevice::ReleaseGraphics( SalGraphics
* )
77 bool X11OpenGLSalVirtualDevice::SetSize( long nDX
, long nDY
)
85 mpGraphics
->Init( this );
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */