From fbe40e33b81782904f487d4c5567f7f245779817 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Thu, 13 Oct 2011 08:09:53 +0000 Subject: [PATCH] Move state to win_t --- sys-win32.c | 5 ++--- sys.h | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys-win32.c b/sys-win32.c index 463b6ff..d6c1c7f 100644 --- a/sys-win32.c +++ b/sys-win32.c @@ -35,7 +35,6 @@ static int NO_CAPTURE = 0; /* Internal structures */ struct win_sys { HWND hwnd; - state_t state; }; typedef struct { @@ -250,7 +249,7 @@ LRESULT CALLBACK ShlProc(int msg, WPARAM wParam, LPARAM lParam) case HSHELL_WINDOWDESTROYED: printf("ShlProc: %p - window destroyed\n", hwnd); if ((win = win_find(hwnd,0)) && - win->sys->state == st_show) { + win->state == st_show) { wm_remove(win); win_remove(win); } @@ -367,7 +366,7 @@ void sys_show(win_t *win, state_t state) [st_icon ] {"icon" , SW_MINIMIZE}, [st_hide ] {"hide" , SW_HIDE }, }; - win->sys->state = state; + win->state = state; printf("sys_show: %s\n", map[state].str); ShowWindow(win->sys->hwnd, map[state].cmd); } diff --git a/sys.h b/sys.h index e55b0a3..0a243bf 100644 --- a/sys.h +++ b/sys.h @@ -24,12 +24,22 @@ * and control windows. */ +/* Window states */ +typedef enum { + st_show, // show as regular window + st_full, // fullscreen/maximized + st_shade, // show titlebar only + st_icon, // iconified/minimized + st_hide, // completely hidden +} state_t; + /* Basic window type */ typedef struct win_sys win_sys_t; typedef struct win_wm win_wm_t; typedef struct { int x, y, z; int w, h; + state_t state; win_sys_t *sys; win_wm_t *wm; } win_t; @@ -78,15 +88,6 @@ typedef struct { } ptr_t; #define PTR(...) ((ptr_t){__VA_ARGS__}) -/* Window states */ -typedef enum { - st_show, // show as regular window - st_full, // fullscreen/maximized - st_shade, // show titlebar only - st_icon, // iconified/minimized - st_hide, // completely hidden -} state_t; - /* Move the window to the specified location and set it's * geometry. The position and size include borders and -- 2.43.2