From e0194b11a0e3fe8d8533d19ccfc1c0a5fdc63699 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 11 Nov 2002 07:12:03 +0000 Subject: [PATCH] * 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. --- src/ChangeLog | 7 ++++++ src/dlg.h | 2 -- src/key.h | 2 ++ src/widget.c | 2 -- src/widget.h | 9 ++----- src/win.c | 65 --------------------------------------------------- src/win.h | 9 +------ 7 files changed, 12 insertions(+), 84 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 44573bd25..60c170897 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2002-11-11 Pavel Roskin + * 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. diff --git a/src/dlg.h b/src/dlg.h index f7ff95a0e..6bd7eb636 100644 --- a/src/dlg.h +++ b/src/dlg.h @@ -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); diff --git a/src/key.h b/src/key.h index ee40f530d..2bcc5bc6a 100644 --- a/src/key.h +++ b/src/key.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); diff --git a/src/widget.c b/src/widget.c index 62720bf70..02182bfe5 100644 --- a/src/widget.c +++ b/src/widget.c @@ -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); diff --git a/src/widget.h b/src/widget.h index fe43ac034..456f080e7 100644 --- a/src/widget.h +++ b/src/widget.h @@ -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; diff --git a/src/win.c b/src/win.c index e127707f1..bc1448462 100644 --- a/src/win.c +++ b/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 diff --git a/src/win.h b/src/win.h index e3e0c3e59..34c3285f5 100644 --- a/src/win.h +++ b/src/win.h @@ -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 */