summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets/include
diff options
context:
space:
mode:
Diffstat (limited to 'NxWidgets/libnxwidgets/include')
-rw-r--r--NxWidgets/libnxwidgets/include/cbgwindow.hxx21
-rw-r--r--NxWidgets/libnxwidgets/include/ccallback.hxx32
-rw-r--r--NxWidgets/libnxwidgets/include/cnxtkwindow.hxx21
-rw-r--r--NxWidgets/libnxwidgets/include/cnxtoolbar.hxx21
-rw-r--r--NxWidgets/libnxwidgets/include/cnxwindow.hxx21
-rw-r--r--NxWidgets/libnxwidgets/include/inxwindow.hxx22
-rw-r--r--NxWidgets/libnxwidgets/include/nxconfig.hxx8
7 files changed, 144 insertions, 2 deletions
diff --git a/NxWidgets/libnxwidgets/include/cbgwindow.hxx b/NxWidgets/libnxwidgets/include/cbgwindow.hxx
index 435fdffbf..21b75799d 100644
--- a/NxWidgets/libnxwidgets/include/cbgwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/cbgwindow.hxx
@@ -207,6 +207,27 @@ namespace NXWidgets
bool lower(void);
/**
+ * Each window implementation also inherits from CCallback. CCallback,
+ * by default, forwards NX keyboard input to the various widgets residing
+ * in the window. But NxConsole is a different usage model; In this case,
+ * keyboard input needs to be directed to the NxConsole character driver.
+ * This method can be used to enable (or disable) redirection of NX
+ * keyboard input from the window widgets to the NxConsole
+ *
+ * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard
+ * input will be directed to the NxConsole driver using this
+ * handle; If NULL (the default), NX keyboard input will be
+ * directed to the widgets within the window.
+ */
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ inline void redirectNxConsole(NXCONSOLE handle)
+ {
+ setNxConsole(handle);
+ }
+#endif
+
+ /**
* Set an individual pixel in the window with the specified color.
*
* @param pPos The location of the pixel to be filled.
diff --git a/NxWidgets/libnxwidgets/include/ccallback.hxx b/NxWidgets/libnxwidgets/include/ccallback.hxx
index 09cb83a8a..8d3c13cd2 100644
--- a/NxWidgets/libnxwidgets/include/ccallback.hxx
+++ b/NxWidgets/libnxwidgets/include/ccallback.hxx
@@ -48,7 +48,10 @@
#include <nuttx/nx/nxglib.h>
#include <nuttx/nx/nx.h>
-#include <nuttx/nx/nxtk.h>
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+# include <nuttx/nx/nxconsole.h>
+#endif
#include "crect.hxx"
@@ -88,7 +91,11 @@ namespace NXWidgets
class CCallback
{
private:
- struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */
+ CWidgetControl *m_widgetControl; /**< The widget control instance for this window */
+ struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ NXCONSOLE m_nxconsole; /**< The NxConsole handle for redirection of keyboard input */
+#endif
// Methods in the callback vtable
@@ -235,6 +242,27 @@ namespace NXWidgets
{
return &m_callbacks;
}
+
+ /**
+ * By default, NX keyboard input is given to the various widgets
+ * residing in the window. But NxConsole is a different usage model;
+ * In this case, keyboard input needs to be directed to the NxConsole
+ * character driver. This method can be used to enable (or disable)
+ * redirection of NX keyboard input from the window widgets to the
+ * NxConsole
+ *
+ * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard
+ * input will be directed to the NxConsole driver using this
+ * handle; If NULL (the default), NX keyboard input will be
+ * directed to the widgets within the window.
+ */
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ inline void setNxConsole(NXCONSOLE handle)
+ {
+ m_nxconsole = handle;
+ }
+#endif
};
}
diff --git a/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx b/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx
index 8fda121a9..16a0bee92 100644
--- a/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx
@@ -228,6 +228,27 @@ namespace NXWidgets
bool lower(void);
/**
+ * Each window implementation also inherits from CCallback. CCallback,
+ * by default, forwards NX keyboard input to the various widgets residing
+ * in the window. But NxConsole is a different usage model; In this case,
+ * keyboard input needs to be directed to the NxConsole character driver.
+ * This method can be used to enable (or disable) redirection of NX
+ * keyboard input from the window widgets to the NxConsole
+ *
+ * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard
+ * input will be directed to the NxConsole driver using this
+ * handle; If NULL (the default), NX keyboard input will be
+ * directed to the widgets within the window.
+ */
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ inline void redirectNxConsole(NXCONSOLE handle)
+ {
+ setNxConsole(handle);
+ }
+#endif
+
+ /**
* Set an individual pixel in the window with the specified color.
*
* @param pos The location of the pixel to be filled.
diff --git a/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx b/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx
index 8e016c15e..69a004da5 100644
--- a/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx
@@ -197,6 +197,27 @@ namespace NXWidgets
bool lower(void);
/**
+ * Each window implementation also inherits from CCallback. CCallback,
+ * by default, forwards NX keyboard input to the various widgets residing
+ * in the window. But NxConsole is a different usage model; In this case,
+ * keyboard input needs to be directed to the NxConsole character driver.
+ * This method can be used to enable (or disable) redirection of NX
+ * keyboard input from the window widgets to the NxConsole
+ *
+ * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard
+ * input will be directed to the NxConsole driver using this
+ * handle; If NULL (the default), NX keyboard input will be
+ * directed to the widgets within the window.
+ */
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ inline void redirectNxConsole(NXCONSOLE handle)
+ {
+ setNxConsole(handle);
+ }
+#endif
+
+ /**
* Set an individual pixel in the toolbar with the specified color.
*
* @param pPos The location of the pixel to be filled.
diff --git a/NxWidgets/libnxwidgets/include/cnxwindow.hxx b/NxWidgets/libnxwidgets/include/cnxwindow.hxx
index e39c3cc81..50822cc83 100644
--- a/NxWidgets/libnxwidgets/include/cnxwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxwindow.hxx
@@ -201,6 +201,27 @@ namespace NXWidgets
bool lower(void);
/**
+ * Each window implementation also inherits from CCallback. CCallback,
+ * by default, forwards NX keyboard input to the various widgets residing
+ * in the window. But NxConsole is a different usage model; In this case,
+ * keyboard input needs to be directed to the NxConsole character driver.
+ * This method can be used to enable (or disable) redirection of NX
+ * keyboard input from the window widgets to the NxConsole
+ *
+ * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard
+ * input will be directed to the NxConsole driver using this
+ * handle; If NULL (the default), NX keyboard input will be
+ * directed to the widgets within the window.
+ */
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ inline void redirectNxConsole(NXCONSOLE handle)
+ {
+ setNxConsole(handle);
+ }
+#endif
+
+ /**
* Set an individual pixel in the window with the specified color.
*
* @param pPos The location of the pixel to be filled.
diff --git a/NxWidgets/libnxwidgets/include/inxwindow.hxx b/NxWidgets/libnxwidgets/include/inxwindow.hxx
index 750994a71..210a1e6ce 100644
--- a/NxWidgets/libnxwidgets/include/inxwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/inxwindow.hxx
@@ -47,6 +47,10 @@
#include <stdint.h>
#include <stdbool.h>
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+# include <nuttx/nx/nxconsole.h>
+#endif
+
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
@@ -169,6 +173,24 @@ namespace NXWidgets
virtual bool lower(void) = 0;
/**
+ * Each window implementation also inherits from CCallback. CCallback,
+ * by default, forwards NX keyboard input to the various widgets residing
+ * in the window. But NxConsole is a different usage model; In this case,
+ * keyboard input needs to be directed to the NxConsole character driver.
+ * This method can be used to enable (or disable) redirection of NX
+ * keyboard input from the window widgets to the NxConsole
+ *
+ * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard
+ * input will be directed to the NxConsole driver using this
+ * handle; If NULL (the default), NX keyboard input will be
+ * directed to the widgets within the window.
+ */
+
+#ifdef CONFIG_NXCONSOLE_NXKBDIN
+ virtual void redirectNxConsole(NXCONSOLE handle) = 0;
+#endif
+
+ /**
* Set an individual pixel in the window with the specified color.
*
* @param pPos The location of the pixel to be filled.
diff --git a/NxWidgets/libnxwidgets/include/nxconfig.hxx b/NxWidgets/libnxwidgets/include/nxconfig.hxx
index 5ab883ab1..699686822 100644
--- a/NxWidgets/libnxwidgets/include/nxconfig.hxx
+++ b/NxWidgets/libnxwidgets/include/nxconfig.hxx
@@ -184,6 +184,14 @@
# error "Only a single color plane is supported (CONFIG_NX_NPLANES)"
#endif
+/* NxConsole checks. This just simplifies the conditional compilation by
+ * reducing the AND of these three conditions to a single condition.
+ */
+
+#if !defined(CONFIG_NX_KBD) || !defined(CONFIG_NXCONSOLE)
+# undef CONFIG_NXCONSOLE_NXKBDIN
+#endif
+
/* NX Server/Device Configuration *******************************************/
/**
* LCD device number (in case there are more than one LCDs connected)