4#include <AppKit/AppKit.h>
16#include <qbytearray.h>
19#include <qpa/qplatformwindow.h>
20#include <QtGui/qsurfaceformat.h>
22#include <qpa/qplatformopenglcontext.h>
23#include <QtGui/qopenglcontext.h>
26#include <QtGui/qguiapplication.h>
29#include <QtGui/private/qmacmimeregistry_p.h>
30#include <QtGui/private/qcoregraphics_p.h>
33#include <MoltenVK/mvk_vulkan.h>
38QCocoaNativeInterface::QCocoaNativeInterface()
44 if (!window->handle())
47 if (resourceString ==
"nsview") {
48 return static_cast<
QCocoaWindow *>(window->handle())->m_view;
49 }
else if (resourceString ==
"nswindow") {
50 return static_cast<
QCocoaWindow *>(window->handle())->nativeWindow();
52 }
else if (resourceString ==
"vkSurface") {
53 if (QVulkanInstance *instance = window->vulkanInstance())
54 return static_cast<QCocoaVulkanInstance *>(instance->handle())->surface(window);
62 if (resource.toLower() ==
"registerdraggedtypes")
63 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::registerDraggedTypes));
64 if (resource.toLower() ==
"registertouchwindow")
65 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::registerTouchWindow));
66 if (resource.toLower() ==
"setembeddedinforeignview")
67 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::setEmbeddedInForeignView));
68 if (resource.toLower() ==
"registercontentborderarea")
69 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::registerContentBorderArea));
70 if (resource.toLower() ==
"setcontentborderareaenabled")
71 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::setContentBorderAreaEnabled));
72 if (resource.toLower() ==
"testcontentborderposition")
73 return NativeResourceForIntegrationFunction(QFunctionPointer(QCocoaNativeInterface::testContentBorderPosition));
86 QCocoaMenuBar::updateMenuBarImmediately();
91 QMacMimeRegistry::registerDraggedTypes(types);
97 QCocoaWindow *cocoaPlatformWindow =
static_cast<QCocoaWindow *>(window);
106 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
108 cocoaWindow->registerTouch(enable);
111void QCocoaNativeInterface::registerContentBorderArea(QWindow *window, quintptr identifier,
int upper,
int lower)
116 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
118 cocoaWindow->registerContentBorderArea(identifier, upper, lower);
121void QCocoaNativeInterface::setContentBorderAreaEnabled(QWindow *window, quintptr identifier,
bool enable)
126 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
128 cocoaWindow->setContentBorderAreaEnabled(identifier, enable);
136 QCocoaWindow *cocoaWindow =
static_cast<QCocoaWindow *>(window->handle());
138 return cocoaWindow->testContentBorderAreaPosition(position);
static void clearCurrentThreadCocoaEventDispatcherInterruptFlag()
void setEmbeddedInForeignView()
Combined button and popup list for selecting options.