home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / src / specialhost / special.h < prev    next >
C/C++ Source or Header  |  1991-07-11  |  3KB  |  148 lines

  1. /* special.h */
  2.  
  3. #define MAGIC_WORD        (('S'<<24) | ('P'<<16) | ('E'<<8) | 'C')
  4.  
  5. #define SPECIAL_PORT        "special_dvi"
  6. #define SPECIAL_REPLY        "special_reply"
  7.  
  8. /* 4 commands for \special-strings */
  9. #define AC_SEND_SPECIAL        1
  10. #define AC_REPLY_SPECIAL    2
  11. #define AC_OK_BITMAP        3
  12. #define AC_REPLY_BITMAP        4
  13.  
  14. /* 2 commands for tpic commands */
  15. #define AC_SEND_TPIC        5
  16. #define AC_REPLY_TPIC        6
  17.  
  18. /* SpecialHost don't know the current action */
  19. #define AC_REPLY_UNKNOWN    7
  20.  
  21.  
  22. #define LOC_NONE        0    /* no picture available             */
  23. #define LOC_BITMAP        1    /* bimap in RAM                 */
  24. #define LOC_FILE        2    /* bitmap in a file             */
  25. #define LOC_BORDER        3    /* no picture, draw only a border    */
  26. #define LOC_RECTANGLE        4    /* no picture, draw a full rectangle */
  27.                     /* LOC_BORDER || LOC_RECTANGLE          */
  28.                     /*        => loc.map == NULL   */
  29. #define LOC_BITMAP_BORDER    5    /* bitmap in RAM + draw border         */
  30. #define LOC_FILE_BORDER        6    /* bitmap in file + draw border         */
  31.  
  32.  
  33.  
  34. /* TPIC commands */
  35. /* only the '!' commands call SpecialHost */
  36.  
  37. #define TPIC_NO_TPIC    0
  38. #define TPIC_PN        1 
  39. #define TPIC_PA     2
  40. #define TPIC_FP     3        /* ! */
  41. #define TPIC_IP     4        /* ! */
  42. #define TPIC_DA     5        /* ! */
  43. #define TPIC_DT        6        /* ! */
  44. #define TPIC_SP     7        /* ! */
  45. #define TPIC_SPB    8        /* ! (same as _SP) */
  46. #define TPIC_AR     9        /* ! */
  47. #define TPIC_IA     10        /* ! */
  48. #define TPIC_SH        11
  49. #define TPIC_SHB    12
  50. #define TPIC_WH        13
  51. #define TPIC_BK        14
  52. #define TPIC_TX        15
  53.  
  54.  
  55. struct tpic_msg {
  56.         char    tpic_com;
  57.         char    whiten;
  58.         char    blacken;
  59.         char    pad;
  60.         long    shade;                /* mult 10000 */
  61.         long    opt_long[4];            /* options to the tpic command */
  62.         char    opt_float[2][12];        /* float werden als String uebergeben! */
  63.         long    pen_size;
  64.         long    path_len;
  65.         long   *xx;
  66.         long   *yy;
  67.     };
  68.  
  69.  
  70. struct driver_map {
  71.         /* cursor */
  72.         long    x;            /* actual cursor position   */
  73.         long    y;            /* in the bitmap.        */
  74.         /* bitmap */
  75.         long    width;            /* width of bitmap in bits  */
  76.         long    height;            /* height of bitmap in bits */
  77.         long    lower_limit;
  78.         long    upper_limit;
  79.         long   *pixptr;            /* pointer to bitmap        */
  80.     };
  81.  
  82. /**  Bitmap:
  83.  
  84.          width
  85.         +---------------+
  86.     |        |
  87.      |        |  height
  88.     |        |
  89.     |        |
  90.     |        |
  91.      ----------------------    upper_limit
  92.     |        |
  93.     |        |
  94.     |        |
  95.      ----------------------    lower_limit
  96.     |        |
  97.     |        |
  98.     |        |
  99.     |        |
  100.         +---------------+
  101.  
  102.   Bitmap is only between upper_limit and lower_limit in memory!
  103.  
  104. *****/
  105.  
  106.  
  107.  
  108.  
  109.  
  110. union  location {
  111.         unsigned long    *map;        /* picture as bitmap, lines with word (2Byte) alignment */
  112.         char         *filename;    /* picture as file */
  113.     };
  114.  
  115.  
  116. struct special_map {
  117.         short         where_is;    /* LOC_#? */
  118.         long         hoffset;    /* all in pixel */
  119.         long         voffset;
  120.         long         width;        /* in pixel (bitmap word-alignment!) */
  121.         long         height;    /* in pixel (bitmap word-alignment!) */
  122.     union    location     loc;
  123.         long         reserved1;
  124.         long         reserved2;
  125.         long         reserved3;
  126.         long         reserved4;
  127.     };
  128.  
  129. struct special_msg {        
  130.     struct    Message         msg;        /* 18 Bytes */
  131.         short         action;
  132.         short         ret;
  133.         char        *special_string;
  134.         long         hresolution;    /* 28 */
  135.         long         vresolution;    /* 32 */
  136.     struct    tpic_msg    *tpic;        /* if != NULL => tpic message */
  137.     struct    driver_map    *dmap;
  138.     struct    special_map    *bmap;
  139.     };
  140.  
  141.  
  142. /* functions */
  143.  
  144. struct special_map *send_special(char *sp_string);
  145. void             send_tpic(struct tpic_msg *tp);
  146. void            special_ok(void);
  147.  
  148.