![]() |
BSB Developer Docs
|
Functions for controlling the currently running application. More...
#include <stdbool.h>Go to the source code of this file.
Macros | |
| #define | RECORD_DESKTOP "desktop" |
| Record key to get the Desktop instance. | |
Typedefs | |
| typedef struct Desktop | Desktop |
| Opaque declaration for the Desktop type. | |
Enumerations | |
| enum | DesktopSwitchDirection { DesktopSwitchDirectionUp , DesktopSwitchDirectionDown , DesktopSwitchDirectionsCount } |
| Direction of rotary switch movement. More... | |
Functions | |
| bool | desktop_replace_current_app (Desktop *instance, const char *name, const char *args) |
| Request the Desktop service to replace the currently running app. | |
| void | desktop_pin_current_app (Desktop *instance, bool pin) |
| Pin or unpin the currently running app. | |
| DesktopSwitchDirection | desktop_get_switch_direction (Desktop *instance) |
| Get the direction of the last rotary switch movement. | |
Functions for controlling the currently running application.
Normally, only one application can be run and visible on the displays (except for services, which may or may not draw something on the display(s)). Desktop service responds to the rotary switch position, additionally, it allows overriding the current app programmatically (e.g. starting from the Apps menu).
| DesktopSwitchDirection desktop_get_switch_direction | ( | Desktop * | instance | ) |
Get the direction of the last rotary switch movement.
Returns the direction the rotary switch was last moved in, which is used The direction is calculated based on comparing the previous switch position with the new position.
| [in] | instance | pointer to the Desktop instance |
| void desktop_pin_current_app | ( | Desktop * | instance, |
| bool | pin ) |
Pin or unpin the currently running app.
Calling this function will prevent the Desktop from changing the currently running app in response to flicking the rotary switch, or, conversely, enable this behaviour, depending on the pin parameter value.
| [in,out] | instance | pointer to the Desktop instance |
| [in] | pin | pin current app if true, do not pin if false |
| bool desktop_replace_current_app | ( | Desktop * | instance, |
| const char * | name, | ||
| const char * | args ) |
Request the Desktop service to replace the currently running app.
Calling this function will merely schedule the request, not actually start the application. It may be overridden at any point in time by the rotary switch or further calls to this function.
| [in,out] | instance | pointer to the Desktop instance |
| [in] | name | app name or ID to replace the current app with |
| [in,out] | args | pointer to a zero-terminated string containing application arguments |