mate-desktop 1.29.2
Library with common API for various MATE modules
Loading...
Searching...
No Matches
mate-rr.c File Reference
View source
#include <config.h>
#include <glib/gi18n-lib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <X11/Xatom.h>
#include "mate-rr.h"
#include "mate-rr-config.h"
#include "private.h"
#include "mate-rr-private.h"
Include dependency graph for mate-rr.c:

Data Structures

struct  MateRROutput
 
struct  MateRROutputWrap
 
struct  MateRRCrtc
 
struct  MateRRMode
 
struct  RotationMap
 

Macros

#define MATE_DESKTOP_USE_UNSTABLE_API
 
#define DISPLAY(o)   ((o)->info->screen->priv->xdisplay)
 
#define RR_Rotate_0   1
 
#define RR_Rotate_90   2
 
#define RR_Rotate_180   4
 
#define RR_Rotate_270   8
 
#define RR_Reflect_X   16
 
#define RR_Reflect_Y   32
 

Typedefs

typedef int RROutput
 
typedef int RRCrtc
 
typedef int RRMode
 
typedef int Rotation
 

Enumerations

enum  { SCREEN_PROP_0 , SCREEN_PROP_GDK_SCREEN , SCREEN_PROP_LAST }
 
enum  { SCREEN_CHANGED , SCREEN_SIGNAL_LAST }
 

Functions

static MateRROutput * output_new (ScreenInfo *info, RROutput id)
 
static MateRROutput * output_copy (const MateRROutput *from)
 
static void output_free (MateRROutput *output)
 
static void mate_rr_screen_finalize (GObject *)
 
static void mate_rr_screen_set_property (GObject *, guint, const GValue *, GParamSpec *)
 
static void mate_rr_screen_get_property (GObject *, guint, GValue *, GParamSpec *)
 
static gboolean mate_rr_screen_initable_init (GInitable *, GCancellable *, GError **)
 
static void mate_rr_screen_initable_iface_init (GInitableIface *iface)
 
 G_DEFINE_TYPE_WITH_CODE (MateRRScreen, mate_rr_screen, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE, mate_rr_screen_initable_iface_init))
 mate_rr_error_quark:
 
static MateRROutput * mate_rr_output_by_id (ScreenInfo *info, RROutput id)
 
static MateRRCrtc * crtc_by_id (ScreenInfo *info, RRCrtc id)
 
static MateRRMode * mode_by_id (ScreenInfo *info, RRMode id)
 
static void screen_info_free (ScreenInfo *info)
 
static gboolean has_similar_mode (MateRROutput *output, MateRRMode *mode)
 
static void gather_clone_modes (ScreenInfo *info)
 
static gboolean fill_out_screen_info (Display *xdisplay, Window xroot, ScreenInfo *info, gboolean needs_reprobe, GError **error)
 
static ScreenInfo * screen_info_new (MateRRScreen *screen, gboolean needs_reprobe, GError **error)
 
static gboolean screen_update (MateRRScreen *screen, gboolean force_callback, gboolean needs_reprobe, GError **error)
 
static GdkFilterReturn screen_on_event (GdkXEvent *xevent, GdkEvent *event, gpointer data)
 
void mate_rr_screen_class_init (MateRRScreenClass *klass)
 
void mate_rr_screen_init (MateRRScreen *self)
 
MateRRScreen * mate_rr_screen_new (GdkScreen *screen, GError **error)
 mate_rr_screen_new: @screen: the #GdkScreen on which to operate @error: will be set if XRandR is not supported
 
void mate_rr_screen_set_size (MateRRScreen *screen, int width, int height, int mm_width, int mm_height)
 
void mate_rr_screen_get_ranges (MateRRScreen *screen, int *min_width, int *max_width, int *min_height, int *max_height)
 mate_rr_screen_get_ranges: @screen: a MateRRScreen @min_width: (out): the minimum width @max_width: (out): the maximum width @min_height: (out): the minimum height @max_height: (out): the maximum height
 
void mate_rr_screen_get_timestamps (MateRRScreen *screen, guint32 *change_timestamp_ret, guint32 *config_timestamp_ret)
 mate_rr_screen_get_timestamps: @screen: a MateRRScreen @change_timestamp_ret: (out): Location in which to store the timestamp at which the RANDR configuration was last changed @config_timestamp_ret: (out): Location in which to store the timestamp at which the RANDR configuration was last obtained
 
