home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / ABox 1.9.5 / Header Files / ABResource.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-26  |  3.8 KB  |  143 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABResource.h
  15.  
  16. NAME
  17.     ABResource.h, part of the ABox project source code,
  18.     responsible for handling the AboutBox resource (element) class stuff.
  19.  
  20. DESCRIPTION
  21.     This file contains defines for the about box modules.
  22.     
  23. DEVELOPED BY
  24.     George (ty) Tempel                ttempel@monmouth.com
  25.     All code in this file, and its associated header file was
  26.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  27.     "FilterTop" application development, except where noted.
  28.  
  29. CARETAKER - George (ty) Tempel <ttempel@monmouth.com>
  30.      Please consult this person for any changes or suggestions to this file.
  31.  
  32. MODIFICATION HISTORY
  33.  
  34.     dd mmm yy    -    xxx    -    patchxx: description of patch
  35.     9 June 94    -    ty    -    Initial Version Created
  36.     20-july-94    -    ty    -    initial version released
  37.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  38.                             release and the associated Universal Headers from Apple:
  39.                             most methods that returned references now have "Ref" at
  40.                             the end of their methods names to prevent possible collisions
  41.                             with datatypes and classes of the same name (older versions
  42.                             of the compiler didn't have a problem with this).
  43.     25-oct-95    -    ty    -    changes for "const" usage under CW7; simplification of Boolean
  44.                             query methods
  45.  
  46. */
  47.  
  48. /*===========================================================================*/
  49.  
  50. /*========== Exclusion Macros ============*/
  51.  
  52. #pragma    once
  53.  
  54. #ifndef    _ABResource_
  55. #define    _ABResource_
  56.  
  57.  
  58. /*============ Header Files ==============*/
  59.  
  60. #include    "ABLinkedList.h"
  61. #include    "ABObject.h"
  62.  
  63. /*=========== External Linkage ===========*/
  64.  
  65. /*================ Macros ================*/
  66.  
  67. /*============== Constants ===============*/
  68.  
  69. // NOTE: be sure to have trigraphs ON in TC!  trigraphs are always on in C++!
  70. //
  71. //    these define's describe the various resource types that are used
  72. //    for slides in the about box. A slide usually will contain at least
  73. //    one of these resources.
  74. #define    kABbadResourceType        ((ResType)'\?\?\?\?')
  75.  
  76.  
  77. #define    kABResourceResType        'Rsrc'
  78. #define    kABResourceResTypeSize    (sizeof(ResType))
  79.  
  80. #define    kABResourceResID        'Rsid'
  81. #define    kABResourceResIDSize    (sizeof(short))
  82.  
  83. #define    kABResourceHandle        'Rhdl'
  84. #define    kABResourceHandleSize    (sizeof(Handle))
  85.  
  86.  
  87. /*================ Enums =================*/
  88.  
  89. /*=============== Structs ================*/
  90.  
  91. /*=============== Typedefs ===============*/
  92.  
  93. /*=========== Class Definitions ==========*/
  94.  
  95. #define    kABResourceSuperProperty    ABObject
  96. class    ABResource : public ABLink, public ABObject
  97. {
  98.     friend class ABLinkedList;
  99.     
  100.     public:
  101.                         ABResource(void);
  102.         virtual            ~ABResource(void);
  103.  
  104.         virtual    OSErr    GetProperty (ABProperty prop, void *ptr, long *ptrSize);
  105.         virtual    OSErr    SetProperty (ABProperty prop, void *ptr, long ptrSize);
  106.         
  107.         virtual    OSErr    Stop(void);
  108.         virtual    OSErr    InitializeResource(void);
  109.         virtual    Boolean    CheckFile(FSSpecPtr fssptr);
  110.  
  111.                 Boolean HasResourceHandle(void) const { return this->ResourceHandleRef() != NULL; }
  112.                 
  113.     protected:
  114.         
  115.                 ResType            mResType;
  116.                 short            mResID;
  117.                 Handle            mResHandle;
  118.                 
  119.                 OSErr    ReleaseResource(void);
  120.                 
  121.                 ResType&            ResourceTypeRef(void)             { return this->mResType; }
  122.                 ResType const&        ResourceTypeRef(void) const        { return this->mResType; }
  123.  
  124.                 short&                ResID(void)                     { return this->mResID; }
  125.                 short const&        ResID(void) const                { return this->mResID; }
  126.  
  127.                 Handle&                ResourceHandleRef(void)         { return this->mResHandle; }
  128.                 Handle const&        ResourceHandleRef(void) const    { return this->mResHandle; }
  129.                 
  130.     private:
  131. };
  132.  
  133.  
  134.  
  135.  
  136. /*========== Function Prototypes =========*/
  137.  
  138.  
  139.  
  140.  
  141. #endif    // _ABResource_
  142.  
  143.