1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00
Commit Graph

108 Commits

Author SHA1 Message Date
Witold Filipczyk
60544f748e Fixed issue with CONFIG_TRUE_COLOR and 16 colors mode. inline functions used
instead of macros. Still problems with transparency in true color mode.
2006-08-20 14:51:06 +02:00
Witold Filipczyk
13dc5f01ea Note about efficiency. I know that normal 16 color mode is broken (menu).
Maybe someone knows how to fix it.
2006-08-19 23:57:50 +02:00
Witold Filipczyk
4f78b0dda1 True color mode. See new konsole.
TODO: dump
2006-08-19 23:39:40 +02:00
Kalle Olavi Niemitalo
0748ee8c92 UTF-8: Split UCS_REPLACEMENT_CHARACTER off UCS_NO_CHAR.
In the previous version, invalid UTF-8 from a terminal caused
UCS_NO_CHAR (0xFFFFFFFD) to be stored in a term_event_key_T, resulting
in -3 which was then incidentally treated as an unassigned special key.

Now, invalid UTF-8 is instead mapped to UCS_REPLACEMENT_CHARACTER
and treated as a character.  The fact that handle_interlink_event
calls term_send_ucs when it receives invalid UTF-8 makes it pretty
clear that this is how it was intended.

src/viewer/text/link.c (not changed in this commit) already referred
to UCS_REPLACEMENT_CHARACTER in a comment even though it was not
previously defined.
2006-08-19 13:35:21 +03:00
Jonas Fonseca
c8c8325092 Fix assertion failure related to closing all tabs but the current
Decrement term->current_tab before calling delete_window() instead of after
deleting all backgrounded tabs, so get_tab_by_number() will see a
consistent value.
2006-08-14 16:12:54 +02:00
Jonas Fonseca
c5005ceeb3 Merge with http://www.iki.fi/kon/2006/elinks.git#ucs_kbdbind 2006-08-14 02:14:04 +02:00
Kalle Olavi Niemitalo
5737cc546b terminal UTF-8: check_kbd_label_key() allows non-ASCII characters again.
All of its callers now use unicode_fold_label_case() rather than toupper(),
if CONFIG_UTF_8 is defined.
2006-08-13 23:48:18 +03:00
Kalle Olavi Niemitalo
3b54979481 terminal doc: More documentation for keyboard event structures. 2006-08-13 23:25:52 +03:00
Kalle Olavi Niemitalo
7ebc8d8281 terminal UTF-8: New type term_event_char_T.
It is either unicode_val_T or unsigned char.
2006-08-13 23:23:54 +03:00
Laurent MONIN
0fdba55e52 Few whitespaces fixes. 2006-08-13 20:57:35 +02:00
Kalle Olavi Niemitalo
c8584a1c7e terminal: New type term_event_modifier_T.
KBD_MOD_NONE and related constants are now also visible in GDB.
2006-08-13 19:41:46 +03:00
Kalle Olavi Niemitalo
f290ff5608 terminal: New enum term_event_special_key.
This makes constants like KBD_ENTER visible to the debugger, at least
when compiled with GCC.
2006-08-13 19:03:09 +03:00
Kalle Olavi Niemitalo
c5c36eba88 terminal: Define term_event_key_T as int32_t, not int.
int might be 16-bit and that is not enough.
2006-08-13 17:16:10 +03:00
Kalle Olavi Niemitalo
de93359a5a Support Ctrl-Alt-letter key combinations.
Actions can now be bound to e.g. Ctrl-Alt-A.  The keybinding code also
supports other combinations of modifiers, like Shift-Ctrl-Up, but the
escape sequence decoder doesn't yet.

Don't let Ctrl-Alt-letter combinations open menus.
2006-08-13 15:32:06 +03:00
Kalle Olavi Niemitalo
6108c3e109 check_kbd_label_key: Allow only the Alt modifier.
Thus, pressing Ctrl-O in the "Terminal options" dialog no longer
triggers the "~OK" button.  One must instead press o, O, Alt-o, or
Alt-O.
2006-08-13 15:27:48 +03:00
Kalle Olavi Niemitalo
a14074a763 try_document_key: Convert the key to UCS-4, resolving the FIXME.
This requires compiling cp2u() in even without CONFIG_UTF_8.
I also added an is_kbd_character macro to make try_document_key
more resilient to changes in the definition of term_event_key_T.
2006-08-12 16:04:21 +03:00
Kalle Olavi Niemitalo
f3b04b8645 terminal: Introduce term_event_key_T. 2006-08-12 14:48:08 +03:00
Miciah Dashiel Butler Masters
cfbf7d1439 Comment the UTF-8 decoding in handle_interlink_event
Thanks to Kalle Olavi Niemitalo for explaining it to me. Any errors,
however, are no doubt my own.
2006-08-06 22:17:20 +00:00
Kalle Olavi Niemitalo
462607416c terminal: Read modifiers from the first UTF-8 byte, not the last.
Previously, ELinks used to silently discard the Alt modifier from
Alt- keystrokes when UTF-8 I/O was enabled.  Now, separate actions
can be bound to  and Alt-.

