#include "gl-albums.h"
#include "gl-albums-sel.h"
#include "gl-nocontents.h"
-#include "gl-ext-exec.h"
#include "gl-ext-ug-load.h"
#include "gl-ctxpopup.h"
#include "gl-popup.h"
#include "gl-button.h"
-#include "gl-ext-exec.h"
#include "gl-notify.h"
#include "gl-db-update.h"
#include "gl-thread-util.h"
static int __gl_timeline_change_mode(void *data, int mode);
static Evas_Object *__gl_timeline_create_list_view(gl_timeline_s *timeline_d, bool update);
-#ifdef _USE_APP_SLIDESHOW
-static int __gl_timeline_edit(void *data);
-#endif
void _gl_timeline_notify_date_check(gl_timeline_s *it_d, Evas_Object *obj, gl_media_s *item);
static bool __gl_timeline_is_checked(gl_timeline_s *timeline_d, char *uuid)
return false;
}
-#if 0
-static bool __gl_timeline_clear_sel_cnt(gl_timeline_s *timeline_d)
-{
- GL_CHECK_FALSE(timeline_d);
- if (timeline_d->sel_d == NULL) {
- return false;
- }
-
- timeline_d->sel_d->sel_list = NULL;
- timeline_d->sel_d->jpge_cnt = 0;
- timeline_d->sel_d->image_cnt = 0;
- return true;
-}
-#endif
-
static bool __gl_timeline_clear_sel_list(gl_timeline_s *timeline_d)
{
GL_CHECK_FALSE(timeline_d);
if (sel_cnt > 0) {
gl_dbg("view_m: %d", ad->tlinfo->view_m);
if (ad->tlinfo->view_m == GL_TL_VIEW_EDIT) {
- /* Disable delete/edit/addtag if facebook files selected */
- /* Disable edit/addtag if cloud files selected */
- /* facebook files only for share */
_gl_ui_disable_menu(timeline_d->nf_it, false);
_gl_ctrl_disable_items(timeline_d->nf_it, false);
- } else { /* Share mode */
+ } else {
_gl_ctrl_disable_items(timeline_d->nf_it, false);
}
} else {
return false;
}
-#if 0
-static int __gl_timeline_update_sel_list(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- GL_CHECK_VAL(timeline_d->sel_d, -1);
- int ret = -1;
- Eina_List *new_l = NULL;
- Eina_List *list = NULL;
-
- ret = _gl_data_get_items(GL_GET_ALL_RECORDS, GL_GET_ALL_RECORDS, &list);
- if (ret != 0 || !list) {
- gl_dbgW("Empty!");
- }
-
- /* Clear old selected count of sepecial files type */
- __gl_timeline_clear_sel_cnt(timeline_d);
-
- gl_media_s *item = NULL;
- char *tmp = NULL;
- EINA_LIST_FREE(list, item) {
- if (!item || !item->uuid) {
- continue;
- }
- if (__gl_timeline_sel_remove_item(timeline_d, item->uuid)) {
- tmp = g_strdup(item->uuid);
- new_l = eina_list_append(new_l, (void *)tmp);
- __gl_timeline_check_special_file(timeline_d, item, true);
- }
- _gl_data_type_free_glitem((void **)(&item));
- item = NULL;
- tmp = NULL;
- }
-
- __gl_timeline_clear_sel_list(timeline_d);
- return 0;
-}
-
-static int __gl_timeline_check_op(gl_tlp_s *it_d, Evas_Object *obj, int index)
-{
- GL_CHECK_VAL(obj, -1);
- GL_CHECK_VAL(it_d, -1);
- GL_CHECK_VAL(it_d->timeline_d, -1);
- GL_CHECK_VAL(it_d->timeline_d->ad, -1);
- gl_dbg("index: %d", index);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
-#ifdef _USE_SVI
- /* Play touch sound */
- _gl_play_sound(it_d->timeline_d->ad);
-#endif
-
- Eina_List *list = NULL;
- _gl_data_get_items(it_d->start_pos, it_d->end_pos, &list);
- if (list == NULL) {
- gl_dbgW("Empty list!");
- return -1;
- }
-
- gl_media_s *item = NULL;
- item = eina_list_nth(list, index);
-
- Eina_Bool checked = elm_check_state_get(obj);
- gl_dbg("checked: %d", checked);
- gl_sdbg("uuid: %s", item->uuid);
-
- if (checked) {
- __gl_timeline_check_special_file(it_d->timeline_d, item, true);
- __gl_timeline_sel_append_item(it_d->timeline_d, item->uuid);
- } else {
- __gl_timeline_check_special_file(it_d->timeline_d, item, false);
- __gl_timeline_sel_remove_item(it_d->timeline_d, item->uuid);
- }
-
- /* Update the label text */
- int sel_cnt = __gl_timeline_get_sel_cnt(it_d->timeline_d);
- _gl_ui_update_navi_title_text(it_d->timeline_d->nf_it, sel_cnt, false);
-
- __gl_timeline_check_btns_state(it_d->timeline_d, it_d->timeline_d->count,
- sel_cnt);
-
- _gl_data_type_free_media_list(&list);
- return 0;
-}
-#endif
-
static int __gl_timeline_thumb_check_op(gl_timeline_s *it_d, Evas_Object *obj, gl_media_s *item)
{
GL_CHECK_VAL(obj, -1);
GL_CHECK_VAL(it_d->ad, -1);
GL_CHECK_VAL(item, -1);
-#ifdef _USE_SVI
- /* Play touch sound */
- _gl_play_sound(it_d->ad);
-#endif
-
Eina_Bool checked = elm_check_state_get(obj);
item->check_state = checked;
if (checked) {
__gl_timeline_thumb_check_op(td, obj, gitem);
}
-#if 0
-static int __gl_timeline_open_file(gl_tlp_s *it_d, int index)
-{
- GL_CHECK_VAL(it_d, -1);
- GL_CHECK_VAL(it_d->timeline_d, -1);
- GL_CHECK_VAL(it_d->timeline_d->ad, -1);
- gl_dbg("index: %d", index);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
-#ifdef _USE_SVI
- /* Play touch sound */
- _gl_play_sound(it_d->timeline_d->ad);
-#endif
-
- Eina_List *list = NULL;
- _gl_data_get_items(it_d->start_pos, it_d->end_pos, &list);
- if (list == NULL) {
- gl_dbgW("Empty list!");
- return -1;
- }
- gl_media_s *item = NULL;
- item = eina_list_nth(list, index);
-
- if (item && item->file_url)
- _gl_ext_load_iv_timeline(it_d->timeline_d->ad, item->file_url,
- (it_d->start_pos + index + 1));
- else {
- gl_dbgW("Image wasn't found!");
- }
- _gl_data_type_free_media_list(&list);
- return 0;
-}
-
-static void __gl_timeline_mouse_down(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- GL_CHECK(ei);
- GL_CHECK(data);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
- GL_CHECK(it_d->timeline_d);
- Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *)ei;
-
- it_d->timeline_d->mouse.x = ev->output.x;
- it_d->timeline_d->mouse.y = ev->output.y;
-}
-
-static void __gl_timeline_mouse_up(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- GL_CHECK(ei);
- GL_CHECK(data);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
- GL_CHECK(it_d->timeline_d);
- GL_CHECK(it_d->timeline_d->ad);
-
- if (!ei || !obj) {
- return;
- }
-
- Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *)ei;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD ||
- ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) {
- return;
- }
-
- if ((abs(it_d->timeline_d->mouse.x - ev->output.x) > GL_MOUSE_RANGE) ||
- (abs(it_d->timeline_d->mouse.y - ev->output.y) > GL_MOUSE_RANGE)) {
- return;
- }
-
- int saved_i = 0;
-#ifdef _USE_ROTATE_BG
- _gl_rotate_bg_get_data(obj, (void **)(&saved_i));
-#endif
- if (it_d->timeline_d->view_m != GL_TL_VIEW_NORMAL) {
- char *part = NULL;
- part = g_strdup_printf(GL_TL_CHECKBOX_FORMAT, it_d->count,
- saved_i + 1);
- Evas_Object *ck = NULL;
- ck = elm_object_part_content_get(it_d->layout, part);
- GL_FREEIF(part);
- elm_check_state_set(ck, !elm_check_state_get(ck));
- __gl_timeline_check_op(it_d, ck, saved_i);
- } else {
- __gl_timeline_open_file(it_d, saved_i);
- }
-}
-
-static int __gl_timeline_clear_bg_data(Evas_Object *bg)
-{
- GL_CHECK_VAL(bg, -1);
- gl_media_s *item = NULL;
- gl_timeline_s *timeline_d = NULL;
-
- item = (gl_media_s *)evas_object_data_get(bg, GL_TL_TILE_DATA_KEY);
- if (item) {
- gl_dbg("Free media item!");
- _gl_data_type_free_glitem((void **)(&item));
- }
- evas_object_data_del(bg, GL_TL_TILE_DATA_KEY);
-
- timeline_d = (gl_timeline_s *)evas_object_data_get(bg, GL_TL_DATA_KEY);
- if (timeline_d && timeline_d->thumbs) {
- gl_dbg("Remove object!");
- timeline_d->thumbs = eina_list_remove(timeline_d->thumbs,
- (void *)bg);
- }
- return 0;
-}
-
-static void __gl_timeline_del_bg_cb(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("Delete bg ---");
- __gl_timeline_clear_bg_data(obj);
- /* Remove mouse event if bg deleted */
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN,
- __gl_timeline_mouse_down);
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP,
- __gl_timeline_mouse_up);
- gl_dbgW("Delete bg +++");
-}
-
-static Evas_Object *__gl_timeline_add_page_bg(Evas_Object *layout,
- const char *part,
- unsigned int orient, char *path,
- int w, int h)
-{
- GL_CHECK_NULL(layout);
-#ifdef _USE_ROTATE_BG
- Evas_Object *bg = _gl_rotate_bg_add(layout, false);
- GL_CHECK_NULL(bg);
-
- _gl_rotate_bg_set_file(bg, path, w, h);
- _gl_rotate_bg_rotate_image(bg, orient);
-
- gl_dbg("part-%s", part);
- elm_object_part_content_set(layout, part, bg);
- return bg;
-#else
- return NULL;
-#endif
-}
-
-static void __gl_timeline_check_changed(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(data);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
-
- int idx = (int)evas_object_data_get(obj, "gl_tl_idx_key");
- __gl_timeline_check_op(it_d, obj, idx);
-}
-
-static Evas_Object *__gl_timeline_add_ck(Evas_Object *layout,
- const char *part, bool b_checked,
- gl_tlp_s *it_d)
-{
- GL_CHECK_NULL(layout);
- Evas_Object *ck = NULL;
- ck = _gl_thumb_show_checkbox(layout, b_checked,
- __gl_timeline_check_changed, it_d);
- gl_dbg("part-%s", part);
- elm_object_part_content_set(layout, part, ck);
- return ck;
-}
-
-static Evas_Object *__gl_timeline_add_page_ly(Evas_Object *parent,
- gl_tlp_s *it_d)
-{
- GL_CHECK_NULL(it_d);
- GL_CHECK_NULL(parent);
- Evas_Object *ly = NULL;
-
- char *path = _gl_get_edje_path();
- GL_CHECK_NULL(path);
- char *group = NULL;
- if (it_d->h > it_d->w) {
- group = g_strdup_printf("gallery/timeline_%d", it_d->count);
- } else {
- group = g_strdup_printf("gallery/timeline_%dl", it_d->count);
- }
-
- ly = gl_ui_load_edj(parent, path, group);
- free(path);
- GL_GFREE(group);
- GL_CHECK_NULL(ly);
-
- Evas_Object *bg = evas_object_rectangle_add(evas_object_evas_get(ly));
- if (!bg) {
- evas_object_del(ly);
- return NULL;
- }
-
- evas_object_color_set(bg, 0, 0, 0, 0);
- elm_object_part_content_set(ly, "bg_c", bg);
-
- evas_object_show(ly);
- return ly;
-}
-#endif
-
static bool __gl_timeline_is_yesterday(struct tm *req_tm, struct tm *now_tm)
{
if (now_tm->tm_yday == 0) { /* It is the first day of this year */
return 0;
}
-#if 0
-/* check mtime is changed or not */
-static bool __gl_timeline_is_tm_changed(struct tm t1, struct tm t2,
- gl_tm_s *tms, gl_tm_s *tme)
-{
- GL_CHECK_FALSE(tms);
- GL_CHECK_FALSE(tme);
-
- gl_dbgW("%d/%d/%d-%d/%d/%d =? %d/%d/%d-%d/%d/%d!", t1.tm_year, t1.tm_mon,
- t1.tm_mday, t2.tm_year, t2.tm_mon, t2.tm_mday, tms->tm_year,
- tms->tm_mon, tms->tm_mday, tme->tm_year, tme->tm_mon,
- tme->tm_mday);
-
- if (tms->tm_year == t1.tm_year && tms->tm_mon == t1.tm_mon &&
- tms->tm_mday == t1.tm_mday && tme->tm_year == t2.tm_year &&
- tme->tm_mon == t2.tm_mon && tme->tm_mday == t2.tm_mday) {
- return false;
- }
-
- tms->tm_year = t1.tm_year;
- tms->tm_mon = t1.tm_mon;
- tms->tm_mday = t1.tm_mday;
-
- tme->tm_year = t2.tm_year;
- tme->tm_mon = t2.tm_mon;
- tme->tm_mday = t2.tm_mday;
- return true;
-}
-#endif
-
/* Caller need to free strings returned */
static int __gl_timeline_get_mtime_str(struct tm t1, struct tm t2, char **str1,
char **str2)
return 0;
}
-#if 0
-static Evas_Object *__gl_timeline_add_title(Evas_Object *parent, char *text1,
- char *text2)
-{
- gl_dbg("");
- GL_CHECK_NULL(parent);
- Evas_Object *bx = NULL;
- Evas_Object *data1 = NULL;
- Evas_Object *data2 = NULL;
- double scale = elm_config_scale_get();
-
- if (text2 == NULL) {
- goto GL_UI_FAILED;
- }
-
- bx = elm_box_add(parent);
- GL_CHECK_NULL(bx);
- elm_box_horizontal_set(bx, EINA_TRUE);
- elm_box_homogeneous_set(bx, EINA_FALSE);
- evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bx, 0.0, 0.5);
- elm_box_align_set(bx, 0.0, 0.5);
-
- Evas *evas = evas_object_evas_get(parent);
- if (evas == NULL) {
- goto GL_UI_FAILED;
- }
- /* Pad - 11 */
- Evas_Object *rect1 = evas_object_rectangle_add(evas);
- if (rect1 == NULL) {
- goto GL_UI_FAILED;
- }
- Evas_Coord pad_w = (Evas_Coord)(11 * scale);
- Evas_Coord pad_h = (Evas_Coord)(GL_TIMELINE_TITLE_H * scale);
- evas_object_resize(rect1, pad_w, pad_h);
- evas_object_size_hint_min_set(rect1, pad_w, pad_h);
- evas_object_size_hint_max_set(rect1, pad_w, pad_h);
- elm_box_pack_end(bx, rect1);
-
- /* data 1 */
- if (text1) {
- data1 = elm_label_add(parent);
- if (data1 == NULL) {
- goto GL_UI_FAILED;
- }
- evas_object_size_hint_weight_set(data1, 0.0, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(data1, 0.0, 0.5);
- elm_box_pack_end(bx, data1);
- evas_object_show(data1);
- /* Set text */
- gl_dbg("%s", text1);
- elm_object_text_set(data1, text1);
- GL_GFREE(text1);
-
- /* Pad - 10 */
- Evas_Object *rect2 = evas_object_rectangle_add(evas);
- if (rect2 == NULL) {
- goto GL_UI_FAILED;
- }
- Evas_Coord pad2_w = (Evas_Coord)(10 * scale);
- evas_object_resize(rect2, pad2_w, pad_h);
- evas_object_size_hint_min_set(rect2, pad2_w, pad_h);
- evas_object_size_hint_max_set(rect2, pad2_w, pad_h);
- elm_box_pack_end(bx, rect2);
- }
-
- /* data 2 */
- data2 = elm_label_add(parent);
- if (data2 == NULL) {
- goto GL_UI_FAILED;
- }
- evas_object_size_hint_weight_set(data2, 0.0, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(data2, 0.0, 0.5);
- elm_box_pack_end(bx, data2);
- evas_object_show(data2);
- /* Set text */
- gl_dbg("%s", text2);
- elm_object_text_set(data2, text2);
- GL_GFREE(text2);
-
- /* Pad - 11 */
- Evas_Object *rect3 = evas_object_rectangle_add(evas);
- if (rect3 == NULL) {
- goto GL_UI_FAILED;
- }
- evas_object_resize(rect3, pad_w, pad_h);
- evas_object_size_hint_min_set(rect3, pad_w, pad_h);
- evas_object_size_hint_max_set(rect3, pad_w, pad_h);
- elm_box_pack_end(bx, rect3);
-
- evas_object_show(bx);
- return bx;
-
-GL_UI_FAILED:
-
- gl_dbgE("Failed to add title!");
- GL_IF_DEL_OBJ(bx);
- return NULL;
-}
-#endif
-
/* Reset title for previous animation if another animation is triggerred */
static int __gl_timeline_reset_title(gl_timeline_s *timeline_d)
{
(void *)timeline_d);
} else {
/* Add callback for title updating */
- edje_object_signal_callback_del(_EDJ(timeline_d->layout),
- GL_TL_TITLE2_SHOW_FINISHED, "",
- __gl_timeline_on_title2_show_finished);
- edje_object_signal_callback_del(_EDJ(timeline_d->layout),
- GL_TL_TITLE_HIDE_FINISHED, "",
- __gl_timeline_on_title_hide_finished);
- }
- return 0;
-}
-
-#if 0
-static Eina_Bool __gl_timeline_title_trans_cb(void *data)
-{
- GL_CHECK_CANCEL(data);
- gl_timeline_s *timeline_d = (gl_timeline_s *)data;
- gl_dbg("");
-
- if (!timeline_d->b_updating_title) {
- gl_dbgW("Updating done!");
- return ECORE_CALLBACK_CANCEL;
- }
-
- timeline_d->animator = NULL;
-
- edje_object_signal_emit(_EDJ(timeline_d->layout),
- GL_TL_TITLE_FADE_OUT, "elm");
- //edje_object_message_signal_process(_EDJ(timeline_d->layout));
- edje_object_signal_emit(_EDJ(timeline_d->layout),
- GL_TL_TITLE2_FADE_IN, "elm");
- edje_object_message_signal_process(_EDJ(timeline_d->layout));
- edje_object_signal_emit(_EDJ(timeline_d->layout),
- GL_TL_TITLE_HIDE_DEFERRED, "elm");
- edje_object_message_signal_process(_EDJ(timeline_d->layout));
- edje_object_signal_emit(_EDJ(timeline_d->layout),
- GL_TL_TITLE2_SHOW_DEFERRED, "elm");
- edje_object_message_signal_process(_EDJ(timeline_d->layout));
-
- gl_dbg("done");
- return ECORE_CALLBACK_CANCEL;
-}
-
-static int __gl_timeline_start_title_trans(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- edje_object_signal_emit(_EDJ(timeline_d->layout), GL_TL_TITLE_SHOW,
- "elm");
- edje_object_signal_emit(_EDJ(timeline_d->layout), GL_TL_TITLE2_CREATED,
- "elm");
- edje_object_message_signal_process(_EDJ(timeline_d->layout));
- timeline_d->animator = ecore_animator_add(__gl_timeline_title_trans_cb,
- timeline_d);
- return 0;
-}
-
-static int __gl_timeline_update_title(gl_timeline_s *timeline_d, gl_tlp_s *it_d,
- bool b_forced)
-{
- GL_CHECK_VAL(it_d, -1);
- GL_CHECK_VAL(timeline_d, -1);
- gl_dbg("index-%d, count-%d", it_d->index, it_d->count);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
- Eina_List *list = NULL;
- _gl_data_get_items(it_d->start_pos, it_d->end_pos, &list);
- if (list == NULL) {
- gl_dbgW("Empty list!");
- return -1;
- }
-
- Evas_Object *title = NULL;
- gl_media_s *item = NULL;
- int i = 0;
- time_t mtime1 = 0;
- time_t mtime2 = 0;
- int count = eina_list_count(list);
-
- for (i = 0; i < count; i++) {
- item = eina_list_nth(list, i);
- if (item == NULL) {
- gl_dbgE("Invalid item!");
- continue;
- }
-
- if (i == 0) {
- mtime1 = item->mtime;
- }
- if (i == count - 1) {
- mtime2 = item->mtime;
- }
-
- item = NULL;
- }
- _gl_data_type_free_media_list(&list);
-
- struct tm t1;
- struct tm t2;
- __gl_timeline_get_tm(mtime1, mtime2, &t1, &t2);
- /* Time changed? */
- if (!b_forced &&
- !__gl_timeline_is_tm_changed(t1, t2, &(timeline_d->tm_s), &(timeline_d->tm_e))) {
- if (!elm_object_part_content_get(timeline_d->layout, "title")) {
- gl_dbgW("Title is empty, recreate it!");
- } else {
- gl_dbgW("Same mtime, change nothing!");
- return 0;
- }
- }
- /* Get title range -- string */
- char *text1 = NULL;
- char *text2 = NULL;
- __gl_timeline_get_mtime_str(t1, t2, &text1, &text2);
- /* Add title object */
- title = __gl_timeline_add_title(timeline_d->layout, text1, text2);
- GL_CHECK_VAL(title, -1);
- if (!b_forced && /* Dont transit if it's forced to update title */
- elm_object_part_content_get(timeline_d->layout, "title")) {
- /* Play Animation for title updating */
- gl_dbg("Animate title");
- if (timeline_d->b_updating_title) {
- gl_dbgW("Cancel previous animation!");
- GL_IF_DEL_ANIMATOR(timeline_d->animator);
- /* Delete callback first to skip useless operation */
- __gl_timeline_add_title_trans_finished_cbs(timeline_d,
- false);
- __gl_timeline_reset_title(timeline_d);
- /* Add callback again */
- __gl_timeline_add_title_trans_finished_cbs(timeline_d,
- true);
- } else {
- timeline_d->b_updating_title = true;
- }
- elm_object_part_content_set(timeline_d->layout, "title2", title);
- __gl_timeline_start_title_trans(timeline_d);
- } else {
- gl_dbg("Set title");
- elm_object_part_content_set(timeline_d->layout, "title", title);
- }
- return 0;
-}
-
-static int __gl_timeline_get_tile_size(int count, int idx, bool b_land, int *w,
- int *h)
-{
- GL_CHECK_VAL(w, -1);
- GL_CHECK_VAL(h, -1);
-
- if (count == 1) {
- if (b_land) {
- *w = GL_WIN_HEIGHT;
- *h = GL_TIMELINE_CONTENT_L_H;
- } else {
- *w = GL_WIN_WIDTH;
- *h = GL_TIMELINE_CONTENT_P_H;
- }
- } else if (count == 2 || (count == 3 && idx == 0)) {
- if (!b_land) {
- *w = GL_WIN_WIDTH * 2 / 3;
- *h = GL_TIMELINE_CONTENT_P_H / 2;
- } else if (idx == 0) {
- *w = GL_WIN_HEIGHT * 2 / 3;
- *h = GL_TIMELINE_CONTENT_L_H;
- }
- }
- return 0;
-}
-#endif
-
-/* Free data after page deleted */
-static void __gl_timeline_del_page_cb(void *data, Evas *e, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("Delete page ---");
- GL_CHECK(data);
- evas_object_smart_callback_del(obj, "layout,page,deleted",
- __gl_timeline_page_deleted_cb);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
- GL_IF_DEL_IDLER(it_d->update_idler);
- it_d->b_created = false;
- gl_dbgW("Delete page +++");
-}
-
-static void __gl_timeline_page_deleted_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("Deleted page ------");
- evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
- __gl_timeline_del_page_cb);
- GL_CHECK(data);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
- GL_IF_DEL_IDLER(it_d->update_idler);
- it_d->b_created = false;
- gl_dbgW("Deleted page ++++++");
-}
-
-#if 0
-static int __gl_timeline_update_page(gl_tlp_s *it_d)
-{
- GL_CHECK_VAL(it_d, -1);
- GL_CHECK_VAL(it_d->layout, -1);
- gl_dbg("index-%d, count-%d", it_d->index, it_d->count);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
- Eina_List *list = NULL;
- _gl_data_get_items(it_d->start_pos, it_d->end_pos, &list);
- if (list == NULL) {
- gl_dbgW("Empty list!");
- return -1;
- }
-
- bool b_landscape = false;
- if (it_d->w > it_d->h) {
- b_landscape = true;
- }
-
- Evas_Object *layout = it_d->layout;
- Evas_Object *bg = NULL;
- gl_media_s *item = NULL;
- int i = 0;
- char *part = NULL;
- int count = eina_list_count(list);
- char *path = NULL;
- unsigned int orient = 0;
- int w = GL_TIMELINE_PAGE_SIZE;
- int h = GL_TIMELINE_PAGE_SIZE;
-
- for (i = 0; i < count; i++) {
- item = eina_list_nth(list, i);
- if (item == NULL) {
- gl_dbgE("Invalid item!");
- continue;
- }
-
- /* Checkme: Scrolling doesn't work smoothly if original file was used */
- /* Get orientation for original file */
- if (((i == 0 && count <= 5) ||
- (i == 1 && count <= 3 && !b_landscape) ||
- (i == 2 && count == 4 && !b_landscape) ||
- (i == 1 && (count == 2 || count == 4) && b_landscape)) &&
- item->type == MEDIA_CONTENT_TYPE_IMAGE &&
- GL_FILE_EXISTS(item->file_url)) {
- path = item->file_url;
-#ifdef _USE_ROTATE_BG
- if (_gl_exif_get_orientation(path, &orient) < 0) {
- path = item->thumb_url;
- return -1;
- }
-#endif
- __gl_timeline_get_tile_size(count, i, b_landscape, &w,
- &h);
- part = g_strdup_printf(GL_TL_CONTENTS_FORMAT,
- it_d->count, i + 1);
- bg = elm_object_part_content_get(layout, part);
- if (bg) {
- _gl_rotate_bg_set_file(bg, path, w, h);
- _gl_rotate_bg_rotate_image(bg, orient);
- } else {
- gl_dbgE("BG is invalid!");
- }
- GL_GFREEIF(part);
- }
- part = NULL;
- item = NULL;
- }
- _gl_data_type_free_media_list(&list);
- gl_dbg("done");
- return 0;
-}
-
-static void __gl_timeline_page_transited_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("Transited page ------");
- evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
- __gl_timeline_del_page_cb);
- GL_CHECK(data);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
- GL_IF_DEL_IDLER(it_d->update_idler);
- _gl_slider_set_zop(it_d->timeline_d->view, GL_SLIDE_ZOP_DEFAULT);
- __gl_timeline_update_page((gl_tlp_s *)data);
- gl_dbgW("evas_object_freeze_events_set EINA_FALSE");
- evas_object_freeze_events_set(it_d->timeline_d->view, EINA_FALSE);
- gl_dbgW("Transited page ++++++");
-}
-
-static Eina_Bool __gl_timeline_page_update_idler_cb(void *data)
-{
- gl_dbgW("start");
- GL_CHECK_CANCEL(data);
- gl_tlp_s *it_d = (gl_tlp_s *)data;
- GL_IF_DEL_IDLER(it_d->update_idler);
- __gl_timeline_update_page((gl_tlp_s *)data);
- gl_dbgW("done");
- return ECORE_CALLBACK_CANCEL;
-}
-
-static int __gl_timeline_check_page_idler(gl_tlp_s *it_d)
-{
- GL_CHECK_VAL(it_d, -1);
- GL_CHECK_VAL(it_d->timeline_d, -1);
-
- gl_slide_zop_e zoom = _gl_slider_get_zop(it_d->timeline_d->view);
- gl_dbg("zoom-%d, tran_op-%d", zoom, it_d->timeline_d->tran_op);
- if (it_d->timeline_d->tran_op == GL_TRANS_OP_PREPARE ||
- it_d->timeline_d->tran_op == GL_TRANS_OP_DONE) {
- gl_dbg("Update checked by transit callback");
- } else if (it_d->timeline_d->tran_op == GL_TRANS_OP_START) {
- gl_dbg("Delay idler callback");
- it_d->timeline_d->idlers = eina_list_append(it_d->timeline_d->idlers,
- it_d);
- } else if (zoom == GL_SLIDE_ZOP_OUT || zoom == GL_SLIDE_ZOP_IN) {
- gl_dbg("Updated by transit callback");
- } else {
- GL_IF_DEL_IDLER(it_d->update_idler);
- gl_dbg("Add idler callback");
- it_d->update_idler = ecore_idler_add(__gl_timeline_page_update_idler_cb,
- it_d);
- }
- return 0;
-}
-
-static int __gl_timeline_add_page_cbs(gl_tlp_s *it_d, Evas_Object *layout)
-{
- GL_CHECK_VAL(layout, -1);
- GL_CHECK_VAL(it_d, -1);
-
- /* Register delete callback */
- evas_object_event_callback_add(layout, EVAS_CALLBACK_DEL,
- __gl_timeline_del_page_cb, it_d);
- evas_object_smart_callback_add(layout, "layout,page,deleted",
- __gl_timeline_page_deleted_cb, it_d);
- /* Register transit callback */
- evas_object_smart_callback_add(layout, "layout,page,transited",
- __gl_timeline_page_transited_cb, it_d);
- return 0;
-}
-
-static void __gl_timeline_transit_op(Elm_Transit_Effect *data,
- Elm_Transit *transit, double progress)
-{
- gl_dbg("");
-}
-
-static void __gl_timeline_transit_done(Elm_Transit_Effect *data, Elm_Transit *transit)
-{
- GL_CHECK(data);
- gl_tile_s *tile = (gl_tile_s *)data;
- gl_dbgW("%d/%d", tile->count, tile->total);
- if (tile->count != tile->total) {
- return;
- }
-
- gl_dbgW("tran_op: %d", tile->timeline_d->tran_op);
- if (tile->timeline_d->tran_op == GL_TRANS_OP_START) {
- tile->timeline_d->tran_op = GL_TRANS_OP_DONE;
- _gl_slider_update_first_item(tile->timeline_d->view);
- }
- tile->timeline_d->tran_op = GL_TRANS_OP_DEFAULT;
- gl_dbg("idlers: %p", tile->timeline_d->idlers);
- if (tile->timeline_d->idlers) {
- gl_tlp_s *it_d = NULL;
- EINA_LIST_FREE(tile->timeline_d->idlers, it_d) {
- gl_dbg("it_d: %p", it_d);
- it_d->update_idler = ecore_idler_add(__gl_timeline_page_update_idler_cb,
- it_d);
- it_d = NULL;
- }
- tile->timeline_d->idlers = NULL;
- }
-}
-
-static void __gl_timeline_transit_del_cb(void *data, Elm_Transit *transit)
-{
- gl_dbg("");
- GL_CHECK(data);
- gl_tile_s *tile = (gl_tile_s *)data;
- if (tile->count == tile->total) {
- gl_dbgW("evas_object_freeze_events_set EINA_FALSE");
- evas_object_freeze_events_set(tile->timeline_d->view, EINA_FALSE);
- GL_IF_FREE_ELIST(tile->timeline_d->tiles);
- }
- /* Free data */
- GL_FREEIF(data);
-}
-
-static int __gl_timeline_tile_transit(gl_tile_s *tile)
-{
-#define GL_TL_TRANS_TIME 0.7
- gl_dbg("");
- GL_CHECK_VAL(tile, -1);
-
- tile->trans = elm_transit_add();
- elm_transit_object_add(tile->trans, tile->bg);
-
- elm_transit_tween_mode_set(tile->trans,
- ELM_TRANSIT_TWEEN_MODE_DECELERATE);
-
- elm_transit_effect_color_add(tile->trans, 0, 0, 0, 0, 255, 255, 255,
- 255);
- elm_transit_effect_zoom_add(tile->trans, 0.4, 1.0);
- elm_transit_effect_add(tile->trans, __gl_timeline_transit_op,
- (Elm_Transit_Effect *)tile,
- __gl_timeline_transit_done);
- elm_transit_del_cb_set(tile->trans, __gl_timeline_transit_del_cb, tile);
-
- elm_transit_duration_set(tile->trans, GL_TL_TRANS_TIME);
- elm_transit_objects_final_state_keep_set(tile->trans, EINA_FALSE);
- elm_transit_go(tile->trans);
- return 0;
-}
-
-static int __gl_timeline_transit_tiles(gl_timeline_s *timeline_d)
-{
- gl_dbgW("start!");
- GL_CHECK_VAL(timeline_d, -1);
- GL_CHECK_VAL(timeline_d->tiles, -1);
- gl_tile_s *tile = NULL;
- Eina_List *l = NULL;
-
- gl_dbgW("evas_object_freeze_events_set EINA_TRUE");
- evas_object_freeze_events_set(timeline_d->view, EINA_TRUE);
-
- /* Remove previous transits first */
- EINA_LIST_FOREACH(timeline_d->tiles, l, tile) {
- if (tile) {
- GL_IF_DEL_TRANSIT(tile->trans);
- tile = NULL;
- }
- }
- /* Transit each tile */
- EINA_LIST_FOREACH(timeline_d->tiles, l, tile) {
- __gl_timeline_tile_transit(tile);
- tile = NULL;
- }
- gl_dbgW("done!");
- return 0;
-}
-
-static int __gl_timeline_add_tile(gl_tlp_s *it_d, Evas_Object *parent,
- Evas_Object *bg, int count, int total)
-{
- GL_CHECK_VAL(it_d, -1);
-
- gl_tile_s *tile = (gl_tile_s *)calloc(1, sizeof(gl_tile_s));
- GL_CHECK_VAL(tile, -1);
- tile->bg = bg;
- tile->parent = parent;
- tile->it_d = it_d;
- tile->count = count;
- tile->total = total;
- tile->timeline_d = it_d->timeline_d;
- it_d->timeline_d->tiles = eina_list_append(it_d->timeline_d->tiles,
- tile);
- return 0;
-}
-
-static Evas_Object *__gl_timeline_get_page_tiles(gl_tlp_s *it_d)
-{
- GL_CHECK_NULL(it_d);
- GL_CHECK_NULL(it_d->timeline_d);
- gl_dbg("index-%d, count-%d", it_d->index, it_d->count);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
- int i = 0;
- int count = it_d->count;
- char *part = NULL;
- Evas_Object *bg = NULL;
-
- for (i = 0; i < count; i++) {
- /* Add images */
- part = g_strdup_printf(GL_TL_CONTENTS_FORMAT, it_d->count,
- i + 1);
-
- bg = elm_object_part_content_get(it_d->layout, part);
- __gl_timeline_add_tile(it_d, NULL, bg, i + 1, count);
-
- part = NULL;
- }
- return 0;
-}
-
-/* Transit tiles without updating images or layout */
-static int __gl_timeline_show_tiles_trans(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- /* Get first image of current page */
- void *sitem = _gl_slider_get_sitem(timeline_d->view);
- GL_CHECK_VAL(sitem, -1);
- gl_tlp_s *it_d = (gl_tlp_s *)_gl_slider_get_sitem_data(sitem);
- GL_CHECK_VAL(it_d, -1);
- /* Show transition */
- if (it_d->timeline_d->tran_op == GL_TRANS_OP_PREPARE) {
- __gl_timeline_get_page_tiles(it_d);
- it_d->timeline_d->tran_op = GL_TRANS_OP_SHOW;
- __gl_timeline_transit_tiles(it_d->timeline_d);
- }
- return 0;
-}
-
-/* Only for local medias */
-static void __gl_timeline_create_thumb_cb(media_content_error_e error,
- const char *path, void *user_data)
-{
- GL_CHECK(user_data);
- Evas_Object *bg = (Evas_Object *)user_data;
-
- if (error == MEDIA_CONTENT_ERROR_NONE && GL_FILE_EXISTS(path) &&
- g_strcmp0(path, GL_ICON_DB_DEFAULT_THUMB)) {
- gl_sdbgW("path[%s]!", path);
- _gl_rotate_bg_set_file(bg, path, GL_TIMELINE_PAGE_SIZE,
- GL_TIMELINE_PAGE_SIZE);
- _gl_rotate_bg_rotate_image(bg, GL_ORIENTATION_ROT_0);
- } else {
- gl_sdbgE("[%d]Invalid path[%s]!", error, path);
- }
-
- __gl_timeline_clear_bg_data(bg);
-}
-
-/* Add thumbs creation */
-static int __gl_timeline_create_thumbs(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- Eina_List *l = NULL;
- Evas_Object *bg = NULL;
- gl_media_s *item = NULL;
- int ret = -1;
-
- EINA_LIST_FOREACH(timeline_d->thumbs, l, bg) {
- if (bg == NULL) {
- continue;
- }
- item = (gl_media_s *)evas_object_data_get(bg,
- GL_TL_TILE_DATA_KEY);
- if (item && !GL_FILE_EXISTS(item->thumb_url) &&
- GL_FILE_EXISTS(item->file_url)) {
- gl_dbgW("Add thumb creation!");
- ret = _gl_data_create_thumb(item,
- __gl_timeline_create_thumb_cb,
- bg);
- if (ret == 0) {
- continue;
- } else {
- goto GL_TL_FAILED;
- }
- } else {
-GL_TL_FAILED:
-
- evas_object_data_del(bg, GL_TL_TILE_DATA_KEY);
- timeline_d->thumbs = eina_list_remove(timeline_d->thumbs,
- bg);
- if (item) {
- _gl_data_type_free_glitem((void **)(&item));
- }
- }
- }
- return 0;
-}
-#endif
-
-/* Cancel thumb creation*/
-static int __gl_timeline_cancel_thumbs(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- Eina_List *l = NULL;
- Evas_Object *bg = NULL;
- gl_media_s *item = NULL;
-
- EINA_LIST_FOREACH(timeline_d->thumbs, l, bg) {
- if (bg == NULL) {
- continue;
- }
- item = (gl_media_s *)evas_object_data_get(bg,
- GL_TL_TILE_DATA_KEY);
- if (item && item->b_create_thumb) {
- gl_dbgW("Cancel thumb creation!");
- _gl_data_cancel_thumb(item);
- }
- }
- return 0;
-}
-
-#if 0
-static int __gl_timeline_check_thumb(gl_media_s *item, Evas_Object *bg)
-{
- GL_CHECK_VAL(bg, -1);
- GL_CHECK_VAL(item, -1);
-
- if (item->storage_type != GL_STORE_T_PHONE &&
- item->storage_type != GL_STORE_T_MMC) {
- return -1;
- }
-
- if (GL_FILE_EXISTS(item->file_url)) {
- int ret = -1;
- ret = _gl_data_create_thumb(item, __gl_timeline_create_thumb_cb,
- (void *)bg);
- return ret;
- }
- return -1;
-}
-
-static int __gl_timeline_check_glitem(gl_timeline_s *timeline_d,
- gl_media_s *item, Evas_Object *bg,
- bool b_check_thumb)
-{
- /* Check thumb */
- if (b_check_thumb) {
- gl_dbg("Check thumb");
- if (__gl_timeline_check_thumb(item, bg) == 0) {
- evas_object_data_set(bg, GL_TL_TILE_DATA_KEY,
- (void *)item);
- evas_object_data_set(bg, GL_TL_DATA_KEY,
- (void *)timeline_d);
- timeline_d->thumbs = eina_list_append(timeline_d->thumbs,
- (void *)bg);
- } else {
- _gl_data_type_free_glitem((void **)(&item));
- }
- } else {
- _gl_data_type_free_glitem((void **)(&item));
- }
- return 0;
-}
-
-static Evas_Object *__gl_timeline_add_page(Evas_Object *parent, gl_tlp_s *it_d)
-{
- GL_CHECK_NULL(it_d);
- GL_CHECK_NULL(it_d->timeline_d);
- GL_CHECK_NULL(parent);
- gl_dbg("index-%d, count-%d", it_d->index, it_d->count);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
- Eina_List *list = NULL;
- _gl_data_get_items(it_d->start_pos, it_d->end_pos, &list);
- if (list == NULL) {
- gl_dbgW("Empty list!");
- return NULL;
- }
- int count = eina_list_count(list);
-
- it_d->w = it_d->timeline_d->w;
- it_d->h = it_d->timeline_d->h;
- bool b_landscape = (it_d->h > it_d->w) ? false : true;
- Evas_Object *layout = NULL;
- layout = __gl_timeline_add_page_ly(parent, it_d);
- GL_CHECK_NULL(layout);
-
- if (!it_d->b_created) {
- it_d->b_created = true;
- /* Add idler for showing original files for big tile */
- if (count <= 5) {
- __gl_timeline_check_page_idler(it_d);
- } else {
- gl_dbg("count>5, no idler for showing original file");
- }
- }
- it_d->layout = layout;
- __gl_timeline_add_page_cbs(it_d, layout);
-
- Evas_Object *bg = NULL;
- Evas_Object *ck = NULL;
- gl_media_s *item = NULL;
- int i = 0;
- char *part = NULL;
- char *path = NULL;
- unsigned int orient = 0;
- int w = GL_TIMELINE_PAGE_SIZE;
- int h = GL_TIMELINE_PAGE_SIZE;
- bool b_check_thumb = false;
-
- for (i = 0; i < count; i++) {
- item = eina_list_nth(list, i);
- if (item == NULL) {
- gl_dbgE("Invalid item!");
- continue;
- }
- /* Checkme: Scrolling doesn't work smoothly if original file was used */
- /* Get orientation for original file */
- if (((i == 0 && count <= 5) ||
- (i == 1 && count <= 3 && !b_landscape) ||
- (i == 2 && count == 4 && !b_landscape) ||
- (i == 1 && (count == 2 || count == 4) && b_landscape)) &&
- item->type == MEDIA_CONTENT_TYPE_IMAGE &&
- (it_d->timeline_d->tran_op == GL_TRANS_OP_DONE ||
- !it_d->b_created) && GL_FILE_EXISTS(item->file_url)) {
- path = item->file_url;
-#ifdef _USE_ROTATE_BG
- if (_gl_exif_get_orientation(path, &orient) < 0) {
- path = item->thumb_url;
- orient = GL_ORIENTATION_ROT_0;
- if (!GL_FILE_EXISTS(path)) {
- path = GL_ICON_NO_THUMBNAIL;
- b_check_thumb = true;
- }
- }
-#endif
- __gl_timeline_get_tile_size(count, i, b_landscape, &w,
- &h);
- } else {
- path = item->thumb_url;
-#ifdef _USE_ROTATE_BG
- orient = GL_ORIENTATION_ROT_0;
-#endif
- if (!GL_FILE_EXISTS(path)) {
- path = GL_ICON_NO_THUMBNAIL;
- b_check_thumb = true;
- }
- }
-
- /* Add images */
- part = g_strdup_printf(GL_TL_CONTENTS_FORMAT, it_d->count,
- i + 1);
- bg = __gl_timeline_add_page_bg(layout, part, orient, path, w,
- h);
- evas_object_event_callback_add(bg, EVAS_CALLBACK_DEL,
- __gl_timeline_del_bg_cb, NULL);
-#ifdef _USE_ROTATE_BG
- _gl_rotate_bg_set_data(bg, (void *)i);
-#endif
- GL_GFREEIF(part);
- /* Add mouse event for launching Imageviewer */
- evas_object_event_callback_add(bg, EVAS_CALLBACK_MOUSE_DOWN,
- __gl_timeline_mouse_down, it_d);
- evas_object_event_callback_add(bg, EVAS_CALLBACK_MOUSE_UP,
- __gl_timeline_mouse_up, it_d);
- /* Add checkbox */
- if (it_d->timeline_d->view_m != GL_TL_VIEW_NORMAL) {
- part = g_strdup_printf(GL_TL_CHECKBOX_FORMAT,
- it_d->count, i + 1);
- ck = __gl_timeline_add_ck(layout, part,
- __gl_timeline_is_checked(it_d->timeline_d, item->uuid),
- it_d);
- evas_object_data_set(ck, "gl_tl_idx_key", (void *)i);
- GL_GFREEIF(part);
- }
- /* Check data */
- __gl_timeline_check_glitem(it_d->timeline_d, item, bg ,
- b_check_thumb);
- b_check_thumb = false;
-
- if (it_d->timeline_d->tran_op == GL_TRANS_OP_PREPARE) {
- __gl_timeline_add_tile(it_d, parent, bg, i + 1, count);
- }
-
- item = NULL;
- }
- GL_IF_FREE_ELIST(list);
-
- if (it_d->timeline_d->tran_op == GL_TRANS_OP_PREPARE) {
- /* Only transit tiles once */
- it_d->timeline_d->tran_op = GL_TRANS_OP_START;
- __gl_timeline_transit_tiles(it_d->timeline_d);
- }
- return layout;
-}
-
-static Evas_Object *__gl_timeline_reset_cks(Evas_Object *parent, gl_tlp_s *it_d)
-{
- GL_CHECK_NULL(it_d);
- GL_CHECK_NULL(it_d->timeline_d);
- GL_CHECK_NULL(parent);
- gl_dbg("index-%d, count-%d", it_d->index, it_d->count);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
-
- Eina_List *list = NULL;
- _gl_data_get_items(it_d->start_pos, it_d->end_pos, &list);
- if (list == NULL) {
- gl_dbgW("Empty list!");
- return NULL;
- }
- int count = eina_list_count(list);
-
- bool b_landscape = (it_d->h > it_d->w) ? false : true;
- Evas_Object *layout = NULL;
- layout = __gl_timeline_add_page_ly(parent, it_d);
- GL_CHECK_NULL(layout);
-
- it_d->b_created = true;
- it_d->layout = layout;
- __gl_timeline_add_page_cbs(it_d, layout);
-
- Evas_Object *bg = NULL;
- Evas_Object *ck = NULL;
- gl_media_s *item = NULL;
- int i = 0;
- char *part = NULL;
- char *path = NULL;
- unsigned int orient = 0;
- int w = GL_TIMELINE_PAGE_SIZE;
- int h = GL_TIMELINE_PAGE_SIZE;
- bool b_check_thumb = false;
-
- for (i = 0; i < count; i++) {
- item = eina_list_nth(list, i);
- if (item == NULL) {
- gl_dbgE("Invalid item!");
- continue;
- }
- /* Checkme: Scrolling doesn't work smoothly if original file was used */
- /* Get orientation for original file */
- if (((i == 0 && count <= 5) ||
- (i == 1 && count <= 3 && !b_landscape) ||
- (i == 2 && count == 4 && !b_landscape) ||
- (i == 1 && (count == 2 || count == 4) && b_landscape)) &&
- item->type == MEDIA_CONTENT_TYPE_IMAGE &&
- GL_FILE_EXISTS(item->file_url)) {
- path = item->file_url;
-#ifdef _USE_ROTATE_BG
- if (_gl_exif_get_orientation(path, &orient) < 0) {
- path = item->thumb_url;
- orient = GL_ORIENTATION_ROT_0;
- if (!GL_FILE_EXISTS(path)) {
- path = GL_ICON_NO_THUMBNAIL;
- b_check_thumb = true;
- }
- }
-#endif
- __gl_timeline_get_tile_size(count, i, b_landscape, &w,
- &h);
- } else {
- path = item->thumb_url;
-#ifdef _USE_ROTATE_BG
- orient = GL_ORIENTATION_ROT_0;
-#endif
- if (!GL_FILE_EXISTS(path)) {
- path = GL_ICON_NO_THUMBNAIL;
- b_check_thumb = true;
- }
- }
-
- /* Add images */
- part = g_strdup_printf(GL_TL_CONTENTS_FORMAT, it_d->count,
- i + 1);
- bg = __gl_timeline_add_page_bg(layout, part, orient, path, w,
- h);
- evas_object_event_callback_add(bg, EVAS_CALLBACK_DEL,
- __gl_timeline_del_bg_cb, NULL);
-#ifdef _USE_ROTATE_BG
- _gl_rotate_bg_set_data(bg, (void *)i);
-#endif
- GL_GFREEIF(part);
- /* Add mouse event for launching Imageviewer */
- evas_object_event_callback_add(bg, EVAS_CALLBACK_MOUSE_DOWN,
- __gl_timeline_mouse_down, it_d);
- evas_object_event_callback_add(bg, EVAS_CALLBACK_MOUSE_UP,
- __gl_timeline_mouse_up, it_d);
- /* Add checkbox */
- if (it_d->timeline_d->view_m != GL_TL_VIEW_NORMAL) {
- part = g_strdup_printf(GL_TL_CHECKBOX_FORMAT,
- it_d->count, i + 1);
- ck = __gl_timeline_add_ck(layout, part,
- __gl_timeline_is_checked(it_d->timeline_d, item->uuid),
- it_d);
- evas_object_data_set(ck, "gl_tl_idx_key", (void *)i);
- GL_GFREEIF(part);
- }
- /* Check data */
- __gl_timeline_check_glitem(it_d->timeline_d, item, bg ,
- b_check_thumb);
- b_check_thumb = false;
-
- item = NULL;
- }
- GL_IF_FREE_ELIST(list);
- return layout;
-}
-
-static bool __gl_timeline_set_cks_state(gl_tlp_s *it_d, bool b_checked)
-{
- GL_CHECK_FALSE(it_d);
- GL_CHECK_FALSE(it_d->timeline_d);
- gl_dbg("index-%d, count-%d", it_d->index, it_d->count);
- gl_dbg("start_pos-%d, end_pos-%d", it_d->start_pos, it_d->end_pos);
- gl_dbg("checkbox: %d", b_checked);
-
- Evas_Object *ck = NULL;
- int i = 0;
- char *part = NULL;
- Eina_Bool checked = EINA_FALSE;
-
- for (i = 0; i < it_d->count; i++) {
- part = g_strdup_printf(GL_TL_CHECKBOX_FORMAT, it_d->count,
- i + 1);
- ck = elm_object_part_content_get(it_d->layout, part);
- if (ck) {
- checked = elm_check_state_get(ck);
- if (checked != b_checked) {
- elm_check_state_set(ck, b_checked);
- }
- } else {
- gl_dbgW("Invalid checkbox!");
- }
- GL_GFREEIF(part);
- }
- return true;
-}
-
-static int __gl_timeline_free_pages(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- if (timeline_d->list) {
- gl_dbgW("############## Free pages ###############");
- void *tl_d = NULL;
- EINA_LIST_FREE(timeline_d->list, tl_d) {
- GL_FREEIF(tl_d);
- }
- timeline_d->list = NULL;
- } else {
- gl_dbgW("None pages!");
- }
- return 0;
-}
-
-static int __gl_timeline_update_tiles_cnt(int zlevel, int default_cnt)
-{
- int tiles_cnt = 0;
-
- if (zlevel == GL_TM_ZOOM_OUT_TWO) {
- tiles_cnt = GL_TL_PINCH_OUT_2_CNT;
- } else if (zlevel == GL_TM_ZOOM_OUT_ONE) {
- if (default_cnt <= 2) {
- tiles_cnt = default_cnt * GL_TL_PINCH_OUT_CNT_STEP;
- } else {
- tiles_cnt = GL_TL_PINCH_OUT_1_CNT;
- }
- } else {
- tiles_cnt = default_cnt;
- }
- return tiles_cnt;
-}
-
-static int __gl_timeline_update_zoom_flags(gl_timeline_s *timeline_d,
- bool b_pout)
-{
- GL_CHECK_VAL(timeline_d, -1);
-
- /* To trigger different transition */
- if (!b_pout) {
- timeline_d->zoom_level++;
- _gl_slider_set_zop(timeline_d->view, GL_SLIDE_ZOP_IN);
- } else {
- timeline_d->zoom_level--;
- _gl_slider_set_zop(timeline_d->view, GL_SLIDE_ZOP_OUT);
- }
- /* Reset zoom level for overscrolling showing in slider */
- if (timeline_d->zoom_level == GL_TM_ZOOM_DEFAULT) {
- _gl_slider_set_zlevel(timeline_d->view, GL_SLIDE_ZLEVEL_MAX);
- } else if (timeline_d->zoom_level == GL_TM_ZOOM_OUT_TWO) {
- _gl_slider_set_zlevel(timeline_d->view, GL_SLIDE_ZLEVEL_MIN);
- } else {
- _gl_slider_set_zlevel(timeline_d->view, GL_SLIDE_ZLEVEL_MID);
- }
- return 0;
-}
-
-static int __gl_timeline_update_zoom_pages(gl_timeline_s *timeline_d,
- bool b_pout)
-{
- GL_CHECK_VAL(timeline_d, -1);
- int i = 0;
- gl_tlp_s *it_d = NULL;
- int index = 0;
- /* Get first image of current page */
- void *sitem = _gl_slider_get_sitem(timeline_d->view);
- GL_CHECK_VAL(sitem, -1);
- it_d = (gl_tlp_s *)_gl_slider_get_sitem_data(sitem);
- GL_CHECK_VAL(it_d, -1);
- int page_first_img_idx = it_d->start_pos;
- int new_cur_page_idx = 0;
- int list_cnt = eina_list_count(timeline_d->count_list);
- gl_dbg("level: %d, count: %d, count_list: %d", timeline_d->zoom_level,
- timeline_d->count, list_cnt);
- int cnt = 0;
-
- /* Update flags */
- __gl_timeline_update_zoom_flags(timeline_d, b_pout);
- evas_object_freeze_events_set(timeline_d->view, EINA_TRUE);
- GL_TL_CLEAR_PAGES(timeline_d, false);
- gl_dbgW("evas_object_freeze_events_set EINA_TRUE");
-
- for (i = 0; i < timeline_d->count;) {
- /* item date is freed in del_cb */
- it_d = (gl_tlp_s *)calloc(1, sizeof(gl_tlp_s));
- /* Create UX item */
- timeline_d->list = eina_list_append(timeline_d->list, it_d);
- it_d->timeline_d = timeline_d;
- if (list_cnt > index) {
- /* Reuse count of page */
- cnt = (int)eina_list_nth(timeline_d->count_list,
- index);
- gl_dbg("%d", cnt);
- } else {
- /* Add new random count */
- cnt = 1 + rand() % 5;
- timeline_d->count_list = eina_list_append(timeline_d->count_list,
- (void *)cnt);
- }
-
- it_d->count = __gl_timeline_update_tiles_cnt(timeline_d->zoom_level,
- cnt);
- it_d->index = index++;
- it_d->start_pos = i;
- /* Refer to first item of next loop */
- i += it_d->count;
- it_d->end_pos = i - 1;
- /* Get new index of page */
- if (new_cur_page_idx == 0 &&
- page_first_img_idx >= it_d->start_pos &&
- page_first_img_idx <= it_d->end_pos) {
- gl_dbgW("New page index got!");
- new_cur_page_idx = it_d->index;
- }
- /* Reset count and end_pos of last page */
- if (timeline_d->zoom_level != GL_TM_ZOOM_OUT_TWO &&
- i >= timeline_d->count) {
- it_d->end_pos = timeline_d->count - 1;
- it_d->count = it_d->end_pos - it_d->start_pos + 1;
- break;
- }
- it_d = NULL;
- }
- gl_dbg("length: %d", eina_list_count(timeline_d->list));
-
- _gl_slider_set_list(timeline_d->view, timeline_d->list,
- new_cur_page_idx);
- _gl_slider_load_first_item(timeline_d->view);
- return 0;
-}
-
-static Eina_Bool __gl_timeline_zoom_in(gl_timeline_s *timeline_d)
-{
- GL_CHECK_FALSE(timeline_d);
- gl_dbg("");
-
- if (gl_get_view_mode(timeline_d->ad) != GL_VIEW_TIMELINE) {
- return false;
- }
-
- gl_dbg("level: %d", timeline_d->zoom_level);
- if (timeline_d->zoom_level >= GL_TM_ZOOM_DEFAULT) {
- return false;
- }
-
- /* Update view */
- __gl_timeline_update_zoom_pages(timeline_d, false);
- return true;
-}
-
-static Eina_Bool __gl_timeline_zoom_out(gl_timeline_s *timeline_d)
-{
- GL_CHECK_FALSE(timeline_d);
- gl_dbg("");
-
- if (gl_get_view_mode(timeline_d->ad) != GL_VIEW_TIMELINE) {
- return false;
- }
-
- gl_dbg("level: %d", timeline_d->zoom_level);
- if (timeline_d->zoom_level <= GL_TM_ZOOM_OUT_TWO) {
- return false;
- }
-
- /* Update view */
- __gl_timeline_update_zoom_pages(timeline_d, true);
- return true;
-}
-
-static void __gl_timeline_slider_clicked_cb(void *data, Evas_Object *obj, void *ei)
-{
- gl_dbg("");
-}
-
-static void __gl_timeline_slider_long_press_start_cb(void *data,
- Evas_Object *obj, void *ei)
-{
- gl_dbg("");
+ edje_object_signal_callback_del(_EDJ(timeline_d->layout),
+ GL_TL_TITLE2_SHOW_FINISHED, "",
+ __gl_timeline_on_title2_show_finished);
+ edje_object_signal_callback_del(_EDJ(timeline_d->layout),
+ GL_TL_TITLE_HIDE_FINISHED, "",
+ __gl_timeline_on_title_hide_finished);
+ }
+ return 0;
}
-static void __gl_timeline_slider_long_press_end_cb(void *data, Evas_Object *obj,
- void *ei)
+/* Free data after page deleted */
+static void __gl_timeline_del_page_cb(void *data, Evas *e, Evas_Object *obj,
+ void *ei)
{
- gl_dbg("");
+ gl_dbgW("Delete page ---");
+ GL_CHECK(data);
+ evas_object_smart_callback_del(obj, "layout,page,deleted",
+ __gl_timeline_page_deleted_cb);
+ gl_tlp_s *it_d = (gl_tlp_s *)data;
+ GL_IF_DEL_IDLER(it_d->update_idler);
+ it_d->b_created = false;
+ gl_dbgW("Delete page +++");
}
-static void __gl_timeline_slider_item_changed_cb(void *data, Evas_Object *obj,
+static void __gl_timeline_page_deleted_cb(void *data, Evas_Object *obj,
void *ei)
{
- GL_CHECK(ei);
+ gl_dbgW("Deleted page ------");
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
+ __gl_timeline_del_page_cb);
GL_CHECK(data);
- gl_dbg("");
-
- __gl_timeline_update_title((gl_timeline_s *)data,
- (gl_tlp_s *)_gl_slider_get_sitem_data(ei),
- false);
+ gl_tlp_s *it_d = (gl_tlp_s *)data;
+ GL_IF_DEL_IDLER(it_d->update_idler);
+ it_d->b_created = false;
+ gl_dbgW("Deleted page ++++++");
}
-static void __gl_timeline_slider_item_state_changed_cb(void *data,
- Evas_Object *obj,
- void *ei)
+/* Cancel thumb creation*/
+static int __gl_timeline_cancel_thumbs(gl_timeline_s *timeline_d)
{
- gl_dbg("");
-}
+ GL_CHECK_VAL(timeline_d, -1);
+ Eina_List *l = NULL;
+ Evas_Object *bg = NULL;
+ gl_media_s *item = NULL;
-static void __gl_timeline_slider_items_resized_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("start");
- GL_CHECK(data);
- gl_timeline_s *timeline_d = (gl_timeline_s *)data;
- GL_CHECK(timeline_d->ad);
- _gl_main_add_reg_idler(timeline_d->ad);
- if (!timeline_d->b_created) {
- timeline_d->b_created = true;
- _gl_slider_load_first_item(timeline_d->view);
- } else {
- if (timeline_d->tran_op == GL_TRANS_OP_SHOW) {
- gl_dbgW("Change transit operation mode!");
- timeline_d->tran_op = GL_TRANS_OP_START;
+ EINA_LIST_FOREACH(timeline_d->thumbs, l, bg) {
+ if (bg == NULL) {
+ continue;
+ }
+ item = (gl_media_s *)evas_object_data_get(bg,
+ GL_TL_TILE_DATA_KEY);
+ if (item && item->b_create_thumb) {
+ gl_dbgW("Cancel thumb creation!");
+ _gl_data_cancel_thumb(item);
}
}
- gl_dbgW("done");
-}
-
-static void __gl_timeline_slider_items_zoom_out_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("start");
- GL_CHECK(data);
- gl_timeline_s *timeline_d = (gl_timeline_s *)data;
- GL_CHECK(timeline_d->ad);
- __gl_timeline_zoom_out(timeline_d);
- gl_dbgW("done");
-}
-
-static void __gl_timeline_slider_items_zoom_in_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- gl_dbgW("start");
- GL_CHECK(data);
- gl_timeline_s *timeline_d = (gl_timeline_s *)data;
- GL_CHECK(timeline_d->ad);
- __gl_timeline_zoom_in(timeline_d);
- gl_dbgW("done");
+ return 0;
}
-#endif
static void __gl_timeline_resize_layout_cb(void *data, Evas *e,
Evas_Object *obj, void *ei)
timeline_d->h = h;
}
-/* register mouse callback */
-#if 0
-static int __gl_timeline_add_slider_cbs(Evas_Object *slider, void *cb_data)
-{
- GL_CHECK_VAL(cb_data, -1);
- GL_CHECK_VAL(slider, -1);
-
- evas_object_smart_callback_add(slider, "slider,clicked",
- __gl_timeline_slider_clicked_cb,
- cb_data);
- evas_object_smart_callback_add(slider, "slider,longpress,start",
- __gl_timeline_slider_long_press_start_cb,
- cb_data);
- evas_object_smart_callback_add(slider, "slider,longpress,end",
- __gl_timeline_slider_long_press_end_cb,
- cb_data);
-
- evas_object_smart_callback_add(slider, "slider,item,changed",
- __gl_timeline_slider_item_changed_cb,
- cb_data);
- evas_object_smart_callback_add(slider, "slider,item,state,changed",
- __gl_timeline_slider_item_state_changed_cb,
- cb_data);
- evas_object_smart_callback_add(slider, "slider,items,resized",
- __gl_timeline_slider_items_resized_cb,
- cb_data);
- evas_object_smart_callback_add(slider, "slider,items,zoomout",
- __gl_timeline_slider_items_zoom_out_cb,
- cb_data);
- evas_object_smart_callback_add(slider, "slider,items,zoomin",
- __gl_timeline_slider_items_zoom_in_cb,
- cb_data);
- return 0;
-}
-
-static Evas_Object *__gl_timeline_create_slider(gl_timeline_s *timeline_d)
-{
- GL_CHECK_NULL(timeline_d);
- Evas_Object *slider = NULL;
-
- slider = _gl_slider_add(timeline_d->layout);
- GL_CHECK_NULL(slider);
-
- evas_object_data_set(slider, "create_func",
- (void *)__gl_timeline_add_page);
- evas_object_data_set(slider, "reset_cks_func",
- (void *)__gl_timeline_reset_cks);
- evas_object_data_set(slider, "set_cks_state_func",
- (void *)__gl_timeline_set_cks_state);
- __gl_timeline_add_slider_cbs(slider, (void *)timeline_d);
- int bx = 0;
- int by = 0;
- int bw = 0;
- int bh = 0;
- evas_object_geometry_get(slider, &bx, &by, &bw, &bh);
- gl_dbg("slider. (%d,%d,%d,%d)", bx, by, bw, bh);
-
- return slider;
-}
-#endif
-
static int __gl_timelne_show_nocontents(gl_timeline_s *timeline_d)
{
GL_CHECK_VAL(timeline_d, -1);
return genlist;
}
-#if 0
-static int __gl_timeline_page_rand(gl_timeline_s *timeline_d)
-{
- GL_CHECK_VAL(timeline_d, -1);
- int item_cnt = timeline_d->count;
- int i = 0;
- gl_tlp_s *it_d = NULL;
- int index = 0;
-
- GL_TL_CLEAR_PAGES(timeline_d, true);
-
- srand(time(NULL));
- int cnt = 0;
- bool b_new_count = false;
- int list_cnt = eina_list_count(timeline_d->count_list);
- gl_dbg("list_cnt: %d", list_cnt);
-
- for (i = 0; i < item_cnt;) {
- it_d = (gl_tlp_s *)calloc(1, sizeof(gl_tlp_s));
- timeline_d->list = eina_list_append(timeline_d->list, it_d);
- it_d->timeline_d = timeline_d;
- if (list_cnt > index) {
- /* Reuse count of page */
- cnt = (int)eina_list_nth(timeline_d->count_list,
- index);
- } else {
- /* Add new random count */
- cnt = 1 + rand() % 5;
- b_new_count = true;
- }
-
- it_d->count = __gl_timeline_update_tiles_cnt(timeline_d->zoom_level,
- cnt);
- it_d->index = index++;
- it_d->start_pos = i;
- /* Refer to first item of next loop */
- i += it_d->count;
- it_d->end_pos = i - 1;
- /* Reset count and end_pos of last page */
- if (timeline_d->zoom_level != GL_TM_ZOOM_OUT_TWO &&
- i >= item_cnt) {
- it_d->end_pos = item_cnt - 1;
- it_d->count = it_d->end_pos - it_d->start_pos + 1;
- if (b_new_count)
- timeline_d->count_list = eina_list_append(timeline_d->count_list,
- (void *)it_d->count);
- break;
- }
- if (b_new_count)
- timeline_d->count_list = eina_list_append(timeline_d->count_list,
- (void *)it_d->count);
- it_d = NULL;
- }
- return 0;
-}
-
-static int __gl_timeline_update_view(gl_timeline_s *timeline_d, bool b_first)
-{
- GL_CHECK_VAL(timeline_d, -1);
- int item_cnt = 0;
- time_t last_mtime = 0;
- int ret = -1;
-
- /* Check media-content to show */
- ret = _gl_data_get_item_cnt(GL_ALBUM_ALL_ID, GL_STORE_T_ALL, &item_cnt);
- if (ret != 0 || item_cnt == 0) {
- gl_dbgE("Empty!");
- }
-
- Eina_List *list = NULL;
- _gl_data_get_items(0, 0, &list);
- if (list == NULL) {
- GL_TL_CLEAR_PAGES(timeline_d, true);
- __gl_timelne_show_nocontents(timeline_d);
- elm_naviframe_item_title_enabled_set(timeline_d->nf_it, EINA_FALSE, EINA_FALSE);
- return -1;
- } else {
- __gl_timelne_del_nocontents(timeline_d);
- elm_naviframe_item_title_enabled_set(timeline_d->nf_it, EINA_TRUE, EINA_TRUE);
- }
-
- gl_media_s *item = eina_list_nth(list, 0);
- if (item) {
- last_mtime = item->mtime;
- }
-
- item = NULL;
- EINA_LIST_FREE(list, item) {
- _gl_data_type_free_glitem((void **)(&item));
- item = NULL;
- }
-
- if (!b_first) {
- if (last_mtime == timeline_d->last_mtime &&
- item_cnt == timeline_d->count) {
- gl_dbgW("Nothing changed!");
- evas_object_show(timeline_d->view); /* To show slide items */
- __gl_timeline_show_tiles_trans(timeline_d);
- return -1;
- }
- }
-
- timeline_d->count = item_cnt;
- timeline_d->last_mtime = last_mtime;
- /* Set rand image count for each page */
- __gl_timeline_page_rand(timeline_d);
- /* Reset zoom level for overscrolling showing in slider */
- if (timeline_d->zoom_level == GL_TM_ZOOM_DEFAULT) {
- _gl_slider_set_zlevel(timeline_d->view, GL_SLIDE_ZLEVEL_MAX);
- } else if (timeline_d->zoom_level == GL_TM_ZOOM_DEFAULT) {
- _gl_slider_set_zlevel(timeline_d->view, GL_SLIDE_ZLEVEL_MIN);
- } else {
- _gl_slider_set_zlevel(timeline_d->view, GL_SLIDE_ZLEVEL_MID);
- }
-
- _gl_slider_set_list(timeline_d->view, timeline_d->list, 0);
- evas_object_show(timeline_d->view); /* To show slide items */
- if (timeline_d->b_created) {
- _gl_slider_start(timeline_d->view);
- }
- return 0;
-}
-#endif
-
/* Free data after layout deleted */
static void __gl_timeline_del_layout_cb(void *data, Evas *e, Evas_Object *obj,
void *ei)
return 0;
}
-#ifdef SUPPORT_SLIDESHOW
-static int __gl_timeline_start_slideshow(void *data)
-{
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- ad->gridinfo.grid_type = GL_GRID_T_ALLALBUMS;
-
- Eina_List *list = NULL;
- gl_item *gitem = NULL;
- gl_media_s *item = NULL;
- _gl_data_get_items(GL_FIRST_VIEW_START_POS,
- GL_FIRST_VIEW_START_POS, &list);
- if (list != NULL) {
- item = (gl_media_s *)eina_list_nth(list, 0);
- GL_IF_FREE_ELIST(list);
- gitem = _gl_data_new_item_mitem(item);
- GL_CHECK_VAL(gitem, -1);
- gl_ext_load_iv_ug(data, gitem, GL_UG_IV_SLIDESHOW_ALL);
- _gl_data_util_free_gitem(gitem);
- }
- return 0;
-}
-
-static int __gl_timeline_slideshow(void *data, const char *label)
-{
- GL_CHECK_VAL(label, -1);
- GL_CHECK_VAL(data, -1);
- gl_dbg("label : %s ", label);
- gl_appdata *ad = (gl_appdata *)data;
-
- if (!g_strcmp0(label, _gl_str(GL_STR_ID_ALL_ITEMS))) {
- __gl_timeline_start_slideshow(data);
- } else if (!g_strcmp0(label, _gl_str(GL_STR_ID_SETTINGS))) {
- evas_object_data_set(ad->maininfo.naviframe,
- GL_NAVIFRAME_SLIDESHOW_DATA_KEY,
- __gl_timeline_start_slideshow);
- gl_ext_load_ug(data, GL_UG_GALLERY_SETTING_SLIDESHOW);
- } else if (!g_strcmp0(label, _gl_str(GL_STR_ID_SELECT_ITEMS))) {
-#ifdef _USE_APP_SLIDESHOW
- __gl_timeline_edit(data);
- evas_object_data_set(ad->maininfo.naviframe,
- GL_NAVIFRAME_SELECTED_SLIDESHOW_KEY,
- gl_pop_to_ctrlbar_ly);
-#else
- _gl_ext_launch_gallery_ug(data);
-#endif
- } else {
- gl_dbgE("Invalid lable!");
- return -1;
- }
- return 0;
-}
-
-static void __gl_timeline_slideshow_cb(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(data);
- _gl_ctxpopup_del(data);
- _gl_popup_create_slideshow(data, __gl_timeline_slideshow);
-}
-#endif
-
-#ifdef _USE_APP_SLIDESHOW
-static Eina_Bool __gl_timeline_edit_cancel_cb(void *data, Elm_Object_Item *it)
-{
- GL_CHECK_FALSE(data);
- gl_dbg("");
- gl_set_view_mode(data, GL_VIEW_TIMELINE);
- gl_appdata *ad = (gl_appdata *)data;
- if (_gl_timeline_update_view(data) < 0) {
- if (ad->tlinfo->nocontents == NULL) {
- ad->tlinfo->tran_op = GL_TRANS_OP_DEFAULT;
- _gl_slider_update_first_item(ad->tlinfo->view);
- }
-
- }
- return EINA_TRUE;
-}
-
-static int __gl_timeline_edit(void *data)
-{
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- int item_cnt = 0;
- int ret = -1;
-
- ret = _gl_data_get_item_cnt(GL_ALBUM_ALL_ID, GL_STORE_T_ALL, &item_cnt);
- if (ret != 0 || item_cnt == 0) {
- gl_dbgE("Empty!");
- return -1;
- }
-
- if (ad->tlinfo->album == NULL)
- ad->tlinfo->album = _gl_data_util_new_gcluster_all(data,
- item_cnt);
- GL_CHECK_VAL(ad->tlinfo->album, -1);
- _gl_albums_set_current(data, ad->tlinfo->album);
- Eina_List *medias_elist = NULL;
- _gl_data_get_items_album(data, ad->tlinfo->album,
- GL_FIRST_VIEW_START_POS, GL_FIRST_VIEW_END_POS,
- &medias_elist);
- _gl_thumbs_set_list(ad, medias_elist);
- _gl_thumbs_set_edit_mode(data, GL_THUMBS_EDIT_SLIDESHOW);
- _gl_thumbs_create_view(data, GL_NAVI_THUMBS, GL_STR_ID_ALL_ALBUMS, true,
- __gl_timeline_edit_cancel_cb);
-
- gl_dbg("Done edit");
- return 0;
-}
-#endif
-
void __gl_timeline_desc_mode_set(void *data)
{
gl_dbg("ENTRY");
gl_dbg("EXIT");
}
-#if 0
-static void __gl_timeline_share_cb(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(data);
- _gl_ctxpopup_del(data);
- gl_appdata *ad = (gl_appdata *)data;
- if (ad->uginfo.ug) {
- /**
- * Prevent changed to edit view in wrong way.
- * 1. When invoke imageviewer UG;
- */
- gl_dbgW("UG invoked!");
- return;
- }
- __gl_timeline_change_mode(data, GL_TL_VIEW_SHARE);
-}
-#endif
-
/* 'Delete medias' is available in Dali view */
static int __gl_timeline_del_op(void *data)
{
gl_dbgE("Get media failed[%d]!", ret);
}
item = NULL;
- }
-
- gl_dbg("Write pipe, make progressbar updated!");
- gl_thread_write_pipe(ad, i, popup_op);
- popup_op = GL_POPUP_OP_NONE;
- }
- timeline_d->sel_d->sel_list = NULL;
- return 0;
-}
-
-/* Update view after deleting process done */
-static int __gl_timeline_update_del_view(void *data)
-{
- GL_CHECK_VAL(data, -1);
- gl_dbgW("");
-
- __gl_timeline_change_mode(data, GL_TL_VIEW_NORMAL);
- /* Update view */
- _gl_timeline_update_view(data);
- /* Add notification */
- _gl_notify_create_notiinfo(GL_STR_DELETED);
- /* Add albums list */
- _gl_update_albums_list(data);
- _gl_db_update_lock_always(data, false);
- return 0;
-}
-
-#if 0
-static int __gl_timeline_get_path_str(void *data, gchar sep_c, char **path_str,
- int *sel_cnt)
-{
- GL_CHECK_VAL(path_str, -1);
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK_VAL(ad->tlinfo, -1);
- gl_timeline_s *timeline_d = ad->tlinfo;
- GL_CHECK_VAL(timeline_d->sel_d, -1);
- GString *selected_path_list = g_string_new(NULL);
- int selected_item_cnt = 0;
- Eina_List *l = NULL;
- char *item = NULL;
- int ret = -1;
- char *path = NULL;
-
- EINA_LIST_FOREACH(timeline_d->sel_d->sel_list, l, item) {
- if (item == NULL) {
- gl_dbgE("Invalid item!");
- goto GL_TL_FAILED;
- }
-
- ret = _gl_local_data_get_path_by_id((const char *)item, &path);
- if (ret != 0 || !path) {
- gl_dbgE("Get path failed[%d]!", ret);
- goto GL_TL_FAILED;
- }
-
- if (strstr(selected_path_list->str, path)) {
- gl_dbgW("Already appended!");
- } else {
- selected_item_cnt++;
- g_string_append(selected_path_list, path);
- g_string_append_c(selected_path_list, sep_c);
- }
- GL_FREE(path);
- }
- gl_dbg("Selected items count: %d.", selected_item_cnt);
- if (sel_cnt) {
- *sel_cnt = selected_item_cnt;
- }
- int len = strlen(selected_path_list->str);
- g_string_truncate(selected_path_list, len - 1);
- /**
- * Frees the memory allocated for the GString.
- * If free_segment is true it also frees the character data.
- * If it's false, the caller gains ownership of the buffer
- * and must free it after use with g_free().
- */
- *path_str = g_string_free(selected_path_list, false);
- GL_CHECK_VAL(*path_str, -1);
- gl_dbg("Total string:\n\n\t>>@@:> %s <:@@<<\n", *path_str);
- return 0;
-
-GL_TL_FAILED:
+ }
- if (selected_path_list) {
- g_string_free(selected_path_list, true);
- selected_path_list = NULL;
+ gl_dbg("Write pipe, make progressbar updated!");
+ gl_thread_write_pipe(ad, i, popup_op);
+ popup_op = GL_POPUP_OP_NONE;
}
- GL_FREEIF(path);
- return -1;
+ timeline_d->sel_d->sel_list = NULL;
+ return 0;
}
-/* To launch Image-editor*/
-static void __gl_timeline_ie_cb(void *data, Evas_Object *obj, void *ei)
+/* Update view after deleting process done */
+static int __gl_timeline_update_del_view(void *data)
{
- GL_CHECK(data);
- gl_appdata *ad = (gl_appdata *)data;
- gl_dbg("");
-
- if (ad->uginfo.ug || ad->uginfo.b_app_called) {
- gl_dbgW("UG or APP is already loaded!");
- return;
- }
- _gl_ctxpopup_del(data);
-
- GL_CHECK(ad->tlinfo);
- gl_timeline_s *timeline_d = ad->tlinfo;
- if (__gl_timeline_get_sel_cnt(timeline_d) == 0) {
- gl_dbgW("No thumbs selected!");
- gl_popup_create_popup(ad, GL_POPUP_NOBUT,
- GL_STR_NO_FILES_SELECTED);
- return;
- }
+ GL_CHECK_VAL(data, -1);
+ gl_dbgW("");
- _gl_ext_load_ie(data, __gl_timeline_get_path_str);
- /* Change to normal mode */
__gl_timeline_change_mode(data, GL_TL_VIEW_NORMAL);
+ /* Update view */
+ _gl_timeline_update_view(data);
+ /* Add notification */
+ _gl_notify_create_notiinfo(GL_STR_DELETED);
+ /* Add albums list */
+ _gl_update_albums_list(data);
+ _gl_db_update_lock_always(data, false);
+ return 0;
}
-#endif
-
/* 'Move medias' is only available in tab Albums */
static int __gl_timeline_move_copy_op(void *data)
{
return -1;
}
-#if 0
-/* move media to album in edit view */
-static void __gl_timeline_move_cb(void *data, Evas_Object *obj, void *ei)
-{
- elm_toolbar_item_selected_set((Elm_Object_Item *)ei, EINA_FALSE);
- GL_CHECK(data);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK(ad->tlinfo);
- gl_timeline_s *timeline_d = ad->tlinfo;
- gl_dbg("");
-
- if (__gl_timeline_get_sel_cnt(timeline_d) == 0) {
- gl_dbgW("No thumbs selected!");
- gl_popup_create_popup(data, GL_POPUP_NOBUT,
- GL_STR_NO_FILES_SELECTED);
- return;
- }
-
- ad->albuminfo.file_mc_mode = GL_MC_MOVE;
- _gl_popup_create_move(data, __gl_timeline_move_copy);
-}
-
-/* move media to album in edit view */
-static void _gl_timeline_copy_cb(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(data);
- _gl_ctxpopup_del(data);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK(ad->tlinfo);
- gl_timeline_s *timeline_d = ad->tlinfo;
-
- if (__gl_timeline_get_sel_cnt(timeline_d) == 0) {
- gl_dbgW("No thumbs selected!");
- gl_popup_create_popup(data, GL_POPUP_NOBUT,
- GL_STR_NO_FILES_SELECTED);
- return;
- }
-
- ad->albuminfo.file_mc_mode = GL_MC_COPY;
- _gl_popup_create_copy(data, __gl_timeline_move_copy);
-}
-#endif
-
-#ifdef _USE_ROTATE_BG
-#if 0
-static int __gl_timeline_rotate_op(void *data)
-{
-#define GL_ROTATE_DELAY 0.25
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK_VAL(ad->tlinfo, -1);
- gl_timeline_s *timeline_d = ad->tlinfo;
- GL_CHECK_VAL(timeline_d->sel_d, -1);
- int i = 0;
- int popup_op = GL_POPUP_OP_NONE;
- int ret = -1;
- bool b_left = false;
- char *item = NULL;
- int cnt = __gl_timeline_get_sel_cnt(timeline_d);
-
- if (ad->maininfo.medias_op_type == GL_MEDIA_OP_ROTATING_LEFT_TIMELINE) {
- b_left = true;
- }
-
- EINA_LIST_FREE(timeline_d->sel_d->sel_list, item) {
- i++;
- if (item) {
- ret = _gl_rotate_image_by_id(data, (const char *)item,
- b_left);
- if (ret != 0) {
- gl_dbgE("Rotate image failed[%d]!", ret);
- }
-
- /* 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);
- }
- item = NULL;
- }
-
- gl_dbg("Write pipe, make progressbar updated!");
- gl_thread_write_pipe(ad, i, popup_op);
- popup_op = GL_POPUP_OP_NONE;
- }
- timeline_d->sel_d->sel_list = NULL;
- return 0;
-}
-
-static int __gl_timeline_update_rotate_view(void *data)
-{
- GL_CHECK_VAL(data, -1);
- gl_dbgW("");
-
- __gl_timeline_change_mode(data, GL_TL_VIEW_NORMAL);
- _gl_db_update_lock_always(data, false);
- return 0;
-}
-static int __gl_timeline_rotate_images(void *data, bool b_left)
-{
- gl_dbg("");
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK_VAL(ad->tlinfo, -1);
- gl_timeline_s *timeline_d = ad->tlinfo;
-
- /* Get all selected medias count */
- int cnt = __gl_timeline_get_sel_cnt(timeline_d);
- /* 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_TIMELINE;
- /* Rotate right */
- if (!b_left) {
- op_type = GL_MEDIA_OP_ROTATING_RIGHT_TIMELINE;
- }
- _gl_db_update_lock_always(data, true);
- _gl_set_file_op_cbs(data, __gl_timeline_rotate_op, NULL,
- __gl_timeline_update_rotate_view, cnt);
- _gl_use_thread_operate_medias(ad, GL_STR_ID_ROTATING, cnt, op_type);
-
- return 0;
-}
-
-static void __gl_timeline_edit_rotate_left_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- GL_CHECK(data);
- _gl_ctxpopup_del(data);
-
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK(ad->tlinfo);
- gl_timeline_s *timeline_d = ad->tlinfo;
-
- if (__gl_timeline_get_sel_cnt(timeline_d) == 0) {
- gl_dbgW("No thumbs selected!");
- gl_popup_create_popup(data, GL_POPUP_NOBUT,
- GL_STR_NO_FILES_SELECTED);
- return;
- }
- __gl_timeline_rotate_images(data, true);
-}
-
-static void __gl_timeline_edit_rotate_right_cb(void *data, Evas_Object *obj,
- void *ei)
-{
- GL_CHECK(data);
- _gl_ctxpopup_del(data);
-
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK(ad->tlinfo);
- gl_timeline_s *timeline_d = ad->tlinfo;
-
- if (__gl_timeline_get_sel_cnt(timeline_d) == 0) {
- gl_dbgW("No thumbs selected!");
- gl_popup_create_popup(data, GL_POPUP_NOBUT,
- GL_STR_NO_FILES_SELECTED);
- return;
- }
- __gl_timeline_rotate_images(data, false);
-}
-#endif
-#endif
-
/* Easy mode: New album/Edit/Slideshow */
static int __gl_timeline_ctxpopup_append(void *data, Evas_Object *parent)
{
/* Copy to album */
_gl_ctxpopup_append(parent, GL_STR_ID_COPY_TO_ALBUM,
__gl_timeline_copy_cb, data);
-#ifdef SUPPORT_SLIDESHOW
- /* Slide show */
- _gl_ctxpopup_append(parent, GL_STR_ID_SLIDESHOW,
- __gl_timeline_slideshow_cb, data);
-#endif
}
return 0;
}
-#if 0
-static int __gl_timeline_edit_ctxpopup_append(void *data, Evas_Object *parent)
-{
- gl_dbg("");
- GL_CHECK_VAL(parent, -1);
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK_VAL(ad->tlinfo, -1);
- GL_CHECK_VAL(ad->tlinfo->sel_d, -1);
- int cnt = __gl_timeline_get_sel_cnt(ad->tlinfo);
-
- /* Hide items */
-
-#ifdef _USE_ROTATE_BG
- if (ad->tlinfo->sel_d->jpge_cnt == cnt) {
- gl_dbg("Enable more button");
- _gl_ctxpopup_append(parent, GL_STR_ID_ROTATE_LEFT,
- __gl_timeline_edit_rotate_left_cb,
- data);
- _gl_ctxpopup_append(parent, GL_STR_ID_ROTATE_RIGHT,
- __gl_timeline_edit_rotate_right_cb,
- data);
- }
-#endif
- return 0;
-}
-#endif
-
static void __gl_timeline_more_cb(void *data, Evas_Object *obj, void *ei)
{
gl_dbg("more button clicked");
}
}
-#if 0
-static void __gl_timeline_camera_cb(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(data);
- gl_dbg("");
- _gl_ext_load_camera(data);
-}
-#endif
-
static int __gl_timeline_reset_label(void *data)
{
GL_CHECK_VAL(data, -1);
}
-/* Select-all checkbox selected/deselected */
-#if 0
-static void __gl_timeline_edit_selall_cb(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(data);
- gl_appdata *ad = (gl_appdata *)data;
- int item_cnt = 0;
- int sel_all_cnt = 0;
- int ret = -1;
-
- ad->selinfo.ck_state = !ad->selinfo.ck_state;
- if (ad->selinfo.selectall_ck) {
- elm_check_state_set(ad->selinfo.selectall_ck, ad->selinfo.ck_state);
- }
- int state = ad->selinfo.ck_state;
- gl_dbg("Checkbox state: %d", state);
- _gl_slider_set_cks_state(ad->tlinfo->view, state);
-
- __gl_timeline_clear_sel_list(ad->tlinfo);
- __gl_timeline_clear_sel_cnt(ad->tlinfo);
-
- if (state == EINA_FALSE) {
- sel_all_cnt = 0;
- item_cnt = ad->tlinfo->count;
- } else {
- Eina_List *list = NULL;
- ret = _gl_data_get_items(GL_GET_ALL_RECORDS, GL_GET_ALL_RECORDS,
- &list);
- if (ret != 0 || !list) {
- gl_dbgW("Empty!");
- }
-
- gl_media_s *item = NULL;
- EINA_LIST_FREE(list, item) {
- if (!item || !item->uuid) {
- continue;
- }
- __gl_timeline_check_special_file(ad->tlinfo, item, true);
- __gl_timeline_sel_append_item(ad->tlinfo, item->uuid);
- _gl_data_type_free_glitem((void **)(&item));
- item_cnt++;
- item = NULL;
- }
- sel_all_cnt = item_cnt;
- }
-
- __gl_timeline_check_btns_state(ad->tlinfo, item_cnt, sel_all_cnt);
- /* Update the label text */
- _gl_ui_update_navi_title_text(ad->tlinfo->nf_it, sel_all_cnt, false);
-}
-#endif
-
int _gl_timeline_update_realized_grid_ck(Evas_Object *view, Eina_Bool state)
{
GL_CHECK_VAL(view, -1);
return 0;
}
-#ifdef GL_EXTENDED_FEATURES
-static int __gl_timeline_share_get_path(void *data, char **files)
-{
- GL_CHECK_VAL(files, 0);
- GL_CHECK_VAL(data, 0);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK_VAL(ad->tlinfo, 0);
- gl_timeline_s *timeline_d = ad->tlinfo;
- GL_CHECK_VAL(timeline_d->sel_d, 0);
- int i = 0;
- Eina_List *l = NULL;
- int ret = -1;
- char *item = NULL;
- char *path = NULL;
-
- EINA_LIST_FOREACH(timeline_d->sel_d->sel_list, l, item) {
- if (item == NULL) {
- gl_dbgE("Invalid item!");
- goto GL_TL_FAILED;
- }
-
- ret = _gl_local_data_get_path_by_id((const char *)item, &path);
- if (ret != 0 || !path) {
- gl_dbgE("Get path failed[%d]!", ret);
- goto GL_TL_FAILED;
- }
-
- files[i++] = strdup(path);
- gl_sdbg("file_url: %s!", files[i - 1]);
-
- GL_FREE(path);
- }
- return i;
-
-GL_TL_FAILED:
-
- for (; i > 0; --i) {
- GL_FREEIF(files[i - 1]);
- }
- GL_FREEIF(path);
- return 0;
-}
-
-static void __gl_timeline_share_op_cb(void *data, Evas_Object *obj, void *ei)
-{
- elm_toolbar_item_selected_set((Elm_Object_Item *)ei, EINA_FALSE);
- GL_CHECK(data);
- gl_appdata *ad = (gl_appdata *)data;
- GL_CHECK(ad->tlinfo);
- gl_timeline_s *timeline_d = ad->tlinfo;
- /* Get all selected medias count */
- int cnt = __gl_timeline_get_sel_cnt(timeline_d);
- _gl_ext_launch_share(data, cnt, __gl_timeline_share_get_path);
- /* Change to normal mode */
- __gl_timeline_change_mode(data, GL_TL_VIEW_NORMAL);
-}
-
-/**
- * Use naviframe api to push albums edit view to stack.
- * @param obj is the content to be pushed.
- */
-static int __gl_timeline_share_add_btns(void *data)
-{
- gl_dbg("Share");
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- Evas_Object *parent = ad->maininfo.naviframe;
- Elm_Object_Item *nf_it = elm_naviframe_top_item_get(parent);
- GL_CHECK_VAL(nf_it, -1);
- /* Item Toolbar */
- Elm_Object_Item *tb_it = NULL;
- Evas_Object *toolbar = _gl_ctrl_add_toolbar(parent);
- /* Cancel */
- _gl_ctrl_append_item(toolbar, NULL, GL_STR_ID_CANCEL,
- __gl_timeline_edit_cancel_cb, data);
- /* Share */
- tb_it = _gl_ctrl_append_item(toolbar, NULL, GL_STR_ID_SHARE,
- __gl_timeline_share_op_cb, data);
- _gl_ctrl_disable_item(tb_it, true);
- elm_object_item_part_content_set(nf_it, "toolbar", toolbar);
- /* Select-all */
- ad->selinfo.ck_state = false;
- _gl_ui_add_xpt_btns(nf_it, GL_UI_XPT_SEL_ALL,
- __gl_timeline_thumb_edit_selall_cb, NULL, data);
- return 0;
-}
-#endif
-
bool __gl_update_timeline(void *data)
{
GL_CHECK_FALSE(data);
if (GL_TL_VIEW_EDIT == mode || GL_TL_VIEW_COPY == mode) {
__gl_timeline_edit_add_btns(data);
}
-#ifdef GL_EXTENDED_FEATURES
- else {
- __gl_timeline_share_add_btns(data);
- }
-#endif
break;
default:
gl_dbgE("Wrong mode!");
+++ /dev/null
-/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* 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 <Elementary.h>
-#include "gl-ext-exec.h"
-#include "gl-debug.h"
-#include "gallery.h"
-#include "gl-data.h"
-#include "gl-util.h"
-#include "gl-popup.h"
-#include "gl-controlbar.h"
-#include "gl-albums.h"
-#include "gl-thumbs.h"
-#include "gl-strings.h"
-#include "gl-notify.h"
-
-#define GL_APP_PKG_VIDEOPLAYER "org.tizen.videos-lite"
-#define GL_APP_PKG_CAMERA_EFL "org.tizen.camera-app-lite"
-#define GL_APP_PKG_IE "com.samsung.image-editor"
-#define GL_SEPERATOR_IE '|'
-#define GL_ARGV_VIDEO_LIST_TYPE "video_list_type"
-#define GL_ARGV_VIDEO_ALL_FOLDER_VIDEO "all_folder_video"
-#define GL_ARGV_VIDEO_FOLDER "folder"
-
-#define GL_ARGV_VIDEO_ORDER_TYPE "order_type"
-#define GL_ARGV_VIDEO_ORDER_DATE_DESC "date_desc"
-#define GL_ARGV_VIDEO_START_POS "start_pos_time"
-
-#define GL_ARGV_VIDEO_LAUNCH_APP "launching_application"
-#define GL_ARGV_VIDEO_LAUNCH_GALLERY "gallery"
-
-#define GL_ARGV_PATH "path"
-
-#define GL_SHARE_FILE_PREFIX "file://"
-#define GL_SHARE_OPERATION_SINGLE "http://tizen.org/appcontrol/operation/share"
-#define GL_SHARE_OPERATION_MULTIPLE "http://tizen.org/appcontrol/operation/multi_share"
-#define GL_SHARE_SVC_FILE_PATH "http://tizen.org/appcontrol/data/path"
-
-//refer to imageviewer
-static int __gl_ext_launch_video_player(void *data, app_control_h service)
-{
- GL_CHECK_VAL(service, -1);
- GL_CHECK_VAL(data, -1);
- gl_item *gitem = (gl_item *)data;
- GL_CHECK_VAL(gitem->ad, -1);
- gl_appdata *ad = (gl_appdata *)gitem->ad;
- GL_CHECK_VAL(gitem->item, -1);
- GL_CHECK_VAL(gitem->item->uuid, -1);
- GL_CHECK_VAL(gitem->item->file_url, -1);
-
- int last_pos = 0;
- char last_pos_str[GL_INTERGER_LEN_MAX] = { 0, };
-
- GL_CHECK_VAL(gitem->item->video_info, -1);
- last_pos = gitem->item->video_info->last_played_pos;
- eina_convert_itoa(last_pos, last_pos_str);
- gl_dbg("last_pos : %d", last_pos);
-
- const char *video_path = gitem->item->file_url;
- /* Albums view */
- gl_cluster *cur_cluster = _gl_albums_get_current(ad);
- if (cur_cluster && cur_cluster->cluster) {
- gl_sdbg("Album: %s", cur_cluster->cluster->display_name);
- if (cur_cluster->cluster->type == GL_STORE_T_ALL) {
- gl_dbg("All album");
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_LIST_TYPE,
- GL_ARGV_VIDEO_ALL_FOLDER_VIDEO);
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_ORDER_TYPE,
- GL_ARGV_VIDEO_ORDER_DATE_DESC);
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_LAUNCH_APP,
- GL_ARGV_VIDEO_LAUNCH_GALLERY);
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_START_POS,
- last_pos_str);
- } else if (cur_cluster->cluster->type == GL_STORE_T_PHONE ||
- cur_cluster->cluster->type == GL_STORE_T_MMC) {
- gl_dbg("Real album");
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_LIST_TYPE,
- GL_ARGV_VIDEO_FOLDER);
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_ORDER_TYPE,
- GL_ARGV_VIDEO_ORDER_DATE_DESC);
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_LAUNCH_APP,
- GL_ARGV_VIDEO_LAUNCH_GALLERY);
- app_control_add_extra_data(service,
- GL_ARGV_VIDEO_START_POS,
- last_pos_str);
- } else {
- gl_dbg("Web album? Under construction...");
- }
- } else {
- /* Fixme: return or not? */
- gl_dbgE("Invalid current album, return?");
- }
-
- int ret = 0;
-
- // aul_open_file(video_path);
- app_control_add_extra_data(service, GL_ARGV_PATH, video_path);
- app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
- if (APP_CONTROL_ERROR_NONE != app_control_set_app_id(service, GL_APP_PKG_VIDEOPLAYER)) {
- gl_dbgE("app_control_set_app_id failed");
- }
- ret = app_control_send_launch_request(service, NULL, NULL);
-
- if (ret == APP_CONTROL_ERROR_NONE) {
- return 0;
- } else {
- return -1;
- }
-}
-
-static int __gl_ext_compose_exec_cmd(void *data, gl_ext_app_type type,
- char *path, char **pkg_name,
- app_control_h service)
-{
- GL_CHECK_VAL(data, -1);
- gl_sdbg("type:%d, path:%s", type, path);
-
- switch (type) {
- case GL_APP_VIDEOPLAYER:
- GL_CHECK_VAL(path, -1);
- *pkg_name = GL_APP_PKG_VIDEOPLAYER;
- break;
- default:
- *pkg_name = NULL;
- }
-
- return 0;
-}
-
-#ifdef GL_EXTENDED_FEATURES
-static void __gl_ext_app_control_reply_cb(app_control_h request, app_control_h reply,
- app_control_result_e result, void *user_data)
-{
- gl_dbg("");
- switch (result) {
- case APP_CONTROL_RESULT_SUCCEEDED:
- gl_dbg("APP_CONTROL_RESULT_SUCCEEDED");
- break;
- case APP_CONTROL_RESULT_FAILED:
- gl_dbg("APP_CONTROL_RESULT_FAILED");
- break;
- case APP_CONTROL_RESULT_CANCELED:
- gl_dbg("APP_CONTROL_RESULT_CANCELED");
- break;
- default:
- gl_dbgE("Unhandled value: %d!", result);
- break;
- }
-}
-#endif
-
-int gl_ext_exec(void *data, gl_ext_app_type type)
-{
- GL_CHECK_VAL(data, -1);
- gl_item *gitem = (gl_item *)data;
- GL_CHECK_VAL(gitem->ad, -1);
- gl_appdata *ad = (gl_appdata *)gitem->ad;
- GL_CHECK_VAL(gitem->item, -1);
- GL_CHECK_VAL(gitem->item->file_url, -1);
- char *path = gitem->item->file_url;
- app_control_h service = NULL;
- char *pkg_name = NULL;
-
- if (ad->uginfo.b_app_called) {
- gl_dbgE("APP launched, return!");
- return GL_LAUNCH_FAIL;
- }
-
- app_control_create(&service);
- GL_CHECK_VAL(service, GL_LAUNCH_FAIL);
-
- __gl_ext_compose_exec_cmd(ad, type, path, &pkg_name, service);
- if (pkg_name == NULL) {
- app_control_destroy(service);
- return GL_LAUNCH_FAIL;
- }
-
- int ret = 0;
- if (type == GL_APP_VIDEOPLAYER) {
- if (path == NULL) {
- app_control_destroy(service);
- return GL_LAUNCH_FAIL;
- }
- if (__gl_ext_launch_video_player(data, service) != 0) {
- app_control_destroy(service);
- return GL_LAUNCH_FAIL;
- }
- } else {
- app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
- ret = app_control_set_app_id(service, pkg_name);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("failed to set app id[%d]!", ret);
- }
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- app_control_destroy(service);
- gl_dbgE("app_control_send_launch_request failed[%d]!", ret);
- return GL_LAUNCH_FAIL;
- }
- }
-
- ret = app_control_destroy(service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ad->uginfo.b_app_called = true;
- return GL_LAUNCH_SUCCESS;
- } else {
- return GL_LAUNCH_FAIL;
- }
-}
-
-#ifdef GL_EXTENDED_FEATURES
-static void __gl_ext_popup_resp_cb(void *data, Evas_Object *obj, void *ei)
-{
- GL_CHECK(obj);
- GL_CHECK(data);
- gl_appdata *ad = (gl_appdata *)data;
- GL_IF_DEL_OBJ(ad->popupinfo.popup);
-}
-
-static Eina_Bool __gl_ext_avoid_multi_click_timer_cb(void *data)
-{
- GL_CHECK_FALSE(data);
- gl_appdata *ad = (gl_appdata *)data;
- gl_dbg("");
- GL_IF_DEL_TIMER(ad->ctrlinfo.avoid_multi_tap);
- return ECORE_CALLBACK_CANCEL;
-}
-
-/**
- * Launching Camera application
- */
-int _gl_ext_load_camera(void *data)
-{
- gl_dbg("");
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- if (ad->ctrlinfo.avoid_multi_tap) {
- return 0;
- }
- Ecore_Timer *timer = NULL;
- timer = ecore_timer_add(2.0, __gl_ext_avoid_multi_click_timer_cb, data);
- ad->ctrlinfo.avoid_multi_tap = timer;
-
- int ret = -1;
- int destroy_ret = -1;
- app_control_h handle;
-
- ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_create failed[%d]!", ret);
- return GL_LAUNCH_FAIL;
- }
-
- ret = app_control_set_operation(handle, APP_CONTROL_OPERATION_DEFAULT);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_operation [%s] failed[%d]!", APP_CONTROL_OPERATION_DEFAULT, ret);
- goto GL_EXT_LOAD_CAMERA_FINISHED;
- }
-
- ret = app_control_set_app_id(handle, GL_APP_PKG_CAMERA_EFL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_app_id [%s] failed[%d]!", GL_APP_PKG_CAMERA_EFL, ret);
- goto GL_EXT_LOAD_CAMERA_FINISHED;
- }
-
- ret = app_control_add_extra_data(handle, "CALLER", "gallery");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_add_extra_data failed[%d]!", ret);
- goto GL_EXT_LOAD_CAMERA_FINISHED;
- }
-
- ret = app_control_send_launch_request(handle, __gl_ext_app_control_reply_cb, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_send_launch_request failed[%d]!", ret);
- goto GL_EXT_LOAD_CAMERA_FINISHED;
- }
-
-GL_EXT_LOAD_CAMERA_FINISHED:
- destroy_ret = app_control_destroy(handle);
- if (destroy_ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_destroy failed[%d]!", destroy_ret);
- return GL_LAUNCH_FAIL;
- }
-
- return (ret == APP_CONTROL_ERROR_NONE ? GL_LAUNCH_SUCCESS : GL_LAUNCH_FAIL);
-
-}
-
-/**
- * Launching image-editor application
- */
-int _gl_ext_load_ie(void *data, void *get_path_cb)
-{
- GL_CHECK_VAL(get_path_cb, -1);
- GL_CHECK_VAL(data, -1);
- char *filepath_arg = NULL;
-
- int (*_get_path_cb)(void * data, gchar sep_c, char **path_str, int * sel_cnt);
- _get_path_cb = get_path_cb;
-
- _get_path_cb(data, GL_SEPERATOR_IE, &filepath_arg, NULL);
- if (filepath_arg == NULL) {
- gl_dbgE("Failed to get path string!");
- return GL_LAUNCH_FAIL;
- }
-
- gl_dbg("Launch Image-editor");
- int ret = GL_LAUNCH_FAIL;
- ret = _gl_ext_load(filepath_arg, APP_CONTROL_OPERATION_EDIT, GL_APP_PKG_IE,
- NULL, NULL);
- if (filepath_arg) {
- g_free(filepath_arg);
- filepath_arg = NULL;
- }
-
- return ret;
-}
-
-int _gl_ext_load(const char *uri, const char *operation, const char *pkg,
- const char *pkg_id, const char *mime)
-{
- gl_dbg("operation: %s, pkg: %s, uri: %s", operation, pkg, uri);
- int ret = -1;
- int destroy_ret = -1;
- app_control_h handle;
-
- ret = app_control_create(&handle);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_create failed[%d]!", ret);
- return GL_LAUNCH_FAIL;
- }
-
- ret = app_control_set_operation(handle, operation);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_operation [%s] failed[%d]!", operation,
- ret);
- goto GL_EXT_FAILED;
- }
-
- if (mime) {
- ret = app_control_set_mime(handle, mime);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_mime [%s] failed[%d]!", mime, ret);
- goto GL_EXT_FAILED;
- }
- }
-
- if (uri) {
- ret = app_control_set_uri(handle, uri);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_uri [%s] failed[%d]!", uri, ret);
- goto GL_EXT_FAILED;
- }
- }
-
- if (pkg) {
- ret = app_control_set_app_id(handle, pkg);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_app_id [%s] failed[%d]!", pkg,
- ret);
- goto GL_EXT_FAILED;
- }
- }
-
- if (pkg_id) {
- ret = app_control_set_app_id(handle, pkg_id);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_app_id [%s] failed[%d]!", pkg_id,
- ret);
- goto GL_EXT_FAILED;
- }
- }
-
- ret = app_control_send_launch_request(handle, __gl_ext_app_control_reply_cb,
- NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_send_launch_request failed[%d]!", ret);
- goto GL_EXT_FAILED;
- }
-
-GL_EXT_FAILED:
- destroy_ret = app_control_destroy(handle);
- if (destroy_ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_destroy failed[%d]!", destroy_ret);
- return GL_LAUNCH_FAIL;
- }
-
- return (ret == APP_CONTROL_ERROR_NONE ? GL_LAUNCH_SUCCESS : GL_LAUNCH_FAIL);
-}
-
-int _gl_ext_launch_share(void *data, int total_cnt, void *get_path_cb)
-{
-#define GL_SHARE_CNT_MAX 500
-
- GL_CHECK_VAL(get_path_cb, -1);
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
-
- if (total_cnt == 0) {
- gl_dbgE("nothing selected!");
- return -1;
- } else if (total_cnt > GL_SHARE_CNT_MAX) {
- char *share_limit_noti = g_strdup_printf(GL_STR_ID_SHARE_LIMIT, GL_SHARE_CNT_MAX);
- _gl_notify_create_notiinfo(share_limit_noti);
- GL_FREEIF(share_limit_noti);
- return -1;
- }
-
- char **files = NULL;
- char *operation = NULL;
- int ret = -1;
- files = (char **)calloc(1, sizeof(char *) * total_cnt);
- GL_CHECK_VAL(files, -1);
-
- int (*_get_path_cb)(void * data, char **files);
- _get_path_cb = get_path_cb;
- int real_cnt = _get_path_cb(data, files);
- app_control_h service = NULL;
- if (real_cnt == 0) {
- gl_dbgE("nothing selected!");
- goto SHARE_PANEL_END;
- }
-
- ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Failed to create service[%d]", ret);
- goto SHARE_PANEL_END;
- }
- char prefix_file[GL_ARRAY_LEN_MAX] = {0,};
- snprintf(prefix_file, GL_ARRAY_LEN_MAX, "%s%s", GL_SHARE_FILE_PREFIX,
- files[0]);
- ret = app_control_set_uri(service, prefix_file);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_uri failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- if (real_cnt == 1) {
- operation = GL_SHARE_OPERATION_SINGLE;
- } else {
- operation = GL_SHARE_OPERATION_MULTIPLE;
- }
- ret = app_control_set_operation(service, operation);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_operation failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- if (real_cnt > 1) {
- ret = app_control_add_extra_data_array(service, GL_SHARE_SVC_FILE_PATH,
- (const char **)files,
- real_cnt);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_add_extra_data_array failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- }
- /* set caller window for share panel */
- ret = app_control_set_window(service, elm_win_xwindow_get(ad->maininfo.win));
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_window failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_send_launch_request failed[%d]!", ret);
- }
-
-SHARE_PANEL_END:
-
- if (service) {
- app_control_destroy(service);
- }
- if (files) {
- for (; real_cnt > 0; --real_cnt) {
- GL_FREEIF(files[real_cnt - 1]);
- }
- GL_FREE(files);
- }
- if (ret != APP_CONTROL_ERROR_NONE) {
- _gl_popup_create(data, NULL, GL_STR_ID_OPERATION_FAILED,
- GL_STR_ID_CLOSE, __gl_ext_popup_resp_cb, data,
- NULL, NULL, NULL, NULL, NULL, NULL);
- return -1;
- }
- return 0;
-}
-
-int _gl_ext_is_larger_than_share_max(int total_cnt)
-{
-#define GL_SHARE_CNT_MAX 500
-
- if (total_cnt > GL_SHARE_CNT_MAX) {
- char limit_str[256] = {0};
- snprintf(limit_str, sizeof(limit_str), GL_STR_ID_SHARE_LIMIT,
- GL_SHARE_CNT_MAX);
- _gl_notify_create_notiinfo(limit_str);
- return true;
- }
- return false;
-}
-
-int _gl_ext_launch_share_with_files(void *data, int total_cnt, char **files)
-{
- GL_CHECK_VAL(files, -1);
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- char *operation = NULL;
- int ret = -1;
- app_control_h service = NULL;
-
- if (total_cnt == 0) {
- gl_dbgE("nothing selected!");
- goto SHARE_PANEL_END;
- }
-
- ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Failed to create service[%d]", ret);
- goto SHARE_PANEL_END;
- }
- char prefix_file[GL_ARRAY_LEN_MAX] = {0,};
- snprintf(prefix_file, GL_ARRAY_LEN_MAX, "%s%s", GL_SHARE_FILE_PREFIX,
- files[0]);
- ret = app_control_set_uri(service, prefix_file);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_uri failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- if (total_cnt == 1) {
- operation = GL_SHARE_OPERATION_SINGLE;
- } else {
- operation = GL_SHARE_OPERATION_MULTIPLE;
- }
- ret = app_control_set_operation(service, operation);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_operation failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- if (total_cnt > 1) {
- ret = app_control_add_extra_data_array(service, GL_SHARE_SVC_FILE_PATH,
- (const char **)files,
- total_cnt);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_add_extra_data_array failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- }
- /* set caller window for share panel */
- ret = app_control_set_window(service, elm_win_xwindow_get(ad->maininfo.win));
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_set_window failed[%d]", ret);
- goto SHARE_PANEL_END;
- }
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_send_launch_request failed[%d]!", ret);
- }
-
-SHARE_PANEL_END:
-
- if (service) {
- app_control_destroy(service);
- }
- if (ret != APP_CONTROL_ERROR_NONE) {
- _gl_popup_create(data, NULL, GL_STR_ID_OPERATION_FAILED,
- GL_STR_ID_CLOSE, __gl_ext_popup_resp_cb, data,
- NULL, NULL, NULL, NULL, NULL, NULL);
- return -1;
- }
- return 0;
-}
-
-int _gl_ext_launch_image_editor(const char *path_string)
-{
- GL_CHECK_VAL(path_string, -1);
-
- gl_dbg("Launch Image-editor");
- int ret = GL_LAUNCH_FAIL;
- ret = _gl_ext_load(path_string, APP_CONTROL_OPERATION_EDIT, GL_APP_PKG_IE,
- NULL, NULL);
- return ret;
-}
-
-#ifndef _USE_APP_SLIDESHOW
-int _gl_ext_launch_gallery_ug(void *data)
-{
-#define GL_GALLERY_UG "gallery-efl-lite"
-#define GL_FILE_TYPE "file-type"
-#define GL_VIEW_BY "view-by"
-#define GL_EXT_STR_BUNDLE_LEN 48
- GL_CHECK_VAL(data, -1);
- gl_appdata *ad = (gl_appdata *)data;
- int ret = -1;
- app_control_h service = NULL;
-
- ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_create failed: 0x%x", ret);
- return false;
- }
- /* set caller window */
- ret = app_control_set_window(service, elm_win_xwindow_get(ad->maininfo.win));
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("set_window failed[%d]", ret);
- goto GL_EXT_FAILED;
- }
- ret = app_control_set_app_id(service, GL_GALLERY_UG);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("set_app_id Failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
- ret = app_control_add_extra_data(service, "launch-type",
- "select-slideshow");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add launched type failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
- ret = app_control_add_extra_data(service, "indicator-state", "hide");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add indicator state failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
-
- int view_mode = gl_get_view_mode(ad);
- gl_dbg("view_mode: %d", view_mode);
- ret = app_control_add_extra_data(service, GL_FILE_TYPE, "all");
- gl_dbg("Media type: All");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add media type failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
-
- int tab_mode = _gl_ctrl_get_tab_mode(ad);
- gl_dbg("tab_mode: %d", tab_mode);
- switch (tab_mode) {
- case GL_CTRL_TAB_ALBUMS: {
- char *album_id = NULL;
- gl_cluster *cur_album = _gl_albums_get_current(data);
- if (cur_album && cur_album->cluster &&
- cur_album->cluster->uuid) {
- album_id = g_strdup(cur_album->cluster->uuid);
- }
- if (album_id) {
- ret = app_control_add_extra_data(service, GL_VIEW_BY,
- "albums1");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add view by failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
- ret = app_control_add_extra_data(service, "album-id",
- album_id);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add album id failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
- GL_GFREE(album_id);
- } else {
- gl_dbg("Albums2");
- ret = app_control_add_extra_data(service, GL_VIEW_BY,
- "all");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add view by failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
- }
- break;
- }
- case GL_CTRL_TAB_TIMELINE:
- ret = app_control_add_extra_data(service, GL_VIEW_BY, "all");
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("Add view by failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
- break;
- default:
- gl_dbgE("Wrong tab mode!");
- goto GL_EXT_FAILED;
- }
-
- ret = app_control_send_launch_request(service, __gl_ext_app_control_reply_cb,
- NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- gl_dbgE("app_control_send_launch_request Failed: 0x%x", ret);
- goto GL_EXT_FAILED;
- }
-
- app_control_destroy(service);
- return 0;
-
-GL_EXT_FAILED:
-
- app_control_destroy(service);
- return -1;
-}
-#endif
-#endif
-