>From 0c089a63e7b1fae8119ea3b780a47bf1cc582865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 28 Apr 2019 22:39:25 +0200 Subject: [PATCH 5/7] Add x-resize-window!. --- guile-xlib.c | 26 ++++++++++++++++++++++++++ guile-xlib.h | 4 ++++ xlib.scm | 1 + 3 files changed, 31 insertions(+) diff --git a/guile-xlib.c b/guile-xlib.c index d829b22..9df32c1 100644 --- a/guile-xlib.c +++ b/guile-xlib.c @@ -2620,6 +2620,32 @@ SCM_DEFINE (scm_x_window_event_x, "x-window-event!", 2, 1, 0, } #undef FUNC_NAME +SCM_DEFINE (scm_x_resize_window_x, "x-resize-window!", 3, 0, 0, + (SCM window, + SCM width, + SCM height), + "") +#define FUNC_NAME s_scm_x_window_event_x +{ + SCM display1; + xdisplay_t *dsp; + xwindow_t *win; + + display1 = valid_dsp (window, SCM_ARG1, XDISPLAY_STATE_OPEN, FUNC_NAME); + dsp = XDISPLAY (display1); + win = valid_win (window, SCM_ARG1, ~XWINDOW_STATE_DESTROYED, FUNC_NAME); + + XResizeWindow (dsp->dsp, win->win, + scm_to_uint (width), + scm_to_uint (height)); + + return SCM_UNSPECIFIED; +} + +xdisplay_t *get_display (SCM display) { + return XDISPLAY (valid_dsp (display, SCM_ARG1, XDISPLAY_STATE_OPEN, "get_display")); +} + /* INITIALIZATION */ void diff --git a/guile-xlib.h b/guile-xlib.h index 0052b30..862ded9 100644 --- a/guile-xlib.h +++ b/guile-xlib.h @@ -144,6 +144,8 @@ SCM resource_id_hash; #define XDISPLAY(display) ((xdisplay_t *) SCM_SMOB_DATA (display)) #define XSCREEN(screen) ((xscreen_t *) SCM_SMOB_DATA (screen)) +xdisplay_t *get_display (SCM display); + #define XDATA_ARCS 0 #define XDATA_LINES 1 #define XDATA_POINTS 2 @@ -223,6 +225,8 @@ SCM scm_x_peek_event_x (SCM display, SCM event); SCM scm_x_select_input_x (SCM window, SCM mask); SCM scm_x_window_event_x (SCM window, SCM mask, SCM event); +SCM scm_x_resize_window_x (SCM window, SCM width, SCM height); + void init_xlib_core (void); #endif /* GUILE2_XLIB_XLIB_H */ diff --git a/xlib.scm b/xlib.scm index a3fce6d..8510b0a 100644 --- a/xlib.scm +++ b/xlib.scm @@ -42,6 +42,7 @@ x-unmap-window! x-destroy-window! x-clear-window! + x-resize-window! x-clear-area! x-create-pixmap! x-copy-area! -- 2.21.0