34
#include <glib-object.h>
32
35
#include <libgnome-desktop/gnome-rr.h>
34
typedef struct GnomeOutputInfo GnomeOutputInfo;
35
typedef struct GnomeRRConfig GnomeRRConfig;
39
* This structure is a Frankenstein monster where all of the fields
40
* are generated by the system, but some of them can be changed by
44
struct GnomeOutputInfo
48
gboolean on; /* whether there is a CRTC assigned to this output (i.e. a signal is being sent to it) */
54
GnomeRRRotation rotation;
56
gboolean connected; /* whether the output is physically connected to a monitor */
71
/* "clone" means that at least two outputs are at (0, 0) offset and they
72
* have the same width/height. Those outputs are of course connected and on
73
* (i.e. they have a CRTC assigned).
77
GnomeOutputInfo ** outputs;
80
GnomeRRConfig *gnome_rr_config_new_current (GnomeRRScreen *screen);
81
GnomeRRConfig *gnome_rr_config_new_stored (GnomeRRScreen *screen,
83
void gnome_rr_config_free (GnomeRRConfig *configuration);
84
gboolean gnome_rr_config_match (GnomeRRConfig *config1,
85
GnomeRRConfig *config2);
86
gboolean gnome_rr_config_equal (GnomeRRConfig *config1,
87
GnomeRRConfig *config2);
88
gboolean gnome_rr_config_save (GnomeRRConfig *configuration,
90
void gnome_rr_config_sanitize (GnomeRRConfig *configuration);
91
gboolean gnome_rr_config_ensure_primary (GnomeRRConfig *configuration);
93
#ifndef GNOME_DISABLE_DEPRECATED
94
gboolean gnome_rr_config_apply (GnomeRRConfig *configuration,
95
GnomeRRScreen *screen,
99
gboolean gnome_rr_config_apply_with_time (GnomeRRConfig *configuration,
100
GnomeRRScreen *screen,
104
#ifndef GNOME_DISABLE_DEPRECATED
105
gboolean gnome_rr_config_apply_stored (GnomeRRScreen *screen,
109
#ifndef GNOME_DISABLE_DEPRECATED
110
gboolean gnome_rr_config_apply_from_filename (GnomeRRScreen *screen,
111
const char *filename,
37
typedef struct GnomeRROutputInfoPrivate GnomeRROutputInfoPrivate;
38
typedef struct GnomeRRConfigPrivate GnomeRRConfigPrivate;
45
GnomeRROutputInfoPrivate *priv;
50
GObjectClass parent_class;
51
} GnomeRROutputInfoClass;
53
#define GNOME_TYPE_RR_OUTPUT_INFO (gnome_rr_output_info_get_type())
54
#define GNOME_RR_OUTPUT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_OUTPUT_INFO, GnomeRROutputInfo))
55
#define GNOME_IS_RR_OUTPUT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_RR_OUTPUT_INFO))
56
#define GNOME_RR_OUTPUT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_RR_OUTPUT_INFO, GnomeRROutputInfoClass))
57
#define GNOME_IS_RR_OUTPUT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_RR_OUTPUT_INFO))
58
#define GNOME_RR_OUTPUT_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_RR_OUTPUT_INFO, GnomeRROutputInfoClass))
60
GType gnome_rr_output_info_get_type (void);
62
char *gnome_rr_output_info_get_name (GnomeRROutputInfo *self);
64
gboolean gnome_rr_output_info_is_active (GnomeRROutputInfo *self);
65
void gnome_rr_output_info_set_active (GnomeRROutputInfo *self, gboolean active);
67
void gnome_rr_output_info_get_geometry (GnomeRROutputInfo *self, int *x, int *y, int *width, int *height);
68
void gnome_rr_output_info_set_geometry (GnomeRROutputInfo *self, int x, int y, int width, int height);
70
int gnome_rr_output_info_get_refresh_rate (GnomeRROutputInfo *self);
71
void gnome_rr_output_info_set_refresh_rate (GnomeRROutputInfo *self, int rate);
73
GnomeRRRotation gnome_rr_output_info_get_rotation (GnomeRROutputInfo *self);
74
void gnome_rr_output_info_set_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation);
76
gboolean gnome_rr_output_info_is_connected (GnomeRROutputInfo *self);
77
void gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self, gchar* vendor);
78
guint gnome_rr_output_info_get_product (GnomeRROutputInfo *self);
79
guint gnome_rr_output_info_get_serial (GnomeRROutputInfo *self);
80
double gnome_rr_output_info_get_aspect_ratio (GnomeRROutputInfo *self);
81
char *gnome_rr_output_info_get_display_name (GnomeRROutputInfo *self);
83
gboolean gnome_rr_output_info_get_primary (GnomeRROutputInfo *self);
84
void gnome_rr_output_info_set_primary (GnomeRROutputInfo *self, gboolean primary);
86
int gnome_rr_output_info_get_preferred_width (GnomeRROutputInfo *self);
87
int gnome_rr_output_info_get_preferred_height (GnomeRROutputInfo *self);
94
GnomeRRConfigPrivate *priv;
99
GObjectClass parent_class;
100
} GnomeRRConfigClass;
102
#define GNOME_TYPE_RR_CONFIG (gnome_rr_config_get_type())
103
#define GNOME_RR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_CONFIG, GnomeRRConfig))
104
#define GNOME_IS_RR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_RR_CONFIG))
105
#define GNOME_RR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_RR_CONFIG, GnomeRRConfigClass))
106
#define GNOME_IS_RR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_RR_CONFIG))
107
#define GNOME_RR_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_RR_CONFIG, GnomeRRConfigClass))
109
GType gnome_rr_config_get_type (void);
111
GnomeRRConfig *gnome_rr_config_new_current (GnomeRRScreen *screen,
113
GnomeRRConfig *gnome_rr_config_new_stored (GnomeRRScreen *screen,
115
gboolean gnome_rr_config_load_current (GnomeRRConfig *self,
117
gboolean gnome_rr_config_load_filename (GnomeRRConfig *self,
118
const gchar *filename,
120
gboolean gnome_rr_config_match (GnomeRRConfig *config1,
121
GnomeRRConfig *config2);
122
gboolean gnome_rr_config_equal (GnomeRRConfig *config1,
123
GnomeRRConfig *config2);
124
gboolean gnome_rr_config_save (GnomeRRConfig *configuration,
126
void gnome_rr_config_sanitize (GnomeRRConfig *configuration);
127
gboolean gnome_rr_config_ensure_primary (GnomeRRConfig *configuration);
129
gboolean gnome_rr_config_apply_with_time (GnomeRRConfig *configuration,
130
GnomeRRScreen *screen,
115
gboolean gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen *screen,
116
const char *filename,
120
gboolean gnome_rr_config_applicable (GnomeRRConfig *configuration,
121
GnomeRRScreen *screen,
134
gboolean gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen *screen,
135
const char *filename,
139
gboolean gnome_rr_config_applicable (GnomeRRConfig *configuration,
140
GnomeRRScreen *screen,
143
gboolean gnome_rr_config_get_clone (GnomeRRConfig *configuration);
144
void gnome_rr_config_set_clone (GnomeRRConfig *configuration, gboolean clone);
145
GnomeRROutputInfo **gnome_rr_config_get_outputs (GnomeRRConfig *configuration);
124
147
char *gnome_rr_config_get_backup_filename (void);
125
148
char *gnome_rr_config_get_intended_filename (void);
127
/* A utility function that isn't really in the spirit of this file, but I don't
128
* don't know a better place for it.
130
GnomeRRMode **gnome_rr_create_clone_modes (GnomeRRScreen *screen);