merge from master
authorJisung Ahn <jcastle.ahn@samsung.com>
Fri, 14 Dec 2012 10:25:34 +0000 (19:25 +0900)
committerJisung Ahn <jcastle.ahn@samsung.com>
Fri, 14 Dec 2012 10:25:34 +0000 (19:25 +0900)
Change-Id: I79bb9c047cdae8a446887f64652e11d462f568b8

23 files changed:
common/include/ivug-db.h [changed mode: 0644->0755]
common/include/ivug-util.h [changed mode: 0644->0755]
common/src/ivug-db.c [changed mode: 0644->0755]
common/src/ivug-util.c
include/ivug-define.h
main/layout/ivug-crop-view.edc [changed mode: 0644->0755]
main/src/control/ivug-crop-ug.cpp [changed mode: 0644->0755]
main/src/control/ivug-crop-ug.h [changed mode: 0644->0755]
main/src/control/ivug-parameter.c
main/src/include/ivug-common.h [changed mode: 0644->0755]
main/src/include/ivug-crop-view.h [changed mode: 0644->0755]
main/src/slider/ivug-slider.cpp
main/src/ug-image-viewer.cpp
main/src/view/ivug-crop-view.cpp
main/src/view/ivug-main-view-menu.cpp
main/src/view/ivug-main-view-toolbar.cpp
main/src/view/ivug-name-view.c
main/src/view/ivug-setas-view.c
medialist/include/ivug-media.h
medialist/include/ivug-medialist.h [changed mode: 0644->0755]
medialist/src/ivug-mediadata.c
medialist/src/ivug-medialist.c [changed mode: 0644->0755]
res/include/ivug-string.h

old mode 100644 (file)
new mode 100755 (executable)
index 8a793da..6201873
@@ -30,9 +30,18 @@ typedef void *media_handle;
 typedef void *tag_handle;
 
 typedef bool (*ivug_db_cb)(media_handle media, void *user_data);
+typedef bool (*ivug_db_path_cb)(media_handle media, const char *path, void *user_data);
 
 #define IVUG_MAX_CONDITION_LEN (1024)
 
+typedef struct _Ivug_DB_h
+{
+       ivug_db_path_cb callback;
+       media_handle *m_handle;
+       void *data;
+       int key;
+}Ivug_DB_h;
+
 bool ivug_db_create(void);
 bool ivug_db_destroy(void);
 
@@ -80,6 +89,9 @@ char *ivug_db_get_tag_name(tag_handle media);
 bool ivug_db_get_file_size(media_handle media, unsigned long long *size);
 
 
+Ivug_DB_h * ivug_db_create_thumbnail(media_handle media, ivug_db_path_cb callback, void *data);
+bool ivug_db_cancel_thumbnail(Ivug_DB_h *db_h);
+
 #ifdef __cplusplus
 }
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index f7ebd09..7b96fc7
@@ -75,7 +75,7 @@ double ivug_atod(const char *number);
 
 long int ivug_atox(const char *number);
 
-char * ivug_generate_file_name(const char *filepath, const char *extension);
+char * ivug_generate_file_name(const char *filepath, const char *extension, const char *dest_dir);
 
 /*
        Removes leading and trailing whitespace from string
@@ -90,6 +90,7 @@ bool ivug_is_bestpic(const char *file);
 */
 char * ivug_get_icu_date(time_t mtime);
 
+bool ivug_validate_file_name(const char *fname);
 
 #ifdef __cplusplus
 }
old mode 100644 (file)
new mode 100755 (executable)
index 5fbf7e1..cfca679
@@ -25,6 +25,8 @@
 #define LOG_LVL DBG_MSG_LVL_HIGH
 #define LOG_CAT "IV-DB"
 
+#define DB_KEY (0x12341234)
+
 typedef struct _Ivug_DB
 {
        ivug_db_cb callback;
@@ -53,6 +55,29 @@ static char *_strerror_db(int error)
        }
 }
 
+static void _ivug_thumb_cb(media_content_error_e error,
+                                      const char *path, void *data)
+{
+       Ivug_DB_h *db_h = (Ivug_DB_h *)data;
+
+       MSG_HIGH("_ivug_thumb_cb, path =%s", path);
+
+       if(db_h->callback == NULL || db_h->key != DB_KEY)
+       {
+               MSG_WARN("handle was freed");
+               return;
+       }
+
+       if(path == NULL)
+       {
+               MSG_ERROR("thumbnail path is NULL");
+               db_h->callback(db_h->m_handle, NULL, db_h->data);
+               return;
+       }
+
+       db_h->callback(db_h->m_handle, path, db_h->data);
+}
+
 bool ivug_db_create(void)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -267,7 +292,7 @@ media_handle ivug_db_insert_file_to_DB(const char* filepath)
        int ret = MEDIA_CONTENT_ERROR_NONE;
 
        if (ivug_is_web_uri(filepath) == true)
-               return false;
+               return NULL;
 
        media_handle m_handle = NULL;
 
@@ -713,4 +738,46 @@ bool ivug_db_get_file_size(media_handle media, unsigned long long *size)
        return true;
 }
 
+Ivug_DB_h * ivug_db_create_thumbnail(media_handle media, ivug_db_path_cb callback, void *data)
+{
+       media_info_h item = (media_info_h)media;
+
+       Ivug_DB_h *db_h = (Ivug_DB_h *)calloc(1, sizeof(Ivug_DB_h));
+       db_h->m_handle = media;
+       db_h->callback = callback;
+       db_h->data = data;
+       db_h->key = DB_KEY;
+
+       int ret = media_info_create_thumbnail(item, _ivug_thumb_cb, db_h);
+       if(ret != MEDIA_CONTENT_ERROR_NONE)
+       {
+               MSG_ERROR("media_info_get_size, err = %s", _strerror_db(ret));
+               free(db_h);
+               return NULL;
+       }
+
+       return db_h;
+}
+
+bool ivug_db_cancel_thumbnail(Ivug_DB_h *db_h)
+{
+       media_info_h item = (media_info_h)db_h->m_handle;
+
+       int ret = media_info_cancel_thumbnail(item);
+       if(ret != MEDIA_CONTENT_ERROR_NONE)
+       {
+               MSG_ERROR("media_info_cancel_thumbnail, err = %s", _strerror_db(ret));
+               return false;
+       }
+
+       db_h->m_handle = NULL;
+       db_h->callback = NULL;
+       db_h->data = NULL;
+       db_h->key = 0;
+
+       free(db_h);
+
+       return true;
+}
+
 
index ed963bc..ff662fc 100755 (executable)
@@ -354,7 +354,7 @@ double ivug_atod(const char *number)
        return val;
 }
 
