impressdefaults1: #i113018# use red as default pen color, enable pen context menu

This commit is contained in:
Christian Lippka ORACLE 2010-12-01 10:02:17 +01:00
parent a2fa4ea9d8
commit ef238fc511
10 changed files with 22 additions and 59 deletions

3
sd/source/ui/slideshow/makefile.mk Normal file → Executable file
View file

@ -40,8 +40,7 @@ AUTOSEG=true
.INCLUDE : $(PRJ)$/util$/makefile.pmk
.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI
ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI
ENABLE_PRESENTER_EXTRA_UI is not used anymore
.ENDIF
# --- Files --------------------------------------------------------

16
sd/source/ui/slideshow/slideshow.src Normal file → Executable file
View file

@ -71,7 +71,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU
{
Separator = TRUE;
};
#ifdef ENABLE_PRESENTER_EXTRA_UI
MenuItem
{
Identifier = CM_PEN_MODE;
@ -153,8 +152,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU
Identifier = CM_ERASE_INK_PEN;
Text [ en-US ] = "~Eraser Width" ;
SubMenu = Menu
{
SubMenu = Menu
{
ItemList =
{
MenuItem
@ -185,11 +184,10 @@ Menu RID_SLIDESHOW_CONTEXTMENU
};
};
};
#endif
MenuItem
{
Separator = TRUE;
};
MenuItem
{
Separator = TRUE;
};
MenuItem
{
Identifier = CM_SCREEN;
@ -216,6 +214,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU
{
Identifier = CM_ENDSHOW ;
Text [ en-US ] = "~End Show" ;
};
};
};
};

View file

