Change prefix of widget options: W_ -> WOP_.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2016-04-10 10:31:42 +03:00
parent 619480c68b
commit 4a0cd948df
11 changed files with 53 additions and 53 deletions

View File

@ -247,7 +247,7 @@ do_select_widget (WDialog * h, GList * w, select_dir_t dir)
break;
}
}
while (h->current != w /* && (WIDGET (h->current->data)->options & W_DISABLED) == 0 */ );
while (h->current != w /* && (WIDGET (h->current->data)->options & WOP_DISABLED) == 0 */ );
if (widget_overlapped (w0, WIDGET (h->current->data)))
{
@ -405,7 +405,7 @@ dlg_mouse_event (WDialog * h, Gpm_Event * event)
{
Widget *w = WIDGET (p->data);
if ((w->options & W_DISABLED) == 0 && w->mouse_callback != NULL)
if ((w->options & WOP_DISABLED) == 0 && w->mouse_callback != NULL)
{
/* put global cursor position to the widget */
int ret;
@ -445,10 +445,10 @@ dlg_try_hotkey (WDialog * h, int d_key)
current = WIDGET (h->current->data);
if ((current->options & W_DISABLED) != 0)
if ((current->options & WOP_DISABLED) != 0)
return MSG_NOT_HANDLED;
if (current->options & W_IS_INPUT)
if ((current->options & WOP_IS_INPUT) != 0)
{
/* skip ascii control characters, anything else can valid character in
* some encoding */
@ -462,7 +462,7 @@ dlg_try_hotkey (WDialog * h, int d_key)
d_key = g_ascii_tolower (c);
handled = MSG_NOT_HANDLED;
if ((current->options & W_WANT_HOTKEY) != 0)
if ((current->options & WOP_WANT_HOTKEY) != 0)
handled = send_message (current, NULL, MSG_HOTKEY, d_key, NULL);
/* If not used, send hotkey to other widgets */
@ -476,7 +476,7 @@ dlg_try_hotkey (WDialog * h, int d_key)
{
current = WIDGET (hot_cur->data);
if ((current->options & W_WANT_HOTKEY) != 0 && (current->options & W_DISABLED) == 0)
if ((current->options & WOP_WANT_HOTKEY) != 0 && (current->options & WOP_DISABLED) == 0)
handled = send_message (current, NULL, MSG_HOTKEY, d_key, NULL);
if (handled == MSG_NOT_HANDLED)
@ -569,7 +569,7 @@ frontend_dlg_run (WDialog * h)
if (idle_hook)
execute_hooks (idle_hook);
while ((WIDGET (h)->options & W_WANT_IDLE) != 0 && is_idle ())
while ((WIDGET (h)->options & WOP_WANT_IDLE) != 0 && is_idle ())
send_message (h, NULL, MSG_IDLE, 0, NULL);
/* Allow terminating the dialog from the idle handler */
@ -790,7 +790,7 @@ dlg_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
return MSG_NOT_HANDLED;
case MSG_IDLE:
dlg_broadcast_msg_to (h, MSG_IDLE, FALSE, W_WANT_IDLE);
dlg_broadcast_msg_to (h, MSG_IDLE, FALSE, WOP_WANT_IDLE);
return MSG_HANDLED;
case MSG_RESIZE:
@ -1048,7 +1048,7 @@ dlg_focus (WDialog * h)
{
Widget *current = WIDGET (h->current->data);
if (((current->options & W_DISABLED) == 0)
if (((current->options & WOP_DISABLED) == 0)
&& (send_message (current, NULL, MSG_FOCUS, 0, NULL) == MSG_HANDLED))
{
send_message (h, current, MSG_FOCUS, 0, NULL);
@ -1166,7 +1166,7 @@ update_cursor (WDialog * h)
w = WIDGET (p->data);
if (((w->options & W_DISABLED) == 0) && ((w->options & W_WANT_CURSOR) != 0))
if (((w->options & WOP_DISABLED) == 0) && ((w->options & WOP_WANT_CURSOR) != 0))
send_message (w, NULL, MSG_CURSOR, 0, NULL);
else
do
@ -1177,7 +1177,7 @@ update_cursor (WDialog * h)
w = WIDGET (p->data);
if (((w->options & W_DISABLED) == 0) && ((w->options & W_WANT_CURSOR) != 0))
if (((w->options & WOP_DISABLED) == 0) && ((w->options & WOP_WANT_CURSOR) != 0))
if (send_message (w, NULL, MSG_CURSOR, 0, NULL) == MSG_HANDLED)
break;
}

View File

@ -71,7 +71,7 @@ groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
gboolean disabled;
disabled = (w->options & W_DISABLED) != 0;
disabled = (w->options & WOP_DISABLED) != 0;
tty_setcolor (disabled ? DISABLED_COLOR : h->color[DLG_COLOR_NORMAL]);
tty_draw_box (w->y, w->x, w->lines, w->cols, TRUE);

View File

@ -103,7 +103,7 @@ static void
draw_history_button (WInput * in)
{
char c;
gboolean disabled = (WIDGET (in)->options & W_DISABLED) != 0;
gboolean disabled = (WIDGET (in)->options & WOP_DISABLED) != 0;
if (g_list_next (in->history.current) == NULL)
c = '^';
@ -1010,7 +1010,7 @@ input_new (int y, int x, const int *colors, int width, const char *def_text,
in = g_new (WInput, 1);
w = WIDGET (in);
widget_init (w, y, x, 1, width, input_callback, input_mouse_callback);
w->options |= W_IS_INPUT;
w->options |= WOP_IS_INPUT;
w->set_options = input_set_options;
in->color = colors;
@ -1295,7 +1295,7 @@ input_update (WInput * in, gboolean clear_first)
if (has_history != 0)
draw_history_button (in);
if ((w->options & W_DISABLED) != 0)
if ((w->options & WOP_DISABLED) != 0)
tty_setcolor (DISABLED_COLOR);
else if (in->first)
tty_setcolor (in->color[WINPUTC_UNCHANGED]);

View File

@ -81,7 +81,7 @@ label_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
if (l->text == NULL)
return MSG_HANDLED;
disabled = (w->options & W_DISABLED) != 0;
disabled = (w->options & WOP_DISABLED) != 0;
if (l->transparent)
tty_setcolor (disabled ? DISABLED_COLOR : DEFAULT_COLOR);

View File

@ -132,7 +132,7 @@ listbox_draw (WListbox * l, gboolean focused)
{
Widget *w = WIDGET (l);
const WDialog *h = w->owner;
const gboolean disabled = (w->options & W_DISABLED) != 0;
const gboolean disabled = (w->options & WOP_DISABLED) != 0;
const int normalc = disabled ? DISABLED_COLOR : h->color[DLG_COLOR_NORMAL];
/* *INDENT-OFF* */
int selc = disabled

View File

@ -12,7 +12,7 @@
#define QUICK_CHECKBOX(txt, st, id_) \
{ \
.widget_type = quick_checkbox, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = id_, \
.u = { \
@ -26,7 +26,7 @@
#define QUICK_BUTTON(txt, act, cb, id_) \
{ \
.widget_type = quick_button, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = id_, \
.u = { \
@ -41,7 +41,7 @@
#define QUICK_INPUT(txt, hname, res, id_, is_passwd_, strip_passwd_, completion_flags_) \
{ \
.widget_type = quick_input, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = id_, \
.u = { \
@ -62,7 +62,7 @@
#define QUICK_LABELED_INPUT(label_, label_loc, txt, hname, res, id_, is_passwd_, strip_passwd_, completion_flags_) \
{ \
.widget_type = quick_input, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = id_, \
.u = { \
@ -83,7 +83,7 @@
#define QUICK_LABEL(txt, id_) \
{ \
.widget_type = quick_label, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = id_, \
.u = { \
@ -97,7 +97,7 @@
#define QUICK_RADIO(cnt, items_, val, id_) \
{ \
.widget_type = quick_radio, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = id_, \
.u = { \
@ -112,7 +112,7 @@
#define QUICK_START_GROUPBOX(t) \
{ \
.widget_type = quick_start_groupbox, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -125,7 +125,7 @@
#define QUICK_STOP_GROUPBOX \
{ \
.widget_type = quick_stop_groupbox, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -140,7 +140,7 @@
#define QUICK_SEPARATOR(line_) \
{ \
.widget_type = quick_separator, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -154,7 +154,7 @@
#define QUICK_START_COLUMNS \
{ \
.widget_type = quick_start_columns, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -169,7 +169,7 @@
#define QUICK_NEXT_COLUMN \
{ \
.widget_type = quick_next_column, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -184,7 +184,7 @@
#define QUICK_STOP_COLUMNS \
{ \
.widget_type = quick_stop_columns, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -199,7 +199,7 @@
#define QUICK_START_BUTTONS(space_, line_) \
{ \
.widget_type = quick_buttons, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \
@ -218,7 +218,7 @@
#define QUICK_END \
{ \
.widget_type = quick_end, \
.options = W_DEFAULT, \
.options = WOP_DEFAULT, \
.pos_flags = WPOS_KEEP_DEFAULT, \
.id = NULL, \
.u = { \

View File

@ -155,7 +155,7 @@ widget_init (Widget * w, int y, int x, int lines, int cols,
w->mouse.last_buttons_down = 0;
/* Almost all widgets want to put the cursor in a suitable place */
w->options = W_WANT_CURSOR;
w->options = WOP_WANT_CURSOR;
}
/* --------------------------------------------------------------------------------------------- */
@ -202,7 +202,7 @@ widget_default_set_options (Widget * w, widget_options_t options, gboolean enabl
else
w->options &= ~options;
if (w->owner != NULL && (options & W_DISABLED) != 0)
if (w->owner != NULL && (options & WOP_DISABLED) != 0)
send_message (w, NULL, MSG_DRAW, 0, NULL);
}
@ -241,7 +241,7 @@ widget_selectcolor (Widget * w, gboolean focused, gboolean hotkey)
WDialog *h = w->owner;
int color;
if ((w->options & W_DISABLED) != 0)
if ((w->options & WOP_DISABLED) != 0)
color = DISABLED_COLOR;
else if (hotkey)
{

View File

@ -16,10 +16,10 @@
#define widget_move(w, _y, _x) tty_gotoyx (CONST_WIDGET(w)->y + (_y), CONST_WIDGET(w)->x + (_x))
/* Sets/clear the specified flag in the options field */
#define widget_want_cursor(w,i) widget_set_options(w, W_WANT_CURSOR, i)
#define widget_want_hotkey(w,i) widget_set_options(w, W_WANT_HOTKEY, i)
#define widget_want_idle(w,i) widget_set_options(w, W_WANT_IDLE, i)
#define widget_disable(w,i) widget_set_options(w, W_DISABLED, i)
#define widget_want_cursor(w,i) widget_set_options(w, WOP_WANT_CURSOR, i)
#define widget_want_hotkey(w,i) widget_set_options(w, WOP_WANT_HOTKEY, i)
#define widget_want_idle(w,i) widget_set_options(w, WOP_WANT_IDLE, i)
#define widget_disable(w,i) widget_set_options(w, WOP_DISABLED, i)
/*** enums ***************************************************************************************/
@ -62,12 +62,12 @@ typedef enum
/* Widget options */
typedef enum
{
W_DEFAULT = (0 << 0),
W_WANT_HOTKEY = (1 << 1),
W_WANT_CURSOR = (1 << 2),
W_WANT_IDLE = (1 << 3),
W_IS_INPUT = (1 << 4),
W_DISABLED = (1 << 5) /* Widget cannot be selected */
WOP_DEFAULT = (0 << 0),
WOP_WANT_HOTKEY = (1 << 1),
WOP_WANT_CURSOR = (1 << 2),
WOP_WANT_IDLE = (1 << 3),
WOP_IS_INPUT = (1 << 4),
WOP_DISABLED = (1 << 5) /* Widget cannot be selected */
} widget_options_t;
/* Flags for widget repositioning on dialog resize */

View File

@ -538,15 +538,15 @@ configure_box (void)
g_snprintf (time_out, sizeof (time_out), "%d", old_esc_mode_timeout);
#ifndef USE_INTERNAL_EDIT
quick_widgets[17].options = W_DISABLED;
quick_widgets[17].options = WOP_DISABLED;
#endif
if (!old_esc_mode)
quick_widgets[10].options = quick_widgets[11].options = W_DISABLED;
quick_widgets[10].options = quick_widgets[11].options = WOP_DISABLED;
#ifndef HAVE_POSIX_FALLOCATE
mc_global.vfs.preallocate_space = FALSE;
quick_widgets[7].options = W_DISABLED;
quick_widgets[7].options = WOP_DISABLED;
#endif
if (quick_dialog (&qdlg) == B_ENTER)
@ -761,13 +761,13 @@ panel_listing_box (WPanel * panel, int num, char **userp, char **minip, int *use
g_snprintf (panel_brief_cols_in, sizeof (panel_brief_cols_in), "%d", panel->brief_cols);
if ((int) panel->list_type != panel_listing_brief_idx)
quick_widgets[4].options = W_DISABLED;
quick_widgets[4].options = WOP_DISABLED;
if ((int) panel->list_type != panel_listing_user_idx)
quick_widgets[6].options = W_DISABLED;
quick_widgets[6].options = WOP_DISABLED;
if (!mini_user_status)
quick_widgets[9].options = W_DISABLED;
quick_widgets[9].options = WOP_DISABLED;
if (quick_dialog (&qdlg) == B_CANCEL)
result = -1;
@ -1109,7 +1109,7 @@ configure_vfs (void)
#ifdef ENABLE_VFS_FTP
if (!ftpfs_always_use_proxy)
quick_widgets[5].options = W_DISABLED;
quick_widgets[5].options = WOP_DISABLED;
#endif
if (quick_dialog (&qdlg) != B_CANCEL)

View File

@ -955,7 +955,7 @@ check_find_events (WDialog * h)
/* dialog terminated */
return FIND_ABORT;
}
if ((WIDGET (h)->options & W_WANT_IDLE) == 0)
if ((WIDGET (h)->options & WOP_WANT_IDLE) == 0)
{
/* searching suspended */
return FIND_SUSPEND;

View File

@ -538,7 +538,7 @@ init_layout (void)
/* "Console output" groupbox */
{
const int disabled = mc_global.tty.console_flag != '\0' ? 0 : W_DISABLED;
const int disabled = mc_global.tty.console_flag != '\0' ? 0 : WOP_DISABLED;
Widget *w;
w = WIDGET (groupbox_new (8, 3, 3, l1, title2));