Fix prevent issues
[apps/core/preloaded/settings.git] / setting-display / src / setting-display-wallpaper.c
index 8b61cf6..df03f38 100755 (executable)
@@ -1,21 +1,25 @@
 /*
-  * Copyright 2012  Samsung Electronics Co., Ltd
-  *
-  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
-  *
-  * 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.
-  */
-
-
+ * setting
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Contact: MyoungJune Park <mj2004.park@samsung.com>
+ *
+ * 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 <setting-display-wallpaper.h>
+#include <Ecore_X.h>
 
 static int setting_display_wallpaper_create(void *cb);
 static int setting_display_wallpaper_destroy(void *cb);
@@ -29,284 +33,387 @@ setting_view setting_view_display_wallpaper = {
        .cleanup = setting_display_wallpaper_cleanup,
 };
 
-//#define MAX_IMAGE_H_SIZE     (600.0)
-//#define MAX_IMAGE_W_SIZE     (336.0)
-
+#define SETTING_WALLPAPER_HOME_SCREEN "Wallpaper"      // ug-image-viewer parameter
+#define SETTING_WALLPAPER_LOCK_SCREEN "Lockscreen"     // ug-image-viewer parameter
+#define SETTING_WALLPAPER_HOME_AND_LOCK "Wallpaper & Lockscreen"       // ug-image-viewer parameter
+#define SETTING_WALLPAPER_POPUP_TIMER 3
 /* ***************************************************
  *
  *basic func
  *
  ***************************************************/
-
-static void __destroy_gallery_ug_cb(struct ui_gadget *ug, void *priv)
+#if DISABLED_CODE
+static void __setting_display_wallpaper_vconf_change_cb(keynode_t *key, void *data)
 {
        SETTING_TRACE_BEGIN;
+       setting_retm_if(data == NULL, "Data parameter is NULL");
+       SettingDisplayUG *ad = (SettingDisplayUG *)data;
 
-       /* restore the '<-' button on the navigate bar */
-       ret_if(!priv);
-       SettingDisplayUG *ad = (SettingDisplayUG *) priv;       /* ad is point to priv */
-
-       if (ug) {
-               ug_destroy(ug);
-               ad->ug_loading = NULL;
-       }
-
-       Elm_Object_Item *navi_it = elm_naviframe_top_item_get(ad->navi_bar);
-       ret_if(!navi_it);
-       Evas_Object *back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
+       char *vconf_name = vconf_keynode_get_name(key);
 
-       if (back_btn != NULL) {
-               elm_object_style_set(back_btn, NAVI_BACK_BUTTON_STYLE); /* take into effect */
+       if (!safeStrCmp(vconf_name, VCONFKEY_BGSET)) {
+               if (ad->cur_sel == WALLPAPER_CUR_SEL_LOCK_SCREEN) {
+                       ad->cur_sel = WALLPAPER_CUR_SEL_HOME_AND_LOCK_SCREEN;
+               } else if (ad->cur_sel == WALLPAPER_CUR_SEL_NONE) {
+                       ad->cur_sel = WALLPAPER_CUR_SEL_HOME_SCREEN;
+               } else {
+                       /* do nothing */
+               }
+       } else if (!safeStrCmp(vconf_name, VCONFKEY_IDLE_LOCK_BGSET)) {
+               if (ad->cur_sel == WALLPAPER_CUR_SEL_HOME_SCREEN) {
+                       ad->cur_sel = WALLPAPER_CUR_SEL_HOME_AND_LOCK_SCREEN;
+               } else if (ad->cur_sel == WALLPAPER_CUR_SEL_NONE) {
+                       ad->cur_sel = WALLPAPER_CUR_SEL_LOCK_SCREEN;
+               } else {
+                       /* do nothing */
+               }
        }
 }
 
-static void setting_display_wallpaper_string_vconf_change_cb(keynode_t *key,
-                                                            void *data)
+static int __setting_display_wallpaper_listen_vconf_change(void *data)
 {
-       SettingDisplayUG *ad = data;
-       if (!ad)
-               return;         /*  do nothing if ad is NULL */
-       char *value = vconf_keynode_get_str(key);
-       char *vconf_name = vconf_keynode_get_name(key);
+       SETTING_TRACE_BEGIN;
+       int ret = 0;
+       ret = vconf_notify_key_changed(VCONFKEY_BGSET,
+                       __setting_display_wallpaper_vconf_change_cb, data);
+       setting_retvm_if(ret < 0, ret, "%s notifications Failed(%d)", (char *)VCONFKEY_BGSET, ret);
+
+       ret = vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_BGSET,
+                       __setting_display_wallpaper_vconf_change_cb, data);
+       setting_retvm_if(ret < 0, ret, "%s notifications Failed(%d)", (char *)VCONFKEY_IDLE_LOCK_BGSET, ret);
+       return ret;
+}
 
