ASPiK SDK
iplatformframe.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 __iplatformframe__
6 #define __iplatformframe__
7 
9 
10 #include "../vstguifwd.h"
11 #include "iplatformframecallback.h"
12 
13 namespace VSTGUI {
14 
15 //-----------------------------------------------------------------------------
16 class IPlatformFrame : public AtomicReferenceCounted
17 {
18 public:
19  static IPlatformFrame* createPlatformFrame (IPlatformFrameCallback* frame, const CRect& size, void* parent, PlatformType parentType, IPlatformFrameConfig* config = nullptr);
20  static uint32_t getTicks ();
21 
22  virtual bool getGlobalPosition (CPoint& pos) const = 0;
23  virtual bool setSize (const CRect& newSize) = 0;
24  virtual bool getSize (CRect& size) const = 0;
25 
26  virtual bool getCurrentMousePosition (CPoint& mousePosition) const = 0;
27  virtual bool getCurrentMouseButtons (CButtonState& buttons) const = 0;
28  virtual bool setMouseCursor (CCursorType type) = 0;
29 
30  virtual bool invalidRect (const CRect& rect) = 0;
31  virtual bool scrollRect (const CRect& src, const CPoint& distance) = 0;
32 
33  virtual bool showTooltip (const CRect& rect, const char* utf8Text) = 0;
34  virtual bool hideTooltip () = 0;
35 
36  virtual void* getPlatformRepresentation () const = 0; // TODO: remove this call later when everything is done
37 
38  virtual SharedPointer<IPlatformTextEdit> createPlatformTextEdit (IPlatformTextEditCallback* textEdit) = 0;
39  virtual SharedPointer<IPlatformOptionMenu> createPlatformOptionMenu () = 0;
40 #if VSTGUI_OPENGL_SUPPORT
41  virtual SharedPointer<IPlatformOpenGLView> createPlatformOpenGLView () = 0;
42 #endif // VSTGUI_OPENGL_SUPPORT
43 
44  virtual SharedPointer<IPlatformViewLayer> createPlatformViewLayer (IPlatformViewLayerDelegate* drawDelegate, IPlatformViewLayer* parentLayer = nullptr) = 0;
45 
46  virtual SharedPointer<COffscreenContext> createOffscreenContext (CCoord width, CCoord height, double scaleFactor = 1.) = 0;
47 
48  virtual DragResult doDrag (IDataPackage* source, const CPoint& offset, CBitmap* dragBitmap) = 0;
49 
50  virtual void setClipboard (const SharedPointer<IDataPackage>& data) = 0;
51  virtual SharedPointer<IDataPackage> getClipboard () = 0;
52 
53  virtual PlatformType getPlatformType () const = 0;
54 //-----------------------------------------------------------------------------
55 protected:
56  explicit IPlatformFrame (IPlatformFrameCallback* frame) : frame (frame) {}
57  IPlatformFrameCallback* frame;
58 };
59 
60 //-----------------------------------------------------------------------------
61 /* Extension to support Mac TouchBar */
62 //-----------------------------------------------------------------------------
63 class ITouchBarCreator : public AtomicReferenceCounted
64 {
65 public:
67  virtual void* createTouchBar () = 0;
68 };
69 
70 //-----------------------------------------------------------------------------
71 class IPlatformFrameTouchBarExtension /* Extents IPlatformFrame */
72 {
73 public:
74  virtual ~IPlatformFrameTouchBarExtension () noexcept = default;
75 
77  virtual void setTouchBarCreator (const SharedPointer<ITouchBarCreator>& creator) = 0;
79  virtual void recreateTouchBar () = 0;
80 };
81 
82 } // namespace
83 
85 
86 #endif // __iplatformframe__
Definition: customcontrols.cpp:8