1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-17 06:24:12 -04:00
Commit Graph

122 Commits

Author SHA1 Message Date
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
Kalle Olavi Niemitalo
2fd8538a72 Bug 821: kbd_field: CONFIG_UTF8 does not mean widget_data->cdata is UTF-8.
The current rules are:

             term.utf8
CONFIG_UTF8  UTF-8 I/O  widget_data.cdata
-----------  ---------  ------------------
undefined    disabled   charset of the terminal
undefined    enabled    charset of the terminal
defined      disabled   charset of the terminal (*)
defined      enabled    always UTF-8

(*) kbd_field was incorrectly assuming UTF-8 in this case.
2006-10-22 17:18:26 +03:00
Miciah Dashiel Butler Masters
28261fcfba check_dialog: compare return value from widget handlers explicitly
Explicitly compare the value that is returned by the widget handler
against EVENT_NOT_PROCESSED rather than relying on the fact that
EVENT_NOT_PROCESSED is equal to 1.
ffeedbdc5045a6a5db2bc75ecaab56bfe46c80ea
2006-10-20 23:10:35 +00:00
Laurent MONIN
e86e1d0fa3 Trim some trailing whitespaces. 2006-09-29 00:07:54 +02:00
Laurent MONIN
0b58b99d30 Use @current_tab for current tab. 2006-09-28 23:58:26 +02:00
Kalle Olavi Niemitalo
677e5c7adc Callers of cp_to_unicode() assert that it didn't return UCS_NO_CHAR.
UCS_NO_CHAR here means the input was too short.  Because the strings
generally come from the source code or from PO files, they should not
end in the middle of a character.  However, the whole character may be
missing if the string is empty.  So select_button_by_key() now checks
for that case separately.

UCS_NO_CHAR must not be passed to unicode_fold_label_case() because
the result is undefined.
2006-09-17 19:54:37 +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
6773c8505d BFU UTF-8: check_hotkeys_common() compares hotkeys as Unicode. 2006-08-13 23:45:41 +03:00
Kalle Olavi Niemitalo
b6447ae26b UTF-8: New function cp_to_unicode(). 2006-08-13 23:35:50 +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
Kalle Olavi Niemitalo
4d80fe6453 BFU UTF-8: select_button_by_key() folds the case of Unicode characters.
This causes the documented-slow cp2u() to be called in a loop, which
fortunately doesn't have very many iterations.  If this is too slow,
then cp2u() can be rewritten, or the hotkeys can be cached in struct
widget or struct widget_data.

Note that check_kbd_label_key() does not yet allow non-ASCII
characters when CONFIG_UTF_8 is defined.  Before they are allowed,
menu.c should also be updated.
2006-08-13 20:30:19 +03:00
Kalle Olavi Niemitalo
f3b04b8645 terminal: Introduce term_event_key_T. 2006-08-12 14:48:08 +03:00
Kalle Olavi Niemitalo
44633cd757 BFU: Fix cell count for forcibly wrapped lines.
To reproduce before this patch:
- Run ELinks with an 80x25 terminal.
- Set document.browse.forms.confirm_submit = 1.
- Go to <http://bugzilla.elinks.cz/query.cgi>.
- Click the [ Search ] submit button.
- ELinks asks "Do you want to post form data to URL".
  Each line of the URL begins at the horizontal center of the dialog,
  and bleeds outside the right border of the dialog.  Also, the
  [ Yes ] and [ No ] buttons appear to float below the dialog.
2006-08-06 23:26:55 +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
fde466bde9 terminal: Introduce macros for KBD_F1...KBD_F12 arithmetic. 2006-08-06 20:02:39 +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
Laurent MONIN
29fb051fc9 Compilation fix: move variables declarations to top. 2006-07-24 17:56:07 +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
Miciah Dashiel Butler Masters
29ffe71bc1 New actions: kill-word-back, move-backward-word, move-forward-word 2006-06-23 04:07:52 +00:00
Miciah Dashiel Butler Masters
588fa3ece8 Properly deselect the main menu instead of crashing
In send_kbd_event, use deselect_mainmenu to get rid of the main menu
instead of delete_window. This fixes bug 747.
2006-06-19 11:07:03 +00:00
Miciah Dashiel Butler Masters
81b4f8b917 done_listbox_item: if_assert_failed return 2006-06-16 21:13:32 +00:00
Miciah Dashiel Butler Masters
6f98f5fd96 Bookmarks: Fix update after move
do_move_bookmark was only updating the selection in the bookmarks manager
window in which the Move button was pressed. Now all windows are updated.

This patch also prevents a crash when the first item that was displayed
in a box was the last child of a folder and was being moved (the comment
removed in this patch was incorrect in assuming that bm->box->next must
be valid because it neglected to account for non-root children).

This change required that I move the definition of struct
hierbox_dialog_list_item from src/bfu/hierbox.c to src/bfu/hierbox.h.

