mate-desktop 1.29.2
Library with common API for various MATE modules
Loading...
Searching...
No Matches
mate-rr-config.h File Reference
View source
#include "mate-rr.h"
#include <glib.h>
#include <glib-object.h>
Include dependency graph for mate-rr-config.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  MateRROutputInfo
 
struct  MateRROutputInfoClass
 
struct  MateRRConfig
 
struct  MateRRConfigClass
 

Macros

#define MATE_TYPE_RR_OUTPUT_INFO   (mate_rr_output_info_get_type())
 
#define MATE_RR_OUTPUT_INFO(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfo))
 
#define MATE_IS_RR_OUTPUT_INFO(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_RR_OUTPUT_INFO))
 
#define MATE_RR_OUTPUT_INFO_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfoClass))
 
#define MATE_IS_RR_OUTPUT_INFO_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_RR_OUTPUT_INFO))
 
#define MATE_RR_OUTPUT_INFO_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfoClass))
 
#define MATE_TYPE_RR_CONFIG   (mate_rr_config_get_type())
 
#define MATE_RR_CONFIG(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_RR_CONFIG, MateRRConfig))
 
#define MATE_IS_RR_CONFIG(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_RR_CONFIG))
 
#define MATE_RR_CONFIG_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_RR_CONFIG, MateRRConfigClass))
 
#define MATE_IS_RR_CONFIG_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_RR_CONFIG))
 
#define MATE_RR_CONFIG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_RR_CONFIG, MateRRConfigClass))
 

Typedefs

typedef struct MateRROutputInfoPrivate MateRROutputInfoPrivate
 
typedef struct MateRRConfigPrivate MateRRConfigPrivate
 

Functions

GType mate_rr_output_info_get_type (void)
 
char * mate_rr_output_info_get_name (MateRROutputInfo *self)
 mate_rr_output_info_get_name:
 
gboolean mate_rr_output_info_is_active (MateRROutputInfo *self)
 mate_rr_output_info_is_active:
 
void mate_rr_output_info_set_active (MateRROutputInfo *self, gboolean active)
 
void mate_rr_output_info_get_geometry (MateRROutputInfo *self, int *x, int *y, int *width, int *height)
 mate_rr_output_info_get_geometry: @self: a MateRROutputInfo @x: (out) (allow-none): @y: (out) (allow-none): @width: (out) (allow-none): @height: (out) (allow-none):
 
void mate_rr_output_info_set_geometry (MateRROutputInfo *self, int x, int y, int width, int height)
 mate_rr_output_info_set_geometry: @self: a MateRROutputInfo @x: x offset for monitor @y: y offset for monitor @width: monitor width @height: monitor height
 
int mate_rr_output_info_get_refresh_rate (MateRROutputInfo *self)
 
void mate_rr_output_info_set_refresh_rate (MateRROutputInfo *self, int rate)
 
MateRRRotation mate_rr_output_info_get_rotation (MateRROutputInfo *self)
 
void mate_rr_output_info_set_rotation (MateRROutputInfo *self, MateRRRotation rotation)
 
gboolean mate_rr_output_info_is_connected (MateRROutputInfo *self)
 mate_rr_output_info_is_connected:
 
void mate_rr_output_info_get_vendor (MateRROutputInfo *self, gchar *vendor)
 mate_rr_output_info_get_vendor: @self: a MateRROutputInfo @vendor: (out caller-allocates) (array fixed-size=4):
 
guint mate_rr_output_info_get_product (MateRROutputInfo *self)
 
guint mate_rr_output_info_get_serial (MateRROutputInfo *self)
 
double mate_rr_output_info_get_aspect_ratio (MateRROutputInfo *self)
 
char * mate_rr_output_info_get_display_name (MateRROutputInfo *self)
 mate_rr_output_info_get_display_name:
 
gboolean mate_rr_output_info_get_primary (MateRROutputInfo *self)
 
void mate_rr_output_info_set_primary (MateRROutputInfo *self, gboolean primary)
 
int mate_rr_output_info_get_preferred_width (MateRROutputInfo *self)
 
int mate_rr_output_info_get_preferred_height (MateRROutputInfo *self)
 
GType mate_rr_config_get_type (void)
 
MateRRConfig * mate_rr_config_new_current (MateRRScreen *screen, GError **error)
 
MateRRConfig * mate_rr_config_new_stored (MateRRScreen *screen, GError **error)
 
gboolean mate_rr_config_load_current (MateRRConfig *self, GError **error)
 
gboolean mate_rr_config_load_filename (MateRRConfig *self, const gchar *filename, GError **error)
 
gboolean mate_rr_config_match (MateRRConfig *config1, MateRRConfig *config2)
 
