From 294d65be77a8e12c3217dc116693940f79d9d2a5 Mon Sep 17 00:00:00 2001 From: Hyunwoo Kim Date: Wed, 31 Oct 2012 20:32:35 +0900 Subject: [PATCH] Fix B/S when scrolling in window SDK Change-Id: I004307956e5e6a1f783a1f41cce047512990bc24 --- main/src/include/ivug-slider.h | 43 +++++++++-------- main/src/slider/ivug-slider-item.cpp | 88 +++++++++++++++++++---------------- main/src/slider/ivug-slider-mouse.cpp | 32 ++++++------- main/src/slider/ivug-slider.cpp | 88 +++++++++++++++++++---------------- 4 files changed, 134 insertions(+), 117 deletions(-) diff --git a/main/src/include/ivug-slider.h b/main/src/include/ivug-slider.h index 26d33dd..47fc058 100755 --- a/main/src/include/ivug-slider.h +++ b/main/src/include/ivug-slider.h @@ -1,18 +1,18 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef __IVUG_SLIDER_H__ #define __IVUG_SLIDER_H__ @@ -35,6 +35,11 @@ typedef enum { // Error state SLIDE_STATE_NO_RIGHT, SLIDE_STATE_ERROR, +/* + CAUTION. + + If you change enumeration, plz modify function - const char *_GetStateString(slide_state_t state), too. +*/ } slide_state_t; @@ -121,10 +126,10 @@ void ivug_slider_zoom_in(Evas_Object *obj); void -ivug_slider_zoom_out(Evas_Object *obj); - -void -ivug_slider_update(Evas_Object *obj, Media_Item *newItem); +ivug_slider_zoom_out(Evas_Object *obj); + +void +ivug_slider_update(Evas_Object *obj, Media_Item *newItem); #ifdef __cplusplus } diff --git a/main/src/slider/ivug-slider-item.cpp b/main/src/slider/ivug-slider-item.cpp index 4dc7121..1d9b9e4 100755 --- a/main/src/slider/ivug-slider-item.cpp +++ b/main/src/slider/ivug-slider-item.cpp @@ -1,18 +1,18 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "ivug-common.h" @@ -129,23 +129,23 @@ static void _hide_videoicon(Slide_Item *si) static bool _start_drm_consume(Slide_Item *si) { - return true; + return true; } static bool _stop_drm_consume(Slide_Item *si) { - return true; + return true; } static bool _pause_drm_consume(Slide_Item *si) { - return true; + return true; } static bool _resume_drm_consume(Slide_Item *si) -{ - return true; -} +{ + return true; +} static sitem_type_t _get_sitem_type(Media_Type mtype) @@ -185,9 +185,9 @@ static void _photocam_loaded_cb(void *data, Evas_Object *obj, void *event_info) { IV_ASSERT(data != NULL); - Slide_Item* si = static_cast(data); + MSG_SITEM_HIGH("_photocam_loaded_cb"); //hide progress. _hide_progressbar(si); @@ -205,6 +205,12 @@ _photocam_loaded_cb(void *data, Evas_Object *obj, void *event_info) return; } + if ( si->state != SLIDE_STATE_LOADING ) + { + MSG_SITEM_ERROR("Invalid slide state. %s", ivug_get_filename(mdata->filepath)); + MSG_SITEM_FATAL("state=%d %s (%d,%d,%d,%d)", si->state, mdata->filepath, si->x, si->y, si->w, si->h); + } + #if 0 typedef enum _Evas_Load_Error { @@ -279,10 +285,10 @@ static bool _set_mitem(Slide_Item* si, Media_Item *item) si->type = _get_sitem_type(mdata->slide_type); - evas_object_smart_callback_add(si->photocam, "loaded", _photocam_loaded_cb, si); - if ( si->type == SITEM_TYPE_IMAGE ) { + evas_object_smart_callback_add(si->photocam, "loaded", _photocam_loaded_cb, si); + _hide_videoicon(si); #ifdef USE_IMAGE_THUMBNAIL @@ -311,14 +317,14 @@ static bool _set_mitem(Slide_Item* si, Media_Item *item) switch(mdata->slide_type) { case SLIDE_TYPE_IMAGE: - MSG_SITEM_HIGH("Set image. %s", ivug_get_filename(mdata->filepath)); - - if(mdata->bIsDRMContent == EINA_FALSE) + if(mdata->bIsDRMContent == false) { + MSG_SITEM_HIGH("Set image. %s", ivug_get_filename(mdata->filepath)); si->state = SLIDE_STATE_READY; } else { + MSG_SITEM_HIGH("Set DRM image. %s", ivug_get_filename(mdata->filepath)); si->state = SLIDE_STATE_DRM_CHECKING; } break; @@ -350,8 +356,8 @@ static bool _set_mitem(Slide_Item* si, Media_Item *item) static bool _unset_mitem(Slide_Item* si) -{ - si->state = SLIDE_STATE_NONE; +{ + si->state = SLIDE_STATE_NONE; // Unswallow photocam/videocam edje_object_part_unswallow(si->layout, edje_object_part_swallow_get(si->layout, "slider.contents")); @@ -673,18 +679,18 @@ ivug_slider_item_load(Slide_Item *si) if ( mdata->bIsDRMContent == EINA_TRUE ) { - _hide_progressbar(si); - - MSG_SITEM_ERROR("Image loading failed. RO expired File=%s", mdata->filepath); - si->state = SLIDE_STATE_ERROR; - - evas_object_hide(si->photocam); - _show_thumbnail(si, DRM_NO_RIGHT_IMAGE_PATH); - - _call_user_callback(si); - - return false; - } + _hide_progressbar(si); + + MSG_SITEM_ERROR("Image loading failed. RO expired File=%s", mdata->filepath); + si->state = SLIDE_STATE_ERROR; + + evas_object_hide(si->photocam); + _show_thumbnail(si, DRM_NO_RIGHT_IMAGE_PATH); + + _call_user_callback(si); + + return false; + } else { strncpy(path, mdata->filepath, sizeof(path)); diff --git a/main/src/slider/ivug-slider-mouse.cpp b/main/src/slider/ivug-slider-mouse.cpp index 78f9f04..3018523 100755 --- a/main/src/slider/ivug-slider-mouse.cpp +++ b/main/src/slider/ivug-slider-mouse.cpp @@ -1,18 +1,18 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "ivug-common.h" #include "ivug-slider-item.h" @@ -365,7 +365,7 @@ Evas_Event_Flags _momentum_move(void *data, void *event_info) if ( sd->edge == EDGE::SLIDE_FIT) { - MSG_HIGH("Case 1. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + MSG_HIGH("Case 1. edge=%d, X=%d dx=%d si->x=%d state=%d", sd->edge, dst_x, dx, si->x, sd->slide[PREV_SLIDE]->state); _ivug_slider_pass_event_to_item(sd, EINA_FALSE); if ( dst_x >= 0 && sd->slide[PREV_SLIDE]->state == SLIDE_STATE_NONE) diff --git a/main/src/slider/ivug-slider.cpp b/main/src/slider/ivug-slider.cpp index a49ce8a..cce0bdf 100755 --- a/main/src/slider/ivug-slider.cpp +++ b/main/src/slider/ivug-slider.cpp @@ -1,18 +1,18 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include // ug_destroy_me, ug_send_result @@ -123,8 +123,8 @@ static void _do_load(struct Smart_Data *sd) sd->load_idler = NULL; } - MSG_SLIDER_HIGH("Add idler for loading."); - sd->load_idler = ecore_idler_add(_idler_loading_func, sd); + MSG_SLIDER_HIGH("Add idler for loading."); + sd->load_idler = ecore_idler_add(_idler_loading_func, sd); } static void _ivug_slider_on_center_changed(Evas_Object *obj, Slide_Item *old, Slide_Item *cur) @@ -149,7 +149,13 @@ static void _ivug_slider_on_center_changed(Evas_Object *obj, Slide_Item *old, Sl MSG_SLIDER_ERROR("Invalid state : %s", _GetStateString(cur->state)); } - MSG_SLIDER_HIGH("Center item changed. State=%s", _GetStateString(cur->state)); + Media_Item *mitem = NULL; + + mitem = cur->mitem; + + Media_Data *pData = ivug_medialist_get_data(mitem); + + MSG_SLIDER_HIGH("Center item changed. %s State=%s", ivug_get_filename(pData->filepath), _GetStateString(cur->state)); evas_object_smart_callback_call(sd->obj, "slider,item,changed", cur); } @@ -1198,26 +1204,26 @@ ivug_slider_zoom_out(Evas_Object *obj) sd->zoom_level--; } - -void -ivug_slider_update(Evas_Object *obj, Media_Item *newItem) -{ - if (obj == NULL) { - MSG_SLIDER_HIGH("Slider is NULL"); - return; - } - struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); - - MSG_SLIDER_HIGH("Slider update"); - - Slide_Item *si = sd->slide[CENTER_SLIDE]; - - ivug_slider_item_zoom_reset(si, EINA_FALSE, 0, 0); - - ivug_slider_item_stop(si); - - ivug_slider_item_data_set(si, newItem); - - _do_load(sd); -} - + +void +ivug_slider_update(Evas_Object *obj, Media_Item *newItem) +{ + if (obj == NULL) { + MSG_SLIDER_HIGH("Slider is NULL"); + return; + } + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider update"); + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + ivug_slider_item_zoom_reset(si, EINA_FALSE, 0, 0); + + ivug_slider_item_stop(si); + + ivug_slider_item_data_set(si, newItem); + + _do_load(sd); +} + -- 2.7.4