RADLib
RADical C++ application framework

RADWeb wraps WebKitGTK behind a PIMPL public API in the RADWeb namespace. Public headers do not expose GTK or WebKit headers. It provides a browser window with tabs, URL loading, JavaScript evaluation, find-in-page, zoom, history, bookmarks, downloads, settings, permission handling, cookie policy, persistent/ephemeral profiles, and session restore.

RADWebBrowserWindow is the single public class. It derives from RADCore::RADObject, so it integrates with RADCore events: RAD_EVENT signals include loadStarted/loadFinished/loadFailed, titleChanged/uriChanged, javaScriptFinished/javaScriptFailed, tab lifecycle (tabAdded, tabClosed, activeTabChanged), download lifecycle (downloadStarted, downloadUpdated, downloadFinished, downloadFailed), permissionRequested, historyChanged, bookmarksChanged, and closed.

The window is created with create() (basic dimensions or a full RADWebWindowOptions struct) and driven with run()/quit(). Tabs are managed with newTab(), closeTab(), duplicateTab(), moveTab(), and setActiveTab(), and inspected through RADWebTabInfo snapshots. Navigation uses loadUrl(), loadHtml(), evaluateJavaScript(), plus goBack()/goForward()/reload(). Runtime configuration flows through RADWebSettings (with RADWebCookiePolicy and RADWebPermissionPolicy enums) applied via applySettings(). Persistent state is exposed as RADWebHistoryItem, RADWebBookmark, and RADWebDownloadInfo records through history(), bookmarks(), and downloads(). nativeWindow() and nativeWebView() return raw GTK/WebKit pointers for advanced integration.

Core features

  • Single RADWebBrowserWindow class over WebKitGTK, PIMPL-hidden.
  • RADCore RAD_EVENT signals for load, tab, download, and permission events.
  • Multi-tab navigation, JavaScript evaluation, find-in-page, and zoom.
  • History, bookmarks, downloads, cookie/permission policy, and session restore.
  • RADWebSettings/RADWebWindowOptions configuration and native handle access.

Beta notes:

  • Browser behavior depends on the system WebKitGTK and GTK versions.
  • History, bookmark, download, and session data can be backed by RADDatabase.
  • Native handles are available for advanced integrations that need direct WebKitGTK access.

Example:

RADCONNECT(browser, loadFinished, &listener, Listener, onLoadFinished);
options.title = "RADPx-OS Browser";
if (browser.create(options)) {
browser.newTab("https://radcomp.tech");
browser.evaluateJavaScript("document.title");
browser.show();
browser.run();
}
#define RADCONNECT(Sender, RadEvent, Receiver, Class, RadEventHandler)
Connects an event to a receiver handler using the receiver's thread affinity.
Definition: RADCore.h:100
WebKitGTK-backed browser window with tabs, history, downloads, and settings.
Definition: RADWeb.h:140
bool create(int width=1200, int height=800, const std::string &title="RADWeb Browser")
Creates the browser window with basic dimensions and title.
void run()
Runs the GTK/WebKit event loop.
void show()
Shows the native browser window.
int newTab(const std::string &url="about:blank", bool makeActive=true)
Opens url in a new tab and returns the tab id.
void evaluateJavaScript(const std::string &script)
Evaluates JavaScript in the active tab.
Creation options for RADWebBrowserWindow.
Definition: RADWeb.h:122
std::string title
Initial window title.
Definition: RADWeb.h:128