diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
commit | d568221710959cf7d783e6ff0fb80fb43a231124 (patch) | |
tree | 8d6f039393294c6ffac8533639afdebe5d68bfc1 /include | |
parent | 9508a382f8a9f241dab097d921b6d290c1c3a776 (diff) |
XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1
Diffstat (limited to 'include')
-rw-r--r-- | include/closestr.h | 29 | ||||
-rw-r--r-- | include/colormap.h | 4 | ||||
-rw-r--r-- | include/cursor.h | 34 | ||||
-rw-r--r-- | include/cursorstr.h | 6 | ||||
-rw-r--r-- | include/dix.h | 141 | ||||
-rw-r--r-- | include/dixfont.h | 356 | ||||
-rw-r--r-- | include/dixstruct.h | 63 | ||||
-rw-r--r-- | include/extension.h | 4 | ||||
-rw-r--r-- | include/extnsionst.h | 35 | ||||
-rw-r--r-- | include/gc.h | 3 | ||||
-rw-r--r-- | include/gcstruct.h | 15 | ||||
-rw-r--r-- | include/input.h | 39 | ||||
-rw-r--r-- | include/inputstr.h | 3 | ||||
-rw-r--r-- | include/misc.h | 69 | ||||
-rw-r--r-- | include/miscstruct.h | 8 | ||||
-rw-r--r-- | include/opaque.h | 38 | ||||
-rw-r--r-- | include/os.h | 216 | ||||
-rw-r--r-- | include/property.h | 5 | ||||
-rw-r--r-- | include/propertyst.h | 4 | ||||
-rw-r--r-- | include/regionstr.h | 31 | ||||
-rw-r--r-- | include/resource.h | 78 | ||||
-rw-r--r-- | include/screenint.h | 8 | ||||
-rw-r--r-- | include/scrnintstr.h | 93 | ||||
-rw-r--r-- | include/servermd.h | 288 | ||||
-rw-r--r-- | include/site.h | 10 | ||||
-rw-r--r-- | include/validate.h | 3 | ||||
-rw-r--r-- | include/window.h | 12 | ||||
-rw-r--r-- | include/windowstr.h | 1 |
28 files changed, 1060 insertions, 536 deletions
diff --git a/include/closestr.h b/include/closestr.h index 323a971bb..3bcb92634 100644 --- a/include/closestr.h +++ b/include/closestr.h @@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/include/closestr.h,v 3.4 2001/12/14 19:59:53 dawes Exp $ */ #ifndef CLOSESTR_H @@ -102,6 +103,18 @@ typedef struct _LFclosure { /* PolyText */ +typedef + int (* PolyTextPtr)( +#if NeedNestedPrototypes + DrawablePtr /* pDraw */, + GCPtr /* pGC */, + int /* x */, + int /* y */, + int /* count */, + void * /* chars or shorts */ +#endif + ); + typedef struct _PTclosure { ClientPtr client; DrawablePtr pDraw; @@ -112,7 +125,7 @@ typedef struct _PTclosure { int xorg; int yorg; CARD8 reqType; - int (* polyText)(); + PolyTextPtr polyText; int itemSize; XID did; int err; @@ -121,6 +134,18 @@ typedef struct _PTclosure { /* ImageText */ +typedef + void (* ImageTextPtr)( +#if NeedNestedPrototypes + DrawablePtr /* pDraw */, + GCPtr /* pGC */, + int /* x */, + int /* y */, + int /* count */, + void * /* chars or shorts */ +#endif + ); + typedef struct _ITclosure { ClientPtr client; DrawablePtr pDraw; @@ -130,7 +155,7 @@ typedef struct _ITclosure { int xorg; int yorg; CARD8 reqType; - void (* imageText)(); + ImageTextPtr imageText; int itemSize; XID did; Bool slept; diff --git a/include/colormap.h b/include/colormap.h index e2515a8ed..2a8f87f23 100644 --- a/include/colormap.h +++ b/include/colormap.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.5 2001/12/14 19:59:53 dawes Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -45,6 +46,7 @@ SOFTWARE. */ /* $Xorg: colormap.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */ + #ifndef CMAP_H #define CMAP_H 1 @@ -73,7 +75,7 @@ SOFTWARE. typedef CARD32 Pixel; typedef struct _CMEntry *EntryPtr; -typedef struct _ColormapRec *ColormapPtr; +/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */ typedef struct _colorResource *colorResourcePtr; extern int CreateColormap( diff --git a/include/cursor.h b/include/cursor.h index 24200837c..82423cd9e 100644 --- a/include/cursor.h +++ b/include/cursor.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/cursor.h,v 1.6 2002/09/17 01:15:14 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -54,6 +55,11 @@ SOFTWARE. #define NullCursor ((CursorPtr)NULL) +/* Provide support for alpha composited cursors */ +#ifdef RENDER +#define ARGB_CURSOR +#endif + typedef struct _Cursor *CursorPtr; typedef struct _CursorMetric *CursorMetricPtr; @@ -66,6 +72,11 @@ extern int FreeCursor( #endif ); +/* Quartz support on Mac OS X pulls in the QuickDraw + framework whose AllocCursor function conflicts here. */ +#ifdef __DARWIN__ +#define AllocCursor Darwin_X_AllocCursor +#endif extern CursorPtr AllocCursor( #if NeedFunctionPrototypes unsigned char* /*psrcbits*/, @@ -80,6 +91,21 @@ extern CursorPtr AllocCursor( #endif ); +extern CursorPtr AllocCursorARGB( +#if NeedFunctionPrototypes + unsigned char* /*psrcbits*/, + unsigned char* /*pmaskbits*/, + CARD32* /*argb*/, + CursorMetricPtr /*cm*/, + unsigned /*foreRed*/, + unsigned /*foreGreen*/, + unsigned /*foreBlue*/, + unsigned /*backRed*/, + unsigned /*backGreen*/, + unsigned /*backBlue*/ +#endif +); + extern int AllocGlyphCursor( #if NeedFunctionPrototypes Font /*source*/, @@ -148,4 +174,12 @@ extern void GetSpritePosition( #endif ); +#ifdef PANORAMIX +extern int XineramaGetCursorScreen( +#if NeedFunctionPrototypes + void +#endif +); +#endif /* PANORAMIX */ + #endif /* CURSOR_H */ diff --git a/include/cursorstr.h b/include/cursorstr.h index 4d9efffda..0e2f04a6d 100644 --- a/include/cursorstr.h +++ b/include/cursorstr.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/cursorstr.h,v 1.9 2003/01/12 02:44:27 dawes Exp $ */ + #ifndef CURSORSTRUCT_H #define CURSORSTRUCT_H @@ -60,9 +62,13 @@ SOFTWARE. typedef struct _CursorBits { unsigned char *source; /* points to bits */ unsigned char *mask; /* points to bits */ + Bool emptyMask; /* all zeros mask */ unsigned short width, height, xhot, yhot; /* metrics */ int refcnt; /* can be shared */ pointer devPriv[MAXSCREENS]; /* set by pScr->RealizeCursor*/ +#ifdef ARGB_CURSOR + CARD32 *argb; /* full-color alpha blended */ +#endif } CursorBits, *CursorBitsPtr; typedef struct _Cursor { diff --git a/include/dix.h b/include/dix.h index b53deb374..ba10a3554 100644 --- a/include/dix.h +++ b/include/dix.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/dix.h,v 3.26 2003/01/12 02:44:27 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -269,11 +270,11 @@ SOFTWARE. ValidateGC(pDraw, pGC); -#define WriteReplyToClient(pClient, size, pReply) \ +#define WriteReplyToClient(pClient, size, pReply) { \ if ((pClient)->swapped) \ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \ (pClient, (int)(size), pReply); \ - else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); + else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); } #define WriteSwappedDataToClient(pClient, size, pbuf) \ if ((pClient)->swapped) \ @@ -289,17 +290,12 @@ typedef struct _Client *ClientPtr; /* also in misc.h */ typedef struct _WorkQueue *WorkQueuePtr; - extern ClientPtr requestingClient; extern ClientPtr *clients; extern ClientPtr serverClient; extern int currentMaxClients; -#ifndef __alpha -typedef long HWEventQueueType; -#else typedef int HWEventQueueType; -#endif typedef HWEventQueueType* HWEventQueuePtr; extern HWEventQueuePtr checkForInput[2]; @@ -404,6 +400,36 @@ extern int GetGeometry( #endif ); +extern int SendConnSetup( +#if NeedFunctionPrototypes + ClientPtr /*client*/, + char* /*reason*/ +#endif +); + +extern int +DoGetImage( +#if NeedFunctionPrototypes + ClientPtr /*client*/, + int /*format*/, + Drawable /*drawable*/, + int /*x*/, + int /*y*/, + int /*width*/, + int /*height*/, + Mask /*planemask*/, + xGetImageReply **/*im_return*/ +#endif +); + +#ifdef LBX +extern void IncrementClientCount( +#if NeedFunctionPrototypes + void +#endif +); +#endif /* LBX */ + /* dixutils.c */ extern void CopyISOLatin1Lowered( @@ -478,9 +504,8 @@ extern ClientPtr LookupClient( ); extern void NoopDDA( -#if NeedVarargsPrototypes - void *, - ... +#if NeedFunctionPrototypes + void #endif ); @@ -512,16 +537,6 @@ extern void WakeupHandler( #endif ); -typedef struct timeval ** OSTimePtr; - -typedef void (* BlockHandlerProcPtr)( -#if NeedNestedPrototypes - pointer /* blockData */, - OSTimePtr /* pTimeout */, - pointer /* pReadmask */ -#endif -); - typedef void (* WakeupHandlerProcPtr)( #if NeedNestedPrototypes pointer /* blockData */, @@ -558,9 +573,27 @@ extern void ProcessWorkQueue( #endif ); +extern void ProcessWorkQueueZombies( +#if NeedFunctionPrototypes + void +#endif +); + extern Bool QueueWorkProc( #if NeedFunctionPrototypes - Bool (* /*function*/)(), + Bool (* /*function*/)( +#if NeedNestedPrototypes + ClientPtr /*clientUnused*/, + pointer /*closure*/ +#endif + ), + ClientPtr /*client*/, + pointer /*closure*/ +#endif +); + +typedef Bool (* ClientSleepProcPtr)( +#if NeedFunctionPrototypes ClientPtr /*client*/, pointer /*closure*/ #endif @@ -569,16 +602,19 @@ extern Bool QueueWorkProc( extern Bool ClientSleep( #if NeedFunctionPrototypes ClientPtr /*client*/, - Bool (* /*function*/)(), + ClientSleepProcPtr /* function */, pointer /*closure*/ #endif ); +#ifndef ___CLIENTSIGNAL_DEFINED___ +#define ___CLIENTSIGNAL_DEFINED___ extern Bool ClientSignal( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif ); +#endif /* ___CLIENTSIGNAL_DEFINED___ */ extern void ClientWakeup( #if NeedFunctionPrototypes @@ -641,11 +677,6 @@ extern void SetMaskForEvent( #endif ); -extern Bool PointerConfinedToScreen( -#if NeedFunctionPrototypes - void -#endif -); extern Bool IsParent( #if NeedFunctionPrototypes @@ -666,12 +697,6 @@ extern WindowPtr GetSpriteWindow( #endif ); -extern void GetSpritePosition( -#if NeedFunctionPrototypes - int * /* px */, - int * /* py */ -#endif -); extern void NoticeEventTime( #if NeedFunctionPrototypes @@ -807,6 +832,15 @@ extern void DeliverGrabbedEvent( #endif ); +#ifdef XKB +extern void FixKeyState( +#if NeedFunctionPrototypes + xEvent * /* xE */, + DeviceIntPtr /* keybd */ +#endif +); +#endif /* XKB */ + extern void RecalculateDeliverableEvents( #if NeedFunctionPrototypes WindowPtr /* pWin */ @@ -834,7 +868,7 @@ extern int SetInputFocus( ClientPtr /* client */, DeviceIntPtr /* dev */, Window /* focusID */, - int /* revertTo */, + CARD8 /* revertTo */, Time /* ctime */, Bool /* followOK */ #endif @@ -860,6 +894,8 @@ extern void InitEvents( #endif ); +extern void CloseDownEvents(void); + extern void DeleteWindowFromAnyEvents( #if NeedFunctionPrototypes WindowPtr /* pWin */, @@ -867,11 +903,6 @@ extern void DeleteWindowFromAnyEvents( #endif ); -extern void CheckCursorConfinement( -#if NeedFunctionPrototypes - WindowPtr /* pWin */ -#endif -); extern Mask EventMaskForClient( #if NeedFunctionPrototypes @@ -891,6 +922,7 @@ extern int DeliverEvents( #endif ); + extern void WriteEventsToClient( #if NeedFunctionPrototypes ClientPtr /*pClient*/, @@ -910,38 +942,17 @@ extern int TryClientEvents( #endif ); -extern int EventSelectForWindow( -#if NeedFunctionPrototypes - WindowPtr /*pWin*/, - ClientPtr /*client*/, - Mask /*mask*/ -#endif -); - -extern int EventSuppressForWindow( +extern void WindowsRestructured( #if NeedFunctionPrototypes - WindowPtr /*pWin*/, - ClientPtr /*client*/, - Mask /*mask*/, - Bool * /*checkOptional*/ + void #endif ); -extern int MaybeDeliverEventsToClient( -#if NeedFunctionPrototypes - WindowPtr /*pWin*/, - xEventPtr /*pEvents*/, - int /*count*/, - Mask /*filter*/, - ClientPtr /*dontClient*/ -#endif -); -extern void WindowsRestructured( -#if NeedFunctionPrototypes - void +#ifdef RANDR +void +ScreenRestructured (ScreenPtr pScreen); #endif -); extern void ResetClientPrivates( #if NeedFunctionPrototypes diff --git a/include/dixfont.h b/include/dixfont.h index b35e252bf..2a6877de2 100644 --- a/include/dixfont.h +++ b/include/dixfont.h @@ -21,311 +21,135 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/dixfont.h,v 3.8 2001/04/05 17:42:35 dawes Exp $ */ #ifndef DIXFONT_H #define DIXFONT_H 1 -#include <dix.h> -#include <font.h> -#include <closure.h> +#include "dix.h" +#include "font.h" +#include "closure.h" +#include "fontstruct.h" #define NullDIXFontProp ((DIXFontPropPtr)0) typedef struct _DIXFontProp *DIXFontPropPtr; -extern int FontToXError( -#if NeedFunctionPrototypes - int /*err*/ -#endif -); +extern FPEFunctions *fpe_functions; -extern Bool SetDefaultFont( -#if NeedFunctionPrototypes - char * /*defaultfontname*/ -#endif -); +extern int FontToXError(int /*err*/); -extern void QueueFontWakeup( -#if NeedFunctionPrototypes - FontPathElementPtr /*fpe*/ -#endif -); +extern Bool SetDefaultFont(char * /*defaultfontname*/); -extern void RemoveFontWakeup( -#if NeedFunctionPrototypes - FontPathElementPtr /*fpe*/ -#endif -); +extern void QueueFontWakeup(FontPathElementPtr /*fpe*/); -extern void FontWakeup( -#if NeedFunctionPrototypes - pointer /*data*/, - int /*count*/, - pointer /*LastSelectMask*/ -#endif -); +extern void RemoveFontWakeup(FontPathElementPtr /*fpe*/); -extern int OpenFont( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - XID /*fid*/, - Mask /*flags*/, - unsigned /*lenfname*/, - char * /*pfontname*/ -#endif -); - -extern int CloseFont( -#if NeedFunctionPrototypes - pointer /*pfont*/, - XID /*fid*/ -#endif -); - -typedef struct _xQueryFontReply *xQueryFontReplyPtr; +extern void FontWakeup(pointer /*data*/, + int /*count*/, + pointer /*LastSelectMask*/); -extern void QueryFont( -#if NeedFunctionPrototypes - FontPtr /*pFont*/, - xQueryFontReplyPtr /*pReply*/, - int /*nProtoCCIStructs*/ -#endif -); +extern int OpenFont(ClientPtr /*client*/, + XID /*fid*/, + Mask /*flags*/, + unsigned /*lenfname*/, + char * /*pfontname*/); -extern int ListFonts( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - unsigned char * /*pattern*/, - unsigned int /*length*/, - unsigned int /*max_names*/ -#endif -); +extern int CloseFont(pointer /*pfont*/, + XID /*fid*/); -extern int doPolyText( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - PTclosurePtr /*c*/ -#endif -); - -extern int PolyText( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - unsigned char * /*pElt*/, - unsigned char * /*endReq*/, - int /*xorg*/, - int /*yorg*/, - int /*reqType*/, - XID /*did*/ -#endif -); - -extern int doImageText( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - ITclosurePtr /*c*/ -#endif -); - -extern int ImageText( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - DrawablePtr /*pDraw*/, - GCPtr /*pGC*/, - int /*nChars*/, - unsigned char * /*data*/, - int /*xorg*/, - int /*yorg*/, - int /*reqType*/, - XID /*did*/ -#endif -); - -extern int SetFontPath( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - int /*npaths*/, - unsigned char * /*paths*/, - int * /*error*/ -#endif -); - -extern int SetDefaultFontPath( -#if NeedFunctionPrototypes - char * /*path*/ -#endif -); - -extern unsigned char *GetFontPath( -#if NeedFunctionPrototypes - int * /*count*/, - int * /*length*/ -#endif -); +typedef struct _xQueryFontReply *xQueryFontReplyPtr; -extern int LoadGlyphs( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - FontPtr /*pfont*/, - unsigned /*nchars*/, - int /*item_size*/, - unsigned char * /*data*/ -#endif -); +extern void QueryFont(FontPtr /*pFont*/, + xQueryFontReplyPtr /*pReply*/, + int /*nProtoCCIStructs*/); -extern void DeleteClientFontStuff( -#if NeedFunctionPrototypes - ClientPtr /*client*/ -#endif -); +extern int ListFonts(ClientPtr /*client*/, + unsigned char * /*pattern*/, + unsigned int /*length*/, + unsigned int /*max_names*/); -extern void InitFonts( -#if NeedFunctionPrototypes - void -#endif -); +int +doListFontsWithInfo(ClientPtr /*client*/, + LFWIclosurePtr /*c*/); -extern int GetDefaultPointSize( -#if NeedFunctionPrototypes - void -#endif +extern int doPolyText(ClientPtr /*client*/, + PTclosurePtr /*c*/ ); -extern FontResolutionPtr GetClientResolutions( -#if NeedFunctionPrototypes - int * /*num*/ -#endif -); +extern int PolyText(ClientPtr /*client*/, + DrawablePtr /*pDraw*/, + GCPtr /*pGC*/, + unsigned char * /*pElt*/, + unsigned char * /*endReq*/, + int /*xorg*/, + int /*yorg*/, + int /*reqType*/, + XID /*did*/); -/* XXX leave these unprototyped for now -- need to do groundwork in - * fonts/include/fontstruct.h before we do these - */ -extern int RegisterFPEFunctions( -#if NeedFunctionPrototypes - Bool (* /*name_func*/)(), - int (* /*init_func*/)(), - int (* /*free_func*/)(), - int (* /*reset_func*/)(), - int (* /*open_func*/)(), - int (* /*close_func*/)(), - int (* /*list_func*/)(), - int (* /*start_lfwi_func*/)(), - int (* /*next_lfwi_func*/)(), - int (* /*wakeup_func*/)(), - int (* /*client_died*/)(), - int (* /*load_glyphs*/)(), - int (* /*start_list_alias_func*/)(), - int (* /*next_list_alias_func*/)(), - void (* /* set_path_func*/) () -#endif -); +extern int doImageText(ClientPtr /*client*/, + ITclosurePtr /*c*/); -extern void FreeFonts( -#if NeedFunctionPrototypes - void -#endif -); +extern int ImageText(ClientPtr /*client*/, + DrawablePtr /*pDraw*/, + GCPtr /*pGC*/, + int /*nChars*/, + unsigned char * /*data*/, + int /*xorg*/, + int /*yorg*/, + int /*reqType*/, + XID /*did*/); -extern FontPtr find_old_font( -#if NeedFunctionPrototypes - XID /*id*/ -#endif -); +extern int SetFontPath(ClientPtr /*client*/, + int /*npaths*/, + unsigned char * /*paths*/, + int * /*error*/); -extern Font GetNewFontClientID( -#if NeedFunctionPrototypes - void -#endif -); +extern int SetDefaultFontPath(char * /*path*/); -extern int StoreFontClientFont( -#if NeedFunctionPrototypes - FontPtr /*pfont*/, - Font /*id*/ -#endif -); +extern unsigned char *GetFontPath(int * /*count*/, + int * /*length*/); -extern void DeleteFontClientID( -#if NeedFunctionPrototypes - Font /*id*/ -#endif -); +extern int LoadGlyphs(ClientPtr /*client*/, + FontPtr /*pfont*/, + unsigned /*nchars*/, + int /*item_size*/, + unsigned char * /*data*/); -extern int client_auth_generation( -#if NeedFunctionPrototypes - ClientPtr /*client*/ -#endif -); +extern void DeleteClientFontStuff(ClientPtr /*client*/); -extern int init_fs_handlers( -#if NeedFunctionPrototypes - FontPathElementPtr /*fpe*/, - BlockHandlerProcPtr /*block_handler*/ +/* Quartz support on Mac OS X pulls in the QuickDraw + framework whose InitFonts function conflicts here. */ +#ifdef __DARWIN__ +#define InitFonts Darwin_X_InitFonts #endif -); +extern void InitFonts(void); -extern void remove_fs_handlers( -#if NeedFunctionPrototypes - FontPathElementPtr /*fpe*/, - BlockHandlerProcPtr /*block_handler*/, - Bool /*all*/ -#endif -); +extern void FreeFonts(void); -extern void GetGlyphs( -#if NeedFunctionPrototypes - FontPtr /*font*/, - unsigned long /*count*/, - unsigned char * /*chars*/, - FontEncoding /*fontEncoding*/, - unsigned long * /*glyphcount*/, - CharInfoPtr * /*glyphs*/ -#endif -); +extern FontPtr find_old_font(XID /*id*/); -extern void QueryGlyphExtents( -#if NeedFunctionPrototypes - FontPtr /*pFont*/, - CharInfoPtr * /*charinfo*/, - unsigned long /*count*/, - ExtentInfoPtr /*info*/ -#endif -); +extern void GetGlyphs(FontPtr /*font*/, + unsigned long /*count*/, + unsigned char * /*chars*/, + FontEncoding /*fontEncoding*/, + unsigned long * /*glyphcount*/, + CharInfoPtr * /*glyphs*/); -extern Bool QueryTextExtents( -#if NeedFunctionPrototypes - FontPtr /*pFont*/, - unsigned long /*count*/, - unsigned char * /*chars*/, - ExtentInfoPtr /*info*/ -#endif -); +extern void QueryGlyphExtents(FontPtr /*pFont*/, + CharInfoPtr * /*charinfo*/, + unsigned long /*count*/, + ExtentInfoPtr /*info*/); -extern Bool ParseGlyphCachingMode( -#if NeedFunctionPrototypes - char * /*str*/ -#endif -); +extern Bool QueryTextExtents(FontPtr /*pFont*/, + unsigned long /*count*/, + unsigned char * /*chars*/, + ExtentInfoPtr /*info*/); -extern void InitGlyphCaching( -#if NeedFunctionPrototypes - void -#endif -); +extern Bool ParseGlyphCachingMode(char * /*str*/); -extern void SetGlyphCachingMode( -#if NeedFunctionPrototypes - int /*newmode*/ -#endif -); +extern void InitGlyphCaching(void); -void -ResetFontPrivateIndex( -#if NeedFunctionPrototypes - void -#endif -); +extern void SetGlyphCachingMode(int /*newmode*/); #endif /* DIXFONT_H */ diff --git a/include/dixstruct.h b/include/dixstruct.h index d6db3f2b6..bcf29dc04 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.18 2003/01/12 02:44:27 dawes Exp $ */ /*********************************************************** Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -49,6 +50,22 @@ typedef struct { xConnSetup *setup; } NewClientInfoRec; +typedef void (*ReplySwapPtr) ( +#if NeedNestedPrototypes + ClientPtr /* pClient */, + int /* size */, + void * /* pbuf */ +#endif +); + +extern void ReplyNotSwappd ( +#if NeedNestedPrototypes + ClientPtr /* pClient */, + int /* size */, + void * /* pbuf */ +#endif +); + typedef enum {ClientStateInitial, ClientStateAuthenticating, ClientStateRunning, @@ -63,13 +80,7 @@ typedef struct _Client { pointer requestBuffer; pointer osPrivate; /* for OS layer, including scheduler */ Bool swapped; - void (*pSwapReplyFunc) ( -#if NeedNestedPrototypes - ClientPtr /* pClient */, - int /* size */, - void * /* pbuf */ -#endif -); + ReplySwapPtr pSwapReplyFunc; XID errorValue; int sequence; int closeDownMode; @@ -135,8 +146,44 @@ typedef struct _Client { int * /* num */ #endif ); +#ifdef SMART_SCHEDULE + int smart_priority; + long smart_start_tick; + long smart_stop_tick; + long smart_check_tick; +#endif } ClientRec; +#ifdef SMART_SCHEDULE +/* + * Scheduling interface + */ +extern long SmartScheduleTime; +extern long SmartScheduleInterval; +extern long SmartScheduleSlice; +extern long SmartScheduleMaxSlice; +extern unsigned long SmartScheduleIdleCount; +extern Bool SmartScheduleDisable; +extern Bool SmartScheduleIdle; +extern Bool SmartScheduleTimerStopped; +extern Bool SmartScheduleStartTimer(void); +#define SMART_MAX_PRIORITY 20 +#define SMART_MIN_PRIORITY -20 + +extern Bool SmartScheduleInit( +#ifdef NeedFunctionPrototypes + void +#endif +); + +#endif + +/* This prototype is used pervasively in Xext, dix */ +#if NeedFunctionPrototypes +#define DISPATCH_PROC(func) int func(ClientPtr /* client */) +#else +#define DISPATCH_PROC(func) int func(/* ClientPtr client */) +#endif typedef struct _WorkQueue { struct _WorkQueue *next; @@ -209,7 +256,7 @@ extern int (*k5_Vector[256])() = ); #endif -extern void (* ReplySwapVector[256]) (); +extern ReplySwapPtr ReplySwapVector[256]; extern int ProcBadRequest( #if NeedFunctionPrototypes diff --git a/include/extension.h b/include/extension.h index 69b32feb1..304674fa6 100644 --- a/include/extension.h +++ b/include/extension.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/extension.h,v 1.5 2001/12/14 19:59:54 dawes Exp $ */ + #ifndef EXTENSION_H #define EXTENSION_H @@ -69,6 +71,8 @@ extern void InitExtensions( #endif ); +extern void InitVisualWrap(void); + extern void CloseDownExtensions( #if NeedFunctionPrototypes void diff --git a/include/extnsionst.h b/include/extnsionst.h index 6bb52767d..6de9be309 100644 --- a/include/extnsionst.h +++ b/include/extnsionst.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/extnsionst.h,v 3.7 2001/12/14 19:59:54 dawes Exp $ */ + #ifndef EXTENSIONSTRUCT_H #define EXTENSIONSTRUCT_H @@ -79,15 +81,32 @@ typedef struct _ExtensionEntry { #endif } ExtensionEntry; -/* any attempt to declare the types of the parameters to the functions - * in EventSwapVector fails. The functions take pointers to two events, - * but the exact event types that are declared vary from one function - * to another. You can't even put void *, void * (the ibm compiler - * complains, anyway). +/* + * The arguments may be different for extension event swapping functions. + * Deal with this by casting when initializing the event's EventSwapVector[] + * entries. */ -extern void (* EventSwapVector[128]) (); +typedef void (*EventSwapPtr) ( +#if NeedFunctionPrototypes + xEvent *, + xEvent * +#endif +); + +extern EventSwapPtr EventSwapVector[128]; + +extern void NotImplemented ( /* FIXME: this may move to another file... */ +#if NeedFunctionPrototypes + xEvent *, + xEvent * +#endif +); -typedef void (* ExtensionLookupProc)(/*args indeterminate*/); +typedef void (* ExtensionLookupProc)( /*args indeterminate*/ +#ifdef EXTENSION_PROC_ARGS + EXTENSION_PROC_ARGS +#endif +); typedef struct _ProcEntry { char *name; @@ -140,6 +159,8 @@ extern Bool AddExtensionAlias( #endif ); +extern ExtensionEntry *CheckExtension(const char *extname); + extern ExtensionLookupProc LookupProc( #if NeedFunctionPrototypes char* /*name*/, diff --git a/include/gc.h b/include/gc.h index 5e220d68c..8d1b31fad 100644 --- a/include/gc.h +++ b/include/gc.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/gc.h,v 1.5 2001/12/14 19:59:54 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -49,8 +50,8 @@ SOFTWARE. #ifndef GC_H #define GC_H -#include "misc.h" /* for Bool */ #include "X11/X.h" /* for GContext, Mask */ +#include "Xdefs.h" /* for Bool */ #include "X11/Xproto.h" #include "screenint.h" /* for ScreenPtr */ #include "pixmap.h" /* for DrawablePtr */ diff --git a/include/gcstruct.h b/include/gcstruct.h index 9d6040c9d..35ca1583d 100644 --- a/include/gcstruct.h +++ b/include/gcstruct.h @@ -46,6 +46,9 @@ SOFTWARE. ******************************************************************/ + +/* $XFree86: xc/programs/Xserver/include/gcstruct.h,v 1.6 2001/12/14 19:59:54 dawes Exp $ */ + #ifndef GCSTRUCT_H #define GCSTRUCT_H @@ -371,7 +374,9 @@ typedef struct _GC { unsigned int clientClipType : 2; /* CT_<kind> */ unsigned int miTranslate:1; /* should mi things translate? */ unsigned int tileIsPixel:1; /* tile is solid pixel */ - unsigned int unused:16; /* see comment above */ + 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; @@ -391,6 +396,14 @@ typedef struct _GC { GCFuncs *funcs; GCOps *ops; DevUnion *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/include/input.h b/include/input.h index 161af2d63..e34098f89 100644 --- a/include/input.h +++ b/include/input.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/include/input.h,v 3.7 2001/12/14 19:59:54 dawes Exp $ */ + #ifndef INPUT_H #define INPUT_H @@ -152,6 +154,7 @@ typedef struct { extern KeybdCtrl defaultKeyboardControl; extern PtrCtrl defaultPointerControl; +#undef AddInputDevice extern DevicePtr AddInputDevice( #if NeedFunctionPrototypes DeviceProc /*deviceProc*/, @@ -159,6 +162,16 @@ extern DevicePtr AddInputDevice( #endif ); +#define AddInputDevice(deviceProc, autoStart) \ + _AddInputDevice(deviceProc, autoStart) + +extern DeviceIntPtr _AddInputDevice( +#if NeedFunctionPrototypes + DeviceProc /*deviceProc*/, + Bool /*autoStart*/ +#endif +); + extern Bool EnableDevice( #if NeedFunctionPrototypes DeviceIntPtr /*device*/ @@ -183,24 +196,50 @@ extern void CloseDownDevices( #endif ); +extern void RemoveDevice( +#if NeedFunctionPrototypes + DeviceIntPtr /*dev*/ +#endif +); + extern int NumMotionEvents( #if NeedFunctionPrototypes void #endif ); +#undef RegisterPointerDevice extern void RegisterPointerDevice( #if NeedFunctionPrototypes DevicePtr /*device*/ #endif ); +#define RegisterPointerDevice(device) \ + _RegisterPointerDevice(device) + +extern void _RegisterPointerDevice( +#if NeedFunctionPrototypes + DeviceIntPtr /*device*/ +#endif +); + +#undef RegisterKeyboardDevice extern void RegisterKeyboardDevice( #if NeedFunctionPrototypes DevicePtr /*device*/ #endif ); +#define RegisterKeyboardDevice(device) \ + _RegisterKeyboardDevice(device) + +extern void _RegisterKeyboardDevice( +#if NeedFunctionPrototypes + DeviceIntPtr /*device*/ +#endif +); + extern DevicePtr LookupKeyboardDevice( #if NeedFunctionPrototypes void diff --git a/include/inputstr.h b/include/inputstr.h index 43a50eb56..045e6a2de 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/inputstr.h,v 1.5 2001/12/14 19:59:54 dawes Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -59,7 +60,7 @@ SOFTWARE. #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) -#define MAX_DEVICES 9 +#define MAX_DEVICES 20 #define EMASKSIZE MAX_DEVICES diff --git a/include/misc.h b/include/misc.h index 9627810d8..e3761c5ba 100644 --- a/include/misc.h +++ b/include/misc.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.28 2001/12/14 19:59:55 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -80,17 +81,16 @@ extern unsigned long serverGeneration; #include <X11/Xfuncproto.h> #include <X11/Xmd.h> #include <X11/X.h> +#include <X11/Xdefs.h> +#ifndef IN_MODULE #ifndef NULL -#ifndef X_NOT_STDC_ENV #include <stddef.h> -#else -#define NULL 0 #endif #endif #ifndef MAXSCREENS -#define MAXSCREENS 3 +#define MAXSCREENS 16 #endif #define MAXCLIENTS 256 #define MAXDITS 1 @@ -98,12 +98,6 @@ extern unsigned long serverGeneration; #define MAXFORMATS 8 #define MAXVISUALS_PER_SCREEN 50 -#if NeedFunctionPrototypes -typedef void *pointer; -#else -typedef unsigned char *pointer; -#endif -typedef int Bool; typedef unsigned long PIXEL; typedef unsigned long ATOM; @@ -113,16 +107,6 @@ typedef unsigned long ATOM; #define FALSE 0 #endif -#ifndef _XTYPEDEF_FONTPTR -typedef struct _Font *FontPtr; /* also in fonts/include/font.h */ -#define _XTYPEDEF_FONTPTR -#endif - -#ifndef _XTYPEDEF_CLIENTPTR -typedef struct _Client *ClientPtr; /* also in dix.h */ -#define _XTYPEDEF_CLIENTPTR -#endif - #ifndef _XTYPEDEF_CALLBACKLISTPTR typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */ #define _XTYPEDEF_CALLBACKLISTPTR @@ -131,7 +115,9 @@ typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */ typedef struct _xReq *xReqPtr; #include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */ +#ifndef IN_MODULE #include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */ +#endif #define NullBox ((BoxPtr)0) #define MILLI_PER_MIN (1000 * 60) @@ -154,11 +140,17 @@ typedef struct _xReq *xReqPtr; /* 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)) -#ifndef abs -#define abs(a) ((a) > 0 ? (a) : -(a)) -#endif +#ifndef IN_MODULE +/* abs() is a function, not a macro; include the file declaring + * it in case we haven't done that yet. + */ +#include <stdlib.h> +#endif /* IN_MODULE */ #ifndef Fabs #define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */ #endif @@ -174,13 +166,32 @@ typedef struct _xReq *xReqPtr; */ #define lowbit(x) ((x) & (~(x) + 1)) -#ifndef MAXSHORT -#define MAXSHORT 32767 -#endif -#ifndef MINSHORT -#define MINSHORT -MAXSHORT +#ifndef IN_MODULE +/* 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> #endif +#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 /* some macros to help swap requests, replies, and events */ @@ -240,7 +251,7 @@ extern void SwapShorts( #endif ); -extern int MakePredeclaredAtoms( +extern void MakePredeclaredAtoms( #if NeedFunctionPrototypes void #endif diff --git a/include/miscstruct.h b/include/miscstruct.h index 01dd2821c..7d6dec0e8 100644 --- a/include/miscstruct.h +++ b/include/miscstruct.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/miscstruct.h,v 3.3 2001/12/14 19:59:55 dawes Exp $ */ + #ifndef MISCSTRUCT_H #define MISCSTRUCT_H 1 @@ -61,7 +63,11 @@ typedef union _DevUnion { pointer ptr; long val; unsigned long uval; - pointer (*fptr)(); + pointer (*fptr)( +#if NeedFunctionPrototypes + void +#endif + ); } DevUnion; #endif /* MISCSTRUCT_H */ diff --git a/include/opaque.h b/include/opaque.h index f35f39d29..1834202ae 100644 --- a/include/opaque.h +++ b/include/opaque.h @@ -26,16 +26,17 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.11 2002/10/08 23:55:22 dawes Exp $ */ #ifndef OPAQUE_H #define OPAQUE_H #include <X11/Xmd.h> -extern char *defaultFontPath; +#include "globals.h" + extern char *defaultTextFont; extern char *defaultCursorFont; -extern char *rgbPath; extern int MaxClients; extern char isItTimeToYield; extern char dispatchException; @@ -46,11 +47,36 @@ extern char dispatchException; #define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */ extern CARD32 TimeOutValue; -extern CARD32 ScreenSaverTime; -extern CARD32 ScreenSaverInterval; -extern int ScreenSaverBlanking; -extern int ScreenSaverAllowExposures; +extern int ScreenSaverBlanking; +extern int ScreenSaverAllowExposures; +extern int defaultScreenSaverBlanking; +extern int defaultScreenSaverAllowExposures; extern int argcGlobal; extern char **argvGlobal; +extern char *display; + +extern int defaultBackingStore; +extern Bool disableBackingStore; +extern Bool enableBackingStore; +extern Bool disableSaveUnders; +extern Bool PartialNetwork; +#ifndef NOLOGOHACK +extern int logoScreenSaver; +#endif +#ifdef RLIMIT_DATA +extern int limitDataSpace; +#endif +#ifdef RLIMIT_STACK +extern int limitStackSpace; +#endif +#ifdef RLIMIT_NOFILE +extern int limitNoFile; +#endif +extern Bool permitOldBugs; +extern Bool defeatAccessControl; +extern char* protNoListen; +extern Bool blackRoot; + + #endif /* OPAQUE_H */ diff --git a/include/os.h b/include/os.h index 99bfd386c..6aa6e29e4 100644 --- a/include/os.h +++ b/include/os.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/os.h,v 3.43 2002/12/24 17:42:59 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -53,6 +54,11 @@ SOFTWARE. #define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size)) #define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr)) #include "Xalloca.h" +#ifndef IN_MODULE +#include <stdarg.h> +#else +#include "xf86_ansic.h" +#endif #define NullFID ((FID) 0) @@ -72,21 +78,24 @@ typedef pointer FID; typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; +#ifndef xalloc #define xnfalloc(size) XNFalloc((unsigned long)(size)) +#define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) #define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size)) #define xalloc(size) Xalloc((unsigned long)(size)) +#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size)) #define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size)) #define xfree(ptr) Xfree((pointer)(ptr)) +#define xstrdup(s) Xstrdup(s) +#define xnfstrdup(s) XNFstrdup(s) +#endif -#ifndef X_NOT_STDC_ENV -#include <string.h> -#else -#ifdef SYSV -#include <string.h> -#else -#include <strings.h> +#ifndef IN_MODULE +#ifdef SCO +#include <stdio.h> #endif +#include <string.h> #endif /* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */ @@ -96,6 +105,9 @@ typedef struct _NewClientRec *NewClientPtr; #define SIGVAL void #endif +extern Bool OsDelayInitColors; +extern void (*OsVendorVErrorFProc)(const char *, va_list args); + extern int WaitForSomething( #if NeedFunctionPrototypes int* /*pClientsReady*/ @@ -109,6 +121,12 @@ extern int StandardReadRequestFromClient( ClientPtr /*client*/ #endif ); + +extern int ClientConnectionNumber( +#if NeedFunctionPrototypes + ClientPtr /*client*/ +#endif +); #else extern int ReadRequestFromClient( #if NeedFunctionPrototypes @@ -125,7 +143,7 @@ extern Bool InsertFakeRequest( #endif ); -extern int ResetCurrentRequest( +extern void ResetCurrentRequest( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif @@ -163,6 +181,12 @@ extern void ResetOsBuffers( #endif ); +extern void InitConnectionLimits( +#if NeedFunctionPrototypes + void +#endif +); + extern void CreateWellKnownSockets( #if NeedFunctionPrototypes void @@ -175,6 +199,12 @@ extern void ResetWellKnownSockets( #endif ); +extern void CloseWellKnownConnections( +#if NeedFunctionPrototypes + void +#endif +); + extern XID AuthorizationIDOfClient( #if NeedFunctionPrototypes @@ -211,54 +241,68 @@ extern void CloseDownConnection( #endif ); -extern int AddEnabledDevice( +extern void AddEnabledDevice( #if NeedFunctionPrototypes int /*fd*/ #endif ); -extern int RemoveEnabledDevice( +extern void RemoveEnabledDevice( #if NeedFunctionPrototypes int /*fd*/ #endif ); -extern int OnlyListenToOneClient( +extern void OnlyListenToOneClient( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif ); -extern int ListenToAllClients( +extern void ListenToAllClients( #if NeedFunctionPrototypes void #endif ); -extern int IgnoreClient( +extern void IgnoreClient( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif ); -extern int AttendClient( +extern void AttendClient( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif ); -extern int MakeClientGrabImpervious( +extern void MakeClientGrabImpervious( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif ); -extern int MakeClientGrabPervious( +extern void MakeClientGrabPervious( #if NeedFunctionPrototypes ClientPtr /*client*/ #endif ); +#ifdef LBX +extern void CloseDownFileDescriptor( +#if NeedFunctionPrototypes + ClientPtr /* client */ +#endif +); +#endif + +extern void AvailableClientInput( +#if NeedFunctionPrototypes + ClientPtr /* client */ +#endif +); + extern void Error( #if NeedFunctionPrototypes char* /*str*/ @@ -271,7 +315,7 @@ extern CARD32 GetTimeInMillis( #endif ); -extern int AdjustWaitForDelay( +extern void AdjustWaitForDelay( #if NeedFunctionPrototypes pointer /*waitTime*/, unsigned long /*newdelay*/ @@ -356,32 +400,38 @@ extern void ProcessCommandLine( #endif ); -extern unsigned long *Xalloc( +extern pointer Xalloc( #if NeedFunctionPrototypes unsigned long /*amount*/ #endif ); -extern unsigned long *XNFalloc( +extern pointer XNFalloc( #if NeedFunctionPrototypes unsigned long /*amount*/ #endif ); -extern unsigned long *Xcalloc( +extern pointer Xcalloc( #if NeedFunctionPrototypes unsigned long /*amount*/ #endif ); -extern unsigned long *Xrealloc( +extern pointer XNFcalloc( +#if NeedFunctionPrototypes + unsigned long /*amount*/ +#endif +); + +extern pointer Xrealloc( #if NeedFunctionPrototypes pointer /*ptr*/, unsigned long /*amount*/ #endif ); -extern unsigned long *XNFrealloc( +extern pointer XNFrealloc( #if NeedFunctionPrototypes pointer /*ptr*/, unsigned long /*amount*/ @@ -394,12 +444,15 @@ extern void Xfree( #endif ); -extern int OsInitAllocator( +extern void OsInitAllocator( #if NeedFunctionPrototypes void #endif ); +extern char *Xstrdup(const char *s); +extern char *XNFstrdup(const char *s); + typedef SIGVAL (*OsSigHandlerPtr)( #if NeedFunctionPrototypes int /* sig */ @@ -415,27 +468,56 @@ extern OsSigHandlerPtr OsSignal( extern int auditTrailLevel; +extern void AuditPrefix( +#if NeedFunctionPrototypes + const char * +#endif +); + extern void AuditF( #if NeedVarargsPrototypes - char* /*f*/, + const char* /*f*/, ... #endif ); extern void FatalError( #if NeedVarargsPrototypes - char* /*f*/, + const char* /*f*/, ... #endif -); +) +#if defined(__GNUC__) && \ + ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4))) +__attribute((noreturn)) +#endif +; extern void ErrorF( #if NeedVarargsPrototypes - char* /*f*/, + const char* /*f*/, ... #endif ); +#if NeedVarargsPrototypes +extern void VErrorF(const char *f, va_list args); +#endif + +#ifdef SERVER_LOCK +extern void LockServer( +#if NeedFunctionPrototypes + void +#endif +); + +extern void UnlockServer( +#if NeedFunctionPrototypes + void +#endif +); +#endif + extern int OsLookupColor( #if NeedFunctionPrototypes int /*screen*/, @@ -453,6 +535,18 @@ extern void OsInit( #endif ); +extern void OsCleanup( +#if NeedFunctionPrototypes + void +#endif +); + +extern void OsVendorFatalError( +#if NeedFunctionPrototypes + void +#endif +); + extern void OsVendorInit( #if NeedFunctionPrototypes void @@ -465,6 +559,31 @@ extern int OsInitColors( #endif ); +void OsBlockSignals ( +#if NeedFunctionPrototypes + void +#endif + ); + +void OsReleaseSignals ( +#if NeedFunctionPrototypes + void +#endif + ); + +#if !defined(WIN32) && !defined(__UNIXOS2__) +extern int System(char *); +extern pointer Popen(char *, char *); +extern int Pclose(pointer); +#else +#define System(a) system(a) +#define Popen(a,b) popen(a,b) +#define Pclose(a) pclose(a) +#endif + +extern void CheckUserParameters(int argc, char **argv, char **envp); +extern void CheckUserAuthorization(void); + extern int AddHost( #if NeedFunctionPrototypes ClientPtr /*client*/, @@ -477,7 +596,13 @@ extern int AddHost( extern Bool ForEachHostInFamily ( #if NeedFunctionPrototypes int /*family*/, - Bool (* /*func*/ )(), + Bool (* /*func*/ )( +#if NeedNestedPrototypes + unsigned char * /* addr */, + short /* len */, + pointer /* closure */ +#endif + ), pointer /*closure*/ #endif ); @@ -515,6 +640,8 @@ extern int LocalClient( #endif ); +extern int LocalClientCred(ClientPtr, int *, int *); + extern int ChangeAccessControl( #if NeedFunctionPrototypes ClientPtr /*client*/, @@ -590,6 +717,19 @@ extern void RegisterAuthorizations( #endif ); +extern XID AuthorizationToID ( + unsigned short name_length, + char *name, + unsigned short data_length, + char *data); + +extern int AuthorizationFromID ( + XID id, + unsigned short *name_lenp, + char **namep, + unsigned short *data_lenp, + char **datap); + extern XID CheckAuthorization( #if NeedFunctionPrototypes unsigned int /*namelength*/, @@ -607,12 +747,18 @@ extern void ResetAuthorization( #endif ); +extern int RemoveAuthorization ( + unsigned short name_length, + char *name, + unsigned short data_length, + char *data); + extern int AddAuthorization( #if NeedFunctionPrototypes - unsigned int /*name_length*/, - char * /*name*/, - unsigned int /*data_length*/, - char * /*data*/ + unsigned int /*name_length*/, + char * /*name*/, + unsigned int /*data_length*/, + char * /*data*/ #endif ); @@ -644,6 +790,8 @@ extern int ddxProcessArgument( #endif ); +extern void ddxUseMsg(void); + /* * idiom processing stuff */ @@ -704,4 +852,8 @@ typedef struct { /* stuff for FlushCallback */ extern CallbackListPtr FlushCallback; +extern void AbortDDX(void); +extern void ddxGiveUp(void); +extern int TimeSinceLastInputEvent(void); + #endif /* OS_H */ diff --git a/include/property.h b/include/property.h index a5dfbc914..c77b0735e 100644 --- a/include/property.h +++ b/include/property.h @@ -45,8 +45,13 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/property.h,v 1.3 2001/12/14 19:59:55 dawes Exp $ */ + #ifndef PROPERTY_H #define PROPERTY_H + +#include "window.h" + typedef struct _Property *PropertyPtr; extern int ChangeWindowProperty( diff --git a/include/propertyst.h b/include/propertyst.h index b704b61fb..5c335d038 100644 --- a/include/propertyst.h +++ b/include/propertyst.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/propertyst.h,v 3.3 2001/12/14 19:59:55 dawes Exp $ */ + #ifndef PROPERTYSTRUCT_H #define PROPERTYSTRUCT_H #include "misc.h" @@ -60,7 +62,7 @@ typedef struct _Property { short format; /* format of data for swapping - 8,16,32 */ long size; /* size of data in (format/8) bytes */ pointer data; /* private to client */ -#ifdef LBX +#if defined(LBX) || defined(LBX_COMPAT) /* If space is at a premium and binary compatibility is not * an issue, you may want to put the owner_pid next to format * so that the two shorts pack together without padding. diff --git a/include/regionstr.h b/include/regionstr.h index 55dc99656..1ac3f2f07 100644 --- a/include/regionstr.h +++ b/include/regionstr.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/regionstr.h,v 1.7 2001/12/14 19:59:56 dawes Exp $ */ + #ifndef REGIONSTRUCT_H #define REGIONSTRUCT_H @@ -75,8 +77,11 @@ typedef struct _Region { extern BoxRec miEmptyBox; extern RegDataRec miEmptyData; +extern 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) \ @@ -131,6 +136,12 @@ extern RegDataRec miEmptyData; #define REGION_NOTEMPTY(_pScreen, _pReg) \ (*(_pScreen)->RegionNotEmpty)(_pReg) +#define REGION_BROKEN(_pScreen, _pReg) \ + (*(_pScreen)->RegionBroken)(_pReg) + +#define REGION_BREAK(_pScreen, _pReg) \ + (*(_pScreen)->RegionBreak)(_pReg) + #define REGION_EMPTY(_pScreen, _pReg) \ (*(_pScreen)->RegionEmpty)(_pReg) @@ -193,6 +204,9 @@ extern RegDataRec miEmptyData; #define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ miRectsToRegion(nrects, prect, ctype) +#define REGION_BREAK(_pScreen, _pReg) \ + miRegionBreak(_pReg) + #ifdef DONT_INLINE_REGION_OPS #define REGION_INIT(_pScreen, _pReg, _rect, _size) \ @@ -207,6 +221,9 @@ extern RegDataRec miEmptyData; #define REGION_NOTEMPTY(_pScreen, _pReg) \ miRegionNotEmpty(_pReg) +#define REGION_BROKEN(_pScreen, _pReg) \ + miRegionBroken(_pReg) + #define REGION_EMPTY(_pScreen, _pReg) \ miRegionEmpty(_pReg) @@ -238,7 +255,10 @@ extern RegDataRec miEmptyData; #define REGION_UNINIT(_pScreen, _pReg) \ { \ - if ((_pReg)->data && (_pReg)->data->size) xfree((_pReg)->data); \ + if ((_pReg)->data && (_pReg)->data->size) { \ + xfree((_pReg)->data); \ + (_pReg)->data = NULL; \ + } \ } #define REGION_RESET(_pScreen, _pReg, _pBox) \ @@ -251,6 +271,9 @@ extern RegDataRec miEmptyData; #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); \ @@ -378,6 +401,12 @@ extern void miRegionReset( #endif ); +extern Bool miRegionBreak( +#if NeedFunctionPrototypes + RegionPtr /*pReg*/ +#endif +); + extern Bool miPointInRegion( #if NeedFunctionPrototypes RegionPtr /*pReg*/, diff --git a/include/resource.h b/include/resource.h index 537093061..63d7ff25a 100644 --- a/include/resource.h +++ b/include/resource.h @@ -45,6 +45,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/resource.h,v 1.11 2002/03/06 21:14:04 mvojkovi Exp $ */ + #ifndef RESOURCE_H #define RESOURCE_H 1 #include "misc.h" @@ -74,6 +76,8 @@ typedef unsigned long RESTYPE; #define RT_WINDOW ((RESTYPE)1|RC_CACHED|RC_DRAWABLE) #define RT_PIXMAP ((RESTYPE)2|RC_CACHED|RC_DRAWABLE) #define RT_GC ((RESTYPE)3|RC_CACHED) +#undef RT_FONT +#undef RT_CURSOR #define RT_FONT ((RESTYPE)4) #define RT_CURSOR ((RESTYPE)5) #define RT_COLORMAP ((RESTYPE)6) @@ -84,11 +88,30 @@ typedef unsigned long RESTYPE; #define RT_NONE ((RESTYPE)0) /* bits and fields within a resource id */ -#define CLIENTOFFSET 22 /* client field */ -#define RESOURCE_ID_MASK 0x3FFFFF /* low 22 bits */ -#define CLIENT_BITS(id) ((id) & 0x3fc00000) /* next 8 bits */ +#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 0x40000000 /* use illegal bit */ +#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */ #ifdef INVALID #undef INVALID /* needed on HP/UX */ @@ -114,6 +137,23 @@ typedef void (*FindResType)( #endif ); +typedef void (*FindAllRes)( +#if NeedNestedPrototypes + pointer /*value*/, + XID /*id*/, + RESTYPE /*type*/, + pointer /*cdata*/ +#endif +); + +typedef Bool (*FindComplexResType)( +#if NeedNestedPrototypes + pointer /*value*/, + XID /*id*/, + pointer /*cdata*/ +#endif +); + extern RESTYPE CreateNewResourceType( #if NeedFunctionPrototypes DeleteType /*deleteFunc*/ @@ -138,6 +178,11 @@ extern XID FakeClientID( #endif ); +/* Quartz support on Mac OS X uses the CarbonCore + framework whose AddResource function conflicts here. */ +#ifdef __DARWIN__ +#define AddResource Darwin_X_AddResource +#endif extern Bool AddResource( #if NeedFunctionPrototypes XID /*id*/, @@ -178,6 +223,14 @@ extern void FindClientResourcesByType( #endif ); +extern void FindAllClientResources( +#if NeedFunctionPrototypes + ClientPtr /*client*/, + FindAllRes /*func*/, + pointer /*cdata*/ +#endif +); + extern void FreeClientNeverRetainResources( #if NeedFunctionPrototypes ClientPtr /*client*/ @@ -217,6 +270,15 @@ extern pointer LookupIDByClass( #endif ); +extern pointer LookupClientResourceComplex( +#if NeedFunctionPrototypes + ClientPtr client, + RESTYPE type, + FindComplexResType func, + pointer cdata +#endif +); + /* These are the access modes that can be passed in the last parameter * to SecurityLookupIDByType/Class. The Security extension doesn't * currently make much use of these; they're mainly provided as an @@ -277,5 +339,13 @@ extern unsigned int GetXIDList( #endif ); +extern RESTYPE lastResourceType; +extern RESTYPE TypeMask; + +#ifdef XResExtension +extern Atom *ResourceNames; +void RegisterResourceName(RESTYPE type, char* name); +#endif + #endif /* RESOURCE_H */ diff --git a/include/screenint.h b/include/screenint.h index f4eb79725..c4ad2a627 100644 --- a/include/screenint.h +++ b/include/screenint.h @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/screenint.h,v 1.5 2001/12/14 19:59:56 dawes Exp $ */ #ifndef SCREENINT_H #define SCREENINT_H @@ -153,7 +154,12 @@ extern void ResetColormapPrivates( ); -typedef int (*InitCmapPrivFunc)(/* ColormapPtr */); +typedef struct _ColormapRec *ColormapPtr; +typedef int (*InitCmapPrivFunc)( +#if NeedNestedPrototypes + ColormapPtr +#endif +); extern int AllocateColormapPrivateIndex( #if NeedFunctionPrototypes diff --git a/include/scrnintstr.h b/include/scrnintstr.h index ea821c7ff..cd4459c6e 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -45,18 +45,17 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/scrnintstr.h,v 1.10 2001/12/14 19:59:56 dawes Exp $ */ + #ifndef SCREENINTSTRUCT_H #define SCREENINTSTRUCT_H #include "screenint.h" #include "miscstruct.h" -#include "region.h" -#include "pixmap.h" -#include "gc.h" +#include "bstore.h" #include "colormap.h" #include "cursor.h" #include "validate.h" -#include "window.h" #include "X11/Xproto.h" #include "dix.h" @@ -194,6 +193,13 @@ typedef Bool (* UnrealizeWindowProcPtr)( #endif ); +typedef void (* RestackWindowProcPtr)( +#if NeedNestedPrototypes + WindowPtr /*pWindow*/, + WindowPtr /*pOldNextSib*/ +#endif +); + typedef int (* ValidateTreeProcPtr)( #if NeedNestedPrototypes WindowPtr /*pParent*/, @@ -218,7 +224,7 @@ typedef void (* WindowExposuresProcPtr)( #endif ); -typedef void (* PaintWindowBackgroundProcPtr)( +typedef void (* PaintWindowProcPtr)( #if NeedNestedPrototypes WindowPtr /*pWindow*/, RegionPtr /*pRegion*/, @@ -226,13 +232,8 @@ typedef void (* PaintWindowBackgroundProcPtr)( #endif ); -typedef void (* PaintWindowBorderProcPtr)( -#if NeedNestedPrototypes - WindowPtr /*pWindow*/, - RegionPtr /*pRegion*/, - int /*what*/ -#endif -); +typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr; +typedef PaintWindowProcPtr PaintWindowBorderProcPtr; typedef void (* CopyWindowProcPtr)( #if NeedNestedPrototypes @@ -458,6 +459,8 @@ typedef void (* ResolveColorProcPtr)( #endif ); +#ifdef NEED_SCREEN_REGIONS + typedef RegionPtr (* RegionCreateProcPtr)( #if NeedNestedPrototypes BoxPtr /*rect*/, @@ -561,6 +564,18 @@ typedef Bool (* RegionNotEmptyProcPtr)( #endif ); +typedef Bool (* RegionBrokenProcPtr)( +#if NeedNestedPrototypes + RegionPtr /*pReg*/ +#endif +); + +typedef Bool (* RegionBreakProcPtr)( +#if NeedNestedPrototypes + RegionPtr /*pReg*/ +#endif +); + typedef void (* RegionEmptyProcPtr)( #if NeedNestedPrototypes RegionPtr /*pReg*/ @@ -587,12 +602,16 @@ typedef Bool (* RegionValidateProcPtr)( #endif ); +#endif /* NEED_SCREEN_REGIONS */ + typedef RegionPtr (* BitmapToRegionProcPtr)( #if NeedNestedPrototypes PixmapPtr /*pPix*/ #endif ); +#ifdef NEED_SCREEN_REGIONS + typedef RegionPtr (* RectsToRegionProcPtr)( #if NeedNestedPrototypes int /*nrects*/, @@ -601,6 +620,8 @@ typedef RegionPtr (* RectsToRegionProcPtr)( #endif ); +#endif /* NEED_SCREEN_REGIONS */ + typedef void (* SendGraphicsExposeProcPtr)( #if NeedNestedPrototypes ClientPtr /*client*/, @@ -615,7 +636,7 @@ typedef void (* ScreenBlockHandlerProcPtr)( #if NeedNestedPrototypes int /*screenNum*/, pointer /*blockData*/, - struct timeval ** /*pTimeout*/, + pointer /*pTimeout*/, pointer /*pReadmask*/ #endif ); @@ -647,6 +668,31 @@ typedef Bool (* ModifyPixmapHeaderProcPtr)( #endif ); +typedef PixmapPtr (* GetWindowPixmapProcPtr)( +#if NeedNestedPrototypes + WindowPtr /*pWin*/ +#endif +); + +typedef void (* SetWindowPixmapProcPtr)( +#if NeedNestedPrototypes + WindowPtr /*pWin*/, + PixmapPtr /*pPix*/ +#endif +); + +typedef PixmapPtr (* GetScreenPixmapProcPtr)( +#if NeedNestedPrototypes + ScreenPtr /*pScreen*/ +#endif +); + +typedef void (* SetScreenPixmapProcPtr)( +#if NeedNestedPrototypes + PixmapPtr /*pPix*/ +#endif +); + typedef void (* MarkWindowProcPtr)( #if NeedNestedPrototypes WindowPtr /*pWin*/ @@ -797,6 +843,7 @@ typedef struct _Screen { CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; + RestackWindowProcPtr RestackWindow; /* Pixmap procedures */ @@ -811,6 +858,11 @@ typedef struct _Screen { 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 */ @@ -843,6 +895,7 @@ typedef struct _Screen { /* Region procedures */ +#ifdef NEED_SCREEN_REGIONS RegionCreateProcPtr RegionCreate; RegionInitProcPtr RegionInit; RegionCopyProcPtr RegionCopy; @@ -857,12 +910,17 @@ typedef struct _Screen { RectInProcPtr RectIn; PointInRegionProcPtr PointInRegion; RegionNotEmptyProcPtr RegionNotEmpty; + RegionBrokenProcPtr RegionBroken; + RegionBreakProcPtr RegionBreak; RegionEmptyProcPtr RegionEmpty; RegionExtentsProcPtr RegionExtents; RegionAppendProcPtr RegionAppend; RegionValidateProcPtr RegionValidate; +#endif /* NEED_SCREEN_REGIONS */ BitmapToRegionProcPtr BitmapToRegion; +#ifdef NEED_SCREEN_REGIONS RectsToRegionProcPtr RectsToRegion; +#endif /* NEED_SCREEN_REGIONS */ SendGraphicsExposeProcPtr SendGraphicsExpose; /* os layer procedures */ @@ -879,12 +937,17 @@ typedef struct _Screen { CreateScreenResourcesProcPtr CreateScreenResources; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; + GetWindowPixmapProcPtr GetWindowPixmap; + SetWindowPixmapProcPtr SetWindowPixmap; + GetScreenPixmapProcPtr GetScreenPixmap; + SetScreenPixmapProcPtr SetScreenPixmap; + PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */ #ifdef PIXPRIV int PixmapPrivateLen; - unsigned *PixmapPrivateSizes; - unsigned totalPixmapSize; + unsigned int *PixmapPrivateSizes; + unsigned int totalPixmapSize; #endif MarkWindowProcPtr MarkWindow; diff --git a/include/servermd.h b/include/servermd.h index eb6b7b272..9c413b0cb 100644 --- a/include/servermd.h +++ b/include/servermd.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/include/servermd.h,v 3.53 2002/05/31 18:46:04 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -44,9 +45,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $Xorg: servermd.h,v 1.3 2000/08/17 19:53:31 cpqbld Exp $ */ + #ifndef SERVERMD_H #define SERVERMD_H 1 -/* $Xorg: servermd.h,v 1.4 2001/02/09 02:05:16 xorgcvs Exp $ */ /* * Machine dependent values: @@ -130,12 +132,87 @@ SOFTWARE. #endif /* vax */ +#ifdef __arm32__ + +#define IMAGE_BYTE_ORDER LSBFirst + +# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) +# define BITMAP_BIT_ORDER MSBFirst +# else +# define BITMAP_BIT_ORDER LSBFirst +# endif + +# if defined(XF86MONOVGA) || defined(XF86VGA16) +# define BITMAP_SCANLINE_UNIT 8 +# endif + +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 +#define LARGE_INSTRUCTION_CACHE +#define AVOID_MEMORY_READ + +#endif /* __arm32__ */ + +#if defined (__hppa__) + +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst +#define GLYPHPADBYTES 4 /* to make fb work */ +#define GETLEFTBITS_ALIGNMENT 1 /* PA forces longs to 4 */ + /* byte boundries */ +#define AVOID_MEMORY_READ +#define FAST_CONSTANT_OFFSET_MODE +#define LARGE_INSTRUCTION_CACHE +#define PLENTIFUL_REGISTERS + +#endif /* __hppa__ */ + +#if defined(__powerpc__) + +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 + +/* XXX Should this be for Lynx only? */ +#ifdef Lynx +#define BITMAP_SCANLINE_UNIT 8 +#endif + +#define LARGE_INSTRUCTION_CACHE +#define FAST_CONSTANT_OFFSET_MODE +#define PLENTIFUL_REGISTERS +#define AVOID_MEMORY_READ + +#define FAST_MEMCPY + +#endif /* PowerPC */ + +#if defined(__sh__) + +#if defined(__BIG_ENDIAN__) +# define IMAGE_BYTE_ORDER MSBFirst +# define BITMAP_BIT_ORDER MSBFirst +# define GLYPHPADBYTES 4 +# define GETLEFTBITS_ALIGNMENT 1 +#else +# define IMAGE_BYTE_ORDER LSBFirst +# define BITMAP_BIT_ORDER LSBFirst +# define GLYPHPADBYTES 4 +# define GETLEFTBITS_ALIGNMENT 1 +#endif + +#define AVOID_MEMORY_READ +#define FAST_CONSTANT_OFFSET_MODE +#define LARGE_INSTRUCTION_CACHE +#define PLENTIFUL_REGISTERS + +#endif /* SuperH */ + + #if (defined(sun) && !(defined(i386) && defined(SVR4))) || \ - (defined(AMOEBA) && (defined(sparc) || defined(mc68000))) || \ (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \ - (defined(Lynx) && defined(__sparc__)) || \ - ((defined(__NetBSD__) || defined(__OpenBSD__)) && \ - (defined(__sparc__) || defined(__mc68000__))) + defined(__sparc__) || defined(__mc68000__) #if defined(sun386) || defined(sun5) # define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */ @@ -159,7 +236,7 @@ SOFTWARE. #define GLYPHPADBYTES 4 #define GETLEFTBITS_ALIGNMENT 1 -#endif /* sun */ +#endif /* sun && !(i386 && SVR4) */ #if defined(AIXV3) @@ -252,31 +329,100 @@ SOFTWARE. #endif /* mips */ -#if defined(__alpha) || defined(__alphaCross) +#if defined(__alpha) || defined(__alpha__) || defined(__alphaCross) # define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */ -# define BITMAP_BIT_ORDER LSBFirst + +# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) +# define BITMAP_BIT_ORDER MSBFirst +# else +# define BITMAP_BIT_ORDER LSBFirst +# endif + +# if defined(XF86MONOVGA) || defined(XF86VGA16) +# define BITMAP_SCANLINE_UNIT 8 +# endif + # define GLYPHPADBYTES 4 # define GETLEFTBITS_ALIGNMENT 1 # define FAST_CONSTANT_OFFSET_MODE # define LARGE_INSTRUCTION_CACHE # define PLENTIFUL_REGISTERS -/* pad scanline to a longword */ -#define BITMAP_SCANLINE_UNIT 64 +#endif /* alpha */ + +#if defined (linux) && defined (__s390__) -#define BITMAP_SCANLINE_PAD 64 -#define LOG2_BITMAP_PAD 6 -#define LOG2_BYTES_PER_SCANLINE_PAD 3 +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 + +#define BITMAP_SCANLINE_UNIT 8 +#define LARGE_INSTRUCTION_CACHE +#define FAST_CONSTANT_OFFSET_MODE +#define FAST_UNALIGNED_READ -/* Add for handling protocol XPutImage and XGetImage; see comment below */ -#define INTERNAL_VS_EXTERNAL_PADDING -#define BITMAP_SCANLINE_UNIT_PROTO 32 +#define FAST_MEMCPY -#define BITMAP_SCANLINE_PAD_PROTO 32 -#define LOG2_BITMAP_PAD_PROTO 5 -#define LOG2_BYTES_PER_SCANLINE_PAD_PROTO 2 +#endif /* linux/s390 */ -#endif /* alpha */ +#if defined (linux) && defined (__s390x__) + +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 + +#define BITMAP_SCANLINE_UNIT 8 +#define LARGE_INSTRUCTION_CACHE +#define FAST_CONSTANT_OFFSET_MODE +#define FAST_UNALIGNED_READ + +#define FAST_MEMCPY +#endif /* linux/s390x */ + + +#if defined(__ia64__) || defined(ia64) +# define IMAGE_BYTE_ORDER LSBFirst + +# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) +# define BITMAP_BIT_ORDER MSBFirst +# else +# define BITMAP_BIT_ORDER LSBFirst +# endif + +# if defined(XF86MONOVGA) || defined(XF86VGA16) +# define BITMAP_SCANLINE_UNIT 8 +# endif + +# define GLYPHPADBYTES 4 +# define GETLEFTBITS_ALIGNMENT 1 +# define FAST_CONSTANT_OFFSET_MODE +# define LARGE_INSTRUCTION_CACHE +# define PLENTIFUL_REGISTERS + +#endif /* ia64 */ + +#if defined(__x86_64__) || defined(x86_64) +# define IMAGE_BYTE_ORDER LSBFirst + +# if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) +# define BITMAP_BIT_ORDER MSBFirst +# else +# define BITMAP_BIT_ORDER LSBFirst +# endif + +# if defined(XF86MONOVGA) || defined(XF86VGA16) +# define BITMAP_SCANLINE_UNIT 8 +# endif + +# define GLYPHPADBYTES 4 +# define GETLEFTBITS_ALIGNMENT 1 +# define LARGE_INSTRUCTION_CACHE +# define FAST_CONSTANT_OFFSET_MODE +/* ???? */ +# define FAST_UNALIGNED_READS +#endif /* x86_64 */ #ifdef stellar @@ -308,18 +454,14 @@ SOFTWARE. #endif /* luna */ -#if ((defined(SVR4) && defined(i386)) || \ - (defined(SYSV) && defined(i386)) || \ - (defined(sun) && defined (i386) && defined(SVR4)) || \ - defined(__bsdi__) || \ - (defined(__NetBSD__) && defined(__i386__)) || \ - defined(__FreeBSD__) || \ - defined(MACH386) || \ - defined(linux) || \ - (defined(AMOEBA) && defined(i80386)) || \ - defined(MINIX) || \ - defined(WIN32)) - +#if (defined(SVR4) && defined(i386)) || \ + defined(__alpha__) || defined(__alpha) || \ + defined(__i386__) || \ + defined(__UNIXOS2__) || \ + defined(__OS2ELF__) || \ + defined(__QNX__) || \ + defined(__s390x__) || defined(__s390__) + #ifndef IMAGE_BYTE_ORDER #define IMAGE_BYTE_ORDER LSBFirst #endif @@ -353,6 +495,15 @@ SOFTWARE. #endif /* SVR4 / BSD / i386 */ +#if defined (linux) && defined (__mc68000__) + +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst +#define FAST_UNALIGNED_READS +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 + +#endif /* linux/m68k */ #ifdef sgi @@ -364,21 +515,6 @@ SOFTWARE. # define GLYPHPADBYTES 4 # define GETLEFTBITS_ALIGNMENT 1 -/* pad scanline to a longword */ -#define BITMAP_SCANLINE_UNIT 64 - -#define BITMAP_SCANLINE_PAD 64 -#define LOG2_BITMAP_PAD 6 -#define LOG2_BYTES_PER_SCANLINE_PAD 3 - -/* Add for handling protocol XPutImage and XGetImage; see comment below */ -#define INTERNAL_VS_EXTERNAL_PADDING -#define BITMAP_SCANLINE_UNIT_PROTO 32 - -#define BITMAP_SCANLINE_PAD_PROTO 32 -#define LOG2_BITMAP_PAD_PROTO 5 -#define LOG2_BYTES_PER_SCANLINE_PAD_PROTO 2 - #else #define GLYPHPADBYTES 2 @@ -393,18 +529,20 @@ SOFTWARE. #endif +/* linux on the Compaq Itsy */ +#if defined(linux) && defined(__arm__) +#define IMAGE_BYTE_ORDER LSBFirst +#define BITMAP_BIT_ORDER LSBFirst +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 +#endif + /* size of buffer to use with GetImage, measured in bytes. There's obviously * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives * you) used and the number of times the ddx routine has to be called. - * - * for a 1024 x 864 bit monochrome screen with a 32 bit word we get - * 8192/4 words per buffer - * (1024/32) = 32 words per scanline - * 2048 words per buffer / 32 words per scanline = 64 scanlines per buffer - * 864 scanlines / 64 scanlines = 14 buffers to draw a full screen */ #ifndef IMAGE_BUFSIZE -#define IMAGE_BUFSIZE 8192 +#define IMAGE_BUFSIZE (64*1024) #endif /* pad scanline to a longword */ @@ -429,12 +567,22 @@ typedef struct _PaddingInfo { int padRoundUp; /* pixels per pad unit - 1 */ int padPixelsLog2; /* log 2 (pixels per pad unit) */ int padBytesLog2; /* log 2 (bytes per pad unit) */ + int notPower2; /* bitsPerPixel not a power of 2 */ + int bytesPerPixel; /* only set when notPower2 is TRUE */ + int bitsPerPixel; /* bits per pixel */ } PaddingInfo; extern PaddingInfo PixmapWidthPaddingInfo[]; +/* The only portable way to get the bpp from the depth is to look it up */ +#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel) + #define PixmapWidthInPadUnits(w, d) \ + (PixmapWidthPaddingInfo[d].notPower2 ? \ + (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \ + PixmapWidthPaddingInfo[d].bytesPerPixel) >> \ + PixmapWidthPaddingInfo[d].padBytesLog2) : \ ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \ - PixmapWidthPaddingInfo[d].padPixelsLog2) + PixmapWidthPaddingInfo[d].padPixelsLog2)) /* * Return the number of bytes to which a scanline of the given @@ -446,38 +594,8 @@ extern PaddingInfo PixmapWidthPaddingInfo[]; #define BitmapBytePad(w) \ (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD) -#ifdef INTERNAL_VS_EXTERNAL_PADDING - -/* This is defined if the server's internal padding is different from the padding - * advertised in the protocol. The protocol does not allow for padding to - * 64 bits, for example, so if the server wants to use 64 bit padding internally, - * it has to advertise 32 bit padding and do padding fixups whenever images - * cross the wire. (See ProcGetImage and ProcPutImage.) - * - * The macros and constants that end in Proto or PROTO refer to the advertised - * padding, and the ones without Proto are for internal padding. - */ - -extern PaddingInfo PixmapWidthPaddingInfoProto[]; - -#define PixmapWidthInPadUnitsProto(w, d) \ - ((int)((w) + PixmapWidthPaddingInfoProto[d].padRoundUp) >> \ - PixmapWidthPaddingInfoProto[d].padPixelsLog2) - -#define PixmapBytePadProto(w, d) \ - (PixmapWidthInPadUnitsProto(w, d) << \ - PixmapWidthPaddingInfoProto[d].padBytesLog2) - -#define BitmapBytePadProto(w) \ - ((((w) + BITMAP_SCANLINE_PAD_PROTO - 1) >> LOG2_BITMAP_PAD_PROTO) \ - << LOG2_BYTES_PER_SCANLINE_PAD_PROTO) - -#else /* protocol and internal padding is the same */ - #define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d) #define PixmapBytePadProto(w, d) PixmapBytePad(w, d) #define BitmapBytePadProto(w) BitmapBytePad(w) -#endif /* protocol vs. internal padding */ - #endif /* SERVERMD_H */ diff --git a/include/site.h b/include/site.h index 426842183..36a05eb73 100644 --- a/include/site.h +++ b/include/site.h @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/include/site.h,v 1.8 2001/12/19 21:37:35 dawes Exp $ */ #ifndef SITE_H #define SITE_H @@ -99,19 +100,12 @@ SOFTWARE. #else #define DEFAULT_AUTOREPEAT FALSE #endif -#ifdef hpux #define DEFAULT_AUTOREPEATS {\ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -#else -#define DEFAULT_AUTOREPEATS {\ - 0, 0, 0, 0, 0, 0, 0, 0,\ - 0, 0, 0, 0, 0, 0, 0, 0,\ - 0, 0, 0, 0, 0, 0, 0, 0,\ - 0, 0, 0, 0, 0, 0, 0, 0 } -#endif + #define DEFAULT_LEDS 0x0 /* all off */ #define DEFAULT_LEDS_MASK 0xffffffff /* 32 */ #define DEFAULT_INT_RESOLUTION 1000 diff --git a/include/validate.h b/include/validate.h index 7cff3a63d..2a13962a7 100644 --- a/include/validate.h +++ b/include/validate.h @@ -24,6 +24,7 @@ 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. */ +/* $XFree86: xc/programs/Xserver/include/validate.h,v 1.5 2001/12/14 19:59:56 dawes Exp $ */ #ifndef VALIDATE_H #define VALIDATE_H @@ -31,7 +32,7 @@ in this Software without prior written authorization from The Open Group. #include "miscstruct.h" #include "regionstr.h" -typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap } VTKind; +typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind; /* union _Validate is now device dependent; see mivalidate.h for an example */ typedef union _Validate *ValidatePtr; diff --git a/include/window.h b/include/window.h index 5c17f43be..c46714aab 100644 --- a/include/window.h +++ b/include/window.h @@ -161,6 +161,11 @@ extern void DestroySubwindows( #endif ); +/* Quartz support on Mac OS X uses the HIToolbox + framework whose ChangeWindowAttributes function conflicts here. */ +#ifdef __DARWIN__ +#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes +#endif extern int ChangeWindowAttributes( #if NeedFunctionPrototypes WindowPtr /*pWin*/, @@ -170,7 +175,14 @@ extern int ChangeWindowAttributes( #endif ); +/* Quartz support on Mac OS X uses the HIToolbox + framework whose GetWindowAttributes function conflicts here. */ +#ifdef __DARWIN__ +#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x) +extern void Darwin_X_GetWindowAttributes( +#else extern void GetWindowAttributes( +#endif #if NeedFunctionPrototypes WindowPtr /*pWin*/, ClientPtr /*client*/, diff --git a/include/windowstr.h b/include/windowstr.h index 31de609b8..4dee291d0 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/windowstr.h,v 1.6 2001/12/14 19:59:57 dawes Exp $ */ #ifndef WINDOWSTRUCT_H #define WINDOWSTRUCT_H |