-char * ivug_generate_file_name(const char *filepath, const char *extension)
+char * ivug_generate_file_name(const char *filepath, const char *extension, const char *dest_dir)
 {
        IV_ASSERT(filepath != NULL);
 
@@ -363,7 +363,7 @@ char * ivug_generate_file_name(const char *filepath, const char *extension)
        char tempname[IVUG_MAX_FILE_PATH_LEN+1] = {0,};
        char *ext = NULL;
        char *filename = ecore_file_strip_ext(ecore_file_file_get(filepath));
-       char *dir = ecore_file_dir_get(filepath);
+       char *dir = NULL;
 
        if(extension)
        {
@@ -374,6 +374,15 @@ char * ivug_generate_file_name(const char *filepath, const char *extension)
                ext = ivug_fileinfo_get_file_extension(filepath);
        }
 
+       if(dest_dir)
+       {
+               dir = strdup(dest_dir);
+       }
+       else
+       {
+               dir = ecore_file_dir_get(filepath);
+       }
+
        int i = 0;
 
        for(i=1; i<IVUG_MAX_FILE_PATH_LEN; i++)
@@ -387,6 +396,10 @@ char * ivug_generate_file_name(const char *filepath, const char *extension)
        {
                free(filename);
        }
+       if(dir)
+       {
+               free(dir);
+       }
        if(ext)
        {
                free(ext);
index 308e6cc..1033760 100755 (executable)
@@ -34,6 +34,8 @@ ADD_DEFINITIONS("-D_USE_MEDIAINFO_STRINGID_")
 
 #define USE_CUSTOM_STYLE
 
+#define IVUG_INVALID_INDEX (0)                         // index was not set
+
 /*
        Time analysis data will be stored as file
 */
old mode 100644 (file)
new mode 100755 (executable)
index 1876b56..39f10ca
@@ -22,6 +22,8 @@
 #define PROGRESSBAR_WIDTH      100
 #define PROGRESSBAR_HEIGHT     100
 
+#define NOTIFY_HEIGHT  35
+
 collections {
    group {
                name: "crop_view";
@@ -42,6 +44,47 @@ collections {
                                }
                        }
 
+                       part { name: "crop.contents";
+                               type: RECT;
+                               scale: 1;
+                               repeat_events: 0;
+                               description { state: "default" 0.0;
+                                       color: 0 0 0 100;
+                                       align: 0.0 0.0;
+                                       rel1.relative: 0.0 0.0;
+                                       rel1.to_x: "bg";
+                                       rel1.to_y: "bg";
+                                       rel1.offset: 0 -10;
+                                       rel2.relative: 1.0 0.0;
+                                       rel2.to_x: "bg";
+                                       rel2.to_y: "toolbar_bg";
+                                       rel2.offset: 0 -NOTIFY_HEIGHT;  //for notify
+                                       visible: 1;
+                               }
+                       }
+
+                       part { name: "crop.contents.swallow";
+                               type: SWALLOW;
+                               scale: 1;
+                               repeat_events: 0;
+                               description { state: "default" 0.0;
+                                       rel1 { relative: 0 0; to:crop.contents; }
+                                       rel2 { relative: 1 1; to:crop.contents; }
+                                       visible: 1;
+                               }
+                       }
+
+                       part { name: "crop.contents.swallow.notify";
+                               type: RECT;
+                               scale: 1;
+                               repeat_events: 0;
+                               description { state: "default" 0.0;
+                                       rel1 { relative: 0 0; to:crop.contents; }
+                                       rel2 { relative: 1 1; to:crop.contents; offset: 0 NOTIFY_HEIGHT;}
+                                       visible: 1;
+                               }
+                       }
+
                        part{
                                name: "photocam";
                                type: SWALLOW;
@@ -51,8 +94,8 @@ collections {
                                description {
                                        state: "default" 0.0;
                                        visible: 1;
-                                       rel1 { relative: 0 0; to:bg; }
-                                       rel2 { relative: 1 1; to:bg; }
+                                       rel1 { relative: 0 0; to:crop.contents; }
+                                       rel2 { relative: 1 1; to:crop.contents; }
                                }
                         }
 
@@ -64,8 +107,8 @@ collections {
                                         state: "default" 0.0;
                                         align: 0.5 0.5;
                                         visible: 1;
-                                        rel1 { relative: 0 0; to:bg; }
-                                        rel2 { relative: 1 1; to:bg; }
+                                        rel1 { relative: 0 0; to:crop.contents; }
+                                        rel2 { relative: 1 1; to:crop.contents; }
                                 }
                        }
 
@@ -109,26 +152,8 @@ collections {
                                description {
                                        state: "default" 0.0;
                                        visible: 1;
-                                       rel1 { relative: 0 0; to:bg; }
-                                       rel2 { relative: 1 1; to:bg; }
-                               }
-                        }
-
-                       part { name: "crop.contents";
-                               type: SWALLOW;
-                               scale: 1;
-                               repeat_events: 0;
-                               description { state: "default" 0.0;
-                                       color: 255 0 0 100;
-                                       align: 0.0 0.0;
-                                       rel1.relative: 0.0 0.0;
-                                       rel1.to_x: "bg";
-                                       rel1.to_y: "bg";
-                                       rel1.offset: 0 -10;
-                                       rel2.relative: 1.0 0.0;
-                                       rel2.to_x: "bg";
-                                       rel2.to_y: "toolbar_bg";
-                                       visible: 1;
+                                       rel1 { relative: 0 0; to:crop.contents; }
+                                       rel2 { relative: 1 1; to:crop.contents; }
                                }
                        }
 
@@ -150,143 +175,3 @@ collections {
        }
 }
 
-collections {
-#define BTN_SET_CALLER_IMAGE_WIDTH     86
-#define BTN_SET_CALLER_IMAGE_HEIGHT    86
-#if 1
-       group {
-               name: "crop_view_btn";
-
-               images {
-                       image: "00_winset_control_toolbar_bg.png" COMP;
-               }
-
-               parts{
-                       part {
-                               name: "base";
-                               type: RECT;
-                               scale:1;
-                               mouse_events: 1;
-                               repeat_events: 1;
-                               description {
-                                       state: "default" 0.0;
-                                       color: 0 0 0 0;
-                                       rel1.relative: 0.0 0.0;
-                                       rel2.relative: 1.0 1.0;
-                               }
-                       }
-                        part { name: "controlbar_bg";
-                   scale: 1;
-                   description { state: "default" 0.0;
-                      min: 0 CONTROLBAR_SMALL_HEIGHT_INC;
-                      max: 999999 CONTROLBAR_SMALL_HEIGHT_INC;
-                      fixed: 0 1;
-                      align: 0.0 1.0;
-                      visible: 1;
-                      rel1 { to: "base"; }
-                      rel2 { to: "base"; }
-                      //image.normal: "00_winset_control_toolbar_bg.png";
-                   }
-                   description { state: "hide" 0.0;
-                      inherit: "default" 0.0;
-                      visible: 0;
-                   }
-                }
-                part { name: "controlbar_clip";
-                   type: RECT;
-                   mouse_events: 0;
-                   description { state: "default" 0.0;
-                      rel1.to: "controlbar_bg";
-                      rel2.to: "controlbar_bg";
-                      visible: 1;
-                   }
-                   description { state: "hide" 0.0;
-                      inherit: "default" 0.0;
-                      visible: 0;
-                   }
-                }
-                part { name: "elm.prev_btn_bg";
-                   type: RECT;
-                   scale: 1;
-                   clip_to: "controlbar_clip";
-                   description { state: "default" 0.0;
-                      min: 0 0;
-                      fixed: 1 0;
-                      align: 1.0 0.0;
-                      rel1 { relative: 1.0 0.0; to: "controlbar_bg"; }
-                      rel2.to: "controlbar_bg";
-                      visible: 0;
-                   }
-                   description { state: "visible" 0.0;
-                      inherit: "default" 0.0;
-                      min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0;
-                   }
-                }
-                part { name: "elm.swallow.prev_btn";
-                   type: SWALLOW;
-                   scale: 1;
-                   clip_to: "controlbar_clip";
-                   description { state: "default" 0.0;
-                      fixed: 1 1;
-                      align: 0.5 0.5;
-                      rel1.to: "elm.prev_btn_bg";
-                      rel2.to: "elm.prev_btn_bg";
-                   }
-                }
-                part { name: "controlbar";
-                   type: SWALLOW;
-                   scale: 1;
-                   clip_to: "controlbar_clip";
-                   description { state: "default" 0.0;
-                          fixed: 1 1;
-                      rel1.to: "controlbar_bg";
-                      rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; }
-                      visible: 1;
-                   }
-                }
-
-                       part {
-                               name: "selectioninfo";
-                               type: SWALLOW;
-                               description { state: "default" 0.0;
-                                       fixed: 0 1;
-                                       align: 0.5 1.0;
-                                       rel1 {
-                                               relative: 0.0 0.0;      to:"controlbar_bg";
-                                       }
-                                       rel2 {
-                                               relative: 1.0 0.0;      to:"controlbar_bg";
-                                       }
-                               }
-                               description { state: "hide" 0.0;
-                                       inherit: "default" 0.0;
-                                       visible: 0;
-                               }
-                       }
-               }
-
-               programs {
-
-                       program {
-                               name: "hide_menu";
-                               signal: "elm,state,hide";
-                               source: "event";
-                               action: STATE_SET "hide" 0.0;
-                               target: "controlbar_clip";
-                               target: "controlbar_bg";
-                               target: "selectioninfo";
-                       }
-
-                       program {
-                               name: "show_menu";
-                               signal: "elm,state,show";
-                               source: "event";
-                               action: STATE_SET "default" 0.0;
-                               target: "controlbar_clip";
-                               target: "controlbar_bg";
-                               target: "selectioninfo";
-                       }
-               }
-       }
-}
-
old mode 100644 (file)
new mode 100755 (executable)
index 7f1a7a6..97a1b89
@@ -24,6 +24,9 @@
 #include "ivug-debug.h"
 #include "ivug-string.h"
 #include "ivug-context.h"
+#include "ivug-db.h"
+
+#include "ivug-setas-view.h"
 
 #undef LOG_LVL
 #define LOG_LVL DBG_MSG_LVL_MED
@@ -60,12 +63,78 @@ static void  _ivug_crop_view_ok_clicked_cb(void *data, Evas_Object *obj, void *e
 
        evas_object_smart_callback_del(obj, "ok,clicked", _ivug_crop_view_ok_clicked_cb);
 
+       media_handle m_handle = NULL;
+
+       m_handle = ivug_db_insert_file_to_DB(path);
+       if(m_handle == NULL)
+       {
+               MSG_ERROR("ivug_db_insert_file_to_DB failed %s", path);
+       }
+       else
+       {
+               ivug_db_destroy_file_handle(m_handle);
+       }
+
        _send_result(gGetUGHandle(), "crop_image_path", path, NULL, NULL);
 
        MSG_HIGH("Start destroy ug");
        ug_destroy_me(gGetUGHandle());
 }
 
+static void _ivug_setas_crop_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       char *path = (char *)event_info;
+
+       MSG_MAIN_HIGH("_ivug_setas_view_ok_clicked_cb path = %d", path);
+
+       evas_object_smart_callback_del(obj, "ok,clicked", _ivug_setas_crop_view_ok_clicked_cb);
+
+       // do not insert to db
+
+       int setas_data = (int)evas_object_data_get(obj, "setas_type");
+       ivug_set_screen_type type = (ivug_set_screen_type)setas_data;
+
+       int setas_mode = (int)evas_object_data_get(obj, "setas_mode");
+       ivug_setas_mode mode = (ivug_setas_mode)setas_mode;
+
+       const char* homescreen_path = IVUG_HOME_SCREEN_PATH;
+       const char* lockscreen_path = IVUG_LOCK_SCREEN_PATH;
+       const char* appsvc_home_path = IVUG_APPSVC_HOME_SCREEN_PATH;
+
+       if(mode == IVUG_SETAS_CROP)
+       {
+               ivug_copy_file(path, appsvc_home_path);
+               _send_result(gGetUGHandle(), "crop_image_path", appsvc_home_path, NULL, NULL);
+       }
+       else
+       {
+               if(type == IVUG_CTRLBAR_SET_SCREEN_HOME)
+               {
+                       ivug_copy_file(path, homescreen_path);
+                       ivug_config_set_homescreen_image(homescreen_path);
+                       _send_result(gGetUGHandle(), "homescreen_path", homescreen_path, NULL, NULL);
+               }
+               else if(type == IVUG_CTRLBAR_SET_SCREEN_LOCK)
+               {
+                       ivug_copy_file(path, lockscreen_path);
+                       ivug_config_set_lockscreen_image(lockscreen_path);
+                       _send_result(gGetUGHandle(), "lockscreen_path", lockscreen_path, NULL, NULL);
+               }
+               else if(type == IVUG_CTRLBAR_SET_SCREEN_BOTH)
+               {
+                       ivug_copy_file(path, homescreen_path);
+                       ivug_config_set_homescreen_image(homescreen_path);
+                       ivug_copy_file(path, lockscreen_path);
+                       ivug_config_set_lockscreen_image(lockscreen_path);
+                       _send_result(gGetUGHandle(), "homescreen_path", homescreen_path, "lockscreen_path", lockscreen_path);
+               }
+       }
+
+       MSG_HIGH("Start destroy ug");
+       ug_destroy_me(gGetUGHandle());
+}
+
+
 static void  _ivug_crop_view_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 {
        //ivug_crop_ug_destroy((IvugCropUG *)data);
@@ -82,6 +151,8 @@ static void  _ivug_crop_view_destroyed_cb(void *data, Evas_Object *obj, void *ev
 {
        IvugCropUG *crop_ug = (IvugCropUG *)data;
 
+       ivug_crop_view_destroy(crop_ug->crop_view);
+
        crop_ug->crop_view = NULL;
 }
 
@@ -234,6 +305,98 @@ IvugCropUG * ivug_crop_ug_create(Evas_Object *parent, int w, int h, bool bRatioF
        return crop_ug;
 }
 
+IvugCropUG * ivug_setas_crop_ug_create(Evas_Object *parent, const char *filepath, ivug_setas_mode mode, ivug_set_screen_type type)
+{
+       IvugCropUG *crop_ug = (IvugCropUG *)calloc(1, sizeof(IvugCropUG));
+       if(crop_ug == NULL)
+       {
+               MSG_ERROR("crop_ug calloc error");
+               return NULL;
+       }
+
+       IvugCropView *crop_view = NULL;
+       Evas_Object *layout = NULL;
+
+       crop_view = ivug_crop_view_create(parent);
+       if(crop_view == NULL)
+       {
+               MSG_ERROR("ivug_crop_view_create error");
+               free(crop_ug);
+               return NULL;
+       }
+
+       layout = ivug_crop_view_get_object(crop_view);
+
+       evas_object_smart_callback_add(layout, "ok,clicked", _ivug_setas_crop_view_ok_clicked_cb, crop_ug);
+       evas_object_smart_callback_add(layout, "cancel,clicked", _ivug_crop_view_cancel_clicked_cb, crop_ug);
+       evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, crop_ug);
+       evas_object_smart_callback_add(layout, "download,failed", _on_msg_load_failed, crop_ug);
+       //evas_object_smart_callback_add(layout, "clicked", _ivug_crop_view_clicked_cb, crop_ug);
+
+       evas_object_data_set(layout, "setas_type", (void *)type);
+       evas_object_data_set(layout, "setas_mode", (void *)mode);
+
+       crop_ug->crop_view = crop_view;
+       crop_ug->layout = layout;
+       crop_ug->parent = parent;
+       crop_ug->filepath = strdup(filepath);
+
+       crop_ug->navi_bar = elm_naviframe_add(parent);
+
+#ifdef USE_CUSTOM_STYLE
+       elm_object_theme_set(crop_ug->navi_bar, gGetSystemTheme() );
+#endif
+       const char *profile = elm_config_profile_get();
+       if (!strcmp(profile,"mobile"))
+       {
+               elm_object_style_set(crop_ug->navi_bar, "ivug-main/default");
+       }
+       else if (!strcmp(profile,"desktop"))
+       {
+               elm_object_style_set(crop_ug->navi_bar, "ivug-main/noindicator");
+       }
+       else
+       {
+               MSG_MAIN_ERROR("Unknown profile : %s", profile);
+       }
+
+       evas_object_name_set(crop_ug->navi_bar, "Crop ug naviframe");
+
+// Layout life cycle is controlled by application explictily.
+       elm_naviframe_content_preserve_on_pop_set(crop_ug->navi_bar, EINA_TRUE);
+
+       Evas_Object *back_btn = ivug_button_add(crop_ug->navi_bar, "naviframe/end_btn/default",
+               IDS_BACK, NULL, on_crop_view_btn_back_clicked, crop_ug);
+
+       crop_ug->navi_it = elm_naviframe_item_push(crop_ug->navi_bar, IDS_LOADING, back_btn, NULL, crop_ug->layout, NULL);
+       elm_naviframe_item_title_visible_set(crop_ug->navi_it, EINA_FALSE);
+
+       int lcd_x = 0;
+       int lcd_y = 0;
+       int lcd_w = 0;
+       int lcd_h = 0;
+       int rot = 0;
+
+       ivug_crop_view_create_menu(crop_view, crop_ug->navi_bar);
+
+       ivug_crop_view_destination_set(crop_view, DATA_PATH, ".iv_setas.jpg");
+
+       evas_object_geometry_get((Evas_Object *)ug_get_window(), &lcd_x, &lcd_y, &lcd_w, &lcd_h);
+       rot = gGetRotationDegree();
+       if(rot == 90 || rot == 270)
+       {
+               int temp = lcd_w;
+               lcd_w = lcd_h;
+               lcd_h = temp;
+       }
+
+       ivug_crop_view_box_size_set(crop_view, lcd_w, lcd_h);
+
+       ivug_crop_view_box_ratio_fix(crop_view, true);
+
+       return crop_ug;
+}
+
 Evas_Object * ivug_crop_ug_get_layout(IvugCropUG * crop_ug)
 {
        IV_ASSERT(crop_ug != NULL);
old mode 100644 (file)
new mode 100755 (executable)
index 15304d9..a1bc424
@@ -18,6 +18,7 @@
 #define __IVUG_CROP_UG_H__
 
 #include "ivug-crop-view.h"
+#include "ivug-setas-view.h"
 
 typedef struct {
        IvugCropView *crop_view;
@@ -37,6 +38,9 @@ extern "C" {
 
 IvugCropUG * ivug_crop_ug_create(Evas_Object *parent, int w, int h, bool bRatioFix, const char *filepath);
 
+IvugCropUG * ivug_setas_crop_ug_create(Evas_Object *parent, const char *filepath,
+                                                       ivug_setas_mode mode, ivug_set_screen_type type);
+
 Evas_Object * ivug_crop_ug_get_layout(IvugCropUG * crop_ug);
 
 bool ivug_crop_ug_destroy(IvugCropUG * crop_ug);
index 5b02218..f2c9471 100755 (executable)
@@ -410,7 +410,15 @@ ivug_param_create_from_bundle(service_h service)
        }
        else
        {
+               if(data->view_by == IVUG_VIEW_BY_FOLDER)
+               {
+                       MSG_IVUG_WARN("IVUG_VIEW_BY_FOLDER but index was not set");
+                       data->start_index = IVUG_INVALID_INDEX;
+               }
+               else
+               {
                data->start_index = IVUG_DEFAULT_INDEX;
+               }
                MSG_IVUG_WARN("Slide Index is not set. Set as default : %d", data->start_index);
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 2fa8865..5637e8e
@@ -79,5 +79,16 @@ Definition "PREFIX" is declared in CMakelist.txt
 
 #define MENUBAR_TIMEOUT_SEC (5.0f)     // 5sec
 
+/*
+       Final image path
+*/
+#define IVUG_HOME_SCREEN_PATH          DATA_PATH"/.homescreen.jpg";
+#define IVUG_LOCK_SCREEN_PATH          DATA_PATH"/.lockscreen.jpg";
+
+/*
+       Screen path for APPSVC
+*/
+#define IVUG_APPSVC_HOME_SCREEN_PATH   DATA_PATH"/.iv_homescreen.jpg";
+
 #endif /* __IVUG_COMMON_H__ */
 
old mode 100644 (file)
new mode 100755 (executable)
index 83a58f0..06ade6f
@@ -40,12 +40,16 @@ typedef struct {
        Evas_Object *btn_back;
 
        Evas_Object *contents_area;
+       Evas_Object *notify_area;
        Evas_Object *btn_ok;
 
        bool bShowMenu;
        char *file_path;
        char *result_path;
 
+       char *dest_dir;
+       char *dest_name;
+
        int w;
        int h;
 
@@ -76,6 +80,8 @@ bool ivug_crop_view_box_ratio_fix(IvugCropView *pCropView, bool bFix);
 
 bool ivug_crop_view_file_set(IvugCropView *pCropView, const char *file);
 
+bool ivug_crop_view_destination_set(IvugCropView *pCropView, const char *dir, const char *name);
+
 void ivug_crop_view_destroy(IvugCropView *pCropView);
 
 Evas_Object *ivug_crop_view_get_object(IvugCropView *pCropView);
index 77a173f..3a6f842 100755 (executable)
@@ -927,8 +927,10 @@ ivug_slider_delete_item(Evas_Object* obj)
                direction = SLIDE_SHIFT_TO_LEFT;
        }
 
-       ivug_medialist_delete_item(sd->media_list,  sd->slide[CENTER_SLIDE]->mitem);    //delete data.
+       Media_Item *mitem = sd->slide[CENTER_SLIDE]->mitem;
+
        ivug_slider_item_data_set(sd->slide[CENTER_SLIDE], NULL);
+       ivug_medialist_delete_item(sd->media_list,  mitem);     //delete data.
 
        Media_Item* item = NULL;
 
index 914b715..a0b515b 100755 (executable)
@@ -457,23 +457,27 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, voi
                else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER)
                {
                        type = IVUG_CTRLBAR_SET_SCREEN_HOME;
-                       ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
+                       ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath,
+                               setas_mode, type);
                }
                else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_LOCKSCREEN)
                {
                        type = IVUG_CTRLBAR_SET_SCREEN_LOCK;
-                       ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
+                       ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath,
+                               setas_mode, type);
                }
                else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER_N_LOCKSCREEN)
                {
                        type = IVUG_CTRLBAR_SET_SCREEN_BOTH;
-                       ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
+                       ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath,
+                               setas_mode, type);
                }
                else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER_CROP)
                {
                        type = IVUG_CTRLBAR_SET_SCREEN_HOME;
                        setas_mode = IVUG_SETAS_CROP;
-                       ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
+                       ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath,
+                               setas_mode, type);
                }
                else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_CROP)
                {
index 505285f..2cc8532 100755 (executable)
@@ -67,7 +67,7 @@ static void _on_layout_resized(void *data, Evas *e, Evas_Object *obj, void *even
 
        int lcd_x, lcd_y, lcd_w, lcd_h;
 
-       evas_object_geometry_get(obj, &lcd_x, &lcd_y, &lcd_w, &lcd_h);
+       evas_object_geometry_get(pCropView->contents_area, &lcd_x, &lcd_y, &lcd_w, &lcd_h);
        MSG_MED("lcd_x=%d, lcd_y=%d, lcd_w=%d, lcd_h=%d", lcd_x, lcd_y, lcd_w, lcd_h);
 
        int ph, pw;
@@ -113,7 +113,7 @@ static void _on_layout_resized(void *data, Evas *e, Evas_Object *obj, void *even
        sx = (ext_w-img_w*zoom)/2 + dx;
        sy = (ext_h-img_h*zoom)/2 + dy;
 
-       ivug_scissorbox_boundary_set(pCropView->cropbox, (ext_w-img_w*zoom)/2, (ext_h-img_h*zoom)/2, img_w*zoom, img_h*zoom);
+       ivug_scissorbox_boundary_set(pCropView->cropbox, lcd_x+(ext_w-img_w*zoom)/2, lcd_y+(ext_h-img_h*zoom)/2, img_w*zoom, img_h*zoom);
 
        ///////////////////////////////////////////////////////////////////
 
@@ -184,7 +184,10 @@ void  _on_preloaded(void *data, Evas_Object *obj, void *event_info)
                evas_object_del(object);
        }
 
-       pCropView->notify = ivug_notify_static_create(pCropView->contents_area, IDS_CROP_NOTIFY, NOTIFY_ALIGN_BOTTOM);
+       pCropView->notify_area = const_cast<Evas_Object *>(edje_object_part_object_get(_EDJ(pCropView->layout),
+                                                                                                                       "crop.contents.swallow.notify"));
+
+       pCropView->notify = ivug_notify_static_create(pCropView->notify_area, IDS_CROP_NOTIFY, NOTIFY_ALIGN_BOTTOM);
 
        elm_object_disabled_set(pCropView->btn_ok, EINA_FALSE);
 
@@ -203,11 +206,11 @@ _ivug_crop_view_response_cb( void *data, Evas_Object *obj, void *event_info )
        evas_object_hide(obj);          // popup
        evas_object_del(obj);
 
+       evas_object_smart_callback_call(pCropView->layout, "ok,clicked", pCropView->result_path);
+
        // Remove view.
        evas_object_smart_callback_call(pCropView->layout, "destroyed", NULL);
 
-       evas_object_smart_callback_call(pCropView->layout, "ok,clicked", pCropView->result_path);
-
        //ivug_crop_view_destroy(pCropView);
 }
 
@@ -231,6 +234,36 @@ _show_exit_popup( Evas_Object *parent, const char *title, const char *desc, void
        return style1_popup;
 }
 
+static char * _ivug_crop_create_name(IvugCropView *pCropView)
+{
+       char tempname[IVUG_MAX_FILE_PATH_LEN+1] = {0,};
+       char *save_file = NULL;
+       char *name = NULL;
+
+       //evas encoder support jpg, png only
+       if(pCropView->dest_name)
+       {
+               char *dir = NULL;
+               if(pCropView->dest_dir)
+               {
+                       dir = strdup(pCropView->dest_dir);
+               }
+               else
+               {
+                       dir = ecore_file_dir_get(pCropView->file_path);
+               }
+               snprintf(tempname, sizeof(tempname), "%s/%s.jpg", dir, pCropView->dest_name);
+               free(dir);
+               save_file = strdup(tempname);
+       }
+       else
+       {
+               save_file = ivug_generate_file_name(pCropView->file_path, "jpg", pCropView->dest_dir);
+       }
+
+       return save_file;
+}
+
 static void _on_btn_save(void *data, Evas_Object *obj, void *event_info)
 {
        IV_ASSERT(data != NULL);
@@ -240,9 +273,7 @@ static void _on_btn_save(void *data, Evas_Object *obj, void *event_info)
        int rx, ry, rw, rh;
        Evas_Object *ret_image = NULL;
 
-       media_handle m_handle = NULL;
-
-       char* save_file = ivug_generate_file_name(pCropView->file_path, "jpg"); //evas encoder support jpg, png only
+       char* save_file = _ivug_crop_create_name(pCropView);
 
        if(save_file == NULL)
        {
@@ -286,17 +317,6 @@ static void _on_btn_save(void *data, Evas_Object *obj, void *event_info)
                }
        }
 
-       m_handle = ivug_db_insert_file_to_DB(save_file);
-       if(m_handle == NULL)
-       {
-               MSG_ERROR("ivug_db_insert_file_to_DB failed %s", save_file);
-               goto SAVE_FAILED;
-       }
-       else
-       {
-               ivug_db_destroy_file_handle(m_handle);
-       }
-
        pCropView->result_path = strdup(save_file);
 
        _show_exit_popup(pCropView->layout, IDS_CROP, IDS_SUCCESS, (void *)pCropView);
@@ -317,6 +337,21 @@ SAVE_FAILED:
        return;
 }
 
