Refactor input/output interface 74/281574/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Tue, 6 Sep 2022 06:21:45 +0000 (15:21 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Tue, 20 Sep 2022 04:14:42 +0000 (13:14 +0900)
- Requirement:
mmi_core needs to control the data and flow between input modality,
output modality, and IU module.

- Solution:
This patch removes mmi-iu-bridge module and move the code from
mmi-iu-bridge to mmi-core module. And also, this patch adds new event
type for screen analyzer modality and voice touch event.

Change-Id: I6a75870a1d398c927872993e04d1f56d7d514c9f
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/mmimgr/meson.build
src/mmimgr/mmi-common.c
src/mmimgr/mmi-common.h
src/mmimgr/mmi-core.c
src/mmimgr/mmi-core.h
src/mmimgr/mmi-iu-bridge.c [deleted file]
src/mmimgr/mmi-iu-bridge.h [deleted file]
src/mmimgr/mmi-manager.c
src/mmimgr/mmi-provider.c

index 17590fa..56622bf 100644 (file)
@@ -16,8 +16,6 @@ mmimgr_srcs = [
        'mmi-fusion.h',
        'mmi-fusion-iface.h',
        'mmi-manager-dbg.h',
-       'mmi-iu-bridge.c',
-       'mmi-iu-bridge.h',
        'mmi_stub.h',
        'mmi_stub.c',
        'iu/input_intent.cpp',
index fc0ddd9..4cde852 100644 (file)
@@ -30,6 +30,8 @@ MMI_API int MMI_PROVIDER_EVENT_KEY = -1;
 MMI_API int MMI_PROVIDER_EVENT_GESTURE = -1;
 MMI_API int MMI_PROVIDER_EVENT_VOICE = -1;
 MMI_API int MMI_PROVIDER_EVENT_VISION = -1;
+MMI_API int MMI_PROVIDER_EVENT_SCREEN_ANALYZER = -1;
+MMI_API int MMI_PROVIDER_EVENT_VOICE_TOUCH = -1;
 MMI_API int MMI_VISION_EVENT_PROPAGATE = -1;
 MMI_API int MMI_VISION_EVENT_DROP = -1;
 MMI_API int MMI_VISION_EVENT_FINISH = -1;
index ad41e36..6938fe5 100644 (file)
@@ -25,6 +25,7 @@
 #define __MMI_COMMON_H__
 
 #include <stdbool.h>
+#include <glib.h>
 
 #ifndef MMI_API
 #define MMI_API __attribute__ ((visibility("default")))
@@ -34,11 +35,18 @@ MMI_API extern int MMI_PROVIDER_EVENT_KEY;
 MMI_API extern int MMI_PROVIDER_EVENT_GESTURE;
 MMI_API extern int MMI_PROVIDER_EVENT_VOICE;
 MMI_API extern int MMI_PROVIDER_EVENT_VISION;
+MMI_API extern int MMI_PROVIDER_EVENT_SCREEN_ANALYZER;
+MMI_API extern int MMI_PROVIDER_EVENT_VOICE_TOUCH;
 MMI_API extern int MMI_VISION_EVENT_PROPAGATE;
 MMI_API extern int MMI_VISION_EVENT_DROP;
 MMI_API extern int MMI_VISION_EVENT_FINISH;
 
 //TODO. not use mmi_vision_state, use mmi_event_vision_type
+typedef enum {
+       MMI_VOICE_TOUCH,
+       MMI_VOICE_RECOGNITION,
+} mmi_input_event_type_e;
+
 typedef enum mmi_vision_state
 {
     LIKE,
@@ -250,6 +258,28 @@ typedef struct
        char *source;//event source information
 } mmi_provider_event_vision;
 
+typedef struct
+{
+       int coord_x;
+       int coord_y;
+       int width;
+       int height;
+       char *object_id;
+       char *label;
+} clickable_item;
+
+typedef struct
+{
+       int type; // number, text, grid
+       int timestamp;
+       int duration;
+       double confidence;
+       int mode;
+       int grid_depth;
+       int n_items; //num of clickable_item
+       GList *list;  // clickable_item
+} mmi_provider_event_screen_analyzer;
+
 typedef unsigned long long ull;
 
 typedef enum mmi_state
index e75fca8..f769538 100644 (file)
 * DEALINGS IN THE SOFTWARE.
 */
 
+#include <Ecore.h>
+
+#include "mmi-manager.h"
+#include "mmi-manager-dbg.h"
+#include "iu/mmi_iu.h"
+
 #include "mmi-core.h"
 
-void
-mmi_core_init()
+#define APP_ID "org.tizen.test"
+
+enum event_handlers {
+       EVENT_HANDLER_FOCUS_CHANGE,
+       EVENT_HANDLER_STATE_CHANGE,
+       EVENT_HANDLER_KEY,
+       EVENT_HANDLER_GESTURE,
+       EVENT_HANDLER_VOICE,
+       EVENT_HANDLER_VISION,
+       EVENT_HANDLER_SCREEN_ANALYZER,
+       EVENT_HANDLER_MAX
+};
+
+static Ecore_Event_Handler *_event_handlers[EVENT_HANDLER_MAX];
+static mmi_client *g_client = NULL;
+
+static void output_result_received_cb(const char *app_id, const char *json_data, void *user_data)
+{
+       // TODO: implement
+}
+
+static void output_modality_received_cb(const char *app_id, int type, void *event, void *user_data)
+{
+       if (type == MMI_PROVIDER_EVENT_KEY) {
+               mmi_provider_event_key *key_event = (mmi_provider_event_key *)event;
+               key_event_arg arg;
+
+               arg.type = key_event->type;
+               arg.timestamp = key_event->timestamp;
+               arg.key_down = key_event->key_down;
+               arg.keycode = key_event->keycode;
+               arg.keyname = key_event->keyname;
+               arg.source = key_event->source;
+
+               client_manager_send_key_event(g_client, &arg);
+       }
+       else if (type == MMI_PROVIDER_EVENT_VOICE) {
+               mmi_provider_event_voice *voice_event = (mmi_provider_event_voice *)event;
+               voice_event_arg arg;
+
+               arg.type = voice_event->type;
+               arg.timestamp = voice_event->timestamp;
+               arg.source = voice_event->source;
+
+               client_manager_send_voice_event(g_client, &arg);
+       }
+       else if (type == MMI_PROVIDER_EVENT_GESTURE) {
+               mmi_provider_event_gesture *gesture_event = (mmi_provider_event_gesture *)event;
+               gesture_event_arg arg;
+
+               arg.type = gesture_event->type;
+               arg.timestamp = gesture_event->timestamp;
+               arg.source = gesture_event->source;
+
+               client_manager_send_gesture_event(g_client, &arg);
+       }
+       else if (type == MMI_PROVIDER_EVENT_VOICE_TOUCH) {
+               // TODO: implement
+       }
+}
+
+static Eina_Bool _focus_change_cb(void *data EINA_UNUSED, int type, void *event)
+{
+       mmi_manager_event_focus_change *ev = (mmi_manager_event_focus_change *)event;
+       _I("[focus change] cur focus : %p, new focus : %p", ev->cur_focus, ev->new_focus);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _state_change_cb(void *data EINA_UNUSED, int type, void *event)
+{
+       mmi_manager_event_state_change *ev = (mmi_manager_event_state_change *)event;
+       g_client = ev->client;
+
+       _I("state : %d", ev->to_state);
+       mmi_iu_set_app_state(ev->to_state);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _key_event_cb(void *data EINA_UNUSED, int type, void *event)
 {
+       mmi_provider_event_key *ev = (mmi_provider_event_key *)event;
+       _I("[key event] code : %d, name : %s, type : %d, timestamp : %d, source: %s", ev->keycode, ev->keyname, ev->type, ev->timestamp, ev->source);
+
+       if (ev->key_down) {
+               mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_KEY, ev);
+       }
+
+       return ECORE_CALLBACK_PASS_ON;
 }
 
-void
-mmi_core_shutdown()
+static Eina_Bool _gesture_event_cb(void *data EINA_UNUSED, int type, void *event)
 {
+       mmi_provider_event_gesture *ev = (mmi_provider_event_gesture *)event;
+       _I("[gesture event] type : %d, timestamp : %d", ev->type, ev->timestamp);
+
+       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_GESTURE, ev);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _voice_event_cb(void *data EINA_UNUSED, int type, void *event)
+{
+       mmi_provider_event_voice *ev = (mmi_provider_event_voice *)event;
+       _I("[voice event] type : %d, timestamp : %d", ev->type, ev->timestamp);
+
+       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_VOICE, ev);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _vision_event_cb(void *data EINA_UNUSED, int type, void *event)
+{
+       mmi_provider_event_vision *ev = (mmi_provider_event_vision *)event;
+
+       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_VISION, ev);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool _screen_analyzer_event_cb(void *data EINA_UNUSED, int type, void *event)
+{
+       mmi_provider_event_screen_analyzer *ev = (mmi_provider_event_screen_analyzer *)event;
+       _I("[Screen analyzer] Number of items : %d, type : %d, timestamp : %d", ev->n_items, ev->type, ev->timestamp);
+
+       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_SCREEN_ANALYZER, ev);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+static void shutdown_event_handler()
+{
+       _I("Shutdown event handlers");
+       for (int i = 0; i < EVENT_HANDLER_MAX; i++) {
+               if (_event_handlers[i]) {
+                       ecore_event_handler_del(_event_handlers[i]);
+                       _event_handlers[i] = NULL;
+               }
+       }
+}
+
+static void init_event_handler()
+{
+       _I("Initialize event handlers");
+       _event_handlers[EVENT_HANDLER_FOCUS_CHANGE] = ecore_event_handler_add(MMI_MANAGER_EVENT_FOCUS_CHANGE,
+                               _focus_change_cb, NULL);
+       _event_handlers[EVENT_HANDLER_STATE_CHANGE] = ecore_event_handler_add(MMI_MANAGER_EVENT_STATE_CHANGE,
+                               _state_change_cb, NULL);
+
+       _event_handlers[EVENT_HANDLER_KEY] = ecore_event_handler_add(MMI_PROVIDER_EVENT_KEY,
+                               _key_event_cb, NULL);
+       _event_handlers[EVENT_HANDLER_GESTURE] = ecore_event_handler_add(MMI_PROVIDER_EVENT_GESTURE,
+                               _gesture_event_cb, NULL);
+       _event_handlers[EVENT_HANDLER_VOICE] = ecore_event_handler_add(MMI_PROVIDER_EVENT_VOICE,
+                               _voice_event_cb, NULL);
+       _event_handlers[EVENT_HANDLER_VISION] = ecore_event_handler_add(MMI_PROVIDER_EVENT_VISION,
+                               _vision_event_cb, NULL);
+       _event_handlers[EVENT_HANDLER_SCREEN_ANALYZER] = ecore_event_handler_add(MMI_PROVIDER_EVENT_SCREEN_ANALYZER,
+                               _screen_analyzer_event_cb, NULL);
+}
+
+int mmi_core_init()
+{
+       _I("Initialize MMI core module");
+       int ret = MMI_IU_ERROR_NONE;
+       ret = mmi_iu_init();
+       if (ret != MMI_IU_ERROR_NONE) {
+               _E("Fail to init IU. ret(%d)", ret);
+               return ret;
+       }
+
+       init_event_handler();
+
+       ret = mmi_iu_set_output_intent_received_callback(output_result_received_cb, NULL);
+       if (ret != MMI_IU_ERROR_NONE) {
+               _E("Error code : %d", ret);
+               return ret;
+       }
+
+       ret = mmi_iu_set_output_event_received_callback(output_modality_received_cb, NULL);
+       if (ret != MMI_IU_ERROR_NONE) {
+               _E("Error code : %d", ret);
+               return ret;
+       }
+
+       return ret;
+}
+
+int mmi_core_shutdown()
+{
+       _I("Shutdown MMI core module");
+       shutdown_event_handler();
+
+       int ret = mmi_iu_shutdown();
+       return ret;
 }
 
index b899a2a..aa7272c 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __MMI_CORE_H__
 #define __MMI_CORE_H__
 
-void mmi_core_init(void);
-void mmi_core_shutdown(void);
+int mmi_core_init(void);
+int mmi_core_shutdown(void);
 
 #endif //__MMI_CORE_H__
diff --git a/src/mmimgr/mmi-iu-bridge.c b/src/mmimgr/mmi-iu-bridge.c
deleted file mode 100644 (file)
index 797359b..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#include <Ecore.h>
-#include <json-glib/json-glib.h>
-
-#include "mmi-manager.h"
-#include "iu/mmi_iu_log.h"
-#include "iu/mmi_iu.h"
-
-#define APP_ID "org.tizen.test"
-
-enum event_handlers {
-       EVENT_HANDLER_FOCUS_CHANGE,
-       EVENT_HANDLER_STATE_CHANGE,
-       EVENT_HANDLER_KEY,
-       EVENT_HANDLER_GESTURE,
-       EVENT_HANDLER_VOICE,
-       EVENT_HANDLER_VISION,
-       EVENT_HANDLER_MAX
-};
-
-static Ecore_Event_Handler *_event_handlers[EVENT_HANDLER_MAX];
-static mmi_client *g_client = NULL;
-
-static void output_intent_received_cb(const char *app_id, const char *json_data, void *user_data)
-{
-       JsonParser *parser = json_parser_new();
-       GError *err_msg = NULL;
-       JsonNode *root = NULL;
-       JsonObject *root_obj = NULL;
-       const gchar *action = NULL;
-
-       action_event_arg arg;
-       arg.timestamp = ecore_time_get();
-       char* arr[1] = { "Action" };
-       arg.cmd = NULL;
-       arg.args = arr;
-       arg.nargs = 1;
-       arg.source = NULL;
-
-       json_parser_load_from_data(parser, (char *)json_data, -1, &err_msg);
-       if (err_msg) {
-               LOGE("failed to load json file. error message: %s\n", err_msg->message);
-               goto cleanup;
-       }
-
-       root = json_parser_get_root(parser);
-       if (root == NULL) {
-               LOGE("failed to get root\n");
-               goto cleanup;
-       }
-
-       root_obj = json_node_get_object(root);
-       if (root_obj == NULL) {
-               LOGE("failed to get object\n");
-               goto cleanup;
-       }
-
-       action = json_object_get_string_member(root_obj, "Action");
-       LOGD("Action: %s\n", action);
-
-       if (action) {
-               if (strcmp(action, "WakeUp") == 0) {
-                       wakeup_event_arg arg;
-                       arg.type = MMI_EVENT_WAKEUP_TYPE_WAKEUP;
-                       arg.source = NULL;
-                       arg.timestamp = ecore_time_get();
-
-                       client_manager_send_wakeup_event(g_client, &arg);
-               }
-               else if (strcmp(action, "Execute") == 0) {
-                       arg.type = MMI_EVENT_ACTION_TYPE_EXECUTE;
-                       client_manager_send_action_event(g_client, &arg);
-               }
-               else if (strcmp(action, "Play") == 0) {
-                       arg.type = MMI_EVENT_ACTION_TYPE_PLAY;
-                       client_manager_send_action_event(g_client, &arg);
-               }
-               else if (strcmp(action, "Cancel") == 0) {
-                       arg.type = MMI_EVENT_ACTION_TYPE_CANCEL;
-                       client_manager_send_action_event(g_client, &arg);
-               }
-               else if (strcmp(action, "Pause") == 0) {
-                       arg.type = MMI_EVENT_ACTION_TYPE_PAUSE;
-                       client_manager_send_action_event(g_client, &arg);
-               }
-               else if (strcmp(action, "Stop") == 0) {
-                       arg.type = MMI_EVENT_ACTION_TYPE_STOP;
-                       client_manager_send_action_event(g_client, &arg);
-               }
-       }
-
-cleanup:
-       if (err_msg)
-               g_error_free(err_msg);
-
-       if (parser)
-               g_object_unref(parser);
-}
-
-static void output_event_received_cb(const char *app_id, int type, void *event, void *user_data)
-{
-       if (type == MMI_PROVIDER_EVENT_KEY) {
-               mmi_provider_event_key *key_event = (mmi_provider_event_key *)event;
-               key_event_arg arg;
-
-               arg.type = key_event->type;
-               arg.timestamp = key_event->timestamp;
-               arg.key_down = key_event->key_down;
-               arg.keycode = key_event->keycode;
-               arg.keyname = key_event->keyname;
-               arg.source = key_event->source;
-
-               client_manager_send_key_event(g_client, &arg);
-       }
-       else if (type == MMI_PROVIDER_EVENT_VOICE) {
-               mmi_provider_event_voice *voice_event = (mmi_provider_event_voice *)event;
-               voice_event_arg arg;
-
-               arg.type = voice_event->type;
-               arg.timestamp = voice_event->timestamp;
-               arg.source = voice_event->source;
-
-               client_manager_send_voice_event(g_client, &arg);
-       }
-       else if (type == MMI_PROVIDER_EVENT_GESTURE) {
-               mmi_provider_event_gesture *gesture_event = (mmi_provider_event_gesture *)event;
-               gesture_event_arg arg;
-
-               arg.type = gesture_event->type;
-               arg.timestamp = gesture_event->timestamp;
-               arg.source = gesture_event->source;
-
-               client_manager_send_gesture_event(g_client, &arg);
-       }
-}
-
-static Eina_Bool
-_focus_change_cb(void *data EINA_UNUSED, int type, void *event)
-{
-       mmi_manager_event_focus_change *ev = (mmi_manager_event_focus_change *)event;
-
-       LOGI("[focus change] cur focus : %p, new focus : %p", ev->cur_focus, ev->new_focus);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_state_change_cb(void *data EINA_UNUSED, int type, void *event)
-{
-       mmi_manager_event_state_change *ev = (mmi_manager_event_state_change *)event;
-       g_client = ev->client;
-
-       LOGI("state : %d", ev->to_state);
-       mmi_iu_set_app_state(ev->to_state);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_key_event_cb(void *data EINA_UNUSED, int type, void *event)
-{
-       mmi_provider_event_key *ev = (mmi_provider_event_key *)event;
-
-       LOGI("[key event] code : %d, name : %s, type : %d, timestamp : %d, source: %s", ev->keycode, ev->keyname, ev->type, ev->timestamp, ev->source);
-
-       if (ev->key_down) {
-               mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_KEY, ev);
-       }
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_gesture_event_cb(void *data EINA_UNUSED, int type, void *event)
-{
-       mmi_provider_event_gesture *ev = (mmi_provider_event_gesture *)event;
-
-       LOGI("[gesture event] type : %d, timestamp : %d", ev->type, ev->timestamp);
-
-       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_GESTURE, ev);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_voice_event_cb(void *data EINA_UNUSED, int type, void *event)
-{
-       mmi_provider_event_voice *ev = (mmi_provider_event_voice *)event;
-
-       LOGI("[voice event] type : %d, timestamp : %d", ev->type, ev->timestamp);
-
-       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_VOICE, ev);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_vision_event_cb(void *data EINA_UNUSED, int type, void *event)
-{
-       mmi_provider_event_vision *ev = (mmi_provider_event_vision *)event;
-
-       mmi_iu_feed_input_event(APP_ID, MMI_PROVIDER_EVENT_KEY, ev);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static void
-init_event_handler()
-{
-       _event_handlers[EVENT_HANDLER_FOCUS_CHANGE] = ecore_event_handler_add(MMI_MANAGER_EVENT_FOCUS_CHANGE,
-                               _focus_change_cb, NULL);
-       _event_handlers[EVENT_HANDLER_STATE_CHANGE] = ecore_event_handler_add(MMI_MANAGER_EVENT_STATE_CHANGE,
-                               _state_change_cb, NULL);
-
-       _event_handlers[EVENT_HANDLER_KEY] = ecore_event_handler_add(MMI_PROVIDER_EVENT_KEY,
-                               _key_event_cb, NULL);
-       _event_handlers[EVENT_HANDLER_GESTURE] = ecore_event_handler_add(MMI_PROVIDER_EVENT_GESTURE,
-                               _gesture_event_cb, NULL);
-       _event_handlers[EVENT_HANDLER_VOICE] = ecore_event_handler_add(MMI_PROVIDER_EVENT_VOICE,
-                               _voice_event_cb, NULL);
-       _event_handlers[EVENT_HANDLER_VISION] = ecore_event_handler_add(MMI_PROVIDER_EVENT_VISION,
-                               _vision_event_cb, NULL);
-}
-
-static void
-shutdown_event_handler()
-{
-       for (int i=0; i<EVENT_HANDLER_MAX; i++) {
-               if (_event_handlers[i]) {
-                       ecore_event_handler_del(_event_handlers[i]);
-                       _event_handlers[i] = NULL;
-               }
-       }
-}
-
-int mmi_iu_bridge_init()
-{
-       int ret;
-
-       mmi_iu_init();
-
-       init_event_handler();
-
-       ret = mmi_iu_set_output_intent_received_callback(output_intent_received_cb, NULL);
-       if (ret != MMI_IU_ERROR_NONE) {
-               LOGE("Error code : %d", ret);
-               return ret;
-       }
-
-       ret = mmi_iu_set_output_event_received_callback(output_event_received_cb, NULL);
-       if (ret != MMI_IU_ERROR_NONE) {
-               LOGE("Error code : %d", ret);
-               return ret;
-       }
-
-       return ret;
-}
-
-int mmi_iu_bridge_shutdown()
-{
-       shutdown_event_handler();
-
-       int ret = mmi_iu_shutdown();
-       return ret;
-}
-
diff --git a/src/mmimgr/mmi-iu-bridge.h b/src/mmimgr/mmi-iu-bridge.h
deleted file mode 100644 (file)
index 25994ea..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef __MMI_IU_BRIDGE_H__
-#define __MMI_IU_BRIDGE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int mmi_iu_bridge_init();
-int mmi_iu_bridge_shutdown();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__MMI_IU_BRIDGE_H__
index 88eb381..695d90c 100644 (file)
@@ -28,7 +28,6 @@
 #include "mmi-common.h"
 #include "mmi-manager-dbg.h"
 #include "mmi-api-handler.h"
-#include "mmi-iu-bridge.h"
 
 #include <Ecore.h>
 #include <Eina.h>
@@ -318,7 +317,6 @@ mmi_manager_init()
        client_manager_init();
        mmi_api_handler_init();
 
-       mmi_iu_bridge_init();
        _event_handler_init();
 
        _init_done = true;
@@ -359,7 +357,6 @@ mmi_manager_shutdown()
        _flush_all_event_type();
 
        _event_handler_shutdown();
-       mmi_iu_bridge_shutdown();
 
        mmi_api_handler_shutdown();
        client_manager_shutdown();
index 9350d89..f7d45ac 100644 (file)
@@ -33,7 +33,7 @@
 #include <string.h>
 
 Eina_List *_provider_list = NULL;
-Ecore_Event_Handler *_provider_event_handlers[4];
+Ecore_Event_Handler *_provider_event_handlers[5];
 
 static Eina_Bool
 _key_provider_event_cb(void *data EINA_UNUSED, int type, void *event)
@@ -100,6 +100,13 @@ _vision_provider_event_cb(void *data EINA_UNUSED, int type, void *event)
        return ECORE_CALLBACK_PASS_ON;
 }
 
+static Eina_Bool
+_screen_analyzer_provider_event_cb(void *data EINA_UNUSED, int type, void *event)
+{
+       // TOODO: implement
+       return ECORE_CALLBACK_PASS_ON;
+}
+
 int
 mmi_provider_set_op_mode_on_caps(unsigned long long caps, mmi_provider_op_mode mode)
 {
@@ -254,6 +261,7 @@ _event_handler_init()
        MMI_PROVIDER_EVENT_GESTURE = ecore_event_type_new();
        MMI_PROVIDER_EVENT_VOICE = ecore_event_type_new();
        MMI_PROVIDER_EVENT_VISION = ecore_event_type_new();
+       MMI_PROVIDER_EVENT_SCREEN_ANALYZER = ecore_event_type_new();
        MMI_VISION_EVENT_PROPAGATE = ecore_event_type_new();
        MMI_VISION_EVENT_DROP = ecore_event_type_new();
        MMI_VISION_EVENT_FINISH = ecore_event_type_new();
@@ -262,6 +270,7 @@ _event_handler_init()
        LOGD("MMI_PROVIDER_EVENT_GESTURE=%d\n", MMI_PROVIDER_EVENT_GESTURE);
        LOGD("MMI_PROVIDER_EVENT_VOICE=%d\n", MMI_PROVIDER_EVENT_VOICE);
        LOGD("MMI_PROVIDER_EVENT_VISION=%d\n", MMI_PROVIDER_EVENT_VISION);
+       LOGD("MMI_PROVIDER_EVENT_SCREEN_ANALYZER=%d\n", MMI_PROVIDER_EVENT_SCREEN_ANALYZER);
 
        //For debugging
        _provider_event_handlers[0] = ecore_event_handler_add(MMI_PROVIDER_EVENT_KEY,
@@ -272,6 +281,8 @@ _event_handler_init()
                        _voice_provider_event_cb, NULL);
        _provider_event_handlers[3] = ecore_event_handler_add(MMI_PROVIDER_EVENT_VISION,
                        _vision_provider_event_cb, NULL);
+       _provider_event_handlers[4] = ecore_event_handler_add(MMI_PROVIDER_EVENT_SCREEN_ANALYZER,
+                       _screen_analyzer_provider_event_cb, NULL);
 }
 
 static void
@@ -282,20 +293,24 @@ _event_handler_shutdown()
        ecore_event_handler_del(_provider_event_handlers[1]);
        ecore_event_handler_del(_provider_event_handlers[2]);
        ecore_event_handler_del(_provider_event_handlers[3]);
+       ecore_event_handler_del(_provider_event_handlers[4]);
        _provider_event_handlers[0] = NULL;
        _provider_event_handlers[1] = NULL;
        _provider_event_handlers[2] = NULL;
        _provider_event_handlers[3] = NULL;
+       _provider_event_handlers[4] = NULL;
 
        MMI_PROVIDER_EVENT_KEY = -1;
        MMI_PROVIDER_EVENT_GESTURE = -1;
        MMI_PROVIDER_EVENT_VOICE = -1;
        MMI_PROVIDER_EVENT_VISION = -1;
+       MMI_PROVIDER_EVENT_SCREEN_ANALYZER = -1;
 
        LOGD("MMI_PROVIDER_EVENT_KEY=%d\n", MMI_PROVIDER_EVENT_KEY);
        LOGD("MMI_PROVIDER_EVENT_GESTURE=%d\n", MMI_PROVIDER_EVENT_GESTURE);
        LOGD("MMI_PROVIDER_EVENT_VOICE=%d\n", MMI_PROVIDER_EVENT_VOICE);
        LOGD("MMI_PROVIDER_EVENT_VISION=%d\n", MMI_PROVIDER_EVENT_VISION);
+       LOGD("MMI_PROVIDER_EVENT_SCREEN_ANALYZER=%d\n", MMI_PROVIDER_EVENT_SCREEN_ANALYZER);
 }
 
 void