home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / EEDPR23S.ZIP / PROGRAM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-10  |  4.4 KB  |  154 lines

  1. /*****************************************************************************
  2. * Definitions for the EED printer driver program:                 *
  3. *****************************************************************************/
  4.  
  5. #ifndef PROGRAM_H
  6. #define PROGRAM_H
  7.  
  8. #define EEDRAW_VERSION "Version 1.3"
  9.  
  10. #ifndef __MSDOS__
  11.  
  12. #ifdef mips                    /* SGI R2000/R3000 machines. */
  13. #define NO_VOID_PTR
  14. #define SYSV
  15. #endif /* mips */
  16.  
  17. char *malloc(unsigned int size);
  18.  
  19. #define searchpath(name) name
  20.  
  21. #ifndef M_PI
  22. #define M_PI 3.1415927
  23. #endif /* M_PI */
  24.  
  25. #endif /* __MSDOS__ */
  26.  
  27. #include "virtrstr.h"
  28.  
  29. typedef int        BooleanType;
  30. typedef unsigned char    ByteType;
  31. typedef double        RealType;
  32.  
  33. #ifdef VoidPtr
  34. #undef VoidPtr
  35. #endif /* VoidPtr */
  36.  
  37. #ifdef NO_VOID_PTR
  38. #define VoidPtr        char *
  39. #else
  40. #define VoidPtr        void *
  41. #endif /* NO_VOID_PTR */
  42.  
  43. #ifndef    NULL
  44. #define    NULL    0
  45. #endif
  46.  
  47. #ifndef    TRUE
  48. #define    TRUE    1
  49. #define    FALSE    0
  50. #endif
  51.  
  52. #ifndef LINE_LEN
  53. #define LINE_LEN    255
  54. #define LINE_LEN_SHORT    81
  55. #define FULL_PATH_LEN    81
  56. #define FILE_NAME_LEN    14
  57. #define MAX_PIN_INFO    10
  58. #endif
  59.  
  60. #define SIGN(x)        ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))
  61. #define ABS(y)        ((y) > 0 ? (y) : (-(y)))
  62. #define SQR(y)        ((y) * (y))
  63. #define SGN(x)        ((x) > 0 ? 1 : ((x) == 0 ? 0 : -1))
  64. #define MIN(x, y)    ((x) > (y) ? (y) : (x))
  65. #define MAX(x, y)    ((x) > (y) ? (x) : (y))
  66. #define BOUND(x, Min, Max) (MIN(MAX((x), (Min)), (Max)))
  67. #define GEN_COPY(Dest, Src, Size)       memcpy(Dest, Src, Size)
  68.  
  69. #define INFINITY    1e6
  70. #define EPSILON        1e-6
  71.  
  72. #define DEG2RAD(Deg)    ((Deg) * M_PI / 180.0)
  73. #define RAD2DEG(Rad)    ((Rad) * 180.0 / M_PI)
  74.  
  75. #define BSPACE    8
  76. #define TAB    9
  77. #define LF    10
  78. #define CR    13
  79. #define ESC    27
  80.  
  81. #define PAGE_SCALER    1000        /* Mapping from page size in inches. */
  82. #define PAGE_A4_XSIZE    10.0                   /* Regular page size. */
  83. #define PAGE_A4_YSIZE    7.5
  84.  
  85. /* Note the snap distance is also the scaler for libraries loaded in. */
  86. #define DEFAULT_SNAP_DISTANCE    16        /* Distance to snap a point. */
  87.  
  88. typedef enum {
  89.     DRAW_POLYLINE_STRUCT_TYPE,
  90.     DRAW_CONNECTION_STRUCT_TYPE,
  91.     DRAW_TEXT_STRUCT_TYPE,
  92.     DRAW_LIB_ITEM_STRUCT_TYPE,
  93.     DRAW_PICK_ITEM_STRUCT_TYPE
  94. } DrawStructType;
  95.  
  96. typedef struct DrawGenericStruct {
  97.     DrawStructType StructType;
  98.     struct DrawGenericStruct *Pnext;
  99. } DrawGenericStruct;
  100.  
  101. typedef struct DrawPolylineStruct {
  102.     DrawStructType StructType;
  103.     struct DrawGenericStruct *Pnext;
  104.     TextWidthType Width;
  105.     int NumOfPoints;              /* Number of XY pairs in Points array. */
  106.     int *Points;            /* XY pairs that forms the polyline. */
  107. } DrawPolylineStruct;
  108.  
  109. typedef struct DrawConnectionStruct {
  110.     DrawStructType StructType;
  111.     struct DrawGenericStruct *Pnext;
  112.     int PosX, PosY;                /* XY coordinates of connection. */
  113. } DrawConnectionStruct;
  114.  
  115. typedef struct DrawTextStruct {
  116.     DrawStructType StructType;
  117.     struct DrawGenericStruct *Pnext;
  118.     int PosX, PosY, Scale;            /* XY coordinates of connection. */
  119.     TextOrientationType Orient;
  120.     char *Text;
  121. } DrawTextStruct;
  122.  
  123. typedef struct DrawLibItemStruct {
  124.     DrawStructType StructType;
  125.     struct DrawGenericStruct *Pnext;
  126.     TextOrientationType PartNameOrient, ChipNameOrient;
  127.     char *PartName;      /* Name of part, i.e. "Op. Amp. 21". Not Chip Name. */
  128.     char *ChipName;       /* Key to look for in the library, i.e. "74LS00". */
  129.     int PartNameX, PartNameY;            /* Where PartName should be put. */
  130.     int ChipNameX, ChipNameY;            /* Where ChipName should be put. */
  131.     int Multi;             /* In multi unit chip - which unit to draw. */
  132.     int Transform[2][2];       /* The rotation/mirror transformation matrix. */
  133.     int PosX, PosY;                  /* Exact position of part. */
  134.     int BBoxMinX, BBoxMaxX, BBoxMinY, BBoxMaxY;     /* BBox around the part. */
  135. } DrawLibItemStruct;
  136.  
  137. typedef struct DrawPickedStruct { /* Holds structures picked by pick events. */
  138.     DrawStructType StructType;
  139.     struct DrawPickedStruct *Pnext;
  140.     DrawGenericStruct *PickedStruct;
  141. } DrawPickedStruct;
  142.  
  143. extern int EEPageSizeX, EEPageSizeY; /* Clipping boundaries of current page. */
  144. extern DrawGenericStruct *EEDrawList;         /* All objects are saved here. */
  145. extern char *EEPSFontName;                 /* EED-PS PS font name. */
  146. extern char *EEDataFileName;              /* EED-PS EED input file name. */
  147.  
  148. VoidPtr MyMalloc(unsigned size);
  149. void MyFree(VoidPtr p);
  150. void MyExit(int ExitCode);
  151. void FatalError(char *ErrMsg);
  152.  
  153. #endif PROGRAM_H
  154.