forked from enlightenment/efl
Added generic functions to fetch geometry, border width
and depth for a drawable, and wrapper functions for windows and pixmaps (overrides previous commit) SVN revision: 9069
This commit is contained in:
parent
d4a727c911
commit
be56b5d25a
|
@ -733,6 +733,8 @@ void ecore_x_window_lower(Ecore_X_Window win);
|
|||
void ecore_x_window_reparent(Ecore_X_Window win, Ecore_X_Window new_parent, int x, int y);
|
||||
void ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h);
|
||||
void ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h);
|
||||
int ecore_x_window_border_size_get(Ecore_X_Window win);
|
||||
int ecore_x_window_depth_get(Ecore_X_Window win);
|
||||
void ecore_x_window_cursor_show(Ecore_X_Window win, int show);
|
||||
void ecore_x_window_defaults_set(Ecore_X_Window win);
|
||||
|
||||
|
@ -794,6 +796,8 @@ void ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixma
|
|||
Ecore_X_Pixmap ecore_x_pixmap_new(Ecore_X_Window win, int w, int h, int dep);
|
||||
void ecore_x_pixmap_del(Ecore_X_Pixmap pmap);
|
||||
void ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, Ecore_X_Drawable dest, Ecore_X_GC gc, int sx, int sy, int w, int h, int dx, int dy);
|
||||
void ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap, int *x, int *y, int *w, int *h);
|
||||
int ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap);
|
||||
|
||||
Ecore_X_GC ecore_x_gc_new(Ecore_X_Drawable draw);
|
||||
void ecore_x_gc_del(Ecore_X_GC gc);
|
||||
|
@ -801,7 +805,9 @@ void ecore_x_gc_del(Ecore_X_GC gc);
|
|||
|
||||
|
||||
/* FIXME: these funcs need categorising */
|
||||
|
||||
void ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int *x, int *y, int *w, int *h);
|
||||
int ecore_x_drawable_border_width_get(Ecore_X_Drawable d);
|
||||
int ecore_x_drawable_depth_get(Ecore_X_Drawable d);
|
||||
Ecore_X_Window *ecore_x_window_root_list(int *num_ret);
|
||||
int ecore_x_window_manage(Ecore_X_Window win);
|
||||
void ecore_x_window_container_manage(Ecore_X_Window win);
|
||||
|
|
|
@ -746,6 +746,56 @@ _ecore_x_event_filter_end(void *data, void *loop_data)
|
|||
/* FIXME: these funcs need categorising */
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
Window dummy_win;
|
||||
int ret_x, ret_y;
|
||||
unsigned int ret_w, ret_h, dummy_border, dummy_depth;
|
||||
|
||||
if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &ret_x, &ret_y,
|
||||
&ret_w, &ret_h, &dummy_border, &dummy_depth))
|
||||
{
|
||||
ret_x = 0;
|
||||
ret_y = 0;
|
||||
ret_w = 0;
|
||||
ret_h = 0;
|
||||
}
|
||||
|
||||
if (x) *x = ret_x;
|
||||
if (y) *y = ret_y;
|
||||
if (w) *w = (int) ret_w;
|
||||
if (h) *h = (int) ret_h;
|
||||
}
|
||||
|
||||
int
|
||||
ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
|
||||
{
|
||||
Window dummy_win;
|
||||
int dummy_x, dummy_y;
|
||||
unsigned int dummy_w, dummy_h, border_ret, dummy_depth;
|
||||
|
||||
if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
|
||||
&dummy_w, &dummy_h, &border_ret, &dummy_depth))
|
||||
border_ret = 0;
|
||||
|
||||
return (int) border_ret;
|
||||
}
|
||||
|
||||
int
|
||||
ecore_x_drawable_depth_get(Ecore_X_Drawable d)
|
||||
{
|
||||
Window dummy_win;
|
||||
int dummy_x, dummy_y;
|
||||
unsigned int dummy_w, dummy_h, dummy_border, depth_ret;
|
||||
|
||||
if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
|
||||
&dummy_w, &dummy_h, &dummy_border, &depth_ret))
|
||||
depth_ret = 0;
|
||||
|
||||
return (int) depth_ret;
|
||||
}
|
||||
|
||||
Ecore_X_Window *
|
||||
ecore_x_window_root_list(int *num_ret)
|
||||
{
|
||||
|
|
|
@ -38,3 +38,27 @@ ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, Ecore_X_Drawable dest,
|
|||
{
|
||||
XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy);
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
void
|
||||
ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
if (pmap)
|
||||
ecore_x_drawable_geometry_get(pmap, x, y, w, h);
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
int
|
||||
ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap)
|
||||
{
|
||||
return ecore_x_drawable_depth_get(pmap);
|
||||
}
|
||||
|
||||
|
|
|
@ -366,21 +366,12 @@ ecore_x_window_reparent(Ecore_X_Window win, Ecore_X_Window new_parent, int x, in
|
|||
void
|
||||
ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h)
|
||||
{
|
||||
Window dummy_win;
|
||||
int dummy_x, dummy_y;
|
||||
unsigned int ret_w, ret_h, dummy_border, dummy_depth;
|
||||
|
||||
if (win == 0) win = DefaultRootWindow(_ecore_x_disp);
|
||||
ret_w = 0;
|
||||
ret_h = 0;
|
||||
if (!XGetGeometry(_ecore_x_disp, win, &dummy_win, &dummy_x, &dummy_y,
|
||||
&ret_w, &ret_h, &dummy_border, &dummy_depth))
|
||||
{
|
||||
ret_w = 0;
|
||||
ret_h = 0;
|
||||
}
|
||||
if (w) *w = (int)ret_w;
|
||||
if (h) *h = (int)ret_h;
|
||||
if (win == 0)
|
||||
win = DefaultRootWindow(_ecore_x_disp);
|
||||
|
||||
ecore_x_drawable_geometry_get(win, &dummy_x, &dummy_y, w, h);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -391,29 +382,34 @@ ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h)
|
|||
void
|
||||
ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
Window dummy_win;
|
||||
int ret_x, ret_y;
|
||||
unsigned int ret_w, ret_h, dummy_border, dummy_depth;
|
||||
|
||||
if (!win)
|
||||
win = DefaultRootWindow(_ecore_x_disp);
|
||||
ret_w = 0;
|
||||
ret_h = 0;
|
||||
if (!XGetGeometry(_ecore_x_disp, win, &dummy_win, &ret_x, &ret_y,
|
||||
&ret_w, &ret_h, &dummy_border, &dummy_depth))
|
||||
{
|
||||
ret_x = 0;
|
||||
ret_y = 0;
|
||||
ret_w = 0;
|
||||
ret_h = 0;
|
||||
}
|
||||
|
||||
if (x) *x = ret_x;
|
||||
if (y) *y = ret_y;
|
||||
if (w) *w = (int) ret_w;
|
||||
if (h) *h = (int) ret_h;
|
||||
ecore_x_drawable_geometry_get(win, x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
int
|
||||
ecore_x_window_border_width_get(Ecore_X_Window win)
|
||||
{
|
||||
return ecore_x_drawable_border_width_get(win);
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
* FIXME: To be fixed.
|
||||
*/
|
||||
int
|
||||
ecore_x_window_depth_get(Ecore_X_Window win)
|
||||
{
|
||||
return ecore_x_drawable_depth_get(win);
|
||||
}
|
||||
|
||||
/**
|
||||
* To be documented.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue