home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mod201j.zip / modula2.exe / os2api / winstddr.def < prev    next >
Text File  |  1994-05-03  |  18KB  |  449 lines

  1. DEFINITION MODULE WINSTDDRAG;
  2.  
  3. (************************************************************************
  4.   OS/2 2.0 interface for Presentation Manager
  5.            CUA standard drag dll.
  6.  
  7.   Copyright (c) 1992 by Juergen Neuhoff
  8. *************************************************************************)
  9.  
  10. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  11. (*$CDECL+    C-style procedures                                         *)
  12. (*$A         default alignment for record fields                        *)
  13.  
  14. IMPORT SYSTEM;
  15. FROM   OS2DEF      IMPORT TYPEPREFIX, HWND, LHANDLE, HPS, PSZ;
  16. FROM   WINDEF      IMPORT MPARAM, MRESULT;
  17. FROM   GPIDEF      IMPORT SIZEL;
  18. FROM   WINPOINTERS IMPORT HPOINTER;
  19.  
  20. CONST
  21.   PMERR_NOT_DRAGGING       = 1F00H;
  22.   PMERR_ALREADY_DRAGGING   = 1F01H;
  23.  
  24. CONST
  25.   MSGF_DRAG                = 0010H;    (* message filter identifier *)
  26.  
  27. CONST
  28.   WM_DRAGFIRST             = 0310H;
  29.   WM_DRAGLAST              = 032FH;
  30.  
  31. CONST
  32.   DM_DROP                  = 032FH;
  33.   DM_DRAGOVER              = 032EH;
  34.   DM_DRAGLEAVE             = 032DH;
  35.   DM_DROPHELP              = 032CH;
  36.   DM_ENDCONVERSATION       = 032BH;
  37.   DM_PRINT                 = 032AH;
  38.   DM_RENDER                = 0329H;
  39.   DM_RENDERCOMPLETE        = 0328H;
  40.   DM_RENDERPREPARE         = 0327H;
  41.   DM_DRAGFILECOMPLETE      = 0326H;
  42.   DM_EMPHASIZETARGET       = 0325H;
  43.   DM_DRAGERROR             = 0324H;
  44.   DM_FILERENDERED          = 0323H;
  45.   DM_RENDERFILE            = 0322H;
  46.   DM_DRAGOVERNOTIFY        = 0321H;
  47.   DM_PRINTOBJECT           = 0320H;
  48.   DM_DISCARDOBJECT         = 031FH;
  49.  
  50. CONST (* drag type constants  *)
  51.   DRT_ASM                  = "Assembler Code";
  52.   DRT_BASIC                = "BASIC Code";
  53.   DRT_BINDATA              = "Binary Data";
  54.   DRT_BITMAP               = "Bitmap";
  55.   DRT_C                    = "C Code";
  56.   DRT_COBOL                = "COBOL Code";
  57.   DRT_DLL                  = "Dynamic Link Library";
  58.   DRT_DOSCMD               = "DOS Command File";
  59.   DRT_EXE                  = "Executable";
  60.   DRT_FORTRAN              = "FORTRAN Code";
  61.   DRT_ICON                 = "Icon";
  62.   DRT_LIB                  = "Library";
  63.   DRT_METAFILE             = "Metafile";
  64.   DRT_OS2CMD               = "OS/2 Command File";
  65.   DRT_PASCAL               = "Pascal Code";
  66.   DRT_RESOURCE             = "Resource File";
  67.   DRT_TEXT                 = "Plain Text";
  68.   DRT_UNKNOWN              = "Unknown";
  69.  
  70. CONST (* DM_DRAGOVER response codes *)
  71.   DOR_NODROP               = 0000H;
  72.   DOR_DROP                 = 0001H;
  73.   DOR_NODROPOP             = 0002H;
  74.   DOR_NEVERDROP            = 0003H;
  75.  
  76. CONST (* supported operation flags  *)
  77.   DO_COPYABLE              = 0001H;
  78.   DO_MOVEABLE              = 0002H;
  79.   DO_LINKABLE              = 0004H;
  80.  
  81. CONST (* source control flags *)
  82.   DC_OPEN                  = 0001H;
  83.   DC_REF                   = 0002H;
  84.   DC_GROUP                 = 0004H;
  85.   DC_CONTAINER             = 0008H;
  86.   DC_PREPARE               = 0010H;
  87.   DC_REMOVEABLEMEDIA       = 0020H;
  88.  
  89. CONST
  90.   DO_DEFAULT               = 0BFFEH; (* Default operation          *)
  91.   DO_UNKNOWN               = 0BFFFH; (* Unknown operation          *)
  92.   DO_COPY                  = 00010H;
  93.   DO_MOVE                  = 00020H;
  94.   DO_LINK                  = 00018H;
  95.   DO_CREATE                = 00040H;
  96.  
  97. CONST (* transfer reply flags *)
  98.   DMFL_TARGETSUCCESSFUL    = 0001H;
  99.   DMFL_TARGETFAIL          = 0002H;
  100.   DMFL_NATIVERENDER        = 0004H;
  101.   DMFL_RENDERRETRY         = 0008H;
  102.   DMFL_RENDEROK            = 0010H;
  103.   DMFL_RENDERFAIL          = 0020H;
  104.  
  105. CONST (* drag image manipulation  flags *)
  106.   DRG_ICON                 = 00000001H;
  107.   DRG_BITMAP               = 00000002H;
  108.   DRG_POLYGON              = 00000004H;
  109.   DRG_STRETCH              = 00000008H;
  110.   DRG_TRANSPARENT          = 00000010H;
  111.   DRG_CLOSED               = 00000020H;
  112.  
  113. CONST (* DM_DRAGERROR return values *)
  114.   DME_IGNOREABORT          = 1;
  115.   DME_IGNORECONTINUE       = 2;
  116.   DME_REPLACE              = 3;
  117.   DME_RETRY                = 4;
  118.  
  119. CONST (* DM_DRAGFILECOMPLETE flags  *)
  120.   DF_MOVE                  = 0001H;
  121.   DF_SOURCE                = 0002H;
  122.   DF_SUCCESSFUL            = 0004H;
  123.  
  124. CONST
  125.   DRR_SOURCE               = 1;
  126.   DRR_TARGET               = 2;
  127.   DRR_ABORT                = 3;
  128.  
  129. CONST (* DM_DRAGERROR operation IDs *)
  130.   DFF_MOVE                 = 1;
  131.   DFF_COPY                 = 2;
  132.   DFF_DELETE               = 3;
  133.  
  134. TYPE
  135.   HSTR                     = LHANDLE;    (* hstr *)
  136.  
  137. TYPE
  138.   DRAGITEM                 = RECORD      (* ditem *)
  139.     CASE                     : TYPEPREFIX OF
  140.     | TRUE                   :
  141.       hwndItem               : HWND;     (* conversation partner           *)
  142.       ulItemID               : LONGCARD; (* identifies item being dragged  *)
  143.       hstrType               : HSTR;     (* type of item                   *)
  144.       hstrRMF                : HSTR;     (* rendering mechanism and format *)
  145.       hstrContainerName      : HSTR;     (* name of source container       *)
  146.       hstrSourceName         : HSTR;     (* name of item at source         *)
  147.       hstrTargetName         : HSTR;     (* suggested name of item at dest *)
  148.       cxOffset               : INTEGER;  (* x offset of the origin of the  *)
  149.                                          (*   image from the mouse hotspot *)
  150.       cyOffset               : INTEGER;  (* y offset of the origin of the  *)
  151.                                          (*   image from the mouse hotspot *)
  152.       fsControl              : CARDINAL; (* source item control flags      *)
  153.       fsSupportedOps         : CARDINAL; (* ops supported by source        *)
  154.     | FALSE                  :
  155.       ItemWinHandle          : HWND;     (* conversation partner           *)
  156.       IdemtID                : LONGCARD; (* identifies item being dragged  *)
  157.       TypeStrHandle          : HSTR;     (* type of item                   *)
  158.       RMFStrHandle           : HSTR;     (* rendering mechanism and format *)
  159.       ContainerNameStrHandle : HSTR;     (* name of source container       *)
  160.       SourceNameStrHandle    : HSTR;     (* name of item at source         *)
  161.       TargetNameStrHandle    : HSTR;     (* suggested name of item at dest *)
  162.       xOffset                : INTEGER;  (* x offset of the origin of the  *)
  163.                                          (*   image from the mouse hotspot *)
  164.       yOffset                : INTEGER;  (* y offset of the origin of the  *)
  165.                                          (*   image from the mouse hotspot *)
  166.       ControlFlags           : CARDINAL; (* source item control flags      *)
  167.       SupportedOps           : CARDINAL; (* ops supported by source        *)
  168.     END;                     END;
  169.   PDRAGITEM                = POINTER TO DRAGITEM;
  170.  
  171. TYPE
  172.   DRAGINFO                 = RECORD      (* dinfo *)
  173.     CASE                     : TYPEPREFIX OF
  174.     | TRUE                   :
  175.       cbDraginfo             : LONGCARD; (* Size of DRAGINFO and DRAGITEMs *)
  176.       cbDragitem             : CARDINAL; (* size of DRAGITEM               *)
  177.       usOperation            : CARDINAL; (* current drag operation         *)
  178.       hwndSource             : HWND;     (* window handle of source        *)
  179.     | FALSE                  :
  180.       DraginfoSize           : LONGCARD; (* Size of DRAGINFO and DRAGITEMs *)
  181.       DragitemSize           : CARDINAL; (* size of DRAGITEM               *)
  182.       Operation              : CARDINAL; (* current drag operation         *)
  183.       SourceWinHandle        : HWND;     (* window handle of source        *)
  184.     END;
  185.     xDrop                    : INTEGER;  (* x coordinate of drop position  *)
  186.     yDrop                    : INTEGER;  (* y coordinate of drop position  *)
  187.     CASE                     : TYPEPREFIX OF
  188.     | TRUE                   :
  189.       cditem                 : CARDINAL; (* count of DRAGITEMs             *)
  190.       usReserved             : CARDINAL; (* reserved for future use        *)
  191.     | FALSE                  :
  192.       ItemCount              : CARDINAL; (* count of DRAGITEMs             *)
  193.       Reserved               : CARDINAL; (* reserved for future use        *)
  194.     END;                     END;
  195.   PDRAGINFO                = POINTER TO DRAGINFO;
  196.  
  197. TYPE
  198.   DRAGIMAGE                = RECORD      (* dimg *)
  199.     CASE                     : TYPEPREFIX OF
  200.     | TRUE                   :
  201.       cb                     : CARDINAL; (* size control block             *)
  202.       cptl                   : CARDINAL; (* count of pts, if DRG_POLYGON   *)
  203.       hImage                 : LHANDLE;  (* image handle passed to DrgDrag *)
  204.       sizlStretch            : SIZEL;    (* size to strecth ico or bmp to  *)
  205.       fl                     : LONGCARD; (* flags passed to DrgDrag        *)
  206.       cxOffset               : INTEGER;  (* x offset of the origin of the  *)
  207.                                          (*   image from the mouse hotspot *)
  208.       cyOffset               : INTEGER;  (* y offset of the origin of the  *)
  209.                                          (*   image from the mouse hotspot *)
  210.     | FALSE                  :
  211.       Size                   : CARDINAL; (* size control block             *)
  212.       PointCount             : CARDINAL; (* count of pts, if DRG_POLYGON   *)
  213.       ImageHandle            : LHANDLE;  (* image handle passed to DrgDrag *)
  214.       StretchSize            : SIZEL;    (* size to strecth ico or bmp to  *)
  215.       Flags                  : LONGCARD; (* flags passed to DrgDrag        *)
  216.       xOffset                : INTEGER;  (* x offset of the origin of the  *)
  217.                                          (*   image from the mouse hotspot *)
  218.       yOffset                : INTEGER;  (* y offset of the origin of the  *)
  219.                                          (*   image from the mouse hotspot *)
  220.     END;                     END;
  221.   PDRAGIMAGE               = POINTER TO DRAGIMAGE;
  222.  
  223. TYPE
  224.   DRAGTRANSFER             = RECORD      (* dxfer *)
  225.     CASE                     : TYPEPREFIX OF
  226.     | TRUE                   :
  227.       cb                     : LONGCARD; (* size of control block          *)
  228.       hwndClient             : HWND;     (* handle of target               *)
  229.       pditem                 : PDRAGITEM;(* DRAGITEM being transferred     *)
  230.       hstrSelectedRMF        : HSTR;     (* rendering mech & fmt of choice *)
  231.       hstrRenderToName       : HSTR;     (* name source will use           *)
  232.       ulTargetInfo           : LONGCARD; (* reserved for target's use      *)
  233.       usOperation            : CARDINAL; (* operation being performed      *)
  234.       fsReply                : CARDINAL; (* reply flags                    *)
  235.     | FALSE                  :
  236.       Size                   : LONGCARD; (* size of control block          *)
  237.       ClientWinHandle        : HWND;     (* handle of target               *)
  238.       DragItem               : PDRAGITEM;(* DRAGITEM being transferred     *)
  239.       SelectedRMFStrHandle   : HSTR;     (* rendering mech & fmt of choice *)
  240.       RenderToNameStrHandle  : HSTR;     (* name source will use           *)
  241.       TargetInfo             : LONGCARD; (* reserved for target's use      *)
  242.       Operation              : CARDINAL; (* operation being performed      *)
  243.       ReplyFlags             : CARDINAL; (* reply flags                    *)
  244.     END;                     END;
  245.   PDRAGTRANSFER            = POINTER TO DRAGTRANSFER;
  246.  
  247. TYPE
  248.   RENDERFILE               = RECORD      (* rndf *)
  249.     CASE                     : TYPEPREFIX OF
  250.     | TRUE                   :
  251.       hwndDragFiles          : HWND;     (* conversation window            *)
  252.       hstrSource             : HSTR;     (* handle to source file name     *)
  253.       hstrTarget             : HSTR;     (* handle to target file name     *)
  254.       fMove                  : CARDINAL; (* TRUE - move, FALSE - copy      *)
  255.       usRsvd                 : CARDINAL; (* reserved                       *)
  256.     | FALSE                  :
  257.       DragFilesWinHandle     : HWND;     (* conversation window            *)
  258.       SourceStrHandle        : HSTR;     (* handle to source file name     *)
  259.       TargetStrHandle        : HSTR;     (* handle to target file name     *)
  260.       MoveFlag               : CARDINAL; (* TRUE - move, FALSE - copy      *)
  261.       Reserved               : CARDINAL; (* reserved                       *)
  262.     END;                     END;
  263.   PRENDERFILE              = POINTER TO RENDERFILE;
  264.  
  265. PROCEDURE DrgAcceptDroppedFiles
  266. ( WinHandle                : HWND;
  267.   Path                     : PSZ;
  268.   Types                    : PSZ;
  269.   DefaultOp                : LONGCARD;
  270.   Reserved                 : LONGCARD
  271. )                          : BOOLEAN;
  272.  
  273. PROCEDURE DrgAllocDraginfo
  274. ( DragItemCount            : LONGCARD
  275. )                          : PDRAGINFO;
  276.  
  277. PROCEDURE DrgAllocDragtransfer
  278. ( DragTransferCount        : LONGCARD
  279. )                          : PDRAGTRANSFER;
  280.  
  281. PROCEDURE DrgDrag
  282. ( SourceWinHandle          : HWND;
  283.   VAR DragInfo             : DRAGINFO;
  284.   VAR DragImage            : ARRAY OF DRAGIMAGE;
  285.   DragImageCount           : LONGCARD;
  286.   TerminateButton          : LONGINT;
  287.   Reserved                 : SYSTEM.ADDRESS
  288. )                          : HWND;
  289.  
  290. PROCEDURE DrgDragFiles
  291. ( WinHandle                : HWND;
  292.   VAR Files                : ARRAY OF PSZ;
  293.   VAR Types                : ARRAY OF PSZ;
  294.   VAR Targets              : ARRAY OF PSZ;
  295.   FilesCount               : LONGCARD;
  296.   DragPointerHandle        : HPOINTER;
  297.   TerminateButton          : LONGCARD;
  298.   SourceRenderFlag         : BOOLEAN;
  299.   Reserved                 : LONGCARD
  300. )                          : BOOLEAN;
  301.  
  302. PROCEDURE DrgPostTransferMsg
  303. ( WinHandle                : HWND;
  304.   MsgId                    : LONGCARD;
  305.   VAR DragTransfer         : DRAGTRANSFER;
  306.   Flags                    : LONGCARD;
  307.   Reserved                 : LONGCARD;
  308.   Retry                    : BOOLEAN
  309. )                          : BOOLEAN;
  310.  
  311. PROCEDURE DrgQueryDragitem
  312. ( VAR DragInfo             : DRAGINFO;
  313.   BufferSize               : LONGCARD;
  314.   VAR DragItem             : DRAGITEM;
  315.   ItemIndex                : LONGCARD
  316. )                          : BOOLEAN;
  317.  
  318. PROCEDURE DrgQueryDragitemCount
  319. ( VAR DragInfo             : DRAGINFO
  320. )                          : LONGCARD;
  321.  
  322. PROCEDURE DrgQueryDragitemPtr
  323. ( VAR DragInfo             : DRAGINFO;
  324.   Index                    : LONGCARD
  325. )                          : PDRAGITEM;
  326.  
  327. PROCEDURE DrgQueryNativeRMF
  328. ( VAR DragItem             : DRAGITEM;
  329.   BufferSize               : LONGCARD;
  330.   VAR Buffer               : ARRAY OF CHAR
  331. )                          : BOOLEAN;
  332.  
  333. PROCEDURE DrgQueryNativeRMFLen
  334. ( VAR DragItem             : DRAGITEM
  335. )                          : LONGCARD;
  336.  
  337. PROCEDURE DrgQueryStrName
  338. ( StrHandle                : HSTR;
  339.   BufferSize               : LONGCARD;
  340.   VAR Buffer               : ARRAY OF CHAR
  341. )                          : LONGCARD;
  342.  
  343. PROCEDURE DrgQueryStrNameLen
  344. ( StrHandle                : HSTR
  345. )                          : LONGCARD;
  346.  
  347. PROCEDURE DrgQueryTrueType
  348. ( VAR DragItem             : DRAGITEM;
  349.   BufferSize               : LONGCARD;
  350.   VAR Buffer               : ARRAY OF CHAR
  351. )                          : BOOLEAN;
  352.  
  353. PROCEDURE DrgQueryTrueTypeLen
  354. ( VAR DragItem             : DRAGITEM
  355. )                          : LONGCARD;
  356.  
  357. PROCEDURE DrgSendTransferMsg
  358. ( WinHandle                : HWND;
  359.   MsgId                    : LONGCARD;
  360.   Param1                   : MPARAM;
  361.   Param2                   : MPARAM
  362. )                          : MRESULT;
  363.  
  364. PROCEDURE DrgSetDragitem
  365. ( VAR DragInfo             : DRAGINFO;
  366.   VAR DragItem             : DRAGITEM;
  367.   BufferSize               : LONGCARD;
  368.   DragItemIndex            : LONGCARD
  369. )                          : BOOLEAN;
  370.  
  371. PROCEDURE DrgSetDragImage
  372. ( VAR DragInfo             : DRAGINFO;
  373.   VAR DragImage            : DRAGIMAGE;
  374.   DragImageSize            : LONGCARD;
  375.   Reserved                 : SYSTEM.ADDRESS
  376. )                          : BOOLEAN;
  377.  
  378. PROCEDURE DrgVerifyTypeSet
  379. ( VAR DragItem             : DRAGITEM;
  380.   TypeStr                  : ARRAY OF CHAR;
  381.   BufferSize               : LONGCARD;
  382.   VAR Buffer               : ARRAY OF CHAR
  383. )                          : BOOLEAN;
  384.  
  385. PROCEDURE DrgAccessDraginfo
  386. ( VAR DragInfo             : DRAGINFO
  387. )                          : BOOLEAN;
  388.  
  389. PROCEDURE DrgAddStrHandle
  390. ( String                   : ARRAY OF CHAR
  391. )                          : HSTR;
  392.  
  393. PROCEDURE DrgDeleteDraginfoStrHandles
  394. ( VAR DragInfo             : DRAGINFO
  395. )                          : BOOLEAN;
  396.  
  397. PROCEDURE DrgDeleteStrHandle
  398. ( StrHandle                : HSTR
  399. )                          : BOOLEAN;
  400.  
  401. PROCEDURE DrgFreeDraginfo
  402. ( VAR DragInfo             : DRAGINFO
  403. )                          : BOOLEAN;
  404.  
  405. PROCEDURE DrgFreeDragtransfer
  406. ( DragTransfer             : PDRAGTRANSFER
  407. )                          : BOOLEAN;
  408.  
  409. PROCEDURE DrgGetPS
  410. ( WinHandle                : HWND
  411. )                          : HPS;
  412.  
  413. PROCEDURE DrgPushDraginfo
  414. ( VAR DragInfo             : DRAGINFO;
  415.   DestWinHandle            : HWND
  416. )                          : BOOLEAN;
  417.  
  418. PROCEDURE DrgReleasePS
  419. ( PresSpaceHandle          : HPS
  420. )                          : BOOLEAN;
  421.  
  422. PROCEDURE DrgSetDragPointer
  423. ( VAR DragInfo             : DRAGINFO;
  424.   PointerHandle            : HPOINTER
  425. )                          : BOOLEAN;
  426.  
  427. PROCEDURE DrgVerifyNativeRMF
  428. ( VAR DragItem             : DRAGITEM;
  429.   RMFString                : ARRAY OF CHAR
  430. )                          : BOOLEAN;
  431.  
  432. PROCEDURE DrgVerifyRMF
  433. ( VAR DragItem             : DRAGITEM;
  434.   MechStr                  : ARRAY OF CHAR;
  435.   FormatStr                : ARRAY OF CHAR
  436. )                          : BOOLEAN;
  437.  
  438. PROCEDURE DrgVerifyTrueType
  439. ( VAR DragItem             : DRAGITEM;
  440.   TypeStr                  : ARRAY OF CHAR
  441. )                          : BOOLEAN;
  442.  
  443. PROCEDURE DrgVerifyType
  444. ( VAR DragItem             : DRAGITEM;
  445.   TypeStr                  : ARRAY OF CHAR
  446. )                          : BOOLEAN;
  447.  
  448. END WINSTDDRAG.
  449.