5 #ifndef __hiviewframe__ 6 #define __hiviewframe__ 8 #include "../../../cframe.h" 12 #include "../../iplatformframe.h" 13 #include <Carbon/Carbon.h> 17 extern bool isWindowComposited (WindowRef window);
20 class HIViewFrame :
public IPlatformFrame
23 static void setAddToContentView (
bool addToContentView);
25 HIViewFrame (IPlatformFrameCallback* frame,
const CRect& size, WindowRef parent);
26 ~HIViewFrame () noexcept;
28 HIViewRef getPlatformControl ()
const {
return controlRef; }
29 const CPoint& getScrollOffset ()
const {
return hiScrollOffset; }
32 bool getGlobalPosition (CPoint& pos)
const override;
33 bool setSize (
const CRect& newSize)
override;
34 bool getSize (CRect& size)
const override;
35 bool getCurrentMousePosition (CPoint& mousePosition)
const override;
36 bool getCurrentMouseButtons (CButtonState& buttons)
const override;
37 bool setMouseCursor (CCursorType type)
override;
38 bool invalidRect (
const CRect& rect)
override;
39 bool scrollRect (
const CRect& src,
const CPoint& distance)
override;
40 bool showTooltip (
const CRect& rect,
const char* utf8Text)
override;
41 bool hideTooltip ()
override;
42 void* getPlatformRepresentation ()
const override {
return controlRef; }
43 SharedPointer<IPlatformTextEdit> createPlatformTextEdit (IPlatformTextEditCallback* textEdit)
override;
44 SharedPointer<IPlatformOptionMenu> createPlatformOptionMenu ()
override;
45 #if VSTGUI_OPENGL_SUPPORT 46 SharedPointer<IPlatformOpenGLView> createPlatformOpenGLView ()
override {
return nullptr; }
48 SharedPointer<IPlatformViewLayer> createPlatformViewLayer (IPlatformViewLayerDelegate* drawDelegate, IPlatformViewLayer* parentLayer =
nullptr)
override {
return 0; }
49 SharedPointer<COffscreenContext> createOffscreenContext (CCoord width, CCoord height,
double scaleFactor = 1.)
override;
50 DragResult doDrag (IDataPackage* source,
const CPoint& offset, CBitmap* dragBitmap)
override;
51 void setClipboard (
const SharedPointer<IDataPackage>& data)
override;
52 SharedPointer<IDataPackage> getClipboard ()
override;
53 PlatformType getPlatformType ()
const override {
return PlatformType::kWindowRef; }
57 static pascal OSStatus carbonMouseEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent,
void *inUserData);
58 static pascal OSStatus carbonEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent,
void *inUserData);
63 bool isInMouseTracking;
64 EventHandlerRef mouseEventHandler;
65 EventHandlerRef keyboardEventHandler;
66 CPoint hiScrollOffset;
72 #endif // __hiviewframe__ Definition: customcontrols.cpp:8