However, if CONFIG_UTF_8 is defined, then actions cannot be bound to
non-ASCII characters, regardless of modifiers.  This is because the
code that handles names of keystrokes assumes a character can only be
a single byte.  This commit does not change that.
2006-08-06 20:51:49 +00:00
Kalle Olavi Niemitalo
a9da075eb5 terminal UTF-8: term_event_keyboard.key is UCS-4, #ifdef CONFIG_UTF_8.
Form fields and BFU text-input widgets then convert from UCS-4 to UTF-8.
If not all UTF-8 bytes fit, they don't insert anything.  Thus it is no
longer possible to get invalid UTF-8 by hitting the length limit.

It is unclear to me which charset is supposed to be used for strings
in internal buffers.  I made BFU insert UTF-8 whenever CONFIG_UTF_8,
but form fields use the charset of the terminal; that may have to be
changed.

As a side effect, this change should solve bug 782, because
term_send_ucs no longer encodes in UTF-8 if CONFIG_UTF_8 is defined.
I think the UTF-8 and codepage encoding calls I added are safe, too.
A similar bug may still surface somewhere else, but 782 could be
closed for now.

This change also lays the foundation for binding actions to non-ASCII
keys, but the keystroke name parser doesn't yet support that.
The CONFIG_UTF_8 mode does not currently support non-ASCII characters
in hot keys, either.
2006-08-06 20:02:43 +00:00
Kalle Olavi Niemitalo
8a1d7e2fa3 terminal UTF-8: Translate all input via UCS-4, #ifdef CONFIG_UTF_8. 2006-08-06 20:02:41 +00:00
Kalle Olavi Niemitalo
1e9f5f6743 terminal: term_send_ucs makes its own struct term_event. 2006-08-06 20:02:40 +00:00
Kalle Olavi Niemitalo
e2a93ac8c3 Renumber special keys to negative values, making room for Unicode.
This version should still be interlink compatible with previous ones.
2006-08-06 20:02:40 +00:00
Kalle Olavi Niemitalo
fde466bde9 terminal: Introduce macros for KBD_F1...KBD_F12 arithmetic. 2006-08-06 20:02:39 +00:00
Kalle Olavi Niemitalo
6052fa12d8 terminal: Define separate structs for events passed via the interlink socket.
This way, struct term_event can be changed without any interprocess
compatibility problems.
2006-08-06 20:02:39 +00:00
Kalle Olavi Niemitalo
51bc99a175 terminal: decode_terminal_escape_sequence ignores previous value of *ev.
There is no need to check whether ev->ev == EVENT_KBD;
if decode_terminal_escape_sequence called
decode_terminal_mouse_escape_sequence, then the former neither modified
kbd.key nor passed &kbd to the latter, so kbd.key remains KBD_UNDEF.

