[rhythmbox] shell: add typedef and GEnum type for RB_SHELL_ERROR_*



commit 914080c80f339b8adf9233f36b30abb92d143d5d
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Aug 28 18:36:48 2010 +1000

    shell: add typedef and GEnum type for RB_SHELL_ERROR_*

 shell/rb-shell.c |   20 ++++++++++++++++++++
 shell/rb-shell.h |    6 ++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index d73b323..d1b98c9 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -3893,3 +3893,23 @@ rb_shell_ui_location_get_type (void)
 
 	return etype;
 }
+
+GType
+rb_shell_error_get_type (void)
+{
+	static GType etype = 0;
+
+	if (etype == 0) {
+		static const GEnumValue values[] = {
+			ENUM_ENTRY(RB_SHELL_ERROR_NO_SUCH_URI, "no-such-uri"),
+			ENUM_ENTRY(RB_SHELL_ERROR_NO_SUCH_PROPERTY, "no-such-property"),
+			ENUM_ENTRY(RB_SHELL_ERROR_IMMUTABLE_PROPERTY, "immutable-property"),
+			ENUM_ENTRY(RB_SHELL_ERROR_INVALID_PROPERTY_TYPE, "invalid-property-type"),
+			ENUM_ENTRY(RB_SHELL_ERROR_NO_SOURCE_FOR_URI, "no-source-for-uri"),
+			{ 0, 0, 0 }
+		};
+		etype = g_enum_register_static ("RBShellErrorType", values);
+	}
+
+	return etype;
+}
diff --git a/shell/rb-shell.h b/shell/rb-shell.h
index 80c40e4..fb860fa 100644
--- a/shell/rb-shell.h
+++ b/shell/rb-shell.h
@@ -42,18 +42,20 @@ G_BEGIN_DECLS
 #define RB_IS_SHELL_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_SHELL))
 #define RB_SHELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_SHELL, RBShellClass))
 
-enum
+typedef enum
 {
 	RB_SHELL_ERROR_NO_SUCH_URI,
 	RB_SHELL_ERROR_NO_SUCH_PROPERTY,
 	RB_SHELL_ERROR_IMMUTABLE_PROPERTY,
 	RB_SHELL_ERROR_INVALID_PROPERTY_TYPE,
 	RB_SHELL_ERROR_NO_SOURCE_FOR_URI
-};
+} RBShellError;
 
 #define RB_SHELL_ERROR rb_shell_error_quark ()
 
 GQuark rb_shell_error_quark (void);
+GType rb_shell_error_get_type (void);
+#define RB_TYPE_SHELL_ERROR (rb_shell_error_get_type ())
 
 typedef enum
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]