allow managed co-ords to be set directly - for internal wm use :)

SVN revision: 18242
This commit is contained in:
Carsten Haitzler 2005-11-03 11:32:59 +00:00
parent 1e890273c9
commit f9a5f37623
7 changed files with 97 additions and 16 deletions

View File

@ -130,6 +130,7 @@ EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func)
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);

View File

@ -472,6 +472,27 @@ ecore_evas_move(Ecore_Evas *ee, int x, int y)
IFE;
}
/**
* 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

View File

@ -390,6 +390,7 @@ static const Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
NULL,
NULL,
NULL,
NULL,
_ecore_evas_resize,
NULL,
NULL,

View File

@ -507,6 +507,7 @@ static const Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
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 */

View File

@ -433,6 +433,7 @@ static const Ecore_Evas_Engine_Func _ecore_fb_engine_func =
NULL,
NULL,
NULL,
NULL,
_ecore_evas_resize,
_ecore_evas_move_resize,
_ecore_evas_rotation_set,

View File

@ -65,6 +65,7 @@ struct _Ecore_Evas_Engine_Func
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 @@ struct _Ecore_Evas_Engine
Region damages;
unsigned char direct_resize : 1;
unsigned char using_bg_pixmap : 1;
unsigned char managed : 1;
struct {
/*
unsigned char modal : 1;

View File

@ -978,28 +978,59 @@ _ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Ev
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)
{
/* We need to request pos */
ee->prop.request_pos = 1;
_ecore_evas_x_size_pos_hints_update(ee);
}
if (ee->engine.x.direct_resize)
{
if (ee->func.fn_move) ee->func.fn_move(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)
{
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(Ecore_Evas *ee, int w, int h)
{
_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_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
{
_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 @@ static const Ecore_Evas_Engine_Func _ecore_x_engine_func =
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,