From 9e096f17ed3e9ec4fe82fe91ba1f4ec227f9fdce Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 22 Mar 2026 19:30:25 +0100 Subject: [FEAT] Working towards a X11ConnMgr implementation barebones. Signed-off-by: Amlal El Mahrouss --- frameworks/libX11.fwrk/src/X11ConnMgr.cpp | 33 +++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'frameworks/libX11.fwrk/src') diff --git a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp index 4d3d61a..aca5e8f 100644 --- a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp +++ b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp @@ -5,17 +5,34 @@ #include #include -#include #define X11_ARRAY_CHECK(PTR) PTR != nullptr -#define X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64)PTR) % LEN] +#define X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN] -struct X11Connection final { - SInt32 fSocket; - SInt32 fType; - SInt32 fFlags; - SInt32 fPad; +namespace X11 { + + struct X11Connection final { + SInt32 fSocket; + SInt32 fType; + SInt32 fFlags; + SInt32 fPad; }; -typedef X11Connection* X11ConnectionPtr; +typedef X11Connection* X11ConnectionPtr; typedef X11ConnectionPtr* X11ConnectionArray; + +static X11ConnectionPtr X11MakeConnection() { + auto ptr = new X11Connection{}; + if (!ptr) return nullptr; + + return ptr; +} + +static Void X11DeleteConnection(X11ConnectionPtr ptr) { + if (!ptr) return; + + delete ptr; + ptr = nullptr; +} + +} // namespace X11 \ No newline at end of file -- cgit v1.2.3