KDDockWidgets API Documentation 2.1
|
implements functions specific to a particular platform A platform can be for example qtwidgets, qtquick, etc. More...
#include <Platform.h>
Public Member Functions | |
Platform () | |
~Platform () override | |
QString | applicationName () const override |
Returns the application name This name will be used as title of floating dock widgets which contain more than 1 group. | |
Core::ViewFactory * | createDefaultViewFactory () override |
Creates and returns the default ViewFactory. | |
Core::View * | createView (Core::Controller *controller, Core::View *parent=nullptr) const override |
Create an empty view For Qt this would just returns a empty QWidget or QQuickItem other frontends can return something as basic. | |
Point | cursorPos () const override |
Returns the mouse cursor position in screen coordinates. | |
DisplayType | displayType () const override |
Returns the type of graphics stack being used. | |
std::shared_ptr< Core::View > | focusedView () const override |
Returns the focused view, if any. | |
bool | hasActivePopup () const override |
Returns whether a popup is open Usually not needed to override. Investigate further in case side bars aren't auto hiding. | |
bool | inDisallowedDragView (Point globalPos) const override |
Returns whether the specified global position is on top of a view that isn't draggable. This is needed since not the entire title bar is draggable. For example, clicking on the close button shouldn't start a drag. | |
bool | isLeftMouseButtonPressed () const override |
Returns whether the left mouse button is pressed. | |
bool | isProcessingAppQuitEvent () const override |
Returns whether we're processing a Event::Quit. | |
const char * | name () const override |
Returns the name of the platform, only "qtwidgets" and "qtquick". | |
virtual void | onDropIndicatorOverlayCreated (flutter::IndicatorWindow *) |
virtual void | onDropIndicatorOverlayDestroyed (flutter::IndicatorWindow *) |
void | onFloatingWindowCreated (Core::FloatingWindow *) override |
Called when a floating window is created. Overridden by flutter, so it can create a window. | |
void | onFloatingWindowDestroyed (Core::FloatingWindow *) override |
Called when a floating window is created. Overridden by flutter, so it can destroy the window. | |
void | onMainWindowCreated (Core::MainWindow *) override |
Called when a main window is created. Overridden by flutter, so it can create a window Used by tests only. In real life users will instantiate a MainWindow in dart directly. | |
void | onMainWindowDestroyed (Core::MainWindow *) override |
Called when a main window is created. Overridden by flutter, so it can destroy the window. | |
std::shared_ptr< Core::Screen > | primaryScreen () const override |
virtual void | rebuildWindowOverlay () |
void | restoreMouseCursor () override |
Undoes the call to setMouseCursor() | |
void | runDelayed (int ms, Core::DelayedCall *c) override |
int | screenNumberForView (Core::View *) const override |
Returns the screen index for the specified view or window. It's up to the platform to decide how screens are ordered, kddw won't care. | |
int | screenNumberForWindow (std::shared_ptr< Core::Window >) const override |
Vector< std::shared_ptr< Core::Screen > > | screens () const override |
Returns all available screens. | |
Size | screenSizeFor (Core::View *) const override |
Returns the size of the screen where this view is in. | |
void | sendEvent (Core::View *, Event *) const override |
Sends the specified event to the specified view. | |
void | setCursorPos (Point) override |
Sets the mouse cursor position in screen coordinates. | |
void | setFocusedView (std::shared_ptr< Core::View >) |
void | setMouseCursor (Qt::CursorShape, bool discardLast=false) override |
Sets the mouse cursor to the specified shape, this has an application-wide effect Call restoreMouseCursor() to set the previous cursor shape. | |
void | ungrabMouse () override |
Releases the mouse grab, if any. | |
bool | usesFallbackMouseGrabber () const override |
Return whether we use the global event filter based mouse grabber. | |
std::shared_ptr< Core::Window > | windowAt (Point globalPos) const override |
Returns the window at the specified global coordinates. | |
Vector< std::shared_ptr< Core::Window > > | windows () const override |
Returns all windows. | |
Public Member Functions inherited from KDDockWidgets::Core::Platform | |
virtual void | dumpManagedBacktrace () |
For non-C++, managed languages (having a VM) prints a non-native back-trace For example, the flutter frontend implements this to get a dart backtrace Used for debugging only. Can be called by gdb. | |
void | installGlobalEventFilter (EventFilterInterface *) |
Installs a global event filter Events will be forwarded to the specified EventFilterInterface. | |
bool | isQt () const |
Returns whether this platform is Qt based. | |
bool | isQtQuick () const |
Returns whether this platform is QtQuick. | |
bool | isQtWidgets () const |
Returns whether this platform is QtWidgets. | |
virtual QByteArray | readFile (const QString &, bool &ok) const |
void | removeGlobalEventFilter (EventFilterInterface *) |
Removes a global event filter. | |
virtual int | screenNumberForWindow (std::shared_ptr< Core::Window >) const =0 |
int | startDragDistance () const |
Returns how many pixels the mouse must move for a drag to start This is usually 4 by default (QApplication::startDragDistance() for QtWidgets) You can override by calling Config::setStartDragDistance(), so you don't need to create a new Platform class. | |
virtual bool | supportsAeroSnap () const |
Only supported on Qt, for windows. | |
Static Public Member Functions | |
static Platform * | platformFlutter () |
Static Public Member Functions inherited from KDDockWidgets::Core::Platform | |
static std::vector< KDDockWidgets::FrontendType > | frontendTypes () |
list the list of frontend types supported by this build | |
static bool | hasInstance () |
Returns whether a Platform instance exists. | |
static Platform * | instance () |
Returns the platform singleton. | |
static bool | isInitialized () |
Returns whether the Platform was already initialized. | |
Public Attributes | |
Private *const | d |
Public Attributes inherited from KDDockWidgets::Core::Platform | |
Private *const | d |
Static Public Attributes | |
static Point | s_lastCursorPosition = { -1, -1 } |
Protected Member Functions | |
void | init () |
Protected Member Functions inherited from KDDockWidgets::Core::Platform | |
Platform () | |
Platform (const Platform &)=delete | |
Platform & | operator= (const Platform &)=delete |
virtual int | startDragDistance_impl () const |
Additional Inherited Members | |
Public Types inherited from KDDockWidgets::Core::Platform | |
enum class | DisplayType { Other = 0 , X11 = 1 , Wayland = 2 , QtOffscreen = 3 , QtEGLFS = 4 , Windows = 5 } |
Enum describing the graphics stack type. More... | |
implements functions specific to a particular platform A platform can be for example qtwidgets, qtquick, etc.
Definition at line 34 of file flutter/Platform.h.
Platform::Platform | ( | ) |
Definition at line 40 of file flutter/Platform.cpp.
References init().
|
overridevirtual |
Reimplemented from KDDockWidgets::Core::Platform.
Definition at line 46 of file flutter/Platform.cpp.
References d.
|
overridevirtual |
Returns the application name This name will be used as title of floating dock widgets which contain more than 1 group.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 111 of file flutter/Platform.cpp.
|
overridevirtual |
Creates and returns the default ViewFactory.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 82 of file flutter/Platform.cpp.
|
overridevirtual |
Create an empty view For Qt this would just returns a empty QWidget or QQuickItem other frontends can return something as basic.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 146 of file flutter/Platform.cpp.
|
overridevirtual |
Returns the mouse cursor position in screen coordinates.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 218 of file flutter/Platform.cpp.
References s_lastCursorPosition.
|
overridevirtual |
Returns the type of graphics stack being used.
Implements KDDockWidgets::Core::Platform.
Definition at line 128 of file flutter/Platform.cpp.
References KDDockWidgets::Core::Platform::Other.
|
overridevirtual |
Returns the focused view, if any.
Implements KDDockWidgets::Core::Platform.
Definition at line 55 of file flutter/Platform.cpp.
References d.
Referenced by KDDockWidgets::flutter::View::hasFocus().
|
overridevirtual |
Returns whether a popup is open Usually not needed to override. Investigate further in case side bars aren't auto hiding.
Reimplemented from KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 77 of file flutter/Platform.cpp.
|
overridevirtual |
Returns whether the specified global position is on top of a view that isn't draggable. This is needed since not the entire title bar is draggable. For example, clicking on the close button shouldn't start a drag.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 157 of file flutter/Platform.cpp.
|
protected |
Definition at line 51 of file flutter/Platform.cpp.
Referenced by Platform(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::init().
|
overridevirtual |
Returns whether the left mouse button is pressed.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 134 of file flutter/Platform.cpp.
|
overridevirtual |
Returns whether we're processing a Event::Quit.
Used internally to know if we should let Qt close a NonClosable dock widget at shutdown time.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 105 of file flutter/Platform.cpp.
|
overridevirtual |
Returns the name of the platform, only "qtwidgets" and "qtquick".
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 71 of file flutter/Platform.cpp.
|
virtual |
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 198 of file flutter/Platform.cpp.
Referenced by KDDockWidgets::flutter::IndicatorWindow::IndicatorWindow(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onDropIndicatorOverlayCreated(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onDropIndicatorOverlayCreated_nocallback().
|
virtual |
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 203 of file flutter/Platform.cpp.
Referenced by KDDockWidgets::flutter::IndicatorWindow::~IndicatorWindow(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onDropIndicatorOverlayDestroyed(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onDropIndicatorOverlayDestroyed_nocallback().
|
overridevirtual |
Called when a floating window is created. Overridden by flutter, so it can create a window.
Reimplemented from KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 178 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onFloatingWindowCreated(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onFloatingWindowCreated_nocallback().
|
overridevirtual |
Called when a floating window is created. Overridden by flutter, so it can destroy the window.
Reimplemented from KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 183 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onFloatingWindowDestroyed(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onFloatingWindowDestroyed_nocallback().
|
overridevirtual |
Called when a main window is created. Overridden by flutter, so it can create a window Used by tests only. In real life users will instantiate a MainWindow in dart directly.
Reimplemented from KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 188 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onMainWindowCreated(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onMainWindowCreated_nocallback().
|
overridevirtual |
Called when a main window is created. Overridden by flutter, so it can destroy the window.
Reimplemented from KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 193 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onMainWindowDestroyed(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::onMainWindowDestroyed_nocallback().
|
inlinestatic |
Definition at line 40 of file flutter/Platform.h.
Referenced by KDDockWidgets::flutter::IndicatorWindow::IndicatorWindow(), KDDockWidgets::flutter::IndicatorWindow::~IndicatorWindow(), KDDockWidgets::flutter::View::~View(), KDDockWidgets::flutter::View::hasFocus(), KDDockWidgets::flutter::View::setFocus(), and KDDockWidgets::flutter::IndicatorWindow::setVisible().
|
overridevirtual |
Implements KDDockWidgets::Core::Platform.
Definition at line 173 of file flutter/Platform.cpp.
Referenced by screens().
|
virtual |
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 208 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::rebuildWindowOverlay(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::rebuildWindowOverlay_nocallback(), and KDDockWidgets::flutter::IndicatorWindow::setVisible().
|
overridevirtual |
Undoes the call to setMouseCursor()
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 123 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::restoreMouseCursor(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::restoreMouseCursor_nocallback().
|
overridevirtual |
runs the specified all after ms Equivalent to QTimer::singleShot in Qt
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 213 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::runDelayed(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::runDelayed_nocallback().
|
overridevirtual |
Returns the screen index for the specified view or window. It's up to the platform to decide how screens are ordered, kddw won't care.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 93 of file flutter/Platform.cpp.
|
override |
Definition at line 99 of file flutter/Platform.cpp.
|
overridevirtual |
Returns all available screens.
Implements KDDockWidgets::Core::Platform.
Definition at line 167 of file flutter/Platform.cpp.
References primaryScreen().
|
overridevirtual |
Returns the size of the screen where this view is in.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 140 of file flutter/Platform.cpp.
|
overridevirtual |
Sends the specified event to the specified view.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 66 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::sendEvent(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::sendEvent_nocallback().
|
overridevirtual |
Sets the mouse cursor position in screen coordinates.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 223 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::setCursorPos(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::setCursorPos_nocallback().
void Platform::setFocusedView | ( | std::shared_ptr< Core::View > | view | ) |
Definition at line 376 of file flutter/Platform.cpp.
References d.
Referenced by KDDockWidgets::flutter::View::~View(), and KDDockWidgets::flutter::View::setFocus().
|
overridevirtual |
Sets the mouse cursor to the specified shape, this has an application-wide effect Call restoreMouseCursor() to set the previous cursor shape.
discardLast | If true, then the previous shape is discarded instead of being saved into a stack for restoreMouseCursor() |
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 118 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::setMouseCursor(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::setMouseCursor_nocallback().
|
overridevirtual |
Releases the mouse grab, if any.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 162 of file flutter/Platform.cpp.
Referenced by KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::ungrabMouse(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper::ungrabMouse_nocallback().
|
overridevirtual |
Return whether we use the global event filter based mouse grabber.
Implements KDDockWidgets::Core::Platform.
Reimplemented in KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::Platform_wrapper.
Definition at line 152 of file flutter/Platform.cpp.
|
overridevirtual |
Returns the window at the specified global coordinates.
Implements KDDockWidgets::Core::Platform.
Definition at line 87 of file flutter/Platform.cpp.
|
overridevirtual |
Returns all windows.
Implements KDDockWidgets::Core::Platform.
Definition at line 60 of file flutter/Platform.cpp.
Private* const KDDockWidgets::flutter::Platform::d |
Definition at line 151 of file flutter/Platform.h.
Referenced by ~Platform(), focusedView(), and setFocusedView().
|
static |
Flutter doesn't have a better way of retrieving the cursor position so save it whenever we get a move event
Definition at line 47 of file flutter/Platform.h.
Referenced by cursorPos(), and KDDockWidgets::flutter::View::onMouseEvent().