ASPiK SDK
iplatformframecallback.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 __iplatformframecallback__
6 #define __iplatformframecallback__
7 
9 
10 #include "../vstguifwd.h"
11 
12 struct VstKeyCode;
13 
14 namespace VSTGUI {
15 
16 //-----------------------------------------------------------------------------
17 enum PlatformType {
18  kHWND, // Windows HWND
19  kWindowRef, // macOS WindowRef (Carbon)
20  kNSView, // macOS NSView
21  kUIView, // iOS UIView
22  kHWNDTopLevel, // Windows HWDN Top Level (non child)
23  kX11EmbedWindowID, // X11 XID
24 
25  kDefaultNative = -1
26 };
27 
28 //-----------------------------------------------------------------------------
29 // Callback interface from IPlatformFrame implementations
30 //-----------------------------------------------------------------------------
31 class IPlatformFrameCallback
32 {
33 public:
34  virtual bool platformDrawRect (CDrawContext* context, const CRect& rect) = 0;
35 
36  virtual CMouseEventResult platformOnMouseDown (CPoint& where, const CButtonState& buttons) = 0;
37  virtual CMouseEventResult platformOnMouseMoved (CPoint& where, const CButtonState& buttons) = 0;
38  virtual CMouseEventResult platformOnMouseUp (CPoint& where, const CButtonState& buttons) = 0;
39  virtual CMouseEventResult platformOnMouseExited (CPoint& where, const CButtonState& buttons) = 0;
40  virtual bool platformOnMouseWheel (const CPoint &where, const CMouseWheelAxis &axis, const float &distance, const CButtonState &buttons) = 0;
41 
42  virtual bool platformOnDrop (IDataPackage* drag, const CPoint& where) = 0;
43  virtual void platformOnDragEnter (IDataPackage* drag, const CPoint& where) = 0;
44  virtual void platformOnDragLeave (IDataPackage* drag, const CPoint& where) = 0;
45  virtual void platformOnDragMove (IDataPackage* drag, const CPoint& where) = 0;
46 
47  virtual bool platformOnKeyDown (VstKeyCode& keyCode) = 0;
48  virtual bool platformOnKeyUp (VstKeyCode& keyCode) = 0;
49 
50  virtual void platformOnActivate (bool state) = 0;
51  virtual void platformOnWindowActivate (bool state) = 0;
52 
53  virtual void platformScaleFactorChanged (double newScaleFactor) = 0;
54 
55 #if VSTGUI_TOUCH_EVENT_HANDLING
56  virtual void platformOnTouchEvent (ITouchEvent& event) = 0;
57 #endif
58 //------------------------------------------------------------------------------------
59 };
60 
61 //------------------------------------------------------------------------------------
62 class IPlatformFrameConfig
63 {
64 public:
65  virtual ~IPlatformFrameConfig () noexcept = default;
66 };
67 
68 //------------------------------------------------------------------------------------
69 } // namespace
70 
72 
73 #endif // __iplatformframecallback__
Definition: vstkeycode.h:12
Definition: customcontrols.cpp:8