1
1

Fully eliminate all references to HAVE_X and HAVE_GNOME.

Этот коммит содержится в:
Pavel Roskin 2001-11-14 23:20:37 +00:00
родитель 5fac744c29
Коммит fa89635b51
22 изменённых файлов: 51 добавлений и 512 удалений

Просмотреть файл

@ -1,5 +1,7 @@
2001-11-14 Pavel Roskin <proski@gnu.org>
Fully eliminate all references to HAVE_X and HAVE_GNOME.
* dir.c (do_sort): Correctly handle the case when there is no
".." entry (i.e. panelized mode).

Просмотреть файл

@ -398,9 +398,7 @@ background_attention (int fd, void *closure)
do_refresh ();
mc_refresh ();
#ifndef HAVE_X
doupdate ();
#endif /* !HAVE_X */
return 0;
}

Просмотреть файл

@ -93,7 +93,6 @@ static struct {
{ TY+10,TX+2 }
};
#ifndef HAVE_X
static void
chown_refresh (void)
{
@ -127,7 +126,6 @@ chown_refresh (void)
dlg_move (ch_dlg, TY, TX + 1);
addstr (_(" File "));
}
#endif
static char *
next_file (void)
@ -142,11 +140,9 @@ static int
chown_callback (Dlg_head * h, int Par, int Msg)
{
switch (Msg) {
#ifndef HAVE_X
case DLG_DRAW:
chown_refresh ();
break;
#endif
}
return 0;
}

Просмотреть файл

@ -1040,16 +1040,7 @@ void link_cmd (void)
void symlink_cmd (void)
{
char *filename = NULL;
if (is_a_desktop_panel (cpanel)) {
gint i;
for (i = 0; i < cpanel->count; i++)
if (cpanel->dir.list [i].f.marked) {
filename = cpanel->dir.list [i].fname;
break;
}
} else {
filename = selection (cpanel)->fname;
}
filename = selection (cpanel)->fname;
if (filename) {
do_link (1, filename);
@ -1064,16 +1055,7 @@ void edit_symlink_cmd (void)
int i;
char *dest, *q;
if (is_a_desktop_panel (cpanel)) {
gint i;
for (i = 0; i < cpanel->count; i++)
if (cpanel->dir.list [i].f.marked) {
p = cpanel->dir.list [i].fname;
break;
}
} else {
p = selection (cpanel)->fname;
}
p = selection (cpanel)->fname;
q = g_strdup_printf (_(" Symlink `%s\' points to: "), name_trunc (p, 32));

Просмотреть файл

@ -803,11 +803,9 @@ void free_completions (WInput *in)
in->completions = NULL;
}
#ifndef HAVE_GNOME
static int query_height, query_width;
static WInput *input;
static int min_end;
#endif /* !HAVE_GNOME */
static int start, end;
static int insert_text (WInput *in, char *text, int len)
@ -840,7 +838,6 @@ static int insert_text (WInput *in, char *text, int len)
return len != 0;
}
#ifndef HAVE_GNOME
static int query_callback (Dlg_head * h, int Par, int Msg)
{
switch (Msg) {
@ -944,7 +941,6 @@ static int querylist_callback (void *data)
{
return 1;
}
#endif /* !HAVE_GNOME */
#define DO_INSERTION 1
#define DO_QUERY 2
@ -977,7 +973,6 @@ complete_engine (WInput *in, int what_to_do)
* because we do not have a Gtk dialog for it. Gtk-ted does not like
* this; if we enable this code, it will crash.
*/
#ifndef HAVE_GNOME
if ((what_to_do & DO_QUERY) && in->completions [1]) {
int maxlen = 0, i, count = 0;
int x, y, w, h;
@ -1036,10 +1031,6 @@ complete_engine (WInput *in, int what_to_do)
if (i == B_USER)
return 1;
}
#else
if (what_to_do & DO_QUERY)
beep ();
#endif
} else
beep ();
return 0;

Просмотреть файл

@ -1,7 +1,6 @@
#ifndef __CONS_SAVER_H
#define __CONS_SAVER_H
#ifndef HAVE_X
enum {
CONSOLE_INIT = '1',
CONSOLE_DONE,
@ -21,10 +20,4 @@ int look_for_rxvt_extensions (void);
/* Used only in the principal program */
extern int cons_saver_pid;
#else /* HAVE_X */
# define console_flag 0
# define show_console_contents(w,f,l) { }
# define handle_console(x) { }
#endif
#endif /* __CONS_SAVER_H */

Просмотреть файл

@ -76,7 +76,6 @@ void do_refresh (void)
if (we_are_background)
return;
#ifndef HAVE_GNOME
if (!refresh_list)
return;
else {
@ -86,7 +85,6 @@ void do_refresh (void)
do_complete_refresh (refresh_list);
}
}
#endif
}

Просмотреть файл

@ -32,16 +32,8 @@
/* "$Id$" */
/*
* If true show files starting with a dot.
*
* In GNOME we default to not showing them.
*/
#ifdef HAVE_GNOME
int show_dot_files = 0;
#else
/* If true show files starting with a dot */
int show_dot_files = 1;
#endif
/* If true show files ending in ~ */
int show_backups = 0;

Просмотреть файл

