remove the rest of the references to mice from global visibility

This commit is contained in:
anon 2024-11-13 12:58:12 +01:00
parent ad397639da
commit df60477f7c
4 changed files with 58 additions and 63 deletions

View File

@ -59,9 +59,6 @@ bool caseless; /* ignore letter case when searching */
bool *change; /* change this line */
char newpat[PATLEN + 1]; /* new pattern */
/* Internal prototypes: */
static void scrollbar(MOUSE *p);
/* read references from a file */
bool readrefs(char *filename) {
FILE *file;
@ -96,43 +93,6 @@ bool readrefs(char *filename) {
return (true);
}
/* scrollbar actions */
static void scrollbar(MOUSE *p) {
// XXX
///* reposition list if it makes sense */
// if (totallines == 0) {
// return;
// }
// switch (p->percent) {
// case 101: /* scroll down one page */
// if (nextline + mdisprefs > totallines) {
// nextline = totallines - mdisprefs + 1;
// }
// break;
// case 102: /* scroll up one page */
// nextline = topline - mdisprefs;
// if (nextline < 1) {
// nextline = 1;
// }
// break;
// case 103: /* scroll down one line */
// nextline = topline + 1;
// break;
// case 104: /* scroll up one line */
// if (topline > 1) {
// nextline = topline - 1;
// }
// break;
// default:
// nextline = p->percent * totallines / 100;
// }
////seekline(nextline);
}
/* count the references found */
void countrefs(void) {
char file[PATHLEN + 1]; /* file name */

View File

@ -60,15 +60,6 @@
typedef void (*sighandler_t)(int);
typedef struct { /* mouse action */
int button;
int percent;
int x1;
int y1;
int x2;
int y2;
} MOUSE;
struct cmd { /* command history struct */
struct cmd *prev, *next; /* list ptrs */
int field; /* input field number */
@ -200,16 +191,11 @@ extern struct keystruct {
struct keystruct *next;
} keyword[];
/* mouse.c global data */
extern bool mouse; /* mouse interface */
/* readline.c global data */
extern char *rl_line_buffer;
extern char input_line[PATLEN + 1];
extern int rl_point;
// extern bool unixpcmouse; /* UNIX PC mouse interface */
/* cscope functions called from more than one function or between files */
char *filepath(char *file);
@ -310,8 +296,7 @@ bool readrefs(char *filename);
bool search(const char *query);
bool writerefsfound(void);
int findinit(const char *pattern_);
MOUSE *getmouseaction(char leading_char);
int findinit(const char *pattern_);
int egrep(char *file, FILE *output, char *format);
int hash(const char * ss);

View File

@ -376,8 +376,6 @@ int normal_global_input(const int c) {
}
int change_input(const int c) {
MOUSE *p; /* mouse data */
switch(c) {
case '*': /* invert page */
for(unsigned i = 0; i < (nextline-1); i++) {
@ -391,17 +389,19 @@ int change_input(const int c) {
}
window_change |= CH_RESULT;
break;
case ctrl('X'): /* mouse selection */
/* MOUSE SELECTION
case ctrl('X'):
MOUSE *p;
if((p = getmouseaction(DUMMYCHAR)) == NULL) {
break; /* unknown control sequence */
break; // unknown control sequence
}
/* if the button number is a scrollbar tag */
// if the button number is a scrollbar tag
if(p->button == '0') {
// scrollbar(p);
break;
}
/* find the selected line */
/* NOTE: the selection is forced into range */
// find the selected line
// NOTE: the selection is forced into range
{
int i;
for(i = disprefs - 1; i > 0; --i) {
@ -410,6 +410,7 @@ int change_input(const int c) {
change[i] = !change[i];
}
break;
*/
case ctrl('D'):
changestring(input_line, newpat, change, totallines);
free(change);

View File

@ -47,6 +47,17 @@ void mousemenu(void);
void mouseinit(void);
void mousereinit(void);
typedef struct { /* mouse action */
int button;
int percent;
int x1;
int y1;
int x2;
int y2;
} MOUSE;
MOUSE *getmouseaction(char leading_char);
// extern bool unixpcmouse; /* UNIX PC mouse interface */
extern int LINES;
@ -430,3 +441,41 @@ int process_mouse() {
return false;
}
// NOTE: this comes from command.c
// /* scrollbar actions */
// static void scrollbar(MOUSE *p) {
// // XXX
// ///* reposition list if it makes sense */
// // if (totallines == 0) {
// // return;
// // }
// // switch (p->percent) {
//
// // case 101: /* scroll down one page */
// // if (nextline + mdisprefs > totallines) {
// // nextline = totallines - mdisprefs + 1;
// // }
// // break;
//
// // case 102: /* scroll up one page */
// // nextline = topline - mdisprefs;
// // if (nextline < 1) {
// // nextline = 1;
// // }
// // break;
//
// // case 103: /* scroll down one line */
// // nextline = topline + 1;
// // break;
//
// // case 104: /* scroll up one line */
// // if (topline > 1) {
// // nextline = topline - 1;
// // }
// // break;
// // default:
// // nextline = p->percent * totallines / 100;
// // }
// ////seekline(nextline);
// }