gboolean mate_rr_config_equal (MateRRConfig *config1, MateRRConfig *config2)
 
gboolean mate_rr_config_save (MateRRConfig *configuration, GError **error)
 
void mate_rr_config_sanitize (MateRRConfig *configuration)
 
gboolean mate_rr_config_ensure_primary (MateRRConfig *configuration)
 
gboolean mate_rr_config_apply_with_time (MateRRConfig *configuration, MateRRScreen *screen, guint32 timestamp, GError **error)
 
gboolean mate_rr_config_apply_from_filename_with_time (MateRRScreen *screen, const char *filename, guint32 timestamp, GError **error)
 
gboolean mate_rr_config_applicable (MateRRConfig *configuration, MateRRScreen *screen, GError **error)
 
gboolean mate_rr_config_get_clone (MateRRConfig *configuration)
 mate_rr_config_get_clone:
 
void mate_rr_config_set_clone (MateRRConfig *configuration, gboolean clone)
 
MateRROutputInfo ** mate_rr_config_get_outputs (MateRRConfig *configuration)
 mate_rr_config_get_outputs:
 
char * mate_rr_config_get_backup_filename (void)
 
char * mate_rr_config_get_intended_filename (void)
 

Macro Definition Documentation

◆ MATE_IS_RR_CONFIG

#define MATE_IS_RR_CONFIG (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_RR_CONFIG))

◆ MATE_IS_RR_CONFIG_CLASS

#define MATE_IS_RR_CONFIG_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_RR_CONFIG))

◆ MATE_IS_RR_OUTPUT_INFO

#define MATE_IS_RR_OUTPUT_INFO (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATE_TYPE_RR_OUTPUT_INFO))

◆ MATE_IS_RR_OUTPUT_INFO_CLASS

#define MATE_IS_RR_OUTPUT_INFO_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), MATE_TYPE_RR_OUTPUT_INFO))

◆ MATE_RR_CONFIG

#define MATE_RR_CONFIG (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_RR_CONFIG, MateRRConfig))

◆ MATE_RR_CONFIG_CLASS

#define MATE_RR_CONFIG_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_RR_CONFIG, MateRRConfigClass))

◆ MATE_RR_CONFIG_GET_CLASS

#define MATE_RR_CONFIG_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_RR_CONFIG, MateRRConfigClass))

◆ MATE_RR_OUTPUT_INFO

#define MATE_RR_OUTPUT_INFO (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfo))

◆ MATE_RR_OUTPUT_INFO_CLASS

#define MATE_RR_OUTPUT_INFO_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfoClass))

◆ MATE_RR_OUTPUT_INFO_GET_CLASS

#define MATE_RR_OUTPUT_INFO_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), MATE_TYPE_RR_OUTPUT_INFO, MateRROutputInfoClass))

◆ MATE_TYPE_RR_CONFIG

#define MATE_TYPE_RR_CONFIG   (mate_rr_config_get_type())

◆ MATE_TYPE_RR_OUTPUT_INFO

#define MATE_TYPE_RR_OUTPUT_INFO   (mate_rr_output_info_get_type())

Typedef Documentation

◆ MateRRConfigPrivate

◆ MateRROutputInfoPrivate

Function Documentation

◆ mate_rr_config_applicable()

gboolean mate_rr_config_applicable ( MateRRConfig *  configuration,
MateRRScreen *  screen,
GError **  error 
)

References crtc_assignment_free(), crtc_assignment_new(), make_outputs(), MATE_IS_RR_CONFIG, MATE_IS_RR_SCREEN, and CrtcAssignment::screen.

Here is the call graph for this function:

◆ mate_rr_config_apply_from_filename_with_time()

gboolean mate_rr_config_apply_from_filename_with_time ( MateRRScreen *  screen,
const char *  filename,
guint32  timestamp,
GError **  error 
)

References MATE_IS_RR_SCREEN, mate_rr_config_apply_with_time(), mate_rr_config_ensure_primary(), mate_rr_config_load_filename(), mate_rr_screen_refresh(), MATE_TYPE_RR_CONFIG, and CrtcAssignment::screen.

Here is the call graph for this function:

◆ mate_rr_config_apply_with_time()

gboolean mate_rr_config_apply_with_time ( MateRRConfig *  configuration,
MateRRScreen *  screen,
guint32  timestamp,
GError **  error 
)

References crtc_assignment_apply(), crtc_assignment_free(), crtc_assignment_new(), make_outputs(), MATE_IS_RR_CONFIG, MATE_IS_RR_SCREEN, and CrtcAssignment::screen.

Referenced by mate_rr_config_apply_from_filename_with_time().

