From: Hermet Park Date: Mon, 28 Nov 2016 10:15:07 +0000 (+0900) Subject: remove all FIXME in the exmaples. X-Git-Tag: accepted/tizen/3.0/common/20161203.012419~3^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51651cdc603924760163b4455c4ae138d108728d;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git remove all FIXME in the exmaples. and replace the folder name from data to res. Change-Id: I68a32680fba3cca3baa71a9cab02aff4fe09bb9d --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e332a10..fe34690 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ SET(EDJDIR "/usr/share/edje/${LIBNAME}") SET(BINNAME ui.viewmgr.demo) SET(BINDIR /usr/apps/${BINNAME}) -SET(IMGDIR ${BINDIR}/data/images) +SET(IMGDIR ${BINDIR}/res/images) SET(ICONDIR ${BINDIR}/shared/res) SET(CMAKE_SKIP_BUILD_RPATH TRUE) @@ -46,19 +46,19 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pc/${LIBNAME}.pc DESTINATION ${LIBDIR} #edj file ADD_CUSTOM_TARGET(${LIBNAME}.edj - COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/edc - ${CMAKE_SOURCE_DIR}/data/edc/${LIBNAME}.edc ${CMAKE_BINARY_DIR}/data/edc/${LIBNAME}.edj - DEPENDS ${CMAKE_SOURCE_DIR}/data/edc/${LIBNAME}.edc + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/edc + ${CMAKE_SOURCE_DIR}/res/edc/${LIBNAME}.edc ${CMAKE_BINARY_DIR}/res/edc/${LIBNAME}.edj + DEPENDS ${CMAKE_SOURCE_DIR}/res/edc/${LIBNAME}.edc ) ADD_DEPENDENCIES(${LIBNAME} ${LIBNAME}.edj) -INSTALL(FILES ${CMAKE_BINARY_DIR}/data/edc/${LIBNAME}.edj DESTINATION ${EDJDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/res/edc/${LIBNAME}.edj DESTINATION ${EDJDIR}) #xml file CONFIGURE_FILE(${BINNAME}.xml.in ${BINNAME}.xml @ONLY) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${BINNAME}.xml DESTINATION /usr/share/packages/) #image file -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION ${IMGDIR} FILES_MATCHING PATTERN "*.png") +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMGDIR} FILES_MATCHING PATTERN "*.png") #icon file INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/shared/res/ DESTINATION ${ICONDIR} FILES_MATCHING PATTERN "*.png") diff --git a/packaging/ui-viewmgr.spec b/packaging/ui-viewmgr.spec index 3ddae03..1f0f374 100644 --- a/packaging/ui-viewmgr.spec +++ b/packaging/ui-viewmgr.spec @@ -73,7 +73,7 @@ cp %{_builddir}/%{buildsubdir}/LICENSE %{buildroot}/usr/share/license/%{name} %{_datadir}/packages/ui.viewmgr.demo.xml %manifest ui.viewmgr.demo.manifest /usr/apps/ui.viewmgr.demo/bin/* -/usr/apps/ui.viewmgr.demo/data/images/* +/usr/apps/ui.viewmgr.demo/res/images/* /usr/apps/ui.viewmgr.demo/shared/res/* %files devel diff --git a/data/edc/images/core_icon_badge_container.#.png b/res/edc/images/core_icon_badge_container.#.png similarity index 100% rename from data/edc/images/core_icon_badge_container.#.png rename to res/edc/images/core_icon_badge_container.#.png diff --git a/data/edc/images/core_theme_bg_01.png b/res/edc/images/core_theme_bg_01.png similarity index 100% rename from data/edc/images/core_theme_bg_01.png rename to res/edc/images/core_theme_bg_01.png diff --git a/data/edc/ui-viewmgr.edc b/res/edc/ui-viewmgr.edc similarity index 100% rename from data/edc/ui-viewmgr.edc rename to res/edc/ui-viewmgr.edc diff --git a/data/images/bg.png b/res/images/bg.png similarity index 100% rename from data/images/bg.png rename to res/images/bg.png diff --git a/data/images/icon_alarm.png b/res/images/icon_alarm.png similarity index 100% rename from data/images/icon_alarm.png rename to res/images/icon_alarm.png diff --git a/data/images/icon_timer.png b/res/images/icon_timer.png similarity index 100% rename from data/images/icon_timer.png rename to res/images/icon_timer.png diff --git a/data/images/icon_worldclock.png b/res/images/icon_worldclock.png similarity index 100% rename from data/images/icon_worldclock.png rename to res/images/icon_worldclock.png diff --git a/data/images/tizen.png b/res/images/tizen.png similarity index 100% rename from data/images/tizen.png rename to res/images/tizen.png diff --git a/src/examples/efl/c/contents.cpp b/src/examples/efl/c/contents.cpp index 24cf684..0342c19 100644 --- a/src/examples/efl/c/contents.cpp +++ b/src/examples/efl/c/contents.cpp @@ -1,3 +1,20 @@ +/* + * 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 "main.h" Eo* @@ -31,7 +48,14 @@ create_landscape_content(Eo *parent, const char *text, Evas_Smart_Cb prev_btn_cl /* Image */ image = elm_image_add(grid); - snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR); + + char *res_path = app_get_resource_path(); + if (res_path) + { + snprintf(buf, sizeof(buf), "%s%s", res_path, "images/tizen.png"); + free(res_path); + } + elm_image_file_set(image, buf, NULL); evas_object_show(image); elm_grid_pack(grid, image, 50, 0, 50, 85); @@ -234,7 +258,14 @@ create_scrolling_content(Eo *parent) /* Image */ image = elm_image_add(parent); - snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR); + + char *res_path = app_get_resource_path(); + if (res_path) + { + snprintf(buf, sizeof(buf), "%s%s", res_path, "images/bg.png"); + free(res_path); + } + elm_image_file_set(image, buf, NULL); elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE); evas_object_show(image); @@ -249,13 +280,8 @@ create_toolbar(Eo *parent, const char *style) toolbar = elm_toolbar_add(parent); - //FIXME: :( UI_View can set this style instead. elm_object_style_set(toolbar, style); - //FIXME: If not call below API, toolbar items create with min size. - // It looks toolbar bug. - elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); - elm_toolbar_item_append(toolbar, NULL, "Tab1", NULL, NULL); elm_toolbar_item_append(toolbar, NULL, "Tab2", NULL, NULL); elm_toolbar_item_append(toolbar, NULL, "Tab3", NULL, NULL); diff --git a/src/examples/efl/c/main.cpp b/src/examples/efl/c/main.cpp index 82ee7c4..f829b87 100644 --- a/src/examples/efl/c/main.cpp +++ b/src/examples/efl/c/main.cpp @@ -1,3 +1,20 @@ +/* + * 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 "main.h" static bool diff --git a/src/examples/efl/c/page1.cpp b/src/examples/efl/c/page1.cpp index e110030..a5ffb21 100644 --- a/src/examples/efl/c/page1.cpp +++ b/src/examples/efl/c/page1.cpp @@ -20,11 +20,10 @@ static void prev_btn_clicked_cb(void *data, Eo *obj, void *event_info) { - //FIXME: deactivate??? or ui_app deactivate??? or ui_viewmgr pop??? - int ret = ui_viewmgr_pop_view(); + int ret = ui_viewmgr_deactivate(); if (ret != UI_VIEWMGR_ERROR_NONE) { - dlog_print(DLOG_ERROR, LOG_TAG, "ui_viewmgr_pop_view() is failed. err = %d", ret); + dlog_print(DLOG_ERROR, LOG_TAG, "ui_viewmgr_deactivate() is failed. err = %d", ret); } } diff --git a/src/examples/efl/cpp/contents.cpp b/src/examples/efl/cpp/contents.cpp index c25fe55..9fa3ee8 100644 --- a/src/examples/efl/cpp/contents.cpp +++ b/src/examples/efl/cpp/contents.cpp @@ -23,13 +23,8 @@ createToolbar(Eo *parent, const char *style) toolbar = elm_toolbar_add(parent); - //FIXME: :( UiView can set this style instead. elm_object_style_set(toolbar, style); - //FIXME: If not call below API, toolbar items create with min size. - // It looks toolbar bug. - elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); - elm_toolbar_item_append(toolbar, nullptr, "Tab1", nullptr, nullptr); elm_toolbar_item_append(toolbar, nullptr, "Tab2", nullptr, nullptr); elm_toolbar_item_append(toolbar, nullptr, "Tab3", nullptr, nullptr); @@ -46,7 +41,14 @@ createScrollingContent(Eo *parent) /* Image */ image = elm_image_add(parent); - snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR); + + char *res_path = app_get_resource_path(); + if (res_path) + { + snprintf(buf, sizeof(buf), "%s%s", res_path, "images/bg.png"); + free(res_path); + } + elm_image_file_set(image, buf, nullptr); elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE); evas_object_show(image); @@ -85,7 +87,14 @@ createLandscapeContent(Eo *parent, const char *text, Evas_Smart_Cb _prevBtnClick /* Image */ image = elm_image_add(grid); - snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR); + + char *res_path = app_get_resource_path(); + if (res_path) + { + snprintf(buf, sizeof(buf), "%s%s", res_path, "images/tizen.png"); + free(res_path); + } + elm_image_file_set(image, buf, nullptr); evas_object_show(image); elm_grid_pack(grid, image, 50, 0, 50, 85); diff --git a/src/examples/efl/cpp/page1.h b/src/examples/efl/cpp/page1.h index 3e225fc..a15d562 100644 --- a/src/examples/efl/cpp/page1.h +++ b/src/examples/efl/cpp/page1.h @@ -31,7 +31,7 @@ protected: //Prev Button Callback [](void *data, Eo *obj, void *event_info) { - UI_VIEWMGR->popView(); + UI_VIEWMGR->deactivate(); }, //Next Button Callback [](void *data, Eo *obj, void *event_info)