Skip to content

Commit

Permalink
Add QPA documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Feb 7, 2024
1 parent 40dcefb commit 1cce68e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web/src/documentation/01_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
22 changes: 22 additions & 0 deletions web/src/documentation/api/00_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 1cce68e

Please sign in to comment.