Add Big Picture mode and multi-target build
Introduce a Big Picture mode and support building two app targets. CMakeLists was refactored to add a helper (add_nebula_app_target) and now registers NebulaBrowser and NebulaBigPicture executables, moving UI/assets post-build copying into the helper. A new app/main_bigpicture.cpp entry was added and RunNebula now accepts LaunchOptions (AppMode) with a new LaunchOptions struct. NebulaController was extended heavily to manage a BigPicture browser role: creation, enter/exit mode, layout logic, cursor injection/removal, remote input handlers (mouse move/click/wheel/text), and state syncing. Cef/browser_client updated for the new BigPicture role and message filtering. Platform API gained MoveCursorToBrowserPoint with platform stubs/Win implementation. Big-picture UI files (CSS/JS/HTML) were also updated to support the new mode.
This commit is contained in:
@@ -35,6 +35,33 @@ bool IsBigPictureFrame(CefRefPtr<CefFrame> frame) {
|
||||
url.starts_with("nebula://big-picture");
|
||||
}
|
||||
|
||||
bool IsBigPictureCommand(const std::string& command) {
|
||||
return command == "navigate" ||
|
||||
command == "new-tab" ||
|
||||
command == "activate-tab" ||
|
||||
command == "close-tab" ||
|
||||
command == "back" ||
|
||||
command == "forward" ||
|
||||
command == "reload" ||
|
||||
command == "stop" ||
|
||||
command == "home" ||
|
||||
command == "settings" ||
|
||||
command == "open-settings" ||
|
||||
command == "big-picture" ||
|
||||
command == "exit-bigpicture" ||
|
||||
command == "gpu-diagnostics" ||
|
||||
command == "zoom-out" ||
|
||||
command == "zoom-in" ||
|
||||
command == "clear-site-history" ||
|
||||
command == "clear-search-history" ||
|
||||
command == "bigpicture-mouse-move" ||
|
||||
command == "bigpicture-click" ||
|
||||
command == "bigpicture-right-click" ||
|
||||
command == "bigpicture-scroll" ||
|
||||
command == "bigpicture-text" ||
|
||||
command == "bigpicture-browse-visible";
|
||||
}
|
||||
|
||||
std::vector<std::string> ToStringVector(const std::vector<CefString>& values) {
|
||||
std::vector<std::string> result;
|
||||
result.reserve(values.size());
|
||||
@@ -62,7 +89,7 @@ bool NebulaBrowserClient::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser
|
||||
}
|
||||
|
||||
if (role_ != BrowserRole::Chrome && role_ != BrowserRole::Content &&
|
||||
role_ != BrowserRole::MenuPopup) {
|
||||
role_ != BrowserRole::BigPicture && role_ != BrowserRole::MenuPopup) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,6 +110,10 @@ bool NebulaBrowserClient::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser
|
||||
!allowed_big_picture_command) {
|
||||
return false;
|
||||
}
|
||||
} else if (role_ == BrowserRole::BigPicture) {
|
||||
if (!IsBigPictureFrame(frame) || !IsBigPictureCommand(command)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (delegate_ && !command.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user