From cdf6974dea21a4678e2e7afd27292a7a4f37ab20 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Wed, 9 Jan 2008 18:03:40 +0000 Subject: Two changes: - support scrolling of message window; - simplify the code for creating a message window, and try it using a second one in the top of the keypad (where we echo the dialed number). The 'skin' that supports these two windows will be committed separately. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97530 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/console_board.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'channels/console_board.c') diff --git a/channels/console_board.c b/channels/console_board.c index 9c913f8a3..f8805affe 100644 --- a/channels/console_board.c +++ b/channels/console_board.c @@ -44,8 +44,6 @@ #ifdef HAVE_SDL /* we only use this code if SDL is available */ #include -#define GUI_BUFFER_LEN 256 /* buffer lenght used for input buffers */ - /* Fonts characterization. XXX should be read from the file */ #define FONT_H 20 /* char height, pixels */ #define FONT_W 9 /* char width, pixels */ @@ -196,6 +194,17 @@ static void render_board(struct board *b) SDL_UpdateRects(b->screen, 1, b->p_rect); /* Update the screen */ } +void move_message_board(struct board *b, int dy) +{ + int cur = b->cur_line + dy; + if (cur < 0) + cur = 0; + else if (cur >= b->v_h - b->p_h) + cur = b->v_h - b->p_h - 1; + b->cur_line = cur; + render_board(b); +} + /* return the content of a board */ const char *read_message(const struct board *b) { -- cgit v1.2.3