Kaydet (Commit) 7070318e authored tarafından Markus Mohrhard's avatar Markus Mohrhard

it builds again

Change-Id: I969ff5ed6fd979e9fd126e8d0b79a518697e7915
üst e8575148
......@@ -24,6 +24,7 @@ $(eval $(call gb_Library_use_libraries,chartopengl,\
cppu \
cppuhelper \
sal \
vcl \
$(gb_UWINAPI) \
))
......@@ -43,6 +44,8 @@ else ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,chartopengl,\
-ldl \
-lGL \
-lGLU \
-lX11 \
))
endif
......
......@@ -227,6 +227,8 @@ public:
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage ) = 0;
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize ) = 0;
virtual void createSeries( const com::sun::star::uno::Reference<
com::sun::star::drawing::XShapes> & xTarget,
......
......@@ -56,6 +56,39 @@
#include <vector>
#include <map>
#include <boost/scoped_ptr.hpp>
#include <GL/gl.h>
#include <GL/glu.h>
#include <vcl/window.hxx>
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
#if defined( _WIN32 )
#include <GL/glu.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#elif defined( MACOSX )
#include "premac.h"
#include <Cocoa/Cocoa.h>
#include "postmac.h"
#elif defined( UNX )
#include <GL/glu.h>
#include <GL/glext.h>
namespace unx
{
#include <X11/keysym.h>
#include <X11/X.h>
#define GLX_GLXEXT_PROTOTYPES 1
#include <GL/glx.h>
#include <GL/glxext.h>
}
#endif
class SystemWindow;
class SystemChildWindow;
using namespace com::sun::star;
......@@ -354,12 +387,53 @@ private:
class DummyChart : public DummyXShapes
{
public:
DummyChart();
virtual DummyChart* getRootShape();
OpenglContext* getGlContext() { return mpContext; }
virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
private:
/// Holds the information of our new child window
struct GLWindow
{
#if defined( _WIN32 )
HWND hWnd;
HDC hDC;
HGLRC hRC;
#elif defined( MACOSX )
#elif defined( UNX )
unx::Display* dpy;
int screen;
unx::Window win;
#if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
unx::GLXFBConfig fbc;
#endif
unx::XVisualInfo* vi;
unx::GLXContext ctx;
bool HasGLXExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, (const GLubyte*) GLXExtensions ); }
const char* GLXExtensions;
#endif
unsigned int bpp;
unsigned int Width;
unsigned int Height;
const GLubyte* GLExtensions;
bool HasGLExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, GLExtensions ); }
} GLWin; /// Holds the information of our new child window
void createGLContext();
bool initWindow();
bool initOpengl();
OpenglContext* mpContext;
boost::scoped_ptr<Window> mpWindow;
boost::scoped_ptr<SystemChildWindow> pWindow;
};
class DummyGroup2D : public DummyXShapes
......
......@@ -187,6 +187,9 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize );
};
}
......
......@@ -203,6 +203,8 @@ public:
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize );
private:
ShapeFactory();
......
......@@ -2398,6 +2398,7 @@ void ChartView::createShapes()
{
OSL_FAIL("could not set page size correctly");
}
pShapeFactory->setPageSize(xPageShapes, aPageSize);
{
SolarMutexGuard aSolarGuard;
......
......@@ -77,10 +77,56 @@ using dummy::DummyCone;
namespace opengl {
namespace {
uno::Reference< drawing::XShapes > getChartShape(
const uno::Reference< drawing::XDrawPage>& xDrawPage )
{
uno::Reference< drawing::XShapes > xRet;
uno::Reference< drawing::XShapes > xShapes( xDrawPage, uno::UNO_QUERY );
if( xShapes.is() )
{
sal_Int32 nCount = xShapes->getCount();
uno::Reference< drawing::XShape > xShape;
for( sal_Int32 nN = nCount; nN--; )
{
if( xShapes->getByIndex( nN ) >>= xShape )
{
OUString aRet;
uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
xProp->getPropertyValue( UNO_NAME_MISC_OBJ_NAME ) >>= aRet;
if( aRet.equals("com.sun.star.chart2.shapes") )
{
xRet = uno::Reference< drawing::XShapes >( xShape, uno::UNO_QUERY );
break;
}
}
}
}
return xRet;
}
}
uno::Reference< drawing::XShapes > OpenglShapeFactory::getOrCreateChartRootShape(
const uno::Reference< drawing::XDrawPage>& )
const uno::Reference< drawing::XDrawPage>& xDrawPage )
{
uno::Reference< drawing::XShapes > xRet( getChartShape( xDrawPage ) );
if( !xRet.is() )
{
//create the root shape
xRet = new dummy::DummyChart();
xDrawPage->add(uno::Reference< drawing::XShape >(xRet, uno::UNO_QUERY_THROW));
}
return xRet;
}
void OpenglShapeFactory::setPageSize( uno::Reference < drawing::XShapes > xChartShapes, const awt::Size& rSize )
{
return new dummy::DummyChart();
uno::Reference< drawing::XShape > xShape(xChartShapes, uno::UNO_QUERY_THROW);
xShape->setSize(rSize);
}
// methods for 3D shape creation
......
......@@ -74,6 +74,10 @@ uno::Reference< drawing::XShapes > ShapeFactory::getOrCreateChartRootShape(
return xRet;
}
void ShapeFactory::setPageSize(uno::Reference< drawing::XShapes >, const awt::Size& )
{
}
// diverse PolyPolygon create methods
uno::Any createPolyPolygon_Cube(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment