summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/Library_chartcore.mk28
-rw-r--r--chart2/Module_chart2.mk8
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx6
-rw-r--r--chart2/source/model/template/ChartTypeManager.cxx9
-rw-r--r--chart2/source/view/main/ChartView.cxx24
5 files changed, 59 insertions, 16 deletions
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index ce2043a415d3..99d3c3328776 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -28,9 +28,14 @@ $(eval $(call gb_Library_set_precompiled_header,chartcore,$(SRCDIR)/chart2/inc/p
$(eval $(call gb_Library_use_externals,chartcore,\
boost_headers \
glm_headers \
- glew \
))
+ifeq ($(ENABLE_OPENGL),TRUE)
+$(eval $(call gb_Library_use_externals,chartcore,\
+ glew \
+))
+endif
+
$(eval $(call gb_Library_use_custom_headers,chartcore,\
officecfg/registry \
))
@@ -82,7 +87,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/view/axes/VPolarCoordinateSystem \
chart2/source/view/axes/VPolarGrid \
chart2/source/view/axes/VPolarRadiusAxis \
- chart2/source/view/charttypes/GL3DBarChart \
chart2/source/view/charttypes/AreaChart \
chart2/source/view/charttypes/BarChart \
chart2/source/view/charttypes/BarPositionHelper \
@@ -94,14 +98,11 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/view/charttypes/Splines \
chart2/source/view/charttypes/VSeriesPlotter \
chart2/source/view/diagram/VDiagram \
- chart2/source/view/main/3DChartObjects \
chart2/source/view/main/ChartItemPool \
chart2/source/view/main/ChartView \
chart2/source/view/main/Clipping \
chart2/source/view/main/DataPointSymbolSupplier \
chart2/source/view/main/DrawModelWrapper \
- chart2/source/view/main/GL3DPlotterBase \
- chart2/source/view/main/GL3DRenderer \
chart2/source/view/main/LabelPositionHelper \
chart2/source/view/main/Linear3DTransformation \
chart2/source/view/main/PlotterBase \
@@ -118,6 +119,14 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/view/main/VPolarTransformation \
chart2/source/view/main/VTitle \
))
+ifeq ($(ENABLE_OPENGL),TRUE)
+$(eval $(call gb_Library_add_exception_objects,chartcore,\
+ chart2/source/view/main/3DChartObjects \
+ chart2/source/view/main/GL3DPlotterBase \
+ chart2/source/view/main/GL3DRenderer \
+ chart2/source/view/charttypes/GL3DBarChart \
+))
+endif
# model pieces ...
$(eval $(call gb_Library_add_exception_objects,chartcore,\
@@ -256,9 +265,14 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,chartcore,\
else ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Library_add_libs,chartcore,\
$(DLOPEN_LIBS) \
- -lGL \
- -lX11 \
))
+ifeq ($(ENABLE_OPENGL),TRUE)
+$(eval $(call gb_Library_add_libs,chartcore,\
+ -lGL \
+ -lX11 \
+))
+endif #ENABLE_OPENGL
+
endif
# vim: set noet sw=4 ts=4:
diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk
index dedb5d713f17..3b32e1cc5c01 100644
--- a/chart2/Module_chart2.mk
+++ b/chart2/Module_chart2.mk
@@ -12,9 +12,13 @@ $(eval $(call gb_Module_Module,chart2))
$(eval $(call gb_Module_add_targets,chart2,\
Library_chartcontroller \
Library_chartcore \
- Library_chartopengl \
- Package_opengl \
))
+ifeq ($(ENABLE_OPENGL),TRUE)
+$(eval $(call gb_Module_add_targets,chart2,\
+ Library_chartopengl \
+ Package_opengl \
+ ))
+endif
$(eval $(call gb_Module_add_l10n_targets,chart2,\
AllLangResTarget_chartcontroller \
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 1c6d6ae4b0db..25bdc33c7a13 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -24,7 +24,7 @@
#include <vcl/help.hxx>
#include <vcl/openglwin.hxx>
#include <vcl/settings.hxx>
-
+#include <config_features.h>
#include <com/sun/star/chart2/X3DChartWindowProvider.hpp>
using namespace ::com::sun::star;
@@ -49,7 +49,11 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
: Window(pParent, nStyle)
, m_pWindowController( pController )
, m_bInPaint(false)
+#if HAVE_FEATURE_OPENGL
, m_pOpenGLWindow(VclPtr<OpenGLWindow>::Create(this))
+#else
+ , m_pOpenGLWindow(nullptr)
+#endif
{
this->SetHelpId( HID_SCH_WIN_DOCUMENT );
this->SetMapMode( MapMode(MAP_100TH_MM) );
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index adee48ecad68..a8b96e42a226 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -33,7 +33,10 @@
#include "StockChartTypeTemplate.hxx"
#include "NetChartTypeTemplate.hxx"
#include "BubbleChartTypeTemplate.hxx"
+#include <config_features.h>
+#if HAVE_FEATURE_OPENGL
#include "GL3DBarChartTypeTemplate.hxx"
+#endif
#include <cppuhelper/component_context.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/InlineContainer.hxx>
@@ -534,14 +537,16 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
case TEMPLATE_BUBBLE:
xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
break;
-
+#if HAVE_FEATURE_OPENGL
case TEMPLATE_GL3DBAR:
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
break;
case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE:
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
break;
-
+#else
+ default: break;
+#endif
// case TEMPLATE_SURFACE:
// case TEMPLATE_ADDIN:
// break;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index fc524b5096e8..c9aba8d841be 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -50,8 +50,9 @@
#include "DateHelper.hxx"
#include "defines.hxx"
#include <unonames.hxx>
+#if HAVE_FEATURE_OPENGL
#include <GL3DBarChart.hxx>
-
+#endif
#include <editeng/frmdiritem.hxx>
#include <rtl/uuid.h>
#include <tools/globname.hxx>
@@ -68,8 +69,9 @@
#include <osl/mutex.hxx>
#include <svx/unofill.hxx>
#include <vcl/openglwin.hxx>
+#if HAVE_FEATURE_OPENGL
#include <vcl/opengl/OpenGLContext.hxx>
-
+#endif
#include <drawinglayer/XShapeDumper.hxx>
#include <time.h>
@@ -1093,8 +1095,10 @@ GL2DRenderer::GL2DRenderer(ChartView* pView):
GL2DRenderer::~GL2DRenderer()
{
SolarMutexGuard g;
+#if HAVE_FEATURE_OPENGL
if(!mbContextDestroyed && mpWindow)
mpWindow->setRenderer(nullptr);
+#endif
mpWindow.reset();
}
@@ -1132,6 +1136,7 @@ void GL2DRenderer::updateOpenGLWindow()
return;
OpenGLWindow* pWindow = mpView->mrChartModel.getOpenGLWindow();
+#if HAVE_FEATURE_OPENGL
if(pWindow != mpWindow)
{
if(mpWindow)
@@ -1144,6 +1149,7 @@ void GL2DRenderer::updateOpenGLWindow()
pWindow->setRenderer(this);
}
}
+#endif
mpWindow = pWindow;
}
@@ -2593,8 +2599,11 @@ void ChartView::impl_refreshAddIn()
bool ChartView::isReal3DChart()
{
uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
-
+#if HAVE_FEATURE_OPENGL
return ChartHelper::isGL3DDiagram(xDiagram);
+#else
+ return false;
+#endif
}
static const char* envChartDummyFactory = getenv("CHART_DUMMY_FACTORY");
@@ -2637,7 +2646,7 @@ void ChartView::createShapes()
}
pShapeFactory->setPageSize(mxRootShape, aPageSize);
pShapeFactory->clearPage(mxRootShape);
-
+#if HAVE_FEATURE_OPENGL
#if HAVE_FEATURE_DESKTOP
if(isReal3DChart())
{
@@ -2654,6 +2663,7 @@ void ChartView::createShapes()
pWindow->Show(false);
}
#endif
+#endif
createShapes2D(aPageSize);
@@ -2672,6 +2682,7 @@ void ChartView::createShapes()
void ChartView::render()
{
+#if HAVE_FEATURE_OPENGL
if(!isReal3DChart())
{
AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory);
@@ -2685,6 +2696,7 @@ void ChartView::render()
pShapeFactory->postRender(pWindow);
}
}
+#endif
}
// util::XEventListener (base of XCloseListener)
@@ -3371,6 +3383,7 @@ void ChartView::createShapes3D()
uno::Reference< XChartType > xChartType( aChartTypeList[0] );
+#if HAVE_FEATURE_OPENGL
if (!m_pGL3DPlotter)
{
m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow));
@@ -3381,6 +3394,7 @@ void ChartView::createShapes3D()
if (pChart)
pChart->setOpenGLWindow(pWindow);
}
+#endif
uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
OSL_ASSERT( xDataSeriesContainer.is());
@@ -3400,9 +3414,11 @@ void ChartView::createShapes3D()
std::unique_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel));
+#if HAVE_FEATURE_OPENGL
m_pGL3DPlotter->create3DShapes(aDataSeries, *pCatProvider);
m_pGL3DPlotter->render();
+#endif
}
void ChartView::updateOpenGLWindow()