summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets/include/ccallback.hxx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-17 22:16:02 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-17 22:16:02 +0000
commitd53035bc78b3fbbd640a6a7535b9cdf7ca0d9667 (patch)
tree166f99f4788c23b3649826405468b34f475d4726 /NxWidgets/libnxwidgets/include/ccallback.hxx
parentb1bbea743d6eef38eebf9975a3b19bbfb7e71233 (diff)
downloadnuttx-d53035bc78b3fbbd640a6a7535b9cdf7ca0d9667.tar.gz
nuttx-d53035bc78b3fbbd640a6a7535b9cdf7ca0d9667.tar.bz2
nuttx-d53035bc78b3fbbd640a6a7535b9cdf7ca0d9667.zip
Implement an NX interface to block flush message queues in multi-user mode. This is necessary to prevent stale window handles when a window is closed
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4745 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/libnxwidgets/include/ccallback.hxx')
-rw-r--r--NxWidgets/libnxwidgets/include/ccallback.hxx77
1 files changed, 50 insertions, 27 deletions
diff --git a/NxWidgets/libnxwidgets/include/ccallback.hxx b/NxWidgets/libnxwidgets/include/ccallback.hxx
index 0e0d5de8b..ca3313a9b 100644
--- a/NxWidgets/libnxwidgets/include/ccallback.hxx
+++ b/NxWidgets/libnxwidgets/include/ccallback.hxx
@@ -99,16 +99,16 @@ namespace NXWidgets
* either be the context of the owning thread or, in the case of multi-
* user NX, the context of the NX event listener thread.
*
- * @param hWindow Handle to a specific NX window.
- * @param pRect The rectangle that needs to be re-drawn (in window
+ * @param hwnd Handle to a specific NX window.
+ * @param rect The rectangle that needs to be re-drawn (in window
* relative coordinates).
* @param bMore true: More re-draw requests will follow.
- * @param pvArg User provided argument (see nx_openwindow, nx_requestbg,
+ * @param arg User provided argument (see nx_openwindow, nx_requestbg,
* nxtk_openwindow, or nxtk_opentoolbar).
*/
- static void redraw(NXHANDLE hWindow, FAR const struct nxgl_rect_s *pRect,
- bool bMore, FAR void *pvArg);
+ static void redraw(NXHANDLE hwnd, FAR const struct nxgl_rect_s *rect,
+ bool bMore, FAR void *arg);
/**
* Position Callback. The new positional data is handled by
@@ -118,19 +118,19 @@ namespace NXWidgets
* either be the context of the owning thread or, in the case of multi-
* user NX, the context of the NX event listener thread.
*
- * @param hWindow Handle to a specific NX window.
- * @param pSize The size of the window.
- * @param pPos The position of the upper left hand corner of the window on
+ * @param hwnd Handle to a specific NX window.
+ * @param size The size of the window.
+ * @param pos The position of the upper left hand corner of the window on
* the overall display.
- * @param pBounds The bounding rectangle that describes the entire display.
- * @param pvArg User provided argument (see nx_openwindow, nx_requestbg,
+ * @param bounds The bounding rectangle that describes the entire display.
+ * @param arg User provided argument (see nx_openwindow, nx_requestbg,
* nxtk_openwindow, or nxtk_opentoolbar).
*/
- static void position(NXHANDLE hWindow, FAR const struct nxgl_size_s *pSize,
- FAR const struct nxgl_point_s *pPos,
- FAR const struct nxgl_rect_s *pBounds,
- FAR void *pvArg);
+ static void position(NXHANDLE hwnd, FAR const struct nxgl_size_s *size,
+ FAR const struct nxgl_point_s *pos,
+ FAR const struct nxgl_rect_s *bounds,
+ FAR void *arg);
/**
* New mouse data is available for the window. The new mouse
@@ -144,16 +144,17 @@ namespace NXWidgets
* The GUI thread is probably sleeping a semaphore, waiting to be
* awakened by a mouse or keyboard event.
*
- * @param hWindow Handle to a specific NX window.
- * @param pPos The (x,y) position of the mouse.
+ * @param hwnd Handle to a specific NX window.
+ * @param pos The (x,y) position of the mouse.
* @param buttons See NX_MOUSE_* definitions.
- * @param pvArg User provided argument (see nx_openwindow, nx_requestbg,
+ * @param arg User provided argument (see nx_openwindow, nx_requestbg,
* nxtk_openwindow, or nxtk_opentoolbar).
*/
#ifdef CONFIG_NX_MOUSE
- static void newMouseEvent(NXHANDLE hWindow, FAR const struct nxgl_point_s *pPos,
- uint8_t buttons, FAR void *pvArg);
+ static void newMouseEvent(NXHANDLE hwnd,
+ FAR const struct nxgl_point_s *pos,
+ uint8_t buttons, FAR void *arg);
#endif /* CONFIG_NX_MOUSE */
/**
@@ -168,27 +169,49 @@ namespace NXWidgets
* The GUI thread is probably sleeping a semaphore, waiting to be
* awakened by a mouse or keyboard event.
*
- * @param hWindow Handle to a specific NX window.
- * @param nCh The number of characters that are available in pStr[].
- * @param pStr The array of characters.
- * @param pvArg User provided argument (see nx_openwindow, nx_requestbg,
+ * @param hwnd Handle to a specific NX window.
+ * @param nCh The number of characters that are available in str[].
+ * @param str The array of characters.
+ * @param arg User provided argument (see nx_openwindow, nx_requestbg,
* nxtk_openwindow, or nxtk_opentoolbar).
*/
#ifdef CONFIG_NX_KBD
- static void newKeyboardEvent(NXHANDLE hWindow, uint8_t nCh, FAR const uint8_t *pStr,
- FAR void *pvArg);
+ static void newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh,
+ FAR const uint8_t *str, FAR void *arg);
#endif // CONFIG_NX_KBD
+ /**
+ * This callback is the response from nx_block (or nxtk_block). Those
+ * blocking interfaces are used to assure that no further messages are
+ * directed to the window. Receipt of the blocked callback signifies
+ * that (1) there are no further pending callbacks and (2) that the
+ * window is now 'defunct' and will receive no further callbacks.
+ *
+ * This callback supports coordinated destruction of a window in multi-
+ * user mode. In multi-use mode, the client window logic must stay
+ * intact until all of the queued callbacks are processed. Then the
+ * window may be safely closed. Closing the window prior with pending
+ * callbacks can lead to bad behavior when the callback is executed.
+ *
+ * @param hwnd. Window handle of the blocked window
+ * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd,
+ * nxtk_openwindow, or nxtk_opentoolbar)
+ */
+
+#ifdef CONFIG_NX_MULTIUSER
+ static void windowBlocked(NXWINDOW hwnd, FAR void *arg);
+#endif
+
public:
/**
* Constructor.
*
- * @param pWidgetControl Control object associated with this window
+ * @param widgetControl Control object associated with this window
*/
- CCallback(CWidgetControl *pWidgetControl);
+ CCallback(CWidgetControl *widgetControl);
/**
* Destructor.