home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / ibase.hp_ / IBASE.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  5.7 KB  |  162 lines

  1. #ifndef _IBASE_
  2. #define _IBASE_
  3. /*******************************************************************************
  4. * FILE NAME: ibase.hpp                                                         *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IBase - Empty "base" class to reduce global name space pollution         *
  9. *                                                                              *
  10. *   In addition, this file contains definitions for various typedefs and       *
  11. *   macros previously defined in <ibasetype.hpp>.  Over time, these            *
  12. *   definitions will probably migrate to more localized homes (e.g.,           *
  13. *   <iwindow.hpp>).                                                            *
  14. *                                                                              *
  15. * COPYRIGHT:                                                                   *
  16. *   Licensed Materials - Property of IBM                                       *
  17. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  18. *   All Rights Reserved                                                        *
  19. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  20. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  21. *                                                                              *
  22. *$Log:   R:/IBMCLASS/IBASE/VCS/IBASE.HPV  $                                                                         *
  23. //
  24. //   Rev 1.2   25 Oct 1992 16:46:12   nunn
  25. //changed library name to ICLUI
  26.    
  27.       Rev 1.1   12 Oct 1992 12:53:28   law
  28.    Changed per new IBase.
  29.    
  30.       Rev 1.0   07 Oct 1992 10:10:04   law
  31.    Initial revision.
  32. *******************************************************************************/
  33.  
  34. class ostream;
  35.  
  36. class IString;
  37.  
  38. class IBase {
  39. /*******************************************************************************
  40. * This class is used to encapsulate the set of names that would otherwise be   *
  41. * in global scope.  All other classes in the ICLUI library inherit from     *
  42. * this class.  Thus, within such classes, the types and enumeration values     *
  43. * defined herein can be utilized directly (i.e., without the qualifying        *
  44. * "IBase::" prefix).                                                           *
  45. *                                                                              *
  46. * Other code, particularly client code, must use either the qualified names,   *
  47. * or, exploit the simplified "synonyms" declared in <isynonym.hpp>.            *
  48. *******************************************************************************/
  49. public:
  50. /*--------------------------------- BOOLEAN ------------------------------------
  51. | The typedef Boolan is defined here, along with constant values for "true"    |
  52. | and "false."                                                                 |
  53. ------------------------------------------------------------------------------*/
  54. typedef int
  55.   Boolean;
  56.  
  57. enum {
  58.   false = 0,
  59.   true  = 1
  60. };
  61.  
  62. /*------------------------------- DIAGNOSTICS ----------------------------------
  63. | A left-shift (<<) operator is defined permitting any library object to be    |
  64. | dumped to an ostream (e.g.,  cout << anObject;).  Note that IBase can't      |
  65. | say anything useful about the object so this function should be overridden   |
  66. | in all subclasses.                                                           |
  67. |                                                                              |
  68. | Likewise, the functions asString and asDebugInfo are provided to permit      |
  69. | obtaining standard and diagnostic versions of object contents.               |
  70. ------------------------------------------------------------------------------*/
  71. friend ostream
  72.  &operator << ( ostream     &aStream,
  73.                 const IBase &anObject );
  74.  
  75. IString
  76.   asString    ( ) const,
  77.   asDebugInfo ( ) const;
  78.  
  79. }; // IBase
  80.  
  81. #ifdef __BORLANDC__
  82.   #define _System  _syscall
  83.   #define _Optlink _fastcall
  84. #endif
  85.  
  86. #ifdef __ZTC__
  87.   #define _System  pascal far
  88.   #define _Optlink 
  89. #endif
  90.  
  91. #ifdef __xlC__
  92.   #define _System  
  93.   #define _Optlink 
  94. #endif
  95.  
  96. #ifndef IC_OS2LEVEL
  97.   #ifdef __ZTC__
  98.     #define IC_OS2LEVEL 130
  99.   #else
  100.     #define IC_OS2LEVEL 200
  101.   #endif
  102. #endif
  103. #ifndef OS2LEVEL
  104.   #define OS2LEVEL IC_OS2LEVEL
  105. #endif
  106.  
  107. extern "C" {
  108.  
  109. typedef int _System
  110.   ICallback ( );
  111.  
  112. typedef void * _System
  113. #if ( IC_OS2LEVEL >= 200 )
  114.   IWinProc ( unsigned long, unsigned long, void *, void * );
  115. #else
  116.   IWinProc ( void *, unsigned short, void *, void * );
  117. #endif
  118.  
  119. // Compatibility:
  120. typedef ICallback
  121.   ICALLBACK;
  122. typedef IWinProc
  123.   IWINCALLBACK;
  124. }
  125.  
  126. #ifdef IC_DEVELOP
  127.   #define IC_TRACE_DEVELOP
  128. #endif
  129.  
  130. #ifdef IC_RUNTIME
  131.   #define IC_TRACE_RUNTIME
  132. #endif
  133.  
  134. #ifdef IC_TRACE_ALL
  135.   #define IC_TRACE_DEVELOP
  136.   #define IC_TRACE_RUNTIME
  137. #endif
  138.  
  139. #ifdef IC_TRACE_DEVELOP
  140.   #define IC_TRACE_RUNTIME
  141. #endif
  142.  
  143. #define IC_UM_BASE            ( 0xFFE0 )
  144. #define IC_UM_WINDOWSETUP     ( IC_UM_BASE + 0 )
  145. #define IC_UM_INITWIN         ( IC_UM_BASE + 1 )
  146. #define IC_UM_CLOSEWINDOW     ( IC_UM_BASE + 2 )
  147. #define IC_UM_DDE_CLOSED      ( IC_UM_BASE + 3 )
  148. #define IC_UM_DRAGDROP_RENDER ( IC_UM_BASE + 4 )
  149.  
  150. // compatibility
  151. #define UM_WINDOWSETUP     IC_UM_WINDOWSETUP    
  152. #define UM_INITWIN         IC_UM_INITWIN        
  153. #define UM_CLOSEWINDOW     IC_UM_CLOSEWINDOW    
  154. #define UM_DDE_CLOSED      IC_UM_DDE_CLOSED     
  155. #define UM_DRAGDROP_RENDER IC_UM_DRAGDROP_RENDER
  156.  
  157. #ifndef _ISYNONYM_
  158.   #include <isynonym.hpp>
  159. #endif
  160.  
  161. #endif /* _IBASE_ */
  162.