Files
racket-webview/scrbl/racket-webview-intro.scrbl
2026-04-06 01:10:06 +02:00

74 lines
2.8 KiB
Racket

#lang scribble/manual
@(require racket/base
scribble/core
scribble/manual
"../racket-webview-version.rkt"
(for-label racket/base
racket/class
racket/string
racket/file
net/url
"../wv-context.rkt"
"../wv-window.rkt"
"../wv-element.rkt"
"../wv-input.rkt"
"../wv-dialog.rkt"
"../wv-settings.rkt"
"../rgba.rkt"
"../mimetypes.rkt"
"../racket-webview-version.rkt"))
@(define version (webview-version-string))
@title{Racket Webview - v@version - Introduction}
@author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]]
@defmodule{racket-webview}
@section{Overview}
This documentation is provided for version @bold{@version} of racket webview.
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/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[racket-webview/wv-context] context creation and settings access}
@item{@racketmodname[racket-webview/wv-window] window lifecycle, events, navigation, and dialogs}
@item{@racketmodname[racket-webview/wv-element] DOM element wrapper}
@item{@racketmodname[racket-webview/wv-input] typed input-element wrappers}
@item{@racketmodname[racket-webview/wv-dialog] dialog windows}
@item{@racketmodname[racket-webview/wv-settings] settings wrapper}
@item{@racketmodname[racket-webview/rgba] RGBA color values}
@item{@racketmodname[racket-webview/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.