Selection.c revision 4456fccd
1/*
2 * $XFree86: xc/lib/Xfixes/Selection.c,v 1.1 2002/11/30 06:21:45 keithp Exp $
3 *
4 * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission.  Keith Packard makes no
13 * representations about the suitability of this software for any purpose.  It
14 * is provided "as is" without express or implied warranty.
15 *
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 */
24
25#ifdef HAVE_CONFIG_H
26#include <config.h>
27#endif
28#include "Xfixesint.h"
29
30void
31XFixesSelectSelectionInput (Display	    *dpy,
32			    Window	    win,
33			    Atom	    selection,
34			    unsigned long   eventMask)
35{
36    XFixesExtDisplayInfo	    *info = XFixesFindDisplay (dpy);
37    xXFixesSelectSelectionInputReq  *req;
38
39    XFixesSimpleCheckExtension (dpy, info);
40
41    LockDisplay (dpy);
42    GetReq (XFixesSelectSelectionInput, req);
43    req->reqType = info->codes->major_opcode;
44    req->xfixesReqType = X_XFixesSelectSelectionInput;
45    req->window = win;
46    req->selection = selection;
47    req->eventMask = eventMask;
48    UnlockDisplay (dpy);
49    SyncHandle ();
50}
51