Debian Codegraph @

contrib/window_managers/olvwm/olvwm-3.3-patch

raw
1 diff -r -c /tmp/olvwm3.3/Debug.c ./Debug.c
2 *** /tmp/olvwm3.3/Debug.c Sat Dec 12 09:27:01 1992
3 --- ./Debug.c Fri Dec 11 22:19:10 1992
4 ***************
5 *** 60,65 ****
6 --- 60,69 ----
7 "ColormapNotify",
8 "ClientMessage",
9 "MappingNotify",
10 + #ifdef SOUNDS
11 + "Startup",
12 + "Shutdown",
13 + #endif
14 };
15
16 void
17 ***************
18 *** 99,101 ****
19 --- 103,209 ----
20 typeNames[win->core.kind]);
21 (void) fflush(stderr);
22 }
23 +
24 + #ifdef SOUNDS
25 + #include <rplay.h>
26 + #include <string.h>
27 + #include <stdio.h>
28 +
29 + #define NEVENTS (sizeof(eventNames) / sizeof(char *))
30 +
31 + RPLAY *rp[NEVENTS];
32 +
33 + static int need_sound_init = 1;
34 + static int sound_fd = 0;
35 + static int sound_state = 1;
36 +
37 + static sound_init()
38 + {
39 + int i;
40 + FILE *fl;
41 + char buffer[100];
42 + char *token;
43 + char hostname[200];
44 +
45 + need_sound_init = 0;
46 + if (sound_fd == 0)
47 + {
48 + gethostname(hostname, 200);
49 + if ((sound_fd = rplay_open(hostname)) < 0)
50 + rplay_perror("create");
51 + }
52 +
53 + /*
54 + * Destroy any old sounds
55 + */
56 + for (i = 0; i < NEVENTS; i++)
57 + {
58 + if (rp[i] != NULL)
59 + rplay_destroy(rp[i]);
60 + rp[i] = NULL;
61 + }
62 +
63 + /*
64 + * Now read the file which contains the sounds
65 + */
66 + fl = fopen(".olvwm-sounds", "r");
67 + if (fl == NULL)
68 + return;
69 + while (fgets(buffer, 100, fl) != NULL)
70 + {
71 + token = strtok(buffer, ": \t");
72 + if (token == NULL)
73 + continue;
74 + for (i = 0; i < NEVENTS; i++)
75 + {
76 + if (strcmp(token, eventNames[i]) == 0)
77 + {
78 + token = strtok(NULL, " \t\r\n");
79 + if (token == NULL || *token == '#'
80 || isspace(*token))
81 + continue;
82 + rp[i] = rplay_create(RPLAY_PLAY);
83 + if (rp[i] == NULL)
84 + {
85 + rplay_perror("create");
86 + continue;
87 + }
88 + if (rplay_set(rp[i], RPLAY_INSERT, 0,
89 + RPLAY_SOUND, token,
90 + NULL) < 0)
91 + {
92 + rplay_perror("rplay");
93 + }
94 + }
95 + }
96 + }
97 + fclose(fl);
98 + }
99 +
100 +
101 + play_sound(snd)
102 + int snd;
103 + {
104 + if (sound_state == 0)
105 + return;
106 +
107 + if (need_sound_init)
108 + sound_init();
109 +
110 + if (rp[snd] == NULL)
111 + return;
112 + if (rplay(sound_fd, rp[snd]) < 0)
113 + rplay_perror("create");
114 + }
115 +
116 +
117 + toggle_sound()
118 + {
119 + sound_state ^= 1;
120 + }
121 +
122 +
123 + reread_sounds()
124 + {
125 + sound_init();
126 + }
127 + #endif
128 diff -r -c /tmp/olvwm3.3/Makefile.sunpro ./Makefile.sunpro
129 *** /tmp/olvwm3.3/Makefile.sunpro Sat Dec 12 09:27:02 1992
130 --- ./Makefile.sunpro Sat Dec 12 08:20:29 1992
131 ***************
132 *** 33,40 ****
133 #
134 # You shouldn't need to change anything below this line
135
136 ! INC = -I${OPENWINHOME}/include
137 ! CFLAGS = ${INC} ${DEBUG} -DOW_I18N_L3 -DSUNDAE -DSHAPE
138
139 HEADERS = cmdstream.h cursors.h defaults.h environ.h events.h gettext.h \
140 globals.h group.h helpcmd.h i18n.h iconimage.h iconmask.h \
141 --- 33,40 ----
142 #
143 # You shouldn't need to change anything below this line
144
145 ! INC = -I${OPENWINHOME}/include -I/usr/local/include
146 ! CFLAGS = ${INC} ${DEBUG} -DOW_I18N_L3 -DSUNDAE -DSHAPE -DSOUNDS
147
148 HEADERS = cmdstream.h cursors.h defaults.h environ.h events.h gettext.h \
149 globals.h group.h helpcmd.h i18n.h iconimage.h iconmask.h \
150 ***************
151 *** 53,59 ****
152 ol_button.c
153
154 LDFLAGS = -L${OPENWINHOME}/lib
155 ! LIBS = ${LDFLAGS} -lolgx -lX11 -lXext -ll -lm
156
157 OBJS = ${SRCS:.c=.o} ${VERSION}
158
159 --- 53,59 ----
160 ol_button.c
161
162 LDFLAGS = -L${OPENWINHOME}/lib
163 ! LIBS = ${LDFLAGS} -lolgx -lX11 -lXext -ll -lm -lrplay
164
165 OBJS = ${SRCS:.c=.o} ${VERSION}
166
167 diff -r -c /tmp/olvwm3.3/events.c ./events.c
168 *** /tmp/olvwm3.3/events.c Sat Dec 12 09:27:05 1992
169 --- ./events.c Fri Dec 11 22:21:34 1992
170 ***************
171 *** 160,165 ****
172 --- 160,168 ----
173 if (GRV.PrintAll)
174 DebugEvent(event, "Dispatch - debug");
175
176 + #ifdef SOUNDS
177 + play_sound(event->type);
178 + #endif
179 saveTimestamp( event );
180
181 if (winInfo == NULL)
182 diff -r -c /tmp/olvwm3.3/olwm.c ./olwm.c
183 *** /tmp/olvwm3.3/olwm.c Sat Dec 12 09:27:13 1992
184 --- ./olwm.c Fri Dec 11 22:23:02 1992
185 ***************
186 *** 369,374 ****
187 --- 369,377 ----
188
189 sendSyncSignal();
190
191 + #ifdef SOUNDS
192 + play_sound(35);
193 + #endif
194 EventLoop( DefDpy );
195
196 /*NOTREACHED*/
197 ***************
198 *** 569,574 ****
199 --- 572,580 ----
200
201 SlaveStop();
202 ListApply(ActiveClientList, ClientShutdown, (void *)0);
203 + #ifdef SOUNDS
204 + play_sound(36);
205 + #endif
206 XSync(dpy, True);
207 exit(0);
208 /*NOTREACHED*/
209 diff -r -c /tmp/olvwm3.3/usermenu.c ./usermenu.c
210 *** /tmp/olvwm3.3/usermenu.c Sat Dec 12 09:27:18 1992
211 --- ./usermenu.c Fri Dec 11 22:25:28 1992
212 ***************
213 *** 190,195 ****
214 --- 190,199 ----
215 extern int GenDirMenuFunc();
216 extern int StickSelnFunc();
217 extern int MoveDesktopFunc();
218 + #ifdef SOUNDS
219 + extern int toggle_sound();
220 + extern int reread_sounds();
221 + #endif
222
223 /* ---------------------------------------------------------------------
224 * local forward declarations
225 ***************
226 *** 1334,1340 ****
227 },
228 {
229 "MOVE_DESKTOP", MoveDesktopFunc, ServiceToken
230 ! }
231 };
232
233 #define NSERVICES COUNT(svctokenlookup)
234 --- 1338,1352 ----
235 },
236 {
237 "MOVE_DESKTOP", MoveDesktopFunc, ServiceToken
238 ! },
239 ! #ifdef SOUNDS
240 ! {
241 ! "FLIPSOUND", toggle_sound, ServiceToken
242 ! },
243 ! {
244 ! "REREADSOUNDS", reread_sounds, ServiceToken
245 ! },
246 ! #endif
247 };
248
249 #define NSERVICES COUNT(svctokenlookup)