Home -> PlatformBindings -> X11Constants

Declaration

struct X11Constants final;

Description

The X11Constants structure stores scoped copies of selected X11 macro values and type-like macros. These wrapped constants are always available when the Xlib platform binding headers are included.

Availability: Linux or compatible X11 platforms when COBALT_RENDERER_XLIB_SUPPORT is enabled.

By default, the Xlib wrapper header strips the original X11 preprocessor macros after copying their values to X11Constants. Define COBALT_RENDERER_STRIP_X11_PREPROCESSOR_MACROS to 0 before including the platform binding headers to leave the original X11 macros visible. The preprocessor macros are stripped by default due to their high likelihood of collisions with unrelated tokens in code.

Use the wrapped constants, such as X11Constants::kNone, X11Constants::kSuccess, and X11Constants::kInputOutput, instead of the raw X11 macro names in C++ code.

ImportantImportant

This helper exists to prevent common X11 macros such as None, Always, True, and False from leaking into the rest of the renderer interface headers.

See also