home *** CD-ROM | disk | FTP | other *** search
/ Kyūkyoku!! X68000 Emulator / X68000Book.dat / mac / OLS / X68000 / Ko-Window / kow142s.lzh / wsrv / draw.h < prev    next >
C/C++ Source or Header  |  1992-12-10  |  3KB  |  143 lines

  1.  
  2. /*
  3.  *        ò`ëµâIâvâVâçâô
  4.  */
  5.  
  6. #ifndef    AttrDefault
  7.     #define    AttrDefault        9
  8.     #define    AttrHighLight    4
  9.     #define    AttrReverse        8
  10.     #define    OptionXor        0x10
  11.     typedef    enum {
  12.             OptionLine,
  13.             OptionBox,
  14.             OptionFill,
  15.             OptionShadow,
  16.         }
  17.             SheetOption ;
  18.     #define    ShadowUp    0
  19.     #define    ShadowDown    1
  20.     typedef struct {
  21.             int                h, v, hword ;    /*    æσé½é│                        */
  22.             unsigned short    *buf1 ;            /*    âoâbâtâ@é╓é╠â|âCâôâ^        */
  23.             unsigned short    *buf2 ;            /*    âoâbâtâ@é╓é╠â|âCâôâ^        */
  24.         }
  25.             Sheet ;
  26. #endif
  27.  
  28. #ifdef    DRAW
  29. typedef    enum {
  30.         DrawClear,
  31.         DrawLine,
  32.         DrawPut,
  33.         DrawSymbol,
  34.         DrawPattern,
  35.         DrawGraphicClear,
  36.         DrawGraphicLine,
  37.         DrawGraphicPut,
  38.         DrawDot,
  39.         DrawCircle,
  40. #if 0
  41.         DrawEllipse,
  42.         DrawTriangle,
  43.         DrawPoly,
  44. #endif
  45.         DrawGraphicDot,
  46.         DrawGraphicCircle,
  47.     }
  48.         DrawOption ;
  49.  
  50. typedef    struct    {
  51.         int        code ;
  52.     }
  53.         DrawClearStruct ;
  54.  
  55. typedef    struct    {
  56.         int        x1, y1, x2, y2 ;
  57.         int        code, option ;
  58.     }
  59.         DrawLineStruct ;
  60.  
  61. typedef    struct    {
  62.         int        x, y ;
  63.         void    *sp ;
  64.     }
  65.         DrawPutStruct ;
  66.  
  67. typedef    struct    {
  68.         int        x, y ;
  69.         char    *str ;
  70.         int        attr, font ;
  71.     }
  72.         DrawSymbolStruct ;
  73.  
  74. typedef    struct    {
  75.         void    *sp ;
  76.     }
  77.         DrawPatternStruct ;
  78.  
  79. typedef    struct    {
  80.         int        x1, y1, x2, y2 ;
  81.         short    *gbuf ;
  82.     }
  83.         DrawGraphicPutStruct ;
  84.  
  85. typedef    struct    {
  86.         int        x, y;
  87.         int        code;
  88. }
  89.         DrawDotStruct ;
  90.  
  91. typedef    struct    {
  92.         int        x, y;
  93.         int        rx, ry;
  94.         int        code, option;
  95. }
  96.         DrawCircleStruct ;
  97.  
  98. typedef    struct    {
  99.         int        *data;
  100.         int        code, option;
  101. }
  102.         DrawTriangleStruct;
  103.  
  104. typedef    struct    {
  105.         int        n;
  106.         int        *data;
  107.         int        code, option;
  108. }
  109.         DrawPolyStruct;
  110.  
  111. typedef    struct    {
  112.         DrawOption    type ;
  113.         union    {
  114.             DrawClearStruct            clear ;
  115.             DrawLineStruct            line ;
  116.             DrawPutStruct            put ;
  117.             DrawSymbolStruct        symbol ;
  118.             DrawPatternStruct        pattern ;
  119.             DrawGraphicPutStruct    gput ;
  120.             DrawDotStruct            dot;
  121.             DrawCircleStruct        circle;
  122.             DrawTriangleStruct        triangle;
  123.             DrawPolyStruct            poly;
  124.         }
  125.             option ;
  126.     }
  127.         DrawBuf ;
  128. #else
  129.     typedef    char    DrawBuf[28] ;
  130. #endif
  131.  
  132. /*
  133.     proto -e draw.c > temp
  134. */
  135. extern    void    DrawSetClear( DrawBuf*, int );
  136. extern    void    DrawSetLine( DrawBuf*, int, int, int, int, int, int );
  137. extern    void    DrawSetPut( DrawBuf*, int, int, void* );
  138. extern    void    DrawSetSymbol( DrawBuf*, int, int, char*, int, int );
  139. extern    void    DrawSetPattern( DrawBuf*, void* );
  140. extern    void    DrawSetGraphicClear( DrawBuf*, int );
  141. extern    void    DrawSetGraphicLine( DrawBuf*, int, int, int, int, int, int );
  142. extern    void    DrawSetGraphicPut( DrawBuf*, int, int, int, int, short* );
  143.