-       int w;
-       int h;
-       ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+static int __setting_display_wallpaper_unlisten_vconf_change()
+{
+       SETTING_TRACE_BEGIN;
+       (void)vconf_ignore_key_changed(VCONFKEY_BGSET,
+                                      __setting_display_wallpaper_vconf_change_cb);
+       (void)vconf_ignore_key_changed(VCONFKEY_IDLE_LOCK_BGSET,
+                                      __setting_display_wallpaper_vconf_change_cb);
+       return 0;
+}
+#endif
 
-       double max_image_w_size = w/2 - w*0.03;
-       double max_image_h_size = h*0.46875;
+static void __setting_display_wallpaper_imageviewer_ug_result_cb(ui_gadget_h ug, service_h result, void *priv)
+{
+       SETTING_TRACE_BEGIN;
+       /* error check */
+       retm_if(priv == NULL, "Data parameter is NULL");
+
+       SettingDisplayUG *ad = (SettingDisplayUG *) priv;
+
+       if (result) {
+               char *path = NULL;
+               switch(ad->cur_sel) {
+               case WALLPAPER_CUR_SEL_HOME_SCREEN:
+               {
+                       service_get_extra_data(result, "homescreen_path", &path);
+                       if (path == NULL) {
+                               ad->wallpaper_changed = EINA_FALSE;
+                               return;
+                       }
+                       break;
+               }
+               case WALLPAPER_CUR_SEL_LOCK_SCREEN:
+               {
+                       service_get_extra_data(result, "lockscreen_path", &path);
+                       if (path == NULL) {
+                               ad->wallpaper_changed = EINA_FALSE;
+                               return;
+                       }
+                       break;
+               }
+               case WALLPAPER_CUR_SEL_HOME_AND_LOCK_SCREEN:
+               {
+                       service_get_extra_data(result, "homescreen_path", &path);
+                       if (path == NULL) {
+                               ad->wallpaper_changed = EINA_FALSE;
+                               return;
+                       }
+                       service_get_extra_data(result, "lockscreen_path", &path);
+                       if (path == NULL) {
+                               ad->wallpaper_changed = EINA_FALSE;
+                               return;
+                       }
+                       break;
+               }
+               default:
+                       ad->wallpaper_changed = EINA_FALSE;
+                       return;
+               }
+
+               ad->wallpaper_changed = EINA_TRUE;
+       }
+}
 
