Mercurial > vim
comparison src/if_mzsch.c @ 16:3ba373b54370 v7.0008
updated for version 7.0008
author | vimboss |
---|---|
date | Mon, 12 Jul 2004 15:53:54 +0000 |
parents | 631143ac4a01 |
children | 3e7d17e425b0 |
comparison
equal
deleted
inserted
replaced
15:631143ac4a01 | 16:3ba373b54370 |
---|---|
206 static long range_start; | 206 static long range_start; |
207 static long range_end; | 207 static long range_end; |
208 | 208 |
209 /* MzScheme threads scheduling stuff */ | 209 /* MzScheme threads scheduling stuff */ |
210 static int mz_threads_allow = 0; | 210 static int mz_threads_allow = 0; |
211 #ifdef FEAT_GUI | |
212 static void setup_timer(void); | |
213 static void remove_timer(void); | |
214 #endif | |
215 | 211 |
216 #if defined(FEAT_GUI_W32) | 212 #if defined(FEAT_GUI_W32) |
217 static void CALLBACK timer_proc(HWND, UINT, UINT, DWORD); | 213 static void CALLBACK timer_proc(HWND, UINT, UINT, DWORD); |
218 static UINT timer_id = 0; | 214 static UINT timer_id = 0; |
219 #elif defined(FEAT_GUI_GTK) | 215 #elif defined(FEAT_GUI_GTK) |
224 static XtIntervalId timer_id = (XtIntervalId)0; | 220 static XtIntervalId timer_id = (XtIntervalId)0; |
225 #elif defined(FEAT_GUI_MAC) | 221 #elif defined(FEAT_GUI_MAC) |
226 pascal void timer_proc(EventLoopTimerRef, void *); | 222 pascal void timer_proc(EventLoopTimerRef, void *); |
227 static EventLoopTimerRef timer_id = NULL; | 223 static EventLoopTimerRef timer_id = NULL; |
228 static EventLoopTimerUPP timerUPP; | 224 static EventLoopTimerUPP timerUPP; |
225 #elif defined(FEAT_GUI_KDE) | |
226 static int timer_id = 0; | |
229 #endif | 227 #endif |
230 | 228 |
231 #ifndef FEAT_GUI_W32 /* Win32 console and Unix */ | 229 #ifndef FEAT_GUI_W32 /* Win32 console and Unix */ |
232 void | 230 void |
233 mzvim_check_threads(void) | 231 mzvim_check_threads(void) |
246 } | 244 } |
247 } | 245 } |
248 } | 246 } |
249 #endif | 247 #endif |
250 | 248 |
251 #ifdef FEAT_GUI | 249 #ifdef MZSCHEME_GUI_THREADS |
250 static void setup_timer(void); | |
251 static void remove_timer(void); | |
252 | |
252 /* timers are presented in GUI only */ | 253 /* timers are presented in GUI only */ |
253 # if defined(FEAT_GUI_W32) | 254 # if defined(FEAT_GUI_W32) |
254 static void CALLBACK | 255 static void CALLBACK |
255 timer_proc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) | 256 timer_proc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) |
256 # elif defined(FEAT_GUI_GTK) | 257 # elif defined(FEAT_GUI_GTK) |
262 static void | 263 static void |
263 timer_proc(XtPointer timed_out, XtIntervalId *interval_id) | 264 timer_proc(XtPointer timed_out, XtIntervalId *interval_id) |
264 # elif defined(FEAT_GUI_MAC) | 265 # elif defined(FEAT_GUI_MAC) |
265 pascal void | 266 pascal void |
266 timer_proc(EventLoopTimerRef theTimer, void *userData) | 267 timer_proc(EventLoopTimerRef theTimer, void *userData) |
268 #elif defined(FEAT_GUI_KDE) | |
269 void | |
270 timer_proc(void) | |
267 # endif | 271 # endif |
268 { | 272 { |
269 scheme_check_threads(); | 273 scheme_check_threads(); |
270 # if defined(FEAT_GUI_GTK) | 274 # if defined(FEAT_GUI_GTK) |
271 return TRUE; /* continue receiving notifications */ | 275 return TRUE; /* continue receiving notifications */ |
288 timer_id = XtAppAddTimeOut(app_context, p_mzq, timer_proc, NULL); | 292 timer_id = XtAppAddTimeOut(app_context, p_mzq, timer_proc, NULL); |
289 # elif defined(FEAT_GUI_MAC) | 293 # elif defined(FEAT_GUI_MAC) |
290 timerUPP = NewEventLoopTimerUPP(timer_proc); | 294 timerUPP = NewEventLoopTimerUPP(timer_proc); |
291 InstallEventLoopTimer(GetMainEventLoop(), p_mzq * kEventDurationMillisecond, | 295 InstallEventLoopTimer(GetMainEventLoop(), p_mzq * kEventDurationMillisecond, |
292 p_mzq * kEventDurationMillisecond, timerUPP, NULL, &timer_id); | 296 p_mzq * kEventDurationMillisecond, timerUPP, NULL, &timer_id); |
297 #elif defined(FEAT_GUI_KDE) | |
298 mzscheme_kde_start_timer(); | |
299 timer_id = 1; /* just signal that timer was started */ | |
293 # endif | 300 # endif |
294 } | 301 } |
295 | 302 |
296 static void | 303 static void |
297 remove_timer(void) | 304 remove_timer(void) |
303 # elif defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) | 310 # elif defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) |
304 XtRemoveTimeOut(timer_id); | 311 XtRemoveTimeOut(timer_id); |
305 # elif defined(FEAT_GUI_MAC) | 312 # elif defined(FEAT_GUI_MAC) |
306 RemoveEventLoopTimer(timer_id); | 313 RemoveEventLoopTimer(timer_id); |
307 DisposeEventLoopTimerUPP(timerUPP); | 314 DisposeEventLoopTimerUPP(timerUPP); |
315 #elif defined(FEAT_GUI_KDE) | |
316 mzscheme_kde_stop_timer(); | |
308 # endif | 317 # endif |
309 timer_id = 0; | 318 timer_id = 0; |
310 } | 319 } |
311 | 320 |
312 void | 321 void |
316 remove_timer(); | 325 remove_timer(); |
317 if (mz_threads_allow && p_mzq > 0 && gui.in_use) | 326 if (mz_threads_allow && p_mzq > 0 && gui.in_use) |
318 setup_timer(); | 327 setup_timer(); |
319 } | 328 } |
320 | 329 |
321 #endif | 330 #endif /* MZSCHEME_GUI_THREADS */ |
322 | 331 |
323 static void | 332 static void |
324 notify_multithread(int on) | 333 notify_multithread(int on) |
325 { | 334 { |
326 mz_threads_allow = on; | 335 mz_threads_allow = on; |
327 #ifdef FEAT_GUI | 336 #ifdef MZSCHEME_GUI_THREADS |
328 if (on && timer_id == 0 && p_mzq > 0 && gui.in_use) | 337 if (on && timer_id == 0 && p_mzq > 0 && gui.in_use) |
329 setup_timer(); | 338 setup_timer(); |
330 if (!on && timer_id != 0) | 339 if (!on && timer_id != 0) |
331 remove_timer(); | 340 remove_timer(); |
332 #endif | 341 #endif |