From 1cce68efdb80024f926e1c0dd82a159e7e115c76 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 7 Feb 2024 15:41:15 -0700 Subject: [PATCH] Add QPA documentation --- web/src/documentation/01_usage.rst | 14 ++++++++++++++ web/src/documentation/api/00_overview.rst | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/web/src/documentation/01_usage.rst b/web/src/documentation/01_usage.rst index 415f9cdb7..3a3dbe935 100644 --- a/web/src/documentation/01_usage.rst +++ b/web/src/documentation/01_usage.rst @@ -319,3 +319,17 @@ These examples assume you have `jq` installed. # Disable telemetry rot settings set telemetry false + +.. _blight_client: + +Display Server Client (blight-client) +===================================== + +When running an application from the command line, you can force it to use the display server by running it with ``blight-client``. The client supports configuration with the following environment variables: + +- ``OXIDE_PRELOAD_FORCE_QT`` Force a Qt application to use the Oxide QPA. +- ``OXIDE_PRELOAD_FORCE_RM1`` Force an application to believe it is running on a reMarkable 1 tablet. +- ``OXIDE_PRELOAD_EXPOSE_FB`` If set, the framebuffer will be directly exposed to the application. It is not recommended to use this, as the display server is not expecting applications to have direct access outside of exclusive mode. +- ``OXIDE_INPUT_BATCH_SIZE`` Number of input events without a EV_SYN SYN_REPORT to queue before flushing them through to the application. Defaults to 16 +- ``OXIDE_PRELOAD_DEBUG`` Debug level. Defaults to 4. +- ``OXIDE_PRELOAD_DISABLE_INPUT`` Disable input handling. diff --git a/web/src/documentation/api/00_overview.rst b/web/src/documentation/api/00_overview.rst index fc1310c97..d151d1dd8 100644 --- a/web/src/documentation/api/00_overview.rst +++ b/web/src/documentation/api/00_overview.rst @@ -48,3 +48,25 @@ Libblight Shared Library Oxide provides a shared library for interacting with the display server. `You can find the documentation here <../../libblight/index.html>`__ + +Oxide Qt Platform Abstraction (QPA) +=================================== + +Oxide ships a QPA for Qt applications to use. This will automatically use the display server for updating the screen, as well as user input. + +If you are using liboxide, a call to `deviceSettings.setupQtEnvironment()` will setup the application to use the Oxide QPA. To manualy use the QPA, you will need to use the following code: + +.. code:: cpp + + void setup(){ + QCoreApplication::addLibraryPath("/opt/usr/lib/plugins"); + qputenv("QMLSCENE_DEVICE", "software"); + qputenv("QT_QUICK_BACKEND","software"); + QString platform( + "oxide:enable_fonts:freetype:freetype:rotate=180" + ); + if(is_on_rm2){ + platform += ":invertx" + } + qputenv("QT_QPA_PLATFORM", platform); + }