Ticket #3001: fix read and update of subshell prompt.

The bug was introduced in e35f044ccdd41922f925c99e6d50930ea8c7c47e.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(strip_ctrl_codes): type accuracy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Cleanup: remove unused 'prompt_pos' variable.

(do_subshell_chdir): remove 'reset_prompt' argument because of removed
'prompt_pos'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Merge branch '3001_subshell_prompt_fix'

* 3001_subshell_prompt_fix:
  Cleanup: remove unused 'prompt_pos' variable.
  (strip_ctrl_codes): type accuracy.
  Ticket #3001: fix read and update of subshell prompt.
Ticket #3011: mc under x11 problems with mouse or hang due gpm

mc may not detect the gpm mouse under X11 on many x terminals when running together with tmux or screen.

On some cases it can even hang.

It's a small patch to the gpm maintainer to improve its checking.
Seems there is a need also to a small change on mc.

Now everything is working perfectly.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Merge branch '3011_mc_gpm_and_xterm'

* 3011_mc_gpm_and_xterm:
  Ticket #3011: mc under x11 problems with mouse or hang due gpm
Ticket #3016: Segfault while entering into extfs archive

Current master (4.8.8-49-g6b64835) segfaults while entering into any extfs archive (zip, rar, etc).
Bad commit is 2640b21bb9700aa51a70f35f9e10732c82a7366f.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Merge branch '3016_extfs_segfault'

* 3016_extfs_segfault:
  Ticket #3016: Segfault while entering into extfs archive
Direct commit in master: fix bug with a directory deletion

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Ticket #2919: create WGroup widget.

WGroup is base widget for complex objects such as windows, dialog
windows, etc.

Initial step: use global counter to set widget ID.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_widget_active): rename to widget_is_active()

...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_replace_widget): rename to widget_replace()

...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_overlap): rename to widget_overlaped()

...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_default_repaint): make static. Use dlg_default_callback (MSG_DRAW) instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Move W_DISABLED option to new widget_state_t flags

...and rename to WIDGET_STATE_DISABLED.

  * Widget::state: new field.
  * Widget::set_state: new virtual method.
  * (widget_set_state): new function.
  * (widget_default_set_state_callback): new function.
  * (input_set_options_callback): rename to input_set_state_callback.
  * (widget_set_options): symplify.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Move W_WANT_IDLE option to widget_state_t flags

...and rename to WIDGET_STATE_IDLE.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_mouse_event): minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Create WGroup class.

Initial step: move widget list of dialog into WGroup class.
Inherit WGroup from Widget. Inherit WDialog from WGroup.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add WGroup API:

  * group_set_current_next;
  * group_set_current_prev;
  * group_get_next_of;
  * group_get_prev_of.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
WGroup API: move add/delete widgets API from dialog to group.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>