+static void _on_btn_cancel(void *data, Evas_Object *obj, void *event_info)
+{
+       IV_ASSERT(data != NULL);
+
+       IvugCropView *pCropView = static_cast<IvugCropView *>(data);
+
+       MSG_HIGH("Cancel clicked");
+
+       evas_object_smart_callback_call(pCropView->layout, "destroyed", NULL);
+
+       evas_object_smart_callback_call(pCropView->layout, "cancel,clicked", NULL);
+
+       ivug_crop_view_destroy(pCropView);
+}
+
 static Evas_Event_Flags _finger_tap_end(void *data , void *event_info)
 {
        Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info;
@@ -423,7 +458,7 @@ IvugCropView *ivug_crop_view_create(Evas_Object *parent)
                MSG_SETAS_ERROR("Cannot create contets_area.");
        }
 
-       elm_object_part_content_set(pCropView->layout, "crop.contents", pCropView->contents_area);
+       elm_object_part_content_set(pCropView->layout, "crop.contents.swallow", pCropView->contents_area);
 
        return pCropView;
 }
@@ -466,6 +501,20 @@ bool ivug_crop_view_file_set(IvugCropView *pCropView, const char *file)
        return true;
 }
 
+bool ivug_crop_view_destination_set(IvugCropView *pCropView, const char *dir, const char *name)
+{
+       MSG_HIGH("ivug_crop_view_destination_set, to %s", dir);
+       if(dir == NULL)
+       {
+               return false;
+       }
+
+       pCropView->dest_dir = strdup(dir);
+       pCropView->dest_name = strdup(name);
+
+       return true;
+}
+
 void ivug_crop_view_destroy(IvugCropView *pCropView)
 {
        IV_ASSERT(pCropView != NULL);
@@ -485,6 +534,18 @@ void ivug_crop_view_destroy(IvugCropView *pCropView)
                pCropView->result_path = NULL;
        }
 
