summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2019-08-27 11:40:54 -0700
committerVito Caputo <vcaputo@pengaru.com>2019-08-27 11:40:54 -0700
commit8b4bcb68cf8a3921e623a5d7d908db3053272fb6 (patch)
tree35e59616ed3d3434048965ff67a84d24dd6f9ca0
parent71c5db7476d8deadfa785570ae63732445b10e85 (diff)
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.
-rw-r--r--src/stage.c31
-rw-r--r--src/stage.h3
2 files changed, 0 insertions, 34 deletions
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;
-}
diff --git a/src/stage.h b/src/stage.h
index a73a5d9..20a03d8 100644
--- a/src/stage.h
+++ b/src/stage.h
@@ -25,13 +25,11 @@ typedef struct stage_t stage_t;
typedef void (stage_prepare_func_t)(stage_t *stage, void *object, float alpha, void *render_ctxt);
typedef void (stage_render_func_t)(const stage_t *stage, void *object, float alpha, void *render_ctxt);
typedef void (stage_free_func_t)(const stage_t *stage, void *object);
-typedef stage_t * (stage_lookup_func_t)(const stage_t *stage, void *object, void *key);
typedef struct stage_ops_t {
stage_prepare_func_t *prepare_func; /* pre-render object */
stage_render_func_t *render_func; /* render object */
stage_free_func_t *free_func; /* free object */
- stage_lookup_func_t *lookup_func; /* lookup object against key */
} stage_ops_t;
typedef struct stage_conf_t {
@@ -60,6 +58,5 @@ void stage_set_locked(stage_t *stage, int locked);
int stage_get_locked(const stage_t *stage);
void stage_set_layer(stage_t *stage, int layer);
stage_t * stage_lookup_name(stage_t *stage, const char *name);
-stage_t * stage_lookup_key(stage_t *stage, void *key);
#endif
© All Rights Reserved