screen_get_display_property_*()

Get the current value of a display property

Function type:

Flushing execution

Synopsis:

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

Arguments:

disp
The handle of the display whose property is being queried.
pname
The name of the property whose value is requested. The properties that can be queried with these functions are:
SCREEN_PROPERTY_ATTACHED
A single integer that indicates whether the display is currently attached.
SCREEN_PROPERTY_DETACHABLE
A single integer that indicates whether the display can be detached.
SCREEN_PROPERTY_FORMAT_COUNT
A single integer that defines the number of formats that the display supports.
SCREEN_PROPERTY_FORMATS
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:
  • SCREEN_FORMAT_BYTE
  • SCREEN_FORMAT_RGBA4444
  • SCREEN_FORMAT_RGBX4444
  • SCREEN_FORMAT_RGBA5551
  • SCREEN_FORMAT_RGBX5551
  • SCREEN_FORMAT_RGB565
  • SCREEN_FORMAT_RGB888
  • SCREEN_FORMAT_RGBA8888
  • SCREEN_FORMAT_RGBX8888
  • SCREEN_FORMAT_YVU9
  • SCREEN_FORMAT_YUV420
  • SCREEN_FORMAT_NV12
  • SCREEN_FORMAT_YV12
  • SCREEN_FORMAT_UYVY
  • SCREEN_FORMAT_YUY2
  • SCREEN_FORMAT_YVYU
  • SCREEN_FORMAT_V422
  • SCREEN_FORMAT_AYUV
SCREEN_PROPERTY_PHYSICAL_SIZE
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.
SCREEN_PROPERTY_PROTECTION_ENABLE
A single integer that defines whether content protection is enabled for the display.
SCREEN_PROPERTY_ROTATION
A single integer that defines the current rotation of the display. The rotation value is either 0, 90, 180, 270 degrees clockwise.
SCREEN_PROPERTY_SIZE
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.
SCREEN_PROPERTY_TYPE
A single integer that defines the type of the display port. The type may be one of the following:
  • SCREEN_PORT_TYPE_INTERNAL
  • SCREEN_PORT_TYPE_COMPOSITE
  • SCREEN_PORT_TYPE_SVIDEO
  • SCREEN_PORT_TYPE_COMPONENT_YPbPr
  • SCREEN_PORT_TYPE_RGB
  • SCREEN_PORT_TYPE_RGBHV
  • SCREEN_PORT_TYPE_DVI
  • SCREEN_PORT_TYPE_HDMI
  • SCREEN_PORT_TYPE_DISPLAYPORT
  • SCREEN_PORT_TYPE_OTHER
SCREEN_PROPERTY_POWER_MODE
A single integer that defines the power mode of the current display. The type may be one of the following:
  • SCREEN_POWER_MODE_OFF
  • SCREEN_POWER_MODE_SUSPEND
  • SCREEN_POWER_MODE_LIMITED_USE
  • SCREEN_POWER_MODE_ON
SCREEN_PROPERTY_GAMMA
The gamma value of the current display.
SCREEN_PROPERTY_ID_STRING
A string of characters indicating the ID of the current display.
SCREEN_PROPERTY_MIRROR_MODE
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.
SCREEN_PROPERTY_KEEP_AWAKES
The number of windows with an idle mode of SCREEN_IDLE_MODE_KEEP_AWAKE that are visible on a display.
SCREEN_PROPERTY_ID
The ID of the current display
SCREEN_PROPERTY_MODE_COUNT
The number of modes supported by the display. param must be a buffer with enough storage for one integer.
SCREEN_PROPERTY_MODE
Fills the contents of a mode structure based on the current video mode.
SCREEN_PROPERTY_CONTEXT
A single integer containing the name of context of the group.
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_display_property_cv() only). The maximum number of bytes that can be written to param.
param
A pointer to a buffer where the values will be stored.

Library

screen

Description

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:

screen_get_display_property_cv()
Takes a char value of a given length.
screen_get_display_property_iv()
Takes an integer value.
screen_get_display_property_llv()
Takes a long long value.
screen_get_display_property_pv()
Takes a pointer to an opaque handle type.

You can set display properties by calling screen_set_display_property_*() functions.

Returns

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.

0
The function succeeded and the value (or 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