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 / ODFDev / ODF / OS / FWMenu / FWAPulDM.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.8 KB  |  80 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWAPulDM.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. // We separate the archiving functions into their own translation units in order to
  10. // enable dead-stripping.
  11.  
  12. #include "FWOS.hpp"
  13.  
  14. #ifndef FWPULLDM_H
  15. #include "FWPullDM.h"
  16. #endif
  17.  
  18. #ifndef FWPRIMEM_H
  19. #include "FWPriMem.h"
  20. #endif
  21.  
  22. //========================================================================================
  23. // File scope definitions
  24. //========================================================================================
  25.  
  26. #ifdef FW_BUILD_MAC
  27. #pragma segment fwmenu
  28. #endif
  29.  
  30. //========================================================================================
  31. //    class FW_CPullDownMenu
  32. //========================================================================================
  33.  
  34. const FW_ClassTypeConstant FW_LPullDownMenu = FW_TYPE_CONSTANT('p','d','m','n');
  35. FW_REGISTER_ARCHIVABLE_CLASS(FW_LPullDownMenu, FW_CPullDownMenu, FW_CPullDownMenu::Create, FW_CPullDownMenu::InitializeFromArchive, FW_CPullDownMenu::Destroy, FW_CPullDownMenu::Write)
  36.  
  37. //----------------------------------------------------------------------------------------
  38. //    FW_CPullDownMenu::Create
  39. //----------------------------------------------------------------------------------------
  40.  
  41. void* FW_CPullDownMenu::Create(FW_CReadableStream& stream, FW_ClassTypeConstant type)
  42. {
  43. FW_UNUSED(type);
  44. FW_UNUSED(stream);
  45.     return ::operator new(sizeof(FW_CPullDownMenu));
  46. }
  47.  
  48. //----------------------------------------------------------------------------------------
  49. //    FW_CPullDownMenu::InitializeFromArchive
  50. //----------------------------------------------------------------------------------------
  51.  
  52. void FW_CPullDownMenu::InitializeFromArchive(FW_CReadableStream& stream, FW_ClassTypeConstant type, void* object)
  53. {
  54. FW_UNUSED(type);
  55.     FW_SOMEnvironment ev;
  56.     new (object) FW_CPullDownMenu(ev, stream);
  57. }
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    FW_CPullDownMenu::Destroy
  61. //----------------------------------------------------------------------------------------
  62.  
  63. void    FW_CPullDownMenu::Destroy(void* object, FW_ClassTypeConstant type)
  64. {
  65. FW_UNUSED(type);
  66.     ::operator delete(object);
  67. }
  68.  
  69. //----------------------------------------------------------------------------------------
  70. //    FW_CPullDownMenu::Write
  71. //----------------------------------------------------------------------------------------
  72.  
  73. void FW_CPullDownMenu::Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object)
  74. {
  75. FW_UNUSED(type);
  76.     FW_SOMEnvironment ev;
  77.     ((FW_CPullDownMenu*) object)->Flatten(ev, stream);
  78. }
  79.  
  80.