If ev->ev was not checked, then it should not be trusted either.
So reinitialize the whole *ev if a keyboard event was indeed found.
2006-08-06 20:02:38 +00:00
Kalle Olavi Niemitalo
9e30ee631c terminal: Do not call toupper with potentially out-of-range values.
For instance, if Ctrl-F1 were pressed and src/terminal/kbd.c supported it,
then toupper(KBD_F1) would be called, resulting in undefined behaviour.
src/terminal/kbd.c does not support such combinations yet, but it is
safest to fix the bug already.
2006-08-06 20:02:38 +00:00
Kalle Olavi Niemitalo
50603fc66c terminal: Decode UTF-8 only from bytes, not from codes of special keys. 2006-08-06 20:02:37 +00:00
Kalle Olavi Niemitalo
cccab0462a terminal doc: itrm.in.sock == itrm.out.std in the master process.
As already documented at handle_trm().
2006-08-01 11:00:23 +00:00
Kalle Olavi Niemitalo
c04afba4e9 terminal doc: TERM=sun explains 4 ctl seqs. Terminfo u6 is position report. 2006-08-01 11:00:22 +00:00
Kalle Olavi Niemitalo
d5f30e77a5 terminal doc: Try to name one terminal for each keyboard escape sequence.
Also list the capnames with which the escape sequences could be
read from Terminfo, and the ECMA-48 interpretations of the bytes
(parenthesized if they seem unrelated to the keys).  This is in
preparation for fixing bug 96.
2006-08-01 11:00:22 +00:00
Kalle Olavi Niemitalo
ee4c3ee426 terminal doc: Add a comment about $TERM on FreeBSD. 2006-08-01 11:00:22 +00:00
Kalle Olavi Niemitalo
8f99828c75 terminal: Decode ESC O entirely separately from ESC [.
decode_terminal_escape_sequence() used to handle both, but
there is now a separate decode_terminal_application_key()
for ESC O.  I have not yet edited decode_terminal_escape_sequence();
there may be dead code in it.
2006-08-01 11:00:21 +00:00
Kalle Olavi Niemitalo
886dbf64df terminal: Rewrite process_queue. 2006-08-01 11:00:21 +00:00
Kalle Olavi Niemitalo
62c0bff87e terminal: In the ESC timeout, don't assume merely ESC was pressed.
If there is e.g. ESC [ in the input buffer, combine that to Alt-[.
Check the first character too; don't blindly assume it is ESC, as
it can be NUL as well.  Note this means you can no longer activate
the main menu by pressing Ctrl-@ (or Ctrl-Space on some terminals).
2006-08-01 11:00:21 +00:00
Kalle Olavi Niemitalo
fbd84630ac terminal: Move kbd_timeout below set_kbd_event.
This ought to make the diff of the next commit more readable.
2006-08-01 11:00:20 +00:00
Kalle Olavi Niemitalo
539f756438 terminal: Kill the ESC timer when blocking the terminal.
Otherwise, the timeout could cause ELinks to resume reading from
the terminal device while another process is still using it.
This actually happened in a test.

On entry to some functions that could resume reading from the device,
assert that the terminal has not been blocked.
2006-08-01 11:00:20 +00:00
Kalle Olavi Niemitalo
671cbb48e6 terminal doc: More comments about itrm->in.queue and bug 777. 2006-08-01 11:00:19 +00:00
Kalle Olavi Niemitalo
e9216413f2 terminal doc: Clarify itrm.remote and some others; fix grammar. 2006-08-01 11:00:19 +00:00
Kalle Olavi Niemitalo
711d672357 terminal doc: Document struct itrm and related things. 2006-08-01 11:00:18 +00:00
Laurent MONIN
1136aefb71 Trim trailing whitespaces. 2006-07-27 09:51:10 +02:00
Laurent MONIN
a897a95721 Compilation fixes (CONFIG_UTF_8): move variables declarations at start
of blocks. Old compilers do not support in-block declarations.
2006-07-27 09:49:49 +02:00
Pavol Babincak
a7a7984d89 Merge with http://www.fi.muni.cz/~xbabinc/elinks/elinks-utf8.git/
without ucdata stuff. UTF-8 code cleanup. Added Pavol Babincak
to the AUTHORS
2006-07-25 09:59:12 +02:00
Witold Filipczyk
2a6125e3d0 Merge with utf8. src/document/plain/renderer.c replaced by utf8 version 2006-07-21 13:12:06 +02:00
Witold Filipczyk
8fa3a4c88f Use isscreensafe also for UTF-8 2006-07-20 03:42:22 +02:00
Miciah Dashiel Butler Masters
f040b6f100 Fix crash when exiting after disabling the mouse
Add guards to return if the mouse is enabled or disabled in disable_mouse
and enable_mouse, respectively.
2006-07-02 03:28:51 +00:00
Miciah Dashiel Butler Masters
a0bcf254ae Modularise src/terminal 2006-05-20 15:01:24 +00:00
Miciah Dashiel Butler Masters
739298b46d Replace a loop with arithmetic in move_current_tab 2006-05-15 20:00:27 +00:00
Miciah Dashiel Butler Masters
3ee31b956a Fix wraparound behaviour in switch_to_tab 2006-05-15 19:57:46 +00:00
Kalle Olavi Niemitalo
408f9174a8 Use int_bounds in move_current_tab.
Requested by Miciah Dashiel Butler Masters.
2006-05-15 22:20:45 +03:00