Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_evas Modified Files: Ecore_Evas.h ecore_evas.c ecore_evas_buffer.c ecore_evas_directfb.c ecore_evas_fb.c ecore_evas_private.h ecore_evas_x.c Log Message: allow managed co-ords to be set directly - for internal wm use :) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Ecore_Evas.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- Ecore_Evas.h 24 Oct 2005 10:42:20 -0000 1.16 +++ Ecore_Evas.h 3 Nov 2005 11:32:59 -0000 1.17 @@ -130,6 +130,7 @@ EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); EAPI Evas *ecore_evas_get(Ecore_Evas *ee); EAPI void ecore_evas_move(Ecore_Evas *ee, int x, int y); +EAPI void ecore_evas_managed_move(Ecore_Evas *ee, int x, int y); EAPI void ecore_evas_resize(Ecore_Evas *ee, int w, int h); EAPI void ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h); EAPI void ecore_evas_geometry_get(Ecore_Evas *ee, int *x, int *y, int *w, int *h); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ecore_evas.c 31 Oct 2005 06:21:40 -0000 1.24 +++ ecore_evas.c 3 Nov 2005 11:32:59 -0000 1.25 @@ -473,6 +473,27 @@ } /** + * Provide Managed move co-ordinates for an Ecore_Evas + * @param ee The Ecore_Evas to move + * @param x The x coordinate to set as the managed location + * @param y The y coordinate to set as the managed location + * + * This sets the managed geometry position of the @p ee to (@p x, @p y) + */ +void +ecore_evas_managed_move(Ecore_Evas *ee, int x, int y) +{ + if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) + { + ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, + "ecore_evas_move"); + return; + } + IFC(ee, fn_managed_move) (ee, x, y); + IFE; +} + +/** * Resize an Ecore_Evas * @param ee The Ecore_Evas to move * @param w The w coordinate to resize to =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_buffer.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ecore_evas_buffer.c 30 Aug 2005 10:05:27 -0000 1.7 +++ ecore_evas_buffer.c 3 Nov 2005 11:32:59 -0000 1.8 @@ -390,6 +390,7 @@ NULL, NULL, NULL, + NULL, _ecore_evas_resize, NULL, NULL, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_directfb.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_evas_directfb.c 15 Oct 2005 10:37:37 -0000 1.1 +++ ecore_evas_directfb.c 3 Nov 2005 11:32:59 -0000 1.2 @@ -507,6 +507,7 @@ NULL, /* cb pre render */ NULL, /* cb post render */ _ecore_evas_directfb_move, /* move */ + NULL, /* managed move */ _ecore_evas_directfb_resize, /* resize */ NULL, /* move resize */ NULL,//_ecore_evas_directfb_rotation_set,/* rotation */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_fb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ecore_evas_fb.c 30 Aug 2005 10:05:27 -0000 1.14 +++ ecore_evas_fb.c 3 Nov 2005 11:32:59 -0000 1.15 @@ -433,6 +433,7 @@ NULL, NULL, NULL, + NULL, _ecore_evas_resize, _ecore_evas_move_resize, _ecore_evas_rotation_set, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_private.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ecore_evas_private.h 15 Oct 2005 10:37:37 -0000 1.19 +++ ecore_evas_private.h 3 Nov 2005 11:32:59 -0000 1.20 @@ -65,6 +65,7 @@ void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); void (*fn_move) (Ecore_Evas *ee, int x, int y); + void (*fn_managed_move) (Ecore_Evas *ee, int x, int y); void (*fn_resize) (Ecore_Evas *ee, int w, int h); void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h); void (*fn_rotation_set) (Ecore_Evas *ee, int rot); @@ -109,6 +110,7 @@ Region damages; unsigned char direct_resize : 1; unsigned char using_bg_pixmap : 1; + unsigned char managed : 1; struct { /* unsigned char modal : 1; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_x.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -3 -r1.66 -r1.67 --- ecore_evas_x.c 3 Nov 2005 06:16:40 -0000 1.66 +++ ecore_evas_x.c 3 Nov 2005 11:32:59 -0000 1.67 @@ -978,28 +978,59 @@ static void _ecore_evas_x_move(Ecore_Evas *ee, int x, int y) { - ecore_x_window_move(ee->engine.x.win_container, x, y); - if (!ee->should_be_visible) + if (ee->engine.x.direct_resize) { - /* We need to request pos */ - ee->prop.request_pos = 1; - _ecore_evas_x_size_pos_hints_update(ee); + if (!ee->engine.x.managed) + { + if ((x != ee->x) || (y != ee->y)) + { + ecore_x_window_move(ee->engine.x.win_container, x, y); + if (!ee->should_be_visible) + { + /* We need to request pos */ + ee->prop.request_pos = 1; + _ecore_evas_x_size_pos_hints_update(ee); + } + if (ee->func.fn_move) ee->func.fn_move(ee); + } + } } + else + { + ecore_x_window_move(ee->engine.x.win_container, x, y); + if (!ee->should_be_visible) + { + /* We need to request pos */ + ee->prop.request_pos = 1; + _ecore_evas_x_size_pos_hints_update(ee); + } + } +} + +static void +_ecore_evas_x_managed_move(Ecore_Evas *ee, int x, int y) +{ if (ee->engine.x.direct_resize) { - if (ee->func.fn_move) ee->func.fn_move(ee); + ee->engine.x.managed = 1; + if ((x != ee->x) || (y != ee->y)) + { + ee->x = x; + ee->y = y; + if (ee->func.fn_move) ee->func.fn_move(ee); + } } } static void _ecore_evas_x_resize(Ecore_Evas *ee, int w, int h) { - ecore_x_window_resize(ee->engine.x.win_container, w, h); if (ee->engine.x.direct_resize) { - ecore_x_window_move_resize(ee->engine.x.win, 0, 0, w, h); if ((ee->w != w) || (ee->h != h)) { + ecore_x_window_resize(ee->engine.x.win_container, w, h); + ecore_x_window_move_resize(ee->engine.x.win, 0, 0, w, h); ee->w = w; ee->h = h; if ((ee->rotation == 90) || (ee->rotation == 270)) @@ -1021,20 +1052,34 @@ { _ecore_evas_x_resize_shape(ee); } + if (ee->func.fn_resize) ee->func.fn_resize(ee); } - if (ee->func.fn_resize) ee->func.fn_resize(ee); } + else + ecore_x_window_resize(ee->engine.x.win_container, w, h); } static void _ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h) { - ecore_x_window_move_resize(ee->engine.x.win_container, x, y, w, h); if (ee->engine.x.direct_resize) { - ecore_x_window_move_resize(ee->engine.x.win, 0, 0, w, h); - if ((ee->w != w) || (ee->h != h)) + if ((ee->w != w) || (ee->h != h) || (x != ee->x) || (y != ee->y)) { + int change_size = 0, change_pos = 0; + + if ((ee->w != w) || (ee->h != h)) change_size = 1; + if (!ee->engine.x.managed) + { + if ((x != ee->x) || (y != ee->y)) change_pos = 1; + } + ecore_x_window_move_resize(ee->engine.x.win_container, x, y, w, h); + ecore_x_window_move_resize(ee->engine.x.win, 0, 0, w, h); + if (!ee->engine.x.managed) + { + ee->x = x; + ee->y = y; + } ee->w = w; ee->h = h; if ((ee->rotation == 90) || (ee->rotation == 270)) @@ -1056,10 +1101,18 @@ { _ecore_evas_x_resize_shape(ee); } + if (change_pos) + { + if (ee->func.fn_move) ee->func.fn_move(ee); + } + if (change_size) + { + if (ee->func.fn_resize) ee->func.fn_resize(ee); + } } - if (ee->func.fn_move) ee->func.fn_move(ee); - if (ee->func.fn_resize) ee->func.fn_resize(ee); } + else + ecore_x_window_move_resize(ee->engine.x.win_container, x, y, w, h); } static void @@ -1697,6 +1750,7 @@ NULL, NULL, _ecore_evas_x_move, + _ecore_evas_x_managed_move, _ecore_evas_x_resize, _ecore_evas_x_move_resize, _ecore_evas_x_rotation_set, ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs