From 529d58a41008941155692e7f187a87de49e4f4d5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 May 2013 08:27:54 +0100 Subject: [PATCH] e_fm2_optimal_size_calc now returns a bool to indicate whether the returned size can be used --- ChangeLog | 4 ++++ NEWS | 1 + src/bin/e_fm.c | 10 ++++++---- src/bin/e_fm.h | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c89eb7846..7d389d196 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-05-08 Mike Blumenkrantz + + * e_fm2_optimal_size_calc returns bool to indicate whether the returned size can be used + 2013-04-26 Mike Blumenkrantz * fixed theme bug which prevented windows from unshading correctly when animations were disabled diff --git a/NEWS b/NEWS index 9fede1c42..612440d3f 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,7 @@ Changes: * E_FN_DEL renamed to E_FREE_FUNC for consistency * deskpreview renamed to bgpreview * e_widget_bgpreview_desk_add now takes an evas instead of an evas object + * e_fm2_optimal_size_calc returns bool to indicate whether the returned size can be used Config: * move winlist_warp_speed option to pointer_warp_speed * bindings now use new E_Binding_Event structs for mouse events diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index 59711537d..38ad1b4cd 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -11411,12 +11411,13 @@ e_fm2_operation_abort(int id) e_fm2_op_registry_entry_unref(ere); } -EAPI void +EAPI Eina_Bool e_fm2_optimal_size_calc(Evas_Object *obj, int maxw, int maxh, int *w, int *h) { int x, y, minw, minh; - EFM_SMART_CHECK(); - if ((!w) || (!h)) return; + EFM_SMART_CHECK(EINA_FALSE); + if ((!w) || (!h)) return EINA_FALSE; + if (!sd->icons) return EINA_FALSE; if (maxw < 0) maxw = 0; if (maxh < 0) maxh = 0; minw = sd->min.w + 5, minh = sd->min.h + 5; @@ -11425,7 +11426,7 @@ e_fm2_optimal_size_calc(Evas_Object *obj, int maxw, int maxh, int *w, int *h) case E_FM2_VIEW_MODE_LIST: *w = MIN(minw, maxw); *h = MIN(minh * eina_list_count(sd->icons), (unsigned int)maxh); - return; + return EINA_TRUE; default: break; @@ -11440,6 +11441,7 @@ e_fm2_optimal_size_calc(Evas_Object *obj, int maxw, int maxh, int *w, int *h) *w = MIN(*w, maxw); *h = minh * y; *h = MIN(*h, maxh); + return EINA_TRUE; } EAPI E_Fm2_View_Mode diff --git a/src/bin/e_fm.h b/src/bin/e_fm.h index 4b01968c7..ed6642134 100644 --- a/src/bin/e_fm.h +++ b/src/bin/e_fm.h @@ -203,7 +203,7 @@ EAPI void e_fm2_overlay_clip_to(Evas_Object *fm, Evas_Object *clip); EAPI void e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e); EAPI void e_fm2_client_del(Ecore_Ipc_Event_Client_Del *e); EAPI E_Fm2_View_Mode e_fm2_view_mode_get(Evas_Object *obj); -EAPI void e_fm2_optimal_size_calc(Evas_Object *obj, int maxw, int maxh, int *w, int *h); +EAPI Eina_Bool e_fm2_optimal_size_calc(Evas_Object *obj, int maxw, int maxh, int *w, int *h); EAPI const char *e_fm2_real_path_map(const char *dev, const char *path); EAPI void e_fm2_favorites_init(void); EAPI unsigned int e_fm2_selected_count(Evas_Object *obj);