#define E_KEYBOARD_SERVICE_BUS_NAME "org.tizen.keyboard"
#define E_KEYBOARD_SERVICE_NAVI_IFC_NAME "org.tizen.KBGestureNavigation"
#define E_KEYBOARD_SERVICE_NAVI_OBJ_PATH "/org/tizen/KBGestureNavigation"
-static Eldbus_Connection *conn = NULL;
+static Eldbus_Connection *eldbus_conn = NULL;
typedef enum _Gesture {
ONE_FINGER_HOVER = 0,
ONE_FINGER_SINGLE_TAP = 15,
void gestures_tracker_register()
{
- Eldbus_Object *obj;
- Eldbus_Proxy *proxy;
-
- eldbus_init();
- LOGD("Registering callback for GestureDetected signal");
- if (!(conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION))) {
- LOGD("Error: Unable to get session bus");
- return;
- }
- obj = eldbus_object_get(conn, E_KEYBOARD_SERVICE_BUS_NAME, E_KEYBOARD_SERVICE_NAVI_OBJ_PATH);
- if (!obj) LOGD("Error: Getting object failed");
-
- proxy = eldbus_proxy_get(obj, E_KEYBOARD_SERVICE_NAVI_IFC_NAME);
- if (!proxy) LOGD("Error: Getting proxy failed");
- if (!eldbus_proxy_signal_handler_add(proxy, "KBGestureDetected", gesture_cb, NULL))
- LOGD("No signal handler returned");
- LOGD("Callback registration successful");
+ Eldbus_Object *obj;
+ Eldbus_Proxy *proxy;
+
+ eldbus_init();
+ LOGD("Registering callback for GestureDetected signal");
+ if (!(eldbus_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION))) {
+ LOGD("Error: Unable to get session bus");
return;
+ }
+ obj = eldbus_object_get(eldbus_conn, E_KEYBOARD_SERVICE_BUS_NAME, E_KEYBOARD_SERVICE_NAVI_OBJ_PATH);
+ if (!obj) LOGD("Error: Getting object failed");
+
+ proxy = eldbus_proxy_get(obj, E_KEYBOARD_SERVICE_NAVI_IFC_NAME);
+ if (!proxy) LOGD("Error: Getting proxy failed");
+ if (!eldbus_proxy_signal_handler_add(proxy, "KBGestureDetected", gesture_cb, NULL))
+ LOGD("No signal handler returned");
+ LOGD("Callback registration successful");
+ return;
}
void gestures_tracker_unregister()
{
- if (conn)
- eldbus_connection_unref(conn);
+ if (eldbus_conn) {
+ eldbus_connection_unref(eldbus_conn);
+ eldbus_conn = NULL;
+ }
- eldbus_shutdown();
+ eldbus_shutdown();
}
#endif
/**