diff options
author | marha <marha@users.sourceforge.net> | 2010-05-15 16:28:11 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-05-15 16:28:11 +0000 |
commit | c38dead3ea7e177728d90cd815cf4eead0c9f534 (patch) | |
tree | b809dba1dc9013bb1e67a5ee388f2dd217dc0f88 /xorg-server/include | |
parent | 6083a94d68878c9ad5f59b28bd07e4738e9fb7b4 (diff) | |
download | vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.tar.gz vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.tar.bz2 vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.zip |
xserver git update 15/5/2010
Diffstat (limited to 'xorg-server/include')
-rw-r--r-- | xorg-server/include/colormap.h | 376 | ||||
-rw-r--r-- | xorg-server/include/dixfont.h | 375 | ||||
-rw-r--r-- | xorg-server/include/gc.h | 340 | ||||
-rw-r--r-- | xorg-server/include/gcstruct.h | 648 | ||||
-rw-r--r-- | xorg-server/include/misc.h | 590 | ||||
-rw-r--r-- | xorg-server/include/os.h | 80 | ||||
-rw-r--r-- | xorg-server/include/privates.h | 298 | ||||
-rw-r--r-- | xorg-server/include/regionstr.h | 586 | ||||
-rw-r--r-- | xorg-server/include/resource.h | 558 | ||||
-rw-r--r-- | xorg-server/include/scrnintstr.h | 1242 |
10 files changed, 2534 insertions, 2559 deletions
diff --git a/xorg-server/include/colormap.h b/xorg-server/include/colormap.h index de48ce8d8..db4c1c834 100644 --- a/xorg-server/include/colormap.h +++ b/xorg-server/include/colormap.h @@ -1,187 +1,189 @@ -/* - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*/ - -#ifndef CMAP_H -#define CMAP_H 1 - -#include <X11/Xproto.h> -#include "screenint.h" -#include "window.h" - -/* these follow X.h's AllocNone and AllocAll */ -#define CM_PSCREEN 2 -#define CM_PWIN 3 -/* Passed internally in colormap.c */ -#define REDMAP 0 -#define GREENMAP 1 -#define BLUEMAP 2 -#define PSEUDOMAP 3 -#define AllocPrivate (-1) -#define AllocTemporary (-2) -#define DynamicClass 1 - -/* Values for the flags field of a colormap. These should have 1 bit set - * and not overlap */ -#define IsDefault 1 -#define AllAllocated 2 -#define BeingCreated 4 - - -typedef CARD32 Pixel; -typedef struct _CMEntry *EntryPtr; -/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */ -typedef struct _colorResource *colorResourcePtr; - -extern _X_EXPORT int CreateColormap( - Colormap /*mid*/, - ScreenPtr /*pScreen*/, - VisualPtr /*pVisual*/, - ColormapPtr* /*ppcmap*/, - int /*alloc*/, - int /*client*/); - -extern _X_EXPORT int FreeColormap( - pointer /*pmap*/, - XID /*mid*/); - -extern _X_EXPORT int TellLostMap( - WindowPtr /*pwin*/, - pointer /* Colormap *pmid */); - -extern _X_EXPORT int TellGainedMap( - WindowPtr /*pwin*/, - pointer /* Colormap *pmid */); - -extern _X_EXPORT int CopyColormapAndFree( - Colormap /*mid*/, - ColormapPtr /*pSrc*/, - int /*client*/); - -extern _X_EXPORT int AllocColor( - ColormapPtr /*pmap*/, - unsigned short* /*pred*/, - unsigned short* /*pgreen*/, - unsigned short* /*pblue*/, - Pixel* /*pPix*/, - int /*client*/); - -extern _X_EXPORT void FakeAllocColor( - ColormapPtr /*pmap*/, - xColorItem * /*item*/); - -extern _X_EXPORT void FakeFreeColor( - ColormapPtr /*pmap*/, - Pixel /*pixel*/); - -typedef int (*ColorCompareProcPtr)( - EntryPtr /*pent*/, - xrgb * /*prgb*/); - -extern _X_EXPORT int FindColor( - ColormapPtr /*pmap*/, - EntryPtr /*pentFirst*/, - int /*size*/, - xrgb* /*prgb*/, - Pixel* /*pPixel*/, - int /*channel*/, - int /*client*/, - ColorCompareProcPtr /*comp*/); - -extern _X_EXPORT int QueryColors( - ColormapPtr /*pmap*/, - int /*count*/, - Pixel* /*ppixIn*/, - xrgb* /*prgbList*/); - -extern _X_EXPORT int FreeClientPixels( - pointer /*pcr*/, - XID /*fakeid*/); - -extern _X_EXPORT int AllocColorCells( - int /*client*/, - ColormapPtr /*pmap*/, - int /*colors*/, - int /*planes*/, - Bool /*contig*/, - Pixel* /*ppix*/, - Pixel* /*masks*/); - -extern _X_EXPORT int AllocColorPlanes( - int /*client*/, - ColormapPtr /*pmap*/, - int /*colors*/, - int /*r*/, - int /*g*/, - int /*b*/, - Bool /*contig*/, - Pixel* /*pixels*/, - Pixel* /*prmask*/, - Pixel* /*pgmask*/, - Pixel* /*pbmask*/); - -extern _X_EXPORT int FreeColors( - ColormapPtr /*pmap*/, - int /*client*/, - int /*count*/, - Pixel* /*pixels*/, - Pixel /*mask*/); - -extern _X_EXPORT int StoreColors( - ColormapPtr /*pmap*/, - int /*count*/, - xColorItem* /*defs*/); - -extern _X_EXPORT int IsMapInstalled( - Colormap /*map*/, - WindowPtr /*pWin*/); - -extern _X_EXPORT Bool ResizeVisualArray( - ScreenPtr /* pScreen */, - int /* new_vis_count */, - DepthPtr /* depth */); - -#endif /* CMAP_H */ +/*
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+*/
+
+#ifndef CMAP_H
+#define CMAP_H 1
+
+#include <X11/Xproto.h>
+#include "screenint.h"
+#include "window.h"
+
+/* these follow X.h's AllocNone and AllocAll */
+#define CM_PSCREEN 2
+#define CM_PWIN 3
+/* Passed internally in colormap.c */
+#define REDMAP 0
+#define GREENMAP 1
+#define BLUEMAP 2
+#define PSEUDOMAP 3
+#define AllocPrivate (-1)
+#define AllocTemporary (-2)
+#define DynamicClass 1
+
+/* Values for the flags field of a colormap. These should have 1 bit set
+ * and not overlap */
+#define IsDefault 1
+#define AllAllocated 2
+#define BeingCreated 4
+
+
+typedef CARD32 Pixel;
+typedef struct _CMEntry *EntryPtr;
+/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
+typedef struct _colorResource *colorResourcePtr;
+
+extern _X_EXPORT int CreateColormap(
+ Colormap /*mid*/,
+ ScreenPtr /*pScreen*/,
+ VisualPtr /*pVisual*/,
+ ColormapPtr* /*ppcmap*/,
+ int /*alloc*/,
+ int /*client*/);
+
+extern _X_EXPORT int FreeColormap(
+ pointer /*pmap*/,
+ XID /*mid*/);
+
+extern _X_EXPORT int TellLostMap(
+ WindowPtr /*pwin*/,
+ pointer /* Colormap *pmid */);
+
+extern _X_EXPORT int TellGainedMap(
+ WindowPtr /*pwin*/,
+ pointer /* Colormap *pmid */);
+
+extern _X_EXPORT int CopyColormapAndFree(
+ Colormap /*mid*/,
+ ColormapPtr /*pSrc*/,
+ int /*client*/);
+
+extern _X_EXPORT int AllocColor(
+ ColormapPtr /*pmap*/,
+ unsigned short* /*pred*/,
+ unsigned short* /*pgreen*/,
+ unsigned short* /*pblue*/,
+ Pixel* /*pPix*/,
+ int /*client*/);
+
+extern _X_EXPORT void FakeAllocColor(
+ ColormapPtr /*pmap*/,
+ xColorItem * /*item*/);
+
+extern _X_EXPORT void FakeFreeColor(
+ ColormapPtr /*pmap*/,
+ Pixel /*pixel*/);
+
+typedef int (*ColorCompareProcPtr)(
+ EntryPtr /*pent*/,
+ xrgb * /*prgb*/);
+
+extern _X_EXPORT int FindColor(
+ ColormapPtr /*pmap*/,
+ EntryPtr /*pentFirst*/,
+ int /*size*/,
+ xrgb* /*prgb*/,
+ Pixel* /*pPixel*/,
+ int /*channel*/,
+ int /*client*/,
+ ColorCompareProcPtr /*comp*/);
+
+extern _X_EXPORT int QueryColors(
+ ColormapPtr /*pmap*/,
+ int /*count*/,
+ Pixel* /*ppixIn*/,
+ xrgb* /*prgbList*/,
+ ClientPtr client);
+
+extern _X_EXPORT int FreeClientPixels(
+ pointer /*pcr*/,
+ XID /*fakeid*/);
+
+extern _X_EXPORT int AllocColorCells(
+ int /*client*/,
+ ColormapPtr /*pmap*/,
+ int /*colors*/,
+ int /*planes*/,
+ Bool /*contig*/,
+ Pixel* /*ppix*/,
+ Pixel* /*masks*/);
+
+extern _X_EXPORT int AllocColorPlanes(
+ int /*client*/,
+ ColormapPtr /*pmap*/,
+ int /*colors*/,
+ int /*r*/,
+ int /*g*/,
+ int /*b*/,
+ Bool /*contig*/,
+ Pixel* /*pixels*/,
+ Pixel* /*prmask*/,
+ Pixel* /*pgmask*/,
+ Pixel* /*pbmask*/);
+
+extern _X_EXPORT int FreeColors(
+ ColormapPtr /*pmap*/,
+ int /*client*/,
+ int /*count*/,
+ Pixel* /*pixels*/,
+ Pixel /*mask*/);
+
+extern _X_EXPORT int StoreColors(
+ ColormapPtr /*pmap*/,
+ int /*count*/,
+ xColorItem* /*defs*/,
+ ClientPtr client);
+
+extern _X_EXPORT int IsMapInstalled(
+ Colormap /*map*/,
+ WindowPtr /*pWin*/);
+
+extern _X_EXPORT Bool ResizeVisualArray(
+ ScreenPtr /* pScreen */,
+ int /* new_vis_count */,
+ DepthPtr /* depth */);
+
+#endif /* CMAP_H */
diff --git a/xorg-server/include/dixfont.h b/xorg-server/include/dixfont.h index e444a2024..4e23da845 100644 --- a/xorg-server/include/dixfont.h +++ b/xorg-server/include/dixfont.h @@ -1,188 +1,187 @@ -/*********************************************************** -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef DIXFONT_H -#define DIXFONT_H 1 - -#include "dix.h" -#include <X11/fonts/font.h> -#include "closure.h" -#include <X11/fonts/fontstruct.h> - -#define NullDIXFontProp ((DIXFontPropPtr)0) - -typedef struct _DIXFontProp *DIXFontPropPtr; - -extern _X_EXPORT Bool SetDefaultFont(char * /*defaultfontname*/); - -extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe*/); - -extern _X_EXPORT void RemoveFontWakeup(FontPathElementPtr /*fpe*/); - -extern _X_EXPORT void FontWakeup(pointer /*data*/, - int /*count*/, - pointer /*LastSelectMask*/); - -extern _X_EXPORT int OpenFont(ClientPtr /*client*/, - XID /*fid*/, - Mask /*flags*/, - unsigned /*lenfname*/, - char * /*pfontname*/); - -extern _X_EXPORT int CloseFont(pointer /*pfont*/, - XID /*fid*/); - -typedef struct _xQueryFontReply *xQueryFontReplyPtr; - -extern _X_EXPORT void QueryFont(FontPtr /*pFont*/, - xQueryFontReplyPtr /*pReply*/, - int /*nProtoCCIStructs*/); - -extern _X_EXPORT int ListFonts(ClientPtr /*client*/, - unsigned char * /*pattern*/, - unsigned int /*length*/, - unsigned int /*max_names*/); - -extern _X_EXPORT int -doListFontsWithInfo(ClientPtr /*client*/, - LFWIclosurePtr /*c*/); - -extern _X_EXPORT int doPolyText(ClientPtr /*client*/, - PTclosurePtr /*c*/ -); - -extern _X_EXPORT int PolyText(ClientPtr /*client*/, - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - unsigned char * /*pElt*/, - unsigned char * /*endReq*/, - int /*xorg*/, - int /*yorg*/, - int /*reqType*/, - XID /*did*/); - -extern _X_EXPORT int doImageText(ClientPtr /*client*/, - ITclosurePtr /*c*/); - -extern _X_EXPORT int ImageText(ClientPtr /*client*/, - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*nChars*/, - unsigned char * /*data*/, - int /*xorg*/, - int /*yorg*/, - int /*reqType*/, - XID /*did*/); - -extern _X_EXPORT int SetFontPath(ClientPtr /*client*/, - int /*npaths*/, - unsigned char * /*paths*/, - int * /*error*/); - -extern _X_EXPORT int SetDefaultFontPath(char * /*path*/); - -extern _X_EXPORT int GetFontPath(ClientPtr client, - int *count, - int *length, - unsigned char **result); - -extern _X_EXPORT void DeleteClientFontStuff(ClientPtr /*client*/); - -/* Quartz support on Mac OS X pulls in the QuickDraw - framework whose InitFonts function conflicts here. */ -#ifdef __APPLE__ -#define InitFonts Darwin_X_InitFonts -#endif -extern _X_EXPORT void InitFonts(void); - -extern _X_EXPORT void FreeFonts(void); - -extern _X_EXPORT FontPtr find_old_font(XID /*id*/); - -extern _X_EXPORT void GetGlyphs(FontPtr /*font*/, - unsigned long /*count*/, - unsigned char * /*chars*/, - FontEncoding /*fontEncoding*/, - unsigned long * /*glyphcount*/, - CharInfoPtr * /*glyphs*/); - -extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont*/, - CharInfoPtr * /*charinfo*/, - unsigned long /*count*/, - ExtentInfoPtr /*info*/); - -extern _X_EXPORT Bool QueryTextExtents(FontPtr /*pFont*/, - unsigned long /*count*/, - unsigned char * /*chars*/, - ExtentInfoPtr /*info*/); - -extern _X_EXPORT Bool ParseGlyphCachingMode(char * /*str*/); - -extern _X_EXPORT void InitGlyphCaching(void); - -extern _X_EXPORT void SetGlyphCachingMode(int /*newmode*/); - -/* - * libXfont/src/builtins/builtin.h - */ -extern _X_EXPORT void BuiltinRegisterFpeFunctions(void); - -/* - * libXfont stubs. - */ -extern _X_EXPORT int client_auth_generation(ClientPtr client); - -extern _X_EXPORT void DeleteFontClientID(Font id); - -extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num); - -extern _X_EXPORT int GetDefaultPointSize(void); - -extern _X_EXPORT Font GetNewFontClientID(void); - -extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler); - -extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func); - -extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr blockHandler, - Bool all); - -extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id); - -#endif /* DIXFONT_H */ +/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef DIXFONT_H
+#define DIXFONT_H 1
+
+#include "dix.h"
+#include <X11/fonts/font.h>
+#include "closure.h"
+#include <X11/fonts/fontstruct.h>
+
+#define NullDIXFontProp ((DIXFontPropPtr)0)
+
+typedef struct _DIXFontProp *DIXFontPropPtr;
+
+extern _X_EXPORT Bool SetDefaultFont(char * /*defaultfontname*/);
+
+extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe*/);
+
+extern _X_EXPORT void RemoveFontWakeup(FontPathElementPtr /*fpe*/);
+
+extern _X_EXPORT void FontWakeup(pointer /*data*/,
+ int /*count*/,
+ pointer /*LastSelectMask*/);
+
+extern _X_EXPORT int OpenFont(ClientPtr /*client*/,
+ XID /*fid*/,
+ Mask /*flags*/,
+ unsigned /*lenfname*/,
+ char * /*pfontname*/);
+
+extern _X_EXPORT int CloseFont(pointer /*pfont*/,
+ XID /*fid*/);
+
+typedef struct _xQueryFontReply *xQueryFontReplyPtr;
+
+extern _X_EXPORT void QueryFont(FontPtr /*pFont*/,
+ xQueryFontReplyPtr /*pReply*/,
+ int /*nProtoCCIStructs*/);
+
+extern _X_EXPORT int ListFonts(ClientPtr /*client*/,
+ unsigned char * /*pattern*/,
+ unsigned int /*length*/,
+ unsigned int /*max_names*/);
+
+extern _X_EXPORT int
+doListFontsWithInfo(ClientPtr /*client*/,
+ LFWIclosurePtr /*c*/);
+
+extern _X_EXPORT int doPolyText(ClientPtr /*client*/,
+ PTclosurePtr /*c*/
+);
+
+extern _X_EXPORT int PolyText(ClientPtr /*client*/,
+ DrawablePtr /*pDraw*/,
+ GCPtr /*pGC*/,
+ unsigned char * /*pElt*/,
+ unsigned char * /*endReq*/,
+ int /*xorg*/,
+ int /*yorg*/,
+ int /*reqType*/,
+ XID /*did*/);
+
+extern _X_EXPORT int doImageText(ClientPtr /*client*/,
+ ITclosurePtr /*c*/);
+
+extern _X_EXPORT int ImageText(ClientPtr /*client*/,
+ DrawablePtr /*pDraw*/,
+ GCPtr /*pGC*/,
+ int /*nChars*/,
+ unsigned char * /*data*/,
+ int /*xorg*/,
+ int /*yorg*/,
+ int /*reqType*/,
+ XID /*did*/);
+
+extern _X_EXPORT int SetFontPath(ClientPtr /*client*/,
+ int /*npaths*/,
+ unsigned char * /*paths*/);
+
+extern _X_EXPORT int SetDefaultFontPath(char * /*path*/);
+
+extern _X_EXPORT int GetFontPath(ClientPtr client,
+ int *count,
+ int *length,
+ unsigned char **result);
+
+extern _X_EXPORT void DeleteClientFontStuff(ClientPtr /*client*/);
+
+/* Quartz support on Mac OS X pulls in the QuickDraw
+ framework whose InitFonts function conflicts here. */
+#ifdef __APPLE__
+#define InitFonts Darwin_X_InitFonts
+#endif
+extern _X_EXPORT void InitFonts(void);
+
+extern _X_EXPORT void FreeFonts(void);
+
+extern _X_EXPORT FontPtr find_old_font(XID /*id*/);
+
+extern _X_EXPORT void GetGlyphs(FontPtr /*font*/,
+ unsigned long /*count*/,
+ unsigned char * /*chars*/,
+ FontEncoding /*fontEncoding*/,
+ unsigned long * /*glyphcount*/,
+ CharInfoPtr * /*glyphs*/);
+
+extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont*/,
+ CharInfoPtr * /*charinfo*/,
+ unsigned long /*count*/,
+ ExtentInfoPtr /*info*/);
+
+extern _X_EXPORT Bool QueryTextExtents(FontPtr /*pFont*/,
+ unsigned long /*count*/,
+ unsigned char * /*chars*/,
+ ExtentInfoPtr /*info*/);
+
+extern _X_EXPORT Bool ParseGlyphCachingMode(char * /*str*/);
+
+extern _X_EXPORT void InitGlyphCaching(void);
+
+extern _X_EXPORT void SetGlyphCachingMode(int /*newmode*/);
+
+/*
+ * libXfont/src/builtins/builtin.h
+ */
+extern _X_EXPORT void BuiltinRegisterFpeFunctions(void);
+
+/*
+ * libXfont stubs.
+ */
+extern _X_EXPORT int client_auth_generation(ClientPtr client);
+
+extern _X_EXPORT void DeleteFontClientID(Font id);
+
+extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num);
+
+extern _X_EXPORT int GetDefaultPointSize(void);
+
+extern _X_EXPORT Font GetNewFontClientID(void);
+
+extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe,
+ BlockHandlerProcPtr block_handler);
+
+extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func,
+ InitFpeFunc init_func,
+ FreeFpeFunc free_func,
+ ResetFpeFunc reset_func,
+ OpenFontFunc open_func,
+ CloseFontFunc close_func,
+ ListFontsFunc list_func,
+ StartLfwiFunc start_lfwi_func,
+ NextLfwiFunc next_lfwi_func,
+ WakeupFpeFunc wakeup_func,
+ ClientDiedFunc client_died,
+ LoadGlyphsFunc load_glyphs,
+ StartLaFunc start_list_alias_func,
+ NextLaFunc next_list_alias_func,
+ SetPathFunc set_path_func);
+
+extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe,
+ BlockHandlerProcPtr blockHandler,
+ Bool all);
+
+extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id);
+
+#endif /* DIXFONT_H */
diff --git a/xorg-server/include/gc.h b/xorg-server/include/gc.h index e75cc5e83..428c40441 100644 --- a/xorg-server/include/gc.h +++ b/xorg-server/include/gc.h @@ -1,173 +1,167 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef GC_H -#define GC_H - -#include <X11/X.h> /* for GContext, Mask */ -#include <X11/Xdefs.h> /* for Bool */ -#include <X11/Xproto.h> -#include "screenint.h" /* for ScreenPtr */ -#include "pixmap.h" /* for DrawablePtr */ - -/* clientClipType field in GC */ -#define CT_NONE 0 -#define CT_PIXMAP 1 -#define CT_REGION 2 -#define CT_UNSORTED 6 -#define CT_YSORTED 10 -#define CT_YXSORTED 14 -#define CT_YXBANDED 18 - -#define GCQREASON_VALIDATE 1 -#define GCQREASON_CHANGE 2 -#define GCQREASON_COPY_SRC 3 -#define GCQREASON_COPY_DST 4 -#define GCQREASON_DESTROY 5 - -#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31) -#define GC_CALL_VALIDATE_BIT (1L<<30) -#define GCExtensionInterest (1L<<29) - -#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT)) - -#define MAX_SERIAL_NUM (1L<<28) - -#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \ - (globalSerialNumber = 1): globalSerialNumber) - -typedef struct _GCInterest *GCInterestPtr; -typedef struct _GC *GCPtr; -typedef struct _GCOps *GCOpsPtr; - -extern _X_EXPORT void ValidateGC( - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/); - -extern _X_EXPORT int ChangeGC( - GCPtr/*pGC*/, - BITS32 /*mask*/, - XID* /*pval*/); - -extern _X_EXPORT int DoChangeGC( - GCPtr/*pGC*/, - BITS32 /*mask*/, - XID* /*pval*/, - int /*fPointer*/); - -typedef union { - CARD32 val; - pointer ptr; -} ChangeGCVal, *ChangeGCValPtr; - -extern _X_EXPORT int dixChangeGC( - ClientPtr /*client*/, - GCPtr /*pGC*/, - BITS32 /*mask*/, - CARD32 * /*pval*/, - ChangeGCValPtr /*pCGCV*/); - -extern _X_EXPORT GCPtr CreateGC( - DrawablePtr /*pDrawable*/, - BITS32 /*mask*/, - XID* /*pval*/, - int* /*pStatus*/, - XID /*gcid*/, - ClientPtr /*client*/); - -extern _X_EXPORT int CopyGC( - GCPtr/*pgcSrc*/, - GCPtr/*pgcDst*/, - BITS32 /*mask*/); - -extern _X_EXPORT int FreeGC( - pointer /*pGC*/, - XID /*gid*/); - -extern _X_EXPORT GCPtr CreateScratchGC( - ScreenPtr /*pScreen*/, - unsigned /*depth*/); - -extern _X_EXPORT void FreeGCperDepth( - int /*screenNum*/); - -extern _X_EXPORT Bool CreateGCperDepth( - int /*screenNum*/); - -extern _X_EXPORT Bool CreateDefaultStipple( - int /*screenNum*/); - -extern _X_EXPORT void FreeDefaultStipple( - int /*screenNum*/); - -extern _X_EXPORT int SetDashes( - GCPtr /*pGC*/, - unsigned /*offset*/, - unsigned /*ndash*/, - unsigned char* /*pdash*/); - -extern _X_EXPORT int VerifyRectOrder( - int /*nrects*/, - xRectangle* /*prects*/, - int /*ordering*/); - -extern _X_EXPORT int SetClipRects( - GCPtr /*pGC*/, - int /*xOrigin*/, - int /*yOrigin*/, - int /*nrects*/, - xRectangle* /*prects*/, - int /*ordering*/); - -extern _X_EXPORT GCPtr GetScratchGC( - unsigned /*depth*/, - ScreenPtr /*pScreen*/); - -extern _X_EXPORT void FreeScratchGC( - GCPtr /*pGC*/); - -#endif /* GC_H */ +/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef GC_H
+#define GC_H
+
+#include <X11/X.h> /* for GContext, Mask */
+#include <X11/Xdefs.h> /* for Bool */
+#include <X11/Xproto.h>
+#include "screenint.h" /* for ScreenPtr */
+#include "pixmap.h" /* for DrawablePtr */
+
+/* clientClipType field in GC */
+#define CT_NONE 0
+#define CT_PIXMAP 1
+#define CT_REGION 2
+#define CT_UNSORTED 6
+#define CT_YSORTED 10
+#define CT_YXSORTED 14
+#define CT_YXBANDED 18
+
+#define GCQREASON_VALIDATE 1
+#define GCQREASON_CHANGE 2
+#define GCQREASON_COPY_SRC 3
+#define GCQREASON_COPY_DST 4
+#define GCQREASON_DESTROY 5
+
+#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
+#define GC_CALL_VALIDATE_BIT (1L<<30)
+#define GCExtensionInterest (1L<<29)
+
+#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
+
+#define MAX_SERIAL_NUM (1L<<28)
+
+#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
+ (globalSerialNumber = 1): globalSerialNumber)
+
+typedef struct _GCInterest *GCInterestPtr;
+typedef struct _GC *GCPtr;
+typedef struct _GCOps *GCOpsPtr;
+
+extern _X_EXPORT void ValidateGC(
+ DrawablePtr /*pDraw*/,
+ GCPtr /*pGC*/);
+
+typedef union {
+ CARD32 val;
+ pointer ptr;
+} ChangeGCVal, *ChangeGCValPtr;
+
+extern int ChangeGCXIDs(
+ ClientPtr /*client*/,
+ GCPtr /*pGC*/,
+ BITS32 /*mask*/,
+ CARD32 * /*pval*/);
+
+extern _X_EXPORT int ChangeGC(
+ ClientPtr /*client*/,
+ GCPtr /*pGC*/,
+ BITS32 /*mask*/,
+ ChangeGCValPtr /*pCGCV*/);
+
+extern _X_EXPORT GCPtr CreateGC(
+ DrawablePtr /*pDrawable*/,
+ BITS32 /*mask*/,
+ XID* /*pval*/,
+ int* /*pStatus*/,
+ XID /*gcid*/,
+ ClientPtr /*client*/);
+
+extern _X_EXPORT int CopyGC(
+ GCPtr/*pgcSrc*/,
+ GCPtr/*pgcDst*/,
+ BITS32 /*mask*/);
+
+extern _X_EXPORT int FreeGC(
+ pointer /*pGC*/,
+ XID /*gid*/);
+
+extern _X_EXPORT GCPtr CreateScratchGC(
+ ScreenPtr /*pScreen*/,
+ unsigned /*depth*/);
+
+extern _X_EXPORT void FreeGCperDepth(
+ int /*screenNum*/);
+
+extern _X_EXPORT Bool CreateGCperDepth(
+ int /*screenNum*/);
+
+extern _X_EXPORT Bool CreateDefaultStipple(
+ int /*screenNum*/);
+
+extern _X_EXPORT void FreeDefaultStipple(
+ int /*screenNum*/);
+
+extern _X_EXPORT int SetDashes(
+ GCPtr /*pGC*/,
+ unsigned /*offset*/,
+ unsigned /*ndash*/,
+ unsigned char* /*pdash*/);
+
+extern _X_EXPORT int VerifyRectOrder(
+ int /*nrects*/,
+ xRectangle* /*prects*/,
+ int /*ordering*/);
+
+extern _X_EXPORT int SetClipRects(
+ GCPtr /*pGC*/,
+ int /*xOrigin*/,
+ int /*yOrigin*/,
+ int /*nrects*/,
+ xRectangle* /*prects*/,
+ int /*ordering*/);
+
+extern _X_EXPORT GCPtr GetScratchGC(
+ unsigned /*depth*/,
+ ScreenPtr /*pScreen*/);
+
+extern _X_EXPORT void FreeScratchGC(
+ GCPtr /*pGC*/);
+
+#endif /* GC_H */
diff --git a/xorg-server/include/gcstruct.h b/xorg-server/include/gcstruct.h index 8d9b05575..c56dd9294 100644 --- a/xorg-server/include/gcstruct.h +++ b/xorg-server/include/gcstruct.h @@ -1,323 +1,325 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - - -#ifndef GCSTRUCT_H -#define GCSTRUCT_H - -#include "gc.h" - -#include "regionstr.h" -#include "region.h" -#include "pixmap.h" -#include "screenint.h" -#include "privates.h" -#include <X11/Xprotostr.h> - -/* - * functions which modify the state of the GC - */ - -typedef struct _GCFuncs { - void (* ValidateGC)( - GCPtr /*pGC*/, - unsigned long /*stateChanges*/, - DrawablePtr /*pDrawable*/); - - void (* ChangeGC)( - GCPtr /*pGC*/, - unsigned long /*mask*/); - - void (* CopyGC)( - GCPtr /*pGCSrc*/, - unsigned long /*mask*/, - GCPtr /*pGCDst*/); - - void (* DestroyGC)( - GCPtr /*pGC*/); - - void (* ChangeClip)( - GCPtr /*pGC*/, - int /*type*/, - pointer /*pvalue*/, - int /*nrects*/); - - void (* DestroyClip)( - GCPtr /*pGC*/); - - void (* CopyClip)( - GCPtr /*pgcDst*/, - GCPtr /*pgcSrc*/); - DevUnion devPrivate; -} GCFuncs; - -/* - * graphics operations invoked through a GC - */ - -typedef struct _GCOps { - void (* FillSpans)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nInit*/, - DDXPointPtr /*pptInit*/, - int * /*pwidthInit*/, - int /*fSorted*/); - - void (* SetSpans)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - char * /*psrc*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - int /*fSorted*/); - - void (* PutImage)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*depth*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - int /*leftPad*/, - int /*format*/, - char * /*pBits*/); - - RegionPtr (* CopyArea)( - DrawablePtr /*pSrc*/, - DrawablePtr /*pDst*/, - GCPtr /*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*w*/, - int /*h*/, - int /*dstx*/, - int /*dsty*/); - - RegionPtr (* CopyPlane)( - DrawablePtr /*pSrcDrawable*/, - DrawablePtr /*pDstDrawable*/, - GCPtr /*pGC*/, - int /*srcx*/, - int /*srcy*/, - int /*width*/, - int /*height*/, - int /*dstx*/, - int /*dsty*/, - unsigned long /*bitPlane*/); - void (* PolyPoint)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/); - - void (* Polylines)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*mode*/, - int /*npt*/, - DDXPointPtr /*pptInit*/); - - void (* PolySegment)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nseg*/, - xSegment * /*pSegs*/); - - void (* PolyRectangle)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nrects*/, - xRectangle * /*pRects*/); - - void (* PolyArc)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/); - - void (* FillPolygon)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*shape*/, - int /*mode*/, - int /*count*/, - DDXPointPtr /*pPts*/); - - void (* PolyFillRect)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*nrectFill*/, - xRectangle * /*prectInit*/); - - void (* PolyFillArc)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*narcs*/, - xArc * /*parcs*/); - - int (* PolyText8)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - int /*count*/, - char * /*chars*/); - - int (* PolyText16)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - int /*count*/, - unsigned short * /*chars*/); - - void (* ImageText8)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - int /*count*/, - char * /*chars*/); - - void (* ImageText16)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - int /*count*/, - unsigned short * /*chars*/); - - void (* ImageGlyphBlt)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/); - - void (* PolyGlyphBlt)( - DrawablePtr /*pDrawable*/, - GCPtr /*pGC*/, - int /*x*/, - int /*y*/, - unsigned int /*nglyph*/, - CharInfoPtr * /*ppci*/, - pointer /*pglyphBase*/); - - void (* PushPixels)( - GCPtr /*pGC*/, - PixmapPtr /*pBitMap*/, - DrawablePtr /*pDst*/, - int /*w*/, - int /*h*/, - int /*x*/, - int /*y*/); - - DevUnion devPrivate; -} GCOps; - -/* there is padding in the bit fields because the Sun compiler doesn't - * force alignment to 32-bit boundaries. losers. - */ -typedef struct _GC { - ScreenPtr pScreen; - unsigned char depth; - unsigned char alu; - unsigned short lineWidth; - unsigned short dashOffset; - unsigned short numInDashList; - unsigned char *dash; - unsigned int lineStyle : 2; - unsigned int capStyle : 2; - unsigned int joinStyle : 2; - unsigned int fillStyle : 2; - unsigned int fillRule : 1; - unsigned int arcMode : 1; - unsigned int subWindowMode : 1; - unsigned int graphicsExposures : 1; - unsigned int clientClipType : 2; /* CT_<kind> */ - unsigned int miTranslate:1; /* should mi things translate? */ - unsigned int tileIsPixel:1; /* tile is solid pixel */ - unsigned int fExpose:1; /* Call exposure handling */ - unsigned int freeCompClip:1; /* Free composite clip */ - unsigned int unused:14; /* see comment above */ - unsigned long planemask; - unsigned long fgPixel; - unsigned long bgPixel; - /* - * alas -- both tile and stipple must be here as they - * are independently specifiable - */ - PixUnion tile; - PixmapPtr stipple; - DDXPointRec patOrg; /* origin for (tile, stipple) */ - struct _Font *font; - DDXPointRec clipOrg; - DDXPointRec lastWinOrg; /* position of window last validated */ - pointer clientClip; - unsigned long stateChanges; /* masked with GC_<kind> */ - unsigned long serialNumber; - GCFuncs *funcs; - GCOps *ops; - PrivateRec *devPrivates; - /* - * The following were moved here from private storage to allow device- - * independent access to them from screen wrappers. - * --- 1997.11.03 Marc Aurele La France (tsi@xfree86.org) - */ - PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */ - RegionPtr pCompositeClip; - /* fExpose & freeCompClip defined above */ -} GC; - -#endif /* GCSTRUCT_H */ +/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+
+
+#ifndef GCSTRUCT_H
+#define GCSTRUCT_H
+
+#include "gc.h"
+
+#include "regionstr.h"
+#include "region.h"
+#include "pixmap.h"
+#include "screenint.h"
+#include "privates.h"
+#include <X11/Xprotostr.h>
+
+#define GCAllBits ((1 << (GCLastBit + 1)) - 1)
+
+/*
+ * functions which modify the state of the GC
+ */
+
+typedef struct _GCFuncs {
+ void (* ValidateGC)(
+ GCPtr /*pGC*/,
+ unsigned long /*stateChanges*/,
+ DrawablePtr /*pDrawable*/);
+
+ void (* ChangeGC)(
+ GCPtr /*pGC*/,
+ unsigned long /*mask*/);
+
+ void (* CopyGC)(
+ GCPtr /*pGCSrc*/,
+ unsigned long /*mask*/,
+ GCPtr /*pGCDst*/);
+
+ void (* DestroyGC)(
+ GCPtr /*pGC*/);
+
+ void (* ChangeClip)(
+ GCPtr /*pGC*/,
+ int /*type*/,
+ pointer /*pvalue*/,
+ int /*nrects*/);
+
+ void (* DestroyClip)(
+ GCPtr /*pGC*/);
+
+ void (* CopyClip)(
+ GCPtr /*pgcDst*/,
+ GCPtr /*pgcSrc*/);
+ DevUnion devPrivate;
+} GCFuncs;
+
+/*
+ * graphics operations invoked through a GC
+ */
+
+typedef struct _GCOps {
+ void (* FillSpans)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*nInit*/,
+ DDXPointPtr /*pptInit*/,
+ int * /*pwidthInit*/,
+ int /*fSorted*/);
+
+ void (* SetSpans)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ char * /*psrc*/,
+ DDXPointPtr /*ppt*/,
+ int * /*pwidth*/,
+ int /*nspans*/,
+ int /*fSorted*/);
+
+ void (* PutImage)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*depth*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ int /*leftPad*/,
+ int /*format*/,
+ char * /*pBits*/);
+
+ RegionPtr (* CopyArea)(
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ GCPtr /*pGC*/,
+ int /*srcx*/,
+ int /*srcy*/,
+ int /*w*/,
+ int /*h*/,
+ int /*dstx*/,
+ int /*dsty*/);
+
+ RegionPtr (* CopyPlane)(
+ DrawablePtr /*pSrcDrawable*/,
+ DrawablePtr /*pDstDrawable*/,
+ GCPtr /*pGC*/,
+ int /*srcx*/,
+ int /*srcy*/,
+ int /*width*/,
+ int /*height*/,
+ int /*dstx*/,
+ int /*dsty*/,
+ unsigned long /*bitPlane*/);
+ void (* PolyPoint)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*mode*/,
+ int /*npt*/,
+ DDXPointPtr /*pptInit*/);
+
+ void (* Polylines)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*mode*/,
+ int /*npt*/,
+ DDXPointPtr /*pptInit*/);
+
+ void (* PolySegment)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*nseg*/,
+ xSegment * /*pSegs*/);
+
+ void (* PolyRectangle)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*nrects*/,
+ xRectangle * /*pRects*/);
+
+ void (* PolyArc)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*narcs*/,
+ xArc * /*parcs*/);
+
+ void (* FillPolygon)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*shape*/,
+ int /*mode*/,
+ int /*count*/,
+ DDXPointPtr /*pPts*/);
+
+ void (* PolyFillRect)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*nrectFill*/,
+ xRectangle * /*prectInit*/);
+
+ void (* PolyFillArc)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*narcs*/,
+ xArc * /*parcs*/);
+
+ int (* PolyText8)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*x*/,
+ int /*y*/,
+ int /*count*/,
+ char * /*chars*/);
+
+ int (* PolyText16)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*x*/,
+ int /*y*/,
+ int /*count*/,
+ unsigned short * /*chars*/);
+
+ void (* ImageText8)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*x*/,
+ int /*y*/,
+ int /*count*/,
+ char * /*chars*/);
+
+ void (* ImageText16)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*x*/,
+ int /*y*/,
+ int /*count*/,
+ unsigned short * /*chars*/);
+
+ void (* ImageGlyphBlt)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*x*/,
+ int /*y*/,
+ unsigned int /*nglyph*/,
+ CharInfoPtr * /*ppci*/,
+ pointer /*pglyphBase*/);
+
+ void (* PolyGlyphBlt)(
+ DrawablePtr /*pDrawable*/,
+ GCPtr /*pGC*/,
+ int /*x*/,
+ int /*y*/,
+ unsigned int /*nglyph*/,
+ CharInfoPtr * /*ppci*/,
+ pointer /*pglyphBase*/);
+
+ void (* PushPixels)(
+ GCPtr /*pGC*/,
+ PixmapPtr /*pBitMap*/,
+ DrawablePtr /*pDst*/,
+ int /*w*/,
+ int /*h*/,
+ int /*x*/,
+ int /*y*/);
+
+ DevUnion devPrivate;
+} GCOps;
+
+/* there is padding in the bit fields because the Sun compiler doesn't
+ * force alignment to 32-bit boundaries. losers.
+ */
+typedef struct _GC {
+ ScreenPtr pScreen;
+ unsigned char depth;
+ unsigned char alu;
+ unsigned short lineWidth;
+ unsigned short dashOffset;
+ unsigned short numInDashList;
+ unsigned char *dash;
+ unsigned int lineStyle : 2;
+ unsigned int capStyle : 2;
+ unsigned int joinStyle : 2;
+ unsigned int fillStyle : 2;
+ unsigned int fillRule : 1;
+ unsigned int arcMode : 1;
+ unsigned int subWindowMode : 1;
+ unsigned int graphicsExposures : 1;
+ unsigned int clientClipType : 2; /* CT_<kind> */
+ unsigned int miTranslate:1; /* should mi things translate? */
+ unsigned int tileIsPixel:1; /* tile is solid pixel */
+ unsigned int fExpose:1; /* Call exposure handling */
+ unsigned int freeCompClip:1; /* Free composite clip */
+ unsigned int unused:14; /* see comment above */
+ unsigned long planemask;
+ unsigned long fgPixel;
+ unsigned long bgPixel;
+ /*
+ * alas -- both tile and stipple must be here as they
+ * are independently specifiable
+ */
+ PixUnion tile;
+ PixmapPtr stipple;
+ DDXPointRec patOrg; /* origin for (tile, stipple) */
+ struct _Font *font;
+ DDXPointRec clipOrg;
+ DDXPointRec lastWinOrg; /* position of window last validated */
+ pointer clientClip;
+ unsigned long stateChanges; /* masked with GC_<kind> */
+ unsigned long serialNumber;
+ GCFuncs *funcs;
+ GCOps *ops;
+ PrivateRec *devPrivates;
+ /*
+ * The following were moved here from private storage to allow device-
+ * independent access to them from screen wrappers.
+ * --- 1997.11.03 Marc Aurele La France (tsi@xfree86.org)
+ */
+ PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */
+ RegionPtr pCompositeClip;
+ /* fExpose & freeCompClip defined above */
+} GC;
+
+#endif /* GCSTRUCT_H */
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h index c7add253e..6cc29c024 100644 --- a/xorg-server/include/misc.h +++ b/xorg-server/include/misc.h @@ -1,298 +1,292 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -Copyright 1992, 1993 Data General Corporation; -Copyright 1992, 1993 OMRON Corporation - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that the -above copyright notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting documentation, and that -neither the name OMRON or DATA GENERAL be used in advertising or publicity -pertaining to distribution of the software without specific, written prior -permission of the party whose name is to be used. Neither OMRON or -DATA GENERAL make any representation about the suitability of this software -for any purpose. It is provided "as is" without express or implied warranty. - -OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, -IN NO EVENT SHALL OMRON OR DATA GENERAL BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -OF THIS SOFTWARE. - -******************************************************************/ -#ifndef MISC_H -#define MISC_H 1 -/* - * X internal definitions - * - */ - -#include <X11/Xosdefs.h> -#include <X11/Xfuncproto.h> -#include <X11/Xmd.h> -#include <X11/X.h> -#include <X11/Xdefs.h> - -#include <stddef.h> - -#ifndef MAXSCREENS -#define MAXSCREENS 16 -#endif -#define MAXCLIENTS 256 -#define MAXEXTENSIONS 128 -#define MAXFORMATS 8 -#define MAXDEVICES 40 /* input devices */ - -#define EXTENSION_EVENT_BASE 64 -#define EXTENSION_BASE 128 - -typedef unsigned long PIXEL; -typedef unsigned long ATOM; - - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifdef __GNUC__ -#define X_DEPRECATED __attribute__((deprecated)) -#else -#define X_DEPRECATED -#endif - -#ifndef _XTYPEDEF_CALLBACKLISTPTR -typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */ -#define _XTYPEDEF_CALLBACKLISTPTR -#endif - -typedef struct _xReq *xReqPtr; - -#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */ -#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */ - -#define NullBox ((BoxPtr)0) -#define MILLI_PER_MIN (1000 * 60) -#define MILLI_PER_SECOND (1000) - - /* this next is used with None and ParentRelative to tell - PaintWin() what to use to paint the background. Also used - in the macro IS_VALID_PIXMAP */ - -#define USE_BACKGROUND_PIXEL 3 -#define USE_BORDER_PIXEL 3 - - -/* byte swap a 32-bit literal */ -#define lswapl(x) ((((x) & 0xff) << 24) |\ - (((x) & 0xff00) << 8) |\ - (((x) & 0xff0000) >> 8) |\ - (((x) >> 24) & 0xff)) - -/* byte swap a short literal */ -#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff)) - -#undef min -#undef max - -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) -/* abs() is a function, not a macro; include the file declaring - * it in case we haven't done that yet. - */ -#include <stdlib.h> -#ifndef Fabs -#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */ -#endif -#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0)) -/* this assumes b > 0 */ -#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b) -/* - * return the least significant bit in x which is set - * - * This works on 1's complement and 2's complement machines. - * If you care about the extra instruction on 2's complement - * machines, change to ((x) & (-(x))) - */ -#define lowbit(x) ((x) & (~(x) + 1)) - -/* XXX Not for modules */ -#include <limits.h> -#if !defined(MAXSHORT) || !defined(MINSHORT) || \ - !defined(MAXINT) || !defined(MININT) -/* - * Some implementations #define these through <math.h>, so preclude - * #include'ing it later. - */ - -#include <math.h> -#undef MAXSHORT -#define MAXSHORT SHRT_MAX -#undef MINSHORT -#define MINSHORT SHRT_MIN -#undef MAXINT -#define MAXINT INT_MAX -#undef MININT -#define MININT INT_MIN - -#include <assert.h> -#include <ctype.h> -#include <stdio.h> /* for fopen, etc... */ - -#endif - -/** - * Calculate the number of bytes needed to hold bits. - * @param bits The minimum number of bits needed. - * @return The number of bytes needed to hold bits. - */ -static inline int -bits_to_bytes(const int bits) { - return ((bits + 7) >> 3); -} -/** - * Calculate the number of 4-byte units needed to hold the given number of - * bytes. - * @param bytes The minimum number of bytes needed. - * @return The number of 4-byte units needed to hold bytes. - */ -static inline int -bytes_to_int32(const int bytes) { - return (((bytes) + 3) >> 2); -} - -/** - * Calculate the number of bytes (in multiples of 4) needed to hold bytes. - * @param bytes The minimum number of bytes needed. - * @return The closest multiple of 4 that is equal or higher than bytes. - */ -static inline int -pad_to_int32(const int bytes) { - return (((bytes) + 3) & ~3); -} - -extern char** -xstrtokenize(const char *str, const char* separators); - -/* some macros to help swap requests, replies, and events */ - -#define LengthRestB(stuff) \ - ((client->req_len << 2) - sizeof(*stuff)) - -#define LengthRestS(stuff) \ - ((client->req_len << 1) - (sizeof(*stuff) >> 1)) - -#define LengthRestL(stuff) \ - (client->req_len - (sizeof(*stuff) >> 2)) - -#define SwapRestS(stuff) \ - SwapShorts((short *)(stuff + 1), LengthRestS(stuff)) - -#define SwapRestL(stuff) \ - SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) - -/* byte swap a 32-bit value */ -#define swapl(x, n) { \ - n = ((char *) (x))[0];\ - ((char *) (x))[0] = ((char *) (x))[3];\ - ((char *) (x))[3] = n;\ - n = ((char *) (x))[1];\ - ((char *) (x))[1] = ((char *) (x))[2];\ - ((char *) (x))[2] = n; } - -/* byte swap a short */ -#define swaps(x, n) { \ - n = ((char *) (x))[0];\ - ((char *) (x))[0] = ((char *) (x))[1];\ - ((char *) (x))[1] = n; } - -/* copy 32-bit value from src to dst byteswapping on the way */ -#define cpswapl(src, dst) { \ - ((char *)&(dst))[0] = ((char *) &(src))[3];\ - ((char *)&(dst))[1] = ((char *) &(src))[2];\ - ((char *)&(dst))[2] = ((char *) &(src))[1];\ - ((char *)&(dst))[3] = ((char *) &(src))[0]; } - -/* copy short from src to dst byteswapping on the way */ -#define cpswaps(src, dst) { \ - ((char *) &(dst))[0] = ((char *) &(src))[1];\ - ((char *) &(dst))[1] = ((char *) &(src))[0]; } - -extern _X_EXPORT void SwapLongs( - CARD32 *list, - unsigned long count); - -extern _X_EXPORT void SwapShorts( - short *list, - unsigned long count); - -extern _X_EXPORT void MakePredeclaredAtoms(void); - -extern _X_EXPORT int Ones( - unsigned long /*mask*/); - -typedef struct _xPoint *DDXPointPtr; -typedef struct pixman_box16 *BoxPtr; -typedef struct _xEvent *xEventPtr; -typedef struct _xRectangle *xRectanglePtr; -typedef struct _GrabRec *GrabPtr; - -/* typedefs from other places - duplicated here to minimize the amount - * of unnecessary junk that one would normally have to include to get - * these symbols defined - */ - -#ifndef _XTYPEDEF_CHARINFOPTR -typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */ -#define _XTYPEDEF_CHARINFOPTR -#endif - -extern _X_EXPORT unsigned long globalSerialNumber; -extern _X_EXPORT unsigned long serverGeneration; - -#endif /* MISC_H */ +/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+Copyright 1992, 1993 Data General Corporation;
+Copyright 1992, 1993 OMRON Corporation
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that the
+above copyright notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting documentation, and that
+neither the name OMRON or DATA GENERAL be used in advertising or publicity
+pertaining to distribution of the software without specific, written prior
+permission of the party whose name is to be used. Neither OMRON or
+DATA GENERAL make any representation about the suitability of this software
+for any purpose. It is provided "as is" without express or implied warranty.
+
+OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+IN NO EVENT SHALL OMRON OR DATA GENERAL BE LIABLE FOR ANY SPECIAL, INDIRECT
+OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+OF THIS SOFTWARE.
+
+******************************************************************/
+#ifndef MISC_H
+#define MISC_H 1
+/*
+ * X internal definitions
+ *
+ */
+
+#include <X11/Xosdefs.h>
+#include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
+#include <X11/X.h>
+#include <X11/Xdefs.h>
+
+#include <stddef.h>
+
+#ifndef MAXSCREENS
+#define MAXSCREENS 16
+#endif
+#define MAXCLIENTS 256
+#define MAXEXTENSIONS 128
+#define MAXFORMATS 8
+#define MAXDEVICES 40 /* input devices */
+
+#define EXTENSION_EVENT_BASE 64
+#define EXTENSION_BASE 128
+
+typedef unsigned long PIXEL;
+typedef unsigned long ATOM;
+
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+
+#ifndef _XTYPEDEF_CALLBACKLISTPTR
+typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
+#define _XTYPEDEF_CALLBACKLISTPTR
+#endif
+
+typedef struct _xReq *xReqPtr;
+
+#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
+#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
+
+#define NullBox ((BoxPtr)0)
+#define MILLI_PER_MIN (1000 * 60)
+#define MILLI_PER_SECOND (1000)
+
+ /* this next is used with None and ParentRelative to tell
+ PaintWin() what to use to paint the background. Also used
+ in the macro IS_VALID_PIXMAP */
+
+#define USE_BACKGROUND_PIXEL 3
+#define USE_BORDER_PIXEL 3
+
+
+/* byte swap a 32-bit literal */
+#define lswapl(x) ((((x) & 0xff) << 24) |\
+ (((x) & 0xff00) << 8) |\
+ (((x) & 0xff0000) >> 8) |\
+ (((x) >> 24) & 0xff))
+
+/* byte swap a short literal */
+#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
+
+#undef min
+#undef max
+
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+/* abs() is a function, not a macro; include the file declaring
+ * it in case we haven't done that yet.
+ */
+#include <stdlib.h>
+#ifndef Fabs
+#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
+#endif
+#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
+/* this assumes b > 0 */
+#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
+/*
+ * return the least significant bit in x which is set
+ *
+ * This works on 1's complement and 2's complement machines.
+ * If you care about the extra instruction on 2's complement
+ * machines, change to ((x) & (-(x)))
+ */
+#define lowbit(x) ((x) & (~(x) + 1))
+
+/* XXX Not for modules */
+#include <limits.h>
+#if !defined(MAXSHORT) || !defined(MINSHORT) || \
+ !defined(MAXINT) || !defined(MININT)
+/*
+ * Some implementations #define these through <math.h>, so preclude
+ * #include'ing it later.
+ */
+
+#include <math.h>
+#undef MAXSHORT
+#define MAXSHORT SHRT_MAX
+#undef MINSHORT
+#define MINSHORT SHRT_MIN
+#undef MAXINT
+#define MAXINT INT_MAX
+#undef MININT
+#define MININT INT_MIN
+
+#include <assert.h>
+#include <ctype.h>
+#include <stdio.h> /* for fopen, etc... */
+
+#endif
+
+/**
+ * Calculate the number of bytes needed to hold bits.
+ * @param bits The minimum number of bits needed.
+ * @return The number of bytes needed to hold bits.
+ */
+static inline int
+bits_to_bytes(const int bits) {
+ return ((bits + 7) >> 3);
+}
+/**
+ * Calculate the number of 4-byte units needed to hold the given number of
+ * bytes.
+ * @param bytes The minimum number of bytes needed.
+ * @return The number of 4-byte units needed to hold bytes.
+ */
+static inline int
+bytes_to_int32(const int bytes) {
+ return (((bytes) + 3) >> 2);
+}
+
+/**
+ * Calculate the number of bytes (in multiples of 4) needed to hold bytes.
+ * @param bytes The minimum number of bytes needed.
+ * @return The closest multiple of 4 that is equal or higher than bytes.
+ */
+static inline int
+pad_to_int32(const int bytes) {
+ return (((bytes) + 3) & ~3);
+}
+
+extern char**
+xstrtokenize(const char *str, const char* separators);
+
+/* some macros to help swap requests, replies, and events */
+
+#define LengthRestB(stuff) \
+ ((client->req_len << 2) - sizeof(*stuff))
+
+#define LengthRestS(stuff) \
+ ((client->req_len << 1) - (sizeof(*stuff) >> 1))
+
+#define LengthRestL(stuff) \
+ (client->req_len - (sizeof(*stuff) >> 2))
+
+#define SwapRestS(stuff) \
+ SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
+
+#define SwapRestL(stuff) \
+ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
+
+/* byte swap a 32-bit value */
+#define swapl(x, n) { \
+ n = ((char *) (x))[0];\
+ ((char *) (x))[0] = ((char *) (x))[3];\
+ ((char *) (x))[3] = n;\
+ n = ((char *) (x))[1];\
+ ((char *) (x))[1] = ((char *) (x))[2];\
+ ((char *) (x))[2] = n; }
+
+/* byte swap a short */
+#define swaps(x, n) { \
+ n = ((char *) (x))[0];\
+ ((char *) (x))[0] = ((char *) (x))[1];\
+ ((char *) (x))[1] = n; }
+
+/* copy 32-bit value from src to dst byteswapping on the way */
+#define cpswapl(src, dst) { \
+ ((char *)&(dst))[0] = ((char *) &(src))[3];\
+ ((char *)&(dst))[1] = ((char *) &(src))[2];\
+ ((char *)&(dst))[2] = ((char *) &(src))[1];\
+ ((char *)&(dst))[3] = ((char *) &(src))[0]; }
+
+/* copy short from src to dst byteswapping on the way */
+#define cpswaps(src, dst) { \
+ ((char *) &(dst))[0] = ((char *) &(src))[1];\
+ ((char *) &(dst))[1] = ((char *) &(src))[0]; }
+
+extern _X_EXPORT void SwapLongs(
+ CARD32 *list,
+ unsigned long count);
+
+extern _X_EXPORT void SwapShorts(
+ short *list,
+ unsigned long count);
+
+extern _X_EXPORT void MakePredeclaredAtoms(void);
+
+extern _X_EXPORT int Ones(
+ unsigned long /*mask*/);
+
+typedef struct _xPoint *DDXPointPtr;
+typedef struct pixman_box16 *BoxPtr;
+typedef struct _xEvent *xEventPtr;
+typedef struct _xRectangle *xRectanglePtr;
+typedef struct _GrabRec *GrabPtr;
+
+/* typedefs from other places - duplicated here to minimize the amount
+ * of unnecessary junk that one would normally have to include to get
+ * these symbols defined
+ */
+
+#ifndef _XTYPEDEF_CHARINFOPTR
+typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
+#define _XTYPEDEF_CHARINFOPTR
+#endif
+
+extern _X_EXPORT unsigned long globalSerialNumber;
+extern _X_EXPORT unsigned long serverGeneration;
+
+#endif /* MISC_H */
diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h index 06dacd326..5b9b05c4a 100644 --- a/xorg-server/include/os.h +++ b/xorg-server/include/os.h @@ -214,21 +214,58 @@ extern _X_EXPORT int set_font_authorizations( #ifndef _HAVE_XALLOC_DECLS
#define _HAVE_XALLOC_DECLS
-extern _X_EXPORT pointer Xalloc(unsigned long /*amount*/);
-extern _X_EXPORT pointer Xcalloc(unsigned long /*amount*/);
-extern _X_EXPORT pointer Xrealloc(pointer /*ptr*/, unsigned long /*amount*/);
-extern _X_EXPORT void Xfree(pointer /*ptr*/);
+
+/*
+ * Use malloc(3) instead.
+ */
+extern _X_EXPORT void *Xalloc(unsigned long /*amount*/) _X_DEPRECATED;
+/*
+ * Use calloc(3) instead
+ */
+extern _X_EXPORT void *Xcalloc(unsigned long /*amount*/) _X_DEPRECATED;
+/*
+ * Use realloc(3) instead
+ */
+extern _X_EXPORT void *Xrealloc(void * /*ptr*/, unsigned long /*amount*/)
+ _X_DEPRECATED;
+/*
+ * Use free(3) instead
+ */
+extern _X_EXPORT void Xfree(void * /*ptr*/) _X_DEPRECATED;
+
#endif
-extern _X_EXPORT pointer XNFalloc(unsigned long /*amount*/);
-extern _X_EXPORT pointer XNFcalloc(unsigned long /*amount*/);
-extern _X_EXPORT pointer XNFrealloc(pointer /*ptr*/, unsigned long /*amount*/);
+/*
+ * This function malloc(3)s buffer, terminating the server if there is not
+ * enough memory.
+ */
+extern _X_EXPORT void *XNFalloc(unsigned long /*amount*/);
+/*
+ * This function calloc(3)s buffer, terminating the server if there is not
+ * enough memory.
+ */
+extern _X_EXPORT void *XNFcalloc(unsigned long /*amount*/);
+/*
+ * This function realloc(3)s passed buffer, terminating the server if there is
+ * not enough memory.
+ */
+extern _X_EXPORT void *XNFrealloc(void * /*ptr*/, unsigned long /*amount*/);
+/*
+ * This function strdup(3)s passed string. The only difference from the library
+ * function that it is safe to pass NULL, as NULL will be returned.
+ */
extern _X_EXPORT char *Xstrdup(const char *s);
+
+/*
+ * This function strdup(3)s passed string, terminating the server if there is
+ * not enough memory. If NULL is passed to this function, NULL is returned.
+ */
extern _X_EXPORT char *XNFstrdup(const char *s);
-extern _X_EXPORT char *Xprintf(const char *fmt, ...);
+
+extern _X_EXPORT char *Xprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern _X_EXPORT char *Xvprintf(const char *fmt, va_list va);
-extern _X_EXPORT char *XNFprintf(const char *fmt, ...);
+extern _X_EXPORT char *XNFprintf(const char *fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern _X_EXPORT char *XNFvprintf(const char *fmt, va_list va);
typedef void (*OsSigHandlerPtr)(int /* sig */);
@@ -262,7 +299,7 @@ extern _X_EXPORT void OsBlockSignals (void); extern _X_EXPORT void OsReleaseSignals (void);
-extern _X_EXPORT void OsAbort (void);
+extern _X_EXPORT void OsAbort (void) _X_NORETURN;
#if !defined(WIN32)
extern _X_EXPORT int System(char *);
@@ -488,32 +525,21 @@ typedef enum { X_UNKNOWN = -1 /* unknown -- this must always be last */
} MessageType;
-/* XXX Need to check which GCC versions have the format(printf) attribute. */
-#if defined(__GNUC__) && (__GNUC__ > 2)
-#define _printf_attribute(a,b) __attribute((format(__printf__,a,b)))
-#else
-#define _printf_attribute(a,b) /**/
-#endif
-
extern _X_EXPORT const char *LogInit(const char *fname, const char *backup);
extern _X_EXPORT void LogClose(void);
extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value);
extern _X_EXPORT void LogVWrite(int verb, const char *f, va_list args);
-extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _printf_attribute(2,3);
+extern _X_EXPORT void LogWrite(int verb, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format,
va_list args);
extern _X_EXPORT void LogMessageVerb(MessageType type, int verb, const char *format,
- ...) _printf_attribute(3,4);
+ ...) _X_ATTRIBUTE_PRINTF(3,4);
extern _X_EXPORT void LogMessage(MessageType type, const char *format, ...)
- _printf_attribute(2,3);
+ _X_ATTRIBUTE_PRINTF(2,3);
extern _X_EXPORT void FreeAuditTimer(void);
-extern _X_EXPORT void AuditF(const char *f, ...) _printf_attribute(1,2);
+extern _X_EXPORT void AuditF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern _X_EXPORT void VAuditF(const char *f, va_list args);
-extern _X_EXPORT void FatalError(const char *f, ...) _printf_attribute(1,2)
-#if defined(__GNUC__) && (__GNUC__ > 2)
-__attribute((noreturn))
-#endif
-;
+extern _X_EXPORT void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN;
#ifdef DEBUG
#define DebugF ErrorF
@@ -522,7 +548,7 @@ __attribute((noreturn)) #endif
extern _X_EXPORT void VErrorF(const char *f, va_list args);
-extern _X_EXPORT void ErrorF(const char *f, ...) _printf_attribute(1,2);
+extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern _X_EXPORT void Error(char *str);
extern _X_EXPORT void LogPrintMarkers(void);
diff --git a/xorg-server/include/privates.h b/xorg-server/include/privates.h index e6f788de1..cbb08887f 100644 --- a/xorg-server/include/privates.h +++ b/xorg-server/include/privates.h @@ -1,162 +1,136 @@ -/*********************************************************** - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************/ - -#ifndef PRIVATES_H -#define PRIVATES_H 1 - -#include "dix.h" -#include "resource.h" - -/***************************************************************** - * STUFF FOR PRIVATES - *****************************************************************/ - -typedef int *DevPrivateKey; -struct _Private; -typedef struct _Private PrivateRec; - -/* - * Request pre-allocated private space for your driver/module. This function - * increases the amount of space allocated automatically when dixLookupPrivate - * is called on a PrivateRec that does not yet have a value associated with - * 'key'. - * - * This function will only increase the reserved size: if a size was previously - * requested, then dixRequestPrivate causes later calls to dixLookupPrivate to - * allocate the maximum of the old size and 'size'. Requested sizes are reset - * to 0 by dixResetPrivates, which is called before each server generation. - * - * If dixRequestPrivate is not called with a nonzero size for 'key', then the - * module responsible for 'key' must manage the associated pointer itself with - * dixSetPrivate. - * - * dixRequestPrivate returns FALSE if it cannot store the requested size. - */ -extern _X_EXPORT int -dixRequestPrivate(const DevPrivateKey key, unsigned size); - -/* - * Allocates space for an association of 'key' with a value in 'privates'. - * - * If a nonzero size was requested with dixRequestPrivate, then - * dixAllocatePrivate also allocates the requested amount of memory and - * associates the pointer to that memory with 'key' in 'privates'. The - * allocated memory is initialized to zero. This memory can only be freed by - * dixFreePrivates. - * - * If dixRequestPrivate was never called with a nonzero size, then - * dixAllocatePrivate associates NULL with 'key' in 'privates'. - * - * dixAllocatePrivate returns a pointer to the value associated with 'key' in - * 'privates', unless a memory allocation fails, in which case it returns NULL. - */ -extern _X_EXPORT pointer * -dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key); - -/* - * Look up a private pointer. - * - * If no value is currently associated with 'key' in 'privates', then - * dixLookupPrivate calls dixAllocatePrivate and returns the resulting - * associated value. - * - * dixLookupPrivate returns NULL if a memory allocation fails. - */ -extern _X_EXPORT pointer -dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key); - -/* - * Look up the address of a private pointer. If 'key' is not associated with a - * value in 'privates', then dixLookupPrivateAddr calls dixAllocatePrivate and - * returns a pointer to the resulting associated value. - * - * dixLookupPrivateAddr returns NULL if 'key' was not previously associated in - * 'privates' and a memory allocation fails. - */ -extern _X_EXPORT pointer * -dixLookupPrivateAddr(PrivateRec **privates, const DevPrivateKey key); - -/* - * Associate 'val' with 'key' in 'privates' so that later calls to - * dixLookupPrivate(privates, key) will return 'val'. - * - * dixSetPrivate returns FALSE if a memory allocation fails. - */ -extern _X_EXPORT int -dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val); - -/* - * Register callbacks to be called on private allocation/freeing. - * The calldata argument to the callbacks is a PrivateCallbackPtr. - */ -typedef struct _PrivateCallback { - DevPrivateKey key; /* private registration key */ - pointer *value; /* address of private pointer */ -} PrivateCallbackRec; - -/* - * Register a function to be called when dixAllocPrivate successfully associates - * 'key' with a new PrivateRec. - */ -extern _X_EXPORT int -dixRegisterPrivateInitFunc(const DevPrivateKey key, - CallbackProcPtr callback, pointer userdata); - -/* - * Register a function to be called when dixFreePrivates unassociates 'key' with - * a PrivateRec. - */ -extern _X_EXPORT int -dixRegisterPrivateDeleteFunc(const DevPrivateKey key, - CallbackProcPtr callback, pointer userdata); - -/* - * Unassociates all keys from 'privates', calls the callbacks registered with - * dixRegisterPrivateDeleteFunc, and frees all private data automatically - * allocated via dixRequestPrivate. - */ -extern _X_EXPORT void -dixFreePrivates(PrivateRec *privates); - -/* - * Resets the privates subsystem. dixResetPrivates is called from the main loop - * before each server generation. This function must only be called by main(). - */ -extern _X_EXPORT int -dixResetPrivates(void); - -/* - * These next two functions are necessary because the position of - * the devPrivates field varies by structure and calling code might - * only know the resource type, not the structure definition. - */ - -/* - * Looks up the offset where the devPrivates field is located. - * Returns -1 if no offset has been registered for the resource type. - */ -extern _X_EXPORT int -dixLookupPrivateOffset(RESTYPE type); - -/* - * Specifies the offset where the devPrivates field is located. - * A negative value indicates no devPrivates field is available. - */ -extern _X_EXPORT int -dixRegisterPrivateOffset(RESTYPE type, int offset); - -/* - * Convenience macro for adding an offset to an object pointer - * when making a call to one of the devPrivates functions - */ -#define DEVPRIV_AT(ptr, offset) ((PrivateRec **)((char *)ptr + offset)) - -#endif /* PRIVATES_H */ +/***********************************************************
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************************************/
+
+#ifndef PRIVATES_H
+#define PRIVATES_H 1
+
+#include "dix.h"
+#include "resource.h"
+
+/*****************************************************************
+ * STUFF FOR PRIVATES
+ *****************************************************************/
+
+typedef int *DevPrivateKey;
+struct _Private;
+typedef struct _Private PrivateRec;
+
+/*
+ * Request pre-allocated private space for your driver/module. This function
+ * increases the amount of space allocated automatically when dixLookupPrivate
+ * is called on a PrivateRec that does not yet have a value associated with
+ * 'key'.
+ *
+ * This function will only increase the reserved size: if a size was previously
+ * requested, then dixRequestPrivate causes later calls to dixLookupPrivate to
+ * allocate the maximum of the old size and 'size'. Requested sizes are reset
+ * to 0 by dixResetPrivates, which is called before each server generation.
+ *
+ * If dixRequestPrivate is not called with a nonzero size for 'key', then the
+ * module responsible for 'key' must manage the associated pointer itself with
+ * dixSetPrivate.
+ *
+ * dixRequestPrivate returns FALSE if it cannot store the requested size.
+ */
+extern _X_EXPORT int
+dixRequestPrivate(const DevPrivateKey key, unsigned size);
+
+/*
+ * Allocates space for an association of 'key' with a value in 'privates'.
+ *
+ * If a nonzero size was requested with dixRequestPrivate, then
+ * dixAllocatePrivate also allocates the requested amount of memory and
+ * associates the pointer to that memory with 'key' in 'privates'. The
+ * allocated memory is initialized to zero. This memory can only be freed by
+ * dixFreePrivates.
+ *
+ * If dixRequestPrivate was never called with a nonzero size, then
+ * dixAllocatePrivate associates NULL with 'key' in 'privates'.
+ *
+ * dixAllocatePrivate returns a pointer to the value associated with 'key' in
+ * 'privates', unless a memory allocation fails, in which case it returns NULL.
+ */
+extern _X_EXPORT pointer *
+dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key);
+
+/*
+ * Look up a private pointer.
+ *
+ * If no value is currently associated with 'key' in 'privates', then
+ * dixLookupPrivate calls dixAllocatePrivate and returns the resulting
+ * associated value.
+ *
+ * dixLookupPrivate returns NULL if a memory allocation fails.
+ */
+extern _X_EXPORT pointer
+dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key);
+
+/*
+ * Look up the address of a private pointer. If 'key' is not associated with a
+ * value in 'privates', then dixLookupPrivateAddr calls dixAllocatePrivate and
+ * returns a pointer to the resulting associated value.
+ *
+ * dixLookupPrivateAddr returns NULL if 'key' was not previously associated in
+ * 'privates' and a memory allocation fails.
+ */
+extern _X_EXPORT pointer *
+dixLookupPrivateAddr(PrivateRec **privates, const DevPrivateKey key);
+
+/*
+ * Associate 'val' with 'key' in 'privates' so that later calls to
+ * dixLookupPrivate(privates, key) will return 'val'.
+ *
+ * dixSetPrivate returns FALSE if a memory allocation fails.
+ */
+extern _X_EXPORT int
+dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val);
+
+/*
+ * Unassociates all keys from 'privates' and frees all private data automatically
+ * allocated via dixRequestPrivate.
+ */
+extern _X_EXPORT void
+dixFreePrivates(PrivateRec *privates);
+
+/*
+ * Resets the privates subsystem. dixResetPrivates is called from the main loop
+ * before each server generation. This function must only be called by main().
+ */
+extern _X_EXPORT int
+dixResetPrivates(void);
+
+/*
+ * These next two functions are necessary because the position of
+ * the devPrivates field varies by structure and calling code might
+ * only know the resource type, not the structure definition.
+ */
+
+/*
+ * Looks up the offset where the devPrivates field is located.
+ * Returns -1 if no offset has been registered for the resource type.
+ */
+extern _X_EXPORT int
+dixLookupPrivateOffset(RESTYPE type);
+
+/*
+ * Specifies the offset where the devPrivates field is located.
+ * A negative value indicates no devPrivates field is available.
+ */
+extern _X_EXPORT int
+dixRegisterPrivateOffset(RESTYPE type, int offset);
+
+/*
+ * Convenience macro for adding an offset to an object pointer
+ * when making a call to one of the devPrivates functions
+ */
+#define DEVPRIV_AT(ptr, offset) ((PrivateRec **)((char *)ptr + offset))
+
+#endif /* PRIVATES_H */
diff --git a/xorg-server/include/regionstr.h b/xorg-server/include/regionstr.h index eead1a1f2..d67873295 100644 --- a/xorg-server/include/regionstr.h +++ b/xorg-server/include/regionstr.h @@ -1,293 +1,293 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef REGIONSTRUCT_H -#define REGIONSTRUCT_H - -typedef struct pixman_region16 RegionRec, *RegionPtr; - -#include "miscstruct.h" - -/* Return values from RectIn() */ - -#define rgnOUT 0 -#define rgnIN 1 -#define rgnPART 2 - -#define NullRegion ((RegionPtr)0) - -/* - * clip region - */ - -typedef struct pixman_region16_data RegDataRec, *RegDataPtr; - -extern _X_EXPORT BoxRec miEmptyBox; -extern _X_EXPORT RegDataRec miEmptyData; -extern _X_EXPORT RegDataRec miBrokenData; - -#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects) -/* not a region */ -#define REGION_NAR(reg) ((reg)->data == &miBrokenData) -#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1) -#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0) -#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \ - : &(reg)->extents) -#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1)) -#define REGION_BOX(reg,i) (®ION_BOXPTR(reg)[i]) -#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects) -#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1) -#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))) - -#define REGION_CREATE(_pScreen, _rect, _size) \ - miRegionCreate(_rect, _size) - -#define REGION_COPY(_pScreen, dst, src) \ - miRegionCopy(dst, src) - -#define REGION_DESTROY(_pScreen, _pReg) \ - miRegionDestroy(_pReg) - -#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ - miIntersect(newReg, reg1, reg2) - -#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ - miUnion(newReg, reg1, reg2) - -#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ - miSubtract(newReg, reg1, reg2) - -#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ - miInverse(newReg, reg1, invRect) - -#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ - miTranslateRegion(_pReg, _x, _y) - -#define RECT_IN_REGION(_pScreen, _pReg, prect) \ - miRectIn(_pReg, prect) - -#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ - miPointInRegion(_pReg, _x, _y, prect) - -#define REGION_APPEND(_pScreen, dstrgn, rgn) \ - miRegionAppend(dstrgn, rgn) - -#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ - miRegionValidate(badreg, pOverlap) - -#define BITMAP_TO_REGION(_pScreen, pPix) \ - (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */ - -#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ - miRectsToRegion(nrects, prect, ctype) - -#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ - miRegionEqual(_pReg1, _pReg2) - -#define REGION_BREAK(_pScreen, _pReg) \ - miRegionBreak(_pReg) - -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ -{ \ - if ((_rect) != NULL) \ - { \ - (_pReg)->extents = *(_rect); \ - (_pReg)->data = (RegDataPtr)NULL; \ - } \ - else \ - { \ - (_pReg)->extents = miEmptyBox; \ - if (((_size) > 1) && ((_pReg)->data = \ - (RegDataPtr)xalloc(REGION_SZOF(_size)))) \ - { \ - (_pReg)->data->size = (_size); \ - (_pReg)->data->numRects = 0; \ - } \ - else \ - (_pReg)->data = &miEmptyData; \ - } \ - } - - -#define REGION_UNINIT(_pScreen, _pReg) \ -{ \ - if ((_pReg)->data && (_pReg)->data->size) { \ - xfree((_pReg)->data); \ - (_pReg)->data = NULL; \ - } \ -} - -#define REGION_RESET(_pScreen, _pReg, _pBox) \ -{ \ - (_pReg)->extents = *(_pBox); \ - REGION_UNINIT(_pScreen, _pReg); \ - (_pReg)->data = (RegDataPtr)NULL; \ -} - -#define REGION_NOTEMPTY(_pScreen, _pReg) \ - !REGION_NIL(_pReg) - -#define REGION_BROKEN(_pScreen, _pReg) \ - REGION_NAR(_pReg) - -#define REGION_EMPTY(_pScreen, _pReg) \ -{ \ - REGION_UNINIT(_pScreen, _pReg); \ - (_pReg)->extents.x2 = (_pReg)->extents.x1; \ - (_pReg)->extents.y2 = (_pReg)->extents.y1; \ - (_pReg)->data = &miEmptyData; \ -} - -#define REGION_EXTENTS(_pScreen, _pReg) \ - (&(_pReg)->extents) - -#define REGION_NULL(_pScreen, _pReg) \ -{ \ - (_pReg)->extents = miEmptyBox; \ - (_pReg)->data = &miEmptyData; \ -} - -#ifndef REGION_NULL -#define REGION_NULL(_pScreen, _pReg) \ - REGION_INIT(_pScreen, _pReg, NullBox, 1) -#endif - -/* moved from mi.h */ - -extern _X_EXPORT void InitRegions (void); - -extern _X_EXPORT RegionPtr miRegionCreate( - BoxPtr /*rect*/, - int /*size*/); - -extern _X_EXPORT void miRegionInit( - RegionPtr /*pReg*/, - BoxPtr /*rect*/, - int /*size*/); - -extern _X_EXPORT void miRegionDestroy( - RegionPtr /*pReg*/); - -extern _X_EXPORT void miRegionUninit( - RegionPtr /*pReg*/); - -extern _X_EXPORT Bool miRegionCopy( - RegionPtr /*dst*/, - RegionPtr /*src*/); - -extern _X_EXPORT Bool miIntersect( - RegionPtr /*newReg*/, - RegionPtr /*reg1*/, - RegionPtr /*reg2*/); - -extern _X_EXPORT Bool miUnion( - RegionPtr /*newReg*/, - RegionPtr /*reg1*/, - RegionPtr /*reg2*/); - -extern _X_EXPORT Bool miRegionAppend( - RegionPtr /*dstrgn*/, - RegionPtr /*rgn*/); - -extern _X_EXPORT Bool miRegionValidate( - RegionPtr /*badreg*/, - Bool * /*pOverlap*/); - -extern _X_EXPORT RegionPtr miRectsToRegion( - int /*nrects*/, - xRectanglePtr /*prect*/, - int /*ctype*/); - -extern _X_EXPORT Bool miSubtract( - RegionPtr /*regD*/, - RegionPtr /*regM*/, - RegionPtr /*regS*/); - -extern _X_EXPORT Bool miInverse( - RegionPtr /*newReg*/, - RegionPtr /*reg1*/, - BoxPtr /*invRect*/); - -extern _X_EXPORT int miRectIn( - RegionPtr /*region*/, - BoxPtr /*prect*/); - -extern _X_EXPORT void miTranslateRegion( - RegionPtr /*pReg*/, - int /*x*/, - int /*y*/); - -extern _X_EXPORT void miRegionReset( - RegionPtr /*pReg*/, - BoxPtr /*pBox*/); - -extern _X_EXPORT Bool miRegionBreak( - RegionPtr /*pReg*/); - -extern _X_EXPORT Bool miPointInRegion( - RegionPtr /*pReg*/, - int /*x*/, - int /*y*/, - BoxPtr /*box*/); - -extern _X_EXPORT Bool miRegionEqual( - RegionPtr /*pReg1*/, - RegionPtr /*pReg2*/); - -extern _X_EXPORT Bool miRegionNotEmpty( - RegionPtr /*pReg*/); - -extern _X_EXPORT void miRegionEmpty( - RegionPtr /*pReg*/); - -extern _X_EXPORT BoxPtr miRegionExtents( - RegionPtr /*pReg*/); - -extern _X_EXPORT void miPrintRegion( - RegionPtr /*pReg*/); - -#endif /* REGIONSTRUCT_H */ +/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef REGIONSTRUCT_H
+#define REGIONSTRUCT_H
+
+typedef struct pixman_region16 RegionRec, *RegionPtr;
+
+#include "miscstruct.h"
+
+/* Return values from RectIn() */
+
+#define rgnOUT 0
+#define rgnIN 1
+#define rgnPART 2
+
+#define NullRegion ((RegionPtr)0)
+
+/*
+ * clip region
+ */
+
+typedef struct pixman_region16_data RegDataRec, *RegDataPtr;
+
+extern _X_EXPORT BoxRec miEmptyBox;
+extern _X_EXPORT RegDataRec miEmptyData;
+extern _X_EXPORT RegDataRec miBrokenData;
+
+#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
+/* not a region */
+#define REGION_NAR(reg) ((reg)->data == &miBrokenData)
+#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
+#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
+#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \
+ : &(reg)->extents)
+#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1))
+#define REGION_BOX(reg,i) (®ION_BOXPTR(reg)[i])
+#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects)
+#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1)
+#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))
+
+#define REGION_CREATE(_pScreen, _rect, _size) \
+ miRegionCreate(_rect, _size)
+
+#define REGION_COPY(_pScreen, dst, src) \
+ miRegionCopy(dst, src)
+
+#define REGION_DESTROY(_pScreen, _pReg) \
+ miRegionDestroy(_pReg)
+
+#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
+ miIntersect(newReg, reg1, reg2)
+
+#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
+ miUnion(newReg, reg1, reg2)
+
+#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
+ miSubtract(newReg, reg1, reg2)
+
+#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
+ miInverse(newReg, reg1, invRect)
+
+#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
+ miTranslateRegion(_pReg, _x, _y)
+
+#define RECT_IN_REGION(_pScreen, _pReg, prect) \
+ miRectIn(_pReg, prect)
+
+#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
+ miPointInRegion(_pReg, _x, _y, prect)
+
+#define REGION_APPEND(_pScreen, dstrgn, rgn) \
+ miRegionAppend(dstrgn, rgn)
+
+#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
+ miRegionValidate(badreg, pOverlap)
+
+#define BITMAP_TO_REGION(_pScreen, pPix) \
+ (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */
+
+#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
+ miRectsToRegion(nrects, prect, ctype)
+
+#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \
+ miRegionEqual(_pReg1, _pReg2)
+
+#define REGION_BREAK(_pScreen, _pReg) \
+ miRegionBreak(_pReg)
+
+#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
+{ \
+ if ((_rect) != NULL) \
+ { \
+ (_pReg)->extents = *(_rect); \
+ (_pReg)->data = (RegDataPtr)NULL; \
+ } \
+ else \
+ { \
+ (_pReg)->extents = miEmptyBox; \
+ if (((_size) > 1) && ((_pReg)->data = \
+ (RegDataPtr)malloc(REGION_SZOF(_size)))) \
+ { \
+ (_pReg)->data->size = (_size); \
+ (_pReg)->data->numRects = 0; \
+ } \
+ else \
+ (_pReg)->data = &miEmptyData; \
+ } \
+ }
+
+
+#define REGION_UNINIT(_pScreen, _pReg) \
+{ \
+ if ((_pReg)->data && (_pReg)->data->size) { \
+ free((_pReg)->data); \
+ (_pReg)->data = NULL; \
+ } \
+}
+
+#define REGION_RESET(_pScreen, _pReg, _pBox) \
+{ \
+ (_pReg)->extents = *(_pBox); \
+ REGION_UNINIT(_pScreen, _pReg); \
+ (_pReg)->data = (RegDataPtr)NULL; \
+}
+
+#define REGION_NOTEMPTY(_pScreen, _pReg) \
+ !REGION_NIL(_pReg)
+
+#define REGION_BROKEN(_pScreen, _pReg) \
+ REGION_NAR(_pReg)
+
+#define REGION_EMPTY(_pScreen, _pReg) \
+{ \
+ REGION_UNINIT(_pScreen, _pReg); \
+ (_pReg)->extents.x2 = (_pReg)->extents.x1; \
+ (_pReg)->extents.y2 = (_pReg)->extents.y1; \
+ (_pReg)->data = &miEmptyData; \
+}
+
+#define REGION_EXTENTS(_pScreen, _pReg) \
+ (&(_pReg)->extents)
+
+#define REGION_NULL(_pScreen, _pReg) \
+{ \
+ (_pReg)->extents = miEmptyBox; \
+ (_pReg)->data = &miEmptyData; \
+}
+
+#ifndef REGION_NULL
+#define REGION_NULL(_pScreen, _pReg) \
+ REGION_INIT(_pScreen, _pReg, NullBox, 1)
+#endif
+
+/* moved from mi.h */
+
+extern _X_EXPORT void InitRegions (void);
+
+extern _X_EXPORT RegionPtr miRegionCreate(
+ BoxPtr /*rect*/,
+ int /*size*/);
+
+extern _X_EXPORT void miRegionInit(
+ RegionPtr /*pReg*/,
+ BoxPtr /*rect*/,
+ int /*size*/);
+
+extern _X_EXPORT void miRegionDestroy(
+ RegionPtr /*pReg*/);
+
+extern _X_EXPORT void miRegionUninit(
+ RegionPtr /*pReg*/);
+
+extern _X_EXPORT Bool miRegionCopy(
+ RegionPtr /*dst*/,
+ RegionPtr /*src*/);
+
+extern _X_EXPORT Bool miIntersect(
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ RegionPtr /*reg2*/);
+
+extern _X_EXPORT Bool miUnion(
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ RegionPtr /*reg2*/);
+
+extern _X_EXPORT Bool miRegionAppend(
+ RegionPtr /*dstrgn*/,
+ RegionPtr /*rgn*/);
+
+extern _X_EXPORT Bool miRegionValidate(
+ RegionPtr /*badreg*/,
+ Bool * /*pOverlap*/);
+
+extern _X_EXPORT RegionPtr miRectsToRegion(
+ int /*nrects*/,
+ xRectanglePtr /*prect*/,
+ int /*ctype*/);
+
+extern _X_EXPORT Bool miSubtract(
+ RegionPtr /*regD*/,
+ RegionPtr /*regM*/,
+ RegionPtr /*regS*/);
+
+extern _X_EXPORT Bool miInverse(
+ RegionPtr /*newReg*/,
+ RegionPtr /*reg1*/,
+ BoxPtr /*invRect*/);
+
+extern _X_EXPORT int miRectIn(
+ RegionPtr /*region*/,
+ BoxPtr /*prect*/);
+
+extern _X_EXPORT void miTranslateRegion(
+ RegionPtr /*pReg*/,
+ int /*x*/,
+ int /*y*/);
+
+extern _X_EXPORT void miRegionReset(
+ RegionPtr /*pReg*/,
+ BoxPtr /*pBox*/);
+
+extern _X_EXPORT Bool miRegionBreak(
+ RegionPtr /*pReg*/);
+
+extern _X_EXPORT Bool miPointInRegion(
+ RegionPtr /*pReg*/,
+ int /*x*/,
+ int /*y*/,
+ BoxPtr /*box*/);
+
+extern _X_EXPORT Bool miRegionEqual(
+ RegionPtr /*pReg1*/,
+ RegionPtr /*pReg2*/);
+
+extern _X_EXPORT Bool miRegionNotEmpty(
+ RegionPtr /*pReg*/);
+
+extern _X_EXPORT void miRegionEmpty(
+ RegionPtr /*pReg*/);
+
+extern _X_EXPORT BoxPtr miRegionExtents(
+ RegionPtr /*pReg*/);
+
+extern _X_EXPORT void miPrintRegion(
+ RegionPtr /*pReg*/);
+
+#endif /* REGIONSTRUCT_H */
diff --git a/xorg-server/include/resource.h b/xorg-server/include/resource.h index 56450d67a..d2a8422b4 100644 --- a/xorg-server/include/resource.h +++ b/xorg-server/include/resource.h @@ -1,279 +1,279 @@ -/*********************************************************** - -Copyright 1987, 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef RESOURCE_H -#define RESOURCE_H 1 -#include "misc.h" -#include "dixaccess.h" - -/***************************************************************** - * STUFF FOR RESOURCES - *****************************************************************/ - -/* classes for Resource routines */ - -typedef unsigned long RESTYPE; - -#define RC_VANILLA ((RESTYPE)0) -#define RC_CACHED ((RESTYPE)1<<31) -#define RC_DRAWABLE ((RESTYPE)1<<30) -/* Use class RC_NEVERRETAIN for resources that should not be retained - * regardless of the close down mode when the client dies. (A client's - * event selections on objects that it doesn't own are good candidates.) - * Extensions can use this too! - */ -#define RC_NEVERRETAIN ((RESTYPE)1<<29) -#define RC_LASTPREDEF RC_NEVERRETAIN -#define RC_ANY (~(RESTYPE)0) - -/* types for Resource routines */ - -#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE) -#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE) -#define RT_GC ((RESTYPE)3) -#undef RT_FONT -#undef RT_CURSOR -#define RT_FONT ((RESTYPE)4) -#define RT_CURSOR ((RESTYPE)5) -#define RT_COLORMAP ((RESTYPE)6) -#define RT_CMAPENTRY ((RESTYPE)7) -#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN) -#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN) -#define RT_LASTPREDEF ((RESTYPE)9) -#define RT_NONE ((RESTYPE)0) - -/* bits and fields within a resource id */ -#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */ -#if MAXCLIENTS == 64 -#define RESOURCE_CLIENT_BITS 6 -#endif -#if MAXCLIENTS == 128 -#define RESOURCE_CLIENT_BITS 7 -#endif -#if MAXCLIENTS == 256 -#define RESOURCE_CLIENT_BITS 8 -#endif -#if MAXCLIENTS == 512 -#define RESOURCE_CLIENT_BITS 9 -#endif -/* client field offset */ -#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS) -/* resource field */ -#define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1) -/* client field */ -#define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET) -/* extract the client mask from an XID */ -#define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK) -/* extract the client id from an XID */ -#define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET)) -#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */ - -#ifdef INVALID -#undef INVALID /* needed on HP/UX */ -#endif - -/* Invalid resource id */ -#define INVALID (0) - -#define BAD_RESOURCE 0xe0000000 - -/* Resource state callback */ -extern _X_EXPORT CallbackListPtr ResourceStateCallback; - -typedef enum {ResourceStateAdding, - ResourceStateFreeing} ResourceState; - -typedef struct { - ResourceState state; - XID id; - RESTYPE type; - pointer value; -} ResourceStateInfoRec; - -typedef int (*DeleteType)( - pointer /*value*/, - XID /*id*/); - -typedef void (*FindResType)( - pointer /*value*/, - XID /*id*/, - pointer /*cdata*/); - -typedef void (*FindAllRes)( - pointer /*value*/, - XID /*id*/, - RESTYPE /*type*/, - pointer /*cdata*/); - -typedef Bool (*FindComplexResType)( - pointer /*value*/, - XID /*id*/, - pointer /*cdata*/); - -extern _X_EXPORT RESTYPE CreateNewResourceType( - DeleteType /*deleteFunc*/, char * /*name*/); - -extern _X_EXPORT RESTYPE CreateNewResourceClass(void); - -extern _X_EXPORT Bool InitClientResources( - ClientPtr /*client*/); - -extern _X_EXPORT XID FakeClientID( - int /*client*/); - -/* Quartz support on Mac OS X uses the CarbonCore - framework whose AddResource function conflicts here. */ -#ifdef __APPLE__ -#define AddResource Darwin_X_AddResource -#endif -extern _X_EXPORT Bool AddResource( - XID /*id*/, - RESTYPE /*type*/, - pointer /*value*/); - -extern _X_EXPORT void FreeResource( - XID /*id*/, - RESTYPE /*skipDeleteFuncType*/); - -extern _X_EXPORT void FreeResourceByType( - XID /*id*/, - RESTYPE /*type*/, - Bool /*skipFree*/); - -extern _X_EXPORT Bool ChangeResourceValue( - XID /*id*/, - RESTYPE /*rtype*/, - pointer /*value*/); - -extern _X_EXPORT void FindClientResourcesByType( - ClientPtr /*client*/, - RESTYPE /*type*/, - FindResType /*func*/, - pointer /*cdata*/); - -extern _X_EXPORT void FindAllClientResources( - ClientPtr /*client*/, - FindAllRes /*func*/, - pointer /*cdata*/); - -extern _X_EXPORT void FreeClientNeverRetainResources( - ClientPtr /*client*/); - -extern _X_EXPORT void FreeClientResources( - ClientPtr /*client*/); - -extern _X_EXPORT void FreeAllResources(void); - -extern _X_EXPORT Bool LegalNewID( - XID /*id*/, - ClientPtr /*client*/); - -extern _X_EXPORT pointer LookupClientResourceComplex( - ClientPtr client, - RESTYPE type, - FindComplexResType func, - pointer cdata); - -extern _X_EXPORT int dixLookupResourceByType( - pointer *result, - XID id, - RESTYPE rtype, - ClientPtr client, - Mask access_mode); - -extern _X_EXPORT int dixLookupResourceByClass( - pointer *result, - XID id, - RESTYPE rclass, - ClientPtr client, - Mask access_mode); - -extern _X_EXPORT void GetXIDRange( - int /*client*/, - Bool /*server*/, - XID * /*minp*/, - XID * /*maxp*/); - -extern _X_EXPORT unsigned int GetXIDList( - ClientPtr /*client*/, - unsigned int /*count*/, - XID * /*pids*/); - -extern _X_EXPORT RESTYPE lastResourceType; -extern _X_EXPORT RESTYPE TypeMask; - -/* - * These are deprecated compatibility functions and will be removed soon! - * Please use the noted replacements instead. - */ - -/* replaced by dixLookupResourceByType */ -extern _X_EXPORT pointer SecurityLookupIDByType( - ClientPtr client, - XID id, - RESTYPE rtype, - Mask access_mode) X_DEPRECATED; - -/* replaced by dixLookupResourceByClass */ -extern _X_EXPORT pointer SecurityLookupIDByClass( - ClientPtr client, - XID id, - RESTYPE classes, - Mask access_mode) X_DEPRECATED; - -/* replaced by dixLookupResourceByType */ -extern _X_EXPORT pointer LookupIDByType( - XID id, - RESTYPE rtype) X_DEPRECATED; - -/* replaced by dixLookupResourceByClass */ -extern _X_EXPORT pointer LookupIDByClass( - XID id, - RESTYPE classes) X_DEPRECATED; - -#endif /* RESOURCE_H */ - +/***********************************************************
+
+Copyright 1987, 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef RESOURCE_H
+#define RESOURCE_H 1
+#include "misc.h"
+#include "dixaccess.h"
+
+/*****************************************************************
+ * STUFF FOR RESOURCES
+ *****************************************************************/
+
+/* classes for Resource routines */
+
+typedef unsigned long RESTYPE;
+
+#define RC_VANILLA ((RESTYPE)0)
+#define RC_CACHED ((RESTYPE)1<<31)
+#define RC_DRAWABLE ((RESTYPE)1<<30)
+/* Use class RC_NEVERRETAIN for resources that should not be retained
+ * regardless of the close down mode when the client dies. (A client's
+ * event selections on objects that it doesn't own are good candidates.)
+ * Extensions can use this too!
+ */
+#define RC_NEVERRETAIN ((RESTYPE)1<<29)
+#define RC_LASTPREDEF RC_NEVERRETAIN
+#define RC_ANY (~(RESTYPE)0)
+
+/* types for Resource routines */
+
+#define RT_WINDOW ((RESTYPE)1|RC_DRAWABLE)
+#define RT_PIXMAP ((RESTYPE)2|RC_DRAWABLE)
+#define RT_GC ((RESTYPE)3)
+#undef RT_FONT
+#undef RT_CURSOR
+#define RT_FONT ((RESTYPE)4)
+#define RT_CURSOR ((RESTYPE)5)
+#define RT_COLORMAP ((RESTYPE)6)
+#define RT_CMAPENTRY ((RESTYPE)7)
+#define RT_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
+#define RT_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
+#define RT_LASTPREDEF ((RESTYPE)9)
+#define RT_NONE ((RESTYPE)0)
+
+/* bits and fields within a resource id */
+#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */
+#if MAXCLIENTS == 64
+#define RESOURCE_CLIENT_BITS 6
+#endif
+#if MAXCLIENTS == 128
+#define RESOURCE_CLIENT_BITS 7
+#endif
+#if MAXCLIENTS == 256
+#define RESOURCE_CLIENT_BITS 8
+#endif
+#if MAXCLIENTS == 512
+#define RESOURCE_CLIENT_BITS 9
+#endif
+/* client field offset */
+#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS)
+/* resource field */
+#define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1)
+/* client field */
+#define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET)
+/* extract the client mask from an XID */
+#define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK)
+/* extract the client id from an XID */
+#define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET))
+#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */
+
+#ifdef INVALID
+#undef INVALID /* needed on HP/UX */
+#endif
+
+/* Invalid resource id */
+#define INVALID (0)
+
+#define BAD_RESOURCE 0xe0000000
+
+/* Resource state callback */
+extern _X_EXPORT CallbackListPtr ResourceStateCallback;
+
+typedef enum {ResourceStateAdding,
+ ResourceStateFreeing} ResourceState;
+
+typedef struct {
+ ResourceState state;
+ XID id;
+ RESTYPE type;
+ pointer value;
+} ResourceStateInfoRec;
+
+typedef int (*DeleteType)(
+ pointer /*value*/,
+ XID /*id*/);
+
+typedef void (*FindResType)(
+ pointer /*value*/,
+ XID /*id*/,
+ pointer /*cdata*/);
+
+typedef void (*FindAllRes)(
+ pointer /*value*/,
+ XID /*id*/,
+ RESTYPE /*type*/,
+ pointer /*cdata*/);
+
+typedef Bool (*FindComplexResType)(
+ pointer /*value*/,
+ XID /*id*/,
+ pointer /*cdata*/);
+
+extern _X_EXPORT RESTYPE CreateNewResourceType(
+ DeleteType /*deleteFunc*/, char * /*name*/);
+
+extern _X_EXPORT RESTYPE CreateNewResourceClass(void);
+
+extern _X_EXPORT Bool InitClientResources(
+ ClientPtr /*client*/);
+
+extern _X_EXPORT XID FakeClientID(
+ int /*client*/);
+
+/* Quartz support on Mac OS X uses the CarbonCore
+ framework whose AddResource function conflicts here. */
+#ifdef __APPLE__
+#define AddResource Darwin_X_AddResource
+#endif
+extern _X_EXPORT Bool AddResource(
+ XID /*id*/,
+ RESTYPE /*type*/,
+ pointer /*value*/);
+
+extern _X_EXPORT void FreeResource(
+ XID /*id*/,
+ RESTYPE /*skipDeleteFuncType*/);
+
+extern _X_EXPORT void FreeResourceByType(
+ XID /*id*/,
+ RESTYPE /*type*/,
+ Bool /*skipFree*/);
+
+extern _X_EXPORT Bool ChangeResourceValue(
+ XID /*id*/,
+ RESTYPE /*rtype*/,
+ pointer /*value*/);
+
+extern _X_EXPORT void FindClientResourcesByType(
+ ClientPtr /*client*/,
+ RESTYPE /*type*/,
+ FindResType /*func*/,
+ pointer /*cdata*/);
+
+extern _X_EXPORT void FindAllClientResources(
+ ClientPtr /*client*/,
+ FindAllRes /*func*/,
+ pointer /*cdata*/);
+
+extern _X_EXPORT void FreeClientNeverRetainResources(
+ ClientPtr /*client*/);
+
+extern _X_EXPORT void FreeClientResources(
+ ClientPtr /*client*/);
+
+extern _X_EXPORT void FreeAllResources(void);
+
+extern _X_EXPORT Bool LegalNewID(
+ XID /*id*/,
+ ClientPtr /*client*/);
+
+extern _X_EXPORT pointer LookupClientResourceComplex(
+ ClientPtr client,
+ RESTYPE type,
+ FindComplexResType func,
+ pointer cdata);
+
+extern _X_EXPORT int dixLookupResourceByType(
+ pointer *result,
+ XID id,
+ RESTYPE rtype,
+ ClientPtr client,
+ Mask access_mode);
+
+extern _X_EXPORT int dixLookupResourceByClass(
+ pointer *result,
+ XID id,
+ RESTYPE rclass,
+ ClientPtr client,
+ Mask access_mode);
+
+extern _X_EXPORT void GetXIDRange(
+ int /*client*/,
+ Bool /*server*/,
+ XID * /*minp*/,
+ XID * /*maxp*/);
+
+extern _X_EXPORT unsigned int GetXIDList(
+ ClientPtr /*client*/,
+ unsigned int /*count*/,
+ XID * /*pids*/);
+
+extern _X_EXPORT RESTYPE lastResourceType;
+extern _X_EXPORT RESTYPE TypeMask;
+
+/*
+ * These are deprecated compatibility functions and will be removed soon!
+ * Please use the noted replacements instead.
+ */
+
+/* replaced by dixLookupResourceByType */
+extern _X_EXPORT pointer SecurityLookupIDByType(
+ ClientPtr client,
+ XID id,
+ RESTYPE rtype,
+ Mask access_mode) _X_DEPRECATED;
+
+/* replaced by dixLookupResourceByClass */
+extern _X_EXPORT pointer SecurityLookupIDByClass(
+ ClientPtr client,
+ XID id,
+ RESTYPE classes,
+ Mask access_mode) _X_DEPRECATED;
+
+/* replaced by dixLookupResourceByType */
+extern _X_EXPORT pointer LookupIDByType(
+ XID id,
+ RESTYPE rtype) _X_DEPRECATED;
+
+/* replaced by dixLookupResourceByClass */
+extern _X_EXPORT pointer LookupIDByClass(
+ XID id,
+ RESTYPE classes) _X_DEPRECATED;
+
+#endif /* RESOURCE_H */
+
diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h index 553893677..e07bee3c3 100644 --- a/xorg-server/include/scrnintstr.h +++ b/xorg-server/include/scrnintstr.h @@ -1,629 +1,613 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifndef SCREENINTSTRUCT_H -#define SCREENINTSTRUCT_H - -#include "screenint.h" -#include "regionstr.h" -#include "bstore.h" -#include "colormap.h" -#include "cursor.h" -#include "validate.h" -#include <X11/Xproto.h> -#include "dix.h" -#include "privates.h" - -typedef struct _PixmapFormat { - unsigned char depth; - unsigned char bitsPerPixel; - unsigned char scanlinePad; - } PixmapFormatRec; - -typedef struct _Visual { - VisualID vid; - short class; - short bitsPerRGBValue; - short ColormapEntries; - short nplanes;/* = log2 (ColormapEntries). This does not - * imply that the screen has this many planes. - * it may have more or fewer */ - unsigned long redMask, greenMask, blueMask; - int offsetRed, offsetGreen, offsetBlue; - } VisualRec; - -typedef struct _Depth { - unsigned char depth; - short numVids; - VisualID *vids; /* block of visual ids for this depth */ - } DepthRec; - - -/* - * There is a typedef for each screen function pointer so that code that - * needs to declare a screen function pointer (e.g. in a screen private - * or as a local variable) can easily do so and retain full type checking. - */ - -typedef Bool (* CloseScreenProcPtr)( - int /*index*/, - ScreenPtr /*pScreen*/); - -typedef void (* QueryBestSizeProcPtr)( - int /*class*/, - unsigned short * /*pwidth*/, - unsigned short * /*pheight*/, - ScreenPtr /*pScreen*/); - -typedef Bool (* SaveScreenProcPtr)( - ScreenPtr /*pScreen*/, - int /*on*/); - -typedef void (* GetImageProcPtr)( - DrawablePtr /*pDrawable*/, - int /*sx*/, - int /*sy*/, - int /*w*/, - int /*h*/, - unsigned int /*format*/, - unsigned long /*planeMask*/, - char * /*pdstLine*/); - -typedef void (* GetSpansProcPtr)( - DrawablePtr /*pDrawable*/, - int /*wMax*/, - DDXPointPtr /*ppt*/, - int* /*pwidth*/, - int /*nspans*/, - char * /*pdstStart*/); - -typedef void (* PointerNonInterestBoxProcPtr)( - DeviceIntPtr /*pDev*/, - ScreenPtr /*pScreen*/, - BoxPtr /*pBox*/); - -typedef void (* SourceValidateProcPtr)( - DrawablePtr /*pDrawable*/, - int /*x*/, - int /*y*/, - int /*width*/, - int /*height*/); - -typedef Bool (* CreateWindowProcPtr)( - WindowPtr /*pWindow*/); - -typedef Bool (* DestroyWindowProcPtr)( - WindowPtr /*pWindow*/); - -typedef Bool (* PositionWindowProcPtr)( - WindowPtr /*pWindow*/, - int /*x*/, - int /*y*/); - -typedef Bool (* ChangeWindowAttributesProcPtr)( - WindowPtr /*pWindow*/, - unsigned long /*mask*/); - -typedef Bool (* RealizeWindowProcPtr)( - WindowPtr /*pWindow*/); - -typedef Bool (* UnrealizeWindowProcPtr)( - WindowPtr /*pWindow*/); - -typedef void (* RestackWindowProcPtr)( - WindowPtr /*pWindow*/, - WindowPtr /*pOldNextSib*/); - -typedef int (* ValidateTreeProcPtr)( - WindowPtr /*pParent*/, - WindowPtr /*pChild*/, - VTKind /*kind*/); - -typedef void (* PostValidateTreeProcPtr)( - WindowPtr /*pParent*/, - WindowPtr /*pChild*/, - VTKind /*kind*/); - -typedef void (* WindowExposuresProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgn*/, - RegionPtr /*other_exposed*/); - -typedef void (* PaintWindowProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*pRegion*/, - int /*what*/); - -typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr; -typedef PaintWindowProcPtr PaintWindowBorderProcPtr; - -typedef void (* CopyWindowProcPtr)( - WindowPtr /*pWindow*/, - DDXPointRec /*ptOldOrg*/, - RegionPtr /*prgnSrc*/); - -typedef void (* ClearToBackgroundProcPtr)( - WindowPtr /*pWindow*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - Bool /*generateExposures*/); - -typedef void (* ClipNotifyProcPtr)( - WindowPtr /*pWindow*/, - int /*dx*/, - int /*dy*/); - -/* pixmap will exist only for the duration of the current rendering operation */ -#define CREATE_PIXMAP_USAGE_SCRATCH 1 -/* pixmap will be the backing pixmap for a redirected window */ -#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2 -/* pixmap will contain a glyph */ -#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3 - -typedef PixmapPtr (* CreatePixmapProcPtr)( - ScreenPtr /*pScreen*/, - int /*width*/, - int /*height*/, - int /*depth*/, - unsigned /*usage_hint*/); - -typedef Bool (* DestroyPixmapProcPtr)( - PixmapPtr /*pPixmap*/); - -typedef void (* SaveDoomedAreasProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgnSave*/, - int /*xorg*/, - int /*yorg*/); - -typedef RegionPtr (* RestoreAreasProcPtr)( - WindowPtr /*pWindow*/, - RegionPtr /*prgnRestore*/); - -typedef void (* ExposeCopyProcPtr)( - WindowPtr /*pSrc*/, - DrawablePtr /*pDst*/, - GCPtr /*pGC*/, - RegionPtr /*prgnExposed*/, - int /*srcx*/, - int /*srcy*/, - int /*dstx*/, - int /*dsty*/, - unsigned long /*plane*/); - -typedef RegionPtr (* TranslateBackingStoreProcPtr)( - WindowPtr /*pWindow*/, - int /*windx*/, - int /*windy*/, - RegionPtr /*oldClip*/, - int /*oldx*/, - int /*oldy*/); - -typedef RegionPtr (* ClearBackingStoreProcPtr)( - WindowPtr /*pWindow*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - Bool /*generateExposures*/); - -typedef void (* DrawGuaranteeProcPtr)( - WindowPtr /*pWindow*/, - GCPtr /*pGC*/, - int /*guarantee*/); - -typedef Bool (* RealizeFontProcPtr)( - ScreenPtr /*pScreen*/, - FontPtr /*pFont*/); - -typedef Bool (* UnrealizeFontProcPtr)( - ScreenPtr /*pScreen*/, - FontPtr /*pFont*/); - -typedef void (* ConstrainCursorProcPtr)( - DeviceIntPtr /*pDev*/, - ScreenPtr /*pScreen*/, - BoxPtr /*pBox*/); - -typedef void (* CursorLimitsProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /*pScreen*/, - CursorPtr /*pCursor*/, - BoxPtr /*pHotBox*/, - BoxPtr /*pTopLeftBox*/); - -typedef Bool (* DisplayCursorProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /*pScreen*/, - CursorPtr /*pCursor*/); - -typedef Bool (* RealizeCursorProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /*pScreen*/, - CursorPtr /*pCursor*/); - -typedef Bool (* UnrealizeCursorProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /*pScreen*/, - CursorPtr /*pCursor*/); - -typedef void (* RecolorCursorProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /*pScreen*/, - CursorPtr /*pCursor*/, - Bool /*displayed*/); - -typedef Bool (* SetCursorPositionProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /*pScreen*/, - int /*x*/, - int /*y*/, - Bool /*generateEvent*/); - -typedef Bool (* CreateGCProcPtr)( - GCPtr /*pGC*/); - -typedef Bool (* CreateColormapProcPtr)( - ColormapPtr /*pColormap*/); - -typedef void (* DestroyColormapProcPtr)( - ColormapPtr /*pColormap*/); - -typedef void (* InstallColormapProcPtr)( - ColormapPtr /*pColormap*/); - -typedef void (* UninstallColormapProcPtr)( - ColormapPtr /*pColormap*/); - -typedef int (* ListInstalledColormapsProcPtr) ( - ScreenPtr /*pScreen*/, - XID* /*pmaps */); - -typedef void (* StoreColorsProcPtr)( - ColormapPtr /*pColormap*/, - int /*ndef*/, - xColorItem * /*pdef*/); - -typedef void (* ResolveColorProcPtr)( - unsigned short* /*pred*/, - unsigned short* /*pgreen*/, - unsigned short* /*pblue*/, - VisualPtr /*pVisual*/); - -typedef RegionPtr (* BitmapToRegionProcPtr)( - PixmapPtr /*pPix*/); - -typedef void (* SendGraphicsExposeProcPtr)( - ClientPtr /*client*/, - RegionPtr /*pRgn*/, - XID /*drawable*/, - int /*major*/, - int /*minor*/); - -typedef void (* ScreenBlockHandlerProcPtr)( - int /*screenNum*/, - pointer /*blockData*/, - pointer /*pTimeout*/, - pointer /*pReadmask*/); - -typedef void (* ScreenWakeupHandlerProcPtr)( - int /*screenNum*/, - pointer /*wakeupData*/, - unsigned long /*result*/, - pointer /*pReadMask*/); - -typedef Bool (* CreateScreenResourcesProcPtr)( - ScreenPtr /*pScreen*/); - -typedef Bool (* ModifyPixmapHeaderProcPtr)( - PixmapPtr /*pPixmap*/, - int /*width*/, - int /*height*/, - int /*depth*/, - int /*bitsPerPixel*/, - int /*devKind*/, - pointer /*pPixData*/); - -typedef PixmapPtr (* GetWindowPixmapProcPtr)( - WindowPtr /*pWin*/); - -typedef void (* SetWindowPixmapProcPtr)( - WindowPtr /*pWin*/, - PixmapPtr /*pPix*/); - -typedef PixmapPtr (* GetScreenPixmapProcPtr)( - ScreenPtr /*pScreen*/); - -typedef void (* SetScreenPixmapProcPtr)( - PixmapPtr /*pPix*/); - -typedef void (* MarkWindowProcPtr)( - WindowPtr /*pWin*/); - -typedef Bool (* MarkOverlappedWindowsProcPtr)( - WindowPtr /*parent*/, - WindowPtr /*firstChild*/, - WindowPtr * /*pLayerWin*/); - -typedef Bool (* ChangeSaveUnderProcPtr)( - WindowPtr /*pLayerWin*/, - WindowPtr /*firstChild*/); - -typedef void (* PostChangeSaveUnderProcPtr)( - WindowPtr /*pLayerWin*/, - WindowPtr /*firstChild*/); - -typedef void (* ConfigNotifyProcPtr)( - WindowPtr /*pWin*/, - int /*x*/, - int /*y*/, - int /*w*/, - int /*h*/, - int /*bw*/, - WindowPtr /*pSib*/); - -typedef void (* MoveWindowProcPtr)( - WindowPtr /*pWin*/, - int /*x*/, - int /*y*/, - WindowPtr /*pSib*/, - VTKind /*kind*/); - -typedef void (* ResizeWindowProcPtr)( - WindowPtr /*pWin*/, - int /*x*/, - int /*y*/, - unsigned int /*w*/, - unsigned int /*h*/, - WindowPtr /*pSib*/ -); - -typedef WindowPtr (* GetLayerWindowProcPtr)( - WindowPtr /*pWin*/ -); - -typedef void (* HandleExposuresProcPtr)( - WindowPtr /*pWin*/); - -typedef void (* ReparentWindowProcPtr)( - WindowPtr /*pWin*/, - WindowPtr /*pPriorParent*/); - -typedef void (* SetShapeProcPtr)( - WindowPtr /*pWin*/); - -typedef void (* ChangeBorderWidthProcPtr)( - WindowPtr /*pWin*/, - unsigned int /*width*/); - -typedef void (* MarkUnrealizedWindowProcPtr)( - WindowPtr /*pChild*/, - WindowPtr /*pWin*/, - Bool /*fromConfigure*/); - -typedef Bool (* DeviceCursorInitializeProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /* pScreen */); - -typedef void (* DeviceCursorCleanupProcPtr)( - DeviceIntPtr /* pDev */, - ScreenPtr /* pScreen */); - -typedef struct _Screen { - int myNum; /* index of this instance in Screens[] */ - ATOM id; - short width, height; - short mmWidth, mmHeight; - short numDepths; - unsigned char rootDepth; - DepthPtr allowedDepths; - unsigned long rootVisual; - unsigned long defColormap; - short minInstalledCmaps, maxInstalledCmaps; - char backingStoreSupport, saveUnderSupport; - unsigned long whitePixel, blackPixel; - unsigned long rgf; /* array of flags; she's -- HUNGARIAN */ - GCPtr GCperDepth[MAXFORMATS+1]; - /* next field is a stipple to use as default in - a GC. we don't build default tiles of all depths - because they are likely to be of a color - different from the default fg pixel, so - we don't win anything by building - a standard one. - */ - PixmapPtr PixmapPerDepth[1]; - pointer devPrivate; - short numVisuals; - VisualPtr visuals; - - /* Random screen procedures */ - - CloseScreenProcPtr CloseScreen; - QueryBestSizeProcPtr QueryBestSize; - SaveScreenProcPtr SaveScreen; - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - PointerNonInterestBoxProcPtr PointerNonInterestBox; - SourceValidateProcPtr SourceValidate; - - /* Window Procedures */ - - CreateWindowProcPtr CreateWindow; - DestroyWindowProcPtr DestroyWindow; - PositionWindowProcPtr PositionWindow; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - RealizeWindowProcPtr RealizeWindow; - UnrealizeWindowProcPtr UnrealizeWindow; - ValidateTreeProcPtr ValidateTree; - PostValidateTreeProcPtr PostValidateTree; - WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; /** unused */ - PaintWindowBorderProcPtr PaintWindowBorder; /** unused */ - CopyWindowProcPtr CopyWindow; - ClearToBackgroundProcPtr ClearToBackground; - ClipNotifyProcPtr ClipNotify; - RestackWindowProcPtr RestackWindow; - - /* Pixmap procedures */ - - CreatePixmapProcPtr CreatePixmap; - DestroyPixmapProcPtr DestroyPixmap; - - /* Backing store procedures */ - - SaveDoomedAreasProcPtr SaveDoomedAreas; - RestoreAreasProcPtr RestoreAreas; - ExposeCopyProcPtr ExposeCopy; - TranslateBackingStoreProcPtr TranslateBackingStore; - ClearBackingStoreProcPtr ClearBackingStore; - DrawGuaranteeProcPtr DrawGuarantee; - /* - * A read/write copy of the lower level backing store vector is needed now - * that the functions can be wrapped. - */ - BSFuncRec BackingStoreFuncs; - - /* Font procedures */ - - RealizeFontProcPtr RealizeFont; - UnrealizeFontProcPtr UnrealizeFont; - - /* Cursor Procedures */ - - ConstrainCursorProcPtr ConstrainCursor; - CursorLimitsProcPtr CursorLimits; - DisplayCursorProcPtr DisplayCursor; - RealizeCursorProcPtr RealizeCursor; - UnrealizeCursorProcPtr UnrealizeCursor; - RecolorCursorProcPtr RecolorCursor; - SetCursorPositionProcPtr SetCursorPosition; - - /* GC procedures */ - - CreateGCProcPtr CreateGC; - - /* Colormap procedures */ - - CreateColormapProcPtr CreateColormap; - DestroyColormapProcPtr DestroyColormap; - InstallColormapProcPtr InstallColormap; - UninstallColormapProcPtr UninstallColormap; - ListInstalledColormapsProcPtr ListInstalledColormaps; - StoreColorsProcPtr StoreColors; - ResolveColorProcPtr ResolveColor; - - /* Region procedures */ - - BitmapToRegionProcPtr BitmapToRegion; - SendGraphicsExposeProcPtr SendGraphicsExpose; - - /* os layer procedures */ - - ScreenBlockHandlerProcPtr BlockHandler; - ScreenWakeupHandlerProcPtr WakeupHandler; - - pointer blockData; - pointer wakeupData; - - /* anybody can get a piece of this array */ - PrivateRec *devPrivates; - - CreateScreenResourcesProcPtr CreateScreenResources; - ModifyPixmapHeaderProcPtr ModifyPixmapHeader; - - GetWindowPixmapProcPtr GetWindowPixmap; - SetWindowPixmapProcPtr SetWindowPixmap; - GetScreenPixmapProcPtr GetScreenPixmap; - SetScreenPixmapProcPtr SetScreenPixmap; - - PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */ - - unsigned int totalPixmapSize; - - MarkWindowProcPtr MarkWindow; - MarkOverlappedWindowsProcPtr MarkOverlappedWindows; - ChangeSaveUnderProcPtr ChangeSaveUnder; - PostChangeSaveUnderProcPtr PostChangeSaveUnder; - ConfigNotifyProcPtr ConfigNotify; - MoveWindowProcPtr MoveWindow; - ResizeWindowProcPtr ResizeWindow; - GetLayerWindowProcPtr GetLayerWindow; - HandleExposuresProcPtr HandleExposures; - ReparentWindowProcPtr ReparentWindow; - - SetShapeProcPtr SetShape; - - ChangeBorderWidthProcPtr ChangeBorderWidth; - MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; - - /* Device cursor procedures */ - DeviceCursorInitializeProcPtr DeviceCursorInitialize; - DeviceCursorCleanupProcPtr DeviceCursorCleanup; -} ScreenRec; - -typedef struct _ScreenInfo { - int imageByteOrder; - int bitmapScanlineUnit; - int bitmapScanlinePad; - int bitmapBitOrder; - int numPixmapFormats; - PixmapFormatRec - formats[MAXFORMATS]; - int numScreens; - ScreenPtr screens[MAXSCREENS]; -} ScreenInfo; - -extern _X_EXPORT ScreenInfo screenInfo; - -extern _X_EXPORT void InitOutput( - ScreenInfo * /*pScreenInfo*/, - int /*argc*/, - char ** /*argv*/); - -#endif /* SCREENINTSTRUCT_H */ +/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef SCREENINTSTRUCT_H
+#define SCREENINTSTRUCT_H
+
+#include "screenint.h"
+#include "regionstr.h"
+#include "bstore.h"
+#include "colormap.h"
+#include "cursor.h"
+#include "validate.h"
+#include <X11/Xproto.h>
+#include "dix.h"
+#include "privates.h"
+
+typedef struct _PixmapFormat {
+ unsigned char depth;
+ unsigned char bitsPerPixel;
+ unsigned char scanlinePad;
+ } PixmapFormatRec;
+
+typedef struct _Visual {
+ VisualID vid;
+ short class;
+ short bitsPerRGBValue;
+ short ColormapEntries;
+ short nplanes;/* = log2 (ColormapEntries). This does not
+ * imply that the screen has this many planes.
+ * it may have more or fewer */
+ unsigned long redMask, greenMask, blueMask;
+ int offsetRed, offsetGreen, offsetBlue;
+ } VisualRec;
+
+typedef struct _Depth {
+ unsigned char depth;
+ short numVids;
+ VisualID *vids; /* block of visual ids for this depth */
+ } DepthRec;
+
+
+/*
+ * There is a typedef for each screen function pointer so that code that
+ * needs to declare a screen function pointer (e.g. in a screen private
+ * or as a local variable) can easily do so and retain full type checking.
+ */
+
+typedef Bool (* CloseScreenProcPtr)(
+ int /*index*/,
+ ScreenPtr /*pScreen*/);
+
+typedef void (* QueryBestSizeProcPtr)(
+ int /*class*/,
+ unsigned short * /*pwidth*/,
+ unsigned short * /*pheight*/,
+ ScreenPtr /*pScreen*/);
+
+typedef Bool (* SaveScreenProcPtr)(
+ ScreenPtr /*pScreen*/,
+ int /*on*/);
+
+typedef void (* GetImageProcPtr)(
+ DrawablePtr /*pDrawable*/,
+ int /*sx*/,
+ int /*sy*/,
+ int /*w*/,
+ int /*h*/,
+ unsigned int /*format*/,
+ unsigned long /*planeMask*/,
+ char * /*pdstLine*/);
+
+typedef void (* GetSpansProcPtr)(
+ DrawablePtr /*pDrawable*/,
+ int /*wMax*/,
+ DDXPointPtr /*ppt*/,
+ int* /*pwidth*/,
+ int /*nspans*/,
+ char * /*pdstStart*/);
+
+typedef void (* SourceValidateProcPtr)(
+ DrawablePtr /*pDrawable*/,
+ int /*x*/,
+ int /*y*/,
+ int /*width*/,
+ int /*height*/);
+
+typedef Bool (* CreateWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef Bool (* DestroyWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef Bool (* PositionWindowProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/);
+
+typedef Bool (* ChangeWindowAttributesProcPtr)(
+ WindowPtr /*pWindow*/,
+ unsigned long /*mask*/);
+
+typedef Bool (* RealizeWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef Bool (* UnrealizeWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef void (* RestackWindowProcPtr)(
+ WindowPtr /*pWindow*/,
+ WindowPtr /*pOldNextSib*/);
+
+typedef int (* ValidateTreeProcPtr)(
+ WindowPtr /*pParent*/,
+ WindowPtr /*pChild*/,
+ VTKind /*kind*/);
+
+typedef void (* PostValidateTreeProcPtr)(
+ WindowPtr /*pParent*/,
+ WindowPtr /*pChild*/,
+ VTKind /*kind*/);
+
+typedef void (* WindowExposuresProcPtr)(
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgn*/,
+ RegionPtr /*other_exposed*/);
+
+typedef void (* CopyWindowProcPtr)(
+ WindowPtr /*pWindow*/,
+ DDXPointRec /*ptOldOrg*/,
+ RegionPtr /*prgnSrc*/);
+
+typedef void (* ClearToBackgroundProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ Bool /*generateExposures*/);
+
+typedef void (* ClipNotifyProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*dx*/,
+ int /*dy*/);
+
+/* pixmap will exist only for the duration of the current rendering operation */
+#define CREATE_PIXMAP_USAGE_SCRATCH 1
+/* pixmap will be the backing pixmap for a redirected window */
+#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
+/* pixmap will contain a glyph */
+#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3
+
+typedef PixmapPtr (* CreatePixmapProcPtr)(
+ ScreenPtr /*pScreen*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/,
+ unsigned /*usage_hint*/);
+
+typedef Bool (* DestroyPixmapProcPtr)(
+ PixmapPtr /*pPixmap*/);
+
+typedef void (* SaveDoomedAreasProcPtr)(
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgnSave*/,
+ int /*xorg*/,
+ int /*yorg*/);
+
+typedef RegionPtr (* RestoreAreasProcPtr)(
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgnRestore*/);
+
+typedef void (* ExposeCopyProcPtr)(
+ WindowPtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ GCPtr /*pGC*/,
+ RegionPtr /*prgnExposed*/,
+ int /*srcx*/,
+ int /*srcy*/,
+ int /*dstx*/,
+ int /*dsty*/,
+ unsigned long /*plane*/);
+
+typedef RegionPtr (* TranslateBackingStoreProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*windx*/,
+ int /*windy*/,
+ RegionPtr /*oldClip*/,
+ int /*oldx*/,
+ int /*oldy*/);
+
+typedef RegionPtr (* ClearBackingStoreProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ Bool /*generateExposures*/);
+
+typedef void (* DrawGuaranteeProcPtr)(
+ WindowPtr /*pWindow*/,
+ GCPtr /*pGC*/,
+ int /*guarantee*/);
+
+typedef Bool (* RealizeFontProcPtr)(
+ ScreenPtr /*pScreen*/,
+ FontPtr /*pFont*/);
+
+typedef Bool (* UnrealizeFontProcPtr)(
+ ScreenPtr /*pScreen*/,
+ FontPtr /*pFont*/);
+
+typedef void (* ConstrainCursorProcPtr)(
+ DeviceIntPtr /*pDev*/,
+ ScreenPtr /*pScreen*/,
+ BoxPtr /*pBox*/);
+
+typedef void (* CursorLimitsProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/,
+ BoxPtr /*pHotBox*/,
+ BoxPtr /*pTopLeftBox*/);
+
+typedef Bool (* DisplayCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/);
+
+typedef Bool (* RealizeCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/);
+
+typedef Bool (* UnrealizeCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/);
+
+typedef void (* RecolorCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/,
+ Bool /*displayed*/);
+
+typedef Bool (* SetCursorPositionProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ int /*x*/,
+ int /*y*/,
+ Bool /*generateEvent*/);
+
+typedef Bool (* CreateGCProcPtr)(
+ GCPtr /*pGC*/);
+
+typedef Bool (* CreateColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef void (* DestroyColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef void (* InstallColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef void (* UninstallColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef int (* ListInstalledColormapsProcPtr) (
+ ScreenPtr /*pScreen*/,
+ XID* /*pmaps */);
+
+typedef void (* StoreColorsProcPtr)(
+ ColormapPtr /*pColormap*/,
+ int /*ndef*/,
+ xColorItem * /*pdef*/);
+
+typedef void (* ResolveColorProcPtr)(
+ unsigned short* /*pred*/,
+ unsigned short* /*pgreen*/,
+ unsigned short* /*pblue*/,
+ VisualPtr /*pVisual*/);
+
+typedef RegionPtr (* BitmapToRegionProcPtr)(
+ PixmapPtr /*pPix*/);
+
+typedef void (* SendGraphicsExposeProcPtr)(
+ ClientPtr /*client*/,
+ RegionPtr /*pRgn*/,
+ XID /*drawable*/,
+ int /*major*/,
+ int /*minor*/);
+
+typedef void (* ScreenBlockHandlerProcPtr)(
+ int /*screenNum*/,
+ pointer /*blockData*/,
+ pointer /*pTimeout*/,
+ pointer /*pReadmask*/);
+
+typedef void (* ScreenWakeupHandlerProcPtr)(
+ int /*screenNum*/,
+ pointer /*wakeupData*/,
+ unsigned long /*result*/,
+ pointer /*pReadMask*/);
+
+typedef Bool (* CreateScreenResourcesProcPtr)(
+ ScreenPtr /*pScreen*/);
+
+typedef Bool (* ModifyPixmapHeaderProcPtr)(
+ PixmapPtr /*pPixmap*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/,
+ int /*bitsPerPixel*/,
+ int /*devKind*/,
+ pointer /*pPixData*/);
+
+typedef PixmapPtr (* GetWindowPixmapProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef void (* SetWindowPixmapProcPtr)(
+ WindowPtr /*pWin*/,
+ PixmapPtr /*pPix*/);
+
+typedef PixmapPtr (* GetScreenPixmapProcPtr)(
+ ScreenPtr /*pScreen*/);
+
+typedef void (* SetScreenPixmapProcPtr)(
+ PixmapPtr /*pPix*/);
+
+typedef void (* MarkWindowProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef Bool (* MarkOverlappedWindowsProcPtr)(
+ WindowPtr /*parent*/,
+ WindowPtr /*firstChild*/,
+ WindowPtr * /*pLayerWin*/);
+
+typedef Bool (* ChangeSaveUnderProcPtr)(
+ WindowPtr /*pLayerWin*/,
+ WindowPtr /*firstChild*/);
+
+typedef void (* PostChangeSaveUnderProcPtr)(
+ WindowPtr /*pLayerWin*/,
+ WindowPtr /*firstChild*/);
+
+typedef void (* ConfigNotifyProcPtr)(
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ int /*bw*/,
+ WindowPtr /*pSib*/);
+
+typedef void (* MoveWindowProcPtr)(
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ WindowPtr /*pSib*/,
+ VTKind /*kind*/);
+
+typedef void (* ResizeWindowProcPtr)(
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ unsigned int /*w*/,
+ unsigned int /*h*/,
+ WindowPtr /*pSib*/
+);
+
+typedef WindowPtr (* GetLayerWindowProcPtr)(
+ WindowPtr /*pWin*/
+);
+
+typedef void (* HandleExposuresProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef void (* ReparentWindowProcPtr)(
+ WindowPtr /*pWin*/,
+ WindowPtr /*pPriorParent*/);
+
+typedef void (* SetShapeProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef void (* ChangeBorderWidthProcPtr)(
+ WindowPtr /*pWin*/,
+ unsigned int /*width*/);
+
+typedef void (* MarkUnrealizedWindowProcPtr)(
+ WindowPtr /*pChild*/,
+ WindowPtr /*pWin*/,
+ Bool /*fromConfigure*/);
+
+typedef Bool (* DeviceCursorInitializeProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /* pScreen */);
+
+typedef void (* DeviceCursorCleanupProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /* pScreen */);
+
+typedef struct _Screen {
+ int myNum; /* index of this instance in Screens[] */
+ ATOM id;
+ short width, height;
+ short mmWidth, mmHeight;
+ short numDepths;
+ unsigned char rootDepth;
+ DepthPtr allowedDepths;
+ unsigned long rootVisual;
+ unsigned long defColormap;
+ short minInstalledCmaps, maxInstalledCmaps;
+ char backingStoreSupport, saveUnderSupport;
+ unsigned long whitePixel, blackPixel;
+ unsigned long rgf; /* array of flags; she's -- HUNGARIAN */
+ GCPtr GCperDepth[MAXFORMATS+1];
+ /* next field is a stipple to use as default in
+ a GC. we don't build default tiles of all depths
+ because they are likely to be of a color
+ different from the default fg pixel, so
+ we don't win anything by building
+ a standard one.
+ */
+ PixmapPtr PixmapPerDepth[1];
+ pointer devPrivate;
+ short numVisuals;
+ VisualPtr visuals;
+
+ /* Random screen procedures */
+
+ CloseScreenProcPtr CloseScreen;
+ QueryBestSizeProcPtr QueryBestSize;
+ SaveScreenProcPtr SaveScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+
+ /* Window Procedures */
+
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
+
+ /* Pixmap procedures */
+
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+
+ /* Backing store procedures */
+
+ SaveDoomedAreasProcPtr SaveDoomedAreas;
+ RestoreAreasProcPtr RestoreAreas;
+ ExposeCopyProcPtr ExposeCopy;
+ TranslateBackingStoreProcPtr TranslateBackingStore;
+ ClearBackingStoreProcPtr ClearBackingStore;
+ DrawGuaranteeProcPtr DrawGuarantee;
+ /*
+ * A read/write copy of the lower level backing store vector is needed now
+ * that the functions can be wrapped.
+ */
+ BSFuncRec BackingStoreFuncs;
+
+ /* Font procedures */
+
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
+
+ /* Cursor Procedures */
+
+ ConstrainCursorProcPtr ConstrainCursor;
+ CursorLimitsProcPtr CursorLimits;
+ DisplayCursorProcPtr DisplayCursor;
+ RealizeCursorProcPtr RealizeCursor;
+ UnrealizeCursorProcPtr UnrealizeCursor;
+ RecolorCursorProcPtr RecolorCursor;
+ SetCursorPositionProcPtr SetCursorPosition;
+
+ /* GC procedures */
+
+ CreateGCProcPtr CreateGC;
+
+ /* Colormap procedures */
+
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ UninstallColormapProcPtr UninstallColormap;
+ ListInstalledColormapsProcPtr ListInstalledColormaps;
+ StoreColorsProcPtr StoreColors;
+ ResolveColorProcPtr ResolveColor;
+
+ /* Region procedures */
+
+ BitmapToRegionProcPtr BitmapToRegion;
+ SendGraphicsExposeProcPtr SendGraphicsExpose;
+
+ /* os layer procedures */
+
+ ScreenBlockHandlerProcPtr BlockHandler;
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+
+ pointer blockData;
+ pointer wakeupData;
+
+ /* anybody can get a piece of this array */
+ PrivateRec *devPrivates;
+
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
+
+ GetWindowPixmapProcPtr GetWindowPixmap;
+ SetWindowPixmapProcPtr SetWindowPixmap;
+ GetScreenPixmapProcPtr GetScreenPixmap;
+ SetScreenPixmapProcPtr SetScreenPixmap;
+
+ PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
+
+ unsigned int totalPixmapSize;
+
+ MarkWindowProcPtr MarkWindow;
+ MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
+ ChangeSaveUnderProcPtr ChangeSaveUnder;
+ PostChangeSaveUnderProcPtr PostChangeSaveUnder;
+ ConfigNotifyProcPtr ConfigNotify;
+ MoveWindowProcPtr MoveWindow;
+ ResizeWindowProcPtr ResizeWindow;
+ GetLayerWindowProcPtr GetLayerWindow;
+ HandleExposuresProcPtr HandleExposures;
+ ReparentWindowProcPtr ReparentWindow;
+
+ SetShapeProcPtr SetShape;
+
+ ChangeBorderWidthProcPtr ChangeBorderWidth;
+ MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
+
+ /* Device cursor procedures */
+ DeviceCursorInitializeProcPtr DeviceCursorInitialize;
+ DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+} ScreenRec;
+
+typedef struct _ScreenInfo {
+ int imageByteOrder;
+ int bitmapScanlineUnit;
+ int bitmapScanlinePad;
+ int bitmapBitOrder;
+ int numPixmapFormats;
+ PixmapFormatRec
+ formats[MAXFORMATS];
+ int numScreens;
+ ScreenPtr screens[MAXSCREENS];
+} ScreenInfo;
+
+extern _X_EXPORT ScreenInfo screenInfo;
+
+extern _X_EXPORT void InitOutput(
+ ScreenInfo * /*pScreenInfo*/,
+ int /*argc*/,
+ char ** /*argv*/);
+
+#endif /* SCREENINTSTRUCT_H */
|