aboutsummaryrefslogtreecommitdiff
path: root/sherlock_nk.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-02-18 23:15:32 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-02-18 23:15:32 +0100
commit345db0ecf42ec9866a562572b8a9222e85a6c4ed (patch)
treef308314326249ecedfe5d6ef7646fd074033a276 /sherlock_nk.c
parent8535e19736aa91f274fd5bec14d3988d67a03897 (diff)
downloadsherlock.lv2-345db0ecf42ec9866a562572b8a9222e85a6c4ed.tar.xz
nk: prototype ttl lexer.
Diffstat (limited to 'sherlock_nk.c')
-rw-r--r--sherlock_nk.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sherlock_nk.c b/sherlock_nk.c
index d82c357..8684f7c 100644
--- a/sherlock_nk.c
+++ b/sherlock_nk.c
@@ -24,6 +24,8 @@
#include <sherlock.h>
#include <osc.lv2/util.h>
+#include <encoder.h>
+
#define NK_PUGL_IMPLEMENTATION
#include <sherlock_nk.h>
@@ -222,7 +224,8 @@ void
_clear(plughandle_t *handle)
{
_clear_items(handle);
- nk_str_clear(&handle->str);
+ struct nk_str *str = &handle->editor.string;
+ nk_str_clear(str);
handle->selected = NULL;
handle->counter = 1;
}
@@ -341,7 +344,9 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
_clear(handle);
_discover(handle);
- nk_str_init_default(&handle->str);
+ nk_textedit_init_default(&handle->editor);
+ handle->editor.lexer.lex = ttl_lex;
+ handle->editor.lexer.data = NULL;
handle->sratom = sratom_new(handle->map);
sratom_set_pretty_numbers(handle->sratom, false);
@@ -358,7 +363,10 @@ cleanup(LV2UI_Handle instance)
sratom_free(handle->sratom);
_clear_items(handle);
- nk_str_free(&handle->str);
+ nk_textedit_free(&handle->editor);
+
+ if(handle->editor.lexer.tokens)
+ free(handle->editor.lexer.tokens);
nk_pugl_hide(&handle->win);
nk_pugl_shutdown(&handle->win);