From 8b4bcb68cf8a3921e623a5d7d908db3053272fb6 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 27 Aug 2019 11:40:54 -0700 Subject: libstage: drop stage_lookup_key/stage_lookup_func_t This seemed useful at the time, but it's proven a bit inadequate when adding relative picking in addition to what the stage could provide via the lookup hook. Then once adding relative picking externally, including the spatial stuff the lookup stage hook typically added was conveniently handled as well. So just get rid of this, even though it probably would be perfectly sufficient for purely touch-based interfaces where there's no relative navigation. i.e. tab/arrow key to select the next item. --- src/stage.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'src/stage.c') diff --git a/src/stage.c b/src/stage.c index 69976ae..3927120 100644 --- a/src/stage.c +++ b/src/stage.c @@ -373,34 +373,3 @@ stage_t * stage_lookup_name(stage_t *stage, const char *name) return NULL; } - - -/* lookup a stage by an opaque key using the per-stage lookup_func when present, - * returns first hit, does not support multiple hits. - * Intended for rudimentary non-overlapping spatial searches like picking of - * basic 2D UI elements. - */ -stage_t * stage_lookup_key(stage_t *stage, void *key) -{ - assert(stage); - - if (stage->ops->lookup_func) { - stage_t *hit = (stage_t *)stage->ops->lookup_func(stage, stage->object, key); - - if (hit) - return hit; - } - - for (int i = 0; i < STAGE_LAYERS_MAX; i++) { - stage_t *s; - - DLL_FOR_EACH_ENTRY(&stage->layers[i], s, stage_t, layer) { - stage_t *hit = stage_lookup_key(s, key); - - if (hit) - return hit; - } - } - - return NULL; -} -- cgit v1.2.3