gnome-rr

gnome-rr

Synopsis

                    GnomeRRScreen;
                    GnomeRRScreenClass;
typedef             GnomeRROutput;
typedef             GnomeRRCrtc;
enum                GnomeRRDpmsMode;
typedef             GnomeRRMode;
enum                GnomeRRRotation;
#define             GNOME_RR_ERROR
GQuark              gnome_rr_error_quark                (void);
enum                GnomeRRError;
#define             GNOME_RR_CONNECTOR_TYPE_PANEL
GnomeRRScreen *     gnome_rr_screen_new                 (GdkScreen *screen,
                                                         GError **error);
GnomeRROutput **    gnome_rr_screen_list_outputs        (GnomeRRScreen *screen);
GnomeRRCrtc **      gnome_rr_screen_list_crtcs          (GnomeRRScreen *screen);
GnomeRRMode **      gnome_rr_screen_list_modes          (GnomeRRScreen *screen);
GnomeRRMode **      gnome_rr_screen_list_clone_modes    (GnomeRRScreen *screen);
void                gnome_rr_screen_set_size            (GnomeRRScreen *screen,
                                                         int width,
                                                         int height,
                                                         int mm_width,
                                                         int mm_height);
GnomeRRCrtc *       gnome_rr_screen_get_crtc_by_id      (GnomeRRScreen *screen,
                                                         guint32 id);
gboolean            gnome_rr_screen_refresh             (GnomeRRScreen *screen,
                                                         GError **error);
GnomeRROutput *     gnome_rr_screen_get_output_by_id    (GnomeRRScreen *screen,
                                                         guint32 id);
GnomeRROutput *     gnome_rr_screen_get_output_by_name  (GnomeRRScreen *screen,
                                                         const char *name);
void                gnome_rr_screen_get_ranges          (GnomeRRScreen *screen,
                                                         int *min_width,
                                                         int *max_width,
                                                         int *min_height,
                                                         int *max_height);
void                gnome_rr_screen_get_timestamps      (GnomeRRScreen *screen,
                                                         guint32 *change_timestamp_ret,
                                                         guint32 *config_timestamp_ret);
void                gnome_rr_screen_set_primary_output  (GnomeRRScreen *screen,
                                                         GnomeRROutput *output);
GnomeRRMode **      gnome_rr_screen_create_clone_modes  (GnomeRRScreen *screen);
gboolean            gnome_rr_screen_get_dpms_mode       (GnomeRRScreen *screen,
                                                         GnomeRRDpmsMode *mode,
                                                         GError **error);
gboolean            gnome_rr_screen_set_dpms_mode       (GnomeRRScreen *screen,
                                                         GnomeRRDpmsMode mode,
                                                         GError **error);
guint32             gnome_rr_output_get_id              (GnomeRROutput *output);
const char *        gnome_rr_output_get_name            (GnomeRROutput *output);
gboolean            gnome_rr_output_is_connected        (GnomeRROutput *output);
int                 gnome_rr_output_get_size_inches     (GnomeRROutput *output);
int                 gnome_rr_output_get_width_mm        (GnomeRROutput *outout);
int                 gnome_rr_output_get_height_mm       (GnomeRROutput *output);
const guint8 *      gnome_rr_output_get_edid_data       (GnomeRROutput *output,
                                                         gsize *size);
GnomeRRCrtc **      gnome_rr_output_get_possible_crtcs  (GnomeRROutput *output);
GnomeRRMode *       gnome_rr_output_get_current_mode    (GnomeRROutput *output);
GnomeRRCrtc *       gnome_rr_output_get_crtc            (GnomeRROutput *output);
const char *        gnome_rr_output_get_connector_type  (GnomeRROutput *output);
gboolean            gnome_rr_output_is_laptop           (GnomeRROutput *output);
void                gnome_rr_output_get_position        (GnomeRROutput *output,
                                                         int *x,
                                                         int *y);
gboolean            gnome_rr_output_can_clone           (GnomeRROutput *output,
                                                         GnomeRROutput *clone);
GnomeRRMode **      gnome_rr_output_list_modes          (GnomeRROutput *output);
GnomeRRMode *       gnome_rr_output_get_preferred_mode  (GnomeRROutput *output);
gboolean            gnome_rr_output_supports_mode       (GnomeRROutput *output,
                                                         GnomeRRMode *mode);
gboolean            gnome_rr_output_get_is_primary      (GnomeRROutput *output);
gint                gnome_rr_output_get_backlight       (GnomeRROutput *output,
                                                         GError **error);
