From 72e7e23b89f1d05c5009149abce4655fe1567436 Mon Sep 17 00:00:00 2001 From: frese Date: Thu, 19 Jul 2001 15:34:22 +0000 Subject: [PATCH] added Get_Geometry. --- c/xlib/window.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/c/xlib/window.c b/c/xlib/window.c index e7cb74e..595b258 100644 --- a/c/xlib/window.c +++ b/c/xlib/window.c @@ -351,6 +351,28 @@ s48_value Query_Pointer (s48_value Xdisplay, s48_value Xwindow) { return l; } +s48_value Get_Geometry(s48_value Xdisplay, s48_value Xdrawable) { + s48_value v; + Window root; + unsigned int x,y,width,height,border_width,depth; + S48_DECLARE_GC_PROTECT(1); + + XGetGeometry(EXTRACT_DISPLAY(Xdisplay), EXTRACT_DRAWABLE(Xdrawable), + &root, &x, &y, &width, &height, &border_width, &depth); + + v = s48_make_vector(7, S48_FALSE); + S48_GC_PROTECT_1(v); + S48_VECTOR_SET(v, 0, ENTER_WINDOW(root)); + S48_VECTOR_SET(v, 1, s48_enter_integer(x)); + S48_VECTOR_SET(v, 2, s48_enter_integer(y)); + S48_VECTOR_SET(v, 3, s48_enter_integer(width)); + S48_VECTOR_SET(v, 4, s48_enter_integer(height)); + S48_VECTOR_SET(v, 5, s48_enter_integer(border_width)); + S48_VECTOR_SET(v, 6, s48_enter_integer(depth)); + S48_GC_UNPROTECT(); + return v; +} + void s48_init_window(void) { S48_EXPORT_FUNCTION(Create_Window); S48_EXPORT_FUNCTION(Destroy_Window); @@ -366,5 +388,6 @@ void s48_init_window(void) { S48_EXPORT_FUNCTION(Query_Tree); S48_EXPORT_FUNCTION(Translate_Coordinates); S48_EXPORT_FUNCTION(Query_Pointer); + S48_EXPORT_FUNCTION(Get_Geometry); }