1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-21 01:56:55 -04:00
Commit Graph

1517 Commits

Author SHA1 Message Date
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
6773c8505d BFU UTF-8: check_hotkeys_common() compares hotkeys as Unicode. 2006-08-13 23:45:41 +03:00
Kalle Olavi Niemitalo
85d4c5679c UTF-8 doc: unicode_fold_label_case() may be called for any Unicode character.
It cannot be restricted just to characters that have passed
check_kbd_label_key(), because hotkeys in strings received from
gettext must also be processed with it, and there we don't have
a struct term_event for check_kbd_label_key().
2006-08-13 23:41:48 +03:00
Kalle Olavi Niemitalo
b6447ae26b UTF-8: New function cp_to_unicode(). 2006-08-13 23:35:50 +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
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
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
Jonas Fonseca
abc66da432 really_add_keybinding: Indent msg_text arguments 2006-08-13 14:50:45 +02:00
Jonas Fonseca
98e8ba781f Merge with http://www.iki.fi/kon/2006/elinks.git#ctrl-alt 2006-08-13 14:47:46 +02:00
Kalle Olavi Niemitalo
1837a55444 really_add_keybinding: Remove unneeded initialization.
According to Jonas Fonseca, if init_string(&canonical) fails, then it
anyway sets canonical.source = NULL and makes done_string(&canonical)
safe, even if canonical was previously uninitialized.
2006-08-13 15:45:13 +03:00
Kalle Olavi Niemitalo
c79ecefe73 doc: Document parse_keystroke(). 2006-08-13 15:41:34 +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
2eeb14f95c Key name strings are const in read_key() and in its (indirect) callers. 2006-08-13 14:44:01 +03:00
Jonas Fonseca
edeb934cc3 try_mark_key: try to improve readability by using a local var and a cast
The cast is not necessary since we already check the bounds, but by using a
cast here, it hopefully makes it more obvious what the long comment above
is pointing out: namely that we put the value of a signed integer into an
unsigned char.
2006-08-13 13:27:16 +02:00
Kalle Olavi Niemitalo
aba0bc77a8 parse_keystroke: Never write back to the input string.
This fixes a bug: in the previous version, l_bind_key() modified the
buffer whose address lua_tostring() returned, even though that is not
allowed according to Lua documentation <http://www.lua.org/pil/24.2.2.html>.

The change affects the user interface: previously, if the user typed
"ctrl+cokebottle" in the "Add keybinding" dialog box, ELinks would
change the text in the widget to "Ctrl-cokebottle" before complaining
that the keystroke is invalid.  Now, it leaves the widget unchanged.

This commit does not yet add const to parameters of parse_keystroke()
and related functions.
2006-08-13 14:24:28 +03:00
Jonas Fonseca
f24fa6ef63 search_dlg_do: Minor (questionable) cleanup 2006-08-13 13:20:32 +02:00
Kalle Olavi Niemitalo
93ef5e02f5 really_add_keybinding: Display the canonical name of the keystroke.
Before really_add_keybinding() is called, check_keystroke() calls
parse_keystroke(), which converts the modifier prefix to canonical
form: for example, "alt+f9" becomes "Alt-f9".  This commit makes
really_add_keybinding() normally ignore that string and generate a
brand new one, e.g. "Alt-F9" (note the upper-case F), for its
"Keystroke already used" warning.  Likewise, " " turns to "Space".

After this commit, it should be possible to change parse_keystroke()
to never write back into its input string.

