Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
shell_view.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstddef>
9#include <string>
10#include <vector>
11
12// local includes
14#include "src/logging/logger.h"
15
16namespace ui {
17
22 std::string id;
23 std::string label;
24 std::string glyph;
25 std::string iconAssetPath;
26 bool selected = false;
27 };
28
33 std::string id;
34 std::string displayName;
35 std::string statusLabel;
36 std::string iconAssetPath;
37 app::PairingState pairingState = app::PairingState::not_paired;
38 app::HostReachability reachability = app::HostReachability::unknown;
39 bool selected = false;
40 };
41
45 struct ShellAppTile {
46 std::string id;
47 std::string name;
48 std::string detail;
49 std::string badgeLabel;
50 std::string boxArtCacheKey;
51 bool hidden = false;
52 bool favorite = false;
53 bool boxArtCached = false;
54 bool running = false;
55 bool selected = false;
56 };
57
62 std::string id;
63 std::string label;
64 bool enabled = true;
65 bool selected = false;
66 bool checked = false;
67 };
68
73 std::string id;
74 std::string label;
75 std::string iconAssetPath;
77 bool emphasized = false;
78 };
79
84 std::string title;
85 std::string message;
86 std::vector<ShellFooterAction> actions;
87 };
88
93 std::string label;
94 bool enabled = true;
95 bool selected = false;
96 };
97
102 app::ScreenId screen = app::ScreenId::hosts;
103 std::string title;
104 std::string pageTitle;
105 std::string statusMessage;
106 std::vector<ShellFooterAction> footerActions;
107 };
108
113 std::vector<ShellToolbarButton> toolbarButtons;
114 std::vector<ShellHostTile> hostTiles;
115 std::size_t hostColumnCount = 3U;
116 std::vector<ShellAppTile> appTiles;
117 std::size_t appColumnCount = 4U;
118 std::vector<std::string> bodyLines;
119 std::vector<ShellActionRow> menuRows;
120 std::vector<ShellActionRow> detailMenuRows;
123 bool leftPanelActive = false;
124 bool rightPanelActive = false;
125 };
126
134
139 bool visible = false;
140 std::string title;
141 std::vector<std::string> lines;
142 };
143
148 bool visible = false;
149 std::string title;
150 std::vector<std::string> lines;
151 std::vector<ShellActionRow> actions;
152 std::vector<ShellFooterAction> footerActions;
153 };
154
159 bool visible = false;
160 std::string path;
161 std::vector<std::string> lines;
162 std::size_t scrollOffset = 0U;
163 app::LogViewerPlacement placement = app::LogViewerPlacement::full;
164 };
165
170 bool visible = false;
171 std::string title;
172 std::vector<std::string> lines;
173 std::vector<ShellModalButton> buttons;
174 std::size_t columnCount = 0U;
175 };
176
189
199 const app::ClientState &state,
200 const std::vector<logging::LogEntry> &logEntries,
201 const std::vector<std::string> &statsLines = {}
202 );
203
204} // namespace ui
Declares client state models and transitions.
LogViewerPlacement
Layout options for the embedded log viewer.
Definition client_state.h:62
ScreenId
Top-level screens used by the Moonlight client shell.
Definition client_state.h:28
PairingState
Pairing state tracked for a saved host record.
Definition host_records.h:20
HostReachability
Reachability state tracked for a discovered or saved host.
Definition host_records.h:28
Declares logging configuration and output.
ShellViewModel build_shell_view_model(const app::ClientState &state, const std::vector< logging::LogEntry > &logEntries, const std::vector< std::string > &statsLines)
Build a render-ready shell view from app state and diagnostics.
Definition shell_view.cpp:671
Serializable app state for the menu-driven client shell.
Definition client_state.h:335
Render-ready vertical action row used by menus and modals.
Definition shell_view.h:61
bool enabled
True when the row can be activated.
Definition shell_view.h:64
std::string id
Stable row identifier.
Definition shell_view.h:62
std::string label
User-facing row label.
Definition shell_view.h:63
bool checked
True when the row represents an enabled option.
Definition shell_view.h:66
bool selected
True when the row currently has focus.
Definition shell_view.h:65
Render-ready app tile for the per-host apps page.
Definition shell_view.h:45
bool hidden
True when the app is hidden by default.
Definition shell_view.h:51
bool favorite
True when the app is flagged as a favorite.
Definition shell_view.h:52
std::string detail
Secondary app detail text.
Definition shell_view.h:48
std::string id
Stable app tile identifier.
Definition shell_view.h:46
std::string badgeLabel
Optional badge label such as HDR or Running.
Definition shell_view.h:49
bool selected
True when the tile currently has focus.
Definition shell_view.h:55
bool boxArtCached
True when box art is already available locally.
Definition shell_view.h:53
bool running
True when the app is currently running on the host.
Definition shell_view.h:54
std::string boxArtCacheKey
Cache key used to resolve box art.
Definition shell_view.h:50
std::string name
Primary app label.
Definition shell_view.h:47
Render-ready footer chip pairing a button icon with an action label.
Definition shell_view.h:72
std::string label
User-facing footer label.
Definition shell_view.h:74
std::string id
Stable footer action identifier.
Definition shell_view.h:73
std::string iconAssetPath
Primary icon asset path.
Definition shell_view.h:75
bool emphasized
True when the action should receive visual emphasis.
Definition shell_view.h:77
std::string secondaryIconAssetPath
Optional secondary icon asset path.
Definition shell_view.h:76
Shell-wide frame metadata shared across all render paths.
Definition shell_view.h:101
std::string title
Shell-wide title.
Definition shell_view.h:103
std::string pageTitle
Primary page heading.
Definition shell_view.h:104
std::vector< ShellFooterAction > footerActions
Footer actions shown for the current screen.
Definition shell_view.h:106
std::string statusMessage
Status line shown near the footer.
Definition shell_view.h:105
app::ScreenId screen
Active screen being rendered.
Definition shell_view.h:102
Render-ready host tile for the Moonlight-style hosts page.
Definition shell_view.h:32
bool selected
True when the tile currently has focus.
Definition shell_view.h:39
app::HostReachability reachability
Reachability state displayed on the tile.
Definition shell_view.h:38
std::string iconAssetPath
Asset path for the tile icon.
Definition shell_view.h:36
app::PairingState pairingState
Pairing state displayed on the tile.
Definition shell_view.h:37
std::string id
Stable host tile identifier.
Definition shell_view.h:33
std::string statusLabel
Secondary host status text.
Definition shell_view.h:35
std::string displayName
Primary host label.
Definition shell_view.h:34
Add-host keypad modal view rendered above the split add-host screen.
Definition shell_view.h:169
std::vector< std::string > lines
Instruction and draft lines shown in the keypad modal.
Definition shell_view.h:172
std::size_t columnCount
Number of columns used to lay out keypad buttons.
Definition shell_view.h:174
std::vector< ShellModalButton > buttons
Buttons rendered inside the keypad modal.
Definition shell_view.h:173
bool visible
True when the keypad modal should be rendered.
Definition shell_view.h:170
std::string title
Title shown at the top of the keypad modal.
Definition shell_view.h:171
Embedded log viewer state surfaced by the log-file modal.
Definition shell_view.h:158
std::vector< std::string > lines
Loaded log lines shown in the viewer.
Definition shell_view.h:161
std::size_t scrollOffset
Vertical scroll offset inside the log viewer.
Definition shell_view.h:162
std::string path
Path of the currently loaded log file.
Definition shell_view.h:160
bool visible
True when the log viewer should be rendered.
Definition shell_view.h:159
app::LogViewerPlacement placement
Placement of the log viewer pane.
Definition shell_view.h:163
Render-ready button in the keypad modal.
Definition shell_view.h:92
bool selected
True when the button currently has focus.
Definition shell_view.h:95
bool enabled
True when the button can be activated.
Definition shell_view.h:94
std::string label
User-facing button label.
Definition shell_view.h:93
Modal dialog view rendered on top of the current shell page.
Definition shell_view.h:147
std::string title
Modal dialog title.
Definition shell_view.h:149
std::vector< ShellActionRow > actions
Modal action rows.
Definition shell_view.h:151
std::vector< std::string > lines
Modal dialog body lines.
Definition shell_view.h:150
bool visible
True when a modal dialog should be rendered.
Definition shell_view.h:148
std::vector< ShellFooterAction > footerActions
Footer actions displayed while a modal is open.
Definition shell_view.h:152
Transient notification view rendered above the main shell content.
Definition shell_view.h:130
bool visible
True when a transient notification should be rendered.
Definition shell_view.h:131
ShellNotification content
Notification content when visible.
Definition shell_view.h:132
Render-ready bottom-right notification shown above the shell content.
Definition shell_view.h:83
std::string message
Notification body message.
Definition shell_view.h:85
std::string title
Notification title.
Definition shell_view.h:84
std::vector< ShellFooterAction > actions
Footer actions shown with the notification.
Definition shell_view.h:86
Diagnostics overlay view rendered above the shell content.
Definition shell_view.h:138
std::vector< std::string > lines
Diagnostics overlay body lines.
Definition shell_view.h:141
bool visible
True when the diagnostics overlay should be rendered.
Definition shell_view.h:139
std::string title
Diagnostics overlay title.
Definition shell_view.h:140
Main page content shown behind overlays and modals.
Definition shell_view.h:112
std::vector< ShellHostTile > hostTiles
Host tiles shown on the hosts page.
Definition shell_view.h:114
std::vector< std::string > bodyLines
Generic body lines for text-driven screens.
Definition shell_view.h:118
std::string selectedMenuRowDescription
Description of the currently selected row, when available.
Definition shell_view.h:122
bool rightPanelActive
True when the right content panel should use the active accent border.
Definition shell_view.h:124
std::string selectedMenuRowLabel
Label of the currently selected primary menu row.
Definition shell_view.h:121
bool leftPanelActive
True when the left navigation panel should use the active accent border.
Definition shell_view.h:123
std::vector< ShellAppTile > appTiles
App tiles shown on the apps page.
Definition shell_view.h:116
std::size_t hostColumnCount
Number of columns used to lay out host tiles.
Definition shell_view.h:115
std::vector< ShellActionRow > detailMenuRows
Secondary action rows for details or settings.
Definition shell_view.h:120
std::size_t appColumnCount
Number of columns used to lay out app tiles.
Definition shell_view.h:117
std::vector< ShellToolbarButton > toolbarButtons
Toolbar buttons for the hosts page.
Definition shell_view.h:113
std::vector< ShellActionRow > menuRows
Primary action rows for the active screen.
Definition shell_view.h:119
Render-ready button shown in the hosts toolbar.
Definition shell_view.h:21
std::string label
User-facing toolbar label.
Definition shell_view.h:23
bool selected
True when the button currently has focus.
Definition shell_view.h:26
std::string id
Stable button identifier.
Definition shell_view.h:22
std::string glyph
Optional text glyph used when no icon asset is available.
Definition shell_view.h:24
std::string iconAssetPath
Optional asset path for the button icon.
Definition shell_view.h:25
Render-ready shell state derived from the app model.
Definition shell_view.h:180
ShellPageContentView content
Main page content for the active screen.
Definition shell_view.h:183
ShellKeypadModalView keypad
Add-host keypad modal content.
Definition shell_view.h:187
ShellFrameView frame
Shell-wide frame metadata.
Definition shell_view.h:181
ShellOverlayView overlay
Diagnostics overlay content.
Definition shell_view.h:184
ShellModalView modal
Modal dialog content.
Definition shell_view.h:185
ShellLogViewerView logViewer
Embedded log viewer surfaced by the log modal.
Definition shell_view.h:186
ShellNotificationView notification
Transient notification rendered above the page.
Definition shell_view.h:182