diff --git a/edit/ChangeLog b/edit/ChangeLog index 99b370a02..a3a6d8a06 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,5 +1,7 @@ 2005-05-20 Pavel Roskin + * edit.h: Eliminate global EditMenuBar. Fix all dependencies. + * edit.h: Eliminate edit_message_dialog macro - it's used inconsistently. Fix all callers to use query_dialog(). diff --git a/edit/edit.h b/edit/edit.h index 319ef9d7c..2a9b7df5b 100644 --- a/edit/edit.h +++ b/edit/edit.h @@ -107,12 +107,13 @@ struct macro { struct WEdit; typedef struct WEdit WEdit; +struct Menu; int edit_drop_hotkey_menu (WEdit *e, int key); void edit_menu_cmd (WEdit *e); -void edit_init_menu_emacs (void); -void edit_init_menu_normal (void); -void edit_done_menu (void); +void edit_init_menu_emacs (struct Menu *EditMenuBar[]); +void edit_init_menu_normal (struct Menu *EditMenuBar[]); +void edit_done_menu (struct Menu *EditMenuBar[]); void menu_save_mode_cmd (void); int edit_raw_key_query (const char *heading, const char *query, int cancel); int edit_file (const char *_file, int line); @@ -249,8 +250,6 @@ void edit_execute_cmd (WEdit *edit, int command, int char_for_insertion); extern int edit_key_emulation; extern WEdit *wedit; -struct Menu; -extern struct Menu *EditMenuBar[]; struct WMenu; extern struct WMenu *edit_menubar; diff --git a/edit/editmenu.c b/edit/editmenu.c index efb20a229..4bef9d3eb 100644 --- a/edit/editmenu.c +++ b/edit/editmenu.c @@ -409,9 +409,7 @@ static menu_entry OptMenu[] = #define menu_entries(x) sizeof(x)/sizeof(menu_entry) -struct Menu *EditMenuBar[N_menus]; - -void edit_init_menu_normal (void) +void edit_init_menu_normal (struct Menu *EditMenuBar[]) { EditMenuBar[0] = create_menu (_(" File "), FileMenu, menu_entries (FileMenu), "[Internal File Editor]"); @@ -425,7 +423,7 @@ void edit_init_menu_normal (void) "[Internal File Editor]"); } -void edit_init_menu_emacs (void) +void edit_init_menu_emacs (struct Menu *EditMenuBar[]) { EditMenuBar[0] = create_menu (_(" File "), FileMenuEmacs, menu_entries (FileMenuEmacs), "[Internal File Editor]"); @@ -439,7 +437,7 @@ void edit_init_menu_emacs (void) "[Internal File Editor]"); } -void edit_done_menu (void) +void edit_done_menu (struct Menu *EditMenuBar[]) { int i; for (i = 0; i < N_menus; i++) diff --git a/edit/editwidget.c b/edit/editwidget.c index 6552b57df..0b31ab4a9 100644 --- a/edit/editwidget.c +++ b/edit/editwidget.c @@ -47,6 +47,7 @@ WEdit *wedit; struct WMenu *edit_menubar; +struct Menu *EditMenuBar[N_menus]; int column_highlighting = 0; @@ -216,10 +217,10 @@ edit_file (const char *_file, int line) switch (edit_key_emulation) { case EDIT_KEY_EMULATION_NORMAL: - edit_init_menu_normal (); /* editmenu.c */ + edit_init_menu_normal (EditMenuBar); /* editmenu.c */ break; case EDIT_KEY_EMULATION_EMACS: - edit_init_menu_emacs (); /* editmenu.c */ + edit_init_menu_emacs (EditMenuBar); /* editmenu.c */ break; } edit_menubar = menubar_new (0, 0, COLS, EditMenuBar, N_menus); @@ -230,7 +231,7 @@ edit_file (const char *_file, int line) run_dlg (edit_dlg); - edit_done_menu (); /* editmenu.c */ + edit_done_menu (EditMenuBar); /* editmenu.c */ destroy_dlg (edit_dlg);