| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/xcb/qxcbnativeinterface.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | - | |||||||||||||
| 15 | - | |||||||||||||
| 16 | - | |||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | static int resourceType(const QByteArray &key) | - | ||||||||||||
| 23 | { | - | ||||||||||||
| 24 | static const QByteArray names[] = { | - | ||||||||||||
| 25 | ([]() -> QByteArray { enum { Size = sizeof("display") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "display" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 26 | ([]() -> QByteArray { enum { Size = sizeof("connection") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "connection" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), ([]() -> QByteArray { enum { Size = sizeof("screen") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "screen" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 27 | ([]() -> QByteArray { enum { Size = sizeof("apptime") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "apptime" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 28 | ([]() -> QByteArray { enum { Size = sizeof("appusertime") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "appusertime" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), ([]() -> QByteArray { enum { Size = sizeof("hintstyle") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "hintstyle" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 29 | ([]() -> QByteArray { enum { Size = sizeof("startupid") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "startupid" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), ([]() -> QByteArray { enum { Size = sizeof("traywindow") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "traywindow" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 30 | ([]() -> QByteArray { enum { Size = sizeof("gettimestamp") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "gettimestamp" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), ([]() -> QByteArray { enum { Size = sizeof("x11screen") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "x11screen" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 31 | ([]() -> QByteArray { enum { Size = sizeof("rootwindow") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "rootwindow" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 32 | ([]() -> QByteArray { enum { Size = sizeof("subpixeltype") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "subpixeltype" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), ([]() -> QByteArray { enum { Size = sizeof("antialiasingenabled") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "antialiasingenabled" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 33 | ([]() -> QByteArray { enum { Size = sizeof("nofonthinting") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "nofonthinting" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 34 | ([]() -> QByteArray { enum { Size = sizeof("atspibus") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "atspibus" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), | - | ||||||||||||
| 35 | ([]() -> QByteArray { enum { Size = sizeof("compositingenabled") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "compositingenabled" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()) | - | ||||||||||||
| 36 | }; | - | ||||||||||||
| 37 | const QByteArray *end = names + sizeof(names) / sizeof(names[0]); | - | ||||||||||||
| 38 | const QByteArray *result = std::find(names, end, key); | - | ||||||||||||
| 39 | return executed 186 times by 128 tests: int(result - names);return int(result - names);Executed by:
executed 186 times by 128 tests: return int(result - names);Executed by:
| 186 | ||||||||||||
| 40 | } | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | QXcbNativeInterface::QXcbNativeInterface() : | - | ||||||||||||
| 43 | m_genericEventFilterType(([]() -> QByteArray { enum { Size = sizeof("xcb_generic_event_t") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "xcb_generic_event_t" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }())), | - | ||||||||||||
| 44 | m_sysTraySelectionAtom(XCB_ATOM_NONE) | - | ||||||||||||
| { | ||||||||||||||
| } | ||||||||||||||
| void QXcbNativeInterface::beep(){ | ||||||||||||||
| QScreen *priScreen = QGuiApplication::primaryScreen(); | ||||||||||||||
| if (!priScreen) | ||||||||||||||
| return; | ||||||||||||||
| QPlatformScreen *screen = priScreen->handle(); | ||||||||||||||
| if (!screen) | ||||||||||||||
| return; | ||||||||||||||
| xcb_connection_t *connection = static_cast<QXcbScreen *>(screen)->xcb_connection(); | ||||||||||||||
| xcb_bell(connection, 0);} | ||||||||||||||
| 47 | - | |||||||||||||
| 48 | static inline QXcbSystemTrayTracker *systemTrayTracker(const QScreen *s) | - | ||||||||||||
| 49 | { | - | ||||||||||||
| 50 | if (!s) | - | ||||||||||||
| 51 | return nullptr; | - | ||||||||||||
| 52 | - | |||||||||||||
| 53 | return static_cast<const QXcbScreen *>(s->handle())->connection()->systemTrayTracker(); | - | ||||||||||||
| 54 | } | - | ||||||||||||
| 55 | - | |||||||||||||
| 56 | bool QXcbNativeInterface::systemTrayAvailable(const QScreen *screen) const | - | ||||||||||||
| 57 | { | - | ||||||||||||
| 58 | return systemTrayTracker(screen); | - | ||||||||||||
| 59 | } | - | ||||||||||||
| 60 | - | |||||||||||||
| 61 | bool QXcbNativeInterface::requestSystemTrayWindowDock(const QWindow *window) | - | ||||||||||||
| 62 | { | - | ||||||||||||
| 63 | return QXcbWindow::requestSystemTrayWindowDockStatic(window); | - | ||||||||||||
| 64 | } | - | ||||||||||||
| 65 | - | |||||||||||||
| 66 | QRect QXcbNativeInterface::systemTrayWindowGlobalGeometry(const QWindow *window) | - | ||||||||||||
| 67 | { | - | ||||||||||||
| 68 | return QXcbWindow::systemTrayWindowGlobalGeometryStatic(window); | - | ||||||||||||
| 69 | } | - | ||||||||||||
| 70 | - | |||||||||||||
| 71 | xcb_window_t QXcbNativeInterface::locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen) | - | ||||||||||||
| 72 | { | - | ||||||||||||
| 73 | if (m_sysTraySelectionAtom == XCB_ATOM_NONE) { | - | ||||||||||||
| 74 | const QByteArray net_sys_tray = QString::fromLatin1("_NET_SYSTEM_TRAY_S%1").arg(screen->screenNumber()).toLatin1(); | - | ||||||||||||
| 75 | xcb_intern_atom_cookie_t intern_c = | - | ||||||||||||
| 76 | xcb_intern_atom_unchecked(conn, true, net_sys_tray.length(), net_sys_tray); | - | ||||||||||||
| 77 | - | |||||||||||||
| 78 | xcb_intern_atom_reply_t *intern_r = xcb_intern_atom_reply(conn, intern_c, 0); | - | ||||||||||||
| 79 | - | |||||||||||||
| 80 | if (!intern_r) | - | ||||||||||||
| 81 | return XCB_WINDOW_NONE; | - | ||||||||||||
| 82 | - | |||||||||||||
| 83 | m_sysTraySelectionAtom = intern_r->atom; | - | ||||||||||||
| 84 | free(intern_r); | - | ||||||||||||
| 85 | } | - | ||||||||||||
| 86 | - | |||||||||||||
| 87 | xcb_get_selection_owner_cookie_t sel_owner_c = xcb_get_selection_owner_unchecked(conn, m_sysTraySelectionAtom); | - | ||||||||||||
| 88 | xcb_get_selection_owner_reply_t *sel_owner_r = xcb_get_selection_owner_reply(conn, sel_owner_c, 0); | - | ||||||||||||
| 89 | - | |||||||||||||
| 90 | if (!sel_owner_r) | - | ||||||||||||
| 91 | return XCB_WINDOW_NONE; | - | ||||||||||||
| 92 | - | |||||||||||||
| 93 | xcb_window_t selection_window = sel_owner_r->owner; | - | ||||||||||||
| 94 | free(sel_owner_r); | - | ||||||||||||
| 95 | - | |||||||||||||
| 96 | return selection_window; | - | ||||||||||||
| 97 | } | - | ||||||||||||
| 98 | - | |||||||||||||
| 99 | bool QXcbNativeInterface::systrayVisualHasAlphaChannel() | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | return QXcbConnection::xEmbedSystemTrayVisualHasAlphaChannel(); | - | ||||||||||||
| 102 | } | - | ||||||||||||
| 103 | - | |||||||||||||
| 104 | void QXcbNativeInterface::setParentRelativeBackPixmap(QWindow *window) | - | ||||||||||||
| 105 | { | - | ||||||||||||
| 106 | QXcbWindow::setParentRelativeBackPixmapStatic(window); | - | ||||||||||||
| 107 | } | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString) | - | ||||||||||||
| 110 | { | - | ||||||||||||
| 111 | QByteArray lowerCaseResource = resourceString.toLower(); | - | ||||||||||||
| 112 | void *result = handlerNativeResourceForIntegration(lowerCaseResource); | - | ||||||||||||
| 113 | if (result) | - | ||||||||||||
| 114 | return result; | - | ||||||||||||
| 115 | - | |||||||||||||
| 116 | switch (resourceType(lowerCaseResource)) { | - | ||||||||||||
| 117 | case StartupId: | - | ||||||||||||
| 118 | result = startupId(); | - | ||||||||||||
| 119 | break; | - | ||||||||||||
| 120 | case X11Screen: | - | ||||||||||||
| 121 | result = x11Screen(); | - | ||||||||||||
| 122 | break; | - | ||||||||||||
| 123 | case RootWindow: | - | ||||||||||||
| 124 | result = rootWindow(); | - | ||||||||||||
| 125 | break; | - | ||||||||||||
| 126 | case Display: | - | ||||||||||||
| 127 | result = display(); | - | ||||||||||||
| 128 | break; | - | ||||||||||||
| 129 | case AtspiBus: | - | ||||||||||||
| 130 | result = atspiBus(); | - | ||||||||||||
| 131 | break; | - | ||||||||||||
| 132 | case Connection: | - | ||||||||||||
| 133 | result = connection(); | - | ||||||||||||
| 134 | break; | - | ||||||||||||
| 135 | default: | - | ||||||||||||
| 136 | break; | - | ||||||||||||
| 137 | } | - | ||||||||||||
| 138 | - | |||||||||||||
| 139 | return result; | - | ||||||||||||
| 140 | } | - | ||||||||||||
| 141 | - | |||||||||||||
| 142 | void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) | - | ||||||||||||
| 143 | { | - | ||||||||||||
| 144 | QByteArray lowerCaseResource = resourceString.toLower(); | - | ||||||||||||
| 145 | void *result = handlerNativeResourceForContext(lowerCaseResource, context); | - | ||||||||||||
| 146 | return result; | - | ||||||||||||
| 147 | } | - | ||||||||||||
| 148 | - | |||||||||||||
| 149 | void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceString, QScreen *screen) | - | ||||||||||||
| 150 | { | - | ||||||||||||
| 151 | if (!screen
| 0-6 | ||||||||||||
| 152 | QMessageLogger(__FILE__, 211207, __PRETTY_FUNCTION__).warning() << ("nativeResourceForScreen: null screen";); | - | ||||||||||||
| 153 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 154 | } | - | ||||||||||||
| 155 | - | |||||||||||||
| 156 | QByteArray lowerCaseResource = resourceString.toLower(); | - | ||||||||||||
| 157 | void *result = handlerNativeResourceForScreen(lowerCaseResource, screen); | - | ||||||||||||
| 158 | if (result
| 0-6 | ||||||||||||
| 159 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||
| 160 | - | |||||||||||||
| 161 | const QXcbScreen *xcbScreen = static_cast<QXcbScreen *>(screen->handle()); | - | ||||||||||||
| 162 | switch (resourceType(lowerCaseResource)) { | - | ||||||||||||
| 163 | case never executed: Display:case Display:never executed: case Display: | 0 | ||||||||||||
| 164 | - | |||||||||||||
| 165 | result = xcbScreen->connection()->xlib_display(); | - | ||||||||||||
| 166 | - | |||||||||||||
| 167 | break; never executed: break; | 0 | ||||||||||||
| 168 | case never executed: AppTime:case AppTime:never executed: case AppTime: | 0 | ||||||||||||
| 169 | result = appTime(xcbScreen); | - | ||||||||||||
| 170 | break; never executed: break; | 0 | ||||||||||||
| 171 | case never executed: AppUserTime:case AppUserTime:never executed: case AppUserTime: | 0 | ||||||||||||
| 172 | result = appUserTime(xcbScreen); | - | ||||||||||||
| 173 | break; never executed: break; | 0 | ||||||||||||
| 174 | case never executed: ScreenHintStyle:case ScreenHintStyle:never executed: case ScreenHintStyle: | 0 | ||||||||||||
| 175 | result = reinterpret_cast<void *>(xcbScreen->hintStyle() + 1); | - | ||||||||||||
| 176 | break; never executed: break; | 0 | ||||||||||||
| 177 | case never executed: ScreenSubpixelType:case ScreenSubpixelType:never executed: case ScreenSubpixelType: | 0 | ||||||||||||
| 178 | result = reinterpret_cast<void *>(xcbScreen->subpixelType() + 1); | - | ||||||||||||
| 179 | break; never executed: break; | 0 | ||||||||||||
| 180 | case never executed: ScreenAntialiasingEnabled:case ScreenAntialiasingEnabled:never executed: case ScreenAntialiasingEnabled: | 0 | ||||||||||||
| 181 | result = reinterpret_cast<void *>(xcbScreen->antialiasingEnabled() + 1); | - | ||||||||||||
| 182 | break; never executed: break; | 0 | ||||||||||||
| 183 | case executed 6 times by 1 test: TrayWindow:case TrayWindow:Executed by:
executed 6 times by 1 test: case TrayWindow:Executed by:
| 6 | ||||||||||||
| 184 | if (QXcbSystemTrayTracker *s = systemTrayTracker(screen)
| 0-6 | ||||||||||||
| 185 | result = (void *)quintptr(s->trayWindow()); executed 6 times by 1 test: result = (void *)quintptr(s->trayWindow());Executed by:
| 6 | ||||||||||||
| 186 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||
| 187 | case never executed: GetTimestamp:case GetTimestamp:never executed: case GetTimestamp: | 0 | ||||||||||||
| 188 | result = getTimestamp(xcbScreen); | - | ||||||||||||
| 189 | break; never executed: break; | 0 | ||||||||||||
| 190 | case never executed: NoFontHinting:case NoFontHinting:never executed: case NoFontHinting: | 0 | ||||||||||||
| 191 | result = xcbScreen->noFontHinting()
| 0 | ||||||||||||
| 192 | break; never executed: break; | 0 | ||||||||||||
| 193 | case never executed: RootWindow:case RootWindow:never executed: case RootWindow: | 0 | ||||||||||||
| 194 | result = reinterpret_cast<void *>(xcbScreen->root()); | - | ||||||||||||
| 195 | break; never executed: break; | 0 | ||||||||||||
| 196 | case never executed: CompositingEnabled:case CompositingEnabled:never executed: case CompositingEnabled: | 0 | ||||||||||||
| 197 | if (QXcbVirtualDesktop *vd = xcbScreen->virtualDesktop()
| 0 | ||||||||||||
| 198 | result = vd->compositingActive()
never executed: result = vd->compositingActive() ? this : nullptr; | 0 | ||||||||||||
| 199 | break; never executed: break; | 0 | ||||||||||||
| 200 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 201 | break; never executed: break; | 0 | ||||||||||||
| 202 | } | - | ||||||||||||
| 203 | return executed 6 times by 1 test: result;return result;Executed by:
executed 6 times by 1 test: return result;Executed by:
| 6 | ||||||||||||
| 204 | } | - | ||||||||||||
| 205 | - | |||||||||||||
| 206 | void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) | - | ||||||||||||
| 207 | { | - | ||||||||||||
| 208 | QByteArray lowerCaseResource = resourceString.toLower(); | - | ||||||||||||
| 209 | void *result = handlerNativeResourceForWindow(lowerCaseResource, window); | - | ||||||||||||
| 210 | if (result) | - | ||||||||||||
| 211 | return result; | - | ||||||||||||
| 212 | - | |||||||||||||
| 213 | switch (resourceType(lowerCaseResource)) { | - | ||||||||||||
| 214 | case Display: | - | ||||||||||||
| 215 | result = displayForWindow(window); | - | ||||||||||||
| 216 | break; | - | ||||||||||||
| 217 | case Connection: | - | ||||||||||||
| 218 | result = connectionForWindow(window); | - | ||||||||||||
| 219 | break; | - | ||||||||||||
| 220 | case Screen: | - | ||||||||||||
| 221 | result = screenForWindow(window); | - | ||||||||||||
| 222 | break; | - | ||||||||||||
| 223 | default: | - | ||||||||||||
| 224 | break; | - | ||||||||||||
| 225 | } | - | ||||||||||||
| 226 | - | |||||||||||||
| 227 | return result; | - | ||||||||||||
| 228 | } | - | ||||||||||||
| 229 | - | |||||||||||||
| 230 | void *QXcbNativeInterface::nativeResourceForBackingStore(const QByteArray &resourceString, QBackingStore *backingStore) | - | ||||||||||||
| 231 | { | - | ||||||||||||
| 232 | const QByteArray lowerCaseResource = resourceString.toLower(); | - | ||||||||||||
| 233 | void *result = handlerNativeResourceForBackingStore(lowerCaseResource,backingStore); | - | ||||||||||||
| 234 | return result; | - | ||||||||||||
| 235 | } | - | ||||||||||||
| 236 | - | |||||||||||||
| 237 | - | |||||||||||||
| 238 | void *QXcbNativeInterface::nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) | - | ||||||||||||
| 239 | { | - | ||||||||||||
| 240 | if (resource == ([]() -> QByteArray { enum { Size = sizeof("xcbcursor") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "xcbcursor" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }())
| 0 | ||||||||||||
| 241 | if (const
| 0 | ||||||||||||
| 242 | if (const
| 0 | ||||||||||||
| 243 | xcb_cursor_t xcbCursor = static_cast<const QXcbCursor *>(pCursor)->xcbCursor(cursor); | - | ||||||||||||
| 244 | return never executed: reinterpret_cast<void *>(quintptr(xcbCursor));return reinterpret_cast<void *>(quintptr(xcbCursor));never executed: return reinterpret_cast<void *>(quintptr(xcbCursor)); | 0 | ||||||||||||
| 245 | } | - | ||||||||||||
| 246 | } never executed: end of block | 0 | ||||||||||||
| 247 | } never executed: end of block | 0 | ||||||||||||
| 248 | return never executed: nullptrreturn nullptr;never executed: return nullptr;never executed: ;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 249 | } | - | ||||||||||||
| 250 | - | |||||||||||||
| 251 | - | |||||||||||||
| 252 | QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterface::nativeResourceFunctionForIntegration(const QByteArray &resource) | - | ||||||||||||
| 253 | { | - | ||||||||||||
| 254 | const QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 255 | QPlatformNativeInterface::NativeResourceForIntegrationFunction func = handlerNativeResourceFunctionForIntegration(lowerCaseResource); | - | ||||||||||||
| 256 | if (func) | - | ||||||||||||
| 257 | return func; | - | ||||||||||||
| 258 | - | |||||||||||||
| 259 | if (lowerCaseResource == "setstartupid") | - | ||||||||||||
| 260 | return NativeResourceForIntegrationFunction(setStartupId); | - | ||||||||||||
| 261 | return 0; | - | ||||||||||||
| 262 | } | - | ||||||||||||
| 263 | - | |||||||||||||
| 264 | QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource) | - | ||||||||||||
| 265 | { | - | ||||||||||||
| 266 | const QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 267 | QPlatformNativeInterface::NativeResourceForContextFunction func = handlerNativeResourceFunctionForContext(lowerCaseResource); | - | ||||||||||||
| 268 | if (func) | - | ||||||||||||
| 269 | return func; | - | ||||||||||||
| 270 | return nullptr; | - | ||||||||||||
| 271 | } | - | ||||||||||||
| 272 | - | |||||||||||||
| 273 | QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource) | - | ||||||||||||
| 274 | { | - | ||||||||||||
| 275 | const QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 276 | NativeResourceForScreenFunction func = handlerNativeResourceFunctionForScreen(lowerCaseResource); | - | ||||||||||||
| 277 | if (func) | - | ||||||||||||
| 278 | return func; | - | ||||||||||||
| 279 | - | |||||||||||||
| 280 | if (lowerCaseResource == "setapptime") | - | ||||||||||||
| 281 | return NativeResourceForScreenFunction(setAppTime); | - | ||||||||||||
| 282 | else if (lowerCaseResource == "setappusertime") | - | ||||||||||||
| 283 | return NativeResourceForScreenFunction(setAppUserTime); | - | ||||||||||||
| 284 | return 0; | - | ||||||||||||
| 285 | } | - | ||||||||||||
| 286 | - | |||||||||||||
| 287 | QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterface::nativeResourceFunctionForWindow(const QByteArray &resource) | - | ||||||||||||
| 288 | { | - | ||||||||||||
| 289 | const QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 290 | NativeResourceForWindowFunction func = handlerNativeResourceFunctionForWindow(lowerCaseResource); | - | ||||||||||||
| 291 | return func; | - | ||||||||||||
| 292 | } | - | ||||||||||||
| 293 | - | |||||||||||||
| 294 | QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterface::nativeResourceFunctionForBackingStore(const QByteArray &resource) | - | ||||||||||||
| 295 | { | - | ||||||||||||
| 296 | const QByteArray lowerCaseResource = resource.toLower(); | - | ||||||||||||
| 297 | NativeResourceForBackingStoreFunction func = handlerNativeResourceFunctionForBackingStore(resource); | - | ||||||||||||
| 298 | return func; | - | ||||||||||||
| 299 | } | - | ||||||||||||
| 300 | - | |||||||||||||
| 301 | QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &function) const | - | ||||||||||||
| 302 | { | - | ||||||||||||
| 303 | const QByteArray lowerCaseFunction = function.toLower(); | - | ||||||||||||
| 304 | QFunctionPointer func = handlerPlatformFunction(lowerCaseFunction); | - | ||||||||||||
| 305 | if (func) | - | ||||||||||||
| 306 | return func; | - | ||||||||||||
| 307 | - | |||||||||||||
| 308 | - | |||||||||||||
| 309 | if (function == QXcbWindowFunctions::setWmWindowTypeIdentifier()) | - | ||||||||||||
| 310 | return QFunctionPointer(QXcbWindowFunctions::SetWmWindowType(QXcbWindow::setWmWindowTypeStatic)); | - | ||||||||||||
| 311 | - | |||||||||||||
| 312 | if (function == QXcbWindowFunctions::setWmWindowRoleIdentifier()) | - | ||||||||||||
| 313 | return QFunctionPointer(QXcbWindowFunctions::SetWmWindowRole(QXcbWindow::setWmWindowRoleStatic)); | - | ||||||||||||
| 314 | - | |||||||||||||
| 315 | if (function == QXcbWindowFunctions::setWmWindowIconTextIdentifier()) | - | ||||||||||||
| 316 | return QFunctionPointer(QXcbWindowFunctions::SetWmWindowIconText(QXcbWindow::setWindowIconTextStatic)); | - | ||||||||||||
| 317 | - | |||||||||||||
| 318 | if (function == QXcbWindowFunctions::setParentRelativeBackPixmapIdentifier()) | - | ||||||||||||
| 319 | return QFunctionPointer(QXcbWindowFunctions::SetParentRelativeBackPixmap(QXcbWindow::setParentRelativeBackPixmapStatic)); | - | ||||||||||||
| 320 | - | |||||||||||||
| 321 | if (function == QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier()) | - | ||||||||||||
| 322 | return QFunctionPointer(QXcbWindowFunctions::RequestSystemTrayWindowDock(QXcbWindow::requestSystemTrayWindowDockStatic)); | - | ||||||||||||
| 323 | - | |||||||||||||
| 324 | if (function == QXcbWindowFunctions::systemTrayWindowGlobalGeometryIdentifier()) | - | ||||||||||||
| 325 | return QFunctionPointer(QXcbWindowFunctions::SystemTrayWindowGlobalGeometry(QXcbWindow::systemTrayWindowGlobalGeometryStatic)); | - | ||||||||||||
| 326 | - | |||||||||||||
| 327 | if (function == QXcbIntegrationFunctions::xEmbedSystemTrayVisualHasAlphaChannelIdentifier()) | - | ||||||||||||
| 328 | return QFunctionPointer(QXcbIntegrationFunctions::XEmbedSystemTrayVisualHasAlphaChannel(QXcbConnection::xEmbedSystemTrayVisualHasAlphaChannel)); | - | ||||||||||||
| 329 | - | |||||||||||||
| 330 | if (function == QXcbWindowFunctions::visualIdIdentifier()) { | - | ||||||||||||
| 331 | return QFunctionPointer(QXcbWindowFunctions::VisualId(QXcbWindow::visualIdStatic)); | - | ||||||||||||
| 332 | } | - | ||||||||||||
| 333 | - | |||||||||||||
| 334 | if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier()) | - | ||||||||||||
| 335 | return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(QXcbScreen::virtualDesktopNumberStatic)); | - | ||||||||||||
| 336 | - | |||||||||||||
| 337 | return nullptr; | - | ||||||||||||
| 338 | } | - | ||||||||||||
| 339 | - | |||||||||||||
| 340 | void *QXcbNativeInterface::appTime(const QXcbScreen *screen) | - | ||||||||||||
| 341 | { | - | ||||||||||||
| 342 | if (!screen) | - | ||||||||||||
| 343 | return nullptr; | - | ||||||||||||
| 344 | - | |||||||||||||
| 345 | return reinterpret_cast<void *>(quintptr(screen->connection()->time())); | - | ||||||||||||
| 346 | } | - | ||||||||||||
| 347 | - | |||||||||||||
| 348 | void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen) | - | ||||||||||||
| 349 | { | - | ||||||||||||
| 350 | if (!screen) | - | ||||||||||||
| 351 | return nullptr; | - | ||||||||||||
| 352 | - | |||||||||||||
| 353 | return reinterpret_cast<void *>(quintptr(screen->connection()->netWmUserTime())); | - | ||||||||||||
| 354 | } | - | ||||||||||||
| 355 | - | |||||||||||||
| 356 | void *QXcbNativeInterface::getTimestamp(const QXcbScreen *screen) | - | ||||||||||||
| 357 | { | - | ||||||||||||
| 358 | if (!screen) | - | ||||||||||||
| 359 | return nullptr; | - | ||||||||||||
| 360 | - | |||||||||||||
| 361 | return reinterpret_cast<void *>(quintptr(screen->connection()->getTimestamp())); | - | ||||||||||||
| 362 | } | - | ||||||||||||
| 363 | - | |||||||||||||
| 364 | void *QXcbNativeInterface::startupId() | - | ||||||||||||
| 365 | { | - | ||||||||||||
| 366 | QXcbIntegration* integration = QXcbIntegration::instance(); | - | ||||||||||||
| 367 | QXcbConnection *defaultConnection = integration->defaultConnection(); | - | ||||||||||||
| 368 | if (defaultConnection) | - | ||||||||||||
| 369 | return reinterpret_cast<void *>(const_cast<char *>(defaultConnection->startupId().constData())); | - | ||||||||||||
| 370 | return 0; | - | ||||||||||||
| 371 | } | - | ||||||||||||
| 372 | - | |||||||||||||
| 373 | void *QXcbNativeInterface::x11Screen() | - | ||||||||||||
| 374 | { | - | ||||||||||||
| 375 | QXcbIntegration *integration = QXcbIntegration::instance(); | - | ||||||||||||
| 376 | QXcbConnection *defaultConnection = integration->defaultConnection(); | - | ||||||||||||
| 377 | if (defaultConnection) | - | ||||||||||||
| 378 | return reinterpret_cast<void *>(defaultConnection->primaryScreenNumber()); | - | ||||||||||||
| 379 | return 0; | - | ||||||||||||
| 380 | } | - | ||||||||||||
| 381 | - | |||||||||||||
| 382 | void *QXcbNativeInterface::rootWindow() | - | ||||||||||||
| 383 | { | - | ||||||||||||
| 384 | QXcbIntegration *integration = QXcbIntegration::instance(); | - | ||||||||||||
| 385 | QXcbConnection *defaultConnection = integration->defaultConnection(); | - | ||||||||||||
| 386 | if (defaultConnection) | - | ||||||||||||
| 387 | return reinterpret_cast<void *>(defaultConnection->rootWindow()); | - | ||||||||||||
| 388 | return 0; | - | ||||||||||||
| 389 | } | - | ||||||||||||
| 390 | - | |||||||||||||
| 391 | void *QXcbNativeInterface::display() | - | ||||||||||||
| 392 | { | - | ||||||||||||
| 393 | - | |||||||||||||
| 394 | QXcbIntegration *integration = QXcbIntegration::instance(); | - | ||||||||||||
| 395 | QXcbConnection *defaultConnection = integration->defaultConnection(); | - | ||||||||||||
| 396 | if (defaultConnection) | - | ||||||||||||
| 397 | return defaultConnection->xlib_display(); | - | ||||||||||||
| 398 | - | |||||||||||||
| 399 | return nullptr; | - | ||||||||||||
| 400 | } | - | ||||||||||||
| 401 | - | |||||||||||||
| 402 | void *QXcbNativeInterface::connection() | - | ||||||||||||
| 403 | { | - | ||||||||||||
| 404 | QXcbIntegration *integration = QXcbIntegration::instance(); | - | ||||||||||||
| 405 | return integration->defaultConnection()->xcb_connection(); | - | ||||||||||||
| 406 | } | - | ||||||||||||
| 407 | - | |||||||||||||
| 408 | void *QXcbNativeInterface::atspiBus() | - | ||||||||||||
| 409 | { | - | ||||||||||||
| 410 | QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); | - | ||||||||||||
| 411 | QXcbConnection *defaultConnection = integration->defaultConnection(); | - | ||||||||||||
| 412 | if (defaultConnection
| 0-180 | ||||||||||||
| 413 | xcb_atom_t atspiBusAtom = defaultConnection->internAtom("AT_SPI_BUS"); | - | ||||||||||||
| 414 | xcb_get_property_cookie_t cookie = xcb_get_property( defaultConnection->xcb_connection(), false, defaultConnection->rootWindow(), atspiBusAtom, XCB_ATOM_STRING, 0, 128) | - | ||||||||||||
| 415 | - | |||||||||||||
| 416 | - | |||||||||||||
| 417 | - | |||||||||||||
| 418 | ; | - | ||||||||||||
| 419 | xcb_get_property_reply_t *reply = xcb_get_property_reply( defaultConnection->xcb_connection(), cookie, 0);) | - | ||||||||||||
| 420 | - | |||||||||||||
| 421 | - | |||||||||||||
| 422 | ; | - | ||||||||||||
| 423 | ((!(!reply->bytes_after)) ? qt_assert("!reply->bytes_after",__FILE__,460478) : qt_noop()); | - | ||||||||||||
| 424 | char *data = (char *)xcb_get_property_value(reply); | - | ||||||||||||
| 425 | int length = xcb_get_property_value_length(reply); | - | ||||||||||||
| 426 | QByteArray *busAddress = new QByteArray(data, length); | - | ||||||||||||
| 427 | free(reply); | - | ||||||||||||
| 428 | return executed 180 times by 128 tests: busAddress;return busAddress;Executed by:
executed 180 times by 128 tests: return busAddress;Executed by:
| 180 | ||||||||||||
| 429 | } | - | ||||||||||||
| 430 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 431 | } | - | ||||||||||||
| 432 | - | |||||||||||||
| 433 | void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time) | - | ||||||||||||
| 434 | { | - | ||||||||||||
| 435 | if (screen) { | - | ||||||||||||
| 436 | static_cast<QXcbScreen *>(screen->handle())->connection()->setTime(time); | - | ||||||||||||
| 437 | } | - | ||||||||||||
| 438 | } | - | ||||||||||||
| 439 | - | |||||||||||||
| 440 | void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time) | - | ||||||||||||
| 441 | { | - | ||||||||||||
| 442 | if (screen) { | - | ||||||||||||
| 443 | static_cast<QXcbScreen *>(screen->handle())->connection()->setNetWmUserTime(time); | - | ||||||||||||
| 444 | } | - | ||||||||||||
| 445 | } | - | ||||||||||||
| 446 | - | |||||||||||||
| 447 | void QXcbNativeInterface::setStartupId(const char *data) | - | ||||||||||||
| 448 | { | - | ||||||||||||
| 449 | QByteArray startupId(data); | - | ||||||||||||
| 450 | QXcbIntegration *integration = QXcbIntegration::instance(); | - | ||||||||||||
| 451 | QXcbConnection *defaultConnection = integration->defaultConnection(); | - | ||||||||||||
| 452 | if (defaultConnection) | - | ||||||||||||
| 453 | defaultConnection->setStartupId(startupId); | - | ||||||||||||
| 454 | } | - | ||||||||||||
| 455 | - | |||||||||||||
| 456 | QXcbScreen *QXcbNativeInterface::qPlatformScreenForWindow(QWindow *window) | - | ||||||||||||
| 457 | { | - | ||||||||||||
| 458 | QXcbScreen *screen; | - | ||||||||||||
| 459 | if (window) { | - | ||||||||||||
| 460 | QScreen *qs = window->screen(); | - | ||||||||||||
| 461 | screen = static_cast<QXcbScreen *>(qs ? qs->handle() : nullptr); | - | ||||||||||||
| 462 | } else { | - | ||||||||||||
| 463 | QScreen *qs = QGuiApplication::primaryScreen(); | - | ||||||||||||
| 464 | screen = static_cast<QXcbScreen *>(qs ? qs->handle() : nullptr); | - | ||||||||||||
| 465 | } | - | ||||||||||||
| 466 | return screen; | - | ||||||||||||
| 467 | } | - | ||||||||||||
| 468 | - | |||||||||||||
| 469 | void *QXcbNativeInterface::displayForWindow(QWindow *window) | - | ||||||||||||
| 470 | { | - | ||||||||||||
| 471 | - | |||||||||||||
| 472 | QXcbScreen *screen = qPlatformScreenForWindow(window); | - | ||||||||||||
| 473 | return screen ? screen->connection()->xlib_display() : nullptr; | - | ||||||||||||
| 474 | - | |||||||||||||
| 475 | - | |||||||||||||
| 476 | - | |||||||||||||
| 477 | - | |||||||||||||
| 478 | } | - | ||||||||||||
| 479 | - | |||||||||||||
| 480 | void *QXcbNativeInterface::connectionForWindow(QWindow *window) | - | ||||||||||||
| 481 | { | - | ||||||||||||
| 482 | QXcbScreen *screen = qPlatformScreenForWindow(window); | - | ||||||||||||
| 483 | return screen ? screen->xcb_connection() : nullptr; | - | ||||||||||||
| 484 | } | - | ||||||||||||
| 485 | - | |||||||||||||
| 486 | void *QXcbNativeInterface::screenForWindow(QWindow *window) | - | ||||||||||||
| 487 | { | - | ||||||||||||
| 488 | QXcbScreen *screen = qPlatformScreenForWindow(window); | - | ||||||||||||
| 489 | return screen ? screen->screen() : nullptr; | - | ||||||||||||
| 490 | } | - | ||||||||||||
| 491 | - | |||||||||||||
| 492 | void QXcbNativeInterface::addHandler(QXcbNativeInterfaceHandler *handler) | - | ||||||||||||
| 493 | { | - | ||||||||||||
| 494 | m_handlers.removeAll(handler); | - | ||||||||||||
| 495 | m_handlers.prepend(handler); | - | ||||||||||||
| 496 | } | - | ||||||||||||
| 497 | - | |||||||||||||
| 498 | void QXcbNativeInterface::removeHandler(QXcbNativeInterfaceHandler *handler) | - | ||||||||||||
| 499 | { | - | ||||||||||||
| 500 | m_handlers.removeAll(handler); | - | ||||||||||||
| 501 | } | - | ||||||||||||
| 502 | - | |||||||||||||
| 503 | QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterface::handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const | - | ||||||||||||
| 504 | { | - | ||||||||||||
| 505 | for (int i = 0; i < m_handlers.size(); i++) { | - | ||||||||||||
| 506 | QXcbNativeInterfaceHandler *handler = m_handlers.at(i); | - | ||||||||||||
| 507 | NativeResourceForIntegrationFunction result = handler->nativeResourceFunctionForIntegration(resource); | - | ||||||||||||
| 508 | if (result) | - | ||||||||||||
| 509 | return result; | - | ||||||||||||
| 510 | } | - | ||||||||||||
| 511 | return nullptr; | - | ||||||||||||
| 512 | } | - | ||||||||||||
| 513 | - | |||||||||||||
| 514 | QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::handlerNativeResourceFunctionForContext(const QByteArray &resource) const | - | ||||||||||||
| 515 | { | - | ||||||||||||
| 516 | for (int i = 0; i < m_handlers.size(); i++) { | - | ||||||||||||
| 517 | QXcbNativeInterfaceHandler *handler = m_handlers.at(i); | - | ||||||||||||
| 518 | NativeResourceForContextFunction result = handler->nativeResourceFunctionForContext(resource); | - | ||||||||||||
| 519 | if (result) | - | ||||||||||||
| 520 | return result; | - | ||||||||||||
| 521 | } | - | ||||||||||||
| 522 | return nullptr; | - | ||||||||||||
| 523 | } | - | ||||||||||||
| 524 | - | |||||||||||||
| 525 | QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::handlerNativeResourceFunctionForScreen(const QByteArray &resource) const | - | ||||||||||||
| 526 | { | - | ||||||||||||
| 527 | for (int i = 0; i < m_handlers.size(); i++) { | - | ||||||||||||
| 528 | QXcbNativeInterfaceHandler *handler = m_handlers.at(i); | - | ||||||||||||
| 529 | NativeResourceForScreenFunction result = handler->nativeResourceFunctionForScreen(resource); | - | ||||||||||||
| 530 | if (result) | - | ||||||||||||
| 531 | return result; | - | ||||||||||||
| 532 | } | - | ||||||||||||
| 533 | return nullptr; | - | ||||||||||||
| 534 | } | - | ||||||||||||
| 535 | - | |||||||||||||
| 536 | QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterface::handlerNativeResourceFunctionForWindow(const QByteArray &resource) const | - | ||||||||||||
| 537 | { | - | ||||||||||||
| 538 | for (int i = 0; i < m_handlers.size(); i++) { | - | ||||||||||||
| 539 | QXcbNativeInterfaceHandler *handler = m_handlers.at(i); | - | ||||||||||||
| 540 | NativeResourceForWindowFunction result = handler->nativeResourceFunctionForWindow(resource); | - | ||||||||||||
| 541 | if (result) | - | ||||||||||||
| 542 | return result; | - | ||||||||||||
| 543 | } | - | ||||||||||||
| 544 | return nullptr; | - | ||||||||||||
| 545 | } | - | ||||||||||||
| 546 | - | |||||||||||||
| 547 | QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterface::handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const | - | ||||||||||||
| 548 | { | - | ||||||||||||
| 549 | for (int i = 0; i < m_handlers.size(); i++) { | - | ||||||||||||
| 550 | QXcbNativeInterfaceHandler *handler = m_handlers.at(i); | - | ||||||||||||
| 551 | NativeResourceForBackingStoreFunction result = handler->nativeResourceFunctionForBackingStore(resource); | - | ||||||||||||
| 552 | if (result) | - | ||||||||||||
| 553 | return result; | - | ||||||||||||
| 554 | } | - | ||||||||||||
| 555 | return nullptr; | - | ||||||||||||
| 556 | } | - | ||||||||||||
| 557 | - | |||||||||||||
| 558 | QFunctionPointer QXcbNativeInterface::handlerPlatformFunction(const QByteArray &function) const | - | ||||||||||||
| 559 | { | - | ||||||||||||
| 560 | for (int i = 0; i < m_handlers.size(); i++) { | - | ||||||||||||
| 561 | QXcbNativeInterfaceHandler *handler = m_handlers.at(i); | - | ||||||||||||
| 562 | QFunctionPointer func = handler->platformFunction(function); | - | ||||||||||||
| 563 | if (func) | - | ||||||||||||
| 564 | return func; | - | ||||||||||||
| 565 | } | - | ||||||||||||
| 566 | return nullptr; | - | ||||||||||||
| 567 | } | - | ||||||||||||
| 568 | - | |||||||||||||
| 569 | void *QXcbNativeInterface::handlerNativeResourceForIntegration(const QByteArray &resource) const | - | ||||||||||||
| 570 | { | - | ||||||||||||
| 571 | NativeResourceForIntegrationFunction func = handlerNativeResourceFunctionForIntegration(resource); | - | ||||||||||||
| 572 | if (func) | - | ||||||||||||
| 573 | return func(); | - | ||||||||||||
| 574 | return nullptr; | - | ||||||||||||
| 575 | } | - | ||||||||||||
| 576 | - | |||||||||||||
| 577 | void *QXcbNativeInterface::handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const | - | ||||||||||||
| 578 | { | - | ||||||||||||
| 579 | NativeResourceForContextFunction func = handlerNativeResourceFunctionForContext(resource); | - | ||||||||||||
| 580 | if (func) | - | ||||||||||||
| 581 | return func(context); | - | ||||||||||||
| 582 | return nullptr; | - | ||||||||||||
| 583 | } | - | ||||||||||||
| 584 | - | |||||||||||||
| 585 | void *QXcbNativeInterface::handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const | - | ||||||||||||
| 586 | { | - | ||||||||||||
| 587 | NativeResourceForScreenFunction func = handlerNativeResourceFunctionForScreen(resource); | - | ||||||||||||
| 588 | if (func) | - | ||||||||||||
| 589 | return func(screen); | - | ||||||||||||
| 590 | return nullptr; | - | ||||||||||||
| 591 | } | - | ||||||||||||
| 592 | - | |||||||||||||
| 593 | void *QXcbNativeInterface::handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const | - | ||||||||||||
| 594 | { | - | ||||||||||||
| 595 | NativeResourceForWindowFunction func = handlerNativeResourceFunctionForWindow(resource); | - | ||||||||||||
| 596 | if (func) | - | ||||||||||||
| 597 | return func(window); | - | ||||||||||||
| 598 | return nullptr; | - | ||||||||||||
| 599 | } | - | ||||||||||||
| 600 | - | |||||||||||||
| 601 | void *QXcbNativeInterface::handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const | - | ||||||||||||
| 602 | { | - | ||||||||||||
| 603 | NativeResourceForBackingStoreFunction func = handlerNativeResourceFunctionForBackingStore(resource); | - | ||||||||||||
| 604 | if (func) | - | ||||||||||||
| 605 | return func(backingStore); | - | ||||||||||||
| 606 | return nullptr; | - | ||||||||||||
| 607 | } | - | ||||||||||||
| 608 | - | |||||||||||||
| 609 | - | |||||||||||||
| Switch to Source code | Preprocessed file |