1: /** 2: * 3: * $Id: DragC.h,v 1.3 2000/09/23 14:51:40 amai Exp $ 4: * 5: * Copyright (C) 1995 Free Software Foundation, Inc. 6: * Copyright (C) 1995-2000 LessTif Development Team 7: * 8: * This file is part of the GNU LessTif Library. 9: * 10: * This library is free software; you can redistribute it and/or 11: * modify it under the terms of the GNU Library General Public 12: * License as published by the Free Software Foundation; either 13: * version 2 of the License, or (at your option) any later version. 14: * 15: * This library is distributed in the hope that it will be useful, 16: * but WITHOUT ANY WARRANTY; without even the implied warranty of 17: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18: * Library General Public License for more details. 19: * 20: * You should have received a copy of the GNU Library General Public 21: * License along with this library; if not, write to the Free 22: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23: * 24: **/ 25: 26: #ifndef _XM_DRAGC_H 27: #define _XM_DRAGC_H 28: 29: #include <Xm/Xm.h> 30: #include <Xm/Display.h> 31: 32: #ifdef __cplusplus 33: extern "C" { 34: #endif 35: 36: #define XmHELP 2 37: 38: typedef unsigned int XmID; 39: 40: #ifndef XmIsDragContext 41: #define XmIsDragContext(w) XtIsSubclass(w, xmDragContextClass) 42: #endif 43: 44: #ifndef _XA_MOTIF_DROP 45: #define _XA_MOTIF_DROP "_MOTIF_DROP" 46: #define _XA_DRAG_FAILURE "_MOTIF_DRAG_FAILURE" 47: #define _XA_DRAG_SUCCESS "_MOTIF_DRAG_SUCCESS" 48: #endif 49: 50: /* values used in the message type for the ClientMessage we send */ 51: enum { 52: XmTOP_LEVEL_ENTER, 53: XmTOP_LEVEL_LEAVE, 54: XmDRAG_MOTION, 55: XmDROP_SITE_ENTER, 56: XmDROP_SITE_LEAVE, 57: XmDROP_START, 58: XmDROP_FINISH, 59: XmDRAG_DROP_FINISH, 60: XmOPERATION_CHANGED 61: }; 62: 63: /* values used for the completionStatus */ 64: enum { 65: XmDROP, 66: XmDROP_HELP, 67: XmDROP_CANCEL, 68: XmDROP_INTERRUPT 69: }; 70: 71: /* values for operations */ 72: 73: #define XmDROP_NOOP 0L 74: #define XmDROP_MOVE (1L << 0) 75: #define XmDROP_COPY (1L << 1) 76: #define XmDROP_LINK (1L << 2) 77: 78: /* enum for operation result */ 79: 80: enum { 81: XmDROP_FAILURE, 82: XmDROP_SUCCESS 83: }; 84: 85: /* values for blending */ 86: 87: enum { 88: XmBLEND_ALL, 89: XmBLEND_STATE_SOURCE, 90: XmBLEND_JUST_SOURCE, 91: XmBLEND_NONE 92: }; 93: 94: /* values sent for the public callback reasons */ 95: 96: enum { 97: XmCR_TOP_LEVEL_ENTER, 98: XmCR_TOP_LEVEL_LEAVE, 99: XmCR_DRAG_MOTION, 100: XmCR_DROP_SITE_ENTER, 101: XmCR_DROP_SITE_LEAVE, 102: XmCR_DROP_START, 103: XmCR_DROP_FINISH, 104: XmCR_DRAG_DROP_FINISH, 105: XmCR_OPERATION_CHANGED, 106: _XmNUMBER_DND_CB_REASONS 107: }; 108: 109: typedef struct _XmDragContextClassRec *XmDragContextClass; 110: typedef struct _XmDragContextRec *XmDragContext; 111: extern WidgetClass xmDragContextClass; 112: 113: typedef struct _XmAnyICCCallbackStruct { 114: int reason; 115: XEvent *event; 116: Time timeStamp; 117: } XmAnyICCCallbackStruct, *XmAnyICCCallback; 118: 119: typedef struct _XmTopLevelEnterCallbackStruct { 120: int reason; 121: XEvent *event; 122: Time timeStamp; 123: Screen *screen; 124: /* see DragC.h in Motif 1.2.3 for comment. line 106 */ 125: Window window; 126: Position x,y; 127: unsigned char dragProtocolStyle; 128: Atom iccHandle; 129: } XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback; 130: 131: typedef struct _XmTopLevelLeaveCallbackStruct { 132: int reason; 133: XEvent *event; 134: Time timeStamp; 135: Screen *screen; 136: Window window; 137: } XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback; 138: 139: /* this message is sent from the receive to the initiator to 140: * indicate that the motion message with the associated timestamp has 141: * caused a drop-site to be entered 142: */ 143: typedef struct _XmDropSiteEnterCallbackStruct { 144: int reason; 145: XEvent *event; 146: Time timeStamp; 147: unsigned char operation; 148: unsigned char operations; 149: unsigned char dropSiteStatus; 150: Position x, y; 151: } XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback; 152: 153: typedef struct _XmDropSiteLeaveCallbackStruct { 154: int reason; 155: XEvent *event; 156: Time timeStamp; 157: } XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback; 158: 159: typedef struct _XmDragMotionCallbackStruct { 160: int reason; 161: XEvent *event; 162: Time timeStamp; 163: unsigned char operation; 164: unsigned char operations; 165: unsigned char dropSiteStatus; 166: Position x, y; 167: } XmDragMotionCallbackStruct, *XmDragMotionCallback; 168: 169: typedef struct _XmOperationChangedCallbackStruct { 170: int reason; 171: XEvent *event; 172: Time timeStamp; 173: unsigned char operation; 174: unsigned char operations; 175: unsigned char dropSiteStatus; 176: } XmOperationChangedCallbackStruct, *XmOperationChangedCallback; 177: 178: typedef struct _XmDropStartCallbackStruct { 179: int reason; 180: XEvent *event; 181: Time timeStamp; 182: unsigned char operation; 183: unsigned char operations; 184: unsigned char dropSiteStatus; 185: unsigned char dropAction; 186: Position x, y; 187: Window window; 188: Atom iccHandle; 189: } XmDropStartCallbackStruct, *XmDropStartCallback; 190: 191: typedef struct _XmDropFinishCallbackStruct { 192: int reason; 193: XEvent *event; 194: Time timeStamp; 195: unsigned char operation; 196: unsigned char operations; 197: unsigned char dropSiteStatus; 198: unsigned char dropAction; 199: unsigned char completionStatus; 200: } XmDropFinishCallbackStruct, *XmDropFinishCallback; 201: 202: typedef struct _XmDragDropFinishCallbackStruct { 203: int reason; 204: XEvent *event; 205: Time timeStamp; 206: } XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback; 207: 208: /* public functions */ 209: 210: extern Widget XmDragStart(Widget w, 211: XEvent *event, 212: ArgList args, 213: Cardinal numArgs); 214: 215: extern void XmDragCancel(Widget dragContext); 216: 217: extern Boolean XmTargetsAreCompatible(Display *dpy, 218: Atom *exportTargets, 219: Cardinal numExportTargets, 220: Atom *importTargets, 221: Cardinal numImportTargets); 222: 223: #ifdef __cplusplus 224: } 225: #endif 226: 227: #endif /* _XM_DRAGC_H */ 228: