Many changes:

- Beginning of the CORBA support for the file manager.
	- Tk and XView code dropped.

Miguel
This commit is contained in:
Miguel de Icaza 1998-12-02 23:44:06 +00:00
parent c0ac4984ab
commit 301e7fbfc3
27 changed files with 143 additions and 475 deletions

View File

@ -1,3 +1,8 @@
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* Makefile.in (codedirs): Dropped xv and tk ports from the
distribution. include idl directory.
1998-12-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in (slang_use_system_installed_lib): Define slang

View File

@ -18,6 +18,7 @@ manprefix =
builddir = @builddir@
bindir = @bindir@
libdir = $(exec_prefix)/lib/mc
idldir = $(prefix)/share/idl
suppbindir = $(libdir)/bin
tidir = $(libdir)/term
extfsdir = $(libdir)/extfs

View File

@ -5,7 +5,7 @@ rootdir = $(srcdir)
@MCFGR@@MCF@
foreigndirs=pc
codedirs=vfs lib doc slang edit gtkedit src tk xv gnome icons
codedirs=vfs lib doc slang edit gtkedit src gnome icons idl
unixdirs=intl $(codedirs) @POSUB@
alldirs=$(unixdirs) $(foreigndirs)
subdirs=$(alldirs)

View File

@ -305,82 +305,6 @@ dnl ])
AC_PATH_XTRA
insticons=
xvers="none"
mxc=""
AC_PATH_XVIEW_XTRA
if test "x$no_xview" != "xyes"; then
mxc="mxc"
xvers="XView"
xvdep="xvdep"
insticons=install_icons
AC_SUBST(insticons)
else
mxc=""
xvdep=""
fi
AC_SUBST(mxc)
AC_SUBST(xvdep)
xv_bindir=
if test -n "$mxc"; then
AC_ARG_WITH(xv-bindir,
[--with-xv-bindir=dir Specifies directory where to install XView version],[
if test x$withval = xyes; then
AC_MSG_WARN(Usage is: --with-xv-bindir=basedir)
else
if test x$withval = xno; then
AC_MSG_WARN(Usage is: --with-xv-bindir=basedir)
else
xv_bindir=$withval
fi
fi
])
if test x$xv_bindir = x; then
xv_bindir=`echo $xv_includes | sed s/include/bin/`
if test ! -x $xv_bindir/openwin; then
if test ! -x $xv_bindir/olwm; then
if test ! -x $xv_bindir/olvwm; then
xv_bindir=
fi
fi
fi
fi
if test x$xv_bindir = x; then
if test "$OPENWINHOME"; then
xv_bindir=$OPENWINHOME/bin
else
AC_PATH_PROG(ac_my_xp, openwin)
if test x$ac_my_xp = x; then
AC_PATH_PROG(ac_my_xp, X)
if test x$ac_my_xp = x; then
xv_bindir=""
else
xv_bindir=`basename $ac_my_xp`
fi
else
xv_bindir=`basename $ac_my_xp`
fi
fi
if test ! -x $xv_bindir/openwin; then
if test ! -x $xv_bindir/olwm; then
if test ! -x $xv_bindir/olvwm; then
if test ! -x $xv_bindir/X; then
xv_bindir=
fi
fi
fi
fi
fi
if test x$xv_bindir = x; then
xv_bindir=$prefix/bin
fi
fi
if test x$xv_bindir = xNONE/bin; then
xv_bindir=
fi
AC_SUBST(xv_bindir)
dnl
dnl Network related functions
dnl
@ -569,107 +493,6 @@ AC_ARG_WITH(hsc,
fi
)
AC_DEFUN(TK_MSG,[
if test x$xvers = xnone; then
xvers="Tk"
else
xvers="XView+Tk"
fi
])
dnl
dnl Check for Tcl/Tk, should switch to Guile/Tk soon :-)
dnl
tkmc=""
tk_includes=""
tk_libs=""
if test x$no_x != xyes; then
AC_ARG_WITH(tk,
[--with-tk Use the Tk toolkit],[
if test x$withval = xyes; then
tkmc="tkmc"
fi])
AC_ARG_WITH(tk-includes,
[--with-tk-includes=dir Specifies the Tcl/Tk header directory],[
if test x$withval = xyes; then
AC_MSG_WARN(Usage is: --with-tk-includes=dir)
else
if test x$withval = xno; then
AC_MSG_WARN(Usage is: --with-tk-includes=dir)
else
tk_includes="-I$withval"
tkmc="tkmc"
fi
fi])
AC_ARG_WITH(tk-libraries,
[--with-tk-libraries=dir Specifies the Tcl/Tk library directory],[
if test x$withval = xyes; then
AC_MSG_WARN(Usage is: --with-tk-libraries=dir)
else
if test x$withval = xno; then
AC_MSG_WARN(Usage is: --with-tk-libraries=dir)
else
tk_libs="-L$withval"
tkmc="tkmc"
fi
fi])
if test -n "$tkmc"; then
AC_CHECKING(for Tcl/Tk)
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
tk_headers_found=no
if test ! -n "$tk_includes"; then
AC_CHECK_HEADER_IN_PATH(tcl.h, $include_additional_path, [
AC_CHECK_HEADER_IN_PATH(tk.h, $include_additional_path, [
tk_headers_found=yes
if test -n "$ac_cv_header_in_path_tcl_h"; then
tk_includes="-I$ac_cv_header_in_path_tcl_h";
fi
if test -n "$ac_cv_header_in_path_tk_h"; then
if test "$ac_cv_header_in_path_tk_h" != "$ac_cv_header_in_path_tcl_h"; then
tk_includes="$tk_includes -I$ac_cv_header_in_path_tk_h"
fi
fi
])
])
else
tk_headers_found=yes
fi
if test $tk_headers_found = no; then
tkmc=""
else
tk_libs_found=no
ac_save_tk_LIBS="$LIBS"
ac_save_tk_LDFLAGS="$LDFLAGS"
LIBS="$X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
LDFLAGS="$LDFLAGS $X_LIBS"
if test ! -n "$tk_libs"; then
AC_CHECK_LIB(tcl, Tcl_Eval, [
AC_CHECK_LIB(tk, Tk_CreateWindow, [
tk_libs_found=yes
], , -ltcl -lm)
], , -lm)
else
tk_libs_found=yes
fi
LDFLAGS="$ac_save_tk_LDFLAGS"
LIBS="$ac_save_tk_LIBS"
if test $tk_libs_found = no; then
tkmc=""
fi
fi
fi
fi
if test -n "$tkmc"; then
TK_MSG
tkdep="tkdep"
else
tkdep=""
fi
AC_SUBST(tkmc)
AC_SUBST(tkdep)
AC_SUBST(tk_includes)
AC_SUBST(tk_libs)
dnl
dnl Check for Gnome
dnl
@ -691,6 +514,7 @@ GNOME_INIT_HOOK([
AC_SUBST(gmc)
AC_SUBST(gmcdep)
AC_SUBST(libgtkedit)
AC_SUBST(GNOMEGNORBA_LIBS)
dnl
dnl Check for the -mandoc package
@ -1433,9 +1257,8 @@ VERSION
doc/Makefile
vfs/Makefile:vfs/Make-mc.in
lib/Makefile
tk/Makefile
gnome/Makefile
xv/Makefile
idl/Makefile
src/Makefile
slang/Makefile
edit/Makefile

View File

@ -4,11 +4,13 @@ VPATH = @srcdir@
rootdir = $(srcdir)/..
@MCFG@@MCF@
GNOMEDEFS = -DHAVE_X -DHAVE_GNOME @GNOME_INCLUDEDIR@
CFLAGS = $(XCFLAGS) @X_CFLAGS@
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) -DHAVE_X -DHAVE_GNOME @GNOME_INCLUDEDIR@
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) $(GNOMEDEFS)
LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEUI_LIBS@
CORBA_LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEGNORBA_LIBS@
DEFS = $(XDEFS)
LIBS = @X_EXTRA_LIBS@ -lX11 @X_PRE_LIBS@ $(XLIBS) $(XLIB) @TERMNET@
LIBS = $(XLIBS) @TERMNET@
EXTRALIBS = @LVFS@ -lgtkedit @LINTL@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@ -83,7 +85,7 @@ LOBJS = mad.o
#
# These objects from ../src do depend on HAVE_GNOME
#
OOBJS = main.o dlg.o screen.o widget.o wtools.o info.o boxes.o \
OOBJS = dlg.o screen.o widget.o wtools.o info.o boxes.o \
file.o find.o dialog.o key.o chmod.o chown.o view.o \
panelize.o hotlist.o background.o dir.o util.o \
win.o color.o profile.o user.o ext.o setup.o \
@ -118,6 +120,13 @@ OBJS = $(LOBJS) $(OOBJS) \
gtkdtree.o \
gwidget.o
NORMALOBJS = \
main.o
CORBAOBJS = \
main-corba.o
#
# Distribution variables
#
@ -131,11 +140,29 @@ PIXMAPS = \
dir-close.xpm \
dir-open.xpm
DISTGNOME = Makefile.in gnome.TODO layout $(PIXMAPS) $(ICONS) $(GNOMESRCS) $(GNOMEHDRS)
CORBA_GENERATED = \
FileManager.h \
FileManager-stubs.c \
FileManager-skels.c \
FileManager-common.c
CORBA_SOURCES = FileManager-impl.c
$(CORBA_GENERATED): $(rootdir)/idl/FileManager.idl
FileManager-impl.c: FileManager.h
DISTGNOME = \
Makefile.in gnome.TODO layout gmc.gnorba \
$(PIXMAPS) $(ICONS) $(GNOMESRCS) $(GNOMEHDRS) \
$(CORBA_SOURCES)
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<
main-corba.o: main.c
$(CC) -c -DHAVE_CORBA $(CPPFLAGS) $(DEFS) $(CFLAGS) $< -o main-corba.o
all: @gmc@ Makefile
Makefile: Makefile.in ../config.status
@ -144,10 +171,13 @@ Makefile: Makefile.in ../config.status
gmc: checklinks
$(MAKE) mx
mx: @LIBVFS@ $(OBJS) @LIBSLANG@ libgtkedit.a
$(CC) $(LDFLAGS) -o gmc $(OBJS) -L../vfs -L../slang -L../gtkedit $(EXTRALIBS) $(LIBS)
mx: @LIBVFS@ $(OBJS) $(NORMALOBJS) @LIBSLANG@ libgtkedit.a
$(CC) $(LDFLAGS) -o gmc $(NORMALOBJS) $(OBJS) -L../vfs -L../slang -L../gtkedit $(EXTRALIBS) $(LIBS)
touch mx
corba-gmc: @LIBVFS@ $(OBJS) $(CORBAOBJS) @LIBSLANG@ libgtkedit.a
$(CC) $(CORBA_LDFLAGS) -o gmc $(CORBAOBJS) $(OBJS) -L../vfs -L../slang -L../gtkedit $(EXTRALIBS) $(LIBS)
@LIBVFS@:
cd ../vfs; $(MAKE) @LIBVFS@
@PCENTRULE@ -$(RMF) @LIBVFS@