Thanks to Kalle Olavi Niemitalo for finding both the update problem
and the crash.
2006-06-16 21:13:31 +00:00
Laurent MONIN
3e4bf0cf27 Fix: redraw main menu when one cancels it by clicking outside menu space. 2006-06-07 16:33:14 +02:00
Kalle Olavi Niemitalo
d10a489a14 BFU: Mark format strings in struct listbox_ops_messages.
With regular comments in the definition of the structure itself,
and with xgettext:c-format comments in constants of that type,
if xgettext would otherwise guess wrong; so that translators
will know they'll have to double any percent signs they add.
I didn't regenerate PO files, though.
2006-06-02 19:08:09 +00:00
Miciah Dashiel Butler Masters
f271a06487 Factor deselect_mainmenu out of select_menu_item, do_mainmenu,
mainmenu_mouse_handler, and mainmenu_kbd_handler
2006-06-02 03:57:53 +00:00
Miciah Dashiel Butler Masters
cdcc8c8415 do_mainmenu: get the menu's window via menu->win instead of using a
silly foreach loop
2006-06-02 03:54:54 +00:00
Miciah Dashiel Butler Masters
c330ae9b9c do_mainmenu: use add_to_list instead of add_at_pos 2006-06-02 03:27:55 +00:00
Laurent MONIN
5acb5e6663 Trim trailing whitespaces. 2006-05-31 19:34:49 +02:00
Laurent MONIN
1d3656a317 Pass a pointer to a hash pointer to free_hash() to ensure hash pointer
is NULL on return.
2006-05-31 19:33:36 +02:00
Laurent MONIN
54099f5286 Do not export init_hash(),strhash() and hash_size() anymore, use a
wrapper named init_hash8() instead.
2006-05-31 19:17:01 +02:00
Kalle Olavi Niemitalo
0a8633d07e BFU: Fix infinite loops in menus that have only unselectable elements.
src/bfu/menu.c (scroll_menu): Let neither menu->selected nor pos
become -2.

src/bfu/menu.c (menu_mouse_handler): Call set_menu_selection directly
rather than via scroll_menu, as sel is already known to be selectable.
(Not required for fixing the bug.)

src/bfu/menu.c (menu_search_handler): Break infinite loops also if
menu->selected is -1 initially.

src/bfu/menu.c (menu_handler): Instead of tweaking menu->selected
directly, let scroll_menu do it.
2006-05-21 20:09:53 +03:00
Kalle Olavi Niemitalo
9fa5ae374f BFU: Fix searching in menus past unselectable items.
The bug was that menu_search_handler gave scroll_menu an incorrect
count because it didn't know that scroll_menu skips unselectable
items.
2006-05-21 18:12:34 +03:00
Kalle Olavi Niemitalo
1fdd9002cb BFU: Redraw the terminal when moving the main menu to the bottom.
This fixes a bug where choosing e.g. "About" from the menu left
the main menu visible but Ctrl-L in the About dialog hid it again.
2006-05-15 00:30:54 +03:00
Kalle Olavi Niemitalo
ca84c353b5 BFU: Display the main menu immediately when activating it.
This fixes two bugs:
1. Pressing F9 did not make the main menu visible, but then pressing
   e.g. Right made it visible.
2. Pressing F9 and then Down displayed the first submenu (File) at the
   wrong position on the screen.
2006-05-15 00:15:08 +03:00
Jonas Fonseca
2fcf33541c Merge with http://www.iki.fi/kon/2006/elinks.git#plausible 2006-05-13 23:15:05 +02:00
Kalle Olavi Niemitalo
eae626a981 doc: Added src/bfu/README.
src/bfu/README: This new file currently contains a diagram of how the
various struct types of src/bfu/ and src/terminal/ relate to each
other.  More documentation may be added later, although if it is
specific to a particular structure, then it should probably go in the
corresponding header file so that people will remember to update it.
2006-05-13 17:01:20 +03:00
Pavol Babincak
31f2c28c06 Correction of b0e2840f0d. Do not correct main menu when utf-8 is not used. 2006-05-07 00:51:27 +02:00
Miciah Dashiel Butler Masters
3b64f2e9e8 Preserve the text when doing a prefix completion. 2006-04-29 22:55:32 +00:00
Miciah Dashiel Butler Masters
6d3b2a97f6 Ignore text after the cursor when performing a completion. The text will
be deleted.
2006-04-29 22:30:07 +00:00
Pavol Babincak
c8a6a4c44d Fix broken double-width chars when displaying menu or dialog. 2006-04-09 16:59:27 +02:00
Pavol Babincak
b0e2840f0d When double-width character in mainmenu is on last collumn don't show it. 2006-04-08 00:42:41 +02:00
Pavol Babincak
3c019606b2 Correct split on punctuation in BFU text.
When CONFIG_UTF_8 is defined but utf8 isn't used.
2006-04-08 00:37:25 +02:00
Pavol Babincak
662ffb903c Modified inpfield to be able to work with double-width UTF-8 chars.
Note: there is ugly hack in ACT_EDIT_BACKSPACE where last byte of UTF-8
character is removed and then moving to left until complete UTF-8
character is found.
2006-04-08 00:16:10 +02:00
witekfl
97d7a57b8a Do not delete main menu while displaying dialogs or when mouse is
pressed outside menu bar
2006-03-11 21:08:02 +01:00
Pavol Babincak
509fe2cf0d Added support for double-width UTF-8 checkboxes and listbox in dialogs. 2006-03-06 15:15:30 +01:00
Pavol Babincak
10303bb94a Added support for UTF-8 (including double-width) texts in dialogs. 2006-03-06 06:18:47 +01:00
Pavol Babincak
dfe029bc27 Added support for correctly displaying double-width UTF-8 chars in buttons.
With UTF-8 support in terminal enabled it is possible to use double-width
UTF-8 strings as margins of buttons. Although they are displayed wrong when
UTF-8 support in terminal is disabled.
2006-03-06 06:09:58 +01:00