Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:24

0001 /* 
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022 */ 
0023 
0024 #ifndef _XmDragController_h
0025 #define _XmDragController_h
0026 
0027 #include <Xm/Xm.h>
0028 #include <Xm/Display.h>
0029 
0030 #ifdef __cplusplus
0031 extern "C" {
0032 #endif
0033 
0034 
0035 /* defines for the dragFinish completionStatus field */
0036 
0037 #define XmHELP          2
0038 
0039 /*
0040  * Some global stuff that will go into Xm.h
0041  */
0042 typedef unsigned int    XmID;
0043 
0044 /***********************************************************************
0045  *
0046  * DragContext
0047  *
0048  ***********************************************************************/
0049 
0050 #ifndef XmIsDragContext
0051 #define XmIsDragContext(w) XtIsSubclass(w,xmDragContextClass)
0052 #endif /* XmIsDragContext */
0053 
0054 #ifndef _XA_MOTIF_DROP
0055 #define _XA_MOTIF_DROP "_MOTIF_DROP"
0056 #define _XA_DRAG_FAILURE "_MOTIF_DRAG_FAILURE"
0057 #define _XA_DRAG_SUCCESS "_MOTIF_DRAG_SUCCESS"
0058 #endif /* _XA_MOTIF_DROP */
0059 
0060 
0061 /* enums used for the message_type in client messages */
0062 
0063 enum{   XmTOP_LEVEL_ENTER,      XmTOP_LEVEL_LEAVE,
0064     XmDRAG_MOTION,          XmDROP_SITE_ENTER,
0065     XmDROP_SITE_LEAVE,      XmDROP_START,
0066     XmDROP_FINISH,          XmDRAG_DROP_FINISH,
0067     XmOPERATION_CHANGED
0068     } ;
0069 
0070 /* enums for completionStatus */
0071 enum{   XmDROP,             XmDROP_HELP,
0072     XmDROP_CANCEL,          XmDROP_INTERRUPT
0073     } ;
0074 
0075 /* values for operation */
0076 #define XmDROP_NOOP 0L
0077 #define XmDROP_MOVE     (1L << 0)
0078 #define XmDROP_COPY (1L << 1)
0079 #define XmDROP_LINK (1L << 2)
0080 
0081 enum{   XmMOVE = XmDROP_MOVE,       XmCOPY = XmDROP_COPY, 
0082     XmLINK = XmDROP_LINK,       XmOTHER
0083     } ;
0084 
0085 enum{   XmBLEND_ALL,            XmBLEND_STATE_SOURCE,
0086     XmBLEND_JUST_SOURCE,        XmBLEND_NONE
0087     } ;
0088 
0089 enum{   XmDROP_FAILURE,         XmDROP_SUCCESS
0090     } ;
0091 
0092 
0093 /* enums used for the public callback reason */
0094 
0095 enum{   XmCR_TOP_LEVEL_ENTER,       XmCR_TOP_LEVEL_LEAVE,
0096     XmCR_DRAG_MOTION,       XmCR_DROP_SITE_ENTER,
0097     XmCR_DROP_SITE_LEAVE,       XmCR_DROP_START,
0098     XmCR_DROP_FINISH,       XmCR_DRAG_DROP_FINISH,
0099     XmCR_OPERATION_CHANGED,
0100 
0101     _XmNUMBER_DND_CB_REASONS
0102     } ;
0103 
0104 
0105 /* Class record constants */
0106 typedef struct _XmDragContextClassRec   *XmDragContextClass;
0107 typedef struct _XmDragContextRec    *XmDragContext;
0108 externalref WidgetClass xmDragContextClass;
0109 
0110 typedef struct _XmAnyICCCallbackStruct{
0111     int             reason;
0112     XEvent              *event;
0113     Time                timeStamp;
0114 }XmAnyICCCallbackStruct, *XmAnyICCCallback;
0115 
0116 typedef struct _XmTopLevelEnterCallbackStruct{
0117     int             reason;
0118     XEvent              *event;
0119     Time                timeStamp;
0120     Screen      *screen;
0121     /*
0122      * the window field is different if this is an outbound or inbound
0123      * callback. Outbound == reciever, Inbound == initiator.
0124      */
0125     Window      window;
0126     Position        x, y;
0127     unsigned char   dragProtocolStyle;
0128     Atom        iccHandle;
0129 }XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback;
0130 
0131 typedef struct _XmTopLevelLeaveCallbackStruct{
0132     int             reason;
0133     XEvent              *event;
0134     Time                timeStamp;
0135     Screen      *screen;
0136     Window      window;
0137 }XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback;
0138 
0139 /* 
0140  * this message is sent from the receiver to the initiator to
0141  * indicate that the motion message with the associated timestamp has
0142  * caused a drop-site to be entered
0143  */
0144 typedef struct _XmDropSiteEnterCallbackStruct{
0145     int             reason;
0146     XEvent              *event;
0147     Time                timeStamp;
0148     unsigned char   operation;
0149     unsigned char   operations;
0150     unsigned char   dropSiteStatus;
0151     Position        x, y;
0152 }XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback;
0153 
0154 /* 
0155  * this message is sent from the receiver to the initiator to
0156  * indicate that the motion message with the associated timestamp has
0157  * caused a drop-site to be left
0158  */
0159 typedef struct _XmDropSiteLeaveCallbackStruct{
0160     int             reason;
0161     XEvent              *event;
0162     Time                timeStamp;
0163 }XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback;
0164 
0165 typedef struct _XmDragMotionCallbackStruct{
0166     int             reason;
0167     XEvent              *event;
0168     Time                timeStamp;
0169     unsigned char   operation;
0170     unsigned char   operations;
0171     unsigned char   dropSiteStatus;
0172     Position        x, y;
0173 }XmDragMotionCallbackStruct, *XmDragMotionCallback;
0174 
0175 typedef struct _XmOperationChangedCallbackStruct{
0176     int             reason;
0177     XEvent              *event;
0178     Time                timeStamp;
0179     unsigned char   operation;
0180     unsigned char   operations;
0181     unsigned char   dropSiteStatus;
0182 }XmOperationChangedCallbackStruct, *XmOperationChangedCallback;
0183 
0184 typedef struct _XmDropStartCallbackStruct{
0185     int             reason;
0186     XEvent              *event;
0187     Time                timeStamp;
0188     unsigned char   operation;
0189     unsigned char   operations;
0190     unsigned char   dropSiteStatus;
0191     unsigned char   dropAction;
0192     Position        x, y;
0193     Window      window;
0194     Atom        iccHandle;
0195 }XmDropStartCallbackStruct, *XmDropStartCallback;
0196 
0197 typedef struct _XmDropFinishCallbackStruct{
0198     int             reason;
0199     XEvent              *event;
0200     Time                timeStamp;
0201     unsigned char   operation;
0202     unsigned char   operations;
0203     unsigned char   dropSiteStatus;
0204     unsigned char   dropAction;
0205     unsigned char   completionStatus;
0206 }XmDropFinishCallbackStruct, *XmDropFinishCallback;
0207 
0208 typedef struct _XmDragDropFinishCallbackStruct{
0209     int             reason;
0210     XEvent              *event;
0211     Time                timeStamp;
0212 }XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback;
0213 
0214 
0215 /********    Public Function Declarations    ********/
0216 
0217 extern Widget XmDragStart( 
0218                         Widget w,
0219                         XEvent *event,
0220                         ArgList args,
0221                         Cardinal numArgs) ;
0222 extern void XmDragCancel( 
0223                         Widget dragContext) ;
0224 extern Boolean XmTargetsAreCompatible( 
0225                         Display *dpy,
0226                         Atom *exportTargets,
0227                         Cardinal numExportTargets,
0228                         Atom *importTargets,
0229                         Cardinal numImportTargets) ;
0230 
0231 /********    End Public Function Declarations    ********/
0232 
0233 
0234 #ifdef __cplusplus
0235 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0236 #endif
0237 
0238 #endif /* _DragController_h */
0239 /* DON'T ADD STUFF AFTER THIS #endif */