From: Radoslaw Czerski Date: Fri, 19 Aug 2016 13:34:03 +0000 (+0200) Subject: [Clock] base GUI. X-Git-Tag: submit/tizen/20161113.192141~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59d5b5c25cb4a1d7fcde1a5671e27ee2f90edae0;p=profile%2Fmobile%2Fapps%2Fnative%2Fclock.git [Clock] base GUI. Change-Id: I1efb84c293b2a43423d66de93fed1c012e370b00 Signed-off-by: Radoslaw Czerski --- diff --git a/clock/.cproject b/clock/.cproject index fadcfc5..10e678f 100644 --- a/clock/.cproject +++ b/clock/.cproject @@ -16,7 +16,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -325,10 +329,10 @@ - - - - @@ -442,10 +446,10 @@ - - - - @@ -559,7 +563,7 @@ - diff --git a/clock/.project b/clock/.project index 4c9b913..99c58d0 100644 --- a/clock/.project +++ b/clock/.project @@ -3,8 +3,6 @@ clock - ring - clock-common @@ -33,7 +31,7 @@ - 1469441105659 + 1470818697836 26 @@ -42,7 +40,7 @@ - 1469441105662 + 1470818697840 6 diff --git a/clock/Build/flags.mk b/clock/Build/flags.mk index 0ee8efb..649a5e5 100644 --- a/clock/Build/flags.mk +++ b/clock/Build/flags.mk @@ -7,7 +7,7 @@ CPP_OPTIMIZATION_OP = COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0 -CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) +CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) -std=c++11 LINK_FLAGS = diff --git a/clock/inc/Clock.h b/clock/inc/Clock.h new file mode 100644 index 0000000..31360b8 --- /dev/null +++ b/clock/inc/Clock.h @@ -0,0 +1,34 @@ +#ifndef __CLOCK_H__ +#define __CLOCK_H__ + +#include +#include "Controller/MainController.h" + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "CLOCK" + +#if !defined(PACKAGE) +#define PACKAGE "org.tizen.clock" +#endif + +#define EDJ_FILE "edje/clock.edj" +#define GRP_MAIN "main" + +/** + * @defgroup Models Models + */ + +/** + * @defgroup Views Views + */ + +/** + * @defgroup Controllers Controllers + */ + +/** + * @defgroup main Main + */ +#endif /* __CLOCK_H__ */ diff --git a/clock/inc/Controller/MainController.h b/clock/inc/Controller/MainController.h new file mode 100644 index 0000000..6a0ee71 --- /dev/null +++ b/clock/inc/Controller/MainController.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2016 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_MAIN_CONTROLLER_H_ +#define _CLOCK_MAIN_CONTROLLER_H_ + +/** + * @file MainController.h + */ + +/** + * @addtogroup Controllers + * @{ + */ + +/** + * @addtogroup Main + * @{ + */ + +namespace worldclock { + namespace controller { + + /** + * @brief Application lifecycle main controller singleton class + * @remarks This is singleton class. + */ + class MainController { + public: + /** + * @brief Retrieves singleton instance. + */ + static MainController &GetInstance(); + + /** + * @brief Destructor. + */ + ~MainController(); + + /** + * @brief Initializes application. + */ + int Init(); + + /** + * @brief Denitializes application. + */ + void Deinit(); + + /** + * @brief Pause application. + */ + void Pause(); + + /** + * @brief Resume application. + */ + void Resume(); + + /** + * @briefs Copies this class object instance. + * @remarks Customized for singleton purpose - make no effect. + */ + MainController(MainController const&) = delete; + + /** + * @briefs Overloads equation mark. + * @remarks Customized for singleton purpose - make no effect. + */ + void operator=(MainController const&) = delete; + + private: + /** + * @brief Constructs MainController class object. + */ + MainController() {}; + }; + + } +} + +/** + * @} + */ + +/** + * @} + */ +#endif /* _CLOCK_MAIN_CONTROLLER_H_ */ diff --git a/clock/inc/View/AlarmView.h b/clock/inc/View/AlarmView.h new file mode 100644 index 0000000..956817d --- /dev/null +++ b/clock/inc/View/AlarmView.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 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 ALARMVIEW_H_ +#define ALARMVIEW_H_ + +#include "View/PageView.h" +#include "View/View.h" + +namespace worldclock { + namespace view { + class AlarmView : public IView{ + public: + AlarmView(); + Evas_Object *GetEvasObject(){return alarm_;}; + + private: + Evas_Object *alarm_; + }; + } +} + + +#endif /* ALARMVIEW_H_ */ diff --git a/clock/inc/View/MainView.h b/clock/inc/View/MainView.h new file mode 100644 index 0000000..50f1b0e --- /dev/null +++ b/clock/inc/View/MainView.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2016 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 _WINDOW_VIEW_H_ +#define _WINDOW_VIEW_H_ + +#include + +#include "View/PageView.h" +#include "View/View.h" + +/** + * @file MainView.h + */ + +/** + * @addtogroup View + * @{ + */ + +/** + * @addtogroup Main + * @{ + */ + +namespace worldclock { + namespace view { + + /** + * @brief Application main view class + * @remarks This is singleton class. + */ + class MainView : public IView { + public: + + /** + * @brief Retrieves singleton instance. + */ + static MainView &GetInstance(); + + /** + * @brief Destructor + */ + ~MainView(); + + /** + * @brief Creates content of application + * @remarks It not creates base GUI + */ + void CreateContent(); + + /** + * @brief Retrieves naviframe object. + */ + Evas_Object *GetEvasObject(); + + /** + * @briefs Copies this class object instance. + * @remarks Customized for singleton purpose - make no effect. + */ + MainView(MainView const&) = delete; + /** + * @briefs Overloads equation mark. + * @remarks Customized for singleton purpose - make no effect. + */ + void operator=(MainView const&) = delete; + private: + + /** + * @brief Constructs MainView class object + * @remarks Creates base GUI + */ + MainView(); + + /** + * Adds conformant to window. + */ + void ConformantAdd(); + + /** + * @brief Adds naviframe to conformant + * @remarks it also fills indicator_bg part in conformant + */ + void NaviframeAdd(); + + /** + * @brief Creates content for Alarm, World Clock, Stopwatch and Timer pages + */ + void CreatePages(); + + /** + * @brief Creates toolbar buttons. + */ + void CreateToolbarButtons(); + + /** + * @brief Creates toolbar. + */ + void CreateToolbar(); + + Evas_Object *window_; + Evas_Object *conformant_; + Evas_Object *naviframe_; + + /* Content */ + Evas_Object *toolbar_; + + IView *alarm_; + IView *world_clock_; + IView *stop_watch_; + IView *timer_; + }; + } +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* _WINDOW_VIEW_H_ */ diff --git a/clock/inc/View/PageView.h b/clock/inc/View/PageView.h new file mode 100644 index 0000000..2a3135a --- /dev/null +++ b/clock/inc/View/PageView.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2016 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 NAVIFRAME_PAGE_VIEW_H_ +#define NAVIFRAME_PAGE_VIEW_H_ + +#include +#include "View/View.h" + +/** + * @file pageView.h + */ + +/** + * @addtogroup View + * @{ + */ + +namespace worldclock { + namespace view { + + /* + * @brief Base class for pages(Alarm, World Clock, StopWatch and Timer) + */ + class PageView : public view::IView { + public: + + /** + * @brief Constructs class object. + */ + PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content); + /** + * @brief Cleans all resources needed to be cleaned up. + */ + ~PageView(); + + /** + * @brief Gets object of the page. + */ + Evas_Object *GetEvasObject(); + + /** + * @brief Creates page content. + */ + virtual void CreateContent(){}; + + /** + * @brief Requests data refresh. + */ + virtual void RefreshContent(){}; + + /** + * @brief Creates new naviframe item page. + * @remarks Used to create "Add ..." pages in Alarm or World Clock + */ + virtual void CreateNewNaviPage(){}; + + protected: + + /** + * Requestes and retrives new naviframe item pushed to naviframe. + */ + void PushNewNaviPage(); + + Elm_Object_Item *subpage_; + const char *title_label_; + Evas_Object *left_button_; + Evas_Object *right_button_; + Evas_Object *content_; + }; + }; +}; + +/** + * @} + */ + +#endif /* NAVIFRAME_PAGE_VIEW_H_ */ diff --git a/clock/inc/View/StopWatchView.h b/clock/inc/View/StopWatchView.h new file mode 100644 index 0000000..4c2b372 --- /dev/null +++ b/clock/inc/View/StopWatchView.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2016 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 STOPWATCHVIEW_H_ +#define STOPWATCHVIEW_H_ + +#include "View/PageView.h" +#include "View/View.h" + +namespace worldclock { + namespace view { + + class StopWatchView : public IView{ + public: + StopWatchView(); + Evas_Object *GetEvasObject(){return stopwatch_;}; + + private: + Evas_Object *stopwatch_; + }; + } +} + + +#endif /* STOPWATCHVIEW_H_ */ diff --git a/clock/inc/View/TimerView.h b/clock/inc/View/TimerView.h new file mode 100644 index 0000000..164a629 --- /dev/null +++ b/clock/inc/View/TimerView.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 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 TIMERVIEW_H_ +#define TIMERVIEW_H_ + +#include "View/PageView.h" +#include "View/View.h" + +namespace worldclock { + namespace view { + class TimerView : public IView{ + public: + TimerView(); + Evas_Object *GetEvasObject(){return timer_;}; + + private: + Evas_Object *timer_; + }; + } +} + + +#endif /* TIMERVIEW_H_ */ diff --git a/clock/inc/View/View.h b/clock/inc/View/View.h new file mode 100644 index 0000000..baf83db --- /dev/null +++ b/clock/inc/View/View.h @@ -0,0 +1,16 @@ +#ifndef _CLOCK_UI_VIEW_H_ +#define _CLOCK_UI_VIEW_H_ + +#include + +namespace worldclock { + namespace view { + class IView { + public: + virtual Evas_Object *GetEvasObject() = 0; + virtual ~IView(){}; + }; + }; +}; + +#endif diff --git a/clock/inc/View/WorldClockView.h b/clock/inc/View/WorldClockView.h new file mode 100644 index 0000000..95b1fc9 --- /dev/null +++ b/clock/inc/View/WorldClockView.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 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 WORLDCLOCKVIEW_H_ +#define WORLDCLOCKVIEW_H_ + +#include "View/PageView.h" +#include "View/View.h" + +namespace worldclock { + namespace view { + class WorldClockView : public IView{ + public: + WorldClockView(); + Evas_Object *GetEvasObject(){return world_clock_;}; + + private: + Evas_Object *world_clock_; + }; + } +} + + +#endif /* WORLDCLOCKVIEW_H_ */ diff --git a/clock/inc/clock.h b/clock/inc/clock.h deleted file mode 100644 index 458e504..0000000 --- a/clock/inc/clock.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __clock_H__ -#define __clock_H__ - -#include -#include -#include -#include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "clock" - -#if !defined(PACKAGE) -#define PACKAGE "org.tizen.clock" -#endif - -#define EDJ_FILE "edje/clock.edj" -#define GRP_MAIN "main" - - -#endif /* __clock_H__ */ diff --git a/clock/inc/log.h b/clock/inc/log.h new file mode 100644 index 0000000..06ed9a7 --- /dev/null +++ b/clock/inc/log.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009-2014 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 __LOG_H__ +#define __LOG_H__ + +#include +#include + +/** + * @addtogroup Utils + * @{ + */ + +#ifdef LOG_TAG + #undef LOG_TAG +#endif + +#define LOG_TAG "CLOCK" + +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + +#if !defined(DBG) +#define DBG(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg) +#endif + +#if !defined(WRN) +#define WRN(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg) +#endif + +#if !defined(ERR) +#define ERR(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg) +#endif + +#if !defined(INF) +#define INF(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg) +#endif + +#if !defined(FATAL) +#define FAT(fmt, arg...) dlog_print(DLOG_FATAL, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg); +#endif + +#undef _ +#define _(str) i18n_get_text(str) + +/** + * @} + */ + +#endif diff --git a/clock/project_def.prop b/clock/project_def.prop index 8af2a10..225bbf4 100644 --- a/clock/project_def.prop +++ b/clock/project_def.prop @@ -9,8 +9,8 @@ type = app profile = mobile-3.0 # C Sources -USER_SRCS = src/Clock.c src/Utils.cpp -USER_SRCS_ABS = +USER_SRCS = src/*.cpp src/Controller/*.cpp src/View/*.cpp +USER_SRCS_ABS = # EDC Sources USER_EDCS = @@ -27,23 +27,23 @@ USER_UNDEFS = USER_CPP_UNDEFS = # User Libraries -USER_LIBS = org.tizen.clock +USER_LIBS = # User Objects -USER_OBJS = +USER_OBJS = USER_OBJS_ABS = # User Includes ## C Compiler -USER_INC_DIRS = $(workspace_loc)/common/inc inc +USER_INC_DIRS = inc/ USER_INC_DIRS_ABS = USER_INC_FILES = USER_INC_FILES_ABS = ## C++ Compiler -USER_CPP_INC_DIRS = +USER_CPP_INC_DIRS = USER_CPP_INC_DIRS_ABS = -USER_CPP_INC_FILES = -USER_CPP_INC_FILES_ABS = +USER_CPP_INC_FILES = +USER_CPP_INC_FILES_ABS = # User Library Path USER_LIB_DIRS = $(workspace_loc)/common/${BUILD_CONFIG} diff --git a/clock/res/edje/clock.edc b/clock/res/edje/clock.edc index 083dc42..130b2be 100644 --- a/clock/res/edje/clock.edc +++ b/clock/res/edje/clock.edc @@ -1,13 +1,8 @@ collections { group { name: "main"; parts { - part { name: "txt_title"; - type: TEXT; - mouse_events: 0; - description { state: "default" 0.0; - text { text: "Hello Tizen"; font: "Tizen:style=regular"; size: 20; min: 1 1; align: 0.5 0; ellipsis: -1; } - color: 0 0 0 255; - } + part { name: "bg"; + type: SWALLOW; } } } diff --git a/clock/res/edje/images/tabs/clock_tabs_ic_alarm.png b/clock/res/edje/images/tabs/clock_tabs_ic_alarm.png new file mode 100644 index 0000000..d3588c9 Binary files /dev/null and b/clock/res/edje/images/tabs/clock_tabs_ic_alarm.png differ diff --git a/clock/res/edje/images/tabs/clock_tabs_ic_stopwatch.png b/clock/res/edje/images/tabs/clock_tabs_ic_stopwatch.png new file mode 100644 index 0000000..c472e9d Binary files /dev/null and b/clock/res/edje/images/tabs/clock_tabs_ic_stopwatch.png differ diff --git a/clock/res/edje/images/tabs/clock_tabs_ic_timer.png b/clock/res/edje/images/tabs/clock_tabs_ic_timer.png new file mode 100644 index 0000000..59bef47 Binary files /dev/null and b/clock/res/edje/images/tabs/clock_tabs_ic_timer.png differ diff --git a/clock/res/edje/images/tabs/clock_tabs_ic_worldclock.png b/clock/res/edje/images/tabs/clock_tabs_ic_worldclock.png new file mode 100644 index 0000000..a8f3187 Binary files /dev/null and b/clock/res/edje/images/tabs/clock_tabs_ic_worldclock.png differ diff --git a/clock/src/Clock.cpp b/clock/src/Clock.cpp new file mode 100644 index 0000000..7914a85 --- /dev/null +++ b/clock/src/Clock.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2016 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 + +#include "log.h" +#include "app.h" +#include "Clock.h" +#include "Controller/MainController.h" + +using namespace worldclock::controller; + + +static bool +app_create(void *data) +{ + /* Hook to take necessary actions before main event loop starts + Initialize UI resources and application's data + If this function returns true, the main loop of application starts + If this function returns false, the application is terminated */ + + DBG("app_create"); + MainController::GetInstance().Init(); + + return true; +} + +static void +app_control(app_control_h app_control, void *data) +{ + /* Handle the launch request. */ +} + +static void +app_pause(void *data) +{ + /* Take necessary actions when application becomes invisible. */ + MainController::GetInstance().Pause(); +} + +static void +app_resume(void *data) +{ + /* Take necessary actions when application becomes visible. */ + MainController::GetInstance().Resume(); +} + +static void +app_terminate(void *data) +{ + /* Release all resources. */ + MainController::GetInstance().Deinit(); +} + +static void +ui_app_lang_changed(app_event_info_h event_info, void *user_data) +{ + /*APP_EVENT_LANGUAGE_CHANGED*/ + + int ret; + char *language; + + ret = app_event_get_language(event_info, &language); + if (ret != APP_ERROR_NONE) { + dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret); + return; + } + + if (language != NULL) { + elm_language_set(language); + free(language); + } +} + +static void +ui_app_orient_changed(app_event_info_h event_info, void *user_data) +{ + /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/ + return; +} + +static void +ui_app_region_changed(app_event_info_h event_info, void *user_data) +{ + /*APP_EVENT_REGION_FORMAT_CHANGED*/ +} + +static void +ui_app_low_battery(app_event_info_h event_info, void *user_data) +{ + /*APP_EVENT_LOW_BATTERY*/ +} + +static void +ui_app_low_memory(app_event_info_h event_info, void *user_data) +{ + /*APP_EVENT_LOW_MEMORY*/ +} + +int +main(int argc, char *argv[]) +{ + int ret = 0; + + ui_app_lifecycle_callback_s event_callback = {0,}; + app_event_handler_h handlers[5] = {NULL, }; + + event_callback.create = app_create; + event_callback.terminate = app_terminate; + event_callback.pause = app_pause; + event_callback.resume = app_resume; + event_callback.app_control = app_control; + + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, NULL); + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, NULL); + ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, NULL); + ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, NULL); + ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, NULL); + + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) + dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret); + + return ret; +} diff --git a/clock/src/Controller/MainController.cpp b/clock/src/Controller/MainController.cpp new file mode 100644 index 0000000..cc6e806 --- /dev/null +++ b/clock/src/Controller/MainController.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016 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 "log.h" +#include "View/MainView.h" +#include "Controller/MainController.h" + +using namespace worldclock::controller; +using namespace worldclock::view; + +MainController &MainController::GetInstance() +{ + static MainController instance; + return instance; +} + +MainController::~MainController() +{ + +} + +void MainController::Pause() +{ + +} + +void MainController::Resume() +{ + +} + +int MainController::Init() +{ + DBG("Init()"); + + MainView::GetInstance(); + MainView::GetInstance().CreateContent(); + + return 0; +} + +void MainController::Deinit() +{ + +} diff --git a/clock/src/View/AlarmView.cpp b/clock/src/View/AlarmView.cpp new file mode 100644 index 0000000..8fb6f09 --- /dev/null +++ b/clock/src/View/AlarmView.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 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 "View/AlarmView.h" +#include "View/MainView.h" +#include "Utils.h" + +using namespace worldclock::view; +using namespace common::utils; + +AlarmView::AlarmView() +{ + /*Create content here and use main_layout_ as a parent*/ + + /*Temporary Code*/ + alarm_ = elm_layout_add(MainView::GetInstance().GetEvasObject()); + + elm_layout_file_set(alarm_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main"); + + evas_object_size_hint_align_set(alarm_, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(alarm_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object *label = elm_label_add(alarm_); + + elm_object_text_set(label, "Alarm"); + elm_layout_content_set(alarm_, "bg", label); +} diff --git a/clock/src/View/MainView.cpp b/clock/src/View/MainView.cpp new file mode 100644 index 0000000..e0866dc --- /dev/null +++ b/clock/src/View/MainView.cpp @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2016 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 +#include +#include + +#include "View/AlarmView.h" +#include "View/StopWatchView.h" +#include "View/TimerView.h" +#include "View/WorldClockView.h" + +#include "View/MainView.h" +#include "Clock.h" +#include "Utils.h" +#include "log.h" + +using namespace worldclock::view; +using namespace common::utils; + + +static void WinDeleteRequestCb(void *data, Evas_Object *obj, void *event_info) +{ + ui_app_exit(); +} + +static Eina_Bool naviframe_pop_cb(void *data, Elm_Object_Item *it) +{ + PageView *page = static_cast(data); + + ui_app_exit(); + return EINA_FALSE; +} + +void toolbar_it_cb (void *data, Evas_Object *obj, void *event_info) +{ + PageView *page = static_cast(data); + + /*TODO + * Send data refresh request + * e.g. page->RefreshContent(); + */ + + Evas_Object *layout = elm_object_parent_widget_get(obj); + Evas_Object *navi = elm_object_parent_widget_get(layout); + Elm_Naviframe_Item *top = elm_naviframe_top_item_get(navi); + + elm_naviframe_item_style_set(top, "tabbar/icon/notitle"); + + Evas_Object *prev = elm_object_item_content_unset(top); + evas_object_hide(prev); + evas_object_show(page->GetEvasObject()); + elm_object_item_content_set(top, page->GetEvasObject()); +} + + +MainView &MainView::GetInstance() +{ + static MainView instance; + return instance; +} + +MainView::MainView() +{ + DBG("CreateBaseGui()"); + + window_ = elm_win_add(NULL, "CLOCK", ELM_WIN_BASIC); + if (!window_) + ERR("Window is NULL"); /*TODO use C++ logging function when it will be implemented*/ + + elm_win_alpha_set(window_, EINA_TRUE); + elm_win_conformant_set(window_, EINA_TRUE); + elm_win_autodel_set(window_, EINA_TRUE); + elm_win_indicator_mode_set(window_, ELM_WIN_INDICATOR_SHOW); + elm_win_indicator_opacity_set(window_, ELM_WIN_INDICATOR_OPAQUE); + + evas_object_smart_callback_add(window_, "delete,request", WinDeleteRequestCb, NULL); + + ConformantAdd(); + NaviframeAdd(); + + evas_object_show(window_); + +} + +MainView::~MainView() +{ +} + +void MainView::ConformantAdd() +{ + conformant_ = elm_conformant_add(window_); + evas_object_size_hint_weight_set(conformant_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(conformant_, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_win_resize_object_add(window_, conformant_); + + evas_object_show(conformant_); + +} + + +void MainView::NaviframeAdd() +{ + naviframe_ = elm_naviframe_add(conformant_); + elm_naviframe_prev_btn_auto_pushed_set(naviframe_, EINA_TRUE); + elm_naviframe_content_preserve_on_pop_set(naviframe_, EINA_TRUE); + + eext_object_event_callback_add(naviframe_, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); + eext_object_event_callback_add(naviframe_, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL); + + evas_object_show(naviframe_); + + Evas_Object *indicator_bg_box; + indicator_bg_box = elm_box_add(naviframe_); + evas_object_size_hint_weight_set(indicator_bg_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(indicator_bg_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(conformant_, "elm.swallow.indicator_bg", indicator_bg_box); + + elm_object_content_set(conformant_, naviframe_); + + DBG("NaviframeAdd END"); +} + + +void MainView::CreatePages() +{ + alarm_ = new AlarmView(); + world_clock_ = new WorldClockView(); + stop_watch_ = new StopWatchView(); + timer_ = new TimerView(); +} + + +void MainView::CreateToolbarButtons() +{ + elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, + "edje/images/tabs/clock_tabs_ic_alarm.png"), + "Alarm", toolbar_it_cb, alarm_); + elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, + "edje/images/tabs/clock_tabs_ic_worldclock.png"), + "World clock", toolbar_it_cb, world_clock_); + elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, + "edje/images/tabs/clock_tabs_ic_stopwatch.png"), + "Stopwatch", toolbar_it_cb, stop_watch_); + elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, + "edje/images/tabs/clock_tabs_ic_timer.png"), + "Timer", toolbar_it_cb, timer_); +} + +void MainView::CreateToolbar() +{ + toolbar_ = elm_toolbar_add(naviframe_); + elm_object_style_set(toolbar_, "tabbar"); + elm_toolbar_shrink_mode_set(toolbar_, ELM_TOOLBAR_SHRINK_EXPAND); + elm_toolbar_transverse_expanded_set(toolbar_, EINA_TRUE); + + CreateToolbarButtons(); + + elm_toolbar_select_mode_set(toolbar_, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_show(toolbar_); + +} + +void MainView::CreateContent() +{ + CreatePages(); + CreateToolbar(); + + Elm_Object_Item *item = elm_naviframe_item_push(naviframe_, NULL, NULL, NULL, NULL, + "tabbar/icon/notitle"); + + elm_naviframe_item_pop_cb_set(item, naviframe_pop_cb, window_); + + elm_object_item_part_content_set(item, "tabbar", toolbar_); + evas_object_show(alarm_->GetEvasObject()); + elm_object_item_content_set(item, alarm_->GetEvasObject()); + +} + +Evas_Object *MainView::GetEvasObject() +{ + return naviframe_; +} + diff --git a/clock/src/View/PageView.cpp b/clock/src/View/PageView.cpp new file mode 100644 index 0000000..43aae18 --- /dev/null +++ b/clock/src/View/PageView.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016 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 "Elementary.h" +#include "View/MainView.h" +#include "View/PageView.h" +#include "Utils.h" +#include "dlog.h" + +#include + +using namespace worldclock::view; +using namespace common::utils; + +PageView::PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content) : + title_label_(title_label), left_button_(left_button), right_button_(right_button), content_(content) +{ + PushNewNaviPage(); + + if (title_label_) + elm_object_item_part_text_set(subpage_, "elm.text.title", title_label_); + + if (left_button_) + elm_object_item_part_content_set(subpage_, "title_left_btn", left_button_); + + if (right_button_) + elm_object_item_part_content_set(subpage_, "title_right_btn", right_button_); + + if (content_) + elm_object_item_content_set(subpage_, content_); +} + +PageView::~PageView() +{ + elm_naviframe_item_pop(subpage_); +} + +Evas_Object *PageView::GetEvasObject() +{ + return content_; +} + +void PageView::PushNewNaviPage() +{ + subpage_ = elm_naviframe_item_push(MainView::GetInstance().GetEvasObject(), NULL, NULL, NULL, NULL, NULL); +} diff --git a/clock/src/View/StopWatchView.cpp b/clock/src/View/StopWatchView.cpp new file mode 100644 index 0000000..ee84c1f --- /dev/null +++ b/clock/src/View/StopWatchView.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 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 "View/StopWatchView.h" +#include "View/MainView.h" +#include "Utils.h" + +using namespace worldclock::view; +using namespace common::utils; + +StopWatchView::StopWatchView() +{ + /*Create content here and use main_layout_ as a parent*/ + + /*Temporary Code*/ + stopwatch_ = elm_layout_add(MainView::GetInstance().GetEvasObject()); + + elm_layout_file_set(stopwatch_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main"); + + evas_object_size_hint_align_set(stopwatch_, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(stopwatch_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object *label = elm_label_add(stopwatch_); + + elm_object_text_set(label, "Stop Watch"); + elm_layout_content_set(stopwatch_, "bg", label); +} diff --git a/clock/src/View/TimerView.cpp b/clock/src/View/TimerView.cpp new file mode 100644 index 0000000..09326da --- /dev/null +++ b/clock/src/View/TimerView.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2016 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 "View/TimerView.h" +#include "View/MainView.h" +#include "Utils.h" + +using namespace worldclock::view; +using namespace common::utils; + + +TimerView::TimerView() +{ + /*Create content here and use main_layout_ as a parent*/ + + /*Temporary Code*/ + timer_ = elm_layout_add(MainView::GetInstance().GetEvasObject()); + + elm_layout_file_set(timer_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main"); + + evas_object_size_hint_align_set(timer_, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(timer_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object *label = elm_label_add(timer_); + + elm_object_text_set(label, "Timer"); + elm_layout_content_set(timer_, "bg", label); +} + diff --git a/clock/src/View/WorldClockView.cpp b/clock/src/View/WorldClockView.cpp new file mode 100644 index 0000000..76dd05f --- /dev/null +++ b/clock/src/View/WorldClockView.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016 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 "View/WorldClockView.h" +#include "View/MainView.h" +#include "Utils.h" + +using namespace worldclock::view; +using namespace common::utils; + +WorldClockView::WorldClockView() +{ + /*Create content here and use main_layout_ as a parent*/ + + /*Temporary Code*/ + world_clock_ = elm_layout_add(MainView::GetInstance().GetEvasObject()); + + elm_layout_file_set(world_clock_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main"); + + evas_object_size_hint_align_set(world_clock_, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(world_clock_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object *label = elm_label_add(world_clock_); + + elm_object_text_set(label, "World Clock"); + elm_layout_content_set(world_clock_, "bg", label); +} + diff --git a/clock/src/clock.c b/clock/src/clock.c deleted file mode 100644 index 27bb255..0000000 --- a/clock/src/clock.c +++ /dev/null @@ -1,188 +0,0 @@ -#include "clock.h" - -typedef struct appdata{ - Evas_Object* win; - Evas_Object* layout; - Evas_Object* conform; -} appdata_s; - -static void -win_delete_request_cb(void *data, Evas_Object *obj, void *event_info) -{ - ui_app_exit(); -} - -static void -layout_back_cb(void *data, Evas_Object *obj, void *event_info) -{ - appdata_s *ad = data; - /* Let window go to hide state. */ - elm_win_lower(ad->win); -} - -static void -app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max) -{ - char *res_path = app_get_resource_path(); - if (res_path) { - snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in); - free(res_path); - } -} - -static void -create_base_gui(appdata_s *ad) -{ - char edj_path[PATH_MAX] = {0, }; - - /* Window */ - /* Create and initialize elm_win. - elm_win is mandatory to manipulate window. */ - ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); - elm_win_conformant_set(ad->win, EINA_TRUE); - elm_win_autodel_set(ad->win, EINA_TRUE); - - if (elm_win_wm_rotation_supported_get(ad->win)) { - int rots[4] = { 0, 90, 180, 270 }; - elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); - } - - evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); - - /* Conformant */ - /* Create and initialize elm_conformant. - elm_conformant is mandatory for base gui to have proper size - when indicator or virtual keypad is visible. */ - ad->conform = elm_conformant_add(ad->win); - elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); - elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE); - evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->win, ad->conform); - evas_object_show(ad->conform); - - /* Base Layout */ - /* Create an actual view of the base gui. - Modify this part to change the view. */ - app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX); - ad->layout = elm_layout_add(ad->win); - elm_layout_file_set(ad->layout, edj_path, GRP_MAIN); - evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad); - elm_object_content_set(ad->conform, ad->layout); - - /* Show window after base gui is set up */ - evas_object_show(ad->win); - -} - -static bool -app_create(void *data) -{ - /* Hook to take necessary actions before main event loop starts - Initialize UI resources and application's data - If this function returns true, the main loop of application starts - If this function returns false, the application is terminated */ - appdata_s *ad = data; - - create_base_gui(ad); - - return true; -} - -static void -app_control(app_control_h app_control, void *data) -{ - /* Handle the launch request. */ -} - -static void -app_pause(void *data) -{ - /* Take necessary actions when application becomes invisible. */ -} - -static void -app_resume(void *data) -{ - /* Take necessary actions when application becomes visible. */ -} - -static void -app_terminate(void *data) -{ - /* Release all resources. */ -} - -static void -ui_app_lang_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LANGUAGE_CHANGED*/ - - int ret; - char *language; - - ret = app_event_get_language(event_info, &language); - if (ret != APP_ERROR_NONE) { - dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret); - return; - } - - if (language != NULL) { - elm_language_set(language); - free(language); - } -} - -static void -ui_app_orient_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/ - return; -} - -static void -ui_app_region_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_REGION_FORMAT_CHANGED*/ -} - -static void -ui_app_low_battery(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LOW_BATTERY*/ -} - -static void -ui_app_low_memory(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LOW_MEMORY*/ -} - -int -main(int argc, char *argv[]) -{ - appdata_s ad = {0,}; - int ret = 0; - - ui_app_lifecycle_callback_s event_callback = {0,}; - app_event_handler_h handlers[5] = {NULL, }; - - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.pause = app_pause; - event_callback.resume = app_resume; - event_callback.app_control = app_control; - - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad); - - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) { - dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret); - } - - return ret; -} diff --git a/common/inc/UI/View.h b/common/inc/UI/View.h deleted file mode 100644 index 857af53..0000000 --- a/common/inc/UI/View.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _CLOCK_UI_VIEW_H_ -#define _CLOCK_UI_VIEW_H_ - -#include - -namespace clock { -namespace ui { - class IView { - public: - virtual Evas_Object *GetEvasObject() = 0; - }; -}; -}; - -#endif