mirror of https://github.com/MidnightCommander/mc
Pass1 of the QNX port of mc from Tamasi Gyorgy
This commit is contained in:
parent
96c55ff5bb
commit
3a3c99ed4c
|
@ -17,7 +17,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||||
DISTMAIN = configure configure.in NEWS README INSTALL INSTALL.FAST \
|
DISTMAIN = configure configure.in NEWS README INSTALL INSTALL.FAST \
|
||||||
Makefile.in FAQ COPYING create_vcs install-sh \
|
Makefile.in FAQ COPYING create_vcs install-sh \
|
||||||
config.h.in mc-aclocal.m4 aclocal.m4 acconfig.h VERSION mcfn_install.in \
|
config.h.in mc-aclocal.m4 aclocal.m4 acconfig.h VERSION mcfn_install.in \
|
||||||
Make.common.in README.NT mc.spec Specfile \
|
Make.common.in README.NT mc.spec Specfile README.QNX \
|
||||||
README.OS2 VERSION.in NLS mkinstalldirs autogen.sh
|
README.OS2 VERSION.in NLS mkinstalldirs autogen.sh
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
|
@ -0,0 +1,322 @@
|
||||||
|
Midnight Commander for QNX
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
1. Compiling
|
||||||
|
2. Running 'mc' under QNX
|
||||||
|
3. List of modifications on mc-4.1.33
|
||||||
|
4. TODO
|
||||||
|
5. Contact information
|
||||||
|
|
||||||
|
1. Compiling
|
||||||
|
------------
|
||||||
|
|
||||||
|
1.1 Make utility
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Use 'gmake'. (This is the default 'make' under QNX 4.23+). [The old 'qmake'
|
||||||
|
can not handle the makefiles in the mc-source.]
|
||||||
|
|
||||||
|
1.2 Configuring
|
||||||
|
---------------
|
||||||
|
|
||||||
|
If you don't have an installed TCP/IP development kit, you have to 'hide'
|
||||||
|
the library file 'socket3r.lib' (can be installed by e.g. Watcom C 10.6)
|
||||||
|
in /usr/lib or /usr/watcom/10.6/usr/lib, because the existence of this file
|
||||||
|
will confuse 'configure': it will erranously assume you have the complete
|
||||||
|
TCP/IP development kit (with headers) and will enable compiling of the
|
||||||
|
network-related VFS code (not only tarfs).
|
||||||
|
[A patch would be required in the configure-script to check the existence
|
||||||
|
of the TCP/IP-related headers also...]
|
||||||
|
|
||||||
|
Use '--disable-nls' option, if you don't have the binary utilities of
|
||||||
|
GNU 'gettext' package (e.g. 'msgfmt'). ['--with-included-gettext' doesn't
|
||||||
|
really work in 4.1.33, there are configuration/compiling problems...]
|
||||||
|
|
||||||
|
1.3 Compiler
|
||||||
|
------------
|
||||||
|
|
||||||
|
It is adviced to use Watcom C 10.6+ to compile the source, because older
|
||||||
|
compilers (e.g. 9.52) do not support some convenient/required features.
|
||||||
|
[e.g. 'ar'-compatible 'wlib',...]
|
||||||
|
|
||||||
|
1.4 "No prototype found for '<function>'" warnings
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
It is adviced to use high warning level (e.g. 'CFLAGS="-w4" ./configure'),
|
||||||
|
when compiling the source, because Watcom C uses a special parameter passing
|
||||||
|
convention for functions with fixed number of arguments only. So if the
|
||||||
|
compiler doesn't see the correct prototype of a function with variable
|
||||||
|
number of arguments (like printf()), it will produce a warning about the
|
||||||
|
missing prototype, but generates function call code according to the special
|
||||||
|
parameter passing convention, not the required CDECL convention (it is used
|
||||||
|
by default for functions with variable number of arguments). So the calling
|
||||||
|
convention of the function call code and the function code itself will not
|
||||||
|
match! So you MUST provide the correct prototype for function with variable
|
||||||
|
number of arguments! (Or you can force using the stack-based calling
|
||||||
|
convention as a default, if you have the stack-call-conv version of all of the
|
||||||
|
required libraries ('<name>3s.lib')...[Watcom C 10.6 required!])
|
||||||
|
|
||||||
|
[The latest release version (4.1.33/qnx) is checked against these types of
|
||||||
|
missing prototypes...]
|
||||||
|
|
||||||
|
1.5 Tested configuration
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
QNX 4.24
|
||||||
|
Watcom C 10.6 (release version, no newer beta patches)
|
||||||
|
Photon 1.12
|
||||||
|
no TCP/IP development kit (-> VFS: tarfs only!)
|
||||||
|
mc-4.1.33, mc-4.1.34
|
||||||
|
|
||||||
|
2. Running 'mc' under QNX
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Using 'qnx*' terminals:
|
||||||
|
|
||||||
|
You can not use your keyboard correctly, if you disable the "Full 8 bits
|
||||||
|
input" feature in the 'Options|Display bits...' dialog.
|
||||||
|
|
||||||
|
On 'qnx*' terminals 'mc' will run in black and white mode by default,
|
||||||
|
because these types of terminals use non-ANSI-compatible color sequences.
|
||||||
|
|
||||||
|
Accessing remote nodes via the native QNX-network:
|
||||||
|
|
||||||
|
[The problem exists under the older versions of 'mc' only...]
|
||||||
|
If directory panels can not handle '//<node-id>' prefix in directory names,
|
||||||
|
use directory links in order to access remote nodes on the native QNX
|
||||||
|
network:
|
||||||
|
|
||||||
|
mkdir /net
|
||||||
|
ln -sf //1/ /net/1
|
||||||
|
...
|
||||||
|
|
||||||
|
Extension and menu files:
|
||||||
|
|
||||||
|
Default 'tar' uses 'stderr' (and not 'stdout' as its 'normal' output with
|
||||||
|
'-t' option.
|
||||||
|
|
||||||
|
Default 'tar' is not a GNU 'tar', so does not understand '-z' option.
|
||||||
|
|
||||||
|
Special key-mappings:
|
||||||
|
|
||||||
|
Restrictions of the META-? as Alt-? functionality:
|
||||||
|
[META-? as ESC-? will always work!!!]
|
||||||
|
|
||||||
|
Alt-TAB -> Ctrl-TAB (Alt-TAB reserved in Photon [1.12+])
|
||||||
|
Alt-ENTER -> Ctrl-ENTER ('qnx*' terminals only)
|
||||||
|
|
||||||
|
Alt-<uppercase letter>: doesn't work
|
||||||
|
|
||||||
|
'qansi*' terminals:
|
||||||
|
|
||||||
|
Problem [QNX 4.23+ only]: screen corruption (strange line-drawing character
|
||||||
|
set handling) on 'qansi*' terminals, if linked with mc/Slang/terminfo
|
||||||
|
terminal management. (Older versions of QNX and Slang/termcap not affected.)
|
||||||
|
|
||||||
|
This problem is solved, see the comments in slang/sldisply.c about
|
||||||
|
SLTT_TRANSP_ACS_PATCH and QNX_QANSI_SLANG_COMPAT_ACS!
|
||||||
|
|
||||||
|
other terminals:
|
||||||
|
|
||||||
|
I have tested 'mc' under QNX on 'qnx*' and 'qansi*' terminals only.
|
||||||
|
|
||||||
|
toggle panels on/off (CTRL-o):
|
||||||
|
|
||||||
|
Currently not supported, but could be implemented later...
|
||||||
|
|
||||||
|
3. List of modifications on mc-4.1.33/mc-4.1.34
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
edit/
|
||||||
|
|
||||||
|
syntax.c: (4.1.33 only, fixed in 4.1.34)
|
||||||
|
|
||||||
|
line 100,191: WCC 10.6 doesn't like "<label>: }" contruct ("no statement
|
||||||
|
after the label"), modified to "<label>: /*nop*/; }".
|
||||||
|
|
||||||
|
lib/
|
||||||
|
|
||||||
|
mc.menu:
|
||||||
|
|
||||||
|
'Z' on 'tar.Z' and 'tar.z' files: '%f' -> '$1'.
|
||||||
|
|
||||||
|
mc.ext.in.qnx.diff:
|
||||||
|
mc.menu.qnx.diff:
|
||||||
|
|
||||||
|
QNX: modified 'mc.ext.in'. [tar -t: output to stderr,...]
|
||||||
|
QNX: modified 'mc.menu'. [tar is not GNU tar: doesn't know '-z',...]
|
||||||
|
|
||||||
|
Support for '*.tar.F': 'freeze'-compressed tar files...
|
||||||
|
|
||||||
|
(No automatic install implemented: patches must be applied before
|
||||||
|
running 'configure' [->mc.ext.in.qnx.diff!]; this patch can be not
|
||||||
|
only QNX-specific...)
|
||||||
|
|
||||||
|
Makefile.in:
|
||||||
|
|
||||||
|
'mc.ext.in.qnx.diff' and 'mc.menu.qnx.diff' added to DISTLIB.
|
||||||
|
|
||||||
|
slang/
|
||||||
|
|
||||||
|
sldisply.c:
|
||||||
|
|
||||||
|
SLTT_TRANSP_ACS_PATCH dependant code:
|
||||||
|
|
||||||
|
The problem: some terminals (e.g. QNX/qansi*) map the whole upper half of
|
||||||
|
the ASCII table to the lower half, when alt-char-set is activated with
|
||||||
|
the smacs/as string-sequence. This means, that if 0 <= ch < 128 written
|
||||||
|
to the terminal, it will be translated to (ch+128) automatically by the
|
||||||
|
terminal: so not only the line-drawing characters can be written, when
|
||||||
|
the alt-char-set is activated. It implicitly means, that space, NL, CR,
|
||||||
|
etc. characters (exactly: anything besides the "standard" line drawing
|
||||||
|
characters) can not be written directly to the terminal, when the
|
||||||
|
alt-char-set is activated, because writing these characters doesn't cause
|
||||||
|
an implicit/temporary switching-back to the standard char-set!
|
||||||
|
|
||||||
|
The original code in SLang assumes that space, NL, CR, etc. can be
|
||||||
|
printed when alt-char-set is activated. If SLTT_TRANSP_ACS_PATCH is
|
||||||
|
defined, the modified code will not use this assumption.
|
||||||
|
[Remark: the patch-code is not the most exact solution, but works...]
|
||||||
|
|
||||||
|
QNX_QANSI_SLANG_COMPAT_ACS_PATCH dependant code:
|
||||||
|
|
||||||
|
A more OS/terminal-specific solution for the problem mentioned above
|
||||||
|
(->SLTT_TRANSP_ACS_PATCH).
|
||||||
|
|
||||||
|
If QNX_QANSI_SLANG_COMPAT_ACS is defined, the default smacs/sa, rmacs/ae,
|
||||||
|
acsc/ac [and sgr/sa, if it would be used!] command sequences will be
|
||||||
|
replaced internally with the "old style" (pre-QNX 4.23) sequences in case
|
||||||
|
of QNX/qansi terminals. Using these optional command sequences the terminal
|
||||||
|
remains compatible with the original SLang code (without using the
|
||||||
|
workaround-code enabled by defining SLTT_TRANSP_ACS_PATCH).
|
||||||
|
|
||||||
|
Remark:
|
||||||
|
|
||||||
|
Currently SLTT_TRANSP_ACS_PATCH is not auto-configured by 'configure'.
|
||||||
|
(Must be manually defined...)
|
||||||
|
|
||||||
|
There is some (QNX-specific) auto-configuration hand-coded in the source:
|
||||||
|
|
||||||
|
#ifdef SLTT_TRANSP_ACS_PATCH
|
||||||
|
# if defined(__QNX__) && defined(QNX_QANSI_SLANG_COMPAT_ACS)
|
||||||
|
# undef SLTT_TRANSP_ACS_PATCH
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# if defined(__QNX__) && !defined(QNX_QANSI_SLANG_COMPAT_ACS)
|
||||||
|
# define QNX_QANSI_SLANG_COMPAT_ACS 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
slutty.c:
|
||||||
|
|
||||||
|
"newtty.c_iflag &= ~(ECHO | INLCR | ICRNL);"
|
||||||
|
|
||||||
|
ECHO(0x08) is a c_lflag bit, it means PARMRK(0x08) in c_iflag. (!?!)
|
||||||
|
|
||||||
|
src/
|
||||||
|
|
||||||
|
file.c:
|
||||||
|
|
||||||
|
'do_reget' can be extern if (USE_VFS && USE_NETCODE), not if (USE_VFS).
|
||||||
|
|
||||||
|
find.c:
|
||||||
|
|
||||||
|
search_content():
|
||||||
|
|
||||||
|
variable 'i' "must be" 'int', not 'char'. ["i == -1": (buggy?) WCC 10.6
|
||||||
|
doesn't convert automatically (int)(-1) to (char)(-1) (GCC does), so
|
||||||
|
"comparison result always 0" warning produced. It is cleaner to define
|
||||||
|
'i' as 'int', than cast '-1' to 'char', because 'read()' returns 'int'.]
|
||||||
|
|
||||||
|
key.c:
|
||||||
|
|
||||||
|
init_key():
|
||||||
|
|
||||||
|
Call load_xtra_key_defines() and clear 'use_8th_bit_as_meta' by default
|
||||||
|
under QNX, if a 'qnx*' terminal detected. (A saved config file (mc.ini)
|
||||||
|
can override it later...)
|
||||||
|
|
||||||
|
key.h:
|
||||||
|
|
||||||
|
Declare load_xtra_key_defines().
|
||||||
|
|
||||||
|
keyxdef.c:
|
||||||
|
|
||||||
|
Provides a method to define some platform-specific additional key
|
||||||
|
mappings. (e.g. QNX terminals can handle most of META-? combinations as
|
||||||
|
ALT-?...)
|
||||||
|
|
||||||
|
(Currently not listed in doc/FILES...)
|
||||||
|
|
||||||
|
layout.c:
|
||||||
|
|
||||||
|
TIOCGWINSZ must be available (<sys/ioctl.h> included), because window-
|
||||||
|
resizing code doesn't work, if not defined.
|
||||||
|
|
||||||
|
main.c:
|
||||||
|
|
||||||
|
print_usage(): reserved name in the QNX run-time library!
|
||||||
|
print_usage() -> print_mc_usage()
|
||||||
|
|
||||||
|
mouse.c:
|
||||||
|
|
||||||
|
QNX: ncurses 1.9.8a ported to QNX doesn't provide the 'SP' pointer as a
|
||||||
|
global symbol in the library, so the keyok() emulation currently can not
|
||||||
|
be used under QNX (4.24 & Watcom C 10.6 release version).
|
||||||
|
|
||||||
|
slint.c:
|
||||||
|
|
||||||
|
QNX: 'qansi*' terminals added to the color_terminals[] list.
|
||||||
|
|
||||||
|
subshell.c:
|
||||||
|
utilunix.c:
|
||||||
|
|
||||||
|
QNX: include <unix.h> to get prototype for exec*()!!!
|
||||||
|
[See README.QNX/Section 1.4!]
|
||||||
|
|
||||||
|
Makefile.in:
|
||||||
|
|
||||||
|
'keyxdef' module added to SRCS and OBJS.
|
||||||
|
|
||||||
|
vfs/
|
||||||
|
|
||||||
|
Makefile.in:
|
||||||
|
|
||||||
|
'install' target: 'mcserv' not installed, if net-code not enabled
|
||||||
|
by 'configure'.
|
||||||
|
|
||||||
|
<mc-src-root>/
|
||||||
|
|
||||||
|
README.QNX:
|
||||||
|
|
||||||
|
QNX-specific notes...
|
||||||
|
|
||||||
|
configure (line 3369):
|
||||||
|
configure.in (line 88):
|
||||||
|
|
||||||
|
(mc-4.1.34 only)
|
||||||
|
'test x$CCOPTS = x;' => 'test "x$CCOPTS" = x;'
|
||||||
|
|
||||||
|
Makefile.in:
|
||||||
|
|
||||||
|
README.QNX added to DISTMAIN.
|
||||||
|
|
||||||
|
4. TODO
|
||||||
|
-------
|
||||||
|
|
||||||
|
Because of limited time and resources now I can define a 'wish list' only:
|
||||||
|
(maybe somebody in the QNX community can help...)
|
||||||
|
|
||||||
|
subshell support with panel switch on/off ?
|
||||||
|
mouse under Photon (with qnxm, qansi-m terminals) ?
|
||||||
|
...
|
||||||
|
|
||||||
|
5. Contact information
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Please report QNX-specific bugs and comments via e-mail to: gt_cosy@usa.net
|
||||||
|
|
||||||
|
|
||||||
|
-------------
|
||||||
|
Tamasi Gyorgy
|
||||||
|
-------------
|
|
@ -85,7 +85,7 @@ if test x$GCC = xyes; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Debug mode is turned ON for now
|
dnl Debug mode is turned ON for now
|
||||||
if test x$CCOPTS = x; then
|
if test "x$CCOPTS" = x; then
|
||||||
CCOPTS='-g'
|
CCOPTS='-g'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,18 @@
|
||||||
1998-05-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
1998-05-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gprop.c (change_icon): Test for gp, as the combobox emits the
|
||||||
|
"changed" signal when shutting down. Great.
|
||||||
|
|
||||||
* gdesktop.c (desktop_reload): Missing mc_closedir
|
* gdesktop.c (desktop_reload): Missing mc_closedir
|
||||||
(desktop_setup_icon): Fix memory leak.
|
(desktop_setup_icon): Fix memory leak.
|
||||||
(get_desktop_icon): Fix memory leak.
|
(get_desktop_icon): Fix memory leak.
|
||||||
|
(desktop_create_directory_entry): Set the size of the exec
|
||||||
|
vector.
|
||||||
|
(desktop_create_launch_entry): Same.
|
||||||
|
|
||||||
|
We now create launch entries instead of trying to support
|
||||||
|
regular dropped stuff on the desktop, this makes things easier and
|
||||||
|
more consistent.
|
||||||
|
|
||||||
1998-05-18 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
1998-05-18 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
|
321
gnome/gdesktop.c
321
gnome/gdesktop.c
|
@ -542,6 +542,145 @@ drop_on_directory (GdkEventDropDataAvailable *event, char *dest, int force_manua
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char **
|
||||||
|
drops_from_event (GdkEventDropDataAvailable *event, int *argc)
|
||||||
|
{
|
||||||
|
int count, i, len;
|
||||||
|
int arguments;
|
||||||
|
char *p, **argv;
|
||||||
|
|
||||||
|
/* Count the number of file names received */
|
||||||
|
count = event->data_numbytes;
|
||||||
|
p = event->data;
|
||||||
|
arguments = 0;
|
||||||
|
while (count){
|
||||||
|
arguments++;
|
||||||
|
len = strlen (p) + 1;
|
||||||
|
count -= len;
|
||||||
|
p += len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the exec vector with all of the filenames */
|
||||||
|
argv = (char **) xmalloc (sizeof (char *) * arguments + 1, "arguments");
|
||||||
|
count = event->data_numbytes;
|
||||||
|
p = event->data;
|
||||||
|
i = 0;
|
||||||
|
do {
|
||||||
|
len = 1 + strlen (p);
|
||||||
|
count -= len;
|
||||||
|
argv [i++] = p;
|
||||||
|
p += len;
|
||||||
|
} while (count);
|
||||||
|
argv [i] = 0;
|
||||||
|
*argc = i;
|
||||||
|
|
||||||
|
return argv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* destroys a desktop_icon_t structure and anything that was held there,
|
||||||
|
* including the desktop widget.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
desktop_release_desktop_icon_t (desktop_icon_t *di)
|
||||||
|
{
|
||||||
|
if (di->dentry){
|
||||||
|
gnome_desktop_entry_free (di->dentry);
|
||||||
|
} else {
|
||||||
|
free (di->pathname);
|
||||||
|
di->pathname = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (di->widget){
|
||||||
|
gtk_widget_destroy (di->widget);
|
||||||
|
di->widget = 0;
|
||||||
|
}
|
||||||
|
free (di);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
remove_directory (char *path)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (confirm_delete){
|
||||||
|
char *buffer;
|
||||||
|
|
||||||
|
if (know_not_what_am_i_doing)
|
||||||
|
query_set_sel (1);
|
||||||
|
buffer = copy_strings (_("Do you want to delete "), path, "?", NULL);
|
||||||
|
i = query_dialog (_("Delete"), buffer,
|
||||||
|
D_ERROR, 2, _("&Yes"), _("&No"));
|
||||||
|
free (buffer);
|
||||||
|
if (i != 0)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
create_op_win (OP_DELETE, 0);
|
||||||
|
erase_dir (path);
|
||||||
|
destroy_op_win ();
|
||||||
|
update_panels (UP_OPTIMIZE, UP_KEEPSEL);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Removes an icon from the desktop and kills the ~/desktop file associated with it
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
desktop_icon_remove (desktop_icon_t *di)
|
||||||
|
{
|
||||||
|
desktop_icons = g_list_remove (desktop_icons, di);
|
||||||
|
|
||||||
|
if (di->dentry == NULL){
|
||||||
|
/* launch entry */
|
||||||
|
mc_unlink (di->pathname);
|
||||||
|
} else {
|
||||||
|
/* a .destop file or a directory */
|
||||||
|
/* Remove the .desktop */
|
||||||
|
mc_unlink (di->dentry->location);
|
||||||
|
|
||||||
|
if (strcmp (di->dentry->type, "Directory") == 0){
|
||||||
|
struct stat s;
|
||||||
|
|
||||||
|
if (mc_lstat (di->dentry->exec[0], &s) == 0){
|
||||||
|
if (S_ISLNK (s.st_mode))
|
||||||
|
mc_unlink (di->dentry->exec[0]);
|
||||||
|
else
|
||||||
|
if (!remove_directory (di->dentry->exec[0]))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
desktop_release_desktop_icon_t (di);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
drop_on_launch_entry (GtkWidget *widget, GdkEventDropDataAvailable *event, desktop_icon_t *di)
|
||||||
|
{
|
||||||
|
struct stat s;
|
||||||
|
char *r;
|
||||||
|
char **drops;
|
||||||
|
int drop_count;
|
||||||
|
|
||||||
|
/* try to stat it, if it fails, remove it from desktop */
|
||||||
|
if (!mc_stat (di->dentry->exec [0], &s) == 0){
|
||||||
|
desktop_icon_remove (di);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
drops = drops_from_event (event, &drop_count);
|
||||||
|
|
||||||
|
r = regex_command (di->pathname, "Drop", drops, 0);
|
||||||
|
if (r && strcmp (r, "Success") == 0){
|
||||||
|
free (drops);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_exe (s.st_mode))
|
||||||
|
gnome_desktop_entry_launch_with_args (di->dentry, drop_count, drops);
|
||||||
|
|
||||||
|
free (drops);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
url_dropped (GtkWidget *widget, GdkEventDropDataAvailable *event, desktop_icon_t *di)
|
url_dropped (GtkWidget *widget, GdkEventDropDataAvailable *event, desktop_icon_t *di)
|
||||||
{
|
{
|
||||||
|
@ -550,7 +689,6 @@ url_dropped (GtkWidget *widget, GdkEventDropDataAvailable *event, desktop_icon_t
|
||||||
int len;
|
int len;
|
||||||
int is_directory = 0;
|
int is_directory = 0;
|
||||||
|
|
||||||
printf ("URL dropped\n");
|
|
||||||
/* if DI is set to zero, then it is a drop on the root window */
|
/* if DI is set to zero, then it is a drop on the root window */
|
||||||
if (di)
|
if (di)
|
||||||
is_directory = strcasecmp (di->dentry->type, "directory") == 0;
|
is_directory = strcasecmp (di->dentry->type, "directory") == 0;
|
||||||
|
@ -565,16 +703,8 @@ url_dropped (GtkWidget *widget, GdkEventDropDataAvailable *event, desktop_icon_t
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Arguments to non-directory (FIXME: needs to be implemented):\n");
|
/* Last case: regular desktop stuff */
|
||||||
count = event->data_numbytes;
|
drop_on_launch_entry (widget, event, di);
|
||||||
p = event->data;
|
|
||||||
do {
|
|
||||||
len = 1 + strlen (event->data);
|
|
||||||
count -= len;
|
|
||||||
printf ("[%s], ", p);
|
|
||||||
p += len;
|
|
||||||
} while (count);
|
|
||||||
printf ("\nReceiving: %s %d\n", (char *) event->data, (int) event->data_numbytes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -771,82 +901,6 @@ desktop_icon_make_draggable (desktop_icon_t *di)
|
||||||
gtk_signal_connect (obj, "drag_end_event", GTK_SIGNAL_FUNC (desktop_icon_drag_end), di);
|
gtk_signal_connect (obj, "drag_end_event", GTK_SIGNAL_FUNC (desktop_icon_drag_end), di);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* destroys a desktop_icon_t structure and anything that was held there,
|
|
||||||
* including the desktop widget.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
desktop_release_desktop_icon_t (desktop_icon_t *di)
|
|
||||||
{
|
|
||||||
if (di->dentry){
|
|
||||||
gnome_desktop_entry_free (di->dentry);
|
|
||||||
} else {
|
|
||||||
free (di->pathname);
|
|
||||||
di->pathname = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (di->widget){
|
|
||||||
gtk_widget_destroy (di->widget);
|
|
||||||
di->widget = 0;
|
|
||||||
}
|
|
||||||
free (di);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remove_directory (char *path)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (confirm_delete){
|
|
||||||
char *buffer;
|
|
||||||
|
|
||||||
if (know_not_what_am_i_doing)
|
|
||||||
query_set_sel (1);
|
|
||||||
buffer = copy_strings (_("Do you want to delete "), path, "?", NULL);
|
|
||||||
i = query_dialog (_("Delete"), buffer,
|
|
||||||
D_ERROR, 2, _("&Yes"), _("&No"));
|
|
||||||
free (buffer);
|
|
||||||
if (i != 0)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
create_op_win (OP_DELETE, 0);
|
|
||||||
erase_dir (path);
|
|
||||||
destroy_op_win ();
|
|
||||||
update_panels (UP_OPTIMIZE, UP_KEEPSEL);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Removes an icon from the desktop and kills the ~/desktop file associated with it
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
desktop_icon_remove (desktop_icon_t *di)
|
|
||||||
{
|
|
||||||
desktop_icons = g_list_remove (desktop_icons, di);
|
|
||||||
|
|
||||||
if (di->dentry == NULL){
|
|
||||||
/* launch entry */
|
|
||||||
mc_unlink (di->pathname);
|
|
||||||
} else {
|
|
||||||
/* a .destop file or a directory */
|
|
||||||
/* Remove the .desktop */
|
|
||||||
mc_unlink (di->dentry->location);
|
|
||||||
|
|
||||||
if (strcmp (di->dentry->type, "Directory") == 0){
|
|
||||||
struct stat s;
|
|
||||||
|
|
||||||
if (mc_lstat (di->dentry->exec[0], &s) == 0){
|
|
||||||
if (S_ISLNK (s.st_mode))
|
|
||||||
mc_unlink (di->dentry->exec[0]);
|
|
||||||
else
|
|
||||||
if (!remove_directory (di->dentry->exec[0]))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
desktop_release_desktop_icon_t (di);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Called by the pop up menu: removes the icon from the desktop */
|
/* Called by the pop up menu: removes the icon from the desktop */
|
||||||
static void
|
static void
|
||||||
icon_delete (GtkWidget *widget, desktop_icon_t *di)
|
icon_delete (GtkWidget *widget, desktop_icon_t *di)
|
||||||
|
@ -1076,18 +1130,15 @@ desktop_create_directory_entry (char *dentry_path, char *pathname, char *short_n
|
||||||
GnomeDesktopEntry *dentry;
|
GnomeDesktopEntry *dentry;
|
||||||
|
|
||||||
dentry = xmalloc (sizeof (GnomeDesktopEntry), "dcde");
|
dentry = xmalloc (sizeof (GnomeDesktopEntry), "dcde");
|
||||||
|
memset (dentry, 0, sizeof (GnomeDesktopEntry));
|
||||||
dentry->name = g_strdup (short_name);
|
dentry->name = g_strdup (short_name);
|
||||||
dentry->comment = NULL;
|
|
||||||
dentry->tryexec = NULL;
|
|
||||||
dentry->exec_length = 0;
|
|
||||||
dentry->exec = (char **) malloc (2 * sizeof (char *));
|
dentry->exec = (char **) malloc (2 * sizeof (char *));
|
||||||
dentry->exec[0] = g_strdup (pathname);
|
dentry->exec[0] = g_strdup (pathname);
|
||||||
dentry->exec[1] = NULL;
|
dentry->exec[1] = NULL;
|
||||||
|
dentry->exec_length = 1;
|
||||||
dentry->icon = gnome_unconditional_pixmap_file ("gnome-folder.png");
|
dentry->icon = gnome_unconditional_pixmap_file ("gnome-folder.png");
|
||||||
dentry->docpath = NULL;
|
|
||||||
dentry->type = g_strdup ("Directory");
|
dentry->type = g_strdup ("Directory");
|
||||||
dentry->location = g_strdup (dentry_path);
|
dentry->location = g_strdup (dentry_path);
|
||||||
dentry->geometry = NULL;
|
|
||||||
|
|
||||||
gnome_desktop_entry_save (dentry);
|
gnome_desktop_entry_save (dentry);
|
||||||
desktop_load_from_dentry (dentry);
|
desktop_load_from_dentry (dentry);
|
||||||
|
@ -1148,75 +1199,32 @@ desktop_file_exec (GtkWidget *widget, GdkEventButton *event, desktop_icon_t *di)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **
|
|
||||||
drops_from_event (GdkEventDropDataAvailable *event)
|
|
||||||
{
|
|
||||||
int count, i, len;
|
|
||||||
int arguments;
|
|
||||||
char *p, **argv;
|
|
||||||
|
|
||||||
/* Count the number of file names received */
|
|
||||||
count = event->data_numbytes;
|
|
||||||
p = event->data;
|
|
||||||
arguments = 0;
|
|
||||||
while (count){
|
|
||||||
arguments++;
|
|
||||||
len = strlen (p) + 1;
|
|
||||||
count -= len;
|
|
||||||
p += len;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create the exec vector with all of the filenames */
|
|
||||||
argv = (char **) xmalloc (sizeof (char *) * arguments + 1, "arguments");
|
|
||||||
count = event->data_numbytes;
|
|
||||||
p = event->data;
|
|
||||||
i = 0;
|
|
||||||
do {
|
|
||||||
len = 1 + strlen (p);
|
|
||||||
count -= len;
|
|
||||||
argv [i++] = p;
|
|
||||||
p += len;
|
|
||||||
} while (count);
|
|
||||||
argv [i] = 0;
|
|
||||||
|
|
||||||
return argv;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drop_on_launch_entry (GtkWidget *widget, GdkEventDropDataAvailable *event, desktop_icon_t *di)
|
desktop_create_launch_entry (char *desktop_file, char *pathname, char *short_name)
|
||||||
{
|
|
||||||
struct stat s;
|
|
||||||
char *r;
|
|
||||||
char **drops;
|
|
||||||
|
|
||||||
/* try to stat it, if it fails, remove it from desktop */
|
|
||||||
if (!mc_stat (di->pathname, &s) == 0){
|
|
||||||
desktop_icon_remove (di);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
drops = drops_from_event (event);
|
|
||||||
|
|
||||||
r = regex_command (di->pathname, "Drop", drops, 0);
|
|
||||||
if (strcmp (r, "Success") == 0){
|
|
||||||
free (drops);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_exe (s.st_mode))
|
|
||||||
exec_direct (di->pathname, drops);
|
|
||||||
|
|
||||||
free (drops);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
desktop_create_launch_entry (char *pathname, char *short_name)
|
|
||||||
{
|
{
|
||||||
|
GnomeDesktopEntry *dentry;
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
desktop_icon_t *di;
|
desktop_icon_t *di;
|
||||||
char *icon;
|
char *icon;
|
||||||
|
struct stat s;
|
||||||
|
|
||||||
icon = get_desktop_icon (pathname);
|
stat (pathname, &s);
|
||||||
|
dentry = xmalloc (sizeof (GnomeDesktopEntry), "launch_entry");
|
||||||
|
memset (dentry, 0, sizeof (GnomeDesktopEntry));
|
||||||
|
|
||||||
|
dentry->name = short_name;
|
||||||
|
dentry->exec = (char **) malloc (2 * sizeof (char *));
|
||||||
|
dentry->exec[0] = g_strdup (pathname);
|
||||||
|
dentry->exec[1] = NULL;
|
||||||
|
dentry->exec_length = 1;
|
||||||
|
dentry->icon = get_desktop_icon (short_name);
|
||||||
|
dentry->type = g_strdup ("File");
|
||||||
|
dentry->location = g_strdup (desktop_file);
|
||||||
|
dentry->terminal = 1;
|
||||||
|
|
||||||
|
gnome_desktop_entry_save (dentry);
|
||||||
|
desktop_load_from_dentry (dentry);
|
||||||
|
#if 0
|
||||||
window = my_create_transparent_text_window (icon, x_basename (pathname));
|
window = my_create_transparent_text_window (icon, x_basename (pathname));
|
||||||
g_free (icon);
|
g_free (icon);
|
||||||
if (!window)
|
if (!window)
|
||||||
|
@ -1240,6 +1248,7 @@ desktop_create_launch_entry (char *pathname, char *short_name)
|
||||||
GTK_SIGNAL_FUNC (drop_on_launch_entry), di);
|
GTK_SIGNAL_FUNC (drop_on_launch_entry), di);
|
||||||
|
|
||||||
gtk_widget_dnd_drop_set (window, TRUE, drop_types, ELEMENTS (drop_types), FALSE);
|
gtk_widget_dnd_drop_set (window, TRUE, drop_types, ELEMENTS (drop_types), FALSE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1283,7 +1292,7 @@ desktop_setup_icon (char *filename, char *full_pathname)
|
||||||
|
|
||||||
desktop_version = copy_strings (full_pathname, ".desktop", NULL);
|
desktop_version = copy_strings (full_pathname, ".desktop", NULL);
|
||||||
if (!exist_file (desktop_version) && !desktop_pathname_loaded (full_pathname))
|
if (!exist_file (desktop_version) && !desktop_pathname_loaded (full_pathname))
|
||||||
desktop_create_launch_entry (full_pathname, filename);
|
desktop_create_launch_entry (desktop_version, full_pathname, filename);
|
||||||
free (desktop_version);
|
free (desktop_version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -414,8 +414,9 @@ change_icon (GtkEntry *entry, GpropGeneral *gp)
|
||||||
|
|
||||||
filename = gtk_entry_get_text (entry);
|
filename = gtk_entry_get_text (entry);
|
||||||
|
|
||||||
if (g_file_exists (filename))
|
if (g_file_exists (filename) && gp->icon_pixmap){
|
||||||
gnome_pixmap_load_file (GNOME_PIXMAP (gp->icon_pixmap), gtk_entry_get_text (entry));
|
gnome_pixmap_load_file (GNOME_PIXMAP (gp->icon_pixmap), gtk_entry_get_text (entry));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GpropGeneral *
|
GpropGeneral *
|
||||||
|
|
|
@ -14,7 +14,8 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
|
||||||
DISTLIB = Makefile.in mc.menu mc.ext.in tdiff xnc.hlp xterm.ti \
|
DISTLIB = Makefile.in mc.menu mc.ext.in tdiff xnc.hlp xterm.ti \
|
||||||
vt100.ti ansi.ti linux.ti tdiff ncurses.h mc.hint mc.lib xterm.tcap \
|
vt100.ti ansi.ti linux.ti tdiff ncurses.h mc.hint mc.lib xterm.tcap \
|
||||||
xterm.ad README.xterm mc.sh mc.csh mcserv.init mcserv.pamd tkmc.wmconfig
|
xterm.ad README.xterm mc.sh mc.csh mcserv.init mcserv.pamd tkmc.wmconfig \
|
||||||
|
mc.ext.in.qnx.diff mc.menu.qnx.diff
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
--- mc.ext.in Fri May 15 08:26:45 1998
|
||||||
|
+++ mc.ext.in.qnx Mon May 18 13:22:28 1998
|
||||||
|
@@ -105,26 +105,32 @@
|
||||||
|
|
||||||
|
regex/\.t([gp]?z|ar\.g?[zZ])$
|
||||||
|
Open=%cd tar:%d/%p/
|
||||||
|
- View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
|
||||||
|
+ View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf - 2>&1
|
||||||
|
Extract=gzip -dc %f 2>/dev/null | tar xf -
|
||||||
|
Icon=compressed.xpm
|
||||||
|
|
||||||
|
regex/\.tar\.bz$
|
||||||
|
# Open=%cd tar:%d/%p/
|
||||||
|
- View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
|
||||||
|
+ View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf - 2>&1
|
||||||
|
Extract=bzip -dc %f 2>/dev/null | tar xf -
|
||||||
|
Icon=compressed.xpm
|
||||||
|
|
||||||
|
regex/\.tar\.bz2$
|
||||||
|
Open=%cd tar:%d/%p/
|
||||||
|
- View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
|
||||||
|
+ View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf - 2>&1
|
||||||
|
Extract=bzip2 -dc %f 2>/dev/null | tar xf -
|
||||||
|
Icon=compressed.xpm
|
||||||
|
|
||||||
|
+regex/\.tar\.F$
|
||||||
|
+# Open=%cd tar:%d/%p/
|
||||||
|
+ View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf - 2>&1
|
||||||
|
+ Extract=freeze -dc %f 2>/dev/null | tar xf -
|
||||||
|
+ Icon=compressed.xpm
|
||||||
|
+
|
||||||
|
# .tar
|
||||||
|
shell/.tar
|
||||||
|
Open=%cd tar:%d/%p/
|
||||||
|
- View=%view{ascii} tar tvvf %f
|
||||||
|
+ View=%view{ascii} tar tvvf %f 2>&1
|
||||||
|
Extract=tar xf %f
|
||||||
|
Icon=tar.xpm
|
||||||
|
|
|
@ -223,14 +223,14 @@ Z Extract compressed tar files to subdirectories
|
||||||
echo $1|egrep -q "\.tar.gz$" && EXT=tar_gz
|
echo $1|egrep -q "\.tar.gz$" && EXT=tar_gz
|
||||||
echo $1|egrep -q "\.tgz$" && EXT=tgz
|
echo $1|egrep -q "\.tgz$" && EXT=tgz
|
||||||
echo $1|egrep -q "\.tpz$" && EXT=tpz
|
echo $1|egrep -q "\.tpz$" && EXT=tpz
|
||||||
echo %f|egrep -q "\.tar.Z$" && EXT=tar_Z
|
echo $1|egrep -q "\.tar.Z$" && EXT=tar_Z
|
||||||
echo %f|egrep -q "\.tar.z$" && EXT=tar_z
|
echo $1|egrep -q "\.tar.z$" && EXT=tar_z
|
||||||
case $EXT in
|
case $EXT in
|
||||||
tar_gz) D="`basename $1 .tar.gz`";;
|
tar_gz) D="`basename $1 .tar.gz`";;
|
||||||
tgz) D="`basename $1 .tgz`";;
|
tgz) D="`basename $1 .tgz`";;
|
||||||
tpz) D="`basename $1 .tpz`";;
|
tpz) D="`basename $1 .tpz`";;
|
||||||
tar_Z) D="`basename %f .tar.Z`";;
|
tar_Z) D="`basename $1 .tar.Z`";;
|
||||||
tar_z) D="`basename %f .tar.z`";;
|
tar_z) D="`basename $1 .tar.z`";;
|
||||||
esac
|
esac
|
||||||
mkdir $D; (cd $D && tar xvzof ../$1)||echo tag $1 >>$MC_CONTROL_FILE
|
mkdir $D; (cd $D && tar xvzof ../$1)||echo tag $1 >>$MC_CONTROL_FILE
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
--- mc.menu Mon May 18 13:27:26 1998
|
||||||
|
+++ mc.menu.qnx Mon May 18 13:25:01 1998
|
||||||
|
@@ -179,7 +179,11 @@
|
||||||
|
|
||||||
|
=+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.Z$ & t r
|
||||||
|
x Extract the contents of a compressed tar file
|
||||||
|
- tar xzvf %f
|
||||||
|
+ gzip -dc %f | tar xvf -
|
||||||
|
+
|
||||||
|
+=+ f \.tar\.F$ & t r
|
||||||
|
+x Extract the contents of a compressed tar file
|
||||||
|
+ freeze -dc %f | tar xvf -
|
||||||
|
|
||||||
|
= t r
|
||||||
|
+ ! t t
|
||||||
|
@@ -212,7 +216,16 @@
|
||||||
|
tar_Z) D="`basename %f .tar.Z`";;
|
||||||
|
tar_z) D="`basename %f .tar.z`";;
|
||||||
|
esac
|
||||||
|
- mkdir $D; cd $D && tar xvzof ../%f
|
||||||
|
+ mkdir $D; cd $D && (gzip -dc ../%f | tar xvof -)
|
||||||
|
+
|
||||||
|
++ f \.tar.F$ & t r & ! t t
|
||||||
|
+z Extract compressed tar file to subdirectory
|
||||||
|
+ unset D
|
||||||
|
+ echo %f|egrep -q "\.tar.F$" && EXT=tar_F
|
||||||
|
+ case $EXT in
|
||||||
|
+ tar_F) D="`basename %f .tar.F`";;
|
||||||
|
+ esac
|
||||||
|
+ mkdir $D; cd $D && (freeze -dc ../%f | tar xvof -)
|
||||||
|
|
||||||
|
+ t t
|
||||||
|
Z Extract compressed tar files to subdirectories
|
||||||
|
@@ -225,13 +238,18 @@
|
||||||
|
echo $1|egrep -q "\.tpz$" && EXT=tpz
|
||||||
|
echo $1|egrep -q "\.tar.Z$" && EXT=tar_Z
|
||||||
|
echo $1|egrep -q "\.tar.z$" && EXT=tar_z
|
||||||
|
+ echo $1|egrep -q "\.tar.F$" && EXT=tar_F
|
||||||
|
case $EXT in
|
||||||
|
tar_gz) D="`basename $1 .tar.gz`";;
|
||||||
|
tgz) D="`basename $1 .tgz`";;
|
||||||
|
tpz) D="`basename $1 .tpz`";;
|
||||||
|
tar_Z) D="`basename $1 .tar.Z`";;
|
||||||
|
tar_z) D="`basename $1 .tar.z`";;
|
||||||
|
+ tar_F) D="`basename $1 .tar.F`";;
|
||||||
|
+ esac
|
||||||
|
+ case $EXT in
|
||||||
|
+ tar_gz|tgz|tpz|tar_Z|tar_z) mkdir $D; (cd $D && (gzip -dc ../$1 | tar xvof -))||echo tag $1 >>$MC_CONTROL_FILE;;
|
||||||
|
+ tar_F) mkdir $D; (cd $D && (freeze -dc ../$1 | tar xvof -))||echo tag $1 >>$MC_CONTROL_FILE;;
|
||||||
|
esac
|
||||||
|
- mkdir $D; (cd $D && tar xvzof ../$1)||echo tag $1 >>$MC_CONTROL_FILE
|
||||||
|
shift
|
||||||
|
done
|
Loading…
Reference in New Issue