// Called by main_view
Ivug_SetAsView *
-ivug_setas_view_screen_create(Evas_Object *parent, const char* filepath, ivug_setas_mode mode, ivug_set_screen_type screen_type);
+ivug_setas_view_screen_create(Evas_Object *parent, ivug_setas_mode mode, ivug_set_screen_type screen_type);
void ivug_setas_view_create_menu(Ivug_SetAsView *pSetAsView, Evas_Object *navi_bar, ivug_set_screen_type type);
-#if 0
-Ivug_SetAsView *
-ivug_setas_view_add(Evas_Object *parent);
-
-void
-ivug_setas_view_source_file_set(Ivug_SetAsView *pSetAsView, const char* filepath);
-
-void
-ivug_setas_view_mode_set(Ivug_SetAsView *pSetAsView, ivug_set_screen_type screen_type);
-#endif
+void ivug_setas_view_load_file(Ivug_SetAsView *pSetAsView, const char* filepath, ivug_set_screen_type type);
#ifdef __cplusplus
}
else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER)
{
type = IVUG_CTRLBAR_SET_SCREEN_HOME;
- ugd->setas_view = ivug_setas_view_screen_create(ugd->base, ugd->ivug_param->filepath,
- setas_mode, type);
+ ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
}
else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_LOCKSCREEN)
{
type = IVUG_CTRLBAR_SET_SCREEN_LOCK;
- ugd->setas_view = ivug_setas_view_screen_create(ugd->base, ugd->ivug_param->filepath,
- setas_mode, type);
+ ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
}
else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER_N_LOCKSCREEN)
{
type = IVUG_CTRLBAR_SET_SCREEN_BOTH;
- ugd->setas_view = ivug_setas_view_screen_create(ugd->base, ugd->ivug_param->filepath,
- setas_mode, type);
+ ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
}
else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER_CROP)
{
type = IVUG_CTRLBAR_SET_SCREEN_HOME;
setas_mode = IVUG_SETAS_CROP;
- ugd->setas_view = ivug_setas_view_screen_create(ugd->base, ugd->ivug_param->filepath,
- setas_mode, type);
+ ugd->setas_view = ivug_setas_view_screen_create(ugd->base, setas_mode, type);
}
else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_CROP)
{
ivug_setas_view_create_menu(ugd->setas_view, ugd->navi_bar, type);
+ ivug_setas_view_load_file(ugd->setas_view, ugd->ivug_param->filepath, type);
+
//layout = ivug_setas_view_object_get(ugd->setas_view);
layout = ugd->navi_bar;
}
static void _create_setas_view(Ivug_MainView *pMainView, const char *filepath, ivug_set_screen_type type)
{
- pMainView->pSetAsView = ivug_setas_view_screen_create(pMainView->layout, filepath,
- IVUG_SETAS_NORMAL, type);
+ pMainView->pSetAsView = ivug_setas_view_screen_create(pMainView->layout, IVUG_SETAS_NORMAL, type);
Evas_Object *setasOjbect = ivug_setas_view_object_get(pMainView->pSetAsView);
//evas_object_event_callback_add(setasOjbect, EVAS_CALLBACK_DEL, _on_setasview_deleted, pMainView);
evas_object_smart_callback_add(setasOjbect, "destroy", _on_setas_view_destroyed, pMainView);
NULL, back_btn, NULL, setasOjbect, NULL);
ivug_setas_view_create_menu(pMainView->pSetAsView, pMainView->navi_bar, type);
+
+ ivug_setas_view_load_file(pMainView->pSetAsView, filepath, type);
}
void _on_setas_selected(void *data, Evas_Object *obj, void *event_info)
#define ICON_PATH_SAVE CONTROL_ICON_DIRECTORY_PATH"/T01_controlbar_icon_save.png"
#define ICON_PATH_PREV CONTROL_ICON_DIRECTORY_PATH"/00_winset_btn_prev.png"
+#define CROP_BOX_INTERVAL_TIME 0.3
+
typedef struct {
Evas_Object *layout;
Evas_Object *notify;
Eina_Bool bAspectPreserve;
} crop;
+ Ecore_Timer *box_timer;
} TSetAsData;
int px, py, pw, ph;
ivug_image_region_get(pSetAsData->photocam, &px, &py, &pw, &ph);
+ MSG_SETAS_WARN("region XYWH(%d,%d,%d,%d)", px, py, pw, ph);
+
int ix, iy, iw, ih;
if ( image_w > image_h ) // Landscape image
rect.w = (double)iw * pw / image_w;
rect.h = (double)ih * ph / image_h;
- MSG_SETAS_WARN("Face is not detected. Zoom Put Box in LCD XYWH(%d,%d,%d,%d)",
+ MSG_SETAS_WARN("Zoom Put Box in LCD XYWH(%d,%d,%d,%d)",
rect.x, rect.y, rect.w, rect.h);
ivug_scissorbox_region_set(pSetAsData->crop.box, rect.x, rect.y, rect.w, rect.h);
ivug_scissorbox_attach(pSetAsData->crop.box, image); // Attach to photocam
}
-static void _put_scissorbox(Evas_Object *obj)
+static Eina_Bool _put_scissorbox_timer_cb(void *data)
{
- TSetAsData *pSetAsData = SETAS_DATA(obj);
+ TSetAsData *pSetAsData = SETAS_DATA(data);
- media_handle db_handle = ivug_db_get_file_handle(pSetAsData->filepath);
- if(db_handle == NULL)
- {
- MSG_SETAS_ERROR("Cannot get db handle %s", pSetAsData->filepath);
- _put_scissorbox_default(pSetAsData);
- elm_object_disabled_set(pSetAsData->btn_ok, EINA_FALSE);
- return;
- }
+ pSetAsData->box_timer = NULL;
_put_scissorbox_default(pSetAsData);
+
+ elm_object_disabled_set(pSetAsData->btn_ok, EINA_FALSE);
+
+ return ECORE_CALLBACK_CANCEL;
}
+
static void
_on_btn_ok_clicked(void *data, Evas_Object *obj, void *event_info)
{
MSG_SETAS_HIGH("Photocam loaded.");
- _put_scissorbox(pSetAsData->layout);
+ pSetAsData->box_timer = ecore_timer_add(CROP_BOX_INTERVAL_TIME, _put_scissorbox_timer_cb, (void *)pSetAsData->layout);
evas_object_smart_callback_call(pSetAsData->layout, "loaded", NULL);
pSetAsData->drm_filepath = NULL;
}
+ if(pSetAsData->btn_ok)
+ {
+ evas_object_del(pSetAsData->btn_ok);
+ pSetAsData->btn_ok = NULL;
+ }
+
free(pSetAsData);
}
TSetAsData *pSetAsData = SETAS_DATA(obj);
IV_ASSERT(pSetAsData != NULL);
+ if(pSetAsData->box_timer)
+ {
+ ecore_timer_del(pSetAsData->box_timer);
+ pSetAsData->box_timer = NULL;
+ }
+
if(pSetAsData->photocam)
{
MSG_SETAS_HIGH("Removing photocam");
pSetAsData->drm_filepath = NULL;
}
+ if(pSetAsData->btn_ok)
+ {
+ evas_object_del(pSetAsData->btn_ok);
+ pSetAsData->btn_ok = NULL;
+ }
+
free(pSetAsData);
return NULL;
evas_object_smart_callback_add(photocam, "loaded", _on_photocam_loaded, (void *)pSetAsData->layout);
elm_object_part_content_set(pSetAsData->layout, "setasview.photocam", photocam);
- evas_object_show(photocam);
- evas_object_smart_member_add(photocam, pSetAsData->layout);
+ evas_object_show(photocam);
pSetAsData->photocam = photocam;
pSetAsData->drm_filepath = NULL;
}
+ if(pSetAsData->btn_ok)
+ {
+ evas_object_del(pSetAsData->btn_ok);
+ pSetAsData->btn_ok = NULL;
+ }
+
free(pSetAsData);
return NULL;
}
Ivug_SetAsView *
-ivug_setas_view_screen_create(Evas_Object *parent, const char* filepath, ivug_setas_mode mode, ivug_set_screen_type screen_type)
+ivug_setas_view_screen_create(Evas_Object *parent, ivug_setas_mode mode, ivug_set_screen_type screen_type)
{
Ivug_SetAsView *pSetAsView = NULL;
evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_SHOW, _on_setas_show, pSetAsView);
evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_HIDE, _on_setas_hide, pSetAsView);
- _ivug_setas_load_file(pSetAsView->content , filepath);
-
return pSetAsView;
}
evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_SHOW, _on_setas_show, pSetAsView);
evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_HIDE, _on_setas_hide, pSetAsView);
- _ivug_setas_callerid_load_file(pSetAsView->content, filepath);
_ivug_setas_callerid_aspect_ratio_set(pSetAsView->content, (double)output_height/output_width);
return pSetAsView;
evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_SHOW, _on_setas_show, pSetAsView);
evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_HIDE, _on_setas_hide, pSetAsView);
- _ivug_setas_callerid_load_file(pSetAsView->content , filepath);
_ivug_setas_callerid_aspect_ratio_set(pSetAsView->content , (double)output_height/output_width);
-
-
return pSetAsView;
}
}
}
+void ivug_setas_view_load_file(Ivug_SetAsView *pSetAsView, const char* filepath, ivug_set_screen_type type)
+{
+ MSG_SETAS_HIGH("ivug_setas_view_load_file %s", filepath);
+
+ if(type == IVUG_CTRLBAR_SET_SCREEN_CALLERID
+ || type == IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID)
+ {
+ _ivug_setas_callerid_load_file(pSetAsView->content , filepath);
+ }
+ else
+ {
+ _ivug_setas_load_file(pSetAsView->content , filepath);
+ }
+}
+