From 843dcd104e0d10cfeebf8933430aafd1b17d2abe Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 28 Sep 2012 11:18:45 +0400 Subject: [PATCH] Rename Dlg_head to WDialog. Signed-off-by: Andrew Borodin --- lib/widget.h | 4 +- lib/widget/button.c | 2 +- lib/widget/buttonbar.c | 2 +- lib/widget/buttonbar.h | 2 +- lib/widget/check.c | 2 +- lib/widget/dialog-switch.c | 30 +++++------ lib/widget/dialog-switch.h | 6 +-- lib/widget/dialog.c | 100 +++++++++++++++++------------------ lib/widget/dialog.h | 72 +++++++++++++------------ lib/widget/gauge.c | 2 +- lib/widget/history.c | 6 +-- lib/widget/hline.c | 2 +- lib/widget/input_complete.c | 4 +- lib/widget/label.c | 2 +- lib/widget/listbox-window.h | 2 +- lib/widget/listbox.c | 4 +- lib/widget/menu.c | 4 +- lib/widget/menu.h | 2 +- lib/widget/quick.c | 2 +- lib/widget/radio.c | 2 +- lib/widget/widget-common.c | 2 +- lib/widget/widget-common.h | 2 +- lib/widget/wtools.c | 22 ++++---- lib/widget/wtools.h | 4 +- src/diffviewer/ydiff.c | 14 ++--- src/editor/edit-impl.h | 24 ++++----- src/editor/editcmd.c | 20 +++---- src/editor/editcmd_dialogs.c | 8 +-- src/editor/editmenu.c | 6 +-- src/editor/editoptions.c | 2 +- src/editor/editwidget.c | 22 ++++---- src/editor/spell_dialogs.c | 2 +- src/filemanager/achown.c | 12 ++--- src/filemanager/boxes.c | 10 ++-- src/filemanager/chmod.c | 12 ++--- src/filemanager/chown.c | 10 ++-- src/filemanager/file.h | 2 +- src/filemanager/filegui.c | 4 +- src/filemanager/find.c | 18 +++---- src/filemanager/hotlist.c | 8 +-- src/filemanager/layout.c | 12 ++--- src/filemanager/listmode.c | 8 +-- src/filemanager/midnight.c | 6 +-- src/filemanager/option.c | 2 +- src/filemanager/panelize.c | 4 +- src/filemanager/tree.c | 10 ++-- src/filemanager/tree.h | 4 +- src/help.c | 18 +++---- src/learn.c | 6 +-- src/viewer/actions_cmd.c | 4 +- src/viewer/display.c | 2 +- src/viewer/internal.h | 4 +- src/viewer/lib.c | 2 +- src/viewer/mcviewer.c | 2 +- src/viewer/search.c | 4 +- 55 files changed, 273 insertions(+), 271 deletions(-) diff --git a/lib/widget.h b/lib/widget.h index 22c00c7d0..f5d4eaeb0 100644 --- a/lib/widget.h +++ b/lib/widget.h @@ -9,8 +9,8 @@ /* main forward declarations */ struct Widget; typedef struct Widget Widget; -struct Dlg_head; -typedef struct Dlg_head Dlg_head; +struct WDialog; +typedef struct WDialog WDialog; /* Please note that the first element in all the widgets is a */ /* widget variable of type Widget. We abuse this fact everywhere */ diff --git a/lib/widget/button.c b/lib/widget/button.c index 49d514e88..0bc37672d 100644 --- a/lib/widget/button.c +++ b/lib/widget/button.c @@ -60,7 +60,7 @@ button_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void * WButton *b = (WButton *) w; int stop = 0; int off = 0; - Dlg_head *h = w->owner; + WDialog *h = w->owner; switch (msg) { diff --git a/lib/widget/buttonbar.c b/lib/widget/buttonbar.c index bbfd118ab..7704f665b 100644 --- a/lib/widget/buttonbar.c +++ b/lib/widget/buttonbar.c @@ -287,7 +287,7 @@ buttonbar_set_label (WButtonBar * bb, int idx, const char *text, /* Find ButtonBar widget in the dialog */ WButtonBar * -find_buttonbar (const Dlg_head * h) +find_buttonbar (const WDialog * h) { return (WButtonBar *) find_widget_type (h, buttonbar_callback); } diff --git a/lib/widget/buttonbar.h b/lib/widget/buttonbar.h index 92416f3d5..bd1e27452 100644 --- a/lib/widget/buttonbar.h +++ b/lib/widget/buttonbar.h @@ -41,7 +41,7 @@ struct global_keymap_t; WButtonBar *buttonbar_new (gboolean visible); void buttonbar_set_label (WButtonBar * bb, int idx, const char *text, const struct global_keymap_t *keymap, const Widget * receiver); -WButtonBar *find_buttonbar (const Dlg_head * h); +WButtonBar *find_buttonbar (const WDialog * h); /*** inline functions ****************************************************************************/ diff --git a/lib/widget/check.c b/lib/widget/check.c index e3e4c991e..26576697b 100644 --- a/lib/widget/check.c +++ b/lib/widget/check.c @@ -57,7 +57,7 @@ static cb_ret_t check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WCheck *c = (WCheck *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; switch (msg) { diff --git a/lib/widget/dialog-switch.c b/lib/widget/dialog-switch.c index 4e2f31b42..dc4e41a84 100644 --- a/lib/widget/dialog-switch.c +++ b/lib/widget/dialog-switch.c @@ -43,7 +43,7 @@ /*** global variables ****************************************************************************/ -Dlg_head *midnight_dlg = NULL; +WDialog *midnight_dlg = NULL; /*** file scope macro definitions ****************************************************************/ @@ -75,7 +75,7 @@ dialog_switch_suspend (void *data, void *user_data) (void) user_data; if (data != mc_current->data) - ((Dlg_head *) data)->state = DLG_SUSPENDED; + DIALOG (data)->state = DLG_SUSPENDED; } /* --------------------------------------------------------------------------------------------- */ @@ -85,7 +85,7 @@ dialog_switch_goto (GList * dlg) { if (mc_current != dlg) { - Dlg_head *old = (Dlg_head *) mc_current->data; + WDialog *old = DIALOG (mc_current->data); mc_current = dlg; @@ -100,7 +100,7 @@ dialog_switch_goto (GList * dlg) /* switch from editor, viewer, etc to another dialog */ old->state = DLG_SUSPENDED; - if ((Dlg_head *) dlg->data != midnight_dlg) + if (DIALOG (dlg->data) != midnight_dlg) /* switch to another editor, viewer, etc */ /* return to panels before run the required dialog */ dialog_switch_pending = TRUE; @@ -119,7 +119,7 @@ dialog_switch_goto (GList * dlg) static void dlg_resize_cb (void *data, void *user_data) { - Dlg_head *d = data; + WDialog *d = data; (void) user_data; if (d->state == DLG_ACTIVE) @@ -133,7 +133,7 @@ dlg_resize_cb (void *data, void *user_data) /* --------------------------------------------------------------------------------------------- */ void -dialog_switch_add (Dlg_head * h) +dialog_switch_add (WDialog * h) { GList *dlg; @@ -154,11 +154,11 @@ dialog_switch_add (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ void -dialog_switch_remove (Dlg_head * h) +dialog_switch_remove (WDialog * h) { GList *this; - if ((Dlg_head *) mc_current->data == h) + if (DIALOG (mc_current->data) == h) this = mc_current; else this = g_list_find (mc_dialogs, h); @@ -167,13 +167,13 @@ dialog_switch_remove (Dlg_head * h) /* adjust current dialog */ if (top_dlg != NULL) - mc_current = g_list_find (mc_dialogs, (Dlg_head *) top_dlg->data); + mc_current = g_list_find (mc_dialogs, DIALOG (top_dlg->data)); else mc_current = mc_dialogs; /* resume forced the current screen */ if (mc_current != NULL) - ((Dlg_head *) mc_current->data)->state = DLG_ACTIVE; + DIALOG (mc_current->data)->state = DLG_ACTIVE; } /* --------------------------------------------------------------------------------------------- */ @@ -240,10 +240,10 @@ dialog_switch_list (void) for (h = mc_dialogs; h != NULL; h = g_list_next (h)) { - Dlg_head *dlg; + WDialog *dlg; char *title; - dlg = (Dlg_head *) h->data; + dlg = DIALOG (h->data); if ((dlg != NULL) && (dlg->get_title != NULL)) title = dlg->get_title (dlg, WIDGET (listbox->list)->cols - 2); @@ -274,7 +274,7 @@ dialog_switch_process_pending (void) while (dialog_switch_pending) { - Dlg_head *h = (Dlg_head *) mc_current->data; + WDialog *h = DIALOG (mc_current->data); dialog_switch_pending = FALSE; h->state = DLG_SUSPENDED; @@ -306,7 +306,7 @@ dialog_switch_got_winch (void) for (dlg = mc_dialogs; dlg != NULL; dlg = g_list_next (dlg)) if (dlg != mc_current) - ((Dlg_head *) dlg->data)->winch_pending = TRUE; + DIALOG (dlg->data)->winch_pending = TRUE; } /* --------------------------------------------------------------------------------------------- */ @@ -316,7 +316,7 @@ dialog_switch_shutdown (void) { while (mc_dialogs != NULL) { - Dlg_head *dlg = (Dlg_head *) mc_dialogs->data; + WDialog *dlg = DIALOG (mc_dialogs->data); run_dlg (dlg); destroy_dlg (dlg); diff --git a/lib/widget/dialog-switch.h b/lib/widget/dialog-switch.h index ab90193b0..bb745371d 100644 --- a/lib/widget/dialog-switch.h +++ b/lib/widget/dialog-switch.h @@ -12,12 +12,12 @@ /*** global variables defined in .c file *********************************************************/ -extern Dlg_head *midnight_dlg; +extern WDialog *midnight_dlg; /*** declarations of public functions ************************************************************/ -void dialog_switch_add (struct Dlg_head *h); -void dialog_switch_remove (struct Dlg_head *h); +void dialog_switch_add (struct WDialog *h); +void dialog_switch_remove (struct WDialog *h); size_t dialog_switch_num (void); void dialog_switch_next (void); diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index afc40cbf4..d239cacba 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -85,7 +85,7 @@ typedef enum /*** file scope functions ************************************************************************/ static GList * -dlg_widget_next (Dlg_head * h, GList * l) +dlg_widget_next (WDialog * h, GList * l) { GList *next; @@ -99,7 +99,7 @@ dlg_widget_next (Dlg_head * h, GList * l) /* --------------------------------------------------------------------------------------------- */ static GList * -dlg_widget_prev (Dlg_head * h, GList * l) +dlg_widget_prev (WDialog * h, GList * l) { GList *prev; @@ -118,7 +118,7 @@ dlg_widget_prev (Dlg_head * h, GList * l) */ static void -dlg_broadcast_msg_to (Dlg_head * h, widget_msg_t msg, gboolean reverse, int flags) +dlg_broadcast_msg_to (WDialog * h, widget_msg_t msg, gboolean reverse, int flags) { GList *p, *first; @@ -156,7 +156,7 @@ dlg_broadcast_msg_to (Dlg_head * h, widget_msg_t msg, gboolean reverse, int flag * Read histories from the ${XDG_CACHE_HOME}/mc/history file */ static void -dlg_read_history (Dlg_head * h) +dlg_read_history (WDialog * h) { char *profile; ev_history_load_save_t event_data; @@ -178,7 +178,7 @@ dlg_read_history (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ static gboolean -dlg_unfocus (Dlg_head * h) +dlg_unfocus (WDialog * h) { /* we can unfocus disabled widget */ if ((h->current != NULL) && (h->state == DLG_CONSTRUCT || h->state == DLG_ACTIVE)) @@ -213,7 +213,7 @@ dlg_find_widget_callback (const void *a, const void *b) */ static void -do_select_widget (Dlg_head * h, GList * w, select_dir_t dir) +do_select_widget (WDialog * h, GList * w, select_dir_t dir) { Widget *w0 = WIDGET (h->current->data); @@ -271,7 +271,7 @@ refresh_cmd (void) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -dlg_execute_cmd (Dlg_head * h, unsigned long command) +dlg_execute_cmd (WDialog * h, unsigned long command) { cb_ret_t ret = MSG_HANDLED; switch (command) @@ -338,7 +338,7 @@ dlg_execute_cmd (Dlg_head * h, unsigned long command) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -dlg_handle_key (Dlg_head * h, int d_key) +dlg_handle_key (WDialog * h, int d_key) { unsigned long command; @@ -357,7 +357,7 @@ dlg_handle_key (Dlg_head * h, int d_key) /* --------------------------------------------------------------------------------------------- */ static int -dlg_mouse_event (Dlg_head * h, Gpm_Event * event) +dlg_mouse_event (WDialog * h, Gpm_Event * event) { Widget *wh = WIDGET (h); @@ -409,7 +409,7 @@ dlg_mouse_event (Dlg_head * h, Gpm_Event * event) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -dlg_try_hotkey (Dlg_head * h, int d_key) +dlg_try_hotkey (WDialog * h, int d_key) { GList *hot_cur; Widget *current; @@ -476,7 +476,7 @@ dlg_try_hotkey (Dlg_head * h, int d_key) /* --------------------------------------------------------------------------------------------- */ static void -dlg_key_event (Dlg_head * h, int d_key) +dlg_key_event (WDialog * h, int d_key) { cb_ret_t handled; @@ -527,7 +527,7 @@ dlg_key_event (Dlg_head * h, int d_key) /* --------------------------------------------------------------------------------------------- */ static void -frontend_run_dlg (Dlg_head * h) +frontend_run_dlg (WDialog * h) { int d_key; Gpm_Event event; @@ -589,7 +589,7 @@ dlg_find_widget_by_id (gconstpointer a, gconstpointer b) /** draw box in window */ void -draw_box (const Dlg_head * h, int y, int x, int ys, int xs, gboolean single) +draw_box (const WDialog * h, int y, int x, int ys, int xs, gboolean single) { const Widget *wh = WIDGET (h); @@ -600,7 +600,7 @@ draw_box (const Dlg_head * h, int y, int x, int ys, int xs, gboolean single) /** Clean the dialog area, draw the frame and the title */ void -dlg_default_repaint (Dlg_head * h) +dlg_default_repaint (WDialog * h) { Widget *wh = WIDGET (h); @@ -627,7 +627,7 @@ dlg_default_repaint (Dlg_head * h) /** this function allows to set dialog position */ void -dlg_set_position (Dlg_head * h, int y1, int x1, int y2, int x2) +dlg_set_position (WDialog * h, int y1, int x1, int y2, int x2) { Widget *wh = WIDGET (h); @@ -713,7 +713,7 @@ dlg_set_position (Dlg_head * h, int y1, int x1, int y2, int x2) /** this function sets only size, leaving positioning to automatic methods */ void -dlg_set_size (Dlg_head * h, int lines, int cols) +dlg_set_size (WDialog * h, int lines, int cols) { int x = WIDGET (h)->x; int y = WIDGET (h)->y; @@ -734,7 +734,7 @@ dlg_set_size (Dlg_head * h, int lines, int cols) /** Default dialog callback */ cb_ret_t -dlg_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +dlg_default_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { (void) sender; (void) parm; @@ -772,15 +772,15 @@ dlg_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, vo /* --------------------------------------------------------------------------------------------- */ -Dlg_head * +WDialog * create_dlg (gboolean modal, int y1, int x1, int lines, int cols, const int *colors, dlg_cb_fn callback, mouse_h mouse_handler, const char *help_ctx, const char *title, dlg_flags_t flags) { - Dlg_head *new_d; + WDialog *new_d; Widget *w; - new_d = g_new0 (Dlg_head, 1); + new_d = g_new0 (WDialog, 1); w = WIDGET (new_d); init_widget (w, y1, x1, lines, cols, NULL, mouse_handler); widget_want_cursor (w, FALSE); @@ -837,7 +837,7 @@ dlg_set_default_colors (void) /* --------------------------------------------------------------------------------------------- */ void -dlg_erase (Dlg_head * h) +dlg_erase (WDialog * h) { if ((h != NULL) && (h->state == DLG_ACTIVE)) { @@ -850,7 +850,7 @@ dlg_erase (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ void -set_idle_proc (Dlg_head * d, int enable) +set_idle_proc (WDialog * d, int enable) { if (enable) d->flags |= DLG_WANT_IDLE; @@ -864,7 +864,7 @@ set_idle_proc (Dlg_head * d, int enable) */ unsigned long -add_widget_autopos (Dlg_head * h, void *w, widget_pos_flags_t pos_flags, const void *before) +add_widget_autopos (WDialog * h, void *w, widget_pos_flags_t pos_flags, const void *before) { Widget *wh = WIDGET (h); Widget *widget = WIDGET (w); @@ -923,7 +923,7 @@ add_widget_autopos (Dlg_head * h, void *w, widget_pos_flags_t pos_flags, const v /** wrapper to simply add lefttop positioned controls */ unsigned long -add_widget (Dlg_head * h, void *w) +add_widget (WDialog * h, void *w) { return add_widget_autopos (h, w, WPOS_KEEP_DEFAULT, h->current != NULL ? h->current->data : NULL); @@ -932,7 +932,7 @@ add_widget (Dlg_head * h, void *w) /* --------------------------------------------------------------------------------------------- */ unsigned long -add_widget_before (Dlg_head * h, void *w, void *before) +add_widget_before (WDialog * h, void *w, void *before) { return add_widget_autopos (h, w, WPOS_KEEP_DEFAULT, before); } @@ -943,7 +943,7 @@ add_widget_before (Dlg_head * h, void *w, void *before) void del_widget (void *w) { - Dlg_head *h = WIDGET (w)->owner; + WDialog *h = WIDGET (w)->owner; GList *d; /* Don't accept NULL widget. This shouldn't happen */ @@ -976,18 +976,18 @@ do_refresh (void) if (fast_refresh) { if ((d != NULL) && (d->data != NULL)) - dlg_redraw ((Dlg_head *) d->data); + dlg_redraw (DIALOG (d->data)); } else { /* Search first fullscreen dialog */ for (; d != NULL; d = g_list_next (d)) - if ((d->data != NULL) && ((Dlg_head *) d->data)->fullscreen) + if (d->data != NULL && DIALOG (d->data)->fullscreen) break; /* back to top dialog */ for (; d != NULL; d = g_list_previous (d)) if (d->data != NULL) - dlg_redraw ((Dlg_head *) d->data); + dlg_redraw (DIALOG (d->data)); } } @@ -995,7 +995,7 @@ do_refresh (void) /** broadcast a message to all the widgets in a dialog */ void -dlg_broadcast_msg (Dlg_head * h, widget_msg_t msg) +dlg_broadcast_msg (WDialog * h, widget_msg_t msg) { dlg_broadcast_msg_to (h, msg, FALSE, 0); } @@ -1003,7 +1003,7 @@ dlg_broadcast_msg (Dlg_head * h, widget_msg_t msg) /* --------------------------------------------------------------------------------------------- */ gboolean -dlg_focus (Dlg_head * h) +dlg_focus (WDialog * h) { /* cannot focus disabled widget */ if ((h->current != NULL) && (h->state == DLG_CONSTRUCT || h->state == DLG_ACTIVE)) @@ -1036,7 +1036,7 @@ dlg_overlap (Widget * a, Widget * b) /** Find the widget with the given callback in the dialog h */ Widget * -find_widget_type (const Dlg_head * h, widget_cb_fn callback) +find_widget_type (const WDialog * h, widget_cb_fn callback) { GList *w; @@ -1049,7 +1049,7 @@ find_widget_type (const Dlg_head * h, widget_cb_fn callback) /** Find the widget with the given id */ Widget * -dlg_find_by_id (const Dlg_head * h, unsigned long id) +dlg_find_by_id (const WDialog * h, unsigned long id) { GList *w; @@ -1061,7 +1061,7 @@ dlg_find_by_id (const Dlg_head * h, unsigned long id) /** Find the widget with the given id in the dialog h and select it */ void -dlg_select_by_id (const Dlg_head * h, unsigned long id) +dlg_select_by_id (const WDialog * h, unsigned long id) { Widget *w; @@ -1079,7 +1079,7 @@ void dlg_select_widget (void *w) { Widget *widget = WIDGET (w); - Dlg_head *h = widget->owner; + WDialog *h = widget->owner; do_select_widget (h, g_list_find (h->widgets, widget), SELECT_EXACT); } @@ -1094,7 +1094,7 @@ void dlg_set_top_widget (void *w) { Widget *widget = WIDGET (w); - Dlg_head *h = widget->owner; + WDialog *h = widget->owner; GList *l; l = g_list_find (h->widgets, w); @@ -1115,7 +1115,7 @@ dlg_set_top_widget (void *w) /** Try to select previous widget in the tab order */ void -dlg_one_up (Dlg_head * h) +dlg_one_up (WDialog * h) { if (h->widgets != NULL) do_select_widget (h, dlg_widget_prev (h, h->current), SELECT_PREV); @@ -1125,7 +1125,7 @@ dlg_one_up (Dlg_head * h) /** Try to select next widget in the tab order */ void -dlg_one_down (Dlg_head * h) +dlg_one_down (WDialog * h) { if (h->widgets != NULL) do_select_widget (h, dlg_widget_next (h, h->current), SELECT_NEXT); @@ -1134,7 +1134,7 @@ dlg_one_down (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ void -update_cursor (Dlg_head * h) +update_cursor (WDialog * h) { GList *p = h->current; @@ -1170,7 +1170,7 @@ update_cursor (Dlg_head * h) */ void -dlg_redraw (Dlg_head * h) +dlg_redraw (WDialog * h) { if (h->state != DLG_ACTIVE) return; @@ -1189,7 +1189,7 @@ dlg_redraw (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ void -dlg_stop (Dlg_head * h) +dlg_stop (WDialog * h) { h->state = DLG_CLOSED; } @@ -1198,9 +1198,9 @@ dlg_stop (Dlg_head * h) /** Init the process */ void -init_dlg (Dlg_head * h) +init_dlg (WDialog * h) { - if ((top_dlg != NULL) && ((Dlg_head *) top_dlg->data)->modal) + if (top_dlg != NULL && DIALOG (top_dlg->data)->modal) h->modal = TRUE; /* add dialog to the stack */ @@ -1231,7 +1231,7 @@ init_dlg (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ void -dlg_process_event (Dlg_head * h, int key, Gpm_Event * event) +dlg_process_event (WDialog * h, int key, Gpm_Event * event) { if (key == EV_NONE) { @@ -1252,7 +1252,7 @@ dlg_process_event (Dlg_head * h, int key, Gpm_Event * event) /** Shutdown the run_dlg */ void -dlg_run_done (Dlg_head * h) +dlg_run_done (WDialog * h) { top_dlg = g_list_remove (top_dlg, h); @@ -1274,7 +1274,7 @@ dlg_run_done (Dlg_head * h) */ int -run_dlg (Dlg_head * h) +run_dlg (WDialog * h) { init_dlg (h); frontend_run_dlg (h); @@ -1285,7 +1285,7 @@ run_dlg (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ void -destroy_dlg (Dlg_head * h) +destroy_dlg (WDialog * h) { /* if some widgets have history, save all history at one moment here */ dlg_save_history (h); @@ -1306,7 +1306,7 @@ destroy_dlg (Dlg_head * h) * Write history to the ${XDG_CACHE_HOME}/mc/history file */ void -dlg_save_history (Dlg_head * h) +dlg_save_history (WDialog * h) { char *profile; int i; @@ -1340,7 +1340,7 @@ dlg_save_history (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ char * -dlg_get_title (const Dlg_head * h, size_t len) +dlg_get_title (const WDialog * h, size_t len) { char *t; @@ -1361,7 +1361,7 @@ dlg_get_title (const Dlg_head * h, size_t len) void dlg_replace_widget (Widget * old_w, Widget * new_w) { - Dlg_head *h = old_w->owner; + WDialog *h = old_w->owner; gboolean should_focus = FALSE; if (h->widgets == NULL) diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index ea9144cc3..46a5b5d6d 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -16,7 +16,9 @@ #include "lib/keybind.h" /* global_keymap_t */ #include "lib/tty/mouse.h" /* mouse_h */ -/*** defined constants ***************************************************************************/ +/*** typedefs(not structures) and defined constants **********************************************/ + +#define DIALOG(x) ((WDialog *)(x)) /* Common return values */ #define B_EXIT 0 @@ -84,19 +86,19 @@ typedef enum typedef char *(*dlg_shortcut_str) (unsigned long command); /* get dialog name to show in dialog list */ -typedef char *(*dlg_title_str) (const Dlg_head * h, size_t len); +typedef char *(*dlg_title_str) (const WDialog * h, size_t len); typedef int dlg_colors_t[DLG_COLOR_COUNT]; /* Dialog callback */ -typedef cb_ret_t (*dlg_cb_fn) (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data); +typedef cb_ret_t (*dlg_cb_fn) (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data); /* menu command execution */ typedef cb_ret_t (*menu_exec_fn) (int command); /*** structures declarations (and typedefs of structures)*****************************************/ -struct Dlg_head +struct WDialog { Widget widget; @@ -147,70 +149,70 @@ extern const global_keymap_t *dialog_map; /*** declarations of public functions ************************************************************/ /* draw box in window */ -void draw_box (const Dlg_head * h, int y, int x, int ys, int xs, gboolean single); +void draw_box (const WDialog * h, int y, int x, int ys, int xs, gboolean single); /* Creates a dialog head */ -Dlg_head *create_dlg (gboolean modal, int y1, int x1, int lines, int cols, - const int *colors, dlg_cb_fn callback, mouse_h mouse_handler, - const char *help_ctx, const char *title, dlg_flags_t flags); +WDialog *create_dlg (gboolean modal, int y1, int x1, int lines, int cols, + const int *colors, dlg_cb_fn callback, mouse_h mouse_handler, + const char *help_ctx, const char *title, dlg_flags_t flags); void dlg_set_default_colors (void); -unsigned long add_widget_autopos (Dlg_head * dest, void *w, widget_pos_flags_t pos_flags, +unsigned long add_widget_autopos (WDialog * dest, void *w, widget_pos_flags_t pos_flags, const void *before); -unsigned long add_widget (Dlg_head * dest, void *w); -unsigned long add_widget_before (Dlg_head * h, void *w, void *before); +unsigned long add_widget (WDialog * dest, void *w); +unsigned long add_widget_before (WDialog * h, void *w, void *before); void del_widget (void *w); /* sets size of dialog, leaving positioning to automatic mehtods according to dialog flags */ -void dlg_set_size (Dlg_head * h, int lines, int cols); +void dlg_set_size (WDialog * h, int lines, int cols); /* this function allows to set dialog position */ -void dlg_set_position (Dlg_head * h, int y1, int x1, int y2, int x2); +void dlg_set_position (WDialog * h, int y1, int x1, int y2, int x2); -void init_dlg (Dlg_head * h); -int run_dlg (Dlg_head * d); -void destroy_dlg (Dlg_head * h); +void init_dlg (WDialog * h); +int run_dlg (WDialog * d); +void destroy_dlg (WDialog * h); -void dlg_run_done (Dlg_head * h); -void dlg_save_history (Dlg_head * h); -void dlg_process_event (Dlg_head * h, int key, Gpm_Event * event); +void dlg_run_done (WDialog * h); +void dlg_save_history (WDialog * h); +void dlg_process_event (WDialog * h, int key, Gpm_Event * event); -char *dlg_get_title (const Dlg_head * h, size_t len); +char *dlg_get_title (const WDialog * h, size_t len); /* To activate/deactivate the idle message generation */ -void set_idle_proc (Dlg_head * d, int enable); +void set_idle_proc (WDialog * d, int enable); -void dlg_redraw (Dlg_head * h); +void dlg_redraw (WDialog * h); -void dlg_broadcast_msg (Dlg_head * h, widget_msg_t message); +void dlg_broadcast_msg (WDialog * h, widget_msg_t message); /* Default callback for dialogs */ -cb_ret_t dlg_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data); +cb_ret_t dlg_default_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data); /* Default paint routine for dialogs */ -void dlg_default_repaint (Dlg_head * h); +void dlg_default_repaint (WDialog * h); void dlg_replace_widget (Widget * old, Widget * new); int dlg_overlap (Widget * a, Widget * b); -void dlg_erase (Dlg_head * h); -void dlg_stop (Dlg_head * h); +void dlg_erase (WDialog * h); +void dlg_stop (WDialog * h); /* Widget selection */ void dlg_select_widget (void *w); void dlg_set_top_widget (void *w); -void dlg_one_up (Dlg_head * h); -void dlg_one_down (Dlg_head * h); -gboolean dlg_focus (Dlg_head * h); -Widget *find_widget_type (const Dlg_head * h, widget_cb_fn callback); -Widget *dlg_find_by_id (const Dlg_head * h, unsigned long id); -void dlg_select_by_id (const Dlg_head * h, unsigned long id); +void dlg_one_up (WDialog * h); +void dlg_one_down (WDialog * h); +gboolean dlg_focus (WDialog * h); +Widget *find_widget_type (const WDialog * h, widget_cb_fn callback); +Widget *dlg_find_by_id (const WDialog * h, unsigned long id); +void dlg_select_by_id (const WDialog * h, unsigned long id); /* Redraw all dialogs */ void do_refresh (void); /* Used in load_prompt() */ -void update_cursor (Dlg_head * h); +void update_cursor (WDialog * h); /*** inline functions ****************************************************************************/ @@ -224,7 +226,7 @@ dlg_widget_active (void *w) /* --------------------------------------------------------------------------------------------- */ static inline unsigned long -dlg_get_current_widget_id (const struct Dlg_head *h) +dlg_get_current_widget_id (const struct WDialog *h) { return WIDGET (h->current->data)->id; } diff --git a/lib/widget/gauge.c b/lib/widget/gauge.c index b35bfa743..30dd9b268 100644 --- a/lib/widget/gauge.c +++ b/lib/widget/gauge.c @@ -62,7 +62,7 @@ static cb_ret_t gauge_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WGauge *g = (WGauge *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; if (msg == WIDGET_INIT) return MSG_HANDLED; diff --git a/lib/widget/history.c b/lib/widget/history.c index 4963fb2bf..95761baa5 100644 --- a/lib/widget/history.c +++ b/lib/widget/history.c @@ -73,7 +73,7 @@ typedef struct /*** file scope functions ************************************************************************/ static cb_ret_t -history_dlg_reposition (Dlg_head * dlg_head) +history_dlg_reposition (WDialog * dlg_head) { history_dlg_data *data; int x = 0, y, he, wi; @@ -117,7 +117,7 @@ history_dlg_reposition (Dlg_head * dlg_head) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -history_dlg_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +history_dlg_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -292,7 +292,7 @@ history_show (GList ** history, Widget * widget, int current) GList *z, *hlist = NULL, *hi; size_t maxlen, i, count = 0; char *r = NULL; - Dlg_head *query_dlg; + WDialog *query_dlg; WListbox *query_list; history_dlg_data hist_data; diff --git a/lib/widget/hline.c b/lib/widget/hline.c index 9721c5180..5e1bbac5c 100644 --- a/lib/widget/hline.c +++ b/lib/widget/hline.c @@ -57,7 +57,7 @@ static cb_ret_t hline_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WHLine *l = (WHLine *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; switch (msg) { diff --git a/lib/widget/input_complete.c b/lib/widget/input_complete.c index bf145e70f..b6600b3fb 100644 --- a/lib/widget/input_complete.c +++ b/lib/widget/input_complete.c @@ -1048,7 +1048,7 @@ insert_text (WInput * in, char *text, ssize_t size) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -query_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +query_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { static char buff[MB_LEN_MAX] = ""; static int bl = 0; @@ -1281,7 +1281,7 @@ complete_engine (WInput * in, int what_to_do) int x, y, w, h; int start_x, start_y; char **p, *q; - Dlg_head *query_dlg; + WDialog *query_dlg; WListbox *query_list; for (p = in->completions + 1; *p != NULL; count++, p++) diff --git a/lib/widget/label.c b/lib/widget/label.c index 24a992e8e..e98d6f0fd 100644 --- a/lib/widget/label.c +++ b/lib/widget/label.c @@ -60,7 +60,7 @@ static cb_ret_t label_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WLabel *l = (WLabel *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; switch (msg) { diff --git a/lib/widget/listbox-window.h b/lib/widget/listbox-window.h index 714d4329a..a96cd59c5 100644 --- a/lib/widget/listbox-window.h +++ b/lib/widget/listbox-window.h @@ -16,7 +16,7 @@ typedef struct { - struct Dlg_head *dlg; + struct WDialog *dlg; struct WListbox *list; } Listbox; diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c index 4b3dce779..781f14d84 100644 --- a/lib/widget/listbox.c +++ b/lib/widget/listbox.c @@ -122,7 +122,7 @@ static void listbox_draw (WListbox * l, gboolean focused) { Widget *w = WIDGET (l); - const Dlg_head *h = w->owner; + const WDialog *h = w->owner; const gboolean disabled = (w->options & W_DISABLED) != 0; const int normalc = disabled ? DISABLED_COLOR : h->color[DLG_COLOR_NORMAL]; /* *INDENT-OFF* */ @@ -368,7 +368,7 @@ static cb_ret_t listbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WListbox *l = (WListbox *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; cb_ret_t ret_code; switch (msg) diff --git a/lib/widget/menu.c b/lib/widget/menu.c index 2b3437317..04a371fbc 100644 --- a/lib/widget/menu.c +++ b/lib/widget/menu.c @@ -235,7 +235,7 @@ menubar_draw (WMenuBar * menubar) static void menubar_remove (WMenuBar * menubar) { - Dlg_head *h; + WDialog *h; if (!menubar->is_dropped) return; @@ -913,7 +913,7 @@ menubar_arrange (WMenuBar * menubar) /** Find MenuBar widget in the dialog */ WMenuBar * -find_menubar (const Dlg_head * h) +find_menubar (const WDialog * h) { return (WMenuBar *) find_widget_type (h, menubar_callback); } diff --git a/lib/widget/menu.h b/lib/widget/menu.h index ca285d09e..d6cb0f04e 100644 --- a/lib/widget/menu.h +++ b/lib/widget/menu.h @@ -65,7 +65,7 @@ void menubar_set_menu (WMenuBar * menubar, GList * menu); void menubar_add_menu (WMenuBar * menubar, Menu * menu); void menubar_arrange (WMenuBar * menubar); -WMenuBar *find_menubar (const Dlg_head * h); +WMenuBar *find_menubar (const WDialog * h); /*** inline functions ****************************************************************************/ diff --git a/lib/widget/quick.c b/lib/widget/quick.c index ae0653606..2cb9aafe4 100644 --- a/lib/widget/quick.c +++ b/lib/widget/quick.c @@ -183,7 +183,7 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip) size_t i; quick_widget_t *quick_widget; WGroupbox *g = NULL; - Dlg_head *dd; + WDialog *dd; int return_val; len = str_term_width1 (I18N (quick_dlg->title)) + 6; diff --git a/lib/widget/radio.c b/lib/widget/radio.c index 58cd8a801..2703b5885 100644 --- a/lib/widget/radio.c +++ b/lib/widget/radio.c @@ -58,7 +58,7 @@ radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d { WRadio *r = (WRadio *) w; int i; - Dlg_head *h = w->owner; + WDialog *h = w->owner; switch (msg) { diff --git a/lib/widget/widget-common.c b/lib/widget/widget-common.c index 9db0d39fe..6d281c378 100644 --- a/lib/widget/widget-common.c +++ b/lib/widget/widget-common.c @@ -233,7 +233,7 @@ widget_set_size (Widget * widget, int y, int x, int lines, int cols) void widget_selectcolor (Widget * w, gboolean focused, gboolean hotkey) { - Dlg_head *h = w->owner; + WDialog *h = w->owner; int color; if ((w->options & W_DISABLED) != 0) diff --git a/lib/widget/widget-common.h b/lib/widget/widget-common.h index acdbc11b4..0432edce4 100644 --- a/lib/widget/widget-common.h +++ b/lib/widget/widget-common.h @@ -96,7 +96,7 @@ struct Widget widget_cb_fn callback; mouse_h mouse; void (*set_options) (Widget *w, widget_options_t options, gboolean enable); - struct Dlg_head *owner; + struct WDialog *owner; }; /* structure for label (caption) with hotkey, if original text does not contain diff --git a/lib/widget/wtools.c b/lib/widget/wtools.c index 61c1e0374..db1556c3a 100644 --- a/lib/widget/wtools.c +++ b/lib/widget/wtools.c @@ -53,7 +53,7 @@ /*** file scope variables ************************************************************************/ -static Dlg_head *last_query_dlg; +static WDialog *last_query_dlg; static int sel_pos = 0; @@ -63,7 +63,7 @@ static int sel_pos = 0; /** default query callback, used to reposition query */ static cb_ret_t -query_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +query_default_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -71,14 +71,14 @@ query_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, if ((h->flags & DLG_CENTER) == 0) { Widget *wh = WIDGET (h); - Dlg_head *prev_dlg = NULL; + WDialog *prev_dlg = NULL; int ypos, xpos; /* get dialog under h */ if (top_dlg != NULL) { if (top_dlg->data != (void *) h) - prev_dlg = (Dlg_head *) top_dlg->data; + prev_dlg = DIALOG (top_dlg->data); else { GList *p; @@ -87,7 +87,7 @@ query_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, Get previous dialog in stack */ p = g_list_next (top_dlg); if (p != NULL) - prev_dlg = (Dlg_head *) p->data; + prev_dlg = DIALOG (p->data); } } @@ -114,11 +114,11 @@ query_default_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, /* --------------------------------------------------------------------------------------------- */ /** Create message dialog */ -static struct Dlg_head * +static struct WDialog * do_create_message (int flags, const char *title, const char *text) { char *p; - Dlg_head *d; + WDialog *d; /* Add empty lines before and after the message */ p = g_strconcat ("\n", text, "\n", (char *) NULL); @@ -143,7 +143,7 @@ do_create_message (int flags, const char *title, const char *text) static void fg_message (int flags, const char *title, const char *text) { - Dlg_head *d; + WDialog *d; d = do_create_message (flags, title, text); tty_getch (); @@ -270,7 +270,7 @@ int query_dialog (const char *header, const char *text, int flags, int count, ...) { va_list ap; - Dlg_head *query_dlg; + WDialog *query_dlg; WButton *button; WButton *defbutton = NULL; int win_len = 0; @@ -376,11 +376,11 @@ query_set_sel (int new_sel) * destroy_dlg() to dismiss it. Not safe to call from background. */ -struct Dlg_head * +struct WDialog * create_message (int flags, const char *title, const char *text, ...) { va_list args; - Dlg_head *d; + WDialog *d; char *p; va_start (args, text); diff --git a/lib/widget/wtools.h b/lib/widget/wtools.h index 61f203667..4e23e9ce6 100644 --- a/lib/widget/wtools.h +++ b/lib/widget/wtools.h @@ -41,8 +41,8 @@ int query_dialog (const char *header, const char *text, int flags, int count, .. void query_set_sel (int new_sel); /* Create message box but don't dismiss it yet, not background safe */ -struct Dlg_head *create_message (int flags, const char *title, - const char *text, ...) __attribute__ ((format (__printf__, 3, 4))); +struct WDialog *create_message (int flags, const char *title, + const char *text, ...) __attribute__ ((format (__printf__, 3, 4))); /* Show message box, background safe */ void message (int flags, const char *title, const char *text, ...) diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index 3a177e2a2..c0acd6c40 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -2860,7 +2860,7 @@ dview_update (WDiff * dview) static void dview_edit (WDiff * dview, diff_place_t ord) { - Dlg_head *h; + WDialog *h; gboolean h_modal; int linenum, lineofs; @@ -2937,7 +2937,7 @@ static void dview_labels (WDiff * dview) { Widget *d; - Dlg_head *h; + WDialog *h; WButtonBar *b; d = WIDGET (dview); @@ -3307,7 +3307,7 @@ static cb_ret_t dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WDiff *dview = (WDiff *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; cb_ret_t i; switch (msg) @@ -3352,7 +3352,7 @@ dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d /* --------------------------------------------------------------------------------------------- */ static void -dview_adjust_size (Dlg_head * h) +dview_adjust_size (WDialog * h) { WDiff *dview; WButtonBar *bar; @@ -3369,7 +3369,7 @@ dview_adjust_size (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -dview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +dview_dialog_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { WDiff *dview = (WDiff *) data; @@ -3409,7 +3409,7 @@ dview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, v /* --------------------------------------------------------------------------------------------- */ static char * -dview_get_title (const Dlg_head * h, size_t len) +dview_get_title (const WDialog * h, size_t len) { const WDiff *dview; const char *modified = " (*) "; @@ -3439,7 +3439,7 @@ diff_view (const char *file1, const char *file2, const char *label1, const char int error; WDiff *dview; Widget *w; - Dlg_head *dview_dlg; + WDialog *dview_dlg; /* Create dialog and widgets, put them on the dialog */ dview_dlg = diff --git a/src/editor/edit-impl.h b/src/editor/edit-impl.h index 5f4b1a0ec..16c1b276d 100644 --- a/src/editor/edit-impl.h +++ b/src/editor/edit-impl.h @@ -172,12 +172,12 @@ extern char *edit_window_close_char; /*** declarations of public functions ************************************************************/ -gboolean edit_add_window (Dlg_head * h, int y, int x, int lines, int cols, +gboolean edit_add_window (WDialog * h, int y, int x, int lines, int cols, const vfs_path_t * f, long fline); -WEdit *find_editor (const Dlg_head * h); +WEdit *find_editor (const WDialog * h); gboolean edit_widget_is_editor (const Widget * w); -gboolean edit_drop_hotkey_menu (Dlg_head * h, int key); -void edit_menu_cmd (Dlg_head * h); +gboolean edit_drop_hotkey_menu (WDialog * h, int key); +void edit_menu_cmd (WDialog * h); void user_menu (WEdit * edit, const char *menu_file, int selected_entry); void edit_init_menu (struct WMenuBar *menubar); void edit_save_mode_cmd (void); @@ -228,9 +228,9 @@ WEdit *edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * filename_vpath, long line); gboolean edit_clean (WEdit * edit); gboolean edit_ok_to_exit (WEdit * edit); -gboolean edit_load_cmd (Dlg_head * h); -gboolean edit_load_syntax_file (Dlg_head * h); -gboolean edit_load_menu_file (Dlg_head * h); +gboolean edit_load_cmd (WDialog * h); +gboolean edit_load_syntax_file (WDialog * h); +gboolean edit_load_menu_file (WDialog * h); gboolean edit_close_cmd (WEdit * edit); void edit_mark_cmd (WEdit * edit, gboolean unmark); void edit_mark_current_word_cmd (WEdit * edit); @@ -265,10 +265,10 @@ gboolean edit_load_back_cmd (WEdit * edit); gboolean edit_load_forward_cmd (WEdit * edit); void edit_block_process_cmd (WEdit * edit, int macro_number); void edit_refresh_cmd (void); -void edit_syntax_onoff_cmd (Dlg_head * h); -void edit_show_tabs_tws_cmd (Dlg_head * h); -void edit_show_margin_cmd (Dlg_head * h); -void edit_show_numbers_cmd (Dlg_head * h); +void edit_syntax_onoff_cmd (WDialog * h); +void edit_show_tabs_tws_cmd (WDialog * h); +void edit_show_margin_cmd (WDialog * h); +void edit_show_numbers_cmd (WDialog * h); void edit_date_cmd (WEdit * edit); void edit_goto_cmd (WEdit * edit); int eval_marks (WEdit * edit, off_t * start_mark, off_t * end_mark); @@ -321,7 +321,7 @@ gboolean edit_line_is_blank (WEdit * edit, long line); gboolean is_break_char (char c); long edit_indent_width (const WEdit * edit, off_t p); void edit_insert_indent (WEdit * edit, int indent); -void edit_options_dialog (Dlg_head * h); +void edit_options_dialog (WDialog * h); void edit_syntax_dialog (WEdit * edit); void edit_mail_dialog (WEdit * edit); void format_paragraph (WEdit * edit, int force); diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index 9d7112341..e3b189f5d 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -118,7 +118,7 @@ static unsigned long edit_save_mode_radio_id, edit_save_mode_input_id; /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -edit_save_mode_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +edit_save_mode_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -535,7 +535,7 @@ edit_save_cmd (WEdit * edit) */ static inline gboolean -edit_load_file_from_filename (Dlg_head * h, const vfs_path_t * vpath) +edit_load_file_from_filename (WDialog * h, const vfs_path_t * vpath) { Widget *w = WIDGET (h); @@ -1521,7 +1521,7 @@ edit_refresh_cmd (void) */ void -edit_syntax_onoff_cmd (Dlg_head * h) +edit_syntax_onoff_cmd (WDialog * h) { option_syntax_highlighting = !option_syntax_highlighting; g_list_foreach (h->widgets, edit_syntax_onoff_cb, NULL); @@ -1536,7 +1536,7 @@ edit_syntax_onoff_cmd (Dlg_head * h) */ void -edit_show_tabs_tws_cmd (Dlg_head * h) +edit_show_tabs_tws_cmd (WDialog * h) { enable_show_tabs_tws = !enable_show_tabs_tws; g_list_foreach (h->widgets, edit_redraw_page_cb, NULL); @@ -1551,7 +1551,7 @@ edit_show_tabs_tws_cmd (Dlg_head * h) */ void -edit_show_margin_cmd (Dlg_head * h) +edit_show_margin_cmd (WDialog * h) { show_right_margin = !show_right_margin; g_list_foreach (h->widgets, edit_redraw_page_cb, NULL); @@ -1566,7 +1566,7 @@ edit_show_margin_cmd (Dlg_head * h) */ void -edit_show_numbers_cmd (Dlg_head * h) +edit_show_numbers_cmd (WDialog * h) { option_line_state = !option_line_state; option_line_state_width = option_line_state ? LINE_STATE_WIDTH : 0; @@ -2057,7 +2057,7 @@ edit_save_confirm_cmd (WEdit * edit) */ gboolean -edit_load_cmd (Dlg_head * h) +edit_load_cmd (WDialog * h) { char *exp; gboolean ret = TRUE; /* possible cancel */ @@ -2087,7 +2087,7 @@ edit_load_cmd (Dlg_head * h) */ gboolean -edit_load_syntax_file (Dlg_head * h) +edit_load_syntax_file (WDialog * h) { vfs_path_t *extdir_vpath; int dir = 0; @@ -2132,7 +2132,7 @@ edit_load_syntax_file (Dlg_head * h) */ gboolean -edit_load_menu_file (Dlg_head * h) +edit_load_menu_file (WDialog * h) { vfs_path_t *buffer_vpath; vfs_path_t *menufile_vpath; @@ -2202,7 +2202,7 @@ edit_close_cmd (WEdit * edit) if (ret) { - Dlg_head *h = WIDGET (edit)->owner; + WDialog *h = WIDGET (edit)->owner; if (edit->locked != 0) unlock_file (edit->filename_vpath); diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c index 14d3dd8a8..a6dfc6931 100644 --- a/src/editor/editcmd_dialogs.c +++ b/src/editor/editcmd_dialogs.c @@ -68,7 +68,7 @@ edit_search_options_t edit_search_options = { /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -editcmd_dialog_raw_key_query_cb (Dlg_head *h, Widget * sender, dlg_msg_t msg, int parm, void *data) +editcmd_dialog_raw_key_query_cb (WDialog *h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -298,7 +298,7 @@ editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean c { int w, wq; int y = 2; - Dlg_head *raw_dlg; + WDialog *raw_dlg; w = str_term_width1 (heading) + 6; wq = str_term_width1 (query); @@ -335,7 +335,7 @@ editcmd_dialog_completion_show (WEdit * edit, int max_len, int word_len, int start_x, start_y, offset, i; char *curr = NULL; - Dlg_head *compl_dlg; + WDialog *compl_dlg; WListbox *compl_list; int compl_dlg_h; /* completion dialog height */ int compl_dlg_w; /* completion dialog width */ @@ -422,7 +422,7 @@ editcmd_dialog_select_definition_show (WEdit * edit, char *match_expr, int max_l int start_x, start_y, offset, i; char *curr = NULL; etags_hash_t *curr_def = NULL; - Dlg_head *def_dlg; + WDialog *def_dlg; WListbox *def_list; int def_dlg_h; /* dialog height */ int def_dlg_w; /* dialog width */ diff --git a/src/editor/editmenu.c b/src/editor/editmenu.c index b88b50293..1624c9366 100644 --- a/src/editor/editmenu.c +++ b/src/editor/editmenu.c @@ -259,7 +259,7 @@ create_options_menu (void) /* --------------------------------------------------------------------------------------------- */ static void -edit_drop_menu_cmd (Dlg_head * h, int which) +edit_drop_menu_cmd (WDialog * h, int which) { WMenuBar *menubar; @@ -306,7 +306,7 @@ edit_init_menu (struct WMenuBar *menubar) /* --------------------------------------------------------------------------------------------- */ void -edit_menu_cmd (Dlg_head * h) +edit_menu_cmd (WDialog * h) { edit_drop_menu_cmd (h, -1); } @@ -314,7 +314,7 @@ edit_menu_cmd (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ gboolean -edit_drop_hotkey_menu (Dlg_head * h, int key) +edit_drop_hotkey_menu (WDialog * h, int key) { int m = 0; switch (key) diff --git a/src/editor/editoptions.c b/src/editor/editoptions.c index 785cc1d8c..33d7a3632 100644 --- a/src/editor/editoptions.c +++ b/src/editor/editoptions.c @@ -115,7 +115,7 @@ edit_reload_syntax (void *data, void *user_data) /* --------------------------------------------------------------------------------------------- */ void -edit_options_dialog (Dlg_head * h) +edit_options_dialog (WDialog * h) { char wrap_length[16], tab_spacing[16]; char *p, *q; diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c index abd24ec1f..23bfc736b 100644 --- a/src/editor/editwidget.c +++ b/src/editor/editwidget.c @@ -84,7 +84,7 @@ static unsigned int edit_dlg_init_refcounter = 0; /*** file scope functions ************************************************************************/ -static cb_ret_t edit_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, +static cb_ret_t edit_dialog_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data); /* --------------------------------------------------------------------------------------------- */ @@ -314,7 +314,7 @@ get_hotkey (int n) /* --------------------------------------------------------------------------------------------- */ static void -edit_window_list (const Dlg_head * h) +edit_window_list (const WDialog * h) { const size_t offset = 2; /* skip menu and buttonbar */ const size_t dlg_num = g_list_length (h->widgets) - offset; @@ -385,7 +385,7 @@ edit_get_shortcut (unsigned long command) /* --------------------------------------------------------------------------------------------- */ static char * -edit_get_title (const Dlg_head * h, size_t len) +edit_get_title (const WDialog * h, size_t len) { const WEdit *edit = find_editor (h); const char *modified = edit->modified ? "(*) " : " "; @@ -654,7 +654,7 @@ edit_event (Gpm_Event * event, void *data) static int edit_dialog_event (Gpm_Event * event, void *data) { - Dlg_head *h = (Dlg_head *) data; + WDialog *h = DIALOG (data); Widget *w; Widget *wh = WIDGET (h); int ret = MOU_UNHANDLED; @@ -709,7 +709,7 @@ edit_dialog_event (Gpm_Event * event, void *data) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -edit_dialog_command_execute (Dlg_head * h, unsigned long command) +edit_dialog_command_execute (WDialog * h, unsigned long command) { Widget *wh = WIDGET (h); gboolean ret = MSG_HANDLED; @@ -812,7 +812,7 @@ edit_dialog_command_execute (Dlg_head * h, unsigned long command) /* --------------------------------------------------------------------------------------------- */ static inline void -edit_quit (Dlg_head * h) +edit_quit (WDialog * h) { GList *l; WEdit *e = NULL; @@ -865,7 +865,7 @@ edit_set_buttonbar (WEdit * edit, WButtonBar * bb) /** Callback for the edit dialog */ static cb_ret_t -edit_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +edit_dialog_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { WMenuBar *menubar; WButtonBar *buttonbar; @@ -1062,7 +1062,7 @@ gboolean edit_files (const GList * files) { static gboolean made_directory = FALSE; - Dlg_head *edit_dlg; + WDialog *edit_dlg; WMenuBar *menubar; const GList *file; gboolean ok = FALSE; @@ -1130,7 +1130,7 @@ edit_get_file_name (const WEdit * edit) /* --------------------------------------------------------------------------------------------- */ WEdit * -find_editor (const Dlg_head * h) +find_editor (const WDialog * h) { if (edit_widget_is_editor (WIDGET (h->current->data))) return (WEdit *) h->current->data; @@ -1156,7 +1156,7 @@ edit_widget_is_editor (const Widget * w) void edit_update_screen (WEdit * e) { - Dlg_head *h = WIDGET (e)->owner; + WDialog *h = WIDGET (e)->owner; edit_scroll_screen_over_cursor (e); edit_update_curs_col (e); @@ -1210,7 +1210,7 @@ edit_save_size (WEdit * edit) */ gboolean -edit_add_window (Dlg_head * h, int y, int x, int lines, int cols, const vfs_path_t * f, long fline) +edit_add_window (WDialog * h, int y, int x, int lines, int cols, const vfs_path_t * f, long fline) { WEdit *edit; Widget *w; diff --git a/src/editor/spell_dialogs.c b/src/editor/spell_dialogs.c index 298127636..c92929601 100644 --- a/src/editor/spell_dialogs.c +++ b/src/editor/spell_dialogs.c @@ -70,7 +70,7 @@ spell_dialog_spell_suggest_show (WEdit * edit, const char *word, char **new_word unsigned int i; int res; char *curr = NULL; - Dlg_head *sug_dlg; + WDialog *sug_dlg; WListbox *sug_list; int max_btn_len = 0; int add_len; diff --git a/src/filemanager/achown.c b/src/filemanager/achown.c index 2510b4d6d..f4b936b57 100644 --- a/src/filemanager/achown.c +++ b/src/filemanager/achown.c @@ -75,7 +75,7 @@ /*** file scope variables ************************************************************************/ -static struct Dlg_head *ch_dlg; +static struct WDialog *ch_dlg; static struct { @@ -279,7 +279,7 @@ chown_info_update (void) /* --------------------------------------------------------------------------------------------- */ static void -update_mode (Dlg_head * h) +update_mode (WDialog * h) { print_flags (); chown_info_update (); @@ -289,7 +289,7 @@ update_mode (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -chl_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +chl_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -310,9 +310,9 @@ chl_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data /* --------------------------------------------------------------------------------------------- */ static void -do_enter_key (Dlg_head * h, int f_pos) +do_enter_key (WDialog * h, int f_pos) { - Dlg_head *chl_dlg; + WDialog *chl_dlg; WListbox *chl_list; struct passwd *chl_pass; struct group *chl_grp; @@ -458,7 +458,7 @@ b_setpos (int f_pos) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -advanced_chown_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +advanced_chown_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { int i; int f_pos; diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c index 6336e40a8..ebc9cdcf0 100644 --- a/src/filemanager/boxes.c +++ b/src/filemanager/boxes.c @@ -118,7 +118,7 @@ static WListbox *bg_list = NULL; /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -panel_listing_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +panel_listing_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -262,7 +262,7 @@ sel_charset_button (WButton * button, int action) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -tree_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +tree_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -299,7 +299,7 @@ tree_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *dat #if defined(ENABLE_VFS) && defined (ENABLE_VFS_FTP) static cb_ret_t -confvfs_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +confvfs_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -711,7 +711,7 @@ char * tree_box (const char *current_dir) { WTree *mytree; - Dlg_head *dlg; + WDialog *dlg; Widget *wd; char *val = NULL; WButtonBar *bar; @@ -916,7 +916,7 @@ jobs_cmd (void) size_t i; const size_t n_but = G_N_ELEMENTS (job_but); - Dlg_head *jobs_dlg; + WDialog *jobs_dlg; int cols = 60; int lines = 15; int x = 0; diff --git a/src/filemanager/chmod.c b/src/filemanager/chmod.c index 02fb9df51..cea3b0022 100644 --- a/src/filemanager/chmod.c +++ b/src/filemanager/chmod.c @@ -181,7 +181,7 @@ chmod_i18n (void) /* --------------------------------------------------------------------------------------------- */ static void -chmod_toggle_select (Dlg_head * h, int Id) +chmod_toggle_select (WDialog * h, int Id) { tty_setcolor (COLOR_NORMAL); check_perm[Id].selected = !check_perm[Id].selected; @@ -194,7 +194,7 @@ chmod_toggle_select (Dlg_head * h, int Id) /* --------------------------------------------------------------------------------------------- */ static void -chmod_refresh (Dlg_head * h) +chmod_refresh (WDialog * h) { int y = WIDGET (file_gb)->y + 1; int x = WIDGET (file_gb)->x + 2; @@ -216,7 +216,7 @@ chmod_refresh (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -chmod_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +chmod_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -281,10 +281,10 @@ chmod_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *da /* --------------------------------------------------------------------------------------------- */ -static Dlg_head * +static WDialog * init_chmod (const char *fname, const struct stat *sf_stat) { - Dlg_head *ch_dlg; + WDialog *ch_dlg; int lines, cols; int y; int perm_gb_len; @@ -456,7 +456,7 @@ chmod_cmd (void) do { /* do while any files remaining */ vfs_path_t *vpath; - Dlg_head *ch_dlg; + WDialog *ch_dlg; struct stat sf_stat; char *fname; int result; diff --git a/src/filemanager/chown.c b/src/filemanager/chown.c index 3cc418f9d..4bb928d39 100644 --- a/src/filemanager/chown.c +++ b/src/filemanager/chown.c @@ -143,7 +143,7 @@ chown_i18n (void) /* --------------------------------------------------------------------------------------------- */ static void -chown_refresh (Dlg_head * h) +chown_refresh (WDialog * h) { const int y = 3; const int x = 7 + GW * 2; @@ -178,7 +178,7 @@ next_file (void) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -chown_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +chown_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -193,7 +193,7 @@ chown_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *da /* --------------------------------------------------------------------------------------------- */ -static Dlg_head * +static WDialog * init_chown (void) { int lines, cols; @@ -201,7 +201,7 @@ init_chown (void) int y; struct passwd *l_pass; struct group *l_grp; - Dlg_head *ch_dlg; + WDialog *ch_dlg; do_refresh (); @@ -332,7 +332,7 @@ chown_cmd (void) { char *fname; struct stat sf_stat; - Dlg_head *ch_dlg; + WDialog *ch_dlg; uid_t new_user; gid_t new_group; char buffer[BUF_TINY]; diff --git a/src/filemanager/file.h b/src/filemanager/file.h index 35a72a4fd..83ab8be8f 100644 --- a/src/filemanager/file.h +++ b/src/filemanager/file.h @@ -26,7 +26,7 @@ typedef FileProgressStatus (*compute_dir_size_callback) (const void *ui, /* status dialog of directory size computing */ typedef struct { - Dlg_head *dlg; + WDialog *dlg; WLabel *dirname; } ComputeDirSizeUI; diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c index 5ad0454b4..cd4019f36 100644 --- a/src/filemanager/filegui.c +++ b/src/filemanager/filegui.c @@ -238,7 +238,7 @@ typedef struct gboolean showing_bps; /* Dialog and widgets for the operation progress window */ - Dlg_head *op_dlg; + WDialog *op_dlg; WLabel *file_string[2]; WLabel *file_label[2]; WGauge *progress_file_gauge; @@ -251,7 +251,7 @@ typedef struct WLabel *total_bytes_label; /* Query replace dialog */ - Dlg_head *replace_dlg; + WDialog *replace_dlg; const char *replace_filename; replace_action_t replace_result; diff --git a/src/filemanager/find.c b/src/filemanager/find.c index d7336633d..605677c1e 100644 --- a/src/filemanager/find.c +++ b/src/filemanager/find.c @@ -154,7 +154,7 @@ static int last_pos; static size_t ignore_count = 0; -static Dlg_head *find_dlg; /* The dialog */ +static WDialog *find_dlg; /* The dialog */ static WLabel *status_label; /* Finished, Searching etc. */ static WLabel *found_num_label; /* Number of found items */ @@ -407,7 +407,7 @@ find_check_regexp (const char *r) */ static cb_ret_t -find_parm_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +find_parm_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -985,7 +985,7 @@ get_line_at (int file_fd, char *buf, int buf_size, int *pos, int *n_read, gboole /* --------------------------------------------------------------------------------------------- */ static FindProgressStatus -check_find_events (Dlg_head * h) +check_find_events (WDialog * h) { Gpm_Event event; int c; @@ -1023,7 +1023,7 @@ check_find_events (Dlg_head * h) */ static gboolean -search_content (Dlg_head * h, const char *directory, const char *filename) +search_content (WDialog * h, const char *directory, const char *filename) { struct stat s; char buffer[BUF_4K]; @@ -1183,7 +1183,7 @@ find_ignore_dir_search (const char *dir) /* --------------------------------------------------------------------------------------------- */ static void -find_rotate_dash (const Dlg_head * h, gboolean finish) +find_rotate_dash (const WDialog * h, gboolean finish) { static const char rotating_dash[] = "|/-\\"; static unsigned int pos = 0; @@ -1203,7 +1203,7 @@ find_rotate_dash (const Dlg_head * h, gboolean finish) /* --------------------------------------------------------------------------------------------- */ static int -do_search (Dlg_head * h) +do_search (WDialog * h) { static struct dirent *dp = NULL; static DIR *dirp = NULL; @@ -1430,7 +1430,7 @@ view_edit_currently_selected_file (int unparsed_view, int edit) /* --------------------------------------------------------------------------------------------- */ static void -find_calc_button_locations (const Dlg_head * h, gboolean all_buttons) +find_calc_button_locations (const WDialog * h, gboolean all_buttons) { const int cols = WIDGET (h)->cols; @@ -1456,7 +1456,7 @@ find_calc_button_locations (const Dlg_head * h, gboolean all_buttons) /* --------------------------------------------------------------------------------------------- */ static void -find_relocate_buttons (const Dlg_head * h, gboolean all_buttons) +find_relocate_buttons (const WDialog * h, gboolean all_buttons) { size_t i; @@ -1469,7 +1469,7 @@ find_relocate_buttons (const Dlg_head * h, gboolean all_buttons) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -find_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +find_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c index 43ddb4544..15612f73c 100644 --- a/src/filemanager/hotlist.c +++ b/src/filemanager/hotlist.c @@ -163,7 +163,7 @@ struct hotlist static gboolean hotlist_has_dot_dot = TRUE; -static Dlg_head *hotlist_dlg, *movelist_dlg; +static WDialog *hotlist_dlg, *movelist_dlg; static WGroupbox *hotlist_group, *movelist_group; static WListbox *l_hotlist, *l_movelist; static WLabel *pname; @@ -489,7 +489,7 @@ hotlist_button_callback (WButton * button, int action) /* --------------------------------------------------------------------------------------------- */ static inline cb_ret_t -hotlist_handle_key (Dlg_head * h, int key) +hotlist_handle_key (WDialog * h, int key) { switch (key) { @@ -552,7 +552,7 @@ hotlist_handle_key (Dlg_head * h, int key) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -hotlist_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +hotlist_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -583,7 +583,7 @@ hotlist_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void * static lcback_ret_t hotlist_listbox_callback (WListbox * list) { - Dlg_head *dlg = WIDGET (list)->owner; + WDialog *dlg = WIDGET (list)->owner; if (list->count != 0) { diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index e38ba65d7..26bc3a315 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -222,7 +222,7 @@ check_split (panels_layout_t * layout) /* --------------------------------------------------------------------------------------------- */ static void -update_split (const Dlg_head * h) +update_split (const WDialog * h) { /* Check split has to be done before testing if it changed, since it can change due to calling check_split() as well */ @@ -308,7 +308,7 @@ bminus_cback (WButton * button, int action) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -layout_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +layout_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { @@ -428,10 +428,10 @@ layout_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *d /* --------------------------------------------------------------------------------------------- */ -static Dlg_head * +static WDialog * init_layout (void) { - Dlg_head *layout_dlg; + WDialog *layout_dlg; int l1 = 0, width; int b1, b2, b; size_t i; @@ -632,7 +632,7 @@ layout_change (void) void layout_box (void) { - Dlg_head *layout_dlg; + WDialog *layout_dlg; gboolean layout_do_change = FALSE; layout_dlg = init_layout (); @@ -1298,7 +1298,7 @@ do_load_prompt (void) return ret; /* Don't actually change the prompt if it's invisible */ - if (top_dlg != NULL && ((Dlg_head *) top_dlg->data == midnight_dlg) && command_prompt) + if (top_dlg != NULL && DIALOG (top_dlg->data) == midnight_dlg && command_prompt) { setup_cmdline (); diff --git a/src/filemanager/listmode.c b/src/filemanager/listmode.c index ded78c76e..0af584588 100644 --- a/src/filemanager/listmode.c +++ b/src/filemanager/listmode.c @@ -173,14 +173,14 @@ bremove_cback (int action) /* --------------------------------------------------------------------------------------------- */ -static Dlg_head * +static WDialog * init_listmode (char *oldlistformat) { int i; char *s; int format_width = 0; int format_columns = 0; - Dlg_head *listmode_dlg; + WDialog *listmode_dlg; static struct listmode_label listmode_labels[] = { {UY + 13, UX + 22, "Item width:"} @@ -271,7 +271,7 @@ init_listmode (char *oldlistformat) /* --------------------------------------------------------------------------------------------- */ static void -listmode_done (Dlg_head * h) +listmode_done (WDialog * h) { destroy_dlg (h); if (0) @@ -321,7 +321,7 @@ listmode_edit (char *oldlistformat) { char *newformat = NULL; char *s; - Dlg_head *listmode_dlg; + WDialog *listmode_dlg; s = g_strdup (oldlistformat); listmode_dlg = init_listmode (s); diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c index d52f595a7..3cedcdf81 100644 --- a/src/filemanager/midnight.c +++ b/src/filemanager/midnight.c @@ -142,7 +142,7 @@ stop_dialogs (void) midnight_dlg->state = DLG_CLOSED; if ((top_dlg != NULL) && (top_dlg->data != NULL)) - ((Dlg_head *) top_dlg->data)->state = DLG_CLOSED; + DIALOG (top_dlg->data)->state = DLG_CLOSED; } /* --------------------------------------------------------------------------------------------- */ @@ -432,7 +432,7 @@ midnight_get_shortcut (unsigned long command) /* --------------------------------------------------------------------------------------------- */ static char * -midnight_get_title (const Dlg_head * h, size_t len) +midnight_get_title (const WDialog * h, size_t len) { char *path; char *login; @@ -1401,7 +1401,7 @@ midnight_execute_cmd (Widget * sender, unsigned long command) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +midnight_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { unsigned long command; diff --git a/src/filemanager/option.c b/src/filemanager/option.c index d11e2e4e4..4e0818b04 100644 --- a/src/filemanager/option.c +++ b/src/filemanager/option.c @@ -62,7 +62,7 @@ unsigned long configure_old_esc_mode_id, configure_time_out_id; /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -configure_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +configure_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c index 42062a31a..1ff7461c7 100644 --- a/src/filemanager/panelize.c +++ b/src/filemanager/panelize.c @@ -73,7 +73,7 @@ /*** file scope variables ************************************************************************/ static WListbox *l_panelize; -static Dlg_head *panelize_dlg; +static WDialog *panelize_dlg; static int last_listitem; static WInput *pname; @@ -109,7 +109,7 @@ update_command (void) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -panelize_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +panelize_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c index 6608e6e2b..67b27a110 100644 --- a/src/filemanager/tree.c +++ b/src/filemanager/tree.c @@ -250,7 +250,7 @@ tree_show_mini_info (WTree * tree, int tree_lines, int tree_cols) else { /* Show full name of selected directory */ - Dlg_head *h = w->owner; + WDialog *h = w->owner; char *tmp_path; tty_setcolor (tree->is_panel ? NORMAL_COLOR : TREE_NORMALC (h)); @@ -268,7 +268,7 @@ static void show_tree (WTree * tree) { Widget *w = WIDGET (tree); - Dlg_head *h = w->owner; + WDialog *h = w->owner; tree_entry *current; int i, j, topsublevel; int x = 0, y = 0; @@ -1175,7 +1175,7 @@ tree_key (WTree * tree, int key) /* --------------------------------------------------------------------------------------------- */ static void -tree_frame (Dlg_head * h, WTree * tree) +tree_frame (WDialog * h, WTree * tree) { Widget *w = WIDGET (tree); @@ -1206,7 +1206,7 @@ static cb_ret_t tree_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) { WTree *tree = (WTree *) w; - Dlg_head *h = w->owner; + WDialog *h = w->owner; WButtonBar *b = find_buttonbar (h); switch (msg) @@ -1333,7 +1333,7 @@ sync_tree (const char *path) /* --------------------------------------------------------------------------------------------- */ WTree * -find_tree (struct Dlg_head *h) +find_tree (struct WDialog *h) { return (WTree *) find_widget_type (h, tree_callback); } diff --git a/src/filemanager/tree.h b/src/filemanager/tree.h index a8c4f5016..ea4191019 100644 --- a/src/filemanager/tree.h +++ b/src/filemanager/tree.h @@ -20,7 +20,7 @@ typedef struct WTree WTree; extern WTree *the_tree; extern int xtree_mode; -struct Dlg_head; +struct WDialog; /*** declarations of public functions ************************************************************/ @@ -31,7 +31,7 @@ vfs_path_t *tree_selected_name (const WTree * tree); void sync_tree (const char *pathname); -WTree *find_tree (struct Dlg_head *h); +WTree *find_tree (struct WDialog *h); /*** inline functions ****************************************************************************/ #endif /* MC__TREE_H */ diff --git a/src/help.c b/src/help.c index 38d5e3f9e..a93ab2770 100644 --- a/src/help.c +++ b/src/help.c @@ -104,7 +104,7 @@ static const char *currentpoint; static const char *selected_item; /* The widget variables */ -static Dlg_head *whelp; +static WDialog *whelp; static struct { @@ -115,7 +115,7 @@ static struct static GSList *link_area = NULL; static gboolean inside_link_area = FALSE; -static cb_ret_t help_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data); +static cb_ret_t help_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data); /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -403,7 +403,7 @@ clear_link_areas (void) /* --------------------------------------------------------------------------------------------- */ static void -help_print_word (Dlg_head * h, GString * word, int *col, int *line, gboolean add_space) +help_print_word (WDialog * h, GString * word, int *col, int *line, gboolean add_space) { if (*line >= help_lines) g_string_set_size (word, 0); @@ -447,7 +447,7 @@ help_print_word (Dlg_head * h, GString * word, int *col, int *line, gboolean add /* --------------------------------------------------------------------------------------------- */ static void -help_show (Dlg_head * h, const char *paint_start) +help_show (WDialog * h, const char *paint_start) { const char *p, *n; int col, line, c; @@ -684,7 +684,7 @@ help_event (Gpm_Event * event, void *vp) /** show help */ static void -help_help (Dlg_head * h) +help_help (WDialog * h) { const char *p; @@ -704,7 +704,7 @@ help_help (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ static void -help_index (Dlg_head * h) +help_index (WDialog * h) { const char *new_item; @@ -727,7 +727,7 @@ help_index (Dlg_head * h) /* --------------------------------------------------------------------------------------------- */ static void -help_back (Dlg_head * h) +help_back (WDialog * h) { currentpoint = history[history_ptr].page; selected_item = history[history_ptr].link; @@ -926,7 +926,7 @@ help_execute_cmd (unsigned long command) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -help_handle_key (Dlg_head * h, int c) +help_handle_key (WDialog * h, int c) { unsigned long command; @@ -941,7 +941,7 @@ help_handle_key (Dlg_head * h, int c) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -help_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +help_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { WButtonBar *bb; diff --git a/src/learn.c b/src/learn.c index 05891914b..c867263b9 100644 --- a/src/learn.c +++ b/src/learn.c @@ -68,7 +68,7 @@ typedef struct /*** file scope variables ************************************************************************/ -static Dlg_head *learn_dlg; +static WDialog *learn_dlg; static const char *learn_title = N_("Learn keys"); static learnkey_t *learnkeys = NULL; @@ -82,7 +82,7 @@ static gboolean learnchanged = FALSE; static int learn_button (WButton * button, int action) { - Dlg_head *d; + WDialog *d; char *seq; (void) button; @@ -232,7 +232,7 @@ learn_check_key (int c) /* --------------------------------------------------------------------------------------------- */ static cb_ret_t -learn_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +learn_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { switch (msg) { diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index f04cb0f3a..e30fd6920 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -551,7 +551,7 @@ mcview_handle_key (mcview_t * view, int key) /* --------------------------------------------------------------------------------------------- */ static inline void -mcview_adjust_size (Dlg_head * h) +mcview_adjust_size (WDialog * h) { mcview_t *view; WButtonBar *b; @@ -633,7 +633,7 @@ mcview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void * /* --------------------------------------------------------------------------------------------- */ cb_ret_t -mcview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data) +mcview_dialog_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data) { mcview_t *view; diff --git a/src/viewer/display.c b/src/viewer/display.c index 69cb61406..41606c52f 100644 --- a/src/viewer/display.c +++ b/src/viewer/display.c @@ -80,7 +80,7 @@ static enum ruler_type static void mcview_set_buttonbar (mcview_t * view) { - Dlg_head *h = WIDGET (view)->owner; + WDialog *h = WIDGET (view)->owner; WButtonBar *b = find_buttonbar (h); const global_keymap_t *keymap = view->hex_mode ? viewer_hex_map : viewer_map; diff --git a/src/viewer/internal.h b/src/viewer/internal.h index 1e7a4b5b2..f4b010cdf 100644 --- a/src/viewer/internal.h +++ b/src/viewer/internal.h @@ -215,7 +215,7 @@ extern mcview_search_options_t mcview_search_options; /* actions_cmd.c: */ cb_ret_t mcview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data); -cb_ret_t mcview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data); +cb_ret_t mcview_dialog_callback (WDialog * h, Widget * sender, dlg_msg_t msg, int parm, void *data); /* coord_cache.c: */ coord_cache_t *coord_cache_new (void); @@ -287,7 +287,7 @@ void mcview_set_codeset (mcview_t * view); void mcview_show_error (mcview_t * view, const char *error); off_t mcview_bol (mcview_t * view, off_t current, off_t limit); off_t mcview_eol (mcview_t * view, off_t current, off_t limit); -char *mcview_get_title (const Dlg_head * h, size_t len); +char *mcview_get_title (const WDialog * h, size_t len); /* move.c */ void mcview_move_up (mcview_t *, off_t); diff --git a/src/viewer/lib.c b/src/viewer/lib.c index 375a88cfd..c98671236 100644 --- a/src/viewer/lib.c +++ b/src/viewer/lib.c @@ -433,7 +433,7 @@ mcview_eol (mcview_t * view, off_t current, off_t limit) /* --------------------------------------------------------------------------------------------- */ char * -mcview_get_title (const Dlg_head * h, size_t len) +mcview_get_title (const WDialog * h, size_t len) { const mcview_t *view = (const mcview_t *) find_widget_type (h, mcview_callback); const char *modified = view->hexedit_mode && (view->change_list != NULL) ? "(*) " : " "; diff --git a/src/viewer/mcviewer.c b/src/viewer/mcviewer.c index 95d39c107..93908f3ea 100644 --- a/src/viewer/mcviewer.c +++ b/src/viewer/mcviewer.c @@ -234,7 +234,7 @@ mcview_viewer (const char *command, const vfs_path_t * file_vpath, int start_lin { gboolean succeeded; mcview_t *lc_mcview; - Dlg_head *view_dlg; + WDialog *view_dlg; /* Create dialog and widgets, put them on the dialog */ view_dlg = create_dlg (FALSE, 0, 0, LINES, COLS, NULL, mcview_dialog_callback, NULL, diff --git a/src/viewer/search.c b/src/viewer/search.c index 9d760fe5a..b1cde90fd 100644 --- a/src/viewer/search.c +++ b/src/viewer/search.c @@ -117,7 +117,7 @@ mcview_find (mcview_t * view, gsize search_start, gsize * len) /* --------------------------------------------------------------------------------------------- */ static void -mcview_search_show_result (mcview_t * view, Dlg_head ** d, size_t match_len) +mcview_search_show_result (mcview_t * view, WDialog ** d, size_t match_len) { int nroff_len; @@ -244,7 +244,7 @@ mcview_do_search (mcview_t * view) gboolean isFound = FALSE; gboolean need_search_again = TRUE; - Dlg_head *d = NULL; + WDialog *d = NULL; size_t match_len;