refactor desktop classes to use RenderContext

Change-Id: I2338733e76968aeb69a57c60edd9d04d29e8321c
This commit is contained in:
Tomaž Vajngerl 2015-05-15 20:39:27 +09:00
parent 264fb9f163
commit a6c85d74ea
3 changed files with 132 additions and 137 deletions

View File

@ -491,97 +491,99 @@ void ExtensionBox_Impl::selectEntry( const long nPos )
} }
void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl& rEntry ) void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const Rectangle& rRect, const TEntry_Impl& rEntry)
{ {
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
if ( rEntry->m_bActive ) if (rEntry->m_bActive)
SetTextColor( rStyleSettings.GetHighlightTextColor() ); rRenderContext.SetTextColor(rStyleSettings.GetHighlightTextColor());
else if ( ( rEntry->m_eState != REGISTERED ) && ( rEntry->m_eState != NOT_AVAILABLE ) ) else if ((rEntry->m_eState != REGISTERED) && (rEntry->m_eState != NOT_AVAILABLE))
SetTextColor( rStyleSettings.GetDisableColor() ); rRenderContext.SetTextColor(rStyleSettings.GetDisableColor());
else if ( IsControlForeground() ) else if (IsControlForeground())
SetTextColor( GetControlForeground() ); rRenderContext.SetTextColor(GetControlForeground());
else else
SetTextColor( rStyleSettings.GetFieldTextColor() ); rRenderContext.SetTextColor(rStyleSettings.GetFieldTextColor());
if ( rEntry->m_bActive ) if (rEntry->m_bActive)
{ {
SetLineColor(); rRenderContext.SetLineColor();
SetFillColor( rStyleSettings.GetHighlightColor() ); rRenderContext.SetFillColor(rStyleSettings.GetHighlightColor());
DrawRect( rRect ); rRenderContext.DrawRect(rRect);
} }
else else
{ {
if( IsControlBackground() ) if (IsControlBackground())
SetBackground( GetControlBackground() ); rRenderContext.SetBackground(GetControlBackground());
else else
SetBackground( rStyleSettings.GetFieldColor() ); rRenderContext.SetBackground(rStyleSettings.GetFieldColor());
SetTextFillColor(); rRenderContext.SetTextFillColor();
Erase( rRect ); rRenderContext.Erase(rRect);
} }
// Draw extension icon // Draw extension icon
Point aPos( rRect.TopLeft() ); Point aPos( rRect.TopLeft() );
aPos += Point( TOP_OFFSET, TOP_OFFSET ); aPos += Point(TOP_OFFSET, TOP_OFFSET);
Image aImage; Image aImage;
if ( ! rEntry->m_aIcon ) if (!rEntry->m_aIcon)
aImage = m_aDefaultImage; aImage = m_aDefaultImage;
else else
aImage = rEntry->m_aIcon; aImage = rEntry->m_aIcon;
Size aImageSize = aImage.GetSizePixel(); Size aImageSize = aImage.GetSizePixel();
if ( ( aImageSize.Width() <= ICON_WIDTH ) && ( aImageSize.Height() <= ICON_HEIGHT ) ) if ((aImageSize.Width() <= ICON_WIDTH ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
DrawImage( Point( aPos.X()+((ICON_WIDTH-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage ); rRenderContext.DrawImage(Point(aPos.X() + ((ICON_WIDTH - aImageSize.Width()) / 2),
aPos.Y() + ((ICON_HEIGHT - aImageSize.Height()) / 2)),
aImage);
else else
DrawImage( aPos, Size( ICON_WIDTH, ICON_HEIGHT ), aImage ); rRenderContext.DrawImage(aPos, Size(ICON_WIDTH, ICON_HEIGHT), aImage);
// Setup fonts // Setup fonts
vcl::Font aStdFont( GetFont() ); vcl::Font aStdFont(rRenderContext.GetFont());
vcl::Font aBoldFont( aStdFont ); vcl::Font aBoldFont(aStdFont);
aBoldFont.SetWeight( WEIGHT_BOLD ); aBoldFont.SetWeight(WEIGHT_BOLD);
SetFont( aBoldFont ); rRenderContext.SetFont(aBoldFont);
long aTextHeight = GetTextHeight(); long aTextHeight = rRenderContext.GetTextHeight();
// Init publisher link here // Init publisher link here
if ( !rEntry->m_pPublisher && !rEntry->m_sPublisher.isEmpty() ) if (!rEntry->m_pPublisher && !rEntry->m_sPublisher.isEmpty())
{ {
rEntry->m_pPublisher = VclPtr<FixedHyperlink>::Create( this ); rEntry->m_pPublisher = VclPtr<FixedHyperlink>::Create(this);
rEntry->m_pPublisher->SetBackground(); rEntry->m_pPublisher->SetBackground();
rEntry->m_pPublisher->SetPaintTransparent( true ); rEntry->m_pPublisher->SetPaintTransparent(true);
rEntry->m_pPublisher->SetURL( rEntry->m_sPublisherURL ); rEntry->m_pPublisher->SetURL(rEntry->m_sPublisherURL);
rEntry->m_pPublisher->SetText( rEntry->m_sPublisher ); rEntry->m_pPublisher->SetText(rEntry->m_sPublisher);
Size aSize = FixedText::CalcMinimumTextSize( rEntry->m_pPublisher ); Size aSize = FixedText::CalcMinimumTextSize(rEntry->m_pPublisher);
rEntry->m_pPublisher->SetSizePixel( aSize ); rEntry->m_pPublisher->SetSizePixel(aSize);
if ( m_aClickHdl.IsSet() ) if (m_aClickHdl.IsSet())
rEntry->m_pPublisher->SetClickHdl( m_aClickHdl ); rEntry->m_pPublisher->SetClickHdl( m_aClickHdl );
} }
// Get max title width // Get max title width
long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET; long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN ); nMaxTitleWidth -= (2 * SMALL_ICON_SIZE) + (4 * SPACE_BETWEEN);
if ( rEntry->m_pPublisher ) if (rEntry->m_pPublisher)
{ {
nMaxTitleWidth -= rEntry->m_pPublisher->GetSizePixel().Width() + (2*SPACE_BETWEEN); nMaxTitleWidth -= rEntry->m_pPublisher->GetSizePixel().Width() + (2 * SPACE_BETWEEN);
} }
long aVersionWidth = GetTextWidth( rEntry->m_sVersion ); long aVersionWidth = rRenderContext.GetTextWidth(rEntry->m_sVersion);
long aTitleWidth = GetTextWidth( rEntry->m_sTitle ) + (aTextHeight / 3); long aTitleWidth = rRenderContext.GetTextWidth(rEntry->m_sTitle) + (aTextHeight / 3);
aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET ); aPos = rRect.TopLeft() + Point(ICON_OFFSET, TOP_OFFSET);
if ( aTitleWidth > nMaxTitleWidth - aVersionWidth ) if (aTitleWidth > nMaxTitleWidth - aVersionWidth)
{ {
aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3); aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3);
OUString aShortTitle = GetEllipsisString( rEntry->m_sTitle, aTitleWidth ); OUString aShortTitle = rRenderContext.GetEllipsisString(rEntry->m_sTitle, aTitleWidth);
DrawText( aPos, aShortTitle ); rRenderContext.DrawText(aPos, aShortTitle);
aTitleWidth += (aTextHeight / 3); aTitleWidth += (aTextHeight / 3);
} }
else else
DrawText( aPos, rEntry->m_sTitle ); rRenderContext.DrawText(aPos, rEntry->m_sTitle);
SetFont( aStdFont ); rRenderContext.SetFont(aStdFont);
DrawText( Point( aPos.X() + aTitleWidth, aPos.Y() ), rEntry->m_sVersion ); rRenderContext.DrawText(Point(aPos.X() + aTitleWidth, aPos.Y()), rEntry->m_sVersion);
long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE; long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE;
long nTitleHeight = TOP_OFFSET + GetTextHeight(); long nTitleHeight = TOP_OFFSET + GetTextHeight();
@ -592,9 +594,9 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl& rEnt
// draw description // draw description
OUString sDescription; OUString sDescription;
if ( !rEntry->m_sErrorText.isEmpty() ) if (!rEntry->m_sErrorText.isEmpty())
{ {
if ( rEntry->m_bActive ) if (rEntry->m_bActive)
sDescription = rEntry->m_sErrorText + "\n" + rEntry->m_sDescription; sDescription = rEntry->m_sErrorText + "\n" + rEntry->m_sDescription;
else else
sDescription = rEntry->m_sErrorText; sDescription = rEntry->m_sErrorText;
@ -603,51 +605,51 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl& rEnt
sDescription = rEntry->m_sDescription; sDescription = rEntry->m_sDescription;
aPos.Y() += aTextHeight; aPos.Y() += aTextHeight;
if ( rEntry->m_bActive ) if (rEntry->m_bActive)
{ {
long nExtraHeight = 0; long nExtraHeight = 0;
if ( rEntry->m_bHasButtons ) if (rEntry->m_bHasButtons)
nExtraHeight = m_nExtraHeight; nExtraHeight = m_nExtraHeight;
DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - nExtraHeight ), rRenderContext.DrawText(Rectangle(aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - nExtraHeight),
sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK ); sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
} }
else else
{ {
//replace LF to space, so words do not stick together in one line view //replace LF to space, so words do not stick together in one line view
sDescription = sDescription.replace(0x000A, ' '); sDescription = sDescription.replace(0x000A, ' ');
const long nWidth = GetTextWidth( sDescription ); const long nWidth = GetTextWidth( sDescription );
if ( nWidth > rRect.GetWidth() - aPos.X() ) if (nWidth > rRect.GetWidth() - aPos.X())
sDescription = GetEllipsisString( sDescription, rRect.GetWidth() - aPos.X() ); sDescription = rRenderContext.GetEllipsisString(sDescription, rRect.GetWidth() - aPos.X());
DrawText( aPos, sDescription ); rRenderContext.DrawText(aPos, sDescription);
} }
// Draw publisher link // Draw publisher link
if ( rEntry->m_pPublisher ) if (rEntry->m_pPublisher)
{ {
rEntry->m_pPublisher->Show(); rEntry->m_pPublisher->Show();
aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + (2*SPACE_BETWEEN), TOP_OFFSET ); aPos = rRect.TopLeft() + Point( ICON_OFFSET + nMaxTitleWidth + (2*SPACE_BETWEEN), TOP_OFFSET );
rEntry->m_pPublisher->SetPosPixel( aPos ); rEntry->m_pPublisher->SetPosPixel(aPos);
} }
// Draw status icons // Draw status icons
if ( !rEntry->m_bUser ) if (!rEntry->m_bUser)
{ {
aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SMALL_ICON_SIZE), TOP_OFFSET ); aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SMALL_ICON_SIZE), TOP_OFFSET );
if ( rEntry->m_bLocked ) if (rEntry->m_bLocked)
DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), m_aLockedImage ); rRenderContext.DrawImage(aPos, Size(SMALL_ICON_SIZE, SMALL_ICON_SIZE), m_aLockedImage);
else else
DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), m_aSharedImage ); rRenderContext.DrawImage(aPos, Size(SMALL_ICON_SIZE, SMALL_ICON_SIZE), m_aSharedImage);
} }
if ( ( rEntry->m_eState == AMBIGUOUS ) || rEntry->m_bMissingDeps || rEntry->m_bMissingLic ) if ((rEntry->m_eState == AMBIGUOUS ) || rEntry->m_bMissingDeps || rEntry->m_bMissingLic)
{ {
aPos = rRect.TopRight() + Point( -(RIGHT_ICON_OFFSET + SPACE_BETWEEN + 2*SMALL_ICON_SIZE), TOP_OFFSET ); aPos = rRect.TopRight() + Point(-(RIGHT_ICON_OFFSET + SPACE_BETWEEN + 2 * SMALL_ICON_SIZE), TOP_OFFSET);
DrawImage( aPos, Size( SMALL_ICON_SIZE, SMALL_ICON_SIZE ), m_aWarningImage ); rRenderContext.DrawImage(aPos, Size(SMALL_ICON_SIZE, SMALL_ICON_SIZE), m_aWarningImage);
} }
SetLineColor( Color( COL_LIGHTGRAY ) ); rRenderContext.SetLineColor(Color(COL_LIGHTGRAY));
DrawLine( rRect.BottomLeft(), rRect.BottomRight() ); rRenderContext.DrawLine(rRect.BottomLeft(), rRect.BottomRight());
} }
@ -747,7 +749,7 @@ bool ExtensionBox_Impl::HandleCursorKey( sal_uInt16 nKeyCode )
} }
void ExtensionBox_Impl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle &/*rPaintRect*/ ) void ExtensionBox_Impl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rPaintRect*/)
{ {
if ( !m_bInDelete ) if ( !m_bInDelete )
DeleteRemoved(); DeleteRemoved();
@ -756,7 +758,7 @@ void ExtensionBox_Impl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rec
RecalcAll(); RecalcAll();
Point aStart( 0, -m_nTopIndex ); Point aStart( 0, -m_nTopIndex );
Size aSize( GetOutputSizePixel() ); Size aSize(rRenderContext.GetOutputSizePixel());
if ( m_bHasScrollBar ) if ( m_bHasScrollBar )
aSize.Width() -= m_pScrollBar->GetSizePixel().Width(); aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
@ -764,11 +766,11 @@ void ExtensionBox_Impl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rec
const ::osl::MutexGuard aGuard( m_entriesMutex ); const ::osl::MutexGuard aGuard( m_entriesMutex );
typedef std::vector< TEntry_Impl >::iterator ITER; typedef std::vector< TEntry_Impl >::iterator ITER;
for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex ) for (ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex)
{ {
aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight; aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight;
Rectangle aEntryRect( aStart, aSize ); Rectangle aEntryRect( aStart, aSize );
DrawRow( aEntryRect, *iIndex ); DrawRow(rRenderContext, aEntryRect, *iIndex);
aStart.Y() += aSize.Height(); aStart.Y() += aSize.Height();
} }
} }

