Comment: These are patches to produce the Andrew component of the X.V11R4 distribution, patch level 5 Andrew-Patch: 5 Date: Tue, 3 Apr 90 12:50:13 -0400 (EDT) Date-span: 90/2/27 15:03:33 through 90/4/3 12:12:08 Bugs addressed: Count of patched files: 86 RCS logs: Source file: config/andrew.rls Current version: 2.91 revision 2.91 date: 90/03/29 21:09:14; author: ghoti; state: Exp; lines added/del: 1/1 remove explicit reference to COMMON from helpalias invokation - it shouldn't be needed - and currently it breaks helpalias locally Source file: ams/flames/mailsvcs.flm Current version: 1.25 revision 1.25 date: 90/03/15 13:54:37; author: mcinerny; state: Exp; lines added/del: 3/0 fixed bug in the rootify procedure Source file: ams/libs/ms/mtchfold.c Current version: 1.8 revision 1.8 date: 90/03/28 13:42:41; author: gk5g; state: Exp; lines added/del: 6/9 Fix to continue after encountering unreadable mspath preferences. Source file: ams/libs/ms/bldpvmap.c Current version: 2.7 revision 2.7 date: 90/03/07 11:16:36; author: bobg; state: Exp; lines added/del: 5/3 Applied a patch from Nathaniel (1-Mar-90). Source file: ams/libs/ms/mswp.c Current version: 2.39 Source file: ams/libs/ms/rawfil.c Current version: 1.1 revision 1.1 date: 90/03/08 13:09:08; author: bobg; state: Exp; Initial revision Source file: ams/delivery/trymail/trymail.c Current version: 1.40 revision 1.40 date: 90/03/07 11:10:05; author: bobg; state: Exp; lines added/del: 51/10 Applied two patches from Craig (1-Mar-90 and 6-Mar-90). Source file: atk/apt/apt/aptv.c Current version: 1.19 Source file: atk/apt/suite/suite.c Current version: 1.29 revision 1.29 date: 90/03/05 12:14:49; author: gk5g; state: Exp; lines added/del: 23/15 Various small things. Added debug printouts. suite_Hit returns correct value (all the way down to an imbedded inset item). Source file: atk/apt/suite/suite.ch Current version: 1.19 revision 1.19 date: 90/03/05 12:16:23; author: gk5g; state: Exp; lines added/del: 8/2 Various small things. Added debug printouts. suite_Hit returns correct value (all the way down to an imbedded inset item). Source file: atk/apt/suite/suiteev.c Current version: 1.28 revision 1.28 date: 90/03/05 12:16:32; author: gk5g; state: Exp; lines added/del: 12/11 Various small things. Added debug printouts. suite_Hit returns correct value (all the way down to an imbedded inset item). Source file: atk/apt/suite/suiteta.c Current version: 1.14 revision 1.14 date: 90/03/05 11:57:51; author: gk5g; state: Exp; lines added/del: 11/0 Added argument declarations for long type to each of the hit handlers. Source file: atk/apt/tree/treev.c Current version: 1.28 revision 1.28 locked by: gk5g; date: 90/03/02 18:35:10; author: gk5g; state: Exp; lines added/del: 1/2 Removed bogus Initialize_Graphics from treev_DesiredSize. This caused a core-dump under wm because the window isn't there yet -- you can't do graphics ops like treev_BlackPattern when there's no window. ---------------------------- revision 1.27 date: 90/02/28 15:45:44; author: gk5g; state: Exp; lines added/del: 2/2 Made small change to DesiredSize so that org charts will take up the width of the window when inserted into ez. ---------------------------- revision 1.26 date: 90/02/27 15:40:10; author: gk5g; state: Exp; lines added/del: 12/6 Change to treev__FinalizeObject such that a ScrollView is freed correctly. I believe this core-leak was leading to core-dumps on the Sun4. Source file: atk/apt/tree/treev.ch Current version: 1.2 Source file: atk/atkvers/atkvers.num Current version: 1.36 revision 1.36 date: 90/03/26 12:02:18; author: susan; state: Exp; lines added/del: 1/1 Bump the global ATK Version number ---------------------------- revision 1.35 date: 90/03/13 15:27:04; author: susan; state: Exp; lines added/del: 1/1 Bump the global ATK Version number Source file: atk/basics/x/xgraphic.c Current version: 1.10 revision 1.10 date: 90/03/22 09:27:44; author: ajp; state: Exp; lines added/del: 17/3 Added a finalize object method to destory the GC's associated with the graphic object Source file: atk/basics/x/xgraphic.ch Current version: 1.4 revision 1.4 date: 90/03/22 09:28:29; author: ajp; state: Exp; lines added/del: 5/3 Added a finalize object method to destory the GC's associated with the graphic object Source file: atk/basics/common/dataobj.c Current version: 2.12 revision 2.12 date: 90/03/22 09:23:44; author: ajp; state: Exp; lines added/del: 4/6 Changed the code for creating a property object to be done only if a property is defined. The property object will still hand around when the dataobject is destroyed, since it was not at all clear how toi delete the objects added to the property list. This remains to be a core leak, but not serious since properties are not really used. Source file: atk/basics/common/menulist.c Current version: 2.8 revision 2.8 date: 90/03/22 09:25:48; author: ajp; state: Exp; lines added/del: 10/5 Fixed code for handling the reference count. It was not being decremented thus the actual menus lists were never being deleted. Source file: atk/basics/common/view.c Current version: 2.8 revision 2.8 date: 90/03/22 09:26:31; author: ajp; state: Exp; lines added/del: 8/6 Changed FinalizeObject routine to delete the underlying graphic attached to the view. Source file: atk/bush/bushv.c Current version: 1.45 revision 1.45 date: 90/03/27 14:08:09; author: gk5g; state: Exp; lines added/del: 13/8 Finally got a grip on how WantUpdate should be called by a parent for its child. Added some proctable entries so that users can bind key sequences to commonly used button actions (like Pop) in the .atkinit files. ---------------------------- revision 1.44 date: 90/03/05 11:19:00; author: gk5g; state: Exp; lines added/del: 286/234 Added "other" editor choice. Made lots of macro changes for simplicity in following the code. Follow soft links correctly now. Source file: atk/bush/bushv.ch Current version: 1.5 revision 1.5 date: 90/03/05 11:18:34; author: gk5g; state: Exp; lines added/del: 5/1 Follow soft links correctly now. Source file: atk/bush/bushapp.c Current version: 1.7 revision 1.7 date: 90/03/27 14:09:51; author: gk5g; state: Exp; lines added/del: 3/1 Made a call to frame_PostDefaultHandler in bushapp_Start after the framePtr was linked into the viewTree. Long standing ommission. Source file: atk/bush/bush.c Current version: 1.17 revision 1.17 date: 90/03/05 11:18:38; author: gk5g; state: Exp; lines added/del: 50/39 Follow soft links correctly now. Source file: atk/bush/bush.ch Current version: 1.6 revision 1.6 date: 90/03/05 11:18:11; author: gk5g; state: Exp; lines added/del: 6/1 Follow soft links correctly now. Source file: atk/bush/bush.h Current version: 1.3 revision 1.3 date: 90/03/14 15:29:29; author: gk5g; state: Exp; lines added/del: 8/1 macros for improved readability. Source file: atk/console/Imakefile Current version: 2.9 revision 2.9 date: 90/03/27 12:09:30; author: susan; state: Exp; lines added/del: 1/1 removed COMMON from mkdir target Source file: atk/ctext/ctextv.c Current version: 2.13 revision 2.13 date: 90/03/19 17:16:37; author: gk5g; state: Exp; lines added/del: 5/8 Made match_paren highlight the region whether the region is totally visible or not. Source file: atk/frame/frame.c Current version: 2.15 revision 2.15 date: 90/03/12 19:27:42; author: gk5g; state: Exp; lines added/del: 15/17 Added menu masks to the frame menus. Frame will post its Quit menu if no other higher-level view has. Changed frame_SetCommandEnable to simply change the menu mask enabling the whole set of frame/buffer menus. ---------------------------- revision 2.14 date: 90/03/09 10:03:17; author: tpn; state: Exp; lines added/del: 6/3 Added new macro-methods to frame frame_GetQuitWindowFlag() and frame_SetQuitWindowFlag(). If set to true, the quit menu option will only destroy the window, not kill the process, if there is more than one window (i.e. frame). The default can be set to true for all of a users windows with a 'QuitWindowOnly:yes' preference line, applications that override quit. are not affected, though they might want to check the same preference option. Also, the macros defined in frame have been changed to macro-methods. Source file: atk/frame/frame.ch Current version: 2.9 revision 2.9 date: 90/03/12 19:25:50; author: gk5g; state: Exp; lines added/del: 8/4 Added menu masks to the frame menus. Frame will post its Quit menu if no other higher-level view has. Changed frame_SetCommandEnable to simply change the menu mask enabling the whole set of frame/buffer menus. ---------------------------- revision 2.8 date: 90/03/09 10:12:39; author: tpn; state: Exp; lines added/del: 13/10 Added new macro-methods to frame frame_GetQuitWindowFlag() and frame_SetQuitWindowFlag(). If set to true, the quit menu option will only destroy the window, not kill the process, if there is more than one window (i.e. frame). The default can be set to true for all of a users windows with a 'QuitWindowOnly:yes' preference line, applications that override quit. are not affected, though they might want to check the same preference option. Also, the macros defined in frame have been changed to macro-methods. Source file: atk/frame/frame.doc Current version: 1.2 revision 1.2 date: 90/03/29 13:20:52; author: gk5g; state: Exp; lines added/del: 36/24 Just trying to clean it up and make it reflect reality. Source file: atk/frame/framecmd.c Current version: 2.37 revision 2.37 date: 90/03/23 15:35:33; author: gk5g; state: Exp; lines added/del: 9/5 Changed the order of the frame/im destruction in frame_Exit and frame_DeleteWindow. Made sure that the frame is unlinked from the viewTree before it's destroyed. ---------------------------- revision 2.36 date: 90/03/12 19:27:20; author: gk5g; state: Exp; lines added/del: 39/39 Added menu masks to the frame menus. Frame will post its Quit menu if no other higher-level view has. Changed frame_SetCommandEnable to simply change the menu mask enabling the whole set of frame/buffer menus. ---------------------------- revision 2.35 date: 90/03/09 10:12:20; author: tpn; state: Exp; lines added/del: 12/4 Added new macro-methods to frame frame_GetQuitWindowFlag() and frame_SetQuitWindowFlag(). If set to true, the quit menu option will only destroy the window, not kill the process, if there is more than one window (i.e. frame). The default can be set to true for all of a users windows with a 'QuitWindowOnly:yes' preference line, applications that override quit. are not affected, though they might want to check the same preference option. Also, the macros defined in frame have been changed to macro-methods. Source file: atk/frame/framemsg.c Current version: 1.8 revision 1.8 date: 90/04/02 14:16:53; author: tpn; state: Exp; lines added/del: 5/3 Fixed the bug that caused messages displayed during an AskForString call to be returned as input if no prompt string is displayed. This bug was most noticeable when a checkpoint occurred while entering data to the table object. Source file: atk/frame/framev.c Current version: 2.14 revision 2.14 date: 90/04/02 14:40:21; author: tpn; state: Exp; lines added/del: 7/7 Installed patch (from turner@ibm) to fix frameview__Complete so that it is no longer messed up if message_Display is called while it is asking for a completion. ---------------------------- revision 2.13 date: 90/02/27 16:17:01; author: gk5g; state: Exp; lines added/del: 10/3 Frame now overrides the Page menu card. Source file: atk/help/maint/mkindex.c Current version: 2.20 Source file: atk/lookz/lookzv.c Current version: 2.16 revision 2.16 date: 90/03/05 16:54:33; author: gk5g; state: Exp; lines added/del: 4/3 Added an entry for "up 2" to SubScrNames. Source file: atk/lset/celv.c Current version: 2.23 revision 2.23 date: 90/04/03 11:20:36; author: gk5g; state: Exp; lines added/del: 18/16 Changes to correctly deal with view_{Remove,MoveNoRedraw} fullupdate types. Source file: atk/lset/lsetv.c Current version: 2.8 revision 2.8 date: 90/03/23 17:16:21; author: tpn; state: Exp; lines added/del: 6/3 Will no longer call WantInputFocus on a newly created child, unless it currently has the input focus itself. Fixes the bug that newly create lset applications make a lot of unnecessary requests. Source file: atk/ness/objects/interp.c Current version: 1.29 revision 1.29 date: 90/03/22 11:08:27; author: wjh; state: Exp; lines added/del: 12/5 Fix "Disasterous Ness error" introduced by earlier fix of core leak. (nessmarks were being deleted as part of returning a nessmark value if another marker to the same text was in the variables of the function returning the value.) Source file: atk/ness/objects/nessv.c Current version: 1.15 revision 1.15 date: 90/03/27 17:14:53; author: gk5g; state: Exp; lines added/del: 27/6 Changed all calls to event_Enqueue to im_EnqueueEvent. The former did not increment im's eventCount and therefore some of these events were not processed correctly. Source file: atk/org/Imakefile Current version: 1.7 revision 1.7 date: 90/03/02 18:37:22; author: gk5g; state: Exp; lines added/del: 2/3 Removed references to orgapp. This application object is no longer used. Source file: atk/org/org.c Current version: 1.8 revision 1.8 date: 90/03/19 16:11:35; author: gk5g; state: Exp; lines added/del: 6/15 Org always writes in datastream format now. ---------------------------- revision 1.7 date: 90/03/02 18:39:51; author: gk5g; state: Exp; lines added/del: 9/33 Remove org__SetFileName and the instance variable used to store the filename. Org doesn't need to know what the filename is. The buffer package does this. Source file: atk/org/org.ch Current version: 1.4 revision 1.4 date: 90/03/02 18:38:02; author: gk5g; state: Exp; lines added/del: 1/7 Removed references to tree_file_name. There is no reason for org to keep around the filename. Source file: atk/org/orga.c Current version: 1.8 Source file: atk/org/orga.ch Current version: 1.2 Source file: atk/org/orgv.c Current version: 1.35 revision 1.35 date: 90/03/02 18:56:09; author: gk5g; state: Exp; lines added/del: 1/2 Forgot to remove #include . ---------------------------- revision 1.34 date: 90/03/02 18:40:57; author: gk5g; state: Exp; lines added/del: 71/309 Removed the menu items (and suite items) Print, Save, and Quit. These are not necessary (and, in fact, wrong) for org to have. Frame (and buffer) handle those operations. Removed the menu masks menu_application & menu_applicationlayer. Removed the methods orgv_{Get,Delete}ApplicationLayer because they did nothing. Removed the instance vars readonly, application, and org_app. These are no longer necessary. Source file: atk/org/orgv.ch Current version: 1.9 revision 1.9 date: 90/03/02 18:45:04; author: gk5g; state: Exp; lines added/del: 19/9 Removed the menu items (and suite items) Print, Save, and Quit. These are not necessary (and, in fact, wrong) for org to have. Frame (and buffer) handle those operations. Removed the menu masks menu_application & menu_applicationlayer. Removed the methods orgv_{Get,Delete}ApplicationLayer because they did nothing. Removed the instance vars readonly, application, and org_app. These are no longer necessary. Source file: atk/raster/cmd/rasterv.c Current version: 2.19 revision 2.19 date: 90/04/03 11:49:07; author: gk5g; state: Exp; lines added/del: 4/3 In ClipScroll, after calculating minLeft & minTop, if either is a positive value set it to zero (0). It will be positive when the visual dimensions are less than the arbitrary number of pixels that were chosen to keep the raster image on the screen. ---------------------------- revision 2.18 date: 90/04/02 15:47:08; author: gk5g; state: Exp; lines added/del: 35/36 Revised the way rasterv__FullUpdate deals with update types view_Remove & view_MoveNoRedraw. Also, check for a non-empty visual bounds (VB) in the FullUpdate. Added a new case (0) to rasterview__ObservedChanged. Every view should respond to a change value of zero by calling for an update (view_WantUpdate(self,self)), setting whatever flags they need to get a FullUpdate to occur. ---------------------------- revision 2.17 date: 90/03/30 16:24:35; author: gk5g; state: Exp; lines added/del: 6/8 Backed out previous "fix". Added checks for update types in RedrawRaster. Now retract the cursor when it's a view_Remove. Retract and re-post cursor when it's a view_MoveNoRedraw. After those update type checks, added check for empty visual rectangle for safety reasons. ---------------------------- revision 2.16 date: 90/03/29 18:28:40; author: gk5g; state: Exp; lines added/del: 14/3 Changed ClipScroll to set self->Xscroll and self->Yscroll to zero when it's an embedded raster. I, Gary Keim, do not understand what ClipScroll is supposed to be doing-- I just know that it's the wrong thing when it's embedded. ---------------------------- revision 2.15 date: 90/03/15 17:47:51; author: gk5g; state: Exp; lines added/del: 4/3 Added missing break statement in RasterIOCommand after Inxwd case. ---------------------------- revision 2.14 date: 90/03/15 12:40:16; author: gk5g; state: Exp; lines added/del: 60/6 Added support for X Window Dump format. Source file: atk/raster/convert/convras.help Current version: 1.3 revision 1.3 date: 90/03/15 12:38:08; author: gk5g; state: Exp; lines added/del: 25/12 Added support for X Window Dump format. Source file: atk/raster/convert/convrast.c Current version: 2.9 revision 2.9 date: 90/03/15 12:37:41; author: gk5g; state: Exp; lines added/del: 31/10 Added support for X Window Dump format. Source file: atk/raster/lib/Imakefile Current version: 2.6 revision 2.6 date: 90/03/15 12:42:30; author: gk5g; state: Exp; lines added/del: 6/3 Added support for X Window Dump format. Source file: atk/raster/lib/xwdio.c Current version: 1.2 revision 1.2 date: 90/03/27 10:53:08; author: gk5g; state: Exp; lines added/del: 2/3 Bug fix from Cattey for X Window Dump interface. ---------------------------- revision 1.1 date: 90/03/15 12:43:12; author: gk5g; state: Exp; Initial revision Source file: atk/raster/lib/xwdio.ch Current version: 1.1 revision 1.1 date: 90/03/15 12:43:40; author: gk5g; state: Exp; Initial revision Source file: atk/rofftext/hash.c Current version: 2.4 revision 2.4 date: 90/03/22 09:32:23; author: ajp; state: Exp; lines added/del: 29/3 Added Clear method that deletes all te elements in the hash table. Source file: atk/rofftext/hash.ch Current version: 2.5 revision 2.5 date: 90/03/22 09:32:48; author: ajp; state: Exp; lines added/del: 4/3 Added Clear method that deletes all te elements in the hash table. Source file: atk/rofftext/roffchrs.c Current version: 2.5 revision 2.5 date: 90/03/22 09:34:00; author: ajp; state: Exp; lines added/del: 4/4 Changed Mangle macro to do a StrDup so that we can properly free the appropriate hash table. Source file: atk/rofftext/roffcmds.c Current version: 2.8 revision 2.8 date: 90/03/22 11:23:40; author: ajp; state: Exp; lines added/del: 16/4 Fixed several core leaks. Source file: atk/rofftext/rofftext.c Current version: 2.16 revision 2.16 date: 90/03/22 09:33:27; author: ajp; state: Exp; lines added/del: 105/10 Plugged lots of core leaks. Basically rofftext was not freeing anything Source file: atk/support/buffer.c Current version: 2.20 revision 2.20 locked by: gk5g; date: 90/03/07 11:37:41; author: gk5g; state: Exp; lines added/del: 5/2 Added comment explaining where to define USESHORTFILENAMES. ---------------------------- revision 2.19 date: 90/03/07 11:30:50; author: gk5g; state: Exp; lines added/del: 31/3 Applied fix from Charles Hayden for buffer_WriteToFile. It conditionally (USESHORTFILENAMES) truncates the temporary .NEW filename such that it is unique when the fileserver is a SYSV machine. ---------------------------- revision 2.18 date: 90/02/28 12:58:27; author: ajp; state: Exp; lines added/del: 12/9 Fixed code to use buffer names when checkpointing to a checkpoint directory This solves the problems with name collisions when editting two files of the same name. ---------------------------- revision 2.17 date: 90/02/28 10:14:09; author: ajp; state: Exp; lines added/del: 41/16 Added code for directing checkpoint files into a separate directory. This is useful when dealing with remote files over a slow network connection. Source file: atk/supportviews/matte.c Current version: 2.9 revision 2.9 date: 90/04/03 11:19:14; author: gk5g; state: Exp; lines added/del: 14/10 Changes to correctly deal with view_{Remove,MoveNoRedraw} fullupdate types. Source file: atk/supportviews/scroll.c Current version: 2.13 revision 2.13 date: 90/04/03 11:19:55; author: gk5g; state: Exp; lines added/del: 33/31 Changes to correctly deal with view_{Remove,MoveNoRedraw} fullupdate types. Source file: atk/table/print.c Current version: 1.5 revision 1.5 date: 90/03/01 13:12:13; author: tpn; state: Exp; lines added/del: 7/5 Fixed printing bug in table that caused extra blank line in the output. Source file: atk/text/drawtxtv.c Current version: 2.22 revision 2.22 date: 90/04/03 11:37:50; author: gk5g; state: Exp; lines added/del: 28/22 Changed textview__ViewMove to correctly deal with a new internal movement code, textview_MOVEVIEW. This code implies that a BitBlt has occured on an inset. ---------------------------- revision 2.21 date: 90/03/08 13:45:00; author: tpn; state: Exp; lines added/del: 8/8 changed to allow machines to display high order bit font characters. Source file: atk/text/textv.c Current version: 2.18 revision 2.18 date: 90/04/03 11:35:54; author: gk5g; state: Exp; lines added/del: 30/14 Correctly handle view_{Remove,MoveNoRedraw} fullupdate types in textview__FullUpdate. ---------------------------- revision 2.17 date: 90/03/22 09:21:49; author: ajp; state: Exp; lines added/del: 37/12 Plugged a bunch of core leaks The lines structure was not being deleted Marks were not being deleted Menulists were not being deleted Source file: atk/text/txttroff.c Current version: 2.26 revision 2.26 date: 90/03/29 15:11:52; author: tpn; state: Exp; lines added/del: 22/6 Put in $ifdef to aid site w/ broken 3812 printer. Also added extra test to see if space quoting is needed. ---------------------------- revision 2.25 date: 90/03/15 12:09:50; author: tpn; state: Exp; lines added/del: 1/1 Changed so that font changes (\f commands) are preceeded with a \&, so that spaces are treated properly. ---------------------------- revision 2.24 date: 90/03/15 10:07:48; author: tpn; state: Exp; lines added/del: 22/12 Fixed two bugs. The code now forces a newline following Format Note text. The code will now throw away unnecessary newlines before page-break objects. (The latter caused some spacing bugs). Source file: atk/text/txtvcmds.c Current version: 2.40 revision 2.40 date: 90/03/28 19:56:27; author: gk5g; state: Exp; lines added/del: 3/3 Real fix for query-replace bug. Only increment the pos by one after user types 'n' at prompt to replace. ---------------------------- revision 2.39 date: 90/03/28 19:20:55; author: gk5g; state: Exp; lines added/del: 7/8 Backed-out "fix" for query-replaced that could cause infinite-loops if the replacement string contained the target string. Source file: atk/text/tpls/foils.tpl Current version: 1.2 revision 1.2 date: 90/03/26 11:09:59; author: gk5g; state: Exp; lines added/del: 16/16 The foils template from jhh via maria. ---------------------------- revision 1.1 date: 90/03/14 12:20:04; author: gk5g; state: Exp; Initial revision Source file: atk/textobjects/panel.c Current version: 1.5 revision 1.5 date: 90/03/06 11:23:36; author: gk5g; state: Exp; lines added/del: 2/1 Moved the call to SetupHighlight(self,entry) after the check for a valid entry pointer in panel_MakeSelection. Source file: atk/textobjects/panel.doc Current version: 1.4 revision 1.4 date: 90/03/08 12:13:04; author: gk5g; state: Exp; lines added/del: 77/83 Incorporated Ayami's changes. ---------------------------- revision 1.3 date: 90/03/07 17:35:57; author: gk5g; state: Exp; lines added/del: 322/6 Updated this programmer's document. Previously it only contained the method stubs. Source file: atk/value/getrecv.c Current version: 2.6 revision 2.6 date: 90/03/16 14:41:26; author: tpn; state: Exp; lines added/del: 8/4 fixed bug where getrecv would dump core if a new one was created, stored , and reread with a non-null value. Source file: atkams/messages/lib/messages.c Current version: 2.32 revision 2.32 date: 90/03/19 15:15:08; author: gk5g; state: Exp; lines added/del: 4/3 Added super_ObservedChanged to beginning of messages_ObservedChanged. ---------------------------- revision 2.31 date: 90/03/19 12:48:41; author: gk5g; state: Exp; lines added/del: 14/10 Fix for bogus messages_ObservedChanged method that was causing core-dumps when any inset was in a message body. ---------------------------- revision 2.30 date: 90/03/12 19:24:27; author: gk5g; state: Exp; lines added/del: 32/4 Changes that allow the Folder Tree to be Quit from without exitting the whole process. Now uses frame_SetQuitWindowFlag. ---------------------------- revision 2.29 date: 90/03/08 13:48:20; author: gk5g; state: Exp; lines added/del: 30/22 Backed out the last change having to do with the Folder Tree. ---------------------------- revision 2.28 date: 90/03/02 15:39:45; author: gk5g; state: Exp; lines added/del: 23/31 Changed BS_ShowTreePlease to fork the FolderTree window. This fixes the problem with quitting the org window also quitting the messages process. Source file: atkams/messages/lib/messages.ch Current version: 2.8 revision 2.8 date: 90/03/19 12:49:43; author: gk5g; state: Exp; lines added/del: 3/2 Fix for bogus messages_ObservedChanged; added instance variable folderFrame to use to test for proper parent frame of the folderTree when Quitting Folder Tree window. ---------------------------- revision 2.7 date: 90/03/12 19:20:49; author: gk5g; state: Exp; lines added/del: 5/3 Changes that allow the Folder Tree to be Quit from without exitting the whole process. Now uses frame_SetQuitWindowFlag. Source file: contrib/hyplink/linkv.c Current version: 1.9 revision 1.9 date: 90/03/27 12:42:21; author: gk5g; state: Exp; lines added/del: 3/5 Fixed FindViewofBuffer to PostDefaultHandler after the frame has been linked into the viewTree. This was causing the message_ routines to return before posting their messages. Source file: contrib/tm/tm.c Current version: 2.17 revision 2.17 date: 90/02/28 11:59:59; author: tpn; state: Exp; lines added/del: 5/5 A statement to start up termulator with the read args has been removed , as it represented a major security hole. Source file: overhead/class/cmd/doindex.c Current version: 1.11 revision 1.11 date: 90/03/15 09:13:18; author: tpn; state: Exp; lines added/del: 21/11 If flock() failed, the code used to wait regardless of the type of error. Now it only waits if errno == EWOULDBLOCK. Other errors print a warning message, and are then ignored. ---------------------------- revision 1.10 date: 90/03/08 13:36:54; author: tpn; state: Exp; lines added/del: 63/64 Now uses osi_ExclusiveLockNoBlock (i.e flock) instead of creating a lock file. Thus it will no longer hang if a previous doindex process died without removing the lock file. Also made more efficient, the index file will only be read and written once, regardless of the number of .do files being indexed. Source file: overhead/cmenu/cmcreate.c Current version: 2.8 revision 2.8 date: 90/02/28 13:09:11; author: ajp; state: Exp; lines added/del: 17/3 Changes to handle hysteresis in the menus. Users can set a percentage of the card that they want to be able to point to before system flips to the previous card. Source file: overhead/cmenu/cmdraw.c Current version: 2.7 revision 2.7 date: 90/02/28 13:09:25; author: ajp; state: Exp; lines added/del: 30/16 Changes to handle hysteresis in the menus. Users can set a percentage of the card that they want to be able to point to before system flips to the previous card. Source file: overhead/cmenu/cmenu.help Current version: 1.3 revision 1.3 date: 90/02/28 17:51:45; author: ajp; state: Exp; lines added/del: 15/2 Added description of OverlapPct cmenu Xdefault. Source file: overhead/cmenu/cmintern.h Current version: 2.5 revision 2.5 date: 90/02/28 13:07:26; author: ajp; state: Exp; lines added/del: 3/2 Changes to handle hysteresis in the menus. Users can set a percentage of the card that they want to be able to point to before system flips to the previous card. Source file: overhead/eli/bglisp/bglisp.c Current version: 2.5 Source file: overhead/eli/hdrs/eli.h Current version: 2.13 revision 2.13 date: 90/03/06 15:07:55; author: bobg; state: Exp; lines added/del: 2/2 Bumped minor version number to reflect major improvement in memory management. Source file: overhead/eli/hdrs/etypes.h Current version: 2.6 Source file: overhead/eli/lib/eerror.c Current version: 2.7 revision 2.7 date: 90/03/27 16:42:06; author: bobg; state: Exp; lines added/del: 8/4 1. Fixed a couple of constructs that most compilers can handle, but not IBM-RT pcc. 2. Fixed bug engendered by earlier massive-memory-savings patch which was causing ELI to enter an infinite loop in error conditions. Source file: overhead/eli/lib/eval.c Current version: 2.10 revision 2.10 date: 90/03/27 16:46:53; author: bobg; state: Exp; lines added/del: 12/9 1. Fixed a couple of constructs that most compilers can handle, but not IBM-RT pcc. 2. Fixed bug engendered by earlier massive-memory-savings patch which was causing ELI to enter an infinite loop in error conditions. ---------------------------- revision 2.9 date: 90/03/14 09:07:51; author: bobg; state: Exp; lines added/del: 5/5 Another case where NIL had to be made more equivalent to (). ---------------------------- revision 2.8 date: 90/03/06 15:08:25; author: bobg; state: Exp; lines added/del: 106/88 Major improvement in memory management. Now no call to eliEval *ever* causes a net growth in the trace stack! Source file: overhead/eli/lib/prims2.c Current version: 1.2 revision 1.2 date: 90/03/13 15:46:05; author: bobg; state: Exp; lines added/del: 6/3 Fixed "sym-to-str", so that (sym-to-str '()) returns "NIL" (instead of core-dumping on a SPARC!). Source file: overhead/util/lib/prefs.help Current version: 1.5 revision 1.5 date: 90/02/28 17:52:53; author: ajp; state: Exp; lines added/del: 13/4 Added the description of the CheckpointDirectory option. *** patchlevel.h Mon Mar 12 13:14:49 1990 --- patchlevel.h.NEW Tue Apr 3 11:28:57 1990 *************** *** 1 **** ! This is the Andrew component of the X.V11R4 distribution, patch level 4 --- 1 ---- ! This is the Andrew component of the X.V11R4 distribution, patch level 5 No differences encountered *** config/andrew.rls Fri Feb 2 12:23:37 1990 --- config/andrew.rls.NEW Tue Apr 3 11:12:30 1990 *************** *** 39,45 **** install.alias:: doc do.alias @@\ @sh -c 'if [ -f ,help.alias ]; then \ @@\ $(ADDALIASES) ,help.alias \ @@\ ! $(COMMON)/$(DESTDIR)/help/help.aliases;\ @@\ fi; \ @@\ exit 0' @@\ @@\ --- 39,45 ---- install.alias:: doc do.alias @@\ @sh -c 'if [ -f ,help.alias ]; then \ @@\ $(ADDALIASES) ,help.alias \ @@\ ! $(DESTDIR)/help/help.aliases;\ @@\ fi; \ @@\ exit 0' @@\ @@\ *** ams/flames/mailsvcs.flm Wed Nov 22 11:30:22 1989 --- ams/flames/mailsvcs.flm.NEW Tue Mar 20 20:08:55 1990 *************** *** 497,502 **** --- 497,505 ---- (strcat rootname "/" fname)) ((not (equal (substring pname 0 1) "/")) ;relative path (strcat rootname "/" pname "/" fname)) + ((or (> (strlen rootname) (strlen f)) + (equal (strlen rootname) (strlen f))) + rootname) (t ;need to strip off rootname (and put back) (strcat rootname "/" ;cheesy method (substring f (+ (strlen rootname) 1) *** ams/libs/ms/mtchfold.c Wed Nov 22 11:33:26 1989 --- ams/libs/ms/mtchfold.c.NEW Tue Apr 3 11:13:21 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/libs/ms/RCS/mtchfold.c,v 1.7 89/06/01 13:54:08 nsb Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/libs/ms/RCS/mtchfold.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/libs/ms/RCS/mtchfold.c,v 1.7 89/06/01 13:54:08 nsb Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/mtchfold.c,v 1.8 90/03/28 13:42:41 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/mtchfold.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/mtchfold.c,v 1.8 90/03/28 13:42:41 gk5g Exp $ "; #endif /* lint */ #include *************** *** 67,78 **** patlen = strlen(pat); for (i=0; i #include --- 3,10 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/bldpvmap.c,v 2.7 90/03/07 11:16:36 bobg Exp $ ! $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/bldpvmap.c,v $ */ #include #include *************** *** 82,88 **** status = AMS_UNSUBSCRIBED; } else { oldsubsindex = subsindex; ! while (PreorderSubscriptionStrcmp(SubsInPathOrder[subsindex]->key, name) < 0 && subsindex < NumSubsInUse && SubsInPathOrder[subsindex]->pathelt == pathindex) { debug(16, ("Skipping over my subs entry %s\n", SubsInPathOrder[subsindex]->key)); if (SubsInPathOrder[subsindex]->status != AMS_UNSUBSCRIBED) { /* This check is necessary because the subscription entry might refer to a no-longer-existent folder */ --- 82,90 ---- status = AMS_UNSUBSCRIBED; } else { oldsubsindex = subsindex; ! while ((subsindex < NumSubsInUse) ! && (PreorderSubscriptionStrcmp(SubsInPathOrder[subsindex]->key, name) < 0) ! && (SubsInPathOrder[subsindex]->pathelt == pathindex)) { debug(16, ("Skipping over my subs entry %s\n", SubsInPathOrder[subsindex]->key)); if (SubsInPathOrder[subsindex]->status != AMS_UNSUBSCRIBED) { /* This check is necessary because the subscription entry might refer to a no-longer-existent folder */ *** ams/libs/ms/mswp.c Wed Nov 22 11:34:10 1989 --- ams/libs/ms/mswp.c.NEW Tue Mar 20 20:15:07 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/libs/ms/RCS/mswp.c,v 2.39 89/11/07 12:49:40 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/libs/ms/RCS/mswp.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/ams/libs/ms/RCS/mswp.c,v 2.39 89/11/07 12:49:40 cfe Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/mswp.c,v 2.39 89/11/07 12:49:40 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/mswp.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/mswp.c,v 2.39 89/11/07 12:49:40 cfe Exp $ "; #endif /* lint */ #include *** ams/libs/ms/rawfil.c Mon Mar 12 13:15:21 1990 --- ams/libs/ms/rawfil.c.NEW Tue Mar 20 20:16:10 1990 *************** *** 3,10 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/andrew/ams/libs/ms/RCS/rawfil.c,v 1.1 90/03/08 13:09:08 bobg Exp $ ! $Source: /afs/andrew.cmu.edu/itc/src/andrew/ams/libs/ms/RCS/rawfil.c,v $ */ #include #include --- 3,10 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/rawfil.c,v 1.1 90/03/08 13:09:08 bobg Exp $ ! $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/rawfil.c,v $ */ #include #include *** ams/delivery/trymail/trymail.c Fri Jan 12 13:40:46 1990 --- ams/delivery/trymail/trymail.c.NEW Tue Mar 20 20:27:58 1990 *************** *** 8,14 **** to client workstations for possible short-circuit evaluation. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/ams/delivery/trymail/RCS/trymail.c,v 1.39 89/12/21 16:05:45 cfe Exp $"; #include /*VARARGS1*/ --- 8,14 ---- to client workstations for possible short-circuit evaluation. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/delivery/trymail/RCS/trymail.c,v 1.40 90/03/07 11:10:05 bobg Exp $"; #include /*VARARGS1*/ *************** *** 462,467 **** --- 462,485 ---- return TRUE; } + static int MemberP(Addr, AList) + PARSED_ADDRESS *Addr, *AList; + { + FOR_ALL_ADDRESSES(Trial, AList, { + switch (Trial->Kind) { + case SIMPLE_ADDRESS: + if (Addr == Trial) return TRUE; + break; + case GROUP_ADDRESS: + if (MemberP(Addr, Trial->Members)) return TRUE; + break; + default: + break; + } + }) + return FALSE; + } + static PARSED_ADDRESS *NewNullAddr() { PARSED_ADDRESS *AL; *************** *** 497,502 **** --- 515,536 ---- AddrList->Prev = Addr; } + static void SafeAppendAddrTo(Addr, AddrList, Fwd) + PARSED_ADDRESS *Addr, *AddrList; + struct FwdLink *Fwd; + { + struct FwdLink *FDum; + + for (FDum = Fwd; FDum != NULL; FDum = FDum->Parent) { + if (MemberP(Addr, FDum->RmtFwded)) return; + } + if ( + ! MemberP(Addr, RemoteDelivered) && + ! MemberP(Addr, LocalDelivered) && + ! MemberP(Addr, AddrList) + ) AppendAddrTo(Addr, AddrList); + } + static int IsSameLocalPart(Addr, OtherLocal) PARSED_ADDRESS *Addr; char *OtherLocal; {/* Return TRUE iff the local-part of address Addr and the local-part OtherLocal, interpreted as local mailboxes in the same domain, map to the same delivery-system mailbox. */ *************** *** 1921,1927 **** } Argv[++Argc] = "-T"; /* don't generate massive PM messages on full disks */ Argv[++Argc] = "-a"; /* following is an address, even if starts with hyphen */ ! Argv[++Argc] = Addr->LocalPart; Argv[++Argc] = NULL; if (TMDebug) { fprintf(stderr, "Sending mail to list with command: %s", Argv[0]); --- 1955,1967 ---- } Argv[++Argc] = "-T"; /* don't generate massive PM messages on full disks */ Argv[++Argc] = "-a"; /* following is an address, even if starts with hyphen */ ! MsgDst = malloc(strlen(Addr->LocalPart) + strlen(Dom) + 2); ! if (MsgDst == NULL) { ! free(NewRetPathText); free(MsgHdr); unlink(fnBuff); free(FunkyDest); ! return AddrResult(tmltf_MemoryExhausted, Addr, "No memory left for dest"); ! } ! sprintf(MsgDst, "%s@%s", Addr->LocalPart, Dom); ! Argv[++Argc] = MsgDst; Argv[++Argc] = NULL; if (TMDebug) { fprintf(stderr, "Sending mail to list with command: %s", Argv[0]); *************** *** 1932,1938 **** queuem = topen(Argv[0], Argv, "w", &PGrp); if (queuem == NULL) { ThisErrno = errno; ! free(NewRetPathText); free(MsgHdr); unlink(fnBuff); free(FunkyDest); return AddrResult(tmltf_MailerExecFailure, Addr, "queuemail: %s", UnixError(ThisErrno)); } --- 1972,1978 ---- queuem = topen(Argv[0], Argv, "w", &PGrp); if (queuem == NULL) { ThisErrno = errno; ! free(NewRetPathText); free(MsgHdr); unlink(fnBuff); free(FunkyDest); free(MsgDst); return AddrResult(tmltf_MailerExecFailure, Addr, "queuemail: %s", UnixError(ThisErrno)); } *************** *** 1939,1948 **** C = tclose(queuem, 10*60, &TimedOut); /* ten minute timeout on mail dropoff */ if (TimedOut) { killpg(PGrp, SIGKILL); ! free(NewRetPathText); free(MsgHdr); unlink(fnBuff); free(FunkyDest); return AddrResult(tmltf_MailerSystemFailure, Addr, "queuemail timed out"); } free(NewRetPathText); unlink(fnBuff); if (C == 0) { ThisWasSent(MsgHdr, FunkyDest, ForString, 1); --- 1979,1989 ---- C = tclose(queuem, 10*60, &TimedOut); /* ten minute timeout on mail dropoff */ if (TimedOut) { killpg(PGrp, SIGKILL); ! free(NewRetPathText); free(MsgHdr); unlink(fnBuff); free(FunkyDest); free(MsgDst); return AddrResult(tmltf_MailerSystemFailure, Addr, "queuemail timed out"); } free(NewRetPathText); + free(MsgDst); unlink(fnBuff); if (C == 0) { ThisWasSent(MsgHdr, FunkyDest, ForString, 1); *************** *** 2277,2283 **** Scuttling = FALSE; for (FDum = Fwd; FDum != NULL; FDum = FDum->Parent) { if (! IsItOnList(FDum->fAddr, LocalDelivered, TRUE)) { ! if (FDum->Rewritten) AppendAddrTo(FDum->fAddr, LocalDelivered); if (TMDebug) fprintf(stderr, "Doing loop delivery to %s@%s, for %s.\n", FDum->fAddr->LocalPart, FDum->fAddr->Hosts->Prev->Name, ForString); --- 2318,2324 ---- Scuttling = FALSE; for (FDum = Fwd; FDum != NULL; FDum = FDum->Parent) { if (! IsItOnList(FDum->fAddr, LocalDelivered, TRUE)) { ! if (FDum->Rewritten) SafeAppendAddrTo(FDum->fAddr, LocalDelivered, Fwd); if (TMDebug) fprintf(stderr, "Doing loop delivery to %s@%s, for %s.\n", FDum->fAddr->LocalPart, FDum->fAddr->Hosts->Prev->Name, ForString); *************** *** 2585,2591 **** if (! IsItOnList(Addr, LocalDelivered, FALSE)) { if (TMDebug) fprintf(stderr, "Adding loc %s to delvr'd list.\n", Addr->LocalPart); ! AppendAddrTo(Addr, LocalDelivered); } return TRUE; } --- 2626,2632 ---- if (! IsItOnList(Addr, LocalDelivered, FALSE)) { if (TMDebug) fprintf(stderr, "Adding loc %s to delvr'd list.\n", Addr->LocalPart); ! SafeAppendAddrTo(Addr, LocalDelivered, Fwd); } return TRUE; } *************** *** 2758,2764 **** return; } HandleFileList(Addr, laPrime, ForString, Fwd, NULL, DefaultDomain); /* no local mailbox ever */ ! if (! IsItOnList(Addr, LocalDelivered, TRUE) && (Fwd == NULL ? TRUE : Fwd->Rewritten)) AppendAddrTo(Addr, LocalDelivered); free(laPrime); if (Hdr != NULL) free(Hdr); return; --- 2799,2805 ---- return; } HandleFileList(Addr, laPrime, ForString, Fwd, NULL, DefaultDomain); /* no local mailbox ever */ ! if (! IsItOnList(Addr, LocalDelivered, TRUE) && (Fwd == NULL ? TRUE : Fwd->Rewritten)) SafeAppendAddrTo(Addr, LocalDelivered, Fwd); free(laPrime); if (Hdr != NULL) free(Hdr); return; *************** *** 2796,2802 **** } /* it's always a local mailbox */ WriteLocalMail(Addr, Hdr, NULL, laPrime, ForString, 0, Fwd, DefaultDomain, MBName); ! if (! IsItOnList(Addr, LocalDelivered, TRUE) && (Fwd == NULL ? TRUE : Fwd->Rewritten)) AppendAddrTo(Addr, LocalDelivered); free(laPrime); if (Hdr != NULL) free(Hdr); return; --- 2837,2843 ---- } /* it's always a local mailbox */ WriteLocalMail(Addr, Hdr, NULL, laPrime, ForString, 0, Fwd, DefaultDomain, MBName); ! if (! IsItOnList(Addr, LocalDelivered, TRUE) && (Fwd == NULL ? TRUE : Fwd->Rewritten)) SafeAppendAddrTo(Addr, LocalDelivered, Fwd); free(laPrime); if (Hdr != NULL) free(Hdr); return; *************** *** 2822,2828 **** return; } HandleFSMembers(Addr, laPrime, ForString, Fwd, NULL, DefaultDomain); /* no local mailbox ever */ ! if (! IsItOnList(Addr, LocalDelivered, TRUE) && (Fwd == NULL ? TRUE : Fwd->Rewritten)) AppendAddrTo(Addr, LocalDelivered); free(laPrime); if (Hdr != NULL) free(Hdr); return; --- 2863,2869 ---- return; } HandleFSMembers(Addr, laPrime, ForString, Fwd, NULL, DefaultDomain); /* no local mailbox ever */ ! if (! IsItOnList(Addr, LocalDelivered, TRUE) && (Fwd == NULL ? TRUE : Fwd->Rewritten)) SafeAppendAddrTo(Addr, LocalDelivered, Fwd); free(laPrime); if (Hdr != NULL) free(Hdr); return; *************** *** 3214,3220 **** if (TMDebug) fprintf(stderr, "HandleRcpt calling LocalMail on %s.\n", Addr->LocalPart); ReturnResult = LocalMail(Addr, Hdr, WName, MBox, Fwd, KVal, DefaultDomain, MBName); if (TMDebug) fprintf(stderr, "HandleRcpt returning after local mailing.\n"); ! if (! IsItOnList(Addr, LocalDelivered, TRUE)) if ((Fwd == NULL ? TRUE : Fwd->Rewritten)) AppendAddrTo(Addr, LocalDelivered); if (KVal != NULL) free(KVal); if (WName != NULL) free(WName); if (MBox != NULL) free(MBox); --- 3255,3261 ---- if (TMDebug) fprintf(stderr, "HandleRcpt calling LocalMail on %s.\n", Addr->LocalPart); ReturnResult = LocalMail(Addr, Hdr, WName, MBox, Fwd, KVal, DefaultDomain, MBName); if (TMDebug) fprintf(stderr, "HandleRcpt returning after local mailing.\n"); ! if (! IsItOnList(Addr, LocalDelivered, TRUE)) if ((Fwd == NULL ? TRUE : Fwd->Rewritten)) SafeAppendAddrTo(Addr, LocalDelivered, Fwd); if (KVal != NULL) free(KVal); if (WName != NULL) free(WName); if (MBox != NULL) free(MBox); *** atk/apt/apt/aptv.c Wed Nov 22 11:44:51 1989 --- atk/apt/apt/aptv.c.NEW Tue Mar 20 20:30:51 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsidaptv = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/apt/apt/RCS/aptv.c,v 1.19 89/11/01 15:58:53 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsidaptv = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/apt/apt/RCS/aptv.c,v 1.19 89/11/01 15:58:53 gk5g Exp Locker: gk5g $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *** atk/apt/suite/suite.c Wed Jan 17 16:36:35 1990 --- atk/apt/suite/suite.c.NEW Tue Apr 3 11:14:49 1990 *************** *** 7,13 **** /* $Source $ */ #ifndef lint ! static char *rcsidsuite_c = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/apt/suite/RCS/suite.c,v 1.28 89/12/12 14:57:54 ghoti Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 7,13 ---- /* $Source $ */ #ifndef lint ! static char *rcsidsuite_c = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/apt/suite/RCS/suite.c,v 1.29 90/03/05 12:14:49 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 502,509 **** if(Items && item) { if(Active(item) && Exposed(item)) { item->mode &= ~item_Active; ! if (IsLinked) ! suite_HideItem(self,item); } vector_RemoveItem(Items,item); FinalizeItem(item); --- 502,508 ---- if(Items && item) { if(Active(item) && Exposed(item)) { item->mode &= ~item_Active; ! if(IsLinked) suite_HideItem(self,item); } vector_RemoveItem(Items,item); FinalizeItem(item); *************** *** 737,744 **** Cursor = cursor_Create(self); if(Cursor && CursorFont && (CursorByte != 0)) cursor_SetGlyph(Cursor,CursorFont,CursorByte); ! else if(CursorByte) cursor_SetStandard(Cursor,CursorByte); ! else cursor_SetStandard(Cursor,Cursor_Octagon); } RealCaptionFontSize = (List?CaptionFontSize:MAX(CaptionFontSize,CaptionFontHigh)); CaptionFont = fontdesc_Create(CaptionFontName,CaptionFontType,RealCaptionFontSize); --- 736,745 ---- Cursor = cursor_Create(self); if(Cursor && CursorFont && (CursorByte != 0)) cursor_SetGlyph(Cursor,CursorFont,CursorByte); ! else if(CursorByte && (CursorByte != suite_NoCursor)) ! cursor_SetStandard(Cursor,CursorByte); ! else if(CursorByte != suite_NoCursor) ! cursor_SetStandard(Cursor,Cursor_Octagon); } RealCaptionFontSize = (List?CaptionFontSize:MAX(CaptionFontSize,CaptionFontHigh)); CaptionFont = fontdesc_Create(CaptionFontName,CaptionFontType,RealCaptionFontSize); *************** *** 745,754 **** RealTitleFontSize = MAX(TitleFontSize,TitleFontHigh); TitleFont = fontdesc_Create(TitleFontName,RealTitleFontType,RealTitleFontSize); SetMWidths(self); ! if (Scroll) ! scroll_LinkTree(Scroll, self); ! else ! suiteev_LinkTree(SetView, self); needs_scroll = Arrange(self,arrange_rect); SetMWidths(self); DrawOutline(self,&Container,BorderSize,BorderStyle); --- 746,753 ---- RealTitleFontSize = MAX(TitleFontSize,TitleFontHigh); TitleFont = fontdesc_Create(TitleFontName,RealTitleFontType,RealTitleFontSize); SetMWidths(self); ! if(Scroll) scroll_LinkTree(Scroll,self); ! else suiteev_LinkTree(SetView,self); needs_scroll = Arrange(self,arrange_rect); SetMWidths(self); DrawOutline(self,&Container,BorderSize,BorderStyle); *************** *** 783,789 **** suiteev_InsertView(SetView,self,&Container); suiteev_FullUpdate(SetView,view_FullRedraw,0,0,ContainerWidth,ContainerHeight); } ! if(Cursor) suite_PostCursor(self,curse_rect,Cursor); if(curse_rect) free(curse_rect); OUT(suite_FullUpdate); } --- 782,789 ---- suiteev_InsertView(SetView,self,&Container); suiteev_FullUpdate(SetView,view_FullRedraw,0,0,ContainerWidth,ContainerHeight); } ! if(Cursor && (CursorByte != suite_NoCursor)) ! suite_PostCursor(self,curse_rect,Cursor); if(curse_rect) free(curse_rect); OUT(suite_FullUpdate); } *************** *** 950,965 **** register enum view_MouseAction action; register long x, y, numberOfClicks; { IN(suite_Hit); if(Scroll) { if(WithinRect(x,y,&ScrollRect)) ! return(scroll_Hit(Scroll,action,x - ScrollRect.left, ! y - ScrollRect.top,numberOfClicks)); } else { if(Within(x - ContainerLeft,y - ContainerTop,0,0, ContainerWidth,ContainerHeight)) ! suiteev_Hit(SetView,action,x - ContainerLeft,y - ContainerTop, numberOfClicks); } if(WithinRect(x,y,&TitleRect)) { --- 950,967 ---- register enum view_MouseAction action; register long x, y, numberOfClicks; { + struct view *retval = (struct view*)self; + IN(suite_Hit); if(Scroll) { if(WithinRect(x,y,&ScrollRect)) ! retval = scroll_Hit(Scroll,action,x - ScrollRect.left, ! y - ScrollRect.top,numberOfClicks); } else { if(Within(x - ContainerLeft,y - ContainerTop,0,0, ContainerWidth,ContainerHeight)) ! retval = suiteev_Hit(SetView,action,x - ContainerLeft,y - ContainerTop, numberOfClicks); } if(WithinRect(x,y,&TitleRect)) { *************** *** 970,978 **** HitHandler(ClientAnchor,self,NULL,suite_TitleObject, action,x,y,numberOfClicks); else if(TitleViewObject) ! view_Hit(TitleViewObject,action,x,y,numberOfClicks); } ! return((struct view*)self); } long --- 972,980 ---- HitHandler(ClientAnchor,self,NULL,suite_TitleObject, action,x,y,numberOfClicks); else if(TitleViewObject) ! retval = view_Hit(TitleViewObject,action,x,y,numberOfClicks); } ! return((struct view*)retval); } long *************** *** 1059,1064 **** --- 1061,1067 ---- register int i = 0, count = 0; register struct suite_item *item = NULL; + IN(suite_ClearAllItems); if(Items && ITEM(0)) { count = vector_Count(Items); for( i = 0 ; i < count ; i++ ){ *************** *** 1070,1075 **** --- 1073,1079 ---- Items = NULL; } NewFirstVisible = FirstVisible = LastVisible = NULL; + OUT(suite_ClearAllItems); } static long *************** *** 1301,1306 **** --- 1305,1311 ---- FinalizeItem( item ) register struct suite_item *item; { + IN(FinalizeItem); if(Breaks(item)) vector_Destroy(Breaks(item)); if(item->caption) free(item->caption); if(item->title) free(item->title); *************** *** 1318,1323 **** --- 1323,1329 ---- gk5g 5/1/89 ===*/ free(item); + OUT(FinalizeItem); } static void *************** *** 1570,1575 **** --- 1576,1582 ---- char Name[100]; long int Size, Type; + IN(SetSuiteAttribute); switch(attribute) { case suite_titlecaption: AllocNameSpace(&TitleCaption,strip((char*)value)); *************** *** 1793,1798 **** --- 1800,1806 ---- break; default: fprintf( stderr, "Suite: Unknown Suite Attribute (%d)\n",attribute); } + OUT(SetSuiteAttribute); } long *** atk/apt/suite/suite.ch Wed Nov 22 11:45:16 1989 --- atk/apt/suite/suite.ch.NEW Tue Apr 3 11:14:54 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsidsuite_ch = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/apt/suite/RCS/suite.ch,v 1.18 89/11/02 18:57:47 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsidsuite_ch = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/apt/suite/RCS/suite.ch,v 1.19 90/03/05 12:16:23 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 138,144 **** macromethods: CurrentItem() (self->current_item) ! ItemCount() (vector_Count(Items)) ItemAnchor(item) (item->anchor) ItemDataObject(item) (item->dataobject) ItemViewObject(item) (item->viewobject) --- 138,144 ---- macromethods: CurrentItem() (self->current_item) ! ItemCount() (vector_Count(self->items)) ItemAnchor(item) (item->anchor) ItemDataObject(item) (item->dataobject) ItemViewObject(item) (item->viewobject) *************** *** 146,151 **** --- 146,155 ---- SetExceptionHandler(handler)(self->exception_handler) ExceptionCode() (self->exception_status) ExceptionItem() (self->exception_item) + FirstVisible() (self->firstvisible) + LastVisible() (self->lastvisible) + SetFirstVisible(item) ((self)->firstvisible = item) + SetLastVisible(item) ((self)->lastvisible = item) data: *************** *** 315,320 **** --- 319,326 ---- #define suite_Immediate (1<<5) #define suite_Defer (1<<6) #define suite_Expose (1<<7) + + #define suite_NoCursor (200) /*** Exception Codes ***/ #define suite_NonExistentItem (1) *** atk/apt/suite/suiteev.c Wed Nov 22 11:45:35 1989 --- atk/apt/suite/suiteev.c.NEW Tue Mar 20 20:31:20 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsidsuiteev_c = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/apt/suite/RCS/suiteev.c,v 1.27 89/11/06 12:06:42 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsidsuiteev_c = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/apt/suite/RCS/suiteev.c,v 1.28 90/03/05 12:16:32 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 481,487 **** vector_Item(Breaks(item),i) = 0; BreakCount(item) = 0; } - else printf("item is NULL\n"); return(status); } --- 481,486 ---- *************** *** 522,528 **** { IN(ygetinfo); total->beg = 0; ! total->end = suiteev_NumberExposed(self); if(Items && ITEM(0) && FirstVisible) seen->beg = vector_Subscript(Items,FirstVisible); else seen->beg = 0; --- 521,527 ---- { IN(ygetinfo); total->beg = 0; ! total->end = suiteev_NumberExposed(self) - 1; if(Items && ITEM(0) && FirstVisible) seen->beg = vector_Subscript(Items,FirstVisible); else seen->beg = 0; *************** *** 627,634 **** if(coord) { /* Right Click */ if(ColumnLine) width += 3; horizOffset = suiteev_GetLogicalWidth(self)*coord/outof; ! if(ColumnMajor) numToSkip = ((horizOffset/width)*VisibleRows)-1; ! else if(RowMajor) numToSkip = horizOffset/width-1; NewFirstVisible = NthPrior(self,FirstVisible,numToSkip); if(!NewFirstVisible) NewFirstVisible = ITEM(0); } --- 626,633 ---- if(coord) { /* Right Click */ if(ColumnLine) width += 3; horizOffset = suiteev_GetLogicalWidth(self)*coord/outof; ! if(ColumnMajor) numToSkip = ((horizOffset/width)*VisibleRows); ! else if(RowMajor) numToSkip = horizOffset/width; NewFirstVisible = NthPrior(self,FirstVisible,numToSkip); if(!NewFirstVisible) NewFirstVisible = ITEM(0); } *************** *** 965,974 **** if(List && (minWidth > width)) { if(width > (TwiceBorderSize+(2*CaptionMWidth)+XGutterOffset)) { suiteev_ShrinkWrap(self, width - TwiceBorderSize - ! (2*CaptionMWidth) - XGutterOffset, height); suiteev_MaxStringSize(self,&itemWidth,&itemHeight); minHeight = itemHeight + TwiceBorderSize + 2 + YGutterOffset; ! minWidth = itemWidth + TwiceBorderSize + (2 * CaptionMWidth) + XGutterOffset; } } if(!Scroll) { --- 964,973 ---- if(List && (minWidth > width)) { if(width > (TwiceBorderSize+(2*CaptionMWidth)+XGutterOffset)) { suiteev_ShrinkWrap(self, width - TwiceBorderSize - ! CaptionMWidth - XGutterOffset, height); suiteev_MaxStringSize(self,&itemWidth,&itemHeight); minHeight = itemHeight + TwiceBorderSize + 2 + YGutterOffset; ! minWidth = itemWidth + TwiceBorderSize + CaptionMWidth + XGutterOffset; } } if(!Scroll) { *************** *** 1049,1055 **** } else { if(ItemFixedWidth) { ! itemWidth = ItemFixedWidth; if(Scroll) NumVisible = width/minWidth; else NumVisible = numItems; } --- 1048,1054 ---- } else { if(ItemFixedWidth) { ! minWidth = itemWidth = ItemFixedWidth; if(Scroll) NumVisible = width/minWidth; else NumVisible = numItems; } *************** *** 1474,1479 **** --- 1473,1480 ---- register enum view_MouseAction action; register long x, y, numClicks; { + struct view *retval = (struct view*)self; + IN(suiteev_ItemHit); if(item && Active(item)) { if(!CVIF || (item->viewobject && (item->viewobject == CVIF))) { *************** *** 1487,1493 **** action,0,0,numClicks)); } else if(item->viewobject) ! view_Hit(item->viewobject,action,x - InsetLeft, y - InsetTop,numClicks); if(item->hithandler) item->hithandler(ClientAnchor,Suite,item,suite_ItemObject, --- 1488,1494 ---- action,0,0,numClicks)); } else if(item->viewobject) ! retval = view_Hit(item->viewobject,action,x - InsetLeft, y - InsetTop,numClicks); if(item->hithandler) item->hithandler(ClientAnchor,Suite,item,suite_ItemObject, *************** *** 1495,1501 **** } } OUT(suiteev_ItemHit); ! return((struct view*)self); } static void --- 1496,1502 ---- } } OUT(suiteev_ItemHit); ! return((struct view*)retval); } static void *************** *** 1701,1707 **** MaxListSubStringWidth(self,item,item_Caption, item_CaptionFont,&totalWidth); if(item_Title) totalWidth += TitleRect.width; ! if(totalWidth > Width) { suiteev_Update(self); return; } --- 1702,1708 ---- MaxListSubStringWidth(self,item,item_Caption, item_CaptionFont,&totalWidth); if(item_Title) totalWidth += TitleRect.width; ! if((totalWidth > Width) && (Width > (4 * CaptionMWidth))) { suiteev_Update(self); return; } *** atk/apt/suite/suiteta.c Wed Nov 22 11:45:13 1989 --- atk/apt/suite/suiteta.c.NEW Tue Mar 20 20:31:24 1990 *************** *** 562,567 **** --- 562,568 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 578,583 **** --- 579,585 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 594,599 **** --- 596,602 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 622,627 **** --- 625,631 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 641,646 **** --- 645,651 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 660,665 **** --- 665,671 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 672,677 **** --- 678,684 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 687,692 **** --- 694,700 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *************** *** 702,707 **** --- 710,716 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; { static char words[]= "Hello. I am a Text Inset; just tickle me to make yourself a believer. I am not showing myself with a Scrollbar, for I feel that would impinge upon your view of this textual material. Further, I am seen only as plain text, because that is all I was born with (if my creator had elected to read me from a file, or do the necessary text-operations, I could have Bold, and all the formatted styles.)"; printf( "Text Handler" ); *************** *** 717,722 **** --- 726,732 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; { printf( "TextView_Object_Handler Item %d\n", suite_ItemAttribute( suite, item, suite_ItemData(0) ) ); *************** *** 730,735 **** --- 740,746 ---- struct suitetapp *self; struct suite *suite; struct suite_item *item; + long type; enum view_MouseAction action; long x, y, clicks; { *** atk/apt/tree/treev.c Mon Mar 12 13:15:26 1990 --- atk/apt/tree/treev.c.NEW Tue Mar 20 20:31:44 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/apt/tree/RCS/treev.c,v 1.25 90/02/20 16:17:19 gk5g Exp Locker: gk5g $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/apt/tree/RCS/treev.c,v 1.28 90/03/02 18:35:10 gk5g Exp Locker: gk5g $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 368,377 **** IN(treev_FinalizeObject ); if ( self->instance ) { ! if ( ScrolledView ) ! Destroy_Shadows( ScrolledView, RootNode ); ! else Destroy_Shadows( self, RootNode ); if ( NodeFontName ) free( NodeFontName ); if ( TitleFontName ) free( TitleFontName ); if ( TreeCursorFontName ) free( TreeCursorFontName ); --- 368,383 ---- IN(treev_FinalizeObject ); if ( self->instance ) { ! if ( ScrolledView ) { ! tree_Destroy( ShadowTree ); ! scroll_Destroy( ScrollView ); ! ScrollView = NULL; ! treev_Destroy( ScrolledView ); ! } ! else{ Destroy_Shadows( self, RootNode ); + tree_Destroy( ShadowTree ); + } if ( NodeFontName ) free( NodeFontName ); if ( TitleFontName ) free( TitleFontName ); if ( TreeCursorFontName ) free( TreeCursorFontName ); *************** *** 709,716 **** { DEBUGdt(Given Width,given_width); DEBUGdt(Given Height,given_height); DEBUGdt(Pass, pass); ! Initialize_Graphics( self ); ! *desired_width = DesiredWidth; *desired_height = DesiredHeight; DEBUGdt(Desired Width,*desired_width); DEBUGdt(Desired Height,*desired_height); DEBUGxt(Result-code,result); --- 715,721 ---- { DEBUGdt(Given Width,given_width); DEBUGdt(Given Height,given_height); DEBUGdt(Pass, pass); ! *desired_width = ((DesiredWidth > given_width) ? DesiredWidth : given_width); *desired_height = DesiredHeight; DEBUGdt(Desired Width,*desired_width); DEBUGdt(Desired Height,*desired_height); DEBUGxt(Result-code,result); *************** *** 2845,2851 **** level = tree_NodeLevel( ShadowTree, shadow_node ); next = NodeShadowNode(ChildNode(node)); while ( next ) ! { DEBUGst(Node Name,NodeName(ShadowedNode(ShadowNodeDatum(next)))); if ( ShadowNodeDatum(next) ) free( ShadowNodeDatum(next) ); if ( (next = NextShadowNode(next)) && --- 2850,2856 ---- level = tree_NodeLevel( ShadowTree, shadow_node ); next = NodeShadowNode(ChildNode(node)); while ( next ) ! {DEBUGst(Node Name,NodeName(ShadowedNode(ShadowNodeDatum(next)))); if ( ShadowNodeDatum(next) ) free( ShadowNodeDatum(next) ); if ( (next = NextShadowNode(next)) && *************** *** 2865,2871 **** register struct tree_node *node; IN(Dump_Trees); ! if ( !debug ) return; tree_SetDebug( Tree, 0 ); printf("\nNodes"); node = RootNode; --- 2870,2876 ---- register struct tree_node *node; IN(Dump_Trees); ! if ( !debug ) return; tree_SetDebug( Tree, 0 ); printf("\nNodes"); node = RootNode; *** atk/apt/tree/treev.ch Wed Nov 22 11:46:12 1989 --- atk/apt/tree/treev.ch.NEW Tue Apr 3 11:15:01 1990 *************** *** 4,10 **** \* ********************************************************************** */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtree_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/apt/tree/RCS/treev.ch,v 1.2 89/08/24 16:41:51 tom Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtree_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/apt/tree/RCS/treev.ch,v 1.2 89/08/24 16:41:51 tom Exp Locker: gk5g $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *** atk/atkvers/atkvers.num Mon Mar 12 13:15:29 1990 --- atk/atkvers/atkvers.num.NEW Mon Mar 26 12:06:04 1990 *************** *** 1 **** ! 14.4 --- 1 ---- ! 14.6 *** atk/basics/x/xgraphic.c Mon Mar 12 13:15:34 1990 --- atk/basics/x/xgraphic.c.NEW Mon Mar 26 12:06:17 1990 *************** *** 2,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/x/RCS/xgraphic.c,v 1.9 90/02/03 12:37:27 ajp Exp $ */ /* $ACIS:graphic.c 1.11$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/x/RCS/xgraphic.c,v $ */ #ifndef LINT ! char xgraphic_rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/x/RCS/xgraphic.c,v 1.9 90/02/03 12:37:27 ajp Exp $"; #endif /* LINT */ /* graphic.c --- 2,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/x/RCS/xgraphic.c,v 1.10 90/03/22 09:27:44 ajp Exp $ */ /* $ACIS:graphic.c 1.11$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/x/RCS/xgraphic.c,v $ */ #ifndef LINT ! char xgraphic_rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/x/RCS/xgraphic.c,v 1.10 90/03/22 09:27:44 ajp Exp $"; #endif /* LINT */ /* graphic.c *************** *** 1704,1706 **** --- 1704,1720 ---- return TRUE; } + + void xgraphic__FinalizeObject(classID, self) + struct classheader *classID; + struct xgraphic *self; + { + if (self->localGraphicContext != NULL) { + XFreeGC(self->displayUsed, self->localGraphicContext); + } + if (self->localFillGraphicContext != NULL) { + XFreeGC(self->displayUsed, self->localFillGraphicContext); + } + } + + *** atk/basics/x/xgraphic.ch Wed Nov 22 11:47:24 1989 --- atk/basics/x/xgraphic.ch.NEW Mon Mar 26 12:06:20 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/basics/x/RCS/xgraphic.ch,v 1.3 89/02/17 18:22:47 ghoti Exp $ */ /* $ACIS:graphic.ch 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/basics/x/RCS/xgraphic.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidxgraphic_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/basics/x/RCS/xgraphic.ch,v 1.3 89/02/17 18:22:47 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/x/RCS/xgraphic.ch,v 1.4 90/03/22 09:28:29 ajp Exp $ */ /* $ACIS:graphic.ch 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/x/RCS/xgraphic.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidxgraphic_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/x/RCS/xgraphic.ch,v 1.4 90/03/22 09:28:29 ajp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *************** *** 93,98 **** --- 93,100 ---- XFillGC() ((self)->localFillGraphicContext) classprocedures: SetUpdateRegion(Region Rgn,Display* whichDisplay, Drawable whichWindow); + FinalizeObject(struct xgraphic *self); + InitializeObject(struct xgraphic *self) returns boolean; data: struct xgraphic ** gray_shades; /* Current set of gray pixmaps */ GC localGraphicContext; /* Context for the pixmap */ *** atk/basics/common/dataobj.c Mon Mar 12 13:15:38 1990 --- atk/basics/common/dataobj.c.NEW Mon Mar 26 12:09:15 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/common/RCS/dataobj.c,v 2.11 90/02/22 12:56:17 gk5g Exp $ */ /* $ACIS:dataobj.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/common/RCS/dataobj.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/common/RCS/dataobj.c,v 2.11 90/02/22 12:56:17 gk5g Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/dataobj.c,v 2.12 90/03/22 09:23:44 ajp Exp $ */ /* $ACIS:dataobj.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/dataobj.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/dataobj.c,v 2.12 90/03/22 09:23:44 ajp Exp $"; #endif /* lint */ #include *************** *** 220,228 **** the specified type is NULL. If type is not NULL, but *type is, then we fill in the actual type. */ ! if (self->properties == NULL) ! self->properties = namespace_New(); ! if (namespace_Boundp(self->properties, property, &prop) && (type == NULL || *type == NULL || *type == prop->type)) { if (value != NULL) --- 220,226 ---- the specified type is NULL. If type is not NULL, but *type is, then we fill in the actual type. */ ! if (self->properties != NULL && namespace_Boundp(self->properties, property, &prop) && (type == NULL || *type == NULL || *type == prop->type)) { if (value != NULL) *** atk/basics/common/menulist.c Wed Jan 17 16:37:05 1990 --- atk/basics/common/menulist.c.NEW Mon Mar 26 12:09:18 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/common/RCS/menulist.c,v 2.7 89/12/12 14:59:19 ghoti Exp $ */ /* $ACIS:menulist.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/common/RCS/menulist.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/basics/common/RCS/menulist.c,v 2.7 89/12/12 14:59:19 ghoti Exp $"; #endif /* lint */ /* menulist.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/menulist.c,v 2.8 90/03/22 09:25:48 ajp Exp $ */ /* $ACIS:menulist.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/menulist.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/menulist.c,v 2.8 90/03/22 09:25:48 ajp Exp $"; #endif /* lint */ /* menulist.c *************** *** 51,58 **** struct menulist *self; { ! if (*self->refcount <= 1) ! menulist_ClearML(self); menulist_ClearChain(self); } --- 51,63 ---- struct menulist *self; { ! if (*self->refcount == 1) { ! menulist_ClearML(self); ! free(self->refcount); ! } ! else if (*self->refcount > 1) { ! *self->refcount -= 1; ! } menulist_ClearChain(self); } *** atk/basics/common/view.c Wed Nov 22 11:49:23 1989 --- atk/basics/common/view.c.NEW Mon Mar 26 12:09:20 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/basics/common/RCS/view.c,v 2.7 89/10/16 11:22:45 tpn Exp $ */ /* $ACIS:view.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/basics/common/RCS/view.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/basics/common/RCS/view.c,v 2.7 89/10/16 11:22:45 tpn Exp $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/view.c,v 2.8 90/03/22 09:26:31 ajp Exp $ */ /* $ACIS:view.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/view.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/basics/common/RCS/view.c,v 2.8 90/03/22 09:26:31 ajp Exp $"; #endif /* lint */ *************** *** 58,68 **** if (self->dataobject != NULL) { dataobject_RemoveObserver(self->dataobject, self); } ! if (self->name != NULL) ! { atomlist_Destroy(self->name); atomlist_Destroy(self->className); ! } } void view__ObservedChanged(self, changed, value) --- 58,70 ---- if (self->dataobject != NULL) { dataobject_RemoveObserver(self->dataobject, self); } ! if (self->name != NULL) { atomlist_Destroy(self->name); atomlist_Destroy(self->className); ! } ! if (self->drawable != NULL) { ! graphic_Destroy(self->drawable); ! } } void view__ObservedChanged(self, changed, value) *** atk/bush/bushv.c Wed Nov 22 11:52:30 1989 --- atk/bush/bushv.c.NEW Tue Apr 3 11:15:51 1990 *************** *** 7,13 **** /* $Source $ */ #ifndef lint ! static char *rcsidbushv_c = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/bush/RCS/bushv.c,v 1.43 89/11/03 18:05:38 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 7,13 ---- /* $Source $ */ #ifndef lint ! static char *rcsidbushv_c = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/bush/RCS/bushv.c,v 1.45 90/03/27 14:08:09 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 147,152 **** --- 147,153 ---- #include #include #include + #include #include #include *************** *** 174,179 **** --- 175,181 ---- "zip", "raster", "table", + "other", NULL}; static char msg[MAXPATHLEN * 2]; *************** *** 247,266 **** #define EditorProgram (self->editor_program) #define EditorChoices (self->editor_choices) #define EditorIndex (self->editor_index) ! #define Selected(entry) ((entry)->mode.selected) ! #define DirType(entry) ((entry)->type.dir) ! #define LinkType(entry) ((entry)->type.soft_link) ! #define DirPerms(entry) ((entry)->permissions) #define SetTreeNotificationCode(self,code) \ ! tree_SetNotificationCode(bush_Tree(Bush),code) #define SetTreeNotificationNode(self,node) \ ! tree_SetNotificationNode(bush_Tree(Bush),node) #define SetTreeNotificationData(self,node,code) \ SetTreeNotificationNode(self,node);SetTreeNotificationCode(self,code) #define NotifyTreeObservers(self) \ ! tree_NotifyObservers(bush_Tree(Bush),NULL) #define ClearFrameBuffer(self) bushv_Announce(self,"") static suite_Specification edit[] = { suite_ItemCaption("Edit"), --- 249,304 ---- #define EditorProgram (self->editor_program) #define EditorChoices (self->editor_choices) #define EditorIndex (self->editor_index) ! #define NumEditorChoices (self->num_editor_choices) + #define Tree (bush_Tree(Bush)) + #define TreeRoot (bush_TreeRoot(Bush)) + #define DirMode(tn) (bush_DirMode(Bush,tn)) + #define DirPath(tn) (bush_DirPath(Bush,tn)) + #define DirName(tn) (bush_DirName(Bush,tn)) + #define DirSortMode(tn) (bush_DirSortMode(Bush,tn)) + #define DirDetail(tn) (bush_DirDetail(Bush,tn)) + #define DirTimeStamp(tn) (bush_DirTimeStamp(Bush,tn)) + #define ScanRequired(tn) (bush_ScanRequired(Bush,tn)) + #define RootDirPath (bush_RootDirPath(Bush)) + #define RootPathName (bush_RootPathName(Bush)) + #define DirEntries(tn) (bush_DirEntries(Bush,tn)) + #define DirEntriesCount(tn) (bush_DirEntriesCount(Bush,tn)) + #define DirEntryPtr(tn) (bush_DirEntryPtr(Bush,tn)) + #define DirEntry(tn,i) (bush_DirEntry(Bush,tn,i)) + #define DirEntryMode(tn,i) (bush_DirEntryMode(Bush,tn,i)) + #define DirEntryPos(tn,i) (bush_DirEntryPos(Bush,tn,i)) + #define DirEntryName(tn,i) (bush_DirEntryName(Bush,tn,i)) + #define DirEntryLinkName(tn,i) (bush_DirEntryLinkName(Bush,tn,i)) + #define DirEntryType(tn,i) (bush_DirEntryType(Bush,tn,i)) + #define DirEntryOwner(tn,i) (bush_DirEntryOwner(Bush,tn,i)) + #define DirEntryNLinks(tn,i) (bush_DirEntryNLinks(Bush,tn,i)) + #define DirEntryTimeStamp(tn,i) (bush_DirEntryTimeStamp(Bush,tn,i)) + #define DirEntrySize(tn,i) (bush_DirEntrySize(Bush,tn,i)) + #define DirEntryPerms(tn,i) (bush_DirEntryPerms(Bush,tn,i)) + + #define Parent(tn) (tree_ParentNode(Tree,tn)) + #define Child(tn) (tree_ChildNode(Tree,tn)) + #define Left(tn) (tree_LeftNode(Tree,tn)) + #define Right(tn) (tree_RightNode(Tree,tn)) + + #define EntrySelected(entry) ((entry)->mode.selected) + #define EntryDirType(entry) ((entry)->type.dir) + #define EntryLinkType(entry) ((entry)->type.soft_link) + #define EntryPerms(entry) ((entry)->permissions) + #define EntryLinkName(entry) ((entry)->link_name) + #define SetTreeNotificationCode(self,code) \ ! tree_SetNotificationCode(Tree,code) #define SetTreeNotificationNode(self,node) \ ! tree_SetNotificationNode(Tree,node) #define SetTreeNotificationData(self,node,code) \ SetTreeNotificationNode(self,node);SetTreeNotificationCode(self,code) #define NotifyTreeObservers(self) \ ! tree_NotifyObservers(Tree,NULL) + #define AllocNameSpace(s,t) apts_CaptureString(s,t) + #define ClearFrameBuffer(self) bushv_Announce(self,"") static suite_Specification edit[] = { suite_ItemCaption("Edit"), *************** *** 307,313 **** suite_Item(rename_it), suite_ItemCaptionFontName( "AndySans10b" ), suite_TitleBorderSize( 2 ), ! suite_GutterSize( 3 ), suite_BorderSize( 3 ), suite_ItemOrder( suite_ColumnMajor ), suite_Arrangement( suite_Matrix ), --- 345,351 ---- suite_Item(rename_it), suite_ItemCaptionFontName( "AndySans10b" ), suite_TitleBorderSize( 2 ), ! suite_GutterSize( 2 ), suite_BorderSize( 3 ), suite_ItemOrder( suite_ColumnMajor ), suite_Arrangement( suite_Matrix ), *************** *** 351,365 **** NULL }; static void - AllocNameSpace( target, source ) - char **target, *source; - { - if(target && *target) free(*target); - if(source && *source) strcpy(*target = malloc(strlen(source)+1),source); - else if(!source) *target = NULL; - } - - static void PostCursor( self, type ) struct bushv *self; int type; --- 389,394 ---- *************** *** 383,397 **** (entries_object). We do this after the check for Pop conditions because we need to determine the number of items previously highlighted for that check. */ { ! register struct Dir_Entry *DirEntry = NULL; register long int status = 0; if(!suite || !item) return(status); ! DirEntry = (struct Dir_Entry*)suite_ItemAttribute(suite,item,suite_ItemDatum(0)); if(!suite_ItemExposed(suite,item) || !suite_ItemHighlighted(suite,item) || !suite_ItemActivated(suite,item)) ! Selected(DirEntry) = FALSE; ! else Selected(DirEntry) = TRUE; return(status); } --- 412,426 ---- (entries_object). We do this after the check for Pop conditions because we need to determine the number of items previously highlighted for that check. */ { ! register struct Dir_Entry *dirEntry = NULL; register long int status = 0; if(!suite || !item) return(status); ! dirEntry = (struct Dir_Entry*)suite_ItemAttribute(suite,item,suite_ItemDatum(0)); if(!suite_ItemExposed(suite,item) || !suite_ItemHighlighted(suite,item) || !suite_ItemActivated(suite,item)) ! EntrySelected(dirEntry) = FALSE; ! else EntrySelected(dirEntry) = TRUE; return(status); } *************** *** 404,410 **** register enum view_MouseAction action; register long x, y, numClicks; { ! register struct Dir_Entry *DirEntry = NULL; register int numSelected = 0, count = 0, i = 0; IN(EntriesHitHandler); --- 433,439 ---- register enum view_MouseAction action; register long x, y, numClicks; { ! register struct Dir_Entry *dirEntry = NULL; register int numSelected = 0, count = 0, i = 0; IN(EntriesHitHandler); *************** *** 412,420 **** if((object == suite_ItemObject) && item && ((action == view_LeftUp) || (action == view_RightUp))) { if(action == view_LeftUp) { ! CurrEntry = DirEntry = (struct Dir_Entry*) suite_ItemAttribute(EntriesView,item,suite_ItemDatum(0)); ! if(Selected(DirEntry) && (NumPrevSelected == 1)) { PostCursor(self,Cursor_Wait); Push(self); bushv_RetractCursor(self,Cursor); --- 441,449 ---- if((object == suite_ItemObject) && item && ((action == view_LeftUp) || (action == view_RightUp))) { if(action == view_LeftUp) { ! CurrEntry = dirEntry = (struct Dir_Entry*) suite_ItemAttribute(EntriesView,item,suite_ItemDatum(0)); ! if(EntrySelected(dirEntry) && (NumPrevSelected == 1)) { PostCursor(self,Cursor_Wait); Push(self); bushv_RetractCursor(self,Cursor); *************** *** 421,430 **** } } suite_Apply(suite,ResetSelectedState,self,NULL); ! if(bush_DirEntries(Bush,CurrNode)) { ! count = bush_DirEntriesCount(Bush,CurrNode); ! for( i = 0 ; i < count ; i++ ) ! if(bush_DirEntryMode(Bush,CurrNode,i).selected) numSelected++; } NumPrevSelected = numSelected; if(Object == entries_object) { /* may have Pop'ed back to nodes */ --- 450,459 ---- } } suite_Apply(suite,ResetSelectedState,self,NULL); ! if(DirEntries(CurrNode)) { ! count = DirEntriesCount(CurrNode); ! for(i = 0 ; i < count ; i++) ! if(DirEntryMode(CurrNode,i).selected) numSelected++; } NumPrevSelected = numSelected; if(Object == entries_object) { /* may have Pop'ed back to nodes */ *************** *** 446,452 **** IN(StartDirMove); if(tn) { PostCursor(self,Cursor_Gunsight); ! sprintf(msg,"Moving directory '%s'...",bush_DirName(Bush,tn)); bushv_Announce(self,msg); } else bushv_Announce(self,"No selected directory to move."); --- 475,481 ---- IN(StartDirMove); if(tn) { PostCursor(self,Cursor_Gunsight); ! sprintf(msg,"Moving directory '%s'...",DirName(tn)); bushv_Announce(self,msg); } else bushv_Announce(self,"No selected directory to move."); *************** *** 474,507 **** bushv_Announce(self,msg); status = -1; } ! else if(tree_NodeAncestor(bush_Tree(Bush),MoveNode,tn)) { sprintf(msg,"You cannot move a directory to one of its children."); bushv_Announce(self,msg); status = -1; } ! else if(tn == bush_Parent(Bush,MoveNode)) { sprintf(msg,"'%s' already lives under '%s'", ! bush_DirName(Bush,MoveNode),bush_DirName(Bush,tn)); bushv_Announce(self,msg); status = -1; } else { ! sprintf(msg,"Moving '%s' under '%s'",bush_DirName(Bush,MoveNode), ! bush_DirName(Bush,tn)); bushv_Announce(self,msg); ! sprintf(finalLocation,"%s/%s",bush_DirPath(Bush,tn), ! bush_DirName(Bush,MoveNode)); ! if(status = rename(bush_DirPath(Bush,MoveNode),finalLocation)) { ! IssueError(self,"Moving",bush_DirName(Bush,MoveNode),TRUE); sprintf(msg,"Move failed."); bushv_Announce(self,msg); } else { ! if(tree_NodeLevel(bush_Tree(Bush),CurrNode) >= ! tree_NodeLevel(bush_Tree(Bush),MoveNode)) CurrNode = NULL; SetTreeNotificationData(self,MoveNode,tree_NodeDestroyed); NotifyTreeObservers(self); ! tree_DestroyNode(bush_Tree(Bush),MoveNode); sprintf(msg,"Move succeeded."); bushv_Announce(self,msg); } --- 503,536 ---- bushv_Announce(self,msg); status = -1; } ! else if(tree_NodeAncestor(Tree,MoveNode,tn)) { sprintf(msg,"You cannot move a directory to one of its children."); bushv_Announce(self,msg); status = -1; } ! else if(tn == Parent(MoveNode)) { sprintf(msg,"'%s' already lives under '%s'", ! DirName(MoveNode),DirName(tn)); bushv_Announce(self,msg); status = -1; } else { ! sprintf(msg,"Moving '%s' under '%s'",DirName(MoveNode), ! DirName(tn)); bushv_Announce(self,msg); ! sprintf(finalLocation,"%s/%s",DirPath(tn), ! DirName(MoveNode)); ! if(status = rename(DirPath(MoveNode),finalLocation)) { ! IssueError(self,"Moving",DirName(MoveNode),TRUE); sprintf(msg,"Move failed."); bushv_Announce(self,msg); } else { ! if(tree_NodeLevel(Tree,CurrNode) >= ! tree_NodeLevel(Tree,MoveNode)) CurrNode = NULL; SetTreeNotificationData(self,MoveNode,tree_NodeDestroyed); NotifyTreeObservers(self); ! tree_DestroyNode(Tree,MoveNode); sprintf(msg,"Move succeeded."); bushv_Announce(self,msg); } *************** *** 539,567 **** return 0; } MoveNode = NULL; ! bush_DirMode(Bush,node).do_rescan = TRUE; } else if(action != view_LeftUp || !node) return 0; ClearFrameBuffer(self); PostCursor(self,Cursor_Wait); ! if(stat(bush_DirPath(Bush,node),&stats)) { ! bush_DirMode(Bush,node).stat_failed = TRUE; ! IssueError(self,"Scanning",bush_DirName(Bush,node),TRUE); bushv_RetractCursor(self,Cursor); return 0; } old_CurrNode = CurrNode; CurrNode = node; ! if(bush_Parent(Bush,CurrNode)) ! peer = bush_Child(Bush,bush_Parent(Bush,CurrNode)); else peer = CurrNode; ! if(!bush_DirMode(Bush,CurrNode).selected || (action == view_RightUp)) { if(old_CurrNode) { ! bush_DirMode(Bush,old_CurrNode).selected = FALSE; old_CurrNode = NULL; } while(peer) { ! if(bush_Child(Bush,peer)) { SetTreeNotificationData(self,peer, tree_NodeChildrenDestroyed); NotifyTreeObservers(self); --- 568,595 ---- return 0; } MoveNode = NULL; ! DirMode(node).do_rescan = TRUE; } else if(action != view_LeftUp || !node) return 0; ClearFrameBuffer(self); PostCursor(self,Cursor_Wait); ! if(stat(DirPath(node),&stats)) { ! DirMode(node).stat_failed = TRUE; ! IssueError(self,"Scanning",DirName(node),TRUE); bushv_RetractCursor(self,Cursor); return 0; } old_CurrNode = CurrNode; CurrNode = node; ! if(Parent(CurrNode)) peer = Child(Parent(CurrNode)); else peer = CurrNode; ! if(!DirMode(CurrNode).selected || (action == view_RightUp)) { if(old_CurrNode) { ! DirMode(old_CurrNode).selected = FALSE; old_CurrNode = NULL; } while(peer) { ! if(Child(peer)) { SetTreeNotificationData(self,peer, tree_NodeChildrenDestroyed); NotifyTreeObservers(self); *************** *** 568,578 **** bush_DestroySubDirs(Bush,peer); break; } ! peer = bush_Right(Bush,peer); } ! bush_DirMode(Bush,CurrNode).selected = TRUE; ! if(bush_ScanRequired(Bush,CurrNode)) { ! sprintf(msg,"Scanning '%s' ...",bush_DirName(Bush,CurrNode)); bushv_Announce(self,msg); im_WantUpdate(bushv_GetIM(self),self); bush_ScanDir(Bush,CurrNode); --- 596,606 ---- bush_DestroySubDirs(Bush,peer); break; } ! peer = Right(peer); } ! DirMode(CurrNode).selected = TRUE; ! if(ScanRequired(CurrNode)) { ! sprintf(msg,"Scanning '%s' ...",DirName(CurrNode)); bushv_Announce(self,msg); im_WantUpdate(bushv_GetIM(self),self); bush_ScanDir(Bush,CurrNode); *************** *** 582,588 **** SetTreeNotificationData(self,CurrNode,tree_NodeChildrenCreated); NotifyTreeObservers(self); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); } else Push(self); bushv_RetractCursor(self,Cursor); --- 610,616 ---- SetTreeNotificationData(self,CurrNode,tree_NodeChildrenCreated); NotifyTreeObservers(self); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); } else Push(self); bushv_RetractCursor(self,Cursor); *************** *** 626,636 **** else if(object == suite_TitleObject) { suite_HighlightTitle(suite); PostCursor(self,Cursor_Wait); ! HandleChangeDir(self,bush_DirPath(Bush,CurrNode)); sleep(1); bushv_RetractCursor(self,Cursor); sprintf(msg,"Working directory changed to '%s'", ! bush_DirPath(Bush,CurrNode)); bushv_Announce(self,msg); suite_NormalizeTitle(suite); } --- 654,664 ---- else if(object == suite_TitleObject) { suite_HighlightTitle(suite); PostCursor(self,Cursor_Wait); ! HandleChangeDir(self,DirPath(CurrNode)); sleep(1); bushv_RetractCursor(self,Cursor); sprintf(msg,"Working directory changed to '%s'", ! DirPath(CurrNode)); bushv_Announce(self,msg); suite_NormalizeTitle(suite); } *************** *** 798,823 **** tempProc = proctable_DefineProc("bushv-exit",PerformExit, &bushv_classinfo,NULL,"Exit Bush."); menulist_AddToML(menulist,"Quit~70",tempProc,NULL,NULL); ! tempProc = proctable_DefineProc("bushv-DEBUG",ToggleDebug, &bushv_classinfo,NULL,"Toggle Bush debug flag."); return(TRUE); } static void - StripWhiteSpace( target, source ) - register char **target, *source; - { - register long i = 0, j = 0; - - AllocNameSpace(target,source); - while(source[i]) { - if(source[i] != ' ') (*target)[j++] = source[i]; - i++; - } - (*target)[j] = '\0'; - } - - static void GetPreferredEditors( self ) struct bushv *self; { --- 826,845 ---- tempProc = proctable_DefineProc("bushv-exit",PerformExit, &bushv_classinfo,NULL,"Exit Bush."); menulist_AddToML(menulist,"Quit~70",tempProc,NULL,NULL); ! proctable_DefineProc("bushv-DEBUG",ToggleDebug, &bushv_classinfo,NULL,"Toggle Bush debug flag."); + proctable_DefineProc("bushv-pop",PerformPop, + &bushv_classinfo,NULL,"Pop up a level."); + proctable_DefineProc("bushv-switch",SwitchDirectory, + &bushv_classinfo,NULL,"Switch to a new directory."); + proctable_DefineProc("bushv-rescan",PerformRescan, + &bushv_classinfo,NULL,"Rescan the current directory."); + proctable_DefineProc("bushv-destroy",PerformDestroy, + &bushv_classinfo,NULL,"Destroy the current directory/files."); return(TRUE); } static void GetPreferredEditors( self ) struct bushv *self; { *************** *** 829,847 **** environ_SetProgramName("bush"); if(((tmp = environ_GetProfile("editors")) || (tmp = environ_GetProfile("editor"))) && *tmp) { ! StripWhiteSpace(&myCopy,tmp); if(colon = (char*)index(tmp = myCopy,':')) { while((colon = (char*)index(tmp,':')) && (i < MAXEDITORS)) { *colon = '\0'; if(tmp && (*tmp != '\0')) { EditorChoices[i] = NULL; ! AllocNameSpace(&EditorChoices[i++],tmp); } tmp = colon + 1; } if(tmp && (*tmp != '\0') && (i < MAXEDITORS)) { EditorChoices[i] = NULL; ! AllocNameSpace(&EditorChoices[i],tmp); EditorChoices[i+1] = NULL; } else if(i >= MAXEDITORS) --- 851,869 ---- environ_SetProgramName("bush"); if(((tmp = environ_GetProfile("editors")) || (tmp = environ_GetProfile("editor"))) && *tmp) { ! AllocNameSpace(tmp,&myCopy); if(colon = (char*)index(tmp = myCopy,':')) { while((colon = (char*)index(tmp,':')) && (i < MAXEDITORS)) { *colon = '\0'; if(tmp && (*tmp != '\0')) { EditorChoices[i] = NULL; ! AllocNameSpace(tmp,&EditorChoices[i++]); } tmp = colon + 1; } if(tmp && (*tmp != '\0') && (i < MAXEDITORS)) { EditorChoices[i] = NULL; ! AllocNameSpace(tmp,&EditorChoices[i]); EditorChoices[i+1] = NULL; } else if(i >= MAXEDITORS) *************** *** 848,865 **** fprintf(stderr,"bush: too many editors in preference.\n"); } else if(tmp && (*tmp != '\0')) { ! EditorChoices[0] = NULL; ! AllocNameSpace(&EditorChoices[0],myCopy); EditorChoices[i+1] = NULL; } if(myCopy) free(myCopy); } ! if(i == 0) { for( i = 0 ; default_editor_choices[i] && (i < MAXEDITORS); i++ ) { EditorChoices[i] = NULL; ! AllocNameSpace(&EditorChoices[i],default_editor_choices[i]); } EditorChoices[i] = NULL; } EditorIndex = 0; strcpy(EditorProgram,EditorChoices[0]); --- 870,892 ---- fprintf(stderr,"bush: too many editors in preference.\n"); } else if(tmp && (*tmp != '\0')) { ! EditorChoices[i] = NULL; ! AllocNameSpace(myCopy,&EditorChoices[i]); EditorChoices[i+1] = NULL; } + i++; + AllocNameSpace("other",&EditorChoices[i]); + EditorChoices[i+1] = NULL; + NumEditorChoices = i+1; if(myCopy) free(myCopy); } ! else if(!tmp || (i == 0)) { for( i = 0 ; default_editor_choices[i] && (i < MAXEDITORS); i++ ) { EditorChoices[i] = NULL; ! AllocNameSpace(default_editor_choices[i],&EditorChoices[i]); } EditorChoices[i] = NULL; + NumEditorChoices = i; } EditorIndex = 0; strcpy(EditorProgram,EditorChoices[0]); *************** *** 884,892 **** suite_SetSuiteAttribute(EntriesView,suite_TitleCaptionFontHigh(0)); suite_SetSuiteAttribute(EntriesView,suite_ItemCaptionFontName( tmp )); suite_SetSuiteAttribute(EntriesView,suite_ItemCaptionFontHigh(0)); - /* - treev_SetAttribute(DirTreeView, treev_NodeFontName( tmp )); - */ } OUT(GetPreferredFont); } --- 911,916 ---- *************** *** 924,930 **** EntriesView = suite_Create(entries_spec,self); DirTreeView = treev_Create(tree_spec,self); LP = lpair_New(); ! lpair_VTFixed(LP,(struct view*)ControlView,(struct view*)DirTreeView,90,TRUE); lpair_LinkTree(LP,(struct view*)self); Object = nodes_object; SortMode = 0; --- 948,954 ---- EntriesView = suite_Create(entries_spec,self); DirTreeView = treev_Create(tree_spec,self); LP = lpair_New(); ! lpair_VTFixed(LP,(struct view*)ControlView,(struct view*)DirTreeView,95,TRUE); lpair_LinkTree(LP,(struct view*)self); Object = nodes_object; SortMode = 0; *************** *** 1003,1014 **** if(!IgnoreFullUpdate && (Type == view_LastPartialRedraw || Type == view_FullRedraw)) { super_FullUpdate(self,Type,left,top,width,height); ! if(!bush_RootPathName(Bush)) { im_GetDirectory(RootPathIfInset); bush_InitTree(Bush,RootPathIfInset); ! CurrNode = InitNode = bush_TreeRoot(Bush); ! bush_BuildSubDirs(Bush,bush_TreeRoot(Bush)); ! HandleChangeDir(self,bush_RootPathName(Bush)); } bushv_GetVisualBounds(self,&r); bushv_SetTransferMode(self,graphic_WHITE); --- 1027,1038 ---- if(!IgnoreFullUpdate && (Type == view_LastPartialRedraw || Type == view_FullRedraw)) { super_FullUpdate(self,Type,left,top,width,height); ! if(!RootPathName) { im_GetDirectory(RootPathIfInset); bush_InitTree(Bush,RootPathIfInset); ! CurrNode = InitNode = TreeRoot; ! bush_BuildSubDirs(Bush,TreeRoot); ! HandleChangeDir(self,RootPathName); } bushv_GetVisualBounds(self,&r); bushv_SetTransferMode(self,graphic_WHITE); *************** *** 1017,1023 **** bushv_SetTransferMode(self,graphic_BLACK); lpair_FullUpdate(LP,Type,0,0,r.width,r.height); if(CurrNode || (CurrNode = treev_CurrentNode(DirTreeView))) { ! sprintf(NewTitle,"%s%s%s",bush_DirPath(Bush,CurrNode), CurrEntry ? "/" : "", CurrEntry ? CurrEntry->name : ""); suite_ChangeSuiteAttribute(ControlView, suite_TitleCaption(NewTitle)); --- 1041,1047 ---- bushv_SetTransferMode(self,graphic_BLACK); lpair_FullUpdate(LP,Type,0,0,r.width,r.height); if(CurrNode || (CurrNode = treev_CurrentNode(DirTreeView))) { ! sprintf(NewTitle,"%s%s%s",DirPath(CurrNode), CurrEntry ? "/" : "", CurrEntry ? CurrEntry->name : ""); suite_ChangeSuiteAttribute(ControlView, suite_TitleCaption(NewTitle)); *************** *** 1028,1033 **** --- 1052,1059 ---- ClearFrameBuffer(self); } IgnoreFullUpdate = false; + if(Object == nodes_object) + treev_WantInputFocus(DirTreeView,DirTreeView); OUT(bushv_FullUpdate); } *************** *** 1061,1076 **** case nodes_object: break; case entries_object: ! if(CurrNode && bush_DirEntries(Bush,CurrNode) && ! (bush_DirEntriesCount(Bush,CurrNode) >= 0)) ! for(i=0;iname); break; } bushv_RetractCursor(self,Cursor); --- 1087,1102 ---- case nodes_object: break; case entries_object: ! if(CurrNode && DirEntries(CurrNode) && ! (DirEntriesCount(CurrNode) >= 0)) ! for(i=0;iname); break; } bushv_RetractCursor(self,Cursor); *************** *** 1092,1111 **** treev_Print(DirTreeView,file,"postscript","postscript",1); fclose(file); system("print -Tnative /tmp/bush_print.PS"); ! sprintf(msg,"Printed '%s'",bush_RootPathName(Bush)); bushv_Announce(self,msg); } else bushv_Announce(self,"Error Printing"); break; case entries_object: ! for(i=0;i < bush_DirEntriesCount(Bush,CurrNode);i++) ! if(bush_DirEntryMode(Bush,CurrNode,i).selected && ! !bush_DirEntryType(Bush,CurrNode,i).dir) ! DoPrint(self,bush_DirPath(Bush,CurrNode), ! bush_DirEntryName(Bush,CurrNode,i)); break; case entry_object: ! DoPrint(self,bush_DirPath(Bush,CurrNode),CurrEntry->name); break; } bushv_RetractCursor(self,Cursor); --- 1118,1137 ---- treev_Print(DirTreeView,file,"postscript","postscript",1); fclose(file); system("print -Tnative /tmp/bush_print.PS"); ! sprintf(msg,"Printed '%s'",RootPathName); bushv_Announce(self,msg); } else bushv_Announce(self,"Error Printing"); break; case entries_object: ! for(i=0;i < DirEntriesCount(CurrNode);i++) ! if(DirEntryMode(CurrNode,i).selected && ! !DirEntryType(CurrNode,i).dir) ! DoPrint(self,DirPath(CurrNode), ! DirEntryName(CurrNode,i)); break; case entry_object: ! DoPrint(self,DirPath(CurrNode),CurrEntry->name); break; } bushv_RetractCursor(self,Cursor); *************** *** 1117,1132 **** struct bushv *self; char *path, *name; { ! char prog[101], full_path[MAXPATHLEN * 2]; IN(DoPrint); - strcpy(prog,"ezprint"); sprintf(full_path,"%s/%s",path,name); sprintf(msg,"Printing '%s'",full_path); ! argv[0] = prog; ! argv[1] = full_path; ! argv[2] = NULL; ! PerformSystemAction(self,prog,argv,msg); OUT(DoPrint); } --- 1143,1170 ---- struct bushv *self; char *path, *name; { ! char full_path[MAXPATHLEN * 2], *ext = NULL; ! int i = 0; IN(DoPrint); sprintf(full_path,"%s/%s",path,name); sprintf(msg,"Printing '%s'",full_path); ! if((ext = rindex(name,'.')) != NULL) { ! ext++; ! argv[i++] = "print"; ! argv[i++] = "-T"; ! if(!strcmp(ext,"ps")) argv[i++] = "native"; ! else if(!strcmp(ext,"ras")) argv[i++] = "raster"; ! else if(!strcmp(ext,"dvi")) argv[i++] = "dvi"; ! else { ! i = 0; ! argv[i++] = "ezprint"; ! } ! } ! else argv[i++] = "ezprint"; ! argv[i++] = full_path; ! argv[i] = NULL; ! PerformSystemAction(self,argv[0],argv,msg); OUT(DoPrint); } *************** *** 1142,1148 **** switch(Object) { case nodes_object: if(bushv_Query(self,"Directory Name: ","",&response)) return; ! sprintf(cmd,"%s/%s",bush_DirPath(Bush,CurrNode),response); if(mkdir(cmd,0777)) { IssueError(self,"Creating",response,TRUE); return; --- 1180,1186 ---- switch(Object) { case nodes_object: if(bushv_Query(self,"Directory Name: ","",&response)) return; ! sprintf(cmd,"%s/%s",DirPath(CurrNode),response); if(mkdir(cmd,0777)) { IssueError(self,"Creating",response,TRUE); return; *************** *** 1151,1157 **** break; case entries_object: if(bushv_Query(self,"File Name: ","",&response)) return; ! sprintf(cmd,"%s/%s",bush_DirPath(Bush,CurrNode),response); if((f = open(cmd,O_CREAT | O_EXCL, 0100 | 0200 | 0400)) < 0) { IssueError(self,"Creating",response,TRUE); return; --- 1189,1195 ---- break; case entries_object: if(bushv_Query(self,"File Name: ","",&response)) return; ! sprintf(cmd,"%s/%s",DirPath(CurrNode),response); if((f = open(cmd,O_CREAT | O_EXCL, 0100 | 0200 | 0400)) < 0) { IssueError(self,"Creating",response,TRUE); return; *************** *** 1218,1240 **** if(!current_node) return; switch(self->object) { case nodes_object: ! if(tn = bush_Parent(Bush,current_node)) { ! for(i=0;i 0)){ sprintf(msg,"'%s' has contents. Destroy Anyway?", ! bush_DirName(Bush,current_node)); if(message_MultipleChoiceQuestion(self,100,msg, 1,&result,question,NULL) == -1) return; if(result != 0) { --- 1256,1278 ---- if(!current_node) return; switch(self->object) { case nodes_object: ! if(tn = Parent(current_node)) { ! for(i=0;i 0)){ sprintf(msg,"'%s' has contents. Destroy Anyway?", ! DirName(current_node)); if(message_MultipleChoiceQuestion(self,100,msg, 1,&result,question,NULL) == -1) return; if(result != 0) { *************** *** 1244,1258 **** } if(result == 0) { PostCursor(self,Cursor_Wait); ! if(DoDestroy(self,bush_Parent(Bush,current_node), Dir_Entry,TRUE)) { bushv_RetractCursor(self,Cursor); return; } ! CurrNode = bush_Parent(Bush,current_node); treev_HighlightNode(DirTreeView,CurrNode); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); bushv_RetractCursor(self,Cursor); PerformRescan(self); sprintf(msg,"Destroyed Node '%s'",Dir_Entry->name); --- 1282,1296 ---- } if(result == 0) { PostCursor(self,Cursor_Wait); ! if(DoDestroy(self,Parent(current_node), Dir_Entry,TRUE)) { bushv_RetractCursor(self,Cursor); return; } ! CurrNode = Parent(current_node); treev_HighlightNode(DirTreeView,CurrNode); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); bushv_RetractCursor(self,Cursor); PerformRescan(self); sprintf(msg,"Destroyed Node '%s'",Dir_Entry->name); *************** *** 1272,1278 **** else { Dir_Entry = (struct Dir_Entry*) suite_ItemAttribute(EntriesView,selected[0],suite_ItemDatum(0)); ! sprintf(msg,"Destroy %s '%s' ?",DirType(Dir_Entry) ? "Node" : "",Dir_Entry->name); } if(message_MultipleChoiceQuestion(self,100,msg,1, --- 1310,1316 ---- else { Dir_Entry = (struct Dir_Entry*) suite_ItemAttribute(EntriesView,selected[0],suite_ItemDatum(0)); ! sprintf(msg,"Destroy %s '%s' ?",EntryDirType(Dir_Entry) ? "Node" : "",Dir_Entry->name); } if(message_MultipleChoiceQuestion(self,100,msg,1, *************** *** 1284,1292 **** suite_ItemAttribute(EntriesView,selected[i],suite_ItemDatum(0)); if(!DoDestroy(self,current_node,Dir_Entry,TRUE)) { suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); suite_PassivateItem(EntriesView,selected[i]); ! Selected(Dir_Entry) = FALSE; } } bushv_RetractCursor(self,Cursor); --- 1322,1330 ---- suite_ItemAttribute(EntriesView,selected[i],suite_ItemDatum(0)); if(!DoDestroy(self,current_node,Dir_Entry,TRUE)) { suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); suite_PassivateItem(EntriesView,selected[i]); ! EntrySelected(Dir_Entry) = FALSE; } } bushv_RetractCursor(self,Cursor); *************** *** 1296,1302 **** case entry_object: if(current_entry) { selected = suite_SelectedItems(EntriesView,&count); ! if(DirType(current_entry)) sprintf(msg,"Destroy Directory '%s'?",current_entry->name); else sprintf(msg,"Destroy '%s'?",current_entry->name); if(message_MultipleChoiceQuestion(self,100,msg,1, --- 1334,1340 ---- case entry_object: if(current_entry) { selected = suite_SelectedItems(EntriesView,&count); ! if(EntryDirType(current_entry)) sprintf(msg,"Destroy Directory '%s'?",current_entry->name); else sprintf(msg,"Destroy '%s'?",current_entry->name); if(message_MultipleChoiceQuestion(self,100,msg,1, *************** *** 1307,1313 **** CurrEntry = NULL; PerformPop(self); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); } bushv_RetractCursor(self,Cursor); } --- 1345,1351 ---- CurrEntry = NULL; PerformPop(self); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); } bushv_RetractCursor(self,Cursor); } *************** *** 1330,1341 **** switch(Object) { case nodes_object: break; case entries_object: ! if(CurrNode && bush_DirEntries(Bush,CurrNode) && ! (bush_DirEntriesCount(Bush,CurrNode) >= 0)) ! for(i = 0;i < bush_DirEntriesCount(Bush,CurrNode);i++) ! if(bush_DirEntryMode(Bush,CurrNode,i).selected && ! !bush_DirEntryType(Bush,CurrNode,i).dir) ! DoExecute(self,CurrNode,bush_DirEntry(Bush,CurrNode,i)); break; case entry_object: DoExecute(self,CurrNode,CurrEntry); --- 1368,1379 ---- switch(Object) { case nodes_object: break; case entries_object: ! if(CurrNode && DirEntries(CurrNode) && ! (DirEntriesCount(CurrNode) >= 0)) ! for(i = 0;i < DirEntriesCount(CurrNode);i++) ! if(DirEntryMode(CurrNode,i).selected && ! !DirEntryType(CurrNode,i).dir) ! DoExecute(self,CurrNode,DirEntry(CurrNode,i)); break; case entry_object: DoExecute(self,CurrNode,CurrEntry); *************** *** 1354,1360 **** char full_path[MAXPATHLEN * 2]; IN(DoExecute); ! sprintf(full_path,"%s/%s",bush_DirPath(Bush,tn),Entry->name); sprintf(msg,"Executing '%s'",full_path); argv[0] = full_path; argv[1] = NULL; --- 1392,1398 ---- char full_path[MAXPATHLEN * 2]; IN(DoExecute); ! sprintf(full_path,"%s/%s",DirPath(tn),Entry->name); sprintf(msg,"Executing '%s'",full_path); argv[0] = full_path; argv[1] = NULL; *************** *** 1405,1415 **** } static char* ! FormatEntriesItem( self, tn, i, DirEntry ) register struct bushv *self; tree_type_node tn; int i; ! struct Dir_Entry *DirEntry; { static char entries_item[257], trailer[5]; register char *entries_ptr = NULL, *time_ptr = NULL; --- 1443,1453 ---- } static char* ! FormatEntriesItem( self, tn, i, dirEntry ) register struct bushv *self; tree_type_node tn; int i; ! struct Dir_Entry *dirEntry; { static char entries_item[257], trailer[5]; register char *entries_ptr = NULL, *time_ptr = NULL; *************** *** 1416,1453 **** IN(FormatEntriesItem); if(tn) { ! if(bush_DirEntryType(Bush,tn,i).dir) strcpy(trailer,"/"); ! else if(bush_DirEntryType(Bush,tn,i).soft_link) strcpy(trailer,"@ ->"); ! else if(bush_DirEntryPerms(Bush,tn,i) & S_IEXEC) strcpy(trailer,"*"); else trailer[0] = '\0'; ! if((bush_DirDetail(Bush,tn) == 1) || ((bush_DirDetail(Bush,tn) == -1) && Detail)) { ! time_ptr = (char*) ctime(&bush_DirEntryTimeStamp(Bush,tn,i)); time_ptr[24] = '\0'; ! sprintf(entries_item,"%s %2d %8s %8d %s %s%s", ! Format_Tags(bush_DirEntryPerms(Bush,tn,i)), ! bush_DirEntryNLinks(Bush,tn,i),bush_DirEntryOwner(Bush,tn,i), ! bush_DirEntrySize(Bush,tn,i),time_ptr,bush_DirEntryName(Bush,tn,i), ! trailer); } ! else sprintf(entries_item,"%s%s",bush_DirEntryName(Bush,tn,i),trailer); entries_ptr = entries_item; } ! else if(DirEntry) { ! if(DirType(DirEntry)) strcpy(trailer,"/"); ! else if(LinkType(DirEntry)) strcpy(trailer,"@ ->"); ! else if(DirPerms(DirEntry) & S_IEXEC) strcpy(trailer,"*"); else trailer[0] = '\0'; ! if((bush_DirDetail(Bush,CurrNode) == 1) || ! ((bush_DirDetail(Bush,CurrNode) == -1) && Detail)) { ! time_ptr = (char*) ctime(&DirEntry->time_stamp); time_ptr[24] = '\0'; ! sprintf(entries_item,"%s %2d %8s %8d %s %s%s", ! Format_Tags(DirEntry->permissions), ! DirEntry->nlinks,DirEntry->owner, ! DirEntry->size,time_ptr,DirEntry->name, ! trailer); } ! else sprintf(entries_item,"%s%s",DirEntry->name,trailer); entries_ptr = entries_item; } OUT(FormatEntriesItem); --- 1454,1498 ---- IN(FormatEntriesItem); if(tn) { ! if(!DirEntryType(tn,i).soft_link && DirEntryType(tn,i).dir) ! strcpy(trailer,"/"); ! else if(DirEntryType(tn,i).soft_link && ! ((DirDetail(CurrNode) == 1) || ! ((DirDetail(CurrNode) == -1) && Detail))) ! strcpy(trailer," -> "); ! else if(DirEntryPerms(tn,i) & S_IEXEC) strcpy(trailer,"*"); else trailer[0] = '\0'; ! if((DirDetail(tn) == 1) || ((DirDetail(tn) == -1) && Detail)) { ! time_ptr = (char*) ctime(&DirEntryTimeStamp(tn,i)); time_ptr[24] = '\0'; ! sprintf(entries_item,"%s %2d %8s %8d %s %s%s%s", ! Format_Tags(DirEntryPerms(tn,i)), ! DirEntryNLinks(tn,i),DirEntryOwner(tn,i), ! DirEntrySize(tn,i),time_ptr,DirEntryName(tn,i), ! trailer, DirEntryType(tn,i).soft_link ? DirEntryLinkName(tn,i) : ""); } ! else sprintf(entries_item,"%s%s",DirEntryName(tn,i),trailer); entries_ptr = entries_item; } ! else if(dirEntry) { ! if(!EntryLinkType(dirEntry) && EntryDirType(dirEntry)) strcpy(trailer,"/"); ! else if(EntryLinkType(dirEntry) && ! ((DirDetail(CurrNode) == 1) || ! ((DirDetail(CurrNode) == -1) && Detail))) ! strcpy(trailer," -> "); ! else if(EntryPerms(dirEntry) & S_IEXEC) strcpy(trailer,"*"); else trailer[0] = '\0'; ! if((DirDetail(CurrNode) == 1) || ! ((DirDetail(CurrNode) == -1) && Detail)) { ! time_ptr = (char*) ctime(&dirEntry->time_stamp); time_ptr[24] = '\0'; ! sprintf(entries_item,"%s %2d %8s %8d %s %s%s%s", ! Format_Tags(dirEntry->permissions), ! dirEntry->nlinks,dirEntry->owner, ! dirEntry->size,time_ptr,dirEntry->name, ! trailer, EntryLinkType(dirEntry) ? EntryLinkName(dirEntry) : ""); } ! else sprintf(entries_item,"%s%s",dirEntry->name,trailer); entries_ptr = entries_item; } OUT(FormatEntriesItem); *************** *** 1463,1473 **** IN(ResetEntriesCaptions); suite_Reset(EntriesView,suite_ClearItems); ! if(bush_DirEntries(Bush,CurrNode) && ! (count = bush_DirEntriesCount(Bush,CurrNode)) >= 0) for( i = 0 ; i < count ; i++ ) if(item = suite_CreateItem(EntriesView, ! bush_DirEntryName(Bush,CurrNode,i),bush_DirEntry(Bush,CurrNode,i))) suite_SetItemAttribute(EntriesView,item, suite_ItemCaption(FormatEntriesItem(self,CurrNode,i,NULL))); OUT(ResetEntriesCaptions); --- 1508,1518 ---- IN(ResetEntriesCaptions); suite_Reset(EntriesView,suite_ClearItems); ! if(DirEntries(CurrNode) && ! (count = DirEntriesCount(CurrNode)) >= 0) for( i = 0 ; i < count ; i++ ) if(item = suite_CreateItem(EntriesView, ! DirEntryName(CurrNode,i),DirEntry(CurrNode,i))) suite_SetItemAttribute(EntriesView,item, suite_ItemCaption(FormatEntriesItem(self,CurrNode,i,NULL))); OUT(ResetEntriesCaptions); *************** *** 1496,1502 **** IN(SwitchDirectory); msg_status = bushv_QueryDirectoryName(self,"Switch To Directory: ",&response); ! if(msg_status) return; PostCursor(self,Cursor_Wait); if(stat(response,&stats)) { IssueError(self,"ReScanning",response,TRUE); --- 1541,1549 ---- IN(SwitchDirectory); msg_status = bushv_QueryDirectoryName(self,"Switch To Directory: ",&response); ! if(msg_status) { ! return; ! } PostCursor(self,Cursor_Wait); if(stat(response,&stats)) { IssueError(self,"ReScanning",response,TRUE); *************** *** 1515,1533 **** PopToNodes(self); PostCursor(self,Cursor_Wait); } ! SetTreeNotificationData(self,bush_TreeRoot(Bush),tree_NodeDestroyed); NotifyTreeObservers(self); ! tree_DestroyNode(bush_Tree(Bush),bush_TreeRoot(Bush)); bush_InitTree(Bush,response); ! CurrNode = InitNode = bush_TreeRoot(Bush); bush_BuildSubDirs(Bush,CurrNode); SetTreeNotificationData(self,CurrNode,tree_NodeCreated); NotifyTreeObservers(self); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); ! if(TopLevelInset) im_SetTitle(bushv_GetIM(self),bush_DirName(Bush,CurrNode)); bushv_RetractCursor(self,Cursor); ! HandleChangeDir(self,bush_RootPathName(Bush)); OUT(SwitchDirectory); } --- 1562,1580 ---- PopToNodes(self); PostCursor(self,Cursor_Wait); } ! SetTreeNotificationData(self,TreeRoot,tree_NodeDestroyed); NotifyTreeObservers(self); ! tree_DestroyNode(Tree,TreeRoot); bush_InitTree(Bush,response); ! CurrNode = InitNode = TreeRoot; bush_BuildSubDirs(Bush,CurrNode); SetTreeNotificationData(self,CurrNode,tree_NodeCreated); NotifyTreeObservers(self); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); ! if(TopLevelInset) im_SetTitle(bushv_GetIM(self),DirName(CurrNode)); bushv_RetractCursor(self,Cursor); ! HandleChangeDir(self,RootPathName); OUT(SwitchDirectory); } *************** *** 1535,1546 **** SetEditor( self ) struct bushv *self; { ! long result = 0; IN(SetEditor); sprintf(msg,"Set editor to: "); if(message_MultipleChoiceQuestion(self,100,msg,EditorIndex, &result,EditorChoices,NULL) == -1) return; EditorIndex = result; strcpy(EditorProgram,EditorChoices[result]); sprintf(msg,"Editor set to: '%s'",EditorProgram); --- 1582,1603 ---- SetEditor( self ) struct bushv *self; { ! long result = 0; ! char *response = NULL; IN(SetEditor); sprintf(msg,"Set editor to: "); if(message_MultipleChoiceQuestion(self,100,msg,EditorIndex, &result,EditorChoices,NULL) == -1) return; + if(!strcmp(EditorChoices[result],"other")) { + if(bushv_Query(self,"Set editor to: ","",&response)) { + return; + } + AllocNameSpace(EditorChoices[NumEditorChoices-1], + &EditorChoices[NumEditorChoices]); + AllocNameSpace(response,&EditorChoices[NumEditorChoices-1]); + EditorChoices[++NumEditorChoices] = NULL; + } EditorIndex = result; strcpy(EditorProgram,EditorChoices[result]); sprintf(msg,"Editor set to: '%s'",EditorProgram); *************** *** 1569,1579 **** IN(FormatEntriesInfo); if(tn) { ! if(bush_DirEntries(Bush,tn)) count = bush_DirEntriesCount(Bush,tn); ! for( i = 0; i < count; i++ ) total_bytes += bush_DirEntrySize(Bush,tn,i); sprintf(entries_info,"%d %s %d %s %s %s",count, "Entries",total_bytes,"Bytes","Sorted by", ! (bush_DirSortMode(Bush,tn) != -1) ? sorts[bush_DirSortMode(Bush,tn)] : sorts[SortMode]); } OUT(FormatEntriesInfo); --- 1626,1636 ---- IN(FormatEntriesInfo); if(tn) { ! if(DirEntries(tn)) count = DirEntriesCount(tn); ! for( i = 0; i < count; i++ ) total_bytes += DirEntrySize(tn,i); sprintf(entries_info,"%d %s %d %s %s %s",count, "Entries",total_bytes,"Bytes","Sorted by", ! (DirSortMode(tn) != -1) ? sorts[DirSortMode(tn)] : sorts[SortMode]); } OUT(FormatEntriesInfo); *************** *** 1588,1594 **** int (*sorter)(), sMode = 0; IN(DetermineSortHandler); ! if((sMode = bush_DirSortMode(Bush,tn)) == -1) sMode = SortMode; switch(sMode) { case by_name: sorter = SortByName; break; case by_size: sorter = SortBySize; break; --- 1645,1651 ---- int (*sorter)(), sMode = 0; IN(DetermineSortHandler); ! if((sMode = DirSortMode(tn)) == -1) sMode = SortMode; switch(sMode) { case by_name: sorter = SortByName; break; case by_size: sorter = SortBySize; break; *************** *** 1615,1622 **** suite_SetSuiteAttribute(EntriesView, suite_TitleCaption(FormatEntriesInfo(self,CurrNode))); lpair_SetNth(LP,1,(struct view*)EntriesView); ! if(bush_ScanRequired(Bush,CurrNode)) PerformRescan(self); ! bushv_WantInputFocus(self,self); } OUT(PushToEntries); } --- 1672,1679 ---- suite_SetSuiteAttribute(EntriesView, suite_TitleCaption(FormatEntriesInfo(self,CurrNode))); lpair_SetNth(LP,1,(struct view*)EntriesView); ! if(ScanRequired(CurrNode)) PerformRescan(self); ! bushv_WantInputFocus(self,EntriesView); } OUT(PushToEntries); } *************** *** 1632,1638 **** IN(PushToEntry); PostCursor(self,Cursor_Wait); Object = entry_object; ! sprintf(file_name,"%s/%s",bush_DirPath(Bush,CurrNode),CurrEntry->name); sprintf(msg,"reading '%s'",file_name); bushv_Announce(self,msg); if(EntryFilep = fopen(file_name,"r")) { --- 1689,1695 ---- IN(PushToEntry); PostCursor(self,Cursor_Wait); Object = entry_object; ! sprintf(file_name,"%s/%s",DirPath(CurrNode),CurrEntry->name); sprintf(msg,"reading '%s'",file_name); bushv_Announce(self,msg); if(EntryFilep = fopen(file_name,"r")) { *************** *** 1681,1690 **** Object = nodes_object; CurrEntry = NULL; suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); lpair_SetNth(LP,1,(struct view*)DirTreeView); ! if(bush_ScanRequired(Bush,CurrNode)) PerformRescan(self); ! bushv_WantInputFocus(self,self); } OUT(PopToNodes); } --- 1738,1747 ---- Object = nodes_object; CurrEntry = NULL; suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); lpair_SetNth(LP,1,(struct view*)DirTreeView); ! if(ScanRequired(CurrNode)) PerformRescan(self); ! treev_WantInputFocus(DirTreeView,DirTreeView); } OUT(PopToNodes); } *************** *** 1702,1710 **** Object = entries_object; lpair_SetNth(LP,1,(struct view*)EntriesView); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); ! if(bush_ScanRequired(Bush,CurrNode)) PerformRescan(self); ! bushv_WantInputFocus(self,self); } OUT(PopToEntries); } --- 1759,1767 ---- Object = entries_object; lpair_SetNth(LP,1,(struct view*)EntriesView); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); ! if(ScanRequired(CurrNode)) PerformRescan(self); ! bushv_WantInputFocus(self,EntriesView); } OUT(PopToEntries); } *************** *** 1758,1785 **** PushToEntries(self); break; case entries_object: ! if(DirType(CurrEntry)) { ! AllocNameSpace(&name,CurrEntry->name); PostCursor(self,Cursor_Wait); Pop(self); ! tn = bush_Child(Bush,CurrNode); ! while(tn) { ! if(!strcmp(bush_DirName(Bush,tn),name)) ! break; ! else tn = bush_Right(Bush,tn); ! } ! if(tn) TreeHitHandler(self,DirTreeView,tn, treev_NodeObject,view_LeftUp,0,0,0); else { sprintf(msg,"Couldn't locate directory node '%s'.",CurrEntry->name); bushv_Announce(self,msg); } - if(name) free(name); bushv_RetractCursor(self,Cursor); } else PushToEntry(self); break; } PassivateControls(self); ClearFrameBuffer(self); OUT(Push); --- 1815,1843 ---- PushToEntries(self); break; case entries_object: ! if(EntryDirType(CurrEntry)) { ! AllocNameSpace(CurrEntry->name,&name); PostCursor(self,Cursor_Wait); Pop(self); ! tn = Child(CurrNode); ! while(tn) ! if(!strcmp(DirName(tn),name)) break; ! else tn = Right(tn); ! if(tn) { ! TreeHitHandler(self,DirTreeView,tn, treev_NodeObject,view_LeftUp,0,0,0); + treev_HighlightNode(DirTreeView,tn); + } else { sprintf(msg,"Couldn't locate directory node '%s'.",CurrEntry->name); bushv_Announce(self,msg); } bushv_RetractCursor(self,Cursor); } else PushToEntry(self); break; } + if(name) free(name); PassivateControls(self); ClearFrameBuffer(self); OUT(Push); *************** *** 1857,1863 **** register long status = 0; IN(ResetDirDetailModes); ! if(tree && tn) bush_DirDetail(Bush,tn) = -1; OUT(ResetDirDetailModes); return(status); } --- 1915,1921 ---- register long status = 0; IN(ResetDirDetailModes); ! if(tree && tn) DirDetail(tn) = -1; OUT(ResetDirDetailModes); return(status); } *************** *** 1873,1888 **** sleep(1); if(Object == nodes_object) { Detail = !Detail; ! tree_Apply(bush_Tree(Bush),NULL,ResetDirDetailModes,self,0); sprintf(msg,"Global detail '%s'", Detail ? "On" : "Off" ); bushv_Announce(self,msg); } else if(Object == entries_object) { ! if((detail = bush_DirDetail(Bush,CurrNode)) == -1) ! bush_DirDetail(Bush,CurrNode) = !Detail; ! else bush_DirDetail(Bush,CurrNode) = !detail; suite_Apply(EntriesView,ToggleCaptionDetail,self,0); ! suite_WantUpdate(EntriesView,EntriesView); } bushv_RetractCursor(self,Cursor); OUT(PerformDetail); --- 1931,1946 ---- sleep(1); if(Object == nodes_object) { Detail = !Detail; ! tree_Apply(Tree,NULL,ResetDirDetailModes,self,0); sprintf(msg,"Global detail '%s'", Detail ? "On" : "Off" ); bushv_Announce(self,msg); } else if(Object == entries_object) { ! if((detail = DirDetail(CurrNode)) == -1) ! DirDetail(CurrNode) = !Detail; ! else DirDetail(CurrNode) = !detail; suite_Apply(EntriesView,ToggleCaptionDetail,self,0); ! suite_WantUpdate(EntriesView,self); } bushv_RetractCursor(self,Cursor); OUT(PerformDetail); *************** *** 1895,1904 **** { IN(bushv_SetDataObject); Bush = bush; ! treev_SetDataObject(DirTreeView,bush_Tree(Bush)); super_SetDataObject(self,bush); ! CurrNode = InitNode = bush_TreeRoot(Bush); ! HandleChangeDir(self,bush_RootPathName(Bush)); OUT(bushv_SetDataObject); } --- 1953,1962 ---- { IN(bushv_SetDataObject); Bush = bush; ! treev_SetDataObject(DirTreeView,Tree); super_SetDataObject(self,bush); ! CurrNode = InitNode = TreeRoot; ! HandleChangeDir(self,RootPathName); OUT(bushv_SetDataObject); } *************** *** 1912,1919 **** IN(SortRequested); if( Object == entries_object ) { IgnoreFullUpdate = true; ! if(bush_DirSortMode(Bush,CurrNode) != -1) ! current_mode = bush_DirSortMode(Bush,CurrNode); else current_mode = SortMode; } else current_mode = SortMode; --- 1970,1977 ---- IN(SortRequested); if( Object == entries_object ) { IgnoreFullUpdate = true; ! if(DirSortMode(CurrNode) != -1) ! current_mode = DirSortMode(CurrNode); else current_mode = SortMode; } else current_mode = SortMode; *************** *** 1941,1947 **** long int status = 0; IN(ResetDirSortModes); ! if(tree && tn) bush_DirSortMode(Bush,tn) = -1; OUT(ResetDirSortModes); return(status); } --- 1999,2005 ---- long int status = 0; IN(ResetDirSortModes); ! if(tree && tn) DirSortMode(tn) = -1; OUT(ResetDirSortModes); return(status); } *************** *** 1960,1971 **** bushv_Announce(self,msg); sorter = DetermineSortHandler(self,CurrNode); suite_SetSuiteAttribute(EntriesView,suite_SortHandler(sorter)); ! tree_Apply(bush_Tree(Bush),NULL,ResetDirSortModes,self,0); bushv_Announce(self,""); return; } else if(Object == entries_object) { ! bush_DirSortMode(Bush,CurrNode) = sMode; sprintf(msg,"Sorting by '%s' ...",sorts[sMode]); bushv_Announce(self,msg); im_ForceUpdate(); --- 2018,2029 ---- bushv_Announce(self,msg); sorter = DetermineSortHandler(self,CurrNode); suite_SetSuiteAttribute(EntriesView,suite_SortHandler(sorter)); ! tree_Apply(Tree,NULL,ResetDirSortModes,self,0); bushv_Announce(self,""); return; } else if(Object == entries_object) { ! DirSortMode(CurrNode) = sMode; sprintf(msg,"Sorting by '%s' ...",sorts[sMode]); bushv_Announce(self,msg); im_ForceUpdate(); *************** *** 1988,2009 **** IN(PerformRescan); if(!CurrNode) return; PostCursor(self,Cursor_Wait); ! if(stat(bush_DirPath(Bush,CurrNode),&stats)) { ! bush_DirMode(Bush,CurrNode).stat_failed = TRUE; ! IssueError(self,"ReScanning",bush_DirPath(Bush,CurrNode),TRUE); bushv_RetractCursor(self,Cursor); return; } if(Object == nodes_object || Object == entries_object) { ! sprintf(msg,"Scanning Directory '%s' ...",bush_DirPath(Bush,CurrNode)); bushv_Announce(self,msg); ! if(bush_Child(Bush,CurrNode)) { SetTreeNotificationData(self,CurrNode,tree_NodeChildrenDestroyed); NotifyTreeObservers(self); } bush_ScanDir(Bush,CurrNode); bush_BuildSubDirs(Bush,CurrNode); ! if(bush_Child(Bush,CurrNode)) { SetTreeNotificationData(self,CurrNode,tree_NodeChildrenCreated); NotifyTreeObservers(self); } --- 2046,2067 ---- IN(PerformRescan); if(!CurrNode) return; PostCursor(self,Cursor_Wait); ! if(stat(DirPath(CurrNode),&stats)) { ! DirMode(CurrNode).stat_failed = TRUE; ! IssueError(self,"ReScanning",DirPath(CurrNode),TRUE); bushv_RetractCursor(self,Cursor); return; } if(Object == nodes_object || Object == entries_object) { ! sprintf(msg,"Scanning Directory '%s' ...",DirPath(CurrNode)); bushv_Announce(self,msg); ! if(Child(CurrNode)) { SetTreeNotificationData(self,CurrNode,tree_NodeChildrenDestroyed); NotifyTreeObservers(self); } bush_ScanDir(Bush,CurrNode); bush_BuildSubDirs(Bush,CurrNode); ! if(Child(CurrNode)) { SetTreeNotificationData(self,CurrNode,tree_NodeChildrenCreated); NotifyTreeObservers(self); } *************** *** 2011,2017 **** ResetEntriesCaptions(self); SortDir(self,CurrNode); } ! sprintf(msg,"Finished scanning '%s'",bush_DirPath(Bush,CurrNode)); bushv_Announce(self,msg); } else if(Object == entry_object) PushToEntry(self); --- 2069,2075 ---- ResetEntriesCaptions(self); SortDir(self,CurrNode); } ! sprintf(msg,"Finished scanning '%s'",DirPath(CurrNode)); bushv_Announce(self,msg); } else if(Object == entry_object) PushToEntry(self); *************** *** 2030,2038 **** char tmp_path[MAXPATHLEN]; IN(ResetChildDirPaths); ! if(tn && tree_NodeLevel(bush_Tree(Bush),tn) > tree_NodeLevel(bush_Tree(Bush),CurrNode)) { ! sprintf(tmp_path,"%s/%s",(char*)datum,bush_DirName(self,tn)); ! AllocNameSpace(&bush_DirPath(Bush,tn),tmp_path); } else if(tn && (CurrNode == tn)) status = 0; else status = -1; --- 2088,2096 ---- char tmp_path[MAXPATHLEN]; IN(ResetChildDirPaths); ! if(tn && tree_NodeLevel(Tree,tn) > tree_NodeLevel(Tree,CurrNode)) { ! sprintf(tmp_path,"%s/%s",(char*)datum,DirName(tn)); ! AllocNameSpace(tmp_path,&DirPath(tn)); } else if(tn && (CurrNode == tn)) status = 0; else status = -1; *************** *** 2049,2055 **** char *response = NULL, tmp_path[MAXPATHLEN], *tmp = NULL; register struct suite_item **selected = NULL; ! struct Dir_Entry *DirEntry = NULL; register int i = 0; IN(PerformRename); --- 2107,2113 ---- char *response = NULL, tmp_path[MAXPATHLEN], *tmp = NULL; register struct suite_item **selected = NULL; ! struct Dir_Entry *dirEntry = NULL; register int i = 0; IN(PerformRename); *************** *** 2057,2106 **** switch(Object) { case nodes_object: msg_status = bushv_Query(self,"New Name: ", ! bush_DirName(Bush,CurrNode),&response); ! if(msg_status || !strcmp(response,bush_DirName(Bush,CurrNode))) return; ! sprintf(msg,"Directory '%s' renamed to '",bush_DirName(Bush,CurrNode)); ! strcpy(tmp_path,bush_DirPath(Bush,CurrNode)); if(tmp = rindex(tmp_path,'/')) *tmp = '\0'; if(!bush_RenameDir(Bush,CurrNode,tmp_path,response)) { ! tree_SetNodeName(bush_Tree(Bush),CurrNode, ! bush_DirName(Bush,CurrNode)); SetTreeNotificationData(self,CurrNode,tree_NodeNameChanged); NotifyTreeObservers(self); ! strcat(msg,bush_DirName(Bush,CurrNode)); strcat(msg,"'"); bushv_Announce(self,msg); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(bush_DirPath(Bush,CurrNode))); ! tree_Apply(bush_Tree(Bush),CurrNode,ResetChildDirPaths, ! self,strcpy(tmp_path,bush_DirPath(Bush,CurrNode))); } ! else IssueError(self,"Renaming",bush_DirName(Bush,CurrNode),TRUE); break; case entries_object: selected = suite_SelectedItems(EntriesView,&count); for( i = 0 ; (i < count) && selected[i] ; i++ ) { suite_PassivateItem(EntriesView,selected[i]); ! DirEntry = (struct Dir_Entry *) suite_ItemAttribute(EntriesView,selected[i],suite_ItemDatum(0)); ! sprintf(msg,"Renaming '%s' to '",DirEntry->name); msg_status = bushv_Query(self,"New Name: ", ! DirEntry->name,&response); ! if(msg_status || !strcmp(response,DirEntry->name)) { suite_ActivateItem(EntriesView,selected[i]); suite_HighlightItem(EntriesView,selected[i]); continue; } ! if(bush_MoveEntry(Bush,CurrNode,DirEntry,response) != -1) { strcat(msg,response); strcat(msg,"'"); bushv_Announce(self,msg); suite_ActivateItem(EntriesView,selected[i]); suite_HighlightItem(EntriesView,selected[i]); suite_ChangeItemAttribute(EntriesView,selected[i], ! suite_ItemCaption(FormatEntriesItem(self,NULL,0,DirEntry))); } else { ! IssueError(self,"Renaming",DirEntry->name,TRUE); suite_ActivateItem(EntriesView,selected[i]); suite_HighlightItem(EntriesView,selected[i]); } --- 2115,2163 ---- switch(Object) { case nodes_object: msg_status = bushv_Query(self,"New Name: ", ! DirName(CurrNode),&response); ! if(msg_status || !strcmp(response,DirName(CurrNode))) return; ! sprintf(msg,"Directory '%s' renamed to '",DirName(CurrNode)); ! strcpy(tmp_path,DirPath(CurrNode)); if(tmp = rindex(tmp_path,'/')) *tmp = '\0'; if(!bush_RenameDir(Bush,CurrNode,tmp_path,response)) { ! tree_SetNodeName(Tree,CurrNode,DirName(CurrNode)); SetTreeNotificationData(self,CurrNode,tree_NodeNameChanged); NotifyTreeObservers(self); ! strcat(msg,DirName(CurrNode)); strcat(msg,"'"); bushv_Announce(self,msg); suite_ChangeSuiteAttribute(ControlView, ! suite_TitleCaption(DirPath(CurrNode))); ! tree_Apply(Tree,CurrNode,ResetChildDirPaths, ! self,strcpy(tmp_path,DirPath(CurrNode))); } ! else IssueError(self,"Renaming",DirName(CurrNode),TRUE); break; case entries_object: selected = suite_SelectedItems(EntriesView,&count); for( i = 0 ; (i < count) && selected[i] ; i++ ) { suite_PassivateItem(EntriesView,selected[i]); ! dirEntry = (struct Dir_Entry *) suite_ItemAttribute(EntriesView,selected[i],suite_ItemDatum(0)); ! sprintf(msg,"Renaming '%s' to '",dirEntry->name); msg_status = bushv_Query(self,"New Name: ", ! dirEntry->name,&response); ! if(msg_status || !strcmp(response,dirEntry->name)) { suite_ActivateItem(EntriesView,selected[i]); suite_HighlightItem(EntriesView,selected[i]); continue; } ! if(bush_MoveEntry(Bush,CurrNode,dirEntry,response) != -1) { strcat(msg,response); strcat(msg,"'"); bushv_Announce(self,msg); suite_ActivateItem(EntriesView,selected[i]); suite_HighlightItem(EntriesView,selected[i]); suite_ChangeItemAttribute(EntriesView,selected[i], ! suite_ItemCaption(FormatEntriesItem(self,NULL,0,dirEntry))); } else { ! IssueError(self,"Renaming",dirEntry->name,TRUE); suite_ActivateItem(EntriesView,selected[i]); suite_HighlightItem(EntriesView,selected[i]); } *************** *** 2113,2119 **** if(bush_MoveEntry(Bush,CurrNode,CurrEntry,response) != -1) { strcat(msg,response); strcat(msg,"'"); bushv_Announce(self,msg); ! sprintf(msg,"%s/%s",bush_DirPath(Bush,CurrNode),CurrEntry->name); suite_ChangeSuiteAttribute(ControlView,suite_TitleCaption(msg)); } else IssueError(self,"Renaming",CurrEntry->name,TRUE); --- 2170,2176 ---- if(bush_MoveEntry(Bush,CurrNode,CurrEntry,response) != -1) { strcat(msg,response); strcat(msg,"'"); bushv_Announce(self,msg); ! sprintf(msg,"%s/%s",DirPath(CurrNode),CurrEntry->name); suite_ChangeSuiteAttribute(ControlView,suite_TitleCaption(msg)); } else IssueError(self,"Renaming",CurrEntry->name,TRUE); *** atk/bush/bushv.ch Wed Nov 22 11:52:19 1989 --- atk/bush/bushv.ch.NEW Tue Mar 27 13:55:06 1990 *************** *** 7,17 **** /* $Source $ */ #ifndef lint ! static char *rcsidbushv_ch = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/bush/RCS/bushv.ch,v 1.4 89/09/08 13:38:01 gk5g Exp $"; #endif /* $Log: bushv.ch,v $ Revision 1.4 89/09/08 13:38:01 gk5g Added entry_filep to keep a handle of the currently visited file. --- 7,20 ---- /* $Source $ */ #ifndef lint ! static char *rcsidbushv_ch = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/bush/RCS/bushv.ch,v 1.5 90/03/05 11:18:34 gk5g Exp $"; #endif /* $Log: bushv.ch,v $ + Revision 1.5 90/03/05 11:18:34 gk5g + Follow soft links correctly now. + Revision 1.4 89/09/08 13:38:01 gk5g Added entry_filep to keep a handle of the currently visited file. *************** *** 81,86 **** --- 84,90 ---- move_node; struct Dir_Entry *current_entry; int editor_index; + int num_editor_choices; char editor_program[1025]; char *editor_choices[MAXEDITORS]; struct suite *control_view; *** atk/bush/bushapp.c Wed Nov 22 11:52:23 1989 --- atk/bush/bushapp.c.NEW Tue Apr 3 11:15:54 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsidbushapp_c = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/bush/RCS/bushapp.c,v 1.6 89/09/07 19:56:19 tom Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsidbushapp_c = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/bush/RCS/bushapp.c,v 1.7 90/03/27 14:09:51 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 125,130 **** --- 125,132 ---- bushv_SetDataObject(NodesWindow,Bush); frame_SetView(framePtr,NodesWindow); im_SetView(imPtr,framePtr); + frame_PostDefaultHandler(framePtr,"message", + frame_WantHandler(framePtr,"message")); if(bush_TreeRoot(Bush)) im_SetTitle(imPtr,bush_DirName(Bush,bush_TreeRoot(Bush))); chdir(bush_DirPath(Bush,bush_TreeRoot(Bush))); *** atk/bush/bush.c Wed Nov 22 11:52:21 1989 --- atk/bush/bush.c.NEW Tue Mar 20 20:36:55 1990 *************** *** 7,17 **** /* $Source $ */ #ifndef lint ! static char *rcsidbush_c = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/bush/RCS/bush.c,v 1.16 89/11/07 10:33:06 cfe Exp $"; #endif /* $Log: bush.c,v $ * Revision 1.16 89/11/07 10:33:06 cfe * Eliminate dependency on afs/param.h . * --- 7,20 ---- /* $Source $ */ #ifndef lint ! static char *rcsidbush_c = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/bush/RCS/bush.c,v 1.17 90/03/05 11:18:38 gk5g Exp $"; #endif /* $Log: bush.c,v $ + * Revision 1.17 90/03/05 11:18:38 gk5g + * Follow soft links correctly now. + * * Revision 1.16 89/11/07 10:33:06 cfe * Eliminate dependency on afs/param.h . * *************** *** 136,141 **** --- 139,145 ---- #include #endif /* AFS_ENV */ #include + #include #include #include #include *************** *** 150,155 **** --- 154,161 ---- #define MyCellName (self->mycellname) #define Debug (self->debug) + #define AllocNameSpace(s,t) apts_CaptureString(s,t) + tree_Specification DirTree[] = {tree_Order(tree_PreOrder),NULL}; char baseName[] = "/afs"; /*Pathname to give to pioctl()*/ *************** *** 156,175 **** #define MAX_PIOCTL_BUFF_SIZE 1000 static char *gethomecell(), *getcell(); - static void - AllocNameSpace( target, source ) - char **target, *source; - { - if(!target) return; - if(*target) free(*target); - if(!source) { - *target = NULL; - return; - } - if(*target = malloc(strlen(source)+1)) - strcpy(*target,source); - } - static int NodeFilter( dir ) struct direct *dir; --- 162,167 ---- *************** *** 288,294 **** strcpy(GivenDirName,root_path); strcpy(tmp,RootPath); ExtractNodeName(tmp,&nodeName); ! AllocNameSpace(&rootDir->name,nodeName); if(stat(RootPath,&stats)) return; else { gethomecell(self,baseName); --- 280,286 ---- strcpy(GivenDirName,root_path); strcpy(tmp,RootPath); ExtractNodeName(tmp,&nodeName); ! AllocNameSpace(nodeName,&rootDir->name); if(stat(RootPath,&stats)) return; else { gethomecell(self,baseName); *************** *** 296,302 **** rootDir->tn = root; rootDir->detail = -1; rootDir->sortmode = -1; ! AllocNameSpace(&rootDir->path,RootPath); bush_ScanDir(self,root); DirMode(root).selected = TRUE; } --- 288,294 ---- rootDir->tn = root; rootDir->detail = -1; rootDir->sortmode = -1; ! AllocNameSpace(RootPath,&rootDir->path); bush_ScanDir(self,root); DirMode(root).selected = TRUE; } *************** *** 388,395 **** if(pw = (struct passwd *) getcpwuid(uid,cell)) { item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; ! AllocNameSpace(&item->uname,pw->pw_name); ! AllocNameSpace(&item->ucell,cell); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } --- 380,387 ---- if(pw = (struct passwd *) getcpwuid(uid,cell)) { item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; ! AllocNameSpace(pw->pw_name,&item->uname); ! AllocNameSpace(cell,&item->ucell); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } *************** *** 399,406 **** item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; sprintf(uid_str,"%u@%s",uid,cell); ! AllocNameSpace(&item->uname,uid_str); ! AllocNameSpace(&item->ucell,cell); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } --- 391,398 ---- item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; sprintf(uid_str,"%u@%s",uid,cell); ! AllocNameSpace(uid_str,&item->uname); ! AllocNameSpace(cell,&item->ucell); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } *************** *** 417,424 **** if(pw = getpwuid(uid)) { item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; ! AllocNameSpace(&item->uname,pw->pw_name); ! AllocNameSpace(&item->ucell,""); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } --- 409,416 ---- if(pw = getpwuid(uid)) { item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; ! AllocNameSpace(pw->pw_name,&item->uname); ! AllocNameSpace("",&item->ucell); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } *************** *** 428,435 **** item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; sprintf(uid_str,"%u",uid); ! AllocNameSpace(&item->uname,uid_str); ! AllocNameSpace(&item->ucell,""); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } --- 420,427 ---- item = (struct map_item*)calloc(1,sizeof(struct map_item)); item->uid = uid; sprintf(uid_str,"%u",uid); ! AllocNameSpace(uid_str,&item->uname); ! AllocNameSpace("",&item->ucell); vector_AddItem(UidUnameMap,(long)item); uname = item->uname; } *************** *** 446,457 **** register long i = 0, status = ok, count = 0; register char *ptr = NULL; struct direct **anchor = NULL; ! struct stat stats; ! int alphasort(); ! char fullEntryName[MAXPATHLEN+25]; IN(bush_ScanDir); if(!tn) return (scan_failure); if(stat(DirPath(tn),&stats)) { status = scan_failure; DirMode(tn).stat_failed = TRUE; --- 438,452 ---- register long i = 0, status = ok, count = 0; register char *ptr = NULL; struct direct **anchor = NULL; ! struct stat stats, lstats; ! int alphasort(), cc = 0; ! char fullEntryName[MAXPATHLEN+25], buf[MAXPATHLEN]; ! char workingDir[MAXPATHLEN]; IN(bush_ScanDir); if(!tn) return (scan_failure); + getwd(workingDir); + chdir(DirPath(tn)); if(stat(DirPath(tn),&stats)) { status = scan_failure; DirMode(tn).stat_failed = TRUE; *************** *** 476,482 **** for( i = 0; i < count && status == ok; i++ ) { DirEntry(tn,i) = (struct Dir_Entry*)calloc(1,sizeof(struct Dir_Entry)); DirEntryPos(tn,i) = i; ! AllocNameSpace(&DirEntryName(tn,i),anchor[i]->d_name); ptr = DirEntryName(tn,i); while(*ptr != '\0') { if(!(isascii(*ptr) && isprint(*ptr))) *ptr = '.'; --- 471,477 ---- for( i = 0; i < count && status == ok; i++ ) { DirEntry(tn,i) = (struct Dir_Entry*)calloc(1,sizeof(struct Dir_Entry)); DirEntryPos(tn,i) = i; ! AllocNameSpace(anchor[i]->d_name,&DirEntryName(tn,i)); ptr = DirEntryName(tn,i); while(*ptr != '\0') { if(!(isascii(*ptr) && isprint(*ptr))) *ptr = '.'; *************** *** 483,497 **** ptr++; } sprintf(fullEntryName,"%s/%s",DirPath(tn),anchor[i]->d_name); ! if(stat(fullEntryName,&stats)) DirEntryMode(tn,i).stat_failed = TRUE; else { if((stats.st_mode & S_IFMT) == S_IFDIR) DirEntryType(tn,i).dir = TRUE; ! else if((stats.st_mode & S_IFMT) == S_IFLNK) DirEntryType(tn,i).soft_link = TRUE; else DirEntryType(tn,i).file = TRUE; ! AllocNameSpace(&DirEntryOwner(tn,i), ! getname(self,stats.st_uid,getcell(self,fullEntryName))); DirEntryTimeStamp(tn,i) = stats.st_mtime; DirEntrySize(tn,i) = stats.st_size; DirEntryPerms(tn,i) = stats.st_mode; --- 478,503 ---- ptr++; } sprintf(fullEntryName,"%s/%s",DirPath(tn),anchor[i]->d_name); ! if(lstat(fullEntryName,&stats) < 0) ! DirEntryMode(tn,i).stat_failed = TRUE; else { if((stats.st_mode & S_IFMT) == S_IFDIR) DirEntryType(tn,i).dir = TRUE; ! else if((stats.st_mode & S_IFMT) == S_IFLNK) { DirEntryType(tn,i).soft_link = TRUE; + if(cc = readlink(fullEntryName,buf,MAXPATHLEN)) { + buf[cc] = '\0'; + AllocNameSpace(buf,&DirEntryLinkName(tn,i)); + } + if(lstat(buf,&lstats) >= 0) { + stats = lstats; + if((stats.st_mode & S_IFMT) == S_IFDIR) + DirEntryType(tn,i).dir = TRUE; + else DirEntryType(tn,i).file = TRUE; + } + } else DirEntryType(tn,i).file = TRUE; ! AllocNameSpace(getname(self,stats.st_uid,getcell(self,fullEntryName)),&DirEntryOwner(tn,i)); DirEntryTimeStamp(tn,i) = stats.st_mtime; DirEntrySize(tn,i) = stats.st_size; DirEntryPerms(tn,i) = stats.st_mode; *************** *** 502,507 **** --- 508,514 ---- } if(anchor) free(anchor); DirMode(tn).do_rescan = FALSE; + chdir(workingDir); OUT(bush_ScanDir); return(status); } *************** *** 525,532 **** newDir = (struct Dir_ *) calloc(1,sizeof(struct Dir_)); sprintf(newDirPath,"%s%s%s",DirPath(tn), !strcmp(DirPath(tn),"/") ? "": "/",DirEntryName(tn,i)); ! AllocNameSpace(&newDir->path,newDirPath); ! AllocNameSpace(&newDir->name,DirEntryName(tn,i)); newTreeNode = tree_CreateChildNode(Tree,DirEntryName(tn,i), (char*)newDir,tn); DirSortMode(newTreeNode) = -1; --- 532,539 ---- newDir = (struct Dir_ *) calloc(1,sizeof(struct Dir_)); sprintf(newDirPath,"%s%s%s",DirPath(tn), !strcmp(DirPath(tn),"/") ? "": "/",DirEntryName(tn,i)); ! AllocNameSpace(newDirPath,&newDir->path); ! AllocNameSpace(DirEntryName(tn,i),&newDir->name); newTreeNode = tree_CreateChildNode(Tree,DirEntryName(tn,i), (char*)newDir,tn); DirSortMode(newTreeNode) = -1; *************** *** 553,558 **** --- 560,569 ---- count = DirEntriesCount(tn); while(i < count) { if(DirEntry(tn,i)) { + if(DirEntryLinkName(tn,i)) { + free(DirEntryLinkName(tn,i)); + DirEntryLinkName(tn,i) = NULL; + } if(DirEntryName(tn,i)) { free(DirEntryName(tn,i)); DirEntryName(tn,i) = NULL; *************** *** 668,674 **** sprintf(oldPath,"%s/%s",DirPath(tn),Entry->name); sprintf(newPath,"%s/%s",DirPath(tn),newName ); if((status = rename(oldPath,newPath)) != -1 ) ! AllocNameSpace(&Entry->name,newName); return(status); } --- 679,685 ---- sprintf(oldPath,"%s/%s",DirPath(tn),Entry->name); sprintf(newPath,"%s/%s",DirPath(tn),newName ); if((status = rename(oldPath,newPath)) != -1 ) ! AllocNameSpace(newName,&Entry->name); return(status); } *************** *** 686,696 **** sprintf(newFullName,"%s/%s",newPath,newName); if(status = rename(DirPath(tn),newFullName)) return(status); else { ! AllocNameSpace(&DirPath(tn),newFullName); ! AllocNameSpace(&DirName(tn),newName); for(i=0;imode) DirEntryPos(tn,i) (bush_DirEntry(self,tn,i)->position) DirEntryName(tn,i) (bush_DirEntry(self,tn,i)->name) + DirEntryLinkName(tn,i) (bush_DirEntry(self,tn,i)->link_name) DirEntryType(tn,i) (bush_DirEntry(self,tn,i)->type) DirEntryOwner(tn,i) (bush_DirEntry(self,tn,i)->owner) DirEntryNLinks(tn,i) (bush_DirEntry(self,tn,i)->nlinks) *** atk/bush/bush.h Wed Nov 22 11:52:13 1989 --- atk/bush/bush.h.NEW Tue Mar 20 20:36:59 1990 *************** *** 7,17 **** /* $Source $ */ #ifndef lint ! static char *rcsidbush_h = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/bush/RCS/bush.h,v 1.2 89/09/01 13:30:33 gk5g Exp $"; #endif /* $Log: bush.h,v $ * Revision 1.2 89/09/01 13:30:33 gk5g * Made change from tree_NodeData to tree_NodeDatum. * --- 7,23 ---- /* $Source $ */ #ifndef lint ! static char *rcsidbush_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/bush/RCS/bush.h,v 1.3 90/03/14 15:29:29 gk5g Exp $"; #endif /* $Log: bush.h,v $ + * Revision 1.3 90/03/14 15:29:29 gk5g + * macros for improved readability. + * + * Revision 1.3 90/03/14 14:36:39 gk5g + * Some added macros for improved readability. + * * Revision 1.2 89/09/01 13:30:33 gk5g * Made change from tree_NodeData to tree_NodeDatum. * *************** *** 70,75 **** --- 76,82 ---- #define DirEntryMode(tn,i) (DirEntry(tn,i)->mode) #define DirEntryPos(tn,i) (DirEntry(tn,i)->position) #define DirEntryName(tn,i) (DirEntry(tn,i)->name) + #define DirEntryLinkName(tn,i) (DirEntry(tn,i)->link_name) #define DirEntryType(tn,i) (DirEntry(tn,i)->type) #define DirEntryOwner(tn,i) (DirEntry(tn,i)->owner) #define DirEntryNLinks(tn,i) (DirEntry(tn,i)->nlinks) *** atk/console/Imakefile Wed Nov 22 11:55:26 1989 --- atk/console/Imakefile.NEW Tue Mar 27 12:10:03 1990 *************** *** 6,9 **** SUBDIRS = lib stats cmd consoles fonts doc ! MkdirTarget($(COMMON)/$(DESTDIR)/lib/ $(COMMON)/$(DESTDIR)/lib/consoles) --- 6,9 ---- SUBDIRS = lib stats cmd consoles fonts doc ! MkdirTarget($(DESTDIR)/lib/ $(DESTDIR)/lib/consoles) *** atk/ctext/ctextv.c Wed Nov 22 12:01:05 1989 --- atk/ctext/ctextv.c.NEW Tue Mar 20 20:44:32 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ctext/RCS/ctextv.c,v 2.12 89/06/07 09:52:04 pgc Exp $ */ /* $ACIS:ctextv.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ctext/RCS/ctextv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ctext/RCS/ctextv.c,v 2.12 89/06/07 09:52:04 pgc Exp $"; #endif /* lint */ /* CTextView, a ``c'' mode for BE2. */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ctext/RCS/ctextv.c,v 2.13 90/03/19 17:16:37 gk5g Exp $ */ /* $ACIS:ctextv.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ctext/RCS/ctextv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ctext/RCS/ctextv.c,v 2.13 90/03/19 17:16:37 gk5g Exp $"; #endif /* lint */ /* CTextView, a ``c'' mode for BE2. */ *************** *** 15,21 **** #include #include - #include #include #include --- 15,20 ---- *************** *** 144,153 **** message_DisplayString(self, 0, buffer); } ! else /* if (BounceTime == 0) */ { ! ctextview_SetDotPosition(self, openparen); ! ctextview_SetDotLength(self, start - openparen); ! } /* else Deal with bounce */ } else --- 143,150 ---- message_DisplayString(self, 0, buffer); } ! ctextview_SetDotPosition(self, openparen); ! ctextview_SetDotLength(self, start - openparen); /* else Deal with bounce */ } else *** atk/frame/frame.c Wed Jan 17 16:37:42 1990 --- atk/frame/frame.c.NEW Tue Mar 20 21:07:34 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/frame.c,v 2.13 89/12/12 15:00:36 ghoti Exp $ */ /* $ACIS:frame.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/frame.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/frame.c,v 2.13 89/12/12 15:00:36 ghoti Exp $"; #endif /* lint */ /* frame.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v 2.15 90/03/12 19:27:42 gk5g Exp $ */ /* $ACIS:frame.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v 2.15 90/03/12 19:27:42 gk5g Exp $"; #endif /* lint */ /* frame.c *************** *** 71,76 **** --- 71,77 ---- static int frame_GlobalStackCount = 0; /* a hack to prevent ugly recursion */ static struct keymap *mykm; static struct proctable_Entry *returnconsidered, *cancel, *confirmAnswer, *gotkey; + static boolean QuitWindowOnlyDefault ; static int CalculateLineHeight(self) *************** *** 98,103 **** --- 99,105 ---- struct classheader *classID; struct frame *self; { + extern struct keymap *frame_InitKeymap(); self->buffer = NULL; self->targetView = NULL; *************** *** 109,121 **** self->dialogView = self->dialogLine->messageView; framemessage_SetCompanion(self->messageLine,(struct msghandler *)self->dialogLine); self->title = NULL; ! self->keystate = NULL; ! self->menulist = NULL; self->helpBuffer[0] = '\0'; self->commandEnable = FALSE; self->lineHeight = 0; self->next = allFrames; allFrames = self; self->AwaitingFocus = 0; self->DialogBuffer = NULL; --- 111,127 ---- self->dialogView = self->dialogLine->messageView; framemessage_SetCompanion(self->messageLine,(struct msghandler *)self->dialogLine); self->title = NULL; ! ! frameKeymap = framecmds_InitKeymap(&frameMenus); ! self->keystate = keystate_Create(self, frameKeymap); ! self->menulist = menulist_DuplicateML(frameMenus, self); ! menulist_SetMask(self->menulist,frame_DefaultMenus); self->helpBuffer[0] = '\0'; self->commandEnable = FALSE; self->lineHeight = 0; self->next = allFrames; allFrames = self; + self->QuitWindowOnly = QuitWindowOnlyDefault ; self->AwaitingFocus = 0; self->DialogBuffer = NULL; *************** *** 421,427 **** view_PostMenus(self->header.view.parent, self->mymenus); } } ! else if (self->commandEnable && ((menulist == NULL) || (menulist->object != (struct basicobject *) self->messageView))) { menulist_ClearChain(self->menulist); menulist_ChainBeforeML(self->menulist, menulist, menulist); view_PostMenus(self->header.view.parent, self->menulist); --- 427,433 ---- view_PostMenus(self->header.view.parent, self->mymenus); } } ! else if ((menulist == NULL) || (menulist->object != (struct basicobject *) self->messageView)) { menulist_ClearChain(self->menulist); menulist_ChainBeforeML(self->menulist, menulist, menulist); view_PostMenus(self->header.view.parent, self->menulist); *************** *** 436,453 **** { if ((self->commandEnable = enable) == TRUE) { ! if (frameKeymap == NULL) { ! ! extern struct keymap *frame_InitKeymap(); ! ! frameKeymap = framecmds_InitKeymap(&frameMenus); ! } ! ! if (self->keystate == NULL) ! self->keystate = keystate_Create(self, frameKeymap); ! if (self->menulist == NULL) ! self->menulist = menulist_DuplicateML(frameMenus, self); } } struct buffer *frame__GetHelpBuffer(self) --- 442,453 ---- { if ((self->commandEnable = enable) == TRUE) { ! menulist_SetMask(self->menulist,menulist_GetMask(self->menulist) | ! frame_BufferMenus); } + else + menulist_SetMask(self->menulist,menulist_GetMask(self->menulist) & + ~frame_BufferMenus); } struct buffer *frame__GetHelpBuffer(self) *************** *** 1336,1340 **** --- 1336,1341 ---- } keymap_BindToKey(mykm, "\007", cancel, 0); keymap_BindToKey(mykm, "\015", confirmAnswer, 0); + QuitWindowOnlyDefault = environ_GetProfileSwitch("QuitWindowOnly", FALSE); return TRUE; } *** atk/frame/frame.ch Wed Nov 22 12:13:21 1989 --- atk/frame/frame.ch.NEW Tue Mar 20 21:07:37 1990 *************** *** 2,19 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/frame.ch,v 2.7 89/04/16 22:02:04 zs01 Exp $ */ /* $ACIS:frame.ch 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/frame.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidframe_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/frame.ch,v 2.7 89/04/16 22:02:04 zs01 Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* frame.H * Class definition for frame module. * ! * $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/frame.ch,v 2.7 89/04/16 22:02:04 zs01 Exp $ * $ACIS:frame.ch 1.5$ * */ --- 2,19 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.ch,v 2.9 90/03/12 19:25:50 gk5g Exp $ */ /* $ACIS:frame.ch 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidframe_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.ch,v 2.9 90/03/12 19:25:50 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* frame.H * Class definition for frame module. * ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.ch,v 2.9 90/03/12 19:25:50 gk5g Exp $ * $ACIS:frame.ch 1.5$ * */ *************** *** 22,37 **** #define frame_MUSTANSWER -1 #include #include - #define frame_GetView(frame) (frame->targetView) - #define frame_GetChildView(frame) (frame->childView) - #define frame_GetBuffer(frame) (frame->buffer) - #define frame_GetCommandEnable(frame) (frame->commandEnable) - #define frame_GetTitle(frame) (frame->title) - class frame: lpair { methods: SetView(struct view *view); --- 22,35 ---- #define frame_MUSTANSWER -1 + #define frame_DefaultMenus (1<<13) + #define frame_BufferMenus (1<<12) + + #include #include class frame: lpair { methods: SetView(struct view *view); *************** *** 46,51 **** --- 44,57 ---- AskForStringCompleted(int priority, char *prompt, char *defaultString, char *buffer, int bufferSize, struct keystate *keystate, procedure completionProc, procedure helpProc, long functionData, int flags) returns int; MultipleChoiceQuestion(int priority, char *prompt, long defaultChoice, long *result, char **choices, char *abbrevKeys) returns int; + macromethods: + GetView() ((self)->targetView) + GetChildView() ((self)->childView) + GetBuffer() ((self)->buffer) + GetCommandEnable() ((self)->commandEnable) + GetTitle() ((self)->title) + GetQuitWindowFlag() ((self)->QuitWindowOnly) + SetQuitWindowFlag(VAL) (((self)->QuitWindowOnly) = VAL) classprocedures: InitializeObject(struct frame *self) returns boolean; *************** *** 105,108 **** --- 111,115 ---- buttonmaxwid; struct dataobject *object; boolean dataModified; + boolean QuitWindowOnly; }; *** atk/frame/frame.doc Wed Nov 22 12:13:19 1989 --- atk/frame/frame.doc.NEW Tue Apr 3 11:18:44 1990 *************** *** 1,4 **** ! \begindata{text,269962044} \textdsversion{12} \template{be2guide} \define{underline --- 1,4 ---- ! \begindata{text,268706304} \textdsversion{12} \template{be2guide} \define{underline *************** *** 42,49 **** \bold{Return value.} Pointer to the newly created instance. ! \bold{Usage.} You should not need to call this procedure directly; instead, ! you should use \italic{frame_Create} to create a new frame. } --- 42,61 ---- \bold{Return value.} Pointer to the newly created instance. ! \bold{Usage.} If you are going to associate a view with a frame you should ! use frame_New. If you are going to associate a buffer with a frame you should ! use frame_Create. If you do use frame_New there are some other steps that you ! need to take in addition to linking the frame to its subview (see ! frame_SetView) and to its parent interaction manager (see im_SetView). You ! must post the default handler for this frame (see view_PostDefaultHandler) so ! that the message package knows what msghandler to use for interacting with the ! user (default msghandler is "message"). As well, if your application will map ! multiple windows (interaction managers) and you do not override frame's Quit ! menu, you may want to specify how frame_Exit operates. Use ! frame_SetQuitWindowFlag to specify that only the window whose Quit menu was ! chosen is to be destroyed. If QuitWindowFlag is FALSE, the process will exit. ! If QuitWindowFlag is TRUE, only the window whose Quit menu was chosen will be ! destroyed. } *************** *** 63,74 **** \bold{Usage.} If the application is using the buffer package, this call would ! be made to associate a buffer with a frame The buffer contains a pointer to a ! data object and a list of views on that data object. This method will get a ! handle on one of those views and cause it to be displayed as the subview of ! the frame. - } \paragraph{Applying a function to a frame}\indexi{Frame++Applying functions} \indexi{ \italic{frame_Enumerate}} --- 75,85 ---- \bold{Usage.} If the application is using the buffer package, this call would ! be made to associate a buffer with a frame. The buffer package provides a set ! of routines to manage a set of views corresponding to a set of data objects. ! This method will get a handle on one of those views and cause it to be ! displayed as the subview of the frame. } \paragraph{Applying a function to a frame}\indexi{Frame++Applying functions} \indexi{ \italic{frame_Enumerate}} *************** *** 81,99 **** \leftindent{\bold{Method description. } \italic{frame_Enumerate} iterates a ! function over all frames. \italic{functionData} is data to be passed to the ! function. The enumeration will continue as long as \italic{mapFunction} ! returns FALSE. If \italic{mapFunction} returns TRUE the Enumeration method ! will return the associate frame. If no calls to \italic{mapFunction} returns ! TRUE then the Enumerate method will return NULL. ! \bold{Return value.} A pointer to the frame. } ! \begindata{bp,269952744} ! \enddata{bp,269952744} ! \view{bpv,269952744,88,0,0} \subsection{Managing frames} --- 92,111 ---- \leftindent{\bold{Method description. } \italic{frame_Enumerate} iterates a ! function over all frames within a given process. \italic{functionData} is ! data to be passed to the function. The enumeration will continue as long as ! \italic{mapFunction} returns FALSE. If \italic{mapFunction} returns TRUE the ! Enumeration method will return the associate frame. If no calls to ! \italic{mapFunction} returns TRUE then the Enumerate method will return NULL. ! \bold{Return value.} A pointer to the frame where mapFunction returns TRUE or ! NULL if no call to mapFunction return TRUE. } ! \begindata{bp,268671648} ! \enddata{bp,268671648} ! \view{bpv,268671648,0,0,0} \subsection{Managing frames} *************** *** 114,120 **** \bold{Usage.} If you are using a frame but are not using the buffer package, ! this method is used to place a view into a frame. } --- 126,132 ---- \bold{Usage.} If you are using a frame but are not using the buffer package, ! this method is used to place a view into a frame (see frame_New). } *************** *** 132,140 **** \leftindent{\bold{Method description. } \italic{frame_SetBuffer} sets the ! subview for \italic{frame} to be a view corresponding to \italic{buffer}. If ! \italic{setInputFocus} is set to TRUE then this method passes the input focus ! to one of the descendants of the view. \bold{Usage.} This method is used when an application is using the buffer --- 144,152 ---- \leftindent{\bold{Method description. } \italic{frame_SetBuffer} sets the ! subview for \italic{frame} to be one of the views managed by \italic{buffer}. ! If \italic{setInputFocus} is set to TRUE then this method passes the input ! focus to one of the descendants of the view. \bold{Usage.} This method is used when an application is using the buffer *************** *** 155,162 **** \leftindent{\bold{Method description. } \italic{frame_SetCommandEnable} enables/disables command interaction with the frame. The frame provides a number of commands that are used for handling files, deleting windows, etc. ! These are usable when the using frames in conjunction with the buffer ! package. } --- 167,174 ---- \leftindent{\bold{Method description. } \italic{frame_SetCommandEnable} enables/disables command interaction with the frame. The frame provides a number of commands that are used for handling files, deleting windows, etc. ! These commands are automatically enabled when using frames in conjunction ! with the buffer package. } *************** *** 175,178 **** window containing the frame.} ! \enddata{text,269962044} --- 187,190 ---- window containing the frame.} ! \enddata{text,268706304} *** atk/frame/framecmd.c Mon Mar 12 13:15:54 1990 --- atk/frame/framecmd.c.NEW Mon Mar 26 12:12:35 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/framecmd.c,v 2.34 90/02/14 17:29:54 gk5g Exp $ */ /* $ACIS:framecmd.c 1.3$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/framecmd.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/framecmd.c,v 2.34 90/02/14 17:29:54 gk5g Exp $"; #endif /* lint */ /* framecmd.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v 2.37 90/03/23 15:35:33 gk5g Exp $ */ /* $ACIS:framecmd.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v 2.37 90/03/23 15:35:33 gk5g Exp $"; #endif /* lint */ /* framecmd.c *************** *** 627,638 **** struct frame *self; { long count = 0; - extern struct frame * frame__Enumerate(); /* BOGUS!!! */ frame_Enumerate(countFrames, &count); if (count > 1) { ! im_Destroy(frame_GetIM( self)); frame_Destroy(self); } else { long answer; --- 627,639 ---- struct frame *self; { long count = 0; frame_Enumerate(countFrames, &count); if (count > 1) { ! struct im *im = frame_GetIM( self); ! frame_UnlinkTree(self); frame_Destroy(self); + im_Destroy(im); } else { long answer; *************** *** 664,670 **** void frame_Exit(self) struct frame *self; { ! if (im_KeyboardLevel() == 1) { if (!preventBufferLossage(self, NULL)) { message_DisplayString(self, 0, "Exit aborted."); return; --- 665,682 ---- void frame_Exit(self) struct frame *self; { ! if(frame_GetQuitWindowFlag(self)) { ! long count = 0; ! frame_Enumerate(countFrames, &count); ! if (count > 1) { /* if more than one window, don't quit */ ! struct im *im = frame_GetIM(self); ! frame_UnlinkTree(self); ! frame_Destroy(self); ! im_Destroy(im); ! return; ! } ! } ! if (self->buffer && im_KeyboardLevel() == 1) { if (!preventBufferLossage(self, NULL)) { message_DisplayString(self, 0, "Exit aborted."); return; *************** *** 1593,1670 **** /* the functions called by these first few check their second argument. If it is a pointer, it is assumed to point to a character string and is used instead of prompting the user. */ ! {"frame-change-directory", "\033c",0, NULL,0,0, (void (*)())frame_cd, "Change current working directory."}, ! {"frame-visit-file", "\030\026",0, NULL,0,0, (void (*)())frame_VisitFile, "Prompts for a file to visit."}, ! {"frame-visit-file-new-window", NULL,0, NULL,0,0, (void (*)())frame_VisitFileNewWindow, "Prompts for a file to visit. Creates a new window for it."}, /* end of functions that check their second arg */ ! {"frame-recursive-visit-file", "\030\024",0, NULL,0,0, frame_RecursiveVisitFile, "Visit file saving current buffer state."}, ! {"frame-recursive-edit", NULL,0, NULL,0,0, frame_RecursiveEdit, "Enter a recursive edit."}, ! {"frame-exit-recursive-edit", "\003",0, NULL,0,0, frame_ExitRecursiveEdit, "Exit after frame-recursive-edit or frame-recursive-visit-file"}, ! {"frame-delete-window", "\030\004",0, "Delete Window~89",0,0, ! frame_DeleteWindow, "Delete the window in which command is executed."}, ! {"frame-exit", "\030\003",0, "Quit~99",0,0, ! frame_Exit, ! "Exit editor. If any buffer is modified ask for confirmation."}, ! {"frame-current-directory", "\033p",0, NULL,0,0, (void (*)())frame_pwd, "Show current working directory."}, ! {"frame-new-window", "\0302",0, NULL,0,0, frame_NewWindow, "Creates a new window."}, ! {"frame-delete-buffer", "\030k",0, NULL,0,0, frame_DeleteBuffer, "Prompts for a buffer to delete."}, ! {"frame-old-buffer", "\030\017",0, NULL,0,0, frame_OldBuffer, "Visits an already existing buffer."}, ! {"frame-visit-buffer", "\030b",0, NULL,0,0, frame_VisitBuffer, "Changes to an arbitrarily named buffer."}, ! {"frame-list-buffers", "\030\002",0, NULL,0,0, frame_ListBuffers, "Lists current buffers."}, ! {"frame-switch-file", "\030\022",0, "Switch File~30",0,0, (void (*)())frame_SwitchFile, "Switches to editing another buffer."}, ! {"frame-read-file", NULL,0, NULL,0,0, (void (*)())frame_ReadFile, "Reads a file into the current buffer."}, ! {"frame-save-file", "\030\023",0, "Save~20",0,0, (void (*)())frame_SaveFile, "Saves buffer into its current file."}, ! {"frame-write-file", "\030\027",0, "File~10,Save As~1",0,0, ! (void (*)())frame_WriteFile, "Prompts for a file to save the current buffer in."}, ! {"frame-save-all-files", "\030\015",0, "File~10,Save All~2",0,0, ! frame_SaveAll, "Saves all files."}, ! {"frame-set-printer", NULL,0, "File~10,Set Printer~20",0,0, ! frame_SetPrinter, "Set the printer for the print command to spool to."}, ! {"frame-preview", NULL,0, "File~10,Preview~21",0,0, ! frame_PreviewCmd, "Previews document."}, ! {"frame-print", NULL,0, "File~10,Print~22",0,0, ! frame_PrintCmd, "Prints document."}, ! {"frame-previous-window", NULL,0, NULL,0,0, frame_PreviousWindow, "Moves the input focus to the \"previous\" window."}, ! {"frame-next-window", NULL,0, NULL,0,0, frame_NextWindow, "Moves the input focus to the \"next\" window."}, ! {"frame-set-buffer-modified", NULL,0, NULL,0,0, frame_SetBufferModified, "Sets buffer to be unmodified, unless given a prefix argument, in which case it sets the buffer to be modified."}, ! {"frame-hide-window", NULL,0, NULL,0,0, frame_HideWindow, "Hides the window this command is executed in."}, ! {"frame-expose-window", NULL,0, NULL,0,0, frame_ExposeWindow, "Exposes the window this command is executed in."}, ! {"frame-single-window", NULL,0, NULL,0,0, frame_SingleWindow, "Hides all other windows and expands the current window."}, NULL --- 1605,1682 ---- /* the functions called by these first few check their second argument. If it is a pointer, it is assumed to point to a character string and is used instead of prompting the user. */ ! {"frame-change-directory", "\033c",0, NULL,0,frame_BufferMenus, (void (*)())frame_cd, "Change current working directory."}, ! {"frame-visit-file", "\030\026",0, NULL,0,frame_BufferMenus, (void (*)())frame_VisitFile, "Prompts for a file to visit."}, ! {"frame-visit-file-new-window", NULL,0, NULL,0,frame_BufferMenus, (void (*)())frame_VisitFileNewWindow, "Prompts for a file to visit. Creates a new window for it."}, /* end of functions that check their second arg */ ! {"frame-recursive-visit-file", "\030\024",0, NULL,0,frame_BufferMenus, frame_RecursiveVisitFile, "Visit file saving current buffer state."}, ! {"frame-recursive-edit", NULL,0, NULL,0,frame_BufferMenus, frame_RecursiveEdit, "Enter a recursive edit."}, ! {"frame-exit-recursive-edit", "\003",0, NULL,0,frame_BufferMenus, frame_ExitRecursiveEdit, "Exit after frame-recursive-edit or frame-recursive-visit-file"}, ! {"frame-delete-window", "\030\004",0, "Delete Window~89",0, ! frame_BufferMenus, frame_DeleteWindow, "Delete the window in which command is executed."}, ! {"frame-exit", "\030\003",0, "Quit~99",0, ! frame_DefaultMenus, frame_Exit, ! "Exit editor. If any buffer is modified ask for confirmation."}, ! {"frame-current-directory", "\033p",0, NULL,0,frame_BufferMenus, (void (*)())frame_pwd, "Show current working directory."}, ! {"frame-new-window", "\0302",0, NULL,0,frame_BufferMenus, frame_NewWindow, "Creates a new window."}, ! {"frame-delete-buffer", "\030k",0, NULL,0,frame_BufferMenus, frame_DeleteBuffer, "Prompts for a buffer to delete."}, ! {"frame-old-buffer", "\030\017",0, NULL,0,frame_BufferMenus, frame_OldBuffer, "Visits an already existing buffer."}, ! {"frame-visit-buffer", "\030b",0, NULL,0,frame_BufferMenus, frame_VisitBuffer, "Changes to an arbitrarily named buffer."}, ! {"frame-list-buffers", "\030\002",0, NULL,0,frame_BufferMenus, frame_ListBuffers, "Lists current buffers."}, ! {"frame-switch-file", "\030\022",0, "Switch File~30",0,frame_BufferMenus, (void (*)())frame_SwitchFile, "Switches to editing another buffer."}, ! {"frame-read-file", NULL,0, NULL,0,frame_BufferMenus, (void (*)())frame_ReadFile, "Reads a file into the current buffer."}, ! {"frame-save-file", "\030\023",0, "Save~20",0,frame_BufferMenus, (void (*)())frame_SaveFile, "Saves buffer into its current file."}, ! {"frame-write-file", "\030\027",0, "File~10,Save As~1",0, ! frame_BufferMenus, (void (*)())frame_WriteFile, "Prompts for a file to save the current buffer in."}, ! {"frame-save-all-files", "\030\015",0, "File~10,Save All~2",0, ! frame_BufferMenus, frame_SaveAll, "Saves all files."}, ! {"frame-set-printer", NULL,0, "File~10,Set Printer~20",0, ! frame_BufferMenus, frame_SetPrinter, "Set the printer for the print command to spool to."}, ! {"frame-preview", NULL,0, "File~10,Preview~21",0, ! frame_BufferMenus, frame_PreviewCmd, "Previews document."}, ! {"frame-print", NULL,0, "File~10,Print~22",0, ! frame_BufferMenus, frame_PrintCmd, "Prints document."}, ! {"frame-previous-window", NULL,0, NULL,0,frame_BufferMenus, frame_PreviousWindow, "Moves the input focus to the \"previous\" window."}, ! {"frame-next-window", NULL,0, NULL,0,frame_BufferMenus, frame_NextWindow, "Moves the input focus to the \"next\" window."}, ! {"frame-set-buffer-modified", NULL,0, NULL,0,frame_BufferMenus, frame_SetBufferModified, "Sets buffer to be unmodified, unless given a prefix argument, in which case it sets the buffer to be modified."}, ! {"frame-hide-window", NULL,0, NULL,0,frame_BufferMenus, frame_HideWindow, "Hides the window this command is executed in."}, ! {"frame-expose-window", NULL,0, NULL,0,frame_BufferMenus, frame_ExposeWindow, "Exposes the window this command is executed in."}, ! {"frame-single-window", NULL,0, NULL,0,frame_BufferMenus, frame_SingleWindow, "Hides all other windows and expands the current window."}, NULL *** atk/frame/framemsg.c Wed Nov 22 12:13:40 1989 --- atk/frame/framemsg.c.NEW Tue Apr 3 11:18:48 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/framemsg.c,v 1.7 89/11/01 16:34:59 tpn Exp $ */ /* $ACIS:framemsg.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/framemsg.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/frame/RCS/framemsg.c,v 1.7 89/11/01 16:34:59 tpn Exp $"; #endif /* lint */ /* framemsg.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framemsg.c,v 1.8 90/04/02 14:16:53 tpn Exp $ */ /* $ACIS:framemsg.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framemsg.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framemsg.c,v 1.8 90/04/02 14:16:53 tpn Exp $"; #endif /* lint */ /* framemsg.c *************** *** 129,134 **** --- 129,136 ---- 0, "[ ] ", 5); text_AlwaysInsertCharacters(self->messageText, 2, string, len); len += 5; + if(text_GetFence(self->messageText) == 0) + text_SetFence(self->messageText,len); }else text_AlwaysDeleteCharacters(self->messageText, 0,self->messageLen); *** atk/frame/framev.c Mon Mar 12 13:15:57 1990 --- atk/frame/framev.c.NEW Tue Apr 3 11:18:51 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/framev.c,v 2.12 89/10/16 12:03:18 ajp Exp $ */ /* $ACIS:framev.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/framev.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/frame/RCS/framev.c,v 2.12 89/10/16 12:03:18 ajp Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v 2.14 90/04/02 14:40:21 tpn Exp $ */ /* $ACIS:framev.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v 2.14 90/04/02 14:40:21 tpn Exp $"; #endif /* lint */ #include *************** *** 309,322 **** { register struct framemessage *messageLine = self->messageLine; enum message_CompletionCode code; if (mark_GetLength(self->transientMark) != 0) CleanMessageState(self); if (messageLine->completionProc != NULL) { - int len, startpos = text_GetFence(Text(self)), - endpos = text_GetLength(Text(self)); - framemessage_GetCurrentString(messageLine, messageLine->textBuffer, messageLine->maxTextSize); --- 309,320 ---- { register struct framemessage *messageLine = self->messageLine; enum message_CompletionCode code; + int len, startpos, endpos; if (mark_GetLength(self->transientMark) != 0) CleanMessageState(self); if (messageLine->completionProc != NULL) { framemessage_GetCurrentString(messageLine, messageLine->textBuffer, messageLine->maxTextSize); *************** *** 326,332 **** if ((code != message_Invalid) || (self->messageLine->flags & message_MustMatch)) { ! text_AlwaysDeleteCharacters(Text(self), startpos, endpos - startpos); len = strlen(messageLine->textBuffer); text_AlwaysInsertCharacters(Text(self), startpos, messageLine->textBuffer, len); --- 324,332 ---- if ((code != message_Invalid) || (self->messageLine->flags & message_MustMatch)) { ! startpos = text_GetFence(Text(self)); ! endpos = text_GetLength(Text(self)); ! text_AlwaysDeleteCharacters(Text(self), startpos, endpos - startpos); len = strlen(messageLine->textBuffer); text_AlwaysInsertCharacters(Text(self), startpos, messageLine->textBuffer, len); *************** *** 539,544 **** --- 539,551 ---- {NULL, NULL, 0, "Search/Spell,Search Again"}, {NULL, NULL, 0, "Search/Spell,Query Replace"}, {NULL, NULL, 0, "Search/Spell,Check Spelling"}, + {NULL, NULL, 0, "Page,Insert Pagebreak"}, + {NULL, NULL, 0, "Page,Next Page"}, + {NULL, NULL, 0, "Page,Previous Page"}, + {NULL, NULL, 0, "Page,Insert Footnote"}, + {NULL, NULL, 0, "Page,Open Footnotes"}, + {NULL, NULL, 0, "Page,Close Footnotes"}, + {NULL, NULL, 0, "Page,Table of Contents"}, NULL }; *** atk/help/maint/mkindex.c Wed Nov 22 12:15:06 1989 --- atk/help/maint/mkindex.c.NEW Mon Mar 26 12:12:50 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/maint/RCS/mkindex.c,v 2.20 89/10/21 13:03:39 pgc Exp $ */ /* $ACIS:mkindex.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/maint/RCS/mkindex.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/maint/RCS/mkindex.c,v 2.20 89/10/21 13:03:39 pgc Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define FSSIZE 32 /* max number of files */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/maint/RCS/mkindex.c,v 2.20 89/10/21 13:03:39 pgc Exp Locker: gk5g $ */ /* $ACIS:mkindex.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/maint/RCS/mkindex.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/maint/RCS/mkindex.c,v 2.20 89/10/21 13:03:39 pgc Exp Locker: gk5g $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define FSSIZE 32 /* max number of files */ *** atk/lookz/lookzv.c Wed Nov 22 12:15:41 1989 --- atk/lookz/lookzv.c.NEW Tue Mar 20 21:11:18 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lookz/RCS/lookzv.c,v 2.15 89/11/12 13:16:52 jhh Exp $ */ /* $ACIS:lookzv.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lookz/RCS/lookzv.c,v $ */ #ifndef lint ! char *lookzv_rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lookz/RCS/lookzv.c,v 2.15 89/11/12 13:16:52 jhh Exp $"; #endif /* lint */ /* lookzv.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lookz/RCS/lookzv.c,v 2.16 90/03/05 16:54:33 gk5g Exp $ */ /* $ACIS:lookzv.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lookz/RCS/lookzv.c,v $ */ #ifndef lint ! char *lookzv_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lookz/RCS/lookzv.c,v 2.16 90/03/05 16:54:33 gk5g Exp $"; #endif /* lint */ /* lookzv.c *************** *** 168,173 **** --- 168,174 ---- struct strTbl SubScrNames[] = { {"up 15", -15}, {"super (up 6)", -6}, + {"super (up 2)", -2}, {"up 4", -4}, {"up 2", -2}, {"sub (down 2)", 2}, *** atk/lset/celv.c Wed Nov 22 12:16:26 1989 --- atk/lset/celv.c.NEW Tue Apr 3 11:19:18 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/celv.c,v 2.22 89/11/14 14:21:20 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/celv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/celv.c,v 2.22 89/11/14 14:21:20 tpn Exp $ "; #endif /* lint */ #define UNSET 0 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v 2.23 90/04/03 11:20:36 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v 2.23 90/04/03 11:20:36 gk5g Exp $ "; #endif /* lint */ #define UNSET 0 *************** *** 581,601 **** self->enclosingRect.top = 0; self->enclosingRect.left = 0; self->enclosingRect.width = celview_GetLogicalWidth(self) ; self->enclosingRect.height = celview_GetLogicalHeight(self) ; ! /* if(DOINDENT(self)){ */ ! (self->enclosingRect.width)--; ! (self->enclosingRect.height)--; ! /* } */ ! UpdateCursors(self); ! if(type != view_MoveNoRedraw){ ! celview_SetTransferMode(self,graphic_WHITE); ! celview_EraseRect(self,&(self->enclosingRect)); ! celview_SetTransferMode(self,graphic_INVERT); ! if(self->drawing){ ! celview_DrawRect(self,&(self->enclosingRect)); ! } } ! /* UpdateDrawing(self); */ self->OldMode = self->drawing; /* self->childRect = self->enclosingRect; */ celview_GetLogicalBounds(self,&(self->childRect)); --- 581,603 ---- self->enclosingRect.top = 0; self->enclosingRect.left = 0; self->enclosingRect.width = celview_GetLogicalWidth(self) ; self->enclosingRect.height = celview_GetLogicalHeight(self) ; ! /* if(DOINDENT(self)){ */ ! (self->enclosingRect.width)--; ! (self->enclosingRect.height)--; ! /* } */ ! if(type != view_Remove) { ! UpdateCursors(self); ! if(type != view_MoveNoRedraw ){ ! celview_SetTransferMode(self,graphic_WHITE); ! celview_EraseRect(self,&(self->enclosingRect)); ! celview_SetTransferMode(self,graphic_INVERT); ! if(self->drawing){ ! celview_DrawRect(self,&(self->enclosingRect)); ! } ! } } ! /* UpdateDrawing(self); */ self->OldMode = self->drawing; /* self->childRect = self->enclosingRect; */ celview_GetLogicalBounds(self,&(self->childRect)); *** atk/lset/lsetv.c Wed Nov 22 12:16:41 1989 --- atk/lset/lsetv.c.NEW Tue Apr 3 11:19:24 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/lsetv.c,v 2.7 89/08/01 10:39:40 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/lsetv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/lsetv.c,v 2.7 89/08/01 10:39:40 tpn Exp $ "; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v 2.8 90/03/23 17:16:21 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v 2.8 90/03/23 17:16:21 tpn Exp $ "; #endif /* lint */ *************** *** 423,430 **** view_RetractViewCursors(self->app,self->app); view_DesiredSize(self->app,rr.width,rr.height,view_NoSet,&foo1,&foo2); view_FullUpdate(self->app, view_FullRedraw,0,0,0,0); ! if(self->mode == lsetview_FirstUpdate && ls->application == CEL) view_WantInputFocus(self->app,self->app); self->mode = lsetview_HasView; return; } --- 423,433 ---- view_RetractViewCursors(self->app,self->app); view_DesiredSize(self->app,rr.width,rr.height,view_NoSet,&foo1,&foo2); view_FullUpdate(self->app, view_FullRedraw,0,0,0,0); ! ! if(self->mode == lsetview_FirstUpdate && ls->application == CEL && ! self->HasFocus) view_WantInputFocus(self->app,self->app); + self->mode = lsetview_HasView; return; } *** atk/ness/objects/interp.c Wed Jan 17 16:38:09 1990 --- atk/ness/objects/interp.c.NEW Mon Mar 26 12:13:20 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/objects/RCS/interp.c,v 1.28 89/11/21 11:56:33 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/objects/RCS/interp.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/objects/RCS/interp.c,v 1.28 89/11/21 11:56:33 wjh Exp $"; #endif /* interp.c --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v 1.29 90/03/22 11:08:27 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v 1.29 90/03/22 11:08:27 wjh Exp $"; #endif /* interp.c *************** *** 21,26 **** --- 21,29 ---- /* * $Log: interp.c,v $ + * Revision 1.29 90/03/22 11:08:27 wjh + * Fix "Disasterous Ness error" introduced by earlier fix of core leak. (nessmarks were being deleted as part of returning a nessmark value if another marker to the same text was in the variables of the function returning the value.) + * * Revision 1.28 89/11/21 11:56:33 wjh * Correct the decision in writefile() of whether and what template to use. * This fixes the bug in files written by gendoc. They were getting style menus for only *************** *** 1299,1306 **** if (tsp->l.hdr == nessmarkHdr) { ismark = TRUE; eltsize = sizeof(struct nessmark); - oldtext = nessmark_GetText(&tsp->m); - nessmark_DetachFromText(&tsp->m); } else /* ERROR - unknown value type; return 0 */ --- 1302,1307 ---- *************** *** 1326,1332 **** because it fits in the instruction cache */ while (src > (unsigned long *)tsp) *--dest = *--src; ! if (ismark) nessmark_AttachToText(&NSP->m, oldtext); } else { /* unknown type, push 0L */ --- 1327,1337 ---- because it fits in the instruction cache */ while (src > (unsigned long *)tsp) *--dest = *--src; ! if (ismark) { ! oldtext = nessmark_GetText(&tsp->m); ! nessmark_DetachFromText(&tsp->m); ! nessmark_AttachToText(&NSP->m, oldtext); ! } } else { /* unknown type, push 0L */ *** atk/ness/objects/nessv.c Wed Nov 22 12:21:55 1989 --- atk/ness/objects/nessv.c.NEW Tue Apr 3 11:19:53 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/nessv.c,v 1.14 89/11/04 17:26:13 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/nessv.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/nessv.c,v 1.14 89/11/04 17:26:13 wjh Exp $"; #endif /* nessview.c --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessv.c,v 1.15 90/03/27 17:14:53 gk5g Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessv.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessv.c,v 1.15 90/03/27 17:14:53 gk5g Exp $"; #endif /* nessview.c *************** *** 17,22 **** --- 17,25 ---- /* * $Log: nessv.c,v $ + * Revision 1.15 90/03/27 17:14:53 gk5g + * Changed all calls to event_Enqueue to im_EnqueueEvent. The former did not increment im's eventCount and therefore some of these events were not processed correctly. + * * Revision 1.14 89/11/04 17:26:13 wjh * patch from Guy Harris to ness.c: * Do initializeEnvt() in ness_EstablishViews() to be sure the pointers are initialized. This avoids "!!! Disasterous error..." *************** *** 898,904 **** if (dobj != NULL && ! dobj->hasWarningText && dobj->DisplayDialogBox) { ! event_Enqueue(event_Now(), DisplayDialogBox, self); /* reverse video while dialog box is up */ self->inverted = TRUE; --- 901,907 ---- if (dobj != NULL && ! dobj->hasWarningText && dobj->DisplayDialogBox) { ! im_EnqueueEvent(DisplayDialogBox, self, 0); /* reverse video while dialog box is up */ self->inverted = TRUE; *************** *** 992,1002 **** if (numberOfClicks == 1) switch (self->ButtonPending) { ! case 1: event_Enqueue(event_Now(), ScanButton, self); break; case 2: AuthorButton(self, 0); break; ! case 3: event_Enqueue(event_Now(), CompileButton, self); break; case 4: DeauthButton(self); break; --- 995,1005 ---- if (numberOfClicks == 1) switch (self->ButtonPending) { ! case 1: im_EnqueueEvent(ScanButton, self, 0); break; case 2: AuthorButton(self, 0); break; ! case 3: im_EnqueueEvent(CompileButton, self, 0); break; case 4: DeauthButton(self); break; *** atk/org/Imakefile Wed Nov 22 12:23:50 1989 --- atk/org/Imakefile.NEW Tue Mar 20 21:21:45 1990 *************** *** 3,12 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ DOBJS = org.do \ ! orgv.do \ ! orga.do ! IHFILES = org.ih orgv.ih orga.ih NormalObjectRule() NormalATKRule() --- 3,11 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ DOBJS = org.do \ ! orgv.do ! IHFILES = org.ih orgv.ih NormalObjectRule() NormalATKRule() *** atk/org/org.c Wed Nov 22 12:23:56 1989 --- atk/org/org.c.NEW Tue Mar 20 21:21:59 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/org/RCS/org.c,v 1.6 89/08/31 17:12:55 tom Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/org.c,v 1.8 90/03/19 16:11:35 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 46,52 **** #include #define Tree (self->tree_data_object) - #define OrgFileName (self->tree_file_name) tree_Specification specification[] = { --- 46,51 ---- *************** *** 76,82 **** printf( "ORGVIEW: Unable to Create AptTree Object\n" ); status = false; } ! else tree_SetDebug( Tree, debug ); OUT(org_InitializeObject); return status; } --- 75,81 ---- printf( "ORGVIEW: Unable to Create AptTree Object\n" ); status = false; } ! /* else tree_SetDebug( Tree, debug );*/ OUT(org_InitializeObject); return status; } *************** *** 98,104 **** register struct org *self; { IN(org_FinalizeObject ); - if ( OrgFileName ) free( OrgFileName ); if ( Tree ) { tree_Apply( Tree, tree_RootNode( Tree ), Free_Elements, self, NULL ); --- 97,102 ---- *************** *** 107,130 **** OUT(org_FinalizeObject ); } - boolean - org__SetFileName( self, name ) - register struct org *self; - register char *name; - { - register long status = ok; - - IN(org_SetFileName); - if ( OrgFileName ) free( OrgFileName ); - OrgFileName = NULL; - if ( name && *name ) - if ( OrgFileName = (char *) malloc( strlen( name ) + 1 )) - strcpy( OrgFileName, name ); - else status = failure; - OUT(org_SetFileName); - return status; - } - long org__Read( self, file, id ) register struct org *self; --- 105,110 ---- *************** *** 160,166 **** { switch ( c ) { ! case '\n': DEBUG(NewLine); if ( ptr > string ) { Strip( ptr = string ); --- 140,146 ---- { switch ( c ) { ! case '\n': if ( ptr > string ) { Strip( ptr = string ); *************** *** 176,187 **** } } break; ! case '{': DEBUG(LeftBrace); braces++; if ( child ) parent = child; - DEBUGst(Parent,tree_NodeName(Tree,parent)); break; ! case '}': DEBUG(RightBrace); braces--; if ( ptr > string ) { --- 156,166 ---- } } break; ! case '{': braces++; if ( child ) parent = child; break; ! case '}': braces--; if ( ptr > string ) { *************** *** 198,207 **** child = parent; parent = tree_ParentNode( Tree, parent ); } - DEBUGst(Parent,tree_NodeName(Tree,parent)); break; ! case '[': DEBUG(LeftBracket); ! DEBUGst(Node,tree_NodeName(Tree,node)); brackets++; count_ptr = counter; while ( (c = getc( file )) && c != EOF && c != '\n' ) --- 177,184 ---- child = parent; parent = tree_ParentNode( Tree, parent ); } break; ! case '[': brackets++; count_ptr = counter; while ( (c = getc( file )) && c != EOF && c != '\n' ) *************** *** 230,243 **** *description_ptr = 0; DEBUGst(Description,tree_NodeDatum( Tree, node )); break; ! case ']': DEBUG(RightBracket); brackets--; break; ! case '\\': DEBUG(EndData); while ( (c = getc( file )) != '\n' && c != EOF ) ; done = true; break; ! case EOF: DEBUG(EOF); done = true; break; default: --- 207,220 ---- *description_ptr = 0; DEBUGst(Description,tree_NodeDatum( Tree, node )); break; ! case ']': brackets--; break; ! case '\\': while ( (c = getc( file )) != '\n' && c != EOF ) ; done = true; break; ! case EOF: done = true; break; default: *************** *** 281,301 **** DEBUGdt(Given Level,level); id = org_UniqueID( self ); DEBUGdt(Local-ID,id); ! if ( self->header.dataobject.writeID != writeID ) ! { self->header.dataobject.writeID = writeID; ! if ( level ) ! { DEBUG(Not Parent -- Write To Datastream); ! fprintf( file, "\\begindata{%s,%d}\n", class_GetTypeName( self ), id ); ! status = Write_Body( self, file ); ! fprintf( file, "\n\\enddata{%s,%d}\n", class_GetTypeName( self ), id ); ! } ! else ! { DEBUG(Parent -- Write To Raw File); ! status = Write_Body( self, file ); ! DEBUGdt(Enparse_Stream Status,status); ! } ! } DEBUGdt(Status,status); OUT(org_Write); return self->header.dataobject.id; --- 258,269 ---- DEBUGdt(Given Level,level); id = org_UniqueID( self ); DEBUGdt(Local-ID,id); ! if ( self->header.dataobject.writeID != writeID ) { self->header.dataobject.writeID = writeID; ! fprintf( file, "\\begindata{%s,%d}\n", class_GetTypeName( self ), id ); ! status = Write_Body( self, file ); ! fprintf( file, "\n\\enddata{%s,%d}\n", class_GetTypeName( self ), id ); ! } DEBUGdt(Status,status); OUT(org_Write); return self->header.dataobject.id; *************** *** 371,375 **** while ( *ptr ) ptr++; ptr--; while ( *ptr == ' ' || *ptr == '\t' ) *ptr-- = 0; - DEBUGst(String,string); } --- 339,342 ---- *** atk/org/org.ch Wed Nov 22 12:23:51 1989 --- atk/org/org.ch.NEW Tue Mar 20 21:22:01 1990 *************** *** 4,10 **** \* ********************************************************************** */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidorg_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/org/RCS/org.ch,v 1.3 89/08/23 15:39:29 tom Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidorg_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/org.ch,v 1.4 90/03/02 18:38:02 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 49,62 **** methods: - SetFileName( char *filename ) returns boolean; SetDebug( boolean state ); NodeName( node ) returns char *; - macromethods: - - FileName() ((self)->tree_file_name) - classprocedures: InitializeObject( struct org *self ) returns boolean; --- 49,57 ---- *************** *** 65,69 **** data: struct tree *tree_data_object; - char *tree_file_name; }; --- 60,63 ---- *** atk/org/orga.c Wed Nov 22 12:23:58 1989 --- atk/org/orga.c.NEW Tue Mar 20 21:22:07 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsidorga_c = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/org/RCS/orga.c,v 1.8 89/09/07 19:43:26 tom Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsidorga_c = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/orga.c,v 1.8 89/09/07 19:43:26 tom Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *** atk/org/orga.ch Wed Nov 22 12:23:52 1989 --- atk/org/orga.ch.NEW Tue Mar 20 21:22:09 1990 *************** *** 7,13 **** /* $Source $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/org/RCS/orga.ch,v 1.2 89/05/02 21:16:20 tom Exp $"; #endif /* --- 7,13 ---- /* $Source $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/orga.ch,v 1.2 89/05/02 21:16:20 tom Exp $"; #endif /* *** atk/org/orgv.c Mon Mar 12 13:16:13 1990 --- atk/org/orgv.c.NEW Tue Mar 20 21:22:18 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/org/RCS/orgv.c,v 1.33 89/09/07 19:43:06 tom Exp Locker: gk5g $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/orgv.c,v 1.35 90/03/02 18:56:09 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *************** *** 102,109 **** static struct keymap *class_keymap; #define menu_default (1<<0) - #define menu_application (1<<1) - #define menu_applicationlayer (1<<2) #define menu_buttons (1<<3) #define menu_exploded (1<<4) #define menu_imploded (1<<5) --- 102,107 ---- *************** *** 116,122 **** #define menu_folded (1<<12) #define menu_unfolded (1<<13) #define menu_debug (1<<14) - #define menu_writeable (1<<15) extern long sys_nerr; extern char *sys_errlist[]; --- 114,119 ---- *************** *** 132,147 **** RenamePhrase[] = "Rename", AddPhrase[] = "Add", DeletePhrase[] = "Delete", - PrintPhrase[] = "Print", - SavePhrase[] = "Save", DescriptionPhrase[] = "Description", ! TempFileName[] = "/tmp/org_temp", ! PrintFileName[] = "/tmp/org_print.PS"; #define Org (self->data_object) #define Anchor (self->anchor) - #define Application (self->application) - #define ApplicationLayer (self->application_layer) #define Menu (self->menu) #define Keystate (self->keystate) #define Bounds (&self->bounds) --- 129,139 ---- RenamePhrase[] = "Rename", AddPhrase[] = "Add", DeletePhrase[] = "Delete", DescriptionPhrase[] = "Description", ! TempFileName[] = "/tmp/org_temp"; #define Org (self->data_object) #define Anchor (self->anchor) #define Menu (self->menu) #define Keystate (self->keystate) #define Bounds (&self->bounds) *************** *** 152,158 **** #define Center (Left + Width/2) #define Middle (Top + Height/2) #define Bottom (Top + Height) ! #define PaletteHeight (50) #define PaletteTop (Top + Height - PaletteHeight) #define HitHandler (self->hit_handler) --- 144,150 ---- #define Center (Left + Width/2) #define Middle (Top + Height/2) #define Bottom (Top + Height) ! #define PaletteHeight (55) #define PaletteTop (Top + Height - PaletteHeight) #define HitHandler (self->hit_handler) *************** *** 175,181 **** #define IgnoreLoseInputFocus (self->ignore_loseinputfocus) #define IgnoreFullUpdate (self->ignore_fullupdate) - #define ReadOnly (self->read_only) #define Arrangement (self->arrangement) #define HorizontalArrangement (self->arrangement==treev_Horizontal) #define VerticalArrangement (self->arrangement==treev_Vertical) --- 167,172 ---- *************** *** 264,279 **** suite_ItemCaption(NodeConnectorPhrase), suite_ItemDatum(node_connector_code), 0 }; ! suite_Specification print_button[] = ! { ! suite_ItemCaption(PrintPhrase), ! suite_ItemDatum(print_code), 0 ! }; ! suite_Specification save_button[] = ! { ! suite_ItemCaption(SavePhrase), ! suite_ItemDatum(save_code), 0 ! }; static long Control_Button_Hit(); suite_Specification control_buttons[] = { --- 255,261 ---- suite_ItemCaption(NodeConnectorPhrase), suite_ItemDatum(node_connector_code), 0 }; ! static long Control_Button_Hit(); suite_Specification control_buttons[] = { *************** *** 286,293 **** suite_Item( fold_button ), suite_Item( node_border_button ), suite_Item( node_connector_button ), - suite_Item( print_button ), - suite_Item( save_button ), suite_ItemCaptionFontName( "andysans10b" ), suite_HitHandler( Control_Button_Hit ), suite_Arrangement( suite_Matrix ), --- 268,273 ---- *************** *** 294,319 **** 0 }; ! void Save_Command(), Add_Command(), ! Delete_Command(), Rename_Command(), ! Print_Command(), Quit_Command(), ! Description_Command(), Plode_Command(), ! Arrangement_Command(), Fold_Command(), ! Node_Border_Command(), Node_Connector_Command(), ! Palette_Command(), DEBUG_Command(); static struct bind_Description view_menu[] = { ! { "orgv-Save", "", 0, "Save Org~10", 0, menu_writeable, ! Save_Command, "Save Database" }, ! ! { "orgv-Add", "", 0, "Add Node~20", 0, menu_writeable, Add_Command, "Add Node" }, ! { "orgv-Delete", "", 0, "Delete Node~21",0, menu_writeable, Delete_Command, "Delete Node" }, ! { "orgv-Rename", "", 0, "Rename Node~22",0, menu_writeable, Rename_Command, "Rename Node" }, - { "orgv-Plode", "", 0, "Explode Nodes~30",0, menu_imploded, Plode_Command, "Plode Tree" }, { "orgv-Plode", "", 0, "Implode Nodes~30",0, menu_exploded, --- 274,299 ---- 0 }; ! void Add_Command(), ! Delete_Command(), ! Rename_Command(), ! Description_Command(), ! Plode_Command(), ! Arrangement_Command(), ! Fold_Command(), ! Node_Border_Command(), ! Node_Connector_Command(), ! Palette_Command(), ! DEBUG_Command(); static struct bind_Description view_menu[] = { ! { "orgv-Add", "", 0, "Add Node~20", 0, menu_default, Add_Command, "Add Node" }, ! { "orgv-Delete", "", 0, "Delete Node~21",0, menu_default, Delete_Command, "Delete Node" }, ! { "orgv-Rename", "", 0, "Rename Node~22",0, menu_default, Rename_Command, "Rename Node" }, { "orgv-Plode", "", 0, "Explode Nodes~30",0, menu_imploded, Plode_Command, "Plode Tree" }, { "orgv-Plode", "", 0, "Implode Nodes~30",0, menu_exploded, *************** *** 322,341 **** Description_Command,"Description" }, { "orgv-Description", "", 0, "Hide Description~31",0, menu_description_exposed, Description_Command,"Description" }, - { "orgv-Palette", "", 0, "Expose Palette~40", 0, menu_palette_hidden, Palette_Command, "Palette-toggle" }, { "orgv-Palette", "", 0, "Hide Palette~40", 0, menu_palette_exposed, Palette_Command, "Palette-toggle" }, - - { "orgv-Print", "", 0, "Print Org~50", 0, menu_default, - Print_Command, "Print Database" }, - { "orgv-DEBUG", "", 0, "DEBUG~98", 0, menu_debug, DEBUG_Command, "Debug-toggle" }, - { "orgv-Quit", "", 0, "Quit~99", 0, menu_default, - Quit_Command, "Quit" }, - { "org-Arrangement", "", 0, "Styling~10,Vertical Layout~10",0, menu_horizontal, Arrangement_Command,"Arrangement" }, { "org-Arrangement", "", 0, "Styling~10,Horizontal Layout~10",0, menu_vertical, --- 302,313 ---- *************** *** 380,388 **** Org = NULL; HitHandler = NULL; PreviousNode = NULL; ! InputFocus = PaletteExposed = Application = ApplicationLayer = ! DescriptionExposed = Exploded = ! IgnoreLoseInputFocus = IgnoreFullUpdate = ReadOnly = false; LastModified = DescriptionLastModified = 0; Arrangement = treev_Vertical; NodeConnectorStyle = treev_DogLeg; --- 352,359 ---- Org = NULL; HitHandler = NULL; PreviousNode = NULL; ! InputFocus = PaletteExposed = DescriptionExposed = Exploded = ! IgnoreLoseInputFocus = IgnoreFullUpdate = false; LastModified = DescriptionLastModified = 0; Arrangement = treev_Vertical; NodeConnectorStyle = treev_DogLeg; *************** *** 429,434 **** --- 400,411 ---- register struct orgv *self; { IN(orgv_FinalizeObject ); + if ( Description ) { + lpair_Destroy(PairView); + textview_DeleteApplicationLayer(DescriptionView,DescriptionViewScroll); + textview_Destroy(DescriptionView); + text_Destroy(Description); + } if ( TreeView ) treev_Destroy( TreeView ); if ( Suite ) suite_Destroy( Suite ); if ( Menu ) menulist_Destroy( Menu ); *************** *** 436,473 **** OUT(orgv_FinalizeObject ); } - struct view * - orgv__GetApplicationLayer( self ) - register struct orgv *self; - { - IN(orgv_GetApplicationLayer); - ApplicationLayer = true; - if ( Menu ) - { - menulist_SetMask( Menu, menulist_GetMask( Menu ) | - menu_default | menu_applicationlayer | ((ReadOnly) ? 0 : menu_writeable) ); - orgv_PostMenus( self, Menu ); - } - OUT(orgv_GetApplicationLayer); - return (struct view *) self; - } - void - orgv__DeleteApplicationLayer( self, view ) - register struct orgv *self; - register struct view *view; - { - IN(orgv_DeleteApplicationLayer); - ApplicationLayer = false; - if ( Menu ) - { - menulist_SetMask( Menu, menulist_GetMask( Menu ) & ~menu_applicationlayer ); - orgv_PostMenus( self, Menu ); - } - OUT(orgv_DeleteApplicationLayer); - } - - void orgv__SetDataObject( self, data ) register struct orgv *self; register struct org *data; --- 413,419 ---- *************** *** 496,503 **** { menulist_SetMask( Menu, menulist_GetMask( Menu ) | menu_default | (((debug) ? menu_debug : 0) | - ((ReadOnly) ? 0 : menu_writeable) | - ((Application) ? menu_application : 0) | ((Exploded) ? menu_exploded : menu_imploded) | ((DescriptionExposed) ? menu_description_exposed : menu_description_hidden) | ((Fold) ? menu_folded : menu_unfolded) | --- 442,447 ---- *************** *** 505,511 **** ((HorizontalArrangement) ? menu_horizontal : menu_vertical) ) ); orgv_PostMenus( self, Menu ); } - /*===printf(" ");otherwise sometimes dumps!?!?===*/ orgv_WantUpdate( self, self ); OUT(orgv_ReceiveInputFocus); } --- 449,454 ---- *************** *** 569,577 **** register enum view_UpdateType type; register long left, top, width, height; { ! register long controls = PaletteExposed * PaletteHeight, ! solicit = false; ! register struct suite_item *item; IN(orgv_FullUpdate); DEBUGdt(Type,type); --- 512,518 ---- register enum view_UpdateType type; register long left, top, width, height; { ! register long controls = PaletteExposed * PaletteHeight; IN(orgv_FullUpdate); DEBUGdt(Type,type); *************** *** 591,601 **** FirstTime = false; if ( tree_RootNode( Tree ) ) { DEBUG(RootNode); - if ( org_FileName( Org ) && access( org_FileName( Org ), F_OK ) == 0 && - access( org_FileName( Org ), W_OK ) == -1 ) - { DEBUG(ReadOnly); - ReadOnly = true; - } if ( tree_NodeDatum( Tree, tree_RootNode( Tree ) ) ) DescriptionExposed = true; } --- 532,537 ---- *************** *** 604,612 **** DescriptionExposed = PaletteExposed = true; controls = PaletteExposed * PaletteHeight; menulist_SetMask( Menu, (menulist_GetMask( Menu ) & ! ~menu_palette_hidden) | menu_palette_exposed | ! ((ReadOnly) ? 0 : menu_writeable) ); ! solicit = true; } if ( DescriptionExposed ) { --- 540,546 ---- DescriptionExposed = PaletteExposed = true; controls = PaletteExposed * PaletteHeight; menulist_SetMask( Menu, (menulist_GetMask( Menu ) & ! ~menu_palette_hidden) | menu_palette_exposed ); } if ( DescriptionExposed ) { *************** *** 614,625 **** ~menu_description_hidden) | menu_description_exposed ); lpair_VSplit( PairView, TreeView, DescriptionViewScroll, 40, 60 ); } ! if ( InputFocus ) ! { ! if ( ReadOnly ) ! menulist_SetMask( Menu, (menulist_GetMask( Menu ) & ~menu_writeable) ); ! orgv_PostMenus( self, Menu ); ! } } Prepare_Description( self, treev_CurrentNode( TreeView ) ); lpair_InsertViewSize( PairView, self, Left+2, Top+2, Width-4, (Height - controls)-4 ); --- 548,554 ---- ~menu_description_hidden) | menu_description_exposed ); lpair_VSplit( PairView, TreeView, DescriptionViewScroll, 40, 60 ); } ! if ( InputFocus )orgv_PostMenus( self, Menu ); } Prepare_Description( self, treev_CurrentNode( TreeView ) ); lpair_InsertViewSize( PairView, self, Left+2, Top+2, Width-4, (Height - controls)-4 ); *************** *** 628,641 **** { DEBUG(Palette Exposed); suite_InsertViewSize( Suite, self, Left+2, PaletteTop, Width-4, PaletteHeight-2 ); suite_FullUpdate( Suite, type, 0,0, Width-4, PaletteHeight-2 ); - if ( ReadOnly ) Passivate_ReadOnly( self ); } - if ( solicit ) - { - suite_HighlightItem( Suite, item = suite_ItemOfDatum( Suite, add_code ) ); - Add_Command( self ); - suite_NormalizeItem( Suite, item ); - } } OUT(orgv_FullUpdate); } --- 557,563 ---- *************** *** 717,723 **** case add_code: Add_Command( self ); break; case delete_code: Delete_Command( self ); break; case rename_code: Rename_Command( self ); break; - case print_code: Print_Command( self ); break; case plode_code: Plode_Command( self ); break; case description_code: Description_Command( self ); break; case arrangement_code: Arrangement_Command( self ); break; --- 639,644 ---- *************** *** 724,730 **** case fold_code: Fold_Command( self ); break; case node_border_code: Node_Border_Command( self ); break; case node_connector_code:Node_Connector_Command( self ); break; - case save_code: Save_Command( self ); break; default: sprintf( msg, "Unknown control-code (%d)", suite_ItemAttribute( suite, item, suite_ItemDatum(0) ) ); --- 645,650 ---- *************** *** 745,776 **** char *reply; IN(Add_Command); ! if ( !ReadOnly ) ! { ! while ( true ) ! { orgv_Query( self, "Enter Node Name: ", "", &reply ); if ( reply == NULL || *reply == 0 ) ! break; if ( node = tree_CreateChildNode( Tree, "?", NULL, treev_CurrentNode( TreeView ) ) ) ! { ! tree_SetNotificationCode( Tree, tree_NodeCreated ); ! tree_SetNotificationNode( Tree, node ); ! orgv_Announce( self, "" ); ! tree_SetNodeName( Tree, node, apts_StripString( reply ) ); ! tree_NotifyObservers( Tree, NULL ); ! org_SetModified( Org ); ! if ( PaletteExposed ) ! Activate( self ); ! } ! else ! { ! orgv_Announce( self, "Unable to Create Node." ); ! break; ! } } ! } ! else orgv_Announce( self, "Org is ReadOnly." ); OUT(Add_Command); } --- 665,692 ---- char *reply; IN(Add_Command); ! while ( true ) ! { orgv_Query( self, "Enter Node Name: ", "", &reply ); if ( reply == NULL || *reply == 0 ) ! break; if ( node = tree_CreateChildNode( Tree, "?", NULL, treev_CurrentNode( TreeView ) ) ) ! { ! tree_SetNotificationCode( Tree, tree_NodeCreated ); ! tree_SetNotificationNode( Tree, node ); ! orgv_Announce( self, "" ); ! tree_SetNodeName( Tree, node, apts_StripString( reply ) ); ! tree_NotifyObservers( Tree, NULL ); ! org_SetModified( Org ); ! if ( PaletteExposed ) ! Activate( self ); } ! else ! { ! orgv_Announce( self, "Unable to Create Node." ); ! break; ! } ! } OUT(Add_Command); } *************** *** 782,790 **** treev_CurrentNode( TreeView ); IN(Delete_Command); if ( current_node ) ! { ! if ( !ReadOnly ) ! { tree_SetNotificationCode( Tree, tree_NodeDestroyed ); tree_SetNotificationNode( Tree, current_node ); tree_NotifyObservers( Tree, NULL ); --- 698,704 ---- treev_CurrentNode( TreeView ); IN(Delete_Command); if ( current_node ) ! { tree_SetNotificationCode( Tree, tree_NodeDestroyed ); tree_SetNotificationNode( Tree, current_node ); tree_NotifyObservers( Tree, NULL ); *************** *** 791,804 **** tree_DestroyNode( Tree, current_node ); org_SetModified( Org ); if ( PaletteExposed && tree_NodeCount( Tree, tree_RootNode( Tree ) ) == 0 ) ! { ! Passivate( self ); ! im_ForceUpdate(); ! } } ! else orgv_Announce( self, "Org is ReadOnly." ); ! } ! else orgv_Announce( self, "Nothing to Delete." ); OUT(Delete_Command); } --- 705,716 ---- tree_DestroyNode( Tree, current_node ); org_SetModified( Org ); if ( PaletteExposed && tree_NodeCount( Tree, tree_RootNode( Tree ) ) == 0 ) ! { ! Passivate( self ); ! im_ForceUpdate(); } ! } ! else orgv_Announce( self, "Nothing to Delete." ); OUT(Delete_Command); } *************** *** 812,835 **** IN(Rename_Command); if ( current_node ) ! { ! if ( !ReadOnly ) ! { orgv_Query( self, "Enter New Node Name: ", ! tree_NodeName( Tree, current_node ), &reply ); orgv_Announce( self, "" ); if ( reply && *reply ) ! { ! tree_SetNodeName( Tree, current_node, apts_StripString( reply ) ); ! tree_SetNotificationCode( Tree, tree_NodeNameChanged ); ! tree_SetNotificationNode( Tree, current_node ); ! tree_NotifyObservers( Tree, NULL ); ! org_SetModified( Org ); ! } } ! else orgv_Announce( self, "Org is ReadOnly." ); ! } ! else orgv_Announce( self, "Nothing to Rename." ); OUT(Rename_Command); } --- 724,743 ---- IN(Rename_Command); if ( current_node ) ! { orgv_Query( self, "Enter New Node Name: ", ! tree_NodeName( Tree, current_node ), &reply ); orgv_Announce( self, "" ); if ( reply && *reply ) ! { ! tree_SetNodeName( Tree, current_node, apts_StripString( reply ) ); ! tree_SetNotificationCode( Tree, tree_NodeNameChanged ); ! tree_SetNotificationNode( Tree, current_node ); ! tree_NotifyObservers( Tree, NULL ); ! org_SetModified( Org ); } ! } ! else orgv_Announce( self, "Nothing to Rename." ); OUT(Rename_Command); } *************** *** 847,879 **** } static void - Print_Command( self ) - register struct orgv *self; - { - register FILE *file; - char msg[512]; - - IN(Print_Command); - orgv_UseWaitCursor( self ); - orgv_Announce( self, "Printing ..." ); - if ( file = fopen( PrintFileName, "w" ) ) - { - treev_SetPrintOptions( TreeView, aptv_PrintLandScape | aptv_PrintFillPage ); - treev_SetPrintUnitDimensions( TreeView, 8.5, 11.0 ); - treev_SetPrintPageDimensions( TreeView, 8.5, 11.0 ); - treev_Print( TreeView, file, "postscript", "postscript", 1 ); - fclose( file ); - sprintf( msg, "print -Tnative %s", PrintFileName ); - system( msg ); - sprintf( msg, "Printed '%s'", org_FileName( Org ) ); - orgv_Announce( self, msg ); - } - else orgv_Announce( self, "Error Printing" ); - orgv_UseNormalCursor( self ); - OUT(Print_Command); - } - - static void Plode_Command( self ) register struct orgv *self; { --- 755,760 ---- *************** *** 990,1068 **** } static void - Save_Command( self ) - register struct orgv *self; - { - char msg[512], - original_name[512], backup_name[512]; - char *file_name, *name; - register FILE *file; - register long serial = 1, status = ok ; - struct stat st; - - IN(Save_Command); - if ( !ReadOnly ) - { - if ( org_FileName( Org ) == NULL ) - { DEBUG(Need FileName); - if ( (status = orgv_QueryFileName( self, "Enter FileName: ", &file_name )) == ok ) - { - /*===FIX QUERYFILENAME TO ENSURE FILE*/ - if (stat(file_name,&st)==0 && (st.st_mode&S_IFMT) == S_IFDIR) - {orgv_Announce(self,"Cancelled");return;} - /*===*/ - orgv_Announce( self, "" ); - org_SetFileName( Org, file_name ); - } - } - if ( Description_Modified( self ) ) - Preserve_Description( self ); - if ( org_FileName( Org ) ) - { - orgv_UseWaitCursor( self ); - sprintf( original_name, "%s", org_FileName( Org ) ); - DEBUGst(Original-name,original_name); - sprintf( backup_name, "%s.BACKUP", org_FileName( Org ) ); - if ( stat( original_name, &st ) == 0 ) - { DEBUG(Existent File); - while ( ! stat( backup_name, &st ) ) - sprintf( backup_name, "%s.BACKUP.%d", org_FileName( Org ), serial++ ); - DEBUGst(Backup-name,backup_name); - if ( rename( original_name, backup_name ) ) - { DEBUG(Rename Failure); - sprintf( msg, "Unable to Create Backup for '%s'", org_FileName( Org ) ); - orgv_Announce( self, msg ); - status = failure; - } - } - if ( status == ok ) - { - if ( file = fopen( org_FileName( Org ), "w" ) ) - { DEBUG(File Opened); - org_Write( Org, file, im_GetWriteID(), 1 ); - fclose( file ); - sprintf( msg, "Wrote '%s'", org_FileName( Org ) ); - orgv_Announce( self, msg ); - name = rindex( org_FileName( Org ), '/' ) + 1; - im_SetTitle( orgv_GetIM( self ), name ); - LastModified = org_GetModified( Org ); - } - else - { DEBUG(File Open Failed); - sprintf( msg, "Unable to Open '%s' (%s)", - org_FileName( Org ), sys_errlist[errno] ); - orgv_Announce( self, msg ); - org_SetFileName( Org, NULL ); - } - } - orgv_UseNormalCursor( self ); - } - } - else orgv_Announce( self, "Org is ReadOnly." ); - OUT(Save_Command); - } - - static void DEBUG_Command( self ) register struct orgv *self; { --- 871,876 ---- *************** *** 1087,1093 **** --- 895,904 ---- menulist_SetMask( Menu, (menulist_GetMask( Menu ) & ~menu_palette_exposed) | menu_palette_hidden ); } + orgv_SetTransferMode( self, graphic_WHITE ); + orgv_FillRectSize( self, 0, 0, Width-3, Height-3, orgv_WhitePattern(self) ); orgv_FullUpdate( self, view_FullRedraw, 0, 0, Width-3, Height-3 ); + orgv_SetTransferMode( self, graphic_BLACK ); orgv_PostMenus( self, Menu ); OUT(Palette_Command); } *************** *** 1109,1115 **** --- 920,929 ---- menulist_SetMask( Menu, (menulist_GetMask( Menu ) & ~menu_description_exposed) | menu_description_hidden ); } + orgv_SetTransferMode( self, graphic_WHITE ); + orgv_FillRectSize( self, 0, 0, Width-3, Height-3, orgv_WhitePattern(self) ); orgv_FullUpdate( self, view_FullRedraw, 0, 0, Width-3, Height-3 ); + orgv_SetTransferMode( self, graphic_BLACK ); orgv_PostMenus( self, Menu ); OUT(Description_Command); } *************** *** 1140,1175 **** OUT(Arrangement_Command); } - static void - Quit_Command( self ) - register struct orgv *self; - { - static char *choices[] = - {"Cancel", SavePhrase, "Save & Quit", "Quit Anyway", 0}; - long response = 0; - - IN(Quit_Command); - Description_Modified( self ); - if ( ! (InitialNodeCount == 0 && - tree_NodeCount( Tree, tree_RootNode( Tree ) ) == 0 ) && - (org_GetModified( Org ) > LastModified) ) - { - message_MultipleChoiceQuestion( - self, 0, "Outstanding Modifications:", 0, &response, choices, NULL ); - DEBUGdt(Response,response); - switch ( response ) - { - case 0: break; - case 1: Save_Command( self ); break; - case 2: Save_Command( self ); - case 3: exit(0); - default: break; - } - } - else exit(0); - OUT(Quit_Command); - } - static Alter_Control_Button( self, datum, new ) register struct orgv *self; --- 954,959 ---- *************** *** 1185,1203 **** } static - Passivate_ReadOnly( self ) - register struct orgv *self; - { - if ( PaletteExposed ) - { - suite_PassivateItem( Suite, suite_ItemOfDatum( Suite, add_code ) ); - suite_PassivateItem( Suite, suite_ItemOfDatum( Suite, rename_code ) ); - suite_PassivateItem( Suite, suite_ItemOfDatum( Suite, delete_code ) ); - suite_PassivateItem( Suite, suite_ItemOfDatum( Suite, save_code ) ); - } - } - - static Passivate( self ) register struct orgv *self; { --- 969,974 ---- *************** *** 1215,1221 **** Activate( self ) register struct orgv *self; { ! if ( PaletteExposed && !ReadOnly ) { suite_ActivateItem( Suite, suite_ItemOfDatum( Suite, plode_code ) ); suite_ActivateItem( Suite, suite_ItemOfDatum( Suite, rename_code ) ); --- 986,992 ---- Activate( self ) register struct orgv *self; { ! if ( PaletteExposed ) { suite_ActivateItem( Suite, suite_ItemOfDatum( Suite, plode_code ) ); suite_ActivateItem( Suite, suite_ItemOfDatum( Suite, rename_code ) ); *************** *** 1279,1285 **** { register FILE *file; long id; - struct attributes attrs; IN(Prepare_Description); if ( DescriptionExposed ) --- 1050,1055 ---- *************** *** 1287,1293 **** orgv_UseWaitCursor( self ); if ( Description_Modified( self ) ) Preserve_Description( self ); - /*=== Rather a bogus technique ... */ file = fopen( TempFileName, "w" ); if ( tree_NodeDatum( Tree, node ) == NULL ) { --- 1057,1062 ---- *************** *** 1303,1316 **** filetype_Lookup( file, (char *) 0, &id, 0 ); text_Read( Description, file, id ); fclose( file ); - /* ... Rather a bogus technique === */ - if ( ReadOnly ) - { - attrs.next = 0; - attrs.key = "readonly"; - attrs.value.integer = 1; - text_SetAttributes( Description, &attrs ); - } DescriptionLastModified = text_GetModified( Description ); orgv_UseNormalCursor( self ); } --- 1072,1077 ---- *** atk/org/orgv.ch Wed Nov 22 12:23:54 1989 --- atk/org/orgv.ch.NEW Tue Mar 20 21:22:22 1990 *************** *** 4,14 **** \* ********************************************************************** */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidorgv_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/org/RCS/orgv.ch,v 1.8 89/08/23 15:39:33 tom Exp $"; #endif /* $Log: orgv.ch,v $ Revision 1.8 89/08/23 15:39:33 tom Revise to Version 1.0 --- 4,17 ---- \* ********************************************************************** */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidorgv_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/orgv.ch,v 1.9 90/03/02 18:45:04 gk5g Exp $"; #endif /* $Log: orgv.ch,v $ + Revision 1.9 90/03/02 18:45:04 gk5g + Removed the menu items (and suite items) Print, Save, and Quit. These are not necessary (and, in fact, wrong) for org to have. Frame (and buffer) handle those operations. Removed the menu masks menu_application & menu_applicationlayer. Removed the methods orgv_{Get,Delete}ApplicationLayer because they did nothing. Removed the instance vars readonly, application, and org_app. These are no longer necessary. + Revision 1.8 89/08/23 15:39:33 tom Revise to Version 1.0 *************** *** 61,68 **** Update(); ReceiveInputFocus(); LoseInputFocus(); - GetApplicationLayer() returns struct view *; - DeleteApplicationLayer( struct view * view ); Hit( enum view_MouseAction action, long x, long y, long n) returns struct view *; Print( FILE *file, char *processor, char *finalFormat, boolean topLevel ); ObservedChanged( struct view *changed, long value ); --- 64,69 ---- *************** *** 97,108 **** struct rectangle bounds; struct menulist *menu; struct keystate *keystate; ! long last_modified, initial_node_count, description_last_modified; ! short arrangement, node_border_style, node_connector_style, background_shade; ! boolean input_focus, expose_controls, controls_exposed, ! application, application_layer, fold, first_time, ! expose_description, description_exposed, read_only, ! exploded, ignore_loseinputfocus, ignore_fullupdate; }; --- 98,118 ---- struct rectangle bounds; struct menulist *menu; struct keystate *keystate; ! long last_modified, ! initial_node_count, description_last_modified; ! short arrangement, ! node_border_style, ! node_connector_style, background_shade; ! boolean input_focus, ! expose_controls, ! controls_exposed, ! fold, first_time, ! expose_description, ! description_exposed, ! read_only, ! exploded, ! ignore_loseinputfocus, ! ignore_fullupdate; }; *** atk/raster/cmd/rasterv.c Wed Nov 22 12:25:09 1989 --- atk/raster/cmd/rasterv.c.NEW Tue Apr 3 11:20:28 1990 *************** *** 2,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.13 89/10/13 16:07:24 msp Exp $ */ /* $ACIS:rasterv.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/rasterv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.13 89/10/13 16:07:24 msp Exp $"; #endif /* lint */ /* Some comments on changes checked in on 8/10/88 >> SetPixel: >> The pix local variable is modified (somehow) by the --- 2,17 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.19 90/04/03 11:49:07 gk5g Exp $ */ /* $ACIS:rasterv.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.19 90/04/03 11:49:07 gk5g Exp $"; #endif /* lint */ + /* Added X Window Dump read/write menu opitons -paul@athena.mit.edu 3/7/90 */ + /* Some comments on changes checked in on 8/10/88 >> SetPixel: >> The pix local variable is modified (somehow) by the *************** *** 81,86 **** --- 83,89 ---- #include #include #include + #include #include *************** *** 578,584 **** struct rectangle VB; rasterview_GetVisualBounds(self, &VB); - if (NotFullSize(self)) { self->Xscroll -= (self->Xscroll % self->Scale); minLeft = - (rectangle_Width(&VB) - 40); --- 581,586 ---- *************** *** 593,599 **** minTop = - (rectangle_Height(&VB) - 18); maxBottom = rectangle_Height(&self->ViewSelection) - 18; } ! DEBUG(("ClipScroll:\n Visual: (%d,%d,%d,%d)\n VS: (%d,%d,%d,%d)\n Min: (%d,%d) Max: (%d,%d)\n", rectangle_Left(&VB), rectangle_Top(&VB), rectangle_Width(&VB), rectangle_Height(&VB), --- 595,602 ---- minTop = - (rectangle_Height(&VB) - 18); maxBottom = rectangle_Height(&self->ViewSelection) - 18; } ! if(minLeft > 0) minLeft = 0; ! if(minTop > 0) minTop = 0; DEBUG(("ClipScroll:\n Visual: (%d,%d,%d,%d)\n VS: (%d,%d,%d,%d)\n Min: (%d,%d) Max: (%d,%d)\n", rectangle_Left(&VB), rectangle_Top(&VB), rectangle_Width(&VB), rectangle_Height(&VB), *************** *** 605,611 **** --- 608,616 ---- if (self->Xscroll > maxRight) self->Xscroll = maxRight; if (self->Yscroll < minTop) self->Yscroll = minTop; if (self->Yscroll > maxBottom) self->Yscroll = maxBottom; + DEBUG((" Scroll: (%d,%d)\n", self->Xscroll, self->Yscroll)); + } *************** *** 916,931 **** self->UpdateWanted = FALSE; if (ras == NULL) return; - if (self->NeedsCentering) { self->NeedsCentering = FALSE; if (! self->embedded) { CenterViewSelection(self); ! PostMenus(self); } } ! /* Just in case the window has been resized. */ ClipScroll(self); - pix = (NotFullSize(self)) ? self->Expansion : raster_GetPix(ras); if (pix == NULL) { /* XXX Kludge: If there is no rasterimage, we create one */ --- 921,935 ---- self->UpdateWanted = FALSE; if (ras == NULL) return; if (self->NeedsCentering) { self->NeedsCentering = FALSE; if (! self->embedded) { CenterViewSelection(self); ! PostMenus(self); ! } ! } /* Just in case the window has been resized. */ ClipScroll(self); pix = (NotFullSize(self)) ? self->Expansion : raster_GetPix(ras); if (pix == NULL) { /* XXX Kludge: If there is no rasterimage, we create one */ *************** *** 934,941 **** self->ViewSelection = self->DesiredSelection; self->Shrunken = FALSE; /* This is to include the execution of the code which would be executed in raster_SetPix which is special cased to NOT inform the upper layers that the raster has changed. This is a kludge to fix the problem when raster is run with a new file one should be able to quit without the message 'Are you sure you want to Quit?' Posting Menus should be sufficient. */ ! PostMenus(self); } ! /* compute LB, the entire allocated rectangle of pixels, but inside by BORDER pixels on all edges. */ rasterview_GetLogicalBounds(self, &LB); InsetRect(&LB, BORDER, BORDER); --- 938,945 ---- self->ViewSelection = self->DesiredSelection; self->Shrunken = FALSE; /* This is to include the execution of the code which would be executed in raster_SetPix which is special cased to NOT inform the upper layers that the raster has changed. This is a kludge to fix the problem when raster is run with a new file one should be able to quit without the message 'Are you sure you want to Quit?' Posting Menus should be sufficient. */ ! PostMenus(self); ! } /* compute LB, the entire allocated rectangle of pixels, but inside by BORDER pixels on all edges. */ rasterview_GetLogicalBounds(self, &LB); InsetRect(&LB, BORDER, BORDER); *************** *** 949,955 **** self->Yoff = - rectangle_Top(&LB); if (FullSize(self)) { self->Xoff += rectangle_Left(&self->ViewSelection) + self->Xscroll; ! self->Yoff += rectangle_Top(&self->ViewSelection) + self->Yscroll; } else { if (self->Xscroll < 0) self->Xoff += self->Xscroll; --- 953,960 ---- self->Yoff = - rectangle_Top(&LB); if (FullSize(self)) { self->Xoff += rectangle_Left(&self->ViewSelection) + self->Xscroll; ! self->Yoff += rectangle_Top(&self->ViewSelection) + self->Yscroll; ! } else { if (self->Xscroll < 0) self->Xoff += self->Xscroll; *************** *** 957,964 **** self->Yoff += self->Yscroll; } ! if (type == view_FullRedraw) { ! rectangle_EmptyRect(&self->CurSelection); } else ViewHideHighlight(self); /* (requires Xoff and Yoff) */ /* compute VB, the displayed portion of the image. It is the intersection of the visual rectangle with LB */ --- 962,968 ---- self->Yoff += self->Yscroll; } ! if (type == view_FullRedraw) rectangle_EmptyRect(&self->CurSelection); else ViewHideHighlight(self); /* (requires Xoff and Yoff) */ /* compute VB, the displayed portion of the image. It is the intersection of the visual rectangle with LB */ *************** *** 1000,1006 **** rectangle_SetRectSize(&NS, 0, 0, rectangle_Width(&self->ViewSelection)*self->Scale, rectangle_Height(&self->ViewSelection)*self->Scale); ! rectangle_IntersectRect(&SRC, &SRC, &NS); } DEBUG(("SRC: (%d,%d,%d,%d)\n", rectangle_Left(&SRC), rectangle_Top(&SRC), --- 1004,1011 ---- rectangle_SetRectSize(&NS, 0, 0, rectangle_Width(&self->ViewSelection)*self->Scale, rectangle_Height(&self->ViewSelection)*self->Scale); ! rectangle_IntersectRect(&SRC, &SRC, &NS); ! } DEBUG(("SRC: (%d,%d,%d,%d)\n", rectangle_Left(&SRC), rectangle_Top(&SRC), *************** *** 1135,1141 **** if (self->embedded) { self->Xscroll = self->Yscroll = 0; - ras->subraster = self->ViewSelection; raster_NotifyObservers(ras, raster_BOUNDSCHANGED); } else { --- 1140,1145 ---- *************** *** 1749,1761 **** InMacPaint, OutMacPaint, OutRasterFile, ! OutPostscript, }; static char *prompts[] = { "Read MacPaint file: ", "Write MacPaint file: ", "Write RasterFile file: ", ! "Write Postscript file: ", }; static void RasterIOCommand(self, rock) struct rasterview *self; --- 1753,1769 ---- InMacPaint, OutMacPaint, OutRasterFile, ! OutPostscript, ! Inxwd, ! Outxwd}; static char *prompts[] = { "Read MacPaint file: ", "Write MacPaint file: ", "Write RasterFile file: ", ! "Write Postscript file: ", ! "Read X Window Dump file: ", ! "Write X Window Dump File: "}; static void RasterIOCommand(self, rock) struct rasterview *self; *************** *** 1770,1776 **** ENTER(RasterIOCommand); if (ras == NULL) return; ! inputop = (rock == InMacPaint); /* XXX adjust if add more input types */ CurrentDirectory(self, filename); --- 1778,1785 ---- ENTER(RasterIOCommand); if (ras == NULL) return; ! inputop = (rock == InMacPaint || rock == Inxwd); ! /* XXX adjust if add more input types */ CurrentDirectory(self, filename); *************** *** 1824,1829 **** --- 1833,1857 ---- (ras->xScale + 0e0) / raster_UNITSCALE, (ras->yScale + 0e0) / raster_UNITSCALE); break; + case Inxwd: + if (xwdio_ReadImage(f, raster_GetPix(ras)) + != dataobject_NOREADERROR) { + char msg[MAXPATHLEN + 50]; + sprintf(msg, "File %s apparently not in X Window Dump format", filename); + message_DisplayString((struct view *)self, 0, msg); } + else { + self->Xscroll = self->Yscroll = 0; + self->needsFullUpdate = TRUE; + self->ViewSelection = self->DesiredSelection = ras->subraster; + /* the Read will cause a NotifyObservers, + which will call WantUpdate */ + } + break; + case Outxwd: + xwdio_WriteImage(f, raster_GetPix(ras), + &self->ViewSelection); + break; + } fclose(f); if (! self->embedded && inputop) *************** *** 2625,2630 **** --- 2653,2666 ---- keymap_BindToKey(EmbeddedKeymap, "\033\022r", proc, 0); /* ESC - ^R - r */ menulist_AddToML(EmbeddedMenus, "File,Read Raster~12", proc, 0, menuRead); + proc = proctable_DefineProc("raster-read-xwdfile", + RasterIOCommand, + &rasterview_classinfo, NULL, + "Read file in X Window Dump format"); + keymap_BindToKey(EmbeddedKeymap, "\033\022x", proc, 0); + /* ESC - ^R - x*/ + menulist_AddToML(EmbeddedMenus, "File,Read X Window Dump~13", proc, (long)Inxwd, menuRead); + /* Application Items: */ proc = proctable_DefineProc("raster-read-file", ReadFileCommand, *************** *** 2657,2663 **** --- 2693,2719 ---- keymap_BindToKey(ApplicationKeymap, "\033\022r", proc, 0); /* ESC - ^R - r *//* same as Read Raster above */ menulist_AddToML(ApplicationMenus, "Raster I/O~42,Read Old Raster~42", proc, 0, menuRead); + /* paul's attempt to add XWD I/O : */ + proc = proctable_DefineProc("raster-read-xwdfile", + RasterIOCommand, + &rasterview_classinfo, NULL, + "Read file in X Window Dump format"); + keymap_BindToKey(ApplicationKeymap, "\033\022x", proc, 0); + /* ESC - ^R - x*/ + menulist_AddToML(ApplicationMenus, "Raster I/O~42,Read X Window Dump~52", proc, (long)Inxwd, menuRead); + + + proc = proctable_DefineProc("raster-write-xwdfile", + RasterIOCommand, + &rasterview_classinfo, NULL, + "Write file in X Window Dump format"); + keymap_BindToKey(ApplicationKeymap, "\033\022X", proc, 0); + /* ESC - ^R - X*/ + menulist_AddToML(ApplicationMenus, "Raster I/O~42,Write X Window Dump~54", proc, (long)Outxwd, menuWrite); + + /* end of paul's attempt to add XWD I/O : */ + RastersInitiallyShrunk = environ_GetProfileSwitch("RastersInitiallyShrunk", FALSE); DEBUG(("LEAVE rasterview__InitializeClass\n")); return TRUE; *************** *** 2768,2773 **** --- 2824,2834 ---- if (status == observable_OBJECTDESTROYED) return; switch (status) { + case 0: + self->UpdateWanted = FALSE; /* What the hell! */ + self->needsFullUpdate = TRUE; + rasterview_WantUpdate(self,self); + break; case raster_BITSCHANGED: case pixelimage_DATACHANGED: DEBUG((" BitsChanged\n")); *************** *** 2868,2891 **** register long left, top, width, height; { register struct raster *ras = (struct raster *)rasterview_GetDataObject(self); ENTER(rasterview__FullUpdate); - if (type == view_Remove) { - self->OnScreen = FALSE; - return; } /* fixes bug that the view selection is not updated when raster_Read is called. */ if (rectangle_IsEmptyRect(&self->ViewSelection)) self->ViewSelection = self->DesiredSelection = ras->subraster; PostMenus(self); - if ((type != view_FullRedraw - && type != view_PartialRedraw - && type != view_LastPartialRedraw) - || rasterview_GetLogicalWidth(self) == 0 - || rasterview_GetLogicalHeight(self) == 0) - return; self->OnScreen = TRUE; - /* XXX this code sets ReadOnly in the rasterimage if the parent is 'messages' --- 2929,2957 ---- register long left, top, width, height; { register struct raster *ras = (struct raster *)rasterview_GetDataObject(self); + struct rectangle VB; ENTER(rasterview__FullUpdate); + rasterview_GetVisualBounds(self, &VB); + if((type == view_Remove) || (type == view_MoveNoRedraw)) { + if(type == view_Remove) { + self->OnScreen = FALSE; + rasterview_RetractCursor(self, self->Cursor[self->Mode]); + } + else if(type == view_MoveNoRedraw) { + rasterview_RetractCursor(self, self->Cursor[self->Mode]); + rasterview_PostCursor(self, &VB, self->Cursor[self->Mode]); + } + return; + } + if(IsEmptyRect(&VB)) return; + /* fixes bug that the view selection is not updated when raster_Read is called. */ if (rectangle_IsEmptyRect(&self->ViewSelection)) self->ViewSelection = self->DesiredSelection = ras->subraster; PostMenus(self); self->OnScreen = TRUE; /* XXX this code sets ReadOnly in the rasterimage if the parent is 'messages' *************** *** 2904,2910 **** break; } } DEBUG(("Done Checking parents.\n")); } if (type == view_FullRedraw) { - struct rectangle r; /* must recompute graphics info because image may be on different display hardware */ self->WhitePattern = rasterview_WhitePattern(self); --- 2970,2975 ---- *************** *** 2928,2935 **** cursor_SetStandard(self->Cursor[PanMode], Cursor_CrossHairs); } /* reset the cursor */ DEBUG(("Finished Posting Cursors\n")); fflush(stdout); ! rasterview_GetVisualBounds(self, &r); ! rasterview_PostCursor(self, &r, self->Cursor[self->Mode]); } if (NotFullSize(self)) { DEBUG(("Call ZoomToVisualBounds\n")); --- 2993,2999 ---- cursor_SetStandard(self->Cursor[PanMode], Cursor_CrossHairs); } /* reset the cursor */ DEBUG(("Finished Posting Cursors\n")); fflush(stdout); ! rasterview_PostCursor(self, &VB, self->Cursor[self->Mode]); } if (NotFullSize(self)) { DEBUG(("Call ZoomToVisualBounds\n")); *** atk/raster/convert/convras.help Fri Dec 8 11:19:05 1989 --- atk/raster/convert/convras.help.NEW Tue Mar 20 21:24:29 1990 *************** *** 1,4 **** ! \begindata{text,2803456} \textdsversion{12} \template{help} \define{index --- 1,4 ---- ! \begindata{text,269004988} \textdsversion{12} \template{help} \define{index *************** *** 35,40 **** --- 35,43 ---- \bold{PostScript} print data stream (can be abbreviated ps); supported only for output}} + \bold{Xwd} the X Window Dump format produced by xwd (can be abbreviated + xwd) + } \section{Using Convertraster} *************** *** 43,50 **** \leftindent{\description{convertraster [-ruln] [-c'(x,y,w,h)'] ! [intype=\italic{type}] [infile=\italic{filename}] [outtype=\italic{type}] ! [outfile=\italic{filename}]}} --- 46,53 ---- \leftindent{\description{convertraster [-ruln] [-c'(x,y,w,h)'] ! [-p\italic{scale]} [intype=\italic{type}] [infile=\italic{filename}] ! [outtype=\italic{type}] [outfile=\italic{filename}]}} *************** *** 115,120 **** --- 118,127 ---- \leftindent{Cropping is optional and is done before the other processing. } + \bold{-p}\italic{scale }Scale postscript output by this factor (1.0 by + default). + + \bold{intype} is the format of the file you want to convert. You may omit this argument if the type is \bold{\italic{RF}} (old RasterFile format) or \italic{\bold{raster}} (Andrew Toolkit format). Otherwise, the type must *************** *** 132,157 **** must correspond to the \bold{intype} argument: ! \leftindent{.raster for Andrew Toolkit (be2) format ! .ras for old RasterFile format ! .mp for MacPaint format} \bold{outfile} is the name of the file in which you want to save the converted raster. If you omit an outfile specification, standard output is written. The extension on the filename must match the \bold{outtype} argument: ! \leftindent{.raster for Andrew Toolkit (be2) format ! .ras for old RasterFile format ! .mp for MacPaint format} ! \leftindent{.ps for Postscript} } \section{Bugs} --- 139,168 ---- must correspond to the \bold{intype} argument: ! \leftindent{.raster for Andrew Toolkit (be2) format ! .ras for old RasterFile format ! .mp for MacPaint format + .xwd for X Window Dump format} + \bold{outfile} is the name of the file in which you want to save the converted raster. If you omit an outfile specification, standard output is written. The extension on the filename must match the \bold{outtype} argument: ! \leftindent{.raster for Andrew Toolkit (be2) format ! .ras for old RasterFile format ! .mp for MacPaint format} ! \leftindent{.xwd for X Window Dump format} + \leftindent{.ps for Postscript} + } \section{Bugs} *************** *** 160,166 **** \bold{outfile}, nor \bold{intype} from the extension on \bold{infile}. ! Does not handle X and Sun raster formats. Some users get "pixelimage not found" error message.} --- 171,177 ---- \bold{outfile}, nor \bold{intype} from the extension on \bold{infile}. ! Does not handle Sun raster formats. Some users get "pixelimage not found" error message.} *************** *** 185,188 **** scan ! }}\enddata{text,2803456} --- 196,201 ---- scan ! xwd ! ! }}\enddata{text,269004988} *** atk/raster/convert/convrast.c Fri Feb 2 12:25:08 1990 --- atk/raster/convert/convrast.c.NEW Tue Mar 20 21:24:33 1990 *************** *** 4,20 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/raster/convert/RCS/convrast.c,v 2.8 90/01/26 14:41:04 susan Exp $ */ /* $ACIS:convrast.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/raster/convert/RCS/convrast.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/raster/convert/RCS/convrast.c,v 2.8 90/01/26 14:41:04 susan Exp $"; #endif /* lint */ /* convrast.c - program to convert raster formats ! convertraster [-nulr] [-c(x,y,w,h)] [-intype=type] [-outtype=type] [-infile=filename] [-outfile=filename] Convertraster reads the infile, generates an internal representation of the raster, --- 4,20 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/convert/RCS/convrast.c,v 2.9 90/03/15 12:37:41 gk5g Exp $ */ /* $ACIS:convrast.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/convert/RCS/convrast.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/convert/RCS/convrast.c,v 2.9 90/03/15 12:37:41 gk5g Exp $"; #endif /* lint */ /* convrast.c - program to convert raster formats ! convertraster [-nulr] [-c(x,y,w,h)] [-pscale] [-intype=type] [-outtype=type] [-infile=filename] [-outfile=filename] Convertraster reads the infile, generates an internal representation of the raster, *************** *** 26,31 **** --- 26,32 ---- Switch definitions: -c(x,y,w,h) Crop the output to the subimage of size (w, h) at (x,y). + -pscale Scale postscript output by this factor (1.0 by default) -n Negative image. -u Reflect across horizontal axis. (Swap Up and down). -l Reflect across vertical axis. (Swap Left and right). *************** *** 32,37 **** --- 33,39 ---- -r Rotate 90 degrees clockwise. Multiple r's rotate 180, 270, . . . Cropping is done before the other processing. + Postscript scaling is done after all other operations. The 'type's supported are: *************** *** 39,44 **** --- 41,47 ---- RF - the old ITC RasterFile format raster - the BE2 .raster format PostScript - print data stream; not supported for intype + Xwd - X Window Dump If the output type is not specified, a .raster file is generated. If the input type is not specified, the program will examine *************** *** 58,63 **** --- 61,67 ---- #include #include #include + #include /* include the ones utilized, but not by this .c file itself */ #define class_StaticEntriesOnly *************** *** 74,84 **** typeMacPaint, typeRF, typeraster, ! typePostscript } inType, outType; char opSwitches[20]; /* -runl */ struct rectangle crop; /* -c(l,t,w,h) */ static void --- 78,90 ---- typeMacPaint, typeRF, typeraster, ! typePostscript, ! typexwd } inType, outType; char opSwitches[20]; /* -runl */ struct rectangle crop; /* -c(l,t,w,h) */ + float PSscale; /* -p */ static void *************** *** 154,159 **** --- 160,167 ---- return oldRF_ReadImage(InputFile, pix); case typeMacPaint: return paint_ReadImage(InputFile, pix); + case typexwd: + return xwdio_ReadImage(InputFile, pix); } } *************** *** 178,185 **** paint_WriteImage(OutputFile, pix, &r); return; case typePostscript: ! heximage_WritePostscript(OutputFile, pix, &r, 0.5, 0.5); return; } } --- 186,196 ---- paint_WriteImage(OutputFile, pix, &r); return; case typePostscript: ! heximage_WritePostscript(OutputFile, pix, &r, (double) PSscale, (double) PSscale); return; + case typexwd: + xwdio_WriteImage(OutputFile, pix, &r); + return; } } *************** *** 198,206 **** static void usage() { ! fprintf(stderr, "usage: convertraster [-ruln] [-c(x,y,w,h)]"); fprintf(stderr, " [intype=type] [infile=file] [outtype=type] [outfile=file]\n"); ! fprintf(stderr, "usage: Types are MacPaint, RF, raster, and Postscript\n"); exit(2); } --- 209,217 ---- static void usage() { ! fprintf(stderr, "usage: convertraster [-ruln] [-c(x,y,w,h)] [-p[scale]]"); fprintf(stderr, " [intype=type] [infile=file] [outtype=type] [outfile=file]\n"); ! fprintf(stderr, "usage: Types are MacPaint, RF, raster, xwd, and Postscript\n"); exit(2); } *************** *** 258,263 **** --- 269,275 ---- "be2", NULL, NULL, typeraster, "ps", NULL, NULL, typePostscript, "postscript", NULL, NULL, typePostscript, + "xwd", NULL, NULL, typexwd, "", NULL, NULL, typeUnknown }; *************** *** 308,313 **** --- 320,329 ---- if (strlen(opSwitches) > 18) fail ("Too many n,l,r,u operations"); break; + case 'p': + if (sscanf(arg+1, "%f", &PSscale) != 1) + fail("PS scale factor -pscale"); + break; case 'i': case 'o': for (bx = buf, sx = arg; *************** *** 353,359 **** { unsigned char *ext = (unsigned char *)rindex(outname, '.'); if (*outname) { ! if (ext == NULL) fail("Output filename must have an extension"); else switch (outType) { case typeraster: --- 369,375 ---- { unsigned char *ext = (unsigned char *)rindex(outname, '.'); if (*outname) { ! if (rindex == NULL) fail("Output filename must have an extension"); else switch (outType) { case typeraster: *************** *** 371,376 **** --- 387,396 ---- case typePostscript: if (strcmp(ext, ".ps") != 0) fail("Output file extension for Postscript files must be \".ps\""); + break; + case typexwd: + if (strcmp(ext, ".xwd") != 0) + fail("Output file extension for X Window Dump files must be \".xwd\""); break; } return fopen(outname, "w"); *************** *** 399,404 **** --- 419,425 ---- outType = typeraster; *opSwitches = '\0'; rectangle_EmptyRect(&crop); + PSscale = 1.0; /* 1 to 1 mapping by default */ ParseSwitches(argc, argv); *************** *** 408,414 **** if (infile == NULL) fail("Cannot open infile"); if (inType == typeUnknown) ! fail("Input file is not Raster or RasterFile. Do you want 'intype=macpaint'?"); outfile = OpenOutputFile(); if (outfile == NULL) --- 429,435 ---- if (infile == NULL) fail("Cannot open infile"); if (inType == typeUnknown) ! fail("Input file is not Raster or RasterFile. Do you want 'intype=xwd' or 'intype=xbitmap'?"); outfile = OpenOutputFile(); if (outfile == NULL) *** atk/raster/lib/Imakefile Wed Nov 22 12:26:09 1989 --- atk/raster/lib/Imakefile.NEW Tue Mar 20 21:25:25 1990 *************** *** 6,24 **** oldrf.do \ paint.do \ plusspc.do \ ! rasterio.do IHFILES = heximage.ih \ oldrf.ih \ paint.ih \ plusspc.ih \ ! rasterio.ih OBJS = heximage.o \ oldrf.o \ paint.o \ plusspc.o \ ! rasterio.o NormalObjectRule() NormalATKRule() --- 6,27 ---- oldrf.do \ paint.do \ plusspc.do \ ! rasterio.do \ ! xwdio.do IHFILES = heximage.ih \ oldrf.ih \ paint.ih \ plusspc.ih \ ! rasterio.ih \ ! xwdio.ih OBJS = heximage.o \ oldrf.o \ paint.o \ plusspc.o \ ! rasterio.o \ ! xwdio.o NormalObjectRule() NormalATKRule() *** atk/raster/lib/xwdio.c Tue Apr 3 11:41:05 1990 --- atk/raster/lib/xwdio.c.NEW Tue Mar 27 13:58:40 1990 *************** *** 0 **** --- 1,398 ---- + /* + Enable import and export of X Window Dump (version 7) files + paul@athena.mit.edu 1/90 + "...it becomes natural, like a third sense." -- Homer Simpson + */ + + #include + #include / + #include + #include /* NECESSARY? */ + #include + #include + #include + #include + + #include + #include + #define XWD_FILE_VERSION 7 + + long xwdio__ReadRow(ClassID, file, row, nbytes) + + struct classhdr *ClassID; + FILE *file; + unsigned char *row; + long nbytes; + { + + if (fread(row, sizeof(char), nbytes, file) < 0) + return dataobject_PREMATUREEOF; + return dataobject_NOREADERROR; + } + + void xwdio__WriteRow(ClassID, file, row, nbits) + + struct classhdr *ClassID; + FILE *file; + unsigned char *row; + long nbits; + { + + unsigned char reversebuf[BUFBITS >> 3]; + long nbytes = (nbits + 7) >> 3; + + reverse_video(row, reversebuf, nbytes); + fwrite(reversebuf, nbytes, 1, file); + + } + + long xwdio__ReadImage(ClassID, file, pix) + + struct classhdr *ClassID; + FILE *file; + struct pixelimage *pix; + { + unsigned char *row; + long rownum, rowsize; + struct _xwd_file_header hdr; + int win_name_size = 0, ncolors = 0, i = 0; + char win_name[512]; + unsigned long swaptest = 1; + XColor colors[512]; + boolean reduce_pixmap = FALSE, swap = FALSE; + + /* Check byte order of this machine */ + if (*(char *) &swaptest) + { + swap = TRUE; + } + + /* Read the header -- Note that the window name is not part + of the actual header structure, but its size is included in + hdr.header_size. + */ + + if (fread(&hdr, sizeof(hdr), 1, file) < 0) + return dataobject_PREMATUREEOF; + + /* Swap header bytes if necessary */ + + if (swap) _swaplong((char *) &hdr, sizeof(hdr)); + + /* Waiting for pixmap_to_bitmap to be incorporated */ + /* Dither color pixmaps to bitmaps, + NOT DONE YET */ + /* Pur error messages for common unsupported types, + NOT DONE YET */ + + if (hdr.pixmap_depth == 8 && hdr.pixmap_format == ZPixmap) + reduce_pixmap = TRUE; + else if (hdr.pixmap_depth == 8 && hdr.pixmap_format == XYPixmap) + { + fprintf(stderr, "Xwd file is in 8 bit/pixel XYPixmap format, only ZPixmap is supported for 8-bit\n"); + fflush(stderr); + return dataobject_BADFORMAT; + } + else if (hdr.pixmap_depth == 8) + { + fprintf(stderr, "Xwd file is in 8 bit/pixel format of unknown type -- only ZPixmap is supported\n"); + fflush(stderr); + return dataobject_BADFORMAT; + } + else if (hdr.pixmap_depth != 1 && hdr.pixmap_depth !=8) + { + fprintf(stderr, "Xwd file is %d bits/pixel; only 1 bit/pixel or 8-bit ZPixmap are supported\n", + hdr.pixmap_depth ); + fflush(stderr); + return dataobject_BADFORMAT; + } + + + + #if 0 + + /* Complain about unsupported types of xwd */ + + if (hdr.pixmap_depth != 1) + { + fprintf(stderr, "Window dump has %d bits per pixel -- only 1 bit per pixel is supported \n",hdr.pixmap_depth); + fflush(stderr); + return dataobject_BADFORMAT; + } + + #endif + + win_name_size = (hdr.header_size - sizeof(hdr)); + fread(win_name, sizeof(char), win_name_size, file); + + /* Read the colormap */ + + ncolors = hdr.ncolors; + fread((char *) colors, sizeof(XColor), ncolors, file); + + /* Swap colormap bytes if necessary */ + if (swap) + { + for (i = 0; i < ncolors; i++) + { + + _swaplong((char *) &colors[i].pixel, sizeof(long)); + _swapshort((char *) &colors[i].red, sizeof(short)); + _swapshort((char *) &colors[i].green, sizeof(short)); + _swapshort((char *) &colors[i].blue, sizeof(short)); + + } + } + + + /* initialize pixelimage for loading */ + + rowsize = hdr.bytes_per_line; + pixelimage_Resize(pix, (rowsize * 8), hdr.pixmap_height); + row = pixelimage_GetBitsPtr(pix); + + /* read the actual pixelimage */ + + if (reduce_pixmap) + { /* 8-bit ZPixmap version */ + for (rownum = 0; rownum < hdr.pixmap_height; + rownum++, row += hdr.pixmap_width) + { + xwdio_ReadRow(file, row, rowsize); + if (!hdr.bitmap_bit_order) + reverse_bit_order(row, row, rowsize); + pixmap_to_bitmap(row, row, rowsize); + } + } + + else + { /* bitmap version */ + for (rownum = 0; rownum < hdr.pixmap_height; + rownum++, row += rowsize) + { + /* modify image directly, since it is + useless in byte-swapped negative-image form + */ + xwdio_ReadRow(file, row, rowsize); + reverse_video(row, row, rowsize); + if (!hdr.bitmap_bit_order) + reverse_bit_order(row, row, rowsize); + } + } + pixelimage_Resize(pix, hdr.pixmap_width, hdr.pixmap_height); + pixelimage_NotifyObservers(pix, pixelimage_DATACHANGED); + return dataobject_NOREADERROR; + } + + void xwdio__WriteImage(ClassID, file, pix, sub) + + struct classhdr *ClassID; + register FILE *file; + register struct pixelimage *pix; + register struct rectangle *sub; + { + long left, top, width, height; + long buf[BUFBITS>>5]; + struct _xwd_file_header hdr; /* XWD V7 file header */ + long row, bytes_per_row; + char name[7]; + int ncolors = 2; /* black & white*/ + XColor colors[2]; + int i = 0; + unsigned long swaptest = 1; + boolean swap = FALSE; + + /* Check byte order of this machine */ + if (! *(char *) &swaptest) + { + swap = TRUE; + } + + + + + rectangle_GetRectSize(sub, &left, &top, &width, &height); + + /* pad rows out to a multiple of 8 bits */ + bytes_per_row = (width + 7) / 8; + + /* fill in hdr - many values are hardwired + since this isn't a real X11 window dump */ + + strcpy(name,"raster"); + + hdr.header_size = (xwdval) (sizeof(hdr) + sizeof(name)); + hdr.file_version = (xwdval) XWD_FILE_VERSION; + hdr.pixmap_format = (xwdval) ZPixmap; + hdr.pixmap_depth = (xwdval) 1; + hdr.pixmap_width = (xwdval) width; + hdr.pixmap_height = (xwdval) height; + hdr.xoffset = (xwdval) 0; + hdr.byte_order = (xwdval) 1; + hdr.bitmap_unit = (xwdval) 8; + hdr.bitmap_bit_order = (xwdval) 1; + hdr.bitmap_pad = (xwdval) 8; + hdr.bits_per_pixel = (xwdval) 1; + hdr.bytes_per_line = (xwdval) bytes_per_row; + hdr.visual_class = (xwdval) 0; + hdr.red_mask = (xwdval) 0; + hdr.green_mask = (xwdval) 0; + hdr.blue_mask = (xwdval) 0; + hdr.bits_per_rgb = (xwdval) 1; + hdr.colormap_entries = (xwdval) ncolors; + hdr.ncolors = (xwdval) ncolors; + hdr.window_width = (xwdval) width; + hdr.window_height = (xwdval) height; + hdr.window_x = 0; /* not xwdval */ + hdr.window_y = 0; /* not xwdval */ + hdr.window_bdrwidth = (xwdval) 0; + + /* Create colormap */ + colors[0].pixel = 0; /* black */ + colors[0].red = 0; + colors[0].green = 0; + colors[0].blue = 0; + colors[1].pixel = 1; /* white */ + colors[1].red = ~0; + colors[1].green = ~0; + colors[1].blue = ~0; + + /* swap byte order if necessary */ + + if (!swap) + { + _swaplong((char *) &hdr, sizeof(hdr)); + for(i = 0; i < ncolors; i++) + { + _swaplong((char *) &colors[i].pixel, sizeof(long)); + _swapshort((char *) &colors[i].red, sizeof(short)); + _swapshort((char *) &colors[i].green, sizeof(short)); + _swapshort((char *) &colors[i].blue, sizeof(short)); + } + } + + + /* write out header*/ + fwrite(&hdr, sizeof(hdr), 1, file); + + /* write out window name */ + fwrite(name, sizeof(name), 1, file); + + /* write out colormap */ + fwrite((char *) colors, sizeof(XColor), ncolors, file); + + /* write out pixelimage */ + for (row = top; row < top + height; row++) + { + pixelimage_GetRow(pix, left, row, width, buf); + xwdio_WriteRow(file, (unsigned char *)buf, width); + } + } + + _swaplong (bp, n) + register char *bp; + register unsigned n; + { + register char c; + register char *ep = bp + n; + register char *sp; + + while (bp < ep) + { + sp = bp + 3; + c = *sp; + *sp = *bp; + *bp++ = c; + sp = bp + 1; + c = *sp; + *sp = *bp; + *bp++ = c; + bp += 2; + + } + } + + _swapshort (bp, n) + register char *bp; + register unsigned n; + { + register char c; + register char *ep = bp + n; + + while (bp < ep) + { + c = *bp; + *bp = *(bp + 1); + bp++; + *bp++ = c; + } + } + + reverse_bit_order(location, output, nbytes) + unsigned char *location, *output; + long nbytes; + { + unsigned char *end = location + nbytes; + static unsigned char reverse_table[256] = { + 0x00,0x80,0x40,0xc0,0x20,0xa0,0x60,0xe0,0x10,0x90,0x50,0xd0,0x30,0xb0,0x70,0xf0, + 0x08,0x88,0x48,0xc8,0x28,0xa8,0x68,0xe8,0x18,0x98,0x58,0xd8,0x38,0xb8,0x78,0xf8, + 0x04,0x84,0x44,0xc4,0x24,0xa4,0x64,0xe4,0x14,0x94,0x54,0xd4,0x34,0xb4,0x74,0xf4, + 0x0c,0x8c,0x4c,0xcc,0x2c,0xac,0x6c,0xec,0x1c,0x9c,0x5c,0xdc,0x3c,0xbc,0x7c,0xfc, + 0x02,0x82,0x42,0xc2,0x22,0xa2,0x62,0xe2,0x12,0x92,0x52,0xd2,0x32,0xb2,0x72,0xf2, + 0x0a,0x8a,0x4a,0xca,0x2a,0xaa,0x6a,0xea,0x1a,0x9a,0x5a,0xda,0x3a,0xba,0x7a,0xfa, + 0x06,0x86,0x46,0xc6,0x26,0xa6,0x66,0xe6,0x16,0x96,0x56,0xd6,0x36,0xb6,0x76,0xf6, + 0x0e,0x8e,0x4e,0xce,0x2e,0xae,0x6e,0xee,0x1e,0x9e,0x5e,0xde,0x3e,0xbe,0x7e,0xfe, + 0x01,0x81,0x41,0xc1,0x21,0xa1,0x61,0xe1,0x11,0x91,0x51,0xd1,0x31,0xb1,0x71,0xf1, + 0x09,0x89,0x49,0xc9,0x29,0xa9,0x69,0xe9,0x19,0x99,0x59,0xd9,0x39,0xb9,0x79,0xf9, + 0x05,0x85,0x45,0xc5,0x25,0xa5,0x65,0xe5,0x15,0x95,0x55,0xd5,0x35,0xb5,0x75,0xf5, + 0x0d,0x8d,0x4d,0xcd,0x2d,0xad,0x6d,0xed,0x1d,0x9d,0x5d,0xdd,0x3d,0xbd,0x7d,0xfd, + 0x03,0x83,0x43,0xc3,0x23,0xa3,0x63,0xe3,0x13,0x93,0x53,0xd3,0x33,0xb3,0x73,0xf3, + 0x0b,0x8b,0x4b,0xcb,0x2b,0xab,0x6b,0xeb,0x1b,0x9b,0x5b,0xdb,0x3b,0xbb,0x7b,0xfb, + 0x07,0x87,0x47,0xc7,0x27,0xa7,0x67,0xe7,0x17,0x97,0x57,0xd7,0x37,0xb7,0x77,0xf7, + 0x0f,0x8f,0x4f,0xcf,0x2f,0xaf,0x6f,0xef,0x1f,0x9f,0x5f,0xdf,0x3f,0xbf,0x7f,0xff, + }; + + while(location < end) + *output++ = reverse_table[*location++]; + } + + reverse_video(location, output, nbytes) + /* invert black/white values: + raster: 0 = white, 1 = black + xwd: 0 = black, 1 = white + */ + unsigned char *location, *output; + long nbytes; + { + unsigned char *end = location + nbytes; + + while(location < end) + *output++ = ~(*location++); + + } + + /* This routine comes from Brian Michon and hasn't been modified and incorporated yet. It converts 8-bit pixmaps to bitmaps */ + + pixmap_to_bitmap(location, output, nbytes) + unsigned char *location, *output; + long nbytes; + { + register int x, c, b; + + /* + * The slow but robust brute force method of converting the image: + */ + c = 0; b = 1; + for (x = 0; x < nbytes;) + { + if (*(location + x)) + c |= b; + b <<= 1; + if (!(++x & 7)) + { + *(output++) = c; + c = 0; b = 1; + } + } + } + *** atk/raster/lib/xwdio.ch Tue Apr 3 11:41:17 1990 --- atk/raster/lib/xwdio.ch.NEW Tue Mar 20 21:26:03 1990 *************** *** 0 **** --- 1,51 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/xwdio.ch,v 1.1 90/03/15 12:43:40 gk5g Exp $ */ + /* $ACIS:xwdio.ch 1.3$ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/xwdio.ch,v $ */ + + #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) + static char *rcsidxwdio_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/xwdio.ch,v 1.1 90/03/15 12:43:40 gk5g Exp $"; + #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + + + /* xwdio.H + + xwdio package + + Routines for reading and writing rasters in the old ITC format + as defined by rastfile.h + + The data stream begins with a 14 or 16 byte header, + which is followed by the bits of the data. + + */ + + #include + + #define xwdio_PROGRAMMERVERSION 1 + + #define BUFBITS (1<<17) + + package xwdio[xwdio] { + + classprocedures: + + WriteRow(FILE *file, unsigned char *byteaddr, long nbytes); + /* write to 'file' the xwdio form representation of the 'nbytes' + bytes starting at location 'byteaddr' */ + + ReadRow(FILE *file, unsigned char *row, long length) returns long; + /* Reads from 'file' the encoding of bytes to fill in 'row'. Row will be + truncated or padded (with WHITE) to exactly 'length' bytes. + */ + ReadImage(FILE *file, struct pixelimage *pix) returns long; + /* Read a raster image from 'file' and put it in 'pix' + return error code */ + WriteImage(FILE *file, struct pixelimage *pix, struct rectangle *sub); + /* Write a raster image to 'file' from 'pix' */ + + }; + *** atk/rofftext/hash.c Wed Nov 22 12:27:30 1989 --- atk/rofftext/hash.c.NEW Mon Mar 26 12:13:54 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/hash.c,v 2.3 89/02/17 17:05:00 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/hash.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/hash.c,v 2.3 89/02/17 17:05:00 ghoti Exp $ "; #endif /* lint */ /* A hash table */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/hash.c,v 2.4 90/03/22 09:32:23 ajp Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/hash.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/hash.c,v 2.4 90/03/22 09:32:23 ajp Exp $ "; #endif /* lint */ /* A hash table */ *************** *** 157,162 **** --- 157,188 ---- return egg->value; } } + + void hash__Clear(self, valFree) + struct hash *self; + procedure valFree; + { + int i; + struct egg *egg; + struct glist *gl; + + for (i=0;ibuckets[i]) != NULL) { + while ((egg = (struct egg *) glist_Pop(gl)) != NULL) { + if (egg->key != NULL) { + free(egg->key); + } + if (egg->value != NULL && valFree != NULL) { + (*valFree)(egg->value); + } + free(egg); + } + glist_Destroy(self->buckets[i]); + self->buckets[i] = NULL; + } + } + } + PrintAll(egg,nothing) struct egg *egg; *** atk/rofftext/hash.ch Wed Nov 22 12:27:28 1989 --- atk/rofftext/hash.ch.NEW Mon Mar 26 12:13:56 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/hash.ch,v 2.4 89/02/17 17:05:06 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/hash.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_hash_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/hash.ch,v 2.4 89/02/17 17:05:06 ghoti Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* A hash table --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/hash.ch,v 2.5 90/03/22 09:32:48 ajp Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/hash.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_hash_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/hash.ch,v 2.5 90/03/22 09:32:48 ajp Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* A hash table *************** *** 27,32 **** --- 27,33 ---- Store(char *key, char *value); Delete(char *key) returns char *; Rename(char *key, char *new) returns char *; + Clear(procedure valFree); Debug(); macromethods: SetHash(fn) (self->hash = (fn)) *** atk/rofftext/roffchrs.c Wed Nov 22 12:27:33 1989 --- atk/rofftext/roffchrs.c.NEW Mon Mar 26 12:13:56 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffchrs.c,v 2.4 89/02/17 17:05:12 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffchrs.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffchrs.c,v 2.4 89/02/17 17:05:12 ghoti Exp $ "; #endif /* lint */ /* special chars for rofftext.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffchrs.c,v 2.5 90/03/22 09:34:00 ajp Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffchrs.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffchrs.c,v 2.5 90/03/22 09:34:00 ajp Exp $ "; #endif /* lint */ /* special chars for rofftext.c *************** *** 18,24 **** #include #include ! #define Mangle(self,name,def) hash_Store(self->SpecialChars,name,def) InitChars(self) struct rofftext *self; --- 18,24 ---- #include #include ! #define Mangle(self,name,def) hash_Store(self->SpecialChars,name,StrDup(def)) InitChars(self) struct rofftext *self; *** atk/rofftext/roffcmds.c Mon Mar 12 13:16:18 1990 --- atk/rofftext/roffcmds.c.NEW Mon Mar 26 12:14:00 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/rofftext/RCS/roffcmds.c,v 2.7 90/02/09 14:38:42 susan Exp Locker: susan $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/rofftext/RCS/roffcmds.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/rofftext/RCS/roffcmds.c,v 2.7 90/02/09 14:38:42 susan Exp Locker: susan $ "; #endif /* lint */ /* rofftext --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffcmds.c,v 2.8 90/03/22 11:23:40 ajp Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffcmds.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffcmds.c,v 2.8 90/03/22 11:23:40 ajp Exp $ "; #endif /* lint */ /* rofftext *************** *** 255,260 **** --- 255,261 ---- char *macro,*existing,*name = StrDup(argv[1]); char *end = StrDup(argv[2]); static BUF b = NULL; + char *oldValue; if (b == NULL) b = NewBuf(); *************** *** 279,285 **** --- 280,291 ---- DEBUG((stderr,"--Defining Macro (%s)--\n",name)); + oldValue = hash_Delete(self->Macros, name); + if (oldValue != NULL) { + free(oldValue); + } hash_Store(self->Macros,name,macro); + hash_Delete(self->Commands, name); hash_Store(self->Commands,name,DoMacro); free(name); free(end); *************** *** 643,649 **** /* check location for trap */ EvalString(self,argv[1],&result,scale_u,&absolute,&relative); if (!relative && !absolute && (result == 0)) { ! DEBUG((stderr,"Setting beginning trap\n")); self->v_Trap = StrDup(argv[2]); } /* foo */ --- 649,658 ---- /* check location for trap */ EvalString(self,argv[1],&result,scale_u,&absolute,&relative); if (!relative && !absolute && (result == 0)) { ! DEBUG((stderr,"Setting beginning trap\n")); ! if (self->v_Trap != NULL) { ! free(self->v_Trap); ! } self->v_Trap = StrDup(argv[2]); } /* foo */ *************** *** 719,724 **** --- 728,736 ---- self->CurrentEnviron->NextInputTrap = 0; } else { + if (self->CurrentEnviron->InputTrapCmd != NULL) { + free(self->CurrentEnviron->InputTrapCmd); + } self->CurrentEnviron->InputTrapCmd = StrDup(argv[2]); EvalString(self,argv[1], &result, scale_u,NULL,NULL); self->CurrentEnviron->NextInputTrap = result + self->v_InputLineCount; *** atk/rofftext/rofftext.c Mon Mar 12 13:16:21 1990 --- atk/rofftext/rofftext.c.NEW Mon Mar 26 12:14:02 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/rofftext/RCS/rofftext.c,v 2.15 90/02/09 15:19:23 susan Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/rofftext/RCS/rofftext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/rofftext/RCS/rofftext.c,v 2.15 90/02/09 15:19:23 susan Exp $ "; #endif /* lint */ /* rofftext --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/rofftext.c,v 2.16 90/03/22 09:33:27 ajp Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/rofftext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/rofftext.c,v 2.16 90/03/22 09:33:27 ajp Exp $ "; #endif /* lint */ /* rofftext *************** *** 60,65 **** --- 60,74 ---- * */ + FreeTrap(trap) + struct trap *trap; + { + if (trap->macro != NULL) + free(trap->macro); + + free(trap); + } + SetIndent(self,u) struct rofftext *self; int u; *************** *** 145,150 **** --- 154,169 ---- DestroyContext(c) IC c; { + int i; + + if (c->argv != NULL) { + for (i = 0; i < c->argc; i++) { + if (c->argv[i] != NULL && *c->argv[i] != '\0') { + free(c->argv[i]); + } + } + free(c->argv); + } free(c); } *************** *** 244,251 **** } if ((c == EOF) && (cur->prev != NULL)) { t->t = cur->prev; ! if (cur->type == trickle_File) fclose(cur->u.f); else { if (cur->pop) { /* pop macro argument stack */ --- 263,274 ---- } if ((c == EOF) && (cur->prev != NULL)) { t->t = cur->prev; ! if (cur->type == trickle_File) { fclose(cur->u.f); + if (cur->filename != NULL) { + free(cur->filename); + } + } else { if (cur->pop) { /* pop macro argument stack */ *************** *** 255,261 **** DEBUG((stderr, "Popping input stream\n")); } free(cur->buf); ! } free(cur); c = g(self,t); } --- 278,284 ---- DEBUG((stderr, "Popping input stream\n")); } free(cur->buf); ! } free(cur); c = g(self,t); } *************** *** 383,390 **** self->CurrentContext->argv = (char **)malloc(sizeof(char *)*10); self->CurrentContext->argc = argc; ! for(i=0;iCurrentContext->argv[i] = StrDup(argv[i]); } while(i<10) self->CurrentContext->argv[i++] = ""; --- 406,416 ---- self->CurrentContext->argv = (char **)malloc(sizeof(char *)*10); self->CurrentContext->argc = argc; ! for(i=0;iCurrentContext->argv[i] = StrDup(argv[i]); ! else ! self->CurrentContext->argv[i] = ""; } while(i<10) self->CurrentContext->argv[i++] = ""; *************** *** 1131,1137 **** self->filename = NULL; self->HelpMode = FALSE; self->BeCompletelyBogus = FALSE; ! self->EndMacros = glist_New(); self->PrintWarnings = FALSE; return TRUE; } --- 1157,1163 ---- self->filename = NULL; self->HelpMode = FALSE; self->BeCompletelyBogus = FALSE; ! self->EndMacros = glist_Create(FreeTrap); self->PrintWarnings = FALSE; return TRUE; } *************** *** 1358,1364 **** cmd = (procedure)(long)hash_Lookup(self->Commands,t->macro); self->Nullarg[0] = t->macro; if (cmd) ! (*cmd)(self,self->Input,0,1,self->Nullarg); } } Set_BOL(self); --- 1384,1391 ---- cmd = (procedure)(long)hash_Lookup(self->Commands,t->macro); self->Nullarg[0] = t->macro; if (cmd) ! (*cmd)(self,self->Input,0,1,self->Nullarg); ! FreeTrap(t); } } Set_BOL(self); *************** *** 1368,1373 **** --- 1395,1405 ---- put(self,'\n'); CloseAllStyles(self); + if (self->Input->t != NULL) { + free(self->Input->t); + } + free(self->Input); + self->Input = NULL; return dataobject_NOREADERROR; } *************** *** 1391,1399 **** void rofftext__FinalizeObject(classID,self) struct classheader *classID; struct rofftext *self; ! {} void rofftext__SetAttributes(self,atts) --- 1423,1494 ---- void rofftext__FinalizeObject(classID,self) struct classheader *classID; struct rofftext *self; ! { ! int i; + if (self->v_Trap != NULL) { + free(self->v_Trap); + } + if (self->Registers != NULL) { + hash_Clear(self->Registers, free); + hash_Destroy(self->Registers); + } + if (self->Commands != NULL) { + /* Need to clear out the keys */ + hash_Clear(self->Commands, NULL); + hash_Destroy(self->Commands); + } + if (self->Macros != NULL) { + /* Need to clear out both the keys and the values */ + hash_Clear(self->Macros, free); + hash_Destroy(self->Macros); + } + if (self->Goofy) { + /* Need to clear out the keys */ + hash_Clear(self->Goofy, NULL); + hash_Destroy(self->Goofy); + } + if (self->ArgStack != NULL) { + glist_Destroy(self->ArgStack); + } + if (self->SpecialChars != NULL) { + /* Need top clear out both the key and the values */ + hash_Clear(self->SpecialChars, free); + hash_Destroy(self->SpecialChars); + } + + if (self->CurrentContext != NULL) { + DestroyContext(self->CurrentContext); + } + + /* initialize indents */ + for (i=0;iIndentName[i]); + free(self->TempIndentName[i]); + free(self->MinusTempIndentName[i]); + } + + if (self->EnvironStack != NULL) + glist_Destroy(self->EnvironStack); + if (self->DiversionStack != NULL) + glist_Destroy(self->DiversionStack); + if (self->CurrentDiversion != NULL) + DestroyDiversion(self, self->CurrentDiversion); + + DestroyEnvirons(self); + + if (self->stack != NULL) { + free(self->stack); + } + if (self->tempstack != NULL) { + free(self->tempstack); + } + + if (self->EndMacros != NULL) { + glist_Destroy(self->EndMacros); + } + } void rofftext__SetAttributes(self,atts) *** atk/support/buffer.c Wed Nov 22 12:28:16 1989 --- atk/support/buffer.c.NEW Tue Apr 3 11:20:56 1990 *************** *** 4,17 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/buffer.c,v 2.16 89/11/01 11:18:27 wjh Exp $ */ /* $ACIS:buffer.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/buffer.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/buffer.c,v 2.16 89/11/01 11:18:27 wjh Exp $"; #endif /* lint */ #include #include /* sys/types.h sys/file.h */ #include --- 4,32 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v 2.20 90/03/07 11:37:41 gk5g Exp Locker: gk5g $ */ /* $ACIS:buffer.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v 2.20 90/03/07 11:37:41 gk5g Exp Locker: gk5g $"; #endif /* lint */ + /* Fixed problem in buffer_WriteToFile 3/2/90 cch@mtgzx.att.com. + + The problem was that it is creating a temporary filename by appending + the string .NEW (and even . if necessary). If the file is on a + Unix V file system, filenames are truncated to 14 characters, and there is + no guarantee that the temp filename will be unique. This sends the routine + into an infinite loop. This fix uncovers a bug elsewhere, in which the + file can be deleted if the checkpoint filename (when truncated to 14 + characters ) is the same as the file being saved. In this case the file is + deleted as soon as it is stored, with no notice or warning. + + To use short temporary filenames, define USESHORTFILENAMES in + your site.h file. + */ + #include #include /* sys/types.h sys/file.h */ #include *************** *** 37,45 **** --- 52,94 ---- static struct buffer *allBuffers; static char *backupExtension = NULL; static char *checkpointExtension = ".CKP"; + static char *checkpointDirectory = NULL; static boolean overwriteFiles = TRUE; static char defaultobjectname[64] = DEFAULTOBJECT; + static void SetCheckpointFilename(self) + struct buffer *self; + { + /* For this routine to work properly buffer names must be unique. */ + /* If they are not then the user might lose some information */ + + if (self->ckpFilename != NULL) { + free(self->ckpFilename); + } + + if (checkpointDirectory != NULL) { + char *basename; + + basename = rindex(self->bufferName, '/'); + if (basename == NULL) { + basename = self->bufferName; + } + else { + basename++; + } + self->ckpFilename = malloc(strlen(checkpointDirectory) + strlen(basename) + strlen(checkpointExtension) + 2); + sprintf(self->ckpFilename, "%s/%s%s", checkpointDirectory, basename, checkpointExtension); + } + else { + char *filename = (self->filename != NULL) ? self->filename : self->bufferName; + + self->ckpFilename = malloc(strlen(filename) + strlen(checkpointExtension) + 1); + strcpy(self->ckpFilename, filename); + strcat(self->ckpFilename, checkpointExtension); + } + } + + boolean buffer__InitializeObject(classID, self) struct classheader *classID; struct buffer *self; *************** *** 116,132 **** len = strlen(filename); thisBuffer->filename = malloc(len + 1); strcpy(thisBuffer->filename, filename); - thisBuffer->ckpFilename = malloc(len + strlen(checkpointExtension) + 1); - strcpy(thisBuffer->ckpFilename, filename); - strcat(thisBuffer->ckpFilename, checkpointExtension); } ! else { ! int len; ! len = strlen(bufferName); ! thisBuffer->ckpFilename = malloc(len + strlen(checkpointExtension) + 1); ! strcpy(thisBuffer->ckpFilename, bufferName); ! strcat(thisBuffer->ckpFilename, checkpointExtension); ! } if (data == NULL) { struct attributes *attributes = NULL; --- 165,174 ---- len = strlen(filename); thisBuffer->filename = malloc(len + 1); strcpy(thisBuffer->filename, filename); } ! ! SetCheckpointFilename(thisBuffer); ! if (data == NULL) { struct attributes *attributes = NULL; *************** *** 272,285 **** filename = realName; if (self->filename) free(self->filename); - if (self->ckpFilename) - free(self->ckpFilename); len = strlen(filename); self->filename = malloc(len + 1); strcpy(self->filename, filename); ! self->ckpFilename = malloc(len + strlen(checkpointExtension) + 1); ! strcpy(self->ckpFilename, filename); ! strcat(self->ckpFilename, checkpointExtension); self->lastTouchDate = buffer_GetFileDate(self); buffer_NotifyObservers(self, 0);/* Tuck it into slot. */ } --- 314,323 ---- filename = realName; if (self->filename) free(self->filename); len = strlen(filename); self->filename = malloc(len + 1); strcpy(self->filename, filename); ! SetCheckpointFilename(self); self->lastTouchDate = buffer_GetFileDate(self); buffer_NotifyObservers(self, 0);/* Tuck it into slot. */ } *************** *** 685,690 **** --- 723,729 ---- } else if ((flags & buffer_ReliableWrite) && fileExists) { + #ifndef USESHORTFILENAMES char *endString; int counter = 1; *************** *** 693,698 **** --- 732,752 ---- endString = tempFilename + strlen(tempFilename); while (access(tempFilename, F_OK) >= 0) /* While the file exists. */ sprintf(endString, ".%d", counter++); + #else /* USESHORTFILENAMES */ + char *endString, *basename; + int counter = 1; + + strcpy(tempFilename, filename); + basename = rindex(tempFilename, '/'); + if (basename == NULL) basename = tempFilename; + else basename++; + if (strlen(basename) > 8) basename[8] = '\0'; + strcat(tempFilename, ".NEW"); + endString = tempFilename + strlen(tempFilename); + while (access(tempFilename, F_OK) >= 0 && counter < 10) /* While the file exists. */ + sprintf(endString, ".%d", counter++); + if (counter == 10) return -1; + #endif /* USESHORTFILENAMES */ originalFilename = filename; filename = tempFilename; } *************** *** 785,790 **** --- 839,849 ---- if ((s = environ_GetProfile("CheckpointExtension")) != NULL) { checkpointExtension = malloc(strlen(s) + 1); strcpy(checkpointExtension, s); + } + + if ((s = environ_GetProfile("CheckpointDirectory")) != NULL) { + checkpointDirectory = malloc(strlen(s) + 1); + strcpy(checkpointDirectory, s); } overwriteFiles = environ_GetProfileSwitch("OverwriteFiles", overwriteFiles); *** atk/supportviews/matte.c Wed Nov 22 12:30:41 1989 --- atk/supportviews/matte.c.NEW Tue Apr 3 11:21:17 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/matte.c,v 2.8 89/04/10 18:01:52 ghoti Exp $ */ /* $ACIS:matte.c 1.8$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/matte.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/matte.c,v 2.8 89/04/10 18:01:52 ghoti Exp $"; #endif /* lint */ #define UNSET 0 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/matte.c,v 2.9 90/04/03 11:19:14 gk5g Exp $ */ /* $ACIS:matte.c 1.8$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/matte.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/matte.c,v 2.9 90/04/03 11:19:14 gk5g Exp $"; #endif /* lint */ #define UNSET 0 *************** *** 255,268 **** enclosingRect.top = 0; enclosingRect.left = 0; enclosingRect.width = matte_GetLogicalWidth(self) -1 ; enclosingRect.height = matte_GetLogicalHeight(self) -1 ; ! UpdateCursors(self); ! matte_SetTransferMode(self,graphic_WHITE); ! matte_DrawRect(self,&enclosingRect); ! matte_SetTransferMode(self,graphic_INVERT); ! if(self->drawing){ ! matte_DrawRect(self,&enclosingRect); } - self->OldMode = self->drawing; enclosingRect.top++; enclosingRect.left++; enclosingRect.width-- ; enclosingRect.height-- ; --- 255,272 ---- enclosingRect.top = 0; enclosingRect.left = 0; enclosingRect.width = matte_GetLogicalWidth(self) -1 ; enclosingRect.height = matte_GetLogicalHeight(self) -1 ; ! if(type != view_Remove){ ! UpdateCursors(self); ! if(type != view_MoveNoRedraw){ ! matte_SetTransferMode(self,graphic_WHITE); ! matte_DrawRect(self,&enclosingRect); ! matte_SetTransferMode(self,graphic_INVERT); ! if(self->drawing){ ! matte_DrawRect(self,&enclosingRect); ! } ! self->OldMode = self->drawing; ! } } enclosingRect.top++; enclosingRect.left++; enclosingRect.width-- ; enclosingRect.height-- ; *** atk/supportviews/scroll.c Wed Nov 22 12:30:29 1989 --- atk/supportviews/scroll.c.NEW Tue Apr 3 11:21:21 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/scroll.c,v 2.12 89/06/10 17:23:08 wjh Exp $ */ /* $ACIS:scroll.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/scroll.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/scroll.c,v 2.12 89/06/10 17:23:08 wjh Exp $"; #endif /* lint */ /* Scrollbar code for be2. */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v 2.13 90/04/03 11:19:55 gk5g Exp $ */ /* $ACIS:scroll.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v 2.13 90/04/03 11:19:55 gk5g Exp $"; #endif /* lint */ /* Scrollbar code for be2. */ *************** *** 905,912 **** long left, top, width, height; { int i; ! struct rectangle rect, crect; self->force_full_update = FALSE; if (self->force_get_interface) for (i = 0; i < scroll_TYPES; i++) --- 905,913 ---- long left, top, width, height; { int i; ! struct rectangle rect, crect, VB; + scroll_GetVisualBounds(self, &VB); self->force_full_update = FALSE; if (self->force_get_interface) for (i = 0; i < scroll_TYPES; i++) *************** *** 913,951 **** self->fns[i] = NULL; if (self->child) { rectangle_SetRectSize(&rect, self->left, self->top, self->width, self->height); view_InsertView(self->child, self, &rect); rectangle_SetRectSize(&crect, left, top, width, height); rectangle_IntersectRect(&crect, &crect, &rect); ! view_FullUpdate(self->child, type, crect.left - self->left, crect.top - self->top, ! crect.width, crect.height); ! /* Is it possible that the scrollee has changed his mind about the scrollbar locations now that he has been redrawn? If so, we need to account for his area changing, and recalling his full update. Then what if he changes his mind again? */ ! calc_desired(self); } ! if (type != view_FullRedraw && type != view_LastPartialRedraw) ! return; ! ! if (self->left > 0) { ! if (self->top > 0) { ! rectangle(self, 0, 0, self->left - 1, self->top - 1, self->cornerFill); ! } ! if (self->height + self->top < scroll_GetLogicalHeight(self)) { ! rectangle(self, 0, self->height + self->top, self->left - 1, scroll_GetLogicalHeight(self) - 1, self->cornerFill); ! } } - if (self->width + self->left < scroll_GetLogicalWidth(self)) { - int left = self->width + self->left; - - if (self->top > 0) { - rectangle(self, left, 0, scroll_GetLogicalWidth(self) - 1, self->top - 1, self->cornerFill); - } - if (self->height + self->top < scroll_GetLogicalHeight(self)) { - rectangle(self, left, self->height + self->top, scroll_GetLogicalWidth(self) - 1, scroll_GetLogicalHeight(self) - 1, self->cornerFill); - } - } - for (i = 0; i < scroll_SIDES; i++) if (self->desired.location & (1<desired.bar[Type[i]].endzones = bar_height(self, i) >= self->endzone_threshold; --- 914,951 ---- self->fns[i] = NULL; if (self->child) { + scroll_RetractViewCursors(self,self->child); rectangle_SetRectSize(&rect, self->left, self->top, self->width, self->height); view_InsertView(self->child, self, &rect); rectangle_SetRectSize(&crect, left, top, width, height); rectangle_IntersectRect(&crect, &crect, &rect); ! view_FullUpdate(self->child, type, crect.left - self->left, crect.top - self->top, crect.width, crect.height); } + /* If visual rectangle is bogus-- leave. */ + if(type == view_Remove || rectangle_IsEmptyRect(&VB) ) return; + if(type != view_MoveNoRedraw) { + /* Is it possible that the scrollee has changed his mind about the scrollbar locations now that he has been redrawn? If so, we need to account for his area changing, and recalling his full update. Then what if he changes his mind again? */ + if(self->child) calc_desired(self); + if (self->left > 0) { + if (self->top > 0) { + rectangle(self, 0, 0, self->left - 1, self->top - 1, self->cornerFill); + } + if (self->height + self->top < scroll_GetLogicalHeight(self)) { + rectangle(self, 0, self->height + self->top, self->left - 1, scroll_GetLogicalHeight(self) - 1, self->cornerFill); + } + } + if (self->width + self->left < scroll_GetLogicalWidth(self)) { + int left = self->width + self->left; ! if (self->top > 0) { ! rectangle(self, left, 0, scroll_GetLogicalWidth(self) - 1, self->top - 1, self->cornerFill); ! } ! if (self->height + self->top < scroll_GetLogicalHeight(self)) { ! rectangle(self, left, self->height + self->top, scroll_GetLogicalWidth(self) - 1, scroll_GetLogicalHeight(self) - 1, self->cornerFill); ! } ! } } for (i = 0; i < scroll_SIDES; i++) if (self->desired.location & (1<desired.bar[Type[i]].endzones = bar_height(self, i) >= self->endzone_threshold; *************** *** 969,976 **** else scroll_RetractCursor(self, self->cursor[i]); ! self->current = self->desired; ! scroll_FlushGraphics(self); } /* Overrides of the view routines: */ --- 969,978 ---- else scroll_RetractCursor(self, self->cursor[i]); ! if(type != view_MoveNoRedraw){ ! self->current = self->desired; ! scroll_FlushGraphics(self); ! } } /* Overrides of the view routines: */ *** atk/table/print.c Wed Nov 22 12:31:12 1989 --- atk/table/print.c.NEW Tue Mar 20 21:34:04 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/print.c,v 1.4 89/03/13 14:09:44 jhh Exp $ */ /* $ACIS:print.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/print.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/print.c,v 1.4 89/03/13 14:09:44 jhh Exp $"; #endif /* lint */ extern char * fcvt(); --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v 1.5 90/03/01 13:12:13 tpn Exp $ */ /* $ACIS:print.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v 1.5 90/03/01 13:12:13 tpn Exp $"; #endif /* lint */ extern char * fcvt(); *************** *** 289,301 **** struct cell *cell; int k; int hadchild; ! int ch; ! hadchild = 0; fprintf(f, ".mk\n"); for (c = 0; c < table_NumberOfColumns(T); c++) { if (TabType(T, r, c) == 'N') continue; cell = table_GetCell(T, r, c); fprintf(f, "\t"); switch (cell->celltype) { --- 289,302 ---- struct cell *cell; int k; int hadchild; ! int ch,didprint; ! hadchild = didprint = 0; fprintf(f, ".mk\n"); for (c = 0; c < table_NumberOfColumns(T); c++) { if (TabType(T, r, c) == 'N') continue; + didprint++; cell = table_GetCell(T, r, c); fprintf(f, "\t"); switch (cell->celltype) { *************** *** 317,322 **** --- 318,324 ---- break; } } + if(didprint == 0) fprintf(f,"\\&"); fprintf(f, "\n"); if (hadchild) fprintf(f, ".sp |\\n(.hu\n"); *** atk/text/drawtxtv.c Wed Nov 22 12:32:10 1989 --- atk/text/drawtxtv.c.NEW Tue Apr 3 11:21:51 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/drawtxtv.c,v 2.20 89/11/02 10:38:42 zs01 Exp $ */ /* $ACIS:drawtxtv.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/drawtxtv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/drawtxtv.c,v 2.20 89/11/02 10:38:42 zs01 Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v 2.22 90/04/03 11:37:50 gk5g Exp $ */ /* $ACIS:drawtxtv.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v 2.22 90/04/03 11:37:50 gk5g Exp $"; #endif /* lint */ #include *************** *** 25,31 **** #include #include #include ! static struct graphic *pat; #define Text(self) \ --- 25,31 ---- #include #include #include ! #define textview_MOVEVIEW 99999999 static struct graphic *pat; #define Text(self) \ *************** *** 480,491 **** { struct environment *myEnv; long lastEnvPos = 0; ! register char *tp, tc; long nChars, pos, bufEnd, tabWidth; long pi; /* Value from ParagraphIndent */ long i, localWidth, initPos, localRubber; int lastWidth = 0; /* Width just before the last rubber space */ ! char *lastBP; /* &linebuffer[linebp] just before last rubber space */ long lastIP; /* Line item index containing last space */ long lastPos; /* Text pos just before the last space */ short passes; --- 480,491 ---- { struct environment *myEnv; long lastEnvPos = 0; ! register unsigned char *tp, tc; long nChars, pos, bufEnd, tabWidth; long pi; /* Value from ParagraphIndent */ long i, localWidth, initPos, localRubber; int lastWidth = 0; /* Width just before the last rubber space */ ! unsigned char *lastBP; /* &linebuffer[linebp] just before last rubber space */ long lastIP; /* Line item index containing last space */ long lastPos; /* Text pos just before the last space */ short passes; *************** *** 492,498 **** long dotPos = -1, markPos = -1; boolean FoundmarkPos = FALSE, FounddotPos = FALSE, oncePerLine; long bufLen; ! char *buf = NULL; if (self->predrawn && mark_GetLength(self->predrawn) > 0 && mark_GetPos(self->predrawn) == mark_GetPos(currentLine)) --- 492,498 ---- long dotPos = -1, markPos = -1; boolean FoundmarkPos = FALSE, FounddotPos = FALSE, oncePerLine; long bufLen; ! unsigned char *buf = NULL; if (self->predrawn && mark_GetLength(self->predrawn) > 0 && mark_GetPos(self->predrawn) == mark_GetPos(currentLine)) *************** *** 707,713 **** break; } if (bufLen == 0) /* filbuf */ ! buf = text_GetBuf(Text(self), pos, 1024, &bufLen); tc = *buf++, bufLen--, pos++; } while (tc != '\n'); --- 707,713 ---- break; } if (bufLen == 0) /* filbuf */ ! buf = (unsigned char *) text_GetBuf(Text(self), pos, 1024, &bufLen); tc = *buf++, bufLen--, pos++; } while (tc != '\n'); *************** *** 748,754 **** break; /* are we done yet? */ if (bufLen == 0) /* filbuf */ ! buf = text_GetBuf(Text(self), pos, 1024, &bufLen); tc = *buf++, bufLen--, pos++; if (tc == ' ') { --- 748,754 ---- break; /* are we done yet? */ if (bufLen == 0) /* filbuf */ ! buf = (unsigned char *) text_GetBuf(Text(self), pos, 1024, &bufLen); tc = *buf++, bufLen--, pos++; if (tc == ' ') { *************** *** 1429,1451 **** elen = environment_GetNextChange(text->rootEnvironment, i); if (elen + i > end) elen = end - i; ! if (curenv->type == environment_View && ! ((CurView = (struct view *) dictionary_LookUp(self, ! (char *) (curenv->data.viewref))) != NULL)) { ! textview_RetractViewCursors(self, CurView); ! if (movement == textview_REMOVEVIEW) { ! rectangle_SetRectSize(&enclosingRect, 0, 0, 0, 0); ! view_InsertView(CurView, self, &enclosingRect); ! view_FullUpdate(CurView, view_Remove, 0, 0, 0, 0); ! } else { ! view_GetEnclosedBounds(CurView, &enclosingRect); ! rectangle_Top(&enclosingRect) += movement; ! view_InsertView(CurView, self, &enclosingRect); ! view_FullUpdate(CurView, ! view_MoveNoRedraw, 0, 0, 0, 0); ! } ! } ! elen += i; ! i = elen; } } --- 1429,1457 ---- elen = environment_GetNextChange(text->rootEnvironment, i); if (elen + i > end) elen = end - i; ! if (curenv->type == environment_View && ! ((CurView = (struct view *) ! dictionary_LookUp(self,(char *) (curenv->data.viewref))) != NULL)) { ! textview_RetractViewCursors(self, CurView); ! if (movement == textview_REMOVEVIEW) { ! rectangle_SetRectSize(&enclosingRect, 0, 0, 0, 0); ! view_InsertView(CurView, self, &enclosingRect); ! view_FullUpdate(CurView, view_Remove, 0, 0, 0, 0); ! } ! else if( movement == textview_MOVEVIEW){ ! view_GetEnclosedBounds(CurView, &enclosingRect); ! view_InsertView(CurView, self, &enclosingRect); ! view_FullUpdate(CurView, view_MoveNoRedraw, 0, 0, 0, 0); ! } ! else { ! view_GetEnclosedBounds(CurView, &enclosingRect); ! rectangle_Top(&enclosingRect) += movement; ! view_InsertView(CurView, self, &enclosingRect); ! view_FullUpdate(CurView, ! view_MoveNoRedraw, 0, 0, 0, 0); ! } ! } ! elen += i; ! i = elen; } } *** atk/text/textv.c Wed Nov 22 12:32:44 1989 --- atk/text/textv.c.NEW Tue Apr 3 11:21:57 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/textv.c,v 2.16 89/10/05 11:22:14 cfe Exp $ */ /* $ACIS:textv.c 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/textv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/textv.c,v 2.16 89/10/05 11:22:14 cfe Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v 2.18 90/04/03 11:35:54 gk5g Exp $ */ /* $ACIS:textv.c 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v 2.18 90/04/03 11:35:54 gk5g Exp $"; #endif /* lint */ #include *************** *** 38,43 **** --- 38,44 ---- static struct graphic *pat; #define TEXT_VIEWREFCHAR '\377' /* place holder character for viewrefs */ + #define textview_MOVEVIEW 99999999 #define NLINES 200 /* This set to keep redisplay from going into an infinite loop if something goes drastically wrong */ #define BX 20 *************** *** 178,197 **** } if(t!=NULL){ ! if (self->dot != NULL) text_RemoveMark(t, self->dot); ! if (self->top != NULL) text_RemoveMark(t, self->top); ! if (self->frameDot != NULL) text_RemoveMark(t, self->frameDot); ! if (self->predrawn != NULL) ! text_RemoveMark(t, self->dot); ! if (self->prepredrawn != NULL) ! text_RemoveMark(t, self->frameDot); } style_Destroy(self->defaultStyle); keystate_Destroy(self->keystate); } void textview__ObservedChanged(self, changed, value) --- 179,221 ---- } if(t!=NULL){ ! if (self->dot != NULL) { text_RemoveMark(t, self->dot); ! mark_Destroy(self->dot); ! } ! if (self->top != NULL) { text_RemoveMark(t, self->top); ! mark_Destroy(self->top); ! } ! if (self->frameDot != NULL) { text_RemoveMark(t, self->frameDot); ! mark_Destroy(self->frameDot); } + if (self->predrawn != NULL) { + text_RemoveMark(t, self->predrawn); + mark_Destroy(self->predrawn); + } + if (self->prepredrawn != NULL) { + text_RemoveMark(t, self->prepredrawn); + mark_Destroy(self->prepredrawn); + } + } + if (self->lines != NULL) { + int i; + + for(i = 0; i < self->aLines; i++) { + if (t != NULL) + text_RemoveMark(t, self->lines[i].data); + mark_Destroy(self->lines[i].data); + } + free(self->lines); + } style_Destroy(self->defaultStyle); keystate_Destroy(self->keystate); + if (self->styleMenus != NULL) { + menulist_Destroy(self->styleMenus); + } } void textview__ObservedChanged(self, changed, value) *************** *** 474,480 **** long bx, by; if (self->lastStyleMenuVersion != Text(self)->styleSheet->version) { ! /* Have to recompute the size of the tab character */ text_InitStateVector(&info.sv); text_ApplyEnvironment(&info.sv, self->defaultStyle, Text(self)->rootEnvironment); --- 498,505 ---- long bx, by; if (self->lastStyleMenuVersion != Text(self)->styleSheet->version) { ! /* Have to recompute the size of the tab character */ ! struct menulist *styleMenus; text_InitStateVector(&info.sv); text_ApplyEnvironment(&info.sv, self->defaultStyle, Text(self)->rootEnvironment); *************** *** 487,493 **** if (self->styleMenus != NULL) menulist_Destroy(self->styleMenus); ! self->styleMenus = menulist_DuplicateML(stylesheet_GetMenuList(((struct text *) Text(self))->styleSheet, textview__LookCmd, &textview_classinfo), self); self->lastStyleMenuVersion = ((struct text *) Text(self))->styleSheet->version; menulist_SetMask(self->menus, textview_NoMenus); } --- 512,519 ---- if (self->styleMenus != NULL) menulist_Destroy(self->styleMenus); ! styleMenus = stylesheet_GetMenuList(((struct text *) Text(self))->styleSheet, textview__LookCmd, &textview_classinfo); ! self->styleMenus = menulist_DuplicateML(styleMenus, self); self->lastStyleMenuVersion = ((struct text *) Text(self))->styleSheet->version; menulist_SetMask(self->menus, textview_NoMenus); } *************** *** 520,526 **** /* Scrolling toward the end of the document */ /* Determine area that has to be moved */ - if(self->lines[self->nLines - 1].height > self->lines[self->nLines - 1].textheight) { /* last line contains a view that will probably need a full redraw */ stopline = self->nLines - 2; --- 546,551 ---- *************** *** 620,626 **** textview_GetLogicalWidth(self),by); pat = textview_BlackPattern(self); textview_FillRect(self,&tempSrcRect, pat); - } self->csyPos = by; self->csxPos = 0; --- 645,650 ---- *************** *** 957,970 **** long height; { long dotpos; ! ! self->force = TRUE; ! if (textview_Visible(self, (dotpos = textview_GetDotPosition(self)))) { ! textview_FrameDot(self, dotpos); } - self->csxPos = BADCURPOS; /* Indication that cursor is not visible */ - self->cexPos = BADCURPOS; - DoUpdate(self, TRUE); } void textview__WantNewSize(self,requestor) --- 981,1011 ---- long height; { long dotpos; ! long line = 0; ! switch(type){ ! case view_Remove: ! while (line < self->nLines) { ! if(self->lines[line].containsView) ! textview_ViewMove(self,&self->lines[line],textview_REMOVEVIEW); ! line++; ! } ! break; ! case view_MoveNoRedraw: ! while (line < self->nLines) { ! if(self->lines[line].containsView) ! textview_ViewMove(self,&self->lines[line],textview_MOVEVIEW); ! line++; ! } ! break; ! default: ! self->force = TRUE; ! if (textview_Visible(self, (dotpos = textview_GetDotPosition(self)))) { ! textview_FrameDot(self, dotpos); ! } ! self->csxPos = BADCURPOS; /* Indication that cursor is not visible */ ! self->cexPos = BADCURPOS; ! DoUpdate(self, TRUE); } } void textview__WantNewSize(self,requestor) *** atk/text/txttroff.c Mon Mar 12 13:16:39 1990 --- atk/text/txttroff.c.NEW Tue Apr 3 11:22:01 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/txttroff.c,v 2.23 90/02/16 10:37:54 tpn Exp $ */ /* $ACIS:txttroff.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/txttroff.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/txttroff.c,v 2.23 90/02/16 10:37:54 tpn Exp $"; #endif /* lint */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v 2.26 90/03/29 15:11:52 tpn Exp $ */ /* $ACIS:txttroff.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v 2.26 90/03/29 15:11:52 tpn Exp $"; #endif /* lint */ /* *************** *** 248,254 **** register char *code = fonttable[dFont].fontcodes[dFace]; if (needNewLine) ! fprintf(troffFile, code[1] ? "\\f(%s" : "\\f%s", code); else fprintf(troffFile, "'ft %s\n", code); } --- 248,254 ---- register char *code = fonttable[dFont].fontcodes[dFace]; if (needNewLine) ! fprintf(troffFile, code[1] ? "\\&\\f(%s" : "\\&\\f%s", code); else fprintf(troffFile, "'ft %s\n", code); } *************** *** 353,358 **** --- 353,360 ---- } if (sv.SpecialFlags != nsv.SpecialFlags) { + if(passthru && !(nsv.SpecialFlags & style_PassThru)) + PutNewlineIfNeeded(); passthru = (nsv.SpecialFlags & style_PassThru); underlining = (nsv.SpecialFlags & style_Underline); changebar = (nsv.SpecialFlags & style_ChangeBar); *************** *** 1107,1140 **** sv.CurView = NULL; if (sv.CurView != NULL) { - if (cs) { - FlushLineSpacing(cs,hitchars); - cs = 0; - } if(strcmp(vr->viewType,"fnotev") == 0){ needNewLine = 0; needta = FALSE; } else if(strcmp(vr->viewType,"bpv") == 0){ ! hitchars = 0; needta = FALSE; PutNewlineIfNeeded(); } else { needta = TRUE; PutNewlineIfNeeded(); } view_Print(sv.CurView, f, "troff", "PostScript", 0); if(needta) fprintf(f,".TA\n"); /* reset tab stops, as table is want to mess them up */ - - } - } - } /* End change environment */ elen += i; /* Bump by current position */ ! if (! needNewLine) ln = 0; if (nenv->type != environment_View) { int c, insideWord = 0; --- 1109,1152 ---- sv.CurView = NULL; if (sv.CurView != NULL) { if(strcmp(vr->viewType,"fnotev") == 0){ + if (cs) { + FlushLineSpacing(cs,hitchars); + cs = 0; + } needNewLine = 0; needta = FALSE; } else if(strcmp(vr->viewType,"bpv") == 0){ ! if(cs){ ! FlushLineSpacing(1,hitchars);/* throw away unneeded newlines */ ! cs = 0; ! } needta = FALSE; + hitchars = 0; PutNewlineIfNeeded(); } else { + if (cs) { + FlushLineSpacing(cs,hitchars); + cs = 0; + } needta = TRUE; PutNewlineIfNeeded(); } view_Print(sv.CurView, f, "troff", "PostScript", 0); if(needta) fprintf(f,".TA\n"); /* reset tab stops, as table is want to mess them up */ + } + } + } /* End change environment */ + elen += i; /* Bump by current position */ ! if (! needNewLine){ ln = 0; + quotespace = TRUE; + } if (nenv->type != environment_View) { int c, insideWord = 0; *************** *** 1264,1276 **** ln += 3; } else { ! if(c == ' ') { ! if(quotespace){ fputc('\\',f); ln++; } } ! else quotespace = FALSE; fputc(c, f); } } --- 1276,1302 ---- ln += 3; } else { ! #ifdef BOGUS3812 ! /* this code isn't quite right, but some 3812 printers can't handle hard spaces */ ! if(quotespace){ ! if(c == ' ') { fputc('\\',f); + fputc('&',f); ln++; } + quotespace = FALSE; } ! #else /*BOGUS3812 */ ! /* put hard spaces at the beginning of lines so that initial spacings are consistent ! and no extra newlines are added */ ! if(quotespace){ ! if(c == ' ') { ! fputc('\\',f); ! ln++; ! } ! else quotespace = FALSE; ! } ! #endif /*BOGUS3812 */ fputc(c, f); } } *** atk/text/txtvcmds.c Mon Mar 12 13:16:45 1990 --- atk/text/txtvcmds.c.NEW Tue Apr 3 11:22:06 1990 *************** *** 3,14 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/txtvcmds.c,v 2.38 90/02/21 11:40:11 gk5g Exp $ */ /* $ACIS:txtvcmds.c 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/txtvcmds.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/txtvcmds.c,v 2.38 90/02/21 11:40:11 gk5g Exp $"; #endif /* lint */ #include --- 3,14 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v 2.40 90/03/28 19:56:27 gk5g Exp $ */ /* $ACIS:txtvcmds.c 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v 2.40 90/03/28 19:56:27 gk5g Exp $"; #endif /* lint */ #include *************** *** 428,435 **** strcpy(messageBuf, "Search for: "); gf = message_AskForString(self, 0, messageBuf, NULL, thisString, sizeof(thisString)); if (gf < 0) return(-1); ! if(textview_GetDotLength(self) > 0) ! textview_SetDotPosition(self, textview_GetDotPosition(self) + 1); if (thisString[0] != '\000') { tp = search_CompilePattern(thisString,&lastPattern); if (tp != 0) { --- 428,435 ---- strcpy(messageBuf, "Search for: "); gf = message_AskForString(self, 0, messageBuf, NULL, thisString, sizeof(thisString)); if (gf < 0) return(-1); ! textview_SetDotPosition(self, ! textview_GetDotPosition(self)+textview_GetDotLength(self)); if (thisString[0] != '\000') { tp = search_CompilePattern(thisString,&lastPattern); if (tp != 0) { *************** *** 513,520 **** long pos = textview_GetDotPosition(self); if (forwardSearch) { ! if(textview_GetDotLength(self) > 0) ! pos = textview_GetDotPosition(self) + 1; textview_SetDotPosition(self, pos); textview_SetDotLength(self, 0); pos = search_MatchPattern(d, pos, lastPattern); --- 513,519 ---- long pos = textview_GetDotPosition(self); if (forwardSearch) { ! pos = textview_GetDotPosition(self) + textview_GetDotLength(self); textview_SetDotPosition(self, pos); textview_SetDotLength(self, 0); pos = search_MatchPattern(d, pos, lastPattern); *************** *** 924,930 **** strncpy(casedString, replacement, replacementLen); text_ReplaceCharacters(d, pos, matchLen, casedString, replacementLen); ! searchPos = pos + ((replacementLen > 0) ? 1 : 0); ++numReplaced; } break; --- 923,929 ---- strncpy(casedString, replacement, replacementLen); text_ReplaceCharacters(d, pos, matchLen, casedString, replacementLen); ! searchPos = pos + replacementLen; ++numReplaced; } break; *************** *** 940,946 **** returnPosition = FALSE; else if (reply == '='){ returnPosition = FALSE; ! searchPos = pos + 1; break; } } --- 939,945 ---- returnPosition = FALSE; else if (reply == '='){ returnPosition = FALSE; ! searchPos = pos + matchLen; break; } } *************** *** 947,953 **** /* Fall through. */ case ' ': text_ReplaceCharacters(d, pos, matchLen, replacement, replacementLen); ! searchPos = pos + ((replacementLen > 0) ? 1 : 0); ++numReplaced; break; case 'n': --- 946,952 ---- /* Fall through. */ case ' ': text_ReplaceCharacters(d, pos, matchLen, replacement, replacementLen); ! searchPos = pos + replacementLen; ++numReplaced; break; case 'n': *** atk/text/tpls/foils.tpl Tue Apr 3 11:44:48 1990 --- atk/text/tpls/foils.tpl.NEW Mon Mar 26 12:14:38 1990 *************** *** 0 **** --- 1,146 ---- + \begindata{text,268680608} + \textdsversion{12} + \define{italic + menu:[Font~1,Italic~11] + attr:[FontFace Italic Int Set]} + \define{bold + menu:[Font~1,Bold~10] + attr:[FontFace Bold Int Set]} + \define{chapter + menu:[Title~3,Chapter~20] + attr:[Justification LeftJustified Point 0] + attr:[FontFace Bold Int Set] + attr:[FontSize PreviousFontSize Point 4]} + \define{section + menu:[Title~3,Section~21] + attr:[Justification LeftJustified Point 0] + attr:[FontFace Bold Int Set] + attr:[FontSize PreviousFontSize Point 2]} + \define{subsection + menu:[Title~3,Subsection~22] + attr:[Justification LeftJustified Point 0] + attr:[FontFace Bold Int Set]} + \define{paragraph + menu:[Title~3,Paragraph~23] + attr:[Justification LeftJustified Point 0] + attr:[FontFace Italic Int Set]} + \define{bigger + menu:[Font~1,Bigger~20] + attr:[FontSize PreviousFontSize Point 2]} + \define{indent + menu:[Region~4,Indent~20] + attr:[LeftMargin LeftMargin Inch 32768] + attr:[RightMargin RightMargin Inch 32768]} + \define{typewriter + menu:[Font~1,Typewriter~40] + attr:[FontFace FixedFace Int Set] + attr:[FontFamily AndyType Int 0]} + \define{underline + menu:[Font~1,Underline~41] + attr:[Flags Underline Int Set]} + \define{display + menu:[Region~4,Display~14] + attr:[LeftMargin LeftMargin Inch 32768] + attr:[RightMargin RightMargin Inch 32768] + attr:[Justification LeftJustified Point 0]} + \define{example + menu:[Region~4,Example~12] + attr:[LeftMargin LeftMargin Inch 32768] + attr:[Justification LeftJustified Point 0] + attr:[FontFace FixedFace Int Set] + attr:[FontFamily AndyType Int 0]} + \define{description + menu:[Region~4,Description~11] + attr:[LeftMargin LeftMargin Inch 32768] + attr:[Indent LeftMargin Inch -32768]} + \define{quotation + menu:[Region~4,Quotation~10] + attr:[LeftMargin LeftMargin Inch 32768] + attr:[RightMargin RightMargin Inch 32768] + attr:[FontFace Italic Int Set]} + \define{subscript + menu:[Font~1,Subscript~30] + attr:[Script PreviousScriptMovement Point 2] + attr:[FontSize PreviousFontSize Point -2]} + \define{superscript + menu:[Font~1,Superscript~31] + attr:[Script PreviousScriptMovement Point -6] + attr:[FontSize PreviousFontSize Point -2]} + \define{smaller + menu:[Font~1,Smaller~21] + attr:[FontSize PreviousFontSize Point -2]} + \define{heading + menu:[Title~3,Heading~11] + attr:[LeftMargin LeftMargin Cm 0] + attr:[FontSize ConstantFontSize Point 20]} + \define{majorheading + menu:[Title~3,MajorHeading~10] + attr:[Justification Centered Point 0] + attr:[FontSize ConstantFontSize Point 20]} + \define{formatnote + menu:[Region~4,FormatNote~60] + attr:[Flags PassThru Int Set]} + \define{subheading + menu:[Title~3,Subheading~12] + attr:[FontFace Italic Int Set]} + \define{center + menu:[Justify~2,Center~10] + attr:[Justification Centered Point 0]} + \define{flushleft + menu:[Justify~2,FlushLeft~20] + attr:[Justification LeftJustified Point 0]} + \define{flushright + menu:[Justify~2,FlushRight~21] + attr:[Justification RightJustified Point 0]} + \define{leftindent + menu:[Region~4,LeftIndent~21] + attr:[LeftMargin LeftMargin Inch 32768]} + \define{andysans16 + menu:[Font~1,AndySans16~51] + attr:[FontFamily AndySans Int 0] + attr:[FontSize ConstantFontSize Point 16]} + \define{andysans20 + menu:[Font~1,AndySans20~52] + attr:[FontFamily AndySans Int 0] + attr:[FontSize ConstantFontSize Point 20]} + \define{andysans8 + menu:[Font~1,AndySans8~50] + attr:[FontFamily AndySans Int 0] + attr:[FontSize ConstantFontSize Point 8]} + \formatnote{.ds CT + + .ds LB H1 + + .ds RB 00/00/90 + + }\andysans16{ + \majorheading{H1} + + + \begindata{bp,268642176} + \enddata{bp,268642176} + \view{bpv,268642176,0,0,0} + \heading{H1} + + \subheading{H2} + + \formatnote{.sp -18p} + + _____________________________________________ + + + + \begindata{bp,268642132} + \enddata{bp,268642132} + \view{bpv,268642132,1,0,0} + \heading{H1} + + \subheading{H2} + + \formatnote{.sp -18p} + + _____________________________________________ + + + + }\enddata{text,268680608} *** atk/textobjects/panel.c Mon Mar 12 13:16:55 1990 --- atk/textobjects/panel.c.NEW Tue Mar 20 21:43:08 1990 *************** *** 348,357 **** register struct panel_Entry *entry; { ClearHighlight(self); - SetupHighlight(self, entry); if (entry == (struct panel_Entry *)NULL) return; panel_SetDotPosition(self, entry->pos); panel_SetDotLength(self, 0); panel_LoseInputFocus(self); --- 348,358 ---- register struct panel_Entry *entry; { ClearHighlight(self); if (entry == (struct panel_Entry *)NULL) return; + + SetupHighlight(self, entry); panel_SetDotPosition(self, entry->pos); panel_SetDotLength(self, 0); panel_LoseInputFocus(self); *** atk/textobjects/panel.doc Wed Nov 22 12:36:27 1989 --- atk/textobjects/panel.doc.NEW Tue Mar 20 21:43:13 1990 *************** *** 1,4 **** ! \begindata{text,270025272} \textdsversion{12} \template{default} \define{bold --- 1,4 ---- ! \begindata{text,268681644} \textdsversion{12} \template{default} \define{bold *************** *** 31,46 **** \chapter{Panel} ! This file is intended to contain programmer's documentation for panel. There ! are no short-term plans to complete this document. ! \section{Quick reference list for }panel - \fixedtext{struct panel_Entry *\bold{panel_}Add }\fixedindent{(struct panel *\paramname{panel}, char *\paramname{item}, char *\paramname{tag}, int \paramname{showNow});} --- 31,59 ---- \chapter{Panel} ! The panel class supports simple caption lists. A caption list is a scrollable ! set of caption strings of arbitrary length. A caption may be selected by ! placing the mouse cursor over a particular caption and clicking with either ! the left or right mouse button. Only a single caption may be selected at a ! time. Each caption may have an associated client-specific datum that is ! passed to a client-specified call-back routine when that caption is selected. ! As well, the font for the highlighted caption can be specified such that the ! caption will be surrounded in that font when selected. By default, normalized ! captions are in a 10-point plain font. As well as providing selection via ! user-interaction, the client program can cause caption selection via certain ! panel classmethods. + Caption lists are useful for applications that require the user to choose one + of many possible alternative items. An example of an application that takes + advantage of the panel class is Help. The 'Overview' and 'Programs' lists on + the right side of the window are panel objects. ! \section{Quick reference list for panel + } \fixedtext{struct panel_Entry *\bold{panel_}Add }\fixedindent{(struct panel *\paramname{panel}, char *\paramname{item}, char *\paramname{tag}, int \paramname{showNow});} *************** *** 104,107 **** \fixedtext{\bold{panel_}SetHighlightStyle }\fixedindent{(struct panel *\paramname{panel}, struct style *\paramname{s});} ! \enddata{text,270025272} --- 117,417 ---- \fixedtext{\bold{panel_}SetHighlightStyle }\fixedindent{(struct panel *\paramname{panel}, struct style *\paramname{s});} ! ! ! \bold{Creating a new panel}\subheading{ ! ! }\example{struct panel *panel_New() ! ! } ! \leftindent{\bold{Class procedure description.} A new panel object is ! allocated and initialized. ! ! ! \bold{Return value.} A pointer to the new panel. ! ! ! \bold{Usage. }} Call whenever you want to create a new, empty panel object. ! ! ! \bold{Adding a caption to a panel ! ! }\indent{struct panel_Entry *panel_Add (panel, item, tag, showNow) ! ! struct panel *\italic{panel}; ! ! char *\italic{item}; ! ! char *\italic{tag}; ! ! int \italic{showNow}; ! ! ! \bold{Class procedure description.} To add a caption to a panel use panel_Add. ! The caption is passed as \italic{item}, a client-specific datum as ! \italic{tag}, and a boolean that specifies whether or not the caption is to be ! displayed immediately, \italic{showNow}. A pointer to a panel_Entry structure ! is returned upon success and NULL is returned otherwise. The returned ! panel_Entry handle can be used to remove the caption (see panel_Remove). ! ! ! \bold{Return value.} A pointer to a struct panel_Entry. ! ! ! \bold{Usage.} Use panel_Add to build up a caption list in a valid panel ! object. ! ! ! }\bold{Binding a client procedure to a key ! ! }\indent{void panel_AssignKey (panel,key,proc,rock) ! ! struct panel *\italic{panel}; ! ! char \italic{key}; ! ! void (*\italic{proc})(); ! ! long \italic{rock}; ! ! ! \bold{Class procedure description.} It is possible for the panel client to ! bind a call-back procedure, \italic{proc}, to a particular keyboard key, ! \italic{key}. When the user types that key, the call-back procedure is ! invoked with these arguments: ! ! ! (proc)(rock,panel,key) ! ! ! where \italic{rock} is the client-specific datum and \italic{key} is the key ! pressed. ! ! ! \bold{Return value.} None. ! ! ! \bold{Usage.} This feature is only useful when the panel object has the input ! focus. In normal usage, selecting a list item causes the input focus to ! remain with whatever view had it before the selection operation. By default, ! the keys 'P', 'p', 'B', 'b' are bound to panel_SelectPrevious. The keys 'F', ! 'f', 'N', 'n' are bound to panel_SelectNext. To override these bindings or to ! provide additional bindings use panel_AssignKey. ! ! ! } ! \bold{Normalizing any selected caption ! ! }\indent{void panel_ClearSelection (panel) ! ! struct panel *\italic{panel}; ! ! ! \bold{Class procedure descritpion.} To de-highlight any selected (highlighted) ! captions, use panel_ClearSelection. ! ! ! \bold{Return value.} None. ! ! ! }\bold{Accessing the currently selected caption ! ! }\indent{struct panel_Entry *panel_CurrentHighlight (panel) ! ! struct panel *panel; ! ! ! \bold{Class procedure description.} To access the currently selected caption ! use panel_CurrentHighlight. ! ! ! \bold{Return value.} A pointer to a panel_Entry structure. ! ! ! }\bold{Simulating a user selection of a particular caption ! ! }\indent{void panel_MakeSelection (panel, entry) ! ! struct panel *\italic{panel}; ! ! struct panel_Entry *\italic{entry}; ! ! ! \bold{Class procedure description.} To cause the caption associated with a ! particular panel_Entry structure to become selected use panel_MakeSelection. ! If a NULL entry is passed, any currently selected caption is de-highlighted. ! ! ! \bold{Return value.} None. ! ! ! }\bold{Removing a caption from a panel ! ! }\indent{void panel_Remove (panel,entry) ! ! struct panel *\italic{panel}; ! ! struct panel_Entry *\italic{entry}; ! ! ! \bold{Class procedure description.} To remove the caption associated with a ! particular panel_Entry use panel_Remove. If an invalid entry is passed the ! call is a no-op, otherwise the caption associated with the entry is removed ! from the list and the memory associated with the entry is freed. \bold{Note:} ! the client-specific \italic{tag} is not freed. To free all the tags ! associated with a panel, see panel_FreeAllTags. ! ! ! \bold{Return value.} None. ! ! ! }\bold{Removing all the captions from a panel ! ! }\indent{void panel_RemoveAll (panel) ! ! struct panel *\italic{panel}; ! ! ! \bold{Class procedure description.} To clear a panel of all the captions that ! it contains use panel_RemoveAll. The memory associated with each panel_Entry ! is freed. \bold{Note:} the client-specific \italic{tag} is not freed. To ! free all the tags associated with a panel, see panel_FreeAllTags. ! ! ! \bold{Return value.} None. ! ! ! }\bold{Selecting the next caption in the panel list ! ! }\indent{void panel_SelectNext (panel) ! ! struct panel *\italic{panel}; ! ! ! \bold{Class procedure description.} To select the caption directly following ! the currently highlighted caption use panel_SelectNext. If there is no ! currently selected caption, or the last caption is currently selected, this ! call is a no-op; otherwise the next caption is highlighted. ! ! ! \bold{Return value. } None. ! ! ! \bold{Usage.} ! ! ! }\bold{Selecting the previous caption in the panel list ! ! }\indent{void panel_SelectPrevious (panel) ! ! struct panel *\italic{panel}; ! ! ! \bold{Class procedure description.} To select the caption directly preceding ! the currently highlighted caption, use panel_SelectPrevious. If there is no ! currently selected caption, or the first caption in the list is currently ! highlighted, this call is a no-op; otherwise the previous caption is ! highlighted. ! ! ! \bold{Return value.} None. ! ! ! }\bold{Specifying the font for the mouse cursor}\bold{ ! ! }\indent{panel_SetCursorFont (panel,cursor_font) ! ! struct panel *\italic{panel}; ! ! struct fontdesc *\italic{cursor_font}; ! ! ! \bold{Class procedure description.} One can specify a particular font family ! from which the cursor can be chosen by using panel_SetCursorFont (see ! fontdesc.doc). After setting the font family one can choose a particular ! character from within that family to be the cursor (see panel_SetCusorIcon ! below). ! ! ! \bold{Return value.} None. ! ! ! }\bold{Specifying a character for the mouse cursor ! ! }\indent{panel_SetFontIcon (panel) ! ! struct panel *\italic{panel}; ! ! ! \bold{Class procedure description.} Once a cursor font family has been ! chosen, use this procedure to chose a particular character from that family to ! be the mouse cursor (see panel_SetCursorFont above). ! ! ! }\bold{Specifying a selection call-back routine ! ! }\indent{panel_SetHandler (panel,handler,globalTag) ! ! struct panel *\italic{panel}; ! ! (void) (*\italic{handler}) (); ! ! long \italic{globalTag}; ! ! ! \bold{Class procedure description.} Whenever a caption is selected, the ! client-supplied routine, \italic{handler}, is called with these arguments: ! ! ! \indent{(handler)(globalTag, tag, panel); ! ! } ! where \italic{tag} is the client-datum associated with the selected caption's ! panel_Entry. ! ! ! \bold{Return value.} None. ! ! ! \bold{Usage.} To give the panel any client-specific meaning it is necessary ! for the client to be able to gain control of any user-initiated selection ! event. This handler is used to gain that control. ! ! ! } ! \bold{Specifying that a particular font be used to display the selected ! caption ! ! }\indent{panel_SetHighlightStyle (panel,font) ! ! struct panel *\italic{panel}; ! ! struct fontdesc *\italic{font}; ! ! ! \bold{Class procedure description.} To specify that a particular font be used ! to display the selected caption use panel_SetHighlightStyle. ! ! ! \bold{Return value.} None. ! ! ! \bold{Usage.} ! ! ! }\bold{Freeing all client data tags ! ! }\indent{panel_FreeAllTags (panel) ! ! struct panel*\italic{panel}; ! ! ! \bold{Class procedure description.} The methods panel_Remove and ! panel_RemoveAll are used to remove captions from a panel. These methods free ! the caption's associated panel_Entry but do not free the client-specific data, ! \italic{tag}. This routine frees all the tags associated with a panel. ! ! ! \bold{Return value.} None. ! ! }\enddata{text,268681644} *** atk/value/getrecv.c Wed Nov 22 12:36:41 1989 --- atk/value/getrecv.c.NEW Tue Mar 20 21:44:36 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/getrecv.c,v 2.5 89/02/17 17:49:24 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/getrecv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/getrecv.c,v 2.5 89/02/17 17:49:24 ghoti Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/getrecv.c,v 2.6 90/03/16 14:41:26 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/getrecv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/getrecv.c,v 2.6 90/03/16 14:41:26 tpn Exp $ "; #endif /* lint */ #include *************** *** 71,79 **** struct GetRecV * self; long x,y,width,height; { if (width > 0 && height > 0) { - struct value *w = GetRecV_Value(self); self->x = x; self->y = y; self->width = width; --- 71,83 ---- struct GetRecV * self; long x,y,width,height; { + struct value *w = GetRecV_Value(self); + if(value_GetUpdateCount(w) == 0){ + /* ignore read in value */ + value_SetValue(w,0); + } if (width > 0 && height > 0) { self->x = x; self->y = y; self->width = width; *** atkams/messages/lib/messages.c Wed Jan 17 16:39:26 1990 --- atkams/messages/lib/messages.c.NEW Tue Mar 20 21:56:52 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/atkams/messages/lib/RCS/messages.c,v 2.27 89/11/17 16:32:37 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/atkams/messages/lib/RCS/messages.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/atkams/messages/lib/RCS/messages.c,v 2.27 89/11/17 16:32:37 cfe Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.32 90/03/19 15:15:08 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.32 90/03/19 15:15:08 gk5g Exp $ "; #endif /* lint */ #include *************** *** 26,31 **** --- 26,32 ---- #include #include #include + #include #include #include *************** *** 1320,1325 **** --- 1321,1349 ---- } #endif + void + messages__ObservedChanged( self, changed, change ) + register struct messages *self; + register struct observable *changed; + register long change; + { + struct org *org = NULL; + + super_ObservedChanged(self,changed,change); + switch(change) { + case observable_OBJECTDESTROYED: + if(self->folderTree && ((struct frame*)changed == self->folderFrame)) { + org = (struct org*)orgv_GetDataObject(self->folderTree); + orgv_UnlinkTree(self->folderTree); + orgv_Destroy(self->folderTree); + org_Destroy(org); + self->folderTree = NULL; + self->folderFrame = NULL; + } + break; + } + } + void BS_ShowTreePlease(self) struct messages *self; { *************** *** 1333,1338 **** --- 1357,1367 ---- struct view *v1, *v2; ams_WaitCursor(TRUE); + if(self->folderTree) { + message_DisplayString(self, 10, "Folder tree already exposed."); + ams_WaitCursor(FALSE); + return; + } ams_CUI_GenTmpFileName(ams_GetAMS(), OrgFileName); if ((fp = fopen(OrgFileName, "w")) == NULL) { message_DisplayString(self, 10, "Could not open output file."); *************** *** 1341,1347 **** } fputs("Folder Tree\n{\n", fp); o = org_New(); ! ov = orgv_New(); if (!o || !ov) { message_DisplayString(self, 10, "Could not create tree objects!"); fclose(fp); --- 1370,1376 ---- } fputs("Folder Tree\n{\n", fp); o = org_New(); ! self->folderTree = ov = orgv_New(); if (!o || !ov) { message_DisplayString(self, 10, "Could not create tree objects!"); fclose(fp); *************** *** 1447,1453 **** org_Read(o, fp, 0); fclose(fp); unlink(OrgFileName); ! ams_InstallInNewWindow(orgv_GetApplicationLayer(ov), "messages-tree", "Folder Tree", environ_GetProfileInt("foldertree.width", 600), environ_GetProfileInt("foldertree.height", 400), ov); ams_WaitCursor(FALSE); #endif } --- 1476,1484 ---- org_Read(o, fp, 0); fclose(fp); unlink(OrgFileName); ! self->folderFrame = ams_InstallInNewWindow(orgv_GetApplicationLayer(ov), "messages-tree", "Folder Tree", environ_GetProfileInt("foldertree.width", 600), environ_GetProfileInt("foldertree.height", 400), ov); ! frame_SetQuitWindowFlag(self->folderFrame,TRUE); ! frame_AddObserver(self->folderFrame,self); ams_WaitCursor(FALSE); #endif } *************** *** 1603,1608 **** --- 1634,1641 ---- mess->mykeys = keystate_Create(mess, messages_standardkeymap); mess->mymenulist = menulist_DuplicateML(messages_standardmenulist, mess); mess->WhatIAm = WHATIAM_UNDEFINED; + mess->folderTree = NULL; + mess->folderFrame = NULL; return(TRUE); } *** atkams/messages/lib/messages.ch Wed Nov 22 12:43:07 1989 --- atkams/messages/lib/messages.ch.NEW Tue Mar 20 21:56:56 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/messages.ch,v 2.6 89/02/20 13:16:19 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/messages.ch,v $ */ #ifndef lint ! static char *rcsid_messages_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/messages.ch,v 2.6 89/02/20 13:16:19 ghoti Exp $ "; #endif /* lint */ #define WHATIAM_UNDEFINED -1 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.8 90/03/19 12:49:43 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v $ */ #ifndef lint ! static char *rcsid_messages_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.8 90/03/19 12:49:43 gk5g Exp $ "; #endif /* lint */ #define WHATIAM_UNDEFINED -1 *************** *** 23,28 **** --- 23,29 ---- overrides: PostKeyState(struct keystate *keystate); PostMenus(struct menulist *ml); + ObservedChanged(struct observable *changed, long change); methods: SetWhatIAm(int WhatIAm); ResetFileIntoMenus(); *************** *** 31,35 **** --- 32,38 ---- struct menulist *mymenulist, *fileintomenulist; struct keystate *mykeys; int WhatIAm; + struct orgv *folderTree; + struct frame *folderFrame; }; *** contrib/hyplink/linkv.c Wed Nov 22 12:45:30 1989 --- contrib/hyplink/linkv.c.NEW Tue Mar 27 14:00:25 1990 *************** *** 244,255 **** /* No frame--need to map buffer to new window */ f = frame_New(); frame_SetCommandEnable(f, TRUE); frame_PostDefaultHandler(f, "message", frame_WantHandler(f, "message")); frame_SetBuffer(f, b, TRUE); - - im = im_Create(NULL); - im_SetView(im, f); } return((struct view *)f); } --- 244,255 ---- /* No frame--need to map buffer to new window */ f = frame_New(); + im = im_Create(NULL); + im_SetView(im, f); + frame_SetCommandEnable(f, TRUE); frame_PostDefaultHandler(f, "message", frame_WantHandler(f, "message")); frame_SetBuffer(f, b, TRUE); } return((struct view *)f); } *************** *** 266,273 **** If the file isn't in a buffer, put it in one. If the buffer isn't in a window, put it in one. Warp the cursor & set the input focus to the target window (file). - (BUG) For some reason, the new window doesn't echo all messages - (like "Cancelled." from ^G) like the parent window does. */ char temp[MAXPATHLEN]; --- 266,271 ---- *** contrib/tm/tm.c Mon Mar 12 13:17:01 1990 --- contrib/tm/tm.c.NEW Tue Mar 20 22:03:00 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/tm/RCS/tm.c,v 2.17 90/02/28 11:59:59 tpn Exp $ */ /* $ACIS:tm.c 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/tm/RCS/tm.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/tm/RCS/tm.c,v 2.17 90/02/28 11:59:59 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.17 90/02/28 11:59:59 tpn Exp $ */ /* $ACIS:tm.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.17 90/02/28 11:59:59 tpn Exp $"; #endif /* lint */ #include *** overhead/class/cmd/doindex.c Wed Nov 22 13:21:08 1989 --- overhead/class/cmd/doindex.c.NEW Tue Mar 20 22:51:52 1990 *************** *** 12,18 **** #include #include #include ! #include /* this contains all the structs, etc. for the class system */ #include #include --- 12,18 ---- #include #include #include ! #include #include /* this contains all the structs, etc. for the class system */ #include #include *************** *** 25,30 **** --- 25,31 ---- struct EntryStruct { char * Name; struct EntryStruct * Next; + struct IndexEntry Ent; }; *************** *** 68,76 **** { (void) fprintf(stderr, "%s: %s%s...program terminated!\n", ProgramName, message, param); (void) fflush(stderr); - if (lockfd >= 0) { - (void) unlink(INDEXLOCKFILE); /* delete it */ - }; (void) exit(1); } --- 69,74 ---- *************** *** 221,263 **** ** be set by the caller. **/ int ! UpdateIndex(entry) ! struct IndexEntry * entry; ! { - int wroteit; /* used to make sure the entry is written */ FILE *infd; FILE *outfd; struct IndexEntry * ThisEntry; ! fprintf(stdout, "%s: indexing %s ...", ProgramName, entry->Data); ! fflush(stdout); ! wroteit = 0; /* haven't written it yet */ ! ! infd = fopen(INDEXFILE, "r"); ! ! outfd = fopen(INDEXNEWFILE, "w"); ! if (outfd == NULL) { Error("Unable to open a new index file", ""); } ! if (infd != NULL) { while ((ThisEntry = ReadEntry(infd)) != NULL) { ! if (strcmp(ThisEntry->Data, entry->Data) == 0) { /* match, replace it */ ! WriteEntry(outfd, entry); /* replace this entry */ ! wroteit = 1; /* remember we wrote it */ ! } else { ! WriteEntry(outfd, ThisEntry); /* put it back */ } ! DestroyEntry(ThisEntry); } } ! ! if (wroteit == 0) { /* didn't write it yet, do so now */ ! WriteEntry(outfd, entry); } ! if (fclose(outfd) == EOF) { Error("Error closing index file", ""); } --- 219,286 ---- ** be set by the caller. **/ int ! UpdateAll() { FILE *infd; FILE *outfd; struct IndexEntry * ThisEntry; + register struct EntryStruct * TempEntry, *last; + int fid,loopcount; ! RETRY: ! fid = open(INDEXNEWFILE,O_WRONLY | O_CREAT , 0644); /* Create output file */ ! if(fid > 0) { ! if(osi_ExclusiveLockNoBlock(fid) != 0){ ! if(errno == EWOULDBLOCK){ ! fprintf(stdout, "%s: Waiting for locked index file...\n", ProgramName); ! fflush(stdout); ! loopcount = 0; ! do {/* wait if locked */ ! sleep(1); ! if(TimeOut != 0 && loopcount++ > TimeOut) /* timeout of 0 means wait forever */ ! Error("timed out while trying to lock index files", ""); ! } while(osi_ExclusiveLockNoBlock(fid) != 0); ! close(fid); ! goto RETRY; /* reopen, as old file has probably been renamed by other process */ ! } ! else { ! extern int sys_nerr,errno; ! extern char *sys_errlist[]; ! if(errno > sys_nerr) ! fprintf(stdout, "%s: Warning : file lock call failed, ignoring unknown error #%d.\n", ProgramName,errno); ! else ! fprintf(stdout, "%s: Warning : file lock call failed, ignoring '%s' error.\n", ProgramName,sys_errlist[errno]); ! } ! } ! outfd = fdopen(fid, "w"); ! } ! else { Error("Unable to open a new index file", ""); } ! fprintf(stdout, "%s: Writing index file...",ProgramName); ! fflush(stdout); ! infd = fopen(INDEXFILE,"r"); if (infd != NULL) { while ((ThisEntry = ReadEntry(infd)) != NULL) { ! last = NULL; ! for(TempEntry = EntryList; TempEntry; TempEntry = TempEntry->Next){ ! if (strcmp(ThisEntry->Data,TempEntry->Ent.Data) == 0) { /* match, replace it */ ! WriteEntry(outfd, &(TempEntry->Ent)); /* replace this entry */ ! if(last == NULL) EntryList = TempEntry->Next; /* take it out of the list */ ! else last->Next = TempEntry->Next; ! break; ! } ! last = TempEntry; } ! if(TempEntry == NULL) ! WriteEntry(outfd, ThisEntry); /* No match, put the one we read back */ } } ! for(TempEntry = EntryList; TempEntry; TempEntry = TempEntry->Next){ ! WriteEntry(outfd, &(TempEntry->Ent)); /* write out new entrys */ } ! fflush(outfd); if (fclose(outfd) == EOF) { Error("Error closing index file", ""); } *************** *** 267,273 **** if (rename(INDEXNEWFILE, INDEXFILE) != 0) { Error("Error creating new index file", ""); } ! fprintf(stdout, "OK\n"); fflush(stdout); } --- 290,296 ---- if (rename(INDEXNEWFILE, INDEXFILE) != 0) { Error("Error creating new index file", ""); } ! fprintf(stdout, "Done\n"); fflush(stdout); } *************** *** 282,288 **** **/ static void ProcessEntry(entry) ! char * entry; { int objfd; --- 305,311 ---- **/ static void ProcessEntry(entry) ! struct EntryStruct * entry; { int objfd; *************** *** 292,310 **** long textlength; char tname[256]; - struct IndexEntry ThisEntry; ! ! objfd = open(entry, O_RDONLY, 0); if (objfd < 0) { ! Error("can't open file ", entry); } ! entrypoint = ( struct classinfo * (*)() ) doload(objfd, entry, &base, &textlength, tname); close(objfd); if (entrypoint == NULL){ ! Error("NULL entrypoint from ", entry); } /* call the loaded routine at its entry point to get the classinfo structure */ --- 315,333 ---- long textlength; char tname[256]; ! objfd = open(entry->Name, O_RDONLY, 0); if (objfd < 0) { ! Error("can't open file ", entry->Name); } ! fprintf(stdout, "%s: indexing %s ...", ProgramName, entry->Name); ! fflush(stdout); ! entrypoint = ( struct classinfo * (*)() ) doload(objfd, entry->Name, &base, &textlength, tname); close(objfd); if (entrypoint == NULL){ ! Error("NULL entrypoint from ", entry->Name); } /* call the loaded routine at its entry point to get the classinfo structure */ *************** *** 311,327 **** info = (*entrypoint)(&unknownID, class_VERSIONNOTKNOWN); if(info == NULL){ ! Error("can not obtain classinfo structure for ", entry); } - ThisEntry.Name = info->name; - ThisEntry.Key = info->namekey; - ThisEntry.Version = info->versionnumber; - ThisEntry.Data = entry; - - UpdateIndex(&ThisEntry); - free(base); } --- 334,354 ---- info = (*entrypoint)(&unknownID, class_VERSIONNOTKNOWN); if(info == NULL){ ! Error("can not obtain classinfo structure for ", entry->Name); } + + if((entry->Ent.Name = malloc(strlen(info->name) + 1)) == NULL) + Error("Out of memory while processing ",entry->Name); + strcpy(entry->Ent.Name ,info->name); + if((entry->Ent.Key = malloc(strlen(info->namekey) + 1)) == NULL) + Error("Out of memory while processing ",entry->Name); + strcpy(entry->Ent.Key ,info->namekey); + entry->Ent.Version = info->versionnumber; + entry->Ent.Data = entry->Name; free(base); + fprintf(stdout, "OK\n"); + fflush(stdout); } *************** *** 337,369 **** { struct EntryStruct * TempEntry; - int loopcount; ParseArgs(argc, argv); /* this may chdir() */ - loopcount = 0; - do { - lockfd = open(INDEXLOCKFILE, O_CREAT | O_EXCL, 022); - if (lockfd < 0) { - if ((TimeOut != 0) && (loopcount > TimeOut)) { /* timeout of 0 means wait forever */ - Error("timed out while trying to lock index files", ""); - } - sleep(1); /* don't hog the CPU */ - loopcount++; - } - } while (lockfd < 0); /* keep going till we get a valid file descriptor */ ! ! while (EntryList != NULL) { ! ProcessEntry(EntryList->Name); ! TempEntry = EntryList; /* save this to be free'd */ ! EntryList = EntryList->Next; ! DeleteEntry(TempEntry); } ! ! (void) close(lockfd); /* done with this so close it */ ! (void) unlink(INDEXLOCKFILE); /* and delete it */ ! exit(0); /* success */ } --- 364,378 ---- { struct EntryStruct * TempEntry; ParseArgs(argc, argv); /* this may chdir() */ ! for(TempEntry = EntryList; TempEntry; TempEntry = TempEntry->Next){ ! ProcessEntry(TempEntry); } ! UpdateAll(); ! exit(0); /* success */ } *** overhead/cmenu/cmcreate.c Wed Jan 17 16:39:50 1990 --- overhead/cmenu/cmcreate.c.NEW Tue Mar 20 23:00:58 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.7 90/01/11 11:00:38 tpn Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/cmenu/RCS/cmcreate.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.7 90/01/11 11:00:38 tpn Exp $"; #endif /* lint */ #include --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.8 90/02/28 13:09:11 ajp Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.8 90/02/28 13:09:11 ajp Exp $"; #endif /* lint */ #include *************** *** 317,322 **** --- 317,336 ---- dp->bottomMargin = dp->selectionFontHeight / 2; dp->overlapWidth = dp->xShift / 2; + + if ((def_val = XGetDefault(dpy, def_env, "OverlapPct")) != NULL) { + dp->overlapPct = atoi(def_val); + if (dp->overlapPct < 0) { + dp->overlapPct = 0; + } + else if (dp->overlapPct > 100) { + dp->overlapPct = 100; + } + } + else { + dp->overlapPct = 0; + } + /* Creates GC's and Windows *** overhead/cmenu/cmdraw.c Mon Mar 12 13:17:10 1990 --- overhead/cmenu/cmdraw.c.NEW Tue Mar 20 23:01:01 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/cmenu/RCS/cmdraw.c,v 2.6 90/02/22 16:13:01 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/cmenu/RCS/cmdraw.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/cmenu/RCS/cmdraw.c,v 2.6 90/02/22 16:13:01 gk5g Exp $"; #endif /* lint */ #include --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmdraw.c,v 2.7 90/02/28 13:09:25 ajp Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmdraw.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmdraw.c,v 2.7 90/02/28 13:09:25 ajp Exp $"; #endif /* lint */ #include *************** *** 107,137 **** int xShift = menu->gMenuData->xShift; int yShift = menu->gMenuData->yShift; int zone; /* Which zone from the left edge of the window we are in. A zone is the active area of a pane. */ ! int paneNum; int selectionNum; int paneTop; int paneTopSelection; struct pane *panePtr; struct selection *selPtr; ! if (x < 0) zone = -1; ! else zone = x / xShift; ! if (zone >= menu->numberOfPanes) ! if (x > state->stackWidth) ! zone = -1; ! else zone = menu->numberOfPanes - 1; /* First card has a much larger zone. */ ! paneNum = menu->numberOfPanes - 1 - zone; paneTop = zone * yShift; ! /* There is a little bit of overlap on coming back into an earlier card. */ ! if (paneNum == state->paneNum - 1 && y <= paneTop + state->paneHeight && ! x <= (menu->numberOfPanes - state->paneNum) * xShift + menu->gMenuData->overlapWidth) { ! paneNum = state->paneNum; ! paneTop -= yShift; } paneTopSelection = paneTop + state->ySelectionOffset; if (y > paneTop + state->paneHeight) { --- 107,151 ---- int xShift = menu->gMenuData->xShift; int yShift = menu->gMenuData->yShift; int zone; /* Which zone from the left edge of the window we are in. A zone is the active area of a pane. */ ! int paneNum = state->paneNum; int selectionNum; int paneTop; int paneTopSelection; + int overlapWidth = menu->gMenuData->overlapWidth; + int leftEdgeOfCard = (menu->numberOfPanes - 1 - state->paneNum) * xShift; struct pane *panePtr; struct selection *selPtr; + int overlapPctWidth = (state->paneWidth * menu->gMenuData->overlapPct + 50) / 100; ! if (overlapPctWidth - xShift > overlapWidth) { ! overlapWidth = overlapPctWidth - xShift; ! } ! ! if (x < 0 || x > state->stackWidth) { zone = -1; ! } ! else if (x < leftEdgeOfCard) { /* Moving left. */ zone = x / xShift; ! } ! else { ! zone = menu->numberOfPanes - 1 - paneNum; ! if (x > leftEdgeOfCard + xShift + overlapWidth) { /* Moving right */ ! zone += (x - leftEdgeOfCard - overlapWidth) / xShift; ! if (zone >= menu->numberOfPanes) { zone = menu->numberOfPanes - 1; /* First card has a much larger zone. */ ! } ! } ! } paneTop = zone * yShift; ! ! /* Handle moving into the grey portion of the cards */ ! if (y > paneTop + state->paneHeight) { ! zone = x / xShift; ! paneTop = zone * yShift; } + + paneNum = menu->numberOfPanes - 1 - zone; paneTopSelection = paneTop + state->ySelectionOffset; if (y > paneTop + state->paneHeight) { *** overhead/cmenu/cmenu.help Wed Nov 22 13:36:03 1989 --- overhead/cmenu/cmenu.help.NEW Tue Mar 20 23:01:09 1990 *************** *** 1,4 **** ! \begindata{text,268965568} \textdsversion{12} \template{help} \chapter{Cmenu: Controlling the menus for Andrew programs --- 1,4 ---- ! \begindata{text,269084692} \textdsversion{12} \template{help} \chapter{Cmenu: Controlling the menus for Andrew programs *************** *** 110,115 **** --- 110,128 ---- screen until the user either makes the selection again or moves the cursor off the menus. The value is in milliseconds. } + + \bold{\italic{cmenu.OverlapPct: 50}} + + \leftindent{Determines the percentage of overlap that is used when flipping to + the previous menu card. By setting this value to 50, the user can move the + mouse cursor halfway across a menu card before it flips to the previous card. + Setting this value to 100 will keep the current menu card showing until the + user moves completely off the right edge of the card onto the previous card. + By setting this value to 0 (the default), the previous menu card will flip + over after moving slightly past its left edge. No setting of this value will + cause the previous menu to be displayed without at least moving the mouse + slightly past its left edge.} + }\leftindent{ }\section{Related tools} *************** *** 120,123 **** \leftindent{ \italic{preferences ! }}\enddata{text,268965568} --- 133,136 ---- \leftindent{ \italic{preferences ! }}\enddata{text,269084692} *** overhead/cmenu/cmintern.h Wed Nov 22 13:35:56 1989 --- overhead/cmenu/cmintern.h.NEW Tue Mar 20 23:01:18 1990 *************** *** 2,9 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/cmenu/RCS/cmintern.h,v 2.4 89/02/10 08:01:41 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/cmenu/RCS/cmintern.h,v $ */ /* Useful definitions... */ --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmintern.h,v 2.5 90/02/28 13:07:26 ajp Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmintern.h,v $ */ /* Useful definitions... */ *************** *** 51,56 **** --- 51,57 ---- int wormHeight; int useSaveUnder; int saveBits; + int overlapPct; }; #define HORIZONTALMARGIN 10 *** overhead/eli/bglisp/bglisp.c Wed Nov 22 13:36:27 1989 --- overhead/eli/bglisp/bglisp.c.NEW Tue Mar 20 23:02:21 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/bglisp/RCS/bglisp.c,v 2.5 89/02/10 23:10:41 ghoti Exp Locker: bobg $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/bglisp/RCS/bglisp.c,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/bglisp/RCS/bglisp.c,v 2.5 89/02/10 23:10:41 ghoti Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/bglisp/RCS/bglisp.c,v $ */ #include *** overhead/eli/hdrs/eli.h Wed Nov 22 13:37:00 1989 --- overhead/eli/hdrs/eli.h.NEW Tue Mar 20 23:03:15 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/hdrs/RCS/eli.h,v 2.12 89/07/07 12:30:08 bobg Exp $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/hdrs/RCS/eli.h,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/hdrs/RCS/eli.h,v 2.13 90/03/06 15:07:55 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/hdrs/RCS/eli.h,v $ */ #include *************** *** 14,20 **** #include #define MAJORVERSION (4) ! #define MINORVERSION (0) #define IN /* Someday I'll use these to label * params in */ --- 14,20 ---- #include #define MAJORVERSION (4) ! #define MINORVERSION (1) #define IN /* Someday I'll use these to label * params in */ *** overhead/eli/hdrs/etypes.h Wed Nov 22 13:37:01 1989 --- overhead/eli/hdrs/etypes.h.NEW Tue Mar 20 23:03:22 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/hdrs/RCS/etypes.h,v 2.6 89/06/17 15:37:07 bobg Exp $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/hdrs/RCS/etypes.h,v $ */ enum eliSymScopes_t { /* Symbol status (status symbol?) */ --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/hdrs/RCS/etypes.h,v 2.6 89/06/17 15:37:07 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/hdrs/RCS/etypes.h,v $ */ enum eliSymScopes_t { /* Symbol status (status symbol?) */ *** overhead/eli/lib/eerror.c Wed Nov 22 13:37:35 1989 --- overhead/eli/lib/eerror.c.NEW Mon Apr 2 13:55:41 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lib/RCS/eerror.c,v 2.6 89/06/17 15:38:23 bobg Exp $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lib/RCS/eerror.c,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/eerror.c,v 2.7 90/03/27 16:42:06 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/eerror.c,v $ */ #include *************** *** 35,44 **** char *loc; int unixerr; { eliErr_Set(st, EliErrNode(st), errtype, node, loc, unixerr); st->g_errflag = TRUE; ! if (errtype & EliCatchMask(st)) ! (*(EliCatchFn(st))) (st); } char *EliErrStr(code) /* If code is a power of two <= 128, --- 35,48 ---- char *loc; int unixerr; { + void (*fn)(); + eliErr_Set(st, EliErrNode(st), errtype, node, loc, unixerr); st->g_errflag = TRUE; ! if (errtype & EliCatchMask(st)) { ! fn = EliCatchFn(st); ! (*fn)(st); ! } } char *EliErrStr(code) /* If code is a power of two <= 128, *** overhead/eli/lib/eval.c Wed Nov 22 13:38:13 1989 --- overhead/eli/lib/eval.c.NEW Mon Apr 2 13:55:43 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lib/RCS/eval.c,v 2.7 89/06/17 15:39:44 bobg Exp $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lib/RCS/eval.c,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/eval.c,v 2.10 90/03/27 16:46:53 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/eval.c,v $ */ #include *************** *** 19,76 **** { EliSym_t *tmp; EliSexp_t *nodetmp; switch (EliSexp_GetType(expr)) { ! case e_data_none: ! EliSexp_SetSym(st, resbuf, EliNilSym(st)); ! break; ! case e_data_integer: ! EliSexp_SetInt(st, resbuf, EliSexp_GetInt(expr)); ! break; ! case e_data_string: ! EliSexp_SetStr(st, resbuf, EliSexp_GetStr(expr)); ! break; ! case e_data_symbol: ! if (!(tmp = EliFindSym(st, EliStr_GetString(EliSym_GetName(EliSexp_GetSym(expr)))))) { ! EliError(st, ELI_ERR_NOSYM, expr, "INTERNAL [eliEval (looking for symbol)]", 0); ! return; ! } ! nodetmp = EliSym_GetSexp(tmp); ! if (EliSexp_GetType(nodetmp) == e_data_none) { ! EliError(st, ELI_ERR_UNBOUND, expr, "INTERNAL [eliEval (returning symbol value)]", 0); ! return; ! } ! switch (EliSexp_GetType(nodetmp)) { ! case e_data_integer: ! EliSexp_SetInt(st, resbuf, EliSexp_GetInt(nodetmp)); ! break; ! case e_data_symbol: ! EliSexp_SetSym(st, resbuf, EliSexp_GetSym(nodetmp)); ! break; ! case e_data_string: ! EliSexp_SetStr(st, resbuf, EliSexp_GetStr(nodetmp)); ! break; ! case e_data_list: ! EliSexp_SetCons(st, resbuf, EliSexp_GetCons(nodetmp)); break; case e_data_fn: EliSexp_SetFn(st, resbuf, EliSexp_GetFn(nodetmp)); break; ! } ! break; ! case e_data_list: ! eliEvalList(st, EliCons_GetCar(EliSexp_GetCons(expr)), EliCons_GetCdr(EliSexp_GetCons(expr)), resbuf); if (EliErr_ErrP(st)) { st->g_errflag = FALSE; st->g_err->backtrace = EliAddToList(st, st->g_err->backtrace, expr); st->g_errflag = TRUE; ! return; } ! break; ! case e_data_fn: ! EliSexp_SetFn(st, resbuf, EliSexp_GetFn(expr)); /* Is this the Right ! * Thing? */ ! break; } } --- 19,83 ---- { EliSym_t *tmp; EliSexp_t *nodetmp; + int depth; switch (EliSexp_GetType(expr)) { ! case e_data_none: ! EliSexp_SetSym(st, resbuf, EliNilSym(st)); ! break; ! case e_data_integer: ! EliSexp_SetInt(st, resbuf, EliSexp_GetInt(expr)); ! break; ! case e_data_string: ! EliSexp_SetStr(st, resbuf, EliSexp_GetStr(expr)); ! break; ! case e_data_symbol: ! if (!(tmp = EliFindSym(st, EliStr_GetString(EliSym_GetName(EliSexp_GetSym(expr)))))) { ! EliError(st, ELI_ERR_NOSYM, expr, "INTERNAL [eliEval (looking for symbol)]", 0); ! return; ! } ! nodetmp = EliSym_GetSexp(tmp); ! if (EliSexp_GetType(nodetmp) == e_data_none) { ! EliError(st, ELI_ERR_UNBOUND, expr, "INTERNAL [eliEval (returning symbol value)]", 0); ! return; ! } ! switch (EliSexp_GetType(nodetmp)) { ! case e_data_integer: ! EliSexp_SetInt(st, resbuf, EliSexp_GetInt(nodetmp)); break; + case e_data_symbol: + EliSexp_SetSym(st, resbuf, EliSexp_GetSym(nodetmp)); + break; + case e_data_string: + EliSexp_SetStr(st, resbuf, EliSexp_GetStr(nodetmp)); + break; + case e_data_list: + EliSexp_SetCons(st, resbuf, EliSexp_GetCons(nodetmp)); + break; case e_data_fn: EliSexp_SetFn(st, resbuf, EliSexp_GetFn(nodetmp)); break; ! } ! break; ! case e_data_list: ! depth = st->numErrStkNodes; ! eliEvalList(st, EliCons_GetCar(EliSexp_GetCons(expr)), EliCons_GetCdr(EliSexp_GetCons(expr)), resbuf); if (EliErr_ErrP(st)) { st->g_errflag = FALSE; st->g_err->backtrace = EliAddToList(st, st->g_err->backtrace, expr); st->g_errflag = TRUE; ! return; } ! eliTraceStk_PurgeN(st, EliTraceStk(st), ! st->numErrStkNodes - depth); /* Brand new attempt to ! * actually do something ! * resembling garbage ! * collection */ ! break; ! case e_data_fn: ! EliSexp_SetFn(st, resbuf, EliSexp_GetFn(expr)); /* Is this the Right ! * Thing? */ ! break; } } *************** *** 84,89 **** --- 91,97 ---- EliCons_t *tmpcons, *anotherCons; char *fnname; int i, wasTrace; + void (*fn)(); switch (EliSexp_GetType(lcar)) { case e_data_integer: *************** *** 111,118 **** return; break; case e_fn_compiled: ! if (EliSexp_GetType(lcdr) != e_data_list) { /* Then it better be ! * e_data_none */ if (!(tmpcons = eliCons_GetNew_trace(st, EliTraceStk(st)))) return; } --- 119,126 ---- return; break; case e_fn_compiled: ! if (EliSexp_GetType(lcdr) != e_data_list) { /* Then it better be ! * e_data_none */ if (!(tmpcons = eliCons_GetNew_trace(st, EliTraceStk(st)))) return; } *************** *** 125,138 **** puts(fnname); ++st->indentTrace; } ! (*(eliFn_GetCompiled(fnval))) (st, tmpcons, resbuf); if (wasTrace && st->tracep) --st->indentTrace; if (EliErr_ErrP(st)) ! return; /* Dumb. What *else* is it going to do? */ break; case e_fn_none: ! EliError(st, ELI_ERR_FN_UNDEF, lcar, "INTERNAL [eliEvalList (functionless symbol at list car)]", 0); return; } break; --- 133,150 ---- puts(fnname); ++st->indentTrace; } ! fn = eliFn_GetCompiled(fnval); ! (*fn)(st, tmpcons, resbuf); if (wasTrace && st->tracep) --st->indentTrace; if (EliErr_ErrP(st)) ! return; /* Dumb. What *else* is it going to ! * do? */ break; case e_fn_none: ! EliError(st, ELI_ERR_FN_UNDEF, lcar, ! "INTERNAL [eliEvalList (functionless symbol at list car)]", ! 0); return; } break; *************** *** 189,195 **** else { if (!(tmpnode2 = eliSexp_GetNew_trace(st, EliTraceStk(st)))) return; ! eliEvalList(st, tmpnode, EliCons_GetCdr(EliSexp_GetCons(lcar)), tmpnode2); if (EliErr_ErrP(st)) return; eliEvalList(st, tmpnode2, lcdr, resbuf); --- 201,208 ---- else { if (!(tmpnode2 = eliSexp_GetNew_trace(st, EliTraceStk(st)))) return; ! eliEvalList(st, tmpnode, EliCons_GetCdr(EliSexp_GetCons(lcar)), ! tmpnode2); if (EliErr_ErrP(st)) return; eliEvalList(st, tmpnode2, lcdr, resbuf); *************** *** 211,218 **** return; } break; ! case e_data_fn: /* This whole section needs to be ! * double-checked */ fnval = EliSexp_GetFn(lcar); switch (eliFn_GetType(fnval)) { case e_fn_list: --- 224,231 ---- return; } break; ! case e_data_fn: /* This whole section needs to be ! * double-checked */ fnval = EliSexp_GetFn(lcar); switch (eliFn_GetType(fnval)) { case e_fn_list: *************** *** 231,242 **** } else anotherCons = EliSexp_GetCons(lcdr); ! (*(eliFn_GetCompiled(fnval))) (st, anotherCons, resbuf); if (EliErr_ErrP(st)) ! return; /* Dumb. What *else* is it going to do? */ break; case e_fn_none: ! EliError(st, ELI_ERR_FN_UNDEF, lcar, "INTERNAL [eliEvalList (empty functionnode at list car)]", 0); return; } break; --- 244,259 ---- } else anotherCons = EliSexp_GetCons(lcdr); ! fn = eliFn_GetCompiled(fnval); ! (*fn)(st, anotherCons, resbuf); if (EliErr_ErrP(st)) ! return; /* Dumb. What *else* is it going to ! * do? */ break; case e_fn_none: ! EliError(st, ELI_ERR_FN_UNDEF, lcar, ! "INTERNAL [eliEvalList (empty functionnode at list car)]", ! 0); return; } break; *************** *** 255,268 **** EliCons_t *lambdalist, *arglist; EliSexp_t *resbuf; { ! int numvars; /* Holds number of items pushed onto the ! * stack */ ! EliCons_t *varlist, /* The varlist is the 2nd element in the ! * lambda list, to wit: (lambda (a b c) (foo ! * you)) (car (cdr '(lambda (a b c) (foo ! * you)))) returns this list [(a b c)]. */ ! *llistcdr, /* Will contain the cdr of the lambda list */ ! *llistcdrcdr,/* Contains the cdr of llistcdr */ *evaledArgs; EliSexp_t *tmp; --- 272,287 ---- EliCons_t *lambdalist, *arglist; EliSexp_t *resbuf; { ! int numvars; /* Holds number of items pushed onto ! * the stack */ ! EliCons_t *varlist, /* The varlist is the 2nd element in ! * the lambda list, to wit: (lambda (a ! * b c) (foo you)) (car (cdr '(lambda ! * (a b c) (foo you)))) returns this ! * list [(a b c)]. */ ! *llistcdr, /* Will contain the cdr of the lambda ! * list */ ! *llistcdrcdr, /* Contains the cdr of llistcdr */ *evaledArgs; EliSexp_t *tmp; *************** *** 269,281 **** tmp = EliCons_GetCdr(lambdalist); llistcdr = EliSexp_GetCons(tmp); tmp = EliCons_GetCar(llistcdr); ! varlist = EliSexp_GetCons(tmp); if (!(evaledArgs = EliEvalListToList(st, arglist))) ! return; ! numvars = eliBind(st, EliEvalStack(st), varlist, evaledArgs); if (EliErr_ErrP(st)) { ! eliEvalStk_PopN(st, EliEvalStack(st), numvars); ! return; } tmp = EliCons_GetCdr(llistcdr); llistcdrcdr = EliSexp_GetCons(tmp); --- 288,300 ---- tmp = EliCons_GetCdr(lambdalist); llistcdr = EliSexp_GetCons(tmp); tmp = EliCons_GetCar(llistcdr); ! varlist = EliNilP(st, tmp) ? (EliCons_t *) 0 : EliSexp_GetCons(tmp); if (!(evaledArgs = EliEvalListToList(st, arglist))) ! return; ! numvars = varlist ? eliBind(st, EliEvalStack(st), varlist, evaledArgs) : 0; if (EliErr_ErrP(st)) { ! eliEvalStk_PopN(st, EliEvalStack(st), numvars); ! return; } tmp = EliCons_GetCdr(llistcdr); llistcdrcdr = EliSexp_GetCons(tmp); *************** *** 282,288 **** eliEval(st, EliCons_GetCar(llistcdrcdr), resbuf); if (EliErr_ErrP(st)) { eliEvalStk_PopN(st, EliEvalStack(st), numvars); ! return; } eliEvalStk_PopN(st, EliEvalStack(st), numvars); } --- 301,307 ---- eliEval(st, EliCons_GetCar(llistcdrcdr), resbuf); if (EliErr_ErrP(st)) { eliEvalStk_PopN(st, EliEvalStack(st), numvars); ! return; } eliEvalStk_PopN(st, EliEvalStack(st), numvars); } *************** *** 295,318 **** EliCons_t *lambdaqlist, *arglist; EliSexp_t *resbuf; { ! int numvars; /* Holds number of items pushed onto the ! * stack */ ! EliCons_t *varlist, /* The varlist is the 2nd element in the ! * lambdaq list, to wit: (lambdaq (a b c) ! * (foo you)) (car (cdr '(lambdaq (a b c) ! * (foo you)))) returns this list [(a b c)]. */ ! *llistcdr, /* Will contain the cdr of the lambdaq list */ ! *llistcdrcdr;/* Contains the cdr of llistcdr */ EliSexp_t *tmp; tmp = EliCons_GetCdr(lambdaqlist); llistcdr = EliSexp_GetCons(tmp); tmp = EliCons_GetCar(llistcdr); ! varlist = EliSexp_GetCons(tmp); ! numvars = eliBind(st, EliEvalStack(st), varlist, arglist); if (EliErr_ErrP(st)) { ! eliEvalStk_PopN(st, EliEvalStack(st), numvars); ! return; } tmp = EliCons_GetCdr(llistcdr); llistcdrcdr = EliSexp_GetCons(tmp); --- 314,339 ---- EliCons_t *lambdaqlist, *arglist; EliSexp_t *resbuf; { ! int numvars; /* Holds number of items pushed onto ! * the stack */ ! EliCons_t *varlist, /* The varlist is the 2nd element in ! * the lambdaq list, to wit: (lambdaq ! * (a b c) (foo you)) (car (cdr ! * '(lambdaq (a b c) (foo you)))) ! * returns this list [(a b c)]. */ ! *llistcdr, /* Will contain the cdr of the lambdaq ! * list */ ! *llistcdrcdr; /* Contains the cdr of llistcdr */ EliSexp_t *tmp; tmp = EliCons_GetCdr(lambdaqlist); llistcdr = EliSexp_GetCons(tmp); tmp = EliCons_GetCar(llistcdr); ! varlist = EliNilP(st, tmp) ? (EliCons_t *) 0 : EliSexp_GetCons(tmp); ! numvars = varlist ? eliBind(st, EliEvalStack(st), varlist, arglist) : 0; if (EliErr_ErrP(st)) { ! eliEvalStk_PopN(st, EliEvalStack(st), numvars); ! return; } tmp = EliCons_GetCdr(llistcdr); llistcdrcdr = EliSexp_GetCons(tmp); *************** *** 324,337 **** eliEvalStk_PopN(st, EliEvalStack(st), numvars); } ! void eliEvalLambdav(st, lambdavlist, arglist, resbuf) ! EliState_t *st; ! EliCons_t *lambdavlist, *arglist; ! EliSexp_t *resbuf; { ! EliSexp_t *listElts[3], *err, *paramSexp, *evaledArgsSexp; ! EliCons_t *paramList, *evaledArgs; ! EliSym_t *pushSym; if (3 != EliGetListCars(lambdavlist, listElts, 3)) { if (!(err = EliSexp_GetNew(st))) --- 345,358 ---- eliEvalStk_PopN(st, EliEvalStack(st), numvars); } ! void eliEvalLambdav(st, lambdavlist, arglist, resbuf) ! EliState_t *st; ! EliCons_t *lambdavlist, *arglist; ! EliSexp_t *resbuf; { ! EliSexp_t *listElts[3], *err, *paramSexp, *evaledArgsSexp; ! EliCons_t *paramList, *evaledArgs; ! EliSym_t *pushSym; if (3 != EliGetListCars(lambdavlist, listElts, 3)) { if (!(err = EliSexp_GetNew(st))) *************** *** 372,385 **** eliEvalStk_PopN(st, EliEvalStack(st), 1); } ! void eliEvalLambdavq(st, lambdavqlist, arglist, resbuf) ! EliState_t *st; ! EliCons_t *lambdavqlist, *arglist; ! EliSexp_t *resbuf; { ! EliSexp_t *listElts[3], *err, *paramSexp, *argsSexp; ! EliCons_t *paramList; ! EliSym_t *pushSym; if (3 != EliGetListCars(lambdavqlist, listElts, 3)) { if (!(err = EliSexp_GetNew(st))) --- 393,406 ---- eliEvalStk_PopN(st, EliEvalStack(st), 1); } ! void eliEvalLambdavq(st, lambdavqlist, arglist, resbuf) ! EliState_t *st; ! EliCons_t *lambdavqlist, *arglist; ! EliSexp_t *resbuf; { ! EliSexp_t *listElts[3], *err, *paramSexp, *argsSexp; ! EliCons_t *paramList; ! EliSym_t *pushSym; if (3 != EliGetListCars(lambdavqlist, listElts, 3)) { if (!(err = EliSexp_GetNew(st))) *** overhead/eli/lib/prims2.c Mon Mar 12 13:17:39 1990 --- overhead/eli/lib/prims2.c.NEW Tue Mar 20 23:04:49 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/eli/lib/RCS/prims2.c,v 1.1 90/02/13 15:23:46 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/eli/lib/RCS/prims2.c,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims2.c,v 1.2 90/03/13 15:46:05 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims2.c,v $ */ #include *************** *** 1332,1338 **** } if (processResult < 0) return; ! EliSexp_SetStr(st, resbuf, EliSym_GetName(EliSexp_GetSym(args[0]))); } void Prim_STR_TO_INT(st, arglist, resbuf) --- 1332,1341 ---- } if (processResult < 0) return; ! EliSexp_SetStr(st, resbuf, ! EliSym_GetName(EliNilP(st, args[0]) ? ! EliNilSym(st) : ! EliSexp_GetSym(args[0]))); } void Prim_STR_TO_INT(st, arglist, resbuf) *** overhead/util/lib/prefs.help Wed Nov 22 14:16:05 1989 --- overhead/util/lib/prefs.help.NEW Tue Mar 20 23:32:18 1990 *************** *** 1,4 **** ! \begindata{text,268914164} \textdsversion{12} \template{help} --- 1,4 ---- ! \begindata{text,268758700} \textdsversion{12} \template{help} *************** *** 422,430 **** \leftindent{Determines what extension appears on checkpoint files. Note that the period ("\bold{.}") that usually precedes extensions is not included automatically. If you want a period (as in the default .CKP), be sure to type ! it in the name of your extension. ! } \bold{ez.CheckpointMinimum: \italic{120}} \leftindent{Determines how much time must elapse since a change was made to a --- 422,438 ---- \leftindent{Determines what extension appears on checkpoint files. Note that the period ("\bold{.}") that usually precedes extensions is not included automatically. If you want a period (as in the default .CKP), be sure to type ! it in the name of your extension.} ! ! \bold{ez.CheckpointDirectory: } ! ! \leftindent{Determines in which directory checkpoint files are written. The ! default operation is to save the checkpoint file in the same directory as the ! file being edited. By setting the checkpoint directory, you can cause all ! checkpoint files to be saved into that directory.} ! ! \bold{ez.CheckpointMinimum: \italic{120}} \leftindent{Determines how much time must elapse since a change was made to a *************** *** 1019,1024 **** --- 1027,1033 ---- + }\bold{ZipCreateTolerance: \italic{10}}\leftindent{ When you are creating an object with multiple segments in the zip editor, if *************** *** 1416,1419 **** link} ! }\enddata{text,268914164} --- 1425,1428 ---- link} ! }\enddata{text,268758700} END OF ANDREW PATCH 5