20 #import <Foundation/Foundation.h>
25 Class notificationClass = NSClassFromString(
@"NSUserNotificationCenter");
26 if(notificationClass) {
32 void send_cocoa_notification(
const std::string& owner,
const std::string& message);
34 #pragma clang diagnostic push
35 #pragma clang diagnostic ignored "-Wunused-parameter"
38 Class appleNotificationClass = NSClassFromString(
@"NSUserNotificationCenter");
39 if (appleNotificationClass) {
40 send_cocoa_notification(owner, message);
44 #pragma clang diagnostic pop
46 void send_cocoa_notification(
const std::string& owner,
const std::string& message) {
47 NSString *title = [NSString stringWithCString:owner.c_str() encoding:NSUTF8StringEncoding];
48 NSString *description = [NSString stringWithCString:
message.c_str() encoding:NSUTF8StringEncoding];
54 [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification:
notification];
void send_notification(const std::string &owner, const std::string &message, const desktop::notifications::type note_type)
@ notification
Callbacks with a sender aka notification messages.
struct utils::detail::formula_initer init