Ignore:
Timestamp:
Jul 13, 2018 6:30:16 AM (23 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
818e70d
Parents:
21b3864
Message:

Fixed a load of issues related to my "sync" approach, and Mac OSX's "async" API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/obj-cpp/AppDelegate.h

    r21b3864 r6d0f80f  
    1010#include "StatusItemButton.h"
    1111#include "JavaHelper.h"
     12#include "RouterTask.h"
     13#include "neither/maybe.hpp"
     14#include "optional.hpp"
     15#include "subprocess.hpp"
     16#include <glob.h>
     17#include <vector>
     18
     19using namespace neither;
    1220
    1321extern JvmListSharedPtr gRawJvmList;
     22
     23// DO NOT ACCESS THIS GLOBAL VARIABLE DIRECTLY.
     24maybeAnRouterRunner globalRouterStatus = maybeAnRouterRunner{};
     25
     26maybeAnRouterRunner getGlobalRouterObject()
     27{
     28    std::lock_guard<std::mutex> lock(globalRouterStatusMutex);
     29    return globalRouterStatus;
     30}
     31
     32void setGlobalRouterObject(RouterTask* newRouter)
     33{
     34    std::lock_guard<std::mutex> lock(globalRouterStatusMutex);
     35    globalRouterStatus.emplace(newRouter);
     36}
     37
     38
     39
     40std::vector<std::string> globVector(const std::string& pattern){
     41    glob_t glob_result;
     42    glob(pattern.c_str(),GLOB_TILDE,NULL,&glob_result);
     43    std::vector<std::string> files;
     44    for(unsigned int i=0;i<glob_result.gl_pathc;++i){
     45        files.push_back(std::string(glob_result.gl_pathv[i]));
     46    }
     47    globfree(&glob_result);
     48    return files;
     49}
    1450
    1551@interface MenuBarCtrl : NSObject <StatusItemButtonDelegate, NSMenuDelegate>
     
    5692- (AppDelegate *)initWithArgc:(int)argc argv:(const char **)argv;
    5793- (NSString *)userSelectJavaHome:(JvmListPtr)rawJvmList;
     94- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center
     95                               shouldPresentNotification:(NSUserNotification *)notification;
    5896@end
    5997
Note: See TracChangeset for help on using the changeset viewer.