From 9cd5b257459a6b4c5d5d4d1026df85f0ecbe5a93 Mon Sep 17 00:00:00 2001 From: davc0n Date: Sun, 4 May 2025 23:39:00 +0200 Subject: protocols: refactor class member vars (u-z) (#10282) * protocols: refactor class member vars (u-z) * protocols: fix clang format --- src/protocols/XDGShell.hpp | 113 +++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 56 deletions(-) (limited to 'src/protocols/XDGShell.hpp') diff --git a/src/protocols/XDGShell.hpp b/src/protocols/XDGShell.hpp index 12f76774..632467ec 100644 --- a/src/protocols/XDGShell.hpp +++ b/src/protocols/XDGShell.hpp @@ -40,7 +40,7 @@ class CXDGPositionerRules { CBox getPosition(CBox constraint, const Vector2D& parentPos); private: - SXDGPositionerState state; + SXDGPositionerState m_state; }; class CXDGPopupResource { @@ -54,19 +54,19 @@ class CXDGPopupResource { void applyPositioning(const CBox& availableBox, const Vector2D& t1coord /* relative to box */); - WP surface; - WP parent; - WP self; + WP m_surface; + WP m_parent; + WP m_self; - bool taken = false; + bool m_taken = false; - CBox geometry; + CBox m_geometry; struct { CSignal reposition; CSignal dismissed; CSignal destroy; // only the role - } events; + } m_events; // schedules a configure event void configure(const CBox& box); @@ -75,13 +75,13 @@ class CXDGPopupResource { void repositioned(); private: - SP resource; + SP m_resource; - uint32_t lastRepositionToken = 0; + uint32_t m_lastRepositionToken = 0; Vector2D accumulateParentOffset(); - CXDGPositionerRules positionerRules; + CXDGPositionerRules m_positionerRules; }; class CXDGToplevelResource { @@ -91,10 +91,10 @@ class CXDGToplevelResource { static SP fromResource(wl_resource*); - WP owner; - WP self; + WP m_owner; + WP m_self; - PHLWINDOWREF window; + PHLWINDOWREF m_window; bool good(); @@ -115,7 +115,7 @@ class CXDGToplevelResource { CSignal stateChanged; // maximized, fs, minimized, etc. CSignal metadataChanged; // title, appid CSignal destroy; // only the role - } events; + } m_events; struct { std::string title; @@ -126,29 +126,30 @@ class CXDGToplevelResource { std::optional requestsFullscreen; std::optional requestsFullscreenMonitor; std::optional requestsMinimize; - } state; + } m_state; struct { Vector2D size; std::vector states; - } pendingApply; + } m_pendingApply; struct { Vector2D minSize = {1, 1}; Vector2D maxSize = {1337420, 694200}; - } pending, current; + } m_pending, m_current; - WP parent; - WP dialog; + WP m_parent; + WP m_dialog; - std::optional m_toplevelTag, m_toplevelDescription; + std::optional m_toplevelTag; + std::optional m_toplevelDescription; bool anyChildModal(); - std::vector> children; + std::vector> m_children; private: - SP resource; + SP m_resource; void applyState(); }; @@ -160,7 +161,7 @@ class CXDGSurfaceRole : public ISurfaceRole { return SURFACE_ROLE_XDG_SHELL; } - WP xdgSurface; + WP m_xdgSurface; }; class CXDGSurfaceResource { @@ -172,17 +173,17 @@ class CXDGSurfaceResource { bool good(); - WP owner; - WP surface; + WP m_owner; + WP m_surface; - WP toplevel; - WP popup; + WP m_toplevel; + WP m_popup; - WP self; + WP m_self; struct { CBox geometry; - } pending, current; + } m_pending, m_current; struct { CSignal ack; @@ -191,30 +192,30 @@ class CXDGSurfaceResource { CSignal unmap; CSignal destroy; CSignal newPopup; // SP - } events; + } m_events; - bool initialCommit = true; - bool mapped = false; + bool m_initialCommit = true; + bool m_mapped = false; uint32_t scheduleConfigure(); // do not call directly void configure(); private: - SP resource; + SP m_resource; - uint32_t lastConfigureSerial = 0; - uint32_t scheduledSerial = 0; + uint32_t m_lastConfigureSerial = 0; + uint32_t m_scheduledSerial = 0; - wl_event_source* configureSource = nullptr; + wl_event_source* m_configureSource = nullptr; // - std::vector> popups; + std::vector> m_popups; struct { CHyprSignalListener surfaceDestroy; CHyprSignalListener surfaceCommit; - } listeners; + } m_listeners; friend class CXDGPopupResource; friend class CXDGToplevelResource; @@ -228,13 +229,13 @@ class CXDGPositionerResource { bool good(); - SXDGPositionerState state; + SXDGPositionerState m_state; - WP owner; - WP self; + WP m_owner; + WP m_self; private: - SP resource; + SP m_resource; }; class CXDGWMBase { @@ -245,18 +246,18 @@ class CXDGWMBase { wl_client* client(); void ping(); - std::vector> positioners; - std::vector> surfaces; + std::vector> m_positioners; + std::vector> m_surfaces; - WP self; + WP m_self; struct { CSignal pong; - } events; + } m_events; private: - SP resource; - wl_client* pClient = nullptr; + SP m_resource; + wl_client* m_client = nullptr; }; class CXDGShellProtocol : public IWaylandProtocol { @@ -273,16 +274,16 @@ class CXDGShellProtocol : public IWaylandProtocol { void destroyResource(CXDGPopupResource* resource); // - std::vector> m_vWMBases; - std::vector> m_vPositioners; - std::vector> m_vSurfaces; - std::vector> m_vToplevels; - std::vector> m_vPopups; + std::vector> m_wmBases; + std::vector> m_positioners; + std::vector> m_surfaces; + std::vector> m_toplevels; + std::vector> m_popups; // current popup grab - WP grabOwner; - SP grab; - std::vector> grabbed; + WP m_grabOwner; + SP m_grab; + std::vector> m_grabbed; void addOrStartGrab(SP popup); void onPopupDestroy(WP popup); -- cgit v1.2.3