diff options
author | Joel Bodenmann <joel@unormal.org> | 2014-01-04 04:41:32 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2014-01-04 04:41:32 +0100 |
commit | abe6a47c1f59941faac719770aa654d2c79cacef (patch) | |
tree | bae98fd4e90b4e1467523a26fbd1263dc78b0777 /src | |
parent | 07869da90938e375e71081d30757cc767596b431 (diff) | |
download | uGFX-abe6a47c1f59941faac719770aa654d2c79cacef.tar.gz uGFX-abe6a47c1f59941faac719770aa654d2c79cacef.tar.bz2 uGFX-abe6a47c1f59941faac719770aa654d2c79cacef.zip |
basic implementation of parent/child (no flag handling done yet)
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gwin.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 6b9cb81e..3a4ae5b5 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -167,7 +167,15 @@ color_t gwinGetDefaultBgColor(void) { GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit) { if (!(pgw = _gwindowCreate(g, pgw, pInit, &basegwinVMT, 0))) return 0; + + #if GWIN_NEED_HIERARCHY + pgw->parent = NULL; + pgw->sibling = NULL; + pgw->child = NULL; + #endif + gwinSetVisible(pgw, pInit->show); + return pgw; } @@ -250,6 +258,27 @@ void gwinRedraw(GHandle gh) { } #endif +#if GWIN_NEED_HIERARCHY + void gwinAddChild(GHandle parent, GHandle child, bool_t last) + { + child->parent = parent; + child->sibling = NULL; + child->child = NULL; + + if(!parent) + return; + + if(last && parent->child) { + GHandle s = parent->child; + while(s->sibling) s = s->sibling; + s->sibling = child; + } else { + child->sibling = parent->child; + parent->child = child; + } + } +#endif + void gwinClear(GHandle gh) { /* * Don't render anything when the window is not visible but |