From 61f9ae172faa23458a4c6a0f59350bf77e67979a Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 14 Mar 2008 12:54:35 +0100 Subject: [PATCH] Add simplewindow_resize() function --- common/swindow.c | 14 ++++++++++++++ common/swindow.h | 1 + 2 files changed, 15 insertions(+) diff --git a/common/swindow.c b/common/swindow.c index 0ae2b1ae2..fde9c7358 100644 --- a/common/swindow.c +++ b/common/swindow.c @@ -96,6 +96,20 @@ simplewindow_move(SimpleWindow *sw, int x, int y) return XMoveWindow(sw->display, sw->window, x, y); } +/** Resize a simple window + * \param sw the SimpleWindow to resize + * \param w new width + * \param h new height + * \return status + */ +int +simplewindow_resize(SimpleWindow *sw, unsigned int w, unsigned int h) +{ + sw->geometry.width = w; + sw->geometry.height = h; + return XResizeWindow(sw->display, sw->window, w, h); +} + /** Refresh the window content * \param sw the SimpleWindow to refresh * \param phys_screen physical screen id diff --git a/common/swindow.h b/common/swindow.h index fede59e84..679c66d40 100644 --- a/common/swindow.h +++ b/common/swindow.h @@ -36,6 +36,7 @@ typedef struct SimpleWindow SimpleWindow * simplewindow_new(Display *, int, int, int, unsigned int, unsigned int, unsigned int); void simplewindow_delete(SimpleWindow *); int simplewindow_move(SimpleWindow *, int, int); +int simplewindow_resize(SimpleWindow *, unsigned int, unsigned int); int simplewindow_refresh_drawable(SimpleWindow *, int); #endif