File: abort.c

package info (click to toggle)
xppaut 8.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,332 kB
  • sloc: ansic: 74,690; makefile: 127; sh: 92
file content (78 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download | duplicates (3)
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
#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);
}