@ -13,9 +13,7 @@ void flush_extension_file (void);
# define MC_USER_EXT "mc.ext"
# define MC_LIB_EXT "mc.ext"
#else
# ifndef HAVE_GNOME
# define MC_USER_EXT ".mc/bindings"
# define MC_LIB_EXT "mc.ext"
# endif
# define MC_USER_EXT ".mc/bindings"
# define MC_LIB_EXT "mc.ext"
#endif
#endif

Просмотреть файл

@ -547,12 +547,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
int retval;
retval = make_symlink (ctx, src_path, dst_path);
#ifdef HAVE_GNOME
if (retval == FILE_CONT) {
gnome_metadata_delete (dst_path);
gnome_metadata_copy (src_path, dst_path);
}
#endif /* !HAVE_GNOME */
return retval;
}
@ -585,10 +579,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
return temp_status;
}
#endif /* !__os2__ */
#ifdef HAVE_GNOME
gnome_metadata_delete (dst_path);
gnome_metadata_copy (src_path, dst_path);
#endif /* HAVE_GNOME */
return FILE_CONT;
}
}
@ -631,11 +621,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
do not create a security hole. FIXME: You have security hole
here, btw. Imagine copying to /tmp and symlink attack :-( */
#ifdef HAVE_GNOME
if (!ctx->do_append)
gnome_metadata_delete (dst_path);
#endif /* HAVE_GNOME */
while ((dest_desc = mc_open (dst_path, O_WRONLY |
(ctx->do_append ? O_APPEND : (O_CREAT | O_TRUNC)), 0600)) < 0){
return_status = file_error (_(" Cannot create target file \"%s\" \n %s "), dst_path);
@ -808,10 +793,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
}
#endif /* !OS2_NT */
#ifdef HAVE_GNOME
gnome_metadata_delete (dst_path);
gnome_metadata_copy (src_path, dst_path);
#endif /* HAVE_GNOME */
/*
* .ado: according to the XPG4 standard, the file must be closed before
* chmod can be invoked
@ -911,10 +892,6 @@ copy_dir_dir (FileOpContext *ctx, char *s, char *d, int toplevel,
if (move_over){
if (mc_rename (s, d) == 0){
#ifdef HAVE_GNOME
gnome_metadata_delete (d);
gnome_metadata_copy (s, d);
#endif /* HAVE_GNOME */
g_free (parent_dirs);
return FILE_CONT;
}
@ -957,11 +934,6 @@ copy_dir_dir (FileOpContext *ctx, char *s, char *d, int toplevel,
goto ret;
}
#ifdef HAVE_GNOME
gnome_metadata_delete (dest_dir);
gnome_metadata_copy (s, dest_dir);
#endif /* HAVE_GNOME */
lp = g_new (struct link, 1);
mc_stat (dest_dir, &buf);
lp->vfs = vfs_type (dest_dir);
@ -1075,9 +1047,6 @@ move_file_file (FileOpContext *ctx, char *s, char *d,
{
struct stat src_stats, dst_stats;
int return_status = FILE_CONT;
#ifdef HAVE_GNOME
int delete_metadata = TRUE;
#endif /* HAVE_GNOME */
if (file_progress_show_source (ctx, s) == FILE_ABORT
|| file_progress_show_target (ctx, d) == FILE_ABORT)
@ -1133,21 +1102,12 @@ move_file_file (FileOpContext *ctx, char *s, char *d,
if (!ctx->do_append) {
if (S_ISLNK (src_stats.st_mode) && ctx->stable_symlinks) {
if ((return_status = make_symlink (ctx, s, d)) == FILE_CONT) {
#ifdef HAVE_GNOME
gnome_metadata_delete (d);
gnome_metadata_rename (s, d);
delete_metadata = FALSE;
#endif /* HAVE_GNOME */
goto retry_src_remove;
} else
return return_status;
}
if (mc_rename (s, d) == 0){
#ifdef HAVE_GNOME
gnome_metadata_delete (d);
gnome_metadata_rename (s, d);
#endif /* HAVE_GNOME */
return FILE_CONT;
}
}
@ -1185,10 +1145,6 @@ move_file_file (FileOpContext *ctx, char *s, char *d,
goto retry_src_remove;
return return_status;
}
#ifdef HAVE_GNOME
if (delete_metadata)
gnome_metadata_delete (s);
#endif /* HAVE_GNOME */
if (return_status == FILE_CONT)
return_status = progress_update_one (ctx,
@ -1266,10 +1222,6 @@ move_dir_dir (FileOpContext *ctx, char *s, char *d,
retry_rename:
if (mc_rename (s, destdir) == 0){
#ifdef HAVE_GNOME
gnome_metadata_delete (destdir);
gnome_metadata_rename (s, destdir);
#endif /* HAVE_GNOME */
return_status = FILE_CONT;
goto ret;
}
@ -1350,9 +1302,7 @@ erase_file (FileOpContext *ctx, char *s, off_t *progress_count, double *progress
if (return_status != FILE_RETRY)
return return_status;
}
#ifdef HAVE_GNOME
gnome_metadata_delete (s);
#endif /* HAVE_GNOME */
if (progress_count)
return progress_update_one (ctx, progress_count, progress_bytes, buf.st_size,
is_toplevel_file);
@ -1412,9 +1362,7 @@ recursive_erase (FileOpContext *ctx, char *s, off_t *progress_count, double *pro
goto retry_rmdir;
return return_status;
}
#ifdef HAVE_GNOME
gnome_metadata_delete (s);
#endif /* HAVE_GNOME */
return FILE_CONT;
}
@ -1482,9 +1430,7 @@ erase_dir (FileOpContext *ctx, char *s, off_t *progress_count, double *progress_
goto retry_rmdir;
return error;
}
#ifdef HAVE_GNOME
gnome_metadata_delete (s);
#endif /* HAVE_GNOME */
return FILE_CONT;
}
@ -1514,9 +1460,7 @@ erase_dir_iff_empty (FileOpContext *ctx, char *s)
goto retry_rmdir;
return error;
}
#ifdef HAVE_GNOME
gnome_metadata_delete (s);
#endif /* HAVE_GNOME */
return FILE_CONT;
}
@ -1673,7 +1617,6 @@ static char *op_names1 [] = { N_("1Copy"), N_("1Move"), N_("1Delete") };
int fmd_xlen = FMD_XLEN;
#ifndef HAVE_GNOME
/*
* These are formats for building a prompt. Parts encoded as follows:
* %o - operation from op_names1
@ -1687,12 +1630,6 @@ int fmd_xlen = FMD_XLEN;
static char* one_format = N_("%o %f \"%s\"%m");
/* xgettext:no-c-format */
static char* many_format = N_("%o %d %f%m");
#else
/* xgettext:no-c-format */
static char* one_format = N_("%o %f \"%s\"%e");
/* xgettext:no-c-format */
static char* many_format = N_("%o %d %f%e");
#endif /* HAVE_GNOME */
static char* prompt_parts [] =
{
N_("file"), N_("files"), N_("directory"), N_("directories"),
@ -1798,15 +1735,6 @@ panel_operate_generate_prompt (WPanel* panel, int operation, int only_one,
return source;
}
#ifdef HAVE_GNOME
extern FileProgressStatus file_progress_query_replace_policy (FileOpContext *ctx,
gboolean dialog_needed);
extern int file_delete_query_recursive (FileOpContext *ctx,
enum OperationMode mode,
gchar *s);
#endif /* HAVE_GNOME */
/**
* panel_operate:
*
@ -1865,13 +1793,10 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
if (operation == OP_DELETE && confirm_delete){
if (know_not_what_am_i_doing)
query_set_sel (1);
#ifdef HAVE_GNOME
i = query_dialog (_(op_names [operation]), cmd_buf,
D_ERROR, 2, _("Yes"), _("No"));
#else
i = query_dialog (_(op_names [operation]), cmd_buf,
D_ERROR, 2, _("&Yes"), _("&No"));
#endif /* !HAVE_GNOME */
if (i != 0) {
file_op_context_destroy (ctx);
return 0;
@ -1954,7 +1879,6 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
file_op_context_create_ui (ctx, operation, 1);
/* This code is only called by the tree and panel code */
#ifndef HAVE_GNOME
if (only_one){
/* We now have ETA in all cases */
@ -2011,11 +1935,10 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
}
} /* Copy or move operation */
if (value == FILE_CONT && !(is_a_desktop_panel(panel)))
if (value == FILE_CONT)
unmark_files (panel);
} else {
/* Many files */
#endif /* !HAVE_GNOME */
/* Check destination for copy or move operation */
if (operation != OP_DELETE){
retry_many_dst_stat:
@ -2099,15 +2022,8 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
if (value == FILE_ABORT)
goto clean_up;
#ifdef HAVE_GNOME
/* if panel->selection is -1, then we have a desktop panel. */
if (value == FILE_CONT && !(is_a_desktop_panel(panel)))
do_file_mark (panel, i, 0);
#else
if (value == FILE_CONT)
do_file_mark (panel, i, 0);
#endif /* !HAVE_GNOME */
if (file_progress_show_count (ctx, count, ctx->progress_count) == FILE_ABORT)
goto clean_up;
@ -2120,9 +2036,7 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
mc_refresh ();
} /* Loop for every file */
#ifndef HAVE_GNOME
} /* Many files */
#endif /* !HAVE_GNOME */
clean_up:
/* Clean up */
@ -2225,7 +2139,6 @@ files_error (char *format, char *file1, char *file2)
return do_file_error (cmd_buf);
}
#ifndef HAVE_GNOME
static int
real_query_recursive (FileOpContext *ctx, enum OperationMode mode, char *s)
{
@ -2283,7 +2196,6 @@ real_query_recursive (FileOpContext *ctx, enum OperationMode mode, char *s)
return FILE_ABORT;
}
}
#endif /* !HAVE_GNOME */
#ifdef WITH_BACKGROUND
static int
@ -2298,17 +2210,10 @@ do_file_error (char *str)
static int
query_recursive (FileOpContext *ctx, char *s)
{
#ifdef HAVE_GNOME
if (we_are_background)
return parent_call (file_delete_query_recursive, ctx, 1, strlen (s), s);
else
return file_delete_query_recursive (ctx, Foreground, s);
#else
if (we_are_background)
return parent_call (real_query_recursive, ctx, 1, strlen (s), s);
else
return real_query_recursive (ctx, Foreground, s);
#endif /* !HAVE_GNOME */
}
static int
@ -2335,11 +2240,7 @@ do_file_error (char *str)
static int
query_recursive (FileOpContext *ctx, char *s)
{
#ifdef HAVE_GNOME
return file_delete_query_recursive (ctx, Foreground, s);
#else
return real_query_recursive (ctx, Foreground, s);
#endif /* !HAVE_GNOME */
}
static int

