graphics/microwindows: add Nano-X client/server support and examples for NuttX - #3689
graphics/microwindows: add Nano-X client/server support and examples for NuttX#3689Acfboy wants to merge 6 commits into
Conversation
|
Thank you @Acfboy :-) For sure we need a documentation for that part :-) I just did a rewrite of components / graphics / nx, so other gfx components are in one place, like framebuffer, and maybe nano-x, will push in a free moment this week :-) |
…support for NuttX Build the Nano-X client library, server and (optional) built-in window manager from the bundled Microwindows tree Signed-off-by: Acfboy <AcfboyU@outlook.com>
* Port the nxcalc demo from Microwindows * Connects to the Nano-X server started by examples/nanoxterm * Requires CONFIG_LIBC_FLOATINGPOINT for the result formatting Signed-off-by: Acfboy <AcfboyU@outlook.com>
* Port the nxterm demo from Microwindows * Starts the Nano-X server as a separate task before connecting * Runs an NSH shell instance on a pseudo terminal in the spwaned child instead of exec /bin/sh (no filesystem binaries in flat builds) Assisted-by: OpenCode:DeepSeek-V4-Flash Signed-off-by: Acfboy <AcfboyU@outlook.com>
…h the server * Add CONFIG_MICROWINDOWS_NANOX_NONETWORK which builds the Nano-X client library and server in the linked-in (NONETWORK) mode, so client applications are linked directly with the server and run in the same task, requiring no network stack or socket at all * Reorganize the source lists: the drawing sources (nxdraw, nxutil, nxtransform, nxpaintnc) are shared by both modes, while the server is built from srvnet.c in the network mode and srvnonet.c in the NONETWORK mode * Use MULTITHREAD_SERVER in the network mode so that several client tasks can run at the same time in the flat build * Let the examples/nanoxterm start the server task only in the network mode (NONETWORK applications run the server inside main) Assisted-by: OpenCode:DeepSeek-V4-Flash Signed-off-by: Acfboy <AcfboyU@outlook.com>
a901697 to
772e4f7
Compare
|
Great, I will look into patches soon. Do not forget to update Microwidows HASH in the but you have pending changes so it would be ideal to change nuttx-apps one when mainline is updated. PS: I will not be available next week/till August 23 night. I leave on this Friday or Saturday evening. |
ppisa
left a comment
There was a problem hiding this comment.
Generally looks OK for me, question is if we need to export
CFLAGS += -DNUTTX=1
from graphics/microwindows/Makefile to control microwindows/microwindows/src/mwin/winmain.c not use dragwp in
int poll = (!canBlock || dragwp);
for NuttX.
|
|
||
| CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/graphics/microwindows/microwindows/src/include | ||
| CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/graphics/microwindows/microwindows/src/include | ||
| EXPORTED_INCLUDES += ${INCDIR_PREFIX}$(APPDIR)/graphics/microwindows/microwindows/src/include |
There was a problem hiding this comment.
This commit should be probably divided into two, one which introduce the feature and another which uses it for Microwindows.
| cp -Rf "$${inc}"$(DELIM). "${EXPORTDIR}"$(DELIM)include || exit 1; \ | ||
| fi \ | ||
| done | ||
| endif |
There was a problem hiding this comment.
I think that this is right srat, but it seems that there needs to be some more work because
CFLAGS += -DMWCONFIG_FILE='"mwconfig.nuttx"'
from apps/graphics/microwindows/Make.defs is not propagated some CFLAGS or similar into nuttx-export/scripts/Make.defs.
But this correction can go to another pull round by you or us (I would discuss with @michallenc ).
* Introduce EXPORTED_INCLUDES in apps/Make.defs; every entry is prefixed with INCDIR_PREFIX and added to CFLAGS/CXXFLAGS so it takes effect in the in-tree build as well * The export target in apps/Makefile copies the content of the listed directories into the include directory of the export package, so out-of-tree applications built from the package can still find the public headers Signed-off-by: Acfboy <AcfboyU@outlook.com>
registers microwindows/src/include through the EXPORTED_INCLUDES mechanism in its Make.defs Signed-off-by: Acfboy <AcfboyU@outlook.com>
772e4f7 to
b3b3dca
Compare
Summary
This PR ports the Nano-X windowing system from Microwindows to NuttX so that X11-style client/server applications can run in a flat build. It contains three logical parts:
graphics/microwindows: build the Nano-X client library and server from the bundled Microwindows tree, with two new Kconfig options:MICROWINDOWS_NANOX: build the Nano-X client library and server.MICROWINDOWS_NANOX_NANOWM: optionally link the Microwindows window manager into the server so the server task draws and decorates windows itself.examples/nanoxcalc: port of the nxcalc demo. It connects to the running Nano-X server and shows a calculator keypad.examples/nanoxterm: port of the nxterm demo. It is a terminal emulator that opens a pseudo terminal, forks, and runs an NSH instance (nsh_consolemain) in the child instead of exec'ing /bin/sh, since flat builds have no filesystem binaries. It starts the Nano-X server as a separate task before connecting, so it can be used as the init entry point: booting sim:nanox opens the nxterm window directly, and typing nanoxcalc in it opens the calculator.Note
There are still some remaining issues, for example, have some problem when running on qemu, so this is just a draft PR. When it is fully ready, I will add the documentation and open it up for review.