home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Layout / LayoInit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.2 KB  |  101 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        LayoInit.cp
  3.  
  4.     Contains:    Init routines for the Layout library
  5.  
  6.     Owned by:    Joshua Susser
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <8>     8/29/95    jpa        Rename 'using' variable; it's a reserved
  13.                                     word in CW7.
  14.          <7>     8/11/95    jpa        Added LayoutInit for single-lib build &
  15.                                     renumbered resource [1276412]
  16.          <6>     5/26/95    RR        #1251403: Multithreading naming support
  17.          <5>     1/12/95    jpa        Don't use obsolete Toolbox names [1211211].
  18.                                     Don't export cfm init [1210936].
  19.          <4>    10/24/94    jpa        Fixed use of resources in CFMInit.
  20.                                     [1186124]
  21.          <3>     9/29/94    RA        1189812: Mods for 68K build.
  22.          <2>     8/24/94    JBS        1181909: new active border appearance
  23.          <1>     6/29/94    JBS        first checked in
  24.          <0>     6/27/94    JBS        copied from CoreInit.cpp
  25.  
  26.     To Do:
  27.     In Progress:
  28.         
  29. */
  30.  
  31. #ifndef __CODEFRAGMENTS__
  32. #include <CodeFragments.h>
  33. #endif
  34.  
  35. #ifndef __QUICKDRAW__
  36. #include <Quickdraw.h>
  37. #endif
  38.  
  39. #ifndef __RESOURCES__
  40. #include <Resources.h>
  41. #endif
  42.  
  43. #ifndef __TOOLUTILS__
  44. #include <ToolUtils.h>
  45. #endif
  46.  
  47. #ifndef __USERSRCM__
  48. #include <UseRsrcM.h>
  49. #endif
  50.  
  51. #ifndef _RSRCBASE_
  52. #include <RsrcBase.h>
  53. #endif
  54.  
  55.  
  56. //==============================================================================
  57. // Constants
  58. //==============================================================================
  59.  
  60. const ODSShort kBorderPatternID = kODLayoutRsrcBase + 0;
  61.  
  62. //==============================================================================
  63. // Global variables
  64. //==============================================================================
  65.  
  66. Pattern borderPattern;
  67.  
  68. //==============================================================================
  69. // Functions
  70. //==============================================================================
  71.  
  72. OSErr LayoutInit( );
  73.  
  74. extern "C" pascal OSErr LayoutCFMInit( CFragInitBlockPtr );
  75.  
  76.  
  77. OSErr LayoutInit( )
  78. {
  79.     CUsingLibraryResources u;
  80.     
  81.     PatHandle patRsrc = GetPattern(kBorderPatternID);
  82.     OSErr err = ResError();
  83.     if ( !patRsrc ) return err ?err :resNotFound;
  84.     
  85.     borderPattern = **patRsrc;
  86.     
  87.     ReleaseResource((Handle)patRsrc);
  88.  
  89.     return noErr;
  90. }
  91.  
  92.  
  93. pascal OSErr LayoutCFMInit (CFragInitBlockPtr initBlkPtr)
  94. {
  95.     OSErr err;
  96.     err = InitLibraryResources(initBlkPtr);
  97.     if ( err ) return err;
  98.     return LayoutInit();
  99. }
  100.  
  101.