2 * Copyright (C) 2009 Sony Computer Entertainment Inc.
3 * Copyright 2009 Sony Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #if !defined(_PB_NC_SCR_H)
22 #include <linux/input.h> /* This must be included before ncurses.h */
25 #define DBG(fmt, args...) pb_log("DBG: " fmt, ## args)
26 #define DBGS(fmt, args...) \
27 pb_log("DBG:%s:%d: " fmt, __func__, __LINE__, ## args)
34 pb_removed_sig = -555,
40 static inline void nc_flush_keys(void)
42 while (getch() != ERR)
48 nc_scr_pos_title_sep = 1,
51 nc_scr_pos_help_sep = 3,
53 nc_scr_pos_status = 1,
55 nc_scr_frame_lines = 5,
66 struct nc_frame frame;
70 int (*post)(struct nc_scr *scr);
71 int (*unpost)(struct nc_scr *scr);
72 void (*process_key)(struct nc_scr *scr);
73 void (*resize)(struct nc_scr *scr);
76 int nc_scr_init(struct nc_scr *scr, enum pb_nc_sig sig, int begin_x,
78 void (*process_key)(struct nc_scr *),
79 int (*post)(struct nc_scr *),
80 int (*unpost)(struct nc_scr *),
81 void (*resize)(struct nc_scr *));
82 void nc_scr_status_free(struct nc_scr *scr);
83 void nc_scr_status_printf(struct nc_scr *scr, const char *format, ...);
84 void nc_scr_frame_draw(struct nc_scr *scr);