whitespace mods

This commit is contained in:
Adam D. Ruppe 2017-04-15 08:38:38 -04:00
parent 9dd559b284
commit d7c19998c5
1 changed files with 473 additions and 490 deletions

View File

@ -878,7 +878,7 @@ version(Windows) {
/*
From MSDN:
You can also use the GET_X_LPARAM or GET_Y_LPARAM macro to extract the x- or y-coordinate.
You can also use the GET_X_LPARAM or GET_Y_LPARAM macro to extract the x- or y-coordinate.
Important Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.
@ -3638,8 +3638,8 @@ struct KeyEvent {
SimpleWindow window; /// associated Window
// convert key event to simplified string representation a-la emacs
const(char)[] toStrBuf(bool growdest=false) (char[] dest) const nothrow @trusted {
// convert key event to simplified string representation a-la emacs
const(char)[] toStrBuf(bool growdest=false) (char[] dest) const nothrow @trusted {
uint dpos = 0;
void put (const(char)[] s...) nothrow @trusted {
static if (growdest) {
@ -3666,12 +3666,12 @@ const(char)[] toStrBuf(bool growdest=false) (char[] dest) const nothrow @trusted
put("Unknown");
return dest[0..dpos];
}
}
string toStr() () { return cast(string)toStrBuf!true(null); } // it is safe to cast here
string toStr() () { return cast(string)toStrBuf!true(null); } // it is safe to cast here
// sorry for pasta, but i don't want to create new struct in `opEquals()`
static KeyEvent parse (const(char)[] name) nothrow @trusted @nogc {
// sorry for pasta, but i don't want to create new struct in `opEquals()`
static KeyEvent parse (const(char)[] name) nothrow @trusted @nogc {
KeyEvent res;
while (name.length && name.ptr[0] <= ' ') name = name[1..$];
while (name.length && name[$-1] <= ' ') name = name[0..$-1];
@ -3717,9 +3717,9 @@ static KeyEvent parse (const(char)[] name) nothrow @trusted @nogc {
}
}
return res; // at least modifier state, lol
}
}
bool opEquals() (const(char)[] name) const nothrow @trusted @nogc {
bool opEquals() (const(char)[] name) const nothrow @trusted @nogc {
while (name.length && name.ptr[0] <= ' ') name = name[1..$];
while (name.length && name[$-1] <= ' ') name = name[0..$-1];
if (!this.key) return (name.length == 0);
@ -3765,7 +3765,7 @@ bool opEquals() (const(char)[] name) const nothrow @trusted @nogc {
}
}
return false;
}
}
}
/// Type of a [MouseEvent]
@ -8545,27 +8545,21 @@ KeySym XKeycodeToKeysym(
);
int XConvertSelection(Display *display, Atom selection, Atom target,
Atom property, Window requestor, Time time);
int XConvertSelection(Display *display, Atom selection, Atom target, Atom property, Window requestor, Time time);
int XFree(void*);
int XDeleteProperty(Display *display, Window w, Atom property);
int XDeleteProperty(Display *display, Window w, Atom property);
int XChangeProperty(Display *display, Window w, Atom property, Atom
type, int format, int mode, in void *data, int nelements);
int XChangeProperty(Display *display, Window w, Atom property, Atom type, int format, int mode, in void *data, int nelements);
int XGetWindowProperty(Display *display, Window w, Atom property, arch_long
int XGetWindowProperty(Display *display, Window w, Atom property, arch_long
long_offset, arch_long long_length, Bool del, Atom req_type, Atom
*actual_type_return, int *actual_format_return, arch_ulong
*nitems_return, arch_ulong *bytes_after_return, void** prop_return);
int XSetSelectionOwner(Display *display, Atom selection, Window owner,
Time time);
Window XGetSelectionOwner(Display *display, Atom selection);
int XSetSelectionOwner(Display *display, Atom selection, Window owner, Time time);
Window XGetSelectionOwner(Display *display, Atom selection);
@ -8893,16 +8887,12 @@ struct XFontStruct {
uint direction; /* Direction the font is painted */
uint min_char_or_byte2; /* First character */
uint max_char_or_byte2; /* Last character */
uint min_byte1; /* First row that exists (for two-byte
* fonts) */
uint max_byte1; /* Last row that exists (for two-byte
* fonts) */
Bool all_chars_exist; /* Flag if all characters have nonzero
* size */
uint min_byte1; /* First row that exists (for two-byte fonts) */
uint max_byte1; /* Last row that exists (for two-byte fonts) */
Bool all_chars_exist; /* Flag if all characters have nonzero size */
uint default_char; /* Char to print for undefined character */
int n_properties; /* How many properties there are */
XFontProp *properties; /* Pointer to array of additional
* properties*/
XFontProp *properties; /* Pointer to array of additional properties*/
XCharStruct min_bounds; /* Minimum bounds over all existing char*/
XCharStruct max_bounds; /* Maximum bounds over all existing char*/
XCharStruct *per_char; /* first_char to last_char information */
@ -9039,7 +9029,7 @@ int XMoveResizeWindow(Display*, Window, int, int, uint, uint);
int XMoveWindow(Display*, Window, int, int);
int XResizeWindow(Display *display, Window w, uint width, uint height);
Colormap XCreateColormap(Display *display, Window w, Visual *visual, int alloc);
Colormap XCreateColormap(Display *display, Window w, Visual *visual, int alloc);
enum CWBackPixmap = (1L<<0);
enum CWBackPixel = (1L<<1);
@ -9180,8 +9170,7 @@ int XDestroyWindow(
Window /* w */
);
int XDestroyImage(
XImage*);
int XDestroyImage(XImage*);
int XSelectInput(
Display* /* display */,
@ -9240,19 +9229,13 @@ Status XGetWMNormalHints(Display *display, Window w, XSizeHints *hints, c_long*
/* Size hints mask bits */
enum USPosition = (1L << 0) /* user specified x, y */;
enum USSize = (1L << 1) /* user specified width, height
*/;
enum PPosition = (1L << 2) /* program specified position
*/;
enum USSize = (1L << 1) /* user specified width, height */;
enum PPosition = (1L << 2) /* program specified position */;
enum PSize = (1L << 3) /* program specified size */;
enum PMinSize = (1L << 4) /* program specified minimum
size */;
enum PMaxSize = (1L << 5) /* program specified maximum
size */;
enum PResizeInc = (1L << 6) /* program specified resize
increments */;
enum PAspect = (1L << 7) /* program specified min and
max aspect ratios */;
enum PMinSize = (1L << 4) /* program specified minimum size */;
enum PMaxSize = (1L << 5) /* program specified maximum size */;
enum PResizeInc = (1L << 6) /* program specified resize increments */;
enum PAspect = (1L << 7) /* program specified min and max aspect ratios */;
enum PBaseSize = (1L << 8);
enum PWinGravity = (1L << 9);
enum PAllHints = (PPosition|PSize| PMinSize|PMaxSize| PResizeInc|PAspect);