Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : */
9 :
10 : #include <config_features.h>
11 :
12 : #include <sdr/contact/viewobjectcontactofopenglobj.hxx>
13 : #include <sdr/contact/viewcontactofopenglobj.hxx>
14 :
15 : #include <svdoopengl.hxx>
16 : #include <vcl/outdev.hxx>
17 : #include <vcl/window.hxx>
18 :
19 : using namespace sdr::contact;
20 :
21 :
22 0 : ViewObjectContactOfOpenGLObj::ViewObjectContactOfOpenGLObj(
23 : ObjectContact& rObjectContact, ViewContact& rViewContact )
24 0 : : ViewObjectContactOfSdrObj( rObjectContact, rViewContact )
25 : {
26 : #if HAVE_FEATURE_DESKTOP
27 0 : OpenGLContext* pContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext();
28 0 : if (pContext)
29 0 : pContext->init(getWindow());
30 : #endif
31 0 : }
32 :
33 0 : ViewObjectContactOfOpenGLObj::~ViewObjectContactOfOpenGLObj()
34 : {
35 0 : }
36 :
37 0 : vcl::Window* ViewObjectContactOfOpenGLObj::getWindow() const
38 : {
39 0 : vcl::Window* pRetval = 0;
40 :
41 0 : boost::optional<const OutputDevice&> oPageOutputDev = getPageViewOutputDevice();
42 0 : if( oPageOutputDev )
43 : {
44 0 : if(OUTDEV_WINDOW == oPageOutputDev->GetOutDevType())
45 : {
46 0 : pRetval = static_cast< vcl::Window* >(&const_cast<OutputDevice&>(oPageOutputDev.get()));
47 : }
48 : }
49 :
50 0 : return pRetval;
51 : }
52 :
53 :
54 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|