14b0ead49Smrg/*
249dc963fSmrg * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
34b0ead49Smrg *
449dc963fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
549dc963fSmrg * copy of this software and associated documentation files (the "Software"),
649dc963fSmrg * to deal in the Software without restriction, including without limitation
749dc963fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
849dc963fSmrg * and/or sell copies of the Software, and to permit persons to whom the
949dc963fSmrg * Software is furnished to do so, subject to the following conditions:
104b0ead49Smrg *
1149dc963fSmrg * The above copyright notice and this permission notice (including the next
1249dc963fSmrg * paragraph) shall be included in all copies or substantial portions of the
1349dc963fSmrg * Software.
144b0ead49Smrg *
1549dc963fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1649dc963fSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1749dc963fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1849dc963fSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1949dc963fSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2049dc963fSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2149dc963fSmrg * DEALINGS IN THE SOFTWARE.
2249dc963fSmrg */
2349dc963fSmrg/*
244b0ead49Smrg * Copyright © 2003 Keith Packard
254b0ead49Smrg *
264b0ead49Smrg * Permission to use, copy, modify, distribute, and sell this software and its
274b0ead49Smrg * documentation for any purpose is hereby granted without fee, provided that
284b0ead49Smrg * the above copyright notice appear in all copies and that both that
294b0ead49Smrg * copyright notice and this permission notice appear in supporting
304b0ead49Smrg * documentation, and that the name of Keith Packard not be used in
314b0ead49Smrg * advertising or publicity pertaining to distribution of the software without
324b0ead49Smrg * specific, written prior permission.  Keith Packard makes no
334b0ead49Smrg * representations about the suitability of this software for any purpose.  It
344b0ead49Smrg * is provided "as is" without express or implied warranty.
354b0ead49Smrg *
364b0ead49Smrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
374b0ead49Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
384b0ead49Smrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
394b0ead49Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
404b0ead49Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
414b0ead49Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
424b0ead49Smrg * PERFORMANCE OF THIS SOFTWARE.
434b0ead49Smrg */
444b0ead49Smrg
454b0ead49Smrg#ifndef _XCOMPOSITEINT_H_
464b0ead49Smrg#define _XCOMPOSITEINT_H_
474b0ead49Smrg
484b0ead49Smrg#include <stdio.h>
49c3e29c03Smrg#include <X11/Xfuncproto.h>
504b0ead49Smrg#include <X11/Xlib.h>
514b0ead49Smrg#include <X11/Xlibint.h>
524b0ead49Smrg#include <X11/Xutil.h>
534b0ead49Smrg#include <X11/extensions/compositeproto.h>
544b0ead49Smrg#include <X11/extensions/Xcomposite.h>
554b0ead49Smrg
564b0ead49Smrgtypedef struct _XCompositeExtDisplayInfo {
574b0ead49Smrg    struct _XCompositeExtDisplayInfo  *next;    /* keep a linked list */
584b0ead49Smrg    Display                 *display;	    /* which display this is */
594b0ead49Smrg    XExtCodes               *codes;	    /* the extension protocol codes */
604b0ead49Smrg    int			    major_version;  /* -1 means we don't know */
614b0ead49Smrg    int			    minor_version;  /* -1 means we don't know */
624b0ead49Smrg} XCompositeExtDisplayInfo;
634b0ead49Smrg
644b0ead49Smrg/* replaces XExtensionInfo */
654b0ead49Smrgtypedef struct _XCompositeExtInfo {
664b0ead49Smrg    XCompositeExtDisplayInfo    *head;          /* start of the list */
674b0ead49Smrg    XCompositeExtDisplayInfo    *cur;           /* most recently used */
684b0ead49Smrg    int                     ndisplays;      /* number of displays */
694b0ead49Smrg} XCompositeExtInfo;
704b0ead49Smrg
714b0ead49Smrgextern XCompositeExtInfo XCompositeExtensionInfo;
724b0ead49Smrgextern const char XCompositeExtensionName[];
734b0ead49Smrg
744b0ead49SmrgXCompositeExtDisplayInfo *
754b0ead49SmrgXCompositeFindDisplay (Display *dpy);
764b0ead49Smrg
774b0ead49Smrg#define XCompositeHasExtension(i) ((i) && ((i)->codes))
784b0ead49Smrg
794b0ead49Smrg#define XCompositeCheckExtension(dpy,i,val) \
80c3e29c03Smrg    do { if (!XCompositeHasExtension(i)) { return val; } } while (0)
814b0ead49Smrg
824b0ead49Smrg#define XCompositeSimpleCheckExtension(dpy,i) \
83c3e29c03Smrg    do { if (!XCompositeHasExtension(i)) { return; } } while (0)
844b0ead49Smrg
854b0ead49Smrg#endif /* _XCOMPOSITEINT_H_ */
86