typedef struct _SlideShow SlideShow;
-typedef struct {
- Evas_Object *parent;
- Evas_Object *layout; /*Layout widget based on EDJ*/
-
- Evas_Object *navi_bar;
- Evas_Object *empty_layout;
- Elm_Object_Item *navi_it;
- Evas_Object* slider; //image viewer slider
-
- Evas_Object *back_btn;
-
- Evas_Object *area_obj; //lcd area except indicator
-
- Evas_Object* selectioninfo;
-
- Evas_Object *zoom_slider;
- int zoom_level;
-
-/*
- |------------------|
- | navi_bar |
- |------------------|
- | tool_bar |
- |------------------|
- | |
- | |
- | |
- | |
- |------------------|
- | ctrl_bar |
- |------------------|
-*/
-
-// Toolbar
- Evas_Object *tool_bar;
- ivug_toolbar tool_bar_type;
-
-// Controlbar
- Evas_Object *ctrl_bar;
- ivug_ctrlbar ctrl_bar_type;
-
- Evas_Object *btn_more;
- Evas_Object *btn_share;
- Evas_Object *btn_download;
-
-
- bool bSetThmByUser;
-
- Evas_Object* popup; //popup
- Evas_Object* ctx_popup; //context popup 1depth
- Evas_Object* ctx_popup2; //context popup 2depth
-
- Evas_Object* longpress_popup; //long press popup
- bool bLongpressEnd;
-
-// child view.
- Ivug_NameView *pNameView;
- Ivug_SetAsView *pSetAsView;
-
- Ivug_DetailsView *pDetailsView;
- IvugCropView *pCropView;
-
-
-// List
- Media_List *mList;
-
-//flag
- bool bShowMenu;
-
- ivug_mode mode;
- ivug_view_by view_by;
-
- ui_gadget_h ext_ug;
-
- Ecore_Event_Handler *keydown_handler;
-
- Ecore_Timer *exit_timer;
- Ecore_Timer *hide_timer;
- int hide_count;
-
- Ecore_Timer *popup_timer;
-
- char *album_name;
-
-// Slide show;
- SlideShow *ssHandle;
-
-
- bool bClickPrevent;
-
-} Ivug_MainView;
+typedef struct _Ivug_MainView Ivug_MainView;
#undef FIX_LAST_BLINK
LONGTAP_CANCELED,
} longtap_state;
+typedef enum {
+ CENTER_SLIDE,
+ NEXT_SLIDE,
+ PREV_SLIDE,
+ MAX_SLIDE,
+} slide_index_t;
/*
Slider signal list.
void
ivug_slider_set_item(Evas_Object* obj, Media_Item *item, slide_dir_t dir);
+void
+ivug_slider_set_item_to_slide(Evas_Object* obj, slide_index_t where, Media_Item *newItem);
+
/*
Delete current media item
*/
SLIDE_SHIFT_TO_LEFT, // Mouse--------------------->
} shift_direction_t;
-
-//ENUM
-typedef enum {
- CENTER_SLIDE,
- NEXT_SLIDE,
- PREV_SLIDE,
- MAX_SLIDE,
-} slide_index_t;
-
class ECoreAnimator;
class CAnimator;
_ivug_slider_on_center_changed(sd->obj, sd->slide[NEXT_SLIDE] , sd->slide[CENTER_SLIDE]);
break;
}
+
+}
+
+void
+ivug_slider_set_item_to_slide(Evas_Object* obj, slide_index_t where, Media_Item *newItem)
+{
+ IV_ASSERT(obj != NULL);
+ IV_ASSERT(newItem != NULL);
+
+ if(where >= MAX_SLIDE)
+ {
+ MSG_SLIDER_ERROR("where is invalid %d, where");
+ return;
+ }
+
+ struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj);
+
+ MSG_SLIDER_HIGH("ivug_slider_set_item_to_slide. where=%d", where);
+
+ Media_Item *mitem = NULL;
+
+ ivug_slider_item_data_set(sd->slide[where], newItem);
+
+ _do_load(sd);
}
#include "ivug-main-view.h"
#include "ivug-main-view-toolbar.h"
#include "ivug-main-view-menu.h"
+#include "ivug-main-view-priv.h"
#include "ivug-slider.h"
#include "ivug-slider-item.h"
elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_TRUE);
+ _update_title(pMainView); // after crop index changed
+
Evas_Object *conformant = (Evas_Object *)ug_get_conformant();
elm_object_signal_emit(conformant, "elm,state,indicator,overlap", "");
}
{
ivug_db_destroy_file_handle(m_handle);
}
+
+ Ivug_MainView *pMainView = (Ivug_MainView *)data;
+
+ Media_Item *mitem = ivug_medialist_prepend_item(pMainView->mList, path);
+
+ Media_Item *c_mitem = ivug_slider_get_item(pMainView->slider);
+ Media_Data *c_mdata = ivug_medialist_get_data(c_mitem);
+ if(c_mdata->index == 1) //left slide item added
+ {
+ MSG_MAIN_ERROR("add left slide item");
+ ivug_slider_set_item_to_slide(pMainView->slider, PREV_SLIDE, mitem);
+ }
}
static void _ivug_setas_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
--- /dev/null
+/*
+ * 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_MAINVIEW_PRIV_H__
+#define __IVUG_MAINVIEW_PRIV_H__
+
+#include "ivug-define.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct _Ivug_MainView{
+ Evas_Object *parent;
+ Evas_Object *layout; /*Layout widget based on EDJ*/
+
+ Evas_Object *navi_bar;
+ Evas_Object *empty_layout;
+ Elm_Object_Item *navi_it;
+ Evas_Object* slider; //image viewer slider
+
+ Evas_Object *back_btn;
+
+ Evas_Object *area_obj; //lcd area except indicator
+
+ Evas_Object* selectioninfo;
+
+ Evas_Object *zoom_slider;
+ int zoom_level;
+
+/*
+ |------------------|
+ | navi_bar |
+ |------------------|
+ | tool_bar |
+ |------------------|
+ | |
+ | |
+ | |
+ | |
+ |------------------|
+ | ctrl_bar |
+ |------------------|
+*/
+
+// Toolbar
+ Evas_Object *tool_bar;
+ ivug_toolbar tool_bar_type;
+
+// Controlbar
+ Evas_Object *ctrl_bar;
+ ivug_ctrlbar ctrl_bar_type;
+
+ Evas_Object *btn_more;
+ Evas_Object *btn_share;
+ Evas_Object *btn_download;
+
+ bool bSetThmByUser;
+
+ Evas_Object* popup; //popup
+ Evas_Object* ctx_popup; //context popup 1depth
+ Evas_Object* ctx_popup2; //context popup 2depth
+
+ Evas_Object* longpress_popup; //long press popup
+ bool bLongpressEnd;
+
+ Evas_Object *best_icon;
+
+// child view.
+ Ivug_NameView *pNameView;
+ Ivug_SetAsView *pSetAsView;
+
+ Ivug_DetailsView *pDetailsView;
+ IvugCropView *pCropView;
+
+// List
+ Media_List *mList;
+
+//flag
+ bool bShowMenu;
+
+ ivug_mode mode;
+ ivug_view_by view_by;
+
+ ui_gadget_h ext_ug;
+
+ Ecore_Event_Handler *keydown_handler;
+
+ Ecore_Timer *exit_timer;
+ Ecore_Timer *hide_timer;
+ int hide_count;
+
+ Ecore_Timer *popup_timer;
+
+ char *album_name;
+
+// Slide show;
+ SlideShow *ssHandle;
+
+ bool bClickPrevent;
+ bool bStandAlone; //if true, it is process not ug
+};
+
+void _update_title(struct _Ivug_MainView *pMainView);
+
+bool ivug_is_agif(const char *filepath);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // __IVUG_MAINVIEW_PRIV_H__
+
#include "ivug-common.h"
#include "ivug-main-view.h"
#include "ivug-main-view-menu.h"
+#include "ivug-main-view-priv.h"
#include "ivug-slider.h"
#include "ivug-image.h"
-
+#include "ivug-main-view-priv.h"
#undef HIDE_INDICATOR // For testing.
#define TEST_MOUSE_EVENT
static bool _destory_slideshow_and_ug(Ivug_MainView *pMainView, int state, bool bMmc_out);
static void _on_slideshow_finished(void *data, Evas_Object *obj, void *event_info);
-static void _update_title(Ivug_MainView *pMainView)
+void _update_title(Ivug_MainView *pMainView)
{
#define MAX_TITLE_LEN 256
Media_Item *ivug_medialist_find_item_by_index(Media_List *mList, int index);
Media_Item * ivug_medialist_find_item_by_filename(Media_List *mList, const char* filepath);
-
+Media_Item *ivug_medialist_append_item(Media_List *mList, const char *filepath);
+Media_Item *ivug_medialist_prepend_item(Media_List *mList, const char *filepath);
#ifdef __cplusplus
}
+Eina_List *ivug_list_append_item(Eina_List *list, const char *filepath)
+{
+ Media_Data *mData = ivug_alloc_mediadata_from_filepath(filepath);
+
+ list = eina_list_append(list, mData);
+ return list;
+}
+
+Eina_List *ivug_list_prepend_item(Eina_List *list, const char *filepath)
+{
+ Media_Data *mData = ivug_alloc_mediadata_from_filepath(filepath);
+
+ list = eina_list_prepend(list, mData);
+ return list;
+}
Eina_List *ivug_list_load_dir_items(const char *basedir);
+Eina_List *ivug_list_append_item(Eina_List *list, const char *filepath);
+
+Eina_List *ivug_list_prepend_item(Eina_List *list, const char *filepath);
#ifdef __cplusplus
}
return NULL;
}
+Media_Item * ivug_medialist_append_item(Media_List *mList, const char *filepath)
+{
+ IV_ASSERT(mList != NULL);
+
+ _Media_List *_mList = (_Media_List *)mList;
+
+ _mList->header = ivug_list_append_item(_mList->header, filepath);
+
+ _mList->count++;
+
+ int index = 0;
+ Eina_List *l;
+ Media_Data *data;
+ EINA_LIST_FOREACH(_mList->header, l, data)
+ {
+ data->index = index++;
+ }
+
+ return (Media_Item *)eina_list_last(_mList->header);
+}
+
+Media_Item * ivug_medialist_prepend_item(Media_List *mList, const char *filepath)
+{
+ IV_ASSERT(mList != NULL);
+
+ _Media_List *_mList = (_Media_List *)mList;
+
+ _mList->header = ivug_list_prepend_item(_mList->header, filepath);
+
+ _mList->count++;
+
+ int index = 0;
+ Eina_List *l;
+ Media_Data *data;
+ EINA_LIST_FOREACH(_mList->header, l, data)
+ {
+ data->index = index++;
+ }
+
+ return (Media_Item *)_mList->header;
+}