From 76e955a1b1743a8bd65ec2c7c3b3f141a6c4403b Mon Sep 17 00:00:00 2001 From: Andrey Klimenko Date: Fri, 29 Apr 2016 14:03:59 +0300 Subject: Restoring SDK-build back Revert "Revert "TizenRefApp-5575 prepare sdk-build for org.tizen.libug-worldclock-efl"" This reverts commit 0173aefda43b745aae865e7fccedc89df426009e. Signed-off-by: Andrey Klimenko Conflicts: worldclock-efl.xml Change-Id: I90f75adf83986986ba337d91dd05df2552404829 --- .cproject | 773 +++++++++++++++++++ .exportMap | 4 + .project | 52 ++ .tproject | 12 + CMakeLists.txt | 24 +- edje/images/clock_world_ic_location.png | Bin 0 -> 1834 bytes inc/clock_fwk_icu_label.h | 40 + inc/ug_worldclock_efl.h | 31 + inc/worldclock.h | 115 +++ inc/worldclock_add_view.h | 55 ++ inc/worldclock_const.h | 54 ++ inc/worldclock_data.h | 37 + inc/worldclock_dlog.h | 93 +++ inc/worldclock_fwk_icu.h | 38 + inc/worldclock_timezone.h | 1259 +++++++++++++++++++++++++++++++ inc/worldclock_types.h | 89 +++ inc/worldclock_util.h | 91 +++ include/clock_fwk_icu_label.h | 40 - include/ug_worldclock_efl.h | 31 - include/worldclock.h | 115 --- include/worldclock_add_view.h | 55 -- include/worldclock_const.h | 52 -- include/worldclock_data.h | 37 - include/worldclock_dlog.h | 94 --- include/worldclock_fwk_icu.h | 38 - include/worldclock_timezone.h | 1259 ------------------------------- include/worldclock_types.h | 89 --- include/worldclock_util.h | 87 --- libug-worldclock-efl.manifest | 4 - packaging/libug-worldclock-efl.spec | 28 +- project_def.prop | 11 + res/edc/worldclock.edc | 23 - res/edc/worldclock_add.edc | 239 ------ res/edje/worldclock.edc | 23 + res/edje/worldclock_add.edc | 240 ++++++ res/images/clock_world_ic_location.png | Bin 1834 -> 0 bytes res/misc/CMakeLists.txt | 14 - res/po/CMakeLists.txt | 2 +- shared/res/libug-worldclock-efl.png | Bin 0 -> 57662 bytes shared/res/worldclock.db | Bin 0 -> 47104 bytes shared/res/worldclock.db-journal | Bin 0 -> 3608 bytes src/CMakeLists.txt | 22 +- src/ug_worldclock_efl.c | 374 ++++----- src/worldclock_add_view.c | 25 +- src/worldclock_data.c | 30 +- src/worldclock_util.c | 34 +- tizen-manifest.xml | 13 + tzlist.ini | 224 ------ worldclock-efl.xml | 17 - 49 files changed, 3273 insertions(+), 2714 deletions(-) create mode 100644 .cproject create mode 100644 .exportMap create mode 100644 .project create mode 100644 .tproject create mode 100644 edje/images/clock_world_ic_location.png create mode 100644 inc/clock_fwk_icu_label.h create mode 100644 inc/ug_worldclock_efl.h create mode 100644 inc/worldclock.h create mode 100644 inc/worldclock_add_view.h create mode 100644 inc/worldclock_const.h create mode 100644 inc/worldclock_data.h create mode 100644 inc/worldclock_dlog.h create mode 100644 inc/worldclock_fwk_icu.h create mode 100644 inc/worldclock_timezone.h create mode 100644 inc/worldclock_types.h create mode 100644 inc/worldclock_util.h delete mode 100644 include/clock_fwk_icu_label.h delete mode 100644 include/ug_worldclock_efl.h delete mode 100644 include/worldclock.h delete mode 100644 include/worldclock_add_view.h delete mode 100644 include/worldclock_const.h delete mode 100644 include/worldclock_data.h delete mode 100644 include/worldclock_dlog.h delete mode 100644 include/worldclock_fwk_icu.h delete mode 100644 include/worldclock_timezone.h delete mode 100644 include/worldclock_types.h delete mode 100644 include/worldclock_util.h create mode 100644 project_def.prop delete mode 100644 res/edc/worldclock.edc delete mode 100644 res/edc/worldclock_add.edc create mode 100644 res/edje/worldclock.edc create mode 100644 res/edje/worldclock_add.edc delete mode 100644 res/images/clock_world_ic_location.png delete mode 100644 res/misc/CMakeLists.txt create mode 100644 shared/res/libug-worldclock-efl.png create mode 100644 shared/res/worldclock.db create mode 100644 shared/res/worldclock.db-journal create mode 100644 tizen-manifest.xml delete mode 100644 tzlist.ini delete mode 100644 worldclock-efl.xml diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..c032025 --- /dev/null +++ b/.cproject @@ -0,0 +1,773 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.exportMap b/.exportMap new file mode 100644 index 0000000..43e310e --- /dev/null +++ b/.exportMap @@ -0,0 +1,4 @@ +{ + global: main; + local: *; +}; diff --git a/.project b/.project new file mode 100644 index 0000000..b332a9d --- /dev/null +++ b/.project @@ -0,0 +1,52 @@ + + + libug-worldclock-efl + + + + + + org.tizen.nativecore.apichecker.apicheckerbuilder + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.apicheckernature + + + + 1459257945673 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + 1459257945676 + + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-project_def.prop + + + + diff --git a/.tproject b/.tproject new file mode 100644 index 0000000..56660b2 --- /dev/null +++ b/.tproject @@ -0,0 +1,12 @@ + + + + + mobile-3.0 + + + + + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c850c..1b3e3dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,32 +1,28 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(ug-worldclock-efl C CXX) -SET(SO_VERSION_MAJOR 0) -SET(SO_VERSION 0.1) +PROJECT(libug-worldclock-efl C CXX) -SET(PACKAGE ${PROJECT_NAME}) +SET(PACKAGE "org.tizen.${PROJECT_NAME}") SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(BINDIR "${PREFIX}/bin") -SET(LIBDIR "/usr/lib") -SET(UGLIBDIR "${PREFIX}/lib") SET(DATADIR "${PREFIX}/res") -SET(EDJDIR "${DATADIR}/edje/${PROJECT_NAME}") +SET(EDJDIR "${DATADIR}/edje/") SET(IMAGEDIR "${DATADIR}/images") SET(LOCALEDIR "${DATADIR}/locale") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") # include file -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc) ADD_SUBDIRECTORY(res/po) -ADD_SUBDIRECTORY(res/misc) ADD_SUBDIRECTORY(src) -#install tzlist.ini file -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tzlist.ini DESTINATION ${TZ_SYS_DATA}/setting) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tzlist.ini DESTINATION ${TZ_USER_DATA}/clock) + #install xml file -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/worldclock-efl.xml DESTINATION ${TZ_SYS_RO_PACKAGES}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-manifest.xml DESTINATION ${TZ_SYS_RO_PACKAGES} RENAME ${PACKAGE}.xml) #install images -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMAGEDIR}/${PROJECT_NAME}/ FILES_MATCHING PATTERN "*.png") \ No newline at end of file +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/edje/images/ DESTINATION ${IMAGEDIR}/ FILES_MATCHING PATTERN "*.png") + +#install shared +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/shared/res/ DESTINATION ${PREFIX}/shared/res FILES_MATCHING PATTERN "*.*") diff --git a/edje/images/clock_world_ic_location.png b/edje/images/clock_world_ic_location.png new file mode 100644 index 0000000..567038b Binary files /dev/null and b/edje/images/clock_world_ic_location.png differ diff --git a/inc/clock_fwk_icu_label.h b/inc/clock_fwk_icu_label.h new file mode 100644 index 0000000..63ca931 --- /dev/null +++ b/inc/clock_fwk_icu_label.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __CLOCK_FWK_ICU_LABEL_H__ +#define __CLOCK_FWK_ICU_LABEL_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + void init_alphabetic_index(char *lang); + + void uninit_alphabetic_index(); + + int32_t get_alphabetic_index(char *cityname); + + char *get_alphabetic_index_name(int32_t index); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/inc/ug_worldclock_efl.h b/inc/ug_worldclock_efl.h new file mode 100644 index 0000000..2d435ed --- /dev/null +++ b/inc/ug_worldclock_efl.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __helloUG_efl_H__ +#define __helloUG_efl_H__ + +#include + +#define IS_STR_EQUAL(a, b) (!strcmp(a, b)) +#define IS_STR_NOT_EQUAL(a, b) (strcmp(a, b)) + +//******************define:free ************************************* +#define FREEIF(p) ({if (p) {free(p); p = NULL; }}) +#define EVAS_OBJECT_DELIF(p) ({if (p) {evas_object_del(p); p = NULL; }}) +#define ECORE_TIMER_DELIF(p) ({if (p) {ecore_timer_del(p); p = NULL; }}) + +#endif /* __helloUG_efl_H__ */ diff --git a/inc/worldclock.h b/inc/worldclock.h new file mode 100644 index 0000000..e859b53 --- /dev/null +++ b/inc/worldclock.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_H__ +#define __DEF_WORLDCLOCK_H__ + +#include +#include +#include + +#include "worldclock_const.h" +#include "worldclock_types.h" + +struct appdata { + int root_w; + int root_h; + int root_x; + int root_y; + + //the caller + Wcl_Caller caller; + //the selection flag + Wcl_Selection_Flag selectionFlag; + + //flag for if or not enter the loop update + bool flag_first; //as the flag for the first time to enter __ugview_index_update + bool flag_special_character; //as the flag for if or not have special character in index + + //For store the default country list + Eina_List *default_list; + //flag for if or not hide the index + bool flag_index; + + app_control_h app_caller; + + /* Add city List */ + //For save current search content + char search_text[BUF_SIZE]; + char current_mcc[MCC_BUF_SIZE]; + + Elm_Object_Item *item_selected; //for store the selected city item + int city_index; //for store the selected city index + + Ecore_IMF_Context *imf_context; + + /* public used widget */ + Evas_Object *win; + Evas_Object *conform; + Evas_Object *bg; + + // samsung window layout + Evas_Object *ly_main; + Evas_Object *more_btn; + Evas_Object *back_btn; + + /* add layout */ + Evas_Object *add_ly; + Evas_Object *add_layout; + Evas_Object *add_search_bar; + Evas_Object *add_fs_layout; + Evas_Object *add_genlist; + Evas_Object *add_index; + Evas_Object *nocontent; + + Evas_Object *searchbar_rect; + Evas_Object *searchbar_entry; + Evas_Object *searchbar_button; + + /* timer */ + Ecore_Timer *add_view_quit_timer; + Ecore_Timer *add_view_update_timer; + Ecore_Timer *search_timer; + + /* Home City */ + Wcl_CitySet *home_cs; + + Evas_Object *navi_bar; + + // return a Wcl_CitySet, used in ug + Wcl_CitySet *return_data; + +#ifdef FEATURE_SORT_ORDER + //mark sort by name or gmt + Wcl_Addlist_Sort_Type sort; + Evas_Object *more_popup; + + //sort popup box + Evas_Object *sort_popup; //sort popup + Evas_Object *sort_popup_genlist; //sort popup genlist + Evas_Object *sort_radio; //sort radio + Wcl_Addlist_Sort_Type sort_text; //sort text + Wcl_Addlist_Sort_Type ex_sort_text; //sort text +#endif + + Eina_Bool is_Empty; + int searched_num; + int searched_text_length; +}; + +#endif /* __DEF_WORLDCLOCK_H_ */ + diff --git a/inc/worldclock_add_view.h b/inc/worldclock_add_view.h new file mode 100644 index 0000000..e8eafc9 --- /dev/null +++ b/inc/worldclock_add_view.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_ADDVIEW_H_ +#define __DEF_WORLDCLOCK_ADDVIEW_H_ + +#include +#include "worldclock.h" + +/** + * Create add view for append new city into the selection list of worldclock + * + * @param[in] parent Evas_Object which is the parent of add view + * @param[in] data data which used in this function + * @param[in] func Callback function which used for invoking when exit from add view + * + * @return FAILED if create add view failed. + * SUCCESS if create add view successfully. + */ +int worldclock_ugview_add(Evas_Object * parent, void *data, Wcl_Return_Cb func); + +/** + * Update worldclock view + * + * @param[in] data data used for this function + * + * @return FAILED if update add view failed. + * SUCCESS if update add view successfully. + */ +int worldclock_ugview_update(void *data); + +/** + * Release all resources which used in add view when exit from add view + * + * @param[in] data data which used in this function + * + * @return + */ +void worldclock_ugview_free(void *data); + +#endif /* __DEF_WORLDCLOCK_ADDVIEW_H_ */ diff --git a/inc/worldclock_const.h b/inc/worldclock_const.h new file mode 100644 index 0000000..d26c4b7 --- /dev/null +++ b/inc/worldclock_const.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_CONST_H_ +#define __DEF_WORLDCLOCK_CONST_H_ + +#include + +#ifndef _ +#define _(s) (dgettext(PACKAGE, s)) +#endif +#ifndef _EDJ +#define _EDJ(o) (elm_layout_edje_get(o)) +#endif + +#define BUF_SIZE 256 +#define BUF_MIN_SIZE 32 +#define BUF_LARGE_SIZE 512 +#define BUF_PATH PATH_MAX + +#define CITY_BUF_SIZE 128 +#define COUNTRY_BUF_SIZE 128 +#define TIMEZONE_BUF_SIZE 32 +#define TZPATH_BUF_SIZE 128 +#define FLAG_BUF_SIZE 128 +#define MCC_BUF_SIZE 20 + +#define PACKAGE "libug-worldclock-efl" + +/* group name */ +#define GRP_ADD "ug_add_layout" + +#ifndef SUCCESS +#define SUCCESS 0 +#endif +#ifndef FAILED +#define FAILED -1 +#endif + +#endif /* __DEF_WORLDCLOCK_CONST_H_ */ diff --git a/inc/worldclock_data.h b/inc/worldclock_data.h new file mode 100644 index 0000000..8ab37f0 --- /dev/null +++ b/inc/worldclock_data.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_DATA_H_ +#define __DEF_WORLDCLOCK_DATA_H_ + +#include +#include "worldclock_types.h" + +Eina_List *worldclock_ug_data_get_default_city_list(Wcl_Selection_Flag selectFlag); +Eina_Bool worldclock_ug_data_get_city_status_from_db(Wcl_CitySet * p_record); +Eina_Bool worldclock_ug_data_open_database(); +Eina_Bool worldclock_ug_data_close_database(); +void worldclock_ug_data_cityset_copy(Wcl_CitySet * dst_city, const Wcl_CitySet * src_city); + +/*TODO Functions below are not used in current realization. Probably it will be used for Clock application*/ +Wcl_CitySet *worldclock_ug_data_get_local_city(); +Eina_List *worldclock_ug_data_get_all_added_city(); +Eina_List *worldclock_ug_data_get_search_city_list(const char *search_txt, + Wcl_Search_Type search_type, Wcl_Selection_Flag selectFlag); +Eina_Bool worldclock_ug_data_update_db_record(Wcl_CitySet * p_record); + +#endif /* __DEF_WORLDCLOCK_DATA_H_ */ diff --git a/inc/worldclock_dlog.h b/inc/worldclock_dlog.h new file mode 100644 index 0000000..ebf2272 --- /dev/null +++ b/inc/worldclock_dlog.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_DLOG_H__ +#define __DEF_WORLDCLOCK_DLOG_H__ + +#include +#include "ug_worldclock_efl.h" + +//tag +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "WORLDCLOCK_UG" + +#define FUNCTION_LOG ENABLE +#ifdef FUNCTION_LOG +#define CLK_FUN_BEG() CLK_INFO("====>>>>fun=%s, BEGIN====>>>>", __FUNCTION__); +#define CLK_FUN_END() CLK_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__); +#else +#define CLK_FUN_BEG() +#define CLK_FUN_END() +#endif +#define CLK_INFO(fmt, arg...) (dlog_print(DLOG_INFO, LOG_TAG, "[%s:%d] "fmt,__FILE__, __LINE__, ##arg)) +#define CLK_ERR(fmt,arg...) (dlog_print(DLOG_ERROR, LOG_TAG, FONT_COLOR_RED"[%s:%d] "fmt FONT_COLOR_RESET, __FILE__, __LINE__, ##arg)) + +#define CLK_FUN_DEBUG_BEG() //CLK_INFO("====>>>>fun=%s, BEGIN====>>>>",__FUNCTION__); +#define CLK_FUN_DEBUG_END() //CLK_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__); +#define CLK_DEBUG_INFO(fmt, arg...) //CLK_INFO(fmt, ##arg) +#define CLK_DEBUG_INFO(fmt, arg...) //CLK_ERR(fmt,##arg) + +/* anci c color type */ +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_CYAN "\033[36m" + +#define CLK_INFO_RED(fmt, arg...) (CLK_INFO(FONT_COLOR_RED fmt FONT_COLOR_RESET, ##arg)) +#define CLK_INFO_GREEN(fmt, arg...) (CLK_INFO(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)) +#define CLK_INFO_YELLOW(fmt, arg...) (CLK_INFO(FONT_COLOR_YELLOW fmt FONT_COLOR_RESET, ##arg)) +#define CLK_INFO_CYAN(fmt, arg...) (CLK_INFO(FONT_COLOR_CYAN fmt FONT_COLOR_RESET, ##arg)) + +#define ret_if(expr) ({do { \ + if(expr) { \ + CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ + return; \ + } \ + } while (0);}) +#define retv_if(expr, val) ({do { \ + if(expr) { \ + CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ + return (val); \ + } \ + } while (0);}) +#define retm_if(expr, fmt, arg...) ({do { \ + if(expr) { \ + CLK_ERR(fmt, ##arg); \ + CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ + return; \ + } \ + } while (0);}) +#define retvm_if(expr, val, fmt, arg...) ({do { \ + if(expr) { \ + CLK_ERR(fmt, ##arg); \ + CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ + return (val); \ + } \ + } while (0);}) + +#define GOTO_ERROR_IF(expr) \ + ({do { \ + if ((expr)) { \ + CLK_ERR("(%s) goto error", #expr); \ + goto error; \ + } \ + } while (0);}) + +#endif // __DEF_WORLDCLOCK_DLOG_H__ diff --git a/inc/worldclock_fwk_icu.h b/inc/worldclock_fwk_icu.h new file mode 100644 index 0000000..c1621ea --- /dev/null +++ b/inc/worldclock_fwk_icu.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __WCL_FWK_ICU_H__ +#define __WCL_FWK_ICU_H__ +#include + +/*BEG: Gong Xingsheng add in Mon Nov 21 01:04:37 PST 2011 + * this struct is saved hour, min, sec and current time format + * which is used in genlist item date + */ + +typedef struct _worldclock_time_s worldclock_time_s; +struct _worldclock_time_s { + int hour; + int min; + int sec; + bool bAm; +}; +/*END: Gong Xingsheng add in Mon Nov 21 01:04:37 PST 2011 */ + +int worldclock_icu_dst_get(const char *tz_path); + +#endif //__WCL_FWK_ICU_H__ diff --git a/inc/worldclock_timezone.h b/inc/worldclock_timezone.h new file mode 100644 index 0000000..264065a --- /dev/null +++ b/inc/worldclock_timezone.h @@ -0,0 +1,1259 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +{ + "Abidjan", "Ivory Coast", "GMT+0", "Africa/Abidjan" +} + +, { + "Abu Dhabi", "United Arab Emirates", "GMT+4", "Asia/Dubai" +} + +, { + "Accra", "Ghana", "GMT-10", "Africa/Accra" +} + +, { + "Addis Ababa", "Ethiopia", "GMT+3", "Africa/Addis_Ababa" +} + +, { + "Adelaide", "Australia", "GMT+9:30", "Australia/Adelaide" +} + +, { + "Alaska", "United States of America", "GMT-9", "America/Nome" +} + +, { + "Algiers", "Algeria", "GMT+1", "Africa/Algiers" +} + +, { + "Almaty", "Kazakhstan", "GMT+6", "Asia/Almaty" +} + +, { + "Ambon", "Indonesia", "GMT+1", "Asia/Jayapura" +} + +, { + "Amman", "Jordan", "GMT+2", "Asia/Amman" +} + +, { + "Amsterdam", "Netherlands", "GMT+1", "Europe/Amsterdam" +} + +, { + "Anadyr", "Russia", "GMT+12", "Asia/Anadyr" +} + +, { + "Anchorage", "United States of America", "GMT-9", "America/Anchorage" +} + +, { + "Ankara", "Turkey", "GMT+2", "Asia/Istanbul" +} + +, { + "Antananarivo", "Madagascar", "GMT+3", "Indian/Antananarivo" +} + +, { + "Ashgabat", "Turkmenistan", "GMT+5", "Asia/Ashgabat" +} + +, { + "Asmera", "Eritrea", "GMT+3", "Africa/Asmara" /* not in zone.tab */ +} + +, { + "Astana", "Kazakhstan", "GMT+6", "Asia/Almaty" /* not in zone.tab */ +} + +, { + "Asuncion", "Paraguay", "GMT-4", "America/Asuncion" +} + +, { + "Athens", "Greece", "GMT+2", "Europe/Athens" +} + +, { + "Auckland", "New Zealand", "GMT+12", "Pacific/Auckland" +} + +, { + "Austin", "United States of America", "GMT-6", "CST6CDT" +} + +, { + "Azores", "Portugal", "GMT-1", "Atlantic/Azores" +} + +, { + "Baghdad", "Iraq", "GMT+3", "Asia/Baghdad" +} + +, { + "Baku", "Azerbaijan", "GMT+4", "Asia/Baku" +} + +, { + "Baltimore", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Bamako", "Mali", "GMT+0", "Africa/Bamako" +} + +, { + "Bangkok", "Thailand", "GMT+7", "Asia/Bangkok" +} + +, { + "Bangui", "Central African Republic", "GMT+1", "Africa/Bangui" +} + +, { + "Barcelona", "Spain", "GMT+2", "Europe/Madrid" +} + +, { + "Bari", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Basse-Terre", "Guadeloupe", "GMT-4", "America/Guadeloupe" +} + +, { + "Beijing", "China", "GMT+8", "Asia/Shanghai" +} + +, { + "Beirut", "Lebanon", "GMT+2", "Asia/Beirut" +} + +, { + "Belgrade", "Serbia", "GMT+1", "Europe/Belgrade" +} + +, { + "Belize City", "Belize", "GMT-6", "America/Belize" +} + +, { + "Berlin", "Germany", "GMT+1", "Europe/Berlin" +} + +, { + "Bern", "Switzerland", "GMT+1", "Europe/Zurich" +} + +, { + "Bishkek", "Kyrgyzstan", "GMT+6", "Asia/Bishkek" +} + +, { + "Bissau", "Guinea Bissau", "GMT+0", "Africa/Bissau" +} + +, { + "Bogota", "Colombia", "GMT-5", "America/Bogota" +} + +, { + "Bologna", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Boston", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Brasilia", "Brazil", "GMT-3", "America/Sao_Paulo" +} + +, { + "Bratislava", "Slovakia", "GMT+2", "Europe/Bratislava" +} + +, { + "Bridgetown", "Barbados", "GMT-4", "America/Barbados" +} + +, { + "Brisbane", "Australia", "GMT+10", "Australia/Brisbane" +} + +, { + "Brussels", "Belgium", "GMT+1", "Europe/Brussels" +} + +, { + "Bucharest", "Romania", "GMT+3", "Europe/Bucharest" +} + +, { + "Budapest", "Hungary", "GMT+1", "Europe/Budapest" +} + +, { + "Buenos Aires", "Argentina", "GMT-3", "America/Argentina/Buenos_Aires" +} + +, { + "Cairo", "Egypt", "GMT+2", "Africa/Cairo" +} + +, { + "Calgary", "Canada", "GMT-7", "MST7MDT" +} + +, { + "Canary Islands", "Spain", "GMT+0", "Atlantic/Canary" +} + +, { + "Canberra", "Australia", "GMT+10", "Australia/Canberra" +} + +, { + "Canton", "China", "GMT+8", "Asia/Shanghai" +} + +, { + "Cape Town", "Republic of South Africa", "GMT+2", "Africa/Johannesburg" +} + +, { + "Caracas", "Venezuela", "GMT-4:30", "America/Caracas" +} + +, { + "Cardiff", "Wales", "GMT+0", "Europe/London" +} + +, { + "Casablanca", "Morocco", "GMT+0", "Africa/Casablanca" +} + +, { + "Catanzaro", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Cayenne", "French Guiana", "GMT-3", "America/Cayenne" +} + +, { + "Charlotte", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Charlotte Amalie", "United States Virgin Islands ", "GMT-5:30", + "America/St_Thomas" +} +, { + "Chelyabinsk", "Russia", "GMT+6", "Asia/Yekaterinburg" +} + +, { + "Chennai", "India", "GMT+5:30", "Asia/Kolkata" +} + +, { + "Chicago", "United States of America", "GMT-6", "America/Chicago" +} + +, { + "Chisinau", "Moldova", "GMT+2", "Europe/Chisinau" +} + +, { + "Chita", "Russia", "GMT+10", "Asia/Yakutsk" +} + +, { + "Cleveland", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Colombo", "Sri Lanka", "GMT+5:30", "Asia/Colombo" +} + +, { + "Columbus", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Conakry", "Guinea", "GMT+1", "Africa/Conakry" +} + +, { + "Copenhagen", "Denmark", "GMT+1", "Europe/Copenhagen" +} + +, { + "Cork", "Ireland", "GMT+0", "Europe/Dublin" +} + +, { + "Crotone", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Dakar", "Senegal", "GMT+0", "Africa/Dakar" +} + +, { + "Dallas", "United States of America", "GMT-6", "CST6CDT" +} + +, { + "Damascus", "Syria", "GMT+2", "Asia/Damascus" +} + +, { + "Dar es Salaam", "Tanzania", "GMT+3", "Africa/Dar_es_Salaam" +} + +, { + "Darwin", "Australia", "GMT+9:30", "Australia/Darwin" +} + +, { + "Delhi", "India", "GMT+5:30", "Asia/Kolkata" +} + +, { + "Denpasar", "Indonesia", "GMT+8", "Asia/Makassar" +} + +, { + "Denver", "United States of America", "GMT-7", "America/Denver" +} + +, { + "Detroit", "United States of America", "GMT-5", "America/Detroit" +} + +, { + "Dhaka", "Bangladesh", "GMT+6", "Asia/Dhaka" +} + +, { + "Diego Garcia", "United Kingdom", "GMT+5", "Indian/Chagos" /* not in zone.tab */ +} + +, { + "Djibouti", "Djibouti", "GMT+3", "Africa/Djibouti" +} + +, { + "Doha", "Qatar", "GMT+3", "Asia/Qatar" +} + +, { + "Douala", "Cameroon", "GMT+1", "Africa/Douala" +} + +, { + "Dubai", "United Arab Emirates", "GMT+4", "Asia/Dubai" +} + +, { + "Dublin", "Ireland", "GMT+0", "Europe/Dublin" +} + +, { + "Dushanbe", "Tajikistan", "GMT+5", "Asia/Dushanbe" +} + +, { + "Easter Island", "Chile", "GMT-6", "Pacific/Easter" +} + +, { + "Edinburgh", "Scotland", "GMT+0", "Europe/London" +} + +, { + "El Paso", "United States of America", "GMT-7", "MST7MDT" +} + +, { + "Florence", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Fort-de-France", "Martinique", "GMT-4", "America/Martinique" +} + +, { + "Freetown", "Sierra Leone", "GMT+0", "Africa/Freetown" +} + +, { + "Gaborone", "Botswana", "GMT+2", "Africa/Gaborone" +} + +, { + "Galapagos Islands", "Ecuador", "GMT-7", "Pacific/Galapagos" +} + +, { + "Geneva", "Switzerland", "GMT+1", "Europe/Paris" +} + +, { + "Genoa", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Georgetown", "Guyana", "GMT-4", "America/Guyana" +} + +, { + "Grytviken", "South Georgia", "GMT-2", "Atlantic/South_Georgia" +} + +, { + "Guam", "United States of America", "GMT+10", "Pacific/Guam" +} + +, { + "Guatemala City", "Guatemala", "GMT-6", "America/Guatemala" +} + +, { + "Gustavia", "Saint Barthelemy", "GMT-4", "America/Antigua" +} + +, { + "Halifax", "Canada", "GMT-4", "America/Halifax" +} + +, { + "Hamburg", "Germany", "GMT+1", "Europe/Berlin" +} + +, { + "Hanoi", "Vietnam", "GMT+7", "Asia/Ho_Chi_Minh" +} + +, { + "Harare", "Zimbabwe", "GMT+2", "Africa/Harare" +} + +, { + "Havana", "Cuba", "GMT-5", "America/Havana" +} + +, { + "Hawaii", "United States of America", "GMT-10", "Pacific/Honolulu" +} + +, { + "Helsinki", "Finland", "GMT+2", "Europe/Helsinki" +} + +, { + "Hobart", "Australia", "GMT+10", "Australia/Hobart" +} + +, { + "Hong Kong", "China", "GMT+8", "Asia/Hong_Kong" +} + +, { + "Honolulu", "United States of America", "GMT-10", "Pacific/Honolulu" +} + +, { + "Houston", "United States of America", "GMT-6", "CST6CDT" +} + +, { + "Hovd", "Mongolia", "GMT+8", "Asia/Hovd" +} + +, { + "Indianapolis", "United States of America", "GMT-5", + "America/Indiana/Indianapolis" +} +, { + "Irkutsk", "Russia", "GMT+9", "Asia/Irkutsk" +} + +, { + "Islamabad", "Pakistan", "GMT+5", "Asia/Karachi" +} + +, { + "Istanbul", "Turkey", "GMT+2", "Europe/Istanbul" +} + +, { + "Izhevsk", "Russia", "GMT+4", "Europe/Moscow" +} + +, { + "Jakarta", "Indonesia", "GMT+7", "Asia/Jakarta" +} + +, { + "Jeddah", "Saudi Arabia", "GMT+3", "Asia/Riyadh" +} + +, { + "Jerusalem", "Israel", "GMT+2", "Asia/Jerusalem" +} + +, { + "Johannesburg", "South Africa", "GMT+2", "Africa/Johannesburg" +} + +, { + "Kabul", "Afghanistan", "GMT+4:30", "Asia/Kabul" +} + +, { + "Kaliningrad", "Russia", "GMT+3", "Europe/Kaliningrad" +} + +, { + "Kamchatka", "Russia", "GMT+12", "Asia/Kamchatka" +} + +, { + "Kampala", "Uganda", "GMT+3", "Africa/Kampala" +} + +, { + "Karachi", "Pakistan", "GMT+5", "Asia/Karachi" +} + +, { + "Kathmandu", "Nepal", "GMT+5:45", "Asia/Kathmandu" +} + +, { + "Khabarovsk", "Russia", "GMT+11", "Asia/Vladivostok" +} + +, { + "Kharkiv", "Ukraine", "GMT+2", "Europe/Kiev" +} + +, { + "Khartoum", "Sudan", "GMT+3", "Africa/Khartoum" +} + +, { + "Kiev", "Ukraine", "GMT+2", "Europe/Kiev" +} + +, { + "Kingston", "Canada", "GMT-5", "America/Toronto" +} + +, /* not in zone.tab */ +{ + "Kingston", "Jamaica", "GMT-5", "America/Jamaica" +} + +, { + "Kinshasa", "Democratic Republic of the Congo", "GMT+1", "Africa/Kinshasa" +} + +, { + "Kolkata", "India", "GMT+5:30", "Asia/Kolkata" +} + +, { + "Krasnoyarsk", "Russia", "GMT+8", "Asia/Krasnoyarsk" +} + +, { + "Kuala Lumpur", "Malaysia", "GMT+8", "Asia/Kuala_Lumpur" +} + +, { + "Kuwait", "Kuwait", "GMT+3", "Asia/Kuwait" +} + +, { + "Kyiv", "Ukraine", "GMT+2", "Europe/Kiev" /* not in zone.tab */ +} + +, { + "Los Angeles", "United States of America", "GMT-7", "America/Los_Angeles" +} + +, { + "La Paz", "Bolivia", "GMT-4", "America/La_Paz" +} + +, { + "Lagos", "Nigeria", "GMT+1", "Africa/Lagos" +} + +, { + "Las Vegas", "United States of America", "GMT-8", "PST8PDT" +} + +, { + "Lima", "Peru", "GMT-5", "America/Lima" +} + +, { + "Lisbon", "Portugal", "GMT+0", "Europe/Lisbon" +} + +, { + "Ljubljana", "Slovakia", "GMT+1", "Europe/Ljubljana" +} + +, { + "London", "United Kingdom", "GMT+0", "Europe/London" +} + +, { + "Atlanta", "United States of America", "GMT-5", "America/Georgia/Atlanta" +} + +, { + "Louisville", "United States of America", "GMT-5", "America/Kentucky/Louisville" +} + +, { + "Luanda", "Angola", "GMT+1", "Africa/Luanda" +} + +, { + "Lubumbashi", "Democratic Republic of the Congo", "GMT+2", "Africa/Lubumbashi" +} + +, { + "Lusaka", "Zambia", "GMT+2", "Africa/Lusaka" +} + +, { + "Luxembourg", "Luxembourg", "GMT+1", "Europe/Luxembourg" +} + +, { + "Lviv", "Ukraine", "GMT+2", "Europe/Kiev" +} + +, { + "Macau", "China", "GMT+8", "Asia/Macau" +} + +, { + "Madrid", "Spain", "GMT+2", "Europe/Madrid" +} + +, { + "Magadan", "Russia", "GMT+12", "Asia/Magadan" +} + +, { + "Malabo", "Equaorial Guinea", "GMT+1", "Africa/Malabo" +} + +, { + "Male", "Maldives", "GMT+5", "Indian/Maldives" +} + +, { + "Managua", "Nicaragua", "GMT-6", "America/Managua" +} + +, { + "Manama", "Bahrain", "GMT+3", "Asia/Bahrain" +} + +, { + "Manila", "Philippines", "GMT+8", "Asia/Manila" +} + +, { + "Maputo", "Mozambique", "GMT+2", "Africa/Maputo" +} + +, { + "Marigot", "Saint Martin", "GMT-4", "America/Marigot" +} + +, { + "Mazatlan", "Mexico", "GMT-7", "America/Mazatlan" +} + +, { + "Mecca", "Saudi Arabia", "GMT+3", "Asia/Riyadh" +} + +, { + "Melbourne", "Australia", "GMT+10", "Australia/Melbourne" +} + +, { + "Memphis", "United States of America", "GMT-6", "CST6CDT" +} + +, { + "Messina", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Mexico City", "Mexico", "GMT-6", "America/Mexico_City" +} + +, { + "Miami", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Mid-Atlantic", "United States of America", "GMT-2", "America/New_York" /* not in zone.tab */ +} + +, { + "Midway Atoll", "United States of America", "GMT-11", "Pacific/Midway" +} + +, { + "Milan", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Milwaukee", "United States of America", "GMT-6", "CST6CDT" +} + +, { + "Minsk", "Belarus", "GMT+2", "Europe/Minsk" +} + +, { + "Mogadishu", "Somalia", "GMT+2", "Africa/Mogadishu" +} + +, { + "Monrovia", "Liberia", "GMT+0", "Africa/Monrovia" +} + +, { + "Montevideo", "Uruguay", "GMT-3", "America/Montevideo" +} + +, { + "Montreal", "Canada", "GMT-5", "America/Montreal" +} + +, { + "Moscow", "Russia", "GMT+4", "Europe/Moscow" +} + +, { + "Mumbai", "India", "GMT+5:30", "Asia/Kolkata" +} + +, { + "Munich", "Germany", "GMT+1", "Europe/Berlin" +} + +, { + "Muscat", "Oman", "GMT+4", "Asia/Muscat" +} + +, { + "Nairobi", "Kenya", "GMT+3", "Africa/Nairobi" +} + +, { + "Naples", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Naters", "Switzerland", "GMT+1", "Europe/Zurich" +} + +, { + "Ndjamena", "Chad", "GMT+1", "Africa/Ndjamena" +} + +, { + "New Delhi", "India", "GMT+5:30", "Asia/Kolkata" /* not in zone.tab */ +} + +, { + "New York", "United States of America", "GMT-4", "America/New_York" +} + +, { + "Newfoundland", "Canada", "GMT-3:30", "America/St_Johns" +} + +, { + "Niamey", "Niger", "GMT+1", "Africa/Niamey" +} + +, { + "Nouakchott", "Mauritania", "GMT+1", "Africa/Nouakchott" +} + +, { + "Noumea", "New Caledonia", "GMT+11", "Pacific/Noumea" +} + +, { + "Novokuznetsk", "Russia", "GMT+7", "Asia/Novokuznetsk" +} + +, /* not clear */ +{ + "Novosibirsk", "Russia", "GMT+7", "Asia/Novosibirsk" +} + +, { + "Nuku'alofa", "Tonga", "GMT+13", "Pacific/Tongatapu" +} + +, { + "Nuuk", "Greenland", "GMT-3", "America/Godthab" +} + +, { + "Omsk", "Russia", "GMT+7", "Asia/Omsk" +} + +, { + "Osaka", "Japan", "GMT+9", "Asia/Tokyo" +} + +, { + "Ottawa", "Canada", "GMT-5", "EST5EDT" +} + +, { + "Ouagadougou", "Burkina Faso", "GMT+0", "Africa/Ouagadougou" +} + +, { + "Pago Pago", "Independent State of Samoa", "GMT-11", "Pacific/Pago_Pago" +} + +, { + "Palermo", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Panama City", "Panama", "GMT-6", "America/Panama" +} + +, { + "Paramaribo", "Surinam", "GMT-3", "America/Paramaribo" +} + +, { + "Paris", "France", "GMT+1", "Europe/Paris" +} + +, { + "Perm", "Russia", "GMT+6", "Asia/Yekaterinburg" +} + +, { + "Perth", "Australia", "GMT+8", "Australia/Perth" +} + +, { + "Petropavlovsk-Kamchatskiy", "Russia", "GMT+12", "Asia/Kamchatka" +} + +, { + "Philadelphia", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Phnom Penh ", "Cambodia", "GMT-5", "Asia/Phnom_Penh" +} + +, { + "Phoenix", "United States of America", "GMT-7", "America/Phoenix" +} + +, { + "Podgorica", "Montenegro", "GMT+1", "Europe/Podgorica" +} + +, { + "Ponta Delgada", "Portugal", "GMT-1", "Atlantic/Azores" +} + +, { + "Port Louis", "Mauritius", "GMT+4", "Indian/Mauritius" +} + +, { + "Port-au-Prince", "Haiti", "GMT-5", "America/Port-au-Prince" +} + +, { + "Portland", "United States of America", "GMT-8", "PST8PDT" +} + +, { + "Prague", "Czech Republic", "GMT+1", "Europe/Prague" +} + +, { + "Pyongyang", "North Korea", "GMT+9", "Asia/Pyongyang" +} + +, { + "Quito", "Ecuador", "GMT-5", "America/Guayaquil" +} + +, { + "Rabat", "Morocco", "GMT+0", "Africa/Casablanca" +} + +, { + "Rangoon", "Burma", "GMT+6:30", "Asia/Rangoon" +} + +, { + "Recife", "Brazil", "GMT-3", "America/Recife" +} + +, { + "Regina", "Canada", "GMT-6", "America/Regina" +} + +, { + "Reykjavik", "Iceland", "GMT+0", "Atlantic/Reykjavik" +} + +, { + "Riga", "Latvia", "GMT+2", "Europe/Riga" +} + +, { + "Rio de Janeiro", "Brazil", "GMT-2", "America/Sao_Paulo" +} + +, { + "Riyadh", "Saudi Arabia", "GMT+3", "Asia/Riyadh" +} + +, { + "Rome", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Saint-Denis", "Reunion Island", "GMT+4", "Indian/Reunion" +} + +, { + "Samara", "Russia", "GMT+4", "Europe/Samara" +} + +, /* not clear */ +{ + "San Antonio", "United States of America", "GMT-6", "CST6CDT" +} + +, { + "San Diego", "United States of America", "GMT-8", "PST8PDT" +} + +, { + "San Francisco", "United States of America", "GMT-8", "America/Los_Angeles" +} + +, { + "San Jose", "United States of America", "GMT-8", "PST8PDT" +} + +, { + "San Jose", "Costa Rica", "GMT-6", "America/Costa_Rica" +} + +, { + "San Juan", "Puerto Rico", "GMT-4", "America/Puerto_Rico" +} + +, { + "San Marino", "Italy", "GMT+1", "Europe/San_Marino" +} + +, { + "San Salvador", "El Salvador", "GMT-6", "America/El_Salvador" +} + +, { + "Sanaa", "Yemen", "GMT+3", "Asia/Aden" /* not in zone.tab */ +} + +, { + "Santiago", "Chile", "GMT-4", "America/Santiago" +} + +, { + "Santo Domingo", "Dominican Republic", "GMT-4", "America/Santo_Domingo" +} + +, { + "Sao Paulo", "Brazil", "GMT-2", "America/Sao_Paulo" +} + +, { + "Seattle", "United States of America", "GMT-8", "PST8PDT" +} + +, { + "Seoul", "Republic of Korea", "GMT+9", "Asia/Seoul" +} + +, { + "Shanghai", "China", "GMT+8", "Asia/Shanghai" +} + +, { + "Shenzhen", "China", "GMT+8", "Asia/Shanghai" +} + +, { + "Singapore", "Republic of Singapore", "GMT+8", "Asia/Singapore" +} + +, { + "Skopje", "Macedonia", "GMT+1", "Europe/Skopje" +} + +, { + "Sofia ", "Bulgaria", "GMT+3", "Europe/Sofia" +} + +, { + "St. John's", "Antigua and Barbuda", "GMT-4", "America/Antigua" +} + +, { + "St. John's", "Canada", "GMT-3:30", "America/St_Johns" +} + +, { + "St. Petersburg", "Russia", "GMT+4", "Europe/Moscow" +} + +, { + "Stockholm", "Sweden", "GMT+2", "Europe/Stockholm" +} + +, { + "Suva", "Fiji", "GMT+12", "Pacific/Fiji" +} + +, { + "Sydney", "Australia", "GMT+11", "Australia/Sydney" +} + +, { + "Tahiti", "French Polynesia", "GMT-10", "Pacific/Tahiti" +} + +, { + "Taipei", "Taiwan", "GMT+8", "Asia/Taipei" +} + +, { + "Tallinn", "Estonia", "GMT+2", "Europe/Tallinn" +} + +, { + "Tarawa", "Kiribati", "GMT+12", "Pacific/Tarawa" +} + +, { + "Tashkent", "Uzbekistan", "GMT+5", "Asia/Tashkent" +} + +, { + "Tbilisi", "Georgia", "GMT+4", "Asia/Tbilisi" +} + +, { + "Tegucigalpa", "Honduras", "GMT-6", "America/Tegucigalpa" +} + +, { + "Tehran", "Iran", "GMT+3:30", "Asia/Tehran" +} + +, { + "Thanh Pho Ho Chi Minh", "Vietnam", "GMT+7", "Asia/Ho_Chi_Minh" +} + +, { + "The Settlement", "British Virgin Islands ", "GMT-4", "America/Tortola" +} + +, { + "Tientsin", "China", "GMT+8", "Asia/Shanghai" /* not in zone.tab */ +} + +, { + "Tijuana", "Mexico", "GMT-5", "America/Tijuana" +} + +, { + "Tokyo", "Japan", "GMT+9", "Asia/Tokyo" +} + +, { + "Toronto", "Canada", "GMT-4", "America/Toronto" +} + +, { + "Trehet", "France", "GMT+1", "Europe/Paris" /* not in zone.tab */ +} + +, { + "Tripoli", "Libya", "GMT+2", "Africa/Tripoli" +} + +, { + "Tunis", "Tunisia", "GMT+2", "Africa/Tunis" +} + +, { + "Turin", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Ufa", "Bashkiriya", "GMT+5", "Asia/Yekaterinburg" +} + +, { + "Ulan Bator", "Mongolia", "GMT+8", "Asia/Ulan_Bator" +} + +, { + "Vaduz", "Liechtenstein", "GMT+1", "Europe/Vaduz" +} + +, { + "Valletta", "Malta", "GMT+1", "Europe/Malta" +} + +, { + "Vancouver", "Canada", "GMT-8", "America/Vancouver" +} + +, { + "Verona", "Italy", "GMT+1", "Europe/Rome" +} + +, { + "Victoria", "Seychelles", "GMT+4", "Australia/Melbourne" +} + +, { + "Vienna", "Austria", "GMT+1", "Europe/Vienna" +} + +, { + "Vilnius", "Lithuania", "GMT+3", "Europe/Vilnius" +} + +, { + "Vladivostok", "Russia", "GMT+11", "Asia/Vladivostok" +} + +, { + "Volgograd", "Russia", "GMT+4", "Europe/Volgograd" +} + +, /* not clear */ +{ + "Warsaw", "Poland", "GMT+2", "Europe/Warsaw" +} + +, { + "Washington, D.C.", "United States of America", "GMT-5", "EST5EDT" +} + +, { + "Wellington", "New Zealand", "GMT+12", "Pacific/Auckland" +} + +, { + "Winnipeg", "Canada", "GMT-5", "America/Winnipeg" +} + +, { + "Yakutsk", "Russia", "GMT+10", "Asia/Yakutsk" +} + +, { + "Yamoussoukro", "Ivory Coast", "GMT+0", "Africa/Abidjan" +} + +, { + "Yaounde", "Cameroon", "GMT+1", "Africa/Douala" /* not in zone.tab */ +} + +, { + "Yekaterinburg", "Russia", "GMT+6", "Asia/Yekaterinburg" +} + +, { + "Yerevan", "Armenia", "GMT+5", "Asia/Yerevan" +} + +, { + "Yuzhno-Sakhalinsk", "Russia", "GMT+11", "Asia/Sakhalin" +} + +, { + "Zagreb", "Croatia", "GMT+1", "Europe/Zagreb" +} + +, { + "Zurich", "Switzerland", "GMT+1", "Europe/Zurich" +} + +, { + "Hyderabad", "India", "GMT+5:30", "Asia/Andhra/Hyderabad" +} + +, { + "Bangalore", "India", "GMT+5:30", "Asia/Karnataka/Bangalore" +} + +, { + NULL, NULL, NULL, NULL +} + +, diff --git a/inc/worldclock_types.h b/inc/worldclock_types.h new file mode 100644 index 0000000..3b541da --- /dev/null +++ b/inc/worldclock_types.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_TYPES_H__ +#define __DEF_WORLDCLOCK_TYPES_H__ + +#include +#include "worldclock_const.h" + +typedef void (*Wcl_Return_Cb) (void *, Eina_Bool); + +typedef enum { + WCL_CALLER_IS_APP_IT_SELF = 0, + WCL_CALLER_IS_SHARED_LIBRARY, + WCL_CALLER_IS_UI_GADGET, + WCL_CALLER_IS_LIVEBOX, + WCL_CALLER_IS_UNKNOW, +} Wcl_Caller; + +#ifdef FEATURE_SORT_ORDER +typedef enum { + WCL_SORT_BY_NAME = 1, + WCL_SORT_BY_TIMEZONE, + + WCL_UNKNOW_SORT_TYPE, +} Wcl_Addlist_Sort_Type; +#endif + +typedef enum { + WCL_SELECT_IN_UNSELECTED = 0, + WCL_SELECT_IN_ALL, + WCL_SELECT_IF_HAS_TZPATH, + + WCL_SELECTION_UNKNOW_FLAG, +} Wcl_Selection_Flag; + +typedef enum { + WCL_SEARCH_BY_ALL_KEYWORDS = 0, + WCL_SEARCH_BY_CITY_NAME, + WCL_SEARCH_BY_COUNTRY_NAME, + WCL_SEARCH_BY_TIMEZONE, + + WCL_UNKNOWN_SEARCH_TYPE, +} Wcl_Search_Type; + +typedef enum { + WCL_DST_OFF = -1, + WCL_DST_AUTO = 0, + WCL_DST_1_HOUR, + WCL_DST_2_HOURS, + + WCL_DST_TYPES_COUNT, + + WCL_DST_UNKNOWN_TYPE, +} Wcl_DST_Type; + +typedef struct _cs { /* city set */ + int index; /* record index in db */ + char city[CITY_BUF_SIZE]; /* city name */ + char country[COUNTRY_BUF_SIZE]; /* country name */ + char timezone[TIMEZONE_BUF_SIZE]; /* timezone */ + int dst_type; /* dst type */ + int dst_enabled; /* dst disable flag */ + int selected; /* selected or not */ + int sequence; /* sequence number in mainlist */ + char tz_path[TZPATH_BUF_SIZE]; /* TZ path of city */ + + int dst; /* dst value */ + volatile time_t now_time; /* the current time of city */ + + char flag[COUNTRY_BUF_SIZE]; /* flag image name */ + char mcc[MCC_BUF_SIZE]; +} Wcl_CitySet; + +#endif // __DEF_WORLDCLOCK_TYPES_H__ diff --git a/inc/worldclock_util.h b/inc/worldclock_util.h new file mode 100644 index 0000000..040cd7b --- /dev/null +++ b/inc/worldclock_util.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_WORLDCLOCK_UTIL_H_ +#define __DEF_WORLDCLOCK_UTIL_H_ + +#include +#include +#include "worldclock.h" + +/** + * Compare the city name of two cities + * + * @param[in] data1 record data of city1 + * @param[in] data2 record data of city2 + * + * @return -1 if city name of city2 is bigger than city1's + * 1 if city name of city1 is bigger than city2's + * 0 if city name of city2 is equal to city1, or meet error + */ +int worldclock_city_compare_cb(const void *data1, const void *data2); + +/** + * Compare timezone of two cities + * + * @param[in] data1 recorder of city1 + * @param[in] data2 recorder of city2 + * + * @return -1 if timezone of city2 is bigger than city1's + * 1 if timezone of city1 is bigger than city2's + * 0 if timezone of city2 is equal to city1, or meet error + */ +int worldclock_time_compare_cb(const void *data1, const void *data2); + +/** + * Remove all items in eina_list + * + * @param[in] glist given eina list + * @param[in] is_free_element flag to define if free data in every item is needed + * + * @return EINA_TRUE if remove successfully + */ +Eina_Bool worldclock_util_glist_remove_all(Eina_List * glist, Eina_Bool is_free_element); +#if 0 +/** + * Creat new popup window, and show it + * + * @param[in] parent Parent for such popup + * @param[in] data Data used in this function + * @param[in] info String displayed on popup + * + * @return + */ +void worldclock_show_popup(Evas_Object * parent, Evas_Object ** p_popup, char *info); +#endif + +/** + * Create layout by load edj according group name from edj file + * + * @param[in] parent Parent of new layout + * @param[in] file EDJE file + * @param[in] group name of group + * + * @return NULL if meet error + * Pointer to new layout + */ +Evas_Object *worldclock_load_edj(Evas_Object * parent, const char *file, + const char *group); + +int worldclock_dst_get(const Wcl_CitySet * cs); + +const char *worldclock_get_egje_path(); +const char *worldclock_get_locale_path(); + +void worldclock_path_util_free(); + +#endif /* __DEF_WORLDCLOCK_UTIL_H_ */ diff --git a/include/clock_fwk_icu_label.h b/include/clock_fwk_icu_label.h deleted file mode 100644 index 63ca931..0000000 --- a/include/clock_fwk_icu_label.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __CLOCK_FWK_ICU_LABEL_H__ -#define __CLOCK_FWK_ICU_LABEL_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - void init_alphabetic_index(char *lang); - - void uninit_alphabetic_index(); - - int32_t get_alphabetic_index(char *cityname); - - char *get_alphabetic_index_name(int32_t index); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/include/ug_worldclock_efl.h b/include/ug_worldclock_efl.h deleted file mode 100644 index 2d435ed..0000000 --- a/include/ug_worldclock_efl.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __helloUG_efl_H__ -#define __helloUG_efl_H__ - -#include - -#define IS_STR_EQUAL(a, b) (!strcmp(a, b)) -#define IS_STR_NOT_EQUAL(a, b) (strcmp(a, b)) - -//******************define:free ************************************* -#define FREEIF(p) ({if (p) {free(p); p = NULL; }}) -#define EVAS_OBJECT_DELIF(p) ({if (p) {evas_object_del(p); p = NULL; }}) -#define ECORE_TIMER_DELIF(p) ({if (p) {ecore_timer_del(p); p = NULL; }}) - -#endif /* __helloUG_efl_H__ */ diff --git a/include/worldclock.h b/include/worldclock.h deleted file mode 100644 index 04e8ee7..0000000 --- a/include/worldclock.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_H__ -#define __DEF_WORLDCLOCK_H__ - -#include -#include -#include - -#include "worldclock_const.h" -#include "worldclock_types.h" - -struct appdata { - int root_w; - int root_h; - int root_x; - int root_y; - - //the caller - Wcl_Caller caller; - //the selection flag - Wcl_Selection_Flag selectionFlag; - - //flag for if or not enter the loop update - bool flag_first; //as the flag for the first time to enter __ugview_index_update - bool flag_special_character; //as the flag for if or not have special character in index - - //For store the default country list - Eina_List *default_list; - //flag for if or not hide the index - bool flag_index; - - /* Add city List */ - //For save current search content - char search_text[BUF_SIZE]; - char current_mcc[MCC_BUF_SIZE]; - - Elm_Object_Item *item_selected; //for store the selected city item - int city_index; //for store the selected city index - - Ecore_IMF_Context *imf_context; - - /* public used widget */ - Evas_Object *win; - Evas_Object *conform; - Evas_Object *bg; - - // samsung window layout - Evas_Object *ly_main; - Evas_Object *parent; - Evas_Object *more_btn; - Evas_Object *back_btn; - - /* add layout */ - Evas_Object *add_ly; - Evas_Object *add_layout; - Evas_Object *add_search_bar; - Evas_Object *add_fs_layout; - Evas_Object *add_genlist; - Evas_Object *add_index; - Evas_Object *nocontent; - - Evas_Object *searchbar_rect; - Evas_Object *searchbar_entry; - Evas_Object *searchbar_button; - - /* timer */ - Ecore_Timer *add_view_quit_timer; - Ecore_Timer *add_view_update_timer; - Ecore_Timer *search_timer; - - /* Home City */ - Wcl_CitySet *home_cs; - - Evas_Object *navi_bar; - - ui_gadget_h ug; - // return a Wcl_CitySet, used in ug - Wcl_CitySet *return_data; - -#ifdef FEATURE_SORT_ORDER - //mark sort by name or gmt - Wcl_Addlist_Sort_Type sort; - Evas_Object *more_popup; - - //sort popup box - Evas_Object *sort_popup; //sort popup - Evas_Object *sort_popup_genlist; //sort popup genlist - Evas_Object *sort_radio; //sort radio - Wcl_Addlist_Sort_Type sort_text; //sort text - Wcl_Addlist_Sort_Type ex_sort_text; //sort text -#endif - - Eina_Bool is_Empty; - int searched_num; - int searched_text_length; -}; - -#endif /* __DEF_WORLDCLOCK_H_ */ - diff --git a/include/worldclock_add_view.h b/include/worldclock_add_view.h deleted file mode 100644 index e8eafc9..0000000 --- a/include/worldclock_add_view.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_ADDVIEW_H_ -#define __DEF_WORLDCLOCK_ADDVIEW_H_ - -#include -#include "worldclock.h" - -/** - * Create add view for append new city into the selection list of worldclock - * - * @param[in] parent Evas_Object which is the parent of add view - * @param[in] data data which used in this function - * @param[in] func Callback function which used for invoking when exit from add view - * - * @return FAILED if create add view failed. - * SUCCESS if create add view successfully. - */ -int worldclock_ugview_add(Evas_Object * parent, void *data, Wcl_Return_Cb func); - -/** - * Update worldclock view - * - * @param[in] data data used for this function - * - * @return FAILED if update add view failed. - * SUCCESS if update add view successfully. - */ -int worldclock_ugview_update(void *data); - -/** - * Release all resources which used in add view when exit from add view - * - * @param[in] data data which used in this function - * - * @return - */ -void worldclock_ugview_free(void *data); - -#endif /* __DEF_WORLDCLOCK_ADDVIEW_H_ */ diff --git a/include/worldclock_const.h b/include/worldclock_const.h deleted file mode 100644 index 4546137..0000000 --- a/include/worldclock_const.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_CONST_H_ -#define __DEF_WORLDCLOCK_CONST_H_ - -#ifndef _ -#define _(s) (dgettext(PACKAGE, s)) -#endif -#ifndef _EDJ -#define _EDJ(o) (elm_layout_edje_get(o)) -#endif - -#define BUF_SIZE 256 -#define BUF_MIN_SIZE 32 -#define BUF_LARGE_SIZE 512 - -#define CITY_BUF_SIZE 128 -#define COUNTRY_BUF_SIZE 128 -#define TIMEZONE_BUF_SIZE 32 -#define TZPATH_BUF_SIZE 128 -#define FLAG_BUF_SIZE 128 -#define MCC_BUF_SIZE 20 - -#define WCL_EDJ_PATH EDJDIR -#define WCL_EDJ_NAME WCL_EDJ_PATH"/ug_worldclock.edj" - -/* group name */ -#define GRP_ADD "ug_add_layout" - -#ifndef SUCCESS -#define SUCCESS 0 -#endif -#ifndef FAILED -#define FAILED -1 -#endif - -#endif /* __DEF_WORLDCLOCK_CONST_H_ */ diff --git a/include/worldclock_data.h b/include/worldclock_data.h deleted file mode 100644 index 8ab37f0..0000000 --- a/include/worldclock_data.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_DATA_H_ -#define __DEF_WORLDCLOCK_DATA_H_ - -#include -#include "worldclock_types.h" - -Eina_List *worldclock_ug_data_get_default_city_list(Wcl_Selection_Flag selectFlag); -Eina_Bool worldclock_ug_data_get_city_status_from_db(Wcl_CitySet * p_record); -Eina_Bool worldclock_ug_data_open_database(); -Eina_Bool worldclock_ug_data_close_database(); -void worldclock_ug_data_cityset_copy(Wcl_CitySet * dst_city, const Wcl_CitySet * src_city); - -/*TODO Functions below are not used in current realization. Probably it will be used for Clock application*/ -Wcl_CitySet *worldclock_ug_data_get_local_city(); -Eina_List *worldclock_ug_data_get_all_added_city(); -Eina_List *worldclock_ug_data_get_search_city_list(const char *search_txt, - Wcl_Search_Type search_type, Wcl_Selection_Flag selectFlag); -Eina_Bool worldclock_ug_data_update_db_record(Wcl_CitySet * p_record); - -#endif /* __DEF_WORLDCLOCK_DATA_H_ */ diff --git a/include/worldclock_dlog.h b/include/worldclock_dlog.h deleted file mode 100644 index 3b6da2d..0000000 --- a/include/worldclock_dlog.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_DLOG_H__ -#define __DEF_WORLDCLOCK_DLOG_H__ - -#include -#include "ug_worldclock_efl.h" - -//tag -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "WORLDCLOCK_UG" - -#define FUNCTION_LOG ENABLE -#ifdef FUNCTION_LOG -#define CLK_FUN_BEG() CLK_INFO("====>>>>fun=%s, BEGIN====>>>>", __FUNCTION__); -#define CLK_FUN_END() CLK_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__); -#else -#define CLK_FUN_BEG() -#define CLK_FUN_END() -#endif -#define CLK_INFO(fmt, arg...) (LOGD("[%s:%d] "fmt,__FILE__, __LINE__, ##arg)) -#define CLK_SINFO(fmt, arg...) (SECURE_LOGD("[%s:%d] "fmt,__FILE__, __LINE__, ##arg)) -#define CLK_ERR(fmt,arg...) (LOGE(FONT_COLOR_RED"[%s:%d] "fmt FONT_COLOR_RESET, __FILE__, __LINE__, ##arg)) - -#define CLK_FUN_DEBUG_BEG() //CLK_INFO("====>>>>fun=%s, BEGIN====>>>>",__FUNCTION__); -#define CLK_FUN_DEBUG_END() //CLK_INFO("====>>>>fun=%s, END====>>>>", __FUNCTION__); -#define CLK_DEBUG_INFO(fmt, arg...) //CLK_INFO(fmt, ##arg) -#define CLK_DEBUG_INFO(fmt, arg...) //CLK_ERR(fmt,##arg) - -/* anci c color type */ -#define FONT_COLOR_RESET "\033[0m" -#define FONT_COLOR_RED "\033[31m" -#define FONT_COLOR_GREEN "\033[32m" -#define FONT_COLOR_YELLOW "\033[33m" -#define FONT_COLOR_CYAN "\033[36m" - -#define CLK_INFO_RED(fmt, arg...) (CLK_INFO(FONT_COLOR_RED fmt FONT_COLOR_RESET, ##arg)) -#define CLK_INFO_GREEN(fmt, arg...) (CLK_INFO(FONT_COLOR_GREEN fmt FONT_COLOR_RESET, ##arg)) -#define CLK_INFO_YELLOW(fmt, arg...) (CLK_INFO(FONT_COLOR_YELLOW fmt FONT_COLOR_RESET, ##arg)) -#define CLK_INFO_CYAN(fmt, arg...) (CLK_INFO(FONT_COLOR_CYAN fmt FONT_COLOR_RESET, ##arg)) - -#define ret_if(expr) ({do { \ - if(expr) { \ - CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ - return; \ - } \ - } while (0);}) -#define retv_if(expr, val) ({do { \ - if(expr) { \ - CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ - return (val); \ - } \ - } while (0);}) -#define retm_if(expr, fmt, arg...) ({do { \ - if(expr) { \ - CLK_ERR(fmt, ##arg); \ - CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ - return; \ - } \ - } while (0);}) -#define retvm_if(expr, val, fmt, arg...) ({do { \ - if(expr) { \ - CLK_ERR(fmt, ##arg); \ - CLK_ERR("(%s) -> %s() return", #expr, __FUNCTION__); \ - return (val); \ - } \ - } while (0);}) - -#define GOTO_ERROR_IF(expr) \ - ({do { \ - if ((expr)) { \ - CLK_ERR("(%s) goto error", #expr); \ - goto error; \ - } \ - } while (0);}) - -#endif // __DEF_WORLDCLOCK_DLOG_H__ diff --git a/include/worldclock_fwk_icu.h b/include/worldclock_fwk_icu.h deleted file mode 100644 index c1621ea..0000000 --- a/include/worldclock_fwk_icu.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __WCL_FWK_ICU_H__ -#define __WCL_FWK_ICU_H__ -#include - -/*BEG: Gong Xingsheng add in Mon Nov 21 01:04:37 PST 2011 - * this struct is saved hour, min, sec and current time format - * which is used in genlist item date - */ - -typedef struct _worldclock_time_s worldclock_time_s; -struct _worldclock_time_s { - int hour; - int min; - int sec; - bool bAm; -}; -/*END: Gong Xingsheng add in Mon Nov 21 01:04:37 PST 2011 */ - -int worldclock_icu_dst_get(const char *tz_path); - -#endif //__WCL_FWK_ICU_H__ diff --git a/include/worldclock_timezone.h b/include/worldclock_timezone.h deleted file mode 100644 index 264065a..0000000 --- a/include/worldclock_timezone.h +++ /dev/null @@ -1,1259 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - -{ - "Abidjan", "Ivory Coast", "GMT+0", "Africa/Abidjan" -} - -, { - "Abu Dhabi", "United Arab Emirates", "GMT+4", "Asia/Dubai" -} - -, { - "Accra", "Ghana", "GMT-10", "Africa/Accra" -} - -, { - "Addis Ababa", "Ethiopia", "GMT+3", "Africa/Addis_Ababa" -} - -, { - "Adelaide", "Australia", "GMT+9:30", "Australia/Adelaide" -} - -, { - "Alaska", "United States of America", "GMT-9", "America/Nome" -} - -, { - "Algiers", "Algeria", "GMT+1", "Africa/Algiers" -} - -, { - "Almaty", "Kazakhstan", "GMT+6", "Asia/Almaty" -} - -, { - "Ambon", "Indonesia", "GMT+1", "Asia/Jayapura" -} - -, { - "Amman", "Jordan", "GMT+2", "Asia/Amman" -} - -, { - "Amsterdam", "Netherlands", "GMT+1", "Europe/Amsterdam" -} - -, { - "Anadyr", "Russia", "GMT+12", "Asia/Anadyr" -} - -, { - "Anchorage", "United States of America", "GMT-9", "America/Anchorage" -} - -, { - "Ankara", "Turkey", "GMT+2", "Asia/Istanbul" -} - -, { - "Antananarivo", "Madagascar", "GMT+3", "Indian/Antananarivo" -} - -, { - "Ashgabat", "Turkmenistan", "GMT+5", "Asia/Ashgabat" -} - -, { - "Asmera", "Eritrea", "GMT+3", "Africa/Asmara" /* not in zone.tab */ -} - -, { - "Astana", "Kazakhstan", "GMT+6", "Asia/Almaty" /* not in zone.tab */ -} - -, { - "Asuncion", "Paraguay", "GMT-4", "America/Asuncion" -} - -, { - "Athens", "Greece", "GMT+2", "Europe/Athens" -} - -, { - "Auckland", "New Zealand", "GMT+12", "Pacific/Auckland" -} - -, { - "Austin", "United States of America", "GMT-6", "CST6CDT" -} - -, { - "Azores", "Portugal", "GMT-1", "Atlantic/Azores" -} - -, { - "Baghdad", "Iraq", "GMT+3", "Asia/Baghdad" -} - -, { - "Baku", "Azerbaijan", "GMT+4", "Asia/Baku" -} - -, { - "Baltimore", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Bamako", "Mali", "GMT+0", "Africa/Bamako" -} - -, { - "Bangkok", "Thailand", "GMT+7", "Asia/Bangkok" -} - -, { - "Bangui", "Central African Republic", "GMT+1", "Africa/Bangui" -} - -, { - "Barcelona", "Spain", "GMT+2", "Europe/Madrid" -} - -, { - "Bari", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Basse-Terre", "Guadeloupe", "GMT-4", "America/Guadeloupe" -} - -, { - "Beijing", "China", "GMT+8", "Asia/Shanghai" -} - -, { - "Beirut", "Lebanon", "GMT+2", "Asia/Beirut" -} - -, { - "Belgrade", "Serbia", "GMT+1", "Europe/Belgrade" -} - -, { - "Belize City", "Belize", "GMT-6", "America/Belize" -} - -, { - "Berlin", "Germany", "GMT+1", "Europe/Berlin" -} - -, { - "Bern", "Switzerland", "GMT+1", "Europe/Zurich" -} - -, { - "Bishkek", "Kyrgyzstan", "GMT+6", "Asia/Bishkek" -} - -, { - "Bissau", "Guinea Bissau", "GMT+0", "Africa/Bissau" -} - -, { - "Bogota", "Colombia", "GMT-5", "America/Bogota" -} - -, { - "Bologna", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Boston", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Brasilia", "Brazil", "GMT-3", "America/Sao_Paulo" -} - -, { - "Bratislava", "Slovakia", "GMT+2", "Europe/Bratislava" -} - -, { - "Bridgetown", "Barbados", "GMT-4", "America/Barbados" -} - -, { - "Brisbane", "Australia", "GMT+10", "Australia/Brisbane" -} - -, { - "Brussels", "Belgium", "GMT+1", "Europe/Brussels" -} - -, { - "Bucharest", "Romania", "GMT+3", "Europe/Bucharest" -} - -, { - "Budapest", "Hungary", "GMT+1", "Europe/Budapest" -} - -, { - "Buenos Aires", "Argentina", "GMT-3", "America/Argentina/Buenos_Aires" -} - -, { - "Cairo", "Egypt", "GMT+2", "Africa/Cairo" -} - -, { - "Calgary", "Canada", "GMT-7", "MST7MDT" -} - -, { - "Canary Islands", "Spain", "GMT+0", "Atlantic/Canary" -} - -, { - "Canberra", "Australia", "GMT+10", "Australia/Canberra" -} - -, { - "Canton", "China", "GMT+8", "Asia/Shanghai" -} - -, { - "Cape Town", "Republic of South Africa", "GMT+2", "Africa/Johannesburg" -} - -, { - "Caracas", "Venezuela", "GMT-4:30", "America/Caracas" -} - -, { - "Cardiff", "Wales", "GMT+0", "Europe/London" -} - -, { - "Casablanca", "Morocco", "GMT+0", "Africa/Casablanca" -} - -, { - "Catanzaro", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Cayenne", "French Guiana", "GMT-3", "America/Cayenne" -} - -, { - "Charlotte", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Charlotte Amalie", "United States Virgin Islands ", "GMT-5:30", - "America/St_Thomas" -} -, { - "Chelyabinsk", "Russia", "GMT+6", "Asia/Yekaterinburg" -} - -, { - "Chennai", "India", "GMT+5:30", "Asia/Kolkata" -} - -, { - "Chicago", "United States of America", "GMT-6", "America/Chicago" -} - -, { - "Chisinau", "Moldova", "GMT+2", "Europe/Chisinau" -} - -, { - "Chita", "Russia", "GMT+10", "Asia/Yakutsk" -} - -, { - "Cleveland", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Colombo", "Sri Lanka", "GMT+5:30", "Asia/Colombo" -} - -, { - "Columbus", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Conakry", "Guinea", "GMT+1", "Africa/Conakry" -} - -, { - "Copenhagen", "Denmark", "GMT+1", "Europe/Copenhagen" -} - -, { - "Cork", "Ireland", "GMT+0", "Europe/Dublin" -} - -, { - "Crotone", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Dakar", "Senegal", "GMT+0", "Africa/Dakar" -} - -, { - "Dallas", "United States of America", "GMT-6", "CST6CDT" -} - -, { - "Damascus", "Syria", "GMT+2", "Asia/Damascus" -} - -, { - "Dar es Salaam", "Tanzania", "GMT+3", "Africa/Dar_es_Salaam" -} - -, { - "Darwin", "Australia", "GMT+9:30", "Australia/Darwin" -} - -, { - "Delhi", "India", "GMT+5:30", "Asia/Kolkata" -} - -, { - "Denpasar", "Indonesia", "GMT+8", "Asia/Makassar" -} - -, { - "Denver", "United States of America", "GMT-7", "America/Denver" -} - -, { - "Detroit", "United States of America", "GMT-5", "America/Detroit" -} - -, { - "Dhaka", "Bangladesh", "GMT+6", "Asia/Dhaka" -} - -, { - "Diego Garcia", "United Kingdom", "GMT+5", "Indian/Chagos" /* not in zone.tab */ -} - -, { - "Djibouti", "Djibouti", "GMT+3", "Africa/Djibouti" -} - -, { - "Doha", "Qatar", "GMT+3", "Asia/Qatar" -} - -, { - "Douala", "Cameroon", "GMT+1", "Africa/Douala" -} - -, { - "Dubai", "United Arab Emirates", "GMT+4", "Asia/Dubai" -} - -, { - "Dublin", "Ireland", "GMT+0", "Europe/Dublin" -} - -, { - "Dushanbe", "Tajikistan", "GMT+5", "Asia/Dushanbe" -} - -, { - "Easter Island", "Chile", "GMT-6", "Pacific/Easter" -} - -, { - "Edinburgh", "Scotland", "GMT+0", "Europe/London" -} - -, { - "El Paso", "United States of America", "GMT-7", "MST7MDT" -} - -, { - "Florence", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Fort-de-France", "Martinique", "GMT-4", "America/Martinique" -} - -, { - "Freetown", "Sierra Leone", "GMT+0", "Africa/Freetown" -} - -, { - "Gaborone", "Botswana", "GMT+2", "Africa/Gaborone" -} - -, { - "Galapagos Islands", "Ecuador", "GMT-7", "Pacific/Galapagos" -} - -, { - "Geneva", "Switzerland", "GMT+1", "Europe/Paris" -} - -, { - "Genoa", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Georgetown", "Guyana", "GMT-4", "America/Guyana" -} - -, { - "Grytviken", "South Georgia", "GMT-2", "Atlantic/South_Georgia" -} - -, { - "Guam", "United States of America", "GMT+10", "Pacific/Guam" -} - -, { - "Guatemala City", "Guatemala", "GMT-6", "America/Guatemala" -} - -, { - "Gustavia", "Saint Barthelemy", "GMT-4", "America/Antigua" -} - -, { - "Halifax", "Canada", "GMT-4", "America/Halifax" -} - -, { - "Hamburg", "Germany", "GMT+1", "Europe/Berlin" -} - -, { - "Hanoi", "Vietnam", "GMT+7", "Asia/Ho_Chi_Minh" -} - -, { - "Harare", "Zimbabwe", "GMT+2", "Africa/Harare" -} - -, { - "Havana", "Cuba", "GMT-5", "America/Havana" -} - -, { - "Hawaii", "United States of America", "GMT-10", "Pacific/Honolulu" -} - -, { - "Helsinki", "Finland", "GMT+2", "Europe/Helsinki" -} - -, { - "Hobart", "Australia", "GMT+10", "Australia/Hobart" -} - -, { - "Hong Kong", "China", "GMT+8", "Asia/Hong_Kong" -} - -, { - "Honolulu", "United States of America", "GMT-10", "Pacific/Honolulu" -} - -, { - "Houston", "United States of America", "GMT-6", "CST6CDT" -} - -, { - "Hovd", "Mongolia", "GMT+8", "Asia/Hovd" -} - -, { - "Indianapolis", "United States of America", "GMT-5", - "America/Indiana/Indianapolis" -} -, { - "Irkutsk", "Russia", "GMT+9", "Asia/Irkutsk" -} - -, { - "Islamabad", "Pakistan", "GMT+5", "Asia/Karachi" -} - -, { - "Istanbul", "Turkey", "GMT+2", "Europe/Istanbul" -} - -, { - "Izhevsk", "Russia", "GMT+4", "Europe/Moscow" -} - -, { - "Jakarta", "Indonesia", "GMT+7", "Asia/Jakarta" -} - -, { - "Jeddah", "Saudi Arabia", "GMT+3", "Asia/Riyadh" -} - -, { - "Jerusalem", "Israel", "GMT+2", "Asia/Jerusalem" -} - -, { - "Johannesburg", "South Africa", "GMT+2", "Africa/Johannesburg" -} - -, { - "Kabul", "Afghanistan", "GMT+4:30", "Asia/Kabul" -} - -, { - "Kaliningrad", "Russia", "GMT+3", "Europe/Kaliningrad" -} - -, { - "Kamchatka", "Russia", "GMT+12", "Asia/Kamchatka" -} - -, { - "Kampala", "Uganda", "GMT+3", "Africa/Kampala" -} - -, { - "Karachi", "Pakistan", "GMT+5", "Asia/Karachi" -} - -, { - "Kathmandu", "Nepal", "GMT+5:45", "Asia/Kathmandu" -} - -, { - "Khabarovsk", "Russia", "GMT+11", "Asia/Vladivostok" -} - -, { - "Kharkiv", "Ukraine", "GMT+2", "Europe/Kiev" -} - -, { - "Khartoum", "Sudan", "GMT+3", "Africa/Khartoum" -} - -, { - "Kiev", "Ukraine", "GMT+2", "Europe/Kiev" -} - -, { - "Kingston", "Canada", "GMT-5", "America/Toronto" -} - -, /* not in zone.tab */ -{ - "Kingston", "Jamaica", "GMT-5", "America/Jamaica" -} - -, { - "Kinshasa", "Democratic Republic of the Congo", "GMT+1", "Africa/Kinshasa" -} - -, { - "Kolkata", "India", "GMT+5:30", "Asia/Kolkata" -} - -, { - "Krasnoyarsk", "Russia", "GMT+8", "Asia/Krasnoyarsk" -} - -, { - "Kuala Lumpur", "Malaysia", "GMT+8", "Asia/Kuala_Lumpur" -} - -, { - "Kuwait", "Kuwait", "GMT+3", "Asia/Kuwait" -} - -, { - "Kyiv", "Ukraine", "GMT+2", "Europe/Kiev" /* not in zone.tab */ -} - -, { - "Los Angeles", "United States of America", "GMT-7", "America/Los_Angeles" -} - -, { - "La Paz", "Bolivia", "GMT-4", "America/La_Paz" -} - -, { - "Lagos", "Nigeria", "GMT+1", "Africa/Lagos" -} - -, { - "Las Vegas", "United States of America", "GMT-8", "PST8PDT" -} - -, { - "Lima", "Peru", "GMT-5", "America/Lima" -} - -, { - "Lisbon", "Portugal", "GMT+0", "Europe/Lisbon" -} - -, { - "Ljubljana", "Slovakia", "GMT+1", "Europe/Ljubljana" -} - -, { - "London", "United Kingdom", "GMT+0", "Europe/London" -} - -, { - "Atlanta", "United States of America", "GMT-5", "America/Georgia/Atlanta" -} - -, { - "Louisville", "United States of America", "GMT-5", "America/Kentucky/Louisville" -} - -, { - "Luanda", "Angola", "GMT+1", "Africa/Luanda" -} - -, { - "Lubumbashi", "Democratic Republic of the Congo", "GMT+2", "Africa/Lubumbashi" -} - -, { - "Lusaka", "Zambia", "GMT+2", "Africa/Lusaka" -} - -, { - "Luxembourg", "Luxembourg", "GMT+1", "Europe/Luxembourg" -} - -, { - "Lviv", "Ukraine", "GMT+2", "Europe/Kiev" -} - -, { - "Macau", "China", "GMT+8", "Asia/Macau" -} - -, { - "Madrid", "Spain", "GMT+2", "Europe/Madrid" -} - -, { - "Magadan", "Russia", "GMT+12", "Asia/Magadan" -} - -, { - "Malabo", "Equaorial Guinea", "GMT+1", "Africa/Malabo" -} - -, { - "Male", "Maldives", "GMT+5", "Indian/Maldives" -} - -, { - "Managua", "Nicaragua", "GMT-6", "America/Managua" -} - -, { - "Manama", "Bahrain", "GMT+3", "Asia/Bahrain" -} - -, { - "Manila", "Philippines", "GMT+8", "Asia/Manila" -} - -, { - "Maputo", "Mozambique", "GMT+2", "Africa/Maputo" -} - -, { - "Marigot", "Saint Martin", "GMT-4", "America/Marigot" -} - -, { - "Mazatlan", "Mexico", "GMT-7", "America/Mazatlan" -} - -, { - "Mecca", "Saudi Arabia", "GMT+3", "Asia/Riyadh" -} - -, { - "Melbourne", "Australia", "GMT+10", "Australia/Melbourne" -} - -, { - "Memphis", "United States of America", "GMT-6", "CST6CDT" -} - -, { - "Messina", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Mexico City", "Mexico", "GMT-6", "America/Mexico_City" -} - -, { - "Miami", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Mid-Atlantic", "United States of America", "GMT-2", "America/New_York" /* not in zone.tab */ -} - -, { - "Midway Atoll", "United States of America", "GMT-11", "Pacific/Midway" -} - -, { - "Milan", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Milwaukee", "United States of America", "GMT-6", "CST6CDT" -} - -, { - "Minsk", "Belarus", "GMT+2", "Europe/Minsk" -} - -, { - "Mogadishu", "Somalia", "GMT+2", "Africa/Mogadishu" -} - -, { - "Monrovia", "Liberia", "GMT+0", "Africa/Monrovia" -} - -, { - "Montevideo", "Uruguay", "GMT-3", "America/Montevideo" -} - -, { - "Montreal", "Canada", "GMT-5", "America/Montreal" -} - -, { - "Moscow", "Russia", "GMT+4", "Europe/Moscow" -} - -, { - "Mumbai", "India", "GMT+5:30", "Asia/Kolkata" -} - -, { - "Munich", "Germany", "GMT+1", "Europe/Berlin" -} - -, { - "Muscat", "Oman", "GMT+4", "Asia/Muscat" -} - -, { - "Nairobi", "Kenya", "GMT+3", "Africa/Nairobi" -} - -, { - "Naples", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Naters", "Switzerland", "GMT+1", "Europe/Zurich" -} - -, { - "Ndjamena", "Chad", "GMT+1", "Africa/Ndjamena" -} - -, { - "New Delhi", "India", "GMT+5:30", "Asia/Kolkata" /* not in zone.tab */ -} - -, { - "New York", "United States of America", "GMT-4", "America/New_York" -} - -, { - "Newfoundland", "Canada", "GMT-3:30", "America/St_Johns" -} - -, { - "Niamey", "Niger", "GMT+1", "Africa/Niamey" -} - -, { - "Nouakchott", "Mauritania", "GMT+1", "Africa/Nouakchott" -} - -, { - "Noumea", "New Caledonia", "GMT+11", "Pacific/Noumea" -} - -, { - "Novokuznetsk", "Russia", "GMT+7", "Asia/Novokuznetsk" -} - -, /* not clear */ -{ - "Novosibirsk", "Russia", "GMT+7", "Asia/Novosibirsk" -} - -, { - "Nuku'alofa", "Tonga", "GMT+13", "Pacific/Tongatapu" -} - -, { - "Nuuk", "Greenland", "GMT-3", "America/Godthab" -} - -, { - "Omsk", "Russia", "GMT+7", "Asia/Omsk" -} - -, { - "Osaka", "Japan", "GMT+9", "Asia/Tokyo" -} - -, { - "Ottawa", "Canada", "GMT-5", "EST5EDT" -} - -, { - "Ouagadougou", "Burkina Faso", "GMT+0", "Africa/Ouagadougou" -} - -, { - "Pago Pago", "Independent State of Samoa", "GMT-11", "Pacific/Pago_Pago" -} - -, { - "Palermo", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Panama City", "Panama", "GMT-6", "America/Panama" -} - -, { - "Paramaribo", "Surinam", "GMT-3", "America/Paramaribo" -} - -, { - "Paris", "France", "GMT+1", "Europe/Paris" -} - -, { - "Perm", "Russia", "GMT+6", "Asia/Yekaterinburg" -} - -, { - "Perth", "Australia", "GMT+8", "Australia/Perth" -} - -, { - "Petropavlovsk-Kamchatskiy", "Russia", "GMT+12", "Asia/Kamchatka" -} - -, { - "Philadelphia", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Phnom Penh ", "Cambodia", "GMT-5", "Asia/Phnom_Penh" -} - -, { - "Phoenix", "United States of America", "GMT-7", "America/Phoenix" -} - -, { - "Podgorica", "Montenegro", "GMT+1", "Europe/Podgorica" -} - -, { - "Ponta Delgada", "Portugal", "GMT-1", "Atlantic/Azores" -} - -, { - "Port Louis", "Mauritius", "GMT+4", "Indian/Mauritius" -} - -, { - "Port-au-Prince", "Haiti", "GMT-5", "America/Port-au-Prince" -} - -, { - "Portland", "United States of America", "GMT-8", "PST8PDT" -} - -, { - "Prague", "Czech Republic", "GMT+1", "Europe/Prague" -} - -, { - "Pyongyang", "North Korea", "GMT+9", "Asia/Pyongyang" -} - -, { - "Quito", "Ecuador", "GMT-5", "America/Guayaquil" -} - -, { - "Rabat", "Morocco", "GMT+0", "Africa/Casablanca" -} - -, { - "Rangoon", "Burma", "GMT+6:30", "Asia/Rangoon" -} - -, { - "Recife", "Brazil", "GMT-3", "America/Recife" -} - -, { - "Regina", "Canada", "GMT-6", "America/Regina" -} - -, { - "Reykjavik", "Iceland", "GMT+0", "Atlantic/Reykjavik" -} - -, { - "Riga", "Latvia", "GMT+2", "Europe/Riga" -} - -, { - "Rio de Janeiro", "Brazil", "GMT-2", "America/Sao_Paulo" -} - -, { - "Riyadh", "Saudi Arabia", "GMT+3", "Asia/Riyadh" -} - -, { - "Rome", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Saint-Denis", "Reunion Island", "GMT+4", "Indian/Reunion" -} - -, { - "Samara", "Russia", "GMT+4", "Europe/Samara" -} - -, /* not clear */ -{ - "San Antonio", "United States of America", "GMT-6", "CST6CDT" -} - -, { - "San Diego", "United States of America", "GMT-8", "PST8PDT" -} - -, { - "San Francisco", "United States of America", "GMT-8", "America/Los_Angeles" -} - -, { - "San Jose", "United States of America", "GMT-8", "PST8PDT" -} - -, { - "San Jose", "Costa Rica", "GMT-6", "America/Costa_Rica" -} - -, { - "San Juan", "Puerto Rico", "GMT-4", "America/Puerto_Rico" -} - -, { - "San Marino", "Italy", "GMT+1", "Europe/San_Marino" -} - -, { - "San Salvador", "El Salvador", "GMT-6", "America/El_Salvador" -} - -, { - "Sanaa", "Yemen", "GMT+3", "Asia/Aden" /* not in zone.tab */ -} - -, { - "Santiago", "Chile", "GMT-4", "America/Santiago" -} - -, { - "Santo Domingo", "Dominican Republic", "GMT-4", "America/Santo_Domingo" -} - -, { - "Sao Paulo", "Brazil", "GMT-2", "America/Sao_Paulo" -} - -, { - "Seattle", "United States of America", "GMT-8", "PST8PDT" -} - -, { - "Seoul", "Republic of Korea", "GMT+9", "Asia/Seoul" -} - -, { - "Shanghai", "China", "GMT+8", "Asia/Shanghai" -} - -, { - "Shenzhen", "China", "GMT+8", "Asia/Shanghai" -} - -, { - "Singapore", "Republic of Singapore", "GMT+8", "Asia/Singapore" -} - -, { - "Skopje", "Macedonia", "GMT+1", "Europe/Skopje" -} - -, { - "Sofia ", "Bulgaria", "GMT+3", "Europe/Sofia" -} - -, { - "St. John's", "Antigua and Barbuda", "GMT-4", "America/Antigua" -} - -, { - "St. John's", "Canada", "GMT-3:30", "America/St_Johns" -} - -, { - "St. Petersburg", "Russia", "GMT+4", "Europe/Moscow" -} - -, { - "Stockholm", "Sweden", "GMT+2", "Europe/Stockholm" -} - -, { - "Suva", "Fiji", "GMT+12", "Pacific/Fiji" -} - -, { - "Sydney", "Australia", "GMT+11", "Australia/Sydney" -} - -, { - "Tahiti", "French Polynesia", "GMT-10", "Pacific/Tahiti" -} - -, { - "Taipei", "Taiwan", "GMT+8", "Asia/Taipei" -} - -, { - "Tallinn", "Estonia", "GMT+2", "Europe/Tallinn" -} - -, { - "Tarawa", "Kiribati", "GMT+12", "Pacific/Tarawa" -} - -, { - "Tashkent", "Uzbekistan", "GMT+5", "Asia/Tashkent" -} - -, { - "Tbilisi", "Georgia", "GMT+4", "Asia/Tbilisi" -} - -, { - "Tegucigalpa", "Honduras", "GMT-6", "America/Tegucigalpa" -} - -, { - "Tehran", "Iran", "GMT+3:30", "Asia/Tehran" -} - -, { - "Thanh Pho Ho Chi Minh", "Vietnam", "GMT+7", "Asia/Ho_Chi_Minh" -} - -, { - "The Settlement", "British Virgin Islands ", "GMT-4", "America/Tortola" -} - -, { - "Tientsin", "China", "GMT+8", "Asia/Shanghai" /* not in zone.tab */ -} - -, { - "Tijuana", "Mexico", "GMT-5", "America/Tijuana" -} - -, { - "Tokyo", "Japan", "GMT+9", "Asia/Tokyo" -} - -, { - "Toronto", "Canada", "GMT-4", "America/Toronto" -} - -, { - "Trehet", "France", "GMT+1", "Europe/Paris" /* not in zone.tab */ -} - -, { - "Tripoli", "Libya", "GMT+2", "Africa/Tripoli" -} - -, { - "Tunis", "Tunisia", "GMT+2", "Africa/Tunis" -} - -, { - "Turin", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Ufa", "Bashkiriya", "GMT+5", "Asia/Yekaterinburg" -} - -, { - "Ulan Bator", "Mongolia", "GMT+8", "Asia/Ulan_Bator" -} - -, { - "Vaduz", "Liechtenstein", "GMT+1", "Europe/Vaduz" -} - -, { - "Valletta", "Malta", "GMT+1", "Europe/Malta" -} - -, { - "Vancouver", "Canada", "GMT-8", "America/Vancouver" -} - -, { - "Verona", "Italy", "GMT+1", "Europe/Rome" -} - -, { - "Victoria", "Seychelles", "GMT+4", "Australia/Melbourne" -} - -, { - "Vienna", "Austria", "GMT+1", "Europe/Vienna" -} - -, { - "Vilnius", "Lithuania", "GMT+3", "Europe/Vilnius" -} - -, { - "Vladivostok", "Russia", "GMT+11", "Asia/Vladivostok" -} - -, { - "Volgograd", "Russia", "GMT+4", "Europe/Volgograd" -} - -, /* not clear */ -{ - "Warsaw", "Poland", "GMT+2", "Europe/Warsaw" -} - -, { - "Washington, D.C.", "United States of America", "GMT-5", "EST5EDT" -} - -, { - "Wellington", "New Zealand", "GMT+12", "Pacific/Auckland" -} - -, { - "Winnipeg", "Canada", "GMT-5", "America/Winnipeg" -} - -, { - "Yakutsk", "Russia", "GMT+10", "Asia/Yakutsk" -} - -, { - "Yamoussoukro", "Ivory Coast", "GMT+0", "Africa/Abidjan" -} - -, { - "Yaounde", "Cameroon", "GMT+1", "Africa/Douala" /* not in zone.tab */ -} - -, { - "Yekaterinburg", "Russia", "GMT+6", "Asia/Yekaterinburg" -} - -, { - "Yerevan", "Armenia", "GMT+5", "Asia/Yerevan" -} - -, { - "Yuzhno-Sakhalinsk", "Russia", "GMT+11", "Asia/Sakhalin" -} - -, { - "Zagreb", "Croatia", "GMT+1", "Europe/Zagreb" -} - -, { - "Zurich", "Switzerland", "GMT+1", "Europe/Zurich" -} - -, { - "Hyderabad", "India", "GMT+5:30", "Asia/Andhra/Hyderabad" -} - -, { - "Bangalore", "India", "GMT+5:30", "Asia/Karnataka/Bangalore" -} - -, { - NULL, NULL, NULL, NULL -} - -, diff --git a/include/worldclock_types.h b/include/worldclock_types.h deleted file mode 100644 index 3b541da..0000000 --- a/include/worldclock_types.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_TYPES_H__ -#define __DEF_WORLDCLOCK_TYPES_H__ - -#include -#include "worldclock_const.h" - -typedef void (*Wcl_Return_Cb) (void *, Eina_Bool); - -typedef enum { - WCL_CALLER_IS_APP_IT_SELF = 0, - WCL_CALLER_IS_SHARED_LIBRARY, - WCL_CALLER_IS_UI_GADGET, - WCL_CALLER_IS_LIVEBOX, - WCL_CALLER_IS_UNKNOW, -} Wcl_Caller; - -#ifdef FEATURE_SORT_ORDER -typedef enum { - WCL_SORT_BY_NAME = 1, - WCL_SORT_BY_TIMEZONE, - - WCL_UNKNOW_SORT_TYPE, -} Wcl_Addlist_Sort_Type; -#endif - -typedef enum { - WCL_SELECT_IN_UNSELECTED = 0, - WCL_SELECT_IN_ALL, - WCL_SELECT_IF_HAS_TZPATH, - - WCL_SELECTION_UNKNOW_FLAG, -} Wcl_Selection_Flag; - -typedef enum { - WCL_SEARCH_BY_ALL_KEYWORDS = 0, - WCL_SEARCH_BY_CITY_NAME, - WCL_SEARCH_BY_COUNTRY_NAME, - WCL_SEARCH_BY_TIMEZONE, - - WCL_UNKNOWN_SEARCH_TYPE, -} Wcl_Search_Type; - -typedef enum { - WCL_DST_OFF = -1, - WCL_DST_AUTO = 0, - WCL_DST_1_HOUR, - WCL_DST_2_HOURS, - - WCL_DST_TYPES_COUNT, - - WCL_DST_UNKNOWN_TYPE, -} Wcl_DST_Type; - -typedef struct _cs { /* city set */ - int index; /* record index in db */ - char city[CITY_BUF_SIZE]; /* city name */ - char country[COUNTRY_BUF_SIZE]; /* country name */ - char timezone[TIMEZONE_BUF_SIZE]; /* timezone */ - int dst_type; /* dst type */ - int dst_enabled; /* dst disable flag */ - int selected; /* selected or not */ - int sequence; /* sequence number in mainlist */ - char tz_path[TZPATH_BUF_SIZE]; /* TZ path of city */ - - int dst; /* dst value */ - volatile time_t now_time; /* the current time of city */ - - char flag[COUNTRY_BUF_SIZE]; /* flag image name */ - char mcc[MCC_BUF_SIZE]; -} Wcl_CitySet; - -#endif // __DEF_WORLDCLOCK_TYPES_H__ diff --git a/include/worldclock_util.h b/include/worldclock_util.h deleted file mode 100644 index 4feba25..0000000 --- a/include/worldclock_util.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __DEF_WORLDCLOCK_UTIL_H_ -#define __DEF_WORLDCLOCK_UTIL_H_ - -#include -#include -#include -#include "worldclock.h" - -/** - * Compare the city name of two cities - * - * @param[in] data1 record data of city1 - * @param[in] data2 record data of city2 - * - * @return -1 if city name of city2 is bigger than city1's - * 1 if city name of city1 is bigger than city2's - * 0 if city name of city2 is equal to city1, or meet error - */ -int worldclock_city_compare_cb(const void *data1, const void *data2); - -/** - * Compare timezone of two cities - * - * @param[in] data1 recorder of city1 - * @param[in] data2 recorder of city2 - * - * @return -1 if timezone of city2 is bigger than city1's - * 1 if timezone of city1 is bigger than city2's - * 0 if timezone of city2 is equal to city1, or meet error - */ -int worldclock_time_compare_cb(const void *data1, const void *data2); - -/** - * Remove all items in eina_list - * - * @param[in] glist given eina list - * @param[in] is_free_element flag to define if free data in every item is needed - * - * @return EINA_TRUE if remove successfully - */ -Eina_Bool worldclock_util_glist_remove_all(Eina_List * glist, Eina_Bool is_free_element); -#if 0 -/** - * Creat new popup window, and show it - * - * @param[in] parent Parent for such popup - * @param[in] data Data used in this function - * @param[in] info String displayed on popup - * - * @return - */ -void worldclock_show_popup(Evas_Object * parent, Evas_Object ** p_popup, char *info); -#endif - -/** - * Create layout by load edj according group name from edj file - * - * @param[in] parent Parent of new layout - * @param[in] file EDJE file - * @param[in] group name of group - * - * @return NULL if meet error - * Pointer to new layout - */ -Evas_Object *worldclock_load_edj(Evas_Object * parent, const char *file, - const char *group); - -int worldclock_dst_get(const Wcl_CitySet * cs); - -#endif /* __DEF_WORLDCLOCK_UTIL_H_ */ diff --git a/libug-worldclock-efl.manifest b/libug-worldclock-efl.manifest index 3d20ec3..c00c25b 100644 --- a/libug-worldclock-efl.manifest +++ b/libug-worldclock-efl.manifest @@ -1,8 +1,4 @@ - - - - diff --git a/packaging/libug-worldclock-efl.spec b/packaging/libug-worldclock-efl.spec index 239fd0c..bb7ed95 100644 --- a/packaging/libug-worldclock-efl.spec +++ b/packaging/libug-worldclock-efl.spec @@ -41,42 +41,24 @@ This is UI gadget for configuration time zone of device %setup -q %build -%define PREFIX "%{TZ_SYS_RO_UG}" +%define PREFIX "%{TZ_SYS_RO_APP}/%{name}" #TODO: Use macros TZ_USER_DATA when it will work cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX} \ - -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \ - -DTZ_SYS_DATA=%{TZ_SYS_DATA} \ - -DTZ_USER_DATA=/opt/usr/data \ - -DTZ_SYS_DB=%{TZ_SYS_DB} + -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} make %{?jobs:-j%jobs} %install rm -rf %{buildroot} %make_install -mkdir -p %{buildroot}/opt/usr/data/clock -%post -/sbin/ldconfig - -mkdir -p %{TZ_SYS_RO_UG}/bin/ -ln -sf /usr/bin/ug-client %{TZ_SYS_RO_UG}/bin/worldclock-efl - -%postun -p /sbin/ldconfig %files %manifest libug-worldclock-efl.manifest %defattr(-,root,root,-) -%{TZ_SYS_RO_UG}/lib/libug-worldclock-efl.so -%{TZ_SYS_RO_UG}/res/edje/ug-worldclock-efl/ug_worldclock.edj -%{TZ_SYS_RO_UG}/res/locale/*/LC_MESSAGES/ug-worldclock-efl.mo -%{TZ_SYS_RO_UG}/res/images/ug-worldclock-efl/* +%{TZ_SYS_RO_APP}/%{name}/* +%{TZ_SYS_RO_PACKAGES}/* %license LICENSE -%{TZ_SYS_RO_PACKAGES}/worldclock-efl.xml -%{TZ_SYS_DATA}/setting/tzlist.ini -%{TZ_SYS_DB}/.worldclock.db -%{TZ_SYS_DB}/.worldclock.db-journal -#TODO: Use macros TZ_USER_DATA when it will work -/opt/usr/data/clock/tzlist.ini + diff --git a/project_def.prop b/project_def.prop new file mode 100644 index 0000000..9eeeca3 --- /dev/null +++ b/project_def.prop @@ -0,0 +1,11 @@ +APPNAME = libug-worldclock-efl + +type = app +profile = mobile-3.0 + +USER_SRCS = src/ug_worldclock_efl.c +USER_DEFS = +USER_INC_DIRS = inc +USER_OBJS = +USER_LIBS = +USER_EDCS = diff --git a/res/edc/worldclock.edc b/res/edc/worldclock.edc deleted file mode 100644 index ccdf760..0000000 --- a/res/edc/worldclock.edc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -collections { - base_scale: 2.4; - - #include "worldclock_add.edc" -} - diff --git a/res/edc/worldclock_add.edc b/res/edc/worldclock_add.edc deleted file mode 100644 index e89fb14..0000000 --- a/res/edc/worldclock_add.edc +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// size -#define ICON_SIZE 80 -#define INPUT_ELEMENTS_HEIGHT 120 -#define PADDING_WIDTH 17 - -// color - -#define COLOR_ADDVIEW_SEARCHBAR_BG 249 249 249 255 -#define COLOR_LOCATION_ICON_NORMAL 20 107 147 127 -#define COLOR_LOCATION_ICON_PRESSED 31 92 102 255 -#define COLOR_LOCATION_ICON_DISABLE 195 195 195 127 - -group { - name: "ug_add_layout"; - parts { - /* background */ - part { - name: "add/bg"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - color: 255 255 255 0; - } - } - /* genlist swallow */ - part { - name: "add/genlist"; - type: SWALLOW; - mouse_events: 1; - scale: 1; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0;} - rel2 { relative: 1.0 1.0;} - } - } - - } // end of parts -} - -group { - name: "searchbar_base"; - parts { - part { name: "elm.swallow.bg"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - } - } - part { name: "searchbar"; - type: SWALLOW; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - align: 0.5 0.0; - rel2 { - relative: 1.0 0.0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - align: 0.0 0.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1 { - relative: 0.0 1.0; - to: "searchbar"; - } - } - } - } - programs { - program { name: "show_searchbar"; - signal: "elm,state,show,searchbar"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "searchbar"; - } - program { name: "show_searchbar_with_animation"; - signal: "elm,state,show,searchbar,animation"; - source: "elm"; - action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.3; - target: "searchbar"; - } - program { name: "hide_searchbar"; - signal: "elm,state,hide,searchbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "searchbar"; - } - program { name: "hide_searchbar_with_animation"; - signal: "elm,state,hide,searchbar,animation"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: ACCELERATE 0.3; - target: "searchbar"; - } - } -} - -group { - name: "location_icon"; - images.image: "clock_world_ic_location.png" COMP; - parts { - part { name: "image"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - image.normal: "clock_world_ic_location.png"; - min: ICON_SIZE ICON_SIZE; - aspect: 1 1; - aspect_preference: BOTH; - color: COLOR_LOCATION_ICON_NORMAL; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - color: COLOR_LOCATION_ICON_PRESSED; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: COLOR_LOCATION_ICON_DISABLE; - } - } - } - programs { - program { name: "disable_location_btn"; - signal: "location_btn.disable"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "image"; - } - - program { name: "press_location_btn"; - signal: "location_btn.press"; - source: "elm"; - action: STATE_SET "pressed" 0.0; - target: "image"; - } - - program { name: "unpress_location_btn"; - signal: "location_btn.unpress"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "image"; - } - } -} - -group { - name: "editfield_layout"; - parts { - part { - name: "bg"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 INPUT_ELEMENTS_HEIGHT; - color: COLOR_ADDVIEW_SEARCHBAR_BG; - } - } - part { - name: "entry_part"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 0.0; to: "bg"; - } - rel2 { - relative: 0.0 1.0; to_x: "location_sw"; - } - } - } - part { - name: "location_sw"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - max: ICON_SIZE ICON_SIZE; - min: ICON_SIZE ICON_SIZE; - fixed: 1 1; - align: 1.0 0.5; - rel1 { - relative: 0.0 0.0; to: "elm.padding.icon"; - } - rel2 { - relative: 0.0 1.0; to: "elm.padding.icon"; - } - } - } - part { - name: "elm.padding.icon"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - min: PADDING_WIDTH 0; - max: PADDING_WIDTH -1; - fixed: 1 0; - align: 1.0 0.5; - rel1 { - relative: 1.0 0.0; to: "bg"; - } - rel2 { - relative: 1.0 1.0; to: "bg"; - } - } - } - } -} diff --git a/res/edje/worldclock.edc b/res/edje/worldclock.edc new file mode 100644 index 0000000..cc06ff4 --- /dev/null +++ b/res/edje/worldclock.edc @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include "worldclock_add.edc" +collections { + base_scale: 2.6; + + +} + diff --git a/res/edje/worldclock_add.edc b/res/edje/worldclock_add.edc new file mode 100644 index 0000000..2b5b3de --- /dev/null +++ b/res/edje/worldclock_add.edc @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#define ICON_SIZE 80 +#define INPUT_ELEMENTS_HEIGHT 120 +#define PADDING_WIDTH 17 + +#define COLOR_ADDVIEW_SEARCHBAR_BG 249 249 249 255 +#define COLOR_LOCATION_ICON_NORMAL 20 107 147 127 +#define COLOR_LOCATION_ICON_PRESSED 31 92 102 255 +#define COLOR_LOCATION_ICON_DISABLE 195 195 195 127 + +collections { + + base_scale: 2.6; + +group { + name: "ug_add_layout"; + parts { + part { + name: "add/bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 0; + } + } + part { + name: "add/genlist"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + + } +} + +group { + name: "searchbar_base"; + parts { + part { name: "elm.swallow.bg"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + } + } + part { name: "searchbar"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + align: 0.5 0.0; + rel2 { + relative: 1.0 0.0; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + align: 0.0 0.0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + rel1 { + relative: 0.0 1.0; + to: "searchbar"; + } + } + } + } + programs { + program { name: "show_searchbar"; + signal: "elm,state,show,searchbar"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "searchbar"; + } + program { name: "show_searchbar_with_animation"; + signal: "elm,state,show,searchbar,animation"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: DECELERATE 0.3; + target: "searchbar"; + } + program { name: "hide_searchbar"; + signal: "elm,state,hide,searchbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "searchbar"; + } + program { name: "hide_searchbar_with_animation"; + signal: "elm,state,hide,searchbar,animation"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: ACCELERATE 0.3; + target: "searchbar"; + } + } +} + +group { + name: "location_icon"; + images.image: "clock_world_ic_location.png" COMP; + parts { + part { name: "image"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + image.normal: "clock_world_ic_location.png"; + min: ICON_SIZE ICON_SIZE; + aspect: 1 1; + aspect_preference: BOTH; + color: COLOR_LOCATION_ICON_NORMAL; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color: COLOR_LOCATION_ICON_PRESSED; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: COLOR_LOCATION_ICON_DISABLE; + } + } + } + programs { + program { name: "disable_location_btn"; + signal: "location_btn.disable"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "image"; + } + + program { name: "press_location_btn"; + signal: "location_btn.press"; + source: "elm"; + action: STATE_SET "pressed" 0.0; + target: "image"; + } + + program { name: "unpress_location_btn"; + signal: "location_btn.unpress"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "image"; + } + } +} + +group { + name: "editfield_layout"; + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: 0 INPUT_ELEMENTS_HEIGHT; + color: COLOR_ADDVIEW_SEARCHBAR_BG; + } + } + part { + name: "entry_part"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 0.0; to: "bg"; + } + rel2 { + relative: 0.0 1.0; to_x: "location_sw"; + } + } + } + part { + name: "location_sw"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + max: ICON_SIZE ICON_SIZE; + min: ICON_SIZE ICON_SIZE; + fixed: 1 1; + align: 1.0 0.5; + rel1 { + relative: 0.0 0.0; to: "elm.padding.icon"; + } + rel2 { + relative: 0.0 1.0; to: "elm.padding.icon"; + } + } + } + part { + name: "elm.padding.icon"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: PADDING_WIDTH 0; + max: PADDING_WIDTH -1; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; to: "bg"; + } + rel2 { + relative: 1.0 1.0; to: "bg"; + } + } + } + } +} + +} diff --git a/res/images/clock_world_ic_location.png b/res/images/clock_world_ic_location.png deleted file mode 100644 index 567038b..0000000 Binary files a/res/images/clock_world_ic_location.png and /dev/null differ diff --git a/res/misc/CMakeLists.txt b/res/misc/CMakeLists.txt deleted file mode 100644 index a4dbef0..0000000 --- a/res/misc/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs-sql REQUIRED db-util) - -ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.worldclock.db - COMMAND sqlite3 ${CMAKE_CURRENT_BINARY_DIR}/.worldclock.db ".read ${CMAKE_CURRENT_SOURCE_DIR}/timezone.sql" - COMMENT "Creating timezone database" - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/timezone.sql -) -ADD_CUSTOM_TARGET(timezone_db ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.worldclock.db) - -#install database files -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/.worldclock.db DESTINATION ${TZ_SYS_DB}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/.worldclock.db-journal DESTINATION ${TZ_SYS_DB}) diff --git a/res/po/CMakeLists.txt b/res/po/CMakeLists.txt index 3eb7200..5218ae3 100644 --- a/res/po/CMakeLists.txt +++ b/res/po/CMakeLists.txt @@ -77,7 +77,7 @@ FOREACH(pofile ${POFILES}) DEPENDS ${absPofile} ) INSTALL(FILES ${moFile} - DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PACKAGE}.mo) + DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) SET(moFiles ${moFiles} ${moFile}) ENDFOREACH(pofile) diff --git a/shared/res/libug-worldclock-efl.png b/shared/res/libug-worldclock-efl.png new file mode 100644 index 0000000..9765b1b Binary files /dev/null and b/shared/res/libug-worldclock-efl.png differ diff --git a/shared/res/worldclock.db b/shared/res/worldclock.db new file mode 100644 index 0000000..7bb7a6a Binary files /dev/null and b/shared/res/worldclock.db differ diff --git a/shared/res/worldclock.db-journal b/shared/res/worldclock.db-journal new file mode 100644 index 0000000..aa97c57 Binary files /dev/null and b/shared/res/worldclock.db-journal differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0e3c86a..c7f377e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,26 +43,24 @@ ENDIF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DSLP_DEBUG") ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") -ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"") -#lib -ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) -#SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0) +#bin +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) -#install lib -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${UGLIBDIR}) +#install +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) # make worldclock.edj -ADD_CUSTOM_TARGET(ug_worldclock.edj - COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../res/images - ${CMAKE_CURRENT_SOURCE_DIR}/../res/edc/worldclock.edc ${CMAKE_BINARY_DIR}/ug_worldclock.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../res/edc/worldclock.edc +ADD_CUSTOM_TARGET(worldclock.edj + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/../edje/images + ${CMAKE_CURRENT_SOURCE_DIR}/../res/edje/worldclock.edc ${CMAKE_BINARY_DIR}/worldclock.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../res/edje/worldclock.edc ) -ADD_DEPENDENCIES(${PROJECT_NAME} ug_worldclock.edj) +ADD_DEPENDENCIES(${PROJECT_NAME} worldclock.edj) # install edj file -INSTALL(FILES ${CMAKE_BINARY_DIR}/ug_worldclock.edj DESTINATION ${EDJDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/worldclock.edj DESTINATION ${EDJDIR}) diff --git a/src/ug_worldclock_efl.c b/src/ug_worldclock_efl.c index 05ff515..39c2a30 100644 --- a/src/ug_worldclock_efl.c +++ b/src/ug_worldclock_efl.c @@ -22,12 +22,12 @@ #include #include -#include #include "worldclock.h" #include "worldclock_dlog.h" #include "ug_worldclock_efl.h" #include "worldclock_add_view.h" +#include "worldclock_util.h" #include "efl_extension.h" #include "clock_fwk_icu_label.h" @@ -35,13 +35,6 @@ #define _(s) dgettext(PACKAGE, s) #endif -struct ug_data { - ui_gadget_h ug; - struct appdata *ad; -}; - -static struct ug_data *g_ugd; - /** * Callback func which should be called when exit from this ug. * @@ -52,39 +45,38 @@ static struct ug_data *g_ugd; static void __ug_return_cb(void *data, Eina_Bool isReload) { CLK_FUN_BEG(); - struct ug_data *ugd = NULL; + struct appdata *ad = NULL; Wcl_CitySet *cs = NULL; - app_control_h app_control = NULL; + app_control_h reply = NULL; - ret_if(!g_ugd); - ugd = g_ugd; - cs = ugd->ad->return_data; + ad = data; + cs = ad->return_data; if (cs) { - app_control_create(&app_control); - app_control_add_extra_data(app_control, "city", cs->city); - app_control_add_extra_data(app_control, "city_name", _(cs->city)); - app_control_add_extra_data(app_control, "country", cs->country); - app_control_add_extra_data(app_control, "country_name", _(cs->country)); + app_control_create(&reply); + app_control_add_extra_data(reply, "city", cs->city); + app_control_add_extra_data(reply, "city_name", _(cs->city)); + app_control_add_extra_data(reply, "country", cs->country); + app_control_add_extra_data(reply, "country_name", _(cs->country)); - if (ugd->ad->caller != WCL_CALLER_IS_APP_IT_SELF) { + if (ad->caller != WCL_CALLER_IS_APP_IT_SELF) { const char *timezone = cs->timezone; if (timezone == strstr(timezone, "GMT")) { timezone += 3; } - app_control_add_extra_data(app_control, "timezone", timezone); - app_control_add_extra_data(app_control, "tzpath", cs->tz_path); + app_control_add_extra_data(reply, "timezone", timezone); + app_control_add_extra_data(reply, "tzpath", cs->tz_path); CLK_INFO("[Result] city: %s, city_name: %s, country: %s, timezone: %s, tzpath: %s\n", cs->city, _(cs->city), cs->country, timezone, cs->tz_path); } - ug_send_result(ugd->ug, app_control); - app_control_destroy(app_control); + app_control_reply_to_launch_request(reply, ad->app_caller, APP_CONTROL_RESULT_SUCCEEDED); + app_control_destroy(reply); - FREEIF(ugd->ad->return_data); + FREEIF(ad->return_data); #ifdef FEATURE_SORT_ORDER - EVAS_OBJECT_DELIF(ugd->ad->more_popup); + EVAS_OBJECT_DELIF(ad->more_popup); #endif } else { CLK_ERR("No return data selected!"); @@ -229,76 +221,38 @@ static void _show_title(void *data, Evas_Object * obj, void *event_info) CLK_FUN_END(); } -static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h data, void *priv) +static bool on_create(void *priv) { CLK_FUN_BEG(); Evas_Object *win = NULL; - struct ug_data *ugd = NULL; struct appdata *ad = NULL; - char *caller_name = NULL; - char *city_index = NULL; - char *text_id = NULL; - retv_if(ug == NULL || priv == NULL, NULL); + retv_if(priv == NULL, false); + + ad = priv; - ugd = priv; - ugd->ug = ug; // get ug window - win = (Evas_Object *) ug_get_window(); - retv_if(win == NULL, NULL); + win = elm_win_util_standard_add(PACKAGE, PACKAGE); + retv_if(win == NULL, false); // allocate data ad = (struct appdata *)calloc(1, sizeof(struct appdata)); - retv_if(ad == NULL, NULL); + retv_if(ad == NULL, false); /*disable rotate */ ad->win = win; - ad->conform = (Evas_Object *) ug_get_conformant(); - ad->ug = ug; - ad->parent = ug_get_parent_layout(ug); - GOTO_ERROR_IF(!ad->parent); - - if (data) { - app_control_get_extra_data(data, "caller", &caller_name); - app_control_get_extra_data(data, "city_index", &city_index); - - app_control_get_extra_data(data, "translation_request", &text_id); - } - if (city_index) { - ad->city_index = atoi(city_index); - } else { - ad->city_index = -1; - } - FREEIF(city_index); + elm_win_conformant_set(win, EINA_TRUE); + elm_win_autodel_set(win, EINA_TRUE); + evas_object_show(win); + ad->conform = elm_conformant_add(win); + evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, ad->conform); + evas_object_show(ad->conform); - // set caller flag - if (caller_name && !strcmp("clock", caller_name)) { - ad->caller = WCL_CALLER_IS_APP_IT_SELF; - } else if (caller_name && !strcmp("dual_clock", caller_name)) { - ad->caller = WCL_CALLER_IS_LIVEBOX; - } else { - ad->caller = WCL_CALLER_IS_UI_GADGET; - } - CLK_INFO("ad->caller = %d", ad->caller); - FREEIF(caller_name); /* language setting */ - bindtextdomain(PACKAGE, LOCALEDIR); + bindtextdomain(PACKAGE, worldclock_get_locale_path()); textdomain(PACKAGE); - if (text_id) { - CLK_INFO("text_id = %d", text_id); - app_control_h app_control = NULL; - app_control_create(&app_control); - app_control_add_extra_data(app_control, "city_name", _(text_id)); - ug_send_result(ug, app_control); - app_control_destroy(app_control); - - FREEIF(text_id); - ug_destroy_me(ug); - GOTO_ERROR_IF(true); - return NULL; - } - /* main layout */ - ad->ly_main = __ug_create_main_layout(ad->parent); + ad->ly_main = __ug_create_main_layout(ad->conform); GOTO_ERROR_IF(ad->ly_main == NULL); ad->bg = __ug_create_bg(ad->ly_main); elm_object_part_content_set(ad->ly_main, "elm.swallow.bg", ad->bg); @@ -320,12 +274,9 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h data, vo ad); evas_object_smart_callback_add(ad->conform, "clipboard,state,off", _show_title, ad); - - ugd->ad = ad; - g_ugd = ugd; - + elm_object_content_set(ad->conform, ad->ly_main); CLK_FUN_END(); - return ad->ly_main; + return true; error: if (ad) { @@ -360,49 +311,22 @@ error: return NULL; } -static void on_start(ui_gadget_h ug, app_control_h data, void *priv) -{ - CLK_FUN_BEG(); - struct appdata *ad = NULL; - - ad = g_ugd->ad; - - if (ad->conform == NULL) { - CLK_INFO("conformant get failed in on_create"); - CLK_INFO("retry to get conformant"); - ad->conform = (Evas_Object *) ug_get_conformant(); - evas_object_smart_callback_add(ad->conform, "virtualkeypad,state,on", - _hide_title, ad); - evas_object_smart_callback_add(ad->conform, "virtualkeypad,state,off", - _show_title, ad); - evas_object_smart_callback_add(ad->conform, "clipboard,state,on", - _hide_title, ad); - evas_object_smart_callback_add(ad->conform, "clipboard,state,off", - _show_title, ad); - } - CLK_FUN_END(); -} - -static void on_pause(ui_gadget_h ug, app_control_h data, void *priv) +static void on_pause(void *priv) { CLK_FUN_BEG(); } -static void on_resume(ui_gadget_h ug, app_control_h data, void *priv) +static void on_resume(void *priv) { CLK_FUN_BEG(); } -static void on_destroy(ui_gadget_h ug, app_control_h data, void *priv) +static void on_destroy(void *priv) { CLK_FUN_BEG(); - struct ug_data *ugd; - - ret_if(!ug || !priv); - ugd = priv; - if (ugd->ad) { - struct appdata *ad = ugd->ad; + if (priv) { + struct appdata *ad = priv; worldclock_ugview_free(ad); #ifdef FEATURE_SORT_ORDER @@ -421,6 +345,8 @@ static void on_destroy(ui_gadget_h ug, app_control_h data, void *priv) ECORE_TIMER_DELIF(ad->add_view_quit_timer); ECORE_TIMER_DELIF(ad->add_view_update_timer); ECORE_TIMER_DELIF(ad->search_timer); + if(ad->app_caller) + app_control_destroy(ad->app_caller); if (ad->conform) { evas_object_smart_callback_del(ad->conform, @@ -434,134 +360,134 @@ static void on_destroy(ui_gadget_h ug, app_control_h data, void *priv) ad->conform = NULL; } /*enable rotate */ - free(ugd->ad); - ugd->ad = NULL; + free(ad); } - + worldclock_path_util_free(); CLK_FUN_END(); } -static void on_message(ui_gadget_h ug, app_control_h msg, app_control_h data, void *priv) +static void on_app_control(app_control_h app_control, void *priv) { + struct appdata *ad = NULL; + char *caller_name = NULL; + char *city_index = NULL; + char *text_id = NULL; + ret_if(!priv); + ad = priv; + + if (app_control) { + app_control_clone(&ad->app_caller, app_control); + app_control_get_extra_data(app_control, "caller", &caller_name); + app_control_get_extra_data(app_control, "city_index", &city_index); + + app_control_get_extra_data(app_control, "translation_request", &text_id); + } + if (city_index) { + ad->city_index = atoi(city_index); + } else { + ad->city_index = -1; + } + FREEIF(city_index); + + // set caller flag + if (caller_name && !strcmp("clock", caller_name)) { + ad->caller = WCL_CALLER_IS_APP_IT_SELF; + } else if (caller_name && !strcmp("dual_clock", caller_name)) { + ad->caller = WCL_CALLER_IS_LIVEBOX; + } else { + ad->caller = WCL_CALLER_IS_UI_GADGET; + } + CLK_INFO("ad->caller = %d", ad->caller); + FREEIF(caller_name); + + if (text_id) { + CLK_INFO("text_id = %d", text_id); + app_control_h reply = NULL; + app_control_create(&reply); + app_control_add_extra_data(reply, "city_name", _(text_id)); + app_control_reply_to_launch_request(reply, app_control, APP_CONTROL_RESULT_SUCCEEDED); + app_control_destroy(reply); + + FREEIF(text_id); + ui_app_exit(); //check if it necessary + } } -static void on_event(ui_gadget_h ug, enum ug_event event, app_control_h data, void *priv) +static void on_lang_changed(app_event_info_h event_info, void *priv) { - CLK_FUN_BEG(); - ret_if(!ug || !priv); - - struct ug_data *ugd; - struct appdata *ad; - Elm_Object_Item *it = NULL; + ret_if(!priv); - ugd = priv; - if (ugd->ad) { - ad = ugd->ad; - } else { - return; - } + struct appdata *ad; + ad = priv; + __ug_lang_update(ad); - switch (event) { - case UG_EVENT_LOW_MEMORY: - CLK_INFO("Event : UG_EVENT_LOW_MEMORY"); - break; - case UG_EVENT_LOW_BATTERY: - CLK_INFO("Event : UG_EVENT_LOW_BATTERY"); - break; - case UG_EVENT_LANG_CHANGE: - CLK_INFO("Event : UG_EVENT_LANG_CHANGE"); - __ug_lang_update(ad); - uninit_alphabetic_index(); - char *lang = vconf_get_str(VCONFKEY_LANGSET); - init_alphabetic_index(lang); - FREEIF(lang); - worldclock_ugview_update(ad); - break; - case UG_EVENT_ROTATE_PORTRAIT: - case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: - CLK_INFO("Event : UG_EVENT_ROTATE_PORTRAIT"); - _show_title(ad, NULL, NULL); - it = elm_index_selected_item_get(ad->add_index, 0); - if (it != NULL) { - elm_index_item_selected_set(it, EINA_FALSE); - } - break; - case UG_EVENT_ROTATE_LANDSCAPE: - case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: - CLK_INFO("Event : UG_EVENT_ROTATE_LANDSCAPE"); - Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->searchbar_entry); - if (imf_context) { - if (ECORE_IMF_INPUT_PANEL_STATE_HIDE != - ecore_imf_context_input_panel_state_get(imf_context)) { - _hide_title(ad, NULL, NULL); - } - } + uninit_alphabetic_index(); + char *lang = vconf_get_str(VCONFKEY_LANGSET); + init_alphabetic_index(lang); + FREEIF(lang); - it = elm_index_selected_item_get(ad->add_index, 0); - if (it != NULL) { - elm_index_item_selected_set(it, EINA_FALSE); - } - //CLK_INFO("current level = %d", level); - break; - default: - CLK_INFO("Event : %d", event); - break; - } - CLK_FUN_END(); + worldclock_ugview_update(ad); } -static void on_key_event(ui_gadget_h ug, enum ug_key_event event, - app_control_h data, void *priv) +static void on_orient_changed(app_event_info_h event_info, void *priv) { - CLK_FUN_BEG(); - ret_if(!ug); - - switch (event) { - case UG_KEY_EVENT_END: - ug_destroy_me(ug); - break; - default: - break; - } - CLK_FUN_END(); + ret_if(!priv); + + struct appdata *ad; + Elm_Index_Item *it = NULL; + Ecore_IMF_Context *imf_context = NULL; + app_device_orientation_e orient = APP_DEVICE_ORIENTATION_0; + ad = priv; + app_event_get_device_orientation(event_info, &orient); + + switch (orient) + { + case APP_DEVICE_ORIENTATION_0: + case APP_DEVICE_ORIENTATION_180: + _show_title(ad, NULL, NULL); + it = elm_index_selected_item_get(ad->add_index, 0); + if (it != NULL) { + elm_index_item_selected_set(it, EINA_FALSE); + } + break; + case APP_DEVICE_ORIENTATION_90: + case APP_DEVICE_ORIENTATION_270: + imf_context = elm_entry_imf_context_get(ad->searchbar_entry); + if (imf_context) { + if (ECORE_IMF_INPUT_PANEL_STATE_HIDE != + ecore_imf_context_input_panel_state_get(imf_context)) { + _hide_title(ad, NULL, NULL); + } + } + + it = elm_index_selected_item_get(ad->add_index, 0); + if (it != NULL) { + elm_index_item_selected_set(it, EINA_FALSE); + } + break; + } } -UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) +int main(int argc, char *argv[]) { - CLK_FUN_BEG(); - struct ug_data *ugd; - - retv_if(!ops, -1); - - ugd = calloc(1, sizeof(struct ug_data)); - retv_if(!ugd, -1); + struct appdata *ad; - ops->create = on_create; - ops->start = on_start; - ops->pause = on_pause; - ops->resume = on_resume; - ops->destroy = on_destroy; - ops->message = on_message; - ops->event = on_event; - ops->key_event = on_key_event; - ops->priv = ugd; - ops->opt = UG_OPT_INDICATOR_ENABLE; + ad = calloc(1, sizeof(struct appdata)); + retv_if(!ad, -1); - CLK_FUN_END(); - return 0; -} - -UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) -{ - CLK_FUN_BEG(); - struct ug_data *ugd; - - ret_if(!ops); + ui_app_lifecycle_callback_s cbs = {}; - ugd = ops->priv; + cbs.app_control = on_app_control; + cbs.create = on_create; + cbs.pause = on_pause; + cbs.resume = on_resume; + cbs.terminate = on_destroy; - FREEIF(ugd); - g_ugd = NULL; + app_event_handler_h handlers[3] = {}; + ui_app_add_event_handler(&handlers[0], APP_EVENT_LANGUAGE_CHANGED, on_lang_changed, ad); + ui_app_add_event_handler(&handlers[1], APP_EVENT_REGION_FORMAT_CHANGED, on_lang_changed, ad); + ui_app_add_event_handler(&handlers[2], APP_EVENT_DEVICE_ORIENTATION_CHANGED, on_orient_changed, &ad); - CLK_FUN_END(); + return ui_app_main(argc, argv, &cbs, ad); } + diff --git a/src/worldclock_add_view.c b/src/worldclock_add_view.c index 3862daf..063ef72 100644 --- a/src/worldclock_add_view.c +++ b/src/worldclock_add_view.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -27,7 +26,6 @@ #include #include #include -#include #include #include @@ -457,8 +455,8 @@ static Eina_Bool _ugview_search_matched_mcc(char *string, char *city_mcc) ret = EINA_FALSE; char *tmp_mcc = strdup(city_mcc); - char *save_ptr = NULL; char *ptr = NULL; + char *save_ptr = NULL; ptr = strtok_r(tmp_mcc, " ", &save_ptr); if (ptr) { if (IS_STR_EQUAL(ptr, string)) { @@ -934,7 +932,7 @@ static Eina_Bool _entry_changed_cb(void *data) //reset current city if (ad->search_text[0] != '\0') { - ad->current_mcc[0] = '\0'; + ad->current_mcc[0] = '\0'; } ad->search_timer = NULL; @@ -1039,7 +1037,7 @@ static void _searchbar_entry_preedit_changed_cb(void *data, } CLK_INFO_GREEN("ad->search_text:%s\n", ad->search_text); } else { - ad->search_text[0] = '\0'; + ad->search_text[0] = '\0'; } CLK_INFO("ad->search_text:%s\n", ad->search_text); @@ -1110,7 +1108,7 @@ static void _searchbar_entry_changed_cb(void *data, Evas_Object *obj, void *even strncpy(ad->search_text, search_str, strlen(search_str) + 1); } } else { - ad->search_text[0] = '\0'; + ad->search_text[0] = '\0'; } FREEIF(search_str); ECORE_TIMER_DELIF(ad->search_timer); @@ -1210,7 +1208,7 @@ static Evas_Object *__ugview_searchbar_add(Evas_Object *parent, void *data) retv_if((!parent || !data), NULL); struct appdata *ad = (struct appdata *)data;; - Evas_Object *searchbar_layout = worldclock_load_edj(parent, WCL_EDJ_NAME, "editfield_layout"); + Evas_Object *searchbar_layout = worldclock_load_edj(parent, worldclock_get_egje_path(), "editfield_layout"); retv_if(!searchbar_layout, NULL); /* editfield layout */ @@ -1256,7 +1254,7 @@ static Evas_Object *__ugview_searchbar_add(Evas_Object *parent, void *data) Evas_Object *location_btn = elm_button_add(searchbar_layout); elm_object_style_set(location_btn, "transparent"); Evas_Object *location_icon = elm_layout_add(location_btn); - elm_layout_file_set(location_icon, WCL_EDJ_NAME, "location_icon"); + elm_layout_file_set(location_icon, worldclock_get_egje_path(), "location_icon"); elm_object_part_content_set(location_btn, "elm.swallow.content", location_icon); elm_object_part_content_set(searchbar_layout, "location_sw", location_btn); evas_object_smart_callback_add(location_btn, "clicked", _location_btn_clicked_cb, ad); @@ -1273,7 +1271,7 @@ static Evas_Object *_ugview_add_layout(Evas_Object *parent) retv_if(!parent, NULL); // create window layout - Evas_Object *layout = worldclock_load_edj(parent, WCL_EDJ_NAME, "searchbar_base"); + Evas_Object *layout = worldclock_load_edj(parent, worldclock_get_egje_path(), "searchbar_base"); retv_if(!layout, NULL); elm_object_signal_emit(layout, "elm,state,show,searchbar", "elm"); @@ -1287,10 +1285,10 @@ static void _ug_reply() app_control_h app_control = NULL; app_control_create(&app_control); app_control_add_extra_data(app_control, "view", "destroy"); - ug_send_result(g_ad->ug, app_control); + app_control_reply_to_launch_request(app_control, g_ad->app_caller, APP_CONTROL_RESULT_SUCCEEDED); app_control_destroy(app_control); - ug_destroy_me(g_ad->ug); + ui_app_exit(); } static void _back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) @@ -1622,9 +1620,11 @@ int worldclock_ugview_add(Evas_Object *parent, void *data, Wcl_Return_Cb func) retv_if(!data, FAILED); int ret = SUCCESS; struct appdata *ad = (struct appdata *)data; + char *lang = vconf_get_str(VCONFKEY_LANGSET); init_alphabetic_index(lang); FREEIF(lang); + g_ad = ad; g_return_cb = func; const char *group_name = NULL; @@ -1672,7 +1672,7 @@ int worldclock_ugview_add(Evas_Object *parent, void *data, Wcl_Return_Cb func) memset(ad->current_mcc, 0x0, MCC_BUF_SIZE * sizeof(char)); /* load edje */ - ad->add_layout = worldclock_load_edj(ad->add_ly, WCL_EDJ_NAME, group_name); + ad->add_layout = worldclock_load_edj(ad->add_ly, worldclock_get_egje_path(), group_name); retv_if(ad->add_layout == NULL, FAILED); elm_object_part_content_set(ad->add_ly, "elm.swallow.content", ad->add_layout); @@ -1750,6 +1750,7 @@ void worldclock_ugview_free(void *data) struct appdata *ad = (struct appdata *)data; uninit_alphabetic_index(); + worldclock_ug_data_close_database(); if (ad->add_ly) { diff --git a/src/worldclock_data.c b/src/worldclock_data.c index 35faff1..4c5e4d5 100644 --- a/src/worldclock_data.c +++ b/src/worldclock_data.c @@ -16,9 +16,8 @@ */ #include -#include #include -#include +#include #include #include @@ -28,9 +27,9 @@ #include "worldclock_dlog.h" #include "worldclock_types.h" #include "worldclock_util.h" -#include -#define WORLDCLOCK_DB tzplatform_mkpath(TZ_SYS_DB, ".worldclock.db") +//TODO: remove hardcode when correct path will be acquired +#define WORLDCLOCK_DB "worldclock.db" #define WORLDCLOCK_DB_QUERY_LEN 512 #define WORLDCLOCK_DB_TABLE_CITY "city_table" @@ -1102,9 +1101,23 @@ Eina_Bool worldclock_ug_data_open_database() // check whether file exists, if not, create it if (!g_hDB) { // open it, create it if not exist - if (SQLITE_OK != db_util_open(WORLDCLOCK_DB, &g_hDB, 0)) { - return EINA_FALSE; - } + char *res = NULL; + res = app_get_shared_resource_path(); + if(res) + { + char db_path[BUF_SIZE]; + snprintf(db_path, BUF_SIZE, "%s/%s", res, WORLDCLOCK_DB); + if (SQLITE_OK != sqlite3_open(db_path, &g_hDB)) { + free(res); + return EINA_FALSE; + } + } + else + { + return EINA_FALSE; + } + free(res); + } CLK_FUN_DEBUG_END(); @@ -1120,8 +1133,7 @@ Eina_Bool worldclock_ug_data_open_database() Eina_Bool worldclock_ug_data_close_database() { CLK_FUN_DEBUG_BEG(); - //sqlite3_close(g_hDB); - db_util_close(g_hDB); + sqlite3_close(g_hDB); g_hDB = NULL; CLK_FUN_DEBUG_END(); return EINA_TRUE; diff --git a/src/worldclock_util.c b/src/worldclock_util.c index 8500c21..fbe3228 100644 --- a/src/worldclock_util.c +++ b/src/worldclock_util.c @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -31,6 +30,9 @@ #define UG_MODULE_API __attribute__ ((visibility("default"))) #endif +static char *_edgePath = NULL; +static char *_localePath = NULL; + /** * Compare the city name of two cities * @@ -223,3 +225,33 @@ int worldclock_dst_get(const Wcl_CitySet * cs) } return dst; } + +const char *worldclock_get_egje_path() +{ + if(!_edgePath) + { + char *resPath = app_get_resource_path(); + _edgePath = (char *)calloc(1, BUF_PATH); + snprintf(_edgePath, BUF_PATH, "%s/edje/worldclock.edj", resPath); + free(resPath); + } + return _edgePath; +} + +const char *worldclock_get_locale_path() +{ + if(!_localePath) + { + char *resPath = app_get_resource_path(); + _localePath = (char *)calloc(1, BUF_PATH); + snprintf(_localePath, BUF_PATH, "%s/locale", resPath); + free(resPath); + } + return _localePath; +} + +void worldclock_path_util_free() +{ + free(_edgePath); + free(_localePath); +} diff --git a/tizen-manifest.xml b/tizen-manifest.xml new file mode 100644 index 0000000..b8d63cd --- /dev/null +++ b/tizen-manifest.xml @@ -0,0 +1,13 @@ + + + + + + + libug-worldclock-efl.png + + + http://tizen.org/privilege/telephony + + true + diff --git a/tzlist.ini b/tzlist.ini deleted file mode 100644 index 7f9c257..0000000 --- a/tzlist.ini +++ /dev/null @@ -1,224 +0,0 @@ -Africa/Abidjan -Africa/Accra -Africa/Addis_Ababa -Africa/Algiers -Africa/Asmara -Africa/Bamako -Africa/Bangui -Africa/Bissau -Africa/Cairo -Africa/Casablanca -Africa/Conakry -Africa/Dakar -Africa/Dar_es_Salaam -Africa/Djibouti -Africa/Douala -Africa/Freetown -Africa/Gaborone -Africa/Harare -Africa/Johannesburg -Africa/Kampala -Africa/Khartoum -Africa/Kinshasa -Africa/Lagos -Africa/Luanda -Africa/Lubumbashi -Africa/Lusaka -Africa/Malabo -Africa/Maputo -Africa/Mogadishu -Africa/Monrovia -Africa/Nairobi -Africa/Ndjamena -Africa/Niamey -Africa/Nouakchott -Africa/Ouagadougou -Africa/Tripoli -Africa/Tunis -America/Anchorage -America/Antigua -America/Argentina/Buenos_Aires -America/Asuncion -America/Barbados -America/Belize -America/Bogota -America/Caracas -America/Cayenne -America/Chicago -America/Costa_Rica -America/Denver -America/Detroit -America/El_Salvador -America/Godthab -America/Guadeloupe -America/Guatemala -America/Guayaquil -America/Guyana -America/Halifax -America/Havana -America/Indiana/Indianapolis -America/Jamaica -America/Kentucky/Louisville -America/La_Paz -America/Lima -America/Los_Angeles -America/Managua -America/Marigot -America/Martinique -America/Mazatlan -America/Mexico_City -America/Montevideo -America/Montreal -America/New_York -America/Nome -America/Panama -America/Paramaribo -America/Phoenix -America/Port-au-Prince -America/Puerto_Rico -America/Recife -America/Regina -America/Santiago -America/Santo_Domingo -America/Sao_Paulo -America/St_Johns -America/St_Thomas -America/Tegucigalpa -America/Tijuana -America/Toronto -America/Tortola -America/Vancouver -America/Winnipeg -Asia/Aden -Asia/Almaty -Asia/Amman -Asia/Anadyr -Asia/Ashgabat -Asia/Baghdad -Asia/Bahrain -Asia/Baku -Asia/Bangkok -Asia/Beirut -Asia/Bishkek -Asia/Colombo -Asia/Damascus -Asia/Dhaka -Asia/Dubai -Asia/Dushanbe -Asia/Ho_Chi_Minh -Asia/Hong_Kong -Asia/Hovd -Asia/Irkutsk -Asia/Istanbul -Asia/Jakarta -Asia/Jayapura -Asia/Jerusalem -Asia/Kabul -Asia/Kamchatka -Asia/Karachi -Asia/Kathmandu -Asia/Kolkata -Asia/Krasnoyarsk -Asia/Kuala_Lumpur -Asia/Kuwait -Asia/Macau -Asia/Magadan -Asia/Makassar -Asia/Manila -Asia/Muscat -Asia/Novokuznetsk -Asia/Novosibirsk -Asia/Omsk -Asia/Phnom_Penh -Asia/Pyongyang -Asia/Qatar -Asia/Rangoon -Asia/Riyadh -Asia/Sakhalin -Asia/Seoul -Asia/Shanghai -Asia/Singapore -Asia/Taipei -Asia/Tashkent -Asia/Tbilisi -Asia/Tehran -Asia/Tokyo -Asia/Ulan_Bator -Asia/Vladivostok -Asia/Yakutsk -Asia/Yekaterinburg -Asia/Yerevan -Atlantic/Azores -Atlantic/Canary -Atlantic/Reykjavik -Atlantic/South_Georgia -Australia/Adelaide -Australia/Brisbane -Australia/Canberra -Australia/Darwin -Australia/Hobart -Australia/Melbourne -Australia/Perth -Australia/Sydney -CST6CDT -EST5EDT -Europe/Amsterdam -Europe/Athens -Europe/Belgrade -Europe/Berlin -Europe/Bratislava -Europe/Brussels -Europe/Bucharest -Europe/Budapest -Europe/Chisinau -Europe/Copenhagen -Europe/Dublin -Europe/Helsinki -Europe/Istanbul -Europe/Kaliningrad -Europe/Kiev -Europe/Lisbon -Europe/Ljubljana -Europe/London -Europe/Luxembourg -Europe/Madrid -Europe/Malta -Europe/Minsk -Europe/Moscow -Europe/Paris -Europe/Podgorica -Europe/Prague -Europe/Riga -Europe/Rome -Europe/Samara -Europe/San_Marino -Europe/Skopje -Europe/Sofia -Europe/Stockholm -Europe/Tallinn -Europe/Vaduz -Europe/Vienna -Europe/Vilnius -Europe/Volgograd -Europe/Warsaw -Europe/Zagreb -Europe/Zurich -Indian/Antananarivo -Indian/Chagos -Indian/Maldives -Indian/Mauritius -Indian/Reunion -MST7MDT -Pacific/Auckland -Pacific/Easter -Pacific/Fiji -Pacific/Galapagos -Pacific/Guam -Pacific/Honolulu -Pacific/Midway -Pacific/Noumea -Pacific/Pago_Pago -Pacific/Tahiti -Pacific/Tarawa -Pacific/Tongatapu -PST8PDT diff --git a/worldclock-efl.xml b/worldclock-efl.xml deleted file mode 100644 index dfc02b0..0000000 --- a/worldclock-efl.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Goo Lee - World clock city list ug - - com.samsung.clock.png - - - - - - - - http://tizen.org/privilege/telephony - - -- cgit v1.2.3 From 7fcddade07e09399651405218c2c43129e7b23a3 Mon Sep 17 00:00:00 2001 From: Andrey Klimenko Date: Wed, 8 Jun 2016 10:52:02 +0300 Subject: corrected package-id in manifest to fix launch issues, also fixed issue with localization Change-Id: I2563724a14262e27485c9899c5e9993819c27c03 Signed-off-by: Andrey Klimenko --- .cproject | 25 ++++++++----- CMakeLists.txt | 2 +- inc/worldclock_const.h | 2 +- libug-worldclock-efl.manifest | 5 --- org.tizen.worldclock-efl.manifest | 5 +++ packaging/libug-worldclock-efl.spec | 64 --------------------------------- packaging/org.tizen.worldclock-efl.spec | 64 +++++++++++++++++++++++++++++++++ tizen-manifest.xml | 4 +-- 8 files changed, 89 insertions(+), 82 deletions(-) delete mode 100644 libug-worldclock-efl.manifest create mode 100644 org.tizen.worldclock-efl.manifest delete mode 100644 packaging/libug-worldclock-efl.spec create mode 100644 packaging/org.tizen.worldclock-efl.spec diff --git a/.cproject b/.cproject index c032025..4eb4e91 100644 --- a/.cproject +++ b/.cproject @@ -16,7 +16,7 @@ - + @@ -32,9 +32,11 @@