diff -ruN old/mc-4.5.37/Makefile.in new/mc-4.5.38/Makefile.in
--- old/mc-4.5.37/Makefile.in Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/Makefile.in Thu Sep 2 12:49:35 1999
@@ -5,8 +5,8 @@
@MCFGR@@MCF@
foreigndirs=pc
-codedirs=vfs lib doc doc-gnome doc-gnome/C doc-gnome/C/figs slang gtkedit edit src gnome new_icons icons idl syntax
-unixdirs=intl $(codedirs) @POSUB@
+codedirs=vfs lib doc slang gtkedit edit src gnome new_icons icons idl syntax
+unixdirs=intl $(codedirs) doc-gnome @POSUB@
alldirs=$(unixdirs) $(foreigndirs)
subdirs=$(alldirs)
@@ -18,9 +18,9 @@
Makefile.in FAQ COPYING create_vcs install-sh \
config.h.in mc-aclocal.m4 aclocal.m4 acconfig.h \
VERSION mcfn_install.in Make.common.in README.PC \
- mc.spec mc.spec.in Specfile README.QNX VERSION.in \
+ mc.spec mc.spec.in README.QNX VERSION.in \
mkinstalldirs autogen.sh ABOUT-NLS gettext.m4 \
- config.guess config.sub
+ config.guess config.sub README.smbfs
all:
@for dir in @INTLSUB@ ${codedirs} @POSUB@; do \
@@ -103,36 +103,37 @@
cd vfs/samba && $(MAKE) $@
distcopy:
- sed -e "s/^%define ver .*/%define ver $(VERSION)/; s/^%define rel .*/%define rel 1/" mc.spec > Specfile
- mkdir ../mc-$(VERSION)
- cp $(DISTMAIN) ../mc-$(VERSION);
- for I in $(alldirs); do \
- mkdir ../mc-$(VERSION)/$$I; \
- cd $$I ; \
- echo Processing $$I; \
- $(MAKE) distcopy VERSION=$(VERSION) PACKAGE=mc || exit 1; \
- cd ..; done
- mkdir ../mc-$(VERSION)/macros
- cp $(GNOME_M4_FILES) ../mc-$(VERSION)/macros
- cd po; $(MAKE) || exit 1; cd ..;
- cp po/Makefile.in.in ../mc-$(VERSION)/po;
- cp po/POTFILES.in ../mc-$(VERSION)/po;
- cp po/*.po po/*.gmo po/mc.pot po/stamp-cat-id po/cat-id-tbl.c ../mc-$(VERSION)/po;
- (cd ..; tar cvf - mc-$(VERSION) | \
- gzip -f9 > mc-$(VERSION).tar.gz)
+ rm -rf $(top_srcdir)/mc-$(VERSION)
+ mkdir $(top_srcdir)/mc-$(VERSION)
+ for I in $(DISTMAIN); do cp $(top_srcdir)/$$I $(top_srcdir)/mc-$(VERSION) || cp $$I $(top_srcdir)/mc-$(VERSION); done
+ for I in $(unixdirs); do \
+ mkdir $(top_srcdir)/mc-$(VERSION)/$$I; \
+ $(MAKE) -C $$I distcopy VERSION=$(VERSION) PACKAGE=mc || exit 1; \
+ done
+ mkdir $(top_srcdir)/mc-$(VERSION)/macros
+ for I in $(GNOME_M4_FILES); do cp $(top_srcdir)/$$I $(top_srcdir)/mc-$(VERSION)/macros; done
+ $(MAKE) || exit 1; cd ..;
+ cp $(top_srcdir)/po/Makefile.in.in $(top_srcdir)/mc-$(VERSION)/po;
+ cp $(top_srcdir)/po/POTFILES.in $(top_srcdir)/mc-$(VERSION)/po;
+ cp $(top_srcdir)/po/*.po $(top_srcdir)/po/*.gmo $(top_srcdir)/po/mc.pot $(top_srcdir)/po/stamp-cat-id $(top_srcdir)/po/cat-id-tbl.c $(top_srcdir)/mc-$(VERSION)/po;
+ (cd $(top_srcdir); tar cvf - mc-$(VERSION) | \
+ gzip -f9) > mc-$(VERSION).tar.gz
dist: configure config.h.in distcopy
+ @:
+
+# rm -rf $(top_srcdir)/mc-$(VERSION) mc-$(VERSION)
mycheck: Makefile
- rm -rf ../mc-$(VERSION)
- tar xzvf ../mc-$(VERSION).tar.gz
+ rm -rf mc-$(VERSION)
+ tar xzvf $(top_srcdir)/mc-$(VERSION).tar.gz
mkdir mc-$(VERSION)/=build
mkdir mc-$(VERSION)/=inst
dc_install_base=`cd mc-$(VERSION)/=inst && pwd`; \
cd mc-$(VERSION)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) \
- && make install \
+ && make install
-rm -rf mc-$(VERSION)
mydistcheck: dist mycheck
diff -ruN old/mc-4.5.37/NEWS new/mc-4.5.38/NEWS
--- old/mc-4.5.37/NEWS Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/NEWS Thu Sep 2 12:49:35 1999
@@ -1,3 +1,11 @@
+Version 4.5
+
+- Too many new features to list.
+
+- This is the last version to be actively maintained. The GNOME
+ edition is in stabilization and maintenance phase only. A new file
+ manager is being written for the GNOME project.
+
Version 3.5
diff -ruN old/mc-4.5.37/README new/mc-4.5.38/README
--- old/mc-4.5.37/README Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/README Thu Sep 2 12:49:35 1999
@@ -2,8 +2,8 @@
Contents:
---------
- Requirments
- GNOME edition requirments
+ Requirements
+ GNOME edition requirements
Features
Midnight Commander editions
Where to get more information
@@ -21,8 +21,8 @@
radically different interfaces: the GNOME version is aimed to be a
simple to use tool for novice users.
-Requirments
------------
+Requirements
+------------
To compile the GNU Midnight Commander you need at least to have a copy
of the glib library, this library is available in ftp://ftp.gtk.org/pub/gtk.
@@ -50,68 +50,72 @@
It is feature packed:
o Built in Virtual File System: manipulate remote files
- systems through the ftp protocol or Midnight Commander's own
- mcfs protocol. Browse tar, compressed tar files, rpm, zip,
- cpio, lha and rar files with a single click.
+ systems through the FTP protocol or Midnight Commander's own
+ mcfs protocol. Browse tar, compressed tar files, RPM, zip,
+ cpio, lha and rar files with a single click.
- o All of the Midnight Commander operations work with the virtual
- file system, enabling you to do complex tasks.
+ o All of the Midnight Commander operations work with the
+ virtual file system, enabling you to do complex tasks.
o Mouse support on the Linux console and under X11's xterms.
o Learn Keys: The Midnight Commander may be configured at run
- time to support any kind of input keys for a given terminal,
- making its operation even on the most wierd terminals a
- breeze.
+ time to support any kind of input keys for a given terminal,
+ making its operation even on the most weird terminals a
+ breeze.
o Text and hex editors are available for you to use.
o Hotlist allows you to keep a list of common visited
- locations (including ftp sites).
+ locations (including FTP sites).
o Command completion: By pressing Alt-Tab in any place where a
- filename or an executable are expected, the Midnight Commander
- will complete for you the name. If you quickly press Alt-Tab
- twice you can get a listbox with the possible completions
- available.
+ filename or an executable are expected, the Midnight
+ Commander will complete for you the name. If you quickly
+ press Alt-Tab twice you can get a list box with the possible
+ completions available.
o Subshell support: Run your commands by a real shell
- interpreter. The Midnight Commander interacts with bash, tcsh
- and zsh to provide you with all of the facilities available in
- your shell.
+ interpreter. The Midnight Commander interacts with bash,
+ tcsh and zsh to provide you with all of the facilities
+ available in your shell.
o Find file command can now search inside the contents of
- files.
+ files.
o Background operations allows you to copy or move files from
- any virtual file system while you do other tasks (ie, you can
- do background ftp copies).
+ any virtual file system while you do other tasks (i.e., you
+ can do background FTP copies).
o Proxy support with our ftpfs.
o Linux file recovery: If you are using Linux system, you can
- recover deleted files from an ext2fs partition with the
- undelete file system. This is a low level file recovery
- function that will recover files deleted by any program in
- Linux.
-
- Please note that the undelete file system can only recover
- 12 file system blocks if the file was deleted with a kernel
- in the 2.0.x series. The 2.1.x series have fixed this and you
- can recover all of the file contents there.
+ recover deleted files from an ext2fs partition with the
+ undelete file system. This is a low level file recovery
+ function that will recover files deleted by any program in
+ Linux.
+
+ Please note that the undelete file system can only recover
+ 12 file system blocks if the file was deleted with a kernel
+ in the 2.0.x series. The 2.1.x series have fixed this and
+ you can recover all of the file contents there.
o External panelization: You can run any arbitrary external
- command and the Midnight Commander will display the output
- generated as a file listing that can be manipulated as a
- regular directory.
+ command and the Midnight Commander will display the output
+ generated as a file listing that can be manipulated as a
+ regular directory.
o Emacs like key bindings in all of our widgets.
- o Powerfull context dependant actions are available.
+ o Powerful context dependent actions are available.
- o Powerfull built-in file viewer: The file viewer, together
- with the context dependant actions is used to format man pages
- on the fly, coloring mail messages and more.
+ o Powerful built-in file viewer: The file viewer, together
+ with the context dependent actions is used to format man
+ pages on the fly, coloring mail messages and more.
+
+This list of features pertains to the terminal edition of the Midnight
+Commander. The GNOME edition's feature set is slightly different, for
+example, it does not include subshell support.
Where to get more information:
@@ -122,20 +126,20 @@
majordomo@roxanne.nuclecu.unam.mx
-There is a WWW page for the Midnight Commander with the URL:
- .
+There is a WWW page for the Midnight Commander at http://www.gnome.org/mc.
The Midnight Commander:
-----------------------
-The Midnight Commander is released under the GNU General Public License
-version 2.0 or any later version. A copy of the file is included with
-this distribution package.
+The Midnight Commander is released under the GNU General Public
+License version 2.0 or any later version. A copy of the file is
+included with this distribution package.
-If you have comments, you can send them to me:
+If you have comments, you can send them to us:
-miguel@roxanne.nuclecu.unam.mx
+miguel@nuclecu.unam.mx
+federico@nuclecu.unam.mx
or if it would benefit more people, to the mailing list:
@@ -164,8 +168,8 @@
o M-Tab completes the current word (or tries to).
-o The Virtual File System is a cute addition to the project, you may
- browse in tar and compressed tar files as well as browsing remote
+o The Virtual File System is a cute addition to the project, you may
+ browse in tar and compressed tar files as well as browsing remote
machines with the mcfs file system.
o Please read the manual page.
@@ -179,16 +183,13 @@
Where you may obtain the Midnight Commander
-------------------------------------------
-The software should be available by anonymous ftp at sunsite.unc.edu
-in the directory /pub/Linux/utils/file and at ftp.nuclecu.unam.mx
-in the directory /linux/local.
-
-The last alpha versions are available at ftp.nuclecu.unam.mx in the
-directory /linux/local/devel.
+You can download the latest version of the Midnight Commander by
+anonymous fTP at ftp.gnome.org in the directory /pub/GNOME/sources/mc.
+Please note that this is a very busy site; use a mirror if possible.
European mirrors of both version 3.1 and alpha versions are available
-at sunsite.mff.cuni.cz in the directory /GNU/mc and at ftp.teuto.de
-in the directory /lmb/mc.
+at sunsite.mff.cuni.cz in the directory /GNU/mc and at ftp.teuto.de in
+the directory /lmb/mc.
Reporting problems
@@ -211,4 +212,12 @@
(gdb) where
+Addendum
+--------
+No new features are being added to the GNOME edition of the Midnight
+Commander anymore. It is just in maintenance and bug fixing stage.
+The reason for this is that the current design of the Midnight
+Commander is not suited well at all for a graphical version with
+multiple windows and asynchronous file operations. A new file manager
+is being written for the GNOME project.
diff -ruN old/mc-4.5.37/README.smbfs new/mc-4.5.38/README.smbfs
--- old/mc-4.5.37/README.smbfs Wed Dec 31 19:00:00 1969
+++ new/mc-4.5.38/README.smbfs Thu Sep 2 12:49:35 1999
@@ -0,0 +1,4 @@
+
+Robert Wayne has a page discussing all issues with smbfs:
+
+ http://members.home.com/wroberts1/smbfs.html
diff -ruN old/mc-4.5.37/Specfile new/mc-4.5.38/Specfile
--- old/mc-4.5.37/Specfile Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/Specfile Wed Dec 31 19:00:00 1969
@@ -1,252 +0,0 @@
-# Note that this is NOT a relocatable package
-%define ver 4.5.37
-%define rel 1
-%define prefix /usr
-
-Summary: Midnight Commander visual shell
-Name: mc
-Version: %ver
-Release: %rel
-Copyright: GPL
-Group: System Environment/Shells
-Source0: ftp://ftp.nuclecu.unam.mx/linux/local/devel/mc-%{PACKAGE_VERSION}.tar.gz
-URL: http://www.gnome.org/mc/
-BuildRoot: /var/tmp/mc-%{PACKAGE_VERSION}-root
-Requires: pam >= 0.59
-Prereq: /sbin/chkconfig
-
-%description
-Midnight Commander is a visual shell much like a file manager, only with way
-more features. It is text mode, but also includes mouse support if you are
-running GPM. Its coolest feature is the ability to ftp, view tar, zip
-files, and poke into RPMs for specific files. :-)
-
-%package -n gmc
-Summary: Midnight Commander visual shell (GNOME version)
-Requires: mc >= %{PACKAGE_VERSION}
-Group: Interface/Desktops
-%description -n gmc
-Midnight Commander is a visual shell much like a file manager, only with
-way more features. This is the GNOME version. It's coolest feature is the
-ability to ftp, view tar, zip files and poke into RPMs for specific files.
-The GNOME version of Midnight Commander is not yet finished though. :-(
-
-%package -n mcserv
-Summary: Midnight Commander file server
-Group: System Environment/Daemons
-Requires: portmap
-%description -n mcserv
-mcserv is the server program for the Midnight Commander networking file
-system. It provides access to the host file system to clients running the
-Midnight file system (currently, only the Midnight Commander file manager).
-
-%prep
-%setup -q
-
-%build
-CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s" ./configure \
- --prefix=%{prefix} --with-included-slang \
- --with-gnome \
- --without-debug \
- --sysconfdir=/etc
-
-if [ "$SMP" != "" ]; then
- (make "MAKE=make -k -j $SMP"; exit 0)
- make
-else
- make
-fi
-
-%install
-echo $RPM_BUILD_ROOT
-rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,pam.d,profile.d,X11/wmconfig}
-
-
-make prefix=$RPM_BUILD_ROOT%{prefix} sysconfdir=$RPM_BUILD_ROOT/etc install
-(cd icons; make prefix=$RPM_BUILD_ROOT%{prefix} install_icons)
-install lib/mcserv.init $RPM_BUILD_ROOT/etc/rc.d/init.d/mcserv
-
-install lib/mcserv.pamd $RPM_BUILD_ROOT/etc/pam.d/mcserv
-install lib/{mc.sh,mc.csh} $RPM_BUILD_ROOT/etc/profile.d
-install lib/mc.global $RPM_BUILD_ROOT/etc
-
-
-# clean up this setuid problem for now
-chmod 755 $RPM_BUILD_ROOT%{prefix}/lib/mc/bin/cons.saver
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%post -n mcserv
-/sbin/chkconfig --add mcserv
-
-%postun -n mcserv
-/sbin/chkconfig --del mcserv
-
-%files
-%defattr(-, root, root)
-
-%doc FAQ COPYING NEWS README
-%{prefix}/bin/mc
-%{prefix}/bin/mcedit
-%{prefix}/bin/mcmfmt
-%{prefix}/lib/mc/mc.ext
-%{prefix}/lib/mc/mc.hint
-%{prefix}/lib/mc/mc.hlp
-%{prefix}/lib/mc/mc.lib
-%{prefix}/lib/mc/mc.menu
-%{prefix}/lib/mc/bin/cons.saver
-%{prefix}/lib/mc/extfs/*
-%{prefix}/lib/mc/syntax/*
-%{prefix}/man/man1/*
-%config /etc/profile.d/*
-%dir %{prefix}/lib/mc
-%dir %{prefix}/lib/mc/bin
-
-%files -n mcserv
-%defattr(-, root, root)
-
-%config /etc/pam.d/mcserv
-%config /etc/rc.d/init.d/mcserv
-%attr(-, root, man) %{prefix}/man/man8/mcserv.8
-%{prefix}/bin/mcserv
-
-%files -n gmc
-%defattr(-, root, root)
-%{prefix}/bin/gmc
-%{prefix}/bin/plain-gmc
-%{prefix}/lib/mc/layout
-%{prefix}/lib/mc/mc-gnome.ext
-%{prefix}/share/pixmaps/mc/*
-%{prefix}/share/mime-info/mc.keys
-%config /etc/CORBA/servers/*
-
-%changelog
-* Tue Jun 22 1999 Vladimir Kondratiev
-- added syntax files to %files
-
-* Wed May 26 1999 Cody Russell
-- chmod cons.saver at $RPM_BUILD_ROOT%{prefix}/lib rather than at
- $RPM_BUILD_ROOT/usr/lib. We can now install to somewhere other than /usr.
-
-* Sun Apr 18 1999 Gregory McLean
-- Updated the specfile, removed some kludges.
-
-* Thu Aug 20 1998 Michael Fulbright
-- rebuilt against gnome-libs 0.27 and gtk+-1.1
-
-* Thu Jul 09 1998 Michael Fulbright
-- made cons.saver not setuid
-
-* Sun Apr 19 1998 Marc Ewing
-- removed tkmc
-
-* Wed Apr 8 1998 Marc Ewing
-- add /usr/lib/mc/layout to gmc
-
-* Tue Dec 23 1997 Tomasz K這czko
-- added --without-debug to configure,
-- modification in %build and %install and cosmetic modification in packages
- headers,
-- added %%{PACKAGE_VERSION} macro to Buildroot,
-- removed "rm -rf $RPM_BUILD_ROOT" from %prep.
-- removed Packager field.
-
-* Thu Dec 18 1997 Michele Marziani
-- Merged spec file with that from RedHat-5.0 distribution
- (now a Hurricane-based distribution is needed)
-- Added patch for RPM script (didn't always work with rpm-2.4.10)
-- Corrected patch for mcserv init file (chkconfig init levels)
-- Added more documentation files on termcap, terminfo, xterm
-
-* Thu Oct 30 1997 Michael K. Johnson
-
-- Added dependency on portmap
-
-* Wed Oct 29 1997 Michael K. Johnson
-
-- fixed spec file.
-- Updated to 4.1.8
-
-* Sun Oct 26 1997 Tomasz K這czko
-
-- updated to 4.1.6
-- added %attr macros in %files,
-- a few simplification in %install,
-- removed glibc patch,
-- fixed installing /etc/X11/wmconfig/tkmc.
-
-* Thu Oct 23 1997 Michael K. Johnson
-
-- updated to 4.1.5
-- added wmconfig
-
-* Wed Oct 15 1997 Erik Troan
-
-- chkconfig is for mcserv package, not mc one
-
-* Tue Oct 14 1997 Erik Troan
-
-- patched init script for chkconfig
-- don't turn on the service by default
-
-* Fri Oct 10 1997 Michael K. Johnson
-
-- Converted to new PAM conventions.
-- Updated to 4.1.3
-- No longer needs glibc patch.
-
-* Thu May 22 1997 Michele Marziani
-
-- added support for mc alias in /etc/profile.d/mc.csh (for csh and tcsh)
-- lowered number of SysV init scripts in /etc/rc.d/rc[0,1,6].d
- (mcserv needs to be killed before inet)
-- removed all references to $RPM_SOURCE_DIR
-- restored $RPM_OPT_FLAGS when compiling
-- minor cleanup of spec file: redundant directives and comments removed
-
-* Sun May 18 1997 Michele Marziani
-
-- removed all references to non-existent mc.rpmfs
-- added mcedit.1 to the %files section
-- reverted to un-gzipped man pages (RedHat style)
-- removed double install line for mcserv.pamd
-
-* Tue May 13 1997 Tomasz K這czko
-
-- added new rpmfs script,
-- removed mcfn_install from mc (adding mc() to bash enviroment is in
- /etc/profile.d/mc.sh),
-- /etc/profile.d/mc.sh changed to %config,
-- removed /usr/lib/mc/bin/create_vcs,
-- removed /usr/lib/mc/term.
-
-* Wed May 9 1997 Tomasz K這czko
-
-- changed source url,
-- fixed link mcedit to mc,
-
-* Tue May 7 1997 Tomasz K這czko
-
-- new version 3.5.27,
-- %dir /usr/lib/mc/icons and icons removed from tkmc,
-- added commented xmc part.
-
-* Tue Apr 22 1997 Tomasz K這czko
-
-- FIX spec:
- - added URL field,
- - in mc added missing /usr/lib/mc/mc.ext, /usr/lib/mc/mc.hint,
- /usr/lib/mc/mc.hlp, /usr/lib/mc/mc.lib, /usr/lib/mc/mc.menu.
-
-* Fri Apr 18 1997 Tomasz K這czko
-
-- added making packages: tkmc, mcserv (xmc not work yet),
-- gziped man pages,
-- added /etc/pamd.d/mcserv PAM config file.
-- added instaling icons,
-- added /etc/profile.d/mc.sh,
-- in %doc added NEWS README,
-- removed /usr/lib/mc/FAQ,
-- added mcserv.init script for mcserv (start/stop on level 86).
diff -ruN old/mc-4.5.37/VERSION new/mc-4.5.38/VERSION
--- old/mc-4.5.37/VERSION Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/VERSION Thu Sep 2 12:49:35 1999
@@ -1 +1 @@
-#define VERSION "4.5.37"
+#define VERSION "4.5.38"
diff -ruN old/mc-4.5.37/aclocal.m4 new/mc-4.5.38/aclocal.m4
--- old/mc-4.5.37/aclocal.m4 Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/aclocal.m4 Thu Sep 2 12:49:35 1999
@@ -1,4 +1,4 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4a
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
diff -ruN old/mc-4.5.37/configure new/mc-4.5.38/configure
--- old/mc-4.5.37/configure Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/configure Thu Sep 2 12:49:35 1999
@@ -588,7 +588,7 @@
PACKAGE=mc
-VERSION=4.5.37
+VERSION=4.5.38
cat >> confdefs.h <&6
fi
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -1742,7 +1742,7 @@
X11_WWW=lynx
fi
-ALL_LINGUAS="ca cs da de es es_ES fi fr hu it ja ko no pl ro ru wa zh_TW.Big5"
+ALL_LINGUAS="ca cs da de el es es_ES fi fr hu it ja ko no pl ro ru sv wa zh_TW.Big5"
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1749: checking for ANSI C header files" >&5
@@ -10379,6 +10379,7 @@
CPPFLAGS="$CPPFLAGS -I../slang"
fastdepslang=fastdepslang
mkdir -p slang
+ rm -f slang/slang.h
case "$srcdir" in
/*) ln -sf $srcdir/slang/slang-mc.h slang/slang.h;;
*) ln -sf ../$srcdir/slang/slang-mc.h slang/slang.h;;
@@ -10410,7 +10411,7 @@
EOF
echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:10414: checking for tgoto in -ltermcap" >&5
+echo "configure:10415: checking for tgoto in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10418,7 +10419,7 @@
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -10544,17 +10545,17 @@
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10548: checking for $ac_hdr" >&5
+echo "configure:10549: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -10607,7 +10608,7 @@
fi
else
echo $ac_n "checking for ext2fs_close in -lext2fs""... $ac_c" 1>&6
-echo "configure:10611: checking for ext2fs_close in -lext2fs" >&5
+echo "configure:10612: checking for ext2fs_close in -lext2fs" >&5
ac_lib_var=`echo ext2fs'_'ext2fs_close | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10615,7 +10616,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lext2fs $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -10647,17 +10648,17 @@
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10651: checking for $ac_hdr" >&5
+echo "configure:10652: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -10723,7 +10724,7 @@
if $search_ncurses
then
echo "checking "location of ncurses.h file"" 1>&6
-echo "configure:10727: checking "location of ncurses.h file"" >&5
+echo "configure:10728: checking "location of ncurses.h file"" >&5
if $search_ncurses
@@ -10863,7 +10864,7 @@
if $search_ncurses
then
cat > conftest.$ac_ext <
EOF
@@ -10889,7 +10890,7 @@
rm -f conftest*
cat > conftest.$ac_ext <
@@ -10949,10 +10950,10 @@
else
# check for ncurses version, to properly ifdef mouse-fix
echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:10953: checking for ncurses version" >&5
+echo "configure:10954: checking for ncurses version" >&5
ncurses_version=unknown
cat > conftest.$ac_ext <
@@ -10996,12 +10997,12 @@
for ac_func in resizeterm keyok
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11000: checking for $ac_func" >&5
+echo "configure:11001: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -11073,7 +11074,7 @@
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS="$ac_save_LIBS"; cat >> confdefs.h <<\EOF
#define SLANG_TERMINFO 1
@@ -11106,7 +11107,7 @@
EOF
echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:11110: checking for tgoto in -ltermcap" >&5
+echo "configure:11111: checking for tgoto in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11114,7 +11115,7 @@
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -11159,6 +11160,7 @@
CPPFLAGS="$CPPFLAGS -I../slang"
fastdepslang=fastdepslang
mkdir -p slang
+ rm -f slang/slang.h
case "$srcdir" in
/*) ln -sf $srcdir/slang/slang-mc.h slang/slang.h;;
*) ln -sf ../$srcdir/slang/slang-mc.h slang/slang.h;;
@@ -11190,7 +11192,7 @@
EOF
echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
-echo "configure:11194: checking for tgoto in -ltermcap" >&5
+echo "configure:11196: checking for tgoto in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11198,7 +11200,7 @@
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -11249,7 +11251,7 @@
install_saver="yes"
echo $ac_n "checking for pam_start in -lpam""... $ac_c" 1>&6
-echo "configure:11253: checking for pam_start in -lpam" >&5
+echo "configure:11255: checking for pam_start in -lpam" >&5
ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11257,7 +11259,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lpam -ldl $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -11311,7 +11313,7 @@
else
echo $ac_n "checking for -lXpm""... $ac_c" 1>&6
-echo "configure:11315: checking for -lXpm" >&5
+echo "configure:11317: checking for -lXpm" >&5
if eval "test \"`echo '$''{'ac_cv_has_xpm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -11327,7 +11329,7 @@
has_xpm_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <
@@ -11337,7 +11339,7 @@
XpmLibraryVersion();
; return 0; }
EOF
-if { (eval echo configure:11341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_has_xpm=yes
else
@@ -11359,7 +11361,7 @@
echo $ac_n "checking for X11 non-rectangular shape extension""... $ac_c" 1>&6
-echo "configure:11363: checking for X11 non-rectangular shape extension" >&5
+echo "configure:11365: checking for X11 non-rectangular shape extension" >&5
if eval "test \"`echo '$''{'ac_cv_has_shape'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -11375,7 +11377,7 @@
has_shape_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <
@@ -11390,7 +11392,7 @@
; return 0; }
EOF
-if { (eval echo configure:11394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_has_shape=yes
else
@@ -11426,7 +11428,7 @@
echo
else
echo $ac_n "checking for setupterm in -lcurses""... $ac_c" 1>&6
-echo "configure:11430: checking for setupterm in -lcurses" >&5
+echo "configure:11432: checking for setupterm in -lcurses" >&5
ac_lib_var=`echo curses'_'setupterm | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11434,7 +11436,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -11462,7 +11464,7 @@
echo "$ac_t""yes" 1>&6
cat > conftest.$ac_ext <
@@ -11475,7 +11477,7 @@
; return 0; }
EOF
-if { (eval echo configure:11479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
LIBS="$LIBS -lcurses"
diff -ruN old/mc-4.5.37/configure.in new/mc-4.5.38/configure.in
--- old/mc-4.5.37/configure.in Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/configure.in Thu Sep 2 12:49:35 1999
@@ -5,7 +5,7 @@
AC_CONFIG_HEADER(config.h)
PACKAGE=mc
-VERSION=4.5.37
+VERSION=4.5.38
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(VERSION)
@@ -70,7 +70,7 @@
X11_WWW=lynx
fi
-ALL_LINGUAS="ca cs da de es es_ES fi fr hu it ja ko no pl ro ru wa zh_TW.Big5"
+ALL_LINGUAS="ca cs da de el es es_ES fi fr hu it ja ko no pl ro ru sv wa zh_TW.Big5"
dnl ultra ulgy hack to get MKINSTALLDIRS right
AM_GNU_GETTEXT
@@ -886,6 +886,7 @@
CPPFLAGS="$CPPFLAGS -I../slang"
fastdepslang=fastdepslang
mkdir -p slang
+ rm -f slang/slang.h
case "$srcdir" in
/*) ln -sf $srcdir/slang/slang-mc.h slang/slang.h;;
*) ln -sf ../$srcdir/slang/slang-mc.h slang/slang.h;;
diff -ruN old/mc-4.5.37/doc/Makefile.in new/mc-4.5.38/doc/Makefile.in
--- old/mc-4.5.37/doc/Makefile.in Mon Jul 12 23:57:23 1999
+++ new/mc-4.5.38/doc/Makefile.in Thu Sep 2 12:49:38 1999
@@ -78,6 +78,6 @@
-$(RMF) $(srcdir)/*~ $(srcdir)/Makefile $(srcdir)/*.1 $(srcdir)/*.8
distcopy:
- $(CP) $(DISTDOC) ../../mc-$(VERSION)/doc
+ for I in $(DISTDOC); do $(CP) $(top_srcdir)/doc/$$I $(top_srcdir)/mc-$(VERSION)/doc; done
depend dep:
diff -ruN old/mc-4.5.37/doc-gnome/C/Makefile.in new/mc-4.5.38/doc-gnome/C/Makefile.in
--- old/mc-4.5.37/doc-gnome/C/Makefile.in Mon Jul 12 23:57:24 1999
+++ new/mc-4.5.38/doc-gnome/C/Makefile.in Thu Sep 2 12:49:46 1999
@@ -179,7 +179,7 @@
gmc_helpdir = $(datadir)/gnome/help/gmc/C
-gmc_help_DATA = gmc.html topic.dat
+gmc_help_DATA = index.html topic.dat
SGML_FILES = gmc.sgml
@@ -267,10 +267,11 @@
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
+
distcopy:
- mkdir ../../../mc-$(VERSION)/doc-gnome/C/figs
- $(CP) $(DISTDOCS) ../../../mc-$(VERSION)/doc-gnome/C/
- $(CP) $(DISTFIGS) ../../../mc-$(VERSION)/doc-gnome/C/figs
+ mkdir $(top_srcdir)/mc-$(VERSION)/doc-gnome/C/figs
+ for I in $(DISTDOCS) $(DISTFIGS); do $(CP) $(top_srcdir)/doc-gnome/C/$$I $(top_srcdir)/mc-$(VERSION)/doc-gnome/C; done
+
info-am:
info: info-am
dvi-am:
@@ -302,11 +303,12 @@
mostlyclean-generic:
+ -rm -f index.html
clean-generic:
distclean-generic:
- -rm -f Makefile gmc.html $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -rf gmc
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
@@ -339,8 +341,11 @@
all:
+index.html:
+
gmc.html: gmc/gmc.html
-cp gmc/gmc.html .
+ -ln -s gmc.html index.html
gmc/gmc.html: $(SGML_FILES)
-db2html gmc.sgml
@@ -349,17 +354,17 @@
mkdir $(distdir)/gmc
-cp gmc/*.html gmc/*.css $(distdir)/gmc
-cp gmc.html $(distdir)
- mkdir $(distdir)/images
- -cp images/*.gif images/*.jpg $(distdir)/images
+ mkdir $(distdir)/figs
+ -cp figs/*.gif $(distdir)/figs
install-data-local: gmc.html
- $(mkinstalldirs) $(gmc_helpdir)/images
+ $(mkinstalldirs) $(gmc_helpdir)/figs
-for file in $(srcdir)/gmc/*.html $(srcdir)/gmc/*.css; do \
basefile=`basename $$file`; \
$(INSTALL_DATA) $(srcdir)/$$file $(gmc_helpdir)/$$basefile; \
done
- -for file in $(srcdir)/images/*.jpg $(srcdir)/images/*.gif; do \
- $(INSTALL_DATA) $(srcdir)/$$file $(gmc_helpdir)/images;\
+ -for file in $(srcdir)/figs/*.gif; do \
+ $(INSTALL_DATA) $(srcdir)/$$file $(gmc_helpdir)/figs;\
done
gmc.ps: gmc.sgml
Binary files old/mc-4.5.37/doc-gnome/C/custom-view.gif and new/mc-4.5.38/doc-gnome/C/custom-view.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/fileprops.gif and new/mc-4.5.38/doc-gnome/C/figs/fileprops.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gccmime.gif and new/mc-4.5.38/doc-gnome/C/figs/gccmime.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gmc1.gif and new/mc-4.5.38/doc-gnome/C/figs/gmc1.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gmc_move.gif and new/mc-4.5.38/doc-gnome/C/figs/gmc_move.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gmcprops1.gif and new/mc-4.5.38/doc-gnome/C/figs/gmcprops1.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gmcprops2.gif and new/mc-4.5.38/doc-gnome/C/figs/gmcprops2.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gmcprops3.gif and new/mc-4.5.38/doc-gnome/C/figs/gmcprops3.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/gmcprops4.gif and new/mc-4.5.38/doc-gnome/C/figs/gmcprops4.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/open_with.gif and new/mc-4.5.38/doc-gnome/C/figs/open_with.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/figs/rubberband.gif and new/mc-4.5.38/doc-gnome/C/figs/rubberband.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/fileprops.gif and new/mc-4.5.38/doc-gnome/C/fileprops.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/gccmime.gif and new/mc-4.5.38/doc-gnome/C/gccmime.gif differ
diff -ruN old/mc-4.5.37/doc-gnome/C/gmc.sgml new/mc-4.5.38/doc-gnome/C/gmc.sgml
--- old/mc-4.5.37/doc-gnome/C/gmc.sgml Mon Jul 12 23:57:24 1999
+++ new/mc-4.5.38/doc-gnome/C/gmc.sgml Thu Sep 2 12:49:46 1999
@@ -1,6 +1,6 @@
-
+
Gnome Midnight Commander Documentation
@@ -42,7 +42,7 @@
-
+
The GNOME File Manager
Introduction
@@ -88,21 +88,22 @@
- There are two main windows within the GNOME File Manager. On the
- left is the tree view which represents all of the directories on
- your system by their hierarchical position. On the right is the
- directory window which will show you the contents of the directory
- which you have selected in the tree view.
+ There are two main windows within the GNOME File Manager. On the left is the
+ tree view, which represents all of the directories on your system by their
+ hierarchical position. On the right is the directory window, which will show
+ you the contents of the directory which you have selected in the tree view.
+
+
+ To select a directory in the tree view simply use a single mouse click. This
+ will change the main directory view, showing the files in the directory you
+ have chosen. If there is a plus sign to the left of a directory name in the
+ tree window, you may click on it to show subdirectories. At this point the
+ plus sign will have changed to a minus sign. If you click on the minus
+ sign, the subdirectory once again becomes hidden in the tree view and the
+ plus sign reappears.
- To select a directory in the tree view simply use a single mouse
- click. This will change the main directory view, showing the files
- in the directory you have chosen. If there are directories
- contained within the directory, you may click on the plus sign in
- the tree view to expand the directory.
-
-
-
+
GNOME File Manager
@@ -110,16 +111,16 @@
Viewing Files
- The main file view has a few viewing options you may wish to take
- advantage of: the icon view and detailed views.
+ The directry window has a few viewing options you may wish to
+ take advantage of: the icon view and three list views, brief,
+ detailed and custom.
- The icon view is the default view and will display large icons for
- each file. The Brief view shows the files and directories in a
- list but without any extra information shown.The Detailed view
- will display a list view of the files in the directory and
- information about the files. The Custom view is a list view which
- allows you to select the information you want to view about files.
+ The icon view is the default view and will display large icons for each
+ file. The Brief view shows the files and directories in a list. The
+ Detailed view expands this list to include information about the files. The
+ The Custom view is a list view that allows you to select the information you
+ want to view about files.
In the Brief, Detailed, and Custom views if you click on one of
@@ -134,7 +135,7 @@
Moving Around the GNOME File Manager
-
+
GNOME File Manager
@@ -150,7 +151,7 @@
which you would like to view in the main window.
-
+
GNOME File Manager
@@ -169,13 +170,12 @@
ftp://[site address]
- Next to the Location text box are navigation buttons you might
- wish to use. These buttons with the arrow icons allow you to move
- within the directories adjacent to the one you are in. The left
- button will take you to the previous directory you were in, the
- middle button will take you up one level in the directory
- hierarchy, and the right button will take you to the next
- directory if you have just moved backwards.
+ Above the Location text box are navigation buttons you might wish to
+ use. These buttons with the arrow icons allow you to move within the
+ directories adjacent to the one you are in. The left button will take you to
+ the previous directory you were in, the middle button will take you up one
+ level in the directory hierarchy, and the right button will take you to the
+ next directory if you have just moved backwards.
TIP
@@ -191,7 +191,7 @@
Selecting Files
-
+
GNOME File Manager
@@ -204,7 +204,7 @@
will then highlight to show you that it has been selected.
-
+
GNOME File Manager
@@ -243,7 +243,7 @@
Edit menu.
-
+
GNOME File Manager
@@ -266,7 +266,7 @@
Copying and Moving Files
-
+
GNOME File Manager
@@ -274,7 +274,7 @@
Copying files
-
+
GNOME File Manager
@@ -282,14 +282,20 @@
Moving files
- The default action for drag and drop in the GNOME File Manager is
- to move files. But you can also use drag and drop to copy a file
- by pressing the SHIFT key while dragging the
- file(s). This will work the same for any files you drag to the
- desktop.
+ The default action for dragging and dropping files between the GNOME File
+ Manager and the desktop is to move them. But you can also use drag and drop
+ to copy a file by pressing the SHIFT key while dragging the
+ file(s). You can also drag a file within the file manager to another
+ directory. Select the file in the main window and drag it to the desired
+ directory in the tree window. Note, however, that when dragging to the tree
+ window the default action is to copy the file. As you drag the file to the
+ tree window, you will see a plus sign appear to remind you that theh file
+ will be copied. You can also use drag and drop to copy directories the same
+ way as you did for files. Again note the plus sign signifying that the
+ directory will be copied, not moved.
-
+
GNOME File Manager
@@ -297,12 +303,13 @@
Linking files
- You may also toggle a menu which lets you decide what action to
- perform with a drag by using the middle mouse button to drag a
- file or pressing the ALT Key while dragging a
- file. Once you release the drag you will get a pop-up menu which
- contains the options Copy, Move, Link, and Cancel Drag.
+ You may also bring up a menu which lets you decide what action to perform
+ with a drag by using the middle mouse button to drag a file or pressing the
+ ALT key while dragging a file. Once you release the drag
+ you will get a pop-up menu which contains the options Copy, Move, Link, and
+ Cancel Drag.
+
The Move Dialog
@@ -321,7 +328,7 @@
-
+
GNOME File Manager
@@ -335,21 +342,20 @@
and works exactly the same way as the Move/rename dialog.
- If the file you are moving has a symbolic link associated with it
- -- that is, a virtual link to where the file actually resides --
- you may select the Advanced Options tab and
- select Preserve symlinks . Selecting this
- will make sure the link is preserved despite the move.
+ If the file you are moving is a symbolic link — that is, a virtual
+ link to where the file actually resides (called a shortcut in some other
+ operating systems) — you may select the Advanced
+ Options tab and select Preserve symlinks .
+ Selecting this will make sure the link is preserved despite the move.
- It is recommended that you use this method of moving a file if it
- has a symbolic link associated to it.
+ It is recommended that you use this method of moving a symbolic link.
Renaming Files
-
+
GNOME File Manager
@@ -375,18 +381,18 @@
- A shortcut method to rename a file is to slowly double click on
- the file. Make sure this is slow so you do not launch the file
- but you simply highlight and then click again. At this point the
- name of the file will enter into the editing mode, your mouse
- cursor will change to an editing line, and you can type in the new
+ A shortcut method to rename a file is to slowly double click on the filename
+ in the icon view or on the desktop. Make sure the double-click is slow so
+ you do not launch the file but you simply highlight and then click again.
+ At this point the name of the file will enter into the editing mode, your
+ mouse cursor will change to an editing line, and you can type in the new
name.
Launching Applications From the GNOME File Manager
-
+
GNOME File Manager
@@ -400,7 +406,7 @@
file types are handled by reading
-
+
GNOME File Manager
@@ -408,18 +414,16 @@
Open with
- If the file does not have an associated application you can right
- mouse click on the file and select Open
- with from the pop-up
- menu. This will bring up a dialog which allows you to define the
- application which will launch the file. For example, if you want
- to edit my file names test.txt with
- Emacs (a popular text editor) you can
- right mouse click on test.txt and choose Open
- with . When you get the Open with dialog box simply
- type in emacs in front of the test.txt file name. When you press
- OK Emacs will
- open the file.
+ If the file does not have an associated application you can right mouse
+ click on the file and select Open with from the
+ pop-up menu. This will bring up a dialog that
+ allows you to define the application which will launch the file. For example,
+ if you want to edit a file named test.txt with
+ Emacs (a popular text editor), you can right mouse
+ click on test.txt and choose Open with . When you
+ get the Open with dialog box simply type in emacs in front of the test.txt
+ file name. When you press OK
+ Emacs will open the file.
The Open With Dialog
@@ -433,7 +437,7 @@
File Properties and Actions
-
+
GNOME File Manager
@@ -448,10 +452,9 @@
- Open - This will open the file with
- the proper application associated with it. You may read more
- about editing these associations in .
+ Open - This will open the file with the default
+ application associated with it. You may read more about editing these
+ associations in .
@@ -489,9 +492,9 @@
Move - This will bring up the
- Move dialog which will allow you to move
- the file. You can read more about this dialog and moving files
- in .
+ Move dialog, which will allow you to move the
+ file. You can read more about this dialog and moving files in .
- Exit - This will allow you to exit
- out of the GNOME File Manager.
+ Exit - This will allow you to exit the GNOME
+ File Manager.
IMPORTANT
- This will exit all GNOME File Manager processes which
- include the GNOME Desktop. If you exit you will lose all
- functionality on your desktop. This option is not
- recommended.
+ This will exit all GNOME File Manager processes which include the
+ GNOME Desktop. If you exit you will lose all functionality on your
+ desktop. This action is not recommended. If you wish to close the
+ current window, use the File/Close button.
@@ -1186,7 +1181,7 @@
A Drag and Drop Tour of GNOME
-
+
GNOME
@@ -1242,9 +1237,9 @@
- Dragging Files - There are many ways to use drag and drop to
- help you manage your system. You can open two GNOME File Manager
- windows to two different directories then drag files between the
+ Dragging Files - There are many ways to use drag and drop to help you
+ manage your system. You can open two GNOME File Manager windows to
+ two different directories then drag files between the
two windows to copy, move, or link files. You can drag files
from the File Manager to the desktop to make it more
accessible. Use the middle mouse button or the right and left
Binary files old/mc-4.5.37/doc-gnome/C/gmc1.gif and new/mc-4.5.38/doc-gnome/C/gmc1.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/gmc_move.gif and new/mc-4.5.38/doc-gnome/C/gmc_move.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/gmcprops1.gif and new/mc-4.5.38/doc-gnome/C/gmcprops1.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/gmcprops2.gif and new/mc-4.5.38/doc-gnome/C/gmcprops2.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/gmcprops3.gif and new/mc-4.5.38/doc-gnome/C/gmcprops3.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/gmcprops4.gif and new/mc-4.5.38/doc-gnome/C/gmcprops4.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/open_with.gif and new/mc-4.5.38/doc-gnome/C/open_with.gif differ
Binary files old/mc-4.5.37/doc-gnome/C/rubberband.gif and new/mc-4.5.38/doc-gnome/C/rubberband.gif differ
diff -ruN old/mc-4.5.37/doc-gnome/Makefile.in new/mc-4.5.38/doc-gnome/Makefile.in
--- old/mc-4.5.37/doc-gnome/Makefile.in Mon Jul 12 23:57:24 1999
+++ new/mc-4.5.38/doc-gnome/Makefile.in Thu Sep 2 12:49:46 1999
@@ -380,7 +380,9 @@
distclean: distclean-recursive
distcopy:
- $(CP) $(DISTDOCS) ../../mc-$(VERSION)/doc-gnome
+ mkdir $(top_srcdir)/mc-$(VERSION)/doc-gnome/C
+ $(MAKE) -C C distcopy VERSION=$(VERSION) PACKAGE=mc
+ for I in $(DISTDOCS); do $(CP) $(top_srcdir)/doc-gnome/$$I $(top_srcdir)/mc-$(VERSION)/doc-gnome; done
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
diff -ruN old/mc-4.5.37/edit/Makefile.in new/mc-4.5.38/edit/Makefile.in
--- old/mc-4.5.37/edit/Makefile.in Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/edit/Makefile.in Thu Sep 2 12:49:40 1999
@@ -90,7 +90,7 @@
-$(RMF) $(DESTDIR)$(bindir)/$(binprefix)mcedit
distcopy:
- $(CP) $(DIST) ../../mc-$(VERSION)/edit
+ for I in $(DIST); do $(CP) $(top_srcdir)/edit/$$I $(top_srcdir)/mc-$(VERSION)/edit; done
depend dep: mcdep
diff -ruN old/mc-4.5.37/gnome/ChangeLog new/mc-4.5.38/gnome/ChangeLog
--- old/mc-4.5.37/gnome/ChangeLog Mon Jul 12 23:57:30 1999
+++ new/mc-4.5.38/gnome/ChangeLog Thu Sep 2 12:49:43 1999
@@ -1,3 +1,274 @@
+1999-09-01 Federico Mena Quintero
+
+ * gscreen.c (panel_icon_renamed): Do nothing if the name did not
+ change.
+
+1999-08-30 Federico Mena Quintero
+
+ * gdnd.c (file_has_drop_action): New function to test whether a
+ file has the drop-action metadata or MIME action property.
+ (gdnd_validate_action): Take the drop-action metadata/MIME
+ property into account.
+ (gdnd_can_drop_on_file): New function to see whether a
+ non-directory file can take drops.
+
+ * gscreen.c (drop_on_panel): New helper function to drop stuff on
+ a panel. This uses gdnd_can_drop_on_file so that we have the
+ correct behavior. This enables dropping on executables and files
+ with the drop-action metadata/MIME property again.
+ (panel_icon_list_drag_data_received): Use drop_on_panel().
+ (panel_clist_drag_data_received): Use drop_on_panel(). Normalize
+ the Y coordinate to the clist_window.
+
+1999-08-26 Federico Mena Quintero
+
+ * gscreen.c (panel_clist_drag_motion): Pass the full name to
+ gdnd_validate_action().
+ (panel_icon_list_drag_motion): Likewise.
+ (panel_tree_drag_motion): Likewise.
+
+ * gdnd.c (gdnd_perform_drop): Renamed the "directory" argument to
+ "dest_full_name" for clarity.
+ (gdnd_validate_action): Likewise. Pass in the full name to
+ if_link_is_exe().
+ (drop_on_file): Do not compute the full name, since we are already
+ get it from the caller.
+ (drop_on_file): Pass in the full name to if_link_is_exe().
+
+ * gscreen.c (panel_tree_drag_data_received): Free the pathname.
+
+ * gdesktop.c (icon_drag_data_received): Pass the full name of the
+ file to gdnd_perform_drop(), not just the desktop directory.
+
+1999-08-23 Federico Mena Quintero
+
+ * gdesktop-prefs.[ch]: New files that handle the desktop
+ preferences page. Now we have a nice way to configure the
+ position of desktop icons.
+
+ * gprefs.c (create_prop_box): Use desktop_prefs_new() to create
+ the desktop preferences page.
+ (apply_page_changes): Do not update the desktop here.
+ (apply_callback): Take the desktop page into account.
+
+ * gdesktop.c (desktop_use_shaped_text): Renamed from
+ desktop_use_transparent_text.
+
+ * Makefile.in: Added gdesktop-prefs.[ch] to the list of sources.
+
+1999-08-19 Richard Hestilow
+
+ * gicon.h: define ICON_IMAGE_WIDTH and ICON_IMAGE_HEIGHT
+ for default icon size. Currently set at 48 by 48.
+
+ * gicon.c (gicon_get_icon_for_file): Scale down images that are too
+ large. Scales down to a size <= DESKTOP_ICON_WIDTH by
+ DESKTOP_ICON_HEIGHT. Correctly composites arrows on user-selected
+ icons. Shows gnome-warning for unreachable symlinks with no user
+ selected icon.
+
+ * gdesktop-icon.c (desktop_icon_reshape): dicon->height is now a
+ MAX of total height (icon height + spacing + text height) and
+ DESKTOP_SNAP_X, so that all icons are of a uniform height and small
+ icons center nicely. Rest of function modified to take this into
+ account. create_window_shape is now called last of all,
+ so dicon's various x/y/width/height fields are up to date.
+ (create_window_shape): Determine drawing coordinates based on
+ dicon->icon & dicon->text coordinates, instead of calculating them
+ by hand (Needed for size changes).
+ (set_text): Modified to take the size changes into acount.
+
+ PATCH FROM volker.braun@physik.hu-berlin.de:
+
+ * gprefs.c, setup.c, gdesktop.[ch]: Added option
+ desktop_use_transparent_text (Default is FALSE)
+
+ * gdesktop-icon.c (create_window_shape:
+ * gdesktop.c (click_button_proxy_press): Modified to take into
+ account transparent text.
+
+1999-08-16 Federico Mena Quintero
+
+ * gmain.c (default_edition_colors): "brightred" is not a standard
+ X color; use "red" instead.
+ (get_color): Take into account the result of gdk_color_parse().
+
+1999-08-13 Federico Mena Quintero
+
+ * gscreen.c (rename_file_with_context): Moved the try_rename()
+ function from gdesktop.c over to here, and renamed it for general
+ use.
+ (panel_icon_renamed): Use rename_file_with_context(). BUGFIX:
+ GNOME bug tracker #1582.
+
+ * gscreen.c (panel_fill_panel_list): Select or unselect the rows
+ as appropriate, not just select them. This is needed because the
+ clist changes the selection under us when appending rows.
+ Finally, do not call select_item() at the end; just reset the
+ panel->selected value.
+ (panel_fill_panel_icons): Likewise.
+ (tree_drag_open_directory): Disabled the auto-collapse
+ functionality yet again, since it has numerous problems. BUGFIX:
+ GNOME bug tracker #1656.
+
+ * gcmd.c (gnome_reverse_selection_cmd_panel): Re-enabled this
+ function. The reverse selection bug was somewhere else after all.
+
+ * glayout.c (gnome_panel_edit_menu): Re-inserted the item for
+ reverse selection. It was pointing to the wrong callback, that is
+ why it never worked.
+
+1999-08-12 Federico Mena Quintero
+
+ * gtkdtree.c (scan_subtree): Scan the subtree unconditionally, as
+ it is completely orthogonal from the selection status.
+ (gtk_dtree_select_row): Maintain the dtree->last_node field here.
+ This fixes the expand/select the same row sequence. BUGFIX: GNOME
+ bug tracker #1758.
+
+1999-08-12 Jonathan Blandford
+
+ * gpopup2.c (handle_unmount): We refresh when we unmount/mount a cdrom.
+
+ * gscreen.c (queue_reread_cmd): We refresh when we make a change.
+
+1999-08-12 Federico Mena Quintero
+
+ The two following entries are BUGFIX: GNOME bug tracker #1789.
+
+ * gscreen.c (panel_fill_panel_list): Do not allow selection of "..".
+ (panel_icon_list_select_icon): Likewise.
+
+ * glayout.c (gnome_panel_edit_menu): Removed the Invert Selection
+ command. It is completely broken for the expected GNOME
+ semantics.
+
+ * gnome-file-property-dialog.c (perm_group_new): If the file
+ belongs to an unknown user/group, use the group's number as a
+ string for the entry box. BUGFIX: GNOME bug tracker #1414.
+ (perm_owner_new): Do the same thing for the user.
+
+ * gdialogs.c (file_mask_dialog): Destroy the dialog if it was
+ closed by the window manager, as well.
+ (file_op_context_create_ui): Make the operation window modal so
+ that the user cannot fiddle with other windows while files are
+ being operated on. BUGFIX: GNOME bug tracker #1035.
+
+1999-08-10 Federico Mena Quintero
+
+ * gdialogs.c (file_mask_dialog): Sigh, disabled background
+ operations, since they are completely hosed. Re-aligned the
+ widgets in the dialog. BUGFIX: GNOME bug tracker #1412, #1416.
+
+1999-08-09 Federico Mena Quintero
+
+ * gscreen.c (editing_icon_list): New function to figure out
+ whether an icon in the icon list is being edited. This is a
+ FANTASTICALLY UGLY HACK, but we cannot add new functions to the
+ icon list at this point as it would break forwards compatibility.
+ Sigh. BUGFIX: GNOME bug tracker #382, #1065.
+
+ * glayout.c (gnome_panel_desktop_menu): Added some underline
+ accelerators.
+
+ * gdesktop.c (desktop_arrange_icons_items): Renamed to the desktop
+ namespace. Added underline accelerators.
+ (handle_arrange_icons_name): Made static.
+ (handle_arrange_icons_type): Likewise.
+ (handle_arrange_icons_size): Likewise.
+ (handle_arrange_icons_access): Likewise.
+ (handle_arrange_icons_mod): Likewise.
+ (handle_arrange_icons_change): Likewise.
+ (desktop_arrange_icons): Made static.
+ (strip_tearoff_menu_item): Made it return the number of items in
+ the menu, not the list of children.
+ (desktop_icon_info_destroy): Remove the icon from the icon hash
+ table.
+ (text_changed): Update the icon hash table information.
+
+ * gdesktop.h: Cleaned up some unused prototypes.
+
+ * gview.c (view_status): Use the correct g_snprintf() format
+ argument.
+
+ * gcmd.c (sort_get_func_from_type): Indented according to the MC
+ conventions. People, *PLEASE* follow the Gnome Programming
+ Guidelines, especially when modifying existing code.
+
+ * gdesktop.c (swap): Likewise.
+ (auto_pos): Likewise.
+ (get_icon_auto_pos): Likewise.
+
+1999-08-08 Richard Hestilow
+
+ * gcmd.[ch]
+ * glayout.c
+ * gprefs.c
+ * gdesktop.[ch] (mostly auto_pos and desktop_arrange_icons):
+ Reworking of the desktop's Arrange Icon code -- in addition to
+ being able to sort by various criteria now (name, file size, etc),
+ there are now 3 options (Right to Left, Bottom to Top, Rows instead
+ of Columns) controlling layout positioning. (Located in the "Desktop"
+ Preferences tab)
+
+1999-08-08 David Martin
+
+ * gaction.c (mainly gmc_unable_to_execute_dlg): Moved g_strconcat
+ to g_strdup_printf, to get compact strings and make coherent
+ translations. Translate atomic actions (open, edit, view) when
+ calling this function.
+
+1999-08-06 Federico Mena Quintero
+
+ * gdesktop.c (try_rename): New function to rename a desktop icon's
+ file by using a file operation context.
+ (text_changed): Use try_rename() instead of fiddling with the VFS
+ directly. BUGFIX: GNOME bug tracker #707. Also, destroy the old
+ icon before updating the desktop.
+
+1999-08-06 Norbert Warmuth
+
+ * gconf.h (PORT_STATIC_IN_STRING_FILE_XTIME): new port specific
+ feature. The Gnome edition first calls all string_file functions
+ and then uses the return values of these functions. This needs
+ some static buffers in string_file_[acm]time. Therefore additional
+ static buffers in string_file_[acm]time are needed.
+
+1999-08-05 Federico Mena Quintero
+
+ * gnome-file-property-dialog.c (perm_group_new): Set the correct
+ group name in the group entry box. BUGFIX: Red Hat bugzilla #3244.
+
+ * gmount.c (get_mountable_devices): Return the list in getmntent()
+ order. BUGFIX: Red Hat bugzilla #3621.
+
+ * gprefs.c (help_callback): New help callback for the preferences
+ dialog. It loads the "gmcprefs.html" section from the GMC user's
+ guide. We need a better framework for this; we need to be able to
+ map DocBook identifiers () to HTML files or
+ whatever. BUGFIX: Red Hat bugzilla #3194.
+
+1999-08-01 David Martin
+
+ * gcmd.c (gnome_about_cmd): Change strings in gmc "about" to
+ static as they only translated once.
+
+1999-08-01
+
+ * glayout.c: moved Preferences to a settings menu.
+
+1999-07-17 Karsten Weiss
+
+ * mc.keys.in.in: changed "x11amp" references to "xmms" (xmms is
+ the new name of x11amp).
+
+1999-07-13 Miguel de Icaza
+
+ * gnome-file-property-dialog.c (perm_group_new): the return values
+ from the group functions in libc return pointers to static buffers
+ in the library. Duplicate all return values and free them at the
+ end.
+
1999-07-12 Miguel de Icaza
* gdesktop.c (icon_drag_data_received): Use desktop directory here
@@ -25,8 +296,8 @@
1999-06-24 Norbert Warmuth
- * gmc-chargrid.c (update_strip): Paint every character with the
- assigned fore and background color instead of using the colors of
+ * gmc-chargrid.c (update_strip): Paint every character with the
+ assigned fore and background color instead of using the colors of
the first character for the whole line.
1999-06-22 Miguel de Icaza
@@ -40,7 +311,7 @@
* gmain.c (non_corba_create_panels): Use parameter for startup
directory (use the this_dir external directory for this).
(create_panels): Pass this_dsir to non_corba_create_panels and
- corba_create_window.
+ corba_create_window.
1999-06-22 David Martin
@@ -116,7 +387,7 @@
1999-06-01 Miguel de Icaza
* gdesktop-icon.c (desktop_icon_select): Show the
- dicon->background.
+ dicon->background.
(desktop_icon_init): Initialize backgorund as a rectangle that
fills all of the space used by the icon.
@@ -124,7 +395,7 @@
* glayout.c (gnome_panel_about_menu): Hooked up the new help
file in the menu.
-
+
1999-05-29 Miguel de Icaza
* gprefs.c (create_prop_int): Translate this label too.
@@ -136,11 +407,11 @@
1999-05-27 Miguel de Icaza
* gscreen.c (panel_tree_button_press): Beginning of context menu
- on tree.
+ on tree.
* gtkdtree.c (gtk_dtree_load_path): Comment out the phantom code.
Need to review this code. Lets fix the problem Federico needs
- solved now.
+ solved now.
1999-05-26 Miguel de Icaza
@@ -219,7 +490,7 @@
1999-04-16 Miguel de Icaza
- * mc.keys.in.in: Merge the application/tex values.
+ * mc.keys.in.in: Merge the application/tex values.
1999-04-18 Miguel de Icaza
@@ -291,7 +562,7 @@
1999-04-12 Tuomas Kuosmanen
- * glayout.c: Changed the stock icon for File->Delete to
+ * glayout.c: Changed the stock icon for File->Delete to
GNOME_STOCK_PIXMAP_TRASH (the trashcan)
1999-04-09 Federico Mena Quintero
@@ -308,7 +579,7 @@
1999-04-09 Miguel de Icaza
* gmount.c (is_block_device_mountable): Allow root to mount
- devices.
+ devices.
1999-04-09 Federico Mena Quintero
@@ -350,7 +621,7 @@
1999-04-08 Jonathan Blandford
- * gaction.c (gmc_unable_to_execute_dlg):
+ * gaction.c (gmc_unable_to_execute_dlg):
now actions do the right thing (TM).
1999-04-07 Owen Taylor
@@ -360,7 +631,7 @@
1999-04-06 Jonathan Blandford
- * gscreen.c: make sure that we bring up an open_with if
+ * gscreen.c: make sure that we bring up an open_with if
open it.
* gcmd.c (gnome_select): new selection dialog.
@@ -381,7 +652,7 @@
1999-04-06 David Martin
* gcmd.c: marked message for translation.
-
+
1999-04-05 Federico Mena Quintero
* gmetadata.c (gmeta_del_icon_pos): New function to delete the
@@ -539,7 +810,7 @@
* gdesktop-init.c (desktop_load_init_from): New file that loads
new configuration files from the installation directory.
- * gdesktop.c: Drop all the reload code from there, put it above.
+ * gdesktop.c: Drop all the reload code from there, put it above.
* gpopup2.c (create_mime_actions): Attach to the menu, not the uiinfo.
@@ -560,12 +831,12 @@
Weninger
* gcmd.c (dentry_apply_callback): new function.
- (gnome_new_launcher): We can now create new
+ (gnome_new_launcher): We can now create new
1999-03-19 Miguel de Icaza
* gpopup2.c (create_mime_actions): Free full_name, just once, not
- once per action.
+ once per action.
1999-03-19 Paul Raines
@@ -576,7 +847,7 @@
1999-03-18 Miguel de Icaza
* gdesktop.c (desktop_icon_info_open): Fix condition. Should not
- open a new panel if it fails to mount the device.
+ open a new panel if it fails to mount the device.
Thu Mar 18 14:59:12 1999 Timur Bakeyev
@@ -678,7 +949,7 @@
1999-03-11 Miguel de Icaza
* gpopup2.c: Sigh. It happened again. More features killed by
- the merge.
+ the merge.
If a file does not have any metadata/mime way of viewing it, the
viewer will always work.
@@ -802,7 +1073,7 @@
panel, always allow edition of the icon image.
1999-03-10 Miguel de Icaza
-
+
* gdialogs.c: Support ui->ctx to be NULL, as file.c will set this
to NULL for background operations.
@@ -823,7 +1094,7 @@
* gmain.c (session_save_state): Add call to gnome_config_sync().
* gutil.c (my_system_get_child_pid): reset SIGPIPE to a sensible
- value.
+ value.
(my_system_get_child_pid): Close also stdin/stdout/stderr
* gdesktop.c (is_mountable): Allow user-nfs devices to be mounted
@@ -870,10 +1141,10 @@
So, no need to kill the tearoff menus in gmc now.
* gmount.c (is_block_device_mountable): compare the device name
- here.
-
- (get_mountable_devices): Do not stop scanning devices.
-
+ here.
+
+ (get_mountable_devices): Do not stop scanning devices.
+
* gview.c (scrollbar_moved): Call view update here, with
update_gui = FALSE.
@@ -908,11 +1179,11 @@
1999-02-24 Miguel de Icaza
* gmount.c (desktop_cleanup_devices): Export this routine now and
- call it from gdeskop instead of overloading gmount_setup_devices.
+ call it from gdeskop instead of overloading gmount_setup_devices.
* gprint.c: Sample file, it uses an externally provided program
(not in 1.0 so far) to setup printer devices.
-
+
* gmount.c (gmount_setup_devices): No longer cleans up here.
* gicon.c (gicon_get_filename_for_icon): Return const char *, this
@@ -922,14 +1193,14 @@
* gnome-file-property-dialog.c (apply_metadata_change): Always set
the name of the icon to the new value, as the entry will always
match the imlib image anyways (due to the fixes I did to const
- correctness).
+ correctness).
(generate_icon_sel): Do not free the value. We do not own this
- return value.
+ return value.
* gdesktop.c (is_mountable): NULL terminate string returned from
- readlink. Yes guys, readlink does not NULL terminate things.
+ readlink. Yes guys, readlink does not NULL terminate things.
(do_mount_umount): ditto.
-
+
* gnome-file-property-dialog.c (init_metadata): ditto
Tue Feb 23 17:41:45 1999 George Lebl
@@ -958,7 +1229,7 @@
* gwidget.c (x_create_input): Hook to the changed signal and sync
the input with our view of the entry. This fixes the paste bug
- reported.
+ reported.
Tue Feb 23 01:57:22 1999 George Lebl
@@ -1070,25 +1341,25 @@
* gdesktop.c (reload_desktop_icons): Load the information provided
on the .desktop file for the desktop icon information: icon
filename and text to be displayed.pwd
-
- * gpopup.c (create_actions): Add ejectable
+
+ * gpopup.c (create_actions): Add ejectable
* gdesktop.c (do_eject): Add eject command.
-
+
1999-02-16 Miguel de Icaza
* gpopup.c (create_actions): Add support for mountable icons.
* gdesktop.c (try_to_mount): Add an option to automatically mount
- links on the desktop that point to devices.
+ links on the desktop that point to devices.
(is_mountable): Returns true if a pathname is mountable.
* glayout.c: Add the dirsizes command here.
* gmount.c: New file. Implements support routines for
mount/umount.
-
+
1999-02-16 Federico Mena Quintero
* i-symlink.png: Flipped the image around, since we are putting
@@ -1142,7 +1413,7 @@
command to execute (used internally).
* gaction.c (gmc_edit_filename): Support for the GNOME editor
- environment properties.
+ environment properties.
* gdesktop.c (create_desktop_dir): Support GNOME_DESKTOP_DIR
variable to configure the desktop directory.
@@ -1190,13 +1461,13 @@
due to having the "file-must-exist" bit turned on.
* gnome-file-property-dialog.c (apply_metadata_change): Metadata
- rename the file.
+ rename the file.
Change fpd->file_name to point to the new name so that any
metadat changes take effect on the new name, not the old name.
Test return value from move_file_file.
-
+
(init_metadata): Fixed typo.
1999-02-12 Federico Mena Quintero
@@ -1250,7 +1521,7 @@
1999-02-10 Miguel de Icaza
* gaction.c (gmc_open_filename): Add support for running .desktop
- files.
+ files.
Made const correct.
(gmc_view): Made const correct.
@@ -1356,11 +1627,11 @@
we don't need this in GNOME. Changed the order of linking - libgtkedit
require libgnomeui.a, so swap $(LDFLAGS) and $(EXTRALIBS). The same for
corba edition.
-
+
gdnd.c, gmetadata.c, gpopup2.c, gtools.c: Adde #include "global.h" or
move it before #include to avoid warnings about redefining
MIN, MAX nad RE_DUP_MAX. More clean compiling.
-
+
* gpopup2.h: New file - to avoid errors during "make distcheck". What
it is for, really?
@@ -1433,8 +1704,8 @@
(gicon_init): Load the url image.
* gdesktop.c (desktop_icon_info_new): Use an URL image for
- desktop-urls. Use the url as the caption for those icons.
-
+ desktop-urls. Use the url as the caption for those icons.
+
1999-02-04 Jonathan Blandford
* gprefs.c (caching_and_optimization_props): wording changes
@@ -1443,7 +1714,7 @@
* gdesktop.c (desktop_icon_info_open): Run "execute" if the file
is an executable. I forgot that gmc_open does not test for
- executable-ness.
+ executable-ness.
1999-02-04 Jonathan Blandford
@@ -1470,7 +1741,7 @@
the type column be displayed.
(panel_file_list_select_row): Removed dead code.
(panel_file_list_press_row): Select the row before calling
- gpopup_do_popup.
+ gpopup_do_popup.
1999-02-03 Federico Mena Quintero
@@ -1523,7 +1794,7 @@
* gnome-file-property-dialog.c (icon_sel_callback): Fix the
conditional here.
-
+
1999-02-01 Federico Mena Quintero
* gdesktop.c (desktop_drag_motion): If the user is dragging a
@@ -1585,7 +1856,7 @@
* gnome-file-property-dialog.h (struct _GnomeFilePropertyDialog):
Now make open field mandatory and icon selection optional.
* gnome-file-property-dialog.c: as above
-
+
* gpopup.c (panel_action_properties): only allow setting images if
we_can_afford_the_speed.
@@ -1602,9 +1873,9 @@
Thu Jan 28 02:15:48 1999 Timur Bakeyev
* gdialogs.c: fixed "regexp.h" -> "eregexp.h" conversion.
-
+
* oldnd.c: Replaced copy_strings() with g_strconcat().
-
+
1999-01-26 Federico Mena Quintero
* gscreen.c (panel_clist_motion): Stop the emission of the
@@ -1618,7 +1889,7 @@
Wed Jan 27 03:14:46 1999 Timur Bakeyev
- * Converted memory managment to Glib - where it wasn't done. Now we
+ * Converted memory managment to Glib - where it wasn't done. Now we
use g_new()/g_malloc()/g_strdup()/g_free() routings. copy_strings() re-
placed by g_strconcat(), and sprintf() by g_snprintf(). Some other,
minor changes.
@@ -1649,7 +1920,7 @@
1999-01-25 Miguel de Icaza
- * gtkdtree.c (gtk_dtree_select_row): This should be also protected
+ * gtkdtree.c (gtk_dtree_select_row): This should be also protected
against async notifications.
1999-01-25 Federico Mena Quintero
@@ -1681,7 +1952,7 @@
* gtkdtree.c (gtk_dtree_load_path): Keep track of when we are
loading the tree (and thus we do not care about async
notifications to the tree state changes) and when we are done (and
- thus, we care about the async treestore structure notifications).
+ thus, we care about the async treestore structure notifications).
1999-01-23 Miguel de Icaza
@@ -1691,17 +1962,17 @@
(gnome_filter_cmd): ditto.
* gdialogs.c (file_progress_query_replace_policy): Set Window's
- position to GTK_WIN_POS_MOUSE.
+ position to GTK_WIN_POS_MOUSE.
(file_progress_real_query_replace): ditto.
(file_mask_dialog): ditto.
* gdialogs.c: Tag the strings for localization. Remove debugging
- messages.
+ messages.
* gmain.c (gmc_window_setup_from_panel): Helper routine used to
set the GTK_WIN_POS_MOUSE on a window and set the parent with
gnome_dialog_set_parent (iff you have the WPanel * pointer to the
- parent).
+ parent).
* gtools.c (query_dialog): Set the window position to GTK_WIN_POS_MOUSE.
@@ -1804,7 +2075,7 @@
* gicon.h (gicon_image_to_name): Added prototype for
gicon_image_to_name().
- * gicon.c (gicon_get_icon_for_file):
+ * gicon.c (gicon_get_icon_for_file):
(gicon_get_icon_for_file_speed): Added a "directory" argument.
It is needed because the file_entry structure only contains the
pruned filename, and we need the complete name for the metadata
@@ -1929,10 +2200,10 @@
register themselves with it.
1999-01-13 bertrand
-
+
* gdialogs.c
- * gwidget.c:
- * gprop.c:
+ * gwidget.c:
+ * gprop.c:
s/gtk_toggle_button_state/gtk_toggle_button_active
1999-01-12 Federico Mena Quintero
@@ -1968,7 +2239,7 @@
command. Add Mkdir command. Use standard key definitions.
* gview.c: Use new standard keybindings
-
+
* gtkdtree.c: Now it uses the treestore code.
* treestore.c: New file format which includes the scan status of
@@ -2009,12 +2280,12 @@
* gscreen.c (panel_icon_list_select_icon): Remove debugging message.
* glayout.c: Add a create directory option.
-
+
1999-01-07 Jonathan Blandford
* gcmd.c (gnome_filter_cmd): now it works! It's even sorta
useful. I'm so psyched... (:
-
+
1999-01-07 Miguel de Icaza
@@ -2068,7 +2339,7 @@
1999-01-05 Miguel de Icaza
* gdesktop.c (desktop_icon_drop_uri_list): Implement
- drops-on-executable.
+ drops-on-executable.
* gmetadata.c, gaction.c, gdesktop.c, gicon.c: Use g_free instead
of free to follow the convention in gnome-metadata.c
@@ -2076,11 +2347,11 @@
* gtools.c (query_dialog): Fix the new version of this. It was
overwriting memory all over.
- * gdialogs.c (): Use GNOME stock; Fill in some FIXME strings.
+ * gdialogs.c (): Use GNOME stock; Fill in some FIXME strings.
(file_progress_real_query_replace): Use the formatted
- message.
+ message.
- Change the inlined N_( for _( in various places.
+ Change the inlined N_( for _( in various places.
(cancel_cb): Cancel button now cancels a copy or move operation.
* gtools.c (query_dialog): Remove the hotkey indicator in the
@@ -2121,13 +2392,13 @@
calling a routine that somehow got dropped during some recent
changes).
- * gtools.c (query_dialog): Simplified.
+ * gtools.c (query_dialog): Simplified.
1999-01-02 Jonathan Blandford
* gcmd.c (gnome_sort_cmd): pretified
(gnome_select_all_cmd): New command -- selects all files (in
- theory).
+ theory).
* glayout.c: rearrange the edit menu some.
@@ -2152,10 +2423,10 @@
* gwidget.c (x_create_listbox): Temporary hack
- * gmetadata.c (gmeta_get_icon_pos): Fixed the memory leak here.
+ * gmetadata.c (gmeta_get_icon_pos): Fixed the memory leak here.
* gicon.c (gicon_get_icon_for_file): Actually return a value
- here.
+ here.
1999-01-01 Miguel de Icaza
@@ -2196,7 +2467,7 @@
* gmain.c (create_panels): Register corba server here.
* gcorba.c: Fix a servant declaration to point to the correct
- vepv.
+ vepv.
1998-12-30 Federico Mena Quintero
@@ -2221,7 +2492,7 @@
1998-12-29 Miguel de Icaza
* gdesktop.c (desktop_icon_delete): New function, used for
- dicon_delete.
+ dicon_delete.
(load_desktop_icons): Implemented the incremental reloading of
desktop icons. This should make the code much nicer.
(reload_desktop_icons): Call x_flush_events to force a display at
@@ -2229,17 +2500,17 @@
* gpopup.c (dicon_delete): Implement this operation.
(desktop_icon_execute): Use the existing implementation for
- launching desktop icons instead of a new hacked up version
+ launching desktop icons instead of a new hacked up version
(desktop_icon_actions): Until copy/move is implemented, do not
even list them to the user.
* gdesktop.c (create_desktop_dir): No trashcan setup until it
- works.
+ works.
* gscren.c (panel_widget_motion): Use button 2 for dragging and
- asking.
-
+ asking.
+
* gscreen.c (panel_create_file_list): Use a notebook instead of
the hack I was using before for switching the panel contents.
@@ -2252,8 +2523,8 @@
Tue Dec 29 16:55:24 1998 Norbert Warmuth
- * gmain.c: According to the man page the color keyword for executable
- files is `executable' and not `execute' -- changed.
+ * gmain.c: According to the man page the color keyword for executable
+ files is `executable' and not `execute' -- changed.
1998-12-28 Jonathan Blandford
@@ -2276,12 +2547,12 @@
Mon Dec 21 22:33:07 1998 Norbert Warmuth
* layout: Deleted obsolete widgets from the Virtual FS configuration
- dialog.
+ dialog.
1998-12-17 Miguel de Icaza
* gscreen.c (panel_icon_list_select_icon): Show the popup menu on
- button release here. This is what makes most sense.
+ button release here. This is what makes most sense.
(panel_widget_motion): Drags with button 3 now produce a popup
dialog box that asks
@@ -2289,7 +2560,7 @@
* gdialogs.c (create_op_win): Remove second spurious packing.
(create_op_win): OP_MOVE uses the same stuff OP_COPY does. Fix
- this.
+ this.
(file_progress_show_target): More compliant to the original
functions.
(file_progress_show_source): More compliant to the original
@@ -2301,7 +2572,7 @@
* gdesktop-icon.c : Attach a desktop_icon wmclass to the desktop
icons to allow even more wizardry with the desktop icons, mainly
- to exclude them from window lists, don't decorate them, skip
+ to exclude them from window lists, don't decorate them, skip
desktops and other boring stuff.
1998-12-14 Sven Neumann
@@ -2337,7 +2608,7 @@
* gscreen.c (panel_tree_drag_motion): Doubled timeout
for autoexpand - reducing opening unwanted directories.
- * gscreen.c (tree_drag_open_directory): Use
+ * gscreen.c (tree_drag_open_directory): Use
gtk_ctree_expand() not gtk_ctree_expand_recursive,
which increases confusion and could be
_vvveeerrrryyyy_ expensive. (/afs ?)
diff -ruN old/mc-4.5.37/gnome/Makefile.in new/mc-4.5.38/gnome/Makefile.in
--- old/mc-4.5.37/gnome/Makefile.in Mon Jul 12 23:57:30 1999
+++ new/mc-4.5.38/gnome/Makefile.in Thu Sep 2 12:49:43 1999
@@ -36,6 +36,7 @@
gcorba.c \
gdesktop-icon.c \
gdesktop-init.c \
+ gdesktop-prefs.c \
gdesktop.c \
gdialogs.c \
gdnd.c \
@@ -75,6 +76,7 @@
gcustom-layout.h \
gdesktop-icon.h \
gdesktop-init.h \
+ gdesktop-prefs.h \
gdesktop.h \
gdnd.h \
gicon.h \
@@ -150,6 +152,7 @@
gcustom-layout.o \
gdesktop-icon.o \
gdesktop-init.o \
+ gdesktop-prefs.o \
gdesktop.o \
gdnd.o \
ghelp.o \
@@ -200,7 +203,8 @@
DISTGNOME = \
Makefile.in ChangeLog $(EXTRA_DIST) $(CORBA_SOURCES) \
- $(PIXMAPS) $(ICONS) $(GNOMESRCS) $(GNOMEHDRS) $(DISTGNOME_NEW)
+ $(PIXMAPS) $(ICONS) $(GNOMESRCS) $(GNOMEHDRS) $(DISTGNOME_NEW) \
+ gmc-window.c gmc-window.h
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<
@@ -288,7 +292,7 @@
-$(RMF) $(srcdir)/Makefile
distcopy:
- $(CP) $(DISTGNOME) ../../mc-$(VERSION)/gnome
+ for I in $(DISTGNOME); do $(CP) $(top_srcdir)/gnome/$$I $(top_srcdir)/mc-$(VERSION)/gnome; done
install: install_@mx@
diff -ruN old/mc-4.5.37/gnome/application.x-gnumeric.desktop new/mc-4.5.38/gnome/application.x-gnumeric.desktop
--- old/mc-4.5.37/gnome/application.x-gnumeric.desktop Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/application.x-gnumeric.desktop Thu Sep 2 12:49:44 1999
@@ -1,10 +1,12 @@
[Desktop Entry]
Name=Spreadsheet
Name[es]=Hoja de c嫮culo
+Name[fi]=Taulukko
Name[fr]=Tableur
Name[no]=Regneark
Comment=Create a new spreadsheet
Comment[es]=Crea una nueva hoja de c嫮culo
+Comment[fi]=Luo uusi taulukko
Comment[fr]=Cr嶪 une nouvelle feuille de calcul
Comment[no]=Opprett et nytt regneark
TryExec=gnumeric
diff -ruN old/mc-4.5.37/gnome/gaction.c new/mc-4.5.38/gnome/gaction.c
--- old/mc-4.5.37/gnome/gaction.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gaction.c Thu Sep 2 12:49:43 1999
@@ -29,34 +29,28 @@
gchar *msg;
gchar *fix = NULL;
if (!strcmp (action, "x-gnome-app-info")) {
- msg = g_strconcat (_("Unable to execute\n\""),
- fname,
- _("\".\n\nPlease check it to see if it points to a valid command."),
- NULL);
+ msg = g_strdup_printf (
+ _("Unable to execute\n\"%s\".\n\n"
+ "Please check it to see if it points to a valid command."),
+ fname);
} else {
if (mime)
- fix = g_strconcat (_("\".\n\nTo fix this, bring up the mime-properties editor "
- "in the GNOME Control Center, and edit the default "),
- action,
- _("-action for \""),
- mime,
- "\".",
- NULL);
+ fix = g_strdup_printf (
+ _("\".\n\nTo fix this, bring up the mime-properties editor "
+ "in the GNOME Control Center, and edit the default %s"
+ "-action for \"%s\"."),
+ action, mime);
else
- fix = g_strconcat (_("\".\n\nTo fix this error, bring up this file's properties "
- "and change the default "),
- action,
- _("-action."),
- NULL);
- msg = g_strconcat (_("Unable to "),
- action,
- "\n\"",
- fname,
- _("\"\nwith the command:\n\""),
- command,
- fix,
- NULL);
+ fix = g_strdup_printf (
+ _("\".\n\nTo fix this error, bring up this file's properties "
+ "and change the default %s-action."),
+ action);
+
+ msg = g_strdup_printf (
+ _("Unable to %s\n\"%s\"\nwith the command:\n\"%s\"%s"),
+ action, fname, command, fix);
+
g_free (fix);
}
msg_dialog = gnome_message_box_new (msg,
@@ -72,7 +66,6 @@
gnome_dialog_run_and_close (GNOME_DIALOG (msg_dialog));
g_free (msg);
-
}
static void
@@ -80,6 +73,7 @@
{
exec_extension (fname, buf, NULL, NULL, 0, needs_terminal);
}
+
static gboolean
gmc_check_exec_string (const char *buf)
{
@@ -137,7 +131,7 @@
if (gmc_check_exec_string (buf))
gmc_execute (fname, buf, needs_terminal);
else
- gmc_unable_to_execute_dlg (fname, buf, "open", NULL);
+ gmc_unable_to_execute_dlg (fname, buf, _("open"), NULL);
g_free (buf);
return 1;
}
@@ -153,7 +147,7 @@
if (gmc_check_exec_string (cmd))
gmc_execute (fname, cmd, needs_terminal);
else
- gmc_unable_to_execute_dlg (fname, cmd, "open", mime_type);
+ gmc_unable_to_execute_dlg (fname, cmd, _("open"), mime_type);
return 1;
}
@@ -188,7 +182,7 @@
if (gmc_check_exec_string (buf))
gmc_execute (fname, buf, 0);
else
- gmc_unable_to_execute_dlg (fname, buf, "edit", NULL);
+ gmc_unable_to_execute_dlg (fname, buf, _("edit"), NULL);
g_free (buf);
return 1;
}
@@ -201,7 +195,7 @@
if (gmc_check_exec_string (cmd))
gmc_execute (fname, cmd, 0);
else
- gmc_unable_to_execute_dlg (fname, cmd, "edit", mime_type);
+ gmc_unable_to_execute_dlg (fname, cmd, _("edit"), mime_type);
return 1;
}
}
@@ -334,7 +328,7 @@
if (gmc_check_exec_string (cmd))
gmc_run_view (filename, cmd);
else
- gmc_unable_to_execute_dlg (filename, cmd, "view", mime_type);
+ gmc_unable_to_execute_dlg (filename, cmd, _("view"), mime_type);
g_free (cmd);
return 1;
} else
diff -ruN old/mc-4.5.37/gnome/gcmd.c new/mc-4.5.38/gnome/gcmd.c
--- old/mc-4.5.37/gnome/gcmd.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gcmd.c Thu Sep 2 12:49:43 1999
@@ -25,16 +25,6 @@
#include "gdesktop.h"
#include "../vfs/vfs.h"
-
-enum {
- SORT_NAME,
- SORT_EXTENSION,
- SORT_ACCESS,
- SORT_MODIFY,
- SORT_CHANGE,
- SORT_SIZE
-};
-
static char *panelize_section = "Panelize";
void
@@ -42,9 +32,9 @@
{
int view_type, use_msformat;
char *user, *status;
-
+
view_type = display_box (panel, &user, &status, &use_msformat, get_current_index ());
-
+
if (view_type == -1)
return;
@@ -66,7 +56,7 @@
{
char *p;
int quote_all = 0;
-
+
if (!(p = gnome_is_program_in_path ("gnome-terminal"))){
if (!(p = gnome_is_program_in_path ("dtterm")))
if (!(p = gnome_is_program_in_path ("nxterm")))
@@ -105,7 +95,7 @@
{
GtkWidget *about;
static int translated;
- const gchar *authors[] = {
+ static const gchar *authors[] = {
N_("The Midnight Commander Team"),
"http://www.gnome.org/mc/",
N_("bug reports: http://bugs.gnome.org, or use gnome-bug"),
@@ -114,12 +104,12 @@
if (!translated){
int i;
-
+
for (i = 0; authors [i]; i++)
authors [i] = _(authors [i]);
translated = TRUE;
}
-
+
about = gnome_about_new (_("GNU Midnight Commander"), VERSION,
"Copyright 1994-1999 the Free Software Foundation",
authors,
@@ -247,6 +237,44 @@
gtk_widget_set_sensitive (cbox1, FALSE);
}
+/* Returns a sort function based on its type */
+sortfn *
+sort_get_func_from_type (SortType type)
+{
+ sortfn *sfn = NULL;
+
+ switch (type) {
+ case SORT_NAME:
+ sfn = (sortfn *) sort_name;
+ break;
+
+ case SORT_EXTENSION:
+ sfn = (sortfn *) sort_ext;
+ break;
+
+ case SORT_ACCESS:
+ sfn = (sortfn *) sort_atime;
+ break;
+
+ case SORT_MODIFY:
+ sfn = (sortfn *) sort_time;
+ break;
+
+ case SORT_CHANGE:
+ sfn = (sortfn *) sort_ctime;
+ break;
+
+ case SORT_SIZE:
+ sfn = (sortfn *) sort_size;
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return sfn;
+}
+
void
gnome_sort_cmd (GtkWidget *widget, WPanel *panel)
{
@@ -258,10 +286,10 @@
GtkWidget *cbox1, *cbox2;
sortfn *sfn = NULL;
- sort_box = gnome_dialog_new (_("Sort By"), GNOME_STOCK_BUTTON_OK,
+ sort_box = gnome_dialog_new (_("Sort By"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gmc_window_setup_from_panel (GNOME_DIALOG (sort_box), panel);
-
+
/* we define this up here so we can pass it in to our callback */
cbox1 = gtk_check_button_new_with_label (_("Ignore case sensitivity."));
hbox = gtk_hbox_new (FALSE, 0);
@@ -277,7 +305,7 @@
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_NAME);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (sort_callback), cbox1);
-
+
menu_item = gtk_menu_item_new_with_label ( _("File Type"));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_EXTENSION);
@@ -311,7 +339,7 @@
gtk_widget_show_all (menu);
gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-
+
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox1), panel->case_sensitive);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (sort_box)->vbox),
cbox1, FALSE, FALSE, 0);
@@ -324,29 +352,11 @@
gtk_widget_show_all (GNOME_DIALOG (sort_box)->vbox);
switch (gnome_dialog_run (GNOME_DIALOG (sort_box))) {
case 0:
- switch( (gint) gtk_object_get_data (GTK_OBJECT
+ sfn = sort_get_func_from_type(
+ GPOINTER_TO_UINT(gtk_object_get_data (GTK_OBJECT
(GTK_OPTION_MENU
(omenu)->menu_item),
- "SORT_ORDER_CODE") ) {
- case SORT_NAME:
- sfn = (sortfn *) sort_name;
- break;
- case SORT_EXTENSION:
- sfn = (sortfn *) sort_ext;
- break;
- case SORT_ACCESS:
- sfn = (sortfn *) sort_atime;
- break;
- case SORT_MODIFY:
- sfn = (sortfn *) sort_time;
- break;
- case SORT_CHANGE:
- sfn = (sortfn *) sort_ctime;
- break;
- case SORT_SIZE:
- sfn = (sortfn *) sort_size;
- break;
- }
+ "SORT_ORDER_CODE")));
/* case sensitive */
panel->case_sensitive = GTK_TOGGLE_BUTTON (cbox1)->active;
/* Reverse order */
@@ -380,8 +390,8 @@
GtkWidget *label;
gchar *retval = NULL;
int destroy;
-
- dlg = gnome_dialog_new (_("Enter name."), GNOME_STOCK_BUTTON_OK,
+
+ dlg = gnome_dialog_new (_("Enter name."), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
entry = gtk_entry_new ();
@@ -408,7 +418,7 @@
if (destroy)
gtk_widget_destroy (dlg);
- return retval;
+ return retval;
}
static void
@@ -490,7 +500,7 @@
gint i = 0;
profile_keys = profile_init_iterator (panelize_section, profile_name);
-
+
if (!profile_keys){
insert_tab[0] = _("Find all core files");
i = gtk_clist_insert (clist, i, insert_tab);
@@ -536,14 +546,14 @@
gint i;
gchar *row_data;
int destroy;
-
+
data = g_new0 (ep_dlg_data, 1);
data->setting_text = FALSE;
data->selected = -1;
- data->ep_dlg = gnome_dialog_new (_("Run Command"), GNOME_STOCK_BUTTON_OK,
+ data->ep_dlg = gnome_dialog_new (_("Run Command"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (data->ep_dlg), GTK_WIN_POS_MOUSE);
-
+
/* Frame 1 */
frame = gtk_frame_new (_("Preset Commands"));
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (data->ep_dlg)->vbox),
@@ -587,7 +597,7 @@
gtk_widget_show_all (GNOME_DIALOG (data->ep_dlg)->vbox);
destroy = TRUE;
-
+
switch (gnome_dialog_run (GNOME_DIALOG (data->ep_dlg))) {
case 0:
gtk_widget_hide (data->ep_dlg);
@@ -636,19 +646,20 @@
}
void
-gnome_reverse_selection_cmd_panel (WPanel *panel)
+gnome_reverse_selection_cmd_panel (GtkWidget *widget, WPanel *panel)
{
- file_entry *file;
- int i;
+ file_entry *file;
+ int i;
- for (i = 0; i < panel->count; i++){
- if (!strcmp (panel->dir.list [i].fname, "..")) {
- continue;
- }
- file = &panel->dir.list [i];
- do_file_mark (panel, i, !file->f.marked);
- }
- paint_panel (panel);
+ for (i = 0; i < panel->count; i++) {
+ if (!strcmp (panel->dir.list [i].fname, ".."))
+ continue;
+
+ file = &panel->dir.list [i];
+ do_file_mark (panel, i, !file->f.marked);
+ }
+
+ paint_panel (panel);
}
void
@@ -659,7 +670,7 @@
GtkWidget *label;
gchar *text1, *text2, *text3;
- filter_dlg = gnome_dialog_new (_("Set Filter"), GNOME_STOCK_BUTTON_OK,
+ filter_dlg = gnome_dialog_new (_("Set Filter"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (filter_dlg), GTK_WIN_POS_MOUSE);
if (easy_patterns) {
@@ -679,7 +690,7 @@
}
entry = gnome_entry_new (text1);
gnome_entry_load_history (GNOME_ENTRY (entry));
-
+
if (text2) {
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))), text2);
gnome_entry_prepend_history (GNOME_ENTRY (entry), FALSE, text3);
@@ -692,7 +703,7 @@
label = gtk_label_new (_("Enter a Regular Expression to filter files in the panel view."));
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-
+
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (filter_dlg)->vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (filter_dlg)->vbox), entry, FALSE, FALSE, 0);
@@ -717,7 +728,7 @@
gtk_label_set_text (GTK_LABEL (panel->status), _("Show all files"));
} else
gtk_label_set_text (GTK_LABEL (panel->status), panel->filter);
-
+
gnome_entry_save_history (GNOME_ENTRY (entry));
x_filter_changed (panel);
reread_cmd ();
@@ -759,7 +770,7 @@
}
#endif
g_list_free (later);
-
+
}
void
@@ -782,7 +793,7 @@
if (page != -1)
return;
-
+
g_return_if_fail(data!=NULL);
g_return_if_fail(GNOME_IS_DENTRY_EDIT(data));
dentry = gnome_dentry_get_dentry(GNOME_DENTRY_EDIT(data));
@@ -838,8 +849,8 @@
GtkWidget *entry;
GtkWidget *label;
int run;
-
- select_dialog = gnome_dialog_new (_("Select File"), GNOME_STOCK_BUTTON_OK,
+
+ select_dialog = gnome_dialog_new (_("Select File"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (select_dialog), GTK_WIN_POS_MOUSE);
entry = gnome_entry_new ("mc_select");
@@ -850,10 +861,10 @@
label = gtk_label_new (_("Enter a filter here to select files in the panel view with.\n\nFor example:\n*.png will select all png images"));
else
label = gtk_label_new (_("Enter a regular expression here to select files in the panel view with."));
-
+
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-
+
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (select_dialog)->vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (select_dialog)->vbox), entry, FALSE, FALSE, 0);
@@ -866,7 +877,7 @@
}
if (run != -1)
gtk_widget_destroy (select_dialog);
-
+
if ((reg_exp == NULL) || (*reg_exp == '\000')) {
g_free (reg_exp);
return;
@@ -927,7 +938,7 @@
if (is_a_desktop_panel (panel))
return;
-
+
cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
gdk_window_set_cursor (GTK_WIDGET (panel->xwindow)->window, cursor);
gdk_cursor_destroy (cursor);
@@ -944,7 +955,7 @@
_("Enter the URL:"), "");
if (!url)
return;
-
+
template = g_concat_dir_and_file (desktop_directory, "urlXXXXXX");
if (mktemp (template)) {
diff -ruN old/mc-4.5.37/gnome/gcmd.h new/mc-4.5.38/gnome/gcmd.h
--- old/mc-4.5.37/gnome/gcmd.h Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gcmd.h Thu Sep 2 12:49:44 1999
@@ -1,6 +1,9 @@
#ifndef __GCMD_H
#define __GCMD_H
+#include "panel.h"
+#include "dir.h" /* sortfn */
+
void gnome_listing_cmd (GtkWidget *widget, WPanel *panel);
void gnome_compare_panels (void);
void gnome_open_terminal (void);
@@ -14,6 +17,17 @@
void gnome_detailed_view_cmd (GtkWidget *widget, WPanel *panel);
void gnome_custom_view_cmd (GtkWidget *widget, WPanel *panel);
+typedef enum {
+ SORT_NAME,
+ SORT_EXTENSION,
+ SORT_ACCESS,
+ SORT_MODIFY,
+ SORT_CHANGE,
+ SORT_SIZE
+} SortType; /* Used for arrange icons */
+
+sortfn *sort_get_func_from_type (SortType type);
+
void gnome_sort_cmd (GtkWidget *widget, WPanel *panel);
void gnome_select_all_cmd (GtkWidget *widget, WPanel *panel);
void gnome_start_search (GtkWidget *widget, WPanel *panel);
@@ -23,7 +37,7 @@
void gnome_run_new (GtkWidget *widget, GnomeDesktopEntry *gde);
void gnome_mkdir_cmd (GtkWidget *widget, WPanel *panel);
void gnome_new_launcher (GtkWidget *widget, WPanel *panel);
-void gnome_reverse_selection_cmd_panel (WPanel *panel);
+void gnome_reverse_selection_cmd_panel (GtkWidget *widget, WPanel *panel);
void gnome_select (GtkWidget *widget, WPanel *panel);
void set_cursor_normal (WPanel *panel);
void set_cursor_busy (WPanel *panel);
diff -ruN old/mc-4.5.37/gnome/gconf.h new/mc-4.5.38/gnome/gconf.h
--- old/mc-4.5.37/gnome/gconf.h Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gconf.h Thu Sep 2 12:49:44 1999
@@ -36,6 +36,7 @@
#define PORT_WINPUT_DELETES_MARKED 1
#define PORT_LIST_MODE_NAME "gnome_list_mode"
#define PORT_LIST_MODE_DEFAULT "icons"
+#define PORT_STATIC_IN_STRING_FILE_XTIME 1
#define CLIST_FROM_SW(panel_list) GTK_CLIST (GTK_BIN (panel_list)->child)
#define ILIST_FROM_SW(panel_list) GNOME_ICON_LIST (GTK_BIN (panel_list)->child)
diff -ruN old/mc-4.5.37/gnome/gcustom-layout.c new/mc-4.5.38/gnome/gcustom-layout.c
--- old/mc-4.5.37/gnome/gcustom-layout.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gcustom-layout.c Thu Sep 2 12:49:43 1999
@@ -1,10 +1,8 @@
-/* GNU Midnight Commander -- GNOME edition
- *
- * Preferences page for custom list view
+/* Custom layout preferences box for the Midnight Commander
*
* Copyright (C) 1999 The Free Software Foundation
*
- * Author: Owen Taylor
+ * Author: Owen Taylor
*/
#include
diff -ruN old/mc-4.5.37/gnome/gcustom-layout.h new/mc-4.5.38/gnome/gcustom-layout.h
--- old/mc-4.5.37/gnome/gcustom-layout.h Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gcustom-layout.h Thu Sep 2 12:49:44 1999
@@ -1,3 +1,10 @@
+/* Custom layout preferences box for the Midnight Commander
+ *
+ * Copyright (C) 1999 The Free Software Foundation
+ *
+ * Author: Owen Taylor
+ */
+
typedef struct _GCustomLayout GCustomLayout;
GCustomLayout *custom_layout_create_page (GnomePropertyBox *prop_box,
diff -ruN old/mc-4.5.37/gnome/gdesktop-icon.c new/mc-4.5.38/gnome/gdesktop-icon.c
--- old/mc-4.5.37/gnome/gdesktop-icon.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gdesktop-icon.c Thu Sep 2 12:49:43 1999
@@ -203,18 +203,17 @@
static void
set_text (DesktopIcon *dicon, char *text)
{
- GtkArg arg;
- int icon_height;
-
- arg.name = "height";
- gtk_object_getv (GTK_OBJECT (dicon->icon), 1, &arg);
- icon_height = GTK_VALUE_DOUBLE (arg);
-
+ int text_height;
+ double x1, y1, x2, y2;
+
+ gnome_canvas_item_get_bounds (dicon->text, &x1, &y1, &x2, &y2);
+ text_height = y2 = y1;
+
gtk_signal_handler_block (GTK_OBJECT (dicon->text), dicon->w_changed_id);
gtk_signal_handler_block (GTK_OBJECT (dicon->text), dicon->h_changed_id);
gnome_icon_text_item_configure (GNOME_ICON_TEXT_ITEM (dicon->text),
- 0, icon_height + SPACING,
+ 0, dicon->height - text_height,
DESKTOP_SNAP_X,
DESKTOP_ICON_FONT,
text,
@@ -297,6 +296,7 @@
GdkBitmap *im_mask;
GdkGC *mgc;
GdkColor c;
+ GnomeIconTextItem *i;
/* Create the initial mask and clear it */
@@ -321,21 +321,29 @@
mgc,
im_mask,
0, 0,
- (dicon->width - icon_width) / 2, 0,
+ dicon->icon_x, dicon->icon_y,
icon_width, icon_height);
gdk_imlib_free_bitmap (im_mask);
} else
gdk_draw_rectangle (mask, mgc, TRUE,
- (dicon->width - icon_width) / 2, 0,
+ dicon->icon_x, dicon->icon_y,
icon_width, icon_height);
/* Fill the area for the text */
- gdk_draw_rectangle (mask, mgc, TRUE,
- (dicon->width - text_width) / 2,
- icon_height + SPACING,
- text_width, text_height);
-
+ i = GNOME_ICON_TEXT_ITEM (dicon->text);
+ if (desktop_use_shaped_text && !i->editing && !i->selected)
+ gnome_icon_paint_text (i->ti,
+ mask, mgc,
+ dicon->text_x + 2,
+ dicon->text_y + 2,
+ GTK_JUSTIFY_CENTER);
+ else
+ gdk_draw_rectangle (mask, mgc, TRUE,
+ dicon->text_x,
+ dicon->text_y,
+ text_width, text_height);
+
if (!GTK_WIDGET_REALIZED (dicon))
gtk_widget_realize (GTK_WIDGET (dicon));
@@ -357,6 +365,7 @@
GtkArg args[2];
int icon_width, icon_height;
int text_width, text_height;
+ int total_height;
double x1, y1, x2, y2;
g_return_if_fail (dicon != NULL);
@@ -377,40 +386,39 @@
text_width = x2 - x1;
text_height = y2 - y1;
+ total_height = icon_height + SPACING + text_height;
+
/* Calculate new size of widget */
dicon->width = MAX (icon_width, DESKTOP_SNAP_X);
- dicon->height = icon_height + SPACING + text_height;
+ dicon->height = MAX (total_height, DESKTOP_SNAP_Y);
/* Set new position of children */
gnome_canvas_item_set (dicon->icon,
"x", (dicon->width - icon_width) / 2.0,
- "y", 0.0,
+ "y", (dicon->height - total_height) / 2.0,
NULL);
gnome_canvas_item_set (dicon->stipple,
"x1", 0.0,
"y1", 0.0,
"x2", (double) dicon->width,
- "y2", (double) icon_height,
+ "y2", (double) dicon->height - text_height - SPACING,
NULL);
if (dicon->width <= DESKTOP_SNAP_X)
gnome_icon_text_item_setxy (GNOME_ICON_TEXT_ITEM (dicon->text),
0,
- icon_height + SPACING);
+ dicon->height - text_height);
else
gnome_icon_text_item_setxy (GNOME_ICON_TEXT_ITEM (dicon->text),
(dicon->width - DESKTOP_SNAP_X) / 2,
- icon_height + SPACING);
-
- /* Create and set the window shape */
-
+ dicon->height - text_height);
+
gtk_widget_set_usize (GTK_WIDGET (dicon), dicon->width, dicon->height);
- create_window_shape (dicon, icon_width, icon_height, text_width, text_height);
dicon->icon_x = (int) ((dicon->width - icon_width) / 2.0 + 0.5);
- dicon->icon_y = 0;
+ dicon->icon_y = (int) ((dicon->height - total_height) / 2.0 + 0.5);
dicon->icon_w = icon_width;
dicon->icon_h = icon_height;
@@ -420,6 +428,11 @@
dicon->text_y = y1;
dicon->text_w = text_width;
dicon->text_h = text_height;
+
+ /* Create and set the window shape */
+
+ create_window_shape (dicon, icon_width, icon_height, text_width, text_height);
+
}
/**
@@ -436,10 +449,13 @@
g_return_if_fail (dicon != NULL);
g_return_if_fail (IS_DESKTOP_ICON (dicon));
+ gnome_icon_text_item_select (GNOME_ICON_TEXT_ITEM (dicon->text), sel);
+
+ if (desktop_use_shaped_text)
+ desktop_icon_reshape (dicon);
+
if (sel)
gnome_canvas_item_show (dicon->stipple);
else
gnome_canvas_item_hide (dicon->stipple);
-
- gnome_icon_text_item_select (GNOME_ICON_TEXT_ITEM (dicon->text), sel);
}
diff -ruN old/mc-4.5.37/gnome/gdesktop-prefs.c new/mc-4.5.38/gnome/gdesktop-prefs.c
--- old/mc-4.5.37/gnome/gdesktop-prefs.c Wed Dec 31 19:00:00 1969
+++ new/mc-4.5.38/gnome/gdesktop-prefs.c Thu Sep 2 12:49:43 1999
@@ -0,0 +1,363 @@
+/* Desktop preferences box for the Midnight Commander
+ *
+ * Copyright (C) 1999 The Free Software Foundation
+ *
+ * Author: Federico Mena
+ */
+
+#include
+#include
+#include "gdesktop-prefs.h"
+#include "gdesktop.h"
+
+
+/* Size of the icon position box */
+#define ICON_POS_WIDTH 120
+#define ICON_POS_HEIGHT 90
+#define ICON_POS_INTERVAL 10
+
+
+struct point {
+ int x, y;
+};
+
+/* Structure to hold preferences information */
+struct _GDesktopPrefs {
+ /* Property box we are attached to */
+ GnomePropertyBox *pbox;
+
+ /* Canvas for the miniature icons */
+ GtkWidget *canvas;
+
+ /* Group that holds the miniature icons */
+ GnomeCanvasItem *group;
+
+ /* Icon position flags */
+ guint right_to_left : 1;
+ guint bottom_to_top : 1;
+ guint rows_not_columns : 1;
+
+ /* Icon positioning options */
+ GtkWidget *auto_placement;
+ GtkWidget *snap_icons;
+
+ /* Icon shape options */
+ GtkWidget *use_shaped_icons;
+ GtkWidget *use_shaped_text;
+};
+
+
+/* Creates the canvas items that represent a mini-icon */
+static void
+create_mini_icon (GnomeCanvasGroup *group, int x, int y, guint color)
+{
+ gnome_canvas_item_new (group,
+ gnome_canvas_rect_get_type (),
+ "x1", (double) (x - 1),
+ "y1", (double) (y - 2),
+ "x2", (double) (x + 1),
+ "y2", (double) y,
+ "fill_color_rgba", color,
+ NULL);
+
+ gnome_canvas_item_new (group,
+ gnome_canvas_rect_get_type (),
+ "x1", (double) (x - 2),
+ "y1", (double) (y + 2),
+ "x2", (double) (x + 2),
+ "y2", (double) (y + 3),
+ "fill_color_rgba", color,
+ NULL);
+}
+
+/* Re-create the icon position mini-icons */
+static void
+create_mini_icons (GDesktopPrefs *dp, int r2l, int b2t, int rows)
+{
+ GtkStyle *style;
+ GdkColor *c;
+ guint color;
+ int i, j;
+ int max_j;
+ int x, y;
+ int dx, dy;
+ int ox, oy;
+
+ dp->right_to_left = r2l ? TRUE : FALSE;
+ dp->bottom_to_top = b2t ? TRUE : FALSE;
+ dp->rows_not_columns = rows ? TRUE : FALSE;
+
+ /* Compute color for mini icons */
+
+ style = gtk_widget_get_style (GTK_WIDGET (dp->canvas));
+ c = &style->fg[GTK_STATE_NORMAL];
+ color = ((c->red & 0xff00) << 8) | (c->green & 0xff00) | (c->blue >> 8) | 0xff;
+
+ if (dp->group)
+ gtk_object_destroy (GTK_OBJECT (dp->group));
+
+ dp->group = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (dp->canvas)),
+ gnome_canvas_group_get_type (),
+ NULL);
+
+ if (dp->right_to_left) {
+ ox = ICON_POS_WIDTH - ICON_POS_INTERVAL;
+ dx = -ICON_POS_INTERVAL;
+ } else {
+ ox = ICON_POS_INTERVAL;
+ dx = ICON_POS_INTERVAL;
+ }
+
+ if (dp->bottom_to_top) {
+ oy = ICON_POS_HEIGHT - ICON_POS_INTERVAL;
+ dy = -ICON_POS_INTERVAL;
+ } else {
+ oy = ICON_POS_INTERVAL;
+ dy = ICON_POS_INTERVAL;
+ }
+
+ if (dp->rows_not_columns)
+ y = oy;
+ else
+ x = ox;
+
+ for (i = 0; i < 2; i++) {
+ if (dp->rows_not_columns) {
+ x = ox;
+ max_j = (i == 1) ? (ICON_POS_WIDTH / 2) : ICON_POS_WIDTH;
+ } else {
+ y = oy;
+ max_j = (i == 1) ? (ICON_POS_HEIGHT / 2) : ICON_POS_HEIGHT;
+ }
+
+ for (j = ICON_POS_INTERVAL; j < max_j; j += ICON_POS_INTERVAL) {
+ create_mini_icon (GNOME_CANVAS_GROUP (dp->group), x, y, color);
+
+ if (dp->rows_not_columns)
+ x += dx;
+ else
+ y += dy;
+ }
+
+ if (dp->rows_not_columns)
+ y += dy;
+ else
+ x += dx;
+ }
+}
+
+/* Handler for button presses on the icon position canvas */
+static gint
+button_press (GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ GDesktopPrefs *dp;
+ int r2l;
+ int b2t;
+ int dx, dy;
+ int rows;
+
+ dp = data;
+
+ if (!(event->type == GDK_BUTTON_PRESS && event->button == 1))
+ return FALSE;
+
+ if (event->x > ICON_POS_WIDTH / 2) {
+ r2l = TRUE;
+ dx = ICON_POS_WIDTH - event->x;
+ } else {
+ r2l = FALSE;
+ dx = event->x;
+ }
+
+ if (event->y > ICON_POS_HEIGHT / 2) {
+ b2t = TRUE;
+ dy = ICON_POS_HEIGHT - event->y;
+ } else {
+ b2t = FALSE;
+ dy = event->y;
+ }
+
+ if (dx < dy)
+ rows = FALSE;
+ else
+ rows = TRUE;
+
+ create_mini_icons (dp, r2l, b2t, rows);
+ gnome_property_box_changed (dp->pbox);
+ return TRUE;
+}
+
+/* Creates the canvas widget and items to configure icon position */
+static GtkWidget *
+create_icon_pos (GDesktopPrefs *dp)
+{
+ dp->canvas = gnome_canvas_new ();
+ gtk_widget_set_usize (dp->canvas, ICON_POS_WIDTH, ICON_POS_HEIGHT);
+ gnome_canvas_set_scroll_region (GNOME_CANVAS (dp->canvas),
+ 0.0, 0.0, ICON_POS_WIDTH, ICON_POS_HEIGHT);
+
+ gtk_signal_connect (GTK_OBJECT (dp->canvas), "button_press_event",
+ GTK_SIGNAL_FUNC (button_press),
+ dp);
+
+ create_mini_icons (dp, desktop_arr_r2l, desktop_arr_b2t, desktop_arr_rows);
+
+ return dp->canvas;
+}
+
+/* Callback used to notify a property box when a toggle button is toggled */
+static void
+toggled (GtkWidget *w, gpointer data)
+{
+ gnome_property_box_changed (GNOME_PROPERTY_BOX (data));
+}
+
+/* Creates a check box that will notify a property box when it changes */
+static GtkWidget *
+create_check_box (char *text, int state, GnomePropertyBox *pbox)
+{
+ GtkWidget *w;
+
+ w = gtk_check_button_new_with_label (text);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), state);
+ gtk_signal_connect (GTK_OBJECT (w), "toggled",
+ GTK_SIGNAL_FUNC (toggled),
+ pbox);
+
+ return w;
+}
+
+/* Creates the widgets that are used to configure icon position and snapping */
+static GtkWidget *
+create_position_widgets (GDesktopPrefs *dp)
+{
+ GtkWidget *vbox;
+ GtkWidget *w;
+ GtkWidget *frame;
+
+ vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
+
+ /* Icon position */
+
+ w = gtk_label_new (_("Icon position"));
+ gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
+
+ w = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
+ gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
+
+ frame = gtk_frame_new (NULL);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
+ gtk_container_add (GTK_CONTAINER (w), frame);
+
+ w = create_icon_pos (dp);
+ gtk_container_add (GTK_CONTAINER (frame), w);
+
+ /* Snap and placement */
+
+ dp->auto_placement = create_check_box (_("Automatic icon placement"),
+ desktop_auto_placement, dp->pbox);
+ gtk_box_pack_start (GTK_BOX (vbox), dp->auto_placement, FALSE, FALSE, 0);
+
+ dp->snap_icons = create_check_box (_("Snap icons to grid"),
+ desktop_snap_icons, dp->pbox);
+ gtk_box_pack_start (GTK_BOX (vbox), dp->snap_icons, FALSE, FALSE, 0);
+
+ return vbox;
+}
+
+/* Creates the widgets that are used to configure the icon shape */
+static GtkWidget *
+create_shape_widgets (GDesktopPrefs *dp)
+{
+ GtkWidget *vbox;
+
+ vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
+
+ dp->use_shaped_icons = create_check_box (_("Use shaped icons"),
+ desktop_use_shaped_icons, dp->pbox);
+ gtk_box_pack_start (GTK_BOX (vbox), dp->use_shaped_icons, FALSE, FALSE, 0);
+
+ dp->use_shaped_text = create_check_box (_("Use shaped text"),
+ desktop_use_shaped_text, dp->pbox);
+ gtk_box_pack_start (GTK_BOX (vbox), dp->use_shaped_text, FALSE, FALSE, 0);
+
+ return vbox;
+}
+
+/* Callback to destroy the desktop preferences data */
+static void
+destroy (GtkObject *object, gpointer data)
+{
+ GDesktopPrefs *dp;
+
+ dp = data;
+ g_free (dp);
+}
+
+/* Creates all the widgets in the desktop preferences page */
+static GtkWidget *
+create_widgets (GDesktopPrefs *dp)
+{
+ GtkWidget *hbox;
+ GtkWidget *w;
+
+ hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), GNOME_PAD_SMALL);
+ gtk_signal_connect (GTK_OBJECT (hbox), "destroy",
+ GTK_SIGNAL_FUNC (destroy),
+ dp);
+
+ w = create_position_widgets (dp);
+ gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
+
+ w = create_shape_widgets (dp);
+ gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
+
+ gtk_widget_show_all (hbox);
+ return hbox;
+}
+
+/* Creates the desktop preferences page */
+GDesktopPrefs *
+desktop_prefs_new (GnomePropertyBox *pbox)
+{
+ GDesktopPrefs *dp;
+ GtkWidget *page;
+
+ g_return_val_if_fail (pbox != NULL, NULL);
+
+ dp = g_new0 (GDesktopPrefs, 1);
+
+ dp->pbox = pbox;
+
+ page = create_widgets (dp);
+ gnome_property_box_append_page (pbox, page, gtk_label_new (_("Desktop")));
+
+ return dp;
+}
+
+/* Applies the changes in the desktop preferences page */
+void
+desktop_prefs_apply (GDesktopPrefs *dp)
+{
+ g_return_if_fail (dp != NULL);
+
+ desktop_arr_r2l = dp->right_to_left;
+ desktop_arr_b2t = dp->bottom_to_top;
+ desktop_arr_rows = dp->rows_not_columns;
+
+ desktop_auto_placement = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (dp->auto_placement));
+
+ desktop_snap_icons = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (dp->snap_icons));
+
+ desktop_use_shaped_icons = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (dp->use_shaped_icons));
+
+ desktop_use_shaped_text = gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (dp->use_shaped_text));
+
+ desktop_reload_icons (FALSE, 0, 0);
+}
diff -ruN old/mc-4.5.37/gnome/gdesktop-prefs.h new/mc-4.5.38/gnome/gdesktop-prefs.h
--- old/mc-4.5.37/gnome/gdesktop-prefs.h Wed Dec 31 19:00:00 1969
+++ new/mc-4.5.38/gnome/gdesktop-prefs.h Thu Sep 2 12:49:44 1999
@@ -0,0 +1,18 @@
+/* Desktop preferences box for the Midnight Commander
+ *
+ * Copyright (C) 1999 The Free Software Foundation
+ *
+ * Author: Federico Mena
+ */
+
+#ifndef GDESKTOP_PREFS_H
+#define GDESKTOP_PREFS_H
+
+#include
+
+typedef struct _GDesktopPrefs GDesktopPrefs;
+
+GDesktopPrefs *desktop_prefs_new (GnomePropertyBox *pbox);
+void desktop_prefs_apply (GDesktopPrefs *dp);
+
+#endif
diff -ruN old/mc-4.5.37/gnome/gdesktop.c new/mc-4.5.38/gnome/gdesktop.c
--- old/mc-4.5.37/gnome/gdesktop.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gdesktop.c Thu Sep 2 12:49:43 1999
@@ -42,14 +42,19 @@
/* Configuration options for the desktop */
int desktop_use_shaped_icons = TRUE;
+int desktop_use_shaped_text = FALSE;
int desktop_auto_placement = FALSE;
int desktop_snap_icons = FALSE;
+int desktop_arr_r2l = FALSE;
+int desktop_arr_b2t = FALSE;
+int desktop_arr_rows = FALSE;
/* The computed name of the user's desktop directory */
char *desktop_directory;
-/* Layout information: number of rows/columns for the layout slots, and the array of slots. Each
- * slot is an integer that specifies the number of icons that belong to that slot.
+/* Layout information: number of rows/columns for the layout slots, and the
+ * array of slots. Each slot is an integer that specifies the number of icons
+ * that belong to that slot.
*/
static int layout_screen_width;
static int layout_screen_height;
@@ -129,6 +134,8 @@
static DesktopIconInfo *desktop_icon_info_new (char *filename, char *url, char *caption,
int xpos, int ypos);
+static GHashTable *icon_hash;
+
/* Convenience function to figure out the slot corresponding to an (x, y) position */
static void
@@ -143,30 +150,82 @@
*v = CLAMP (vv, 0, layout_rows - 1);
}
+/* Swaps two integer variables */
+static void
+swap (int *a, int *b)
+{
+ int tmp;
+
+ tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+
/* Looks for a free slot in the layout_slots array and returns the coordinates
* that coorespond to it. "Free" means it either has zero icons in it, or it
* has the minimum number of icons of all the slots. Returns the number of
* icons in the sought spot (ideally 0).
*/
static int
-auto_pos (int start_slot, int end_slot, int *slot)
+auto_pos (int sx, int ex, int sy, int ey, int *slot)
{
int min, min_slot;
- int i;
+ int x, y;
int val;
+ int xinc, yinc;
+ int r, b;
- min = layout_slots[start_slot].num_icons;
- min_slot = start_slot;
+ min = l_slots (sx, sy).num_icons;
+ min_slot = sx * layout_rows + sy;
+ xinc = yinc = 1;
- for (i = start_slot; i < end_slot; i++) {
- val = layout_slots[i].num_icons;
+ if (desktop_arr_rows) {
+ swap (&ex, &ey);
+ swap (&sx, &sy);
+ }
- if (val < min || val == 0) {
- min = val;
- min_slot = i;
- if (val == 0)
- break;
+#if 0
+ if (desktop_arr_r2l)
+ swap (&sx, &ex);
+
+ if (desktop_arr_b2t)
+ swap (&sy, &ey);
+#endif
+ if (desktop_arr_r2l)
+ xinc = -1;
+
+ if (desktop_arr_b2t)
+ yinc = -1;
+
+ if (desktop_arr_rows)
+ swap (&xinc, &yinc);
+
+ r = desktop_arr_r2l;
+ b = desktop_arr_b2t;
+
+ if (desktop_arr_rows)
+ swap (&r, &b);
+
+ for (x = sx; (r ? (x >= ex) : (x <= ex)); x += xinc) {
+ for (y = sy; (b ? (y >= ey) : (y <= ey)); y += yinc) {
+ if (desktop_arr_rows)
+ val = l_slots (y, x).num_icons;
+ else
+ val = l_slots (x, y).num_icons;
+
+ if (val < min || val == 0) {
+ min = val;
+ if (desktop_arr_rows)
+ min_slot = (y * layout_rows + x);
+ else
+ min_slot = (x * layout_rows + y);
+ if (val == 0)
+ break;
+ }
}
+
+ if (val == 0)
+ break;
}
*slot = min_slot;
@@ -177,29 +236,63 @@
static void
get_icon_auto_pos (int *x, int *y)
{
- int start, end;
- int u, v;
- int val1, val2;
- int slot1, slot2;
+ int val1;
+ int slot1;
int slot;
+ int sx, sy, ex, ey;
+
+#if 0
+ get_slot_from_pos (*x, *y, &sx, &sy);
+#endif
+ /* FIXME funky stuff going on with the efficient positioning thingy */
+ if (desktop_arr_r2l)
+ sx = layout_cols - 1;
+ else
+ sx = 0;
- get_slot_from_pos (*x, *y, &u, &v);
- start = u * layout_rows + v;
- end = layout_cols * layout_rows;
+ if (desktop_arr_b2t)
+ sy = layout_rows - 1;
+ else
+ sy = 0;
+
+ if (desktop_arr_r2l)
+ ex = 0;
+ else
+ ex = layout_cols - 1;
+
+ if (desktop_arr_b2t)
+ ey = 0;
+ else
+ ey = layout_rows - 1;
/* Look forwards until the end of the grid. If we could not find an
* empty spot, find the second best.
*/
- val1 = auto_pos (start, end, &slot1);
+ val1 = auto_pos (sx, ex, sy, ey, &slot1);
+
+ slot = slot1;
+#if 0
+ /* to be used at a later date */
if (val1 == 0)
slot = slot1;
else {
- val2 = auto_pos (0, start, &slot2);
+ if (desktop_arr_r2l)
+ sx = layout_cols - 1;
+ else
+ sx = 0;
+
+ if (desktop_arr_b2t)
+ sy = layout_rows - 1;
+ else
+ sy = 0;
+
+ val2 = auto_pos (sx, ex, sy, ey, &slot2);
if (val2 < val1)
slot = slot2;
}
+#endif
*x = (slot / layout_rows) * DESKTOP_SNAP_X;
*y = (slot % layout_rows) * DESKTOP_SNAP_Y;
@@ -309,6 +402,8 @@
gtk_widget_destroy (dii->dicon);
remove_from_slot (dii);
+ g_hash_table_remove (icon_hash, dii->filename);
+
g_free (dii->url);
g_free (dii->filename);
g_free (dii);
@@ -492,10 +587,13 @@
fau = g_new0 (file_and_url_t, 1);
fau->filename = g_strdup (dirent->d_name);
+
if (desktop_url)
- fau->url = g_strdup (desktop_url);
+ fau->url = g_strdup (desktop_url);
+
if (caption)
fau->caption = g_strdup (caption);
+
need_position_list = g_slist_prepend (need_position_list, fau);
}
@@ -610,25 +708,39 @@
x_flush_events ();
}
+static WPanel *create_panel_from_desktop(); /* Fwd decl */
+static void free_panel_from_desktop(WPanel *panel);
+
/* Perform automatic arrangement of the desktop icons */
-void
-desktop_arrange_icons (void)
+static void
+desktop_arrange_icons (SortType type)
{
- GList *icons, *l;
+ WPanel *panel;
+ sortfn *sfn;
+ DesktopIconInfo *dii;
+ int i;
+ dir_list dir;
int xpos, ypos;
- icons = g_list_reverse (get_all_icons ());
+ panel = create_panel_from_desktop ();
+ sfn = sort_get_func_from_type (type);
+ g_assert (sfn != NULL);
+
+ do_sort (&panel->dir, sfn, panel->count - 1, FALSE, FALSE);
+ dir = panel->dir;
+ g_assert (dir.list != NULL);
- for (l = icons; l; l = l->next)
- remove_from_slot (l->data);
+ for (i = 0; i < dir.size; i++)
+ remove_from_slot (desktop_icon_info_get_by_filename (dir.list[i].fname));
- for (l = icons; l; l = l->next) {
+ for (i = 0; i < dir.size; i++) {
+ dii = desktop_icon_info_get_by_filename (dir.list[i].fname);
xpos = ypos = 0;
get_icon_auto_pos (&xpos, &ypos);
- desktop_icon_info_place (l->data, xpos, ypos);
+ desktop_icon_info_place (dii, xpos, ypos);
}
- g_list_free (icons);
+ free_panel_from_desktop (panel);
}
/* Unselects all the desktop icons except the one in exclude */
@@ -804,8 +916,16 @@
XFree (h);
}
-/*
- * Callback used when an icon's text changes. We must validate the
+/* Removes the Gtk and Gdk grabs that are present when editing a desktop icon */
+static void
+remove_editing_grab (DesktopIconInfo *dii)
+{
+ gtk_grab_remove (dii->dicon);
+ gdk_pointer_ungrab (GDK_CURRENT_TIME);
+ gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+}
+
+/* Callback used when an icon's text changes. We must validate the
* rename and return the appropriate value. The desktop icon info
* structure is passed in the user data.
*/
@@ -821,6 +941,7 @@
int retval;
dii = data;
+ remove_editing_grab (dii);
source = g_concat_dir_and_file (desktop_directory, dii->filename);
new_name = gnome_icon_text_item_get_text (iti);
@@ -830,12 +951,29 @@
dest = g_concat_dir_and_file (desktop_directory, new_name);
- if (mc_rename (source, dest) == 0) {
- gnome_metadata_delete (dest);
- gnome_metadata_rename (source, dest);
+ if (rename_file_with_context (source, dest) == FILE_CONT) {
+ GList *icons;
+ GList *l;
+
+ /* See if there was an icon for the new name. If so,
+ * destroy it first; desktop_reload_icons() will not be
+ * happy if two icons have the same filename.
+ */
+
+ icons = get_all_icons ();
+ l = icon_exists_in_list (icons, new_name);
+ if (l)
+ desktop_icon_info_destroy (l->data);
+
+ g_list_free (icons);
+ /* Set the new name */
+
+ g_hash_table_remove (icon_hash, dii->filename);
g_free (dii->filename);
+
dii->filename = g_strdup (new_name);
+ g_hash_table_insert (icon_hash, dii->filename, dii);
set_icon_wmclass (dii);
desktop_reload_icons (FALSE, 0, 0);
@@ -928,10 +1066,7 @@
DesktopIconInfo *dii;
dii = data;
-
- gtk_grab_remove (dii->dicon);
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+ remove_editing_grab (dii);
/* Re-enable drags from this icon */
@@ -1401,21 +1536,9 @@
DesktopIconInfo *
desktop_icon_info_get_by_filename (char *filename)
{
- int i;
- GList *l;
- DesktopIconInfo *dii;
-
g_return_val_if_fail (filename != NULL, NULL);
- for (i = 0; i < layout_cols * layout_rows; i++)
- for (l = layout_slots[i].icons; l; l = l->next) {
- dii = l->data;
-
- if (strcmp (dii->filename, filename) == 0)
- return dii;
- }
-
- return NULL;
+ return g_hash_table_lookup (icon_hash, filename);
}
/* Used to execute the popup menu for desktop icons */
@@ -1916,12 +2039,12 @@
full_name = g_concat_dir_and_file (desktop_directory, dii->filename);
fe = file_entry_from_file (full_name);
- if (!fe){
+ if (!fe) {
g_free (full_name);
return;
}
- if (gdnd_perform_drop (context, data, desktop_directory, fe))
+ if (gdnd_perform_drop (context, data, full_name, fe))
desktop_reload_icons (FALSE, 0, 0);
file_entry_free (fe);
@@ -2038,8 +2161,11 @@
setup_icon_dnd_dest (dii);
/* Place the icon and append it to the list */
-
desktop_icon_info_place (dii, xpos, ypos);
+
+ /* Put into icon hash table */
+ g_hash_table_insert (icon_hash, dii->filename, dii);
+
return dii;
}
@@ -2208,7 +2334,7 @@
info.protocol_style = 5; /* XmDRAG_DYNAMIC */
info.proxy_window = proxy_xid;
info.num_drop_sites = 0;
- info.total_size = sizeof(info);
+ info.total_size = sizeof (info);
XChangeProperty (gdk_display, xid,
receiver_info_atom,
@@ -2371,11 +2497,46 @@
return proxy_gdk_window;
}
-/* Callback for arranging the icons on the desktop */
+/* Callback for arranging icons by name */
+static void
+handle_arrange_icons_name (GtkWidget *widget, gpointer data)
+{
+ desktop_arrange_icons (SORT_NAME);
+}
+
+/* Callback for arranging icons by file type */
+static void
+handle_arrange_icons_type (GtkWidget *widget, gpointer data)
+{
+ desktop_arrange_icons (SORT_EXTENSION);
+}
+
+/* Callback for arranging icons by file size */
+static void
+handle_arrange_icons_size (GtkWidget *widget, gpointer data)
+{
+ desktop_arrange_icons (SORT_SIZE);
+}
+
+/* Callback for arranging icons by access time */
+static void
+handle_arrange_icons_access (GtkWidget *widget, gpointer data)
+{
+ desktop_arrange_icons (SORT_ACCESS);
+}
+
+/* Callback for arranging icons by modification time */
+static void
+handle_arrange_icons_mod (GtkWidget *widget, gpointer data)
+{
+ desktop_arrange_icons (SORT_MODIFY);
+}
+
+/* Callback for arranging icons by change time */
static void
-handle_arrange_icons (GtkWidget *widget, gpointer data)
+handle_arrange_icons_change (GtkWidget *widget, gpointer data)
{
- desktop_arrange_icons ();
+ desktop_arrange_icons (SORT_CHANGE);
}
/* Callback for creating a new panel window */
@@ -2385,13 +2546,12 @@
new_panel_at (gnome_user_home_dir);
}
+/* Rescans the mountable devices in the desktop and re-creates their icons */
void
desktop_rescan_devices (void)
{
desktop_cleanup_devices ();
-
gdesktop_init ();
-
desktop_reload_icons (FALSE, 0, 0);
}
@@ -2447,46 +2607,79 @@
}
static GnomeUIInfo gnome_panel_new_menu [] = {
- GNOMEUIINFO_ITEM_NONE(N_("_Terminal"), N_("Launch a new terminal in the current directory"), new_terminal),
+ GNOMEUIINFO_ITEM_NONE (N_("_Terminal"), N_("Launch a new terminal in the current directory"), new_terminal),
/* If this ever changes, make sure you update create_new_menu accordingly. */
- GNOMEUIINFO_ITEM_NONE( N_("_Directory..."), N_("Creates a new directory"), gnome_mkdir_cmd ),
- GNOMEUIINFO_ITEM_NONE( N_("URL L_ink..."), N_("Creates a new URL link"), gnome_new_link ),
- GNOMEUIINFO_ITEM_NONE( N_("_Launcher..."), N_("Creates a new launcher"), gnome_new_launcher ),
+ GNOMEUIINFO_ITEM_NONE (N_("_Directory..."), N_("Creates a new directory"), gnome_mkdir_cmd),
+ GNOMEUIINFO_ITEM_NONE (N_("URL L_ink..."), N_("Creates a new URL link"), gnome_new_link),
+ GNOMEUIINFO_ITEM_NONE (N_("_Launcher..."), N_("Creates a new launcher"), gnome_new_launcher),
+ GNOMEUIINFO_END
+};
+
+/* Menu items for arranging the desktop icons */
+GnomeUIInfo desktop_arrange_icons_items[] = {
+ GNOMEUIINFO_ITEM_NONE (N_("By _Name"), NULL, handle_arrange_icons_name),
+ GNOMEUIINFO_ITEM_NONE (N_("By File _Type"), NULL, handle_arrange_icons_type),
+ GNOMEUIINFO_ITEM_NONE (N_("By _Size"), NULL, handle_arrange_icons_size),
+ GNOMEUIINFO_ITEM_NONE (N_("By Time Last _Accessed"), NULL, handle_arrange_icons_access),
+ GNOMEUIINFO_ITEM_NONE (N_("By Time Last _Modified"), NULL, handle_arrange_icons_mod),
+ GNOMEUIINFO_ITEM_NONE (N_("By Time Last _Changed"), NULL, handle_arrange_icons_change),
GNOMEUIINFO_END
};
/* The popup menu for the desktop */
GnomeUIInfo desktop_popup_items[] = {
- GNOMEUIINFO_MENU_NEW_SUBTREE(gnome_panel_new_menu),
+ GNOMEUIINFO_MENU_NEW_SUBTREE (gnome_panel_new_menu),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_ITEM_NONE (N_("Arrange Icons"), NULL, handle_arrange_icons),
- GNOMEUIINFO_ITEM_NONE (N_("Create New Window"), NULL, handle_new_window),
+ GNOMEUIINFO_SUBTREE (N_("_Arrange Icons"), desktop_arrange_icons_items),
+ GNOMEUIINFO_ITEM_NONE (N_("Create _New Window"), NULL, handle_new_window),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop Shortcuts"), NULL, handle_rescan_devices),
- GNOMEUIINFO_ITEM_NONE (N_("Rescan Desktop"), NULL, handle_rescan_desktop),
- GNOMEUIINFO_ITEM_NONE (N_("Configure Background Image"), NULL, set_background_image),
+ GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop _Shortcuts"), NULL, handle_rescan_devices),
+ GNOMEUIINFO_ITEM_NONE (N_("Rescan _Desktop"), NULL, handle_rescan_desktop),
+ GNOMEUIINFO_ITEM_NONE (N_("Configure _Background Image"), NULL, set_background_image),
GNOMEUIINFO_END
};
+static int
+strip_tearoff_menu_item (GnomeUIInfo *infos)
+{
+ GtkWidget *shell;
+ GList *child_list;
+ int n;
+
+ g_assert (infos != NULL);
+
+ shell = infos[0].widget->parent;
+ child_list = gtk_container_children (GTK_CONTAINER (shell));
+ n = g_list_length (child_list);
+
+ if (child_list && GTK_IS_TEAROFF_MENU_ITEM (child_list->data)) {
+ n--;
+ gtk_widget_destroy (GTK_WIDGET (child_list->data));
+#if 0
+ gtk_widget_hide (GTK_WIDGET (child_list->data));
+#endif
+ }
+
+ return n;
+}
+
/* Executes the popup menu for the desktop */
static void
desktop_popup (GdkEventButton *event)
{
GtkWidget *shell;
GtkWidget *popup;
- GList *child_list;
gchar *file, *file2;
WPanel *panel;
gint i;
+ /* Create the menu and then strip the tearoff menu items, sigh... */
+
popup = gnome_popup_menu_new (desktop_popup_items);
- /* First thing we want to do is strip off the STUPID tear off menu... S-: */
+
+ strip_tearoff_menu_item (desktop_arrange_icons_items);
+ i = strip_tearoff_menu_item (gnome_panel_new_menu);
shell = gnome_panel_new_menu[0].widget->parent;
- child_list = gtk_container_children (GTK_CONTAINER (shell));
- if (GTK_IS_TEAROFF_MENU_ITEM (child_list->data))
- gtk_widget_hide (GTK_WIDGET (child_list->data));
- i = g_list_length (child_list);
- g_list_free (child_list);
file = gnome_unconditional_datadir_file ("mc/templates");
i = create_new_menu_from (file, shell, i);
file2 = gnome_datadir_file ("mc/templates");
@@ -2648,7 +2841,6 @@
desktop_icon_select (DESKTOP_ICON (dii->dicon), dii->tmp_selected);
dii->selected = dii->tmp_selected;
}
-
}
}
@@ -2658,6 +2850,29 @@
{
GdkCursor *cursor;
+ /* maybe the user wants to click on the icon text */
+ if (event->button == 1 && desktop_use_shaped_text) {
+ int x = event->x;
+ int y = event->y;
+ GList *l, *icons = get_all_icons ();
+ DesktopIconInfo *clicked = NULL;
+ for (l = icons; l; l = l->next) {
+ DesktopIconInfo *dii = l->data;
+ DesktopIcon *di = DESKTOP_ICON (dii->dicon);
+ int x1 = dii->x + di->text_x;
+ int y1 = dii->y + di->text_y;
+ int x2 = x1 + di->text_w;
+ int y2 = y1 + di->text_h;
+ if (x>=x1 && y>=y1 && x<=x2 && y<=y2)
+ clicked = dii;
+ }
+ g_list_free (icons);
+ if (clicked) {
+ select_icon (clicked, event->state);
+ return FALSE;
+ }
+ }
+
if (event->button == 1) {
click_start_x = event->x;
click_start_y = event->y;
@@ -2922,6 +3137,7 @@
gdk_bitmap_unref (stipple);
}
+
/**
* desktop_init
*
@@ -2931,6 +3147,8 @@
void
desktop_init (void)
{
+ icon_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
gdnd_init ();
gicon_init ();
create_layout_info ();
@@ -2976,6 +3194,8 @@
gtk_widget_destroy (proxy_invisible);
XDeleteProperty (GDK_DISPLAY (), GDK_ROOT_WINDOW (), gdk_atom_intern ("XdndProxy", FALSE));
+
+ g_hash_table_destroy (icon_hash);
}
void
diff -ruN old/mc-4.5.37/gnome/gdesktop.h new/mc-4.5.38/gnome/gdesktop.h
--- old/mc-4.5.37/gnome/gdesktop.h Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gdesktop.h Thu Sep 2 12:49:44 1999
@@ -25,10 +25,17 @@
/* Configuration options for the desktop */
extern int desktop_use_shaped_icons; /* Whether to use shaped icons or not (for slow X servers) */
+extern int desktop_use_shaped_text; /* Shaped text for the icons on the desktop */
extern int desktop_auto_placement; /* Whether to auto-place icons or not (user placement) */
extern int desktop_snap_icons; /* Whether to snap icons to the grid or not */
+extern int desktop_arr_r2l; /* Arrange from right to left */
+extern int desktop_arr_b2t; /* Arrange from bottom to top */
+extern int desktop_arr_rows; /* Arrange in rows instead of columns */
extern char *desktop_directory;
+/* Menu items for arranging the desktop icons */
+extern GnomeUIInfo desktop_arrange_icons_items[];
+
/* Initializes the desktop -- init DnD, load the default desktop icons, etc. */
void desktop_init (void);
@@ -63,7 +70,6 @@
gboolean do_mount_umount (char *filename, gboolean is_mount);
gboolean do_eject (char *filename);
-void desktop_arrange_icons (void);
void desktop_rescan_devices (void);
void desktop_reload_icons (int user_pos, int xpos, int ypos);
void desktop_create_url (const char *filename, const char *title, const char *url, const char *icon);
diff -ruN old/mc-4.5.37/gnome/gdialogs.c new/mc-4.5.38/gnome/gdialogs.c
--- old/mc-4.5.37/gnome/gdialogs.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gdialogs.c Thu Sep 2 12:49:43 1999
@@ -84,16 +84,17 @@
length -= dotdotdot;
len = (gint) ((1.0 - (gfloat) length / (gfloat) cur_length) * strlen (path));
-
+
/* we guess a starting point */
if (gdk_string_width (ui->op_source_label->style->font, path + len) < length) {
while (gdk_string_width (ui->op_source_label->style->font, path + len) < length)
- len --;
+ len--;
len++;
} else {
while (gdk_string_width (ui->op_source_label->style->font, path + len) > length)
- len ++;
+ len++;
}
+
path_copy = g_strdup_printf ("...%s", path + len);
return path_copy;
}
@@ -134,7 +135,7 @@
else {
path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - from_width,
path_width);
-
+
gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy);
g_free (path_copy);
}
@@ -167,7 +168,7 @@
return FILE_CONT;
}
- if (!to_width)
+ if (!to_width)
to_width = gdk_string_width (ui->op_target_label->style->font,
_(gdialog_to_string));
path_width = gdk_string_width (ui->op_target_label->style->font, path);
@@ -216,7 +217,7 @@
else {
path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - deleting_width,
path_width);
-
+
gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy);
g_free (path_copy);
}
@@ -235,12 +236,12 @@
/* ctx->ui might be NULL for background processes */
if (ctx->ui == NULL)
return FILE_CONT;
-
+
ui = ctx->ui;
if (ui->aborting)
return FILE_ABORT;
-
+
if (total > 0) {
perc = (double) done / (double) total;
snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc));
@@ -262,7 +263,7 @@
/* ctx->ui might be NULL for background processes */
if (ctx->ui == NULL)
return FILE_CONT;
-
+
ui = ctx->ui;
if (ui->aborting)
@@ -549,7 +550,6 @@
GtkWidget *notebook;
GtkWidget *hbox;
GtkWidget *vbox, *label;
- GtkWidget *alignment;
GtkWidget *fentry;
GtkWidget *cbox;
GtkWidget *icon;
@@ -558,45 +558,60 @@
const char *error;
struct stat buf;
int run;
-
+
g_return_val_if_fail (ctx != NULL, NULL);
ctx->stable_symlinks = 0;
/* Basic window */
if (operation == OP_COPY)
- fmd_win = gnome_dialog_new (_("Copy"), GNOME_STOCK_BUTTON_OK,
+ fmd_win = gnome_dialog_new (_("Copy"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
else if (operation == OP_MOVE)
- fmd_win = gnome_dialog_new (_("Move"), GNOME_STOCK_BUTTON_OK,
+ fmd_win = gnome_dialog_new (_("Move"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (fmd_win), GTK_WIN_POS_MOUSE);
-
- hbox = gtk_hbox_new (FALSE, GNOME_PAD);
+
notebook = gtk_notebook_new ();
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (fmd_win)->vbox),
notebook, FALSE, FALSE, 0);
- /*FIXME: I wan't a bigger, badder, better Icon here... */
+
+ hbox = gtk_hbox_new (FALSE, GNOME_PAD);
+ gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
+ hbox,
+ gtk_label_new (_("Destination")));
+
+ /* FIXME: I want a bigger, badder, better Icon here... */
icon = gnome_stock_pixmap_widget (hbox, GNOME_STOCK_PIXMAP_HELP);
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
+
vbox = gtk_vbox_new (FALSE, GNOME_PAD);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD);
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- hbox,
- gtk_label_new (_("Destination")));
- alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
+
label = gtk_label_new (text);
- gtk_container_add (GTK_CONTAINER (alignment), label);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
fentry = gnome_file_entry_new ("gmc-copy-file", _("Find Destination Folder"));
gnome_file_entry_set_directory (GNOME_FILE_ENTRY (fentry), TRUE);
gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fentry))),
def_text);
gnome_file_entry_set_default_path (GNOME_FILE_ENTRY (fentry), def_text);
+ gnome_file_entry_set_modal (GNOME_FILE_ENTRY (fentry), TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), fentry, FALSE, FALSE, 0);
+
+ /* Background operations are completely hosed, so we olympically disable
+ * them. How's that for foolproof bugfixing.
+ */
+
+ *do_background = FALSE;
+#if 0
cbox = gtk_check_button_new_with_label (_("Copy as a background process"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbox), *do_background);
- gtk_signal_connect (GTK_OBJECT (cbox), "toggled", (GtkSignalFunc) fmd_check_box_callback, do_background);
+ gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
+ (GtkSignalFunc) fmd_check_box_callback, do_background);
#if 0
gnome_widget_add_help (cbox, "Selecting this will run the copying in the background. "
"This is useful for transfers over networks that might take a long "
@@ -604,16 +619,13 @@
#endif
gtk_box_pack_end (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (vbox), fentry, FALSE, FALSE, 0);
- gnome_file_entry_set_modal(GNOME_FILE_ENTRY (fentry),TRUE);
-
- gtk_box_pack_end (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+#endif
/* Advanced Options */
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- hbox,
+ hbox,
gtk_label_new (_("Advanced Options")));
gtk_container_set_border_width (GTK_CONTAINER (hbox), GNOME_PAD);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
@@ -644,7 +656,8 @@
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
(GtkSignalFunc) fmd_check_box_callback, &ctx->op_preserve);
#if 0
- gnome_widget_add_help (cbox, _("Preserves the permissions and the UID/GID if possible"));
+ gnome_widget_add_help (cbox,
+ _("Preserves the permissions and the UID/GID if possible"));
#endif
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
@@ -653,31 +666,30 @@
cbox = gtk_check_button_new_with_label (_("Recursively copy subdirectories."));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbox), ctx->dive_into_subdirs);
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
- (GtkSignalFunc) fmd_check_box_callback, &ctx->dive_into_subdirs);
+ (GtkSignalFunc) fmd_check_box_callback,
+ &ctx->dive_into_subdirs);
#if 0
- gnome_widget_add_help (cbox, _("If set, this will copy the directories recursively"));
+ gnome_widget_add_help (cbox,
+ _("If set, this will copy the directories recursively"));
#endif
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
}
gtk_widget_show_all (GNOME_DIALOG (fmd_win)->vbox);
- gtk_window_set_modal (GTK_WINDOW (fmd_win), FALSE);
gnome_dialog_set_close (GNOME_DIALOG (fmd_win), TRUE);
gnome_dialog_close_hides (GNOME_DIALOG (fmd_win), TRUE);
/* Off to the races!!! */
run = gnome_dialog_run (GNOME_DIALOG (fmd_win));
-
- if (run == 1) {
+
+ if (run == 1 || run == -1) {
gtk_widget_destroy (fmd_win);
return NULL;
}
- if (run == -1)
- return NULL;
-
- dest_dir = gnome_file_entry_get_full_path(GNOME_FILE_ENTRY (fentry), FALSE);
+ dest_dir = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (fentry), FALSE);
gtk_widget_destroy (fmd_win);
+
easy_patterns = 1;
if (!dest_dir || !*dest_dir)
return NULL;
@@ -735,12 +747,13 @@
else
ctx->dest_mask++;
orig_mask = ctx->dest_mask;
- if (!*ctx->dest_mask || (!ctx->dive_into_subdirs && !is_wildcarded (ctx->dest_mask) &&
- (!only_one || (!mc_stat (dest_dir, &buf)
- && S_ISDIR (buf.st_mode)))) ||
- (ctx->dive_into_subdirs && ((!only_one && !is_wildcarded (ctx->dest_mask)) ||
- (only_one && !mc_stat (dest_dir, &buf)
- && S_ISDIR (buf.st_mode)))))
+ if (!*ctx->dest_mask
+ || (!ctx->dive_into_subdirs && !is_wildcarded (ctx->dest_mask)
+ && (!only_one || (!mc_stat (dest_dir, &buf)
+ && S_ISDIR (buf.st_mode))))
+ || (ctx->dive_into_subdirs && ((!only_one && !is_wildcarded (ctx->dest_mask))
+ || (only_one && !mc_stat (dest_dir, &buf)
+ && S_ISDIR (buf.st_mode)))))
ctx->dest_mask = g_strdup ("*");
else {
ctx->dest_mask = g_strdup (ctx->dest_mask);
@@ -764,7 +777,8 @@
gboolean rest_same;
if (ctx->recursive_result < RECURSIVE_ALWAYS) {
- msg = g_strdup_printf(_("%s\n\nDirectory not empty. Delete it recursively?"), name_trunc (s, 80));
+ msg = g_strdup_printf (_("%s\n\nDirectory not empty. Delete it recursively?"),
+ name_trunc (s, 80));
dialog = gnome_message_box_new (msg,
GNOME_MESSAGE_BOX_QUESTION,
GNOME_STOCK_BUTTON_YES,
@@ -772,7 +786,7 @@
GNOME_STOCK_BUTTON_CANCEL,
NULL);
g_free (msg);
-
+
title = g_strconcat (_(" Delete: "), name_trunc (s, 30), " ", NULL);
gtk_window_set_title (GTK_WINDOW (dialog), title);
g_free (title);
@@ -781,14 +795,14 @@
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
togglebutton, FALSE, FALSE, 0);
gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox);
-
+
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
-
+
button = gnome_dialog_run (GNOME_DIALOG (dialog));
rest_same = GTK_TOGGLE_BUTTON (togglebutton)->active;
gtk_widget_destroy (dialog);
-
+
switch (button) {
case 0:
ctx->recursive_result = rest_same ? RECURSIVE_ALWAYS : RECURSIVE_YES;
@@ -801,22 +815,22 @@
break;
default:
}
-
+
if (ctx->recursive_result != RECURSIVE_ABORT)
do_refresh ();
}
-
+
switch (ctx->recursive_result){
case RECURSIVE_YES:
case RECURSIVE_ALWAYS:
return FILE_CONT;
-
+
case RECURSIVE_NO:
case RECURSIVE_NEVER:
return FILE_SKIP;
-
+
case RECURSIVE_ABORT:
-
+
default:
return FILE_ABORT;
}
@@ -883,19 +897,22 @@
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (alignment), hbox);
- gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_from_string)), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_from_string)),
+ FALSE, FALSE, 0);
ui->op_source_label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), ui->op_source_label, FALSE, FALSE, 0);
gtk_box_set_spacing (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD_SMALL);
- gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD);
+ gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox),
+ GNOME_PAD);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
alignment, FALSE, FALSE, 0);
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (alignment), hbox);
- gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_to_string)), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_to_string)),
+ FALSE, FALSE, 0);
ui->op_target_label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), ui->op_target_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
@@ -905,15 +922,18 @@
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (alignment), hbox);
- gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_deleting_string)), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_deleting_string)),
+ FALSE, FALSE, 0);
ui->op_source_label = gtk_label_new ("");
-
+
gtk_box_pack_start (GTK_BOX (hbox), ui->op_source_label, FALSE, FALSE, 0);
gtk_box_set_spacing (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD_SMALL);
- gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD);
+ gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox),
+ GNOME_PAD);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
alignment, FALSE, FALSE, 0);
- }
+ }
+
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("File ")), FALSE, FALSE, 0);
@@ -934,8 +954,9 @@
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
GTK_WIDGET (ui->byte_prog), FALSE, FALSE, 0);
- /*done with things */
+ /* done with things */
gtk_widget_show_all (GNOME_DIALOG (ui->op_win)->vbox);
+ gtk_window_set_modal (GTK_WINDOW (ui->op_win), TRUE);
gtk_widget_show_now (ui->op_win);
}
@@ -948,7 +969,7 @@
if (ctx->ui == NULL)
return;
-
+
ui = ctx->ui;
gtk_widget_destroy (ui->op_win);
diff -ruN old/mc-4.5.37/gnome/gdnd.c new/mc-4.5.38/gnome/gdnd.c
--- old/mc-4.5.37/gnome/gdnd.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gdnd.c Thu Sep 2 12:49:43 1999
@@ -28,7 +28,7 @@
/**
* gdnd_init:
- *
+ *
* Initializes the dnd_target_atoms array by interning the DnD target atom names.
**/
void
@@ -194,7 +194,7 @@
} else {
long count = 0;
double bytes = 0;
-
+
if (S_ISDIR (s.st_mode)) {
if (action == GDK_ACTION_COPY)
copy_dir_dir (ctx,
@@ -298,44 +298,66 @@
return retval;
}
+/* Returns whether a file has the drop-action metadata or MIME property defined
+ * for it.
+ */
+static int
+file_has_drop_action (char *filename)
+{
+ char *buf;
+ int size;
+ const char *mime_type;
+
+ if (gnome_metadata_get (filename, "drop-action", &size, &buf) == 0) {
+ g_free (buf);
+ return TRUE;
+ } else {
+ mime_type = gnome_mime_type_or_default (filename, NULL);
+ if (!mime_type)
+ return FALSE;
+
+ if (gnome_mime_get_value (mime_type, "drop-action") != NULL)
+ return TRUE;
+ else
+ return FALSE;
+ }
+}
+
/* Drop stuff on a non-directory file. This uses metadata and MIME as well. */
static int
drop_on_file (GdkDragContext *context, GtkSelectionData *selection_data,
- char *directory, file_entry *dest_fe)
+ char *dest_full_name, file_entry *dest_fe)
{
int size;
char *buf;
const char *mime_type;
- char *full_name;
int retval;
GList *names, *l;
int len, i;
char **drops;
-
retval = FALSE; /* assume we cannot drop */
- full_name = g_concat_dir_and_file (directory, dest_fe->fname);
/* Convert the data list into an array of strings */
-
+
names = gnome_uri_list_extract_uris (selection_data->data);
len = g_list_length (names);
drops = g_new (char *, len + 1);
-
+
for (l = names, i = 0; i < len; i++, l = l->next) {
char *text = l->data;
-
+
if (strncmp (text, "file:", 5) == 0)
text += 5;
-
+
drops[i] = text;
}
drops[i] = NULL;
/* 1. Try to use a metadata-based drop action */
- if (gnome_metadata_get (full_name, "drop-action", &size, &buf) == 0) {
- exec_extension (full_name, buf, drops, NULL, 0, 0);
+ if (gnome_metadata_get (dest_full_name, "drop-action", &size, &buf) == 0) {
+ exec_extension (dest_full_name, buf, drops, NULL, 0, 0);
g_free (buf);
retval = TRUE;
goto out;
@@ -343,13 +365,13 @@
/* 2. Try a drop action from the MIME-type */
- mime_type = gnome_mime_type_or_default (full_name, NULL);
+ mime_type = gnome_mime_type_or_default (dest_full_name, NULL);
if (mime_type) {
const char *action;
action = gnome_mime_get_value (mime_type, "drop-action");
if (action) {
- exec_extension (full_name, action, drops, NULL, 0, 0);
+ exec_extension (dest_full_name, action, drops, NULL, 0, 0);
retval = TRUE;
goto out;
}
@@ -357,13 +379,13 @@
/* 3. If executable, try metadata keys for "open" */
- if (is_exe (dest_fe->buf.st_mode) && if_link_is_exe (directory, dest_fe)) {
+ if (is_exe (dest_fe->buf.st_mode) && if_link_is_exe (dest_full_name, dest_fe)) {
/* FIXME: handle the case for Netscape URLs */
- if (gnome_metadata_get (full_name, "open", &size, &buf) == 0)
- exec_extension (full_name, buf, drops, NULL, 0, 0);
+ if (gnome_metadata_get (dest_full_name, "open", &size, &buf) == 0)
+ exec_extension (dest_full_name, buf, drops, NULL, 0, 0);
else
- exec_extension (full_name, "%f %q", drops, NULL, 0, 0);
+ exec_extension (dest_full_name, "%f %q", drops, NULL, 0, 0);
g_free (buf);
@@ -374,19 +396,29 @@
out:
g_free (drops);
gnome_uri_list_free_strings (names);
- g_free (full_name);
return retval;
}
+/**
+ * gdnd_perform_drop:
+ * @context: Drag context for operation.
+ * @selection_data: Selection data from drag_data_received.
+ * @dest_full_name: Complete name of the destination file or directory.
+ * @dest_fe: File entry for the destination file or directory.
+ *
+ * Performs a drop operation on a directory or file.
+ *
+ * Return value: TRUE if the drop is successful, FALSE otherwise.
+ **/
int
gdnd_perform_drop (GdkDragContext *context, GtkSelectionData *selection_data,
- char *directory, file_entry *dest_fe)
+ char *dest_full_name, file_entry *dest_fe)
{
GdkDragAction action;
g_return_val_if_fail (context != NULL, FALSE);
g_return_val_if_fail (selection_data != NULL, FALSE);
- g_return_val_if_fail (directory != NULL, FALSE);
+ g_return_val_if_fail (dest_full_name != NULL, FALSE);
g_return_val_if_fail (dest_fe != NULL, FALSE);
/* Get action */
@@ -399,18 +431,18 @@
action = context->action;
if (S_ISDIR (dest_fe->buf.st_mode) || dest_fe->f.link_to_dir)
- return drop_on_directory (context, selection_data, action, directory);
+ return drop_on_directory (context, selection_data, action, dest_full_name);
else
- return drop_on_file (context, selection_data, directory, dest_fe);
+ return drop_on_file (context, selection_data, dest_full_name, dest_fe);
}
/**
* gdnd_drag_context_has_target:
* @context: The context to query for a target type
* @type: The sought target type
- *
+ *
* Tests whether the specified drag context has a target of the specified type.
- *
+ *
* Return value: TRUE if the context has the specified target type, FALSE
* otherwise.
**/
@@ -432,10 +464,10 @@
* gdnd_find_panel_by_drag_context:
* @context: The context by which to find a panel.
* @source_widget: The source widget is returned here.
- *
+ *
* Looks in the list of panels for the one that corresponds to the specified
* drag context.
- *
+ *
* Return value: The sought panel, or NULL if no panel corresponds to the
* context.
**/
@@ -475,24 +507,25 @@
* @on_desktop: Whether we are dragging onto the desktop or a desktop icon.
* @same_process: Whether the drag comes from the same process or not.
* @same_source: If same_process, then whether the source and dest widgets are the same.
- * @dest: The destination file entry, or NULL if dropping on empty space.
+ * @dest_full_name: Complete name of the destination file or directory.
+ * @dest_fe: File entry for the destination file, or NULL if directory.
* @dest_selected: If dest is non-NULL, whether it is selected or not.
- *
+ *
* Computes the final drag action based on the suggested action of the specified
* context and conditions.
- *
+ *
* Return value: The computed action, meant to be passed to gdk_drag_action().
**/
GdkDragAction
gdnd_validate_action (GdkDragContext *context,
int on_desktop, int same_process, int same_source,
- char *directory, file_entry *dest_fe, int dest_selected)
+ char *dest_full_name, file_entry *dest_fe, int dest_selected)
{
int on_directory;
int on_exe;
g_return_val_if_fail (context != NULL, 0);
- g_return_val_if_fail (directory != NULL, 0);
+ g_return_val_if_fail (dest_full_name != NULL, 0);
/* If we are dragging a desktop icon onto the desktop or onto a selected
* desktop icon, unconditionally specify MOVE.
@@ -506,7 +539,7 @@
if (dest_fe) {
on_directory = S_ISDIR (dest_fe->buf.st_mode) || dest_fe->f.link_to_dir;
- on_exe = is_exe (dest_fe->buf.st_mode) && if_link_is_exe (directory, dest_fe);
+ on_exe = is_exe (dest_fe->buf.st_mode) && if_link_is_exe (dest_full_name, dest_fe);
}
if (gdnd_drag_context_has_target (context, TARGET_URI_LIST)) {
@@ -524,6 +557,9 @@
} else if (on_exe) {
if (context->actions & GDK_ACTION_COPY)
return GDK_ACTION_COPY;
+ } else if (file_has_drop_action (dest_full_name)) {
+ if (context->actions & GDK_ACTION_COPY)
+ return GDK_ACTION_COPY;
} else if (same_source)
return 0;
else if (same_process
@@ -560,4 +596,26 @@
}
return 0;
+}
+
+/**
+ * gdnd_can_drop_on_file:
+ * @full_name: Complete name of the file.
+ * @fe: File entry for the file.
+ *
+ * Computes whether a non-directory file can take drops.
+ *
+ * Return value: TRUE if the file can take drops, FALSE otherwise.
+ **/
+int
+gdnd_can_drop_on_file (char *full_name, file_entry *fe)
+{
+ g_return_val_if_fail (full_name != NULL, FALSE);
+ g_return_val_if_fail (fe != NULL, FALSE);
+
+ if ((is_exe (fe->buf.st_mode) && if_link_is_exe (full_name, fe))
+ || file_has_drop_action (full_name))
+ return TRUE;
+ else
+ return FALSE;
}
diff -ruN old/mc-4.5.37/gnome/gdnd.h new/mc-4.5.38/gnome/gdnd.h
--- old/mc-4.5.37/gnome/gdnd.h Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gdnd.h Thu Sep 2 12:49:44 1999
@@ -40,7 +40,7 @@
* Returns TRUE if an action was performed, FALSE otherwise (i.e. invalid drop).
*/
int gdnd_perform_drop (GdkDragContext *context, GtkSelectionData *selection_data,
- char *directory, file_entry *dest_fe);
+ char *dest_full_name, file_entry *dest_fe);
/* Test whether the specified context has a certain target type */
int gdnd_drag_context_has_target (GdkDragContext *context, TargetType type);
@@ -53,7 +53,10 @@
*/
GdkDragAction gdnd_validate_action (GdkDragContext *context,
int on_desktop, int same_process, int same_source,
- char *directory, file_entry *dest_fe, int dest_selected);
+ char *dest_full_name, file_entry *dest_fe, int dest_selected);
+
+/* Returns whether a non-directory file can take drops */
+int gdnd_can_drop_on_file (char *full_name, file_entry *fe);
#endif
diff -ruN old/mc-4.5.37/gnome/gicon.c new/mc-4.5.38/gnome/gicon.c
--- old/mc-4.5.37/gnome/gicon.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gicon.c Thu Sep 2 12:49:43 1999
@@ -117,6 +117,71 @@
}
}
+static void
+compute_scaled_size (int width, int height, int *nwidth, int *nheight)
+{
+ g_return_if_fail (nwidth != NULL);
+ g_return_if_fail (nheight != NULL);
+
+ if (width <= ICON_IMAGE_WIDTH && height <= ICON_IMAGE_HEIGHT) {
+ *nheight = height;
+ *nwidth = width;
+ } else if (width < height) {
+ *nheight = ICON_IMAGE_HEIGHT;
+ *nwidth = *nheight * width / height;
+ } else {
+ *nwidth = ICON_IMAGE_WIDTH;
+ *nheight = *nwidth * height / width;
+ }
+}
+
+/* Returns a newly allocated, correctly scaled image */
+static GdkImlibImage *
+get_scaled_image (GdkImlibImage *orig)
+{
+ GdkImlibImage *im;
+ int width, height;
+
+ g_return_val_if_fail (orig != NULL, NULL);
+
+ compute_scaled_size (orig->rgb_width, orig->rgb_height,
+ &width, &height);
+ im = gdk_imlib_clone_scaled_image (orig, width, height);
+
+ return im;
+}
+
+/* Returns the icon set corresponding to the specified image.
+ * If we create a new IconSet, iset->plain is set to a new scaled
+ * image, so _WE FREE THE IM PARAMETER_. */
+static IconSet *
+get_icon_set_from_image (GdkImlibImage *im)
+{
+ IconSet *iset;
+
+ g_return_val_if_fail (im != NULL, NULL);
+
+ iset = g_hash_table_lookup (image_hash, im);
+ if (iset)
+ return iset;
+
+ iset = g_new (IconSet, 1);
+ iset->plain = get_scaled_image (im);
+ iset->symlink = NULL;
+ iset->stalled = NULL;
+ iset->filename = NULL;
+
+
+ /* Insert the icon information into the hash tables */
+
+ g_hash_table_remove (image_hash, im);
+ g_hash_table_insert (image_hash, iset->plain, iset);
+
+ gdk_imlib_destroy_image (im);
+
+ return iset;
+}
+
/* Returns the icon set corresponding to the specified icon filename, or NULL if
* the file could not be loaded.
*/
@@ -125,7 +190,7 @@
{
GdkImlibImage *im;
IconSet *iset;
-
+
iset = g_hash_table_lookup (name_hash, filename);
if (iset)
return iset;
@@ -133,17 +198,16 @@
im = gdk_imlib_load_image ((char *) filename);
if (!im)
return NULL;
+
+ iset = get_icon_set_from_image (im);
+ im = NULL;
- iset = g_new (IconSet, 1);
- iset->plain = im;
- iset->symlink = NULL;
iset->filename = g_strdup (filename);
/* Insert the icon information into the hash tables */
g_hash_table_insert (name_hash, iset->filename, iset);
- g_hash_table_insert (image_hash, iset->plain, iset);
-
+
return iset;
}
@@ -234,29 +298,30 @@
{
int size;
char *buf;
- GdkImlibImage *im;
- IconSet *iset;
-
+ IconSet *iset = NULL;
+
/* Try the inlined icon */
if (gnome_metadata_get (filename, "icon-inline-png", &size, &buf) == 0) {
+ GdkImlibImage *im;
im = gdk_imlib_inlined_png_to_image (buf, size);
g_free (buf);
-
- if (im)
- return im;
+ if (im) {
+ iset = get_icon_set_from_image (im);
+ im = NULL;
+ }
}
/* Try the non-inlined icon */
- if (gnome_metadata_get (filename, "icon-filename", &size, &buf) == 0) {
+ if (!iset && gnome_metadata_get (filename, "icon-filename", &size, &buf) == 0) {
iset = get_icon_set (buf);
g_free (buf);
-
- if (iset) {
- ensure_icon_image (iset, ICON_TYPE_PLAIN);
- return iset->plain;
- }
+ }
+
+ if (iset) {
+ ensure_icon_image (iset, ICON_TYPE_PLAIN);
+ return iset->plain;
}
return NULL; /* nothing is available */
@@ -355,6 +420,7 @@
IconSet *iset;
mode_t mode;
const char *mime_type;
+ gboolean is_user_set = FALSE;
g_return_val_if_fail (directory != NULL, NULL);
g_return_val_if_fail (fe != NULL, NULL);
@@ -372,13 +438,31 @@
full_name = g_concat_dir_and_file (directory, fe->fname);
im = get_icon_from_metadata (full_name);
g_free (full_name);
-
- if (im)
- return im;
+
+ if (im) {
+ iset = get_icon_set_from_image (im);
+ im = NULL;
+ is_user_set = TRUE;
+ goto add_link;
+ }
}
+
+ /* 2. Before we do anything else, make sure the
+ * pointed-to file exists if a link */
+
+ if (S_ISLNK (mode) && fe->f.stalled_link) {
+ const char *icon_name;
- /* 2. See if it is a directory */
+ icon_name = gnome_unconditional_pixmap_file ("gnome-warning.png");
+ if (icon_name) {
+ iset = get_icon_set (icon_name);
+ if (iset)
+ goto add_link;
+ }
+ }
+ /* 3. See if it is a directory */
+
if (S_ISDIR (mode)) {
if (can_access_directory (fe))
iset = iset_directory;
@@ -388,7 +472,7 @@
goto add_link;
}
- /* 3. Try MIME-types */
+ /* 4. Try MIME-types */
mime_type = gnome_mime_type_or_default (fe->fname, NULL);
if (mime_type) {
@@ -402,7 +486,7 @@
}
}
- /* 4. Get an icon from the file mode */
+ /* 5. Get an icon from the file mode */
iset = get_default_icon (fe);
@@ -411,7 +495,7 @@
g_assert (iset != NULL);
if (S_ISLNK (mode)) {
- if (fe->f.link_to_dir)
+ if (fe->f.link_to_dir && !is_user_set)
iset = iset_directory;
if (fe->f.stalled_link) {
diff -ruN old/mc-4.5.37/gnome/gicon.h new/mc-4.5.38/gnome/gicon.h
--- old/mc-4.5.37/gnome/gicon.h Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gicon.h Thu Sep 2 12:49:44 1999
@@ -13,6 +13,9 @@
#include
#include "dir.h"
+/* Standard icon sizes */
+#define ICON_IMAGE_WIDTH 48
+#define ICON_IMAGE_HEIGHT 48
void gicon_init (void);
diff -ruN old/mc-4.5.37/gnome/gimp.image.desktop new/mc-4.5.38/gnome/gimp.image.desktop
--- old/mc-4.5.37/gnome/gimp.image.desktop Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gimp.image.desktop Thu Sep 2 12:49:44 1999
@@ -3,6 +3,7 @@
Name[ca]=Imatge
Name[de]=Grafik
Name[es]=Imagen
+Name[fi]=Kuva
Name[fr]=Image
Name[no]=Bilde
Name[wa]=Im嶟je
@@ -10,6 +11,7 @@
Comment[ca]=Crea una nova imatge
Comment[de]=Eine neue Grafik erzeugen
Comment[es]=Crear una imagen
+Comment[fi]=Luo uusi kuva
Comment[fr]=Cr嶪r une image
Comment[no]=Lag et nytt bilde
Comment[wa]=F ene novele im嶟je
diff -ruN old/mc-4.5.37/gnome/glayout.c new/mc-4.5.38/gnome/glayout.c
--- old/mc-4.5.37/gnome/glayout.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/glayout.c Thu Sep 2 12:49:43 1999
@@ -395,13 +395,17 @@
{ GNOME_APP_UI_ITEM, N_("Select _All"), N_("Select all files in the current Panel"), gnome_select_all_cmd,
NULL, NULL, 0, NULL, 'a', GDK_CONTROL_MASK },
GNOMEUIINFO_ITEM_NONE(N_("_Select Files..."), N_("Select a group of files"), gnome_select),
- GNOMEUIINFO_ITEM_NONE(N_("_Invert Selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd),
+ GNOMEUIINFO_ITEM_NONE(N_("_Invert Selection"), N_("Reverses the list of tagged files"),
+ gnome_reverse_selection_cmd_panel),
GNOMEUIINFO_SEPARATOR,
{ GNOME_APP_UI_ITEM, N_("Search"), N_("Search for a file in the current Panel"), gnome_start_search,
NULL, NULL, 0, NULL, 's', GDK_CONTROL_MASK },
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_NONE(N_("_Rescan Directory"), N_("Rescan the directory contents"), reread_cmd),
- GNOMEUIINFO_SEPARATOR,
+ GNOMEUIINFO_END
+};
+
+GnomeUIInfo gnome_panel_settings_menu [] = {
GNOMEUIINFO_MENU_PREFERENCES_ITEM(gnome_configure_box, NULL),
GNOMEUIINFO_END
};
@@ -442,22 +446,23 @@
GnomeUIInfo gnome_panel_about_menu [] = {
- GNOMEUIINFO_HELP ("gmc"),
GNOMEUIINFO_MENU_ABOUT_ITEM(gnome_about_cmd, NULL),
+ GNOMEUIINFO_HELP ("gmc"),
GNOMEUIINFO_END
};
GnomeUIInfo gnome_panel_desktop_menu [] = {
- GNOMEUIINFO_ITEM_NONE (N_("Arrange Icons"), NULL, desktop_arrange_icons),
+ GNOMEUIINFO_SUBTREE(N_("_Arrange Icons"), desktop_arrange_icons_items),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_ITEM_NONE (N_("Rescan System Devices"), NULL, desktop_rescan_devices),
- GNOMEUIINFO_ITEM_NONE (N_("Rescan Desktop"), NULL, do_desktop_rescan_devices),
+ GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop _Shortcuts"), NULL, desktop_rescan_devices),
+ GNOMEUIINFO_ITEM_NONE (N_("Rescan _Desktop"), NULL, do_desktop_rescan_devices),
GNOMEUIINFO_END
};
GnomeUIInfo gnome_panel_menu_with_desktop [] = {
GNOMEUIINFO_MENU_FILE_TREE(gnome_panel_file_menu),
GNOMEUIINFO_MENU_EDIT_TREE(gnome_panel_edit_menu),
+ GNOMEUIINFO_SUBTREE(N_("_Settings"),gnome_panel_settings_menu),
GNOMEUIINFO_SUBTREE(N_("_Layout"),gnome_panel_layout_menu),
GNOMEUIINFO_SUBTREE(N_("_Commands"),gnome_panel_commands_menu),
GNOMEUIINFO_SUBTREE(N_("_Desktop"), gnome_panel_desktop_menu),
@@ -468,6 +473,7 @@
GnomeUIInfo gnome_panel_menu_without_desktop [] = {
GNOMEUIINFO_MENU_FILE_TREE(gnome_panel_file_menu),
GNOMEUIINFO_MENU_EDIT_TREE(gnome_panel_edit_menu),
+ GNOMEUIINFO_SUBTREE(N_("_Settings"),gnome_panel_settings_menu),
GNOMEUIINFO_SUBTREE(N_("_Layout"),gnome_panel_layout_menu),
GNOMEUIINFO_SUBTREE(N_("_Commands"),gnome_panel_commands_menu),
GNOMEUIINFO_SUBTREE(N_("_Help"), gnome_panel_about_menu),
diff -ruN old/mc-4.5.37/gnome/gmain.c new/mc-4.5.38/gnome/gmain.c
--- old/mc-4.5.37/gnome/gmain.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gmain.c Thu Sep 2 12:49:43 1999
@@ -37,13 +37,13 @@
char *default_edition_colors =
"normal=black:"
"selected=white,darkblue:"
-"viewunderline=brightred,blue:"
+"viewunderline=red,blue:"
"directory=blue:"
"markselect=yellow,darkblue:"
"marked=yellow,seagreen:"
"execute=slateblue:"
"link=green:"
-"stalledlink=brightred:"
+"stalledlink=red:"
"device=magenta:"
"core=red:"
"menuhotsel=cyan,black:"
@@ -86,14 +86,21 @@
get_color (char *cpp, GdkColor **colp)
{
GdkColor *new_color;
- gint status;
+ int result;
+ gint status;
new_color = g_new (GdkColor, 1);
- gdk_color_parse (cpp, new_color);
+ result = gdk_color_parse (cpp, new_color);
new_color->pixel = 0;
- status = 0;
- gdk_color_context_get_pixels (mc_cc, &new_color->red, &new_color->green, &new_color->blue, 1,
- &new_color->pixel, &status);
+
+ if (result) {
+ status = 0;
+ gdk_color_context_get_pixels (mc_cc,
+ &new_color->red, &new_color->green, &new_color->blue,
+ 1, &new_color->pixel, &status);
+ } else
+ new_color->red = new_color->green = new_color->blue = 0;
+
*colp = new_color;
}
diff -ruN old/mc-4.5.37/gnome/gmain.h new/mc-4.5.38/gnome/gmain.h
--- old/mc-4.5.37/gnome/gmain.h Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gmain.h Thu Sep 2 12:49:44 1999
@@ -47,6 +47,7 @@
void x_create_info (Dlg_head *h, widget_data parent, WInfo *info);
void gnome_check_super_user (void);
gint create_new_menu_from (char *file, GtkWidget *shell, gint pos);
+int rename_file_with_context (char *source, char *dest);
/*
* stuff from gaction.c
diff -ruN old/mc-4.5.37/gnome/gmc-window.c new/mc-4.5.38/gnome/gmc-window.c
--- old/mc-4.5.37/gnome/gmc-window.c Wed Dec 31 19:00:00 1969
+++ new/mc-4.5.38/gnome/gmc-window.c Thu Sep 2 12:49:44 1999
@@ -0,0 +1,220 @@
+/* Toplevel file window for the Midnight Commander
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena
+ */
+
+/* #include */
+#include
+#include "gdesktop.h"
+#include "gmc-window.h"
+
+
+/* Magic numbers */
+
+#define ICON_LIST_SEPARATORS " /-_."
+#define ICON_LIST_ROW_SPACING 2
+#define ICON_LIST_COL_SPACING 2
+#define ICON_LIST_ICON_BORDER 2
+#define ICON_LIST_TEXT_SPACING 2
+
+
+static void gmc_window_init (GmcWindow *gmc);
+
+
+/**
+ * gmc_window_get_type:
+ *
+ * Returns the unique Gtk type assigned to the GmcWindow widget.
+ *
+ * Return Value: the type ID of the GmcWindow widget.
+ **/
+GtkType
+gmc_window_get_type (void)
+{
+ static GtkType gmc_window_type = 0;
+
+ if (!gmc_window_type) {
+ GtkTypeInfo gmc_window_info = {
+ "GmcWindow",
+ sizeof (GmcWindow),
+ sizeof (GmcWindowClass),
+ (GtkClassInitFunc) NULL,
+ (GtkObjectInitFunc) gmc_window_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ gmc_window_type = gtk_type_unique (gnome_app_get_type (), &gmc_window_info);
+ }
+
+ return gmc_window_type;
+}
+
+/* Displays GMC's About dialog */
+static void
+about_dialog (GtkWidget *widget, gpointer data)
+{
+ GtkWidget *about;
+ const gchar *authors[] = {
+ "The Midnight Commander Team",
+ "http://www.gnome.org/mc",
+ "Bug reports: mc-bugs@nuclecu.unam.mx",
+ NULL
+ };
+
+ about = gnome_about_new (_("GNU Midnight Commander"), VERSION,
+ _("Copyright (C) 1998 The Free Software Foundation"),
+ authors,
+ _("The GNOME edition of the Midnight Commander file manager."),
+ NULL);
+ gtk_window_set_modal(GTK_WINDOW(about),TRUE);
+ gnome_dialog_run (GNOME_DIALOG (about));
+}
+
+/* FIXME: put in the callbacks */
+
+/* File menu */
+static GnomeUIInfo file_menu[] = {
+ { GNOME_APP_UI_ITEM, N_("Open _new window"), NULL, NULL, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL, 'n', GDK_CONTROL_MASK, NULL },
+
+ GNOMEUIINFO_SEPARATOR,
+
+ { GNOME_APP_UI_ITEM, N_("_Close this window"), NULL, NULL, NULL, NULL,
+ GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE, 'w', GDK_CONTROL_MASK, NULL },
+ { GNOME_APP_UI_ITEM, N_("E_xit"), NULL, NULL, NULL, NULL,
+ GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, 'q', GDK_CONTROL_MASK, NULL },
+ GNOMEUIINFO_END
+};
+
+/* View types radioitem list */
+static GnomeUIInfo view_list_types_radioitems[] = {
+ GNOMEUIINFO_ITEM_NONE (N_("_Listing view"), NULL, NULL),
+ GNOMEUIINFO_ITEM_NONE (N_("_Icon view"), NULL, NULL),
+ GNOMEUIINFO_END
+};
+
+/* View menu */
+static GnomeUIInfo view_menu[] = {
+ GNOMEUIINFO_TOGGLEITEM (N_("Display _tree view"), NULL, NULL, NULL),
+
+ GNOMEUIINFO_SEPARATOR,
+
+ GNOMEUIINFO_RADIOLIST (view_list_types_radioitems),
+ GNOMEUIINFO_END
+};
+
+/* Help menu */
+static GnomeUIInfo help_menu[] = {
+ { GNOME_APP_UI_ITEM, N_("_About the Midnight Commander..."), NULL, about_dialog, NULL, NULL,
+ GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT, 0, 0, NULL },
+ GNOMEUIINFO_END
+};
+
+/* Main menu */
+static GnomeUIInfo main_menu[] = {
+ GNOMEUIINFO_SUBTREE (N_("_File"), file_menu),
+ GNOMEUIINFO_SUBTREE (N_("_View"), view_menu),
+ GNOMEUIINFO_SUBTREE (N_("_Help"), help_menu),
+ GNOMEUIINFO_END
+};
+
+/* Sets up the menu bar for a gmc window */
+static void
+setup_menus (GmcWindow *gmc)
+{
+ gnome_app_create_menus_with_data (GNOME_APP (gmc), main_menu, gmc);
+}
+
+/* Sets up the toolbar for a gmc window */
+static void
+setup_toolbar (GmcWindow *gmc)
+{
+ /* FIXME */
+}
+
+/* Sets up the contents for a gmc window */
+static void
+setup_contents (GmcWindow *gmc)
+{
+ /* Paned container */
+
+ gmc->paned = gtk_hpaned_new ();
+ gnome_app_set_contents (GNOME_APP (gmc), gmc->paned);
+ gtk_widget_show (gmc->paned);
+
+ /* Tree view */
+
+ gmc->tree = gtk_button_new_with_label ("Look at me!\nI am a nice tree!");
+ gtk_paned_add1 (GTK_PANED (gmc->paned), gmc->tree);
+ gtk_widget_show (gmc->tree);
+
+ /* Notebook */
+
+ gmc->notebook = gtk_notebook_new ();
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (gmc->notebook), FALSE);
+ gtk_notebook_set_show_border (GTK_NOTEBOOK (gmc->notebook), FALSE);
+ gtk_paned_add2 (GTK_PANED (gmc->paned), gmc->notebook);
+ gtk_widget_show (gmc->notebook);
+
+ /* List view */
+
+ gmc->clist_sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gmc->clist_sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_notebook_append_page (GTK_NOTEBOOK (gmc->notebook), gmc->clist_sw, NULL);
+ gtk_widget_show (gmc->clist_sw);
+
+ gmc->clist = gtk_clist_new (1); /* FIXME: how many columns? */
+ gtk_container_add (GTK_CONTAINER (gmc->clist_sw), gmc->clist);
+ gtk_widget_show (gmc->clist);
+
+ /* Icon view */
+
+ gmc->ilist_sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gmc->ilist_sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_notebook_append_page (GTK_NOTEBOOK (gmc->notebook), gmc->ilist_sw, NULL);
+ gtk_widget_show (gmc->ilist_sw);
+
+ gmc->ilist = gnome_icon_list_new (DESKTOP_SNAP_X, NULL, TRUE);
+ gnome_icon_list_set_separators (GNOME_ICON_LIST (gmc->ilist), ICON_LIST_SEPARATORS);
+ gnome_icon_list_set_row_spacing (GNOME_ICON_LIST (gmc->ilist), ICON_LIST_ROW_SPACING);
+ gnome_icon_list_set_col_spacing (GNOME_ICON_LIST (gmc->ilist), ICON_LIST_COL_SPACING);
+ gnome_icon_list_set_icon_border (GNOME_ICON_LIST (gmc->ilist), ICON_LIST_ICON_BORDER);
+ gnome_icon_list_set_text_spacing (GNOME_ICON_LIST (gmc->ilist), ICON_LIST_TEXT_SPACING);
+ gnome_icon_list_set_selection_mode (GNOME_ICON_LIST (gmc->ilist), GTK_SELECTION_MULTIPLE);
+ GTK_WIDGET_SET_FLAGS (gmc->ilist, GTK_CAN_FOCUS);
+
+ gtk_container_add (GTK_CONTAINER (gmc->ilist_sw), gmc->ilist);
+ gtk_widget_show (gmc->ilist);
+
+ gtk_notebook_set_page (GTK_NOTEBOOK (gmc->notebook), gmc->list_type);
+
+ /* FIXME: connect the clist/ilist signals, setup DnD, etc. */
+}
+
+/* Initializes the gmc window by creating all its contents */
+static void
+gmc_window_init (GmcWindow *gmc)
+{
+ gmc->list_type = FILE_LIST_ICONS; /* FIXME: load this from the configuration */
+
+ setup_menus (gmc);
+ setup_toolbar (gmc);
+ setup_contents (gmc);
+}
+
+/**
+ * gmc_window_new:
+ *
+ * Creates a new GMC toplevel file window.
+ *
+ * Return Value: the newly-created window.
+ **/
+GtkWidget *
+gmc_window_new (void)
+{
+ return gtk_type_new (gmc_window_get_type ());
+}
diff -ruN old/mc-4.5.37/gnome/gmc-window.h new/mc-4.5.38/gnome/gmc-window.h
--- old/mc-4.5.37/gnome/gmc-window.h Wed Dec 31 19:00:00 1969
+++ new/mc-4.5.38/gnome/gmc-window.h Thu Sep 2 12:49:44 1999
@@ -0,0 +1,55 @@
+/* Toplevel file window for the Midnight Commander
+ *
+ * Copyright (C) 1998 The Free Software Foundation
+ *
+ * Author: Federico Mena
+ */
+
+#ifndef GMC_WINDOW_H
+#define GMC_WINDOW_H
+
+#include
+#include
+
+BEGIN_GNOME_DECLS
+
+
+/* File listing modes */
+typedef enum {
+ FILE_LIST_LIST,
+ FILE_LIST_ICONS
+} FileListType;
+
+
+typedef struct _GmcWindow GmcWindow;
+typedef struct _GmcWindowClass GmcWindowClass;
+
+struct _GmcWindow {
+ GnomeApp app;
+
+ GtkWidget *paned; /* Paned container to split into tree/list views */
+ GtkWidget *tree; /* Tree view */
+ GtkWidget *notebook; /* Notebook to switch between list and icon views */
+ GtkWidget *clist_sw; /* Scrolled window for the clist */
+ GtkWidget *clist; /* List view (column list) */
+ GtkWidget *ilist_sw; /* Scrolled window for the icon list */
+ GtkWidget *ilist; /* Icon view (icon list) */
+
+ FileListType list_type; /* Current file listing type */
+};
+
+struct _GmcWindowClass {
+ GnomeAppClass parent_class;
+};
+
+
+/* Standard Gtk function */
+GtkType gmc_window_get_type (void);
+
+/* Creates a new GMC window */
+GtkWidget *gmc_window_new (void);
+
+
+END_GNOME_DECLS
+
+#endif
diff -ruN old/mc-4.5.37/gnome/gmount.c new/mc-4.5.38/gnome/gmount.c
--- old/mc-4.5.37/gnome/gmount.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gmount.c Thu Sep 2 12:49:44 1999
@@ -214,7 +214,10 @@
list = g_list_prepend (list, dit);
}
}
+
endmntent (f);
+
+ list = g_list_reverse (list);
return list;
}
diff -ruN old/mc-4.5.37/gnome/gnome-file-property-dialog.c new/mc-4.5.38/gnome/gnome-file-property-dialog.c
--- old/mc-4.5.37/gnome/gnome-file-property-dialog.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gnome-file-property-dialog.c Thu Sep 2 12:49:44 1999
@@ -130,7 +130,7 @@
if (gfpd->mode_name)
g_free (gfpd->mode_name);
-
+
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -257,9 +257,9 @@
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
}
-
+
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 8);
-
+
/* Time Fields */
table = gtk_table_new (3, 2, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
@@ -313,7 +313,7 @@
fp_dlg->caption_entry = gtk_entry_new ();
gtk_table_attach (GTK_TABLE (table), fp_dlg->caption_entry,
2, 3, 2, 3, GTK_FILL | GTK_EXPAND, 0, GNOME_PAD, GNOME_PAD);
-
+
gtk_widget_show_all (table);
return table;
}
@@ -327,13 +327,13 @@
if (cbox == fp_dlg->open_cbox) {
if (GTK_TOGGLE_BUTTON (cbox)->active) {
gtk_widget_set_sensitive (fp_dlg->open_entry, FALSE);
- if (fp_dlg->mime_fm_open)
+ if (fp_dlg->mime_fm_open)
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), fp_dlg->mime_fm_open);
} else {
gtk_widget_set_sensitive (fp_dlg->open_entry, TRUE);
if (fp_dlg->fm_open) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), fp_dlg->fm_open);
- }
+ }
}
} else if (cbox == fp_dlg->prop1_cbox) {
if (GTK_TOGGLE_BUTTON (cbox)->active) {
@@ -351,7 +351,7 @@
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->drop_target);
} else if (!fp_dlg->executable && fp_dlg->fm_view) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_view);
- }
+ }
}
} else {
if (GTK_TOGGLE_BUTTON (cbox)->active) {
@@ -435,7 +435,7 @@
{
GtkWidget *retval;
gchar *icon;
-
+
retval = gnome_icon_entry_new ("gmc_file_icon", _("Select an Icon"));
icon = g_strdup (gicon_get_filename_for_icon (fp_dlg->im));
@@ -480,7 +480,7 @@
gtk_signal_connect (GTK_OBJECT (fp_dlg->open_cbox), "toggled", metadata_toggled, fp_dlg);
gtk_table_attach_defaults (GTK_TABLE (table), fp_dlg->open_cbox, 0, 2, 1, 2);
-
+
vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, GNOME_PAD_SMALL);
gtk_table_attach_defaults (GTK_TABLE (table), vbox, 0, 2, 2, 3);
@@ -514,7 +514,7 @@
gtk_misc_set_alignment (GTK_MISC (fp_dlg->prop2_label), 0.0, 0.5);
gtk_misc_set_padding (GTK_MISC (fp_dlg->prop2_label), 2, 0);
gtk_table_attach_defaults (GTK_TABLE (table),
- fp_dlg->prop2_label,
+ fp_dlg->prop2_label,
0, 1, 6, 7);
fp_dlg->prop2_entry = gtk_entry_new ();
gtk_table_attach_defaults (GTK_TABLE (table),
@@ -568,7 +568,7 @@
GtkWidget *table;
struct stat linkstat;
int finish;
-
+
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD);
@@ -618,7 +618,7 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fp_dlg->needs_terminal_check),
fp_dlg->needs_terminal);
gtk_container_add (GTK_CONTAINER (frame), fp_dlg->needs_terminal_check);
-
+
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
return vbox;
}
@@ -648,21 +648,21 @@
SETBIT (fp_dlg->suid, S_ISUID);
SETBIT (fp_dlg->sgid, S_ISGID);
SETBIT (fp_dlg->svtx, S_ISVTX);
-
+
SETBIT (fp_dlg->rusr, S_IRUSR);
SETBIT (fp_dlg->wusr, S_IWUSR);
SETBIT (fp_dlg->xusr, S_IXUSR);
-
+
SETBIT (fp_dlg->rgrp, S_IRGRP);
SETBIT (fp_dlg->wgrp, S_IWGRP);
SETBIT (fp_dlg->xgrp, S_IXGRP);
-
+
SETBIT (fp_dlg->roth, S_IROTH);
SETBIT (fp_dlg->woth, S_IWOTH);
SETBIT (fp_dlg->xoth, S_IXOTH);
return umode;
-
+
#undef SETBIT
}
@@ -703,7 +703,7 @@
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (check), FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), state ? TRUE : FALSE);
-
+
gtk_signal_connect (GTK_OBJECT (check), "toggled",
(GtkSignalFunc) perm_set_mode_label,
fp_dlg);
@@ -729,7 +729,7 @@
ATTACH (table, w, 2, 3, y, y + 1); \
ATTACH (table, x, 3, 4, y, y + 1); \
} while (0);
-
+
static GtkWidget *
perm_mode_new (GnomeFilePropertyDialog *fp_dlg)
{
@@ -781,7 +781,7 @@
fp_dlg->suid = perm_check_new (_("Set UID"), fp_dlg->st.st_mode & S_ISUID, fp_dlg);
fp_dlg->sgid = perm_check_new (_("Set GID"), fp_dlg->st.st_mode & S_ISGID, fp_dlg);
fp_dlg->svtx = perm_check_new (_("Sticky"), fp_dlg->st.st_mode & S_ISVTX, fp_dlg);
-
+
ATTACH (table, fp_dlg->suid, 4, 5, 1, 2);
ATTACH (table, fp_dlg->sgid, 4, 5, 2, 3);
ATTACH (table, fp_dlg->svtx, 4, 5, 3, 4);
@@ -809,8 +809,12 @@
if (passwd) {
fp_dlg->user_name = passwd->pw_name;
gtk_entry_set_text (GTK_ENTRY (gentry), passwd->pw_name);
- } else
- gtk_entry_set_text (GTK_ENTRY (gentry), "");
+ } else {
+ char buf[100];
+
+ g_snprintf (buf, sizeof (buf), _(" (%d)"), (int) fp_dlg->st.st_uid);
+ gtk_entry_set_text (GTK_ENTRY (gentry), buf);
+ }
return gentry;
}
@@ -820,13 +824,11 @@
{
GtkWidget *gentry;
struct group *grp;
- gchar grpnum [50];
gboolean grp_flag = FALSE;
gchar *grpname = NULL;
GList *templist;
GList *list = NULL;
-
/* Are we root? Do we own the file? */
/* In this case we can change it. */
/* A little bit of this was swiped from kfm. */
@@ -838,28 +840,22 @@
if (grp->gr_name)
fp_dlg->group_name = g_strdup (grp->gr_name);
else {
- sprintf (grpnum, "%d", (int) grp->gr_gid);
- fp_dlg->group_name = g_strdup (grpnum);
+ fp_dlg->group_name = g_strdup_printf ("%d", (int) grp->gr_gid);
}
} else {
- sprintf (grpnum, "%d", (int) fp_dlg->st.st_gid);
- fp_dlg->group_name = g_strdup (grpnum);
+ fp_dlg->group_name = g_strdup_printf ("%d", (int) fp_dlg->st.st_gid);
}
/* we change this, b/c we are able to set the egid, if we aren't in the group already */
grp = getgrgid (getegid());
if (grp) {
if (grp->gr_name)
- grpname = grp->gr_name;
- else {
- sprintf (grpnum, "%d", (int) grp->gr_gid);
- grpname = grpnum;
- }
- } else {
- sprintf (grpnum, "%d", (int) fp_dlg->st.st_gid);
- grpname = grpnum;
- }
-
+ grpname = g_strdup (grp->gr_name);
+ else
+ grpname = g_strdup_printf ("%d", (int) grp->gr_gid);
+ } else
+ grpname = g_strdup_printf ("%d", (int) fp_dlg->st.st_gid);
+
if (fp_dlg->euid != 0)
gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (gentry)->entry), FALSE);
for (setgrent (); (grp = getgrent ()) != NULL;) {
@@ -883,7 +879,7 @@
}
}
endgrent ();
-
+
/* we also might want to add the egid to the list. */
if (!grp_flag)
list = g_list_insert_sorted (list, g_strdup (grpname), (GCompareFunc)strcmp);
@@ -893,15 +889,24 @@
for (templist = list; templist; templist = templist->next) {
g_free (templist->data);
}
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gentry)->entry), grpname);
+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (gentry)->entry), fp_dlg->group_name);
g_list_free (list);
} else {
/* we're neither so we just put an entry down */
gentry = gtk_entry_new ();
gtk_widget_set_sensitive (gentry, FALSE);
+
grp = getgrgid (fp_dlg->st.st_gid);
- gtk_entry_set_text (GTK_ENTRY (gentry), grp->gr_name);
+ if (grp)
+ gtk_entry_set_text (GTK_ENTRY (gentry), grp->gr_name);
+ else {
+ char buf[100];
+
+ g_snprintf (buf, sizeof (buf), _(" (%d)"), fp_dlg->st.st_gid);
+ gtk_entry_set_text (GTK_ENTRY (gentry), buf);
+ }
}
+ g_free (grpname);
return gentry;
}
@@ -962,7 +967,7 @@
gtk_box_pack_start (GTK_BOX (vbox), perm_mode_new (fp_dlg), FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), perm_ownership_new (fp_dlg), TRUE, TRUE, 0);
return vbox;
-}
+}
/* finally the new dialog */
static void
@@ -988,8 +993,8 @@
fp_dlg->needs_terminal = strstr (str, "needsterminal") != 0;
g_free (str);
} else
- fp_dlg->needs_terminal = 0;
-
+ fp_dlg->needs_terminal = 0;
+
/* Mime stuff */
file_name = fp_dlg->file_name;
if (S_ISLNK (fp_dlg->st.st_mode)) {
@@ -999,7 +1004,7 @@
file_name = link_name;
}
}
-
+
if (gnome_metadata_get (fp_dlg->file_name, "desktop-url", &size, &desktop_url) == 0)
fp_dlg->desktop_url = desktop_url;
else
@@ -1007,7 +1012,7 @@
if (gnome_metadata_get (fp_dlg->file_name, "icon-caption", &size, &fp_dlg->caption))
fp_dlg->caption = g_strdup (desktop_url);
-
+
/*
* Mime type.
*/
@@ -1032,7 +1037,7 @@
GtkWidget *new_page;
gchar *title_string;
mode_t mode;
-
+
g_return_val_if_fail (file_name != NULL, NULL);
fp_dlg = gtk_type_new (gnome_file_property_dialog_get_type ());
@@ -1050,7 +1055,7 @@
if (mc_stat (file_name, &s) != -1)
mode = s.st_mode;
}
-
+
if (fp_dlg->st.st_mode & (S_IXUSR | S_IXGRP |S_IXOTH)) {
fp_dlg->executable = TRUE;
} else {
@@ -1075,7 +1080,7 @@
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
create_general_properties (fp_dlg),
gtk_label_new (_("Statistics")));
-
+
new_page = create_settings_pane (fp_dlg);
if (new_page)
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
@@ -1089,10 +1094,10 @@
title_string = g_strconcat (strrchr (file_name, '/') + 1, _(" Properties"), NULL);
gtk_window_set_title (GTK_WINDOW (fp_dlg), title_string);
g_free (title_string);
-
- gnome_dialog_append_button ( GNOME_DIALOG(fp_dlg),
+
+ gnome_dialog_append_button ( GNOME_DIALOG(fp_dlg),
GNOME_STOCK_BUTTON_OK);
- gnome_dialog_append_button ( GNOME_DIALOG(fp_dlg),
+ gnome_dialog_append_button ( GNOME_DIALOG(fp_dlg),
GNOME_STOCK_BUTTON_CANCEL);
gtk_widget_show_all (GNOME_DIALOG (fp_dlg)->vbox);
@@ -1127,7 +1132,7 @@
uid = fpd->st.st_uid;
gid = fpd->st.st_gid;
-
+
/* we only check if our euid == 0 */
if (fpd->euid == 0) {
new_user_name = gtk_entry_get_text (GTK_ENTRY (fpd->owner_entry));
@@ -1151,7 +1156,7 @@
* sensitive. */
if (GTK_WIDGET_IS_SENSITIVE (fpd->group_entry))
new_group_name = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (fpd->group_entry)->entry));
-
+
if (fpd->group_name && new_group_name && strcmp (fpd->group_name, new_group_name)) {
g = getgrnam (new_group_name);
if (!g) {
@@ -1193,15 +1198,15 @@
} else {
char *p;
int s;
-
+
/* create the files. */
base_name = g_strdup (fpd->file_name);
-
+
p = strrchr (base_name, '/');
if (p)
*p = '\0';
-
+
full_target = concat_dir_and_file (base_name, new_name);
ctx = file_op_context_new ();
@@ -1226,7 +1231,7 @@
/* If we don't have an open_cbox, that means we have no metadata
* to set.
- */
+ */
if (fpd->open_cbox != NULL) {
if (!GTK_TOGGLE_BUTTON (fpd->open_cbox)->active) {
text = gtk_entry_get_text (GTK_ENTRY (fpd->open_entry));
@@ -1318,7 +1323,7 @@
if (gnome_metadata_get (fpd->file_name, "flags", &size, &buf) == 0){
char *p;
-
+
p = strstr (buf, "needsterminal");
if (toggled){
if (!p){
@@ -1347,23 +1352,23 @@
strlen (p2)+1, p2);
g_free (p2);
g_free (p1);
-
+
}
}
} else {
if (toggled){
gnome_metadata_set (fpd->file_name, "flags",
sizeof ("needsterminal"), "needsterminal");
- }
+ }
}
}
-
+
if (!fpd->can_set_icon)
return 1;
/* And finally, we set the metadata on the icon filename */
text = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (fpd->button));
/*gtk_entry_get_text (GTK_ENTRY (gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (fpd->button))));*/
-
+
if (text) {
if (fpd->icon_filename == NULL || strcmp (fpd->icon_filename, text) != 0)
gnome_metadata_set (fpd->file_name, "icon-filename", strlen (text) + 1, text);
@@ -1382,7 +1387,7 @@
gnome_file_property_dialog_make_changes (GnomeFilePropertyDialog *file_property_dialog)
{
gint retval = 0;
-
+
g_return_val_if_fail (file_property_dialog != NULL, 1);
g_return_val_if_fail (GNOME_IS_FILE_PROPERTY_DIALOG (file_property_dialog), 1);
diff -ruN old/mc-4.5.37/gnome/gpopup2.c new/mc-4.5.38/gnome/gpopup2.c
--- old/mc-4.5.37/gnome/gpopup2.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gpopup2.c Thu Sep 2 12:49:44 1999
@@ -612,12 +612,14 @@
handle_mount (GtkWidget *widget, WPanel *panel)
{
perform_mount_unmount (panel, TRUE);
+ update_panels (UP_RELOAD, UP_KEEPSEL);
}
static void
handle_unmount (GtkWidget *widget, WPanel *panel)
{
perform_mount_unmount (panel, FALSE);
+ update_panels (UP_RELOAD, UP_KEEPSEL);
}
static void
@@ -646,8 +648,9 @@
do_mount_umount (full_name, FALSE);
do_eject (lname);
-
+
desktop_icon_set_busy (dii, FALSE);
+ update_panels (UP_RELOAD, UP_KEEPSEL);
g_free (lname);
g_free (full_name);
}
diff -ruN old/mc-4.5.37/gnome/gprefs.c new/mc-4.5.38/gnome/gprefs.c
--- old/mc-4.5.37/gnome/gprefs.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gprefs.c Thu Sep 2 12:49:44 1999
@@ -21,9 +21,9 @@
#include "dialog.h"
#include "layout.h"
#include "gcustom-layout.h"
+#include "gdesktop-prefs.h"
#include "../vfs/vfs.h"
#include "gprefs.h"
-#include "gdesktop.h"
/* Orphan confirmation options */
/* Auto save setup */
@@ -56,21 +56,25 @@
gpointer property_variable;
gpointer extra_data1;
gpointer extra_data2;
-
- GtkWidget *widget;
-} Property;
-typedef struct
+ GtkWidget *widget;
+} Property;
+
+typedef struct
{
gchar *title;
- Property *props;
+ Property *props;
} PrefsPage;
-typedef struct
+typedef struct
{
WPanel *panel;
GtkWidget *prop_box;
PrefsPage *prefs_pages;
+
+ GDesktopPrefs *desktop_prefs;
+ gint desktop_prefs_page;
+
GCustomLayout *custom_layout;
gint custom_layout_page;
} PrefsDlg;
@@ -82,14 +86,14 @@
typedef GtkWidget* (*CustomCreateFunc) (PrefsDlg *dlg, Property *prop);
typedef void (*CustomApplyFunc) (PrefsDlg *dlg, Property *prop);
-static Property file_display_props [] =
+static Property file_display_props [] =
{
{
- N_("Show backup files"), PROPERTY_BOOL,
+ N_("Show backup files"), PROPERTY_BOOL,
&show_backups, NULL, NULL, NULL
},
{
- N_("Show hidden files"), PROPERTY_BOOL,
+ N_("Show hidden files"), PROPERTY_BOOL,
&show_dot_files, NULL, NULL, NULL
},
{
@@ -103,22 +107,22 @@
PROPERTIES_DONE
};
-static Property confirmation_props [] =
+static Property confirmation_props [] =
{
{
- N_("Confirm when deleting file"), PROPERTY_BOOL,
+ N_("Confirm when deleting file"), PROPERTY_BOOL,
&confirm_delete, NULL, NULL, NULL
},
{
- N_("Confirm when overwriting files"), PROPERTY_BOOL,
+ N_("Confirm when overwriting files"), PROPERTY_BOOL,
&confirm_overwrite, NULL, NULL, NULL
},
{
- N_("Confirm when executing files"), PROPERTY_BOOL,
+ N_("Confirm when executing files"), PROPERTY_BOOL,
&confirm_execute, NULL, NULL, NULL
},
{
- N_("Show progress while operations are being performed"), PROPERTY_BOOL,
+ N_("Show progress while operations are being performed"), PROPERTY_BOOL,
&verbose, NULL, NULL, NULL
},
PROPERTIES_DONE
@@ -140,8 +144,8 @@
},
PROPERTIES_DONE
};
-
-static Property caching_and_optimization_props [] =
+
+static Property caching_and_optimization_props [] =
{
{
N_("Fast directory reload"), PROPERTY_BOOL,
@@ -162,28 +166,12 @@
PROPERTIES_DONE
};
-static Property desktop_props [] = {
- {
- N_("Use shaped icons"), PROPERTY_BOOL,
- &desktop_use_shaped_icons, NULL, NULL, NULL
- },
- {
- N_("Auto place icons"), PROPERTY_BOOL,
- &desktop_auto_placement, NULL, NULL, NULL
- },
- {
- N_("Snap icons to grid"), PROPERTY_BOOL,
- &desktop_snap_icons, NULL, NULL, NULL
- },
- PROPERTIES_DONE
-};
-
static PrefsPage prefs_pages [] =
{
{
N_("File display"),
file_display_props
- },
+ },
{
N_("Confirmation"),
confirmation_props
@@ -196,23 +184,19 @@
N_("Caching"),
caching_and_optimization_props
},
- {
- N_("Desktop"),
- desktop_props
- },
PREFSPAGES_DONE
};
-static void
+static void
apply_changes_bool (PrefsDlg *dlg, Property *cur_prop)
{
GtkWidget *checkbox;
-
+
checkbox = cur_prop->widget;
-
- if (GTK_TOGGLE_BUTTON (checkbox)->active)
+
+ if (GTK_TOGGLE_BUTTON (checkbox)->active)
*( (int*) cur_prop->property_variable) = TRUE;
- else
+ else
*( (int*) cur_prop->property_variable) = FALSE;
}
@@ -223,7 +207,7 @@
gchar *text;
entry = cur_prop->widget;
-
+
text = gtk_entry_get_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))));
*( (char**) cur_prop->property_variable) = g_strdup (text);
@@ -243,7 +227,7 @@
*( (int*) cur_prop->property_variable) = (gint) val;
}
-static void
+static void
apply_changes_custom (PrefsDlg *dlg, Property *cur_prop)
{
CustomApplyFunc apply = (CustomApplyFunc) cur_prop->extra_data2;
@@ -266,7 +250,7 @@
case PROPERTY_NONE :
g_warning ("Invalid case in gprefs.c: apply_page_changes");
break;
- case PROPERTY_BOOL :
+ case PROPERTY_BOOL :
apply_changes_bool (dlg, &cur_prop);
break;
case PROPERTY_STRING :
@@ -284,22 +268,21 @@
}
static void
-apply_callback (GtkWidget *prop_box, gint pagenum, PrefsDlg *dlg)
+apply_callback (GtkWidget *prop_box, gint pagenum, PrefsDlg *dlg)
{
- if (pagenum == dlg->custom_layout_page) {
+ if (pagenum == dlg->desktop_prefs_page)
+ desktop_prefs_apply (dlg->desktop_prefs);
+ else if (pagenum == dlg->custom_layout_page)
custom_layout_apply (dlg->custom_layout);
- } else if (pagenum != -1) {
+ else if (pagenum != -1)
apply_page_changes (dlg, pagenum);
- } else {
- /* FIXME: can be optimized. Only if some of the
- * boolean flags changed this makes sense
- */
+ else {
update_panels (UP_RELOAD, UP_KEEPSEL);
save_setup ();
}
}
-static void
+static void
changed_callback (GtkWidget *widget, PrefsDlg *dlg)
{
if (dlg->prop_box)
@@ -310,9 +293,9 @@
create_prop_bool (PrefsDlg *dlg, Property *prop)
{
GtkWidget *checkbox;
-
+
checkbox = gtk_check_button_new_with_label (_(prop->label));
-
+
if (*((int*) prop->property_variable)) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
TRUE);
@@ -321,7 +304,7 @@
FALSE);
}
- gtk_signal_connect (GTK_OBJECT (checkbox), "clicked",
+ gtk_signal_connect (GTK_OBJECT (checkbox), "clicked",
changed_callback, (gpointer) dlg);
prop->widget = checkbox;
@@ -339,9 +322,9 @@
gint max_length;
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
-
+
label = gtk_label_new (_(prop->label));
- gtk_box_pack_start (GTK_BOX (hbox), label,
+ gtk_box_pack_start (GTK_BOX (hbox), label,
FALSE, FALSE, 0);
entry = gnome_entry_new (_(prop->label));
@@ -355,20 +338,20 @@
gtk_entry_set_text (GTK_ENTRY (gtk_entry),
(gchar*) *( (gchar**) prop->property_variable));
- gtk_signal_connect_while_alive (GTK_OBJECT (gtk_entry),
- "changed",
+ gtk_signal_connect_while_alive (GTK_OBJECT (gtk_entry),
+ "changed",
GTK_SIGNAL_FUNC (changed_callback),
(gpointer) dlg,
GTK_OBJECT (dlg->prop_box));
-
- gtk_box_pack_start (GTK_BOX (hbox), entry,
+
+ gtk_box_pack_start (GTK_BOX (hbox), entry,
FALSE, FALSE, 0);
-
+
prop->widget = entry;
gtk_widget_show_all (hbox);
return hbox;
}
-
+
static GtkWidget*
create_prop_int (PrefsDlg *dlg, Property *prop)
{
@@ -378,9 +361,9 @@
gchar buffer [10];
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
-
+
label = gtk_label_new (_(prop->label));
- gtk_box_pack_start (GTK_BOX (hbox), label,
+ gtk_box_pack_start (GTK_BOX (hbox), label,
FALSE, FALSE, 0);
entry = gnome_entry_new (_(prop->label));
@@ -389,34 +372,34 @@
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
buffer);
-
- gtk_signal_connect_while_alive (GTK_OBJECT (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
- "changed",
+
+ gtk_signal_connect_while_alive (GTK_OBJECT (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
+ "changed",
GTK_SIGNAL_FUNC (changed_callback),
(gpointer) dlg,
GTK_OBJECT (dlg->prop_box));
-
- gtk_box_pack_start (GTK_BOX (hbox), entry,
+
+ gtk_box_pack_start (GTK_BOX (hbox), entry,
FALSE, FALSE, 0);
if (prop->extra_data1) {
label = gtk_label_new (_((gchar *)prop->extra_data1));
- gtk_box_pack_start (GTK_BOX (hbox), label,
+ gtk_box_pack_start (GTK_BOX (hbox), label,
FALSE, FALSE, 0);
}
-
+
prop->widget = entry;
gtk_widget_show_all (hbox);
return hbox;
-}
+}
-static GtkWidget*
+static GtkWidget*
create_prop_custom (PrefsDlg *dlg, Property *prop)
{
CustomCreateFunc create = (CustomCreateFunc) prop->extra_data1;
if (!create)
return create_prop_bool (dlg, prop);
-
+
return create (dlg, prop);
}
@@ -442,7 +425,7 @@
static void
create_page (PrefsDlg *dlg, PrefsPage *page)
-{
+{
GtkWidget *vbox;
GtkWidget *prop_widget;
Property *cur_prop;
@@ -456,7 +439,7 @@
while (cur_prop->label != NULL) {
cur_prop = &(page->props [i]);
prop_widget = create_prop_widget (dlg, cur_prop);
- gtk_box_pack_start (GTK_BOX (vbox), prop_widget,
+ gtk_box_pack_start (GTK_BOX (vbox), prop_widget,
FALSE, FALSE, 0);
i++;
cur_prop = &(page->props [i]);
@@ -467,6 +450,18 @@
gtk_label_new (_(page->title)));
}
+/* Help callback for the preferences dialog */
+static void
+help_callback (GnomePropertyBox *pb, gint page_num, gpointer data)
+{
+ static GnomeHelpMenuEntry entry = {
+ "gmc",
+ "gmcprefs.html"
+ };
+
+ gnome_help_display (NULL, &entry);
+}
+
static void
create_prop_box (PrefsDlg *dlg)
{
@@ -486,12 +481,17 @@
cur_page = &(dlg->prefs_pages [i]);
}
- dlg->custom_layout = custom_layout_create_page (GNOME_PROPERTY_BOX (dlg->prop_box),
+ dlg->desktop_prefs = desktop_prefs_new (GNOME_PROPERTY_BOX (dlg->prop_box));
+ dlg->desktop_prefs_page = i++;
+
+ dlg->custom_layout = custom_layout_create_page (GNOME_PROPERTY_BOX (dlg->prop_box),
dlg->panel);
dlg->custom_layout_page = i;
gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "apply",
GTK_SIGNAL_FUNC (apply_callback), dlg);
+ gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "help",
+ GTK_SIGNAL_FUNC (help_callback), dlg);
}
void
diff -ruN old/mc-4.5.37/gnome/gscreen.c new/mc-4.5.38/gnome/gscreen.c
--- old/mc-4.5.37/gnome/gscreen.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gscreen.c Thu Sep 2 12:49:44 1999
@@ -27,6 +27,7 @@
#include "dir.h"
#include "dialog.h"
#include "setup.h"
+#include "file.h"
#include "fileopctx.h"
#include "gdesktop.h"
#include "gdnd.h"
@@ -40,6 +41,10 @@
#include "../vfs/vfs.h"
#include
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? a : b)
+#endif
+
/* Whether to display the tree view on the left */
int tree_panel_visible = -1;
@@ -125,7 +130,7 @@
panel_cancel_drag_scroll (WPanel *panel)
{
g_return_if_fail (panel != NULL);
-
+
if (panel->timer_id != -1){
gtk_timeout_remove (panel->timer_id);
panel->timer_id = -1;
@@ -190,11 +195,12 @@
type_col = -1;
g_assert (items == cl->columns);
-
+
texts [items] = NULL;
for (i = 0; i < top; i++){
file_entry *fe = &panel->dir.list [i];
format_e *format = panel->format;
+ int n;
for (col = 0; format; format = format->next){
if (!format->use_in_gui)
@@ -205,12 +211,17 @@
type_col = col;
if (!format->string_fn)
- texts [col] = "";
+ texts[col] = "";
else
- texts [col] = (*format->string_fn)(fe, 10);
+ texts[col] = (* format->string_fn) (fe, 10);
col++;
}
- gtk_clist_append (cl, texts);
+
+ n = gtk_clist_append (cl, texts);
+
+ /* Do not let the user select .. */
+ if (strcmp (fe->fname, "..") == 0)
+ gtk_clist_set_selectable (cl, n, FALSE);
color = file_compute_color (NORMAL, fe);
panel_file_list_set_row_colors (cl, i, color);
@@ -220,13 +231,17 @@
if (fe->f.marked)
gtk_clist_select_row (cl, i, 0);
-
+ else
+ gtk_clist_unselect_row (cl, i, 0);
+
}
+
+ g_free (texts);
+
/* This is needed as the gtk_clist_append changes selected under us :-( */
panel->selected = selected;
- select_item (panel);
+
gtk_clist_thaw (GTK_CLIST (cl));
- g_free (texts);
}
/*
@@ -235,40 +250,32 @@
static void
panel_fill_panel_icons (WPanel *panel)
{
- GnomeIconList *icons = ILIST_FROM_SW (panel->icons);
const int top = panel->count;
const int selected = panel->selected;
+ GnomeIconList *icons = ILIST_FROM_SW (panel->icons);
int i;
GdkImlibImage *image;
gnome_icon_list_freeze (icons);
gnome_icon_list_clear (icons);
-#if 0
- /*
- * HACK_BEGIN:
- * Temporary hack for pre-gnome-libs-1.0.10
- *
- * Remove after wildely deployed
- */
- icons->last_selected = 0;
- icons->last_clicked = 0;
- /*
- * HACK_END:
- */
-#endif
+
for (i = 0; i < top; i++) {
file_entry *fe = &panel->dir.list [i];
int p;
-
+
image = gicon_get_icon_for_file (panel->cwd, fe, TRUE);
p = gnome_icon_list_append_imlib (icons, image, fe->fname);
+
if (fe->f.marked)
gnome_icon_list_select_icon (icons, p);
+ else
+ gnome_icon_list_unselect_icon (icons, p);
}
- /* This is needed as the gtk_clist_append changes selected under us :-( */
+
+ /* This is needed as the gtk_gnome_icon_list_append_imlib changes selected under us :-( */
panel->selected = selected;
+
gnome_icon_list_thaw (icons);
- select_item (panel);
}
/*
@@ -420,7 +427,7 @@
used_columns += 2;
else
used_columns += format->field_len;
-
+
items++;
if (format->expand)
expandables++;
@@ -482,10 +489,6 @@
gtk_clist_thaw (clist);
}
-/* Handler for the select_row signal of the clist. We synchronize the panel's
- * idea of a selection, and handle pending actions that the
- * button_press/button_release handlers did not handle by themselves.
- */
static void
panel_file_list_select_row (GtkWidget *file_list, gint row, gint column,
GdkEvent *event, gpointer data)
@@ -513,7 +516,6 @@
panel->selected = 0;
}
-
/* Figure out the number of visible lines in the panel */
static void
panel_file_list_compute_lines (GtkScrolledWindow *sw, WPanel *panel, int height)
@@ -755,58 +757,50 @@
/* Things is: The File manager already handles file moving */
}
-/**
- * panel_icon_list_drag_data_received:
- *
- * Invoked on the target side of a Drag and Drop operation when data has been
- * dropped.
+/* Performs a drop on a panel. If idx is -1, then drops on the panel's cwd
+ * itself.
*/
static void
-panel_icon_list_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *selection_data,
- guint info,
- guint32 time,
- WPanel *panel)
+drop_on_panel (WPanel *panel, int idx, GdkDragContext *context, GtkSelectionData *selection_data)
{
- GnomeIconList *gil = GNOME_ICON_LIST (widget);
- file_entry *fe;
char *file;
- int free_file, free_fe;
- int idx;
- gboolean reload;
+ file_entry *fe;
+ int drop_on_dir;
+ int reload;
- idx = gnome_icon_list_get_icon_at (gil, x, y);
- if (idx == -1) {
- file = panel->cwd;
- fe = file_entry_from_file (file);
- if (!fe)
- return; /* eeeek */
+ g_assert (panel != NULL);
+ g_assert (idx == -1 || idx < panel->count);
+ g_assert (context != NULL);
+ g_assert (selection_data != NULL);
- free_file = FALSE;
- free_fe = TRUE;
- } else {
+ drop_on_dir = FALSE;
+
+ if (idx == -1)
+ drop_on_dir = TRUE;
+ else {
fe = &panel->dir.list[idx];
+ file = g_concat_dir_and_file (panel->cwd, fe->fname);
- if (S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir){
- file = g_concat_dir_and_file (panel->cwd, panel->dir.list[idx].fname);
- free_file = TRUE;
- } else {
- file = panel->cwd;
- free_file = FALSE;
+ if (!((S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir)
+ || gdnd_can_drop_on_file (file, fe))) {
+ g_free (file);
+ drop_on_dir = TRUE;
}
-
- free_fe = FALSE;
+ }
+
+ if (drop_on_dir) {
+ file = panel->cwd;
+ fe = file_entry_from_file (file);
+ if (!fe)
+ return; /* eeeek */
}
reload = gdnd_perform_drop (context, selection_data, file, fe);
- if (free_file)
+ if (file != panel->cwd)
g_free (file);
- if (free_fe)
+ if (drop_on_dir)
file_entry_free (fe);
if (reload) {
@@ -816,6 +810,28 @@
}
/**
+ * panel_icon_list_drag_data_received:
+ *
+ * Invoked on the target side of a Drag and Drop operation when data has been
+ * dropped.
+ */
+static void
+panel_icon_list_drag_data_received (GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint32 time,
+ WPanel *panel)
+{
+ int idx;
+
+ idx = gnome_icon_list_get_icon_at (GNOME_ICON_LIST (widget), x, y);
+ drop_on_panel (panel, idx, context, selection_data);
+}
+
+/**
* panel_clist_drag_data_received:
*
* Invoked on the target side of a Drag and Drop operation when data has been
@@ -831,49 +847,21 @@
guint32 time,
WPanel *panel)
{
- GtkCList *clist = GTK_CLIST (widget);
- file_entry *fe;
- char *file;
- int free_file, free_fe;
+ GtkCList *clist;
int row;
- int reload;
-
- if (gtk_clist_get_selection_info (clist, x, y, &row, NULL) == 0) {
- file = panel->cwd;
- fe = file_entry_from_file (file);
- if (!fe)
- return; /* eeeek */
-
- free_file = FALSE;
- free_fe = TRUE;
- } else {
- g_assert (row < panel->count);
-
- fe = &panel->dir.list[row];
- if (S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir){
- file = g_concat_dir_and_file (panel->cwd, panel->dir.list[row].fname);
- free_file = TRUE;
- } else {
- file = panel->cwd;
- free_file = FALSE;
- }
-
- free_fe = FALSE;
- }
+ clist = GTK_CLIST (widget);
- reload = gdnd_perform_drop (context, selection_data, file, fe);
+ /* Normalize the y coordinate to the clist_window */
- if (free_file)
- g_free (file);
+ y -= (GTK_CONTAINER (clist)->border_width
+ + clist->column_title_area.y
+ + clist->column_title_area.height);
- if (free_fe)
- file_entry_free (fe);
+ if (gtk_clist_get_selection_info (GTK_CLIST (widget), x, y, &row, NULL) == 0)
+ row = -1;
- if (reload) {
- update_panels (UP_OPTIMIZE, UP_KEEPSEL);
- repaint_screen ();
- }
+ drop_on_panel (panel, row, context, selection_data);
}
/**
@@ -907,8 +895,10 @@
path = gtk_dtree_get_row_path (dtree, node, 0);
fe = file_entry_from_file (path);
- if (!fe)
+ if (!fe) {
+ g_free (path);
return; /* eeeek */
+ }
reload = gdnd_perform_drop (context, selection_data, path, fe);
@@ -1069,6 +1059,7 @@
GtkWidget *source_widget;
gint idx;
file_entry *fe;
+ char *full_name;
panel = data;
@@ -1099,14 +1090,19 @@
else
fe = &panel->dir.list[idx];
+ full_name = fe ? g_concat_dir_and_file (panel->cwd, fe->fname) : panel->cwd;
+
action = gdnd_validate_action (context,
FALSE,
source_widget != NULL,
source_widget == widget,
- panel->cwd,
+ full_name,
fe,
fe ? fe->f.marked : FALSE);
+ if (full_name != panel->cwd)
+ g_free (full_name);
+
gdk_drag_status (context, action, time);
out:
@@ -1200,6 +1196,7 @@
GtkWidget *source_widget;
int idx;
file_entry *fe;
+ char *full_name;
panel = data;
@@ -1216,14 +1213,19 @@
idx = gnome_icon_list_get_icon_at (GNOME_ICON_LIST (widget), x, y);
fe = (idx == -1) ? NULL : &panel->dir.list[idx];
+ full_name = fe ? g_concat_dir_and_file (panel->cwd, fe->fname) : panel->cwd;
+
action = gdnd_validate_action (context,
FALSE,
source_widget != NULL,
source_widget == widget,
- panel->cwd,
+ full_name,
fe,
fe ? fe->f.marked : FALSE);
+ if (full_name != panel->cwd)
+ g_free (full_name);
+
gdk_drag_status (context, action, time);
return TRUE;
}
@@ -1376,6 +1378,10 @@
display_mini_info (panel);
execute_hooks (select_file_hook);
+ /* Do not let the user select .. */
+ if (strcmp (panel->dir.list[index].fname, "..") == 0)
+ gnome_icon_list_unselect_icon (GNOME_ICON_LIST (widget), index);
+
if (!event)
return;
@@ -1420,17 +1426,63 @@
}
static int
+queue_reread_cmd (gpointer data)
+{
+ reread_cmd ();
+ return FALSE;
+}
+
+/* Renames a file using a file operation context. Returns FILE_CONT on success. */
+int
+rename_file_with_context (char *source, char *dest)
+{
+ FileOpContext *ctx;
+ struct stat s;
+ long count;
+ double bytes;
+ int retval;
+
+ if (mc_lstat (source, &s) != 0)
+ return FILE_ABORT;
+
+ ctx = file_op_context_new ();
+ file_op_context_create_ui (ctx, OP_MOVE, FALSE);
+
+ count = 1;
+ bytes = s.st_size;
+
+ retval = move_file_file (ctx, source, dest, &count, &bytes);
+ file_op_context_destroy (ctx);
+
+ return retval;
+}
+
+static int
panel_icon_renamed (GtkWidget *widget, int index, char *dest, WPanel *panel)
{
char *source;
+ char *fullname;
+ int retval;
- source = panel->dir.list [index].fname;
- if (mc_rename (source, dest) == 0){
+ if (strcmp (dest, panel->dir.list[index].fname) == 0)
+ return TRUE; /* do nothing if the name did not change */
+
+ source = g_concat_dir_and_file (cpanel->cwd, panel->dir.list[index].fname);
+ fullname = g_concat_dir_and_file (cpanel->cwd, dest);
+
+ if (rename_file_with_context (source, dest) == FILE_CONT) {
g_free (panel->dir.list [index].fname);
panel->dir.list [index].fname = g_strdup (dest);
- return TRUE;
+
+ gtk_idle_add (queue_reread_cmd, NULL);
+ retval = TRUE;
} else
- return FALSE;
+ retval = FALSE;
+
+ g_free (source);
+ g_free (fullname);
+
+ return retval;
}
/* Callback for rescanning the cwd */
@@ -1463,6 +1515,21 @@
}
+/* Returns whether an icon in the icon list is being edited. FIXME: This
+ * function uses a fantastically ugly hack to figure this out. It would be
+ * saner to have a function provided by the icon list widget to do it, but we
+ * can't break forwards compatibility at this point. It would be even saner to
+ * have a good DnD API for the icon list.
+ */
+static int
+editing_icon_list (GnomeIconList *gil)
+{
+ GnomeCanvasItem *item;
+
+ item = GNOME_CANVAS (gil)->focused_item;
+ return (item && GNOME_IS_ICON_TEXT_ITEM (item) && GNOME_ICON_TEXT_ITEM (item)->editing);
+}
+
/*
* Strategy for activaing the drags from the icon-list:
*
@@ -1478,6 +1545,9 @@
GnomeIconList *gil = GNOME_ICON_LIST (widget);
int icon;
+ if (editing_icon_list (gil))
+ return FALSE;
+
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
@@ -1791,7 +1861,10 @@
g_assert (node != NULL);
if (!GTK_CTREE_ROW (node)->expanded) {
+#if 0
+ /* FIXME: Disabled until fully debugged. Should also be configurable. */
dtree->auto_expanded_nodes = g_list_append (dtree->auto_expanded_nodes, node);
+#endif
gtk_ctree_expand (GTK_CTREE (panel->tree), node);
}
@@ -1925,7 +1998,6 @@
GtkWidget *source_widget;
char *row_path;
int on_drag_row;
- char *parent_dir, *p;
dtree = GTK_DTREE (widget);
panel = data;
@@ -1976,13 +2048,6 @@
panel->drag_tree_row = row;
}
- /* Compute the parent directory of the file entry */
-
- parent_dir = g_strdup (row_path);
- p = strrchr (parent_dir, PATH_SEP);
- g_assert (p != NULL);
- p[1] = 0;
-
/* Validate the action */
gdnd_find_panel_by_drag_context (context, &source_widget);
@@ -1996,16 +2061,15 @@
on_drag_row = strcmp (row_path, dtree->drag_dir) == 0;
} else
on_drag_row = FALSE;
-
+
action = gdnd_validate_action (context,
FALSE,
source_widget != NULL,
source_widget == widget,
- parent_dir,
+ row_path,
panel->drag_tree_fe,
on_drag_row);
- g_free (parent_dir);
g_free (row_path);
} else {
panel->drag_tree_row = -1;
@@ -2080,10 +2144,10 @@
panel_tree_button_press (GtkWidget *widget, GdkEventButton *event, WPanel *panel)
{
GtkWidget *popup;
-
+
if (event->type != GDK_BUTTON_PRESS)
return;
-
+
if (event->button != 3)
return;
@@ -2245,12 +2309,12 @@
};
static void
-do_ui_signal_connect (GnomeUIInfo *uiinfo, gchar *signal_name,
+do_ui_signal_connect (GnomeUIInfo *uiinfo, gchar *signal_name,
GnomeUIBuilderData *uibdata)
{
if (uiinfo->moreinfo)
- gtk_signal_connect (GTK_OBJECT (uiinfo->widget),
- signal_name, uiinfo->moreinfo, uibdata->data ?
+ gtk_signal_connect (GTK_OBJECT (uiinfo->widget),
+ signal_name, uiinfo->moreinfo, uibdata->data ?
uibdata->data : uiinfo->user_data);
}
@@ -2361,7 +2425,7 @@
* We fall back to icon view if a certain listing type is not supported.
* Be sure to keep this in sync with the uiinfo arrays in glayout.c.
*/
-
+
if (panel->list_type == list_brief)
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[1].widget), TRUE);
@@ -2523,7 +2587,7 @@
x_reset_sort_labels (WPanel *panel)
{
int page;
-
+
if (!panel->notebook)
return;
diff -ruN old/mc-4.5.37/gnome/gtkdtree.c new/mc-4.5.38/gnome/gtkdtree.c
--- old/mc-4.5.37/gnome/gtkdtree.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gtkdtree.c Thu Sep 2 12:49:44 1999
@@ -1,5 +1,5 @@
/*
- * GtkDTree: A directory tree view
+ * GtkDTree: A directory tree view
*
* Original version by Daniel Lacroix (LACROIX@wanadoo.fr)
*
@@ -38,7 +38,7 @@
LAST_SIGNAL
};
-static guint gtk_dtree_signals [LAST_SIGNAL] = { 0 };
+static guint gtk_dtree_signals[LAST_SIGNAL] = { 0 };
char *
gtk_dtree_get_row_path (GtkDTree *dtree, GtkCTreeNode *row, gint column)
@@ -68,11 +68,11 @@
row = GTK_CTREE_ROW (row)->parent;
} while (row);
- if (path [0] && path [1]){
+ if (path[0] && path[1]) {
int l = strlen (path);
-
- if (path [l-1] == '/')
- path [l-1] = 0;
+
+ if (path[l - 1] == '/')
+ path[l - 1] = 0;
}
return path;
}
@@ -88,7 +88,7 @@
node = GTK_CTREE_ROW (parent)->children;
- for (; node && GTK_CTREE_ROW (node)->parent == parent;){
+ for (; node && GTK_CTREE_ROW (node)->parent == parent;) {
char *s;
gtk_ctree_node_get_pixtext (GTK_CTREE (dtree), node, 0, &s, NULL, NULL, NULL);
@@ -105,9 +105,9 @@
static GtkCTreeNode *
gtk_dtree_insert_node (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
{
- char *texts [1];
+ char *texts[1];
- texts [0] = text;
+ texts[0] = text;
return gtk_ctree_insert_node (GTK_CTREE (dtree), parent, NULL,
texts, TREE_SPACING,
@@ -130,7 +130,7 @@
g_assert (parent);
g_assert (dtree);
- if (mc_stat (path, &dir_stat)){
+ if (mc_stat (path, &dir_stat)) {
return FALSE;
}
if (!S_ISDIR(dir_stat.st_mode))
@@ -149,14 +149,14 @@
return TRUE;
}
#endif
-
+
dir = tree_store_opendir (path);
- if (!dir){
+ if (!dir) {
dtree->loading_dir--;
return FALSE;
}
- for (; (dirent = tree_store_readdir (dir)) != NULL; ){
+ while ((dirent = tree_store_readdir (dir)) != NULL) {
GtkCTreeNode *sibling;
char *text;
@@ -206,19 +206,13 @@
}
}
-/* Scans a subdirectory in the tree. Returns whether it is worth it to reload
- * the directory or not.
- */
-static int
+/* Scans a subdirectory in the tree */
+static void
scan_subtree (GtkDTree *dtree, GtkCTreeNode *row)
{
char *path;
- if (row == dtree->last_node)
- return FALSE;
-
dtree->loading_dir++;
- dtree->last_node = row;
scan_begin (dtree);
path = gtk_dtree_get_row_path (dtree, row, 0);
@@ -229,31 +223,15 @@
dtree->current_path = path;
gtk_dtree_load_path (dtree, path, row, 1);
-#if 0
- last_node = GTK_CTREE_ROW (row)->children;
- for (; last_node; last_node = GTK_CTREE_ROW (last_node)->sibling){
- char *np, *text;
-
- gtk_ctree_node_get_pixtext (GTK_CTREE (dtree), last_node, column,
- &text, NULL, NULL, NULL);
-
- np = g_concat_dir_and_file (path, text);
- gtk_dtree_load_path (dtree, np, last_node, 0);
- g_free (np);
- }
-#endif
dtree->loading_dir--;
scan_end (dtree);
-
- return TRUE;
}
static void
gtk_dtree_select_row (GtkCTree *ctree, GtkCTreeNode *row, gint column)
{
GtkDTree *dtree;
- int do_change;
dtree = GTK_DTREE (ctree);
@@ -263,10 +241,18 @@
scan_begin (dtree);
(* parent_class->tree_select_row) (ctree, row, column);
- do_change = scan_subtree (dtree, row);
- if (do_change && !dtree->internal)
- gtk_signal_emit (GTK_OBJECT (dtree), gtk_dtree_signals [DIRECTORY_CHANGED],
+ if (row == dtree->last_node) {
+ scan_end (dtree);
+ return;
+ }
+
+ dtree->last_node = row;
+
+ scan_subtree (dtree, row);
+
+ if (!dtree->internal)
+ gtk_signal_emit (GTK_OBJECT (dtree), gtk_dtree_signals[DIRECTORY_CHANGED],
dtree->current_path);
scan_end (dtree);
@@ -283,10 +269,10 @@
node = GTK_CTREE_ROW (parent)->children;
- while (node){
+ while (node) {
char *text;
- if (GTK_CTREE_ROW (node)->parent == parent){
+ if (GTK_CTREE_ROW (node)->parent == parent) {
gtk_ctree_node_get_pixtext (
GTK_CTREE (dtree), node, 0, &text,
NULL, NULL, NULL);
@@ -321,7 +307,7 @@
npath = g_strdup ("/");
dtree->internal = 1;
- while ((current = strtok (s, "/")) != NULL){
+ while ((current = strtok (s, "/")) != NULL) {
char *full_path;
GtkCTreeNode *node;
@@ -331,13 +317,13 @@
npath = full_path;
node = gtk_dtree_lookup_dir (dtree, current_node, current);
- if (!node){
+ if (!node) {
gtk_dtree_load_path (dtree, full_path, current_node, 1);
node = gtk_dtree_lookup_dir (dtree, current_node, current);
}
- if (node){
+ if (node) {
gtk_ctree_expand (GTK_CTREE (dtree), node);
current_node = node;
} else
@@ -345,19 +331,19 @@
}
g_free (npath);
- if (current_node){
+ if (current_node) {
gtk_ctree_select (GTK_CTREE (dtree), current_node);
- if (gtk_ctree_node_is_visible (GTK_CTREE (dtree), current_node) != GTK_VISIBILITY_FULL){
+ if (gtk_ctree_node_is_visible (GTK_CTREE (dtree), current_node)
+ != GTK_VISIBILITY_FULL)
gtk_ctree_node_moveto (GTK_CTREE (dtree), current_node, 0, 0.5, 0.0);
- }
-
}
- if (dtree->current_path){
+
+ if (dtree->current_path) {
g_free (dtree->current_path);
dtree->current_path = g_strdup (path);
}
- if (dtree->requested_path){
+ if (dtree->requested_path) {
g_free (dtree->requested_path);
dtree->requested_path = NULL;
}
@@ -373,7 +359,7 @@
* @path: The path we want loaded into the tree
*
* Attemps to open all of the tree notes until
- * path is reached. It takes a fully qualified
+ * path is reached. It takes a fully qualified
* pathname.
*
* Returns: TRUE if it succeeded, otherwise, FALSE
@@ -418,7 +404,7 @@
if (!dtree->requested_path)
return;
- if (strcmp (dtree->current_path, dtree->requested_path) == 0){
+ if (strcmp (dtree->current_path, dtree->requested_path) == 0) {
g_free (dtree->requested_path);
dtree->requested_path = NULL;
return;
@@ -489,13 +475,13 @@
copy = dirname = g_strdup (tree->name);
copy++;
current_node = dtree->root_node;
- while ((current = strtok (copy, "/")) != NULL){
+ while ((current = strtok (copy, "/")) != NULL) {
current_node = gtk_dtree_lookup_dir (dtree, current_node, current);
if (!current_node)
break;
copy = NULL;
}
- if (current == NULL && current_node){
+ if (current == NULL && current_node) {
dtree->removing_rows = 1;
gtk_ctree_remove_node (GTK_CTREE (data), current_node);
dtree->removing_rows = 0;
@@ -525,13 +511,13 @@
copy++;
current_node = dtree->root_node;
npath = g_strdup ("/");
- while ((current = strtok (copy, "/")) != NULL){
+ while ((current = strtok (copy, "/")) != NULL) {
full_path = g_concat_dir_and_file (npath, current);
g_free (npath);
npath = full_path;
new_node = gtk_dtree_lookup_dir (dtree, current_node, current);
- if (!new_node){
+ if (!new_node) {
GtkCTreeNode *sibling;
sibling = gtk_dtree_insert_node (dtree, current_node, current);
@@ -579,7 +565,7 @@
if (dtree->requested_path)
g_free (dtree->requested_path);
-
+
(GTK_OBJECT_CLASS (parent_class))->destroy (object);
}
@@ -629,7 +615,7 @@
static void
gtk_dtree_load_root_tree (GtkDTree *dtree)
{
- char *root_dir [1] = { "/" };
+ char *root_dir[1] = { "/" };
g_assert (dtree);
@@ -654,8 +640,8 @@
/* Set current_path to "/" */
dtree->current_path = g_malloc (2);
- dtree->current_path [0] = '/';
- dtree->current_path [1] = 0;
+ dtree->current_path[0] = '/';
+ dtree->current_path[1] = 0;
/* Select root node */
gtk_ctree_select (GTK_CTREE (dtree), dtree->root_node);
@@ -664,7 +650,7 @@
}
static void
-gtk_dtree_load_pixmap (char *pix [], GdkPixmap **pixmap, GdkBitmap **bitmap)
+gtk_dtree_load_pixmap (char *pix[], GdkPixmap **pixmap, GdkBitmap **bitmap)
{
GdkImlibImage *image;
@@ -678,12 +664,6 @@
*bitmap = gdk_imlib_move_mask (image);
}
-/*
- * FIXME: This uses the current colormap and pixmap.
- * This means that at widget *creation* time the proper
- * colormap and visual should be set, dont wait till
- * realize for that
- */
static void
gdk_dtree_load_pixmaps (GtkDTree *dtree)
{
@@ -714,7 +694,7 @@
static void
gtk_dtree_dirty_notify (int state)
{
- if (dirty_tag != -1){
+ if (dirty_tag != -1) {
if (state)
return;
else {
@@ -768,7 +748,7 @@
gdk_dtree_load_pixmaps (dtree);
gtk_dtree_load_root_tree (dtree);
-
+
}
GtkWidget *
@@ -812,11 +792,11 @@
* @dtree: A tree
* @node: The presumed ancestor node
* @child: The presumed child node
- *
+ *
* Tests whether a node is an ancestor of a child node. This does this in
* O(height of child), instead of O(number of children in node), like GtkCTree
* does.
- *
+ *
* Return value: TRUE if the node is an ancestor of the child, FALSE otherwise.
**/
gboolean
diff -ruN old/mc-4.5.37/gnome/gtkdtree.h new/mc-4.5.38/gnome/gtkdtree.h
--- old/mc-4.5.37/gnome/gtkdtree.h Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/gnome/gtkdtree.h Thu Sep 2 12:49:44 1999
@@ -20,12 +20,12 @@
char *drag_dir;
GList *auto_expanded_nodes;
-
+
GtkCTreeNode *root_node; /* root node */
GtkCTreeNode *last_node; /* last visited node */
/* Pixmaps for showing directories */
- GdkPixmap *pixmap_open;
+ GdkPixmap *pixmap_open;
GdkPixmap *pixmap_close;
/* Masks */
@@ -40,7 +40,7 @@
typedef struct {
GtkCTreeClass parent_class;
-
+
void (* directory_changed) (GtkDTree *dtree, char *directory);
void (* scan_begin) (GtkDTree *dtree);
void (* scan_end) (GtkDTree *dtree);
diff -ruN old/mc-4.5.37/gnome/gview.c new/mc-4.5.38/gnome/gview.c
--- old/mc-4.5.37/gnome/gview.c Mon Jul 12 23:57:31 1999
+++ new/mc-4.5.38/gnome/gview.c Thu Sep 2 12:49:44 1999
@@ -133,7 +133,7 @@
char buffer [80];
if (view->hex_mode)
- g_snprintf (buffer, sizeof (buffer), _("Offset 0x%08x"), view->edit_cursor);
+ g_snprintf (buffer, sizeof (buffer), _("Offset 0x%08lx"), view->edit_cursor);
else
g_snprintf (buffer, sizeof (buffer), _("Col %d"), -view->start_col);
if (strcmp (buffer, GTK_LABEL (view->gtk_offset)->label))
diff -ruN old/mc-4.5.37/gnome/mc.keys.in.in new/mc-4.5.38/gnome/mc.keys.in.in
--- old/mc-4.5.37/gnome/mc.keys.in.in Mon Jul 12 23:57:30 1999
+++ new/mc-4.5.38/gnome/mc.keys.in.in Thu Sep 2 12:49:43 1999
@@ -189,19 +189,19 @@
audio/x-mp3:
open=mpg123 %f
- open.x11amp.Use x11amp to play this=x11amp %f
+ open.xmms.Use xmms to play this=xmms %f
audio/x-mod:
- open=x11amp %f
- view=x11amp %f
+ open=xmms %f
+ view=xmms %f
audio/x-s3m:
- open=x11amp %f
- view=x11amp %f
+ open=xmms %f
+ view=xmms %f
audio/x-xm:
- open=x11amp %f
- view=x11amp %f
+ open=xmms %f
+ view=xmms %f
image/*:
diff -ruN old/mc-4.5.37/gtkedit/Makefile.in new/mc-4.5.38/gtkedit/Makefile.in
--- old/mc-4.5.37/gtkedit/Makefile.in Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/Makefile.in Thu Sep 2 12:49:39 1999
@@ -75,7 +75,7 @@
-$(RMF) $(DESTDIR)$(bindir)/$(binprefix)mcedit
distcopy:
- $(CP) $(DIST) ../../mc-$(VERSION)/gtkedit
+ for I in $(DIST); do $(CP) $(top_srcdir)/gtkedit/$$I $(top_srcdir)/mc-$(VERSION)/gtkedit; done
depend dep: mcdep
diff -ruN old/mc-4.5.37/gtkedit/bookmark.c new/mc-4.5.38/gtkedit/bookmark.c
--- old/mc-4.5.37/gtkedit/bookmark.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/bookmark.c Thu Sep 2 12:49:40 1999
@@ -23,6 +23,9 @@
#include
#include "edit.h"
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
/* note, if there is more than one bookmark on a line, then they are
appended after each other and the last one is always the one found
@@ -138,23 +141,30 @@
if (p->next)
p->next->prev = q;
p->next = q;
+#if !defined (GTK) && !defined (MIDNIGHT)
+ render_scrollbar (edit->widget->vert_scrollbar);
+#endif
}
/* remove a bookmark if there is one at this line matching this colour - c of -1 clear all */
-void book_mark_clear (WEdit * edit, int line, int c)
+/* returns non-zero on not-found */
+int book_mark_clear (WEdit * edit, int line, int c)
{
struct _book_mark *p, *q;
+ int r = 1;
+ int rend = 0;
if (!edit->book_mark)
- return;
+ return r;
for (p = book_mark_find (edit, line); p; p = q) {
q = p->prev;
if (p->line == line && (p->c == c || c == -1)) {
+ r = 0;
edit->force |= REDRAW_LINE;
edit->book_mark = p->prev;
p->prev->next = p->next;
if (p->next)
p->next->prev = p->prev;
- memset (p, 0, sizeof (struct _book_mark));
+ rend = 1;
free (p);
break;
}
@@ -164,12 +174,18 @@
free (edit->book_mark);
edit->book_mark = 0;
}
+#if !defined (GTK) && !defined (MIDNIGHT)
+ if (rend)
+ render_scrollbar (edit->widget->vert_scrollbar);
+#endif
+ return r;
}
/* clear all bookmarks matching this colour, if c is -1 clears all */
void book_mark_flush (WEdit * edit, int c)
{
struct _book_mark *p, *q;
+ int rend = 0;
if (!edit->book_mark)
return;
edit->force |= REDRAW_PAGE;
@@ -181,7 +197,7 @@
q->prev->next = q->next;
if (p)
p->prev = q->prev;
- memset (q, 0, sizeof (struct _book_mark));
+ rend = 1;
free (q);
}
}
@@ -189,28 +205,46 @@
free (edit->book_mark);
edit->book_mark = 0;
}
+#if !defined (GTK) && !defined (MIDNIGHT)
+ if (rend)
+ render_scrollbar (edit->widget->vert_scrollbar);
+#endif
}
/* shift down bookmarks after this line */
void book_mark_inc (WEdit * edit, int line)
{
+ int rend = 0;
if (edit->book_mark) {
struct _book_mark *p;
p = book_mark_find (edit, line);
- for (p = p->next; p; p = p->next)
+ for (p = p->next; p; p = p->next) {
p->line++;
+ rend = 1;
+ }
}
+#if !defined (GTK) && !defined (MIDNIGHT)
+ if (rend)
+ render_scrollbar (edit->widget->vert_scrollbar);
+#endif
}
/* shift up bookmarks after this line */
void book_mark_dec (WEdit * edit, int line)
{
+ int rend = 0;
if (edit->book_mark) {
struct _book_mark *p;
p = book_mark_find (edit, line);
- for (p = p->next; p; p = p->next)
+ for (p = p->next; p; p = p->next) {
p->line--;
+ rend = 1;
+ }
}
+#if !defined (GTK) && !defined (MIDNIGHT)
+ if (rend)
+ render_scrollbar (edit->widget->vert_scrollbar);
+#endif
}
diff -ruN old/mc-4.5.37/gtkedit/edit.c new/mc-4.5.38/gtkedit/edit.c
--- old/mc-4.5.37/gtkedit/edit.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/edit.c Thu Sep 2 12:49:39 1999
@@ -26,8 +26,6 @@
#if defined(NEEDS_IO_H)
# include
# include
-#endif
-#ifdef NEEDS_CR_LF_TRANSLATION
# define CR_LF_TRANSLATION
#endif
#include "edit.h"
@@ -36,6 +34,9 @@
# include
#endif /* SCO_FLAVOR */
#include /* for ctime() */
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
/*
*
@@ -257,10 +258,10 @@
/* Lastbyte calculation in TEXT mode FRANCO */
#if defined CR_LF_TRANSLATION
- if(file && (!text)) {
+ if(file && (!text)){
real_size=0;
tmp_buf[sizeof (tmp_buf) - 1] = 0;
- while ((bytes_read = read (file, tmp_buf, 1024)) > 0) {
+ while((bytes_read = read(file,tmp_buf,1024)) > 0){
real_size += bytes_read;
}
s.st_size = real_size;
@@ -336,8 +337,8 @@
filename = catstrs (dir, filename, 0);
edit_split_filename (edit, (char *) filename);
} else {
- edit->filename = strdup ("");
- edit->dir = strdup(dir);
+ edit->filename = (char *) strdup ("");
+ edit->dir = (char *) strdup(dir);
}
edit->stack_size = START_STACK_SIZE;
edit->stack_size_mask = START_STACK_SIZE - 1;
@@ -394,7 +395,7 @@
char *dir;
if (edit->dir)
- dir = strdup (edit->dir);
+ dir = (char *) strdup (edit->dir);
else
dir = 0;
@@ -444,7 +445,7 @@
set edit->mark1 position. 700'000'000 through 1400'000'000 is to set edit->mark2
position.
- The only way the curser moves or the buffer is changed is through the routines:
+ The only way the cursor moves or the buffer is changed is through the routines:
insert, backspace, insert_ahead, delete, and cursor_move.
These record the reverse undo movements onto the stack each time they are
called.
@@ -745,26 +746,22 @@
#ifdef FAST_MOVE_CURSOR
-#define memqcpy(edit,d,s,i) \
- { \
- unsigned long next; \
- char *dest = d; \
- char *src = s; \
- int n = i; \
- while ((next = \
- (unsigned long) memccpy (dest, src, '\n', n))) { \
- edit->curs_line--; \
- next -= (unsigned long) dest; \
- n -= next; \
- src += next; \
- dest += next; \
- } \
- }
+static void memqcpy (WEdit * edit, unsigned char *dest, unsigned char *src, int n)
+{
+ unsigned long next;
+ while ((next = (unsigned long) memccpy (dest, src, '\n', n))) {
+ edit->curs_line--;
+ next -= (unsigned long) dest;
+ n -= next;
+ src += next;
+ dest += next;
+ }
+}
int edit_move_backward_lots (WEdit * edit, long increment)
{
int r, s, t;
- char *p;
+ unsigned char *p;
if (increment > edit->curs1)
increment = edit->curs1;
@@ -845,7 +842,7 @@
#endif /* ! FAST_MOVE_CURSOR */
-/* moves the curser right or left: increment positive or negative respectively */
+/* moves the cursor right or left: increment positive or negative respectively */
int edit_cursor_move (WEdit * edit, long increment)
{
/* this is the same as a combination of two of the above routines, with only one push onto the undo stack */
@@ -1158,7 +1155,7 @@
f = edit_eol (edit, offset) - 1;
while (s <= f) {
c = edit_get_byte (edit, s++);
- if ((c > ' ' && c <= '~') || c >= 160) /* non-printables on a line are considered "blank" */
+ if (!isspace (c))
return 0;
}
return 1;
@@ -1169,7 +1166,7 @@
long edit_find_line (WEdit * edit, int line)
{
int i, j = 0;
- int m = 1000000000;
+ int m = 2000000000;
if (!edit->caches_valid) {
for (i = 0; i < N_LINE_CACHES; i++)
edit->line_numbers[i] = edit->line_offsets[i] = 0;
@@ -1435,75 +1432,118 @@
}
}
-int my_type_of (int c)
+static unsigned long my_type_of (int c)
{
- if (c < ' ' && c > 0)
- return 1;
- if (strchr ("+_-.", c))
- if (strchr (option_whole_chars_move, c))
- return 3;
- if (!strcasechr (option_whole_chars_move, c))
- return 2;
- if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c >= 160)
- return 3;
- return c;
+ int x, r = 0;
+ char *p, *q;
+ if (!c)
+ return 0;
+ if (c == '!') {
+ if (*option_chars_move_whole_word == '!')
+ return 2;
+ return 0x80000000UL;
+ }
+ if (isupper (c))
+ c = 'A';
+ else if (islower (c))
+ c = 'a';
+ else if (isalpha (c))
+ c = 'a';
+ else if (isdigit (c))
+ c = '0';
+ else if (isspace (c))
+ c = ' ';
+ q = strchr (option_chars_move_whole_word, c);
+ if (!q)
+ return 0xFFFFFFFFUL;
+ do {
+ for (x = 1, p = option_chars_move_whole_word; (unsigned long) p < (unsigned long) q; p++)
+ if (*p == '!')
+ x <<= 1;
+ r |= x;
+ } while ((q = strchr (q + 1, c)));
+ return r;
}
-void edit_left_word_move (WEdit * edit)
+void edit_left_word_move (WEdit * edit, int s)
{
- do {
+ for (;;) {
+ int c1, c2;
edit_cursor_move (edit, -1);
if (!edit->curs1)
break;
- } while (my_type_of (edit_get_byte (edit, edit->curs1))
- ==
- my_type_of (edit_get_byte (edit, edit->curs1 - 1)));
+ c1 = edit_get_byte (edit, edit->curs1 - 1);
+ c2 = edit_get_byte (edit, edit->curs1);
+ if (!(my_type_of (c1) & my_type_of (c2)))
+ break;
+ if (isspace (c1) && !isspace (c2))
+ break;
+ if (s)
+ if (!isspace (c1) && isspace (c2))
+ break;
+ }
}
static void edit_left_word_move_cmd (WEdit * edit)
{
- edit_left_word_move (edit);
- if (strchr (option_whole_chars_move, ' '))
- if (strchr ("\t ", edit_get_byte (edit, edit->curs1)))
- edit_left_word_move (edit);
+ edit_left_word_move (edit, 0);
edit->force |= REDRAW_PAGE;
}
-void edit_right_word_move (WEdit * edit)
+void edit_right_word_move (WEdit * edit, int s)
{
- do {
+ for (;;) {
+ int c1, c2;
edit_cursor_move (edit, 1);
if (edit->curs1 >= edit->last_byte)
break;
- } while (my_type_of (edit_get_byte (edit, edit->curs1 - 1))
- ==
- my_type_of (edit_get_byte (edit, edit->curs1)));
+ c1 = edit_get_byte (edit, edit->curs1 - 1);
+ c2 = edit_get_byte (edit, edit->curs1);
+ if (!(my_type_of (c1) & my_type_of (c2)))
+ break;
+ if (isspace (c1) && !isspace (c2))
+ break;
+ if (s)
+ if (!isspace (c1) && isspace (c2))
+ break;
+ }
}
static void edit_right_word_move_cmd (WEdit * edit)
{
- edit_right_word_move (edit);
- if (strchr (option_whole_chars_move, ' '))
- if (strchr ("\t ", edit_get_byte (edit, edit->curs1)))
- edit_right_word_move (edit);
+ edit_right_word_move (edit, 0);
edit->force |= REDRAW_PAGE;
}
static void edit_right_delete_word (WEdit * edit)
{
- int c;
- do {
- c = edit_delete (edit);
- } while (my_type_of (c) == my_type_of (edit_get_byte (edit, edit->curs1)));
+ int c1, c2;
+ for (;;) {
+ if (edit->curs1 >= edit->last_byte)
+ break;
+ c1 = edit_delete (edit);
+ c2 = edit_get_byte (edit, edit->curs1);
+ if ((isspace (c1) == 0) != (isspace (c2) == 0))
+ break;
+ if (!(my_type_of (c1) & my_type_of (c2)))
+ break;
+ }
}
static void edit_left_delete_word (WEdit * edit)
{
- int c;
- do {
- c = edit_backspace (edit);
- } while (my_type_of (c) == my_type_of (edit_get_byte (edit, edit->curs1 - 1)));
+ int c1, c2;
+ for (;;) {
+ if (edit->curs1 <= 0)
+ break;
+ c1 = edit_backspace (edit);
+ c2 = edit_get_byte (edit, edit->curs1 - 1);
+ if ((isspace (c1) == 0) != (isspace (c2) == 0))
+ break;
+ if (!(my_type_of (c1) & my_type_of (c2)))
+ break;
+ }
}
extern int column_highlighting;
@@ -1661,21 +1701,21 @@
indent -= TAB_SIZE;
}
}
- while (indent--)
+ while (indent-- > 0)
edit_insert (edit, ' ');
}
-static void edit_auto_indent (WEdit * edit, int always)
+void edit_auto_indent (WEdit * edit, int extra, int no_advance)
{
long p;
int indent;
p = edit->curs1;
- while (strchr ("\t\n\r ", edit_get_byte (edit, p - 1)) && p > 0) /* move back/up to a line with text */
+ while (isspace (edit_get_byte (edit, p - 1)) && p > 0) /* move back/up to a line with text */
p--;
indent = edit_indent_width (edit, edit_bol (edit, p));
- if (edit->curs_col < indent)
+ if (edit->curs_col < indent && no_advance)
indent = edit->curs_col;
- edit_insert_indent (edit, indent);
+ edit_insert_indent (edit, indent + (option_fake_half_tabs ? HALF_TAB_SIZE : TAB_SIZE) * space_width * extra);
}
static void edit_double_newline (WEdit * edit)
@@ -1930,6 +1970,7 @@
edit->prev_col = edit_get_col (edit);
edit->search_start = edit->curs1;
edit_find_bracket (edit);
+ edit_check_spelling (edit);
return 1;
}
switch (command) {
@@ -2004,11 +2045,11 @@
if (option_auto_para_formatting) {
edit_double_newline (edit);
if (option_return_does_auto_indent)
- edit_auto_indent (edit, 0);
+ edit_auto_indent (edit, 0, 1);
format_paragraph (edit, 0);
} else if (option_return_does_auto_indent) {
edit_insert (edit, '\n');
- edit_auto_indent (edit, 0);
+ edit_auto_indent (edit, 0, 1);
} else {
edit_insert (edit, '\n');
}
@@ -2264,9 +2305,12 @@
break;
case CK_Date:{
+ char s[1024];
+
time_t t;
time (&t);
- edit_printf (edit, ctime (&t));
+ strftime (s, 1024, "%c", localtime (&t));
+ edit_printf (edit, s);
edit->force |= REDRAW_PAGE;
break;
}
@@ -2294,6 +2338,7 @@
case CK_Sort:
case CK_Mail:
case CK_Find_File:
+ case CK_Ctags:
#endif
case CK_Complete:
case CK_Cancel:
@@ -2332,18 +2377,24 @@
/* CK_Pipe_Block */
if ((command / 1000) == 1) /* a shell command */
edit_block_process_cmd (edit, shell_cmd[command - 1000], 1);
-#else
- if ((command / 1000) == 1) /* a user defined command */
- if (user_commamd)
- (*user_commamd) (edit, command - 1000);
-#endif
-
if (command > CK_Macro (0) && command <= CK_Last_Macro) { /* a macro command */
struct macro m[MAX_MACRO_LENGTH];
int nm;
if ((result = edit_load_macro_cmd (edit, m, &nm, command - 2000)))
edit_execute_macro (edit, m, nm);
}
+#else
+ if (IS_USER_COMMAND (command)) /* a user defined command */
+ if (user_commamd)
+ (*user_commamd) (edit, command & 0xFFFF);
+ if (IS_MACRO_COMMAND (command)) { /* a macro command */
+ struct macro m[MAX_MACRO_LENGTH];
+ int nm;
+ if ((result = edit_load_macro_cmd (edit, m, &nm, command & 0xFFFF)))
+ edit_execute_macro (edit, m, nm);
+ }
+#endif
+
/* keys which must set the col position, and the search vars */
switch (command) {
case CK_Find:
@@ -2376,6 +2427,7 @@
edit->search_start = edit->curs1;
edit->found_len = 0;
edit_find_bracket (edit);
+ edit_check_spelling (edit);
return 1;
break;
default:
@@ -2384,6 +2436,7 @@
edit->search_start = edit->curs1;
}
edit_find_bracket (edit);
+ edit_check_spelling (edit);
if (option_auto_para_formatting) {
switch (command) {
diff -ruN old/mc-4.5.37/gtkedit/edit.h new/mc-4.5.38/gtkedit/edit.h
--- old/mc-4.5.37/gtkedit/edit.h Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/edit.h Thu Sep 2 12:49:39 1999
@@ -36,6 +36,8 @@
# include
# endif
# include
+# include
+# include
# include "src/tty.h"
# include
# include
@@ -61,6 +63,8 @@
#else
# include
#endif
+# include
+# include
# include
# ifdef HAVE_FCNTL_H
@@ -81,11 +85,7 @@
# endif
# endif
-#ifdef GTK
-# include
-#else
# include "regex.h"
-#endif
#endif
@@ -274,55 +274,58 @@
int len;
};
+struct syntax_rule {
+ unsigned short keyword;
+ unsigned char end;
+ unsigned char context;
+ unsigned char _context;
+#define RULE_ON_LEFT_BORDER 1
+#define RULE_ON_RIGHT_BORDER 2
+ unsigned char border;
+};
-#define RULE_CONTEXT 0x00FFF000UL
-#define RULE_CONTEXT_SHIFT 12
-#define RULE_WORD 0x00000FFFUL
-#define RULE_WORD_SHIFT 0
-#define RULE_ON_LEFT_BORDER 0x02000000UL
-#define RULE_ON_RIGHT_BORDER 0x01000000UL
+#define MAX_WORDS_PER_CONTEXT 1024
+#define MAX_CONTEXTS 128
struct key_word {
char *keyword;
- char first;
- char last;
+ unsigned char first;
char *whole_word_chars_left;
char *whole_word_chars_right;
-#define NO_COLOR 0xFFFFFFFF
+ time_t time;
+#define NO_COLOR 0x7FFFFFFF
+#define SPELLING_ERROR 0x7EFEFEFE
int line_start;
int bg;
int fg;
};
struct context_rule {
- int rule_number;
char *left;
- char first_left;
- char last_left;
- char line_start_left;
+ unsigned char first_left;
char *right;
- char first_right;
- char last_right;
+ unsigned char first_right;
+ char line_start_left;
char line_start_right;
int single_char;
int between_delimiters;
char *whole_word_chars_left;
char *whole_word_chars_right;
char *keyword_first_chars;
- char *keyword_last_chars;
+ int spelling;
/* first word is word[1] */
struct key_word **keyword;
};
struct _syntax_marker {
long offset;
- unsigned long rule;
+ struct syntax_rule rule;
struct _syntax_marker *next;
};
struct _book_mark {
int line; /* line number */
-#define BOOK_MARK_COLOR ((5 << 8) + 26) /* cyan on white */
+#define BOOK_MARK_COLOR ((0 << 8) | 26) /* black on white */
int c; /* colour */
struct _book_mark *next;
struct _book_mark *prev;
@@ -349,7 +352,7 @@
char *filename; /* Name of the file */
char *dir; /* current directory */
-/* dynamic buffers and curser position for editor: */
+/* dynamic buffers and cursor position for editor: */
long curs1; /*position of the cursor from the beginning of the file. */
long curs2; /*position from the end of the file */
unsigned char *buffers1[MAXBUFF + 1]; /*all data up to curs1 */
@@ -365,7 +368,7 @@
long start_display; /* First char displayed */
long start_col; /* First displayed column, negative */
long max_column; /* The maximum cursor position ever reached used to calc hori scroll bar */
- long curs_row; /*row position of curser on the screen */
+ long curs_row; /*row position of cursor on the screen */
long curs_col; /*column position on screen */
int force; /* how much of the screen do we redraw? */
unsigned char overwrite;
@@ -377,7 +380,7 @@
or saved */
#endif
unsigned char highlight;
- long prev_col; /*recent column position of the curser - used when moving
+ long prev_col; /*recent column position of the cursor - used when moving
up or down past lines that are shorter than the current line */
long curs_line; /*line number of the cursor. */
long start_line; /*line nummber of the top of the page */
@@ -410,7 +413,7 @@
struct _syntax_marker *syntax_marker;
struct context_rule **rules;
long last_get_rule;
- unsigned long rule;
+ struct syntax_rule rule;
char *syntax_type; /* description of syntax highlighting type being used */
int explicit_syntax; /* have we forced the syntax hi. type in spite of the filename? */
@@ -547,8 +550,8 @@
unsigned char *edit_get_block (WEdit * edit, long start, long finish, int *l);
int edit_sort_cmd (WEdit * edit);
void edit_help_cmd (WEdit * edit);
-void edit_left_word_move (WEdit * edit);
-void edit_right_word_move (WEdit * edit);
+void edit_left_word_move (WEdit * edit, int s);
+void edit_right_word_move (WEdit * edit, int s);
void edit_get_selection (WEdit * edit);
int edit_save_macro_cmd (WEdit * edit, struct macro macro[], int n);
@@ -572,13 +575,14 @@
void edit_load_syntax (WEdit * edit, char **names, char *type);
void edit_free_syntax_rules (WEdit * edit);
void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg);
+int edit_check_spelling (WEdit * edit);
void book_mark_insert (WEdit * edit, int line, int c);
int book_mark_query_color (WEdit * edit, int line, int c);
int book_mark_query_all (WEdit * edit, int line, int *c);
struct _book_mark *book_mark_find (WEdit * edit, int line);
-void book_mark_clear (WEdit * edit, int line, int c);
+int book_mark_clear (WEdit * edit, int line, int c);
void book_mark_flush (WEdit * edit, int c);
void book_mark_inc (WEdit * edit, int line);
void book_mark_dec (WEdit * edit, int line);
@@ -666,6 +670,9 @@
# define FONT_PIX_PER_LINE (FONT_OVERHEAD + FONT_HEIGHT)
# define FONT_MEAN_WIDTH gtk_edit_option_font_mean_width
+# define EDIT_FRAME_H 3
+# define EDIT_FRAME_W 3
+
# define FONT_OFFSET_X 0
# define FONT_OFFSET_Y FONT_BASE_LINE
@@ -772,7 +779,7 @@
extern char *home_dir;
-#define NUM_SELECTION_HISTORY 32
+#define NUM_SELECTION_HISTORY 64
#ifndef MAX_PATH_LEN
#ifdef PATH_MAX
@@ -841,7 +848,7 @@
int option_editor_fg_cursor = 18;
char *option_whole_chars_search = "0123456789abcdefghijklmnopqrstuvwxyz_";
-char *option_whole_chars_move = "0123456789abcdefghijklmnopqrstuvwxyz_; ,[](){}";
+char *option_chars_move_whole_word = "!=&|<>^~ !:;, !'!`!.?!\"!( !) !Aa0 !+-*/= |<> ![ !] !\\#! ";
char *option_backup_ext = "~";
#else /* ! _EDIT_C */
@@ -889,7 +896,7 @@
extern int option_editor_fg_cursor;
extern char *option_whole_chars_search;
-extern char *option_whole_chars_move;
+extern char *option_chars_move_whole_word;
extern char *option_backup_ext;
extern int edit_confirm_save;
diff -ruN old/mc-4.5.37/gtkedit/editcmd.c new/mc-4.5.38/gtkedit/editcmd.c
--- old/mc-4.5.37/gtkedit/editcmd.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/editcmd.c Thu Sep 2 12:49:39 1999
@@ -63,7 +63,7 @@
static inline int my_lower_case (int c)
{
- return tolower(c);
+ return tolower(c & 0xFF);
}
char *strcasechr (const unsigned char *s, int c)
@@ -76,6 +76,8 @@
#ifdef MIDNIGHT
#include "../src/mad.h"
+#elif !defined (GTK)
+#include "mad.h"
#endif
#ifndef HAVE_MEMMOVE
@@ -257,13 +259,12 @@
if (this_save_mode > 0) {
char *savedir = ".", *slashpos = strrchr (filename, '/');
if (slashpos != 0) {
- savedir = strdup (filename);
+ savedir = (char *) strdup (filename);
if (savedir == 0)
return 0;
savedir[slashpos - filename + 1] = '\0';
}
- savename = tempnam (savedir, "cooledit");
-
+ savename = (char *) tempnam (savedir, "cooledit");
if (slashpos)
free (savedir);
if (!savename)
@@ -336,13 +337,13 @@
N_("Do backups -->")};
static QuickWidget widgets[] =
{
- {quick_button, 20, DLG_X, 7, DLG_Y, N_("&Cancel"), 0,
+ {quick_button, 18, DLG_X, 7, DLG_Y, N_("&Cancel"), 0,
B_CANCEL, 0, 0, XV_WLAY_DONTCARE, "c"},
{quick_button, 6, DLG_X, 7, DLG_Y, N_("&Ok"), 0,
B_ENTER, 0, 0, XV_WLAY_DONTCARE, "o"},
- {quick_input, 24, DLG_X, 5, DLG_Y, 0, 10,
+ {quick_input, 23, DLG_X, 5, DLG_Y, 0, 9,
0, 0, &str_result, XV_WLAY_DONTCARE, "i"},
- {quick_label, 24, DLG_X, 4, DLG_Y, N_("Extension:"), 0,
+ {quick_label, 22, DLG_X, 4, DLG_Y, N_("Extension:"), 0,
0, 0, 0, XV_WLAY_DONTCARE, "savemext"},
{quick_radio, 4, DLG_X, 3, DLG_Y, "", 3,
0, &save_mode_new, str, XV_WLAY_DONTCARE, "t"},
@@ -380,10 +381,10 @@
{
if (edit->filename)
free (edit->filename);
- edit->filename = strdup (f);
+ edit->filename = (char *) strdup (f);
if (edit->dir)
free (edit->dir);
- edit->dir = strdup ("");
+ edit->dir = (char *) strdup ("");
}
#else
@@ -456,9 +457,9 @@
if (edit->dir)
free (edit->dir);
p = strrchr (exp, '/');
- edit->filename = strdup (++p);
+ edit->filename = (char *) strdup (++p);
*p = 0;
- edit->dir = strdup (exp);
+ edit->dir = (char *) strdup (exp);
free (exp);
}
@@ -475,11 +476,11 @@
exp = edit_get_save_file (edit->dir, edit->filename, _(" Save As "));
edit_push_action (edit, KEY_PRESS + edit->start_display);
- edit->force |= REDRAW_COMPLETELY;
if (exp) {
if (!*exp) {
free (exp);
+ edit->force |= REDRAW_COMPLETELY;
return 0;
} else {
if (strcmp(catstrs (edit->dir, edit->filename, 0), exp)) {
@@ -490,8 +491,10 @@
if (edit_query_dialog2 (_(" Warning "),
_(" A file already exists with this name. "),
/* Push buttons to over-write the current file, or cancel the operation */
- _("Overwrite"), _("Cancel")))
+ _("Overwrite"), _("Cancel"))) {
+ edit->force |= REDRAW_COMPLETELY;
return 0;
+ }
}
}
if (edit_save_file (edit, exp)) {
@@ -503,15 +506,18 @@
#endif
if (different_filename && !edit->explicit_syntax)
edit_load_syntax (edit, 0, 0);
+ edit->force |= REDRAW_COMPLETELY;
return 1;
} else {
free (exp);
edit_error_dialog (_(" Save as "), get_sys_error (_(" Error trying to save file. ")));
+ edit->force |= REDRAW_COMPLETELY;
return 0;
}
}
- } else
- return 0;
+ }
+ edit->force |= REDRAW_COMPLETELY;
+ return 0;
}
/* {{{ Macro stuff starts here */
@@ -670,12 +676,12 @@
FILE *f;
int s, i;
- edit->force |= REDRAW_COMPLETELY;
edit_push_action (edit, KEY_PRESS + edit->start_display);
/* This heads the 'Macro' dialog box */
s = edit_raw_key_query (_(" Macro "),
/* Input line for a single key press follows the ':' */
_(" Press the macro's new hotkey: "), 1);
+ edit->force |= REDRAW_COMPLETELY;
if (s) {
if (edit_delete_macro (edit, s))
return 0;
@@ -703,23 +709,23 @@
int command;
#ifdef MIDNIGHT
- command = CK_Macro (edit_raw_key_query (_(" Delete Macro "), _(" Press macro hotkey: "), 1));
+ command = CK_Macro (edit_raw_key_query (_ (" Delete Macro "), _ (" Press macro hotkey: "), 1));
#else
/* This heads the 'Delete Macro' dialog box */
#ifdef GTK
/* *** */
command = 0;
#else
- command = CK_Macro (CKeySymMod (CRawkeyQuery (0, 0, 0, _(" Delete Macro "),
+ command = CKeySymMod (CRawkeyQuery (0, 0, 0, _ (" Delete Macro "),
/* Input line for a single key press follows the ':' */
- _(" Press macro hotkey: "))));
+ _ (" Press macro hotkey: ")));
#endif
#endif
- if (command == CK_Macro (0))
+ if (!command)
return;
- edit_delete_macro (edit, command - 2000);
+ edit_delete_macro (edit, command);
}
/* return 0 on error */
@@ -789,9 +795,9 @@
/* returns 1 on success */
int edit_save_cmd (WEdit * edit)
{
- edit->force |= REDRAW_COMPLETELY;
if (!edit_save_file (edit, catstrs (edit->dir, edit->filename, 0)))
return edit_save_as_cmd (edit);
+ edit->force |= REDRAW_COMPLETELY;
edit->modified = 0;
#if defined(MIDNIGHT) || defined(GTK)
edit->delete_file = 0;
@@ -804,10 +810,13 @@
/* returns 1 on success */
int edit_new_cmd (WEdit * edit)
{
- edit->force |= REDRAW_COMPLETELY;
- if (edit->modified)
- if (edit_query_dialog2 (_ (" Warning "), _ (" Current text was modified without a file save. \n Continue discards these changes. "), _ ("Continue"), _ ("Cancel")))
+ if (edit->modified) {
+ if (edit_query_dialog2 (_ (" Warning "), _ (" Current text was modified without a file save. \n Continue discards these changes. "), _ ("Continue"), _ ("Cancel"))) {
+ edit->force |= REDRAW_COMPLETELY;
return 0;
+ }
+ }
+ edit->force |= REDRAW_COMPLETELY;
edit->modified = 0;
return edit_renew (edit); /* if this gives an error, something has really screwed up */
}
@@ -833,11 +842,13 @@
int edit_load_cmd (WEdit * edit)
{
char *exp;
- edit->force |= REDRAW_COMPLETELY;
- if (edit->modified)
- if (edit_query_dialog2 (_ (" Warning "), _ (" Current text was modified without a file save. \n Continue discards these changes. "), _ ("Continue"), _ ("Cancel")))
+ if (edit->modified) {
+ if (edit_query_dialog2 (_ (" Warning "), _ (" Current text was modified without a file save. \n Continue discards these changes. "), _ ("Continue"), _ ("Cancel"))) {
+ edit->force |= REDRAW_COMPLETELY;
return 0;
+ }
+ }
exp = edit_get_load_file (edit->dir, edit->filename, _ (" Load "));
@@ -846,6 +857,7 @@
edit_load_file_from_filename (edit, exp);
free (exp);
}
+ edit->force |= REDRAW_COMPLETELY;
return 0;
}
@@ -1122,10 +1134,11 @@
#define SEARCH_DLG_HEIGHT 10
#define REPLACE_DLG_WIDTH 58
#define REPLACE_DLG_HEIGHT 15
-#define CONFIRM_DLG_WIDTH 66
+#define CONFIRM_DLG_WIDTH 79
#define CONFIRM_DLG_HEIGTH 6
#define B_REPLACE_ALL B_USER+1
-#define B_SKIP_REPLACE B_USER+2
+#define B_REPLACE_ONE B_USER+2
+#define B_SKIP_REPLACE B_USER+3
int edit_replace_prompt (WEdit * edit, char *replace_text, int xpos, int ypos)
{
@@ -1133,23 +1146,25 @@
QuickWidget quick_widgets[] =
{
/* NLS for hotkeys? */
- {quick_button, 50, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("&Cancel"),
- 0, B_CANCEL, 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 37, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("al&L"),
- 0, B_REPLACE_ALL, 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 21, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("&Skip"),
- 0, B_SKIP_REPLACE, 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 4, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("&Replace"),
- 0, B_ENTER, 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_label, 2, CONFIRM_DLG_WIDTH, 2, CONFIRM_DLG_HEIGTH, 0,
+ {quick_button, 63, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("&Cancel"),
+ 0, B_CANCEL, 0, 0, XV_WLAY_DONTCARE, NULL},
+ {quick_button, 50, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("o&Ne"),
+ 0, B_REPLACE_ONE, 0, 0, XV_WLAY_DONTCARE, NULL},
+ {quick_button, 37, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("al&L"),
+ 0, B_REPLACE_ALL, 0, 0, XV_WLAY_DONTCARE, NULL},
+ {quick_button, 21, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("&Skip"),
+ 0, B_SKIP_REPLACE, 0, 0, XV_WLAY_DONTCARE, NULL},
+ {quick_button, 4, CONFIRM_DLG_WIDTH, 3, CONFIRM_DLG_HEIGTH, N_("&Replace"),
+ 0, B_ENTER, 0, 0, XV_WLAY_DONTCARE, NULL},
+ {quick_label, 2, CONFIRM_DLG_WIDTH, 2, CONFIRM_DLG_HEIGTH, 0,
0, 0, 0, XV_WLAY_DONTCARE, 0},
{0}};
- quick_widgets[4].text = catstrs (_(" Replace with: "), replace_text, 0);
+ quick_widgets[5].text = catstrs (_(" Replace with: "), replace_text, 0);
{
QuickDialog Quick_input =
- {CONFIRM_DLG_WIDTH, CONFIRM_DLG_HEIGTH, 0, 0, N_(" Confirm replace "),
+ {CONFIRM_DLG_WIDTH, CONFIRM_DLG_HEIGTH, 0, 0, N_(" Confirm replace "),
"[Input Line Keys]", "quick_input", 0 /*quick_widgets */ };
Quick_input.widgets = quick_widgets;
@@ -1162,8 +1177,6 @@
return 0;
}
-
-
void edit_replace_dialog (WEdit * edit, char **search_text, char **replace_text, char **arg_order)
{
int treplace_scanf = replace_scanf;
@@ -1319,7 +1332,8 @@
#define B_ENTER 0
#define B_SKIP_REPLACE 1
#define B_REPLACE_ALL 2
-#define B_CANCEL 3
+#define B_REPLACE_ONE 3
+#define B_CANCEL 4
extern CWidget *wedit;
@@ -1346,22 +1360,22 @@
(CDrawText ("replace.t1", win, xh, h, _(" Enter search text : ")))->hotkey = 'E';
CGetHintPos (0, &yh);
- (m = CDrawTextInput ("replace.sinp", win, xh, yh, 10, AUTO_HEIGHT, 256, *search_text))->hotkey = 'E';
+ (m = CDrawTextInput ("replace.sinp", win, xh, yh, 10, AUTO_HEIGHT, 8192, *search_text))->hotkey = 'E';
if (replace_text) {
CGetHintPos (0, &yh);
(CDrawText ("replace.t2", win, xh, yh, _(" Enter replace text : ")))->hotkey = 'n';
CGetHintPos (0, &yh);
- (CDrawTextInput ("replace.rinp", win, xh, yh, 10, AUTO_HEIGHT, 256, *replace_text))->hotkey = 'n';
- CSetToolHint ("replace.t2", _("You can enter regexp substrings with %s (not \\1, \\2 like sed) then use \"Enter...order\""));
- CSetToolHint ("replace.rinp", _("You can enter regexp substrings with %s (not \\1, \\2 like sed) then use \"Enter...order\""));
+ (CDrawTextInput ("replace.rinp", win, xh, yh, 10, AUTO_HEIGHT, 8192, *replace_text))->hotkey = 'n';
+ CSetToolHint ("replace.t2", _("You can enter regexp substrings with %s\n(not \\1, \\2 like sed) then use \"Enter...order\""));
+ CSetToolHint ("replace.rinp", _("You can enter regexp substrings with %s\n(not \\1, \\2 like sed) then use \"Enter...order\""));
CGetHintPos (0, &yh);
(CDrawText ("replace.t3", win, xh, yh, _(" Enter argument (or substring) order : ")))->hotkey = 'o';
CGetHintPos (0, &yh);
(CDrawTextInput ("replace.ainp", win, xh, yh, 10, AUTO_HEIGHT, 256, *arg_order))->hotkey = 'o';
/* Tool hint */
- CSetToolHint ("replace.ainp", _("Enter the order of replacement of your scanf format specifiers or regexp substrings"));
- CSetToolHint ("replace.t3", _("Enter the order of replacement of your scanf format specifiers or regexp substrings"));
+ CSetToolHint ("replace.ainp", _("Enter the order of replacement of your scanf\nformat specifiers or regexp substrings, eg 3,1,2"));
+ CSetToolHint ("replace.t3", _("Enter the order of replacement of your scanf\nformat specifiers or regexp substrings, eg 3,1,2"));
}
CGetHintPos (0, &yh);
ys = yh;
@@ -1372,8 +1386,8 @@
yc = yh;
CGetHintPos (0, &yh);
CDrawSwitch ("replace.reg", win, xh, yh, replace_regexp, _(" Regular expression "), 1);
- CSetToolHint ("replace.reg", _("See the regex man page for how to compose a regular expression"));
- CSetToolHint ("replace.reg.label", _("See the regex man page for how to compose a regular expression"));
+ CSetToolHint ("replace.reg", _("See the regex man page for how\nto compose a regular expression"));
+ CSetToolHint ("replace.reg.label", _("See the regex man page for how\nto compose a regular expression"));
yb = yh;
CGetHintPos (0, &yh);
CGetHintPos (&xb, 0);
@@ -1404,7 +1418,7 @@
}
CDrawSwitch ("replace.scanf", win, xb, yr, replace_scanf, _(" Scanf expression "), 1);
/* Tool hint */
- CSetToolHint ("replace.scanf", _("Allows entering of a C format string, see the scanf man page"));
+ CSetToolHint ("replace.scanf", _("Allows entering of a C format string,\nsee the scanf man page"));
get_hint_limits (&x, &y);
CDrawPixmapButton ("replace.ok", win, x - WIDGET_SPACING - TICK_BUTTON_WIDTH, h, PIXMAP_BUTTON_TICK);
@@ -1446,10 +1460,10 @@
if (replace_text) {
replace_all = CIdent ("replace.all")->keypressed;
replace_prompt = CIdent ("replace.pr")->keypressed;
- *replace_text = strdup (CIdent ("replace.rinp")->text);
- *arg_order = strdup (CIdent ("replace.ainp")->text);
+ *replace_text = (char *) strdup (CIdent ("replace.rinp")->text);
+ *arg_order = (char *) strdup (CIdent ("replace.ainp")->text);
}
- *search_text = strdup (CIdent ("replace.sinp")->text);
+ *search_text = (char *) strdup (CIdent ("replace.sinp")->text);
replace_whole = CIdent ("replace.ww")->keypressed;
replace_case = CIdent ("replace.case")->keypressed;
replace_scanf = CIdent ("replace.scanf")->keypressed;
@@ -1539,15 +1553,17 @@
char *s;
s = gtk_dialog_cauldron (
"Replace", GTK_CAULDRON_TOPLEVEL | GTK_CAULDRON_GRAB,
- " ( (Replace with:)d %Ld )xf / ( %Bxfrq || %Bxfq || %Bxfq || %Bxfgq )f",
+ " ( (Replace with:)d %Ld )xf / ( %Bxfrq || %Bxfq || %Bxfq || %Bxfq || %Bxfgq )f",
replace_text,
- "Replace", "Skip", "Replace All",
+ "Replace", "Skip", "Replace all", "Replace one",
GNOME_STOCK_BUTTON_CANCEL
);
if (s == GTK_CAULDRON_ESCAPE || !s || s == GNOME_STOCK_BUTTON_CANCEL)
return B_CANCEL;
- if (!strcmp (s, "Replace All"))
+ if (!strcmp (s, "Replace all"))
return B_REPLACE_ALL;
+ if (!strcmp (s, "Replace one"))
+ return B_REPLACE_ONE;
if (!strcmp (s, "Skip"))
return B_SKIP_REPLACE;
if (!strcmp (s, "Replace"))
@@ -1561,34 +1577,14 @@
int edit_replace_prompt (WEdit * edit, char *replace_text, int xpos, int ypos)
{
if (replace_prompt) {
- int q;
- char *p, *r = 0;
- r = p = malloc (strlen (replace_text) + NUM_REPL_ARGS * 2);
- strcpy (p, replace_text);
- while ((p = strchr (p, '%'))) { /* convert "%" to "%%" so no convertion is attempted */
- memmove (p + 2, p + 1, strlen (p) + 1);
- *(++p) = '%';
- p++;
- }
+ int q, x[] =
+ {
+ B_CANCEL, B_ENTER, B_SKIP_REPLACE, B_REPLACE_ALL, B_REPLACE_ONE, B_CANCEL
+ };
+ q = CQueryDialog (WIN_MESSAGES + (edit->curs_line < 8 ? edit->num_widget_lines / 2 * FONT_PIX_PER_LINE + CYof (edit->widget) : 0),
+ _ (" Replace "), catstrs (_ (" Replace with: "), replace_text, 0), _ ("Replace"), _ ("Skip"), _ ("Replace all"), _ ("Replace one"), _ ("Cancel"), 0);
edit->force |= REDRAW_COMPLETELY;
- q = edit_query_dialog4 (_(" Replace "),
-/* This is for the confirm replace dialog box. The replaced string comes after the ':' */
- catstrs (_(" Replace with: "), r, 0),
-/* Buttons for the confirm replace dialog box. */
- _("Replace"), _("Skip"), _("Replace all"), _("Cancel"));
- if (r)
- free (r);
- switch (q) {
- case 0:
- return B_ENTER;
- case 1:
- return B_SKIP_REPLACE;
- case 2:
- return B_REPLACE_ALL;
- case -1:
- case 3:
- return B_CANCEL;
- }
+ return x[q + 1];
}
return 0;
}
@@ -1634,7 +1630,7 @@
*found_len = 0;
return -3;
}
- old_pattern = strdup (pattern);
+ old_pattern = (char *) strdup (pattern);
old_type = match_type;
old_icase = icase;
}
@@ -1994,9 +1990,9 @@
if (again) {
if (!old1 || !old2)
return;
- exp1 = strdup (old1);
- exp2 = strdup (old2);
- exp3 = strdup (old3);
+ exp1 = (char *) strdup (old1);
+ exp2 = (char *) strdup (old2);
+ exp3 = (char *) strdup (old3);
} else {
edit_push_action (edit, KEY_PRESS + edit->start_display);
edit_replace_dialog (edit, &exp1, &exp2, &exp3);
@@ -2017,9 +2013,9 @@
free (old2);
if (old3)
free (old3);
- old1 = strdup (exp1);
- old2 = strdup (exp2);
- old3 = strdup (exp3);
+ old1 = (char *) strdup (exp1);
+ old2 = (char *) strdup (exp2);
+ old3 = (char *) strdup (exp3);
{
char *s;
@@ -2084,7 +2080,7 @@
edit_push_key_press (edit);
switch (edit_replace_prompt (edit, exp2, /*and prompt 2/3 down */
- edit->num_widget_columns / 2 - 33, edit->num_widget_lines * 2 / 3)) {
+ edit->num_widget_columns / 2 - 39, edit->num_widget_lines * 2 / 3)) {
case B_ENTER:
break;
case B_SKIP_REPLACE:
@@ -2094,6 +2090,9 @@
replace_prompt = 0;
replace_continue = 1;
break;
+ case B_REPLACE_ONE:
+ replace_continue = 0;
+ break;
case B_CANCEL:
replace_yes = 0;
replace_continue = 0;
@@ -2187,7 +2186,7 @@
if (again) { /*ctrl-hotkey for search again. */
if (!old)
return;
- exp = strdup (old);
+ exp = (char *) strdup (old);
} else {
edit_search_dialog (edit, &exp);
edit_push_action (edit, KEY_PRESS + edit->start_display);
@@ -2198,7 +2197,7 @@
int len = 0;
if (old)
free (old);
- old = strdup (exp);
+ old = (char *) strdup (exp);
if (edit->found_len && edit->search_start == edit->found_start + 1 && replace_backwards)
edit->search_start--;
@@ -2248,8 +2247,8 @@
if (edit->modified) {
#ifdef GTK
char *r;
- r = gtk_dialog_cauldron (_(" Quit "), GTK_CAULDRON_TOPLEVEL | GTK_CAULDRON_GRAB, " [ ( %Lxf )xf ]xf / ( %Bgxfq || %Bgxfq || %Bgxfq ) ",
- _(" Current text was modified without a file save. \n Save with exit? "), GNOME_STOCK_BUTTON_CANCEL, GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO);
+ r = gtk_dialog_cauldron (_ (" Quit "), GTK_CAULDRON_TOPLEVEL | GTK_CAULDRON_GRAB, " [ ( %Lxf )xf ]xf / ( %Bgxfq || %Bgxfq || %Bgxfq ) ",
+ _ (" Current text was modified without a file save. \n Save with exit? "), GNOME_STOCK_BUTTON_CANCEL, GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO);
if (!strcmp (r, GNOME_STOCK_BUTTON_YES)) {
edit_push_markers (edit);
edit_set_markers (edit, 0, 0, 0, 0);
@@ -2263,11 +2262,11 @@
}
#else
#ifdef MIDNIGHT
- switch (edit_query_dialog3 (_(" Quit "), _(" File was modified, Save with exit? "), _("Cancel quit"), _("&Yes"), _("&No"))) {
+ switch (edit_query_dialog3 (_ (" Quit "), _ (" File was modified, Save with exit? "), _ ("Cancel quit"), _ ("&Yes"), _ ("&No"))) {
#else
/* Confirm 'Quit' dialog box */
- switch (edit_query_dialog3 (_(" Quit "),
- _(" Current text was modified without a file save. \n Save with exit? "), _(" &Cancel quit "), _(" &Yes "), _(" &No "))) {
+ switch (edit_query_dialog3 (_ (" Quit "),
+ _ (" Current text was modified without a file save. \n Save with exit? "), _ (" &Cancel quit "), _ (" &Yes "), _ (" &No "))) {
#endif
case 1:
edit_push_markers (edit);
@@ -2296,10 +2295,10 @@
#else
#ifdef GTK
{
- extern char *edit_one_file;
+ extern char *edit_one_file;
- if (edit_one_file)
- gtk_main_quit ();
+ if (edit_one_file)
+ gtk_main_quit ();
}
#endif
edit->stopped = 1;
@@ -2405,13 +2404,42 @@
int c, j;
for (j = 0; j < s[line].len; j++) {
c = *p++;
- if ((c < ' ' || (c > '~' && c < 160)) && c != '\t') {
- t[i++] = '.';
+ if (!isprint (c)) {
+ t[i++] = '_';
t[i++] = '\b';
- t[i++] = '.';
+ t[i++] = '\\';
+ t[i++] = '_';
+ t[i++] = '\b';
+ switch (c) {
+ case '\a':
+ t[i++] = 'a';
+ break;
+ case '\b':
+ t[i++] = 'b';
+ break;
+ case '\t':
+ t[i++] = 't';
+ break;
+ case '\n':
+ t[i++] = 'n';
+ break;
+ case '\v':
+ t[i++] = 'v';
+ break;
+ case '\f':
+ t[i++] = 'f';
+ break;
+ case '\r':
+ t[i++] = 'r';
+ break;
+ default:
+ i -= 3;
+ t[i++] = '.';
+ break;
+ }
} else
t[i++] = c;
- if (i > 1020)
+ if (i > 1000)
break;
}
}
@@ -2523,8 +2551,8 @@
#endif
else
#ifdef GTK
- gtk_selection_convert (GTK_WIDGET (edit->widget), GDK_SELECTION_PRIMARY,
- gdk_atom_intern ("COMPOUND_TEXT", FALSE), GDK_CURRENT_TIME);
+ gtk_selection_convert (GTK_WIDGET (edit->widget), GDK_SELECTION_PRIMARY,
+ gdk_atom_intern ("COMPOUND_TEXT", FALSE), GDK_CURRENT_TIME);
#else
XConvertSelection (CDisplay, XA_PRIMARY, XA_STRING,
XInternAtom (CDisplay, "VT_SELECTION", False),
@@ -2589,7 +2617,7 @@
char s [12];
sprintf (s, "%d", l);
- f = input_dialog (_(" Goto line "), _(" Enter line: "), l ? s : "");
+ f = (char *) input_dialog (_(" Goto line "), _(" Enter line: "), l ? s : "");
#endif
#else
f = CInputDialog ("goto", WIN_MESSAGES, 150, l ? itoa (l) : "", _(" Goto line "), _(" Enter line: "));
@@ -2607,17 +2635,14 @@
}
/*returns 1 on success */
-int edit_save_block_cmd (WEdit * edit) {
+int edit_save_block_cmd (WEdit * edit)
+{
long start_mark, end_mark;
char *exp;
if (eval_marks (edit, &start_mark, &end_mark))
return 1;
-
- exp = edit_get_save_file (edit->dir, catstrs (home_dir, CLIP_FILE, 0), _(" Save Block "));
-
- edit->force |= REDRAW_COMPLETELY;
+ exp = edit_get_save_file (edit->dir, catstrs (home_dir, CLIP_FILE, 0), _ (" Save Block "));
edit_push_action (edit, KEY_PRESS + edit->start_display);
-
if (exp) {
if (!*exp) {
free (exp);
@@ -2629,13 +2654,14 @@
return 1;
} else {
free (exp);
+ edit_error_dialog (_ (" Save Block "), get_sys_error (_ (" Error trying to save file. ")));
edit->force |= REDRAW_COMPLETELY;
- edit_error_dialog (_(" Save Block "), get_sys_error (_(" Error trying to save file. ")));
return 0;
}
}
- } else
- return 0;
+ }
+ edit->force |= REDRAW_COMPLETELY;
+ return 0;
}
@@ -2663,12 +2689,10 @@
/* returns 1 on success */
-int edit_insert_file_cmd (WEdit * edit) {
- char *exp = edit_get_load_file (edit->dir, catstrs (home_dir, CLIP_FILE, 0), _(" Insert File "));
- edit->force |= REDRAW_COMPLETELY;
-
+int edit_insert_file_cmd (WEdit * edit)
+{
+ char *exp = edit_get_load_file (edit->dir, catstrs (home_dir, CLIP_FILE, 0), _ (" Insert File "));
edit_push_action (edit, KEY_PRESS + edit->start_display);
-
if (exp) {
if (!*exp) {
free (exp);
@@ -2676,15 +2700,18 @@
} else {
if (edit_insert_file (edit, exp)) {
free (exp);
+ edit->force |= REDRAW_COMPLETELY;
return 1;
} else {
free (exp);
- edit_error_dialog (_(" Insert file "), get_sys_error (_(" Error trying to insert file. ")));
+ edit_error_dialog (_ (" Insert file "), get_sys_error (_ (" Error trying to insert file. ")));
+ edit->force |= REDRAW_COMPLETELY;
return 0;
}
}
- } else
- return 0;
+ }
+ edit->force |= REDRAW_COMPLETELY;
+ return 0;
}
#ifdef MIDNIGHT
@@ -2784,6 +2811,7 @@
edit_error_dialog (_(" Process block "),
/* Not essential to translate */
get_sys_error (_(" Error trying to stat file ")));
+ edit->force |= REDRAW_COMPLETELY;
return;
}
}
diff -ruN old/mc-4.5.37/gtkedit/editcmddef.h new/mc-4.5.38/gtkedit/editcmddef.h
--- old/mc-4.5.37/gtkedit/editcmddef.h Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/editcmddef.h Thu Sep 2 12:49:39 1999
@@ -87,6 +87,7 @@
#define CK_Util 417
#define CK_Type_Load_Python 418
#define CK_Find_File 419
+#define CK_Ctags 420
/* application control */
#define CK_Save_Desktop 451
@@ -136,7 +137,7 @@
#define CK_XPaste 703
#define CK_Selection_History 704
-#ifdef MIDNIGHT /* cooledit now has its own full-featured script editor and executor */
+#ifdef MIDNIGHT /* cooledit now has its own full-featured script editor and executor */
/*
Process a block through a shell command: CK_Pipe_Block(i) executes shell_cmd[i].
shell_cmd[i] must process the file ~/cooledit.block and output ~/cooledit.block
@@ -148,14 +149,15 @@
*/
#define CK_Pipe_Block(i) (1000+(i))
#define SHELL_COMMANDS_i {"/.cedit/edit.indent.rc", "/.cedit/edit.spell.rc", /* and so on */ 0};
-#else
-#define CK_User_Command(i) (1000+(i))
-#endif
-
-/* execute a macro */
#define CK_Macro(i) (2000+(i))
#define CK_Last_Macro CK_Macro(0x7FFF)
+#else
+#define CK_User_Command(i) ((i) | (1 << 16))
+#define IS_USER_COMMAND(i) ((i) & (1 << 16))
+#define CK_Macro(i) ((i) | (1 << 17))
+#define IS_MACRO_COMMAND(i) ((i) & (1 << 17))
+#endif
#endif
diff -ruN old/mc-4.5.37/gtkedit/editdraw.c new/mc-4.5.38/gtkedit/editdraw.c
--- old/mc-4.5.37/gtkedit/editdraw.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/editdraw.c Thu Sep 2 12:49:39 1999
@@ -25,20 +25,21 @@
#define MAX_LINE_LEN 1024
-#ifndef MIDNIGHT
-#ifndef GTK
+#if ! defined (MIDNIGHT) && ! defined (GTK)
#include "app_glob.c"
#include "coollocal.h"
-#endif
-#else
-#include "../src/mad.h"
+#include "mad.h"
#endif
extern int column_highlighting;
+#if defined (MIDNIGHT) || defined (GTK)
+
void status_string (WEdit * edit, char *s, int w, int fill, int font_width)
{
+#ifdef MIDNIGHT
int i;
+#endif
char t[160]; /* 160 just to be sure */
/* The field lengths just prevents the status line from shortening to much */
sprintf (t, "[%c%c%c%c] %2ld:%3ld+%2ld=%3ld/%3ld - *%-4ld/%4ldb=%3d",
@@ -49,19 +50,24 @@
edit->curs_line + 1, edit->total_lines + 1, edit->curs1,
edit->last_byte, edit->curs1 < edit->last_byte
? edit_get_byte (edit, edit->curs1) : -1);
+#ifdef MIDNIGHT
sprintf (s, "%.*s", w + 1, t);
i = strlen (s);
s[i] = ' ';
i = w;
do {
- if (strchr (" +-*=/:b", s[i])) /* chop off the last word/number */
+ if (strchr ("+-*=/:b", s[i])) /* chop off the last word/number */
break;
s[i] = fill;
} while (i--);
s[i] = fill;
s[w] = 0;
+#else
+ strcpy (s, t);
+#endif
}
+#endif
#ifdef MIDNIGHT
@@ -101,7 +107,7 @@
extern int fixed_font;
#endif
-void rerender_text (CWidget * wdt);
+void render_status (CWidget * wdt, int expose);
#ifdef GTK
@@ -138,40 +144,45 @@
void edit_status (WEdit * edit)
{
- if ((COptionsOf (edit->widget) & EDITOR_NO_TEXT)) {
+ long start_mark, end_mark;
+ CWidget *wdt;
+ mode_t m;
+ char *p;
+ char id[33];
+ char s[256];
+ if (eval_marks (edit, &start_mark, &end_mark))
+ end_mark = start_mark = 0;
+ if ((COptionsOf (edit->widget) & EDITOR_NO_TEXT))
return;
- } else {
- int w, i, t;
- CWidget *wdt;
- char id[33];
- char s[160];
- w = edit->num_widget_columns - 1;
- if (w > 150)
- w = 150;
- if (w < 0)
- w = 0;
- memset (s, 0, w);
- if (w > 1) {
- i = w > 24 ? 18 : w - 6;
- i = i < 13 ? 13 : i;
- sprintf (s, "%s", name_trunc (edit->filename ? edit->filename : "", i));
- i = strlen (s);
- s[i] = ' ';
- s[i+1] = ' ';
- t = w - i - 2;
- if (t < 0)
- t = 0;
- status_string (edit, s + i + 2, t, 0, FONT_MEAN_WIDTH);
- }
- s[w] = 0;
- strcpy (id, CIdentOf (edit->widget));
- strcat (id, ".text");
- wdt = CIdent (id);
- free (wdt->text);
- wdt->text = strdup (s);
- CSetWidgetSize (id, CWidthOf (edit->widget), CHeightOf (wdt));
- rerender_text (wdt);
- }
+ m = edit->stat.st_mode;
+ p = edit->filename ? edit->filename : "";
+ sprintf (s, "\034%c%s\033\035 \034-%c%c%c%c%c%c%c%c%c\035 \034%s%s%s%c\035 \034\030%02ld\033\035 \034%-4ld+%2ld=\030%4ld\033/%3ld\035 \034*%-5ld/%5ldb=%c%3d\035%c \034\001%ld\033\035",
+ *p ? '\033' : '\003', *p ? (char *) name_trunc (p, max (edit->num_widget_lines / 3, 16)) : _ (""),
+ m & S_IRUSR ? 'r' : '-',
+ m & S_IWUSR ? 'w' : '-',
+ m & S_IXUSR ? 'x' : '-',
+ m & S_IRGRP ? 'r' : '-',
+ m & S_IWGRP ? 'w' : '-',
+ m & S_IXGRP ? 'x' : '-',
+ m & S_IROTH ? 'r' : '-',
+ m & S_IWOTH ? 'w' : '-',
+ m & S_IXOTH ? 'x' : '-',
+ end_mark - start_mark || (edit->mark2 == -1 && !edit->highlight) ? (column_highlighting ? "\032C\033" : "\001B\033") : "-",
+ edit->modified ? "\012M\033" : "-", edit->macro_i < 0 ? "-" : "\023R\033",
+ edit->overwrite == 0 ? '-' : 'O',
+ edit->curs_col / FONT_MEAN_WIDTH, edit->start_line + 1, edit->curs_row,
+ edit->curs_line + 1, edit->total_lines + 1, edit->curs1,
+ edit->last_byte, edit->curs1 == edit->last_byte ? '\014' : '\033', edit->curs1 < edit->last_byte
+ ? edit_get_byte (edit, edit->curs1) : -1,
+ end_mark - start_mark && !column_highlighting ? ' ' : '\0',
+ end_mark - start_mark);
+ strcpy (id, CIdentOf (edit->widget));
+ strcat (id, ".text");
+ wdt = CIdent (id);
+ free (wdt->text);
+ wdt->text = (char *) strdup (s);
+ CSetWidgetSize (id, CWidthOf (edit->widget), CHeightOf (wdt));
+ render_status (wdt, 0);
}
#endif
@@ -216,32 +227,50 @@
/* this scrolls the text so that cursor is on the screen */
void edit_scroll_screen_over_cursor (WEdit * edit)
{
- int p, l;
+ int p;
int outby;
+ int b_extreme, t_extreme, l_extreme, r_extreme;
+ r_extreme = EDIT_RIGHT_EXTREME;
+ l_extreme = EDIT_LEFT_EXTREME;
+ b_extreme = EDIT_BOTTOM_EXTREME;
+ t_extreme = EDIT_TOP_EXTREME;
+ if (edit->found_len) {
+ b_extreme = max (edit->num_widget_lines / 4, b_extreme);
+ t_extreme = max (edit->num_widget_lines / 4, t_extreme);
+ }
+ if (b_extreme + t_extreme + 1 > edit->num_widget_lines) {
+ int n;
+ n = b_extreme + t_extreme;
+ b_extreme = (b_extreme * (edit->num_widget_lines - 1)) / n;
+ t_extreme = (t_extreme * (edit->num_widget_lines - 1)) / n;
+ }
+ if (l_extreme + r_extreme + 1 > edit->num_widget_columns) {
+ int n;
+ n = l_extreme + t_extreme;
+ l_extreme = (l_extreme * (edit->num_widget_columns - 1)) / n;
+ r_extreme = (r_extreme * (edit->num_widget_columns - 1)) / n;
+ }
p = edit_get_col (edit);
edit_update_curs_row (edit);
#ifdef MIDNIGHT
- outby = p + edit->start_col - edit->num_widget_columns + 1 + (EDIT_RIGHT_EXTREME + edit->found_len);
+ outby = p + edit->start_col - edit->num_widget_columns + 1 + (r_extreme + edit->found_len);
#else
- outby = p + edit->start_col - CWidthOf (edit->widget) + 7 + (EDIT_RIGHT_EXTREME + edit->found_len) * FONT_MEAN_WIDTH + edit_width_of_long_printable (edit_get_byte (edit, edit->curs1));
+ outby = p + edit->start_col - CWidthOf (edit->widget) + 7 + (r_extreme + edit->found_len) * FONT_MEAN_WIDTH + edit_width_of_long_printable (edit_get_byte (edit, edit->curs1));
#endif
if (outby > 0)
edit_scroll_right (edit, outby);
#ifdef MIDNIGHT
- outby = EDIT_LEFT_EXTREME - p - edit->start_col;
+ outby = l_extreme - p - edit->start_col;
#else
- outby = EDIT_LEFT_EXTREME * FONT_MEAN_WIDTH - p - edit->start_col;
+ outby = l_extreme * FONT_MEAN_WIDTH - p - edit->start_col;
#endif
if (outby > 0)
edit_scroll_left (edit, outby);
p = edit->curs_row;
- l = 0;
- if (edit->found_len != 0)
- l = edit->num_widget_lines / 5;
- outby = p - edit->num_widget_lines + 1 + EDIT_BOTTOM_EXTREME + l;
+ outby = p - edit->num_widget_lines + 1 + b_extreme;
if (outby > 0)
edit_scroll_downward (edit, outby);
- outby = EDIT_TOP_EXTREME - p + l;
+ outby = t_extreme - p;
if (outby > 0)
edit_scroll_upward (edit, outby);
edit_update_curs_row (edit);
@@ -440,11 +469,20 @@
static int key_pending (WEdit * edit)
{
+ static int flush = 0, line = 0;
#ifdef GTK
/* ******* */
#else
- if (!(edit->force & REDRAW_COMPLETELY) && !EditExposeRedraw)
- return CKeyPending ();
+ if (!edit) {
+ flush = line = 0;
+ } else if (!(edit->force & REDRAW_COMPLETELY) && !EditExposeRedraw) {
+/* this flushes the display in logarithmic intervals - so both fast and
+ slow machines will get good performance vs nice-refreshing */
+ if ((1 << flush) == ++line) {
+ flush++;
+ return CKeyPending ();
+ }
+ }
#endif
return 0;
}
@@ -478,6 +516,10 @@
int force = edit->force;
long b;
+#ifndef MIDNIGHT
+ key_pending (0);
+#endif
+
/*
if the position of the page has not moved then we can draw the cursor character only.
This will prevent line flicker when using arrow keys.
@@ -708,8 +750,8 @@
{
int row_start, col_start, row_end, col_end;
EditExposeRedraw = 1;
- edit->num_widget_lines = (CHeightOf (edit->widget) - 6) / FONT_PIX_PER_LINE;
- edit->num_widget_columns = (CWidthOf (edit->widget) - 7) / FONT_MEAN_WIDTH;
+ edit->num_widget_lines = (CHeightOf (edit->widget) - EDIT_FRAME_H) / FONT_PIX_PER_LINE;
+ edit->num_widget_columns = (CWidthOf (edit->widget) - EDIT_FRAME_W) / FONT_MEAN_WIDTH;
if (edit->force & (REDRAW_PAGE | REDRAW_COMPLETELY)) {
edit->force |= REDRAW_PAGE | REDRAW_COMPLETELY;
edit_render_keypress (edit);
diff -ruN old/mc-4.5.37/gtkedit/editmenu.c new/mc-4.5.38/gtkedit/editmenu.c
--- old/mc-4.5.37/gtkedit/editmenu.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/editmenu.c Thu Sep 2 12:49:40 1999
@@ -25,6 +25,10 @@
#include "editcmddef.h"
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
+
#ifdef MIDNIGHT
#include "../src/mad.h"
@@ -69,7 +73,7 @@
{
edit_message_dialog (wedit->mainid, 20, 20, _(" About "),
_("\n"
- " Cooledit v2.1\n"
+ " Cooledit v3.11.5\n"
"\n"
" Copyright (C) 1996 the Free Software Foundation\n"
"\n"
@@ -400,7 +404,7 @@
_("Copy to file...\tC-f"), '~', menu_cmd, (unsigned long) CK_Save_Block
);
/* Tool hint */
- CSetToolHint (catstrs (ident, ".filemenu", 0), _("Disk operations"));
+ CSetToolHint (catstrs (ident, ".filemenu", 0), _("Disk operations and file indexing/searching"));
CGetHintPos (&x, &d);
diff -ruN old/mc-4.5.37/gtkedit/editwidget.c new/mc-4.5.38/gtkedit/editwidget.c
--- old/mc-4.5.37/gtkedit/editwidget.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/editwidget.c Thu Sep 2 12:49:40 1999
@@ -20,7 +20,6 @@
02111-1307, USA.
*/
-
#include
#include "edit.h"
@@ -32,7 +31,9 @@
#include "editcmddef.h"
#include "mousemark.h"
#endif
-
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
#ifndef MIDNIGHT
@@ -142,9 +143,12 @@
if (edit->mark1 != edit->mark2 && event) {
edit_get_selection (edit);
XSetSelectionOwner (CDisplay, XA_PRIMARY, CWindowOf (edit->widget), event->xbutton.time);
- } else {
+ }
+#ifdef GTK
+ else {
edit->widget->editable.has_selection = TRUE;
}
+#endif
}
static char *get_block (WEdit * edit, long start_mark, long end_mark, int *type, int *l)
@@ -166,9 +170,9 @@
static void dclick (WEdit *edit, XEvent *event)
{
edit_mark_cmd (edit, 1);
- edit_right_word_move (edit);
+ edit_right_word_move (edit, 1);
edit_mark_cmd (edit, 0);
- edit_left_word_move (edit);
+ edit_left_word_move (edit, 1);
release_mark (edit, event);
}
@@ -265,6 +269,7 @@
mime_majors
};
+static void render_book_marks (CWidget *w);
extern int option_editor_bg_normal;
void edit_tri_cursor (Window win);
@@ -273,7 +278,7 @@
int width, int height, const char *text, const char *filename,
const char *starting_directory, unsigned int options, unsigned long text_size)
{
- static made_directory = 0;
+ static int made_directory = 0;
int extra_space_for_hscroll = 0;
CWidget *w;
WEdit *e;
@@ -282,7 +287,7 @@
extra_space_for_hscroll = 8;
wedit = w = CSetupWidget (identifier, parent, x, y,
- width + 7, height + 6, C_EDITOR_WIDGET,
+ width + EDIT_FRAME_W, height + EDIT_FRAME_H, C_EDITOR_WIDGET,
ExposureMask | ButtonPressMask | ButtonReleaseMask | \
KeyPressMask | KeyReleaseMask | ButtonMotionMask | \
PropertyChangeMask | StructureNotifyMask | \
@@ -296,9 +301,9 @@
w->destroy = edit_destroy_callback;
if (filename)
- w->label = strdup (filename);
+ w->label = (char *) strdup (filename);
else
- w->label = strdup ("");
+ w->label = (char *) strdup ("");
if (!made_directory) {
mkdir (catstrs (home_dir, EDIT_DIR, 0), 0700);
@@ -323,22 +328,45 @@
e->macro_i = -1;
e->widget = w;
- set_hint_pos (x + width + 7 + WIDGET_SPACING, y + height + 6 + WIDGET_SPACING + extra_space_for_hscroll);
+ set_hint_pos (x + width + EDIT_FRAME_W + WIDGET_SPACING, y + height + EDIT_FRAME_H + WIDGET_SPACING + extra_space_for_hscroll);
if (extra_space_for_hscroll) {
w->hori_scrollbar = CDrawHorizontalScrollbar (catstrs (identifier, ".hsc", 0), parent,
- x, y + height + 6, width + 6, 12, 0, 0);
+ x, y + height + EDIT_FRAME_H, width + EDIT_FRAME_W, 12, 0, 0);
CSetScrollbarCallback (w->hori_scrollbar->ident, w->ident, link_hscrollbar_to_editor);
}
if (!(options & EDITOR_NO_TEXT))
- CDrawText (catstrs (identifier, ".text", 0), parent, x, y + height + 6 + WIDGET_SPACING + extra_space_for_hscroll, "%s", e->filename);
+ CDrawStatus (catstrs (identifier, ".text", 0), parent, x, y + height + 3 + EDIT_FRAME_H + WIDGET_SPACING + extra_space_for_hscroll, width + EDIT_FRAME_W, e->filename);
if (!(options & EDITOR_NO_SCROLL)) {
w->vert_scrollbar = CDrawVerticalScrollbar (catstrs (identifier, ".vsc", 0), parent,
- x + width + 7 + WIDGET_SPACING, y, height + 6, 20, 0, 0);
+ x + width + EDIT_FRAME_W + WIDGET_SPACING, y, height + EDIT_FRAME_H, 20, 0, 0);
CSetScrollbarCallback (w->vert_scrollbar->ident, w->ident, link_scrollbar_to_editor);
+ w->vert_scrollbar->scroll_bar_extra_render = render_book_marks;
}
return w;
}
+static void render_book_marks (CWidget * w)
+{
+ struct _book_mark *p;
+ WEdit *edit;
+ int l;
+ char i[32];
+ if (!w)
+ return;
+ strcpy (i, CIdentOf (w));
+ *(strstr (i, ".vsc")) = '\0';
+ edit = (CIdent (i))->editor;
+ if (!edit->book_mark)
+ return;
+ l = CHeightOf (w) - 10 * CWidthOf (w) / 3 - 10;
+ for (p = edit->book_mark; p->next; p = p->next);
+ for (; p->prev; p = p->prev) {
+ int y = (CWidthOf (w) + 2 * CWidthOf (w) / 3 + 4) + (int) ((double) l * p->line / edit->total_lines);
+ CSetColor (color_palette (p->c & 0xFF));
+ CLine (CWindowOf (w), 5, y, CWidthOf (w) - 6, y);
+ }
+}
+
void update_scroll_bars (WEdit * e)
{
int i, x1, x2;
@@ -571,6 +599,7 @@
Atom actual_type;
int actual_fmt, i;
unsigned long nitems;
+
if (XGetWindowProperty (CDisplay, win, prop,
nread / 4, 65536, delete,
AnyPropertyType, &actual_type, &actual_fmt,
@@ -632,7 +661,6 @@
edit_render_keypress (e);
}
}
-
extern int space_width;
diff -ruN old/mc-4.5.37/gtkedit/gtkedit.c new/mc-4.5.38/gtkedit/gtkedit.c
--- old/mc-4.5.37/gtkedit/gtkedit.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/gtkedit.c Thu Sep 2 12:49:39 1999
@@ -665,9 +665,9 @@
case GDK_2BUTTON_PRESS:
dragging = 0;
edit_cursor_move (e, mouse_pos - e->curs1);
- edit_right_word_move (e);
+ edit_right_word_move (e, 1);
mouse_pos = e->curs1;
- edit_left_word_move (e);
+ edit_left_word_move (e, 1);
button_down_pos = e->curs1;
gtk_edit_set_selection (GTK_EDITABLE (widget), mouse_pos, button_down_pos);
gtk_edit_mouse_redraw (e, mouse_pos);
@@ -911,7 +911,7 @@
static void gtk_edit_init (GtkEdit * edit)
{
- static made_directory = 0;
+ static int made_directory = 0;
GTK_WIDGET_SET_FLAGS (edit, GTK_CAN_FOCUS);
@@ -1284,43 +1284,43 @@
app = gnome_app_new ("mcedit", (char *) (file ? file : "Mcedit"));
{
- GnomeUIInfo file_menu[] =
+ static GnomeUIInfo file_menu[] =
{
- GNOMEUIINFO_MENU_OPEN_ITEM( gtk_edit_load_file, edit),
- GNOMEUIINFO_MENU_NEW_ITEM( "_New", N_ ("Clear the edit buffer"), gtk_edit_new_file, edit),
+ GNOMEUIINFO_MENU_OPEN_ITEM( gtk_edit_load_file, NULL),
+ GNOMEUIINFO_MENU_NEW_ITEM( "_New", N_ ("Clear the edit buffer"), gtk_edit_new_file, NULL),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_SAVE_ITEM( gtk_edit_save_file, edit),
- GNOMEUIINFO_MENU_SAVE_AS_ITEM( gtk_edit_save_as_file, edit),
+ GNOMEUIINFO_MENU_SAVE_ITEM( gtk_edit_save_file, NULL),
+ GNOMEUIINFO_MENU_SAVE_AS_ITEM( gtk_edit_save_as_file, NULL),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_DATA( N_ ("Insert File"), N_ ("Insert text from a file"),
- gtk_edit_insert_file, edit, NULL),
+ gtk_edit_insert_file, NULL, NULL),
GNOMEUIINFO_ITEM_DATA( N_ ("Copy to file"), N_ ("copy a block to a file"),
- gtk_edit_copy_to_file, edit, NULL),
+ gtk_edit_copy_to_file, NULL, NULL),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_EXIT_ITEM(gtk_edit_quit,edit),
+ GNOMEUIINFO_MENU_EXIT_ITEM(gtk_edit_quit, NULL),
GNOMEUIINFO_END
};
- GnomeUIInfo edit_menu[] =
+ static GnomeUIInfo edit_menu[] =
{
- GNOMEUIINFO_MENU_COPY_ITEM(gtk_edit_clip_copy, edit),
- GNOMEUIINFO_MENU_CUT_ITEM( gtk_edit_clip_cut, edit),
- GNOMEUIINFO_MENU_PASTE_ITEM( gtk_edit_clip_paste, edit),
+ GNOMEUIINFO_MENU_COPY_ITEM(gtk_edit_clip_copy, NULL),
+ GNOMEUIINFO_MENU_CUT_ITEM( gtk_edit_clip_cut, NULL),
+ GNOMEUIINFO_MENU_PASTE_ITEM( gtk_edit_clip_paste, NULL),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_UNDO_ITEM(gtk_edit_undo, edit),
+ GNOMEUIINFO_MENU_UNDO_ITEM(gtk_edit_undo, NULL),
GNOMEUIINFO_END
};
- GnomeUIInfo search_menu[] =
+ static GnomeUIInfo search_menu[] =
{
- GNOMEUIINFO_MENU_FIND_ITEM(gtk_edit_search, edit),
- GNOMEUIINFO_MENU_FIND_AGAIN_ITEM(gtk_edit_search_again, edit),
- GNOMEUIINFO_MENU_REPLACE_ITEM(gtk_edit_replace, edit),
+ GNOMEUIINFO_MENU_FIND_ITEM(gtk_edit_search, NULL),
+ GNOMEUIINFO_MENU_FIND_AGAIN_ITEM(gtk_edit_search_again, NULL),
+ GNOMEUIINFO_MENU_REPLACE_ITEM(gtk_edit_replace, NULL),
GNOMEUIINFO_END
};
- GnomeUIInfo help_menu[] =
+ static GnomeUIInfo help_menu[] =
{
GNOMEUIINFO_MENU_ABOUT_ITEM(about_cb, NULL),
#if 0
@@ -1343,7 +1343,7 @@
statusbar = gtk_entry_new ();
gtk_entry_set_editable (GTK_ENTRY (statusbar), 0);
gtk_widget_set_usize (app, 400, 400);
- gnome_app_create_menus (GNOME_APP (app), main_menu);
+ gnome_app_create_menus_with_data (GNOME_APP (app), main_menu, edit);
gnome_app_set_contents (GNOME_APP (app), edit);
gnome_app_set_statusbar (GNOME_APP (app), GTK_WIDGET (statusbar));
GTK_EDIT (edit)->menubar = GNOME_APP (app)->menubar;
diff -ruN old/mc-4.5.37/gtkedit/propfont.c new/mc-4.5.38/gtkedit/propfont.c
--- old/mc-4.5.37/gtkedit/propfont.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/propfont.c Thu Sep 2 12:49:39 1999
@@ -19,6 +19,9 @@
#include
#include "edit.h"
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
/* this file definatively relies on int being 32 bits or more */
@@ -51,26 +54,28 @@
extern int EditExposeRedraw;
extern int EditClear;
-void set_style_color (
+int set_style_color (
#ifdef GTK
Window win,
#endif
cache_type s, unsigned long *fg, unsigned long *bg)
{
- int fgp, bgp;
+ int fgp, bgp, underlined = 0;
fgp = (s & 0xFF000000UL) >> 24;
/* NO_COLOR would give fgp == 255 */
- if (fgp < 255)
+ if (fgp < 0xFF)
*fg = color_palette (fgp);
else
*fg = edit_normal_foreground_color;
bgp = (s & 0x00FF0000) >> 16;
- if (bgp < 255)
+ if (bgp == 0xFE)
+ underlined = 1;
+ if (bgp < 0xFD)
*bg = color_palette (bgp);
else
*bg = edit_normal_background_color;
if (!(s & 0xFFFFFF00UL)) /* check this first as an optimization */
- return;
+ return underlined;
if (s & (MOD_ABNORMAL * 256)) {
*bg = edit_abnormal_color;
if (s & (MOD_MARKED * 256))
@@ -92,6 +97,7 @@
if (*bg == COLOR_BLACK)
*bg = color_palette (1);
}
+ return underlined;
}
#ifdef GTK
@@ -105,30 +111,13 @@
return x += tab_width - x % tab_width;
}
-/* For Ryan: */
-/* converts a possibly unprintable character to a string,
- returning the string's width in pixels, t must have space for 4 chars */
+/* this now properly uses ctypes */
static inline int convert_to_long_printable (int c, unsigned char *t)
{
- if (c > ' ') {
- if (c <= '~') {
- t[0] = c;
- t[1] = 0;
- return per_char[c];
- }
- if (c >= 160)
- if (option_international_characters) {
- t[0] = c;
- t[1] = 0;
- return per_char[c];
- }
- if (c > '~') {
- t[0] = ("0123456789ABCDEF")[c >> 4];
- t[1] = ("0123456789ABCDEF")[c & 0xF];
- t[2] = 'h';
- t[3] = 0;
- return per_char[t[0]] + per_char[t[1]] + per_char[t[2]];
- }
+ if (isgraph (c)) {
+ t[0] = c;
+ t[1] = 0;
+ return per_char[c];
}
if (c == ' ') {
if (option_long_whitespace) {
@@ -142,6 +131,18 @@
return per_char[' '];
}
}
+ if (option_international_characters && per_char[c]) {
+ t[0] = c;
+ t[1] = 0;
+ return per_char[c];
+ }
+ if (c > '~') {
+ t[0] = ("0123456789ABCDEF")[c >> 4];
+ t[1] = ("0123456789ABCDEF")[c & 0xF];
+ t[2] = 'h';
+ t[3] = 0;
+ return per_char[t[0]] + per_char[t[1]] + per_char[t[2]];
+ }
t[0] = '^';
t[1] = c + '@';
t[2] = 0;
@@ -151,21 +152,18 @@
/* same as above but just gets the length */
static inline int width_of_long_printable (int c)
{
- if (c > ' ') {
- if (c <= '~')
- return per_char[c];
- if (c >= 160)
- if (option_international_characters)
- return per_char[c];
- if (c > '~')
- return per_char[(unsigned char) ("0123456789ABCDEF")[c >> 4]] + per_char[(unsigned char) ("0123456789ABCDEF")[c & 0xF]] + per_char['h'];
- }
+ if (isgraph (c))
+ return per_char[c];
if (c == ' ') {
if (option_long_whitespace)
return per_char[' '] + per_char[' '];
else
return per_char[' '];
}
+ if (option_international_characters && per_char[c])
+ return per_char[c];
+ if (c > '~')
+ return per_char[(unsigned char) ("0123456789ABCDEF")[c >> 4]] + per_char[(unsigned char) ("0123456789ABCDEF")[c & 0xF]] + per_char[(unsigned char) 'h'];
return per_char['^'] + per_char[c + '@'];
}
@@ -250,6 +248,18 @@
extern int column_highlighting;
/* gets the characters style (eg marked, highlighted) from its position in the edit buffer */
+static inline cache_type get_style_fast (WEdit * edit, long q, int c)
+{
+ cache_type s = 0;
+ unsigned int fg, bg;
+ if (!(isprint (c) || (option_international_characters && per_char[c])))
+ if (c != '\n' && c != '\t')
+ s |= MOD_ABNORMAL * 256;
+ edit_get_syntax_color (edit, q, (int *) &fg, (int *) &bg);
+ return s | ((fg & 0xFF) << 24) | ((bg & 0xFF) << 16);
+}
+
+/* gets the characters style (eg marked, highlighted) from its position in the edit buffer */
static inline cache_type get_style (WEdit * edit, long q, int c, long m1, long m2, int x)
{
cache_type s = 0;
@@ -269,13 +279,9 @@
s |= MOD_BOLD * 256;
if (q >= edit->found_start && q < edit->found_start + edit->found_len)
s |= MOD_HIGHLIGHTED * 256;
- if (option_international_characters) {
- if ((c < ' ' || (c > '~' && c < 160)) && c != '\t' && c != '\n')
+ if (!(isprint (c) || (option_international_characters && per_char[c])))
+ if (c != '\n' && c != '\t')
s |= MOD_ABNORMAL * 256;
- } else {
- if ((c < ' ' || c > '~') && c != '\t' && c != '\n')
- s |= MOD_ABNORMAL * 256;
- }
edit_get_syntax_color (edit, q, (int *) &fg, (int *) &bg);
return s | ((fg & 0xFF) << 24) | ((bg & 0xFF) << 16);
}
@@ -284,72 +290,151 @@
{
int c;
cache_type s;
- long m1, m2;
+ long m1, m2, last;
unsigned char *r, text[4];
- int book_mark_colors[10], book_mark, book_mark_cycle = 0, the_end = 0;
-
+ int book_mark_colors[10], book_mark;
eval_marks (edit, &m1, &m2);
-
book_mark = book_mark_query_all (edit, edit->start_line + row, book_mark_colors);
-
- for (;;) {
- c = edit_get_byte (edit, q);
- if (!the_end)
- *p = get_style (edit, q, c, m1, m2, x);
- if (book_mark) {
+ last = q + (x_max - x) / 2 + 2; /* for optimization, we say that the last character
+ of this line cannot have an offset greater than this.
+ This can be used to rule out uncommon text styles,
+ like a character with a cursor, or selected text */
+ if (book_mark) {
+ int the_end = 0, book_mark_cycle = 0;
+ for (;;) {
+ c = edit_get_byte (edit, q);
+ if (!the_end)
+ *p = get_style (edit, q, c, m1, m2, x);
if (the_end)
*p = 0;
*p = (*p & 0x0000FFFF) | (book_mark_colors[book_mark_cycle++ % book_mark] << 16);
- }
- switch (c) {
- case '\n':
- if (book_mark) { /* bookmarks must show right across the screen */
+ switch (c) {
+ case '\n':
the_end = 1;
c = ' ';
q--;
goto the_default;
- } else {
+ case '\t':
+ if (fixed_font) {
+ int t;
+ t = next_tab_pos (x);
+ t = min (t, x_max);
+ s = *p;
+ while (x < t) {
+ x += per_char[' '];
+ *p++ = s | ' ';
+ }
+ } else {
+ *p++ |= '\t';
+ x = next_tab_pos (x);
+ }
+ break;
+ default:
+ the_default:
+ x += convert_to_long_printable (c, text);
+ r = text;
+ s = *p;
+ *p++ = s | *r++;
+ if (!*r)
+ break;
+ *p++ = s | *r++;
+ if (!*r)
+ break;
+ *p++ = s | *r++;
+ break;
+ }
+ if (x >= x_max)
+ break;
+ q++;
+ }
+ } else if ((m2 < q || m1 > last) && (edit->curs1 < q || edit->curs1 > last) && \
+ (edit->found_start + edit->found_len < q || edit->found_start > last) &&
+ (edit->bracket < q || edit->bracket > last)) {
+ for (;;) {
+ c = edit_get_byte (edit, q);
+ *p = get_style_fast (edit, q, c);
+ switch (c) {
+ case '\n':
*p++ |= ' ';
*p = 0;
if (x > edit->max_column)
edit->max_column = x;
return;
- }
- case '\t':
- if (fixed_font) {
- int t;
- t = next_tab_pos (x);
- t = min (t, x_max);
- s = *p;
- while (x < t) {
-#if 0
- if (book_mark)
- *p = (*p & 0x0000FFFF) | (book_mark_colors[book_mark_cycle++ % book_mark] << 16);
-#endif
- x += per_char[' '];
- *p++ = s | ' ';
+ case '\t':
+ if (fixed_font) {
+ int t;
+ t = next_tab_pos (x);
+ t = min (t, x_max);
+ s = *p;
+ while (x < t) {
+ x += per_char[' '];
+ *p++ = s | ' ';
+ }
+ } else {
+ *p++ |= '\t';
+ x = next_tab_pos (x);
}
- } else {
- *p++ |= '\t';
- x = next_tab_pos (x);
+ break;
+ default:
+ x += convert_to_long_printable (c, text);
+ r = text;
+ s = *p;
+ *p++ = s | *r++;
+ if (!*r)
+ break;
+ *p++ = s | *r++;
+ if (!*r)
+ break;
+ *p++ = s | *r++;
+ break;
}
- break;
- default:
- the_default:
- x += convert_to_long_printable (c, text);
- r = text;
- s = *p;
- *p++ = s | *r++;
- if (*r) {
+ if (x >= x_max)
+ break;
+ q++;
+ }
+ } else {
+ for (;;) {
+ c = edit_get_byte (edit, q);
+ *p = get_style (edit, q, c, m1, m2, x);
+ switch (c) {
+ case '\n':
+ *p++ |= ' ';
+ *p = 0;
+ if (x > edit->max_column)
+ edit->max_column = x;
+ return;
+ case '\t':
+ if (fixed_font) {
+ int t;
+ t = next_tab_pos (x);
+ t = min (t, x_max);
+ s = *p;
+ while (x < t) {
+ x += per_char[' '];
+ *p++ = s | ' ';
+ }
+ } else {
+ *p++ |= '\t';
+ x = next_tab_pos (x);
+ }
+ break;
+ default:
+ x += convert_to_long_printable (c, text);
+ r = text;
+ s = *p;
*p++ = s | *r++;
- if (*r)
- *p++ = s | *r++;
+ if (!*r)
+ break;
+ *p++ = s | *r++;
+ if (!*r)
+ break;
+ *p++ = s | *r++;
+ break;
}
- break;
+ if (x >= x_max)
+ break;
+ q++;
}
- if (x >= x_max)
- break;
- q++;
}
if (x > edit->max_column)
edit->max_column = x;
@@ -488,6 +573,7 @@
GdkColor fg, bg;
#else
unsigned long fg, bg;
+ int underlined, l;
#endif
#ifdef GTK
set_style_color (s, &fg.pixel, &bg.pixel);
@@ -495,12 +581,24 @@
gdk_gc_set_foreground (win->gc, &fg);
gdk_draw_image_text (win->text_area, GTK_WIDGET (win)->style->font, win->gc, x + FONT_OFFSET_X, y + FONT_OFFSET_Y, text, length);
#else
- set_style_color (s, &fg, &bg);
+ underlined = set_style_color (s, &fg, &bg);
CSetBackgroundColor (bg);
CSetColor (fg);
CImageString (win, x + FONT_OFFSET_X, y + FONT_OFFSET_Y, (char *) text, length);
+ l = CTextWidth (win, (char *) text, length);
+ if (underlined) {
+ int i, h, inc;
+ inc = FONT_MEAN_WIDTH * 2 / 3;
+ CSetColor (color_palette (18));
+ h = (x / inc) & 1;
+ CLine (win, x, y + FONT_HEIGHT + FONT_OVERHEAD - 1 - h, x + min (l, inc - (x % inc) - 1), y + FONT_HEIGHT + FONT_OVERHEAD - 1 - h);
+ h = h ^ 1;
+ for (i = inc - min (l, (x % inc)); i < l; i += inc) {
+ CLine (win, x + i, y + FONT_HEIGHT + FONT_OVERHEAD - 1 - h, x + min (l, i + inc - 1), y + FONT_HEIGHT + FONT_OVERHEAD - 1 - h);
+ h = h ^ 1;
+ }
+ }
#endif
-
/* if we printed a cursor: */
#ifdef GTK
if (s & (MOD_CURSOR * 256))
@@ -509,19 +607,18 @@
#else
if (s & (MOD_CURSOR * 256))
edit_set_cursor (win, x, y, bg, fg, per_char[*text], *text);
- return x + CTextWidth (win, (char *) text, length);
+ return x + l;
#endif
}
-#define STYLE_DIFF (cache[i] != line[i] \
- || ((cache[i] | line[i]) & (MOD_CURSOR * 256)) \
- || !cache[i] || !line[i] \
- )
+#define STYLE_DIFF (*cache != *line \
+ || ((*cache | *line) & (MOD_CURSOR * 256)) \
+ || !*cache || !*line)
int get_ignore_length (cache_type *cache, cache_type *line)
{
int i;
- for (i = 0; i < CACHE_WIDTH; i++) {
+ for (i = 0; i < CACHE_WIDTH; i++, line++, cache++) {
if (STYLE_DIFF)
return i;
}
@@ -554,7 +651,7 @@
if (line[i] != ' ')
return i + 1;
- for (i = cache_len - 1; i > length; i--)
+ for (i = cache_len - 1, line = line + i, cache = cache + i; i > length; i--, line--, cache--)
if (STYLE_DIFF)
return i + 1;
@@ -562,19 +659,32 @@
}
/* erases trailing bit of old line if a new line is printed over a longer old line */
-void cover_trail (Window win, int x_new, int x_old, int y)
+static void cover_trail (Window win, int x_start, int x_new, int x_old, int y)
{
if (x_new < EDIT_TEXT_HORIZONTAL_OFFSET)
- x_new = EDIT_TEXT_HORIZONTAL_OFFSET;
- if (x_new >= x_old) /* no need to print */
- return;
+ x_new = EDIT_TEXT_HORIZONTAL_OFFSET;
+ if (x_new < x_old) { /* no need to print */
+#ifdef GTK
+ gdk_gc_set_foreground (win->gc, &win->color[1]);
+ gdk_draw_rectangle (win->text_area, win->gc, 1, x_new, y + FONT_OVERHEAD, x_old - x_new, FONT_HEIGHT);
+#else
+ CSetColor (edit_normal_background_color);
+ CRectangle (win, x_new, y + FONT_OVERHEAD, x_old - x_new, FONT_HEIGHT + (FONT_OVERHEAD != 0 && !fixed_font));
+#endif
+ } else {
+#ifdef GTK
+ gdk_gc_set_foreground (win->gc, &win->color[1]);
+#else
+ CSetColor (edit_normal_background_color);
+#endif
+ }
+/* true type fonts print stuff out of the bounding box (aaaaaaaaarrrgh!!) */
+ if (!fixed_font)
+ if (FONT_OVERHEAD && x_new > EDIT_TEXT_HORIZONTAL_OFFSET)
#ifdef GTK
- gdk_gc_set_foreground (win->gc, &win->color[1]);
- gdk_draw_rectangle (win->text_area, win->gc, 1, x_new, y + FONT_OVERHEAD, x_old - x_new, FONT_HEIGHT);
+ gdk_draw_line (win->text_area, win->gc, max (x_start, EDIT_TEXT_HORIZONTAL_OFFSET), y + FONT_HEIGHT + FONT_OVERHEAD, x_new - 1, y + FONT_HEIGHT + FONT_OVERHEAD);
#else
- CSetColor (edit_normal_background_color);
-/* CSetColor (color_palette(12)); */
- CRectangle (win, x_new, y + FONT_OVERHEAD, x_old - x_new, FONT_HEIGHT);
+ CLine (win, max (x_start, EDIT_TEXT_HORIZONTAL_OFFSET), y + FONT_HEIGHT + FONT_OVERHEAD, x_new - 1, y + FONT_HEIGHT + FONT_OVERHEAD);
#endif
}
@@ -688,7 +798,7 @@
x = min (x, x_max);
if (!EditExposeRedraw || EditClear)
- cover_trail (win, x, lines[row].x1, y);
+ cover_trail (win, x0, x, lines[row].x1, y);
memcpy (&(lines[row].data[ignore_text]),
&(line[ignore_text]),
(min (j, CACHE_WIDTH) - ignore_text) * sizeof (cache_type));
@@ -711,7 +821,7 @@
return;
if (row + edit->start_line > edit->total_lines)
- b = 2000000000; /* force b out of range of the edit buffer for blanks lines */
+ b = edit->last_byte + 1; /* force b out of range of the edit buffer for blanks lines */
if (end_column > CWidthOf (edit->widget))
end_column = CWidthOf (edit->widget);
@@ -733,7 +843,7 @@
static inline int nroff_printable (int c)
{
- return ((c >= ' ' && c <= '~') || c >= 160);
+ return isprint (c);
}
diff -ruN old/mc-4.5.37/gtkedit/syntax.c new/mc-4.5.38/gtkedit/syntax.c
--- old/mc-4.5.37/gtkedit/syntax.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/syntax.c Thu Sep 2 12:49:39 1999
@@ -26,13 +26,29 @@
#else
#include "coolwidget.h"
#endif
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
/* bytes */
#define SYNTAX_MARKER_DENSITY 512
+/*
+ Mispelled words are flushed from the syntax highlighting rules
+ when they have been around longer than
+ TRANSIENT_WORD_TIME_OUT seconds. At a cursor rate of 30
+ chars per second and say 3 chars + a space per word, we can
+ accumulate 450 words absolute max with a value of 60. This is
+ below this limit of 1024 words in a context.
+ */
+#define TRANSIENT_WORD_TIME_OUT 60
+
+#define UNKNOWN_FORMAT "unknown"
+
#if !defined(MIDNIGHT) || defined(HAVE_SYNTAXH)
int option_syntax_highlighting = 1;
+int option_auto_spellcheck = 1;
/* these three functions are called from the outside */
void edit_load_syntax (WEdit * edit, char **names, char *type);
@@ -49,29 +65,33 @@
#define syntax_free(x) {if(x){free(x);(x)=0;}}
-static int compare_word_to_right (WEdit * edit, long i, char *text, char *whole_left, char *whole_right, int line_start)
+static long compare_word_to_right (WEdit * edit, long i, char *text, char *whole_left, char *whole_right, int line_start)
{
- char *p;
+ unsigned char *p, *q;
int c, d, j;
if (!*text)
- return 0;
+ return -1;
c = edit_get_byte (edit, i - 1);
if (line_start)
if (c != '\n')
- return 0;
+ return -1;
if (whole_left)
if (strchr (whole_left, c))
- return 0;
- for (p = text; *p; p++, i++) {
+ return -1;
+ for (p = (unsigned char *) text, q = p + strlen ((char *) p); (unsigned long) p < (unsigned long) q; p++, i++) {
switch (*p) {
case '\001':
p++;
for (;;) {
c = edit_get_byte (edit, i);
+ if (!*p)
+ if (whole_right)
+ if (!strchr (whole_right, c))
+ break;
if (c == *p)
break;
if (c == '\n')
- return 0;
+ return -1;
i++;
}
break;
@@ -80,20 +100,31 @@
j = 0;
for (;;) {
c = edit_get_byte (edit, i);
- if (c == *p)
+ if (c == *p) {
j = i;
- if (j && strchr (p + 1, c)) /* c exists further down, so it will get matched later */
+ if (*p == *text && !p[1]) /* handle eg '+' and @+@ keywords properly */
+ break;
+ }
+ if (j && strchr ((char *) p + 1, c)) /* c exists further down, so it will get matched later */
break;
if (c == '\n' || c == '\t' || c == ' ') {
+ if (!*p) {
+ i--;
+ break;
+ }
if (!j)
- return 0;
+ return -1;
i = j;
break;
}
if (whole_right)
if (!strchr (whole_right, c)) {
+ if (!*p) {
+ i--;
+ break;
+ }
if (!j)
- return 0;
+ return -1;
i = j;
break;
}
@@ -102,14 +133,6 @@
break;
case '\003':
p++;
-#if 0
- c = edit_get_byte (edit, i++);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char1;
- return 0;
- found_char1:
-#endif
c = -1;
for (;; i++) {
d = c;
@@ -127,304 +150,177 @@
if (p[1] == d)
i--;
break;
-#if 0
case '\004':
p++;
- c = edit_get_byte (edit, i++);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j])
- return 0;
- for (;; i++) {
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j])
- goto found_char4;
- continue;
- found_char4:
- break;
- }
- i--;
- while (*p != '\004')
- p++;
+ c = edit_get_byte (edit, i);
+ for (; *p != '\004'; p++)
+ if (c == *p)
+ goto found_char3;
+ return -1;
+ found_char3:
+ for (; *p != '\004'; p++);
break;
-#endif
default:
if (*p != edit_get_byte (edit, i))
- return 0;
+ return -1;
}
}
if (whole_right)
if (strchr (whole_right, edit_get_byte (edit, i)))
- return 0;
- return 1;
+ return -1;
+ return i;
}
-static int compare_word_to_left (WEdit * edit, long i, char *text, char *whole_left, char *whole_right, int line_start)
+#define XXX \
+ if (*s < '\005' || *s == (unsigned char) c) \
+ goto done; \
+ s++;
+
+static inline char *xx_strchr (const unsigned char *s, int c)
{
- char *p;
- int c, d, j;
- if (!*text)
- return 0;
- if (whole_right)
- if (strchr (whole_right, edit_get_byte (edit, i + 1)))
- return 0;
- for (p = text + strlen (text) - 1; (unsigned long) p >= (unsigned long) text; p--, i--) {
- switch (*p) {
- case '\001':
- p--;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == *p)
- break;
- if (c == '\n')
- return 0;
- i--;
- }
- break;
- case '\002':
- p--;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == *p)
- break;
- if (c == '\n' || c == '\t' || c == ' ')
- return 0;
- if (whole_right)
- if (!strchr (whole_right, c))
- return 0;
- i--;
- }
- break;
- case '\003':
- while (*(--p) != '\003');
- p++;
-#if 0
- c = edit_get_byte (edit, i--);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char1;
- return 0;
- found_char1:
-#endif
- c = -1;
- d = '\0';
- for (;; i--) {
- d = c;
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char2;
- break;
- found_char2:
- j = c; /* dummy command */
- }
- i++;
- p--;
- if (*(p - 1) == d)
- i++;
- break;
-#if 0
- case '\004':
- while (*(--p) != '\004');
- d = *p;
- p++;
- c = edit_get_byte (edit, i--);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j])
- return 0;
- for (;; i--) {
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j] || c == '\n' || c == d)
- goto found_char4;
- continue;
- found_char4:
- break;
- }
- i++;
- p--;
- break;
-#endif
- default:
- if (*p != edit_get_byte (edit, i))
- return 0;
- }
- }
- c = edit_get_byte (edit, i);
- if (line_start)
- if (c != '\n')
- return 0;
- if (whole_left)
- if (strchr (whole_left, c))
- return 0;
- return 1;
+ repeat:
+ XXX XXX XXX XXX XXX XXX XXX XXX;
+ XXX XXX XXX XXX XXX XXX XXX XXX;
+ goto repeat;
+ done:
+ return (char *) s;
}
-
-#if 0
-#define debug_printf(x,y) fprintf(stderr,x,y)
-#else
-#define debug_printf(x,y)
-#endif
-
-static inline unsigned long apply_rules_going_right (WEdit * edit, long i, unsigned long rule)
+static inline struct syntax_rule apply_rules_going_right (WEdit * edit, long i, struct syntax_rule rule)
{
struct context_rule *r;
- int context, contextchanged = 0, keyword, c1, c2;
- int found_right = 0, found_left = 0, keyword_foundleft = 0;
- int done = 0;
- unsigned long border;
- context = (rule & RULE_CONTEXT) >> RULE_CONTEXT_SHIFT;
- keyword = (rule & RULE_WORD) >> RULE_WORD_SHIFT;
- border = rule & (RULE_ON_LEFT_BORDER | RULE_ON_RIGHT_BORDER);
- c1 = edit_get_byte (edit, i - 1);
- c2 = edit_get_byte (edit, i);
- if (!c2 || !c1)
+ int contextchanged = 0, c;
+ int found_right = 0, found_left = 0, keyword_foundleft = 0, keyword_foundright = 0;
+ int is_end;
+ long end = 0;
+ struct syntax_rule _rule = rule;
+ if (!(c = edit_get_byte (edit, i)))
return rule;
-
- debug_printf ("%c->", c1);
- debug_printf ("%c ", c2);
-
+ is_end = (rule.end == (unsigned char) i);
/* check to turn off a keyword */
- if (keyword) {
+ if (_rule.keyword) {
struct key_word *k;
- k = edit->rules[context]->keyword[keyword];
- if (c1 == '\n')
- keyword = 0;
- if (k->last == c1 && compare_word_to_left (edit, i - 1, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start)) {
- keyword = 0;
+ k = edit->rules[_rule.context]->keyword[_rule.keyword];
+ if (edit_get_byte (edit, i - 1) == '\n')
+ _rule.keyword = 0;
+ if (is_end) {
+ _rule.keyword = 0;
keyword_foundleft = 1;
- debug_printf ("keyword=%d ", keyword);
}
}
- debug_printf ("border=%s ", border ? ((border & RULE_ON_LEFT_BORDER) ? "left" : "right") : "off");
-
/* check to turn off a context */
- if (context && !keyword) {
- r = edit->rules[context];
- if (r->first_right == c2 && compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right) \
- &&!(rule & RULE_ON_RIGHT_BORDER)) {
- debug_printf ("A:3 ", 0);
+ if (_rule.context && !_rule.keyword) {
+ long e;
+ r = edit->rules[_rule.context];
+ if (r->first_right == c && !(rule.border & RULE_ON_RIGHT_BORDER) && (e = compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right)) > 0) {
+ _rule.end = e;
found_right = 1;
- border = RULE_ON_RIGHT_BORDER;
+ _rule.border = RULE_ON_RIGHT_BORDER;
if (r->between_delimiters)
- context = 0;
- } else if (!found_left) {
- if (r->last_right == c1 && compare_word_to_left (edit, i - 1, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right) \
- &&(rule & RULE_ON_RIGHT_BORDER)) {
+ _rule.context = 0;
+ } else if (is_end && rule.border & RULE_ON_RIGHT_BORDER) {
/* always turn off a context at 4 */
- debug_printf ("A:4 ", 0);
- found_left = 1;
- border = 0;
- if (!keyword_foundleft)
- context = 0;
- } else if (r->last_left == c1 && compare_word_to_left (edit, i - 1, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left) \
- &&(rule & RULE_ON_LEFT_BORDER)) {
+ found_left = 1;
+ _rule.border = 0;
+ if (!keyword_foundleft)
+ _rule.context = 0;
+ } else if (is_end && rule.border & RULE_ON_LEFT_BORDER) {
/* never turn off a context at 2 */
- debug_printf ("A:2 ", 0);
- found_left = 1;
- border = 0;
- }
+ found_left = 1;
+ _rule.border = 0;
}
}
- debug_printf ("\n", 0);
-
/* check to turn on a keyword */
- if (!keyword) {
+ if (!_rule.keyword) {
char *p;
- p = (r = edit->rules[context])->keyword_first_chars;
- while ((p = strchr (p + 1, c2))) {
+ p = (r = edit->rules[_rule.context])->keyword_first_chars;
+ while (*(p = xx_strchr ((unsigned char *) p + 1, c))) {
struct key_word *k;
int count;
+ long e;
count = (unsigned long) p - (unsigned long) r->keyword_first_chars;
k = r->keyword[count];
- if (compare_word_to_right (edit, i, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start)) {
- keyword = count;
- debug_printf ("keyword=%d ", keyword);
+ e = compare_word_to_right (edit, i, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start);
+ if (e > 0) {
+ end = e;
+ _rule.end = e;
+ _rule.keyword = count;
+ keyword_foundright = 1;
break;
}
}
}
/* check to turn on a context */
- if (!context) {
- int count;
- for (count = 1; edit->rules[count] && !done; count++) {
- r = edit->rules[count];
- if (!found_left) {
- if (r->last_right == c1 && compare_word_to_left (edit, i - 1, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right) \
- &&(rule & RULE_ON_RIGHT_BORDER)) {
- debug_printf ("B:4 count=%d", count);
- found_left = 1;
- border = 0;
- context = 0;
+ if (!_rule.context) {
+ if (!found_left && is_end) {
+ if (rule.border & RULE_ON_RIGHT_BORDER) {
+ _rule.border = 0;
+ _rule.context = 0;
+ contextchanged = 1;
+ _rule.keyword = 0;
+ } else if (rule.border & RULE_ON_LEFT_BORDER) {
+ r = edit->rules[_rule._context];
+ _rule.border = 0;
+ if (r->between_delimiters) {
+ long e;
+ _rule.context = _rule._context;
contextchanged = 1;
- keyword = 0;
- } else if (r->last_left == c1 && compare_word_to_left (edit, i - 1, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left) \
- &&(rule & RULE_ON_LEFT_BORDER)) {
- debug_printf ("B:2 ", 0);
- found_left = 1;
- border = 0;
- if (r->between_delimiters) {
- context = count;
- contextchanged = 1;
- keyword = 0;
- debug_printf ("context=%d ", context);
- if (r->first_right == c2 && compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right)) {
- debug_printf ("B:3 ", 0);
- found_right = 1;
- border = RULE_ON_RIGHT_BORDER;
- context = 0;
- }
+ _rule.keyword = 0;
+ if (r->first_right == c && (e = compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right)) >= end) {
+ _rule.end = e;
+ found_right = 1;
+ _rule.border = RULE_ON_RIGHT_BORDER;
+ _rule.context = 0;
}
- break;
}
}
- if (!found_right) {
- if (r->first_left == c2 && compare_word_to_right (edit, i, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left)) {
- debug_printf ("B:1 ", 0);
- found_right = 1;
- border = RULE_ON_LEFT_BORDER;
- if (!r->between_delimiters) {
- debug_printf ("context=%d ", context);
- if (!keyword)
- context = count;
+ }
+ if (!found_right) {
+ int count;
+ struct context_rule **rules = edit->rules;
+ for (count = 1; rules[count]; count++) {
+ r = rules[count];
+ if (r->first_left == c) {
+ long e;
+ e = compare_word_to_right (edit, i, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left);
+ if (e >= end && (!_rule.keyword || keyword_foundright)) {
+ _rule.end = e;
+ found_right = 1;
+ _rule.border = RULE_ON_LEFT_BORDER;
+ _rule._context = count;
+ if (!r->between_delimiters)
+ if (!_rule.keyword)
+ _rule.context = count;
+ break;
}
- break;
}
}
}
}
- if (!keyword && contextchanged) {
+/* check again to turn on a keyword if the context switched */
+ if (contextchanged && !_rule.keyword) {
char *p;
- p = (r = edit->rules[context])->keyword_first_chars;
- while ((p = strchr (p + 1, c2))) {
+ p = (r = edit->rules[_rule.context])->keyword_first_chars;
+ while (*(p = xx_strchr ((unsigned char *) p + 1, c))) {
struct key_word *k;
- int coutner;
- coutner = (unsigned long) p - (unsigned long) r->keyword_first_chars;
- k = r->keyword[coutner];
- if (compare_word_to_right (edit, i, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start)) {
- keyword = coutner;
- debug_printf ("keyword=%d ", keyword);
+ int count;
+ long e;
+ count = (unsigned long) p - (unsigned long) r->keyword_first_chars;
+ k = r->keyword[count];
+ e = compare_word_to_right (edit, i, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start);
+ if (e > 0) {
+ _rule.end = e;
+ _rule.keyword = count;
break;
}
}
}
- debug_printf ("border=%s ", border ? ((border & RULE_ON_LEFT_BORDER) ? "left" : "right") : "off");
- debug_printf ("keyword=%d ", keyword);
-
- debug_printf (" %d#\n\n", context);
-
- return (context << RULE_CONTEXT_SHIFT) | (keyword << RULE_WORD_SHIFT) | border;
+ return _rule;
}
-static unsigned long edit_get_rule (WEdit * edit, long byte_index)
+static struct syntax_rule edit_get_rule (WEdit * edit, long byte_index)
{
long i;
- if (byte_index < 0) {
- edit->last_get_rule = -1;
- edit->rule = 0;
- return 0;
- }
if (byte_index > edit->last_get_rule) {
for (i = edit->last_get_rule + 1; i <= byte_index; i++) {
edit->rule = apply_rules_going_right (edit, i, edit->rule);
@@ -441,7 +337,7 @@
struct _syntax_marker *s;
for (;;) {
if (!edit->syntax_marker) {
- edit->rule = 0;
+ memset (&edit->rule, 0, sizeof (edit->rule));
for (i = -1; i <= byte_index; i++)
edit->rule = apply_rules_going_right (edit, i, edit->rule);
break;
@@ -461,27 +357,25 @@
return edit->rule;
}
-static void translate_rule_to_color (WEdit * edit, unsigned long rule, int *fg, int *bg)
+static void translate_rule_to_color (WEdit * edit, struct syntax_rule rule, int *fg, int *bg)
{
struct key_word *k;
- k = edit->rules[(rule & RULE_CONTEXT) >> RULE_CONTEXT_SHIFT]->keyword[(rule & RULE_WORD) >> RULE_WORD_SHIFT];
+ k = edit->rules[rule.context]->keyword[rule.keyword];
*bg = k->bg;
*fg = k->fg;
}
void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg)
{
- unsigned long rule;
- if (!edit->rules || byte_index >= edit->last_byte || !option_syntax_highlighting) {
+ if (edit->rules && byte_index < edit->last_byte && option_syntax_highlighting) {
+ translate_rule_to_color (edit, edit_get_rule (edit, byte_index), fg, bg);
+ } else {
#ifdef MIDNIGHT
*fg = EDITOR_NORMAL_COLOR;
#else
*fg = NO_COLOR;
*bg = NO_COLOR;
#endif
- } else {
- rule = edit_get_rule (edit, byte_index);
- translate_rule_to_color (edit, rule, fg, bg);
}
}
@@ -498,6 +392,8 @@
for (;;) {
c = fgetc (f);
if (c == -1) {
+ if (errno == EINTR)
+ continue;
r = 0;
break;
} else if (c == '\n') {
@@ -522,11 +418,8 @@
static char *strdup_convert (char *s)
{
-#if 0
- int e = 0;
-#endif
char *r, *p;
- p = r = strdup (s);
+ p = r = (char *) strdup (s);
while (*s) {
switch (*s) {
case '\\':
@@ -556,25 +449,11 @@
break;
case '[':
case ']':
- if ((unsigned long) p == (unsigned long) r || strlen (s) == 1)
- *p = *s;
- else {
-#if 0
- if (!strncmp (s, "[^", 2)) {
- *p = '\004';
- e = 1;
- s++;
- } else {
- if (e)
- *p = '\004';
- else
-#endif
- *p = '\003';
-#if 0
- e = 0;
- }
-#endif
- }
+ *p = '\003';
+ break;
+ case '{':
+ case '}':
+ *p = '\004';
break;
default:
*p = *s;
@@ -582,17 +461,10 @@
}
break;
case '*':
-/* a * or + at the beginning or end of the line must be interpreted literally */
- if ((unsigned long) p == (unsigned long) r || strlen (s) == 1)
- *p = '*';
- else
- *p = '\001';
+ *p = '\001';
break;
case '+':
- if ((unsigned long) p == (unsigned long) r || strlen (s) == 1)
- *p = '+';
- else
- *p = '\002';
+ *p = '\002';
break;
default:
*p = *s;
@@ -601,7 +473,7 @@
s++;
p++;
}
- *p = 0;
+ *p = '\0';
return r;
}
@@ -707,21 +579,21 @@
FILE *f;
char p[MAX_PATH_LEN];
syntax_free (error_file_name);
- error_file_name = strdup (filename);
+ error_file_name = (char *) strdup (filename);
if (*filename == '/')
return fopen (filename, "r");
strcpy (p, home_dir);
strcat (p, EDIT_DIR "/");
strcat (p, filename);
syntax_free (error_file_name);
- error_file_name = strdup (p);
+ error_file_name = (char *) strdup (p);
f = fopen (p, "r");
if (f)
return f;
strcpy (p, LIBDIR "/syntax/");
strcat (p, filename);
syntax_free (error_file_name);
- error_file_name = strdup (p);
+ error_file_name = (char *) strdup (p);
return fopen (p, "r");
}
@@ -735,7 +607,7 @@
char whole_left[512];
char *args[1024], *l = 0;
int save_line = 0, line = 0;
- struct context_rule **r, *c;
+ struct context_rule **r, *c = 0;
int num_words = -1, num_contexts = -1;
int argc, result = 0;
int i, j;
@@ -745,7 +617,7 @@
strcpy (whole_left, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
strcpy (whole_right, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
- r = edit->rules = syntax_malloc (256 * sizeof (struct context_rule *));
+ r = edit->rules = syntax_malloc (MAX_CONTEXTS * sizeof (struct context_rule *));
for (;;) {
char **a;
@@ -807,8 +679,8 @@
}
a++;
c = r[0] = syntax_malloc (sizeof (struct context_rule));
- c->left = strdup (" ");
- c->right = strdup (" ");
+ c->left = (char *) strdup (" ");
+ c->right = (char *) strdup (" ");
num_contexts = 0;
} else {
c = r[num_contexts] = syntax_malloc (sizeof (struct context_rule));
@@ -819,14 +691,14 @@
check_a;
if (!strcmp (*a, "whole")) {
a++;
- c->whole_word_chars_left = strdup (whole_left);
- c->whole_word_chars_right = strdup (whole_right);
+ c->whole_word_chars_left = (char *) strdup (whole_left);
+ c->whole_word_chars_right = (char *) strdup (whole_right);
} else if (!strcmp (*a, "wholeleft")) {
a++;
- c->whole_word_chars_left = strdup (whole_left);
+ c->whole_word_chars_left = (char *) strdup (whole_left);
} else if (!strcmp (*a, "wholeright")) {
a++;
- c->whole_word_chars_right = strdup (whole_right);
+ c->whole_word_chars_right = (char *) strdup (whole_right);
}
check_a;
if (!strcmp (*a, "linestart")) {
@@ -834,21 +706,22 @@
c->line_start_left = 1;
}
check_a;
- c->left = strdup (*a++);
+ c->left = (char *) strdup (*a++);
check_a;
if (!strcmp (*a, "linestart")) {
a++;
c->line_start_right = 1;
}
check_a;
- c->right = strdup (*a++);
- c->last_left = c->left[strlen (c->left) - 1];
- c->last_right = c->right[strlen (c->right) - 1];
+ c->right = (char *) strdup (*a++);
c->first_left = *c->left;
c->first_right = *c->right;
c->single_char = (strlen (c->right) == 1);
}
- c->keyword = syntax_malloc (1024 * sizeof (struct key_word *));
+ c->keyword = syntax_malloc (MAX_WORDS_PER_CONTEXT * sizeof (struct key_word *));
+#if 0
+ c->max_words = MAX_WORDS_PER_CONTEXT;
+#endif
num_words = 1;
c->keyword[0] = syntax_malloc (sizeof (struct key_word));
fg = *a;
@@ -865,9 +738,15 @@
c->keyword[0]->fg = this_allocate_color (edit, fg);
c->keyword[0]->bg = this_allocate_color (edit, bg);
#endif
- c->keyword[0]->keyword = strdup (" ");
+ c->keyword[0]->keyword = (char *) strdup (" ");
check_not_a;
num_contexts++;
+ } else if (!strcmp (args[0], "spellcheck")) {
+ if (!c) {
+ result = line;
+ break;
+ }
+ c->spelling = 1;
} else if (!strcmp (args[0], "keyword")) {
struct key_word *k;
if (num_words == -1)
@@ -876,14 +755,14 @@
k = r[num_contexts - 1]->keyword[num_words] = syntax_malloc (sizeof (struct key_word));
if (!strcmp (*a, "whole")) {
a++;
- k->whole_word_chars_left = strdup (whole_left);
- k->whole_word_chars_right = strdup (whole_right);
+ k->whole_word_chars_left = (char *) strdup (whole_left);
+ k->whole_word_chars_right = (char *) strdup (whole_right);
} else if (!strcmp (*a, "wholeleft")) {
a++;
- k->whole_word_chars_left = strdup (whole_left);
+ k->whole_word_chars_left = (char *) strdup (whole_left);
} else if (!strcmp (*a, "wholeright")) {
a++;
- k->whole_word_chars_right = strdup (whole_right);
+ k->whole_word_chars_right = (char *) strdup (whole_right);
}
check_a;
if (!strcmp (*a, "linestart")) {
@@ -895,8 +774,7 @@
*a = 0;
check_a;
}
- k->keyword = strdup (*a++);
- k->last = k->keyword[strlen (k->keyword) - 1];
+ k->keyword = (char *) strdup (*a++);
k->first = *k->keyword;
fg = *a;
if (*a)
@@ -930,6 +808,9 @@
free_args (args);
syntax_free (l);
+ if (!edit->rules[0])
+ syntax_free (edit->rules);
+
if (result)
return result;
@@ -939,28 +820,281 @@
}
{
- char first_chars[1024], *p;
- char last_chars[1024], *q;
+ char first_chars[MAX_WORDS_PER_CONTEXT + 2], *p;
for (i = 0; edit->rules[i]; i++) {
c = edit->rules[i];
p = first_chars;
- q = last_chars;
*p++ = (char) 1;
- *q++ = (char) 1;
- for (j = 1; c->keyword[j]; j++) {
+ for (j = 1; c->keyword[j]; j++)
*p++ = c->keyword[j]->first;
- *q++ = c->keyword[j]->last;
- }
*p = '\0';
- *q = '\0';
- c->keyword_first_chars = strdup (first_chars);
- c->keyword_last_chars = strdup (last_chars);
+ c->keyword_first_chars = malloc (strlen (first_chars) + 2);
+ strcpy (c->keyword_first_chars, first_chars);
}
}
return result;
}
+#if !defined (GTK) && !defined (MIDNIGHT)
+
+/* strdup and append c */
+static char *strdupc (char *s, int c)
+{
+ char *t;
+ int l;
+ strcpy (t = malloc ((l = strlen (s)) + 3), s);
+ t[l] = c;
+ t[l + 1] = '\0';
+ return t;
+}
+
+static void edit_syntax_clear_keyword (WEdit * edit, int context, int j)
+{
+ struct context_rule *c;
+ struct _syntax_marker *s;
+ c = edit->rules[context];
+/* first we clear any instances of this keyword in our cache chain (we used to just clear the cache chain, but this slows things down) */
+ for (s = edit->syntax_marker; s; s = s->next)
+ if (s->rule.keyword == j)
+ s->rule.keyword = 0;
+ else if (s->rule.keyword > j)
+ s->rule.keyword--;
+ free (c->keyword[j]->keyword);
+ free (c->keyword[j]->whole_word_chars_left);
+ free (c->keyword[j]->whole_word_chars_right);
+ free (c->keyword[j]);
+ memcpy (&c->keyword[j], &c->keyword[j + 1], (MAX_WORDS_PER_CONTEXT - j) * sizeof (struct keyword *));
+ strcpy (&c->keyword_first_chars[j], &c->keyword_first_chars[j + 1]);
+}
+
+
+FILE *spelling_pipe_in = 0;
+FILE *spelling_pipe_out = 0;
+pid_t ispell_pid = 0;
+
+
+/* adds a keyword for underlining into the keyword list for this context, returns 1 if too many words */
+static int edit_syntax_add_keyword (WEdit * edit, char *keyword, int context, time_t t)
+{
+ int j;
+ char *s;
+ struct context_rule *c;
+ c = edit->rules[context];
+ for (j = 1; c->keyword[j]; j++) {
+/* if a keyword has been around for more than TRANSIENT_WORD_TIME_OUT
+ seconds, then remove it - we don't want to run out of space or makes syntax highlighting to slow */
+ if (c->keyword[j]->time) {
+ if (c->keyword[j]->time + TRANSIENT_WORD_TIME_OUT < t) {
+ edit->force |= REDRAW_PAGE;
+ edit_syntax_clear_keyword (edit, context, j);
+ j--;
+ }
+ }
+ }
+/* are we out of space? */
+ if (j >= MAX_WORDS_PER_CONTEXT - 1)
+ return 1;
+/* add the new keyword and date it */
+ c->keyword[j + 1] = 0;
+ c->keyword[j] = syntax_malloc (sizeof (struct key_word));
+#ifdef MIDNIGHT
+ c->keyword[j]->fg = SPELLING_ERROR;
+#else
+ c->keyword[j]->fg = c->keyword[0]->fg;
+ c->keyword[j]->bg = SPELLING_ERROR;
+#endif
+ c->keyword[j]->keyword = (char *) strdup (keyword);
+ c->keyword[j]->first = *c->keyword[j]->keyword;
+ c->keyword[j]->whole_word_chars_left = (char *) strdup ("-'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ﹜ㄓ它壯貝帚型陋悖停眾斯順溢劃遞蝨螃謝藥齪а圴佮迓玿旂衲欶趹欹詘棰葮摵蜠樉賥濋錎膼瀔嚦黀蘜蠲");
+ c->keyword[j]->whole_word_chars_right = (char *) strdup ("-'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ﹜ㄓ它壯貝帚型陋悖停眾斯順溢劃遞蝨螃謝藥齪а圴佮迓玿旂衲欶趹欹詘棰葮摵蜠樉賥濋錎膼瀔嚦黀蘜蠲");
+ c->keyword[j]->time = t;
+ s = strdupc (c->keyword_first_chars, c->keyword[j]->first);
+ free (c->keyword_first_chars);
+ c->keyword_first_chars = s;
+ return 0;
+}
+
+/* checks spelling of the word at offset */
+static int edit_check_spelling_at (WEdit * edit, long byte_index)
+{
+ int context;
+ long p1, p2;
+ unsigned char *p, *q;
+ int r, c1, c2, j;
+ int ch;
+ time_t t;
+ struct context_rule *c;
+/* sanity check */
+ if (!edit->rules || byte_index > edit->last_byte)
+ return 0;
+/* in what context are we */
+ context = edit_get_rule (edit, byte_index).context;
+ c = edit->rules[context];
+/* does this context have `spellcheck' */
+ if (!edit->rules[context]->spelling)
+ return 0;
+/* find word start */
+ for (p1 = byte_index - 1;; p1--) {
+ ch = edit_get_byte (edit, p1);
+ if (isalpha (ch) || ch == '-' || ch == '\'')
+ continue;
+ break;
+ }
+ p1++;
+/* find word end */
+ for (p2 = byte_index;; p2++) {
+ ch = edit_get_byte (edit, p2);
+ if (isalpha (ch) || ch == '-' || ch == '\'')
+ continue;
+ break;
+ }
+ if (p2 <= p1)
+ return 0;
+/* create string */
+ q = p = malloc (p2 - p1 + 2);
+ for (; p1 < p2; p1++)
+ *p++ = edit_get_byte (edit, p1);
+ *p = '\0';
+ if (q[0] == '-' || strlen ((char *) q) > 40) { /* if you are using words over 40 characters, you are on your own */
+ free (q);
+ return 0;
+ }
+ time (&t);
+ for (j = 1; c->keyword[j]; j++) {
+/* if the keyword is present, then update its time only. if it is a fixed keyword from the rules file, then just return */
+ if (!strcmp (c->keyword[j]->keyword, (char *) q)) {
+ if (c->keyword[j]->time)
+ c->keyword[j]->time = t;
+ free (q);
+ return 0;
+ }
+ }
+/* feed it to ispell */
+ fprintf (spelling_pipe_out, "%s\n", (char *) q);
+ fflush (spelling_pipe_out);
+/* what does ispell say? */
+ do {
+ r = fgetc (spelling_pipe_in);
+ } while (r == -1 && errno == EINTR);
+ if (r == -1) {
+ free (q);
+ return 1;
+ }
+ if (r == '\n') { /* ispell sometimes returns just blank line if it is given bad characters */
+ free (q);
+ return 0;
+ }
+/* now read ispell output untill we get two blanks lines - we are not intersted in this part */
+ do {
+ c1 = fgetc (spelling_pipe_in);
+ } while (c1 == -1 && errno == EINTR);
+ for (;;) {
+ if (c1 == -1) {
+ free (q);
+ return 1;
+ }
+ do {
+ c2 = fgetc (spelling_pipe_in);
+ } while (c2 == -1 && errno == EINTR);
+ if (c1 == '\n' && c2 == '\n')
+ break;
+ c1 = c2;
+ }
+/* spelled ok */
+ if (r == '*' || r == '+' || r == '-') {
+ free (q);
+ return 0;
+ }
+/* not spelled ok - so add a syntax keyword for this word */
+ edit_syntax_add_keyword (edit, (char *) q, context, t);
+ free (q);
+ return 0;
+}
+
+char *option_alternate_dictionary = "";
+
+int edit_check_spelling (WEdit * edit)
+{
+ if (!option_auto_spellcheck)
+ return 0;
+/* magic arg to close up shop */
+ if (!edit) {
+ option_auto_spellcheck = 0;
+ goto close_spelling;
+ }
+/* do we at least have a syntax rule struct to put new wrongly spelled keyword in for highlighting? */
+ if (!edit->rules && !edit->explicit_syntax)
+ edit_load_syntax (edit, 0, UNKNOWN_FORMAT);
+ if (!edit->rules) {
+ option_auto_spellcheck = 0;
+ return 0;
+ }
+/* is ispell running? */
+ if (!spelling_pipe_in) {
+ int in, out, a = 0;
+ char *arg[10];
+ arg[a++] = "ispell";
+ arg[a++] = "-a";
+ if (option_alternate_dictionary)
+ if (*option_alternate_dictionary) {
+ arg[a++] = "-d";
+ arg[a++] = option_alternate_dictionary;
+ }
+ arg[a++] = "-a";
+ arg[a++] = 0;
+/* start ispell process */
+ ispell_pid = triple_pipe_open (&in, &out, 0, 1, arg[0], arg);
+ if (ispell_pid < 1) {
+ option_auto_spellcheck = 0;
+#if 0
+ CErrorDialog (0, 0, 0, _ (" Spelling Message "), "%s", _ (" Fail trying to open ispell program. \n Check that it is in your path and works with the -a option. \n Alternatively, disable spell checking from the Options menu. "));
+#endif
+ return 1;
+ }
+/* prepare pipes */
+ spelling_pipe_in = (FILE *) fdopen (out, "r");
+ spelling_pipe_out = (FILE *) fdopen (in, "w");
+ if (!spelling_pipe_in || !spelling_pipe_out) {
+ option_auto_spellcheck = 0;
+ CErrorDialog (0, 0, 0, _ (" Spelling Message "), "%s", _ (" Fail trying to open ispell pipes. \n Check that it is in your path and works with the -a option. \n Alternatively, disable spell checking from the Options menu. "));
+ return 1;
+ }
+/* read the banner message */
+ for (;;) {
+ int c1;
+ c1 = fgetc (spelling_pipe_in);
+ if (c1 == -1 && errno != EINTR) {
+ option_auto_spellcheck = 0;
+ CErrorDialog (0, 0, 0, _ (" Spelling Message "), "%s", _ (" Fail trying to read ispell pipes. \n Check that it is in your path and works with the -a option. \n Alternatively, disable spell checking from the Options menu. "));
+ return 1;
+ }
+ if (c1 == '\n')
+ break;
+ }
+ }
+/* spellcheck the word under the cursor */
+ if (edit_check_spelling_at (edit, edit->curs1)) {
+ CMessageDialog (0, 0, 0, 0, _ (" Spelling Message "), "%s", _ (" Error reading from ispell. \n Ispell is being restarted. "));
+ close_spelling:
+ fclose (spelling_pipe_in);
+ spelling_pipe_in = 0;
+ fclose (spelling_pipe_out);
+ spelling_pipe_out = 0;
+ kill (ispell_pid, SIGKILL);
+ }
+ return 0;
+}
+
+#else /* ! GTK && ! MIDNIGHT*/
+
+int edit_check_spelling (WEdit * edit)
+{
+ return 0;
+}
+
+#endif
+
void (*syntax_change_callback) (CWidget *) = 0;
void edit_set_syntax_change_callback (void (*callback) (CWidget *))
@@ -975,6 +1109,7 @@
return;
if (!edit->rules)
return;
+ edit_get_rule (edit, -1);
syntax_free (edit->syntax_type);
edit->syntax_type = 0;
if (syntax_change_callback)
@@ -998,7 +1133,6 @@
syntax_free (edit->rules[i]->whole_word_chars_right);
syntax_free (edit->rules[i]->keyword);
syntax_free (edit->rules[i]->keyword_first_chars);
- syntax_free (edit->rules[i]->keyword_last_chars);
syntax_free (edit->rules[i]);
}
for (;;) {
@@ -1012,7 +1146,7 @@
syntax_free (edit->rules);
}
-#define CURRENT_SYNTAX_RULES_VERSION "48"
+#define CURRENT_SYNTAX_RULES_VERSION "61"
char *syntax_text[] = {
"# syntax rules version " CURRENT_SYNTAX_RULES_VERSION,
@@ -1053,13 +1187,13 @@
"file ..\\*\\\\.lsm$ LSM\\sFile",
"include lsm.syntax",
"",
-"file ..\\*\\\\.sh$ Shell\\sScript ^#!\\s\\*/.\\*/(ksh|bash|sh|pdkzsh)$",
+"file ..\\*\\\\.sh$ Shell\\sScript ^#!\\s\\*/.\\*/(ksh|bash|sh|pdkzsh)",
"include sh.syntax",
"",
-"file ..\\*\\\\.(pl|PL])$ Perl\\sProgram ^#!\\s\\*/.\\*/perl$",
+"file ..\\*\\\\.(pl|PL])$ Perl\\sProgram ^#!\\s\\*/.\\*/perl",
"include perl.syntax",
"",
-"file ..\\*\\\\.(py|PY])$ Python\\sProgram ^#!\\s\\*/.\\*/python$",
+"file ..\\*\\\\.(py|PY])$ Python\\sProgram ^#!\\s\\*/.\\*/python",
"include python.syntax",
"",
"file ..\\*\\\\.(man|[0-9n]|[0-9]x)$ NROFF\\sSource",
@@ -1068,15 +1202,24 @@
"file ..\\*\\\\.(htm|html|HTM|HTML)$ HTML\\sFile",
"include html.syntax",
"",
-"file ..\\*\\\\.(pp|PP|pas|PAS)$ Pascal Program",
+"file ..\\*\\\\.(pp|PP|pas|PAS)$ Pascal\\sProgram",
"include pascal.syntax",
"",
+"file ..\\*\\\\.(ada|adb|ADA|ADB)$ Ada\\sProgram",
+"include ada95.syntax",
+"",
"file ..\\*\\\\.tex$ LaTeX\\s2.09\\sDocument",
"include latex.syntax",
"",
+"file ..\\*\\.(texi|texinfo|TEXI|TEXINFO)$ Texinfo\\sDocument",
+"include texinfo.syntax",
+"",
"file ..\\*\\\\.([chC]|CC|cxx|cc|cpp|CPP|CXX)$ C/C\\+\\+\\sProgram",
"include c.syntax",
"",
+"file ..\\*\\\\.i$ SWIG\\sSource",
+"include swig.syntax",
+"",
"file ..\\*\\\\.(java|JAVA|Java|jav)$ Java\\sProgram",
"include java.syntax",
"",
@@ -1092,9 +1235,13 @@
"file .\\*Makefile[\\\\\\.a-z]\\*$ Makefile",
"include makefile.syntax",
"",
+"file Don_t_match_me Mail\\sfolder ^From\\s",
+"include mail.syntax",
+"",
"file .\\*syntax$ Syntax\\sHighlighting\\sdefinitions",
"",
"context default",
+" keyword whole spellch\\eck yellow/24",
" keyword whole keyw\\ord yellow/24",
" keyword whole whole\\[\\t\\s\\]l\\inestart brightcyan/17",
" keyword whole whole\\[\\t\\s\\]l\\inestart brightcyan/17",
@@ -1165,12 +1312,16 @@
"",
"context linestart # \\n brown/22",
"",
+"file .\\* " UNKNOWN_FORMAT,
+"include unknown.syntax",
+"",
0};
FILE *upgrade_syntax_file (char *syntax_file)
{
FILE *f;
+ char *p;
char line[80];
f = fopen (syntax_file, "r");
if (!f) {
@@ -1185,31 +1336,26 @@
}
memset (line, 0, 79);
fread (line, 80, 1, f);
- if (!strstr (line, "syntax rules version")) {
+ if (!strstr (line, "syntax rules version"))
goto rename_rule_file;
- } else {
- char *p;
- p = strstr (line, "version") + strlen ("version") + 1;
- if (atoi (p) < atoi (CURRENT_SYNTAX_RULES_VERSION)) {
- char s[1024];
- rename_rule_file:
- strcpy (s, syntax_file);
- strcat (s, ".OLD");
- unlink (s);
- rename (syntax_file, s);
- unlink (syntax_file); /* might rename() fail ? */
+ p = strstr (line, "version") + strlen ("version") + 1;
+ if (atoi (p) < atoi (CURRENT_SYNTAX_RULES_VERSION)) {
+ char s[1024];
+ rename_rule_file:
+ strcpy (s, syntax_file);
+ strcat (s, ".OLD");
+ unlink (s);
+ rename (syntax_file, s);
+ unlink (syntax_file); /* might rename() fail ? */
#if defined(MIDNIGHT) || defined(GTK)
- edit_message_dialog (" Load Syntax Rules ", " Your syntax rule file is outdated \n A new rule file is being installed. \n Your old rule file has been saved with a .OLD extension. ");
+ edit_message_dialog (_(" Load Syntax Rules "), _(" Your syntax rule file is outdated \n A new rule file is being installed. \n Your old rule file has been saved with a .OLD extension. "));
#else
- CMessageDialog (0, 20, 20, 0, " Load Syntax Rules ", " Your syntax rule file is outdated \n A new rule file is being installed. \n Your old rule file has been saved with a .OLD extension. ");
+ CMessageDialog (0, 20, 20, 0,_(" Load Syntax Rules "), _(" Your syntax rule file is outdated \n A new rule file is being installed. \n Your old rule file has been saved with a .OLD extension. "));
#endif
- return upgrade_syntax_file (syntax_file);
- } else {
- rewind (f);
- return (f);
- }
+ return upgrade_syntax_file (syntax_file);
}
- return 0; /* not reached */
+ rewind (f);
+ return f;
}
/* returns -1 on file error, line number on error in file syntax */
@@ -1249,7 +1395,7 @@
break;
}
if (names) {
- names[count++] = strdup (args[2]);
+ names[count++] = (char *) strdup (args[2]);
names[count] = 0;
} else if (type) {
if (!strcmp (type, args[2]))
@@ -1266,17 +1412,19 @@
result = line_error;
} else {
syntax_free (edit->syntax_type);
- edit->syntax_type = strdup (args[2]);
+ edit->syntax_type = (char *) strdup (args[2]);
+/* if there are no rules then turn off syntax highlighting for speed */
+ if (!edit->rules[1])
+ if (!edit->rules[0]->keyword[1] && !edit->rules[0]->spelling) {
+ edit_free_syntax_rules (edit);
+ break;
+ }
if (syntax_change_callback)
#ifdef MIDNIGHT
(*syntax_change_callback) (&edit->widget);
#else
(*syntax_change_callback) (edit->widget);
#endif
-/* if there are no rules then turn off syntax highlighting for speed */
- if (!edit->rules[1])
- if (!edit->rules[0]->keyword[1])
- edit_free_syntax_rules (edit);
}
break;
}
diff -ruN old/mc-4.5.37/gtkedit/wordproc.c new/mc-4.5.38/gtkedit/wordproc.c
--- old/mc-4.5.37/gtkedit/wordproc.c Mon Jul 12 23:57:27 1999
+++ new/mc-4.5.38/gtkedit/wordproc.c Thu Sep 2 12:49:39 1999
@@ -20,6 +20,9 @@
#include
#include "edit.h"
+#if defined (HAVE_MAD) && ! defined (MIDNIGHT) && ! defined (GTK)
+#include "mad.h"
+#endif
#ifdef MIDNIGHT
#define tab_width option_tab_spacing
@@ -107,7 +110,11 @@
static char *get_paragraph (WEdit * edit, long p, long q, int indent, int *size)
{
char *s, *t;
+#if 0
t = malloc ((q - p) + 2 * (q - p) / option_word_wrap_line_length + 10);
+#else
+ t = malloc (2 * (q - p) + 100);
+#endif
if (!t)
return 0;
for (s = t; p < q; p++, s++) {
diff -ruN old/mc-4.5.37/icons/Makefile.in new/mc-4.5.38/icons/Makefile.in
--- old/mc-4.5.37/icons/Makefile.in Mon Jul 12 23:57:37 1999
+++ new/mc-4.5.38/icons/Makefile.in Thu Sep 2 12:49:45 1999
@@ -67,6 +67,6 @@
-$(RMF) $(srcdir)/*~ $(srcdir)/Makefile
distcopy:
- $(CP) $(DISTICONS) ../../mc-$(VERSION)/icons
+ for I in $(DISTICONS); do $(CP) $(top_srcdir)/icons/$$I $(top_srcdir)/mc-$(VERSION)/icons; done
depend dep:
diff -ruN old/mc-4.5.37/idl/Makefile.in new/mc-4.5.38/idl/Makefile.in
--- old/mc-4.5.37/idl/Makefile.in Mon Jul 12 23:57:39 1999
+++ new/mc-4.5.38/idl/Makefile.in Thu Sep 2 12:49:45 1999
@@ -38,7 +38,7 @@
do $(RMF) $(DESTDIR)$(idldir)/$$I; done
distcopy:
- $(CP) $(DISTFILES) ../../mc-$(VERSION)/idl
+ for I in $(DISTFILES); do $(CP) $(top_srcdir)/idl/$$I $(top_srcdir)/mc-$(VERSION)/idl; done
depend dep:
diff -ruN old/mc-4.5.37/intl/Makefile.in new/mc-4.5.38/intl/Makefile.in
--- old/mc-4.5.37/intl/Makefile.in Tue Feb 9 15:49:56 1999
+++ new/mc-4.5.38/intl/Makefile.in Thu Aug 19 20:17:00 1999
@@ -180,7 +180,7 @@
# GNU gettext needs not contain the file `VERSION' but contains some
# other files which should not be distributed in other packages.
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: Makefile $(DISTFILES)
if test "$(PACKAGE)" = gettext; then \
additional="$(DISTFILES.gettext)"; \
@@ -195,8 +195,8 @@
distcopy: Makefile $(DISTFILES)
additional="$(DISTFILES.normal)";
for file in $(DISTFILES.common) $$additional; do \
- ln $(srcdir)/$$file ../$(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file ../$(distdir); \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
done
dist-libc:
diff -ruN old/mc-4.5.37/lib/Makefile.in new/mc-4.5.38/lib/Makefile.in
--- old/mc-4.5.37/lib/Makefile.in Mon Jul 12 23:57:23 1999
+++ new/mc-4.5.38/lib/Makefile.in Thu Sep 2 12:49:37 1999
@@ -14,7 +14,7 @@
LIBFILES_IN = mc.ext.in mc-gnome.ext.in
LIBFILES_OUT = mc.ext mc-gnome.ext
-LIBFILES_CONST = mc.hint mc.lib mc.menu
+LIBFILES_CONST = mc.hint mc.hint.es mc.lib mc.menu
DESKTOP_FILES = startup.links README.desktop
TIFILES = README.xterm linux.ti xterm.ad xterm.ti ansi.ti vt100.ti xterm.tcap
@@ -74,6 +74,6 @@
-rmdir $(DESTDIR)$(mclibdir)
distcopy:
- $(CP) $(DISTLIB) ../../mc-$(VERSION)/lib
+ for I in $(DISTLIB); do $(CP) $(top_srcdir)/lib/$$I $(top_srcdir)/mc-$(VERSION)/lib; done
depend dep:
diff -ruN old/mc-4.5.37/lib/mc.hint.es new/mc-4.5.38/lib/mc.hint.es
--- old/mc-4.5.37/lib/mc.hint.es Wed Dec 31 19:00:00 1969
+++ new/mc-4.5.38/lib/mc.hint.es Thu Sep 2 12:49:37 1999
@@ -0,0 +1,49 @@
+Midnight Commander (c) 1995-1999 The Free Software Foundation
+Ayudita: C-x t copia los nombres de archivos en la l璯ea de 鏎denes.
+Ayudita: C-x p copia la trayectoria completa en la l璯ea de 鏎denes.
+Ayudita: C-x C-p copia la trayectoria del panel opuesto en la l璯ea de 鏎denes.
+Ayudita: M-Tab (o Esc+Tab) completa nombres; dos veces y muestra una lista.
+Ayudita: M-p y M-n permiten acceder al hist鏎ico de comandos.
+Ayudita: Para introducir un car塶ter especial: C-q y el caracter.
+Ayudita: 澦arto de mensajitos? Se quitan en el men Opciones/Presentaci鏮.
+Ayudita: Para seleccionar directorios a鎙dir "/" tras el patr鏮 a buscar.
+Ayudita: Si no funcionan las teclas de funci鏮, ESC+nmero sirve.
+Ayudita: El WWW del Midnight Commander est en http://www.gnome.org/mc/
+Ayudita: La ltima versi鏮 de MC en ftp://ftp.gnome.org/pub/GNOME/sources/mc
+Ayudita: Comunique cualquier defecto a mc-bugs@nuclecu.unam.mx
+Ayudita: El sitio oficial del Midnight Commander es http://www.gnome.org/mc/
+Ayudita: El tabulador cambia de panel.
+Ayudita: •l mejor VFS! Al en un archivo comprimido se ve su contenido.
+Ayudita: El Midnight Commander tiene manual: "man mc"
+Ayudita: 澳esea navegar con las flechas al estilo lynx? Est en Configuraci鏮.
+Ayudita: Las macros con % funcionan incluso en la l璯ea de 鏎denes.
+Ayudita: Con M-! puede ejecutar programas y ver la salida en el visor.
+Ayudita: El formato del listado se puede personalizar; "man mc" para ver pistas.
+Ayudita: %D/%T representa los archivos seleccionados en el panel opuesto.
+Ayudita: Con C-o se puede ir y volver a la shell de siempre.
+Ayudita: La variable CDPATH ahorra teclas al cambiar de directorios.
+Ayudita: Para ver los archivos .* basta indicarlo en Configuraci鏮.
+Ayudita: Para ver los archivos de seguridad tipo *~ ir a Configuraci鏮.
+Ayudita: 燐emoria real/virtual de sobra? Fijar el l璥ite para VFS en -1.
+Ayudita: Se puede auto-completar nombres tambi幯 en los di嫮ogos con M-Tab.
+Ayudita: En terminales lentos la opci鏮 -s puede ayudar.
+Ayudita: Puede "Llevar al panel" los resultados de "Buscar archivos" y usarlos.
+Ayudita: Puede hacer y guardar bsquedas complejas con "Bsquedas externas".
+Ayudita: Con M-c cambiar de directorio es un poco m嫳 c鏔odo.
+Nota: Los comandos de la Shell no funcionan fuera del sistema local.
+Ayudita: Con C-y puede recuperar texto eliminado.
+Ayudita: 澤lguna tecla rebelde? Puede educarla con "Redefinir teclas".
+Ayudita: Para ver la salida de un comando por el visor M-!
+Ayudita: F13 (o Maysculas-F3) invoca el visor en modo primitivo, sin formatos.
+Ayudita: 燕roblemas de teclas en terminales X? Use xterm.ad, .ti y .tcap
+Ayudita: F4 puede usar cualquier editor que indiquemos en la variable EDITOR.
+Ayudita: Se puede usar un visor externo indicado en la variable PAGER.
+Ayudita: Para deshabilitar los mensajes de Confirmaci鏮 vaya al men Opciones.
+Ayudita: Apunte los directorios m嫳 usados en "Directorios favoritos".
+Ayudita: Para hacer un FTP an鏮imo con mc: 'cd /#ftp:maquina.dominio'
+Ayudita: FTP est integrado en Midnight Commander, en "conexi鏮 por FTP..."
+Ayudita: M-t permite cambiar r嫚idamente entre varios tipos de listado.
+Ayudita: Para hacer un FTP no-an鏮imo: 'cd /#ftp:usuario@maquina.dominio'
+Ayudita: Para examinar un archivo RPM basta pulsar sobre 幨.
+Ayudita: Para copiar y pegar con rat鏮 mantener presionada la tecla MAY湒CULAS.
+Ayudita: Los ftp habituales se pueden guardar como "Directorios favoritos".
diff -ruN old/mc-4.5.37/lib/mc.sh new/mc-4.5.38/lib/mc.sh
--- old/mc-4.5.37/lib/mc.sh Mon Jul 12 23:57:23 1999
+++ new/mc-4.5.38/lib/mc.sh Thu Sep 2 12:49:37 1999
@@ -1,6 +1,8 @@
mc ()
{
- MC=/tmp/mc$$-"$RANDOM"
+ mkdir -p ~/.mc/tmp 2> /dev/null
+ chmod 700 ~/.mc/tmp
+ MC=~/.mc/tmp/mc$$-"$RANDOM"
/usr/bin/mc -P "$@" > "$MC"
cd "`cat $MC`"
rm "$MC"
diff -ruN old/mc-4.5.37/mc.spec new/mc-4.5.38/mc.spec
--- old/mc-4.5.37/mc.spec Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/mc.spec Thu Sep 2 12:49:35 1999
@@ -1,6 +1,7 @@
# Note that this is NOT a relocatable package
-%define ver 4.5.37
-%define rel 1
+%define ver 4.5.38
+%define RELEASE 1
+%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /usr
Summary: Midnight Commander visual shell
@@ -101,6 +102,7 @@
%{prefix}/lib/mc/syntax/*
%{prefix}/man/man1/*
%config /etc/profile.d/*
+%config /etc/mc.global
%dir %{prefix}/lib/mc
%dir %{prefix}/lib/mc/bin
@@ -120,9 +122,14 @@
%{prefix}/lib/mc/mc-gnome.ext
%{prefix}/share/pixmaps/mc/*
%{prefix}/share/mime-info/mc.keys
+%{prefix}/share/gnome/help/gmc/*
+%{prefix}/share/locale/*
%config /etc/CORBA/servers/*
%changelog
+* Mon Jul 12 1999 Kjartan Maraas
+- added help and locale files to %files
+
* Tue Jun 22 1999 Vladimir Kondratiev
- added syntax files to %files
diff -ruN old/mc-4.5.37/mc.spec.in new/mc-4.5.38/mc.spec.in
--- old/mc-4.5.37/mc.spec.in Mon Jul 12 23:57:18 1999
+++ new/mc-4.5.38/mc.spec.in Thu Sep 2 12:49:35 1999
@@ -1,6 +1,7 @@
# Note that this is NOT a relocatable package
%define ver @VERSION@
-%define rel 1
+%define RELEASE 1
+%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /usr
Summary: Midnight Commander visual shell
@@ -101,6 +102,7 @@
%{prefix}/lib/mc/syntax/*
%{prefix}/man/man1/*
%config /etc/profile.d/*
+%config /etc/mc.global
%dir %{prefix}/lib/mc
%dir %{prefix}/lib/mc/bin
@@ -120,9 +122,14 @@
%{prefix}/lib/mc/mc-gnome.ext
%{prefix}/share/pixmaps/mc/*
%{prefix}/share/mime-info/mc.keys
+%{prefix}/share/gnome/help/gmc/*
+%{prefix}/share/locale/*
%config /etc/CORBA/servers/*
%changelog
+* Mon Jul 12 1999 Kjartan Maraas
+- added help and locale files to %files
+
* Tue Jun 22 1999 Vladimir Kondratiev
- added syntax files to %files
diff -ruN old/mc-4.5.37/new_icons/Makefile.in new/mc-4.5.38/new_icons/Makefile.in
--- old/mc-4.5.37/new_icons/Makefile.in Mon Jul 12 23:57:32 1999
+++ new/mc-4.5.38/new_icons/Makefile.in Thu Sep 2 12:49:44 1999
@@ -41,6 +41,7 @@
gnome-http-url.png \
gnome-image-generic.png \
gnome-application-encapsulated_postscript.png \
+ gnome-application-pdf.png \
gnome-application-postscript.png \
gnome-application-x-c-header.png \
gnome-application-x-c-source.png \
@@ -97,6 +98,6 @@
-$(RMF) $(srcdir)/*~ $(srcdir)/Makefile
distcopy:
- $(CP) $(DISTICONS) ../../mc-$(VERSION)/new_icons
+ for I in $(DISTICONS); do $(CP) $(top_srcdir)/new_icons/$$I $(top_srcdir)/mc-$(VERSION)/new_icons; done
depend dep:
Binary files old/mc-4.5.37/new_icons/gnome-application-pdf.png and new/mc-4.5.38/new_icons/gnome-application-pdf.png differ
diff -ruN old/mc-4.5.37/pc/BUGS new/mc-4.5.38/pc/BUGS
--- old/mc-4.5.37/pc/BUGS Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/BUGS Wed Dec 31 19:00:00 1969
@@ -1,15 +0,0 @@
-BUGS OF PC port
-
-- Troubles with keys (Ctrl-Tab, Gray +,-,*, Alt-Shift-A etc)
-- Filtered view hangs in close_pipe() because error is set, but nothing
-is available on stderr
-- Windows '95 will not delete directory if not empty. (as it does
- not return ENOTEMPTY but ENOACCESS)! Already fixed?
-- Windows '95 will not allow "''" in root drives
-- OS/2 port uses always screen size 80x25. Do we need newer SLang?
-- IBM C++ has some problems with O_TEXT -> troubles with editor
-- OS/2 port causes access violation while copying files.
-- getcwd from EMX returns a UNIX-like path -> drive change fails.
-
--please report!
-
diff -ruN old/mc-4.5.37/pc/ChangeLog new/mc-4.5.38/pc/ChangeLog
--- old/mc-4.5.37/pc/ChangeLog Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/ChangeLog Wed Dec 31 19:00:00 1969
@@ -1,42 +0,0 @@
-1999-01-08 Miguel de Icaza
-
- * chmod.c (chmod_cmd): Killed the tk_end_frame and tk_new_frame
- macros.
-
-Wed Oct 14 14:51:23 1998 Franco Bez
-
- * gtkedit/edit.c: Workarround for the CR/LF Translation problem.
- This is vital, because otherwise CoolEdit corrupts files -
- they keep growing each time you save the file.
-
- * pc/key_nt.c: fixed the problem with the AltGr Key and the
- Gray Keys. Still not optimal, but usable.
- Especially usefull for international keyboard
-
- * pc/util_nt.c: Provide a mc_doublepopen and mc_doublepclose
- function. If one has an egrep.exe installed it's now possible
- to search for files containing a search pattern.
-
-Tue May 12 17:16:43 1998 Pavel Roskin
-
- * Makefile.RSX, mc.rc: Resources support for RSX
-
- * Makefile.PC, *.c: Some includes corrected for MinGW
- compatability (dir.h exists both in mc and MinGW)
-
-Fri May 8 10:49:21 1998 Pavel Roskin
-
- * Makefile.PC, Makefile.MIN: support for custom extension
- for compiled resourses
-
- * key_nt.c: Minor changes for MinGW
-
- * mc.rc: WindRes support
-
- * slint_pc.c: support for syntax highlighting
-
-Fri May 1 17:33:11 1998 Pavel Roskin
-
- * chmod.c: Updated call to update_panels()
-
- * config.h, Makefile.MIN: Support for MinGW added
diff -ruN old/mc-4.5.37/pc/Makefile new/mc-4.5.38/pc/Makefile
--- old/mc-4.5.37/pc/Makefile Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile Wed Dec 31 19:00:00 1969
@@ -1,40 +0,0 @@
-#
-# This makefile is for making the distribution on Unix
-# You won't be able to compile with this one the Midnight Commander
-# on Windows NT or OS/2
-#
-# Please read the file README in this directory if you want to compile
-# the Midnight Commander for Windows NT or OS/2
-#
-
-include ../Make.common
-
-FILES = BUGS Makefile Makefile.BC2 Makefile.BC5 Makefile.EMX \
- Makefile.MIN Makefile.IBM Makefile.PC Makefile.VC4 \
- Makefile.RSX README TODO ChangeLog chmod.c config.h \
- cons_nt.c cons_os2.c dirent.h dirent_nt.c dirent_os2.c \
- drive.c drive.h key_nt.c key_os2.c mc.def mc.rc mc_nt.ico \
- mc_os2.ico slint_pc.c trace_nt.c trace_nt.h util_nt.c \
- util_os2.c util_win32.c util_win32.h util_winnt.c
-
-FILESSYS = sys/param.h sys/time.h
-
-all:
-
-TAGS: $(FILES)
- etags $(FILES)
-
-clean realclean distclean cross:
-
-install:
-
-uninstall:
-
-depend dep:
-
-fastdeploc:
-
-distcopy:
- $(CP) $(FILES) ../../mc-$(VERSION)/pc
- -mkdir ../../mc-$(VERSION)/pc/sys
- $(CP) $(FILESSYS) ../../mc-$(VERSION)/pc/sys
diff -ruN old/mc-4.5.37/pc/Makefile.BC2 new/mc-4.5.38/pc/Makefile.BC2
--- old/mc-4.5.37/pc/Makefile.BC2 Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.BC2 Wed Dec 31 19:00:00 1969
@@ -1,57 +0,0 @@
-# Makefile.BC2
-#
-# Midnight Commander for OS/2 makefile
-# for Borland C++ 2
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# 980316 hacked by Pavel Roskin to make it work with Borland C++
-# --------------------------------------------------------------------------
-
-TARGET_OS=OS2
-
-CC=bcc.exe
-LINK=bcc.exe
-OBJ_SUFFIX=obj
-OBJ_PLACE=-o
-EXE_PLACE=-e
-# Just comment RSC out if you have problems with resources
-# RSC=rc.exe
-# RES_PLACE=-fo
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=-D__MT__ -I../src -I../edit
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-v -y $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=-lv
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-D_DEBUG
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-O2 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-DRELEASE=$(RELEASE)
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are usualy compiler-specific
-
-MC_LIBS=c2mt.lib
-SPECIFIC_MC_LFLAGS=$(SPECIFIC_MC_LFLAGS_EXTRA)
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(LINK) $(EXE_PLACE)$(MC_EXE) $(SPECIFIC_MC_LFLAGS) $+ $(MC_LIBS)
diff -ruN old/mc-4.5.37/pc/Makefile.BC5 new/mc-4.5.38/pc/Makefile.BC5
--- old/mc-4.5.37/pc/Makefile.BC5 Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.BC5 Wed Dec 31 19:00:00 1969
@@ -1,56 +0,0 @@
-# Makefile.BC5
-#
-# Midnight Commander for Win32 makefile
-# for Borland C++ 5.01
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# 980316 hacked by Pavel Roskin to make it work with Borland C++
-# --------------------------------------------------------------------------
-
-TARGET_OS=NT
-
-CC=bcc32.exe
-LINK=bcc32.exe
-OBJ_SUFFIX=obj
-OBJ_PLACE=-o
-EXE_PLACE=-e
-# Just comment RSC out if you have problems with resources
-# RSC=rc.exe
-# RES_PLACE=-fo
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=-I../edit -I../src
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=trace_nt.c
-SPECIFIC_DEFINES=-DHAVE_TRACE
-SPECIFIC_MC_CFLAGS=-v -y $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=-lv
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-D_DEBUG
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=$(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-DRELEASE=$(RELEASE)
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are usualy compiler-specific
-SPECIFIC_MC_LFLAGS=$(SPECIFIC_MC_LFLAGS_EXTRA)
-MC_LIBS=
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(LINK) $(EXE_PLACE)$(MC_EXE) $(SPECIFIC_MC_LFLAGS) $+ $(MC_LIBS)
diff -ruN old/mc-4.5.37/pc/Makefile.EMX new/mc-4.5.38/pc/Makefile.EMX
--- old/mc-4.5.37/pc/Makefile.EMX Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.EMX Wed Dec 31 19:00:00 1969
@@ -1,56 +0,0 @@
-# Makefile.EMX
-#
-# Midnight Commander for OS/2 makefile
-# for EMX+GCC
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# --------------------------------------------------------------------------
-
-TARGET_OS=OS2
-
-CC=gcc.exe
-LINK=gcc.exe
-OBJ_SUFFIX=o
-OBJ_PLACE=-o
-EXE_PLACE=-o
-# Just comment RSC out if you have problems with resources
-# RSC=rc.exe
-# RES_PLACE=-fo
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=-Zmt
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-g -O0 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-D_DEBUG
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-O2 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-DRELEASE=$(RELEASE)
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are very compiler-specific
-
-SPECIFIC_MC_LFLAGS= -Zmt $(SPECIFIC_MC_LFLAGS_EXTRA)
-MC_LIBS=
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(LINK) $(EXE_PLACE) $(MC_EXE) $(MC_LIBS) $(SPECIFIC_MC_LFLAGS) $+
diff -ruN old/mc-4.5.37/pc/Makefile.IBM new/mc-4.5.38/pc/Makefile.IBM
--- old/mc-4.5.37/pc/Makefile.IBM Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.IBM Wed Dec 31 19:00:00 1969
@@ -1,62 +0,0 @@
-# Makefile.IBM
-#
-# Midnight Commander for OS/2 makefile
-# for IBM CSet and Visual Age C++
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# 980327 hacked by Pavel Roskin to make it work with Visual Age C++
-# --------------------------------------------------------------------------
-
-TARGET_OS=OS2
-
-CC=icc.exe
-LINK=icc.exe
-OBJ_SUFFIX=obj
-OBJ_PLACE=-Fo
-EXE_PLACE=-Fe
-# Just comment RSC out if you have problems with resources
-# RSC=rc.exe
-# RES_PLACE=-fo
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=-Q -Gm -I../src
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-Ti $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=-Ti
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-D_DEBUG
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-O $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-DRELEASE=$(RELEASE)
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are very compiler-specific
-
-SPECIFIC_MC_LFLAGS= -Q -Gm $(SPECIFIC_MC_LFLAGS_EXTRA)
-MC_LIBS=
-MC_DEF=$(MC_PC_DIR)/mc.def
-
-LINK_CMD=$(LINK) $(EXE_PLACE)$(MC_EXE) $(SPECIFIC_MC_LFLAGS) $(MC_RES) \
- $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS) $(MC_LIBS) $(MC_DEF)
-_LINK_CMD=$(subst /,\\,$(LINK_CMD))
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(_LINK_CMD)
diff -ruN old/mc-4.5.37/pc/Makefile.MIN new/mc-4.5.38/pc/Makefile.MIN
--- old/mc-4.5.37/pc/Makefile.MIN Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.MIN Wed Dec 31 19:00:00 1969
@@ -1,57 +0,0 @@
-# Makefile.MIN
-#
-# Midnight Commander for NT makefile
-# for MinGW
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# --------------------------------------------------------------------------
-
-TARGET_OS=NT
-
-CC=gcc.exe
-LINK=gcc.exe
-OBJ_SUFFIX=o
-OBJ_PLACE=-o
-EXE_PLACE=-o
-# Just comment RSC out if you have problems with resources
-RSC=windres.exe
-RES_PLACE=-o
-RES_SUFFIX=o
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-g -O0 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=--define WINDRES --define _DEBUG
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-O2 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=--define WINDRES --define RELEASE=$(RELEASE)
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are very compiler-specific
-
-SPECIFIC_MC_LFLAGS=$(SPECIFIC_MC_LFLAGS_EXTRA)
-MC_LIBS=
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(LINK) $(EXE_PLACE) $(MC_EXE) $(MC_LIBS) $(SPECIFIC_MC_LFLAGS) $+
diff -ruN old/mc-4.5.37/pc/Makefile.PC new/mc-4.5.38/pc/Makefile.PC
--- old/mc-4.5.37/pc/Makefile.PC Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.PC Wed Dec 31 19:00:00 1969
@@ -1,185 +0,0 @@
-# Makefile.PC
-#
-# This is the Makefile for Midnight Commander under OS/2 and Windows NT
-#
-# Written by Dan Nicolaescu
-# 970423 hacked by Juan f. Grigera
-# 970525 hacked again by jfg to add internal editor
-# 971127 hacked by Pavel Roskin to make it work with mc-4.1.11
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# 980329 changed by Pavel Roskin to make it common for OS/2 and NT
-#
-# Supported Compilers:
-#
-# For Windows NT:
-# Makefile.VC4: Microsoft Visual C++ 4.0 and above
-# Makefile.BC5: Borland C++ 5.x
-# Makefile.MIN: MinGW
-# Makefile.RSX: RSX
-# For OS/2:
-# Makefile.EMX: EMX/GCC
-# Makefile.BC2: Borland C++ 2.x
-# Makefile.IBM: IBM CSet or Visual Age C++
-# ...
-
-# ---- Directories
-MC_PC_DIR=.
-MC_SRC_DIR=../src
-VFS_DIR=../vfs
-MCEDIT_SRC_DIR=../edit
-MCGTKEDIT_SRC_DIR=../edit
-MCEDIT_OBJS_DIR=$(OBJS_DIR)/edit
-SLANG_SRC_DIR=../slang
-SLANG_OBJS_DIR=$(OBJS_DIR)/slang
-MC_EXE=$(OBJS_DIR)/mc.exe
-
-# --- Midnight Defines
-COMMON_DEFINES=-DMC_$(TARGET_OS) $(SPECIFIC_DEFINES)
-MC_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
-MC_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-SLANG_DEFINES=$(COMMON_DEFINES)
-SLANG_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-MCEDIT_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
-MCEDIT_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-
-CFLAGS=$(SPECIFIC_MC_CFLAGS) $(MC_INCLUDES) $(MC_DEFINES) -c
-SLANG_CFLAGS=$(SPECIFIC_SLANG_CFLAGS) $(SLANG_INCLUDES) $(SLANG_DEFINES) -c
-MCEDIT_CFLAGS=$(SPECIFIC_MCEDIT_CFLAGS) $(MCEDIT_INCLUDES) $(MCEDIT_DEFINES) -c
-
-
-all: object-dirs mc
-object-dirs: $(OBJS_DIR) $(SLANG_OBJS_DIR) $(MCEDIT_OBJS_DIR)
-
-mc: $(MC_EXE)
-
-clean:
- deltree -y "$(SLANG_OBJS_DIR)"
- deltree -y "$(MCEDIT_OBJS_DIR)"
- deltree -y "$(OBJS_DIR)"
-
-$(OBJS_DIR):
- mkdir "$@"
-
-$(SLANG_OBJS_DIR):
- mkdir "$@"
-
-$(MCEDIT_OBJS_DIR):
- mkdir "$@"
-
-$(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_PC_DIR)/%.c
- $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_SRC_DIR)/%.c
- $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(SLANG_OBJS_DIR)/%.$(OBJ_SUFFIX): $(SLANG_SRC_DIR)/%.c
- $(CC) $(SLANG_CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX): $(MCEDIT_SRC_DIR)/%.c
- $(CC) $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX) $(MCGTKEDIT_SRC_DIR)/%.c
- $(CC) -I$(MCGTKEDIT_SRC_DIR) -I$(MCEDIT_SRC_DIR) -I$(MCEDIT_SRC_DIR)/.. $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
-
-MC_SRCS= \
- terms.c \
- user.c \
- file.c \
- filegui.c \
- filenot.c \
- findme.c \
- listmode.c \
- cmd.c \
- command.c \
- help.c \
- menu.c \
- view.c \
- dir.c \
- info.c \
- widget.c \
- option.c \
- dlg.c \
- panelize.c \
- profile.c \
- util.c \
- dialog.c \
- ext.c \
- color.c \
- layout.c \
- setup.c \
- regex.c \
- hotlist.c \
- tree.c \
- win.c \
- complete.c \
- find.c \
- wtools.c \
- boxes.c \
- background.c \
- main.c \
- popt.c \
- text.c \
- screen.c
-
-PC_SRCS= \
- slint_pc.c \
- chmod.c \
- drive.c
-
-NT_SRCS= \
- cons_nt.c \
- dirent_nt.c \
- key_nt.c \
- util_win32.c \
- util_winnt.c \
- util_nt.c
-
-OS2_SRCS= \
- cons_os2.c \
- dirent_os2.c \
- key_os2.c \
- util_os2.c
-
-SLANG_NT=slw32tty.c
-SLANG_OS2=slos2tty.c
-
-SLANG_SRCS= \
- slerr.c \
- slgetkey.c \
- slsmg.c \
- slvideo.c \
- $(SLANG_$(TARGET_OS))
-
-MCEDIT_SRCS= \
- edit.c \
- editcmd.c \
- editdraw.c \
- editmenu.c \
- editoptions.c \
- editwidget.c \
- syntax.c \
- wordproc.c
-
-SRCS=$(MC_SRCS) $(PC_SRCS) $($(TARGET_OS)_SRCS) $(EXTRA_MC_SRCS)
-
-OBJS=$(addprefix $(OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(SRCS)))
-SLANG_OBJS=$(addprefix $(SLANG_OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(SLANG_SRCS)))
-MCEDIT_OBJS=$(addprefix $(MCEDIT_OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(MCEDIT_SRCS)))
-
-ifdef RSC
-
-ifndef RES_SUFFIX
-RES_SUFFIX=res
-endif # RES_SUFFIX
-
-MC_RES=$(OBJS_DIR)/mc.$(RES_SUFFIX)
-
-$(MC_RES): $(MC_PC_DIR)/mc.rc $(MC_PC_DIR)/mc_nt.ico $(MC_PC_DIR)/config.h ../VERSION
- $(RSC) $(RES_PLACE)$(MC_RES) $(RC_DEFINES) $(MC_PC_DIR)/mc.rc
-
-else
-MC_RES=
-endif # !RSC
diff -ruN old/mc-4.5.37/pc/Makefile.RSX new/mc-4.5.38/pc/Makefile.RSX
--- old/mc-4.5.37/pc/Makefile.RSX Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.RSX Wed Dec 31 19:00:00 1969
@@ -1,59 +0,0 @@
-# Makefile.RSX
-#
-# Midnight Commander for NT makefile
-# for RSX
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# --------------------------------------------------------------------------
-
-TARGET_OS=NT
-
-CC=gcc.exe
-LINK=gcc.exe
-OBJ_SUFFIX=o
-OBJ_PLACE=-o
-EXE_PLACE=-o
-# Just comment RSC out if you have problems with resources
-RSC=grc.exe
-RES_PLACE=-o
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=-Zrsx32
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-g -O0 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-O2 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are very compiler-specific
-
-SPECIFIC_MC_LFLAGS=-Zrsx32 $(SPECIFIC_MC_LFLAGS_EXTRA)
-MC_LIBS=-lvideont -ladvapi32
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(LINK) $(EXE_PLACE) $(MC_EXE) $(SPECIFIC_MC_LFLAGS) $+ $(MC_LIBS)
-
-resources: $(MC_RES)
- rsrc $(MC_EXE) $(MC_RES)
diff -ruN old/mc-4.5.37/pc/Makefile.VC4 new/mc-4.5.38/pc/Makefile.VC4
--- old/mc-4.5.37/pc/Makefile.VC4 Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/Makefile.VC4 Wed Dec 31 19:00:00 1969
@@ -1,56 +0,0 @@
-# Makefile.VC4
-#
-# Midnight Commander for Win32 makefile
-# for Microsoft Visual C++ 4.x and above
-#
-# Hacked by Dan Nicolaescu from Visual IDE mak
-# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# --------------------------------------------------------------------------
-
-TARGET_OS=NT
-
-CC=cl.exe
-LINK=link.exe
-OBJ_SUFFIX=obj
-OBJ_PLACE=-Fo
-EXE_PLACE=-out:
-# Just comment RSC out if you have problems with resources
-RSC=rc.exe
-RES_PLACE=-fo
-
-# ---- Compiler-specific optional stuff
-MC_MISC_CFLAGS=-nologo -YX -Fp$(OBJS_DIR)/mc.pch
-
-ifndef RELEASE
-# ---- Debug build
-OBJS_DIR=debug
-EXTRA_MC_SRCS=trace_nt.c
-SPECIFIC_DEFINES=-DHAVE_TRACE
-SPECIFIC_MC_CFLAGS=-MLd -W3 -Gm -Zi -Od -Fd$(OBJS_DIR)/mc.pdb $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=-debug -incremental:yes
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-D_DEBUG
-else
-# ---- Release build
-OBJS_DIR=release
-EXTRA_MC_SRCS=
-SPECIFIC_DEFINES=
-SPECIFIC_MC_CFLAGS=-ML -W3 -O2 $(MC_MISC_CFLAGS)
-SPECIFIC_MC_LFLAGS_EXTRA=-incremental:no
-SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
-RC_DEFINES=-DRELEASE=$(RELEASE)
-endif
-
-# ---- Compiler independent defines
-include Makefile.PC
-
-# ---- Linkers are usualy compiler-specific
-SPECIFIC_MC_LFLAGS=-nologo -subsystem:console -pdb:$(OBJS_DIR)/mc.pdb \
- -machine:I386 $(SPECIFIC_MC_LFLAGS_EXTRA)
-MC_LIBS=advapi32.lib
-
-$(MC_EXE): $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
- $(LINK) $(EXE_PLACE)$(MC_EXE) $(MC_LIBS) $(SPECIFIC_MC_LFLAGS) $+
diff -ruN old/mc-4.5.37/pc/README new/mc-4.5.38/pc/README
--- old/mc-4.5.37/pc/README Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/README Wed Dec 31 19:00:00 1969
@@ -1,41 +0,0 @@
- This is the port of Midnight Commander for OS/2, Windows 95 and Windows NT.
-
- This port is based on the port for Windows NT by
- Juan Grigera
-and the port for OS/2 by
- Alexander Dong
-and is currently maintained by
- Pavel Roskin
-
- This port of the Midnight Commander is released under the GNU General
-Public License version 2.0 or any later version. See file COPYING for
-details.
-
- Following compilers are supported:
- For Windows NT:
- Makefile.VC4: Microsoft Visual C++ 4.0 and above
- Makefile.BC5: Borland C++ 5.x
- For OS/2:
- Makefile.EMX: EMX/GCC
- Makefile.BC2: Borland C++ 2.x
- Makefile.IBM: IBM CSet or Visual Age C++
-
- You need GNU make in order to compile mc. Other implementation of
-make will not work! Run
-
-gmake -f Makefile.xxx [RELEASE=1]
-
-where gmake is name of GNU make and Makefile.xxx is the makefile for
-your compiler. You may want to add RELEASE=1 if you want to compile an
-optimized version without debug information.
- Please note, that not all compilers are equal. You may need to create
-dummy include files or change something in order to be able to compile
-mc. BUT PLEASE DON'T TRY TO INCORPORATE SUCH QUICK HACKS INTO THE
-MC DISTRIBUTION! Try to make your changes work with all other compilers.
- If you add a file, don't forget to add it into FILES statement of
-Makefile in this directory. Otherwise this file will not be copied to
-the distribution.
- This port is not very stable now. See files BUGS and TODO in this
-directory.
-
-Pavel Roskin
diff -ruN old/mc-4.5.37/pc/TODO new/mc-4.5.38/pc/TODO
--- old/mc-4.5.37/pc/TODO Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/TODO Wed Dec 31 19:00:00 1969
@@ -1,12 +0,0 @@
-TODO
-
-- Make most files common for OS/2 and NT
-- Move settings from mc.ini to the registry for Windows NT/95 (optionally?)
-- Fix opendir/readdir d_date and d_time packing (they return 10).
-- Fix gettimeofday()
-- Write a better stat function than the one RTL gives us. We can provide
-user ID (on NT) and rwx permissions.
-- Optionally use vfsapi.lib for ext2 filesystems on OS/2
-- Write the VFS
-- Write a better documentation
-- Write a better canonify_pathname()
diff -ruN old/mc-4.5.37/pc/chmod.c new/mc-4.5.38/pc/chmod.c
--- old/mc-4.5.37/pc/chmod.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/chmod.c Wed Dec 31 19:00:00 1969
@@ -1,490 +0,0 @@
-/* Chmod command for Windows NT and OS/2
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include
-
-#ifdef __os2__
-#define INCL_DOSFILEMGR
-#include
-#endif
-
-#ifdef _OS_NT
-#include
-#endif
-
-#include
-#include
-/* for chmod and stat */
-#include
-#include
-#include
-#include "../src/tty.h"
-#include "../src/mad.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/color.h"
-#include "../src/dlg.h"
-#include "../src/widget.h"
-#include "../src/dialog.h" /* For do_refresh() */
-
-#include "../src/dir.h"
-#include "../src/panel.h" /* Needed for the externs */
-#include "../src/file.h"
-#include "../src/main.h"
-#include "../src/chmod.h"
-#include "../src/achown.h"
-#include "../src/chown.h"
-
-#ifdef _OS_NT
-#define FILE_ARCHIVED FILE_ATTRIBUTE_ARCHIVE
-#define FILE_DIRECTORY FILE_ATTRIBUTE_DIRECTORY
-#define FILE_HIDDEN FILE_ATTRIBUTE_HIDDEN
-#define FILE_READONLY FILE_ATTRIBUTE_READONLY
-#define FILE_SYSTEM FILE_ATTRIBUTE_SYSTEM
-#define mk_chmod(fname,st) SetFileAttributes(fname,st)
-#endif
-
-static int single_set;
-struct Dlg_head *ch_dlg;
-
-#define PX 5
-#define PY 2
-
-#define FX 40
-#define FY 2
-
-#define BX 6
-#define BY 17
-
-#define TX 40
-#define TY 12
-
-#define PERMISSIONS 4
-#define BUTTONS 6
-
-#define B_MARKED B_USER
-#define B_ALL B_USER+1
-#define B_SETMRK B_USER+2
-#define B_CLRMRK B_USER+3
-
-int mode_change, need_update;
-int c_file, end_chmod;
-
-umode_t and_mask, or_mask, c_stat;
-char *c_fname, *c_fown, *c_fgrp, *c_fperm;
-int c_fsize;
-
-static WLabel *statl;
-static int normal_color;
-static int title_color;
-static int selection_color;
-
-/* bsedos.h */
-struct {
- mode_t mode;
- char *text;
- int selected;
- WCheck *check;
-} check_perm[PERMISSIONS] = {
-
- {
- FILE_ARCHIVED, "Archive", 0, 0,
- },
- {
- FILE_READONLY, "Read Only", 0, 0,
- },
- {
- FILE_HIDDEN, "Hidden", 0, 0,
- },
- {
- FILE_SYSTEM, "System", 0, 0,
- },
-};
-
-struct {
- int ret_cmd, flags, y, x;
- char *text;
-} chmod_but[BUTTONS] = {
-
- {
- B_CANCEL, NORMAL_BUTTON, 2, 33, "&Cancel",
- },
- {
- B_ENTER, DEFPUSH_BUTTON, 2, 17, "&Set",
- },
- {
- B_CLRMRK, NORMAL_BUTTON, 0, 42, "C&lear marked",
- },
- {
- B_SETMRK, NORMAL_BUTTON, 0, 27, "S&et marked",
- },
- {
- B_MARKED, NORMAL_BUTTON, 0, 12, "&Marked all",
- },
- {
- B_ALL, NORMAL_BUTTON, 0, 0, "Set &all",
- },
-};
-
-static void chmod_toggle_select (void)
-{
- int Id = ch_dlg->current->dlg_id - BUTTONS + single_set * 2;
-
- attrset (normal_color);
- check_perm[Id].selected ^= 1;
-
- dlg_move (ch_dlg, PY + PERMISSIONS - Id, PX + 1);
- addch ((check_perm[Id].selected) ? '*' : ' ');
- dlg_move (ch_dlg, PY + PERMISSIONS - Id, PX + 3);
-}
-
-static void chmod_refresh (void)
-{
- attrset (normal_color);
- dlg_erase (ch_dlg);
-
- draw_box (ch_dlg, 1, 2, 20 - single_set, 66);
- draw_box (ch_dlg, PY, PX, PERMISSIONS + 2, 33);
- draw_box (ch_dlg, FY, FX, 10, 25);
-
- dlg_move (ch_dlg, FY + 1, FX + 2);
- addstr ("Name");
- dlg_move (ch_dlg, FY + 3, FX + 2);
- addstr ("Permissions (Octal)");
- dlg_move (ch_dlg, FY + 5, FX + 2);
- addstr ("Owner name");
- dlg_move (ch_dlg, FY + 7, FX + 2);
- addstr ("Group name");
-
- attrset (title_color);
- dlg_move (ch_dlg, 1, 28);
- addstr (" Chmod command ");
- dlg_move (ch_dlg, PY, PX + 1);
- addstr (" Permission ");
- dlg_move (ch_dlg, FY, FX + 1);
- addstr (" File ");
-
- attrset (selection_color);
-
- dlg_move (ch_dlg, TY, TX);
- addstr ("Use SPACE to change");
- dlg_move (ch_dlg, TY + 1, TX);
- addstr ("an option, ARROW KEYS");
- dlg_move (ch_dlg, TY + 2, TX);
- addstr ("to move between options");
- dlg_move (ch_dlg, TY + 3, TX);
- addstr ("and T or INS to mark");
-}
-
-static int chmod_callback (Dlg_head *h, int Par, int Msg)
-{
- char buffer [10];
-
- switch (Msg) {
- case DLG_ACTION:
- if (Par >= BUTTONS - single_set * 2){
- c_stat ^= check_perm[Par - BUTTONS + single_set * 2].mode;
- sprintf (buffer, "%o", c_stat);
- label_set_text (statl, buffer);
- chmod_toggle_select ();
- mode_change = 1;
- }
- break;
-
- case DLG_KEY:
- if ((Par == 'T' || Par == 't' || Par == KEY_IC) &&
- ch_dlg->current->dlg_id >= BUTTONS - single_set * 2) {
- chmod_toggle_select ();
- if (Par == KEY_IC)
- dlg_one_down (ch_dlg);
- return 1;
- }
- break;
-#ifndef HAVE_X
- case DLG_DRAW:
- chmod_refresh ();
- break;
-#endif
- }
- return 0;
-}
-
-static void init_chmod (void)
-{
- int i;
-
- do_refresh ();
- end_chmod = c_file = need_update = 0;
- single_set = (cpanel->marked < 2) ? 2 : 0;
-
- if (use_colors){
- normal_color = COLOR_NORMAL;
- title_color = COLOR_HOT_NORMAL;
- selection_color = COLOR_NORMAL;
- } else {
- normal_color = NORMAL_COLOR;
- title_color = SELECTED_COLOR;
- selection_color = SELECTED_COLOR;
- }
-
- ch_dlg = create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
- chmod_callback, "[Chmod]", "chmod", DLG_CENTER);
-
- x_set_dialog_title (ch_dlg, "Chmod command");
-
-#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
-
- for (i = 0; i < BUTTONS; i++) {
- if (i == 2 && single_set)
- break;
- else
- add_widgetl (ch_dlg, button_new (XTRACT (i)), XV_WLAY_RIGHTOF);
- }
-
-
-#define XTRACT2(i) 0, check_perm [i].text, NULL
- for (i = 0; i < PERMISSIONS; i++) {
- check_perm[i].check = check_new (PY + (PERMISSIONS - i), PX + 2,
- XTRACT2 (i));
- add_widget (ch_dlg, check_perm[i].check);
- }
-}
-
-int pc_stat_file (char *filename)
-{
- mode_t st;
-
-#ifdef _OS_NT
- st = GetFileAttributes (filename);
-#endif /* _OS_NT */
-
-#ifdef __os2__
- HFILE fHandle = 0L;
- ULONG fInfoLevel = 1; /* 1st Level Info: Standard attributs */
- FILESTATUS3 fInfoBuf;
- ULONG fInfoBufSize;
- ULONG fAction = 0;
- APIRET rc;
-
- fInfoBufSize = sizeof(FILESTATUS3);
- rc = DosOpen((PSZ) filename,
- &fHandle,
- &fAction,
- (ULONG) 0,
- FILE_NORMAL,
- OPEN_ACTION_OPEN_IF_EXISTS,
- (OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE),
- (PEAOP2) NULL);
- if (rc != 0) {
- return -1;
- }
-
- rc = DosQueryFileInfo(fHandle, fInfoLevel, &fInfoBuf, fInfoBufSize);
- DosClose(fHandle);
- if (rc != 0) {
- return -1; /* error ! */
- } else {
- st = fInfoBuf.attrFile;
- }
-#endif /* __os2__ */
-
- if (st & FILE_DIRECTORY)
- st = -1;
- return st;
-}
-
-static void chmod_done (void)
-{
- if (need_update)
- update_panels (UP_OPTIMIZE, UP_KEEPSEL);
- repaint_screen ();
-}
-
-char *next_file (void)
-{
- while (!cpanel->dir.list[c_file].f.marked)
- c_file++;
-
- return cpanel->dir.list[c_file].fname;
-}
-
-#ifdef __os2__
-static int mk_chmod (char *filename, ULONG st)
-{
- HFILE fHandle = 0L;
- ULONG fInfoLevel = 1; /* 1st Level Info: Standard attributs */
- FILESTATUS3 fInfoBuf;
- ULONG fInfoBufSize;
- ULONG fAction = 0L;
- APIRET rc;
-
- if (!(st & FILE_READONLY))
- chmod(filename, (S_IWRITE | S_IREAD));
- fInfoBufSize = sizeof(FILESTATUS3);
- rc = DosOpen((PSZ) filename,
- &fHandle,
- &fAction,
- (ULONG) 0,
- FILE_NORMAL,
- OPEN_ACTION_OPEN_IF_EXISTS,
- (OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE),
- 0L);
- if (rc != 0) {
- return rc;
- }
-
- rc = DosQueryFileInfo(fHandle, fInfoLevel, &fInfoBuf, fInfoBufSize);
- if (rc!=0) {
- DosClose(fHandle);
- return rc;
- }
- fInfoBuf.attrFile = st;
- rc = DosSetFileInfo(fHandle, fInfoLevel, &fInfoBuf, fInfoBufSize);
- rc = DosClose(fHandle);
- return rc;
-}
-#endif /* __os2__ */
-
-static void do_chmod (mode_t sf)
-{
- sf &= and_mask;
- sf |= or_mask;
-
- mk_chmod(cpanel->dir.list[c_file].fname, sf);
-
- do_file_mark (cpanel, c_file, 0);
-}
-
-static void apply_mask (mode_t sf)
-{
- char *fname;
- mode_t sf_stat;
-
- need_update = end_chmod = 1;
- do_chmod (sf);
-
- do {
- fname = next_file ();
- if ((sf_stat = pc_stat_file (fname)) < 0)
- break;
-
- c_stat = sf_stat;
- do_chmod (c_stat);
- } while (cpanel->marked);
-}
-
-void chmod_cmd (void)
-{
- char buffer [10];
- char *fname;
- int i;
- mode_t sf_stat;
-
- do { /* do while any files remaining */
- init_chmod ();
- if (cpanel->marked)
- fname = next_file (); /* next marked file */
- else
- fname = selection (cpanel)->fname; /* single file */
-
- if ((sf_stat = pc_stat_file (fname)) < 0) /* get status of file */
- break;
-
- c_stat = sf_stat;
- mode_change = 0; /* clear changes flag */
-
- /* set check buttons */
- for (i = 0; i < PERMISSIONS; i++){
- check_perm[i].check->state = (c_stat & check_perm[i].mode) ? 1 : 0;
- check_perm[i].selected = 0;
- }
-
- /* Set the labels */
- c_fname = name_trunc (fname, 21);
- add_widget (ch_dlg, label_new (FY+2, FX+2, c_fname, NULL));
- c_fown = "unknown";
- add_widget (ch_dlg, label_new (FY+6, FX+2, c_fown, NULL));
- c_fgrp = "unknown";
- add_widget (ch_dlg, label_new (FY+8, FX+2, c_fgrp, NULL));
- sprintf (buffer, "%o", c_stat);
- statl = label_new (FY+4, FX+2, buffer, NULL);
- add_widget (ch_dlg, statl);
-
- run_dlg (ch_dlg); /* retrieve an action */
-
- /* do action */
- switch (ch_dlg->ret_value){
- case B_ENTER:
- if (mode_change)
- mk_chmod (fname, c_stat); /*.ado */
- need_update = 1;
- break;
-
- case B_CANCEL:
- end_chmod = 1;
- break;
-
- case B_ALL:
- case B_MARKED:
- and_mask = or_mask = 0;
- and_mask = ~and_mask;
-
- for (i = 0; i < PERMISSIONS; i++) {
- if (check_perm[i].selected || ch_dlg->ret_value == B_ALL)
- if (check_perm[i].check->state & C_BOOL)
- or_mask |= check_perm[i].mode;
- else
- and_mask &= ~check_perm[i].mode;
- }
-
- apply_mask (sf_stat);
- break;
-
- case B_SETMRK:
- and_mask = or_mask = 0;
- and_mask = ~and_mask;
-
- for (i = 0; i < PERMISSIONS; i++) {
- if (check_perm[i].selected)
- or_mask |= check_perm[i].mode;
- }
-
- apply_mask (sf_stat);
- break;
- case B_CLRMRK:
- and_mask = or_mask = 0;
- and_mask = ~and_mask;
-
- for (i = 0; i < PERMISSIONS; i++) {
- if (check_perm[i].selected)
- and_mask &= ~check_perm[i].mode;
- }
-
- apply_mask (sf_stat);
- break;
- }
-
- if (cpanel->marked && ch_dlg->ret_value!=B_CANCEL) {
- do_file_mark (cpanel, c_file, 0);
- need_update = 1;
- }
- destroy_dlg (ch_dlg);
- } while (cpanel->marked && !end_chmod);
- chmod_done ();
-}
diff -ruN old/mc-4.5.37/pc/config.h new/mc-4.5.38/pc/config.h
--- old/mc-4.5.37/pc/config.h Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/config.h Wed Dec 31 19:00:00 1969
@@ -1,259 +0,0 @@
-/****************************************************************************
- CONFIG.H - Midnight Commander Configuration for Win32 and OS/2
-
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ----------------------------------------------------------------------------
- Changes:
- - Created 951204/jfg
- - Changed from Alexander Dong (ado) for OS/2
- - Changed 980329 by Pavel Roskin for both OS/2 and NT
-
- ----------------------------------------------------------------------------
- Contents:
- - Headers flags
- - Library flags
- - Typedefs
- - etc.
- ****************************************************************************/
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define OS2_NT
-
-#define NEEDS_IO_H
-#define NEEDS_DRIVE_H
-#define NEEDS_FCNTL_H
-#define HAS_NO_GRP_PWD_H
-#define HAS_NO_TERMIOS_H
-#define HAS_NO_SYS_PARAM_H
-#define HAS_NO_SYS_IOCTL_H
-
-#define USE_O_TEXT
-#define HAS_ACS_AS_PCCHARS
-#define HAS_DIRECT_COLOR_ACCESS
-#define NEEDS_CR_LF_TRANSLATION
-
-#ifdef MC_NT
-# ifndef WIN32
-# define WIN32
-# endif
-# ifndef __WIN32__
-# define __WIN32__
-# endif
-# ifndef MSWINDOWS
-# define MSWINDOWS
-# endif
-# ifndef _OS_NT
-# define _OS_NT
-# endif
-#endif /* MC_NT */
-
-#ifdef MC_OS2
-# ifndef OS2
-# define OS2
-# endif
-# ifndef __os2__
-# define __os2__
-# define NEEDS_LOCAL_DIRENT_H
-# endif
-#endif /* MC_OS2 */
-
-#include "..\VERSION"
-
-#ifndef pc_system
-# define pc_system
-#endif
-
-#ifndef HAVE_SLANG
-# define HAVE_SLANG
-#endif
-
-#ifndef _CONSOLE
-# define _CONSOLE
-#endif
-
-#define FLOAT_TYPE
-#define MIDNIGHT
-#define USE_INTERNAL_EDIT
-
-#define STDC_HEADERS
-#define HAVE_STDLIB_H
-#define HAVE_STRING_H
-#define HAVE_DIRENT_H
-#define HAVE_LIMITS_H
-#define HAVE_UTIME_H
-
-#define HAVE_MEMSET
-#define HAVE_MEMCHR
-#define HAVE_MEMCPY
-#define HAVE_MEMCMP
-#define HAVE_MEMMOVE
-#define HAVE_STRDUP
-#define HAVE_STRERROR
-#define HAVE_TRUNCATE
-
-#define REGEX_MALLOC
-#define NO_INFOMOUNT
-
-typedef unsigned int umode_t;
-#define S_IFLNK 0
-#define S_ISLNK(x) 0
-
-#ifdef __EMX__
-
-#define S_IFBLK 0
-#define S_ISBLK(x) 0
-
-#endif /* __EMX__ */
-
-#ifdef __MINGW32__
-
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-#define pipe(p) _pipe(p, 4096, 0x8000 /* O_BINARY */)
-
-typedef int mode_t;
-typedef unsigned int nlink_t;
-typedef int gid_t;
-typedef int uid_t;
-typedef int pid_t;
-
-#endif /* __MINGW32__ */
-
-#ifdef _MSC_VER
-
-#pragma include_alias(, )
-
-#define INLINE
-#define inline
-
-#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-
-#define S_ISFIFO(m) 0
-#define S_ISBLK(x) 0
-
-#define S_IRWXU 0000700
-#define S_IRUSR 0000400
-#define S_IWUSR 0000200
-#define S_IXUSR 0000100
-
-#define S_IRWXG 0000070
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IRWXO 0000007
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-/* FIXME: is this definition correct? */
-#define R_OK 4
-
-#define pipe(p) _pipe(p, 4096, 0x8000 /* O_BINARY */)
-#define popen _popen
-#define pclose _pclose
-
-typedef int mode_t;
-typedef unsigned int nlink_t;
-typedef int gid_t;
-typedef int uid_t;
-typedef int pid_t;
-
-#endif /* _MSC_VER */
-
-#ifdef __BORLANDC__
-
-#define INLINE
-#define inline
-
-#define S_IRWXG 0000070
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IRWXO 0000007
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-/* FIXME: is this definition correct? */
-#define R_OK 4
-
-#define pipe(p) _pipe(p, 4096, 0x8000 /* O_BINARY */)
-#define popen _popen
-#define pclose _pclose
-#define sleep _sleep
-
-typedef int pid_t;
-
-#endif /* __BORLANDC__ */
-
-#ifdef __IBMC__
-
-#define INLINE
-#define inline
-
-#define S_ISFIFO(m) 0
-#define S_ISBLK(x) 0
-
-#define S_ISCHR(m) (((m) & S_IFCHR) != 0)
-#define S_ISDIR(m) (((m) & S_IFDIR) != 0)
-#define S_ISREG(m) (((m) & S_IFREG) != 0)
-
-#define S_IRWXU 0000700
-#define S_IRUSR 0000400
-#define S_IWUSR 0000200
-#define S_IXUSR 0000100
-
-#define S_IRWXG 0000070
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IRWXO 0000007
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-#define ENOTDIR ENOENT
-
-/* FIXME: is this definition correct? */
-#define R_OK 4
-
-#pragma map( chdir , "_chdir" )
-#pragma map( getcwd, "_getcwd" )
-#pragma map( mkdir , "_mkdir" )
-#pragma map( rmdir , "_rmdir" )
-
-#define popen DosCreatePipe
-#define pclose DosClose
-#define sleep DosSleep
-
-typedef unsigned int nlink_t;
-typedef int mode_t;
-typedef int gid_t;
-typedef int uid_t;
-typedef int pid_t;
-
-#endif /* __IBMC__ */
-
-#endif /* __CONFIG_H */
diff -ruN old/mc-4.5.37/pc/cons_nt.c new/mc-4.5.38/pc/cons_nt.c
--- old/mc-4.5.37/pc/cons_nt.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/cons_nt.c Wed Dec 31 19:00:00 1969
@@ -1,110 +0,0 @@
-/* Client interface for General purpose Win32 console save/restore server
- Having the same interface as its Linux counterpart:
- Copyright (C) 1994 Janne Kukonlehto
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Note:
- show_console_contents doesn't know how to write to its window
- the rest works fine.
-*/
-#include
-
-#include
-#include "trace_nt.h"
-
-int cons_saver_pid = 1;
-
-#include "../src/tty.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/cons.saver.h"
-
-signed char console_flag = 1;
-static HANDLE hSaved, hNew;
-
-void show_console_contents (int starty, unsigned char begin_line,
- unsigned char end_line)
-{
- COORD c0 = { 0, 0 };
- COORD csize;
- SMALL_RECT rect;
- CHAR_INFO *pchar;
-
- csize.X = COLS;
- csize.Y = end_line-begin_line;
- rect.Left = 0;
- rect.Top = begin_line;
- rect.Right = COLS;
- rect.Bottom = end_line;
-
-/* -- This code reads characters and attributes */
- pchar = malloc (sizeof(CHAR_INFO) * (end_line-begin_line) * COLS);
- /* Copy from one console to the curses virtual screen */
- win32APICALL(ReadConsoleOutput (hSaved, pchar, csize, c0, &rect));
-
- /* FIXME: this should've work,
- but refresh() is called after this write :-( */
- win32APICALL(WriteConsoleOutput (hNew, pchar, csize, c0, &rect));
-
- free (pchar);
-}
-
-void handle_console (unsigned char action)
-{
- static SECURITY_ATTRIBUTES sa;
- CONSOLE_SCREEN_BUFFER_INFO csbi;
-
- switch (action){
- case CONSOLE_INIT:
- /* Save Standard handle */
- hSaved = GetStdHandle (STD_OUTPUT_HANDLE);
-
- sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.lpSecurityDescriptor = NULL;
- /* Create a new console buffer */
- sa.bInheritHandle = TRUE;
- win32APICALL_HANDLE(hNew,
- CreateConsoleScreenBuffer (GENERIC_WRITE | GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE, &sa,
- CONSOLE_TEXTMODE_BUFFER, NULL));
- win32APICALL(GetConsoleScreenBufferInfo(hSaved, &csbi));
- win32APICALL(SetConsoleScreenBufferSize(hNew, csbi.dwSize));
-
- /* that becomes standard handle */
- win32APICALL(SetConsoleActiveScreenBuffer(hNew));
- win32APICALL(SetConsoleMode(hNew, ENABLE_PROCESSED_INPUT));
- win32APICALL(SetStdHandle(STD_OUTPUT_HANDLE, hNew));
- break;
-
- case CONSOLE_DONE:
- win32APICALL(CloseHandle (hNew));
- break;
-
- case CONSOLE_SAVE:
- /* Current = our standard handle */
- win32APICALL(SetConsoleActiveScreenBuffer (hNew));
- win32APICALL(SetStdHandle (STD_OUTPUT_HANDLE, hNew));
- break;
-
- case CONSOLE_RESTORE:
- /* Put saved (shell) screen buffer */
- win32APICALL(SetConsoleActiveScreenBuffer (hSaved));
- win32APICALL(SetStdHandle (STD_OUTPUT_HANDLE, hSaved));
- break;
- default:
- win32Trace(("Invalid action code %d sent to handle_console", action));
- }
-}
diff -ruN old/mc-4.5.37/pc/cons_os2.c new/mc-4.5.38/pc/cons_os2.c
--- old/mc-4.5.37/pc/cons_os2.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/cons_os2.c Wed Dec 31 19:00:00 1969
@@ -1,110 +0,0 @@
-/* Client interface for General purpose OS/2 console save/restore server.
- 1997 Alexander Dong
- Having the same interface as its Linux counterpart:
- Copyright (C) 1994 Janne Kukonlehto
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include
-
-#ifdef __os2__
-#define INCL_BASE
-#define INCL_NOPM
-#define INCL_VIO
-#define INCL_KBD
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_DOSERRORS
-#include
-#endif
-
-#include "../src/tty.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/cons.saver.h"
-
-signed char console_flag = 1;
-static unsigned char *scr_buffer;
-static unsigned char *pointer;
-
-static int GetScrRows();
-static int GetScrCols();
-
-static int GetScrRows()
-{
- VIOMODEINFO pvMode = {80};
- unsigned int hVio = 0;
- VioGetMode(&pvMode, hVio);
- return (pvMode.row ? pvMode.row: 25);
-}
-
-static int GetScrCols()
-{
- VIOMODEINFO pvMode = {80};
- unsigned int hVio = 0;
- VioGetMode(&pvMode, hVio);
- return (pvMode.col ? pvMode.col: 80);
-}
-
-void show_console_contents (int starty, unsigned char begin_line, unsigned char end_line)
-{
- int col = GetScrCols();
- int row = GetScrRows();
- int n;
- register int z;
-
- pointer = scr_buffer;
- for (z=0; z<(begin_line * col); z++) {
- pointer++; pointer++;
- }
- n = (end_line - begin_line + 1) * col;
- VioWrtCellStr((PCH) pointer, (USHORT) n, begin_line, 0, 0);
- return;
-}
-
-void handle_console (unsigned char action)
-{
- static int col;
- static int row;
- int n;
-
- switch (action) {
- case CONSOLE_INIT: /* Initialize */
- col = GetScrCols();
- row = GetScrRows();
- scr_buffer = (unsigned char *) malloc(col * row * 2); /* short values */
- n = col * row * 2;
- VioReadCellStr((PCH) scr_buffer, (USHORT *) &n, 0, 0, 0); /* Just save it */
- break;
- case CONSOLE_DONE:
- free(scr_buffer);
- break;
- case CONSOLE_SAVE: /* Save the screen */
- n = col * row * 2;
- VioReadCellStr((PCH) scr_buffer, (USHORT *) &n, 0, 0, 0);
- break;
- case CONSOLE_RESTORE:
- n = col * row * 2;
- VioWrtCellStr ((PCH) scr_buffer, (USHORT) n, 0, 0, 0); /* Write it back */
- break;
- default:
- /* This is not possible, but if we are here, just save the screen */
- handle_console(CONSOLE_SAVE);
- break;
- }
- return;
-}
diff -ruN old/mc-4.5.37/pc/dirent.h new/mc-4.5.38/pc/dirent.h
--- old/mc-4.5.37/pc/dirent.h Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/dirent.h Wed Dec 31 19:00:00 1969
@@ -1,35 +0,0 @@
-/*
- * direct.h Defines the types and structures used by the directory routines
- *
- */
-#ifndef _DIRENT_H_incl
-#define _DIRENT_H_incl
-
-#ifdef __cplupplus
-extern "C" {
-#endif
-
-#include
-
-#define NAME_MAX 255 /* maximum filename for HPFS or NTFS */
-
-typedef struct dirent {
- unsigned long* d_handle;
- unsigned d_attr; /* file's attribute */
- unsigned short int d_time; /* file's time */
- unsigned short int d_date; /* file's date */
- long d_size; /* file's size */
- char d_name[ NAME_MAX + 1 ]; /* file's name */
- unsigned short d_ino; /* serial number (not used) */
- char d_first; /* flag for 1st time */
-} DIR;
-
-extern int closedir( DIR * );
-extern DIR *opendir( const char * );
-extern struct dirent *readdir( DIR * );
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* _DIRENT_H_incl */
diff -ruN old/mc-4.5.37/pc/dirent_nt.c new/mc-4.5.38/pc/dirent_nt.c
--- old/mc-4.5.37/pc/dirent_nt.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/dirent_nt.c Wed Dec 31 19:00:00 1969
@@ -1,92 +0,0 @@
-
-#include
-#include
-#include
-#include
-#include
-#include "dirent.h"
-
-DIR *opendir (const char * a_dir)
-{
- int err;
- WIN32_FIND_DATA wfd;
- DIR* dd_dir = (DIR*) malloc (sizeof(DIR));
-
- char *c_dir = malloc (strlen(a_dir) + 4);
- strcpy (c_dir, a_dir);
- strcat (c_dir, "\\*");
-
- dd_dir->d_handle = FindFirstFile (c_dir, &wfd);
- if (dd_dir->d_handle == INVALID_HANDLE_VALUE) {
- err = GetLastError();
- switch (err) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_NOT_ENOUGH_MEMORY:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- free(dd_dir);
- return NULL;
- }
- dd_dir->d_attr = (wfd.dwFileAttributes == FILE_ATTRIBUTE_NORMAL)
- ? 0 : wfd.dwFileAttributes;
-
- dd_dir->d_time = dd_dir->d_date = 10;
- dd_dir->d_size = wfd.nFileSizeLow;
- strcpy (dd_dir->d_name, wfd.cFileName);
- dd_dir->d_first = 1;
-
- free (c_dir);
- return dd_dir;
-}
-
-DIR *readdir( DIR * dd_dir)
-{
- int err;
- WIN32_FIND_DATA wfd;
-
- if (dd_dir->d_first) {
- dd_dir->d_first = 0;
- return dd_dir;
- }
-
- if(!FindNextFile (dd_dir->d_handle, &wfd)) {
- err = GetLastError();
- switch (err) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_NOT_ENOUGH_MEMORY:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- return NULL;
- }
- dd_dir->d_attr = (wfd.dwFileAttributes == FILE_ATTRIBUTE_NORMAL)
- ? 0 : wfd.dwFileAttributes;
-
- dd_dir->d_time = dd_dir->d_date = 10;
- dd_dir->d_size = wfd.nFileSizeLow;
- strcpy (dd_dir->d_name, wfd.cFileName);
- return dd_dir;
-}
-
-int closedir (DIR *dd_dir)
-{
- FindClose(dd_dir->d_handle);
- free (dd_dir);
- return 1;
-}
-
diff -ruN old/mc-4.5.37/pc/dirent_os2.c new/mc-4.5.38/pc/dirent_os2.c
--- old/mc-4.5.37/pc/dirent_os2.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/dirent_os2.c Wed Dec 31 19:00:00 1969
@@ -1,110 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include
-#endif
-
-#define INCL_DOSFILEMGR
-#define INCL_DOSERRORS
-#include
-
-#include
-#include
-#include
-#include
-#include "dirent.h"
-
-DIR *opendir (const char * a_dir)
-{
- APIRET rc;
- FILEFINDBUF3 FindBuffer = {0};
- ULONG FileCount = 1;
- DIR *dd_dir = (DIR*) malloc (sizeof(DIR));
- char *c_dir = (char*) malloc (strlen(a_dir) + 5);
-
- strcpy (c_dir, a_dir);
- strcat (c_dir, "\\*.*");
- dd_dir->d_handle = (unsigned long*) HDIR_CREATE;
-
- rc = DosFindFirst(c_dir,
- (PHDIR) &dd_dir->d_handle,
- FILE_SYSTEM | FILE_HIDDEN | FILE_DIRECTORY,
- (PVOID) &FindBuffer,
- sizeof(FILEFINDBUF3),
- &FileCount,
- FIL_STANDARD);
-
- if (rc) {
- switch (rc) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_BUFFER_OVERFLOW:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- free(dd_dir);
- return NULL;
- }
- dd_dir->d_attr = FindBuffer.attrFile;
- dd_dir->d_time = dd_dir->d_date = 10;
- dd_dir->d_size = FindBuffer.cbFile;
- strcpy (dd_dir->d_name, FindBuffer.achName);
- dd_dir->d_first = 1;
-
- free (c_dir);
- return dd_dir;
-}
-
-DIR *readdir( DIR * dd_dir)
-{
- APIRET rc;
- FILEFINDBUF3 FindBuffer = {0};
- ULONG FileCount = 1;
- DIR *ret_dir = (DIR*) malloc (sizeof(DIR));
-
- if (dd_dir->d_first) {
- dd_dir->d_first = 0;
- return dd_dir;
- }
-
- rc = DosFindNext((HDIR) dd_dir->d_handle,
- (PVOID) &FindBuffer,
- sizeof(FILEFINDBUF3),
- &FileCount);
-
- if (rc) {
- switch (rc) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_BUFFER_OVERFLOW:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- return NULL;
- }
-
- ret_dir->d_attr = FindBuffer.attrFile;
- ret_dir->d_time = ret_dir->d_date = 10;
- ret_dir->d_size = FindBuffer.cbFile;
- strcpy (ret_dir->d_name, FindBuffer.achName);
- return ret_dir;
-}
-
-int closedir (DIR *dd_dir)
-{
- if (dd_dir->d_handle != (unsigned long*) HDIR_CREATE) {
- DosFindClose((HDIR) dd_dir->d_handle);
- }
- free (dd_dir);
- return 1;
-}
diff -ruN old/mc-4.5.37/pc/drive.c new/mc-4.5.38/pc/drive.c
--- old/mc-4.5.37/pc/drive.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/drive.c Wed Dec 31 19:00:00 1969
@@ -1,218 +0,0 @@
-/* Ch-Drive command for Windows NT and OS/2
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Bug:
- the code will not work if you have more drives than those that
- can fit in a panel.
- */
-
-#include
-#ifdef _OS_NT
-#include
-#include "util_win32.h"
-#endif
-#include
-#include
-#include
-#include
-#include "../src/tty.h"
-#include "../src/mad.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/color.h"
-#include "../src/dlg.h"
-#include "../src/widget.h"
-#include "../src/dialog.h"
-#include "../src/dir.h"
-#include "../src/panel.h"
-#include "../src/main.h"
-#include "../src/cmd.h"
-
-struct Dlg_head *drive_dlg;
-WPanel *this_panel;
-
-static int drive_dlg_callback (Dlg_head *h, int Par, int Msg);
-static void drive_dlg_refresh (void);
-static void drive_cmd(void);
-
-#define B_DRIVE_BASE 100
-#define MAX_LGH 13 /* Length for drives */
-
-static void drive_cmd()
-{
- int i, nNewDrive, nDrivesAvail;
- char szTempBuf[7], szDrivesAvail[27*4], *p;
-
- /* Dialogbox position */
- int x_pos;
- int y_pos = (LINES-6)/2-3;
- int y_height;
- int x_width;
-
- int m_drv;
-
- /* Get drives name and count */
-#ifdef _OS_NT
- GetLogicalDriveStrings (255, szDrivesAvail);
- for (nDrivesAvail = 0, p = szDrivesAvail; *p; nDrivesAvail++)
- p+=4;
-#else
- unsigned long uDriveNum, uDriveMap;
- nDrivesAvail = 0;
- p = szDrivesAvail;
- DosQueryCurrentDisk(&uDriveNum, &uDriveMap);
- for (i = 0; i < 26; i++) {
- if ( uDriveMap & (1 << i) ) {
- *p = 'A' + i;
- p += 4;
- nDrivesAvail++;
- }
- }
- *p = 0;
-#endif
-
- /* Create Dialog */
- do_refresh ();
-
- m_drv = ((nDrivesAvail > MAX_LGH) ? MAX_LGH: nDrivesAvail);
- /* Center on x, relative to panel */
- x_pos = this_panel->widget.x + (this_panel->widget.cols - m_drv*3)/2 + 2;
-
- if (nDrivesAvail > MAX_LGH) {
- y_height = 8;
- x_width = 33;
- } else {
- y_height = 6;
- x_width = (nDrivesAvail - 1) * 2 + 9;
- }
-
- drive_dlg = create_dlg (y_pos, x_pos, y_height, x_width, dialog_colors,
- drive_dlg_callback, "[ChDrive]", "drive", DLG_NONE);
-
- x_set_dialog_title (drive_dlg, "Change Drive");
-
- if (nDrivesAvail>MAX_LGH) {
- for (i = 0; i < nDrivesAvail - MAX_LGH; i++) {
- p -= 4;
- sprintf(szTempBuf, "&%c", *p);
- add_widgetl(drive_dlg,
- button_new (5,
- (m_drv-i-1)*2+4 - (MAX_LGH*2 - nDrivesAvail) * 2,
- B_DRIVE_BASE + nDrivesAvail - i - 1,
- HIDDEN_BUTTON,
- szTempBuf, 0, NULL, NULL),
- XV_WLAY_RIGHTOF);
- }
- }
-
- /* Add a button for each drive */
- for (i = 0; i < m_drv; i++) {
- p -= 4;
- sprintf (szTempBuf, "&%c", *p);
- add_widgetl(drive_dlg,
- button_new (3, (m_drv-i-1)*2+4, B_DRIVE_BASE+m_drv-i-1,
- HIDDEN_BUTTON, szTempBuf, 0, NULL, NULL),
- XV_WLAY_RIGHTOF);
- }
-
- run_dlg(drive_dlg);
-
- /* do action */
- if (drive_dlg->ret_value != B_CANCEL) {
- int errocc = 0; /* no error */
- int rtn;
- char drvLetter;
-
- nNewDrive = drive_dlg->ret_value - B_DRIVE_BASE;
- drvLetter = (char) *(szDrivesAvail + (nNewDrive*4));
-#ifdef _OS_NT
- if (win32_GetPlatform() == OS_WinNT) { /* Windows NT */
- rtn = _chdrive(drvLetter - 'A' + 1);
- } else { /* Windows 95 */
- rtn = 1;
- SetCurrentDirectory(szDrivesAvail+(nNewDrive*4));
- }
-#else
- rtn = DosSetDefaultDisk(nNewDrive + 1);
-#endif
- if (rtn == -1)
- errocc = 1;
- else {
- getcwd (this_panel->cwd, sizeof (this_panel->cwd)-2);
- if (toupper(drvLetter) == toupper(*(this_panel->cwd))) {
- clean_dir (&this_panel->dir, this_panel->count);
- this_panel->count = do_load_dir(&this_panel->dir,
- this_panel->sort_type,
- this_panel->reverse,
- this_panel->case_sensitive,
- this_panel->filter);
- this_panel->top_file = 0;
- this_panel->selected = 0;
- this_panel->marked = 0;
- this_panel->total = 0;
- show_dir(this_panel);
- reread_cmd();
- } else
- errocc = 1;
- }
- if (errocc)
- message (1, " Error ", " Can't access drive %c: ",
- *(szDrivesAvail+(nNewDrive*4)) );
- }
- destroy_dlg (drive_dlg);
- repaint_screen ();
-}
-
-void drive_cmd_a()
-{
- this_panel = left_panel;
- drive_cmd();
-}
-
-void drive_cmd_b()
-{
- this_panel = right_panel;
- drive_cmd();
-}
-
-void drive_chg(WPanel *panel)
-{
- this_panel = panel;
- drive_cmd();
-}
-
-static int drive_dlg_callback (Dlg_head *h, int Par, int Msg)
-{
- switch (Msg) {
-#ifndef HAVE_X
- case DLG_DRAW:
- drive_dlg_refresh ();
- break;
-#endif
- }
- return 0;
-}
-
-static void drive_dlg_refresh (void)
-{
- attrset (dialog_colors[0]);
- dlg_erase (drive_dlg);
- draw_box (drive_dlg, 1, 1, drive_dlg->lines-2, drive_dlg->cols-2);
-
- attrset (dialog_colors[2]);
- dlg_move (drive_dlg, 1, drive_dlg->cols/2 - 7);
- addstr (" Change Drive ");
-}
diff -ruN old/mc-4.5.37/pc/drive.h new/mc-4.5.38/pc/drive.h
--- old/mc-4.5.37/pc/drive.h Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/drive.h Wed Dec 31 19:00:00 1969
@@ -1,4 +0,0 @@
-void drive_cmd_a(WPanel *);
-void drive_cmd_b(WPanel *);
-void drive_chg(WPanel *panel);
-
diff -ruN old/mc-4.5.37/pc/key_nt.c new/mc-4.5.38/pc/key_nt.c
--- old/mc-4.5.37/pc/key_nt.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/key_nt.c Wed Dec 31 19:00:00 1969
@@ -1,322 +0,0 @@
-/* Keyboard support routines.
- for Windows NT system.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Bugs:
- Have trouble with non-US keyboards, "Alt-gr"+keys (API tells CTRL-ALT is pressed)
- */
-#include
-#ifndef _OS_NT
-#error This file is for Win32 systems.
-#else
-
-#include
-#include
-#include "../src/mouse.h"
-#include "../src/global.h"
-#include "../src/main.h"
-#include "../src/key.h"
-#include "../vfs/vfs.h"
-#include "../src/tty.h"
-#include "trace_nt.h"
-
-/* Global variables */
-int old_esc_mode = 0;
-HANDLE hConsoleInput;
-DWORD dwSaved_ControlState;
-Gpm_Event evSaved_Event;
-
-/* Unused variables */
-int double_click_speed; /* they are here to keep linker happy */
-int mou_auto_repeat;
-int use_8th_bit_as_meta = 0;
-
-/* Static Tables */
-struct {
- int key_code;
- int vkcode;
-} fkt_table [] = {
- { KEY_F(1), VK_F1 },
- { KEY_F(2), VK_F2 },
- { KEY_F(3), VK_F3 },
- { KEY_F(4), VK_F4 },
- { KEY_F(5), VK_F5 },
- { KEY_F(6), VK_F6 },
- { KEY_F(7), VK_F7 },
- { KEY_F(8), VK_F8 },
- { KEY_F(9), VK_F9 },
- { KEY_F(10), VK_F10 },
- { KEY_F(11), VK_F11 },
- { KEY_F(12), VK_F12 },
- { KEY_F(13), VK_F13 },
- { KEY_F(14), VK_F14 },
- { KEY_F(15), VK_F15 },
- { KEY_F(16), VK_F16 },
- { KEY_F(17), VK_F17 },
- { KEY_F(18), VK_F18 },
- { KEY_F(19), VK_F19 },
- { KEY_F(20), VK_F20 },
- { KEY_IC, VK_INSERT },
- { KEY_DC, VK_DELETE },
- { KEY_BACKSPACE, VK_BACK },
-
- { KEY_PPAGE, VK_PRIOR },
- { KEY_NPAGE, VK_NEXT },
- { KEY_LEFT, VK_LEFT },
- { KEY_RIGHT, VK_RIGHT },
- { KEY_UP, VK_UP },
- { KEY_DOWN, VK_DOWN },
- { KEY_HOME, VK_HOME },
- { KEY_END, VK_END },
-
- { ALT('*'), VK_MULTIPLY },
- { ALT('+'), VK_ADD },
- { ALT('-'), VK_SUBTRACT },
- { ALT('\t'), VK_PAUSE }, /* Added to make Complete work press Pause */
-
- { ESC_CHAR, VK_ESCAPE },
-
- { 0, 0}
-};
-
-/* init_key - Called in main.c to initialize ourselves
- Get handle to console input
-*/
-void init_key (void)
-{
- win32APICALL_HANDLE (hConsoleInput, GetStdHandle (STD_INPUT_HANDLE));
-}
-
-int ctrl_pressed ()
-{
- if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0;
- /* The line above fixes the BUG with the AltGr Keys*/
- return dwSaved_ControlState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED);
-}
-
-int shift_pressed ()
-{
- return dwSaved_ControlState & SHIFT_PRESSED;
-}
-
-int alt_pressed ()
-{
- return dwSaved_ControlState & (/* RIGHT_ALT_PRESSED |*/ LEFT_ALT_PRESSED );
-}
-
-static int VKtoCurses (int a_vkc)
-{
- int i;
-
- for (i = 0; fkt_table[i].vkcode != 0; i++)
- if (a_vkc == fkt_table[i].vkcode) {
- return fkt_table[i].key_code;
- }
- return 0;
-}
-
-static int translate_key_code(int asc, int scan)
-{
- int c;
- switch(scan){
- case 106: /* KP_MULT*/
- return ALT('*');
- case 107: /* KP_PLUS*/
- return ALT('+');
- case 109: /* KP_MINUS*/
- return ALT('-');
- }
- c = VKtoCurses (scan);
- if (!asc && !c)
- return 0;
- if (asc && c)
- return c;
- if (!asc || asc=='\t' )
- {
- if (shift_pressed() && (c >= KEY_F(1)) && (c <= KEY_F(10)))
- c += 10;
- if (alt_pressed() && (c >= KEY_F(1)) && (c <= KEY_F(2)))
- c += 10;
- if (alt_pressed() && (c == KEY_F(7)))
- c = ALT('?');
- if (asc == '\t'){
- if(ctrl_pressed())c = ALT('\t');
- else c=asc;
- }
- return c;
- }
- if (ctrl_pressed())
- return XCTRL(asc);
- if (alt_pressed())
- return ALT(asc);
- if (asc == 13)
- return 10;
- return asc;
-}
-
-int get_key_code (int no_delay)
-{
- INPUT_RECORD ir; /* Input record */
- DWORD dw; /* number of records actually read */
- int ch, vkcode, j;
-
- if (no_delay) {
- /* Check if any input pending, otherwise return */
- nodelay (stdscr, TRUE);
- win32APICALL(PeekConsoleInput(hConsoleInput, &ir, 1, &dw));
- if (!dw)
- return 0;
- }
-
- do {
- win32APICALL(ReadConsoleInput(hConsoleInput, &ir, 1, &dw));
- switch (ir.EventType) {
- case KEY_EVENT:
- if (!ir.Event.KeyEvent.bKeyDown) /* Process key just once: when pressed */
- break;
-
- vkcode = ir.Event.KeyEvent.wVirtualKeyCode;
-//#ifndef __MINGW32__
- ch = ir.Event.KeyEvent.uChar.AsciiChar;
-//#else
-// ch = ir.Event.KeyEvent.AsciiChar;
-//#endif
- dwSaved_ControlState = ir.Event.KeyEvent.dwControlKeyState;
- j = translate_key_code (ch, vkcode);
- if (j)
- return j;
- break;
-
- case MOUSE_EVENT:
- /* Save event as a GPM-like event */
- evSaved_Event.x = ir.Event.MouseEvent.dwMousePosition.X;
- evSaved_Event.y = ir.Event.MouseEvent.dwMousePosition.Y+1;
- evSaved_Event.buttons = ir.Event.MouseEvent.dwButtonState;
- switch (ir.Event.MouseEvent.dwEventFlags) {
- case 0:
- evSaved_Event.type = GPM_DOWN | GPM_SINGLE;
- break;
- case MOUSE_MOVED:
- evSaved_Event.type = GPM_MOVE;
- break;
- case DOUBLE_CLICK:
- evSaved_Event.type = GPM_DOWN | GPM_DOUBLE;
- break;
- };
- return 0;
- }
- } while (!no_delay);
- return 0;
-}
-
-static int getch_with_delay (void)
-{
- int c;
-
- while (1) {
- /* Try to get a character */
- c = get_key_code (0);
- if (c != ERR)
- break;
- }
- /* Success -> return the character */
- return c;
-}
-
-/* Returns a character read from stdin with appropriate interpretation */
-int get_event (Gpm_Event *event, int redo_event, int block)
-{
- int c;
- static int flag; /* Return value from select */
- static int dirty = 3;
-
- if ((dirty == 1) || is_idle ()){
- refresh ();
- doupdate ();
- dirty = 1;
- } else
- dirty++;
-
- vfs_timeout_handler ();
-
- c = block ? getch_with_delay () : get_key_code (1);
-
- if (!c) {
- /* Code is 0, so this is a Control key or mouse event */
- return EV_NONE; /* FIXME: mouse not supported */
- }
-
- return c;
-}
-
-/* Returns a key press, mouse events are discarded */
-int mi_getch ()
-{
- Gpm_Event ev;
- int key;
-
- while ((key = get_event (&ev, 0, 1)) == 0)
- ;
- return key;
-}
-
-/*
- is_idle - A function to check if we're idle.
- It checks for any waiting event (that can be a Key, Mouse event,
- and other internal events like focus or menu)
-*/
-int is_idle (void)
-{
- DWORD dw;
- if (GetNumberOfConsoleInputEvents (hConsoleInput, &dw))
- if (dw > 15)
- return 0;
- return 1;
-}
-
-/* get_modifier */
-int get_modifier()
-{
- int retval = 0;
-
- if (dwSaved_ControlState & LEFT_ALT_PRESSED) /* code is not clean, because we return Linux-like bitcodes*/
- retval |= ALTL_PRESSED;
- if (dwSaved_ControlState & RIGHT_ALT_PRESSED)
- retval |= ALTR_PRESSED;
-
- if (dwSaved_ControlState & RIGHT_CTRL_PRESSED ||
- dwSaved_ControlState & LEFT_CTRL_PRESSED)
- retval |= CONTROL_PRESSED;
-
- if (dwSaved_ControlState & SHIFT_PRESSED)
- retval |= SHIFT_PRESSED;
-
- return retval;
-}
-
-/* void functions for UNIX compatibility */
-void define_sequence (int code, char* vkcode, int action) {}
-void channels_up() {}
-void channels_down() {}
-void init_key_input_fd (void) {}
-void numeric_keypad_mode (void) {}
-void application_keypad_mode (void) {}
-
-/* mouse is not yet supported, sorry */
-void init_mouse (void) {}
-void shut_mouse (void) {}
-
-#endif /* _OS_NT */
diff -ruN old/mc-4.5.37/pc/key_os2.c new/mc-4.5.38/pc/key_os2.c
--- old/mc-4.5.37/pc/key_os2.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/key_os2.c Wed Dec 31 19:00:00 1969
@@ -1,408 +0,0 @@
-/* Keyboard support routines.
- for OS/2 system.
-
- 20. April 97: Alexander Dong (ado)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include
-#ifndef __os2__
-#error This file is for OS/2 systems.
-#else
-
-#define INCL_BASE
-#define INCL_NOPM
-#define INCL_VIO
-#define INCL_KBD
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_WININPUT
-#include
-#include
-#include "../src/mouse.h"
-#include "../src/global.h"
-#include "../src/main.h"
-#include "../src/key.h"
-#include "../vfs/vfs.h"
-#include "../src/tty.h"
-
-/* Code to read keystrokes in a separate thread */
-
-typedef struct kbdcodes {
- UCHAR ascii;
- UCHAR scan;
- USHORT shift; /* .ado: change for mc */
-} KBDCODES;
-
-/* Global variables */
-int old_esc_mode = 0;
-/* HANDLE hConsoleInput;
-DWORD dwSaved_ControlState; */
-Gpm_Event evSaved_Event;
-
-/* Unused variables */
-int double_click_speed; /* they are here to keep linker happy */
-int mou_auto_repeat;
-int use_8th_bit_as_meta = 0;
-
-static int VKtoCurses (int vkcode);
-
-/* -------------------------------------------------------------- */
-/* DEFINITIONS:
- Return from SLANG: KeyCode: 0xaaaabbcc
-
- where: aaaa = Flags
- bb = Scan code
- cc = ASCII-code (if available)
-
- if no flags (CTRL and ALT) is set, cc will be returned.
- If CTRL is pressed, cc is already the XCTRL(code).
- case cc is:
- 0xE0: The scan code will be used for the following keys:
- Insert: 0x52, DEL: 0x53,
- Page_Up: 0x49, Page_Down: 0x51,
- Pos1: 0x47, Ende: 0x4F,
- Up: 0x48, Down: 0x50,
- Left: 0x4B, Right: 0x4D,
-
- 0x00: The function keys are defined as:
- F1: 3b00, F2: 3c00 ... F10: 4400, F11: 8500, F12: 8600.
- With ALT-bit set:
- ALT(F1): 6800, 6900,... ALT(F10): 7100, ALT(F11): 8b00
- ALT(F12): 8c00
-
- Mapping for ALT(key_code):
- For Mapping with normal keys, only the scan code can be
- used. (see struct ALT_table)
-
- Special keys:
- ENTER (number block): 0xaaaaE00D
- + (number block): 0xaaaa4E2B Normal: 1B2B
- - (number block): 0xaaaa4A2D Normal: 352D
- * (number block): 0xaaaa372A Normal: 1B2A
- / (number block): 0xaaaaE02F
-*/
-/* -------------------------------------------------------------- */
-#define RIGHT_SHIFT_PRESSED 1
-#define LEFT_SHIFT_PRESSED 2
-#define CTRL_PRESSED 4
-#define ALT_PRESSED 8
-#define SCROLL_LOCK_MODE 16
-#define NUM_LOCK_MODE 32
-#define CAPS_LOCK_MODE 64
-#define INSERT_MODE 128
-#define LEFT_CTRL_PRESSED 256
-#define LEFT_ALT_PRESSED 512
-#define RIGHT_CTRL_PRESSED 1024
-#define RIGHT_ALT_PRESSED 2048
-#define SCROLL_LOCK_PRESSED 4096
-#define NUM_LOCK_PRESSED 8192
-#define CAPS_LOCK_PRESSED 16384
-#define SYSREQ 32768
-/* -------------------------------------------------------------- */
-
-/* Static Tables */
-struct {
- int key_code;
- int vkcode;
-} fkt_table [] = {
- { KEY_F(1), 0x3B },
- { KEY_F(2), 0x3C },
- { KEY_F(3), 0x3D },
- { KEY_F(4), 0x3E },
- { KEY_F(5), 0x3F },
- { KEY_F(6), 0x40 },
- { KEY_F(7), 0x41 },
- { KEY_F(8), 0x42 },
- { KEY_F(9), 0x43 },
- { KEY_F(10), 0x44 },
- { KEY_F(11), 0x85 },
- { KEY_F(12), 0x86 },
- { 0, 0}
-};
-
-
-struct {
- int key_code;
- int vkcode;
-} ALT_table [] = {
- { ALT('a'), 0x1E },
- { ALT('b'), 0x30 },
- { ALT('c'), 0x2E },
- { ALT('d'), 0x20 },
- { ALT('e'), 0x12 },
- { ALT('f'), 0x21 },
- { ALT('g'), 0x22 },
- { ALT('h'), 0x23 },
- { ALT('i'), 0x17 },
- { ALT('j'), 0x24 },
- { ALT('k'), 0x25 },
- { ALT('l'), 0x26 },
- { ALT('m'), 0x32 },
- { ALT('n'), 0x31 },
- { ALT('o'), 0x18 },
- { ALT('p'), 0x19 },
- { ALT('q'), 0x10 },
- { ALT('r'), 0x13 },
- { ALT('s'), 0x1F },
- { ALT('t'), 0x14 },
- { ALT('u'), 0x16 },
- { ALT('v'), 0x2F },
- { ALT('w'), 0x11 },
- { ALT('x'), 0x2D },
- { ALT('y'), 0x15 },
- { ALT('z'), 0x2C },
- { ALT('\n'), 0x1c },
- { ALT('\n'), 0xA6 },
- { ALT(KEY_F(1)), 0x68 },
- { ALT(KEY_F(2)), 0x69 },
- { ALT(KEY_F(3)), 0x6A },
- { ALT(KEY_F(4)), 0x6B },
- { ALT(KEY_F(5)), 0x6C },
- { ALT(KEY_F(6)), 0x6D },
- { ALT(KEY_F(7)), 0x6E },
- { ALT(KEY_F(8)), 0x6F },
- { ALT(KEY_F(9)), 0x70 },
- { ALT(KEY_F(10)), 0x71 },
- { ALT(KEY_F(11)), 0x8B },
- { ALT(KEY_F(12)), 0x8C },
- { 0, 0}
-};
-
-
-struct {
- int key_code;
- int vkcode;
-} movement [] = {
- { KEY_IC, 0x52 },
- { KEY_DC, 0x53 },
- { KEY_PPAGE, 0x49 },
- { KEY_NPAGE, 0x51 },
- { KEY_LEFT, 0x4B },
- { KEY_RIGHT, 0x4D },
- { KEY_UP, 0x48 },
- { KEY_DOWN, 0x50 },
- { KEY_HOME, 0x47 },
- { KEY_END, 0x4F },
- { 0, 0}
-};
-
-
-/* init_key -- to make linker happy */
-void init_key (void)
-{
- return;
-}
-
-
-/* The maximum sequence length (32 + null terminator) */
-static int seq_buffer[33];
-static int *seq_append = 0;
-
-static int push_char (int c)
-{
- if (!seq_append)
- seq_append = seq_buffer;
-
- if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
- return 0;
- *(seq_append++) = c;
- *seq_append = 0;
- return 1;
-}
-
-int get_key_code (int no_delay)
-{
- unsigned int inp_ch;
-
- if (no_delay) {
- /* Check if any input pending, otherwise return */
- nodelay (stdscr, TRUE);
- inp_ch = SLang_input_pending(0);
- if (inp_ch == 0) {
- return 0;
- }
- }
-
- if (no_delay) {
- return (VKtoCurses(inp_ch));
- }
-
- do {
- inp_ch = SLang_getkey();
- if (!inp_ch)
- inp_ch = (SLang_getkey() << 8);
- if (inp_ch) return (VKtoCurses(inp_ch));
- } while (!no_delay);
- return 0;
-}
-
-static int VKtoCurses (int a_vkc)
-{
- int ctrlState = 0;
- int altState = 0;
-
- int fsState;
- char scanCode;
- char asciiCode;
- register int i;
- int rtnCode = 0;
-
- fsState = (a_vkc & 0xFFFF0000) >> 16;
- fsState &= (~INSERT_MODE); /* Ignore Insertion mode */
-
- scanCode = (char) ((a_vkc & 0x0000FFFF) >> 8);
- asciiCode = (char) (a_vkc & 0x000000FF);
-
- ctrlState = (fsState & CTRL_PRESSED);
- altState = (fsState & ALT_PRESSED);
-
- rtnCode = asciiCode;
-
- if (ctrlState) {
- /* CTRL pressed */
- rtnCode = XCTRL(asciiCode);
- }
-
- if (altState) {
- /* ALT pressed
- * rtnCode = ALT(asciiCode);
- *
- * With German keyboards, the Values between 7B -> 7D
- * and 5b, 5d, 40, fd, fc and e6 are only reachable with the AltGr
- * key. If such a combination is used, asciiCode will not be zero.
- * With the normal ALT key, the asciiCode will always be zero.
- */
- if (asciiCode) {
- return asciiCode;
- }
- }
-
- /* Scan Movement codes */
- if (asciiCode == 0) {
- /* Replace key code with that in table */
- for (i=0; movement[i].vkcode != 0 || movement[i].key_code != 0; i++)
- if (scanCode == movement[i].vkcode)
- return (movement[i].key_code);
- }
-
- if (asciiCode == 0) {
- /* Function-key detected */
- for (i=0; fkt_table[i].vkcode != 0 || fkt_table[i].key_code != 0; i++)
- if (scanCode == fkt_table[i].vkcode)
- return (fkt_table[i].key_code);
- /* ALT - KEY */
- /* if (altState) */ {
- for (i=0; ALT_table[i].vkcode != 0 || ALT_table[i].key_code != 0; i++)
- if (scanCode == ALT_table[i].vkcode)
- return (ALT_table[i].key_code);
- }
- }
-
- if (asciiCode == 0x0d) {
- return '\n';
- }
-
- return rtnCode;
-}
-
-
-static int getch_with_delay (void)
-{
- int c;
-
- while (1) {
- /* Try to get a character */
- c = get_key_code (0);
- if (c != ERR)
- break;
- }
- /* Success -> return the character */
- return c;
-}
-
-int get_event (Gpm_Event *event, int redo_event, int block)
-{
- int c;
- static int dirty = 3;
-
- if ((dirty == 1) || is_idle ()){
- refresh ();
- doupdate ();
- dirty = 1;
- } else
- dirty++;
-
- vfs_timeout_handler ();
-
- c = block ? getch_with_delay () : get_key_code (1);
- if (!c) {
- /* Code is 0, so this is a Control key or mouse event */
- *event = evSaved_Event;
- return EV_NONE; /* FIXME: when should we return EV_MOUSE ? */
- }
-
- return c;
-}
-
-/* Returns a key press, mouse events are discarded */
-int mi_getch ()
-{
- Gpm_Event ev;
- int key;
-
- while ((key = get_event (&ev, 0, 1)) == 0)
- ;
- return key;
-}
-
-
-/*
- is_idle - A function to check if we're idle.
- It checks for any waiting event (that can be a Key, Mouse event,
- and other internal events like focus or menu)
-*/
-int is_idle (void)
-{
- return 1;
-}
-
-/* get_modifier */
-int get_modifier()
-{
- return 0;
-}
-
-int ctrl_pressed ()
-{
- return 0;
-}
-
-
-/* void functions for UNIX copatibility */
-void define_sequence (int code, char* vkcode, int action) {}
-void channels_up() {}
-void channels_down() {}
-void init_key_input_fd (void) {}
-void numeric_keypad_mode (void) {}
-void application_keypad_mode (void) {}
-
-/* mouse is not yet supported, sorry */
-void init_mouse (void) {}
-void shut_mouse (void) {}
-
-#endif /* __os2__ */
diff -ruN old/mc-4.5.37/pc/mc.def new/mc-4.5.38/pc/mc.def
--- old/mc-4.5.37/pc/mc.def Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/mc.def Wed Dec 31 19:00:00 1969
@@ -1,4 +0,0 @@
-NAME MC WINDOWCOMPAT
-DESCRIPTION 'Midnight Commander'
-EXETYPE OS2
-PROTMODE
diff -ruN old/mc-4.5.37/pc/mc.rc new/mc-4.5.38/pc/mc.rc
--- old/mc-4.5.37/pc/mc.rc Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/mc.rc Wed Dec 31 19:00:00 1969
@@ -1,59 +0,0 @@
-#include "../VERSION"
-#ifndef WINDRES
-# include "windows.h"
-# include "winver.h"
-#endif
-
-/* English (U.S.) resources */
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-
-#ifdef _WIN32
-#ifndef WINDRES
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#endif
-#pragma code_page(1252)
-#endif /* _WIN32 */
-
-/* Version */
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 3,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40000L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904E4"
- BEGIN
- VALUE "CompanyName", "Free Software Foundation"
- VALUE "FileDescription", "GNU Midnight Commander"
- VALUE "FileVersion", VERSION
- VALUE "InternalName", "MC"
- VALUE "LegalCopyright", "(c) Free Software Foundation"
- VALUE "LegalTrademarks", "see GNU General Public License"
- VALUE "OriginalFilename", "MC.EXE"
- VALUE "ProductName", "GNU Midnight Commander"
- VALUE "ProductVersion", VERSION
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1252
- END
-END
-
-
-/* Icon */
-0 ICON DISCARDABLE "mc_nt.ico"
-
-#endif /* English (U.S.) resources */
-
Binary files old/mc-4.5.37/pc/mc_nt.ico and new/mc-4.5.38/pc/mc_nt.ico differ
Binary files old/mc-4.5.37/pc/mc_os2.ico and new/mc-4.5.38/pc/mc_os2.ico differ
diff -ruN old/mc-4.5.37/pc/slint_pc.c new/mc-4.5.38/pc/slint_pc.c
--- old/mc-4.5.37/pc/slint_pc.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/slint_pc.c Wed Dec 31 19:00:00 1969
@@ -1,267 +0,0 @@
-/* Slang interface to the Midnight Commander for Windows NT and OS/2
- This emulates some features of ncurses on top of slang
- S-lang is not fully consistent between its Unix and non-Unix versions.
-
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-#include
-#include
-#include "../src/tty.h"
-#include "../src/mad.h"
-#include "../src/color.h"
-#include "../src/util.h"
-#include "../src/mouse.h" /* Gpm_Event is required in key.h */
-#include "../src/key.h" /* define_sequence */
-#include "../src/main.h" /* extern: force_colors */
-#include "../src/win.h" /* do_exit_ca_mode */
-
-#ifdef HAVE_SLANG
-
-static void slang_sigterm ()
-{
- SLsmg_reset_smg ();
-}
-
-static int slinterrupt;
-
-void enable_interrupt_key(void)
-{
- SLang_set_abort_signal(NULL);
- slinterrupt = 1;
-}
-void disable_interrupt_key(void)
-{
- slinterrupt = 0;
-}
-int got_interrupt ()
-{
- int t;
- int SLKeyboard_Quit=0; /* FIXME!! */
- t = slinterrupt ? SLKeyboard_Quit : 0;
- /* SLKeyboard_Quit = 0; */
- return t;
-}
-
-/* Only done the first time */
-void slang_init (void)
-{
- SLtt_get_terminfo ();
- SLang_init_tty (XCTRL('c'), 1, 0);
- slang_prog_mode ();
- load_terminfo_keys ();
-}
-
-/* Done each time we come back from done mode */
-void slang_prog_mode (void)
-{
- SLsmg_init_smg ();
- SLsmg_touch_lines (0, LINES);
-}
-
-/* Called each time we want to shutdown slang screen manager */
-void slang_shell_mode (void)
-{
-
-}
-
-void slang_shutdown ()
-{
- slang_shell_mode ();
- do_exit_ca_mode ();
- SLang_reset_tty ();
-
- /* reset the colors to those that were
- * active when the program was started up
- (not written)
- */
-}
-
-/* keypad routines */
-void slang_keypad (int set)
-{
- /* enable keypad strings */
-}
-
-static int no_slang_delay;
-
-void set_slang_delay (int v)
-{
- no_slang_delay = v;
-}
-
-void hline (int ch, int len)
-{
- int last_x, last_y;
-
- last_x = SLsmg_get_column ();
- last_y = SLsmg_get_row ();
-
- if (ch == 0)
- ch = ACS_HLINE;
-
- if (ch == ACS_HLINE){
- SLsmg_draw_hline (len);
- } else {
- while (len--)
- addch (ch);
- }
- move (last_y, last_x);
-}
-
-void vline (int character, int len)
-{
- if (!slow_terminal){
- SLsmg_draw_vline (len);
- } else {
- int last_x, last_y, pos = 0;
-
- last_x = SLsmg_get_column ();
- last_y = SLsmg_get_row ();
-
- while (len--){
- move (last_y + pos++, last_x);
- addch (' ');
- }
- move (last_x, last_y);
- }
-}
-
-int has_colors ()
-{
- /* No terminals on NT, make default color */
- if (!disable_colors)
- SLtt_Use_Ansi_Colors = 1;
-
- /* Setup emulated colors */
- if (SLtt_Use_Ansi_Colors){
- init_pair (A_REVERSE, "black", "white");
- } else {
-/* SLtt_set_mono (A_BOLD, NULL, SLTT_BOLD_MASK);
- SLtt_set_mono (A_REVERSE, NULL, SLTT_REV_MASK);
- SLtt_set_mono (A_BOLD|A_REVERSE, NULL, SLTT_BOLD_MASK | SLTT_REV_MASK);
- */ }
- return SLtt_Use_Ansi_Colors;
-}
-
-void attrset (int color)
-{
- if (!SLtt_Use_Ansi_Colors){
- SLsmg_set_color (color);
- return;
- }
-
- if (color & A_BOLD){
- if (color == A_BOLD)
- SLsmg_set_color (A_BOLD);
- else
- SLsmg_set_color ((color & (~A_BOLD)) + 8);
- return;
- }
-
- if (color == A_REVERSE)
- SLsmg_set_color (A_REVERSE);
- else
- SLsmg_set_color (color);
-}
-
-void load_terminfo_keys ()
-{
-}
-
-int getch ()
-{
- if (no_slang_delay)
- if (SLang_input_pending (0) == 0)
- return -1;
-
- return SLang_getkey ();
-}
-
-extern int slow_terminal;
-
-#else
-
-/* Non slang builds do not understand got_interrupt */
-int got_interrupt ()
-{
- return 0;
-}
-#endif /* HAVE_SLANG */
-
-void mc_refresh (void)
-{
-/* if (!we_are_background) (no background mode yet) */
- refresh ();
-}
-
-void slang_set_raw_mode (void)
-{
- return;
-}
-
-int max_index = 0;
-
-void
-init_pair (int index, char *foreground, char *background)
-{
-
- SLtt_set_color (index, "", foreground, background);
- if (index > max_index)
- max_index = index;
-}
-
-int
-alloc_color_pair (char *foreground, char *background)
-{
- init_pair (++max_index, foreground, background);
- return max_index;
-}
-
-int
-try_alloc_color_pair (char *fg, char *bg)
-{
- static struct colors_avail {
- struct colors_avail *next;
- char *fg, *bg;
- int index;
- } *p, c =
- {
- 0, 0, 0, 0
- };
-
- c.index = NORMAL_COLOR;
- p = &c;
- for (;;) {
- if (((fg && p->fg) ? !strcmp (fg, p->fg) : fg == p->fg) != 0
- && ((bg && p->bg) ? !strcmp (bg, p->bg) : bg == p->bg) != 0)
- return p->index;
- if (!p->next)
- break;
- p = p->next;
- }
- p->next = malloc (sizeof (c));
- p = p->next;
- p->next = 0;
- p->fg = fg ? strdup (fg) : 0;
- p->bg = bg ? strdup (bg) : 0;
- if (!fg)
- fg = "white";
- if (!bg)
- bg = "blue";
- p->index = alloc_color_pair (fg, bg);
- return p->index;
-}
diff -ruN old/mc-4.5.37/pc/sys/param.h new/mc-4.5.38/pc/sys/param.h
--- old/mc-4.5.37/pc/sys/param.h Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/sys/param.h Wed Dec 31 19:00:00 1969
@@ -1,7 +0,0 @@
-/* Systems having sys/param.h should not include this file */
-
-#ifdef HAVE_PARAM_H
-#error Remove this file if you have real sys/param.h
-#else
-/* FIXME: We should warn, that this file should not be included */
-#endif
diff -ruN old/mc-4.5.37/pc/sys/time.h new/mc-4.5.38/pc/sys/time.h
--- old/mc-4.5.37/pc/sys/time.h Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/sys/time.h Wed Dec 31 19:00:00 1969
@@ -1,16 +0,0 @@
-
-#ifndef _SYS_TIME_H
-#define _SYS_TIME_H
-
-#ifndef _WINSOCKAPI_ /* winsock.h defines struct timeval */
-
-struct timeval {
- long tv_sec;
- long tv_usec;
-};
-
-#endif
-
-int gettimeofday (struct timeval*, void *);
-
-#endif
diff -ruN old/mc-4.5.37/pc/trace_nt.c new/mc-4.5.38/pc/trace_nt.c
--- old/mc-4.5.37/pc/trace_nt.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/trace_nt.c Wed Dec 31 19:00:00 1969
@@ -1,186 +0,0 @@
-/* trace_nt.c - Debugging routines
- for Midnight Commander, under Win32
-
- Written 951215 by Juan Grigera
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include
-#ifdef HAVE_TRACE
-
-#include
-#ifdef _OS_NT
-#include
-#endif
-#include
-#include "trace_nt.h"
-
-/* Global variables */
-int __win32_tracing_enabled = 1;
-
-static int _win32_tracing_started = 0;
-static FILE *__win32_trace_f = NULL;
-
-/* Definitions */
-#define TRACE_FILE "mcTrace.out"
-
-/* Prototypes - static funcs */
-static void _win32InitTrace (void);
-static void _win32EndTrace (void);
-static const char* GetLastErrorText(void);
-static char *visbuf(const char *buf);
-
-
-/*
- void _win32InitTrace()
- This func will open file TRACE_FILE for output and add _win32EndTrace to onexit
- list of funcs.
- */
-static void _win32InitTrace()
-{
- if (!_win32_tracing_started) {
- _win32_tracing_started = 1;
-
- __win32_trace_f = fopen(TRACE_FILE, "wt");
- if (__win32_trace_f == NULL) {
- printf("Midnight Commander[DEBUG]: Can't open trace file '" TRACE_FILE "': %s \n", strerror(errno));
- }
- atexit (&_win32EndTrace);
- }
-}
-
-/*
- void _win32EndTrace()
- This func closes file TRACE_FILE if opened.
- */
-static void _win32EndTrace()
-{
- if (_win32_tracing_started) {
- _win32_tracing_started = 0;
- if (__win32_trace_f)
- fclose (__win32_trace_f);
- }
-
-}
-
-/*
- void _win32Trace (char *fmt, ...)
- Format and output debug strings. They are written to TRACE_FILE.
- Debug Output is controlled by SetTrace (see below).
- Win32: Output is sent to Debug Output also.
- */
-void _win32Trace (const char *fmt, ...)
-{
- va_list ap;
- char buffer[256];
- char *vp;
-
-
- if (!_win32_tracing_started)
- _win32InitTrace();
-
- va_start(ap, fmt);
- vsprintf(buffer, fmt, ap);
- vp = buffer;
-
-#ifdef _OS_NT /* Write Output to Debug monitor also */
- OutputDebugString (vp);
- #if (_MSC_VER > 800) /* Don't write newline in MSVC++ 1.0, has a dammed bug in Debug Output screen */
- OutputDebugString ("\n");
- #endif
-#endif
-
- if(__win32_trace_f)
- fprintf (__win32_trace_f, "%s\n", vp);
-}
-
-/*
- void SetTrace (int trace)
- Control debug output. Turn it of or on.
- trace: 0 = off, 1 = on.
- */
-void _win32SetTrace (int trace)
-{
- /* Prototypes - interlan funcs */
- __win32_tracing_enabled = trace;
-}
-void _win32TraceOn ()
-{
- __win32_tracing_enabled = 1;
-}
-void _win32TraceOff()
-{
- __win32_tracing_enabled = 0;
-}
-
-
-#ifdef _OS_NT
-/*
- void DebugFailedWin32APICall (const char* name, int line, const char* file)
- Report a System call failure.
- name - text containing the source code that called the offending API func
- line, file - place of "name" in code
-
- See Also: definition of win32APICALL macro.
- */
-void _win32DebugFailedWin32APICall (const char* name, int line, const char* file)
-{
- _win32Trace ("%s(%d): Call to Win32 API Failed. \"%s\".", file, line, name);
- _win32Trace (" System Error (%d): %s. ", GetLastError(), GetLastErrorText());
-}
-#endif
-
-/*
- void DebugAssertionFailed (const char* name, int line, const char* file)
- Report a logical condition failure. (e.g. a bad argument to a func)
- name - text containing the logical condition
- line, file - place of "name" in code
-
- See Also: definition of ASSERT macro.
- */
-void _win32DebugAssertionFailed (const char* name, int line, const char* file)
-{
- _win32Trace ("%s(%d): Assertion failed! \"%s\".", file, line, name);
-}
-
-
-/* const char* GetLastErrorText()
- Retrieves the text associated with the last system error.
-
- Returns pointer to static buffer. Contents valid till next call
-*/
-static const char* GetLastErrorText()
-{
-#define MAX_MSG_SIZE 256
- static char szMsgBuf[MAX_MSG_SIZE];
- DWORD dwError, dwRes;
-
- dwError = GetLastError ();
-
- dwRes = FormatMessage (
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- dwError,
- MAKELANGID (LANG_ENGLISH, SUBLANG_ENGLISH_US),
- szMsgBuf,
- MAX_MSG_SIZE,
- NULL);
- if (0 == dwRes) {
- sprintf (szMsgBuf, "FormatMessage failed with %d", GetLastError());
- }
- return szMsgBuf;
-}
-
-#endif /*HAVE_TRACE*/
diff -ruN old/mc-4.5.37/pc/trace_nt.h new/mc-4.5.38/pc/trace_nt.h
--- old/mc-4.5.37/pc/trace_nt.h Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/trace_nt.h Wed Dec 31 19:00:00 1969
@@ -1,72 +0,0 @@
-/* trace_nt.h - Debugging routines
-
- Written by Juan Grigera
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/* ------------------------------------------------------------------------------------------ *
- TRACER FUNCTIONS
- * ------------------------------------------------------------------------------------------ */
-
-#ifdef HAVE_TRACE
-/************************/
-/* Debug version */
-/************************/
-
-/* Macros
- ------
- win32Trace(x) - Trace macro. Use double in parenthesis for x. Same args as printf.
- win32ASSERT(x) - assert macro, but will not abort program and output sent to trace routine.
- win32APICALL(x) - Use to enclose a Win32 system call that should return TRUE.
- win32APICALL_HANDLE(h,api) - Use to enclose a Win32 system call that should return a handle.
-*/
-#define win32Trace(x) if (__win32_tracing_enabled) _win32Trace x
-#define win32ASSERT(x) if (!(x)) _win32DebugAssertionFailed (#x, __LINE__, __FILE__)
-#define win32APICALL(x) if (!(x)) _win32DebugFailedWin32APICall (#x, __LINE__, __FILE__)
-#define win32APICALL_HANDLE(h,api) h=api; if (h==INVALID_HANDLE_VALUE) _win32DebugFailedWin32APICall (#h" = "#api, __LINE__, __FILE__)
-
-/* Prototypes */
-void _win32Trace (const char *, ...);
-void _win32DebugFailedWin32APICall (const char *name, int line, const char *file);
-void _win32DebugAssertionFailed (const char *name, int line, const char *file);
-
-void _win32SetTrace (int trace);
-void _win32TraceOn (void);
-void _win32TraceOff (void);
-
-#define SetTrace _win32SetTrace
-#define TraceOn _win32TraceOn
-#define TraceOff _win32TraceOff
-
-/* Global variables */
-extern int __win32_tracing_enabled;
-
-#else
-/************************/
-/* Non-debug version */
-/************************/
-
-/* Wipe-out these macros */
-#define win32Trace(x)
-#define win32ASSERT(x)
-#define win32APICALL(x) x
-#define win32APICALL_HANDLE(h,api) h=api;
-
-/* Wipe-out these funcs */
-#define SetTrace(x)
-#define TraceOn()
-#define TraceOff()
-#endif
diff -ruN old/mc-4.5.37/pc/util_nt.c new/mc-4.5.38/pc/util_nt.c
--- old/mc-4.5.37/pc/util_nt.c Mon Jul 12 23:57:43 1999
+++ new/mc-4.5.38/pc/util_nt.c Wed Dec 31 19:00:00 1969
@@ -1,745 +0,0 @@
-/* Various utilities - NT versions
- Copyright (C) 1994, 1995, 1996 the Free Software Foundation.
-
- Written 1994, 1995, 1996 by:
- Juan Grigera, Miguel de Icaza, Janne Kukonlehto, Dugan Porter,
- Jakub Jelinek, Mauricio Plaza.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include /* my_system */
-#include /* INT_MAX */
-#include