diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-07 19:40:37 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-07 19:40:37 +1000 |
commit | 3957505ab119b21c7b0f4e72f56030c97711988a (patch) | |
tree | 5a059012d5fa0d07a93fcb70e72518bdaca1d4c5 /src/gwin/gwm.c | |
parent | de28112a7d6db829142ad113c93eb8ad071b0d65 (diff) | |
download | uGFX-3957505ab119b21c7b0f4e72f56030c97711988a.tar.gz uGFX-3957505ab119b21c7b0f4e72f56030c97711988a.tar.bz2 uGFX-3957505ab119b21c7b0f4e72f56030c97711988a.zip |
GWIN renaming, tidy up, color styles
Diffstat (limited to 'src/gwin/gwm.c')
-rw-r--r-- | src/gwin/gwm.c | 41 |
1 files changed, 40 insertions, 1 deletions
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 *-----------------------------------------------*/ |