...to pass given WRect object directly to widget callback withowt
constuction/deconstuction of intermediate WRect object.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Rename to input_push_history().
Use input's buffer.
Don't duplicate an empty string, use current one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
How to reproduce:
1. Set left panel to list mode.
2. Make left panel active.
3. Change left panel to info mode.
Result: segmentation fault.
(widget_replace): fix search of the next focusable widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add two widget callbacks:
* (make_global): convert widget coordinates from local (relative to
owner) to global (screen).
* (make_local): convert widget coordinates from global (screen) to
local (relative to owner).
Such conversions are required when nested widgets and groups are added to
or removed from another groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
lib/widget/group.c: fix -Wcast-qual warnings:
group.c:199:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
^
group.c:231:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
^
group.c:263:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
^
Found by Clang-11.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...to free or not to free the string representation
of vfs_path_t object.
It allows to get rid of string duplication in following cases:
vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = g_strdup (vfs_path_as_str (vpath));
vfs_path_free (vpath);
Now we can write:
vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = vfs_path_free (vpath, FALSE);
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(group_default_callback): NULLify list of widgets after destroy.
(dlg_default_callback): do nothing in MSG_INIT and MSG_DESTROY handlers.
(dlg_destroy): send MSG_DESTORY to dialog to allow it destroy it's
private data. MSG_DESTROY is a last message sent to dialog before
desctuction.
(edit_dialog_callback): use MSG_DESTROY instead of MSG_END to deinit
editor.
(midnight_callback): use MSG_DESTROY instead of MSG_DESTORY to deinit
file manager.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Avoid limitation of file name length.
(vfs_dirent): redefined to use instead of standard "struct direct"
to hold file name of any length.
(vfs_class::readdir): return newly allocated vfs_dirent structure.
Related changes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This bug was introduced in 2e734e5618.
(dlg_handle_key): fallback to dialog_map if shortcut is not defined in
filemanager/editor/viewer/diffviewer key map.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (complete): rename to input_complete() and move declaration to
input.h.
* input_complete.h: remove.
* (input_free_completions): rename to input_complete_free() and move
definition to input_complete.c.
* lib/widget/input_complete.c: rename variables and function from
query_* to complete_*.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>