CallbackI.h revision 2265a131
1444c061aSmrg/* $Xorg: CallbackI.h,v 1.4 2001/02/09 02:03:54 xorgcvs Exp $ */
2444c061aSmrg/***********************************************************
3444c061aSmrg
4444c061aSmrgCopyright 1987, 1988, 1998  The Open Group
5444c061aSmrg
6444c061aSmrgPermission to use, copy, modify, distribute, and sell this software and its
7444c061aSmrgdocumentation for any purpose is hereby granted without fee, provided that
8444c061aSmrgthe above copyright notice appear in all copies and that both that
9444c061aSmrgcopyright notice and this permission notice appear in supporting
10444c061aSmrgdocumentation.
11444c061aSmrg
12444c061aSmrgThe above copyright notice and this permission notice shall be included in
13444c061aSmrgall copies or substantial portions of the Software.
14444c061aSmrg
15444c061aSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16444c061aSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17444c061aSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18444c061aSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19444c061aSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20444c061aSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21444c061aSmrg
22444c061aSmrgExcept as contained in this notice, the name of The Open Group shall not be
23444c061aSmrgused in advertising or otherwise to promote the sale, use or other dealings
24444c061aSmrgin this Software without prior written authorization from The Open Group.
25444c061aSmrg
26444c061aSmrg
27444c061aSmrgCopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
28444c061aSmrg
29444c061aSmrg                        All Rights Reserved
30444c061aSmrg
31444c061aSmrgPermission to use, copy, modify, and distribute this software and its
32444c061aSmrgdocumentation for any purpose and without fee is hereby granted,
33444c061aSmrgprovided that the above copyright notice appear in all copies and that
34444c061aSmrgboth that copyright notice and this permission notice appear in
35444c061aSmrgsupporting documentation, and that the name of Digital not be
36444c061aSmrgused in advertising or publicity pertaining to distribution of the
37444c061aSmrgsoftware without specific, written prior permission.
38444c061aSmrg
39444c061aSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40444c061aSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41444c061aSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42444c061aSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43444c061aSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44444c061aSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45444c061aSmrgSOFTWARE.
46444c061aSmrg
47444c061aSmrg******************************************************************/
48444c061aSmrg/* $XFree86$ */
49444c061aSmrg
50444c061aSmrg/****************************************************************
51444c061aSmrg *
52444c061aSmrg * Callbacks
53444c061aSmrg *
54444c061aSmrg ****************************************************************/
55444c061aSmrg
56444c061aSmrgtypedef XrmResource **CallbackTable;
57444c061aSmrg
58444c061aSmrg#define _XtCBCalling 1
59444c061aSmrg#define _XtCBFreeAfterCalling 2
60444c061aSmrg
612265a131Smrg_XFUNCPROTOBEGIN
622265a131Smrg
63444c061aSmrgtypedef struct internalCallbackRec {
64444c061aSmrg    unsigned short count;
65444c061aSmrg    char	   is_padded;	/* contains NULL padding for external form */
66444c061aSmrg    char	   call_state;  /* combination of _XtCB{FreeAfter}Calling */
67444c061aSmrg#ifdef LONG64
68444c061aSmrg    unsigned int   align_pad;	/* padding to align callback list */
69444c061aSmrg#endif
70444c061aSmrg    /* XtCallbackList */
71444c061aSmrg} InternalCallbackRec, *InternalCallbackList;
72444c061aSmrg
73444c061aSmrgtypedef Boolean (*_XtConditionProc)(
74444c061aSmrg    XtPointer	/* data */
75444c061aSmrg);
76444c061aSmrg
77444c061aSmrgextern void _XtAddCallback(
78444c061aSmrg    InternalCallbackList*	/* callbacks */,
79444c061aSmrg    XtCallbackProc		/* callback */,
80444c061aSmrg    XtPointer 			/* closure */
81444c061aSmrg);
82444c061aSmrg
83444c061aSmrgextern void _XtAddCallbackOnce(
84444c061aSmrg    InternalCallbackList*	/* callbacks */,
85444c061aSmrg    XtCallbackProc		/* callback */,
86444c061aSmrg    XtPointer 			/* closure */
87444c061aSmrg);
88444c061aSmrg
89444c061aSmrgextern InternalCallbackList _XtCompileCallbackList(
90444c061aSmrg    XtCallbackList		/* xtcallbacks */
91444c061aSmrg);
92444c061aSmrg
93444c061aSmrgextern XtCallbackList _XtGetCallbackList(
94444c061aSmrg    InternalCallbackList*	/* callbacks */
95444c061aSmrg);
96444c061aSmrg
97444c061aSmrgextern void _XtRemoveAllCallbacks(
98444c061aSmrg    InternalCallbackList*	/* callbacks */
99444c061aSmrg);
100444c061aSmrg
101444c061aSmrgextern void _XtRemoveCallback(
102444c061aSmrg    InternalCallbackList*	/* callbacks */,
103444c061aSmrg    XtCallbackProc		/* callback */,
104444c061aSmrg    XtPointer			/* closure */
105444c061aSmrg);
106444c061aSmrg
107444c061aSmrgextern void _XtPeekCallback(
108444c061aSmrg    Widget			/* widget */,
109444c061aSmrg    XtCallbackList		/* callbacks */,
110444c061aSmrg    XtCallbackProc *		/* callback */,
111444c061aSmrg    XtPointer *			/* closure */
112444c061aSmrg);
113444c061aSmrg
114444c061aSmrgextern void _XtCallConditionalCallbackList(
115444c061aSmrg    Widget			/* widget */,
116444c061aSmrg    XtCallbackList		/* callbacks */,
117444c061aSmrg    XtPointer			/* call_data */,
118444c061aSmrg    _XtConditionProc		/* cond_proc */
119444c061aSmrg);
1202265a131Smrg
1212265a131Smrg_XFUNCPROTOEND
122