-       if (!safeStrCmp(vconf_name, VCONFKEY_BGSET)) {
-               evas_object_image_file_set(ad->img_homescreen, NULL, NULL);     /* give a littile time for gallery to copy the tmp file */
-               Evas_Object *temp_img = evas_object_image_add(ad->evas);
-               int temp_w;
-               int temp_h;
-               double ratio_w, ratio_h, ratio;
-
-               /* A:VCONFKEY_BGSET */
-               evas_object_image_file_set(temp_img, value, NULL);
-               evas_object_image_size_get(temp_img, &temp_w, &temp_h);
-               SETTING_TRACE("temp_w:%d, temp_h:%d", temp_w, temp_h);
-               ratio_w = temp_w / max_image_w_size;
-               ratio_h = temp_h / max_image_h_size;
-               ratio = (ratio_w > ratio_h ? ratio_w : ratio_h);
-               SETTING_TRACE("ratio_w:%f, ratio_h:%f, ratio:%f", ratio_w,
-                             ratio_h, ratio);
-
-               evas_object_image_file_set(ad->img_homescreen, value, NULL);
-               evas_object_image_fill_set(ad->img_homescreen, 0, 0,
-                                          temp_w / ratio, temp_h / ratio);
-               evas_object_size_hint_min_set(ad->img_homescreen,
-                                             temp_w / ratio, temp_h / ratio);
-               evas_object_del(temp_img);
+static void __setting_display_wallpaper_imageviewer_ug_destroy_cb(ui_gadget_h ug, void *priv)
+{
+       SETTING_TRACE_BEGIN;
+       setting_retm_if(priv == NULL, "Data parameter is NULL");
+       SettingDisplayUG *ad = (SettingDisplayUG *) priv;       /* ad is point to priv */
 
-       } else if (!safeStrCmp(vconf_name, VCONFKEY_IDLE_LOCK_BGSET)) {
-               /* SETTING_TRACE("vconf_name is %s.\tvalue is %s", vconf_name, value); */
-               evas_object_image_file_set(ad->img_lockscreen, NULL, NULL);     /* give a littile time for gallery to copy the tmp file */
-               Evas_Object *temp_img = evas_object_image_add(ad->evas);
-               int temp_w;
-               int temp_h;
-               double ratio_w, ratio_h, ratio;
-               /* A:VCONFKEY_BGSET */
-               evas_object_image_file_set(temp_img, value, NULL);
-               evas_object_image_size_get(temp_img, &temp_w, &temp_h);
-               SETTING_TRACE("temp_w:%d, temp_h:%d", temp_w, temp_h);
-               ratio_w = temp_w / max_image_w_size;
-               ratio_h = temp_h / max_image_h_size;
-               ratio = (ratio_w > ratio_h ? ratio_w : ratio_h);
-               SETTING_TRACE("ratio_w:%f, ratio_h:%f, ratio:%f", ratio_w,
-                             ratio_h, ratio);
-
-               evas_object_image_file_set(ad->img_lockscreen, value, NULL);
-               evas_object_image_fill_set(ad->img_lockscreen, 0, 0,
-                                          temp_w / ratio, temp_h / ratio);
-               evas_object_size_hint_min_set(ad->img_lockscreen,
-                                             temp_w / ratio, temp_h / ratio);
-               evas_object_del(temp_img);
+       if (ug) {
+               ug_destroy(ug);
+               ad->ug_imageviewer = NULL;
+       }
 
+       if (ad->wallpaper_changed) {
+               if (ad->ug_gallery) {
+                       ug_destroy(ad->ug_gallery);
+                       ad->ug_gallery = NULL;
+               }
+
+               char text[MAX_DISPLAY_NAME_LEN_ON_UI +1] = {0, };
+               SETTING_TRACE("cur_sel = %d", ad->cur_sel);
+
+               switch(ad->cur_sel) {
+               case WALLPAPER_CUR_SEL_HOME_SCREEN:
+                       snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s", SETTING_WALLPAPER_HOME_SCREEN_CHANGED);
+                       break;
+               case WALLPAPER_CUR_SEL_LOCK_SCREEN:
+                       snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s", SETTING_WALLPAPER_LOCK_SCREEN_CHANGED);
+                       break;
+               case WALLPAPER_CUR_SEL_HOME_AND_LOCK_SCREEN:
+                       snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s", SETTING_WALLPAPER_HOME_AND_LOCK_SCREEN_CHANGED);
+                       break;
+               default:
+                       ad->cur_sel = WALLPAPER_CUR_SEL_NONE;
+                       return;
+               }
+
+               setting_create_sel_info_popup(ad->view_layout,
+                                             &(ad->selInfoPop_layout),
+                                             &(ad->selInfoPop));
+               elm_notify_timeout_set(ad->selInfoPop, SETTING_WALLPAPER_POPUP_TIMER);
+
+               edje_object_part_text_set(_EDJ(ad->selInfoPop_layout), "elm.text", text);
+               ad->cur_sel = WALLPAPER_CUR_SEL_NONE;
+               ad->wallpaper_changed = EINA_FALSE;
+       } else {
+               SETTING_TRACE("wallpaper not changed");
        }
 }
 
-int setting_display_wallpaper_listen_vconf_change(void *data)
+static void __setting_display_wallpaper_gallery_ug_result_cb(ui_gadget_h ug, service_h result, void *priv)
 {
        SETTING_TRACE_BEGIN;
-       int ret;
-       ret =
-           vconf_notify_key_changed(VCONFKEY_BGSET,
-                                    setting_display_wallpaper_string_vconf_change_cb,
-                                    data);
-       setting_retvm_if(ret < 0, ret, "%s notifications Failed(%d)",
-                        (char *)VCONFKEY_BGSET, ret);
-
-       ret =
-           vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_BGSET,
-                                    setting_display_wallpaper_string_vconf_change_cb,
-                                    data);
-       setting_retvm_if(ret < 0, ret, "%s notifications Failed(%d)",
-                        (char *)VCONFKEY_IDLE_LOCK_BGSET, ret);
-       return ret;
+       /* error check */
+       retm_if(priv == NULL, "Data parameter is NULL");
+
+       SettingDisplayUG *ad = (SettingDisplayUG *) priv;
+
+       if (result) {
+               char *path = NULL;
+               service_get_extra_data(result, "path", &path);
+               setting_retm_if(path == NULL, "path is NULL");
+
+               service_h service;
+               if (service_create(&service)) {
+                       return;
+               }
+
+               service_add_extra_data(service, "Path", path);
+               service_add_extra_data(service, "View Mode", "SETAS");
+
+               SETTING_TRACE("Path = %s", path);
+
+               switch(ad->cur_sel) {
+               case WALLPAPER_CUR_SEL_HOME_SCREEN:
+                       service_add_extra_data(service, "Setas type", SETTING_WALLPAPER_HOME_SCREEN);
+                       break;
+               case WALLPAPER_CUR_SEL_LOCK_SCREEN:
+                       service_add_extra_data(service, "Setas type", SETTING_WALLPAPER_LOCK_SCREEN);
+                       break;
+               case WALLPAPER_CUR_SEL_HOME_AND_LOCK_SCREEN:
+                       service_add_extra_data(service, "Setas type", SETTING_WALLPAPER_HOME_AND_LOCK);
+                       break;
+               default:
+                       service_destroy(service);
+                       SETTING_TRACE_ERROR("ad->cur_sel is error");
+                       return;
+               }
+
+               struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
+               if (!cbs) {
+                       service_destroy(service);
+                       return;
+               }
+
+               cbs->layout_cb = setting_display_layout_ug_cb;
+               cbs->result_cb = __setting_display_wallpaper_imageviewer_ug_result_cb;
+               cbs->destroy_cb = __setting_display_wallpaper_imageviewer_ug_destroy_cb;
+               cbs->priv = (void *)ad;
+
+               ad->ug_imageviewer = ug_create(ad->ug, "image-viewer-efl", UG_MODE_FULLVIEW, service, cbs);
+
+               if (NULL == ad->ug_imageviewer) {       /* error handling */
+                       SETTING_TRACE_ERROR("NULL == ad->ug_imageviewer");
+                       setting_create_simple_popup(ad, ad->win_get, NULL, _(UNSUPPORTED_FUNCTION));
+               }
+
+               service_destroy(service);
+               FREE(cbs);
+       }
 }
 
