1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-27 02:56:18 -04:00
Commit Graph

292 Commits

Author SHA1 Message Date
Witold Filipczyk
407ca7d114 [colors] Implemented displaying for 256 color mode 2022-03-18 16:24:48 +01:00
Witold Filipczyk
4b93f841a8 [bfu] draw_*_node 2022-03-17 19:11:13 +01:00
Witold Filipczyk
c7fbc44417 [leds] Call node version of functions
Code for correct colors not added yet.
2022-03-12 19:00:23 +01:00
Witold Filipczyk
aab01cfae1 [bfu] Added get_bfu_color_node 2022-03-10 18:27:37 +01:00
Witold Filipczyk
095aac5753 [bfu] style.c seems to be better place for node_number 2022-03-09 19:53:56 +01:00
Witold Filipczyk
2c2cf97e03 [options] No need for C_ macro in INIT_OPT_* 2022-03-02 19:02:47 +01:00
Witold Filipczyk
e432fc8c91 [bfu] cast in call of add_dlg_button 2022-02-21 16:03:31 +01:00
Witold Filipczyk
3b57ebd352 [bfu] cast in call of refresh_dialog 2022-02-21 15:54:02 +01:00
Witold Filipczyk
c4aff169e9 [bfu] const in menu_labels 2022-02-18 15:04:46 +01:00
Witold Filipczyk
647e00f950 [intl] const language_to_iso639 2022-02-17 21:02:27 +01:00
Witold Filipczyk
6575f71dd4 [bfu] const in load_input_history and save_input_history 2022-02-11 19:57:36 +01:00
Witold Filipczyk
b9701abffb [bfu] const in add_to_menu 2022-02-10 19:57:33 +01:00
Witold Filipczyk
5ea99371dd [bfu] const 2022-01-31 16:41:29 +01:00
Witold Filipczyk
b982bd9abf [draw] const char * in draw_text 2022-01-31 16:18:43 +01:00
Witold Filipczyk
dc3ba3ef3b [bfu] const in input_dialog 2022-01-30 18:21:52 +01:00
Witold Filipczyk
ef24855aa7 [bfu] msgbox_flags_T 2022-01-28 16:41:23 +01:00
Witold Filipczyk
349a27238f [align] enum format_align -> format_align_T 2022-01-28 16:05:35 +01:00
Witold Filipczyk
cd49b315d9 [action] enum main_action -> main_action_T 2022-01-28 15:26:43 +01:00
Witold Filipczyk
199f1c60ff [draw] enum screen_char_attr -> screen_char_attr_T 2022-01-28 14:47:36 +01:00
Witold Filipczyk
d839efc9f4 [color] enum color_mode -> color_mode_T 2022-01-28 14:42:48 +01:00
Witold Filipczyk
3f29dada0a [bfu] enum menu_item_flags -> menu_item_flags_T 2022-01-28 14:35:18 +01:00
Witold Filipczyk
e57bae65d3 [draw] enum border_char -> border_char_T 2022-01-28 14:30:01 +01:00
Witold Filipczyk
ee6e9caa6a [kbd] enum keymap_id -> keymap_id_T 2022-01-28 14:20:06 +01:00
Witold Filipczyk
f706afe8d0 [bfu] enum menu_action -> action_id_T 2022-01-28 14:05:46 +01:00
Witold Filipczyk
3d1ea9ea24 [msgbox] enum msgbox_flags -> unsigned int 2022-01-26 18:27:11 +01:00
Witold Filipczyk
e4550c1562 [bfu] cast 2022-01-24 21:53:18 +01:00
Witold Filipczyk
d889484ca4 Revert "[button] No warnings related to char *"
This reverts commit 6602557d0e.
2022-01-22 15:04:36 +01:00
Witold Filipczyk
6602557d0e [button] No warnings related to char * 2022-01-21 20:31:40 +01:00
Witold Filipczyk
2f51c30d70 [bfu] const char * in get_bfu_color 2022-01-21 20:29:30 +01:00
Witold Filipczyk
2fa67c5730 [char] Introduced macro C_
C_("aaaa") -> (char *)("aaaa")
2022-01-19 22:49:13 +01:00
Witold Filipczyk
53a860a3d6 [strchr] casting first parameter to const char * was not a good idea 2022-01-18 20:30:48 +01:00
Witold Filipczyk
23f1a7cdce [mem_align_alloc] cast 2022-01-17 15:54:50 +01:00
Witold Filipczyk
881f896e85 [mem_calloc] Cast 2022-01-16 21:08:50 +01:00
Witold Filipczyk
be8a030fa7 [mem_realloc] cast return value 2022-01-16 19:38:30 +01:00
Witold Filipczyk
20c161559c [mem_alloc] cast return value 2022-01-16 19:09:27 +01:00
Witold Filipczyk
b434b11309 [options] 0 (option_flags) -> OPT_ZERO 2022-01-15 20:10:37 +01:00
Witold Filipczyk
2da72b11c0 [leds] Check for NULL 2022-01-04 16:30:23 +01:00
Witold Filipczyk
ccb75758b4 [dialogs] Make 9 / 10 ratio configurable at compile time.
DIALOG_WIDTH_RATIO and DIALOG_HEIGHT_RATIO in src/setup.h
2021-08-23 16:11:17 +02:00
Witold Filipczyk
66305fcb50 [gettext] try system gettext. Refs #62
Now, only meson was changed.
-Dnls=true -Dgettext=true
2021-08-08 21:25:08 +02:00
Witold Filipczyk
435edde218 [status] Show temperature of CPU.
Optional, it works on my machine.
2021-07-04 16:32:16 +02:00
Witold Filipczyk
d55ea80fe6 [select] Modifications related to select. test/select.html still broken 2021-06-29 21:58:04 +02:00
Witold Filipczyk
36aa04ed12 [time.h] time.h can be included unconditionally 2021-03-19 14:22:04 +01:00
Witold Filipczyk
4b5c9a4e21 [msgbox] const char * 2021-03-03 14:38:11 +01:00
Witold Filipczyk
0fea79cc8f [cflags] Removed -Wno-pointer-sign
Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
2021-01-02 16:20:27 +01:00
Witold Filipczyk
1f57e72212 [mozjs24] Allow build elinks with g++
SpiderMonkey was updated to mozjs24. If you want to build elinks
with ecmascript support, you must compile using g++ with -fpermissive .
There is a lot of warnings.
There are some memleaks in ecmascript code, especially related to JSAutoCompartment.
I don't know yet, where and how to free it.

