home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / OS2API / OS2.ADS < prev    next >
Text File  |  1996-07-12  |  11KB  |  316 lines

  1.  
  2. -- ╔═══════════════════════════════════════════════════════════════════╗
  3. -- ║       D E S I G N   E N G I N E R I N G              ║D║S║        ║
  4. -- ║            S O F T W A R E                           ╚═╩═╝        ║
  5. -- ║                                                                   ║
  6. -- ║        Package    OS2   interface to API and PM functions         ║
  7. -- ║            common block                                           ║
  8. -- ║        Author :  Leonid Dulman     1995 , 1996                    ║
  9. -- ║                                                                   ║
  10. -- ╚═══════════════════════════════════════════════════════════════════╝
  11. with System;
  12. with Interfaces.C;         use Interfaces.C;
  13. with Interfaces.C.Strings; use Interfaces.C.Strings;
  14.  
  15. package Os2 is
  16. pragma Preelaborate(Os2);
  17.  
  18. -- ===========================================================================
  19. -- + INCL_DOSPROCESS         Process and thread support
  20. -- + INCL_DOSFILEMGR         File Management
  21. -- + INCL_DOSMEMMGR          Memory Management
  22. -- + INCL_DOSSEMAPHORES      Semaphore support
  23. -- + INCL_DOSDATETIME        Date/Time and Timer support
  24. --   INCL_DOSMODULEMGR       Module manager
  25. -- + INCL_DOSRESOURCES       Resource support
  26. --   INCL_DOSNLS             National Language Support
  27. --   INCL_DOSEXCEPTIONS      Exception Management Support
  28. --   INCL_DOSMISC            Miscellaneous
  29. --   INCL_DOSMONITORS        Monitors
  30. --   INCL_DOSQUEUES          Queues
  31. --   INCL_DOSSESMGR          Session Manager Support
  32. --   INCL_DOSDEVICES         Device specific, ring 2 support
  33. --   INCL_DOSNMPIPES         Named Pipes Support
  34. --   INCL_DOSPROFILE         DosProfile API
  35. --   INCL_DOSMVDM            MVDM support
  36. --
  37. -- ===========================================================================
  38.    -------------------
  39.    -- General Types --
  40.    -------------------
  41.  
  42.  
  43. subtype PVOID is System.Address;
  44. subtype PVOID16 is System.Address;
  45.  
  46. type VLONG is range -9_223_372_036_854_775_808
  47.                                .. 9_223_372_036_854_775_807;
  48. for VLONG'size use 64;
  49.  
  50. type UVLong is mod 16#1_0000_0000_0000_0000#;
  51. for UVLong'size use 64;
  52.  
  53.  
  54. type UCHAR  is new unsigned_char;
  55. type USHORT is new unsigned_short;
  56. type ULONG  is new unsigned_long;
  57. type  LONG  is new long_integer;
  58.  
  59. type ASTRING is array(integer range <>) of aliased CHARACTER;
  60.  
  61. subtype Short   is Short_Integer ;
  62. subtype BYTE    is UCHAR  ;
  63. subtype SEL     is USHORT ;
  64. subtype APIRET16 is USHORT;
  65. subtype SHANDLE is USHORT ;
  66. subtype LHANDLE is ULONG  ;
  67. subtype BOOL    is ULONG  ;
  68. subtype BOOL32  is ULONG  ;
  69. subtype HMODULE is ULONG  ;
  70. subtype ERRORID is ULONG  ;
  71. subtype APIRET  is ULONG  ;
  72. subtype APIRET32 is ULONG ;
  73. subtype PID     is ULONG  ;
  74. subtype TID     is ULONG  ;
  75. subtype HAB     is ULONG  ;
  76. subtype HDC     is ULONG  ;
  77. subtype HPS     is ULONG  ;
  78. subtype HDS     is ULONG  ;
  79. subtype HMF     is ULONG  ;
  80. subtype HMQ     is ULONG  ;
  81. subtype HRGN    is ULONG  ;
  82. subtype HBITMAP is ULONG  ;
  83. subtype HPAL    is ULONG  ;
  84. subtype HWND    is ULONG  ;
  85. subtype COLOR   is LONG   ;
  86. subtype HSEM    is PVOID  ;
  87. subtype PCH     is PVOID  ;
  88. subtype PSZ     is PVOID  ;
  89. subtype NPSZ    is PVOID  ;
  90. subtype PMPARAM  is PVOID;
  91. subtype  MPARAM  is ULONG;
  92. subtype PMRESULT is PVOID;
  93. subtype  MRESULT is PVOID;
  94. subtype  PFNWP   is PVOID;
  95. subtype  PFN     is PVOID;
  96.  
  97.    type   PULONG   is access all ULONG;
  98.    type   PLONG    is access all LONG;
  99.    type   PUSHORT  is access all USHORT;
  100.    type   PSHORT   is access all SHORT;
  101.    type   PUCHAR   is access all UCHAR;
  102.    type   PBYTE    is access all BYTE ;
  103.    type   PCHAR    is access all CHARACTER;
  104.    type   PSEL     is access all SEL;
  105.    type   PSHANDLE is access all SHANDLE ;
  106.    type   PLHANDLE is access all LHANDLE ;
  107.    type   PHMODULE is access all HMODULE ;
  108.    type   PERRORID is access all ERRORID ;
  109.    type   PPID     is access all PID     ;
  110.    type   PTID     is access all TID     ;
  111.    type   PHAB     is access all HAB     ;
  112.    type   PHPS     is access all HPS     ;
  113.    type   PHDC     is access all HDC     ;
  114.    type   PHDS     is access all HDS     ;
  115.    type   PHMF     is access all HMF     ;
  116.    type   PHMQ     is access all HMQ     ;
  117.    type   PHRGN    is access all HRGN    ;
  118.    type   PHBITMAP is access all HBITMAP ;
  119.    type   PHPAL    is access all HPAL    ;
  120.    type   PHWND    is access all HWND    ;
  121.    type   PCOLOR   is access all COLOR   ;
  122.    type   PPVOID   is access all PVOID   ;
  123.    type   PHSEM    is access all HSEM    ;
  124.  
  125. subtype HFILE is LHANDLE ;     -- hf --
  126. type PHFILE   is access all HFILE;
  127.  
  128.    False32 : constant BOOL32 := 0;
  129.    True32  : constant BOOL32 := 1;
  130.    facesize: constant integer:=32;
  131.  
  132.  
  133. type  QWORD is record           -- qword --
  134. ulLo   :ULONG   ;
  135. ulHi   :ULONG   ;
  136. end record; -- QWORD;
  137. type PQWORD is access all QWORD;
  138.  
  139. type  POINTL is record         -- ptl  --
  140.  x  :LONG  ;
  141.  y  :LONG  ;
  142. end record; -- POINTL;
  143. type  PPOINTL is access all POINTL;
  144.  
  145. type  POINTS is record          -- pts --
  146.  x  :SHORT ;
  147.  y  :SHORT ;
  148. end record; -- POINTS;
  149. type  PPOINTS  is access all POINTS;
  150.  
  151. type  RECTL is record           -- rcl --
  152.  xLeft    :LONG  ;
  153.  yBottom  :LONG  ;
  154.  xRight   :LONG  ;
  155.  yTop     :LONG  ;
  156. end record; -- RECTL;
  157. type  PRECTL is access all RECTL;
  158.  
  159. --        QMSG structure
  160. type QMSG    is record  -- qmsg
  161.    hwn           :HWND    ;
  162.    msg           :ULONG   ;
  163.    mp1           :MPARAM  ;
  164.    mp2           :MPARAM  ;
  165.    time          :ULONG   ;
  166.    ptl           :POINTL  ;
  167.    reserved      :ULONG   ;
  168. end record; -- QMSG;
  169. type PQMSG  is access all QMSG;
  170.  
  171. type  DRIVDATA is record       -- driv --
  172.  cb              :LONG    ;
  173.  lVersion        :LONG    ;
  174.  szDeviceName    :string(1..32)  ;     --  [32];
  175.  abGeneralData   :string(1..1)   ;     --  [1];
  176. end record; -- DRIVDATA;
  177. type  PDRIVDATA is access all DRIVDATA ;
  178.  
  179. type  DEVOPENSTRUC is record      -- dop --
  180.     pszLogAddress        :PSZ       ;
  181.     pszDriverName        :PSZ       ;
  182.     pdriv                :PDRIVDATA ;
  183.     pszDataType          :PSZ       ;
  184.     pszComment           :PSZ       ;
  185.     pszQueueProcName     :PSZ       ;
  186.     pszQueueProcParams   :PSZ       ;
  187.     pszSpoolerParams     :PSZ       ;
  188.     pszNetworkParams     :PSZ       ;
  189.    end record; -- DEVOPENSTRUC;
  190. type  PDEVOPENSTRUC is access all  DEVOPENSTRUC ;
  191.  
  192. type  PRINTDEST is record    -- prntdst --
  193.  cb          :ULONG        ;
  194.  lType       :LONG         ;
  195.  pszToken    :PSZ          ;
  196.  lCount      :LONG         ;
  197.  pdopData    :PSZ          ;
  198.  fl          :ULONG        ;
  199.  pszPrinter  :PSZ          ;
  200. end record; -- PRINTDEST;
  201. type  PPRINTDEST is access all PRINTDEST;
  202.  
  203. -- font  for Vio/GpiCreateLogFont --
  204. type  FATTRS is record             -- fat --
  205.  usRecordLength   :USHORT  ;
  206.  fsSelection      :USHORT  ;
  207.  lMatch           :LONG    ;
  208.  szFacename       :string (1..FACESIZE) ;         -- [FACESIZE];
  209.  idRegistry       :USHORT  ;
  210.  usCodePage       :USHORT  ;
  211.  lMaxBaselineExt  :LONG    ;
  212.  lAveCharWidth    :LONG    ;
  213.  fsType           :USHORT  ;
  214.  fsFontUse        :USHORT  ;
  215. end record; -- FATTRS;
  216. type  PFATTRS is access all   FATTRS;
  217.  
  218. -- font metrics returned by GpiQueryFonts and others --
  219. type  PANOSE is record    -- panose --
  220.   bFamilyType        :BYTE   ;
  221.   bSerifStyle        :BYTE   ;
  222.   bWeight            :BYTE   ;
  223.   bProportion        :BYTE   ;
  224.   bContrast          :BYTE   ;
  225.   bStrokeVariation   :BYTE   ;
  226.   bArmStyle          :BYTE   ;
  227.   bLetterform        :BYTE   ;
  228.   bMidline           :BYTE   ;
  229.   bXHeight           :BYTE   ;
  230.   fbPassedISO        :BYTE   ;
  231.   fbFailedISO        :BYTE   ;
  232. end record; -- PANOSE;
  233. type  PPANOSE is access all  PANOSE;
  234.  
  235. type  FONTMETRICS is record      -- fm --
  236.   szFamilyname         :string(1..FACESIZE)   ;       --  [FACESIZE];
  237.   szFacename           :string(1..FACESIZE)  ;       --[FACESIZE];
  238.   idRegistry           :USHORT   ;
  239.   usCodePage           :USHORT   ;
  240.   lEmHeight            :LONG     ;
  241.   lXHeight             :LONG     ;
  242.   lMaxAscender         :LONG     ;
  243.   lMaxDescender        :LONG     ;
  244.   lLowerCaseAscent     :LONG     ;
  245.   lLowerCaseDescent    :LONG     ;
  246.   lInternalLeading     :LONG     ;
  247.   lExternalLeading     :LONG     ;
  248.   lAveCharWidth        :LONG     ;
  249.   lMaxCharInc          :LONG     ;
  250.   lEmInc               :LONG     ;
  251.   lMaxBaselineExt      :LONG     ;
  252.   sCharSlope           :SHORT    ;
  253.   sInlineDir           :SHORT    ;
  254.   sCharRot             :SHORT    ;
  255.   usWeightClass        :USHORT   ;
  256.   usWidthClass         :USHORT   ;
  257.   sXDeviceRes          :SHORT    ;
  258.   sYDeviceRes          :SHORT    ;
  259.   sFirstChar           :SHORT    ;
  260.   sLastChar            :SHORT    ;
  261.   sDefaultChar         :SHORT    ;
  262.   sBreakChar           :SHORT    ;
  263.   sNominalPointSize    :SHORT    ;
  264.   sMinimumPointSize    :SHORT    ;
  265.   sMaximumPointSize    :SHORT    ;
  266.   fsType               :USHORT   ;
  267.   fsDefn               :USHORT   ;
  268.   fsSelection          :USHORT   ;
  269.   fsCapabilities       :USHORT   ;
  270.   lSubscriptXSize      :LONG     ;
  271.   lSubscriptYSize      :LONG     ;
  272.   lSubscriptXOffset    :LONG     ;
  273.   lSubscriptYOffset    :LONG     ;
  274.   lSuperscriptXSize    :LONG     ;
  275.   lSuperscriptYSize    :LONG     ;
  276.   lSuperscriptXOffset  :LONG     ;
  277.   lSuperscriptYOffset  :LONG     ;
  278.   lUnderscoreSize      :LONG     ;
  279.   lUnderscorePosition  :LONG     ;
  280.   lStrikeoutSize       :LONG     ;
  281.   lStrikeoutPosition   :LONG     ;
  282.   sKerningPairs        :SHORT    ;
  283.   sFamilyClass         :SHORT    ;
  284.   lMatch               :LONG     ;
  285.   FamilyNameAtom       :LONG     ;
  286.   FaceNameAtom         :LONG     ;
  287.    pan                 :PANOSE   ;
  288. end record; -- FONTMETRICS;
  289. type PFONTMETRICS is access all FONTMETRICS;
  290.  
  291. type ICONINFO  is record  -- icninf --
  292.  cb           :ULONG   ;  -- size of ICONINFO structure --
  293.  fFormat      :ULONG   ;
  294.  pszFileName  :PSZ     ;  -- use when fFormat = ICON_FILE --
  295.  hmod         :HMODULE ;  -- use when fFormat = ICON_RESOURCE --
  296.  resid        :ULONG   ;  -- use when fFormat = ICON_RESOURCE --
  297.  cbIconData   :ULONG   ;  -- use when fFormat = ICON_DATA     --
  298.  pIconData    :PVOID   ;  -- use when fFormat = ICON_DATA     --
  299. end record;
  300. type PICONINFO is access all ICONINFO ;
  301.  
  302. type SWP   is record   -- swp
  303.    fl                 :ULONG   ;
  304.    cy                 :LONG    ;
  305.    cx                 :LONG    ;
  306.    y                  :LONG    ;
  307.    x                  :LONG    ;
  308.    hwndInsertBehind   :HWND    ;
  309.    hwn                :HWND    ;
  310.    ulReserved1        :ULONG   ;
  311.    ulReserved2        :ULONG   ;
  312. end record; -- SWP;
  313. type PSWP  is access all SWP;
  314.  
  315. end Os2;
  316.