[sim] Expose GUI control functions via HAL_RegisterExtension (#4034)

This commit is contained in:
Dustin Spicuzza
2022-02-19 23:40:25 -05:00
committed by GitHub
parent b2a8d3f0f3
commit 27847d7eb2
2 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <functional>
namespace halsimgui {
// These functions can be used to hook into the GUI, and can be accessed
// via HAL_RegisterExtensionListener
#define HALSIMGUI_EXT_ADDGUIINIT "halsimgui::AddGuiInit"
using AddGuiInitFn = void (*)(std::function<void()> initialize);
#define HALSIMGUI_EXT_ADDGUILATEEXECUTE "halsimgui::AddGuiLateExecute"
using AddGuiLateExecuteFn = void (*)(std::function<void()> execute);
#define HALSIMGUI_EXT_ADDGUIEARLYEXECUTE "halsimgui::AddGuiEarlyExecute"
using AddGuiEarlyExecuteFn = void (*)(std::function<void()> execute);
#define HALSIMGUI_EXT_GUIEXIT "halsimgui::GuiExit"
using GuiExitFn = void (*)();
} // namespace halsimgui