updated on Wed Jan 11 12:00:27 UTC 2012
[aur-mirror.git] / fsviewer / fsviewer.diff
blobbc23ef32f75e35506a88c69e3897ccb34402fcaf
1 diff -Nur FSViewer.app-0.2.5-alt/src/FSBrowser.c FSViewer.app-0.2.5/src/FSBrowser.c
2 --- FSViewer.app-0.2.5-alt/src/FSBrowser.c Thu Dec 19 21:26:35 2002
3 +++ FSViewer.app-0.2.5/src/FSBrowser.c Mon Dec 23 15:11:58 2002
4 @@ -278,13 +278,13 @@
5 &titleLen, widthC);
6 W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
7 (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
8 - bPtr->columnSize.width, WACenter, WMColorGC(scr->white),
9 + bPtr->columnSize.width, WACenter, WMWhiteColor(scr),
10 False, titleBuf, titleLen);
11 free (titleBuf);
12 } else {
13 W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
14 (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
15 - bPtr->columnSize.width, WACenter, WMColorGC(scr->white),
16 + bPtr->columnSize.width, WACenter, WMWhiteColor(scr),
17 False, bPtr->titles[column], titleLen);
20 @@ -621,7 +621,7 @@
23 static void
24 -paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
25 +paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
26 WMRect *rect)
28 WMView *view = W_VIEW(lPtr);
29 @@ -630,19 +630,18 @@
30 /* WMListItem *item; */
32 /* item = WMGetListItem(lPtr, index); */
35 width = rect->size.width;
36 height = rect->size.height;
37 x = rect->pos.x;
38 y = rect->pos.y;
40 if (state & WLDSSelected)
41 - XFillRectangle(scr->display, d, WMColorGC(scr->white), x, y,
42 + WMPaintColorSwatch(WMWhiteColor(scr), d, x, y,
43 width, height);
44 -/* else if(item->uflags & 1) */
45 -/* XFillRectangle(scr->display, d, WMColorGC(WMCreateNamedColor(scr, "yellow", False)), x, y, width, height); */
46 else
47 - XClearArea(scr->display, d, x, y, width, height, False);
48 + WMPaintColorSwatch(WMGetWidgetBackgroundColor(lPtr), d, x, y,
49 + width, height);
51 if (text) {
52 /* Avoid overlaping... */
53 @@ -652,11 +651,11 @@
54 char *textBuf = createTruncatedString(scr->normalFont,
55 text, &textLen, widthC);
56 W_PaintText(view, d, scr->normalFont, x+4, y, widthC,
57 - WALeft, WMColorGC(scr->black), False, textBuf, textLen);
58 + WALeft, WMBlackColor(scr), False, textBuf, textLen);
59 free(textBuf);
60 } else {
61 - W_PaintText(view, d, scr->normalFont, x+4, y, widthC,
62 - WALeft, WMColorGC(scr->black), False, text, textLen);
63 + W_PaintText(view, d, scr->normalFont, x+4, y, widthC,
64 + WALeft, WMBlackColor(scr), False, text, textLen);
68 diff -Nur FSViewer.app-0.2.5-alt/src/FSFileButton.c FSViewer.app-0.2.5/src/FSFileButton.c
69 --- FSViewer.app-0.2.5-alt/src/FSFileButton.c Thu Dec 19 21:26:35 2002
70 +++ FSViewer.app-0.2.5/src/FSFileButton.c Mon Dec 23 14:52:07 2002
71 @@ -518,7 +518,7 @@
74 W_PaintText(view, d, screen->normalFont, x+ix, y+iy,
75 - strwidth, WACenter, WMColorGC(screen->black),
76 + strwidth, WACenter, WMBlackColor(screen),
77 True, text, strlen(text));
80 @@ -711,7 +711,7 @@
81 XSetWindowBackgroundPixmap(WMScreenDisplay(scr), view->window, pix);
82 XClearWindow(WMScreenDisplay(scr), view->window);
83 W_PaintText(view, pix, scr->normalFont, 2, 1, width, WACenter,
84 - WMColorGC(scr->black), False, text, len);
85 + WMBlackColor(scr), False, text, len);
86 if(pix)
87 XFreePixmap(scr->display, pix);
89 diff -Nur FSViewer.app-0.2.5-alt/src/FSMCList.c FSViewer.app-0.2.5/src/FSMCList.c
90 --- FSViewer.app-0.2.5-alt/src/FSMCList.c Thu Dec 19 21:26:35 2002
91 +++ FSViewer.app-0.2.5/src/FSMCList.c Mon Dec 23 15:13:14 2002
92 @@ -257,7 +257,7 @@
94 char *path;
95 FileInfo *fileList;
96 - FileInfo *start;
97 + FileInfo *start = NULL;
98 WMListItem *listItem;
99 FSMCList *mPtr = (FSMCList *)(WMGetHangedData(bPtr));
100 WMList *list = FSGetBrowserListInColumn(bPtr, column);
101 @@ -408,7 +408,7 @@
102 if (width >= 3*dLen) {
103 int dddLen = 3*dLen;
104 int tmpTextLen = *textLen;
107 strcpy(textBuf, text);
108 while (tmpTextLen
109 && (WMWidthOfString(font, textBuf, tmpTextLen)+dddLen > width))
110 @@ -429,7 +429,7 @@
113 static void
114 -paintItem(WMList *lPtr, int index, Drawable d,
115 +paintItem(WMList *lPtr, int index, Drawable d,
116 char *text, int state, WMRect *rect)
118 int i = 0;
119 @@ -450,17 +450,18 @@
120 x = rect->pos.x;
121 y = rect->pos.y;
122 fontHeight = WMFontHeight(scr->normalFont);
125 /* Highlight the selected area */
126 if (state & WLDSSelected)
127 - XFillRectangle(scr->display, d, WMColorGC(scr->white),
128 - x, y, width, height);
129 + WMPaintColorSwatch(WMWhiteColor(scr), d, x, y,
130 + width, height);
131 else
132 - XClearArea(scr->display, d, x, y, width, height, False);
133 + WMPaintColorSwatch(WMGetWidgetBackgroundColor(lPtr), d, x, y,
134 + width, height);
136 if(item->clientData)
138 - str = wstrdup(item->clientData);
139 + str = wstrdup(item->clientData);
140 len = strlen(str);
142 else
143 @@ -513,10 +514,10 @@
144 else
145 image = WMCreatePixmapFromXPMData(scr, list_file_xpm);
146 size = WMGetPixmapSize(image);
147 - WMDrawPixmap(image, d,
148 + WMDrawPixmap(image, d,
149 x+6+(20-size.width)/2, (height-size.height)/2+y);
150 WMReleasePixmap(image);
154 else
156 @@ -527,52 +528,52 @@
157 else
158 tmpStr = wstrdup("F");
160 - W_PaintText(view, d, scr->boldFont,
161 + W_PaintText(view, d, scr->boldFont,
162 x+6, y+(height-fontHeight)/2, widthC,
163 - WALeft, WMColorGC(scr->darkGray), False,
164 + WALeft, WMDarkGrayColor(scr), False,
165 tmpStr, 1);
167 free(tmpStr);
170 - if (WMWidthOfString(scr->normalFont, items[i], textLen) > widthC)
172 + if (WMWidthOfString(scr->normalFont, items[i], textLen) > widthC)
174 char *textBuf = createTruncatedString(scr->normalFont,
175 - items[i], &textLen,
176 + items[i], &textLen,
177 widthC);
179 - W_PaintText(view, d, scr->normalFont,
181 + W_PaintText(view, d, scr->normalFont,
182 x+26, y+(height-fontHeight)/2, widthC,
183 - WALeft, WMColorGC(scr->black), False,
184 + WALeft, WMBlackColor(scr), False,
185 textBuf, textLen);
187 free(textBuf);
189 - else
190 + else
192 - W_PaintText(view, d, scr->normalFont,
193 + W_PaintText(view, d, scr->normalFont,
194 x+26, y+(height-fontHeight)/2, widthC,
195 - WALeft, WMColorGC(scr->black), False, items[i],
196 + WALeft, WMBlackColor(scr), False, items[i],
197 textLen);
199 x += 194;
200 - }
202 else if(i==3)
204 - W_PaintText(view, d, scr->normalFont,
205 + W_PaintText(view, d, scr->normalFont,
206 x+6, y+(height-fontHeight)/2, 100,
207 - WALeft, WMColorGC(scr->black), False, items[i],
208 + WALeft, WMBlackColor(scr), False, items[i],
209 strlen(items[i]));
210 x += 100;
212 else
214 - W_PaintText(view, d, scr->normalFont,
215 + W_PaintText(view, d, scr->normalFont,
216 x+6, y+(height-fontHeight)/2, 82,
217 - WALeft, WMColorGC(scr->black), False, items[i],
218 + WALeft, WMBlackColor(scr), False, items[i],
219 strlen(items[i]));
220 x += 82;
221 - }
223 free(items[i]);
224 items[i] = NULL;
226 diff -Nur FSViewer.app-0.2.5-alt/src/FSPrefs.c FSViewer.app-0.2.5/src/FSPrefs.c
227 --- FSViewer.app-0.2.5-alt/src/FSPrefs.c Thu Dec 19 21:26:35 2002
228 +++ FSViewer.app-0.2.5/src/FSPrefs.c Mon Dec 23 15:14:09 2002
229 @@ -1913,25 +1913,26 @@
230 WMListItem *item = WMGetListItem(lPtr, index);
232 if (item->selected)
233 - XFillRectangle(scr->display, view->window, WMColorGC(scr->white),
234 - rect->pos.x, rect->pos.y,
235 + WMPaintColorSwatch(WMWhiteColor(scr), d,
236 + rect->pos.x, rect->pos.y,
237 rect->size.width, rect->size.height);
238 else
239 - XClearArea(scr->display, view->window, rect->pos.x, rect->pos.y,
240 - rect->size.width, rect->size.height, False);
241 + WMPaintColorSwatch(WMGetWidgetBackgroundColor(lPtr), d,
242 + rect->pos.x, rect->pos.y,
243 + rect->size.width, rect->size.height);
245 if(item->uflags)
247 - W_PaintText(view, view->window, scr->boldFont,
248 + W_PaintText(view, d, scr->boldFont,
249 rect->pos.x+4, rect->pos.y, rect->size.width,
250 - WALeft, WMColorGC(scr->black), False,
251 + WALeft, WMBlackColor(scr), False,
252 item->text, strlen(item->text));
254 else
256 - W_PaintText(view, view->window, scr->normalFont,
257 + W_PaintText(view, d, scr->normalFont,
258 rect->pos.x+4, rect->pos.y, rect->size.width,
259 - WALeft, WMColorGC(scr->black), False,
260 + WALeft, WMBlackColor(scr), False,
261 item->text, strlen(item->text));
264 diff -Nur FSViewer.app-0.2.5-alt/src/FSUtils.c FSViewer.app-0.2.5/src/FSUtils.c
265 --- FSViewer.app-0.2.5-alt/src/FSUtils.c Thu Dec 19 21:26:35 2002
266 +++ FSViewer.app-0.2.5/src/FSUtils.c Mon Dec 23 14:55:35 2002
267 @@ -976,8 +976,8 @@
268 clone = RMakeCenteredImage(image, 64, 64, &color1);
269 pixmap = WMCreatePixmapFromRImage(scr, clone, 0);
271 - RDestroyImage(image);
272 - RDestroyImage(clone);
273 + RReleaseImage(image);
274 + RReleaseImage(clone);
276 return pixmap;
278 @@ -1028,8 +1028,8 @@
279 pixmap = WMCreatePixmapFromRImage(scr, clone, 0);
282 - RDestroyImage(clone);
283 - RDestroyImage(image);
284 + RReleaseImage(clone);
285 + RReleaseImage(image);
287 return pixmap;
289 @@ -1068,7 +1068,7 @@
290 RClearImage(image, &color);
291 pixmap = WMCreatePixmapFromRImage(scr, image, 0);
293 - RDestroyImage(image);
294 + RReleaseImage(image);
296 return pixmap;
298 diff -Nur FSViewer.app-0.2.5-alt/src/timestampWidget.c FSViewer.app-0.2.5/src/timestampWidget.c
299 --- FSViewer.app-0.2.5-alt/src/timestampWidget.c Thu Dec 19 21:26:35 2002
300 +++ FSViewer.app-0.2.5/src/timestampWidget.c Mon Dec 23 14:52:07 2002
301 @@ -99,6 +99,7 @@
302 XpmIcon weekday;
303 XpmIcon asvisible;
304 GC gc;
305 + WMColor *color;
306 time_t time;
308 struct flags
309 @@ -236,7 +237,8 @@
310 WMCreateEventHandler(timestamp->view, ExposureMask | StructureNotifyMask, handleEvents, timestamp);
312 /* Default GC for paint. */
313 - timestamp->gc = WMColorGC(scr->gray);
314 + timestamp->color = WMGrayColor(scr);
315 + timestamp->gc = WMColorGC(timestamp->color);
317 W_ResizeView(timestamp->view, TIMESTAMP_MIN_WIDTH, TIMESTAMP_MIN_HEIGHT);
318 DEBUG_PRINT("Resized View");
319 @@ -668,14 +670,14 @@
321 W_PaintTextAndImage(timestamp->view,
322 False,
323 - timestamp->gc,
324 + timestamp->color,
325 scr->normalFont,
326 WRFlat,
327 NULL,
328 WACenter,
329 timestamp->image,
330 WIPImageOnly,
331 - timestamp->gc,
332 + timestamp->color,
333 offset);
334 DEBUG_PRINT("Painted image");