diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-03-19 09:58:42 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-03-19 14:58:06 +0100 |
| commit | 157264f914725f0041b08a50099834d4670dd8ce (patch) | |
| tree | 04344dddf4feff296a52dc4f8cb32aaa6e4db950 /vis.h | |
| parent | 3aa603c0e72a35bb2fb5d6b31f5a3d509f8178bd (diff) | |
| download | vis-157264f914725f0041b08a50099834d4670dd8ce.tar.gz vis-157264f914725f0041b08a50099834d4670dd8ce.tar.xz | |
vis: add infrastructure to dynamically add :set options
Diffstat (limited to 'vis.h')
| -rw-r--r-- | vis.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -482,6 +482,21 @@ typedef bool (CmdFunc)(Vis*, Win*, void *data, bool force, * unique prefix of the given name is executed */ bool vis_cmd_register(Vis*, const char *name, const char *help, void *data, CmdFunc*); bool vis_cmd_unregister(Vis*, const char *name); + +enum VisOption { + VIS_OPTION_TYPE_BOOL = 1 << 0, + VIS_OPTION_TYPE_STRING = 1 << 1, + VIS_OPTION_TYPE_NUMBER = 1 << 2, + VIS_OPTION_VALUE_OPTIONAL = 1 << 3, + VIS_OPTION_NEED_WINDOW = 1 << 4, +}; + +typedef bool (VisOptionFunction)(Vis*, Win*, void *context, bool toggle, + enum VisOption, const char *name, Arg *value); +bool vis_option_register(Vis*, const char *names[], enum VisOption, + VisOptionFunction*, void *context, const char *help); +bool vis_option_unregister(Vis*, const char *name); + /* execute any kind (:,?,/) of prompt command */ bool vis_prompt_cmd(Vis*, const char *cmd); |
