]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-scr.h
ui/ncurses: in lockdown ensure system reboot in ncurses menu exit
[petitboot] / ui / ncurses / nc-scr.h
index a8aa314cfa86bec9a2108d2c22f1aa8b140c13e0..5671a6b7b71f4ec43d093b7ac130afd29538ac48 100644 (file)
 #  error "Curses header file not found."
 #endif
 
-#ifdef DEBUG
-#define DBG(fmt, args...) pb_log("DBG: " fmt, ## args)
+#define DBG(fmt, args...) pb_debug("DBG: " fmt, ## args)
 #define DBGS(fmt, args...) \
-       pb_log("DBG:%s:%d: " fmt, __func__, __LINE__, ## args)
-#else
-#define DBG(fmt, args...)
-#define DBGS(fmt, args...)
-#endif
+       pb_debug("DBG:%s:%d: " fmt, __func__, __LINE__, ## args)
 
 
 enum pb_nc_sig {
-       pb_cui_sig         = 111,
-       pb_pmenu_sig       = 222,
-       pb_item_sig        = 333,
-       pb_boot_editor_sig = 444,
-       pb_removed_sig     = -555,
+       pb_cui_sig              = 111,
+       pb_pmenu_sig            = 222,
+       pb_item_sig             = 333,
+       pb_boot_editor_sig      = 444,
+       pb_text_screen_sig      = 555,
+       pb_config_screen_sig    = 666,
+       pb_lang_screen_sig      = 777,
+       pb_add_url_screen_sig   = 888,
+       pb_subset_screen_sig    = 101,
+       pb_plugin_screen_sig    = 202,
+       pb_removed_sig          = -999,
 };
 
-void nc_start(void);
-void nc_atexit(void);
-
 static inline void nc_flush_keys(void)
 {
        while (getch() != ERR)
@@ -64,6 +62,7 @@ static inline void nc_flush_keys(void)
 enum nc_scr_pos {
        nc_scr_pos_title = 0,
        nc_scr_pos_title_sep = 1,
+       nc_scr_pos_lrtitle_space = 2,
        nc_scr_pos_sub = 2,
 
        nc_scr_pos_help_sep = 3,
@@ -71,10 +70,12 @@ enum nc_scr_pos {
        nc_scr_pos_status = 1,
 
        nc_scr_frame_lines = 5,
+       nc_scr_frame_cols = 1,
 };
 
 struct nc_frame {
-       char *title;
+       char *ltitle;
+       char *rtitle;
        char *help;
        char *status;
 };
@@ -101,4 +102,7 @@ void nc_scr_status_free(struct nc_scr *scr);
 void nc_scr_status_printf(struct nc_scr *scr, const char *format, ...);
 void nc_scr_frame_draw(struct nc_scr *scr);
 
+int nc_scr_post(struct nc_scr *src);
+int nc_scr_unpost(struct nc_scr *src);
+
 #endif