Fix macos build

This commit is contained in:
Jonas Kvinge
2019-01-02 00:32:36 +01:00
parent 45c4be3ae9
commit d398018633
9 changed files with 65 additions and 64 deletions

View File

@@ -1,7 +1,7 @@
#import <AppKit/NSApplication.h>
#include "config.h"
#include "globalshortcuts/macglobalshortcutbackend.h"
#include "globalshortcuts/globalshortcutbackend-macos.h"
class PlatformInterface;
@class SPMediaKeyTap;
@@ -9,7 +9,7 @@ class PlatformInterface;
@interface AppDelegate : NSObject<NSApplicationDelegate, NSUserNotificationCenterDelegate> {
PlatformInterface* application_handler_;
NSMenu* dock_menu_;
MacGlobalShortcutBackend* shortcut_handler_;
GlobalShortcutBackendMacOS* shortcut_handler_;
SPMediaKeyTap* key_tap_;
}
@@ -27,7 +27,7 @@ class PlatformInterface;
shouldPresentNotification: (id)notification;
- (void) setDockMenu: (NSMenu*)menu;
- (MacGlobalShortcutBackend*) shortcut_handler;
- (void) setShortcutHandler: (MacGlobalShortcutBackend*)backend;
- (GlobalShortcutBackendMacOS*) shortcut_handler;
- (void) setShortcutHandler: (GlobalShortcutBackendMacOS*)backend;
- (void) mediaKeyTap: (SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
@end

View File

@@ -9,7 +9,7 @@
class QObject;
class QWidget;
class MacGlobalShortcutBackend;
class GlobalShortcutBackendMacOS;
class PlatformInterface {
public:
@@ -23,7 +23,7 @@ class PlatformInterface {
namespace mac {
void MacMain();
void SetShortcutHandler(MacGlobalShortcutBackend *handler);
void SetShortcutHandler(GlobalShortcutBackendMacOS *handler);
void SetApplicationHandler(PlatformInterface *handler);
void CheckForUpdates();

View File

@@ -51,7 +51,7 @@
#include "core/logging.h"
#include "core/scoped_nsautorelease_pool.h"
#include "globalshortcuts/globalshortcuts.h"
#include "globalshortcuts/macglobalshortcutbackend.h"
#include "globalshortcuts/globalshortcutbackend-macos.h"
#ifdef HAVE_SPARKLE
# import <Sparkle/SUUpdater.h>
@@ -80,11 +80,11 @@ QDebug operator<<(QDebug dbg, NSObject* object) {
PlatformInterface* application_handler_;
AppDelegate* delegate_;
// shortcut_handler_ only used to temporarily save it AppDelegate does all the heavy-shortcut-lifting
MacGlobalShortcutBackend* shortcut_handler_;
GlobalShortcutBackendMacOS* shortcut_handler_;
}
- (MacGlobalShortcutBackend*)shortcut_handler;
- (void)SetShortcutHandler:(MacGlobalShortcutBackend*)handler;
- (GlobalShortcutBackendMacOS*)shortcut_handler;
- (void)SetShortcutHandler:(GlobalShortcutBackendMacOS*)handler;
- (PlatformInterface*)application_handler;
- (void)SetApplicationHandler:(PlatformInterface*)handler;
@@ -147,11 +147,11 @@ static BreakpadRef InitBreakpad() {
return dock_menu_;
}
- (void)setShortcutHandler:(MacGlobalShortcutBackend*)backend {
- (void)setShortcutHandler:(GlobalShortcutBackendMacOS*)backend {
shortcut_handler_ = backend;
}
- (MacGlobalShortcutBackend*)shortcut_handler {
- (GlobalShortcutBackendMacOS*)shortcut_handler {
return shortcut_handler_;
}
@@ -227,12 +227,12 @@ static BreakpadRef InitBreakpad() {
return self;
}
- (MacGlobalShortcutBackend*)shortcut_handler {
- (GlobalShortcutBackendMacOS*)shortcut_handler {
// should be the same as delegate_'s shortcut handler
return shortcut_handler_;
}
- (void)SetShortcutHandler:(MacGlobalShortcutBackend*)handler {
- (void)SetShortcutHandler:(GlobalShortcutBackendMacOS*)handler {
shortcut_handler_ = handler;
if (delegate_) [delegate_ setShortcutHandler:handler];
}
@@ -277,7 +277,7 @@ void MacMain() {
#endif
}
void SetShortcutHandler(MacGlobalShortcutBackend* handler) {
void SetShortcutHandler(GlobalShortcutBackendMacOS* handler) {
[NSApp SetShortcutHandler:handler];
}