Here is the call graph for this function:

◆ mate_rr_config_ensure_primary()

gboolean mate_rr_config_ensure_primary ( MateRRConfig *  configuration)

References _mate_rr_output_name_is_laptop(), CrtcAssignment::info, MATE_IS_RR_CONFIG, MateRRConfigPrivate::outputs, MateRROutputInfoPrivate::primary, MateRROutputInfo::priv, MateRRConfig::priv, MateRROutputInfoPrivate::x, and MateRROutputInfoPrivate::y.

Referenced by mate_rr_config_apply_from_filename_with_time().

Here is the call graph for this function:

◆ mate_rr_config_equal()

gboolean mate_rr_config_equal ( MateRRConfig *  config1,
MateRRConfig *  config2 
)

References find_output(), MATE_IS_RR_CONFIG, MateRROutputInfoPrivate::name, output_equal(), MateRRConfigPrivate::outputs, MateRROutputInfo::priv, and MateRRConfig::priv.

Here is the call graph for this function:

◆ mate_rr_config_get_backup_filename()

char * mate_rr_config_get_backup_filename ( void  )

References CONFIG_BACKUP_BASENAME, and ensure_config_directory().

Referenced by mate_rr_config_save().

Here is the call graph for this function:

◆ mate_rr_config_get_clone()

gboolean mate_rr_config_get_clone ( MateRRConfig *  self)

mate_rr_config_get_clone:

Returns: whether at least two outputs are at (0, 0) offset and they have the same width/height. Those outputs are of course connected and on (i.e. they have a CRTC assigned).

References MateRRConfigPrivate::clone, MATE_IS_RR_CONFIG, and MateRRConfig::priv.

Referenced by create_label_window(), and create_label_windows().

◆ mate_rr_config_get_intended_filename()

char * mate_rr_config_get_intended_filename ( void  )

References CONFIG_INTENDED_BASENAME, and ensure_config_directory().

Referenced by mate_rr_config_load_filename(), mate_rr_config_new_stored(), and mate_rr_config_save().

Here is the call graph for this function:

◆ mate_rr_config_get_outputs()

MateRROutputInfo ** mate_rr_config_get_outputs ( MateRRConfig *  self)

mate_rr_config_get_outputs:

Returns: (array zero-terminated=1) (element-type MateDesktop.RROutputInfo) (transfer none): the output configuration for this MateRRConfig

References MATE_IS_RR_CONFIG, MateRRConfigPrivate::outputs, and MateRRConfig::priv.

Referenced by count_outputs(), create_label_windows(), and mate_rr_labeler_get_rgba_for_output().

◆ mate_rr_config_get_type()

GType mate_rr_config_get_type ( void  )

◆ mate_rr_config_load_current()

gboolean mate_rr_config_load_current ( MateRRConfig *  self,
GError **  error 
)

◆ mate_rr_config_load_filename()

gboolean mate_rr_config_load_filename ( MateRRConfig *  self,
const gchar *  filename,
GError **  error 
)

◆ mate_rr_config_match()

gboolean mate_rr_config_match ( MateRRConfig *  config1,
MateRRConfig *  config2 
)

References find_output(), MATE_IS_RR_CONFIG, MateRROutputInfoPrivate::name, output_match(), MateRRConfigPrivate::outputs, MateRROutputInfo::priv, and MateRRConfig::priv.

Referenced by mate_rr_config_load_current(), mate_rr_config_load_filename(), and mate_rr_config_save().

Here is the call graph for this function:

◆ mate_rr_config_new_current()

MateRRConfig * mate_rr_config_new_current ( MateRRScreen *  screen,
GError **  error 
)

References mate_rr_config_load_current(), MATE_TYPE_RR_CONFIG, and CrtcAssignment::screen.

Referenced by mate_rr_config_load_filename().

Here is the call graph for this function:

◆ mate_rr_config_new_stored()

MateRRConfig * mate_rr_config_new_stored ( MateRRScreen *  screen,
GError **  error 
)

References mate_rr_config_get_intended_filename(), mate_rr_config_load_filename(), MATE_TYPE_RR_CONFIG, and CrtcAssignment::screen.

Here is the call graph for this function:

◆ mate_rr_config_sanitize()

◆ mate_rr_config_save()

gboolean mate_rr_config_save ( MateRRConfig *  configuration,
GError **  error 
)

References configurations_read_from_file(), emit_configuration(), MATE_IS_RR_CONFIG, mate_rr_config_get_backup_filename(), mate_rr_config_get_intended_filename(), and mate_rr_config_match().

Here is the call graph for this function:

◆ mate_rr_config_set_clone()

