yolobs-studio/UI/frontend-plugins/frontend-tools/auto-scene-switcher-osx.mm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
892 B
Text
Raw Normal View History

2016-10-10 19:01:40 +00:00
#import <AppKit/AppKit.h>
#include <util/platform.h>
#include "auto-scene-switcher.hpp"
using namespace std;
void GetWindowList(vector<string> &windows)
{
windows.resize(0);
@autoreleasepool {
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
NSArray *array = [ws runningApplications];
for (NSRunningApplication *app in array) {
NSString *name = app.localizedName;
if (!name)
continue;
const char *str = name.UTF8String;
if (str && *str)
windows.emplace_back(str);
}
}
}
void GetCurrentWindowTitle(string &title)
{
title.resize(0);
@autoreleasepool {
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
NSRunningApplication *app = [ws frontmostApplication];
if (app) {
NSString *name = app.localizedName;
if (!name)
return;
const char *str = name.UTF8String;
if (str && *str)
title = str;
}
}
}
2020-10-01 20:15:25 +00:00
void CleanupSceneSwitcher() {}