mc/src/main.h

192 lines
4.9 KiB
C
Raw Normal View History

1998-02-27 07:54:42 +03:00
#ifndef __MAIN_H
#define __MAIN_H
/* Toggling functions */
void toggle_fast_reload (void);
void toggle_mix_all_files (void);
1998-02-27 07:54:42 +03:00
void toggle_show_backup (void);
void toggle_show_hidden (void);
enum {
RP_NOCLEAR,
RP_CLEAR
};
#define UP_OPTIMIZE 0
#define UP_RELOAD 1
#define UP_ONLY_CURRENT 2
#define UP_KEEPSEL (char *) -1
extern int quote;
extern volatile int quit;
/* Execute functions: the base and the routines that use it */
void do_execute (const char *shell, const char *command, int internal_command);
#define execute_internal(command,args) do_execute (command, args, 1)
/* Execute functions that use the shell to execute */
void shell_execute (char *command, int flags);
1998-02-27 07:54:42 +03:00
void execute (char *command);
/* This one executes a shell */
void exec_shell (void);
1998-02-27 07:54:42 +03:00
void subshell_chdir (char *command);
/* See main.c for details on these variables */
extern int mark_moves_down;
extern int auto_menu;
extern int pause_after_run;
extern int auto_save_setup;
extern int use_internal_view;
extern int use_internal_edit;
extern char *view_one_file;
extern char *edit_one_file;
1998-02-27 07:54:42 +03:00
extern int fast_reload_w;
extern int clear_before_exec;
extern int mou_auto_repeat;
extern char *other_dir;
extern int mouse_move_pages;
extern int mouse_move_pages_viewer;
#ifdef HAVE_CHARSET
extern int source_codepage;
extern int display_codepage;
#else
1998-02-27 07:54:42 +03:00
extern int eight_bit_clean;
extern int full_eight_bits;
#endif /* !HAVE_CHARSET */
1998-02-27 07:54:42 +03:00
extern int confirm_view_dir;
extern int fast_refresh;
extern int navigate_with_arrows;
extern int force_ugly_line_drawing;
1998-02-27 07:54:42 +03:00
extern int drop_menus;
extern int cd_symlinks;
extern int show_all_if_ambiguous;
extern int slow_terminal;
extern int update_prompt; /* To comunicate with subshell */
extern int confirm_delete;
extern int confirm_execute;
extern int confirm_exit;
extern int confirm_overwrite;
extern int force_colors;
extern int boot_current_is_left;
extern int acs_vline;
extern int acs_hline;
extern int use_file_to_check_type;
extern int searching;
extern int vfs_use_limit;
extern int alternate_plus_minus;
extern int only_leading_plus_minus;
extern int ftpfs_directory_timeout;
extern int output_starts_shell;
extern int midnight_shutdown;
extern char search_buffer [256];
extern char cmd_buf [512];
These are a bunch of changes to fix CORBA and session management. They are almost complete (i.e. to handle all nitty gritty cases), but they seem to be working OK right now. SM should be much more stable now. Please tell me if you find any weird behavior - Federico 1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdesktop-icon.c (desktop_icon_realize): Remove the WM_CLIENT_LEADER property from icon windows so that window managers will not store SM information for them. * gnome-open-dialog.c: Added missing #includes. * gdesktop-init.c (desktop_init_at): Removed an unused variable. * gdesktop.h: Added some missing prototypes. * gmain.h: Added some missing prototypes. * Makefile.in: Added gsession.[ch] to the list of sources. * gmain.c (create_panels): Consider whether we have a CORBA server and session management. * gdesktop.c: #include "gdesktop-init.h" * gdesktop.c: Added a missing cast to GNOME_DIALOG. * gmain.c (create_panels): Removed the run_desktop global variable. * glayout.c (create_container): Set the wmclass of the panel to include its unique ID. * gsession.[ch]: New file with the functions that deal with session management. * glayout.c (gnome_exit): Use session_set_restart(). * gcorba.c (corba_init): Now returns an int with an error value. (corba_init_server): Initialize the server properly. Fixed all the object implementation code. (corba_create_window): New function used to create a window with the CORBA server. * gmain.c (gnome_check_super_user): Now the check for running as root is done here. There should be no GUI code in src/. 1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> * dlg.c (dlg_run_done): Do not call the callback of a NULL current widget. * setup.h: Added missing prototype for setup_init(). * filegui.c (check_progress_buttons): Added a missing return value. * dlg.c (remove_widget): Added a missing return value. * main.c: Removed the global directory_list variable. Removed the main_corba_register_server() function. * main.h: Removed the global run_desktop variable. * panel.h: Now the panel structure has a unique numerical ID used for session management. * screen.c (panel_new): Maintain a unique ID for each panel. * main.c (maybe_display_linksdir): Handle display of the desktop init dir here. (main): Call gnome_check_super_user(). (init_corba_with_args): Call corba_init_server(). * main.c (init_corba_with_args): Do CORBA initialization here. Also removed the global force_activation option. 1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> * vfs.c (vfs_add_current_stamps): Only do stamping of the panels if they exist. * mcserv.c: #include <sys/wait.h> (get_client): Put `#ifdef __EMX__' around an otherwise-unused variable. * utilvfs.c (vfs_split_url): Fix NULL <-> 0 confusion when comparing characters. * ftpfs.c (retrieve_dir): Removed unused variable dot_dot_found. * extfs.c (extfs_init): Assign `key' to c, not `&key'.
1999-03-30 10:09:56 +04:00
extern char *cmdline_geometry;
1998-02-27 07:54:42 +03:00
/* The menu panels */
extern int is_right; /* If the selected menu was the right */
#define MENU_PANEL (is_right ? right_panel : left_panel)
#define SELECTED_IS_PANEL (get_display_type (is_right ? 1 : 0) == view_listing)
/* Useful macros to avoid too much typing */
#define cpanel get_current_panel()
#define opanel get_other_panel()
typedef void (*key_callback) ();
/* FIXME: We have to leave this type ambiguous, because `key_callback'
is used both for functions that take an argument and ones that don't.
That ought to be cleared up. */
/* The keymaps are of this type */
typedef struct {
int key_code;
key_callback fn;
} key_map;
void update_panels (int force_update, char *current_file);
1998-02-27 07:54:42 +03:00
void create_panels (void);
void repaint_screen (void);
void outrefresh_screen (void);
void suspend_cmd (void);
void do_update_prompt (void);
extern char *shell;
/* directory specified on command line for startup */
extern char *this_dir;
1998-02-27 07:54:42 +03:00
void clr_scr (void);
void restore_console (void);
enum cd_enum {
cd_parse_command,
cd_exact
};
int do_cd (char *new_dir, enum cd_enum cd_type); /* For find.c */
void change_panel (void);
void init_sigchld (void); /* For subshell.c */
int load_prompt (int fd, void *unused);
1998-02-27 07:54:42 +03:00
void save_cwds_stat (void);
void copy_prog_name (void);
int quiet_quit_cmd (void); /* For cmd.c and command.c */
1998-02-27 07:54:42 +03:00
void untouch_bar (void);
void touch_bar (void);
void load_hint (void);
1998-02-27 07:54:42 +03:00
void print_vfs_message(char *msg, ...)
__attribute__ ((format (printf, 1, 2)));
1998-02-27 07:54:42 +03:00
2000-05-04 Valery Kornienkov <vlk@dimavb.st.simbirsk.su> * src/user.c: Add macro %k it is block file name Add macro %e it is error file name Add macro %i it is cursor column indent of spaces, only for edit Add macro %y, it is syntax of current file in editor, only for edit Add condition y , it is syntax pattern of current file in edit Add macro %x it is extension of current file Add macro %m it is current menu filename 2000-05-04 Valery Kornienkov <vlk@dimavb.st.simbirsk.su> * gtkedit/editcmd.c: Modify External Formatter (was C indent formatter) . Autocreate a scripts in home, from templates /usr/lib/mc/edit.indent.rc, edit.ispell.rc, etc. Remove leading and trailing spaces into _(""), (the message of David H. Martin <dmartina@usa.net>) 2000-05-05 Valery Kornienkov <vlk@dimavb.st.simbirsk.su> * src/user.c: Add condition (x filename) into mc.menu . for "Open next a free console" and like. 2000-05-04 Valery Kornienkov <vlk@dimavb.st.simbirsk.su> src/user.c: fix segfault in chunk_alloc of glibc, when into condition of .mnu we have quoted space. (~.mc/menu: + f \.\ test$). 2000-05-04 Valery Kornienkov <vlk@dimavb.st.simbirsk.su> * gtkedit/edit.c: Add ability user edit menus: system: /usr/lib/mc/cedit.menu, * gtkedit/editmenu.c: home: ~/.cedit.menu, local: .cedit.menu Marked block is access now from an user edit menu Access ~/.cedit/cooledit.block for insert to cursor place from user edit menu. Created system cedit.menu 2000-05-04 Valery Kornienkov <vlk@dimavb.st.simbirsk.su> * gtkedit/editdraw.c: Improved a status string of cool editor for best understand, and to add char,hex view. 2000-05-04 Richard Hestilow <hestgray@ionet.net> * gnome/gdesktop.c: Fixes snap to grid.
2000-05-09 05:18:27 +04:00
void edit_user_menu_cmd (void);
1998-02-27 07:54:42 +03:00
extern char *prompt;
extern char *mc_home;
char *get_mc_lib_dir (void);
1998-02-27 07:54:42 +03:00
int maybe_cd (int char_code, int move_up_dir);
void do_possible_cd (char *dir);
#ifdef WANT_WIDGETS
extern WButtonBar *the_bar;
extern WLabel *the_prompt;
extern WLabel *the_hint;
extern Dlg_head *midnight_dlg;
extern Dlg_head *edit_dlg;
extern WLabel *process_status;
struct WMenu;
extern struct WMenu *the_menubar;
#endif /* WANT_WIDGETS */
1998-02-27 07:54:42 +03:00
void edition_pre_exec (void);
void edition_post_exec (void);
1998-12-03 00:27:27 +03:00
void done_menu (void);
void init_menu (void);
void exec_shell (void);
#ifdef NATIVE_WIN32
1998-02-27 07:54:42 +03:00
# define MC_BASE ""
#else
# define MC_BASE "/.mc/"
#endif /* !NATIVE_WIN32 */
1998-12-15 22:53:55 +03:00
/* Back hack to define the following routines only if the client code
* has included panel.h
*/
#ifdef __PANEL_H
#ifndef PANEL_DEFS_DONE
#define PANEL_DEFS_DONE
void directory_history_add (WPanel *panel, char *s);
int do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type);
int midnight_callback (struct Dlg_head *h, int id, int msg);
#endif /* !PANEL_DEFS_DONE */
#endif /* __PANEL_H */
#endif /* !__MAIN_H */