~rodrigo-moya/ubuntu/oneiric/gnome-desktop3/fix_863038

« back to all changes in this revision

Viewing changes to libgnome-desktop/gnome-rr-config.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-01-12 11:08:17 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110112110817-qiyyybvcj2k70sjq
Tags: 2.91.5-0ubuntu1
* New upstream release
* debian/control:
  - Bump build dependency on gsettings-desktop-schemas
* debian/libgnome-desktop-3-0.symbols:
  - Update to match new API

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* gnome-rr-config.h
 
2
 * -*- c-basic-offset: 4 -*-
2
3
 *
3
4
 * Copyright 2007, 2008, Red Hat, Inc.
 
5
 * Copyright 2010 Giovanni Campagna
4
6
 * 
5
7
 * This file is part of the Gnome Library.
6
8
 * 
29
31
#endif
30
32
 
31
33
#include <glib.h>
 
34
#include <glib-object.h>
32
35
#include <libgnome-desktop/gnome-rr.h>
33
36
 
34
 
typedef struct GnomeOutputInfo GnomeOutputInfo;
35
 
typedef struct GnomeRRConfig GnomeRRConfig;
36
 
 
37
 
/* FIXME:
38
 
 *
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
41
 
 * the client.
42
 
 */
43
 
 
44
 
struct GnomeOutputInfo
45
 
{
46
 
    char *              name;
47
 
 
48
 
    gboolean            on; /* whether there is a CRTC assigned to this output (i.e. a signal is being sent to it) */
49
 
    int                 width;
50
 
    int                 height;
51
 
    int                 rate;
52
 
    int                 x;
53
 
    int                 y;
54
 
    GnomeRRRotation     rotation;
55
 
 
56
 
    gboolean            connected; /* whether the output is physically connected to a monitor */
57
 
    char                vendor[4];
58
 
    guint               product;
59
 
    guint               serial;
60
 
    double              aspect;
61
 
    int                 pref_width;
62
 
    int                 pref_height;
63
 
    char *              display_name;
64
 
    gboolean            primary;
65
 
 
66
 
    gpointer            user_data;
67
 
};
68
 
 
69
 
struct GnomeRRConfig
70
 
{
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).
74
 
     */
75
 
    gboolean            clone;
76
 
    
77
 
    GnomeOutputInfo **  outputs;
78
 
};
79
 
 
80
 
GnomeRRConfig  *gnome_rr_config_new_current  (GnomeRRScreen  *screen);
81
 
GnomeRRConfig  *gnome_rr_config_new_stored   (GnomeRRScreen  *screen,
82
 
                                              GError        **error);
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,
89
 
                                              GError        **error);
90
 
void            gnome_rr_config_sanitize     (GnomeRRConfig  *configuration);
91
 
gboolean        gnome_rr_config_ensure_primary (GnomeRRConfig  *configuration);
92
 
 
93
 
#ifndef GNOME_DISABLE_DEPRECATED
94
 
gboolean        gnome_rr_config_apply        (GnomeRRConfig  *configuration,
95
 
                                              GnomeRRScreen  *screen,
96
 
                                              GError        **error);
97
 
#endif
98
 
 
99
 
gboolean        gnome_rr_config_apply_with_time (GnomeRRConfig  *configuration,
100
 
                                                 GnomeRRScreen  *screen,
101
 
                                                 guint32         timestamp,
102
 
                                                 GError        **error);
103
 
 
104
 
#ifndef GNOME_DISABLE_DEPRECATED
105
 
gboolean        gnome_rr_config_apply_stored (GnomeRRScreen  *screen,
106
 
                                              GError        **error);
107
 
#endif
108
 
 
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;
 
39
 
 
40
typedef struct
 
41
{
 
42
    GObject parent;
 
43
 
 
44
    /*< private >*/
 
45
    GnomeRROutputInfoPrivate *priv;
 
46
} GnomeRROutputInfo;
 
47
 
 
48
typedef struct
 
49
{
 
50
    GObjectClass parent_class;
 
51
} GnomeRROutputInfoClass;
 
52
 
 
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))
 
