From 374efa7253703b054e4603c66aeba862e4e98574 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Mon, 17 Mar 2014 22:03:14 +0100 Subject: Skeleton of drawinglayer object called OpenGLObject - Shape name: com.sun.star.drawing.OpenGLObject - Drawinglayer object: SdrOpenGLObject - Uno object: SvxOpenGLObject - View contact: ViewContactOfOpenGL - Primitive: OpenGLPrimitive2D Change-Id: I7fc0829d58cb4a8432d0e3007c90223707e5dd84 --- .../primitive2d/drawinglayer_primitivetypes2d.hxx | 1 + .../drawinglayer/primitive2d/openglprimitive2d.hxx | 42 ++++++++++++++++++++++ include/svx/sdr/contact/viewcontactofopengl.hxx | 35 ++++++++++++++++++ include/svx/svdobj.hxx | 1 + include/svx/svdoopengl.hxx | 27 ++++++++++++++ include/svx/unoshape.hxx | 7 ++++ 6 files changed, 113 insertions(+) create mode 100644 include/drawinglayer/primitive2d/openglprimitive2d.hxx create mode 100644 include/svx/sdr/contact/viewcontactofopengl.hxx create mode 100644 include/svx/svdoopengl.hxx (limited to 'include') diff --git a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 68357caeedeb..088d60e50cbd 100644 --- a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -103,6 +103,7 @@ #define PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68) #define PRIMITIVE2D_ID_POLYPOLYGONSELECTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 69) #define PRIMITIVE2D_ID_CLIPPEDBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 70) +#define PRIMITIVE2D_ID_OPENGLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 71) diff --git a/include/drawinglayer/primitive2d/openglprimitive2d.hxx b/include/drawinglayer/primitive2d/openglprimitive2d.hxx new file mode 100644 index 000000000000..c251dcb06e4f --- /dev/null +++ b/include/drawinglayer/primitive2d/openglprimitive2d.hxx @@ -0,0 +1,42 @@ +/* -*- 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_DRAWINGLAYER_PRIMITIVE2D_OPENGL_PRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_OPENGL_PRIMITIVE2D_HXX + +#include +#include + +namespace drawinglayer +{ + namespace primitive2d + { + + class DRAWINGLAYER_DLLPUBLIC OpenGLPrimitive2D : public BasePrimitive2D + { + public: + explicit OpenGLPrimitive2D(const Point& rPos); + + const Point& getPos() const { return m_aPos; } + + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + /// provide unique ID + DeclPrimitive2DIDBlock() + + private: + Point m_aPos; + }; + + } +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofopengl.hxx b/include/svx/sdr/contact/viewcontactofopengl.hxx new file mode 100644 index 000000000000..ad96b0c03ea4 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofopengl.hxx @@ -0,0 +1,35 @@ +/* -*- 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_SVX_SDR_CONTACT_VIEWCONTACTOFOPENGL_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFOPENGL_HXX + +#include + +class SdrOpenGLObj; + +namespace sdr +{ + namespace contact + { + class ViewContactOfOpenGL : public ViewContactOfSdrObj + { + public: + explicit ViewContactOfOpenGL(SdrOpenGLObj& rOpenGLObj); + virtual ~ViewContactOfOpenGL(); + + protected: + virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const; + }; + } +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index a6558b9b3fae..ddd6dcca28c5 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -134,6 +134,7 @@ enum SdrObjKind {OBJ_NONE = 0, // abstract object (SdrObject) OBJ_CUSTOMSHAPE=33, // custom shape OBJ_MEDIA =34, // media shape OBJ_TABLE =35, // table + OBJ_OPENGL =36, // opengl graphic OBJ_MAXI}; enum SdrUserCallType {SDRUSERCALL_MOVEONLY, // only moved, size unchanged diff --git a/include/svx/svdoopengl.hxx b/include/svx/svdoopengl.hxx new file mode 100644 index 000000000000..6a6b1d1265c5 --- /dev/null +++ b/include/svx/svdoopengl.hxx @@ -0,0 +1,27 @@ +/* -*- 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_SVX_SVDO_OPENGL_HXX +#define INCLUDED_SVX_SVDO_OPENGL_HXX + +#include +#include + +class SVX_DLLPUBLIC SdrOpenGLObj : public SdrObject +{ +public: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() + { + return new sdr::contact::ViewContactOfOpenGL(*this); + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index 1f2056c3d9a9..bcf2b6231ea3 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -875,6 +875,13 @@ private: OUString referer_; }; +class SvxOpenGLObject : public SvxShape +{ +public: + SvxOpenGLObject( SdrObject* pObj ) throw() : SvxShape(pObj){} + virtual ~SvxOpenGLObject() throw() {} +}; + /* * This is a really ugly hack for the chart2 OpenGL backend * SvxShapeGroup::add only accepts objects derived from SvxShape and silently drops -- cgit