View File

@ -49,9 +49,6 @@ namespace dp_gui {
class TheExtensionManager; class TheExtensionManager;
// struct Entry_Impl
struct Entry_Impl; struct Entry_Impl;
typedef ::boost::shared_ptr< Entry_Impl > TEntry_Impl; typedef ::boost::shared_ptr< Entry_Impl > TEntry_Impl;
@ -80,24 +77,20 @@ struct Entry_Impl
Image m_aIconHC; Image m_aIconHC;
VclPtr<FixedHyperlink> m_pPublisher; VclPtr<FixedHyperlink> m_pPublisher;
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage; css::uno::Reference<css::deployment::XPackage> m_xPackage;
Entry_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage, Entry_Impl(const css::uno::Reference<css::deployment::XPackage> &xPackage,
const PackageState eState, const bool bReadOnly ); const PackageState eState, const bool bReadOnly);
~Entry_Impl(); ~Entry_Impl();
sal_Int32 CompareTo( const CollatorWrapper *pCollator, const TEntry_Impl& rEntry ) const; sal_Int32 CompareTo(const CollatorWrapper *pCollator, const TEntry_Impl& rEntry) const;
void checkDependencies(); void checkDependencies();
}; };
// class ExtensionBox_Impl
class ExtensionBox_Impl; class ExtensionBox_Impl;
class ExtensionRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener > class ExtensionRemovedListener : public ::cppu::WeakImplHelper1<css::lang::XEventListener>
{ {
VclPtr<ExtensionBox_Impl> m_pParent; VclPtr<ExtensionBox_Impl> m_pParent;
@ -108,35 +101,36 @@ public:
// XEventListener // XEventListener
virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt ) virtual void SAL_CALL disposing(css::lang::EventObject const& evt)
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
}; };
class ExtensionBox_Impl : public ::svt::IExtensionListBox class ExtensionBox_Impl : public ::svt::IExtensionListBox
{ {
bool m_bHasScrollBar; bool m_bHasScrollBar : 1;
bool m_bHasActive; bool m_bHasActive : 1;
bool m_bNeedsRecalc; bool m_bNeedsRecalc : 1;
bool m_bInCheckMode; bool m_bInCheckMode : 1;
bool m_bAdjustActive; bool m_bAdjustActive : 1;
bool m_bInDelete; bool m_bInDelete : 1;
//Must be guarded together with m_vEntries to ensure a valid index at all times. //Must be guarded together with m_vEntries to ensure a valid index at all times.
//Use m_entriesMutex as guard. //Use m_entriesMutex as guard.
long m_nActive; long m_nActive;
long m_nTopIndex; long m_nTopIndex;
long m_nStdHeight; long m_nStdHeight;
long m_nActiveHeight; long m_nActiveHeight;
long m_nExtraHeight; long m_nExtraHeight;
Image m_aSharedImage; Image m_aSharedImage;
Image m_aLockedImage; Image m_aLockedImage;
Image m_aWarningImage; Image m_aWarningImage;
Image m_aDefaultImage; Image m_aDefaultImage;
Link<> m_aClickHdl;
Link<> m_aClickHdl;
VclPtr<ScrollBar> m_pScrollBar; VclPtr<ScrollBar> m_pScrollBar;
com::sun::star::uno::Reference< ExtensionRemovedListener > m_xRemoveListener; css::uno::Reference<ExtensionRemovedListener> m_xRemoveListener;
TheExtensionManager *m_pManager; TheExtensionManager *m_pManager;
//This mutex is used for synchronizing access to m_vEntries. //This mutex is used for synchronizing access to m_vEntries.
@ -158,17 +152,16 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
::com::sun::star::deployment::XPackage> > m_vListenerAdded; ::com::sun::star::deployment::XPackage> > m_vListenerAdded;
//Removes the dead weak references from m_vListenerAdded //Removes the dead weak references from m_vListenerAdded
void cleanVecListenerAdded(); void cleanVecListenerAdded();
void addEventListenerOnce( ::com::sun::star::uno::Reference< void addEventListenerOnce(css::uno::Reference<css::deployment::XPackage> const & extension);
::com::sun::star::deployment::XPackage> const & extension);
void CalcActiveHeight( const long nPos ); void CalcActiveHeight( const long nPos );
long GetTotalHeight() const; long GetTotalHeight() const;
void SetupScrollBar(); void SetupScrollBar();
void DrawRow( const Rectangle& rRect, const TEntry_Impl& rEntry ); void DrawRow(vcl::RenderContext& rRenderContext, const Rectangle& rRect, const TEntry_Impl& rEntry);
bool HandleTabKey( bool bReverse ); bool HandleTabKey( bool bReverse );
bool HandleCursorKey( sal_uInt16 nKeyCode ); bool HandleCursorKey( sal_uInt16 nKeyCode );
bool FindEntryPos( const TEntry_Impl& rEntry, long nStart, long nEnd, long &nFound ); bool FindEntryPos( const TEntry_Impl& rEntry, long nStart, long nEnd, long &nFound );
void DeleteRemoved(); void DeleteRemoved();
DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * ); DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
@ -184,11 +177,11 @@ public:
virtual ~ExtensionBox_Impl(); virtual ~ExtensionBox_Impl();
virtual void dispose() SAL_OVERRIDE; virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle &rPaintRect ) SAL_OVERRIDE; virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle &rPaintRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual Size GetOptimalSize() const SAL_OVERRIDE;
void SetExtraSize( long nSize ) { m_nExtraHeight = nSize; } void SetExtraSize( long nSize ) { m_nExtraHeight = nSize; }
TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; } TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
@ -203,16 +196,16 @@ public:
void RemoveUnlocked(); void RemoveUnlocked();
virtual void selectEntry( const long nPos ); virtual void selectEntry( const long nPos );
long addEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage, long addEntry(const css::uno::Reference<css::deployment::XPackage> &xPackage,
bool bLicenseMissing = false ); bool bLicenseMissing = false );
void updateEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ); void updateEntry(const css::uno::Reference<css::deployment::XPackage> &xPackage );
void removeEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ); void removeEntry(const css::uno::Reference<css::deployment::XPackage> &xPackage );
void prepareChecking(); void prepareChecking();
void checkEntries(); void checkEntries();
TheExtensionManager* getExtensionManager() const { return m_pManager; } TheExtensionManager* getExtensionManager() const { return m_pManager; }
void setExtensionManager(TheExtensionManager* pManager) { m_pManager = pManager; } void setExtensionManager(TheExtensionManager* pManager) { m_pManager = pManager; }

