aboutsummaryrefslogtreecommitdiffstats
path: root/cad/spice/files/patch-src_lib_fte_x11_c
blob: 692480e17f95bd884f19a9f12f02933f913bb9a7 (plain) (blame)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
--- src/lib/fte/x11.c.orig	1993-04-14 19:44:56.000000000 +0000
+++ src/lib/fte/x11.c	2011-07-26 23:16:48.000000000 +0000
@@ -36,6 +36,10 @@
 extern int _Xdebug;
 #  endif
 
+void initlinestyles(void);
+void initcolors(GRAPH *graph);
+void slopelocation(GRAPH *graph, int x0, int y0);
+
 /* forward declarations */
 extern void handlebuttonev(), handlekeypressed(), killwin(), hardcopy(),
 	    redraw(), resize();
@@ -120,7 +124,10 @@
 	/* "invert" works better than "xor" for B&W */
 
 	/* xor gc should be a function of the pixels that are written on */
-	gcvalues.function = GXxor;
+	/* gcvalues.function = GXxor; */
+	/* this patch makes lines visible on true color displays
+           Guenther Roehrich 22-Jan-99 */
+	gcvalues.function = GXinvert;
 	gcvalues.line_width = 1;
 	gcvalues.foreground = 1;
 	gcvalues.background = 0;
@@ -152,7 +159,7 @@
 {
 	XGetErrorText(display, errorev->error_code, ErrorMessage, 1024);
 	externalerror(ErrorMessage);
-	return;
+	return (0);
 }
 
 /* Recover from bad NewViewPort call. */
@@ -302,7 +309,8 @@
 	return (0);
 }
 
-static
+/* PN static */
+void
 initlinestyles()
 {
 
@@ -318,7 +326,8 @@
 	return;
 }
 
-static
+/* PN static */
+void
 initcolors(graph)
     GRAPH *graph;
 {
@@ -405,6 +414,7 @@
 }
 
 /*ARGSUSED*/
+void
 X11_Arc(x0, y0, radius, theta1, theta2)
 int x0, y0, radius;
 double theta1, theta2;
@@ -612,6 +622,7 @@
 }
 #  endif
 
+void
 slopelocation(graph, x0, y0)
 GRAPH *graph;
 int x0, y0;         /* initial position of mouse */
@@ -805,8 +816,9 @@
 
 	/* Iplots are done asynchronously */
 	DEVDEP(graph).isopen = 0;
+	w = DEVDEP(graph).shell;
 	DestroyGraph(graph->graphid);
-	XtDestroyWidget(DEVDEP(graph).shell);
+	XtDestroyWidget(w);
 
 }
 
@@ -915,6 +927,7 @@
 }
 #  endif
 
+void
 X11_Input(request, response)
     REQUEST *request;
     RESPONSE *response;
@@ -942,7 +955,8 @@
 	            1 << ConnectionNumber(display);
 
 	      /* block on ConnectionNumber and request->fp */
-	      select(nfds + 1, &readfds, (int *) NULL, (int *) NULL, NULL);
+	      /* PN added fd_set * casting */
+	      select(nfds + 1, (fd_set *) &readfds, (fd_set *) NULL, (fd_set *) NULL, NULL);
 
 	      /* handle X events first */
 	      if (readfds & (1 << ConnectionNumber(display))) {
@@ -995,7 +1009,8 @@
 
 }
 
-static X_ScreentoData(graph, x, y, fx, fy)
+/* PN static */ 
+X_ScreentoData(graph, x, y, fx, fy)
 GRAPH *graph;
 int x,y;
 double *fx, *fy;