/src/qtbase/src/gui/kernel/qplatformintegration.cpp
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #include "qplatformintegration.h" |
6 | | |
7 | | #include <qpa/qplatformfontdatabase.h> |
8 | | #include <qpa/qplatformclipboard.h> |
9 | | #include <qpa/qplatformaccessibility.h> |
10 | | #include <qpa/qplatformkeymapper.h> |
11 | | #include <qpa/qplatformtheme.h> |
12 | | #include <QtGui/private/qguiapplication_p.h> |
13 | | #include <QtGui/private/qpixmap_raster_p.h> |
14 | | |
15 | | #if QT_CONFIG(draganddrop) |
16 | | #include <private/qdnd_p.h> |
17 | | #include <private/qsimpledrag_p.h> |
18 | | #endif |
19 | | |
20 | | #ifndef QT_NO_SESSIONMANAGER |
21 | | # include <qpa/qplatformsessionmanager.h> |
22 | | #endif |
23 | | |
24 | | QT_BEGIN_NAMESPACE |
25 | | |
26 | | /*! |
27 | | Accessor for the platform integration's fontdatabase. |
28 | | |
29 | | Default implementation returns a default QPlatformFontDatabase. |
30 | | |
31 | | \sa QPlatformFontDatabase |
32 | | */ |
33 | | QPlatformFontDatabase *QPlatformIntegration::fontDatabase() const |
34 | 0 | { |
35 | 0 | static QPlatformFontDatabase *db = nullptr; |
36 | 0 | if (!db) { |
37 | 0 | db = new QPlatformFontDatabase; |
38 | 0 | } |
39 | 0 | return db; |
40 | 0 | } |
41 | | |
42 | | /*! |
43 | | Accessor for the platform integration's clipboard. |
44 | | |
45 | | Default implementation returns a default QPlatformClipboard. |
46 | | |
47 | | \sa QPlatformClipboard |
48 | | |
49 | | */ |
50 | | |
51 | | #ifndef QT_NO_CLIPBOARD |
52 | | |
53 | | QPlatformClipboard *QPlatformIntegration::clipboard() const |
54 | 0 | { |
55 | 0 | static QPlatformClipboard *clipboard = nullptr; |
56 | 0 | if (!clipboard) { |
57 | 0 | clipboard = new QPlatformClipboard; |
58 | 0 | } |
59 | 0 | return clipboard; |
60 | 0 | } |
61 | | |
62 | | #endif |
63 | | |
64 | | #if QT_CONFIG(draganddrop) |
65 | | /*! |
66 | | Accessor for the platform integration's drag object. |
67 | | |
68 | | Default implementation returns QSimpleDrag. This class supports only drag |
69 | | and drop operations within the same Qt application. |
70 | | */ |
71 | | QPlatformDrag *QPlatformIntegration::drag() const |
72 | 0 | { |
73 | 0 | static QSimpleDrag *drag = nullptr; |
74 | 0 | if (!drag) { |
75 | 0 | drag = new QSimpleDrag; |
76 | 0 | } |
77 | 0 | return drag; |
78 | 0 | } |
79 | | #endif // QT_CONFIG(draganddrop) |
80 | | |
81 | | QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const |
82 | 0 | { |
83 | 0 | return nullptr; |
84 | 0 | } |
85 | | |
86 | | QPlatformServices *QPlatformIntegration::services() const |
87 | 0 | { |
88 | 0 | return nullptr; |
89 | 0 | } |
90 | | |
91 | | /*! |
92 | | \class QPlatformIntegration |
93 | | \since 4.8 |
94 | | \internal |
95 | | \preliminary |
96 | | \ingroup qpa |
97 | | \brief The QPlatformIntegration class is the entry for WindowSystem specific functionality. |
98 | | |
99 | | QPlatformIntegration is the single entry point for windowsystem specific functionality when |
100 | | using the QPA platform. It has factory functions for creating platform specific pixmaps and |
101 | | windows. The class also controls the font subsystem. |
102 | | |
103 | | QPlatformIntegration is a singleton class which gets instantiated in the QGuiApplication |
104 | | constructor. The QPlatformIntegration instance do not have ownership of objects it creates in |
105 | | functions where the name starts with create. However, functions which don't have a name |
106 | | starting with create acts as accessors to member variables. |
107 | | |
108 | | It is not trivial to create or build a platform plugin outside of the Qt source tree. Therefore |
109 | | the recommended approach for making new platform plugin is to copy an existing plugin inside |
110 | | the QTSRCTREE/src/plugins/platform and develop the plugin inside the source tree. |
111 | | |
112 | | The minimal platform integration is the smallest platform integration it is possible to make, |
113 | | which makes it an ideal starting point for new plugins. For a slightly more advanced plugin, |
114 | | consider reviewing the directfb plugin, or the testlite plugin. |
115 | | */ |
116 | | |
117 | | /*! |
118 | | \fn QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const |
119 | | |
120 | | Factory function for QPlatformPixmap. PixelType can be either PixmapType or BitmapType. |
121 | | \sa QPlatformPixmap |
122 | | */ |
123 | | |
124 | | /*! |
125 | | \fn QPlatformWindow *QPlatformIntegration::createPlatformWindow(QWindow *window) const |
126 | | |
127 | | Factory function for QPlatformWindow. The \a window parameter is a pointer to the window |
128 | | which the QPlatformWindow is supposed to be created for. |
129 | | |
130 | | All windows have to have a QPlatformWindow, and it will be created on-demand when the |
131 | | QWindow is made visible for the first time, or explicitly through calling QWindow::create(). |
132 | | |
133 | | In the constructor, of the QPlatformWindow, the window flags, state, title and geometry |
134 | | of the \a window should be applied to the underlying window. If the resulting flags or state |
135 | | differs, the resulting values should be set on the \a window using QWindow::setWindowFlags() |
136 | | or QWindow::setWindowState(), respectively. |
137 | | |
138 | | \sa QPlatformWindow, QPlatformWindowFormat |
139 | | \sa createPlatformBackingStore() |
140 | | */ |
141 | | |
142 | | /*! |
143 | | \fn QPlatformBackingStore *QPlatformIntegration::createPlatformBackingStore(QWindow *window) const |
144 | | |
145 | | Factory function for QPlatformBackingStore. The QWindow parameter is a pointer to the |
146 | | top level widget(tlw) the window surface is created for. A QPlatformWindow is always created |
147 | | before the QPlatformBackingStore for tlw where the widget also requires a backing store. |
148 | | |
149 | | \sa QBackingStore |
150 | | \sa createPlatformWindow() |
151 | | */ |
152 | | |
153 | | /*! |
154 | | \enum QPlatformIntegration::Capability |
155 | | |
156 | | Capabilities are used to determine specific features of a platform integration |
157 | | |
158 | | \value ThreadedPixmaps The platform uses a pixmap implementation that is reentrant |
159 | | and can be used from multiple threads, like the raster paint engine and QImage based |
160 | | pixmaps. |
161 | | |
162 | | \value OpenGL The platform supports OpenGL |
163 | | |
164 | | \value ThreadedOpenGL The platform supports using OpenGL outside the GUI thread. |
165 | | |
166 | | \value SharedGraphicsCache The platform supports a shared graphics cache |
167 | | |
168 | | \value BufferQueueingOpenGL Deprecated. The OpenGL implementation on the platform will |
169 | | queue up buffers when swapBuffers() is called and block only when its buffer pipeline |
170 | | is full, rather than block immediately. |
171 | | |
172 | | \value MultipleWindows The platform supports multiple QWindows, i.e. does some kind |
173 | | of compositing either client or server side. Some platforms might only support a |
174 | | single fullscreen window. |
175 | | |
176 | | \value ApplicationState The platform handles the application state explicitly. |
177 | | This means that QEvent::ApplicationActivate and QEvent::ApplicationDeativate |
178 | | will not be posted automatically. Instead, the platform must handle application |
179 | | state explicitly by using QWindowSystemInterface::handleApplicationStateChanged(). |
180 | | If not set, application state will follow window activation, which is the normal |
181 | | behavior for desktop platforms. |
182 | | |
183 | | \value ForeignWindows The platform allows creating QWindows which represent |
184 | | native windows created by other processes or by using native libraries. |
185 | | |
186 | | \value NonFullScreenWindows The platform supports top-level windows which do not |
187 | | fill the screen. The default implementation returns \c true. Returning false for |
188 | | this will cause all windows, including dialogs and popups, to be resized to fill the |
189 | | screen. |
190 | | |
191 | | \value WindowManagement The platform is based on a system that performs window |
192 | | management. This includes the typical desktop platforms. Can be set to false on |
193 | | platforms where no window management is available, meaning for example that windows |
194 | | are never repositioned by the window manager. The default implementation returns \c true. |
195 | | |
196 | | \value AllGLFunctionsQueryable Deprecated. Used to indicate whether the QOpenGLContext |
197 | | backend provided by the platform is |
198 | | able to return function pointers from getProcAddress() even for standard OpenGL |
199 | | functions, for example OpenGL 1 functions like glClear() or glDrawArrays(). This is |
200 | | important because the OpenGL specifications do not require this ability from the |
201 | | getProcAddress implementations of the windowing system interfaces (EGL, WGL, GLX). The |
202 | | platform plugins may however choose to enhance the behavior in the backend |
203 | | implementation for QOpenGLContext::getProcAddress() and support returning a function |
204 | | pointer also for the standard, non-extension functions. This capability is a |
205 | | prerequisite for dynamic OpenGL loading. Starting with Qt 5.7, the platform plugin |
206 | | is required to have this capability. |
207 | | |
208 | | \value [since 5.5] ApplicationIcon The platform supports setting the application icon. |
209 | | |
210 | | \value TopStackedNativeChildWindows The platform supports native child windows via |
211 | | QWindowContainer without having to punch a transparent hole in the |
212 | | backingstore. (since 5.10) |
213 | | |
214 | | \value OpenGLOnRasterSurface The platform supports making a QOpenGLContext current |
215 | | in combination with a QWindow of type RasterSurface. |
216 | | |
217 | | \value PaintEvents The platform sends paint events instead of expose events when |
218 | | the window needs repainting. Expose events are only sent when a window is toggled |
219 | | from a non-exposed to exposed state or back. |
220 | | |
221 | | \value RhiBasedRendering The platform supports one or more of the 3D rendering APIs |
222 | | that Qt Quick and other components can use via the Qt Rendering Hardware Interface. On |
223 | | platforms where it is clear upfront that the platform cannot, or does not want to, |
224 | | support rendering via 3D graphics APIs such as OpenGL, Vulkan, Direct 3D, or Metal, |
225 | | this capability can be reported as \c false. That in effect means that in modules |
226 | | where there is an alternative, such as Qt Quick with its \c software backend, an |
227 | | automatic fallback to that alternative may occur, if applicable. The default |
228 | | implementation of hasCapability() returns \c true. |
229 | | |
230 | | \value ScreenWindowGrabbing The platform supports grabbing window on screen. |
231 | | On Wayland, this capability can be reported as \c false. The default implementation |
232 | | of hasCapability() returns \c true. |
233 | | |
234 | | \value BackingStoreStaticContents The platform backingstore supports static contents. |
235 | | On resize of the backingstore the static contents region is provided, and the backing |
236 | | store is expected to propagate the static content to the resized backing store, without |
237 | | clients needing to repaint the static content region. |
238 | | |
239 | | \value OffscreenSurface The platform supports creating a platform offscreen surface |
240 | | without falling back to an implementation utilizing an invisible QWindow. A platform |
241 | | without this capability requires QOffscreenSurface::create to be called from the GUI |
242 | | thread. |
243 | | |
244 | | \value MouseCursorPositioning The platform supports programmatic cursor positioning via |
245 | | QCursor::setPos(). Platforms such as Wayland that enforce pointer confinement will |
246 | | return \c false. The default implementation returns \c false. |
247 | | */ |
248 | | |
249 | | /*! |
250 | | |
251 | | \fn QAbstractEventDispatcher *QPlatformIntegration::createEventDispatcher() const = 0 |
252 | | |
253 | | Factory function for the GUI event dispatcher. The platform plugin should create |
254 | | and return a QAbstractEventDispatcher subclass when this function is called. |
255 | | |
256 | | If the platform plugin for some reason creates the event dispatcher outside of |
257 | | this function (for example in the constructor), it needs to handle the case |
258 | | where this function is never called, ensuring that the event dispatcher is |
259 | | still deleted at some point (typically in the destructor). |
260 | | |
261 | | Note that the platform plugin should never explicitly set the event dispatcher |
262 | | itself, using QCoreApplication::setEventDispatcher(), but let QCoreApplication |
263 | | decide when and which event dispatcher to create. |
264 | | |
265 | | \since 5.2 |
266 | | */ |
267 | | |
268 | | bool QPlatformIntegration::hasCapability(Capability cap) const |
269 | 0 | { |
270 | 0 | return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement |
271 | 0 | || cap == TopStackedNativeChildWindows || cap == WindowActivation |
272 | 0 | || cap == RhiBasedRendering || cap == ScreenWindowGrabbing; |
273 | 0 | } |
274 | | |
275 | | QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const |
276 | 0 | { |
277 | 0 | return new QRasterPlatformPixmap(type); |
278 | 0 | } |
279 | | |
280 | | #ifndef QT_NO_OPENGL |
281 | | /*! |
282 | | Factory function for QPlatformOpenGLContext. The \a context parameter is a pointer to |
283 | | the context for which a platform-specific context backend needs to be |
284 | | created. Configuration settings like the format, share context and screen have to be |
285 | | taken from this QOpenGLContext and the resulting platform context is expected to be |
286 | | backed by a native context that fulfills these criteria. |
287 | | |
288 | | If the context has native handles set, no new native context is expected to be created. |
289 | | Instead, the provided handles have to be used. In this case the ownership of the handle |
290 | | must not be taken and the platform implementation is not allowed to destroy the native |
291 | | context. Configuration parameters like the format are also to be ignored. Instead, the |
292 | | platform implementation is responsible for querying the configuriation from the provided |
293 | | native context. |
294 | | |
295 | | Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could |
296 | | not be created. |
297 | | |
298 | | \sa QOpenGLContext |
299 | | */ |
300 | | QPlatformOpenGLContext *QPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const |
301 | | { |
302 | | Q_UNUSED(context); |
303 | | qWarning("This plugin does not support createPlatformOpenGLContext!"); |
304 | | return nullptr; |
305 | | } |
306 | | #endif // QT_NO_OPENGL |
307 | | |
308 | | /*! |
309 | | Factory function for QPlatformSharedGraphicsCache. This function will return 0 if the platform |
310 | | integration does not support any shared graphics cache mechanism for the given \a cacheId. |
311 | | */ |
312 | | QPlatformSharedGraphicsCache *QPlatformIntegration::createPlatformSharedGraphicsCache(const char *cacheId) const |
313 | 0 | { |
314 | 0 | qWarning("This plugin does not support createPlatformSharedGraphicsBuffer for cacheId: %s!", |
315 | 0 | cacheId); |
316 | 0 | return nullptr; |
317 | 0 | } |
318 | | |
319 | | /*! |
320 | | Factory function for QPaintEngine. This function will return 0 if the platform |
321 | | integration does not support creating any paint engine the given \a paintDevice. |
322 | | */ |
323 | | QPaintEngine *QPlatformIntegration::createImagePaintEngine(QPaintDevice *paintDevice) const |
324 | 0 | { |
325 | 0 | Q_UNUSED(paintDevice); |
326 | 0 | return nullptr; |
327 | 0 | } |
328 | | |
329 | | /*! |
330 | | Performs initialization steps that depend on having an event dispatcher |
331 | | available. Called after the event dispatcher has been created. |
332 | | |
333 | | Tasks that require an event dispatcher, for example creating socket notifiers, cannot be |
334 | | performed in the constructor. Instead, they should be performed here. The default |
335 | | implementation does nothing. |
336 | | */ |
337 | | void QPlatformIntegration::initialize() |
338 | 0 | { |
339 | 0 | } |
340 | | |
341 | | /*! |
342 | | Called before the platform integration is deleted. Useful when cleanup relies on virtual |
343 | | functions. |
344 | | |
345 | | \since 5.5 |
346 | | */ |
347 | | void QPlatformIntegration::destroy() |
348 | 0 | { |
349 | 0 | } |
350 | | |
351 | | /*! |
352 | | Returns the platforms input context. |
353 | | |
354 | | The default implementation returns \nullptr, implying no input method support. |
355 | | */ |
356 | | QPlatformInputContext *QPlatformIntegration::inputContext() const |
357 | 0 | { |
358 | 0 | return nullptr; |
359 | 0 | } |
360 | | |
361 | | /*! |
362 | | Accessor for the platform integration's key mapper. |
363 | | |
364 | | Default implementation returns a default QPlatformKeyMapper. |
365 | | |
366 | | \sa QPlatformKeyMapper |
367 | | */ |
368 | | QPlatformKeyMapper *QPlatformIntegration::keyMapper() const |
369 | 0 | { |
370 | 0 | static QPlatformKeyMapper *keyMapper = nullptr; |
371 | 0 | if (!keyMapper) |
372 | 0 | keyMapper = new QPlatformKeyMapper; |
373 | 0 | return keyMapper; |
374 | 0 | } |
375 | | |
376 | | #if QT_CONFIG(accessibility) |
377 | | |
378 | | /*! |
379 | | Returns the platforms accessibility. |
380 | | |
381 | | The default implementation returns QPlatformAccessibility which |
382 | | delegates handling of accessibility to accessiblebridge plugins. |
383 | | */ |
384 | | QPlatformAccessibility *QPlatformIntegration::accessibility() const |
385 | 0 | { |
386 | 0 | static QPlatformAccessibility *accessibility = nullptr; |
387 | 0 | if (Q_UNLIKELY(!accessibility)) { |
388 | 0 | accessibility = new QPlatformAccessibility; |
389 | 0 | } |
390 | 0 | return accessibility; |
391 | 0 | } |
392 | | |
393 | | #endif |
394 | | |
395 | | QVariant QPlatformIntegration::styleHint(StyleHint hint) const |
396 | 0 | { |
397 | 0 | switch (hint) { |
398 | 0 | case CursorFlashTime: |
399 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::CursorFlashTime); |
400 | 0 | case KeyboardInputInterval: |
401 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::KeyboardInputInterval); |
402 | 0 | case KeyboardAutoRepeatRate: |
403 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::KeyboardAutoRepeatRate); |
404 | 0 | case MouseDoubleClickInterval: |
405 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::MouseDoubleClickInterval); |
406 | 0 | case StartDragDistance: |
407 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragDistance); |
408 | 0 | case StartDragTime: |
409 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragTime); |
410 | 0 | case ShowIsFullScreen: |
411 | 0 | return false; |
412 | 0 | case ShowIsMaximized: |
413 | 0 | return false; |
414 | 0 | case ShowShortcutsInContextMenus: |
415 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::ShowShortcutsInContextMenus); |
416 | 0 | case PasswordMaskDelay: |
417 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay); |
418 | 0 | case PasswordMaskCharacter: |
419 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskCharacter); |
420 | 0 | case FontSmoothingGamma: |
421 | 0 | return qreal(1.7); |
422 | 0 | case StartDragVelocity: |
423 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragVelocity); |
424 | 0 | case UseRtlExtensions: |
425 | 0 | return QVariant(false); |
426 | 0 | case SetFocusOnTouchRelease: |
427 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::SetFocusOnTouchRelease); |
428 | 0 | case MousePressAndHoldInterval: |
429 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::MousePressAndHoldInterval); |
430 | 0 | case TabFocusBehavior: |
431 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::TabFocusBehavior); |
432 | 0 | case ReplayMousePressOutsidePopup: |
433 | 0 | return true; |
434 | 0 | case ItemViewActivateItemOnSingleClick: |
435 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick); |
436 | 0 | case UiEffects: |
437 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::UiEffects); |
438 | 0 | case WheelScrollLines: |
439 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::WheelScrollLines); |
440 | 0 | case MouseQuickSelectionThreshold: |
441 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::MouseQuickSelectionThreshold); |
442 | 0 | case MouseDoubleClickDistance: |
443 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::MouseDoubleClickDistance); |
444 | 0 | case FlickStartDistance: |
445 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::FlickStartDistance); |
446 | 0 | case FlickMaximumVelocity: |
447 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::FlickMaximumVelocity); |
448 | 0 | case FlickDeceleration: |
449 | 0 | return QPlatformTheme::defaultThemeHint(QPlatformTheme::FlickDeceleration); |
450 | 0 | case UnderlineShortcut: |
451 | 0 | return true; |
452 | 0 | } |
453 | | |
454 | 0 | return 0; |
455 | 0 | } |
456 | | |
457 | | Qt::WindowState QPlatformIntegration::defaultWindowState(Qt::WindowFlags flags) const |
458 | 0 | { |
459 | | // Leave popup-windows as is |
460 | 0 | if (flags & Qt::Popup & ~Qt::Window) |
461 | 0 | return Qt::WindowNoState; |
462 | | |
463 | 0 | if (flags & Qt::SubWindow) |
464 | 0 | return Qt::WindowNoState; |
465 | | |
466 | 0 | if (styleHint(QPlatformIntegration::ShowIsFullScreen).toBool()) |
467 | 0 | return Qt::WindowFullScreen; |
468 | 0 | else if (styleHint(QPlatformIntegration::ShowIsMaximized).toBool()) |
469 | 0 | return Qt::WindowMaximized; |
470 | | |
471 | 0 | return Qt::WindowNoState; |
472 | 0 | } |
473 | | |
474 | | Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const |
475 | 0 | { |
476 | 0 | return QGuiApplication::keyboardModifiers(); |
477 | 0 | } |
478 | | |
479 | | /*! |
480 | | Should be used to obtain a list of possible shortcuts for the given key |
481 | | event. Shortcuts should be encoded as int(Qt::Key + Qt::KeyboardModifiers). |
482 | | |
483 | | One example for more than one possibility is the key combination of Shift+5. |
484 | | That one might trigger a shortcut which is set as "Shift+5" as well as one |
485 | | using %. These combinations depend on the currently set keyboard layout. |
486 | | |
487 | | \note This function should be called only from key event handlers. |
488 | | */ |
489 | | QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const |
490 | 0 | { |
491 | 0 | return QList<int>(); |
492 | 0 | } |
493 | | |
494 | | QStringList QPlatformIntegration::themeNames() const |
495 | 0 | { |
496 | 0 | return QStringList(); |
497 | 0 | } |
498 | | |
499 | | class QPlatformTheme *QPlatformIntegration::createPlatformTheme(const QString &name) const |
500 | 0 | { |
501 | 0 | Q_UNUSED(name); |
502 | 0 | return new QPlatformTheme; |
503 | 0 | } |
504 | | |
505 | | /*! |
506 | | Factory function for QOffscreenSurface. An offscreen surface will typically be implemented with a |
507 | | pixel buffer (pbuffer). If the platform doesn't support offscreen surfaces, an invisible window |
508 | | will be used by QOffscreenSurface instead. |
509 | | |
510 | | If the platform has the OffscreenSurface capability, this should always return a valid pointer. |
511 | | */ |
512 | | QPlatformOffscreenSurface *QPlatformIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const |
513 | 0 | { |
514 | 0 | Q_UNUSED(surface); |
515 | 0 | return nullptr; |
516 | 0 | } |
517 | | |
518 | | #ifndef QT_NO_SESSIONMANAGER |
519 | | /*! |
520 | | \since 5.2 |
521 | | |
522 | | Factory function for QPlatformSessionManager. The default QPlatformSessionManager provides the same |
523 | | functionality as the QSessionManager. |
524 | | */ |
525 | | QPlatformSessionManager *QPlatformIntegration::createPlatformSessionManager(const QString &id, const QString &key) const |
526 | 0 | { |
527 | 0 | return new QPlatformSessionManager(id, key); |
528 | 0 | } |
529 | | #endif |
530 | | |
531 | | /*! |
532 | | \since 5.2 |
533 | | |
534 | | Function to sync the platform integrations state with the window system. |
535 | | |
536 | | This is often implemented as a roundtrip from the platformintegration to the window system. |
537 | | |
538 | | This function should not call QWindowSystemInterface::flushWindowSystemEvents() or |
539 | | QCoreApplication::processEvents() |
540 | | */ |
541 | | void QPlatformIntegration::sync() |
542 | 0 | { |
543 | 0 | } |
544 | | |
545 | | /*! |
546 | | \since 5.7 |
547 | | |
548 | | Should sound a bell, using the default volume and sound. |
549 | | |
550 | | \sa QApplication::beep() |
551 | | */ |
552 | | void QPlatformIntegration::beep() const |
553 | 0 | { |
554 | 0 | } |
555 | | |
556 | | /*! |
557 | | \since 6.0 |
558 | | |
559 | | Asks the platform to terminate the application. |
560 | | |
561 | | Overrides should ensure there's a callback into the QWSI |
562 | | function handleApplicationTermination so that the quit can |
563 | | be propagated to QtGui and the application. |
564 | | */ |
565 | | void QPlatformIntegration::quit() const |
566 | 0 | { |
567 | 0 | QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>(); |
568 | 0 | } |
569 | | |
570 | | #ifndef QT_NO_OPENGL |
571 | | /*! |
572 | | Platform integration function for querying the OpenGL implementation type. |
573 | | |
574 | | Used only when dynamic OpenGL implementation loading is enabled. |
575 | | |
576 | | Subclasses should reimplement this function and return a value based on |
577 | | the OpenGL implementation they have chosen to load. |
578 | | |
579 | | \note The return value does not indicate or limit the types of |
580 | | contexts that can be created by a given implementation. For example |
581 | | a desktop OpenGL implementation may be capable of creating OpenGL |
582 | | ES-compatible contexts too. |
583 | | |
584 | | \sa QOpenGLContext::openGLModuleType(), QOpenGLContext::isOpenGLES() |
585 | | |
586 | | \since 5.3 |
587 | | */ |
588 | | QOpenGLContext::OpenGLModuleType QPlatformIntegration::openGLModuleType() |
589 | | { |
590 | | qWarning("This plugin does not support dynamic OpenGL loading!"); |
591 | | return QOpenGLContext::LibGL; |
592 | | } |
593 | | #endif |
594 | | |
595 | | /*! |
596 | | \since 5.5 |
597 | | |
598 | | Platform integration function for setting the application icon. |
599 | | |
600 | | \sa QGuiApplication::setWindowIcon() |
601 | | */ |
602 | | void QPlatformIntegration::setApplicationIcon(const QIcon &icon) const |
603 | 0 | { |
604 | 0 | Q_UNUSED(icon); |
605 | 0 | } |
606 | | |
607 | | /*! |
608 | | \since 6.5 |
609 | | |
610 | | Should set the application's badge to \a number. |
611 | | |
612 | | If the number is 0 the badge should be cleared. |
613 | | |
614 | | \sa QGuiApplication::setBadge() |
615 | | */ |
616 | | void QPlatformIntegration::setApplicationBadge(qint64 number) |
617 | 0 | { |
618 | | Q_UNUSED(number); |
619 | 0 | } |
620 | | |
621 | | #if QT_CONFIG(vulkan) || defined(Q_QDOC) |
622 | | |
623 | | /*! |
624 | | Factory function for QPlatformVulkanInstance. The \a instance parameter is a |
625 | | pointer to the instance for which a platform-specific backend needs to be |
626 | | created. |
627 | | |
628 | | Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could |
629 | | not be created. |
630 | | |
631 | | \sa QVulkanInstance |
632 | | \since 5.10 |
633 | | */ |
634 | | QPlatformVulkanInstance *QPlatformIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const |
635 | | { |
636 | | Q_UNUSED(instance); |
637 | | qWarning("This plugin does not support createPlatformVulkanInstance"); |
638 | | return nullptr; |
639 | | } |
640 | | |
641 | | #endif // QT_CONFIG(vulkan) |
642 | | |
643 | | QT_END_NAMESPACE |