#define SHORTCUT_IS_WIDGET_SIZE(size) (!!((size) & WIDGET_SIZE_DEFAULT))
#define REQUEST_ID_LEN 40
-EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
+static int __shortcut_init_ipc_process()
{
int ret;
- if (request_cb == NULL)
- return SHORTCUT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
-
ret = _dbus_init();
if (ret != SHORTCUT_ERROR_NONE) {
/* LCOV_EXCL_START */
/* LCOV_EXCL_STOP */
}
+ return SHORTCUT_ERROR_NONE;
+}
+
+EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
+{
+ int ret;
+
+ if (request_cb == NULL)
+ return SHORTCUT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
+
+ ret = __shortcut_init_ipc_process();
+ if (ret != SHORTCUT_ERROR_NONE)
+ return ret;
+
_set_request_cb(request_cb, data);
return SHORTCUT_ERROR_NONE;
if (remove_cb == NULL)
return SHORTCUT_ERROR_INVALID_PARAMETER;
- ret = _dbus_init();
- if (ret != SHORTCUT_ERROR_NONE) {
- /* LCOV_EXCL_START */
- SHORTCUT_ERR("Can't init dbus %d", ret);
- return ret;
- /* LCOV_EXCL_STOP */
- }
-
- ret = _dbus_signal_init();
- if (ret != SHORTCUT_ERROR_NONE) {
- /* LCOV_EXCL_START */
- SHORTCUT_ERR("Can't init dbus_signal %d", ret);
- return ret;
- /* LCOV_EXCL_STOP */
- }
-
- ret = _send_service_register();
- if (ret != SHORTCUT_ERROR_NONE) {
- /* LCOV_EXCL_START */
- SHORTCUT_ERR("Can't init ipc_monitor_register %d", ret);
- return ret;
- /* LCOV_EXCL_STOP */
- }
-
- ret = _dbus_set_watch_name();
- if (ret != SHORTCUT_ERROR_NONE) {
- /* LCOV_EXCL_START */
- SHORTCUT_ERR("Can't init _dbus_set_watch_name %d", ret);
+ ret = __shortcut_init_ipc_process();
+ if (ret != SHORTCUT_ERROR_NONE)
return ret;
- /* LCOV_EXCL_STOP */
- }
_set_remove_cb(remove_cb, data);