static gboolean force_timestamp_update (MateRRScreen *screen)
 
gboolean mate_rr_screen_refresh (MateRRScreen *screen, GError **error)
 mate_rr_screen_refresh: @screen: a MateRRScreen @error: location to store error, or NULL
 
MateRRMode ** mate_rr_screen_list_modes (MateRRScreen *screen)
 mate_rr_screen_list_modes:
 
MateRRMode ** mate_rr_screen_list_clone_modes (MateRRScreen *screen)
 mate_rr_screen_list_clone_modes:
 
MateRRCrtc ** mate_rr_screen_list_crtcs (MateRRScreen *screen)
 mate_rr_screen_list_crtcs:
 
MateRROutput ** mate_rr_screen_list_outputs (MateRRScreen *screen)
 mate_rr_screen_list_outputs:
 
MateRRCrtc * mate_rr_screen_get_crtc_by_id (MateRRScreen *screen, guint32 id)
 mate_rr_screen_get_crtc_by_id:
 
MateRROutput * mate_rr_screen_get_output_by_id (MateRRScreen *screen, guint32 id)
 mate_rr_screen_get_output_by_id:
 
static guint8 * get_property (Display *dpy, RROutput output, Atom atom, int *len)
 
static guint8 * read_edid_data (MateRROutput *output, int *len)
 
static char * get_connector_type_string (MateRROutput *output)
 
static gboolean get_hotplug_mode_update (MateRROutput *output)
 
guint32 mate_rr_output_get_id (MateRROutput *output)
 
const guint8 * mate_rr_output_get_edid_data (MateRROutput *output)
 

Variables

gint screen_signals [SCREEN_SIGNAL_LAST]
 

mate_rr_screen_get_output_by_name:

Returns: (transfer none): the output identified by

static const RotationMap rotation_map []
 
static MateRRCrtc * crtc_new (ScreenInfo *info, RRCrtc id)
 
static MateRRCrtc * crtc_copy (const MateRRCrtc *from)
 
static void crtc_free (MateRRCrtc *crtc)
 
static MateRRMode * mode_new (ScreenInfo *info, RRMode id)
 
static MateRRMode * mode_copy (const MateRRMode *from)
 
static void mode_free (MateRRMode *mode)
 
MateRROutput * mate_rr_screen_get_output_by_name (MateRRScreen *screen, const char *name)
 
MateRRCrtc * mate_rr_output_get_crtc (MateRROutput *output)
 mate_rr_output_get_crtc: @output: a MateRROutput Returns: (transfer none):
 
MateRRCrtc ** mate_rr_output_get_possible_crtcs (MateRROutput *output)
 mate_rr_output_get_possible_crtcs: @output: a MateRROutput Returns: (array zero-terminated=1) (transfer none):
 
const char * mate_rr_output_get_connector_type (MateRROutput *output)
 
gboolean mate_rr_output_get_hotplug_mode_update (MateRROutput *output)
 mate_rr_output_get_hotplug_mode_update: @output: a MateRROutput
 
gboolean _mate_rr_output_name_is_laptop (const char *name)
 
gboolean mate_rr_output_is_laptop (MateRROutput *output)
 
MateRRMode * mate_rr_output_get_current_mode (MateRROutput *output)
 mate_rr_output_get_current_mode: @output: a MateRROutput Returns: (transfer none): the current mode of this output
 
void mate_rr_output_get_position (MateRROutput *output, int *x, int *y)
 mate_rr_output_get_position: @output: a MateRROutput @x: (out) (allow-none): @y: (out) (allow-none):
 
const char * mate_rr_output_get_name (MateRROutput *output)
 
int mate_rr_output_get_width_mm (MateRROutput *output)
 
int mate_rr_output_get_height_mm (MateRROutput *output)
 
MateRRMode * mate_rr_output_get_preferred_mode (MateRROutput *output)
 mate_rr_output_get_preferred_mode: @output: a MateRROutput Returns: (transfer none):
 
MateRRMode ** mate_rr_output_list_modes (MateRROutput *output)
 mate_rr_output_list_modes: @output: a MateRROutput Returns: (array zero-terminated=1) (transfer none):
 
gboolean mate_rr_output_is_connected (MateRROutput *output)
 
