GEventLoop.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. public:
  12. GWindowServerConnection()
  13. : Connection("/tmp/wsportal")
  14. {}
  15. void handshake() override;
  16. static GWindowServerConnection& the();
  17. private:
  18. void postprocess_bundles(Vector<IncomingMessageBundle>& m_unprocessed_bundles) override;
  19. void handle_paint_event(const WSAPI_ServerMessage&, GWindow&, const ByteBuffer& extra_data);
  20. void handle_resize_event(const WSAPI_ServerMessage&, GWindow&);
  21. void handle_mouse_event(const WSAPI_ServerMessage&, GWindow&);
  22. void handle_key_event(const WSAPI_ServerMessage&, GWindow&);
  23. void handle_window_activation_event(const WSAPI_ServerMessage&, GWindow&);
  24. void handle_window_close_request_event(const WSAPI_ServerMessage&, GWindow&);
  25. void handle_menu_event(const WSAPI_ServerMessage&);
  26. void handle_window_entered_or_left_event(const WSAPI_ServerMessage&, GWindow&);
  27. void handle_wm_event(const WSAPI_ServerMessage&, GWindow&);
  28. void handle_greeting(WSAPI_ServerMessage&);
  29. };
  30. class GEventLoop final : public CEventLoop {
  31. public:
  32. GEventLoop();
  33. virtual ~GEventLoop() override;
  34. static GEventLoop& current() { return static_cast<GEventLoop&>(CEventLoop::current()); }
  35. private:
  36. void process_unprocessed_bundles();
  37. };