ASPiK SDK
clayeredviewcontainer.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 __clayeredviewcontainer__
6 #define __clayeredviewcontainer__
7 
8 #include "cviewcontainer.h"
9 #include "iviewlistener.h"
10 #include "iscalefactorchangedlistener.h"
11 #include "platform/iplatformviewlayer.h"
12 
13 namespace VSTGUI {
14 
15 //-----------------------------------------------------------------------------
16 // CLayeredViewContainer Declaration
22 //-----------------------------------------------------------------------------
24 {
25 public:
26  explicit CLayeredViewContainer (const CRect& r = CRect (0, 0, 0, 0));
27  ~CLayeredViewContainer () noexcept override = default;
28 
29  IPlatformViewLayer* getPlatformLayer () const { return layer; }
30 
31  void setZIndex (uint32_t zIndex);
32  uint32_t getZIndex () const { return zIndex; }
33 
34  bool removed (CView* parent) override;
35  bool attached (CView* parent) override;
36  void invalid () override;
37  void invalidRect (const CRect& rect) override;
38  void parentSizeChanged () override;
39  void setViewSize (const CRect& rect, bool invalid = true) override;
40  void setAlphaValue (float alpha) override;
41 //-----------------------------------------------------------------------------
42 protected:
43  void drawRect (CDrawContext* pContext, const CRect& updateRect) override;
44  void drawViewLayer (CDrawContext* context, const CRect& dirtyRect) override;
45  void viewContainerTransformChanged (CViewContainer* container) override;
46  void onScaleFactorChanged (CFrame* frame, double newScaleFactor) override;
47  void updateLayerSize ();
48  CGraphicsTransform getDrawTransform () const;
49  void registerListeners (bool state);
50 
52  CLayeredViewContainer* parentLayerView {nullptr};
53  uint32_t zIndex {0};
54 };
55 
56 } // namespace
57 
58 #endif // __clayeredviewcontainer__
void invalid() override
mark whole view as invalid
Definition: clayeredviewcontainer.cpp:130
Container Class of CView objects.
Definition: cviewcontainer.h:52
void setAlphaValue(float alpha) override
set alpha value which will be applied when drawing this view
Definition: clayeredviewcontainer.cpp:174
Rect structure.
Definition: crect.h:17
ViewContainer Listener Interface Adapter.
Definition: iviewlistener.h:59
void drawRect(CDrawContext *pContext, const CRect &updateRect) override
called if the view should draw itself
Definition: clayeredviewcontainer.cpp:186
Definition: vstguibase.h:299
void invalidRect(const CRect &rect) override
mark rect as invalid
Definition: clayeredviewcontainer.cpp:138
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
bool attached(CView *parent) override
view is attached to a parent view
Definition: clayeredviewcontainer.cpp:71
void parentSizeChanged() override
notification that one of the views parent has changed its size
Definition: clayeredviewcontainer.cpp:153
a view container which draws into a platform layer on top of a parent layer or the platform viewA CLa...
Definition: clayeredviewcontainer.h:23
bool removed(CView *parent) override
view is removed from parent view
Definition: clayeredviewcontainer.cpp:56
void setViewSize(const CRect &rect, bool invalid=true) override
set views size
Definition: clayeredviewcontainer.cpp:164
Definition: customcontrols.cpp:8
Definition: iplatformviewlayer.h:13
Definition: iplatformviewlayer.h:22
Base Class of all view objects.
Definition: cview.h:44
Definition: iscalefactorchangedlistener.h:13
Graphics Transform Matrix.
Definition: cgraphicstransform.h:23
The CFrame is the parent container of all views.
Definition: cframe.h:32