summaryrefslogtreecommitdiffstats
path: root/src/extension/dbus/application-interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/extension/dbus/application-interface.cpp')
-rw-r--r--src/extension/dbus/application-interface.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp
index a652b7c96..8ee7bd12f 100644
--- a/src/extension/dbus/application-interface.cpp
+++ b/src/extension/dbus/application-interface.cpp
@@ -39,6 +39,9 @@ application_interface_class_init (ApplicationInterfaceClass *klass)
static void
application_interface_init (ApplicationInterface *object)
{
+ dbus_g_error_domain_register (INKSCAPE_ERROR,
+ NULL,
+ INKSCAPE_TYPE_ERROR);
}
@@ -48,6 +51,44 @@ application_interface_new (void)
return (ApplicationInterface*)g_object_new (TYPE_APPLICATION_INTERFACE, NULL);
}
+/*
+ * Error stuff...
+ *
+ * To add a new error type, edit here and in the .h InkscapeError enum.
+ */
+GQuark
+inkscape_error_quark (void)
+{
+ static GQuark quark = 0;
+ if (!quark)
+ quark = g_quark_from_static_string ("inkscape_error");
+
+ return quark;
+}
+
+#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
+
+GType inkscape_error_get_type(void)
+{
+ static GType etype = 0;
+
+ if (etype == 0) {
+ static const GEnumValue values[] =
+ {
+
+ ENUM_ENTRY(INKSCAPE_ERROR_SELECTION, "Incompatible_Selection"),
+ ENUM_ENTRY(INKSCAPE_ERROR_OBJECT, "Incompatible_Object"),
+ ENUM_ENTRY(INKSCAPE_ERROR_VERB, "Failed_Verb"),
+ ENUM_ENTRY(INKSCAPE_ERROR_OTHER, "Generic_Error"),
+ { 0, 0, 0 }
+ };
+
+ etype = g_enum_register_static("InkscapeError", values);
+ }
+
+ return etype;
+}
+
/****************************************************************************
DESKTOP FUNCTIONS
****************************************************************************/