aboutsummaryrefslogtreecommitdiffstats
path: root/channels/console_board.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-09 18:03:40 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-09 18:03:40 +0000
commitea322dd14cd064209debd16d936745505986c4f9 (patch)
tree4c324133204ebe77aac52774c2f7c47129695ff0 /channels/console_board.c
parentbf8028a2c8013348216ed1a1426a3fd8fab01398 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@97530 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/console_board.c')
-rw-r--r--channels/console_board.c13
1 files changed, 11 insertions, 2 deletions
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 <SDL/SDL.h>
-#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)
{