gboolean mate_rr_output_supports_mode (MateRROutput *output, MateRRMode *mode)
 
gboolean mate_rr_output_can_clone (MateRROutput *output, MateRROutput *clone)
 
gboolean mate_rr_output_get_is_primary (MateRROutput *output)
 
void mate_rr_screen_set_primary_output (MateRRScreen *screen, MateRROutput *output)
 
static MateRRRotation mate_rr_rotation_from_xrotation (Rotation r)
 
static Rotation xrotation_from_rotation (MateRRRotation r)
 
gboolean mate_rr_crtc_set_config (MateRRCrtc *crtc, int x, int y, MateRRMode *mode, MateRRRotation rotation, MateRROutput **outputs, int n_outputs, GError **error)
 
gboolean mate_rr_crtc_set_config_with_time (MateRRCrtc *crtc, guint32 timestamp, int x, int y, MateRRMode *mode, MateRRRotation rotation, MateRROutput **outputs, int n_outputs, GError **error)
 
MateRRMode * mate_rr_crtc_get_current_mode (MateRRCrtc *crtc)
 mate_rr_crtc_get_current_mode: @crtc: a MateRRCrtc Returns: (transfer none): the current mode of this crtc
 
guint32 mate_rr_crtc_get_id (MateRRCrtc *crtc)
 
gboolean mate_rr_crtc_can_drive_output (MateRRCrtc *crtc, MateRROutput *output)
 
void mate_rr_crtc_get_position (MateRRCrtc *crtc, int *x, int *y)
 mate_rr_crtc_get_position: @crtc: a MateRRCrtc @x: (out) (allow-none): @y: (out) (allow-none):
 
MateRRRotation mate_rr_crtc_get_current_rotation (MateRRCrtc *crtc)
 
MateRRRotation mate_rr_crtc_get_rotations (MateRRCrtc *crtc)
 
gboolean mate_rr_crtc_supports_rotation (MateRRCrtc *crtc, MateRRRotation rotation)
 
guint32 mate_rr_mode_get_id (MateRRMode *mode)
 
guint mate_rr_mode_get_width (MateRRMode *mode)
 
int mate_rr_mode_get_freq (MateRRMode *mode)
 
guint mate_rr_mode_get_height (MateRRMode *mode)
 
void mate_rr_crtc_set_gamma (MateRRCrtc *crtc, int size, unsigned short *red, unsigned short *green, unsigned short *blue)
 
gboolean mate_rr_crtc_get_gamma (MateRRCrtc *crtc, int *size, unsigned short **red, unsigned short **green, unsigned short **blue)
 mate_rr_crtc_get_gamma: @crtc: a MateRRCrtc @size: @red: (out): the minimum width @green: (out): the maximum width @blue: (out): the minimum height
 

Macro Definition Documentation

◆ DISPLAY

#define DISPLAY (   o)    ((o)->info->screen->priv->xdisplay)

◆ MATE_DESKTOP_USE_UNSTABLE_API

#define MATE_DESKTOP_USE_UNSTABLE_API

◆ RR_Reflect_X

#define RR_Reflect_X   16

◆ RR_Reflect_Y

#define RR_Reflect_Y   32

◆ RR_Rotate_0

#define RR_Rotate_0   1

◆ RR_Rotate_180

#define RR_Rotate_180   4

◆ RR_Rotate_270

#define RR_Rotate_270   8

◆ RR_Rotate_90

#define RR_Rotate_90   2

Typedef Documentation

◆ Rotation

typedef int Rotation

◆ RRCrtc

typedef int RRCrtc

◆ RRMode

typedef int RRMode

◆ RROutput

typedef int RROutput

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SCREEN_PROP_0 
SCREEN_PROP_GDK_SCREEN 
SCREEN_PROP_LAST 

◆ anonymous enum

anonymous enum
Enumerator
SCREEN_CHANGED 
SCREEN_SIGNAL_LAST 

Function Documentation

◆ _mate_rr_output_name_is_laptop()

gboolean _mate_rr_output_name_is_laptop ( const char *  name)

◆ crtc_by_id()

static MateRRCrtc * crtc_by_id ( ScreenInfo *  info,
RRCrtc  id 
)
static

References ScreenInfo::crtcs.

◆ crtc_copy()

◆ crtc_free()

static void crtc_free ( MateRRCrtc *  crtc)
static

