From 17e1e88ac47e64a59254f3ebb618e15336918b0c Mon Sep 17 00:00:00 2001 From: Jin Yoon Date: Mon, 10 Dec 2012 11:02:58 +0900 Subject: [PATCH] Code sync Change-Id: I3719865d85cdd50841d90cd82436da2c8dc1ae25 --- CMakeLists.txt | 5 +- data/CMakeLists.txt | 2 +- data/edje/all_apps_portrait.edc | 12 +-- data/org.tizen.menu-screen.xml.in | 2 +- debian/changelog | 9 +++ debian/org.tizen.menu-screen.postinst | 6 +- include/layout.h | 2 +- include/menu_screen.h | 1 - include/util.h | 9 +++ org.tizen.menu-screen.manifest | 5 +- packaging/org.tizen.menu-screen.spec | 50 ++++++------ src/all_apps/layout.c | 3 + src/all_apps/list.c | 6 +- src/index.c | 1 + src/item.c | 24 +++--- src/item_event.c | 20 ++--- src/layout.c | 65 +++++++++------- src/list.c | 6 +- src/menu_screen.c | 105 +++++++++++++++----------- src/page.c | 5 ++ src/page_scroller.c | 41 ++-------- src/pkgmgr.c | 2 +- src/popup.c | 3 + 23 files changed, 209 insertions(+), 175 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c437bc..8c43f40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(menu-screen C) SET(PACKAGE_NAME "org.tizen.${PROJECT_NAME}") -SET(PREFIX "/opt/apps/${PACKAGE_NAME}") +SET(PREFIX "/usr/apps/${PACKAGE_NAME}") SET(EXEC_PREFIX "${PREFIX}/bin") SET(LIBDIR "${PREFIX}/lib") -SET(DATADIR "${PREFIX}/data") +SET(DATADIR "/opt${PREFIX}/data") SET(RESDIR "${PREFIX}/res") SET(IMAGEDIR "${RESDIR}/images") SET(EDJEDIR "${RESDIR}/edje") @@ -79,6 +79,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MENU_PKGS_LDFLAGS}) # Install INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${EXEC_PREFIX}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME ${PACKAGE_NAME}) ADD_SUBDIRECTORY(data) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index e743f02..dcc6f83 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(MANIFESTDIR "/opt/share/packages") +SET(MANIFESTDIR "/usr/share/packages") # manifest CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml) diff --git a/data/edje/all_apps_portrait.edc b/data/edje/all_apps_portrait.edc index 8f8634c..5534e0f 100644 --- a/data/edje/all_apps_portrait.edc +++ b/data/edje/all_apps_portrait.edc @@ -40,8 +40,8 @@ collections { mouse_events: 0; description { state: "default" 0.0; - rel1 { relative: 0.0 70/1280; to, "bg";} - rel2 { relative: 1.0 174/1280; to, "bg";} + rel1 { relative: 0.0 0/1210; to, "bg";} // 1280 - 70(indicator) + rel2 { relative: 1.0 104/1210; to, "bg";} // 174 - 70 color: 0 0 0 255; visible: 0; } @@ -53,8 +53,8 @@ collections { description { state: "default" 0.0; align: 0.5 0.5; - rel1 { relative: 0.0 0.0; to, "index_bg";} - rel2 { relative: 1.0 1.0; to, "index_bg";} + rel1 { relative: 0.2 0.0; to, "index_bg";} + rel2 { relative: 0.8 1.0; to, "index_bg";} visible: 1; } } @@ -66,8 +66,8 @@ collections { mouse_events: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 154/1280; to, "bg"; } - rel2 { relative: 1.0 1214/1280; to, "bg"; } + rel1 { relative: 0.0 84/1210; to, "bg"; } // 154 - 70 + rel2 { relative: 1.0 1144/1210; to, "bg"; } color: 34 34 34 255; visible: 0; } diff --git a/data/org.tizen.menu-screen.xml.in b/data/org.tizen.menu-screen.xml.in index 864d1ae..0af9fb6 100755 --- a/data/org.tizen.menu-screen.xml.in +++ b/data/org.tizen.menu-screen.xml.in @@ -1,5 +1,5 @@ - + Jin Yoon Youngjoo Park diff --git a/debian/changelog b/debian/changelog index ced47da..b397018 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +org.tizen.menu-screen (1.0.17) unstable; urgency=low + + * Git: apps/home/menu-screen + * Tag: menu-screen_1.0.17 + + * Code sync + + -- Jin Yoon Thu, 06 Dec 2012 16:56:25 +0900 + org.tizen.menu-screen (1.0.15) unstable; urgency=low * Git: apps/home/menu-screen diff --git a/debian/org.tizen.menu-screen.postinst b/debian/org.tizen.menu-screen.postinst index e16c323..f131902 100644 --- a/debian/org.tizen.menu-screen.postinst +++ b/debian/org.tizen.menu-screen.postinst @@ -4,11 +4,9 @@ INHOUSE_ID="5000" init_vconf() { - # for menu daemon - vconftool set -t int memory/menu-screen/is_menu_screen_done 0 -i -f - - # for menu-screen vconftool set -t int memory/idle-screen/top 0 -i -u 5000 -f + vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -i -u 5000 -f + vconftool set -t int memory/menu-screen/is_menu_screen_done 0 -i -f vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -u 5000 -f } diff --git a/include/layout.h b/include/layout.h index 8dc322d..912d1ca 100644 --- a/include/layout.h +++ b/include/layout.h @@ -22,7 +22,7 @@ #include #include "util.h" -extern Evas_Object *layout_create(Evas_Object *win, const char *file, const char *group, int rotate); +extern Evas_Object *layout_create(Evas_Object *conformant, const char *file, const char *group, int rotate); extern void layout_destroy(Evas_Object *layout); extern void layout_enable_block(Evas_Object *layout); diff --git a/include/menu_screen.h b/include/menu_screen.h index 21ee408..ad51232 100644 --- a/include/menu_screen.h +++ b/include/menu_screen.h @@ -25,7 +25,6 @@ extern int menu_screen_get_root_width(void); extern int menu_screen_get_root_height(void); -extern double menu_screen_get_yscale(void); extern Evas *menu_screen_get_evas(void); extern Evas_Object *menu_screen_get_win(void); extern Elm_Theme *menu_screen_get_theme(void); diff --git a/include/util.h b/include/util.h index 68d6e66..9d93f62 100644 --- a/include/util.h +++ b/include/util.h @@ -48,6 +48,15 @@ #define _T(package) LOG(LOG_DEBUG, "LAUNCH", "[%s:Menuscreen:launch:done]", package); #endif +/* Multi-language */ +#ifndef _ +#define _(str) gettext(str) +#endif + +#define gettext_noop(str) (str) +#define N_(str) gettext_noop(str) +#define D_(str) dgettext("sys_string", str) + #ifdef APPFWK_MEASUREMENT #define PRINT_APPFWK() do { \ struct timeval tv; \ diff --git a/org.tizen.menu-screen.manifest b/org.tizen.menu-screen.manifest index 812f7c7..f418e82 100644 --- a/org.tizen.menu-screen.manifest +++ b/org.tizen.menu-screen.manifest @@ -5,7 +5,7 @@ - + @@ -16,4 +16,7 @@ + + + diff --git a/packaging/org.tizen.menu-screen.spec b/packaging/org.tizen.menu-screen.spec index 50ddee2..728d6f7 100644 --- a/packaging/org.tizen.menu-screen.spec +++ b/packaging/org.tizen.menu-screen.spec @@ -1,10 +1,20 @@ %define _optdir /opt -%define _appdir %{_optdir}/apps -%define _opt_datadir %{_optdir}/share +%define _usrdir /usr +%define _appdir %{_usrdir}/apps +%define _usr_datadir %{_usrdir}/share + +%define _project_name menu-screen +%define _package_name org.tizen.%{_project_name} + +%define _packagedir %{_appdir}/%{_package_name} +%define _bindir %{_packagedir}/bin +%define _datadir %{_optdir}%{_packagedir}/data +%define _resdir %{_packagedir}/res +%define _sharedir %{_packagedir}/share Name: org.tizen.menu-screen Summary: An utility library of the menu screen -Version: 1.0.16 +Version: 1.0.17 Release: 1.1 Group: TO_BE/FILLED_IN License: Flora Software License @@ -53,25 +63,23 @@ An utility library for developers of the menu screen (devel) %setup -q %build -CFLAGS="-I/usr/lib/glib-2.0/include/ -I/usr/include/glib-2.0 -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0 -I/usr/include/e_dbus-1 -I/usr/include/ethumb-0 -I/usr/include/edje-1 -I/usr/include/efreet-1 -I/usr/include/embryo-1 -I/usr/include/ecore-1 -I/usr/include/eet-1 -I/usr/include/evas-1 -I/usr/include/eina-1 -I/usr/include/eina-1/eina $CFLAGS" CXXFLAGS=$CXXFLAGS cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} - +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} +CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed" make %{?jobs:-j%jobs} %install %make_install - +mkdir -p %{buildroot}%{_datadir} +mkdir -p %{buildroot}/usr/share/license %post - INHOUSE_ID="5000" init_vconf() { - # for menu daemon - vconftool set -t int memory/menu-screen/is_menu_screen_done 0 -i -f - - # for menu-screen vconftool set -t int memory/idle-screen/top 0 -i -u 5000 -f + vconftool set -t string file/private/org.tizen.menu-screen/engine "gl" -i -u 5000 -f + vconftool set -t int memory/menu-screen/is_menu_screen_done 0 -i -f vconftool set -t string db/setting/menuscreen/package_name "org.tizen.menu-screen" -i -u 5000 -f } @@ -79,14 +87,14 @@ init_vconf() init_vconf -%files +%files %manifest %{name}.manifest -%{_appdir}/org.tizen.menu-screen/bin/menu-screen -%{_appdir}/org.tizen.menu-screen/res/edje/all_apps_portrait.edj -%{_appdir}/org.tizen.menu-screen/res/edje/group_4x4_portrait.edj -%{_appdir}/org.tizen.menu-screen/res/edje/item_4x4.edj -%{_appdir}/org.tizen.menu-screen/res/edje/layout_portrait.edj -%{_appdir}/org.tizen.menu-screen/res/edje/index.edj -%{_opt_datadir}/packages/org.tizen.menu-screen.xml - - +%defattr(-,root,root,-) +%{_bindir}/menu-screen +%{_resdir}/edje/all_apps_portrait.edj +%{_resdir}/edje/group_4x4_portrait.edj +%{_resdir}/edje/item_4x4.edj +%{_resdir}/edje/layout_portrait.edj +%{_resdir}/edje/index.edj +%{_usr_datadir}/packages/org.tizen.menu-screen.xml +%{_usr_datadir}/license/%{name} diff --git a/src/all_apps/layout.c b/src/all_apps/layout.c index e22070f..61d39db 100644 --- a/src/all_apps/layout.c +++ b/src/all_apps/layout.c @@ -95,6 +95,7 @@ static menu_screen_error_e _push_items(Evas_Object *all_apps) evas_object_data_set(all_apps, "list", list); idle_timer = ecore_idler_add(_push_items_idler_cb, all_apps); + retv_if(NULL == idle_timer, MENU_SCREEN_ERROR_FAIL); return MENU_SCREEN_ERROR_OK; } @@ -142,6 +143,8 @@ Evas_Object *all_apps_layout_create(Evas_Object *controlbar, int rotate) evas_object_data_set(all_apps, "is_under_pkgmgr", (void *) true); evas_object_data_set(all_apps, "rotate", (void *) rotate); evas_object_data_set(all_apps, "enable_bg_image", (void *) true); + evas_object_size_hint_min_set(all_apps, width, height); + evas_object_size_hint_max_set(all_apps, width, height); evas_object_resize(all_apps, width, height); index = index_create(all_apps, 0); diff --git a/src/all_apps/list.c b/src/all_apps/list.c index e3bc0b8..e3d2e6c 100644 --- a/src/all_apps/list.c +++ b/src/all_apps/list.c @@ -94,7 +94,11 @@ app_list *all_apps_list_create(void) list = calloc(1, sizeof(app_list)); retv_if(NULL == list, NULL); - retv_if(ail_filter_new(&f) != AIL_ERROR_OK, NULL); + if (ail_filter_new(&f) != AIL_ERROR_OK) { + free(list); + return NULL; + } + if (ail_filter_add_bool(f, AIL_PROP_NODISPLAY_BOOL, false) != AIL_ERROR_OK){ _E("Failed to add filter"); ail_filter_destroy(f); diff --git a/src/index.c b/src/index.c index 93c5003..81f536c 100644 --- a/src/index.c +++ b/src/index.c @@ -99,6 +99,7 @@ Evas_Object *index_create(Evas_Object *tab, unsigned int count) _D("COUNT:%d", count); evas_object_show(index); + free(number); return index; } diff --git a/src/item.c b/src/item.c index a9dd107..1d799f9 100644 --- a/src/item.c +++ b/src/item.c @@ -328,7 +328,7 @@ void item_enable_progress(Evas_Object *obj) evas_object_del(progress); } - progress = elm_progressbar_add(menu_screen_get_win()); + progress = elm_progressbar_add(obj); ret_if(NULL == progress); elm_object_part_content_set(obj, "progress,swallow", progress); @@ -388,21 +388,21 @@ int item_is_enabled_progress(Evas_Object *obj) -static Evas_Object *_add_icon_image(const char *icon_file) +static Evas_Object *_add_icon_image(Evas_Object *item, const char *icon_file) { Evas_Object *icon; - icon = elm_icon_add(menu_screen_get_win()); - if (elm_icon_file_set(icon, icon_file, NULL) == EINA_FALSE) { + icon = elm_icon_add(item); + if (elm_image_file_set(icon, icon_file, NULL) == EINA_FALSE) { _E("Icon file is not accessible (%s)", icon_file); evas_object_del(icon); icon = NULL; } - elm_icon_resizable_set(icon, EINA_TRUE, EINA_TRUE); + elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE); - if (menu_screen_get_root_height() >= BASE_HEIGHT || menu_screen_get_root_width() >= BASE_WIDTH) { - elm_icon_no_scale_set(icon, EINA_TRUE); + if (menu_screen_get_root_height() > BASE_HEIGHT || menu_screen_get_root_width() > BASE_WIDTH) { + elm_image_no_scale_set(icon, EINA_TRUE); } return icon; @@ -410,7 +410,7 @@ static Evas_Object *_add_icon_image(const char *icon_file) -static Evas_Object *_add_edje_icon(const char *icon_file) +static Evas_Object *_add_edje_icon(Evas_Object *item, const char *icon_file) { Evas_Object *icon; if (access(icon_file, R_OK) != 0) { @@ -418,7 +418,7 @@ static Evas_Object *_add_edje_icon(const char *icon_file) return NULL; } - icon = layout_load_edj(menu_screen_get_win(), (char*)icon_file, ITEM_GROUP_NAME); + icon = layout_load_edj(item, (char*)icon_file, ITEM_GROUP_NAME); if (!icon) { _E("Failed to load an edje, [%s] group icon", icon_file); evas_object_del(icon); @@ -455,10 +455,10 @@ void item_update(Evas_Object *item, app_info_t *ai) if (!ai->image) { if (item_is_edje_icon(ai->icon) == MENU_SCREEN_ERROR_OK) { - icon = _add_edje_icon(ai->icon); + icon = _add_edje_icon(item, ai->icon); evas_object_data_set(item, "icon_image_type", STR_ICON_IMAGE_TYPE_EDJE); } else { - icon = _add_icon_image(ai->icon); + icon = _add_icon_image(item, ai->icon); evas_object_data_set(item, "icon_image_type", STR_ICON_IMAGE_TYPE_OBJECT); } } else { @@ -497,7 +497,7 @@ Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai) int item_height; item_edje = evas_object_data_get(scroller, "item_edje"); - item = layout_load_edj(menu_screen_get_win(), item_edje, ITEM_GROUP_NAME); + item = layout_load_edj(scroller, item_edje, ITEM_GROUP_NAME); if (!item) { _E("Failed to load an item object"); return NULL; diff --git a/src/item_event.c b/src/item_event.c index 4742b9b..30fd27a 100644 --- a/src/item_event.c +++ b/src/item_event.c @@ -83,21 +83,15 @@ static void _item_up_cb(void *data, Evas_Object *obj, const char* emission, cons evas_object_color_set(icon_image, 255, 255, 255, 255); ret_if(NULL == item_event_info.pressed_item); - - if (item_event_info.pressed_item == item) { - bool item_enable_long_press; - - item_enable_long_press = (bool) evas_object_data_get(item, "item_enable_long_press"); - _D("Not Edit Mode"); - - if (mouse_is_scrolling()) { - return; - } - - item_launch(item); + if (item != item_event_info.pressed_item) { + item_event_info.pressed_item = NULL; + return; } - item_event_info.pressed_item = NULL; + + if (mouse_is_scrolling()) return; + + item_launch(item); } diff --git a/src/layout.c b/src/layout.c index cc5a60d..b56b477 100644 --- a/src/layout.c +++ b/src/layout.c @@ -33,36 +33,44 @@ -Evas_Object *layout_create(Evas_Object *win, const char *file, const char *group, int rotate) +Evas_Object *layout_create(Evas_Object *conformant, const char *file, const char *group, int rotate) { Evas_Object *layout; - Evas_Object *all_apps; - int width; - int height; - - layout = layout_load_edj(win, file, group); - retv_if(NULL == layout, NULL); - - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(win, layout); - - evas_object_data_set(layout, "win", win); - evas_object_data_set(layout, "rotate", (void *) rotate); - width = menu_screen_get_root_width(); - height = menu_screen_get_root_height(); - - evas_object_data_set(layout, "width", (void *) width); - evas_object_data_set(layout, "height", (void *) height); - - all_apps = all_apps_layout_create(layout, rotate); - if (NULL == all_apps) { - _E("Failed to create scroller"); - layout_destroy(layout); - return NULL; - } - evas_object_data_set(layout, "all_apps", all_apps); - elm_object_part_content_set(layout, "content", all_apps); + do { + int width; + int height; + + layout = layout_load_edj(conformant, file, group); + retv_if(NULL == layout, NULL); + + width = menu_screen_get_root_width(); + height = menu_screen_get_root_height(); + + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_min_set(layout, width, height); + evas_object_size_hint_max_set(layout, width, height); + evas_object_resize(layout, width, height); + evas_object_show(layout); + + evas_object_data_set(layout, "win", menu_screen_get_win()); + evas_object_data_set(layout, "rotate", (void *) rotate); + evas_object_data_set(layout, "width", (void *) width); + evas_object_data_set(layout, "height", (void *) height); + } while (0); + + do { + Evas_Object *all_apps; + + all_apps = all_apps_layout_create(layout, rotate); + if (NULL == all_apps) { + _E("Failed to create scroller"); + layout_destroy(layout); + return NULL; + } + evas_object_data_set(layout, "all_apps", all_apps); + elm_object_part_content_set(layout, "content", all_apps); + } while (0); return layout; } @@ -73,11 +81,10 @@ void layout_destroy(Evas_Object *layout) { Evas_Object *all_apps; - all_apps = evas_object_data_get(layout, "all_apps"); + all_apps = evas_object_data_del(layout, "all_apps"); all_apps_layout_destroy(all_apps); evas_object_data_del(layout, "win"); - evas_object_data_del(layout, "all_apps"); evas_object_data_del(layout, "rotate"); evas_object_data_del(layout, "width"); evas_object_data_del(layout, "height"); diff --git a/src/list.c b/src/list.c index 5109904..48c9a08 100644 --- a/src/list.c +++ b/src/list.c @@ -108,7 +108,7 @@ menu_screen_error_e list_get_values(const char *package, app_info_t *ai) retv_if(NULL == ai, MENU_SCREEN_ERROR_FAIL); retv_if(NULL == (ai->package = strdup(package)), MENU_SCREEN_ERROR_FAIL); - ret = ail_package_get_appinfo(ai->package, &appinfo_h); + ret = ail_get_appinfo(ai->package, &appinfo_h); if (AIL_ERROR_OK == ret) { do { break_if(ail_appinfo_get_str(appinfo_h, AIL_PROP_EXEC_STR, &exec) < 0); @@ -122,12 +122,12 @@ menu_screen_error_e list_get_values(const char *package, app_info_t *ai) break_if(NULL == name || NULL == (ai->name = strdup(name))); break_if(NULL == icon || NULL == (ai->icon = strdup(icon))); - ail_package_destroy_appinfo(appinfo_h); + ail_destroy_appinfo(appinfo_h); return MENU_SCREEN_ERROR_OK; } while(0); - ail_package_destroy_appinfo(appinfo_h); + ail_destroy_appinfo(appinfo_h); list_free_values(ai); return MENU_SCREEN_ERROR_FAIL; } else if (AIL_ERROR_NO_DATA == ret) { diff --git a/src/menu_screen.c b/src/menu_screen.c index 7916392..d2dc8d3 100644 --- a/src/menu_screen.c +++ b/src/menu_screen.c @@ -35,8 +35,7 @@ #include "page_scroller.h" #include "util.h" -#define STR_ENV_ENGINE "LAUNCHER_ENGINE" -#define STR_ENV_FPS "LAUNCHER_FPS" +#define MENU_SCREEN_ENGINE "file/private/org.tizen.menu-screen/engine" #define LAYOUT_EDJE_PORTRAIT EDJEDIR"/layout_portrait.edj" #define LAYOUT_GROUP_NAME "layout" @@ -49,8 +48,6 @@ static struct { int state; int root_width; int root_height; - double xscale; - double yscale; Evas *evas; Ecore_Evas *ee; Evas_Object *win; @@ -88,13 +85,6 @@ int menu_screen_get_root_height(void) -double menu_screen_get_yscale(void) -{ - return menu_screen_info.yscale; -} - - - Evas_Object *menu_screen_get_win(void) { return menu_screen_info.win; @@ -154,6 +144,8 @@ static menu_screen_error_e _create_canvas(char *name, char *title) } evas_object_move(menu_screen_info.win, 0, 0); + evas_object_size_hint_min_set(menu_screen_info.win, menu_screen_info.root_width, menu_screen_info.root_height); + evas_object_size_hint_max_set(menu_screen_info.win, menu_screen_info.root_width, menu_screen_info.root_height); evas_object_resize(menu_screen_info.win, menu_screen_info.root_width, menu_screen_info.root_height); evas_object_show(menu_screen_info.win); @@ -181,9 +173,8 @@ static int _dead_cb(int pid, void *data) -static void _set_scale(void) +static void _get_window_size(void) { - double scale; Ecore_X_Window focus_win; Ecore_X_Window root_win; @@ -191,11 +182,7 @@ static void _set_scale(void) root_win = ecore_x_window_root_get(focus_win); ecore_x_window_size_get(root_win, &menu_screen_info.root_width, &menu_screen_info.root_height); - menu_screen_info.xscale = (double) menu_screen_info.root_width / (double) BASE_WIDTH; - menu_screen_info.yscale = (double) menu_screen_info.root_height / (double) BASE_HEIGHT; - scale = menu_screen_info.xscale < menu_screen_info.yscale ? menu_screen_info.xscale : menu_screen_info.yscale; - _D("width:%d, height:%d, scale:%f", menu_screen_info.root_width, menu_screen_info.root_height, scale); - elm_config_scale_set(scale); + _D("width:%d, height:%d", menu_screen_info.root_width, menu_screen_info.root_height); } @@ -254,7 +241,7 @@ static void _create_bg(void) wf = (double) width / (double) w; hf = (double) height / (double) h; - f = wf > hf ? hf : wf; + f = wf < hf ? hf : wf; w = (int) ((double) f * (double) w); h = (int) ((double) f * (double) h); @@ -312,13 +299,41 @@ static void _fini_theme(void) +Evas_Object *_create_conformant(Evas_Object *win) +{ + Evas_Object *conformant; + + conformant = elm_conformant_add(win); + retv_if(NULL == conformant, NULL); + + evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_data_set(conformant, "win", win); + evas_object_show(conformant); + + elm_win_resize_object_add(win, conformant); + elm_win_conformant_set(win, EINA_TRUE); + + return conformant; +} + + + +void _destroy_conformant(Evas_Object *conformant) +{ + evas_object_data_del(conformant, "win"); + evas_object_del(conformant); +} + + + static bool _create_cb(void *data) { + Evas_Object *conformant; Evas_Object *layout; - _set_scale(); + _get_window_size(); _init_theme(); - retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), EXIT_FAILURE); + retv_if(MENU_SCREEN_ERROR_FAIL == _create_canvas(PACKAGE, PACKAGE), false); elm_win_indicator_mode_set(menu_screen_info.win, ELM_WIN_INDICATOR_SHOW); if (vconf_notify_key_changed(VCONFKEY_BGSET, _change_bg_cb, NULL) < 0) { @@ -326,16 +341,20 @@ static bool _create_cb(void *data) } _create_bg(); - layout = layout_create(menu_screen_info.win, LAYOUT_EDJE_PORTRAIT, + conformant = _create_conformant(menu_screen_info.win); + retv_if(NULL == conformant, false); + evas_object_data_set(menu_screen_info.win, "conformant", conformant); + + layout = layout_create(conformant, LAYOUT_EDJE_PORTRAIT, LAYOUT_GROUP_NAME, MENU_SCREEN_ROTATE_PORTRAIT); if (NULL == layout) { - _E("Faield to load an edje object"); + _E("Failed to load an edje object"); evas_object_del(menu_screen_info.win); - return EXIT_FAILURE; + return false; } evas_object_data_set(menu_screen_info.win, "layout", layout); - evas_object_show(layout); + elm_object_content_set(conformant, layout); mouse_register(); aul_listen_app_dead_signal(_dead_cb, NULL); @@ -346,6 +365,7 @@ static bool _create_cb(void *data) static void _terminate_cb(void *data) { + Evas_Object *conformant; Evas_Object *layout; if (vconf_ignore_key_changed(VCONFKEY_BGSET, _change_bg_cb) < 0) { @@ -357,7 +377,10 @@ static void _terminate_cb(void *data) mouse_unregister(); layout = evas_object_data_del(menu_screen_info.win, "layout"); - layout_destroy(layout); + if (layout) layout_destroy(layout); + + conformant = evas_object_data_del(menu_screen_info.win, "conformant"); + if (conformant) _destroy_conformant(conformant); _destroy_bg(); _destroy_canvas(); @@ -455,20 +478,20 @@ static void _language_changed_cb(void *data) item = page_get_item_at(page, j); if (!item) continue; - if (ail_package_get_appinfo(item_get_package(item), &ai) < 0) continue; + if (ail_get_appinfo(item_get_package(item), &ai) < 0) continue; if (ail_appinfo_get_str(ai, AIL_PROP_NAME_STR, &name) < 0) { - ail_package_destroy_appinfo(ai); + ail_destroy_appinfo(ai); continue; } if (!name) { - _D("Faield to get name for %s", item_get_package(item)); - ail_package_destroy_appinfo(ai); + _D("Failed to get name for %s", item_get_package(item)); + ail_destroy_appinfo(ai); continue; } item_set_name(item, name, 0); - ail_package_destroy_appinfo(ai); + ail_destroy_appinfo(ai); } mapbuf_enable(page, 1); @@ -501,27 +524,19 @@ static void _fini(void) int main(int argc, char *argv[]) { - const char *env; + char *buf; app_event_callback_s event_callback; - env = getenv(STR_ENV_ENGINE); - if (env) { - _D("ELM_ENGINE is set as [%s]", env); - setenv("ELM_ENGINE", env, 1); + buf = vconf_get_str(MENU_SCREEN_ENGINE); + if (buf) { + _D("ELM_ENGINE is set as [%s]\n", buf); + setenv("ELM_ENGINE", buf, 1); + free(buf); } else { _D("ELM_ENGINE is set as [%s]", "gl"); setenv("ELM_ENGINE", "gl", 1); } - env = getenv(STR_ENV_FPS); - if (env) { - _D("ELM_FPS is set as [%s]", env); - setenv("ELM_FPS", env, 1); - } else { - _D("ELM_FPS is set as [%s]", "6000"); - setenv("ELM_FPS", "6000", 1); - } - _init(&event_callback); app_efl_main(&argc, &argv, &event_callback, NULL); _fini(); diff --git a/src/page.c b/src/page.c index c37cc8d..e9220b3 100644 --- a/src/page.c +++ b/src/page.c @@ -198,6 +198,11 @@ Evas_Object *page_create(Evas_Object *scroller, int idx, int rotate) evas_object_size_hint_min_set(bg, page_width, page_height); evas_object_size_hint_max_set(bg, page_width, page_height); + + evas_object_size_hint_min_set(page, page_width, page_height); + evas_object_size_hint_max_set(page, page_width, page_height); + evas_object_resize(page, page_width, page_height); + elm_object_part_content_set(page, "bg", bg); evas_object_data_set(page, "win", evas_object_data_get(scroller, "win")); diff --git a/src/page_scroller.c b/src/page_scroller.c index 337cabb..f9bd6b5 100644 --- a/src/page_scroller.c +++ b/src/page_scroller.c @@ -19,15 +19,15 @@ #include #include -#include "menu_screen.h" #include "conf.h" -#include "list.h" -#include "mapbuf.h" -#include "page.h" #include "index.h" #include "item.h" #include "item_event.h" #include "layout.h" +#include "list.h" +#include "mapbuf.h" +#include "menu_screen.h" +#include "page.h" #include "page_scroller.h" #include "pkgmgr.h" #include "util.h" @@ -363,6 +363,8 @@ static Evas_Object *_animated_unpack_item(Evas_Object *scroller, Evas_Object *pa for (; pos < page_max_app; pos ++) { item = page_unpack_item_at(page, pos); + if (NULL == item) continue; + page_pack_item(page, pos - 1, item); snprintf(buf, 32, "menu%d", pos - 1); edje_object_signal_emit(_EDJ(page), STR_MOVE_NEXT, buf); @@ -377,6 +379,8 @@ static Evas_Object *_animated_unpack_item(Evas_Object *scroller, Evas_Object *pa next_page = page_scroller_get_page_at(scroller, page_no); if (next_page) { item = page_unpack_item_at(next_page, 0); + if (NULL == item) continue; + page_pack_item(page, page_max_app - 1, item); } else break; @@ -813,7 +817,6 @@ void page_scroller_destroy(Evas_Object *scroller) Evas_Object *box; Evas_Object *page; Evas_Object *tmp; - Evas_Object *tab; const Eina_List *page_list; const Eina_List *l; @@ -823,8 +826,6 @@ void page_scroller_destroy(Evas_Object *scroller) ret_if(NULL == (box = evas_object_data_get(scroller, "box"))); ret_if(NULL == (page_list = elm_box_children_get(box))); - tab = evas_object_data_get(scroller, "tab"); - pkgmgr_fini(); EINA_LIST_FOREACH_SAFE(page_list, l, ln, page) { @@ -1031,17 +1032,6 @@ Evas_Object *page_scroller_find_item_by_package(Evas_Object *scroller, const cha -void _show(Evas_Object *scroller, int page) -{ - Evas_Coord w; - Evas_Coord h; - - evas_object_geometry_get(scroller, NULL, NULL, &w, &h); - elm_scroller_region_show(scroller, page * w, 0, w, h); -} - - - void page_scroller_trim_items(Evas_Object *scroller) { register unsigned int i; @@ -1113,19 +1103,4 @@ void page_scroller_trim_items(Evas_Object *scroller) } - -Evas_Object *_unpack_updated_item(Evas_Object *scroller, unsigned int page_no, unsigned int position_no) -{ - Evas_Object *page; - Evas_Object *temp; - - retv_if(NULL == scroller, NULL); - page = page_scroller_get_page_at(scroller, page_no); - temp = page_unpack_item_at(page, (int) position_no); - - return temp; -} - - - // End of a file diff --git a/src/pkgmgr.c b/src/pkgmgr.c index f39a7c1..aace7cb 100644 --- a/src/pkgmgr.c +++ b/src/pkgmgr.c @@ -56,7 +56,7 @@ inline menu_screen_error_e pkgmgr_uninstall(Evas_Object *item) req_pc = pkgmgr_client_new(PC_REQUEST); retv_if(NULL == req_pc, MENU_SCREEN_ERROR_FAIL); - if (pkgmgr_client_uninstall(req_pc, NULL, item_get_package(item), PM_DEFAULT, NULL, NULL) < 0) { + if (pkgmgr_client_uninstall(req_pc, NULL, item_get_package(item), PM_QUIET, NULL, NULL) < 0) { _E("cannot uninstall %s.", item_get_package(item)); ret = MENU_SCREEN_ERROR_FAIL; } diff --git a/src/popup.c b/src/popup.c index 3849383..c83e305 100644 --- a/src/popup.c +++ b/src/popup.c @@ -19,9 +19,12 @@ #include #include "conf.h" +#include "item.h" #include "menu_screen.h" +#include "pkgmgr.h" #include "util.h" +#define BUFSZE 1024 static void _response_cb(void *data, Evas_Object *obj, void *event_info) -- 2.34.1