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 / FWCFMRes.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.7 KB  |  100 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWCFMRes.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWCFMRES_H
  11. #define FWCFMRES_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef FWRESFIL_H
  18. #include "FWResFil.h"
  19. #endif
  20.  
  21. #ifndef FWEXCLIB_H
  22. #include "FWExcLib.h"
  23. #endif
  24.  
  25. #if defined(FW_BUILD_MAC) && !defined(__CODEFRAGMENTS__)
  26. #include <CodeFragments.h>
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Global Variable
  31. //========================================================================================
  32. //    FW_gInstance is initialize in PrivInitLibraryResources on the Mac and in DLLMain
  33. //    on Windows 32
  34.  
  35. extern FW_Instance         FW_gInstance;
  36.  
  37. //========================================================================================
  38. //    Global functions
  39. //========================================================================================
  40.  
  41. #ifdef FW_BUILD_WIN
  42. extern "C" BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved);
  43. #endif
  44.  
  45. //========================================================================================
  46. //    class FW_CAcquireCFMResourceAccess
  47. //========================================================================================
  48.  
  49. class FW_CAcquireCFMResourceAccess
  50. {
  51. public:
  52.     FW_CAcquireCFMResourceAccess(Environment* ev);
  53.     FW_CAcquireCFMResourceAccess(Environment* ev, FW_Instance instance);
  54.     ~FW_CAcquireCFMResourceAccess();
  55.  
  56. #ifdef FW_BUILD_MAC
  57.  
  58.     FW_DECLARE_AUTO(FW_CAcquireCFMResourceAccess)
  59.  
  60.     short        GetLibraryRefNum() const
  61.                     {return fInstance->fRefNum;}
  62.  
  63.     static OSErr PrivInitLibraryResources(CFragInitBlockPtr init);
  64.     static void PrivCloseLibraryResources();
  65.  
  66. private:
  67.     void        CommonInit(Environment* ev);
  68.                     
  69. private:
  70.     FW_Instance    fInstance;
  71.     long        fSavedLibraryRefNum;
  72. #endif
  73. };
  74.  
  75. //========================================================================================
  76. //    class FW_PSharedLibraryResourceFile
  77. //========================================================================================
  78.  
  79. class FW_PSharedLibraryResourceFile : public FW_PResourceFile
  80. {
  81. public:
  82.     FW_DECLARE_AUTO(FW_PSharedLibraryResourceFile)
  83.  
  84.     FW_PSharedLibraryResourceFile(Environment* ev);
  85.     FW_PSharedLibraryResourceFile(Environment* ev, FW_Instance instance);
  86.     
  87.     virtual ~FW_PSharedLibraryResourceFile();
  88.  
  89. private:
  90.     void    CommonInit(Environment* ev, FW_Instance instance);
  91.  
  92. private:
  93. #ifdef FW_BUILD_MAC
  94.     FW_CAcquireCFMResourceAccess    fAcquireCFMResourceAccess;
  95. #endif
  96.     FW_PSharedLibraryResourceFile(const FW_PSharedLibraryResourceFile& other);
  97. };
  98.  
  99. #endif
  100.