|
|
@ -88,6 +88,8 @@ static int numdispplanes; |
|
|
|
|
|
|
|
|
extern void internalerror (char *message); |
|
|
extern void internalerror (char *message); |
|
|
extern void externalerror (char *message); |
|
|
extern void externalerror (char *message); |
|
|
|
|
|
static void initlinestyles (void); |
|
|
|
|
|
static void initcolors (GRAPH *graph); |
|
|
extern void PushGraphContext (GRAPH *graph); |
|
|
extern void PushGraphContext (GRAPH *graph); |
|
|
extern void SetColor (int colorid); |
|
|
extern void SetColor (int colorid); |
|
|
extern void Text (char *text, int x, int y); |
|
|
extern void Text (char *text, int x, int y); |
|
|
@ -95,6 +97,7 @@ extern void SaveText (GRAPH *graph, char *text, int x, int y); |
|
|
extern void PopGraphContext (void); |
|
|
extern void PopGraphContext (void); |
|
|
void slopelocation (GRAPH *graph, int x0, int y0); |
|
|
void slopelocation (GRAPH *graph, int x0, int y0); |
|
|
void zoomin (GRAPH *graph); |
|
|
void zoomin (GRAPH *graph); |
|
|
|
|
|
static void X_ScreentoData (GRAPH *graph, int x, int y, double *fx, double *fy); |
|
|
extern int DestroyGraph (int id); |
|
|
extern int DestroyGraph (int id); |
|
|
extern void gr_redraw (GRAPH *graph); |
|
|
extern void gr_redraw (GRAPH *graph); |
|
|
extern void gr_resize (GRAPH *graph); |
|
|
extern void gr_resize (GRAPH *graph); |
|
|
@ -287,6 +290,21 @@ handlekeypressed(Widget w, caddr_t clientdata, caddr_t calldata) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
void |
|
|
|
|
|
keyhandler(clientdata, source, id) |
|
|
|
|
|
caddr_t clientdata; |
|
|
|
|
|
int *source; |
|
|
|
|
|
XtInputId id; |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
KEYwaiting = TRUE; |
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
void |
|
|
void |
|
|
handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata) |
|
|
handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata) |
|
|
{ |
|
|
{ |
|
|
@ -304,6 +322,17 @@ handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
handlemotionev(w, clientdata, calldata) |
|
|
|
|
|
Widget w; |
|
|
|
|
|
caddr_t clientdata, calldata; |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
XMotionEvent *motionev = (XMotionEvent *) calldata; |
|
|
|
|
|
|
|
|
|
|
|
switch |
|
|
|
|
|
} |
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
/* Recover from bad NewViewPort call. */ |
|
|
/* Recover from bad NewViewPort call. */ |
|
|
#define RECOVERNEWVIEWPORT() free((char *) graph);\ |
|
|
#define RECOVERNEWVIEWPORT() free((char *) graph);\ |
|
|
@ -496,6 +525,15 @@ X11_Arc(int x0, int y0, int radius, double theta1, double theta2) |
|
|
x0 - radius, |
|
|
x0 - radius, |
|
|
currentgraph->absolute.height - radius - y0, |
|
|
currentgraph->absolute.height - radius - y0, |
|
|
2 * radius, 2 * radius, t1, t2); |
|
|
2 * radius, 2 * radius, t1, t2); |
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
printf("at %d, %d, %g %g x %d :: (%d, %d)\n", |
|
|
|
|
|
x0, y0, theta1, theta2, radius, t1, t2); |
|
|
|
|
|
printf("skip\n"); |
|
|
|
|
|
XSync(display, 0); |
|
|
|
|
|
printf("XDrawArc(%d, %d, %d, %d, %d, %d)\n", x0 - radius, |
|
|
|
|
|
currentgraph->absolute.height - radius - y0, |
|
|
|
|
|
2 * radius, 2 * radius, t1, t2); |
|
|
|
|
|
# endif |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -540,6 +578,19 @@ X11_SetLinestyle(int linestyleid) |
|
|
|
|
|
|
|
|
if (currentgraph->linestyle != linestyleid) { |
|
|
if (currentgraph->linestyle != linestyleid) { |
|
|
|
|
|
|
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
switch (linestyleid %3) { |
|
|
|
|
|
case 0: |
|
|
|
|
|
values.line_style = LineSolid; |
|
|
|
|
|
break; |
|
|
|
|
|
case 1: |
|
|
|
|
|
values.line_style = LineOnOffDash; |
|
|
|
|
|
break; |
|
|
|
|
|
case 2: |
|
|
|
|
|
values.line_style = LineDoubleDash; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
# endif |
|
|
if ((linestyleid == 0 || numdispplanes > 1) && linestyleid != 1) { |
|
|
if ((linestyleid == 0 || numdispplanes > 1) && linestyleid != 1) { |
|
|
/* solid if linestyle 0 or if has color, allow only one |
|
|
/* solid if linestyle 0 or if has color, allow only one |
|
|
* dashed linestyle */ |
|
|
* dashed linestyle */ |
|
|
@ -808,8 +859,10 @@ killwin(Widget w, caddr_t client_data, caddr_t call_data) |
|
|
|
|
|
|
|
|
/* Iplots are done asynchronously */ |
|
|
/* Iplots are done asynchronously */ |
|
|
DEVDEP(graph).isopen = 0; |
|
|
DEVDEP(graph).isopen = 0; |
|
|
DestroyGraph(graph->graphid); |
|
|
|
|
|
|
|
|
/* MW. Not sure but DestroyGraph might free() to much - try Xt...() first */ |
|
|
XtDestroyWidget(DEVDEP(graph).shell); |
|
|
XtDestroyWidget(DEVDEP(graph).shell); |
|
|
|
|
|
DestroyGraph(graph->graphid); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -825,6 +878,15 @@ redraw(Widget w, caddr_t client_data, caddr_t call_data) |
|
|
int n = 1; |
|
|
int n = 1; |
|
|
|
|
|
|
|
|
DEVDEP(graph).isopen = 1; |
|
|
DEVDEP(graph).isopen = 1; |
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
/* if there is a resize, let the resize routine handle the exposures */ |
|
|
|
|
|
if (XCheckWindowEvent(display, DEVDEP(graph).window, |
|
|
|
|
|
(long) StructureNotifyMask, &ev)) { |
|
|
|
|
|
resize(w, client_data, &ev); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
rects[0].x = pev->x; |
|
|
rects[0].x = pev->x; |
|
|
rects[0].y = pev->y; |
|
|
rects[0].y = pev->y; |
|
|
rects[0].width = pev->width; |
|
|
rects[0].width = pev->width; |
|
|
@ -873,6 +935,38 @@ resize(Widget w, caddr_t client_data, caddr_t call_data) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ifdef notdef |
|
|
|
|
|
/* stolen from CP/lexical.c */ |
|
|
|
|
|
|
|
|
|
|
|
/* A special 'getc' so that we can deal with ^D properly. There is no way for |
|
|
|
|
|
* stdio to know if we have typed a ^D after some other characters, so |
|
|
|
|
|
* don't use buffering at all... |
|
|
|
|
|
*/ |
|
|
|
|
|
static int inchar(fp) |
|
|
|
|
|
FILE *fp; |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
char c; |
|
|
|
|
|
int i; |
|
|
|
|
|
extern int errno; |
|
|
|
|
|
|
|
|
|
|
|
# ifdef HAS_TERMREAD |
|
|
|
|
|
if (cp_interactive && !cp_nocc) { |
|
|
|
|
|
i = read((int) fileno(fp), &c, 1); |
|
|
|
|
|
if (i == 0) |
|
|
|
|
|
return (EOF); |
|
|
|
|
|
else if (i == -1) { |
|
|
|
|
|
perror("read"); |
|
|
|
|
|
return (EOF); |
|
|
|
|
|
} else |
|
|
|
|
|
return ((int) c); |
|
|
|
|
|
} |
|
|
|
|
|
# endif |
|
|
|
|
|
c = getc(fp); |
|
|
|
|
|
return ((int) c); |
|
|
|
|
|
} |
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
void |
|
|
void |
|
|
X11_Input(REQUEST *request, RESPONSE *response) |
|
|
X11_Input(REQUEST *request, RESPONSE *response) |
|
|
{ |
|
|
{ |
|
|
|