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>
(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>
* (widget_destroy): new API to destroy widget.
* (group_del_widget): rename to group_remove_widget. Don't destroy
widget after remove it from group.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>