home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Developer University / DUProjects / Talker / Sources / Part.cpp < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.9 KB  |  119 lines  |  [TEXT/CWIE]

  1. //========================================================================================
  2. //    Release Version:    $ ODF 1 $
  3. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  4.  
  5. //================================================================================
  6. #include "Talker.hpp"
  7.  
  8. #ifndef PART_H
  9. #include "Part.h"
  10. #endif
  11.  
  12. #ifndef CONTENT_H
  13. #include "Content.h"
  14. #endif
  15.  
  16. #ifndef BINDING_K
  17. #include "Binding.k"
  18. #endif
  19.  
  20. #ifndef FRAME_H
  21. #include "Frame.h"
  22. #endif
  23.  
  24. #ifndef SELECTION_H
  25. #include "Selection.h"
  26. #endif
  27.  
  28. // ----- Framework Layer -----
  29. #ifndef FWPRESEN_H
  30. #include "FWPresen.h"        // FW_CPresentation
  31. #endif
  32.  
  33. #ifndef FWUTIL_H
  34. #include "FWUtil.h"            // FW_Beep()
  35. #endif
  36.  
  37. #ifndef FWABOUT_H
  38. #include "FWAbout.h"        //::FW_About()
  39. #endif
  40.  
  41. // ----- OS Layer -----
  42. #ifndef FWCFMRES_H
  43. #include "FWCFMRes.h"        // FW_CSharedLibraryResourceFile
  44. #endif
  45.  
  46. #ifndef FWSUSINK_H
  47. #include "FWSUSink.h"        // FW_CStorageUnitSink
  48. #endif
  49.  
  50. #ifndef FWBARRAY_H
  51. #include "FWBArray.h"        // FW_CByteArray
  52. #endif
  53.  
  54. // ----- Foundation Layer -----
  55. #ifndef FWSTREAM_H
  56. #include <FWStream.h>        // FW_InitializeArchiving
  57. #endif
  58.  
  59. #ifndef FWMEMMGR_H
  60. #include "FWMemMgr.h"        // FW_CMemoryManager
  61. #endif
  62.  
  63. #ifndef FWSUSINK_H
  64. #include "FWSUSink.h"        // FW_CStorageUnitSink
  65. #endif
  66.  
  67. //==============================================================================
  68. #ifdef FW_BUILD_MAC
  69. #pragma segment Talker
  70. #endif
  71.  
  72. FW_DEFINE_AUTO(CTalkerPart)
  73. //==============================================================================
  74. CTalkerPart::CTalkerPart(ODPart* odPart)
  75.   :    FW_CPart(odPart, FW_gInstance, kPartInfoID),
  76.     fPresentation(NULL),
  77.     fPartContent(NULL)
  78. {
  79.     FW_END_CONSTRUCTOR
  80. }
  81.  
  82. //--------------------------------------------------------------------------------
  83. CTalkerPart::~CTalkerPart()
  84. {
  85.     FW_START_DESTRUCTOR
  86. }
  87.  
  88. //--------------------------------------------------------------------------------
  89. void 
  90. CTalkerPart::Initialize(Environment* ev)    // Override
  91. {
  92.     FW_CPart::Initialize(ev);
  93.     CTalkerSelection* selection = FW_NEW(CTalkerSelection, (ev, fPartContent));
  94.     const ODType kMainPresentation = "Apple:Presentation:Talker";
  95.     const FW_Boolean kDefaultPresentation = true;
  96.     fPresentation = RegisterPresentation(ev, kMainPresentation, 
  97.                                             kDefaultPresentation, selection);
  98.     FW_CSharedLibraryResourceFile resFile(ev);
  99.     GetMenuBar(ev)->InitializeFromResource(ev, kMenuBarID);
  100. }
  101.  
  102. //--------------------------------------------------------------------------------
  103. FW_CFrame* 
  104. CTalkerPart::NewFrame(Environment* ev, ODFrame* odFrame,
  105.                         FW_CPresentation* presentation, FW_Boolean fromStorage)    // Override
  106. {
  107.     FW_UNUSED(presentation);
  108.     FW_UNUSED(fromStorage);
  109.     return FW_NEW(CTalkerFrame, (ev, odFrame, presentation, fPartContent));
  110. }
  111.  
  112. //------------------------------------------------------------------------------
  113. FW_CContent* 
  114. CTalkerPart::NewPartContent(Environment* ev)
  115. {
  116.     fPartContent = FW_NEW(CTalkerContent, (ev, this));
  117.     return fPartContent;
  118. }
  119.