2002-05-09 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Thu, 9 May 2002 05:35:59 +0000 (05:35 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Thu, 9 May 2002 05:35:59 +0000 (05:35 +0000)
commite2ac35766f834f2d9e47a610847461257640e2de
tree0e9cc561ebfe5ea17ccbfe5507eac510f20ab4d6
parentc3ce16d643da23cfe28e1f2363ea24bb9e743b0d
2002-05-09  Marcus Brinkmann  <marcus@g10code.de>

* configure.ac: Add option --enable-fallback-curses and bind it to
the ncurses check.  Add automake conditional
BUILD_LIBPINENTRY_CURSES and FALLBACK_CURSES. Add preprocessor
symbol FALLBACK_CURSES.

* curses/Makefile.am (AM_CPPFLAGS): Add $(NCURSES_INCLUDE).
(LDADD): Add ../pinentry/libpinentry-curses.a.
* curses/pinentry-curses.c: Include "pinentry-curses.h".
Moved most of the meat to ...
* pinentry/pinentry-curses.c: ... here.  New file.  Make all
functions and global variables static.
(dialog_cmd_handler): Rename to ...
(curses_cmd_handler): ... this.
* pinentry/pinentry-curses.h: New file.
* pinentry/Makefile.am (noinst_LIBRARIES)
[BUILD_LIBPINENTRY_CURSES]: Add libpinentry-curses.a.
(libpinentry_curses_a_SOURCES): New target.

* gtk/Makefile.am (INCLUDES): Moved all to ...
(AM_CPPFLAGS): ... here.
[CURSES_FALLBACK]: Define ncurses_include and libcurses.
(AM_CPPFLAGS): Add $(ncurses_include).
(LDADD): Add $(libcurses).
* gtk/pinentry-gtk.c: Rename TIMEOUT to TIME_OUT to avoid conflict
with curses.h.
[CURSES_FALLBACK]: Include "pinentry-curses.h".
(button_clicked): Likewise.
(create_window): Likewise.
(cmd_handler): Renamed to ...
(gtk_cmd_handler): ... this.
(pinentry_cmd_handler): Set to gtk_cmd_handler.
(main) [CURSES_FALLBACK]: Initialize GTK+ only if environment
variable DISPLAY is set, otherwise fall back to curses dialog.

* pinentry/pinentry.h: Protect against multiple inclusion.
12 files changed:
ChangeLog
NEWS
README
TODO
configure.ac
curses/Makefile.am
curses/pinentry-curses.c
gtk/Makefile.am
gtk/pinentry-gtk.c
pinentry/Makefile.am
pinentry/pinentry.c
pinentry/pinentry.h