gboolean            gnome_rr_output_set_backlight       (GnomeRROutput *output,
                                                         gint value,
                                                         GError **error);
gint                gnome_rr_output_get_backlight_max   (GnomeRROutput *output);
gint                gnome_rr_output_get_backlight_min   (GnomeRROutput *output);
const char *        gnome_rr_output_get_display_name    (GnomeRROutput *output);
gboolean            gnome_rr_output_get_ids_from_edid   (GnomeRROutput *output,
                                                         char **vendor,
                                                         int *product,
                                                         int *serial);
guint32             gnome_rr_mode_get_id                (GnomeRRMode *mode);
guint               gnome_rr_mode_get_width             (GnomeRRMode *mode);
guint               gnome_rr_mode_get_height            (GnomeRRMode *mode);
int                 gnome_rr_mode_get_freq              (GnomeRRMode *mode);
guint32             gnome_rr_crtc_get_id                (GnomeRRCrtc *crtc);
gboolean            gnome_rr_crtc_set_config_with_time  (GnomeRRCrtc *crtc,
                                                         guint32 timestamp,
                                                         int x,
                                                         int y,
                                                         GnomeRRMode *mode,
                                                         GnomeRRRotation rotation,
                                                         GnomeRROutput **outputs,
                                                         int n_outputs,
                                                         GError **error);
gboolean            gnome_rr_crtc_can_drive_output      (GnomeRRCrtc *crtc,
                                                         GnomeRROutput *output);
GnomeRRMode *       gnome_rr_crtc_get_current_mode      (GnomeRRCrtc *crtc);
void                gnome_rr_crtc_get_position          (GnomeRRCrtc *crtc,
                                                         int *x,
                                                         int *y);
GnomeRRRotation     gnome_rr_crtc_get_current_rotation  (GnomeRRCrtc *crtc);
GnomeRRRotation     gnome_rr_crtc_get_rotations         (GnomeRRCrtc *crtc);
gboolean            gnome_rr_crtc_supports_rotation     (GnomeRRCrtc *crtc,
                                                         GnomeRRRotation rotation);
gboolean            gnome_rr_crtc_get_gamma             (GnomeRRCrtc *crtc,
                                                         int *size,
                                                         unsigned short **red,
                                                         unsigned short **green,
                                                         unsigned short **blue);
void                gnome_rr_crtc_set_gamma             (GnomeRRCrtc *crtc,
                                                         int size,
                                                         unsigned short *red,
                                                         unsigned short *green,
                                                         unsigned short *blue);

Description

Details

GnomeRRScreen

typedef struct {
	GObject parent;

	GnomeRRScreenPrivate* priv;
} GnomeRRScreen;


GnomeRRScreenClass

typedef struct {
	GObjectClass parent_class;

        void (* changed) (void);
        void (* output_connected)       (GnomeRROutput *output);
        void (* output_disconnected)    (GnomeRROutput *output);
} GnomeRRScreenClass;


GnomeRROutput

typedef struct GnomeRROutput GnomeRROutput;


GnomeRRCrtc

typedef struct GnomeRRCrtc GnomeRRCrtc;


enum GnomeRRDpmsMode

typedef enum {
	GNOME_RR_DPMS_ON,
	GNOME_RR_DPMS_STANDBY,
	GNOME_RR_DPMS_SUSPEND,
	GNOME_RR_DPMS_OFF,
	GNOME_RR_DPMS_DISABLED,
	GNOME_RR_DPMS_UNKNOWN
} GnomeRRDpmsMode;

GNOME_RR_DPMS_ON

GNOME_RR_DPMS_STANDBY

GNOME_RR_DPMS_SUSPEND

GNOME_RR_DPMS_OFF

GNOME_RR_DPMS_DISABLED

GNOME_RR_DPMS_UNKNOWN


GnomeRRMode

typedef struct GnomeRRMode GnomeRRMode;


enum GnomeRRRotation

typedef enum {
    GNOME_RR_ROTATION_NEXT = 0,
    GNOME_RR_ROTATION_0 = (1 << 0),
    GNOME_RR_ROTATION_90 = (1 << 1),
    GNOME_RR_ROTATION_180 = (1 << 2),
    GNOME_RR_ROTATION_270 = (1 << 3),
    GNOME_RR_REFLECT_X = (1 << 4),
    GNOME_RR_REFLECT_Y = (1 << 5)
} GnomeRRRotation;

GNOME_RR_ROTATION_NEXT

GNOME_RR_ROTATION_0

GNOME_RR_ROTATION_90

