From 3634716374c2adde10e2979c0ad5aad14457bc8f Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Wed, 16 Feb 2011 17:19:48 +0200 Subject: [PATCH] Moved input_map, listbox_map and dialog_map variables to 'lib' subdirectory. Signed-off-by: Slava Zanko --- lib/widget/dialog.c | 3 ++- lib/widget/dialog.h | 3 +++ lib/widget/input.c | 3 ++- lib/widget/input.h | 4 ++++ lib/widget/listbox.c | 9 ++++----- lib/widget/listbox.h | 4 ++++ src/keybind-defaults.c | 1 + src/keybind-defaults.h | 1 + src/setup.c | 4 ++-- 9 files changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index f8f383416..bf0a75224 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -42,7 +42,6 @@ #include "src/help.h" /* interactive_display() */ #include "src/filemanager/layout.h" #include "src/execute.h" /* suspend_cmd() */ -#include "src/keybind-defaults.h" /*** global variables ****************************************************************************/ @@ -64,6 +63,8 @@ int fast_refresh = 0; /* left click outside of dialog closes it */ int mouse_close_dialog = 0; +const global_keymap_t *dialog_map; + /*** file scope macro definitions ****************************************************************/ /*** file scope type declarations ****************************************************************/ diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index 468be9e68..7aa112aab 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -31,6 +31,7 @@ #include "lib/global.h" #include "lib/hook.h" /* hook_t */ +#include "lib/keybind.h" /* global_keymap_t */ /*** defined constants ***************************************************************************/ @@ -162,6 +163,8 @@ extern hook_t *idle_hook; extern int fast_refresh; extern int mouse_close_dialog; +extern const global_keymap_t *dialog_map; + /*** declarations of public functions ************************************************************/ /* draw box in window */ diff --git a/lib/widget/input.c b/lib/widget/input.c index bcce66a1c..46eb66b9e 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -55,12 +55,13 @@ #include "src/main.h" /* home_dir */ #include "src/filemanager/midnight.h" /* current_panel */ #include "src/clipboard.h" /* copy_file_to_ext_clip, paste_to_file_from_ext_clip */ -#include "src/keybind-defaults.h" /* input_map */ /*** global variables ****************************************************************************/ int quote = 0; +const global_keymap_t *input_map; + /*** file scope macro definitions ****************************************************************/ #define LARGE_HISTORY_BUTTON 1 diff --git a/lib/widget/input.h b/lib/widget/input.h index 702e39da9..25b6c2295 100644 --- a/lib/widget/input.h +++ b/lib/widget/input.h @@ -6,6 +6,8 @@ #ifndef MC__WIDGET_INPUT_H #define MC__WIDGET_INPUT_H +#include "lib/keybind.h" /* global_keymap_t */ + /*** typedefs(not structures) and defined constants **********************************************/ /* For history load-save functions */ @@ -68,6 +70,8 @@ typedef struct extern int quote; +extern const global_keymap_t *input_map; + /*** declarations of public functions ************************************************************/ WInput *input_new (int y, int x, const int *input_colors, diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c index 51602c9e8..a2353ba2f 100644 --- a/lib/widget/listbox.c +++ b/lib/widget/listbox.c @@ -44,11 +44,10 @@ #include "lib/keybind.h" /* global_keymap_t */ #include "lib/widget.h" -/* TODO: these includes should be removed! */ -#include "src/keybind-defaults.h" /* listbox_map */ - /*** global variables ****************************************************************************/ +const global_keymap_t *listbox_map; + /*** file scope macro definitions ****************************************************************/ /*** file scope type declarations ****************************************************************/ @@ -122,8 +121,8 @@ listbox_draw (WListbox * l, gboolean focused) const gboolean disabled = (((Widget *) l)->options & W_DISABLED) != 0; const int normalc = disabled ? DISABLED_COLOR : h->color[DLG_COLOR_NORMAL]; int selc = - disabled ? DISABLED_COLOR : focused ? h->color[DLG_COLOR_HOT_FOCUS] : h-> - color[DLG_COLOR_FOCUS]; + disabled ? DISABLED_COLOR : focused ? h-> + color[DLG_COLOR_HOT_FOCUS] : h->color[DLG_COLOR_FOCUS]; GList *le; int pos; diff --git a/lib/widget/listbox.h b/lib/widget/listbox.h index 6513ff83f..88424848b 100644 --- a/lib/widget/listbox.h +++ b/lib/widget/listbox.h @@ -6,6 +6,8 @@ #ifndef MC__WIDGET_LISTBOX_H #define MC__WIDGET_LISTBOX_H +#include "lib/keybind.h" /* global_keymap_t */ + /*** typedefs(not structures) and defined constants **********************************************/ /*** enums ***************************************************************************************/ @@ -53,6 +55,8 @@ typedef struct WListbox /*** global variables defined in .c file *********************************************************/ +extern const global_keymap_t *listbox_map; + /*** declarations of public functions ************************************************************/ WListbox *listbox_new (int y, int x, int height, int width, gboolean deletable, lcback_fn callback); diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index b46b87e46..7d3237130 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -57,6 +57,7 @@ const global_keymap_t *input_map = NULL; const global_keymap_t *listbox_map = NULL; const global_keymap_t *tree_map = NULL; const global_keymap_t *help_map = NULL; + #ifdef USE_INTERNAL_EDIT const global_keymap_t *editor_map = NULL; const global_keymap_t *editor_x_map = NULL; diff --git a/src/keybind-defaults.h b/src/keybind-defaults.h index 53b324afb..038b910c8 100644 --- a/src/keybind-defaults.h +++ b/src/keybind-defaults.h @@ -40,6 +40,7 @@ extern const global_keymap_t *input_map; extern const global_keymap_t *listbox_map; extern const global_keymap_t *tree_map; extern const global_keymap_t *help_map; + #ifdef USE_INTERNAL_EDIT extern const global_keymap_t *editor_map; extern const global_keymap_t *editor_x_map; diff --git a/src/setup.c b/src/setup.c index 23b3a2929..2d7dad78a 100644 --- a/src/setup.c +++ b/src/setup.c @@ -35,6 +35,8 @@ #include "lib/mcconfig.h" #include "lib/fileloc.h" #include "lib/timefmt.h" +#include "lib/util.h" +#include "lib/widget.h" #include "lib/vfs/vfs.h" @@ -45,8 +47,6 @@ #include "src/vfs/fish/fish.h" #endif -#include "lib/util.h" -#include "lib/widget.h" #ifdef HAVE_CHARSET #include "lib/charsets.h" #endif