void mate_rr_config_set_clone ( MateRRConfig *  configuration,
gboolean  clone 
)

◆ mate_rr_output_info_get_aspect_ratio()

double mate_rr_output_info_get_aspect_ratio ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_display_name()

char * mate_rr_output_info_get_display_name ( MateRROutputInfo *  self)

mate_rr_output_info_get_display_name:

Returns: (transfer none): the display name of this output

References MateRROutputInfoPrivate::display_name, MATE_IS_RR_OUTPUT_INFO, and MateRROutputInfo::priv.

Referenced by create_label_window().

◆ mate_rr_output_info_get_geometry()

void mate_rr_output_info_get_geometry ( MateRROutputInfo *  self,
int *  x,
int *  y,
int *  width,
int *  height 
)

mate_rr_output_info_get_geometry: @self: a MateRROutputInfo @x: (out) (allow-none): @y: (out) (allow-none): @width: (out) (allow-none): @height: (out) (allow-none):

References MateRROutputInfoPrivate::height, MATE_IS_RR_OUTPUT_INFO, MateRROutputInfo::priv, MateRROutputInfoPrivate::width, MateRROutputInfoPrivate::x, and MateRROutputInfoPrivate::y.

Referenced by create_label_window().

◆ mate_rr_output_info_get_name()

char * mate_rr_output_info_get_name ( MateRROutputInfo *  self)

mate_rr_output_info_get_name:

Returns: (transfer none): the output name

References MATE_IS_RR_OUTPUT_INFO, MateRROutputInfoPrivate::name, and MateRROutputInfo::priv.

Referenced by create_label_window().

◆ mate_rr_output_info_get_preferred_height()

int mate_rr_output_info_get_preferred_height ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_preferred_width()

int mate_rr_output_info_get_preferred_width ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_primary()

gboolean mate_rr_output_info_get_primary ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_product()

guint mate_rr_output_info_get_product ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_refresh_rate()

int mate_rr_output_info_get_refresh_rate ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_rotation()

◆ mate_rr_output_info_get_serial()

guint mate_rr_output_info_get_serial ( MateRROutputInfo *  self)

◆ mate_rr_output_info_get_type()

GType mate_rr_output_info_get_type ( void  )

◆ mate_rr_output_info_get_vendor()

void mate_rr_output_info_get_vendor ( MateRROutputInfo *  self,
gchar *  vendor 
)

mate_rr_output_info_get_vendor: @self: a MateRROutputInfo @vendor: (out caller-allocates) (array fixed-size=4):

References MATE_IS_RR_OUTPUT_INFO, MateRROutputInfo::priv, and MateRROutputInfoPrivate::vendor.

◆ mate_rr_output_info_is_active()

gboolean mate_rr_output_info_is_active ( MateRROutputInfo *  self)

mate_rr_output_info_is_active:

Returns: whether there is a CRTC assigned to this output (i.e. a signal is being sent to it)

References MATE_IS_RR_OUTPUT_INFO, MateRROutputInfoPrivate::on, and MateRROutputInfo::priv.

Referenced by create_label_windows().

◆ mate_rr_output_info_is_connected()

gboolean mate_rr_output_info_is_connected ( MateRROutputInfo *  self)

mate_rr_output_info_is_connected:

Returns: whether the output is physically connected to a monitor

References MateRROutputInfoPrivate::connected, MATE_IS_RR_OUTPUT_INFO, and MateRROutputInfo::priv.

◆ mate_rr_output_info_set_active()

void mate_rr_output_info_set_active ( MateRROutputInfo *  self,
gboolean  active 
)

◆ mate_rr_output_info_set_geometry()

void mate_rr_output_info_set_geometry ( MateRROutputInfo *  self,
int  x,
int  y,
int  width,
int  height 
)

mate_rr_output_info_set_geometry: @self: a MateRROutputInfo @x: x offset for monitor @y: y offset for monitor @width: monitor width @height: monitor height

Set the geometry for the monitor connected to the specified output.

References MateRROutputInfoPrivate::height, MATE_IS_RR_OUTPUT_INFO, MateRROutputInfo::priv, MateRROutputInfoPrivate::width, MateRROutputInfoPrivate::x, and MateRROutputInfoPrivate::y.

◆ mate_rr_output_info_set_primary()

void mate_rr_output_info_set_primary ( MateRROutputInfo *  self,
gboolean  primary 
)

◆ mate_rr_output_info_set_refresh_rate()

void mate_rr_output_info_set_refresh_rate ( MateRROutputInfo *  self,
int  rate 
)

◆ mate_rr_output_info_set_rotation()

void mate_rr_output_info_set_rotation ( MateRROutputInfo *  self,
MateRRRotation  rotation 
)