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

  1. //====START_GENERATED_PROLOG======================================
  2. //
  3. //
  4. //   COMPONENT_NAME: odutils
  5. //
  6. //   CLASSES: none
  7. //
  8. //   ORIGINS: 82,27
  9. //
  10. //
  11. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12. //   All Rights Reserved
  13. //   Licensed Materials - Property of IBM
  14. //   US Government Users Restricted Rights - Use, duplication or
  15. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16. //       
  17. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23. //   OR PERFORMANCE OF THIS SOFTWARE.
  24. //
  25. //====END_GENERATED_PROLOG========================================
  26. //
  27. // @(#) 1.24 com/src/utils/include/ODTypesP.h, odutils, od96os2, odos29646d 7/31/96 09:57:48 [ 11/15/96 15:29:36 ]
  28. /********************************************************************/
  29. /*  Licensed Materials - Property of IBM                            */
  30. /*                                                                  */
  31. /*                                                                  */
  32. /* Copyright (C) International Business Machines Corp., 1994.       */
  33. /* Copyright (C) Apple Computer, Inc., 1994                         */
  34. /*                                                                  */
  35. /*  US Government Users Restricted Rights -                         */
  36. /*  Use, duplication, or disclosure restricted                      */
  37. /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  38. /*                                                                  */
  39. /********************************************************************/
  40.  
  41. #ifndef _ODTYPESP_
  42. #define _ODTYPESP_
  43.  
  44. #include <stdlib.h>
  45. #include <string.h>
  46.  
  47. #ifndef _ITEXT_
  48. #include <IText.h>
  49. #endif
  50.  
  51. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  52. #ifndef _ODTYPESF_
  53. #include <ODTypesF.h>
  54. #endif
  55. #ifndef _ODDEBUG_
  56. #include <ODDebug.h>
  57. #endif
  58. #endif // defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  59.  
  60. // ********* Begin Mac header Lists.h **************
  61.    /* The apple drop was missing this file so I'll fake it. */
  62.    typedef struct {} ListHandle;
  63.  
  64.    typedef struct {} DialogXBlahX;
  65.    typedef DialogXBlahX * DialogPtr;
  66. // ********* End Mac header Lists.h **************
  67.  
  68. // ********* Begin Mac header OCEStandardMail.h? **************
  69.   typedef int SMPEditCommand;
  70.   #define gestaltOCEToolboxAttr 2000
  71.   #define gestaltOCETBAvailable 2001
  72.   #define kSMPSelectAllCommand 3000
  73. // ********* End Mac header OCEStandardMail.h? **************
  74.  
  75. //#ifndef __LIBRARYMANAGER__
  76. //  #define __LIBRARYMANAGER__
  77. //  class  TMemoryPool;
  78. //#endif
  79.  
  80. // ********* Begin Mac header Types.h **************
  81.  
  82. #ifdef _PLATFORM_WIN32_
  83.  #ifndef _WTYPES_
  84.  #include <wtypes.h>
  85.  #endif
  86.  #ifndef _WINBASE_
  87.  #include <winbase.h>
  88.  #endif
  89.  #ifndef _WINDEF_
  90.  #include <windef.h>
  91.  #endif
  92. #endif // _PLATFORM_WIN32_
  93. #ifdef _PLATFORM_OS2_
  94.  #include <ODos2.h>
  95. #endif // _PLATFORM_OS2_
  96. #ifdef _PLATFORM_UNIX_
  97.  #include <sys/types.h>
  98.  #include <sys/param.h>
  99.  #include <unistd.h>
  100. #endif // _PLATFORM_UNIX_
  101. #if !defined(_PLATFORM_WIN32_) && !defined(_PLATFORM_OS2_) && !defined(_PLATFORM_UNIX_)
  102.  #define pascal
  103. #endif // !defined(_PLATFORM_WIN32_) && !defined(_PLATFORM_OS2_) && !defined(_PLATFORM_UNIX_)
  104.  
  105. #ifndef SOMCorba_h
  106. #include<somcorba.h>
  107. #endif
  108.  
  109. #ifndef _BooleanType
  110.    #define _BooleanType
  111.    typedef int Boolean;
  112. #endif
  113.  
  114.  // use OpenClass's true and false which are enums set to 1 and 0 respectively.
  115.  // this will NOT conflict with SOM's TRUE and FALSE, which are 
  116.  // defines set to 1 and 0 respectively.
  117.  #include <isynonym.hpp>
  118.  
  119. #ifndef _PLATFORM_AIX_
  120.  // for AIX, Cursor is defined in /usr/include/X11/X.h, which we got by
  121.  // including ODTypesF.h which includes /usr/include/X11/Intrinsic.h
  122.  typedef void* Cursor;
  123. #endif
  124.  
  125.  #define nil 0
  126.  
  127.  typedef unsigned char Byte;
  128.  typedef char SignedByte;
  129.  typedef char *Ptr;
  130.  typedef Ptr *Handle;    /*  pointer to a master pointer */
  131.  
  132.  typedef long Fixed;     /* fixed point arithmatic type */
  133.  typedef Fixed *FixedPtr;
  134.  typedef long Fract;
  135.  typedef Fract *FractPtr;
  136. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  137.  typedef double double_t;
  138. #endif // defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  139.  
  140.  struct extended80 {
  141.   short w[5];
  142.  };
  143.  typedef struct extended80 extended80;
  144.  
  145.  enum {v,h};
  146.  typedef unsigned char VHSelect;
  147.  
  148.  typedef unsigned char Str63[64],Str32[33],Str31[32],Str27[28],Str15[16],**StringHandle;
  149.  
  150.  typedef const unsigned char *ConstStr255Param;
  151.  typedef ConstStr255Param ConstStr63Param,ConstStr32Param,ConstStr31Param,
  152.   ConstStr27Param,ConstStr15Param;
  153.  
  154.  typedef unsigned long OSType;
  155.  typedef OSType *OSTypePtr;
  156.  typedef unsigned long ResType;
  157.  typedef ResType *ResTypePtr;
  158.  typedef unsigned char Style;
  159.  typedef short ScriptCode;
  160.  
  161.  enum {
  162.   normal = 0,
  163.   bold = 1,
  164.   italic = 2,
  165.   underline = 4,
  166.   outline = 8,
  167.   shadow = 0x10,
  168.   condense = 0x20,
  169.   extend = 0x40
  170.  };
  171.  
  172.    #define Debugger
  173.    #define DebugStr
  174.    #define debugstr
  175.    #define SysBreakStr
  176.    #define SysBreakFunc
  177.  
  178. // ********* End Mac header Types.h **************
  179.  
  180. // ********* Begin Mac header Strings.h **************
  181.  
  182.     #define aNumber "001"
  183.  
  184. #ifndef _PLATFORM_AIX_
  185.      // xlC has no itoa function
  186.      inline
  187.      void NumToString(int id, char* pString) { _itoa(id,pString,10);}
  188. #endif
  189.  
  190.     inline
  191.     char * p2cstr( StringPtr pString) { return (char*)pString; }
  192.  
  193.     inline
  194.     StringPtr c2pstr( char *pString) { return (StringPtr)pString; }
  195.  
  196.  
  197. // ********* End Mac header Strings.h **************
  198.  
  199.  
  200. // ********* Begin Mac header AERegistry.h **************
  201.  
  202. #if 0
  203. struct WritingCode {
  204.     ScriptCode  theScriptCode;
  205.     LangCode    theLangCode;
  206. };
  207.  
  208. typedef struct WritingCode WritingCode;
  209.  
  210. struct IntlText {
  211.     ScriptCode  theScriptCode;
  212.     LangCode    theLangCode;
  213.     char        theText[1];
  214.     /* variable length data */
  215. };
  216.  
  217. typedef struct IntlText IntlText;
  218.  
  219. #endif // 0
  220.  
  221. // ********* End Mac header AERegistry.h **************
  222.  
  223. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  224. // ********* Begin Mac header AppleEvents.h **************
  225.  
  226. typedef unsigned long AEKeyword;
  227. typedef ResType DescType;
  228. typedef AEDescList AEDesc;
  229. typedef AEDescList AERecord;
  230. typedef AERecord AppleEvent;
  231.  
  232. // ********* End Mac header AppleEvents.h **************
  233.  
  234. // ********* Begin Mac header Menus.h **************
  235. struct MenuInfo {
  236.     short menuID;
  237.     short menuWidth;
  238.     short menuHeight;
  239.     Handle menuProc;
  240.     long enableFlags;
  241.     Str255 menuData;
  242. };
  243.  
  244. #if defined(_PLATFORM_WIN32_)
  245. typedef HMENU     MenuHandle;
  246. #else // !defined(_PLATFORM_WIN32_)
  247.  
  248. #if defined(_PLATFORM_OS2_)
  249. typedef HWND     MenuHandle;
  250. #else // !defined(_PLATFORM_OS2_)
  251.  
  252. #if defined(_PLATFORM_AIX_)
  253. typedef void*    MenuHandle;
  254. #else // !defined(_PLATFORM_AIX_)
  255. #error ODTypesP.h: MenuHandle needs to be defined for this platform.
  256. #endif // defined(_PLATFORM_AIX_)
  257.  
  258. #endif // defined(_PLATFORM_OS2_)
  259.  
  260. #endif // defined(_PLATFORM_WIN32_)
  261.  
  262. // ********* End Mac header Menus.h **************
  263.  
  264. // ********* Begin Mac header Quickdraw.h **************
  265.  
  266. typedef ODRgnHandle  RgnHandle;
  267.  
  268. // ********* End Mac header Quickdraw.h **************
  269.  
  270. // ********* Begin Mac header Controls.h **************
  271.  
  272. typedef void *ControlHandle;
  273.  
  274. // ********* End Mac header Controls.h **************
  275.  
  276. // ********* Begin Mac header Files.h **************
  277.  
  278. #if defined(_PLATFORM_WIN32_)
  279. typedef unsigned char ODFilePathname[MAX_PATH + 1];
  280. #endif // defined(_PLATFORM_WIN32_)
  281. #if defined(_PLATFORM_OS2_)
  282. typedef unsigned char ODFilePathname[CCHMAXPATH + 1];
  283. #endif // defined(_PLATFORM_OS2_)
  284. #if defined(_PLATFORM_UNIX_)
  285. typedef unsigned char ODFilePathname[MAXPATHLEN + 1];
  286. #endif // defined(_PLATFORM_UNIX_)
  287.  
  288.  
  289. struct FSSpec {
  290.  // short vRefNum;
  291.  // long parID;
  292.  ODFilePathname name;
  293. };
  294.  
  295. typedef FSSpec *FSSpecPtr;
  296.  
  297. // Note:  Keep in sync with PlfmFile.h
  298. #define fsRdPerm      0x0001
  299. #define fsWrPerm      0x0002
  300. #define fsRdWrPerm    0x0003
  301. #define fsRdWrShPerm  0x000F
  302.  
  303. #if defined(_PLATFORM_WIN32_)
  304. #define fsFromStart SEEK_SET
  305. #define fsFromMark  SEEK_CUR
  306. #define fsFromLEOF  SEEK_END
  307. #endif // defined(_PLATFORM_WIN32_)
  308.  
  309. #if defined(_PLATFORM_OS2_)
  310. #define fsFromStart FILE_BEGIN
  311. #define fsFromMark  FILE_CURRENT
  312. #define fsFromLEOF  FILE_END
  313. #endif // defined(_PLATFORM_OS2_)
  314.  
  315. #if defined(_PLATFORM_UNIX_)
  316. #define fsFromStart SEEK_SET 
  317. #define fsFromMark  SEEK_CUR  
  318. #define fsFromLEOF  SEEK_END  
  319. #endif // defined(_PLATFORM_UNIX_)
  320.  
  321. // ********* End Mac header Files.h **************
  322. #endif // defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_UNIX_)
  323.  
  324. #define smRoman  0    // default ??
  325.  
  326.  
  327. // (keyboard) language codes copied from PMWINP.H
  328. #define LG_BE         2       /* Belgium translation table */
  329. #define LG_CF         3       /* Canadian-French translation table */
  330. #define LG_DK         4       /* Denmark translation table */
  331. #define LG_FR         5       /* France translation table */
  332. #define LG_GR         6       /* Germany translation table */
  333. #define LG_IT         7       /* Italy translation table */
  334. #define LG_LA         8       /* Latin-American Spanish translation table */
  335. #define LG_NL         9       /* Netherlands translation table */
  336. #define LG_NO        10       /* Norway translation table */
  337. #define LG_PO        11       /* Portugal translation table */
  338. #define LG_SF        12       /* Swiss-French translation table */
  339. #define LG_SG        13       /* Swiss-German translation table */
  340. #define LG_SP        14       /* Spain translation table */
  341. #define LG_SU        15       /* Finland translation table */
  342. #define LG_SV        16       /* Sweden translation table */
  343. #define LG_UK        17       /* United Kingdom translation table */
  344. #define LG_US        18       /* United States translation table */
  345. #define LG_TR        22       /* Turkish */
  346. #define LG_CS        23       /* Czech */
  347. #define LG_HU        25       /* Hungarian */
  348. #define LG_YU        26       /* Yugoslav */
  349. #define LG_PL        27       /* Polish */
  350. #define LG_IC        28       /* Icelandic */
  351. #define LG_BR        29       /* Brazil */
  352. #define LG_HE        31       /* Hebrew Kbd   - National layer (Bidi) */
  353. #define LG_AR        33       /* Arabic Kbd   - National layer (Bidi) */
  354. #define LG_KATAKANA     0x51
  355. #define LG_KATAR        0x52
  356. #define LG_HIRAGANA     0x53
  357. #define LG_HIRAR        0x54
  358. #define langEnglish  LG_UK
  359.  
  360. // MAP - moved from ODTYPESF.H
  361. inline Ptr NewPtr( unsigned long size)
  362. {
  363.   return new char[size];
  364. }
  365.  
  366. inline void DisposPtr( Ptr ptr)
  367. {
  368.   delete ptr;
  369. }
  370.  
  371. inline void* BlockMove( void* target, void* source, unsigned long size)
  372. {
  373.   return memmove( target, source, size);
  374. }
  375.  
  376. inline unsigned long MemError()
  377. {
  378.   return 0;
  379. }
  380.  
  381. // end of moved stuff from ODTYPESF.H
  382.  
  383.  
  384. #endif
  385.