From fe90fbdbd18eed8712bbc30909efb1b7870f859f Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 1 May 2012 22:31:26 +0000 Subject: NxWM update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4683 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx | 33 ++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx') diff --git a/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx b/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx index 9fedd4618..0a894eae8 100644 --- a/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx +++ b/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx @@ -193,6 +193,9 @@ namespace NXWidgets struct nxgl_size_s m_size; /**< Size of the window */ struct nxgl_point_s m_pos; /**< Position in display space */ struct nxgl_rect_s m_bounds; /**< Size of the display */ +#ifdef CONFIG_NX_MULTIUSER + sem_t m_geosem; /**< Posted when geometry is valid */ +#endif /** * Style @@ -279,6 +282,27 @@ namespace NXWidgets void wakeupModalLoop(void); + /** + * Take the geometry semaphore (handling signal interruptions) + */ + +#ifdef CONFIG_NX_MULTIUSER + void takeGeoSem(void); +#else + inline void takeGeoSem(void) {} +#endif + + /** + * Give the geometry semaphore + */ + + inline void giveGeoSem(void) + { +#ifdef CONFIG_NX_MULTIUSER + sem_post(&m_geosem); +#endif + } + /** * Clear all mouse events */ @@ -553,7 +577,10 @@ namespace NXWidgets inline CRect getWindowBoundingBox(void) { - return CRect(&m_bounds); + takeGeoSem(); + CRect rect(&m_bounds); + giveGeoSem(); + return rect; } /** @@ -564,8 +591,10 @@ namespace NXWidgets inline bool getWindowPosition(FAR struct nxgl_point_s *pPos) { + takeGeoSem(); pPos->x = m_pos.x; pPos->x = m_pos.y; + giveGeoSem(); return true; } @@ -577,8 +606,10 @@ namespace NXWidgets inline bool getWindowSize(FAR struct nxgl_size_s *pSize) { + takeGeoSem(); pSize->h = m_size.h; pSize->w = m_size.w; + giveGeoSem(); return true; } -- cgit v1.2.3