59
 
 
60
GType gnome_rr_output_info_get_type (void);
 
61
 
 
62
char *gnome_rr_output_info_get_name (GnomeRROutputInfo *self);
 
63
 
 
64
gboolean gnome_rr_output_info_is_active  (GnomeRROutputInfo *self);
 
65
void     gnome_rr_output_info_set_active (GnomeRROutputInfo *self, gboolean active);
 
66
 
 
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);
 
69
 
 
70
int  gnome_rr_output_info_get_refresh_rate (GnomeRROutputInfo *self);
 
71
void gnome_rr_output_info_set_refresh_rate (GnomeRROutputInfo *self, int rate);
 
72
 
 
73
GnomeRRRotation gnome_rr_output_info_get_rotation (GnomeRROutputInfo *self);
 
74
void            gnome_rr_output_info_set_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation);
 
75
 
 
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);
 
82
 
 
83
gboolean gnome_rr_output_info_get_primary (GnomeRROutputInfo *self);
 
84
void     gnome_rr_output_info_set_primary (GnomeRROutputInfo *self, gboolean primary);
 
85
 
 
86
int gnome_rr_output_info_get_preferred_width  (GnomeRROutputInfo *self);
 
87
int gnome_rr_output_info_get_preferred_height (GnomeRROutputInfo *self);
 
88
 
 
89
typedef struct
 
90
{
 
91
    GObject parent;
 
92
 
 
93
    /*< private >*/
 
94
    GnomeRRConfigPrivate *priv;
 
95
} GnomeRRConfig;
 
96
 
 
97
typedef struct
 
98
{
 
99
    GObjectClass parent_class;
 
100
} GnomeRRConfigClass;
 
101
 
 
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))
 
108
 
 
109
GType               gnome_rr_config_get_type     (void);
 
110
 
 
111
GnomeRRConfig      *gnome_rr_config_new_current  (GnomeRRScreen  *screen,
 
112
                                                  GError        **error);
 
113
GnomeRRConfig      *gnome_rr_config_new_stored   (GnomeRRScreen  *screen,
 
114
                                                  GError        **error);
 
115
gboolean                gnome_rr_config_load_current (GnomeRRConfig  *self,
 
116
                                                      GError        **error);
 
117
gboolean                gnome_rr_config_load_filename (GnomeRRConfig  *self,
 
118
                                                       const gchar    *filename,
 
119
                                                       GError        **error);
 
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,
 
125
                                                  GError        **error);
 
126
void                gnome_rr_config_sanitize     (GnomeRRConfig  *configuration);
 
127
gboolean            gnome_rr_config_ensure_primary (GnomeRRConfig  *configuration);
 
128
 
 
129
gboolean            gnome_rr_config_apply_with_time (GnomeRRConfig  *configuration,
 
130
                                                     GnomeRRScreen  *screen,
 
131
                                                     guint32         timestamp,
112
132
                                                     GError        **error);
113
 
#endif
114
 
 
115
 
gboolean        gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen  *screen,
116
 
                                                               const char     *filename,
117
 
                                                               guint32         timestamp,
118
 
                                                               GError        **error);
119
 
 
120
 
gboolean        gnome_rr_config_applicable   (GnomeRRConfig  *configuration,
121
 
                                              GnomeRRScreen  *screen,
122
 
                                              GError        **error);
 
133
 
 
134
gboolean            gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen  *screen,
 
135
                                                                   const char     *filename,
 
136
                                                                   guint32         timestamp,
 
137
                                                                   GError        **error);
 
138
 
 
139
gboolean            gnome_rr_config_applicable   (GnomeRRConfig  *configuration,
 
140
                                                  GnomeRRScreen  *screen,
 
141
                                                  GError        **error);
 
142
 
 
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);
123
146
 
124
147
char *gnome_rr_config_get_backup_filename (void);
125
148
char *gnome_rr_config_get_intended_filename (void);
126
149
 
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.
129
 
 */
130
 
GnomeRRMode **gnome_rr_create_clone_modes (GnomeRRScreen *screen);
131
 
 
132
150
#endif