registry

package
v0.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package registry lists the models, layouts, variants and options a ruleset offers, from xkeyboard-config's XML files, the way libxkbregistry does. It lives apart from package xkb so that compositors and clients do not link an XML parser for a configuration interface's needs.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoIncludes = errors.New("registry: no valid include path")

ErrNoIncludes reports a context none of whose default include paths exists.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context reads rulesets. Parse fills it once.

func NewContext

func NewContext(getenv func(string) string, flags Flags) (*Context, error)

NewContext makes a context. RXKB_LOG_LEVEL sets its log level.

func (*Context) AppendDefaultIncludePaths

func (c *Context) AppendDefaultIncludePaths() bool

AppendDefaultIncludePaths adds the default search path, false once parsed or when none of it exists.

func (*Context) AppendIncludePath

func (c *Context) AppendIncludePath(path string) bool

AppendIncludePath adds a directory to the search path, false once parsed or when it is not a readable directory.

func (*Context) Layouts

func (c *Context) Layouts() []Layout

Layouts is every layout and variant, in the order first read.

func (*Context) LogLevel

func (c *Context) LogLevel() xkb.LogLevel

LogLevel is the least severe level logged.

func (*Context) Models

func (c *Context) Models() []Model

Models is every model, in the order first read.

func (*Context) OptionGroups

func (c *Context) OptionGroups() []OptionGroup

OptionGroups is every option group, in the order first read.

func (*Context) Parse

func (c *Context) Parse(ruleset string) error

Parse reads a ruleset's files from every include path, earlier paths winning, and may be called once.

func (*Context) ParseDefaultRuleset

func (c *Context) ParseDefaultRuleset() error

ParseDefaultRuleset is Parse of the evdev ruleset.

func (*Context) SetLogFunc

func (c *Context) SetLogFunc(fn xkb.LogFunc)

SetLogFunc routes log messages to fn; nil restores the default, stderr.

func (*Context) SetLogLevel

func (c *Context) SetLogLevel(level xkb.LogLevel)

SetLogLevel sets the least severe level logged.

func (*Context) SetUserData

func (c *Context) SetUserData(v any)

SetUserData keeps a value on the context.

func (*Context) UserData

func (c *Context) UserData() any

UserData is the value SetUserData kept.

type Flags

type Flags uint8

Flags adjusts NewContext.

const (
	// NoDefaultIncludes starts with an empty include path.
	NoDefaultIncludes Flags = 1 << iota
	// LoadExoticRules also reads the ruleset's .extras.xml files.
	LoadExoticRules
	// NoSecureGetenv reads the environment even when the process runs setuid
	// or setgid.
	NoSecureGetenv
)

type Layout

type Layout struct {
	Name, Variant, Brief, Description string
	Popularity                        Popularity
	ISO639, ISO3166                   []string
}

Layout is a layout, or a variant of one when Variant is set.

type Model

type Model struct {
	Name, Description, Vendor string
	Popularity                Popularity
}

Model is a keyboard model.

type Option

type Option struct {
	Name, Brief, Description string
	Popularity               Popularity
	LayoutSpecific           bool
}

Option is one XKB option.

type OptionGroup

type OptionGroup struct {
	Name, Description string
	Popularity        Popularity
	AllowsMultiple    bool
	Options           []Option
	// contains filtered or unexported fields
}

OptionGroup is a group of related options.

type Popularity

type Popularity uint8

Popularity is how common an entry is.

const (
	// Standard is an entry of the ruleset's main file.
	Standard Popularity = iota + 1
	// Exotic is an entry of the ruleset's extras file, or one marked exotic.
	Exotic
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL