From 0874ae23a16946781dd517cfdb011c691ad0b581 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 5 May 2010 09:43:03 +0000 Subject: svn merge -r571:HEAD "^/branches/released" . --- xorg-server/include/Makefile.am | 1 + xorg-server/include/callback.h | 87 ++++++++++++++++++++++++++++++++++++++++ xorg-server/include/dix.h | 31 +------------- xorg-server/include/dixstruct.h | 4 -- xorg-server/include/inputstr.h | 3 +- xorg-server/include/misc.h | 6 +++ xorg-server/include/privates.h | 64 +++++++++++++++++++++++++---- xorg-server/include/ptrveloc.h | 5 ++- xorg-server/include/resource.h | 6 --- xorg-server/include/scrnintstr.h | 2 - 10 files changed, 158 insertions(+), 51 deletions(-) create mode 100644 xorg-server/include/callback.h (limited to 'xorg-server/include') diff --git a/xorg-server/include/Makefile.am b/xorg-server/include/Makefile.am index eddc86cb3..e76de05c3 100644 --- a/xorg-server/include/Makefile.am +++ b/xorg-server/include/Makefile.am @@ -3,6 +3,7 @@ sdk_HEADERS = \ XIstubs.h \ bstore.h \ bstorestr.h \ + callback.h \ closestr.h \ closure.h \ colormap.h \ diff --git a/xorg-server/include/callback.h b/xorg-server/include/callback.h new file mode 100644 index 000000000..632ed4f32 --- /dev/null +++ b/xorg-server/include/callback.h @@ -0,0 +1,87 @@ +/*********************************************************** + +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 CALLBACK_H +#define CALLBACK_H + +#include /* for GContext, Mask */ +#include /* for Bool */ +#include +#include + +/* + * callback manager stuff + */ + +#ifndef _XTYPEDEF_CALLBACKLISTPTR +typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */ +#define _XTYPEDEF_CALLBACKLISTPTR +#endif + +typedef void (*CallbackProcPtr) ( + CallbackListPtr *, pointer, pointer); + +extern _X_EXPORT Bool AddCallback( + CallbackListPtr * /*pcbl*/, + CallbackProcPtr /*callback*/, + pointer /*data*/); + +extern _X_EXPORT Bool DeleteCallback( + CallbackListPtr * /*pcbl*/, + CallbackProcPtr /*callback*/, + pointer /*data*/); + +extern _X_EXPORT void CallCallbacks( + CallbackListPtr * /*pcbl*/, + pointer /*call_data*/); + +extern _X_EXPORT void DeleteCallbackList( + CallbackListPtr * /*pcbl*/); + +extern _X_EXPORT void InitCallbackManager(void); + +#endif /* CALLBACK_H */ diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h index 6505fd02f..dc86257fb 100644 --- a/xorg-server/include/dix.h +++ b/xorg-server/include/dix.h @@ -48,6 +48,7 @@ SOFTWARE. #ifndef DIX_H #define DIX_H +#include "callback.h" #include "gc.h" #include "window.h" #include "input.h" @@ -512,36 +513,6 @@ ScreenRestructured (ScreenPtr pScreen); extern _X_EXPORT int ffs(int i); -/* - * callback manager stuff - */ - -#ifndef _XTYPEDEF_CALLBACKLISTPTR -typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */ -#define _XTYPEDEF_CALLBACKLISTPTR -#endif - -typedef void (*CallbackProcPtr) ( - CallbackListPtr *, pointer, pointer); - -extern _X_EXPORT Bool AddCallback( - CallbackListPtr * /*pcbl*/, - CallbackProcPtr /*callback*/, - pointer /*data*/); - -extern _X_EXPORT Bool DeleteCallback( - CallbackListPtr * /*pcbl*/, - CallbackProcPtr /*callback*/, - pointer /*data*/); - -extern _X_EXPORT void CallCallbacks( - CallbackListPtr * /*pcbl*/, - pointer /*call_data*/); - -extern _X_EXPORT void DeleteCallbackList( - CallbackListPtr * /*pcbl*/); - -extern _X_EXPORT void InitCallbackManager(void); /* * ServerGrabCallback stuff diff --git a/xorg-server/include/dixstruct.h b/xorg-server/include/dixstruct.h index acfbe46ca..9cd965445 100644 --- a/xorg-server/include/dixstruct.h +++ b/xorg-server/include/dixstruct.h @@ -85,7 +85,6 @@ typedef struct _Window *SaveSetElt; #define SaveSetAssignMap(ss,m) #endif -/* The unused_ members are ABI spacing. Please reuse them. */ typedef struct _Client { int index; Mask clientAsMask; @@ -101,7 +100,6 @@ typedef struct _Client { * killed */ SaveSetElt *saveSet; int numSaved; - void *unused_screenPrivate[16]; int (**requestVector) ( ClientPtr /* pClient */); CARD32 req_len; /* length of current request */ @@ -116,8 +114,6 @@ typedef struct _Client { KeyCode minKC,maxKC; unsigned long replyBytesRemaining; - void *unused_appgroup; - void *unused_fontResFunc; int smart_priority; long smart_start_tick; long smart_stop_tick; diff --git a/xorg-server/include/inputstr.h b/xorg-server/include/inputstr.h index de4026cb7..6da3f38e4 100644 --- a/xorg-server/include/inputstr.h +++ b/xorg-server/include/inputstr.h @@ -514,8 +514,9 @@ typedef struct _DeviceIntRec { LedFeedbackPtr leds; struct _XkbInterest *xkb_interest; char *config_info; /* used by the hotplug layer */ + ClassesPtr unused_classes; /* for master devices */ + int saved_master_id; /* for slaves while grabbed */ PrivateRec *devPrivates; - int nPrivates; DeviceUnwrapProc unwrapProc; SpriteInfoPtr spriteInfo; union { diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h index 1cdb38fc4..ed8e9d0a0 100644 --- a/xorg-server/include/misc.h +++ b/xorg-server/include/misc.h @@ -100,6 +100,12 @@ typedef unsigned long ATOM; #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 diff --git a/xorg-server/include/privates.h b/xorg-server/include/privates.h index 3c5c32175..e6f788de1 100644 --- a/xorg-server/include/privates.h +++ b/xorg-server/include/privates.h @@ -24,32 +24,71 @@ struct _Private; typedef struct _Private PrivateRec; /* - * Request pre-allocated private space for your driver/module. - * Calling this is not necessary if only a pointer by itself is needed. + * 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 a new private and attaches it to an existing object. + * 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. + * 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); /* - * Set a private pointer. + * 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); @@ -63,22 +102,33 @@ typedef struct _PrivateCallback { 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); /* - * Frees private data. + * 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 subsystem, called from the main loop. + * 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); diff --git a/xorg-server/include/ptrveloc.h b/xorg-server/include/ptrveloc.h index 676c46419..6f999a88f 100644 --- a/xorg-server/include/ptrveloc.h +++ b/xorg-server/include/ptrveloc.h @@ -62,6 +62,9 @@ typedef struct _MotionTracker { int dir; /* initial direction bitfield */ } MotionTracker, *MotionTrackerPtr; +/* number of properties for predictable acceleration */ +#define NPROPS_PREDICTABLE_ACCEL 4 + /** * Contains all data needed to implement mouse ballistics */ @@ -88,9 +91,9 @@ typedef struct _DeviceVelocityRec { struct { /* to be able to query this information */ int profile_number; } statistics; + long prop_handlers[NPROPS_PREDICTABLE_ACCEL]; } DeviceVelocityRec, *DeviceVelocityPtr; - extern _X_EXPORT void InitVelocityData(DeviceVelocityPtr vel); diff --git a/xorg-server/include/resource.h b/xorg-server/include/resource.h index 7948af50e..56450d67a 100644 --- a/xorg-server/include/resource.h +++ b/xorg-server/include/resource.h @@ -251,12 +251,6 @@ extern _X_EXPORT RESTYPE TypeMask; * Please use the noted replacements instead. */ -#ifdef __GNUC__ -#define X_DEPRECATED __attribute__((deprecated)) -#else -#define X_DEPRECATED -#endif - /* replaced by dixLookupResourceByType */ extern _X_EXPORT pointer SecurityLookupIDByType( ClientPtr client, diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h index faf4343fe..d07d3f98d 100644 --- a/xorg-server/include/scrnintstr.h +++ b/xorg-server/include/scrnintstr.h @@ -619,10 +619,8 @@ typedef struct _ScreenInfo { int numPixmapFormats; PixmapFormatRec formats[MAXFORMATS]; - int arraySize; int numScreens; ScreenPtr screens[MAXSCREENS]; - int unused; } ScreenInfo; extern _X_EXPORT ScreenInfo screenInfo; -- cgit v1.2.3