forked from enlightenment/enlightenment
add an intercept function for e_border to allow adjustments for movement of borders
SVN revision: 73363
This commit is contained in:
parent
75b80031eb
commit
09e526e2ba
|
@ -1303,8 +1303,14 @@ _e_border_move_internal(E_Border *bd,
|
|||
x -= bd->client_inset.l;
|
||||
y -= bd->client_inset.t;
|
||||
}
|
||||
|
||||
if ((x == bd->x) && (y == bd->y)) return;
|
||||
if (bd->move_intercept_cb)
|
||||
{
|
||||
int px, py;
|
||||
px = bd->x, py = bd->y;
|
||||
bd->move_intercept_cb(bd, x, y);
|
||||
if ((bd->x == px) && (bd->y == py)) return;
|
||||
}
|
||||
else if ((x == bd->x) && (y == bd->y)) return;
|
||||
bd->pre_res_change.valid = 0;
|
||||
bd->x = x;
|
||||
bd->y = y;
|
||||
|
@ -1351,6 +1357,17 @@ e_border_move(E_Border *bd,
|
|||
_e_border_move_internal(bd, x, y, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a callback which will be called just prior to updating the
|
||||
* move coordinates for a border
|
||||
*/
|
||||
EAPI void
|
||||
e_border_move_intercept_cb_set(E_Border *bd, E_Border_Move_Intercept_Cb cb)
|
||||
{
|
||||
bd->move_intercept_cb = cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move window to coordinates that do not account border decorations yet.
|
||||
*
|
||||
|
|
|
@ -124,7 +124,7 @@ typedef struct _E_Event_Border_Simple E_Event_Border_Focus_Out;
|
|||
typedef struct _E_Event_Border_Simple E_Event_Border_Property;
|
||||
typedef struct _E_Event_Border_Simple E_Event_Border_Fullscreen;
|
||||
typedef struct _E_Event_Border_Simple E_Event_Border_Unfullscreen;
|
||||
|
||||
typedef void (*E_Border_Move_Intercept_Cb)(E_Border *, int x, int y);
|
||||
#else
|
||||
#ifndef E_BORDER_H
|
||||
#define E_BORDER_H
|
||||
|
@ -564,6 +564,7 @@ struct _E_Border
|
|||
Ecore_Timer *raise_timer;
|
||||
Ecore_Poller *ping_poller;
|
||||
Ecore_Timer *kill_timer;
|
||||
E_Border_Move_Intercept_Cb move_intercept_cb;
|
||||
int shape_rects_num;
|
||||
Ecore_X_Rectangle *shape_rects;
|
||||
E_Remember *remember;
|
||||
|
@ -647,6 +648,7 @@ EAPI void e_border_desk_set(E_Border *bd, E_Desk *desk);
|
|||
EAPI void e_border_show(E_Border *bd);
|
||||
EAPI void e_border_hide(E_Border *bd, int manage);
|
||||
EAPI void e_border_move(E_Border *bd, int x, int y);
|
||||
EAPI void e_border_move_intercept_cb_set(E_Border *bd, E_Border_Move_Intercept_Cb cb);
|
||||
EAPI void e_border_move_without_border(E_Border *bd, int x, int y);
|
||||
EAPI void e_border_center(E_Border *bd);
|
||||
EAPI void e_border_center_pos_get(E_Border *bd, int *x, int *y);
|
||||
|
|
Loading…
Reference in New Issue