diff options
author | Irfan Abdul <irfan.abdul@samsung.com> | 2017-01-06 13:35:20 +0530 |
---|---|---|
committer | Irfan Abdul <irfan.abdul@samsung.com> | 2017-01-06 13:35:20 +0530 |
commit | 7fd089e0b22a7c78cb02e836d5fd0b17602ab246 (patch) | |
tree | c21f2a10c5d00140fe70e2d2f6bc8850b7bfc9ca | |
parent | 2307d8aa6bae388552c2301f46db034269121fd8 (diff) | |
parent | 90fb42317d747613bc8f68eef6c94d51fd6e5b53 (diff) | |
download | idle-clock-digital-7fd089e0b22a7c78cb02e836d5fd0b17602ab246.tar.gz idle-clock-digital-7fd089e0b22a7c78cb02e836d5fd0b17602ab246.tar.bz2 idle-clock-digital-7fd089e0b22a7c78cb02e836d5fd0b17602ab246.zip |
Merge branch 'tizen_3.0' into tizentizen_4.0.m1_releasesubmit/tizen_unified/20170309.100419submit/tizen_unified/20170308.100420submit/tizen/20170110.054236accepted/tizen/wearable/20170110.081624accepted/tizen/unified/20170309.075127accepted/tizen_wearable
Change-Id: Ib521ac75a1f581b709a69c8b33db5b4e70cdbd74
Signed-off-by: Irfan Abdul <irfan.abdul@samsung.com>
-rwxr-xr-x | include/app_data.h | 3 | ||||
-rwxr-xr-x | include/log.h | 18 | ||||
-rwxr-xr-x | src/clock_view.c | 98 | ||||
-rwxr-xr-x | src/debug.c | 56 | ||||
-rwxr-xr-x | src/main.c | 102 |
5 files changed, 118 insertions, 159 deletions
diff --git a/include/app_data.h b/include/app_data.h index ead294a..318f61c 100755 --- a/include/app_data.h +++ b/include/app_data.h @@ -27,8 +27,7 @@ #include <utils_i18n.h> #define MAX_PATH_LEN 1024 -typedef struct __appdata -{ +typedef struct __appdata { Evas_Object *win; Evas_Object *ly_main; Evas_Object *bg; diff --git a/include/log.h b/include/log.h index 91e666d..e13d4c8 100755 --- a/include/log.h +++ b/include/log.h @@ -60,7 +60,7 @@ } while (0) #define retvm_if(expr, val, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ _E(fmt, ##arg); \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return val; \ @@ -68,14 +68,14 @@ } while (0) #define retv_if(expr, val) do { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return (val); \ } \ } while (0) #define retm_if(expr, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ _E(fmt, ##arg); \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return; \ @@ -83,28 +83,28 @@ } while (0) #define ret_if(expr) do { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return; \ } \ } while (0) #define goto_if(expr, val) do { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> goto", #expr); \ goto val; \ } \ } while (0) #define break_if(expr) { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> break", #expr); \ break; \ } \ } #define continue_if(expr) { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> continue", #expr); \ continue; \ } \ @@ -112,11 +112,11 @@ //assert #define ASSERT_SE(expr, args...) do { \ - if(expr) app_assert_screen(LOG_TAG, __FILE__, __LINE__, __func__, ##args); \ + if (expr) app_assert_screen(LOG_TAG, __FILE__, __LINE__, __func__, ##args); \ } while (0) #define ASSERT_S(expr) do { \ - if(expr) assert_screen(LOG_TAG, __FILE__, __LINE__, __func__, #expr, NULL); \ + if (expr) assert_screen(LOG_TAG, __FILE__, __LINE__, __func__, #expr, NULL); \ } while (0) void assert_screen(const char* tag_name, const char* file, int line, const char* func, const char *expr, const char *fmt, ...); diff --git a/src/clock_view.c b/src/clock_view.c index ab5cd84..204a7aa 100755 --- a/src/clock_view.c +++ b/src/clock_view.c @@ -197,11 +197,11 @@ int clock_view_parse_result_data(const char *result_data) checked = (char *) xmlGetProp(childNode, (const xmlChar *)"checked"); if (checked) { _D("checked:%s", checked); - if (strcmp(checked, "yes") == 0) { + if (strcmp(checked, "yes") == 0) setting_items_s.show_date = 1; - } else if (strcmp(checked, "no") == 0) { + else if (strcmp(checked, "no") == 0) setting_items_s.show_date = 0; - } + xmlFree(checked); } childNode = xmlNextElementSibling(childNode); @@ -288,9 +288,8 @@ static i18n_udatepg_h _get_generator(void *data) //i18n_ustring_copy_ua_n(u_skeleton, "hhmm", strlen("hhmm")); - if (!ad->timeregion_format) { + if (!ad->timeregion_format) ad->timeregion_format = _get_locale(); - } status = i18n_udatepg_create(ad->timeregion_format, &generator); if (status != I18N_ERROR_NONE) { @@ -325,9 +324,8 @@ static i18n_udate_format_h _get_time_formatter(void *data) appdata *ad = data; retv_if(!ad, NULL); - if (!ad->generator) { + if (!ad->generator) ad->generator = _get_generator(ad); - } /* only 12 format */ @@ -394,8 +392,8 @@ static i18n_udate_format_h _get_time_formatter_24(void *data) char a_best_pattern[64] = {0.}; char *a_best_pattern_fixed = NULL; - char *saveptr1=NULL; - char *saveptr2=NULL; + char *saveptr1 = NULL; + char *saveptr2 = NULL; int status = I18N_ERROR_INVALID_PARAMETER; i18n_uchar u_pattern[64] = {0,}; @@ -408,9 +406,8 @@ static i18n_udate_format_h _get_time_formatter_24(void *data) appdata *ad = data; retv_if(!ad, NULL); - if (!ad->generator) { + if (!ad->generator) ad->generator = _get_generator(ad); - } /* only 12 format */ if (!i18n_ustring_copy_ua_n(u_pattern, "H:mm", sizeof(u_pattern))) { @@ -431,8 +428,8 @@ static i18n_udate_format_h _get_time_formatter_24(void *data) /* remove am/pm of best pattern */ retv_if(!i18n_ustring_copy_au(a_best_pattern, u_best_pattern), NULL); _D("best pattern [%s]", a_best_pattern); - a_best_pattern_fixed = strtok_r(a_best_pattern, "a",&saveptr1); - a_best_pattern_fixed = strtok_r(a_best_pattern_fixed, " ",&saveptr2); + a_best_pattern_fixed = strtok_r(a_best_pattern, "a", &saveptr1); + a_best_pattern_fixed = strtok_r(a_best_pattern_fixed, " ", &saveptr2); _D("best pattern fixed [%s]", a_best_pattern_fixed); if (a_best_pattern_fixed) { @@ -561,11 +558,10 @@ static i18n_udate_format_h _get_ampm_formatter(void *data) i18n_ustring_copy_au(a_best_pattern, u_best_pattern); i18n_ustring_copy_ua(u_best_pattern, "a"); - if (a_best_pattern[0] == 'a') { + if (a_best_pattern[0] == 'a') ad->is_pre = EINA_TRUE; - } else { + else ad->is_pre = EINA_FALSE; - } /* get formatter */ i18n_ustring_copy_ua_n(u_timezone, ad->timezone_id, sizeof(u_timezone)); @@ -657,9 +653,8 @@ static int _get_formatted_date_from_utc_time(void *data, time_t intime, char *bu return -1; } - if (formatted_str_len <= 0) { + if (formatted_str_len <= 0) _E("formatted_str_len is less than 0"); - } buf = i18n_ustring_copy_au_n(buf, u_formatted_str, (int32_t)buf_len); _SD("date:(%d)[%s][%d]", formatted_str_len, buf, intime); @@ -692,9 +687,8 @@ static int _get_formatted_ampm_from_utc_time(void *data, time_t intime, char *bu return -1; } - if (formatted_str_len <= 0) { + if (formatted_str_len <= 0) _E("formatted_str_len is less than 0"); - } (*ampm_len) = i18n_ustring_get_length(u_formatted_str); @@ -813,9 +807,8 @@ Eina_Bool clock_view_set_info_time(void *data) } device_display_get_state(&val); - if (val != DISPLAY_STATE_SCREEN_OFF) { + if (val != DISPLAY_STATE_SCREEN_OFF) ad->timer = ecore_timer_add(60 - ts->tm_sec, clock_view_set_info_time, ad); - } /* text_date */ err_code = preference_get_int(DIGITAL_PREFERENCE_CLOCK_FONT_COLOR, &clock_font_color); @@ -889,9 +882,8 @@ void clock_view_update_view(void *data) return; } - if (ad->win) { + if (ad->win) clock_view_set_info_time(ad); - } } @@ -923,10 +915,7 @@ static void ICU_set_timezone(const char *timezone) i18n_uchar *str = _uastrcpy(timezone); ec = i18n_ucalendar_set_default_timezone(str); - if (ec != I18N_ERROR_NONE) { - } else { - _E("ucal_setDefaultTimeZone() FAILED"); - } + _D("ec:%d" , ec); free(str); } @@ -938,13 +927,11 @@ static char* _get_timezone() char *timezone = NULL; int ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &timezone); - if (ret < 0) { + if (ret < 0) _E("fail to get the locale time zone value(%d)", ret); - } - if (!timezone) { + if (!timezone) _E("system settings fail to get value: time zone"); - } _D("time zone : %s", timezone); @@ -1036,9 +1023,8 @@ static void _clock_font_changed_cb(int node, void *data) elm_object_signal_emit(ad->ly_main, "change,no_data", "source_textblock_time"); } - if (node) { + if (node) clock_view_set_info_time(ad); - } } @@ -1135,31 +1121,28 @@ static void _set_settings(void *data) /* register time changed cb */ ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED, _time_status_changed_cb, ad); - if (ret < 0) { + if (ret < 0) _E("Failed to set time changed cb.(%d)", ret); - } + /*Register changed cb(timezone) */ ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, _time_status_changed_cb, ad); - if (ret < 0) { + if (ret < 0) _E("Failed to set time zone change cb(%d)", ret); - } + /* Register changed cb(pm mode) */ ret = device_add_callback(DEVICE_CALLBACK_DISPLAY_STATE, _device_state_changed_cb, ad); - if (DEVICE_ERROR_NONE != ret) { + if (DEVICE_ERROR_NONE != ret) _E("Failed to add device display state changed cb(%d)", ret); - } /*Register changed cb(language) */ ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, _language_changed_cb, ad); - if (ret < 0) { + if (ret < 0) _E("Failed to set language setting's changed cb.(%d)", ret); - } /*Register changed cb(regionformat 1224) */ ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, _timeformat_changed_cb, ad); - if (ret < 0) { + if (ret < 0) _E("Failed to set time format about 24 hour changed cb(%d).", ret); - } } @@ -1171,43 +1154,38 @@ static void _unset_settings() /* unset changed cb(time changed) */ ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_TIME_CHANGED); - if (ret < 0) { + if (ret < 0) _E("Failed to unset time changed(%d).", ret); - } + /* unset changed cb(timezone) */ ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE); - if (ret < 0) { + if (ret < 0) _E("Failed to unset time zone changed cb(%d).", ret); - } + /* unset changed cb(pm mode) */ ret = device_remove_callback(DEVICE_CALLBACK_DISPLAY_STATE, _device_state_changed_cb); - if (DEVICE_ERROR_NONE != ret) { + if (DEVICE_ERROR_NONE != ret) _E("Failed to remove device display state changed cb(%d)", ret); - } /* unset changed cb(language)*/ ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE); - if (ret < 0) { + if (ret < 0) _E("Failed to unset locale language(%d).", ret); - } /* unset changed cb(region format)*/ ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR); - if (ret < 0) { + if (ret < 0) _E("Failed to unset locale time format about 24 hour(%d).", ret); - } /* date showing */ ret = preference_unset_changed_cb(DIGITAL_PREFERENCE_SHOW_DATE); - if (ret < 0) { + if (ret < 0) _E("Failed to unset preference(show_date, %d).", ret); - } /* clock_font_color */ ret = preference_unset_changed_cb(DIGITAL_PREFERENCE_CLOCK_FONT_COLOR); - if (ret < 0) { + if (ret < 0) _E("Failed to unset preference(font color, %d).", ret); - } } #endif @@ -1284,11 +1262,11 @@ bool clock_view_create_layout(void *data) /* create main layout */ Evas_Object *ly_main = NULL; - char edj_path[MAX_PATH_LEN]={0,}; + char edj_path[MAX_PATH_LEN] = {0,}; char *res_path = app_get_resource_path(); snprintf(edj_path, MAX_PATH_LEN, "%s%s", res_path, EDJ_APP); free(res_path); - _D("edj_path: %s",edj_path); + _D("edj_path: %s", edj_path); ly_main = _add_layout(ad->win, edj_path, "layout_clock_digital"); retv_if(!ly_main, -1); evas_object_size_hint_weight_set(ly_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); diff --git a/src/debug.c b/src/debug.c index f1fd9b3..498a8e6 100755 --- a/src/debug.c +++ b/src/debug.c @@ -25,35 +25,31 @@ void assert_screen(const char* tag_name, const char* file, int line, const char* func, const char *expr, const char *fmt, ...) { - app_control_h app_control; - va_list ap; - char pid_buffer[16] = {0}; - char result_buffer[256] = {0}; - char line_buffer[16] = {0}; + app_control_h app_control; + va_list ap; + char pid_buffer[16] = {0}; + char result_buffer[256] = {0}; + char line_buffer[16] = {0}; - app_control_create(&app_control); - app_control_set_app_id(app_control, "com.samsung.assert-scr"); - snprintf(pid_buffer, sizeof(pid_buffer), "%d", getpid()); - app_control_add_extra_data(app_control, "pid", pid_buffer); - app_control_add_extra_data(app_control, "appname", tag_name); - if(fmt == NULL) - { - snprintf(result_buffer, sizeof(result_buffer), "%s", expr); - } - else - { - char arg_buffer[256] = {0}; - - va_start(ap, fmt); - vsnprintf(arg_buffer, sizeof(arg_buffer), fmt, ap); - va_end(ap); - snprintf(result_buffer, sizeof(result_buffer), "(%s) %s", expr, arg_buffer); - } - app_control_add_extra_data(app_control, "assert_str", result_buffer); - app_control_add_extra_data(app_control, "filename", file); - snprintf(line_buffer, sizeof(line_buffer), "%d", line); - app_control_add_extra_data(app_control, "line", line_buffer); - app_control_add_extra_data(app_control, "funcname", func); - app_control_send_launch_request(app_control, NULL,NULL ); - app_control_destroy(app_control); + app_control_create(&app_control); + app_control_set_app_id(app_control, "com.samsung.assert-scr"); + snprintf(pid_buffer, sizeof(pid_buffer), "%d", getpid()); + app_control_add_extra_data(app_control, "pid", pid_buffer); + app_control_add_extra_data(app_control, "appname", tag_name); + if (fmt == NULL) + snprintf(result_buffer, sizeof(result_buffer), "%s", expr); + else { + char arg_buffer[256] = {0}; + va_start(ap, fmt); + vsnprintf(arg_buffer, sizeof(arg_buffer), fmt, ap); + va_end(ap); + snprintf(result_buffer, sizeof(result_buffer), "(%s) %s", expr, arg_buffer); + } + app_control_add_extra_data(app_control, "assert_str", result_buffer); + app_control_add_extra_data(app_control, "filename", file); + snprintf(line_buffer, sizeof(line_buffer), "%d", line); + app_control_add_extra_data(app_control, "line", line_buffer); + app_control_add_extra_data(app_control, "funcname", func); + app_control_send_launch_request(app_control, NULL, NULL); + app_control_destroy(app_control); } @@ -87,34 +87,34 @@ void _remove_preview_resource(void *data) appdata *ad = data; ret_if(!ad); - if(offscreen_box) { + if (offscreen_box) { evas_object_del(offscreen_box); offscreen_box = NULL; ad->win = NULL; _D("##### ad->win set to NULL"); } - if(offscreen_bg) { + if (offscreen_bg) { evas_object_del(offscreen_bg); offscreen_bg = NULL; } - if(offscreen_img) { + if (offscreen_img) { evas_object_del(offscreen_img); offscreen_img = NULL; } - if(minicontrol_bg) { + if (minicontrol_bg) { evas_object_del(minicontrol_bg); minicontrol_bg = NULL; } - if(minicontrol_img) { + if (minicontrol_img) { evas_object_del(minicontrol_img); minicontrol_img = NULL; } - if(minicontrol_img_box) { + if (minicontrol_img_box) { evas_object_del(minicontrol_img_box); minicontrol_img_box = NULL; } @@ -132,7 +132,7 @@ static void _update_clock_to_offscreen(void *data, int w, int h) appdata *ad = data; ret_if(!ad); - if(!offscreen_e) { + if (!offscreen_e) { offscreen_e = _live_create_virtual_canvas(w, h); ad->e_offscreen = offscreen_e; } @@ -263,8 +263,8 @@ static bool _create_window(void *data, int mode) retv_if(!ad, false); /* create main window */ - if(ad->win == NULL) { - if(mode == BUFFER_TYPE_OFFSCREEN) { + if (ad->win == NULL) { + if (mode == BUFFER_TYPE_OFFSCREEN) { ad->win_type = BUFFER_TYPE_OFFSCREEN; _update_clock_to_offscreen(data, ad->win_w, ad->win_h); @@ -293,21 +293,20 @@ static bool _idle_clock_digital_create(int width, int height, void *data) app_event_handler_h handlers[5] = {NULL, }; // Register callbacks for each system event - if (watch_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, NULL, NULL) != APP_ERROR_NONE) { + if (watch_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, NULL, NULL) != APP_ERROR_NONE) _E("watch_app_add_event_handler () is failed"); - } - if (watch_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL) != APP_ERROR_NONE) { + + if (watch_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL) != APP_ERROR_NONE) _E("watch_app_add_event_handler () is failed"); - } - if (watch_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL) != APP_ERROR_NONE) { + + if (watch_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL) != APP_ERROR_NONE) _E("watch_app_add_event_handler () is failed"); - } - if (watch_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, NULL, NULL) != APP_ERROR_NONE) { + + if (watch_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, NULL, NULL) != APP_ERROR_NONE) _E("watch_app_add_event_handler () is failed"); - } - if (watch_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL) != APP_ERROR_NONE) { + + if (watch_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL) != APP_ERROR_NONE) _E("watch_app_add_event_handler () is failed"); - } ad->win_w = width; ad->win_h = height; @@ -332,7 +331,7 @@ static void _idle_clock_digital_terminate(void *data) ad->ly_main = NULL; } - if(close_timer) { + if (close_timer) { ecore_timer_del(close_timer); close_timer = NULL; } @@ -376,17 +375,17 @@ static void _send_reply(void *data) _D("reply app_control created"); if (ret == 0) { _D("reply caller"); - if(ad->win_type == BUFFER_TYPE_OFFSCREEN) + if (ad->win_type == BUFFER_TYPE_OFFSCREEN) ret = app_control_add_extra_data(reply, "result", DUMP_FILE_PATH_OFFSCREEN); else ret = app_control_add_extra_data(reply, "result", DUMP_FILE_PATH_MINICONTROL); - if(ret) + if (ret) _E("app_control_add_extra_data failed"); ret = app_control_reply_to_launch_request(reply, ad->app_control, APP_CONTROL_RESULT_SUCCEEDED); - if(ret) + if (ret) _E("app_control_reply_to_launch_request failed"); app_control_destroy(reply); @@ -408,7 +407,7 @@ static void _draw_onscreen(void *data) _make_dump(data, ad->win_type, WIN_SIZE_W, WIN_SIZE_H, DUMP_FILE_PATH_MINICONTROL); _send_reply(data); - if(clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) + if (clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) clock_view_hide_clock(ad); drawing_state = 0; @@ -436,7 +435,7 @@ static Eina_Bool _drawing_timer_onscreen_cb(void *data) appdata *ad = data; retv_if(!ad, ECORE_CALLBACK_CANCEL); - if(!ad->is_show) { + if (!ad->is_show) { clock_view_show_clock(ad); ecore_idler_add(_idler_drawing_onscreen_cb, ad); return ECORE_CALLBACK_CANCEL; @@ -460,15 +459,14 @@ static void _draw_offscreen(void *data) _send_reply(data); - if(clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) + if (clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) clock_view_hide_clock(ad); drawing_state = 0; drawing_timer = NULL; _D("win type = %d and window = %d", ad->win_type, ad->win); - if(BUFFER_TYPE_OFFSCREEN == ad->win_type) - { + if (BUFFER_TYPE_OFFSCREEN == ad->win_type) { _D("offscreen capture completed. app will be closed"); elm_exit(); } @@ -497,7 +495,7 @@ static Eina_Bool _drawing_timer_cb(void *data) appdata *ad = data; retv_if(!ad, ECORE_CALLBACK_RENEW); - if(!ad->is_show) { + if (!ad->is_show) { clock_view_show_clock(ad); ecore_idler_add(_idler_drawing_offscreen_cb, ad); return ECORE_CALLBACK_CANCEL; @@ -527,7 +525,7 @@ static Eina_Bool _sync_timer_cb(void *data) appdata *ad = data; retv_if(!ad, ECORE_CALLBACK_RENEW); - if(drawing_state == 0) { + if (drawing_state == 0) { _remove_preview_resource(data); _create_window(data, BUFFER_TYPE_WINDOW); sync_timer = NULL; @@ -551,11 +549,11 @@ static void _idle_clock_digital_app_control(app_control_h app_control, void *dat app_control_get_operation(app_control, &op); - if(op) { + if (op) { _D("operation:%s", op); - if(strcmp(op, "http://tizen.org/appcontrol/operation/remote_settings") == 0) { + if (strcmp(op, "http://tizen.org/appcontrol/operation/remote_settings") == 0) { app_control_get_extra_data(app_control, "http://tizen.org/appcontrol/data/result_xml", &result_data); - if(result_data) { + if (result_data) { _D("Result:%s", result_data); clock_view_parse_result_data(result_data); clock_view_set_result_data(ad); @@ -566,20 +564,19 @@ static void _idle_clock_digital_app_control(app_control_h app_control, void *dat device_display_change_state(DISPLAY_STATE_NORMAL); } else { _D("app will be closed"); - if(close_timer) { + if (close_timer) { ecore_timer_del(close_timer); close_timer = NULL; } close_timer = ecore_timer_add(3.0, _close_timer_cb, NULL); } } - } - else if(strcmp(op, "http://tizen.org/appcontrol/operation/main") == 0) { - if(close_timer) { + } else if (strcmp(op, "http://tizen.org/appcontrol/operation/main") == 0) { + if (close_timer) { ecore_timer_del(close_timer); close_timer = NULL; } - if(drawing_state) { + if (drawing_state) { if (sync_timer) { ecore_timer_del(sync_timer); sync_timer = NULL; @@ -590,18 +587,17 @@ static void _idle_clock_digital_app_control(app_control_h app_control, void *dat _remove_preview_resource(data); _create_window(data, BUFFER_TYPE_WINDOW); /* create window if not mini app setting called */ } - } - else if(strcmp(op, "http://tizen.org/appcontrol/operation/clock/capture") == 0) { + } else if (strcmp(op, "http://tizen.org/appcontrol/operation/clock/capture") == 0) { app_control_clone(&ad->app_control, app_control); - if(close_timer) { + if (close_timer) { ecore_timer_del(close_timer); close_timer = NULL; } _create_window(data, BUFFER_TYPE_OFFSCREEN); - if(BUFFER_TYPE_OFFSCREEN == ad->win_type) { + if (BUFFER_TYPE_OFFSCREEN == ad->win_type) { _D("offscreen capture"); drawing_state = 1; @@ -610,7 +606,7 @@ static void _idle_clock_digital_app_control(app_control_h app_control, void *dat drawing_timer = NULL; } clock_view_set_info_time(data); - if(clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) + if (clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) clock_view_show_clock(ad); drawing_timer = ecore_timer_add(0.15, _drawing_timer_cb, data); } else { @@ -621,14 +617,13 @@ static void _idle_clock_digital_app_control(app_control_h app_control, void *dat drawing_timer = NULL; } clock_view_set_info_time(data); - if(clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) + if (clock_view_get_display_state() == DISPLAY_STATE_SCREEN_OFF) clock_view_show_clock(ad); drawing_timer = ecore_timer_add(0.15, _drawing_timer_onscreen_cb, data); } - } - else { + } else _E("Unknown operation"); - } + free(op); } } @@ -642,19 +637,13 @@ void app_time_tick(watch_time_h watch_time, void* user_data) void app_ambient_tick(watch_time_h watch_time, void* user_data) { - + } void app_ambient_changed(bool ambient_mode, void* user_data) { - if (ambient_mode) { - // Prepare to enter the ambient mode - } else { - // Prepare to exit the ambient mode - } -} - +} int main(int argc, char *argv[]) { @@ -676,6 +665,3 @@ int main(int argc, char *argv[]) return watch_app_main(argc, argv, &lifecycle_callback, &ad); } - - - |