#include <screen/screen.h> int screen_get_context_property_cv( screen_context_t ctx, int pname, int len, char * param ); int screen_get_context_property_iv( screen_context_t ctx, int pname, int * param ); int screen_get_context_property_llv( screen_context_t ctx, int pname, long long * param ); int screen_get_context_property_pv( screen_context_t ctx, int pname, void ** param );
- The handle of the context whose property is being queried.
- The name of the property whose value is requested. The properties that can
be queried with this function are:
- An array of display pointers. param must be a buffer with enough storage for one void pointer for each display.
- A single integer containing the number of displays associated with this context. param must be a buffer with enough storage for one integer.
- 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_context_property_cv() only). The maximum number of bytes that can be written to param.
- A buffer where the values will be stored.
These functions store the current value of a context 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.
For example, SCREEN_PROPERTY_WINDOW_COUNT must be queried using the screen_get_context_property_iv() function. Context properties can be set with the screen_set_context_property() functions.
These function return 0 if successful. They return -1 if an error has occurred. Because these function flush any pending commands, the error might have been caused by one of these delayed function calls.
- The function succeeded and the values of the property are stored in the buffer provided.
- An error occurred (errno is set).