Commit 84de552b authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Added --disable-mouse option

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@595 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 235ab192
Showing with 1268 additions and 925 deletions
+1268 -925
...@@ -3,6 +3,10 @@ Cvs code - ...@@ -3,6 +3,10 @@ Cvs code -
- New global variables currshortcut and currslen to support using - New global variables currshortcut and currslen to support using
the mouse with the shortcuts. FIXME - Does not support clicking the mouse with the shortcuts. FIXME - Does not support clicking
on filenames in the browser, yet. on filenames in the browser, yet.
- Changed mouse disabling code from depending on --enable-tiny
to its own flag, --disable mouse. The --tiny option defines
this automatically, but now just mouse support can be disabled
if desired.
nano 1.1 tree forked here 04/07/2001 nano 1.1 tree forked here 04/07/2001
......
...@@ -57,26 +57,31 @@ POST_INSTALL = : ...@@ -57,26 +57,31 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
AS = @AS@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATALOGS = @CATALOGS@ CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@ CATOBJEXT = @CATOBJEXT@
CC = @CC@ CC = @CC@
CURSES_LIB = @CURSES_LIB@ CURSES_LIB = @CURSES_LIB@
DATADIRNAME = @DATADIRNAME@ DATADIRNAME = @DATADIRNAME@
GENCAT = @GENCAT@ DLLTOOL = @DLLTOOL@
GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_CONFIG = @GLIB_CONFIG@ GLIB_CONFIG = @GLIB_CONFIG@
GLIB_LIBS = @GLIB_LIBS@ GLIB_LIBS = @GLIB_LIBS@
GMOFILES = @GMOFILES@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@ GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@ INTLBISON = @INTLBISON@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@ INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LIBICONV = @LIBICONV@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MKINSTALLDIRS = @MKINSTALLDIRS@ MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@ MSGFMT = @MSGFMT@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
POFILES = @POFILES@ POFILES = @POFILES@
POSUB = @POSUB@ POSUB = @POSUB@
...@@ -84,7 +89,6 @@ RANLIB = @RANLIB@ ...@@ -84,7 +89,6 @@ RANLIB = @RANLIB@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@ USE_NLS = @USE_NLS@
VERSION = @VERSION@ VERSION = @VERSION@
l = @l@
bin_PROGRAMS = nano bin_PROGRAMS = nano
nano_SOURCES = cut.c files.c global.c move.c nano.c nano.h proto.h search.c utils.c winio.c nano_SOURCES = cut.c files.c global.c move.c nano.c nano.h proto.h search.c utils.c winio.c
...@@ -132,8 +136,8 @@ MANS = $(man_MANS) ...@@ -132,8 +136,8 @@ MANS = $(man_MANS)
NROFF = nroff NROFF = nroff
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 \ INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 \
config.h.in configure configure.in install-sh missing mkinstalldirs \ config.guess config.h.in config.sub configure configure.in install-sh \
texinfo.tex missing mkinstalldirs texinfo.tex
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
...@@ -203,8 +207,8 @@ install-binPROGRAMS: $(bin_PROGRAMS) ...@@ -203,8 +207,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
$(mkinstalldirs) $(DESTDIR)$(bindir) $(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \ @list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \ if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \ else :; fi; \
done done
......
...@@ -51,3 +51,7 @@ ...@@ -51,3 +51,7 @@
/* Define this to disable any and all text wrapping */ /* Define this to disable any and all text wrapping */
#undef DISABLE_WRAPPING #undef DISABLE_WRAPPING
/* Define this to disable the mouse functions */
#undef DISABLE_MOUSE
This diff is collapsed.
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
/* Define to `long' if <sys/types.h> doesn't define. */ /* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t #undef off_t
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
/* Define as the return type of signal handlers (int or void). */ /* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE #undef RETSIGTYPE
...@@ -61,21 +58,6 @@ ...@@ -61,21 +58,6 @@
/* Define this if your curses lib has the _use_keypad flag */ /* Define this if your curses lib has the _use_keypad flag */
#undef HAVE_USEKEYPAD #undef HAVE_USEKEYPAD
/* Define this if you have NLS */
#undef ENABLE_NLS
/* Define this is you have the catgets command */
#undef HAVE_CATGETS
/* Define this is you have GNU gettext */
#undef HAVE_GETTEXT
/* Define this for HAVE_LC_MESSAGES */
#undef HAVE_LC_MESSAGES
/* Define this if you have the stpcpy function (cool) */
#undef HAVE_STPCPY
/* Define this to make the nano executable as small as possible */ /* Define this to make the nano executable as small as possible */
#undef NANO_SMALL #undef NANO_SMALL
...@@ -103,6 +85,9 @@ ...@@ -103,6 +85,9 @@
/* Define this to disable any and all text wrapping */ /* Define this to disable any and all text wrapping */
#undef DISABLE_WRAPPING #undef DISABLE_WRAPPING
/* Define this to disable the mouse functions */
#undef DISABLE_MOUSE
/* Define if you have the __argz_count function. */ /* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT #undef HAVE___ARGZ_COUNT
...@@ -115,6 +100,12 @@ ...@@ -115,6 +100,12 @@
/* Define if you have the dcgettext function. */ /* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT #undef HAVE_DCGETTEXT
/* Define if you have the feof_unlocked function. */
#undef HAVE_FEOF_UNLOCKED
/* Define if you have the fgets_unlocked function. */
#undef HAVE_FGETS_UNLOCKED
/* Define if you have the getcwd function. */ /* Define if you have the getcwd function. */
#undef HAVE_GETCWD #undef HAVE_GETCWD
...@@ -124,6 +115,9 @@ ...@@ -124,6 +115,9 @@
/* Define if you have the getpagesize function. */ /* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE #undef HAVE_GETPAGESIZE
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if you have the munmap function. */ /* Define if you have the munmap function. */
#undef HAVE_MUNMAP #undef HAVE_MUNMAP
...@@ -151,6 +145,9 @@ ...@@ -151,6 +145,9 @@
/* Define if you have the strdup function. */ /* Define if you have the strdup function. */
#undef HAVE_STRDUP #undef HAVE_STRDUP
/* Define if you have the tsearch function. */
#undef HAVE_TSEARCH
/* Define if you have the vsnprintf function. */ /* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF #undef HAVE_VSNPRINTF
...@@ -184,6 +181,12 @@ ...@@ -184,6 +181,12 @@
/* Define if you have the <regex.h> header file. */ /* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H #undef HAVE_REGEX_H
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <string.h> header file. */ /* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H #undef HAVE_STRING_H
...@@ -199,12 +202,28 @@ ...@@ -199,12 +202,28 @@
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define if you have the i library (-li). */
#undef HAVE_LIBI
/* Name of package */ /* Name of package */
#undef PACKAGE #undef PACKAGE
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if translation of program messages to the user's native language
is requested. */
#undef ENABLE_NLS
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
This diff is collapsed.
...@@ -24,6 +24,7 @@ AC_ARG_ENABLE(tiny, ...@@ -24,6 +24,7 @@ AC_ARG_ENABLE(tiny,
AC_DEFINE(DISABLE_HELP) AC_DEFINE(DISABLE_HELP)
AC_DEFINE(DISABLE_JUSTIFY) AC_DEFINE(DISABLE_JUSTIFY)
AC_DEFINE(DISABLE_BROWSER) AC_DEFINE(DISABLE_BROWSER)
AC_DEFINE(DISABLE_MOUSE)
fi]) fi])
AC_ARG_ENABLE(extra, AC_ARG_ENABLE(extra,
...@@ -68,6 +69,12 @@ AC_ARG_ENABLE(wrapping, ...@@ -68,6 +69,12 @@ AC_ARG_ENABLE(wrapping,
AC_DEFINE(DISABLE_WRAPPING) AC_DEFINE(DISABLE_WRAPPING)
fi]) fi])
AC_ARG_ENABLE(mouse,
[ --disable-mouse Disables mouse support (and -m flag)],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_MOUSE)
fi])
AC_MSG_CHECKING([whether to use slang]) AC_MSG_CHECKING([whether to use slang])
CURSES_LIB_NAME="" CURSES_LIB_NAME=""
AC_ARG_WITH(slang, AC_ARG_WITH(slang,
......
...@@ -377,7 +377,7 @@ void usage(void) ...@@ -377,7 +377,7 @@ void usage(void)
#endif #endif
printf(_ printf(_
(" -l --nofollow Don't follow symbolic links, overwrite\n")); (" -l --nofollow Don't follow symbolic links, overwrite\n"));
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
printf(_(" -m --mouse Enable mouse\n")); printf(_(" -m --mouse Enable mouse\n"));
#endif #endif
...@@ -419,7 +419,7 @@ void usage(void) ...@@ -419,7 +419,7 @@ void usage(void)
#endif #endif
printf(_ printf(_
(" -l Don't follow symbolic links, overwrite\n")); (" -l Don't follow symbolic links, overwrite\n"));
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
printf(_(" -m Enable mouse\n")); printf(_(" -m Enable mouse\n"));
#endif #endif
...@@ -472,7 +472,10 @@ void version(void) ...@@ -472,7 +472,10 @@ void version(void)
#ifdef DISABLE_HELP #ifdef DISABLE_HELP
printf(" --disable-help"); printf(" --disable-help");
#endif #endif
#ifdef DISABLE_MOUSE
printf(" --disable-mouse");
#endif #endif
#endif /* NANO_SMALL */
#ifdef DISABLE_WRAPPING #ifdef DISABLE_WRAPPING
printf(" --disable-wrapping"); printf(" --disable-wrapping");
...@@ -1516,7 +1519,7 @@ int do_exit(void) ...@@ -1516,7 +1519,7 @@ int do_exit(void)
return 1; return 1;
} }
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
void do_mouse(void) void do_mouse(void)
{ {
...@@ -1766,7 +1769,7 @@ void window_init(void) ...@@ -1766,7 +1769,7 @@ void window_init(void)
void mouse_init(void) void mouse_init(void)
{ {
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
if (ISSET(USE_MOUSE)) { if (ISSET(USE_MOUSE)) {
keypad_on(edit, 1); keypad_on(edit, 1);
...@@ -2627,7 +2630,7 @@ int main(int argc, char *argv[]) ...@@ -2627,7 +2630,7 @@ int main(int argc, char *argv[])
/* Last gasp, stuff that's not in the main lists */ /* Last gasp, stuff that's not in the main lists */
if (!keyhandled) if (!keyhandled)
switch (kbinput) { switch (kbinput) {
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
case KEY_MOUSE: case KEY_MOUSE:
do_mouse(); do_mouse();
......
...@@ -382,6 +382,10 @@ consider the following command line options: ...@@ -382,6 +382,10 @@ consider the following command line options:
Disables all word wrapping in the editor. This also eliminates the Disables all word wrapping in the editor. This also eliminates the
-w command line flag, as nonwrapping is then the default behavior. -w command line flag, as nonwrapping is then the default behavior.
`--disable-mouse'
Disables all mouse functionality. This also disables the -m
commands line flag which enables the mouse functions.
 
Tag Table: Tag Table:
......
...@@ -409,6 +409,10 @@ It also disables the function toggles and mouse support. ...@@ -409,6 +409,10 @@ It also disables the function toggles and mouse support.
Disables all word wrapping in the editor. This also eliminates the Disables all word wrapping in the editor. This also eliminates the
-w command line flag, as nonwrapping is then the default behavior. -w command line flag, as nonwrapping is then the default behavior.
@item --disable-mouse
Disables all mouse functionality. This also disables the -m commands line
flag which enables the mouse functions.
@end table @end table
@contents @contents
......
...@@ -308,7 +308,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen, ...@@ -308,7 +308,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
case 545: /* Right alt again */ case 545: /* Right alt again */
break; break;
#endif #endif
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
case KEY_MOUSE: case KEY_MOUSE:
do_mouse(); do_mouse();
...@@ -1044,7 +1044,7 @@ int do_yesno(int all, int leavecursor, char *msg, ...) ...@@ -1044,7 +1044,7 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
char *nostr; /* Same for no */ char *nostr; /* Same for no */
char *allstr; /* And all, surprise! */ char *allstr; /* And all, surprise! */
char shortstr[5]; /* Temp string for above */ char shortstr[5]; /* Temp string for above */
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
MEVENT mevent; MEVENT mevent;
#endif #endif
...@@ -1097,7 +1097,7 @@ int do_yesno(int all, int leavecursor, char *msg, ...) ...@@ -1097,7 +1097,7 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
kbinput = wgetch(edit); kbinput = wgetch(edit);
switch (kbinput) { switch (kbinput) {
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
case KEY_MOUSE: case KEY_MOUSE:
...@@ -1297,7 +1297,7 @@ int do_help(void) ...@@ -1297,7 +1297,7 @@ int do_help(void)
do { do {
ptr = help_text; ptr = help_text;
switch (kbinput) { switch (kbinput) {
#ifndef NANO_SMALL #ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
case KEY_MOUSE: case KEY_MOUSE:
do_mouse(); do_mouse();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment