diff options
Diffstat (limited to 'src/gwin/gwin_wm.c')
-rw-r--r-- | src/gwin/gwin_wm.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c index 7f251a70..6761180f 100644 --- a/src/gwin/gwin_wm.c +++ b/src/gwin/gwin_wm.c @@ -34,11 +34,11 @@ gfxMutexDestroy(&gmutex); } - bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit) { + gBool _gwinWMAdd(GHandle gh, const GWindowInit *pInit) { gh->x = gh->y = gh->width = gh->height = 0; gwinMove(gh, pInit->x, pInit->y); gwinResize(gh, pInit->width, pInit->height); - return TRUE; + return gTrue; } void _gwinFlushRedraws(GRedrawMethod how) { @@ -83,12 +83,12 @@ gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW); } - bool_t _gwinDrawStart(GHandle gh) { + gBool _gwinDrawStart(GHandle gh) { if (!(gh->flags & GWIN_FLG_SYSVISIBLE)) - return FALSE; + return gFalse; getLock(gh); - return TRUE; + return gTrue; } void _gwinDrawEnd(GHandle gh) { @@ -96,7 +96,7 @@ exitLock(gh); } - void gwinSetVisible(GHandle gh, bool_t visible) { + void gwinSetVisible(GHandle gh, gBool visible) { if (visible) { if (!(gh->flags & GWIN_FLG_VISIBLE)) { gh->flags |= (GWIN_FLG_VISIBLE|GWIN_FLG_SYSVISIBLE|GWIN_FLG_BGREDRAW); @@ -111,7 +111,7 @@ } } - void gwinSetEnabled(GHandle gh, bool_t enabled) { + void gwinSetEnabled(GHandle gh, gBool enabled) { if (enabled) { if (!(gh->flags & GWIN_FLG_ENABLED)) { gh->flags |= (GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED); @@ -161,7 +161,7 @@ // The default window manager extern const GWindowManager GNullWindowManager; GWindowManager * _GWINwm; -bool_t _gwinFlashState; +gBool _gwinFlashState; static gfxSem gwinsem; static gfxQueueASync _GWINList; #if GWIN_NEED_FLASHING @@ -190,7 +190,7 @@ void _gwmInit(void) #endif #if !GWIN_REDRAW_IMMEDIATE gtimerInit(&RedrawTimer); - gtimerStart(&RedrawTimer, RedrawTimerFn, 0, TRUE, TIME_INFINITE); + gtimerStart(&RedrawTimer, RedrawTimerFn, 0, gTrue, TIME_INFINITE); #endif _GWINwm = (GWindowManager *)&GNullWindowManager; _GWINwm->vmt->Init(); @@ -366,11 +366,11 @@ void _gwinUpdate(GHandle gh) { } #endif -bool_t _gwinDrawStart(GHandle gh) { +gBool _gwinDrawStart(GHandle gh) { // This test should occur inside the lock. We do this // here as well as an early out (more efficient). if (!(gh->flags & GWIN_FLG_SYSVISIBLE)) - return FALSE; + return gFalse; // Obtain the drawing lock gfxSemWait(&gwinsem, TIME_INFINITE); @@ -378,14 +378,14 @@ bool_t _gwinDrawStart(GHandle gh) { // Re-test visibility as we may have waited a while if (!(gh->flags & GWIN_FLG_SYSVISIBLE)) { _gwinDrawEnd(gh); - return FALSE; + return gFalse; } // OK - we are ready to draw. #if GDISP_NEED_CLIP gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height); #endif - return TRUE; + return gTrue; } void _gwinDrawEnd(GHandle gh) { @@ -401,19 +401,19 @@ void _gwinDrawEnd(GHandle gh) { gfxSemSignal(&gwinsem); } -bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit) { +gBool _gwinWMAdd(GHandle gh, const GWindowInit *pInit) { #if GWIN_NEED_CONTAINERS // Save the parent gh->parent = pInit->parent; // Ensure the display is consistent with any parents if (gh->parent && (!(gh->parent->flags & GWIN_FLG_CONTAINER) || gh->display != gh->parent->display)) - return FALSE; + return gFalse; #endif // Add to the window manager if (!_GWINwm->vmt->Add(gh, pInit)) - return FALSE; + return gFalse; #if GWIN_NEED_CONTAINERS // Notify the parent it has been added @@ -421,7 +421,7 @@ bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit) { ((gcontainerVMT *)gh->parent->vmt)->NotifyAdd(gh->parent, gh); #endif - return TRUE; + return gTrue; } void gwinSetWindowManager(struct GWindowManager *gwm) { @@ -448,7 +448,7 @@ void gwinRedraw(GHandle gh) { } #if GWIN_NEED_CONTAINERS - void gwinSetVisible(GHandle gh, bool_t visible) { + void gwinSetVisible(GHandle gh, gBool visible) { if (visible) { // Mark us as visible gh->flags |= GWIN_FLG_VISIBLE; @@ -463,7 +463,7 @@ void gwinRedraw(GHandle gh) { TriggerRedraw(); } #else - void gwinSetVisible(GHandle gh, bool_t visible) { + void gwinSetVisible(GHandle gh, gBool visible) { if (visible) { if (!(gh->flags & GWIN_FLG_VISIBLE)) { gh->flags |= (GWIN_FLG_VISIBLE|GWIN_FLG_SYSVISIBLE|GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW); @@ -491,7 +491,7 @@ void gwinRedraw(GHandle gh) { #if GWIN_NEED_CONTAINERS // These two sub-functions set/clear system enable recursively. - void gwinSetEnabled(GHandle gh, bool_t enabled) { + void gwinSetEnabled(GHandle gh, gBool enabled) { if (enabled) { // Mark us as enabled gh->flags |= GWIN_FLG_ENABLED; @@ -530,7 +530,7 @@ void gwinRedraw(GHandle gh) { } } #else - void gwinSetEnabled(GHandle gh, bool_t enabled) { + void gwinSetEnabled(GHandle gh, gBool enabled) { if (enabled) { if (!(gh->flags & GWIN_FLG_ENABLED)) { gh->flags |= (GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED); @@ -577,7 +577,7 @@ GWindowMinMax gwinGetMinMax(GHandle gh) { return GWIN_NORMAL; } -void gwinRedrawDisplay(GDisplay *g, bool_t preserve) { +void gwinRedrawDisplay(GDisplay *g, gBool preserve) { GHandle gh; for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { @@ -631,7 +631,7 @@ GHandle gwinGetNextWindow(GHandle gh) { gtimerStop(&FlashTimer); } - void gwinSetFlashing(GHandle gh, bool_t flash) { + void gwinSetFlashing(GHandle gh, gBool flash) { // Start flashing? if (flash) { @@ -642,9 +642,9 @@ GHandle gwinGetNextWindow(GHandle gh) { RedrawPending |= DOREDRAW_FLASHRUNNING; // Ensure we start the timer with flash bit on - _gwinFlashState = FALSE; + _gwinFlashState = gFalse; FlashTimerFn(0); // First flash - gtimerStart(&FlashTimer, FlashTimerFn, 0, TRUE, GWIN_FLASHING_PERIOD); // Subsequent flashes + gtimerStart(&FlashTimer, FlashTimerFn, 0, gTrue, GWIN_FLASHING_PERIOD); // Subsequent flashes } // Stop flashing? @@ -656,7 +656,7 @@ GHandle gwinGetNextWindow(GHandle gh) { } #if GWIN_NEED_WIDGET - const GColorSet *_gwinGetFlashedColor(GWidgetObject *gw, const GColorSet *pcol, bool_t flashOffState) { + const GColorSet *_gwinGetFlashedColor(GWidgetObject *gw, const GColorSet *pcol, gBool flashOffState) { // Does the flashing state affect the current colors? if ((gw->g.flags & GWIN_FLG_FLASHING) && _gwinFlashState) { @@ -688,7 +688,7 @@ GHandle gwinGetNextWindow(GHandle gh) { static void WM_Init(void); static void WM_DeInit(void); -static bool_t WM_Add(GHandle gh, const GWindowInit *pInit); +static gBool WM_Add(GHandle gh, const GWindowInit *pInit); static void WM_Delete(GHandle gh); static void WM_Redraw(GHandle gh); static void WM_Size(GHandle gh, coord_t w, coord_t h); @@ -726,7 +726,7 @@ static void WM_DeInit(void) { // A full window manager would remove any borders etc } -static bool_t WM_Add(GHandle gh, const GWindowInit *pInit) { +static gBool WM_Add(GHandle gh, const GWindowInit *pInit) { // Note the window will not currently be marked as visible // Put it on the end of the queue @@ -737,7 +737,7 @@ static bool_t WM_Add(GHandle gh, const GWindowInit *pInit) { gh->x = gh->y = 0; WM_Move(gh, pInit->x, pInit->y); WM_Size(gh, pInit->width, pInit->height); - return TRUE; + return gTrue; } static void WM_Delete(GHandle gh) { @@ -860,7 +860,7 @@ static void WM_Size(GHandle gh, coord_t w, coord_t h) { } else { // We need to make this window invisible and ensure that has been drawn - gwinSetVisible(gh, FALSE); + gwinSetVisible(gh, gFalse); _gwinFlushRedraws(REDRAW_WAIT); // Resize @@ -878,7 +878,7 @@ static void WM_Size(GHandle gh, coord_t w, coord_t h) { #endif // Mark it visible again in its new location - gwinSetVisible(gh, TRUE); + gwinSetVisible(gh, gTrue); } } else { gh->width = w; gh->height = h; @@ -941,7 +941,7 @@ static void WM_Move(GHandle gh, coord_t x, coord_t y) { // Clear the old area and then redraw if ((gh->flags & GWIN_FLG_SYSVISIBLE)) { // We need to make this window invisible and ensure that has been drawn - gwinSetVisible(gh, FALSE); + gwinSetVisible(gh, gFalse); _gwinFlushRedraws(REDRAW_WAIT); // Do the move @@ -959,7 +959,7 @@ static void WM_Move(GHandle gh, coord_t x, coord_t y) { } #endif - gwinSetVisible(gh, TRUE); + gwinSetVisible(gh, gTrue); } else { u = gh->x; gh->x = x; v = gh->y; gh->y = y; @@ -996,13 +996,13 @@ static void WM_Raise(GHandle gh) { if ((gh->flags & GWIN_FLG_CONTAINER)) { GHandle gx; GHandle child; - bool_t restart; + gBool restart; // Raise the children too // Note: Children can also have their own children so after each move we have to start again. for (gx = gwinGetNextWindow(0); gx; gx = gwinGetNextWindow(gx)) { if ((gx->flags & GWIN_FLG_CONTAINER)) { - restart = FALSE; + restart = gFalse; for (child = gwinGetNextWindow(0); child && child != gx; child = gwinGetNextWindow(child)) { if (child->parent == gx) { // Oops - this child is behind its parent. Move it to the front. @@ -1012,7 +1012,7 @@ static void WM_Raise(GHandle gh) { // Restart at the front of the list for this parent container as we have moved this child // to the end of the list. We also need to restart everything once this container is done. child = 0; - restart = TRUE; + restart = gTrue; } } if (restart) |