rackety slideshow doc

This commit is contained in:
Matthew Flatt 2010-05-02 12:19:25 -06:00
parent fb4af54436
commit ce21cf9fd8
11 changed files with 618 additions and 618 deletions

View File

@ -42,7 +42,7 @@ To document a collection or @|PLaneT| package:
@racket[racket] for writing Racket documentation.}
@item{Add the following entry to your collect or package's
@filepath{info.ss}:
@filepath{info.rkt}:
@racketblock[
(define scribblings '(("manual.scrbl" ())))
@ -54,7 +54,7 @@ To document a collection or @|PLaneT| package:
the whole right-hand side of the definition is already
quoted).
If you do not already have an @filepath{info.ss} module,
If you do not already have an @filepath{info.rkt} module,
here's a suitable complete module:
@racketmod[
@ -172,7 +172,7 @@ The following example illustrates section hyperlinks:
}|
Since the page is so short, the hyperlinks in the above example are
more effective if you change the @filepath{info.ss} file to add the
more effective if you change the @filepath{info.rkt} file to add the
@racket['multi-file] flag:
@racketblock[
@ -213,22 +213,22 @@ and they declare hyperlink targets for @racket[racket]-based
hyperlinks.
To document a @racket[my-helper] procedure that is exported by
@filepath{helper.ss} in the @filepath{my-lib} collection that contains
@filepath{helper.rkt} in the @filepath{my-lib} collection that contains
@filepath{manual.scrbl}:
@itemize[
@item{Use @racket[(require (for-label "helper.ss"))] to import the
binding information about the bindings of @filepath{helper.ss}
@item{Use @racket[(require (for-label "helper.rkt"))] to import the
binding information about the bindings of @filepath{helper.rkt}
for use when typesetting identifiers. A relative reference
@racket["helper.ss"] works since it is relative to the
@racket["helper.rkt"] works since it is relative to the
documentation source.}
@item{Add a @tt|{@defmodule[my-lib/helper]}| declaration, which
specifies the library that is being documented within the
section. The @racket[defmodule] form needs an absolute module
name @racket[mylib/helper], instead of a relative reference
@racket["helper.ss"], since the module path given to
@racket["helper.rkt"], since the module path given to
@racket[defmodule] appears verbatim in the generated
documentation.}
@ -244,7 +244,7 @@ following:
@verbatim[#:indent 2]|{
#lang scribble/manual
@(require (for-label racket
"helper.ss"))
"helper.rkt"))
@title{My Library}
@ -290,7 +290,7 @@ generates:
@item{If you use @racket[my-helper] in any documentation now, as long
as that documentation source also has a @racket[(require
(for-label ....))] of @filepath{helper.ss}, then the
(for-label ....))] of @filepath{helper.rkt}, then the
reference is hyperlinked to the definition above.}
]
@ -309,15 +309,15 @@ To use @racket[examples], the procedures to document must be suitable
for use at documentation time; in fact, @racket[examples] uses
bindings introduced into the document source by
@racket[require]. Thus, to generate examples using @racket[my-helper]
from the previous section, @filepath{helper.ss} must be imported both
from the previous section, @filepath{helper.rkt} must be imported both
via @racket[require-for-label] and @racket[require]:
@verbatim[#:indent 2]|{
#lang scribble/manual
@(require scribble/eval ; <--- added
"helper.ss" ; <--- added
"helper.rkt" ; <--- added
(for-label racket
"helper.ss"))
"helper.rkt"))
@title{My Library}
@ -365,7 +365,7 @@ Revising @filepath{cows.scrbl} from the previous section:
See @secref["singing"].
}|
To run this example, remember to change @filepath{info.ss} to add the
To run this example, remember to change @filepath{info.rkt} to add the
@racket['multi-page] style. You may also want to add a call to
@racket[table-of-contents] in @filepath{manual.scrbl}.

View File

@ -35,7 +35,7 @@ changes that make it suitable as a preprocessor language:
@; TODO:
@; * make all example sections be subsections,
@; * add a reference section,
@; * a section on "scribble/text.ss"
@; * a section on "scribble/text.rkt"
@; * maybe a section on additional utilities: begin/text
@;--------------------------------------------------------------------
@ -926,13 +926,13 @@ trivial: the preprocessor source is still source code in a module, so
you can @racket[require] additional files with utility functions.
@example|-{#lang scribble/text
@(require "itemize.ss")
@(require "itemize.rkt")
Todo:
@itemize[@list{Hack some}
@list{Sleep some}
@list{Hack some
more}]
---***--- itemize.ss
---***--- itemize.rkt
#lang racket
(provide itemize)
(define (itemize . items)
@ -953,14 +953,14 @@ often be useful here, since such files need to deal with texts. Using
it, it is easy to include a lot of textual content.
@example|-{#lang scribble/text
@(require "stuff.ss")
@(require "stuff.rkt")
Todo:
@itemize[@list{Hack some}
@list{Sleep some}
@list{Hack some
more}]
@summary
---***--- stuff.ss
---***--- stuff.rkt
#lang at-exp racket/base
(require racket/list)
(provide (all-defined-out))

View File

@ -36,7 +36,7 @@ to the renderers. For example, the @exec{scribble} command-line tool
might, in the future, extract rendering mixins from a document module
(in addition to the document proper).
See the @filepath{base-render.ss} source for more information about
See the @filepath{base-render.rkt} source for more information about
the methods of the renderer. Documents built with higher layers, such
as @racketmodname[scribble/manual], generally do not call the render
object's methods directly.

View File

@ -29,7 +29,7 @@ same way that the module system keeps expansion-time code separate
from run-time code.
For an example use, see the @filepath{file} collection's
@filepath{gif.ss} source file and the corresponding extraction in
@filepath{gif.rkt} source file and the corresponding extraction in
@filepath{scribblings/gif.scrbl}. As that example illustrates,
prefixing the module declaration with

View File

@ -1,15 +1,15 @@
#lang scribble/doc
@(require "ss.ss"
(for-label slideshow/code
scheme/gui/base))
racket/gui/base))
@(define stx-obj
(tech #:doc '(lib "scribblings/reference/reference.scrbl") "syntax object"))
@title{Typesetting Scheme Code}
@title{Typesetting Racket Code}
@defmodule[slideshow/code]{The @scheme[slideshow/code] library
provides utilities for typesetting Scheme code as a pict.}
@defmodule[slideshow/code]{The @racket[slideshow/code] library
provides utilities for typesetting Racket code as a pict.}
@defproc[(typeset-code [stx syntax?]) pict?]{
@ -18,62 +18,62 @@ source-location information of the syntax object determines the line
breaks, line indenting, and space within a row. Empty rows are
ignored.
Beware that if you use @scheme[read-syntax] on a file port, you may
have to turn on line counting via @scheme[port-count-lines!] for the
Beware that if you use @racket[read-syntax] on a file port, you may
have to turn on line counting via @racket[port-count-lines!] for the
code to typeset properly. Also beware that when a source file
containing a @scheme[syntax] or @scheme[quote-syntax] form is
containing a @racket[syntax] or @racket[quote-syntax] form is
compiled, source location information is omitted from the compiled
@|stx-obj|.
Normally, @scheme[typeset-code] is used through the @scheme[code]
Normally, @racket[typeset-code] is used through the @racket[code]
syntactic form, which works properly with compilation, and that
escapes to pict-producing code via @scheme[unsyntax]. See also
@scheme[define-code].
escapes to pict-producing code via @racket[unsyntax]. See also
@racket[define-code].
Embedded picts within @scheme[stx] are used directly. Row elements are
combined using and operator like @scheme[htl-append], so use
@scheme[code-align] (see below) as necessary to add an ascent to
Embedded picts within @racket[stx] are used directly. Row elements are
combined using and operator like @racket[htl-append], so use
@racket[code-align] (see below) as necessary to add an ascent to
ascentless picts. More precisely, creation of a line of code uses
@scheme[pict-last] to determine the end point of the element most
@racket[pict-last] to determine the end point of the element most
recently added to a line; the main effect is that closing parentheses
are attached in the right place when a multi-line pict is embedded in
@scheme[stx].
@racket[stx].
An identifier that starts with @litchar{_} is italicized in the pict,
and the @litchar{_} is dropped, unless the
@scheme[code-italic-underscore-enabled] parameter is set to
@scheme[#f]. Also, unless @scheme[code-scripts-enabled] is set to
@scheme[#f], @litchar{_} and @litchar{^} in the middle of a word
@racket[code-italic-underscore-enabled] parameter is set to
@racket[#f]. Also, unless @racket[code-scripts-enabled] is set to
@racket[#f], @litchar{_} and @litchar{^} in the middle of a word
create superscripts and subscripts, respectively (like TeX); for
example @schemeidfont{foo^4_ok} is displayed as the identifier
@schemeidfont{foo} with a @schemeidfont{4} superscript and an
@schemeidfont{ok} subscript.
example @racketidfont{foo^4_ok} is displayed as the identifier
@racketidfont{foo} with a @racketidfont{4} superscript and an
@racketidfont{ok} subscript.
Further, uses of certain identifiers in @scheme[stx] typeset
Further, uses of certain identifiers in @racket[stx] typeset
specially:
@itemize[
@item{@as-index{@schemeidfont{code:blank}} --- produces a space.}
@item{@as-index{@racketidfont{code:blank}} --- produces a space.}
@item{@scheme[(#,(as-index (schemeidfont "code:comment")) _s ...)]
--- produces a comment block, with each @scheme[_s] on its own line,
where each @scheme[_s] must be a string or a pict.}
@item{@racket[(#,(as-index (racketidfont "code:comment")) _s ...)]
--- produces a comment block, with each @racket[_s] on its own line,
where each @racket[_s] must be a string or a pict.}
@item{@scheme[(#,(as-index (schemeidfont "code:line")) _datum ...)]
--- typesets the @scheme[_datum] sequence, which is mostly useful for
the top-level sequence, since @scheme[typeset-code] accepts only one
@item{@racket[(#,(as-index (racketidfont "code:line")) _datum ...)]
--- typesets the @racket[_datum] sequence, which is mostly useful for
the top-level sequence, since @racket[typeset-code] accepts only one
argument.}
@item{@scheme[(#,(as-index (schemeidfont "code:contract")) _datum
...)] --- like @schemeidfont{code:line}, but every @scheme[_datum]
@item{@racket[(#,(as-index (racketidfont "code:contract")) _datum
...)] --- like @racketidfont{code:line}, but every @racket[_datum]
is colored as a comment, and a @litchar{;} is prefixed to every line.}
@item{@scheme[(#,(as-index (schemeidfont "code:template")) _datum
...)] --- like @schemeidfont{code:line}, but a @litchar{;} is
@item{@racket[(#,(as-index (racketidfont "code:template")) _datum
...)] --- like @racketidfont{code:line}, but a @litchar{;} is
prefixed to every line.}
@item{@schemeidfont{$} --- typesets as a vertical bar (for no
@item{@racketidfont{$} --- typesets as a vertical bar (for no
particularly good reason).}
]}
@ -81,13 +81,13 @@ specially:
@defform[(code datum ...)]{
The macro form of @scheme[typeset-code]. Within a @scheme[datum],
@scheme[unsyntax] can be used to escape to an expression.
The macro form of @racket[typeset-code]. Within a @racket[datum],
@racket[unsyntax] can be used to escape to an expression.
For more information, see @scheme[typeset-code] and
@scheme[define-code], since @scheme[code] is defined as
For more information, see @racket[typeset-code] and
@racket[define-code], since @racket[code] is defined as
@schemeblock[
@racketblock[
(define-code code typeset-code)
]}
@ -95,8 +95,8 @@ For more information, see @scheme[typeset-code] and
@defparam[current-code-font style text-style/c]{
Parameter for a base font used to typeset text. The default is
@scheme[`(bold . modern)]. For even more control, see
@scheme[current-code-tt].}
@racket[`(bold . modern)]. For even more control, see
@racket[current-code-tt].}
@defparam[current-code-tt proc (string? . -> . pict?)]{
@ -104,19 +104,19 @@ Parameter for a base font used to typeset text. The default is
Parameter for a one-argument procedure to turn a
string into a pict, used to typeset text. The default is
@schemeblock[
@racketblock[
(lambda (s) (text s (current-code-font) (current-font-size)))
]
This procedure is not used to typeset subscripts or other items that
require font changes, where @scheme[current-code-font] is used
require font changes, where @racket[current-code-font] is used
directly.}
@defparam[current-code-line-sep amt real?]{
A parameter that determines the spacing between lines of typeset code.
The default is @scheme[2].}
The default is @racket[2].}
@defparam[current-comment-color color (or/c string? (is-a?/c color%))]{
@ -127,7 +127,7 @@ A parameter for the color of comments.}
@defparam[current-keyword-color color (or/c string? (is-a?/c color%))]{
A parameter for the color of syntactic-form names. See
@scheme[current-keyword-list].}
@racket[current-keyword-list].}
@defparam[current-id-color color (or/c string? (is-a?/c color%))]{
@ -139,13 +139,13 @@ names or constants.}
@defparam[current-literal-color color (or/c string? (is-a?/c color%))]{
A parameter for the color of literal values, such as strings and
numbers. See also @scheme[current-literal-list]}
numbers. See also @racket[current-literal-list]}
@defparam[current-const-color color (or/c string? (is-a?/c color%))]{
A parameter for the color of constant names. See
@scheme[current-const-list].}
@racket[current-const-list].}
@defparam[current-base-color color (or/c string? (is-a?/c color%))]{
@ -156,56 +156,56 @@ A parameter for the color of everything else.}
@defparam[current-reader-forms syms (listof symbol?)]{
Parameter for a list of symbols indicating which built-in reader forms
should be used. The default is @scheme['(quote quasiquote unquote
should be used. The default is @racket['(quote quasiquote unquote
unquote-splicing syntax quasisyntax unsyntax unsyntax-splicing)].
Remove a symbol to suppress the corresponding reader output.}
@defproc[(code-align [pict pict?]) pict?]{
Adjusts the ascent of @scheme[pict] so that its bottom aligns with the
baseline for text; use this function when @scheme[pict] has no
Adjusts the ascent of @racket[pict] so that its bottom aligns with the
baseline for text; use this function when @racket[pict] has no
ascent.}
@defparam[current-keyword-list names (listof string?)]{
A list of strings to color as syntactic-form names. The default
includes most of the forms provided by @scheme[scheme/base].}
includes most of the forms provided by @racket[racket/base].}
@defparam[current-const-list names (listof string?)]{
A list of strings to color as constant names. The default is
@scheme[null].}
@racket[null].}
@defparam[current-literal-list names (listof string?)]{
A list of strings to color as literals, in addition to literals such
as strings. The default is @scheme[null].}
as strings. The default is @racket[null].}
@defthing[mzscheme-const-list (listof string?)]{
A list of strings that could be used to initialize the
@scheme[current-const-list] parameter.}
@racket[current-const-list] parameter.}
@defboolparam[code-colorize-enabled on?]{
A parameter to enable or disable all code coloring. The default is
@scheme[#t].}
@racket[#t].}
@defboolparam[code-colorize-quote-enabled on?]{
A parameter to control whether under a @scheme[quote] is colorized as
a literal (as in this documentation). The default is @scheme[#t].}
A parameter to control whether under a @racket[quote] is colorized as
a literal (as in this documentation). The default is @racket[#t].}
@defboolparam[code-italic-underscore-enabled on?]{
A parameter to control whether @litchar{_}-prefixed identifiers are
italicized (dropping the @litchar{_}). The default is @scheme[#t].}
italicized (dropping the @litchar{_}). The default is @racket[#t].}
@defboolparam[code-scripts-enabled on?]{
@ -215,60 +215,60 @@ recognized in an identifier.}
@defform*[[(define-code code-id typeset-code-id)
(define-code code-id typeset-code-id escape-id)]]{
Defines @scheme[code-id] as a macro that uses
@scheme[typeset-code-id], which is a function with the same input as
@scheme[typeset-code]. The @scheme[escape-id] form defaults to
@scheme[unsyntax].
Defines @racket[code-id] as a macro that uses
@racket[typeset-code-id], which is a function with the same input as
@racket[typeset-code]. The @racket[escape-id] form defaults to
@racket[unsyntax].
The resulting @scheme[code-id] syntactic form takes a sequence of
@scheme[_datum]s:
The resulting @racket[code-id] syntactic form takes a sequence of
@racket[_datum]s:
@schemeblock[
@racketblock[
(code-id _datum ...)
]
It produces a pict that typesets the sequence. Source-location
information for the @scheme[_datum] determines the layout of code in
the resulting pict. The @scheme[code-id] is expanded in such a way
information for the @racket[_datum] determines the layout of code in
the resulting pict. The @racket[code-id] is expanded in such a way
that source location is preserved during compilation (so
@scheme[typeset-code-id] receives a syntax object with source
@racket[typeset-code-id] receives a syntax object with source
locations intact).
If a @scheme[_datum] contains @scheme[(escape-id _expr)]---perhaps as
@SCHEME[#,_expr] when @scheme[escape-id] is @scheme[unsyntax]---then
the @scheme[_expr] is evaluated and the result datum is spliced in
place of the @scheme[escape-id] form in @scheme[_datum]. If the result
If a @racket[_datum] contains @racket[(escape-id _expr)]---perhaps as
@RACKET[#,_expr] when @racket[escape-id] is @racket[unsyntax]---then
the @racket[_expr] is evaluated and the result datum is spliced in
place of the @racket[escape-id] form in @racket[_datum]. If the result
is not a syntax object, it is given the source location of the
@scheme[escape-id] form. A pict value intected this way as a
@scheme[_datum] is rendered as itself.}
@racket[escape-id] form. A pict value intected this way as a
@racket[_datum] is rendered as itself.}
@defform[(define-exec-code (pict-id runnable-id string-id)
datum ...)]{
Binds @scheme[pict-id] to the result of @scheme[(code datum ...)],
except that if an identifier @schemeidfont{_} appears anywhere in a
@scheme[datum], then the identifier and the following expression are
not included for @scheme[code].
Binds @racket[pict-id] to the result of @racket[(code datum ...)],
except that if an identifier @racketidfont{_} appears anywhere in a
@racket[datum], then the identifier and the following expression are
not included for @racket[code].
Meanwhile, @scheme[runnable-id] is bound to a @|stx-obj| that wraps
the @scheme[datum]s in a @scheme[begin]. In this case,
@schemeidfont{_}s are removed from the @scheme[datum]s, but not the
following expression. Thus, an @schemeidfont{_} identifier is used to
Meanwhile, @racket[runnable-id] is bound to a @|stx-obj| that wraps
the @racket[datum]s in a @racket[begin]. In this case,
@racketidfont{_}s are removed from the @racket[datum]s, but not the
following expression. Thus, an @racketidfont{_} identifier is used to
comment out an expression from the pict, but have it present in the
@|stx-obj| for evaluation.
The @scheme[string-id] is bound to a string representation of the code
The @racket[string-id] is bound to a string representation of the code
that is in the pict. This string is useful for copying to the
clipboard with @scheme[(send the-clipboard set-clipboard-string
clipboard with @racket[(send the-clipboard set-clipboard-string
string-id 0)].}
@defform[(define-exec-code/scale scale-expr (pict-id runnable-id string-id)
datum ...)]{
Like @scheme[define-exec-code], but with a scale to use via
@scheme[scale/improve-new-text] when generating the pict.}
Like @racket[define-exec-code], but with a scale to use via
@racket[scale/improve-new-text] when generating the pict.}
@deftogether[(
@ -279,15 +279,15 @@ Like @scheme[define-exec-code], but with a scale to use via
)]{
For backward compatibility, the default values for
@scheme[current-comment-color], etc.}
@racket[current-comment-color], etc.}
@defproc[(code-pict-bottom-line-pict [pict pict?])
(or/c pict? #f)]{
The same as @scheme[pict-last], provided for backward compatibility.}
The same as @racket[pict-last], provided for backward compatibility.}
@defproc[(pict->code-pict [pict pict?] [bl-pict (or/c pict? #f)]) pict?]{
Mainly for backward compatibility: returns @scheme[(if bl-pict
Mainly for backward compatibility: returns @racket[(if bl-pict
(use-last pict (or (pict-last bl-pict) bl-pict)))].}

View File

@ -15,21 +15,21 @@
@title{Creating Slide Presentations}
The @schememodname[slideshow] module acts as a language that includes:
The @racketmodname[slideshow] module acts as a language that includes:
@itemize[
@item{all of @schememodname[scheme];}
@item{all of @racketmodname[racket];}
@item{pict-creating functions from @schememodname[slideshow/pict]; and}
@item{pict-creating functions from @racketmodname[slideshow/pict]; and}
@item{slide-composing functions from @schememodname[slideshow/base].}
@item{slide-composing functions from @racketmodname[slideshow/base].}
]
The @schememodname[slideshow] and @schememodname[slideshow/base]
The @racketmodname[slideshow] and @racketmodname[slideshow/base]
module initialization also check the
@scheme[current-command-line-arguments] parameter to configure the
@racket[current-command-line-arguments] parameter to configure the
slide mode (e.g., printing).
The rest of this section repeats information that is presented by the
@ -39,11 +39,11 @@ link.
@section{Slide Basics}
The main Slideshow function is @scheme[slide], which adds a slide to
The main Slideshow function is @racket[slide], which adds a slide to
the presentation with a given content. For example, the ``Hello
World'' presentation can be defined by the following module:
@schememod[
@racketmod[
slideshow
(slide
@ -51,7 +51,7 @@ slideshow
(t "Hello World!"))
]
The @scheme[t] function in this example creates a pict containing the
The @racket[t] function in this example creates a pict containing the
given text using the default font and style.
Executing the above module pops up a slide-presentation window. Type
@ -73,13 +73,13 @@ Alt-q (or Meta-q) to end the slides. Here are more controls:
(list "Alt, Meta, or Cmd with arrow" "move window 10 pixels")
]
The @scheme[slide] function accepts any number of arguments. Each
The @racket[slide] function accepts any number of arguments. Each
argument is a pict to be centered on the slide. The picts are stacked
vertically with @scheme[gap-size] separation between each pict, and
vertically with @racket[gap-size] separation between each pict, and
the total result is centered (as long as there's a gap of at least
@scheme[(* 2 gap-size)] between the title and content).
@racket[(* 2 gap-size)] between the title and content).
@schememod[
@racketmod[
slideshow
(slide
@ -89,10 +89,10 @@ slideshow
]
Various functions format paragraphs and generate bulleted items for
lists. For example, @scheme[item] creates a bulleted paragraph that
lists. For example, @racket[item] creates a bulleted paragraph that
spans (by default) the middle @math{2/3} of the slide:
@schememod[
@racketmod[
slideshow
(slide
@ -103,17 +103,17 @@ slideshow
"could be" (bt "Goodbye Dlrow!")))
]
As the example illustrates, the @scheme[item] function accepts a
As the example illustrates, the @racket[item] function accepts a
mixture of strings and picts, and it formats them as a paragraph.
@; ------------------------------------------------------------------------
@section[#:tag "staging"]{Staging Slides}
The @scheme[slide] function creates a slide as a side effect. It can
The @racket[slide] function creates a slide as a side effect. It can
be put inside a function to abstract over a slide:
@schememod[
@racketmod[
slideshow
(define (slide-n n)
@ -125,42 +125,42 @@ slideshow
(slide-n 2)
(slide-n 3)]
The @scheme[slide] function also has built-in support for some common
multi-slide patterns. Each element argument to @scheme[slide] is
The @racket[slide] function also has built-in support for some common
multi-slide patterns. Each element argument to @racket[slide] is
usually a pict, but there are a few other possibilities:
@itemize[
@item{If an element is @scheme['next], then a slide is generated
@item{If an element is @racket['next], then a slide is generated
containing only the preceding elements, and then the elements are
re-processed without the @scheme['next]. Multiple @scheme['next]
re-processed without the @racket['next]. Multiple @racket['next]
elements generate multiple slides.}
@item{If an element is @scheme['alts], then the next element must be
@item{If an element is @racket['alts], then the next element must be
a list of element lists. Each list up to the last one is appended
to the elements before @scheme['alts] and the resulting list of
to the elements before @racket['alts] and the resulting list of
elements is processed. The last lists is appended to the preceding
elements along with the remaining elements (after the list of
lists) and the result is re-processed.}
@item{A @scheme['nothing] element is ignored (useful as a result of a
@item{A @racket['nothing] element is ignored (useful as a result of a
branching expression).}
@item{A @scheme['next!] element is like @scheme['next], except that
@item{A @racket['next!] element is like @racket['next], except that
it is preserved when condensing (via the @DFlag{condense} flag).}
@item{A @scheme['alts~] element is like @scheme['alts], except that
@item{A @racket['alts~] element is like @racket['alts], except that
it is @italic{not} preserved when condensing.}
@item{A comment produced by @scheme[comment] is ignored, except when
@item{A comment produced by @racket[comment] is ignored, except when
commentary is displayed.}
]
Here's an example to illustrate how @scheme['next] and @scheme['alts]
Here's an example to illustrate how @racket['next] and @racket['alts]
work:
@schememod[
@racketmod[
slideshow
(slide
@ -190,27 +190,27 @@ they are displayed. Thus, one picture unit reliably corresponds
to a ``pixel'' that occupies @math{1/1024} by @math{1/768} of the
screen.
The @scheme[text] form for generating text pictures takes into
The @racket[text] form for generating text pictures takes into
account any expected scaling for the display when measuring
text. (All Slideshow text functions, such as @scheme[t] and
@scheme[item] are built on @scheme[text].) In particular, scaling
text. (All Slideshow text functions, such as @racket[t] and
@racket[item] are built on @racket[text].) In particular, scaling
the picture causes a different font size to be used for drawing
the slide---rather than bitmap-scaling the original font---and
changing the font size by a factor of @math{k} does not
necessarily scale all text dimensions equally by a factor of
@math{k}---because, for most devices, each character must have
integer dimensions. Nevertheless, especially if you use the
@scheme[current-expected-text-scale] parameter, Slideshow is
@racket[current-expected-text-scale] parameter, Slideshow is
usually able to produce good results when the slide is scaled.
More generally, different font sets on different platforms can
change the way a slide is rendered. For example, the @scheme[tt]
change the way a slide is rendered. For example, the @racket[tt]
font on one platform might be slightly wider than on another,
causing different line breaks, and so on. Beware.
Beware also of using bitmaps in slides when the presentation
screen is not @math{1024} by @math{768}. In that case, consider
using @scheme[size-in-pixels] (with the caveat that the resulting
using @racket[size-in-pixels] (with the caveat that the resulting
picture will take up different amounts of the slide on different
displays).
@ -221,16 +221,16 @@ displays).
@defmodule[slideshow/start]
The @exec{slideshow} executable invokes the
@schememodname[slideshow/start] module, which inspects the command
line as reported by @scheme[current-command-line-arguments] to get
@racketmodname[slideshow/start] module, which inspects the command
line as reported by @racket[current-command-line-arguments] to get
another module to provide the slide content. It also initializes
variables like @scheme[printing?] and @scheme[condense?] based on
variables like @racket[printing?] and @racket[condense?] based on
flags supplied on the command line.
Thus, if the above example is in @filepath{multi-step.ss}, then the
Thus, if the above example is in @filepath{multi-step.rkt}, then the
command
@commandline{slideshow multi-step.ss}
@commandline{slideshow multi-step.rkt}
runs the slides.

View File

@ -1,6 +1,6 @@
#lang scribble/doc
@(require "ss.ss"
(for-label scheme/gui
(for-label racket/gui
slideshow/code
slideshow/flash
slideshow/face
@ -11,12 +11,12 @@
@declare-exporting[slideshow/pict slideshow]
@defmodule*/no-declare[(slideshow/pict)]{ The
@schememodname[slideshow/pict] layer provides core functions for
@racketmodname[slideshow/pict] layer provides core functions for
constructing pictures, and it is independent of the slide viewer. This
layer can be used, for example, to generate a picture as encapsulated
PostScript for inclusion into a larger document. The
@schememodname[slideshow/pict] layer is re-provided by the
@schememodname[slideshow] language.}
@racketmodname[slideshow/pict] layer is re-provided by the
@racketmodname[slideshow] language.}
@local-table-of-contents[]
@ -24,11 +24,11 @@ PostScript for inclusion into a larger document. The
@section{Pict Datatype}
A picture is a @scheme[pict] structure. Some functions, such as
@scheme[hline], create new simple picts. Other functions, such as
@scheme[ht-append], build new picts out of existing picts. In the
A picture is a @racket[pict] structure. Some functions, such as
@racket[hline], create new simple picts. Other functions, such as
@racket[ht-append], build new picts out of existing picts. In the
latter case, the embedded picts retain their identity, so that
offset-finding functions, such as @scheme[lt-find], can find the
offset-finding functions, such as @racket[lt-find], can find the
offset of an embedded pict in a larger pict.
In addition to its drawing part, a pict has the following
@ -48,21 +48,21 @@ In addition to its drawing part, a pict has the following
That is, the bounding box has a width @math{w} and a height
@math{h}. For a single text line, @math{d} is descent below the
baseline, and @math{a+d=h}. For multiple text lines (often created
with a function like @scheme[vc-append]), @math{a} is the ascent of
with a function like @racket[vc-append]), @math{a} is the ascent of
the top line, and @math{d} is the descent of the bottom line, so
@math{a+d<h}. Many picts have @math{d=0} and @math{a=h}.
In addition, a pict can have a @defterm{last} sub-pict that
corresponds to the last item on the last line of text, so that extra
lines can be added to the last line. In particular, the @defterm{last}
element is useful for adding closing parentheses to a block of Scheme
element is useful for adding closing parentheses to a block of Racket
code, where the last line of code not the longest line in the block.
The size information for a pict is computed when the pict is
created. This strategy supports programs that create new picts though
arbitrarily complex computations on the size and shape of existing
picts. The functions @scheme[pict-width], @scheme[pict-height],
@scheme[pict-descent], and @scheme[pict-ascent] extract bounding-box
picts. The functions @racket[pict-width], @racket[pict-height],
@racket[pict-descent], and @racket[pict-ascent] extract bounding-box
information from a pict.
@ -75,26 +75,26 @@ information from a pict.
[panbox (or/c #f any/c)]
[last (or/c #f pict-path?)])]{
A @scheme[pict] structure is normally not created directly with
@scheme[make-pict]. Instead, functions like @scheme[text],
@scheme[hline], and @scheme[dc] are used to construct a pict.
A @racket[pict] structure is normally not created directly with
@racket[make-pict]. Instead, functions like @racket[text],
@racket[hline], and @racket[dc] are used to construct a pict.
The @scheme[draw] field contains the pict's drawing information in an
The @racket[draw] field contains the pict's drawing information in an
internal format. Roughly, the drawing information is a procedure that
takes a @scheme[dc<%>] drawing context and an offset for the pict's
takes a @racket[dc<%>] drawing context and an offset for the pict's
top-left corner (i.e., it's bounding box's top left corner relative to
the @scheme[dc<%>] origin). The state of the @scheme[dc<%>] is
the @racket[dc<%>] origin). The state of the @racket[dc<%>] is
intended to affect the pict's drawing; for example, the pen and brush
will be set for a suitable default drawing mode, and the
@scheme[dc<%>] scale will be set to scale the resulting image. Use
@scheme[draw-pict] (as opposed to @scheme[pict-draw]) to draw the
@racket[dc<%>] scale will be set to scale the resulting image. Use
@racket[draw-pict] (as opposed to @racket[pict-draw]) to draw the
picture.
The @scheme[panbox] field is internal and initialized to @scheme[#f].
The @racket[panbox] field is internal and initialized to @racket[#f].
The @scheme[last] field indicates a pict within the @scheme[children]
The @racket[last] field indicates a pict within the @racket[children]
list (transitively) that can be treated as the last element of the
last line in the pict. A @scheme[#f] value means that the pict is its
last line in the pict. A @racket[#f] value means that the pict is its
own last sub-pict.}
@ -107,9 +107,9 @@ own last sub-pict.}
Records, for a pict constructed of other picts, the relative location
and scale of one nested pict.
A @scheme[child] structure is normally not created directly with
@scheme[make-child]. Instead, functions like @scheme[hc-append] create
@scheme[child] structures when combining picts to create a new one.}
A @racket[child] structure is normally not created directly with
@racket[make-child]. Instead, functions like @racket[hc-append] create
@racket[child] structures when combining picts to create a new one.}
@; ------------------------------------------------------------------------
@ -154,47 +154,47 @@ adding the given ascent and descent.}
pict?]{
Creates a pict that draws text. For creating text picts within a slide
presentation, see @scheme[t], instead. Otherwise, before calling this
presentation, see @racket[t], instead. Otherwise, before calling this
function, a drawing context must be installed with
@scheme[dc-for-text-size].
@racket[dc-for-text-size].
The @scheme[style] argument must be one of the following:
The @racket[style] argument must be one of the following:
@itemize[
@item{@scheme[null] --- the default, same as @scheme['default]}
@item{@racket[null] --- the default, same as @racket['default]}
@item{a @scheme[font%] object}
@item{a @racket[font%] object}
@item{a font family symbol, such a @scheme['roman] (see @scheme[font%])}
@item{a font family symbol, such a @racket['roman] (see @racket[font%])}
@item{a font face string, such as @scheme["Helvetica"] (see @scheme[font%])}
@item{a font face string, such as @racket["Helvetica"] (see @racket[font%])}
@item{@scheme[(cons _str _sym)] combining a face string and a font
family (in case the face is unavailable; see @scheme[font%])}
@item{@racket[(cons _str _sym)] combining a face string and a font
family (in case the face is unavailable; see @racket[font%])}
@item{@scheme[(cons 'bold style)] for a valid @scheme[style]}
@item{@racket[(cons 'bold style)] for a valid @racket[style]}
@item{@scheme[(cons 'italic style)]}
@item{@scheme[(cons 'subscript style)]}
@item{@scheme[(cons 'superscript style)]}
@item{@scheme[(cons 'caps style)]}
@item{@racket[(cons 'italic style)]}
@item{@racket[(cons 'subscript style)]}
@item{@racket[(cons 'superscript style)]}
@item{@racket[(cons 'caps style)]}
@item{@scheme[(cons 'combine style)] --- allows kerning and ligatures
(the default, unless the @scheme['modern] family is specified)}
@item{@racket[(cons 'combine style)] --- allows kerning and ligatures
(the default, unless the @racket['modern] family is specified)}
@item{@scheme[(cons 'no-combine style)] --- renders characters individually}
@item{@racket[(cons 'no-combine style)] --- renders characters individually}
]
If both @scheme['combine] and @scheme['no-combine] are specified, the
If both @racket['combine] and @racket['no-combine] are specified, the
first one takes precedence. If caps is specified, the angle must be
zero.
The given @scheme[size] is in pixels, but it is ignored if a
@scheme[font%] object is provided in the text-style.
The given @racket[size] is in pixels, but it is ignored if a
@racket[font%] object is provided in the text-style.
The @scheme[rotation] is in radians, and positive values rotate
counter-clockwise. For a non-zero @scheme[rotation], the resulting
The @racket[rotation] is in radians, and positive values rotate
counter-clockwise. For a non-zero @racket[rotation], the resulting
pict's bounding box covers the rotated text, and the descent is zero
and the ascent is the height.}
@ -230,7 +230,7 @@ Unfilled and filled ellipses.}
Unfilled and filled rectangles.
If @scheme[draw-border?] is @scheme[#f], then the pen is set to be transparent
If @racket[draw-border?] is @racket[#f], then the pen is set to be transparent
before drawing the rectangle.
}
@ -244,16 +244,16 @@ before drawing the rectangle.
pict?])]{
Unfilled and filled rectangles with rounded corners. The
@scheme[corner-radius] is used to determine how much
@racket[corner-radius] is used to determine how much
rounding occurs in the corners. If it is a positive number,
then it determines the radius of a circle touching the edges
in each corner, and the rounding of the rectangle follow the
edge of those circles. If it is a negative number, then the
radius of the circles in the corners is the absolute value of the
@scheme[corner-radius] times the smaller of @scheme[width]
and @scheme[height].
@racket[corner-radius] times the smaller of @racket[width]
and @racket[height].
The @scheme[angle] determines how much the rectangle is
The @racket[angle] determines how much the rectangle is
rotated, in radians.
}
@ -261,18 +261,18 @@ rotated, in radians.
pict]{
A pict that display a bitmap. When a path is provided, the image is
loaded with the @scheme['unknown/mask] flag, which means that a mask
loaded with the @racket['unknown/mask] flag, which means that a mask
bitmap is generated if the file contains a mask.
If the bitmap cannot be loaded, if the given @scheme[bitmap%] object
is not valid, or if the @scheme[bitmap-draft-mode] parameter is set to
@scheme[#t], the result pict draws the word ``bitmap failed''.}
If the bitmap cannot be loaded, if the given @racket[bitmap%] object
is not valid, or if the @racket[bitmap-draft-mode] parameter is set to
@racket[#t], the result pict draws the word ``bitmap failed''.}
@defproc*[([(arrow [size real?] [radians real?]) pict?]
[(arrowhead [size real?] [radians real?]) pict?])]{
Creates an arrow or arrowhead in the specific direction within a
@scheme[size] by @scheme[size] pict. Points on the arrow may extend
@racket[size] by @racket[size] pict. Points on the arrow may extend
slightly beyond the bounding box.}
@defproc*[([(pip-line [dx real?] [dy real?] [size real?]) pict?]
@ -280,11 +280,11 @@ slightly beyond the bounding box.}
[(pip-arrows-line [dx real?] [dy real?] [size real?]) pict?])]{
Creates a line (with some number of arrowheads) as a zero-sized pict
suitable for use with @scheme[pin-over]. The 0-sized picture contains
suitable for use with @racket[pin-over]. The 0-sized picture contains
the starting point.
The @scheme[size] is used for the arrowhead size. Even though
@scheme[pip-line] creates no arrowheads, it accepts the @scheme[size]
The @racket[size] is used for the arrowhead size. Even though
@racket[pip-line] creates no arrowheads, it accepts the @racket[size]
argument for consistency with the other functions.}
@defproc*[([(pin-line [pict pict?]
@ -331,32 +331,32 @@ argument for consistency with the other functions.}
[#:hide-arrowhead? any/c #f])
pict?])]{
Adds a line or line-with-arrows onto @scheme[pict], using one of the
pict-finding functions (e.g., @scheme[lt-find]) to extract the source
Adds a line or line-with-arrows onto @racket[pict], using one of the
pict-finding functions (e.g., @racket[lt-find]) to extract the source
and destination of the line.
If @scheme[under?] is true, then the line and arrows are added under
the existing @scheme[pict] drawing, instead of on top. If
@scheme[solid?] is false, then the arrowheads are hollow instead of
If @racket[under?] is true, then the line and arrows are added under
the existing @racket[pict] drawing, instead of on top. If
@racket[solid?] is false, then the arrowheads are hollow instead of
filled.
The @scheme[start-angle], @scheme[end-angle], @scheme[start-pull], and
@scheme[end-pull] arguments control the curve of the line:
The @racket[start-angle], @racket[end-angle], @racket[start-pull], and
@racket[end-pull] arguments control the curve of the line:
@itemize[
@item{The @scheme[start-angle] and @scheme[end-angle] arguments
@item{The @racket[start-angle] and @racket[end-angle] arguments
specify the direction of curve at its start and end positions;
if either is @scheme[#f], it defaults to the angle of a
if either is @racket[#f], it defaults to the angle of a
straight line from the start position to end position.}
@item{The @scheme[start-pull] and @scheme[end-pull] arguments specify
@item{The @racket[start-pull] and @racket[end-pull] arguments specify
a kind of momentum for the starting and ending angles; larger
values preserve the angle longer.}
]
When the @scheme[hide-arrowhead?] argument is a true value, then
When the @racket[hide-arrowhead?] argument is a true value, then
space for the arrowhead is left behind, but the arrowhead itself
is not drawn.
@ -364,11 +364,11 @@ The defaults produce a straight line.}
@defthing[text-style/c contract?]{
A contract that matches the second argument of @scheme[text].}
A contract that matches the second argument of @racket[text].}
@defboolparam[bitmap-draft-mode on?]{
A parameter that determines whether @scheme[bitmap] loads/uses a
A parameter that determines whether @racket[bitmap] loads/uses a
bitmap.}
@ -385,22 +385,22 @@ bitmap.}
[(hbl-append [d real? 0.0] [pict pict?] ...) pict?]
[(hb-append [d real? 0.0] [pict pict?] ...) pict?])]{
Creates a new pict as a column (for @scheme[v...-append]) or row (for
@scheme[h...-append]) of other picts. The optional @scheme[d] argument
Creates a new pict as a column (for @racket[v...-append]) or row (for
@racket[h...-append]) of other picts. The optional @racket[d] argument
specifies amount of space to insert between each pair of pictures in
making the column or row.
Different procedures align pictures in the orthogonal direction in
different ways. For example, @scheme[vl-append] left-aligns all of the
different ways. For example, @racket[vl-append] left-aligns all of the
pictures.
The descent of the result corresponds to baseline that is lowest in
the result among all of the picts' descent-specified baselines;
similarly, the ascent of the result corresponds to the highest
ascent-specified baseline. If at least one @scheme[pict] is supplied,
then the last element (as reported by @scheme[pict-last]) for the
result is @scheme[(or (pict-last pict) pict)] for the using last
supplied @scheme[pict].}
ascent-specified baseline. If at least one @racket[pict] is supplied,
then the last element (as reported by @racket[pict-last]) for the
result is @racket[(or (pict-last pict) pict)] for the using last
supplied @racket[pict].}
@defproc*[([(lt-superimpose [pict pict?] ...) pict?]
[(ltl-superimpose [pict pict?] ...) pict?]
@ -426,8 +426,8 @@ The descent of the result corresponds to baseline that is lowest in
the result among all of the picts' descent-specified baselines;
similarly, the ascent of the result corresponds to the highest
ascent-specified baseline. The last element (as reported by
@scheme[pict-last]) for the result is the lowest, right-most among the
last-element picts of the @scheme[pict] arguments, as determined by
@racket[pict-last]) for the result is the lowest, right-most among the
last-element picts of the @racket[pict] arguments, as determined by
comparing the last-element bottom-right corners.}
@ -440,12 +440,12 @@ comparing the last-element bottom-right corners.}
pict?])]{
Creates a pict with the same bounding box, ascent, and descent as
@scheme[base], but with @scheme[pict] placed on top. The @scheme[dx]
and @scheme[dy] arguments specify how far right and down the second
@racket[base], but with @racket[pict] placed on top. The @racket[dx]
and @racket[dy] arguments specify how far right and down the second
pict's corner is from the first pict's corner. Alternately, the
@scheme[find-pict] and @scheme[find] arguments find a point in
@scheme[base] for @scheme[find-pict]; the @scheme[find] procedure
should be something like @scheme[lt-find].}
@racket[find-pict] and @racket[find] arguments find a point in
@racket[base] for @racket[find-pict]; the @racket[find] procedure
should be something like @racket[lt-find].}
@defproc*[([(pin-under [base pict?] [dx real?] [dy real?] [pict pict?])
@ -456,8 +456,8 @@ should be something like @scheme[lt-find].}
[pict pict?])
pict?])]{
Like @scheme[pin-over], but @scheme[pict] is drawn before
@scheme[base] in the resulting combination.}
Like @racket[pin-over], but @racket[pict] is drawn before
@racket[base] in the resulting combination.}
@defproc[(table [ncols exact-positive-integer?]
@ -468,21 +468,21 @@ Like @scheme[pin-over], but @scheme[pict] is drawn before
[row-seps (table-list-of real?)])
pict?]{
Creates a table given a list of picts. The @scheme[picts] list is a
concatenation of the table's rows (which means that a Scheme
@scheme[list] call can be formatted to reflect the shape of the output
Creates a table given a list of picts. The @racket[picts] list is a
concatenation of the table's rows (which means that a Racket
@racket[list] call can be formatted to reflect the shape of the output
table).
The @scheme[col-aligns], @scheme[row-aligns], @scheme[col-seps], and
@scheme[row-seps] arguments are ``lists'' specifying the row and
The @racket[col-aligns], @racket[row-aligns], @racket[col-seps], and
@racket[row-seps] arguments are ``lists'' specifying the row and
columns alignments separation between rows and columns. For @math{c}
columns and @math{r} rows, the first two should have @math{c} and
@math{r} superimpose procedures, and the last two should have
@math{c-1} and @math{r-1} numbers, respectively. The lists can be
``improper'' (i.e., ending in a number instead of an empty list), in
which case the non-pair cdr is used as the value for all remaining
list items that were expected. The @scheme[col-aligns] and
@scheme[row-aligns] procedures are used to superimpose all of the
list items that were expected. The @racket[col-aligns] and
@racket[row-aligns] procedures are used to superimpose all of the
cells in a column or row; this superimposition determines the total
width or height of the column or row, and also determines the
horizontal or vertical placement of each cell in the column or row.}
@ -495,8 +495,8 @@ horizontal or vertical placement of each cell in the column or row.}
[(scale [pict pict?] [w-factor real?] [h-factor real?]) pict?])]{
Scales a pict drawing, as well as its @tech{bounding-box}. The drawing
is scaled by adjusting the destination @scheme[dc<%>]'s scale while
drawing the original @scheme[pict].}
is scaled by adjusting the destination @racket[dc<%>]'s scale while
drawing the original @racket[pict].}
@defproc[(ghost [pict pict?]) pict?]{
@ -506,7 +506,7 @@ but uses the child's size.}
@defproc[(linewidth [w real?] [pict pict?]) pict?]{
Selects a specific pen width for drawing, which applies to pen drawing
for @scheme[pict] that does not already use a specific pen width.}
for @racket[pict] that does not already use a specific pen width.}
@defproc[(colorize [pict pict?] [color (or/c string?
(is-a?/c color%)
@ -516,15 +516,15 @@ for @scheme[pict] that does not already use a specific pen width.}
pict?]{
Selects a specific color drawing, which applies to drawing in
@scheme[pict] that does not already use a specific color. The
@scheme[black-and-white] parameter causes all non-white colors to be
@racket[pict] that does not already use a specific color. The
@racket[black-and-white] parameter causes all non-white colors to be
converted to black.}
@defproc[(cellophane [pict pict?] [opacity (real-in 0 1)])
pict?]{
Makes the given @scheme[pict] semi-transparent, where an opacity of
@scheme[0] is fully transparent, and an opacity of @scheme[1] is fully
Makes the given @racket[pict] semi-transparent, where an opacity of
@racket[0] is fully transparent, and an opacity of @racket[1] is fully
opaque. See @method[dc<%> set-alpha] for information about the
contexts and cases when semi-transparent drawing works.}
@ -543,12 +543,12 @@ box}. Usually, the inset amounts are negative.}
@defform*[[(scale/improve-new-text pict-expr scale-expr)
(scale/improve-new-text pict-expr x-scale-expr y-scale-expr)]]{
Like the @scheme[scale] procedure, but also sets
@scheme[current-expected-text-scale] while evaluating @scheme[pict-expr].}
Like the @racket[scale] procedure, but also sets
@racket[current-expected-text-scale] while evaluating @racket[pict-expr].}
@defboolparam[black-and-white on?]{
A parameter that determines whether @scheme[colorize] uses color or
A parameter that determines whether @racket[colorize] uses color or
black-and-white colors.}
@; ------------------------------------------------------------------------
@ -560,58 +560,58 @@ black-and-white colors.}
[(inset [pict pict?] [l-amt real?] [t-amt real?]
[r-amt real?] [b-amt real?]) pict?])]{
Extends @scheme[pict]'s @tech{bounding box} by adding the given amounts
Extends @racket[pict]'s @tech{bounding box} by adding the given amounts
to the corresponding sides; ascent and descent are extended, too.}
@defproc[(clip-descent [pict pict?]) pict?]{
Truncates @scheme[pict]'s @tech{bounding box} by removing the descent part.}
Truncates @racket[pict]'s @tech{bounding box} by removing the descent part.}
@defproc[(lift-above-baseline [pict pict?] [amt real?]) pict?]{
Lifts @scheme[pict] relative to its baseline, extending the
Lifts @racket[pict] relative to its baseline, extending the
@tech{bounding-box} height if necessary.}
@defproc[(drop-below-ascent [pict pict?] [amt real?]) pict?]{
Drops @scheme[pict] relative to its ascent line, extending the
Drops @racket[pict] relative to its ascent line, extending the
@tech{bounding-box} height if necessary.}
@defproc[(baseless [pict pict?]) pict?]{
Makes the descent @scheme[0] and the ascent the same as the height.}
Makes the descent @racket[0] and the ascent the same as the height.}
@defproc[(refocus [pict pict?] [sub-pict pict?]) pict?]{
Assuming that @scheme[sub-pict] can be found within @scheme[pict],
shifts the overall bounding box to that of @scheme[sub-pict] (but
preserving all the drawing of @scheme[pict]). The last element, as
reported by @scheme[pict-last] is also set to @scheme[(or (pict-last
Assuming that @racket[sub-pict] can be found within @racket[pict],
shifts the overall bounding box to that of @racket[sub-pict] (but
preserving all the drawing of @racket[pict]). The last element, as
reported by @racket[pict-last] is also set to @racket[(or (pict-last
sub-pict) sub-pict)].}
@defproc[(panorama [pict pict?]) pict?]{
Shifts the given pict's bounding box to enclose the bounding boxes of
all sub-picts (even @scheme[launder]ed picts).}
all sub-picts (even @racket[launder]ed picts).}
@defproc[(use-last [pict pict?] [sub-pict pict-path?]) pict?]{
Returns a pict like @scheme[pict], but with the last element (as
reported by @scheme[pict-last]) set to @scheme[sub-pict]. The
@scheme[sub-pict] must exist as a sub-pict (or path of sub-picts)
within @scheme[pict].}
Returns a pict like @racket[pict], but with the last element (as
reported by @racket[pict-last]) set to @racket[sub-pict]. The
@racket[sub-pict] must exist as a sub-pict (or path of sub-picts)
within @racket[pict].}
@defproc[(use-last* [pict pict?] [sub-pict pict-path?]) pict?]{
Propagates the last element of @scheme[sub-pict] to @scheme[pict].
Propagates the last element of @racket[sub-pict] to @racket[pict].
That is, @scheme[use-last*] is like @scheme[use-last], but the last
element of @scheme[sub-pict] is used as the new last element for
@scheme[pict], instead of @scheme[sub-pict] itself---unless
@scheme[(pict-last sub-pict)] is @scheme[#f], in which case
@scheme[sub-pict] is used as the last element of @scheme[pict].}
That is, @racket[use-last*] is like @racket[use-last], but the last
element of @racket[sub-pict] is used as the new last element for
@racket[pict], instead of @racket[sub-pict] itself---unless
@racket[(pict-last sub-pict)] is @racket[#f], in which case
@racket[sub-pict] is used as the last element of @racket[pict].}
@; ------------------------------------------------------------------------
@ -633,24 +633,24 @@ element of @scheme[sub-pict] is used as the new last element for
[(rbl-find [pict pict?] [find pict-path?]) (values real? real?)]
[(rb-find [pict pict?] [find pict-path?]) (values real? real?)])]{
Locates a pict designated by @scheme[find] is within @scheme[pict]. If
@scheme[find] is a pict, then the @scheme[pict] must have been created
as some combination involving @scheme[find].
Locates a pict designated by @racket[find] is within @racket[pict]. If
@racket[find] is a pict, then the @racket[pict] must have been created
as some combination involving @racket[find].
If @scheme[find] is a list, then the first element of @scheme[find]
must be within @scheme[pict], the second element of @scheme[find] must
If @racket[find] is a list, then the first element of @racket[find]
must be within @racket[pict], the second element of @racket[find] must
be within the second element, and so on.}
@defproc[(pict-path? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a @scheme[pict] or a non-empty
list of @scheme[pict]s.}
Returns @racket[#t] if @racket[v] is a @racket[pict] or a non-empty
list of @racket[pict]s.}
@defproc[(launder [pict pict?]) pict?]{
Creates a pict that has the same drawing and bounding box of
@scheme[pict], but which hides all of its sub-picts so that they
cannot be found with functions like @scheme[lt-find]. If @scheme[pict]
@racket[pict], but which hides all of its sub-picts so that they
cannot be found with functions like @racket[lt-find]. If @racket[pict]
has a last-line pict, then the laundered pict has a fresh last-line
pict with the same shape and location.}
@ -675,10 +675,10 @@ Creates a fluffy cloud.}
[shaded? any/c #f])
pict?]{
Creates a Mac-like file icon, optionally shaded. If @scheme[color] is
not a string or @scheme[color%] object, it is treated as a boolean, in
which case true means @scheme["gray"] and false means
@scheme["white"].}
Creates a Mac-like file icon, optionally shaded. If @racket[color] is
not a string or @racket[color%] object, it is treated as a boolean, in
which case true means @racket["gray"] and false means
@racket["white"].}
@defproc[(standard-fish [w real?]
[h real?]
@ -688,12 +688,12 @@ which case true means @scheme["gray"] and false means
[#:open-mouth open-mouth (or/c boolean? real?) #f])
pict?]{
Creates a fish swimming either @scheme['left] or @scheme['right].
If @scheme[eye-color] is @scheme[#f], no eye is drawn.
Creates a fish swimming either @racket['left] or @racket['right].
If @racket[eye-color] is @racket[#f], no eye is drawn.
The @scheme[open-mouth] argument can be either @scheme[#f] (mouth
closed), @scheme[#t] (mouth fully open), or a number: @scheme[0.0] is
closed, @scheme[1.0] is fully open, and numbers in between are
The @racket[open-mouth] argument can be either @racket[#f] (mouth
closed), @racket[#t] (mouth fully open), or a number: @racket[0.0] is
closed, @racket[1.0] is fully open, and numbers in between are
partially open.}
@defproc[(jack-o-lantern [size real?]
@ -702,7 +702,7 @@ partially open.}
pict?]{
Creates a jack-o-lantern; use the same pumpkin and face color to get a
plain pumpkin. The @scheme[size] determines the width.}
plain pumpkin. The @racket[size] determines the width.}
@defproc[(angel-wing [w real?]
[h real?]
@ -716,7 +716,7 @@ width for drawing the wing outline is the current one.}
@subsection{Balloon Annotations}
@defmodule[slideshow/balloon]{The @schememodname[slideshow/balloon]
@defmodule[slideshow/balloon]{The @racketmodname[slideshow/balloon]
library provides functions for creating and placing cartoon-speech
balloons.}
@ -728,29 +728,29 @@ balloons.}
[corner-radius (and/c real? (not/c negative?)) 32])
balloon?]{
Superimposes @scheme[pict] on top of a balloon that wraps it.
Superimposes @racket[pict] on top of a balloon that wraps it.
The @scheme[spike] argument indicates the corner from which a spike
The @racket[spike] argument indicates the corner from which a spike
protrudes from the balloon (i.e., the spike that points to whatever
the balloon is about). For example, @scheme['n] means ``north,'',
the balloon is about). For example, @racket['n] means ``north,'',
which is a spike in the top middle of the balloon.
The @scheme[dx] and @scheme[dy] arguments specify how far the spike
should protrude. For a @scheme['w] spike, @scheme[dx] should be
The @racket[dx] and @racket[dy] arguments specify how far the spike
should protrude. For a @racket['w] spike, @racket[dx] should be
negative, etc.
The @scheme[color] argument is the background color for the balloon.
The @racket[color] argument is the background color for the balloon.
The @scheme[corner-radius] argument determines the radius of the cicle
The @racket[corner-radius] argument determines the radius of the cicle
used to roun the balloon's corners. As usual, if it is less than
@scheme[1], then it acts as a ratio of the balloon's width or height.
@racket[1], then it acts as a ratio of the balloon's width or height.
The result is a balloon, not a pict. The @scheme[balloon-pict]
The result is a balloon, not a pict. The @racket[balloon-pict]
function extracts a pict whose bounding box does not include the
spike, but includes the rest of the image, and the
@scheme[balloon-point-x] and @scheme[balloon-point-y] functions
@racket[balloon-point-x] and @racket[balloon-point-y] functions
extract the location of the spike point. More typically, the
@scheme[pin-balloon] function is used to add a balloon to a pict.}
@racket[pin-balloon] function is used to add a balloon to a pict.}
@defproc[(pip-wrap-balloon [pict pict?]
[spike (or/c 'n 's 'e 'w 'ne 'se 'sw 'nw)]
@ -760,8 +760,8 @@ extract the location of the spike point. More typically, the
[corner-radius (and/c real? (not/c negative?)) 32])
pict?]{
Like @scheme[wrap-balloon], but produces a zero-sized pict suitable
for use with @scheme[pin-over].}
Like @racket[wrap-balloon], but produces a zero-sized pict suitable
for use with @racket[pin-over].}
@defproc*[([(pin-balloon [balloon balloon?]
@ -775,15 +775,15 @@ for use with @scheme[pin-over].}
[find (pict? pict-path? . -> . (values real? real?))])
pict?])]{
Superimposes the pict in @scheme[balloon] onto @scheme[base] to
Superimposes the pict in @racket[balloon] onto @racket[base] to
produce a new pict. The balloon is positioned so that its spike points
to the location specified by either @scheme[x] and @scheme[y]
(numbers) or at the position determined by combining @scheme[base] and
@scheme[at-pict] with @scheme[find]. The @scheme[find] function uses
its arguments like @scheme[lt-find].
to the location specified by either @racket[x] and @racket[y]
(numbers) or at the position determined by combining @racket[base] and
@racket[at-pict] with @racket[find]. The @racket[find] function uses
its arguments like @racket[lt-find].
The resulting pict has the same bounding box, descent, and ascent as
@scheme[base], even if the balloon extends beyond the bounding box.}
@racket[base], even if the balloon extends beyond the bounding box.}
@defproc[(balloon [w real?]
@ -795,8 +795,8 @@ The resulting pict has the same bounding box, descent, and ascent as
[color (or/c string? (is-a?/c color%)) balloon-color])
balloon?]{
Creates a balloon, much like @scheme[wrap-balloon] except that the balloon's
width is @scheme[w] and its height is @scheme[h].}
Creates a balloon, much like @racket[wrap-balloon] except that the balloon's
width is @racket[w] and its height is @racket[h].}
@defproc*[([(balloon? [v any/c]) boolean?]
[(make-balloon [pict pict?] [x real?] [y real?]) balloon?]
@ -815,7 +815,7 @@ The default background color for a balloon.
@subsection{Face}
@defmodule[slideshow/face]{The @schememodname[slideshow/face] library
@defmodule[slideshow/face]{The @racketmodname[slideshow/face] library
provides functions for a kind of @as-index{Mr. Potatohead}-style face
library.}
@ -833,19 +833,19 @@ follows:
@itemize[
@item{@scheme['unhappy] --- @scheme[(face* 'none 'plain #t default-face-color 6)]}
@item{@scheme['sortof-unhappy] --- @scheme[(face* 'worried 'grimace #t default-face-color 6)]}
@item{@scheme['sortof-happy] --- @scheme[(face* 'worried 'medium #f default-face-color 6)]}
@item{@scheme['happy] --- @scheme[(face* 'none 'plain #f default-face-color 6)]}
@item{@scheme['happier] --- @scheme[(face* 'none 'large #f default-face-color 3)]}
@item{@scheme['embarrassed] --- @scheme[(face* 'worried 'medium #f default-face-color 3)]}
@item{@scheme['badly-embarrassed] --- @scheme[(face* 'worried 'medium #t default-face-color 3)]}
@item{@scheme['unhappier] --- @scheme[(face* 'normal 'large #t default-face-color 3)]}
@item{@scheme['happiest] --- @scheme[(face* 'normal 'huge #f default-face-color 0 -3)]}
@item{@scheme['unhappiest] --- @scheme[(face* 'normal 'huge #t default-face-color 0 -3)]}
@item{@scheme['mad] --- @scheme[(face* 'angry 'grimace #t default-face-color 0)]}
@item{@scheme['mean] --- @scheme[(face* 'angry 'narrow #f default-face-color 0)]}
@item{@scheme['surprised] --- @scheme[(face* 'worried 'oh #t default-face-color -4 -3 2)]}
@item{@racket['unhappy] --- @racket[(face* 'none 'plain #t default-face-color 6)]}
@item{@racket['sortof-unhappy] --- @racket[(face* 'worried 'grimace #t default-face-color 6)]}
@item{@racket['sortof-happy] --- @racket[(face* 'worried 'medium #f default-face-color 6)]}
@item{@racket['happy] --- @racket[(face* 'none 'plain #f default-face-color 6)]}
@item{@racket['happier] --- @racket[(face* 'none 'large #f default-face-color 3)]}
@item{@racket['embarrassed] --- @racket[(face* 'worried 'medium #f default-face-color 3)]}
@item{@racket['badly-embarrassed] --- @racket[(face* 'worried 'medium #t default-face-color 3)]}
@item{@racket['unhappier] --- @racket[(face* 'normal 'large #t default-face-color 3)]}
@item{@racket['happiest] --- @racket[(face* 'normal 'huge #f default-face-color 0 -3)]}
@item{@racket['unhappiest] --- @racket[(face* 'normal 'huge #t default-face-color 0 -3)]}
@item{@racket['mad] --- @racket[(face* 'angry 'grimace #t default-face-color 0)]}
@item{@racket['mean] --- @racket[(face* 'angry 'narrow #f default-face-color 0)]}
@item{@racket['surprised] --- @racket[(face* 'worried 'oh #t default-face-color -4 -3 2)]}
]}
@ -870,34 +870,34 @@ Returns a pict for a face:
@itemize[
@item{@scheme[eyebrow-kind] determines the eyebrow shape.}
@item{@racket[eyebrow-kind] determines the eyebrow shape.}
@item{@scheme[mouth-kind] determines the mouth shape, combined with
@scheme[frown?].}
@item{@racket[mouth-kind] determines the mouth shape, combined with
@racket[frown?].}
@item{@scheme[frown?] determines whether the mouth is up or down.}
@item{@racket[frown?] determines whether the mouth is up or down.}
@item{@scheme[color] determines the face color.}
@item{@racket[color] determines the face color.}
@item{@scheme[eye-inset] adjusts the eye size; recommend values are
@item{@racket[eye-inset] adjusts the eye size; recommend values are
between 0 and 10.}
@item{@scheme[eyebrow-dy] adjusts the eyebrows; recommend values:
@item{@racket[eyebrow-dy] adjusts the eyebrows; recommend values:
between -5 and 5.}
@item{@scheme[pupil-dx] adjusts the pupil; recommend values are
@item{@racket[pupil-dx] adjusts the pupil; recommend values are
between -10 and 10.}
@item{@scheme[pupil-dy] adjusts the pupil; recommend values are
@item{@racket[pupil-dy] adjusts the pupil; recommend values are
between -15 and 15.}
]
The @scheme[#:eyebrow-shading?] through
@scheme[#:face-background-shading?] arguments control whether a
The @racket[#:eyebrow-shading?] through
@racket[#:face-background-shading?] arguments control whether a
shading is used for on a particular feature in the face (shading tends
to look worse than just anti-aliasing when the face is small). The
@scheme[#:teeth?] argument controls the visibility of the teeth for
@racket[#:teeth?] argument controls the visibility of the teeth for
some mouth shapes.}
@; ----------------------------------------
@ -917,19 +917,19 @@ Returns a pict for a ``flash'': a spiky oval, like the yellow
background that goes behind a ``new!'' logo on web pages or a box of
cereal.
The @scheme[height] and @scheme[width] arguments determine the size of
The @racket[height] and @racket[width] arguments determine the size of
the oval in which the flash is drawn, prior to rotation. The actual
height and width may be smaller if @scheme[points] is not a multiple
height and width may be smaller if @racket[points] is not a multiple
of 4, and the actual height and width will be different if the flash
is rotated.
The @scheme[n-points] argument determines the number of points on the
The @racket[n-points] argument determines the number of points on the
flash.
The @scheme[spike-fraction] argument determines how big the flash
The @racket[spike-fraction] argument determines how big the flash
spikes are compared to the bounding oval.
The @scheme[rotation] argument specifies an angle in radians for
The @racket[rotation] argument specifies an angle in radians for
counter-clockwise rotation.
The flash is drawn in the default color.}
@ -941,7 +941,7 @@ The flash is drawn in the default color.}
[rotation real? 0])
pict?]{
Like @scheme[filled-flash], but drawing only the outline.}
Like @racket[filled-flash], but drawing only the outline.}
@; ------------------------------------------------------------------------
@ -950,7 +950,7 @@ Like @scheme[filled-flash], but drawing only the outline.}
@defproc[(hyperlinkize [pict pict?])
pict?]{
Adds an underline and blue color. The @scheme[pict]'s height and
Adds an underline and blue color. The @racket[pict]'s height and
descent are extended.}
@ -973,15 +973,15 @@ dividing the gap between the RGB components and 255 by the factor.}
[set-brush? any/c])
void?]{
Calls a @scheme[proc] multiple times, gradually changing the pen
Calls a @racket[proc] multiple times, gradually changing the pen
and/or brush color for each call. For the first call, the current pen
and/or brush color matches @scheme[start]; for the last call, it
matches scheme[end]; and for intermediate calls, the color is an
and/or brush color matches @racket[start]; for the last call, it
matches racket[end]; and for intermediate calls, the color is an
intermediate color.
The @scheme[max-step] and @scheme[step-delta] arguments should be
The @racket[max-step] and @racket[step-delta] arguments should be
exact numbers; the procedure is called with each number from 0 to
@scheme[max-step] inclusive using a @scheme[step-delta] increment.}
@racket[max-step] inclusive using a @racket[step-delta] increment.}
@; ------------------------------------------------------------------------
@ -990,13 +990,13 @@ exact numbers; the procedure is called with each number from 0 to
@defparam[dc-for-text-size dc (or/c #f (is-a?/c dc<%>))]{
A parameter that is used to determine the @tech{bounding box} of picts
created with @scheme[text].
created with @racket[text].
The drawing context installed in this parameter need not be the same
as the ultimate drawing context, but it must measure text in the same
way. In particular, use a @scheme[post-script-dc%] for preparing
PostScript output, while a @scheme[bitmap-dc%] instance will work fine
for either @scheme[bitmap-dc%] or @scheme[canvas%] output.}
way. In particular, use a @racket[post-script-dc%] for preparing
PostScript output, while a @racket[bitmap-dc%] instance will work fine
for either @racket[bitmap-dc%] or @racket[canvas%] output.}
@defproc[(draw-pict [pict pict?]
@ -1005,16 +1005,16 @@ for either @scheme[bitmap-dc%] or @scheme[canvas%] output.}
[y real?])
void?]{
Draws @scheme[pict] to @scheme[dc], with its top-left corner at offset
(@scheme[x], @scheme[y]).}
Draws @racket[pict] to @racket[dc], with its top-left corner at offset
(@racket[x], @racket[y]).}
@defproc[(make-pict-drawer [pict pict?])
((is-a?/c dc<%>) real? real? . -> . void?)]{
Generates a pict-drawer procedure for multiple renderings of
@scheme[pict]. Using the generated procedure can be faster than
repeated calls to @scheme[draw-pict].}
@racket[pict]. Using the generated procedure can be faster than
repeated calls to @racket[draw-pict].}
@defproc[(show-pict [pict pict?]
@ -1022,13 +1022,13 @@ repeated calls to @scheme[draw-pict].}
[h (or/c #f exact-nonnegative-integer?) #f])
void?]{
Opens a frame that displays @scheme[pict]. The frame adds one method,
@scheme[set-pict], which takes a pict to display. The optional
@scheme[w] and @scheme[h] arguments specify a minimum size for the
Opens a frame that displays @racket[pict]. The frame adds one method,
@racket[set-pict], which takes a pict to display. The optional
@racket[w] and @racket[h] arguments specify a minimum size for the
frame's drawing area.}
@defparam[current-expected-text-scale scales (list real? real?)]{
A parameter used to refine text measurements to better match an
expected scaling of the image. The @scheme[scale/improve-new-text]
expected scaling of the image. The @racket[scale/improve-new-text]
form sets this parameter while also scaling the resulting pict.}

View File

@ -5,18 +5,18 @@
@title[#:tag "play"]{Animations}
@defmodule[slideshow/play]{The @schememodname[slideshow/play] module
@defmodule[slideshow/play]{The @racketmodname[slideshow/play] module
provides tools for generating animations as multiple, automatically
advanced slides.}
Many of the tools are based on a function that takes a number between
@scheme[0.0] and @scheme[1.0] inclusive and produces a
pict. The pict produced for the input @scheme[0.0] is
@racket[0.0] and @racket[1.0] inclusive and produces a
pict. The pict produced for the input @racket[0.0] is
the starting image of the animation, and the pict produced for
@scheme[1.0] is the ending image, while intermediate values produced
@racket[1.0] is the ending image, while intermediate values produced
intermediate images. For example,
@schemeblock[
@racketblock[
(lambda (n)
(cellophane (t "Hello") n))
]
@ -40,28 +40,28 @@ corresponds to an animation that fades in the word ``Hello.''
[#:layout layout (or/c 'auto 'center 'top 'tall) 'auto])
void?]{
Generates @math{@scheme[steps]+1} slides by calling @scheme[gen] on
equally-spaced values from @scheme[0.0] (inclusve) to @scheme[1.0]
Generates @math{@racket[steps]+1} slides by calling @racket[gen] on
equally-spaced values from @racket[0.0] (inclusve) to @racket[1.0]
(exclusive). Except for the first of the slides, each slide has a
timeout of @scheme[delay-secs], so that the next slide appears
timeout of @racket[delay-secs], so that the next slide appears
automatically.
Normally, @scheme[play] is called via @scheme[play-n], which
effectively calls @scheme[gen] on @scheme[1.0] without a timeout to
Normally, @racket[play] is called via @racket[play-n], which
effectively calls @racket[gen] on @racket[1.0] without a timeout to
complete the animation and stop the auto-advance of slides. The
@scheme[play-n] function also manages with multi-step animations.
@racket[play-n] function also manages with multi-step animations.
If @scheme[skip-first?] is @scheme[#f], then one fewer slide is
generated, because @scheme[gen] is not called on @scheme[0.0].
If @racket[skip-first?] is @racket[#f], then one fewer slide is
generated, because @racket[gen] is not called on @racket[0.0].
The @scheme[title], @scheme[name], and @scheme[layout] arguments are
passed on to @scheme[slide], at least when @scheme[title] and/or
@scheme[name] are not functions. When @scheme[title] or @scheme[name]
The @racket[title], @racket[name], and @racket[layout] arguments are
passed on to @racket[slide], at least when @racket[title] and/or
@racket[name] are not functions. When @racket[title] or @racket[name]
is a function, the function is applied to the value used to produce
the slide content, and the resulting title or name is passed on to
@scheme[slide].
@racket[slide].
In condensed mode (i.e., when @scheme[condense?] is @scheme[#t]), any
In condensed mode (i.e., when @racket[condense?] is @racket[#t]), any
slide that would be registered with a timeout is instead skipped.}
@ -79,24 +79,24 @@ slide that would be registered with a timeout is instead skipped.}
[#:layout layout (or/c 'auto 'center 'top 'tall) 'auto])
void?]{
Generates a sequence of slides by calling @scheme[gen*] with, for each
of its arguments, numbers from @scheme[0.0] to @scheme[1.0]. If
@scheme[gen*] accepts @math{n} arguments, then result is a sequence of
Generates a sequence of slides by calling @racket[gen*] with, for each
of its arguments, numbers from @racket[0.0] to @racket[1.0]. If
@racket[gen*] accepts @math{n} arguments, then result is a sequence of
animations with a pause (i.e., not auto-advanced) between each of
@math{n} segments.
If @scheme[gen*] accepts a single argument, then @scheme[play-n] is
like @scheme[play], except that @scheme[gen*] is also called with
@scheme[1.0] to generate a slide with no timeout. If @scheme[gen*]
If @racket[gen*] accepts a single argument, then @racket[play-n] is
like @racket[play], except that @racket[gen*] is also called with
@racket[1.0] to generate a slide with no timeout. If @racket[gen*]
accepts multiple arguments, then slides are generated by calling
@scheme[gen*] with the first argument varying from @scheme[0.0] to
@scheme[1.0] while all other arguments are @scheme[0.0]. Then, the
first argument is held at @scheme[1.0] while the second argument varies
from @scheme[0.0] to @scheme[1.0], and so on.
@racket[gen*] with the first argument varying from @racket[0.0] to
@racket[1.0] while all other arguments are @racket[0.0]. Then, the
first argument is held at @racket[1.0] while the second argument varies
from @racket[0.0] to @racket[1.0], and so on.
For example,
@schemeblock[
@racketblock[
(play-n
(lambda (n1 n2)
(cellophane (t "Hello")
@ -106,13 +106,13 @@ For example,
generates an animation to fade in the word ``Hello,'' and then pauses
for a manual advance, and then fades ``Hello'' back out.
If @scheme[skip-first?] is @scheme[#t], then the very first slide of
the sequence is skipped. Similarly, if @scheme[skip-last?] is
@scheme[#t], then the last slide of the sequence is skipped.
If @racket[skip-first?] is @racket[#t], then the very first slide of
the sequence is skipped. Similarly, if @racket[skip-last?] is
@racket[#t], then the last slide of the sequence is skipped.
The @scheme[steps], @scheme[delay-msecs], @scheme[title],
@scheme[name], and @scheme[layout] arguments are passed on to
@scheme[play] for each of the @math{n} segments of animation.}
The @racket[steps], @racket[delay-msecs], @racket[title],
@racket[name], and @racket[layout] arguments are passed on to
@racket[play] for each of the @math{n} segments of animation.}
@defproc[(animate-slide [element (flat-rec-contract elem/c
@ -121,10 +121,10 @@ The @scheme[steps], @scheme[delay-msecs], @scheme[title],
...)
(() (listof (real-in 0.0 1.0)) . ->* . pict?)]{
Accepts slide content similar to @scheme[slide] with @scheme['next]
and @scheme['alts] and produces a procedure suitable for use with
@scheme[play-n]. The result is similar to using @scheme[slide], but
with fades for @scheme['next] and @scheme['alts] transitions (to
Accepts slide content similar to @racket[slide] with @racket['next]
and @racket['alts] and produces a procedure suitable for use with
@racket[play-n]. The result is similar to using @racket[slide], but
with fades for @racket['next] and @racket['alts] transitions (to
better fit the style, perhaps, of surrounding animations).}
@; --------------------------------------------------
@ -135,20 +135,20 @@ better fit the style, perhaps, of surrounding animations).}
[#:combine combine (pict? pict? . -> . pict?) cc-superimpose])
pict?]{
Interpolates @scheme[p1] and @scheme[p2], where the result with
@scheme[n] as @scheme[0.0] is @scheme[p1], and the result with
@scheme[n] as @scheme[1.0] is @scheme[p2]. For intermediate points,
@scheme[p1] fades out while @scheme[p2] fades in as @scheme[n] changes
from @scheme[0.0] to @scheme[1.0]. At the same time, the width and
Interpolates @racket[p1] and @racket[p2], where the result with
@racket[n] as @racket[0.0] is @racket[p1], and the result with
@racket[n] as @racket[1.0] is @racket[p2]. For intermediate points,
@racket[p1] fades out while @racket[p2] fades in as @racket[n] changes
from @racket[0.0] to @racket[1.0]. At the same time, the width and
height of the generated pict are intermediate between
@scheme[p1] and @scheme[p2], and the relative baselines and last
@racket[p1] and @racket[p2], and the relative baselines and last
pict correspondingly morph within the bounding box.
The @scheme[combine] argument determines how @scheme[p1] and
@scheme[p2] are aligned for morphing. For example, if @scheme[p1] and
@scheme[p2] both contain multiple lines of text with the same line
The @racket[combine] argument determines how @racket[p1] and
@racket[p2] are aligned for morphing. For example, if @racket[p1] and
@racket[p2] both contain multiple lines of text with the same line
height but different number of lines, then using
@scheme[ctl-superimpose] would keep the ascent line in a fixed
@racket[ctl-superimpose] would keep the ascent line in a fixed
location relative to the top of the resulting pict as the rest of the
shape morphs around it.}
@ -157,23 +157,23 @@ shape morphs around it.}
[make-p2 (pict? . -> . pict?)])
pict?]{
Similar to @scheme[fade-pict], but the target is not a fixed
@scheme[_p2], but instead a function @scheme[make-p2] that takes a
@scheme[launder]ed @scheme[ghost] of @scheme[p1] and places it into a
larger scene. Also, @scheme[p1] does not fade out as @scheme[n]
increases; instead, @scheme[p1] is placed wherever its ghost appears
in the result of @scheme[make-p2].
Similar to @racket[fade-pict], but the target is not a fixed
@racket[_p2], but instead a function @racket[make-p2] that takes a
@racket[launder]ed @racket[ghost] of @racket[p1] and places it into a
larger scene. Also, @racket[p1] does not fade out as @racket[n]
increases; instead, @racket[p1] is placed wherever its ghost appears
in the result of @racket[make-p2].
For example,
@SCHEMEBLOCK[
@RACKETBLOCK[
(lambda (n)
(fade-around-pict n
(code x)
(lambda (g) (code (+ #,x 1)))))
]
animates the wrapping of @scheme[x] with a @scheme[(+ .... 1)] form.}
animates the wrapping of @racket[x] with a @racket[(+ .... 1)] form.}
@defproc[(slide-pict [base pict?]
[p pict?]
@ -182,15 +182,15 @@ animates the wrapping of @scheme[x] with a @scheme[(+ .... 1)] form.}
[n (in-real 0.0 1.0)])
pict?]{
Pins @scheme[p] onto @scheme[base], sliding from @scheme[p-from] to
@scheme[p-to] (which are picts within @scheme[base]) as
@scheme[n] goes from @scheme[0.0] to @scheme[1.0]. The top-left
locations of @scheme[p-from] and @scheme[p-to] determine the placement
of the top-left of @scheme[p].
Pins @racket[p] onto @racket[base], sliding from @racket[p-from] to
@racket[p-to] (which are picts within @racket[base]) as
@racket[n] goes from @racket[0.0] to @racket[1.0]. The top-left
locations of @racket[p-from] and @racket[p-to] determine the placement
of the top-left of @racket[p].
The @scheme[p-from] and @scheme[p-to] picts are typically
@scheme[launder]ed @scheme[ghost]s of @scheme[p] within @scheme[base],
but they can be any picts within @scheme[base].}
The @racket[p-from] and @racket[p-to] picts are typically
@racket[launder]ed @racket[ghost]s of @racket[p] within @racket[base],
but they can be any picts within @racket[base].}
@; --------------------------------------------------
@ -200,15 +200,15 @@ but they can be any picts within @scheme[base].}
...)
((real-in 0.0 1.0) . ->* . pict?)]{
Converts a list of @scheme[gen] functions into a single function that
uses each @scheme[gen] in sequence.}
Converts a list of @racket[gen] functions into a single function that
uses each @racket[gen] in sequence.}
@defproc[(reverse-animations [gen ((real-in 0.0 1.0) . ->* . pict?)]
...)
((real-in 0.0 1.0) . ->* . pict?)]{
Converts a list of @scheme[gen] functions into a single function that
run @scheme[(sequence-animations gen ...)] in reverse.}
Converts a list of @racket[gen] functions into a single function that
run @racket[(sequence-animations gen ...)] in reverse.}
@; --------------------------------------------------
@ -221,45 +221,45 @@ run @scheme[(sequence-animations gen ...)] in reverse.}
@defproc[(fast-middle [n (in-real 0.0 1.0)]) (in-real 0.0 1.0)]
)]{
Monotonically but non-uniformly maps @scheme[n] with fixed
points at @scheme[0.0] and @scheme[1.0].
Monotonically but non-uniformly maps @racket[n] with fixed
points at @racket[0.0] and @racket[1.0].
The @scheme[fast-start] mapping is convex, so that
The @racket[fast-start] mapping is convex, so that
@schemeblock[(slide-pict _base p _p1 _p2 (fast-start n))]
@racketblock[(slide-pict _base p _p1 _p2 (fast-start n))]
appears to move quickly away from @scheme[_p1] and then slowly as it
approaches @scheme[_p2], assuming that @scheme[n] increases uniformly.
appears to move quickly away from @racket[_p1] and then slowly as it
approaches @racket[_p2], assuming that @racket[n] increases uniformly.
The @scheme[fast-end] mapping is concave, so that
The @racket[fast-end] mapping is concave, so that
@schemeblock[(slide-pict _base _p _p1 _p2 (fast-start _n))]
@racketblock[(slide-pict _base _p _p1 _p2 (fast-start _n))]
appears to move slowly away from @scheme[_p1] and then quicly as it
approaches @scheme[_p2], assuming that @scheme[_n] increases uniformly.
appears to move slowly away from @racket[_p1] and then quicly as it
approaches @racket[_p2], assuming that @racket[_n] increases uniformly.
The @scheme[fast-edges] mapping is convex at first and concave at the
The @racket[fast-edges] mapping is convex at first and concave at the
end, so that
@schemeblock[(slide-pict _base _p _p1 _p2 (fast-start _n))]
@racketblock[(slide-pict _base _p _p1 _p2 (fast-start _n))]
appears to move quickly away from @scheme[_p1], then more slowly, and
then quickly again near @scheme[_p2], assuming that @scheme[_n] increases
appears to move quickly away from @racket[_p1], then more slowly, and
then quickly again near @racket[_p2], assuming that @racket[_n] increases
uniformly.
The @scheme[fast-middle] mapping is concave at first and convex at the
The @racket[fast-middle] mapping is concave at first and convex at the
end, so that
@schemeblock[(slide-pict _base _p _p1 _p2 (fast-start _n))]
@racketblock[(slide-pict _base _p _p1 _p2 (fast-start _n))]
appears to move slowly away from @scheme[_p1], then more quickly, and
then slowly again near @scheme[_p2], assuming that @scheme[_n] increases
appears to move slowly away from @racket[_p1], then more quickly, and
then slowly again near @racket[_p2], assuming that @racket[_n] increases
uniformly.}
@defproc[(split-phase [n (in-real 0.0 1.0)])
(values (in-real 0.0 1.0) (in-real 0.0 1.0))]{
Splits the progression of @scheme[n] from @scheme[0.0] to @scheme[1.0]
into a progression from @scheme[(values 0.0 0.0)] to @scheme[(values
1.0 0.0)] and then @scheme[(values 1.0 0.0)] to @scheme[(values 1.0
Splits the progression of @racket[n] from @racket[0.0] to @racket[1.0]
into a progression from @racket[(values 0.0 0.0)] to @racket[(values
1.0 0.0)] and then @racket[(values 1.0 0.0)] to @racket[(values 1.0
1.0)].}

View File

@ -1,6 +1,6 @@
#lang scribble/doc
@(require "ss.ss"
(for-label (except-in scheme/gui drop)
(for-label (except-in racket/gui drop)
slideshow/step
slideshow/slides-to-picts))
@ -11,8 +11,8 @@
@declare-exporting[slideshow/base slideshow]
@defmodule*/no-declare[(slideshow/base)]{The
@schememodname[slideshow/base] module, which is re-provided by
@schememodname[slideshow], provides the functions for creating slides.}
@racketmodname[slideshow/base] module, which is re-provided by
@racketmodname[slideshow], provides the functions for creating slides.}
@local-table-of-contents[]
@ -34,72 +34,72 @@
void?]{
Creates and registers a slide. See @secref["staging"] for information
about @scheme[element]s.
about @racket[element]s.
When this function is first called in non-printing mode, then the
viewer window is opened. Furthermore, each call to the function
@scheme[yield]s, so that the viewer window can be refreshed, and so
@racket[yield]s, so that the viewer window can be refreshed, and so
the user can step through slides.
If @scheme[title] is not @scheme[#f], then a title is shown for the
slide. The @scheme[name] is used in the slide-navigation dialog, and
it defaults to @scheme[title].
If @racket[title] is not @racket[#f], then a title is shown for the
slide. The @racket[name] is used in the slide-navigation dialog, and
it defaults to @racket[title].
If @scheme[layout] is @scheme['top], then the content is top-aligned,
with @scheme[(* 2 gap-size)] space between the title and the
content. The @scheme['tall] layout is similar, but with only
@scheme[gap-size]. The @scheme['center] mode centers the content
(ignoring space consumed by the title). The @scheme['auto] mode is
like @scheme['center], except when @scheme[title] is non-@scheme[#f]
If @racket[layout] is @racket['top], then the content is top-aligned,
with @racket[(* 2 gap-size)] space between the title and the
content. The @racket['tall] layout is similar, but with only
@racket[gap-size]. The @racket['center] mode centers the content
(ignoring space consumed by the title). The @racket['auto] mode is
like @racket['center], except when @racket[title] is non-@racket[#f]
and when the space between the title and content would be less than
@scheme[(* 2 gap-size)], in which case it behaves like @scheme['top].
@racket[(* 2 gap-size)], in which case it behaves like @racket['top].
The @scheme[inset] argument supplies an inset that makes the
The @racket[inset] argument supplies an inset that makes the
slide-viewing window smaller when showing the slide. See
@scheme[make-slide-inset] for more information.
@racket[make-slide-inset] for more information.
If @scheme[secs] argument for @scheme[#:timeout] is not @scheme[#f],
If @racket[secs] argument for @racket[#:timeout] is not @racket[#f],
then the viewer automatically advances from this slide to the next
after @scheme[secs] seconds, and manual advancing skips this slide.
after @racket[secs] seconds, and manual advancing skips this slide.
If @scheme[condense?] is ture, then in condense mode (as specified by
If @racket[condense?] is ture, then in condense mode (as specified by
the @Flag{c} command-line flag), the slide is not created and
registered.}
@defproc[(t [str string?]) pict?]{
The normal way to make plain text. Returns @scheme[(text str
The normal way to make plain text. Returns @racket[(text str
(current-main-font) (current-font-size))].}
@defproc[(it [str string?]) pict?]{
The normal way to make italic text. Returns @scheme[(text str (cons
The normal way to make italic text. Returns @racket[(text str (cons
'italic (current-main-font)) (current-font-size))].}
@defproc[(bt [str string?]) pict?]{
The normal way to make bold text. Returns @scheme[(text str (cons
The normal way to make bold text. Returns @racket[(text str (cons
'bold (current-main-font)) (current-font-size))].}
@defproc[(bit [str string?]) pict?]{
Bold-italic text. Returns @scheme[(text str (list* 'bold 'italic
Bold-italic text. Returns @racket[(text str (list* 'bold 'italic
(current-main-font)) (current-font-size))].}
@defproc[(tt [str string?]) pict?]{
The normal way to make monospaced text. Returns @scheme[(text str
The normal way to make monospaced text. Returns @racket[(text str
`(bold . modern) (current-font-size))].}
@defproc[(rt [str string?]) pict?]{
The normal way to make serif text. Returns @scheme[(text str 'roman
The normal way to make serif text. Returns @racket[(text str 'roman
(current-font-size))].}
@defproc[(titlet [str string?]) pict?]{
Creates title text. Returns @scheme[((current-titlet) str)].}
Creates title text. Returns @racket[((current-titlet) str)].}
@defproc[(para [#:width width real? (current-para-width)]
[#:align align (or/c 'left 'center 'right) 'left]
@ -109,19 +109,19 @@ Creates title text. Returns @scheme[((current-titlet) str)].}
(or/c string? pict? (listof elem/c)))] ...)
pict?]{
Generates a paragraph pict that is no wider than @scheme[width] units,
and that is exactly @scheme[width] units if @scheme[fill?] is true. If
@scheme[fill?] is @scheme[#f], then the result pict is as wide as the
Generates a paragraph pict that is no wider than @racket[width] units,
and that is exactly @racket[width] units if @racket[fill?] is true. If
@racket[fill?] is @racket[#f], then the result pict is as wide as the
widest line.
Each list within @scheme[element]s is spliced into the sequence of
string and pict elements. If @scheme[decode?] is true, then strings
among the @scheme[element]s are decoded by performing the following
Each list within @racket[element]s is spliced into the sequence of
string and pict elements. If @racket[decode?] is true, then strings
among the @racket[element]s are decoded by performing the following
substitutions: @litchar{---} @d=> @litchar["\u2014"], @litchar{--}
@d=> @litchar["\u2013"], @litchar{``} @d=> @litchar["\u201C"],
@litchar{''} @d=> @litchar["\u201D"], @litchar{'} @d=>
@litchar["\u2019"]. In addition, to better work with
@schememodname[at-exp] notation, if an @scheme[element] is @scheme["\n"],
@racketmodname[at-exp] notation, if an @racket[element] is @racket["\n"],
then it is dropped along with any spaces at the start of the next
element.
@ -135,11 +135,11 @@ is added before the string:
@litchar{;} @litchar{?} @litchar{!} @litchar{)} @litchar["\u201D"] @litchar["\u2019"]
}
The @scheme[align] argument specifies how to align lines within the
The @racket[align] argument specifies how to align lines within the
paragraph.
See the spacing between lines is determined by the
@scheme[current-line-sep] parameter.}
@racket[current-line-sep] parameter.}
@defproc[(item [#:width width real? (current-para-width)]
@ -151,10 +151,10 @@ See the spacing between lines is determined by the
(or/c string? pict? (listof elem/c)))] ...)
pict?]{
Like @scheme[para], but with @scheme[blt] followed by @scheme[(/
Like @racket[para], but with @racket[blt] followed by @racket[(/
gap-size 2)] space appended horizontally to the resulting paragraph,
aligned with the top line. The paragraph width of @scheme[blt] plus
@scheme[(/ gap-size 2)] is subtracted from the maximum width of the
aligned with the top line. The paragraph width of @racket[blt] plus
@racket[(/ gap-size 2)] is subtracted from the maximum width of the
paragraph.}
@ -167,10 +167,10 @@ paragraph.}
(or/c string? pict? (listof elem/c)))] ...)
pict?]{
Like @scheme[item], but an additional @scheme[(* 2 gap-size)] is
Like @racket[item], but an additional @racket[(* 2 gap-size)] is
subtracted from the paragraph width and added as space to the left of
the pict. Also, @scheme[o-bullet] is the default bullet, instead of
@scheme[bullet].}
the pict. Also, @racket[o-bullet] is the default bullet, instead of
@racket[bullet].}
@defproc[(clickback [pict pict?] [thunk (-> any)])
@ -178,14 +178,14 @@ the pict. Also, @scheme[o-bullet] is the default bullet, instead of
Creates a pict that embeds the given one, and is the same size as the
given pict, but that when clicked during a presentation calls
@scheme[thunk].}
@racket[thunk].}
@defproc[(size-in-pixels [pict pict?]) pict?]{
Scales @scheme[pict] so that it is displayed on the screen as
@scheme[(pict-width pict)] pixels wide and @scheme[(pict-height pict)]
pixels tall. The result is @scheme[pict] when using a 1024 by 768
Scales @racket[pict] so that it is displayed on the screen as
@racket[(pict-width pict)] pixels wide and @racket[(pict-height pict)]
pixels tall. The result is @racket[pict] when using a 1024 by 768
display.}
@ -199,21 +199,21 @@ display.}
Returns a function that takes a symbol and generates an outline
slide.
The @scheme[...] above applies to all three arguments together. Each
The @racket[...] above applies to all three arguments together. Each
trio of arguments defines a section for the outline:
@itemize[
@item{The section @scheme[name] is either a symbol or a list of symbols. When
@item{The section @racket[name] is either a symbol or a list of symbols. When
the outline function is called later to make an outline, the
given symbol is compared to the section's symbol(s), and the
section is marked as current if the symbol matches.}
@item{The @scheme[title] is used as the displayed name of the
@item{The @racket[title] is used as the displayed name of the
section.}
@item{The @scheme[subitems] are displayed when the section is
active. It can be @scheme[#f] or @scheme[null] (for historical
@item{The @racket[subitems] are displayed when the section is
active. It can be @racket[#f] or @racket[null] (for historical
reasons) if no subitems are to be displayed. Otherwise, it
should be a function that takes a symbol (the same one passed
to the outline maker) and produces a pict.}
@ -224,12 +224,12 @@ trio of arguments defines a section for the outline:
comment?]{
Combines strings and picts to be used as a slide element for (usually
hidden) commentary. Use the result as an argument to @scheme[slide].}
hidden) commentary. Use the result as an argument to @racket[slide].}
@defproc[(comment? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a comment produced by
@scheme[comment].}
Returns @racket[#t] if @racket[v] is a comment produced by
@racket[comment].}
@; ------------------------------------------------------------------------
@ -237,25 +237,25 @@ Returns @scheme[#t] if @scheme[v] is a comment produced by
@defproc[(most-recent-slide) slide?]{
Returns a slide structure that be supplied @scheme[re-slide] to make a
Returns a slide structure that be supplied @racket[re-slide] to make a
copy of the slide.}
@defproc[(retract-most-recent-slide) slide?]{
Cancels the most recently created slide, and also returns a slide
structure that be supplied to @scheme[re-slide] to restore the slide
structure that be supplied to @racket[re-slide] to restore the slide
(usually in a later position).}
@defproc[(re-slide [slide slide?] [pict pict? (blank)])
void?]{
Re-inserts a slide, @scheme[lt-superimpose]ing the given additional
@scheme[pict].}
Re-inserts a slide, @racket[lt-superimpose]ing the given additional
@racket[pict].}
@defproc[(slide? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a slide produced by
@scheme[most-recent-slide] or @scheme[retract-most-recent-slide].}
Returns @racket[#t] if @racket[v] is a slide produced by
@racket[most-recent-slide] or @racket[retract-most-recent-slide].}
@; ------------------------------------------------------------------------
@ -276,7 +276,7 @@ Enables or disables slide advance as a result of a mouse click.}
@defproc[(set-use-background-frame! [on? any/c]) void?]{
Enables or disables the creation of a background frame, which is
typically useful only when @scheme[make-slide-inset] is used are
typically useful only when @racket[make-slide-inset] is used are
active. The last enable/disable before the first slide registration
takes effect once and for all.}
@ -316,39 +316,39 @@ A width commonly used for layout.}
@defthing[bullet pict?]{
A filled bullet used by default by @scheme[item].}
A filled bullet used by default by @racket[item].}
@defthing[o-bullet pict?]{
A hollow bullet used by default by @scheme[subitem].}
A hollow bullet used by default by @racket[subitem].}
@defidform[client-w]{
Produces the width of the display area, minus @scheme[margin]s. The
Produces the width of the display area, minus @racket[margin]s. The
result of the form changes if the margin is adjusted via
@scheme[set-margin!].}
@racket[set-margin!].}
@defidform[client-h]{
Produces the height of the display area, minus @scheme[margin]s, but
Produces the height of the display area, minus @racket[margin]s, but
including the title area). The result of the form changes if the
margin is adjusted via @scheme[set-margin!].}
margin is adjusted via @racket[set-margin!].}
@defidform[full-page]{
Produces an empty pict that is the same size as the client area, which
is like @scheme[(blank client-w client-h)].}
is like @racket[(blank client-w client-h)].}
@defidform[titleless-page]{
Produces an empty pict that is the same size as the client area minus
the title area in @scheme['top] layout mode, which is like
@scheme[(blank client-w (- client-h title-h (* 2 gap-size)))].}
the title area in @racket['top] layout mode, which is like
@racket[(blank client-w (- client-h title-h (* 2 gap-size)))].}
@defidform[margin]{
@ -356,33 +356,33 @@ the title area in @scheme['top] layout mode, which is like
Produces a number that corresponds to the current margin, which
surrounds every side of the slide. The client area for a slide
corresponds to the display area (which is always 1024 by 768) minus
this margin on each side. The default margin is @scheme[20].
this margin on each side. The default margin is @racket[20].
The margin can be adjusted via @scheme[set-margin!].}
The margin can be adjusted via @racket[set-margin!].}
@defidform[title-h]{
Produces a number that corresponds to the height of a title created by
@scheme[titlet].
@racket[titlet].
If @scheme[titlet] is changed via the @scheme[current-titlet]
If @racket[titlet] is changed via the @racket[current-titlet]
parameter, the title height should be updated via
@scheme[set-title-h!].}
@racket[set-title-h!].}
@defthing[printing? boolean?]{
The value is @scheme[#t] if slides are being generated for printed
output, @scheme[#f] for normal on-screen display. Printing mode is
The value is @racket[#t] if slides are being generated for printed
output, @racket[#f] for normal on-screen display. Printing mode is
normally triggered via the @DFlag{print} or @DFlag{ps} command-line
flag.}
@defthing[condense? boolean?]{
The value is @scheme[#t] if slides are being generated in condensed
mode, @scheme[#f] for normal mode. Condensed mode is normally
The value is @racket[#t] if slides are being generated in condensed
mode, @racket[#f] for normal mode. Condensed mode is normally
triggered via the @DFlag{condense} command-line flag.}
@; ------------------------------------------------------------------------
@ -391,34 +391,34 @@ triggered via the @DFlag{condense} command-line flag.}
@defparam[current-font-size n exact-nonnegative-integer?]{
Parameter that determines he font size used by @scheme[t],
@scheme[para], etc. The default size is @scheme[32].}
Parameter that determines he font size used by @racket[t],
@racket[para], etc. The default size is @racket[32].}
@defparam[current-main-font style text-style/c]{
Parameter that determines the font size used by @scheme[t],
@scheme[para], etc. The default is platform-specific; possible
initial values include @scheme['swiss], @scheme["Verdana"], and
@scheme["Gill Sans"].}
Parameter that determines the font size used by @racket[t],
@racket[para], etc. The default is platform-specific; possible
initial values include @racket['swiss], @racket["Verdana"], and
@racket["Gill Sans"].}
@defparam[current-line-sep n exact-nonnegative-integer?]{
Parameter that controls the amount of space used between lines by
@scheme[para], @scheme[item], and @scheme[subitem].}
@racket[para], @racket[item], and @racket[subitem].}
@defparam[current-para-width n exact-nonnegative-integer?]{
Parameter that controls the width of a pict created by
@scheme[para], @scheme[item], and @scheme[subitem].}
@racket[para], @racket[item], and @racket[subitem].}
@defparam[current-title-color color (or/c string? (is-a?/c color%))]{
Parameter used by the default @scheme[current-titlet] to colorize the
title. The default is @scheme["black"].}
Parameter used by the default @racket[current-titlet] to colorize the
title. The default is @racket["black"].}
@defparam[current-slide-assembler proc ((or/c string? #f)
@ -429,48 +429,48 @@ title. The default is @scheme["black"].}
Parameter whose value is a function for assembling slide content into
a single pict; the assembling function takes a string for the title
(or @scheme[#f]), a separation for the title (if any) and pict, and a
(or @racket[#f]), a separation for the title (if any) and pict, and a
pict for the slide content (not counting the title).
The result is of the assembler is @scheme[ct-superimpose]d with the
The result is of the assembler is @racket[ct-superimpose]d with the
client area, but the result pict might draw outside the client region
to paint the screen margins, too.
The default assembler uses @scheme[titlet] to turn a title string (if
any) to a pict. See also @scheme[current-titlet] and
@scheme[set-title-h!],.
The default assembler uses @racket[titlet] to turn a title string (if
any) to a pict. See also @racket[current-titlet] and
@racket[set-title-h!],.
The slide assembler is @emph{not} responsible for adding page
numbers to the slide; that job belongs to the viewer. See also
@scheme[current-page-number-font], @scheme[current-page-number-color],
and @scheme[set-page-numbers-visible!].}
@racket[current-page-number-font], @racket[current-page-number-color],
and @racket[set-page-numbers-visible!].}
@defparam[current-titlet proc (string? . -> . pict?)]{
Parameter to configure @scheme[titlet]. The default is
Parameter to configure @racket[titlet]. The default is
@schemeblock[
@racketblock[
(lambda (s)
(colorize (text s (current-main-font) 40)
(current-title-color)))
]
If this parameter is changed such that the result is a different
height, then @scheme[set-title-h!] should be called to update the
value produced by @scheme[title-h], @scheme[titleless-page], etc.}
height, then @racket[set-title-h!] should be called to update the
value produced by @racket[title-h], @racket[titleless-page], etc.}
@defproc[(set-margin! [amt real?]) void?]{
Changes the margin that surrounds the client area. See also
@scheme[margin].}
@racket[margin].}
@defproc[(set-title-h! [amt real?]) void?]{
Changes the expected height of a title, which adjusts @scheme[title-h],
@scheme[client-h], @scheme[full-page], and @scheme[titleless-page].}
Changes the expected height of a title, which adjusts @racket[title-h],
@racket[client-h], @racket[full-page], and @racket[titleless-page].}
@defproc[(make-slide-inset [left-inset exact-nonnegative-integer?]
@ -485,86 +485,86 @@ viewer for a slide on each side.}
@defproc[(slide-inset? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a slide inset created by
@scheme[make-slide-inset], @scheme[#f] otherwise.}
Returns @racket[#t] if @racket[v] is a slide inset created by
@racket[make-slide-inset], @racket[#f] otherwise.}
@; ----------------------------------------------------------------------
@section{Pict-Staging Helper}
@defmodule[slideshow/step]{The @schememodname[slideshow/step] library
@defmodule[slideshow/step]{The @racketmodname[slideshow/step] library
provides syntax for breaking a complex slide into steps that are more
complex than can be handled with @scheme['next] and @scheme['alts] in
a @scheme[slide] sequence.}
complex than can be handled with @racket['next] and @racket['alts] in
a @racket[slide] sequence.}
@defform[(with-steps (id ...) body ...)]{
Evaluates the @scheme[body]s once for each @scheme[id], skipping an
@scheme[id] if its name ends with @litchar{~} and @scheme[condense?]
is true. The results of the last @scheme[body] for each iteration are
collected into a list, which is the result of the @scheme[with-steps]
Evaluates the @racket[body]s once for each @racket[id], skipping an
@racket[id] if its name ends with @litchar{~} and @racket[condense?]
is true. The results of the last @racket[body] for each iteration are
collected into a list, which is the result of the @racket[with-steps]
form.
Within the @scheme[body]s, several keywords are bound non-hygienically
(using the first @scheme[body]'s lexical context):
Within the @racket[body]s, several keywords are bound non-hygienically
(using the first @racket[body]'s lexical context):
@itemize[
@item{@scheme[(only? id)] --- returns @scheme[#t] during the
@scheme[id] step (i.e., during the evaluation of the
@scheme[body]s for @scheme[id]), @scheme[#f] otherwise.}
@item{@racket[(only? id)] --- returns @racket[#t] during the
@racket[id] step (i.e., during the evaluation of the
@racket[body]s for @racket[id]), @racket[#f] otherwise.}
@item{@scheme[(vonly id)] --- returns the identity function during
the @scheme[id] step, @scheme[ghost] otherwise.}
@item{@racket[(vonly id)] --- returns the identity function during
the @racket[id] step, @racket[ghost] otherwise.}
@item{@scheme[(only id _then-expr)] returns the result of
@scheme[_then-expr] during the @scheme[id] step, @scheme[values]
@item{@racket[(only id _then-expr)] returns the result of
@racket[_then-expr] during the @racket[id] step, @racket[values]
otherwise.}
@item{@scheme[(only id _then-expr _else-expr)] returns the result
of @scheme[_then-expr] during the @scheme[id] step, the result of
@scheme[_else-expr] otherwise.}
@item{@racket[(only id _then-expr _else-expr)] returns the result
of @racket[_then-expr] during the @racket[id] step, the result of
@racket[_else-expr] otherwise.}
@item{@scheme[(before? id)] --- returns @scheme[#t] before the
@scheme[id] step, @scheme[#f] starting for the @scheme[id] and
@item{@racket[(before? id)] --- returns @racket[#t] before the
@racket[id] step, @racket[#f] starting for the @racket[id] and
afterward.}
@item{@scheme[(vbefore id)], @scheme[(before id _then-expr)], or
@scheme[(before id _then-expr _else-expr)] --- analogous to
@scheme[vonly] and @scheme[only].}
@item{@racket[(vbefore id)], @racket[(before id _then-expr)], or
@racket[(before id _then-expr _else-expr)] --- analogous to
@racket[vonly] and @racket[only].}
@item{@scheme[(after? id)] --- returns @scheme[#t] after the
@scheme[id] step, @scheme[#f] through the @scheme[id] step.}
@item{@racket[(after? id)] --- returns @racket[#t] after the
@racket[id] step, @racket[#f] through the @racket[id] step.}
@item{@scheme[(vafter id)], @scheme[(after id _then-expr)], or
@scheme[(after id _then-expr _else-expr)] --- analogous to
@scheme[vonly] and @scheme[only].}
@item{@racket[(vafter id)], @racket[(after id _then-expr)], or
@racket[(after id _then-expr _else-expr)] --- analogous to
@racket[vonly] and @racket[only].}
@item{@scheme[(between? _a-id _b-id)] --- returns @scheme[#t]
starting from the @scheme[_a-id] step through the @scheme[_b-id]
step, @scheme[#f] otherwise.}
@item{@racket[(between? _a-id _b-id)] --- returns @racket[#t]
starting from the @racket[_a-id] step through the @racket[_b-id]
step, @racket[#f] otherwise.}
@item{@scheme[(vbetween _a-id _b-id)], @scheme[(between _a-id
_b-id _then-expr)], or @scheme[(between _a-id _b-id _then-expr
_else-expr)] --- analogous to @scheme[vonly] and @scheme[only].}
@item{@racket[(vbetween _a-id _b-id)], @racket[(between _a-id
_b-id _then-expr)], or @racket[(between _a-id _b-id _then-expr
_else-expr)] --- analogous to @racket[vonly] and @racket[only].}
@item{@scheme[(between-excel? _a-id _b-id)] --- returns
@scheme[#t] starting from the @scheme[_a-id] step through steps
before the @scheme[_b-id] step, @scheme[#f] for the @scheme[_b-id]
@item{@racket[(between-excel? _a-id _b-id)] --- returns
@racket[#t] starting from the @racket[_a-id] step through steps
before the @racket[_b-id] step, @racket[#f] for the @racket[_b-id]
step and afterward.}
@item{@scheme[(vbetween-excl _a-id _b-id)], @scheme[(between-excl
_a-id _b-id _then-expr)], or @scheme[(between-excl _a-id _b-id
_then-expr _else-expr)] --- analogous to @scheme[vonly] and
@scheme[only].}
@item{@racket[(vbetween-excl _a-id _b-id)], @racket[(between-excl
_a-id _b-id _then-expr)], or @racket[(between-excl _a-id _b-id
_then-expr _else-expr)] --- analogous to @racket[vonly] and
@racket[only].}
]}
@defform[(with-steps~ (id ...) body ...)]{
Like @scheme[with-steps], but when @scheme[condense?] is true, then
@scheme[expr] is evaluated only for the last @scheme[id] (independent
of whether the name fo the last @scheme[id] name ends in @litchar{~}).
Like @racket[with-steps], but when @racket[condense?] is true, then
@racket[expr] is evaluated only for the last @racket[id] (independent
of whether the name fo the last @racket[id] name ends in @litchar{~}).
}
@; ----------------------------------------------------------------------
@ -580,12 +580,12 @@ of whether the name fo the last @scheme[id] name ends in @litchar{~}).
[stop-after (or/c #f exact-nonnegative-integer?) #f])
(listof pict?)]{
Executes the Slideshow program indicated by @scheme[path] in a fresh
Executes the Slideshow program indicated by @racket[path] in a fresh
namespace, and returns a list of picts for the slides. Each pict has
the given @scheme[width] and @scheme[height], and @scheme[condense?]
the given @racket[width] and @racket[height], and @racket[condense?]
determines whether the Slideshow program is executed in condense
mode.
If @scheme[stop-after] is not @scheme[#f], then the list is truncated
after @scheme[stop-after] slides are converted to picts.}
If @racket[stop-after] is not @racket[#f], then the list is truncated
after @racket[stop-after] slides are converted to picts.}

View File

@ -3,7 +3,7 @@
@(define paper-url "http://www.cs.utah.edu/plt/publications/jfp05-ff.pdf")
@title{@bold{Slideshow}: PLT Figure and Presentation Tools}
@title{@bold{Slideshow}: Racket Figure and Presentation Tools}
@author["Matthew Flatt" "Robert Bruce Findler"]
@ -19,7 +19,7 @@ To learn more about why Slideshow is cool, see also ``Slideshow:
Functional Presentations'' @cite["Findler06"].
@defmodulelang*/no-declare[(slideshow)]{Most of the bindings defined in
the manual are provided by the @schememodname[slideshow] language.}
the manual are provided by the @racketmodname[slideshow] language.}
@table-of-contents[]

View File

@ -1,11 +1,11 @@
#lang scheme/base
#lang racket/base
(require scribble/manual)
(provide (all-from-out scribble/manual))
(require (for-label (except-in scheme only drop)
(require (for-label (except-in racket only drop)
slideshow/base
slideshow/pict))
(provide (for-label (all-from-out scheme
(provide (for-label (all-from-out racket
slideshow/base
slideshow/pict)))