Xrenderint.h revision 1f0ac6a5
1/* 2 * 3 * Copyright © 2000 SuSE, Inc. 4 * 5 * Permission to use, copy, modify, distribute, and sell this software and its 6 * documentation for any purpose is hereby granted without fee, provided that 7 * the above copyright notice appear in all copies and that both that 8 * copyright notice and this permission notice appear in supporting 9 * documentation, and that the name of SuSE not be used in advertising or 10 * publicity pertaining to distribution of the software without specific, 11 * written prior permission. SuSE makes no representations about the 12 * suitability of this software for any purpose. It is provided "as is" 13 * without express or implied warranty. 14 * 15 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE 17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 21 * 22 * Author: Keith Packard, SuSE, Inc. 23 */ 24 25#ifndef _XRENDERINT_H_ 26#define _XRENDERINT_H_ 27 28#include "config.h" 29#define NEED_EVENTS 30#define NEED_REPLIES 31#include <X11/Xlibint.h> 32#include <X11/Xutil.h> 33#include <X11/extensions/renderproto.h> 34#include "Xrender.h" 35 36typedef struct { 37 Visual *visual; 38 XRenderPictFormat *format; 39} XRenderVisual; 40 41typedef struct { 42 int depth; 43 int nvisuals; 44 XRenderVisual *visuals; 45} XRenderDepth; 46 47typedef struct { 48 XRenderDepth *depths; 49 int ndepths; 50 XRenderPictFormat *fallback; 51 int subpixel; 52} XRenderScreen; 53 54typedef struct _XRenderInfo { 55 int major_version; 56 int minor_version; 57 XRenderPictFormat *format; 58 int nformat; 59 XRenderScreen *screen; 60 int nscreen; 61 XRenderDepth *depth; 62 int ndepth; 63 XRenderVisual *visual; 64 int nvisual; 65 int *subpixel; 66 int nsubpixel; 67 char **filter; 68 int nfilter; 69 short *filter_alias; 70 int nfilter_alias; 71} XRenderInfo; 72 73/* replaces XRenderExtDisplayInfo */ 74typedef struct _XRenderExtDisplayInfo { 75 struct _XRenderExtDisplayInfo *next; /* keep a linked list */ 76 Display *display; /* which display this is */ 77 XExtCodes *codes; /* the extension protocol codes */ 78 XRenderInfo *info; /* extra data for the extension to use */ 79} XRenderExtDisplayInfo; 80 81/* replaces XExtensionInfo */ 82typedef struct _XRenderExtInfo { 83 XRenderExtDisplayInfo *head; /* start of the list */ 84 XRenderExtDisplayInfo *cur; /* most recently used */ 85 int ndisplays; /* number of displays */ 86} XRenderExtInfo; 87 88extern XRenderExtInfo XRenderExtensionInfo; 89extern char XRenderExtensionName[]; 90 91XRenderExtDisplayInfo * 92XRenderFindDisplay (Display *dpy); 93 94#define RenderHasExtension(i) ((i) && ((i)->codes)) 95 96#define RenderCheckExtension(dpy,i,val) \ 97 if (!RenderHasExtension(i)) { return val; } 98 99#define RenderSimpleCheckExtension(dpy,i) \ 100 if (!RenderHasExtension(i)) { return; } 101 102/* 103 * Xlib uses long for 32-bit values. Xrender uses int. This 104 * matters on alpha. Note that this macro assumes that int is 32 bits 105 * except on WORD64 machines where it is 64 bits. 106 */ 107 108#ifdef WORD64 109#define DataInt32(dpy,d,len) Data32(dpy,(long *) (d),len) 110#else 111#define DataInt32(dpy,d,len) Data(dpy,(char *) (d),len) 112#endif 113 114#endif /* _XRENDERINT_H_ */ 115