From 61bc8d2cf4f5cd5b7eae09088bbce2b000abbcb8 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 4 Dec 2008 00:26:09 +0000 Subject: Start a GError framework for the GnomeRR API Signed-off-by: Federico Mena Quintero svn path=/trunk/; revision=5299 --- libgnome-desktop/ChangeLog | 9 +++++++++ libgnome-desktop/gnome-rr.c | 16 ++++++++++++++++ libgnome-desktop/libgnomeui/gnome-rr.h | 10 ++++++++++ 3 files changed, 35 insertions(+) diff --git a/libgnome-desktop/ChangeLog b/libgnome-desktop/ChangeLog index a8ac6d34..70a12ae0 100644 --- a/libgnome-desktop/ChangeLog +++ b/libgnome-desktop/ChangeLog @@ -1,3 +1,12 @@ +2008-10-16 Federico Mena Quintero + + Add error reporting to the GnomeRR API. + + * libgnomeui/gnome-rr.h (GnomeRRError): New enum with error codes + for the GnomeRR API. + + * gnome-rr.c (gnome_rr_error_quark): New public function. + 2008-12-02 Vincent Untz * gnome-rr-config.c: (handle_start_element), (outputs_free): diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c index 99cfe399..89b5cc48 100644 --- a/libgnome-desktop/gnome-rr.c +++ b/libgnome-desktop/gnome-rr.c @@ -138,6 +138,22 @@ static void mode_initialize (GnomeRRMode *mode, static void mode_free (GnomeRRMode *mode); +/* Errors */ + +/** + * gnome_rr_error_quark: + * + * Returns the #GQuark that will be used for #GError values returned by the + * GnomeRR API. + * + * Return value: a #GQuark used to identify errors coming from the GnomeRR API. + */ +GQuark +gnome_rr_error_quark (void) +{ + return g_quark_from_static_string ("gnome-rr-error-quark"); +} + /* Screen */ static GnomeRROutput * gnome_rr_output_by_id (ScreenInfo *info, RROutput id) diff --git a/libgnome-desktop/libgnomeui/gnome-rr.h b/libgnome-desktop/libgnomeui/gnome-rr.h index c7907fcd..3871168c 100644 --- a/libgnome-desktop/libgnomeui/gnome-rr.h +++ b/libgnome-desktop/libgnomeui/gnome-rr.h @@ -48,6 +48,16 @@ typedef enum GNOME_RR_REFLECT_Y = (1 << 5) } GnomeRRRotation; +/* Error codes */ + +#define GNOME_RR_ERROR (gnome_rr_error_quark ()) + +GQuark gnome_rr_error_quark (void); + +typedef enum { + GNOME_RR_ERROR_UNKNOWN, /* generic "fail" */ +} GnomeRRError; + /* GnomeRRScreen */ GnomeRRScreen * gnome_rr_screen_new (GdkScreen *screen, GnomeRRScreenChanged callback, -- cgit v1.2.1