more calls :)

SVN revision: 3834
This commit is contained in:
Carsten Haitzler 2000-11-09 23:49:50 +00:00
parent 51f0972f8d
commit af1ac0ce02
2 changed files with 56 additions and 0 deletions

View File

@ -219,6 +219,7 @@ void e_dnd_set_mode_ask(void);
void e_dnd_own_selection(Window win);
void e_dnd_send_drop(Window win, Window source_win);
void e_window_gravity_reset(Window win);
void e_window_gravity_set(Window win, int gravity);
void e_pointer_warp_by(int dx, int dy);
void e_pointer_warp_to(int x, int y);
void e_gc_set_include_inferiors(GC gc);
@ -229,6 +230,7 @@ void e_window_get_virtual_area(Window win, int *area_x,
int *area_y);
void e_get_virtual_area(int *area_x, int *area_y);
void e_window_get_root_relative_location(Window win, int *x, int *y);
typedef struct _eev Eevent;
typedef struct _ev_fd_handler Ev_Fd_Handler;

View File

@ -2218,6 +2218,15 @@ e_window_gravity_reset(Window win)
XChangeWindowAttributes(disp, win, CWWinGravity, &att);
}
void
e_window_gravity_set(Window win, int gravity)
{
XSetWindowAttributes att;
att.win_gravity = gravity;
XChangeWindowAttributes(disp, win, CWWinGravity, &att);
}
void
e_pointer_warp_by(int dx, int dy)
{
@ -2297,3 +2306,48 @@ e_get_virtual_area(int *area_x, int *area_y)
FREE(data);
}
}
void
e_window_get_root_relative_location(Window win, int *x, int *y)
{
int dx, dy;
Window parent;
E_XID *xid = NULL;
if (win == 0)
win = default_root;
if (win == default_root)
{
if (x) *x = 0;
if (y) *y = 0;
return;
}
xid = e_validate_xid(win);
if (!xid)
{
if (x) *x = 0;
if (y) *y = 0;
return;
}
dx = 0;
dy = 0;
do
{
parent = xid->parent;
dx += xid->x;
dy += xid->y;
if (parent != default_root)
{
xid = e_validate_xid(parent);
if (!xid)
{
if (x) *x = dx;
if (y) *y = dy;
return;
}
}
}
while (parent != default_root);
if (x) *x = dx;
if (y) *y = dy;
}