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 / Include / FWCFMRes.h next >
Encoding:
Text File  |  1995-11-08  |  2.8 KB  |  108 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:        FWCFMRes.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    1995 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 FWAUTODE_H
  22. #include "FWAutoDe.h"
  23. #endif
  24.  
  25. #if defined(FW_BUILD_MAC) && !defined(__CODEFRAGMENTS__)
  26. #include <CodeFragments.h>
  27. #endif
  28.  
  29. #if defined(SYMANTEC_CPLUS) && !FW_LIB_EXPORT_PRAGMAS
  30. #pragma internal on
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Global Variable
  35. //========================================================================================
  36. //    FW_gInstance is initialize in InitLibraryResources on the Mac and in DLLMain
  37. //    on Windows 32
  38.  
  39. extern FW_Instance FW_gInstance;
  40.  
  41. //========================================================================================
  42. //    Global functions
  43. //========================================================================================
  44.  
  45. #ifdef FW_BUILD_MAC
  46. OSErr InitLibraryResources(CFragInitBlockPtr init);
  47. #endif
  48.  
  49. #ifdef FW_BUILD_WIN
  50. extern "C" BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved);
  51. #endif
  52.  
  53. //========================================================================================
  54. //    class FW_CAcquireCFMResourceAccess
  55. //========================================================================================
  56.  
  57. class FW_CLASS_ATTR FW_CAcquireCFMResourceAccess FW_AUTO_DESTRUCT_OBJECT
  58. {
  59. public:
  60.     FW_CAcquireCFMResourceAccess();
  61.     FW_CAcquireCFMResourceAccess(FW_Instance instance);
  62.     virtual ~FW_CAcquireCFMResourceAccess();
  63.  
  64. #ifdef FW_BUILD_MAC
  65.  
  66.     short        GetLibraryRefNum() const
  67.                     {return gLibraryRefNum;}
  68.  
  69. private:
  70.     void        CommonInit(FW_Instance instance);
  71.                     
  72. private:
  73.     static short    gLibraryRefCount;
  74.         // # of nested calls to BeginUsingLibRsrcs
  75.     static short    gLibraryRefNum;
  76.         // Library refNum; valid when fLibraryRefCount>0.
  77.  
  78.     long            fSavedLibraryRefNum;
  79. #endif
  80. };
  81.  
  82. //========================================================================================
  83. //    class FW_CSharedLibraryResourceFile
  84. //========================================================================================
  85.  
  86. class FW_CLASS_ATTR FW_CSharedLibraryResourceFile : public FW_CResourceFile
  87. {
  88. public:
  89.     FW_CSharedLibraryResourceFile();
  90.     FW_CSharedLibraryResourceFile(FW_Instance instance);
  91.     
  92.     virtual ~FW_CSharedLibraryResourceFile();
  93.  
  94. private:
  95.     void    CommonInit(FW_Instance instance);
  96.  
  97. private:
  98. #ifdef FW_BUILD_MAC
  99.     FW_CAcquireCFMResourceAccess    fAcquireCFMResourceAccess;
  100. #endif
  101. };
  102.  
  103. #if defined(SYMANTEC_CPLUS) && !FW_LIB_EXPORT_PRAGMAS
  104. #pragma internal off
  105. #endif
  106.  
  107. #endif
  108.