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 #ifndef INCLUDED_VCL_OPENGLWIN_HXX
11 #define INCLUDED_VCL_OPENGLWIN_HXX
13 #include <vcl/event.hxx>
14 #include <vcl/syschild.hxx>
15 #include <vcl/dllapi.h>
18 class OpenGLWindowImpl
;
20 class VCL_DLLPUBLIC IRenderer
23 virtual ~IRenderer() {}
24 virtual void update() = 0;
25 virtual void clickedAt(const Point
& rPos
, sal_uInt16 nButtons
) = 0;
26 virtual void mouseDragMove(const Point
& rPosBegin
, const Point
& rPosEnd
, sal_uInt16 nButtons
) = 0;
27 virtual void scroll(long nDelta
) = 0;
29 virtual void contextDestroyed() = 0;
32 // pImpl Pattern to avoid linking against OpenGL libs when using the class without the context
33 class VCL_DLLPUBLIC OpenGLWindow
: public vcl::Window
36 OpenGLWindow(vcl::Window
* pParent
);
37 virtual ~OpenGLWindow();
38 virtual void dispose() SAL_OVERRIDE
;
40 OpenGLContext
& getContext();
42 void setRenderer(IRenderer
* pRenderer
);
44 virtual void Paint(vcl::RenderContext
& rRenderContext
, const Rectangle
&) SAL_OVERRIDE
;
46 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
47 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
48 virtual void MouseMove( const MouseEvent
& rMEvt
) SAL_OVERRIDE
;
49 virtual void Command( const CommandEvent
& rCEvt
) SAL_OVERRIDE
;
52 std::unique_ptr
<OpenGLWindowImpl
> mxImpl
;
53 IRenderer
* mpRenderer
;
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */