mmi-manager: add initial development environment 04/264004/1
authorSung-Jin Park <sj76.park@samsung.com>
Sun, 20 Jun 2021 17:14:10 +0000 (02:14 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 13 Sep 2021 11:23:26 +0000 (20:23 +0900)
Change-Id: If937bf743093ca7780a1f4d3c13be81ea1b7973d

27 files changed:
CODEOWNERS [new file with mode: 0644]
COPYING [new file with mode: 0644]
README.md
meson.build [new file with mode: 0644]
meson_options.txt [new file with mode: 0644]
packaging/mmi-manager.manifest [new file with mode: 0644]
packaging/mmi-manager.spec [new file with mode: 0644]
src/interface/mmifw_stub.c [new file with mode: 0644]
src/interface/mmifw_stub.h [new file with mode: 0644]
src/main.c [new file with mode: 0644]
src/meson.build [new file with mode: 0644]
src/mmi-api-handler.c [new file with mode: 0644]
src/mmi-api-handler.h [new file with mode: 0644]
src/mmi-client.c [new file with mode: 0644]
src/mmi-client.h [new file with mode: 0644]
src/mmi-core.c [new file with mode: 0644]
src/mmi-core.h [new file with mode: 0644]
src/mmi-fusion.c [new file with mode: 0644]
src/mmi-fusion.h [new file with mode: 0644]
src/mmi-manager.c [new file with mode: 0644]
src/mmi-manager.h [new file with mode: 0644]
src/mmi-provider.c [new file with mode: 0644]
src/mmi-provider.h [new file with mode: 0644]
tests/meson.build [new file with mode: 0644]
tests/mmi-manager-tests.cpp [new file with mode: 0644]
tests/mmi-manager-tests.h [new file with mode: 0644]
tidl/mmifw.tidl [new file with mode: 0644]

diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644 (file)
index 0000000..647c677
--- /dev/null
@@ -0,0 +1,5 @@
+# These owners will be the default owners for everything in
+# the repo. Unless a later match takes precedence,
+# @global-owner1 and @global-owner2 will be requested for
+# review when someone opens a pull request.
+*       @gl77-lee @dyamy-lee @sj76-park @duna-oh @ulgal-park
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..921be60
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,21 @@
+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.
+
index 9a131ee..fda4ccb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1 +1,37 @@
-# mmi-manager
\ No newline at end of file
+# MMI(Multi-modal Interaction) Manager  
+  
+[Source Tree]  
+.  
+├── CODEOWNERS  
+├── COPYING  
+├── meson.build  
+├── meson_options.txt  
+├── packaging  
+│   ├── mmi-manager.manifest  
+│   └── mmi-manager.spec  
+├── README.md  
+├── src  
+│   ├── interface  
+│   │   ├── mmifw_stub.c  
+│   │   └── mmifw_stub.h  
+│   ├── main.c  
+│   ├── meson.build  
+│   ├── mmi-api-handler.c  
+│   ├── mmi-api-handler.h  
+│   ├── mmi-client.c  
+│   ├── mmi-client.h  
+│   ├── mmi-core.c  
+│   ├── mmi-core.h  
+│   ├── mmi-fusion.c  
+│   ├── mmi-fusion.h  
+│   ├── mmi-manager.c  
+│   ├── mmi-manager.h  
+│   ├── mmi-provider.c  
+│   └── mmi-provider.h  
+├── tests  
+│   ├── meson.build  
+│   ├── mmi-manager-tests.cpp  
+│   └── mmi-manager-tests.h  
+└── tidl  
+    └── mmifw.tidl  
+  
diff --git a/meson.build b/meson.build
new file mode 100644 (file)
index 0000000..26ca905
--- /dev/null
@@ -0,0 +1,17 @@
+project(
+       'mmi-manager',
+       ['c', 'cpp'],
+       version : '0.0.1',
+       license : 'MIT',
+       default_options : ['b_pie=true']
+)
+
+mmi_manager_version = meson.project_version().split('.')
+mmi_manager_prefix = get_option('prefix')
+mmi_manager_prefix_bindir = join_paths(mmi_manager_prefix, get_option('bindir'))
+mmi_manager_prefix_libdir = join_paths(mmi_manager_prefix, get_option('libdir'))
+
+pkgconfig = import('pkgconfig')
+
+subdir('src')
+subdir('tests')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packaging/mmi-manager.manifest b/packaging/mmi-manager.manifest
new file mode 100644 (file)
index 0000000..75b0fa5
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+    <request>
+        <domain name="_"/>
+    </request>
+</manifest>
diff --git a/packaging/mmi-manager.spec b/packaging/mmi-manager.spec
new file mode 100644 (file)
index 0000000..6eedf43
--- /dev/null
@@ -0,0 +1,77 @@
+Name:          mmi-manager
+Version:       0.0.1
+Release:       0
+Summary:       Multi-modal Interaction Manager
+License:       MIT
+URL:           http://www.tizen.org
+Source:                %{name}-%{version}.tar.xz
+Source1004:    %{name}.manifest
+
+BuildRequires: meson
+BuildRequires: tidl
+BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(rpc-port)
+BuildRequires: pkgconfig(ecore)
+
+#Build dependencies for tests
+BuildRequires: pkgconfig(gmock)
+
+%description
+MMI(Multi-modal Interaction) Manager
+
+%package devel
+Summary:       Development package for MMI Manager Module
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+%description devel
+Development package for MMI Manager Module
+
+%package tests
+Summary:       Testcases for MMI Manager APIs
+Group:         System/Libraries
+%description tests
+Testcases for testing MMI Manager APIs
+
+%prep
+%setup -q
+cp %{SOURCE1004} .
+
+#generate mmi-stub using TIDL Compiler
+tidlc -s -l C -i tidl/mmifw.tidl -o mmifw_stub
+mv mmifw_stub.* ./src/interface/
+
+%build
+meson setup --prefix=/usr \
+       --bindir %{_bindir} \
+       --libdir %{_libdir} \
+       builddir
+ninja -C builddir all
+
+%install
+DESTDIR=%{buildroot} ninja -C builddir install
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%license COPYING
+%{_bindir}/mmi-manager
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%license COPYING
+%{_includedir}/mmi-manager.h
+%{_libdir}/pkgconfig/*
+
+%files tests
+%defattr(-,root,root,-)
+%license COPYING
+%{_bindir}/mmi-manager-tests
+
diff --git a/src/interface/mmifw_stub.c b/src/interface/mmifw_stub.c
new file mode 100644 (file)
index 0000000..51312fc
--- /dev/null
@@ -0,0 +1,3764 @@
+/*
+ * Generated by tidlc 1.4.9.
+ */
+
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <pthread.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <libgen.h>
+#include <glib.h>
+#include <dlog.h>
+#include <rpc-port.h>
+#include <rpc-port-parcel.h>
+
+#include "mmifw_stub.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "RPC_PORT_STUB"
+
+#ifdef _E
+#undef _E
+#endif
+
+#ifdef _W
+#undef _W
+#endif
+
+#ifdef _I
+#undef _I
+#endif
+
+#ifdef _D
+#undef _D
+#endif
+
+#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__)
+
+typedef int (*stub_method)(rpc_port_h, rpc_port_parcel_h, void *data);
+
+struct focus_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       bool focus_in;
+};
+
+static void __focus_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_focus_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_bool(parcel, h->focus_in);
+}
+
+static void __focus_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_focus_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_bool(parcel, &h->focus_in);
+}
+
+int rpc_port_focus_event_create(rpc_port_focus_event_h *h)
+{
+       struct focus_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct focus_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __focus_event_to;
+       handle->parcelable.from = __focus_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_focus_event_destroy(rpc_port_focus_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_focus_event_clone(rpc_port_focus_event_h h, rpc_port_focus_event_h *clone)
+{
+       rpc_port_focus_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_focus_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create focus_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       handle->focus_in = h->focus_in;
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_focus_event_set_type(rpc_port_focus_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_focus_event_set_timestamp(rpc_port_focus_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_focus_event_set_focus_in(rpc_port_focus_event_h h, bool focus_in)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->focus_in = focus_in;
+       return 0;
+}
+
+int rpc_port_focus_event_get_type(rpc_port_focus_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_focus_event_get_timestamp(rpc_port_focus_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_focus_event_get_focus_in(rpc_port_focus_event_h h, bool *focus_in)
+{
+       if (!h || !focus_in) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *focus_in = h->focus_in;
+       return 0;
+}
+
+struct state_change_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       int state;
+       int old_state;
+};
+
+static void __state_change_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_state_change_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_int32(parcel, h->state);
+       rpc_port_parcel_write_int32(parcel, h->old_state);
+}
+
+static void __state_change_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_state_change_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_int32(parcel, &h->state);
+       rpc_port_parcel_read_int32(parcel, &h->old_state);
+}
+
+int rpc_port_state_change_event_create(rpc_port_state_change_event_h *h)
+{
+       struct state_change_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct state_change_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __state_change_event_to;
+       handle->parcelable.from = __state_change_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_state_change_event_destroy(rpc_port_state_change_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_state_change_event_clone(rpc_port_state_change_event_h h, rpc_port_state_change_event_h *clone)
+{
+       rpc_port_state_change_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_state_change_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create state_change_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       handle->state = h->state;
+       handle->old_state = h->old_state;
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_state_change_event_set_type(rpc_port_state_change_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_state_change_event_set_timestamp(rpc_port_state_change_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_state_change_event_set_state(rpc_port_state_change_event_h h, int state)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->state = state;
+       return 0;
+}
+
+int rpc_port_state_change_event_set_old_state(rpc_port_state_change_event_h h, int old_state)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->old_state = old_state;
+       return 0;
+}
+
+int rpc_port_state_change_event_get_type(rpc_port_state_change_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_state_change_event_get_timestamp(rpc_port_state_change_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_state_change_event_get_state(rpc_port_state_change_event_h h, int *state)
+{
+       if (!h || !state) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *state = h->state;
+       return 0;
+}
+
+int rpc_port_state_change_event_get_old_state(rpc_port_state_change_event_h h, int *old_state)
+{
+       if (!h || !old_state) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *old_state = h->old_state;
+       return 0;
+}
+
+struct wakeup_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       char *source;
+};
+
+static void __wakeup_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_wakeup_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_string(parcel, h->source ? h->source : "");
+}
+
+static void __wakeup_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_wakeup_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_string(parcel, &h->source);
+}
+
+int rpc_port_wakeup_event_create(rpc_port_wakeup_event_h *h)
+{
+       struct wakeup_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct wakeup_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __wakeup_event_to;
+       handle->parcelable.from = __wakeup_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_wakeup_event_destroy(rpc_port_wakeup_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source)
+               free(h->source);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_wakeup_event_clone(rpc_port_wakeup_event_h h, rpc_port_wakeup_event_h *clone)
+{
+       rpc_port_wakeup_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_wakeup_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create wakeup_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       if (h->source) {
+               handle->source = strdup(h->source);
+               if (!handle->source) {
+                       _E("Failed to duplicate h->source");
+                       rpc_port_wakeup_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_wakeup_event_set_type(rpc_port_wakeup_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_wakeup_event_set_timestamp(rpc_port_wakeup_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_wakeup_event_set_source(rpc_port_wakeup_event_h h, const char *source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source) {
+               free(h->source);
+               h->source = NULL;
+       }
+
+       h->source = strdup(source);
+       if (!h->source) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_wakeup_event_get_type(rpc_port_wakeup_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_wakeup_event_get_timestamp(rpc_port_wakeup_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_wakeup_event_get_source(rpc_port_wakeup_event_h h, char **source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->source) {
+               _E("Invalid parameter: h->source is NULL");
+               return -1;
+       }
+
+       *source = strdup(h->source);
+       if (*source == NULL) {
+               _E("Failed to duplicate source");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct key_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       bool key_down;
+       int keycode;
+       char *keyname;
+       char *source;
+};
+
+static void __key_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_key_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_bool(parcel, h->key_down);
+       rpc_port_parcel_write_int32(parcel, h->keycode);
+       rpc_port_parcel_write_string(parcel, h->keyname ? h->keyname : "");
+       rpc_port_parcel_write_string(parcel, h->source ? h->source : "");
+}
+
+static void __key_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_key_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_bool(parcel, &h->key_down);
+       rpc_port_parcel_read_int32(parcel, &h->keycode);
+       rpc_port_parcel_read_string(parcel, &h->keyname);
+       rpc_port_parcel_read_string(parcel, &h->source);
+}
+
+int rpc_port_key_event_create(rpc_port_key_event_h *h)
+{
+       struct key_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct key_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __key_event_to;
+       handle->parcelable.from = __key_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_key_event_destroy(rpc_port_key_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->keyname)
+               free(h->keyname);
+
+       if (h->source)
+               free(h->source);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_key_event_clone(rpc_port_key_event_h h, rpc_port_key_event_h *clone)
+{
+       rpc_port_key_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_key_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create key_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       handle->key_down = h->key_down;
+       handle->keycode = h->keycode;
+       if (h->keyname) {
+               handle->keyname = strdup(h->keyname);
+               if (!handle->keyname) {
+                       _E("Failed to duplicate h->keyname");
+                       rpc_port_key_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       if (h->source) {
+               handle->source = strdup(h->source);
+               if (!handle->source) {
+                       _E("Failed to duplicate h->source");
+                       rpc_port_key_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_key_event_set_type(rpc_port_key_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_key_event_set_timestamp(rpc_port_key_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_key_event_set_key_down(rpc_port_key_event_h h, bool key_down)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->key_down = key_down;
+       return 0;
+}
+
+int rpc_port_key_event_set_keycode(rpc_port_key_event_h h, int keycode)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->keycode = keycode;
+       return 0;
+}
+
+int rpc_port_key_event_set_keyname(rpc_port_key_event_h h, const char *keyname)
+{
+       if (!h || !keyname) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->keyname) {
+               free(h->keyname);
+               h->keyname = NULL;
+       }
+
+       h->keyname = strdup(keyname);
+       if (!h->keyname) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_key_event_set_source(rpc_port_key_event_h h, const char *source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source) {
+               free(h->source);
+               h->source = NULL;
+       }
+
+       h->source = strdup(source);
+       if (!h->source) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_key_event_get_type(rpc_port_key_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_key_event_get_timestamp(rpc_port_key_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_key_event_get_key_down(rpc_port_key_event_h h, bool *key_down)
+{
+       if (!h || !key_down) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *key_down = h->key_down;
+       return 0;
+}
+
+int rpc_port_key_event_get_keycode(rpc_port_key_event_h h, int *keycode)
+{
+       if (!h || !keycode) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *keycode = h->keycode;
+       return 0;
+}
+
+int rpc_port_key_event_get_keyname(rpc_port_key_event_h h, char **keyname)
+{
+       if (!h || !keyname) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->keyname) {
+               _E("Invalid parameter: h->keyname is NULL");
+               return -1;
+       }
+
+       *keyname = strdup(h->keyname);
+       if (*keyname == NULL) {
+               _E("Failed to duplicate keyname");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_key_event_get_source(rpc_port_key_event_h h, char **source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->source) {
+               _E("Invalid parameter: h->source is NULL");
+               return -1;
+       }
+
+       *source = strdup(h->source);
+       if (*source == NULL) {
+               _E("Failed to duplicate source");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct gesture_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       char *source;
+};
+
+static void __gesture_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_gesture_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_string(parcel, h->source ? h->source : "");
+}
+
+static void __gesture_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_gesture_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_string(parcel, &h->source);
+}
+
+int rpc_port_gesture_event_create(rpc_port_gesture_event_h *h)
+{
+       struct gesture_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct gesture_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __gesture_event_to;
+       handle->parcelable.from = __gesture_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_gesture_event_destroy(rpc_port_gesture_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source)
+               free(h->source);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_gesture_event_clone(rpc_port_gesture_event_h h, rpc_port_gesture_event_h *clone)
+{
+       rpc_port_gesture_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_gesture_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create gesture_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       if (h->source) {
+               handle->source = strdup(h->source);
+               if (!handle->source) {
+                       _E("Failed to duplicate h->source");
+                       rpc_port_gesture_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_gesture_event_set_type(rpc_port_gesture_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_gesture_event_set_timestamp(rpc_port_gesture_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_gesture_event_set_source(rpc_port_gesture_event_h h, const char *source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source) {
+               free(h->source);
+               h->source = NULL;
+       }
+
+       h->source = strdup(source);
+       if (!h->source) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_gesture_event_get_type(rpc_port_gesture_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_gesture_event_get_timestamp(rpc_port_gesture_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_gesture_event_get_source(rpc_port_gesture_event_h h, char **source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->source) {
+               _E("Invalid parameter: h->source is NULL");
+               return -1;
+       }
+
+       *source = strdup(h->source);
+       if (*source == NULL) {
+               _E("Failed to duplicate source");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct voice_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       char *source;
+};
+
+static void __voice_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_voice_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_string(parcel, h->source ? h->source : "");
+}
+
+static void __voice_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_voice_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_string(parcel, &h->source);
+}
+
+int rpc_port_voice_event_create(rpc_port_voice_event_h *h)
+{
+       struct voice_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct voice_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __voice_event_to;
+       handle->parcelable.from = __voice_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_voice_event_destroy(rpc_port_voice_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source)
+               free(h->source);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_voice_event_clone(rpc_port_voice_event_h h, rpc_port_voice_event_h *clone)
+{
+       rpc_port_voice_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_voice_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create voice_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       if (h->source) {
+               handle->source = strdup(h->source);
+               if (!handle->source) {
+                       _E("Failed to duplicate h->source");
+                       rpc_port_voice_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_voice_event_set_type(rpc_port_voice_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_voice_event_set_source(rpc_port_voice_event_h h, const char *source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source) {
+               free(h->source);
+               h->source = NULL;
+       }
+
+       h->source = strdup(source);
+       if (!h->source) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_voice_event_get_type(rpc_port_voice_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_voice_event_get_source(rpc_port_voice_event_h h, char **source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->source) {
+               _E("Invalid parameter: h->source is NULL");
+               return -1;
+       }
+
+       *source = strdup(h->source);
+       if (*source == NULL) {
+               _E("Failed to duplicate source");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct action_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       char *cmd;
+       char **args;
+       int args_size;
+       int nargs;
+       char *source;
+};
+
+static void __action_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_action_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_string(parcel, h->cmd ? h->cmd : "");
+       rpc_port_parcel_write_array_count(parcel, h->args_size);
+       do {
+               for (int i = 0; i < h->args_size; i++) {
+                       rpc_port_parcel_write_string(parcel, h->args[i] ? h->args[i] : "");
+               }
+       } while (0);
+
+       rpc_port_parcel_write_int32(parcel, h->nargs);
+       rpc_port_parcel_write_string(parcel, h->source ? h->source : "");
+}
+
+static void __action_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_action_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_string(parcel, &h->cmd);
+
+       do {
+               rpc_port_parcel_read_array_count(parcel, &h->args_size);
+
+               h->args = calloc(h->args_size, sizeof(*h->args));
+               if (!h->args) {
+                       _E("Out of memory");
+                       return;
+               }
+
+               for (int i = 0; i < h->args_size; i++) {
+                       char *value = NULL;
+
+                       rpc_port_parcel_read_string(parcel, &value);
+                       h->args[i] = value;
+               }
+       } while (0);
+
+       rpc_port_parcel_read_int32(parcel, &h->nargs);
+       rpc_port_parcel_read_string(parcel, &h->source);
+}
+
+int rpc_port_action_event_create(rpc_port_action_event_h *h)
+{
+       struct action_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct action_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __action_event_to;
+       handle->parcelable.from = __action_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_action_event_destroy(rpc_port_action_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->cmd)
+               free(h->cmd);
+
+       do {
+               for (int j = 0; j < h->args_size; j++) {
+                       if (h->args[j])
+                               free(h->args[j]);
+               }
+               free(h->args);
+       } while (0);
+       if (h->source)
+               free(h->source);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_action_event_clone(rpc_port_action_event_h h, rpc_port_action_event_h *clone)
+{
+       rpc_port_action_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_action_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create action_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       if (h->cmd) {
+               handle->cmd = strdup(h->cmd);
+               if (!handle->cmd) {
+                       _E("Failed to duplicate h->cmd");
+                       rpc_port_action_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       do {
+               if (h->args_size == 0) {
+                       _W("args is empty");
+                       break;
+               }
+
+               handle->args = calloc(h->args_size, sizeof(*h->args));
+               if (!handle->args) {
+                       _E("Out of memory");
+                       rpc_port_action_event_destroy(handle);
+                       return -1;
+               }
+               handle->args_size = h->args_size;
+
+               for (int i = 0; i < h->args_size; i++) {
+                       handle->args[i] = strdup(h->args[i]);
+               }
+       } while (0);
+
+       handle->nargs = h->nargs;
+       if (h->source) {
+               handle->source = strdup(h->source);
+               if (!handle->source) {
+                       _E("Failed to duplicate h->source");
+                       rpc_port_action_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_action_event_set_type(rpc_port_action_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_action_event_set_timestamp(rpc_port_action_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_action_event_set_cmd(rpc_port_action_event_h h, const char *cmd)
+{
+       if (!h || !cmd) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->cmd) {
+               free(h->cmd);
+               h->cmd = NULL;
+       }
+
+       h->cmd = strdup(cmd);
+       if (!h->cmd) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_action_event_set_args(rpc_port_action_event_h h, char **args, int args_size)
+{
+       if (!h || !args) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       do {
+               for (int j = 0; j < h->args_size; j++) {
+                       if (h->args[j])
+                               free(h->args[j]);
+               }
+               free(h->args);
+       } while (0);
+
+       h->args = NULL;
+
+       do {
+               h->args = calloc(args_size, sizeof(*args));
+               if (!h->args) {
+                       _E("Out of memory");
+                       return -1;
+               }
+               h->args_size = args_size;
+
+               for (int i = 0; i < h->args_size; i++) {
+                       h->args[i] = strdup(args[i]);
+               }
+       } while (0);
+
+       return 0;
+}
+
+int rpc_port_action_event_set_nargs(rpc_port_action_event_h h, int nargs)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->nargs = nargs;
+       return 0;
+}
+
+int rpc_port_action_event_set_source(rpc_port_action_event_h h, const char *source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->source) {
+               free(h->source);
+               h->source = NULL;
+       }
+
+       h->source = strdup(source);
+       if (!h->source) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_action_event_get_type(rpc_port_action_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_action_event_get_timestamp(rpc_port_action_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_action_event_get_cmd(rpc_port_action_event_h h, char **cmd)
+{
+       if (!h || !cmd) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->cmd) {
+               _E("Invalid parameter: h->cmd is NULL");
+               return -1;
+       }
+
+       *cmd = strdup(h->cmd);
+       if (*cmd == NULL) {
+               _E("Failed to duplicate cmd");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_action_event_get_args(rpc_port_action_event_h h, char ***args, int *args_size)
+{
+       if (!h || !args || !args_size) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       do {
+               if (h->args_size == 0) {
+                       _W("args is empty");
+                       break;
+               }
+
+               *args = calloc(h->args_size, sizeof(*h->args));
+               if (!*args) {
+                       _E("Out of memory");
+                       return -1;
+               }
+               *args_size = h->args_size;
+
+               for (int i = 0; i < h->args_size; i++) {
+                       (*args)[i] = strdup(h->args[i]);
+               }
+       } while (0);
+
+       return 0;
+}
+
+int rpc_port_action_event_get_nargs(rpc_port_action_event_h h, int *nargs)
+{
+       if (!h || !nargs) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *nargs = h->nargs;
+       return 0;
+}
+
+int rpc_port_action_event_get_source(rpc_port_action_event_h h, char **source)
+{
+       if (!h || !source) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->source) {
+               _E("Invalid parameter: h->source is NULL");
+               return -1;
+       }
+
+       *source = strdup(h->source);
+       if (*source == NULL) {
+               _E("Failed to duplicate source");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct feedback_event_s {
+       rpc_port_parcelable_t parcelable;
+       int type;
+       int timestamp;
+       char *feedback;
+       char *comment;
+};
+
+static void __feedback_event_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_feedback_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, h->type);
+       rpc_port_parcel_write_int32(parcel, h->timestamp);
+       rpc_port_parcel_write_string(parcel, h->feedback ? h->feedback : "");
+       rpc_port_parcel_write_string(parcel, h->comment ? h->comment : "");
+}
+
+static void __feedback_event_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_feedback_event_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &h->type);
+       rpc_port_parcel_read_int32(parcel, &h->timestamp);
+       rpc_port_parcel_read_string(parcel, &h->feedback);
+       rpc_port_parcel_read_string(parcel, &h->comment);
+}
+
+int rpc_port_feedback_event_create(rpc_port_feedback_event_h *h)
+{
+       struct feedback_event_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct feedback_event_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __feedback_event_to;
+       handle->parcelable.from = __feedback_event_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_feedback_event_destroy(rpc_port_feedback_event_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->feedback)
+               free(h->feedback);
+
+       if (h->comment)
+               free(h->comment);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_feedback_event_clone(rpc_port_feedback_event_h h, rpc_port_feedback_event_h *clone)
+{
+       rpc_port_feedback_event_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_feedback_event_create(&handle);
+       if (!handle) {
+               _E("Failed to create feedback_event handle");
+               return -1;
+       }
+
+       handle->type = h->type;
+       handle->timestamp = h->timestamp;
+       if (h->feedback) {
+               handle->feedback = strdup(h->feedback);
+               if (!handle->feedback) {
+                       _E("Failed to duplicate h->feedback");
+                       rpc_port_feedback_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       if (h->comment) {
+               handle->comment = strdup(h->comment);
+               if (!handle->comment) {
+                       _E("Failed to duplicate h->comment");
+                       rpc_port_feedback_event_destroy(handle);
+                       return -1;
+               }
+       }
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_feedback_event_set_type(rpc_port_feedback_event_h h, int type)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->type = type;
+       return 0;
+}
+
+int rpc_port_feedback_event_set_timestamp(rpc_port_feedback_event_h h, int timestamp)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->timestamp = timestamp;
+       return 0;
+}
+
+int rpc_port_feedback_event_set_feedback(rpc_port_feedback_event_h h, const char *feedback)
+{
+       if (!h || !feedback) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->feedback) {
+               free(h->feedback);
+               h->feedback = NULL;
+       }
+
+       h->feedback = strdup(feedback);
+       if (!h->feedback) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_feedback_event_set_comment(rpc_port_feedback_event_h h, const char *comment)
+{
+       if (!h || !comment) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->comment) {
+               free(h->comment);
+               h->comment = NULL;
+       }
+
+       h->comment = strdup(comment);
+       if (!h->comment) {
+               _E("Failed to duplicate data");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_feedback_event_get_type(rpc_port_feedback_event_h h, int *type)
+{
+       if (!h || !type) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *type = h->type;
+       return 0;
+}
+
+int rpc_port_feedback_event_get_timestamp(rpc_port_feedback_event_h h, int *timestamp)
+{
+       if (!h || !timestamp) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *timestamp = h->timestamp;
+       return 0;
+}
+
+int rpc_port_feedback_event_get_feedback(rpc_port_feedback_event_h h, char **feedback)
+{
+       if (!h || !feedback) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->feedback) {
+               _E("Invalid parameter: h->feedback is NULL");
+               return -1;
+       }
+
+       *feedback = strdup(h->feedback);
+       if (*feedback == NULL) {
+               _E("Failed to duplicate feedback");
+               return -1;
+       }
+
+       return 0;
+}
+
+int rpc_port_feedback_event_get_comment(rpc_port_feedback_event_h h, char **comment)
+{
+       if (!h || !comment) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!h->comment) {
+               _E("Invalid parameter: h->comment is NULL");
+               return -1;
+       }
+
+       *comment = strdup(h->comment);
+       if (*comment == NULL) {
+               _E("Failed to duplicate comment");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct array_string_s {
+       rpc_port_parcelable_t parcelable;
+       char **array_strings;
+       int array_strings_size;
+};
+
+static void __array_string_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_array_string_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_array_count(parcel, h->array_strings_size);
+       do {
+               for (int i = 0; i < h->array_strings_size; i++) {
+                       rpc_port_parcel_write_string(parcel, h->array_strings[i] ? h->array_strings[i] : "");
+               }
+       } while (0);
+}
+
+static void __array_string_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_array_string_h h = data;
+
+       if (!parcel || !h) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       do {
+               rpc_port_parcel_read_array_count(parcel, &h->array_strings_size);
+
+               h->array_strings = calloc(h->array_strings_size, sizeof(*h->array_strings));
+               if (!h->array_strings) {
+                       _E("Out of memory");
+                       return;
+               }
+
+               for (int i = 0; i < h->array_strings_size; i++) {
+                       char *value = NULL;
+
+                       rpc_port_parcel_read_string(parcel, &value);
+                       h->array_strings[i] = value;
+               }
+       } while (0);
+}
+
+int rpc_port_array_string_create(rpc_port_array_string_h *h)
+{
+       struct array_string_s *handle;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct array_string_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __array_string_to;
+       handle->parcelable.from = __array_string_from;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_array_string_destroy(rpc_port_array_string_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       do {
+               for (int j = 0; j < h->array_strings_size; j++) {
+                       if (h->array_strings[j])
+                               free(h->array_strings[j]);
+               }
+               free(h->array_strings);
+       } while (0);
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_array_string_clone(rpc_port_array_string_h h, rpc_port_array_string_h *clone)
+{
+       rpc_port_array_string_h handle = NULL;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       rpc_port_array_string_create(&handle);
+       if (!handle) {
+               _E("Failed to create array_string handle");
+               return -1;
+       }
+
+       do {
+               if (h->array_strings_size == 0) {
+                       _W("array_strings is empty");
+                       break;
+               }
+
+               handle->array_strings = calloc(h->array_strings_size, sizeof(*h->array_strings));
+               if (!handle->array_strings) {
+                       _E("Out of memory");
+                       rpc_port_array_string_destroy(handle);
+                       return -1;
+               }
+               handle->array_strings_size = h->array_strings_size;
+
+               for (int i = 0; i < h->array_strings_size; i++) {
+                       handle->array_strings[i] = strdup(h->array_strings[i]);
+               }
+       } while (0);
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_array_string_set_array_strings(rpc_port_array_string_h h, char **array_strings, int array_strings_size)
+{
+       if (!h || !array_strings) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       do {
+               for (int j = 0; j < h->array_strings_size; j++) {
+                       if (h->array_strings[j])
+                               free(h->array_strings[j]);
+               }
+               free(h->array_strings);
+       } while (0);
+
+       h->array_strings = NULL;
+
+       do {
+               h->array_strings = calloc(array_strings_size, sizeof(*array_strings));
+               if (!h->array_strings) {
+                       _E("Out of memory");
+                       return -1;
+               }
+               h->array_strings_size = array_strings_size;
+
+               for (int i = 0; i < h->array_strings_size; i++) {
+                       h->array_strings[i] = strdup(array_strings[i]);
+               }
+       } while (0);
+
+       return 0;
+}
+
+int rpc_port_array_string_get_array_strings(rpc_port_array_string_h h, char ***array_strings, int *array_strings_size)
+{
+       if (!h || !array_strings || !array_strings_size) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       do {
+               if (h->array_strings_size == 0) {
+                       _W("array_strings is empty");
+                       break;
+               }
+
+               *array_strings = calloc(h->array_strings_size, sizeof(*h->array_strings));
+               if (!*array_strings) {
+                       _E("Out of memory");
+                       return -1;
+               }
+               *array_strings_size = h->array_strings_size;
+
+               for (int i = 0; i < h->array_strings_size; i++) {
+                       (*array_strings)[i] = strdup(h->array_strings[i]);
+               }
+       } while (0);
+
+       return 0;
+}
+
+enum mmifw_method_e {
+       mmifw_METHOD_Result,
+       mmifw_METHOD_Callback,
+       mmifw_METHOD_register_cb,
+       mmifw_METHOD_deregister_cb,
+       mmifw_METHOD_get_focus,
+       mmifw_METHOD_set_state,
+};
+
+enum mmifw_delegate_e {
+       mmifw_DELEGATE_focus_event_cb = 1,
+       mmifw_DELEGATE_state_change_event_cb = 2,
+       mmifw_DELEGATE_wakeup_event_cb = 3,
+       mmifw_DELEGATE_key_event_cb = 4,
+       mmifw_DELEGATE_gesture_event_cb = 5,
+       mmifw_DELEGATE_voice_event_cb = 6,
+       mmifw_DELEGATE_action_event_cb = 7,
+       mmifw_DELEGATE_feedback_event_cb = 8,
+};
+
+static rpc_port_stub_h __mmifw_stub;
+static rpc_port_stub_mmifw_callback_s __mmifw_callback;
+static void *__mmifw_user_data;
+static GList *__mmifw_contexts;
+
+struct mmifw_context_s {
+       char *sender;
+       char *instance;
+       rpc_port_h port;
+       void *tag;
+       rpc_port_stub_mmifw_callback_s callback;
+       void *user_data;
+};
+
+static struct mmifw_context_s *__create_mmifw_context(const char *sender, const char *instance)
+{
+       struct mmifw_context_s *handle;
+
+       handle = calloc(1, sizeof(struct mmifw_context_s));
+       if (!handle) {
+               _E("Out of memory");
+               return NULL;
+       }
+
+       handle->sender = strdup(sender);
+       if (!handle->sender) {
+               _E("Out of memory");
+               free(handle);
+               return NULL;
+       }
+
+       handle->instance = strdup(instance);
+       if (!handle->instance) {
+               _E("Out of memory");
+               free(handle->sender);
+               free(handle);
+               return NULL;
+       }
+
+       handle->callback = __mmifw_callback;
+       handle->user_data = __mmifw_user_data;
+
+       return handle;
+}
+
+static void __destroy_mmifw_context(gpointer data)
+{
+       struct mmifw_context_s *handle = data;
+
+       if (!handle) {
+               _E("Critical error!");
+               return;
+       }
+
+       free(handle->instance);
+       free(handle->sender);
+
+       free(handle);
+}
+
+static struct mmifw_context_s *__find_mmifw_context(const char *instance)
+{
+       struct mmifw_context_s *handle;
+       GList *iter;
+
+       iter = __mmifw_contexts;
+       while (iter) {
+               handle = (struct mmifw_context_s *)iter->data;
+               if (!strcmp(handle->instance, instance))
+                       return handle;
+               iter = g_list_next(iter);
+       }
+
+       return NULL;
+}
+
+int rpc_port_stub_mmifw_context_set_tag(rpc_port_stub_mmifw_context_h ctx, void *tag)
+{
+       if (!ctx) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       ctx->tag = tag;
+
+       return 0;
+}
+
+int rpc_port_stub_mmifw_context_get_tag(rpc_port_stub_mmifw_context_h ctx, void **tag)
+{
+       if (!ctx || !tag) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *tag = ctx->tag;
+
+       return 0;
+}
+
+int rpc_port_stub_mmifw_context_get_sender(rpc_port_stub_mmifw_context_h ctx, char **sender)
+{
+       if (!ctx || !sender) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       *sender = strdup(ctx->sender);
+       if (*sender == NULL) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       return 0;
+}
+
+struct mmifw_focus_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_focus_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_focus_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_focus_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_focus_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_focus_event_cb_create(rpc_port_mmifw_focus_event_cb_h *h)
+{
+       struct mmifw_focus_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_focus_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_focus_event_cb_to;
+       handle->parcelable.from = __mmifw_focus_event_cb_from;
+       handle->id = mmifw_DELEGATE_focus_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_focus_event_cb_destroy(rpc_port_mmifw_focus_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_focus_event_cb_clone(rpc_port_mmifw_focus_event_cb_h h, rpc_port_mmifw_focus_event_cb_h *clone)
+{
+       rpc_port_mmifw_focus_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_focus_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_focus_event_cb_invoke(rpc_port_mmifw_focus_event_cb_h h, rpc_port_focus_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_focus_event_cb_set_port(rpc_port_mmifw_focus_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_state_change_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_state_change_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_state_change_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_state_change_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_state_change_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_state_change_event_cb_create(rpc_port_mmifw_state_change_event_cb_h *h)
+{
+       struct mmifw_state_change_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_state_change_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_state_change_event_cb_to;
+       handle->parcelable.from = __mmifw_state_change_event_cb_from;
+       handle->id = mmifw_DELEGATE_state_change_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_state_change_event_cb_destroy(rpc_port_mmifw_state_change_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_state_change_event_cb_clone(rpc_port_mmifw_state_change_event_cb_h h, rpc_port_mmifw_state_change_event_cb_h *clone)
+{
+       rpc_port_mmifw_state_change_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_state_change_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_state_change_event_cb_invoke(rpc_port_mmifw_state_change_event_cb_h h, rpc_port_state_change_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_state_change_event_cb_set_port(rpc_port_mmifw_state_change_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_wakeup_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_wakeup_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_wakeup_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_wakeup_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_wakeup_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_wakeup_event_cb_create(rpc_port_mmifw_wakeup_event_cb_h *h)
+{
+       struct mmifw_wakeup_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_wakeup_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_wakeup_event_cb_to;
+       handle->parcelable.from = __mmifw_wakeup_event_cb_from;
+       handle->id = mmifw_DELEGATE_wakeup_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_wakeup_event_cb_destroy(rpc_port_mmifw_wakeup_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_wakeup_event_cb_clone(rpc_port_mmifw_wakeup_event_cb_h h, rpc_port_mmifw_wakeup_event_cb_h *clone)
+{
+       rpc_port_mmifw_wakeup_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_wakeup_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_wakeup_event_cb_invoke(rpc_port_mmifw_wakeup_event_cb_h h, rpc_port_wakeup_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_wakeup_event_cb_set_port(rpc_port_mmifw_wakeup_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_key_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_key_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_key_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_key_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_key_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_key_event_cb_create(rpc_port_mmifw_key_event_cb_h *h)
+{
+       struct mmifw_key_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_key_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_key_event_cb_to;
+       handle->parcelable.from = __mmifw_key_event_cb_from;
+       handle->id = mmifw_DELEGATE_key_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_key_event_cb_destroy(rpc_port_mmifw_key_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_key_event_cb_clone(rpc_port_mmifw_key_event_cb_h h, rpc_port_mmifw_key_event_cb_h *clone)
+{
+       rpc_port_mmifw_key_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_key_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_key_event_cb_invoke(rpc_port_mmifw_key_event_cb_h h, rpc_port_key_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_key_event_cb_set_port(rpc_port_mmifw_key_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_gesture_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_gesture_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_gesture_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_gesture_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_gesture_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_gesture_event_cb_create(rpc_port_mmifw_gesture_event_cb_h *h)
+{
+       struct mmifw_gesture_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_gesture_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_gesture_event_cb_to;
+       handle->parcelable.from = __mmifw_gesture_event_cb_from;
+       handle->id = mmifw_DELEGATE_gesture_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_gesture_event_cb_destroy(rpc_port_mmifw_gesture_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_gesture_event_cb_clone(rpc_port_mmifw_gesture_event_cb_h h, rpc_port_mmifw_gesture_event_cb_h *clone)
+{
+       rpc_port_mmifw_gesture_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_gesture_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_gesture_event_cb_invoke(rpc_port_mmifw_gesture_event_cb_h h, rpc_port_gesture_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_gesture_event_cb_set_port(rpc_port_mmifw_gesture_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_voice_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_voice_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_voice_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_voice_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_voice_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_voice_event_cb_create(rpc_port_mmifw_voice_event_cb_h *h)
+{
+       struct mmifw_voice_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_voice_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_voice_event_cb_to;
+       handle->parcelable.from = __mmifw_voice_event_cb_from;
+       handle->id = mmifw_DELEGATE_voice_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_voice_event_cb_destroy(rpc_port_mmifw_voice_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_voice_event_cb_clone(rpc_port_mmifw_voice_event_cb_h h, rpc_port_mmifw_voice_event_cb_h *clone)
+{
+       rpc_port_mmifw_voice_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_voice_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_voice_event_cb_invoke(rpc_port_mmifw_voice_event_cb_h h, rpc_port_voice_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_voice_event_cb_set_port(rpc_port_mmifw_voice_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_action_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_action_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_action_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_action_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_action_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_action_event_cb_create(rpc_port_mmifw_action_event_cb_h *h)
+{
+       struct mmifw_action_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_action_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_action_event_cb_to;
+       handle->parcelable.from = __mmifw_action_event_cb_from;
+       handle->id = mmifw_DELEGATE_action_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_action_event_cb_destroy(rpc_port_mmifw_action_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_action_event_cb_clone(rpc_port_mmifw_action_event_cb_h h, rpc_port_mmifw_action_event_cb_h *clone)
+{
+       rpc_port_mmifw_action_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_action_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_action_event_cb_invoke(rpc_port_mmifw_action_event_cb_h h, rpc_port_action_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_action_event_cb_set_port(rpc_port_mmifw_action_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+struct mmifw_feedback_event_cb_s {
+       rpc_port_parcelable_t parcelable;
+       rpc_port_h port;
+       int id;
+       int seq_id;
+       bool once;
+       bool valid;
+};
+
+static void __mmifw_feedback_event_cb_to(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_feedback_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_write_int32(parcel, handle->id);
+       rpc_port_parcel_write_int32(parcel, handle->seq_id);
+       rpc_port_parcel_write_bool(parcel, handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static void __mmifw_feedback_event_cb_from(rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_mmifw_feedback_event_cb_h handle = data;
+
+       if (!handle) {
+               _E("Invalid parameter");
+               return;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &handle->id);
+       rpc_port_parcel_read_int32(parcel, &handle->seq_id);
+       rpc_port_parcel_read_bool(parcel, &handle->once);
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+}
+
+static int rpc_port_mmifw_feedback_event_cb_create(rpc_port_mmifw_feedback_event_cb_h *h)
+{
+       struct mmifw_feedback_event_cb_s *handle;
+       static int seq_num;
+
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_feedback_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable.to = __mmifw_feedback_event_cb_to;
+       handle->parcelable.from = __mmifw_feedback_event_cb_from;
+       handle->id = mmifw_DELEGATE_feedback_event_cb;
+       handle->seq_id = g_atomic_int_add(&seq_num, 1) + 1;
+       handle->once = false;
+       handle->valid = true;
+
+       *h = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_feedback_event_cb_destroy(rpc_port_mmifw_feedback_event_cb_h h)
+{
+       if (!h) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       free(h);
+
+       return 0;
+}
+
+int rpc_port_mmifw_feedback_event_cb_clone(rpc_port_mmifw_feedback_event_cb_h h, rpc_port_mmifw_feedback_event_cb_h *clone)
+{
+       rpc_port_mmifw_feedback_event_cb_h handle;
+
+       if (!h || !clone) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       handle = calloc(1, sizeof(struct mmifw_feedback_event_cb_s));
+       if (!handle) {
+               _E("Out of memory");
+               return -1;
+       }
+
+       handle->parcelable = h->parcelable;
+       handle->port = h->port;
+       handle->id = h->id;
+       handle->seq_id = h->seq_id;
+       handle->once = h->once;
+       handle->valid = h->valid;
+       _I("id(%d), seq_id(%d), once(%s)", handle->id, handle->seq_id, handle->once ? "true" : "false");
+
+       *clone = handle;
+
+       return 0;
+}
+
+int rpc_port_mmifw_feedback_event_cb_invoke(rpc_port_mmifw_feedback_event_cb_h h, rpc_port_feedback_event_h args)
+{
+       rpc_port_parcel_h parcel = NULL;
+       int r;
+
+       if (!h || !h->port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (h->once && !h->valid) {
+               _E("Invalid callback");
+               return -1;
+       }
+
+       rpc_port_parcel_create(&parcel);
+       if (!parcel) {
+               _E("Failed to create parcel");
+               return -1;
+       }
+
+       rpc_port_parcel_write_int32(parcel, mmifw_METHOD_Callback);
+       rpc_port_parcel_write(parcel, &h->parcelable, h);
+       rpc_port_parcel_write(parcel, &args->parcelable, args);
+
+       r = rpc_port_parcel_send(parcel, h->port);
+       rpc_port_parcel_destroy(parcel);
+       h->valid = false;
+
+       return r;
+}
+
+int rpc_port_mmifw_feedback_event_cb_set_port(rpc_port_mmifw_feedback_event_cb_h h, rpc_port_h port)
+{
+       if (!h || !port) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       h->port = port;
+
+       return 0;
+}
+
+static int __mmifw_method_register_cb(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_stub_mmifw_context_h context = data;
+       rpc_port_h callback_port;
+       int r;
+
+       r = rpc_port_stub_get_port(__mmifw_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
+       if (r != 0) {
+               _E("Failed to get callback port");
+               return -1;
+       }
+
+       rpc_port_mmifw_focus_event_cb_h focus_cb = NULL;
+       rpc_port_mmifw_state_change_event_cb_h state_cb = NULL;
+       rpc_port_mmifw_wakeup_event_cb_h wakeup_cb = NULL;
+       rpc_port_mmifw_key_event_cb_h key_cb = NULL;
+       rpc_port_mmifw_gesture_event_cb_h gesture_cb = NULL;
+       rpc_port_mmifw_voice_event_cb_h voice_cb = NULL;
+       rpc_port_mmifw_action_event_cb_h action_cb = NULL;
+       rpc_port_mmifw_feedback_event_cb_h feedback_cb = NULL;
+
+       rpc_port_mmifw_focus_event_cb_create(&focus_cb);
+
+       if (!focus_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_focus_event_cb_set_port(focus_cb, callback_port);
+       rpc_port_parcel_read(parcel, &focus_cb->parcelable, focus_cb);
+       rpc_port_mmifw_state_change_event_cb_create(&state_cb);
+
+       if (!state_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_state_change_event_cb_set_port(state_cb, callback_port);
+       rpc_port_parcel_read(parcel, &state_cb->parcelable, state_cb);
+       rpc_port_mmifw_wakeup_event_cb_create(&wakeup_cb);
+
+       if (!wakeup_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_wakeup_event_cb_set_port(wakeup_cb, callback_port);
+       rpc_port_parcel_read(parcel, &wakeup_cb->parcelable, wakeup_cb);
+       rpc_port_mmifw_key_event_cb_create(&key_cb);
+
+       if (!key_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_key_event_cb_set_port(key_cb, callback_port);
+       rpc_port_parcel_read(parcel, &key_cb->parcelable, key_cb);
+       rpc_port_mmifw_gesture_event_cb_create(&gesture_cb);
+
+       if (!gesture_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_gesture_event_cb_set_port(gesture_cb, callback_port);
+       rpc_port_parcel_read(parcel, &gesture_cb->parcelable, gesture_cb);
+       rpc_port_mmifw_voice_event_cb_create(&voice_cb);
+
+       if (!voice_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_voice_event_cb_set_port(voice_cb, callback_port);
+       rpc_port_parcel_read(parcel, &voice_cb->parcelable, voice_cb);
+       rpc_port_mmifw_action_event_cb_create(&action_cb);
+
+       if (!action_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_action_event_cb_set_port(action_cb, callback_port);
+       rpc_port_parcel_read(parcel, &action_cb->parcelable, action_cb);
+       rpc_port_mmifw_feedback_event_cb_create(&feedback_cb);
+
+       if (!feedback_cb) {
+               _E("Failed to create handle");
+               return -1;
+       }
+
+       rpc_port_mmifw_feedback_event_cb_set_port(feedback_cb, callback_port);
+       rpc_port_parcel_read(parcel, &feedback_cb->parcelable, feedback_cb);
+
+       int ret = context->callback.register_cb(context, focus_cb, state_cb, wakeup_cb, key_cb, gesture_cb, voice_cb, action_cb, feedback_cb, context->user_data);
+       do {
+               rpc_port_parcel_h result;
+
+               rpc_port_parcel_create(&result);
+               rpc_port_parcel_write_int32(result, mmifw_METHOD_Result);
+               rpc_port_parcel_write_int32(result, ret);
+               r = rpc_port_parcel_send(result, port);
+               rpc_port_parcel_destroy(result);
+       } while (0);
+
+       rpc_port_mmifw_focus_event_cb_destroy(focus_cb);
+       rpc_port_mmifw_state_change_event_cb_destroy(state_cb);
+       rpc_port_mmifw_wakeup_event_cb_destroy(wakeup_cb);
+       rpc_port_mmifw_key_event_cb_destroy(key_cb);
+       rpc_port_mmifw_gesture_event_cb_destroy(gesture_cb);
+       rpc_port_mmifw_voice_event_cb_destroy(voice_cb);
+       rpc_port_mmifw_action_event_cb_destroy(action_cb);
+       rpc_port_mmifw_feedback_event_cb_destroy(feedback_cb);
+       return r;
+}
+
+static int __mmifw_method_deregister_cb(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_stub_mmifw_context_h context = data;
+       rpc_port_h callback_port;
+       int r;
+
+       r = rpc_port_stub_get_port(__mmifw_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
+       if (r != 0) {
+               _E("Failed to get callback port");
+               return -1;
+       }
+
+       context->callback.deregister_cb(context, context->user_data);
+
+       return r;
+}
+
+static int __mmifw_method_get_focus(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_stub_mmifw_context_h context = data;
+       rpc_port_h callback_port;
+       int r;
+
+       r = rpc_port_stub_get_port(__mmifw_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
+       if (r != 0) {
+               _E("Failed to get callback port");
+               return -1;
+       }
+
+       char *sender;
+
+       rpc_port_parcel_read_string(parcel, &sender);
+
+       context->callback.get_focus(context, sender, context->user_data);
+
+       free(sender);
+       return r;
+}
+
+static int __mmifw_method_set_state(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
+{
+       rpc_port_stub_mmifw_context_h context = data;
+       rpc_port_h callback_port;
+       int r;
+
+       r = rpc_port_stub_get_port(__mmifw_stub, RPC_PORT_PORT_CALLBACK, context->instance, &callback_port);
+       if (r != 0) {
+               _E("Failed to get callback port");
+               return -1;
+       }
+
+       char *sender;
+       int state;
+
+       rpc_port_parcel_read_string(parcel, &sender);
+       rpc_port_parcel_read_int32(parcel, &state);
+
+       context->callback.set_state(context, sender, state, context->user_data);
+
+       free(sender);
+
+       return r;
+}
+
+static stub_method __mmifw_method_table[] = {
+       [mmifw_METHOD_register_cb] = __mmifw_method_register_cb,
+       [mmifw_METHOD_deregister_cb] = __mmifw_method_deregister_cb,
+       [mmifw_METHOD_get_focus] = __mmifw_method_get_focus,
+       [mmifw_METHOD_set_state] = __mmifw_method_set_state,
+};
+
+static void __mmifw_on_connected(const char *sender, const char *instance, void *data)
+{
+       rpc_port_stub_mmifw_context_h context;
+
+       _I("[__RPC_PORT__] sender(%s), instance(%s)", sender, instance);
+       context = __create_mmifw_context(sender, instance);
+       if (!context)
+               return;
+
+       if (context->callback.create)
+               context->callback.create(context, context->user_data);
+       __mmifw_contexts = g_list_append(__mmifw_contexts, context);
+}
+
+static void __mmifw_on_disconnected(const char *sender, const char *instance, void *data)
+{
+       rpc_port_stub_mmifw_context_h context;
+
+       _I("[__RPC_PORT__] sender(%s), instance(%s)", sender, instance);
+       context = __find_mmifw_context(instance);
+       if (!context)
+               return;
+
+       if (context->callback.terminate)
+               context->callback.terminate(context, context->user_data);
+       __mmifw_contexts = g_list_remove(__mmifw_contexts, context);
+       __destroy_mmifw_context(context);
+}
+
+static int __mmifw_on_received(const char *sender, const char *instance, rpc_port_h port, void *data)
+{
+       rpc_port_stub_mmifw_context_h context;
+       rpc_port_parcel_h parcel;
+       int cmd = -1;
+       int r;
+
+       _I("[__RPC_PORT__] sender(%s), instance(%s)", sender, instance);
+       context = __find_mmifw_context(instance);
+       if (!context) {
+               _E("Failed to find mmifw context(%s)", instance);
+               return -1;
+       }
+
+       context->port = port;
+       r = rpc_port_parcel_create_from_port(&parcel, port);
+       if (r != 0) {
+               _E("Failed to create parcel from port");
+               return r;
+       }
+
+       rpc_port_parcel_read_int32(parcel, &cmd);
+       if (cmd > 1 && cmd < (sizeof(__mmifw_method_table) / sizeof(__mmifw_method_table[0]))) {
+               if (__mmifw_method_table[cmd])
+                       r = __mmifw_method_table[cmd](port, parcel, context);
+       } else {
+               _E("Unknown Command(%d)", cmd);
+               r = -1;
+       }
+
+       rpc_port_parcel_destroy(parcel);
+
+       return r;
+}
+
+static int __mmifw_add_privileges(void)
+{
+
+       return 0;
+}
+
+int rpc_port_stub_mmifw_register(rpc_port_stub_mmifw_callback_s *callback, void *user_data)
+{
+       int r;
+
+       if (__mmifw_stub) {
+               _W("Already exists");
+               return -1;
+       }
+
+       if (!callback) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       __mmifw_callback = *callback;
+       __mmifw_user_data = user_data;
+       r = rpc_port_stub_create(&__mmifw_stub, "mmifw");
+       if (r != 0) {
+               _E("Failed to create stub handle");
+               return r;
+       }
+
+       r = rpc_port_stub_add_received_event_cb(__mmifw_stub, __mmifw_on_received, NULL);
+       if (r != 0) {
+               _E("Failed to add received event callback");
+               rpc_port_stub_destroy(__mmifw_stub);
+               __mmifw_stub = NULL;
+               return r;
+       }
+
+       r = rpc_port_stub_add_connected_event_cb(__mmifw_stub, __mmifw_on_connected, NULL);
+       if (r != 0) {
+               _E("Failed to add connected event callback");
+               rpc_port_stub_destroy(__mmifw_stub);
+               __mmifw_stub = NULL;
+               return r;
+       }
+
+       r = rpc_port_stub_add_disconnected_event_cb(__mmifw_stub, __mmifw_on_disconnected, NULL);
+       if (r != 0) {
+               _E("Failed to add disconnected event callback");
+               rpc_port_stub_destroy(__mmifw_stub);
+               __mmifw_stub = NULL;
+               return r;
+       }
+
+       r = __mmifw_add_privileges();
+       if (r != 0) {
+               _E("Failed to add privileges");
+               rpc_port_stub_destroy(__mmifw_stub);
+               __mmifw_stub = NULL;
+               return r;
+       }
+
+       r = rpc_port_stub_listen(__mmifw_stub);
+       if (r != 0) {
+               _E("Failed to listen stub");
+               rpc_port_stub_destroy(__mmifw_stub);
+               __mmifw_stub = NULL;
+               return r;
+       }
+
+       return 0;
+}
+
+int rpc_port_stub_mmifw_unregister(void)
+{
+       int r;
+
+       if (!__mmifw_stub)
+               return -1;
+
+       if (__mmifw_contexts) {
+               g_list_free_full(__mmifw_contexts, __destroy_mmifw_context);
+               __mmifw_contexts = NULL;
+       }
+
+       r = rpc_port_stub_destroy(__mmifw_stub);
+       __mmifw_stub = NULL;
+
+       return r;
+}
+
+int rpc_port_stub_mmifw_get_client_number(unsigned int *n)
+{
+       if (!n) {
+               _E("Invalid parameter");
+               return -1;
+       }
+
+       if (!__mmifw_stub) {
+               _E("mmifw Stub is not ready");
+               return -1;
+       }
+
+       *n = g_list_length(__mmifw_contexts);
+
+       return 0;
+}
diff --git a/src/interface/mmifw_stub.h b/src/interface/mmifw_stub.h
new file mode 100644 (file)
index 0000000..b2945a1
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * Generated by tidlc 1.4.9.
+ */
+
+#pragma once
+
+#include <stdbool.h>
+#include <bundle.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct focus_event_s *rpc_port_focus_event_h;
+
+int rpc_port_focus_event_create(rpc_port_focus_event_h *h);
+
+int rpc_port_focus_event_destroy(rpc_port_focus_event_h h);
+
+int rpc_port_focus_event_clone(rpc_port_focus_event_h h, rpc_port_focus_event_h *clone);
+
+int rpc_port_focus_event_set_type(rpc_port_focus_event_h h, int type);
+
+int rpc_port_focus_event_set_timestamp(rpc_port_focus_event_h h, int timestamp);
+
+int rpc_port_focus_event_set_focus_in(rpc_port_focus_event_h h, bool focus_in);
+
+int rpc_port_focus_event_get_type(rpc_port_focus_event_h h, int *type);
+
+int rpc_port_focus_event_get_timestamp(rpc_port_focus_event_h h, int *timestamp);
+
+int rpc_port_focus_event_get_focus_in(rpc_port_focus_event_h h, bool *focus_in);
+
+typedef struct state_change_event_s *rpc_port_state_change_event_h;
+
+int rpc_port_state_change_event_create(rpc_port_state_change_event_h *h);
+
+int rpc_port_state_change_event_destroy(rpc_port_state_change_event_h h);
+
+int rpc_port_state_change_event_clone(rpc_port_state_change_event_h h, rpc_port_state_change_event_h *clone);
+
+int rpc_port_state_change_event_set_type(rpc_port_state_change_event_h h, int type);
+
+int rpc_port_state_change_event_set_timestamp(rpc_port_state_change_event_h h, int timestamp);
+
+int rpc_port_state_change_event_set_state(rpc_port_state_change_event_h h, int state);
+
+int rpc_port_state_change_event_set_old_state(rpc_port_state_change_event_h h, int old_state);
+
+int rpc_port_state_change_event_get_type(rpc_port_state_change_event_h h, int *type);
+
+int rpc_port_state_change_event_get_timestamp(rpc_port_state_change_event_h h, int *timestamp);
+
+int rpc_port_state_change_event_get_state(rpc_port_state_change_event_h h, int *state);
+
+int rpc_port_state_change_event_get_old_state(rpc_port_state_change_event_h h, int *old_state);
+
+typedef struct wakeup_event_s *rpc_port_wakeup_event_h;
+
+int rpc_port_wakeup_event_create(rpc_port_wakeup_event_h *h);
+
+int rpc_port_wakeup_event_destroy(rpc_port_wakeup_event_h h);
+
+int rpc_port_wakeup_event_clone(rpc_port_wakeup_event_h h, rpc_port_wakeup_event_h *clone);
+
+int rpc_port_wakeup_event_set_type(rpc_port_wakeup_event_h h, int type);
+
+int rpc_port_wakeup_event_set_timestamp(rpc_port_wakeup_event_h h, int timestamp);
+
+int rpc_port_wakeup_event_set_source(rpc_port_wakeup_event_h h, const char *source);
+
+int rpc_port_wakeup_event_get_type(rpc_port_wakeup_event_h h, int *type);
+
+int rpc_port_wakeup_event_get_timestamp(rpc_port_wakeup_event_h h, int *timestamp);
+
+int rpc_port_wakeup_event_get_source(rpc_port_wakeup_event_h h, char **source);
+
+typedef struct key_event_s *rpc_port_key_event_h;
+
+int rpc_port_key_event_create(rpc_port_key_event_h *h);
+
+int rpc_port_key_event_destroy(rpc_port_key_event_h h);
+
+int rpc_port_key_event_clone(rpc_port_key_event_h h, rpc_port_key_event_h *clone);
+
+int rpc_port_key_event_set_type(rpc_port_key_event_h h, int type);
+
+int rpc_port_key_event_set_timestamp(rpc_port_key_event_h h, int timestamp);
+
+int rpc_port_key_event_set_key_down(rpc_port_key_event_h h, bool key_down);
+
+int rpc_port_key_event_set_keycode(rpc_port_key_event_h h, int keycode);
+
+int rpc_port_key_event_set_keyname(rpc_port_key_event_h h, const char *keyname);
+
+int rpc_port_key_event_set_source(rpc_port_key_event_h h, const char *source);
+
+int rpc_port_key_event_get_type(rpc_port_key_event_h h, int *type);
+
+int rpc_port_key_event_get_timestamp(rpc_port_key_event_h h, int *timestamp);
+
+int rpc_port_key_event_get_key_down(rpc_port_key_event_h h, bool *key_down);
+
+int rpc_port_key_event_get_keycode(rpc_port_key_event_h h, int *keycode);
+
+int rpc_port_key_event_get_keyname(rpc_port_key_event_h h, char **keyname);
+
+int rpc_port_key_event_get_source(rpc_port_key_event_h h, char **source);
+
+typedef struct gesture_event_s *rpc_port_gesture_event_h;
+
+int rpc_port_gesture_event_create(rpc_port_gesture_event_h *h);
+
+int rpc_port_gesture_event_destroy(rpc_port_gesture_event_h h);
+
+int rpc_port_gesture_event_clone(rpc_port_gesture_event_h h, rpc_port_gesture_event_h *clone);
+
+int rpc_port_gesture_event_set_type(rpc_port_gesture_event_h h, int type);
+
+int rpc_port_gesture_event_set_timestamp(rpc_port_gesture_event_h h, int timestamp);
+
+int rpc_port_gesture_event_set_source(rpc_port_gesture_event_h h, const char *source);
+
+int rpc_port_gesture_event_get_type(rpc_port_gesture_event_h h, int *type);
+
+int rpc_port_gesture_event_get_timestamp(rpc_port_gesture_event_h h, int *timestamp);
+
+int rpc_port_gesture_event_get_source(rpc_port_gesture_event_h h, char **source);
+
+typedef struct voice_event_s *rpc_port_voice_event_h;
+
+int rpc_port_voice_event_create(rpc_port_voice_event_h *h);
+
+int rpc_port_voice_event_destroy(rpc_port_voice_event_h h);
+
+int rpc_port_voice_event_clone(rpc_port_voice_event_h h, rpc_port_voice_event_h *clone);
+
+int rpc_port_voice_event_set_type(rpc_port_voice_event_h h, int type);
+
+int rpc_port_voice_event_set_source(rpc_port_voice_event_h h, const char *source);
+
+int rpc_port_voice_event_get_type(rpc_port_voice_event_h h, int *type);
+
+int rpc_port_voice_event_get_source(rpc_port_voice_event_h h, char **source);
+
+typedef struct action_event_s *rpc_port_action_event_h;
+
+int rpc_port_action_event_create(rpc_port_action_event_h *h);
+
+int rpc_port_action_event_destroy(rpc_port_action_event_h h);
+
+int rpc_port_action_event_clone(rpc_port_action_event_h h, rpc_port_action_event_h *clone);
+
+int rpc_port_action_event_set_type(rpc_port_action_event_h h, int type);
+
+int rpc_port_action_event_set_timestamp(rpc_port_action_event_h h, int timestamp);
+
+int rpc_port_action_event_set_cmd(rpc_port_action_event_h h, const char *cmd);
+
+int rpc_port_action_event_set_args(rpc_port_action_event_h h, char **args, int args_size);
+
+int rpc_port_action_event_set_nargs(rpc_port_action_event_h h, int nargs);
+
+int rpc_port_action_event_set_source(rpc_port_action_event_h h, const char *source);
+
+int rpc_port_action_event_get_type(rpc_port_action_event_h h, int *type);
+
+int rpc_port_action_event_get_timestamp(rpc_port_action_event_h h, int *timestamp);
+
+int rpc_port_action_event_get_cmd(rpc_port_action_event_h h, char **cmd);
+
+int rpc_port_action_event_get_args(rpc_port_action_event_h h, char ***args, int *args_size);
+
+int rpc_port_action_event_get_nargs(rpc_port_action_event_h h, int *nargs);
+
+int rpc_port_action_event_get_source(rpc_port_action_event_h h, char **source);
+
+typedef struct feedback_event_s *rpc_port_feedback_event_h;
+
+int rpc_port_feedback_event_create(rpc_port_feedback_event_h *h);
+
+int rpc_port_feedback_event_destroy(rpc_port_feedback_event_h h);
+
+int rpc_port_feedback_event_clone(rpc_port_feedback_event_h h, rpc_port_feedback_event_h *clone);
+
+int rpc_port_feedback_event_set_type(rpc_port_feedback_event_h h, int type);
+
+int rpc_port_feedback_event_set_timestamp(rpc_port_feedback_event_h h, int timestamp);
+
+int rpc_port_feedback_event_set_feedback(rpc_port_feedback_event_h h, const char *feedback);
+
+int rpc_port_feedback_event_set_comment(rpc_port_feedback_event_h h, const char *comment);
+
+int rpc_port_feedback_event_get_type(rpc_port_feedback_event_h h, int *type);
+
+int rpc_port_feedback_event_get_timestamp(rpc_port_feedback_event_h h, int *timestamp);
+
+int rpc_port_feedback_event_get_feedback(rpc_port_feedback_event_h h, char **feedback);
+
+int rpc_port_feedback_event_get_comment(rpc_port_feedback_event_h h, char **comment);
+
+typedef struct array_string_s *rpc_port_array_string_h;
+
+int rpc_port_array_string_create(rpc_port_array_string_h *h);
+
+int rpc_port_array_string_destroy(rpc_port_array_string_h h);
+
+int rpc_port_array_string_clone(rpc_port_array_string_h h, rpc_port_array_string_h *clone);
+
+int rpc_port_array_string_set_array_strings(rpc_port_array_string_h h, char **array_strings, int array_strings_size);
+
+int rpc_port_array_string_get_array_strings(rpc_port_array_string_h h, char ***array_strings, int *array_strings_size);
+
+typedef struct mmifw_context_s* rpc_port_stub_mmifw_context_h;
+
+int rpc_port_stub_mmifw_context_set_tag(rpc_port_stub_mmifw_context_h ctx, void *tag);
+
+int rpc_port_stub_mmifw_context_get_tag(rpc_port_stub_mmifw_context_h ctx, void **tag);
+
+int rpc_port_stub_mmifw_context_get_sender(rpc_port_stub_mmifw_context_h ctx, char **sender);
+
+typedef struct mmifw_focus_event_cb_s *rpc_port_mmifw_focus_event_cb_h;
+
+int rpc_port_mmifw_focus_event_cb_destroy(rpc_port_mmifw_focus_event_cb_h h);
+
+int rpc_port_mmifw_focus_event_cb_clone(rpc_port_mmifw_focus_event_cb_h h, rpc_port_mmifw_focus_event_cb_h *clone);
+
+int rpc_port_mmifw_focus_event_cb_invoke(rpc_port_mmifw_focus_event_cb_h h, rpc_port_focus_event_h args);
+
+typedef struct mmifw_state_change_event_cb_s *rpc_port_mmifw_state_change_event_cb_h;
+
+int rpc_port_mmifw_state_change_event_cb_destroy(rpc_port_mmifw_state_change_event_cb_h h);
+
+int rpc_port_mmifw_state_change_event_cb_clone(rpc_port_mmifw_state_change_event_cb_h h, rpc_port_mmifw_state_change_event_cb_h *clone);
+
+int rpc_port_mmifw_state_change_event_cb_invoke(rpc_port_mmifw_state_change_event_cb_h h, rpc_port_state_change_event_h args);
+
+typedef struct mmifw_wakeup_event_cb_s *rpc_port_mmifw_wakeup_event_cb_h;
+
+int rpc_port_mmifw_wakeup_event_cb_destroy(rpc_port_mmifw_wakeup_event_cb_h h);
+
+int rpc_port_mmifw_wakeup_event_cb_clone(rpc_port_mmifw_wakeup_event_cb_h h, rpc_port_mmifw_wakeup_event_cb_h *clone);
+
+int rpc_port_mmifw_wakeup_event_cb_invoke(rpc_port_mmifw_wakeup_event_cb_h h, rpc_port_wakeup_event_h args);
+
+typedef struct mmifw_key_event_cb_s *rpc_port_mmifw_key_event_cb_h;
+
+int rpc_port_mmifw_key_event_cb_destroy(rpc_port_mmifw_key_event_cb_h h);
+
+int rpc_port_mmifw_key_event_cb_clone(rpc_port_mmifw_key_event_cb_h h, rpc_port_mmifw_key_event_cb_h *clone);
+
+int rpc_port_mmifw_key_event_cb_invoke(rpc_port_mmifw_key_event_cb_h h, rpc_port_key_event_h args);
+
+typedef struct mmifw_gesture_event_cb_s *rpc_port_mmifw_gesture_event_cb_h;
+
+int rpc_port_mmifw_gesture_event_cb_destroy(rpc_port_mmifw_gesture_event_cb_h h);
+
+int rpc_port_mmifw_gesture_event_cb_clone(rpc_port_mmifw_gesture_event_cb_h h, rpc_port_mmifw_gesture_event_cb_h *clone);
+
+int rpc_port_mmifw_gesture_event_cb_invoke(rpc_port_mmifw_gesture_event_cb_h h, rpc_port_gesture_event_h args);
+
+typedef struct mmifw_voice_event_cb_s *rpc_port_mmifw_voice_event_cb_h;
+
+int rpc_port_mmifw_voice_event_cb_destroy(rpc_port_mmifw_voice_event_cb_h h);
+
+int rpc_port_mmifw_voice_event_cb_clone(rpc_port_mmifw_voice_event_cb_h h, rpc_port_mmifw_voice_event_cb_h *clone);
+
+int rpc_port_mmifw_voice_event_cb_invoke(rpc_port_mmifw_voice_event_cb_h h, rpc_port_voice_event_h args);
+
+typedef struct mmifw_action_event_cb_s *rpc_port_mmifw_action_event_cb_h;
+
+int rpc_port_mmifw_action_event_cb_destroy(rpc_port_mmifw_action_event_cb_h h);
+
+int rpc_port_mmifw_action_event_cb_clone(rpc_port_mmifw_action_event_cb_h h, rpc_port_mmifw_action_event_cb_h *clone);
+
+int rpc_port_mmifw_action_event_cb_invoke(rpc_port_mmifw_action_event_cb_h h, rpc_port_action_event_h args);
+
+typedef struct mmifw_feedback_event_cb_s *rpc_port_mmifw_feedback_event_cb_h;
+
+int rpc_port_mmifw_feedback_event_cb_destroy(rpc_port_mmifw_feedback_event_cb_h h);
+
+int rpc_port_mmifw_feedback_event_cb_clone(rpc_port_mmifw_feedback_event_cb_h h, rpc_port_mmifw_feedback_event_cb_h *clone);
+
+int rpc_port_mmifw_feedback_event_cb_invoke(rpc_port_mmifw_feedback_event_cb_h h, rpc_port_feedback_event_h args);
+
+typedef struct {
+       void (*create)(rpc_port_stub_mmifw_context_h context, void *user_data);
+       void (*terminate)(rpc_port_stub_mmifw_context_h context, void *user_data);
+
+       int (*register_cb)(rpc_port_stub_mmifw_context_h context, rpc_port_mmifw_focus_event_cb_h focus_cb, rpc_port_mmifw_state_change_event_cb_h state_cb, rpc_port_mmifw_wakeup_event_cb_h wakeup_cb, rpc_port_mmifw_key_event_cb_h key_cb, rpc_port_mmifw_gesture_event_cb_h gesture_cb, rpc_port_mmifw_voice_event_cb_h voice_cb, rpc_port_mmifw_action_event_cb_h action_cb, rpc_port_mmifw_feedback_event_cb_h feedback_cb, void *user_data);
+       void (*deregister_cb)(rpc_port_stub_mmifw_context_h context, void *user_data);
+       void (*get_focus)(rpc_port_stub_mmifw_context_h context, const char *sender, void *user_data);
+       void (*set_state)(rpc_port_stub_mmifw_context_h context, const char *sender, int state, void *user_data);
+} rpc_port_stub_mmifw_callback_s;
+
+int rpc_port_stub_mmifw_register(rpc_port_stub_mmifw_callback_s *callback, void *user_data);
+
+int rpc_port_stub_mmifw_unregister(void);
+
+int rpc_port_stub_mmifw_get_client_number(unsigned int *n);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/main.c b/src/main.c
new file mode 100644 (file)
index 0000000..8825633
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* 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 "mmi-manager.h"
+
+int main(int argc, char *argv[])
+{
+       mmi_manager_init();
+       mmi_manager_loop_begin();
+       mmi_manager_shutdown();
+
+       return 0;
+}
+
diff --git a/src/meson.build b/src/meson.build
new file mode 100644 (file)
index 0000000..c0d399b
--- /dev/null
@@ -0,0 +1,62 @@
+mmi_manager_srcs = [
+       'main.c',
+       'mmi-manager.h',
+       'mmi-manager.c',
+       'mmi-core.h',
+       'mmi-core.c',
+       'mmi-api-handler.h',
+       'mmi-api-handler.c',
+       'mmi-client.h',
+       'mmi-client.c',
+       'mmi-fusion.c',
+       'mmi-provider.c',
+       'mmi-fusion.h',
+       'mmi-provider.h',
+       'interface/mmifw_stub.h',
+       'interface/mmifw_stub.c'
+       ]
+
+install_headers(
+       'mmi-manager.h'
+       )
+
+glib_dep = dependency('glib-2.0')
+gio_dep = dependency('gio-2.0')
+bundle_dep = dependency('bundle')
+dlog_dep = dependency('dlog')
+ecore_dep = dependency('ecore', method : 'pkg-config')
+rpc_port_dep = dependency('rpc-port')
+libtzplatform_config_dep = dependency('libtzplatform-config')
+
+mmi_manager_deps = [
+       ecore_dep,
+       glib_dep,
+       gio_dep,
+       bundle_dep,
+       dlog_dep,
+       rpc_port_dep,
+       libtzplatform_config_dep]
+
+executable('mmi-manager',
+       mmi_manager_srcs,
+       dependencies : [mmi_manager_deps],
+       install_dir : mmi_manager_prefix_bindir,
+       install : true
+       )
+
+mmi_manager_include_dirs = include_directories(
+       '.'
+       )
+
+mmi_manager_declared_dep = declare_dependency(
+       dependencies : [mmi_manager_deps],
+       include_directories : [mmi_manager_include_dirs]        
+       )
+
+pkgconfig.generate(
+       filebase : 'mmi-manager',
+       name : 'mmi-manager',
+       description : 'Multi-modal Interaction Manager',
+       version : meson.project_version(),
+       )
+
diff --git a/src/mmi-api-handler.c b/src/mmi-api-handler.c
new file mode 100644 (file)
index 0000000..3347d22
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* 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 "mmi-api-handler.h"
+
+void
+mmi_api_handler_init(void)
+{
+}
+
+void
+mmi_api_handler_shutdown(void)
+{
+}
+
diff --git a/src/mmi-api-handler.h b/src/mmi-api-handler.h
new file mode 100644 (file)
index 0000000..7850353
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* 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_API_HANDLER_H__
+#define __MMI_API_HANDLER_H__
+
+void mmi_api_handler_init(void);
+void mmi_api_handler_shutdown(void);
+
+#endif //__MMI_API_HANDLER_H__
diff --git a/src/mmi-client.c b/src/mmi-client.c
new file mode 100644 (file)
index 0000000..15bbbf4
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* 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 "mmi-client.h"
+
+void
+client_manager_init(void)
+{
+}
+
+void
+client_manager_shutdown(void)
+{
+}
diff --git a/src/mmi-client.h b/src/mmi-client.h
new file mode 100644 (file)
index 0000000..76e180a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* 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_CLIENT_H__
+#define __MMI_CLIENT_H__
+
+void client_manager_init(void);
+void client_manager_shutdown(void);
+
+#endif //__MMI_CLIENT_H__
diff --git a/src/mmi-core.c b/src/mmi-core.c
new file mode 100644 (file)
index 0000000..e75fca8
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* 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 "mmi-core.h"
+
+void
+mmi_core_init()
+{
+}
+
+void
+mmi_core_shutdown()
+{
+}
+
diff --git a/src/mmi-core.h b/src/mmi-core.h
new file mode 100644 (file)
index 0000000..b899a2a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* 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_CORE_H__
+#define __MMI_CORE_H__
+
+void mmi_core_init(void);
+void mmi_core_shutdown(void);
+
+#endif //__MMI_CORE_H__
diff --git a/src/mmi-fusion.c b/src/mmi-fusion.c
new file mode 100644 (file)
index 0000000..32f1a4c
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* 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 "mmi-fusion.h"
+
+void
+modality_fusions_init(void)
+{
+}
+
+void
+modality_fusions_shutdown(void)
+{
+}
diff --git a/src/mmi-fusion.h b/src/mmi-fusion.h
new file mode 100644 (file)
index 0000000..0c9c54c
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* 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_FUSION_H__
+#define __MMI_FUSION_H__
+
+void modality_fusions_init(void);
+void modality_fusions_shutdown(void);
+
+#endif //__MMI_FUSION_H__
diff --git a/src/mmi-manager.c b/src/mmi-manager.c
new file mode 100644 (file)
index 0000000..06d156b
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+* 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 "mmi-manager.h"
+#include "mmi-core.h"
+#include "mmi-fusion.h"
+#include "mmi-provider.h"
+#include "mmi-client.h"
+#include "mmi-api-handler.h"
+
+#include <Ecore.h>
+
+void
+mmi_manager_init()
+{
+       ecore_init();
+       mmi_core_init();
+       modality_providers_init();
+       modality_fusions_init();
+       client_manager_init();
+       mmi_api_handler_init();
+}
+
+void
+mmi_manager_loop_begin()
+{
+       ecore_main_loop_begin();
+}
+
+void
+mmi_manager_loop_end()
+{
+       ecore_main_loop_quit();
+}
+
+void
+mmi_manager_shutdown()
+{
+       mmi_api_handler_shutdown();
+       client_manager_shutdown();
+       modality_fusions_shutdown();
+       modality_providers_shutdown();
+       mmi_core_shutdown();
+       ecore_shutdown();
+}
diff --git a/src/mmi-manager.h b/src/mmi-manager.h
new file mode 100644 (file)
index 0000000..f214f7c
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+* 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_MANAGER_H__
+#define __MMI_MANAGER_H__
+
+void mmi_manager_init(void);
+void mmi_manager_loop_begin(void);
+void mmi_manager_loop_end(void);
+void mmi_manager_shutdown(void);
+
+#endif //__MMI_MANAGER_H__
diff --git a/src/mmi-provider.c b/src/mmi-provider.c
new file mode 100644 (file)
index 0000000..3c88d50
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* 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 "mmi-provider.h"
+
+void
+modality_providers_init(void)
+{
+}
+
+void
+modality_providers_shutdown(void)
+{
+}
\ No newline at end of file
diff --git a/src/mmi-provider.h b/src/mmi-provider.h
new file mode 100644 (file)
index 0000000..1e48d3a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* 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_PROVIDER_H__
+#define __MMI_PROVIDER_H__
+
+void modality_providers_init(void);
+void modality_providers_shutdown(void);
+
+#endif //__MMI_PROVIDER_H__
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644 (file)
index 0000000..9e2a2bf
--- /dev/null
@@ -0,0 +1,14 @@
+mmi_manager_tests_srcs = [
+       'mmi-manager-tests.cpp'
+       ]
+
+gmock_dep = dependency('gmock', method : 'pkg-config')
+ecore_dep = dependency('ecore', method : 'pkg-config')
+
+executable(
+       'mmi-manager-tests',
+       mmi_manager_tests_srcs,
+       dependencies : [mmi_manager_declared_dep, gmock_dep, ecore_dep],
+       install_dir : mmi_manager_prefix_bindir,
+       install : true
+       )
diff --git a/tests/mmi-manager-tests.cpp b/tests/mmi-manager-tests.cpp
new file mode 100644 (file)
index 0000000..8d83cd7
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+* 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 "mmi-manager-tests.h"
+
+int main(int argc, char **argv)
+{
+       auto testResults = false;
+
+       try
+       {
+               ::testing::InitGoogleMock(&argc, argv);
+               ::testing::FLAGS_gtest_death_test_style = "fast";
+       }
+       catch ( ... )
+       {
+               PRINT("Error occurred while trying to initialize GoogleTest.\n");
+               exit(EXIT_FAILURE);
+       }
+
+       try
+       {
+               testResults = (RUN_ALL_TESTS() == 0) ? true : false;
+       }
+       catch (const ::testing::internal::GoogleTestFailureException &e)
+       {
+               testResults = false;
+               PRINT("GoogleTestFailureException has been thrown: %s\n", e.what());
+       }
+
+       return testResults;
+}
+
diff --git a/tests/mmi-manager-tests.h b/tests/mmi-manager-tests.h
new file mode 100644 (file)
index 0000000..2273dfa
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+* 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_MANAGER_TESTS_H__
+#define __MMI_MANAGER_TESTS_H__
+
+#include <stdio.h>
+#include <gmock/gmock.h>
+#include <Ecore.h>
+
+#define PRINT printf
+
+using ::testing::TestWithParam;
+using ::testing::Bool;
+using ::testing::Values;
+using ::testing::Combine;
+
+#endif //__MMI_MANAGER_TESTS_H__
diff --git a/tidl/mmifw.tidl b/tidl/mmifw.tidl
new file mode 100644 (file)
index 0000000..3baca86
--- /dev/null
@@ -0,0 +1,78 @@
+struct focus_event {
+   int type;
+   int timestamp;
+   bool focus_in;
+}
+
+struct state_change_event {
+   int type;
+   int timestamp;
+   int state;
+   int old_state;
+}
+
+struct wakeup_event {
+   int type;
+   int timestamp;
+   string source;
+}
+
+struct key_event {
+   int type;
+   int timestamp;
+   bool key_down;
+   int keycode;
+   string keyname;
+   string source;
+}
+
+struct gesture_event {
+   int type;
+   int timestamp;
+   string source;
+}
+
+struct voice_event {
+   int type;
+   string source;
+}
+
+struct action_event {
+   int type;
+   int timestamp;
+   string cmd;
+   array<string> args;
+   int nargs;
+   string source;
+}
+
+struct feedback_event {
+   int type;
+   int timestamp;
+   string feedback;
+   string comment;
+}
+
+interface mmifw {
+   void focus_event_cb(focus_event args) delegate;
+   void state_change_event_cb(state_change_event args) delegate;
+   void wakeup_event_cb(wakeup_event args) delegate;
+   void key_event_cb(key_event args) delegate;
+   void gesture_event_cb(gesture_event args) delegate;
+   void voice_event_cb(voice_event args) delegate;
+   void action_event_cb(action_event args) delegate;
+   void feedback_event_cb(feedback_event args) delegate;
+
+   int register_cb(focus_event_cb focus_cb,
+                   state_change_event_cb state_cb,
+                   wakeup_event_cb wakeup_cb,
+                   key_event_cb key_cb,
+                   gesture_event_cb gesture_cb,
+                   voice_event_cb voice_cb,
+                   action_event_cb action_cb,
+                   feedback_event_cb feedback_cb);
+   void deregister_cb() async;
+   void get_focus(string sender) async;
+   void set_state(string sender, int state) async;
+}
+