X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Fncurses%2Fnc-boot-editor.h;h=5c22598ba7f544f94736458bb804854f7e1d9dd9;hp=7aa715e86f7a71780663970d1bfb6ed8e9e94e9e;hb=37bff93c8b0a71432613f41f2319dc073ca64619;hpb=3b8b270bd7a54a9ba7506d9eec1901c6f3027ebf diff --git a/ui/ncurses/nc-boot-editor.h b/ui/ncurses/nc-boot-editor.h index 7aa715e..5c22598 100644 --- a/ui/ncurses/nc-boot-editor.h +++ b/ui/ncurses/nc-boot-editor.h @@ -19,74 +19,24 @@ #if !defined(_PB_NC_KED_H) #define _PB_NC_KED_H -#include /* This must be included before ncurses.h */ -#if defined HAVE_NCURSESW_FORM_H -# include -#elif defined HAVE_NCURSES_FORM_H -# include -#elif defined HAVE_FORM_H -# include -#else -# error "Curses form.h not found." -#endif +#include "ui/common/discover-client.h" #include "types/types.h" -#include "ui/common/ui-system.h" -#include "nc-scr.h" - -enum boot_editor_attr_field { - boot_editor_attr_field_normal = A_NORMAL, - boot_editor_attr_field_selected = A_REVERSE, -}; - -enum boot_editor_attr_cursor { - boot_editor_attr_cursor_ins = A_NORMAL, - boot_editor_attr_cursor_ovl = A_NORMAL | A_UNDERLINE, -}; +#include "nc-cui.h" -/** - * enum boot_editor_result - Result code for boot_editor:on_exit(). - * @boot_editor_cancel: The user canceled the operation. - * @boot_editor_update: The args were updated. - */ - -enum boot_editor_result { - boot_editor_cancel, - boot_editor_update, -}; +struct boot_editor; -/** - * struct boot_editor - kexec args editor. - */ +struct boot_editor *boot_editor_init(struct cui *cui, + struct pmenu_item *item, + const struct system_info *sysinfo, + void (*on_exit)(struct cui *cui, + struct pmenu_item *item, + struct pb_boot_data *bd)); -struct boot_editor { - struct nc_scr scr; - void *data; - struct pmenu *original_pmenu; - void (*on_exit)(struct boot_editor *boot_editor, - enum boot_editor_result result, - struct pb_boot_data *bd); - enum boot_editor_attr_cursor attr_cursor; +struct nc_scr *boot_editor_scr(struct boot_editor *boot_editor); - struct nc_widgetset *widgetset; - struct { - struct nc_widget_label *image_l; - struct nc_widget_textbox *image_f; - struct nc_widget_label *initrd_l; - struct nc_widget_textbox *initrd_f; - struct nc_widget_label *dtb_l; - struct nc_widget_textbox *dtb_f; - struct nc_widget_label *args_l; - struct nc_widget_textbox *args_f; - struct nc_widget_button *ok_b; - struct nc_widget_button *cancel_b; - } widgets; -}; +void boot_editor_update(struct boot_editor *boot_editor, + const struct system_info *info); -struct boot_editor *boot_editor_init(struct pmenu *menu, - const struct pb_boot_data *bd, - void (*on_exit)(struct boot_editor *, - enum boot_editor_result, - struct pb_boot_data *)); #endif