svn: r17217
This commit is contained in:
Eli Barzilay 2009-12-05 23:16:18 +00:00
parent 63469d2f3d
commit 7090e676fc

View File

@ -23,24 +23,24 @@
@title{@bold{Browser}: Simple HTML Rendering} @title{@bold{Browser}: Simple HTML Rendering}
The @schememodname[browser] library provides the following The @schememodname[browser] library provides the following procedures
procedures and classes for parsing and viewing HTML files. The and classes for parsing and viewing HTML files. The
@schememodname[browser/htmltext] library provides a simplified @schememodname[browser/htmltext] library provides a simplified interface
interface for rendering to a subclass of the MrEd @scheme[text%] for rendering to a subclass of the MrEd @scheme[text%] class. The
class. The @schememodname[browser/external] library provides utilities @schememodname[browser/external] library provides utilities for
for launching an external browser (such as Firefox). launching an external browser (such as Firefox).
@section[#:tag "browser"]{Browser} @section[#:tag "browser"]{Browser}
@defmodule[browser] @defmodule[browser]
The browser supports basic HTML commands, plus special Scheme The browser supports basic HTML commands, plus special Scheme hyperlinks
hyperlinks of the form @(litchar "<A MZSCHEME=sexpr>...</A>"). When of the form @litchar{<A MZSCHEME=sexpr>...</A>}. When the user clicks
the user clicks on such a link, the string @scheme[sexpr] is parsed as on such a link, the string @scheme[sexpr] is parsed as a Scheme program
a Scheme program and evaluated. Since @scheme[sexpr] is likely to and evaluated. Since @scheme[sexpr] is likely to contain Scheme
contain Scheme strings, and since escape characters are difficult for strings, and since escape characters are difficult for people to read, a
people to read, a @litchar{|} character in @scheme[sexpr] is @litchar{|} character in @scheme[sexpr] is converted to a @litchar{"}
converted to a @litchar{"} character before it is parsed. Thus, character before it is parsed. Thus,
@verbatim[#:indent 2]{ @verbatim[#:indent 2]{
<A MZSCHEME="|This goes nowhere.|">Nowhere</A> <A MZSCHEME="|This goes nowhere.|">Nowhere</A>
@ -49,7 +49,7 @@ converted to a @litchar{"} character before it is parsed. Thus,
creates a ``Nowhere'' hyperlink, which executes the Scheme program creates a ``Nowhere'' hyperlink, which executes the Scheme program
@schemeblock[ @schemeblock[
"This goes nowhere." "This goes nowhere."
] ]
The value of that program is a string. When a Scheme hyperlink returns The value of that program is a string. When a Scheme hyperlink returns
@ -57,12 +57,13 @@ a string, it is parsed as a new HTML document. Thus, where the use
clicks on ``Nowhere,'' the result is a new page that says ``This goes clicks on ``Nowhere,'' the result is a new page that says ``This goes
nowhere.'' nowhere.''
The browser also treats comment forms containing @(litchar "MZSCHEME=sexpr") The browser also treats comment forms containing
specially. Whereas the @(litchar "<A MZSCHEME=sexpr>...</A>") form executes the @litchar{MZSCHEME=sexpr} specially. Whereas the
expression when the user clicks, the @(litchar "MZSCHEME") expression in a comment @litchar{<A MZSCHEME=sexpr>...</A>} form executes the expression when
is executed immediately during HTML rendering. If the result is a the user clicks, the @litchar{MZSCHEME} expression in a comment is
string, the comment is replaced in the input HTML stream with the executed immediately during HTML rendering. If the result is a string,
content of the string. Thus, the comment is replaced in the input HTML stream with the content of the
string. Thus,
@verbatim[#:indent 2]{ @verbatim[#:indent 2]{
<!-- MZSCHEME="(format |<B>Here</B>: ~a| (current-directory))" --> <!-- MZSCHEME="(format |<B>Here</B>: ~a| (current-directory))" -->
@ -73,29 +74,27 @@ document (and ``Here'' is boldfaced). If the result is a snip instead
of a string, it replaces the comment in the document. Other types of of a string, it replaces the comment in the document. Other types of
return values are ignored. return values are ignored.
If the html file is being accessed as a @(litchar "file:") url, the If the html file is being accessed as a @litchar{file:} url, the
@scheme[current-load-relative-directory] parameter is set to the @scheme[current-load-relative-directory] parameter is set to the
directory during the evaluation of the mzscheme code (in both directory during the evaluation of the mzscheme code (in both
examples). The Scheme code is executed through @scheme[eval]. examples). The Scheme code is executed through @scheme[eval].
The @(litchar "MZSCHEME") forms are disabled unless the web page is a The @litchar{MZSCHEME} forms are disabled unless the web page is a
@(litchar "file:") url that points into the @scheme[doc] collection. @litchar{file:} url that points into the @scheme[doc] collection.
@defproc[(open-url [url (or/c url? string? input-port?)]) (is-a?/c hyper-frame%)]{ @defproc[(open-url [url (or/c url? string? input-port?)]) (is-a?/c hyper-frame%)]{
Opens the given url Opens the given url in a vanilla browser frame and returns the
in a vanilla browser frame and returns frame. The frame is an instance of @scheme[hyper-frame%].
the frame. The frame is an instance of
@scheme[hyper-frame%].
} }
@defboolparam[html-img-ok ok?]{ @defboolparam[html-img-ok ok?]{
A parameter that determines whether the browser attempts to A parameter that determines whether the browser attempts to download
download and render images. and render images.
} }
@defboolparam[html-eval-ok ok?]{ @defboolparam[html-eval-ok ok?]{
A parameter that determines whether @(litchar "MZSCHEME=") A parameter that determines whether @litchar{MZSCHEME=} tags are
tags are evaluated. evaluated.
} }
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@ -108,8 +107,8 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmethod[(get-hyper-panel%) (subclass?/c panel%)]{ @defmethod[(get-hyper-panel%) (subclass?/c panel%)]{
Returns the class that is instantiated when the frame is created. Returns the class that is instantiated when the frame is created.
Must be a panel with hyper-panel-mixin mixed in. Defaults to Must be a panel with hyper-panel-mixin mixed in. Defaults to just
just returning @scheme[hyper-panel%]. returning @scheme[hyper-panel%].
} }
@defmethod[(get-hyper-panel) (is-a?/c panel%)]{ @defmethod[(get-hyper-panel) (is-a?/c panel%)]{
@ -119,37 +118,40 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@defclass[hyper-no-show-frame% (hyper-frame-mixin (frame:status-line-mixin frame:basic%)) ()] @defclass[hyper-no-show-frame%
(hyper-frame-mixin (frame:status-line-mixin frame:basic%))
()]
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@defmixin[hyper-no-show-frame-mixin (frame%) ()]{ @defmixin[hyper-no-show-frame-mixin (frame%) ()]{
The same as the @scheme[hyper-frame-mixin], except that it The same as the @scheme[hyper-frame-mixin], except that it doesn't
doesn't show the frame and the initialization arguments show the frame and the initialization arguments are unchanged.
are unchanged.
} }
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@defclass[hyper-frame% (hyper-no-show-frame-mixin (frame:status-line-mixin frame:basic%)) ()] @defclass[hyper-frame%
(hyper-no-show-frame-mixin (frame:status-line-mixin frame:basic%))
()]
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@defmixin[hyper-text-mixin (text%) ()]{ @defmixin[hyper-text-mixin (text%) ()]{
An instance of a @scheme[hyper-text-mixin]-extended class An instance of a @scheme[hyper-text-mixin]-extended class should be
should be displayed only in an instance of a class created displayed only in an instance of a class created with
with @scheme[hyper-canvas-mixin]. @scheme[hyper-canvas-mixin].
@defconstructor/auto-super[([url (or/c url? string? input-port?)] @defconstructor/auto-super[([url (or/c url? string? input-port?)]
[status-frame (or/c (is-a?/c top-level-window<%>) false/c)] [status-frame
(or/c (is-a?/c top-level-window<%>) false/c)]
[post-data (or/c false/c bytes?)])]{ [post-data (or/c false/c bytes?)])]{
The @scheme[url] is loaded into the @scheme[text%] object The @scheme[url] is loaded into the @scheme[text%] object (using the
(using the @method[hyper-text-mixin reload] method), a @method[hyper-text-mixin reload] method), a top-level window for
top-level window for status messages and dialogs, a progress status messages and dialogs, a progress procedure used as for
procedure used as for @scheme[get-url], and either @scheme[#f] @scheme[get-url], and either @scheme[#f] or a post string to be sent
or a post string to be sent to a web server (technically to a web server (technically changing the GET to a POST).
changing the GET to a POST).
Sets the autowrap-bitmap to @scheme[#f]. Sets the autowrap-bitmap to @scheme[#f].
} }
@ -168,8 +170,8 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
} }
@defmethod[(get-url) (or/c url? string? input-port? false/c)]{ @defmethod[(get-url) (or/c url? string? input-port? false/c)]{
Returns the URL displayed by the editor, or @scheme[#f] if there Returns the URL displayed by the editor, or @scheme[#f] if there is
is none. none.
} }
@defmethod[(get-title) string?]{ @defmethod[(get-title) string?]{
@ -190,13 +192,11 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmethod[(find-tag [name/number (or/c string? exact-nonnegative-integer?)]) @defmethod[(find-tag [name/number (or/c string? exact-nonnegative-integer?)])
(or/c exact-nonnegative-integer? false/c)]{ (or/c exact-nonnegative-integer? false/c)]{
Finds the location of a tag in the buffer (where tags Finds the location of a tag in the buffer (where tags are installed
are installed in HTML with @(litchar "<A in HTML with @litchar{<A NAME="name">}) and returns its position.
NAME=\"name\">")) and returns its position. If If @scheme[name] is a number, the number is returned (assumed to be
@scheme[name] is a number, the number is returned an offset rather than a tag). Otherwise, if the tag is not found,
(assumed to be an offset rather than a @scheme[#f] is returned.
tag). Otherwise, if the tag is not found, @scheme[#f]
is returned.
} }
@defmethod[(remove-tag [name string?]) void?]{ @defmethod[(remove-tag [name string?]) void?]{
@ -230,10 +230,9 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
} }
@defmethod[(eval-scheme-string [str string?]) any]{ @defmethod[(eval-scheme-string [str string?]) any]{
Called to handle the @(litchar "<A MZSCHEME=\"expr\">...</A>") Called to handle the @litchar{<A MZSCHEME="expr">...</A>} tag and
tag and @(litchar "<! MZSCHEME=\"expr\">") comments (see above). @litchar{<! MZSCHEME="expr">} comments (see above). Evaluates the
Evaluates the string; if the result is a string, string; if the result is a string, it is opened as an HTML page.
it is opened as an HTML page.
} }
@defmethod[(reload) void?]{ @defmethod[(reload) void?]{
@ -244,13 +243,11 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
} }
@defmethod[(remap-url [url (or/c url? string?)]) (or/c url? string?)]{ @defmethod[(remap-url [url (or/c url? string?)]) (or/c url? string?)]{
When visiting a new page, this method is called to remap When visiting a new page, this method is called to remap the url.
the url. The remapped url is used in place of the The remapped url is used in place of the original url. If this
original url. If this method returns @scheme[#f], the page doesn't method returns @scheme[#f], the page doesn't go anywhere.
go anywhere.
This method may be killed (if the user clicks the This method may be killed (if the user clicks the ``stop'' button).
``stop'' button).
} }
@defmethod[(get-hyper-keymap) (is-a?/c keymap%)]{ @defmethod[(get-hyper-keymap) (is-a?/c keymap%)]{
@ -264,8 +261,8 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defclass[hyper-text% (hyper-text-mixin text:keymap%) ()]{ @defclass[hyper-text% (hyper-text-mixin text:keymap%) ()]{
Extends the @scheme[text:keymap%] class to support standard Extends the @scheme[text:keymap%] class to support standard key
key bindings in the browser window. bindings in the browser window.
} }
@ -273,9 +270,8 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmixin[hyper-canvas-mixin (editor-canvas%) ()]{ @defmixin[hyper-canvas-mixin (editor-canvas%) ()]{
A @scheme[hyper-can-mixin]-extended canvas's parent should be A @scheme[hyper-can-mixin]-extended canvas's parent should be an
an instance of a class derived with instance of a class derived with @scheme[hyper-panel-mixin].
@scheme[hyper-panel-mixin].
@defconstructor/auto-super[()]{ @defconstructor/auto-super[()]{
} }
@ -283,20 +279,18 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmethod[(get-editor%) (subclass?/c text%)]{ @defmethod[(get-editor%) (subclass?/c text%)]{
Returns the class used to implement the editor in the browser Returns the class used to implement the editor in the browser
window. It should be derived from @scheme[hyper-text%] and window. It should be derived from @scheme[hyper-text%] and should
should pass on the initialization arguments to pass on the initialization arguments to @scheme[hyper-text%].
@scheme[hyper-text%].
The dynamic extent of the initialization of this The dynamic extent of the initialization of this editor is called on
editor is called on a thread that may be killed (via a a thread that may be killed (via a custodian shutdown). In that
custodian shutdown). In that case, the editor in the browser's case, the editor in the browser's editor-canvas may not be an
editor-canvas may not be an instance of this class. instance of this class.
} }
@defmethod[(current-page) any/c]{ @defmethod[(current-page) any/c]{
Returns a representation of the currently displayed page, which Returns a representation of the currently displayed page, which
includes a particular editor and a visible range within the includes a particular editor and a visible range within the editor.
editor.
} }
@defmethod[(goto-url [url (or/c url? string?)] @defmethod[(goto-url [url (or/c url? string?)]
@ -304,21 +298,21 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
[progress-proc (boolean? . -> . any) void] [progress-proc (boolean? . -> . any) void]
[post-data (or/c bytes? false/c) #f]) [post-data (or/c bytes? false/c) #f])
void?]{ void?]{
Changes to the given url, loading it by calling the @scheme[make-editor] Changes to the given url, loading it by calling the
method. If @scheme[relative-to-url] is not @scheme[#f], it must be @scheme[make-editor] method. If @scheme[relative-to-url] is not
a URL for resolving @scheme[url] as a relative URL. @scheme[#f], it must be a URL for resolving @scheme[url] as a
@scheme[url] may also be a port, in which case, relative URL. @scheme[url] may also be a port, in which case,
@scheme[relative-to-url] must be @scheme[#f]. @scheme[relative-to-url] must be @scheme[#f].
The @scheme[progress-proc] procedure is called with a boolean at the The @scheme[progress-proc] procedure is called with a boolean at the
point where the URL has been resolved and enough progress has point where the URL has been resolved and enough progress has been
been made to dismiss any message that the URL is being made to dismiss any message that the URL is being resolved. The
resolved. The procedure is called with @scheme[#t] if the URL will be procedure is called with @scheme[#t] if the URL will be loaded into
loaded into a browser window, @scheme[#f] otherwise (e.g., the user will a browser window, @scheme[#f] otherwise (e.g., the user will save
save the URL content to a file). the URL content to a file).
If @scheme[post-data-bytes] is a byte string instead of false, the URL If @scheme[post-data-bytes] is a byte string instead of false, the
GET is changed to a POST with the given data. URL GET is changed to a POST with the given data.
} }
@defmethod[(set-page [page any/c] [notify? any/c]) void?]{ @defmethod[(set-page [page any/c] [notify? any/c]) void?]{
@ -337,31 +331,30 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmixin[hyper-panel-mixin (area-container<%>) ()]{ @defmixin[hyper-panel-mixin (area-container<%>) ()]{
@defconstructor/auto-super[([info-line? any/c])]{ @defconstructor/auto-super[([info-line? any/c])]{
Creates controls and a hyper text canvas. The Creates controls and a hyper text canvas. The controls permit a
controls permit a user to move back and forth in the hypertext user to move back and forth in the hypertext history.
history.
The @scheme[info-line?] argument indicates whether the browser The @scheme[info-line?] argument indicates whether the browser
should contain a line to display special @(litchar "DOCNOTE") should contain a line to display special @litchar{DOCNOTE} tags in a
tags in a page. Such tags are used primarily by the PLT page. Such tags are used primarily by the PLT documentation.
documentation.} }
@defmethod[(make-canvas [container (is-a?/c area-container<%>)]) void?]{ @defmethod[(make-canvas [container (is-a?/c area-container<%>)]) void?]{
Creates the panel's hypertext canvas, an instance of a class Creates the panel's hypertext canvas, an instance of a class derived
derived using @scheme[hyper-canvas-mixin]. This using @scheme[hyper-canvas-mixin]. This method is called during
method is called during initialization. initialization.
} }
@defmethod[(get-canvas%) (subclass?/c editor-canvas%)]{ @defmethod[(get-canvas%) (subclass?/c editor-canvas%)]{
Returns the class instantiated by make-canvas. It must be derived from Returns the class instantiated by make-canvas. It must be derived
@scheme[hyper-canvas-mixin]. from @scheme[hyper-canvas-mixin].
} }
@defmethod[(make-control-bar-panel [container (is-a?/c area-container<%>)]) @defmethod[(make-control-bar-panel [container (is-a?/c area-container<%>)])
any/c]{ any/c]{
Creates the panel's sub-container for the control bar containing Creates the panel's sub-container for the control bar containing the
the navigation buttons. If @scheme[#f] is returned, the panel will navigation buttons. If @scheme[#f] is returned, the panel will have
have no control bar. The default method instantiates no control bar. The default method instantiates
@scheme[horizontal-panel%]. @scheme[horizontal-panel%].
} }
@ -385,17 +378,16 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmethod[(leaving-page [page any/c] [new-page any/c]) @defmethod[(leaving-page [page any/c] [new-page any/c])
any]{ any]{
This method is called by the hypertext canvas to notify the This method is called by the hypertext canvas to notify the panel
panel that the hypertext page changed. The @scheme[page] is @scheme[#f] that the hypertext page changed. The @scheme[page] is @scheme[#f]
if @scheme[new-page] is the first page for the canvas. See also if @scheme[new-page] is the first page for the canvas. See also
@scheme[page->editor]. @scheme[page->editor].
} }
@defmethod[(filter-notes [notes (listof string?)]) @defmethod[(filter-notes [notes (listof string?)])
(listof string?)]{ (listof string?)]{
Given the notes from a page as a list of strings (where Given the notes from a page as a list of strings (where each string
each string is a note), returns a single string to print is a note), returns a single string to print above the page.
above the page.
} }
@defmethod[(reload) void?]{ @defmethod[(reload) void?]{
@ -411,9 +403,8 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@defproc[(editor->page [editor (is-a?/c text%)]) any/c]{ @defproc[(editor->page [editor (is-a?/c text%)]) any/c]{
Creates a page record for the given editor, Creates a page record for the given editor, suitable for use with the
suitable for use with the @scheme[set-page] method of @scheme[set-page] method of @scheme[hyper-canvas-mixin].
@scheme[hyper-canvas-mixin].
} }
@defproc[(page->editor [page any/c]) (is-a?/c text%)]{ @defproc[(page->editor [page any/c]) (is-a?/c text%)]{
@ -421,21 +412,20 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
} }
@defparam[bullet-size n exact-nonnegative-integer?]{ @defparam[bullet-size n exact-nonnegative-integer?]{
Parameter controlling the point size of a Parameter controlling the point size of a bullet.
bullet.
} }
@defclass[image-map-snip% snip% ()]{ @defclass[image-map-snip% snip% ()]{
Instances of this class behave like @scheme[image-snip%] objects, Instances of this class behave like @scheme[image-snip%] objects,
except they have a @(litchar "<map> ... </map>") associated with them and except they have a @litchar{<map> ... </map>} associated with them and
when clicking on them (in the map) they will cause their when clicking on them (in the map) they will cause their init arg text
init arg text to follow the corresponding link. to follow the corresponding link.
@defconstructor[([html-text (is-a?/c html-text<%>)])]{ @defconstructor[([html-text (is-a?/c html-text<%>)])]{
} }
@defmethod[(set-key [key string?]) void?]{ @defmethod[(set-key [key string?]) void?]{
Sets the key for the image map (eg, "#key"). Sets the key for the image map (eg, @scheme["#key"]).
} }
@defmethod[(get-key) string?]{ @defmethod[(get-key) string?]{
@ -446,10 +436,9 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
[region (listof number?)] [region (listof number?)]
[href string?]) [href string?])
void?]{ void?]{
Registers the shape named by @scheme[shape] whose Registers the shape named by @scheme[shape] whose coordinates are
coordinates are specified by @scheme[region] to go to specified by @scheme[region] to go to @scheme[href] when that region
@scheme[href] when that region of the image of the image is clicked on.
is clicked on.
} }
} }
@ -460,9 +449,9 @@ The @(litchar "MZSCHEME") forms are disabled unless the web page is a
@defmodule[browser/browser-unit] @defmodule[browser/browser-unit]
@defthing[browser@ unit?]{ @defthing[browser@ unit?]{
Imports @scheme[mred^], @scheme[tcp^], and @scheme[url^], and exports
Imports @scheme[mred^], @scheme[tcp^], and @scheme[url^], and exports @scheme[browser^].
@scheme[browser^].} }
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@ -471,9 +460,8 @@ Imports @scheme[mred^], @scheme[tcp^], and @scheme[url^], and exports
@defmodule[browser/browser-sig] @defmodule[browser/browser-sig]
@defsignature[browser^ ()]{ @defsignature[browser^ ()]{
Includes all of the bindings of the @schememodname[browser] library.
Includes all of the bindings of the @schememodname[browser] }
library.}
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@ -484,13 +472,12 @@ library.}
@definterface[html-text<%> (text%)]{ @definterface[html-text<%> (text%)]{
@defmethod[(get-url) (or/c url? string? false/c)]{ @defmethod[(get-url) (or/c url? string? false/c)]{
Returns a base URL used for building Returns a base URL used for building relative URLs, or @scheme[#f]
relative URLs, or @scheme[#f] if no base is available. if no base is available.
} }
@defmethod[(set-title [str string?]) void?]{ @defmethod[(set-title [str string?]) void?]{
Registers the title @scheme[str] Registers the title @scheme[str] for the rendered page.
for the rendered page.
} }
@defmethod[(add-link [start exact-nonnegative-integer?] @defmethod[(add-link [start exact-nonnegative-integer?]
@ -542,16 +529,15 @@ library.}
[load-img? any/c] [load-img? any/c]
[eval-mz? any/c]) [eval-mz? any/c])
void?]{ void?]{
Reads HTML from @scheme[in] and renders it to @scheme[dest]. If
Reads HTML from @scheme[in] and renders it to @scheme[dest]. @scheme[load-img?] is @scheme[#f], then images are rendered as Xed-out
If @scheme[load-img?] is @scheme[#f], then images are rendered boxes. If @scheme[eval-mz?] is @scheme[#f], then @litchar{MZSCHEME}
as Xed-out boxes. If @scheme[eval-mz?] is @scheme[#f], then hyperlink expressions and comments are not evaluated.
@litchar{MZSCHEME} hyperlink expressions and comments are not
evaluated.
Uses the style named @scheme["Html Standard"] in the editor's Uses the style named @scheme["Html Standard"] in the editor's
style-list (if it exists) for all of the inserted text's style-list (if it exists) for all of the inserted text's default
default style.} style.
}
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@ -560,9 +546,9 @@ library.}
@defmodule[browser/external] @defmodule[browser/external]
@defproc[(send-url [str null] [separate-window? void #t]) null]{ @defproc[(send-url [str null] [separate-window? void #t]) null]{
Like @net-send-url from @scheme[net/sendurl] , but under Unix, Like @net-send-url from @scheme[net/sendurl], but under Unix, the user
the user is prompted for a browser to use if none is recorded is prompted for a browser to use if none is recorded in the
in the preferences file. preferences file.
} }
@defproc[(browser-preference? [v any/c]) boolean?]{ @defproc[(browser-preference? [v any/c]) boolean?]{
@ -570,22 +556,23 @@ library.}
} }
@defproc[(update-browser-preference [url (or/c string? false/c)]) void?]{ @defproc[(update-browser-preference [url (or/c string? false/c)]) void?]{
Under Unix, prompts the user for a browser preference and records Under Unix, prompts the user for a browser preference and records the
the user choice as a framework preference (even if one is already user choice as a framework preference (even if one is already
recorded). If @scheme[url] is not @scheme[#f], it is used in the recorded). If @scheme[url] is not @scheme[#f], it is used in the
dialog to explain which URL is to be opened; if it is @scheme[#f], dialog to explain which URL is to be opened; if it is @scheme[#f], the
the @scheme['internal] will be one of the options for the user. @scheme['internal] will be one of the options for the user.
} }
@defproc[(install-help-browser-preference-panel) void?]{ @defproc[(install-help-browser-preference-panel) void?]{
Installs a framework preference panel for ``Browser'' options. Installs a framework preference panel for ``Browser'' options.
} }
@defproc[(add-to-browser-prefs-panel [proc ((is-a?/c panel%) . -> . any)]) void?]{ @defproc[(add-to-browser-prefs-panel [proc ((is-a?/c panel%) . -> . any)])
The @scheme[proc] is called when the ``Browser'' panel is constructed for void?]{
preferences. The supplied argument is the panel, so @scheme[proc] can add The @scheme[proc] is called when the ``Browser'' panel is constructed
additional option controls. If the panel is already created, @scheme[proc] for preferences. The supplied argument is the panel, so @scheme[proc]
is called immediately. can add additional option controls. If the panel is already created,
@scheme[proc] is called immediately.
} }
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------
@ -595,7 +582,6 @@ library.}
@defmodule[browser/tool] @defmodule[browser/tool]
@defthing[tool@ unit?]{ @defthing[tool@ unit?]{
A unit that implements a DrScheme tool to add the ``Browser'' A unit that implements a DrScheme tool to add the ``Browser''
preference panel. preference panel.
} }