mouse.hpp 700B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef N_MOUSE_H_
  2. #define N_MOUSE_H_
  3. #include <wayland-client.h>
  4. #include <wayland-cursor.h>
  5. #include <vector>
  6. #include <glm/glm.hpp>
  7. #include "linux/input-event-codes.h"
  8. #include "wayland.hpp"
  9. class Mouse {
  10. private:
  11. wl_cursor_theme* theme;
  12. float x,y;
  13. std::vector<glm::ivec2> buttons;
  14. std::string currentMouseCursor;
  15. public:
  16. wl_surface* surface;
  17. wl_cursor* cursor;
  18. wl_pointer* pointer;
  19. int serial;
  20. Mouse( Wayland* wayland );
  21. void setMousePos( float x, float y );
  22. void setCursor( std::string name );
  23. glm::vec2 getMousePos();
  24. void setButton( int button, int state );
  25. int getButton( int button );
  26. };
  27. extern Mouse* mouse;
  28. #endif // N_MOUSE_H_