- This is for Tizen 4.0.
- API per profile for SDK is filetered by sdk-image.git.
You may include APIs not included for Wearable profile, which
is filtered during rootstraping of wearable SDK.
- API disable for .so is done at runtime.
- CC'ed SDK (sh.cat.lee@samsung.com) for SDK review
Change-Id: Ie4640b3f15a8044570e02b0e0a94fc91253bdb7a
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
SET(CMAKE_INSTALL_PREFIX /usr)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-IF (TIZEN_WEARABLE)
- ADD_DEFINITIONS("-DTIZEN_WEARABLE")
-ENDIF (TIZEN_WEARABLE)
-
SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
# required dependencies
-SET(dependents "dlog elementary capi-base-common libdrm libtbm")
+SET(dependents "dlog elementary capi-base-common capi-system-info libdrm libtbm")
SET(dependents "${dependents} ecore-wayland wayland-client wayland-tbm-client screenshooter-client tizen-extension-client")
* @privilege %http://tizen.org/privilege/display
* @remarks This API needs the privilege.
* If the application which is not get the privilege use this API, the window manager generates the permission deny error.
- $TZ_CFG_KEEP_BEGIN$
- * The application can notice this error if it set the callback function using the efl_util_set_window_screen_mode_error_cb().
- $TZ_CFG_KEEP_END$
+ * The application can notice this error if it set the callback function using the efl_util_set_window_screen_mode_error_cb() (non-wearable only).
* @param[in] window The EFL window
* @param[in] mode The screen mode
* @return @c 0 on success, otherwise a negative error value
*/
API int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode);
-$TZ_CFG_KEEP_BEGIN$
/**
* @deprecated Deprecated since 3.0.
* @brief Called when an error occurs for setting window's screen mode
- * @since_tizen 2.4
+ * @since_tizen $TZ_CFG_NONWEARABLE_24
* @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0.
* @param[in] window The EFL window
* @param[in] error_code The error code (#EFL_UTIL_ERROR_PERMISSION_DENIED)
/**
* @deprecated Deprecated since 3.0. Use the return value of efl_util_set_window_screen_mode() instead.
* @brief Registers a callback function to be invoked when an error which set the screen mode.
- * @since_tizen 2.4
+ * @since_tizen $TZ_CFG_NONWEARABLE_24
* @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0.
* @param[in] window The EFL window
* @param[in] callback The callback function to register
/**
* @deprecated Deprecated since 3.0. Use the return value of efl_util_set_window_screen_mode() instead.
* @brief Unregisters the callback function.
- * @since_tizen 2.4
+ * @since_tizen $TZ_CFG_NONWEARABLE_24
* @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0.
* @param[in] window The EFL window
* @return @c 0 on success, otherwise a negative error value
* @see efl_util_set_window_screen_mode_error_cb()
*/
API int efl_util_unset_window_screen_mode_error_cb(Evas_Object *window) TIZEN_DEPRECATED_API;
-$TZ_CFG_KEEP_END$
/**
* @brief Sets the user's preferred brightness of the specified window.
BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(capi-base-common)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libtbm)
cp %{SOURCE1001} .
cp -a include/efl_util.h.in include/efl_util.h
-%if "%{profile}" != "wearable"
- sed -i 's/\$TZ_CFG_VER_24_OR_30\$/2.4/g' include/efl_util.h
- sed -i 's/\$TZ_CFG_VER_24_OR_231\$/2.4/g' include/efl_util.h
- sed -i '/\$TZ_CFG_KEEP_BEGIN\$/d' include/efl_util.h
- sed -i '/\$TZ_CFG_KEEP_END\$/d' include/efl_util.h
-%else
- sed -i 's/\$TZ_CFG_VER_24_OR_30\$/3.0/g' include/efl_util.h
- sed -i 's/\$TZ_CFG_VER_24_OR_231\$/2.3.1/g' include/efl_util.h
- sed -ie '/\$TZ_CFG_KEEP_BEGIN\$/,/\$TZ_CFG_KEEP_END\$/{s/\$TZ_CFG_KEEP_BEGIN\$//p;d}' include/efl_util.h
-%endif
-
+sed -i 's/\$TZ_CFG_VER_24_OR_30\$/@if WEARABLE 3.0 @else 2.4 @endif/g' include/efl_util.h
+sed -i 's/\$TZ_CFG_VER_24_OR_231\$/@if WEARABLE 2.3.1 @else 2.4 @endif/g' include/efl_util.h
+sed -i 's/\$TZ_CFG_NONWEARABLE_24\$/@if WEARABLE @else 2.4 @endif/g' include/efl_util.h
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
-%if "%{profile}" == "wearable"
- -DTIZEN_WEARABLE=YES \
-%endif
make %{?jobs:-j%jobs}
#undef LOG_TAG
#endif
+/* Determine Tizen profile at runtime */
+#include <system_info.h>
+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;
+static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+static tizen_profile_t _get_tizen_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 inline tizen_profile_t get_tizen_profile()
+{
+ if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
+ return profile;
+ return _get_tizen_profile();
+}
+
+
#define LOG_TAG "TIZEN_N_EFL_UTIL"
return EFL_UTIL_ERROR_INVALID_PARAMETER;
}
-#ifndef TIZEN_WEARABLE
API int
efl_util_set_window_screen_mode_error_cb(Evas_Object *window,
efl_util_window_screen_mode_error_cb callback,
void *user_data)
{
+ /* Wearable device cannot use this. */
+ if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
+ return EFL_UTIL_ERROR_NO_SUCH_DEVICE;
+
dlog_print(DLOG_WARN, LOG_TAG,
"DEPRECATION WARNING: efl_util_set_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead.");
API int
efl_util_unset_window_screen_mode_error_cb(Evas_Object *window)
{
+ /* Wearable device cannot use this. */
+ if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
+ return EFL_UTIL_ERROR_NO_SUCH_DEVICE;
+
dlog_print(DLOG_WARN, LOG_TAG,
"DEPRECATION WARNING: efl_util_unset_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead.");
return EFL_UTIL_ERROR_NONE;
}
-#endif
API int
efl_util_set_window_brightness(Evas_Object *window, int brightness)