Sunshine/src/system_tray.h
Lukas Senionis bc22cca59b
Some checks are pending
CI / GitHub Env Debug (push) Waiting to run
CI / Setup Release (push) Waiting to run
CI / Setup Flatpak Matrix (push) Waiting to run
CI / Linux Flatpak (push) Blocked by required conditions
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Blocked by required conditions
CI / Windows (push) Blocked by required conditions
CI Docker / Check Dockerfiles (push) Waiting to run
CI Docker / Setup Release (push) Blocked by required conditions
CI Docker / Docker${{ matrix.tag }} (push) Blocked by required conditions
CodeQL / Get language matrix (push) Waiting to run
CodeQL / Analyze (${{ matrix.name }}) (push) Blocked by required conditions
localize / Update Localization (push) Waiting to run
Build GH-Pages / prep (push) Waiting to run
Build GH-Pages / call-jekyll-build (push) Blocked by required conditions
feat(tray): add button to reset display device settings on Windows (#3546)
2025-01-17 11:45:50 -05:00

109 lines
2.8 KiB
C++

/**
* @file src/system_tray.h
* @brief Declarations for the system tray icon and notification system.
*/
#pragma once
/**
* @brief Handles the system tray icon and notification system.
*/
namespace system_tray {
/**
* @brief Callback for opening the UI from the system tray.
* @param item The tray menu item.
*/
void
tray_open_ui_cb(struct tray_menu *item);
/**
* @brief Callback for opening GitHub Sponsors from the system tray.
* @param item The tray menu item.
*/
void
tray_donate_github_cb(struct tray_menu *item);
/**
* @brief Callback for opening Patreon from the system tray.
* @param item The tray menu item.
*/
void
tray_donate_patreon_cb(struct tray_menu *item);
/**
* @brief Callback for opening PayPal donation from the system tray.
* @param item The tray menu item.
*/
void
tray_donate_paypal_cb(struct tray_menu *item);
/**
* @brief Callback for resetting display device configuration.
* @param item The tray menu item.
*/
void
tray_reset_display_device_config_cb(struct tray_menu *item);
/**
* @brief Callback for restarting Sunshine from the system tray.
* @param item The tray menu item.
*/
void
tray_restart_cb(struct tray_menu *item);
/**
* @brief Callback for exiting Sunshine from the system tray.
* @param item The tray menu item.
*/
void
tray_quit_cb(struct tray_menu *item);
/**
* @brief Create the system tray.
* @details This function has an endless loop, so it should be run in a separate thread.
* @return 1 if the system tray failed to create, otherwise 0 once the tray has been terminated.
*/
int
system_tray();
/**
* @brief Run the system tray with platform specific options.
* @todo macOS requires that UI elements be created on the main thread, so the system tray is not currently implemented for macOS.
*/
int
run_tray();
/**
* @brief Exit the system tray.
* @return 0 after exiting the system tray.
*/
int
end_tray();
/**
* @brief Sets the tray icon in playing mode and spawns the appropriate notification
* @param app_name The started application name
*/
void
update_tray_playing(std::string app_name);
/**
* @brief Sets the tray icon in pausing mode (stream stopped but app running) and spawns the appropriate notification
* @param app_name The paused application name
*/
void
update_tray_pausing(std::string app_name);
/**
* @brief Sets the tray icon in stopped mode (app and stream stopped) and spawns the appropriate notification
* @param app_name The started application name
*/
void
update_tray_stopped(std::string app_name);
/**
* @brief Spawns a notification for PIN Pairing. Clicking it opens the PIN Web UI Page
*/
void
update_tray_require_pin();
} // namespace system_tray