- This is for Tizen 4.0.
: Tizen 4.0 Configurability and Build Blocks require
to remove all profile-depending build options in spec files.
(No More profile macros)
- It is recommended to distinguish features/profiles at runtime.
unless it incurs too much overhead, which requires you to
create multiple binaries and subpackages.
Change-Id: Icaa34a008377114ca81757c9d73746e9dc0ca92e
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
PKG_CHECK_MODULES(EEZE, [eeze])
PKG_CHECK_MODULES(VCONF, [vconf])
PKG_CHECK_MODULES(DLOG, [dlog])
+PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, [capi-system-info])
AC_SUBST(ENLIGHTENMENT_CFLAGS)
AC_SUBST(ENLIGHTENMENT_LIBS)
BuildRequires: pkgconfig(eeze)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(capi-system-info)
%if !%{with wayland}
ExclusiveArch:
%endif
%build
CFLAGS+=" -Werror";
CXXFLAGS+=" -Werror";
-%if "%{profile}" == "tv"
-CFLAGS+=" -D_TV";
-CXXFLAGS+=" -D_TV";
-%endif
%autogen
%configure
e_mod_input_panel.c \
wti_log.c
module_la_LIBADD =
-module_la_CFLAGS = @WAYLAND_CFLAGS@ @ENLIGHTENMENT_CFLAGS@ @EEZE_CFLAGS@ @VCONF_CFLAGS@ -DHAVE_WAYLAND_ONLY -DHAVE_WAYLAND
-module_la_LDFLAGS = -module -avoid-version @WAYLAND_LIBS@ @ENLIGHTENMENT_LIBS@ @EEZE_LIBS@ @VCONF_LIBS@
+module_la_CFLAGS = @WAYLAND_CFLAGS@ @ENLIGHTENMENT_CFLAGS@ @EEZE_CFLAGS@ @VCONF_CFLAGS@ @CAPI_SYSTEM_INFO_CFLAGS@ -DHAVE_WAYLAND_ONLY -DHAVE_WAYLAND
+module_la_LDFLAGS = -module -avoid-version @WAYLAND_LIBS@ @ENLIGHTENMENT_LIBS@ @EEZE_LIBS@ @VCONF_LIBS@ @CAPI_SYSTEM_INFO_LIBS@
module_la_DEPENDENCIES = $(top_builddir)/config.h
e_client_util_move_without_frame(ec, nx, ny);
}
-#ifndef _TV
static void
_ips_show(E_Client *ec)
{
end:
return ECORE_CALLBACK_PASS_ON;
}
-#endif
static void
_e_input_panel_surface_visible_update(E_Input_Panel_Surface *ips)
if ((ips->showing) && (e_pixmap_usable_get(ec->pixmap)))
{
-#ifdef _TV
- _e_input_panel_position_set(ec, ec->client.w, ec->client.h);
- ec->visible = EINA_TRUE;
- evas_object_geometry_set(ec->frame, ec->x, ec->y, ec->w, ec->h);
- evas_object_show(ec->frame);
- e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
-#else
- if (ec->visible)
- return;
-
- WTI_LOG("IPS::DEFER_SHOW::ADD");
- ips->wait_update = EINA_TRUE;
- if (!ips->eh.buf_change)
+ if (_TV)
{
- ips->eh.buf_change =
- ecore_event_handler_add(E_EVENT_CLIENT_BUFFER_CHANGE,
- _ips_cb_buffer_change, ips);
+ _e_input_panel_position_set(ec, ec->client.w, ec->client.h);
+ ec->visible = EINA_TRUE;
+ evas_object_geometry_set(ec->frame, ec->x, ec->y, ec->w, ec->h);
+ evas_object_show(ec->frame);
+ e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+ }
+ else
+ {
+ if (ec->visible)
+ return;
+
+ WTI_LOG("IPS::DEFER_SHOW::ADD");
+ ips->wait_update = EINA_TRUE;
+ if (!ips->eh.buf_change)
+ {
+ ips->eh.buf_change =
+ ecore_event_handler_add(E_EVENT_CLIENT_BUFFER_CHANGE,
+ _ips_cb_buffer_change, ips);
+ }
}
-#endif
}
else
{
}
}
-#ifndef _TV
static void
_ips_client_frame_flush(E_Input_Panel_Surface *ips)
{
end:
return ECORE_CALLBACK_PASS_ON;
}
-#endif
EINTERN void
e_input_panel_wait_update_set(Eina_Bool wait_update)
{
-#ifndef _TV
- E_Input_Panel_Surface *ips;
- Eina_List *l;
+ if (!_TV)
+ {
+ E_Input_Panel_Surface *ips;
+ Eina_List *l;
- if (!g_input_panel)
- return;
+ if (!g_input_panel)
+ return;
- g_input_panel->wait_update = wait_update;
+ g_input_panel->wait_update = wait_update;
- /* If we are in wait_update mode, the input panel surfaces have to be updated forcibly */
- if (wait_update)
- {
- EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips)
+ /* If we are in wait_update mode, the input panel surfaces have to be updated forcibly */
+ if (wait_update)
{
- if (!ips->ec) continue;
- _ips_client_frame_flush(ips);
- }
+ EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips)
+ {
+ if (!ips->ec) continue;
+ _ips_client_frame_flush(ips);
+ }
- if (!g_input_panel->buf_change_handler)
- {
- WTI_LOG("IPS::WAIT::UPDATE::SET (add buf change handler)\n");
- g_input_panel->buf_change_handler = ecore_event_handler_add(E_EVENT_CLIENT_BUFFER_CHANGE,
- _ip_cb_e_buf_change, NULL);
+ if (!g_input_panel->buf_change_handler)
+ {
+ WTI_LOG("IPS::WAIT::UPDATE::SET (add buf change handler)\n");
+ g_input_panel->buf_change_handler = ecore_event_handler_add(E_EVENT_CLIENT_BUFFER_CHANGE,
+ _ip_cb_e_buf_change, NULL);
+ }
}
+ else
+ E_FREE_FUNC(g_input_panel->buf_change_handler, ecore_event_handler_del);
}
- else
- E_FREE_FUNC(g_input_panel->buf_change_handler, ecore_event_handler_del);
-#endif
}
EINTERN void
#include <Eeze.h>
#include <Ecore_Wayland.h>
#include <dlog.h>
+#include <stdlib.h>
+#include <system_info.h>
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "WL_TEXTINPUT"
+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;
+}
+
static Eina_Bool _e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type, void *event);
static void set_soft_keyboard_mode();
free(language);
}
/* We do not want to change the current keymap related behavior in TV profile for now */
-#ifndef _TV
- /* Resetting the H/W keyboard language mode to English, would be more appropriate when the
- * display language gets changed, such as the cases like changing from French to Russian, for example */
- e_comp_wl_input_keymap_set(g_keymap_info[0].rules, g_keymap_info[0].models, g_keymap_info[0].layout, NULL, NULL, NULL, NULL);
-#endif
+ if (!_TV)
+ {
+ /* Resetting the H/W keyboard language mode to English, would be more appropriate when the
+ * display language gets changed, such as the cases like changing from French to Russian, for example */
+ e_comp_wl_input_keymap_set(g_keymap_info[0].rules, g_keymap_info[0].models, g_keymap_info[0].layout, NULL, NULL, NULL, NULL);
+ }
g_keyboard_mode_engligh = EINA_TRUE;
}
if (!context) return EINA_FALSE;
/* We do not want to change the current keymap related behavior in TV profile for now */
-#ifndef _TV
- const char *keyname_space = "space";
- if ((strncmp(ev->keyname, keyname_space, strlen(keyname_space)) == 0) && (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT))
+ if (!_TV)
{
- int keymap_index;
- keymap_index = g_keyboard_mode_engligh ? g_keymap_index : 0;
- e_comp_wl_input_keymap_set(g_keymap_info[keymap_index].rules, g_keymap_info[keymap_index].models, g_keymap_info[keymap_index].layout, NULL, NULL, NULL, NULL);
- wl_keyboard_send_keymap(context->kbd.resource, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
- e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
- g_keyboard_mode_engligh = !g_keyboard_mode_engligh;
-
- return EINA_TRUE;
+ const char *keyname_space = "space";
+ if ((strncmp(ev->keyname, keyname_space, strlen(keyname_space)) == 0) && (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT))
+ {
+ int keymap_index;
+ keymap_index = g_keyboard_mode_engligh ? g_keymap_index : 0;
+ e_comp_wl_input_keymap_set(g_keymap_info[keymap_index].rules, g_keymap_info[keymap_index].models, g_keymap_info[keymap_index].layout, NULL, NULL, NULL, NULL);
+ wl_keyboard_send_keymap(context->kbd.resource, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
+ e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
+ g_keyboard_mode_engligh = !g_keyboard_mode_engligh;
+
+ return EINA_TRUE;
+ }
}
-#endif
return EINA_FALSE;
}
if (text_input->resource)
wl_text_input_send_leave(text_input->resource);
-#ifdef _TV
- g_disable_show_panel = EINA_FALSE;
-#endif
+ if (_TV)
+ g_disable_show_panel = EINA_FALSE;
}
}
wl_input_method_send_activate(input_method->resource, context->resource, text_input->id);
}
-#ifdef _TV
- set_soft_keyboard_mode();
-#endif
+ if (_TV)
+ set_soft_keyboard_mode();
if (text_input->resource)
wl_text_input_send_enter(text_input->resource, surface);
e_input_panel_wait_update_set(EINA_TRUE);
}
-#ifdef _TV
- e_input_panel_visibility_change(EINA_TRUE);
-#endif
+ if (_TV)
+ e_input_panel_visibility_change(EINA_TRUE);
/* If the input panel state was WILL_HIDE, it means that the conformant area information needs to be restored */
if (g_input_panel_state == E_INPUT_PANEL_STATE_WILL_HIDE)
EINTERN void e_input_panel_wait_update_set(Eina_Bool wait_update);
EINTERN void e_input_panel_transient_for_set(E_Client *parent);
+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)
#endif