21 static int mfb_wincount;
27 static void mfbsetcolors(
void);
28 static void mfbsetlinestyles(
void);
30 static void mfbsetcolors();
31 static void mfbsetlinestyles();
41 static char success =
false;
58 fprintf(
cp_out,
"Terminal type = ");
60 (void) fscanf(
cp_in,
" %s", buf);
69 || (strcmp(old_term, term) != 0) || (strcmp(old_dev,dev) != 0)) {
70 (void)
MFBOpen( term, (dev[0] ? dev : (
char *)
NULL), &err);
107 Mfb_NewViewport(
graph)
122 graph->absolute.xpos = 0;
123 graph->absolute.ypos = 0;
171 Mfb_Line(x1, y1, x2, y2)
180 Mfb_Box(x1, y1, x2, y2)
184 (void)
MFBBox(x1, y1, x2, y2);
189 Mfb_Arc(x0, y0, radius, theta1, theta2)
191 double theta1, theta2;
193 double theta3, theta4;
197 if( (theta1 != theta2)
198 &&
sin(fabs( theta1 - theta2 )/2.0) < 0.5 ) {
199 theta3 = ceil((
double) 180.0/
M_PI * theta1);
200 theta4 = floor((
double) 180.0/
M_PI * theta2);
202 if ( theta3 < theta4 && theta3 < 360.0 ) {
203 MFBArc(x0, y0, radius, (
int)theta3, (
int)theta4, 50);
205 theta3 *=
M_PI/180.0;
206 theta4 *=
M_PI/180.0;
213 (void)
MFBLine((
int)(x0+radius*
cos(theta1)),(
int)(y0+radius*
sin(theta1)),
214 (
int)(x0+radius*
cos(theta3)),(
int)(y0+radius*
sin(theta3)));
215 (void)
MFBLine((
int)(x0+radius*
cos(theta2)),(
int)(y0+radius*
sin(theta2)),
216 (
int)(x0+radius*
cos(theta4)),(
int)(y0+radius*
sin(theta4)));
219 (void)
MFBArc(x0, y0, radius,
220 rnd((
double) 180.0/
M_PI * theta1),
221 rnd((
double) 180.0/
M_PI * theta2), 50);
249 Mfb_SetGhost(callback,x,y)
252 void (*callback)(int,int,int,int);
264 Mfb_DefineColor(colorid, red, green, blue)
267 double red, green, blue;
270 rnd(red*1000),
rnd(green*1000),
rnd(blue*1000));
276 Mfb_DefineLinestyle(linestyleid, mask)
299 Mfb_SetColor(colorid)
337 int button = 0,key = 0;
340 switch (request->option) {
346 response->
option = request->option;
355 response->
option = request->option;
359 while (button == 0 && key == 0)
396 static int reds[] = { 999, 0, 999, 0, 0, 999, 999, 0, 999, 500,
397 500, 999, 999, 500, 999, 999, 600, 300, 600, 300 } ;
398 static int grns[] = { 999, 0, 0, 999, 0, 999, 0, 999, 500, 999,
399 500, 999, 500, 999, 600, 300, 999, 999, 300, 600 } ;
400 static int blus[] = { 999, 0, 0, 0, 999, 0, 999, 999, 500, 500,
401 999, 500, 999, 999, 300, 600, 300, 600, 999, 999 } ;
407 int red, green, blue;
427 static int styles[] = { 0333, 0347, 0360, 0071, 0216, 0366, 0155, 0011,
428 0123, 0317, 0330, 0145, 0275, 0016, 0315, 0101,
429 0222, 0174, 0251, 0376 } ;
static char buf[MAXPROMPT]
bool cp_getvar(char *n, int t, char *r)
static char * linestyle[]
union response::@11 reply
int MFBSetGhost(void(*callback)(), int x, int y)
externalerror(char *message)