From 8424c663dd9ff9479f80e3d3fdfc5534942c3c32 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 1 Apr 2026 07:49:40 +0200 Subject: [CHORE] Reworking X11 server architecture. Signed-off-by: Amlal El Mahrouss --- frameworks/libSocket.fwrk/dist/.keep | 0 frameworks/libSocket.fwrk/headers/Config.h | 18 -------------- frameworks/libSocket.fwrk/libSocket.fwrk.json | 20 --------------- frameworks/libSocket.fwrk/src/.keep | 0 frameworks/libSocket.fwrk/xml/app.xml | 4 --- frameworks/libX11.fwrk/headers/Config.h | 31 ------------------------ frameworks/libX11.fwrk/headers/Foundation.hpp | 35 +++++++++++++++++++++++++++ frameworks/libX11.fwrk/src/Foundation+X11.cpp | 28 +++++++++++++++++++++ frameworks/libX11.fwrk/src/X11ConnMgr.cpp | 28 --------------------- 9 files changed, 63 insertions(+), 101 deletions(-) delete mode 100644 frameworks/libSocket.fwrk/dist/.keep delete mode 100644 frameworks/libSocket.fwrk/headers/Config.h delete mode 100644 frameworks/libSocket.fwrk/libSocket.fwrk.json delete mode 100644 frameworks/libSocket.fwrk/src/.keep delete mode 100644 frameworks/libSocket.fwrk/xml/app.xml delete mode 100644 frameworks/libX11.fwrk/headers/Config.h create mode 100644 frameworks/libX11.fwrk/headers/Foundation.hpp create mode 100644 frameworks/libX11.fwrk/src/Foundation+X11.cpp delete mode 100644 frameworks/libX11.fwrk/src/X11ConnMgr.cpp diff --git a/frameworks/libSocket.fwrk/dist/.keep b/frameworks/libSocket.fwrk/dist/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/frameworks/libSocket.fwrk/headers/Config.h b/frameworks/libSocket.fwrk/headers/Config.h deleted file mode 100644 index 7cde306..0000000 --- a/frameworks/libSocket.fwrk/headers/Config.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) -// Licensed under the Apache License, Version 2.0 (see LICENSE file) -// Official repository: https://github.com/ne-foss-org/ne-system - -#ifndef SOCKET_FOUNDATION_H -#define SOCKET_FOUNDATION_H - -#include - -#define LIBSOCKET_VERSION 0x100000 - -#define LIBSOCKET_SOCKET_ARRAY_CHECK(PTR) PTR != nullptr -#define LIBSOCKET_SOCKET_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN] - -#define LIBSOCKET_SOCKET_INVALID ((SizeT)-1) - -#endif diff --git a/frameworks/libSocket.fwrk/libSocket.fwrk.json b/frameworks/libSocket.fwrk/libSocket.fwrk.json deleted file mode 100644 index a1b13bb..0000000 --- a/frameworks/libSocket.fwrk/libSocket.fwrk.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../", "./", "../../src/kernel", "../../src/kernel/src"], - "sources_path": ["src/*.cpp"], - "output_name": "./dist/libSocket.fwrk.dylib", - "compiler_flags": [ - "-ffreestanding", - "-shared", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17" - ], - "cpp_macros": [ - "kSocketVersion=0x0100", - "kSocketVersionHighest=0x0100", - "kSocketVersionLowest=0x0100" - ] - } - diff --git a/frameworks/libSocket.fwrk/src/.keep b/frameworks/libSocket.fwrk/src/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/frameworks/libSocket.fwrk/xml/app.xml b/frameworks/libSocket.fwrk/xml/app.xml deleted file mode 100644 index bd1dbee..0000000 --- a/frameworks/libSocket.fwrk/xml/app.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/frameworks/libX11.fwrk/headers/Config.h b/frameworks/libX11.fwrk/headers/Config.h deleted file mode 100644 index 44abc06..0000000 --- a/frameworks/libX11.fwrk/headers/Config.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) -// Licensed under the Apache License, Version 2.0 (see LICENSE file) -// Official repository: https://github.com/ne-foss-org/ne-system - -#ifndef X11_FOUNDATION_H -#define X11_FOUNDATION_H - -#include - -#define LIBX11_VERSION 0x100000 - -#define LIBX11_X11_ARRAY_CHECK(PTR) PTR != nullptr -#define LIBX11_X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN] - -namespace X11 { - -/// @brief Plain Old Data type for a X11 connection. -struct X11Connection final { - SInt32 fSocket; - SInt32 fType; - SInt32 fFlags; - SInt32 fPad; -}; - -typedef X11Connection* X11ConnectionPtr; -typedef X11ConnectionPtr* X11ConnectionArray; - -} // namespace X11 - -#endif diff --git a/frameworks/libX11.fwrk/headers/Foundation.hpp b/frameworks/libX11.fwrk/headers/Foundation.hpp new file mode 100644 index 0000000..18d119d --- /dev/null +++ b/frameworks/libX11.fwrk/headers/Foundation.hpp @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/ne-foss-org/ne-system + +#ifndef LIBX11_FOUNDATION_HPP +#define LIBX11_FOUNDATION_HPP + +#include + +#define LIBX11_VERSION 0x100000 + +#define LIBX11_X11_ARRAY_CHECK(PTR) PTR != nullptr +#define LIBX11_X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN] + +namespace X11 { + +namespace Detail { + + /// @brief Plain Old Data type for a X11 connection. + struct X11Connection final { + SInt32 fSocket; + SInt32 fType; + SInt32 fFlags; + SInt32 fPad; + }; + + typedef X11Connection* X11ConnectionPtr; + typedef X11ConnectionPtr* X11ConnectionArray; + +} // namespace Detail + +} // namespace X11 + +#endif diff --git a/frameworks/libX11.fwrk/src/Foundation+X11.cpp b/frameworks/libX11.fwrk/src/Foundation+X11.cpp new file mode 100644 index 0000000..37e2920 --- /dev/null +++ b/frameworks/libX11.fwrk/src/Foundation+X11.cpp @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/ne-foss-org/ne-system + +#include + +namespace X11 { + +namespace Detail { + + X11ConnectionPtr x11_make_connection_ptr() { + auto ptr = new X11Connection{}; + if (!ptr) return nullptr; + + return ptr; + } + + Void x11_delete_connection_ptr(X11ConnectionPtr ptr) { + if (!ptr) return; + + delete ptr; + ptr = nullptr; + } + +} // namespace Detail + +} // namespace X11 \ No newline at end of file diff --git a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp deleted file mode 100644 index ca55c8b..0000000 --- a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) -// Licensed under the Apache License, Version 2.0 (see LICENSE file) -// Official repository: https://github.com/ne-foss-org/ne-system - -#include - -namespace X11 { - -namespace Detail { - - 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 Detail - -} // namespace X11 \ No newline at end of file -- cgit v1.2.3