home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / Xm / DragC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  6.3 KB  |  233 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.3
  7. */ 
  8. /*   $RCSfile: DragC.h,v $ $Revision: 10.1 $ $Date: 1994/02/03 15:36:44 $ */
  9. /*
  10. *  (c) Copyright 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  11. /* $Header: /s/xsrc/motif.CVS/motif/lib/Xm/DragC.h,v 10.1 1994/02/03 15:36:44 barrie Exp $ */
  12.  
  13. #ifndef _XmDragController_h
  14. #define _XmDragController_h
  15.  
  16. #include <Xm/Xm.h>
  17. #include <Xm/Display.h>
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23.  
  24. /* defines for the dragFinish completionStatus field */
  25.  
  26. #define XmHELP            2
  27.  
  28. /*
  29.  * Some global stuff that will go into Xm.h
  30.  */
  31. typedef unsigned int    XmID;
  32.  
  33. /***********************************************************************
  34.  *
  35.  * DragContext
  36.  *
  37.  ***********************************************************************/
  38.  
  39. #ifndef XmIsDragContext
  40. #define XmIsDragContext(w) XtIsSubclass(w,xmDragContextClass)
  41. #endif /* XmIsDragContext */
  42.  
  43. #ifndef _XA_MOTIF_DROP
  44. #define _XA_MOTIF_DROP "_MOTIF_DROP"
  45. #define _XA_DRAG_FAILURE "_MOTIF_DRAG_FAILURE"
  46. #define _XA_DRAG_SUCCESS "_MOTIF_DRAG_SUCCESS"
  47. #endif /* _XA_MOTIF_DROP */
  48.  
  49.  
  50. /* enums used for the message_type in client messages */
  51.  
  52. enum{    XmTOP_LEVEL_ENTER,        XmTOP_LEVEL_LEAVE,
  53.     XmDRAG_MOTION,            XmDROP_SITE_ENTER,
  54.     XmDROP_SITE_LEAVE,        XmDROP_START,
  55.     XmDROP_FINISH,            XmDRAG_DROP_FINISH,
  56.     XmOPERATION_CHANGED
  57.     } ;
  58.  
  59. /* enums for completionStatus */
  60. enum{    XmDROP,                XmDROP_HELP,
  61.     XmDROP_CANCEL,            XmDROP_INTERRUPT
  62.     } ;
  63.  
  64. /* values for operation */
  65. #define    XmDROP_NOOP    0L
  66. #define XmDROP_MOVE     (1L << 0)
  67. #define XmDROP_COPY    (1L << 1)
  68. #define XmDROP_LINK    (1L << 2)
  69.  
  70. enum{    XmBLEND_ALL,            XmBLEND_STATE_SOURCE,
  71.     XmBLEND_JUST_SOURCE,        XmBLEND_NONE
  72.     } ;
  73.  
  74. enum{      XmDROP_FAILURE,            XmDROP_SUCCESS
  75.     } ;
  76.  
  77.  
  78. /* enums used for the public callback reason */
  79.  
  80. enum{    XmCR_TOP_LEVEL_ENTER,        XmCR_TOP_LEVEL_LEAVE,
  81.     XmCR_DRAG_MOTION,        XmCR_DROP_SITE_ENTER,
  82.     XmCR_DROP_SITE_LEAVE,        XmCR_DROP_START,
  83.     XmCR_DROP_FINISH,        XmCR_DRAG_DROP_FINISH,
  84.     XmCR_OPERATION_CHANGED,
  85.  
  86.     _XmNUMBER_DND_CB_REASONS
  87.     } ;
  88.  
  89.  
  90. /* Class record constants */
  91. typedef struct _XmDragContextClassRec    *XmDragContextClass;
  92. typedef struct _XmDragContextRec    *XmDragContext;
  93. externalref WidgetClass xmDragContextClass;
  94.  
  95. typedef struct _XmAnyICCCallbackStruct{
  96.     int              reason;
  97.     XEvent              *event;
  98.     Time                timeStamp;
  99. }XmAnyICCCallbackStruct, *XmAnyICCCallback;
  100.  
  101. typedef struct _XmTopLevelEnterCallbackStruct{
  102.     int              reason;
  103.     XEvent              *event;
  104.     Time                timeStamp;
  105.     Screen        *screen;
  106.     /*
  107.      * the window field is different if this is an outbound or inbound
  108.      * callback. Outbound == reciever, Inbound == initiator.
  109.      */
  110.     Window        window;
  111.     Position        x, y;
  112.     unsigned char    dragProtocolStyle;
  113.     Atom        iccHandle;
  114. }XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback;
  115.  
  116. typedef struct _XmTopLevelLeaveCallbackStruct{
  117.     int              reason;
  118.     XEvent              *event;
  119.     Time                timeStamp;
  120.     Screen        *screen;
  121.     Window        window;
  122. }XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback;
  123.  
  124. /* 
  125.  * this message is sent from the receiver to the initiator to
  126.  * indicate that the motion message with the associated timestamp has
  127.  * caused a drop-site to be entered
  128.  */
  129. typedef struct _XmDropSiteEnterCallbackStruct{
  130.     int              reason;
  131.     XEvent              *event;
  132.     Time                timeStamp;
  133.     unsigned char    operation;
  134.     unsigned char    operations;
  135.     unsigned char    dropSiteStatus;
  136.     Position        x, y;
  137. }XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback;
  138.  
  139. /* 
  140.  * this message is sent from the receiver to the initiator to
  141.  * indicate that the motion message with the associated timestamp has
  142.  * caused a drop-site to be left
  143.  */
  144. typedef struct _XmDropSiteLeaveCallbackStruct{
  145.     int              reason;
  146.     XEvent              *event;
  147.     Time                timeStamp;
  148. }XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback;
  149.  
  150. typedef struct _XmDragMotionCallbackStruct{
  151.     int              reason;
  152.     XEvent              *event;
  153.     Time                timeStamp;
  154.     unsigned char    operation;
  155.     unsigned char    operations;
  156.     unsigned char    dropSiteStatus;
  157.     Position        x, y;
  158. }XmDragMotionCallbackStruct, *XmDragMotionCallback;
  159.  
  160. typedef struct _XmOperationChangedCallbackStruct{
  161.     int              reason;
  162.     XEvent              *event;
  163.     Time                timeStamp;
  164.     unsigned char    operation;
  165.     unsigned char    operations;
  166.     unsigned char    dropSiteStatus;
  167. }XmOperationChangedCallbackStruct, *XmOperationChangedCallback;
  168.  
  169. typedef struct _XmDropStartCallbackStruct{
  170.     int              reason;
  171.     XEvent              *event;
  172.     Time                timeStamp;
  173.     unsigned char    operation;
  174.     unsigned char    operations;
  175.     unsigned char    dropSiteStatus;
  176.     unsigned char    dropAction;
  177.     Position        x, y;
  178.     Window        window;
  179.     Atom        iccHandle;
  180. }XmDropStartCallbackStruct, *XmDropStartCallback;
  181.  
  182. typedef struct _XmDropFinishCallbackStruct{
  183.     int              reason;
  184.     XEvent              *event;
  185.     Time                timeStamp;
  186.     unsigned char    operation;
  187.     unsigned char    operations;
  188.     unsigned char    dropSiteStatus;
  189.     unsigned char    dropAction;
  190.     unsigned char    completionStatus;
  191. }XmDropFinishCallbackStruct, *XmDropFinishCallback;
  192.  
  193. typedef struct _XmDragDropFinishCallbackStruct{
  194.     int              reason;
  195.     XEvent              *event;
  196.     Time                timeStamp;
  197. }XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback;
  198.  
  199.  
  200. /********    Public Function Declarations    ********/
  201. #ifdef _NO_PROTO
  202.  
  203. extern Widget XmDragStart() ;
  204. extern void XmDragCancel() ;
  205. extern Boolean XmTargetsAreCompatible() ;
  206.  
  207. #else
  208.  
  209. extern Widget XmDragStart( 
  210.                         Widget w,
  211.                         XEvent *event,
  212.                         ArgList args,
  213.                         Cardinal numArgs) ;
  214. extern void XmDragCancel( 
  215.                         Widget dragContext) ;
  216. extern Boolean XmTargetsAreCompatible( 
  217.                         Display *dpy,
  218.                         Atom *exportTargets,
  219.                         Cardinal numExportTargets,
  220.                         Atom *importTargets,
  221.                         Cardinal numImportTargets) ;
  222.  
  223. #endif /* _NO_PROTO */
  224. /********    End Public Function Declarations    ********/
  225.  
  226.  
  227. #ifdef __cplusplus
  228. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  229. #endif
  230.  
  231. #endif /* _DragController_h */
  232. /* DON'T ADD STUFF AFTER THIS #endif */
  233.