[ISF_HAS_VCONF=yes],
[ISF_HAS_VCONF=no])
-# Check edbus library
-PKG_CHECK_MODULES(EDBUS, [edbus],
- [ISF_HAS_EDBUS=yes],
- [ISF_HAS_EDBUS=no])
-
# Check bluetooth library
PKG_CHECK_MODULES(BLUETOOTH, [capi-network-bluetooth],
[ISF_HAS_BLUETOOTH=yes],
AC_DEFINE(HAVE_FEEDBACK,1,[Have Feedback functions.])
fi
-if test "$ISF_HAS_EDBUS" = "yes"; then
- AC_DEFINE(HAVE_EDBUS,1,[Have edbus functions.])
-fi
-
if test "$ISF_HAS_NOTIFICATION" = "yes" && test "$enable_notification" = "yes"; then
AC_DEFINE(HAVE_NOTIFICATION,1,[Have Notification functions.])
fi
#include <notification.h>
#include <notification_internal.h>
#endif
-#ifdef HAVE_EDBUS
-#include <E_DBus.h>
-#endif
#ifdef HAVE_BLUETOOTH
#include <bluetooth.h>
#endif
#define ISF_KEYBOARD_ICON_FILE (SCIM_ICONDIR "/noti_keyboard_connected.png")
#define ISF_ISE_SELECTOR_ICON_FILE "/noti_keyboard.png"
-#define HOST_BUS_NAME "org.tizen.usb.host"
-#define HOST_OBJECT_PATH "/Org/Tizen/Usb/Host"
-#define HOST_INTERFACE_NAME "org.tizen.usb.host"
-#define HOST_KEYBOARD_SIGNAL "usbkeyboard"
-#define HOST_ADDED "added"
-#define HOST_REMOVED "removed"
-
#define E_PROP_DEVICEMGR_INPUTWIN "DeviceMgr Input Window"
#endif
#endif /* CANDIDATE */
-#ifdef HAVE_EDBUS
-static E_DBus_Connection *edbus_conn;
-static E_DBus_Signal_Handler *edbus_handler;
-#endif
-
#if ENABLE_REMOTE_INPUT
static Remote_Input* remote_input_impl = NULL;
static bool launch_remote_input = false;
return ret;
}
-#ifdef HAVE_EDBUS
-static void usb_keyboard_signal_cb (void *data, DBusMessage *msg)
-{
- DBusError err;
- char *str = NULL;
-
- if (!msg) {
- LOGW ("No Message");
- return;
- }
-
- if (dbus_message_is_signal (msg, HOST_INTERFACE_NAME, HOST_KEYBOARD_SIGNAL) == 0) {
- LOGW ("HOST_KEYBOARD_SIGNAL");
- return;
- }
-
- dbus_error_init (&err);
-
- if (dbus_message_get_args (msg, &err, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID) == 0) {
- LOGW ("DBUS_TYPE_INVALID");
- return;
- }
-
- if (!str) return;
-
- if (!strncmp (str, HOST_ADDED, strlen (HOST_ADDED))) {
- LOGD ("HOST_ADDED");
- return;
- }
-
- if (!strncmp (str, HOST_REMOVED, strlen (HOST_REMOVED))) {
- LOGD ("HOST_REMOVED");
- if (_info_manager->get_current_toolbar_mode () == TOOLBAR_KEYBOARD_MODE) {
- change_keyboard_mode (TOOLBAR_HELPER_MODE);
- }
- return;
- }
-
- LOGW ("ERROR: msg (%s) is improper", str);
-}
-
-static void unregister_edbus_signal_handler (void)
-{
- if (edbus_conn) {
- LOGD ("unregister signal handler for keyboard");
- if (edbus_handler) {
- e_dbus_signal_handler_del (edbus_conn, edbus_handler);
- edbus_handler = NULL;
- }
- e_dbus_connection_close (edbus_conn);
- edbus_conn = NULL;
- }
- e_dbus_shutdown ();
-}
-
-static int register_edbus_signal_handler (void)
-{
- int retry;
-
- retry = 0;
- while (e_dbus_init () == 0) {
- retry++;
- if (retry >= 10) {
- return -1;
- }
- }
-
- edbus_conn = e_dbus_bus_get (DBUS_BUS_SYSTEM);
- if (!edbus_conn) {
- LOGW ("edbus connection fail");
- return -1;
- }
-
- edbus_handler = e_dbus_signal_handler_add (edbus_conn, NULL, HOST_OBJECT_PATH, HOST_INTERFACE_NAME, HOST_KEYBOARD_SIGNAL, usb_keyboard_signal_cb, NULL);
- if (!edbus_handler) {
- LOGW ("cannot register signal");
- return -1;
- }
-
- LOGD ("Success edbus register");
-
- return 0;
-}
-#endif
-
#ifdef HAVE_NOTIFICATION
static void delete_notification (NotificationData *noti_data)
{
vconf_notify_key_changed (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, keyboard_mode_changed_cb, NULL);
#endif
-#ifdef HAVE_EDBUS
- if (0 != register_edbus_signal_handler ())
- LOGW ("register edbus signal fail");
-#endif
-
try {
/* Update ISE list */
std::vector<String> list;
#endif
#endif
-#ifdef HAVE_EDBUS
- unregister_edbus_signal_handler ();
-#endif
-
if (_info_manager) {
try {
_info_manager->stop ();