Skip to content

Commit

Permalink
Changes to support building of 'libform' (ncurses forms menu) and som…
Browse files Browse the repository at this point in the history
…e associated ncurses demos
  • Loading branch information
Bill-Gray committed Jul 30, 2024
1 parent 07bc4ac commit 1ad9562
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
12 changes: 12 additions & 0 deletions demos/curses.priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define NCURSES_INLINE inline
#define Min(a,b) ((a) > (b) ? (b) : (a))
#define TR_FUNC_BFR(max)
#define TR(n, a)
#define NCURSES_SP_DCLx

#define StdScreen(sp) stdscr
Expand All @@ -22,4 +23,15 @@
#define CharOf(c) ChCharOf(c)
#define BLANK ' '
#define ZEROS '\0'
#define _nc_SPRINTF snprintf
#define _nc_SLIMIT(n) ((size_t)(n)),
#define FreeIfNeeded(p) if ((p) != 0) free(p)

#ifdef PDC_WIDE
#define ISBLANK(ch) ((ch).chars[0] == L' ' && (ch).chars[1] == L'\0')
#else
#define ISBLANK(ch) (CharOf(ch) == ' ')
#endif

#define IsValidScreen(sp) true
unsigned addch_used; /* number of 'pending' bytes for a multi-byte character */
16 changes: 8 additions & 8 deletions demos/nctests.mif
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ blue$(E): $(ncurses_testdir)/blue.c
bs$(E): $(ncurses_testdir)/bs.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)

cardfile$(E): $(ncurses_testdir)/cardfile.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
cardfile$(E): $(ncurses_testdir)/cardfile.c $(LIBFORM)
$(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS)

chgat$(E): $(ncurses_testdir)/chgat.c $(ncurses_testdir)/popup_msg.c
$(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS)
Expand All @@ -98,8 +98,8 @@ demo_altkeys$(E): $(ncurses_testdir)/demo_altkeys.c
demo_defkey$(E): $(ncurses_testdir)/demo_defkey.c $(ncurses_testdir)/popup_msg.c
$(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS)

demo_forms$(E): $(ncurses_testdir)/demo_forms.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
demo_forms$(E): $(ncurses_testdir)/demo_forms.c $(ncurses_testdir)/popup_msg.c $(ncurses_testdir)/edit_field.c $(LIBFORM)
$(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS)

demo_keyok$(E): $(ncurses_testdir)/demo_keyok.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
Expand Down Expand Up @@ -140,8 +140,8 @@ dots_termcap$(E): $(ncurses_testdir)/dots_termcap.c
dots_xcurses$(E): $(ncurses_testdir)/dots_xcurses.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)

dup_field$(E): $(ncurses_testdir)/dup_field.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
dup_field$(E): $(ncurses_testdir)/dup_field.c $(ncurses_testdir)/edit_field.c $(ncurses_testdir)/popup_msg.c $(LIBFORM)
$(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS)

echochar$(E): $(ncurses_testdir)/echochar.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
Expand Down Expand Up @@ -200,8 +200,8 @@ list_keys$(E): $(ncurses_testdir)/list_keys.c
lrtest$(E): $(ncurses_testdir)/lrtest.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)

move_field$(E): $(ncurses_testdir)/move_field.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
move_field$(E): $(ncurses_testdir)/move_field.c $(ncurses_testdir)/edit_field.c $(ncurses_testdir)/popup_msg.c $(LIBFORM)
$(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS)

movewindow$(E): $(ncurses_testdir)/movewindow.c
$(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS)
Expand Down
2 changes: 2 additions & 0 deletions demos/ncurses_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define HAVE_COPYWIN 1
#define HAVE_CURSES_VERSION 1
#define HAVE_DELSCREEN 1
#define HAVE_FORM_H 1
#define HAVE_GETBEGX 1
#define HAVE_GETCURX 1
#define HAVE_GETMAXX 1
Expand Down Expand Up @@ -60,6 +61,7 @@
#define HAVE_WRESIZE 1
#define USE_STRING_HACKS 1
#define USE_LIBMENU 1
#define USE_LIBFORM 1

#ifdef PDC_WIDE
# define USE_WIDEC_SUPPORT 1
Expand Down

0 comments on commit 1ad9562

Please sign in to comment.