diff --git a/edit/editcmd.c b/edit/editcmd.c index 75bf521e3..2aa8948b5 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -2719,13 +2719,6 @@ edit_collect_completions (WEdit *edit, long start, int word_len, } -static int -compllist_callback (void *data) -{ - return 0; -} - - /* let the user select its preferred completion */ static void edit_completion_dialog (WEdit *edit, int max_len, int word_len, @@ -2766,8 +2759,7 @@ edit_completion_dialog (WEdit *edit, int max_len, int word_len, /* create the listbox */ compl_list = - listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0, - compllist_callback); + listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0, NULL); /* add the dialog */ add_widget (compl_dlg, compl_list); diff --git a/src/ChangeLog b/src/ChangeLog index 23a9f888a..4995e02de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2003-09-01 Pavel Roskin + * widget.h: Use exact type in the listbox callback. Adjust all + legitimate users, remove all unused callbacks. + * boxes.c: Fix GUI code for some non-default configurations. * listmode.c: Likewise. diff --git a/src/achown.c b/src/achown.c index 48a546a57..0d211ae92 100644 --- a/src/achown.c +++ b/src/achown.c @@ -217,11 +217,6 @@ static void update_mode (Dlg_head * h) send_message (h->current->widget, WIDGET_FOCUS, 0); } -static int l_call (void *data) -{ - return 1; -} - static int chl_callback (Dlg_head * h, int Par, int Msg) { switch (Msg) { @@ -265,7 +260,7 @@ do_enter_key (Dlg_head * h, int f_pos) "[Advanced Chown]", title, DLG_COMPACT); /* get new listboxes */ - chl_list = listbox_new (1, 1, 15, 11, 0, l_call); + chl_list = listbox_new (1, 1, 15, 11, 0, NULL); listbox_add_item (chl_list, 0, 0, "", NULL); diff --git a/src/chown.c b/src/chown.c index fee56bf58..07f9b6c50 100644 --- a/src/chown.c +++ b/src/chown.c @@ -141,12 +141,6 @@ chown_callback (Dlg_head * h, int Par, int Msg) return 0; } -static int -l_call (void *data) -{ - return 1; -} - static Dlg_head * init_chown (void) { @@ -177,8 +171,8 @@ init_chown (void) } /* get new listboxes */ - l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, l_call); - l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, l_call); + l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, NULL); + l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, NULL); /* add fields for unknown names (numbers) */ listbox_add_item (l_user, 0, 0, _(""), NULL); diff --git a/src/complete.c b/src/complete.c index 8ee5a3587..939c42b45 100644 --- a/src/complete.c +++ b/src/complete.c @@ -909,11 +909,6 @@ query_callback (Dlg_head * h, int Par, int Msg) return 0; } -static int querylist_callback (void *data) -{ - return 1; -} - #define DO_INSERTION 1 #define DO_QUERY 2 /* Returns 1 if the user would like to see us again */ @@ -985,7 +980,7 @@ complete_engine (WInput *in, int what_to_do) query_dlg = create_dlg (y, x, query_height, query_width, dialog_colors, query_callback, "[Completion]", NULL, DLG_COMPACT); - query_list = listbox_new (1, 1, w - 2, h - 2, 0, querylist_callback); + query_list = listbox_new (1, 1, w - 2, h - 2, 0, NULL); add_widget (query_dlg, query_list); for (p = in->completions + 1; *p; p++) listbox_add_item (query_list, 0, 0, *p, NULL); diff --git a/src/hotlist.c b/src/hotlist.c index 74dc2fc03..d8edc8fe6 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -476,9 +476,8 @@ l1: return 0; } -static int l_call (void *l) +static int l_call (WListbox *list) { - WListbox *list = (WListbox *) l; Dlg_head *dlg = hotlist_state.moving ? movelist_dlg : hotlist_dlg; if (list->current){ diff --git a/src/listmode.c b/src/listmode.c index 29662de79..06a939120 100644 --- a/src/listmode.c +++ b/src/listmode.c @@ -147,12 +147,6 @@ listmode_callback (Dlg_head * h, int Par, int Msg) return 0; } -static int -l_call (void *data) -{ - return 1; -} - static Dlg_head * init_listmode (char *oldlistformat) { @@ -198,7 +192,7 @@ init_listmode (char *oldlistformat) radio_justify->sel = 1; /* get new listbox */ - l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, l_call); + l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, NULL); if (strncmp (oldlistformat, "full ", 5) == 0) { format_width = 1; diff --git a/src/panelize.c b/src/panelize.c index 807c7c382..2f222c274 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -113,11 +113,6 @@ panelize_callback (Dlg_head * h, int Par, int Msg) return 0; } -static int l_call (void *data) -{ - return listbox_nothing; -} - static void init_panelize (void) { @@ -171,13 +166,11 @@ init_panelize (void) "in"); add_widget (panelize_dlg, pname); - add_widget (panelize_dlg, - label_new (UY + 13, UX, _("Command"))); + add_widget (panelize_dlg, label_new (UY + 13, UX, _("Command"))); /* get new listbox */ l_panelize = - listbox_new (UY + 1, UX + 1, panelize_dlg->cols - 12, 10, 0, - l_call); + listbox_new (UY + 1, UX + 1, panelize_dlg->cols - 12, 10, 0, NULL); while (current) { listbox_add_item (l_panelize, 0, 0, current->label, current); diff --git a/src/widget.h b/src/widget.h index 5e51f32a1..f827437c1 100644 --- a/src/widget.h +++ b/src/widget.h @@ -91,10 +91,6 @@ typedef struct WLEntry { struct WLEntry *prev; } WLEntry; -enum { - listbox_begin, listbox_end -} /* listbox_insert */; - /* Listbox actions when selecting an option: */ enum { listbox_nothing, @@ -102,9 +98,11 @@ enum { listbox_cback /* call the callback routine */ } /* listbox_action */; -typedef int (*lcback) (void *); +struct WListbox; +typedef struct WListbox WListbox; +typedef int (*lcback) (WListbox *); -typedef struct WListbox { +struct WListbox { Widget widget; WLEntry *list; /* Pointer to the circular double linked list. */ WLEntry *top; /* The first element displayed */ @@ -118,7 +116,7 @@ typedef struct WListbox { int scrollbar; /* Draw a scrollbar? */ lcback cback; /* The callback function */ int cursor_x, cursor_y; /* Cache the values */ -} WListbox; +}; typedef void (*buttonbarfn)(void *);