mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
graphics/nxmu, include/nuttx/nx/nxmu.h, libs/libnx: Add new server->client callback to notify the window client of server events. Remove the old 'blocked' callback and just make it one case of an 'event' callback.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* libs/libnx/nxtk/nxtk_events.c
|
||||
*
|
||||
* Copyright (C) 2008-2009, 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2012, 2017, 2019 Gregory Nutt. All rights
|
||||
* reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -68,7 +69,8 @@ static void nxtk_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
|
||||
static void nxtk_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch,
|
||||
FAR void *arg);
|
||||
#endif
|
||||
static void nxtk_blocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2);
|
||||
static void nxtk_event(NXWINDOW hwnd, enum nx_event_e event,
|
||||
FAR void *arg1, FAR void *arg2);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
@@ -84,7 +86,7 @@ const struct nx_callback_s g_nxtkcb =
|
||||
#ifdef CONFIG_NX_KBD
|
||||
, nxtk_kbdin /* kbdin */
|
||||
#endif
|
||||
, nxtk_blocked /* blocked */
|
||||
, nxtk_event /* event */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -290,18 +292,19 @@ static void nxtk_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch,
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxtk_blocked
|
||||
* Name: nxtk_event
|
||||
****************************************************************************/
|
||||
|
||||
static void nxtk_blocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2)
|
||||
static void nxtk_event(NXWINDOW hwnd, enum nx_event_e event,
|
||||
FAR void *arg1, FAR void *arg2)
|
||||
{
|
||||
FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hwnd;
|
||||
|
||||
/* Only the client window gets keyboard input */
|
||||
/* Forward the event to the window client */
|
||||
|
||||
if (fwnd->fwcb->blocked)
|
||||
if (fwnd->fwcb->event != NULL)
|
||||
{
|
||||
fwnd->fwcb->blocked((NXTKWINDOW)fwnd, fwnd->fwarg, arg2);
|
||||
fwnd->fwcb->event((NXTKWINDOW)fwnd, event, fwnd->fwarg, arg2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user