home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / ODTYPESF.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  13KB  |  378 lines

  1. /* @(#)Z 1.41 com/src/include/c/ODTypesF.h, odcore, od96os2, odos29646d 96/11/15 15:29:04 (96/10/29 09:27:33) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odcore
  6.  *
  7.  *   CLASSES: none
  8.  *
  9.  *   ORIGINS: 82,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:           ODTypesF.h
  31.  
  32.         Contains:       Definitions for Foreign types which can't be described in IDL
  33.  
  34.         Owned by:       Richard Rodseth
  35.  
  36.         Copyright:      ⌐ 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  37.  
  38.         Change History (most recent first):
  39.  
  40.           Defect  Date   Body  Reason
  41.           ------ ------- ----  -------------------------------------------------------
  42.            23372 6/20/96  BRR  Move def of ACCEL struct to only be included for AIX
  43.            23278 6/18/96  BRR  Add _PLATFORM_AIX_ to all ACCEL definitions
  44.            23129 6/13/96  BRR  Add _PLATFORM_AIX_ definition for HWND
  45.            22750 6/10/96  BRR  Add _PLATFORM_AIX_ flags
  46.            21029 4/11/96  LAW  Add _PLATFORM_OS2_ and _PLATFORM_AIX_ flags
  47.            20821 4/05/96  LAW  Fixed typedef of OSType and associated typedefs
  48.            20780 3/28/96  BRR  Added definition for ODPlatformAccelTable
  49.            20444 3/16/96  BRR  Added definition for ODACCELTABLE
  50.            20259 3/08/96  BRR  Added MenuBar stuff in that was added to ODTypesM.idl
  51.  
  52.                  <4>      9/8/95        VL              1275241, 1283463: Added
  53.                                                                         ODPlatformDragReference.
  54.                  <3>     5/25/95        jpa             Don't include GX header(s) [1253324]
  55.                  <2>     3/22/95        jpa             Added ODPlatformPrintJob. [1230236]
  56.                  <1>     1/25/95        jpa             first checked in
  57.                                                                  ---Moved to ODSOM:Interfaces:Handmade:
  58.                 <12>     1/22/95        NP              Add ODHandle.
  59.                 <11>    11/30/94        RR              #1188078 Removed unused and inappropriate
  60.                                                                                                                                                 types
  61.                 <10>     9/23/94        RR              Removed forward declaration of ODPart
  62.                  <9>     8/18/94        Té              #1181622 Set Richard to the Owned by:
  63.                                                                         field
  64.                  <8>     7/26/94        eeh             remove typedef of ODQDPoint
  65.                  <7>     7/19/94        jpa             Include QDFixM.h.
  66.                  <6>     6/20/94        Té              Added ODQDGlobalRec
  67.                  <5>     6/15/94        jpa             Added ODQDPoint definition.
  68.                  <4>     6/13/94        NP              Added comment after endif
  69.                  <3>      6/7/94        CG              Commented out def for GetIndString.
  70.                  <2>     5/23/94        RR              Added ODPlatformType
  71.                  <2>      4/4/94        RR              XMP -> OD
  72.  
  73.         In Progress:
  74.  
  75. */
  76.  
  77. #ifndef _ODTYPESF_
  78. #define _ODTYPESF_
  79.  
  80. /*
  81.         This is a hand-made file, containing Macintosh "foreign" types, which cannot be defined in IDL.
  82.         Actually, all of them are 4-byte types which are defined in ODTypesM.idl as "unsigned long"
  83.         rather than as foreign, and are not emitted. This means that they can be marshalled, and
  84.         can be used without typecasting, since the actual definition is obtained from this file.
  85.  
  86.         This file is included in ODObject.h by way of  a "passThru" statement in ODObject.idl
  87. */
  88.  
  89. #ifdef _PLATFORM_MACINTOSH_  // we don't want to include these for _PLATFORM_WIN32_
  90. #ifndef __TYPES__
  91. #include <Types.h>
  92. #endif
  93.  
  94. #ifndef __FILES__
  95. #include <Files.h>
  96. #endif
  97.  
  98. #ifndef _QDFIXM_
  99. #include <QDFixM.h>
  100. /*
  101.         This header fixes problems with the incorrect use of the 'frame'
  102.         constant defined in QuickDraw.h ... see comments in QDFixM.h for details.
  103. */
  104. #endif
  105.  
  106. #ifndef __QUICKDRAW__
  107. #include <QuickDraw.h>
  108. #endif
  109.  
  110. #ifndef __WINDOWS__
  111. #include <Windows.h>
  112. #endif
  113.  
  114. #ifndef __MENUS__
  115. #include <Menus.h>
  116. #endif
  117.  
  118. #ifndef __AEREGISTRY__
  119. #include <AERegistry.h>
  120. #endif
  121.  
  122. #ifndef __APPLEEVENTS_
  123. #include <AppleEvents.h>
  124. #endif
  125.  
  126. #ifndef __EVENTS__
  127. #include <Events.h>
  128. #endif
  129.  
  130. #ifndef __FIXMATH__
  131. #include <FixMath.h>                    // Must include before GX headers...
  132. #endif
  133.  
  134. #ifndef __DRAG__
  135. #include <Drag.h>
  136. #endif
  137.  
  138. //#ifndef __GXTYPES__
  139. //#include <GXTypes.h>                  /* for gxShape type */
  140. //#endif
  141. #endif // _PLATFORM_MACINTOSH_
  142.  
  143. #ifdef _PLATFORM_WIN32_
  144. #include <WTYPES.h>
  145. #endif
  146. #ifdef _PLATFORM_OS2_
  147. #include <ODos2.h>
  148. #endif
  149. #ifdef _PLATFORM_UNIX_
  150. #include <X11/Intrinsic.h>
  151.                 // Intrinsic.h already has a definition for Boolean
  152. #define _BooleanType
  153. #include <Xm/XmAll.h>
  154. #endif
  155.  
  156. /* Definitions of 4-byte types defined in ODTypesM.idl, but not emitted */
  157.  
  158. #ifdef _PLATFORM_MACINTOSH_
  159. typedef GrafPtr ODPlatformCanvas;    // But it's a gxViewPort for QuickDraw GX
  160. #endif
  161.  
  162.  
  163. typedef void*                   ODPlatformPrintJob;
  164. #if defined(_PLATFORM_WIN32_) || defined (_PLATFORM_OS2_)
  165. typedef HRGN                    ODPlatformShape;        // Graphics-system-dependent shape data
  166. #elif _PLATFORM_UNIX_
  167. typedef Region                  ODPlatformShape;
  168. #else
  169. typedef void*                   ODPlatformShape;        // Graphics-system-dependent shape data
  170. #endif
  171. typedef void*                   ODPlatformTransform;    // Graphics-system-dependent transform data
  172.  
  173.  
  174. #ifdef _PLATFORM_MACINTOSH_
  175. typedef RgnHandle               ODRgnHandle;
  176. #endif
  177. #if defined(_PLATFORM_WIN32_) || defined (_PLATFORM_OS2_)
  178. typedef HRGN            ODRgnHandle;
  179. #endif
  180. #if defined(_PLATFORM_UNIX_)
  181. typedef Region  ODRgnHandle;
  182. #endif
  183.  
  184.  
  185. #ifdef _PLATFORM_MACINTOSH_
  186. typedef struct gxPrivateShapeRecord *ODgxShape; // Makes it synonymous with gxShape type
  187. #endif
  188. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  189. typedef void* ODgxShape;        // Makes it synonymous with gxShape type
  190. #endif
  191.  
  192. #ifdef _PLATFORM_UNIX_
  193. typedef Window          WindowPtr;
  194. typedef Window          ODPlatformWindow;
  195. typedef Window          HWND; // This is temporary for build purposes - BOGUS
  196. typedef unsigned long   HACCEL; // Lance, check into this -- BOGUS ALERT
  197.  
  198. struct ACCEL{
  199.    unsigned short fs;
  200.    unsigned short key;
  201.    unsigned short cmd;
  202. };
  203.  
  204. #endif
  205.  
  206.  
  207. #ifdef _PLATFORM_MACINTOSH_
  208. typedef WindowPtr       ODPlatformWindow;
  209. #endif
  210. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_)
  211. typedef HWND            WindowPtr;
  212. typedef HWND            ODPlatformWindow;
  213. #endif
  214.  
  215.  
  216. #ifdef _PLATFORM_MACINTOSH_
  217. typedef MenuHandle              ODPlatformMenu;
  218. typedef Handle                  ODPlatformMenuBar;
  219. #endif
  220.  
  221.  
  222. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_)
  223. typedef void   *ODMenuTemplate;
  224. typedef HWND    ODPlatformMenuBar;
  225. #endif // PLATFORM_WIN32 || PLATFORM_OS2
  226.  
  227. #ifdef _PLATFORM_UNIX_
  228. typedef void *ODPlatformMenuBar;
  229. #endif // PLATFORM_UNIX
  230.  
  231. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  232. typedef HWND    ODPlatformMenu;
  233. typedef HACCEL  ODPlatformAccelTable;
  234. #ifndef INCL_ODDTS
  235.    #include "CmdDefs.xh"
  236. #else
  237.    #include "CmdDefs.hh"
  238. #endif
  239.  
  240. #define ACCELMAX 20
  241. typedef struct _ODACCEL{
  242.    ACCEL aAccel[ACCELMAX];
  243. } ODACCEL;
  244.  
  245. typedef struct _ODACCELTABLE{
  246.    unsigned short cAccel;
  247.    unsigned short codepage;
  248.    ACCEL    aaccel[1];
  249. } ODACCELTABLE;
  250. #endif // PLATFORM_OS2 || PLATFORM_WIN32 || PLATFORM_UNIX
  251.  
  252. #if defined(_PLATFORM_WIN32_)||defined(_PLATFORM_OS2_)||defined(_PLATFORM_UNIX_)
  253. typedef unsigned long OSType; // needed for ODOSType below, LAW 4/05/96
  254. #endif // PLATFORM_OS2 || PLATFORM_WIN32 || PLATFORM_UNIX_
  255.  
  256. typedef OSType                  ODOSType;
  257. typedef ODOSType        ODPlatformType;    // Host platform file & data type
  258.  
  259.  
  260. #ifdef _PLATFORM_MACINTOSH_
  261. typedef Handle                  ODHandle;
  262. #endif
  263. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  264. typedef void **ODHandle;
  265. #endif
  266.  
  267.  
  268. #ifdef _PLATFORM_MACINTOSH_
  269. typedef DragReference   ODPlatformDragReference;
  270. #endif
  271. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  272. typedef void*   ODPlatformDragReference;
  273. #endif
  274.  
  275.  
  276. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  277. typedef unsigned int OSErr;
  278. typedef char* AEDescList;
  279.  
  280. typedef unsigned char   Str255[256],
  281.                         *StringPtr;
  282.  
  283. #ifdef _PLATFORM_WIN32_
  284. typedef POINT Point;
  285.  
  286. typedef RECT Rect;
  287. #endif
  288. #ifdef _PLATFORM_OS2_
  289. typedef POINTL Point;
  290.  
  291. typedef RECTL Rect;
  292. #endif
  293. #ifdef _PLATFORM_UNIX_
  294. typedef XPoint Point;
  295.  
  296. typedef XRectangle Rect;
  297. #endif
  298.  
  299. struct ProcessSerialNumber {
  300.         unsigned long   highLongOfPSN;
  301.         unsigned long   lowLongOfPSN;
  302. };
  303. typedef struct ProcessSerialNumber ProcessSerialNumber;
  304.  
  305. #define noErr   0
  306. typedef int*    AliasHandle;
  307. typedef char*   corbastring;
  308. #define fixed1          (0x00010000L)
  309. #define FixedToInt(a) ((short)(((long)(a) + fixed1/2) >> 16))
  310. #define IntToFixed(a) ((long)(a) << 16)
  311. #define ff(a)           IntToFixed(a)
  312.  
  313. // Registration return and error codes
  314. const long RM_NO_ERROR                       = 0x0000;
  315. const long PR_NO_ERROR                       = 0x0000;
  316. const long CM_NO_ERROR                       = 0x0000;
  317. const long RMANAGER_RM_BASE                  = 0x0000;
  318. const long PARTREGISTRY_PR_BASE              = 0x0000+RMANAGER_RM_BASE;
  319. const long errPR_INVALID_CLASSNAME              = 0x0001+PARTREGISTRY_PR_BASE;
  320. const long errPR_COULD_NOT_LOAD_CLASS           = 0x0002+PARTREGISTRY_PR_BASE;
  321. const long errPR_NOT_PART_HANDLER_CLASS         = 0x0003+PARTREGISTRY_PR_BASE;
  322. const long errPR_PART_HANDLER_INFO_REPLACED     = 0x0004+PARTREGISTRY_PR_BASE;
  323. const long errPR_PART_HANDLER_NOT_FOUND         = 0x0005+PARTREGISTRY_PR_BASE;
  324. const long errPR_PART_KIND_NOT_FOUND            = 0x0006+PARTREGISTRY_PR_BASE;
  325. const long errPR_BUFFER_TOO_SMALL               = 0x0007+PARTREGISTRY_PR_BASE;
  326. // end Registration return and error codes
  327.  
  328. #endif // _PLATFORM_WIN32_ || _PLATFORM_OS2_ || _PLATFORM_UNIX_
  329.  
  330. #ifdef _PLATFORM_OS2_
  331. typedef struct WindowSystemDataTag
  332. {
  333.   HAB                  hab;
  334.   ODPlatformWindow     parentWindow;
  335.   PFNWP                windowProc;
  336.   HMODULE              resInstance;
  337.   ODPlatformMenuBar    menu;
  338.   ODPlatformAccelTable accelTable;
  339.   HMQ                  hmq;
  340. } WindowSystemData;
  341. #endif
  342.  
  343. #ifdef _PLATFORM_WIN32_
  344. typedef struct WindowSystemDataTag
  345. {
  346.   HINSTANCE         instance;
  347.   HINSTANCE         resInstance;
  348.   ODPlatformMenuBar menu;
  349.   HACCEL            accelTable;
  350.   ODPlatformWindow  parentWindow;
  351.   WNDPROC           windowProc;
  352.   /* the following data member is used by the OLE interop code to turn off
  353.    * displaying a window to the screen during certain rendering situations.
  354.    */
  355.   BOOL              showToScreen;
  356. } WindowSystemData;
  357. #endif
  358.  
  359. #ifdef _PLATFORM_UNIX_
  360. typedef struct WindowSystemDataTag
  361. {
  362.   Display               *display;
  363.   Screen                *screen;
  364.   XtAppContext          appContext;
  365.   Widget                appShell;
  366.   ODPlatformAccelTable  accelTable;
  367.   ODPlatformMenuBar     menu;
  368.   ODPlatformWindow      parentWindow;
  369.   void            (*closeCallBack)(Widget widget, XtPointer client_data, 
  370.                                          XtPointer call_data);
  371.   void            (*saveYourselfCallBack)(Widget widget, 
  372.                      XtPointer client_data,
  373.                      XtPointer call_data);
  374. } WindowSystemData;
  375. #endif
  376.  
  377. #endif // _ODTYPESF_
  378.