(FILECREATED "16-Feb-85 02:49:40" {PHYLUM}<NOTECARDS>RELEASE1.2>FGHPATCH005.;8 14686 changes to: (FNS NC.InsertLinkInText NC.InsertLinkInTextWindow NC.PushCopyLinkIcon) previous date: "16-Feb-85 02:12:24" {PHYLUM}<NOTECARDS>RELEASE1.2>FGHPATCH005.;7) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT FGHPATCH005COMS) (RPAQQ FGHPATCH005COMS ((* * This stuff supports the "push-copy" method of copying links in NC) (* * Junk. Just sets up this stuff to work on top of old code) (FILES (FROM {PHYLUM}<NOTECARDS>RELEASE1.2>) FGHPATCH003) (FILES (FROM {PHYLUM}<NOTECARDS>RELEASE1.2>) FGHPATCH004) (* * New stuff to go in NCLINKS) (FNS NC.PushCopyLinkIcon) (* * New stuff to go in various card type/ substance type files) (FNS NC.TranslateWindowPositionToGraphPosition NC.TranslateWindowPositionToSketchPosition NC.TranslateWindowPositionToTEditPosition NC.InsertLinkInGraph NC.InsertLinkInTextWindow) (* * redefined stuff from NCLINKS) (FNS NC.LinkIconButtonEventInFn) (* * Redefined stuff to go in NCGRAPHSUBSTANCE) (FNS NC.GraphAddNodeFn NC.GraphCardLeftButtonFn) (* * Redefined stuff to go in NCTEXTSUBSTANCE) (FNS NC.InsertLinkInText) (* * Redefined stuff to go in NCSKETCHSUBSTANCE) (FNS NC.AddLinkToSketchCard NC.InsertLinkInSketch))) (* * This stuff supports the "push-copy" method of copying links in NC) (* * Junk. Just sets up this stuff to work on top of old code) (FILESLOAD (FROM {PHYLUM}<NOTECARDS>RELEASE1.2>) FGHPATCH003) (FILESLOAD (FROM {PHYLUM}<NOTECARDS>RELEASE1.2>) FGHPATCH004) (* * New stuff to go in NCLINKS) (DEFINEQ (NC.PushCopyLinkIcon (LAMBDA (LinkIcon Window) (* fgh: "16-Feb-85 02:46") (* * Do a push-copy of LinkIcon from Window) (PROG (ID NoteCardType InsertLinkFn TranslatePositionFn Link ScreenPosition NewWindow WindowPositionX WindowPositionY) (SETQ Link (NC.FetchLinkFromLinkIcon LinkIcon)) (SETQ ScreenPosition (GETPOSITION)) (SETQ NewWindow (WHICHW ScreenPosition)) (SETQ WindowPositionX (LASTMOUSEX NewWindow)) (SETQ WindowPositionY (LASTMOUSEY NewWindow)) (COND ((AND (WINDOWP NewWindow) (SETQ ID (NC.IDFromWindow NewWindow)) (SETQ NoteCardType (NC.FetchType ID)) (SETQ InsertLinkFn (NC.InsertLinkFn NoteCardType)) (SETQ TranslatePositionFn (NC.TranslateWindowPositionFn NoteCardType))) (SETQ Link (NC.MakeLink NewWindow (fetch (NOTECARDLINK LINKLABEL) of Link) (fetch (NOTECARDLINK DESTINATIONID) of Link) ID (fetch (NOTECARDLINK DISPLAYMODE) of Link) (fetch (NOTECARDLINK ANCHORMODE) of Link) NIL NIL)) (APPLY* InsertLinkFn NewWindow Link (APPLY* TranslatePositionFn NewWindow WindowPositionX WindowPositionY)))) (RETURN NIL)))) ) (* * New stuff to go in various card type/ substance type files) (DEFINEQ (NC.TranslateWindowPositionToGraphPosition (LAMBDA (Window WindowPositionX WindowPositionY) (* fgh: "15-Feb-85 22:01") (create POSITION XCOORD ← WindowPositionX YCOORD ← WindowPositionY))) (NC.TranslateWindowPositionToSketchPosition (LAMBDA (Window WindowPositionX WindowPositionY) (* fgh: "15-Feb-85 22:01") (create POSITION XCOORD ← WindowPositionX YCOORD ← WindowPositionY))) (NC.TranslateWindowPositionToTEditPosition (LAMBDA (Window WindowPositionX WindowPositionY) (* fgh: "15-Feb-85 19:42") (* * comment) (PROG (TextObj) (COND ((AND (WINDOWP Window) (type? TEXTOBJ (SETQ TextObj (WINDOWPROP Window (QUOTE TEXTOBJ))))) (RETURN (fetch (SELECTION CH#) of (TEDIT.SELECT WindowPositionX WindowPositionY TextObj (fetch (TEXTOBJ MOUSEREGION) of TextObj) NIL NIL Window)))))))) (NC.InsertLinkInGraph (LAMBDA (GraphWindow Link Position) (* fgh: "15-Feb-85 22:50") (* * Insert a Link in GraphWindow at Position) (PROG (Node (Graph (WINDOWPROP GraphWindow (QUOTE GRAPH)))) (WINDOWPROP GraphWindow (QUOTE NoteCardInsertingLink) Link) (OR (SETQ Node (GRAPHADDNODE Graph GraphWindow)) (RETURN)) (replace (GRAPHNODE NODEPOSITION) of Node with Position) (MEASUREGRAPHNODE Node) (PRINTDISPLAYNODE Node (CONSTANT (create POSITION XCOORD ← 0 YCOORD ← 0)) GraphWindow (DSPCLIPPINGREGION NIL GraphWindow)) (WINDOWPROP GraphWindow (QUOTE NoteCardInsertingLink) NIL)))) (NC.InsertLinkInTextWindow (LAMBDA (TextWindow Link CharacterPosition) (* fgh: "16-Feb-85 02:43") (* * Given a Window and a Link, insert the Link at CharacterPosition in the TextStream of Window) (PROG ((TextStream (WINDOWPROP TextWindow (QUOTE TEXTSTREAM)))) (RETURN (NC.InsertLinkInText TextStream Link NIL NIL NIL CharacterPosition))))) ) (* * redefined stuff from NCLINKS) (DEFINEQ (NC.LinkIconButtonEventInFn (LAMBDA (ImageObject WINDOW) (* fgh: "16-Feb-85 02:02") (* If the guy buttons inside a link image object) (PROG (ID ClippingRegion HotRegion LeftButtonFlg (Link (NC.FetchLinkFromLinkIcon ImageObject))) (SETQ WINDOW (COND ((WINDOWP WINDOW) WINDOW) ((DISPLAYSTREAMP WINDOW) (WFROMDS WINDOW)) ((TEXTSTREAMP WINDOW) (WINDOW.FROM.TEDIT.THING WINDOW)) (T NIL))) (SETQ LeftButtonFlg (MOUSESTATE LEFT)) (SETQ ClippingRegion (DSPCLIPPINGREGION NIL WINDOW)) (SETQ HotRegion (CREATEREGION (IPLUS (fetch (REGION LEFT) of ClippingRegion) (FTIMES .25 (fetch (REGION WIDTH) of ClippingRegion))) (fetch (REGION BOTTOM) of ClippingRegion) (FTIMES .5 (fetch (REGION WIDTH) of ClippingRegion)) (fetch (REGION HEIGHT) of ClippingRegion))) (until (OR (MOUSESTATE UP) (INSIDEP HotRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)))) (AND (MOUSESTATE UP) (RETURN NIL)) (RESETLST (RESETSAVE (INVERTW WINDOW)) (until (OR (MOUSESTATE UP) (NOT (INSIDEP HotRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)))))) (COND ((INSIDEP HotRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)) (RETURN (COND ((EQ NC.SelectionInProgress T) (* A selection is in progress. Don't really want to edit this object, want to select it. Just add to the selection collection list.) (AND (SETQ ID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards)))) ((KEYDOWNP (QUOTE LSHIFT)) (NC.PushCopyLinkIcon ImageObject WINDOW) (QUOTE DON'T)) ((EQ NC.SelectionInProgress (QUOTE Links)) (AND (NOT (MEMBER Link NC.SelectedCards)) (SETQ NC.SelectedCards (CONS Link NC.SelectedCards)))) (LeftButtonFlg (NC.EditNoteCard (fetch (NOTECARDLINK DESTINATIONID) of Link))) (T (NC.LinkIconMiddleButtonFn ImageObject WINDOW))))) ((INSIDEP ClippingRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)) (RETURN NIL)) (T (RETURN NIL)))))) ) (* * Redefined stuff to go in NCGRAPHSUBSTANCE) (DEFINEQ (NC.GraphAddNodeFn (LAMBDA (Graph Window) (* fgh: "15-Feb-85 22:40") (* * Add a node, normal or link, to a graph) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG (LinkLabel Link (GraphID (NC.IDFromWindow Window))) (RETURN (COND ((NULL (SETQ Link (WINDOWPROP Window (QUOTE NoteCardInsertingLink) NIL))) (NC.MarkCardDirty GraphID) (DEFAULT.ADDNODEFN Graph Window)) ((OR (type? NOTECARDLINK Link) (AND (SETQ LinkLabel (NC.AskLinkLabel Window NIL NIL T T)) (SETQ Link (NC.MakeLink Window LinkLabel)))) (NC.MarkCardDirty GraphID) (NODECREATE (for bind NodeID unless (FASSOC (SETQ NodeID (GENSYM)) (fetch (GRAPH GRAPHNODES) of Graph)) do (RETURN NodeID)) (NC.MakeLinkIcon Link) (CURSORPOSITION NIL Window)))))))) (NC.GraphCardLeftButtonFn (LAMBDA (GraphNode GraphWindow) (* fgh: "16-Feb-85 00:18") (* * If this is a node containing a link icon, then do: IF Selection in progress, then pressing a node gets its destination ID if its actually a note card node. Otherwise, bring up the note card pointed to by the node.) (PROG (ID (LinkIcon (fetch (GRAPHNODE NODELABEL) of GraphNode))) (AND (NC.LinkIconImageObjP LinkIcon) (COND (NC.SelectionInProgress (AND (SETQ ID (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchLinkFromLinkIcon LinkIcon))) (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards)))) ((KEYDOWNP (QUOTE LSHIFT)) (NC.PushCopyLinkIcon LinkIcon GraphWindow) (RETURN NIL)) (T (NC.EditNoteCard (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchLinkFromLinkIcon LinkIcon))))))))) ) (* * Redefined stuff to go in NCTEXTSUBSTANCE) (DEFINEQ (NC.InsertLinkInText (LAMBDA (TextStream LinkOrLinkLabel DestinationID SourceID DisplayMode CharacterPosition) (* fgh: "16-Feb-85 02:42") (* * Add a link image object (and hence a link) to the text specified by TextStream. Link has LinkLabel, goes to DestinationID and has DisplayMode. Returns the Link inserted.) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG ((Window (WINDOW.FROM.TEDIT.THING TextStream)) (TextObject (TEXTOBJ TextStream)) Selection Link) (RETURN (COND ((OR (AND (FIXP CharacterPosition) (ILEQ CharacterPosition (fetch (TEXTOBJ TEXTLEN) of TextObject))) (fetch (SELECTION SET) of (SETQ Selection (fetch (TEXTOBJ SEL) of TextObject) ))) (AND (SETQ Link (COND ((type? NOTECARDLINK LinkOrLinkLabel) LinkOrLinkLabel) (T (NC.MakeLink Window LinkOrLinkLabel DestinationID SourceID DisplayMode)))) (TEDIT.INSERT.OBJECT (NC.MakeLinkIcon Link) (TEXTSTREAM TextObject) (OR CharacterPosition (SELECTQ (fetch (SELECTION POINT) of Selection) (LEFT (fetch (SELECTION CH#) of Selection)) (RIGHT (IMIN (ADD1 (fetch (TEXTOBJ TEXTLEN) of TextObject)) (ADD1 (fetch (SELECTION CHLIM) of Selection)))) NIL)))) Link) (T (NC.ReportError "NC.InseretLinkInText" "No selection set when inserting link image object.") NIL)))))) ) (* * Redefined stuff to go in NCSKETCHSUBSTANCE) (DEFINEQ (NC.AddLinkToSketchCard (LAMBDA (SketchWindow) (* fgh: "15-Feb-85 22:15") (* Called from a SKETCH window to add a new NoteCard Link Icon to the sketch) (* * rht 11/9/84: Now checks result of NC.MakeLink before building link.) (PROG ((Label (NC.AskLinkLabel SketchWindow NIL NIL T T)) Link) (RETURN (AND Label (SETQ Link (NC.MakeLink SketchWindow Label NIL NIL NIL)) (NC.InsertLinkInSketch SketchWindow Link)))))) (NC.InsertLinkInSketch (LAMBDA (SketchWindow Link SketchWindowPosition) (* fgh: "16-Feb-85 01:58") (* * Insert an icon for Link into the sketch contained in SketchWindow) (PROG ((LinkIcon (NC.MakeLinkIcon Link)) (Scale (SKETCHW.SCALE SketchWindow)) SketchIcon Size Region Position) (SETQ Size (IMAGEBOXSIZE LinkIcon)) (SETQ Position (OR (POSITIONP SketchWindowPosition) (GETBOXPOSITION (fetch (IMAGEBOX XSIZE) of Size) (fetch (IMAGEBOX YSIZE) of Size) NIL NIL SketchWindow))) (SETQ Region (CREATEREGION (fetch (POSITION XCOORD) of Position) (fetch (POSITION YCOORD) of Position) (fetch (IMAGEBOX XSIZE) of Size) (fetch (IMAGEBOX YSIZE) of Size))) (SETQ SketchIcon (create GLOBALPART INDIVIDUALGLOBALPART ←(create SKIMAGEOBJ SKIMAGEOBJ ← LinkIcon SKIMOBJ.GLOBALREGION ←( UNSCALE.REGION.FROM.SKETCHW Region SketchWindow) SKIMOBJ.ORIGSCALE ← Scale SKIMOBJ.OFFSETPOS ←(create POSITION XCOORD ←(fetch (IMAGEBOX XKERN) of Size) YCOORD ←(fetch (IMAGEBOX YDESC) of Size))) COMMONGLOBALPART ←(create COMMONGLOBALPART MAXSCALE ←(ITIMES Scale MINIMUM.VISIBLE.SCALE.FACTOR) MINSCALE ←(QUOTIENT Scale DEFAULT.VISIBLE.SCALE.FACTOR)))) (SKETCH.ADD.AND.DISPLAY SketchIcon SketchWindow) (RETURN SketchIcon)))) ) (PUTPROPS FGHPATCH005 COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (1710 3128 (NC.PushCopyLinkIcon 1720 . 3126)) (3200 5468 ( NC.TranslateWindowPositionToGraphPosition 3210 . 3436) (NC.TranslateWindowPositionToSketchPosition 3438 . 3665) (NC.TranslateWindowPositionToTEditPosition 3667 . 4226) (NC.InsertLinkInGraph 4228 . 5049 ) (NC.InsertLinkInTextWindow 5051 . 5466)) (5510 8151 (NC.LinkIconButtonEventInFn 5520 . 8149)) (8206 10327 (NC.GraphAddNodeFn 8216 . 9281) (NC.GraphCardLeftButtonFn 9283 . 10325)) (10381 12190 ( NC.InsertLinkInText 10391 . 12188)) (12246 14604 (NC.AddLinkToSketchCard 12256 . 12868) ( NC.InsertLinkInSketch 12870 . 14602))))) STOP