15 Commits

Author SHA1 Message Date
97b5300e48 Merge pull request 'dynamic' (#10) from dynamic into main
Reviewed-on: EventHorizonStudio/EHS#10
2024-07-24 01:39:29 -07:00
8e7cc39000 Added shared library support. 2024-07-24 01:36:20 -07:00
1b70383448 Started dynamic library support. 2024-07-21 10:45:06 -07:00
64e1555d56 Fixed DNS, TCP and UDP on Windows.
All checks were successful
Build & Release / Linux-AMD64-Build (push) Successful in 1m5s
Build & Release / Windows-AMD64-Build (push) Successful in 3m43s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m31s
2024-07-10 02:36:21 -07:00
a65c8d64b5 Fixed constructor to use move constructors.
Some checks failed
Build & Release / Linux-AMD64-Build (push) Successful in 1m44s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m46s
Build & Release / Windows-AMD64-Build (push) Failing after 7h1m29s
2024-07-09 19:23:24 -07:00
fa2b801690 Fixed Spotify.Play and fixed TCP.Connect. 2024-07-09 17:39:01 -07:00
4e887b1ac2 Added new DNS::Resolve static method and organized it per OS. 2024-07-09 16:41:43 -07:00
126fc92fae Fixed Wayland window resizing and closing. 2024-07-08 21:17:09 -07:00
2ef28273b0 Fixed Wayland window decoration. 2024-07-05 13:15:34 -07:00
04bf7d43ff Added second wl_display_roundtrip before wl_surface_commit. 2024-07-04 12:12:19 -07:00
fb86dca332 Added features to readme. 2024-07-03 19:49:18 -07:00
7e380efd7d Added features to readme. 2024-07-01 22:15:49 -07:00
b5e05864b6 Removed const arguments from GC header. 2024-07-01 20:23:17 -07:00
e2e5a1b8db Fixed FileMonitor, Window, Thread, and Audio on Windows.
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m25s
Build & Release / Linux-AMD64-Build (push) Successful in 1m38s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m36s
2024-07-01 19:16:45 -07:00
2a2296685e Fixed Directory for Windows.
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m41s
Build & Release / Linux-AMD64-Build (push) Successful in 1m56s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m48s
2024-06-29 23:38:27 -07:00
145 changed files with 1730 additions and 512 deletions

View File

@@ -122,7 +122,7 @@ set(EHS_SOURCES
src/io/socket/Request.cpp include/ehs/io/socket/Request.h src/io/socket/Request.cpp include/ehs/io/socket/Request.h
src/io/socket/Response.cpp include/ehs/io/socket/Response.h src/io/socket/Response.cpp include/ehs/io/socket/Response.h
src/io/socket/DNS.cpp include/ehs/io/socket/DNS.h src/io/socket/BaseDNS.cpp include/ehs/io/socket/BaseDNS.h
src/io/socket/BaseUDP.cpp include/ehs/io/socket/BaseUDP.h src/io/socket/BaseUDP.cpp include/ehs/io/socket/BaseUDP.h
src/io/socket/BaseTCP.cpp include/ehs/io/socket/BaseTCP.h src/io/socket/BaseTCP.cpp include/ehs/io/socket/BaseTCP.h
src/io/socket/SSL.cpp include/ehs/io/socket/SSL.h src/io/socket/SSL.cpp include/ehs/io/socket/SSL.h
@@ -133,6 +133,7 @@ set(EHS_SOURCES
include/ehs/io/socket/Socket.h include/ehs/io/socket/Socket.h
include/ehs/io/socket/TCP.h include/ehs/io/socket/TCP.h
include/ehs/io/socket/UDP.h include/ehs/io/socket/UDP.h
include/ehs/io/socket/DNS.h
src/io/audio/Audio.cpp include/ehs/io/audio/Audio.h src/io/audio/Audio.cpp include/ehs/io/audio/Audio.h
src/io/audio/BaseAudioDevice.cpp include/ehs/io/audio/BaseAudioDevice.h src/io/audio/BaseAudioDevice.cpp include/ehs/io/audio/BaseAudioDevice.h
@@ -164,8 +165,6 @@ set(EHS_SOURCES
include/ehs/io/mdl/MdlCodec.h include/ehs/io/mdl/MdlCodec.h
include/ehs/io/UsbBase.h include/ehs/io/UsbBase.h
src/io/UsbBase.cpp src/io/UsbBase.cpp
include/ehs/io/Usb_LNX.h
src/io/Usb_LNX.cpp
include/ehs/db/DbTable.h include/ehs/db/DbTable.h
include/ehs/db/DbObject.h include/ehs/db/DbObject.h
include/ehs/db/DbVar.h include/ehs/db/DbVar.h
@@ -177,8 +176,6 @@ set(EHS_SOURCES
src/db/DbTable.cpp src/db/DbTable.cpp
include/ehs/io/BaseDirectory.h include/ehs/io/BaseDirectory.h
src/io/BaseDirectory.cpp src/io/BaseDirectory.cpp
include/ehs/io/Directory_LNX.h
src/io/Directory_LNX.cpp
include/ehs/io/Directory.h include/ehs/io/Directory.h
) )
@@ -186,6 +183,7 @@ if (IS_OS_WINDOWS)
list(APPEND EHS_SOURCES list(APPEND EHS_SOURCES
src/io/socket/UDP_W32.cpp include/ehs/io/socket/UDP_W32.h src/io/socket/UDP_W32.cpp include/ehs/io/socket/UDP_W32.h
src/io/socket/TCP_W32.cpp include/ehs/io/socket/TCP_W32.h src/io/socket/TCP_W32.cpp include/ehs/io/socket/TCP_W32.h
src/io/socket/DNS_W32.cpp include/ehs/io/socket/DNS_W32.h
src/system/Semaphore_W32.cpp include/ehs/system/Semaphore_W32.h src/system/Semaphore_W32.cpp include/ehs/system/Semaphore_W32.h
src/system/System_W32.cpp include/ehs/system/System_W32.h src/system/System_W32.cpp include/ehs/system/System_W32.h
src/system/Mutex_W32.cpp include/ehs/system/Mutex_W32.h src/system/Mutex_W32.cpp include/ehs/system/Mutex_W32.h
@@ -196,11 +194,13 @@ if (IS_OS_WINDOWS)
src/io/Window_W32.cpp include/ehs/io/Window_W32.h src/io/Window_W32.cpp include/ehs/io/Window_W32.h
src/io/COM.cpp include/ehs/io/COM.h src/io/COM.cpp include/ehs/io/COM.h
src/system/CPU_MSVC_AMD64.asm src/HRNG_MSVC.asm src/Math_MSVC_AMD64.asm src/system/CPU_MSVC_AMD64.asm src/HRNG_MSVC.asm src/Math_MSVC_AMD64.asm
src/io/Directory_W32.cpp include/ehs/io/Directory_W32.h
) )
elseif (IS_OS_LINUX) elseif (IS_OS_LINUX)
list(APPEND EHS_SOURCES list(APPEND EHS_SOURCES
src/io/socket/UDP_BSD.cpp include/ehs/io/socket/UDP_BSD.h src/io/socket/UDP_BSD.cpp include/ehs/io/socket/UDP_BSD.h
src/io/socket/TCP_BSD.cpp include/ehs/io/socket/TCP_BSD.h src/io/socket/TCP_BSD.cpp include/ehs/io/socket/TCP_BSD.h
src/io/socket/DNS_LNX.cpp include/ehs/io/socket/DNS_LNX.h
src/system/Semaphore_P.cpp include/ehs/system/Semaphore_P.h src/system/Semaphore_P.cpp include/ehs/system/Semaphore_P.h
src/system/System_LNX.cpp include/ehs/system/System_LNX.h src/system/System_LNX.cpp include/ehs/system/System_LNX.h
src/system/Open_UNX.cpp include/ehs/system/Open_UNX.h src/system/Open_UNX.cpp include/ehs/system/Open_UNX.h
@@ -210,13 +210,18 @@ elseif (IS_OS_LINUX)
src/io/audio/AudioDevice_ALSA.cpp include/ehs/io/audio/AudioDevice_ALSA.h src/io/audio/AudioDevice_ALSA.cpp include/ehs/io/audio/AudioDevice_ALSA.h
src/system/FileSystem.cpp include/ehs/system/FileSystem.h src/system/FileSystem.cpp include/ehs/system/FileSystem.h
src/system/User.cpp include/ehs/system/User.h src/system/User.cpp include/ehs/system/User.h
src/io/Directory_LNX.cpp include/ehs/io/Directory_LNX.h
src/io/Usb_LNX.cpp include/ehs/io/Usb_LNX.h
) )
set(LINUX_WINDOW_SYSTEM "Wayland" CACHE STRING "Linux Window System") set(LINUX_WINDOW_SYSTEM "Wayland" CACHE STRING "Linux Window System")
if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland") if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland")
add_compile_definitions(EHS_WS_WAYLAND) add_compile_definitions(EHS_WS_WAYLAND)
list(APPEND EHS_SOURCES src/io/xdg-shell-protocol.c include/ehs/io/xdg-shell-client-protocol.h src/io/Window_Way.cpp include/ehs/io/Window_Way.h) list(APPEND EHS_SOURCES
src/io/xdg-shell-protocol.c include/ehs/io/xdg-shell-client-protocol.h
src/io/xdg-decoration.c include/ehs/io/xdg-decoration.h
src/io/Window_Way.cpp include/ehs/io/Window_Way.h)
message("Building for Wayland.") message("Building for Wayland.")
elseif (LINUX_WINDOW_SYSTEM STREQUAL "XCB") elseif (LINUX_WINDOW_SYSTEM STREQUAL "XCB")
add_compile_definitions(EHS_WS_XCB) add_compile_definitions(EHS_WS_XCB)
@@ -234,11 +239,14 @@ endif()
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
#message("${CMAKE_CXX_FLAGS}") #message("${CMAKE_CXX_FLAGS}")
add_library(EHS ${EHS_SOURCES}) add_library(EHS_STC STATIC ${EHS_SOURCES})
add_library(EHS_DYN SHARED ${EHS_SOURCES})
add_executable(StrToHash src/StrToHash.cpp) add_executable(StrToHash src/StrToHash.cpp)
target_include_directories(EHS PUBLIC ${PROJECT_SOURCE_DIR}/include) target_compile_definitions(EHS_DYN PRIVATE EHS_LIB_EXPORT)
target_include_directories(EHS_STC PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_include_directories(EHS_DYN PUBLIC ${PROJECT_SOURCE_DIR}/include)
if (IS_OS_LINUX) if (IS_OS_LINUX)
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local") set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local")
@@ -246,12 +254,13 @@ elseif (IS_OS_WINDOWS)
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS") set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS")
endif () endif ()
install(TARGETS EHS DESTINATION lib) install(TARGETS EHS_STC DESTINATION lib)
install(TARGETS EHS_DYN RUNTIME DESTINATION bin)
install(TARGETS EHS_DYN LIBRARY DESTINATION lib)
install(TARGETS StrToHash DESTINATION bin)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include)
install(TARGETS StrToHash DESTINATION bin)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
if (ZLIB_FOUND) if (ZLIB_FOUND)
message(STATUS "ZLIB was found.") message(STATUS "ZLIB was found.")
@@ -266,10 +275,11 @@ else ()
message(STATUS "OpenSSL was not found.") message(STATUS "OpenSSL was not found.")
endif () endif ()
target_link_libraries(EHS OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) target_link_libraries(EHS_STC OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB)
target_link_libraries(EHS_DYN OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB avrt ws2_32)
if (IS_OS_WINDOWS) if (IS_OS_WINDOWS)
target_link_libraries(StrToHash ws2_32 avrt EHS) target_link_libraries(StrToHash ws2_32 avrt EHS_STC)
elseif (IS_OS_LINUX) elseif (IS_OS_LINUX)
if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland") if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland")
target_link_libraries(StrToHash wayland-client) target_link_libraries(StrToHash wayland-client)
@@ -277,5 +287,5 @@ elseif (IS_OS_LINUX)
target_link_libraries(StrToHash xcb xcb-cursor xcb-xfixes xcb-xinput) target_link_libraries(StrToHash xcb xcb-cursor xcb-xfixes xcb-xinput)
endif () endif ()
target_link_libraries(StrToHash z asound EHS) target_link_libraries(StrToHash z asound EHS_STC)
endif () endif ()