-int setting_display_wallpaper_unlisten_vconf_change(void *data)
+static void __setting_display_wallpaper_gallery_ug_destroy_cb(ui_gadget_h ug, void *priv)
 {
        SETTING_TRACE_BEGIN;
+       setting_retm_if(priv == NULL, "Data parameter is NULL");
+       SettingDisplayUG *ad = (SettingDisplayUG *) priv;       /* ad is point to priv */
 
-       (void)vconf_ignore_key_changed(VCONFKEY_BGSET,
-                                      setting_display_wallpaper_string_vconf_change_cb);
-       (void)vconf_ignore_key_changed(VCONFKEY_IDLE_LOCK_BGSET,
-                                      setting_display_wallpaper_string_vconf_change_cb);
-   return 0;
+       if (ad->ug_imageviewer == NULL) {
+               ug_destroy(ug);
+               ad->ug_gallery = NULL;
+       } else {
+               return;
+       }
+
+       Elm_Object_Item *navi_it = elm_naviframe_top_item_get(ad->navi_bar);
+       retm_if(navi_it == NULL, "navi_it is NULL");
+       Evas_Object *back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
+
+       if (back_btn != NULL) {
+               elm_object_style_set(back_btn, NAVI_BACK_BUTTON_STYLE); /* take into effect */
+       }
 }
 
