*
* @par Typical use case:
* To do something when predefined events (enum appcore_event) occur, use this API
- *
+ *
* @par Method of function operation:
* Using Heynoti subscription, Vconf changed callback, and AUL, Appcore invokes the registered callback function.
- *
+ *
* @par Important notes:
* Only one callback function can be set. If <I>cb</I> is NULL, unset the callback function about the event.\n
* Default behavior is performed when the specified event callback doesn't have registered.
* @param[in] cb callback function
* @param[in] data callback function data
*
- * @return 0 on success, -1 on error (<I>errno</I> set)
+ * @return 0 on success, -1 on error (<I>errno</I> set)
*
* @par Errors:
* EINVAL - Invalid event type
*
* @par Typical use case:
* To do something when the rotation mode is changed, use this API
- *
+ *
* @par Method of function operation:
* Appcore receives rotation change from Sensor framework. When Appcore receive the change, it invokes the registered callback function.
- *
+ *
* @par Important notes:
* Locks the rotation mode, the registered callback is not invoked.
*
* @param[in] cb callback function
* @param[in] data callback function data
*
- * @return 0 on success, -1 on error (<I>errno</I> set)
- *
+ * @return 0 on success, -1 on error (<I>errno</I> set)
+ *
* @par Errors:
* EINVAL - <I>cb</I> is NULL
* EALREADY - rotation callback function already registered
* This function unsets a callback function for rotation events.
*
* @return 0 on success, -1 on error
- *
+ *
* @pre Callback is set by appcore_set_rotation_cb().
* @post None.
* @see appcore_set_rotation_cb(), appcore_get_rotation_state()
*
* @par Method of function operation:
* This function gets the current rotation mode from Sensor framework.
- *
+ *
* @param[out] curr current rotation mode\n
* If Sensor framework is not working, curr is set to APPCORE_RM_UNKNOWN.
*
- * @return 0 on success, -1 on error (<I>errno</I> set)
- *
+ * @return 0 on success, -1 on error (<I>errno</I> set)
+ *
* @par Errors:
* EINVAL - <I>curr</I> is NULL
*
enum appcore_rm curr;
...
-
+
r = appcore_get_rotation_state(&curr);
if (r == -1) {
// add exception handling
*
* @par Method of function operation:
* This function gets the current time format from vconf.
- *
+ *
* @param[out] timeformat current time format\n
* If vconf is not working, timeformat is set to APPCORE_TIME_FORMAT_UNKNOWN.
*
- * @return 0 on success, -1 on error (<I>errno</I> set)
- *
+ * @return 0 on success, -1 on error (<I>errno</I> set)
+ *
* @par Errors:
* EINVAL - <I>timeformat</I> is NULL
*
enum appcore_time_format timeformat;
...
-
+
r = appcore_get_timeformat(&timeformat);
if (r == -1) {
// add exception handling
*
* @par Typical use case:
* This function provides convenience for using gettext.
- *
+ *
* @par Method of function operation:
* Calls setlocale(), bindtextdomain() and textdomain() internally.
- *
+ *
* @par Corner cases/exceptions:
* If <I>dirname</I> is NULL, the previously set base directory is used. Typically, it is /usr/share/locale.
*
* @param[in] domainname a message domain name(text domain name) \n Must be a non-empty string.
- * @param[in] dirname the base directory for message catalogs belonging to the specified domain \n
+ * @param[in] dirname the base directory for message catalogs belonging to the specified domain \n
+ *
+ * @return 0 on success, -1 on error (<I>errno</I> set)
*
- * @return 0 on success, -1 on error (<I>errno</I> set)
- *
* @par Errors:
* EINVAL - <I>domain</I> is NULL
*
r = appcore_set_i18n("i18n_example", NULL);
if (r == -1) {
- // add exception handling
+ // add exception handling
}
...
}
/**
* @par Description:
- * Set the measuring start time
+ * Set the measuring start time
*
* @par Purpose:
* To measure the time, the start time should be set. This function set the start point.
*
* @par Typical use case:
* It is used to measure the time for doing something. \n
- * This function set the start point. And, appcore_measure_time() returns
+ * This function set the start point. And, appcore_measure_time() returns
* the elapsed time from the start point.
*
* @see appcore_measure_time()
- *
+ *
* @par Method of function operation:
* Store the current time to the internal variable.
*
* This function returns the elapsed time from the start point set by appcore_measure_start().
*
* @see appcore_measure_start()
- *
+ *
* @par Method of function operation:
* This function subtracts the current time from the start point.
*
* This function returns the elapsed time from a time specified in environment variable.
*
* @see appcore_measure_start()
- *
+ *
* @par Method of function operation:
* This function subtracts the current time from a time specified in environment variable.
*
* If <I>envnm</I> is NULL, "APP_START_TIME" set by launcher is used.
* If the environment variable is not set or invalid format, returns 0.
*
- * @param[in] envnm environment variable name which has
+ * @param[in] envnm environment variable name which has
* the start time (format: "%u %u", seconds, micro seconds)
*
* @return Milliseconds from a time specified in environment variable
{
...
- // do something
+ // do something
- printf("it takes %d msec from APP_START\n",
+ printf("it takes %d msec from APP_START\n",
appcore_measure_time_from("APP_START_TIME"));
...
}
/**
* @par Description:
* Appcore init. Internal use only
- *
+ *
* @par Important notes:
* Except special case, NEVER use this. Use the appcore EFL or GTK instead of this.
*
/**
* @par Description:
* Appcore exit. Internal use only.
- *
+ *
* @par Important notes:
* Except special case, NEVER use this.
*
* sqlite3_release_memory() if sqlite3 is used, and malloc_trim(). Also, trims native stack.
*
* @par Important notes:
- * Currently, this function is automatically called in the following 2 cases:\n
+ * Currently, this function is automatically called in the following 2 cases:\n
* (1) when the application enters into the pause state and\n
- * (2) when low memory event is invoked and the application is on pause.\n
+ * (2) when low memory event is invoked and the application is on pause.\n
* Developers can use this function when they want extra memory flush utility.
*
* @return 0 on success, -1 on error
/**
* @par Description:
* Set a open callback
- * Only when application is running, if aul_open api is called, then this callback function is called.
- * If your open_cb function return -1, then appcore doesn't raise window.
+ * Only when application is running, if aul_open api is called, then this callback function is called.
+ * If your open_cb function return -1, then appcore doesn't raise window.
*
* @param[in] cb callback function
* @param[in] data callback function data
#include <Ecore_X.h>
#include <X11/Xlib.h>
-/*Fixme: to be added for wayland works*/
-#define _MAKE_ATOM(a, s) \
- do { \
- a = ecore_x_atom_get(s); \
- if (!a) \
- _ERR("##s creation failed.\n"); \
- } while(0)
+/* Fixme: to be added for wayland works */
+#define _MAKE_ATOM(a, s) \
+ do { \
+ a = ecore_x_atom_get(s); \
+ if (!a) \
+ _ERR("##s creation failed.\n"); \
+ } while (0)
-#define STR_ATOM_ROTATION_LOCK "_E_ROTATION_LOCK"
+#define STR_ATOM_ROTATION_LOCK "_E_ROTATION_LOCK"
static Ecore_X_Atom ATOM_ROTATION_LOCK = 0;
static Ecore_X_Window root;
{
int *cb_event_data;
enum appcore_rm m;
- int ret;
if (rot.lock)
return;
{
int r;
enum appcore_rm m;
- int ret;
rot.lock = !vconf_keynode_get_bool(node);
lock = 0;
r = vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &lock);
- if (r) {
+ if (r)
_DBG("[APP %d] Rotation vconf get bool failed", getpid());
- }
rot.lock = !lock;
EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore_rm, void *),
void *data)
{
- if (rot.wm_rotate) {
+ if (rot.wm_rotate)
return rot.wm_rotate->set_rotation_cb(cb, data);
- }
else {
int r;
int handle;
if (r < 0) {
_ERR("sf_start failed: %d", r);
r = sf_unregister_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK);
- if (r < 0) {
+ if (r < 0)
_ERR("sf_unregister_event failed: %d", r);
- }
+
rot.callback = NULL;
rot.cbdata = NULL;
rot.cb_set = 0;
__add_rotlock(data);
#ifdef X11
- _MAKE_ATOM(ATOM_ROTATION_LOCK, STR_ATOM_ROTATION_LOCK );
+ _MAKE_ATOM(ATOM_ROTATION_LOCK, STR_ATOM_ROTATION_LOCK);
root = ecore_x_window_root_first_get();
XSelectInput(ecore_x_display_get(), root, PropertyChangeMask);
#endif
EXPORT_API int appcore_unset_rotation_cb(void)
{
- if (rot.wm_rotate) {
+ if (rot.wm_rotate)
return rot.wm_rotate->unset_rotation_cb();
- }
else {
int r;
EXPORT_API int appcore_get_rotation_state(enum appcore_rm *curr)
{
- if (rot.wm_rotate) {
+ if (rot.wm_rotate)
return rot.wm_rotate->get_rotation_state(curr);
- }
else {
int r;
unsigned long event;
EXPORT_API int appcore_pause_rotation_cb(void)
{
- if (rot.wm_rotate) {
+ if (rot.wm_rotate)
return rot.wm_rotate->pause_rotation_cb();
- }
else {
int r;
EXPORT_API int appcore_resume_rotation_cb(void)
{
- if (rot.wm_rotate) {
+ if (rot.wm_rotate)
return rot.wm_rotate->resume_rotation_cb();
- }
else {
- int r,ret;
+ int r;
+ int ret;
enum appcore_rm m;
_retv_if(rot.callback == NULL, 0);