+       if ( pCropView->dest_dir)
+       {
+               free(pCropView->dest_dir);
+               pCropView->dest_dir = NULL;
+       }
+
+       if ( pCropView->dest_name)
+       {
+               free(pCropView->dest_name);
+               pCropView->dest_name = NULL;
+       }
+
        if ( pCropView->cropbox)
        {
                evas_object_del(pCropView->cropbox);
index b123182..c77a448 100755 (executable)
@@ -166,6 +166,18 @@ static void _on_add_tag_view_response(ivug_name_response resp, const char *str,
        ivug_main_view_set_hide_timer(pMainView);
 }
 
+static void
+_on_setasview_deleted(void *data, Evas *e , Evas_Object *obj , void *event_info )
+{
+       ivug_retm_if(!data, "data is NULL");
+       Ivug_MainView *pMainView = (Ivug_MainView *)data;
+       MSG_MAIN_HIGH("SetAS View is destroyed");
+
+       pMainView->pSetAsView = NULL;
+
+       ivug_main_view_set_hide_timer(pMainView);
+}
+
 static void _on_setas_view_destroyed(void *data, Evas_Object *obj, void *event_info)
 {
        IV_ASSERT(data != NULL);
@@ -237,10 +249,29 @@ void _on_share_selected(void *data, Evas_Object *obj, void *event_info)
        evas_object_del(obj);
 }
 
+static void  _ivug_crop_view_destroyed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       Ivug_MainView *pMainView = (Ivug_MainView *)data;
+
+       ivug_main_view_set_hide_timer(pMainView);
+
+       elm_naviframe_item_pop(pMainView->navi_bar);
+       pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar);
+
+       ivug_crop_view_destroy(pMainView->pCropView);
+
+       pMainView->pCropView = NULL;
+
+       elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_TRUE);
+}
+
+#if 0
 static void _create_setas_view(Ivug_MainView *pMainView, const char *filepath, ivug_set_screen_type type)
 {
-       pMainView->pSetAsView = ivug_setas_view_screen_create(pMainView->layout, IVUG_SETAS_NORMAL, type);
+       pMainView->pSetAsView = ivug_setas_view_screen_create(pMainView->layout, filepath,
+                               IVUG_SETAS_NORMAL, type);
        Evas_Object *setasOjbect = ivug_setas_view_object_get(pMainView->pSetAsView);
+       //evas_object_event_callback_add(setasOjbect, EVAS_CALLBACK_DEL, _on_setasview_deleted, pMainView);
        evas_object_smart_callback_add(setasOjbect, "destroy", _on_setas_view_destroyed, pMainView);
 
        Evas_Object *back_btn = ivug_button_add(pMainView->navi_bar, "naviframe/end_btn/default",
@@ -250,10 +281,110 @@ static void _create_setas_view(Ivug_MainView *pMainView, const char *filepath, i
                                                        NULL, back_btn, NULL, setasOjbect, NULL);
 
        ivug_setas_view_create_menu(pMainView->pSetAsView, pMainView->navi_bar, type);
+}
+#else
+
+static void _ivug_crop_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       char *path = (char *)event_info;
+       media_handle m_handle = NULL;
+
+       MSG_MAIN_HIGH("_ivug_crop_view_ok_clicked_cb path = %d", path);
+
+       evas_object_smart_callback_del(obj, "ok,clicked", _ivug_crop_view_ok_clicked_cb);
 
-       ivug_setas_view_load_file(pMainView->pSetAsView, filepath, type);
+       m_handle = ivug_db_insert_file_to_DB(path);
+       if(m_handle == NULL)
+       {
+               MSG_MAIN_ERROR("ivug_db_insert_file_to_DB failed %s", path);
+       }
+       else
+       {
+               ivug_db_destroy_file_handle(m_handle);
+}
 }
 