GNOME_RR_ROTATION_180

GNOME_RR_ROTATION_270

GNOME_RR_REFLECT_X

GNOME_RR_REFLECT_Y


GNOME_RR_ERROR

#define GNOME_RR_ERROR (gnome_rr_error_quark ())


gnome_rr_error_quark ()

GQuark              gnome_rr_error_quark                (void);

Returns the GQuark that will be used for GError values returned by the GnomeRR API.

Returns :

a GQuark used to identify errors coming from the GnomeRR API.

enum GnomeRRError

typedef enum {
    GNOME_RR_ERROR_UNKNOWN,		/* generic "fail" */
    GNOME_RR_ERROR_NO_RANDR_EXTENSION, /* RANDR extension is not present */
    GNOME_RR_ERROR_RANDR_ERROR,		/* generic/undescribed error from the underlying XRR API */
    GNOME_RR_ERROR_BOUNDS_ERROR, /* requested bounds of a CRTC are outside the maximum size */
    GNOME_RR_ERROR_CRTC_ASSIGNMENT, /* could not assign CRTCs to outputs */
    GNOME_RR_ERROR_NO_MATCHING_CONFIG, /* none of the saved configurations matched the current configuration */
    GNOME_RR_ERROR_NO_DPMS_EXTENSION, /* DPMS extension is not present */
} GnomeRRError;

GNOME_RR_ERROR_UNKNOWN

GNOME_RR_ERROR_NO_RANDR_EXTENSION

GNOME_RR_ERROR_RANDR_ERROR

GNOME_RR_ERROR_BOUNDS_ERROR

GNOME_RR_ERROR_CRTC_ASSIGNMENT

GNOME_RR_ERROR_NO_MATCHING_CONFIG

GNOME_RR_ERROR_NO_DPMS_EXTENSION


GNOME_RR_CONNECTOR_TYPE_PANEL

#define GNOME_RR_CONNECTOR_TYPE_PANEL "Panel"  /* This is a laptop's built-in LCD */


gnome_rr_screen_new ()

GnomeRRScreen *     gnome_rr_screen_new                 (GdkScreen *screen,
                                                         GError **error);

Creates a unique GnomeRRScreen instance for the specified screen.

screen :

the GdkScreen on which to operate

error :

will be set if XRandR is not supported

Returns :

a unique GnomeRRScreen instance, specific to the screen, or NULL if this could not be created, for instance if the driver does not support Xrandr 1.2. Each GdkScreen thus has a single instance of GnomeRRScreen.

gnome_rr_screen_list_outputs ()

GnomeRROutput **    gnome_rr_screen_list_outputs        (GnomeRRScreen *screen);

List all outputs

Returns :

. [array zero-terminated=1][transfer none]

gnome_rr_screen_list_crtcs ()

GnomeRRCrtc **      gnome_rr_screen_list_crtcs          (GnomeRRScreen *screen);

List all CRTCs

Returns :

. [array zero-terminated=1][transfer none]

gnome_rr_screen_list_modes ()

GnomeRRMode **      gnome_rr_screen_list_modes          (GnomeRRScreen *screen);

List available XRandR modes

Returns :

. [array zero-terminated=1][transfer none]

gnome_rr_screen_list_clone_modes ()

GnomeRRMode **      gnome_rr_screen_list_clone_modes    (GnomeRRScreen *screen);

List available XRandR clone modes

Returns :

. [array zero-terminated=1][transfer none]

gnome_rr_screen_set_size ()

void                gnome_rr_screen_set_size            (GnomeRRScreen *screen,
                                                         int width,
                                                         int height,
                                                         int mm_width,
                                                         int mm_height);


gnome_rr_screen_get_crtc_by_id ()

GnomeRRCrtc *       gnome_rr_screen_get_crtc_by_id      (GnomeRRScreen *screen,
                                                         guint32 id);

Returns :

the CRTC identified by id. [transfer none]

gnome_rr_screen_refresh ()

gboolean            gnome_rr_screen_refresh             (GnomeRRScreen *screen,
                                                         GError **error);

Refreshes the screen configuration, and calls the screen's callback if it exists and if the screen's configuration changed.

screen :

a GnomeRRScreen

error :

location to store error, or NULL

Returns :

TRUE if the screen's configuration changed; otherwise, the function returns FALSE and a NULL error if the configuration didn't change, or FALSE and a non-NULL error if there was an error while refreshing the configuration.

gnome_rr_screen_get_output_by_id ()

