diff options
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | atom_inspector_nk.c | 8 | ||||
-rw-r--r-- | encoder.h | 10 | ||||
-rw-r--r-- | encoder.l | 34 | ||||
-rw-r--r-- | midi_inspector_nk.c | 1 | ||||
-rw-r--r-- | osc_inspector_nk.c | 1 | ||||
-rw-r--r-- | sherlock_nk.c | 16 | ||||
-rw-r--r-- | sherlock_nk.h | 11 |
9 files changed, 51 insertions, 35 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0bd9523..9b79cef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,9 @@ stages: .build_template: &build_definition <<: *common_definition + before_script: + - apt-get update + - apt-get install -y -q flex script: - mkdir build - pushd build @@ -1 +1 @@ -0.11.2823 +0.11.2825 diff --git a/atom_inspector_nk.c b/atom_inspector_nk.c index 1551df5..4631a6b 100644 --- a/atom_inspector_nk.c +++ b/atom_inspector_nk.c @@ -20,7 +20,6 @@ #include <sherlock.h> #include <sherlock_nk.h> - #include <encoder.h> #define NS_RDF (const uint8_t*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#" @@ -224,7 +223,7 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat nk_list_view_end(&lview); } - nk_layout_row_dynamic(ctx, widget_h, 3); + nk_layout_row_dynamic(ctx, widget_h, 4); { if(nk_checkbox_label(ctx, "overwrite", &handle->state.overwrite)) _toggle(handle, handle->urid.overwrite, handle->state.overwrite, true); @@ -232,6 +231,11 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat _toggle(handle, handle->urid.block, handle->state.block, true); if(nk_checkbox_label(ctx, "follow", &handle->state.follow)) _toggle(handle, handle->urid.follow, handle->state.follow, true); + if(nk_checkbox_label(ctx, "pretty", &handle->pretty_numbers)) + { + handle->ttl_dirty = true; + sratom_set_pretty_numbers(handle->sratom, handle->pretty_numbers); + } } const bool max_reached = handle->n_item >= MAX_LINES; @@ -20,6 +20,16 @@ #include "nk_pugl/nk_pugl.h" +extern const struct nk_color white; +extern const struct nk_color gray; +extern const struct nk_color yellow; +extern const struct nk_color magenta; +extern const struct nk_color green; +extern const struct nk_color blue; +extern const struct nk_color orange; +extern const struct nk_color violet; +extern const struct nk_color red; + struct nk_token * ttl_lex(void *data, const char *utf8, int len); @@ -21,11 +21,26 @@ #include <encoder.h> +#define ful 0xff +#define one 0xbb +#define two 0x66 +#define non 0x0 +const struct nk_color white = {.r = one, .g = one, .b = one, .a = ful}; +const struct nk_color gray = {.r = two, .g = two, .b = two, .a = ful}; +const struct nk_color yellow = {.r = one, .g = one, .b = non, .a = ful}; +const struct nk_color magenta = {.r = one, .g = two, .b = one, .a = ful}; +const struct nk_color green = {.r = non, .g = one, .b = non, .a = ful}; +const struct nk_color blue = {.r = non, .g = one, .b = one, .a = ful}; +const struct nk_color orange = {.r = one, .g = two, .b = non, .a = ful}; +const struct nk_color violet = {.r = two, .g = two, .b = one, .a = ful}; +const struct nk_color red = {.r = one, .g = non, .b = non, .a = ful}; + enum { TK_NONE, TK_PREFIX, TK_SUBJECT, TK_PREDICATE, + TK_BOOL, TK_NUMBER, TK_URI_IN, TK_URI_OUT, @@ -64,6 +79,8 @@ eol [\n\r] {name}: return TK_SUBJECT; "@prefix" return TK_PREFIX; "a" return TK_PREFIX; +true return TK_BOOL; +false return TK_BOOL; {name} return TK_PREDICATE; {number} return TK_NUMBER; . return TK_RAW; @@ -127,21 +144,24 @@ ttl_lex(void *data, const char *utf8, int len) switch(tok) { case TK_PREFIX: - col1 = (struct nk_color){0xff, 0x00, 0x00, 0xff}; + col1 = blue; break; case TK_SUBJECT: - col1 = (struct nk_color){0x00, 0xff, 0x00, 0xff}; + col1 = magenta; break; case TK_PREDICATE: - col1 = (struct nk_color){0x00, 0x00, 0xff, 0xff}; + col1 = orange; + break; + case TK_BOOL: + col1 = violet; break; case TK_NUMBER: - col1 = (struct nk_color){0xff, 0xff, 0x00, 0xff}; + col1 = green; break; case TK_URI_IN: case TK_URI_OUT: case TK_URI_ERR: - col1 = (struct nk_color){0xff, 0x00, 0xff, 0xff}; + col1 = yellow; break; case TK_STRING_IN: @@ -149,12 +169,12 @@ ttl_lex(void *data, const char *utf8, int len) case TK_STRING_ERR: case TK_LONG_STRING_IN: case TK_LONG_STRING_OUT: - col1 = (struct nk_color){0x00, 0xff, 0xff, 0xff}; + col1 = red; break; case TK_NONE: case TK_WHITESPACE: - col1 = (struct nk_color){0xff, 0xff, 0xff, 0xff}; + col1 = white; break; case TK_RAW: diff --git a/midi_inspector_nk.c b/midi_inspector_nk.c index 2ac4d4f..9ea5bb6 100644 --- a/midi_inspector_nk.c +++ b/midi_inspector_nk.c @@ -19,6 +19,7 @@ #include <sherlock.h> #include <sherlock_nk.h> +#include <encoder.h> typedef struct _midi_msg_t midi_msg_t; diff --git a/osc_inspector_nk.c b/osc_inspector_nk.c index d4f6004..8a35736 100644 --- a/osc_inspector_nk.c +++ b/osc_inspector_nk.c @@ -21,6 +21,7 @@ #include <sherlock.h> #include <sherlock_nk.h> +#include <encoder.h> #include <osc.lv2/util.h> diff --git a/sherlock_nk.c b/sherlock_nk.c index 8684f7c..c272689 100644 --- a/sherlock_nk.c +++ b/sherlock_nk.c @@ -29,20 +29,6 @@ #define NK_PUGL_IMPLEMENTATION #include <sherlock_nk.h> -#define ful 0xff -#define one 0xbb -#define two 0x66 -#define non 0x0 -const struct nk_color white = {.r = one, .g = one, .b = one, .a = ful}; -const struct nk_color gray = {.r = two, .g = two, .b = two, .a = ful}; -const struct nk_color yellow = {.r = one, .g = one, .b = non, .a = ful}; -const struct nk_color magenta = {.r = one, .g = two, .b = one, .a = ful}; -const struct nk_color green = {.r = non, .g = one, .b = non, .a = ful}; -const struct nk_color blue = {.r = non, .g = one, .b = one, .a = ful}; -const struct nk_color orange = {.r = one, .g = two, .b = non, .a = ful}; -const struct nk_color violet = {.r = two, .g = two, .b = one, .a = ful}; -const struct nk_color red = {.r = one, .g = non, .b = non, .a = ful}; - const char *max_items [5] = { "1k", "2k", "4k", "8k", "16k" }; @@ -349,7 +335,7 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri, handle->editor.lexer.data = NULL; handle->sratom = sratom_new(handle->map); - sratom_set_pretty_numbers(handle->sratom, false); + sratom_set_pretty_numbers(handle->sratom, handle->pretty_numbers); handle->base_uri = "file:///tmp/base"; return handle; diff --git a/sherlock_nk.h b/sherlock_nk.h index a81bbad..4d16417 100644 --- a/sherlock_nk.h +++ b/sherlock_nk.h @@ -97,6 +97,7 @@ struct _plughandle_t { Sratom *sratom; const char *base_uri; + int pretty_numbers; float dy; @@ -111,16 +112,6 @@ struct _plughandle_t { extern const char *max_items [5]; extern const int32_t max_values [5]; -extern const struct nk_color white; -extern const struct nk_color gray; -extern const struct nk_color yellow; -extern const struct nk_color magenta; -extern const struct nk_color green; -extern const struct nk_color blue; -extern const struct nk_color orange; -extern const struct nk_color violet; -extern const struct nk_color red; - void _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data); |