summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-03-17 22:03:14 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-03-17 23:48:28 +0100
commit374efa7253703b054e4603c66aeba862e4e98574 (patch)
tree9a5dfebe75f425cfae3c264862c6acdb913dcd05 /svx
parentca25cdcb398f200ce5d53286eea02d49d8d1c5f4 (diff)
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
Diffstat (limited to 'svx')
-rw-r--r--svx/Library_svxcore.mk1
-rw-r--r--svx/source/sdr/contact/viewcontactofopengl.cxx44
-rw-r--r--svx/source/svdraw/svdobj.cxx2
-rw-r--r--svx/source/unodraw/unomod.cxx4
-rw-r--r--svx/source/unodraw/unopage.cxx3
-rw-r--r--svx/source/unodraw/unoprov.cxx1
6 files changed, 55 insertions, 0 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 968c92220c42..4b59047b94e9 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -159,6 +159,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/sdr/contact/viewobjectcontactofpageobj \
svx/source/sdr/contact/viewobjectcontactofe3dscene \
svx/source/sdr/contact/viewcontactofgraphic \
+ svx/source/sdr/contact/viewcontactofopengl \
svx/source/sdr/contact/viewobjectcontactredirector \
svx/source/sdr/contact/viewcontactofsdrcircobj \
svx/source/sdr/contact/viewcontactofgroup \
diff --git a/svx/source/sdr/contact/viewcontactofopengl.cxx b/svx/source/sdr/contact/viewcontactofopengl.cxx
new file mode 100644
index 000000000000..34630ec5bfa6
--- /dev/null
+++ b/svx/source/sdr/contact/viewcontactofopengl.cxx
@@ -0,0 +1,44 @@
+/* -*- 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/.
+ */
+
+#include <com/sun/star/drawing/XShape.hpp>
+#include <svx/sdr/contact/viewcontactofopengl.hxx>
+#include <drawinglayer/primitive2d/openglprimitive2d.hxx>
+#include <svx/svdoopengl.hxx>
+#include <tools/gen.hxx>
+
+
+namespace sdr
+{
+ namespace contact
+ {
+
+ ViewContactOfOpenGL::ViewContactOfOpenGL(SdrOpenGLObj& rOpenGLObj)
+ : ViewContactOfSdrObj(rOpenGLObj)
+ {
+ }
+
+ ViewContactOfOpenGL::~ViewContactOfOpenGL()
+ {
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfOpenGL::createViewIndependentPrimitive2DSequence() const
+ {
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape(GetSdrObject().getUnoShape(), com::sun::star::uno::UNO_QUERY);
+ const Point aPos(xShape->getPosition().X,xShape->getPosition().Y);
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::OpenGLPrimitive2D(aPos));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index c368553177c3..eaf24ac4ce3d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -126,6 +126,7 @@
#include <svx/xlnwtit.hxx>
#include <svx/xpoly.hxx>
#include <rtl/strbuf.hxx>
+#include <svx/svdoopengl.hxx>
using namespace ::com::sun::star;
@@ -3395,6 +3396,7 @@ SdrObject* SdrObjFactory::MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, S
case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(); break;
case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(); break;
case sal_uInt16(OBJ_TABLE ): pObj=new ::sdr::table::SdrTableObj(pModel); break;
+ case sal_uInt16(OBJ_OPENGL ): pObj=new SdrOpenGLObj; break;
}
}
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 9b5a3d6f45e9..6a86ce4122b0 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -493,6 +493,10 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c
{
nType = OBJ_TABLE;
}
+ else if( aTypeName.startsWith( "OpenGLObject" ) )
+ {
+ nType = OBJ_OPENGL;
+ }
else
{
throw lang::ServiceNotRegisteredException();
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 26e04683fff8..43522065986d 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -738,6 +738,9 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt3
case OBJ_TABLE:
pRet = new SvxTableShape( pObj );
break;
+ case OBJ_OPENGL:
+ pRet = new SvxOpenGLObject( pObj );
+ break;
default: // unbekanntes 2D-Objekt auf der Page
OSL_FAIL("Nicht implementierter Starone-Shape erzeugt! [CL]");
pRet = new SvxShapeText( pObj );
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index f7a385519d55..61518d2b44c8 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -843,6 +843,7 @@ namespace {
{ RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DLatheObject"), E3D_LATHEOBJ_ID | E3D_INVENTOR_FLAG },
{ RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject"), E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG },
{ RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DPolygonObject"), E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG },
+ { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenGLObject"), OBJ_OPENGL },
};
for (sal_uInt32 i = 0; i < sizeof(aInit)/sizeof(aInit[0]); i++)
aImpl[OUString( aInit[i].name, aInit[i].length, RTL_TEXTENCODING_ASCII_US ) ] = aInit[i].id;