View File

@ -605,32 +605,32 @@ void SplashScreen::determineProgressRatioValues(
} }
} }
void SplashScreenWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&) void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{ {
if (!pSpl || !pSpl->_bVisible) if (!pSpl || !pSpl->_bVisible)
return; return;
//native drawing //native drawing
// in case of native controls we need to draw directly to the window // in case of native controls we need to draw directly to the window
if( pSpl->_bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) ) if (pSpl->_bNativeProgress && rRenderContext.IsNativeControlSupported(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL))
{ {
DrawBitmapEx( Point(), pSpl->_aIntroBmp ); rRenderContext.DrawBitmapEx(Point(), pSpl->_aIntroBmp);
ImplControlValue aValue( pSpl->_iProgress * pSpl->_barwidth / pSpl->_iMax); ImplControlValue aValue( pSpl->_iProgress * pSpl->_barwidth / pSpl->_iMax);
Rectangle aDrawRect( Point(pSpl->_tlx, pSpl->_tly), Size( pSpl->_barwidth, pSpl->_barheight ) ); Rectangle aDrawRect( Point(pSpl->_tlx, pSpl->_tly), Size( pSpl->_barwidth, pSpl->_barheight));
Rectangle aNativeControlRegion, aNativeContentRegion; Rectangle aNativeControlRegion, aNativeContentRegion;
if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, if (rRenderContext.GetNativeControlRegion(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
ControlState::ENABLED, aValue, OUString(), ControlState::ENABLED, aValue, OUString(),
aNativeControlRegion, aNativeContentRegion ) ) aNativeControlRegion, aNativeContentRegion))
{ {
long nProgressHeight = aNativeControlRegion.GetHeight(); long nProgressHeight = aNativeControlRegion.GetHeight();
aDrawRect.Top() -= (nProgressHeight - pSpl->_barheight)/2; aDrawRect.Top() -= (nProgressHeight - pSpl->_barheight)/2;
aDrawRect.Bottom() += (nProgressHeight - pSpl->_barheight)/2; aDrawRect.Bottom() += (nProgressHeight - pSpl->_barheight)/2;
} }
if( (DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, if ((rRenderContext.DrawNativeControl(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
ControlState::ENABLED, aValue, pSpl->_sProgressText )) ) ControlState::ENABLED, aValue, pSpl->_sProgressText)))
{ {
return; return;
} }
@ -639,7 +639,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rec
// non native drawing // non native drawing
// draw bitmap // draw bitmap
if (pSpl->_bPaintBitmap) if (pSpl->_bPaintBitmap)
_vdev->DrawBitmapEx( Point(), pSpl->_aIntroBmp ); _vdev->DrawBitmapEx(Point(), pSpl->_aIntroBmp);
if (pSpl->_bPaintProgress) { if (pSpl->_bPaintProgress) {
// draw progress... // draw progress...
@ -660,7 +660,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rec
_vdev->SetTextColor(pSpl->_cProgressTextColor); _vdev->SetTextColor(pSpl->_cProgressTextColor);
_vdev->DrawText(Point(pSpl->_tlx, pSpl->_textBaseline), pSpl->_sProgressText); _vdev->DrawText(Point(pSpl->_tlx, pSpl->_textBaseline), pSpl->_sProgressText);
} }
DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev->GetOutputSizePixel(), *_vdev.get() ); rRenderContext.DrawOutDev(Point(), rRenderContext.GetOutputSizePixel(), Point(), _vdev->GetOutputSizePixel(), *_vdev.get());
} }