home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Developer University / DU Projects / Sample / Sources / Part.cpp < prev    next >
Encoding:
Text File  |  1996-08-22  |  2.0 KB  |  81 lines  |  [TEXT/CWIE]

  1. //    Release Version:    $ ODF 2 $
  2. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  3.  
  4. //================================================================================
  5. #ifndef PART_H
  6. #include "Part.h"
  7. #endif
  8.  
  9. #ifndef FRAME_H
  10. #include "Frame.h"
  11. #endif
  12.  
  13. #ifndef DEFINES_K
  14. #include "Defines.k"
  15. #endif
  16.  
  17. #ifndef BINDING_K
  18. #include "Binding.k"
  19. #endif
  20.  
  21. // ----- Framework Includes -----
  22. #ifndef FWABOUT_H
  23. #include "FWAbout.h"
  24. #endif
  25.  
  26. //==============================================================================
  27. #ifdef FW_BUILD_MAC
  28. #pragma segment Sample
  29. #endif
  30.  
  31. FW_DEFINE_AUTO(CSamplePart)
  32. //==============================================================================
  33. CSamplePart::CSamplePart(ODPart* odPart)
  34.   :    FW_CPart(odPart, FW_gInstance, kPartInfoID)
  35. {
  36.     FW_END_CONSTRUCTOR
  37. }
  38.  
  39. //--------------------------------------------------------------------------------
  40. CSamplePart::~CSamplePart()
  41. {
  42.     FW_START_DESTRUCTOR
  43. }
  44.  
  45. //--------------------------------------------------------------------------------
  46. void 
  47. CSamplePart::Initialize(Environment* ev, ODStorageUnit* storageUnit, 
  48.                         FW_Boolean fromStorage)    // Override
  49. {
  50.     FW_CPart::Initialize(ev, storageUnit, fromStorage);
  51.     FW_CSelection* selection = NULL;
  52.     const ODType kMainPresentation = "Apple:Presentation:Sample";
  53.     this->RegisterPresentation(ev, kMainPresentation, true, selection);
  54. }
  55.  
  56. //--------------------------------------------------------------------------------
  57. FW_CFrame* 
  58. CSamplePart::NewFrame(Environment* ev, ODFrame* odFrame,
  59.                         FW_CPresentation* presentation, FW_Boolean fromStorage)    // Override
  60. {
  61.     FW_UNUSED(fromStorage);
  62.     return FW_NEW(CSampleFrame, (ev, odFrame, presentation, this));
  63. }
  64.  
  65. //--------------------------------------------------------------------------------
  66. FW_CContent* 
  67. CSamplePart::NewPartContent(Environment* ev)
  68. {
  69.     FW_UNUSED(ev);
  70.     return NULL;
  71. }
  72.  
  73. //--------------------------------------------------------------------------------
  74. FW_Handled 
  75. CSamplePart::DoAbout(Environment* ev)
  76. {
  77.     ::FW_About(ev, this, kAbout);
  78.     
  79.     return FW_kHandled;
  80. }
  81.