Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorton06 committed May 20, 2024
1 parent 936a62a commit c515468
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Lumos/Source/Lumos/Core/OS/OS.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ namespace Lumos
// Needed for MaxOS
virtual void MaximiseWindow() { }

virtual void OpenFileLocation(const std::filesystem::path& path) { }
virtual void OpenFileExternal(const std::filesystem::path& path) { }
virtual void OpenFileLocation(const std::string& path) { }
virtual void OpenFileExternal(const std::string& path) { }
virtual void OpenURL(const std::string& url) { }

protected:
Expand Down
7 changes: 1 addition & 6 deletions Lumos/Source/Lumos/Platform/GLFW/GLFWWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@

#include "GLFWKeyCodes.h"

#if __has_include(<filesystem>)
#include <filesystem>
#elif __has_include(<experimental/filesystem>)
#include <experimental/filesystem>
#endif
#include "Core/OS/OS.h"
#include "Core/OS/Input.h"
#include "Core/Application.h"
Expand Down Expand Up @@ -225,7 +220,7 @@ namespace Lumos
data.Exit = true; });

glfwSetWindowFocusCallback(m_Handle, [](GLFWwindow* window, int focused)
{
{
Window* lmWindow = Application::Get().GetWindow();

if(lmWindow)
Expand Down
8 changes: 4 additions & 4 deletions Lumos/Source/Lumos/Platform/Unix/UnixOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ namespace Lumos
}
}

void UnixOS::OpenFileLocation(const std::filesystem::path& path)
void UnixOS::OpenFileLocation(const std::string& path)
{
#ifndef LUMOS_PLATFORM_MOBILE
std::string command = "open -R " + path.string();
std::string command = "open -R " + path;
std::system(command.c_str());
#endif
}

void UnixOS::OpenFileExternal(const std::filesystem::path& path)
void UnixOS::OpenFileExternal(const std::string& path)
{
#ifndef LUMOS_PLATFORM_MOBILE
std::string command = "open " + path.string();
std::string command = "open " + path;
std::system(command.c_str());
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions Lumos/Source/Lumos/Platform/Unix/UnixOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Lumos
void Run() override;
void Delay(uint32_t usec) override;

void OpenFileLocation(const std::filesystem::path& path) override;
void OpenFileExternal(const std::filesystem::path& path) override;
void OpenFileLocation(const std::string& path) override;
void OpenFileExternal(const std::string& path) override;
void OpenURL(const std::string& url) override;

std::string GetExecutablePath() override
Expand Down
10 changes: 5 additions & 5 deletions Lumos/Source/Lumos/Platform/Windows/WindowsOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#endif

#include <filesystem>

#include <shellapi.h>
#include <dwmapi.h>
#include <winuser.h>
Expand Down Expand Up @@ -86,14 +85,15 @@ namespace Lumos
return convertedString;
}

void WindowsOS::OpenFileLocation(const std::filesystem::path& path)
void WindowsOS::OpenFileLocation(const std::string& path)
{
ShellExecuteA(NULL, "open", std::filesystem::is_directory(path) ? path.string().c_str() : path.parent_path().string().c_str(), NULL, NULL, SW_SHOWNORMAL);
std::filesystem::path fsPath = path;
ShellExecuteA(NULL, "open", std::filesystem::is_directory(fsPath) ? path.c_str() : fsPath.parent_path().string().c_str(), NULL, NULL, SW_SHOWNORMAL);
}

void WindowsOS::OpenFileExternal(const std::filesystem::path& path)
void WindowsOS::OpenFileExternal(const std::string& path)
{
ShellExecuteA(NULL, "open", path.string().c_str(), NULL, NULL, SW_SHOWNORMAL);
ShellExecuteA(NULL, "open", path.c_str(), NULL, NULL, SW_SHOWNORMAL);
}

void WindowsOS::OpenURL(const std::string& url)
Expand Down
6 changes: 3 additions & 3 deletions Lumos/Source/Lumos/Platform/Windows/WindowsOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ namespace Lumos
void Run() override;
std::string GetExecutablePath() override;

void OpenFileLocation(const std::filesystem::path& path) override;
void OpenFileExternal(const std::filesystem::path& path) override;
void OpenFileLocation(const std::string& path) override;
void OpenFileExternal(const std::string& path) override;
void OpenURL(const std::string& url) override;

void SetTitleBarColour(const glm::vec4& colour, bool dark = true) override;
};
}
}

0 comments on commit c515468

Please sign in to comment.