AUI Framework
develop
Cross-platform base for C++ UI apps
|
Platform Abstraction Layer. More...
#include <AUI/Platform/linux/IPlatformAbstraction.h>
Public Member Functions# | |
virtual void | init ()=0 |
virtual _< ACursor::Custom > | createCustomCursor (AImageView image)=0 |
virtual void | applyNativeCursor (const ACursor &cursor, AWindow *pWindow)=0 |
virtual void | copyToClipboard (const AString &text)=0 |
virtual AString | pasteFromClipboard ()=0 |
virtual glm::ivec2 | desktopGetMousePosition ()=0 |
virtual void | desktopSetMousePosition (glm::ivec2 pos)=0 |
virtual float | platformGetDpiRatio ()=0 |
virtual AInput::Key | inputFromNative (int k)=0 |
virtual int | inputToNative (AInput::Key key)=0 |
virtual bool | inputIsKeyDown (AInput::Key k)=0 |
virtual void | windowSetStyle (AWindow &window, WindowStyle ws)=0 |
virtual float | windowFetchDpiFromSystem (AWindow &window)=0 |
virtual void | windowRestore (AWindow &window)=0 |
virtual void | windowMinimize (AWindow &window)=0 |
virtual bool | windowIsMinimized (AWindow &window) const =0 |
virtual bool | windowIsMaximized (AWindow &window) const =0 |
virtual void | windowMaximize (AWindow &window)=0 |
virtual glm::ivec2 | windowGetPosition (AWindow &window) const =0 |
virtual void | windowFlagRedraw (AWindow &window)=0 |
virtual void | windowShow (AWindow &window)=0 |
virtual void | windowSetSize (AWindow &window, glm::ivec2 size)=0 |
virtual void | windowSetGeometry (AWindow &window, int x, int y, int width, int height)=0 |
virtual void | windowSetIcon (AWindow &window, const AImage &image)=0 |
virtual void | windowHide (AWindow &window)=0 |
virtual void | windowManagerNotifyProcessMessages ()=0 |
virtual void | windowManagerLoop ()=0 |
virtual void | windowBlockUserInput (AWindow &window, bool blockUserInput)=0 |
virtual void | windowAllowDragNDrop (AWindow &window)=0 |
virtual void | windowShowTouchscreenKeyboardImpl (AWindow &window)=0 |
virtual void | windowHideTouchscreenKeyboardImpl (AWindow &window)=0 |
virtual void | windowMoveToCenter (AWindow &window)=0 |
virtual void | windowQuit (AWindow &window)=0 |
virtual void | windowAnnounceMinMaxSize (AWindow &window)=0 |
virtual void | windowManagerInitNativeWindow (const IRenderingContext::Init &init)=0 |
virtual float | windowGetDpiRatio (AWindow &window) |
virtual AMessageBox::ResultButton | messageBoxShow (AWindow *parent, const AString &title, const AString &message, AMessageBox::Icon icon, AMessageBox::Button b)=0 |
Static Public Member Functions# | |
static IPlatformAbstraction & | current () |
static void | setCurrentWindow (AWindowBase *window) |
static bool & | redrawFlag (AWindow &window) |
static AWindowNativePtr & | nativeHandle (AWindow &window) |
static AWindow *& | parentWindow (AWindow &window) |
static bool & | wasMaximized (AWindow &window) |
Runtime layer for switching between multiple displaying options (i.e, Linux = X11 or Wayland).
This is a direct equivalent of Qt's Platform Abstraction.
AUI framework is designed to be flexible and adaptable to different desktop environments and UI toolkits. This is achieved through a platform abstraction layer that isolates the core application logic from the specifics of the underlying UI implementation.
Currently, the framework supports the following UI backends:
The framework determines the preferred UI backend based on an initializationOrder
defined within APlatformAbstractionOptions. The order prioritizes backends, attempting to initialize them sequentially.
To minimize dependencies and enhance compatibility, the framework utilizes dynamic loading for certain UI backends. For example, the Adwaita backend loads the libadwaita-1.so
library at runtime using dlopen
.
The generate_dl_subs
function from aui.toolbox
is used to automatically generate dlsym
-based function implementations based on a list of signatures (*.sigs
) that need to be exported from the dynamically loaded libraries. This allows the framework to call functions within the loaded library without requiring explicit linking.