mmi-fusion: add initial fusion interface 07/264007/1
authorSung-Jin Park <sj76.park@samsung.com>
Sat, 10 Jul 2021 17:06:27 +0000 (02:06 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 13 Sep 2021 11:23:34 +0000 (20:23 +0900)
Change-Id: I896ec6fb1d3ef9dd0ac8d8b01052ea45b4ec592a
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/meson.build
src/mmi-common.h
src/mmi-fusion-iface.h [new file with mode: 0644]
src/mmi-fusion.c

index 7b7dd0c53acc23795aea19066ef2838490209918..9b49d746b20b2cb5c6f5e8118ff3e05be7d5a3f7 100644 (file)
@@ -8,12 +8,13 @@ mmi_manager_srcs = [
        'mmi-api-handler.c',
        'mmi-client.h',
        'mmi-client.c',
-       'mmi-fusion.c',
-       'mmi-provider.c',
-       'mmi-fusion.h',
        'mmi-common.h',
+       'mmi-provider.c',
        'mmi-provider.h',
        'mmi-provider-iface.h',
+       'mmi-fusion.c',
+       'mmi-fusion.h',
+       'mmi-fusion-iface.h',
        'mmi-manager-event-types.h',
        'interface/mmifw_stub.h',
        'interface/mmifw_stub.c',
@@ -23,7 +24,8 @@ install_headers(
        'mmi-manager.h',
        'mmi-common.h',
        'mmi-manager-event-types.h',
-       'mmi-provider-iface.h'
+       'mmi-provider-iface.h',
+       'mmi-fusion-iface.h'
        )
 
 glib_dep = dependency('glib-2.0')
index 30f53a9056374e58f49f9311de08bbbf8086d940..605eb4595caaa0f8ee1757b5ec51f6591c9a82ee 100644 (file)
 
 typedef unsigned long long ull;
 
+typedef enum mmi_state
+{
+        MMI_STATE_NONE,
+        MMI_STATE_INITIATION,
+        MMI_STATE_EXPLORATION,
+        MMI_STATE_EXECUTION,
+        MMI_STATE_FEEDBACK,
+        MMI_STATE_OBSERVATION,
+        MMI_STATE_TERMINATION
+} mmi_state;
+
 typedef enum mmi_provider_op_mode
 {
    MODALITY_PROVIDER_MODE_NONE,
@@ -58,4 +69,8 @@ typedef struct _mmi_provider_module_data mmi_provider_module_data;
 typedef struct _mmi_provider_module mmi_provider_module;
 typedef struct _mmi_provider_handle mmi_provider_handle;
 
+typedef struct _mmi_fusion_module_data mmi_fusion_module_data;
+typedef struct _mmi_fusion_module mmi_fusion_module;
+typedef struct _mmi_fusion_handle mmi_fusion_handle;
+
 #endif //__MMI_COMMON_H__
diff --git a/src/mmi-fusion-iface.h b/src/mmi-fusion-iface.h
new file mode 100644 (file)
index 0000000..7cb56fc
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+* 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_IFACE_H__
+#define __MMI_FUSION_IFACE_H__
+
+#include "mmi-common.h"
+
+#define MMI_FUSION_ABI_MAJOR_MASK     0xFFFF0000
+#define MMI_FUSION_ABI_MINOR_MASK     0x0000FFFF
+
+#define MMI_FUSION_GET_ABI_MAJOR(m)   (((m) & MMI_FUSION_ABI_MAJOR_MASK) >> 16)
+#define MMI_FUSION_GET_ABI_MINOR(m)   ((m) & MMI_FUSION_ABI_MINOR_MASK)
+
+#define MMI_FUSION_SET_ABI_VERSION(major, minor)      \
+                ((((major) << 16) & MMI_FUSION_ABI_MAJOR_MASK) \
+                 | ((minor) & MMI_FUSION_ABI_MINOR_MASK))
+
+#define MMI_FUSION_API __attribute__ ((visibility("default")))
+
+#ifndef bool
+typedef int bool;
+#endif
+
+struct _mmi_fusion_module
+{
+       const char *name; /**< The name of a fusion module */
+       const char *so_name; /**< The shared library name of a fusion module */
+       unsigned long abi_version; /**< The API version of a fusion module */
+
+       mmi_fusion_module_data *(*fusion_init)(void);
+       void (*fusion_deinit)(mmi_fusion_module_data *fusion_data);
+};
+
+struct _mmi_fusion_handle
+{
+       mmi_fusion_module module_info;
+       mmi_state state;
+};
+
+struct _mmi_fusion_module_data
+{
+       mmi_state (*set_state)(mmi_state state);
+       mmi_state (*get_state)(void);
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//APIs for fusions
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__MMI_FUSION_IFACE_H__
index 32f1a4c70feac0b46835851ca50debd91fcab524..28e3f008e60721ec682cfe784ebd48ff71d4f2c9 100644 (file)
@@ -22,6 +22,7 @@
 */
 
 #include "mmi-fusion.h"
+#include "mmi-fusion-iface.h"
 
 void
 modality_fusions_init(void)