GnomeRROutput *     gnome_rr_screen_get_output_by_id    (GnomeRRScreen *screen,
                                                         guint32 id);

Returns :

the output identified by id. [transfer none]

gnome_rr_screen_get_output_by_name ()

GnomeRROutput *     gnome_rr_screen_get_output_by_name  (GnomeRRScreen *screen,
                                                         const char *name);

Returns :

the output identified by name. [transfer none]

gnome_rr_screen_get_ranges ()

void                gnome_rr_screen_get_ranges          (GnomeRRScreen *screen,
                                                         int *min_width,
                                                         int *max_width,
                                                         int *min_height,
                                                         int *max_height);

Get the ranges of the screen

screen :

a GnomeRRScreen

min_width :

the minimum width. [out]

max_width :

the maximum width. [out]

min_height :

the minimum height. [out]

max_height :

the maximum height. [out]

gnome_rr_screen_get_timestamps ()

void                gnome_rr_screen_get_timestamps      (GnomeRRScreen *screen,
                                                         guint32 *change_timestamp_ret,
                                                         guint32 *config_timestamp_ret);

Queries the two timestamps that the X RANDR extension maintains. The X server will prevent change requests for stale configurations, those whose timestamp is not equal to that of the latest request for configuration. The X server will also prevent change requests that have an older timestamp to the latest change request.

screen :

a GnomeRRScreen

change_timestamp_ret :

Location in which to store the timestamp at which the RANDR configuration was last changed. [out]

config_timestamp_ret :

Location in which to store the timestamp at which the RANDR configuration was last obtained. [out]

gnome_rr_screen_set_primary_output ()

void                gnome_rr_screen_set_primary_output  (GnomeRRScreen *screen,
                                                         GnomeRROutput *output);


gnome_rr_screen_create_clone_modes ()

GnomeRRMode **      gnome_rr_screen_create_clone_modes  (GnomeRRScreen *screen);


gnome_rr_screen_get_dpms_mode ()

gboolean            gnome_rr_screen_get_dpms_mode       (GnomeRRScreen *screen,
                                                         GnomeRRDpmsMode *mode,
                                                         GError **error);

mode :

The current GnomeRRDpmsMode of this screen. [out]

gnome_rr_screen_set_dpms_mode ()

gboolean            gnome_rr_screen_set_dpms_mode       (GnomeRRScreen *screen,
                                                         GnomeRRDpmsMode mode,
                                                         GError **error);

This method also disables the DPMS timeouts.


gnome_rr_output_get_id ()

guint32             gnome_rr_output_get_id              (GnomeRROutput *output);


gnome_rr_output_get_name ()

const char *        gnome_rr_output_get_name            (GnomeRROutput *output);


gnome_rr_output_is_connected ()

gboolean            gnome_rr_output_is_connected        (GnomeRROutput *output);


gnome_rr_output_get_size_inches ()

int                 gnome_rr_output_get_size_inches     (GnomeRROutput *output);


gnome_rr_output_get_width_mm ()

int                 gnome_rr_output_get_width_mm        (GnomeRROutput *outout);


gnome_rr_output_get_height_mm ()

int                 gnome_rr_output_get_height_mm       (GnomeRROutput *output);


gnome_rr_output_get_edid_data ()

const guint8 *      gnome_rr_output_get_edid_data       (GnomeRROutput *output,
                                                         gsize *size);


gnome_rr_output_get_possible_crtcs ()

GnomeRRCrtc **      gnome_rr_output_get_possible_crtcs  (GnomeRROutput *output);


gnome_rr_output_get_current_mode ()

GnomeRRMode *       gnome_rr_output_get_current_mode    (GnomeRROutput *output);


gnome_rr_output_get_crtc ()

GnomeRRCrtc *       gnome_rr_output_get_crtc            (GnomeRROutput *output);


gnome_rr_output_get_connector_type ()

const char *        gnome_rr_output_get_connector_type  (GnomeRROutput *output);


gnome_rr_output_is_laptop ()

gboolean            gnome_rr_output_is_laptop           (GnomeRROutput *output);


gnome_rr_output_get_position ()

void                gnome_rr_output_get_position        (GnomeRROutput *output,
                                                         int *x,
                                                         int *y);

output :

a GnomeRROutput

x :

. [out][allow-none]

y :

. [out][allow-none]

gnome_rr_output_can_clone ()

gboolean            gnome_rr_output_can_clone           (GnomeRROutput *output,
                                                         GnomeRROutput *clone);


gnome_rr_output_list_modes ()

