(* Copyright (C) 1992, Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* *) (* Last modified on Sun Dec 13 21:49:27 PST 1992 by mhb *) (* modified on Tue Oct 27 13:08:04 PST 1992 by steveg *) <* PRAGMA LL *> MODULE XTrestle; IMPORT Axis, ParseParams, Scan, StableVBT, Trestle, TrestleComm, TrestleImpl, VBT, VBTClass, XParam; PROCEDURE Install (v : VBT.T; applName : TEXT := NIL; inst : TEXT := NIL; windowTitle: TEXT := NIL; iconTitle : TEXT := NIL; bgColorR : REAL := -1.0; bgColorG : REAL := -1.0; bgColorB : REAL := -1.0; iconWindow : VBT.T := NIL ) RAISES {TrestleComm.Failure, Error} = VAR display : TEXT := NIL; geometry: TEXT := NIL; d : XParam.Display; g : XParam.Geometry; trsl : Trestle.T; BEGIN ParseParams.BeginParsing(); TRY IF ParseParams.KeywordPresent("-display") THEN display := ParseParams.GetNext(); d := XParam.ParseDisplay(display); END; IF ParseParams.KeywordPresent("-geometry") THEN geometry := ParseParams.GetNext(); g := XParam.ParseGeometry(geometry); IF g.size = XParam.Missing THEN WITH shapes = VBTClass.GetShapes(v, FALSE) DO g.size.h := shapes[Axis.T.Hor].pref; g.size.v := shapes[Axis.T.Ver].pref; END END END; EXCEPT Scan.BadFormat, XParam.Error => RAISE Error END; trsl := Trestle.Connect(display); TrestleImpl.SetDefault(trsl); Trestle.Attach(v, trsl); Trestle.Decorate(v, inst, windowTitle, iconTitle, bgColorR, bgColorG, bgColorB, applName, iconWindow); IF geometry = NIL THEN Trestle.MoveNear(v, NIL) ELSE StableVBT.SetShape(v, g.size.h, g.size.v); Trestle.Overlap( v, d.screen, XParam.Position(trsl, d.screen, g)) END; END Install; BEGIN END XTrestle.