]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-boot-editor.h
ui/ncurses: Interpret left/right keys as up/down
[petitboot] / ui / ncurses / nc-boot-editor.h
index ee6d0469eb2f9f49d58837c0b6b1bf91038977ba..5c22598ba7f544f94736458bb804854f7e1d9dd9 100644 (file)
 #if !defined(_PB_NC_KED_H)
 #define _PB_NC_KED_H
 
-#include <linux/input.h> /* This must be included before ncurses.h */
-#if defined HAVE_NCURSESW_FORM_H
-#  include <ncursesw/form.h>
-#elif defined HAVE_NCURSES_FORM_H
-#  include <ncurses/form.h>
-#elif defined HAVE_FORM_H
-#  include <form.h>
-#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,
-};
+#include "nc-cui.h"
 
-enum boot_editor_attr_cursor {
-       boot_editor_attr_cursor_ins = A_NORMAL,
-       boot_editor_attr_cursor_ovl = A_NORMAL | A_UNDERLINE,
-};
+struct boot_editor;
 
-/**
- * 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.
- */
+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));
 
-enum boot_editor_result {
-       boot_editor_cancel,
-       boot_editor_update,
-};
-
-/**
- * struct boot_editor - kexec args editor.
- */
+struct nc_scr *boot_editor_scr(struct boot_editor *boot_editor);
 
-struct boot_editor {
-       struct nc_scr   scr;
-       FORM            *ncf;
-       FIELD           **fields;
-       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;
-};
+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