From 44b62de0b65b62264e65be5d0b22b259e68ebbd2 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 16 Jan 2013 08:41:34 +0000 Subject: [PATCH] Add monitor function to return geometry of the actual frame object. Signed-off-by: Christopher Michael SVN revision: 82866 --- src/modules/conf_randr/e_smart_monitor.c | 17 +++++++++++++++++ src/modules/conf_randr/e_smart_monitor.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 0645e9c3c..53b821beb 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -825,6 +825,23 @@ e_smart_monitor_drop_zone_set(Evas_Object *obj, Eina_Bool can_drop) edje_object_signal_emit(sd->o_frame, "e,state,drop,off", "e"); } +void +e_smart_monitor_frame_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +{ + E_Smart_Data *sd; + Evas_Coord fx = 0, fy = 0, fw = 0, fh = 0; + + /* try to get the objects smart data */ + if (!(sd = evas_object_smart_data_get(obj))) return; + + /* get the geometry of the frame */ + evas_object_geometry_get(sd->o_frame, &fx, &fy, &fw, &fh); + if (x) *x = fx; + if (y) *y = fy; + if (w) *w = fw; + if (h) *h = fh; +} + /* local functions */ static void _e_smart_add(Evas_Object *obj) diff --git a/src/modules/conf_randr/e_smart_monitor.h b/src/modules/conf_randr/e_smart_monitor.h index 295d47a5f..24f622e42 100644 --- a/src/modules/conf_randr/e_smart_monitor.h +++ b/src/modules/conf_randr/e_smart_monitor.h @@ -37,6 +37,7 @@ void e_smart_monitor_clone_add(Evas_Object *obj, Evas_Object *mon); void e_smart_monitor_clone_del(Evas_Object *obj, Evas_Object *mon); void e_smart_monitor_cloned_set(Evas_Object *obj, Eina_Bool cloned); void e_smart_monitor_drop_zone_set(Evas_Object *obj, Eina_Bool can_drop); +void e_smart_monitor_frame_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); # endif #endif