Kaydet (Commit) 2463160c authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor BackingWindow to use RenderContext

Change-Id: I7061b25ca349ca9e33bf38007558ab743ac7170c
üst 6499d465
...@@ -381,29 +381,29 @@ void BackingWindow::setupButton( MenuButton* pButton ) ...@@ -381,29 +381,29 @@ void BackingWindow::setupButton( MenuButton* pButton )
pButton->SetSelectHdl(LINK(this, BackingWindow, MenuSelectHdl)); pButton->SetSelectHdl(LINK(this, BackingWindow, MenuSelectHdl));
} }
void BackingWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) void BackingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{ {
Resize(); Resize();
Wallpaper aBack( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor ); Wallpaper aBack(svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor);
vcl::Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); vcl::Region aClip(Rectangle(Point(0, 0), rRenderContext.GetOutputSizePixel()));
aClip.Exclude( maStartCentButtons ); aClip.Exclude(maStartCentButtons);
Push( PushFlags::CLIPREGION ); rRenderContext.Push(PushFlags::CLIPREGION);
IntersectClipRegion( aClip ); rRenderContext.IntersectClipRegion(aClip);
DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack ); rRenderContext.DrawWallpaper(Rectangle(Point(0, 0), rRenderContext.GetOutputSizePixel()), aBack);
Pop(); rRenderContext.Pop();
ScopedVclPtrInstance< VirtualDevice > pVDev( *this ); ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
pVDev->EnableRTL( IsRTLEnabled() ); pVDev->EnableRTL(rRenderContext.IsRTLEnabled());
pVDev->SetOutputSizePixel( maStartCentButtons.GetSize() ); pVDev->SetOutputSizePixel(maStartCentButtons.GetSize());
Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft()); Point aOffset(Point(0, 0) - maStartCentButtons.TopLeft());
pVDev->DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack ); pVDev->DrawWallpaper(Rectangle(aOffset, rRenderContext.GetOutputSizePixel()), aBack);
DrawOutDev( maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(), rRenderContext.DrawOutDev(maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(),
Point( 0, 0 ), maStartCentButtons.GetSize(), Point(0, 0), maStartCentButtons.GetSize(),
*pVDev.get() ); *pVDev.get());
} }
bool BackingWindow::PreNotify( NotifyEvent& rNEvt ) bool BackingWindow::PreNotify( NotifyEvent& rNEvt )
...@@ -510,7 +510,7 @@ void BackingWindow::Resize() ...@@ -510,7 +510,7 @@ void BackingWindow::Resize()
VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD),
maStartCentButtons.TopLeft(), maStartCentButtons.GetSize()); maStartCentButtons.TopLeft(), maStartCentButtons.GetSize());
if( !IsInPaint()) if (!IsInPaint())
Invalidate(); Invalidate();
} }
......
...@@ -48,69 +48,66 @@ ...@@ -48,69 +48,66 @@
class ToolBox; class ToolBox;
class BackingWindow class BackingWindow : public vcl::Window, public VclBuilderContainer
: public vcl::Window
, public VclBuilderContainer
{ {
typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const ThumbnailViewItem*); typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*, const ThumbnailViewItem*);
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext; css::uno::Reference<css::uno::XComponentContext> mxContext;
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider > mxDesktopDispatchProvider; css::uno::Reference<css::frame::XDispatchProvider> mxDesktopDispatchProvider;
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> mxFrame; css::uno::Reference<css::frame::XFrame> mxFrame;
com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop; css::uno::Reference<css::frame::XDesktop2> mxDesktop;
/** helper for drag&drop. */ /** helper for drag&drop. */
com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener; css::uno::Reference<css::datatransfer::dnd::XDropTargetListener> mxDropTargetListener;
VclPtr<PushButton> mpOpenButton; VclPtr<PushButton> mpOpenButton;
VclPtr<PushButton> mpRecentButton; VclPtr<PushButton> mpRecentButton;
VclPtr<MenuButton> mpTemplateButton; VclPtr<MenuButton> mpTemplateButton;
VclPtr<FixedText> mpCreateLabel; VclPtr<FixedText> mpCreateLabel;
VclPtr<PushButton> mpWriterAllButton; VclPtr<PushButton> mpWriterAllButton;
VclPtr<PushButton> mpCalcAllButton; VclPtr<PushButton> mpCalcAllButton;
VclPtr<PushButton> mpImpressAllButton; VclPtr<PushButton> mpImpressAllButton;
VclPtr<PushButton> mpDrawAllButton; VclPtr<PushButton> mpDrawAllButton;
VclPtr<PushButton> mpDBAllButton; VclPtr<PushButton> mpDBAllButton;
VclPtr<PushButton> mpMathAllButton; VclPtr<PushButton> mpMathAllButton;
VclPtr<PushButton> mpHelpButton; VclPtr<PushButton> mpHelpButton;
VclPtr<PushButton> mpExtensionsButton; VclPtr<PushButton> mpExtensionsButton;
VclPtr<VclBox> mpAllButtonsBox; VclPtr<VclBox> mpAllButtonsBox;
VclPtr<VclBox> mpButtonsBox; VclPtr<VclBox> mpButtonsBox;
VclPtr<VclBox> mpSmallButtonsBox; VclPtr<VclBox> mpSmallButtonsBox;
VclPtr<VclBox> mpThinBox1; VclPtr<VclBox> mpThinBox1;
VclPtr<VclBox> mpThinBox2; VclPtr<VclBox> mpThinBox2;
VclPtr<VclBox> mpHelpBox; VclPtr<VclBox> mpHelpBox;
VclPtr<VclBox> mpExtensionsBox; VclPtr<VclBox> mpExtensionsBox;
VclPtr<RecentDocsView> mpAllRecentThumbnails; VclPtr<RecentDocsView> mpAllRecentThumbnails;
VclPtr<TemplateDefaultView> mpLocalView; VclPtr<TemplateDefaultView> mpLocalView;
bool mbLocalViewInitialized; bool mbLocalViewInitialized;
std::vector<VclPtr<vcl::Window> > maDndWindows; std::vector< VclPtr<vcl::Window> > maDndWindows;
Rectangle maStartCentButtons; Rectangle maStartCentButtons;
bool mbIsSaveMode; bool mbIsSaveMode;
bool mbInitControls; bool mbInitControls;
sal_Int32 mnHideExternalLinks; sal_Int32 mnHideExternalLinks;
svt::AcceleratorExecute* mpAccExec; svt::AcceleratorExecute* mpAccExec;
void setupButton( PushButton* pButton ); void setupButton(PushButton* pButton);
void setupButton( MenuButton* pButton ); void setupButton(MenuButton* pButton);
//Template Manager //Template Manager
void OnTemplateOpen (); void OnTemplateOpen();
void dispatchURL( const OUString& i_rURL, void dispatchURL(const OUString& i_rURL,
const OUString& i_rTarget = OUString( "_default" ), const OUString& i_rTarget = OUString("_default"),
const com::sun::star::uno::Reference< com::sun::star::frame::XDispatchProvider >& i_xProv = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchProvider >(), const css::uno::Reference<css::frame::XDispatchProvider >& i_xProv = css::uno::Reference<css::frame::XDispatchProvider>(),
const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& = com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >() const css::uno::Sequence<css::beans::PropertyValue >& = css::uno::Sequence<css::beans::PropertyValue>());
);
std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates; std::set<const ThumbnailViewItem*, selection_cmp_fn> maSelTemplates;
std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelFolders; std::set<const ThumbnailViewItem*, selection_cmp_fn> maSelFolders;
DECL_LINK(ClickHdl, Button*); DECL_LINK(ClickHdl, Button*);
DECL_LINK_TYPED(MenuSelectHdl, MenuButton*, void); DECL_LINK_TYPED(MenuSelectHdl, MenuButton*, void);
...@@ -123,19 +120,19 @@ class BackingWindow ...@@ -123,19 +120,19 @@ class BackingWindow
void initializeLocalView(); void initializeLocalView();
public: public:
BackingWindow( vcl::Window* pParent ); BackingWindow(vcl::Window* pParent);
virtual ~BackingWindow(); virtual ~BackingWindow();
virtual void dispose() SAL_OVERRIDE; virtual void dispose() SAL_OVERRIDE;
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect ) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; virtual bool PreNotify(NotifyEvent& rNEvt) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; virtual bool Notify(NotifyEvent& rNEvt) SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual Size GetOptimalSize() const SAL_OVERRIDE;
void setOwningFrame( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame ); void setOwningFrame(const css::uno::Reference<css::frame::XFrame>& xFrame );
void clearRecentFileList(); void clearRecentFileList();
}; };
......
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