mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 21:06:52 +03:00
* edit.h: Eliminate global EditMenuBar. Fix all dependencies.
This commit is contained in:
parent
7511729690
commit
b5b70bce10
@ -1,5 +1,7 @@
|
|||||||
2005-05-20 Pavel Roskin <proski@gnu.org>
|
2005-05-20 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* edit.h: Eliminate global EditMenuBar. Fix all dependencies.
|
||||||
|
|
||||||
* edit.h: Eliminate edit_message_dialog macro - it's used
|
* edit.h: Eliminate edit_message_dialog macro - it's used
|
||||||
inconsistently. Fix all callers to use query_dialog().
|
inconsistently. Fix all callers to use query_dialog().
|
||||||
|
|
||||||
|
@ -107,12 +107,13 @@ struct macro {
|
|||||||
|
|
||||||
struct WEdit;
|
struct WEdit;
|
||||||
typedef struct WEdit WEdit;
|
typedef struct WEdit WEdit;
|
||||||
|
struct Menu;
|
||||||
|
|
||||||
int edit_drop_hotkey_menu (WEdit *e, int key);
|
int edit_drop_hotkey_menu (WEdit *e, int key);
|
||||||
void edit_menu_cmd (WEdit *e);
|
void edit_menu_cmd (WEdit *e);
|
||||||
void edit_init_menu_emacs (void);
|
void edit_init_menu_emacs (struct Menu *EditMenuBar[]);
|
||||||
void edit_init_menu_normal (void);
|
void edit_init_menu_normal (struct Menu *EditMenuBar[]);
|
||||||
void edit_done_menu (void);
|
void edit_done_menu (struct Menu *EditMenuBar[]);
|
||||||
void menu_save_mode_cmd (void);
|
void menu_save_mode_cmd (void);
|
||||||
int edit_raw_key_query (const char *heading, const char *query, int cancel);
|
int edit_raw_key_query (const char *heading, const char *query, int cancel);
|
||||||
int edit_file (const char *_file, int line);
|
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 int edit_key_emulation;
|
||||||
|
|
||||||
extern WEdit *wedit;
|
extern WEdit *wedit;
|
||||||
struct Menu;
|
|
||||||
extern struct Menu *EditMenuBar[];
|
|
||||||
struct WMenu;
|
struct WMenu;
|
||||||
extern struct WMenu *edit_menubar;
|
extern struct WMenu *edit_menubar;
|
||||||
|
|
||||||
|
@ -409,9 +409,7 @@ static menu_entry OptMenu[] =
|
|||||||
|
|
||||||
#define menu_entries(x) sizeof(x)/sizeof(menu_entry)
|
#define menu_entries(x) sizeof(x)/sizeof(menu_entry)
|
||||||
|
|
||||||
struct Menu *EditMenuBar[N_menus];
|
void edit_init_menu_normal (struct Menu *EditMenuBar[])
|
||||||
|
|
||||||
void edit_init_menu_normal (void)
|
|
||||||
{
|
{
|
||||||
EditMenuBar[0] = create_menu (_(" File "), FileMenu, menu_entries (FileMenu),
|
EditMenuBar[0] = create_menu (_(" File "), FileMenu, menu_entries (FileMenu),
|
||||||
"[Internal File Editor]");
|
"[Internal File Editor]");
|
||||||
@ -425,7 +423,7 @@ void edit_init_menu_normal (void)
|
|||||||
"[Internal File Editor]");
|
"[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),
|
EditMenuBar[0] = create_menu (_(" File "), FileMenuEmacs, menu_entries (FileMenuEmacs),
|
||||||
"[Internal File Editor]");
|
"[Internal File Editor]");
|
||||||
@ -439,7 +437,7 @@ void edit_init_menu_emacs (void)
|
|||||||
"[Internal File Editor]");
|
"[Internal File Editor]");
|
||||||
}
|
}
|
||||||
|
|
||||||
void edit_done_menu (void)
|
void edit_done_menu (struct Menu *EditMenuBar[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < N_menus; i++)
|
for (i = 0; i < N_menus; i++)
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
WEdit *wedit;
|
WEdit *wedit;
|
||||||
struct WMenu *edit_menubar;
|
struct WMenu *edit_menubar;
|
||||||
|
struct Menu *EditMenuBar[N_menus];
|
||||||
|
|
||||||
int column_highlighting = 0;
|
int column_highlighting = 0;
|
||||||
|
|
||||||
@ -216,10 +217,10 @@ edit_file (const char *_file, int line)
|
|||||||
|
|
||||||
switch (edit_key_emulation) {
|
switch (edit_key_emulation) {
|
||||||
case EDIT_KEY_EMULATION_NORMAL:
|
case EDIT_KEY_EMULATION_NORMAL:
|
||||||
edit_init_menu_normal (); /* editmenu.c */
|
edit_init_menu_normal (EditMenuBar); /* editmenu.c */
|
||||||
break;
|
break;
|
||||||
case EDIT_KEY_EMULATION_EMACS:
|
case EDIT_KEY_EMULATION_EMACS:
|
||||||
edit_init_menu_emacs (); /* editmenu.c */
|
edit_init_menu_emacs (EditMenuBar); /* editmenu.c */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
edit_menubar = menubar_new (0, 0, COLS, EditMenuBar, N_menus);
|
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);
|
run_dlg (edit_dlg);
|
||||||
|
|
||||||
edit_done_menu (); /* editmenu.c */
|
edit_done_menu (EditMenuBar); /* editmenu.c */
|
||||||
|
|
||||||
destroy_dlg (edit_dlg);
|
destroy_dlg (edit_dlg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user