◆ crtc_new()

static MateRRCrtc * crtc_new ( ScreenInfo *  info,
RRCrtc  id 
)
static

References MateRRCrtc::id, and MateRRCrtc::info.

◆ fill_out_screen_info()

static gboolean fill_out_screen_info ( Display *  xdisplay,
Window  xroot,
ScreenInfo *  info,
gboolean  needs_reprobe,
GError **  error 
)
static

References MATE_RR_ERROR, MATE_RR_ERROR_RANDR_ERROR, MATE_RR_ERROR_UNKNOWN, mate_rr_screen_get_ranges(), ScreenInfo::max_height, ScreenInfo::max_width, ScreenInfo::min_height, ScreenInfo::min_width, and ScreenInfo::screen.

Referenced by screen_info_new().

Here is the call graph for this function:

◆ force_timestamp_update()

static gboolean force_timestamp_update ( MateRRScreen *  screen)
static

◆ G_DEFINE_TYPE_WITH_CODE()

G_DEFINE_TYPE_WITH_CODE ( MateRRScreen  ,
mate_rr_screen  ,
G_TYPE_OBJECT  ,
G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE, mate_rr_screen_initable_iface_init)   
)

mate_rr_error_quark:

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

Return value: a #GQuark used to identify errors coming from the MateRR API.

◆ gather_clone_modes()

static void gather_clone_modes ( ScreenInfo *  info)
static

References ScreenInfo::clone_modes, MateRROutput::connected, has_similar_mode(), MateRROutput::modes, and ScreenInfo::outputs.

Here is the call graph for this function:

◆ get_connector_type_string()

static char * get_connector_type_string ( MateRROutput *  output)
static

◆ get_hotplug_mode_update()

static gboolean get_hotplug_mode_update ( MateRROutput *  output)
static

◆ get_property()

static guint8 * get_property ( Display *  dpy,
RROutput  output,
Atom  atom,
int *  len 
)
static

Referenced by read_edid_data().

◆ has_similar_mode()

static gboolean has_similar_mode ( MateRROutput *  output,
MateRRMode *  mode 
)
static

References mate_rr_mode_get_height(), mate_rr_mode_get_width(), and mate_rr_output_list_modes().

Referenced by gather_clone_modes().

Here is the call graph for this function:

◆ mate_rr_crtc_can_drive_output()

gboolean mate_rr_crtc_can_drive_output ( MateRRCrtc *  crtc,
MateRROutput *  output 
)

◆ mate_rr_crtc_get_current_mode()

MateRRMode * mate_rr_crtc_get_current_mode ( MateRRCrtc *  crtc)

mate_rr_crtc_get_current_mode: @crtc: a MateRRCrtc Returns: (transfer none): the current mode of this crtc

References MateRRCrtc::current_mode.

Referenced by crtc_assignment_apply(), mate_rr_config_load_current(), and mate_rr_output_get_current_mode().

◆ mate_rr_crtc_get_current_rotation()

MateRRRotation mate_rr_crtc_get_current_rotation ( MateRRCrtc *  crtc)

◆ mate_rr_crtc_get_gamma()

gboolean mate_rr_crtc_get_gamma ( MateRRCrtc *  crtc,
int *  size,
unsigned short **  red,
unsigned short **  green,
unsigned short **  blue 
)

mate_rr_crtc_get_gamma: @crtc: a MateRRCrtc @size: @red: (out): the minimum width @green: (out): the maximum width @blue: (out): the minimum height

Returns: TRUE for success

References DISPLAY, MateRRCrtc::gamma_size, and MateRRCrtc::id.

◆ mate_rr_crtc_get_id()

guint32 mate_rr_crtc_get_id ( MateRRCrtc *  crtc)

◆ mate_rr_crtc_get_position()

void mate_rr_crtc_get_position ( MateRRCrtc *  crtc,
int *  x,
int *  y 
)

mate_rr_crtc_get_position: @crtc: a MateRRCrtc @x: (out) (allow-none): @y: (out) (allow-none):

References MateRRCrtc::x, and MateRRCrtc::y.

Referenced by crtc_assignment_apply(), mate_rr_config_load_current(), and mate_rr_output_get_position().

◆ mate_rr_crtc_get_rotations()

MateRRRotation mate_rr_crtc_get_rotations ( MateRRCrtc *  crtc)

