"requires: stream." Graphics addSlot: #Presentation valued: Mixin derive. "Presentations are designed as a mixin which encodes a bit of 'type' and representation with formatting. Generally, this 'type' should correspond to the presenations' traits objects in the graphics libraries." Presentation addSlot: #object. "The object presented." Presentation addSlot: #criteria. "replaces presentation type in CLIM. instead, we use a testBlock." Presentation addSlot: #view. Presentation addSlot: #singleBox. "Boolean sensitivity" Presentation addSlot: #highlighting. "Boolean highlighting" Presentation addSlot: #keepsHistory. "Boolean for #history use." Presentation addSlot: #history. "traits slot only. TODO: enforce this?" "TODO: refactor keepsHistory into history isNil with overriding as needed." Presentation addSlot: #description. p@(Presentation traits) newTraitsFor: obj satisfying: testBlock "Creates a new presentation type which must both inherit from the given object and cause the test block to return True." [| newP | newP: p derive. newP criteria: testBlock. newP ]. p@(Presentation traits) newFor: obj "TODO: improve this weak substitute for defining a new presentation/type." [| newP | newP: Presentation clone. newP object: obj. newP ]. obj@(Root traits) presentAs: p@(Presentation traits) through: s@(Stream traits) on: v@(View traits) "Display the representation of obj on the view TODO: implement optional keyword forContext:." [ ]. p@(Presentation traits) present: obj@(Root traits) through: s@(Stream traits) on: v@(View traits) "An alternate syntax. The presentation is used as the desired type." [ ]. p@(Presentation traits) acceptThrough: s@(Stream traits) from: v@(View traits) "Return the object parsed from s, which might not be of type q. TODO: implement optional keywords default, default-type" [ ]. "NOTE: CLIM function describe maps to printOn:/printName." "TODO: find out what accept-present-default translates to." p@(Presentation traits) positionTest: x@(Point traits) in: r(SceneElement traits) "Definitively answers hit detection queries, ensuring x is within the output record, specialized for p." [ ]. p@(Presentation traits) highlightOn: s@(Stream traits) "Draw a highlight box on the output record in stream s." [ ]. p@(Presentation traits) unhighlightOn: s@(Stream traits) "Draw a highlight box on the output record in stream s." [ ]. "TODO: implement 23.4 below." "p@(Presentation traits) " "23.5" lobby addSlot: #InputContexts valued: Stack newEmpty. "Elements in CLIM of InputContexts are supposed to be a Presentation (type) tagged with indicating where in the control structure it was established. It is not strictly a stack, but the order reflects call order." "23.6..." "------------------------------------" "Some actual presentation types:" graphics addDelegate: #presentations valued: Namespace derive. presentations addSlot: #Expression valued: Presentation derive. presentations addSlot: #True valued: Presentation derive. presentations addSlot: #False valued: Presentation derive. presentations addSlot: #Nil valued: Presentation derive. presentations addSlot: #Command valued: Presentation derive. "TODO: refactor these into Presentation and presentation in the manner of the external iteration package."