+static void _ivug_setas_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       char *path = (char *)event_info;
+
+       MSG_MAIN_HIGH("_ivug_setas_view_ok_clicked_cb path = %d", path);
+
+       evas_object_smart_callback_del(obj, "ok,clicked", _ivug_crop_view_ok_clicked_cb);
+
+       // do not insert to db
+
+       int setas_data = (int)evas_object_data_get(obj, "setas_type");
+       ivug_set_screen_type type = (ivug_set_screen_type)setas_data;
+
+       const char* homescreen_path = IVUG_HOME_SCREEN_PATH;
+       const char* lockscreen_path = IVUG_LOCK_SCREEN_PATH;
+
+       if(type == IVUG_CTRLBAR_SET_SCREEN_HOME)
+       {
+               ivug_copy_file(path, homescreen_path);
+               ivug_config_set_homescreen_image(homescreen_path);
+       }
+       else if(type == IVUG_CTRLBAR_SET_SCREEN_LOCK)
+       {
+               ivug_copy_file(path, lockscreen_path);
+               ivug_config_set_lockscreen_image(lockscreen_path);
+       }
+       else if(type == IVUG_CTRLBAR_SET_SCREEN_BOTH)
+       {
+               ivug_copy_file(path, homescreen_path);
+               ivug_config_set_homescreen_image(homescreen_path);
+               ivug_copy_file(path, lockscreen_path);
+               ivug_config_set_lockscreen_image(lockscreen_path);
+       }
+}
+
+static void _create_setas_view(Ivug_MainView *pMainView, const char *filepath, ivug_set_screen_type type)
+{
+       IvugCropView *pCropView = ivug_crop_view_create(pMainView->layout);
+       int lcd_x = 0;
+       int lcd_y = 0;
+       int lcd_w = 0;
+       int lcd_h = 0;
+       int rot = 0;
+
+       Evas_Object *layout = ivug_crop_view_get_object(pCropView);
+
+       evas_object_smart_callback_add(layout, "ok,clicked", _ivug_setas_view_ok_clicked_cb, pMainView);
+       evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, pMainView);
+
+       evas_object_data_set(layout, "setas_type", (void *)type);
+
+       Evas_Object *btn_back = ivug_button_add(layout, "naviframe/end_btn/default",
+               IDS_BACK, NULL, _ivug_crop_view_destroyed_cb, pMainView);
+
+       pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, NULL, btn_back, NULL, pCropView->layout, NULL);
+
+       ivug_crop_view_create_menu(pCropView, pMainView->navi_bar);
+
+       ivug_crop_view_file_set(pCropView, filepath);
+
+       ivug_crop_view_destination_set(pCropView, DATA_PATH, ".iv_setas.jpg");
+
+       evas_object_geometry_get((Evas_Object *)ug_get_window(), &lcd_x, &lcd_y, &lcd_w, &lcd_h);
+       rot = gGetRotationDegree();
+       if(rot == 90 || rot == 270)
+       {
+               int temp = lcd_w;
+               lcd_w = lcd_h;
+               lcd_h = temp;
+       }
+
+       ivug_crop_view_box_size_set(pCropView, lcd_w, lcd_h);
+
+       ivug_crop_view_box_ratio_fix(pCropView, true);
+
+       pMainView->pCropView = pCropView;
+
+       elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE);
+}
+#endif
+
 void _on_setas_selected(void *data, Evas_Object *obj, void *event_info)
 {
        IV_ASSERT(data != NULL);
@@ -1192,7 +1323,7 @@ void on_btn_save_clicked(void *data, Evas_Object *obj, void *event_info)
        if(ecore_file_exists(dest_file))
        {
                MSG_MAIN_WARN("file already exist");
-               temp_filename = ivug_generate_file_name(dest_file, NULL);
+               temp_filename = ivug_generate_file_name(dest_file, NULL, NULL);
                snprintf(dest_file, IVUG_MAX_FILE_PATH_LEN, "%s/%s", DEFAULT_DOWNLOADS_FOLDER, ecore_file_file_get(temp_filename));
                free(temp_filename);
        }
@@ -1428,20 +1559,6 @@ _on_copy_selected(void *data, Evas_Object *obj)
        }
 }
 
