[Libreoffice-commits] core.git: Branch 'feature/slidehack' - 2 commits - sd/source
sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx| 22 - sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx |7 sd/source/ui/slidesorter/view/SlideSorterView.cxx | 144 --- sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx |3 sd/source/ui/slidesorter/view/SlsLayouter.cxx | 23 - sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx| 40 -- sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx | 188 ++ 7 files changed, 98 insertions(+), 329 deletions(-) New commits: commit fdb1e019e30a40d81754ddd4c6846d08b19c83fd Author: Michael Meeks michael.me...@suse.com Date: Fri Apr 12 16:31:48 2013 +0100 slide-sorter: re-factor to improve bbox calcuation Always use a SlsPageDescriptor to calculate bbox, so we can adapt it to merge slides attributes where possible. Change-Id: Id719459adb069654ab712e22ea79fea96c1f diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx index 1c50da9..16c7a2a 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx @@ -95,22 +95,30 @@ public: @param eCoodinateSystem The bounding box can be returned in model and in pixel (window) coordinates. +@param bIgnoreLocation +Return a position ignoring the slides' location, ie. as if +we were the first slide. */ Rectangle GetBoundingBox ( const model::SharedPageDescriptor rpPageDescriptor, const Part ePart, -const CoordinateSystem eCoordinateSystem); +const CoordinateSystem eCoordinateSystem, +bool bIgnoreLocation = false); + +/// the size of the embedded preview: position independent +Size GetPreviewSize(const CoordinateSystem eCoordinateSystem); + +/// the maximum size of each tile, also position independent +Size GetGridMaxSize(const CoordinateSystem eCoordinateSystem); + +Image GetTransitionEffectIcon (void) const; + +private: Rectangle GetBoundingBox ( const Point rPageObjectLocation, const Part ePart, const CoordinateSystem eCoordinateSystem); -Size GetSize ( -const Part ePart, -const CoordinateSystem eCoordinateSystem); -Image GetTransitionEffectIcon (void) const; - -private: SharedSdWindow mpWindow; Size maPageObjectSize; Rectangle maFocusIndicatorBoundingBox; diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx index 67de31c..6697de4 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx @@ -104,8 +104,12 @@ private: OutputDevice rDevice, const Theme::GradientColorType eColorType, const Rectangle rBox) const; +void PaintBackgroundDetail( +OutputDevice rDevice, +const model::SharedPageDescriptor rpDescriptor); + +#if 0 Bitmap GetBackgroundForState ( -const model::SharedPageDescriptor rpDescriptor, const OutputDevice rTemplateDevice); Bitmap GetBackground( Bitmap rBackground, @@ -116,6 +120,7 @@ private: const OutputDevice rReferenceDevice, const Theme::GradientColorType eType, const bool bHasFocusBorder) const; +#endif Bitmap CreateMarkedPreview( const Size rSize, const Bitmap rPreview, diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 06e15d6..66b1015 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -421,9 +421,7 @@ void SlideSorterView::Layout () mpLayouter-GetPageObjectLayouter()); if (pPageObjectLayouter) { -const Size aNewPreviewSize (mpLayouter-GetPageObjectLayouter()-GetSize( -PageObjectLayouter::Preview, -PageObjectLayouter::WindowCoordinateSystem)); +const Size aNewPreviewSize (mpLayouter-GetPageObjectLayouter()-GetPreviewSize(PageObjectLayouter::WindowCoordinateSystem)); if (maPreviewSize != aNewPreviewSize GetPreviewCache()) { mpPreviewCache-ChangeSize(aNewPreviewSize, true); diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index fc52483..6ad4c19 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -129,8 +129,7 @@ void InsertionIndicatorOverlay::Create ( ::boost::shared_ptrview::PageObjectLayouter pPageObjectLayouter (
[Libreoffice-commits] core.git: Branch 'feature/slidehack' - 2 commits - sd/source
sd/source/ui/inc/SlideSorterChildWindow.hxx |3 sd/source/ui/inc/SlideSorterViewShell.hxx | 20 + sd/source/ui/inc/ViewShell.hxx|3 sd/source/ui/slidesorter/shell/SlideSorter.cxx| 130 sd/source/ui/slidesorter/shell/SlideSorterChildWindow.cxx |8 sd/source/ui/slidesorter/shell/SlideSorterService.cxx | 144 -- sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 131 sd/source/ui/slidesorter/view/SlideSorterView.cxx | 11 + 8 files changed, 164 insertions(+), 286 deletions(-) New commits: commit 306e688216c1399ca9807b4e6be3058745a4ddfa Author: Michael Meeks michael.me...@suse.com Date: Wed Apr 10 12:21:24 2013 +0100 initial, horrible attempt at slidejockey / search pane. Apparently integrating with the View is really not entirely trivial. Change-Id: Id9db5fdb69b17d26d3ade9e09714c2fd49d744bd diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx index 656622f..17568b5 100644 --- a/sd/source/ui/inc/SlideSorterViewShell.hxx +++ b/sd/source/ui/inc/SlideSorterViewShell.hxx @@ -31,10 +31,15 @@ namespace sd { namespace slidesorter { namespace controller { class SlotManager; } } } +class Edit; +class VclVBox; +class VclHBox; +class FixedText; namespace sd { namespace slidesorter { class SlideSorter; +class SlideSorterContainer; class SlideSorterViewShell : public ViewShell @@ -195,7 +200,7 @@ protected: ViewShellBase rViewShellBase, ::Window* pParentWindow, FrameView* pFrameView); -void Initialize (void); +virtual void Initialize (void); /** This method overwrites the one from our base class: We do our own scroll bar and the base class call is thus unnecessary. It simply @@ -211,11 +216,18 @@ class SlideJockeyViewShell : public SlideSorterViewShell { friend class controller::SlotManager; +::std::auto_ptrVclVBox mpPaned; +::std::auto_ptrVclHBox mpTopHBox; +::std::auto_ptrFixedText mpLabel; +::std::auto_ptrEdit mpSearchEdit; +::std::auto_ptrSlideSorterContainer mpSorterContainer; public: TYPEINFO(); SFX_DECL_INTERFACE(SD_IF_SDSLIDEJOCKEYVIEWSHELL) +virtual ~SlideJockeyViewShell(); + static ::boost::shared_ptrSlideJockeyViewShell Create( SfxViewFrame* pFrame, ViewShellBase rViewShellBase, @@ -223,6 +235,12 @@ public: FrameView* pFrameView, const bool bIsCenterPane); +/// Place and size our contents +virtual void ArrangeGUIElements (void); + +protected: +virtual void Initialize (void); + private: SlideJockeyViewShell ( SfxViewFrame* pFrame, diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index d2e3ce7..e59 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -62,6 +62,11 @@ #include cppuhelper/bootstrap.hxx #include comphelper/processfactory.hxx +// pieces for SlideJockeyView which doesn't truly belong here. +#include vcl/edit.hxx +#include vcl/fixed.hxx +#include vcl/layout.hxx + using namespace ::sd::slidesorter; #define SlideSorterViewShell #define SlideJockeyViewShell @@ -688,9 +693,15 @@ SlideJockeyViewShell::SlideJockeyViewShell ( SfxViewFrame* _pFrame, FrameView* _pFrameView ) : SlideSorterViewShell( _pFrame, _rViewShellBase, _pParentWindow, _pFrameView ) { -fprintf( stderr, Create slide jockey\n ); meShellType = ST_JOCKEY_SORTER; -SetName (OUString(SlideJockeyViewShell)); +SetName(OUString(SlideJockeyViewShell)); +} + +SlideJockeyViewShell::~SlideJockeyViewShell() +{ +// FIXME: need to delete this early - it holds references on random widgets. +mpSlideSorter.reset(); +fprintf(stderr, Delete slide jockey %p\n, this); } ::boost::shared_ptrSlideJockeyViewShell SlideJockeyViewShell::Create ( @@ -718,6 +729,122 @@ SlideJockeyViewShell::SlideJockeyViewShell ( SfxViewFrame* _pFrame, return pViewShell; } +class SlideSorterContainer : public VclBin +{ +public: +::boost::shared_ptrSlideSorter mpSlideSorter; +Size maRequisition; + +SlideSorterContainer( VclContainer *pParent, SlideJockeyViewShell *pShell ) +: VclBin( pParent ) +{ +mpSlideSorter = SlideSorter::CreateSlideSorter( pShell-GetViewShellBase(), pShell, *pParent ); +Show(); +mpSlideSorter-GetContentWindow()-Show(); +} +virtual void setAllocation(const Size rAllocation) +{ +fprintf(stderr, setAllocation %d,%d %dx%d\n, +(int)GetPosPixel().X(), (int)GetPosPixel().Y(), +(int)rAllocation.Width(), (int)rAllocation.Height()); + +mpSlideSorter-ArrangeGUIElements(GetPosPixel(), rAllocation); +