Initial macOS port bringup (#52)

This commit is contained in:
Marcin Chojnacki 2022-08-26 04:03:26 +02:00 committed by GitHub
parent a2abffd37b
commit 974edaa649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 157 additions and 122 deletions

View file

@ -150,7 +150,7 @@ bool CemuApp::OnInit()
int CemuApp::OnExit()
{
wxApp::OnExit();
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
ExitProcess(0);
#else
exit(0);
@ -306,7 +306,7 @@ void CemuApp::CreateDefaultFiles(bool first_start)
std::stringstream errorMsg;
errorMsg << fmt::format(_("Couldn't create a required mlc01 subfolder or file!\n\nError: {0}\nTarget path:\n{1}").ToStdString(), ex.what(), boost::nowide::narrow(mlc));
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
const DWORD lastError = GetLastError();
if (lastError != ERROR_SUCCESS)
errorMsg << fmt::format("\n\n{}", GetSystemErrorMessage(lastError));
@ -332,7 +332,7 @@ void CemuApp::CreateDefaultFiles(bool first_start)
std::stringstream errorMsg;
errorMsg << fmt::format(_("Couldn't create a required cemu directory or file!\n\nError: {0}").ToStdString(), ex.what());
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
const DWORD lastError = GetLastError();
if (lastError != ERROR_SUCCESS)
errorMsg << fmt::format("\n\n{}", GetSystemErrorMessage(lastError));

View file

@ -515,7 +515,7 @@ void CemuUpdateWindow::OnClose(wxCloseEvent& event)
{
event.Skip();
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
if (m_restart_required && !m_restart_file.empty() && fs::exists(m_restart_file))
{
PROCESS_INFORMATION pi{};

View file

@ -11,8 +11,8 @@
#include "gui/helpers/wxHelpers.h"
#include "input/InputManager.h"
#if BOOST_OS_LINUX
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
GameProfileWindow::GameProfileWindow(wxWindow* parent, uint64_t title_id)

View file

@ -16,7 +16,7 @@
#include "config/CemuConfig.h"
#include "audio/IAudioAPI.h"
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
#include "audio/DirectSoundAPI.h"
#include "audio/XAudio27API.h"
#endif
@ -31,7 +31,7 @@
#include "gui/dialogs/CreateAccount/wxCreateAccountDialog.h"
#include "config/PermanentStorage.h"
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
#include <VersionHelpers.h>
#endif
@ -39,8 +39,8 @@
#include "config/ActiveSettings.h"
#include "gui/helpers/wxHelpers.h"
#if BOOST_OS_LINUX > 0
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
#include "Cafe/CafeSystem.h"
@ -649,7 +649,7 @@ wxPanel* GeneralSettings2::AddAccountPage(wxNotebook* notebook)
{
m_account_information = new wxCollapsiblePane(online_panel, wxID_ANY, _("Account information"));
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
m_account_information->GetControlWidget()->SetBackgroundColour(*wxWHITE);
#endif
auto win = m_account_information->GetPane();
@ -1063,7 +1063,7 @@ void GeneralSettings2::ResetAccountInformation()
// refresh pane size
m_account_information->InvalidateBestSize();
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
m_account_information->OnStateChange(GetBestSize());
#endif
}

View file

@ -15,8 +15,8 @@
#include "Cafe/TitleList/TitleList.h"
#if BOOST_OS_LINUX > 0
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
#include "wxHelper.h"

View file

@ -10,8 +10,8 @@
#include "Cafe/CafeSystem.h"
#include "Cafe/TitleList/TitleList.h"
#if BOOST_OS_LINUX > 0
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
// main.cpp

View file

@ -50,12 +50,12 @@
#include "gui/input/InputSettings2.h"
#include "input/InputManager.h"
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
#define exit(__c) ExitProcess(__c)
#endif
#if BOOST_OS_LINUX > 0
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
#include "Cafe/TitleList/TitleInfo.h"
@ -296,7 +296,7 @@ MainWindow::MainWindow()
SetClientSize(1280, 720);
SetIcon(wxICON(M_WND_ICON128));
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
HICON hWindowIcon = (HICON)LoadImageA(NULL, "M_WND_ICON16", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
SendMessage(this->GetHWND(), WM_SETICON, ICON_SMALL, (LPARAM)hWindowIcon);
#endif
@ -650,7 +650,7 @@ void MainWindow::OnInstallUpdate(wxCommandEvent& event)
break;
if (modalChoice == wxID_OK)
{
#if BOOST_OS_LINUX
#if BOOST_OS_LINUX || BOOST_OS_MACOS
fs::path dirPath((const char*)(openDirDialog.GetPath().fn_str()));
#else
fs::path dirPath(openDirDialog.GetPath().fn_str());

View file

@ -13,8 +13,8 @@
#include "gui/helpers/wxHelpers.h"
#include "input/InputManager.h"
#if BOOST_OS_LINUX
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
#include "wxHelper.h"

View file

@ -42,8 +42,8 @@
#include "Cafe/TitleList/TitleList.h"
#if BOOST_OS_LINUX
#include "resource/linux/resources.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#include "resource/embedded/resources.h"
#endif
#include "Cafe/TitleList/SaveList.h"

View file

@ -20,7 +20,7 @@
#include "util/helpers/helpers.h"
#if BOOST_OS_LINUX
#include "resource/linux/resources.h"
#include "resource/embedded/resources.h"
#endif
enum

View file

@ -159,9 +159,9 @@ typedef void GdkDisplay;
void gui_initHandleContextFromWxWidgetsWindow(WindowHandleInfo& handleInfoOut, class wxWindow* wxw)
{
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
handleInfoOut.hwnd = wxw->GetHWND();
#else
#elif BOOST_OS_LINUX
/* dynamically retrieve GTK imports so we dont have to include and link the whole lib */
void (*dyn_gtk_widget_realize)(GtkWidget *widget);
dyn_gtk_widget_realize = (void(*)(GtkWidget* widget))dlsym(RTLD_NEXT, "gtk_widget_realize");

View file

@ -2,7 +2,7 @@
#include <atomic>
#if BOOST_OS_LINUX > 0
#if BOOST_OS_LINUX
#include "xcb/xproto.h"
#endif

View file

@ -30,7 +30,7 @@
#include "util/EventService.h"
#if BOOST_OS_LINUX
#include "resource/linux/resources.h"
#include "resource/embedded/resources.h"
#endif
bool g_inputConfigWindowHasFocus = false;