From 5a94934487ea477947e24dcd4720b7cde77d3d2f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Mar 2011 14:53:26 +1000 Subject: panoramiX: consolidate common id assignment code. This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first element and is a common idiom throughout panoramiX code. It then adds a new inline function to hide id assignment to a panoramiX resource and cleans up lots of common repeated code. Signed-off-by: Dave Airlie Reviewed-by: Daniel Stone Reviewed-by: Alan Coopersmith --- Xext/panoramiXsrv.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Xext/panoramiXsrv.h') diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h index b0a5a6e1f..5dd02e859 100644 --- a/Xext/panoramiXsrv.h +++ b/Xext/panoramiXsrv.h @@ -51,4 +51,15 @@ extern _X_EXPORT void XineramaGetImageData( Bool isRoot ); +static inline void panoramix_setup_ids(PanoramiXRes *resource, + ClientPtr client, XID base_id) +{ + int j; + + resource->info[0].id = base_id; + FOR_NSCREENS_FORWARD_SKIP(j) { + resource->info[j].id = FakeClientID(client->index); + } +} + #endif /* _PANORAMIXSRV_H_ */ -- cgit v1.2.3