summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2009-06-13 19:35:49 +0100
committerBastien Nocera <hadess@hadess.net>2009-06-13 21:03:45 +0100
commit6c6b73618be165281785370414c0c5f826099535 (patch)
treef24315e396b2348808f0ab27b4d7633dae7c4b58 /lib
parent07b921ddf59b88f7231b63fbec7e8a1aae1d73fd (diff)
downloadgnome-bluetooth-6c6b73618be165281785370414c0c5f826099535.tar.gz
Move AgentError to the shared BluetoothAgent
So we can use it in the wizard as well.
Diffstat (limited to 'lib')
-rw-r--r--lib/bluetooth-agent.c27
-rw-r--r--lib/bluetooth-agent.h10
2 files changed, 37 insertions, 0 deletions
diff --git a/lib/bluetooth-agent.c b/lib/bluetooth-agent.c
index bdc20b66..b88520ca 100644
--- a/lib/bluetooth-agent.c
+++ b/lib/bluetooth-agent.c
@@ -528,3 +528,30 @@ void bluetooth_agent_set_cancel_func(BluetoothAgent *agent,
priv->cancel_func = func;
priv->cancel_data = data;
}
+
+GQuark bluetooth_agent_error_quark(void)
+{
+ static GQuark quark = 0;
+ if (!quark)
+ quark = g_quark_from_static_string("agent");
+
+ return quark;
+}
+
+#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
+
+GType bluetooth_agent_error_get_type(void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ ENUM_ENTRY(AGENT_ERROR_REJECT, "Rejected"),
+ { 0, 0, 0 }
+ };
+
+ etype = g_enum_register_static("agent", values);
+ }
+
+ return etype;
+}
+
diff --git a/lib/bluetooth-agent.h b/lib/bluetooth-agent.h
index bc861f50..a212ab51 100644
--- a/lib/bluetooth-agent.h
+++ b/lib/bluetooth-agent.h
@@ -88,6 +88,16 @@ void bluetooth_agent_set_authorize_func(BluetoothAgent *agent,
void bluetooth_agent_set_cancel_func(BluetoothAgent *agent,
BluetoothAgentCancelFunc func, gpointer data);
+#define AGENT_ERROR (bluetooth_agent_error_quark())
+#define AGENT_ERROR_TYPE (bluetooth_agent_error_get_type())
+
+typedef enum {
+ AGENT_ERROR_REJECT
+} AgentError;
+
+GType bluetooth_agent_error_get_type(void);
+GQuark bluetooth_agent_error_quark(void);
+
G_END_DECLS
#endif /* __BLUETOOTH_AGENT_H */