-static void  _ivug_crop_view_destroyed_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       Ivug_MainView *pMainView = (Ivug_MainView *)data;
-
-       ivug_main_view_set_hide_timer(pMainView);
-
-       elm_naviframe_item_pop(pMainView->navi_bar);
-       pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar);
-
-       ivug_crop_view_destroy(pMainView->pCropView);
-
-       pMainView->pCropView = NULL;
-}
-
 static void
 _on_crop_selected(void *data, Evas_Object *obj)
 {
@@ -1463,6 +1580,7 @@ _on_crop_selected(void *data, Evas_Object *obj)
 
        Evas_Object *layout = ivug_crop_view_get_object(pCropView);
 
+       evas_object_smart_callback_add(layout, "ok,clicked", _ivug_crop_view_ok_clicked_cb, pMainView);
        evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, pMainView);
 
        Evas_Object *btn_back = ivug_button_add(layout, "naviframe/end_btn/default",
@@ -1475,6 +1593,8 @@ _on_crop_selected(void *data, Evas_Object *obj)
        ivug_crop_view_file_set(pCropView, mdata->filepath);
 
        pMainView->pCropView = pCropView;
+
+       elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE);
 }
 
 #include <Ecore_File.h>
index 8797287..1c1ea7d 100755 (executable)
@@ -193,11 +193,11 @@ void _create_main_menu(Ivug_MainView *pMainView)
                                                                        NULL, NULL, on_btn_more_clicked, pMainView);
                elm_object_item_part_content_set(pMainView->navi_it, "toolbar_more_btn", btn_more);
 
