From 6a8d1d5fb1a685d9eba93d100af673053ab68860 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 23 Mar 2026 01:11:36 +0100 Subject: [FEAT] Improved installation flow and X11 library. Signed-off-by: Amlal El Mahrouss --- frameworks/libThread.fwrk/headers/Config.h | 11 ++++++++++ frameworks/libThread.fwrk/src/ThreadMgr.cpp | 2 +- frameworks/libX11.fwrk/headers/Config.h | 18 +++++++++++++++ frameworks/libX11.fwrk/src/.gitkeep | 0 frameworks/libX11.fwrk/src/X11ConnMgr.cpp | 34 ++++++++++------------------- 5 files changed, 42 insertions(+), 23 deletions(-) create mode 100644 frameworks/libThread.fwrk/headers/Config.h delete mode 100644 frameworks/libX11.fwrk/src/.gitkeep (limited to 'frameworks') diff --git a/frameworks/libThread.fwrk/headers/Config.h b/frameworks/libThread.fwrk/headers/Config.h new file mode 100644 index 0000000..c6734a4 --- /dev/null +++ b/frameworks/libThread.fwrk/headers/Config.h @@ -0,0 +1,11 @@ +// 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 LIBTHREAD_FOUNDATION_H +#define LIBTHREAD_FOUNDATION_H + +#include + +#endif // LIBTHREAD_FOUNDATION_H diff --git a/frameworks/libThread.fwrk/src/ThreadMgr.cpp b/frameworks/libThread.fwrk/src/ThreadMgr.cpp index f01bbfe..7361f86 100644 --- a/frameworks/libThread.fwrk/src/ThreadMgr.cpp +++ b/frameworks/libThread.fwrk/src/ThreadMgr.cpp @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/ne-foss-org/ne_system -#include +#include #define kThreadMapMax (1024UL) #define kThreadBaseHash (0x5555ffff6ULL) diff --git a/frameworks/libX11.fwrk/headers/Config.h b/frameworks/libX11.fwrk/headers/Config.h index f311fdb..7466eaf 100644 --- a/frameworks/libX11.fwrk/headers/Config.h +++ b/frameworks/libX11.fwrk/headers/Config.h @@ -6,6 +6,24 @@ #ifndef X11_FOUNDATION_H #define X11_FOUNDATION_H +#include +#define _X11_ARRAY_CHECK(PTR) PTR != nullptr +#define _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/src/.gitkeep b/frameworks/libX11.fwrk/src/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp index 7477a19..61752f1 100644 --- a/frameworks/libX11.fwrk/src/X11ConnMgr.cpp +++ b/frameworks/libX11.fwrk/src/X11ConnMgr.cpp @@ -3,36 +3,26 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/ne-foss-org/ne_system -#include #include -#define X11_ARRAY_CHECK(PTR) PTR != nullptr -#define X11_ARRAY_INDEX(ARR, PTR, LEN) ARR[((SInt64) PTR) % LEN] - namespace X11 { -struct X11Connection final { - SInt32 fSocket; - SInt32 fType; - SInt32 fFlags; - SInt32 fPad; -}; +namespace Detail { -typedef X11Connection* X11ConnectionPtr; -typedef X11ConnectionPtr* X11ConnectionArray; + static X11ConnectionPtr X11MakeConnection() { + auto ptr = new X11Connection{}; + if (!ptr) return nullptr; -static X11ConnectionPtr X11MakeConnection() { - auto ptr = new X11Connection{}; - if (!ptr) return nullptr; + return ptr; + } - return ptr; -} + static Void X11DeleteConnection(X11ConnectionPtr ptr) { + if (!ptr) return; -static Void X11DeleteConnection(X11ConnectionPtr ptr) { - if (!ptr) return; + delete ptr; + ptr = nullptr; + } - delete ptr; - ptr = nullptr; -} +} // namespace Detail } // namespace X11 \ No newline at end of file -- cgit v1.2.3