summaryrefslogtreecommitdiff
path: root/src/cursor.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-16 21:26:17 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-16 21:26:17 -0700
commite086eb1bf49f2a8c270eaebd5beb595c1dc2973e (patch)
treede1657f6ac030ecd56593c67bfb04fda43258049 /src/cursor.c
parentd79ddc01e4b247ae95af3581b93aef2b93e76888 (diff)
Strip trailing whitespace
Performed with: find * -type f | xargs perl -i -p -e 's{\s+$}{\n}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/cursor.c')
-rw-r--r--src/cursor.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/cursor.c b/src/cursor.c
index 7da62ef..b36339b 100644
--- a/src/cursor.c
+++ b/src/cursor.c
@@ -51,7 +51,7 @@ XcursorCursorsDestroy (XcursorCursors *cursors)
--cursors->ref;
if (cursors->ref > 0)
return;
-
+
for (n = 0; n < cursors->ncursor; n++)
XFreeCursor (cursors->dpy, cursors->cursors[n]);
free (cursors);
@@ -238,17 +238,17 @@ _XcursorHeckbertMedianCut (const XcursorImage *image, XcursorCoreCursor *core)
XcursorPixel leftColor, centerColor, rightColor;
int (*compare) (const void *, const void *);
int x, y;
-
+
/*
* Temp space for converted image and converted colors
*/
temp = malloc (npixels * sizeof (XcursorPixel) * 2);
if (!temp)
return False;
-
+
pixels = temp;
colors = pixels + npixels;
-
+
/*
* Convert to 2-value alpha and build
* array of opaque color values and an
@@ -286,7 +286,7 @@ _XcursorHeckbertMedianCut (const XcursorImage *image, XcursorCoreCursor *core)
*pn++ = p;
}
ncolors = pc - colors;
-
+
/*
* Compute longest dimension and sort
*/
@@ -468,16 +468,16 @@ _XcursorFloydSteinberg (const XcursorImage *image, XcursorCoreCursor *core)
iErrorRight = (iError * 7) >> 4;
iErrorBelowLeft = (iError * 3) >> 4;
iErrorBelow = (iError * 5) >> 4;
- iErrorBelowRight = (iError - iErrorRight -
+ iErrorBelowRight = (iError - iErrorRight -
iErrorBelowLeft - iErrorBelow);
aErrorRight = (aError * 7) >> 4;
aErrorBelowLeft = (aError * 3) >> 4;
aErrorBelow = (aError * 5) >> 4;
- aErrorBelowRight = (aError - aErrorRight -
+ aErrorBelowRight = (aError - aErrorRight -
aErrorBelowLeft - aErrorBelow);
if (x < image->width - 1)
{
- iP[right] += iErrorRight;
+ iP[right] += iErrorRight;
aP[right] += aErrorRight;
}
if (y < image->height - 1)
@@ -500,9 +500,9 @@ _XcursorFloydSteinberg (const XcursorImage *image, XcursorCoreCursor *core)
}
free (iPicture);
core->on_color.red =
- core->on_color.green =
+ core->on_color.green =
core->on_color.blue = (min_inten | min_inten << 8);
- core->off_color.red =
+ core->off_color.red =
core->off_color.green =
core->off_color.blue = (max_inten | max_inten << 8);
return True;
@@ -537,9 +537,9 @@ _XcursorThreshold (const XcursorImage *image, XcursorCoreCursor *core)
}
}
core->on_color.red =
- core->on_color.green =
+ core->on_color.green =
core->on_color.blue = 0;
- core->off_color.red =
+ core->off_color.red =
core->off_color.green =
core->off_color.blue = 0xffff;
return True;
@@ -549,7 +549,7 @@ Cursor
XcursorImageLoadCursor (Display *dpy, const XcursorImage *image)
{
Cursor cursor;
-
+
#if RENDER_MAJOR > 0 || RENDER_MINOR >= 5
if (XcursorSupportsARGB (dpy))
{
@@ -581,13 +581,13 @@ XcursorImageLoadCursor (Display *dpy, const XcursorImage *image)
pixmap = XCreatePixmap (dpy, RootWindow (dpy, screen),
image->width, image->height, 32);
gc = XCreateGC (dpy, pixmap, 0, NULL);
- XPutImage (dpy, pixmap, gc, &ximage,
+ XPutImage (dpy, pixmap, gc, &ximage,
0, 0, 0, 0, image->width, image->height);
XFreeGC (dpy, gc);
format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
picture = XRenderCreatePicture (dpy, pixmap, format, 0, NULL);
XFreePixmap (dpy, pixmap);
- cursor = XRenderCreateCursor (dpy, picture,
+ cursor = XRenderCreateCursor (dpy, picture,
image->xhot, image->yhot);
XRenderFreePicture (dpy, picture);
}
@@ -604,12 +604,12 @@ XcursorImageLoadCursor (Display *dpy, const XcursorImage *image)
core.src_image = XCreateImage (dpy, NULL, 1, ZPixmap,
0, NULL, image->width, image->height,
32, 0);
- core.src_image->data = Xmalloc (image->height *
+ core.src_image->data = Xmalloc (image->height *
core.src_image->bytes_per_line);
core.msk_image = XCreateImage (dpy, NULL, 1, ZPixmap,
0, NULL, image->width, image->height,
32, 0);
- core.msk_image->data = Xmalloc (image->height *
+ core.msk_image->data = Xmalloc (image->height *
core.msk_image->bytes_per_line);
switch (info->dither) {
@@ -642,16 +642,16 @@ XcursorImageLoadCursor (Display *dpy, const XcursorImage *image)
image->width, image->height, 1);
gcv.foreground = 1;
gcv.background = 0;
- gc = XCreateGC (dpy, src_pixmap,
+ gc = XCreateGC (dpy, src_pixmap,
GCForeground|GCBackground,
&gcv);
XPutImage (dpy, src_pixmap, gc, core.src_image,
0, 0, 0, 0, image->width, image->height);
-
+
XPutImage (dpy, msk_pixmap, gc, core.msk_image,
0, 0, 0, 0, image->width, image->height);
XFreeGC (dpy, gc);
-
+
#ifdef DEBUG_IMAGE
_XcursorDumpColor (&core.on_color, "on_color");
_XcursorDumpColor (&core.off_color, "off_color");
@@ -702,7 +702,7 @@ XcursorImagesLoadCursor (Display *dpy, const XcursorImages *images)
XcursorCursors *cursors = XcursorImagesLoadCursors (dpy, images);
XAnimCursor *anim;
int n;
-
+
if (!cursors)
return 0;
anim = malloc (cursors->ncursor * sizeof (XAnimCursor));
@@ -734,7 +734,7 @@ XcursorFilenameLoadCursor (Display *dpy, const char *file)
int size = XcursorGetDefaultSize (dpy);
XcursorImages *images = XcursorFilenameLoadImages (file, size);
Cursor cursor;
-
+
if (!images)
return None;
cursor = XcursorImagesLoadCursor (dpy, images);
@@ -748,7 +748,7 @@ XcursorFilenameLoadCursors (Display *dpy, const char *file)
int size = XcursorGetDefaultSize (dpy);
XcursorImages *images = XcursorFilenameLoadImages (file, size);
XcursorCursors *cursors;
-
+
if (!images)
return NULL;
cursors = XcursorImagesLoadCursors (dpy, images);
@@ -768,7 +768,7 @@ _XcursorCreateGlyphCursor(Display *dpy,
unsigned int mask_char,
XColor _Xconst *foreground,
XColor _Xconst *background)
-{
+{
Cursor cid;
register xCreateGlyphCursorReq *req;
@@ -800,21 +800,21 @@ _XcursorCreateFontCursor (Display *dpy, unsigned int shape)
static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */
static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */
- /*
+ /*
* the cursor font contains the shape glyph followed by the mask
* glyph; so character position 0 contains a shape, 1 the mask for 0,
* 2 a shape, etc. <X11/cursorfont.h> contains hash define names
* for all of these.
*/
- if (dpy->cursor_font == None)
+ if (dpy->cursor_font == None)
{
dpy->cursor_font = XLoadFont (dpy, CURSORFONT);
if (dpy->cursor_font == None)
return None;
}
- return _XcursorCreateGlyphCursor (dpy, dpy->cursor_font, dpy->cursor_font,
+ return _XcursorCreateGlyphCursor (dpy, dpy->cursor_font, dpy->cursor_font,
shape, shape + 1, &foreground, &background);
}