-               pMainView->btn_share = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/default",
+               pMainView->btn_share = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/left",
                                                                        IDS_SHARE, NULL, on_btn_share_clicked, pMainView);
                elm_object_item_part_content_set(pMainView->navi_it, "toolbar_button1", pMainView->btn_share);
 
-               Evas_Object *btn_del = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/default",
+               Evas_Object *btn_del = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/right",
                                                                        IDS_DELETE, NULL, on_btn_delete_clicked, pMainView);
                elm_object_item_part_content_set(pMainView->navi_it, "toolbar_button2", btn_del);
        }
index 17e8c9f..4ecc583 100755 (executable)
@@ -47,6 +47,16 @@ _on_timeout_response(void *data, Evas_Object *obj, void *event_info)
 }
 
 static void
+_on_invalid_name_timeout_response(void *data, Evas_Object *obj, void *event_info)
+{
+       IV_ASSERT(data != NULL);
+
+       Ivug_NameView *pNameView = (Ivug_NameView *)data;
+
+       ecore_imf_context_input_panel_show(elm_entry_imf_context_get(pNameView->entry));
+}
+
+static void
 _ivug_rename_view_enter_click_cb(void *data, Evas_Object *obj, void *event_info)
 {
        MSG_IMAGEVIEW_HIGH("inside ...");
@@ -186,6 +196,22 @@ static void _ivug_name_view_on_entry_changed(void *data, Evas_Object *obj, void
                elm_object_part_text_set(pNameView->editfield, "elm.guidetext", IDS_ENTER_NAME);
                //elm_object_disabled_set(pNameView->btn_done, EINA_TRUE);
        }
+       else if(ivug_validate_file_name(content) == false)
+       {
+               MSG_IMAGEVIEW_HIGH("invalid char ISF : %s", content);
+               char *new_str = strdup(content);
+               if (new_str) {
+                       if (strlen(content) > 0)
+                               new_str[strlen(content) - 1] = '\0';
+                       elm_entry_entry_set(pNameView->entry, new_str);
+                       elm_entry_cursor_end_set(pNameView->entry);
+                       free(new_str);
+                       new_str = NULL;
+               }
+               ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(pNameView->entry));
+               ivug_timeout_popup_show(pNameView->layout, _on_invalid_name_timeout_response,
+                       pNameView, NULL, IDS_INVALID_NAME);
+       }
        else
        {
                MSG_IMAGEVIEW_HIGH("ISF : %s", content);
@@ -202,6 +228,11 @@ static void _ivug_name_view_on_entry_changed_user(void *data, Evas_Object *obj,
        MSG_IMAGEVIEW_HIGH("Entry changed by user");
 }
 
+static void _ivug_name_view_on_entry_preedit_changed(void *data, Evas_Object *obj, void *event_info)
+{
+       MSG_IMAGEVIEW_HIGH("_ivug_name_view_on_entry_preedit_changed");
+}
+
 static void _ivug_name_view_on_entry_focused(void *data, Evas_Object *obj, void *event_info)
 {
        MSG_IMAGEVIEW_HIGH("_ivug_name_view_on_entry_focused");
@@ -238,6 +269,7 @@ static Evas_Object *_ivug_name_view_editfield_create(void *data, Evas_Object *ob
 
        evas_object_smart_callback_add(entry, "activated", _ivug_rename_view_enter_click_cb, pNameView);
        evas_object_smart_callback_add(entry, "changed", _ivug_name_view_on_entry_changed, pNameView);
+       evas_object_smart_callback_add(entry, "preedit,changed", _ivug_name_view_on_entry_preedit_changed, pNameView);
        evas_object_smart_callback_add(entry, "changed,user", _ivug_name_view_on_entry_changed_user, pNameView);
        evas_object_smart_callback_add(entry, "focused", _ivug_name_view_on_entry_focused, editfield);
        evas_object_smart_callback_add(entry, "unfocused", _ivug_name_view_on_entry_unfocused, editfield);
@@ -351,9 +383,9 @@ ivug_name_view_create(Evas_Object *parent, const char *title)
 
        Evas_Object *cancel_button, *done_button;
 
-       cancel_button = ivug_button_add(navi_bar, "naviframe/title/icon/previous", NULL, NULL, _ivug_name_view_cancel_cb, pNameView );
+       cancel_button = ivug_button_add(navi_bar, "naviframe/end_btn/default", NULL, NULL, _ivug_name_view_cancel_cb, pNameView );
 
-       done_button = ivug_button_add(navi_bar, "naviframe/title/icon/plus", NULL, NULL, _ivug_name_view_done_cb, pNameView );
+       done_button = ivug_button_add(navi_bar, "naviframe/toolbar/default", IDS_DONE, NULL, _ivug_name_view_done_cb, pNameView );
 
        pNameView->btn_done = done_button;
 
@@ -364,8 +396,9 @@ ivug_name_view_create(Evas_Object *parent, const char *title)
 
        //ivug_name_view_set_focus(pNameView);
 
-       elm_object_item_part_content_set(navi_it, "title_left_btn", done_button);
-       elm_object_item_part_content_set(navi_it, "title_right_btn", cancel_button);
+       elm_object_item_part_content_set(navi_it, "title_toolbar_button1", done_button);
+       elm_object_item_part_content_set(navi_it, "title_prev_btn", cancel_button);
+       elm_object_item_signal_emit(navi_it, "elm,state,sip,shown", "");
 
        return pNameView;
 }
index 2cd8496..d49905f 100755 (executable)
 #define IVUG_RESULT_BUNDLE_KEY_ERROR                   "Error"
 #define IVUG_RESULT_BUNDLE_VALUE_NOT_SUPPORTED "not_supported_file_type"
 
-
-/*
-       Final image path
-*/
-#define IVUG_HOME_SCREEN_PATH          DATA_PATH"/.homescreen.jpg";
-#define IVUG_LOCK_SCREEN_PATH          DATA_PATH"/.lockscreen.jpg";
-
-/*
-       Screen path for APPSVC
-*/
-#define IVUG_APPSVC_HOME_SCREEN_PATH   DATA_PATH"/.iv_homescreen.jpg";
-
-
 /*
        Caller ID image
 */
@@ -394,7 +381,7 @@ static void _on_setas_callerid(Ivug_SetAsView *pSetAsView)
        Evas_Coord_Rectangle box_rect;
        evas_object_geometry_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h) );
 
-       MSG_SETAS_HIGH("Rect XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h);
+       MSG_SETAS_HIGH("Conetent area XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h);
 
 // LCD Image
        Evas_Object *image = NULL;
index a62f0f1..0442297 100755 (executable)
@@ -55,6 +55,8 @@ typedef struct {
        char* fileurl;                                  // file url.
        char* filepath;                                 // file path in local file system.
        char* drm_filepath;
+
+       Ivug_DB_h *thumb_handle;
 } Media_Data;
 
 
old mode 100644 (file)
new mode 100755 (executable)
index 4d9792f..efe9639
@@ -29,14 +29,17 @@ typedef void *Media_Item;
 /* Opaque pointer for media list. */
 typedef void Media_List;
 
+typedef bool (*ivug_medialist_cb)(Media_List *mList, void *data);
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 Media_List * ivug_medialist_create();
 
-Media_Item *ivug_medialist_load(Media_List *mList, const Filter_struct *filter);
+bool ivug_medialist_set_callback(Media_List *mList, ivug_medialist_cb callback, void *data);
 
+Media_Item *ivug_medialist_load(Media_List *mList, const Filter_struct *filter);
 
 void ivug_medialist_del(Media_List *mList);
 
index 45d88c7..7b0a553 100755 (executable)
@@ -50,6 +50,19 @@ static char *_strerror_db(int error)
        }
 }
 
