| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | #ifndef _XtselectionI_h |
| 49 | #define _XtselectionI_h |
| 50 | |
| 51 | #include "Intrinsic.h" |
| 52 | |
| 53 | typedef struct _RequestRec *Request; |
| 54 | typedef struct _SelectRec *Select; |
| 55 | |
| 56 | typedef struct _RequestRec { |
| 57 | Select ctx; |
| 58 | Widget widget; |
| 59 | Window requestor; |
| 60 | Atom property; |
| 61 | Atom target; |
| 62 | Atom type; |
| 63 | int format; |
| 64 | XtPointer value; |
| 65 | unsigned long bytelength; |
| 66 | unsigned long offset; |
| 67 | XtIntervalId timeout; |
| 68 | XSelectionRequestEvent event; |
| 69 | Boolean allSent; |
| 70 | } RequestRec; |
| 71 | |
| 72 | typedef struct { |
| 73 | Atom prop; |
| 74 | Boolean avail; |
| 75 | } SelectionPropRec, *SelectionProp; |
| 76 | |
| 77 | typedef struct { |
| 78 | Display *dpy; |
| 79 | Atom incr_atom, indirect_atom, timestamp_atom; |
| 80 | int propCount; |
| 81 | SelectionProp list; |
| 82 | } PropListRec, *PropList; |
| 83 | |
| 84 | typedef struct _SelectRec { |
| 85 | Atom selection; |
| 86 | Display *dpy; |
| 87 | Widget widget; |
| 88 | Time time; |
| 89 | unsigned long serial; |
| 90 | XtConvertSelectionProc convert; |
| 91 | XtLoseSelectionProc loses; |
| 92 | XtSelectionDoneProc notify; |
| 93 | XtCancelConvertSelectionProc owner_cancel; |
| 94 | XtPointer owner_closure; |
| 95 | PropList prop_list; |
| 96 | Request req; |
| 97 | int ref_count; |
| 98 | unsigned int incremental:1; |
| 99 | unsigned int free_when_done:1; |
| 100 | unsigned int was_disowned:1; |
| 101 | } SelectRec; |
| 102 | |
| 103 | typedef struct _ParamRec { |
| 104 | Atom selection; |
| 105 | Atom param; |
| 106 | } ParamRec, *Param; |
| 107 | |
| 108 | typedef struct _ParamInfoRec { |
| 109 | unsigned int count; |
| 110 | Param paramlist; |
| 111 | } ParamInfoRec, *ParamInfo; |
| 112 | |
| 113 | typedef struct _QueuedRequestRec { |
| 114 | Atom selection; |
| 115 | Atom target; |
| 116 | Atom param; |
| 117 | XtSelectionCallbackProc callback; |
| 118 | XtPointer closure; |
| 119 | Time time; |
| 120 | Boolean incremental; |
| 121 | } QueuedRequestRec, *QueuedRequest; |
| 122 | |
| 123 | typedef struct _QueuedRequestInfoRec { |
| 124 | int count; |
| 125 | Atom *selections; |
| 126 | QueuedRequest *requests; |
| 127 | } QueuedRequestInfoRec, *QueuedRequestInfo; |
| 128 | |
| 129 | typedef struct { |
| 130 | XtSelectionCallbackProc *callbacks; |
| 131 | XtPointer *req_closure; |
| 132 | Atom property; |
| 133 | Atom *target; |
| 134 | Atom type; |
| 135 | int format; |
| 136 | char *value; |
| 137 | int bytelength; |
| 138 | int offset; |
| 139 | XtIntervalId timeout; |
| 140 | XtEventHandler proc; |
| 141 | Widget widget; |
| 142 | Time time; |
| 143 | Select ctx; |
| 144 | Boolean *incremental; |
| 145 | int current; |
| 146 | } CallBackInfoRec, *CallBackInfo; |
| 147 | |
| 148 | typedef struct { |
| 149 | Atom target; |
| 150 | Atom property; |
| 151 | } IndirectPair; |
| 152 | |
| 153 | #define IndirectPairWordSize 2 |
| 154 | |
| 155 | typedef struct { |
| 156 | int active_transfer_count; |
| 157 | } RequestWindowRec; |
| 158 | |
| 159 | #define MAX_SELECTION_INCR(dpy) (((65536 < XMaxRequestSize(dpy)) ? \ |
| 160 | (65536 << 2) : (XMaxRequestSize(dpy) << 2))-100) |
| 161 | |
| 162 | #define MATCH_SELECT(event, info) ((event->time == info->time) && \ |
| 163 | (event->requestor == XtWindow(info->widget)) && \ |
| 164 | (event->selection == info->ctx->selection) && \ |
| 165 | (event->target == *info->target)) |
| 166 | |
| 167 | #endif |
| 168 | |