home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povsrc20 / tigadefs.h < prev    next >
Text File  |  1992-03-25  |  13KB  |  252 lines

  1. /*-----------------------------------------------------------------------*/
  2. /*                                 TIGA                                  */
  3. /*              Copyright (c) 1988,89 Texas Instruments Inc.             */
  4. /*-----------------------------------------------------------------------*/
  5. /*  TIGA - Header file                                                   */
  6. /*-----------------------------------------------------------------------*/
  7. /*                                                                       */
  8. /*  file            typedefs.h                                           */
  9. /*                                                                       */
  10. /*  description     This file contains type definitions used in          */ 
  11. /*                  the Applications Interface.                          */
  12. /*                  This file should be included in any Microsoft-C      */
  13. /*                  program accessing data of these types.               */
  14. /*                                                                       */
  15. /*-----------------------------------------------------------------------*/
  16.  
  17. /*--------------------------------------------------------------------------*/
  18. /*  Define integral data types                                              */
  19. /*--------------------------------------------------------------------------*/
  20. typedef unsigned char   uchar;
  21. typedef unsigned short  ushort;
  22. typedef unsigned long   ulong;
  23. typedef unsigned long   PTR;
  24. typedef uchar far       *HPTR;
  25.  
  26.  
  27. /*--------------------------------------------------------------------------*/
  28. /*  CURSOR structure definition                                             */
  29. /*                                                                          */
  30. /*      This structure contains cursor description information.             */
  31. /*--------------------------------------------------------------------------*/
  32. typedef struct 
  33. {
  34.     short   hot_x;      /* offset from top...  */
  35.     short   hot_y;      /* ...left-hand corner */
  36.     ushort  width;      /* array width         */
  37.     ushort  height;     /* array height        */
  38.     ushort  pitch;
  39.     ulong   color;      /* color of cursor     */
  40.     ushort  mask_rop;   /* cursor mask rop     */
  41.     ushort  shape_rop;  /* cursor shape rop    */
  42.     PTR     data;       /* pointer to cursor data in GSP memory */
  43. } CURSOR;
  44.  
  45.  
  46. /*--------------------------------------------------------------------------*/
  47. /*  PATTERN structure definition                                            */
  48. /*                                                                          */
  49. /*      This structure contains pattern description information.            */
  50. /*--------------------------------------------------------------------------*/
  51. typedef struct 
  52. {
  53.     ushort  width;      /* width of pattern    */
  54.     ushort  height;     /* height of pattern   */
  55.     ushort  depth;      /* depth (bits/pixel)  */
  56.     PTR     data;       /* address of pattern in GSP memory */
  57. } PATTERN;
  58.  
  59.             
  60. /*--------------------------------------------------------------------------*/
  61. /*  PALET structure definition                                              */
  62. /*                                                                          */
  63. /*      This structure contains the rgb and intensity components for a      */
  64. /*      palette entry.                                                      */
  65. /*--------------------------------------------------------------------------*/
  66. typedef struct 
  67. {
  68.     uchar   r;
  69.     uchar   g;
  70.     uchar   b;
  71.     uchar   i;
  72. } PALET;
  73.  
  74.  
  75. /*--------------------------------------------------------------------------*/
  76. /*  MONITORINFO structure definition                                        */
  77. /*                                                                          */
  78. /*      This structure contains video timing parameters.                    */
  79. /*--------------------------------------------------------------------------*/
  80. typedef struct
  81. {
  82.     ushort  hesync;
  83.     ushort  heblnk;
  84.     ushort  hsblnk;
  85.     ushort  htotal;
  86.     ushort  vesync;
  87.     ushort  veblnk;
  88.     ushort  vsblnk;
  89.     ushort  vtotal;
  90.     ushort  dpyctl;
  91.     ushort  screen_delay;
  92.     ushort  flags;
  93. } MONITORINFO;
  94.  
  95.  
  96. /*--------------------------------------------------------------------------*/
  97. /*  OFFSCREEN structure definitions                                         */
  98. /*                                                                          */
  99. /*      These structures contain definitions of offscreen work areas        */
  100. /*--------------------------------------------------------------------------*/
  101. typedef struct 
  102. {
  103.     PTR     addr;   /* address in gsp space of an offscreen work area */
  104.     ushort  xext;   /* x extension in the current screen pixel size   */
  105.     ushort  yext;   /* y extension using default screen pitch         */
  106. } OFFSCREEN_AREA;
  107.  
  108.  
  109. /*--------------------------------------------------------------------------*/
  110. /*  PAGE structure definitions                                              */
  111. /*                                                                          */
  112. /*      These structures contain definitions used to implement multiple     */
  113. /*      display pages.  The information in these structures is used to      */
  114. /*      display a given page.                                               */
  115. /*--------------------------------------------------------------------------*/
  116. typedef struct 
  117. {
  118.     PTR     BaseAddr;   /* Base address of start of page                */
  119.     ushort  DpyStart;   /* Value loaded in Display Start i/o register   */
  120.     short   DummyPad;   /* 16 bits to pad structure to power of 2 size  */
  121. } PAGE;                 
  122.  
  123.  
  124. /*--------------------------------------------------------------------------*/
  125. /*  MODEINFO structure definition                                           */
  126. /*                                                                          */
  127. /*      This structure contains information pertaining to the current mode  */ 
  128. /*      of operation.                                                       */
  129. /*--------------------------------------------------------------------------*/
  130. typedef struct
  131. {
  132.     ulong   disp_pitch;         /* display pitch y::x                   */
  133.     ushort  disp_vres;          /* vertical resolution (pixels)         */
  134.     ushort  disp_hres;          /* horizontal resolution (pixels)       */
  135.     short   screen_wide;        /* screen width                         */
  136.     short   screen_high;        /* screen height                        */
  137.     ushort  disp_psize;         /* pixel size                           */
  138.     ulong   pixel_mask;         /* pixel mask                           */
  139.     ushort  palet_gun_depth;    /* # of bits per gun                    */    
  140.     ulong   palet_size;         /* number of palette entries            */
  141.     short   palet_inset;        /* offset from frame start to data      */ 
  142.     ushort  num_pages;          /* number of display pages              */
  143.     short   num_offscrn_areas;  /* number off offscreen work areas      */
  144.     ulong   wksp_addr;          /* address of offscreen workspace       */
  145.     ulong   wksp_pitch;         /* pitch of offscreen workspace         */
  146. } MODEINFO;
  147.  
  148.  
  149. /*--------------------------------------------------------------------------*/
  150. /*  CONFIG structure definition                                             */
  151. /*                                                                          */
  152. /*      This structure contains the current hardware operating              */
  153. /*      configuration.                                                      */
  154. /*--------------------------------------------------------------------------*/
  155. typedef struct 
  156. {
  157.     ushort      version_number;
  158.     ulong       comm_buff_size;
  159.     ulong       sys_flags;
  160.     ulong       device_rev;
  161.     ushort      num_modes;
  162.     ushort      current_mode;
  163.     ulong       program_mem_start;
  164.     ulong       program_mem_end;
  165.     ulong       display_mem_start;
  166.     ulong       display_mem_end;
  167.     ulong       stack_size;
  168.     ulong       shared_mem_size;
  169.     HPTR        shared_host_addr;
  170.     PTR         shared_gsp_addr;
  171.     MODEINFO    mode;
  172. } CONFIG;
  173.  
  174.  
  175. /*--------------------------------------------------------------------------*/
  176. /*  ENVIRONMENT structure definition                                        */
  177. /*                                                                          */
  178. /*      This structure contains the current values of environment global    */
  179. /*      variables.                                                          */
  180. /*--------------------------------------------------------------------------*/
  181. typedef struct 
  182. {
  183.     ulong   xyorigin;      /* xy drawing origin      */
  184.     ulong   pensize;       /* pensize height::width  */
  185.     PTR     srcbm;         /* source bitmap struct   */
  186.     PTR     dstbm;         /*   dest bitmap struct   */
  187.     ulong   stylemask;     /* styled line patn mask  */
  188. } ENVIRONMENT;
  189.  
  190.  
  191. /*----------------------------------------------------------------------*/
  192. /*  MODULE structure definition                                         */
  193. /*                                                                      */
  194. /*  This structure defines the data associated with a function module.  */
  195. /*----------------------------------------------------------------------*/
  196. typedef struct
  197. {
  198.     PTR     ListAddr;
  199.     PTR     MallocAddr;
  200.     ulong   MallocBytes;
  201.     ushort  NumFuncs;
  202.     ushort  Dummy;
  203. } MODULE;
  204.  
  205.  
  206. /*----------------------------------------------------------------------*/
  207. /*  FONT structure definition                                           */
  208. /*                                                                      */
  209. /*  This structure defines the data associated with a font              */
  210. /*----------------------------------------------------------------------*/
  211. typedef struct
  212. {
  213.     ushort magic;        /* font type code                               */
  214.     long   length;       /* Length of font in bytes                      */
  215.     char   facename[32];
  216.     short  first;        /* ASCII code of first character                */
  217.     short  last;         /* ASCII code of last character                 */
  218.     short  maxwide;      /* maximum character width                      */
  219.     short  maxkern;      /* maximum character kerning amount             */
  220.     short  charwide;     /* Width of characters (0 if proportional)      */
  221.     short  avgwide;      /* Average width of characters                  */
  222.     short  charhigh;     /* character height                             */
  223.     short  ascent;       /* ascent (how far above base line)             */
  224.     short  descent;      /* descent (how far below base line)            */
  225.     short  leading;      /* leading (row bottom to next row top)         */
  226.     long   rowpitch;     /* bits per row of char patterns                */
  227.     long   oPatnTbl;     /* Bit offset to PatnTbl (from bof)             */
  228.     long   oLocTbl;      /* Bit offset to LocTbl (from bof)              */
  229.     long   oOwTbl;       /* Bit offset to OWTbl (from bof)               */
  230. } FONT;
  231.  
  232. /*----------------------------------------------------------------------*/
  233. /*  FONTINFO structure definition                                       */
  234. /*----------------------------------------------------------------------*/
  235. typedef struct
  236. {
  237.     char  facename[32];
  238.     short first;        /* ASCII code of first character                */
  239.     short last;         /* ASCII code of last character                 */
  240.     short maxwide;      /* maximum character width                      */
  241.     short avgwide;      /* Average width of characters                  */
  242.     short maxkern;      /* Max character kerning amount                 */
  243.     short charwide;     /* Width of characters (0=proportional)         */
  244.     short charhigh;     /* character height                             */
  245.     short ascent;       /* ascent (how far above base line)             */
  246.     short descent;      /* descent (how far below base line)            */
  247.     short leading;      /* leading (row bottom to next row top)         */
  248.     PTR   fontptr;      /* address of font in gsp memory                */
  249.     short id;           /* id of font (set at install time)             */
  250. } FONTINFO;
  251.  
  252.