forked from Ermentrout/xppaut
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabort.c
executable file
·78 lines (53 loc) · 1.12 KB
/
abort.c
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
#include "abort.h"
#include <stdlib.h>
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "many_pops.h"
#include "ggets.h"
#include "aniparse.h"
extern Window command_pop;
extern GC gc,gc_graph,small_gc;
extern Display *display;
extern int DCURYb,DCURXb,CURY_OFFb;
extern int DCURYs,DCURXs,CURY_OFFs;
extern int DCURY,DCURX,CURY_OFF;
int get_command_width()
{
int x,y;
unsigned int w,h,bw,de;
Window root;
XGetGeometry(display,command_pop,&root,&x,&y,&w,&h,&bw,&de);
XClearWindow(display,command_pop);
return(w);
}
void plot_command(nit,icount,cwidth)
int nit,icount,cwidth;
{
int i;
float dx;
if(nit==0)return;
dx=(float)icount*(float)cwidth/(float)nit;
i=(int)dx;
XDrawPoint(display,command_pop,gc,i,5);
}
int my_abort()
{
int ch;
XEvent event;
while(XPending(display)>0){
XNextEvent(display,&event);
if(check_ani_pause(event)==27)return(27);
switch(event.type){
case Expose: do_expose(event);
break;
case ButtonPress:
break;
case KeyPress:
ch=get_key_press(&event);
return(ch);
}
return(0);
}
return(64);
}