References MateRRCrtc::rotations.

◆ mate_rr_crtc_set_config()

gboolean mate_rr_crtc_set_config ( MateRRCrtc *  crtc,
int  x,
int  y,
MateRRMode *  mode,
MateRRRotation  rotation,
MateRROutput **  outputs,
int  n_outputs,
GError **  error 
)

References mate_rr_crtc_set_config_with_time().

Here is the call graph for this function:

◆ mate_rr_crtc_set_config_with_time()

gboolean mate_rr_crtc_set_config_with_time ( MateRRCrtc *  crtc,
guint32  timestamp,
int  x,
int  y,
MateRRMode *  mode,
MateRRRotation  rotation,
MateRROutput **  outputs,
int  n_outputs,
GError **  error 
)

References DISPLAY, MateRRMode::height, MateRRCrtc::id, MateRRMode::id, MateRRCrtc::info, MATE_RR_ERROR, MATE_RR_ERROR_BOUNDS_ERROR, MATE_RR_ERROR_RANDR_ERROR, ScreenInfo::max_height, ScreenInfo::max_width, MateRRMode::width, and xrotation_from_rotation().

Referenced by configure_crtc(), crtc_assignment_apply(), and mate_rr_crtc_set_config().

Here is the call graph for this function:

◆ mate_rr_crtc_set_gamma()

void mate_rr_crtc_set_gamma ( MateRRCrtc *  crtc,
int  size,
unsigned short *  red,
unsigned short *  green,
unsigned short *  blue 
)

◆ mate_rr_crtc_supports_rotation()

gboolean mate_rr_crtc_supports_rotation ( MateRRCrtc *  crtc,
MateRRRotation  rotation 
)

References MateRRCrtc::rotations.

Referenced by crtc_assignment_assign().

◆ mate_rr_mode_get_freq()

int mate_rr_mode_get_freq ( MateRRMode *  mode)

◆ mate_rr_mode_get_height()

◆ mate_rr_mode_get_id()

guint32 mate_rr_mode_get_id ( MateRRMode *  mode)

References MateRRMode::id.

Referenced by crtc_assignment_assign().

◆ mate_rr_mode_get_width()

◆ mate_rr_output_by_id()

static MateRROutput * mate_rr_output_by_id ( ScreenInfo *  info,
RROutput  id 
)
static

References ScreenInfo::outputs.

◆ mate_rr_output_can_clone()

gboolean mate_rr_output_can_clone ( MateRROutput *  output,
MateRROutput *  clone 
)

References MateRROutput::clones.

Referenced by can_clone().

◆ mate_rr_output_get_connector_type()

const char * mate_rr_output_get_connector_type ( MateRROutput *  output)

◆ mate_rr_output_get_crtc()

MateRRCrtc * mate_rr_output_get_crtc ( MateRROutput *  output)

mate_rr_output_get_crtc: @output: a MateRROutput Returns: (transfer none):

References MateRROutput::current_crtc.

Referenced by mate_rr_config_load_current(), mate_rr_output_get_current_mode(), and mate_rr_output_get_position().

◆ mate_rr_output_get_current_mode()

MateRRMode * mate_rr_output_get_current_mode ( MateRROutput *  output)

mate_rr_output_get_current_mode: @output: a MateRROutput Returns: (transfer none): the current mode of this output

References mate_rr_crtc_get_current_mode(), and mate_rr_output_get_crtc().

Here is the call graph for this function:

◆ mate_rr_output_get_edid_data()

const guint8 * mate_rr_output_get_edid_data ( MateRROutput *  output)

◆ mate_rr_output_get_height_mm()

int mate_rr_output_get_height_mm ( MateRROutput *  output)

◆ mate_rr_output_get_hotplug_mode_update()

gboolean mate_rr_output_get_hotplug_mode_update ( MateRROutput *  output)

mate_rr_output_get_hotplug_mode_update: @output: a MateRROutput

Returns whether the output has the hotplug_mode_update property, which indicates that the display should apply a new preferred mode on hotplug events to handle dynamic guest resizing in virtual machines.

Returns: TRUE if the output has hotplug_mode_update

References MateRROutput::hotplug_mode_update.

◆ mate_rr_output_get_id()

guint32 mate_rr_output_get_id ( MateRROutput *  output)

References MateRROutput::id.

