GEventLoop.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include <LibCore/CEventLoop.h>
  3. #include <LibCore/CoreIPCClient.h>
  4. #include <LibGUI/GEvent.h>
  5. #include <WindowServer/WSAPITypes.h>
  6. class GAction;
  7. class CObject;
  8. class CNotifier;
  9. class GWindow;
  10. class GWindowServerConnection : public IPC::Client::Connection<WSAPI_ServerMessage, WSAPI_ClientMessage> {
  11. C_OBJECT(GWindowServerConnection)
  12. public:
  13. GWindowServerConnection()
  14. : Connection("/tmp/wsportal")
  15. {}
  16. void handshake() override;
  17. static GWindowServerConnection& the();
  18. private:
  19. void postprocess_bundles(Vector<IncomingMessageBundle>& m_unprocessed_bundles) override;
  20. void handle_paint_event(const WSAPI_ServerMessage&, GWindow&, const ByteBuffer& extra_data);
  21. void handle_resize_event(const WSAPI_ServerMessage&, GWindow&);
  22. void handle_mouse_event(const WSAPI_ServerMessage&, GWindow&);
  23. void handle_key_event(const WSAPI_ServerMessage&, GWindow&);
  24. void handle_window_activation_event(const WSAPI_ServerMessage&, GWindow&);
  25. void handle_window_close_request_event(const WSAPI_ServerMessage&, GWindow&);
  26. void handle_menu_event(const WSAPI_ServerMessage&);
  27. void handle_window_entered_or_left_event(const WSAPI_ServerMessage&, GWindow&);
  28. void handle_wm_event(const WSAPI_ServerMessage&, GWindow&);
  29. void handle_greeting(WSAPI_ServerMessage&);
  30. };
  31. class GEventLoop final : public CEventLoop {
  32. public:
  33. GEventLoop();
  34. virtual ~GEventLoop() override;
  35. static GEventLoop& current() { return static_cast<GEventLoop&>(CEventLoop::current()); }
  36. private:
  37. void process_unprocessed_bundles();
  38. };