40 #include <nuttx/config.h> 104 #ifdef CONFIG_NX_XYINPUT 117 #ifdef CONFIG_NXWIDGET_EVENTWAIT 149 #ifdef CONFIG_NXWIDGET_EVENTWAIT 186 #ifdef CONFIG_NXWIDGET_EVENTWAIT 199 #ifdef CONFIG_NXWIDGET_EVENTWAIT 256 return mouseEvent || keyboardEvent || cursorControlEvent;
268 for (
int i = 0; i <
m_widgets.size(); i++)
311 #ifdef CONFIG_NXWIDGET_EVENTWAIT 373 FAR
const struct nxgl_size_s *size,
374 FAR
const struct nxgl_point_s *pos,
375 FAR
const struct nxgl_rect_s *bounds)
451 #ifdef CONFIG_NX_XYINPUT 463 if ((buttons & NX_MOUSE_LEFTBUTTON) != 0)
505 #if 0 // Center and right buttons not used 506 if ((buttons & NX_MOUSE_CENTERBUTTON) != 0)
538 if ((buttons & NX_MOUSE_RIGHTBUTTON) != 0)
577 #ifdef CONFIG_NXWIDGET_EVENTWAIT 600 i < nCh &&
m_nCh < CONFIG_NXWIDGETS_KBDBUFFER_SIZE;
603 *pBuffer++ = *pStr++;
612 #ifdef CONFIG_NXWIDGET_EVENTWAIT 628 if (
m_nCc < CONFIG_NXWIDGETS_CURSORCONTROL_SIZE)
636 #ifdef CONFIG_NXWIDGET_EVENTWAIT 658 #ifdef CONFIG_NX_WRITEONLY 695 struct timespec endTime;
697 (void)clock_gettime(CLOCK_REALTIME, &endTime);
698 if (startTime->tv_sec <= endTime.tv_sec)
702 uint32_t seconds = endTime.tv_sec - startTime->tv_sec;
706 int32_t endNanoSeconds = endTime.tv_nsec;
707 if (startTime->tv_nsec > endNanoSeconds)
721 endNanoSeconds += 1000000000;
723 uint32_t nanoseconds = endNanoSeconds - startTime->tv_nsec;
727 return seconds * 1000000 + nanoseconds / 1000;
752 for (
int i =
m_widgets.size() - 1; i > -1; i--)
764 (void)widget->
click(x, y);
794 #ifdef CONFIG_NX_XYINPUT 795 bool mouseEvent =
true;
853 bool keyboardEvent =
false;
862 for (uint8_t i = 0; i <
m_nCh; i++)
865 keyboardEvent =
true;
872 return keyboardEvent;
883 bool cursorControlEvent =
false;
892 for (uint8_t i = 0; i <
m_nCc; i++)
895 cursorControlEvent =
true;
902 return cursorControlEvent;
919 while (ret < 0 && errno == EINTR);
936 while (ret < 0 && errno == EINTR);
943 #ifdef CONFIG_NX_XYINPUT 952 #if 0 // Center and right buttons are not used void raiseGeometryEvent(void)
nxgl_mxpixel_t selectedBackground
bool createGraphicsPort(INxWindow *window)
nxgl_mxpixel_t enabledText
CWidgetControl(FAR const CWidgetStyle *style=(const CWidgetStyle *) NULL)
void raiseRedrawEvent(void)
bool pollKeyboardEvents(void)
TNxArray< CNxWidget * > m_deleteQueue
nxgl_mxpixel_t disabledText
CNxWidget * m_clickedWidget
void addToDeleteQueue(CNxWidget *widget)
bool cursorControl(ECursorControl control)
struct timespec leftReleaseTime
void copyWidgetStyle(CWidgetStyle *dest, const CWidgetStyle *src)
void waitForWindowEvent(void)
void setFocusedWidget(CNxWidget *widget)
nxgl_mxpixel_t shadowEdge
const int getWidgetIndex(const CNxWidget *widget) const
uint32_t elapsedTime(FAR const struct timespec *startTime)
bool drag(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY)
void redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more)
struct nxgl_rect_s m_bounds
void raiseMouseEvent(void)
void setNxRect(FAR const struct nxgl_rect_s *rect)
virtual bool click(nxgl_coord_t x, nxgl_coord_t y)
uint8_t m_kbdbuf[CONFIG_NXWIDGETS_KBDBUFFER_SIZE]
struct nxgl_point_s m_pos
bool pollEvents(CNxWidget *widget=(CNxWidget *) NULL)
bool pollCursorControlEvents(void)
void processDeleteQueue(void)
void handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget *widget)
void newCursorControlEvent(ECursorControl cursorControl)
virtual ~CWidgetControl(void)
void raiseKeyboardEvent(void)
void postWindowEvent(void)
struct timespec leftPressTime
nxgl_mxpixel_t background
void geometryEvent(NXHANDLE hWindow, const struct nxgl_size_s *size, const struct nxgl_point_s *pos, const struct nxgl_rect_s *bounds)
CWindowEventHandlerList m_eventHandlers
bool keyPress(nxwidget_char_t key)
struct SXYInput m_xyinput
CWidgetStyle * g_defaultWidgetStyle
TNxArray< CNxWidget * > m_widgets
void newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr)
void setClickedWidget(CNxWidget *widget)
CNxWidget * m_focusedWidget
uint8_t m_controls[CONFIG_NXWIDGETS_CURSORCONTROL_SIZE]
nxgl_coord_t getX(void) const
struct nxgl_size_s m_size
bool release(nxgl_coord_t x, nxgl_coord_t y)
nxgl_mxpixel_t selectedText
void clearMouseEvents(void)
bool pollMouseEvents(CNxWidget *widget)
void newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t buttons)
void removeControlledWidget(CNxWidget *widget)