/********************************************************************* * * GUI_DispStringInRectEx */ void GUI_DispStringInRectEx(const char GUI_UNI_PTR *s, GUI_RECT* pRect, int TextAlign, int MaxLen, const GUI_ROTATION * pLCD_Api) { const GUI_ROTATION * pLCD_ApiOld; if (pLCD_Api == GUI_ROTATE_0) { /* Do nothing else but calling GUI_DispStringInRectMax if pLCD_Api == GUI_ROTATE_0 */ GUI_DispStringInRectMax(s, pRect, TextAlign, MaxLen); } else { #if (!GUI_WINSUPPORT) GUI_RECT Rect_Old; #else const GUI_RECT * pOldClipRect = NULL; #endif GUI_RECT rClip, rText = {0}; GUI_LOCK(); /* Set the clip rectangle */ if (pRect) { rText = *pRect; GUI_RectDispString = rText; #if (GUI_WINSUPPORT) pOldClipRect = WM_SetUserClipRect(pRect); if (pOldClipRect) { GUI__IntersectRects(&rClip, pRect, pOldClipRect); WM_SetUserClipRect(&rClip); } #else Rect_Old = GUI_Context.ClipRect; GUI__IntersectRects(&rClip, pRect, &Rect_Old); LCD_SetClipRectEx(&rClip); #endif } pLCD_ApiOld = _SetRotation(pLCD_Api); /* Set the new function pointer for rotating text */ pLCD_Api->pfRect2TextRect(&rText); /* Calculate the text rectangle */ GUI__DispStringInRect(s, &rText, TextAlign, MaxLen); /* Display the string */ /* Restore old clipping rectangle */ #if (GUI_WINSUPPORT) WM_SetUserClipRect(pOldClipRect); #else LCD_SetClipRectEx(&Rect_Old); #endif _SetRotation(pLCD_ApiOld); GUI_UNLOCK(); } }
void GUI_DispStringInRectMax(const char GUI_UNI_PTR *s, GUI_RECT* pRect, int TextAlign, int MaxLen) { GUI_RECT Rect_Old, r; if (s && pRect) { GUI_LOCK(); Rect_Old = GUI_Context.ClipRect[GUI_Context.SelLayer]; GUI__IntersectRects(&r, pRect, &Rect_Old); LCD_SetClipRectEx(&r); GUI__DispStringInRect(s, pRect, TextAlign, MaxLen); LCD_SetClipRectEx(&Rect_Old); GUI_UNLOCK(); } }
/* Invalidate a certain section of the display. One main reason for this is that a window has been moved or destroyed. The following windows are affected: * windows below the window creating the invalidation. * transparent windows located above The coordinates given are absolute coordinates (desktop coordinates) */ void WM__InvalidateAreaBelow(const GUI_RECT* pRect, WM_HWIN StopWin) { WM_HWIN iWin, iNext; /* Iterate over windows below StopWin */ for (iWin = WM__FirstWin; iWin!=StopWin; iWin = iNext) { GUI_RECT r = *pRect; WM_Obj* pWin = WM_H2P(iWin); iNext = pWin->hNextLin; if (GUI__IntersectRects(&r, &r, &pWin->Rect)) { WM_InvalidateBWin1Abs (iWin, &r); } }; }
/* Invalidate a certain section of the display. One main reason for this is that a window has been moved or destroyed. The following windows are affected: * windows below the window creating the invalidation. * transparent windows located above The coordinates given are absolute coordinates (desktop coordinates) */ void WM__InvalidateAreaBelow(const GUI_RECT* pRect, WM_HWIN StopWin) { WM_HWIN iWin, iNext; GUI_USE_PARA(StopWin); /* tbd: change calls of this function */ /* Iterate over windows below StopWin */ for (iWin = WM__FirstWin; iWin/*!=StopWin*/; iWin = iNext) { GUI_RECT r = *pRect; WM_Obj* pWin = WM_H2P(iWin); iNext = pWin->hNextLin; if (GUI__IntersectRects(&r, &r, &pWin->Rect)) { WM_InvalidateBWin1Abs (iWin, &r); } }; }
void GUI_DispStringInRectMax(const char GUI_UNI_PTR *s, GUI_RECT* pRect, int TextAlign, int MaxLen) { if (s) { const GUI_RECT *pOldClipRect = NULL; GUI_RECT r; GUI_LOCK(); if (pRect) { pOldClipRect = WM_SetUserClipRect(pRect); if (pOldClipRect) { GUI__IntersectRects(&r, pRect, pOldClipRect); WM_SetUserClipRect(&r); } } GUI__DispStringInRect(s, pRect, TextAlign, MaxLen); WM_SetUserClipRect(pOldClipRect); GUI_UNLOCK(); } }
/* Invalidate any transparent window above the given area */ void WM__InvalidateTransAreaAbove(const GUI_RECT* pRect, WM_HWIN StopWin) { GUI_USE_PARA(pRect); GUI_USE_PARA(StopWin); #if 0 WM_HWIN iWin; /* Iterate over windows below StopWin */ for (iWin = StopWin; iWin!=WM_HWIN_NULL; iWin = WM_H2P(iWin)->Next) { WM_Obj *pWin = WM_H2P(iWin); if (pWin->Status & WM_SF_HASTRANS) { GUI_RECT r = *pRect; if (GUI__IntersectRects(&r, &r, &WM_H2P(iWin)->Rect)) { WM_InvalidateBWin1Abs (iWin, &r); } } } #endif }