IV_ASSERT(pMainView != NULL);
Media_Item *mitem = ivug_medialist_get_current_item(pMainView->mList);
- Media_Data *mdata = ivug_medialist_get_data(mitem);
+
+ Media_Data *mdata = NULL;
+
+ if (mitem) {
+ mdata = ivug_medialist_get_data(mitem);
+ } else {
+ MSG_MAIN_ERROR("mdata is NULL");
+ return;
+ }
if (mdata == NULL) {
MSG_MAIN_ERROR("mdata is NULL");
}
}
-void
-on_slider_clicked(void *data, Evas_Object *obj, void *event_info)
+static void
+_request_destroy_to_caller()
+{
+ app_control_h service;
+ app_control_create(&service);
+
+ app_control_add_extra_data(service, "request_destroy", "true");
+ app_control_reply_to_launch_request(service, gGetServiceHandle(), APP_CONTROL_RESULT_SUCCEEDED);
+
+ app_control_destroy(service);
+}
+
+static void on_slider_layout_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
{
IV_ASSERT(data != NULL);
}
}
#endif
- if (pMainView->mode != IVUG_MODE_SELECT && pMainView->mode != IVUG_MODE_EMAIL) {
- if (pMainView->bShowMenu) {
- ivug_main_view_hide_menu_bar(pMainView);
- } else {
- ivug_main_view_show_menu_bar(pMainView);
- }
- }
+ if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE && pMainView->cur_mitem == NULL && pMainView->slide_move_timer == NULL) {
+ ivug_ext_launch_gallery();
+ _request_destroy_to_caller();
+ }
}
-
static Eina_Bool _ivug_long_press_timer_expired(void *data)
{
ivug_retv_if(!data, ECORE_CALLBACK_CANCEL);
elm_object_signal_callback_add(sn_layout, "play", "elm", _on_slider_playvideo_icon_clicked, pMainView);
// evas_object_smart_callback_add(sn_layout, "slider,playburst", _on_slider_playburst_icon_clicked, pMainView);
-// evas_object_smart_callback_add(sn_layout, "slider,clicked", on_slider_clicked, pMainView);
evas_object_smart_callback_add(sn_layout, "slider,longpress,start", _on_slider_long_press_start, pMainView);
evas_object_smart_callback_add(sn_layout, "slider,longpress,end", _on_slider_long_press_end, pMainView);
evas_object_event_callback_add(sn_layout, EVAS_CALLBACK_MOUSE_DOWN, _on_slider_mouse_down, pMainView);
evas_object_event_callback_add(sn_layout, EVAS_CALLBACK_MOUSE_MOVE, _on_slider_mouse_moved, pMainView);
evas_object_event_callback_add(sn_layout, EVAS_CALLBACK_MOUSE_UP, _on_slider_mouse_up, pMainView);
+ elm_object_signal_callback_add(sn_layout, "mouse,clicked,1", "*", on_slider_layout_clicked, (void *)pMainView);
}
if ((pMainView->view_by != IVUG_VIEW_BY_FILE)
pMainView->album_name = strdup(IDS_NO_NAME);
}
}
+
pMainView->mList = mlist;
if (ivug_medialist_get_count(mlist) == 1) {
MSG_MAIN_HIGH("currentindex = %d count =%d", currentindex, count);
}
+ if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) count++;
+
ivug_create_new_photocam_image(pMainView, &pMainView->photocam, "imageview_area");
ivug_slider_new_set_photocam(pMainView->pSliderNew, pMainView->photocam);
if (count != -1 && currentindex != -1 && currentindex + 1 < count) {
Media_Item *next_mitem = ivug_medialist_get_next(pMainView->mList, pMainView->cur_mitem);
- Media_Data *pData = ivug_medialist_get_data(next_mitem);
+ Media_Data *pData = NULL;
+
+ if (next_mitem) {
+ pData = ivug_medialist_get_data(next_mitem);
+ }
ivug_create_new_photocam_image(pMainView, &pMainView->photocam2, "imageview_area_temp2");
- if (pData->slide_type == SLIDE_TYPE_VIDEO) {
- elm_photocam_file_set(pMainView->photocam2, pData->thumbnail_path);
+
+ if (pMainView->mode != IVUG_MODE_CAMERA_SIMPLE) {
+ if (pData->slide_type == SLIDE_TYPE_VIDEO) {
+ elm_photocam_file_set(pMainView->photocam2, pData->thumbnail_path);
+ } else {
+ e = elm_photocam_file_set(pMainView->photocam2, pData->filepath);
+
+ if (EVAS_LOAD_ERROR_NONE != e) {
+ MSG_HIGH("Loading default Thumbnail");
+ elm_photocam_file_set(pMainView->photocam2, default_thumbnail_edj_path);
+ }
+ }
} else {
- e = elm_photocam_file_set(pMainView->photocam2, pData->filepath);
+ char lock_icon[1024];
+ snprintf(lock_icon, 1024, "%sedje/icons/image_viewer_camera_secured.png", app_get_resource_path());
+
+ e = elm_photocam_file_set(pMainView->photocam2, lock_icon);
if (EVAS_LOAD_ERROR_NONE != e) {
MSG_HIGH("Loading default Thumbnail");
/*initialize the values on finger touch to the screen*/
void _on_slider_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- on_slider_clicked(data, obj, event_info);
IV_ASSERT(data != NULL);
Ivug_MainView *pMainView = (Ivug_MainView *)data;
+
+ if (pMainView->mode != IVUG_MODE_SELECT && pMainView->mode != IVUG_MODE_EMAIL) {
+ if (pMainView->bShowMenu) {
+ ivug_main_view_hide_menu_bar(pMainView);
+ } else {
+ ivug_main_view_show_menu_bar(pMainView);
+ }
+ }
+
Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info;
pMainView->prev_mouse_point = 0;
pMainView->last_prev_mouse_point = ev->output.x;
int currentindex = -1;
if (pMainView->slide_state == true) {
MSG_MAIN_HIGH("Sliding is happening");
- return ;//Do not accept the flick event if transition is not completed
+ return ;
}
Evas_Object *sn_layout = ivug_slider_new_get_layout(pMainView->pSliderNew);
count = ivug_medialist_get_count(pMainView->mList);
Media_Data *pData = ivug_medialist_get_data(pMainView->cur_mitem);
currentindex = pData->index;
+ } else if (pMainView->cur_mitem == NULL && pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) {
+ count = ivug_medialist_get_count(pMainView->mList);
+ currentindex = count;
}
- if (pMainView->prev_mouse_point != 0 && currentindex != -1 && count != -1 && ivug_isslide_enabled(pMainView->pSliderNew) && pMainView->bmultitouchsliding == false) {
+ if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) count++;
+
+ if (pMainView->prev_mouse_point != 0 && currentindex != -1 && count != -1
+ && ivug_isslide_enabled(pMainView->pSliderNew)
+ && pMainView->bmultitouchsliding == false) {
+
if (pMainView->currentphotocam == PHOTOCAM_0) {
evas_object_geometry_get(pMainView->photocam0, &bx, &by, &bw, &bh);
} else if (pMainView->currentphotocam == PHOTOCAM_1) {
* and again come back at original position
* then video play icon should appear
*/
- Media_Data *pData = ivug_medialist_get_data(pMainView->cur_mitem);
- if ((pMainView->last_prev_mouse_point - ev->cur.output.x > -10) && (pMainView->is_play_Icon == false) && (currentindex + 1 == count) && (pData->slide_type == SLIDE_TYPE_VIDEO)) {
- edje_object_signal_emit(elm_layout_edje_get(sn_layout), "show,icon", "video_play_icon");
- pMainView->is_play_Icon = true;
+ if (pMainView->cur_mitem) {
+ Media_Data *pData = ivug_medialist_get_data(pMainView->cur_mitem);
+ if ((pMainView->last_prev_mouse_point - ev->cur.output.x > -10) && (pMainView->is_play_Icon == false) && (currentindex + 1 == count) && (pData->slide_type == SLIDE_TYPE_VIDEO)) {
+ edje_object_signal_emit(elm_layout_edje_get(sn_layout), "show,icon", "video_play_icon");
+ pMainView->is_play_Icon = true;
+ }
}
}
MSG_MAIN_HIGH("mouse up (%d,%d)", ev->output.x, ev->output.y);
if (pMainView->slide_state == true || ivug_isphotocam_reset(pMainView->pSliderNew)) {
MSG_MAIN_HIGH("Sliding is happening");
- return ;//Do not accept the flick event if transition is not completed
+ return ;
}
int count = -1;
int currentindex = -1;
count = ivug_medialist_get_count(pMainView->mList);
Media_Data *pData = ivug_medialist_get_data(pMainView->cur_mitem);
currentindex = pData->index;
- MSG_MAIN_HIGH(" _main_view_eventbox_flick_left_cb currentindex = %d count =%d ", currentindex, count);
+ MSG_MAIN_HIGH("currentindex = %d count =%d ", currentindex, count);
+ } else if (pMainView->cur_mitem == NULL && pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) {
+ count = ivug_medialist_get_count(pMainView->mList);
+ currentindex = count;
}
int diffX = pMainView->last_prev_mouse_point - ev->output.x ;
+ if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) count++;
+
if (diffX > 10) {
//left flick code
ivug_medialist_set_current_item(pMainView->mList, pMainView->cur_mitem);
// Update Main View.
- if (pMainView->bShowMenu == true) {
+ if (pMainView->bShowMenu == true && pMainView->mode != IVUG_MODE_CAMERA_SIMPLE) {
_update_main_view(pMainView);
}
- ivug_medialist_get_data(pMainView->cur_mitem);
if (pMainView->slide_move_timer) {
ecore_timer_del(pMainView->slide_move_timer);
pMainView->slide_move_timer = ecore_timer_add(PC_MOVE_INTERVAL_TIME, _ivug_left_move_interval, pMainView);
pMainView->slide_state = true;//set it to true until the tranition completes.
#ifdef USE_THUMBLIST
- if (pMainView->thumbs) {
- Media_Item *mItem = ivug_medialist_get_current_item(pMainView->mList);
-
- Image_Object *img = NULL;
- img = ivug_thumblist_find_item_by_data(pMainView->thumbs, mItem); // Find thumb item of new image,.
- if (img != NULL) {
- pMainView->bSetThmByUser = true;
- ivug_thumblist_select_item(pMainView->thumbs, img);
+ if (pMainView->mode != IVUG_MODE_CAMERA_SIMPLE) {
+ if (pMainView->thumbs) {
+ Media_Item *mItem = ivug_medialist_get_current_item(pMainView->mList);
+
+ Image_Object *img = NULL;
+ img = ivug_thumblist_find_item_by_data(pMainView->thumbs, mItem); // Find thumb item of new image,.
+ if (img != NULL) {
+ pMainView->bSetThmByUser = true;
+ ivug_thumblist_select_item(pMainView->thumbs, img);
+ }
}
}
#endif
pMainView->currentphotocam = PHOTOCAM_2;
}
- pMainView->cur_mitem = ivug_medialist_get_prev(pMainView->mList, pMainView->cur_mitem);
+ if (pMainView->cur_mitem) {
+ pMainView->cur_mitem = ivug_medialist_get_prev(pMainView->mList, pMainView->cur_mitem);
+ } else if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) {
+ pMainView->cur_mitem = ivug_medialist_get_last(pMainView->mList);
+ }
+
ivug_medialist_set_current_item(pMainView->mList, pMainView->cur_mitem);
// Update Main View.
_update_main_view(pMainView);
}
- ivug_medialist_get_data(pMainView->cur_mitem);
-
if (pMainView->slide_move_timer) {
ecore_timer_del(pMainView->slide_move_timer);
pMainView->slide_move_timer = NULL;
/* slide the image on flick left */
Eina_Bool _ivug_left_move_interval(void *data)
{
+ MSG_MAIN_HIGH("_ivug_left_move_interval");
Ivug_MainView *pMainView = (Ivug_MainView *)data;
bool movepossible = false;
- update_check(pMainView);
+
+ if (pMainView->mode == IVUG_MODE_SELECT) {
+ update_check(pMainView);
+ }
+
Evas_Object *sn_layout = ivug_slider_new_get_layout(pMainView->pSliderNew);
ivug_disable_gesture(pMainView->pSliderNew);
if (!movepossible) {
MSG_MAIN_HIGH("left_transit_done signal triggered");
edje_object_signal_emit(elm_layout_edje_get(sn_layout), "left_transit_done", "imageview_area");
- Media_Item *next_mitem = ivug_medialist_get_next(pMainView->mList, pMainView->cur_mitem);
+ if (pMainView->cur_mitem) {
+ Media_Item *next_mitem = ivug_medialist_get_next(pMainView->mList, pMainView->cur_mitem);
- if (next_mitem) {
- Media_Data *pData = ivug_medialist_get_data(next_mitem);
+ if (next_mitem) {
+ Media_Data *pData = ivug_medialist_get_data(next_mitem);
- if (pData->slide_type == SLIDE_TYPE_IMAGE) {
- edje_object_signal_emit(elm_layout_edje_get(sn_layout), "hide,icon", "video_play_icon");
- pMainView->is_play_Icon = false;
- } else {
- edje_object_signal_emit(elm_layout_edje_get(sn_layout), "show,icon", "video_play_icon");
- pMainView->is_play_Icon = true;
+ if (pData->slide_type == SLIDE_TYPE_IMAGE) {
+ edje_object_signal_emit(elm_layout_edje_get(sn_layout), "hide,icon", "video_play_icon");
+ pMainView->is_play_Icon = false;
+ } else {
+ edje_object_signal_emit(elm_layout_edje_get(sn_layout), "show,icon", "video_play_icon");
+ pMainView->is_play_Icon = true;
+ }
}
}
pMainView->slide_move_timer = NULL;
MSG_MAIN_HIGH("_ivug_right_move_interval");
Ivug_MainView *pMainView = (Ivug_MainView *)data;
bool movepossible = false;
- update_check(pMainView);
+
+ if (pMainView->mode == IVUG_MODE_SELECT) {
+ update_check(pMainView);
+ }
+
Evas_Object *sn_layout = ivug_slider_new_get_layout(pMainView->pSliderNew);
ivug_disable_gesture(pMainView->pSliderNew);
if (!movepossible) {
MSG_MAIN_HIGH("right_transit_done signal triggered");
edje_object_signal_emit(elm_layout_edje_get(sn_layout), "right_transit_done", "imageview_area");
- Media_Item *prev_mitem = ivug_medialist_get_prev(pMainView->mList, pMainView->cur_mitem);
+ Media_Item *prev_mitem = NULL;
+
+ if (pMainView->cur_mitem) {
+ prev_mitem = ivug_medialist_get_prev(pMainView->mList, pMainView->cur_mitem);
+ } else {
+ prev_mitem = ivug_medialist_get_last(pMainView->mList);
+ }
if (prev_mitem) {
Media_Data *pmData = ivug_medialist_get_data(prev_mitem);
Evas_Object *sn_layout = ivug_slider_new_get_layout(pMainView->pSliderNew);
Evas_Load_Error err = EVAS_LOAD_ERROR_NONE;
+ if (!pMainView->cur_mitem) return;
Media_Item *prev_mitem = ivug_medialist_get_prev(pMainView->mList, pMainView->cur_mitem);
char *edj_file = DEFAULT_THUMBNAIL_PATH;
}
evas_object_show(*next_pc);
edje_object_signal_emit(elm_layout_edje_get(sn_layout), "set_right", next_iva);
+ } else if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) {
+ if ((*next_pc) == NULL) {
+ ivug_create_new_photocam_image(pMainView, next_pc, next_iva);
+ }
+
+ char lock_icon[1024];
+ snprintf(lock_icon, 1024, "%sedje/icons/image_viewer_camera_secured.png", app_get_resource_path());
+
+ err = elm_photocam_file_set(*next_pc, lock_icon);
+
+ if (EVAS_LOAD_ERROR_NONE != err) {
+ MSG_HIGH("Loading default Thumbnail");
+ elm_photocam_file_set(*next_pc, edj_file);
+ }
+ evas_object_show(*next_pc);
+ edje_object_signal_emit(elm_layout_edje_get(sn_layout), "set_right", next_iva);
}
free(edj_file);
}