5#include <AppKit/AppKit.h>
17#include <qbytearray.h>
20#include <qpa/qplatformwindow.h>
21#include <QtGui/qsurfaceformat.h>
23#include <qpa/qplatformopenglcontext.h>
24#include <QtGui/qopenglcontext.h>
27#include <QtGui/qguiapplication.h>
30#include <QtGui/private/qmacmimeregistry_p.h>
31#include <QtGui/private/qcoregraphics_p.h>
34#include <MoltenVK/mvk_vulkan.h>
39QCocoaNativeInterface::QCocoaNativeInterface()
45 if (!window->handle())
48 if (resourceString ==
"nsview") {
49 return static_cast<
QCocoaWindow *>(window->handle())->m_view;
50 }
else if (resourceString ==
"nswindow") {
51 return static_cast<
QCocoaWindow *>(window->handle())->nativeWindow();
53 }
else if (resourceString ==
"vkSurface") {
54 if (QVulkanInstance *instance = window->vulkanInstance())
55 return static_cast<QCocoaVulkanInstance *>(instance->handle())->surface(window);
63 if (resource.toLower() ==
"registerdraggedtypes")
64 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::registerDraggedTypes));
65 if (resource.toLower() ==
"registertouchwindow")
66 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::registerTouchWindow));
67 if (resource.toLower() ==
"setembeddedinforeignview")
68 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::setEmbeddedInForeignView));
69 if (resource.toLower() ==
"registercontentborderarea")
70 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::registerContentBorderArea));
71 if (resource.toLower() ==
"setcontentborderareaenabled")
72 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::setContentBorderAreaEnabled));
73 if (resource.toLower() ==
"testcontentborderposition")
74 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::testContentBorderPosition));
87 QCocoaMenuBar::updateMenuBarImmediately();
92 QMacMimeRegistry::registerDraggedTypes(types);
98 QCocoaWindow *cocoaPlatformWindow =
static_cast<QCocoaWindow *>(window);
107 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
109 cocoaWindow->registerTouch(enable);
112void QCocoaNativeInterface::registerContentBorderArea(QWindow *window, quintptr identifier,
int upper,
int lower)
117 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
119 cocoaWindow->registerContentBorderArea(identifier, upper, lower);
122void QCocoaNativeInterface::setContentBorderAreaEnabled(QWindow *window, quintptr identifier,
bool enable)
127 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
129 cocoaWindow->setContentBorderAreaEnabled(identifier, enable);
137 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
139 return cocoaWindow->testContentBorderAreaPosition(position);
static void clearCurrentThreadCocoaEventDispatcherInterruptFlag()
void setEmbeddedInForeignView()