home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osp1.exe / src / grafpart / iodgcomm.cpp < prev    next >
C/C++ Source or Header  |  1997-04-02  |  5KB  |  160 lines

  1. // @(#) 1.3 com/src/samples/grafpart/iodgcomm.cpp, odgrafpart, od96os2, odos29712d 11/7/96 17:00:53 [3/21/97 17:47:54]
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odgrafpart
  6.  *
  7.  *   CLASSES: none
  8.  *
  9.  *   ORIGINS: 27
  10.  *
  11.  *
  12.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13.  *   All Rights Reserved
  14.  *   Licensed Materials - Property of IBM
  15.  *   US Government Users Restricted Rights - Use, duplication or
  16.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17.  *
  18.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24.  *   OR PERFORMANCE OF THIS SOFTWARE.
  25.  */
  26. /*====END_GENERATED_PROLOG========================================
  27.  */
  28.  
  29. // *********************************************************************
  30. //  File:      iodgcomm.cpp
  31. //  Contains:  Common implementation details for a 2D-Drawing Container Part
  32. // ************************************************************************
  33.  
  34. #ifndef _IODGCOMM_CPP_
  35. #define _IODGCOMM_CPP_
  36.  
  37. #ifdef __IBMC__
  38.     #pragma linkage (SOMInitModule, system)
  39. #endif
  40.  
  41. // includes for OD-specific function
  42. #if defined(_PLATFORM_WIN32_) || \
  43.     defined(_PLATFORM_OS2_)
  44. //  #include <Arbitrat.xh>
  45. //  #include <Draft.xh>
  46. //  #include <Info.xh>
  47.     #include <Facet.xh>
  48. //  #include <FacetItr.xh>
  49. //  #include <Foci.xh>
  50.     #include <FocusSet.xh>
  51. //  #include <FocusItr.xh>
  52.     #include <Frame.xh>
  53.     #include <FrFaItr.xh>
  54.     #include <MenuBar.xh>
  55. //  #include <ODSessn.xh>
  56. //  #include <Popup.xh>
  57.     #include <Shape.xh>
  58.     #include <StdTypes.xh>
  59.     #include <StdProps.xh>
  60.     #include <StorageU.xh>
  61.     #include <Trnsform.xh>
  62.     #include <Window.xh>
  63. //  #include <winStat.xh>
  64.     typedef long RGBColor;
  65. #endif // _PLATFORM_WIN32_ || _PLATFORM_OS2_
  66.  
  67. // support exception handling (DrawContents)
  68. #ifndef _ODEXCEPT_
  69.     #include "ODExcept.h"
  70. #endif
  71.  
  72. // support defines like ODBoolean, kODNULL, etc
  73. #ifndef _ODTYPES_
  74.     #include <ODTypes.h>
  75. #endif  // _ODTYPES_
  76.  
  77. // support debugging
  78. #ifdef ODDebug
  79.     #include <ODDebug.h>
  80. #endif // ODDebug
  81.  
  82. // define debugging message vehicle
  83. #ifdef GPDebug
  84.     #define SQUAWK PRINT
  85. #else
  86.     #define SQUAWK //_SQUAWK
  87. #endif // GPDebug
  88.  
  89. // support math conversion macros for use of ODPoints
  90. #ifndef _ODMATH_
  91.     #include <ODMath.h>
  92.     // define inverse of ODIntToFixed(), since ODMath.h doesn't
  93.     #define ODFixedToInt(a) ((LONG)(a) >> 16)
  94. #endif   // _ODMATH_
  95.  
  96.  
  97. // system-dependant support for NLS
  98. #include <locale.h>
  99. #include <wchar.h>
  100. #include <odnltyps.h>
  101. // Use the NLS catalogs if using the VisualAge compiler or AIX's xlC
  102. #if defined(__IBMCPP__) || defined(_IBMR2)
  103.     #define _NLS_
  104. #else
  105.     #undef  _NLS_
  106. // if this platform/compiler does not support NLS, create dummy definitions for NLS function
  107.     #ifndef NL_CAT_LOCALE
  108.         #define NL_CAT_LOCALE 1
  109.         typedef int nl_catd;
  110.         int     catopen(char *, int) { return 0; }
  111.         char*   catgets(int a, int b, int c, char *defaultMsg) { return defaultMsg; }
  112.         void    catclose(int) { }
  113.     #endif  // NL_CAT_LOCALE
  114. #endif  // VAC++, xLC ?
  115.  
  116. // subclass from BaseContainer
  117. #ifndef BaseContainer_Header
  118.     #include <BCMain.h>
  119. #endif  // BaseContainer_Header
  120.  
  121. // make a nickname for kODCommands
  122. #ifndef CMD
  123.     #define CMD(X)    kODCommand##X
  124. #endif // CMD()
  125.  
  126. // Use resources
  127. #ifndef _ODRESRC_
  128.     #include <ODResrc.h>
  129. #endif  // _ODRESRC_
  130.  
  131. // define a platform independant menubar separator attribute
  132. #if defined(_PLATFORM_WIN32_)
  133.     #define MB_SEPARATOR    MF_SEPARATOR
  134. #elif defined(_PLATFORM_OS2_)
  135.     #define MB_SEPARATOR    CA_TITLESEPARATOR
  136. #endif
  137.  
  138. // =========================================================================
  139. //
  140. //  Global helper Functions: GrafPart
  141. //
  142. //  ->  Prototypes only, definitions appear once in iodgraph.cpp
  143. // =========================================================================
  144. ODFacet*    FirstFacet( Environment*    ev,
  145.                         ODFrame*        frame);
  146.  
  147. ODRect*     FluffRect(  ODRect*         rect);
  148.  
  149. void        GetPoint(   Environment*    ev,
  150.                         ODFacet*        facet,
  151.                         ODEventData*    event,
  152.                         ODPoint*        point);
  153.  
  154.  
  155. #endif  // _IODGCOMM_CPP_
  156.  
  157. // =========================================================================
  158. // End of file: iodgcomm.cpp
  159. // =========================================================================
  160.