View File

@@ -8,6 +8,7 @@ This project does not fully follow the C++ standard.
### Features ### Features
- Audio IO/Processing/Manipulation - Audio IO/Processing/Manipulation
- Image Processing/Manipulation - Image Processing/Manipulation
- Databases
- 3D Model & Mesh Processing/Manipulation - 3D Model & Mesh Processing/Manipulation
- File IO - File IO
- Basic File Monitoring - Basic File Monitoring
@@ -20,7 +21,7 @@ This project does not fully follow the C++ standard.
- Mutexes - Mutexes
- Semaphores - Semaphores
- CPU information and features at runtime - CPU information and features at runtime
- HTTP(S) Sockets - HTTP(S) Socket Layer
- TCP Socket - TCP Socket
- UDP Socket - UDP Socket
- COM (Serial) IO - COM (Serial) IO
@@ -29,12 +30,13 @@ This project does not fully follow the C++ standard.
- Twitch Integration - Twitch Integration
- Json Parsing/Writing - Json Parsing/Writing
- User Friendly HID Input - User Friendly HID Input
- Basic Garbage Collector - Heap Garbage Collector
- Linked List - Linked List
- Array - Array
- Vector - Vector
- Asynchronous Task System - Asynchronous Task System
- URI Parsing - URI Parsing
- USB (WIP)
### Supported Architectures ### Supported Architectures
- AMD64 - AMD64

View File

