Drop "--enable-ncmouse" option from configure script

This commit is contained in:
Christophe Grenier 2022-04-08 13:49:07 +02:00
parent 37286661af
commit baefe2b3e4
6 changed files with 5 additions and 286 deletions

View file

@ -6,7 +6,7 @@ AC_INIT([testdisk],[7.2-WIP],[grenier@cgsecurity.org])
AC_LANG(C)
sinclude(acx_pthread.m4)
sinclude(mkdir.m4)
TESTDISKDATE="May 2021"
TESTDISKDATE="April 2022"
AC_SUBST(TESTDISKDATE)
AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release])
AC_CONFIG_AUX_DIR(config)
@ -213,15 +213,6 @@ AC_ARG_ENABLE([qt],
esac],
[use_qt=true])
AC_ARG_ENABLE([ncmouse],
AS_HELP_STRING([--enable-ncmouse],[enable use of mouse in ncurses(default is NO)]),
[case "${enableval}" in
yes) use_ncmouse=true ;;
no) use_ncmouse=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-mouse]) ;;
esac],
[use_ncmouse=false])
AC_ARG_ENABLE([dfxml],
AS_HELP_STRING([--disable-dfxml]),
[case "${enableval}" in
@ -570,17 +561,6 @@ if test "x$with_ncurses" != "xno"; then
photorec_LDADD="$photorec_LDADD -l${tinfo_lib}"
fi
fi
if test "$use_ncmouse" = "true";
then
ac_save_LIBS="$LIBS"
LIBS="$LIBS $photorec_LDADD"
AC_CHECK_FUNCS(mousemask)
LIBS="$ac_save_LIBS"
if test "$ac_cv_func_mousemask" = "yes";
then
AC_DEFINE([ENABLE_MOUSE],1,[Define to 1 if the ncurses mouse interface is enabled])
fi
fi
ac_save_LIBS="$LIBS"
LIBS="$LIBS $photorec_LDADD"
AC_CHECK_FUNCS([assume_default_colors])
@ -779,7 +759,7 @@ then
then
AC_MSG_WARN(No uuid_create or uuid_generate function in library libuuid or uuidgen function present)
else
AC_MSG_ERROR(No uuid_create or uuid_generate function in library libuuid or uuidgen function present)
AC_MSG_ERROR(No uuid_create or uuid_generate function in library libuuid or uuidgen function present. Either fix it or use "--enable-missing-uuid-ok")
fi
fi
@ -841,7 +821,7 @@ if test "x$have_ewf" != "xyes"; then
fi
fi
#-Wconversion -Wmissing-noreturn -ffunction-sections -Wl,--gc-sections -Wl,--print-gc-sections
for option in -Wdeclaration-after-statement -Wall -Wextra -MD -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wwrite-strings -W -Wcast-align -Waggregate-return -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wsign-compare -Wnested-externs -Winline -Wdisabled-optimization -Wfloat-equal -Wmissing-format-attribute -Wmultichar -Wc++-compat -Wformat=2 -Wunreachable-code -Wvla
for option in -Wdeclaration-after-statement -Wall -Wextra -MD -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wwrite-strings -W -Wcast-align -Waggregate-return -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wsign-compare -Wnested-externs -Winline -Wdisabled-optimization -Wfloat-equal -Wmissing-format-attribute -Wmultichar -Wc++-compat -Wformat=2 -Wtrampolines -Wunreachable-code -Wvla
do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
@ -856,7 +836,7 @@ done
unset option
AC_LANG_PUSH([C++])
for option in -Wall -MD -Wpointer-arith -Wmissing-declarations -Wshadow -Wwrite-strings -W -Wcast-align -Wcast-qual -Wundef -Wredundant-decls -Wsign-compare -Wdisabled-optimization -Wmissing-format-attribute -Wmultichar -Wformat=2 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -Wvla
for option in -Wall -MD -Wpointer-arith -Wmissing-declarations -Wshadow -Wwrite-strings -W -Wcast-align -Wcast-qual -Wundef -Wredundant-decls -Wsign-compare -Wdisabled-optimization -Wmissing-format-attribute -Wmultichar -Wformat=2 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -Wtrampolines -Wvla
do
SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $option"

View file

@ -411,42 +411,6 @@ void ask_location(char *dst_directory, const unsigned int dst_size, const char *
{
const int command=wgetch(window);
quit=ASK_LOCATION_WAITKEY;
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
if(command==KEY_MOUSE)
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
{
if(event.y => line_base - 1 && event.y < old_LINES)
{
const int pos_num_old=pos_num;
/* Disk selection */
while(pos_num > event.y - (line_base - offset) && current_file->prev!=&dir_list.list)
{
current_file=current_file->prev;
pos_num--;
}
while(pos_num < event.y - (line_base - offset) && current_file->next!=&dir_list.list)
{
current_file=current_file->next;
pos_num++;
}
quit=ASK_LOCATION_UPDATE;
if(((event.bstate & BUTTON1_CLICKED) && pos_num==pos_num_old) ||
(event.bstate & BUTTON1_DOUBLE_CLICKED))
command=KEY_ENTER;
}
#if 0
else if(file_walker!=&dir_list.list && file_walker->next!=&dir_list.list)
{
}
#endif
}
}
}
#endif
switch(command)
{
case 'y':
@ -595,4 +559,3 @@ static int aff_txt(const int line, WINDOW *window, const char *_format, ...)
return next_line;
}
#endif

View file

@ -272,74 +272,6 @@ static int wmenuUpdate(WINDOW *window, const int yinfo, int y, int x, const stru
return y;
}
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
int menu_to_command(const unsigned int yinfo, const unsigned int y_org, const unsigned int x_org, const struct MenuItem *menuItems, const unsigned int itemLength, const char *available, const int menuType, const unsigned int y_real, const unsigned int x_real)
{
unsigned int y=y_org;
unsigned int x=x_org;
unsigned int i;
const unsigned int lmargin = x;
const unsigned int ymargin = y;
unsigned int lenNameMax=0;
for( i = 0; menuItems[i].key!=0; i++ )
if(strchr(available, menuItems[i].key)!=NULL )
{
const unsigned int lenName = strlen( menuItems[i].name );
if(lenNameMax<lenName && lenName < itemLength)
lenNameMax=lenName;
}
/* Print available buttons */
for( i = 0; menuItems[i].key!=0; i++ )
{
unsigned int lenName;
const char *mi;
const unsigned int x_old=x;
const unsigned int y_old=y;
/* Search next available button */
while( menuItems[i].key!=0 && strchr(available, menuItems[i].key)==NULL )
{
i++;
}
if( menuItems[i].key==0 ) break; /* No more menu items */
mi = menuItems[i].name;
lenName = strlen( mi );
/* Calculate position for the next item */
if( menuType & MENU_VERT )
{
y += 1;
if( y >= yinfo - 1)
{
y = ymargin;
x += (lenName < itemLength?itemLength:lenName) + MENU_SPACING;
if( menuType & MENU_BUTTON ) x += 2;
}
if(y_old==y_real && x_old <= x_real && x_real < x+(lenName < itemLength?itemLength:lenName) + MENU_SPACING)
{
return menuItems[i].key;
}
}
else
{
x += (lenName < itemLength?itemLength:lenName) + MENU_SPACING;
if( menuType & MENU_BUTTON ) x += 2;
if(y_old==y_real && x_old <= x_real && x_real < x)
{
return menuItems[i].key;
}
if( x + lmargin + 12 > COLUMNS )
{
x = lmargin;
y ++ ;
}
}
}
log_info("menu_to_command not found\n");
return 0;
}
#endif
/* This function takes a list of menu items, lets the user choose one *
* and returns the value keyboard shortcut of the selected menu item */
@ -372,10 +304,6 @@ int wmenuSelect_ext(WINDOW *window, const int yinfo, const int y, const int x, c
*current = 0;
}
}
#if defined(ALL_MOUSE_EVENTS) && defined(ENABLE_MOUSE)
if((menuType & MENU_ACCEPT_OTHERS)==0 )
mousemask(ALL_MOUSE_EVENTS, NULL);
#endif
/* Repeat until allowable choice has been made */
while( key==0 )
@ -413,22 +341,6 @@ int wmenuSelect_ext(WINDOW *window, const int yinfo, const int y, const int x, c
/* Cursor keys */
switch(key)
{
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
case KEY_MOUSE:
if((menuType & MENU_ACCEPT_OTHERS)==0 )
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
{
key = menu_to_command(yinfo, y_org, x_org, menuItems, itemLength,
available, menuType, event.y, event.x);
}
}
}
break;
#endif
case KEY_UP:
if( (menuType & MENU_VERT)!=0 )
{
@ -1219,18 +1131,6 @@ int check_enter_key_or_s(WINDOW *window)
{
switch(wgetch_nodelay(window))
{
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
case KEY_MOUSE:
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
return 1;
}
}
break;
#endif
case KEY_ENTER:
#ifdef PADENTER
case PADENTER:

View file

@ -114,9 +114,6 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
wprintw(stdscr,"comes with ABSOLUTELY NO WARRANTY.");
wmove(stdscr,7,0);
wprintw(stdscr,"Select a media (use Arrow keys, then press Enter):");
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
mousemask(ALL_MOUSE_EVENTS, NULL);
#endif
for(i=0,element_disk=list_disk;
element_disk!=NULL && i<offset+NBR_DISK_MAX;
i++, element_disk=element_disk->next)
@ -173,39 +170,6 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
}
command = wmenuSelect_ext(stdscr, INTER_NOTE_Y-1, INTER_DISK_Y, INTER_DISK_X, menuMain, 8,
menu_options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, &menu,&real_key);
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
if(command == KEY_MOUSE)
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
{
if(event.y >=8 && event.y<8+NBR_DISK_MAX)
{
const int pos_num_old=pos_num;
/* Disk selection */
while(pos_num > event.y-(8-offset) && current_disk->prev!=NULL)
{
current_disk=current_disk->prev;
pos_num--;
}
while(pos_num < event.y-(8-offset) && current_disk->next!=NULL)
{
current_disk=current_disk->next;
pos_num++;
}
if(((event.bstate & BUTTON1_CLICKED) && pos_num==pos_num_old) ||
(event.bstate & BUTTON1_DOUBLE_CLICKED))
command='O';
}
else
command = menu_to_command(INTER_NOTE_Y-1, INTER_DISK_Y, INTER_DISK_X, menuMain, 8,
menu_options, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, event.y, event.x);
}
}
}
#endif
switch(command)
{
case KEY_UP:

View file

@ -139,21 +139,6 @@ static void recovery_finished(disk_t *disk, const partition_t *partition, const
{
switch(wgetch(stdscr))
{
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
case KEY_MOUSE:
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
{
if(event.x < sizeof("[ Quit ]") && event.y==22)
return ;
}
}
}
break;
#endif
case KEY_ENTER:
#ifdef PADENTER
case PADENTER:
@ -599,9 +584,6 @@ void interface_file_select_ncurses(file_enable_t *files_enable)
{0,NULL,NULL}
};
log_info("\nInterface File Select\n");
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
mousemask(ALL_MOUSE_EVENTS, NULL);
#endif
while(1)
{
int i;
@ -665,42 +647,6 @@ void interface_file_select_ncurses(file_enable_t *files_enable)
wprintw(stdscr," to save the settings");
command = wmenuSelect(stdscr, LINES-1, INTER_FSELECT_Y, INTER_FSELECT_X, menuAdv, 8,
"q", MENU_BUTTON | MENU_ACCEPT_OTHERS, menu);
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
if(command == KEY_MOUSE)
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
{
if(event.y >=6 && event.y<6+INTER_FSELECT)
{
if(((event.bstate & BUTTON1_CLICKED) && current_element_num == event.y-6-offset) ||
(event.bstate & BUTTON1_DOUBLE_CLICKED))
command='+';
/* Disk selection */
while(current_element_num > event.y-(6-offset) && current_element_num>0)
{
current_element_num--;
}
while(current_element_num < event.y-(6-offset) && files_enable[current_element_num+1].file_hint!=NULL)
{
current_element_num++;
}
}
else if(event.y==5 && event.x>=4 && event.x<=4+sizeof("Previous") &&
offset>0)
command=KEY_PPAGE;
else if(event.y==6+INTER_FSELECT && event.x>=4 && event.x<=4+sizeof("Next") &&
files_enable[i].file_hint!=NULL)
command=KEY_NPAGE;
else
command = menu_to_command(LINES-1, INTER_FSELECT_Y, INTER_FSELECT_X, menuAdv, 8,
"q", MENU_BUTTON | MENU_ACCEPT_OTHERS, event.y, event.x);
}
}
}
#endif
switch(command)
{
case KEY_UP:

View file

@ -106,7 +106,7 @@ void menu_photorec(struct ph_param *params, struct ph_options *options, alloc_da
#ifdef HAVE_NCURSES
ask_location(dst_path, sizeof(dst_path), "Please select a destination to save the recovered files to.\nDo not choose to write the files to the same partition they were stored on.", "");
#else
td_getcwd(&dst_path, sizeof(dst_path));
td_getcwd(dst_path, sizeof(dst_path));
#endif
if(dst_path[0]!='\0')
{
@ -160,9 +160,6 @@ void menu_photorec(struct ph_param *params, struct ph_options *options, alloc_da
wmove(stdscr,4,0);
wprintw(stdscr,"%s",params->disk->description_short(params->disk));
mvwaddstr(stdscr,6,0,msg_PART_HEADER_LONG);
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
mousemask(ALL_MOUSE_EVENTS, NULL);
#endif
for(i=0,element=list_part; element!=NULL && i<offset+INTER_SELECT;element=element->next,i++)
{
if(i<offset)
@ -187,37 +184,6 @@ void menu_photorec(struct ph_param *params, struct ph_options *options, alloc_da
wprintw(stdscr, "Next");
command = wmenuSelect(stdscr, INTER_SELECT_Y+1, INTER_SELECT_Y, INTER_SELECT_X, menuMain, 8,
(options->expert==0?"SOFQ":"SOFGQ"), MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, menu);
#if defined(KEY_MOUSE) && defined(ENABLE_MOUSE)
if(command == KEY_MOUSE)
{
MEVENT event;
if(getmouse(&event) == OK)
{ /* When the user clicks left mouse button */
if((event.bstate & BUTTON1_CLICKED) || (event.bstate & BUTTON1_DOUBLE_CLICKED))
{
if(event.y >=7 && event.y<7+INTER_SELECT)
{
/* Disk selection */
while(current_element_num > event.y-(7-offset) && current_element->prev!=NULL)
{
current_element=current_element->prev;
current_element_num--;
}
while(current_element_num < event.y-(7-offset) && current_element->next!=NULL)
{
current_element=current_element->next;
current_element_num++;
}
if(event.bstate & BUTTON1_DOUBLE_CLICKED)
command='S';
}
else
command = menu_to_command(INTER_SELECT_Y+1, INTER_SELECT_Y, INTER_SELECT_X, menuMain, 8,
(options->expert==0?"SOFQ":"SOFGQ"), MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, event.y, event.x);
}
}
}
#endif
switch(command)
{
case KEY_UP: