summaryrefslogtreecommitdiff
path: root/sd/source/ui/slideshow
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/slideshow')
-rw-r--r--sd/source/ui/slideshow/PaneHider.cxx5
-rw-r--r--sd/source/ui/slideshow/PaneHider.hxx5
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.cxx5
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.hxx5
-rw-r--r--sd/source/ui/slideshow/makefile.mk11
-rw-r--r--sd/source/ui/slideshow/showwin.cxx5
-rw-r--r--sd/source/ui/slideshow/showwindow.hxx6
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx21
-rw-r--r--sd/source/ui/slideshow/slideshow.hrc24
-rw-r--r--sd/source/ui/slideshow/slideshow.src130
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx474
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.hxx22
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.cxx5
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.hxx5
14 files changed, 611 insertions, 112 deletions
diff --git a/sd/source/ui/slideshow/PaneHider.cxx b/sd/source/ui/slideshow/PaneHider.cxx
index a6b1241496ca..f0032b27d1a0 100644
--- a/sd/source/ui/slideshow/PaneHider.cxx
+++ b/sd/source/ui/slideshow/PaneHider.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: PaneHider.cxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/PaneHider.hxx b/sd/source/ui/slideshow/PaneHider.hxx
index 54fb7ceef14b..0a865c683adb 100644
--- a/sd/source/ui/slideshow/PaneHider.hxx
+++ b/sd/source/ui/slideshow/PaneHider.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: PaneHider.hxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx
index f1c918be8cd1..dc2c3b3fe5ea 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.cxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SlideShowRestarter.cxx,v $
- * $Revision: 1.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.hxx b/sd/source/ui/slideshow/SlideShowRestarter.hxx
index d976d09a2c60..64ee3e4551f6 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.hxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SlideShowRestarter.hxx,v $
- * $Revision: 1.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk
index e157ba99d3bc..ad4f4d306c6b 100644
--- a/sd/source/ui/slideshow/makefile.mk
+++ b/sd/source/ui/slideshow/makefile.mk
@@ -2,14 +2,10 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2008 by Sun Microsystems, Inc.
+# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.7 $
-#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
@@ -43,6 +39,11 @@ AUTOSEG=true
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
+.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
+RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI
+ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI
+.ENDIF
+
# --- Files --------------------------------------------------------
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index 3fad355c915a..fe6f9483b8b6 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: showwin.cxx,v $
- * $Revision: 1.16 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/showwindow.hxx b/sd/source/ui/slideshow/showwindow.hxx
index 464b4f96a4fd..9521b6946138 100644
--- a/sd/source/ui/slideshow/showwindow.hxx
+++ b/sd/source/ui/slideshow/showwindow.hxx
@@ -2,14 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: showwindow.hxx,v $
- *
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index f1cb2cf4afb9..c951f68d9b74 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshow.cxx,v $
- * $Revision: 1.14 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -35,6 +32,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
+#include <comphelper/serviceinfohelper.hxx>
#include <cppuhelper/bootstrap.hxx>
@@ -43,10 +41,9 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
-
+#include <svx/svdpool.hxx>
#include <svl/itemprop.hxx>
-#include <sfx2/topfrm.hxx>
#include <sfx2/viewfrm.hxx>
#include <toolkit/unohlp.hxx>
@@ -87,7 +84,7 @@ extern String getUiNameFromPageApiNameImpl( const ::rtl::OUString& rApiName );
namespace {
/** This local version of the work window overloads DataChanged() so that it
- can restart the slide show when a displau is added or removed.
+ can restart the slide show when a display is added or removed.
*/
class FullScreenWorkWindow : public WorkWindow
{
@@ -151,7 +148,7 @@ const SfxItemPropertyMapEntry* ImplGetPresentationPropertyMap()
SlideShow::SlideShow( SdDrawDocument* pDoc )
: SlideshowBase( m_aMutex )
-, maPropSet(ImplGetPresentationPropertyMap())
+, maPropSet(ImplGetPresentationPropertyMap(), SdrObject::GetGlobalDrawObjectItemPool())
, mbIsInStartup(false)
, mpDoc( pDoc )
, mpCurrentViewShellBase( 0 )
@@ -278,7 +275,7 @@ OUString SAL_CALL SlideShow::getImplementationName( ) throw(RuntimeException)
sal_Bool SAL_CALL SlideShow::supportsService( const OUString& ServiceName ) throw(RuntimeException)
{
- return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames( ) );
+ return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames( ) );
}
// --------------------------------------------------------------------
@@ -706,9 +703,9 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
{
PresentationViewShell* pShell = dynamic_cast<PresentationViewShell*>(pFullScreenViewShellBase->GetMainViewShell().get());
- if( pShell && pShell->GetViewFrame() && pShell->GetViewFrame()->GetTopFrame() )
+ if( pShell && pShell->GetViewFrame() )
{
- WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame()->GetWindow().GetParent());
+ WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent());
if( pWorkWindow )
{
pWorkWindow->StartPresentationMode( FALSE, isAlwaysOnTop() );
@@ -1202,7 +1199,7 @@ void SlideShow::StartFullscreenPresentation( )
// The new frame is created hidden. To make it visible and activate the
// new view shell--a prerequisite to process slot calls and initialize
// its panes--a GrabFocus() has to be called later on.
- SfxTopFrame* pNewFrame = SfxTopFrame::Create( mpDoc->GetDocSh(), pWorkWindow, PRESENTATION_FACTORY_ID, TRUE);
+ SfxFrame* pNewFrame = SfxFrame::Create( *mpDoc->GetDocSh(), *pWorkWindow, PRESENTATION_FACTORY_ID, true );
pNewFrame->SetPresentationMode(TRUE);
mpFullScreenViewShellBase = static_cast<ViewShellBase*>(pNewFrame->GetCurrentViewFrame()->GetViewShell());
diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc
index 8a9799321738..709e2a79146e 100644
--- a/sd/source/ui/slideshow/slideshow.hrc
+++ b/sd/source/ui/slideshow/slideshow.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshow.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -41,5 +38,24 @@
#define CM_FIRST_SLIDE 8
#define CM_LAST_SLIDE 9
#define CM_SLIDES 10
+//CM for extra presenter UI
+#define CM_ERASE_ALLINK 11
+#define CM_ERASE_INK 12
+#define CM_ERASE_INK_PEN 13
+#define CM_ERASE_INK_PEN_VERY_THIN 14
+#define CM_ERASE_INK_PEN_THIN 15
+#define CM_ERASE_INK_PEN_NORMAL 16
+#define CM_ERASE_INK_PEN_THICK 17
+#define CM_ERASE_INK_PEN_VERY_THICK 18
+#define CM_COLOR_PEN 19
+#define CM_WIDTH_PEN 20
+#define CM_WIDTH_PEN_VERY_THIN 21
+#define CM_WIDTH_PEN_THIN 22
+#define CM_WIDTH_PEN_NORMAL 23
+#define CM_WIDTH_PEN_THICK 24
+#define CM_WIDTH_PEN_VERY_THICK 25
+#define CM_PEN_MODE 26
+#define CM_ERASE_MODE 27
+#define CM_POINTER_OPTION 28
#endif
diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src
index ec57d3e84897..02c225fb5ea9 100644
--- a/sd/source/ui/slideshow/slideshow.src
+++ b/sd/source/ui/slideshow/slideshow.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshow.src,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -74,6 +71,125 @@ Menu RID_SLIDESHOW_CONTEXTMENU
{
Separator = TRUE;
};
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ MenuItem
+ {
+ Identifier = CM_PEN_MODE;
+ Text [ en-US ] = "~Pen Mode";
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_MODE;
+ Text [ en-US ] = "~Eraser Mode";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = CM_WIDTH_PEN;
+ Text [ en-US ] = "~Pen Width" ;
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = CM_WIDTH_PEN_VERY_THIN;
+ Text [ en-US ] = "~Very thin";
+ };
+ MenuItem
+ {
+ Identifier = CM_WIDTH_PEN_THIN;
+ Text [ en-US ] = "~Thin";
+ };
+ MenuItem
+ {
+ Identifier = CM_WIDTH_PEN_NORMAL;
+ Text [ en-US ] = "~Normal";
+ };
+ MenuItem
+ {
+ Identifier = CM_WIDTH_PEN_THICK;
+ Text [ en-US ] = "~Thick";
+ };
+ MenuItem
+ {
+ Identifier = CM_WIDTH_PEN_VERY_THICK;
+ Text [ en-US ] = "~Very Thick";
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = CM_COLOR_PEN ;
+ Text [ en-US ] = "~Change Pen Color" ;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_ALLINK ;
+ Text [ en-US ] = "~Erase All Ink On Slide" ;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_INK_PEN;
+ Text [ en-US ] = "~Eraser Width" ;
+
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = CM_ERASE_INK_PEN_VERY_THIN;
+ Text [ en-US ] = "~Very thin";
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_INK_PEN_THIN;
+ Text [ en-US ] = "~Thin";
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_INK_PEN_NORMAL;
+ Text [ en-US ] = "~Normal";
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_INK_PEN_THICK;
+ Text [ en-US ] = "~Thick";
+ };
+ MenuItem
+ {
+ Identifier = CM_ERASE_INK_PEN_VERY_THICK;
+ Text [ en-US ] = "~Very Thick";
+ };
+ };
+ };
+ };
+#endif
+ MenuItem
+ {
+ Separator = TRUE;
+ };
MenuItem
{
Identifier = CM_SCREEN;
@@ -98,12 +214,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU
};
MenuItem
{
- Separator = TRUE;
- };
- MenuItem
- {
Identifier = CM_ENDSHOW ;
Text [ en-US ] = "~End Show" ;
- };
+ };
};
};
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index e59f45b71e12..d58cfcb3f6c9 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshowimpl.cxx,v $
- * $Revision: 1.57.10.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -34,6 +31,7 @@
#include <boost/scoped_ptr.hpp>
+#include "com/sun/star/frame/XComponentLoader.hpp"
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/drawing/XMasterPageTarget.hpp>
@@ -86,6 +84,7 @@
#include "canvas/elapsedtime.hxx"
#include "canvas/prioritybooster.hxx"
#include "avmedia/mediawindow.hxx"
+#include "svtools/colrdlg.hxx"
#include <boost/noncopyable.hpp>
#include <boost/bind.hpp>
@@ -169,9 +168,9 @@ public:
bool nextSlide();
bool previousSlide();
- void displayCurrentSlide(
- const Reference< XSlideShow >& xShow,
- const bool bSkipAllMainSequenceEffects);
+ void displayCurrentSlide( const Reference< XSlideShow >& xShow,
+ const Reference< XDrawPagesSupplier>& xDrawPages,
+ const bool bSkipAllMainSequenceEffects );
sal_Int32 getNextSlideIndex() const;
sal_Int32 getPreviousSlideIndex() const;
@@ -468,9 +467,9 @@ bool AnimationSlideController::previousSlide()
return jumpToSlideIndex( getPreviousSlideIndex() );
}
-void AnimationSlideController::displayCurrentSlide(
- const Reference< XSlideShow >& xShow,
- const bool bSkipAllMainSequenceEffects)
+void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow,
+ const Reference< XDrawPagesSupplier>& xDrawPages,
+ const bool bSkipAllMainSequenceEffects )
{
const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber();
@@ -519,7 +518,7 @@ void AnimationSlideController::displayCurrentSlide(
aPropertySequence[nIndex] = aProperties[nIndex];
if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) )
- xShow->displaySlide( xSlide, xAnimNode, aPropertySequence );
+ xShow->displaySlide( xSlide, xDrawPages, xAnimNode, aPropertySequence );
}
}
@@ -554,7 +553,15 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
, mbInputFreeze(false)
, mbActive(sal_False)
, maPresSettings( pDoc->getPresentationSettings() )
-, mnUserPaintColor( 0x0000FF00L )
+, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+, mbSwitchPenMode(true)
+, mbSwitchEraserMode(false)
+, mdUserPaintStrokeWidth ( 4.0 )
+, mbEraseAllInk(false)
+//, mbEraseInk(false)
+, mnEraseInkSize(100)
+#endif
, mnEntryCounter(0)
, mnLastSlideNumber(-1)
, msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") )
@@ -1121,7 +1128,8 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
aProperties.push_back(
beans::PropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ),
- -1, Any( static_cast<sal_Int32>(0x0000FF00L) ),
+ // User paint color is black by default.
+ -1, Any( static_cast<sal_Int32>(0x00000000L) ),
beans::PropertyState_DIRECT_VALUE ) );
}
@@ -1431,7 +1439,9 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects)
if( mpSlideController.get() && mxShow.is() )
{
- mpSlideController->displayCurrentSlide( mxShow, bSkipAllMainSequenceEffects );
+ Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(),
+ UNO_QUERY_THROW );
+ mpSlideController->displayCurrentSlide( mxShow, xDrawPages, bSkipAllMainSequenceEffects );
registerShapeEvents(mpSlideController->getCurrentSlideNumber());
update();
@@ -1448,6 +1458,14 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects)
void SlideshowImpl::endPresentation()
{
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ if( maPresSettings.mbMouseAsPen)
+ {
+ Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY );
+ if( xDocFactory.is() )
+ mxShow->registerUserPaintPolygons(xDocFactory);
+ }
+#endif
if( !mnEndShowEvent )
mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) );
}
@@ -2182,6 +2200,17 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) );
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ //adding button to contextual menu for erasing functionnalities for UserPaintOverlay
+ pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen));
+ // Adding button to contextual menu for changing pen color
+ pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen));
+ // Adding button to display if in Pen mode
+ pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen));
+ // Adding button to displau if in Erase Mode
+ pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen));
+#endif
+
const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) );
pMenu->EnableItem( CM_PREV_SLIDE, ( mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) );
@@ -2189,9 +2218,9 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
PopupMenu* pPageMenu = pMenu->GetPopupMenu( CM_GOTO );
SfxViewFrame* pViewFrame = getViewFrame();
- if( pViewFrame && pViewFrame->GetFrame() )
+ if( pViewFrame )
{
- Reference< ::com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame()->GetFrameInterface() );
+ Reference< ::com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() );
if( xFrame.is() )
{
pMenu->SetItemImage( CM_NEXT_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10617") ), FALSE, FALSE ) );
@@ -2248,6 +2277,105 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
pBlankMenu->CheckItem( ( mpShowWindow->GetBlankColor() == Color( COL_WHITE ) ) ? CM_SCREEN_WHITE : CM_SCREEN_BLACK );
}
}
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+
+ PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN);
+
+ // populate color width list
+ if( pWidthMenu )
+ {
+ if(! maPresSettings.mbMouseAsPen)
+ {
+ pMenu->EnableItem( CM_WIDTH_PEN, FALSE );
+ }
+ else
+ {
+ sal_Int32 nIterator;
+ double nWidth;
+
+ nWidth = 4.0;
+ for( nIterator = 1; nIterator < 6; nIterator++)
+ {
+ switch(nIterator)
+ {
+ case 1:
+ nWidth = 4.0;
+ break;
+ case 2:
+ nWidth = 100.0;
+ break;
+ case 3:
+ nWidth = 150.0;
+ break;
+ case 4:
+ nWidth = 200.0;
+ break;
+ case 5:
+ nWidth = 400.0;
+ break;
+ default:
+ break;
+ }
+
+ pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE);
+ if( nWidth == mdUserPaintStrokeWidth)
+ pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) );
+
+ }
+ }
+ }
+
+
+ PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN);
+
+ // populate eraser width list
+ if( pEraseWidthMenu )
+ {
+ if(! maPresSettings.mbMouseAsPen)
+ {
+ pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE );
+ }
+ else
+ {
+ sal_Int32 nEIterator;
+ double nEWidth;
+
+ nEWidth = 100.0;
+ for( nEIterator = 1; nEIterator < 6; nEIterator++)
+ {
+ switch(nEIterator)
+ {
+ case 1:
+ nEWidth = 100.0;
+ break;
+ case 2:
+ nEWidth = 200.0;
+ break;
+ case 3:
+ nEWidth = 300.0;
+ break;
+ case 4:
+ nEWidth = 400.0;
+ break;
+ case 5:
+ nEWidth = 500.0;
+ break;
+ default:
+ break;
+ }
+
+ pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE);
+ if( nEWidth == mnEraseInkSize)
+ pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) );
+ if( mbSwitchPenMode )
+ pMenu->CheckItem( (USHORT)(CM_PEN_MODE));
+ if( mbSwitchEraserMode )
+ pMenu->CheckItem( (USHORT)(CM_ERASE_MODE));
+
+ }
+ }
+ }
+#endif
pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) );
pMenu->Execute( mpShowWindow, maPopupMousePos );
@@ -2311,32 +2439,139 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu )
}
}
break;
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ if( maPresSettings.mbMouseAsPen )
+ {
+ case CM_COLOR_PEN:
+ {
+ //Open a color picker based on SvColorDialog
+ ::Color aColor( mnUserPaintColor );
+ SvColorDialog aColorDlg( mpShowWindow);
+ aColorDlg.SetColor( aColor );
- case CM_ENDSHOW:
- // in case the user cancels the presentation, switch to current slide
- // in edit mode
- if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
- {
- if( mpSlideController->getCurrentSlideNumber() != -1 )
+ if (aColorDlg.Execute() )
+ {
+ aColor = aColorDlg.GetColor();
+ mnUserPaintColor = aColor.GetColor();
+ setPenColor(mnUserPaintColor);
+ }
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_WIDTH_PEN_VERY_THIN:
{
- mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
+ setPenWidth(4.0);
+ mbWasPaused = false;
}
- }
- endPresentation();
- break;
- default:
- sal_Int32 nPageNumber = nMenuId - CM_SLIDES;
- const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
- if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) )
- {
- mpShowWindow->RestartShow( nPageNumber );
- }
- else if( nPageNumber != mpSlideController->getCurrentSlideNumber() )
- {
- displaySlideNumber( nPageNumber );
- }
- mbWasPaused = false;
- break;
+ break;
+
+ case CM_WIDTH_PEN_THIN:
+ {
+ setPenWidth(100.0);
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_WIDTH_PEN_NORMAL:
+ {
+ setPenWidth(150.0);
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_WIDTH_PEN_THICK:
+ {
+ setPenWidth(200.0);
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_WIDTH_PEN_VERY_THICK:
+ {
+ setPenWidth(400.0);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_ERASE_ALLINK:
+ {
+ setEraseAllInk(true);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_PEN_MODE:
+ {
+ setPenMode(true);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_ERASE_MODE:
+ {
+ setEraserMode(true);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_ERASE_INK_PEN_VERY_THIN:
+ {
+ setEraseInk(100);
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_ERASE_INK_PEN_THIN:
+ {
+ setEraseInk(200);
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_ERASE_INK_PEN_NORMAL:
+ {
+ setEraseInk(300);
+ mbWasPaused = false;
+ }
+ break;
+
+ case CM_ERASE_INK_PEN_THICK:
+ {
+ setEraseInk(400);
+ mbWasPaused = false;
+ }
+ break;
+ case CM_ERASE_INK_PEN_VERY_THICK:
+ {
+ setEraseInk(500);
+ mbWasPaused = false;
+ }
+ break;
+ }
+#endif
+
+ case CM_ENDSHOW:
+ // in case the user cancels the presentation, switch to current slide
+ // in edit mode
+ if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
+ {
+ if( mpSlideController->getCurrentSlideNumber() != -1 )
+ {
+ mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
+ }
+ }
+ endPresentation();
+ break;
+ default:
+ sal_Int32 nPageNumber = nMenuId - CM_SLIDES;
+ const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
+ if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) )
+ {
+ mpShowWindow->RestartShow( nPageNumber );
+ }
+ else if( nPageNumber != mpSlideController->getCurrentSlideNumber() )
+ {
+ displaySlideNumber( nPageNumber );
+ }
+ mbWasPaused = false;
+ break;
}
}
@@ -2608,12 +2843,12 @@ void SlideshowImpl::setActiveXToolbarsVisible( sal_Bool bVisible )
// this is a plugin/activex mode, no toolbars should be visible during slide show
// after the end of slide show they should be visible again
SfxViewFrame* pViewFrame = getViewFrame();
- if( pViewFrame && pViewFrame->GetFrame() && pViewFrame->GetFrame()->GetTopFrame() )
+ if( pViewFrame )
{
try
{
Reference< frame::XLayoutManager > xLayoutManager;
- Reference< beans::XPropertySet > xFrameProps( pViewFrame->GetFrame()->GetTopFrame()->GetFrameInterface(), UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xFrameProps( pViewFrame->GetFrame().GetTopFrame().GetFrameInterface(), UNO_QUERY_THROW );
if ( ( xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) )
>>= xLayoutManager )
&& xLayoutManager.is() )
@@ -2919,16 +3154,46 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc
maPresSettings.mbMouseAsPen = bMouseAsPen;
if( mxShow.is() ) try
{
+ // For Pencolor;
Any aValue;
if( maPresSettings.mbMouseAsPen )
- // todo: take color from configuration
- aValue <<= mnUserPaintColor;
-
+ // TODO: take color from configuration
+ aValue <<= mnUserPaintColor;
beans::PropertyValue aPenProp;
aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" ));
aPenProp.Value = aValue;
-
mxShow->setProperty( aPenProp );
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ //for StrokeWidth :
+ Any aValueWidth;
+ if( maPresSettings.mbMouseAsPen )
+ aValueWidth <<= mdUserPaintStrokeWidth;
+
+ beans::PropertyValue aPenPropWidth;
+ aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" ));
+ aPenPropWidth.Value = aValueWidth;
+
+ mxShow->setProperty( aPenPropWidth );
+
+ // for Pen Mode
+ Any aValueSwitchPenMode;
+ if( maPresSettings.mbMouseAsPen )
+ aValueSwitchPenMode <<= mbSwitchPenMode;
+ beans::PropertyValue aPenPropSwitchPenMode;
+ aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" ));
+ aPenPropSwitchPenMode.Value = aValueSwitchPenMode;
+ mxShow->setProperty( aPenPropSwitchPenMode );
+
+ //for EraseAllInk :
+ Any aValueEraseAllInk;
+ if( maPresSettings.mbMouseAsPen )
+ aValueEraseAllInk <<= mbEraseAllInk;
+ beans::PropertyValue aPenPropEraseAllInk;
+ aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" ));
+ aPenPropEraseAllInk.Value = aValueEraseAllInk;
+ mxShow->setProperty( aPenPropEraseAllInk );
+ mbEraseAllInk = false; // sets to false so not to have it applied again
+#endif
}
catch( Exception& e )
{
@@ -2942,6 +3207,64 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc
}
}
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ maPresSettings.mbMouseAsPen = bMouseAsPen;
+ if( mxShow.is() ) try
+ {
+
+ //for EraseInk :
+ Any aValueEraseInk;
+ if( maPresSettings.mbMouseAsPen )
+ aValueEraseInk <<= mnEraseInkSize;
+ beans::PropertyValue aPenPropEraseInk;
+ aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" ));
+ aPenPropEraseInk.Value = aValueEraseInk;
+ mxShow->setProperty( aPenPropEraseInk );
+
+ // for Erase Mode
+ Any aValueSwitchEraserMode;
+ if( maPresSettings.mbMouseAsPen )
+ aValueSwitchEraserMode <<= mbSwitchEraserMode;
+ beans::PropertyValue aPenPropSwitchEraserMode;
+ aPenPropSwitchEraserMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchEraserMode" ));
+ aPenPropSwitchEraserMode.Value = aValueSwitchEraserMode;
+ mxShow->setProperty( aPenPropSwitchEraserMode );
+ }
+ catch( Exception& e )
+ {
+ static_cast<void>(e);
+ DBG_ERROR(
+ (OString("sd::SlideshowImpl::setUseEraser(), "
+ "exception caught: ") +
+ rtl::OUStringToOString(
+ comphelper::anyToString( cppu::getCaughtException() ),
+ RTL_TEXTENCODING_UTF8 )).getStr() );
+ }
+}
+
+// --------------------------------------------------------------------
+
+double SAL_CALL SlideshowImpl::getPenWidth() throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ return mdUserPaintStrokeWidth;
+}
+
+// --------------------------------------------------------------------
+
+void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ mdUserPaintStrokeWidth = dStrokeWidth;
+ mbSwitchPenMode = true;
+ mbSwitchEraserMode = !mbSwitchPenMode;
+ if( maPresSettings.mbMouseAsPen )
+ setUsePen( sal_True ); // update color and width
+}
+#endif
// --------------------------------------------------------------------
sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException)
@@ -2956,10 +3279,71 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
mnUserPaintColor = nColor;
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ mbSwitchPenMode = true;
+ mbSwitchEraserMode = !mbSwitchPenMode;
+#endif
if( maPresSettings.mbMouseAsPen )
setUsePen( sal_True ); // update color
}
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+// --------------------------------------------------------------------
+
+void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ mbSwitchPenMode = bSwitchPenMode;
+
+ if(mbSwitchPenMode == true){
+ mbSwitchEraserMode = false;
+ }else{
+ mbSwitchEraserMode = true;
+ }
+ if( maPresSettings.mbMouseAsPen )
+ setUsePen( sal_True ); // Switch to Pen Mode
+
+}
+
+void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ mbSwitchEraserMode = bSwitchEraserMode;
+ if(mbSwitchEraserMode = true){
+ mbSwitchPenMode = false;
+ }else{
+ mbSwitchPenMode = true;
+ }
+
+ if( maPresSettings.mbMouseAsPen )
+ setUseEraser( sal_True ); // Switch to EraseMode
+
+}
+
+
+// --------------------------------------------------------------------
+
+void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ mbEraseAllInk=bEraseAllInk;
+ mbSwitchPenMode = true;
+ mbSwitchEraserMode = false;
+ if( maPresSettings.mbMouseAsPen )
+ setUsePen( sal_True ); // update erase all ink bool
+}
+
+
+void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ mnEraseInkSize=nEraseInkSize;
+ mbSwitchPenMode = false;
+ mbSwitchEraserMode = true;
+ if( maPresSettings.mbMouseAsPen )
+ setUseEraser( sal_True ); // update erase ink size
+}
+#endif
// --------------------------------------------------------------------
// XSlideShowController Methods
// --------------------------------------------------------------------
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index 96b24913c45e..48dca432671c 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshowimpl.hxx,v $
- * $Revision: 1.29 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -202,6 +199,15 @@ public:
virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException);
virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException);
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
+ virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEraseAllInk( bool bEraseAllInk ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException);
+#endif
virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException);
@@ -391,6 +397,14 @@ private:
PresentationSettings maPresSettings;
sal_Int32 mnUserPaintColor;
+#ifdef ENABLE_PRESENTER_EXTRA_UI
+ bool mbSwitchPenMode;
+ bool mbSwitchEraserMode;
+ double mdUserPaintStrokeWidth;
+ bool mbEraseAllInk;
+// bool mbEraseInk;
+ sal_Int32 mnEraseInkSize;
+#endif
/// used in updateHdl to prevent recursive calls
sal_Int32 mnEntryCounter;
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx
index 69190f68a0aa..c92a3913670b 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshowviewimpl.cxx,v $
- * $Revision: 1.21 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.hxx b/sd/source/ui/slideshow/slideshowviewimpl.hxx
index 4d2ecbdef39c..8e22a5d9fd7f 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: slideshowviewimpl.hxx,v $
- * $Revision: 1.14 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify