#include <screen/screen.h> int screen_get_display_property_cv( screen_display_t disp, int pname, int len, char * param ); int screen_get_display_property_iv( screen_display_t disp, int pname, int * param ); int screen_get_display_property_llv( screen_display_t disp, int pname, long long * param ); int screen_get_display_property_pv( screen_display_t disp, int pname, void ** param );
- The handle of the display whose property is being queried.
- The name of the property whose value is requested. The properties that can
be queried with these functions are:
- A single integer that indicates whether the display is currently attached.
- A single integer that indicates whether the display can be detached.
- A single integer that defines the number of formats that the display supports.
- A array of integers of size
SCREEN_PROPERTY_FORMAT_COUNT that defines the
formats that are supported by the display. If the display has
many layers, the list is the union of all the formats supported
on all layers. The list of formats can contain the following:
- A pair of integers that define the width and height of the display, in millimeters. param must point to a buffer with enough storage for two integers.
- A single integer that defines whether content protection is enabled for the display.
- A single integer that defines the current rotation of the display. The rotation value is either 0, 90, 180, 270 degrees clockwise.
- A pair of integers that define the width and height of the current video resolution. param must point to a buffer with enough storage for two integers. The display size changes with the display rotation. For example, if the video mode is 1024x768 and the rotation is 0 degrees, the display size will indicate 1024x768. When the display rotation is set to 90 degrees, the display size will become 768x1024.
- A single integer that defines the type of the display port. The
type may be one of the following:
- A single integer that defines the power mode of the current
display. The type may be one of the following:
- The gamma value of the current display.
- A string of characters indicating the ID of the current display.
- A single integer that defines whether or not the display is currently in mirror mode. Mirror mode indicates that the internal and external displays display the same signal.
- The number of windows with an idle mode of SCREEN_IDLE_MODE_KEEP_AWAKE that are visible on a display.
- The ID of the current display
- The number of modes supported by the display. param must be a buffer with enough storage for one integer.
- Fills the contents of a mode structure based on the current video mode.
- A single integer containing the name of context of the group.
- A single integer containing the idle state of the display. The idle state will be 1 if the system is idle, indicating that no input was received after the idle timeout period. When the idle state is 0, an input event was received prior to the idle timeout period expiring.
- A single integer indicating the amount of time (in seconds) after which the system will enter an idle state.
- A single window handle corresponding to the window that currently has keyboard focus. This query is only permitted from window manager contexts.
- (screen_get_display_property_cv() only). The maximum number of bytes that can be written to param.
- A pointer to a buffer where the values will be stored.
These functions store the current value of a display property in a user-specified array. No more than len bytes will be written. Each property must be queried with the variant corresponding to the type associated with this property.
The functions and their types are described below:
- Takes a char value of a given length.
- Takes an integer value.
- Takes a long long value.
- Takes a pointer to an opaque handle type.
You can set display properties by calling screen_set_display_property_*() functions.
A successful return value indicates that any delayed command and the flushing command all executed without errors. Conversely, if a flushing API returns an error, it could have been caused by a batch-processed command that didn't execute properly, or the flushing call itself encountering an error. It is important to note that the server won't stop processing batched commands when it detects an error.
- The function succeeded and the value (or values) of the property are stored in the buffer provided.
- An error occurred (errno is set).