From 8dacf32025d2fc6419e0f639636bdf97abcbc55b Mon Sep 17 00:00:00 2001 From: David Reveman Date: Tue, 27 May 2008 12:41:26 -0400 Subject: [PATCH] Add AnimForEachCursorElt function. --- render/animcur.c | 20 ++++++++++++++++++++ render/picturestr.h | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/render/animcur.c b/render/animcur.c index 5723442fa..335feaa56 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -439,3 +439,23 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp *ppCursor = pCursor; return Success; } + +void +AnimForEachCursorElt (ScreenPtr pScreen, + CursorPtr pCursor, + CursorProcPtr callBack) +{ + if (IsAnimCur (pCursor)) + { + AnimCurPtr ac = GetAnimCur (pCursor); + int i; + + for (i = 0; i < ac->nelt; i++) + (*callBack) (pScreen, ac->elts[i].pCursor); + + } + else + { + (*callBack) (pScreen, pCursor); + } +} diff --git a/render/picturestr.h b/render/picturestr.h index 1ce16be7d..71647e67f 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -673,4 +673,12 @@ void PanoramiXRenderInit (void); void PanoramiXRenderReset (void); #endif +typedef void (*CursorProcPtr) (ScreenPtr pScreen, + CursorPtr pCursor); + +void +AnimForEachCursorElt (ScreenPtr pScreen, + CursorPtr pCursor, + CursorProcPtr callBack); + #endif /* _PICTURESTR_H_ */