screen_get_context_property_*()

Get the current value of a context property

Function type:

Flushing execution

Synopsis:

#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 );

Arguments:

ctx
The handle of the context whose property is being queried.
pname
The name of the property whose value is requested. The properties that can be queried with this function are:
SCREEN_PROPERTY_DISPLAYS
An array of display pointers. param must be a buffer with enough storage for one void pointer for each display.
SCREEN_PROPERTY_DISPLAY_COUNT
A single integer containing the number of displays associated with this context. param must be a buffer with enough storage for one integer.
SCREEN_PROPERTY_IDLE_STATE
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.
SCREEN_PROPERTY_IDLE_TIMEOUT
A single integer indicating the amount of time (in seconds) after which the system will enter an idle state.
SCREEN_PROPERTY_KEYBOARD_FOCUS
A single window handle corresponding to the window that currently has keyboard focus. This query is only permitted from window manager contexts.
len
(screen_get_context_property_cv() only). The maximum number of bytes that can be written to param.
param
A buffer where the values will be stored.

Library

screen

Description

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:

screen_get_context_property_cv()
Takes a char value of a given length.
screen_get_context_property_iv()
Takes an integer value.
screen_get_context_property_llv()
Takes a long long value.
screen_get_context_property_pv()
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.

Returns

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.

0
The function succeeded and the values of the property are stored in the buffer provided.
-1
An error occurred (errno is set).

Classification

Windowing API

Safety  Value  
Interrupt handler No
Signal handler No
Thread Yes