home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / scnote / tesample.002 / TESampleGlue.a < prev    next >
Text File  |  1989-06-01  |  3KB  |  88 lines

  1. ;
  2. ;    Apple Macintosh Developer Technical Support
  3. ;
  4. ;    MultiFinder-Aware TextEdit Sample Application
  5. ;
  6. ;    TESample
  7. ;
  8. ;    TESampleGlue.a    -    Assembler Source
  9. ;
  10. ;    Copyright ⌐ 1989 Apple Computer, Inc.
  11. ;    All rights reserved.
  12. ;
  13. ;    Versions:    
  14. ;                1.00                08/88
  15. ;                1.01                11/88
  16. ;                1.02                04/89
  17. ;                1.03                06/89
  18. ;
  19. ;    Components:
  20. ;                TESample.p            June 1, 1989
  21. ;                TESample.c            June 1, 1989
  22. ;                TESampleGlue.a        June 1, 1989    -MPW only-
  23. ;                TESample.r            June 1, 1989
  24. ;                TESample.h            June 1, 1989
  25. ;                PTESample.make        June 1, 1989    -MPW only-
  26. ;                CTESample.make        June 1, 1989    -MPW only-
  27. ;                TESampleGlue.s        June 1, 1989    -A/UX only-
  28. ;                TESampleAUX.r        June 1, 1989    -A/UX only-
  29. ;                Makefile            June 1, 1989    -A/UX only-
  30. ;
  31. ;    TESample is an example application that demonstrates how 
  32. ;    to initialize the commonly used toolbox managers, operate 
  33. ;    successfully under MultiFinder, handle desk accessories and 
  34. ;    create, grow, and zoom windows. The fundamental TextEdit 
  35. ;    toolbox calls and TextEdit autoscroll are demonstrated. It 
  36. ;    also shows how to create and maintain scrollbar controls.
  37. ;
  38. ;    It does not by any means demonstrate all the techniques you 
  39. ;    need for a large application. In particular, Sample does not 
  40. ;    cover exception handling, multiple windows/documents, 
  41. ;    sophisticated memory management, printing, or undo. All of 
  42. ;    these are vital parts of a normal full-sized application.
  43. ;
  44. ;    This application is an example of the form of a Macintosh 
  45. ;    application; it is NOT a template. It is NOT intended to be 
  46. ;    used as a foundation for the next world-class, best-selling, 
  47. ;    600K application. A stick figure drawing of the human body may 
  48. ;    be a good example of the form for a painting, but that does not 
  49. ;    mean it should be used as the basis for the next Mona Lisa.
  50. ;
  51. ;    We recommend that you review this program or Sample before 
  52. ;    beginning a new application. Sample is a simple app. which doesn╒t 
  53. ;    use TextEdit or the Control Manager.
  54. ;
  55.  
  56. ;
  57. ;    AsmClikLoop
  58. ;
  59. ;    This routine gets called by the TextEdit Manager from TEClick.
  60. ;    It calls the old, default click loop routine that scrolls the
  61. ;    text, and then calls our own Pascal routine that handles
  62. ;    tracking the scroll bars to follow along.  It doesn't bother
  63. ;    with saving registers A0 and D0, because they are trashed
  64. ;    anyway by TextEdit.
  65. ;
  66.  
  67. AsmClikLoop    PROC        EXPORT
  68.  
  69.             IMPORT        GETOLDCLIKLOOP
  70.             IMPORT        PASCALCLIKLOOP
  71.             
  72.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  73.             CLR.L        -(SP)                ; make space for procedure pointer
  74.             JSR            GETOLDCLIKLOOP        ; get the old clikLoop
  75.             MOVEA.L        (SP)+,A0            ; into A0
  76.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  77.             
  78.             JSR            (A0)                ; and execute old clikLoop
  79.  
  80.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  81.             JSR            PASCALCLIKLOOP        ; do our clikLoop
  82.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  83.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  84.             RTS
  85.  
  86.             END 
  87.  
  88.