KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
KDDockWidgets::flutter::Platform Class Reference

implements functions specific to a particular platform A platform can be for example qtwidgets, qtquick, etc. More...

#include <Platform.h>

Inheritance diagram for KDDockWidgets::flutter::Platform:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::flutter::Platform:
Collaboration graph
[legend]

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::ViewFactorycreateDefaultViewFactory () override
 Creates and returns the default ViewFactory.
 
Core::ViewcreateView (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::ViewfocusedView () 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 PlatformplatformFlutter ()
 
- Static Public Member Functions inherited from KDDockWidgets::Core::Platform
static std::vector< KDDockWidgets::FrontendTypefrontendTypes ()
 list the list of frontend types supported by this build
 
static bool hasInstance ()
 Returns whether a Platform instance exists.
 
static Platforminstance ()
 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
 
Platformoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Platform()

Platform::Platform ( )

Definition at line 40 of file flutter/Platform.cpp.

References init().

◆ ~Platform()

Platform::~Platform ( )
overridevirtual

Reimplemented from KDDockWidgets::Core::Platform.

Definition at line 46 of file flutter/Platform.cpp.

References d.

Member Function Documentation

◆ applicationName()

QString Platform::applicationName ( ) const
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.

◆ createDefaultViewFactory()

Core::ViewFactory * Platform::createDefaultViewFactory ( )
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.

◆ createView()

Core::View * Platform::createView ( Core::Controller ,
Core::View parent = nullptr 
) const
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.

◆ cursorPos()

Point Platform::cursorPos ( ) const
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.

◆ displayType()

Core::Platform::DisplayType Platform::displayType ( ) const
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.

◆ focusedView()

std::shared_ptr< Core::View > Platform::focusedView ( ) const
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().

◆ hasActivePopup()

bool Platform::hasActivePopup ( ) const
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.

◆ inDisallowedDragView()

bool Platform::inDisallowedDragView ( Point  globalPos) const
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.

◆ init()

void Platform::init ( )
protected

◆ isLeftMouseButtonPressed()

bool Platform::isLeftMouseButtonPressed ( ) const
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.

◆ isProcessingAppQuitEvent()

bool Platform::isProcessingAppQuitEvent ( ) const
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.

◆ name()

const char * Platform::name ( ) const
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.

◆ onDropIndicatorOverlayCreated()

void Platform::onDropIndicatorOverlayCreated ( flutter::IndicatorWindow )
virtual

◆ onDropIndicatorOverlayDestroyed()

void Platform::onDropIndicatorOverlayDestroyed ( flutter::IndicatorWindow )
virtual

◆ onFloatingWindowCreated()

void Platform::onFloatingWindowCreated ( Core::FloatingWindow )
overridevirtual

◆ onFloatingWindowDestroyed()

void Platform::onFloatingWindowDestroyed ( Core::FloatingWindow )
overridevirtual

◆ onMainWindowCreated()

void Platform::onMainWindowCreated ( Core::MainWindow )
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().

◆ onMainWindowDestroyed()

void Platform::onMainWindowDestroyed ( Core::MainWindow )
overridevirtual

◆ platformFlutter()

static Platform * KDDockWidgets::flutter::Platform::platformFlutter ( )
inlinestatic

◆ primaryScreen()

Core::Screen::Ptr Platform::primaryScreen ( ) const
overridevirtual

Implements KDDockWidgets::Core::Platform.

Definition at line 173 of file flutter/Platform.cpp.

Referenced by screens().

◆ rebuildWindowOverlay()

void Platform::rebuildWindowOverlay ( )
virtual

◆ restoreMouseCursor()

void Platform::restoreMouseCursor ( )
overridevirtual

◆ runDelayed()

void Platform::runDelayed ( int  ms,
Core::DelayedCall *  c 
)
overridevirtual

◆ screenNumberForView()

int Platform::screenNumberForView ( Core::View ) const
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.

◆ screenNumberForWindow()

int Platform::screenNumberForWindow ( std::shared_ptr< Core::Window >  ) const
override

Definition at line 99 of file flutter/Platform.cpp.

◆ screens()

Core::Screen::List Platform::screens ( ) const
overridevirtual

Returns all available screens.

Implements KDDockWidgets::Core::Platform.

Definition at line 167 of file flutter/Platform.cpp.

References primaryScreen().

◆ screenSizeFor()

Size Platform::screenSizeFor ( Core::View ) const
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.

◆ sendEvent()

void Platform::sendEvent ( Core::View ,
Event *   
) const
overridevirtual

◆ setCursorPos()

void Platform::setCursorPos ( Point  )
overridevirtual

◆ setFocusedView()

void Platform::setFocusedView ( std::shared_ptr< Core::View view)

◆ setMouseCursor()

void Platform::setMouseCursor ( Qt::CursorShape  ,
bool  discardLast = false 
)
overridevirtual

Sets the mouse cursor to the specified shape, this has an application-wide effect Call restoreMouseCursor() to set the previous cursor shape.

Parameters
discardLastIf 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().

◆ ungrabMouse()

void Platform::ungrabMouse ( )
overridevirtual

◆ usesFallbackMouseGrabber()

bool Platform::usesFallbackMouseGrabber ( ) const
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.

◆ windowAt()

Core::Window::Ptr Platform::windowAt ( Point  globalPos) const
overridevirtual

Returns the window at the specified global coordinates.

Implements KDDockWidgets::Core::Platform.

Definition at line 87 of file flutter/Platform.cpp.

◆ windows()

Vector< std::shared_ptr< Core::Window > > Platform::windows ( ) const
overridevirtual

Returns all windows.

Implements KDDockWidgets::Core::Platform.

Definition at line 60 of file flutter/Platform.cpp.

Member Data Documentation

◆ d

Private* const KDDockWidgets::flutter::Platform::d

Definition at line 151 of file flutter/Platform.h.

Referenced by ~Platform(), focusedView(), and setFocusedView().

◆ s_lastCursorPosition

Point Platform::s_lastCursorPosition = { -1, -1 }
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().


The documentation for this class was generated from the following files:

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8