Compare commits
15 Commits
1.3.0
...
97b5300e48
| Author | SHA1 | Date | |
|---|---|---|---|
| 97b5300e48 | |||
| 8e7cc39000 | |||
| 1b70383448 | |||
| 64e1555d56 | |||
| a65c8d64b5 | |||
| fa2b801690 | |||
| 4e887b1ac2 | |||
| 126fc92fae | |||
| 2ef28273b0 | |||
| 04bf7d43ff | |||
| fb86dca332 | |||
| 7e380efd7d | |||
| b5e05864b6 | |||
| e2e5a1b8db | |||
| 2a2296685e |
@@ -122,7 +122,7 @@ set(EHS_SOURCES
|
||||
|
||||
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/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/BaseTCP.cpp include/ehs/io/socket/BaseTCP.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/TCP.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/BaseAudioDevice.cpp include/ehs/io/audio/BaseAudioDevice.h
|
||||
@@ -164,8 +165,6 @@ set(EHS_SOURCES
|
||||
include/ehs/io/mdl/MdlCodec.h
|
||||
include/ehs/io/UsbBase.h
|
||||
src/io/UsbBase.cpp
|
||||
include/ehs/io/Usb_LNX.h
|
||||
src/io/Usb_LNX.cpp
|
||||
include/ehs/db/DbTable.h
|
||||
include/ehs/db/DbObject.h
|
||||
include/ehs/db/DbVar.h
|
||||
@@ -177,8 +176,6 @@ set(EHS_SOURCES
|
||||
src/db/DbTable.cpp
|
||||
include/ehs/io/BaseDirectory.h
|
||||
src/io/BaseDirectory.cpp
|
||||
include/ehs/io/Directory_LNX.h
|
||||
src/io/Directory_LNX.cpp
|
||||
include/ehs/io/Directory.h
|
||||
)
|
||||
|
||||
@@ -186,6 +183,7 @@ if (IS_OS_WINDOWS)
|
||||
list(APPEND EHS_SOURCES
|
||||
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/DNS_W32.cpp include/ehs/io/socket/DNS_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/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/COM.cpp include/ehs/io/COM.h
|
||||
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)
|
||||
list(APPEND EHS_SOURCES
|
||||
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/DNS_LNX.cpp include/ehs/io/socket/DNS_LNX.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/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/system/FileSystem.cpp include/ehs/system/FileSystem.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")
|
||||
|
||||
if (LINUX_WINDOW_SYSTEM STREQUAL "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.")
|
||||
elseif (LINUX_WINDOW_SYSTEM STREQUAL "XCB")
|
||||
add_compile_definitions(EHS_WS_XCB)
|
||||
@@ -234,11 +239,14 @@ endif()
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
#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)
|
||||
|
||||
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)
|
||||
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local")
|
||||
@@ -246,12 +254,13 @@ elseif (IS_OS_WINDOWS)
|
||||
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS")
|
||||
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(TARGETS StrToHash DESTINATION bin)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
if (ZLIB_FOUND)
|
||||
message(STATUS "ZLIB was found.")
|
||||
@@ -266,10 +275,11 @@ else ()
|
||||
message(STATUS "OpenSSL was not found.")
|
||||
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)
|
||||
target_link_libraries(StrToHash ws2_32 avrt EHS)
|
||||
target_link_libraries(StrToHash ws2_32 avrt EHS_STC)
|
||||
elseif (IS_OS_LINUX)
|
||||
if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland")
|
||||
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)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(StrToHash z asound EHS)
|
||||
target_link_libraries(StrToHash z asound EHS_STC)
|
||||
endif ()
|
||||
@@ -8,6 +8,7 @@ This project does not fully follow the C++ standard.
|
||||
### Features
|
||||
- Audio IO/Processing/Manipulation
|
||||
- Image Processing/Manipulation
|
||||
- Databases
|
||||
- 3D Model & Mesh Processing/Manipulation
|
||||
- File IO
|
||||
- Basic File Monitoring
|
||||
@@ -20,7 +21,7 @@ This project does not fully follow the C++ standard.
|
||||
- Mutexes
|
||||
- Semaphores
|
||||
- CPU information and features at runtime
|
||||
- HTTP(S) Sockets
|
||||
- HTTP(S) Socket Layer
|
||||
- TCP Socket
|
||||
- UDP Socket
|
||||
- COM (Serial) IO
|
||||
@@ -29,12 +30,13 @@ This project does not fully follow the C++ standard.
|
||||
- Twitch Integration
|
||||
- Json Parsing/Writing
|
||||
- User Friendly HID Input
|
||||
- Basic Garbage Collector
|
||||
- Heap Garbage Collector
|
||||
- Linked List
|
||||
- Array
|
||||
- Vector
|
||||
- Asynchronous Task System
|
||||
- URI Parsing
|
||||
- USB (WIP)
|
||||
|
||||
### Supported Architectures
|
||||
- AMD64
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Base64
|
||||
class EHS_LIB_IO Base64
|
||||
{
|
||||
private:
|
||||
static const char ascii[];
|
||||
|
||||
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:
|
||||
static char Find(const char c);
|
||||
static char Find(char c);
|
||||
|
||||
static bool IsBase64(const char c);
|
||||
static bool IsBase64(char c);
|
||||
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class BaseObj
|
||||
class EHS_LIB_IO BaseObj
|
||||
{
|
||||
private:
|
||||
Type* hierarchy;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Color3
|
||||
class EHS_LIB_IO Color3
|
||||
{
|
||||
public:
|
||||
float r;
|
||||
@@ -13,13 +13,13 @@ namespace ehs
|
||||
|
||||
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& operator=(const float scalar);
|
||||
Color3& operator=(float scalar);
|
||||
|
||||
Color3& operator=(const Color3& color);
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace ehs
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Color4
|
||||
class EHS_LIB_IO Color4
|
||||
{
|
||||
public:
|
||||
float r;
|
||||
@@ -15,15 +15,15 @@ namespace ehs
|
||||
|
||||
Color4();
|
||||
|
||||
Color4(const float scalar);
|
||||
Color4(float scalar);
|
||||
|
||||
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& operator=(const float scalar);
|
||||
Color4& operator=(float scalar);
|
||||
|
||||
Color4& operator=(const Color3& color);
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace ehs
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Data
|
||||
class EHS_LIB_IO Data
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace ehs
|
||||
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);
|
||||
}
|
||||
@@ -19,45 +19,47 @@ namespace ehs
|
||||
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"
|
||||
/// @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"
|
||||
/// @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"
|
||||
/// @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.
|
||||
/// @returns The result.
|
||||
const Char_32* GetVersionId_32();
|
||||
EHS_LIB_IO const Char_32* GetVersionId_32();
|
||||
|
||||
/// Retrieves the version identifier in UTF16.
|
||||
/// @returns The result.
|
||||
const Char_16* GetVersionId_16();
|
||||
EHS_LIB_IO const Char_16* GetVersionId_16();
|
||||
|
||||
/// Retrieves the version identifier in UTF8.
|
||||
/// @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.
|
||||
/// @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);
|
||||
@@ -9,7 +9,7 @@ namespace ehs
|
||||
{
|
||||
typedef bool (*GcLogic)(BaseObj*);
|
||||
|
||||
class GC
|
||||
class EHS_LIB_IO GC
|
||||
{
|
||||
private:
|
||||
static Array<GcLogic> logic;
|
||||
@@ -36,7 +36,7 @@ namespace ehs
|
||||
|
||||
/// Sets the maximum amount of garbage to delete per poll.
|
||||
/// @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.
|
||||
/// @returns The maximum.
|
||||
@@ -44,7 +44,7 @@ namespace ehs
|
||||
|
||||
/// Sets a new amount for memory pre-allocation to save on memory operations.
|
||||
/// @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.
|
||||
/// @returns The stride.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class HRNG
|
||||
class EHS_LIB_IO HRNG
|
||||
{
|
||||
public:
|
||||
static UInt_64 GenerateSeed_u64();
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ehs
|
||||
/// A helper class for holding error information and handling them.
|
||||
/// @tparam T The character data type to use.
|
||||
/// @tparam N The number data type to use.
|
||||
class Log
|
||||
class EHS_LIB_IO Log
|
||||
{
|
||||
private:
|
||||
static void DefaultRaisedCb(const Log &log);
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace ehs
|
||||
|
||||
Mat2<T> GetMinor() const
|
||||
{
|
||||
Mat2<T> result(0);
|
||||
Mat2<T> result;
|
||||
result.data[0] = data[3];
|
||||
result.data[1] = data[2];
|
||||
result.data[2] = data[1];
|
||||
@@ -187,7 +187,7 @@ namespace ehs
|
||||
Mat2<T> GetInverse() const
|
||||
{
|
||||
T det = GetDeterminant();
|
||||
if (Math::ComCmp(det, 0.0f))
|
||||
if (Math::ComCmp(det, 0))
|
||||
return {};
|
||||
|
||||
return GetAdjugate() * (1 / det);
|
||||
@@ -196,7 +196,7 @@ namespace ehs
|
||||
void Inverse()
|
||||
{
|
||||
T det = GetDeterminant();
|
||||
if (Math::ComCmp(det, 0.0f))
|
||||
if (Math::ComCmp(det, 0))
|
||||
return;
|
||||
|
||||
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<double> Mat2_d;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace ehs
|
||||
Mat2<T> result;
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ namespace ehs
|
||||
Mat3<T> GetInverse() const
|
||||
{
|
||||
T det = GetDeterminant();
|
||||
if (Math::ComCmp(det, 0.0f))
|
||||
if (Math::ComCmp(det, 0))
|
||||
return {};
|
||||
|
||||
return GetAdjugate() * (1 / det);
|
||||
@@ -243,7 +243,7 @@ namespace ehs
|
||||
void Inverse()
|
||||
{
|
||||
T det = GetDeterminant();
|
||||
if (Math::ComCmp(det, 0.0f))
|
||||
if (Math::ComCmp(det, 0))
|
||||
return;
|
||||
|
||||
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<double> Mat3_d;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ namespace ehs
|
||||
Mat4<T> GetInverse() const
|
||||
{
|
||||
T det = GetDeterminant();
|
||||
if (Math::ComCmp(det, 0.0f))
|
||||
if (Math::ComCmp(det, 0))
|
||||
return {};
|
||||
|
||||
return GetAdjugate() * (1 / det);
|
||||
@@ -277,7 +277,7 @@ namespace ehs
|
||||
void Inverse()
|
||||
{
|
||||
T det = GetDeterminant();
|
||||
if (Math::ComCmp(det, 0.0f))
|
||||
if (Math::ComCmp(det, 0))
|
||||
return;
|
||||
|
||||
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<double> Mat4_d;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Math
|
||||
class EHS_LIB_IO Math
|
||||
{
|
||||
private:
|
||||
static float Sqrt_AVX(const float from);
|
||||
@@ -26,22 +26,22 @@ namespace ehs
|
||||
constexpr static double dblEpsilon = 1e-16;
|
||||
|
||||
/// 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.
|
||||
static bool AbsCmp(const double a, const double b);
|
||||
static bool AbsCmp(double a, double b);
|
||||
|
||||
/// 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.
|
||||
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.
|
||||
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.
|
||||
static bool ComCmp(const double a, const double b);
|
||||
static bool ComCmp(double a, double b);
|
||||
|
||||
template<typename T = float>
|
||||
static T Max(const T a, const T b)
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace ehs
|
||||
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);
|
||||
}
|
||||
@@ -564,7 +564,7 @@ namespace ehs
|
||||
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.
|
||||
@@ -580,7 +580,7 @@ namespace ehs
|
||||
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.
|
||||
@@ -595,7 +595,7 @@ namespace ehs
|
||||
return;
|
||||
}
|
||||
|
||||
Util::Copy(data[dstOffset], src, srcSize * sizeof(T));
|
||||
Util::Copy(&data[dstOffset], src, srcSize * sizeof(T));
|
||||
}
|
||||
|
||||
/// Inserts a string at a specified index.
|
||||
@@ -747,7 +747,7 @@ namespace ehs
|
||||
|
||||
T* result = new T[size + inSize + 1];
|
||||
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;
|
||||
|
||||
@@ -1271,8 +1271,11 @@ namespace ehs
|
||||
/// @note Use "IsNum" before this if the string object is not guaranteed to be a number.
|
||||
float ToFloat() const
|
||||
{
|
||||
Str<T, N> ide;
|
||||
ide.Push(46);
|
||||
|
||||
N decPoint = size;
|
||||
Find(".", &decPoint);
|
||||
Find(ide, &decPoint);
|
||||
|
||||
float result = 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.
|
||||
double ToDouble() const
|
||||
{
|
||||
Str<T, N> ide;
|
||||
ide.Push(46);
|
||||
|
||||
N decPoint = size;
|
||||
Find(".", &decPoint);
|
||||
Find(ide, &decPoint);
|
||||
|
||||
double result = 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.
|
||||
long double ToLDouble() const
|
||||
{
|
||||
Str<T, N> ide;
|
||||
ide.Push(46);
|
||||
|
||||
N decPoint = size;
|
||||
Find(".", &decPoint);
|
||||
Find(ide, &decPoint);
|
||||
|
||||
long double result = 0.0f;
|
||||
long double fraction = 0.0f;
|
||||
@@ -1679,7 +1688,7 @@ namespace ehs
|
||||
|
||||
Str<T, N> result;
|
||||
if (whole < 0)
|
||||
result += "-";
|
||||
result.Push(45);
|
||||
|
||||
result += Str<T, N>::FromNum(whole);
|
||||
|
||||
@@ -1691,7 +1700,7 @@ namespace ehs
|
||||
if (!fraction)
|
||||
return result;
|
||||
|
||||
result += ".";
|
||||
result.Push(46);
|
||||
|
||||
Str<T, N> fResult(maxDecimals);
|
||||
N i = 0;
|
||||
@@ -1721,7 +1730,7 @@ namespace ehs
|
||||
|
||||
Str<T, N> result;
|
||||
if (whole < 0)
|
||||
result += "-";
|
||||
result.Push(45);
|
||||
|
||||
result += Str<T, N>::FromNum(whole);
|
||||
|
||||
@@ -1733,7 +1742,7 @@ namespace ehs
|
||||
if (!fraction)
|
||||
return result;
|
||||
|
||||
result += ".";
|
||||
result.Push(46);
|
||||
|
||||
Str<T, N> fResult(maxDecimals);
|
||||
N i = 0;
|
||||
@@ -1763,7 +1772,7 @@ namespace ehs
|
||||
|
||||
Str<T, N> result;
|
||||
if (whole < 0)
|
||||
result += "-";
|
||||
result.Push(45);
|
||||
|
||||
result += Str<T, N>::FromNum(whole);
|
||||
|
||||
@@ -1775,7 +1784,7 @@ namespace ehs
|
||||
if (!fraction)
|
||||
return result;
|
||||
|
||||
result += ".";
|
||||
result.Push(46);
|
||||
|
||||
Str<T, N> fResult(maxDecimals);
|
||||
N i = 0;
|
||||
@@ -1888,14 +1897,14 @@ namespace ehs
|
||||
if (aSize != bSize)
|
||||
return false;
|
||||
|
||||
for (UInt_64 i = 0; i < aSize; ++i)
|
||||
if (a[i] != b[i])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return Util::Compare(a, b, aSize);
|
||||
}
|
||||
};
|
||||
|
||||
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_16, UInt_64> Str_16;
|
||||
typedef Str<Char_8, UInt_64> Str_8;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace ehs
|
||||
{
|
||||
typedef void (*TaskCb)(Serializer<UInt_64>*);
|
||||
|
||||
class Task
|
||||
class EHS_LIB_IO Task
|
||||
{
|
||||
private:
|
||||
bool working;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Type
|
||||
class EHS_LIB_IO Type
|
||||
{
|
||||
private:
|
||||
friend class BaseObj;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class URI
|
||||
class EHS_LIB_IO URI
|
||||
{
|
||||
public:
|
||||
/// Encodes specialized characters in the URI.
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace ehs
|
||||
};
|
||||
|
||||
/// A helper class for converting between UTF8, 16 and 32.
|
||||
class UTF
|
||||
class EHS_LIB_IO UTF
|
||||
{
|
||||
public:
|
||||
/// Converts the given UTF16 C-style string into UTF32.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Util
|
||||
class EHS_LIB_IO Util
|
||||
{
|
||||
public:
|
||||
static bool Compare(const void* a, const void* b, UInt_64 size);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
namespace ehs
|
||||
{
|
||||
/// A helper class for storing version major, minor and patch.
|
||||
class Version
|
||||
class EHS_LIB_IO Version
|
||||
{
|
||||
public:
|
||||
UInt_32 major;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Database
|
||||
class EHS_LIB_IO Database
|
||||
{
|
||||
private:
|
||||
UInt_64 hashId;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace ehs
|
||||
{
|
||||
class DbTable;
|
||||
|
||||
class DbObject
|
||||
class EHS_LIB_IO DbObject
|
||||
{
|
||||
private:
|
||||
friend class DbTable;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace ehs
|
||||
{
|
||||
class Database;
|
||||
|
||||
class DbTable
|
||||
class EHS_LIB_IO DbTable
|
||||
{
|
||||
private:
|
||||
friend class Database;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace ehs
|
||||
class DbVarTmpl;
|
||||
class DbObject;
|
||||
|
||||
class DbVar
|
||||
class EHS_LIB_IO DbVar
|
||||
{
|
||||
private:
|
||||
friend class DbObject;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace ehs
|
||||
{
|
||||
class DbVar;
|
||||
|
||||
class DbVarTmpl
|
||||
class EHS_LIB_IO DbVarTmpl
|
||||
{
|
||||
private:
|
||||
friend class DbTable;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class BaseDirectory
|
||||
class EHS_LIB_IO BaseDirectory
|
||||
{
|
||||
public:
|
||||
static Array<Str_8> GetAllFiles(const Str_8 &dir);
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ehs
|
||||
};
|
||||
|
||||
/// A cross-platform wrapper class that handles native file input/output.
|
||||
class BaseFile
|
||||
class EHS_LIB_IO BaseFile
|
||||
{
|
||||
protected:
|
||||
Str_8 path;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class BaseFileMonitor
|
||||
class EHS_LIB_IO BaseFileMonitor
|
||||
{
|
||||
protected:
|
||||
Str_8 filePath;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/EHS.h"
|
||||
#include "ehs/Str.h"
|
||||
#include "ehs/Vec2.h"
|
||||
#include "ehs/Rect.h"
|
||||
#include "ehs/io/hid/Input.h"
|
||||
|
||||
namespace ehs
|
||||
@@ -20,7 +18,7 @@ namespace ehs
|
||||
I_BEAM
|
||||
};
|
||||
|
||||
class BaseWindow
|
||||
class EHS_LIB_IO BaseWindow
|
||||
{
|
||||
protected:
|
||||
bool created;
|
||||
@@ -60,10 +58,6 @@ namespace ehs
|
||||
|
||||
bool HasFocus() const;
|
||||
|
||||
void EnableResizing(bool enable);
|
||||
|
||||
bool IsResizable() const;
|
||||
|
||||
/// Gets the cursors position on the desktop in pixels.
|
||||
/// @param [in] relative Whether the position should be relative to the windows client.
|
||||
/// @returns The current value.
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ehs
|
||||
TWO
|
||||
};
|
||||
|
||||
class COM
|
||||
class EHS_LIB_IO COM
|
||||
{
|
||||
private:
|
||||
UInt_8 port;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ehs
|
||||
typedef int ConsoleHdl;
|
||||
#endif
|
||||
|
||||
class Console
|
||||
class EHS_LIB_IO Console
|
||||
{
|
||||
private:
|
||||
static ConsoleHdl hdlOut;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Directory : public BaseDirectory
|
||||
class EHS_LIB_IO Directory : public BaseDirectory
|
||||
{
|
||||
public:
|
||||
static Array<Str_8> GetAllFiles(const Str_8 &dir);
|
||||
|
||||
16
include/ehs/io/Directory_W32.h
Normal file
16
include/ehs/io/Directory_W32.h
Normal 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);
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class FileMonitor : public BaseFileMonitor
|
||||
class EHS_LIB_IO FileMonitor : public BaseFileMonitor
|
||||
{
|
||||
private:
|
||||
int hdl;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class FileMonitor final : public BaseFileMonitor
|
||||
class EHS_LIB_IO FileMonitor final : public BaseFileMonitor
|
||||
{
|
||||
private:
|
||||
Handle hdl;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class File : public BaseFile
|
||||
class EHS_LIB_IO File : public BaseFile
|
||||
{
|
||||
private:
|
||||
int hdl;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class File : public BaseFile
|
||||
class EHS_LIB_IO File : public BaseFile
|
||||
{
|
||||
private:
|
||||
HANDLE hdl;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class FontAtlas : public BaseObj
|
||||
class EHS_LIB_IO FontAtlas : public BaseObj
|
||||
{
|
||||
private:
|
||||
UInt_64 hashId;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Glyph
|
||||
class EHS_LIB_IO Glyph
|
||||
{
|
||||
private:
|
||||
Char_32 code;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class RIFF
|
||||
class EHS_LIB_IO RIFF
|
||||
{
|
||||
private:
|
||||
Str_8 type;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class RIFF_Chunk
|
||||
class EHS_LIB_IO RIFF_Chunk
|
||||
{
|
||||
private:
|
||||
Str_8 id;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Resource : public BaseObj
|
||||
class EHS_LIB_IO Resource : public BaseObj
|
||||
{
|
||||
private:
|
||||
ehs::UInt_64 hashId;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class UsbBase
|
||||
class EHS_LIB_IO UsbBase
|
||||
{
|
||||
private:
|
||||
UInt_32 bus;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Usb final : public UsbBase
|
||||
class EHS_LIB_IO Usb final : public UsbBase
|
||||
{
|
||||
private:
|
||||
int hdl;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Window : public BaseWindow
|
||||
class EHS_LIB_IO Window : public BaseWindow
|
||||
{
|
||||
private:
|
||||
UInt_32 owner;
|
||||
@@ -71,13 +71,6 @@ namespace ehs
|
||||
|
||||
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.
|
||||
/// @returns The window's native handle.
|
||||
HWND GetHdl() const;
|
||||
|
||||
@@ -4,21 +4,27 @@
|
||||
|
||||
#include <wayland-client.h>
|
||||
#include "xdg-shell-client-protocol.h"
|
||||
#include "xdg-decoration.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Window : public BaseWindow
|
||||
class EHS_LIB_IO Window : public BaseWindow
|
||||
{
|
||||
private:
|
||||
protected:
|
||||
wl_display *display;
|
||||
wl_registry *registry;
|
||||
wl_compositor *compositor;
|
||||
wl_surface* surface;
|
||||
wl_surface *wlSurface;
|
||||
xdg_wm_base *xdgShell;
|
||||
xdg_surface *xdgSurface;
|
||||
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);
|
||||
|
||||
@@ -26,16 +32,32 @@ namespace ehs
|
||||
|
||||
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:
|
||||
~Window() override;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Window : public BaseWindow
|
||||
class EHS_LIB_IO Window : public BaseWindow
|
||||
{
|
||||
protected:
|
||||
friend class Input;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Audio : public Resource
|
||||
class EHS_LIB_IO Audio : public Resource
|
||||
{
|
||||
private:
|
||||
static Array<AudioCodec> codecs;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace ehs
|
||||
{
|
||||
class Audio;
|
||||
|
||||
class AudioCodec
|
||||
class EHS_LIB_IO AudioCodec
|
||||
{
|
||||
private:
|
||||
Str_8 id;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class AudioDevice : public BaseAudioDevice
|
||||
class EHS_LIB_IO AudioDevice : public BaseAudioDevice
|
||||
{
|
||||
private:
|
||||
snd_pcm_t* hdl;
|
||||
|
||||
@@ -12,7 +12,7 @@ struct IMMDevice;
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class AudioDevice : public BaseAudioDevice
|
||||
class EHS_LIB_IO AudioDevice : public BaseAudioDevice
|
||||
{
|
||||
private:
|
||||
IMMDevice* hdl;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace ehs
|
||||
UNPLUGGED = 0x8
|
||||
};
|
||||
|
||||
class BaseAudioDevice
|
||||
class EHS_LIB_IO BaseAudioDevice
|
||||
{
|
||||
protected:
|
||||
AudioDeviceType type;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Button
|
||||
class EHS_LIB_IO Button
|
||||
{
|
||||
private:
|
||||
Str_8 name;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace ehs
|
||||
TOUCHED
|
||||
};
|
||||
|
||||
class ButtonState
|
||||
class EHS_LIB_IO ButtonState
|
||||
{
|
||||
private:
|
||||
Button button;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class HID
|
||||
class EHS_LIB_IO HID
|
||||
{
|
||||
protected:
|
||||
UInt_8 type;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Input
|
||||
class EHS_LIB_IO Input
|
||||
{
|
||||
private:
|
||||
Array<InputHandler*> handlers;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class InputHandler
|
||||
class EHS_LIB_IO InputHandler
|
||||
{
|
||||
private:
|
||||
UInt_64 hashId;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Keyboard : public HID
|
||||
class EHS_LIB_IO Keyboard : public HID
|
||||
{
|
||||
public:
|
||||
Keyboard();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Mouse : public HID
|
||||
class EHS_LIB_IO Mouse : public HID
|
||||
{
|
||||
private:
|
||||
friend class Input;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace ehs
|
||||
NEAREST_NEIGHBOR
|
||||
};
|
||||
|
||||
class Img : public BaseObj
|
||||
class EHS_LIB_IO Img : public BaseObj
|
||||
{
|
||||
private:
|
||||
static Array<ImgCodec> codecs;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ehs
|
||||
typedef bool (*EncodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, const Img*);
|
||||
typedef bool (*DecodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, Img*);
|
||||
|
||||
class ImgCodec
|
||||
class EHS_LIB_IO ImgCodec
|
||||
{
|
||||
private:
|
||||
Str_8 id;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class PNG
|
||||
class EHS_LIB_IO PNG
|
||||
{
|
||||
private:
|
||||
Str_8 id;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class PNG_Chunk
|
||||
class EHS_LIB_IO PNG_Chunk
|
||||
{
|
||||
private:
|
||||
Str_8 id;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class AnimBone
|
||||
class EHS_LIB_IO AnimBone
|
||||
{
|
||||
private:
|
||||
UInt_8 boneId;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Animation
|
||||
class EHS_LIB_IO Animation
|
||||
{
|
||||
private:
|
||||
UInt_64 hashId;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Bone
|
||||
class EHS_LIB_IO Bone
|
||||
{
|
||||
private:
|
||||
UInt_64 hashName;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class KeyFrame
|
||||
class EHS_LIB_IO KeyFrame
|
||||
{
|
||||
private:
|
||||
float num;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ehs
|
||||
EHM
|
||||
};
|
||||
|
||||
class Mdl : public BaseObj
|
||||
class EHS_LIB_IO Mdl : public BaseObj
|
||||
{
|
||||
private:
|
||||
static Array<MdlCodec> codecs;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ehs
|
||||
typedef bool (*EnocdeMdlCb)(const MdlCodec*, Serializer<UInt_64>&, const Mdl*);
|
||||
typedef bool (*DecodeMdlCb)(const MdlCodec*, Serializer<UInt_64>&, Mdl*);
|
||||
|
||||
class MdlCodec
|
||||
class EHS_LIB_IO MdlCodec
|
||||
{
|
||||
private:
|
||||
Str_8 id;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Mesh final : public BaseObj
|
||||
class EHS_LIB_IO Mesh final : public BaseObj
|
||||
{
|
||||
protected:
|
||||
UInt_64 hashId;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ehs
|
||||
INVALID
|
||||
};
|
||||
|
||||
class PropertyChange
|
||||
class EHS_LIB_IO PropertyChange
|
||||
{
|
||||
public:
|
||||
ChangeType type;
|
||||
|
||||
18
include/ehs/io/socket/BaseDNS.h
Normal file
18
include/ehs/io/socket/BaseDNS.h
Normal 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);
|
||||
};
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class BaseTCP
|
||||
class EHS_LIB_IO BaseTCP
|
||||
{
|
||||
protected:
|
||||
AddrType addrType;
|
||||
@@ -146,6 +146,10 @@ namespace ehs
|
||||
/// @returns The result.
|
||||
virtual bool IsBlocking() const = 0;
|
||||
|
||||
virtual void SetIPv6Only(bool value) = 0;
|
||||
|
||||
virtual bool IsIPv6Only() const = 0;
|
||||
|
||||
/// Retrieves whether or not this socket was initialized.
|
||||
/// @returns The result.
|
||||
virtual bool IsValid() const = 0;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class BaseUDP
|
||||
class EHS_LIB_IO BaseUDP
|
||||
{
|
||||
protected:
|
||||
AddrType type;
|
||||
@@ -69,6 +69,10 @@ namespace ehs
|
||||
/// @returns The result.
|
||||
virtual bool IsBlocking() const = 0;
|
||||
|
||||
virtual void SetIPv6Only(bool value) = 0;
|
||||
|
||||
virtual bool IsIPv6Only() const = 0;
|
||||
|
||||
/// Retrieves the bound ip version.
|
||||
/// @returns The result.
|
||||
AddrType GetLocalAddressType() const;
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/EHS.h"
|
||||
#include "ehs/Str.h"
|
||||
#include "Socket.h"
|
||||
#include "ehs/system/OS.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class DNS
|
||||
{
|
||||
public:
|
||||
/// 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);
|
||||
};
|
||||
}
|
||||
#if defined(EHS_OS_WINDOWS)
|
||||
#include "DNS_W32.h"
|
||||
#elif defined(EHS_OS_LINUX)
|
||||
#include "DNS_LNX.h"
|
||||
#endif
|
||||
17
include/ehs/io/socket/DNS_LNX.h
Normal file
17
include/ehs/io/socket/DNS_LNX.h
Normal 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);
|
||||
};
|
||||
}
|
||||
14
include/ehs/io/socket/DNS_W32.h
Normal file
14
include/ehs/io/socket/DNS_W32.h
Normal 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);
|
||||
};
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace ehs
|
||||
DEL
|
||||
};
|
||||
|
||||
class Request
|
||||
class EHS_LIB_IO Request
|
||||
{
|
||||
private:
|
||||
Verb verb;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Response
|
||||
class EHS_LIB_IO Response
|
||||
{
|
||||
private:
|
||||
UInt_32 code;
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct ssl_st SSL;
|
||||
namespace ehs
|
||||
{
|
||||
/// A class for handling the HTTP(S) TCP socket layer.
|
||||
class SSL : public TCP
|
||||
class EHS_LIB_IO SSL : public TCP
|
||||
{
|
||||
private:
|
||||
SSL_CTX* ctx;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace ehs
|
||||
{
|
||||
/// A wrapper class for the transmission control protocol socket.
|
||||
class TCP : public BaseTCP
|
||||
class EHS_LIB_IO TCP : public BaseTCP
|
||||
{
|
||||
protected:
|
||||
Socket hdl;
|
||||
@@ -80,6 +80,10 @@ namespace ehs
|
||||
/// @returns The result.
|
||||
bool IsBlocking() const override;
|
||||
|
||||
void SetIPv6Only(bool value) override;
|
||||
|
||||
bool IsIPv6Only() const override;
|
||||
|
||||
bool IsValid() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace ehs
|
||||
{
|
||||
/// A wrapper class for the transmission control protocol socket.
|
||||
class TCP : public BaseTCP
|
||||
class EHS_LIB_IO TCP : public BaseTCP
|
||||
{
|
||||
protected:
|
||||
Socket hdl;
|
||||
@@ -80,6 +80,10 @@ namespace ehs
|
||||
/// @returns The result.
|
||||
bool IsBlocking() const override;
|
||||
|
||||
void SetIPv6Only(bool value) override;
|
||||
|
||||
bool IsIPv6Only() const override;
|
||||
|
||||
bool IsValid() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace ehs
|
||||
{
|
||||
/// A wrapper class for the user datagram protocol socket.
|
||||
class UDP : public BaseUDP
|
||||
class EHS_LIB_IO UDP : public BaseUDP
|
||||
{
|
||||
private:
|
||||
Socket hdl;
|
||||
@@ -68,6 +68,10 @@ namespace ehs
|
||||
/// @returns The result.
|
||||
bool IsBlocking() const override;
|
||||
|
||||
void SetIPv6Only(bool value) override;
|
||||
|
||||
bool IsIPv6Only() const override;
|
||||
|
||||
bool IsValid() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace ehs
|
||||
{
|
||||
/// A wrapper class for the user datagram protocol socket.
|
||||
class UDP : public BaseUDP
|
||||
class EHS_LIB_IO UDP : public BaseUDP
|
||||
{
|
||||
private:
|
||||
Socket hdl;
|
||||
@@ -68,6 +68,10 @@ namespace ehs
|
||||
/// @returns The result.
|
||||
bool IsBlocking() const override;
|
||||
|
||||
void SetIPv6Only(bool value) override;
|
||||
|
||||
bool IsIPv6Only() const override;
|
||||
|
||||
bool IsValid() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ehs
|
||||
Str_8 id;
|
||||
};
|
||||
|
||||
class Spotify
|
||||
class EHS_LIB_IO Spotify final
|
||||
{
|
||||
private:
|
||||
SSL client;
|
||||
@@ -40,14 +40,14 @@ namespace ehs
|
||||
|
||||
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();
|
||||
|
||||
/// Sets the volume for a device.
|
||||
/// @param [in] level The percentage to set the volume to.
|
||||
/// @returns The response code.
|
||||
UInt_32 SetVolume(const UInt_8 level);
|
||||
UInt_32 SetVolume(UInt_8 level);
|
||||
|
||||
/// Resume playback for a device.
|
||||
/// @returns The response code.
|
||||
@@ -60,12 +60,12 @@ namespace ehs
|
||||
/// Repeats playback for a device.
|
||||
/// @param [in] status The status to set it to.
|
||||
/// @returns The response code.
|
||||
UInt_32 SetRepeat(const SpotifyState state);
|
||||
UInt_32 SetRepeat(SpotifyState state);
|
||||
|
||||
/// Shuffles playback for a device.
|
||||
/// @param [in] state The state to set shuffle to.
|
||||
/// @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);
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace ehs
|
||||
/// Seeks to a position of the currently playing track in milliseconds.
|
||||
/// @param [in] pos The position in milliseconds to seek to.
|
||||
/// @returns The response code.
|
||||
UInt_32 Seek(const UInt_32 pos);
|
||||
UInt_32 Seek(UInt_32 pos);
|
||||
|
||||
Str_8 GetClientId() const;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Twitch
|
||||
class EHS_LIB_IO Twitch
|
||||
{
|
||||
private:
|
||||
SSL client;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class TwitchChat
|
||||
class EHS_LIB_IO TwitchChat
|
||||
{
|
||||
private:
|
||||
TCP client;
|
||||
|
||||
377
include/ehs/io/xdg-decoration.h
Normal file
377
include/ehs/io/xdg-decoration.h
Normal 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
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Json
|
||||
class EHS_LIB_IO Json
|
||||
{
|
||||
private:
|
||||
JsonBase* value;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace ehs
|
||||
class JsonNum;
|
||||
class JsonStr;
|
||||
|
||||
class JsonArray : public JsonBase
|
||||
class EHS_LIB_IO JsonArray : public JsonBase
|
||||
{
|
||||
private:
|
||||
UInt_64 size;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ehs
|
||||
STR
|
||||
};
|
||||
|
||||
class JsonBase
|
||||
class EHS_LIB_IO JsonBase
|
||||
{
|
||||
private:
|
||||
JsonType type;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class JsonBool : public JsonBase
|
||||
class EHS_LIB_IO JsonBool : public JsonBase
|
||||
{
|
||||
public:
|
||||
bool value;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class JsonNum : public JsonBase
|
||||
class EHS_LIB_IO JsonNum : public JsonBase
|
||||
{
|
||||
public:
|
||||
float value;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace ehs
|
||||
{
|
||||
class JsonVar;
|
||||
|
||||
class JsonObj : public JsonBase
|
||||
class EHS_LIB_IO JsonObj : public JsonBase
|
||||
{
|
||||
protected:
|
||||
UInt_64 size;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class JsonStr : public JsonBase
|
||||
class EHS_LIB_IO JsonStr : public JsonBase
|
||||
{
|
||||
public:
|
||||
Str_8 value;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ehs
|
||||
class JsonNum;
|
||||
class JsonStr;
|
||||
|
||||
class JsonVar
|
||||
class EHS_LIB_IO JsonVar
|
||||
{
|
||||
private:
|
||||
UInt_64 hashId;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user