diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-02-27 14:15:34 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-15 14:54:21 +0800 |
commit | 6eb39a03bf66d91c37ca5d14dd61a90850a921d3 (patch) | |
tree | a416a0ef8fd7c1f6338481eedf3dd04e8236bad3 /ui/ncurses/nc-boot-editor.h | |
parent | e3ebf4d2ebe3464257655f059ea020565a536643 (diff) | |
download | talos-petitboot-6eb39a03bf66d91c37ca5d14dd61a90850a921d3.tar.gz talos-petitboot-6eb39a03bf66d91c37ca5d14dd61a90850a921d3.zip |
ui/ncurses: ked -> boot-editor
git mv ui/ncurses/nc-ked.c ui/ncurses/nc-boot-editor.c
git mv ui/ncurses/nc-ked.h ui/ncurses/nc-boot-editor.h
find ui/ncurses -type f |
xargs sed -i -e s/nc-ked\./nc-boot-editor./g \
-e s/ked/boot_editor/g
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-boot-editor.h')
-rw-r--r-- | ui/ncurses/nc-boot-editor.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/ui/ncurses/nc-boot-editor.h b/ui/ncurses/nc-boot-editor.h new file mode 100644 index 0000000..650c316 --- /dev/null +++ b/ui/ncurses/nc-boot-editor.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2009 Sony Computer Entertainment Inc. + * Copyright 2009 Sony Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#if !defined(_PB_NC_KED_H) +#define _PB_NC_KED_H + +#include <assert.h> +#include <linux/input.h> /* This must be included before ncurses.h */ +#include <form.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, +}; + +/** + * 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 - kexec args editor. + */ + +struct boot_editor { + struct nc_scr scr; + FORM *ncf; + FIELD **fields; + enum boot_editor_attr_cursor attr_cursor; + void (*on_exit)(struct boot_editor *boot_editor, + enum boot_editor_result result, + struct pb_kexec_data *kd); +}; + +struct boot_editor *boot_editor_init(void *ui_ctx, + const struct pb_kexec_data *kd, + void (*on_exit)(struct boot_editor *, + enum boot_editor_result, + struct pb_kexec_data *)); + +#endif |