NXWidgets: NxWM::CWindowMessenger Class Reference

NXWidgets 1.19

Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
NxWM::CWindowMessenger Class Reference

`#include <cwindowmessenger.hxx>`

Inheritance diagram for NxWM::CWindowMessenger:

## Classes
struct | work_state_t

## Public Member Functions
| CWindowMessenger (FAR const NXWidgets::CWidgetStyle *style=(const NXWidgets::CWidgetStyle *) NULL)
| ~CWindowMessenger (void)
Public Member Functions inherited from NXWidgets::CWindowEventHandler
| CWindowEventHandler ()
virtual | ~CWindowEventHandler ()
virtual void | handleRedrawEvent (void)
virtual void | handleGeometryEvent (void)
Public Member Functions inherited from NXWidgets::CWidgetControl
| CWidgetControl (FAR const CWidgetStyle *style=(const CWidgetStyle *) NULL)
virtual | ~CWidgetControl (void)
void | waitForWindowEvent (void)
const bool | isWaiting (void) const
bool | pollEvents (CNxWidget *widget=(CNxWidget *) NULL)
bool | swapWidgetDepth (CNxWidget *widget)
void | addControlledWidget (CNxWidget *widget)
void | removeControlledWidget (CNxWidget *widget)
const int | getControlledWidgetCount (void) const
void | addToDeleteQueue (CNxWidget *widget)
void | setClickedWidget (CNxWidget *widget)
CNxWidget * | getClickedWidget (void)
void | setFocusedWidget (CNxWidget *widget)
void | clearFocusedWidget (CNxWidget *widget)
CNxWidget * | getFocusedWidget (void)
bool | doubleClick (void)
void | getWidgetStyle (CWidgetStyle *style)
void | setWidgetStyle (const CWidgetStyle *style)
void | geometryEvent (NXHANDLE hWindow, const struct nxgl_size_s *size, const struct nxgl_point_s *pos, const struct nxgl_rect_s *bounds)
void | redrawEvent (FAR const struct nxgl_rect_s *nxRect, bool more)
void | newMouseEvent (FAR const struct nxgl_point_s *pos, uint8_t buttons)
void | newKeyboardEvent (uint8_t nCh, FAR const uint8_t *pStr)
void | windowBlocked (FAR void *arg)
void | newCursorControlEvent (ECursorControl cursorControl)
NXHANDLE | getWindowHandle (void)
CRect | getWindowBoundingBox (void)
void | getWindowBoundingBox (FAR struct nxgl_rect_s *bounds)
bool | getWindowPosition (FAR struct nxgl_point_s *pos)
bool | getWindowSize (FAR struct nxgl_size_s *size)
nxgl_coord_t | getWindowWidth (void)
nxgl_coord_t | getWindowHeight (void)
bool | createGraphicsPort (INxWindow *window)
CGraphicsPort * | getGraphicsPort (void)
void | addWindowEventHandler (CWindowEventHandler *eventHandler)
void | removeWindowEventHandler (CWindowEventHandler *eventHandler)

## Private Member Functions
void | handleMouseEvent (void)
void | handleKeyboardEvent (void)
void | handleBlockedEvent (FAR void *arg)

## Static Private Member Functions
static void | inputWorkCallback (FAR void *arg)
static void | destroyWorkCallback (FAR void *arg)

