* dlg.h: Move movefn definition ...
* win.h: ... where it's used. Remove unused definitions. * win.c: Remove unused code. * key.h: Include mouse.h, don't rely on others doing it. * widget.h: Include dlg.h. Remove Tk-only fields. * widget.c: Remove Tk-only fields.
Этот коммит содержится в:
родитель
7e8c2e9abe
Коммит
e0194b11a0
@ -1,5 +1,12 @@
|
||||
2002-11-11 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* dlg.h: Move movefn definition ...
|
||||
* win.h: ... where it's used. Remove unused definitions.
|
||||
* win.c: Remove unused code.
|
||||
* key.h: Include mouse.h, don't rely on others doing it.
|
||||
* widget.h: Include dlg.h. Remove Tk-only fields.
|
||||
* widget.c: Remove Tk-only fields.
|
||||
|
||||
* panel.h: Simplify interdependencies between headers. Use
|
||||
forward declarations for structures.
|
||||
* widget.h: Declare struct WListbox.
|
||||
|
@ -212,8 +212,6 @@ Widget *find_widget_type (Dlg_head *h, callback_fn signature);
|
||||
#define widget_want_hotkey(w,i) widget_option(w, W_WANT_HOTKEY, i)
|
||||
#define widget_want_postkey(w,i) widget_option(w, W_WANT_POSTKEY, i)
|
||||
|
||||
typedef void (*movefn)(void *, int);
|
||||
|
||||
/* Used in load_prompt() */
|
||||
void update_cursor (Dlg_head *h);
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef __KEY_H
|
||||
#define __KEY_H
|
||||
|
||||
#include "mouse.h" /* Gpm_Event */
|
||||
|
||||
void init_key (void);
|
||||
void init_key_input_fd (void);
|
||||
void done_key (void);
|
||||
|
@ -669,7 +669,6 @@ gauge_new (int y, int x, int shown, int max, int current, char *tkname)
|
||||
max = 1; /* I do not like division by zero :) */
|
||||
g->max = max;
|
||||
g->current = current;
|
||||
g->pixels = 0;
|
||||
widget_want_cursor (g->widget, 0);
|
||||
return g;
|
||||
}
|
||||
@ -1486,7 +1485,6 @@ handle_char (WInput *in, int c_code)
|
||||
}
|
||||
free_completions (in);
|
||||
v = insert_char (in, c_code);
|
||||
in->inserted_one = c_code;
|
||||
}
|
||||
if (!disable_update)
|
||||
update_input (in, 1);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef __WIDGET_H
|
||||
#define __WIDGET_H
|
||||
|
||||
#include "dlg.h" /* Widget */
|
||||
|
||||
#define C_BOOL 1
|
||||
#define C_CHANGE 2
|
||||
|
||||
@ -47,12 +49,6 @@ typedef struct WGauge {
|
||||
int shown;
|
||||
int max;
|
||||
int current;
|
||||
int pixels; /* Only used for Tk:
|
||||
* We keep the pixel size in the C code
|
||||
* so that we can compute quickly compute
|
||||
* the size of the rectangle in the Tk
|
||||
* canvas. Using Tcl would be too slow.
|
||||
*/
|
||||
} WGauge;
|
||||
|
||||
typedef struct hist_entry {
|
||||
@ -81,7 +77,6 @@ typedef struct {
|
||||
int need_push; /* need to push the current Input on hist? */
|
||||
char **completions; /* Possible completions array */
|
||||
int completion_flags; /* INPUT_COMPLETE* bitwise flags(complete.h) */
|
||||
int inserted_one; /* TK: just one char inserted, nothing fancy */
|
||||
char *history_name; /* name of history for loading and saving */
|
||||
} WInput;
|
||||
|
||||
|
65
src/win.c
65
src/win.c
@ -32,66 +32,6 @@
|
||||
#include "key.h" /* XCTRL and ALT macros */
|
||||
#include "layout.h"
|
||||
|
||||
typedef void (*fnptr)(void);
|
||||
|
||||
typedef struct Fkey_Table_List {
|
||||
fnptr actions[11];
|
||||
struct Fkey_Table_List *next;
|
||||
int has_labels;
|
||||
} Fkey_Table_List;
|
||||
|
||||
static Fkey_Table_List *fkey_table_list = NULL;
|
||||
|
||||
/* Return values: 0 = not a fkey, other = was a fkey */
|
||||
int check_fkeys (int c)
|
||||
{
|
||||
int fkey;
|
||||
|
||||
if (!fkey_table_list)
|
||||
return 0;
|
||||
|
||||
switch (c){
|
||||
case KEY_F(1):
|
||||
fkey = 1;
|
||||
break;
|
||||
case KEY_F(2):
|
||||
fkey = 2;
|
||||
break;
|
||||
case KEY_F(3):
|
||||
fkey = 3;
|
||||
break;
|
||||
case KEY_F(4):
|
||||
fkey = 4;
|
||||
break;
|
||||
case KEY_F(5):
|
||||
fkey = 5;
|
||||
break;
|
||||
case KEY_F(6):
|
||||
fkey = 6;
|
||||
break;
|
||||
case KEY_F(7):
|
||||
fkey = 7;
|
||||
break;
|
||||
case KEY_F(8):
|
||||
fkey = 8;
|
||||
break;
|
||||
case KEY_F(9):
|
||||
fkey = 9;
|
||||
break;
|
||||
case KEY_F(10):
|
||||
fkey = 10;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
if (fkey_table_list->actions [fkey]){
|
||||
fkey_table_list->actions [fkey] ();
|
||||
return fkey;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return values: 0 = not a movement key, 1 = was a movement key */
|
||||
int check_movement_keys (int c, int additional, int page_size, void *data,
|
||||
movefn backfn, movefn forfn, movefn topfn,
|
||||
@ -171,11 +111,6 @@ void mc_noraw_mode (void)
|
||||
noraw ();
|
||||
}
|
||||
|
||||
int is_quit_char (int c)
|
||||
{
|
||||
return (c == XCTRL('g') || (c == ESC_CHAR) || (c == KEY_F(10)));
|
||||
}
|
||||
|
||||
/* This table is a mapping between names and the constants we use
|
||||
* We use this to allow users to define alternate definitions for
|
||||
* certain keys that may be missing from the terminal database
|
||||
|
@ -1,13 +1,8 @@
|
||||
#ifndef __WIN_H
|
||||
#define __WIN_H
|
||||
|
||||
/* Window utilities */
|
||||
#include "dlg.h"
|
||||
|
||||
/* Labels at the screen bottom */
|
||||
|
||||
/* Keys managing */
|
||||
int check_fkeys (int c);
|
||||
typedef void (*movefn)(void *, int);
|
||||
int check_movement_keys (int c, int additional, int page_size, void *,
|
||||
movefn backfn, movefn forfn, movefn topfn, movefn bottomfn);
|
||||
int lookup_key (char *keyname);
|
||||
@ -16,9 +11,7 @@ int lookup_key (char *keyname);
|
||||
extern int xterm_flag;
|
||||
void do_enter_ca_mode (void);
|
||||
void do_exit_ca_mode (void);
|
||||
#define wclr(w) wclrn(w, 0)
|
||||
|
||||
void mc_raw_mode (void);
|
||||
void mc_noraw_mode (void);
|
||||
void mc_init_cbreak (void);
|
||||
#endif /* __WIN_H */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user