summaryrefslogtreecommitdiff
path: root/src/stage.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-05-29 12:39:24 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-05-29 12:39:24 -0700
commitb50c169621c3d6fba5c6ddf08a1acd80601c5c93 (patch)
tree75e2b7fa5d4ec7f5b4646da945bfce340d3cdc12 /src/stage.h
parentfc879e25fd4b45ec3520b4bd0cbfb4bec4ad1590 (diff)
libstage: add stage, rename adopt->replace in stage_conf_t
In preparation for supporting caller-supplied stage memory, add another stage_t pointer to the conf called .stage. The naming of .adopt was always awkward and resulted from the reuse of the .parent pointer to indicate the stage to replace. Now that there's a .stage member, just rename .adopt to .replace, with the same semantics. At some point I need to firm up what .replace does with the other conf data. Currently, only the name, ops, and object, are updated. The existing active/locked/alpha etc are retained unchanged, ignored from the conf. This can be surprising/unexpected to someone performing a replace through the .conf, and it would probably be convenient to be able to set everything during a replace. So there should probably be a convenience helper for constructing a conf from an existing stage, which can then be overridden selectively while passing to a new().
Diffstat (limited to 'src/stage.h')
-rw-r--r--src/stage.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stage.h b/src/stage.h
index 785ddf5..40f2057 100644
--- a/src/stage.h
+++ b/src/stage.h
@@ -33,14 +33,14 @@ typedef struct stage_ops_t {
} stage_ops_t;
typedef struct stage_conf_t {
- stage_t *parent;
+ stage_t *parent, *stage;
int layer;
const char *name;
float alpha;
unsigned active:1;
unsigned locked:1;
unsigned dirty:1;
- unsigned adopt:1;
+ unsigned replace:1;
} stage_conf_t;
stage_t * stage_new(const stage_conf_t *conf, const stage_ops_t *ops, void *object);
© All Rights Reserved