Commit Graph

43 Commits

Author SHA1 Message Date
Andrew Borodin
da33e767e9 Type accuracy and code clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
15a21a71cd Ticket #1781: some improvements of startup time.
After implementation of keybinding engine and reimplenetation
of menu engine, MC starts very slow due to multiple trivial
(totally non optimized) search of many values in many arrays.

This patch performes the some speedup of MC startup process.

Statistics:
- startup time without the patch: 0m0.413s
- startup time with the patch: 0m0.073s

Great thanks to 0xe2.0x9a.0x9b for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 14:23:48 +03:00
Vit Rosin
aa3f4b66d4 Ticket #1803: added missed esc sequencies for qansi terminals.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 13:27:20 +03:00
Slava Zanko
51f10b3038 Cleanup of code for compile with new warnings options for compilator
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:48 +02:00
Ilia Maslakov
a16b37c8e7 Ticket #1736: editor: X copy/paste eats newlines
1. Open empty file (<Shift-F4>)
2. Fill with data:

1234
5678
9abc

3. Mark contents (or any multiline text in, for example, firefox) with mouse (<Shift+MouseDown???>)
4. Insert somewhere below third line (<Shift+Insert>)
5. Newlines are eaten (xterm)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 09:46:20 +02:00
Andrew Borodin
7e33c12685 Show actual shortcuts in editor menu.
Key emulation in editor was removed. Default key emulation
is stored in misc/mc.keymap.default file. Emacs key emulation
is stored in misc/mc.keymap.emacs.
Editor options dialog was redesigned.
Shortcut parser was fixed.
Fixes after rebase to recent master.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:32 +03:00
Andrew Borodin
729d4f08a9 Implemented default actual shortcuts for main menu.
Some functions and commands are renamed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
41989bd0c6 Implemented display of actual shortcuts in main menu.
Many shortcuts are not defined in keymap file and therefore
not displayed in menu.

Editor menu is not reimplemented yet.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Ilia Maslakov
de56559df5 Reimplemented keybindings parser.
New parser allows get the string representation of menu shortcuts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-26 16:15:31 +03:00
Ilia Maslakov
1c4f8b1a0e Ticket #1675 (hex editor regression)
Viewer: fixed command handling.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

    add: binding for "esc", "escape"

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-07 07:15:04 +00:00
Ilia Maslakov
53b0f8546d Ticket #212
fixed completion in command line
    add: EditToggleTabTWS,EditFindDefinition, EditLoadPrevFile, EditLoadNextFile actions into bindings list
    add string bindings for f21..f24

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-30 12:04:17 +00:00
Ilia Maslakov
87102cc7e8 fix: main.c keys handler
add more keys into mc.keymap
    fix: CK_SingleDirsizeCmd event
    add default keys (alt-'.', alt-'+') mc.keymap

Signed-off-by: Ilia Maslakov <il.smind@google.com>

    Added alt-shift-h hotkey
    Add some documentation about keymap file.
    Replace some symbols into names '.' to 'dot', '?' to question, etc.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-29 17:42:40 +00:00
Ilia Maslakov
23b81fac46 fix: default_input_keymap, remove incorrect entry
fix: parsing keymap string with "backslash"

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-29 17:42:39 +00:00
Ilia Maslakov
c893dcf1dd fix: movement in Lynx navigation mode
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-09-29 17:42:39 +00:00
Slava Zanko
13cc339018 Fix hotkey parser for handle shift+<letter> hotkeys.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-29 17:42:38 +00:00
Slava Zanko
3b7d4c29ec Fixed parsing of hotkeys. Now will read:
alt+p
and
alt-p

as same hotkey.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-29 17:42:38 +00:00
Slava Zanko
52205790b2 Fix memory leak in function lookup_key()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-29 17:42:38 +00:00
Slava Zanko
df59561ab0 Show hotkeys as 'alt-s' instread of 'alt s'.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-29 17:42:35 +00:00
Slava Zanko
84f502a2e1 Reidentation of code and changes for compile with CFLAGS="-pedantic -Wall -Wextra -Werror -Wno-long-long"
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-18 11:57:35 +03:00
Andrew Borodin
62378d71d7 Mouse wheel events hack.
Don't generate 'Button up' event after wheel events.
Need for menu evemnt handling.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-14 15:11:59 +04:00
Denys Vlasenko
e064bd60df De-inline a few functions which are large
...or not-so-large but nevertheless
contain more than one function call,
or contain loops, or contain if's and at least one
function call, or contain largish objects on stack.

In my experience, in those cases the code size
growth is big enough to not inline stuff.

I guess some of the really big functions
are defined inline because they have, or had in the past,
just one callsite.

But for a few years gcc already does it automatically,
no need to do it by hand and risk code size explosion
when later during code evolution another callsite
is created. This optimization by hand is simply
no longer needed.

Anyway, here is the code size difference:

   text    data     bss     dec     hex filename
 572337   17944  177820  768101   bb865 mc.t5/.obj/src/mc
 567697   17944  177820  763461   ba645 mc.t6/.obj/src/mc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-08-31 07:12:59 +03:00