10
idl/FileManager.idl Normal file
View File

@ -0,0 +1,10 @@
#include <factory.idl>
module GNOME {
interface FileManagerFactory : Factory {
};
interface FileManager {
};
};

44
idl/Makefile.in Normal file
View File

@ -0,0 +1,44 @@
srcdir = @srcdir@
VPATH = @srcdir@
rootdir = $(srcdir)/..
@MCFG@@MCF@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
#
# Distribution variables
#
DISTFILES = FileManager.idl
all:
check:
@echo no tests are supplied.
TAGS:
cross:
clean:
realclean:
distclean:
install:
for I in $(DISTFILES); \
do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(idldir)/$$I; done
uninstall:
for I in $(DISTFILES); \
do $(RMF) $(DESTDIR)$(idldir)/$$I; done
distcopy:
$(CP) $(DISTFILES) ../../mc-$(VERSION)/idl
depend dep:

View File

@ -1,5 +1,8 @@
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* GNORBA integration. We now produce two binaries: gmc and
corba-gmc (that way, I dont interfere with other's work).
* Added prototypes, made private functions static, clean up
various silly warnings.

View File

@ -123,15 +123,6 @@ struct {
#ifdef HAVE_X
static void chmod_toggle_select (void)
{
#ifdef HAVE_TK
char *wn = (char *) ch_dlg->current->widget->wdata;
int id = ch_dlg->current->dlg_id -BUTTONS + single_set * 2;
check_perm [id].selected ^= 1;
tk_evalf ("%s configure -color $setup(%s)",
wn+1, check_perm [id].selected ? "marked":"black");
#endif
}
#else
@ -245,7 +236,6 @@ static void init_chmod (void)
#define XTRACT(i) BY+chmod_but[i].y-single_set, BX+chmod_but[i].x, \
chmod_but[i].ret_cmd, chmod_but[i].flags, _(chmod_but[i].text), 0, 0, NULL
tk_new_frame (ch_dlg, "b.");
for (i = 0; i < BUTTONS; i++) {
if (i == 2 && single_set)
break;
@ -255,7 +245,6 @@ static void init_chmod (void)
#define XTRACT2(i) 0, _(check_perm [i].text), NULL
tk_new_frame (ch_dlg, "c.");
for (i = 0; i < PERMISSIONS; i++) {
check_perm[i].check = check_new (PY + (PERMISSIONS - i), PX + 2,
XTRACT2 (i));
@ -361,7 +350,6 @@ void chmod_cmd (void)
check_perm[i].selected = 0;
}
tk_new_frame (ch_dlg, "l.");
/* Set the labels */
c_fname = name_trunc (fname, 21);
add_widget (ch_dlg, label_new (FY+2, FX+2, c_fname, NULL));
@ -372,7 +360,6 @@ void chmod_cmd (void)
sprintf (buffer, "%o", c_stat);
statl = label_new (FY+4, FX+2, buffer, NULL);
add_widget (ch_dlg, statl);
tk_end_frame ();
run_dlg (ch_dlg); /* retrieve an action */

View File

@ -177,13 +177,11 @@ init_chown (void)
#define XTRACT(i) BY+chown_but[i].y, BX+chown_but[i].x, chown_but[i].ret_cmd, chown_but[i].flags, _(chown_but[i].text), 0, 0, NULL
tk_new_frame (ch_dlg, "b.");
for (i = 0; i < BUTTONS-single_set; i++)
add_widget (ch_dlg, button_new (XTRACT (i)));
/* Add the widgets for the file information */
#define LX(i) chown_label [i].y, chown_label [i].x, "", NULL
tk_new_frame (ch_dlg, "l.");
for (i = 0; i < LABELS; i++){
chown_label [i].l = label_new (LX (i));
add_widget (ch_dlg, chown_label [i].l);
@ -208,11 +206,8 @@ init_chown (void)
}
endgrent ();
tk_new_frame (ch_dlg, "f.");
add_widget (ch_dlg, l_group);
tk_new_frame (ch_dlg, "g.");
add_widget (ch_dlg, l_user); /* add listboxes to the dialogs */
tk_end_frame ();
}
static void

View File

@ -217,13 +217,9 @@ void configure_colors_string (char *the_color_string)
static void configure_colors (void)
{
extern char *command_line_colors;
#ifndef HAVE_TK
#ifndef HAVE_XVIEW
extern char *default_edition_colors;
configure_colors_string (default_edition_colors);
#endif
#endif
configure_colors_string (setup_color_string);
configure_colors_string (term_color_string);
configure_colors_string (getenv ("MC_COLOR_TABLE"));

View File

@ -348,7 +348,7 @@ int main (int argc, char **argv)
if (error){
/* Not a console -> no need for privileges */
setuid (getuid ());
dwrite (2, error);
/* dwrite (2, error); */
console_flag = 0;
if (console_fd >= 0)
close (console_fd);

View File

@ -793,8 +793,6 @@ void init_dlg (Dlg_head *h)
{
int refresh_mode;
tk_end_frame ();
/* Initialize dialog manager and widgets */
(*h->callback) (h, 0, DLG_INIT);
dlg_broadcast_msg (h, WIDGET_INIT, 0);
@ -1022,54 +1020,6 @@ int dlg_select_nth_widget (Dlg_head *h, int n)
return dlg_select_widget (h, w->widget);
}
#ifdef HAVE_TK
/* Frames must include a trailing dot */
static void tk_frame_proc (Dlg_head *h, char *frame, int new_frame)
{
char *s = strdup (frame);
if (frame [strlen (frame)-1] != '.'){
fprintf (stderr, "Invalid frame name\n");
exit (1);
}
s [strlen (frame)-1] = 0;
the_frame = frame;
if (new_frame)
tk_evalf ("frame %s.%s", (char *)h->wdata, s);
}
/* If passed a null string, it returns */
void tk_new_frame (Dlg_head *h, char *frame)
{
if (!*frame)
return;
tk_frame_proc (h, frame, 1);
}
void tk_frame (Dlg_head *h, char *frame)
{
tk_frame_proc (h, frame, 0);
}
void tk_end_frame ()
{
the_frame = "";
}
#else
void tk_new_frame (Dlg_head *h, char *x)
{
}
void tk_frame (Dlg_head *h, char *x)
{
}
void tk_end_frame (void)
{
}
#endif
#ifndef PORT_HAS_DIALOG_TITLE
void
x_set_dialog_title (Dlg_head *h, char *title)

View File

@ -220,13 +220,8 @@ create_op_win (FileOperation op, int with_eta)
int minus = verbose ? 0 : 3;
int eta_offset = with_eta ? (WX_ETA_EXTRA) / 2 : 0;
#ifdef HAVE_XVIEW
char *sixty = " ";
char *fifteen = " ";
#else
char *sixty = "";
char *fifteen = "";
#endif
file_progress_replace_result = 0;
file_progress_recursive_result = 0;
@ -246,7 +241,6 @@ create_op_win (FileOperation op, int with_eta)
x_set_dialog_title (op_dlg, "");
tk_new_frame (op_dlg, "b.");
add_widgetl (op_dlg, button_new (BY-minus, WX - 19 + eta_offset, FILE_ABORT,
NORMAL_BUTTON, _("&Abort"), 0, 0, "abort"),
XV_WLAY_RIGHTOF);
@ -254,33 +248,28 @@ create_op_win (FileOperation op, int with_eta)
NORMAL_BUTTON, _("&Skip"), 0, 0, "skip"),
XV_WLAY_CENTERROW);
tk_new_frame (op_dlg, "2.");
add_widgetl (op_dlg, ProgressGauge [2] = gauge_new (7, FCOPY_GAUGE_X, 0, 100, 0, "g-1"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, ProgressLabel [2] = label_new (7, FCOPY_LABEL_X, fifteen, "l-1"),
XV_WLAY_NEXTROW);
add_widgetl (op_dlg, bps_label = label_new (7, WX, "", "bps-label"), XV_WLAY_NEXTROW);
tk_new_frame (op_dlg, "1.");
add_widgetl (op_dlg, ProgressGauge [1] = gauge_new (8, FCOPY_GAUGE_X, 0, 100, 0, "g-2"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, ProgressLabel [1] = label_new (8, FCOPY_LABEL_X, fifteen, "l-2"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, stalled_label = label_new (8, WX, "", "stalled"), XV_WLAY_NEXTROW);
tk_new_frame (op_dlg, "0.");
add_widgetl (op_dlg, ProgressGauge [0] = gauge_new (6, FCOPY_GAUGE_X, 0, 100, 0, "g-3"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, ProgressLabel [0] = label_new (6, FCOPY_LABEL_X, fifteen, "l-3"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, eta_label = label_new (6, WX, "", "eta_label"), XV_WLAY_NEXTROW);
tk_new_frame (op_dlg, "f1.");
add_widgetl (op_dlg, FileString [1] = label_new (4, FCOPY_GAUGE_X, sixty, "fs-l-1"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, FileLabel [1] = label_new (4, FCOPY_LABEL_X, fifteen, "fs-l-2"),
XV_WLAY_NEXTROW);
tk_new_frame (op_dlg, "f0.");
add_widgetl (op_dlg, FileString [0] = label_new (3, FCOPY_GAUGE_X, sixty, "fs-x-1"),
XV_WLAY_RIGHTOF);
add_widgetl (op_dlg, FileLabel [0] = label_new (3, FCOPY_LABEL_X, fifteen, "fs-x-2"),
@ -298,9 +287,6 @@ create_op_win (FileOperation op, int with_eta)
void
destroy_op_win (void)
{
#ifdef HAVE_XVIEW
xtoolkit_kill_dialog (op_dlg);
#endif
dlg_run_done (op_dlg);
destroy_dlg (op_dlg);
#ifndef HAVE_X
@ -606,8 +592,6 @@ init_replace (enum OperationMode mode)
ADD_RD_LABEL(0, name_trunc (file_progress_replace_filename, rd_trunc - strlen (rd_widgets [0].text)), 0 );
ADD_RD_BUTTON(1);
tk_new_frame (replace_dlg, "a.");
ADD_RD_BUTTON(2);
ADD_RD_BUTTON(3);
ADD_RD_BUTTON(4);
@ -615,7 +599,6 @@ init_replace (enum OperationMode mode)
ADD_RD_LABEL(6,0,0);
/* "this target..." widgets */
tk_new_frame (replace_dlg, "p.");
if (!S_ISDIR (d_stat->st_mode)){
if ((d_stat->st_size && s_stat->st_size > d_stat->st_size))
ADD_RD_BUTTON(7);
@ -626,10 +609,8 @@ init_replace (enum OperationMode mode)
ADD_RD_BUTTON(10);
ADD_RD_LABEL(11,0,0);
tk_new_frame (replace_dlg, "i.");
ADD_RD_LABEL(12, file_date (d_stat->st_mtime), (int) d_stat->st_size);
ADD_RD_LABEL(13, file_date (s_stat->st_mtime), (int) s_stat->st_size);
tk_end_frame ();
}
FileProgressStatus
@ -715,13 +696,11 @@ static QuickWidget fmd_widgets [] = {
0/* &source_easy_patterns */, 0, XV_WLAY_BELOWCLOSE, "using-shell" },
{ quick_input, 3, 64, 3, FMDY, "", 58,
0, 0, 0, XV_WLAY_BELOWCLOSE, "input-def" },
#ifndef HAVE_XVIEW
#define FMDI1 4
#define FMDI2 5
#define FMDC 3
{ quick_input, 3, 64, 6, FMDY, "", 58, 0,
0, 0, XV_WLAY_BELOWCLOSE, "input2" },
#endif
#define FMDI0 6
{ quick_label, 3, 64, 2, FMDY, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "ql" },
#define FMBRGT 7

View File

@ -55,10 +55,6 @@
#include "cmd.h" /* view_file_at_line */
#include "../vfs/vfs.h"
#ifdef HAVE_XVIEW
#include "xvmain.h"
#endif
#ifndef PORT_HAS_FLUSH_EVENTS
# define x_flush_events()
#endif
@ -553,9 +549,6 @@ do_search (struct Dlg_head *h)
if (strcmp (dp->d_name, ".") == 0 ||
strcmp (dp->d_name, "..") == 0){
dp = mc_readdir (dirp);
#ifdef HAVE_XVIEW
xv_post_proc (h, (void (*)(void *))do_search, (void *)h);
#endif
return;
}
@ -595,9 +588,6 @@ do_search (struct Dlg_head *h)
#else
}
}
#ifdef HAVE_XVIEW
xv_post_proc (h, (void (*)(void *))do_search, (void *)h);
#endif
#endif
x_flush_events ();
}
@ -805,9 +795,6 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname, char
init_find_vars ();
push_directory (start_dir);
#ifdef HAVE_XVIEW
xv_post_proc (find_dlg, (void (*)(void *))do_search, (void *)find_dlg);
#endif
run_dlg (find_dlg);
return_value = find_dlg->ret_value;

View File

@ -558,9 +558,7 @@ help_help_cmd (Dlg_head *h)
history [history_ptr].link = selected_item;
currentpoint = startpoint = search_string (data, "[How to use help]") + 1;
selected_item = NULL;
#ifndef HAVE_XVIEW
help_callback (h, 0, DLG_DRAW);
#endif
}
static void
@ -578,9 +576,7 @@ help_index_cmd (Dlg_head *h)
else
currentpoint = startpoint = new_item + 1;
selected_item = NULL;
#ifndef HAVE_XVIEW
help_callback (h, 0, DLG_DRAW);
#endif
}
static void quit_cmd (void *x)
@ -596,9 +592,7 @@ static void prev_node_cmd (Dlg_head *h)
if (history_ptr < 0)
history_ptr = HISTORY_SIZE-1;
#ifndef HAVE_XVIEW
help_callback (h, 0, DLG_DRAW);
#endif
}
static int md_callback (Dlg_head *h, Widget *w, int msg, int par)

View File

@ -478,14 +478,6 @@ static void init_layout (void)
check_options [i].widget = check_new (8 - i, 7 + first_width, XTRACT(i));
add_widgetl (layout_dlg, check_options [i].widget, XV_WLAY_BELOWCLOSE);
}
#ifdef HAVE_XVIEW
add_widgetl (layout_dlg, label_new (2, 7 + first_width, _("Other options"), "oo"),
XV_WLAY_NEXTCOLUMN);
add_widgetl (layout_dlg, label_new (8, 5, _("Highlight..."), "hl"),
XV_WLAY_NEXTCOLUMN);
add_widgetl (layout_dlg, label_new (2, 5, _("Panel split"), "ps"),
XV_WLAY_NEXTCOLUMN);
#endif
check_options [8].widget = check_new (10, 6, XTRACT(8));
add_widgetl (layout_dlg, check_options [8].widget, XV_WLAY_BELOWCLOSE);
check_options [7].widget = check_new (9, 6, XTRACT(7));
@ -663,10 +655,6 @@ setup_panels (void)
}
load_hint ();
#ifdef HAVE_XVIEW
panel_do_cols (0);
panel_do_cols (1);
#endif
}
#else
@ -979,9 +967,6 @@ void set_display_type (int num, int type)
x = first_panel_size;
}
}
#ifdef HAVE_TK
tk_evalf ("container_clean %s", panel->widget.wcontainer);
#endif
}
new_widget = 0;
@ -1055,7 +1040,6 @@ void set_display_type (int num, int type)
current_panel = num == 0 ? right_panel : left_panel;
}
#ifndef HAVE_XVIEW
/* This routine is deeply sticked to the two panels idea.
What should it do in more panels. ANSWER - don't use it
in any multiple panels environment. */
@ -1152,7 +1136,6 @@ void swap_panels ()
panels [1].type = tmp_type;
}
}
#endif
int get_display_type (int index)
{

View File

@ -79,6 +79,10 @@
#include <fcntl.h> /* For O_RDWR */
#include <signal.h>
#ifdef HAVE_CORBA
# include <libgnorba/gnorba.h>
#endif
/* Program include files */
#include "x.h"
#include "mad.h"
@ -1276,10 +1280,8 @@ static menu_entry CmdMenu [] = {
{ ' ', N_("&Directory tree"), 'D', tree_box },
#endif
{ ' ', N_("&Find file M-?"), 'F', find_cmd },
#ifndef HAVE_XVIEW
{ ' ', N_("s&Wap panels C-u"), 'W', swap_cmd },
{ ' ', N_("switch &Panels on/off C-o"), 'P', view_other_cmd },
#endif
{ ' ', N_("&Compare directories C-x d"), 'C', compare_dirs_cmd },
{ ' ', N_("e&Xternal panelize C-x !"), 'X', external_panelize },
#ifdef HAVE_DUSUM
@ -1342,7 +1344,6 @@ init_menu (void)
MenuBar [1] = create_menu (_(" &File "), FileMenu, menu_entries (FileMenu));
MenuBar [2] = create_menu (_(" &Command "), CmdMenu, menu_entries (CmdMenu));
MenuBar [3] = create_menu (_(" &Options "), OptMenu, menu_entries (OptMenu));
#ifndef HAVE_XVIEW
#ifdef HAVE_X
MenuBar [4] = create_menu (_(" &Right "), RightMenu, menu_entries (PanelMenu));
#else
@ -1351,7 +1352,6 @@ init_menu (void)
for (i = 0; i < 5; i++)
MenuBarEmpty [i] = create_menu (MenuBar [i]->name, 0, 0);
#endif /* HAVE_X */
#endif /* ! HAVE_XVIEW */
}
void
@ -1359,15 +1359,10 @@ done_menu (void)
{
int i;
#ifndef HAVE_XVIEW
for (i = 0; i < 5; i++){
destroy_menu (MenuBar [i]);
#ifndef HAVE_X
destroy_menu (MenuBarEmpty [i]);
#endif
#else
for (i = 0; i < 4; i++){
destroy_menu (MenuBar [i]);
#endif
}
}
@ -1532,12 +1527,7 @@ create_panels (void)
the_hint->widget.cols = COLS;
#endif
#ifndef HAVE_XVIEW
the_menubar = menubar_new (0, 0, COLS, MenuBar, 5);
#else
the_menubar = menubar_new (0, 0, COLS, MenuBar + 1, 3);
the_bar2 = buttonbar_new (keybar_visible);
#endif
}
#endif
@ -1692,7 +1682,6 @@ init_labels (Widget *paneletc)
define_label (midnight_dlg, paneletc, 10, _("Quit"), (voidfn) quit_cmd);
}
#ifndef HAVE_XVIEW
static key_map ctl_x_map [] = {
{ XCTRL('c'), (callfn) quit_cmd },
#ifdef USE_VFS
@ -1788,7 +1777,6 @@ static key_map default_map [] = {
{ XCTRL('g'), nothing },
{ 0, 0 },
};
#endif
#ifndef HAVE_X
static void setup_sigwinch ()
@ -1936,8 +1924,6 @@ midnight_callback (struct Dlg_head *h, int id, int msg)
int i;
switch (msg){
#ifndef HAVE_XVIEW
/* Speed up routine: now, we just set the */
case DLG_PRE_EVENT:
make_panels_dirty ();
@ -2043,7 +2029,6 @@ midnight_callback (struct Dlg_head *h, int id, int msg)
}
return MSG_NOT_HANDLED;
#endif
#ifndef HAVE_X
/* We handle the special case of the output lines */
case DLG_DRAW:
@ -2078,10 +2063,6 @@ xtoolkit_panel_setup ()
the_prompt->widget.area = AREA_BOTTOM;
the_bar->widget.wcontainer = containers [0];
the_bar->widget.area = AREA_TOP;
#ifdef HAVE_XVIEW
the_bar2->widget.wcontainer = containers [1];
the_bar2->widget.area = AREA_TOP;
#endif
get_panel_widget (0)->wcontainer = containers [0];
get_panel_widget (0)->area = AREA_RIGHT;
get_panel_widget (1)->wcontainer = containers [1];
@ -2126,18 +2107,14 @@ setup_panels_and_run_mc ()
int first, second;
xtoolkit_panel_setup ();
tk_new_frame (midnight_dlg, "p.");
#ifndef HAVE_X
add_widget (midnight_dlg, the_hint);
#endif /* HAVE_X */
load_hint ();
add_widgetl (midnight_dlg, cmdline, XV_WLAY_RIGHTOF);
add_widgetl (midnight_dlg, the_prompt, XV_WLAY_DONTCARE);
tk_end_frame ();
add_widget (midnight_dlg, the_bar);
#ifdef HAVE_XVIEW
add_widget (midnight_dlg, the_bar2);
#endif
if (boot_current_is_left){
first = 1;
second = 0;
@ -2623,7 +2600,7 @@ char *cmdline_geometry = NULL;
int nowindows = 0;
char **directory_list = NULL;
static struct poptOption argumentTable[] = {
static struct poptOption argument_table [] = {
#ifdef WITH_BACKGROUND
{ "background", 'B', POPT_ARG_NONE, &background_wait, 0 },
#endif
@ -2682,13 +2659,22 @@ handle_args (int argc, char *argv [])
{
char *tmp, *option_arg, *base;
int c;
poptContext optCon;
poptContext ctx;
#ifdef HAVE_GNOME
gnome_init_with_popt_table ("gmc", VERSION, argc, argv, argumentTable, 0, &optCon);
poptResetContext(optCon);
#ifdef HAVE_CORBA
CORBA_Environment ev;
CORBA_exception_init (&ev);
gnome_CORBA_init_with_popt_table (
"gmc", VERSION, &argc, argv, argument_table, 0, &ctx, 0, &ev);
#else
optCon = poptGetContext ("mc", argc, argv, argumentTable, 0);
gnome_init_with_popt_table ("gmc", VERSION, argc, argv, argument_table, 0, &ctx);
#endif
poptResetContext (ctx);
#else
ctx = poptGetContext ("mc", argc, argv, argument_table, 0);
#endif
#ifndef HAVE_X
@ -2697,8 +2683,8 @@ handle_args (int argc, char *argv [])
#endif
#endif
while ((c = poptGetNextOpt (optCon)) > 0) {
option_arg = poptGetOptArg(optCon);
while ((c = poptGetNextOpt (ctx)) > 0){
option_arg = poptGetOptArg (ctx);
process_args (c, option_arg);
}
@ -2706,18 +2692,19 @@ handle_args (int argc, char *argv [])
if (c < -1){
print_mc_usage ();
fprintf(stderr, "%s: %s\n",
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(c));
poptBadOption (ctx, POPT_BADOPTION_NOALIAS),
poptStrerror (c));
finish_program = 1;
}
probably_finish_program ();
/* Check for special invocation names mcedit and mcview,
/*
* Check for special invocation names mcedit and mcview,
* if none apply then set the current directory and the other
* directory from the command line arguments
*/
tmp = poptGetArg (optCon);
tmp = poptGetArg (ctx);
base = x_basename (argv[0]);
if (!STRNCOMP (base, "mce", 3) || !STRCOMP(base, "vi")) {
edit_one_file = "";
@ -2733,13 +2720,12 @@ handle_args (int argc, char *argv [])
char buffer[MC_MAXPATHLEN + 2];
this_dir = strdup (tmp);
mc_get_current_wd (buffer, sizeof (buffer) - 2);
if ((tmp = poptGetArg (optCon)))
if ((tmp = poptGetArg (ctx)))
other_dir = strdup (tmp);
}
}
poptFreeContext(optCon);
poptFreeContext (ctx);
}
/*

View File

@ -238,14 +238,6 @@ static void init_configure (void)
add_widgetl (conf_dlg, check_options [i+12].widget,
XV_WLAY_BELOWCLOSE);
}
#ifdef HAVE_XVIEW
add_widgetl (conf_dlg, label_new (OY, OX + 1, _("Other options"), "label-other"),
XV_WLAY_NEXTCOLUMN);
add_widgetl (conf_dlg, label_new (RY, RX + 1, _("Pause after run..."), "label-pause"),
XV_WLAY_BELOWOF);
add_widgetl (conf_dlg, label_new (PY, PX + 1, _("Panel options"), "label-panel"),
XV_WLAY_NEXTCOLUMN);
#endif
}

View File

@ -1924,9 +1924,7 @@ do_file_mark (WPanel *panel, int idx, int mark)
panel->dirs_marked++;
} else
panel->total += panel->dir.list [idx].buf.st_size;
#ifndef HAVE_XVIEW
set_colors (panel);
#endif
} else {
if (S_ISDIR(panel->dir.list [idx].buf.st_mode)) {
if (panel->has_dir_sizes)
@ -1956,10 +1954,9 @@ static void
do_mark_file (WPanel *panel, int do_move)
{
int idx = panel->selected;
do_file_mark (panel, idx, selection (panel)->f.marked ? 0 : 1);
#ifndef HAVE_XVIEW
repaint_file (panel, idx, 1, 2*panel->dir.list [idx].f.marked+1, 0);
#endif
if (mark_moves_down && do_move)
move_down (panel);
@ -2283,11 +2280,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
return 1;
case WIDGET_DRAW:
#ifndef HAVE_XVIEW
paint_panel (panel);
#else
show_dir (panel);
#endif
break;
case WIDGET_FOCUS:

View File

@ -450,7 +450,6 @@ init_growing_view (WView *view, char *name, char *filename)
return set_view_init_error (view, _(" Can't spawn child program "));
}
#ifndef HAVE_XVIEW
/* First, check if filter produced any output */
get_byte (view, 0);
if (view->bytes_read <= 0){
@ -459,7 +458,6 @@ init_growing_view (WView *view, char *name, char *filename)
close_error_pipe (view->have_frame?-1:1, view->data);
return set_view_init_error (view, _(" Empty output from child filter "));
}
#endif
} else {
view->stdfile = NULL;
if ((view->file = mc_open (filename, O_RDONLY)) == -1)
@ -2277,32 +2275,6 @@ view_mode_callback (struct Dlg_head *h, int id, int msg)
return default_dlg_callback (h, id, msg);
}
#ifdef HAVE_XVIEW
/* Real view only */
void
view_adjust_size (Dlg_head *unused)
{
}
int
view (char *_command, char *_file, int *move_dir_p, int start_line)
{
int midnight_colors [4];
int error;
WView *wview;
wview = view_new (0, 0, COLS, LINES - 1, 0);
error = view_init (wview, _command, _file, start_line);
if (!error){
x_view (wview);
}
*move_dir_p = 0;
return !error;
}
#endif
#ifndef PORT_WANTS_VIEW
void
view_adjust_size (Dlg_head *h)

View File

@ -84,7 +84,7 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
switch (Msg){
case WIDGET_INIT:
return x_create_button (h, h->wdata, b);
#ifndef HAVE_XVIEW
case WIDGET_HOTKEY:
if (b->hotkey == Par || toupper(b->hotkey) == Par){
button_callback (h, b, WIDGET_KEY, ' '); /* to make action */
@ -104,18 +104,6 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
}
return 1;
#ifdef HAVE_TK
case WIDGET_FOCUS:
case WIDGET_CURSOR:
{
char *s = b->action == B_ENTER ? ".button" : "";
tk_evalf ("focus %s%s", (char *)(b->widget.wdata)+1, s);
/* Do not call default_proc: we did the tk focus command */
return 1;
}
#else
case WIDGET_CURSOR:
switch (b->flags) {
case DEFPUSH_BUTTON:
@ -181,8 +169,6 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
else
return 1;
break;
#endif
#endif /* !HAVE_XVIEW */
}
return default_proc (h, Msg, Par);
}
@ -305,7 +291,6 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
case WIDGET_INIT:
return x_create_radio (h, h->wdata, r);
#ifndef HAVE_XVIEW
case WIDGET_HOTKEY:
{
int i, lp = tolower(Par);
@ -360,7 +345,6 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
x_radio_focus_item (r);
return 1;
#endif
#endif
#ifndef HAVE_X
case WIDGET_CURSOR:
@ -467,7 +451,6 @@ check_callback (Dlg_head *h, WCheck *c, int Msg, int Par)
case WIDGET_INIT:
return x_create_check (h, h->wdata, c);
#ifndef HAVE_XVIEW
case WIDGET_HOTKEY:
if (c->hotkey==Par ||
(c->hotkey>='a' && c->hotkey<='z' && c->hotkey-32==Par)){
@ -504,7 +487,6 @@ check_callback (Dlg_head *h, WCheck *c, int Msg, int Par)
}
return 1;
#endif /* !HAVE_X */
#endif /* !HAVE_XVIEW */
}
return default_proc (h, Msg, Par);
}
@ -829,7 +811,6 @@ static char *kill_buffer = 0;
void
update_input (WInput *in, int clear_first)
{
#ifndef HAVE_XVIEW
int has_history = 0;
int i, j;
unsigned char c;
@ -881,8 +862,6 @@ update_input (WInput *in, int clear_first)
if (clear_first)
in->first = 0;
#endif
#endif
}
void
@ -1635,7 +1614,6 @@ input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
case WIDGET_INIT:
return x_create_input (h, h->wdata, in);
#ifndef HAVE_XVIEW
case WIDGET_KEY:
if (Par == XCTRL('q')){
int v;
@ -1661,7 +1639,6 @@ input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
case WIDGET_DRAW:
update_input (in, 0);
break;
#endif /* !HAVE_XVIEW */
#ifndef HAVE_X
case WIDGET_CURSOR:
widget_move (&in->widget, 0, in->point - in->first_shown);
@ -2103,7 +2080,6 @@ listbox_callback (Dlg_head *h, WListbox *l, int msg, int par)
case WIDGET_INIT:
return x_create_listbox (h, h->wdata, l);
#ifndef HAVE_XVIEW
case WIDGET_HOTKEY:
if ((e = listbox_check_hotkey (l, par)) != NULL){
listbox_select_entry (l, e);
@ -2138,7 +2114,6 @@ listbox_callback (Dlg_head *h, WListbox *l, int msg, int par)
listbox_draw (l, h, msg != WIDGET_UNFOCUS);
return 1;
#endif
#endif /* !HAVE_XVIEW */
}
return default_proc (h, msg, par);
}
@ -2356,7 +2331,6 @@ buttonbar_callback (Dlg_head *h, WButtonBar *bb, int msg, int par)
case WIDGET_FOCUS:
return 0;
#ifndef HAVE_XVIEW
case WIDGET_HOTKEY:
for (i = 0; i < 10; i++){
if (par == KEY_F(i+1) && bb->labels [i].function){
@ -2385,7 +2359,6 @@ buttonbar_callback (Dlg_head *h, WButtonBar *bb, int msg, int par)
attrset (SELECTED_COLOR);
return 1;
#endif
#endif /* !HAVE_XVIEW */
}
return default_proc (h, msg, par);
}
@ -2460,15 +2433,6 @@ find_buttonbar (Dlg_head *h, Widget *paneletc)
for (i = 0, item = h->current; i < h->count; i++, item = item->next){
if (item->widget->callback == (callback_fn) buttonbar_callback){
bb = (WButtonBar *) item->widget;
#ifdef HAVE_XVIEW
/* Jakub: do we really need this routine here?
* Does XView hold more that a buttonbar per Dlg_head?
*/
if (x_find_buttonbar_check (bb, paneletc)) {
bb = 0;
continue;
}
#endif
break;
}
}

View File

@ -265,25 +265,15 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
xpos = strlen (cur_name)+6;
if (strchr(cur_name, '&') != NULL)
xpos--;
#ifndef HAVE_XVIEW
add_widget (query_dlg, button_new
(lines-3, cols, B_USER+i, NORMAL_BUTTON, cur_name,
0, 0, NULL));
#else
buttonnames [i] = cur_name;
#endif
cols += xpos;
if (i == sel_pos)
query_dlg->initfocus = query_dlg->current;
}
va_end (ap);
#ifdef HAVE_XVIEW
for (i = count - 1; i >= 0; i--)
add_widgetl (query_dlg, button_new
(0, 0, B_USER+i, NORMAL_BUTTON, buttonnames [i], 0, 0, NULL),
i ? XV_WLAY_RIGHTOF : XV_WLAY_CENTERROW);
#endif
add_widget (query_dlg, label_new (2, 3, text, NULL));
/* run dialog and make result */
@ -345,15 +335,8 @@ Dlg_head *message (int error, char *header, char *text, ...)
va_end (args);
query_dialog (header, buffer, error, 0);
#ifndef HAVE_XVIEW
d = last_query_dlg;
#ifdef HAVE_TK
if (error & D_INSERT){
init_dlg (d);
tk_dispatch_all ();
return d;
}
#else
init_dlg (d);
if (!(error & D_INSERT)){
mi_getch ();
@ -361,8 +344,6 @@ Dlg_head *message (int error, char *header, char *text, ...)
destroy_dlg (d);
} else
return d;
#endif
#endif
return 0;
}
#endif

12
src/x.h
View File

@ -3,18 +3,6 @@
# include "textconf.h"
#endif
#ifdef HAVE_XVIEW
# include "xvconf.h"
# include "xvmain.h"
#endif
#ifdef HAVE_TK
# include "tkconf.h"
# include "tkmain.h"
# include "tkwidget.h"
# include "tkscreen.h"
#endif
#ifdef HAVE_GNOME
# define GNOME_REGEX_H
# include <gnome.h>

View File

@ -1,3 +1,8 @@
1998-12-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* direntry.c (vfs_s_insert_super): This routine does not return
anything.
1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* fish.c (FISH_OP): changed snprintf to g_snprintf, as glib is

View File

@ -359,7 +359,6 @@ void vfs_s_insert_super (vfs *me, vfs_s_super *super)
if (MEDATA->supers != NULL) MEDATA->supers->prevp = &super->next;
MEDATA->supers = super;
return super;
}
void vfs_s_free_super (vfs *me, vfs_s_super *super)

View File

@ -1078,7 +1078,8 @@ my_forget (char *path)
int port, i, vers;
if (strncmp (path, "/#mc:", 5))
return NULL;
return;
path += 5;
if (path[0] == '/' && path[1] == '/')
path += 2;