home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / OWLDEFS.H < prev    next >
Text File  |  1995-08-29  |  5KB  |  151 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   General definitions used by all ObjectWindows programs. Included
  6. //   directly by ObjectWindows source modules.
  7. //----------------------------------------------------------------------------
  8. #if !defined(OWL_OWLDEFS_H)
  9. #define OWL_OWLDEFS_H
  10. #define __OWL_OWLDEFS_H   // Old-style define for VbxGen compatibility
  11.  
  12. //----------------------------------------------------------------------------
  13. // We must use all libraries in DLLs if we are using Owl in a DLL
  14. //
  15. // Define _OWLDLL with -WSE (-WE for 32bit) to use Owl, bids & RTL in dlls.
  16. //
  17. // Be sure _BUILDOWLDLL is defined when building an actual owl dll
  18. //
  19. #if defined(_OWLDLL) || defined(_BUILDOWLDLL)
  20. # if !defined(_OWLDLL)
  21. #   define _OWLDLL
  22. # endif
  23. # if !defined(_BIDSDLL)
  24. #   define _BIDSDLL
  25. # endif
  26. # if !defined(_RTLDLL)
  27. #   define _RTLDLL
  28. # endif
  29. #endif
  30.  
  31. //
  32. // Setup class, function and data modifier macros for Owl.
  33. //
  34. #if defined(_FASTTHIS) && !defined(__FLAT__)
  35. # define _OWLFASTTHIS __fastthis
  36. #else
  37. # define _OWLFASTTHIS
  38. #endif
  39. #if defined(_BUILDOWLDLL)
  40. # define _OWLCLASS     __export  _OWLFASTTHIS
  41. # define _OWLCLASS_RTL __export
  42. # define _OWLDATA      __export
  43. # define _OWLFUNC      __export
  44. #elif defined(_OWLDLL)
  45. # define _OWLCLASS     __import  _OWLFASTTHIS
  46. # define _OWLCLASS_RTL __import
  47. # if defined(__FLAT__)
  48. #   define _OWLDATA __import
  49. #   define _OWLFUNC __import
  50. # else
  51. #   define _OWLDATA __far
  52. #   define _OWLFUNC
  53. # endif
  54. #else
  55. # if defined(_OWLFARVTABLE)
  56. #   define _OWLCLASS __huge _OWLFASTTHIS
  57. # else
  58. #   define _OWLCLASS _OWLFASTTHIS
  59. # endif
  60. # define _OWLCLASS_RTL _EXPCLASS
  61. # define _OWLDATA
  62. # define _OWLFUNC
  63. #endif
  64. #define _OWLFAR
  65.  
  66. //
  67. // Setup class modifier for user classes derived from Owl classes.
  68. //
  69. #if defined(_OWLDLL) && defined(__DLL__) && !defined(__WIN32__)
  70.   // force data segment load on method entry in case called back from Owl
  71. # define _USERCLASS  __export _OWLFASTTHIS
  72. #else
  73. # define _USERCLASS           _OWLFASTTHIS
  74. #endif 
  75.  
  76. //----------------------------------------------------------------------------
  77. // Get RTL, OSL & other owl headers common to all of Owl
  78. //
  79. #if !defined(OSL_DEFS_H)
  80. # include <osl/defs.h>
  81. # include <osl/inlines.h>
  82. #endif
  83. #if !defined(__SYSTYPES_H)
  84. # include <systypes.h>    // int8, int16, etc.
  85. #endif
  86. #if !defined(__CSTRING_H)
  87. # include <cstring.h>     // string class
  88. #endif
  89. #if !defined(__CHECKS_H)
  90. # include <checks.h>      // diag macros (PRECONDITION, CHECK, WARN, TRACE)
  91. #endif
  92. #if !defined(OWL_EXCEPT_H)
  93. # include <owl/except.h>  // Owl exception classes
  94. #endif
  95.  
  96. //----------------------------------------------------------------------------
  97. // Define macro for user code to force inclusion of stream
  98. // registration objects when statically linking to OWL.
  99. // Assumes that objstrm.h has been #included at the point
  100. // where it is used.
  101. //
  102. #if defined(_OWLDLL)
  103. # define _OWLLINK(s)
  104. #else
  105. # define _OWLLINK(s) __link(s)
  106. #endif
  107.  
  108. //----------------------------------------------------------------------------
  109. // Additional windows.h related defines & undefs for owl compatibility
  110. //
  111. #if defined(BI_PLAT_WIN32)
  112. # undef GetNextWindow
  113. # undef GetWindowTask
  114. # undef MessageBox
  115.   inline WINAPI MessageBox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, uint uType)
  116. # if defined(UNICODE)
  117.     {return MessageBoxExW(hWnd, lpText, lpCaption, uType, 0);}
  118. # else
  119.     {return MessageBoxExA(hWnd, lpText, lpCaption, uType, 0);}
  120. # endif
  121. # define HUGE
  122. # define WM_SYSTEMERROR      0x0017
  123. # define WM_CTLCOLOR         0x0019
  124. # define HTASK HANDLE    // allow users to use the same type in Win16 & Win32
  125. #else
  126. # define HUGE                __huge
  127. # define WM_HOTKEY           0x0312
  128. # define WM_PAINTICON        0x0026
  129. #endif
  130. #undef  SetWindowFont
  131. #undef  GetWindowFont
  132.  
  133. //----------------------------------------------------------------------------
  134. // Owl diagnostics extensions
  135. //
  136. uint8 _OWLFUNC GetDiagEnabled(char* file, char* name, uint8 e);
  137. uint8 _OWLFUNC GetDiagLevel(char* file, char* name, uint8 l);
  138.  
  139. #define OWL_INI "OWL.INI"
  140.  
  141. #define DIAG_DEFINE_GROUP_INIT(f,g,e,l)\
  142.   DIAG_DEFINE_GROUP(g, GetDiagEnabled(f,#g,e), GetDiagLevel(f,#g,l));
  143.  
  144. //----------------------------------------------------------------------------
  145. // Common external Owl functions & data
  146. //
  147. uint16 far _OWLFUNC OWLGetVersion(); // Get running version
  148. const uint16 OWLVersion = 0x0250;    // Version building with: XX.XX
  149.  
  150. #endif  // OWL_OWLDEFS_H
  151.