2020-04-14 15:53:53 +00:00
|
|
|
#import <engine/client/notifications.h>
|
|
|
|
|
2017-07-26 02:30:56 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <Foundation/NSUserNotification.h>
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2020-04-14 15:53:53 +00:00
|
|
|
void NotificationsInit()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void NotificationsUninit()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void NotificationsNotify(const char *pTitle, const char *pMessage)
|
2017-07-26 02:30:56 +00:00
|
|
|
{
|
|
|
|
NSString* pNsTitle = [NSString stringWithCString:pTitle encoding:NSUTF8StringEncoding];
|
2020-04-14 15:53:53 +00:00
|
|
|
NSString* pNsMsg = [NSString stringWithCString:pMessage encoding:NSUTF8StringEncoding];
|
2017-07-26 02:30:56 +00:00
|
|
|
|
|
|
|
NSUserNotification *pNotification = [[NSUserNotification alloc] autorelease];
|
|
|
|
pNotification.title = pNsTitle;
|
|
|
|
pNotification.informativeText = pNsMsg;
|
|
|
|
pNotification.soundName = NSUserNotificationDefaultSoundName;
|
|
|
|
|
|
|
|
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:pNotification];
|
|
|
|
|
|
|
|
[NSApp requestUserAttention:NSInformationalRequest]; // use NSCriticalRequest to annoy the user (doesn't stop bouncing)
|
|
|
|
}
|