From b301b089be6e59da46216ce33451063a81e54206 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 15 Jun 2011 15:45:12 +0200 Subject: Encapsulate the display (6) Let's create some ops to be registered by the pm blocks to the display. Signed-off-by: Daniel Lezcano --- display.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'display.c') diff --git a/display.c b/display.c index 384714b..d55d748 100644 --- a/display.c +++ b/display.c @@ -49,6 +49,7 @@ struct rowdata { struct windata { WINDOW *win; WINDOW *pad; + struct display_ops *ops; struct rowdata *rowdata; char *name; int nrdata; @@ -207,6 +208,16 @@ void print_sensor_header(void) show_header_footer(SENSOR); } +int display_register(int win, struct display_ops *ops) +{ + if (win < 0 || win >= TOTAL_FEATURE_WINS) + return -1; + + windata[win].ops = ops; + + return 0; +} + int display_next_panel(void) { current_win++; -- cgit v1.2.3