[Gallery] Modified EDJ path. 56/54056/3
authorRahul Dadhich <r.dadhich@samsung.com>
Fri, 11 Dec 2015 06:16:04 +0000 (11:46 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Fri, 11 Dec 2015 09:46:18 +0000 (15:16 +0530)
Change-Id: Ibfee6c43ee5beafdcf66756b7b6d68ea12a2d658
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
12 files changed:
inc/gallery.h
inc/util/gl-util.h
src/2dview/gl-timeline.c
src/features/gl-albums.c
src/features/gl-entry.c
src/features/gl-main.c
src/util/gl-ui-util.c
src/util/gl-util.c
src/widget/gl-controlbar.c
src/widget/gl-popup.c
src/widget/gl-progressbar.c
src/widget/gl-rotate-bg.c

index 312c4a2..d43600f 100644 (file)
@@ -23,6 +23,7 @@
 #include <efl_extension.h>
 
 #include "gl-data.h"
+#include "gl-util.h"
 
 #ifndef EXPORT_API
 #define EXPORT_API __attribute__ ((visibility("default")))
@@ -58,7 +59,7 @@ extern "C"
 
 /******** EDJ File path ********/
 
-#define GL_EDJ_FILE EDJDIR "/" PACKAGE ".edj"
+#define GL_EDJ_FILE PACKAGE".edj"
 
 /******** Groups name ********/
 
index 4bfdbc6..fb0b6ab 100755 (executable)
@@ -256,6 +256,7 @@ int gl_remove_album(void *data, gl_cluster *album_item, bool is_hide);
 int _gl_free_selected_list(void *data);
 int _gl_dlopen_imageviewer(void *data);
 int _gl_dlclose_imageviewer(void *data);
+char *_gl_get_edje_path(void);
 
 #ifdef __cplusplus
 }
