DIRECTORY Imager USING [Color, Context, Font, VEC], ImagerFont USING [Extents], NodeStyle USING [Ref, RealParam], NodeStyleOps USING [OfStyle], TextNode USING [Location, Ref]; TEditFormatExtras: CEDAR DEFINITIONS ~ BEGIN CharacterArtwork: TYPE ~ REF CharacterArtworkRep; CharacterArtworkRep: TYPE ~ RECORD [ paint: PROC [CharacterArtwork, Imager.Context], extents: ImagerFont.Extents _ [0, 0, 0, 0], escapement: Imager.VEC _ [0, 0], amplified: BOOL _ FALSE, data: REF _ NIL ]; CharacterArtworkClass: TYPE ~ REF CharacterArtworkClassRep; CharacterArtworkClassRep: TYPE ~ RECORD [ name: ATOM, format: PROC [CharacterArtworkClass, TextNode.Location, NodeStyle.Ref, NodeStyleOps.OfStyle] RETURNS [CharacterArtwork], data: REF ]; RegisterCharacterArtwork: PROC [class: CharacterArtworkClass]; UnregisterCharacterArtwork: PROC [name: ATOM]; GetCharacterArtworkClass: PROC [ATOM] RETURNS [CharacterArtworkClass]; GetFont: PROC [style: NodeStyle.Ref] RETURNS [Imager.Font]; GetColor: PROC [style: NodeStyle.Ref, h: NodeStyle.RealParam _ textHue, s: NodeStyle.RealParam _ textSaturation, b: NodeStyle.RealParam _ textBrightness] RETURNS [color: Imager.Color]; ArtworkEnabled: PROC RETURNS [BOOL]; SetArtworkEnabled: PROC [enabled: BOOL] RETURNS [was: BOOL]; maxHyph: NAT ~ 16; HyphenationPosition: TYPE ~ [0..256) _ 0; HyphenationPositions: TYPE ~ PACKED ARRAY [0..maxHyph) OF HyphenationPosition; HyphProc: TYPE ~ PROC [node: TextNode.Ref, start, len: INT, hyphData: REF] RETURNS [HyphenationPositions]; RegisterHyphenation: PROC [hyphenationClass: ATOM, hyphProc: HyphProc, hyphData: REF] RETURNS [oldProc: HyphProc, oldData: REF]; END. dTEditFormatExtras.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Michael Plass, April 1, 1986 9:26:04 am PST Provides a means for inserting artwork that behaves like a single character. The character artwork mechanism is invoked when a character property is detected that has the $Artwork key with a value matching one of the registered character artwork classes. Also provides hooks for hyphenation routines. Character artwork Note: The style may change before paint is called, so the client should extract all needed style info during format call. Global Artwork Controls Controls a global Boolean that says whether or not artwork is formatted and displayed. Does not automatically refresh the screen. Hyphenation If the returned value is h, should have 0 < h[0] < h[1] < . . . < h[k-1] < len and either k = maxHyph or h[k] = 0, where k is the number of places at which it is possible to hyphenate the word. If h[j] = i is in the range (0..len), it means it's ok to hyphenate after the ith character of the word. The word is at Rope.Substr[node.rope, start, len]; the hyphenation routine may examine the context of the word in the rest of the rope. If node.hascharsets, use TextEdit.FetchChar or equivalent to fetch 16-bit character codes. Registers a HyphProc to be called; hyphenationClass identifies the language involved, as determined from style parameters. Any previously registered proc is returned (for layering, etc.) and forgotten by the registration mechanism. Note that registering a new hyphProc may invalidate line breaks on the screen; it's up to the client to refresh these viewers. Êž˜šœ™Icodešœ Ïmœ1™<™+K™—šœÿ™ÿK™—K™-K˜—šÏk ˜ Jšœžœžœ˜)Jšœ žœ ˜Jšœ žœ˜!Jšœ žœ ˜Jšœ žœ˜—K˜KšÐlnœžœž ˜$Kšœž˜head™Kšœžœžœ˜1šœžœžœ˜$Jšœžœ$˜/Jšœ+˜+Jšœžœ ˜ Jšœ ž œ˜Jšœžœž˜Jšœ˜K˜—Kšœžœžœ˜;šœžœžœ˜)Jšœžœ˜ šœžœQžœ˜xK™y—Jšœž˜ Jšœ˜K˜—šÏnœžœ ˜>K˜—š œžœžœ˜.K˜—Kš œžœžœžœ˜FK˜š œžœžœ˜;K˜—š œžœŒžœ˜¸K˜——™Kš œžœžœžœ˜$š  œžœ žœžœžœ˜