// SPDX-License-Identifier: MIT #pragma once #include #include #include namespace udpscope { /// The About dialog: the app icon, version, commit, build timestamp and where the session /// files live. An `AdwAboutDialog`, so it is modal on `parent` by being presented on it, and /// it is an `AdwDialog` rather than a `GtkWindow`. `session_path` is this run's own session /// file; it goes on the Troubleshooting page, which has a copy button. void show_about(GtkWindow* parent, const std::string& session_path); /// The icon name the open About dialog carries, or "" when it is not open. The probe reads it /// so the dialog is asserted to *show* the app icon rather than merely to open. const char* about_icon_name(); /// The paged help window. Modal on nothing — it is a reference, so it stays usable while /// the scope runs. Already open: presented. void show_help(GtkWindow* parent); /// What UDPSCOPE_PROBE_HELP_MS reports. `parsed` counts pages whose markup /// pango_parse_markup() accepted and whose body is non-empty; it must equal `pages`. struct HelpReport { int pages = 0; int parsed = 0; std::string shortest_title; std::size_t shortest_bytes = 0; }; /// Loads and validates every page without building a window. Safe to call headless. HelpReport help_self_check(); /// The shortcut overview: the application accelerators and the plot's own interactions, /// in the sections the tables name. An AdwShortcutsDialog, because GtkShortcutsWindow is /// deprecated as of GTK 4.18 and this project builds warning-free. void show_shortcuts(GtkWindow* parent); /// Closes whichever of the three windows are open. One of them is a GtkWindow -- the help /// window, closed with gtk_window_close(), which emits close-request so its handler runs. The /// other two are AdwDialogs, which are not GtkWindows: they close with adw_dialog_close(), /// which emits ::closed. Either way the file-scope pointer is nulled by the handler, which is /// what prevents a second open presenting a dead widget. Used by the probe. void close_help_windows(); } // namespace udpscope