## Additional Inherited Members
Protected Member Functions inherited from NXWidgets::CWidgetControl
void | copyWidgetStyle (CWidgetStyle *dest, const CWidgetStyle *src)
uint32_t | elapsedTime (FAR const struct timespec *startTime)
void | handleLeftClick (nxgl_coord_t x, nxgl_coord_t y, CNxWidget *widget)
const int | getWidgetIndex (const CNxWidget *widget) const
void | processDeleteQueue (void)
bool | pollMouseEvents (CNxWidget *widget)
bool | pollKeyboardEvents (void)
bool | pollCursorControlEvents (void)
void | postWindowEvent (void)
void | takeGeoSem (void)
void | giveGeoSem (void)
void | waitGeoData (void)
void | takeBoundsSem (void)
void | giveBoundsSem (void)
void | waitBoundsData (void)
void | clearMouseEvents (void)
Protected Attributes inherited from NXWidgets::CWidgetControl
CGraphicsPort * | m_port
TNxArray< CNxWidget * > | m_deleteQueue
TNxArray< CNxWidget * > | m_widgets
bool | m_haveGeometry
bool | m_waiting
sem_t | m_waitSem
struct SXYInput | m_xyinput
CNxWidget * | m_clickedWidget
CNxWidget * | m_focusedWidget
uint8_t | m_kbdbuf [CONFIG_NXWIDGETS_KBDBUFFER_SIZE]
uint8_t | m_nCh
uint8_t | m_controls [CONFIG_NXWIDGETS_CURSORCONTROL_SIZE]
uint8_t | m_nCc
NXHANDLE | m_hWindow
struct nxgl_size_s | m_size
struct nxgl_point_s | m_pos
struct nxgl_rect_s | m_bounds
sem_t | m_geoSem
sem_t | m_boundsSem
CWindowEventHandlerList | m_eventHandlers
CWidgetStyle | m_style

## Detailed Description

The class CWindowMessenger integrates the widget control with some special handling of mouse and keyboard inputs needs by NxWM. It use used in place of CWidgetControl whenever an NxWM window is created.

CWindowMessenger cohabitates with CWidgetControl only because it needs the CWidgetControl as an argument in its messaging.

Definition at line 82 of file cwindowmessenger.hxx.

## Constructor & Destructor Documentation

## ◆ CWindowMessenger()

CWindowMessenger::CWindowMessenger | ( | FAR const NXWidgets::CWidgetStyle * | style = `(const NXWidgets::CWidgetStyle *)NULL` | ) |

CWindowMessenger Constructor

Parameters

  style | The default style that all widgets on this display should use. If this is not specified, the widget will use the values stored in the defaultCWidgetStyle object.

Definition at line 69 of file cwindowmessenger.cxx.

## ◆ ~CWindowMessenger()

CWindowMessenger::~CWindowMessenger | ( | void |  | ) |

CWindowMessenger Destructor.

Definition at line 81 of file cwindowmessenger.cxx.

## Member Function Documentation

## ◆ destroyWorkCallback()

void CWindowMessenger::destroyWorkCallback | ( | FAR void * | arg | ) |
| staticprivate

Definition at line 189 of file cwindowmessenger.cxx.

## ◆ handleBlockedEvent()

void CWindowMessenger::handleBlockedEvent | ( | FAR void * | arg | ) |
| privatevirtual

Handle a NX window blocked event

Parameters

  arg | - User provided argument (see nx_block or nxtk_block)

Handle a NX window blocked event. This handler is called when we receive the BLOCKED message meaning that there are no further pending actions on the window. It is now safe to delete the window.

This is handled by sending a message to the start window thread (vs just calling the destructors) because in the case where an application destroys itself (because of pressing the stop button), then we need to unwind and get out of the application logic before destroying all of its objects.

Parameters

  arg | - User provided argument (see nx_block or nxtk_block)

Reimplemented from NXWidgets::CWindowEventHandler.

Definition at line 165 of file cwindowmessenger.cxx.

## ◆ handleKeyboardEvent()

void CWindowMessenger::handleKeyboardEvent | ( | void |  | ) |
| privatevirtual

Handle a NX window keyboard input event.

Reimplemented from NXWidgets::CWindowEventHandler.

Definition at line 138 of file cwindowmessenger.cxx.

## ◆ handleMouseEvent()

void CWindowMessenger::handleMouseEvent | ( | void |  | ) |
| privatevirtual

Handle an NX window mouse input event.

Parameters

  e | The event data.

Reimplemented from NXWidgets::CWindowEventHandler.

Definition at line 95 of file cwindowmessenger.cxx.

## ◆ inputWorkCallback()

void CWindowMessenger::inputWorkCallback | ( | FAR void * | arg | ) |
| staticprivate

Work queue callback functions

Definition at line 182 of file cwindowmessenger.cxx.

The documentation for this class was generated from the following files:

- cwindowmessenger.hxx
- cwindowmessenger.cxx