marco 1.29.1
Window manager
Loading...
Searching...
No Matches
MetaEnumPreference Struct Reference

The details of one preference which is constrained to be one of a small number of string values– in other words, an enumeration. More...

Data Fields

gchar * key
 
gchar * schema
 
MetaPreference pref
 
gint * target
 

Detailed Description

The details of one preference which is constrained to be one of a small number of string values– in other words, an enumeration.

We could have done this other ways. One particularly attractive possibility would have been to represent the entire symbol table as a space-separated string literal in the list of symtabs, so the focus mode enums could have been represented simply by "click sloppy mouse". However, the simplicity gained would have been outweighed by the bugs caused when the ordering of the enum strings got out of sync with the actual enum statement. Also, there is existing library code to use this kind of symbol tables.

Other things we might consider doing to clean this up in the future include:

  • most of the keys begin with the same prefix, and perhaps we could assume it if they don't start with a slash
  • there are several cases where a single identifier could be used to generate an entire entry, and perhaps this could be done with a macro. (This would reduce clarity, however, and is probably a bad thing.)
  • these types all begin with a gchar* (and contain a MetaPreference) and we can factor out the repeated code in the handlers by taking advantage of this using some kind of union arrangement.

Field Documentation

◆ key

gchar* MetaEnumPreference::key

◆ pref

MetaPreference MetaEnumPreference::pref

◆ schema

gchar* MetaEnumPreference::schema

◆ target

gint* MetaEnumPreference::target

The documentation for this struct was generated from the following file: