1 /* gnome-rr-config.h 2 * -*- c-basic-offset: 4 -*- 3 * 4 * Copyright 2007, 2008, Red Hat, Inc. 5 * Copyright 2010 Giovanni Campagna 6 * 7 * This file is part of the Gnome Library. 8 * 9 * The Gnome Library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Library General Public License as 11 * published by the Free Software Foundation; either version 2 of the 12 * License, or (at your option) any later version. 13 * 14 * The Gnome Library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Library General Public License for more details. 18 * 19 * You should have received a copy of the GNU Library General Public 20 * License along with the Gnome Library; see the file COPYING.LIB. If not, 21 * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 * Boston, MA 02110-1301, USA. 23 * 24 * Author: Soren Sandmann <sandmann@redhat.com> 25 */ 26 #ifndef GNOME_RR_CONFIG_H 27 #define GNOME_RR_CONFIG_H 28 29 #ifndef GNOME_DESKTOP_USE_UNSTABLE_API 30 #error gnome-rr-config.h is unstable API. You must define GNOME_DESKTOP_USE_UNSTABLE_API before including gnome-rr-config.h 31 #endif 32 33 #include <glib.h> 34 #include <glib-object.h> 35 #include <libcinnamon-desktop/gnome-rr.h> 36 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 const 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 float gnome_rr_output_info_get_scale (GnomeRROutputInfo *self); 71 void gnome_rr_output_info_set_scale (GnomeRROutputInfo *self, float scale); 72 73 int gnome_rr_output_info_get_refresh_rate (GnomeRROutputInfo *self); 74 void gnome_rr_output_info_set_refresh_rate (GnomeRROutputInfo *self, int rate); 75 76 double gnome_rr_output_info_get_refresh_rate_f (GnomeRROutputInfo *self); 77 void gnome_rr_output_info_set_refresh_rate_f (GnomeRROutputInfo *self, double rate); 78 79 GnomeRRRotation gnome_rr_output_info_get_rotation (GnomeRROutputInfo *self); 80 void gnome_rr_output_info_set_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation); 81 82 gboolean gnome_rr_output_info_is_connected (GnomeRROutputInfo *self); 83 void gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self, gchar* vendor); 84 guint gnome_rr_output_info_get_product (GnomeRROutputInfo *self); 85 guint gnome_rr_output_info_get_serial (GnomeRROutputInfo *self); 86 double gnome_rr_output_info_get_aspect_ratio (GnomeRROutputInfo *self); 87 char *gnome_rr_output_info_get_display_name (GnomeRROutputInfo *self); 88 89 gboolean gnome_rr_output_info_get_primary (GnomeRROutputInfo *self); 90 void gnome_rr_output_info_set_primary (GnomeRROutputInfo *self, gboolean primary); 91 92 int gnome_rr_output_info_get_preferred_width (GnomeRROutputInfo *self); 93 int gnome_rr_output_info_get_preferred_height (GnomeRROutputInfo *self); 94 95 void gnome_rr_output_info_get_flags (GnomeRROutputInfo *self, 96 gboolean *doublescan, 97 gboolean *interlaced, 98 gboolean *vsync); 99 void gnome_rr_output_info_set_flags (GnomeRROutputInfo *self, 100 gboolean doublescan, 101 gboolean interlaced, 102 gboolean vsync); 103 typedef struct 104 { 105 GObject parent; 106 107 /*< private >*/ 108 GnomeRRConfigPrivate *priv; 109 } GnomeRRConfig; 110 111 typedef struct 112 { 113 GObjectClass parent_class; 114 } GnomeRRConfigClass; 115 116 #define GNOME_TYPE_RR_CONFIG (gnome_rr_config_get_type()) 117 #define GNOME_RR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_CONFIG, GnomeRRConfig)) 118 #define GNOME_IS_RR_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_RR_CONFIG)) 119 #define GNOME_RR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_RR_CONFIG, GnomeRRConfigClass)) 120 #define GNOME_IS_RR_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_RR_CONFIG)) 121 #define GNOME_RR_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_RR_CONFIG, GnomeRRConfigClass)) 122 123 GType gnome_rr_config_get_type (void); 124 125 GnomeRRConfig *gnome_rr_config_new_current (GnomeRRScreen *screen, 126 GError **error); 127 GnomeRRConfig *gnome_rr_config_new_stored (GnomeRRScreen *screen, 128 GError **error); 129 gboolean gnome_rr_config_load_current (GnomeRRConfig *self, 130 GError **error); 131 gboolean gnome_rr_config_load_filename (GnomeRRConfig *self, 132 const gchar *filename, 133 GError **error); 134 gboolean gnome_rr_config_match (GnomeRRConfig *config1, 135 GnomeRRConfig *config2); 136 gboolean gnome_rr_config_equal (GnomeRRConfig *config1, 137 GnomeRRConfig *config2); 138 gboolean gnome_rr_config_save (GnomeRRConfig *configuration, 139 GError **error); 140 void gnome_rr_config_sanitize (GnomeRRConfig *configuration); 141 gboolean gnome_rr_config_ensure_primary (GnomeRRConfig *configuration); 142 143 gboolean gnome_rr_config_apply_with_time (GnomeRRConfig *configuration, 144 GnomeRRScreen *screen, 145 guint32 timestamp, 146 GError **error); 147 148 gboolean gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen *screen, 149 const char *filename, 150 guint32 timestamp, 151 GError **error); 152 153 gboolean gnome_rr_config_applicable (GnomeRRConfig *configuration, 154 GnomeRRScreen *screen, 155 GError **error); 156 157 gboolean gnome_rr_config_get_clone (GnomeRRConfig *configuration); 158 void gnome_rr_config_set_clone (GnomeRRConfig *configuration, gboolean clone); 159 guint gnome_rr_config_get_base_scale (GnomeRRConfig *self); 160 void gnome_rr_config_set_base_scale (GnomeRRConfig *self, 161 guint base_scale); 162 gboolean gnome_rr_config_get_auto_scale (GnomeRRConfig *self); 163 void gnome_rr_config_set_auto_scale (GnomeRRConfig *self, 164 gboolean auto_scale); 165 GnomeRROutputInfo **gnome_rr_config_get_outputs (GnomeRRConfig *configuration); 166 167 char *gnome_rr_config_get_backup_filename (void); 168 char *gnome_rr_config_get_intended_filename (void); 169 char *gnome_rr_config_get_legacy_filename (void); 170 171 #endif 172