75 lines
3.0 KiB
Racket
75 lines
3.0 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"
|
|
racket-mimetypes
|
|
"../racket-webview-version.rkt"))
|
|
|
|
|
|
@(define version (webview-version-string))
|
|
|
|
|
|
@title[#:tag "racket-webview-intro"]{Racket Webview - v@version - Introduction}
|
|
@author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]]
|
|
|
|
@defmodule{racket-webview}
|
|
|
|
@section[#:tag "racket-webview-intro-overview"]{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, Racket starts a separate Qt helper
|
|
process and exchanges line-delimited JSON messages through stdin and stdout.
|
|
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[#:tag "racket-webview-intro-core-concepts"]{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[#:tag "racket-webview-intro-modules"]{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-mimetypes] — MIME type lookup}]
|
|
|
|
@section[#:tag "racket-webview-intro-typical-usage"]{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. |