D-Programming-Deimos/libX11 — pull request #14 by andrea9940 (2013-02-26 13:38:35+00:00)
Title: Fixed scoped enums

In C the constants defined with enum reside in the global scope, but in D every named enum create new scope.
To keep a 1:1 correspondence between C and D headers, I converted each named enum in an anonymous enum and defined a new type with its name.
(btw I found a couple of redefined constants in the same file in different enums...)

Before:
XInternAtom(display, cast(char*) "WM_DELETE_WINDOW", Bool.False);
XSelectInput(display, window, EventMask.ExposureMask | EventMask.KeymapStateMask);

After (same as C):
XInternAtom(display, cast(char*) "WM_DELETE_WINDOW", False);
XSelectInput(display, window, ExposureMask | KeymapStateMask);