mouse.h 1.5 KB

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