libxkbcommon 0.6.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Enumerations | Functions
Library Context

## Enumerations
enum | xkb_context_flags { XKB_CONTEXT_NO_FLAGS = 0, XKB_CONTEXT_NO_DEFAULT_INCLUDES = (1 << 0), XKB_CONTEXT_NO_ENVIRONMENT_NAMES = (1 << 1) }

## Functions
struct xkb_context * | xkb_context::xkb_context_new (enum xkb_context_flags flags)
struct xkb_context * | xkb_context::xkb_context_ref (struct xkb_context *context)
void | xkb_context::xkb_context_unref (struct xkb_context *context)
void | xkb_context::xkb_context_set_user_data (struct xkb_context *context, void *user_data)
void * | xkb_context::xkb_context_get_user_data (struct xkb_context *context)

## Detailed Description

Creating, destroying and using library contexts.

Every keymap compilation request must have a context associated with it. The context keeps around state such as the include path.

### Environment Variables

The user may set some environment variables which affect the library:

- `XKB_CONFIG_ROOT`, `HOME` - see Include Paths.
- `XKB_LOG_LEVEL` - see xkb_context_set_log_level().
- `XKB_LOG_VERBOSITY` - see xkb_context_set_log_verbosity().
- `XKB_DEFAULT_RULES`, `XKB_DEFAULT_MODEL`, `XKB_DEFAULT_LAYOUT`, `XKB_DEFAULT_VARIANT`, `XKB_DEFAULT_OPTIONS` - see xkb_rule_names.

## Enumeration Type Documentation

enum xkb_context_flags

Flags for context creation.

Enumerator
XKB_CONTEXT_NO_FLAGS | Do not apply any context flags.
XKB_CONTEXT_NO_DEFAULT_INCLUDES | Create this context with an empty include path.
XKB_CONTEXT_NO_ENVIRONMENT_NAMES | Don't take RMLVO names from the environment. Since 0.3.0

## Function Documentation

struct xkb_context * xkb_context_new | ( | enum xkb_context_flags | flags | ) |

Create a new context.

Parameters

  flags | Optional flags for the context, or 0.

Returns
  A new context, or NULL on failure.

struct xkb_context * xkb_context_ref | ( | struct xkb_context * | context | ) |

Take a new reference on a context.

Returns
  The passed in context.

void xkb_context_unref | ( | struct xkb_context * | context | ) |

Release a reference on a context, and possibly free it.

Parameters

  context | The context. If it is NULL, this function does nothing.

void xkb_context_set_user_data | ( | struct xkb_context * | context,
|  | void * | user_data
| ) |  |

Store custom user data in the context.

This may be useful in conjunction with xkb_context_set_log_fn() or other callbacks.

void * xkb_context_get_user_data | ( | struct xkb_context * | context | ) |

Retrieves stored user data from the context.

Returns
  The stored user data. If the user data wasn't set, or the passed in context is NULL, returns NULL.

This may be useful to access private user data from callbacks like a custom logging function.