Просмотреть файл

@ -1,4 +1,3 @@
/* GNOME already handles the intenrationalization issues */
#ifndef _MC_I18N_H_
#define _MC_I18N_H_
@ -6,25 +5,22 @@
#undef ENABLE_NLS
#endif
#ifndef HAVE_GNOME
# ifdef ENABLE_NLS
# include <libintl.h>
# define _(String) gettext (String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
# else
/* Stubs that do something close enough. */
# define textdomain(String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory)
# define _(String) (String)
# define N_(String) (String)
# endif
#endif /* !HAVE_GNOME */
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(String) gettext (String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#else /* Stubs that do something close enough. */
# define textdomain(String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory)
# define _(String) (String)
# define N_(String) (String)
#endif /* !ENABLE_NLS */
#endif /* _MC_I18N_H_ */

Просмотреть файл

@ -81,9 +81,7 @@ extern key_code_name_t key_name_conv_tab [];
extern int we_are_background;
/* Set keypad mode (xterm and linux console only) */
#ifndef HAVE_X
void numeric_keypad_mode (void);
void application_keypad_mode (void);
#endif
void numeric_keypad_mode (void);
void application_keypad_mode (void);
#endif /* __KEY_H */

Просмотреть файл

@ -2753,7 +2753,7 @@ main (int argc, char *argv [])
#ifdef HAVE_SUBSHELL_SUPPORT
/* Don't use subshell in GNOME and when invoked as a viewer or editor */
/* Don't use subshell when invoked as a viewer or editor */
if (edit_one_file || view_one_file)
use_subshell = 0;

Просмотреть файл

@ -109,15 +109,10 @@ extern char search_buffer [256];
extern char cmd_buf [512];
extern char *cmdline_geometry;
#ifdef HAVE_GNOME
#define MENU_PANEL get_current_panel ()
#define SELECTED_IS_PANEL 1
#else
/* 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)
#endif /* !HAVE_GNOME */
/* Useful macros to avoid too much typing */
#define cpanel get_current_panel()

Просмотреть файл

@ -9,22 +9,6 @@
#define LIST_TYPES 5
#ifdef HAVE_GNOME
/* Keep the following in sync with setup.c */
/* Number of columns that each mode requires */
#define GMC_COLUMNS_BRIEF 2 /* brief view */
#define GMC_COLUMNS_DETAILED 4 /* detailed view */
#define GMC_COLUMNS_CUSTOM 15 /* custom view */
#define GMC_COLUMNS (GMC_COLUMNS_BRIEF + GMC_COLUMNS_DETAILED + GMC_COLUMNS_CUSTOM)
/* Default column widths */
extern int default_column_width[GMC_COLUMNS];
/* custom listing format */
extern char *default_user_format;
#endif
enum list_types {
list_full, /* Name, size, perm/date */
list_brief, /* Name */
@ -139,67 +123,6 @@ typedef struct {
char search_buffer [256];
void *port_ui; /* UI stuff specific to each GUI port */
#ifdef HAVE_GNOME
/* These are standard GtkWidgets */
void *xwindow; /* The toplevel window */
void *table;
void *view_table;
void *pane;
void *list;
void *tree;
void *icons;
void *notebook;
void *status;
void *ministatus;
void *tree_scrolled_window;
void *filter_w; /* A WInput* */
void *current_dir; /* A WInput* */
int estimated_total;
/* default column layout */
int column_width[GMC_COLUMNS];
/* navigation buttons */
void *back_b;
void *fwd_b;
void *up_b;
/* Used during drag and drop */
int maybe_start_drag;
int click_x, click_y;
/* View menu and toolbar items */
void **view_menu_items;
void **view_toolbar_items;
int dragging;
/* Unique numerical ID for session management */
int id;
/* Used for scrolling nicely during drags */
int timer_id;
int drag_motion_x;
int drag_motion_y;
/* The highlighted row in the tree for drag and drop */
int drag_tree_row;
int drag_tree_timeout_id;
file_entry *drag_tree_fe;
/* Whether the user is dragging something over the tree */
int drag_tree_dragging_over;
void *panel_listbox; /* container for the list */
int is_a_desktop_panel;
/* CORBA servant */
void *servant;
#endif
} WPanel;
WPanel *panel_new (const char *panel_name);
@ -217,16 +140,8 @@ extern int show_mini_info;
extern int panel_scroll_pages;
#define selection(p) (&(p->dir.list [p->selected]))
#ifdef HAVE_GNOME
#define is_a_desktop_panel(p) ((p->is_a_desktop_panel))
/* Evil empty trash_hack */
extern int is_trash_panel;
#else
#define is_a_desktop_panel(p) FALSE
#endif
extern int fast_reload;
extern int extra_info;
/*#define ITEMS(p) ((p)->view_type == view_brief ? (p)->lines *2 : (p)->lines)
@ -255,7 +170,6 @@ void show_dir (WPanel *panel);
void panel_set_sort_order (WPanel *panel, sortfn *sort_order);
void panel_re_sort (WPanel *panel);
/* NOTE: Have to be ifdefed for HAVE_X */
void x_panel_set_size (int index);
void x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel);
void x_fill_panel (WPanel *panel);
@ -330,7 +244,6 @@ void do_file_mark_range (WPanel *panel, int r1, int r2);
int do_enter_on_file_entry (file_entry *fe);
int do_enter (WPanel *panel);
/* NOTE: Have to be ifdefed for HAVE_X */
void x_panel_select_item (WPanel *panel, int index, int val);
void x_select_item (WPanel *panel);
void x_unselect_item (WPanel *panel);

Просмотреть файл

@ -60,7 +60,6 @@ void do_external_panelize (char *command);
#define B_ADD B_USER
#define B_REMOVE B_USER + 1
#ifndef HAVE_X
static WListbox *l_panelize;
static Dlg_head *panelize_dlg;
static int last_listitem;
@ -76,7 +75,6 @@ static struct {
{ B_REMOVE, NORMAL_BUTTON, 0, 16, N_("&Remove"), "r"},
{ B_ENTER, DEFPUSH_BUTTON, 0, 0, N_("Pane&lize"),"l"},
};
#endif /* !HAVE_X */
static char *panelize_section = "Panelize";
@ -87,7 +85,6 @@ static struct panelize {
struct panelize *next;
} *panelize = NULL;
#ifndef HAVE_X
static char* panelize_title = N_(" External panelize ");
static void
@ -211,7 +208,6 @@ static void panelize_done (void)
destroy_dlg (panelize_dlg);
repaint_screen ();
}
#endif /* !HAVE_X */
static void add2panelize (char *label, char *command)
{
@ -239,7 +235,6 @@ static void add2panelize (char *label, char *command)
}
}
#ifndef HAVE_X
void
add2panelize_cmd (void)
{
@ -325,7 +320,6 @@ external_panelize (void)
panelize_done ();
}
#endif /* !HAVE_X */
void load_panelize (void)
{

Просмотреть файл

@ -97,13 +97,10 @@ static int panel_event (Gpm_Event *event, WPanel *panel);
# define unfocus_unselect_item(x) unselect_item(x)
#endif
#ifdef HAVE_X
# define set_colors(x)
#else
# define x_create_panel(x,y,z) 1;
# define x_panel_load_index(p,x)
# define x_panel_select_item(a,b,c)
# define x_panel_destroy(p)
#define x_create_panel(x,y,z) 1;
#define x_panel_load_index(p,x)
#define x_panel_select_item(a,b,c)
#define x_panel_destroy(p)
void
set_colors (WPanel *panel)
@ -112,7 +109,6 @@ set_colors (WPanel *panel)
if (hascolors)
attrset (NORMAL_COLOR);
}
#endif
#ifndef ICONS_PER_ROW
# define ICONS_PER_ROW(x) 1
@ -131,7 +127,6 @@ delete_format (format_e *format)
}
}
#ifndef HAVE_X
/* This code relies on the default justification!!! */
static void
add_permission_string (char *dest, int width, file_entry *fe, int attr, int color, int is_octal)
@ -162,7 +157,6 @@ add_permission_string (char *dest, int width, file_entry *fe, int attr, int colo
addch (dest[i]);
}
}
#endif /* HAVE_X */
/* String representations of various file attributes */
/* name */
@ -368,11 +362,7 @@ string_dot (file_entry *fe, int len)
return ".";
}
#ifdef HAVE_GNOME
# define GT 2
#else
# define GT 1
#endif
#define GT 1
static struct {
char *id;
@ -527,7 +517,6 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
cdest = to_buffer (cdest, format->just_mode, len, txt);
length += len;
#ifndef HAVE_X
attrset (color);
if (permission_mode && !strcmp(format->id, "perm"))
@ -537,17 +526,12 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
else
addstr (old_pos);
#endif
} else {
#ifndef HAVE_X
if (attr == SELECTED || attr == MARKED_SELECTED)
attrset (SELECTED_COLOR);
else
attrset (NORMAL_COLOR);
one_vline ();
#else
*cdest++ = ' ';
#endif
length++;
}
}
@ -555,12 +539,7 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
if (length < width){
int still = width - length;
while (still--)
#ifdef HAVE_X
*cdest++ = ' ';
*cdest = '\0';
#else
addch (' ');
#endif
}
}
@ -703,7 +682,7 @@ mini_info_separator (WPanel *panel)
#else
hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
panel->widget.cols-2);
#endif
#endif /* !HAVE_SLANG */
}
void
@ -733,7 +712,7 @@ show_dir (WPanel *panel)
panel->widget.x + panel->widget.cols - 1, SLSMG_RTEE_CHAR);
}
}
#endif /* have_slang */
#endif /* HAVE_SLANG */
if (panel->active)
attrset (REVERSE_COLOR);
@ -770,11 +749,7 @@ void
panel_update_contents (WPanel *panel)
{
show_dir (panel);
#ifdef HAVE_X
x_fill_panel (panel);
#else
paint_dir (panel);
#endif
display_mini_info (panel);
}
@ -924,9 +899,6 @@ is_a_panel (Widget *w)
WPanel *
panel_new (const char *panel_name)
{
#ifdef HAVE_GNOME
static int panel_id = 0;
#endif
WPanel *panel;
char *section;
int i, err;
@ -965,12 +937,6 @@ panel_new (const char *panel_name)
panel->format = 0;
panel->status_format = 0;
panel->format_modified = 1;
#ifdef HAVE_GNOME
panel->drag_tree_row = -1;
panel->is_a_desktop_panel = FALSE;
panel->id = panel_id++;
panel->servant = NULL;
#endif
panel->panel_name = g_strdup (panel_name);
panel->user_format = g_strdup (DEFAULT_USER_FORMAT);
@ -1479,14 +1445,6 @@ select_item (WPanel *panel)
top file to decent values before calling select_item, I could
forget it someday, so it's better to do the actual fitting here */
#ifdef HAVE_X
int old_top;
old_top = panel->top_file;
#endif
if (is_a_desktop_panel (panel))
return;
if (panel->top_file < 0){
repaint = 1;
panel->top_file = 0;
@ -1520,16 +1478,10 @@ select_item (WPanel *panel)
panel->top_file = panel->selected - items + 1;
}
#ifndef HAVE_X
if (repaint)
paint_panel (panel);
else
repaint_file (panel, panel->selected, 1, 2*selection (panel)->f.marked+1, 0);
#else
if (old_top != panel->top_file)
x_adjust_top_file (panel);
x_select_item (panel);
#endif
display_mini_info (panel);
@ -1552,19 +1504,11 @@ unmark_files (WPanel *panel)
panel->total = 0;
}
#ifdef HAVE_X
void
unselect_item (WPanel *panel)
{
x_unselect_item (panel);
}
#else
void
unselect_item (WPanel *panel)
{
repaint_file (panel, panel->selected, 1, 2*selection (panel)->f.marked, 0);
}
#endif
static void
do_move_down (WPanel *panel)
@ -1575,7 +1519,6 @@ do_move_down (WPanel *panel)
unselect_item (panel);
panel->selected++;
#ifndef HAVE_X
if (panel->selected - panel->top_file == ITEMS (panel) &&
panel_scroll_pages){
/* Scroll window half screen */
@ -1585,7 +1528,6 @@ do_move_down (WPanel *panel)
paint_dir (panel);
select_item (panel);
}
#endif
select_item (panel);
}
@ -1597,14 +1539,12 @@ do_move_up (WPanel *panel)
unselect_item (panel);
panel->selected--;
#ifndef HAVE_X
if (panel->selected < panel->top_file && panel_scroll_pages){
/* Scroll window half screen */
panel->top_file -= ITEMS (panel)/2;
if (panel->top_file < 0) panel->top_file = 0;
paint_dir (panel);
}
#endif
select_item (panel);
}
@ -1653,9 +1593,7 @@ static void
move_selection (WPanel *panel, int lines)
{
int new_pos;
#ifndef HAVE_X
int adjust = 0;
#endif
new_pos = panel->selected + lines;
if (new_pos >= panel->count)
@ -1667,7 +1605,6 @@ move_selection (WPanel *panel, int lines)
unselect_item (panel);
panel->selected = new_pos;
#ifndef HAVE_X
if (panel->selected - panel->top_file >= ITEMS (panel)){
panel->top_file += lines;
adjust = 1;
@ -1685,7 +1622,6 @@ move_selection (WPanel *panel, int lines)
panel->top_file = 0;
paint_dir (panel);
}
#endif
select_item (panel);
}
@ -1743,20 +1679,17 @@ prev_page (WPanel *panel)
panel->top_file = 0;
x_adjust_top_file (panel);
select_item (panel);
#ifndef HAVE_X
paint_dir (panel);
#endif /* !HAVE_X */
}
static void
prev_page_key (WPanel *panel)
{
#ifndef HAVE_X
if (ctrl_pressed ()){
do_cd ("..", cd_exact);
} else
#endif /* !HAVE_X */
} else {
prev_page (panel);
}
}
static void
@ -1785,21 +1718,18 @@ next_page (WPanel *panel)
panel->top_file = panel->count - 1;
x_adjust_top_file (panel);
select_item (panel);
#ifndef HAVE_X
paint_dir (panel);
#endif /* !HAVE_X */
}
static void next_page_key (WPanel *panel)
{
#ifndef HAVE_X
if (ctrl_pressed() &&
(S_ISDIR(selection (panel)->buf.st_mode) ||
link_isdir (selection (panel))))
link_isdir (selection (panel)))) {
do_cd (selection (panel)->fname, cd_exact);
else
#endif /* !HAVE_X */
} else {
next_page (panel);
}
}
static void
@ -1853,9 +1783,7 @@ move_home (WPanel *panel)
panel->top_file = 0;
panel->selected = 0;
#ifndef HAVE_X
paint_dir (panel);
#endif
select_item (panel);
}
@ -1879,9 +1807,7 @@ move_end (WPanel *panel)
}
panel->selected = panel->count-1;
#ifndef HAVE_X
paint_dir (panel);
#endif
select_item (panel);
}
@ -2007,9 +1933,8 @@ do_search (WPanel *panel, int c_code)
}
if (!found)
panel->search_buffer [--l] = 0;
#ifndef HAVE_X
paint_panel (panel);
#endif
}
void
@ -2028,67 +1953,7 @@ start_search (WPanel *panel)
mc_refresh ();
}
}
/* This procedure was getting really messy with all the rewriting and ifdef's
* so I just splet them out. -jrb */
#ifdef HAVE_GNOME
extern void set_cursor_busy (WPanel *panel);
extern void set_cursor_normal (WPanel *panel);
int
do_enter_on_file_entry (file_entry *fe)
{
gint retval;
char *full_name;
set_cursor_busy (cpanel);
/* Can we change dirs? */
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe)) {
do_cd (fe->fname, cd_exact);
set_cursor_normal (cpanel);
return 1;
}
/* do metadata/mime stuff tell us anything? */
if (gmc_open (fe) != 0) {
set_cursor_normal (cpanel);
return 1;
}
/* can we change dirs? */
full_name = concat_dir_and_file (cpanel->cwd, fe->fname);
if (is_exe (fe->buf.st_mode) && if_link_is_exe (full_name, fe)) {
g_free (full_name);
#ifdef USE_VFS
if (vfs_current_is_local ())
#endif
{
char *tmp = name_quote (fe->fname, 0);
char *cmd = g_strconcat (".", PATH_SEP_STR, tmp, NULL);
g_free (tmp);
if (!confirm_execute || (query_dialog (_(" The Midnight Commander "),
_(" Do you really want to execute? "),
0, 2, _("Yes"), _("No")) == 0))
execute (cmd);
g_free (cmd);
}
#ifdef USE_VFS
else {
char *tmp;
tmp = concat_dir_and_file (vfs_get_current_dir(), fe->fname);
if (!mc_setctl (tmp, MCCTL_EXTFS_RUN, NULL))
message (1, _(" Warning "), _(" No action taken "));
g_free (tmp);
}
#endif /* USE_VFS */
set_cursor_normal (cpanel);
return 1;
}
g_free (full_name);
/* looks like we couldn't open it. Let's ask the user */
retval = gmc_open_with (fe->fname);
set_cursor_normal (cpanel);
return retval;
}
#else
int
do_enter_on_file_entry (file_entry *fe)
{
@ -2143,14 +2008,13 @@ do_enter_on_file_entry (file_entry *fe)
}
}
}
#endif /* else not HAVE_GNOME */
int
do_enter (WPanel *panel)
{
return do_enter_on_file_entry (selection (panel));
}
#ifndef HAVE_X
static void
chdir_other_panel (WPanel *panel)
{
@ -2216,7 +2080,6 @@ chdir_to_readlink (WPanel *panel)
g_free (new_dir);
}
}
#endif /* !HAVE_X */
static const key_map panel_keymap [] = {
{ KEY_DOWN, move_down },
@ -2253,11 +2116,9 @@ static const key_map panel_keymap [] = {
{ XCTRL('s'), start_search }, /* C-s like emacs */
{ ALT('s'), start_search }, /* M-s not like emacs */
{ XCTRL('t'), mark_file },
#ifndef HAVE_X
{ ALT('o'), chdir_other_panel },
{ ALT('l'), chdir_to_readlink },
{ ALT('H'), directory_history_list },
#endif /* HAVE_X */
{ KEY_F(13), view_simple_cmd },
{ KEY_F(14), edit_cmd_new },
{ ALT('y'), directory_history_prev },
@ -2269,23 +2130,6 @@ static const key_map panel_keymap [] = {
{ KEY_KP_SUBTRACT, unselect_cmd_panel },
{ ALT('*'), reverse_selection_cmd_panel },
{ KEY_KP_MULTIPLY, reverse_selection_cmd_panel },
#ifdef HAVE_GNOME
{ '+', select_cmd_panel },
{ '\\', unselect_cmd_panel },
{ '-', unselect_cmd_panel },
{ '*', reverse_selection_cmd_panel },
{ XCTRL('r'), reread_cmd },
{ KEY_F(3), view_panel_cmd },
{ KEY_F(4), edit_panel_cmd },
{ KEY_F(5), copy_cmd },
{ KEY_F(6), ren_cmd },
{ KEY_F(7), mkdir_panel_cmd },
{ KEY_F(8), delete_cmd },
{ KEY_DC, delete_cmd },
#endif
{ 0, 0 }
};
@ -2328,9 +2172,7 @@ panel_key (WPanel *panel, int key)
return 1;
}
#ifndef HAVE_X
if (!command_prompt)
#endif /* !HAVE_X */
{
start_search (panel);
do_search (panel, key);
@ -2341,20 +2183,15 @@ panel_key (WPanel *panel, int key)
return 0;
}
#ifndef HAVE_X
void user_file_menu_cmd (void) {
user_menu_cmd (NULL);
}
#endif /* !HAVE_X */
static int
panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
{
switch (msg){
case WIDGET_INIT:
#ifdef HAVE_X
x_create_panel (h, h->wdata, panel);
#endif /* !HAVE_X */
return 1;
case WIDGET_DRAW:
@ -2362,9 +2199,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
break;
case WIDGET_FOCUS:
#ifndef HAVE_GNOME
current_panel = panel;
#endif
panel->active = 1;
if (mc_chdir (panel->cwd) != 0){
message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
@ -2374,7 +2209,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
show_dir (panel);
focus_select_item (panel);
#ifndef HAVE_X
define_label (h, (Widget *)panel, 1, _("Help"), help_cmd);
define_label (h, (Widget *)panel, 2, _("Menu"), user_file_menu_cmd);
define_label (h, (Widget *)panel, 3, _("View"), view_panel_cmd);
@ -2384,7 +2219,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
define_label (h, (Widget *)panel, 7, _("Mkdir"), mkdir_panel_cmd);
define_label (h, (Widget *)panel, 8, _("Delete"), delete_cmd);
redraw_labels (h, (Widget *)panel);
#endif
/* Chain behaviour */
default_proc (h, WIDGET_FOCUS, par);
return 1;
@ -2395,15 +2230,9 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
panel->searching = 0;
display_mini_info (panel);
}
#ifdef HAVE_X
show_dir (panel);
unfocus_unselect_item (panel);
panel->active = 0;
#else
panel->active = 0;
show_dir (panel);
unselect_item (panel);
#endif
return 1;
case WIDGET_KEY:

Просмотреть файл

@ -47,10 +47,8 @@
#define MAX_ENTRIES 16
#define MAX_ENTRY_LEN 60
#ifndef HAVE_X
static int debug_flag = 0;
static int debug_error = 0;
#endif /* !HAVE_X */
static char *menu = NULL;
/* Formats defined:
@ -266,7 +264,6 @@ char *expand_format (WEdit *edit_widget, char c, int quote)
return g_strdup ("");
}
#ifndef HAVE_X
/* Checks for shell patterns definition */
char *check_patterns (char *p)
{
@ -796,4 +793,4 @@ void user_menu_cmd (WEdit *edit_widget)
g_free (entries);
g_free (data);
}
#endif /* !HAVE_X */

Просмотреть файл

@ -64,7 +64,6 @@ int tilde_trunc = 1;
#ifndef VFS_STANDALONE
int is_printable (int c)
{
#ifndef HAVE_X
static const unsigned char xterm_printable[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
@ -99,9 +98,6 @@ int is_printable (int c)
} else
return (c > 31 && c < 127);
#endif /* !HAVE_CHARSET */
#else
return 1;
#endif /* HAVE_X */
}
/* Returns the message dimensions (lines and columns) */

Просмотреть файл

@ -749,7 +749,6 @@ view_display_clean (WView *view, int height, int width)
#define view_add_string(view,s) addstr (s)
#define view_gotoyx(v,r,c) widget_move (v,r,c)
/* Both the text mode and gnome editions use this */
#define BOLD_COLOR MARKED_COLOR
#define UNDERLINE_COLOR VIEW_UNDERLINED_COLOR
#define MARK_COLOR SELECTED_COLOR

Просмотреть файл

@ -34,7 +34,6 @@
/* "$Id$" */
#ifndef HAVE_X
typedef void (*fnptr)(void);
typedef struct Fkey_Table_List {
@ -94,7 +93,6 @@ int check_fkeys (int c)
else
return 0;
}
#endif /* !HAVE_X */
/* 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,
@ -165,7 +163,6 @@ int is_abort_char (int c)
c == KEY_F(10));
}
#ifndef HAVE_X
void mc_raw_mode (void)
{
raw ();
@ -253,4 +250,3 @@ int lookup_key (char *keyname)
return 0;
}
#endif /* !HAVE_X */

Просмотреть файл

@ -55,7 +55,6 @@
void
dialog_repaint (struct Dlg_head *h, int back, int title_fore)
{
#ifndef HAVE_X
attrset (back);
dlg_erase (h);
draw_box (h, 1, 1, h->lines - 2, h->cols - 2);
@ -64,7 +63,6 @@ dialog_repaint (struct Dlg_head *h, int back, int title_fore)
dlg_move (h, 1, (h->cols-strlen (h->title))/2);
addstr (h->title);
}
#endif
}
void
@ -84,11 +82,7 @@ common_dialog_callback (struct Dlg_head *h, int id, int msg)
/* }}} */
/* {{{ Listbox utility functions */
#ifdef HAVE_X
#define listbox_refresh(h)
#else
#define listbox_refresh(h) common_dialog_repaint(h)
#endif
static int listbox_callback (Dlg_head *h, int id, int msg)
{
@ -156,7 +150,6 @@ int run_listbox (Listbox *l)
/* {{{ Query Dialog functions */
#ifndef HAVE_GNOME
struct text_struct {
char *text;
char *header;
@ -164,7 +157,6 @@ struct text_struct {
static int query_callback (struct Dlg_head *h, int Id, int Msg)
{
#ifndef HAVE_X
struct text_struct *info;
info = (struct text_struct *) h->data;
@ -180,7 +172,6 @@ static int query_callback (struct Dlg_head *h, int Id, int Msg)
addstr (info->header);
break;
}
#endif
return 0;
}
@ -202,9 +193,6 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
char *cur_name;
static int query_colors [4];
static struct text_struct pass;
#ifdef HAVE_X
static char *buttonnames [10];
#endif
/* set dialog colors */
query_colors [0] = (flags & D_ERROR) ? ERROR_COLOR : Q_UNSELECTED_COLOR;
@ -279,17 +267,8 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
/* free used memory */
destroy_dlg (query_dlg);
} else {
#ifdef HAVE_X
add_widget (query_dlg, button_new(0, 0, B_EXIT, NORMAL_BUTTON,
_("&Ok"), 0, 0, NULL));
add_widget (query_dlg, label_new (2, 3, text, NULL));
run_dlg (query_dlg);
destroy_dlg (query_dlg);
#else
add_widget (query_dlg, label_new (2, 3, text, NULL));
add_widget (query_dlg, button_new(0, 0, 0, HIDDEN_BUTTON, "-", 0, 0, NULL));
#endif /* HAVE_X */
last_query_dlg = query_dlg;
}
sel_pos = 0;
@ -331,7 +310,6 @@ Dlg_head *message (int error, char *header, const char *text, ...)
return d;
return 0;
}
#endif
/* }}} */
/* {{{ The chooser routines */
@ -393,8 +371,6 @@ void destroy_chooser (Chooser *c)
/* {{{ Quick dialog routines */
#ifndef HAVE_X
static int quick_callback (struct Dlg_head *h, int id, int Msg)
{
switch (Msg){
@ -610,7 +586,6 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te
} else
return 0;
}
#endif /* !HAVE_X */
char *input_dialog (char *header, char *text, char *def_text)
{