INCLUDE(GNUInstallDirs)
INCLUDE(FindPkgConfig)
-SET(PKGS_CHECK_MODULES
- smartreply
- )
SET(VERSION_MAJOR 1)
SET(VERSION ${VERSION_MAJOR}.0.0)
-pkg_check_modules(PKGS REQUIRED ${PKGS_CHECK_MODULES})
-
-FOREACH(flag ${PKGS_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
- SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
-ENDFOREACH(flag)
-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -Wall -fPIE")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -fPIE")
#pragma once
+#include "w-input-selector.h"
#include <Elementary.h>
#include <efl_extension.h>
{
Evas_Object *nf;
Evas_Object *more_option_layout;
+#ifdef _WEARABLE
Eext_Object_Item *item;
-
+#endif
Eina_Bool option_opened;
void *voicedata;
REPLY_APP_CONTROL,
};
+typedef enum {
+ TIZEN_PROFILE_UNKNOWN = 0,
+ TIZEN_PROFILE_MOBILE = 0x1,
+ TIZEN_PROFILE_WEARABLE = 0x2,
+ TIZEN_PROFILE_TV = 0x4,
+ TIZEN_PROFILE_IVI = 0x8,
+ TIZEN_PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+extern tizen_profile_t _get_tizen_profile();
+#define _TV (_get_tizen_profile() == TIZEN_PROFILE_TV)
+#define _MOBILE (_get_tizen_profile() == TIZEN_PROFILE_MOBILE)
+#define _WEARABLE (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
typedef struct appdata{
Evas_Object* win_main;
Evas_Object* conform;
Evas_Object* naviframe;
Evas_Object* genlist;
+#ifdef _WEARABLE
Eext_Circle_Surface *circle_surface;
+#endif
app_control_h source_app_control;
int app_type;
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-media-audio-io)
BuildRequires: pkgconfig(smartreply)
+BuildRequires: pkgconfig(capi-system-info)
%if %{enable_log_manager}
BuildRequires: pkgconfig(bundle)
#PKG_CHECK_MODULES(GRAPHICS_EXTENSION REQUIRED graphics-extension)
#PKG_CHECK_MODULES(WNOTI_SERVICE REQUIRED wnoti-service2)
#PKG_CHECK_MODULES(SAP_CLIENT_STUB_API REQUIRED sap-client-stub-api)
-
+PKG_CHECK_MODULES(SMARTREPLY REQUIRED smartreply)
+PKG_CHECK_MODULES(CAPI_SYSTEM_INFO REQUIRED capi-system-info)
SET(W_INPUT_SELECTOR inputdelegator)
FILE(GLOB W_INPUT_SELECTOR_SRCS *.cpp)
${DATA_CONTROL_INCLUDE_DIRS}
${WNOTI_SERVICE_INCLUDE_DIRS}
${SAP_CLIENT_STUB_API_INCLUDE_DIRS}
- ${CAPI_MEDIA_AUDIO_IO_INCLUDE_DIRS})
+ ${CAPI_MEDIA_AUDIO_IO_INCLUDE_DIRS}
+ ${SMARTREPLY_INCLUDE_DIRS}
+ ${CAPI_SYSTEM_INFO_INCLUDE_DIRS})
LINK_DIRECTORIES(${DLOG_LIBRARY_DIRS}
${WNOTI_SERVICE_LIBRARY_DIRS}
${SAP_CLIENT_STUB_API_LIBRARY_DIRS}
${CAPI_MEDIA_AUDIO_IO_LIBRARY_DIRS}
+ ${SMARTREPLY_LIBRARY_DIRS}
+ ${CAPI_SYSTEM_INFO_LIBRARY_DIRS}
)
ADD_EXECUTABLE(${W_INPUT_SELECTOR}
${STT_LIBRARIES}
${VCONF_LIBRARIES}
${CAPI_MEDIA_AUDIO_IO_LIBRARIES}
+ ${SMARTREPLY_LIBRARIES}
+ ${CAPI_SYSTEM_INFO_LIBRARIES}
)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
MoreOption::MoreOption(Evas_Object *naviframe, void* voicedata)
: nf(naviframe)
, more_option_layout(NULL)
+#ifdef _WEARABLE
, item(NULL)
+#endif
, option_opened(EINA_FALSE)
, voicedata(voicedata) {
/** todo. implement constructor */
#include <vconf.h>
#include <vconf-keys.h>
#include <stdint.h>
+#include <system_info.h>
#include "w-input-selector.h"
#include "w-input-template.h"
Evas_Coord last_step; // 0 ~ 9 for gesture, 10~11 for rotary
+tizen_profile_t _get_tizen_profile()
+{
+ static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+ if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
+ return profile;
+
+ char *profileName;
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ switch (*profileName)
+ {
+ case 'm':
+ case 'M':
+ profile = TIZEN_PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = TIZEN_PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = TIZEN_PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ profile = TIZEN_PROFILE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = TIZEN_PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
+}
+
+
void _init_app_data(App_Data* app_data);
static void _app_language_changed(app_event_info_h event_info, void *user_data);
reply_to_sender_by_callback(NULL, NULL);
elm_exit();
}
-
+#ifdef _WEARABLE
Evas_Object *circle_genlist = (Evas_Object *) evas_object_data_get(app_data->genlist, "circle");
-
eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
+#endif
}
static void _item_realized(void *data, Evas_Object *obj, void *event_info) //called when list scrolled
return NULL;
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
-
+#ifdef _WEARABLE
Evas_Object* circle_object_genlist = eext_circle_object_genlist_add(genlist, app_data->circle_surface);
eext_circle_object_genlist_scroller_policy_set(circle_object_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
evas_object_data_set(genlist, "circle", (void *) circle_object_genlist);
eext_rotary_object_event_activated_set(circle_object_genlist, EINA_TRUE);
-
+#endif
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
Evas_Object* conform = NULL;
Evas_Object* bg = NULL;
Evas_Object* window = NULL;
+#ifdef _WEARABLE
Eext_Circle_Surface *surface;
-
+#endif
if (!user_data) {
return false;
}
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
conform = elm_conformant_add(window);
+#ifdef _WEARABLE
surface = eext_circle_surface_conformant_add(conform);
+#endif
evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
app_data->win_main = window;
app_data->conform = conform;
app_data->layout_main = layout;
+#ifdef _WEARABLE
app_data->circle_surface = surface;
+#endif
app_data->app_type = APP_TYPE_SELECT_MODE;
Evas_Object *naviframe = elm_naviframe_add(layout);
#define _EDJ(x) elm_layout_edje_get(x)
+#ifdef _WEARABLE
static Evas_Object *g_circle_object_first = NULL;
-
+#endif
#define ISE_PREFERENCE_AGREEMENT "wearable_input_agreement"
#define VCONFKEY_USER_AGREEMENT "db/wms/user_agreement/svoice"
#define VCONFKEY_USER_AGREED_TOS "db/private/ise/stt/tos"
_naviframe_pop_cb2(void *data , Elm_Object_Item *it)
{
PRINTFUNC(DLOG_DEBUG, "");
-
+#ifdef _WEARABLE
if (g_circle_object_first)
eext_rotary_object_event_activated_set(g_circle_object_first, EINA_TRUE);
-
+#endif
return EINA_TRUE;
}
Evas_Object *outer_layout;
Evas_Object *inner_layout;
Evas_Object *scroller;
+#ifdef _WEARABLE
Evas_Object *circle_scroller;
-
+#endif
std::string terms = "";
string edj_path = get_resource_path();
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
elm_object_scroll_lock_x_set(scroller, EINA_TRUE);
evas_object_show(scroller);
+#ifdef _WEARABLE
circle_scroller = eext_circle_object_scroller_add(scroller, ad->circle_surface);
eext_circle_object_scroller_policy_set(circle_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
eext_rotary_object_event_activated_set(circle_scroller, EINA_TRUE);
+#endif
elm_object_part_content_set(outer_layout, "elm.swallow.content", scroller);
//------------inner layout----------------------
Evas_Object *outer_layout;
Evas_Object *inner_layout;
Evas_Object *scroller;
+#ifdef _WEARABLE
Evas_Object *circle_scroller;
-
+#endif
std::string terms = "";
string edj_path = get_resource_path();
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
elm_object_scroll_lock_x_set(scroller, EINA_TRUE);
evas_object_show(scroller);
+#ifdef _WEARABLE
circle_scroller = eext_circle_object_scroller_add(scroller, ad->circle_surface);
eext_circle_object_scroller_policy_set(circle_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
eext_rotary_object_event_activated_set(circle_scroller, EINA_TRUE);
- elm_object_part_content_set(outer_layout, "elm.swallow.content", scroller);
g_circle_object_first = circle_scroller;
+#endif
+ elm_object_part_content_set(outer_layout, "elm.swallow.content", scroller);
//------------inner layout----------------------
inner_layout = elm_layout_add(scroller);
Evas_Object *outer_layout;
Evas_Object *inner_layout;
Evas_Object *scroller;
+#ifdef _WEARABLE
Evas_Object *circle_scroller;
-
+#endif
std::string terms = "";
string edj_path = get_resource_path();
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
elm_object_scroll_lock_x_set(scroller, EINA_TRUE);
evas_object_show(scroller);
+#ifdef _WEARABLE
circle_scroller = eext_circle_object_scroller_add(scroller, ad->circle_surface);
eext_circle_object_scroller_policy_set(circle_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
eext_rotary_object_event_activated_set(circle_scroller, EINA_TRUE);
- elm_object_part_content_set(outer_layout, "elm.swallow.content", scroller);
g_circle_object_first = circle_scroller;
+#endif
+ elm_object_part_content_set(outer_layout, "elm.swallow.content", scroller);
//------------inner layout----------------------
inner_layout = elm_layout_add(scroller);
VoiceData *voicedata = (VoiceData *)data;
Evas_Object *scroller = NULL;
- Evas_Object *circle_scroller = NULL;
-
scroller = elm_layout_content_get((Evas_Object *)voicedata->layout_main, "text_area");
+#ifdef _WEARABLE
+ Evas_Object *circle_scroller = NULL;
circle_scroller = (Evas_Object *) evas_object_data_get(scroller, "circle");
eext_rotary_object_event_activated_set(circle_scroller, bActivate);
+#endif
}
static Evas_Object *create_textblock(void* data)
elm_scroller_page_scroll_limit_set(scroller, 0, 1);
elm_object_scroll_lock_x_set(scroller, EINA_TRUE);
-
-// uxt_scroller_set_auto_scroll_enabled(scroller, EINA_FALSE);
-
+#ifdef _WEARABLE
circle_scroller = eext_circle_object_scroller_add(scroller, app_data->circle_surface);
eext_circle_object_scroller_policy_set(circle_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
eext_rotary_object_event_activated_set(circle_scroller, EINA_TRUE);
-
+#endif
box = elm_box_add(scroller);
inner_layout = elm_layout_add(scroller);