2023-06-27 15:53:29 +08:00
|
|
|
/*
|
|
|
|
_ __ _ __
|
|
|
|
| | / /___ _(_) /____
|
|
|
|
| | /| / / __ `/ / / ___/
|
|
|
|
| |/ |/ / /_/ / / (__ )
|
|
|
|
|__/|__/\__,_/_/_/____/
|
|
|
|
The electron alternative for Go
|
|
|
|
(c) Lea Anthony 2019-present
|
|
|
|
*/
|
|
|
|
|
|
|
|
export function LogPrint(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogPrint(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function LogTrace(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogTrace(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function LogDebug(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogDebug(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function LogInfo(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogInfo(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function LogWarning(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogWarning(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function LogError(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogError(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function LogFatal(message) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.LogFatal(message);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function EventsOnMultiple(eventName, callback, maxCallbacks) {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function EventsOn(eventName, callback) {
|
2023-07-17 10:49:53 +08:00
|
|
|
return EventsOnMultiple(eventName, callback, -1);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function EventsOff(eventName, ...additionalEventNames) {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.EventsOff(eventName, ...additionalEventNames);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function EventsOnce(eventName, callback) {
|
2023-07-17 10:49:53 +08:00
|
|
|
return EventsOnMultiple(eventName, callback, 1);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function EventsEmit(eventName) {
|
2023-07-17 10:49:53 +08:00
|
|
|
let args = [eventName].slice.call(arguments);
|
|
|
|
return window.runtime.EventsEmit.apply(null, args);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowReload() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowReload();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowReloadApp() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowReloadApp();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetAlwaysOnTop(b) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetAlwaysOnTop(b);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetSystemDefaultTheme() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetSystemDefaultTheme();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetLightTheme() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetLightTheme();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetDarkTheme() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetDarkTheme();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowCenter() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowCenter();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetTitle(title) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetTitle(title);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowFullscreen() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowFullscreen();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowUnfullscreen() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowUnfullscreen();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowIsFullscreen() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.WindowIsFullscreen();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowGetSize() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.WindowGetSize();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetSize(width, height) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetSize(width, height);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetMaxSize(width, height) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetMaxSize(width, height);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetMinSize(width, height) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetMinSize(width, height);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetPosition(x, y) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetPosition(x, y);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowGetPosition() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.WindowGetPosition();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowHide() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowHide();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowShow() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowShow();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowMaximise() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowMaximise();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowToggleMaximise() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowToggleMaximise();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowUnmaximise() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowUnmaximise();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowIsMaximised() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.WindowIsMaximised();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowMinimise() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowMinimise();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowUnminimise() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowUnminimise();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowSetBackgroundColour(R, G, B, A) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.WindowSetBackgroundColour(R, G, B, A);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function ScreenGetAll() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.ScreenGetAll();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowIsMinimised() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.WindowIsMinimised();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function WindowIsNormal() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.WindowIsNormal();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function BrowserOpenURL(url) {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.BrowserOpenURL(url);
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function Environment() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.Environment();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function Quit() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.Quit();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function Hide() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.Hide();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function Show() {
|
2023-07-17 10:49:53 +08:00
|
|
|
window.runtime.Show();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function ClipboardGetText() {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.ClipboardGetText();
|
2023-06-27 15:53:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function ClipboardSetText(text) {
|
2023-07-17 10:49:53 +08:00
|
|
|
return window.runtime.ClipboardSetText(text);
|
|
|
|
}
|