struct _mmi_client
{
- char *sender;
- uid_t uid;
- pid_t pid;
- mmi_state state;
+ char *sender;
+ uid_t uid;
+ pid_t pid;
+ mmi_state state;
+
+ rpc_port_focus_event_h focus_cb_h;
+ rpc_port_state_change_event_h state_change_cb_h;
+ rpc_port_wakeup_event_h wakeup_cb_h;
+ rpc_port_key_event_h key_cb_h;
+ rpc_port_gesture_event_h gesture_cb_h;
+ rpc_port_voice_event_h voice_cb_h;
+ rpc_port_action_event_h action_cb_h;
+ rpc_port_feedback_event_h feedback_cb_h;
};
Eina_Hash *_client_hash = NULL;
_init_done = false;
}
+
+void *
+client_manager_set_client_focus_cb_handle(mmi_client *client, void *focus_cb_h)
+{
+ int r;
+
+ if (!client || !focus_cb_h)
+ return NULL;
+
+ r = rpc_port_focus_event_clone(focus_cb_h, &client->focus_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone focus event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->focus_cb_h;
+}
+
+void *
+client_manager_get_client_focus_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->focus_cb_h;
+}
+
+
+void *
+client_manager_set_client_state_change_cb_handle(mmi_client *client, void *state_change_cb_h)
+{
+ int r;
+
+ if (!client || !state_change_cb_h)
+ return NULL;
+
+ r = rpc_port_state_change_event_clone(state_change_cb_h, &client->state_change_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone state_change event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->state_change_cb_h;
+}
+
+void *
+client_manager_get_client_state_change_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->state_change_cb_h;
+}
+
+void *
+client_manager_set_client_wakeup_cb_handle(mmi_client *client, void *wakeup_cb_h)
+{
+ int r;
+
+ if (!client || !wakeup_cb_h)
+ return NULL;
+
+ r = rpc_port_wakeup_event_clone(wakeup_cb_h, &client->wakeup_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone wakeup event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->wakeup_cb_h;
+}
+
+void *
+client_manager_get_client_wakeup_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->wakeup_cb_h;
+}
+
+void *
+client_manager_set_client_key_cb_handle(mmi_client *client, void *key_cb_h)
+{
+ int r;
+
+ if (!client || !key_cb_h)
+ return NULL;
+
+ r = rpc_port_key_event_clone(key_cb_h, &client->key_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone key event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->key_cb_h;
+}
+
+void *
+client_manager_get_client_key_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->key_cb_h;
+}
+
+void *
+client_manager_set_client_gesture_cb_handle(mmi_client *client, void *gesture_cb_h)
+{
+ int r;
+
+ if (!client || !gesture_cb_h)
+ return NULL;
+
+ r = rpc_port_gesture_event_clone(gesture_cb_h, &client->gesture_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone gesture event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->gesture_cb_h;
+}
+
+void *
+client_manager_get_client_gesture_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->gesture_cb_h;
+}
+
+void *
+client_manager_set_client_voice_cb_handle(mmi_client *client, void *voice_cb_h)
+{
+ int r;
+
+ if (!client || !voice_cb_h)
+ return NULL;
+
+ r = rpc_port_voice_event_clone(voice_cb_h, &client->voice_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone voice event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->voice_cb_h;
+}
+
+void *
+client_manager_get_client_voice_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->voice_cb_h;
+}
+
+void *
+client_manager_set_client_action_cb_handle(mmi_client *client, void *action_cb_h)
+{
+ int r;
+
+ if (!client || !action_cb_h)
+ return NULL;
+
+ r = rpc_port_action_event_clone(action_cb_h, &client->action_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone action event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->action_cb_h;
+}
+
+void *
+client_manager_get_client_action_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->action_cb_h;
+}
+
+void *
+client_manager_set_client_feedback_cb_handle(mmi_client *client, void *feedback_cb_h)
+{
+ int r;
+
+ if (!client || !feedback_cb_h)
+ return NULL;
+
+ r = rpc_port_feedback_event_clone(feedback_cb_h, &client->feedback_cb_h);
+ if (r)
+ {
+ LOGE("Failed to clone feedback event handle ! (error:%d)\n", r);
+ return NULL;
+ }
+
+ return client->feedback_cb_h;
+}
+
+void *
+client_manager_get_client_feedback_cb_handle(mmi_client *client)
+{
+ if (!client)
+ return NULL;
+
+ return client->feedback_cb_h;
+}
mmi_state client_manager_set_client_state(mmi_client *client, mmi_state state);
mmi_state client_manager_get_client_state(mmi_client *client);
+void *client_manager_set_client_focus_cb_handle(mmi_client *client, void *focus_cb_h);
+void *client_manager_get_client_focus_cb_handle(mmi_client *client);
+void *client_manager_set_client_state_change_cb_handle(mmi_client *client, void *state_change_cb_h);
+void *client_manager_get_client_state_change_cb_handle(mmi_client *client);
+void *client_manager_set_client_wakeup_cb_handle(mmi_client *client, void *wakeup_cb_h);
+void *client_manager_get_client_wakeup_cb_handle(mmi_client *client);
+void *client_manager_set_client_key_cb_handle(mmi_client *client, void *key_cb_h);
+void *client_manager_get_client_key_cb_handle(mmi_client *client);
+void *client_manager_set_client_gesture_cb_handle(mmi_client *client, void *gesture_cb_h);
+void *client_manager_get_client_gesture_cb_handle(mmi_client *client);
+void *client_manager_set_client_voice_cb_handle(mmi_client *client, void *voice_cb_h);
+void *client_manager_get_client_voice_cb_handle(mmi_client *client);
+void *client_manager_set_client_action_cb_handle(mmi_client *client, void *action_cb_h);
+void *client_manager_get_client_action_cb_handle(mmi_client *client);
+void *client_manager_set_client_feedback_cb_handle(mmi_client *client, void *feedback_cb_h);
+void *client_manager_get_client_feedback_cb_handle(mmi_client *client);
+
void client_manager_init(void);
void client_manager_shutdown(void);