void D4D_ScrlBrDrawArrow(D4D_POINT* ppt, D4D_COOR size, D4D_DIRECTION dir, D4D_COLOR color) { D4D_COOR i,j; D4D_POINT tmp_point = {0, 0}; D4D_POINT tmp_pointReal; D4D_BOOL swap = D4D_FALSE; if((dir == D4D_DIR_LEFT) || (dir == D4D_DIR_RIGHT)) swap = D4D_TRUE; D4D_PutPixel(ppt, D4D_LINE_THIN, color); for(i = 0; i < size; i++) { if((dir == D4D_DIR_DOWN) || (dir == D4D_DIR_RIGHT)) tmp_point.y--; else tmp_point.y++; tmp_point.x--; if(swap) tmp_pointReal = D4D_SwapCoor(tmp_point); else tmp_pointReal = tmp_point; tmp_pointReal.x += ppt->x; tmp_pointReal.y += ppt->y; D4D_MoveTo(&tmp_pointReal); j = tmp_point.x; tmp_point.x += (i+1) * 2; if(swap) tmp_pointReal = D4D_SwapCoor(tmp_point); else tmp_pointReal = tmp_point; tmp_pointReal.x += ppt->x; tmp_pointReal.y += ppt->y; D4D_LineTo(&tmp_pointReal, D4D_LINE_THIN, color); tmp_point.x = j; } }
/**************************************************************//*! * * Redraw non client screen area - Header, background, title, etc. * ******************************************************************/ static void D4D_DrawScreenNC(D4D_SCREEN* pScreen, D4D_BOOL active) { D4D_CLR_SCHEME *pScheme = D4D_ScreenGetScheme(pScreen); D4D_COLOR clr; D4D_GEOMETRY contentGeom; D4D_POINT tmpPoint; D4D_SIZE tmpSize; contentGeom.pnt = pScreen->position; contentGeom.sz = pScreen->size; if(pScreen->flags & D4D_SCR_F_BEVEL) { contentGeom.pnt.x += D4D_BEVEL_WIDTH; contentGeom.pnt.y += D4D_BEVEL_WIDTH; contentGeom.sz.cx -= 2*D4D_BEVEL_WIDTH; contentGeom.sz.cy -= 2*D4D_BEVEL_WIDTH; }else if(pScreen->flags & D4D_SCR_F_OUTLINE) { contentGeom.pnt.x++; contentGeom.pnt.y++; contentGeom.sz.cx -= 2; contentGeom.sz.cy -= 2; } if(active) { if(pScreen->flags & D4D_SCR_F_BCKG) { D4D_FillRRect(&contentGeom.pnt, &contentGeom.sz, pScheme->screen.desktop, pScreen->radius); } if(pScreen->flags & D4D_SCR_F_BEVEL) { D4D_Bevel(&(pScreen->position), &(pScreen->size), pScheme->screen.outline, D4D_BEVEL_RAISED, pScreen->radius); }else if(pScreen->flags & D4D_SCR_F_OUTLINE) { D4D_RRect(&(pScreen->position), &(pScreen->size), D4D_LINE_THIN, pScheme->screen.outline, pScreen->radius); } } if(pScreen->flags & D4D_SCR_F_TITLEBAR) { clr = pScheme->screen.title_bar; if(!active) clr = D4D_GetGreyScale(clr); tmpSize = contentGeom.sz; tmpSize.cy = D4D_GetScrHeaderSize(pScreen); if(tmpSize.cy) tmpSize.cy--; D4D_FillRRect(&contentGeom.pnt, &tmpSize, clr, pScreen->radius); } if(pScreen->pIcon != NULL) { tmpPoint = contentGeom.pnt; tmpPoint.x += D4D_SCR_TITLE_OFF_X; tmpPoint.y += (D4D_COOR)((D4D_GetScrHeaderSize(pScreen) - D4D_GetBmpHeight(pScreen->pIcon)) / 2); D4D_DrawRBmp(&tmpPoint, pScreen->pIcon, (D4D_BOOL)!active, pScreen->radius); } if(pScreen->textBuff.pText) { tmpPoint = contentGeom.pnt; tmpPoint.x += D4D_GetScrHeaderTitleOffset(pScreen); tmpPoint.y += (D4D_COOR)((D4D_GetScrHeaderSize(pScreen) - D4D_GetFontHeight(pScreen->textBuff.fontId)) / 2); clr = pScheme->screen.title_text; if(!active) clr = D4D_GetGreyScale(clr); D4D_DrawText(&tmpPoint, &pScreen->textBuff, clr, 0); } if(pScreen->flags & D4D_SCR_F_EXIT) { clr = pScheme->screen.exitBtnFore; if(!active) clr = D4D_GetGreyScale(clr); if(D4D_GetScrHeaderExitBtnCoor(pScreen, &tmpPoint, &tmpSize)) { D4D_RBox(&tmpPoint, &tmpSize, D4D_LINE_THIN, clr, pScheme->screen.exitBtnBckg, pScreen->radius); tmpPoint.x += D4D_SCR_EXITBTN_CROSS_SIZE; tmpPoint.y += D4D_SCR_EXITBTN_CROSS_SIZE; #if D4D_ROUND_CORNER_ENABLE != D4D_FALSE tmpPoint.x += (D4D_COOR)(pScreen->radius / 2); tmpPoint.y += (D4D_COOR)(pScreen->radius / 2); #endif D4D_MoveTo(&tmpPoint); tmpPoint.x += tmpSize.cx - (2 * D4D_SCR_EXITBTN_CROSS_SIZE); tmpPoint.y += tmpSize.cy - (2 * D4D_SCR_EXITBTN_CROSS_SIZE); #if D4D_ROUND_CORNER_ENABLE != D4D_FALSE tmpPoint.x -= (D4D_COOR)(pScreen->radius); tmpPoint.y -= (D4D_COOR)(pScreen->radius); #endif D4D_LineTo(&tmpPoint, D4D_LINE_THIN, clr); tmpPoint.y -= tmpSize.cy - (2 * D4D_SCR_EXITBTN_CROSS_SIZE); #if D4D_ROUND_CORNER_ENABLE != D4D_FALSE tmpPoint.y += (D4D_COOR)(pScreen->radius); #endif D4D_MoveTo(&tmpPoint); tmpPoint.x -= tmpSize.cx - (2 * D4D_SCR_EXITBTN_CROSS_SIZE); tmpPoint.y += tmpSize.cy - (2 * D4D_SCR_EXITBTN_CROSS_SIZE); #if D4D_ROUND_CORNER_ENABLE != D4D_FALSE tmpPoint.x += (D4D_COOR)(pScreen->radius); tmpPoint.y -= (D4D_COOR)(pScreen->radius); #endif D4D_LineTo(&tmpPoint, D4D_LINE_THIN, clr); } } }