(* Copyright (C) 1992, Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* *) (* Last modified on Thu Dec 10 18:35:48 PST 1992 by msm *) <*PRAGMA LL*> MODULE JoinPixmap; IMPORT ScrnPixmap, JoinScreen, Pixmap, Palette, PlttFrnds, Rect, VBTRep; PROCEDURE New(st: JoinScreen.T): Oracle = BEGIN RETURN NEW(Oracle, st := st) END New; PROCEDURE Resolve (st: JoinScreen.T; pm: Pixmap.T) = VAR i: INTEGER; t := st.succ(NIL, i); BEGIN WHILE t # NIL DO EVAL Palette.ResolvePixmap(t, pm); t := st.succ(t, i) END END Resolve; PROCEDURE Apply ( st: JoinScreen.T; <*UNUSED*> cl: Palette.PixmapClosure; pm: Pixmap.T ): ScrnPixmap.T = VAR res := st.pixmaps[pm.pm]; BEGIN Resolve(st, pm); IF res = NIL OR res = PlttFrnds.noPixmap THEN res := NEW(T, id := 2 * pm.pm + 1, st := st) END; VAR i: INTEGER; t := st.succ(NIL, i); BEGIN IF t = NIL THEN res.depth := 1; res.bounds := Rect.Empty ELSE WITH tpm = Palette.ResolvePixmap(t, pm) DO res.depth := tpm.depth; res.bounds := tpm.bounds END END END; RETURN res END Apply; REVEAL Oracle = ScrnPixmap.Oracle BRANDED OBJECT st: JoinScreen.T; (* OVERRIDES load := Register; list := List; lookup := Lookup; builtIn := BuiltIn *) END; TYPE T = ScrnPixmap.T OBJECT st: JoinScreen.T; (* OVERRIDES localize := Localize; unload := Unload *) END; (* PROCEDURE PixmapRegister(orc: PixmapOracle; READONLY pm: ScrnPixmap.Raw; nm: TEXT := NIL): ScrnPixmap.T RAISES {TrestleComm.Failure} = BEGIN IF orc.st.sts = NIL THEN RAISE FatalError; END; RETURN orc.st.sts[0].pixmap.load(pm, nm); END PixmapRegister; PROCEDURE PixmapList(orc: PixmapOracle; pat: TEXT; maxResults: CARDINAL := 1) : REF ARRAY OF TEXT RAISES {TrestleComm.Failure} = BEGIN IF orc.st.sts = NIL THEN RAISE FatalError; END; RETURN orc.st.sts[0].pixmap.list(pat, maxResults); END PixmapList; PROCEDURE PixmapLookup(orc: PixmapOracle; name: TEXT) : ScrnPixmap.T RAISES {TrestleComm.Failure} = BEGIN IF orc.st.sts = NIL THEN RAISE FatalError; END; RETURN orc.st.sts[0].pixmap.lookup(name); END PixmapLookup; PROCEDURE PixmapBuiltIn(orc: PixmapOracle; pm: Pixmap.Predefined): ScrnPixmap.T = BEGIN IF orc.st.sts = NIL THEN RAISE FatalError; END; RETURN orc.st.sts[0].pixmap.builtIn(pm); END PixmapBuiltIn; *) BEGIN END JoinPixmap.