2021-06-06 01:26:18 +00:00
|
|
|
/**
|
|
|
|
* Looking Glass
|
2023-10-20 04:36:34 +00:00
|
|
|
* Copyright © 2017-2023 The Looking Glass Authors
|
2021-06-06 01:26:18 +00:00
|
|
|
* https://looking-glass.io
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
|
|
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2019-02-28 05:35:30 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-02-28 08:20:35 +00:00
|
|
|
#include <stdbool.h>
|
2022-01-05 10:04:57 +00:00
|
|
|
#include "common/KVMFR.h"
|
2019-02-28 05:35:30 +00:00
|
|
|
|
2021-01-21 04:07:19 +00:00
|
|
|
// exit code for user opted to exit looking-glass-host
|
2021-01-21 04:24:02 +00:00
|
|
|
#define LG_HOST_EXIT_USER 0x10
|
2021-01-21 04:07:19 +00:00
|
|
|
// exit code for capture errors that should result in a restart, e.g. UAC
|
2021-01-21 04:24:02 +00:00
|
|
|
#define LG_HOST_EXIT_CAPTURE 0x20
|
2021-01-21 04:07:19 +00:00
|
|
|
// exit code for terminated
|
2021-01-21 04:24:02 +00:00
|
|
|
#define LG_HOST_EXIT_KILLED 0x30
|
2021-01-21 04:07:19 +00:00
|
|
|
// exit code for failed to start
|
2021-01-21 04:24:02 +00:00
|
|
|
#define LG_HOST_EXIT_FAILED 0x40
|
2021-03-18 23:05:51 +00:00
|
|
|
// exit code for failed to start, and no amount of restarting could help
|
|
|
|
#define LG_HOST_EXIT_FATAL 0x50
|
2021-01-21 04:07:19 +00:00
|
|
|
|
2019-05-09 09:30:09 +00:00
|
|
|
int app_main(int argc, char * argv[]);
|
2022-02-08 05:10:31 +00:00
|
|
|
bool app_init(void);
|
|
|
|
void app_shutdown(void);
|
|
|
|
void app_quit(void);
|
2019-02-28 05:35:30 +00:00
|
|
|
|
2019-02-28 08:20:35 +00:00
|
|
|
// these must be implemented for each OS
|
2022-02-08 05:10:31 +00:00
|
|
|
const char * os_getExecutable(void);
|
|
|
|
const char * os_getDataPath(void);
|
2021-06-04 02:31:15 +00:00
|
|
|
void os_showMessage(const char * caption, const char * msg);
|
2021-02-03 22:42:54 +00:00
|
|
|
|
2022-02-07 03:39:42 +00:00
|
|
|
bool os_getAndClearPendingActivationRequest(void);
|
2022-02-08 05:10:31 +00:00
|
|
|
bool os_blockScreensaver(void);
|
2021-08-05 12:35:22 +00:00
|
|
|
bool os_hasSetCursorPos(void);
|
|
|
|
void os_setCursorPos(int x, int y);
|
2022-01-05 10:04:57 +00:00
|
|
|
|
|
|
|
// return the KVMFR OS type
|
|
|
|
KVMFROS os_getKVMFRType(void);
|
|
|
|
|
|
|
|
// returns the OS name & version if possible
|
|
|
|
const char * os_getOSName(void);
|
|
|
|
|
|
|
|
// returns the UUID that was given to the VM, this can be obtained from the
|
|
|
|
// SMBIOS. Must return exactly 16 bytes or NULL.
|
|
|
|
const uint8_t * os_getUUID(void);
|