summaryrefslogtreecommitdiff
path: root/src/cursor.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-11-23 05:48:34 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2019-11-23 05:48:34 -0500
commit077a496c38fc993d7691ce5aab1e9c2b4aee4b02 (patch)
treea426a7cb6deae949b6d6931ca6c0bd371a9ad9ac /src/cursor.c
parent2e0923ba703d040160bac1deb05d5d6d4cbd62aa (diff)
Formatted most of the C files using "twm-indent", part of cindent at
https://invisible-island.net/cindent/ That is essentially a script which adds typedefs to the x-indent.sh script. No object-code changed in this reformatting. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/cursor.c')
-rw-r--r--src/cursor.c53
1 files changed, 28 insertions, 25 deletions
diff --git a/src/cursor.c b/src/cursor.c
index 9a0cb28..98a1256 100644
--- a/src/cursor.c
+++ b/src/cursor.c
@@ -37,6 +37,7 @@ in this Software without prior written authorization from The Open Group.
#include "screen.h"
#include "util.h"
+/* *INDENT-OFF* */
static struct _CursorName {
const char *name;
unsigned int shape;
@@ -121,25 +122,26 @@ static struct _CursorName {
{"watch", XC_watch, None},
{"xterm", XC_xterm, None},
};
+/* *INDENT-ON* */
void
-NewFontCursor (Cursor *cp, const char *str)
+NewFontCursor(Cursor *cp, const char *str)
{
int i;
- for (i = 0; (size_t)i < sizeof(cursor_names)/sizeof(struct _CursorName); i++)
- {
- if (strcmp(str, cursor_names[i].name) == 0)
- {
- if (cursor_names[i].cursor == None)
- cursor_names[i].cursor = XCreateFontCursor(dpy,
- cursor_names[i].shape);
- *cp = cursor_names[i].cursor;
- return;
- }
+ for (i = 0; (size_t) i < sizeof(cursor_names) / sizeof(struct _CursorName);
+ i++) {
+ if (strcmp(str, cursor_names[i].name) == 0) {
+ if (cursor_names[i].cursor == None)
+ cursor_names[i].cursor = XCreateFontCursor(dpy,
+ cursor_names[i].
+ shape);
+ *cp = cursor_names[i].cursor;
+ return;
+ }
}
- fprintf (stderr, "%s: unable to find font cursor \"%s\"\n",
- ProgramName, str);
+ fprintf(stderr, "%s: unable to find font cursor \"%s\"\n",
+ ProgramName, str);
}
void
@@ -151,22 +153,23 @@ NewBitmapCursor(Cursor *cp, char *source, char *mask)
Pixmap spm, mpm;
spm = GetBitmap(source);
- if ((hotx = HotX) < 0) hotx = 0;
- if ((hoty = HotY) < 0) hoty = 0;
+ if ((hotx = HotX) < 0)
+ hotx = 0;
+ if ((hoty = HotY) < 0)
+ hoty = 0;
mpm = GetBitmap(mask);
/* make sure they are the same size */
- XGetGeometry(dpy, spm, &JunkRoot, &sx, &sy, &sw, &sh, &JunkBW,&JunkDepth);
- XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW,&JunkDepth);
- if (sw != mw || sh != mh)
- {
- fprintf (stderr,
- "%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n",
- ProgramName, source, mask);
- return;
+ XGetGeometry(dpy, spm, &JunkRoot, &sx, &sy, &sw, &sh, &JunkBW, &JunkDepth);
+ XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW, &JunkDepth);
+ if (sw != mw || sh != mh) {
+ fprintf(stderr,
+ "%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n",
+ ProgramName, source, mask);
+ return;
}
*cp = XCreatePixmapCursor(dpy, spm, mpm, &Scr->PointerForeground,
- &Scr->PointerBackground,
- (unsigned)hotx, (unsigned)hoty);
+ &Scr->PointerBackground,
+ (unsigned) hotx, (unsigned) hoty);
}