◆ mate_rr_output_get_is_primary()

gboolean mate_rr_output_get_is_primary ( MateRROutput *  output)

◆ mate_rr_output_get_name()

const char * mate_rr_output_get_name ( MateRROutput *  output)

◆ mate_rr_output_get_position()

void mate_rr_output_get_position ( MateRROutput *  output,
int *  x,
int *  y 
)

mate_rr_output_get_position: @output: a MateRROutput @x: (out) (allow-none): @y: (out) (allow-none):

References mate_rr_crtc_get_position(), and mate_rr_output_get_crtc().

Here is the call graph for this function:

◆ mate_rr_output_get_possible_crtcs()

MateRRCrtc ** mate_rr_output_get_possible_crtcs ( MateRROutput *  output)

mate_rr_output_get_possible_crtcs: @output: a MateRROutput Returns: (array zero-terminated=1) (transfer none):

References MateRROutput::possible_crtcs.

◆ mate_rr_output_get_preferred_mode()

MateRRMode * mate_rr_output_get_preferred_mode ( MateRROutput *  output)

mate_rr_output_get_preferred_mode: @output: a MateRROutput Returns: (transfer none):

References MateRROutput::modes, and MateRROutput::n_preferred.

Referenced by mate_rr_config_load_current().

◆ mate_rr_output_get_width_mm()

int mate_rr_output_get_width_mm ( MateRROutput *  output)

◆ mate_rr_output_is_connected()

gboolean mate_rr_output_is_connected ( MateRROutput *  output)

◆ mate_rr_output_is_laptop()

gboolean mate_rr_output_is_laptop ( MateRROutput *  output)

References _mate_rr_output_name_is_laptop(), MateRROutput::connected, MateRROutput::connector_type, MATE_RR_CONNECTOR_TYPE_PANEL, and MateRROutput::name.

Referenced by mate_rr_config_load_current().

Here is the call graph for this function:

◆ mate_rr_output_list_modes()

MateRRMode ** mate_rr_output_list_modes ( MateRROutput *  output)

mate_rr_output_list_modes: @output: a MateRROutput Returns: (array zero-terminated=1) (transfer none):

References MateRROutput::modes.

Referenced by has_similar_mode(), mate_rr_config_load_current(), and real_assign_crtcs().

◆ mate_rr_output_supports_mode()

gboolean mate_rr_output_supports_mode ( MateRROutput *  output,
MateRRMode *  mode 
)

References MateRROutput::modes.

Referenced by crtc_assignment_assign().

◆ mate_rr_rotation_from_xrotation()

static MateRRRotation mate_rr_rotation_from_xrotation ( Rotation  r)
static

References RotationMap::rot, and rotation_map.

◆ mate_rr_screen_class_init()

void mate_rr_screen_class_init ( MateRRScreenClass *  klass)

References mate_rr_screen_finalize(), mate_rr_screen_get_property(), mate_rr_screen_set_property(), SCREEN_CHANGED, SCREEN_PROP_GDK_SCREEN, and screen_signals.

Here is the call graph for this function:

◆ mate_rr_screen_finalize()

void mate_rr_screen_finalize ( GObject *  gobject)
static

References MateRRScreenPrivate::gdk_root, MateRRScreenPrivate::info, MATE_RR_SCREEN, MateRRScreen::priv, screen_info_free(), and screen_on_event().

Referenced by mate_rr_screen_class_init().

Here is the call graph for this function:

◆ mate_rr_screen_get_crtc_by_id()

MateRRCrtc * mate_rr_screen_get_crtc_by_id ( MateRRScreen *  screen,
guint32  id 
)

mate_rr_screen_get_crtc_by_id:

Returns: (transfer none): the CRTC identified by @id

References ScreenInfo::crtcs, MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, and MateRRScreen::priv.

◆ mate_rr_screen_get_output_by_id()

MateRROutput * mate_rr_screen_get_output_by_id ( MateRRScreen *  screen,
guint32  id 
)

mate_rr_screen_get_output_by_id:

Returns: (transfer none): the output identified by @id

References MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, ScreenInfo::outputs, and MateRRScreen::priv.

◆ mate_rr_screen_get_output_by_name()

MateRROutput * mate_rr_screen_get_output_by_name ( MateRRScreen *  screen,
const char *  name 
)

◆ mate_rr_screen_get_property()

