1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-13 00:38:32 -04:00
Commit Graph

147 Commits

Author SHA1 Message Date
Witold Filipczyk
753e503e26 Removed the buggy code. 2007-01-08 11:38:34 +01:00
Kalle Olavi Niemitalo
ef96caad01 Make u2cp and u2cp_no_nbsp return a pointer to const. 2007-01-02 20:08:59 +02:00
Kalle Olavi Niemitalo
b586bd99bc Bug 871, 752: Lock down enum color_mode and change option help to match.
The numbering of document.dump.color_mode and terminal._template_.colors
is now the same regardless of compile-time options, unlike in previous
versions.  Therefore this version of ELinks may interpret a configuration
file differently from previous versions even if compiled with the same
options.  This is unfortunate but the alternatives (keeping the numbering
dependent on configuration options; defining separate options that use
the new numbering; starting the numbers from 10 or so and recognizing the
previous ones only for compatibility) seem even worse.
2006-12-25 11:51:24 +02:00
Kalle Olavi Niemitalo
c56fb7d630 Bug 871: Fall back to 16 colors if color_mode is unsupported.
There may currently be no way to select an unsupported mode,
but the next commit will change that.
2006-12-25 11:25:06 +02:00
Kalle Olavi Niemitalo
2aad5c7d09 fg_color[][] is const. 2006-12-25 11:04:16 +02:00
Kalle Olavi Niemitalo
45f39847c3 color_modes[] is const. 2006-12-25 11:03:51 +02:00
Kalle Olavi Niemitalo
5ae8721ebd color_mode_infos are const. 2006-12-25 11:02:01 +02:00
Kalle Olavi Niemitalo
39673505c8 set_term_color: Fix a typo in a comment. 2006-12-25 10:56:15 +02:00
Kalle Olavi Niemitalo
cae9b720bc Palettes are const.
This does not conflict with querying the palette from xterm (bug 890)
because although those palettes would have to be modifiable, they
would be terminal-specific rather than global.
2006-12-25 10:54:54 +02:00
Kalle Olavi Niemitalo
b4359e0445 Explicitly compare to COLOR_MODE_MONO where appropriate. 2006-12-25 10:27:23 +02:00
Kalle Olavi Niemitalo
9efc661384 Bug 827: Force UTF-8 I/O on if the UTF-8 charset is selected. 2006-12-09 21:13:13 +02:00
Kalle Olavi Niemitalo
bddafe5f7e Document how timer callbacks erase timer IDs; add some assertions.
Tangential to bug 868.
2006-12-02 18:35:03 +02:00
Kalle Olavi Niemitalo
8b8cd57941 Use new macro UCS_ORPHAN_CELL for broken double-cell characters.
UCS_ORPHAN_CELL is currently defined as U+0020 SPACE, which was
already used before this macro, so the behaviour does not change,
but the code seems clearer now.

I searched for ' ' and 32 and 0x20 and \x20, and replaced with
UCS_ORPHAN_CELL wherever UCS_NO_CHAR was involved.  However,
some BFU widgets first draw spaces and then overwrite with text;
those will require a more complex fix if UCS_ORPHAN_CELL is ever
changed to some other character.
2006-11-13 00:49:59 +02:00
Kalle Olavi Niemitalo
97f2ca5166 draw_char_data: Document the dubious unicode_to_cell call.
This was found while examining bug 821.
2006-11-02 09:23:59 +02:00
Kalle Olavi Niemitalo
a0ed52e699 Bug 724: Quadruple ITRM_IN_QUEUE_SIZE from 16 to 64 bytes.
DEC VT510 can apparently send 46 bytes of device attributes.
2006-10-30 23:15:43 +02:00
Kalle Olavi Niemitalo
b7319a75db Bug 724: terminal: Correct parsing of ECMA-48 control sequences.
The previous version assumed the first non-digit after the CSI was the
Final Byte, for example the first semicolon in the "\E[?1;2c" report.
It then treated all subsequent bytes as typed characters.
According to Standard ECMA-48 (Fifth Edition - June 1991), there may
be any number of Parameter Bytes in the range 0x30 to 0x3F, and then
any number of Intermediate Bytes in the range 0x20 to 0x2F, between
the CSI and the Final Byte.

