1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00
Commit Graph

205 Commits

Author SHA1 Message Date
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