2014-05-07 03:45:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_VCL_OPENGLWIN_HXX
|
|
|
|
#define INCLUDED_VCL_OPENGLWIN_HXX
|
|
|
|
|
2014-05-24 16:43:05 +01:00
|
|
|
#include <vcl/event.hxx>
|
2014-05-07 03:45:41 +02:00
|
|
|
#include <vcl/syschild.hxx>
|
2014-05-07 04:16:54 +02:00
|
|
|
#include <vcl/vclopengl_dllapi.hxx>
|
2014-05-07 03:45:41 +02:00
|
|
|
|
2014-05-07 04:16:54 +02:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
|
|
class OpenGLContext;
|
|
|
|
class OpenGLWindowImpl;
|
|
|
|
|
2014-05-13 05:12:55 +02:00
|
|
|
class VCLOPENGL_DLLPUBLIC IRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IRenderer() {}
|
|
|
|
virtual void update() = 0;
|
2014-05-26 03:20:12 +02:00
|
|
|
virtual void clickedAt(const Point& rPos, sal_uInt16 nButtons) = 0;
|
2014-05-24 23:28:06 +02:00
|
|
|
virtual void mouseDragMove(const Point& rPosBegin, const Point& rPosEnd, sal_uInt16 nButtons) = 0;
|
|
|
|
virtual void scroll(long nDelta) = 0;
|
2014-05-23 01:19:19 +02:00
|
|
|
|
|
|
|
virtual void contextDestroyed() = 0;
|
2014-05-13 05:12:55 +02:00
|
|
|
};
|
|
|
|
|
2014-05-07 04:16:54 +02:00
|
|
|
// pImpl Pattern to avoid linking against OpenGL libs when using the class without the context
|
2014-09-23 11:20:40 +02:00
|
|
|
class VCLOPENGL_DLLPUBLIC OpenGLWindow : public vcl::Window
|
2014-05-07 03:45:41 +02:00
|
|
|
{
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
OpenGLWindow(vcl::Window* pParent);
|
2014-05-07 21:55:39 +02:00
|
|
|
virtual ~OpenGLWindow();
|
2014-06-18 12:14:29 +02:00
|
|
|
OpenGLContext& getContext();
|
2014-05-07 03:45:41 +02:00
|
|
|
|
2014-05-13 05:12:55 +02:00
|
|
|
void setRenderer(IRenderer* pRenderer);
|
|
|
|
|
|
|
|
virtual void Paint(const Rectangle&) SAL_OVERRIDE;
|
2014-05-24 16:43:05 +01:00
|
|
|
|
2014-05-10 08:24:54 +02:00
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
|
2014-05-24 16:43:05 +01:00
|
|
|
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
|
|
|
|
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
|
2014-05-24 23:28:06 +02:00
|
|
|
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
|
2014-05-09 03:55:06 +02:00
|
|
|
|
2014-05-07 03:45:41 +02:00
|
|
|
private:
|
2014-05-07 04:16:54 +02:00
|
|
|
boost::scoped_ptr<OpenGLWindowImpl> mpImpl;
|
2014-05-13 05:12:55 +02:00
|
|
|
IRenderer* mpRenderer;
|
2014-05-24 23:28:06 +02:00
|
|
|
|
|
|
|
Point maStartPoint;
|
2014-05-07 03:45:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|