/* * Flea, (F)un (L)oveable (E)ngineering (A)rtist * Written By Edward A Luke for * Mississippi State University * Last Modified Oct 1989 */ #include "device.h" #define TYPEMASK 0x07 #define SPACEMASK 0xf8 #define ANGLEMASK 0x300 #define UP &up #define DOWN &down int up = 3 ; int down = 2 ; static int fillstyle = -255 ; int iarg[2] ; float rarg[4] ; #define MIN(a,b) ((a= 'a' && *s <= 'z') *s &= ~0x20 ; } } symbol_(&rx,&ry,&sh,text,&angle,&nc,nc) ; } VPDrawCross(x,y) int x,y ; { float rx,ry ; float ru,rd,rl,rr ; rx = ((float)x/10000.0) ; ry = ((float)y/10000.0) ; ru = ry + 0.1 ; rd = ry - 0.1 ; rl = rx + 0.1 ; rr = rx - 0.1 ; plot_(&rx,&ru,UP) ; plot_(&rx,&rd,DOWN) ; plot_(&rl,&ry,UP) ; plot_(&rr,&ry,DOWN) ; } VPDrawLine(x1,y1,x2,y2) int x1,y1,x2,y2 ; { float rx1,rx2,ry1,ry2 ; rx1 = ((float)x1/10000.0) ; rx2 = ((float)x2/10000.0) ; ry1 = ((float)y1/10000.0) ; ry2 = ((float)y2/10000.0) ; plot_(&rx1,&ry1,UP) ; plot_(&rx2,&ry2,DOWN) ; } VPSelectFillStyle(style) int style ; { if(fillstyle == style) return ; fillstyle = style ; if(style > 0) tonclr_(&style) ; } VPSelectLineStyle(style) int style ; { static int laststyle = -255 ; if(laststyle == style) return ; laststyle = style ; } VPFillBox(x1,y1,x2,y2) int x1,y1,x2,y2 ; { float rx1,rx2,ry1,ry2 ; int iflg ; rx1 = ((float)x1/10000.0) ; rx2 = ((float)x2/10000.0) ; ry1 = ((float)y1/10000.0) ; ry2 = ((float)y2/10000.0) ; iflg = 0 ; rect_(&rx1,&rx2,&ry1,&ry2,&iflg) ; } VPSelectPen(PenNumber) int PenNumber ; { static int lastpen = -255 ; int pen ; if(lastpen == PenNumber) return ; lastpen = PenNumber ; pen = 1 ; penclr_(&pen,&lastpen) ; } VPInit() { struct Device *p ; p = BuildDevice() ; strncpy(p->DeviceName,"VP",STRINGSIZE) ; p->OpenDevice = VPOpenDevice ; p->CloseDevice = VPCloseDevice ; p->HardCloseDevice = VPHardCloseDevice ; p->DrawLine = VPDrawLine ; p->SelectPen = VPSelectPen ; p->SelectFillStyle = VPSelectFillStyle ; p->SelectLineStyle = VPSelectLineStyle ; p->FillBox = VPFillBox ; p->DrawLabel = VPDrawLabel ; p->DrawCross = VPDrawCross ; p->plotter = YEA ; p->xAspect = 10000 ; p->yAspect = 10000 ; p->xLeft = 420000 ; p->xRight = 0 ; p->yTop = 420000 ; p->yBottom = 0 ; }