From 3957505ab119b21c7b0f4e72f56030c97711988a Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 7 Jul 2013 19:40:37 +1000 Subject: GWIN renaming, tidy up, color styles --- src/gwin/gwm.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/gwin/gwm.c') diff --git a/src/gwin/gwm.c b/src/gwin/gwm.c index 88d61a21..f9f56838 100644 --- a/src/gwin/gwm.c +++ b/src/gwin/gwm.c @@ -43,10 +43,49 @@ static const gwmVMT GNullWindowManagerVMT = { WM_MinMax, }; -const GWindowManager GNullWindowManager = { +static const GWindowManager GNullWindowManager = { &GNullWindowManagerVMT, }; +gfxQueueASync _GWINList; +GWindowManager * _GWINwm; + +/*----------------------------------------------- + * Window Routines + *-----------------------------------------------*/ + +void _gwmInit(void) { + gfxQueueASyncInit(&_GWINList); + _GWINwm = (GWindowManager *)&GNullWindowManager; + _GWINwm->vmt->Init(); +} + +void gwinSetWindowManager(struct GWindowManager *gwm) { + if (!gwm) + gwm = (GWindowManager *)&GNullWindowManager; + if (_GWINwm != gwm) { + _GWINwm->vmt->DeInit(); + _GWINwm = gwm; + _GWINwm->vmt->Init(); + } +} + +void gwinSetMinMax(GHandle gh, GWindowMinMax minmax) { + _GWINwm->vmt->MinMax(gh, minmax); +} + +void gwinRaise(GHandle gh) { + _GWINwm->vmt->Raise(gh); +} + +GWindowMinMax gwinGetMinMax(GHandle gh) { + if (gh->flags & GWIN_FLG_MINIMIZED) + return GWIN_MINIMIZE; + if (gh->flags & GWIN_FLG_MAXIMIZED) + return GWIN_MAXIMIZE; + return GWIN_NORMAL; +} + /*----------------------------------------------- * Window Manager Routines *-----------------------------------------------*/ -- cgit v1.2.3