5 #ifndef __nsviewframe__ 6 #define __nsviewframe__ 8 #include "../../../vstguifwd.h" 12 #include "../../platform_macos.h" 13 #include "../../../cview.h" 14 #include "../../../idatapackage.h" 18 #import <Cocoa/Cocoa.h> 25 class CocoaTooltipWindow;
28 class NSViewFrame :
public IPlatformFrame,
public ICocoaPlatformFrame,
public IPlatformFrameTouchBarExtension
31 NSViewFrame (IPlatformFrameCallback* frame,
const CRect& size, NSView* parent, IPlatformFrameConfig* config);
32 ~NSViewFrame () noexcept override;
34 NSView* getNSView ()
const override {
return nsView; }
35 IPlatformFrameCallback* getFrame ()
const {
return frame; }
36 void* makeTouchBar ()
const;
38 void setLastDragOperationResult (DragResult result) { lastDragOperationResult = result; }
39 void setIgnoreNextResignFirstResponder (
bool state) { ignoreNextResignFirstResponder = state; }
40 bool getIgnoreNextResignFirstResponder ()
const {
return ignoreNextResignFirstResponder; }
42 void setDragDataPackage (SharedPointer<IDataPackage>&& package) { dragDataPackage = std::move (package); }
43 const SharedPointer<IDataPackage>& getDragDataPackage ()
const {
return dragDataPackage; }
45 void initTrackingArea ();
46 void scaleFactorChanged (
double newScaleFactor);
48 virtual void drawRect (NSRect* rect);
51 bool getGlobalPosition (CPoint& pos)
const override;
52 bool setSize (
const CRect& newSize)
override;
53 bool getSize (CRect& size)
const override;
54 bool getCurrentMousePosition (CPoint& mousePosition)
const override;
55 bool getCurrentMouseButtons (CButtonState& buttons)
const override;
56 bool setMouseCursor (CCursorType type)
override;
57 bool invalidRect (
const CRect& rect)
override;
58 bool scrollRect (
const CRect& src,
const CPoint& distance)
override;
59 bool showTooltip (
const CRect& rect,
const char* utf8Text)
override;
60 bool hideTooltip ()
override;
61 void* getPlatformRepresentation ()
const override {
return nsView; }
62 SharedPointer<IPlatformTextEdit> createPlatformTextEdit (IPlatformTextEditCallback* textEdit)
override;
63 SharedPointer<IPlatformOptionMenu> createPlatformOptionMenu ()
override;
64 #if VSTGUI_OPENGL_SUPPORT 65 SharedPointer<IPlatformOpenGLView> createPlatformOpenGLView ()
override;
67 SharedPointer<IPlatformViewLayer> createPlatformViewLayer (IPlatformViewLayerDelegate* drawDelegate, IPlatformViewLayer* parentLayer =
nullptr)
override;
68 SharedPointer<COffscreenContext> createOffscreenContext (CCoord width, CCoord height,
double scaleFactor)
override;
69 DragResult doDrag (IDataPackage* source,
const CPoint& offset, CBitmap* dragBitmap)
override;
70 void setClipboard (
const SharedPointer<IDataPackage>& data)
override;
71 SharedPointer<IDataPackage> getClipboard ()
override;
72 PlatformType getPlatformType ()
const override {
return PlatformType::kNSView; }
75 void setTouchBarCreator (
const SharedPointer<ITouchBarCreator>& creator)
override;
76 void recreateTouchBar ()
override;
80 static void initClass ();
83 CocoaTooltipWindow* tooltipWindow;
84 SharedPointer<IDataPackage> dragDataPackage;
85 SharedPointer<ITouchBarCreator> touchBarCreator;
87 DragResult lastDragOperationResult;
88 bool ignoreNextResignFirstResponder;
89 bool trackingAreaInitialized;
97 #endif // __nsviewframe__ Definition: customcontrols.cpp:8