51#include <imgui_impl_opengl3.h>
52#include <imgui_impl_sdl2.h>
53#include <imgui_internal.h>
54#include <CustomFont.ii>
60using namespace std::literals;
62ImFont* ImGuiManager::addFont(
zstring_view filename,
int fontSize)
64 auto& io = ImGui::GetIO();
65 if (!filename.
empty()) {
70 auto fileSize = file.getSize();
71 auto ttfData = std::span(
72 static_cast<uint8_t*
>(ImGui::MemAlloc(fileSize)), fileSize);
75 static const std::array<ImWchar, 2*6 + 1>
ranges = {
91 return io.Fonts->AddFontFromMemoryTTF(
93 narrow<int>(ttfData.size()), narrow<float>(fontSize),
95 }
catch (MSXException& e) {
97 ". Reverted to builtin font");
100 return io.Fonts->AddFontDefault();
103void ImGuiManager::loadFont()
105 ImGuiIO& io = ImGui::GetIO();
111 static constexpr std::array<ImWchar, 3> icons_ranges = {ICON_MIN_IGFD, ICON_MAX_IGFD, 0};
112 ImFontConfig icons_config; icons_config.MergeMode =
true; icons_config.PixelSnapH =
true;
113 io.Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_IGFD, 15.0f, &icons_config, icons_ranges.data());
121void ImGuiManager::reloadFont()
127 ImGuiIO& io = ImGui::GetIO();
135void ImGuiManager::initializeImGui()
138 IMGUI_CHECKVERSION();
139 ImGui::CreateContext();
140 ImGuiIO& io = ImGui::GetIO();
141 io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard |
143 ImGuiConfigFlags_DockingEnable |
144 ImGuiConfigFlags_ViewportsEnable;
146 io.IniFilename = iniFilename.c_str();
151static void cleanupImGui()
153 ImGui::DestroyContext();
159 , fontPropFilename(reactor.getCommandController(),
"gui_font_default_filename",
"TTF font filename for the default GUI font",
"DejaVuSans.ttf.gz")
160 , fontMonoFilename(reactor.getCommandController(),
"gui_font_mono_filename",
"TTF font filename for the monospaced GUI font",
"DejaVuSansMono.ttf.gz")
161 , fontPropSize(reactor.getCommandController(),
"gui_font_default_size",
"size for the default GUI font", 13, 9, 72)
162 , fontMonoSize(reactor.getCommandController(),
"gui_font_mono_size",
"size for the monospaced GUI font", 13, 9, 72)
163 , windowPos{SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED}
165 parts.push_back(
this);
168 machine = std::make_unique<ImGuiMachine>(*
this);
169 media = std::make_unique<ImGuiMedia>(*
this);
170 connector = std::make_unique<ImGuiConnector>(*
this);
171 reverseBar = std::make_unique<ImGuiReverseBar>(*
this);
172 tools = std::make_unique<ImGuiTools>(*
this);
173 settings = std::make_unique<ImGuiSettings>(*
this);
174 debugger = std::make_unique<ImGuiDebugger>(*
this);
175 help = std::make_unique<ImGuiHelp>(*
this);
177 breakPoints = std::make_unique<ImGuiBreakPoints>(*
this);
178 symbols = std::make_unique<ImGuiSymbols>(*
this);
179 watchExpr = std::make_unique<ImGuiWatchExpr>(*
this);
180 vdpRegs = std::make_unique<ImGuiVdpRegs>(*
this);
181 palette = std::make_unique<ImGuiPalette>(*
this);
182 osdIcons = std::make_unique<ImGuiOsdIcons>(*
this);
183 openFile = std::make_unique<ImGuiOpenFile>(*
this);
184 trainer = std::make_unique<ImGuiTrainer>(*
this);
185 cheatFinder = std::make_unique<ImGuiCheatFinder>(*
this);
186 sccViewer = std::make_unique<ImGuiSCCViewer>(*
this);
187 waveViewer = std::make_unique<ImGuiWaveViewer>(*
this);
189 soundChip = std::make_unique<ImGuiSoundChip>(*
this);
190 keyboard = std::make_unique<ImGuiKeyboard>(*
this);
191 console = std::make_unique<ImGuiConsole>(*
this);
192 messages = std::make_unique<ImGuiMessages>(*
this);
195 ImGuiSettingsHandler ini_handler;
196 ini_handler.TypeName =
"openmsx";
197 ini_handler.TypeHash =
ImHashStr(
"openmsx");
198 ini_handler.UserData =
this;
203 ini_handler.ReadInitFn = [](ImGuiContext*, ImGuiSettingsHandler* handler) {
205 static_cast<ImGuiManager*
>(handler->UserData)->iniReadInit();
207 ini_handler.ReadOpenFn = [](ImGuiContext*, ImGuiSettingsHandler* handler,
const char* name) ->
void* {
209 return static_cast<ImGuiManager*
>(handler->UserData)->iniReadOpen(name);
211 ini_handler.ReadLineFn = [](ImGuiContext*, ImGuiSettingsHandler* handler,
void* entry,
const char* line) {
213 static_cast<ImGuiManager*
>(handler->UserData)->loadLine(entry, line);
215 ini_handler.ApplyAllFn = [](ImGuiContext*, ImGuiSettingsHandler* handler) {
217 static_cast<ImGuiManager*
>(handler->UserData)->iniApplyAll();
219 ini_handler.WriteAllFn = [](ImGuiContext*, ImGuiSettingsHandler* handler, ImGuiTextBuffer* out_buf) {
221 static_cast<ImGuiManager*
>(handler->UserData)->iniWriteAll(*out_buf);
223 ImGui::AddSettingsHandler(&ini_handler);
260 assert(!
contains(toBeAddedParts, part));
261 toBeAddedParts.push_back(part);
266 if (
auto it1 =
ranges::find(parts, part); it1 != parts.end()) {
269 }
else if (
auto it2 =
ranges::find(toBeAddedParts, part); it2 != toBeAddedParts.end()) {
270 toBeAddedParts.erase(it2);
274void ImGuiManager::updateParts()
281 append(parts, toBeAddedParts);
282 toBeAddedParts.clear();
285void ImGuiManager::save(ImGuiTextBuffer& buf)
293void ImGuiManager::loadLine(std::string_view name,
zstring_view value)
300 auto windowTL = windowPos;
301 auto windowBR = windowTL + windowSize;
302 auto overlaps = [&](
const ImGuiPlatformMonitor& monitor) {
304 auto monitorBR = monitorTL +
trunc(
gl::vec2(monitor.MainSize));
305 return windowTL.x < monitorBR.x &&
306 windowBR.x > monitorTL.x &&
307 windowTL.y < monitorBR.y &&
308 windowBR.y > monitorTL.y;
311 if (
const auto& monitors = ImGui::GetPlatformIO().Monitors;
315 return gl::ivec2(SDL_WINDOWPOS_CENTERED);
320void ImGuiManager::loadEnd()
323 windowPos = ensureVisible(windowPos, display.getWindowSize());
324 display.setWindowPosition(windowPos);
349 delayedActionQueue.push_back(std::move(action));
354 const std::function<
void(
const TclObject&)>& ok,
355 const std::function<
void(
const std::string&)>& error)
362 if (error) error(e.getMessage());
368 const std::function<
void(
const TclObject&)>& ok)
371 [
this](
const std::string& message) { this->
printError(message); });
379bool ImGuiManager::signalEvent(
const Event& event)
381 if (
auto* evt = get_event_if<SdlEvent>(event)) {
382 const ImGuiIO& io = ImGui::GetIO();
383 if (!io.BackendPlatformUserData) {
387 const SDL_Event& sdlEvent = evt->getSdlEvent();
389 if ((io.WantCaptureMouse &&
390 sdlEvent.type ==
one_of(SDL_MOUSEMOTION, SDL_MOUSEWHEEL,
391 SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP)) ||
392 (io.WantCaptureKeyboard &&
393 sdlEvent.type ==
one_of(SDL_KEYDOWN, SDL_KEYUP, SDL_TEXTINPUT))) {
399 for (
auto& action : delayedActionQueue) {
402 delayedActionQueue.clear();
406 const auto& fde = get_event<FileDropEvent>(event);
407 droppedFile = fde.getFileName();
408 handleDropped =
true;
427void ImGuiManager::update(
const Setting& )
noexcept
429 needReloadFont =
true;
433static std::vector<std::string> getDrives(MSXMotherBoard* motherBoard)
435 std::vector<std::string> result;
436 if (!motherBoard)
return result;
438 std::string driveName =
"diskX";
441 if (!(*drivesInUse)[i])
continue;
442 driveName[4] = char(
'a' + i);
443 result.push_back(driveName);
448static std::vector<std::string> getSlots(MSXMotherBoard* motherBoard)
450 std::vector<std::string> result;
451 if (!motherBoard)
return result;
453 const auto& slotManager = motherBoard->getSlotManager();
454 std::string cartName =
"cartX";
455 for (
auto slot :
xrange(CartridgeSlotManager::MAX_SLOTS)) {
456 if (!slotManager.slotExists(slot))
continue;
457 cartName[4] = char(
'a' + slot);
458 result.push_back(cartName);
466 ImGui::LoadIniSettingsFromDisk(
loadIniFile.c_str());
475static bool hoverMenuBar()
477 const auto* viewport = ImGui::GetMainViewport();
479 gl::vec2 bottomRight = topLeft +
gl::vec2(viewport->Size.x, ImGui::GetFrameHeight());
480 gl::vec2 mouse = ImGui::GetMousePos();
481 return mouse.x >= topLeft.x && mouse.x <= bottomRight.x &&
482 mouse.y >= topLeft.y && mouse.y <= bottomRight.y;
492 if (
auto* keyb = motherBoard->getKeyboard()) {
494 keyb->setFocus(!ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow), time);
498 for (
auto* part : parts) {
499 part->paint(motherBoard);
506 for (
auto* part : parts) {
507 part->showMenu(motherBoard);
510 if (mainMenuBarUndocked) {
511 im::Window(
"openMSX main menu", &mainMenuBarUndocked, ImGuiWindowFlags_MenuBar, [&]{
513 if (ImGui::ArrowButton(
"re-dock-button", ImGuiDir_Down)) {
514 mainMenuBarUndocked =
false;
516 simpleToolTip(
"Dock the menu bar in the main openMSX window.");
521 bool active = ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow) ||
522 ImGui::IsWindowFocused(ImGuiHoveredFlags_AnyWindow) ||
524 if (active != guiActive) {
531 auto target = active ? 1.0f : 0.0f;
532 auto period = active ? 0.5f : 5.0f;
537 if (ImGui::ArrowButton(
"undock-button", ImGuiDir_Up)) {
538 mainMenuBarUndocked =
true;
540 simpleToolTip(
"Undock the menu bar from the main openMSX window.");
549 auto insert2 = [&](std::string_view displayName,
const TclObject& cmd) {
550 auto message =
strCat(
"Inserted ", droppedFile,
" in ", displayName);
552 insertedInfo = message;
553 openInsertedInfo =
true;
554 media->addRecent(cmd);
557 auto insert = [&](std::string_view displayName, std::string_view cmd) {
558 insert2(displayName,
makeTclList(cmd,
"insert", droppedFile));
561 handleDropped =
false;
562 insertedInfo.clear();
564 auto category =
execute(
makeTclList(
"openmsx_info",
"file_type_category", droppedFile))->getString();
569 auto error = [&](
auto&& ...message) {
572 auto cantHandle = [&](
auto&& ...message) {
573 error(
"Can't handle dropped file ", droppedFile,
": ", message...);
575 auto notPresent = [&](
const auto& mediaType) {
576 cantHandle(
"no ", mediaType,
" present.");
579 auto testMedia = [&](std::string_view displayName, std::string_view cmd) {
581 insert(displayName, cmd);
583 notPresent(displayName);
587 if (category ==
"disk") {
588 auto list = getDrives(motherBoard);
590 notPresent(
"disk drive");
591 }
else if (list.size() == 1) {
592 const auto& drive = list.front();
593 insert(
strCat(
"disk drive ",
char(drive.back() -
'a' +
'A')), drive);
595 selectList = std::move(list);
596 ImGui::OpenPopup(
"select-drive");
598 }
else if (category ==
"rom") {
599 auto list = getSlots(motherBoard);
601 notPresent(
"cartridge slot");
604 selectedMedia = list.front();
605 selectList = std::move(list);
611 selectedRomType = romInfo ? romInfo->
getRomType()
613 ImGui::OpenPopup(
"select-cart");
614 }
else if (category ==
"cassette") {
615 testMedia(
"casette port",
"cassetteplayer");
616 }
else if (category ==
"laserdisc") {
617 testMedia(
"laser disc player",
"laserdiscplayer");
618 }
else if (category ==
"savestate") {
620 }
else if (category ==
"replay") {
622 }
else if (category ==
"script") {
627 cantHandle(
"unknown file type");
632 auto n = std::min(3.5f, narrow<float>(selectList.size()));
633 auto height = n * ImGui::GetTextLineHeightWithSpacing() + ImGui::GetStyle().FramePadding.y;
634 im::ListBox(
"##select-media", {-FLT_MIN, height}, [&]{
635 for (
const auto& item : selectList) {
636 auto drive = item.back() -
'a';
637 auto display =
strCat(
char(
'A' + drive),
": ",
media->displayNameForDriveContent(drive,
true));
638 if (ImGui::Selectable(display.c_str())) {
639 insert(
strCat(
"disk drive ",
char(drive +
'A')), item);
640 ImGui::CloseCurrentPopup();
654 ImGui::TableSetupColumn(
"description", ImGuiTableColumnFlags_WidthFixed);
655 ImGui::TableSetupColumn(
"value", ImGuiTableColumnFlags_WidthStretch);
660 if (ImGui::TableNextColumn()) {
661 ImGui::AlignTextToFramePadding();
664 if (ImGui::TableNextColumn()) {
670 if (selectList.size() > 1) {
671 const auto& slotManager = motherBoard->getSlotManager();
673 auto n = std::min(3.5f, narrow<float>(selectList.size()));
674 auto height = n * ImGui::GetTextLineHeightWithSpacing() + ImGui::GetStyle().FramePadding.y;
675 im::ListBox(
"##select-media", {-FLT_MIN, height}, [&]{
676 for (
const auto& item : selectList) {
677 auto slot = item.back() -
'a';
680 " (", slotManager.getPsSsString(slot),
"): ",
681 media->displayNameForSlotContent(slotManager, slot,
true));
683 if (ImGui::Selectable(display.c_str(), item == selectedMedia)) {
684 selectedMedia = item;
690 ImGui::Checkbox(
"Reset MSX on inserting ROM", &
media->resetOnInsertRom);
692 if (ImGui::Button(
"Insert ROM")) {
693 auto cmd =
makeTclList(selectedMedia,
"insert", droppedFile);
697 insert2(
strCat(
"cartridge slot ",
char(selectedMedia.back() -
'a' +
'A')), cmd);
698 if (
media->resetOnInsertRom) {
701 ImGui::CloseCurrentPopup();
704 if (ImGui::Button(
"Cancel")) {
705 ImGui::CloseCurrentPopup();
708 if (openInsertedInfo) {
709 openInsertedInfo =
false;
710 insertedInfoTimeout = 3.0f;
711 ImGui::OpenPopup(
"inserted-info");
714 insertedInfoTimeout -= ImGui::GetIO().DeltaTime;
715 if (insertedInfoTimeout <= 0.0f || insertedInfo.empty()) {
716 ImGui::CloseCurrentPopup();
726 if (ImGui::BeginViewportSideBar(
"##MainStatusBar",
nullptr, ImGuiDir_Down, ImGui::GetFrameHeight(),
727 ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_MenuBar)) {
729 auto frameTime = ImGui::GetIO().DeltaTime;
732 fpsDrawTimeOut -= frameTime;
733 if (fpsDrawTimeOut < 0.0f) {
734 fpsDrawTimeOut = 0.1f;
737 std::stringstream ssFps;
738 ssFps << std::fixed << std::setprecision(1) << fps <<
" fps";
743 auto [modeStr, extendedStr_] = [&] {
744 if (!motherBoard)
return std::pair{
"-",
""};
745 const auto* vdp =
dynamic_cast<const VDP*
>(motherBoard->
findDevice(
"VDP"));
746 if (!vdp)
return std::pair{
"-",
""};
748 auto mode = vdp->getDisplayMode();
749 auto base = mode.getBase();
761 ? (mode.getByte() &
DisplayMode::YAE) ? std::pair{
"11",
"GRAPHIC 7 (YJK/YAE mode)"} : std::pair{
"12",
"GRAPHIC 7 (YJK mode)"}
762 : std::pair{
"8",
"GRAPHIC 7"};
764 auto extendedStr = extendedStr_;
767 std::string result =
"screen mode as used in MSX-BASIC";
768 if (extendedStr[0]) {
769 strAppend(result,
", corresponds to VDP mode ", extendedStr);
775 auto timeStr = motherBoard
784 speedDrawTimeOut -= frameTime;
785 if (speedDrawTimeOut < 0.0f) {
786 auto realTimePassed = 1.0f - speedDrawTimeOut;
787 speedDrawTimeOut = 1.0f;
790 auto boardTimePassed = (boardTime < prevBoardTime)
792 : (boardTime - prevBoardTime).toDouble();
793 prevBoardTime = boardTime;
795 speed = 100.0f * float(boardTimePassed) / realTimePassed;
799 prevBoardTime = EmuTime::zero();
806 if (
const HardwareConfig* machineConfig = motherBoard->
getMachineConfig()) {
807 if (
const auto* info = machineConfig->getConfig().findChild(
"info")) {
808 auto manuf = info->getChildData(
"manufacturer",
"?");
809 auto code = info->getChildData(
"code",
"?");
812 auto type = info->getChildData(
"type",
"");
813 auto desc = info->getChildData(
"description",
"");
814 return strCat((type.empty() ?
"" :
strCat(
"Machine type: ", type,
'\n')), desc);
821 if (
auto result =
execute(TclObject(
"guess_title"))) {
831void ImGuiManager::iniReadInit()
834 for (
auto* part : parts) {
841void* ImGuiManager::iniReadOpen(std::string_view name)
844 for (
auto* part : parts) {
845 if (part->iniName() == name)
return part;
850void ImGuiManager::loadLine(
void* entry,
const char* line_)
const
853 auto pos = line.
find(
'=');
855 std::string_view name = line.
substr(0, pos);
859 static_cast<ImGuiPartInterface*
>(entry)->loadLine(name, value);
862void ImGuiManager::iniApplyAll()
865 for (
auto* part : parts) {
870void ImGuiManager::iniWriteAll(ImGuiTextBuffer& buf)
873 for (
auto* part : parts) {
874 if (
auto name = part->iniName(); !name.empty()) {
875 buf.appendf(
"[openmsx][%s]\n", name.c_str());
void printError(std::string_view message)
void printWarning(std::string_view message)
static constexpr uint8_t GRAPHIC3
static constexpr uint8_t MULTICOLOR
static constexpr uint8_t GRAPHIC4
static constexpr uint8_t GRAPHIC5
static constexpr uint8_t GRAPHIC1
static constexpr uint8_t GRAPHIC7
static constexpr uint8_t TEXT2
static constexpr byte YAE
Encoding of YAE flag.
static constexpr uint8_t GRAPHIC6
static constexpr byte YJK
Encoding of YJK flag.
static constexpr uint8_t GRAPHIC2
static constexpr uint8_t TEXT1
void unregisterEventListener(EventType type, EventListener &listener)
Unregisters a previously registered event listener.
void distributeEvent(Event &&event)
Schedule the given event for delivery.
void registerEventListener(EventType type, EventListener &listener, Priority priority=Priority::OTHER)
Registers a given object to receive certain events.
std::string resolveCreate(std::string_view filename) const
Sha1Sum getSha1Sum(File &file)
Calculate sha1sum for the given File object.
zstring_view getString() const noexcept
std::unique_ptr< ImGuiMachine > machine
void registerPart(ImGuiPartInterface *part)
std::unique_ptr< ImGuiBreakPoints > breakPoints
void printError(std::string_view message)
std::unique_ptr< ImGuiVdpRegs > vdpRegs
std::unique_ptr< ImGuiCheatFinder > cheatFinder
std::unique_ptr< ImGuiTrainer > trainer
std::unique_ptr< ImGuiDiskManipulator > diskManipulator
IntegerSetting fontMonoSize
std::unique_ptr< ImGuiWatchExpr > watchExpr
std::unique_ptr< ImGuiPalette > palette
std::unique_ptr< ImGuiWaveViewer > waveViewer
std::unique_ptr< ImGuiConnector > connector
std::optional< TclObject > execute(TclObject command)
std::unique_ptr< ImGuiKeyboard > keyboard
std::unique_ptr< ImGuiHelp > help
IntegerSetting fontPropSize
Interpreter & getInterpreter()
std::unique_ptr< ImGuiConsole > console
std::unique_ptr< ImGuiSoundChip > soundChip
ImGuiManager(Reactor &reactor_)
std::unique_ptr< ImGuiReverseBar > reverseBar
std::unique_ptr< ImGuiMedia > media
std::unique_ptr< ImGuiMessages > messages
std::unique_ptr< ImGuiOpenFile > openFile
std::unique_ptr< ImGuiOsdIcons > osdIcons
FilenameSetting fontPropFilename
std::unique_ptr< ImGuiSettings > settings
std::unique_ptr< ImGuiDebugger > debugger
std::unique_ptr< ImGuiSCCViewer > sccViewer
void unregisterPart(ImGuiPartInterface *part)
std::unique_ptr< ImGuiTools > tools
void executeDelayed(std::function< void()> action)
FilenameSetting fontMonoFilename
std::unique_ptr< ImGuiSymbols > symbols
int getInt() const noexcept
EmuTime::param getCurrentTime() const
Convenience method: This is the same as getScheduler().getCurrentTime().
const HardwareConfig * getMachineConfig() const
MSXDevice * findDevice(std::string_view name)
Find a MSXDevice by name.
Contains the main loop of openMSX.
MSXMotherBoard * getMotherBoard() const
Interpreter & getInterpreter()
EventDistributor & getEventDistributor()
RomDatabase & getSoftwareDatabase()
static std::shared_ptr< DrivesInUse > getDrivesInUse(MSXMotherBoard &motherBoard)
const RomInfo * fetchRomInfo(const Sha1Sum &sha1sum) const
Lookup an entry in the database by sha1sum.
static zstring_view romTypeToName(RomType type)
RomType getRomType() const
void detach(Observer< T > &observer)
void attach(Observer< T > &observer)
TclObject executeCommand(Interpreter &interp, bool compile=false)
Interpret this TclObject as a command and execute it.
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
static constexpr auto npos
constexpr auto find(char c, size_type pos=0) const
constexpr zstring_view substr(size_type pos) const
constexpr auto empty() const
ImGuiID ImHashStr(const char *data_p, size_t data_size, ImGuiID seed)
bool ImGui_ImplOpenGL3_CreateFontsTexture()
void ImGui_ImplOpenGL3_DestroyFontsTexture()
bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event *event)
void TextUnformatted(const std::string &str)
void RightAlignText(std::string_view text, std::string_view maxWidthText)
constexpr vecN< N, int > trunc(const vecN< N, T > &x)
std::optional< Context > context
void Table(const char *str_id, int column, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, std::invocable<> auto next)
void MainMenuBar(std::invocable<> auto next)
void MenuBar(std::invocable<> auto next)
void Window(const char *name, bool *p_open, ImGuiWindowFlags flags, std::invocable<> auto next)
void StyleVar(ImGuiStyleVar idx, float val, std::invocable<> auto next)
void ListBox(const char *label, const ImVec2 &size, std::invocable<> auto next)
void TextWrapPos(float wrap_local_pos_x, std::invocable<> auto next)
void Popup(const char *str_id, ImGuiWindowFlags flags, std::invocable<> auto next)
string_view getExtension(string_view path)
Returns the extension portion of a path.
bool isDirectory(const Stat &st)
string join(string_view part1, string_view part2)
Join two paths.
This file implemented 3 utility functions:
const FileContext & systemFileContext()
bool loadOnePersistent(std::string_view name, zstring_view value, C &c, const std::tuple< Elements... > &tup)
void simpleToolTip(std::string_view desc)
void savePersistent(ImGuiTextBuffer &buf, C &c, const std::tuple< Elements... > &tup)
EventType getType(const Event &event)
std::variant< KeyUpEvent, KeyDownEvent, MouseMotionEvent, MouseButtonUpEvent, MouseButtonDownEvent, MouseWheelEvent, JoystickAxisMotionEvent, JoystickHatEvent, JoystickButtonUpEvent, JoystickButtonDownEvent, OsdControlReleaseEvent, OsdControlPressEvent, WindowEvent, TextEvent, FileDropEvent, QuitEvent, FinishFrameEvent, CliCommandEvent, GroupEvent, BootEvent, FrameDrawnEvent, BreakEvent, SwitchRendererEvent, TakeReverseSnapshotEvent, AfterTimedEvent, MachineLoadedEvent, MachineActivatedEvent, MachineDeactivatedEvent, MidiInReaderEvent, MidiInWindowsEvent, MidiInCoreMidiEvent, MidiInCoreMidiVirtualEvent, MidiInALSAEvent, Rs232TesterEvent, Rs232NetEvent, ImGuiDelayedActionEvent, ImGuiActiveEvent > Event
std::string formatTime(std::optional< double > time)
float calculateFade(float current, float target, float period)
TclObject makeTclList(Args &&... args)
auto remove(ForwardRange &&range, const T &value)
constexpr bool none_of(InputRange &&range, UnaryPredicate pred)
auto find(InputRange &&range, const T &value)
constexpr bool contains(ITER first, ITER last, const VAL &val)
Check if a range contains a given value, using linear search.
TemporaryString tmpStrCat(Ts &&... ts)
void strAppend(std::string &result, Ts &&...ts)
constexpr auto xrange(T e)