[gnome-bluetooth] lib: Simplify pairing agent API



commit 629574947fe5ef7921a2f280fea58bdd63cc15a3
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 3 15:57:11 2013 +0100

    lib: Simplify pairing agent API

 lib/bluetooth-agent.h |   89 ++++++++++++++++++++++++++++--------------------
 1 files changed, 52 insertions(+), 37 deletions(-)
---
diff --git a/lib/bluetooth-agent.h b/lib/bluetooth-agent.h
index 6f0d5e6..9a90196 100644
--- a/lib/bluetooth-agent.h
+++ b/lib/bluetooth-agent.h
@@ -61,51 +61,66 @@ gboolean bluetooth_agent_setup(BluetoothAgent *agent, const char *path);
 gboolean bluetooth_agent_register(BluetoothAgent *agent);
 gboolean bluetooth_agent_unregister(BluetoothAgent *agent);
 
-typedef gboolean (*BluetoothAgentPasskeyFunc) (GDBusMethodInvocation *invocation,
-                                              GDBusProxy *device, gpointer data);
-typedef gboolean (*BluetoothAgentDisplayFunc) (GDBusMethodInvocation *invocation,
-                                       GDBusProxy *device, guint passkey,
-                                               guint entered, gpointer data);
-typedef gboolean (*BluetoothAgentDisplayPinCodeFunc) (GDBusMethodInvocation *invocation,
-                                                     GDBusProxy *device, const char *pincode,
-                                                     gpointer data);
-typedef gboolean (*BluetoothAgentConfirmFunc) (GDBusMethodInvocation *invocation,
-                                       GDBusProxy *device, guint passkey,
-                                                               gpointer data);
-typedef gboolean (*BluetoothAgentAuthorizeFunc) (GDBusMethodInvocation *invocation,
-                                 GDBusProxy *device, gpointer data);
-typedef gboolean (*BluetoothAgentAuthorizeServiceFunc) (GDBusMethodInvocation *invocation,
-                                       GDBusProxy *device, const char *uuid,
-                                                               gpointer data);
+typedef void (*BluetoothAgentPasskeyFunc) (GDBusMethodInvocation *invocation,
+                                          GDBusProxy            *device,
+                                          gpointer               data);
+typedef void (*BluetoothAgentDisplayFunc) (GDBusMethodInvocation *invocation,
+                                          GDBusProxy            *device,
+                                          guint                  passkey,
+                                          guint                  entered,
+                                          gpointer               data);
+typedef void (*BluetoothAgentDisplayPinCodeFunc) (GDBusMethodInvocation *invocation,
+                                                 GDBusProxy            *device,
+                                                 const char            *pincode,
+                                                 gpointer               data);
+typedef void (*BluetoothAgentConfirmFunc) (GDBusMethodInvocation *invocation,
+                                          GDBusProxy            *device,
+                                          guint                  passkey,
+                                          gpointer               data);
+typedef void (*BluetoothAgentAuthorizeFunc) (GDBusMethodInvocation *invocation,
+                                            GDBusProxy            *device,
+                                            gpointer               data);
+typedef void (*BluetoothAgentAuthorizeServiceFunc) (GDBusMethodInvocation *invocation,
+                                                   GDBusProxy            *device,
+                                                   const char            *uuid,
+                                                   gpointer               data);
 typedef gboolean (*BluetoothAgentCancelFunc) (GDBusMethodInvocation *invocation,
-                                                               gpointer data);
-
-void bluetooth_agent_set_pincode_func(BluetoothAgent *agent,
-                               BluetoothAgentPasskeyFunc func, gpointer data);
-void bluetooth_agent_set_passkey_func(BluetoothAgent *agent,
-                               BluetoothAgentPasskeyFunc func, gpointer data);
-void bluetooth_agent_set_display_func(BluetoothAgent *agent,
-                               BluetoothAgentDisplayFunc func, gpointer data);
-void bluetooth_agent_set_display_pincode_func(BluetoothAgent *agent,
-                               BluetoothAgentDisplayPinCodeFunc func, gpointer data);
-void bluetooth_agent_set_confirm_func(BluetoothAgent *agent,
-                               BluetoothAgentConfirmFunc func, gpointer data);
-void bluetooth_agent_set_authorize_func(BluetoothAgent *agent,
-                               BluetoothAgentAuthorizeFunc func, gpointer data);
-void bluetooth_agent_set_authorize_service_func(BluetoothAgent *agent,
-                               BluetoothAgentAuthorizeServiceFunc func, gpointer data);
-void bluetooth_agent_set_cancel_func(BluetoothAgent *agent,
-                               BluetoothAgentCancelFunc func, gpointer data);
+                                             gpointer               data);
+
+void bluetooth_agent_set_pincode_func (BluetoothAgent            *agent,
+                                      BluetoothAgentPasskeyFunc  func,
+                                      gpointer                   data);
+void bluetooth_agent_set_passkey_func (BluetoothAgent            *agent,
+                                      BluetoothAgentPasskeyFunc  func,
+                                      gpointer                   data);
+void bluetooth_agent_set_display_func (BluetoothAgent            *agent,
+                                      BluetoothAgentDisplayFunc  func,
+                                      gpointer                   data);
+void bluetooth_agent_set_display_pincode_func (BluetoothAgent                   *agent,
+                                              BluetoothAgentDisplayPinCodeFunc  func,
+                                              gpointer                          data);
+void bluetooth_agent_set_confirm_func (BluetoothAgent            *agent,
+                                      BluetoothAgentConfirmFunc  func,
+                                      gpointer                   data);
+void bluetooth_agent_set_authorize_func (BluetoothAgent              *agent,
+                                        BluetoothAgentAuthorizeFunc  func,
+                                        gpointer                     data);
+void bluetooth_agent_set_authorize_service_func (BluetoothAgent                     *agent,
+                                                BluetoothAgentAuthorizeServiceFunc  func,
+                                                gpointer                            data);
+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()) 
+#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);
+GType  bluetooth_agent_error_get_type (void);
+GQuark bluetooth_agent_error_quark    (void);
 
 G_END_DECLS
 


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