@@ -5,20 +5,20 @@
namespace ehs namespace ehs
{ {
class Base64 class EHS_LIB_IO Base64
{ {
private: private:
static const char ascii[]; static const char ascii[];
public: public:
static Str_8 Encode(const Str_8 input); static Str_8 Encode(const Str_8 &input);
static Str_8 Decode(const Str_8 input); static Str_8 Decode(const Str_8 &input);
private: private:
static char Find(const char c); static char Find(char c);
static bool IsBase64(const char c); static bool IsBase64(char c);
}; };
} }

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class BaseObj class EHS_LIB_IO BaseObj
{ {
private: private:
Type* hierarchy; Type* hierarchy;

View File

@@ -4,7 +4,7 @@
namespace ehs namespace ehs
{ {
class Color3 class EHS_LIB_IO Color3
{ {
public: public:
float r; float r;
@@ -13,13 +13,13 @@ namespace ehs
Color3(); Color3();
Color3(const float scalar); Color3(float scalar);
Color3(const float r, const float g, const float b); Color3(float r, float g, float b);
Color3(const Color3& color); Color3(const Color3& color);
Color3& operator=(const float scalar); Color3& operator=(float scalar);
Color3& operator=(const Color3& color); Color3& operator=(const Color3& color);
@@ -27,9 +27,9 @@ namespace ehs
bool operator!=(const Color3& color) const; bool operator!=(const Color3& color) const;
float operator[](const UInt_64 i) const; float operator[](UInt_64 i) const;
float& operator[](const UInt_64 i); float& operator[](UInt_64 i);
Color3& operator*=(const Color3& color); Color3& operator*=(const Color3& color);

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class Color4 class EHS_LIB_IO Color4
{ {
public: public:
float r; float r;
@@ -15,15 +15,15 @@ namespace ehs
Color4(); Color4();
Color4(const float scalar); Color4(float scalar);
explicit Color4(const Color3& color); explicit Color4(const Color3& color);
Color4(const float r, const float g, const float b, const float a = 1.0f); Color4(float r, float g, float b, float a = 1.0f);
Color4(const Color4& color); Color4(const Color4& color);
Color4& operator=(const float scalar); Color4& operator=(float scalar);
Color4& operator=(const Color3& color); Color4& operator=(const Color3& color);
@@ -33,9 +33,9 @@ namespace ehs
bool operator!=(const Color4& color) const; bool operator!=(const Color4& color) const;
float operator[](const UInt_64 i) const; float operator[](UInt_64 i) const;
float& operator[](const UInt_64 i); float& operator[](UInt_64 i);
Color4& operator*=(const Color4& color); Color4& operator*=(const Color4& color);

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class Data class EHS_LIB_IO Data
{ {
public: public:
template<typename T> template<typename T>

View File

@@ -21,9 +21,9 @@ namespace ehs
UINT_8 UINT_8
}; };
DataType FromAudioBitDepth(UInt_16 bitDepth); EHS_LIB_IO DataType FromAudioBitDepth(UInt_16 bitDepth);
UInt_8 ToByteDepth(DataType type); EHS_LIB_IO UInt_8 ToByteDepth(DataType type);
UInt_8 ToBitDepth(DataType type); EHS_LIB_IO UInt_8 ToBitDepth(DataType type);
} }

View File

@@ -13,51 +13,53 @@
namespace ehs namespace ehs
{ {
enum class MemoryPattern enum class MemoryPattern
{ {
SPEED, SPEED,
SIZE SIZE
}; };
EHS_LIB_IO void Initialize(Str_8 appName, Str_8 appVerId, const Version &appVer);
EHS_LIB_IO void Uninitialize();
/// Retrieves the UTF32 C-style string as "Event Horizon Standard" /// Retrieves the UTF32 C-style string as "Event Horizon Standard"
/// @returns The result. /// @returns The result.
const Char_32* GetName_32(); EHS_LIB_IO const Char_32* GetName_32();
/// Retrieves the UTF16 C-style string as "Event Horizon Standard" /// Retrieves the UTF16 C-style string as "Event Horizon Standard"
/// @returns The result. /// @returns The result.
const Char_16* GetName_16(); EHS_LIB_IO const Char_16* GetName_16();
/// Retrieves the UTF8 C-style string as "Event Horizon Standard" /// Retrieves the UTF8 C-style string as "Event Horizon Standard"
/// @returns The result. /// @returns The result.
const Char_8* GetName_8(); EHS_LIB_IO const Char_8* GetName_8();
Str_8 GetAppName_8(); EHS_LIB_IO Str_8 GetAppName_8();
const Char_32* GetAcronym_32(); EHS_LIB_IO const Char_32* GetAcronym_32();
const Char_16* GetAcronym_16(); EHS_LIB_IO const Char_16* GetAcronym_16();
const Char_8* GetAcronym_8(); EHS_LIB_IO const Char_8* GetAcronym_8();
/// Retrieves the version identifier in UTF32. /// Retrieves the version identifier in UTF32.
/// @returns The result. /// @returns The result.
const Char_32* GetVersionId_32(); EHS_LIB_IO const Char_32* GetVersionId_32();
/// Retrieves the version identifier in UTF16. /// Retrieves the version identifier in UTF16.
/// @returns The result. /// @returns The result.
const Char_16* GetVersionId_16(); EHS_LIB_IO const Char_16* GetVersionId_16();
/// Retrieves the version identifier in UTF8. /// Retrieves the version identifier in UTF8.
/// @returns The result. /// @returns The result.
const Char_8* GetVersionId_8(); EHS_LIB_IO const Char_8* GetVersionId_8();
Str_8 GetAppVersionId_8(); EHS_LIB_IO Str_8 GetAppVersionId_8();
/// Retrieves the current Event Horizon Standard version. /// Retrieves the current Event Horizon Standard version.
/// @returns The result. /// @returns The result.
Version GetVersion(); EHS_LIB_IO Version GetVersion();
Version GetAppVersion(); EHS_LIB_IO Version GetAppVersion();
}; };
extern ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVer);

View File

@@ -9,7 +9,7 @@ namespace ehs
{ {
typedef bool (*GcLogic)(BaseObj*); typedef bool (*GcLogic)(BaseObj*);
class GC class EHS_LIB_IO GC
{ {
private: private:
static Array<GcLogic> logic; static Array<GcLogic> logic;
@@ -36,7 +36,7 @@ namespace ehs
/// Sets the maximum amount of garbage to delete per poll. /// Sets the maximum amount of garbage to delete per poll.
/// @param[in] newMax The new maximum. /// @param[in] newMax The new maximum.
static void SetMax(const UInt_64 newMax); static void SetMax(UInt_64 newMax);
/// Gets the maximum amount of garbage to delete per poll. /// Gets the maximum amount of garbage to delete per poll.
/// @returns The maximum. /// @returns The maximum.
@@ -44,7 +44,7 @@ namespace ehs
/// Sets a new amount for memory pre-allocation to save on memory operations. /// Sets a new amount for memory pre-allocation to save on memory operations.
/// @param[in] newStride The stride to pre-allocate. /// @param[in] newStride The stride to pre-allocate.
static void SetStride(const UInt_64 newStride); static void SetStride(UInt_64 newStride);
/// The amount of data pre-allocated to save on memory operations. /// The amount of data pre-allocated to save on memory operations.
/// @returns The stride. /// @returns The stride.

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class HRNG class EHS_LIB_IO HRNG
{ {
public: public:
static UInt_64 GenerateSeed_u64(); static UInt_64 GenerateSeed_u64();

View File

@@ -25,7 +25,7 @@ namespace ehs
/// A helper class for holding error information and handling them. /// A helper class for holding error information and handling them.
/// @tparam T The character data type to use. /// @tparam T The character data type to use.
/// @tparam N The number data type to use. /// @tparam N The number data type to use.
class Log class EHS_LIB_IO Log
{ {
private: private:
static void DefaultRaisedCb(const Log &log); static void DefaultRaisedCb(const Log &log);

View File

@@ -120,7 +120,7 @@ namespace ehs
Mat2<T> GetMinor() const Mat2<T> GetMinor() const
{ {
Mat2<T> result(0); Mat2<T> result;
result.data[0] = data[3]; result.data[0] = data[3];
result.data[1] = data[2]; result.data[1] = data[2];
result.data[2] = data[1]; result.data[2] = data[1];
@@ -187,7 +187,7 @@ namespace ehs
Mat2<T> GetInverse() const Mat2<T> GetInverse() const
{ {
T det = GetDeterminant(); T det = GetDeterminant();
if (Math::ComCmp(det, 0.0f)) if (Math::ComCmp(det, 0))
return {}; return {};
return GetAdjugate() * (1 / det); return GetAdjugate() * (1 / det);
@@ -196,7 +196,7 @@ namespace ehs
void Inverse() void Inverse()
{ {
T det = GetDeterminant(); T det = GetDeterminant();
if (Math::ComCmp(det, 0.0f)) if (Math::ComCmp(det, 0))
return; return;
Adjugate(); Adjugate();
@@ -212,6 +212,9 @@ namespace ehs
} }
}; };
template class EHS_LIB_IO Mat2<float>;
template class EHS_LIB_IO Mat2<double>;
typedef Mat2<float> Mat2_f; typedef Mat2<float> Mat2_f;
typedef Mat2<double> Mat2_d; typedef Mat2<double> Mat2_d;
} }

View File

@@ -50,7 +50,7 @@ namespace ehs
Mat2<T> result; Mat2<T> result;
for (UInt_8 i = 0; i < 4; ++i) for (UInt_8 i = 0; i < 4; ++i)
result.data[i] = data[i / 2 * 4 + i % 2]; result[i] = data[i / 2 * 4 + i % 2];
return result; return result;
} }
@@ -234,7 +234,7 @@ namespace ehs
Mat3<T> GetInverse() const Mat3<T> GetInverse() const
{ {
T det = GetDeterminant(); T det = GetDeterminant();
if (Math::ComCmp(det, 0.0f)) if (Math::ComCmp(det, 0))
return {}; return {};
return GetAdjugate() * (1 / det); return GetAdjugate() * (1 / det);
@@ -243,7 +243,7 @@ namespace ehs
void Inverse() void Inverse()
{ {
T det = GetDeterminant(); T det = GetDeterminant();
if (Math::ComCmp(det, 0.0f)) if (Math::ComCmp(det, 0))
return; return;
Adjugate(); Adjugate();
@@ -317,6 +317,9 @@ namespace ehs
} }
}; };
template class EHS_LIB_IO Mat3<float>;
template class EHS_LIB_IO Mat3<double>;
typedef Mat3<float> Mat3_f; typedef Mat3<float> Mat3_f;
typedef Mat3<double> Mat3_d; typedef Mat3<double> Mat3_d;
} }

View File

@@ -268,7 +268,7 @@ namespace ehs
Mat4<T> GetInverse() const Mat4<T> GetInverse() const
{ {
T det = GetDeterminant(); T det = GetDeterminant();
if (Math::ComCmp(det, 0.0f)) if (Math::ComCmp(det, 0))
return {}; return {};
return GetAdjugate() * (1 / det); return GetAdjugate() * (1 / det);
@@ -277,7 +277,7 @@ namespace ehs
void Inverse() void Inverse()
{ {
T det = GetDeterminant(); T det = GetDeterminant();
if (Math::ComCmp(det, 0.0f)) if (Math::ComCmp(det, 0))
return; return;
Adjugate(); Adjugate();
@@ -421,6 +421,9 @@ namespace ehs
} }
}; };
template class EHS_LIB_IO Mat4<float>;
template class EHS_LIB_IO Mat4<double>;
typedef Mat4<float> Mat4_f; typedef Mat4<float> Mat4_f;
typedef Mat4<double> Mat4_d; typedef Mat4<double> Mat4_d;
} }

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class Math class EHS_LIB_IO Math
{ {
private: private:
static float Sqrt_AVX(const float from); static float Sqrt_AVX(const float from);
@@ -26,22 +26,22 @@ namespace ehs
constexpr static double dblEpsilon = 1e-16; constexpr static double dblEpsilon = 1e-16;
/// Absolute tolerance comparison for single precision floats. /// Absolute tolerance comparison for single precision floats.
static bool AbsCmp(const float a, const float b); static bool AbsCmp(float a, float b);
/// Absolute tolerance comparison for double precision floats. /// Absolute tolerance comparison for double precision floats.
static bool AbsCmp(const double a, const double b); static bool AbsCmp(double a, double b);
/// Relative tolerance comparison for single precision floats. /// Relative tolerance comparison for single precision floats.
static bool RelCmp(const float a, const float b); static bool RelCmp(float a, float b);
/// Relative tolerance comparison for double precision floats. /// Relative tolerance comparison for double precision floats.
static bool RelCmp(const double a, const double b); static bool RelCmp(double a, double b);
/// Combined absolute and relative tolerance comparison for single precision floats. /// Combined absolute and relative tolerance comparison for single precision floats.
static bool ComCmp(const float a, const float b); static bool ComCmp(float a, float b);
/// Combined absolute and relative tolerance comparison for double precision floats. /// Combined absolute and relative tolerance comparison for double precision floats.
static bool ComCmp(const double a, const double b); static bool ComCmp(double a, double b);
template<typename T = float> template<typename T = float>
static T Max(const T a, const T b) static T Max(const T a, const T b)

View File

@@ -10,9 +10,9 @@ namespace ehs
void* data; void* data;
}; };
bool HasPtrData(void* data); EHS_LIB_IO bool HasPtrData(void* data);
void AddPtrData(void* data); EHS_LIB_IO void AddPtrData(void* data);
bool RemovePtrData(void* data); EHS_LIB_IO bool RemovePtrData(void* data);
} }

View File

@@ -564,7 +564,7 @@ namespace ehs
return; return;
} }
Util::Copy(data[dstOffset], src, src.Size(true)); Util::Copy(&data[dstOffset], src, src.Size(true));
} }
/// Copies a C-style string to the referenced string object. /// Copies a C-style string to the referenced string object.
@@ -580,7 +580,7 @@ namespace ehs
return; return;
} }
Util::Copy(data[dstOffset], src, srcSize * sizeof(T)); Util::Copy(&data[dstOffset], src, srcSize * sizeof(T));
} }
/// Copies a C-style string to the referenced string object. /// Copies a C-style string to the referenced string object.
@@ -595,7 +595,7 @@ namespace ehs
return; return;
} }
Util::Copy(data[dstOffset], src, srcSize * sizeof(T)); Util::Copy(&data[dstOffset], src, srcSize * sizeof(T));
} }
/// Inserts a string at a specified index. /// Inserts a string at a specified index.
@@ -747,7 +747,7 @@ namespace ehs
T* result = new T[size + inSize + 1]; T* result = new T[size + inSize + 1];
Util::Copy(result, data, Size(true)); Util::Copy(result, data, Size(true));
Util::Copy(result[size], value, inSize * sizeof(T)); Util::Copy(&result[size], value, inSize * sizeof(T));
result[size + inSize] = 0; result[size + inSize] = 0;
@@ -1027,7 +1027,7 @@ namespace ehs
/// @param [in] pattern The search pattern for optimization. /// @param [in] pattern The search pattern for optimization.
/// @param [in] result What index to return where the first instance is found. /// @param [in] result What index to return where the first instance is found.
/// @returns The index where the instance was found with the result varying from the result parameter. /// @returns The index where the instance was found with the result varying from the result parameter.
bool Find(const Str<T, N>& ide, N* const index = nullptr, const SearchPattern pattern = SearchPattern::LEFT_RIGHT, const IndexResult result = IndexResult::BEGINNING) const bool Find(const Str<T, N> &ide, N* const index = nullptr, const SearchPattern pattern = SearchPattern::LEFT_RIGHT, const IndexResult result = IndexResult::BEGINNING) const
{ {
if (pattern == SearchPattern::LEFT_RIGHT) if (pattern == SearchPattern::LEFT_RIGHT)
{ {
@@ -1271,8 +1271,11 @@ namespace ehs
/// @note Use "IsNum" before this if the string object is not guaranteed to be a number. /// @note Use "IsNum" before this if the string object is not guaranteed to be a number.
float ToFloat() const float ToFloat() const
{ {
Str<T, N> ide;
ide.Push(46);
N decPoint = size; N decPoint = size;
Find(".", &decPoint); Find(ide, &decPoint);
float result = 0.0f; float result = 0.0f;
float fraction = 0.0f; float fraction = 0.0f;
@@ -1297,8 +1300,11 @@ namespace ehs
/// @note Use "IsNum" before this if the string object is not guaranteed to be a number. /// @note Use "IsNum" before this if the string object is not guaranteed to be a number.
double ToDouble() const double ToDouble() const
{ {
Str<T, N> ide;
ide.Push(46);
N decPoint = size; N decPoint = size;
Find(".", &decPoint); Find(ide, &decPoint);
double result = 0.0f; double result = 0.0f;
double fraction = 0.0f; double fraction = 0.0f;
@@ -1323,8 +1329,11 @@ namespace ehs
/// @note Use "IsNum" before this if the string object is not guaranteed to be a number. /// @note Use "IsNum" before this if the string object is not guaranteed to be a number.
long double ToLDouble() const long double ToLDouble() const
{ {
Str<T, N> ide;
ide.Push(46);
N decPoint = size; N decPoint = size;
Find(".", &decPoint); Find(ide, &decPoint);
long double result = 0.0f; long double result = 0.0f;
long double fraction = 0.0f; long double fraction = 0.0f;
@@ -1679,7 +1688,7 @@ namespace ehs
Str<T, N> result; Str<T, N> result;
if (whole < 0) if (whole < 0)
result += "-"; result.Push(45);
result += Str<T, N>::FromNum(whole); result += Str<T, N>::FromNum(whole);
@@ -1691,7 +1700,7 @@ namespace ehs
if (!fraction) if (!fraction)
return result; return result;
result += "."; result.Push(46);
Str<T, N> fResult(maxDecimals); Str<T, N> fResult(maxDecimals);
N i = 0; N i = 0;
@@ -1721,7 +1730,7 @@ namespace ehs
Str<T, N> result; Str<T, N> result;
if (whole < 0) if (whole < 0)
result += "-"; result.Push(45);
result += Str<T, N>::FromNum(whole); result += Str<T, N>::FromNum(whole);
@@ -1733,7 +1742,7 @@ namespace ehs
if (!fraction) if (!fraction)
return result; return result;
result += "."; result.Push(46);
Str<T, N> fResult(maxDecimals); Str<T, N> fResult(maxDecimals);
N i = 0; N i = 0;
@@ -1763,7 +1772,7 @@ namespace ehs
Str<T, N> result; Str<T, N> result;
if (whole < 0) if (whole < 0)
result += "-"; result.Push(45);
result += Str<T, N>::FromNum(whole); result += Str<T, N>::FromNum(whole);
@@ -1775,7 +1784,7 @@ namespace ehs
if (!fraction) if (!fraction)
return result; return result;
result += "."; result.Push(46);
Str<T, N> fResult(maxDecimals); Str<T, N> fResult(maxDecimals);
N i = 0; N i = 0;
@@ -1888,14 +1897,14 @@ namespace ehs
if (aSize != bSize) if (aSize != bSize)
return false; return false;
for (UInt_64 i = 0; i < aSize; ++i) return Util::Compare(a, b, aSize);
if (a[i] != b[i])
return false;
return true;
} }
}; };
template class EHS_LIB_IO Str<Char_32, UInt_64>;
template class EHS_LIB_IO Str<Char_16, UInt_64>;
template class EHS_LIB_IO Str<Char_8, UInt_64>;
typedef Str<Char_32, UInt_64> Str_32; typedef Str<Char_32, UInt_64> Str_32;
typedef Str<Char_16, UInt_64> Str_16; typedef Str<Char_16, UInt_64> Str_16;
typedef Str<Char_8, UInt_64> Str_8; typedef Str<Char_8, UInt_64> Str_8;

View File

@@ -9,7 +9,7 @@ namespace ehs
{ {
typedef void (*TaskCb)(Serializer<UInt_64>*); typedef void (*TaskCb)(Serializer<UInt_64>*);
class Task class EHS_LIB_IO Task
{ {
private: private:
bool working; bool working;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class Type class EHS_LIB_IO Type
{ {
private: private:
friend class BaseObj; friend class BaseObj;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class URI class EHS_LIB_IO URI
{ {
public: public:
/// Encodes specialized characters in the URI. /// Encodes specialized characters in the URI.

View File

@@ -13,7 +13,7 @@ namespace ehs
}; };
/// A helper class for converting between UTF8, 16 and 32. /// A helper class for converting between UTF8, 16 and 32.
class UTF class EHS_LIB_IO UTF
{ {
public: public:
/// Converts the given UTF16 C-style string into UTF32. /// Converts the given UTF16 C-style string into UTF32.

View File

@@ -4,7 +4,7 @@
namespace ehs namespace ehs
{ {
class Util class EHS_LIB_IO Util
{ {
public: public:
static bool Compare(const void* a, const void* b, UInt_64 size); static bool Compare(const void* a, const void* b, UInt_64 size);

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
/// A helper class for storing version major, minor and patch. /// A helper class for storing version major, minor and patch.
class Version class EHS_LIB_IO Version
{ {
public: public:
UInt_32 major; UInt_32 major;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class Database class EHS_LIB_IO Database
{ {
private: private:
UInt_64 hashId; UInt_64 hashId;

View File

@@ -7,7 +7,7 @@ namespace ehs
{ {
class DbTable; class DbTable;
class DbObject class EHS_LIB_IO DbObject
{ {
private: private:
friend class DbTable; friend class DbTable;

View File

@@ -10,7 +10,7 @@ namespace ehs
{ {
class Database; class Database;
class DbTable class EHS_LIB_IO DbTable
{ {
private: private:
friend class Database; friend class Database;

View File

@@ -8,7 +8,7 @@ namespace ehs
class DbVarTmpl; class DbVarTmpl;
class DbObject; class DbObject;
class DbVar class EHS_LIB_IO DbVar
{ {
private: private:
friend class DbObject; friend class DbObject;

View File

@@ -8,7 +8,7 @@ namespace ehs
{ {
class DbVar; class DbVar;
class DbVarTmpl class EHS_LIB_IO DbVarTmpl
{ {
private: private:
friend class DbTable; friend class DbTable;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class BaseDirectory class EHS_LIB_IO BaseDirectory
{ {
public: public:
static Array<Str_8> GetAllFiles(const Str_8 &dir); static Array<Str_8> GetAllFiles(const Str_8 &dir);

View File

@@ -25,7 +25,7 @@ namespace ehs
}; };
/// A cross-platform wrapper class that handles native file input/output. /// A cross-platform wrapper class that handles native file input/output.
class BaseFile class EHS_LIB_IO BaseFile
{ {
protected: protected:
Str_8 path; Str_8 path;

View File

@@ -11,7 +11,7 @@
namespace ehs namespace ehs
{ {
class BaseFileMonitor class EHS_LIB_IO BaseFileMonitor
{ {
protected: protected:
Str_8 filePath; Str_8 filePath;

View File

@@ -1,9 +1,7 @@
#pragma once #pragma once
#include "ehs/EHS.h"
#include "ehs/Str.h" #include "ehs/Str.h"
#include "ehs/Vec2.h" #include "ehs/Vec2.h"
#include "ehs/Rect.h"
#include "ehs/io/hid/Input.h" #include "ehs/io/hid/Input.h"
namespace ehs namespace ehs
@@ -20,7 +18,7 @@ namespace ehs
I_BEAM I_BEAM
}; };
class BaseWindow class EHS_LIB_IO BaseWindow
{ {
protected: protected:
bool created; bool created;
@@ -60,10 +58,6 @@ namespace ehs
bool HasFocus() const; bool HasFocus() const;
void EnableResizing(bool enable);
bool IsResizable() const;
/// Gets the cursors position on the desktop in pixels. /// Gets the cursors position on the desktop in pixels.
/// @param [in] relative Whether the position should be relative to the windows client. /// @param [in] relative Whether the position should be relative to the windows client.
/// @returns The current value. /// @returns The current value.

View File

@@ -20,7 +20,7 @@ namespace ehs
TWO TWO
}; };
class COM class EHS_LIB_IO COM
{ {
private: private:
UInt_8 port; UInt_8 port;

View File

@@ -12,7 +12,7 @@ namespace ehs
typedef int ConsoleHdl; typedef int ConsoleHdl;
#endif #endif
class Console class EHS_LIB_IO Console
{ {
private: private:
static ConsoleHdl hdlOut; static ConsoleHdl hdlOut;

View File

@@ -3,7 +3,7 @@
#include "ehs/system/OS.h" #include "ehs/system/OS.h"
#if defined(EHS_OS_WINDOWS) #if defined(EHS_OS_WINDOWS)
#include "Directory_W32.h" #include "Directory_W32.h"
#elif defined(EHS_OS_LINUX) #elif defined(EHS_OS_LINUX)
#include "Directory_LNX.h" #include "Directory_LNX.h"
#endif #endif

View File

@@ -4,7 +4,7 @@
namespace ehs namespace ehs
{ {
class Directory : public BaseDirectory class EHS_LIB_IO Directory : public BaseDirectory
{ {
public: public:
static Array<Str_8> GetAllFiles(const Str_8 &dir); static Array<Str_8> GetAllFiles(const Str_8 &dir);

View File

@@ -0,0 +1,16 @@
#pragma once
#include "BaseDirectory.h"
namespace ehs
{
class EHS_LIB_IO Directory : public BaseDirectory
{
public:
static Array<Str_8> GetAllFiles(const Str_8 &dir);
static void CreateRecursive(Str_8 dir);
static void Create(const Str_8 &dir);
};
}

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class FileMonitor : public BaseFileMonitor class EHS_LIB_IO FileMonitor : public BaseFileMonitor
{ {
private: private:
int hdl; int hdl;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class FileMonitor final : public BaseFileMonitor class EHS_LIB_IO FileMonitor final : public BaseFileMonitor
{ {
private: private:
Handle hdl; Handle hdl;

View File

@@ -10,7 +10,7 @@
namespace ehs namespace ehs
{ {
class File : public BaseFile class EHS_LIB_IO File : public BaseFile
{ {
private: private:
int hdl; int hdl;

View File

@@ -10,7 +10,7 @@
namespace ehs namespace ehs
{ {
class File : public BaseFile class EHS_LIB_IO File : public BaseFile
{ {
private: private:
HANDLE hdl; HANDLE hdl;

View File

@@ -10,7 +10,7 @@
namespace ehs namespace ehs
{ {
class FontAtlas : public BaseObj class EHS_LIB_IO FontAtlas : public BaseObj
{ {
private: private:
UInt_64 hashId; UInt_64 hashId;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class Glyph class EHS_LIB_IO Glyph
{ {
private: private:
Char_32 code; Char_32 code;

View File

@@ -8,7 +8,7 @@
namespace ehs namespace ehs
{ {
class RIFF class EHS_LIB_IO RIFF
{ {
private: private:
Str_8 type; Str_8 type;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class RIFF_Chunk class EHS_LIB_IO RIFF_Chunk
{ {
private: private:
Str_8 id; Str_8 id;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class Resource : public BaseObj class EHS_LIB_IO Resource : public BaseObj
{ {
private: private:
ehs::UInt_64 hashId; ehs::UInt_64 hashId;

View File

@@ -4,7 +4,7 @@
namespace ehs namespace ehs
{ {
class UsbBase class EHS_LIB_IO UsbBase
{ {
private: private:
UInt_32 bus; UInt_32 bus;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class Usb final : public UsbBase class EHS_LIB_IO Usb final : public UsbBase
{ {
private: private:
int hdl; int hdl;

View File

@@ -14,7 +14,7 @@
namespace ehs namespace ehs
{ {
class Window : public BaseWindow class EHS_LIB_IO Window : public BaseWindow
{ {
private: private:
UInt_32 owner; UInt_32 owner;
@@ -71,13 +71,6 @@ namespace ehs
void SetIcon(const Str_8& filePath); void SetIcon(const Str_8& filePath);
/// Sets the windows client scale.
/// @param [in] w The width in pixels.
/// @param [in] h The height in pixels.
void SetClientSize(const Vec2<UInt_32>& size);
Vec2<UInt_32> GetClientSize();
/// Gets the windows native handle for the operating system or other native tasks. /// Gets the windows native handle for the operating system or other native tasks.
/// @returns The window's native handle. /// @returns The window's native handle.
HWND GetHdl() const; HWND GetHdl() const;

View File

@@ -4,21 +4,27 @@
#include <wayland-client.h> #include <wayland-client.h>
#include "xdg-shell-client-protocol.h" #include "xdg-shell-client-protocol.h"
#include "xdg-decoration.h"
namespace ehs namespace ehs
{ {
class Window : public BaseWindow class EHS_LIB_IO Window : public BaseWindow
{ {
private: protected:
wl_display* display; wl_display *display;
wl_registry *registry; wl_registry *registry;
wl_compositor* compositor; wl_compositor *compositor;
wl_surface* surface; wl_surface *wlSurface;
xdg_wm_base *xdgShell; xdg_wm_base *xdgShell;
xdg_surface *xdgSurface; xdg_surface *xdgSurface;
xdg_toplevel *xdgToplevel; xdg_toplevel *xdgToplevel;
zxdg_decoration_manager_v1 *decManager;
zxdg_toplevel_decoration_v1 *dec;
wl_seat *seat;
wl_pointer *pointer;
Vec2_u32 scale;
static void SurfaceConfigure(void *data, xdg_surface *xdg_surface, UInt_32 serial); static void SurfaceConfigEvent(void *data, xdg_surface *xdg_surface, UInt_32 serial);
static void ShellPing(void *data, xdg_wm_base *shell, UInt_32 serial); static void ShellPing(void *data, xdg_wm_base *shell, UInt_32 serial);
@@ -26,16 +32,32 @@ namespace ehs
static void RegistryRemoved(void *data, wl_registry *registry, UInt_32 id); static void RegistryRemoved(void *data, wl_registry *registry, UInt_32 id);
static void ResizeEvent(void *data, xdg_toplevel *xdg_toplevel, Int_32 width, Int_32 height, wl_array *states);
static void CloseEvent(void *data, xdg_toplevel *xdg_toplevel);
static void SeatCapabilitiesEvent(void *data, wl_seat *seat, UInt_32 capabilities);
static void PointerMotionEvent(void *data, wl_pointer *pointer, UInt_32 time, wl_fixed_t sx, wl_fixed_t sy);
public: public:
~Window() override; ~Window() override;
Window(); Window();
void Create_32(const Str_32& title, const Vec2_s32& pos, const Vec2_u32 scale) override; Window(Window &&win) noexcept;
void Create_16(const Str_16& title, const Vec2_s32& pos, const Vec2_u32 scale) override; Window(const Window &win);
void Create_8(const Str_8& title, const Vec2_s32& pos, const Vec2_u32 scale) override; Window &operator=(Window &&win) noexcept;
Window &operator=(const Window &win);
void Create_32(const Str_32& title, const Vec2_s32& pos, Vec2_u32 scale) override;
void Create_16(const Str_16& title, const Vec2_s32& pos, Vec2_u32 scale) override;
void Create_8(const Str_8& title, const Vec2_s32& pos, Vec2_u32 scale) override;
void OnCreated() override; void OnCreated() override;

View File

@@ -8,7 +8,7 @@
namespace ehs namespace ehs
{ {
class Window : public BaseWindow class EHS_LIB_IO Window : public BaseWindow
{ {
protected: protected:
friend class Input; friend class Input;

View File

@@ -11,7 +11,7 @@
namespace ehs namespace ehs
{ {
class Audio : public Resource class EHS_LIB_IO Audio : public Resource
{ {
private: private:
static Array<AudioCodec> codecs; static Array<AudioCodec> codecs;

View File

@@ -8,7 +8,7 @@ namespace ehs
{ {
class Audio; class Audio;
class AudioCodec class EHS_LIB_IO AudioCodec
{ {
private: private:
Str_8 id; Str_8 id;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class AudioDevice : public BaseAudioDevice class EHS_LIB_IO AudioDevice : public BaseAudioDevice
{ {
private: private:
snd_pcm_t* hdl; snd_pcm_t* hdl;

View File

@@ -12,7 +12,7 @@ struct IMMDevice;
namespace ehs namespace ehs
{ {
class AudioDevice : public BaseAudioDevice class EHS_LIB_IO AudioDevice : public BaseAudioDevice
{ {
private: private:
IMMDevice* hdl; IMMDevice* hdl;

View File

@@ -23,7 +23,7 @@ namespace ehs
UNPLUGGED = 0x8 UNPLUGGED = 0x8
}; };
class BaseAudioDevice class EHS_LIB_IO BaseAudioDevice
{ {
protected: protected:
AudioDeviceType type; AudioDeviceType type;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class Button class EHS_LIB_IO Button
{ {
private: private:
Str_8 name; Str_8 name;

View File

@@ -13,7 +13,7 @@ namespace ehs
TOUCHED TOUCHED
}; };
class ButtonState class EHS_LIB_IO ButtonState
{ {
private: private:
Button button; Button button;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class HID class EHS_LIB_IO HID
{ {
protected: protected:
UInt_8 type; UInt_8 type;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class Input class EHS_LIB_IO Input
{ {
private: private:
Array<InputHandler*> handlers; Array<InputHandler*> handlers;

View File

@@ -5,7 +5,7 @@
namespace ehs namespace ehs
{ {
class InputHandler class EHS_LIB_IO InputHandler
{ {
private: private:
UInt_64 hashId; UInt_64 hashId;

View File

@@ -8,7 +8,7 @@
namespace ehs namespace ehs
{ {
class Keyboard : public HID class EHS_LIB_IO Keyboard : public HID
{ {
public: public:
Keyboard(); Keyboard();

View File

@@ -9,7 +9,7 @@
namespace ehs namespace ehs
{ {
class Mouse : public HID class EHS_LIB_IO Mouse : public HID
{ {
private: private:
friend class Input; friend class Input;

View File

@@ -13,7 +13,7 @@ namespace ehs
NEAREST_NEIGHBOR NEAREST_NEIGHBOR
}; };
class Img : public BaseObj class EHS_LIB_IO Img : public BaseObj
{ {
private: private:
static Array<ImgCodec> codecs; static Array<ImgCodec> codecs;

View File

@@ -12,7 +12,7 @@ namespace ehs
typedef bool (*EncodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, const Img*); typedef bool (*EncodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, const Img*);
typedef bool (*DecodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, Img*); typedef bool (*DecodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, Img*);
class ImgCodec class EHS_LIB_IO ImgCodec
{ {
private: private:
Str_8 id; Str_8 id;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class PNG class EHS_LIB_IO PNG
{ {
private: private:
Str_8 id; Str_8 id;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class PNG_Chunk class EHS_LIB_IO PNG_Chunk
{ {
private: private:
Str_8 id; Str_8 id;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class AnimBone class EHS_LIB_IO AnimBone
{ {
private: private:
UInt_8 boneId; UInt_8 boneId;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class Animation class EHS_LIB_IO Animation
{ {
private: private:
UInt_64 hashId; UInt_64 hashId;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class Bone class EHS_LIB_IO Bone
{ {
private: private:
UInt_64 hashName; UInt_64 hashName;

View File

@@ -9,7 +9,7 @@
namespace ehs namespace ehs
{ {
class KeyFrame class EHS_LIB_IO KeyFrame
{ {
private: private:
float num; float num;

View File

@@ -15,7 +15,7 @@ namespace ehs
EHM EHM
}; };
class Mdl : public BaseObj class EHS_LIB_IO Mdl : public BaseObj
{ {
private: private:
static Array<MdlCodec> codecs; static Array<MdlCodec> codecs;

View File

@@ -12,7 +12,7 @@ namespace ehs
typedef bool (*EnocdeMdlCb)(const MdlCodec*, Serializer<UInt_64>&, const Mdl*); typedef bool (*EnocdeMdlCb)(const MdlCodec*, Serializer<UInt_64>&, const Mdl*);
typedef bool (*DecodeMdlCb)(const MdlCodec*, Serializer<UInt_64>&, Mdl*); typedef bool (*DecodeMdlCb)(const MdlCodec*, Serializer<UInt_64>&, Mdl*);
class MdlCodec class EHS_LIB_IO MdlCodec
{ {
private: private:
Str_8 id; Str_8 id;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class Mesh final : public BaseObj class EHS_LIB_IO Mesh final : public BaseObj
{ {
protected: protected:
UInt_64 hashId; UInt_64 hashId;

View File

@@ -19,7 +19,7 @@ namespace ehs
INVALID INVALID
}; };
class PropertyChange class EHS_LIB_IO PropertyChange
{ {
public: public:
ChangeType type; ChangeType type;

View File

@@ -0,0 +1,18 @@
#pragma once
#include "Socket.h"
#include "ehs/Str.h"
namespace ehs
{
class EHS_LIB_IO BaseDNS
{
public:
static Str_8 Resolve(AddrType type, const Str_8 &hostname);
/// Resolves a hostname to an ip address.
/// @param [in] hostname The given hostname to resolve.
/// @returns The resulting ip address.
static Str_8 Resolve(const Str_8 &hostname);
};
}

View File

@@ -9,7 +9,7 @@
namespace ehs namespace ehs
{ {
class BaseTCP class EHS_LIB_IO BaseTCP
{ {
protected: protected:
AddrType addrType; AddrType addrType;
@@ -146,6 +146,10 @@ namespace ehs
/// @returns The result. /// @returns The result.
virtual bool IsBlocking() const = 0; virtual bool IsBlocking() const = 0;
virtual void SetIPv6Only(bool value) = 0;
virtual bool IsIPv6Only() const = 0;
/// Retrieves whether or not this socket was initialized. /// Retrieves whether or not this socket was initialized.
/// @returns The result. /// @returns The result.
virtual bool IsValid() const = 0; virtual bool IsValid() const = 0;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class BaseUDP class EHS_LIB_IO BaseUDP
{ {
protected: protected:
AddrType type; AddrType type;
@@ -69,6 +69,10 @@ namespace ehs
/// @returns The result. /// @returns The result.
virtual bool IsBlocking() const = 0; virtual bool IsBlocking() const = 0;
virtual void SetIPv6Only(bool value) = 0;
virtual bool IsIPv6Only() const = 0;
/// Retrieves the bound ip version. /// Retrieves the bound ip version.
/// @returns The result. /// @returns The result.
AddrType GetLocalAddressType() const; AddrType GetLocalAddressType() const;

View File

@@ -1,17 +1,9 @@
#pragma once #pragma once
#include "ehs/EHS.h" #include "ehs/system/OS.h"
#include "ehs/Str.h"
#include "Socket.h"
namespace ehs #if defined(EHS_OS_WINDOWS)
{ #include "DNS_W32.h"
class DNS #elif defined(EHS_OS_LINUX)
{ #include "DNS_LNX.h"
public: #endif
/// Resolves a hostname to an ip address.
/// @param [in] hostname The given hostname to resolve.
/// @returns The resulting ip address.
static Str_8 Resolve(const Str_8& hostname);
};
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include "BaseDNS.h"
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "Socket.h"
namespace ehs
{
class EHS_LIB_IO DNS final : public BaseDNS
{
public:
static Str_8 Resolve(AddrType type, const Str_8 &hostname);
static Str_8 Resolve(const Str_8 &hostname);
};
}

View File

@@ -0,0 +1,14 @@
#pragma once
#include "BaseDNS.h"
namespace ehs
{
class EHS_LIB_IO DNS final : public BaseDNS
{
public:
static Str_8 Resolve(AddrType type, const Str_8 &hostname);
static Str_8 Resolve(const Str_8 &hostname);
};
}

View File

@@ -16,7 +16,7 @@ namespace ehs
DEL DEL
}; };
class Request class EHS_LIB_IO Request
{ {
private: private:
Verb verb; Verb verb;

View File

@@ -8,7 +8,7 @@
namespace ehs namespace ehs
{ {
class Response class EHS_LIB_IO Response
{ {
private: private:
UInt_32 code; UInt_32 code;

View File

@@ -12,7 +12,7 @@ typedef struct ssl_st SSL;
namespace ehs namespace ehs
{ {
/// A class for handling the HTTP(S) TCP socket layer. /// A class for handling the HTTP(S) TCP socket layer.
class SSL : public TCP class EHS_LIB_IO SSL : public TCP
{ {
private: private:
SSL_CTX* ctx; SSL_CTX* ctx;

View File

@@ -10,7 +10,7 @@
namespace ehs namespace ehs
{ {
/// A wrapper class for the transmission control protocol socket. /// A wrapper class for the transmission control protocol socket.
class TCP : public BaseTCP class EHS_LIB_IO TCP : public BaseTCP
{ {
protected: protected:
Socket hdl; Socket hdl;
@@ -80,6 +80,10 @@ namespace ehs
/// @returns The result. /// @returns The result.
bool IsBlocking() const override; bool IsBlocking() const override;
void SetIPv6Only(bool value) override;
bool IsIPv6Only() const override;
bool IsValid() const override; bool IsValid() const override;
private: private:

View File

@@ -10,7 +10,7 @@
namespace ehs namespace ehs
{ {
/// A wrapper class for the transmission control protocol socket. /// A wrapper class for the transmission control protocol socket.
class TCP : public BaseTCP class EHS_LIB_IO TCP : public BaseTCP
{ {
protected: protected:
Socket hdl; Socket hdl;
@@ -80,6 +80,10 @@ namespace ehs
/// @returns The result. /// @returns The result.
bool IsBlocking() const override; bool IsBlocking() const override;
void SetIPv6Only(bool value) override;
bool IsIPv6Only() const override;
bool IsValid() const override; bool IsValid() const override;
private: private:

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
/// A wrapper class for the user datagram protocol socket. /// A wrapper class for the user datagram protocol socket.
class UDP : public BaseUDP class EHS_LIB_IO UDP : public BaseUDP
{ {
private: private:
Socket hdl; Socket hdl;
@@ -68,6 +68,10 @@ namespace ehs
/// @returns The result. /// @returns The result.
bool IsBlocking() const override; bool IsBlocking() const override;
void SetIPv6Only(bool value) override;
bool IsIPv6Only() const override;
bool IsValid() const override; bool IsValid() const override;
private: private:

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
/// A wrapper class for the user datagram protocol socket. /// A wrapper class for the user datagram protocol socket.
class UDP : public BaseUDP class EHS_LIB_IO UDP : public BaseUDP
{ {
private: private:
Socket hdl; Socket hdl;
@@ -68,6 +68,10 @@ namespace ehs
/// @returns The result. /// @returns The result.
bool IsBlocking() const override; bool IsBlocking() const override;
void SetIPv6Only(bool value) override;
bool IsIPv6Only() const override;
bool IsValid() const override; bool IsValid() const override;
private: private:

View File

@@ -21,7 +21,7 @@ namespace ehs
Str_8 id; Str_8 id;
}; };
class Spotify class EHS_LIB_IO Spotify final
{ {
private: private:
SSL client; SSL client;
@@ -40,14 +40,14 @@ namespace ehs
Spotify(); Spotify();
Spotify(const Str_8& clientId, const Str_8& secret, const Str_8& redURI, const Array<Str_8>& scopes, const bool forceVerify); Spotify(Str_8 clientId, Str_8 secret, Str_8 redURI, Array<Str_8> scopes, bool forceVerify);
bool Authorize(); bool Authorize();
/// Sets the volume for a device. /// Sets the volume for a device.
/// @param [in] level The percentage to set the volume to. /// @param [in] level The percentage to set the volume to.
/// @returns The response code. /// @returns The response code.
UInt_32 SetVolume(const UInt_8 level); UInt_32 SetVolume(UInt_8 level);
/// Resume playback for a device. /// Resume playback for a device.
/// @returns The response code. /// @returns The response code.
@@ -60,12 +60,12 @@ namespace ehs
/// Repeats playback for a device. /// Repeats playback for a device.
/// @param [in] status The status to set it to. /// @param [in] status The status to set it to.
/// @returns The response code. /// @returns The response code.
UInt_32 SetRepeat(const SpotifyState state); UInt_32 SetRepeat(SpotifyState state);
/// Shuffles playback for a device. /// Shuffles playback for a device.
/// @param [in] state The state to set shuffle to. /// @param [in] state The state to set shuffle to.
/// @returns The response code. /// @returns The response code.
UInt_32 SetShuffle(const bool state); UInt_32 SetShuffle(bool state);
UInt_32 SearchTrack(Vector<Str_8>& artists, Str_8& id, Str_8& name); UInt_32 SearchTrack(Vector<Str_8>& artists, Str_8& id, Str_8& name);
@@ -93,7 +93,7 @@ namespace ehs
/// Seeks to a position of the currently playing track in milliseconds. /// Seeks to a position of the currently playing track in milliseconds.
/// @param [in] pos The position in milliseconds to seek to. /// @param [in] pos The position in milliseconds to seek to.
/// @returns The response code. /// @returns The response code.
UInt_32 Seek(const UInt_32 pos); UInt_32 Seek(UInt_32 pos);
Str_8 GetClientId() const; Str_8 GetClientId() const;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class Twitch class EHS_LIB_IO Twitch
{ {
private: private:
SSL client; SSL client;

View File

@@ -6,7 +6,7 @@
namespace ehs namespace ehs
{ {
class TwitchChat class EHS_LIB_IO TwitchChat
{ {
private: private:
TCP client; TCP client;

View File

@@ -0,0 +1,377 @@
/* Generated by wayland-scanner 1.23.0 */
#ifndef XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
#define XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_xdg_decoration_unstable_v1 The xdg_decoration_unstable_v1 protocol
* @section page_ifaces_xdg_decoration_unstable_v1 Interfaces
* - @subpage page_iface_zxdg_decoration_manager_v1 - window decoration manager
* - @subpage page_iface_zxdg_toplevel_decoration_v1 - decoration object for a toplevel surface
* @section page_copyright_xdg_decoration_unstable_v1 Copyright
* <pre>
*
* Copyright © 2018 Simon Ser
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct xdg_toplevel;
struct zxdg_decoration_manager_v1;
struct zxdg_toplevel_decoration_v1;
#ifndef ZXDG_DECORATION_MANAGER_V1_INTERFACE
#define ZXDG_DECORATION_MANAGER_V1_INTERFACE
/**
* @page page_iface_zxdg_decoration_manager_v1 zxdg_decoration_manager_v1
* @section page_iface_zxdg_decoration_manager_v1_desc Description
*
* This interface allows a compositor to announce support for server-side
* decorations.
*
* A window decoration is a set of window controls as deemed appropriate by
* the party managing them, such as user interface components used to move,
* resize and change a window's state.
*
* A client can use this protocol to request being decorated by a supporting
* compositor.
*
* If compositor and client do not negotiate the use of a server-side
* decoration using this protocol, clients continue to self-decorate as they
* see fit.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding interface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and interface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
* @section page_iface_zxdg_decoration_manager_v1_api API
* See @ref iface_zxdg_decoration_manager_v1.
*/
/**
* @defgroup iface_zxdg_decoration_manager_v1 The zxdg_decoration_manager_v1 interface
*
* This interface allows a compositor to announce support for server-side
* decorations.
*
* A window decoration is a set of window controls as deemed appropriate by
* the party managing them, such as user interface components used to move,
* resize and change a window's state.
*
* A client can use this protocol to request being decorated by a supporting
* compositor.
*
* If compositor and client do not negotiate the use of a server-side
* decoration using this protocol, clients continue to self-decorate as they
* see fit.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding interface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and interface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
*/
extern const struct wl_interface zxdg_decoration_manager_v1_interface;
#endif
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE
#define ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE
/**
* @page page_iface_zxdg_toplevel_decoration_v1 zxdg_toplevel_decoration_v1
* @section page_iface_zxdg_toplevel_decoration_v1_desc Description
*
* The decoration object allows the compositor to toggle server-side window
* decorations for a toplevel surface. The client can request to switch to
* another mode.
*
* The xdg_toplevel_decoration object must be destroyed before its
* xdg_toplevel.
* @section page_iface_zxdg_toplevel_decoration_v1_api API
* See @ref iface_zxdg_toplevel_decoration_v1.
*/
/**
* @defgroup iface_zxdg_toplevel_decoration_v1 The zxdg_toplevel_decoration_v1 interface
*
* The decoration object allows the compositor to toggle server-side window
* decorations for a toplevel surface. The client can request to switch to
* another mode.
*
* The xdg_toplevel_decoration object must be destroyed before its
* xdg_toplevel.
*/
extern const struct wl_interface zxdg_toplevel_decoration_v1_interface;
#endif
#define ZXDG_DECORATION_MANAGER_V1_DESTROY 0
#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION 1
/**
* @ingroup iface_zxdg_decoration_manager_v1
*/
#define ZXDG_DECORATION_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_decoration_manager_v1
*/
#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION_SINCE_VERSION 1
/** @ingroup iface_zxdg_decoration_manager_v1 */
static inline void
zxdg_decoration_manager_v1_set_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zxdg_decoration_manager_v1, user_data);
}
/** @ingroup iface_zxdg_decoration_manager_v1 */
static inline void *
zxdg_decoration_manager_v1_get_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_decoration_manager_v1);
}
static inline uint32_t
zxdg_decoration_manager_v1_get_version(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1);
}
/**
* @ingroup iface_zxdg_decoration_manager_v1
*
* Destroy the decoration manager. This doesn't destroy objects created
* with the manager.
*/
static inline void
zxdg_decoration_manager_v1_destroy(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,
ZXDG_DECORATION_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zxdg_decoration_manager_v1
*
* Create a new decoration object associated with the given toplevel.
*
* Creating an xdg_toplevel_decoration from an xdg_toplevel which has a
* buffer attached or committed is a client error, and any attempts by a
* client to attach or manipulate a buffer prior to the first
* xdg_toplevel_decoration.configure event must also be treated as
* errors.
*/
static inline struct zxdg_toplevel_decoration_v1 *
zxdg_decoration_manager_v1_get_toplevel_decoration(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, struct xdg_toplevel *toplevel)
{
struct wl_proxy *id;
id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,
ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION, &zxdg_toplevel_decoration_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), 0, NULL, toplevel);
return (struct zxdg_toplevel_decoration_v1 *) id;
}
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM
#define ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM
enum zxdg_toplevel_decoration_v1_error {
/**
* xdg_toplevel has a buffer attached before configure
*/
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_UNCONFIGURED_BUFFER = 0,
/**
* xdg_toplevel already has a decoration object
*/
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED = 1,
/**
* xdg_toplevel destroyed before the decoration object
*/
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ORPHANED = 2,
};
#endif /* ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM */
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
#define ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
* window decoration modes
*
* These values describe window decoration modes.
*/
enum zxdg_toplevel_decoration_v1_mode {
/**
* no server-side window decoration
*/
ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE = 1,
/**
* server-side window decoration
*/
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE = 2,
};
#endif /* ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM */
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
* @struct zxdg_toplevel_decoration_v1_listener
*/
struct zxdg_toplevel_decoration_v1_listener {
/**
* notify a decoration mode change
*
* The configure event configures the effective decoration mode.
* The configured state should not be applied immediately. Clients
* must send an ack_configure in response to this event. See
* xdg_surface.configure and xdg_surface.ack_configure for details.
*
* A configure event can be sent at any time. The specified mode
* must be obeyed by the client.
* @param mode the decoration mode
*/
void (*configure)(void *data,
struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
uint32_t mode);
};
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*/
static inline int
zxdg_toplevel_decoration_v1_add_listener(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
const struct zxdg_toplevel_decoration_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_decoration_v1,
(void (**)(void)) listener, data);
}
#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY 0
#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE 1
#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE 2
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*/
#define ZXDG_TOPLEVEL_DECORATION_V1_CONFIGURE_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*/
#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*/
#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE_SINCE_VERSION 1
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*/
#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE_SINCE_VERSION 1
/** @ingroup iface_zxdg_toplevel_decoration_v1 */
static inline void
zxdg_toplevel_decoration_v1_set_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1, user_data);
}
/** @ingroup iface_zxdg_toplevel_decoration_v1 */
static inline void *
zxdg_toplevel_decoration_v1_get_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1);
}
static inline uint32_t
zxdg_toplevel_decoration_v1_get_version(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
{
return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1);
}
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*
* Switch back to a mode without any server-side decorations at the next
* commit.
*/
static inline void
zxdg_toplevel_decoration_v1_destroy(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
ZXDG_TOPLEVEL_DECORATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), WL_MARSHAL_FLAG_DESTROY);
}
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*
* Set the toplevel surface decoration mode. This informs the compositor
* that the client prefers the provided decoration mode.
*
* After requesting a decoration mode, the compositor will respond by
* emitting an xdg_surface.configure event. The client should then update
* its content, drawing it without decorations if the received mode is
* server-side decorations. The client must also acknowledge the configure
* when committing the new content (see xdg_surface.ack_configure).
*
* The compositor can decide not to use the client's mode and enforce a
* different mode instead.
*
* Clients whose decoration mode depend on the xdg_toplevel state may send
* a set_mode request in response to an xdg_surface.configure event and wait
* for the next xdg_surface.configure event to prevent unwanted state.
* Such clients are responsible for preventing configure loops and must
* make sure not to send multiple successive set_mode requests with the
* same decoration mode.
*/
static inline void
zxdg_toplevel_decoration_v1_set_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, uint32_t mode)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0, mode);
}
/**
* @ingroup iface_zxdg_toplevel_decoration_v1
*
* Unset the toplevel surface decoration mode. This informs the compositor
* that the client doesn't prefer a particular decoration mode.
*
* This request has the same semantics as set_mode.
*/
static inline void
zxdg_toplevel_decoration_v1_unset_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
{
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -12,7 +12,7 @@
namespace ehs namespace ehs
{ {
class Json class EHS_LIB_IO Json
{ {
private: private:
JsonBase* value; JsonBase* value;

View File

@@ -11,7 +11,7 @@ namespace ehs
class JsonNum; class JsonNum;
class JsonStr; class JsonStr;
class JsonArray : public JsonBase class EHS_LIB_IO JsonArray : public JsonBase
{ {
private: private:
UInt_64 size; UInt_64 size;

View File

@@ -15,7 +15,7 @@ namespace ehs
STR STR
}; };
class JsonBase class EHS_LIB_IO JsonBase
{ {
private: private:
JsonType type; JsonType type;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class JsonBool : public JsonBase class EHS_LIB_IO JsonBool : public JsonBase
{ {
public: public:
bool value; bool value;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class JsonNum : public JsonBase class EHS_LIB_IO JsonNum : public JsonBase
{ {
public: public:
float value; float value;

View File

@@ -9,7 +9,7 @@ namespace ehs
{ {
class JsonVar; class JsonVar;
class JsonObj : public JsonBase class EHS_LIB_IO JsonObj : public JsonBase
{ {
protected: protected:
UInt_64 size; UInt_64 size;

View File

@@ -7,7 +7,7 @@
namespace ehs namespace ehs
{ {
class JsonStr : public JsonBase class EHS_LIB_IO JsonStr : public JsonBase
{ {
public: public:
Str_8 value; Str_8 value;

Some files were not shown because too many files have changed in this diff Show More