This version still does not support control sequences longer than
ITRM_IN_QUEUE_SIZE bytes.
2006-10-29 18:41:16 +02:00
Kalle Olavi Niemitalo
23ca645054 terminal: Treat ESC O as Alt-O if the next byte is unsuitable for SS3. 2006-10-29 18:27:54 +02:00
Kalle Olavi Niemitalo
1c5db85b1a Bug 821: Document the charsets of buffers for BFU and form input fields. 2006-10-25 19:46:01 +03:00
Miciah Dashiel Butler Masters
5605a046a7 handle_interlink_event: don't check whether key <= 0xFF
This is a given, because any value >= 0x100 is negated.
2006-10-20 23:10:34 +00:00
Petr Baudis
10d72cae7e Revert cfce869a69 (The UTF-8 detection reactivated.)
Total crap - spits out garbage on random terminals when attaching instances
and sometimes hang the attached instance.
2006-10-16 23:12:35 +02:00
Jonas Fonseca
9b5446a025 Fix warning about undefined sscanf on Mac OS X 2006-10-14 05:12:23 +02:00
Witold Filipczyk
cfce869a69 The UTF-8 detection reactivated. It trashes slightly screen,
but works probably.
2006-10-12 13:13:10 +02:00
Witold Filipczyk
eef961e206 Detection of UTF-8 mode doesn't work well on slave terminals. 2006-10-11 21:13:43 +02:00
Laurent MONIN
0b58b99d30 Use @current_tab for current tab. 2006-09-28 23:58:26 +02:00
Laurent MONIN
3f94687e28 Use @tabs_count instead of mixed tabs_count, num_tabs or tabs. 2006-09-28 23:50:46 +02:00
Kalle Olavi Niemitalo
bac6e76c23 switch_to_tab: Prevent "tab number out of range" assertion failure.
To reproduce:
- Start ELinks.
- Enable the ui.tabs.wraparound option.
- Press t to open a second tab.
- Go to http://elinks.cz/ in the second tab.
- Press 3< to step three tabs to the left.

In the statement "tab = tabs + tab % tabs;", tab == -2 and tabs == 2.
So tab % tabs == 0 and tab becomes 2, which is out of range.

The new version calls get_opt_bool even if the tab parameter is already in
range, but the cost should be negligible compared to the redraw_terminal()
call that follows.
2006-09-27 21:29:27 +03:00
Kalle Olavi Niemitalo
92cb452a9e Rename CONFIG_UTF_8 to CONFIG_UTF8.
The configure script no longer recognizes "CONFIG_UTF_8=yes" lines
in custom features.conf files.  They will have to be changed to
"CONFIG_UTF8=yes".  This incompatibility was deemed acceptable
because no released version of ELinks supports CONFIG_UTF_8.

The --enable-utf-8 option was not renamed.
2006-09-17 16:12:47 +03:00
Kalle Olavi Niemitalo
e8462980e5 Change "utf_8" to "utf8" in most identifiers.
Suggested by Miciah on #elinks.

What was renamed:
  add_utf_8                      => add_utf8
  cp2utf_8                       => cp2utf8
  encode_utf_8                   => encode_utf8
  get_translation_table_to_utf_8 => get_translation_table_to_utf8
  goto invalid_utf_8_start_byte  => goto invalid_utf8_start_byte
  goto utf_8                     => goto utf8
  goto utf_8_select              => goto utf8_select
  terminal_interlink.utf_8       => terminal_interlink.utf8
  utf_8_to_unicode               => utf8_to_unicode

What was not renamed:
  terminal._template_.utf_8_io option, TERM_OPT_UTF_8_IO
    Compatibility with existing elinks.conf files would require an alias.
  --enable-utf-8
    Because the name of the charset is UTF-8, --enable-utf-8 looks better
    than --enable-utf8.
  CONFIG_UTF_8
    Will be renamed in a later commit.
  Unicode/utf_8.cp, table_utf_8, aliases_utf_8
    Will be renamed in a later commit.
2006-09-17 16:06:22 +03:00
Kalle Olavi Niemitalo
b42f0ba153 Bug 772: Recognize ESC [ Z as Shift-Tab, and bind it like Alt-Tab by default. 2006-09-17 12:38:23 +03:00
Kalle Olavi Niemitalo
c6f871b3af terminal doc: Explain the "ECMA-48 Terminfo $TERM" comments. 2006-09-17 12:23:34 +03:00
Witold Filipczyk
d9037cc4c3 Small comment about UTF-8 detection. 2006-09-01 21:06:08 +02:00
Witold Filipczyk
c1c494bd4b Preserved Linux console mode. When console was in one char mode, restore it.
When console was in UTF-8 mode, restore it, too.
2006-08-27 14:18:02 +02:00
Kalle Olavi Niemitalo
55212827c7 Outdent labels as instructed in doc/hacking.txt.
Reported by Jonas Fonseca.

Also add an empty line above the label in init_tab; but there are
still several labels elsewhere that don't have empty lines above them.
2006-08-27 10:44:36 +03:00
Witold Filipczyk
d299501076 Avoided white on white and similar cases in true color mode. 2006-08-26 19:21:08 +02:00
Witold Filipczyk
a094bddd1b Removed dead code. Add suffix _256 to TERM_COLOR_(BACK|FORE)GROUND. 2006-08-26 19:05:31 +02:00
Kalle Olavi Niemitalo
be7526d00a terminal UTF-8: Reject code points reserved for UTF-16 surrogates.
Those code points are allowed in CESU-8 but not in UTF-8.
2006-08-25 22:25:55 +03:00
Kalle Olavi Niemitalo
e333fb37ab terminal UTF-8: Have an array for the interlink->utf_8.min values.
The previous scheme incorrectly accepted 0xC1 0x80 as U+0040.
That could have been fixed by tweaking the loop, but the constant
array is surely easier to verify.
2006-08-25 22:20:33 +03:00
Jonas Fonseca
0ae69652dd Define SCREEN_COLOR_SIZE to hold the number of bytes in screen_char->color 2006-08-20 21:24:20 +02:00
Witold Filipczyk
77d7741726 Fixed transparency in true color mode. 2006-08-20 15:19:25 +02:00
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