home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / EEDRW23S.ZIP / EELIBSL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-24  |  3.1 KB  |  92 lines

  1. /*****************************************************************************
  2. *   Local definitions of the EELibs?.c modules.                     *
  3. *                                         *
  4. * Written by:  Gershon Elber            IBM PC Ver 1.0,    Oct. 1989    *
  5. *****************************************************************************/
  6.  
  7. #ifndef EELIBSL_H
  8. #define EELIBSL_H
  9.  
  10. #define PART_NAME_LEN    15             /* Maximum length of part name. */
  11. #define PREFIX_NAME_LEN    5      /* Maximum length of prefix (IC, R, SW etc.). */
  12. #define PIN_SEPERATOR    "\n"          /* See Pins in LibraryEntryStruct. */
  13. #define FILE_IDENT    "EEDRAW-LIB"       /* Must be at the lib file start. */
  14. #define PIN_WIDTH    96          /* Width between 2 pins in pixels. */
  15. #define PIN_LENGTH    192          /* Length of each pin to be drawn. */
  16. /* Between height and width of chip (for pin desc. text inside/outside).     */
  17. #define CHIP_BOX_ASPECT_TO 0.4
  18. #define CHIP_BOX_ASPECT_TI 0.7
  19. #define INVERT_PIN_RADIUS LIB_SCALE_DRAW   /* Radius of inverted pin circle. */
  20.  
  21. /* THe width/height of one character in drawing space: */
  22. #define DRAW_TEXT_WIDTH  (GRGetTextWidth("M") << ABS(DEFAULT_ZOOM_FACTOR))
  23. #define DRAW_TEXT_HEIGHT  (GRGetTextHeight("M") << ABS(DEFAULT_ZOOM_FACTOR))
  24.  
  25. /* Normalize angle to be in the 0..360 range: */
  26. #define    NORMALIZE_ANGLE(Angle)    { while (Angle < 0) Angle += 360; \
  27.                   while (Angle > 360) Angle -= 360; }
  28.  
  29. typedef struct LibraryDrawArc {
  30.     int x, y, r, t1, t2;
  31. } LibraryDrawArc;
  32. typedef struct LibraryDrawCircle {
  33.     int x, y, r;
  34. } LibraryDrawCircle;
  35. typedef struct LibraryDrawText {
  36.     int Horiz, x, y;
  37.     char *Text;
  38. } LibraryDrawText;
  39. typedef struct LibraryDrawSquare {
  40.     int x1, y1, x2, y2;
  41. } LibraryDrawSquare;
  42. typedef struct LibraryDrawLine {
  43.     int x1, y1, x2, y2;
  44.     BooleanType Invert;
  45. } LibraryDrawLine;
  46. typedef struct LibraryDrawPolyline {
  47.     int n, *PolyList;
  48.     BooleanType Fill;
  49. } LibraryDrawPolyline;
  50.  
  51. typedef struct LibraryDrawEntryStruct {
  52.     int DrawType;
  53.     union {
  54.     LibraryDrawArc Arc;
  55.     LibraryDrawCircle Circ;
  56.     LibraryDrawText Text;
  57.     LibraryDrawSquare Sqr;
  58.     LibraryDrawLine Line;
  59.     LibraryDrawPolyline Poly;
  60.     } U;
  61.     struct LibraryDrawEntryStruct *Pnext;
  62. } LibraryDrawEntryStruct;
  63.  
  64. typedef struct LibraryEntryStruct {
  65.     char Name[PART_NAME_LEN + 1];                   /* Part name. */
  66.     char Prefix[PREFIX_NAME_LEN + 1];
  67.     int NumOfPins, NumOfUnits, PinsPerUnit;
  68.     BooleanType TextInside, DrawNums, DrawName;
  69.     char *Pins;               /* All pin names, seperated by PIN_SEPERATOR. */
  70.     LibraryDrawEntryStruct *Drawings;           /* How to draw this part. */
  71.     int *Multi;               /* Hold MULTI/ENDMULTI block as linear array. */
  72.     int BBoxMinX, BBoxMaxX, BBoxMinY, BBoxMaxY;     /* BBox around the part. */
  73. } LibraryEntryStruct;
  74.  
  75. typedef enum {
  76.     ARC_DRAW_TYPE,
  77.     CIRCLE_DRAW_TYPE,
  78.     TEXT_DRAW_TYPE,
  79.     SQUARE_DRAW_TYPE,
  80.     LINE_DRAW_TYPE,
  81.     POLYLINE_DRAW_TYPE
  82. } DrawStructType;
  83.  
  84. extern LibraryStruct *LibraryList;        /* All part libs are saved here. */
  85.  
  86. /* Functions common to all EELibs?.c modules: */
  87. int LibraryEntryCompare(LibraryEntryStruct *LE1,
  88.             LibraryEntryStruct *LE2);
  89. int NumOfLibraries(void);
  90.  
  91. #endif EELIBSL_H
  92.