mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
28 lines
703 B
C++
28 lines
703 B
C++
// 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.
|
|
|
|
#include "glass/View.h"
|
|
|
|
using namespace glass;
|
|
|
|
namespace {
|
|
class FunctionView : public View {
|
|
public:
|
|
explicit FunctionView(wpi::unique_function<void()> display)
|
|
: m_display(std::move(display)) {}
|
|
|
|
void Display() override { m_display(); }
|
|
|
|
private:
|
|
wpi::unique_function<void()> m_display;
|
|
};
|
|
} // namespace
|
|
|
|
std::unique_ptr<View> glass::MakeFunctionView(
|
|
wpi::unique_function<void()> display) {
|
|
return std::make_unique<FunctionView>(std::move(display));
|
|
}
|
|
|
|
void View::Hidden() {}
|