mouse.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef MOUSE_H
  2. #define MOUSE_H
  3. void mouse_init(void);
  4. void mouse_poll_update(void);
  5. int mouse_is_present(void);
  6. /* 1 when a PS/2 mouse was detected; the protocol accessors below are
  7. PS/2-specific (the USB backend lives in usbhid.h). */
  8. int mouse_ps2_present(void);
  9. int mouse_streaming_enabled(void);
  10. unsigned int mouse_device_id(void);
  11. int mouse_cursor_visible(void);
  12. /* Active cursor backend: 0 = software, 1 = Cirrus, 2 = Radeon. */
  13. int mouse_cursor_backend(void);
  14. /* Human-readable form of the above ("software", "nvidia hw", ...). */
  15. const char *mouse_cursor_backend_name(void);
  16. unsigned int mouse_packet_size(void);
  17. /* Current cursor position (hotspot) in framebuffer pixels. */
  18. unsigned int mouse_get_x(void);
  19. unsigned int mouse_get_y(void);
  20. /* Button state bitmask: bit0 = left, bit1 = right, bit2 = middle. */
  21. unsigned int mouse_buttons_state(void);
  22. /* Restore the saved background under the cursor (erase the cursor). Call
  23. before a scene redraw so mouse_redraw_cursor() re-saves a clean background. */
  24. void mouse_cursor_erase(void);
  25. /* Re-save the region under the cursor and redraw it on top (after the WM
  26. redraws windows underneath a stationary cursor). */
  27. void mouse_redraw_cursor(void);
  28. /* While a WM frame owns the shadow buffer, movement must update the position
  29. * and buttons without drawing a software cursor underneath the frame. The
  30. * WM erases/redraws the cursor itself at BEGIN/PRESENT. */
  31. void mouse_set_auto_draw(int on);
  32. #endif