1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
$NetBSD: patch-ai,v 1.2 2004/05/23 23:28:29 danw Exp $
Index: icons.c
===================================================================
RCS file: /home/siren/src/tvtwm/icons.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- icons.c 1999/08/08 05:46:53 1.1.1.1
+++ icons.c 1999/08/08 05:56:50 1.2
@@ -116,6 +116,7 @@
**********************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include "twm.h"
#include "screen.h"
#include "icons.h"
@@ -123,6 +124,10 @@
#include "parse.h"
#include "util.h"
+static void
+AddOneIconRegion(char *name, short type, int x, int y, int w, int h,
+ int grav1, int grav2, int stepx, int stepy);
+
#define iconWidth(w) (w->icon.width + 2 * w->icon.bw)
#define iconHeight(w) (w->icon.height + 2 * w->icon.bw)
@@ -131,8 +136,7 @@
Pixmap SetIconClip();
#endif
-static
-splitEntry (ie, grav1, grav2, w, h)
+void splitEntry (ie, grav1, grav2, w, h)
IconEntry *ie;
int grav1, grav2;
int w, h;
@@ -185,6 +189,7 @@
}
}
+int
roundUp (v, multiple)
int v;
int multiple;
@@ -192,6 +197,7 @@
return ((v + multiple - 1) / multiple) * multiple;
}
+void
PlaceIcon(tmp_win, def_x, def_y, final_x, final_y)
TwmWindow *tmp_win;
int def_x, def_y;
@@ -206,8 +212,8 @@
ir_list = Scr->IconRegions;
while (ir_list)
- if (ir = (IconRegion *)MultiLookInList(ir_list, tmp_win->full_name,
- &tmp_win->class, &ir_list)) {
+ if ((ir = (IconRegion *)MultiLookInList(ir_list, tmp_win->full_name,
+ &tmp_win->class, &ir_list))) {
w = roundUp (iconWidth (tmp_win), ir->stepx);
h = roundUp (iconHeight (tmp_win), ir->stepy);
for (ie = ir->entries; ie; ie=ie->next) {
@@ -264,7 +270,7 @@
return 0;
}
-IconUp (tmp_win)
+void IconUp (tmp_win)
TwmWindow *tmp_win;
{
int x, y;
@@ -290,8 +296,10 @@
ir_list = Scr->IconRegions;
while (ir_list)
- if (ir = (IconRegion *)MultiLookInList(ir_list, tmp_win->full_name,
- &tmp_win->class, &ir_list)) {
+ if ((ir = (IconRegion *)MultiLookInList(ir_list,
+ tmp_win->full_name,
+ &tmp_win->class,
+ &ir_list))) {
if (x >= ir->x && x < (ir->x + ir->w) &&
y >= ir->y && y < (ir->y + ir->h))
break;
@@ -330,8 +338,7 @@
* regions together
*/
-static
-mergeEntries (old, ie)
+void mergeEntries (old, ie)
IconEntry *old, *ie;
{
if (old->y == ie->y) {
@@ -345,7 +352,7 @@
}
}
-IconDown (tmp_win)
+void IconDown (tmp_win)
TwmWindow *tmp_win;
{
IconEntry *ie, *ip, *in;
@@ -381,14 +388,16 @@
}
}
-static int AddOneIconRegion();
-
-AddIconRegion(name, type, geom, itterate, grav1, grav2, stepx, stepy)
+void
+AddIconRegion(name, icontype, geom, itterate, grav1, grav2, stepx, stepy)
char *name;
-short type;
+short icontype;
char *geom;
Bool itterate;
-int grav1, grav2;
+int grav1;
+int grav2;
+int stepx;
+int stepy;
{
int mask, x, y, w, h;
@@ -412,21 +421,21 @@
for (x1 = x ; x1 < vdtw ; x1 += Scr->MyDisplayWidth)
for (y1 = y ; y1 < vdth ; y1 += Scr->MyDisplayHeight)
- AddOneIconRegion(name, type, x1, y1, w, h,
+ AddOneIconRegion(name, icontype, x1, y1, w, h,
grav1, grav2, stepx, stepy);
} else
- AddOneIconRegion(name, type, x, y, w, h, grav1, grav2, stepx, stepy);
+ AddOneIconRegion(name, icontype, x, y, w, h, grav1, grav2, stepx, stepy);
}
-static
+static void
AddOneIconRegion(name, type, x, y, w, h, grav1, grav2, stepx, stepy)
char *name;
short type;
int x, y, w, h;
-int grav1, grav2;
+int grav1, grav2, stepx, stepy;
{
IconRegion *ir;
- int mask;
+/* int mask;*/
ir = (IconRegion *)malloc(sizeof(IconRegion));
AddToList(&(Scr->IconRegions), name, type, (char *)ir);
@@ -498,12 +507,11 @@
width, height,
foreground,
background,
- border_pixel,
pmp)
Pixmap pm, mask;
int depth;
int width, height;
-Pixel foreground, background, border_pixel;
+Pixel foreground, background;
Pixmap *pmp;
{
if ((*pmp = XCreatePixmap(dpy, Scr->Root, width,
@@ -658,7 +666,7 @@
} *cached;
Window image;
XSetWindowAttributes attributes;
- Pixmap pm, clip;
+ Pixmap pm /*, clip*/;
Bool isXpm;
/* check cache first */
@@ -702,14 +710,13 @@
cached->depth = isXpm?Scr->d_depth:1;
- AddToList(&Scr->Icons, name, LTYPE_EXACT_NAME, cached);
+ AddToList(&Scr->Icons, name, LTYPE_EXACT_NAME, (char *) cached);
}
if (!pm_n_mask_to_pm(cached->pm, cached->mask, cached->depth,
cached->width, cached->height,
tmp_win->iconc.fore,
tmp_win->iconc.back,
- tmp_win->icon_border,
&pm))
return False;
@@ -772,7 +779,6 @@
width, height,
tmp_win->iconc.fore,
tmp_win->iconc.back,
- tmp_win->icon_border,
&newpm))
return False;
@@ -819,6 +825,7 @@
* CreateIconWindows Actually creates the windows representing the icon.
*/
+void
CreateIconWindows(tmp_win)
TwmWindow *tmp_win;
{
@@ -1005,6 +1012,7 @@
#define max(x,y) ((x)>(y)?(x):(y))
+void
ConfigureIconWindows(tmp_win)
TwmWindow *tmp_win;
{
@@ -1102,6 +1110,7 @@
* or SqueezeIcon has been turned on for this window.
*/
+void
ShapeIconWindows(tmp_win)
TwmWindow *tmp_win;
{
@@ -1187,6 +1196,7 @@
* PlaceIconWindows figures out where to put it.
*/
+void
PlaceIconWindows(tmp_win, def_x, def_y)
TwmWindow *tmp_win;
int def_x, def_y;
@@ -1217,7 +1227,7 @@
* Finally, here is the top level function.
*/
-CreateIconWindow(tmp_win, def_x, def_y)
+void CreateIconWindow(tmp_win, def_x, def_y)
TwmWindow *tmp_win;
int def_x, def_y;
{
@@ -1234,7 +1244,7 @@
return;
}
-DestroyIconWindow(tmp_win)
+void DestroyIconWindow(tmp_win)
TwmWindow *tmp_win;
{
TwmIcon *icon = &(tmp_win->icon);
|