/******** Style name ********/
#define GL_CLASS_GENGRID "gengrid"
-#ifdef _USE_CUSTOMIZED_GENGRID_STYLE
-#define GL_GENGRID_STYLE_GALLERY "gallery"
-#endif
#define GL_BUTTON_STYLE_RENAME "rename" //"gallery/rename"
#define GL_BUTTON_STYLE_NAVI_MORE "naviframe/more/default"
GL_VIEW_NONE,
GL_VIEW_ALBUMS,
GL_VIEW_ALBUMS_EDIT,
- GL_VIEW_ALBUMS_RENAME,
GL_VIEW_ALBUMS_SELECT,
+ GL_VIEW_ALBUMS_RENAME,
GL_VIEW_TIMELINE,
GL_VIEW_THUMBS,
GL_VIEW_THUMBS_EDIT,
state: "default" 0.0;
fixed: 1 1;
min: 0 0;
- max: 0 0;
+ max: 0 -1;
align: 0 0;
rel1 { relative: 0.0 0.0; }
rel2 { relative: 1.0 1.0; }
}
- description {
- state: "visible" 0.0;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; }
- rel2 { relative: 179/540 1.0; }
- fixed: 1 0;
- min: 0 0;
- max: -1 -1;
- }
}
part {
name: "select.all.area.bg";
source: "elm";
action: STATE_SET "default" 0.0;
target: "split.view";
- transition : LINEAR 0.5;
+ transition : LINEAR 0.3;
}
program {
name: "split_view_visible";
source: "elm";
action: STATE_SET "custom" 0.0;
target: "split.view";
- transition : LINEAR 0.5;
+ transition : LINEAR 0.3;
}
program {
name: "touch_snd";
goto PINCH_ZOOM_OUT_OVER;
}
-#ifdef _USE_SCROL_HORIZONRAL
- if (ad->maininfo.rotate_mode == APP_DEVICE_ORIENTATION_270 ||
- ad->maininfo.rotate_mode == APP_DEVICE_ORIENTATION_90) {
- /* Keep level if pinching zoom in in landscape mode */
- goto PINCH_ZOOM_OUT_OVER;
- }
-#endif
ad->pinchinfo.zoom_level--;
if (_gl_thumbs_update_size(data, NULL) < 0) {
ad->pinchinfo.zoom_level = GL_ZOOM_DEFAULT;
if (view_m == GL_VIEW_THUMBS && !_gl_thumbs_get_view(ad, NULL)) {
goto PINCH_ZOOM_IN_OVER;
}
-
-#ifdef _USE_SCROL_HORIZONRAL
- if (ad->maininfo.rotate_mode == APP_DEVICE_ORIENTATION_270 ||
- ad->maininfo.rotate_mode == APP_DEVICE_ORIENTATION_90) {
- /* Keep level if pinching zoom in in landscape mode */
- goto PINCH_ZOOM_IN_OVER;
- }
-#endif
ad->pinchinfo.zoom_level++;
if (_gl_thumbs_update_size(data, NULL) < 0) {
ad->pinchinfo.zoom_level = GL_ZOOM_IN_TWO;
ad->uginfo.b_ug_launched = false;
}
- //ug_resume();
int view_mode = gl_get_view_mode(ad);
if (ad->maininfo.lang_changed && (view_mode == GL_VIEW_ALBUMS || view_mode == GL_VIEW_ALBUMS_EDIT)) {
gl_albums_update_view(data);
gl_dbgW("SIG_IGN");
signal(SIGTERM, SIG_IGN);
}
- bindtextdomain(PACKAGE, "/usr/apps/org.tizen.gallery/res/locale");
+
+ char locale[1024] = {0};
+ char * path = app_get_resource_path();
+ gl_dbgW("Gallery start...and resource path is : %s", path);
+ snprintf(locale, 1024, "%s%s", path, "locale");
+ bindtextdomain(PACKAGE, locale);
+ free(path);
/* initialize gallery main view(layout) */
if (_gl_main_create_view(data) != 0) {
gl_dbgE("_gl_main_create_view failed");
/* Time for displaying progressbar UI compeletely */
#define GL_TIMER_INTERVAL_PBAR_SHOWED 0.5
#define GL_TIMER_INTERVAL_VIBRATION 0.5
-#ifdef _USE_ROTATE_BG
-#define GL_ROTATE_DELAY 0.25
-#endif
#define GL_SO_PATH_IMAGEVIEWER "/usr/ug/lib/libug-image-viewer-efl.so"
/* Use timer to show progressbar totally before write pipe */
return -1;
}
-#ifdef _USE_ROTATE_BG
-
-int _gl_delay(double sec)
-{
- gl_dbg("Start");
- struct timeval tv;
- unsigned int start_t = 0;
- unsigned int end_t = 0;
- unsigned int delay_t = (unsigned int)(sec * GL_TIME_USEC_PER_SEC);
-
- gettimeofday(&tv, NULL);
- start_t = tv.tv_sec * GL_TIME_USEC_PER_SEC + tv.tv_usec;
-
- for (end_t = start_t; end_t - start_t < delay_t;) {
- gettimeofday(&tv, NULL);
- end_t = tv.tv_sec * GL_TIME_USEC_PER_SEC + tv.tv_usec;
- }
-
- gl_dbg("End");
- return 0;
-}
-
-int _gl_rotate_op(void *data)
-{
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- /* Get all selected medias count */
- int cnt = _gl_data_selected_list_count(ad);
- gl_item *gitem = NULL;
- int i = 0;
- int popup_op = GL_POPUP_OP_NONE;
- unsigned int orient = GL_ORIENTATION_ROT_ERR;
- unsigned int new_orient = GL_ORIENTATION_ROT_ERR;
- int ret = -1;
- bool b_left = false;
-
- if (ad->maininfo.medias_op_type == GL_MEDIA_OP_ROTATING_LEFT) {
- b_left = true;
- }
-
- gl_cluster *current_album = _gl_albums_get_current(data);
- /* Save cluster path to set new current_album from new albums list */
- if (current_album && current_album->cluster &&
- current_album->cluster->path &&
- strlen(current_album->cluster->path))
- g_strlcpy(ad->albuminfo.dest_folder,
- current_album->cluster->path, GL_DIR_PATH_LEN_MAX);
- else {
- gl_dbgE("Invalid folder path!");
- }
-
- /* Removed media from selected_media_elist */
- for (i = 0; i < cnt; i++) {
- gitem = eina_list_nth(ad->selinfo.elist, i);
- if (gitem != NULL && gitem->item != NULL &&
- gitem->item->file_url &&
- gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE &&
- GL_FILE_EXISTS(gitem->item->file_url)) {
- /* Save orient in file */
- ret = _gl_exif_get_orientation(gitem->item->file_url,
- &orient);
- if (ret == 0) {
- new_orient = _gl_exif_get_rotated_orientation(orient,
- b_left);
- _gl_exif_set_orientation(gitem->item->file_url,
- new_orient);
- /* Update thumbnail */
- media_info_refresh_metadata_to_db(gitem->item->uuid);
- }
- } else {
- gl_dbgE("Invalid item!");
- }
-
- /* Add some delay for last two images to wait for thumb updated */
- if (i > cnt - 2) {
- _gl_delay(GL_ROTATE_DELAY);
- }
-
- if (i == cnt) {
- gl_dbgW("Last image rotated!");
- /* Add another delay for last thumb */
- _gl_delay(GL_ROTATE_DELAY);
- }
- gl_dbg("Write pipe, make progressbar updated!");
- gl_thread_write_pipe(ad, i + 1, popup_op);
- gitem = NULL;
- }
- return 0;
-}
-
-/* Update view after rotation process done */
-int _gl_update_rotate_view(void *data)
-{
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
-
- gl_item *gitem = NULL;
- Eina_List *tmp = NULL;
- EINA_LIST_FOREACH(ad->selinfo.elist, tmp, gitem) {
- if (gitem && gitem->elm_item) {
- gitem->checked = false;
- elm_gengrid_item_update(gitem->elm_item);
- }
- }
-
- /* Clear selected list */
- _gl_data_selected_list_finalize(data);
-
- memset(ad->albuminfo.dest_folder, 0x00, GL_DIR_PATH_LEN_MAX);
-
- _gl_update_operation_view(ad, NULL);
- _gl_db_update_lock_always(data, false);
- return 0;
-}
-
-int _gl_rotate_images(void *data, bool b_left)
-{
- gl_dbg("");
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- /* Get all selected medias count */
- int cnt = _gl_data_selected_list_count(ad);
- /* Check MMC state for cancel operation */
- gl_check_mmc_state(ad, NULL);
- gl_dbg("MMC state: %d.", ad->maininfo.mmc_state);
- /* Rotate left */
- int op_type = GL_MEDIA_OP_ROTATING_LEFT;
- /* Rotate right */
- if (!b_left) {
- op_type = GL_MEDIA_OP_ROTATING_RIGHT;
- }
- _gl_db_update_lock_always(data, true);
- _gl_set_file_op_cbs(data, _gl_rotate_op, NULL, _gl_update_rotate_view,
- cnt);
- _gl_use_thread_operate_medias(ad, GL_STR_ID_ROTATING, cnt, op_type);
-
- return 0;
-}
-
-int _gl_rotate_image_by_id(void *data, const char *uuid, bool b_left)
-{
- GL_CHECK_VAL(uuid, -1);
- GL_CHECK_VAL(data, -1);
- unsigned int orient = GL_ORIENTATION_ROT_ERR;
- unsigned int new_orient = GL_ORIENTATION_ROT_ERR;
- int ret = -1;
- media_info_h media_h = NULL;
- char *path = NULL;
- media_content_type_e media_type = 0;
-
- ret = media_info_get_media_from_db(uuid, &media_h);
- if (ret != MEDIA_CONTENT_ERROR_NONE || media_h == NULL) {
- gl_dbgE("Get media failed[%d]!", ret);
- if (media_h) {
- media_info_destroy(media_h);
- }
- return -1;
- }
- ret = media_info_get_media_type(media_h, &media_type);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- gl_dbgE("Get storage type failed!");
- media_info_destroy(media_h);
- return -1;
- }
- ret = media_info_get_file_path(media_h, &path);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- gl_dbgE("Get media file path failed!");
- media_info_destroy(media_h);
- return -1;
- }
- if (media_type == MEDIA_CONTENT_TYPE_IMAGE && GL_FILE_EXISTS(path)) {
- /* Save orient in file */
- ret = _gl_exif_get_orientation(path, &orient);
- if (ret == 0) {
- new_orient = _gl_exif_get_rotated_orientation(orient,
- b_left);
- _gl_exif_set_orientation(path, new_orient);
- /* Update thumbnail */
- media_info_refresh_metadata_to_db(uuid);
- }
- }
-
- GL_FREE(path);
- media_info_destroy(media_h);
- media_h = NULL;
- return 0;
-}
-#endif
-
Eina_Bool gl_update_view(void *data, int mode)
{
GL_CHECK_FALSE(data);
Evas_Object *grid = elm_gengrid_add(parent);
GL_CHECK_NULL(grid);
-#ifdef _USE_CUSTOMIZED_GENGRID_STYLE
- elm_object_style_set(grid, GL_GENGRID_STYLE_GALLERY);
-#endif
-#ifdef _USE_SCROL_HORIZONRAL
- elm_gengrid_align_set(grid, 0.5, 0.5);
- elm_gengrid_horizontal_set(grid, EINA_TRUE);
- elm_scroller_bounce_set(grid, EINA_TRUE, EINA_FALSE);
-#else
elm_gengrid_align_set(grid, 0.0, 0.0);
elm_gengrid_horizontal_set(grid, EINA_FALSE);
elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE);
-#endif
elm_scroller_policy_set(grid, ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_AUTO);
elm_gengrid_multi_select_set(grid, EINA_TRUE);
return 0;
}
-#ifdef _USE_SCROL_HORIZONRAL
-/* Change icon size and gengrid alignment */
-int _gl_thumb_set_size(void *data, Evas_Object *view, int *size_w, int *size_h)
-{
- GL_CHECK_VAL(view, -1);
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- int rotate_mode = ad->maininfo.rotate_mode;
- int _w = 0;
- int _h = 0;
- int _w_l = 0;
- int _h_l = 0;
- int align_c = 0;
- int count = elm_gengrid_items_count(view);
- int win_w = 0;
- int win_h = 0;
- double scale = _gl_get_win_factor(ad->maininfo.win, &win_w, &win_h);
- gl_dbg("rotate_mode: %d, zoom level: %d", rotate_mode,
- ad->pinchinfo.zoom_level);
-
- _w_l = (int)(GL_GRID_L_W * scale);
- _h_l = (int)(GL_GRID_L_H * scale);
-
- if (ad->pinchinfo.zoom_level == GL_ZOOM_IN_TWO) {
- _w = (int)(win_w / GL_GRID_3_PER_ROW);
- _h = (int)(GL_GRID_H_ZOOM_02 * scale);
- align_c = GL_GRID_ITEM_ZOOM_02_CNT;
- } else if (ad->pinchinfo.zoom_level == GL_ZOOM_IN_ONE) {
-GL_THUMB_SIZE:
- _w = (int)(win_w / GL_GRID_4_PER_ROW);
- _h = (int)(GL_GRID_H_ZOOM_03 * scale);
- align_c = GL_GRID_ITEM_ZOOM_03_CNT;
- } else if (ad->pinchinfo.zoom_level == GL_ZOOM_DEFAULT) {
- _w = (int)(win_w / GL_GRID_8_PER_ROW);
- _h = (int)(GL_GRID_H * scale);
- } else {
- /* Set size same as ZOOM_IN_TWO except zoom_in_one and default level */
- goto GL_THUMB_SIZE;
- }
-
- if ((rotate_mode == APP_DEVICE_ORIENTATION_270) ||
- (rotate_mode == APP_DEVICE_ORIENTATION_90)) {
- align_c = GL_GRID_ITEM_L_CNT;
- elm_gengrid_item_size_set(view, _w_l, _h_l);
- if (size_w) {
- *size_w = _w_l - 4;
- }
- if (size_h) {
- *size_h = _h_l - 4;
- }
- } else {
- elm_gengrid_item_size_set(view, _w, _h);
- if (size_w) {
- *size_w = _w - 4;
- }
- if (size_h) {
- *size_h = _h - 4;
- }
- }
- if (count <= align_c) {
- elm_gengrid_align_set(view, 0.5, 0.5);
- } else {
- elm_gengrid_align_set(view, 0.0, 0.5);
- }
- if (size_w && size_h) {
- gl_dbg("P: %dx%d, size_w: %d,size_h: %d", _w, _h, *size_w, *size_h);
- }
- return 0;
-}
-#else
/* Change icon size and gengrid alignment */
int _gl_thumb_set_size(void *data, Evas_Object *view, int *size_w, int *size_h)
{
}
return 0;
}
-#endif
int _gl_thumb_split_set_size(void *data, Evas_Object *view)
{
/* Width and height of album item (4+331, 4+331) */
#define GL_TILE_ITEM_WIDTH 360
#define GL_TILE_ITEM_HEIGHT 354
-#define GL_TILE_ITEM_L_W 426
-#define GL_TILE_ITEM_L_H 426
+//#define GL_TILE_ITEM_L_W 426
+//#define GL_TILE_ITEM_L_H 426
#define GL_TILE_2_PER_ROW 2
#define GL_TILE_3_PER_ROW 3
#define GL_TILE_4_PER_ROW 4
#define GL_TILE_ITEM_CNT2 12
#define GL_TILE_ITEM_L_CNT 3
/* Items count of each column */
-#define GL_TILE_ITEM_C_CNT 3
-#define GL_TILE_ALIGN_LEFT 0.0f
+//#define GL_TILE_ITEM_C_CNT 3
+//#define GL_TILE_ALIGN_LEFT 0.0f
#define GL_TILE_ALIGN_CON1 0.25f
#define GL_TILE_ALIGN_CON2 0.75f
#define GL_TILE_ALIGN_MID 0.5f
-#define GL_TILE_ALIGN_BOT 1.0f
+//#define GL_TILE_ALIGN_BOT 1.0f
/* Size of album icon */
#define GL_TILE_W (GL_TILE_ITEM_WIDTH-8)
#define GL_TILE_H (GL_TILE_ITEM_HEIGHT-8)
-#define GL_CHECKBOX_STYLE_ALBUM "gallery/album"
+//#define GL_CHECKBOX_STYLE_ALBUM "gallery/album"
#define GL_CHECKBOX_STYLE_ALBUM_GRID "gallery/album/grid"
static Evas_Object *__gl_tile_add_icon_bg(Evas_Object *obj, bg_file_set_cb func,
Evas_Object *grid = elm_gengrid_add(parent);
GL_CHECK_NULL(grid);
-#ifdef _USE_CUSTOMIZED_GENGRID_STYLE
- elm_object_style_set(grid, GL_GENGRID_STYLE_GALLERY);
-#endif
/* horizontal scrolling */
-#ifdef _USE_SCROL_HORIZONRAL
- elm_gengrid_align_set(grid, GL_TILE_ALIGN_MID, GL_TILE_ALIGN_MID);
- elm_gengrid_horizontal_set(grid, EINA_TRUE);
- elm_scroller_bounce_set(grid, EINA_TRUE, EINA_FALSE);
-#else
elm_gengrid_align_set(grid, GL_TILE_ALIGN_MID, 0.0);
elm_gengrid_horizontal_set(grid, EINA_FALSE);
elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE);
-#endif
elm_scroller_policy_set(grid, ELM_SCROLLER_POLICY_OFF,
ELM_SCROLLER_POLICY_AUTO);
return grid;
}
-#ifdef _USE_SCROL_HORIZONRAL
-/* Change icon size and gengrid alignment */
-int _gl_tile_update_item_size(void *data, Evas_Object *grid, bool b_update)
-{
- GL_CHECK_VAL(grid, -1);
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- int rotate_mode = ad->maininfo.rotate_mode;
- int w = 0;
- int h = 0;
- int c = 0;
- int c2 = 0;
- int w_l = 0;
- int h_l = 0;
- int c_l = 0;
- int win_w = 0;
- int win_h = 0;
- double scale = _gl_get_win_factor(ad->maininfo.win, &win_w, &win_h);
- gl_dbg("rotate_mode: %d, b_update: %d", rotate_mode, b_update);
-
- w = (int)(win_w / GL_TILE_2_PER_ROW);
- h = (int)(GL_TILE_ITEM_HEIGHT * scale);
- w_l = (int)(win_h / GL_TILE_3_PER_ROW);
- h_l = (int)(GL_TILE_ITEM_L_H * scale);
- c = GL_TILE_ITEM_CNT;
- c_l = GL_TILE_ITEM_L_CNT;
- c2 = GL_TILE_ITEM_C_CNT;
-
- /* Change size in pinch zoom out mode */
- int level = (int)evas_object_data_get(grid, GL_GESTURE_KEY_PINCH_LEVEL);
- if (level < GL_ZOOM_DEFAULT) {
- gl_dbg("Use smaller size");
- w = (int)(win_w / GL_TILE_3_PER_ROW);
- h *= 0.75f;
- c = GL_TILE_ITEM_CNT2;
- c2 = GL_TILE_ITEM_C_CNT + 1;
- }
- gl_dbg("P %dx%d L %dx%d C %dx%d", w, h, w_l, h_l, c, c_l);
-
- double align_x = 0.0f;
- double align_y = 0.0f;
- unsigned int count = 0;
- count = elm_gengrid_items_count(grid);
- elm_gengrid_align_get(grid, &align_x, &align_y);
- gl_dbg("count: %d, align_x: %f, align_y: %f", count, align_x, align_y);
-
- if ((rotate_mode == APP_DEVICE_ORIENTATION_270) ||
- (rotate_mode == APP_DEVICE_ORIENTATION_90)) {
- /* >=3, (0.0, 0.5); <3, (0.5, 0.5) */
- if (count >= c_l && (align_x > GL_TILE_ALIGN_CON1 ||
- align_y > GL_TILE_ALIGN_CON2))
- elm_gengrid_align_set(grid, GL_TILE_ALIGN_LEFT,
- GL_TILE_ALIGN_MID);
- else if (count < c_l && (align_x < GL_TILE_ALIGN_CON1 ||
- align_y > GL_TILE_ALIGN_CON2))
- elm_gengrid_align_set(grid, GL_TILE_ALIGN_MID,
- GL_TILE_ALIGN_MID);
-
- elm_gengrid_item_size_set(grid, w_l, h_l);
- } else {
- /* >=6, (0.0, 1.0); <3, (0.5, 0.5); <6, (0.5, 1.0) */
- if (count >= c && (align_x > GL_TILE_ALIGN_CON1 ||
- align_y < GL_TILE_ALIGN_CON2)) {
- elm_gengrid_align_set(grid, GL_TILE_ALIGN_LEFT,
- GL_TILE_ALIGN_MID);
- } else if (count < c) {
- if (count < c2 &&
- (align_x < GL_TILE_ALIGN_CON1 ||
- align_y > GL_TILE_ALIGN_CON2))
- elm_gengrid_align_set(grid, GL_TILE_ALIGN_MID,
- GL_TILE_ALIGN_MID);
- else if (count >= c2 &&
- (align_x < GL_TILE_ALIGN_CON1 ||
- align_y < GL_TILE_ALIGN_CON2))
- elm_gengrid_align_set(grid, GL_TILE_ALIGN_MID,
- GL_TILE_ALIGN_MID);
- }
- elm_gengrid_item_size_set(grid, w, h);
- }
-
- if (b_update) {
- elm_gengrid_realized_items_update(grid);
- }
- return 0;
-}
-#else
/* Change icon size and gengrid alignment */
int _gl_tile_update_item_size(void *data, Evas_Object *grid, bool b_update)
{
}
return 0;
}
-#endif
Evas_Object *_gl_tile_add_gesture(void *data, Evas_Object *parent)
{