If really_add_keybinding() cannot generate the string for some reason
(out of memory?), then it will use whatever parse_keystroke() has left
in the buffer.  The alternatives would be to omit the keystroke name
from the warning or to reject the keybinding entirely; it isn't clear
what the best solution is here, but the one I implemented is closest
to the previous behaviour.
2006-08-13 14:04:17 +03:00
Kalle Olavi Niemitalo
19bb5f02d1 do_file_menu: Correct the order of arguments in SET_MENU_ITEM invocations.
The last two parameters are hotkey_state_ and hotkey_pos_, not vice versa.
This bug did not affect the binary because HKS_SHOW is defined as 0 anyway.
2006-08-13 07:37:39 +00:00
Miciah Dashiel Butler Masters
75e292efe6 Mark the prompt for a key when adding a binding as translatable
Thanks to Kalle Olavi Niemitalo for noticing this omission.
2006-08-13 07:34:25 +00:00
Witold Filipczyk
5e1a1a215a Fixed about: 2006-08-13 08:58:20 +02:00
Kalle Olavi Niemitalo
143d95e927 UTF-8: Reuse the translation table if it is from the same charset.
This change makes ELinks more efficient and causes bug 782 to occur
far less often.  (That does not mean the bug should not be fixed.)
2006-08-12 21:10:39 +02:00
Witold Filipczyk
b1c8eb5572 SEE: use periodic callback. SEE engine passes infinite test 2006-08-12 19:07:16 +02:00
Witold Filipczyk
0a1b522fdd Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-08-12 18:46:43 +02:00
Witold Filipczyk
19315e136e Ecmascript: the code adjusted for SEE-2.0 2006-08-12 18:43:31 +02: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
f97a392c01 try_mark_key: Reject non-ASCII keys as mark characters.
The previous version used only the low 8 bits of the key code.
This one arranges for the whole key to be rejected if it's not ASCII.
Perhaps the modifiers should be checked too, but I'm not changing that now.
2006-08-12 15:07:07 +03:00
Kalle Olavi Niemitalo
2648fd57e4 UTF-8 doc: Clarify FIXME in try_document_key. 2006-08-12 15:00:44 +03:00
Kalle Olavi Niemitalo
8be5ed9749 add_accesskey_to_string: Use KBD_MOD_NONE, rather than plain 0. 2006-08-12 14:53:28 +03:00
Kalle Olavi Niemitalo
f3b04b8645 terminal: Introduce term_event_key_T. 2006-08-12 14:48:08 +03:00
Kalle Olavi Niemitalo
e101f5f537 UTF-8 doc: Clarify FIXME in add_accesskey_to_string. 2006-08-12 12:37:37 +03:00
Miciah Dashiel Butler Masters
8344dfe6c9 Fix IPv4 DNS lookup bug
In revision 1.15 of dns.c (as it was called way back then), pasky
backported a fix from Links 0.97pre2 to try gethostbyaddr before
trying gethostbyname for DNS lookups:

   MacOS address resolution fix (Aldy Hernandez) (from 0.97pre2)

However, that fix introduced a bug, because it was calling gethostbyaddr
on all addresses, not just IP addresses. Mikulas fixed that bug in Links
0.98:

   Do not call gethostbyaddr when name is not ip address (it should avoid
   some useless nameserver queries)'

This fix was never backported to ELinks. Until today.

This commit is functionally the same as the fix in Links 0.98, plus it uses
inet_aton for great correctness!

This fixes a bug reported in #elinks by tnks, whereby lookups for
yubnub.org resulted in 121.117.98.110 == 0x7975626E == 'y', 'u', 'b', 'n'.
I believe that it also fixes bug 691 (which is already closed with a
workaround).
2006-08-09 12:42:54 +00: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
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
f7fd49cf28 UTF-8: New function unicode_fold_label_case and a related script. 2006-08-06 20:02:42 +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
c4acdb6d3c config: Do not treat all negative key values like KBD_UNDEF. 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
ef2f6383c6 do_auth_dialog: Don't claim that the authentication is for HTTP. 2006-08-06 20:02:36 +00:00
Kalle Olavi Niemitalo
ca496aa2dd do_auth_dialog: Fix off-by-one error leading to reads of uninitialized memory.
This bug manifested as a junk character at the end of the text in the
authentication dialog.
2006-08-06 20:02:35 +00:00
Miciah Dashiel Butler Masters
5b260ad69d Add a missing blank line between check_option_name and push_add_button 2006-08-05 19:46:09 +00:00
Miciah Dashiel Butler Masters
b5b285b5df Mark check_keystroke and new_hop_from static. 2006-08-05 19:42:20 +00:00
Witold Filipczyk
a5c395cd7a Workaround for segfaults introduced by previous commit.
Why html_context->part->document isn't set ?
2006-08-05 20:17:48 +02:00
Witold Filipczyk
b7409fc5a7 The fix for bug 784. There is a wide area to cleanup and tidy up the code. 2006-08-05 18:32:05 +02:00
Witold Filipczyk
bdc3fcb7e4 I forgot about this one 2006-08-05 18:08:52 +02:00
Witold Filipczyk
049d088e8a The massive attack: the only property of options used by get_attr_val was
cp (codepage). To fix bug 784 html_context->part->document->cp should
be passed to get_attr_val instead of html_context->options->cp.
2006-08-05 18:06:28 +02:00
Jonas Fonseca
b9908b4622 Use internal OFF_T_FORMAT instead of PRId64
... since the latter is for printing int64_T and we don't check for that and
we use PRId64 only for printing values having the off_t types.

