Xrenderint.h revision 1f0ac6a5
11f0ac6a5Smrg/*
21f0ac6a5Smrg *
31f0ac6a5Smrg * Copyright © 2000 SuSE, Inc.
41f0ac6a5Smrg *
51f0ac6a5Smrg * Permission to use, copy, modify, distribute, and sell this software and its
61f0ac6a5Smrg * documentation for any purpose is hereby granted without fee, provided that
71f0ac6a5Smrg * the above copyright notice appear in all copies and that both that
81f0ac6a5Smrg * copyright notice and this permission notice appear in supporting
91f0ac6a5Smrg * documentation, and that the name of SuSE not be used in advertising or
101f0ac6a5Smrg * publicity pertaining to distribution of the software without specific,
111f0ac6a5Smrg * written prior permission.  SuSE makes no representations about the
121f0ac6a5Smrg * suitability of this software for any purpose.  It is provided "as is"
131f0ac6a5Smrg * without express or implied warranty.
141f0ac6a5Smrg *
151f0ac6a5Smrg * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
161f0ac6a5Smrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
171f0ac6a5Smrg * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
181f0ac6a5Smrg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
191f0ac6a5Smrg * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
201f0ac6a5Smrg * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
211f0ac6a5Smrg *
221f0ac6a5Smrg * Author:  Keith Packard, SuSE, Inc.
231f0ac6a5Smrg */
241f0ac6a5Smrg
251f0ac6a5Smrg#ifndef _XRENDERINT_H_
261f0ac6a5Smrg#define _XRENDERINT_H_
271f0ac6a5Smrg
281f0ac6a5Smrg#include "config.h"
291f0ac6a5Smrg#define NEED_EVENTS
301f0ac6a5Smrg#define NEED_REPLIES
311f0ac6a5Smrg#include <X11/Xlibint.h>
321f0ac6a5Smrg#include <X11/Xutil.h>
331f0ac6a5Smrg#include <X11/extensions/renderproto.h>
341f0ac6a5Smrg#include "Xrender.h"
351f0ac6a5Smrg
361f0ac6a5Smrgtypedef struct {
371f0ac6a5Smrg    Visual		*visual;
381f0ac6a5Smrg    XRenderPictFormat	*format;
391f0ac6a5Smrg} XRenderVisual;
401f0ac6a5Smrg
411f0ac6a5Smrgtypedef struct {
421f0ac6a5Smrg    int			depth;
431f0ac6a5Smrg    int			nvisuals;
441f0ac6a5Smrg    XRenderVisual	*visuals;
451f0ac6a5Smrg} XRenderDepth;
461f0ac6a5Smrg
471f0ac6a5Smrgtypedef struct {
481f0ac6a5Smrg    XRenderDepth	*depths;
491f0ac6a5Smrg    int			ndepths;
501f0ac6a5Smrg    XRenderPictFormat	*fallback;
511f0ac6a5Smrg    int			subpixel;
521f0ac6a5Smrg} XRenderScreen;
531f0ac6a5Smrg
541f0ac6a5Smrgtypedef struct _XRenderInfo {
551f0ac6a5Smrg    int			major_version;
561f0ac6a5Smrg    int			minor_version;
571f0ac6a5Smrg    XRenderPictFormat	*format;
581f0ac6a5Smrg    int			nformat;
591f0ac6a5Smrg    XRenderScreen	*screen;
601f0ac6a5Smrg    int			nscreen;
611f0ac6a5Smrg    XRenderDepth	*depth;
621f0ac6a5Smrg    int			ndepth;
631f0ac6a5Smrg    XRenderVisual	*visual;
641f0ac6a5Smrg    int			nvisual;
651f0ac6a5Smrg    int			*subpixel;
661f0ac6a5Smrg    int			nsubpixel;
671f0ac6a5Smrg    char		**filter;
681f0ac6a5Smrg    int			nfilter;
691f0ac6a5Smrg    short    		*filter_alias;
701f0ac6a5Smrg    int			nfilter_alias;
711f0ac6a5Smrg} XRenderInfo;
721f0ac6a5Smrg
731f0ac6a5Smrg/* replaces XRenderExtDisplayInfo */
741f0ac6a5Smrgtypedef struct _XRenderExtDisplayInfo {
751f0ac6a5Smrg    struct _XRenderExtDisplayInfo *next;    /* keep a linked list */
761f0ac6a5Smrg    Display                       *display; /* which display this is */
771f0ac6a5Smrg    XExtCodes                     *codes;   /* the extension protocol codes */
781f0ac6a5Smrg    XRenderInfo                   *info;    /* extra data for the extension to use */
791f0ac6a5Smrg} XRenderExtDisplayInfo;
801f0ac6a5Smrg
811f0ac6a5Smrg/* replaces XExtensionInfo */
821f0ac6a5Smrgtypedef struct _XRenderExtInfo {
831f0ac6a5Smrg    XRenderExtDisplayInfo  *head;           /* start of the list */
841f0ac6a5Smrg    XRenderExtDisplayInfo  *cur;            /* most recently used */
851f0ac6a5Smrg    int                     ndisplays;      /* number of displays */
861f0ac6a5Smrg} XRenderExtInfo;
871f0ac6a5Smrg
881f0ac6a5Smrgextern XRenderExtInfo XRenderExtensionInfo;
891f0ac6a5Smrgextern char XRenderExtensionName[];
901f0ac6a5Smrg
911f0ac6a5SmrgXRenderExtDisplayInfo *
921f0ac6a5SmrgXRenderFindDisplay (Display *dpy);
931f0ac6a5Smrg
941f0ac6a5Smrg#define RenderHasExtension(i) ((i) && ((i)->codes))
951f0ac6a5Smrg
961f0ac6a5Smrg#define RenderCheckExtension(dpy,i,val) \
971f0ac6a5Smrg  if (!RenderHasExtension(i)) { return val; }
981f0ac6a5Smrg
991f0ac6a5Smrg#define RenderSimpleCheckExtension(dpy,i) \
1001f0ac6a5Smrg  if (!RenderHasExtension(i)) { return; }
1011f0ac6a5Smrg
1021f0ac6a5Smrg/*
1031f0ac6a5Smrg * Xlib uses long for 32-bit values.  Xrender uses int.  This
1041f0ac6a5Smrg * matters on alpha.  Note that this macro assumes that int is 32 bits
1051f0ac6a5Smrg * except on WORD64 machines where it is 64 bits.
1061f0ac6a5Smrg */
1071f0ac6a5Smrg
1081f0ac6a5Smrg#ifdef WORD64
1091f0ac6a5Smrg#define DataInt32(dpy,d,len)	Data32(dpy,(long *) (d),len)
1101f0ac6a5Smrg#else
1111f0ac6a5Smrg#define DataInt32(dpy,d,len)	Data(dpy,(char *) (d),len)
1121f0ac6a5Smrg#endif
1131f0ac6a5Smrg
1141f0ac6a5Smrg#endif /* _XRENDERINT_H_ */
115