2018-09-19 17:00:17 +00:00
|
|
|
//
|
|
|
|
// SBridge.m
|
|
|
|
// I2PLauncher
|
|
|
|
//
|
|
|
|
// Created by Mikal Villa on 18/09/2018.
|
|
|
|
// Copyright © 2018 The I2P Project. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "SBridge.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
|
|
|
#include <glob.h>
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <future>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#import <AppKit/AppKit.h>
|
|
|
|
#import "I2PLauncher-Swift.h"
|
2018-09-30 09:40:43 +00:00
|
|
|
#include "LoggerWorker.hpp"
|
|
|
|
#include "Logger.h"
|
|
|
|
#include "logger_c.h"
|
2018-09-19 17:00:17 +00:00
|
|
|
|
|
|
|
#include "AppDelegate.h"
|
2019-05-02 19:30:56 +00:00
|
|
|
// TODO: Configure the project to avoid such includes.
|
|
|
|
#include "../include/fn.h"
|
2018-09-19 17:00:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
@implementation SBridge
|
|
|
|
|
2018-09-22 22:13:40 +00:00
|
|
|
// this makes it a singleton
|
|
|
|
+ (instancetype)sharedInstance {
|
|
|
|
static SBridge *sharedInstance = nil;
|
|
|
|
static dispatch_once_t onceToken;
|
|
|
|
|
|
|
|
dispatch_once(&onceToken, ^{
|
|
|
|
sharedInstance = [[SBridge alloc] init];
|
|
|
|
});
|
|
|
|
return sharedInstance;
|
|
|
|
}
|
2018-09-19 17:00:17 +00:00
|
|
|
|
2018-12-08 09:14:33 +00:00
|
|
|
+ (void) sendUserNotification:(NSString*)title formattedMsg:(NSString*)formattedMsg
|
|
|
|
{
|
|
|
|
sendUserNotification(title, formattedMsg);
|
|
|
|
}
|
|
|
|
|
2018-09-19 17:00:17 +00:00
|
|
|
- (void) openUrl:(NSString*)url
|
|
|
|
{
|
|
|
|
osx::openUrl(url);
|
|
|
|
}
|
|
|
|
|
2018-10-11 16:58:20 +00:00
|
|
|
+ (void) logProxy:(int)level formattedMsg:(NSString*)formattedMsg
|
|
|
|
{
|
|
|
|
MLog(level, formattedMsg);
|
|
|
|
}
|
2018-09-19 17:00:17 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|