Jspice3
mfbbasic.c
Go to the documentation of this file.
1 /**********
2 Copyright 1990 Regents of the University of California. All rights reserved.
3 Author: -C- 1982 Giles C. Billingsley
4 **********/
5 /*
6  * mfbbasic.c
7  *
8  * sccsid "@(#)mfbbasic.c 1.9 9/3/83"
9  *
10  * MFB is a graphics package that was developed by the integrated
11  * circuits group of the Electronics Research Laboratory and the
12  * Department of Electrical Engineering and Computer Sciences at
13  * the University of California, Berkeley, California. The programs
14  * in MFB are available free of charge to any interested party.
15  * The sale, resale, or use of these program for profit without the
16  * express written consent of the Department of Electrical Engineering
17  * and Computer Sciences, University of California, Berkeley, California,
18  * is forbidden.
19  */
20 
21 
22 #include "spice.h"
23 #include "mfb.h"
24 #include <stdio.h>
25 #include <string.h>
26 
27 #define RadToDeg 57.29577951
28 #define MFBFORMAT MFBCurrent->strings
29 
30 /* Here we take care of externs */
32 
33 extern void MFBNaiveBoxFill();
34 void MFBSetGhost() {}
35 
36 
37 /*****************************************************************************
38  *
39  * BASIC MACROS AND SERVICE ROUTINES
40  *
41  *****************************************************************************/
42 
43 int
44 MFBInfo(Info)
45 int Info;
46 {
47  /*
48  * Notes:
49  * MFBInfo is the only routine for acquiring device
50  * specific information. The valid arguments are to
51  * MFBInfo are defined in mfb.h. If an invalid argument
52  * is used, MFBInfo returns -1.
53  */
54  switch(Info){
55  case MAXX:
56  return(MFBCurrent->maxX);
57  case MAXY:
58  return(MFBCurrent->maxY);
59  case MAXCOLORS:
60  return(MFBCurrent->maxColors);
61  case MAXINTENSITY:
62  return(MFBCurrent->maxIntensity);
63  case MAXFILLPATTERNS:
64  return(MFBCurrent->maxFillPatterns);
65  case MAXLINESTYLES:
66  return(MFBCurrent->maxLineStyles);
67  case MAXBLINKERS:
68  return(MFBCurrent->maxBlinkers);
69  case POINTINGDEVICE:
70  return((int)MFBCurrent->PointingDeviceBool);
71  case POINTINGBUTTONS:
72  return((int)MFBCurrent->buttonsBool);
73  case NUMBUTTONS:
74  return(MFBCurrent->numberOfButtons);
75  case BUTTON1:
76  return(MFBCurrent->buttonMask[0]);
77  case BUTTON2:
78  return(MFBCurrent->buttonMask[1]);
79  case BUTTON3:
80  return(MFBCurrent->buttonMask[2]);
81  case BUTTON4:
82  return(MFBCurrent->buttonMask[3]);
83  case BUTTON5:
84  return(MFBCurrent->buttonMask[4]);
85  case BUTTON6:
86  return(MFBCurrent->buttonMask[5]);
87  case BUTTON7:
88  return(MFBCurrent->buttonMask[6]);
89  case BUTTON8:
90  return(MFBCurrent->buttonMask[7]);
91  case BUTTON9:
92  return(MFBCurrent->buttonMask[8]);
93  case BUTTON10:
94  return(MFBCurrent->buttonMask[9]);
95  case BUTTON11:
96  return(MFBCurrent->buttonMask[10]);
97  case BUTTON12:
98  return(MFBCurrent->buttonMask[11]);
99  case TEXTPOSITIONALBE:
100  return((int)MFBCurrent->textPositionableBool);
101  case TEXTROTATABLE:
102  return((int)MFBCurrent->textRotateBool);
103  case FONTHEIGHT:
104  return(MFBCurrent->fontHeight);
105  case FONTWIDTH:
106  return(MFBCurrent->fontWidth);
107  case FONTXOFFSET:
108  return(MFBCurrent->fontXOffset);
109  case FONTYOFFSET:
110  return(MFBCurrent->fontYOffset);
111  case DESTRUCTIVETEXT:
112  return((int)MFBCurrent->replaceTextBool);
113  case OVERSTRIKETEXT:
114  return((int)MFBCurrent->overstrikeTextBool);
115  case VLT:
116  return((int)MFBCurrent->vltBool);
117  case BLINKERS:
118  return((int)MFBCurrent->blinkersBool);
119  case FILLEDPOLYGONS:
120  return((int)MFBCurrent->filledPlygnBool);
121  case DEFFILLPATTERNS:
122  return((int)MFBCurrent->fillPtrnDefineBool);
123  case DEFREADMASK:
124  return((int)MFBCurrent->readMaskBool);
125  case DEFCHANNELMASK:
126  return((int)MFBCurrent->channelMaskBool);
127  case DEFLINEPATTERN:
128  return((int)MFBCurrent->linePatternDefineBool);
129  case CURFGCOLOR:
130  return(MFBCurrent->fgColorId);
131  case CURFILLPATTERN:
132  return(MFBCurrent->fillPattern);
133  case CURLINESTYLE:
134  return(MFBCurrent->lineStyle);
135  case CURCHANNELMASK:
136  return(MFBCurrent->channelMask);
137  case CURREADMASK:
138  return(MFBCurrent->readMask);
139  case NUMBITPLANES:
140  return(MFBCurrent->lengthOfVLT);
141  case RASTERCOPY:
142  return((int)MFBCurrent->rastCopyBool);
143  case OFFSCREENX:
144  return(MFBCurrent->minOffScreenX);
145  case OFFSCREENY:
146  return(MFBCurrent->minOffScreenY);
147  case OFFSCREENDX:
148  return(MFBCurrent->offScreenDX);
149  case OFFSCREENDY:
150  return(MFBCurrent->offScreenDY);
151  default:
152  return(-1);
153  }
154 }
155 
156 
157 void
159 int r,g,b;
160  /*
161  * Notes:
162  * The HLS values are returned in MFBCurrent->Y,
163  * MFBCurrent->Z, and MFBCurrent->T.
164  */
165 {
166  double rrr,ggg,bbb,rr,gg,bb,sum,dif,mx,mn,lit,intensity;
167  intensity = (double)MFBCurrent->maxIntensity;
168  /* RGB is normalized to 1000 */
169  rr = ((double) r)/1000.0;
170  gg = ((double) g)/1000.0;
171  bb = ((double) b)/1000.0;
172  mx = rr;
173  if(mx < gg) mx = gg;
174  if(mx < bb) mx = bb;
175  mn = rr;
176  if(mn > gg) mn = gg;
177  if(mn > bb) mn = bb;
178  sum = mx + mn; dif = mx - mn;
179  if(dif != 0.0){
180  rrr = (mx - rr)/dif; ggg = (mx - gg)/dif; bbb = (mx - bb)/dif;
181  }
182  /* lightness calculation */
183  lit = sum/2.0;
184  /* saturation calculation */
185  if(mx == mn) MFBCurrent->T = 0;
186  else if(lit <= .5) MFBCurrent->T = (int)(intensity * dif/sum);
187  else MFBCurrent->T = (int)((intensity * dif)/(2.0 - sum));
188  /* hue calculation */
189  if(MFBCurrent->T == 0) MFBCurrent->Y = 0;
190  else if(rr == mx) MFBCurrent->Y = (int)(60.0 * (2.0 + bbb - ggg));
191  else if(gg == mx) MFBCurrent->Y = (int)(60.0 * (4.0 + rrr - bbb));
192  else MFBCurrent->Y = (int)(60.0 * (6.0 + ggg - rrr));
193  MFBCurrent->Z = (int)(intensity * lit);
194 }
195 
196 
197 void
199 MFB *mfb;
200  /*
201  * Notes:
202  * Set the current frame buffer. Since each MFB struct contains
203  * all necessary I/O information, it is possible for a host
204  * program to manipulate several different graphics displays by
205  * simply maintaining a MFB struct for each device.
206  */
207 {
208  MFBCurrent = mfb;
209 }
210 
211 
212 void
214 #ifdef DEBUG
215  if(MFBCurrent == NULL) return;
216  MFBCurrent->nChars = MFBCurrent->nBoxes
217  = MFBCurrent->nLines = MFBCurrent->nChars
218  = MFBCurrent->sumBoxArea = MFBCurrent->sumLineLength = 0;
219 #endif
220 }
221 
222 
223 void
224 MFBCounters(nChars,nBoxes,meanBoxArea,nLines,meanLineLength,nPixels)
225 int *nChars,*nBoxes,*meanBoxArea,*nLines,*meanLineLength,*nPixels;
226 {
227 #ifdef DEBUG
228  /*
229  * routine for measuring approximate pixel bandwidth
230  */
231  *nChars = MFBCurrent->nChars;
232  *nBoxes = MFBCurrent->nBoxes;
233  *nLines = MFBCurrent->nLines;
234  *meanLineLength = 0;
235  *meanBoxArea = 0;
236  if(MFBCurrent->nBoxes != 0)
237  *meanBoxArea = MFBCurrent->sumBoxArea/MFBCurrent->nBoxes;
238  if(MFBCurrent->nLines != 0)
239  *meanLineLength = MFBCurrent->sumLineLength/MFBCurrent->nLines;
240  *nPixels =
241  MFBCurrent->nChars*MFBCurrent->fontHeight*MFBCurrent->fontWidth+
242  MFBCurrent->sumBoxArea+
243  MFBCurrent->sumLineLength;
244 #else
245  *nChars = *nBoxes = *nLines = *meanLineLength = *meanBoxArea = 0;
246 #endif
247 }
248 
249 
250 
251 
252 
253 /*****************************************************************************
254  *
255  * SET VIEWPORT ATTRIBUTES
256  *
257  *****************************************************************************/
258 
260 int styleId;
261  /*
262  * Notes:
263  * Sets current line style.
264  * Return immediately if line style is already current.
265  * Return MFBBADLST if styleId is out of range.
266  */
267 {
268  /*
269  * Check if styleId is already the current line style
270  */
271  if(styleId == MFBCurrent->lineStyle && !MFBCurrent->reissueLineStyleBool)
272  return(MFBOK);
273  if(styleId < 0 || styleId >= MFBCurrent->maxLineStyles)
274  /* bad styleId */
275  return(MFBBADLST);
276  else {
277  MFBCurrent->X = MFBCurrent->lineStyle = styleId;
278  if(styleId == 0 && MFBFORMAT.setSolidLineStyle != NULL
279  && *MFBFORMAT.setSolidLineStyle != 0)
280  MFBGenCode(MFBFORMAT.setSolidLineStyle);
281  else
282  MFBGenCode(MFBFORMAT.setLineStyle);
283  }
284  return(MFBOK);
285 }
286 
287 
289 int styleId;
290  /*
291  * Notes:
292  * Sets current fill pattern.
293  *
294  * CURRENT COLOR MUST BE SET PRIOR TO SETTING FILL STYLE!!!!!!!!
295  * Some frame buffers allow multi-colored stipple patterns.
296  * MFB sets all pixels in the bit array to either the
297  * background color (ID = 0) or the current forground color.
298  */
299 {
300 
301  /*
302  * Check if styleId is already the current fill style
303  */
304  if(styleId == MFBCurrent->fillPattern)
305  return(MFBOK);
306  if(styleId < 0 || styleId >= MFBCurrent->maxFillPatterns)
307  /* bad styleId */
308  return(MFBBADFST);
309  else {
310  MFBCurrent->X = MFBCurrent->fillPattern = styleId;
311  if(styleId == 0 && MFBFORMAT.setSolidFillPattern != NULL
312  && *MFBFORMAT.setSolidFillPattern != 0)
313  MFBGenCode(MFBFORMAT.setSolidFillPattern);
314  else
315  MFBGenCode(MFBFORMAT.setFillPattern);
316  }
317  return(MFBOK);
318 }
319 
320 
321 int
322 MFBSetChannelMask(channelMask)
323 int channelMask;
324  /*
325  * Notes:
326  * Sets write enable mask. This is relevant only to terminals
327  * which have write enable masks.
328  */
329 {
330 
331  /* Is channel mask already set? */
332  if(channelMask == MFBCurrent->channelMask)
333  return(MFBOK);
334  /* Are there channel or write-enable masks? */
335  if(!MFBCurrent->channelMaskBool)
336  return(MFBNOMASK);
337  else{
338  MFBCurrent->X = MFBCurrent->channelMask = channelMask;
339  MFBGenCode(MFBFORMAT.channelMaskSet);
340  }
341  return(MFBOK);
342 }
343 
344 
345 int
346 MFBSetReadMask(readMask)
347 int readMask;
348  /*
349  * Notes:
350  * Sets write enable mask. This is relevant only to terminals
351  * which have write enable masks.
352  */
353 {
354 
355  /* Is channel mask already set? */
356  if(readMask == MFBCurrent->readMask)
357  return(MFBOK);
358  /* Are there channel or write-enable masks? */
359  if(!MFBCurrent->readMaskBool)
360  return(MFBNOMASK);
361  else{
362  MFBCurrent->X = MFBCurrent->readMask = readMask;
363  MFBGenCode(MFBFORMAT.readMaskSet);
364  }
365  return(MFBOK);
366 }
367 
368 
369 int
370 MFBSetColor(colorId)
371 int colorId;
372  /*
373  * Notes:
374  * Sets the current (foreground) color to `colorId'.
375  */
376 {
377 
378  /*
379  * Check if styleId is already the foreground color
380  */
381  if(colorId == MFBCurrent->fgColorId) return(MFBOK);
382 
383  if(colorId < 0 || colorId >= MFBCurrent->maxColors)
384  /* bad colorId */
385  return(MFBBADCST);
386  else {
387  MFBCurrent->X = MFBCurrent->fgColorId = colorId;
388  MFBGenCode(MFBFORMAT.setForegroundColor);
389  }
390  return(MFBOK);
391 }
392 
393 
394 int
395 MFBSetTextMode(destructiveBool)
396 Bool destructiveBool;
397  /*
398  * Notes:
399  * Changes mode of displaying text if possible.
400  * If destructiveBool is true,the the destructive
401  * text mode is set. Also,the text index is changed
402  * to colorId.
403  */
404 {
405  if(MFBCurrent->textMode != (int)destructiveBool) {
406  if(destructiveBool){
407  if(!MFBCurrent->replaceTextBool)
408  return(MFBBADTM1);
409  MFBGenCode(MFBFORMAT.replaceON);
410  }
411  else{
412  if(!MFBCurrent->overstrikeTextBool)
413  return(MFBBADTM2);
414  MFBGenCode(MFBFORMAT.overstrikeON);
415  }
416  MFBCurrent->textMode = (int)destructiveBool;
417  }
418  return(MFBOK);
419 }
420 
421 
422 int
424 int mode;
425  /*
426  * Notes:
427  * This routine changes the mode by which pixels on the screen
428  * are changed when written over. The four possible operations
429  * are:
430  * mode = MFBALUJAM JAM (replace mode)
431  * mode = MFBALUOR OR
432  * mode = MFBALUNOR NOR
433  * mode = MFBALUEOR EOR
434  * If MFB cannot set the ALU mode, MFBBADALU is returned. Otherwise,
435  * MFBOK is returned.
436  */
437 {
438  char *cp;
439  switch(mode){
440  case MFBALUJAM:
441  cp = MFBFORMAT.setALUJAM;
442  break;
443  case MFBALUOR:
444  cp = MFBFORMAT.setALUOR;
445  break;
446  case MFBALUNOR:
447  cp = MFBFORMAT.setALUNOR;
448  break;
449  case MFBALUEOR:
450  cp = MFBFORMAT.setALUEOR;
451  break;
452  default:
453  cp = NULL;
454  }
455  if(cp == NULL || *cp == 0)
456  return(MFBBADALU);
457  MFBGenCode(cp);
458  return(MFBOK);
459 }
460 
461 
462 int
463 MFBSetCursorColor(colorId1,colorId2)
464 int colorId1,colorId2;
465  /*
466  * Notes:
467  * The cursor color is set when the pointing device is initialized
468  */
469 {
470  MFBCurrent->cursorColor1Id = colorId1;
471  MFBCurrent->cursorColor2Id = colorId2;
472  return(MFBOK);
473 }
474 
475 
476 int
477 MFBSetBlinker(colorId,r,g,b,onFlag)
478 int colorId,r,g,b,onFlag;
479  /*
480  * Notes:
481  * Turn ON or OF a blinking color.
482  */
483 {
484  if(!MFBCurrent->blinkersBool)
485  return(MFBNOBLNK);
486 
487  MFBCurrent->X = colorId;
488  if(MFBCurrent->vltUseHLSBool){
489  MFBConvertToHLS(r,g,b);
490  }
491  else{
492  /* Normalize to 1000 */
493  MFBCurrent->Y = r * MFBCurrent->maxIntensity / 1000;
494  MFBCurrent->Z = g * MFBCurrent->maxIntensity / 1000;
495  MFBCurrent->T = b * MFBCurrent->maxIntensity / 1000;
496  }
497 
498  if(onFlag == ON) {
499  MFBGenCode(MFBFORMAT.blinkerON);
500  ++MFBCurrent->numBlinkers;
501  }
502  else {
503  MFBGenCode(MFBFORMAT.blinkerOFF);
504  --MFBCurrent->numBlinkers;
505  }
506  if(MFBCurrent->numBlinkers >= MFBCurrent->maxBlinkers)
507  return(MFBTMBLNK);
508  return(MFBOK);
509 }
510 
511 
512 int
513 MFBSetRubberBanding(RubberBandingBool,X,Y)
514 Bool RubberBandingBool;
515 int X,Y;
516  /*
517  * Notes:
518  * Turn ON or OFF rubberbanding of pointing device.
519  * The center of the rubberbanding is assumed to be the current
520  * graphics position,but may be kludged in the enable sequence.
521  */
522 {
523  if(MFBFORMAT.enableRubberBanding == NULL
524  || *MFBFORMAT.enableRubberBanding == 0)
525  return(MFBNORBND);
526  if(RubberBandingBool){
527  MFBCurrent->X = X;
528  MFBCurrent->Y = Y;
529  MFBGenCode(MFBFORMAT.movePenSequence);
530  MFBGenCode(MFBFORMAT.enableRubberBanding);
531  }
532  else
533  MFBGenCode(MFBFORMAT.disableRubberBanding);
534  return(MFBOK);
535 }
536 
537 
538 
539 
540 
541 
542 /*****************************************************************************
543  *
544  * DEFINE VIEWPORT ATTRIBUTES
545  *
546  *****************************************************************************/
547 
548 int
549 MFBDefineColor(colorId,r,g,b)
550 int colorId,r,g,b;
551  /*
552  * Notes:
553  * Defines an entry in the VLT contained in the terminal.
554  * r,g, and b are the red, green, blue intensities normalized
555  * to 1000.
556  */
557 {
558 
559  /* Are there user defineable colors? */
560  if(!MFBCurrent->vltBool)
561  return(MFBNODFCO);
562  if(MFBCurrent->vltUseHLSBool){
563  /* HLS return in MFBCurrent->Y, MFBCurrent->Z, MFBCurrent->T */
564  MFBConvertToHLS(r,g,b);
565  }
566  else{
567  /* Normalize to 1000 */
568  MFBCurrent->Y = r * MFBCurrent->maxIntensity / 1000;
569  MFBCurrent->Z = g * MFBCurrent->maxIntensity / 1000;
570  MFBCurrent->T = b * MFBCurrent->maxIntensity / 1000;
571  }
572  MFBCurrent->X = MFBmax(0,MFBmin(MFBCurrent->maxColors,colorId));
573  MFBGenCode(MFBFORMAT.vltEntry);
574  return(MFBOK);
575 }
576 
577 
578 int
579 MFBDefineFillPattern(styleId,BitArray)
580 int styleId;
581 int *BitArray;
582  /*
583  * Notes:
584  * A very difficult procedure to generalize.
585  * BitArray is a pointer to 8 integers for which the 8 least
586  * significant bits represent one row in the fill pattern.
587  */
588 {
589  int i,*j,Count;
590 
591  /* save current stipple pattern */
592  for(i=0; i<8; ++i)
593  MFBCurrent->stipplePattern[i] = BitArray[i];
594 
595  /*
596  * Are there defineable fill patterns for this frame buffer?
597  */
598  if(!MFBCurrent->fillPtrnDefineBool)
599  return(MFBNODFFP);
600 
601  MFBCurrent->X = styleId;
602  if(MFBCurrent->fillDefineRowMajorBool)
603  Count = MFBCurrent->fillDefineHeight;
604  else
605  Count = MFBCurrent->fillDefineWidth;
606  MFBGenCode(MFBFORMAT.fillDefineStart);
607  for(i=0; i<Count; ++i){
608  if( (int)((i/8) * 8) == i) j = BitArray;
609  MFBCurrent->Y = *j++;
610  MFBGenCode(MFBFORMAT.fillDefineFormat);
611  }
612  MFBGenCode(MFBFORMAT.fillDefineEnd);
613  /* return with the new fill pattern as the current one */
614  return( MFBSetFillPattern(styleId) );
615 }
616 
617 
618 int
619 MFBDefineLineStyle(styleId,BitArray)
620 int styleId;
621 int BitArray;
622 {
623  int l;
624 
625  /*
626  * Are there defineable line styles for this frame buffer?
627  */
628  if(!MFBCurrent->linePatternDefineBool)
629  return(MFBNODFLP);
630 
631  MFBCurrent->X = styleId;
632  MFBGenCode(MFBFORMAT.lineDefineStart);
633  MFBCurrent->Y = BitArray;
634  for(l = 0; l < MFBCurrent->lineDefineLength; ++l)
635  MFBGenCode(MFBFORMAT.lineDefineFormat);
636  MFBGenCode(MFBFORMAT.lineDefineEnd);
637  /* return with the new line style as the current one */
638  return( MFBSetLineStyle(styleId) );
639 }
640 
641 
642 
643 
644 
645 
646 /*****************************************************************************
647  *
648  * BASIC VIEWPORT GEOMETRIES
649  *
650  *****************************************************************************/
651 
652 int LastX, LastY; /* used for terminals which have no drawLineToSeq. */
653 
654 void
655 MFBMoveTo(X1,Y1)
656 int X1,Y1;
657  /*
658  * Notes:
659  * Move current graphics position to X1,Y1.
660  */
661 {
662  /* the assignment of lastX/Y is redundant for a Tek terminal */
663  LastX = MFBCurrent->X = X1; LastY = MFBCurrent->Y = Y1;
664  MFBGenCode(MFBFORMAT.movePenSequence);
665 }
666 
667 
668 void
670 MFBPATH *path;
671  /*
672  * Notes:
673  * Draw the Path defined in "path" in the current linestyle.
674  * Without a 'DrawSolidLineToSequence',we must call MFBLine
675  * for the first segment to be certain that the linestyle is
676  * properly set.
677  */
678 {
679  int n,x,y;
680  if(MFBCurrent->reissueLineStyleBool)
681  MFBSetLineStyle(MFBCurrent->lineStyle);
682  if(path->nvertices < 2)
683  return;
684  n = 2;
685  MFBLine(path->xy[0],path->xy[1],path->xy[2],path->xy[3]);
686  while(n < path->nvertices){
687  x = path->xy[(n << 1)];
688  y = path->xy[(n << 1) + 1];
689  MFBDrawLineTo(x,y);
690  n++;
691  }
692 }
693 
694 
695 void
697 int X1,Y1;
698  /*
699  * Notes:
700  * Draws a line in the current color and line style from
701  * the last graphics position to X1,Y1.
702  */
703 {
704  if(MFBCurrent->reissueLineStyleBool)
705  MFBSetLineStyle(MFBCurrent->lineStyle);
706  if(MFBFORMAT.drawLineToSequence == NULL
707  || *MFBFORMAT.drawLineToSequence == 0) {
708  MFBLine(LastX,LastY,X1,Y1);
709  /* the assignment of lastX/Y is redundant for a Tek terminal */
710  LastX = X1; LastY = Y1;
711  }
712  else{
713  MFBCurrent->X = X1; MFBCurrent->Y = Y1;
714  if(MFBCurrent->lineStyle == 0
715  && MFBFORMAT.drawSolidLineToSequence != NULL
716  && *MFBFORMAT.drawSolidLineToSequence != 0)
717  MFBGenCode(MFBFORMAT.drawSolidLineToSequence);
718  else
719  MFBGenCode(MFBFORMAT.drawLineToSequence);
720  }
721 }
722 
723 
724 void
725 MFBLine(X1,Y1,X2,Y2)
726 int X1,Y1,X2,Y2;
727  /*
728  * Notes:
729  * Draws a line in the current color and line style from X1,Y1
730  * to X2,Y2.
731  */
732 {
733 #ifdef DEBUG
734  MFBCurrent->nLines += 1;
735  MFBCurrent->sumLineLength += MFBmax(abs(X1-X2),abs(Y1-Y2));
736 #endif
737  if(MFBCurrent->reissueLineStyleBool)
738  MFBSetLineStyle(MFBCurrent->lineStyle);
739  MFBCurrent->X = X1; MFBCurrent->Y = Y1;
740  MFBCurrent->Z = X2; MFBCurrent->T = Y2;
741  if(MFBCurrent->lineStyle == 0 && MFBFORMAT.drawSolidLineSequence != NULL
742  && *MFBFORMAT.drawSolidLineSequence != 0)
743  MFBGenCode(MFBFORMAT.drawSolidLineSequence);
744  else
745  MFBGenCode(MFBFORMAT.drawLineSequence);
746  LastX = X2; LastY = Y2;
747 }
748 
749 
750 void
752 int l,b,r,t;
753  /*
754  * Notes:
755  * Draws a box in the current fill pattern from lower left
756  * corner (l,b) to upper right corner (r,t). After
757  * this sequence,pen must be left at (r,t).
758  */
759 {
760 #ifdef DEBUG
761  MFBCurrent->nBoxes += 1;
762  MFBCurrent->sumBoxArea += (r-l)*(t-b);
763 #endif
764  MFBCurrent->X = l; MFBCurrent->Y = b; MFBCurrent->Z = r; MFBCurrent->T = t;
765  if(MFBCurrent->fillPattern == 0
766  && MFBFORMAT.drawSolidBoxSequence != NULL
767  && *MFBFORMAT.drawSolidBoxSequence != 0) {
768  MFBGenCode(MFBFORMAT.drawSolidBoxSequence);
769  }
770  else if (MFBFORMAT.drawBoxSequence != NULL
771  && *MFBFORMAT.drawBoxSequence != 0) {
772  MFBGenCode(MFBFORMAT.drawBoxSequence);
773  }
774  else
775  MFBNaiveBoxFill(l,b,r,t);
776 }
777 
778 
779 void
780 MFBArc(x,y,r,astart,astop,s)
781 int x; /* x coordinate of center */
782 int y; /* y coordinate of center */
783 int r; /* radius of arc */
784 int astart; /* initial angle ( +x axis = 0 degrees ) */
785 int astop; /* final angle ( +x axis = 0 degrees ) */
786 int s; /* number of segments in a 360 degree arc */
787  /*
788  * Notes:
789  * Draws an arc of radius r and center at (x,y) beginning at
790  * angle astart (in degrees) and ending at astop
791  */
792 {
793  int i,j,xx,yy;
794  double d;
795 
796  d = astart / RadToDeg;
797  xx = x + (int)(r * cos(d));
798  yy = y + (int)(r * sin(d));
799  /* Must use MFBLine to force a DSL sequence if style Id is solid */
800  MFBLine(xx,yy,xx,yy);
801  while(astart >= astop)
802  astop += 360;
803  if(s>2 && s<181)
804  j = MFBmax(1,(astop - astart)/s);
805  else
806  j = MFBmax(1,(astop - astart)/18);
807  for(i = astart + j; i <= astop; i += j){
808  d = i / RadToDeg;
809  MFBCurrent->X = x + (int)(r * cos(d));
810  MFBCurrent->Y = y + (int)(r * sin(d));
811  MFBGenCode(MFBFORMAT.drawLineToSequence);
812  }
813  d = astop / RadToDeg;
814  MFBCurrent->X = x + (int)(r * cos(d));
815  MFBCurrent->Y = y + (int)(r * sin(d));
816  MFBGenCode(MFBFORMAT.drawLineToSequence);
817 }
818 
819 
820 void
822 int x; /* x coordinate of center */
823 int y; /* y coordinate of center */
824 int r; /* radius of circle */
825  int s; /* number of line segments in circle (default = 72) */
826  /*
827  * Notes:
828  * Draws a circle of radius r and center at (x,y) in the
829  * current line style.
830  */
831 {
832  int i,j=5;
833  double d=0;
834 
835  if(MFBFORMAT.drawCircleSequence == NULL
836  || *MFBFORMAT.drawCircleSequence == 0) {
837  MFBCurrent->X = x + r;
838  MFBCurrent->Y = y;
839  if(s>2 && s<181)
840  j = MFBmax(1,360/s);
841  for(i = j; i <= 360; i += j){
842  d = i / RadToDeg;
843  MFBCurrent->Z = x + (int)(r * cos(d));
844  MFBCurrent->T = y + (int)(r * sin(d));
845  MFBGenCode(MFBFORMAT.drawLineSequence);
846  MFBCurrent->X = MFBCurrent->Z;
847  MFBCurrent->Y = MFBCurrent->T;
848  }
849  } else {
850  MFBCurrent->X = x;
851  MFBCurrent->Y = y;
852  MFBCurrent->Z = r;
853  MFBGenCode(MFBFORMAT.drawCircleSequence);
854  }
855 }
856 
857 
858 void
860 int x,y,r,s;
861  /*
862  * Notes:
863  * Draws a roundflash of radius r and center at (x,y) in the
864  * current fill style.
865  */
866 {
867  int i=0,j;
868  double d=0;
869 
870  MFBCurrent->X = x + r;
871  MFBCurrent->Y = y;
872  if(s>2 && s<181)
873  j = 360/s;
874  else {
875  j = 5;
876  s = 72;
877  }
878  MFBCurrent->Z = s;
879  MFBGenCode(MFBFORMAT.beginPlygnSequence);
880  for(i = j; i < 360; i += j){
881  d = i / RadToDeg;
882  MFBCurrent->X = x + (int)(r * cos(d));
883  MFBCurrent->Y = y + (int)(r * sin(d));
884  MFBGenCode(MFBFORMAT.sendPlygnVertex);
885  }
886  MFBCurrent->X = x + r;
887  MFBCurrent->Y = y;
888  MFBGenCode(MFBFORMAT.endPlygnSequence);
889 }
890 
891 
892 void
894 MFBPOLYGON *p;
895  /*
896  * Notes:
897  * Draws a polygon with n vertices in the current fill pattern.
898  */
899 {
900  int *xy0,*xy1,n;
901 
902  xy0 = xy1 = p->xy;
903  MFBCurrent->Z = n = p->nvertices;
904  if(n <= 0) return;
905  MFBCurrent->X = *xy1++;
906  MFBCurrent->Y = *xy1++;
907  if(MFBCurrent->fillPattern == 0 &&
908  MFBFORMAT.beginSolidPlygnSequence != NULL &&
909  *MFBFORMAT.beginSolidPlygnSequence != 0)
910  MFBGenCode(MFBFORMAT.beginSolidPlygnSequence);
911  else
912  MFBGenCode(MFBFORMAT.beginPlygnSequence);
913  n--;
914  while(n--) {
915  MFBCurrent->X = *xy1++;
916  MFBCurrent->Y = *xy1++;
917  MFBGenCode(MFBFORMAT.sendPlygnVertex);
918  }
919  MFBCurrent->X = *xy0;
920  MFBCurrent->Y = *(xy0+1);
921  MFBGenCode(MFBFORMAT.endPlygnSequence);
922 }
923 
924 
925 void
926 MFBText(text,x,y,phi)
927 char *text;
928 int x,y;
929 int phi; /* angle of rotation in degrees */
930  /*
931  * Notes:
932  * Draws the string `text' in the current color with the lower
933  * left corner at (x,y).
934  */
935 {
936  char *c;
937 
938 #ifdef DEBUG
939  MFBCurrent->nChars += strlen(text);
940 #endif
941  if((phi != 0) && (MFBCurrent->textRotateBool == true)){
942  MFBCurrent->X = phi;
943  MFBGenCode(MFBFORMAT.rotateTextSequence);
944  }
945 
946  /* Move to (x + GTW),(Y + GTH). */
947  MFBCurrent->X = x + MFBCurrent->fontXOffset;
948  MFBCurrent->Y = y + MFBCurrent->fontYOffset;
949 
950  /* Get ready for graphics text. */
951  c = text;
952  MFBCurrent->Z = 0;
953  while(*c++ != 0) (MFBCurrent->Z)++;
954 
955  MFBGenCode(MFBFORMAT.graphicsTextStart);
956 
957  /* Output the text. */
958  while(*text) MFBPutchar(*text++);
959 
960  /* Finish the graphics text */
961  MFBGenCode(MFBFORMAT.graphicsTextEnd);
962 
963  /* rotate text back to zero */
964  if((phi != 0) && (MFBCurrent->textRotateBool == true)){
965  MFBCurrent->X = 0;
966  MFBGenCode(MFBFORMAT.rotateTextSequence);
967  }
968 }
969 
970 
971 void
973 int x,y;
974  /*
975  * Notes:
976  * Sets the indicated pixel to the current foreground color.
977  */
978 {
979  MFBCurrent->X = x; MFBCurrent->Y = y;
980  MFBGenCode(MFBFORMAT.writePixel);
981 }
982 
983 
984 void
986  /*
987  * Notes:
988  * Floods the display with the current (foreground) color.
989  */
990 {
991  MFBCurrent->X = MFBCurrent->fgColorId;
992  MFBGenCode(MFBFORMAT.screenFlood);
993 
994  /*
995  * MFBFlood may destroy last x/y,so be safe about it.
996  */
997  MFBCurrent->lastX = MFBCurrent->lastY = -1;
998 }
999 
1000 
1001 MFBPATH
1002 *MFBArcPath(x,y,r,astart,astop,s)
1003 int x; /* x coordinate of center */
1004 int y; /* y coordinate of center */
1005 int r; /* radius of arc */
1006 int astart; /* initial angle ( +x axis = 0 degrees ) */
1007 int astop; /* final angle ( +x axis = 0 degrees ) */
1008 int s; /* number of segments in a 360 degree arc */
1009  /*
1010  * Notes:
1011  * Returns MFBPATH containing an arc.
1012  */
1013 {
1014  static MFBPATH pth;
1015  static int xy[400];
1016  int *ip,i,j;
1017  double d;
1018 
1019  pth.xy = ip = xy;
1020  while(astart >= astop)
1021  astop += 360;
1022  if(s<2 || s>180)
1023  s = 20;
1024  pth.nvertices = 2;
1025  j = MFBmax(1,(astop - astart)/s);
1026  d = astart / RadToDeg;
1027  *ip++ = x + (int)(r * cos(d));
1028  *ip++ = y + (int)(r * sin(d));
1029  for(i = astart + j; i <= astop; i += j){
1030  d = i / RadToDeg;
1031  *ip++ = x + (int)(r * cos(d));
1032  *ip++ = y + (int)(r * sin(d));
1033  ++pth.nvertices;
1034  }
1035  d = astop / RadToDeg;
1036  *ip++ = x + (int)(r * cos(d));
1037  *ip = y + (int)(r * sin(d));
1038  return(&pth);
1039 }
1040 
1041 
1042 MFBPOLYGON
1043 *MFBEllipse(x,y,rx,ry,s)
1044 int x; /* x coordinate of center */
1045 int y; /* y coordinate of center */
1046 int rx; /* radius of ellipse in x direction */
1047 int ry; /* radius of ellipse in y direction */
1048 int s; /* number of line segments in circle (default = 20) */
1049  /*
1050  * Notes:
1051  * Returns MFBPOLYGON containing an ellipse with no more than 200 coords.
1052  */
1053 {
1054  static MFBPOLYGON poly;
1055  static int xy[400];
1056  int i=0;
1057  int j;
1058  int *ip;
1059  double d=0;
1060 
1061  poly.xy = ip = xy;
1062  *ip++ = x + rx;
1063  *ip++ = y;
1064  if(s>2 && s<181)
1065  j = 360/s;
1066  else {
1067  j = 18;
1068  s = 20;
1069  }
1070  poly.nvertices = s + 1;
1071  while(--s) {
1072  i += j;
1073  d = i / RadToDeg;
1074  *ip++ = x + (int)(rx * cos(d));
1075  *ip++ = y + (int)(ry * sin(d));
1076  }
1077  *ip++ = x + rx;
1078  *ip++ = y;
1079  return(&poly);
1080 }
1081 
1082 
1083 
1084 
1085 
1086 
1087 /***********************************************************************
1088  *
1089  * WINDOW CONTROL
1090  *
1091  ***********************************************************************/
1092 
1093 #define WNDW MFBCurrent->currentWindow
1094 #define VWPRT MFBCurrent->currentViewport
1095 
1096 int
1098 int X;
1099 {
1100  int XX;
1101 
1102  XX = (int)(((double)(X-WNDW.left)*VWPRT.length)/WNDW.length) + VWPRT.left;
1103  if(XX < VWPRT.left) XX = VWPRT.left;
1104  else if(XX > VWPRT.right) XX = VWPRT.right;
1105  return(XX);
1106 }
1107 
1108 int
1110 int Y;
1111 {
1112  int YY;
1113 
1114  YY = (int)(((double)(Y-WNDW.bottom)*VWPRT.width)/WNDW.width) + VWPRT.bottom;
1115  if(YY < VWPRT.bottom) YY = VWPRT.bottom;
1116  else if(YY > VWPRT.top) YY = VWPRT.top;
1117  return(YY);
1118 }
1119 
1120 int
1122 int X;
1123 {
1124  int XX;
1125 
1126  XX = ((X-VWPRT.left)*WNDW.length)/VWPRT.length+WNDW.left;
1127  return(XX);
1128 }
1129 
1130 int
1132 int Y;
1133 {
1134  int YY;
1135 
1136  YY = ((Y-VWPRT.bottom)*WNDW.width)/VWPRT.width+WNDW.bottom;
1137  return(YY);
1138 }
1139 
1140 void
1141 MFBSetViewport(left,bottom,right,top)
1142 int left,bottom,right,top;
1143 {
1144  VWPRT.bottom = bottom;
1145  VWPRT.top = top;
1146  VWPRT.left = left;
1147  VWPRT.right = right;
1148  VWPRT.length = VWPRT.right - VWPRT.left;
1149  VWPRT.width = VWPRT.top - VWPRT.bottom;
1150 }
1151 
1152 void
1153 MFBSetWindow(left,bottom,right,top)
1154 int left,bottom,right,top;
1155 {
1156  WNDW.bottom = bottom;
1157  WNDW.top = top;
1158  WNDW.left = left;
1159  WNDW.right = right;
1160  WNDW.length = WNDW.right - WNDW.left;
1161  WNDW.width = WNDW.top - WNDW.bottom;
1162 }
1163 
1164 /* This wasn't in here, for some reason. */
1165 
1166 /* MFBNaiveBoxFill simulates stipple patterns */
1167 
1168 void
1169 MFBNaiveBoxFill(left, bottom, right, top)
1170 {
1171  int step;
1172  int incr;
1173  int incr2;
1174  int ll, bb, rr, tt;
1175 
1176  if (top < bottom)
1177  MFBSwapInt (top, bottom);
1178  if (right < left)
1179  MFBSwapInt (left, right);
1180  incr = MFBmax (MFBmax (MFBCurrent->maxX, MFBCurrent->maxY) / 400, 1);
1181  step = incr * 5;
1182  incr2 = incr + (incr >> 1);
1183  ll = left;
1184  bb = bottom;
1185  rr = right;
1186  tt = top;
1187  switch (MFBCurrent->fillPattern) {
1188 
1189  case 0:
1190  /*
1191  * solid
1192  */
1193  if ((right - left) > (top - bottom)) {
1194  for (bb = bottom; bb <= top; bb += incr)
1195  MFBLine (ll, bb, rr, bb);
1196  }
1197  else {
1198  for (ll = left; ll <= right; ll += incr)
1199  MFBLine (ll, bb, ll, tt);
1200  }
1201  break;
1202 
1203  case 1:
1204  /*
1205  * horizontal striped
1206  */
1207  for (bb = bottom; bb < top; bb += step)
1208  MFBLine (ll, bb, rr, bb);
1209  break;
1210 
1211  case 2:
1212  /*
1213  * vertical striped
1214  */
1215  for (ll = left; ll < right; ll += step)
1216  MFBLine (ll, bb, ll, tt);
1217  break;
1218 
1219  case 3:
1220  /*
1221  * diagonal lines
1222  */
1223  ll += step;
1224  bb += step;
1225  while (ll < right && bb < top) {
1226  MFBLine (left, bb, ll, bottom);
1227  ll += step;
1228  bb += step;
1229  }
1230  if (ll >= right) {
1231  while (bb < top) {
1232  MFB_Y_Intercept (left, bb, ll, bottom, right, &tt);
1233  MFBLine (left, bb, right, tt);
1234  bb += step;
1235  ll += step;
1236  }
1237  }
1238  else {
1239  while (ll < right) {
1240  MFB_X_Intercept (left, bb, ll, bottom, top, &rr);
1241  MFBLine (rr, top, ll, bottom);
1242  bb += step;
1243  ll += step;
1244  }
1245  }
1246  while (rr <= right && tt <= top) {
1247  MFB_X_Intercept (left, bb, ll, bottom, top, &rr);
1248  MFB_Y_Intercept (left, bb, ll, bottom, right, &tt);
1249  if (rr > right || tt > top)
1250  break;
1251  MFBLine (rr, top, right, tt);
1252  bb += step;
1253  ll += step;
1254  }
1255  break;
1256 
1257  case 4:
1258  /*
1259  * diagonal lines
1260  */
1261  rr -= step;
1262  bb += step;
1263  while (rr > left && bb < top) {
1264  MFBLine (rr, bottom, right, bb);
1265  rr -= step;
1266  bb += step;
1267  }
1268  if (rr <= left) {
1269  while (bb < top) {
1270  MFB_Y_Intercept (rr, bottom, right, bb, left, &tt);
1271  MFBLine (left, tt, right, bb);
1272  bb += step;
1273  rr -= step;
1274  }
1275  }
1276  else {
1277  while (rr > left) {
1278  MFB_X_Intercept (rr, bottom, right, bb, top, &ll);
1279  MFBLine (rr, bottom, ll, top);
1280  bb += step;
1281  rr -= step;
1282  }
1283  }
1284  while (ll >= left && tt <= top) {
1285  MFB_X_Intercept (rr, bottom, right, bb, top, &ll);
1286  MFB_Y_Intercept (rr, bottom, right, bb, left, &tt);
1287  if (ll < left || tt > top)
1288  break;
1289  MFBLine (left, tt, ll, top);
1290  bb += step;
1291  rr -= step;
1292  }
1293  break;
1294 
1295  case 5:
1296  /*
1297  * plus signs
1298  */
1299  for (bb = bottom; bb < top; bb += (step + step)) {
1300  for (ll = left; ll < right; ll += step) {
1301  MFBLine (ll - incr2, bb, ll + incr2, bb);
1302  MFBLine (ll, bb - incr2, ll, bb + incr2);
1303  }
1304  }
1305  break;
1306 
1307  case 6:
1308  /*
1309  * x's
1310  */
1311  for (bb = bottom; bb < top; bb += (step + step)) {
1312  for (ll = left; ll < right; ll += step) {
1313  MFBLine (ll - incr2, bb - incr2, ll + incr2, bb + incr2);
1314  MFBLine (ll - incr2, bb + incr2, ll + incr2, bb - incr2);
1315  }
1316  }
1317  break;
1318 
1319  default:
1320  case 7:
1321  /*
1322  * outline
1323  */
1324  MFBLine (left, bottom, left, top);
1325  MFBLine (left, top, right, top);
1326  MFBLine (right, top, right, bottom);
1327  MFBLine (right, bottom, left, bottom);
1328  break;
1329 
1330  }
1331 }
void MFBMoveTo(int X1, int Y1)
Definition: mfbbasic.c:655
int maxFillPatterns
Definition: mfb.h:262
int MFBDefineColor(int colorId, int r, int g, int b)
Definition: mfbbasic.c:549
#define MFBTMBLNK
Definition: mfb.h:507
#define MFBALUEOR
Definition: mfb.h:448
#define DEFREADMASK
Definition: mfb.h:563
MFBPATH * MFBArcPath(int x, int y, int r, int astart, int astop, int s)
Definition: mfbbasic.c:1002
#define BUTTON11
Definition: mfb.h:541
int MFBSetALUMode(int mode)
Definition: mfbbasic.c:423
Bool textRotateBool
Definition: mfb.h:333
int lineStyle
Definition: mfb.h:269
int offScreenDX
Definition: mfb.h:230
#define BUTTON6
Definition: mfb.h:536
#define MAXLINESTYLES
Definition: mfb.h:526
#define MFBNOBLNK
Definition: mfb.h:506
#define BUTTON12
Definition: mfb.h:542
void MFBConvertToHLS(int r, int g, int b)
Definition: mfbbasic.c:158
#define MFBBADTM1
Definition: mfb.h:501
#define DEFCHANNELMASK
Definition: mfb.h:555
void MFBSetWindow(int left, int bottom, int right, int top)
Definition: mfbbasic.c:1153
#define CURCHANNELMASK
Definition: mfb.h:560
double phi()
int maxLineStyles
Definition: mfb.h:247
#define MAXCOLORS
Definition: mfb.h:523
Bool readMaskBool
Definition: mfb.h:314
#define MFBNODFLP
Definition: mfb.h:503
#define MAXY
Definition: mfb.h:522
#define FONTWIDTH
Definition: mfb.h:546
int MFBDefineLineStyle(int styleId, int BitArray)
Definition: mfbbasic.c:619
Definition: cddefs.h:119
int nLines
Definition: mfb.h:283
#define BUTTON5
Definition: mfb.h:535
void MFBCircle(int x, int y, int r, int s)
Definition: mfbbasic.c:821
int readMask
Definition: mfb.h:271
int lineDefineLength
Definition: mfb.h:246
Definition: xforms.c:16
int MFBDefineFillPattern(int styleId, int *BitArray)
Definition: mfbbasic.c:579
int numberOfButtons
Definition: mfb.h:239
#define MFBOK
Definition: mfb.h:491
int maxIntensity
Definition: mfb.h:234
#define BUTTON3
Definition: mfb.h:533
int fillDefineWidth
Definition: mfb.h:261
int T
Definition: mfb.h:222
void MFBDrawPath(MFBPATH *path)
Definition: mfbbasic.c:669
#define MFBFORMAT
Definition: mfbbasic.c:28
int fillDefineHeight
Definition: mfb.h:260
int nvertices
Definition: mfb.h:105
#define BUTTON1
Definition: mfb.h:531
int MFBSetTextMode(Bool destructiveBool)
Definition: mfbbasic.c:395
#define MFBBADCST
Definition: mfb.h:500
#define BUTTON8
Definition: mfb.h:538
#define MFBBADTM2
Definition: mfb.h:502
int fgColorId
Definition: mfb.h:267
int MFBSetRubberBanding(Bool RubberBandingBool, int X, int Y)
Definition: mfbbasic.c:513
void MFBLine(int X1, int Y1, int X2, int Y2)
Definition: mfbbasic.c:725
int MFBSetCursorColor(int colorId1, int colorId2)
Definition: mfbbasic.c:463
int Y
Definition: mfb.h:222
void MFBFlood()
Definition: mfbbasic.c:985
int fontWidth
Definition: mfb.h:251
int lastX
Definition: mfb.h:221
#define MFBALUJAM
Definition: mfb.h:445
Definition: cddefs.h:312
MFBPutchar(char c)
Definition: mfbio.c:121
int stipplePattern[8]
Definition: mfb.h:274
int maxColors
Definition: mfb.h:227
int LastY
Definition: mfbbasic.c:652
Bool buttonsBool
Definition: mfb.h:318
int minOffScreenX
Definition: mfb.h:228
Definition: cddefs.h:215
int sumLineLength
Definition: mfb.h:283
#define BUTTON9
Definition: mfb.h:539
#define TEXTPOSITIONALBE
Definition: mfb.h:543
#define MFBBADFST
Definition: mfb.h:499
#define CURFILLPATTERN
Definition: mfb.h:558
#define FONTYOFFSET
Definition: mfb.h:548
Bool channelMaskBool
Definition: mfb.h:313
int nBoxes
Definition: mfb.h:282
int Z
Definition: mfb.h:222
Bool linePatternDefineBool
Definition: mfb.h:325
int fontXOffset
Definition: mfb.h:252
void MFB_X_Intercept(long x1, long y1, long x2, long y2, long e, long *xi)
Definition: mfblclip.c:50
#define POINTINGBUTTONS
Definition: mfb.h:529
#define FILLEDPOLYGONS
Definition: mfb.h:553
long X
Definition: actions.c:450
#define DEFLINEPATTERN
Definition: mfb.h:556
Bool textPositionableBool
Definition: mfb.h:332
void SetCurrentMFB(MFB *mfb)
Definition: mfbbasic.c:198
#define MFBALUNOR
Definition: mfb.h:447
#define CURLINESTYLE
Definition: mfb.h:559
Bool vltUseHLSBool
Definition: mfb.h:310
Definition: cddefs.h:237
int MFBScaleX(int X)
Definition: mfbbasic.c:1097
Bool
Definition: mfb.h:18
Definition: mfb.h:215
MFB * MFBCurrent
Definition: mfbbasic.c:31
int maxX
Definition: mfb.h:225
MFBSetLineStyle(int styleId)
Definition: mfbbasic.c:259
#define MFBBADALU
Definition: mfb.h:516
#define NULL
Definition: spdefs.h:121
int lastY
Definition: mfb.h:221
void MFBZeroCounters()
Definition: mfbbasic.c:213
#define MFBNOMASK
Definition: mfb.h:508
int fontYOffset
Definition: mfb.h:253
#define OVERSTRIKETEXT
Definition: mfb.h:550
#define MFBmin(a, b)
Definition: mfb.h:34
#define MFBNORBND
Definition: mfb.h:515
int fillPattern
Definition: mfb.h:268
#define MFBNODFCO
Definition: mfb.h:505
double cos()
Bool filledPlygnBool
Definition: mfb.h:329
int fontHeight
Definition: mfb.h:250
Definition: mfb.h:104
#define MAXFILLPATTERNS
Definition: mfb.h:525
int channelMask
Definition: mfb.h:270
static double c
Definition: vectors.c:16
#define BLINKERS
Definition: mfb.h:552
#define FONTXOFFSET
Definition: mfb.h:547
double sin()
int buttonMask[12]
Definition: mfb.h:238
void MFBText(char *text, int x, int y, int phi)
Definition: mfbbasic.c:926
void MFBNaiveBoxFill()
int maxY
Definition: mfb.h:226
#define VLT
Definition: mfb.h:551
int minOffScreenY
Definition: mfb.h:229
#define RASTERCOPY
Definition: mfb.h:564
void MFBFlash(int x, int y, int r, int s)
Definition: mfbbasic.c:859
int nChars
Definition: mfb.h:281
int MFBDescaleX(int X)
Definition: mfbbasic.c:1121
int cursorColor2Id
Definition: mfb.h:266
#define BUTTON10
Definition: mfb.h:540
int sumBoxArea
Definition: mfb.h:282
int MFBInfo(int Info)
Definition: mfbbasic.c:44
#define WNDW
Definition: mfbbasic.c:1093
void MFB_Y_Intercept(long x1, long y1, long x2, long y2, long e, long *yi)
Definition: mfblclip.c:32
void MFBGenCode(char *PM)
Definition: mfbgnc.c:99
int textMode
Definition: mfb.h:272
#define NUMBITPLANES
Definition: mfb.h:562
MFBSetFillPattern(int styleId)
Definition: mfbbasic.c:288
#define POINTINGDEVICE
Definition: mfb.h:528
#define RadToDeg
Definition: mfbbasic.c:27
void MFBPixel(int x, int y)
Definition: mfbbasic.c:972
int MFBSetBlinker(int colorId, int r, int g, int b, int onFlag)
Definition: mfbbasic.c:477
void MFBSetGhost()
Definition: mfbbasic.c:34
#define BUTTON4
Definition: mfb.h:534
int MFBScaleY(int Y)
Definition: mfbbasic.c:1109
int MFBSetColor(int colorId)
Definition: mfbbasic.c:370
int MFBSetReadMask(int readMask)
Definition: mfbbasic.c:346
#define NUMBUTTONS
Definition: mfb.h:530
int numBlinkers
Definition: mfb.h:273
#define BUTTON2
Definition: mfb.h:532
int X
Definition: mfb.h:222
#define MAXX
Definition: mfb.h:521
#define MFBALUOR
Definition: mfb.h:446
#define CURREADMASK
Definition: mfb.h:561
#define MFBNODFFP
Definition: mfb.h:504
#define DESTRUCTIVETEXT
Definition: mfb.h:549
#define MFBmax(a, b)
Definition: mfb.h:33
Definition: cddefs.h:162
int MFBSetChannelMask(int channelMask)
Definition: mfbbasic.c:322
void MFBPolygon(MFBPOLYGON *p)
Definition: mfbbasic.c:893
void MFBArc(int x, int y, int r, int astart, int astop, int s)
Definition: mfbbasic.c:780
#define TEXTROTATABLE
Definition: mfb.h:544
Bool reissueLineStyleBool
Definition: mfb.h:326
void MFBBox(int l, int b, int r, int t)
Definition: mfbbasic.c:751
Definition: cddefs.h:227
#define FONTHEIGHT
Definition: mfb.h:545
#define MFBSwapInt(f1, f2)
Definition: mfb.h:35
#define VWPRT
Definition: mfbbasic.c:1094
int lengthOfVLT
Definition: mfb.h:235
#define ON
Definition: mfb.h:26
#define MFBBADLST
Definition: mfb.h:498
int cursorColor1Id
Definition: mfb.h:265
int maxBlinkers
Definition: mfb.h:257
void MFBDrawLineTo(int X1, int Y1)
Definition: mfbbasic.c:696
#define OFFSCREENX
Definition: mfb.h:565
Bool replaceTextBool
Definition: mfb.h:334
#define OFFSCREENY
Definition: mfb.h:566
Bool blinkersBool
Definition: mfb.h:338
void MFBSetViewport(int left, int bottom, int right, int top)
Definition: mfbbasic.c:1141
Bool rastCopyBool
Definition: mfb.h:341
MFBPOLYGON * MFBEllipse(int x, int y, int rx, int ry, int s)
Definition: mfbbasic.c:1043
static char * path
Definition: paths.c:13
#define DEFFILLPATTERNS
Definition: mfb.h:554
void MFBCounters(int *nChars, int *nBoxes, int *meanBoxArea, int *nLines, int *meanLineLength, int *nPixels)
Definition: mfbbasic.c:224
Definition: cddefs.h:192
#define MAXBLINKERS
Definition: mfb.h:527
long Y
Definition: actions.c:450
Bool vltBool
Definition: mfb.h:309
#define MAXINTENSITY
Definition: mfb.h:524
#define OFFSCREENDY
Definition: mfb.h:568
#define BUTTON7
Definition: mfb.h:537
int MFBDescaleY(int Y)
Definition: mfbbasic.c:1131
int offScreenDY
Definition: mfb.h:231
Bool fillDefineRowMajorBool
Definition: mfb.h:346
int * xy
Definition: mfb.h:106
#define CURFGCOLOR
Definition: mfb.h:557
int LastX
Definition: mfbbasic.c:652
Bool PointingDeviceBool
Definition: mfb.h:317
Bool fillPtrnDefineBool
Definition: mfb.h:345
Bool overstrikeTextBool
Definition: mfb.h:335
#define OFFSCREENDX
Definition: mfb.h:567