2 * Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 #include <rpc-port/rpc-port.h>
26 #include "interface/mmifw_proxy.h"
31 int MMI_EVENT_STATE_CHANGE;
32 int MMI_EVENT_WAKE_UP;
34 int MMI_EVENT_GESTURE;
37 int MMI_EVENT_FEEDBACK;
39 rpc_port_proxy_mmifw_h rpc_h;
41 static int _mmi_init_count = 0;
46 if (++_mmi_init_count != 1)
47 return _mmi_init_count;
51 MMI_EVENT_FOCUS = ecore_event_type_new();
52 MMI_EVENT_STATE_CHANGE = ecore_event_type_new();
53 MMI_EVENT_WAKE_UP = ecore_event_type_new();
54 MMI_EVENT_KEY = ecore_event_type_new();
55 MMI_EVENT_GESTURE = ecore_event_type_new();
56 MMI_EVENT_VOICE = ecore_event_type_new();
57 MMI_EVENT_ACTION = ecore_event_type_new();
58 MMI_EVENT_FEEDBACK = ecore_event_type_new();
60 return _mmi_init_count;
63 return --_mmi_init_count;
69 if (_mmi_init_count <= 0)
71 ERR("Init count must be greater than 0.");
78 MMI_EVENT_STATE_CHANGE = -1;
79 MMI_EVENT_WAKE_UP = -1;
81 MMI_EVENT_GESTURE = -1;
83 MMI_EVENT_ACTION = -1;
84 MMI_EVENT_FEEDBACK = -1;
87 return _mmi_init_count;
91 mmi_instance_create(const char *app_id)
100 MMIFW_API mmi_event_listener *
101 mmi_event_add_listener(mmi_handle h, int ev_type, mmi_event_handler_cb func, const void *data)
103 mmi_event_listener *listener;
114 mmi_request_send_get_focus(mmi_handle h)
124 mmi_state_get_current_state(mmi_handle h)
134 mmi_request_send_set_state(mmi_handle h, mmi_state state)
145 mmi_event_remove_listener(mmi_handle h, mmi_event_listener *listener)
154 mmi_event_remove_all_listeners(mmi_handle h)
160 mmi_instance_destroy(mmi_handle h)