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 / Framewrk / FWPart / FWAScrol.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  6.1 KB  |  164 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWAScrol.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 "FWFrameW.hpp"
  13.  
  14. #ifndef FWSCROLR_H
  15. #include "FWScrolr.h"
  16. #endif
  17.  
  18. //========================================================================================
  19. // File scope definitions
  20. //========================================================================================
  21.  
  22. #ifdef FW_BUILD_MAC
  23. #pragma segment FW_FrameSegment
  24. #endif
  25.  
  26. //========================================================================================
  27. // CLASS FW_CPrivBaseScroller
  28. //========================================================================================
  29.  
  30. const FW_ClassTypeConstant FW_LPrivBaseScroller = FW_TYPE_CONSTANT('b','s','c','l');
  31. FW_REGISTER_ARCHIVABLE_CLASS(FW_LPrivBaseScroller, FW_CPrivBaseScroller, FW_CPrivBaseScroller::Create, FW_CPrivBaseScroller::Read, FW_CPrivBaseScroller::Destroy, FW_CPrivBaseScroller::Write)
  32.  
  33. //----------------------------------------------------------------------------------------
  34. //    FW_CPrivBaseScroller::Create
  35. //----------------------------------------------------------------------------------------
  36.  
  37. void* FW_CPrivBaseScroller::Create(FW_CReadableStream& stream, FW_ClassTypeConstant type)
  38. {
  39. FW_UNUSED(stream);
  40. FW_UNUSED(type);
  41.     FW_DEBUG_MESSAGE("FW_CPrivBaseScroller is an abstract base class");
  42.     return NULL;
  43. }
  44.  
  45. //----------------------------------------------------------------------------------------
  46. //    FW_CPrivBaseScroller::Destroy
  47. //----------------------------------------------------------------------------------------
  48.  
  49. void FW_CPrivBaseScroller::Destroy(void* object, FW_ClassTypeConstant type)
  50. {
  51. FW_UNUSED(type);
  52. FW_UNUSED(object);
  53.     FW_DEBUG_MESSAGE("FW_CPrivBaseScroller is an abstract base class");
  54. }
  55.  
  56. //----------------------------------------------------------------------------------------
  57. //    FW_CPrivBaseScroller::Read
  58. //----------------------------------------------------------------------------------------
  59.  
  60. void FW_CPrivBaseScroller::Read(FW_CReadableStream& stream, FW_ClassTypeConstant type, void* object)
  61. {
  62. FW_UNUSED(type);
  63. FW_UNUSED(stream);
  64. FW_UNUSED(object);
  65.     FW_DEBUG_MESSAGE("FW_CPrivBaseScroller is an abstract base class");
  66. }
  67.  
  68. //----------------------------------------------------------------------------------------
  69. //    FW_CPrivBaseScroller::Write
  70. //----------------------------------------------------------------------------------------
  71.  
  72. void FW_CPrivBaseScroller::Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object)
  73. {
  74. FW_UNUSED(type);
  75. FW_UNUSED(stream);
  76. FW_UNUSED(object);
  77.     FW_DEBUG_MESSAGE("FW_CPrivBaseScroller is an abstract base class");
  78. }
  79.  
  80. //========================================================================================
  81. // CLASS FW_CScroller
  82. //========================================================================================
  83.  
  84. const FW_ClassTypeConstant FW_LScroller = FW_TYPE_CONSTANT('s','c','l','r');
  85. FW_REGISTER_ARCHIVABLE_CLASS(FW_LScroller, FW_CScroller, FW_CScroller::Create, FW_CScroller::Read, FW_CScroller::Destroy, FW_CScroller::Write)
  86.  
  87. //----------------------------------------------------------------------------------------
  88. //    FW_CScroller::Create
  89. //----------------------------------------------------------------------------------------
  90.  
  91. void* FW_CScroller::Create(FW_CReadableStream& stream, FW_ClassTypeConstant type)
  92. {
  93. FW_UNUSED(stream);
  94. FW_UNUSED(type);
  95.     FW_SOMEnvironment ev;
  96.     return FW_NEW(FW_CScroller, (ev));
  97. }
  98.  
  99. //----------------------------------------------------------------------------------------
  100. //    FW_CScroller::Destroy
  101. //----------------------------------------------------------------------------------------
  102.  
  103. void FW_CScroller::Destroy(void* object, FW_ClassTypeConstant type)
  104. {
  105. FW_UNUSED(type);
  106.     FW_CScroller* self = (FW_CScroller*) object;
  107.     delete self;
  108. }
  109.  
  110. //----------------------------------------------------------------------------------------
  111. //    FW_CScroller::Read
  112. //----------------------------------------------------------------------------------------
  113.  
  114. void FW_CScroller::Read(FW_CReadableStream& stream, FW_ClassTypeConstant type, void* object)
  115. {
  116. FW_UNUSED(type);
  117.     FW_SOMEnvironment ev;
  118.     ((FW_CScroller *) object)->InitializeFromStream(ev, stream);
  119. }
  120.  
  121. //----------------------------------------------------------------------------------------
  122. //    FW_CScroller::Write
  123. //----------------------------------------------------------------------------------------
  124.  
  125. void FW_CScroller::Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object)
  126. {
  127. FW_UNUSED(type);
  128.     FW_SOMEnvironment ev;
  129.     ((const FW_CScroller *) object)->Flatten(ev, stream);
  130. }
  131.  
  132.  
  133. //========================================================================================
  134. // CLASS FW_CScrollBarScroller
  135. //========================================================================================
  136.  
  137. const FW_ClassTypeConstant FW_LScrollBarScroller = FW_TYPE_CONSTANT('s','b','s','c');
  138. FW_REGISTER_ARCHIVABLE_CLASS(FW_LScrollBarScroller, FW_CScrollBarScroller, FW_CScrollBarScroller::Create, FW_CScroller::Read, FW_CScrollBarScroller::Destroy, FW_CScroller::Write)
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    FW_CScrollBarScroller::Create
  142. //----------------------------------------------------------------------------------------
  143.  
  144. void* FW_CScrollBarScroller::Create(FW_CReadableStream& stream, FW_ClassTypeConstant type)
  145. {
  146. FW_UNUSED(stream);
  147. FW_UNUSED(type);
  148.     FW_SOMEnvironment ev;
  149.     return FW_NEW(FW_CScrollBarScroller, (ev));
  150. }
  151.  
  152. //----------------------------------------------------------------------------------------
  153. //    FW_CScrollBarScroller::Destroy
  154. //----------------------------------------------------------------------------------------
  155.  
  156. void FW_CScrollBarScroller::Destroy(void* object, FW_ClassTypeConstant type)
  157. {
  158. FW_UNUSED(type);
  159.     FW_CScrollBarScroller* self = (FW_CScrollBarScroller*) object;
  160.     delete self;
  161. }
  162.  
  163.  
  164.