forked from enlightenment/enlightenment
E (RandR): Add callbacks in randr widget for monitor_rotated and
monitor_moved. Add del hook for when monitor gets deleted so we can cleanup callbacks. Fix monitor smart object to build. SVN revision: 77261
This commit is contained in:
parent
7d6f95bc01
commit
271a21df59
|
@ -965,7 +965,7 @@ _e_smart_monitor_rotate_snap(Evas_Object *obj)
|
|||
|
||||
/* tell randr widget we rotated this monitor so that it can
|
||||
* update the layout for any monitors around this one */
|
||||
evas_object_smart_callback_call(mon, "monitor_rotated", NULL);
|
||||
evas_object_smart_callback_call(obj, "monitor_rotated", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -29,6 +29,9 @@ static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
|
|||
static void _e_smart_clip_unset(Evas_Object *obj);
|
||||
static void _e_smart_reconfigure(E_Smart_Data *sd);
|
||||
static void _e_smart_cb_monitor_resized(void *data, Evas_Object *obj, void *event __UNUSED__);
|
||||
static void _e_smart_cb_monitor_rotated(void *data, Evas_Object *obj, void *event __UNUSED__);
|
||||
static void _e_smart_cb_monitor_moved(void *data, Evas_Object *obj, void *event __UNUSED__);
|
||||
static void _e_smart_cb_monitor_deleted(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event __UNUSED__);
|
||||
|
||||
/* public functions */
|
||||
Evas_Object *
|
||||
|
@ -77,6 +80,14 @@ e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon)
|
|||
/* add listeners for when this monitor changes */
|
||||
evas_object_smart_callback_add(mon, "monitor_resized",
|
||||
_e_smart_cb_monitor_resized, sd);
|
||||
evas_object_smart_callback_add(mon, "monitor_rotated",
|
||||
_e_smart_cb_monitor_rotated, sd);
|
||||
evas_object_smart_callback_add(mon, "monitor_moved",
|
||||
_e_smart_cb_monitor_moved, sd);
|
||||
|
||||
/* add listener for when this monitor gets removed */
|
||||
evas_object_event_callback_add(mon, EVAS_CALLBACK_DEL,
|
||||
_e_smart_cb_monitor_deleted, sd);
|
||||
|
||||
/* pack this monitor into the layout */
|
||||
e_layout_pack(sd->o_layout, mon);
|
||||
|
@ -305,3 +316,26 @@ _e_smart_cb_monitor_resized(void *data, Evas_Object *obj, void *event __UNUSED__
|
|||
/* thaw layout to allow redraw */
|
||||
e_layout_thaw(sd->o_layout);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_cb_monitor_rotated(void *data, Evas_Object *obj, void *event __UNUSED__)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_cb_monitor_moved(void *data, Evas_Object *obj, void *event __UNUSED__)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_cb_monitor_deleted(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event __UNUSED__)
|
||||
{
|
||||
evas_object_smart_callback_del(obj, "monitor_resized",
|
||||
_e_smart_cb_monitor_resized);
|
||||
evas_object_smart_callback_del(obj, "monitor_rotated",
|
||||
_e_smart_cb_monitor_rotated);
|
||||
evas_object_smart_callback_del(obj, "monitor_moved",
|
||||
_e_smart_cb_monitor_moved);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue