Made changes in resource path for Music Player 25/54125/5
authorsahil.ch525 <sahil.ch525@samsung.com>
Fri, 11 Dec 2015 13:25:23 +0000 (18:55 +0530)
committersahil.ch525 <sahil.ch525@samsung.com>
Mon, 14 Dec 2015 12:57:24 +0000 (18:27 +0530)
Change-Id: Iab1d4b61aab01c7954919b0cec06acede7061896
Signed-off-by: sahil.ch525 <sahil.ch525@samsung.com>
15 files changed:
inc/mp-common-defs.h
src/common/mp-common.c
src/common/mp-widget.c
src/include/mp-define.h
src/mp-main.c
src/view/mp-create-playlist-view.c
src/widget/mp-album-detail-list.c
src/widget/mp-artist-detail-list.c
src/widget/mp-edit-playlist.c
src/widget/mp-lockscreenmini.c
src/widget/mp-minicontroller.c
src/widget/mp-now-playing.c
src/widget/mp-playlist-list.c
src/widget/mp-popup.c
src/widget/mp-search.c

index 7e49381e062875d10460986438c9fcd070d1894a..4c4065cee8428886d9df95f0ff1395a6f5d129fa 100755 (executable)
@@ -63,7 +63,7 @@
 #define DEFAULT_PLAYER_THUMBNAIL               "/usr/apps/org.tizen.music-player/shared/res/shared_images/default_album_art_480.png"
 #define BROKEN_ALBUMART_IMAGE_PATH             "/opt/usr/share/media/.thumb/thumb_default.png"
 
