From 4afd2594d4fe1bbe5e96ea83e5f77b102849221f Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 29 Nov 2008 20:26:18 +0000 Subject: Using wrong(invalid) callback structure git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1357 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/graphics/nxmu/nx_eventhandler.c | 60 ++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 26 deletions(-) (limited to 'nuttx/graphics/nxmu/nx_eventhandler.c') diff --git a/nuttx/graphics/nxmu/nx_eventhandler.c b/nuttx/graphics/nxmu/nx_eventhandler.c index 136ff9b5f..a9ef438f0 100644 --- a/nuttx/graphics/nxmu/nx_eventhandler.c +++ b/nuttx/graphics/nxmu/nx_eventhandler.c @@ -187,45 +187,53 @@ int nx_eventhandler(NXHANDLE handle) return ERROR; case NX_CLIMSG_REDRAW: - if (conn->cb->redraw) - { - FAR struct nxclimsg_redraw_s *redraw = (FAR struct nxclimsg_redraw_s *)buffer; - wnd = redraw->wnd; - DEBUGASSERT(wnd); - wnd->cb->redraw((NXWINDOW)wnd, &redraw->rect, redraw->more); - } + { + FAR struct nxclimsg_redraw_s *redraw = (FAR struct nxclimsg_redraw_s *)buffer; + wnd = redraw->wnd; + DEBUGASSERT(wnd); + if (wnd->cb->redraw) + { + wnd->cb->redraw((NXWINDOW)wnd, &redraw->rect, redraw->more); + } + } break; case NX_CLIMSG_NEWPOSITION: - if (conn->cb->position) - { - FAR struct nxclimsg_newposition_s *postn = (FAR struct nxclimsg_newposition_s *)buffer; - wnd = postn->wnd; - DEBUGASSERT(wnd); - wnd->cb->position((NXWINDOW)wnd, &postn->size, &postn->pos, &postn->bounds); - } + { + FAR struct nxclimsg_newposition_s *postn = (FAR struct nxclimsg_newposition_s *)buffer; + wnd = postn->wnd; + DEBUGASSERT(wnd); + if (wnd->cb->position) + { + wnd->cb->position((NXWINDOW)wnd, &postn->size, &postn->pos, &postn->bounds); + } + } break; #ifdef CONFIG_NX_KBD case NX_CLIMSG_MOUSEIN: - if (conn->cb->mousein) - { - FAR struct nxclimsg_mousein_s *mouse = (FAR struct nxclimsg_mousein_s *)buffer; - wnd = mouse->wnd; - DEBUGASSERT(wnd); - wnd->cb->mousein((NXWINDOW)wnd, &mouse->pos, mouse->buttons); + { + FAR struct nxclimsg_mousein_s *mouse = (FAR struct nxclimsg_mousein_s *)buffer; + wnd = mouse->wnd; + DEBUGASSERT(wnd); + if (wnd->cb->mousein) + { + wnd->cb->mousein((NXWINDOW)wnd, &mouse->pos, mouse->buttons); + } } break; #endif #ifdef CONFIG_NX_KBD case NX_CLIMSG_KBDIN: - if (conn->cb->kbdin) - { - FAR struct nxclimsg_kbdin_s *kbd = (FAR struct nxclimsg_kbdin_s *)buffer; - wnd = kbd->wnd; - DEBUGASSERT(wnd); - wnd->cb->kbdin((NXWINDOW)wnd, kbd->nch, kbd->ch); + { + FAR struct nxclimsg_kbdin_s *kbd = (FAR struct nxclimsg_kbdin_s *)buffer; + wnd = kbd->wnd; + DEBUGASSERT(wnd); + if (wnd->cb->kbdin) + { + wnd->cb->kbdin((NXWINDOW)wnd, kbd->nch, kbd->ch); + } } break; #endif -- cgit v1.2.3