[swindow] Free GC, make refresh inline

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-09 20:16:16 +02:00
parent baa9525c70
commit 70d26b5b36
2 changed files with 14 additions and 14 deletions

View File

@ -87,6 +87,7 @@ simplewindow_delete(simple_window_t **sw)
{
xcb_destroy_window((*sw)->connection, (*sw)->window);
xcb_free_pixmap((*sw)->connection, (*sw)->drawable);
xcb_free_gc((*sw)->connection, (*sw)->gc);
p_delete(sw);
}
@ -128,17 +129,4 @@ simplewindow_resize(simple_window_t *sw, unsigned int w, unsigned int h)
resize_win_vals);
}
/** Refresh the window content
* \param sw the simple_window_t to refresh
* \param phys_screen physical screen id
*/
void
simplewindow_refresh_drawable(simple_window_t *sw)
{
xcb_copy_area(sw->connection, sw->drawable,
sw->window, sw->gc, 0, 0, 0, 0,
sw->geometry.width,
sw->geometry.height);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -39,7 +39,6 @@ simple_window_t * simplewindow_new(xcb_connection_t *, int, int, int, unsigned i
void simplewindow_delete(simple_window_t **);
void simplewindow_move(simple_window_t *, int, int);
void simplewindow_resize(simple_window_t *, unsigned int, unsigned int);
void simplewindow_refresh_drawable(simple_window_t *);
static inline void
simplewindow_move_resize(simple_window_t *sw, int x, int y,
@ -49,5 +48,18 @@ simplewindow_move_resize(simple_window_t *sw, int x, int y,
simplewindow_resize(sw, w, h);
}
/** Refresh the window content
* \param sw the simple_window_t to refresh
* \param phys_screen physical screen id
*/
static inline void
simplewindow_refresh_drawable(simple_window_t *sw)
{
xcb_copy_area(sw->connection, sw->drawable,
sw->window, sw->gc, 0, 0, 0, 0,
sw->geometry.width,
sw->geometry.height);
}
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80