|
|
Class: HTMLDocumentPainter
Object
|
+--HTMLDocumentInterpreter
|
+--HTMLDocumentPainter
- Package:
- stx:libhtml
- Category:
- System-Documentation
- Version:
- rev:
1.291
date: 2009/11/02 16:58:52
- user: cg
- file: HTMLDocumentPainter.st directory: libhtml
- module: stx stc-classLibrary: libhtml
- Author:
- Claus Gittinger
This one is responsible to paint a document (a linked list
of HTMLElements) into some drawable.
The major entry points are:
format:for:resolver:style:
to scan the list for applets, widgets
and preformat it.
reformatDocument
to reformat the document after a size change of the
drawable.
displayX:y:width:height:on:
to redraw (part of) the document.
HTMLParser
HTMLDocumentView
initialization
-
initialize
-
accessing
-
applets
-
return a collection of my applets
-
arrayOfHeaderIndex
-
returns current header index
-
forms
-
return a collection of my forms
-
listOfHeaders
-
returns current list of headers
-
scriptObject
-
return my scriptObject - if any
accessing-private
-
currentBGColor
-
-
currentColIndex
-
-
currentColor
-
-
currentElement
-
-
currentFont
-
-
currentFontAscent
-
-
currentFontAvgHeight
-
-
currentFontHeight
-
-
currentForm
-
-
currentIndentOffset
-
-
currentLeftIndent
-
-
currentRightIndent
-
-
currentRowIndex
-
-
currentTable
-
-
document: aDocument
-
-
hBegin
-
-
haveSpace
-
-
inBLOCKQUOTE
-
-
inCenter
-
-
inDL
-
-
inKbd
-
-
inNoBreak
-
-
inOL
-
-
inPre
-
-
inRightAlign
-
-
inStrikeout
-
-
inSup
-
-
inUnderline
-
-
needSpace
-
-
previousIsEmpty
-
-
styleStack
-
-
ulLevel
-
-
xPosition
-
-
yNextLine
-
-
yPosition
-
-
yText
-
applets
-
createAppletFor: element
-
-
defineAppletParameterFor: element
-
-
destroyApplet: appletElement
-
-
setupAppletElement: element
-
checking
-
checkInitialStateAtEndOfDocument
-
check for correct closing TAGS.
Although, most HTML viewers can handle this case, its usually an
indication of some error and often leads to badly formatted documents
-
printCheckInfoMessage: msg
-
contents
-
contentsAddHeader: text
-
assign text to header and store in list of headers
-
headerAsString: anArray depht: depth
-
returns printable header assigned to array
-
printContents
-
-
printContents: aList pageNumber: initialPageNumber romanPageNumbers: romanPageNumbers
-
print contents to destination
displaying
-
displayX: xLeft y: yTop width: w height: h on: aGC
-
-
pageBreak
-
(y > self pageBreakLimit and:[self atLeft and:[destination isView not]]) ifTrue:[
-
pageBreakLimit
-
-
redrawDocument
-
elements-document
-
body
-
-
head
-
-
headEnd
-
-
meta
-
-
title
-
-
titleEnd
-
elements-forms
-
anyFormElement: element
-
-
form
-
-
formEnd
-
-
input
-
-
prescanForm: aFormElement
-
prescan a form, for its widgets max height.
a kludge - we need the form elements' heights BEFORE
formatting (since the text-elements have no origin knowledge,
which could be backpatched (also, we needed a way to break
MarkupText into multiple individual text items
-
prescanForms
-
a kludge - we need the form elements' heights BEFORE
formatting - since the text-elements have no origin knowledge,
which could be backpatched (also, we needed a way to break
MarkupText into multiple individual text items)
-
textarea
-
-
textareaEnd
-
elements-lists
-
blockquote
-
-
blockquoteEnd
-
-
dd
-
self conditionalBreak.
-
dir
-
-
dirEnd
-
-
dl
-
-
dlEnd
-
-
dt
-
-
li
-
-
li_ol
-
-
li_ul
-
in <ul> ... </ul> - draw a bullet
-
listTypeOElement: anElement
-
-
menu
-
-
menuEnd
-
-
ol
-
-
olEnd
-
-
ul
-
-
ulEnd
-
elements-pseudoTags
-
internalMathFont
-
-
internalMathFontEnd
-
elements-special
-
a
-
-
aEnd
-
-
app
-
backward compatible (now obsolete) applet tag
-
appEnd
-
backward compatible (now obsolete) applet end-tag
-
applet
-
-
appletEnd
-
-
area
-
-
img
-
<IMG
SRC='image-url'
ALT='alternative-text'
WIDTH=w
HEIGHT=h
HSPACE=hSpc
VSPACE=vSpc
BORDER=bw
NOPRINT // deprecated
PRINT=yesOrNo // deprecated
LOWSRC='lowRes-image-url' // not implemented
>
-
map
-
-
mapEnd
-
-
param
-
done in preparse - see #defineAppletParameterFor: ...
-
script
-
the script is now loaded and evaluated by the parser
(to allow it to generate the HTML text ...)
However, we need to remember it, for startup & cleanup message
sends.
-
specialMarkup
-
elements-structure
-
br
-
-
center
-
-
centerEnd
-
-
div
-
-
h1
-
-
h1End
-
-
h2
-
-
h2End
-
-
h3
-
-
h3End
-
-
h4
-
-
h4End
-
-
h5
-
-
h5End
-
-
h6
-
-
h6End
-
-
h7
-
-
h7End
-
-
h8
-
-
h8End
-
-
h9
-
-
h9End
-
-
hr
-
-
nobr
-
-
nobrEnd
-
-
p
-
-
pEnd
-
-
pre
-
-
preEnd
-
-
tab
-
-
wbr
-
-
xmp
-
-
xmpEnd
-
elements-style
-
acronym
-
-
acronymEnd
-
-
address
-
-
addressEnd
-
-
b
-
-
bEnd
-
-
cite
-
-
citeEnd
-
-
code
-
(element hasParameterFor:'FOO') ifTrue:[self halt].
-
codeEnd
-
-
dfn
-
-
dfnEnd
-
self handlePendingSpaceNeed.
-
em
-
-
emEnd
-
-
font
-
-
fontEnd
-
-
i
-
-
iEnd
-
-
kbd
-
-
kbdEnd
-
-
s
-
-
sEnd
-
-
samp
-
-
sampEnd
-
-
strike
-
-
strikeEnd
-
-
strong
-
-
strongEnd
-
-
sub
-
-
subEnd
-
-
sup
-
-
supEnd
-
-
tt
-
-
ttEnd
-
-
u
-
-
uEnd
-
self handlePendingSpaceNeed.
-
var
-
-
varEnd
-
elements-tables
-
caption
-
-
drawTable
-
-
drawTableRow: row
-
draw one row
-
finishPreviousTableColumn
-
-
finishPreviousTableRow: final
-
-
table
-
-
tableEnd
-
-
td
-
-
th
-
-
th_td_common
-
-
tr
-
elements-text
-
addText: txtIn fromElement: element
-
-
privateDrawString: aString atX: xS y: yS to: xE
-
formatting
-
flushAnchorColors
-
-
format: docAnchor for: aGC resolver: aResolver style: aStyle
-
-
process: aDocumentAnchor
-
-
reformatDocument
-
helpers
-
atLeft
-
-
atOrLeftOfLeft
-
-
atTop
-
-
break
-
-
conditionalBreak
-
break line if not already at the beginning
-
conditionalEmpty
-
add vertical space, but only if there is not already some
-
currentElementHasHREF
-
-
do_needAndNewPage
-
handle any NEWPAGE and NEED= attributes of the current element,
put only if painting to paper (i.e. ignore if displaying)
-
do_starOfficeStyleBefore
-
handle
STYLE='page-break-before: always'
-
empty
-
-
empty: height
-
-
fontFor: aFont onDevice: aDevice
-
-
getFontsFor: aGC
-
-
handlePendingSpaceNeed
-
-
header: index font: aFont space: space
-
-
headerEnd
-
-
initialHeaderNumbers
-
-
needSpace: nPixel
-
-
relativeValueFrom: aString with: aNumericValue
-
-
romanStringFor: aNumber
-
initialization & release
-
release
-
sent from docView, to release stuff
-
terminateMetaCommands
-
sent from docView, to release stuff
meta commands
-
processMetaCommands
-
-
refreshDocument: url
-
private
-
addSyncPoint
-
-
forkImageSequencePlayerFor: entry
-
-
handleColorAttribute
-
-
handleColorChange
-
-
playImageSequence: entry
-
-
processFrom: firstElement while: aBlock
-
process elements starting with firstElement, while aBlock
returns true. Should be called from a saveExcursion block.
-
resyncFrom: syncPoint
-
fetch the state found there
-
saveExcursion: aBlock
-
save the current state, perform aBlock and restore the state afterwards
-
saveExcursionFrom: firstElement while: testBlock
-
remember the current state, process elements starting with firstElement,
while testBlock returns true, finally restore the state
-
setupInitialState
-
setup some initial state, such as margins, indents,
colors, fonts etc.
-
startImageDisplayProcess
-
handle two queues in the background; the first
contains images which are to be loaded (i.e. which are
contained in the current document) and have to be
rendered for the device.
The second contains those which are to be displayed.
The displayList is always served first.
-
syncPoint
-
save my state in a sync point
queries
-
anchorAt: aPoint
-
given a (click-) point, search for and return the corresponding
anchorElement. Return nil, if there is none
-
height
-
-
imageAt: aPoint
-
given a (click-) point, search for and return the corresponding
imageElement. Return nil, if there is none
-
positionOfAnchor: aLocalAnchor
-
-
width
-
style changes
-
currentStyle
-
-
defaultStyle
-
-
normalStyle
-
-
popStyle
-
-
pushStyle
-
-
setBGColor: aColor
-
-
setColor: aColor
-
-
setFont: aFont
-
-
setStyle: aStyle
-
widget-actions
-
buttonWidgetPressed: aWidgetElement
-
-
formResetted: aFormElement from: aWidgetElement
-
reset forms contents to their original values
-
formSubmitted: aFormElement from: aWidgetElement
-
-
mouseOverAnchor: anElement
-
widgets
-
createWidgetFor: element inForm: aForm
-
-
destroyWidgets
-
-
fixupForm: aForm
-
-
hideAllWidgets
-
hide any widget
-
hideWidgets
-
hide any widget which became invisible
-
prescanForm: aForm atIndex: startIndex
-
prescan a form, for its widgets max height.
a kludge - we need the form elements' heights BEFORE
formatting (since the text-elements have no origin knowledge,
which could be backpatched (also, we needed a way to break
MarkupText into multiple individual text items
-
showWidgets
-
show any widget which became visible
PainterState
TextStyle
WidgetQuery
|