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 / FWResour / FWResFil.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.0 KB  |  190 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWResFil.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #ifndef   FWRESFIL_H
  13. #include "FWResFil.h"
  14. #endif
  15.  
  16. #ifndef   FWSTRS_H
  17. #include "FWStrs.h"
  18. #endif
  19.  
  20. #ifndef   FWFILESP_H
  21. #include "FWFileSp.h"
  22. #endif
  23.  
  24. #ifndef FWEXCDEF_H
  25. #include "FWExcDef.h"
  26. #endif
  27.  
  28. #ifndef   FWPRIDEB_H
  29. #include "FWPriDeb.h"
  30. #endif
  31.  
  32. #ifndef FWEXCEPT_H
  33. #include "FWExcept.h"
  34. #endif
  35.  
  36. //----------------------------------------------------------------------------------------
  37. // Mac-only
  38. //----------------------------------------------------------------------------------------
  39. #ifdef FW_BUILD_MAC
  40.  
  41. #ifndef __ERRORS__
  42. #include <errors.h>
  43. #endif
  44.  
  45. #ifndef __TOOLUTILS__
  46. #include <ToolUtils.h>
  47. #endif
  48.  
  49. #ifndef __RESOURCES__
  50. #include <Resources.h>
  51. #endif
  52.  
  53. #ifndef __MENUS__
  54. #include <Menus.h>
  55. #endif
  56.  
  57. #ifndef __STRING__
  58. #include <string.h>
  59. #endif
  60.  
  61. #ifndef __MEMORY__
  62. #include <Memory.h>
  63. #endif
  64.  
  65. #endif
  66.  
  67. #ifdef FW_BUILD_MAC
  68. #pragma segment fwresour
  69. #endif
  70.  
  71. //========================================================================================
  72. //    Template instantiations
  73. //========================================================================================
  74.  
  75. #include "FWSOMPtr.tpp"
  76.  
  77. FW_DEFINE_AUTO_TEMPLATE(FW_TCountedSOMPtr, FW_OResourceFile)
  78.  
  79. #if FW_USE_TEMPLATE_PRAGMAS
  80. #pragma template_access public
  81. #pragma template FW_TCountedSOMPtr<FW_OResourceFile>
  82. #endif
  83.  
  84. #if FW_ANSI_TEMPLATE_INSTANTIATION
  85. template class FW_TCountedSOMPtr<FW_OResourceFile>;
  86. #endif
  87.  
  88. //========================================================================================
  89. // CLASS FW_PResourceFile
  90. //========================================================================================
  91.  
  92. FW_DEFINE_AUTO(FW_PResourceFile)
  93.  
  94. //----------------------------------------------------------------------------------------
  95. // FW_PResourceFile::FW_PResourceFile 
  96. //----------------------------------------------------------------------------------------
  97.  
  98. FW_PResourceFile::FW_PResourceFile()
  99. {
  100.     FW_END_CONSTRUCTOR
  101. }
  102.  
  103. //----------------------------------------------------------------------------------------
  104. // FW_PResourceFile::FW_PResourceFile 
  105. //----------------------------------------------------------------------------------------
  106.  
  107. FW_PResourceFile::FW_PResourceFile(Environment* ev, FW_OResourceFile *rep)
  108. {
  109.     SetRep(ev, rep);
  110.     FW_END_CONSTRUCTOR
  111. }
  112.  
  113. //----------------------------------------------------------------------------------------
  114. // FW_PResourceFile::FW_PResourceFile 
  115. //----------------------------------------------------------------------------------------
  116.  
  117. FW_PResourceFile::FW_PResourceFile(Environment* ev, FW_OFileSpecification* newFileSpec)
  118. {
  119.     FW_OResourceFile* rep = new FW_OResourceFile();
  120.  
  121.     SetRep(ev, rep);
  122.     rep->InitFromFileSpec(ev, newFileSpec);
  123.     FW_END_CONSTRUCTOR
  124. }
  125.  
  126. //----------------------------------------------------------------------------------------
  127. // FW_PResourceFile::FW_PResourceFile 
  128. //----------------------------------------------------------------------------------------
  129.  
  130. FW_PResourceFile::FW_PResourceFile(Environment* ev, FW_ResourceFileID resFileID)
  131. {
  132.     FW_OResourceFile* rep = new FW_OResourceFile();
  133.  
  134.     SetRep(ev, rep);
  135.     rep->InitFromResFileID(ev, resFileID);
  136.     FW_END_CONSTRUCTOR
  137. }
  138.  
  139. //----------------------------------------------------------------------------------------
  140. // FW_PResourceFile::FW_PResourceFile 
  141. //----------------------------------------------------------------------------------------
  142.  
  143. FW_PResourceFile::FW_PResourceFile(const FW_PResourceFile& other)
  144. {
  145.     FW_SOMEnvironment ev;
  146.  
  147.     SetRep(ev, other);
  148.     FW_END_CONSTRUCTOR
  149. }
  150.  
  151. //----------------------------------------------------------------------------------------
  152. // FW_PResourceFile::~FW_PResourceFile 
  153. //----------------------------------------------------------------------------------------
  154.  
  155. FW_PResourceFile::~FW_PResourceFile()
  156. {
  157.     FW_START_DESTRUCTOR
  158. }
  159.  
  160.  
  161. //========================================================================================
  162. // FW_CMacResLoadFalse
  163. //========================================================================================
  164.  
  165. #if defined FW_BUILD_MAC
  166. FW_DEFINE_AUTO(FW_CMacResLoadFalse)
  167. #endif
  168.  
  169. //----------------------------------------------------------------------------------------
  170. // FW_CMacResLoadFalse::FW_CMacResLoadFalse 
  171. //----------------------------------------------------------------------------------------
  172. #if defined FW_BUILD_MAC
  173. FW_CMacResLoadFalse::FW_CMacResLoadFalse()
  174. {
  175.     ::SetResLoad(false);
  176.     FW_END_CONSTRUCTOR
  177. }
  178. #endif
  179.  
  180. //----------------------------------------------------------------------------------------
  181. // FW_CMacResLoadFalse::~FW_CMacResLoadFalse 
  182. //----------------------------------------------------------------------------------------
  183. #if defined FW_BUILD_MAC
  184. FW_CMacResLoadFalse::~FW_CMacResLoadFalse()
  185. {
  186.     FW_START_DESTRUCTOR
  187.     ::SetResLoad(true);
  188. }
  189. #endif
  190.