Files
racket-webview/scrbl/racket-webview-intro.scrbl
2026-04-01 16:23:56 +02:00

64 lines
2.4 KiB
Racket

#lang scribble/manual
@(require racket/base
scribble/core
scribble/manual
(for-label racket/base
racket/class
racket/string
racket/file
net/url
"../private/wv-context.rkt"
"../private/wv-window.rkt"
"../private/wv-element.rkt"
"../private/wv-input.rkt"
"../private/wv-dialog.rkt"
"../private/wv-settings.rkt"
"../private/rgba.rkt"
"../private/mimetypes.rkt"))
@title{Racket Webview}
@author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]]
@section{Overview}
Racket Webview is a class-oriented webview library built on top of a Qt-based
native runtime.
The library is layered. At the lowest level a native FFI layer is used. On top
of that, @racketmodname[racket-webview] provides a functional API. The
class-oriented API described in this manual is built from smaller modules on top
of that layer.
@section{Core Concepts}
The library is structured around two main concepts:
@itemlist[#:style 'compact
@item{a context, representing an isolated runtime with its own local HTTPS server}
@item{a window, representing a webview instance within such a context}]
A context manages local file serving, certificates, and settings. A window loads
content, handles events, and provides access to DOM elements.
@section{Modules}
The public API is divided into the following modules:
@itemlist[#:style 'compact
@item{@racketmodname[wv-context] context creation and settings access}
@item{@racketmodname[wv-window] window lifecycle, events, navigation, and dialogs}
@item{@racketmodname[wv-element] DOM element wrapper}
@item{@racketmodname[wv-input] typed input-element wrappers}
@item{@racketmodname[wv-dialog] dialog windows}
@item{@racketmodname[wv-settings] settings wrapper}
@item{@racketmodname[rgba] RGBA color values}
@item{@racketmodname[mimetypes] MIME type lookup}]
@section{Typical Usage}
A typical application creates a @racket[wv-context%] object and then creates one
or more @racket[wv-window%] objects within that context. DOM elements are
retrieved using @racket[(send window element 'id)], after which their state can
be read or modified using the element and input wrapper classes. Interaction
with the browser is handled through event callbacks and bindings.