Don't force compile everything as Objective-C++ on macOS

This commit is contained in:
Michael Maltese
2016-09-18 17:33:51 -07:00
parent 4c004b6dc9
commit cd19c9fa22
13 changed files with 89 additions and 133 deletions
-4
View File
@@ -12,10 +12,6 @@
#include <wx/stattext.h>
#include <wx/textctrl.h>
#ifdef __APPLE__
#import <AppKit/AppKit.h>
#endif
#include "Common/Common.h"
#include "DolphinWX/AboutDolphin.h"
#include "DolphinWX/WxUtils.h"
-24
View File
@@ -2,10 +2,6 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#ifdef __APPLE__
#include <Cocoa/Cocoa.h>
#endif
#include <atomic>
#include <cstddef>
#include <fstream>
@@ -584,16 +580,6 @@ bool CFrame::RendererIsFullscreen()
fullscreen = m_RenderFrame->IsFullScreen();
}
#if defined(__APPLE__)
if (m_RenderFrame != nullptr)
{
NSView* view = (NSView*)m_RenderFrame->GetHandle();
NSWindow* window = [view window];
fullscreen = (([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);
}
#endif
return fullscreen;
}
@@ -1284,15 +1270,6 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
ToggleDisplayMode(enable_fullscreen);
#if defined(__APPLE__)
NSView* view = (NSView*)m_RenderFrame->GetHandle();
NSWindow* window = [view window];
if (enable_fullscreen != RendererIsFullscreen())
{
[window toggleFullScreen:nil];
}
#else
if (enable_fullscreen)
{
m_RenderFrame->ShowFullScreen(true, wxFULLSCREEN_ALL);
@@ -1303,7 +1280,6 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
// Therefore we don't exit fullscreen from here if we are in exclusive mode.
m_RenderFrame->ShowFullScreen(false, wxFULLSCREEN_ALL);
}
#endif
if (SConfig::GetInstance().bRenderToMain)
{
+2 -12
View File
@@ -21,10 +21,6 @@
#include <wx/toolbar.h>
#include <wx/toplevel.h>
#ifdef __APPLE__
#include <AppKit/AppKit.h>
#endif
#include "Common/CDUtils.h"
#include "Common/CommonTypes.h"
#include "Common/FileSearch.h"
@@ -1014,10 +1010,7 @@ void CFrame::StartGame(const std::string& filename)
}
#if defined(__APPLE__)
NSView* view = (NSView*)m_RenderFrame->GetHandle();
NSWindow* window = [view window];
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
m_RenderFrame->EnableFullScreenView(true);
#endif
wxBeginBusyCursor();
@@ -1233,10 +1226,7 @@ void CFrame::OnStopped()
{
#if defined(__APPLE__)
// Disable the full screen button when not in a game.
NSView* view = (NSView*)m_RenderFrame->GetHandle();
NSWindow* window = [view window];
[window setCollectionBehavior:NSWindowCollectionBehaviorDefault];
m_RenderFrame->EnableFullScreenView(false);
#endif
// Make sure the window is not longer set to stay on top
+4 -8
View File
@@ -2,10 +2,6 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#ifdef __APPLE__
#import <Cocoa/Cocoa.h>
#endif
#include <cinttypes>
#include <cstddef>
#include <cstdio>
@@ -1235,9 +1231,9 @@ bool CISOProperties::SaveGameConfig()
void CISOProperties::LaunchExternalEditor(const std::string& filename, bool wait_until_closed)
{
#ifdef __APPLE__
// wxTheMimeTypesManager is not yet implemented for wxCocoa
[[NSWorkspace sharedWorkspace] openFile:[NSString stringWithUTF8String:filename.c_str()]
withApplication:@"TextEdit"];
// GetOpenCommand does not work for wxCocoa
const char* OpenCommandConst[] = {"open", "-a", "TextEdit", filename.c_str(), NULL};
char** OpenCommand = const_cast<char**>(OpenCommandConst);
#else
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension("ini");
if (filetype == nullptr) // From extension failed, trying with MIME type now
@@ -1256,6 +1252,7 @@ void CISOProperties::LaunchExternalEditor(const std::string& filename, bool wait
WxUtils::ShowErrorDialog(_("Couldn't find open command for extension 'ini'!"));
return;
}
#endif
long result;
@@ -1269,7 +1266,6 @@ void CISOProperties::LaunchExternalEditor(const std::string& filename, bool wait
WxUtils::ShowErrorDialog(_("wxExecute returned -1 on application run!"));
return;
}
#endif
}
void CISOProperties::GenerateLocalIniModified()
-4
View File
@@ -70,10 +70,6 @@
#endif
#ifdef __APPLE__
#import <AppKit/AppKit.h>
#endif
class wxFrame;
// ------------
-4
View File
@@ -17,10 +17,6 @@
#include "DolphinWX/WxUtils.h"
#ifdef __APPLE__
#import <AppKit/AppKit.h>
#endif
namespace WxUtils
{
// Launch a file according to its mime type