1 /*****************************************************************************/
3 // Written by Michael Wilber
4 // Slide show code derived from ShowImage code, written by Michael Pfeiffer
11 // Permission is hereby granted, free of charge, to any person obtaining a
12 // copy of this software and associated documentation files (the "Software"),
13 // to deal in the Software without restriction, including without limitation
14 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 // and/or sell copies of the Software, and to permit persons to whom the
16 // Software is furnished to do so, subject to the following conditions:
18 // The above copyright notice and this permission notice shall be included
19 // in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 // DEALINGS IN THE SOFTWARE.
28 /*****************************************************************************/
31 #ifndef SLIDE_SHOW_SAVER_H
32 #define SLIDE_SHOW_SAVER_H
35 #include <ScreenSaver.h>
39 #include "LiveSettings.h"
41 class SlideShowSaver
:
43 public LiveSettingsObserver
{
45 SlideShowSaver(BMessage
*archive
, image_id image
);
46 virtual ~SlideShowSaver(void);
48 virtual void SettingChanged(uint32 setting
);
50 virtual void StartConfig(BView
*view
);
51 virtual status_t
StartSaver(BView
*view
, bool preview
);
52 virtual void Draw(BView
*view
, int32 frame
);
55 // reload ticksize setting and apply it
56 status_t
UpdateTickSize();
58 status_t
UpdateShowCaption();
59 status_t
UpdateShowBorder();
60 // reload directory setting and apply it
61 status_t
UpdateDirectory();
63 // Function taken from Haiku ShowImage,
64 // function originally written by Michael Pfeiffer
65 status_t
SetImage(const entry_ref
*pref
);
67 // Function originally from Haiku ShowImage
68 bool ShowNextImage(bool next
, bool rewind
);
70 // Function taken from Haiku ShowImage,
71 // function originally written by Michael Pfeiffer
72 bool IsImage(const entry_ref
*pref
);
74 // Function taken from Haiku ShowImage,
75 // function originally written by Michael Pfeiffer
76 bool FindNextImage(entry_ref
*in_current
, entry_ref
*out_image
, bool next
, bool rewind
);
78 // Function taken from Haiku ShowImage,
79 // function originally written by Michael Pfeiffer
80 void FreeEntries(BList
*entries
);
82 void LayoutCaption(BView
*view
, BFont
&font
, BPoint
&pos
, BRect
&rect
);
83 void DrawCaption(BView
*view
);
84 // void UpdateCaption(BView *view);
89 LiveSettings
*fSettings
;
92 entry_ref fCurrentRef
;
97 #endif // #ifndef SLIDE_SHOW_SAVER_H