void mate_rr_screen_get_property ( GObject *  gobject,
guint  property_id,
GValue *  value,
GParamSpec *  property 
)
static

◆ mate_rr_screen_get_ranges()

void mate_rr_screen_get_ranges ( MateRRScreen *  screen,
int *  min_width,
int *  max_width,
int *  min_height,
int *  max_height 
)

mate_rr_screen_get_ranges: @screen: a MateRRScreen @min_width: (out): the minimum width @max_width: (out): the maximum width @min_height: (out): the minimum height @max_height: (out): the maximum height

Get the ranges of the screen

References MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, ScreenInfo::max_height, ScreenInfo::max_width, ScreenInfo::min_height, ScreenInfo::min_width, and MateRRScreen::priv.

Referenced by crtc_assignment_apply(), crtc_assignment_new(), and fill_out_screen_info().

◆ mate_rr_screen_get_timestamps()

void mate_rr_screen_get_timestamps ( MateRRScreen *  screen,
guint32 *  change_timestamp_ret,
guint32 *  config_timestamp_ret 
)

mate_rr_screen_get_timestamps: @screen: a MateRRScreen @change_timestamp_ret: (out): Location in which to store the timestamp at which the RANDR configuration was last changed @config_timestamp_ret: (out): Location in which to store the timestamp at which the RANDR configuration was last obtained

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.

References MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, and MateRRScreen::priv.

◆ mate_rr_screen_init()

◆ mate_rr_screen_initable_iface_init()

void mate_rr_screen_initable_iface_init ( GInitableIface *  iface)
static

References mate_rr_screen_initable_init().

Here is the call graph for this function:

◆ mate_rr_screen_initable_init()

static gboolean mate_rr_screen_initable_init ( GInitable *  initable,
GCancellable *  canc,
GError **  error 
)
static

◆ mate_rr_screen_list_clone_modes()

MateRRMode ** mate_rr_screen_list_clone_modes ( MateRRScreen *  screen)

mate_rr_screen_list_clone_modes:

List available XRandR clone modes

Returns: (array zero-terminated=1) (transfer none):

References ScreenInfo::clone_modes, MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, and MateRRScreen::priv.

◆ mate_rr_screen_list_crtcs()

MateRRCrtc ** mate_rr_screen_list_crtcs ( MateRRScreen *  screen)

mate_rr_screen_list_crtcs:

List all CRTCs

Returns: (array zero-terminated=1) (transfer none):

References ScreenInfo::crtcs, MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, and MateRRScreen::priv.

Referenced by crtc_assignment_apply(), and real_assign_crtcs().

◆ mate_rr_screen_list_modes()

MateRRMode ** mate_rr_screen_list_modes ( MateRRScreen *  screen)

mate_rr_screen_list_modes:

List available XRandR modes

Returns: (array zero-terminated=1) (transfer none):

References MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, ScreenInfo::modes, and MateRRScreen::priv.

◆ mate_rr_screen_list_outputs()

MateRROutput ** mate_rr_screen_list_outputs ( MateRRScreen *  screen)

mate_rr_screen_list_outputs:

List all outputs

Returns: (array zero-terminated=1) (transfer none):

References MateRRScreenPrivate::info, MATE_IS_RR_SCREEN, ScreenInfo::outputs, and MateRRScreen::priv.

Referenced by mate_rr_config_load_current().

◆ mate_rr_screen_new()

MateRRScreen * mate_rr_screen_new ( GdkScreen *  screen,
GError **  error 
)

mate_rr_screen_new: @screen: the #GdkScreen on which to operate @error: will be set if XRandR is not supported

Creates a new MateRRScreen instance

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

References _mate_desktop_init_i18n(), and MATE_TYPE_RR_SCREEN.

Here is the call graph for this function:

◆ mate_rr_screen_refresh()

gboolean mate_rr_screen_refresh ( MateRRScreen *  screen,
GError **  error 
)

mate_rr_screen_refresh: @screen: a MateRRScreen @error: location to store error, or NULL

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

Return value: 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.

References force_timestamp_update(), MateRRScreenPrivate::gdk_screen, MateRRScreen::priv, and screen_update().

Referenced by mate_rr_config_apply_from_filename_with_time().

Here is the call graph for this function:

◆ mate_rr_screen_set_primary_output()

