BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-base-1.0)
BuildRequires: pkgconfig(gstreamer-app-1.0)
+BuildRequires: pkgconfig(libaurum)
+BuildRequires: pkgconfig(capi-system-info)
#Build dependencies for tests
BuildRequires: pkgconfig(gmock)
'iu/CommandManager.cpp',
'iu/CommandManager.h',
'iu/json_provider.cpp',
- 'iu/json_provider.h'
+ 'iu/json_provider.h',
+ 'output_modality/mmi_output_modality.cpp',
+ 'output_modality/mmi_output_modality.h',
+ 'output_modality/TouchModule.cpp',
+ 'output_modality/TouchModule.h',
]
install_headers(
json_glib_dep = dependency('json-glib-1.0')
libtzplatform_config_dep = dependency('libtzplatform-config')
xkbcommon_dep = dependency('xkbcommon', method : 'pkg-config')
+aurum_dep = dependency('libaurum', method : 'pkg-config')
+system_info_dep = dependency('capi-system-info', method : 'pkg-config')
mmimgr_deps = [
ecore_dep,
rpc_port_dep,
json_glib_dep,
libtzplatform_config_dep,
- xkbcommon_dep]
+ xkbcommon_dep,
+ aurum_dep,
+ system_info_dep
+ ]
mmimgr_include_dirs = include_directories('.')
MMI_EVENT_STATE_CHANGE_TYPE_STATE_CHANGE
} mmi_event_state_change_type;
+typedef enum mmi_voice_touch_mode
+{
+ MMI_VOICE_TOUCH_MODE_TOOLTIP,
+ MMI_VOICE_TOUCH_MODE_GRID
+} mmi_voice_touch_mode;
+
typedef struct
{
int type;
GList *list; // clickable_item
} mmi_provider_event_screen_analyzer;
+typedef struct
+{
+ int mode;// tooltip, grid
+ int timestamp;
+ const char *object_id;
+ int coord_x;
+ int coord_y;
+} mmi_output_modality_voice_touch;
+
typedef unsigned long long ull;
typedef enum mmi_state
int mmi_core_init()
{
_I("Initialize MMI core module");
+
+ output_modality_initialize();
+
int ret = MMI_IU_ERROR_NONE;
ret = mmi_iu_init();
if (ret != MMI_IU_ERROR_NONE) {
_I("Shutdown MMI core module");
__shutdown_event_handler();
+ output_modality_shutdown();
+
int ret = mmi_iu_shutdown();
return ret;
}
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <Aurum.h>
+#include <string>
+#include <memory>
+#include <system_info.h>
+
+#include "mmi-manager-dbg.h"
+#include "TouchModule.h"
+
+#define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
+#define TIZEN_PROFILE_COMMON (get_tizen_profile() == _PROFILE_COMMON)
+
+typedef enum {
+ _PROFILE_UNKNOWN = 0,
+ _PROFILE_MOBILE = 0x1,
+ _PROFILE_WEARABLE = 0x2,
+ _PROFILE_TV = 0x4,
+ _PROFILE_IVI = 0x8,
+ _PROFILE_COMMON = 0x10,
+} tizen_profile_e;
+
+static tizen_profile_e get_tizen_profile()
+{
+ tizen_profile_e profile;
+ char *profileName = NULL;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName) {
+ case 't':
+ case 'T':
+ profile = _PROFILE_TV;
+ break;
+ case 'm':
+ case 'M':
+ profile = _PROFILE_MOBILE;
+ break;
+ default:
+ profile = _PROFILE_COMMON;
+ }
+
+ free(profileName);
+ return profile;
+}
+
+TouchModule::TouchModule()
+{
+ Aurum::AccessibleWatcher::getInstance();
+}
+
+TouchModule::~TouchModule()
+{
+
+}
+
+bool TouchModule::ClickByObjectId(std::string objectId)
+{
+ LOGD("execute by object id = %s", objectId.c_str());
+ std::shared_ptr<Aurum::UiDevice> device = Aurum::UiDevice::getInstance();
+ auto sel = std::make_shared<Aurum::UiSelector>();
+ bool ret = false;
+
+ sel->id(objectId);
+ std::shared_ptr<Aurum::UiObject> found = device->findObject(sel);
+
+ if (nullptr == found) {
+ return false;
+ }
+
+ LOGD("click object = %s", objectId.c_str());
+ found->getAccessibleNode()->print(1,1);
+ if (TIZEN_PROFILE_TV) {
+ found->setFocus();
+ std::string input_text("Return");
+ ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::PRESS);
+ LOGD("press ret = %d", ret);
+
+ ret = device->pressKeyCode(input_text, Aurum::KeyRequestType::RELEASE);
+ LOGD("release ret = %d", ret);
+ LOGD("clicked keyname result = %d", ret);
+ } else {
+ found->click();
+ ret = true;
+ }
+ return ret;
+}
+
+bool TouchModule::ClickByCoordinate(int x, int y)
+{
+ LOGD("execute by coordinate = %d, %d", x, y);
+ std::shared_ptr<Aurum::UiDevice> device = Aurum::UiDevice::getInstance();
+ bool ret = false;
+ ret = device->click(x,y);
+ LOGD("clicked, ret = %d", ret);
+ return ret;
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#ifndef __TOUCH_MODULE_H__
+#define __TOUCH_MODULE_H__
+
+#include <unistd.h>
+#include <string>
+
+class TouchModule
+{
+public:
+ TouchModule();
+ virtual ~TouchModule();
+
+ bool ClickByObjectId(std::string key);
+ bool ClickByCoordinate(int x, int y);
+};
+
+#endif /* __TOUCH_MODULE_H__ */
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#include <string>
+
+#include "mmi-common.h"
+#include "TouchModule.h"
+#include "mmi-manager-dbg.h"
+#include "mmi_output_modality.h"
+
+static TouchModule *g_touch_module = nullptr;
+
+EXPORT_API void output_modality_initialize()
+{
+ LOGD("initialize output modality");
+ g_touch_module = new TouchModule();
+}
+
+EXPORT_API void output_modality_shutdown()
+{
+ LOGD("shutdown output modality");
+ if (g_touch_module) {
+ delete g_touch_module;
+ g_touch_module = NULL;
+ }
+}
+
+EXPORT_API int output_modality_voice_touch(mmi_output_modality_voice_touch modality)
+{
+ mmi_voice_touch_mode mode = (mmi_voice_touch_mode)modality.mode;
+ int ret = 0;
+
+ if (MMI_VOICE_TOUCH_MODE_TOOLTIP == mode) {
+ LOGD("voice touch by tooltip");
+ std::string objID = std::string(modality.object_id, strlen(modality.object_id));
+ ret = g_touch_module->ClickByObjectId(objID);
+ } else if (MMI_VOICE_TOUCH_MODE_GRID == mode) {
+ LOGD("voice touch by grid");
+ ret = g_touch_module->ClickByCoordinate(modality.coord_x, modality.coord_y);
+ } else {
+ return 0;
+ }
+ LOGD("voice touch done");
+
+ return ret;
+}
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __MMI_OUTPUT_MODALITY_H__
+#define __MMI_OUTPUT_MODALITY_H__
+
+#include "mmi-common.h"
+#include <tizen.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize MMI Output Modality Manager
+ */
+void output_modality_initialize();
+
+
+/**
+ * @brief Shutdown MMI Output Modality Manager
+ */
+void output_modality_shutdown();
+
+/**
+ * @brief Act MMI Output Modality Voice Touch
+ *
+ * @return int 1 on success, 0 on fail
+ */
+int output_modality_voice_touch(mmi_output_modality_voice_touch modality);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MMI_OUTPUT_MODALITY_H__ */
\ No newline at end of file