diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-07-27 16:10:27 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.ravnborg.org> | 2006-09-30 05:19:19 -0400 |
commit | 2982de6993e6d9944f2215d7cb9b558b465a0c99 (patch) | |
tree | 3b4765905e7c53e2a03ed599692d2636623e22a5 /scripts/kconfig/lxdialog/dialog.h | |
parent | 350b5b76384e77bcc58217f00455fdbec5cac594 (diff) |
kconfig/menuconfig: lxdialog is now built-in
lxdialog was previously called as an external program causing screen
to flicker when used. With this patch lxdialog is now built-in.
It is loosly based om previous work by: Petr Baudis <pasky@ucw.cz>
Following is a list of changes:
o Moved build of dialog routings to kconfig Makefile
o menubox + checklist uses a new item list to hold all menu items
o in util.c implmented helper function to deal with item list
o menubox now uses parameters to save scroll state (avoids temp file)
o textbox now get text to be displayed as parameter and not a file
o make sure to properly delete subwin's before main windows
o killed unused files: lxdialog.c msgbox.c
o modified return value for ESC to match direct calling
o in a few places the code has been adjusted to 80 char wide
o in textbox a small refactoring was made to make code remotely readable
o in mconf removed all unused stuff (functions/variables)
Following is a list of know short comings:
a) pressing ESC twice will be interpreted as two ESC presses
b) resize does not work. menuconfig needs to be restarted to be adjusted
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lxdialog/dialog.h')
-rw-r--r-- | scripts/kconfig/lxdialog/dialog.h | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h index 2f4c19d710b2..065ded0a449f 100644 --- a/scripts/kconfig/lxdialog/dialog.h +++ b/scripts/kconfig/lxdialog/dialog.h | |||
@@ -133,11 +133,55 @@ struct dialog_info { | |||
133 | * Global variables | 133 | * Global variables |
134 | */ | 134 | */ |
135 | extern struct dialog_info dlg; | 135 | extern struct dialog_info dlg; |
136 | extern char dialog_input_result[]; | ||
136 | 137 | ||
137 | /* | 138 | /* |
138 | * Function prototypes | 139 | * Function prototypes |
139 | */ | 140 | */ |
140 | void init_dialog(void); | 141 | |
142 | /* item list as used by checklist and menubox */ | ||
143 | void item_reset(void); | ||
144 | void item_make(const char *fmt, ...); | ||
145 | void item_add_str(const char *fmt, ...); | ||
146 | void item_set_tag(char tag); | ||
147 | void item_set_data(void *p); | ||
148 | void item_set_selected(int val); | ||
149 | int item_activate_selected(void); | ||
150 | void *item_data(void); | ||
151 | char item_tag(void); | ||
152 | |||
153 | /* item list manipulation for lxdialog use */ | ||
154 | #define MAXITEMSTR 200 | ||
155 | struct dialog_item { | ||
156 | char str[MAXITEMSTR]; /* promtp displayed */ | ||
157 | char tag; | ||
158 | void *data; /* pointer to menu item - used by menubox+checklist */ | ||
159 | int selected; /* Set to 1 by dialog_*() function if selected. */ | ||
160 | }; | ||
161 | |||
162 | /* list of lialog_items */ | ||
163 | struct dialog_list { | ||
164 | struct dialog_item node; | ||
165 | struct dialog_list *next; | ||
166 | }; | ||
167 | |||
168 | extern struct dialog_list *item_cur; | ||
169 | extern struct dialog_list item_nil; | ||
170 | extern struct dialog_list *item_head; | ||
171 | |||
172 | int item_count(void); | ||
173 | void item_set(int n); | ||
174 | int item_n(void); | ||
175 | const char *item_str(void); | ||
176 | int item_is_selected(void); | ||
177 | int item_is_tag(char tag); | ||
178 | #define item_foreach() \ | ||
179 | for (item_cur = item_head ? item_head: item_cur; \ | ||
180 | item_cur && (item_cur != &item_nil); item_cur = item_cur->next) | ||
181 | |||
182 | |||
183 | void init_dialog(const char *backtitle); | ||
184 | void reset_dialog(void); | ||
141 | void end_dialog(void); | 185 | void end_dialog(void); |
142 | void attr_clear(WINDOW * win, int height, int width, chtype attr); | 186 | void attr_clear(WINDOW * win, int height, int width, chtype attr); |
143 | void dialog_clear(void); | 187 | void dialog_clear(void); |
@@ -154,11 +198,9 @@ int dialog_msgbox(const char *title, const char *prompt, int height, | |||
154 | int width, int pause); | 198 | int width, int pause); |
155 | int dialog_textbox(const char *title, const char *file, int height, int width); | 199 | int dialog_textbox(const char *title, const char *file, int height, int width); |
156 | int dialog_menu(const char *title, const char *prompt, int height, int width, | 200 | int dialog_menu(const char *title, const char *prompt, int height, int width, |
157 | int menu_height, const char *choice, int item_no, | 201 | int menu_height, const void *selected, int *s_scroll); |
158 | const char *const *items); | ||
159 | int dialog_checklist(const char *title, const char *prompt, int height, | 202 | int dialog_checklist(const char *title, const char *prompt, int height, |
160 | int width, int list_height, int item_no, | 203 | int width, int list_height); |
161 | const char *const *items); | ||
162 | extern char dialog_input_result[]; | 204 | extern char dialog_input_result[]; |
163 | int dialog_inputbox(const char *title, const char *prompt, int height, | 205 | int dialog_inputbox(const char *title, const char *prompt, int height, |
164 | int width, const char *init); | 206 | int width, const char *init); |