DIRECTORY CD, CDInline, CDOrient; CDApplications: CEDAR DEFINITIONS IMPORTS CDInline, CDOrient = BEGIN HighPosO: PROC [aptr: CD.ApplicationPtr] RETURNS [CD.DesignPosition] = INLINE {RETURN [CDInline.AddSize[aptr.location, CDOrient.OrientedSize[aptr.ob.size, aptr.orientation]]]}; PointToO: PROC [pos: CD.DesignPosition, aptr: CD.ApplicationPtr] RETURNS [BOOLEAN] = INLINE {RETURN [ CDInline.OrderedIncreasing[aptr.location, pos] AND CDInline.OrderedIncreasing[pos, HighPosO[aptr]]]}; ARectO: PROC [aptr: CD.ApplicationPtr] RETURNS [CD.DesignRect] = INLINE {RETURN [CDOrient.RectAt[aptr.location, aptr.ob.size, aptr.orientation]]}; HighPosI: PROC [aptr: CD.ApplicationPtr] RETURNS [p: CD.DesignPosition] = INLINE {d: CD.DesignRect _ ARectI[aptr]; RETURN [CD.DesignPosition[d.x2, d.y2]]}; PointToI: PROC [pos: CD.DesignPosition, aptr: CD.ApplicationPtr] RETURNS [BOOLEAN] = INLINE {RETURN [aptr.ob.p.hitInside[aptr, CDInline.RectAt[pos, [0, 0]]]]}; ARectI: PROC [aptr: CD.ApplicationPtr] RETURNS [CD.DesignRect] = INLINE BEGIN RETURN [ CDOrient.MapRect[ itemInCell: aptr.ob.p.insideRect[aptr.ob], cellSize: aptr.ob.size, cellInstOrient: aptr.orientation, cellInstPos: aptr.location ] ] END; NewApplicationI: PROC [ob: CD.ObPtr, location: CD.DesignPosition_[0,0], orientation: CD.Orientation_0, selected: BOOLEAN _ FALSE, properties: CD.Properties_NIL] RETURNS [CD.ApplicationPtr]; Transform: PROC [aptr: CD.ApplicationPtr, cellRect: CD.DesignRect, transformation: CD.Orientation]; Translate: PROC [aptr: CD.ApplicationPtr, offset: CD.DesignPosition] = INLINE {aptr.location _ CDInline.AddPoints[aptr.location, offset]}; AplicationAt: PROC [al: CD.ApplicationList, pos: CD.DesignPosition, selectedOnly: BOOL_FALSE] RETURNS [CD.ApplicationPtr]; BoundingRect: PROC[list: CD.ApplicationList, selectedOnly: BOOLEAN_FALSE] RETURNS [CD.DesignRect]; TransformList: PROC[al: CD.ApplicationList, cellRect: CD.DesignRect, transformation: CD.Orientation]; TranslateList: PROC[al: CD.ApplicationList, offset: CD.DesignPosition]; DeSelectList: PROC [list: CD.ApplicationList]; AppendToList: PROC [app, to: CD.ApplicationList] RETURNS [CD.ApplicationList]; SplitPointed: PROC [from: CD.ApplicationList, pos: CD.DesignPosition] RETURNS [pointed, others: CD.ApplicationList]; SplitSelected: PROC [from: CD.ApplicationList] RETURNS [selected, others: CD.ApplicationList]; OnlySelected: PROC[al: CD.ApplicationList] RETURNS [selected: CD.ApplicationList]; CopyList: PROC[al: CD.ApplicationList] RETURNS [CD.ApplicationList]; ComposedCopy: PROC[al: CD.ApplicationList, cellPos, cellSize: CD.DesignPosition, cellOrient: CD.Orientation] RETURNS [CD.ApplicationList]; DeComposedCopy: PROC[al: CD.ApplicationList, cellPos, cellSize: CD.DesignPosition, cellOrient: CD.Orientation] RETURNS [CD.ApplicationList]; END. ìCDApplications.mesa (A Chipndale module) by Christian Jacobi May 12, 1983 12:22 pm last edited by Christian Jacobi November 21, 1983 3:22 pm --Procedures with vanilla stuff around applications --be carefull, ApplicationList's are lists of pointers, distinguish between: --procedures which modify the application list, from procedures which don't --procedures which modify the applications pointed to, from procedures which don't --procedures which modify an application list, from procedures which modify the applications --procedures around one application --returns "pos points to the application aptr" --returns "pos points to the application aptr", using its virtual coordinates --creates a new application, does neither draw nor include it into any world --modifies location such that ob...insideRect is at original location --performs "transformation" to "aptr"; the transformation occurs to the rect "cellRect". --"cellRect" and "aptr" in the same coordinate system --transformation group NOT abelsch --translates aptr^ by offset; aptr, offset in same coordinate system --procedures inspecting an application list --returns a reference to an application at location pos (or NIL if there is none) --uses inner area's --real coordinates --uses outer area's --procedures which modify the applications referenced by a list --composes the lists "app" and "to" --the original list "to" might be destroyed and must be replaced by the returned list --the original list "app" is not touched --procedures which handle the application list but don't modify the applications --copyes the pointed application references from "from" to "pointed" --finds maximal 1 pointed application --copyes the non-pointed application references from "from" to "others" --does not make copies of the real applications --copyes the selected application references from "from" to "selected" --copyes the non-selected application references from "from" to "others" --returns new lists but same applications --returns new list but same applications --procedures which create a new application list, with new applications --creates a new list with new applications --makes a copy of "al" with world coordinates assumed that "al" has cell coordinates --cellSize in cell coordinates, cellPos in world cordinates --the new list points to new applications --makes a copy of "al" with cell coordinates assumed al has world coordinates --cellSize in cell coordinates --cellPos, cellOrient in world coordinates --the new list points to new applications Ê4˜Jšœ+™+Jšœ,™,Jšœ;™;J˜Jšœ3™3J˜šÏk ˜ Jšœ˜Jšœ ˜ J˜ J˜—šÏnœœ œ˜"Jšœ˜—Jš˜J˜JšœL™LJšœK™KJšœR™RJšœ\™\J˜J˜Jšœ#™#J˜š žœœœœœ˜Fšœœ"˜0J˜9J˜——š žœœœœœœ˜TJšœ/™/šœœ˜Jšœ/˜2Jšœ2˜2J˜——š žœœœœœ˜@JšœœC˜QJ˜J˜—š žœœœœœ˜IJšœœœœ˜QJ˜—š žœœœœœœ˜TJšœM™MJšœœ<˜JJ˜—š žœœœœœ˜@Jšœ˜ šœ˜šœ˜Jšœ*˜*Jšœ˜Jšœ!˜!Jšœ˜J˜—J˜—Jšœ˜J˜—J˜šžœœœ˜%Jšœ œ$œ˜AJš œ œœœ œœœ˜WJšœL™LJšœE™EJ˜—J˜šž œœœ˜*Jšœ œœ˜9JšœX™XJšœ5™5Jšœ"™"J˜—šž œœœœ˜FJšœD™DJšœ=˜CJ˜J˜—Jšœ+™+J˜šž œœœœœœœœ˜zJšœQ™QJ™J˜—š ž œœœ œœ˜JJšœœ ˜Jšœ™J™J™J˜J˜—Jšœ?™?J˜šž œœœ˜,Jšœ œœ˜9J˜—Jšž œœœœ˜GJ˜Jšž œœœ˜.J˜š ž œœ œœœ˜NJšœ#™#JšœU™UJšœ)™)J˜—J™JšœP™PJ˜š ž œœœœœœ˜tJšœD™DJ™%JšœG™GJšœ/™/—J™š ž œœœœœ˜^JšœF™FJšœH™HJšœ)™)—J™š ž œœœœ œ˜RJšœ(™(J˜—JšœG™GJ˜š žœœœœœ˜DJšœ*™*J˜—šž œœœ˜+Jš œœœœœ˜_JšœT™TJšœ;™;Jšœ)™)J˜—šžœœœ˜-Jš œœœœœ˜_JšœM™MJšœ™Jšœ*™*Jšœ)™)J˜—Jšœ˜—…— 4