diff options
-rw-r--r-- | applet/agent.c | 34 | ||||
-rw-r--r-- | lib/bluetooth-agent.c | 27 | ||||
-rw-r--r-- | lib/bluetooth-agent.h | 10 |
3 files changed, 37 insertions, 34 deletions
diff --git a/applet/agent.c b/applet/agent.c index 948ccc03..64fbf813 100644 --- a/applet/agent.c +++ b/applet/agent.c @@ -42,40 +42,6 @@ static BluetoothClient *client; static GtkTreeModel *adapter_model; -typedef enum { - AGENT_ERROR_REJECT -} AgentError; - -#define AGENT_ERROR (agent_error_quark()) - -#define AGENT_ERROR_TYPE (agent_error_get_type()) - -static GQuark 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 } - -static GType 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; -} - static GList *input_list = NULL; typedef struct input_data input_data; 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 */ |