git: 3e42d7194bdc - main - contrib/bsddialog: Import version 1.0.5
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 09 Oct 2025 15:41:07 UTC
The branch main has been updated by asiciliano: URL: https://cgit.FreeBSD.org/src/commit/?id=3e42d7194bdcd4fbfd781518258f919d6ac803d3 commit 3e42d7194bdcd4fbfd781518258f919d6ac803d3 Merge: a28b44ddc348 653f765f05b8 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2025-10-09 15:39:10 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2025-10-09 15:39:10 +0000 contrib/bsddialog: Import version 1.0.5 Version for change and feature requests. * Improve documentation for --alternate-screen and --normal-screen. Request: https://bugs.freebsd.org/285459. (This PR is not about bsddialog itself but is used as an example for an official FreeBSD documentation request.) * Reduce the number of screen refreshes to improve performance over a 115200 UART connection. Request: https://gitlab.com/alfix/bsddialog/-/issues/8. * Change textbox buttons to return distinct values (previously always returned OK). Request: https://reviews.freebsd.org/D48668; already committed in contrib/ 96a241a35905078bdc5d20bf25943cdb67758dea * Change forms navigation key behavior for ENTER and TAB. Request: https://bugs.freebsd.org/287592. Refer to /usr/src/contrib/bsddialog/CHANGELOG to know more. PR: 287592 Reported by: adrian Sponsored by: The FreeBSD Foundation Merge commit '653f765f05b8c7e3908ae92e9bf61522a50cefc9' into YYY contrib/bsddialog/.gitignore | 1 + contrib/bsddialog/CHANGELOG | 50 ++++++++++++++++++++- contrib/bsddialog/LICENSE | 2 +- contrib/bsddialog/Makefile | 13 +++++- contrib/bsddialog/README.md | 5 +-- contrib/bsddialog/examples_library/compile | 8 ++-- contrib/bsddialog/examples_library/textbox.c | 38 ++++++++++++++++ contrib/bsddialog/lib/GNUmakefile | 19 +++++++- contrib/bsddialog/lib/Makefile | 21 ++++++++- contrib/bsddialog/lib/barbox.c | 37 ++++++++-------- contrib/bsddialog/lib/bsddialog.3 | 16 +++++-- contrib/bsddialog/lib/bsddialog.h | 5 ++- contrib/bsddialog/lib/bsddialog_theme.h | 2 +- contrib/bsddialog/lib/datebox.c | 28 ++++++------ contrib/bsddialog/lib/formbox.c | 48 ++++++++++++++------ contrib/bsddialog/lib/lib_util.c | 3 +- contrib/bsddialog/lib/lib_util.h | 4 +- contrib/bsddialog/lib/libbsddialog.c | 14 +++++- contrib/bsddialog/lib/menubox.c | 18 ++++---- contrib/bsddialog/lib/messagebox.c | 16 +++---- contrib/bsddialog/lib/textbox.c | 16 +++---- contrib/bsddialog/lib/theme.c | 6 +-- contrib/bsddialog/lib/timebox.c | 16 +++---- contrib/bsddialog/utility/GNUmakefile | 11 ++++- contrib/bsddialog/utility/Makefile | 11 ++++- contrib/bsddialog/utility/bsddialog.1 | 21 ++++++--- contrib/bsddialog/utility/bsddialog.c | 2 +- contrib/bsddialog/utility/util.h | 2 +- contrib/bsddialog/utility/util_builders.c | 66 ++++++++++++++-------------- contrib/bsddialog/utility/util_cli.c | 2 +- contrib/bsddialog/utility/util_theme.c | 4 +- 31 files changed, 353 insertions(+), 152 deletions(-) diff --cc contrib/bsddialog/.gitignore index c8fc68ed8a0e,000000000000..c9613d477f7f mode 100644,000000..100644 --- a/contrib/bsddialog/.gitignore +++ b/contrib/bsddialog/.gitignore @@@ -1,26 -1,0 +1,27 @@@ +bsddialog +.depend* +*.o +*.so* +*.a +*.gz +*.core +*~ +BSDDIALOG.geany +BSDDIALOG.tags +examples_library/calendar +examples_library/checklist +examples_library/datebox +examples_library/form +examples_library/gauge +examples_library/infobox +examples_library/menu +examples_library/mixedgauge +examples_library/mixedlist +examples_library/msgbox +examples_library/pause +examples_library/radiolist +examples_library/rangebox ++examples_library/textbox +examples_library/theme +examples_library/timebox +examples_library/yesno diff --cc contrib/bsddialog/Makefile index a6af8813a48e,000000000000..335b693470e6 mode 100644,000000..100644 --- a/contrib/bsddialog/Makefile +++ b/contrib/bsddialog/Makefile @@@ -1,38 -1,0 +1,47 @@@ +# PUBLIC DOMAIN - NO WARRANTY, see: +# <http://creativecommons.org/publicdomain/zero/1.0/> +# +# Written in 2023 by Alfonso Sabato Siciliano + +OUTPUT = bsddialog - export VERSION=1.0.4 ++export VERSION=1.0.5 +.CURDIR ?= ${CURDIR} +LIBPATH = ${.CURDIR}/lib +LIBBSDDIALOG = ${LIBPATH}/libbsddialog.so +UTILITYPATH = ${.CURDIR}/utility + +RM= rm -f +LN = ln -s -f + +### command-line options ### +# FreeBSD port Makefile: 'MAKE_ARGS = -DNORPATH' +NORPATH ?= +export DISABLERPATH=${NORPATH} +# Debug: `make -DDEBUG` or `gmake DEBUG=1` +DEBUG ?= +export ENABLEDEBUG=${DEBUG} +################### + - all : ${OUTPUT} ++all: ${OUTPUT} ++ ++install: all ++ ${MAKE} -C ${LIBPATH} install ++ ${MAKE} -C ${UTILITYPATH} install ++ ++uninstall: ++ ${MAKE} -C ${UTILITYPATH} uninstall ++ ${MAKE} -C ${LIBPATH} uninstall + +${OUTPUT}: ${LIBBSDDIALOG} + ${MAKE} -C ${UTILITYPATH} LIBPATH=${LIBPATH} + ${LN} ${UTILITYPATH}/${OUTPUT} ${.CURDIR}/${OUTPUT} + +${LIBBSDDIALOG}: + ${MAKE} -C ${LIBPATH} + +clean: + ${MAKE} -C ${LIBPATH} clean + ${MAKE} -C ${UTILITYPATH} clean + ${RM} ${OUTPUT} *.core + ++.PHONY: all install uninstall clean diff --cc contrib/bsddialog/README.md index 7b9b6cf8e84d,000000000000..5a25109775fe mode 100644,000000..100644 --- a/contrib/bsddialog/README.md +++ b/contrib/bsddialog/README.md @@@ -1,142 -1,0 +1,141 @@@ - # BSDDialog 1.0.4 ++# BSDDialog 1.0.5 + +This project provides **bsddialog** and **libbsddialog**, an utility +and a library to build scripts and tools with TUI dialogs and widgets. + + +## Demo + +[Screenshots](https://www.flickr.com/photos/alfonsosiciliano/albums/72157720215006074). + + +## Getting Started + +FreeBSD and Linux: + +``` +% git clone https://gitlab.com/alfix/bsddialog.git +% cd bsddialog +% make +% ./bsddialog --msgbox "Hello World!" 8 20 +``` + +Output: + + + + +## Utility + +**Dialogs:** + +--calendar, --checklist, --datebox, --form, --gauge, --infobox, --inputbox, +--menu, --mixedform, --mixedgauge, --msgbox, --passwordbox, --passwordform, +--pause, --radiolist, --rangebox, --textbox, --timebox, --treeview, --yesno. + +**Manual** + + - [bsddialog(1)](https://alfonsosiciliano.gitlab.io/posts/2022-01-26-manual-bsddialog.html) + + +**Examples**: + +``` +% ./bsddialog --backtitle "TITLE" --title msgbox --msgbox "Hello World!" 5 30 +% ./bsddialog --theme blackwhite --title msgbox --msgbox "Hello World!" 5 30 +% ./bsddialog --begin-y 2 --default-no --title yesno --yesno "Hello World!" 5 30 +% ./bsddialog --ascii-lines --pause "Hello World!" 8 50 10 +% ./bsddialog --checklist "Space to select" 0 0 0 Name1 Desc1 off Name2 Desc2 on +% ./bsddialog --title yesno --hline "bsddialog" --yesno "Hello World!" 5 25 +% ./bsddialog --extra-button --help-button --yesno "Hello World!" 0 0 +``` + +and [Examples](https://gitlab.com/alfix/bsddialog/-/tree/main/examples_utility) +in the _Public Domain_ to build new projects: +``` +% sh ./examples_utility/calendar.sh +% sh ./examples_utility/checklist.sh +% sh ./examples_utility/datebox.sh +% sh ./examples_utility/form.sh +% sh ./examples_utility/gauge.sh +% sh ./examples_utility/infobox.sh +% sh ./examples_utility/inputbox.sh +% sh ./examples_utility/menu.sh +% sh ./examples_utility/mixedform.sh +% sh ./examples_utility/mixedgauge.sh +% sh ./examples_utility/msgbox.sh +% sh ./examples_utility/passwordbox.sh +% sh ./examples_utility/passwordform.sh +% sh ./examples_utility/pause.sh +% sh ./examples_utility/radiolist.sh +% sh ./examples_utility/rangebox.sh +% sh ./examples_utility/timebox.sh +% sh ./examples_utility/yesno.sh +``` + +## Library + +**API** + + - [bsddialog.h](https://gitlab.com/alfix/bsddialog/-/blob/main/lib/bsddialog.h) + - [bsddialog\_theme.h](https://gitlab.com/alfix/bsddialog/-/blob/main/lib/bsddialog_theme.h) + + +**Manual** + + - [bsddialog(3)](https://alfonsosiciliano.gitlab.io/posts/2022-01-15-manual-libbsddialog.html) + + +**Examples**: + +[Examples](https://gitlab.com/alfix/bsddialog/-/tree/main/examples_library) +in the _Public Domain_ to build new projects: +``` +% cd examples_library +% sh compile +% ./calendar +% ./checklist +% ./datebox +% ./form +% ./gauge +% ./infobox +% ./menu +% ./mixedgauge +% ./mixedlist +% ./msgbox +% ./pause +% ./radiolist +% ./rangebox +% ./theme +% ./timebox +% ./yesno +``` + + +## TODO and Ideas + + - menubar feature. + - key callback. + - Right-To-Left text. + - some terminal does not hide the cursor, move it bottom-right before to getch. + - refactor backtitle: add WINDOW \*dialog.backtitle for multiline and fix expanding screen. + - refactor bottomdesc: add WINDOW \*dialog.bottomdesc to fix expandig screen. + - accessibility https://wiki.freebsd.org/Accessibility/Wishlist/Base. + - add bool conf.menu.depthlines. + - implement custom getopt\_long(). + - refactor/redesign gauge(). + - improve grey lines expanding terminal (maybe redrawwin() in hide\_dialog()). + - more restrictive strtol() and strtoul(). + - implement global buttons handler. + - doc: external tutorial, theming guide. + - implement menutype.min\_on. - - improve refresh at startup, avoid dialog refresh before drawing text. + - add debug API: bsddialog\_debug(y,x,refresh,"fmt",...). + - add mouse support. + - use alarm(2) for bsddialog\_pause. + - delete form fieldlen constraint, hide or truncate long field in little screens. + - improve --inputbox autosizing, consider also input length. + - fix --form "" 0 0 0 Label 1 0 Init 1 12 0 0 (with 0 editable field). + - fix --mixedform "" 0 0 0 Label 1 0 Init 1 12 0 0 2 (with 0 editable field). + - add *text* customization to --hmsg *help-message* + - check --passwordform *fieldlen* like --form and --mixedform. - ++ - add manuals to Makefiles installe and uninstall targets. diff --cc contrib/bsddialog/examples_library/textbox.c index 000000000000,2e76cbb97891..2e76cbb97891 mode 000000,100644..100644 --- a/contrib/bsddialog/examples_library/textbox.c +++ b/contrib/bsddialog/examples_library/textbox.c diff --cc contrib/bsddialog/lib/Makefile index 252b33f79848,000000000000..c728541a9f7a mode 100644,000000..100644 --- a/contrib/bsddialog/lib/Makefile +++ b/contrib/bsddialog/lib/Makefile @@@ -1,44 -1,0 +1,63 @@@ +# PUBLIC DOMAIN - NO WARRANTY, see: +# <http://creativecommons.org/publicdomain/zero/1.0/> +# +# Written in 2021 by Alfonso Sabato Siciliano + +LIBRARY = bsddialog +LIBRARY_SO = lib${LIBRARY:=.so} +LIBRARY_A = lib${LIBRARY:=.a} +HEADERS = bsddialog.h bsddialog_theme.h bsddialog_progressview.h +SOURCES = barbox.c datebox.c formbox.c libbsddialog.c lib_util.c \ + menubox.c messagebox.c textbox.c theme.c timebox.c +OBJECTS = ${SOURCES:.c=.o} ++PREFIX = /usr/local + +.if defined(DEBUG) +CFLAGS += -g +.endif +CFLAGS += -D_XOPEN_SOURCE_EXTENDED -fPIC -Wall -Wextra -std=gnu99 \ + -fstack-protector-strong +LDFLAGS += -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel -Wl,-soname,${LIBRARY_SO}.${VERSION} \ + -L/usr/lib -lncursesw -ltinfow + +LN = ln -s -f +RM = rm -f + - all : ${LIBRARY} ++all: ${LIBRARY} ++ ++install: all ++ ${INSTALL} -m 0644 bsddialog.h ${DESTDIR}${PREFIX}/include/bsddialog.h ++ ${INSTALL} -m 0644 bsddialog_progressview.h ${DESTDIR}${PREFIX}/include/bsddialog_progressview.h ++ ${INSTALL} -m 0644 bsddialog_theme.h ${DESTDIR}${PREFIX}/include/bsddialog_theme.h ++ ${INSTALL} -m 0644 ${LIBRARY_A} ${DESTDIR}${PREFIX}/lib/${LIBRARY_A} ++ ${INSTALL} -m 0755 ${LIBRARY_SO}.${VERSION} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO}.${VERSION} ++ ${LN} ${LIBRARY_SO}.${VERSION} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO} ++ ++uninstall: ++ ${RM} ${DESTDIR}${PREFIX}/include/bsddialog.h ++ ${RM} ${DESTDIR}${PREFIX}/include/bsddialog_progressview.h ++ ${RM} ${DESTDIR}${PREFIX}/include/bsddialog_theme.h ++ ${RM} ${DESTDIR}${PREFIX}/lib/${LIBRARY_A} ++ ${RM} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO}.${VERSION} ++ ${RM} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO} + +${LIBRARY}: ${LIBRARY_SO} ${LIBRARY_A} + +${LIBRARY_SO}.${VERSION}: ${OBJECTS} + ${CC} ${LDFLAGS} ${.ALLSRC} -o ${LIBRARY_SO}.${VERSION} + +${LIBRARY_SO}: ${LIBRARY_SO}.${VERSION} + ${LN} ${LIBRARY_SO}.${VERSION} ${LIBRARY_SO} + +${LIBRARY_A}: ${OBJECTS} + ${AR} cr ${.TARGET} ${OBJECTS} + ${RANLIB} ${.TARGET} + +.c.o: + ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +clean: + ${RM} ${LIBRARY_SO}* *.o *~ *.gz ${LIBRARY_A} ++ ++.PHONY: all install uninstall ${LIBRARY} clean