Sergei Trofimovich
5f5d3b8caf src/tty/: sanitized sprinkled 'const' qualifiers
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-08-24 09:31:26 +04:00
Andrew Borodin
510265b41c Fixed compiling warnings.
src/tty/key.c (get_modifier): comparison between pointer and integer
src/tty/win.c: missed #include <stdlib.h>
src/dialog.c (add_widget): control reaches end of non-void function
src/widget.c: missed #include "layout.h"

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-24 09:31:26 +04:00
Andrew Borodin
7c1e24525d Ticket #74: TUI is not resized if mouse is desabled.
If you run without mouse support (mc -d), mc doesn't detect resizes.

You need to press a key for mc to resize itself to new window after
window is maximized or resized (press up/down arrow, Ctrl-O, almost
anything will work).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-19 11:20:15 +04:00
Andrew Borodin
bc09ff3888 Ticket #1414: implemented scalable TUI.
Thanks to E.L.K.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-17 15:54:39 +04:00
Andrew Borodin
c43bb6f576 TTY: moved alternate_plus_minus variable to TTY layer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-12 21:23:55 +04:00
Andrew Borodin
509f4d5c4f TTY: fixes after rebase.
Code clean up.
Modification of tty_refresh for NCurses: call doupdate() after refresh()
every time.
tty_draw_box_slow() is not private function of TTY now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-12 21:23:54 +04:00
Andrew Borodin
7eb4f84dbd TTY: reorganization of mouse handling.
Also small optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-12 21:23:54 +04:00
Andrew Borodin
aadc438c20 TTY: code reorganization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-12 21:23:54 +04:00
Andrew Borodin
46559fd764 TTY: renamed functions.
getch have been renamed to tty_lowlevel_getch.
mi_getch have been renamed to tty_getch.
get_event have been renamed to tty_get_event.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-12 21:23:54 +04:00
Slava Zanko
7b74e49bd2 Added Copyringt information. Corrected 'Written by' field.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-08-12 21:23:13 +04:00
Slava Zanko
ce54d07561 Fix include paths in some source files
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-08-12 21:23:13 +04:00
Andrew Borodin
55e626726c For NCurses, always call doupdate() in tty_refresh(). 2009-08-12 21:23:12 +04:00
Andrew Borodin
86f77f3cb2 New functions.
tty_touch_screen() is used instead of touchwin() function or macro.
tty_set_normal_attrs() is used instead of standend() function or macro.
tty_set_alt_charset() is used instead of acs() and noacs()
functions or macros.
tty_baudrate() is used instead of baudrate() function or macro.
2009-08-12 21:23:12 +04:00
Andrew Borodin
2b7a991fde New functions.
tty_keypad() is used instead of keypad() function or macro.
tty_nodelay() is used instead of nodelay() function or macro.
tty_reset_prog_mode() is used instead of reset_prog_mode() function or macro.
tty_reset_shell_mode() is used instead of reset_shell_mode()
function or macro.
tty_beep() is used instead of beep() function or macro.
2009-08-12 21:23:12 +04:00
Andrew Borodin
f1d526d84d Keys handling.
src/tty/key.c (keyboard_key_timeout): make static.
src/tty/key.h: removed unsed irix_fn_keys variable.
Moved declaration of mou_auto_repeat variable here...
src/main.h: ...from here.
2009-08-12 21:23:12 +04:00
Andrew Borodin
5a5a8bd3c0 Reorganization of key and window management functions. 2009-08-12 21:23:12 +04:00
Andrew Borodin
fb51cb8241 Use TTY function names instead of #define's. 2009-08-12 21:23:12 +04:00
Andrew Borodin
3720285612 Reorganization of is_abort_char() function.
src/tty/key.h: cleanup. Changed returned type of is_abort_char()
function from int to gboolean.

src/tty/key.c: moved is_abort_char() function here...

src/tty/win.h: ...from here.

src/dialog.c (dialog_handle_key): is_abort_char() function is used.
Changed order of dialog key handling. Formatting.
2009-08-12 21:23:12 +04:00
Andrew Borodin
bcc6a40486 Reorganization of TTY initalization and line drawing.
Created some TTY functions instead of MC core global variables.
Moved init_layer() function from MC core to TTY layer.
Renamed slang_init() to init_slang().
Added required #include's in TTY layer.
Moved S-Lang color and attribute definitions from src/tty/tty-slang.h
to colors-slang.h.
2009-08-12 21:23:12 +04:00
Andrew Borodin
069aab9ebc Renamed mc_refresh() to tty_refresh(). 2009-08-12 21:22:17 +04:00
Andrew Borodin
389e5bf613 Moved rxvt.c, win.[ch] and x11con.[ch] from src to src/tty directory.
Fixed includes.
Fixed library order in src/Makefile.am due to --as-needed linking option.
2009-08-12 21:19:20 +04:00
Andrew Borodin
f3730bdc41 Initial step to move TTY layer of MC to separate library. 2009-08-12 21:19:20 +04:00