--- fsviewer-app-0.2.3f/src/FSPrefs.c.newwings 2002-10-26 00:49:43 +0400 +++ fsviewer-app-0.2.3f/src/FSPrefs.c 2002-11-21 10:53:31 +0300 @@ -1906,25 +1906,26 @@ WMListItem *item = WMGetListItem(lPtr, index); if (item->selected) - XFillRectangle(scr->display, view->window, WMColorGC(scr->white), - rect->pos.x, rect->pos.y, + WMPaintColorSwatch(WMWhiteColor(scr), d, + rect->pos.x, rect->pos.y, rect->size.width, rect->size.height); else - XClearArea(scr->display, view->window, rect->pos.x, rect->pos.y, - rect->size.width, rect->size.height, False); + WMPaintColorSwatch(WMGetWidgetBackgroundColor(lPtr), d, + rect->pos.x, rect->pos.y, + rect->size.width, rect->size.height); if(item->uflags) { - W_PaintText(view, view->window, scr->boldFont, + W_PaintText(view, d, scr->boldFont, rect->pos.x+4, rect->pos.y, rect->size.width, - WALeft, WMColorGC(scr->black), False, + WALeft, WMBlackColor(scr), False, item->text, strlen(item->text)); } else { - W_PaintText(view, view->window, scr->normalFont, + W_PaintText(view, d, scr->normalFont, rect->pos.x+4, rect->pos.y, rect->size.width, - WALeft, WMColorGC(scr->black), False, + WALeft, WMBlackColor(scr), False, item->text, strlen(item->text)); } } --- fsviewer-app-0.2.3f/src/timestampWidget.c.newwings 2002-01-05 19:21:17 +0300 +++ fsviewer-app-0.2.3f/src/timestampWidget.c 2002-11-21 11:12:28 +0300 @@ -106,6 +106,7 @@ XpmIcon weekday; XpmIcon asvisible; GC gc; + WMColor *color; time_t time; struct flags @@ -258,7 +259,8 @@ WMCreateEventHandler(timestamp->view, ExposureMask | StructureNotifyMask, handleEvents, timestamp); /* Default GC for paint. */ - timestamp->gc = WMColorGC(scr->gray); + timestamp->color = WMGrayColor(scr); + timestamp->gc = WMColorGC(timestamp->color); W_ResizeView(timestamp->view, TIMESTAMP_MIN_WIDTH, TIMESTAMP_MIN_HEIGHT); DEBUG_PRINT("Resized View"); @@ -731,14 +733,14 @@ { W_PaintTextAndImage(timestamp->view, False, - timestamp->gc, + timestamp->color, scr->normalFont, WRFlat, NULL, WACenter, timestamp->image, WIPImageOnly, - timestamp->gc, + timestamp->color, offset); DEBUG_PRINT("Painted image"); } --- fsviewer-app-0.2.3f/src/FSFileButton.c.newwings 2002-01-05 20:08:49 +0300 +++ fsviewer-app-0.2.3f/src/FSFileButton.c 2002-11-21 11:08:53 +0300 @@ -518,7 +518,7 @@ { W_PaintText(view, d, screen->normalFont, x+ix, y+iy, - strwidth, WACenter, WMColorGC(screen->black), + strwidth, WACenter, WMBlackColor(screen), True, text, strlen(text)); } @@ -711,7 +711,7 @@ XSetWindowBackgroundPixmap(WMScreenDisplay(scr), view->window, pix); XClearWindow(WMScreenDisplay(scr), view->window); W_PaintText(view, pix, scr->normalFont, 2, 1, width, WACenter, - WMColorGC(scr->black), False, text, len); + WMBlackColor(scr), False, text, len); if(pix) XFreePixmap(scr->display, pix); --- fsviewer-app-0.2.3f/src/FSMCList.c.newwings 2002-01-05 20:09:16 +0300 +++ fsviewer-app-0.2.3f/src/FSMCList.c 2002-11-21 11:13:23 +0300 @@ -257,7 +257,7 @@ { char *path; FileInfo *fileList; - FileInfo *start; + FileInfo *start = NULL; WMListItem *listItem; FSMCList *mPtr = (FSMCList *)(WMGetHangedData(bPtr)); WMList *list = FSGetBrowserListInColumn(bPtr, column); @@ -408,7 +408,7 @@ if (width >= 3*dLen) { int dddLen = 3*dLen; int tmpTextLen = *textLen; - + strcpy(textBuf, text); while (tmpTextLen && (WMWidthOfString(font, textBuf, tmpTextLen)+dddLen > width)) @@ -429,7 +429,7 @@ } static void -paintItem(WMList *lPtr, int index, Drawable d, +paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMRect *rect) { int i = 0; @@ -450,17 +450,18 @@ x = rect->pos.x; y = rect->pos.y; fontHeight = WMFontHeight(scr->normalFont); - + /* Highlight the selected area */ if (state & WLDSSelected) - XFillRectangle(scr->display, d, WMColorGC(scr->white), - x, y, width, height); + WMPaintColorSwatch(WMWhiteColor(scr), d, x, y, + width, height); else - XClearArea(scr->display, d, x, y, width, height, False); + WMPaintColorSwatch(WMGetWidgetBackgroundColor(lPtr), d, x, y, + width, height); if(item->clientData) { - str = wstrdup(item->clientData); + str = wstrdup(item->clientData); len = strlen(str); } else @@ -513,10 +514,10 @@ else image = WMCreatePixmapFromXPMData(scr, list_file_xpm); size = WMGetPixmapSize(image); - WMDrawPixmap(image, d, + WMDrawPixmap(image, d, x+6+(20-size.width)/2, (height-size.height)/2+y); WMReleasePixmap(image); - + } else { @@ -527,52 +528,52 @@ else tmpStr = wstrdup("F"); - W_PaintText(view, d, scr->boldFont, + W_PaintText(view, d, scr->boldFont, x+6, y+(height-fontHeight)/2, widthC, - WALeft, WMColorGC(scr->darkGray), False, + WALeft, WMDarkGrayColor(scr), False, tmpStr, 1); free(tmpStr); } - - if (WMWidthOfString(scr->normalFont, items[i], textLen) > widthC) + + if (WMWidthOfString(scr->normalFont, items[i], textLen) > widthC) { char *textBuf = createTruncatedString(scr->normalFont, - items[i], &textLen, + items[i], &textLen, widthC); - - W_PaintText(view, d, scr->normalFont, + + W_PaintText(view, d, scr->normalFont, x+26, y+(height-fontHeight)/2, widthC, - WALeft, WMColorGC(scr->black), False, + WALeft, WMBlackColor(scr), False, textBuf, textLen); free(textBuf); } - else + else { - W_PaintText(view, d, scr->normalFont, + W_PaintText(view, d, scr->normalFont, x+26, y+(height-fontHeight)/2, widthC, - WALeft, WMColorGC(scr->black), False, items[i], + WALeft, WMBlackColor(scr), False, items[i], textLen); } x += 194; - } + } else if(i==3) { - W_PaintText(view, d, scr->normalFont, + W_PaintText(view, d, scr->normalFont, x+6, y+(height-fontHeight)/2, 100, - WALeft, WMColorGC(scr->black), False, items[i], + WALeft, WMBlackColor(scr), False, items[i], strlen(items[i])); x += 100; } else { - W_PaintText(view, d, scr->normalFont, + W_PaintText(view, d, scr->normalFont, x+6, y+(height-fontHeight)/2, 82, - WALeft, WMColorGC(scr->black), False, items[i], + WALeft, WMBlackColor(scr), False, items[i], strlen(items[i])); x += 82; - } + } free(items[i]); items[i] = NULL; } --- fsviewer-app-0.2.3f/src/FSBrowser.c.newwings 2002-01-05 19:38:50 +0300 +++ fsviewer-app-0.2.3f/src/FSBrowser.c 2002-11-21 10:34:00 +0300 @@ -278,13 +278,13 @@ &titleLen, widthC); W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x, (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2, - bPtr->columnSize.width, WACenter, WMColorGC(scr->white), + bPtr->columnSize.width, WACenter, WMWhiteColor(scr), False, titleBuf, titleLen); free (titleBuf); } else { W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x, (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2, - bPtr->columnSize.width, WACenter, WMColorGC(scr->white), + bPtr->columnSize.width, WACenter, WMWhiteColor(scr), False, bPtr->titles[column], titleLen); } } @@ -621,7 +621,7 @@ static void -paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, +paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMRect *rect) { WMView *view = W_VIEW(lPtr); @@ -630,19 +630,18 @@ /* WMListItem *item; */ /* item = WMGetListItem(lPtr, index); */ - + width = rect->size.width; height = rect->size.height; x = rect->pos.x; y = rect->pos.y; if (state & WLDSSelected) - XFillRectangle(scr->display, d, WMColorGC(scr->white), x, y, + WMPaintColorSwatch(WMWhiteColor(scr), d, x, y, width, height); -/* else if(item->uflags & 1) */ -/* XFillRectangle(scr->display, d, WMColorGC(WMCreateNamedColor(scr, "yellow", False)), x, y, width, height); */ else - XClearArea(scr->display, d, x, y, width, height, False); + WMPaintColorSwatch(WMGetWidgetBackgroundColor(lPtr), d, x, y, + width, height); if (text) { /* Avoid overlaping... */ @@ -652,11 +651,11 @@ char *textBuf = createTruncatedString(scr->normalFont, text, &textLen, widthC); W_PaintText(view, d, scr->normalFont, x+4, y, widthC, - WALeft, WMColorGC(scr->black), False, textBuf, textLen); + WALeft, WMBlackColor(scr), False, textBuf, textLen); free(textBuf); } else { - W_PaintText(view, d, scr->normalFont, x+4, y, widthC, - WALeft, WMColorGC(scr->black), False, text, textLen); + W_PaintText(view, d, scr->normalFont, x+4, y, widthC, + WALeft, WMBlackColor(scr), False, text, textLen); } }