Kaydet (Commit) 73e45da4 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor chart2 classes to use RenderContext

Change-Id: I245af77126739bb219f6a085a47cee2efac2c351
üst 60758229
......@@ -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;
......
......@@ -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 )
......
......@@ -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
{
......
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