summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 09:22:24 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 09:58:14 +0900
commit73e45da4f52eb50f6c756bd71e6274b59162ee2d (patch)
tree929d32179fef8d47946d5eb61788c60f5f6fe4e1 /chart2
parent607582291eaad26a18b1df6f7aea434b391d548c (diff)
refactor chart2 classes to use RenderContext
Change-Id: I245af77126739bb219f6a085a47cee2efac2c351
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ChartController.hxx30
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx22
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx6
3 files changed, 29 insertions, 29 deletions
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index 9462df665397..c9b2dcb16d57 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -82,19 +82,19 @@ class WindowController
public:
virtual ~WindowController() {};
- virtual void PrePaint()=0;
- virtual void execute_Paint( const Rectangle& rRect )=0;
- virtual void execute_MouseButtonDown( const MouseEvent& rMEvt )=0;
- virtual void execute_MouseMove( const MouseEvent& rMEvt )=0;
- virtual void execute_Tracking( const TrackingEvent& rTEvt )=0;
- virtual void execute_MouseButtonUp( const MouseEvent& rMEvt )=0;
- virtual void execute_Resize()=0;
- virtual void execute_Activate()=0;
- virtual void execute_Deactivate()=0;
- virtual void execute_GetFocus()=0;
- virtual void execute_LoseFocus()=0;
- virtual void execute_Command( const CommandEvent& rCEvt )=0;
- virtual bool execute_KeyInput( const KeyEvent& rKEvt )=0;
+ virtual void PrePaint(vcl::RenderContext& rRenderContext) = 0;
+ virtual void execute_Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) = 0;
+ virtual void execute_MouseButtonDown( const MouseEvent& rMEvt ) = 0;
+ virtual void execute_MouseMove( const MouseEvent& rMEvt ) = 0;
+ virtual void execute_Tracking( const TrackingEvent& rTEvt ) = 0;
+ virtual void execute_MouseButtonUp( const MouseEvent& rMEvt ) = 0;
+ virtual void execute_Resize() = 0;
+ virtual void execute_Activate() = 0;
+ virtual void execute_Deactivate() = 0;
+ virtual void execute_GetFocus() = 0;
+ virtual void execute_LoseFocus() = 0;
+ virtual void execute_Command( const CommandEvent& rCEvt ) = 0;
+ virtual bool execute_KeyInput( const KeyEvent& rKEvt ) = 0;
/** get help text to be shown in a quick help
@@ -406,8 +406,8 @@ public:
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// chart2::WindowController
- virtual void PrePaint() SAL_OVERRIDE;
- virtual void execute_Paint( const Rectangle& rRect ) SAL_OVERRIDE;
+ virtual void PrePaint(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
+ virtual void execute_Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
virtual void execute_MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void execute_MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void execute_Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 1e28f3f07abb..0b7aaa2d7861 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -449,34 +449,34 @@ void SAL_CALL ChartController::removePaintListener(
}
// impl vcl window controller methods
-void ChartController::PrePaint()
+void ChartController::PrePaint(vcl::RenderContext& /*rRenderContext*/)
{
// forward VCLs PrePaint window event to DrawingLayer
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(pDrawViewWrapper)
+ if (pDrawViewWrapper)
{
pDrawViewWrapper->PrePaint();
}
}
-void ChartController::execute_Paint( const Rectangle& rRect )
+void ChartController::execute_Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
try
{
- uno::Reference< frame::XModel > xModel( getModel() );
+ uno::Reference<frame::XModel> xModel(getModel());
//OSL_ENSURE( xModel.is(), "ChartController::execute_Paint: have no model to paint");
- if( !xModel.is() )
+ if (!xModel.is())
return;
//better performance for big data
- uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
- if( xProp.is() )
+ uno::Reference<beans::XPropertySet> xProp(m_xChartView, uno::UNO_QUERY);
+ if (xProp.is())
{
awt::Size aResolution(1000, 1000);
{
SolarMutexGuard aGuard;
- if( m_pChartWindow )
+ if (m_pChartWindow)
{
aResolution.Width = m_pChartWindow->GetSizePixel().Width();
aResolution.Height = m_pChartWindow->GetSizePixel().Height();
@@ -486,14 +486,14 @@ void ChartController::execute_Paint( const Rectangle& rRect )
}
uno::Reference< util::XUpdatable > xUpdatable( m_xChartView, uno::UNO_QUERY );
- if( xUpdatable.is() )
+ if (xUpdatable.is())
xUpdatable->update();
{
SolarMutexGuard aGuard;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(pDrawViewWrapper)
- pDrawViewWrapper->CompleteRedraw(m_pChartWindow, vcl::Region(rRect) );
+ if (pDrawViewWrapper)
+ pDrawViewWrapper->CompleteRedraw(&rRenderContext, vcl::Region(rRect));
}
}
catch( const uno::Exception & ex )
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 57a306691164..7e14db058053 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -93,12 +93,12 @@ void ChartWindow::clear()
this->ReleaseMouse();
}
-void ChartWindow::PrePaint(vcl::RenderContext& /*rRenderContext*/)
+void ChartWindow::PrePaint(vcl::RenderContext& rRenderContext)
{
// forward VCLs PrePaint window event to DrawingLayer
if (m_pWindowController)
{
- m_pWindowController->PrePaint();
+ m_pWindowController->PrePaint(rRenderContext);
}
}
@@ -111,7 +111,7 @@ void ChartWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRe
}
else if (m_pWindowController)
{
- m_pWindowController->execute_Paint(rRect);
+ m_pWindowController->execute_Paint(rRenderContext, rRect);
}
else
{