home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vppmhlp1.zip / os2def.pas next >
Pascal/Delphi Source File  |  1996-11-03  |  12KB  |  440 lines

  1. {█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
  2. {█                                                       █}
  3. {█      Virtual Pascal Runtime Library.  Version 1.1a    █}
  4. {█      OS/2 Common Definitions                          █}
  5. {█      ─────────────────────────────────────────────────█}
  6. {█      Copyright (C) 1995 fPrint UK Ltd                 █}
  7. {█                                                       █}
  8. {▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  9.  
  10. {$AlignRec-}
  11.  
  12. unit Os2Def;
  13.  
  14. interface
  15.  
  16. type
  17.   ApiRet  = Longint;
  18.   ApiRet16 = Word;
  19.   SHandle = Word;
  20.   LHandle = Longint;
  21.   HPointer = LHandle;
  22.   FHLock  = Longint;
  23.   ULong   = Longint;
  24.   Long    = Longint;
  25.   Bool    = LongBool;
  26.   UShort  = Word;
  27.   PULong  = ^ULong;
  28.   PLong   = ^Long;
  29.   PFn     = Pointer;
  30.   PUShort = ^UShort;
  31.   PPChar  = ^PChar;
  32.  
  33. { Quad-word }
  34.   PQWord = ^QWord;
  35.   QWord = record
  36.    Lo: ULong;
  37.    Hi: ULong;
  38.  end;
  39.  
  40. { Macro functions }
  41. { Combine l and h to form a 32 bit quantity }
  42. function MakeULong(l,h : SmallWord) : ULong; inline;
  43. begin
  44.   MakeULong := l OR h shl 16;
  45. end;
  46.  
  47. function MakeLong(l,h : SmallWord) : Long; inline;
  48. begin
  49.   MakeLong := l OR (h shl 16);
  50. end;
  51.  
  52. { Combine l and h to form a 16 bit quantity }
  53. function MakeUShort(l,h: Byte) : UShort; inline;
  54. begin
  55.   MakeUShort := l OR h shl 8;
  56. end;
  57.  
  58. function MakeShort(l,h: Byte) : Integer; inline;
  59. begin
  60.   MakeShort := l OR h shl 8;
  61. end;
  62.  
  63. { Extract high and low order parts of 16 and 32 bit quantities }
  64. function LoByte(w : Word) : Byte; inline;
  65. begin
  66.   LoByte := Byte(w);
  67. end;
  68.  
  69. function HiByte(w : Word) : Byte; inline;
  70. begin
  71.   HiByte := Word(w) shr 8;
  72. end;
  73.  
  74. function LoUChar(w : Word) : Char; inline;
  75. begin
  76.   LoUChar := Chr( w );
  77. end;
  78.  
  79. function HiUChar(w : Word) : Char; inline;
  80. begin
  81.   HiUChar := Chr( w shr 8 );
  82. end;
  83.  
  84. function LoUShort(w : Word) : UShort; inline;
  85. begin
  86.   LoUShort := SmallWord( w );
  87. end;
  88.  
  89. function HiUShort(w : Word) : UShort; inline;
  90. begin
  91.   HiUShort := SmallWord( w shr 16 );
  92. end;
  93.  
  94. const
  95.   hNull   = 0;          { Null handle }
  96.   NullHandle = 0;
  97.  
  98.   ulFalse = 0;
  99.   ulTrue  = 1;
  100.  
  101. { cchMaxPath is the maximum fully qualified path name length including  }
  102. { the drive letter, colon, backslashes and terminating #0 symbol.       }
  103.   cchMaxPath                    = 260;
  104.  
  105. { cchMaxPathComp is the maximum individual path component name length   }
  106. { including a terminating #0 symbol.                                    }
  107.   cchMaxPathComp                = 256;
  108.  
  109. type
  110. {  Common Error definitions }
  111.   PErrorId = ^ErrorId;
  112.   ErrorId = ULong;
  113.  
  114. { Extract error number from an error id }
  115. function ErrorIdError(Var ErrId) : UShort; inline;
  116. begin
  117.   ErrorIdError := SmallWord( ULong((@ErrId)^) );
  118. end;
  119.  
  120. { Extract Severity from an error id }
  121. function ErrorIdSev(Var Sev) : UShort; inline;
  122. begin
  123.   ErrorIdSev := SmallWord( ULong((@Sev)^) shr 16 );
  124. end;
  125.  
  126. { Severity codes }
  127. const
  128.   severity_NoError              = $0000;
  129.   severity_Warning              = $0004;
  130.   severity_Error                = $0008;
  131.   severity_Severe               = $000C;
  132.   severity_Unrecoverable        = $0010;
  133.  
  134. { Base component error values }
  135.  
  136.   winerr_Base                   = $1000;  { Window Manager                    }
  137.   gpierr_Base                   = $2000;  { Graphics Presentation Interface   }
  138.   deverr_Base                   = $3000;  { Device Manager                    }
  139.   splerr_Base                   = $4000;  { Spooler                           }
  140.  
  141. { Common types used across components }
  142.  
  143. { Common DOS types }
  144. type
  145.   HModule = LHandle;
  146.   Pid     = LHandle;
  147.   Tid     = LHandle;
  148.   Sgid    = Word;
  149.  
  150.   PHmodule = ^HModule;
  151.   PPid     = ^Pid;
  152.   PTid     = ^Tid;
  153.   HFile    = SHandle;
  154.   pHFile   = ^HFile;
  155.  
  156. { Common SUP types }
  157.   Hab = LHandle;
  158.   PHab = ^Hab;
  159.  
  160. { Common GPI/DEV types }
  161.   Hps = LHandle;
  162.   PHps = ^Hps;
  163.  
  164.   HSem = Pointer;
  165.  
  166.   Hdc = LHandle;
  167.   PHdc = ^Hdc;
  168.  
  169.   HRgn = LHandle;
  170.   PHRgn = ^HRgn;
  171.  
  172.   HBitMap = LHandle;
  173.   PHbitMap = ^HBitMap;
  174.  
  175.   Hmf = LHandle;
  176.   PHmf = ^Hmf;
  177.  
  178.   HPal = LHandle;
  179.   PHPal = ^HPal;
  180.  
  181.   Color = Long;
  182.   PColor = ^Color;
  183.  
  184.   PPointL  = ^PointL;
  185.   NPPointL = ^PointL;
  186.   PointL   = record
  187.     X: Long;
  188.     Y: Long;
  189.   end;
  190.   WPoint = PointL;
  191.   PWPoint = ^WPoint;
  192.  
  193.   PPointS = ^PointS;
  194.   PointS  = record
  195.     X: Word;
  196.     Y: Word;
  197.   end;
  198.  
  199.   PRectL  = ^RectL;
  200.   NPRectL = ^RectL;
  201.   RectL   = record
  202.     xLeft:   Long;
  203.     yBottom: Long;
  204.     xRight:  Long;
  205.     yTop:    Long;
  206.   end;
  207.   WRect = RectL;
  208.  
  209.   Str8 = array[0..7] of Char;
  210.   PStr8 = ^Str8;
  211.  
  212. { Common DEV/SPL types }
  213.  
  214.   PDrivData = ^DrivData;
  215.   DrivData  = record            { Record for for Device Driver data }
  216.     cb:         Long;
  217.     lVersion:   Long;
  218.     szDeviceName: array[0..31] of Char;
  219.     abGeneralData: Char;
  220.   end;
  221.  
  222. { Pointer data for DevOpenDC }
  223.   pDevOpenData = ppChar;
  224.  
  225.  { Array indices for array parameter for DevOpenDC, SplQmOpen or SplQpOpen }
  226.  
  227. const
  228.   Address                       = 0;
  229.   Driver_Name                   = 1;
  230.   Driver_Data                   = 2;
  231.   Data_Type                     = 3;
  232.   Comment                       = 4;
  233.   Proc_Name                     = 5;
  234.   Proc_Params                   = 6;
  235.   Spl_Params                    = 7;
  236.   Network_Params                = 8;
  237.  
  238.  { Record definition as an alternative of the array parameter }
  239.  
  240. type
  241.  PDevOpenStruc = ^DevOpenStruc;
  242.  DevOpenStruc = record
  243.    pszLogAddress:       PChar;
  244.    pszDriverName:       PChar;
  245.    pDriv:               PDrivData;
  246.    pszDataType:         PChar;
  247.    pszComment:          PChar;
  248.    pszQueueProcName:    PChar;
  249.    pszQueueProcParams:  PChar;
  250.    pszSpoolerParams:    PChar;
  251.    pszNetworkParams:    PChar;
  252.  end;
  253.  
  254. { Common PMWP object and PMSTDDLG drag data }
  255.  
  256.   PPrintDest = ^PrintDest;
  257.   PrintDest =  record
  258.     cb:          ULong;
  259.     lType:       Long;
  260.     pszToken:    PChar;
  261.     lCount:      Long;
  262.     pdopData:    PChar;
  263.     fl:          ULong;
  264.     pszPrinter:  PChar;
  265.   end;
  266.  
  267. const
  268.   pd_job_Property               = $0001;        { Flags for .fl field }
  269.  
  270. { Common AVIO/GPI types }
  271.  
  272. { Values of fsSelection field of FATTRS structure }
  273.   fattr_Sel_Italic               = $0001;
  274.   fattr_Sel_Underscore           = $0002;
  275.   fattr_Sel_Outline              = $0008;
  276.   fattr_Sel_Strikeout            = $0010;
  277.   fattr_Sel_Bold                 = $0020;
  278.  
  279. { Values of fsType field of FATTRS structure }
  280.   fattr_Type_Kerning            = $0004;
  281.   fattr_Type_Mbcs               = $0008;
  282.   fattr_Type_Dbcs               = $0010;
  283.   fattr_Type_Antialiased        = $0020;
  284.  
  285. { Values of fsFontUse field of FATTRS structure }
  286.   fattr_FontUse_NoMix           = $0002;
  287.   fattr_FontUse_Outline         = $0004;
  288.   fattr_FontUse_Transformable   = $0008;
  289.  
  290. { Size for fields in the font structures }
  291.   FaceSize                      = 32;
  292.  
  293. { Font struct for Vio/GpiCreateLogFont }
  294.  
  295. type
  296.   PFAttrs = ^FAttrs;
  297.   FAttrs  = record
  298.     usRecordLength:         Word;
  299.     fsSelection:            Word;
  300.     lMatch:                 Long;
  301.     szFacename: array [0..FACESIZE-1] of Char;
  302.     idRegistry:             Word;
  303.     usCodePage:             Word;
  304.     lMaxBaselineExt:        Long;
  305.     lAveCharWidth:          Long;
  306.     fsType:                 Word;
  307.     fsFontUse:              Word;
  308.   end;
  309.  
  310. { Values of fsType field of FONTMETRICS structure }
  311. const
  312.   fm_Type_Fixed                 = $0001;
  313.   fm_Type_Licensed              = $0002;
  314.   fm_Type_Kerning               = $0004;
  315.   fm_Type_Dbcs                  = $0010;
  316.   fm_Type_Mbcs                  = $0018;
  317.   fm_Type_64k                   = $8000;
  318.   fm_Type_Atoms                 = $4000;
  319.   fm_Type_FamTrunc              = $2000;
  320.   fm_Type_FaceTrunc             = $1000;
  321.  
  322. { Values of fsDefn field of FONTMETRICS structure }
  323.   fm_Defn_Outline               = $0001;
  324.   fm_Defn_Ifi                   = $0002;
  325.   fm_Defn_Win                   = $0004;
  326.   fm_Defn_Generic               = $8000;
  327.  
  328. { Values of fsSelection field of FONTMETRICS structure }
  329.   fm_Sel_Italic                 = $0001;
  330.   fm_Sel_Underscore             = $0002;
  331.   fm_Sel_Negative               = $0004;
  332.   fm_Sel_Outline                = $0008;
  333.   fm_Sel_StrikeOut              = $0010;
  334.   fm_Sel_Bold                   = $0020;
  335.  
  336. { Values of fsCapabilities field of FONTMETRICS structure }
  337.   fm_Cap_NoMix                  = $0001;
  338.  
  339. { Font metrics returned by GpiQueryFonts and others }
  340. type
  341.   pPanose = ^Panose;
  342.   Panose = record
  343.    bFamilyType:      Byte;
  344.    bSerifStyle:      Byte;
  345.    bWeight:          Byte;
  346.    bProportion:      Byte;
  347.    bContrast:        Byte;
  348.    bStrokeVariation: Byte;
  349.    bArmStyle:        Byte;
  350.    bLetterform:      Byte;
  351.    bMidline:         Byte;
  352.    bXHeight:         Byte;
  353.    fbPassedISO:      Byte;
  354.    fbFailedISO:      Byte;
  355.  end;
  356.  
  357.   PFontMetrics = ^FontMetrics;
  358.   FontMetrics  = record
  359.     szFamilyname: array[0..FACESIZE-1] of Char;
  360.     szFacename:   array[0..FACESIZE-1] of Char;
  361.     idRegistry:             Word;
  362.     usCodePage:             Word;
  363.     lEmHeight:              Long;
  364.     lXHeight:               Long;
  365.     lMaxAscender:           Long;
  366.     lMaxDescender:          Long;
  367.     lLowerCaseAscent:       Long;
  368.     lLowerCaseDescent:      Long;
  369.     lInternalLeading:       Long;
  370.     lExternalLeading:       Long;
  371.     lAveCharWidth:          Long;
  372.     lMaxCharInc:            Long;
  373.     lEmInc:                 Long;
  374.     lMaxBaselineExt:        Long;
  375.     sCharSlope:             Integer;
  376.     sInlineDir:             Integer;
  377.     sCharRot:               Integer;
  378.     usWeightClass:          Word;
  379.     usWidthClass:           Word;
  380.     sXDeviceRes:            Integer;
  381.     sYDeviceRes:            Integer;
  382.     sFirstChar:             Integer;
  383.     sLastChar:              Integer;
  384.     sDefaultChar:           Integer;
  385.     sBreakChar:             Integer;
  386.     sNominalPointSize:      Integer;
  387.     sMinimumPointSize:      Integer;
  388.     sMaximumPointSize:      Integer;
  389.     fsType:                 Word;
  390.     fsDefn:                 Word;
  391.     fsSelection:            Word;
  392.     fsCapabilities:         Word;
  393.     lSubscriptXSize:        Long;
  394.     lSubscriptYSize:        Long;
  395.     lSubscriptXOffset:      Long;
  396.     lSubscriptYOffset:      Long;
  397.     lSuperscriptXSize:      Long;
  398.     lSuperscriptYSize:      Long;
  399.     lSuperscriptXOffset:    Long;
  400.     lSuperscriptYOffset:    Long;
  401.     lUnderscoreSize:        Long;
  402.     lUnderscorePosition:    Long;
  403.     lStrikeoutSize:         Long;
  404.     lStrikeoutPosition:     Long;
  405.     sKerningPairs:          Integer;
  406.     sFamilyClass:           Integer;
  407.     lMatch:                 Long;
  408.     FamilyNameAtom:         Long;
  409.     FaceNameAtom:           Long;
  410.     FmPanose:               Panose;
  411.   end;
  412.  
  413. { Common WIN types }
  414.   HWnd = LHandle;
  415.   PHWnd = ^HWnd;
  416.  
  417.   Hmq = LHandle;
  418.   PHmq = ^Hmq;
  419.  
  420.   PIconInfo = ^IconInfo;
  421.   IconInfo = record
  422.     cb:                ULong;           { size of IconInfo record }
  423.     fFormat:           ULong;
  424.     pszFileName:       PChar;           { use when fFormat = ICON_FILE }
  425.     hmod:              HModule;         { use when fFormat = ICON_RESOURCE }
  426.     resid:             ULong;           { use when fFormat = ICON_RESOURCE }
  427.     cbIconData:        ULong;           { use when fFormat = ICON_DATA     }
  428.     pIconData:         Pointer;         { use when fFormat = ICON_DATA     }
  429.   end;
  430.  
  431. const
  432.   icon_File                     = 1;    { flags for fFormat of tIconInfo }
  433.   icon_Resource                 = 2;
  434.   icon_Data                     = 3;
  435.   icon_Clear                    = 4;
  436.  
  437. implementation
  438.  
  439. end.
  440.