xref: /aoo41x/main/sd/source/ui/slideshow/showwin.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
30 
31 #include <com/sun/star/awt/Key.hpp>
32 
33 #include "showwindow.hxx"
34 
35 #include <unotools/syslocale.hxx>
36 #include <sfx2/viewfrm.hxx>
37 
38 
39 #include "res_bmp.hrc"
40 #include "slideshow.hxx"
41 #include "ViewShellBase.hxx"
42 #include "slideshow.hxx"
43 #include "sdresid.hxx"
44 #include "helpids.h"
45 #include "strings.hrc"
46 #include <vcl/virdev.hxx>
47 
48 using namespace ::com::sun::star;
49 
50 namespace sd {
51 
52 static const sal_uLong HIDE_MOUSE_TIMEOUT = 10000;
53 static const sal_uLong SHOW_MOUSE_TIMEOUT = 1000;
54 
55 // =============================================================================
56 
57 ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, ::Window* pParent )
58 : ::sd::Window( pParent )
59 , mnPauseTimeout( SLIDE_NO_TIMEOUT )
60 , mnRestartPageIndex( PAGE_NO_END )
61 , meShowWindowMode(SHOWWINDOWMODE_NORMAL)
62 , mbShowNavigatorAfterSpecialMode( sal_False )
63 , mbMouseAutoHide(true)
64 , mbMouseCursorHidden(false)
65 , mnFirstMouseMove(0)
66 , mxController( xController )
67 {
68 	SetOutDevViewType( OUTDEV_VIEWTYPE_SLIDESHOW );
69 
70     // Do never mirror the preview window.  This explicitly includes right
71     // to left writing environments.
72     EnableRTL (sal_False);
73 
74 	MapMode aMap(GetMapMode());
75 	aMap.SetMapUnit(MAP_100TH_MM);
76 	SetMapMode(aMap);
77 
78 	// HelpId setzen
79 	SetHelpId( HID_SD_WIN_PRESENTATION );
80 	SetUniqueId( HID_SD_WIN_PRESENTATION );
81 
82 	maPauseTimer.SetTimeoutHdl( LINK( this, ShowWindow, PauseTimeoutHdl ) );
83 	maPauseTimer.SetTimeout( 1000 );
84 	maMouseTimer.SetTimeoutHdl( LINK( this, ShowWindow, MouseTimeoutHdl ) );
85 	maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
86 
87 	maShowBackground = Wallpaper( Color( COL_BLACK ) );
88 //	SetBackground( Wallpaper( Color( COL_BLACK ) ) );
89     SetBackground(); // avoids that VCL paints any background!
90 	GetParent()->Show();
91 	AddEventListener( LINK( this, ShowWindow, EventHdl ) );
92 }
93 
94 ShowWindow::~ShowWindow(void)
95 {
96 	maPauseTimer.Stop();
97 	maMouseTimer.Stop();
98 }
99 
100 /*************************************************************************
101 |*
102 |* Keyboard event
103 |*
104 \************************************************************************/
105 
106 void ShowWindow::KeyInput(const KeyEvent& rKEvt)
107 {
108 	sal_Bool bReturn = sal_False;
109 
110 	if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
111 	{
112 		TerminateShow();
113 		bReturn = true;
114 	}
115 	else if( SHOWWINDOWMODE_END == meShowWindowMode )
116 	{
117 		const int nKeyCode = rKEvt.GetKeyCode().GetCode();
118 		switch( nKeyCode )
119 		{
120 		case KEY_PAGEUP:
121 		case KEY_LEFT:
122 		case KEY_UP:
123 		case KEY_P:
124 		case KEY_HOME:
125 		case KEY_END:
126 		case awt::Key::CONTEXTMENU:
127 			// these keys will be handled by the slide show even
128 			// while in end mode
129 			break;
130 		default:
131 			TerminateShow();
132 			bReturn = true;
133 		}
134 	}
135 	else if( SHOWWINDOWMODE_BLANK == meShowWindowMode )
136 	{
137 		RestartShow();
138 		bReturn = true;
139 	}
140 	else if( SHOWWINDOWMODE_PAUSE == meShowWindowMode )
141 	{
142 		const int nKeyCode = rKEvt.GetKeyCode().GetCode();
143 		switch( nKeyCode )
144 		{
145 		case KEY_ESCAPE:
146 			TerminateShow();
147 			bReturn = true;
148 			break;
149 		case KEY_PAGEUP:
150 		case KEY_RIGHT:
151 		case KEY_UP:
152 		case KEY_P:
153 		case KEY_HOME:
154 		case KEY_END:
155 		case awt::Key::CONTEXTMENU:
156 			// these keys will be handled by the slide show even
157 			// while in end mode
158 			break;
159 		default:
160 			RestartShow();
161 			bReturn = true;
162 			break;
163 		}
164 	}
165 
166 	if( !bReturn )
167 	{
168 		if( mxController.is() )
169 			bReturn = mxController->keyInput(rKEvt);
170 
171 		if( !bReturn )
172 		{
173 			if( mpViewShell )
174 			{
175 				mpViewShell->KeyInput(rKEvt,this);
176 			}
177 			else
178 			{
179 				Window::KeyInput(rKEvt);
180 			}
181 		}
182 	}
183 
184 	if( mpViewShell )
185 		mpViewShell->SetActiveWindow( this );
186 }
187 
188 /*************************************************************************
189 |*
190 |* MouseButtonDown event
191 |*
192 \************************************************************************/
193 
194 void ShowWindow::MouseButtonDown(const MouseEvent& /*rMEvt*/)
195 {
196 	if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
197 	{
198 		TerminateShow();
199 	}
200 	else if( mpViewShell )
201 	{
202 		mpViewShell->SetActiveWindow( this );
203 	}
204 }
205 
206 /*************************************************************************
207 |*
208 |* MouseMove event
209 |*
210 \************************************************************************/
211 
212 void ShowWindow::MouseMove(const MouseEvent& /*rMEvt*/)
213 {
214 	if( mbMouseAutoHide )
215 	{
216 		if( mbMouseCursorHidden )
217 		{
218 			if( mnFirstMouseMove )
219 			{
220 				// if this is not the first mouse move while hidden, see if
221 				// enough time has pasted to show mouse pointer again
222 				sal_uLong nTime = Time::GetSystemTicks();
223 				if( (nTime - mnFirstMouseMove) >= SHOW_MOUSE_TIMEOUT )
224 				{
225 					ShowPointer( sal_True );
226 					mnFirstMouseMove = 0;
227 					mbMouseCursorHidden = false;
228 					maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
229 					maMouseTimer.Start();
230 				}
231 			}
232 			else
233 			{
234 				// if this is the first mouse move, note current
235 				// time and start idle timer to cancel show mouse pointer
236 				// again if not enough mouse movement is measured
237 				mnFirstMouseMove = Time::GetSystemTicks();
238 				maMouseTimer.SetTimeout( 2*SHOW_MOUSE_TIMEOUT );
239 				maMouseTimer.Start();
240 			}
241 		}
242 		else
243 		{
244 			// current mousemove restarts the idle timer to hide the mouse
245 			maMouseTimer.Start();
246 		}
247 	}
248 
249 	if( mpViewShell )
250 		mpViewShell->SetActiveWindow( this );
251 }
252 
253 /*************************************************************************
254 |*
255 |* MouseButtonUp event
256 |*
257 \************************************************************************/
258 
259 void ShowWindow::MouseButtonUp(const MouseEvent& rMEvt)
260 {
261 	if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
262 	{
263 		TerminateShow();
264 	}
265 	else if( (SHOWWINDOWMODE_END == meShowWindowMode) && !rMEvt.IsRight() )
266 	{
267 		TerminateShow();
268 	}
269 	else if( (( SHOWWINDOWMODE_BLANK == meShowWindowMode ) || ( SHOWWINDOWMODE_PAUSE == meShowWindowMode ))
270 			 && !rMEvt.IsRight() )
271 	{
272         RestartShow();
273 	}
274 	else
275 	{
276 		if( mxController.is() )
277 			mxController->mouseButtonUp( rMEvt );
278 	}
279 }
280 
281 /*************************************************************************
282 |*
283 |* Paint-Event: wenn FuSlideShow noch erreichbar ist, weiterleiten
284 |*
285 \************************************************************************/
286 
287 void ShowWindow::Paint(const Rectangle& rRect)
288 {
289 	if( (meShowWindowMode == SHOWWINDOWMODE_NORMAL) || (meShowWindowMode == SHOWWINDOWMODE_PREVIEW) )
290 	{
291 /*
292 		Region aOldClipRegion( GetClipRegion() );
293 
294 		Region aClipRegion( rRect );
295 		aClipRegion.Exclude( maPresArea );
296 		SetClipRegion( aClipRegion );
297 
298 		DrawWallpaper( rRect, maShowBackground );
299 
300 		SetClipRegion( aOldClipRegion );
301 */
302 		if( mxController.is() )
303 		{
304 			mxController->paint(rRect);
305 		}
306 		else if(mpViewShell )
307 		{
308 			mpViewShell->Paint(rRect, this);
309 		}
310 	}
311 	else
312 	{
313 		DrawWallpaper( rRect, maShowBackground );
314 
315 		if( SHOWWINDOWMODE_END == meShowWindowMode )
316 		{
317 			DrawEndScene();
318 		}
319 		else if( SHOWWINDOWMODE_PAUSE == meShowWindowMode )
320 		{
321 			DrawPauseScene( sal_False );
322 		}
323 		else if( SHOWWINDOWMODE_BLANK == meShowWindowMode )
324 		{
325 			DrawBlankScene();
326 		}
327 	}
328 }
329 
330 /*************************************************************************
331 |*
332 |* Notify
333 |*
334 \************************************************************************/
335 
336 long ShowWindow::Notify(NotifyEvent& rNEvt)
337 {
338 	long nOK = sal_False;
339 /*
340 	if( mpViewShell && rNEvt.GetType() == EVENT_GETFOCUS )
341 	{
342 		NotifyEvent aNEvt(EVENT_GETFOCUS, this);
343 		nOK = mpViewShell->GetViewFrame()->GetWindow().Notify(aNEvt);
344 	}
345 */
346 	if (!nOK)
347 		nOK = Window::Notify(rNEvt);
348 
349 	return nOK;
350 }
351 
352 
353 // -----------------------------------------------------------------------------
354 
355 void ShowWindow::GetFocus()
356 {
357 	// Basisklasse
358 	Window::GetFocus();
359 /*
360 	if( mpViewShell )
361 	{
362 		NotifyEvent aNEvt(EVENT_GETFOCUS, this);
363 		mpViewShell->GetViewFrame()->GetWindow().Notify(aNEvt);
364 	}
365 */
366 }
367 
368 // -----------------------------------------------------------------------------
369 
370 void ShowWindow::LoseFocus()
371 {
372 	Window::LoseFocus();
373 
374 	if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode)
375 		TerminateShow();
376 }
377 
378 // -----------------------------------------------------------------------------
379 
380 void ShowWindow::Resize()
381 {
382 	::sd::Window::Resize();
383 }
384 
385 // -----------------------------------------------------------------------------
386 
387 void ShowWindow::Move()
388 {
389 	::sd::Window::Move();
390 }
391 
392 // -----------------------------------------------------------------------------
393 
394 sal_Bool ShowWindow::SetEndMode()
395 {
396 	if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
397 	{
398 		DeleteWindowFromPaintView();
399 		meShowWindowMode = SHOWWINDOWMODE_END;
400 //		maShowBackground = GetBackground();
401 //		SetBackground( Wallpaper( Color( COL_BLACK ) ) );
402 		maShowBackground = Wallpaper( Color( COL_BLACK ) );
403 
404 		// hide navigator if it is visible
405 		if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
406 		{
407 			mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
408 			mbShowNavigatorAfterSpecialMode = sal_True;
409 		}
410 
411 		Invalidate();
412 	}
413 
414 	return( SHOWWINDOWMODE_END == meShowWindowMode );
415 }
416 
417 // -----------------------------------------------------------------------------
418 
419 sal_Bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout, Graphic* pLogo )
420 {
421 	rtl::Reference< SlideShow > xSlideShow;
422 
423 	if( mpViewShell )
424 		xSlideShow = SlideShow::GetSlideShow( mpViewShell->GetViewShellBase() );
425 
426 	if( xSlideShow.is() && !nTimeout )
427 	{
428 		xSlideShow->jumpToPageIndex( nPageIndexToRestart );
429 	}
430 	else if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
431 	{
432 		DeleteWindowFromPaintView();
433 		mnPauseTimeout = nTimeout;
434 		mnRestartPageIndex = nPageIndexToRestart;
435 		meShowWindowMode = SHOWWINDOWMODE_PAUSE;
436 //		maShowBackground = GetBackground();
437 //		SetBackground( Wallpaper( Color( COL_BLACK ) ) );
438 		maShowBackground = Wallpaper( Color( COL_BLACK ) );
439 
440 		// hide navigator if it is visible
441 		if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
442 		{
443 			mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
444 			mbShowNavigatorAfterSpecialMode = sal_True;
445 		}
446 
447 		if( pLogo )
448 			maLogo = *pLogo;
449 
450 		Invalidate();
451 
452 		if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
453 			maPauseTimer.Start();
454 	}
455 
456 	return( SHOWWINDOWMODE_PAUSE == meShowWindowMode );
457 }
458 
459 // -----------------------------------------------------------------------------
460 
461 sal_Bool ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor )
462 {
463     if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
464 	{
465 		DeleteWindowFromPaintView();
466 		mnRestartPageIndex = nPageIndexToRestart;
467 		meShowWindowMode = SHOWWINDOWMODE_BLANK;
468 //		maShowBackground = GetBackground();
469 //		SetBackground( Wallpaper( rBlankColor ) );
470 		maShowBackground = Wallpaper( rBlankColor );
471 
472 		// hide navigator if it is visible
473 		if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
474 		{
475 			mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
476 			mbShowNavigatorAfterSpecialMode = sal_True;
477 		}
478 
479 		Invalidate();
480 	}
481 
482 	return( SHOWWINDOWMODE_BLANK == meShowWindowMode );
483 }
484 
485 // -----------------------------------------------------------------------------
486 
487 void ShowWindow::SetPreviewMode()
488 {
489 	meShowWindowMode = SHOWWINDOWMODE_PREVIEW;
490 }
491 
492 // -----------------------------------------------------------------------------
493 
494 void ShowWindow::TerminateShow()
495 {
496 	maLogo.Clear();
497 	maPauseTimer.Stop();
498 	maMouseTimer.Stop();
499 	Erase();
500 //	SetBackground( maShowBackground );
501 	maShowBackground = Wallpaper( Color( COL_BLACK ) );
502     meShowWindowMode = SHOWWINDOWMODE_NORMAL;
503 	mnPauseTimeout = SLIDE_NO_TIMEOUT;
504 
505 	if( mpViewShell )
506 	{
507 		// show navigator?
508 		if( mbShowNavigatorAfterSpecialMode )
509 		{
510 			mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True );
511 			mbShowNavigatorAfterSpecialMode = sal_False;
512 		}
513 	}
514 
515 	if( mxController.is() )
516 		mxController->endPresentation();
517 
518 	mnRestartPageIndex = PAGE_NO_END;
519 }
520 
521 // -----------------------------------------------------------------------------
522 
523 void ShowWindow::RestartShow()
524 {
525 	RestartShow( mnRestartPageIndex );
526 }
527 
528 // -----------------------------------------------------------------------------
529 
530 void ShowWindow::RestartShow( sal_Int32 nPageIndexToRestart )
531 
532 {
533     ShowWindowMode eOldShowWindowMode = meShowWindowMode;
534 
535 	maLogo.Clear();
536 	maPauseTimer.Stop();
537 	Erase();
538 //	SetBackground( maShowBackground );
539 	maShowBackground = Wallpaper( Color( COL_BLACK ) );
540 	meShowWindowMode = SHOWWINDOWMODE_NORMAL;
541 	mnPauseTimeout = SLIDE_NO_TIMEOUT;
542 
543 	if( mpViewShell )
544 	{
545 		rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( mpViewShell->GetViewShellBase() ) );
546 
547  		if( xSlideShow.is() )
548 		{
549 			AddWindowToPaintView();
550 
551 		    if( SHOWWINDOWMODE_BLANK == eOldShowWindowMode )
552 			{
553 				xSlideShow->pause(false);
554 				Invalidate();
555 			}
556 		    else
557 			{
558 				xSlideShow->jumpToPageIndex( nPageIndexToRestart );
559 			}
560 		}
561 	}
562 
563 	mnRestartPageIndex = PAGE_NO_END;
564 
565 	// show navigator?
566 	if( mbShowNavigatorAfterSpecialMode )
567 	{
568 		mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True );
569 		mbShowNavigatorAfterSpecialMode = sal_False;
570 	}
571 }
572 
573 // -----------------------------------------------------------------------------
574 
575 void ShowWindow::DrawPauseScene( sal_Bool bTimeoutOnly )
576 {
577 	const MapMode&	rMap = GetMapMode();
578 	const Point		aOutOrg( PixelToLogic( Point() ) );
579 	const Size		aOutSize( GetOutputSize() );
580 	const Size		aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, rMap ) );
581 	const Size		aOffset( LogicToLogic( Size( 1000, 1000 ), MAP_100TH_MM, rMap ) );
582 	String			aText( SdResId( STR_PRES_PAUSE ) );
583 	sal_Bool			bDrawn = sal_False;
584 
585 	Font 			aFont( GetSettings().GetStyleSettings().GetMenuFont() );
586 	const Font 		aOldFont( GetFont() );
587 
588 	aFont.SetSize( aTextSize );
589 	aFont.SetColor( COL_WHITE );
590 	aFont.SetCharSet( aOldFont.GetCharSet() );
591 	aFont.SetLanguage( aOldFont.GetLanguage() );
592 
593 	if( !bTimeoutOnly && ( maLogo.GetType() != GRAPHIC_NONE ) )
594 	{
595 		Size aGrfSize;
596 
597 		if( maLogo.GetPrefMapMode() == MAP_PIXEL )
598 			aGrfSize = PixelToLogic( maLogo.GetPrefSize() );
599 		else
600 			aGrfSize = LogicToLogic( maLogo.GetPrefSize(), maLogo.GetPrefMapMode(), rMap );
601 
602 		const Point	aGrfPos( Max( aOutOrg.X() + aOutSize.Width() - aGrfSize.Width() - aOffset.Width(), aOutOrg.X() ),
603 							 Max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) );
604 
605 		if( maLogo.IsAnimated() )
606 			maLogo.StartAnimation( this, aGrfPos, aGrfSize, (long) this );
607 		else
608 			maLogo.Draw( this, aGrfPos, aGrfSize );
609 	}
610 
611 	if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
612 	{
613 		MapMode			aVMap( rMap );
614 		VirtualDevice	aVDev( *this );
615 
616 		aVMap.SetOrigin( Point() );
617 		aVDev.SetMapMode( aVMap );
618 		aVDev.SetBackground( Wallpaper( Color( COL_BLACK ) ) );
619 
620 		// set font first, to determine real output height
621 		aVDev.SetFont( aFont );
622 
623 		const Size aVDevSize( aOutSize.Width(), aVDev.GetTextHeight() );
624 
625 		if( aVDev.SetOutputSize( aVDevSize ) )
626 		{
627 			// Note: if performance gets an issue here, we can use NumberFormatter directly
628 			SvtSysLocale				aSysLocale;
629 			const LocaleDataWrapper&    aLocaleData = aSysLocale.GetLocaleData();
630 
631 			aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " ( " ));
632 			aText += aLocaleData.getDuration( Time( 0, 0, mnPauseTimeout ) );
633 			aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " )" ));
634 			aVDev.DrawText( Point( aOffset.Width(), 0 ), aText );
635 			DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, aVDev );
636 			bDrawn = sal_True;
637 		}
638 	}
639 
640 	if( !bDrawn )
641 	{
642 		SetFont( aFont );
643 		DrawText( Point( aOutOrg.X() + aOffset.Width(), aOutOrg.Y() + aOffset.Height() ), aText );
644 		SetFont( aOldFont );
645 	}
646 }
647 
648 // -----------------------------------------------------------------------------
649 
650 void ShowWindow::DrawEndScene()
651 {
652 	const Font		aOldFont( GetFont() );
653 	Font			aFont( GetSettings().GetStyleSettings().GetMenuFont() );
654 
655 	const Point		aOutOrg( PixelToLogic( Point() ) );
656 	const Size		aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, GetMapMode() ) );
657 	const String	aText( SdResId( STR_PRES_SOFTEND ) );
658 
659 	aFont.SetSize( aTextSize );
660 	aFont.SetColor( COL_WHITE );
661 	aFont.SetCharSet( aOldFont.GetCharSet() );
662 	aFont.SetLanguage( aOldFont.GetLanguage() );
663 	SetFont( aFont );
664 	DrawText( Point( aOutOrg.X() + aTextSize.Height(), aOutOrg.Y() + aTextSize.Height() ), aText );
665 	SetFont( aOldFont );
666 }
667 
668 // -----------------------------------------------------------------------------
669 
670 void ShowWindow::DrawBlankScene()
671 {
672     // just blank through background color => nothing to be done here
673 }
674 
675 // -----------------------------------------------------------------------------
676 
677 IMPL_LINK( ShowWindow, PauseTimeoutHdl, Timer*, pTimer )
678 {
679 	if( !( --mnPauseTimeout ) )
680 		RestartShow();
681 	else
682 	{
683 		DrawPauseScene( sal_True );
684 		pTimer->Start();
685 	}
686 
687 	return 0L;
688 }
689 
690 IMPL_LINK( ShowWindow, MouseTimeoutHdl, Timer*, EMPTYARG )
691 {
692 	if( mbMouseCursorHidden )
693 	{
694 		// not enough mouse movements since first recording so
695 		// cancle show mouse pointer for now
696 		mnFirstMouseMove = 0;
697 	}
698 	else
699 	{
700 		// mouse has been idle to long, hide pointer
701 		ShowPointer( sal_False );
702 		mbMouseCursorHidden = true;
703 	}
704 	return 0L;
705 }
706 
707 IMPL_LINK( ShowWindow, EventHdl, VclWindowEvent*, pEvent )
708 {
709 	if( mbMouseAutoHide )
710 	{
711 		if (pEvent->GetId() == VCLEVENT_WINDOW_SHOW)
712 		{
713 			maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
714 			maMouseTimer.Start();
715 		}
716 	}
717 	return 0L;
718 }
719 
720 void ShowWindow::SetPresentationArea( const Rectangle& rPresArea )
721 {
722 	maPresArea = rPresArea;
723 }
724 
725 void ShowWindow::DeleteWindowFromPaintView()
726 {
727 	if( mpViewShell->GetView() )
728 		mpViewShell->GetView()->DeleteWindowFromPaintView( this );
729 
730     sal_uInt16 nChild = GetChildCount();
731 	while( nChild-- )
732 		GetChild( nChild )->Show( sal_False );
733 }
734 
735 void ShowWindow::AddWindowToPaintView()
736 {
737 	if( mpViewShell->GetView() )
738 		mpViewShell->GetView()->AddWindowToPaintView( this );
739 
740     sal_uInt16 nChild = GetChildCount();
741 	while( nChild-- )
742 		GetChild( nChild )->Show( sal_True );
743 }
744 
745 } // end of namespace sd
746