-#define PLAYLIST_CREATE_THUMBNAIL              "/usr/apps/org.tizen.music-player/res/images/music_player/T02_playlist_thumbnail_created.png"
+#define PLAYLIST_CREATE_THUMBNAIL              "T02_playlist_thumbnail_created.png"
 //for shortcut
 typedef enum {
        MP_ADD_TO_HOME_SHORTCUT_TYPE_NONE,
index db7681d1adad044b58c5ca91e36edf43cd3ee7be..7befcf09b6a5bc18d305a9f7ab59cf93ac1be0c5 100755 (executable)
@@ -640,8 +640,13 @@ static void _mp_common_list_track_more_detail(void *parent, void *data)
 
        pop_layout = elm_layout_add(popup);
        MP_CHECK(pop_layout);
+       char edje_path[1024] ={0};
+       char * path = app_get_resource_path();
 
-       elm_layout_file_set(pop_layout, MP_EDJ_NAME, "popup_detail");
+       MP_CHECK(path);
+       snprintf(edje_path, 1024, "%s%s/%s", path, "edje", MP_EDJ_NAME);
+       elm_layout_file_set(pop_layout, edje_path, "popup_detail");
+       free(path);
 
        pBox = elm_box_add(popup);
        elm_box_horizontal_set(pBox, EINA_FALSE);
index 4d48f5a6b1d81ceee799033268365bf939cdc1b3..cd2fd4f2c426ae2a88101e3b96befaa3b8c4a046 100755 (executable)
@@ -378,7 +378,13 @@ mp_common_load_edj(Evas_Object * parent, const char *file, const char *group)
 
        eo = elm_layout_add(parent);
        if (eo) {
-               r = elm_layout_file_set(eo, file, group);
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", file);
+               r = elm_layout_file_set(eo, edje_path, group);
+               free(path);
                if (!r) {
                        evas_object_del(eo);
                        return NULL;
index 4e42c8411cd3736f4fed1908ea1fb46d96d3270f..ccf76d2c1cf76c5dc7d056483931bb677abdec67 100755 (executable)
@@ -37,6 +37,7 @@
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 #include <sys/times.h>
+#include <app.h>
 
 #ifndef EXPORT_API
 #define EXPORT_API __attribute__((__visibility__("default")))
 #define PKGNAME_FOR_SHORTCUT   PKG_NAME
 
 #define EDJ_PATH EDJDIR
-#define EDJ_NAME EDJ_PATH"/mp-library.edj"
-#define MP_EDJ_NAME EDJ_PATH"/music.edj"
-#define MINICON_EDJ_NAME EDJ_PATH"/mp-minicontroller.edj"
-#define LOCKSCREENMINI_EDJ_NAME EDJ_PATH"/mp-lockscreenmini.edj"
-#define IMAGE_EDJ_NAME EDJ_PATH"/mp-images.edj"
+#define EDJ_NAME "mp-library.edj"
+#define MP_EDJ_NAME "music.edj"
+#define MINICON_EDJ_NAME "mp-minicontroller.edj"
+#define LOCKSCREENMINI_EDJ_NAME "mp-lockscreenmini.edj"
+#define IMAGE_EDJ_NAME "mp-images.edj"
 #define GRP_MAIN "main"
 
-#define THEME_NAME     EDJ_PATH"/mp-custom-winset-style.edj"
+#define THEME_NAME "mp-custom-winset-style.edj"
 
 #define TITLE_H 90
 #define START_Y_POSITION       94
 #define MAX_URL_LEN                            MAX_NAM_LEN
 #define DEF_STR_LEN                            512
 
-#define PLAY_VIEW_EDJ_NAME                     EDJ_PATH"/music.edj"
+#define PLAY_VIEW_EDJ_NAME             "music.edj"
 
 //2 EVAS_OBJECT_TYPE define
 #define MP_FAST_SCROLLER_TYPE                                  "mp_data_fast_scroller_type"
index 573e7c31ed19cfc56987fe7c7640bcc50969d8f6..227688f8e89d7e9197e146ab5a81e115a3f181af 100755 (executable)
@@ -1366,7 +1366,14 @@ mp_create(void *data)
 
        PROFILE_IN("elm_theme_extension_add");
        /* do extension add before add elm object.*/
-       elm_theme_extension_add(NULL, THEME_NAME);
+       char edje_path[1024] ={0};
+       char * path = app_get_resource_path();
+       MP_CHECK_VAL(path, EINA_FALSE);
+       snprintf(edje_path, 1024, "%s%s/%s", path, "edje", THEME_NAME);
+
+       Elm_Theme *th = elm_theme_new();
+       elm_theme_extension_add(NULL, edje_path);
+       free(path);
        PROFILE_OUT("elm_theme_extension_add");
 
        PROFILE_IN("bindtextdomain");
@@ -1988,3 +1995,4 @@ main(int argc, char *argv[])
 
        return ui_app_main(argc, argv, &event_callbacks, &ad);
 }
+
index 20c969e60aedec87a4b45de869e3b8a263b707cd..2bab654471fa3dfb3727834106a55e7c0030d604 100644 (file)
@@ -384,7 +384,14 @@ _mp_create_plst_view_create_editfield_layout(void *thiz)
 
        view->create_plst_layout = elm_layout_add(view->layout);
        MP_CHECK_NULL(view->create_plst_layout);
-       elm_layout_file_set(view->create_plst_layout, EDJ_NAME, "create_playlist");
+
+       char edje_path[1024] ={0};
+       char * path = app_get_resource_path();
+
+       MP_CHECK_NULL(path);
+       snprintf(edje_path, 1024, "%s%s/%s", path, "edje", EDJ_NAME);
+       elm_layout_file_set(view->create_plst_layout, edje_path, "create_playlist");
+       free(path);
 
        genlist = mp_widget_genlist_create(view->create_plst_layout);
        elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
index 79615fa578b20d28bd3c5f8ef12aebbd5d5677a8..e4fbfa8685bb0fb414261e0e774844760528a692 100755 (executable)
@@ -366,9 +366,15 @@ _mp_album_detail_list_shuffle_icon_get(void *data, Evas_Object * obj, const char
                content = elm_layout_add(obj);
 
                Evas_Object *icon;
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
 
-               icon = mp_util_create_image(obj, IMAGE_EDJ_NAME, MP_LITE_SHUFFLE_ICON, MP_LIST_SHUFFLE_ICON_SIZE, MP_LIST_SHUFFLE_ICON_SIZE);
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", IMAGE_EDJ_NAME);
+
+               icon = mp_util_create_image(obj, edje_path, MP_LITE_SHUFFLE_ICON, MP_LIST_SHUFFLE_ICON_SIZE, MP_LIST_SHUFFLE_ICON_SIZE);
                evas_object_color_set(icon, 21, 108, 148, 255);
+               free(path);
 
                elm_layout_theme_set(content, "layout", "list/B/type.3", "default");
                elm_layout_content_set(content, "elm.swallow.content", icon);
index cd839fdf5ff74f376795973eb0fe30366dc0c506..db088d2095991af56cb241c6fe284a0cf030b8d6 100755 (executable)
@@ -512,9 +512,15 @@ _mp_artist_detail_list_shuffle_icon_get(void *data, Evas_Object * obj, const cha
                content = elm_layout_add(obj);
 
                Evas_Object *icon = NULL;
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
 
-               icon = mp_util_create_image(obj, IMAGE_EDJ_NAME, MP_LITE_SHUFFLE_ICON, MP_LIST_SHUFFLE_ICON_SIZE, MP_LIST_SHUFFLE_ICON_SIZE);
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", IMAGE_EDJ_NAME);
+
+               icon = mp_util_create_image(obj, edje_path, MP_LITE_SHUFFLE_ICON, MP_LIST_SHUFFLE_ICON_SIZE, MP_LIST_SHUFFLE_ICON_SIZE);
                evas_object_color_set(icon, 21, 108, 148, 255);
+               free(path);
 
                elm_layout_theme_set(content, "layout", "list/B/type.3", "default");
                elm_layout_content_set(content, "elm.swallow.content", icon);
index 4f7ecc1167d1b57d85d71f36cb7d54e0913ff3c4..9cbb4604fdcc1660a6a0b704a35c0ea7468aac72 100755 (executable)
@@ -488,7 +488,14 @@ mp_edit_playlist_content_create(void *thiz)
        mp_playlist_data->add_to_selected = true;
 
        layout = elm_layout_add(mp_playlist_data->popup);
-       elm_layout_file_set(layout, PLAY_VIEW_EDJ_NAME, "popup_entryview");
+       char edje_path[1024] ={0};
+       char * path = app_get_resource_path();
+
+       MP_CHECK(path);
+       snprintf(edje_path, 1024, "%s%s/%s", path, "edje", PLAY_VIEW_EDJ_NAME);
+
+       elm_layout_file_set(layout, edje_path, "popup_entryview");
+       free(path);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        elm_object_focus_set(layout, EINA_FALSE);
 
index 9eb18ea25ae79ddffa7c2129a8237cf757244b31..f4d662a9d511669c1d7a428fd32d4ab896098fae 100755 (executable)
@@ -241,7 +241,15 @@ _load_edj(Evas_Object *parent, const char *file, const char *group)
 
        eo = elm_layout_add(parent);
        if (eo) {
-               r = elm_layout_file_set(eo, file, group);
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", file);
+
+               r = elm_layout_file_set(eo, edje_path, group);
+               free(path);
+
                if (!r) {
                        evas_object_del(eo);
                        return NULL;
index 0c87fdc7ee9cc90a049071709d6024048c278f75..f29ef5860d47f1a34c5bd72f7e8ce1e376162783 100755 (executable)
@@ -339,7 +339,14 @@ _load_edj(Evas_Object * parent, const char *file, const char *group)
 
        eo = elm_layout_add(parent);
        if (eo) {
-               r = elm_layout_file_set(eo, file, group);
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", file);
+
+               r = elm_layout_file_set(eo, edje_path, group);
+               free(path);
                if (!r) {
                        evas_object_del(eo);
                        return NULL;
index abb30b471d44a6d419d16c302b1da88487c6d39f..3c656b8c0db211acfb9adadd38338653475d2a41 100755 (executable)
@@ -601,7 +601,14 @@ Evas_Object *mp_now_playing_create(Evas_Object *parent, MpNowplayingCb play_bt_c
 #endif
        playing_pannel = elm_layout_add(parent);
        if (playing_pannel) {
-               r = elm_layout_file_set(playing_pannel, PLAY_VIEW_EDJ_NAME, "mp_now_playing");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", PLAY_VIEW_EDJ_NAME);
+
+               r = elm_layout_file_set(playing_pannel, edje_path, "mp_now_playing");
+               free(path);
 
                if (!r) {
                        ERROR_TRACE("Error: elm_layout_file_set");
index c5725fa5bdb77e8634a4127811c70db16954e3a3..bf8e50fd27dd0e004d84d9a3cd259391881675c8 100755 (executable)
@@ -407,7 +407,14 @@ _mp_playlist_add_icon_get(void *data, Evas_Object * obj, const char *part)
                Evas_Object *eo = NULL;
                Evas_Object *content = NULL;
                content = elm_layout_add(obj);
-               eo = mp_util_create_thumb_icon(obj, PLAYLIST_CREATE_THUMBNAIL, MP_LIST_ICON_SIZE,
+
+               char image_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(image_path, 1024, "%s%s/%s", path, "images/music_player", PLAYLIST_CREATE_THUMBNAIL);
+
+               eo = mp_util_create_thumb_icon(obj, image_path, MP_LIST_ICON_SIZE,
                                               MP_LIST_ICON_SIZE);
 
                elm_layout_theme_set(content, "layout", "list/B/music.type.1", "default");
index 9ecce21b91f0123c49d14ef986389608016056f3..4b3491cbfd28ba78cffb03573fe7f300f838cf75 100755 (executable)
@@ -840,7 +840,14 @@ mp_popup_message_create(Evas_Object * parent, mp_popup_type type, char *title, c
 
                Evas_Object *layout = NULL;
                layout = elm_layout_add(popup);
-               elm_layout_file_set(layout, PLAY_VIEW_EDJ_NAME, "popup_processingview_string");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", PLAY_VIEW_EDJ_NAME);
+
+               elm_layout_file_set(layout, edje_path, "popup_processingview_string");
+               free(path);
                evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                progressbar = mp_widget_loading_icon_add(popup, MP_LOADING_ICON_SIZE_SMALL);
                elm_object_part_content_set(layout, "elm.swallow.content", progressbar);
@@ -924,7 +931,14 @@ mp_popup_create(Evas_Object * parent, mp_popup_type type, char *title, void *use
 
                Evas_Object *layout = NULL;
                layout = elm_layout_add(popup);
-               elm_layout_file_set(layout, PLAY_VIEW_EDJ_NAME, "popup_processingview_string");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", PLAY_VIEW_EDJ_NAME);
+
+               elm_layout_file_set(layout, edje_path, "popup_processingview_string");
+               free(path);
                evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                progressbar = mp_widget_loading_icon_add(popup, MP_LOADING_ICON_SIZE_SMALL);
                elm_object_part_content_set(layout, "elm.swallow.content", progressbar);
@@ -937,7 +951,14 @@ mp_popup_create(Evas_Object * parent, mp_popup_type type, char *title, void *use
                Evas_Object *btn1;
 
                layout = elm_layout_add(popup);
-               elm_layout_file_set(layout, PLAY_VIEW_EDJ_NAME, "popup_processingview_1button");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024,"%s%s/%s",path, "edje", PLAY_VIEW_EDJ_NAME);
+
+               elm_layout_file_set(layout, edje_path, "popup_processingview_1button");
+               free(path);
 
                progressbar = mp_widget_loading_icon_add(popup, MP_LOADING_ICON_SIZE_LARGE);
 
@@ -959,7 +980,14 @@ mp_popup_create(Evas_Object * parent, mp_popup_type type, char *title, void *use
                Evas_Object *layout;
 
                layout = elm_layout_add(popup);
-               elm_layout_file_set(layout, PLAY_VIEW_EDJ_NAME, "popup_processingview_1button");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", PLAY_VIEW_EDJ_NAME);
+
+               elm_layout_file_set(layout, edje_path, "popup_processingview_1button");
+               free(path);
                progressbar = mp_widget_loading_icon_add(popup, MP_LOADING_ICON_SIZE_LARGE);
                elm_object_part_content_set(layout, "elm.swallow.content", progressbar);
                elm_object_part_text_set(layout, "elm.text", title);
@@ -973,7 +1001,14 @@ mp_popup_create(Evas_Object * parent, mp_popup_type type, char *title, void *use
                Evas_Object *btn1;
 
                layout = elm_layout_add(popup);
-               elm_layout_file_set(layout, MP_EDJ_NAME, "popup_center_progressview");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024,"%s%s/%s",path, "edje", MP_EDJ_NAME);
+
+               elm_layout_file_set(layout, edje_path, "popup_center_progressview");
+               free(path);
 
                progressbar = elm_progressbar_add(popup);
                elm_object_style_set(progressbar, "list_progress");
@@ -1013,7 +1048,14 @@ mp_popup_create(Evas_Object * parent, mp_popup_type type, char *title, void *use
                Evas_Object *label;
 
                layout = elm_layout_add(popup);
-               int ret = elm_layout_file_set(layout, MP_EDJ_NAME, "popup_checkview_personal");
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", MP_EDJ_NAME);
+
+               int ret = elm_layout_file_set(layout, edje_path, "popup_checkview_personal");
+               free(path);
                if (!ret) {
                        ERROR_TRACE("Set layout style failed");
                }
@@ -1254,8 +1296,15 @@ Evas_Object *mp_popup_multi_window_center_add(Evas_Object *parent)
 
        Evas_Object *p_window = elm_popup_win_get(popup);
        if (p_window) {
-               elm_theme_extension_add(NULL, THEME_NAME);
+               char edje_path[1024] ={0};
+               char * path = app_get_resource_path();
+
+               MP_CHECK_NULL(path);
+               snprintf(edje_path, 1024, "%s%s/%s", path, "edje", THEME_NAME);
+               elm_theme_extension_add(NULL, edje_path);
+               free(path);
        }
 
        return popup;
 }
+
index 904d6a3937eebe96dcdcba47f25bd88b88d39683..ed36213a2e678d793e48b9234b11e8c389928983 100644 (file)
@@ -103,9 +103,15 @@ mp_search_create_new(Evas_Object * parent, Evas_Smart_Cb change_cb, void *change
 
        searchfield = elm_layout_add(parent);
        Elm_Theme *th = elm_theme_new();
-       elm_theme_extension_add(th, THEME_NAME);
+       char edje_path[1024] ={0};
+       char * path = app_get_resource_path();
+
+       MP_CHECK_NULL(path);
+       snprintf(edje_path, 1024, "%s%s/%s", path, "edje", THEME_NAME);
+
+       elm_theme_extension_add(th, edje_path);
+       free(path);
        elm_layout_theme_set(searchfield, "layout", "searchbar", "cancel_button_case");
-       //elm_layout_theme_set(searchfield, "layout", "searchfield", "singleline");
        const char *style = "DEFAULT='font=tizen; font_size=45'";
 
        en = elm_entry_add(searchfield);