wdvi

network DVI viewer
Log | Files | Refs

commit eee4e645398a319920c77b4740beb9af391bc092
parent e074efe03ca2520950889990927aafe02934c05c
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Sun, 29 Aug 2021 01:17:25 +0000

Remove MOTIF_TIMERS code

Diffstat:
Mevents.c | 79-------------------------------------------------------------------------------
Mxdvi.h | 4----
2 files changed, 0 insertions(+), 83 deletions(-)

diff --git a/events.c b/events.c @@ -2938,82 +2938,3 @@ do_pages() XFlush(DISP); } } - - -#if MOTIF_TIMERS - -/* - * Newer versions of the Motif toolkit use the timer facility - * (XtAppAddTimeOut(), etc.) in the X Toolkit. Proper functioning of - * this mechanism, however, requires that the X Toolkit be in charge of - * blocking. Since xdvi does its own blocking, this means that we need - * to provide working alternatives to these X Toolkit routines. - * One symptom of the above-mentioned bug is that the printlog window - * eventually stops showing dvips progress until you move the mouse. - */ - -static void xt_alarm(struct xtimer *); - -static struct xtimer *xt_free_timers = NULL; - - -XtIntervalId -XtAppAddTimeOut(app, interval, proc, closure) - XtAppContext app; - unsigned long interval; - XtTimerCallbackProc proc; - XtPointer closure; -{ - struct xtimer *tp; - - if (xt_free_timers == NULL) - tp = xmalloc(sizeof *tp); - else { - tp = xt_free_timers; - xt_free_timers = xt_free_timers->next; - } - - tp->proc = xt_alarm; - tp->xt_proc = proc; - tp->closure = closure; - - set_timer(tp, interval); - - return (XtIntervalId) tp; -} - -void -XtRemoveTimeOut(id) - XtIntervalId id; -{ - struct xtimer *tp; - - tp = (struct xtimer *) id; - - /* Motif (Solaris 9, 2003) sometimes calls XtRemoveTimeOut() after - the timer event has occurred, so we need to be sure not to remove - the timer record twice. */ - if (tp->proc == NULL) - return; - - cancel_timer(tp); - - tp->next = xt_free_timers; - xt_free_timers = tp; -} - -void -xt_alarm(tp) - struct xtimer *tp; -{ - XtIntervalId id; - - tp->proc = NULL; /* flag timer as used-up */ - id = (XtIntervalId) tp; - (tp->xt_proc)(tp->closure, &id); - - tp->next = xt_free_timers; - xt_free_timers = tp; -} - -#endif /* MOTIF_TIMERS */ diff --git a/xdvi.h b/xdvi.h @@ -621,11 +621,7 @@ struct xtimer { #endif }; -#if MOTIF_TIMERS -# define TIMER_INIT(proc) {NULL, {0, 0}, proc, NULL, NULL} -#else # define TIMER_INIT(proc) {NULL, {0, 0}, proc} -#endif struct WindowRec { Window win;