home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWResour / Sources / FWResFil.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  4.6 KB  |  179 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:        FWResFil.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    1995 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. //----------------------------------------------------------------------------------------
  33. // Mac-only
  34. //----------------------------------------------------------------------------------------
  35. #ifdef FW_BUILD_MAC
  36.  
  37. #pragma segment ResourceFile
  38.  
  39. #ifndef __ERRORS__
  40. #include <errors.h>
  41. #endif
  42.  
  43. #ifndef __TOOLUTILS__
  44. #include <ToolUtils.h>
  45. #endif
  46.  
  47. #ifndef __RESOURCES__
  48. #include <Resources.h>
  49. #endif
  50.  
  51. #ifndef __MENUS__
  52. #include <Menus.h>
  53. #endif
  54.  
  55. #ifndef __STRING__
  56. #include <string.h>
  57. #endif
  58.  
  59. #ifndef __MEMORY__
  60. #include <Memory.h>
  61. #endif
  62.  
  63. #endif
  64.  
  65. #if FW_LIB_EXPORT_PRAGMAS
  66. #pragma lib_export on
  67. #endif
  68.  
  69. #ifdef FW_BUILD_MAC
  70. //    [HLX] Doesn't make much sens in an OpenDoc World        
  71. //const FW_ResourceFileID FW_CResourceFile::gMacAppResFileID = ::CurResFile();
  72. #endif
  73.  
  74. //========================================================================================
  75. // CLASS FW_CResourceFile
  76. //========================================================================================
  77.  
  78. /*
  79. //    [HLX] Doesn't make much sens in an OpenDoc World        
  80. //----------------------------------------------------------------------------------------
  81. // FW_CResourceFile::GetAppResourceFileID 
  82. //----------------------------------------------------------------------------------------
  83.  
  84. FW_ResourceFileID FW_CResourceFile::GetAppResourceFileID()
  85. {
  86. #ifdef FW_BUILD_MAC
  87.     return gMacAppResFileID;
  88. #elif defined FW_BUILD_WIN16
  89.     int i;
  90.     return HIWORD(&i) - 1;
  91. #elif defined FW_BUILD_WIN32
  92.     return ::GetModuleHandle(NULL);
  93. #endif
  94. }
  95. */
  96.  
  97. //----------------------------------------------------------------------------------------
  98. // FW_CResourceFile::FW_CResourceFile 
  99. //----------------------------------------------------------------------------------------
  100.  
  101. FW_CResourceFile::FW_CResourceFile() :
  102.     fRep()
  103. {
  104.     FW_END_CONSTRUCTOR
  105. }
  106.  
  107. //----------------------------------------------------------------------------------------
  108. // FW_CResourceFile::FW_CResourceFile 
  109. //----------------------------------------------------------------------------------------
  110.  
  111. FW_CResourceFile::FW_CResourceFile(const FW_CFileSpecification& newFileSpec) :
  112.     fRep(new FW_CPrivResourceFileRep(newFileSpec))
  113. {
  114.     FW_END_CONSTRUCTOR
  115. }
  116.  
  117. //----------------------------------------------------------------------------------------
  118. // FW_CResourceFile::FW_CResourceFile 
  119. //----------------------------------------------------------------------------------------
  120.  
  121. FW_CResourceFile::FW_CResourceFile(const FW_CResourceFile& other) :
  122.     fRep(other.fRep)
  123. {
  124.     FW_END_CONSTRUCTOR
  125. }
  126.  
  127. //----------------------------------------------------------------------------------------
  128. // FW_CResourceFile::FW_CResourceFile 
  129. //----------------------------------------------------------------------------------------
  130.  
  131. FW_CResourceFile::FW_CResourceFile(FW_ResourceFileID resFileID) :
  132.     fRep(new FW_CPrivResourceFileRep(resFileID))
  133. {
  134.     FW_END_CONSTRUCTOR
  135. }
  136.  
  137. //----------------------------------------------------------------------------------------
  138. // FW_CResourceFile::FW_CResourceFile 
  139. //----------------------------------------------------------------------------------------
  140.  
  141. FW_CResourceFile::FW_CResourceFile(FW_CPrivResourceFileRep *rep) :
  142.     fRep(rep)
  143. {
  144.     FW_END_CONSTRUCTOR
  145. }
  146.  
  147. //----------------------------------------------------------------------------------------
  148. // FW_CResourceFile::~FW_CResourceFile 
  149. //----------------------------------------------------------------------------------------
  150.  
  151. FW_CResourceFile::~FW_CResourceFile()
  152. {
  153.     FW_START_DESTRUCTOR
  154. }
  155.  
  156.  
  157. #if defined FW_BUILD_MAC
  158.  
  159. //----------------------------------------------------------------------------------------
  160. // FW_CMacResLoadFalse::FW_CMacResLoadFalse 
  161. //----------------------------------------------------------------------------------------
  162.  
  163. FW_CMacResLoadFalse::FW_CMacResLoadFalse()
  164. {
  165.     ::SetResLoad(false);
  166.     FW_END_CONSTRUCTOR
  167. }
  168.  
  169. //----------------------------------------------------------------------------------------
  170. // FW_CMacResLoadFalse::~FW_CMacResLoadFalse 
  171. //----------------------------------------------------------------------------------------
  172.  
  173. FW_CMacResLoadFalse::~FW_CMacResLoadFalse()
  174. {
  175.     FW_START_DESTRUCTOR
  176.     ::SetResLoad(true);
  177. }
  178. #endif
  179.