void mate_rr_screen_set_primary_output ( MateRRScreen *  screen,
MateRROutput *  output 
)

◆ mate_rr_screen_set_property()

void mate_rr_screen_set_property ( GObject *  gobject,
guint  property_id,
const GValue *  value,
GParamSpec *  property 
)
static

◆ mate_rr_screen_set_size()

void mate_rr_screen_set_size ( MateRRScreen *  screen,
int  width,
int  height,
int  mm_width,
int  mm_height 
)

◆ mode_by_id()

static MateRRMode * mode_by_id ( ScreenInfo *  info,
RRMode  id 
)
static

References ScreenInfo::modes.

◆ mode_copy()

◆ mode_free()

static void mode_free ( MateRRMode *  mode)
static

References MateRRMode::name.

Referenced by screen_info_free().

◆ mode_new()

static MateRRMode * mode_new ( ScreenInfo *  info,
RRMode  id 
)
static

References MateRRMode::id, and MateRRMode::info.

◆ output_copy()

◆ output_free()

◆ output_new()

static MateRROutput * output_new ( ScreenInfo *  info,
RROutput  id 
)
static

◆ read_edid_data()

static guint8 * read_edid_data ( MateRROutput *  output,
int *  len 
)
static

References DISPLAY, get_property(), and MateRROutput::id.

Here is the call graph for this function:

◆ screen_info_free()

static void screen_info_free ( ScreenInfo *  info)
static

References ScreenInfo::clone_modes, crtc_free(), ScreenInfo::crtcs, mode_free(), ScreenInfo::modes, output_free(), and ScreenInfo::outputs.

Referenced by mate_rr_screen_finalize(), screen_info_new(), and screen_update().

Here is the call graph for this function:

◆ screen_info_new()

static ScreenInfo * screen_info_new ( MateRRScreen *  screen,
gboolean  needs_reprobe,
GError **  error 
)
static

References ScreenInfo::crtcs, fill_out_screen_info(), ScreenInfo::modes, ScreenInfo::outputs, MateRRScreen::priv, ScreenInfo::screen, screen_info_free(), MateRRScreenPrivate::xdisplay, and MateRRScreenPrivate::xroot.

Referenced by mate_rr_screen_initable_init(), and screen_update().

Here is the call graph for this function:

◆ screen_on_event()

static GdkFilterReturn screen_on_event ( GdkXEvent *  xevent,
GdkEvent *  event,
gpointer  data 
)
static

References MateRRScreenPrivate::info, MateRRScreen::priv, MateRRScreenPrivate::randr_event_base, and screen_update().

Referenced by mate_rr_screen_finalize(), and mate_rr_screen_initable_init().

Here is the call graph for this function:

◆ screen_update()

static gboolean screen_update ( MateRRScreen *  screen,
gboolean  force_callback,
gboolean  needs_reprobe,
GError **  error 
)
static

References MateRRScreenPrivate::info, MateRRScreen::priv, SCREEN_CHANGED, screen_info_free(), screen_info_new(), and screen_signals.

Referenced by mate_rr_screen_refresh(), and screen_on_event().

Here is the call graph for this function:

◆ xrotation_from_rotation()

static Rotation xrotation_from_rotation ( MateRRRotation  r)
static

Variable Documentation

◆ rotation_map

const RotationMap rotation_map[]
static
Initial value:
=
{
}
#define RR_Reflect_X
Definition mate-rr.c:59
#define RR_Rotate_180
Definition mate-rr.c:57
#define RR_Rotate_90
Definition mate-rr.c:56
#define RR_Rotate_270
Definition mate-rr.c:58
#define RR_Rotate_0
Definition mate-rr.c:55
#define RR_Reflect_Y
Definition mate-rr.c:60
@ MATE_RR_ROTATION_90
Definition mate-rr.h:54
@ MATE_RR_ROTATION_0
Definition mate-rr.h:53
@ MATE_RR_REFLECT_Y
Definition mate-rr.h:58
@ MATE_RR_ROTATION_180
Definition mate-rr.h:55
@ MATE_RR_REFLECT_X
Definition mate-rr.h:57
@ MATE_RR_ROTATION_270
Definition mate-rr.h:56

Referenced by mate_rr_rotation_from_xrotation(), and xrotation_from_rotation().

◆ screen_signals

gint screen_signals[SCREEN_SIGNAL_LAST]