mouse.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* $Id$
  2. * MegaZeux
  3. *
  4. * Copyright (C) 1996 Greg Janson
  5. * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. * Copyright (C) 1999 Charles Goetzman
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. /* Prototypes and declarations for MOUSE.CPP */
  23. #ifndef __MOUSE_H
  24. #define __MOUSE_H
  25. //Code returned by getkey for mouse events
  26. #define MOUSE_EVENT -513
  27. //Size of mouse "click" ahead buffer
  28. #define MOUSE_BUFFERSIZE 16
  29. //Bit defines for mouse driver function 12 -- define handler
  30. //Also used for mouse queue status
  31. #define MOUSEMOVE 1
  32. #define LEFTBPRESS 2
  33. #define LEFTBRELEASE 4
  34. #define RIGHTBPRESS 8
  35. #define RIGHTBRELEASE 16
  36. //Bits for button presses from button status function
  37. #define LEFTBDOWN 1
  38. #define RIGHTBDOWN 2
  39. //Mouse information record
  40. struct mouse_info_rec {
  41. char buttonstat;
  42. char cx,cy;
  43. };
  44. typedef struct mouse_info_rec mouse_info_rec;
  45. extern char mousehidden;
  46. extern unsigned int mouseinstalled;
  47. extern char driver_activated;
  48. extern volatile int mousex,mousey,mybutton;
  49. extern volatile int mmx, mmy;
  50. extern int mouse_count;
  51. //Initialize the mouse routines
  52. void m_init(void);
  53. //Deinitialize the mouse routines
  54. void m_deinit(void);
  55. //Take a snapshot of current mouse state (in saved_mouse_x, etc)
  56. void m_snapshot(void);
  57. //Change the current video segment
  58. void m_vidseg(unsigned int newseg);
  59. //Hide the mouse cursor
  60. void m_hide(void);
  61. //Show the mouse cursor
  62. void m_show(void);
  63. //Move the mouse cursor
  64. void m_move(int newx,int newy);
  65. //Return non-0 if there are events waiting in the buffer
  66. char m_check(void);
  67. //Look at the next event in the buffer, but don't pull it out
  68. void m_preview(mouse_info_rec *mir);
  69. //Get and remove next event from the buffer
  70. void m_get(mouse_info_rec *mir);
  71. //Return the current status of the mouse buttons
  72. int m_buttonstatus(void);
  73. #endif