home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************/
- /* MegaCAD colour values */
- /**********************************************************************/
-
- #define BLACK 0
- #define BLUE 1
- #define GREEN 2
- #define CYAN 3
- #define RED 4
- #define MAGENTA 5
- #define YELLOW 6
- #define WHITE 7
- #define BRIGHT_BLACK 8
- #define BRIGHT_BLUE 9
- #define BRIGHT_GREEN 10
- #define BRIGHT_CYAN 11
- #define BRIGHT_RED 12
- #define BRIGHT_MAGENTA 13
- #define BRIGHT_YELLOW 14
- #define BRIGHT_WHITE 15
-
- /**********************************************************************/
-
- #define NIB(i,s) (((i) & 0xf)<<(s))
-
- #define PIX_XOR 2
- #define LMODE(s,p,c,w) ((ushort)(NIB(s,0) | NIB(p,4) | NIB(c,8) | NIB(w,12)))
- // s = linestyle, p = pixelmode, c = colour, w = linewidth
- // with 'DrawInv()' pixelmode must be 'PIX_XOR'
- // other values may be constant or 0,
- // if 0, current values are taken
- // if you want a continuous line with width 1, you can call :
- // DrawInv(E_LINE,&line,LMODE(1,PIX_XOR,WHITE,1),0);
- // if you want the current settings of entity type 'type', you call :
- // DrawInv(E_LINE,&line,LMODE(0,PIX_XOR,0,0),type);
-
- #define HLP_INV(f,b,s) ((ushort)(NIB(f,0) | NIB(b,4) | ((s)<<15)))
- // f = foreground colour, b = background colour, s = sound ?
- // if you set both colours to 0, the default colours are taken
-
- #define DO_SAVCNT (1<<7)
- // calls 'savecount()' at the end of 'StoreMultiple()'
- // if or'ed together with entity type
-
- #if defined ( MEGATECH_C )
- #define tCallBack void *
- #else
- typedef short (_far *tCallBack)(void _far *para);
- #endif
-
- #define CONTINUE_LOOP 0
- #define CALL_SAVECOUNT 1
- #define BREAK_LOOP 2
-
- /**********************************************************************/
- /* MegaCAD function prototypes. */
- /**********************************************************************/
-
- EXT(201) short GetPntInv( // Get point and draw something with mouse move
- double *pkt, // point to be filled in
- short setinc, // incremental point to be set ?
- tCallBack func, // callback function
- void *para); // data pointer for callback function
-
- EXT(202) void DrawInv( // draw and save a temporary object
- ushort type, // type of entity to be drawn
- void *ptr, // data of entity
- ushort lmode, // line attributes (see LMODE)
- ushort atype); // type to get attributes from
-
- EXT(203) short DlgInput( // input some values by dialog
- ushort num, // number of fields (1 - 10)
- char *title, // title string
- t_dlgdta *dta); // array of field descriptors
-
- EXT(204) short GetFilename( // let the user select a filename
- char *title, // title string
- char *fname); // filename; must be initialized with path
-
- EXT(205) void StoreMultiple( // store an entity (maybe multiple)
- double *data, // entity data
- ushort type); // entity type (may be or'ed with DO_SAVCNT)
-
- EXT(206) void MegaCMD( // call MegaCAD command
- char *cmd); // command string (+ arguments)
-
- EXT(207) short Message( // message box
- char *str1, // 1st line of text
- char *str2, // 2nd line of text
- char *but1, // 1st button (may be NULL)
- char *but2, // 2nd button (may be NULL)
- char *but3, // 3rd button
- short defbut); // number of default button (1-3)
-
- EXT(208) void MouseHelp( // help text for mouse buttons
- char *str1, // help text for left mouse button
- char *str2, // help text for right mouse button
- ushort inv); // colour (beep) for 1st text (see HLP_INV)
-
- EXT(209) short GetPnt( // Get point
- double *pkt, // point to be filled in
- short setinc); // incremental point to be set ?
-
- EXT(210) void savecount( // End of operation
- void ); // must be called after creation of entities
-
- EXT(211) void SetFuncText( // set name of current function
- char *text); // function text
-
- EXT(212) ulong CreateEntity( // store an entity (not multiple), returns ID
- ushort type, // entity type
- t_attribs *attr, // entity attributes (may be NULL)
- void *data); // entity data
-
- EXT(213) void GetTextVal( // retrieve text attributes
- ushort type, // line or block
- ushort init, // initialize (or just calculate box)
- t_text *txt); // text data
-
- EXT(214) ushort ReadTxtFile( // read in a text file
- char *fname, // filename
- char *buf, // buffer to be filled in
- uint bufsiz); // size of buffer
-
- EXT(215) ushort AddPolylnPt( // add a polyline point
- t_polyln *polyln, // polyline structure
- double *mpd, // may be NULL
- double px, // x-coordinate of point
- double py); // y-coordinate of point
-
- EXT(216) void EraseInv( // delete temporary objects
- void );
-
- EXT(217) void GetDimVal( // retrieve dimension attributes
- ushort type, // type of dimension
- ushort init, // initialize (or just calculate box)
- t_dimension *dim); // dimension data
-
- EXT(218) void PrintDimVal( // print dimension text
- double value, // measured value
- char *str, // string buffer to fill
- char *tol1, // tolerance string 1
- char *tol2); // tolerance string 2
-
- EXT(219) short ClickEntity( // let the user click a single entity
- ulong filter, // allowed entity types
- double *pnt, // point where entity was clicked
- t_entity *ent, // entity data to be filled in
- void *edta, // data ptr of variable length entities
- ushort esiz); // size of data buffer
-
- EXT(220) ulong ExChangeEntity(// exchange an entity, returns new ID
- t_entity *ent); // new entity data, old id
-
- EXT(221) short Blink( // draw something blinking
- tCallBack func, // callback function
- void *para); // data pointer for callback function
-
- EXT(222) void EntityLoop( // loop through all entities
- ulong filter, // allowed entity types
- tCallBack func, // callback function
- void *para, // data pointer for callback function
- void *edta, // data ptr of variable length entities
- ushort esiz); // size of data buffer
-
- EXT(223) void DrawEntities( // draw array of entity-id's
- ulong *pid, // array of entity-id's
- ushort num); // number of id's
-
- EXT(224) short StringInput( // input a line of text
- char *title, // title string
- char *buf, // string buffer to be filled in
- ushort buflen); // size of buffer
-
- EXT(225) void SelectInit( // set select filter
- ulong filter); // allowed entity types
-
- EXT(226) void SelectLoop( // select entities
- tCallBack func, // callback function
- void *para, // data pointer for callback function
- void *edta, // data ptr of variable length entities
- ushort esiz); // size of data buffer
-
- EXT(227) ushort InsertMac( // insert macro-file
- char *fname, // macro filename
- tCallBack func, // callback function
- void *para, // data pointer for callback function
- void *edta, // data ptr of variable length entities
- ushort esiz); // size of data buffer
-