%manifest %{name}.manifest
%defattr(-,root,root,-)
%license COPYING
-%{_includedir}/mmi-manager.h
+%{_includedir}/mmi-*.h
%{_libdir}/pkgconfig/*
%files tests
'mmi-fusion.c',
'mmi-provider.c',
'mmi-fusion.h',
+ 'mmi-common.h',
'mmi-provider.h',
+ 'mmi-provider-iface.h',
+ 'mmi-manager-event-types.h',
'interface/mmifw_stub.h',
- 'interface/mmifw_stub.c'
+ 'interface/mmifw_stub.c',
]
install_headers(
- 'mmi-manager.h'
+ 'mmi-manager.h',
+ 'mmi-common.h',
+ 'mmi-manager-event-types.h',
+ 'mmi-provider-iface.h'
)
glib_dep = dependency('glib-2.0')
--- /dev/null
+/*
+* 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_COMMON_H__
+#define __MMI_COMMON_H__
+
+typedef unsigned long long ull;
+
+typedef enum mmi_provider_op_mode
+{
+ MODALITY_PROVIDER_MODE_NONE,
+ MODALITY_PROVIDER_MODE_PROPAGATE_EVENT,
+ MODALITY_PROVIDER_MODE_KEEP_EVENT,
+ MODALITY_PROVIDER_MODE_DROP_EVENT,
+} mmi_provider_op_mode;
+
+typedef enum mmi_provider_capability
+{
+ MODALITY_PROVIDER_CAP_NONE = 0,
+ MODALITY_PROVIDER_CAP_KEY_EVENT = (1 << 0),
+ MODALITY_PROVIDER_CAP_MOUSE_EVENT = (1 << 1),
+ MODALITY_PROVIDER_CAP_TOUCH_EVENT = (1 << 2),
+ MODALITY_PROVIDER_CAP_GESTURE_EVENT = (1 << 3),
+ MODALITY_PROVIDER_CAP_VOICE_EVENT = (1 << 4),
+ MODALITY_PROVIDER_CAP_VISION_EVENT = (1 << 5),
+ MODALITY_PROVIDER_CAP_UNKNOWN = ((ull)1 << 62),
+ MODALITY_PROVIDER_CAP_MAX = ((ull)1 << 63)
+} mmi_provider_capability;
+
+typedef enum mmi_provider_result
+{
+ MODALITY_PROVIDER_RESULT_NONE,
+ MODALITY_PROVIDER_RESULT_FAIL,
+ MODALITY_PROVIDER_RESULT_SUCCESS
+} mmi_provider_result;
+
+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;
+
+#endif //__MMI_COMMON_H__
--- /dev/null
+/*
+* 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_EVENT_TYPES_H__
+#define __MMI_MANAGER_EVENT_TYPES_H__
+
+MMI_API extern int MMI_PROVIDER_EVENT_KEY;
+MMI_API extern int MMI_PROVIDER_EVENT_GESTURE;
+MMI_API extern int MMI_PROVIDER_EVENT_VOICE;
+MMI_API extern int MMI_PROVIDER_EVENT_VISION;
+
+typedef struct
+{
+ int type;//down or up
+ int timestamp;
+ void *user_data;
+ int duration;
+ double confidence;
+ int keycode;
+ bool key_down;
+ char *keyname;
+ char *source;//event source information
+} mmi_provider_event_key;
+
+typedef struct gesture_event
+{
+ int type;//swipe up, down, left, palm open, palm cover
+ int timestamp;
+ void *user_data;
+ int duration;
+ double confidence;
+ char *source;//event source information
+} mmi_provider_event_gesture;
+
+typedef struct
+{
+ int type;//play, pause, ..., yes, no
+ int timestamp;
+ void *user_data;
+ int duration;
+ double confidence;
+ char *cmd;
+ char **args;
+ int nargs;//num of args
+ char *source;//event source information
+} mmi_provider_event_voice;
+
+typedef struct
+{
+ int type;//leave, enter, move away, move closer
+ int timestamp;
+ void *user_data;
+ int duration;
+ double confidence;
+ char *cmd;
+ char **args;
+ int nargs;//num of args
+ char *source;//event source information
+} mmi_provider_event_vision;
+
+#endif //__MMI_MANAGER_EVENTS_TYPES_H__
--- /dev/null
+/*
+* 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_IFACE_H__
+#define __MMI_PROVIDER_IFACE_H__
+
+#include "mmi-common.h"
+
+#define MMI_PROVIDER_ABI_MAJOR_MASK 0xFFFF0000
+#define MMI_PROVIDER_ABI_MINOR_MASK 0x0000FFFF
+
+#define MMI_PROVIDER_GET_ABI_MAJOR(m) (((m) & MMI_PROVIDER_ABI_MAJOR_MASK) >> 16)
+#define MMI_PROVIDER_GET_ABI_MINOR(m) ((m) & MMI_PROVIDER_ABI_MINOR_MASK)
+
+#define MMI_PROVIDER_SET_ABI_VERSION(major, minor) \
+ ((((major) << 16) & MMI_PROVIDER_ABI_MAJOR_MASK) \
+ | ((minor) & MMI_PROVIDER_ABI_MINOR_MASK))
+
+#define MMI_PROVIDER_API __attribute__ ((visibility("default")))
+
+#ifndef bool
+typedef int bool;
+#endif
+
+struct _mmi_provider_module
+{
+ const char *name; /**< The name of a provider module */
+ const char *so_name; /**< The shared library name of a provider module */
+ const unsigned long long capabilities; /**< The capabilities provided by a provider module */
+ unsigned long abi_version; /**< The API version of a provider module */
+
+ mmi_provider_module_data *(*provider_init)(void);
+ void (*provider_deinit)(mmi_provider_module_data *provider_data);
+};
+
+struct _mmi_provider_handle
+{
+ mmi_provider_module module_info;
+ unsigned long long capabilities;
+ mmi_provider_op_mode op_mode;
+};
+
+struct _mmi_provider_module_data
+{
+ bool (*set_mode)(mmi_provider_op_mode mode);
+ mmi_provider_op_mode (*get_mode)(void);
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//APIs for providers
+int mmi_provider_register_caps(mmi_provider_handle provider, int caps);
+void *mmi_provider_alloc_event(int ev_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__MMI_PROVIDER_IFACE_H__
--- /dev/null
+/*
+* 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_INTERFACE_H__
+#define __MMI_PROVIDER_INTERFACE_H__
+
+#include "mmi-common.h"
+
+#define MMI_PROVIDER_ABI_MAJOR_MASK 0xFFFF0000
+#define MMI_PROVIDER_ABI_MINOR_MASK 0x0000FFFF
+
+#define MMI_PROVIDER_GET_ABI_MAJOR(m) (((m) & MMI_PROVIDER_ABI_MAJOR_MASK) >> 16)
+#define MMI_PROVIDER_GET_ABI_MINOR(m) ((m) & MMI_PROVIDER_ABI_MINOR_MASK)
+
+#define MMI_PROVIDER_SET_ABI_VERSION(major, minor) \
+ ((((major) << 16) & MMI_PROVIDER_ABI_MAJOR_MASK) \
+ | ((minor) & MMI_PROVIDER_ABI_MINOR_MASK))
+
+#define MMI_PROVIDER_API __attribute__ ((visibility("default")))
+
+#ifndef bool
+typedef int bool;
+#endif
+
+typedef struct _mmi_provider_module_data mmi_provider_module_data;
+struct _mmi_provider_module_data
+{
+ bool (*set_mode)(mmi_provider_op_mode mode);
+ mmi_provider_op_mode (*get_mode)(void);
+};
+
+typedef struct _mmi_provider_module mmi_provider_module;
+struct _mmi_provider_module
+{
+ const char *name; /**< The name of a provider module */
+ const char *so_name; /**< The shared library name of a provider module */
+ const unsigned long long capabilities; /**< The capabilities provided by a provider module */
+ unsigned long abi_version; /**< The API version of a provider module */
+
+ mmi_provider_module_data *(*provider_init)(void);
+ void (*provider_deinit)(mmi_provider_module_data *provider_data);
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__MMI_PROVIDER_INTERFACE_H__
* DEALINGS IN THE SOFTWARE.
*/
-#include "mmi-provider.h"
+#include "mmi-provider-iface.h"
+
+int
+mmi_provider_register_caps(mmi_provider_handle provider, int caps)
+{
+ (void) provider;
+ (void) caps;
+
+ return 0;
+}
+
+void *
+mmi_provider_alloc_event(int ev_type)
+{
+ (void) ev_type;
+
+ return (void *)0;
+}
void
modality_providers_init(void)
{
+ //Lookup and init modality providers
}
void
modality_providers_shutdown(void)
{
-}
\ No newline at end of file
+ //Do shutdown for intialized providers
+}