@ -554,15 +554,12 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
, mbInputFreeze(false)
, mbActive(sal_False)
, maPresSettings( pDoc->getPresentationSettings() )
, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default
#ifdef ENABLE_PRESENTER_EXTRA_UI
, mnUserPaintColor( 0x80ff0000L )
, mbSwitchPenMode(true)
, mbSwitchEraserMode(false)
, mdUserPaintStrokeWidth ( 4.0 )
, mdUserPaintStrokeWidth ( 150.0 )
, mbEraseAllInk(false)
//, mbEraseInk(false)
, mnEraseInkSize(100)
#endif
, mnEntryCounter(0)
, mnLastSlideNumber(-1)
, msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") )
@ -1130,7 +1127,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
beans::PropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ),
// User paint color is black by default.
-1, Any( static_cast<sal_Int32>(0x00000000L) ),
-1, Any( mnUserPaintColor ),
beans::PropertyState_DIRECT_VALUE ) );
}
@ -1461,14 +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) );
}
@ -2203,7 +2200,6 @@ 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
@ -2212,7 +2208,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
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 ) );
@ -2280,7 +2275,6 @@ 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);
@ -2378,7 +2372,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
}
}
}
#endif
pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) );
pMenu->Execute( mpShowWindow, maPopupMousePos );
@ -2442,7 +2435,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu )
}
}
break;
#ifdef ENABLE_PRESENTER_EXTRA_UI
if( maPresSettings.mbMouseAsPen )
{
case CM_COLOR_PEN:
@ -2548,7 +2540,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu )
}
break;
}
#endif
case CM_ENDSHOW:
// in case the user cancels the presentation, switch to current slide
@ -3166,7 +3157,6 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc
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 )
@ -3196,7 +3186,6 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc
aPenPropEraseAllInk.Value = aValueEraseAllInk;
mxShow->setProperty( aPenPropEraseAllInk );
mbEraseAllInk = false; // sets to false so not to have it applied again
#endif
}
catch( Exception& e )
{
@ -3210,7 +3199,6 @@ 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() );
@ -3267,7 +3255,7 @@ void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeEx
if( maPresSettings.mbMouseAsPen )
setUsePen( sal_True ); // update color and width
}
#endif
// --------------------------------------------------------------------
sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException)
@ -3282,15 +3270,12 @@ 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)
@ -3312,7 +3297,7 @@ void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (Runti
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
mbSwitchEraserMode = bSwitchEraserMode;
if(mbSwitchEraserMode = true){
if(mbSwitchEraserMode == true){
mbSwitchPenMode = false;
}else{
mbSwitchPenMode = true;
@ -3346,7 +3331,7 @@ void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (Runti
if( maPresSettings.mbMouseAsPen )
setUseEraser( sal_True ); // update erase ink size
}
#endif
// --------------------------------------------------------------------
// XSlideShowController Methods
// --------------------------------------------------------------------

View file

@ -198,7 +198,6 @@ 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);
@ -206,7 +205,6 @@ public:
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);
@ -396,14 +394,13 @@ 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;

View file

@ -267,7 +267,9 @@ namespace slideshow
RGBColor::RGBColor(const RGBColor& rLHS)
{
RGBColor(rLHS.getRed(), rLHS.getGreen(), rLHS.getBlue());
maRGBTriple.mnRed = rLHS.getRed();
maRGBTriple.mnGreen = rLHS.getGreen();
maRGBTriple.mnBlue = rLHS.getBlue();
}
RGBColor& RGBColor::operator=( const RGBColor& rLHS ){

View file

@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : $(PRJ)$/util$/makefile.pmk
.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
CDEFS+=-DENABLE_PRESENTER_EXTRA_UI
ENABLE_PRESENTER_EXTRA_UI is not used anymore
.ENDIF
# --- Common ----------------------------------------------------------

View file

@ -646,20 +646,13 @@ ShapeImporter::ShapeImporter( uno::Reference<drawing::XDrawPage> const&
sal_Int32 nOrdNumStart,
bool bConvertingMasterPage ) :
mxPage( xActualPage ),
#ifdef ENABLE_PRESENTER_EXTRA_UI
mxPagesSupplier( xPagesSupplier ),
#else
mxPagesSupplier( NULL ),
#endif
mrContext( rContext ),
maPolygons(),
maShapesStack(),
mnAscendingPrio( nOrdNumStart ),
mbConvertingMasterPage( bConvertingMasterPage )
{
#ifndef ENABLE_PRESENTER_EXTRA_UI
(void)xPagesSupplier;
#endif
uno::Reference<drawing::XShapes> const xShapes(
xPage, uno::UNO_QUERY_THROW );
maShapesStack.push( XShapesEntry(xShapes) );

View file

@ -454,9 +454,7 @@ void SlideImpl::dispose()
mpShapeManager.reset();
mxRootNode.clear();
mxDrawPage.clear();
#ifndef ENABLE_PRESENTER_EXTRA_UI
mxDrawPagesSupplier.clear();
#endif
}
bool SlideImpl::prefetch()
@ -1259,12 +1257,7 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >&
bool bIntrinsicAnimationsAllowed,
bool bDisableAnimationZOrder )
{
#ifdef ENABLE_PRESENTER_EXTRA_UI
boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue,
#else
(void)xDrawPages;
boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue,
#endif
rEventMultiplexer, rScreenUpdater,
rActivitiesQueue, rUserEventQueue,
rCursorManager, rViewContainer,

View file

@ -156,7 +156,7 @@ namespace slideshow
++aIter )
{
// fully clear view content to background color
(*aIter)->getCanvas()->clear();
//(*aIter)->getCanvas()->clear();
//get via SlideImpl instance the bitmap of the slide unmodified to redraw it
SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) );

View file

@ -1112,11 +1112,7 @@ void SlideShowImpl::displaySlide(
// precondition: must only be called from the main thread!
DBG_TESTSOLARMUTEX();
#ifdef ENABLE_PRESENTER_EXTRA_UI
mxDrawPagesSupplier = xDrawPages;
#else
mxDrawPagesSupplier = NULL;
#endif
stopShow(); // MUST call that: results in
// maUserEventQueue.clear(). What's more,