home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / viewers / showgl19 / mscio.h < prev    next >
C/C++ Source or Header  |  1992-03-26  |  3KB  |  87 lines

  1. /* mscio.h */
  2.  
  3. /* header file for MSC specific IO & BIOS calls */
  4. /* Copyright 1992, Robert C. Becker, Lantern Systems */
  5.  
  6. #ifndef MSCIO
  7.  
  8. #define        VIDEO        0x10    /* BIOS video int. */
  9. #define        WRT_PIX        0x0c    /* BIOS write pixel request */
  10. #define        SET_MODE    0    /* BIOS set video mode: al = video mode */
  11. #define        VIDEO_STATE    0x0f    /* BIOS read video state */
  12. #define        SET_COLOR    0x0b    /* setup color pallate request */
  13.  
  14. #define        MOUSE_D        0x33    /* mouse driver interrupt vector */
  15. #define     M_RESET        0    /* reset mouse */
  16. #define     M_SHO_CUR    1    /* show cursor */
  17. #define     M_HID_CUR    2    /* hide cursor */
  18. #define     M_GET_POS    3    /* get current cursor position (in pixels) */
  19. #define     M_SET_POS    4    /* set cursor position (in pixels ) */
  20. #define     M_GET_BTNS    5    /* get button press info */
  21. #define        M_MAX_MIN_X    7    /* set max & min x position (in pixels) */
  22. #define        M_MAX_MIN_Y    8    /* set max & min y position (in pixels) */
  23. #define        M_DEF_CURS    9    /* define graphics cursor shape & reference point */
  24.  
  25. #define        RT_ARROW    0x4d00
  26. #define        LF_ARROW    0x4b00
  27. #define        UP_ARROW    0x4800
  28. #define        DN_ARROW    0x5000    /* cursor key values returned by _bios_keybrd (_KEYBRD_READ) */
  29.  
  30. #define    get_vector(x)            _gr_get_vector_ (x)
  31. #define    get_key()            _gr_get_key_ ()
  32. #define    pc_wrt_line(r,s,t,u,v,w)    _gr_pc_wrt_line_ (r, s, t, u, v, w)
  33. #define    kbd_shift_state()        _gr_kbd_shift_state_ ()
  34. #define    kbd_status()            _gr_kbd_status_ ()
  35. #define    clear_kbd_queue()        _gr_clear_kbd_queue_ ()
  36. #define    move_cursor(x,y,z,t)        _gr_move_cursor_ (x, y, z, t)
  37. #define    draw_pointer(r,s,t,u,v,w)    _gr_draw_pointer_ (r, s, t, u, v, w)
  38. #define    mouse_set_pos(x,y)        _gr_mouse_set_pos_ (x, y)
  39. #define    mouse_get_pos()            _gr_mouse_get_pos_ ()
  40. #define    mouse_define_cursor(x,y,z)    _gr_mouse_define_cursor_ (x, y, z)
  41. #define    mouse_get_btns(x)        _gr_mouse_get_btns_ (x)
  42.  
  43.  
  44. #define    get_video_mode()        _gr_vid_mode_ (VIDEO_STATE, 0)
  45. #define    set_video_mode(x)        _gr_vid_mode_ (SET_MODE, x)
  46. #define mouse_reset()            _gr_mouse_fn1_ (M_RESET)
  47. #define    mouse_sho_cur()            ( (void) _gr_mouse_fn1_ (M_SHO_CUR))
  48. #define    mouse_hid_cur()            ( (void) _gr_mouse_fn1_ (M_HID_CUR))
  49.                     /* showing and hiding the mouse do not yield */
  50.                     /* meaningful return values */
  51. #define    mouse_cursor_x(xmin,xmax)    _gr_mouse_cursor_minmax_ (xmin, xmax, M_MAX_MIN_X)
  52. #define    mouse_cursor_y(ymin,ymax)    _gr_mouse_cursor_minmax_ (ymin, ymax, M_MAX_MIN_Y)
  53.  
  54. #define arrow_key(x)            ((x == UP_ARROW) || (x == LF_ARROW) \
  55.                     || (x == RT_ARROW) || (x == DN_ARROW))
  56.                     /* test for cursor keys */
  57.  
  58. struct mouse_pos
  59.     {
  60.     int x, y;
  61.     unsigned count;
  62.     };
  63.  
  64. void _gr_draw_pointer_ ( int *, int *, int, int, unsigned _far *, unsigned _far * );
  65.  
  66. unsigned _gr_get_key_ ( void );
  67. unsigned char _far * _gr_get_vector_ ( unsigned );
  68.  
  69. unsigned _gr_kbd_shift_state_ ( void );
  70. unsigned _gr_kbd_status_ ( void );
  71. void _gr_clear_kbd_queue_ ( void );
  72.  
  73. void _gr_move_cursor_ ( int *, int *, unsigned, int );
  74.  
  75. int _gr_mouse_fn1_ ( unsigned );
  76. void _gr_mouse_define_cursor_ (int, int, unsigned _far * );
  77. void _gr_mouse_cursor_minmax_ ( unsigned, unsigned, unsigned );
  78. void _gr_mouse_set_pos_ ( int, int );
  79. struct mouse_pos *_gr_mouse_get_btns_ ( unsigned );
  80. struct mouse_pos *_gr_mouse_get_pos_ ( void );    /* get position */
  81.  
  82. void _gr_pc_wrt_line_ ( unsigned, int, int, int, int, int );
  83. unsigned _gr_vid_mode_ ( unsigned char, unsigned char );
  84.  
  85. #define    MSCIO
  86. #endif
  87.