graphics/microwindows: add Nano-X client library and built-in server 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>
This commit is contained in:
Acfboy 2026-08-01 22:56:05 +08:00
parent ef1cfe9798
commit 8481f80583
2 changed files with 57 additions and 0 deletions

View file

@ -128,4 +128,22 @@ config MICROWINDOWS_MWIN
a high-level windowing API similar to the Microsoft Windows API
with window management, controls, and standard dialogs.
config MICROWINDOWS_NANOX
bool "Nano-X (X11 API) client/server support"
default n
depends on NET_LOCAL && NET_LOCAL_STREAM
---help---
Build the Nano-X server core and the Nano-X client library.
The Nano-X server runs as a separate task and provides the
X11-like API (GrXXX calls) to client applications which
connect to it through a local stream socket.
config MICROWINDOWS_NANOX_NANOWM
bool "Built-in Nano-X window manager"
default n
depends on MICROWINDOWS_NANOX
---help---
Link the built-in window manager (wm*.c, nxdraw.c) into the
Nano-X server, providing window decorations (title bar, 3D
frame), cascaded placement, move/resize and focus handling.
endif # GRAPHICS_MICROWINDOWS

View file

@ -153,4 +153,43 @@ CFLAGS += -DNOGDI
endif
ifneq ($(CONFIG_MICROWINDOWS_NANOX),)
MW_NANOX_CLIENT_SRCS = microwindows/src/nanox/nxdraw.c
MW_NANOX_CLIENT_SRCS += microwindows/src/nanox/nxutil.c
MW_NANOX_CLIENT_SRCS += microwindows/src/nanox/nxtransform.c
MW_NANOX_CLIENT_SRCS += microwindows/src/nanox/client.c
MW_NANOX_CLIENT_SRCS += microwindows/src/nanox/clientfb.c
MW_NANOX_CLIENT_SRCS += microwindows/src/nanox/nxproto.c
MW_NANOX_CLIENT_SRCS += microwindows/src/drivers/osdep.c
MW_NANOX_WM_SRCS = microwindows/src/nanox/wmaction.c
MW_NANOX_WM_SRCS += microwindows/src/nanox/wmclients.c
MW_NANOX_WM_SRCS += microwindows/src/nanox/wmevents.c
MW_NANOX_WM_SRCS += microwindows/src/nanox/wmutil.c
MW_NANOX_SERVER_SRCS = microwindows/src/nanox/srvmain.c
MW_NANOX_SERVER_SRCS += microwindows/src/nanox/srvfunc.c
MW_NANOX_SERVER_SRCS += microwindows/src/nanox/srvutil.c
MW_NANOX_SERVER_SRCS += microwindows/src/nanox/srvevent.c
MW_NANOX_SERVER_SRCS += microwindows/src/nanox/srvclip.c
MW_NANOX_SERVER_SRCS += microwindows/src/nanox/srvnet.c
# The server main() is renamed to nanox_server_main() and invoked from
# the nanoxterm example, which starts the server as a separate task.
microwindows/src/nanox/srvmain.c_CFLAGS += -Dmain=nanox_server_main
# Rename the server-side GrXXX symbols to SVR_GrXXX.
CFLAGS += -DNUTTX=1
ifneq ($(CONFIG_MICROWINDOWS_NANOX_NANOWM),)
CFLAGS += -DNANOWM=1
$(foreach src,$(MW_NANOX_WM_SRCS),$(eval $(src)_CFLAGS += -include microwindows/src/nanox/serv.h))
microwindows/src/nanox/nxdraw.c_CFLAGS += -include microwindows/src/nanox/serv.h
CSRCS += $(MW_NANOX_WM_SRCS)
endif
CSRCS += $(MW_NANOX_CLIENT_SRCS) $(MW_NANOX_SERVER_SRCS)
endif
include $(APPDIR)/Application.mk