mouse.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 int mouse_count;
  50. //Initialize the mouse routines
  51. void m_init(void);
  52. //Deinitialize the mouse routines
  53. void m_deinit(void);
  54. //Take a snapshot of current mouse state (in saved_mouse_x, etc)
  55. void m_snapshot(void);
  56. //Change the current video segment
  57. void m_vidseg(unsigned int newseg);
  58. //Hide the mouse cursor
  59. void m_hide(void);
  60. //Show the mouse cursor
  61. void m_show(void);
  62. //Move the mouse cursor
  63. void m_move(int newx,int newy);
  64. //Return non-0 if there are events waiting in the buffer
  65. char m_check(void);
  66. //Look at the next event in the buffer, but don't pull it out
  67. void m_preview(mouse_info_rec *mir);
  68. //Get and remove next event from the buffer
  69. void m_get(mouse_info_rec *mir);
  70. //Return the current status of the mouse buttons
  71. int m_buttonstatus(void);
  72. #endif