diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-08-20 12:18:27 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-08-20 12:18:27 +1000 |
commit | ecaf8b83f8227724e9f862a0a8f64e6004a63d56 (patch) | |
tree | ed84213400a1f7e338e5bb79eb5fec11152e24d1 /src/gwin/gwidget.c | |
parent | 3b21507274aa4f98644382903ae529c1fc2c7bd4 (diff) | |
download | uGFX-ecaf8b83f8227724e9f862a0a8f64e6004a63d56.tar.gz uGFX-ecaf8b83f8227724e9f862a0a8f64e6004a63d56.tar.bz2 uGFX-ecaf8b83f8227724e9f862a0a8f64e6004a63d56.zip |
Create a generic GWIN event.
The frame now sends a GEVENT_GWIN_CLOSE event on closing.
Unfortunately some gwin events have had a field renamed in order to generalise the structure.
Demo's updated to match.
Diffstat (limited to 'src/gwin/gwidget.c')
-rw-r--r-- | src/gwin/gwidget.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gwin/gwidget.c b/src/gwin/gwidget.c index c9fff50e..e773dc6c 100644 --- a/src/gwin/gwidget.c +++ b/src/gwin/gwidget.c @@ -302,6 +302,24 @@ void _gwidgetRedraw(GHandle gh) { gw->fnDraw(gw, gw->fnParam); } +void _gwinSendEvent(GHandle gh, GEventType type) { + GSourceListener * psl; + GEventGWin * pge; + + // Trigger a GWIN Event + psl = 0; + while ((psl = geventGetSourceListener(GWIDGET_SOURCE, psl))) { + if (!(pge = (GEventGWin *)geventGetEventBuffer(psl))) + continue; + pge->type = type; + pge->gwin = gh; + #if GWIN_WIDGET_TAGS + pge->tag = (gh->flags & GWIN_FLG_WIDGET) ? ((GWidgetObject *)gh)->tag : 0; + #endif + geventSendEvent(psl); + } +} + void gwinWidgetClearInit(GWidgetInit *pwi) { char *p; unsigned len; |