home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / viewers / showgl19 / graph.h < prev    next >
C/C++ Source or Header  |  1992-08-18  |  7KB  |  202 lines

  1. /* header file for graphix.c applications.  Function prototypes & #defines */
  2. /* copyright 1988 - 1992 Robert C. Becker, Lantern Systems */
  3.  
  4. #define        VIDEO        0x10    /* BIOS video int. */
  5. #define        WRT_PIX        0x0c    /* BIOS write pixel request */
  6. #define        SET_MODE    0    /* BIOS set video mode: al = video mode */
  7. #define        VIDEO_STATE    0x0f    /* BIOS get video state */
  8.  
  9. #define        CRT        1    /* text CRT on HP systems, here just CRT */
  10. #define        KBD        2    /* same as on HP systems */
  11. #define        MOUSE        3    /* no previous definition */
  12.  
  13. #define        CGA_320x200    &hpc_320_200_hp        /* BIOS CGA 320x200, 4 color */
  14. #define        CGA_640x200    &hpc_640_200_hp        /* BIOS CGA 640x200 BW */
  15. #define        ATT_640x400    &hpa_640_400_hp        /* AT&T 640x400 BW, tiny type */
  16. #define        ATTDEB_640x400    &hpa_640_400_hp        /* AT&T 640x400 BW, tiny type, 16 colors */
  17. #define        HGC_720x348    &hph_720_348_hp        /* Hercules HGC and HGC+ 720x348 BW */
  18. #define        EGA_320x200    &hpe_320_200_hp        /* IBM EGA low-res 320x200, 16 color */
  19. #define        EGA_640x200    &hpe_640_200_hp        /* IBM EGA med-res 640x200, 16 color */
  20. #define        MEGA_640x350    &hpem_640_350_hp    /* IBM EGA high-res 640x350, BW */
  21. #define        EGA_640x350    &hpe_640_350_hp        /* IBM EGA high-res 640x350, 16 color */
  22. #define        VGA_640x480    &hpv_640_480_hp        /* IBM VGA high-res 640x480, 16 color */
  23. #define        VGA_320x200    &hpv_320_200_hp        /* IBM VGA lo-res 320x200, 256 color */
  24. #define        MCGA_640x480    &hpm_640_480_hp        /* IBM MCGA high-res 640x480, BW */
  25.  
  26. #ifndef VID_PARAM_DEFT
  27.  
  28. #define        IBMPACKED    1    /* video bios # for CGA, MCGA, and VGA 256 color mode, ATT6300, Herc HGC & HCG+ */
  29. #define        IBMPLANES    2    /* video bios # for EGA & VGA */
  30. #define        VESABIOS    3    /* video bios # for VESA devices using BIOS I/O */
  31.  
  32. struct _vid_x_parm_        /* graphix init parameters */
  33.     {
  34.     unsigned max_xdot;    /* horizontal screens pixels - 1 */
  35.     unsigned max_ydot;    /* vertical screen pixels - 1 */
  36.     int max_pen;        /* # colors for this mode - 1 */
  37.     unsigned char mode;    /* BIOS mode # for this mode */
  38.     unsigned video_bios;    /* 0 -> using bios writes, != 0 -> not using bios for pixel writes */
  39.     unsigned base_adr;    /* segment adr for video RAM */
  40.     unsigned block_size;        /* # bytes in one block of video RAM */
  41.     unsigned block_per_page;    /* # blocks needed to make one graphics screen */
  42.     unsigned bytes_per_pixel;    /* =1 unless more than 8 bits/pixel */
  43.     unsigned bits_per_pixel;    /* # bits used for a single pixel */
  44.     unsigned pixels_per_byte;    /* # pixels/byte  (=1 if > 8 bits/pixel) */
  45.  
  46.     };
  47.  
  48. #define     VID_PARAM_DEFT    /* video param structure defined */
  49. #endif
  50.  
  51.  
  52. #ifndef DSP_FN_DEFT
  53.  
  54. enum DFNON__OFF { DFN_OFF, DFN_ON };    /* definition for display fn's ON/OFF */
  55.  
  56. #define DSP_FN_DEFT
  57. #endif
  58.  
  59.  
  60. #ifndef VID_RTN_DEFT
  61.  
  62. struct video_display        /* returned structure for video_test () */
  63.     {
  64.     unsigned disp_a;
  65.     struct _vid_x_parm_ *vid_mode_a;
  66.     char *display_a;
  67.     unsigned disp_b;
  68.     struct _vid_x_parm_ *vid_mode_b;
  69.     char *display_b;
  70.     };
  71. #define     VID_RTN_DEFT    /* video_test return structure defined */
  72. #endif
  73.  
  74. #ifndef Graphix_hdr_deft
  75.  
  76. extern struct _vid_x_parm_ hpc_320_200_hp;        /* BIOS CGA 320x200, 4 color */
  77. extern struct _vid_x_parm_ hpc_640_200_hp;        /* BIOS CGA 640x200 BW */
  78. extern struct _vid_x_parm_ hpa_640_400_hp;        /* AT&T 640x400 BW, tiny type */
  79. extern struct _vid_x_parm_ hpad_640_400_hp;        /* AT&T 640x400 BW, tiny type, 16 colors */
  80. extern struct _vid_x_parm_ hph_720_348_hp;        /* Hercules HGC and HGC+ 720x348 BW */
  81. extern struct _vid_x_parm_ hpe_320_200_hp;        /* IBM EGA low-res 320x200, 16 color */
  82. extern struct _vid_x_parm_ hpe_640_200_hp;        /* IBM EGA med-res 640x200, 16 color */
  83. extern struct _vid_x_parm_ hpem_640_350_hp;        /* IBM EGA high-res 640x350, BW */
  84. extern struct _vid_x_parm_ hpe_640_350_hp;        /* IBM EGA high-res 640x350, 16 color */
  85. extern struct _vid_x_parm_ hpv_640_480_hp;        /* IBM VGA high-res 640x480, 16 color */
  86. extern struct _vid_x_parm_ hpv_320_200_hp;        /* IBM VGA lo-res 320x200, 256 color */
  87. extern struct _vid_x_parm_ hpm_640_480_hp;        /* IBM MCGA high-res 640x480, BW */
  88.  
  89. #define        Graphix_hdr_deft
  90.  
  91. #endif
  92.  
  93. #ifndef GR_CFG_DEFT
  94.  
  95. struct gr_config    /* defining structure for get_config (), set_config () */
  96.     {
  97.     int units, coupled, pen, pendown, degree, clip_type;
  98.     int wht_color, pen_max, g_input, csize_units;
  99.     int disp_fn, current_font;
  100.     double hclip_xmin, hclip_xmax, hclip_ymin, hclip_ymax;
  101.     double sclip_xmin, sclip_xmax, sclip_ymin, sclip_ymax;
  102.     double clip_xmin, clip_xmax, clip_ymin, clip_ymax;
  103.     double vport_xmin, vport_xmax, vport_ymin, vport_ymax;
  104.     double uu_xfactor, uu_yfactor, uu_xoffset, uu_yoffset;
  105.     double rpos_x, rpos_y, xpos, ypos, ldir_angle, cdir_angle;
  106.     double pivot_cos, pivot_sin, pivot_x, pivot_y, p_cos, p_sin;
  107.     double tilt, gdu, l_rpt, l_org, l_type, c_size;
  108.     double x_factor, y_factor, x_offset, y_offset, xmax, ymax;
  109.     double scr_xmin, scr_ymin;
  110.     };
  111.  
  112. #define    GR_CFG_DEFT
  113. #endif
  114.  
  115.  
  116. #ifndef CHAR_STR_DEFT
  117. struct char___deft
  118.     {
  119.     char *fontname;
  120.     double ascender;
  121.     double descender;
  122.     double width;
  123.     double base;
  124.     double center;
  125.     double top;
  126.     double x_inc;
  127.     double y_inc;
  128.     };
  129. #define        CHAR_STR_DEFT    /* char description struct defined */
  130. #endif
  131.  
  132.  
  133. #ifndef        SCR_PXLZ
  134.  
  135. struct scrn_pixel__
  136.     {
  137.     int xp, yp;
  138.     };
  139.  
  140. #define        SCR_PXLZ    /* struct for pmap () defined */
  141. #endif
  142.  
  143.  
  144. void arc ( double, int, double, double );
  145. void axes ( double, double, double, double, int, int, double );
  146. void cdir ( double );
  147. void char_xspace ( double, double );
  148. void clip ( double, double, double, double );
  149. void clip_off ( void );
  150. void clip_on ( void );
  151. void couple_pdir ( void );
  152. void csize ( double, double, double );
  153. void csize_gdu (void);
  154. void csize_mm (void);
  155. void csize_udu (void);
  156. void deg ( void );
  157. int  digitize ( double *, double * );
  158. void disp_fns ( enum DFNON__OFF );
  159. void draw ( double, double );
  160. void frame ( void );
  161. void gclear ( void );
  162. void get_config ( struct gr_config * );
  163. void g_init ( struct _vid_x_parm_ * );
  164. int  graphics_input ( int );
  165. void graphics_off ( void );
  166. void grid ( double, double, double, double, int, int, double );
  167. void idraw ( double, double );
  168. void imove ( double, double );
  169. void iplot ( double, double, int );
  170. void labelf ( char *, ... );
  171. void ldir ( double );
  172. void limit ( double, double, double, double );
  173. void line_type ( int, double );
  174. void lorg ( int );
  175. void move ( double, double );
  176. void mscale ( double, double );
  177. void pen ( int );
  178. void penup ( void );
  179. void pdir ( double );
  180. void pivot ( double );
  181. void plot ( double, double, int );
  182. int pmap ( double, double, struct scrn_pixel__ _far * );
  183. void rad ( void );
  184. double ratio ( void );
  185. void rdraw ( double, double );
  186. void rectangle ( double, double, double, double );
  187. int  read_locator ( double *, double * );
  188. void rmove ( double, double );
  189. void rplot ( double, double, int );
  190. void show ( double, double, double, double );
  191. void set_config ( struct gr_config * );
  192. void setgu ( void );
  193. void setuu ( void );
  194. void track ( int );
  195. void uncouple_pdir ( void );
  196. void viewport ( double, double, double, double );
  197. int  where ( double *, double * );
  198. void window ( double, double, double, double );
  199.  
  200. struct char___deft *std_font ( void );    /* pointer to struct defining std char font */
  201.  
  202.