ASPiK SDK
csplashscreen.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __csplashscreen__
6 #define __csplashscreen__
7 
8 #include "ccontrol.h"
9 #include "icontrollistener.h"
10 
11 namespace VSTGUI {
12 
13 //-----------------------------------------------------------------------------
14 // CSplashScreen Declaration
17 //-----------------------------------------------------------------------------
18 class CSplashScreen : public CControl, public IControlListener
19 {
20 public:
21  CSplashScreen (const CRect& size, IControlListener* listener, int32_t tag, CBitmap* background, const CRect& toDisplay, const CPoint& offset = CPoint (0, 0));
22  CSplashScreen (const CRect& size, IControlListener* listener, int32_t tag, CView* splashView);
23  CSplashScreen (const CSplashScreen& splashScreen);
24 
25  void draw (CDrawContext*) override;
26  bool hitTest (const CPoint& where, const CButtonState& buttons = -1) override;
27 
28  //-----------------------------------------------------------------------------
30  //-----------------------------------------------------------------------------
32  virtual void unSplash ();
33 
34  virtual void setDisplayArea (const CRect& rect) { toDisplay = rect; }
35  virtual CRect& getDisplayArea (CRect& rect) const { rect = toDisplay; return rect; }
36 
37 
38  CMouseEventResult onMouseDown (CPoint& where, const CButtonState& buttons) override;
39 
40  CLASS_METHODS(CSplashScreen, CControl)
41 protected:
42  ~CSplashScreen () noexcept override;
43  using CControl::valueChanged;
44  void valueChanged (CControl *pControl) override;
45 
46  CRect toDisplay;
47  CRect keepSize;
48  CPoint offset;
49  CView* modalView;
50 };
51 
52 //-----------------------------------------------------------------------------
53 // CAnimationSplashScreen Declaration
57 //-----------------------------------------------------------------------------
59 {
60 public:
61  CAnimationSplashScreen (const CRect& size, int32_t tag, CBitmap* background, CBitmap* splashBitmap);
62  CAnimationSplashScreen (const CAnimationSplashScreen& splashScreen) = default;
63 
64  //-----------------------------------------------------------------------------
66  //-----------------------------------------------------------------------------
68  virtual void setSplashBitmap (CBitmap* bitmap);
69  CBitmap* getSplashBitmap () const;
70 
71  virtual void setSplashRect (const CRect& splashRect);
72  const CRect& getSplashRect () const;
73 
74  virtual void setAnimationIndex (uint32_t index) { animationIndex = index; }
75  uint32_t getAnimationIndex () const { return animationIndex; }
76 
77  virtual void setAnimationTime (uint32_t time) { animationTime = time; }
78  uint32_t getAnimationTime () const { return animationTime; }
79 
81  virtual bool createAnimation (uint32_t animationIndex, uint32_t animationTime, CView* splashView, bool removeViewAnimation);
83 
84  void unSplash () override;
85  void draw (CDrawContext*) override;
86  CMouseEventResult onMouseDown (CPoint& where, const CButtonState& buttons) override;
87  bool sizeToFit () override;
88  CMessageResult notify (CBaseObject* sender, IdStringPtr message) override;
89 
90 protected:
91  ~CAnimationSplashScreen () noexcept override = default;
92 
93  uint32_t animationIndex;
94  uint32_t animationTime;
95 };
96 
97 } // namespace
98 
99 #endif
Rect structure.
Definition: crect.h:17
virtual void setDisplayArea(const CRect &rect)
set the area in which the splash will be displayed
Definition: csplashscreen.h:34
Definition: xmlparse.c:181
CMouseEventResult onMouseDown(CPoint &where, const CButtonState &buttons) override
called when a mouse down event occurs
Definition: csplashscreen.cpp:118
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
Base Object with reference counter.
Definition: vstguibase.h:276
void draw(CDrawContext *) override
called if the view should draw itself
Definition: csplashscreen.cpp:103
virtual CRect & getDisplayArea(CRect &rect) const
get the area in which the splash will be displayed
Definition: csplashscreen.h:35
bool hitTest(const CPoint &where, const CButtonState &buttons=-1) override
check if where hits this view
Definition: csplashscreen.cpp:109
Encapsulates various platform depended kinds of bitmaps.
Definition: cbitmap.h:21
Definition: customcontrols.cpp:8
base class of all VSTGUI controls
Definition: ccontrol.h:76
Button and Modifier state.
Definition: cbuttonstate.h:34
CSplashScreen(const CRect &size, IControlListener *listener, int32_t tag, CBitmap *background, const CRect &toDisplay, const CPoint &offset=CPoint(0, 0))
Definition: csplashscreen.cpp:61
Base Class of all view objects.
Definition: cview.h:44
Definition: csplashscreen.h:18
virtual bool sizeToFit()
resize view to optimal size
Definition: cview.h:138
Point structure.
Definition: cpoint.h:17
a splash screen which animates the opening and closing of the splash bitmap
Definition: csplashscreen.h:58
CMessageResult notify(CBaseObject *sender, IdStringPtr message) override
Definition: cview.cpp:616
virtual void valueChanged()
notifies listener and dependent objects
Definition: ccontrol.cpp:200
Definition: icontrollistener.h:14