summaryrefslogtreecommitdiff
path: root/composite/compoverlay.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-03-21 12:55:09 -0700
committerKeith Packard <keithp@keithp.com>2012-03-21 13:54:42 -0700
commit9838b7032ea9792bec21af424c53c07078636d21 (patch)
treeb72d0827dac50f0f3b8eab29b3b7639546d735d7 /composite/compoverlay.c
parent75199129c603fc8567185ac31866c9518193cb78 (diff)
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'composite/compoverlay.c')
-rw-r--r--composite/compoverlay.c93
1 files changed, 45 insertions, 48 deletions
diff --git a/composite/compoverlay.c b/composite/compoverlay.c
index 047f069ff..d3cfaf06f 100644
--- a/composite/compoverlay.c
+++ b/composite/compoverlay.c
@@ -56,54 +56,53 @@
* Delete the given overlay client list element from its screen list.
*/
void
-compFreeOverlayClient (CompOverlayClientPtr pOcToDel)
+compFreeOverlayClient(CompOverlayClientPtr pOcToDel)
{
- ScreenPtr pScreen = pOcToDel->pScreen;
- CompScreenPtr cs = GetCompScreen (pScreen);
- CompOverlayClientPtr *pPrev, pOc;
-
- for (pPrev = &cs->pOverlayClients; (pOc = *pPrev); pPrev = &pOc->pNext)
- {
- if (pOc == pOcToDel) {
- *pPrev = pOc->pNext;
- free(pOc);
- break;
- }
+ ScreenPtr pScreen = pOcToDel->pScreen;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ CompOverlayClientPtr *pPrev, pOc;
+
+ for (pPrev = &cs->pOverlayClients; (pOc = *pPrev); pPrev = &pOc->pNext) {
+ if (pOc == pOcToDel) {
+ *pPrev = pOc->pNext;
+ free(pOc);
+ break;
+ }
}
-
+
/* Destroy overlay window when there are no more clients using it */
if (cs->pOverlayClients == NULL)
- compDestroyOverlayWindow (pScreen);
+ compDestroyOverlayWindow(pScreen);
}
/*
* Return the client's first overlay client rec from the given screen
*/
CompOverlayClientPtr
-compFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
+compFindOverlayClient(ScreenPtr pScreen, ClientPtr pClient)
{
- CompScreenPtr cs = GetCompScreen(pScreen);
- CompOverlayClientPtr pOc;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ CompOverlayClientPtr pOc;
for (pOc = cs->pOverlayClients; pOc != NULL; pOc = pOc->pNext)
- if (pOc->pClient == pClient)
- return pOc;
+ if (pOc->pClient == pClient)
+ return pOc;
- return NULL;
+ return NULL;
}
/*
* Create an overlay client object for the given client
*/
CompOverlayClientPtr
-compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
+compCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient)
{
- CompScreenPtr cs = GetCompScreen(pScreen);
+ CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc;
pOc = (CompOverlayClientPtr) malloc(sizeof(CompOverlayClientRec));
if (pOc == NULL)
- return NULL;
+ return NULL;
pOc->pClient = pClient;
pOc->pScreen = pScreen;
@@ -115,8 +114,8 @@ compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
* Create a resource for this element so it can be deleted
* when the client goes away.
*/
- if (!AddResource (pOc->resource, CompositeClientOverlayType, (pointer) pOc))
- return NULL;
+ if (!AddResource(pOc->resource, CompositeClientOverlayType, (pointer) pOc))
+ return NULL;
return pOc;
}
@@ -125,34 +124,33 @@ compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
* Create the overlay window and map it
*/
Bool
-compCreateOverlayWindow (ScreenPtr pScreen)
+compCreateOverlayWindow(ScreenPtr pScreen)
{
- CompScreenPtr cs = GetCompScreen(pScreen);
- WindowPtr pRoot = pScreen->root;
- WindowPtr pWin;
- XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */
- int result;
- int w = pScreen->width;
- int h = pScreen->height;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ WindowPtr pRoot = pScreen->root;
+ WindowPtr pWin;
+ XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */
+ int result;
+ int w = pScreen->width;
+ int h = pScreen->height;
#ifdef PANORAMIX
- if (!noPanoramiXExtension)
- {
- w = PanoramiXPixWidth;
- h = PanoramiXPixHeight;
+ if (!noPanoramiXExtension) {
+ w = PanoramiXPixWidth;
+ h = PanoramiXPixHeight;
}
#endif
- pWin = cs->pOverlayWin =
- CreateWindow (cs->overlayWid, pRoot, 0, 0, w, h, 0,
- InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
- pRoot->drawable.depth,
- serverClient, pScreen->rootVisual, &result);
+ pWin = cs->pOverlayWin =
+ CreateWindow(cs->overlayWid, pRoot, 0, 0, w, h, 0,
+ InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
+ pRoot->drawable.depth,
+ serverClient, pScreen->rootVisual, &result);
if (pWin == NULL)
- return FALSE;
+ return FALSE;
- if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin))
- return FALSE;
+ if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer) pWin))
+ return FALSE;
MapWindow(pWin, serverClient);
@@ -163,11 +161,10 @@ compCreateOverlayWindow (ScreenPtr pScreen)
* Destroy the overlay window
*/
void
-compDestroyOverlayWindow (ScreenPtr pScreen)
+compDestroyOverlayWindow(ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
cs->pOverlayWin = NullWindow;
- FreeResource (cs->overlayWid, RT_NONE);
+ FreeResource(cs->overlayWid, RT_NONE);
}
-