cafe-rr-screen: CAFE Desktop Library Reference Manual

## cafe-rr-screen cafe-rr-screen |

## Functions

CafeRRScreen * | cafe_rr_screen_new ()
gboolean | cafe_rr_screen_refresh ()
CafeRROutput ** | cafe_rr_screen_list_outputs ()
CafeRRCrtc ** | cafe_rr_screen_list_crtcs ()
CafeRRMode ** | cafe_rr_screen_list_modes ()
CafeRRMode ** | cafe_rr_screen_list_clone_modes ()
void | cafe_rr_screen_set_size ()
CafeRROutput * | cafe_rr_screen_get_output_by_id ()
CafeRROutput * | cafe_rr_screen_get_output_by_name ()
CafeRRCrtc * | cafe_rr_screen_get_crtc_by_id ()
void | cafe_rr_screen_get_ranges ()

## Types and Values

| CafeRRScreen

## Includes

    #include <cafe-rr.h>

## Description

## Functions

### cafe_rr_screen_new ()

    CafeRRScreen *
    cafe_rr_screen_new (CdkScreen *screen,
                        GError **error);

Creates a new CafeRRScreen instance

#### Parameters

screen | the CdkScreen on which to operate |
error | will be set if XRandR is not supported |

#### Returns

a new CafeRRScreen instance or NULL if screen could not be created, for instance if the driver does not support Xrandr 1.2

### cafe_rr_screen_refresh ()

    gboolean
    cafe_rr_screen_refresh (CafeRRScreen *screen,
                            GError **error);

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

#### Parameters

screen | a CafeRRScreen |
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.

### cafe_rr_screen_list_outputs ()

    CafeRROutput **
    cafe_rr_screen_list_outputs (CafeRRScreen *screen);

List all outputs

#### Returns

.

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

### cafe_rr_screen_list_crtcs ()

    CafeRRCrtc **
    cafe_rr_screen_list_crtcs (CafeRRScreen *screen);

List all CRTCs

#### Returns

.

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

### cafe_rr_screen_list_modes ()

    CafeRRMode **
    cafe_rr_screen_list_modes (CafeRRScreen *screen);

List available XRandR modes

#### Returns

.

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

### cafe_rr_screen_list_clone_modes ()

    CafeRRMode **
    cafe_rr_screen_list_clone_modes (CafeRRScreen *screen);

List available XRandR clone modes

#### Returns

.

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

### cafe_rr_screen_set_size ()

    void
    cafe_rr_screen_set_size (CafeRRScreen *screen,
                             int width,
                             int height,
                             int mm_width,
                             int mm_height);

### cafe_rr_screen_get_output_by_id ()

    CafeRROutput *
    cafe_rr_screen_get_output_by_id (CafeRRScreen *screen,
                                     guint32 id);

#### Returns

the output identified by `id` .

[transfer none]

### cafe_rr_screen_get_output_by_name ()

    CafeRROutput *
    cafe_rr_screen_get_output_by_name (CafeRRScreen *screen,
                                       const char *name);

#### Returns

the output identified by `name` .

[transfer none]

### cafe_rr_screen_get_crtc_by_id ()

    CafeRRCrtc *
    cafe_rr_screen_get_crtc_by_id (CafeRRScreen *screen,
                                   guint32 id);

#### Returns

the CRTC identified by `id` .

[transfer none]

### cafe_rr_screen_get_ranges ()

    void
    cafe_rr_screen_get_ranges (CafeRRScreen *screen,
                               int *min_width,
                               int *max_width,
                               int *min_height,
                               int *max_height);

Get the ranges of the screen

#### Parameters

screen | a CafeRRScreen |
min_width | the minimum width. | [out]
max_width | the maximum width. | [out]
min_height | the minimum height. | [out]
max_height | the maximum height. | [out]

## Types and Values

### CafeRRScreen

    typedef struct {
        GObject parent;

        CafeRRScreenPrivate* priv;
    } CafeRRScreen;