home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / DTS.Lib / TUndoTaskObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-04  |  2.1 KB  |  97 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** Program:     DTS.Lib
  5. ** File:        TUndoTaskObj.c
  6. ** Written by:  Eric Soldan
  7. **
  8. ** Copyright © 1992 Apple Computer, Inc.
  9. ** All rights reserved.
  10. */
  11.  
  12. /* You may incorporate this sample code into your applications without
  13. ** restriction, though the sample code has been provided "AS IS" and the
  14. ** responsibility for its operation is 100% yours.  However, what you are
  15. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  16. ** after having made changes. If you're going to re-distribute the source,
  17. ** we require that you make it clear in the source that the code was
  18. ** descended from Apple Sample Code, but that you've made changes. */
  19.  
  20. #ifndef __OSEVENTS__
  21. #include <OSEvents.h>
  22. #endif
  23.  
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29. #include <Quickdraw.h>
  30. #endif
  31.  
  32. //#ifndef __STRING__
  33. //#include <String.h>
  34. //#endif
  35.  
  36. #ifndef __TREEOBJ__
  37. #include "TreeObj.h"
  38. #endif
  39.  
  40. #ifndef __UTILITIES__
  41. #include "Utilities.h"
  42. #endif
  43.  
  44.  
  45.  
  46. #pragma segment TreeObj
  47. long    TUndoTaskObj(TreeObjHndl hndl, short message, long data)
  48. {
  49.     short    fileRefNum;
  50.     char    *cptr;
  51.     Point    pt;
  52.  
  53.     switch (message) {
  54.         case FREADMESSAGE:
  55.             fileRefNum = data;
  56.             return(ReadTreeObjData(hndl, fileRefNum));
  57.             break;
  58.  
  59.         case FWRITEMESSAGE:
  60.             fileRefNum = data;
  61.             return(WriteTreeObjData(hndl, fileRefNum));
  62.             break;
  63.  
  64.         case VHMESSAGE:
  65.             cptr = ((VHFormatDataPtr)data)->data;
  66.             ccatchr(cptr, 13, 2);
  67.             ccat   (cptr, "$10: TUndoTaskObj:");
  68.             ccatchr(cptr, 13, 1);
  69.             ccat   (cptr, "  $00: editType   = ");
  70.             ccatdec(cptr, mDerefUndoTask(hndl)->editType);
  71.             ccatchr(cptr, 13, 1);
  72.             ccat   (cptr, "  $02: undoOrigin = (");
  73.             pt = mDerefUndoTask(hndl)->undoOrigin;
  74.             ccatdec(cptr, pt.v);
  75.             ccat   (cptr, ",");
  76.             ccatdec(cptr, pt.h);
  77.             ccat   (cptr, ")");
  78.             ccatchr(cptr, 13, 1);
  79.             ccat   (cptr, "  $06: redoOrigin = (");
  80.             pt = mDerefUndoTask(hndl)->redoOrigin;
  81.             ccatdec(cptr, pt.v);
  82.             ccat   (cptr, ",");
  83.             ccatdec(cptr, pt.h);
  84.             ccat   (cptr, ")");
  85.             return(true);
  86.             break;
  87.  
  88.         default:
  89.             break;
  90.     }
  91.  
  92.     return(noErr);
  93. }
  94.  
  95.  
  96.  
  97.