ASPiK SDK
caviewlayer.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 __caviewlayer__
6 #define __caviewlayer__
7 
8 #include "../iplatformviewlayer.h"
9 
10 #if MAC_COCOA
11 
12 #include "../platform_macos.h"
13 
14 namespace VSTGUI {
15 
16 //-----------------------------------------------------------------------------
17 class CAViewLayer : public IPlatformViewLayer, public ICocoaViewLayer
18 //-----------------------------------------------------------------------------
19 {
20 public:
21  CAViewLayer (CALayer* parent);
22  ~CAViewLayer () noexcept override;
23 
24  bool init (IPlatformViewLayerDelegate* drawDelegate);
25 
26  void invalidRect (const CRect& size) override;
27  void setSize (const CRect& size) override;
28  void setZIndex (uint32_t zIndex) override;
29  void setAlpha (float alpha) override;
30  void draw (CDrawContext* context, const CRect& updateRect) override;
31  void onScaleFactorChanged (double newScaleFactor) override;
32 
33  CALayer* getCALayer () const override { return layer; }
34 //-----------------------------------------------------------------------------
35 protected:
36  CALayer* layer;
37 };
38 
39 } // namespace
40 
41 #endif // MAC_COCOA
42 
43 #endif // __caviewlayer__
Definition: customcontrols.cpp:8