index 68e6f52..7c8d7d5 100644 (file)
@@ -718,6 +718,8 @@ static Evas_Object *__gl_timeline_add_page_ly(Evas_Object *parent,
        GL_CHECK_NULL(parent);
        Evas_Object *ly = NULL;
 
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
        char *group = NULL;
        if (it_d->h > it_d->w) {
                group = g_strdup_printf("gallery/timeline_%d", it_d->count);
@@ -725,7 +727,8 @@ static Evas_Object *__gl_timeline_add_page_ly(Evas_Object *parent,
                group = g_strdup_printf("gallery/timeline_%dl", it_d->count);
        }
 
-       ly = gl_ui_load_edj(parent, GL_EDJ_FILE, group);
+       ly = gl_ui_load_edj(parent, path, group);
+       free(path);
        GL_GFREE(group);
        GL_CHECK_NULL(ly);
 
@@ -2661,7 +2664,10 @@ Evas_Object *_gl_grid_layout_add(Evas_Object *parent)
 {
        Evas_Object *layout = NULL;
        layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, GL_EDJ_FILE, "timeline_gridview");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
+       elm_layout_file_set(layout, path, "timeline_gridview");
+       free(path);
        evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_show(layout);
 
@@ -3146,7 +3152,10 @@ static Evas_Object *__gl_timeline_create_list_view(gl_timeline_s *timeline_d, bo
 
        layout = elm_layout_add(timeline_d->parent);
        GL_CHECK_NULL(layout);
-       elm_layout_file_set(layout, GL_EDJ_FILE, "timeline_gridview_date_toast");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
+       elm_layout_file_set(layout, path, "timeline_gridview_date_toast");
+       free(path);
        timeline_d->date_layout = layout;
 
        if (_gl_timeline_create_grid_view(timeline_d, genlist, update) < 0) {
@@ -4559,7 +4568,10 @@ int _gl_timeline_create_view(void *data, Evas_Object *parent)
        timeline_d->time_media_display_order = TIME_ORDER_DESC;
        ad->pinchinfo.zoom_level = GL_ZOOM_IN_ONE;
 
-       layout = gl_ui_load_edj(parent, GL_EDJ_FILE, "timeline");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_VAL(path, -1);
+       layout = gl_ui_load_edj(parent, path, "timeline");
+       free(path);
        if (layout == NULL) {
                gl_dbgE("Failed to create layout!");
                goto GL_TIMELINE_FAILED;
index b105bbc..142b3e4 100644 (file)
@@ -430,7 +430,10 @@ static Evas_Object *__gl_albums_get_content(void *data, Evas_Object *obj,
                }
                char cnt[GL_ALBUM_NAME_LEN_MAX] = { 0, };
                Evas_Object *layout = elm_layout_add(obj);
-               elm_layout_file_set(layout, GL_EDJ_FILE, "ceter_algined_text_layout");
+               char *path = _gl_get_edje_path();
+               GL_CHECK_NULL(path);
+               elm_layout_file_set(layout, path, "ceter_algined_text_layout");
+               free(path);
                char *i18n_name = _gl_get_i18n_album_name(album_item->cluster);
                elm_layout_text_set(layout, "elm.text", elm_entry_utf8_to_markup(_gl_str(i18n_name)));
                snprintf(cnt, sizeof(cnt), "(%d)", (int)(album_item->cluster->count));
@@ -503,7 +506,10 @@ static Evas_Object *__gl_albums_get_content_split_view(void *data, Evas_Object *
        if (!g_strcmp0(part, "elm.text.name.swallow")) {
                char cnt[GL_ALBUM_NAME_LEN_MAX] = { 0, };
                Evas_Object *layout = elm_layout_add(obj);
-               elm_layout_file_set(layout, GL_EDJ_FILE, "ceter_algined_text_layout_split_view");
+               char *path = _gl_get_edje_path();
+               GL_CHECK_NULL(path);
+               elm_layout_file_set(layout, path, "ceter_algined_text_layout_split_view");
+               free(path);
                char *i18n_name = _gl_get_i18n_album_name(album_item->cluster);
                elm_layout_text_set(layout, "elm.text", _gl_str(i18n_name));
                snprintf(cnt, sizeof(cnt), "(%d)", (int)(album_item->cluster->count));
index d44c270..3a57175 100644 (file)
@@ -223,7 +223,10 @@ int _gl_entry_create_view(void *data, char *name, char *title)
        _gl_ui_set_translate_part_str(popup, "title,text", title);
 
        entry_ly = elm_layout_add(popup);
-       elm_layout_file_set(entry_ly, GL_EDJ_FILE, "popup_input_text");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_VAL(path, -1);
+       elm_layout_file_set(entry_ly, path, "popup_input_text");
+       free(path);
 
        Evas_Object *entry = elm_entry_add(entry_ly);
        if (entry == NULL) {
index 8091133..ee8545e 100644 (file)
@@ -387,7 +387,10 @@ int _gl_main_create_view(gl_appdata *ad)
        GL_PROFILE_IN;
        GL_CHECK_VAL(ad, -1);
 
-       elm_theme_extension_add(NULL, GL_EDJ_FILE);
+       char *path = _gl_get_edje_path();
+       GL_CHECK_VAL(path, -1);
+       elm_theme_extension_add(NULL, path);
+       free(path);
        /* Set initial rotate angle */
        ad->maininfo.rotate_mode = APP_DEVICE_ORIENTATION_0;
        gl_dbg("Initial rotation mode: %d", ad->maininfo.rotate_mode);
@@ -459,7 +462,10 @@ int _gl_main_clear_view(gl_appdata *ad)
        evas_object_smart_callback_del(ad->maininfo.win, "wm,rotation,changed",
                                       __gl_main_win_rot_changed_cb);
        _gl_ctxpopup_del(ad);
-       elm_theme_extension_del(NULL, GL_EDJ_FILE);
+       char *path = _gl_get_edje_path();
+       GL_CHECK_VAL(path, -1);
+       elm_theme_extension_del(NULL, path);
+       free(path);
        return 0;
 }
 
index 58eef07..7e1716f 100644 (file)
@@ -228,8 +228,11 @@ Evas_Object *_gl_ui_create_gridview_ly(void *data, Evas_Object *parent)
        gl_dbg("");
 
        Evas_Object *layout = NULL;
-       layout = gl_ui_load_edj(ad->maininfo.naviframe, GL_EDJ_FILE,
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
+       layout = gl_ui_load_edj(ad->maininfo.naviframe, path,
                                GL_GRP_GRIDVIEW);
+       free(path);
        evas_object_show(layout);
 
        return layout;
index c5ba0ec..2a5e8d7 100644 (file)
@@ -2487,3 +2487,14 @@ int _gl_dlclose_imageviewer(void *data)
        return -1;
 }
 
+char *_gl_get_edje_path(void)
+{
+       char edj_path[1024] = {0};
+       char *path = app_get_resource_path();
+       if (!path) {
+               return NULL;
+       }
+       snprintf(edj_path, 1024, "%s%s/%s", path , "edje", GL_EDJ_FILE);
+       return strdup(edj_path);
+}
+
index e93638b..b031201 100644 (file)
@@ -111,7 +111,10 @@ Evas_Object *_gl_ctrl_add_layout(Evas_Object *parent)
 {
        GL_CHECK_NULL(parent);
        Evas_Object *layout = NULL;
-       layout = gl_ui_load_edj(parent, GL_EDJ_FILE, GL_GRP_CONTROLBAR);
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
+       layout = gl_ui_load_edj(parent, path, GL_GRP_CONTROLBAR);
+       free(path);
        GL_CHECK_NULL(layout);
        evas_object_show(layout);
        return layout;
index ed392e5..bda021a 100644 (file)
@@ -1465,8 +1465,11 @@ void _gl_list_pop_create(void *data, Evas_Object *obj, void *ei, char *title, ch
 
        Evas_Object *ly = elm_layout_add(popup);
        Evas_Object *ly1 = elm_layout_add(ly);
-       elm_layout_file_set(ly, GL_EDJ_FILE, "list_popup_swallow_ly");
-       elm_layout_file_set(ly1, GL_EDJ_FILE, "list_popup_content_ly");
+       char *path = _gl_get_edje_path();
+       GL_CHECK(path);
+       elm_layout_file_set(ly, path, "list_popup_swallow_ly");
+       elm_layout_file_set(ly1, path, "list_popup_content_ly");
+       free(path);
        _gl_ui_set_translate_part_str(ly1, "elm.text", first_text);
        _gl_ui_set_translate_part_str(ly1, "elm.text.second", second_text);
 
@@ -1773,9 +1776,12 @@ int _gl_popup_create_copy_move(void *data, void *sel_cb, void *cb_data)
                               __gl_popup_menu_get_genlist_text, __gl_popup_menu_get_genlist_content,
                               _gl_genlist_item_apend);
        Evas_Object *ly = elm_layout_add(popup);
-       elm_layout_file_set(ly, GL_EDJ_FILE, "list_popup_swallow_ly");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_VAL(path, -1);
+       elm_layout_file_set(ly, path, "list_popup_swallow_ly");
        Evas_Object *ly1 = elm_layout_add(popup);
-       elm_layout_file_set(ly1, GL_EDJ_FILE, "list_popup_content_ly");
+       elm_layout_file_set(ly1, path, "list_popup_content_ly");
+       free(path);
        elm_object_part_content_set(ly, "list", genlist);
        elm_object_content_set(popup, ly);
        int w, h;
index e1b9399..edae48b 100644 (file)
@@ -86,7 +86,10 @@ int gl_pb_make_thread_pbar_wheel(void *data, Evas_Object *parent, char *title)
        eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
                                       __gl_pb_cancel_thread_pbar_cb, data);
        Evas_Object *popupLayout = elm_layout_add(popup);
-       elm_layout_file_set(popupLayout, GL_EDJ_FILE, "popup_text_progressbar_view_layout");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_VAL(path, -1);
+       elm_layout_file_set(popupLayout, path, "popup_text_progressbar_view_layout");
+       free(path);
        evas_object_size_hint_weight_set(popupLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_show(popupLayout);
 
@@ -217,7 +220,10 @@ Evas_Object *gl_pb_make_pbar(void *data, Evas_Object *parent, char *state)
        evas_object_show(label);
 
        layout = elm_layout_add(popup);
-       elm_layout_file_set(layout, GL_EDJ_FILE, "popup_processing");
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
+       elm_layout_file_set(layout, path, "popup_processing");
+       free(path);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
                                         EVAS_HINT_EXPAND);
 
index 9e491d7..8406732 100644 (file)
@@ -296,8 +296,11 @@ Evas_Object *_gl_rotate_bg_add(Evas_Object *parent, bool b_preload)
        GL_CHECK_NULL(bg_data);
 
        Evas_Object *base = NULL;
-       base = _gl_rotate_bg_add_layout(parent, GL_EDJ_FILE,
+       char *path = _gl_get_edje_path();
+       GL_CHECK_NULL(path);
+       base = _gl_rotate_bg_add_layout(parent, path,
                                        GL_ROTATE_BG_GROUP);
+       free(path);
        if (base == NULL) {
                GL_FREE(bg_data);
                return NULL;