home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / OS2API / OS2-PMCB.ADS < prev    next >
Text File  |  1996-07-18  |  8KB  |  195 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.PMcb                                       ║
  7. -- ║                                                                   ║
  8. -- ║        Author :  Leonid Dulman     1995                           ║
  9. -- ║                                                                   ║
  10. -- ║             GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS            ║
  11. -- ║                                                                   ║
  12. -- ║               PM  WinTrackRect( ) information                     ║
  13. -- ║               PM  Clipboard Manager                               ║
  14. -- ╚═══════════════════════════════════════════════════════════════════╝
  15.  
  16.  
  17. with Interfaces.C;         use Interfaces.C;
  18. with Interfaces.C.Strings; use Interfaces.C.Strings;
  19.  
  20. package Os2.PMcb is
  21. pragma Preelaborate (PMcb);
  22. --
  23. --  Extended Attribute Flags ( Association Table)
  24.  
  25.  EAF_DEFAULTOWNER  :constant Long:=         16#0001#;
  26.  EAF_UNCHANGEABLE  :constant Long:=         16#0002#;
  27.  EAF_REUSEICON     :constant Long:=         16#0004#;
  28.  
  29. --  WinTrackRect( ) information
  30. --  WinTrackRect( ) tracking information structure
  31.  
  32. type TRACKINFO  is record    -- ti
  33.    cxBorder          :LONG    ;
  34.    cyBorder          :LONG    ;
  35.    cxGrid            :LONG    ;
  36.    cyGrid            :LONG    ;
  37.    cxKeyboard        :LONG    ;
  38.    cyKeyboard        :LONG    ;
  39.    rclTrack          :RECTL   ;
  40.    rclBoundary       :RECTL   ;
  41.    ptlMinTrackSize   :POINTL  ;
  42.    ptlMaxTrackSize   :POINTL  ;
  43.    fs                :ULONG   ;
  44. end record; -- TRACKINFO;
  45. type PTRACKINFO  is access all TRACKINFO;
  46.  
  47. function WinTrackRect(hwn:HWND       ;
  48.                       hp :HPS        ;
  49.                       pti:PTRACKINFO )return BOOL32;
  50. pragma Import(c,WinTrackRect, Link_name=>"_WinTrackRect");
  51.  
  52. function WinShowTrackRect(hwn  :HWND   ;
  53.                           fShow:BOOL32 )return BOOL32;
  54. pragma Import(c,WinShowTrackRect, Link_name=>"_WinShowTrackRect");
  55.  
  56. --        WinTrackRect( ) flags
  57.  
  58.  TF_LEFT       :constant Long:=             16#0001#;
  59.  TF_TOP        :constant Long:=             16#0002#;
  60.  TF_RIGHT      :constant Long:=             16#0004#;
  61.  TF_BOTTOM     :constant Long:=             16#0008#;
  62. -- TF_MOVE  TF_LEFT or TF_TOP or TF_RIGHT or TF_BOTTOM ;
  63.  TF_MOVE       :constant Long:=             16#000F#;
  64.  TF_SETPOINTERPOS  :constant Long:=         16#0010#;
  65.  TF_GRID           :constant Long:=         16#0020#;
  66.  TF_STANDARD       :constant Long:=         16#0040#;
  67.  TF_ALLINBOUNDARY     :constant Long:=      16#0080#;
  68.  TF_VALIDATETRACKRECT :constant Long:=      16#0100#;
  69.  TF_PARTINBOUNDARY    :constant Long:=      16#0200#;
  70.  
  71. --  Clipboard Manager
  72. --  Clipboard messages
  73.  
  74.  WM_RENDERFMT         :constant Long:=      16#0060#;
  75.  WM_RENDERALLFMTS     :constant Long:=      16#0061#;
  76.  WM_DESTROYCLIPBOARD  :constant Long:=      16#0062#;
  77.  WM_PAINTCLIPBOARD    :constant Long:=      16#0063#;
  78.  WM_SIZECLIPBOARD     :constant Long:=      16#0064#;
  79.  WM_HSCROLLCLIPBOARD  :constant Long:=      16#0065#;
  80.  WM_VSCROLLCLIPBOARD  :constant Long:=      16#0066#;
  81.  WM_DRAWCLIPBOARD     :constant Long:=      16#0067#;
  82.  
  83. --        --Standard Clipboard formats
  84.  
  85.  CF_TEXT              :constant Long:=      1;
  86.  CF_BITMAP            :constant Long:=      2;
  87.  CF_DSPTEXT           :constant Long:=      3;
  88.  CF_DSPBITMAP         :constant Long:=      4;
  89.  CF_METAFILE          :constant Long:=      5;
  90.  CF_DSPMETAFILE       :constant Long:=      6;
  91.  CF_PALETTE           :constant Long:=      9;
  92.  CF_MMPMFIRST         :constant Long:=     10;
  93.  CF_MMPMLAST          :constant Long:=     19;
  94. --
  95. --        --standard DDE and clipboard format stings
  96. --
  97. --        #define SZFMT_TEXT                   "#1"
  98. --        #define SZFMT_BITMAP                 "#2"
  99. --        #define SZFMT_DSPTEXT                "#3"
  100. --        #define SZFMT_DSPBITMAP              "#4"
  101. --        #define SZFMT_METAFILE               "#5"
  102. --        #define SZFMT_DSPMETAFILE            "#6"
  103. --        #define SZFMT_PALETTE                "#9"
  104. --        #define SZFMT_SYLK                   "Sylk"
  105. --        #define SZFMT_DIF                    "Dif"
  106. --        #define SZFMT_TIFF                   "Tiff"
  107. --        #define SZFMT_OEMTEXT                "OemText"
  108. --        #define SZFMT_DIB                    "Dib"
  109. --        #define SZFMT_OWNERDISPLAY           "OwnerDisplay"
  110. --        #define SZFMT_LINK                   "Link"
  111. --        #define SZFMT_METAFILEPICT           "MetaFilePict"
  112. --        #define SZFMT_DSPMETAFILEPICT        "DspMetaFilePict"
  113. --        #define SZFMT_CPTEXT                 "Codepage Text"
  114. --        #define SZDDEFMT_RTF                 "Rich Text Format"
  115. --        #define SZDDEFMT_PTRPICT             "Printer_Picture"
  116.  
  117. --     Metafiles are the same no matter whether they are used in
  118. --     16-bit or 32-bit applications. While not strictly necessary
  119. --     because of inherent alignment we force packing on a 2 byte
  120. --     boundary to avoid any confusion.
  121.  
  122. type MFP  is record    -- mfp
  123.   sizeBounds     :POINTL ;  -- metafile notional grid size
  124.   sizeMM         :POINTL ;  -- metafile size high metric units
  125.   cbLength       :ULONG  ;  -- length of metafile data
  126.   mapMode        :USHORT ;  -- a PM metaflie map mode
  127.   reserved       :USHORT ;
  128.   abData         :BYTE   ;  --  [1];   -- metafile Data
  129. end record; -- MFP;
  130. type PMFP  is access all MFP;
  131.  
  132. --   CPTEXT DDE data are the same no matter whether they are used
  133. --   in 16-bit or 32-bit applications. While not strictly necessary
  134. --   because of inherent alignment we force packing on a 2 byte
  135. --   boundary to avoid any confusion.
  136.  
  137. type CPTEXT  is record    -- cptxt
  138.       idCountry      :USHORT ;
  139.       usCodepage     :USHORT ;
  140.       usLangID       :USHORT ;
  141.       usSubLangID    :USHORT ;
  142.       abText         :BYTE   ;  --[1];   -- text string starts here
  143. end record; -- CPTEXT;
  144. type PCPTEXT  is access all CPTEXT;
  145.  
  146. function WinSetClipbrdOwner(ha  :HAB  ;
  147.                             hwn :HWND )return BOOL32  ;
  148. pragma Import(c,WinSetClipbrdOwner, Link_name=>"_WinSetClipbrdOwner");
  149.  
  150. function WinSetClipbrdData(ha        :HAB   ;
  151.                            ulData    :ULONG ;
  152.                            fmt       :ULONG ;
  153.                            rgfFmtInfo:ULONG )return BOOL32  ;
  154. pragma Import(c,WinSetClipbrdData, Link_name=>"_WinSetClipbrdData");
  155.  
  156. function WinQueryClipbrdData(ha :HAB   ;
  157.                              fmt:ULONG )return ULONG ;
  158. pragma Import(c,WinQueryClipbrdData, Link_name=>"_WinQueryClipbrdData");
  159.  
  160. function WinQueryClipbrdFmtInfo(ha         :HAB    ;
  161.                                 fmt        :ULONG  ;
  162.                                 prgfFmtInfo:PULONG )return BOOL32  ;
  163. pragma Import(c,WinQueryClipbrdFmtInfo, Link_name=>"_WinQueryClipbrdFmtInfo");
  164.  
  165. function WinSetClipbrdViewer(ha               :HAB  ;
  166.                              hwndNewClipViewer:HWND )return BOOL32  ;
  167. pragma Import(c,WinSetClipbrdViewer, Link_name=>"_WinSetClipbrdViewer");
  168.  
  169. --        WinSetClipbrdData( ) flags
  170. --
  171. --        #define CFI_OWNERFREE              16#0001
  172. --        #define CFI_OWNERDISPLAY           16#0002
  173. --        #define CFI_POINTER                16#0400
  174. --        #define CFI_HANDLE                 16#0200
  175.  
  176. function WinEnumClipbrdFmts(ha :HAB   ;
  177.                             fmt:ULONG )return ULONG;
  178. pragma Import(c,WinEnumClipbrdFmts, Link_name=>"_WinEnumClipbrdFmts");
  179.  
  180. function WinEmptyClipbrd(ha:HAB)return BOOL32  ;
  181. pragma Import(c,WinEmptyClipbrd, Link_name=>"_WinEmptyClipbrd");
  182.  
  183. function WinOpenClipbrd(ha:HAB)return BOOL32  ;
  184. pragma Import(c,WinOpenClipbrd, Link_name=>"_WinOpenClipbrd");
  185.  
  186. function WinCloseClipbrd(ha:HAB)return BOOL32  ;
  187. pragma Import(c,WinCloseClipbrd, Link_name=>"_WinCloseClipbrd");
  188.  
  189. function WinQueryClipbrdOwner(ha:HAB)return HWND  ;
  190. pragma Import(c,WinQueryClipbrdOwner, Link_name=>"_WinQueryClipbrdOwner");
  191.  
  192. function WinQueryClipbrdViewer(ha:HAB)return HWND  ;
  193. pragma Import(c,WinQueryClipbrdViewer, Link_name=>"_WinQueryClipbrdViewer");
  194. end os2.pmcb ;
  195.