master
ブランチ master
ShaderPlayground / deps / xlibre / include / X11 / SelectionI.h
5.1 KB、168行 生 Blame 履歴
1/***********************************************************
2
3Copyright 1987, 1988, 1994, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25
26Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
27
28 All Rights Reserved
29
30Permission to use, copy, modify, and distribute this software and its
31documentation for any purpose and without fee is hereby granted,
32provided that the above copyright notice appear in all copies and that
33both that copyright notice and this permission notice appear in
34supporting documentation, and that the name of Digital not be
35used in advertising or publicity pertaining to distribution of the
36software without specific, written prior permission.
37
38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44SOFTWARE.
45
46******************************************************************/
47
48#ifndef _XtselectionI_h
49#define _XtselectionI_h
50
51#include "Intrinsic.h"
52
53typedef struct _RequestRec *Request;
54typedef struct _SelectRec *Select;
55
56typedef struct _RequestRec {
57 Select ctx; /* logical owner */
58 Widget widget; /* widget actually receiving Selection events */
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; /* for XtGetSelectionRequest */
69 Boolean allSent;
70} RequestRec;
71
72typedef struct {
73 Atom prop;
74 Boolean avail;
75} SelectionPropRec, *SelectionProp;
76
77typedef struct {
78 Display *dpy;
79 Atom incr_atom, indirect_atom, timestamp_atom;
80 int propCount;
81 SelectionProp list;
82} PropListRec, *PropList;
83
84typedef struct _SelectRec {
85 Atom selection; /* constant */
86 Display *dpy; /* constant */
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; /* state for local non-incr xfer */
97 int ref_count; /* of active transfers */
98 unsigned int incremental:1;
99 unsigned int free_when_done:1;
100 unsigned int was_disowned:1;
101} SelectRec;
102
103typedef struct _ParamRec {
104 Atom selection;
105 Atom param;
106} ParamRec, *Param;
107
108typedef struct _ParamInfoRec {
109 unsigned int count;
110 Param paramlist;
111} ParamInfoRec, *ParamInfo;
112
113typedef 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
123typedef struct _QueuedRequestInfoRec {
124 int count;
125 Atom *selections;
126 QueuedRequest *requests;
127} QueuedRequestInfoRec, *QueuedRequestInfo;
128
129typedef 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
148typedef struct {
149 Atom target;
150 Atom property;
151} IndirectPair;
152
153#define IndirectPairWordSize 2
154
155typedef 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 /* _XtselectionI_h */
168/* DON'T ADD STUFF AFTER THIS #endif */