-static void
-__wall_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+static void __setting_display_wallpaper_ug_launch(void *data)
 {
        SETTING_TRACE_BEGIN;
+       setting_retm_if(data == NULL, "Data parameter is NULL");
        SettingDisplayUG *ad = (SettingDisplayUG *) data;
-       if (!ad) return;                /*  do nothing if ad is NULL */
 
-       if (ad->ug_loading) return; // prevent double-clicked
-               
-       bundle *b = bundle_create();
-       if (!b) {
+       service_h svc;
+       if (service_create(&svc)) {
                return;
        }
 
-       bundle_add(b, "launch-type", "select-setas");
-       bundle_add(b, "setas-type", "wallpaper");
-       bundle_add(b, "file-type", "image");
+       service_add_extra_data(svc, "launch-type", "select-one");
+       service_add_extra_data(svc, "file-type", "image");
 
        struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
        if (!cbs) {
-               bundle_free(b);
+               service_destroy(svc);
                return;
        }
 
        cbs->layout_cb = setting_display_layout_ug_cb;
-       cbs->result_cb = NULL;
-       cbs->destroy_cb = __destroy_gallery_ug_cb;
+       cbs->result_cb = __setting_display_wallpaper_gallery_ug_result_cb;
+       cbs->destroy_cb = __setting_display_wallpaper_gallery_ug_destroy_cb;
        cbs->priv = (void *)ad;
 
-       ad->ug_loading =
-           ug_create(ad->ug, "gallery-efl", UG_MODE_FULLVIEW, b, cbs);
-
-       if (NULL == ad->ug_loading) {   /* error handling */
-               SETTING_TRACE_ERROR("NULL == ad->ug_loading");
-        setting_create_popup_without_title(ad, ad->win_get, _("Cannot support this function"));
-               // popup message 
+       ad->ug_gallery = ug_create(ad->ug, "gallery-efl", UG_MODE_FULLVIEW, svc, cbs);
+       SETTING_TRACE("ad->ug_gallery = %p", ad->ug_gallery);
 
+       if (NULL == ad->ug_gallery) {   /* error handling */
+               SETTING_TRACE_ERROR("NULL == ad->ug_gallery");
+               setting_create_simple_popup(ad, ad->win_get, NULL, _(UNSUPPORTED_FUNCTION));
        }
-       bundle_free(b);
+
+       service_destroy(svc);
        FREE(cbs);
 }
 
+static void __setting_display_wallpaper_mouse_up_Gendial_list_cb(void *data, Evas_Object * obj, void *event_info)
+{
+       //error check
+       setting_retm_if(data == NULL, "Data parameter is NULL");
+       setting_retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+
+       Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+       elm_genlist_item_selected_set(item, 0);
+       Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
+
+       SettingDisplayUG *ad = (SettingDisplayUG *) data;
+
+       if (!safeStrCmp("IDS_ST_MBODY_HOME_SCREEN_WALLPAPER", list_item->keyStr)) {
+               ad->cur_sel = WALLPAPER_CUR_SEL_HOME_SCREEN;
+               __setting_display_wallpaper_ug_launch(ad);
+       } else if (!safeStrCmp("IDS_ST_MBODY_LOCK_SCREEN_WALLPAPER_M_NOUN", list_item->keyStr)) {
+               ad->cur_sel = WALLPAPER_CUR_SEL_LOCK_SCREEN;
+               __setting_display_wallpaper_ug_launch(ad);
+       } else if (!safeStrCmp(SETTING_WALLPAPER_HOME_AND_LOCK_SCREEN, list_item->keyStr)) {
+               ad->cur_sel = WALLPAPER_CUR_SEL_HOME_AND_LOCK_SCREEN;
+               __setting_display_wallpaper_ug_launch(ad);
+       } else {
+               /* do nothing */
+       }
+
+}
+
 static int setting_display_wallpaper_create(void *cb)
 {
        SETTING_TRACE_BEGIN;
        retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
 
        SettingDisplayUG *ad = (SettingDisplayUG *) cb; /* ad is point to cb */
+       ad->cur_sel = WALLPAPER_CUR_SEL_NONE;
+
+       Evas_Object *controllbar = NULL;
+       Evas_Object *scroller = NULL;
+       scroller = elm_genlist_add(ad->win_main_layout);
+       elm_object_style_set(scroller, "dialogue");
+       retvm_if(scroller == NULL, SETTING_RETURN_FAIL, "Cannot set scroller object as contento of layout");
+       elm_genlist_clear(scroller);    /* first to clear list */
+
+       ad->ly_wall = setting_create_layout_navi_bar(ad->win_main_layout, ad->win_get,
+                                          _(KeyStr_Wallpaper),
+                                          _("IDS_COM_BODY_BACK"), NULL, NULL,
+                                          setting_display_wallpaper_click_softkey_cancel_cb,
+                                          NULL, NULL, ad, scroller,
+                                          &ad->navi_bar, &controllbar);
+
+       Elm_Object_Item *item = NULL;
+       item = elm_genlist_item_append(scroller, &(ad->itc_seperator), NULL, NULL,
+                               ELM_GENLIST_ITEM_NONE, NULL, NULL);
+       elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+       ad->data_home_screen =
+               setting_create_Gendial_field_def(scroller, &(ad->itc_1text),
+                                            __setting_display_wallpaper_mouse_up_Gendial_list_cb,
+                                            ad, SWALLOW_Type_INVALID, NULL,
+                                            NULL, 0, "IDS_ST_MBODY_HOME_SCREEN_WALLPAPER",
+                                            NULL, NULL);
+       if (ad->data_home_screen) {
+               ad->data_home_screen->userdata = ad;
+       } else {
+               SETTING_TRACE_ERROR("ad->screen_reader is NULL");
+               return SETTING_RETURN_FAIL;
+       }
 
-       Evas_Object *sub_layout = elm_layout_add(ad->win_main_layout);
-       elm_layout_file_set(sub_layout, SETTING_THEME_EDJ_NAME,
-                           "wallpaper_layout");
-       evas_object_size_hint_weight_set(sub_layout, EVAS_HINT_EXPAND,
-                                        EVAS_HINT_EXPAND);
-
-       ad->ly_wall =
-           setting_create_layout_navi_bar_scroller(ad->win_main_layout,
-                                                   ad->win_get,
-                                                   _(KeyStr_Wallpaper),
-                                                   (char *)dgettext("sys_string", "IDS_COM_BODY_BACK"),
-                                                   NULL,
-                                                   setting_display_wallpaper_click_softkey_cancel_cb,
-                                                   NULL, ad, &(ad->scrl_wall),
-                                                   &(ad->navi_bar));
-
-       /* pack outer box into scroller */
-       elm_object_content_set(ad->scrl_wall, sub_layout);
-
-       int w;
-       int h;
-       ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-
-       double max_image_w_size = w/2 - w*0.03;
-       double max_image_h_size = h*0.46875;
-
-       /* elm_scroller_content_set(scroller, sub_layout); */
-       Evas_Object *eo_left, *eo_right;
-       Evas_Object *temp_img = evas_object_image_add(ad->evas);
-       int temp_w;
-       int temp_h;
-       double ratio_w, ratio_h, ratio;
-       char *pa_image_path = NULL;
-
-       /* A:VCONFKEY_BGSET */
-       pa_image_path = vconf_get_str(VCONFKEY_BGSET);
-       evas_object_image_file_set(temp_img, pa_image_path, NULL);
-       evas_object_image_size_get(temp_img, &temp_w, &temp_h);
-       SETTING_TRACE("temp_w:%d, temp_h:%d", temp_w, temp_h);
-       ratio_w = temp_w / max_image_w_size;
-       ratio_h = temp_h / max_image_h_size;
-       ratio = (ratio_w > ratio_h ? ratio_w : ratio_h);
-       SETTING_TRACE("ratio_w:%f, ratio_h:%f, ratio:%f", ratio_w, ratio_h,
-                     ratio);
-       create_image_box_add_ex(NULL, ad->win_main_layout, ad->evas, pa_image_path,
-                               temp_w / ratio, temp_h / ratio, NULL, NULL,
-                               &eo_left, &(ad->img_homescreen));
-
-       evas_object_del(temp_img);
-       FREE(pa_image_path);
-
-       /*  temp_img are being used in both bgset & lock screen. */
-       Evas_Object *temp_img2 = evas_object_image_add(ad->evas);
-
-       /* B:VCONFKEY_IDLE_LOCK_BGSET */
-       pa_image_path = vconf_get_str(VCONFKEY_IDLE_LOCK_BGSET);
-       evas_object_image_file_set(temp_img2, pa_image_path, NULL);
-       evas_object_image_size_get(temp_img2, &temp_w, &temp_h);
-       SETTING_TRACE("temp_w:%d, temp_h:%d", temp_w, temp_h);
-       ratio_w = temp_w / max_image_w_size;
-       ratio_h = temp_h / max_image_h_size;
-       ratio = (ratio_w > ratio_h ? ratio_w : ratio_h);
-       SETTING_TRACE("ratio_w:%f, ratio_h:%f, ratio:%f", ratio_w, ratio_h,
-                     ratio);
-       create_image_box_add_ex(NULL, ad->win_main_layout, ad->evas, pa_image_path,
-                               temp_w / ratio, temp_h / ratio, NULL, NULL,
-                               &eo_right, &(ad->img_lockscreen));
-       evas_object_del(temp_img2);
-       FREE(pa_image_path);
-
-       elm_object_part_content_set(sub_layout, "left_swallow", eo_left);
-       elm_object_part_content_set(sub_layout, "right_swallow", eo_right);
-
-       edje_object_part_text_set(_EDJ(sub_layout), "left_text",
-                                 _(KeyStr_HomeScreen));
-       edje_object_part_text_set(_EDJ(sub_layout), "right_text",
-                                 _(KeyStr_LockedScreen));
-
-       /*  button : change wallpaper */
-       Evas_Object *btn = elm_button_add(sub_layout);
-       elm_object_text_set(btn, _(SETING_DISPLAY_WALLPAPER_CHANGE_WALLPAPER_STR));
-       evas_object_smart_callback_add(btn, "clicked", __wall_button_clicked_cb,
-                                      ad);
-       elm_object_part_content_set(sub_layout, "btn", btn);
-
-       SETTING_TRACE_DEBUG("get theme : %d", setting_get_theme());
-       if (Theme_Tizen_Black == setting_get_theme()) {
-               SETTING_TRACE_DEBUG("black theme");
-               elm_object_style_set(btn, "sweep");
-               edje_object_signal_emit(_EDJ(sub_layout), "change,non-white,theme", "elm");
-       } else if  (Theme_Tizen_Blue == setting_get_theme()) {
-               SETTING_TRACE_DEBUG("blue theme");
-               edje_object_signal_emit(_EDJ(sub_layout), "change,non-white,theme", "elm");
-       } else if  (Theme_Tizen_Grey == setting_get_theme()) {
-               SETTING_TRACE_DEBUG("grey theme");
-               edje_object_signal_emit(_EDJ(sub_layout), "change,non-white,theme", "elm");
+       ad->data_lock_screen =
+               setting_create_Gendial_field_def(scroller, &(ad->itc_1text),
+                                            __setting_display_wallpaper_mouse_up_Gendial_list_cb,
+                                            ad, SWALLOW_Type_INVALID, NULL,
+                                            NULL, 0, "IDS_ST_MBODY_LOCK_SCREEN_WALLPAPER_M_NOUN",
+                                            NULL, NULL);
+       if (ad->data_lock_screen) {
+               ad->data_lock_screen->userdata = ad;
+       } else {
+               SETTING_TRACE_ERROR("ad->screen_reader is NULL");
+               return SETTING_RETURN_FAIL;
        }
 
+       ad->data_home_lock_screen =
+               setting_create_Gendial_field_def(scroller, &(ad->itc_1text),
+                                            __setting_display_wallpaper_mouse_up_Gendial_list_cb,
+                                            ad, SWALLOW_Type_INVALID, NULL,
+                                            NULL, 0, SETTING_WALLPAPER_HOME_AND_LOCK_SCREEN,
+                                            NULL, NULL);
+       if (ad->data_home_lock_screen) {
+               ad->data_home_lock_screen->userdata = ad;
+       } else {
+               SETTING_TRACE_ERROR("ad->screen_reader is NULL");
+               return SETTING_RETURN_FAIL;
+       }
+
+       ad->wallpaper_changed = EINA_FALSE;
        setting_view_display_wallpaper.is_create = 1;
-       setting_display_wallpaper_listen_vconf_change(ad);
+#if DISABLED_CODE
+       __setting_display_wallpaper_listen_vconf_change(ad);
+#endif
        return SETTING_RETURN_SUCCESS;
 }
 
@@ -317,10 +424,18 @@ static int setting_display_wallpaper_destroy(void *cb)
        retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
 
        SettingDisplayUG *ad = (SettingDisplayUG *) cb; /* ad is point to cb */
-       setting_display_wallpaper_unlisten_vconf_change(ad);
+#if DISABLED_CODE
+       __setting_display_wallpaper_unlisten_vconf_change();
+#endif
+
+       if (ad->selInfoPop) {
+               evas_object_del(ad->selInfoPop);
+               ad->selInfoPop = NULL;
+       }
 
        if (ad->ly_wall != NULL) {
                evas_object_del(ad->ly_wall);
+               ad->ly_wall = NULL;
        }
        setting_view_display_wallpaper.is_create = 0;
 
@@ -334,6 +449,7 @@ static int setting_display_wallpaper_update(void *cb)
 
 static int setting_display_wallpaper_cleanup(void *cb)
 {
+       SETTING_TRACE_BEGIN;
        return SETTING_RETURN_SUCCESS;
 }