mirror of https://github.com/Alia5/GlosSI
Add traypp-patch and prebuild script
parent
895694fda2
commit
75e03a5320
@ -0,0 +1,11 @@
|
||||
git submodule init
|
||||
git submodule update --recursive
|
||||
|
||||
cmd.exe /c buildSFML.bat
|
||||
cmd.exe /c buildViGEmClient.bat
|
||||
|
||||
cd deps/traypp
|
||||
|
||||
git apply ../../traypp_unicode.patch
|
||||
|
||||
cd ../../
|
@ -0,0 +1,79 @@
|
||||
diff --git a/tray/include/core/windows/tray.hpp b/tray/include/core/windows/tray.hpp
|
||||
index ab5949922b41c519a6632544286811f379f36392..6f658feda1aae2c1770648b3bffc3af201672fe6 100755
|
||||
--- a/tray/include/core/windows/tray.hpp
|
||||
+++ b/tray/include/core/windows/tray.hpp
|
||||
@@ -11,7 +11,7 @@ namespace Tray
|
||||
{
|
||||
HWND hwnd = nullptr;
|
||||
HMENU menu = nullptr;
|
||||
- WNDCLASSEX windowClass;
|
||||
+ WNDCLASSEXA windowClass;
|
||||
NOTIFYICONDATA notifyData;
|
||||
|
||||
std::vector<std::shared_ptr<char[]>> allocations;
|
||||
diff --git a/tray/src/core/windows/image.cpp b/tray/src/core/windows/image.cpp
|
||||
index 75a7868350bd1069521345826163eb9275607277..1ecb1de7edaeaff871426238862531dcf4015a76 100755
|
||||
--- a/tray/src/core/windows/image.cpp
|
||||
+++ b/tray/src/core/windows/image.cpp
|
||||
@@ -5,7 +5,7 @@
|
||||
Tray::Image::Image(HBITMAP image) : image(image) {}
|
||||
Tray::Image::Image(const char *path) : Image(std::string(path)) {}
|
||||
Tray::Image::Image(const std::string &path)
|
||||
- : image(reinterpret_cast<HBITMAP>(LoadImage(nullptr, path.c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)))
|
||||
+ : image(reinterpret_cast<HBITMAP>(LoadImageA(nullptr, path.c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)))
|
||||
{
|
||||
if (image == nullptr)
|
||||
{
|
||||
diff --git a/tray/src/core/windows/tray.cpp b/tray/src/core/windows/tray.cpp
|
||||
index 38111083207e3e9512f24749360172b995cf2bb0..089fdc56fab1c9d6bdd60b4b93158ecdf22e5bf6 100755
|
||||
--- a/tray/src/core/windows/tray.cpp
|
||||
+++ b/tray/src/core/windows/tray.cpp
|
||||
@@ -23,14 +23,14 @@ Tray::Tray::Tray(std::string identifier, Icon icon) : BaseTray(std::move(identif
|
||||
windowClass.lpszClassName = this->identifier.c_str();
|
||||
windowClass.hInstance = GetModuleHandle(nullptr);
|
||||
|
||||
- if (RegisterClassEx(&windowClass) == 0)
|
||||
+ if (RegisterClassExA(&windowClass) == 0)
|
||||
{
|
||||
throw std::runtime_error("Failed to register class");
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE
|
||||
- hwnd = CreateWindow(this->identifier.c_str(), nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, windowClass.hInstance,
|
||||
- nullptr);
|
||||
+ hwnd = CreateWindowA(this->identifier.c_str(), nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, windowClass.hInstance,
|
||||
+ nullptr);
|
||||
if (hwnd == nullptr)
|
||||
{
|
||||
throw std::runtime_error("Failed to create window");
|
||||
@@ -64,7 +64,7 @@ void Tray::Tray::exit()
|
||||
DestroyIcon(notifyData.hIcon);
|
||||
DestroyMenu(menu);
|
||||
|
||||
- UnregisterClass(identifier.c_str(), GetModuleHandle(nullptr));
|
||||
+ UnregisterClassA(identifier.c_str(), GetModuleHandle(nullptr));
|
||||
PostMessage(hwnd, WM_QUIT, 0, 0);
|
||||
allocations.clear();
|
||||
|
||||
@@ -98,10 +98,10 @@ HMENU Tray::Tray::construct(const std::vector<std::shared_ptr<TrayEntry>> &entri
|
||||
auto *item = entry.get();
|
||||
|
||||
auto name = std::shared_ptr<char[]>(new char[item->getText().size() + 1]);
|
||||
- strcpy(name.get(), item->getText().c_str()); // NOLINT
|
||||
+ strcpy_s(name.get(), strlen(name.get()), item->getText().c_str()); // NOLINT
|
||||
parent->allocations.emplace_back(name);
|
||||
|
||||
- MENUITEMINFO winItem{0};
|
||||
+ MENUITEMINFOA winItem{0};
|
||||
|
||||
winItem.wID = ++id;
|
||||
winItem.dwTypeData = name.get();
|
||||
@@ -158,7 +158,7 @@ HMENU Tray::Tray::construct(const std::vector<std::shared_ptr<TrayEntry>> &entri
|
||||
}
|
||||
}
|
||||
|
||||
- InsertMenuItem(menu, id, TRUE, &winItem);
|
||||
+ InsertMenuItemA(menu, id, TRUE, &winItem);
|
||||
}
|
||||
|
||||
return menu;
|
Loading…
Reference in New Issue