2026-04-08 08:29:54 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2026, Johan Dahlin <jdahlin@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibMain/Main.h>
|
|
|
|
|
#include <LibWebView/Application.h>
|
|
|
|
|
#include <UI/Gtk/Application.h>
|
UI/Gtk: Add browser window, tabs, menus, and dialogs
Add the complete browser UI:
- BrowserWindow: AdwHeaderBar with navigation, tab management via
AdwTabView/AdwTabBar, find-in-page, fullscreen, zoom, D-Bus
single-instance with open/activate handlers
- Tab: WebContentView lifecycle, ViewImplementation callbacks for
title, URL, favicon, cursor, tooltips, dialogs, window management
- LadybirdBrowserWindow: GtkBuilder template widget with toolbar,
tab bar, find bar, devtools banner, and hamburger menu
- LadybirdLocationEntry: URL entry with autocomplete, domain
highlighting, and security icon
- Menu: GAction-based context menus and application menu with
keyboard accelerators
- Dialogs: JS alert/confirm/prompt (AdwAlertDialog), color picker,
file picker, select dropdown, download save dialog, toast
- GtkBuilder .ui resources for browser window, location entry
completions, and list popovers
Updates Application and main.cpp to create browser windows and
handle D-Bus activation from remote instances.
2026-04-08 08:31:51 -03:00
|
|
|
#include <UI/Gtk/BrowserWindow.h>
|
2026-04-08 08:29:54 -03:00
|
|
|
|
|
|
|
|
ErrorOr<int> ladybird_main(Main::Arguments arguments)
|
|
|
|
|
{
|
|
|
|
|
AK::set_rich_debug_enabled(true);
|
|
|
|
|
|
|
|
|
|
auto app = TRY(Ladybird::Application::create(arguments));
|
|
|
|
|
|
UI/Gtk: Add browser window, tabs, menus, and dialogs
Add the complete browser UI:
- BrowserWindow: AdwHeaderBar with navigation, tab management via
AdwTabView/AdwTabBar, find-in-page, fullscreen, zoom, D-Bus
single-instance with open/activate handlers
- Tab: WebContentView lifecycle, ViewImplementation callbacks for
title, URL, favicon, cursor, tooltips, dialogs, window management
- LadybirdBrowserWindow: GtkBuilder template widget with toolbar,
tab bar, find bar, devtools banner, and hamburger menu
- LadybirdLocationEntry: URL entry with autocomplete, domain
highlighting, and security icon
- Menu: GAction-based context menus and application menu with
keyboard accelerators
- Dialogs: JS alert/confirm/prompt (AdwAlertDialog), color picker,
file picker, select dropdown, download save dialog, toast
- GtkBuilder .ui resources for browser window, location entry
completions, and list popovers
Updates Application and main.cpp to create browser windows and
handle D-Bus activation from remote instances.
2026-04-08 08:31:51 -03:00
|
|
|
if (auto const& browser_options = Ladybird::Application::browser_options(); !browser_options.headless_mode.has_value()) {
|
|
|
|
|
// Single-instance is handled via D-Bus in Application::create_platform_event_loop().
|
|
|
|
|
// If this is a remote instance, it already forwarded URLs and exited.
|
|
|
|
|
auto& window = app->new_window(browser_options.urls);
|
|
|
|
|
(void)window;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-08 08:29:54 -03:00
|
|
|
return app->execute();
|
|
|
|
|
}
|