+static void _ivug_mediadata_thumbnail_cb(media_handle media, const char *path, void *data)
+{
+       MSG_SDATA_ERROR("_ivug_mediadata_thumbnail_cb, path = %s", path);
+
+       Media_Data *mdata = (Media_Data *)data;
+
+       mdata->thumbnail_path = strdup(path);
+
+       ivug_db_cancel_thumbnail(mdata->thumb_handle);
+
+       mdata->thumb_handle = NULL;
+}
+
 Media_Data *ivug_alloc_mediadata_from_media_handle(media_handle media)
 {
        IV_ASSERT(media != NULL);
@@ -100,6 +113,11 @@ Media_Data *ivug_alloc_mediadata_from_media_handle(media_handle media)
                MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret));
                goto ALLOC_MHANDLE_ERROR;
        }
+       if(mdata->thumbnail_path == NULL)
+       {
+               MSG_SDATA_ERROR("thumbnail is NULL, request to DB");
+               mdata->thumb_handle = ivug_db_create_thumbnail(mdata->m_handle, _ivug_mediadata_thumbnail_cb, mdata);
+       }
 
 #if 0
        // Useless codes because media_info_get_thumbnail_path() never failed.
@@ -291,6 +309,12 @@ void ivug_free_mediadata(Media_Data * mdata)
        IV_ASSERT(mdata != NULL);
 
 #ifdef USE_NEW_DB_API
+       if (mdata->thumb_handle)
+       {
+               ivug_db_cancel_thumbnail(mdata->thumb_handle);
+               mdata->thumb_handle = NULL;
+       }
+
        if(mdata->m_handle)
        {
                media_info_destroy(mdata->m_handle);
old mode 100644 (file)
new mode 100755 (executable)
index 22ce4b8..df44d87
@@ -53,6 +53,9 @@ typedef struct {
 
        Eina_List *shufflelist; // Shuffle liste
 
+       Ecore_Job *callback_job;
+       ivug_medialist_cb cb;   // loaded callback
+       void *data;
 } _Media_List;
 
 
@@ -81,11 +84,8 @@ static int _get_block_num(int index)
        return (index / LOAD_BLOCK_COUNT);
 }
 
-static Eina_List *_load_block(const Filter_struct *filter, int block_num)
+static Eina_List *_load_partial(const Filter_struct *filter, int stp, int endp)
 {
-       int stp = block_num * LOAD_BLOCK_COUNT;
-       int endp = ((block_num + 1) * LOAD_BLOCK_COUNT) - 1;
-
        Eina_List *header = NULL;
 
 #ifdef UT_USE_DB
@@ -115,11 +115,43 @@ static Eina_List *_load_block(const Filter_struct *filter, int block_num)
        }
 #endif
 
+       MSG_SDATA_HIGH("Loaded : %d ~ %d", stp, endp);
+
+       return header;
+}
+
+static Eina_List *_load_block(const Filter_struct *filter, int block_num)
+{
+       int stp = block_num * LOAD_BLOCK_COUNT;
+       int endp = ((block_num + 1) * LOAD_BLOCK_COUNT) - 1;
+
+       Eina_List *header = _load_partial(filter, stp, endp);
+
        MSG_SDATA_HIGH("Loaded block : %d", block_num);
 
        return header;
 }
 
+static void _job_send_cb(void *data)
+{
+       IV_ASSERT(data != NULL);
+
+       _Media_List *_mList = (_Media_List *)data;
+       if(_mList->cb)
+       {
+               _mList->cb(_mList, _mList->data);
+       }
+}
+
+static void _call_loaded_callback(_Media_List *_mList)
+{
+       IV_ASSERT(_mList != NULL);
+
+       if(_mList->callback_job)
+               ecore_job_del(_mList->callback_job);
+
+       _mList->callback_job = ecore_job_add(_job_send_cb, _mList);
+}
 
 static void _doLoad(Ecore_Thread *thread, _Media_List *_mList, const Filter_struct *filter, int center, int max_block)
 {
@@ -258,6 +290,8 @@ static void loader_end(void *data, Ecore_Thread *thread)
        PERF_CHECK_END(LVL3, "Deffered loading");
 
        ivug_data_filter_delete(pParam->filter_str);
+
+       _call_loaded_callback(pParam->_mList);
 }
 
 static void loader_cancel(void *data, Ecore_Thread *thread)
@@ -315,6 +349,17 @@ static void _dump_list(Eina_List *list, void (*func)(void *))
 }
 #endif
 
+static void _create_shuffle_list(_Media_List *_mList)
+{
+       int i;
+       _mList->shufflelist = NULL;
+       for ( i = 0; i < _mList->count; i++)
+       {
+               _mList->shufflelist = eina_list_append(_mList->shufflelist, (void *)i);
+       }
+
+       _mList->shufflelist = eina_list_sort(_mList->shufflelist, eina_list_count(_mList->shufflelist), _sort_cb);
+}
 
 Media_List *ivug_medialist_create()
 {
@@ -328,6 +373,17 @@ Media_List *ivug_medialist_create()
        return (Media_List *)_mList;
 }
 
+bool ivug_medialist_set_callback(Media_List *mList, ivug_medialist_cb callback, void *data)
+{
+       IV_ASSERT(mList != NULL);
+
+       _Media_List *_mList = (_Media_List *)mList;
+       _mList->cb = callback;
+       _mList->data = data;
+
+       return true;
+}
+
 Media_Item * ivug_medialist_find_item_by_filename(Media_List *mList, const char* filepath)
 {
        IV_ASSERT(mList != NULL);
@@ -453,14 +509,7 @@ Media_Item *ivug_medialist_load(Media_List *mList, const Filter_struct *filter)
 
        PERF_CHECK_BEGIN(LVL3, "MediaList - shuffle");
 
-       int i;
-       _mList->shufflelist = NULL;
-       for ( i = 0; i < _mList->count; i++)
-       {
-               _mList->shufflelist = eina_list_append(_mList->shufflelist, (void *)i);
-       }
-
-       _mList->shufflelist = eina_list_sort(_mList->shufflelist, eina_list_count(_mList->shufflelist), _sort_cb);
+       _create_shuffle_list(_mList);
 
        PERF_CHECK_END(LVL3, "MediaList - shuffle");
 
@@ -470,6 +519,7 @@ Media_Item *ivug_medialist_load(Media_List *mList, const Filter_struct *filter)
        if ( block_max == 0 && eina_list_count(_mList->header) < LOAD_BLOCK_COUNT )
        {
                MSG_SDATA_HIGH("Deffered loading is not needed. BolckMax=%d FirstBlockCount=%d", block_max, eina_list_count(_mList->header));
+               _call_loaded_callback(_mList);
                return (Media_Item *)current;
        }
 
@@ -505,6 +555,11 @@ ivug_medialist_del(Media_List *mList)
 
        MSG_SDATA_HIGH("Removing all media data");
 
+       if(_mList->callback_job)
+       {
+               ecore_job_del(_mList->callback_job);
+       }
+
        if ( _mList->thread )
        {
                MSG_SDATA_HIGH("1. Thread cancel");
index 365f07f..29a11e2 100755 (executable)
@@ -60,9 +60,8 @@
 
 #define IDS_ADD_NAME                   _("Add name")
 #define IDS_SET_AS_CALLER_ID   _("Set as caller ID")
-#define IDS_LIVE_BOX                   _("Live Box")
 #define IDS_MMS                                        _("MMS")
-#define IDS_NO_FACE_DETECTED   _("No face detected")
+#define IDS_INVALID_NAME               _("Invalid name")
 
 #define IDS_ORIENTATION                _("Orientation")
 #define IDS_MANUFACTURE                _("Manufacture")