mmi_client *_focus_client = NULL;
mmi_state _prev_state = MMI_STATE_NONE;
mmi_state _state = MMI_STATE_NONE;
-Ecore_Event_Handler *_event_handlers[2];
+Ecore_Event_Handler *_event_handlers;
static Eina_Bool
_focus_change_cb(void *data EINA_UNUSED, int type, void *event)
return ECORE_CALLBACK_PASS_ON;
}
-static Eina_Bool
-_state_change_cb(void *data EINA_UNUSED, int type, void *event)
-{
- int r;
- unsigned long long caps = MODALITY_PROVIDER_CAP_NONE;
-
- LOGI("...");
-
- mmi_manager_event_state_change *ev = (mmi_manager_event_state_change *)event;
-
- if (ev->client != _focus_client)
- {
- LOGE("Invalid state change event ! (client:%p, focus_client:%p)\n",
- ev->client, _focus_client);
- return ECORE_CALLBACK_PASS_ON;
- }
-
- if (_state != ev->from_state)
- {
- LOGE("Abnormal situation ! (_state=%d, ev->from_state=%d)\n", _state, ev->from_state);
- return ECORE_CALLBACK_PASS_ON;
- }
-
- if (ev->from_state != MMI_STATE_NONE)
- {
- //Set op_mode to MODALITY_PROVIDER_MODE_DROP_EVENT
- caps = state_caps[ev->from_state];
-
- r = mmi_provider_set_op_mode_on_caps(caps, MODALITY_PROVIDER_MODE_DROP_EVENT);
- if (r)
- {
- LOGE("Failed on setting op_mode(%d) on caps(%llu) !\n",
- MODALITY_PROVIDER_MODE_DROP_EVENT, caps);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
-
- if (ev->to_state != MMI_STATE_NONE)
- {
- //Set op_mode to MODALITY_PROVIDER_MODE_PROPAGATE_EVENT
- caps = state_caps[ev->from_state];
-
- r = mmi_provider_set_op_mode_on_caps(caps, MODALITY_PROVIDER_MODE_PROPAGATE_EVENT);
- if (r)
- {
- LOGE("Failed on setting op_mode(%d) on caps(%llu) !\n",
- MODALITY_PROVIDER_MODE_PROPAGATE_EVENT, caps);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
-
- _prev_state = _state;
- _state = ev->to_state;
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
static mmi_fusion_module_data *
ref_fusion_init(void)
{
ref_fusion_data->get_state = ref_fusion_get_state;
ref_fusion_data->set_state = ref_fusion_set_state;
- _event_handlers[0] = ecore_event_handler_add(MMI_MANAGER_EVENT_FOCUS_CHANGE,
+ _event_handlers = ecore_event_handler_add(MMI_MANAGER_EVENT_FOCUS_CHANGE,
_focus_change_cb, NULL);
- //_event_handlers[1] = ecore_event_handler_add(MMI_MANAGER_EVENT_STATE_CHANGE,
- // _state_change_cb, NULL);
return ref_fusion_data;
}
LOGD("ref_fusion_deinit\n");
- ecore_event_handler_del(_event_handlers[0]);
- ecore_event_handler_del(_event_handlers[1]);
+ ecore_event_handler_del(_event_handlers);
module_data->get_state = NULL;
module_data->set_state = NULL;