GnomeRRMode **      gnome_rr_output_list_modes          (GnomeRROutput *output);


gnome_rr_output_get_preferred_mode ()

GnomeRRMode *       gnome_rr_output_get_preferred_mode  (GnomeRROutput *output);


gnome_rr_output_supports_mode ()

gboolean            gnome_rr_output_supports_mode       (GnomeRROutput *output,
                                                         GnomeRRMode *mode);


gnome_rr_output_get_is_primary ()

gboolean            gnome_rr_output_get_is_primary      (GnomeRROutput *output);


gnome_rr_output_get_backlight ()

gint                gnome_rr_output_get_backlight       (GnomeRROutput *output,
                                                         GError **error);

Returns :

The currently set backlight brightness

gnome_rr_output_set_backlight ()

gboolean            gnome_rr_output_set_backlight       (GnomeRROutput *output,
                                                         gint value,
                                                         GError **error);

value :

the absolute value which is min >= this <= max

Returns :

TRUE for success

gnome_rr_output_get_backlight_max ()

gint                gnome_rr_output_get_backlight_max   (GnomeRROutput *output);

Returns :

The maximum backlight value, or -1 if not supported

gnome_rr_output_get_backlight_min ()

gint                gnome_rr_output_get_backlight_min   (GnomeRROutput *output);

Returns :

The mimimum backlight value, or -1 if not supported

gnome_rr_output_get_display_name ()

const char *        gnome_rr_output_get_display_name    (GnomeRROutput *output);


gnome_rr_output_get_ids_from_edid ()

gboolean            gnome_rr_output_get_ids_from_edid   (GnomeRROutput *output,
                                                         char **vendor,
                                                         int *product,
                                                         int *serial);

output :

a GnomeRROutput

vendor :

. [out][allow-none]

product :

. [out][allow-none]

serial :

. [out][allow-none]

gnome_rr_mode_get_id ()

guint32             gnome_rr_mode_get_id                (GnomeRRMode *mode);


gnome_rr_mode_get_width ()

guint               gnome_rr_mode_get_width             (GnomeRRMode *mode);


gnome_rr_mode_get_height ()

guint               gnome_rr_mode_get_height            (GnomeRRMode *mode);


gnome_rr_mode_get_freq ()

int                 gnome_rr_mode_get_freq              (GnomeRRMode *mode);


gnome_rr_crtc_get_id ()

guint32             gnome_rr_crtc_get_id                (GnomeRRCrtc *crtc);


gnome_rr_crtc_set_config_with_time ()

gboolean            gnome_rr_crtc_set_config_with_time  (GnomeRRCrtc *crtc,
                                                         guint32 timestamp,
                                                         int x,
                                                         int y,
                                                         GnomeRRMode *mode,
                                                         GnomeRRRotation rotation,
                                                         GnomeRROutput **outputs,
                                                         int n_outputs,
                                                         GError **error);


gnome_rr_crtc_can_drive_output ()

gboolean            gnome_rr_crtc_can_drive_output      (GnomeRRCrtc *crtc,
                                                         GnomeRROutput *output);


gnome_rr_crtc_get_current_mode ()

GnomeRRMode *       gnome_rr_crtc_get_current_mode      (GnomeRRCrtc *crtc);


gnome_rr_crtc_get_position ()

void                gnome_rr_crtc_get_position          (GnomeRRCrtc *crtc,
                                                         int *x,
                                                         int *y);

crtc :

a GnomeRRCrtc

x :

. [out][allow-none]

y :

. [out][allow-none]

gnome_rr_crtc_get_current_rotation ()

GnomeRRRotation     gnome_rr_crtc_get_current_rotation  (GnomeRRCrtc *crtc);


gnome_rr_crtc_get_rotations ()

GnomeRRRotation     gnome_rr_crtc_get_rotations         (GnomeRRCrtc *crtc);


gnome_rr_crtc_supports_rotation ()

gboolean            gnome_rr_crtc_supports_rotation     (GnomeRRCrtc *crtc,
                                                         GnomeRRRotation rotation);


gnome_rr_crtc_get_gamma ()

gboolean            gnome_rr_crtc_get_gamma             (GnomeRRCrtc *crtc,
                                                         int *size,
                                                         unsigned short **red,
                                                         unsigned short **green,
                                                         unsigned short **blue);


gnome_rr_crtc_set_gamma ()

void                gnome_rr_crtc_set_gamma             (GnomeRRCrtc *crtc,
                                                         int size,
                                                         unsigned short *red,
                                                         unsigned short *green,
                                                         unsigned short *blue);