Besides off_t has it's own ELinks specific defaults so it should be safer
to use an internal format string. If off_t is 8 bytes use "lld" else use
"ld".

Reported-by: Andy Tanenbaum <ast@cs.vu.nl>
2006-08-05 00:43:34 +02:00
Miciah Dashiel Butler Masters
948d010088 Drop obsolete, commented-out code in put_chars
Drop some code for superscript and subscript handling that was deleted
in commit 65016cdca4, then added back
with the UTF-8 merge in commit 2a6125e3d0,
and then disabled in commit 1b653b9765.
2006-08-03 06:12:30 +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
Kalle Olavi Niemitalo
7dcc6c9a19 viewer UTF-8: Correctly position cursor for ACT_EDIT_LEFT in text input field.
To reproduce the bug before this patch:
Enable CONFIG_UTF_8, UTF-8 I/O, and UTF-8 charset.
Go to www.google.com and type "abc" in the text input field.
Then press Left.  The cursor jumps to "a" when it should go to "c".
2006-07-31 21:46:36 +02:00
Witold Filipczyk
5fd284d6a2 The value of UCS_NO_CHAR was bad. There must not be a possibility
to encode it using utf_8_to_unicode. If every unicode_val_T value
could be a result of that function then one must add out param
to the utf_8_to_unicode signaling 'true' UCS_NO_CHAR.
2006-07-31 21:23:47 +02:00
Witold Filipczyk
2e818771d0 Made directory listings XML compliant 2006-07-31 13:24:39 +02:00
Witold Filipczyk
7af9cf5ebc The missing line:
cells += added_chars - 1;
This is a fix for bug 778.
goto next instead of continue. Not heavilly tested
2006-07-28 22:33:16 +02:00
Petr Baudis
3e2f7f48b5 Merge with /srv/git/elinks.git 2006-07-27 15:05:52 +02:00
Petr Baudis
8627189148 Support for mouse wheel over GPM
GPM is awful, tho', and this is an ugly hack. Why can't it just report
buttons like everyone else?

Another nice thing is that we don't seem to get the wheel events more
frequently than once in a second or so. Therefore it will work properly
only when you scroll slooooowly. :^)
2006-07-27 15:05:18 +02: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
Miciah Dashiel Butler Masters
3ff8422e76 Fix a crash with the download manager when CONFIG_UTF_8 is enabled
In draw_file_download, pass get_file_download_text the terminal pointer
instead of NULL.
2006-07-26 21:28:40 +00:00
Witold Filipczyk
d83068ec85 Proper CFLAGS and LDFLAGS for the Python scripting backend.
The patch by M. Levinson.
I added DIR to the --with-python
2006-07-26 21:27:57 +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
6c8f532692 Fixes to the Python scripting by M. Levinson 2006-07-24 18:52:25 +02:00
Laurent MONIN
29fb051fc9 Compilation fix: move variables declarations to top. 2006-07-24 17:56:07 +02:00
Witold Filipczyk
8b4daed148 Commented out the code causing infinite loop when viewing
test/backspaces.txt.
2006-07-23 16:35:53 +02:00
Witold Filipczyk
4263af97a9 The missing code, I suppose. Fixed moving right in textareas in UTF-8 mode.
First move was by two cells.
2006-07-23 15:23:19 +02:00
Witold Filipczyk
58b158871c Decode the second char of double glyph. Still problems with a splitted
char
2006-07-23 13:14:38 +02:00
Witold Filipczyk
7cb91c3213 Decode the second char from double glyph. When that char is splitted
by convert_string and that char is the beginning of double glyph too
we have a problem. This is a rare case. Must we care about it?
2006-07-23 13:04:39 +02:00
Witold Filipczyk
a3e0caca57 Return number of really processed chars. In that case 0 2006-07-23 12:27:20 +02:00
Jonas Fonseca
8e438aaa33 Merge with git+ssh://pasky/srv/git/elinks.git 2006-07-22 17:06:44 +02:00
Jonas Fonseca
71e569c129 Move variable out of loop to fix uninitialized warning caused by goto label 2006-07-22 17:06:05 +02:00
Witold Filipczyk
f5351fc0dc Remember fragment of the splitted char and decode it next time. Idea by Jonas.
Not tested at all. UCS_NO_CHAR is returned only for <hr> or for UTF-8 char
which is splitted by convert_string
2006-07-21 22:10:18 +02:00
Witold Filipczyk
7c7a0bb890 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-07-21 19:00:49 +02:00
Witold Filipczyk
1b653b9765 Compilation fix 2006-07-21 13:21:21 +02:00
Miciah Dashiel Butler Masters
97e2bc9365 Text type-ahead searching: don't follow current link on enter
When the user presses enter during a text type-ahead search, simply cancel
the search without additionally following the current link. Link type-ahead
searching still will follow the active link on enter.
2006-07-21 11:15:30 +00: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
ecbc2271d1 examine_element: drop html_stack parameter
The stack is available via the html_context, which is passed to
examine_element as of commit f42c86be70744e62af92282e4d64fc3066f6ba04.
2006-07-21 11:10:54 +00:00
Witold Filipczyk
8fa3a4c88f Use isscreensafe also for UTF-8 2006-07-20 03:42:22 +02:00
Witold Filipczyk
8a1ef2ada9 That was missing, at least I think so 2006-07-20 02:05:56 +02:00
Witold Filipczyk
b388b4afea Avoided rerendering 2006-07-20 02:03:25 +02:00
Witold Filipczyk
70a46e12aa Fixed the issue when assummed codepage is not UTF-8 2006-07-19 19:11:03 +02:00
Witold Filipczyk
8c3f931ff0 Wide char could be bigger than 0xffff 2006-07-18 20:33:34 +02:00
Witold Filipczyk
3126078f51 Rexgexp works but the accented letters. It's all I can do 2006-07-18 18:06:43 +02:00
Witold Filipczyk
b27667fcf7 Use already known document->options.utf8 instead of is_cp_utf8 2006-07-18 17:54:23 +02:00
Witold Filipczyk
44c74ac389 Refactor is_cp_special to is_cp_utf8 2006-07-18 17:51:03 +02:00
Witold Filipczyk
681cfc4ae5 Populate search function with utf8 indicating whether we really use UTF-8 2006-07-18 17:39:02 +02:00
Witold Filipczyk
02e098dc5a Case insensitive search works with accented letters. UTF-8 character set
is assummed for now
2006-07-18 12:31:30 +02:00
Witold Filipczyk
7dc2b5bf02 Case insensitive search works but accented letters 2006-07-18 00:44:08 +02:00
Witold Filipczyk
8052c74a03 Case sensitive searching works, but only in UTF-8 mode 2006-07-18 00:28:13 +02:00
Witold Filipczyk
1adbce8429 unicode_val_T instead of unsigned char in struct search 2006-07-17 22:14:45 +02:00
Petr Baudis
85c9c54d00 Accept float widths (ceiling them)
Especially percentages might be floats instead of integer, see
e.g. http://www.armitunes.com/cgi-bin/icecast/playing.cgi.
2006-07-16 22:22:16 +02:00
Witold Filipczyk
d0f7a9279e It works without this code 2006-07-16 16:00:56 +02:00
Witold Filipczyk
ff136e5116 Bugfix for bug 770 (Download resuming simply restarts the download)
using magic ;)

Now in resume mode connection is always interrupted
and resumed. Even when all file is downloaded from beginning
conection will be resumed from old end of file. Feel free to fix it.
2006-07-16 14:46:46 +02:00
Jonas Fonseca
ef051261b3 Improve upon pasky's intro to the HTML engine 2006-07-13 21:12:24 +02:00
Petr Baudis
314dbc2dab Add short intro and talk about box model 2006-07-13 03:46:16 +02:00
Petr Baudis
1ae18267f8 Kill src/document/html/TODO
In the first paragraph it lists what's already done. In the second it
lists the obvious. And the third is obsolete.
2006-07-13 02:51:31 +02:00
Petr Baudis
250669b0e9 Merge with /srv/git/elinks.git 2006-07-13 02:49:41 +02:00
Laurent MONIN
36a277540c Let be more tolerant with buggy meta refresh. It should fix bug 767. 2006-07-10 21:16:14 +02:00
Jonas Fonseca
442645b766 Clean vernum.o
Reported-by: paakku on #elinks
2006-07-10 14:28:21 +02:00
Witold Filipczyk
00fc1c394c Avoid compilation of vernum.c in 'make install' 2006-07-09 17:25:29 +02:00
Witold Filipczyk
2d9e28bd68 Used dir_sep instead of hard coded '/' 2006-07-09 13:02:44 +02:00
Witold Filipczyk
a35307f85a Revert "ELinks doesn't change current directory, so get_cwd and set_cwd are useless"
This reverts f53cbc756f commit.
2006-07-09 00:55:07 +02:00
Witold Filipczyk
f53cbc756f ELinks doesn't change current directory, so get_cwd and set_cwd are useless 2006-07-09 00:25:30 +02:00
Laurent MONIN
1ec1dc43be LONG/INT: fix compilation under AMD64, reported by Miciah. 2006-07-05 15:11:53 +02:00
Laurent MONIN
c2ca89cab1 HTTP DIGEST AUTH: fix wrong sizeof(), patch by Vitaly Lavrov (added to
AUTHORS). Close bug 769.
2006-07-05 15:07:48 +02:00
Witold Filipczyk
2f82a708db win32: Keys F1 - F10 are useable 2006-07-02 20:06:57 +02:00
Witold Filipczyk
1f747b2299 Local file browsing works under Windows. It is done lame way.
In protocol/common.c length of string is known, so pass it
instead of -1 to encode_uri_string.
Introduced encode_win32_uri_string, because there were problems
with : and \ in base href.
2006-07-02 19:20:27 +02:00
Witold Filipczyk
8fa2b8180e s|/|\|g in directory listings under Windows 2006-07-02 16:48:39 +02:00
Witold Filipczyk
c6426b4634 CHAR_DIR_SEP used in directory listings 2006-07-02 16:38:52 +02:00
Witold Filipczyk
f45146ebc5 Introduced CHAR_DIR_SEP 2006-07-02 16:30:41 +02:00
Witold Filipczyk
fa9c449c87 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-07-02 09:47:05 +02:00
Witold Filipczyk
cad9bf3010 osdep/osdep.h was superfluos 2006-07-02 09:16:28 +02:00
Witold Filipczyk
3fd1ac87bd STRING_DIR_SEP in file redirects 2006-07-02 09:01:14 +02:00
Witold Filipczyk
7934d3c7d6 STRING_DIR_SEP in config/* 2006-07-02 08:53:33 +02:00
Witold Filipczyk
d1e5e0b7d2 Introduced STRING_DIR_SEP for better portability 2006-07-02 08:44:52 +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
Petr Baudis
0f8ee055db Fix compilation of perl hooks
It complains here that n_a might be used uninitialized and POPpx doesn't
set anything like it.
2006-06-30 00:54:06 +02:00
Laurent MONIN
9412cc77f0 INT/LONG: introduce long_wr() and long_set() and use them instead of
num_wr() and num_set() for options of type OPT_LONG.
2006-06-27 14:13:04 +02:00
Laurent MONIN
bd38ed5b17 LUA: use long instead of int with OPT_LONG. 2006-06-26 17:55:42 +02:00
Laurent MONIN
2454ceffb7 config/options: use struct option big_number field instead of number
field where OPT_LONG is used.
2006-06-26 17:49:59 +02:00
Laurent MONIN
cde9db3d70 config/options: add_opt() casts value to long then store in int... see
bug 764. Micro step to a fix.
2006-06-26 17:37:10 +02:00
Laurent MONIN
6637272c5a config/options: arrange add_opt() to use only mem_free() instead of
delete_option() in case of allocation failure.
2006-06-26 17:33:00 +02:00
Laurent MONIN
c3cf5b9474 config/options: add_opt() @min and @max parameters have to be long to
match struct option.
2006-06-26 17:28:45 +02:00
Witold Filipczyk
a69ef92723 assertm(fd >= 0 && fd < FD_SETSIZE) always fails under Windows, so
this assertion is excluded on that platform
2006-06-25 12:36:46 +02:00
Miciah Dashiel Butler Masters
7a9b9f8171 Fix focus issue with the 'Toggle display' button in the keybindings manager
Don't call clear_dialog, which sets the focus to the listbox.  Neither the
button widget nor the listbox widget has a clear callback, and the only
other thing that clear_dialog does is focus the first widget and redraw, so
call redraw_dialog instead.

Thanks to Kalle Olavi Niemitalo for noticing the issue.
2006-06-24 08:22:24 +00:00
Miciah Dashiel Butler Masters
76f3dc99b3 Fix refresh after move-page-up with a prefix
Make move_up and move_down return no value. Instead, save the old y value
and compare it to the new after calling move_up or move_down in
move_page_up or move_page_down, respectively.

This fixes a bug where if given a prefix, if that prefix specified a number
of pages greater than move-page-up actually scrolled, there would be no
screen update, because the last call to move_up would return FRAME_EVENT_OK
which would be returned from move_page_up, even tho move_page_up would have
previously returned FRAME_EVENT_REFRESH.
2006-06-24 07:39:23 +00:00
Miciah Dashiel Butler Masters
888faebaea parse_header_param: better describe behaviour when @ret is NULL
This got lost during merging of Kalle Olavi Niemitalo's patches.
2006-06-23 06:07:22 +00: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
1bd498cde9 Fix accesskeys so that they work when priority is 0
Don't try the key as an accesskey if a menu was opened, whether it was just
the main menu or whether it was a submenu of the menu menu (we would try
the key as an accesskey in the latter case).

In send_kbd_event, replace the KBD_MOD_ALT modifier when trying the key as
an accesskey rather than when we don't.
2006-06-19 11:34:49 +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
a3d804540a Factor draw_link out of clear_link 2006-06-17 01:02:50 +00:00
Miciah Dashiel Butler Masters
bfc8b17d64 Fix a bug in the plaintext renderer when handling tabs
Commit 3ce3f01f30 introduced a bug whereby
if a tab set the current position in the line to or greater than the number
of bytes remaining in the source, the line was split after the tab.
2006-06-16 21:13:33 +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
b41c7d4055 MIME: fix crash with empty File extensions menu
Delete the FREE_LIST flag from mi_no_ext so that free_menu_items doesn't
try to free static memory.

This fixes a crash reproducible by deleting every entry under Setup -> File
extensions, opening said menu, and then closing said menu.
2006-06-16 21:13:32 +00:00
Miciah Dashiel Butler Masters
32ec5d1db3 do_move_bookmarks: replace destb and desti parameters with insert_as_child flag
Simplify do_move_bookmarks (from a readability perspective) by replacing
the destb and desti parameters with a new insert_as_child flag. Inspired
by Kalle Olavi Niemitalo.
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
Miciah Dashiel Butler Masters
fed0d6bd54 Bookmarks: Include bfu/listbox.h and bfu/hierbox.h 2006-06-16 21:13:31 +00:00
Laurent MONIN
645ee58c83 http_negotiate_get(): only change *is_new on successful allocation. 2006-06-16 16:27:28 +02:00
Laurent MONIN
2217c885b4 http_negotiate: tidy up. 2006-06-16 16:26:20 +02:00
Laurent MONIN
2e0d5aa197 Add forgotten files from negotiate-auth patch. 2006-06-14 20:25:11 +02:00
Laurent MONIN
b373ded19b Trim trailing whitespaces. 2006-06-14 14:46:30 +02:00
Laurent MONIN
4b04a25b32 Support for negotiate-auth, using GSSAPI. It makes possible to
authenticate users by Kerberos. Patch by Karel Zak.
2006-06-14 14:41:59 +02:00
Miciah Dashiel Butler Masters
52bd1ea01b SMJS: Fix crash with elinks.vs and no document loaded
Make sure that there really is a view_state before creating a wrapper
object with a bad pointer for it.
2006-06-11 02:33:41 +00:00
Miciah Dashiel Butler Masters
5899c281ce SMJS: bookmark_folder_get_property: Reflow some code. 2006-06-11 00:37:31 +00:00
Miciah Dashiel Butler Masters
1a3b718f98 SMJS: bookmark_folder_get_property: Reflow some code.
Set the return value to JSVAL_NULL up front instead of in every error
handling block.
2006-06-11 00:33:19 +00:00
Miciah Dashiel Butler Masters
ec1ab9fbe9 SMJS: Better handle when the C code tries to call a badly defined method
Before, when one assigned a value other than a function to
elinks.preformat_html, elinks.goto_url_hook, or elinks.follow_url_hook,
an assertion failure was triggered (and probably worse happened in
non-DEBUG builds). Now just fail silently.
2006-06-10 18:11:37 +00:00
Miciah Dashiel Butler Masters
355cbebaad SMJS: Add elinks.vs
E.g., elinks.vs.plain = 0; elinks.action.rerender(); forces ELinks to
rerender the current document as HTML.
2006-06-10 18:11:37 +00:00
Miciah Dashiel Butler Masters
1df39d5068 SMJS: Add elinks.action
E.g., elinks.action.link_follow(20) follows the twentieth link.
The argument is optional.
2006-06-10 18:11:37 +00:00
Laurent MONIN
b6e6ac96a3 ftp_process_dirlist(): re-introduce else { ERROR() } part, just drop
#ifdef/#endif.
2006-06-10 01:28:35 +02:00
Laurent MONIN
de2264f712 ftp_process_dirlist(): minor test optiization. 2006-06-10 01:12:38 +02:00
Laurent MONIN
6960fc8feb ftp_process_dirlist(): drop stale debug code, spotted by Miciah. 2006-06-10 00:58:50 +02:00
Miciah Dashiel Butler Masters
14595404d1 ftp_process_dirlist: Rename local variable bufp to line_length. 2006-06-09 21:46:47 +00:00
Miciah Dashiel Butler Masters
71ec83c0de ftp_get_line: Reflow some code. 2006-06-09 21:43:36 +00:00
Miciah Dashiel Butler Masters
2d49225db3 ftp_get_line: Reflow some code. 2006-06-09 21:43:18 +00:00
Miciah Dashiel Butler Masters
e1ea1cf2bb ftp_get_line: Don't update *@len if returning -1. 2006-06-09 21:42:16 +00:00
Miciah Dashiel Butler Masters
ea5b06c329 ftp_process_dirlist: Drop a silly comment. 2006-06-09 21:39:51 +00:00
Miciah Dashiel Butler Masters
4122a97a03 Factor ftp_get_line out of ftp_process_dirlist.
Per Quiznos's suggestion.
2006-06-09 21:38:06 +00:00
Miciah Dashiel Butler Masters
585f7c5f2b ftp_process_dirlist: check for bufl == 0 earlier. 2006-06-09 20:17:57 +00:00
Miciah Dashiel Butler Masters
dafc209c61 Simplify ftp_process_dirlist via memchr. 2006-06-09 20:16:35 +00:00
Miciah Dashiel Butler Masters
8c3d7a8e72 Fix data: protocol
Increment conn->from by the length of the data so that when
abort_connection calls normalize_cache_entry, it doesn't truncate the
cache entry to 0 length.
2006-06-08 17:42:27 +00:00
Jonas Fonseca
a72a0dab08 Fix assertion failure in the charset menu related to special codepages
If the codepage option was set to utf-8 (a special codepage) it would
end up being out of range when used for the initialy selected menu item.
2006-06-07 17:35:03 +02: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
Laurent MONIN
ef37161070 distribute_rows_or_cols(): merge two loops. 2006-06-06 23:10:29 +02:00
Laurent MONIN
824b4374fa distribute_rows_or_cols(): simplify code. 2006-06-06 23:09:19 +02:00
Jonas Fonseca
7a42d2f41d Clean out some unused variables 2006-06-06 16:33:16 +02:00
Jonas Fonseca
4433438f92 SMJS: Add execute method to the elinks object
It is similar to lua's execute and let's you run a command line in
'non-blocking' mode. Example:

	elinks.keymaps.main["F"] = function () {
		elinks.execute("firefox " + elinks.location);
	};
2006-06-06 16:30:24 +02:00
Jonas Fonseca
9f3456c872 Add support for parsing space separated CSS class attribute values
Sequentially apply style for stuff like class="class1 class2".
2006-06-06 15:21:56 +02:00
Miciah Dashiel Butler Masters
fde874ad35 Remove a useless comment
The comment was added in commit 0a44083e7b63cf51c7347a289c6d953cb7c15bcd.
2006-06-06 05:18:40 +00:00
Miciah Dashiel Butler Masters
819ea129af Bookmarks: Avoid a dangling pointer on malloc failure
In memorize_last_searched_bookmark, when malloc of bm_last_searched_url
fails, set bm_last_searched_title to NULL after freeing it.
2006-06-06 05:18:39 +00:00
Miciah Dashiel Butler Masters
9d6ec1ee59 Remove a superfluous check.
This thoroughly ridiculous check was added in commit
bfa309e192caf6f1dd1f1bc112490b2f3dad1ebb.
2006-06-06 05:18:39 +00:00
Miciah Dashiel Butler Masters
d3bc3eb7e9 Drop an unnecessary prototype (it is in the header file). 2006-06-06 05:18:38 +00:00
Miciah Dashiel Butler Masters
1a3c8734d4 Utilise mem_free_set. 2006-06-06 05:18:38 +00:00
Miciah Dashiel Butler Masters
551ff4587a Drop a stale comment.
The return value to delete_bookmark was changed to void in commit
7f47389e41a1bd2d9a0e05b74df49c26cd8e155a.
2006-06-06 02:43:00 +00:00
Miciah Dashiel Butler Masters
938d9c860b Drop an unnecessary prototype (it is in the header file). 2006-06-06 02:41:09 +00:00
Jonas Fonseca
0c2ce62459 When prompting a program for copiousoutput don't show the block checkbox
Since (I hope) it has no effect. Instead, inform the user that the output will
be displayed in the current tab.
2006-06-06 01:32:03 +02:00
Jonas Fonseca
ae58ab8fd7 Fix to the new internal copiousoutput handling 2006-06-06 01:15:07 +02:00
Kalle Olavi Niemitalo
ab23505519 cookies: New function init_cookie has a monopoly.
All cookies are now constructed with the new function init_cookie.
Requested by Miciah Dashiel Butler Masters.

This also fixes a bug where the "Add cookie" button left cookie->path == NULL,
causing a crash later when deciding whether to send the cookie to the server.
2006-06-05 20:22:55 +00:00
Kalle Olavi Niemitalo
e8233fa06a cookies: Use strrchr instead of ad-hoc loop.
The size and speed of the object code probably don't change much,
but the source becomes easier to read.
2006-06-05 20:22:54 +00:00