Debian does not support mozjs24, so I'm going to gradually update SpiderMonkey version.
2020-10-05 20:14:55 +02:00
Witold Filipczyk
5f87bdbcb2 [meson] meson build scripts.
Not finished yet, but I added to motivate myself and others.
The goal is to get a few seconds faster builds.

autotools still will be available.
2020-09-05 22:06:01 +02:00
Witold Filipczyk
d8de9ac7e5 [gcc] pragma outside function body 2019-12-06 20:13:38 +01:00
Witold Filipczyk
0724c3c49d [gcc] Silent gcc. I guess code was ok. 2019-11-15 16:27:16 +01:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Witold Filipczyk
d8be2c505e Rename struct box to struct el_box.
In the future I want to copy some code from netsurf, so I'm preparing.
2018-09-09 19:14:56 +02:00
Felix Janda
e739ed07dc Fix broken double-width chars when displaying status leds 2017-12-28 15:36:03 +01:00
Felix Janda
336e596a83 Rename VA_COPY to va_copy
With this, the C99 standard macro va_copy is used when available
instead of the prestandard __va_copy.
2017-11-23 19:18:20 -05:00
Witold Filipczyk
1b06539694 Explicit cast to (const char *) in strcasestr for C++ 2016-04-20 20:11:08 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
8cf00fa61c delete -> delete_ for C++ compatibility 2016-04-20 18:57:32 +02:00
Witold Filipczyk
3688bb9c61 auto-completion reads not only the first character, but also the next ones.
This behaviour is similar to other browsers.
2015-05-12 16:12:56 +02:00
Witold Filipczyk
c84dfd7e18 mem_free_if where aplicable. Initialised memory in encoding/* 2015-05-10 17:27:55 +02:00
witekfl
767a1c4228 bug 1126: use draw_text for titles
I didn't check big dialog boxes.
2012-11-19 14:24:34 +01:00
Kalle Olavi Niemitalo
8b00e1ef70 bug 764: Initialize the right member of union option_value
INIT_OPTION used to initialize union option_value at compile time by
casting the default value to LIST_OF(struct option) *, which is the
type of the first member.  On sparc64 and other big-endian systems
where sizeof(int) < sizeof(struct list_head *), this tended to leave
option->value.number as zero, thus messing up OPT_INT and OPT_BOOL
at least.  OPT_LONG however tended to work right.

This would be easy to fix with C99 designated initializers,
but doc/hacking.txt says ELinks must be kept C89 compatible.
Another solution would be to make register_options() read the
value from option->value.tree (the first member), cast it back
to the right type, and write it to the appropriate member;
but that would still require somewhat dubious conversions
between integers, data pointers, and function pointers.

So here's a rather more invasive solution.  Add struct option_init,
which is somewhat similar to struct option but has non-overlapping
members for different types of values, to ensure nothing is lost
in compile-time conversions.  Move unsigned char *path from struct
option_info to struct option_init, and replace struct option_info
with a union that contains struct option_init and struct option.
Now, this union can be initialized with no portability problems,
and register_options() then moves the values from struct option_init
to their final places in struct option.

In my x86 ELinks build with plenty of options configured in, this
change bloated the text section by 340 bytes but compressed the data
section by 2784 bytes, presumably because union option_info is a
pointer smaller than struct option_info was.
(cherry picked from elinks-0.12 commit e5f6592ee2)

Conflicts:
	src/protocol/fsp/fsp.c: All options had been removed in 0.13.GIT.
	src/protocol/smb/smb2.c: Ditto.
2012-11-03 22:16:32 +02:00
Kalle Olavi Niemitalo
ad9c144e5c BFU: Add comments in enum widget_type
I was trying to check which charset WIDGET_TEXT uses in the buffer but
had difficulty finding the code that handles key presses and updates
the buffer.  These comments should make that easier in the future.
2011-05-09 23:28:12 +03:00
Kalle Olavi Niemitalo
dd608c500b BFU: Document additional data in struct dialog 2011-05-09 23:28:12 +03:00
Witold Filipczyk
0ec2f8eaa8 Show IP of the document in the status bar.
config options:
ui.show_ip (0/1) default 0
status.showip-text - colors
2010-03-30 14:45:19 +02:00
Kalle Olavi Niemitalo
ef548e5728 Merge branch 'elinks-0.12'
Conflicts:
	src/session/download.c
	src/session/download.h
	src/viewer/text/view.c
2009-07-24 18:32:25 +03:00
Kalle Olavi Niemitalo
62316163f3 Comment fixes 2009-07-18 23:31:10 +03:00
Kalle Olavi Niemitalo
a92bdcf02d Document add_dlg_button, add_dlg_ok_button 2009-07-18 19:51:01 +03:00
Miciah Dashiel Butler Masters
30a8d2faed Fix compilation error in src/bfu/listbox.c
Fix a silly error introduced by me in commit
66e1baec77.
2009-05-22 21:48:10 +00:00
Miciah Dashiel Butler Masters
8d8ff02bbf Fix behaviour for search-toggle-regex
text_typeahead_handler: Document that passing -2 for action_id will cause
a search without error reporting.  This behaviour is unintentionally the
current behaviour of text_typeahead_handler, but now it is documented so
that it can be used.

input_line_event_handler: When rewinding, pass -2 for the action_id
parameter to the handler instead of passing again whatever action led to
the rewinding.

The old behavior of input_line_event_handler was particularly problematic
with the search-toggle-regex action and the text_typeahead_handler handler:
input_line_event_handler would call the handler with
ACT_EDIT_SEARCH_TOGGLE_REGEX, and the handler would toggle the setting and
perform the search again; then if the search string no longer matched
anything, the handler would return INPUT_LINE_REWIND to
input_line_event_handler, which would rewind and call the handler with
ACT_EDIT_SEARCH_TOGGLE_REGEX again, thus toggling the option back to the
original setting.

With the new behaviour, input_line_event_handler will not repeat the same
action when re-invoking the handler; in the above example with
search-toggle-regex, the search string will simply be rewound until it
matches with the new setting.
2009-05-22 20:15:52 +00:00
Miciah Dashiel Butler Masters
76de375d3d Do not redraw listbox when deleting invisible item
In done_listbox_item, do not call update_hierbox_browser if the item
that is being deleted was not visible.
2009-05-22 19:58:41 +00:00
Miciah Dashiel Butler Masters
66e1baec77 Fix hierbox line characters WRT item visibility
Hierarchical listboxes draw items with upper-left corner, lower-left
corner, or horizontal border characters to indicate whether a given item is
the first item in a listbox, the last, or any other, respectively.
However, the wrong character can be drawn if there are invisible items: if
an item is the first (or last) visible item but there is an invisible item
before (or after) it, it will be drawn with a horizontal border character,
not a corner.

This patch fixes that problem using traverse_listbox_items_list in
display_listbox_item to ignore invisible items when determining whether
an item is either the first or the last among its siblings.
2009-05-22 19:53:45 +00:00
Miciah Dashiel Butler Masters
f1dee0d04f Drop special handling of ctrl-l
Drop special handling of ctrl-l in handle_interlink_event.

To make sure that the 'redraw' action works everywhere, first modify
menu_kbd_handler and mainmenu_kbd_handler to handle ACT_MENU_REDRAW; and
second, drop the ACTION_REQUIRE_VIEW_STATE flag from the 'redraw' action in
the 'main' keymap so that it works even if there is no document loaded.

Ctrl-l is already bound to 'redraw' in all keymaps by default, so the
current default behaviour is preserved.
2009-05-22 19:50:28 +00:00
Kalle Olavi Niemitalo
35acde4a10 big dialogs: fix unused term in dlg_format_text_do
Fix this error when configured with --enable-debug --disable-utf-8:

      [CC]   src/bfu/text.o
cc1: warnings being treated as errors
/home/Kalle/src/elinks-0.13/src/bfu/text.c: In function ‘dlg_format_text_do’:
/home/Kalle/src/elinks-0.13/src/bfu/text.c:220: error: unused variable ‘term’
2009-04-26 17:07:02 +03:00
Kalle Olavi Niemitalo
fe8cd7d7ba big dialogs: fix unused term in dlg_format_buttons
Fix this error when configured with --enable-debug --disable-utf-8:

      [CC]   src/bfu/button.o
cc1: warnings being treated as errors
/home/Kalle/src/elinks-0.13/src/bfu/button.c: In function ‘dlg_format_buttons’:
/home/Kalle/src/elinks-0.13/src/bfu/button.c:122: error: unused variable ‘term’
2009-04-26 17:07:02 +03:00
Kalle Olavi Niemitalo
1bb71f3732 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/config/conf.c
	src/network/ssl/ssl.c
2009-03-12 08:46:02 +02:00
Kalle Olavi Niemitalo
5a43c55c9e Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line.  When the option manager displayed these
strings, it treated each "\n" as a hard newline.  On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones.  This could also cause the text to take up too much
vertical space and not fit in the window.

Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping.  At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.

In some options though, there is a list of possible values and their
meanings.  In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented.  The
option manager and BFU are not currently able to do that.  So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-08 15:18:10 +02:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bfu/dialog.c
	src/bfu/hotkey.c
	src/bfu/inpfield.c
	src/dialogs/options.c
	src/document/renderer.c
	src/intl/gettext/libintl.h
	src/protocol/http/codes.c
	src/session/task.c
	src/terminal/event.c
	src/terminal/terminal.h
	src/viewer/text/form.c
	src/viewer/text/link.c

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
ad45176dde Add get_terminal_codepage().
This simplifies the callers a little and may help implement
simultaneous support for different charsets on different terminals
of the same type (bug 1064).
2009-01-01 16:16:17 +00:00
Kalle Olavi Niemitalo
8010b3371b big dialogs: redraw the dialog when scrolling
Merge functions:
redraw_from_window(win) => redraw_windows(REDRAW_IN_FRONT_OF_WINDOW, win)
redraw_below_window(win) => redraw_windows(REDRAW_BEHIND_WINDOW, win)
Add REDRAW_WINDOW_AND_FRONT as a third possibility.
Then use that in update_hierbox_browser(), which previously used
window.next for this purpose, and in dialog-scrolling code,
which previously did not redraw the dialog box itself.
2008-10-12 14:01:05 +03:00
Kalle Olavi Niemitalo
2db33a0c53 big dialogs: document part of struct dialog_data 2008-10-12 13:03:01 +03:00
Kalle Olavi Niemitalo
4f41ce00b4 big dialogs: draw_dlg_text: no need to pass the term.
Instead, make draw_dlg_text read dlg_data->win->term.
2008-10-11 23:52:09 +03:00
Witold Filipczyk
1b589beb81 big dialogs: Refactoring. do not pass the term. 2008-09-07 18:27:06 +02:00
Witold Filipczyk
ca073bf5ca big dialogs: set_curosr2 -> set_dlg_cursor. 2008-09-07 18:16:15 +02:00
Witold Filipczyk
cd35fa79fc big dialogs: dlg_format_text: no need to pass the term. 2008-09-07 18:12:42 +02:00
Witold Filipczyk
de815bb206 big dialogs: Scrolling of big dialogs, mainly that produced by the bittorent. 2008-09-07 18:02:37 +02:00
Miciah Dashiel Butler Masters
3433c9d0f6 Adjust LED update interval according to need
Add new routine compute_redraw_interval, which returns the appropriate
interval in milliseconds for updating the LED panel, namely 100ms if there
are any downloads, 1000 if the clock is enabled (with a TODO noted to check
whether the date format includes seconds), or 0 otherwise to indicate that
the LED paanel need not be updated

Use the new compute_redraw_interval routine in draw_leds and redraw_leds.

This fixes bug 973, "LED indicators wake system up every 100ms".
2008-08-02 03:34:51 +00:00
Miciah Dashiel Butler Masters
3a0286e447 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:19:23 +00:00
Miciah Dashiel Butler Masters
643a34e6af Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:09:18 +00:00
Miciah Dashiel Butler Masters
0d001a88b7 redraw_leds: Redraw the LED panel for each terminal, not each session
Since there is only one LED panel per terminal, redrawing for each session
is wasteful.

Furthermore, since one terminal can have many sessions (i.e. tabs), and
since the last session in the list might not be the current session, the
wrong LEDs might be drawn.

An easy way to demonstrate the bug is to enable ui.clock.enable, so that
the panel is redrawn every 100ms, and then to select a text field and enter
insert mode.  Unless the current tab is the last tab, the insert-mode LED
will only briefly show that insert mode is enabled.
2008-01-03 06:38:27 +00:00
Laurent MONIN
9297853d20 Fix download led among different sessions, just use are_there_downloads().
It is a partial revert of commit d14f79eb2c.
Most introduced stuff was useless.
2007-11-07 14:01:10 +01:00
Laurent MONIN
7a74edab5a Fix display of led after download abort. 2007-11-07 12:06:00 +01:00
Laurent MONIN
d14f79eb2c Indicate backgrounded downloads using an unused led.
The sixth position (the last led from the left) is used.
2007-11-07 11:24:52 +01:00
Miciah Dashiel Butler Masters
92abd48405 Drop EVENT_TEXTAREA, use EVENT_RESIZE instead
When returning from an external program, unblock_itrm_x in the slave process will send a resize event to the master process for the slave terminal.  In handle_interlink_event, when we receive this resize event, we can check whether we need to call textarea_edit.
2007-09-01 12:46:02 +00:00
Miciah Dashiel Butler Masters
1000f88748 bug 181: Allow edit textareas using an external editor on slave terminals.
Added EVENT_TEXTAREA used to notify the master terminal
about end of execution of an external program on a slave terminal.
The format of data sent to the master terminal by exec_on_slave_terminal
has changed. Now after 0, fg the value of term is sent.
Therfore this release of ELinks is incompatible with previous releases.

Patch by Witold Filipczyk, taken from his witekfl branch.

Conflicts:

	src/viewer/text/textarea.c
2007-09-01 09:00:33 +00:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Jonas Fonseca
ab5e7f116b Update hierbox comments and make them ready for Doxygen
Noticed by kon.
2007-08-08 13:18:53 +02:00
Jonas Fonseca
fd9f1f8f6d Doxify bfu/style
Also fixes an old misleading comment noticed by kon.
2007-07-31 14:39:12 +02:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +03:00
Kalle Olavi Niemitalo
45d1750d03 Bug 914: Don't let UTF-8 I/O affect internal representations.
Use it for the actual I/O only.  Previously, defining CONFIG_UTF8 and
enabling UTF-8 used to force many strings to the UTF-8 charset
regardless of the terminal charset option.  Now, those strings always
follow the terminal charset.  This fixes bug 914 which was caused
because _() returned strings in the terminal charset and functions
then assumed they were in UTF-8.  This reduction in the effects of
UTF-8 I/O may also simplify future testing.
2007-05-20 15:31:02 +03:00
Kalle Olavi Niemitalo
157124dcdb UTF-8: Whitespace changes. 2007-05-19 14:22:36 +03:00
Witold Filipczyk
988313ac9b The real fix for the bug 935.
It works for not utf-8 and the code doesn't affect the utf-8 mode.
2007-03-11 17:00:29 +02:00