diff options
-rw-r--r-- | include/svx/svdoopengl.hxx | 12 | ||||
-rw-r--r-- | include/svx/unoshape.hxx | 4 | ||||
-rw-r--r-- | include/vcl/IOpenGLRenderer.hxx | 23 | ||||
-rw-r--r-- | svx/source/svdraw/svdoopengl.cxx | 15 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 12 |
5 files changed, 66 insertions, 0 deletions
diff --git a/include/svx/svdoopengl.hxx b/include/svx/svdoopengl.hxx index 68428da279c1..7760b823717d 100644 --- a/include/svx/svdoopengl.hxx +++ b/include/svx/svdoopengl.hxx @@ -13,22 +13,34 @@ #include <svx/svdobj.hxx> #include <vcl/OpenGLContext.hxx> +#include <vcl/IOpenGLRenderer.hxx> + +#include <boost/scoped_ptr.hpp> + namespace sdr { namespace contact { class ViewContact; } } +class IOpenGLRenderer; + class SVX_DLLPUBLIC SdrOpenGLObj : public SdrObject { public: + virtual ~SdrOpenGLObj(); virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE; OpenGLContext& getOpenGLContext(); virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE; + void setRenderer(IOpenGLRenderer* pRenderer); + IOpenGLRenderer* getRenderer(); + private: OpenGLContext maContext; + + boost::scoped_ptr<IOpenGLRenderer> mpRenderer; }; #endif diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index 54a784ceb6a4..60775f662a45 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -66,6 +66,7 @@ class SdrModel; class SvxDrawPage; class SvGlobalName; class Pair; +class IOpenGLRenderer; // Dimension arrows change size/position on save/reload (#i59051#) namespace basegfx @@ -881,6 +882,9 @@ class SvxOpenGLObject : public SvxShape public: SvxOpenGLObject( SdrObject* pObj ) throw() : SvxShape(pObj){} virtual ~SvxOpenGLObject() throw() {} + + void setRenderer(IOpenGLRenderer* pRenderer); + IOpenGLRenderer* getRenderer(); }; /* diff --git a/include/vcl/IOpenGLRenderer.hxx b/include/vcl/IOpenGLRenderer.hxx new file mode 100644 index 000000000000..92ce0648f843 --- /dev/null +++ b/include/vcl/IOpenGLRenderer.hxx @@ -0,0 +1,23 @@ +/* -*- 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 VCL_IOPENGLRENDER_HXX +#define VCL_IOPENGLRENDER_HXX + +class IOpenGLRenderer +{ +public: + virtual ~IOpenGLRenderer(); + virtual void operator()() = 0; + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdoopengl.cxx b/svx/source/svdraw/svdoopengl.cxx index 45d23ae4734e..df2f07b7d04b 100644 --- a/svx/source/svdraw/svdoopengl.cxx +++ b/svx/source/svdraw/svdoopengl.cxx @@ -10,6 +10,12 @@ #include <svx/svdoopengl.hxx> #include <svx/sdr/contact/viewcontactofopenglobj.hxx> +#include <vcl/IOpenGLRenderer.hxx> + +SdrOpenGLObj::~SdrOpenGLObj() +{ +} + sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact() { return new sdr::contact::ViewContactOfOpenGLObj(*this); @@ -29,5 +35,14 @@ void SdrOpenGLObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fra SAL_WARN("svx.opengl", "resized opengl drawinglayer object"); } +void SdrOpenGLObj::setRenderer(IOpenGLRenderer* pRenderer) +{ + mpRenderer.reset(pRenderer); +} + +IOpenGLRenderer* SdrOpenGLObj::getRenderer() +{ + return mpRenderer.get(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 239328d6ccab..40a206760e3e 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -50,6 +50,7 @@ #include "svx/svdview.hxx" #include "svx/svdglob.hxx" #include "svx/svdstr.hrc" +#include <svx/svdoopengl.hxx> #include <vcl/wmf.hxx> @@ -968,4 +969,15 @@ SvxDummyShapeContainer::SvxDummyShapeContainer(uno::Reference< drawing::XShapes SvxDummyShapeContainer::~SvxDummyShapeContainer() throw() { } + +void SvxOpenGLObject::setRenderer(IOpenGLRenderer* pRenderer) +{ + static_cast<SdrOpenGLObj*>(GetSdrObject())->setRenderer(pRenderer); +} + +IOpenGLRenderer* SvxOpenGLObject::getRenderer() +{ + return static_cast<SdrOpenGLObj*>(GetSdrObject())->getRenderer(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |