forked from len0rd/rockbox
Horizontal screen scrolling part 3 (by Shachar Liberman)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8414 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bfe740712a
commit
d3a03b679f
10 changed files with 191 additions and 197 deletions
172
apps/gui/list.c
172
apps/gui/list.c
|
@ -37,8 +37,13 @@
|
|||
#define SCROLL_LIMIT 2
|
||||
#endif
|
||||
|
||||
static int offset_step = 15;
|
||||
static bool offset_outof_view = false;
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
static int offset_step = 16; /* pixels per screen scroll step */
|
||||
/* should lines scroll out of the screen */
|
||||
static bool offset_out_of_view = false;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void gui_list_init(struct gui_list * gui_list,
|
||||
list_get_name callback_get_item_name,
|
||||
|
@ -54,7 +59,9 @@ void gui_list_init(struct gui_list * gui_list,
|
|||
gui_list->limit_scroll = false;
|
||||
gui_list->data=data;
|
||||
gui_list->cursor_flash_state=false;
|
||||
gui_list->offsetval = 0;
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
gui_list->offset_position = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void gui_list_set_display(struct gui_list * gui_list, struct screen * display)
|
||||
|
@ -181,47 +188,43 @@ void gui_list_draw(struct gui_list * gui_list)
|
|||
entry_name = gui_list->callback_get_item_name(current_item,
|
||||
gui_list->data,
|
||||
entry_buffer);
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
/* position the string at the right offset place */
|
||||
int item_offset;
|
||||
int str_width,h;
|
||||
display->getstringsize(entry_name, &str_width, &h);
|
||||
/* position the string at the correct offset place */
|
||||
int item_offset;
|
||||
int item_width,h;
|
||||
display->getstringsize(entry_name, &item_width, &h);
|
||||
|
||||
if (offset_outof_view)
|
||||
item_offset = gui_list->offsetval;
|
||||
else
|
||||
/* if text is smaller then view */
|
||||
if (str_width <= display->width - text_pos)
|
||||
item_offset = 0;
|
||||
if (offset_out_of_view)
|
||||
item_offset = gui_list->offset_position;
|
||||
else
|
||||
/* if text got out of view */
|
||||
if (gui_list->offsetval > str_width - (display->width - text_pos))
|
||||
item_offset = str_width - (display->width - text_pos);
|
||||
/* if text is smaller then view */
|
||||
if (item_width <= display->width - text_pos)
|
||||
item_offset = 0;
|
||||
else
|
||||
item_offset = gui_list->offsetval;
|
||||
|
||||
#endif
|
||||
/* if text got out of view */
|
||||
if (gui_list->offset_position >
|
||||
item_width - (display->width - text_pos))
|
||||
item_offset = item_width - (display->width - text_pos);
|
||||
else
|
||||
item_offset = gui_list->offset_position;
|
||||
|
||||
#endif
|
||||
if(current_item == gui_list->selected_item) {
|
||||
/* The selected item must be displayed scrolling */
|
||||
/* The selected item must be displayed scrolling */
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
if (global_settings.invert_cursor) /* Display inverted-line-style*/
|
||||
|
||||
if (global_settings.invert_cursor)/* Display inverted-line-style*/
|
||||
/* if text got out of view */
|
||||
if (item_offset > str_width - (display->width - text_pos))
|
||||
if (item_offset > item_width - (display->width - text_pos))
|
||||
/* don't scroll */
|
||||
display->puts_style_offset(0, i, entry_name, STYLE_INVERT,item_offset);
|
||||
else
|
||||
display->puts_scroll_style_offset(0, i, entry_name, STYLE_INVERT,item_offset);
|
||||
|
||||
else /* if (global_settings.invert_cursor) */
|
||||
|
||||
if (item_offset > str_width - (display->width - text_pos))
|
||||
display->puts_offset(0, i, entry_name,item_offset);
|
||||
else
|
||||
display->puts_scroll_offset(0, i, entry_name,item_offset);
|
||||
|
||||
else /* if (!global_settings.invert_cursor) */
|
||||
if (item_offset > item_width - (display->width - text_pos))
|
||||
display->puts_offset(0, i, entry_name,item_offset);
|
||||
else
|
||||
display->puts_scroll_offset(0, i, entry_name,item_offset);
|
||||
#else
|
||||
display->puts_scroll(text_pos, i, entry_name);
|
||||
#endif
|
||||
|
@ -264,40 +267,6 @@ void gui_list_draw(struct gui_list * gui_list)
|
|||
gui_textarea_update(display);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
void gui_list_screen_scroll_step(int ofs)
|
||||
{
|
||||
offset_step = ofs;
|
||||
}
|
||||
|
||||
void gui_list_screen_scroll_out_of_view(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
offset_outof_view = true;
|
||||
else
|
||||
offset_outof_view = false;
|
||||
}
|
||||
|
||||
void gui_list_offset_right(struct gui_list * gui_list)
|
||||
{
|
||||
/* there should be a callback to find out what's the longest item on the list,
|
||||
* and then, by finding out the width with get_stringsize, we would stop the
|
||||
* list from scrolling at that point */
|
||||
|
||||
gui_list->offsetval+=offset_step;
|
||||
if (gui_list->offsetval > 1000)
|
||||
gui_list->offsetval = 1000;
|
||||
}
|
||||
|
||||
void gui_list_offset_left(struct gui_list * gui_list)
|
||||
{
|
||||
gui_list->offsetval-=offset_step;
|
||||
if (gui_list->offsetval < 0)
|
||||
gui_list->offsetval = 0;
|
||||
|
||||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
void gui_list_select_item(struct gui_list * gui_list, int item_number)
|
||||
{
|
||||
if( item_number > gui_list->nb_items-1 || item_number < 0 )
|
||||
|
@ -428,6 +397,37 @@ void gui_list_del_item(struct gui_list * gui_list)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
void gui_list_scroll_right(struct gui_list * gui_list)
|
||||
{
|
||||
/* FIXME: This is a fake right boundry limiter. there should be some
|
||||
* callback function to find the longest item on the list in pixels,
|
||||
* to stop the list from scrolling past that point */
|
||||
gui_list->offset_position+=offset_step;
|
||||
if (gui_list->offset_position > 1000)
|
||||
gui_list->offset_position = 1000;
|
||||
}
|
||||
|
||||
void gui_list_scroll_left(struct gui_list * gui_list)
|
||||
{
|
||||
gui_list->offset_position-=offset_step;
|
||||
if (gui_list->offset_position < 0)
|
||||
gui_list->offset_position = 0;
|
||||
}
|
||||
void gui_list_screen_scroll_step(int ofs)
|
||||
{
|
||||
offset_step = ofs;
|
||||
}
|
||||
|
||||
void gui_list_screen_scroll_out_of_view(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
offset_out_of_view = true;
|
||||
else
|
||||
offset_out_of_view = false;
|
||||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
/*
|
||||
* Synchronized lists stuffs
|
||||
*/
|
||||
|
@ -453,7 +453,9 @@ void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
|
|||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
gui_list_set_nb_items(&(lists->gui_list[i]), nb_items);
|
||||
lists->gui_list[i].offsetval = 0;
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
lists->gui_list[i].offset_position = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback)
|
||||
|
@ -502,22 +504,6 @@ void gui_synclist_select_next_page(struct gui_synclist * lists,
|
|||
screens[screen].nb_lines);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
void gui_synclist_offset_right(struct gui_synclist * lists)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
gui_list_offset_right(&(lists->gui_list[i]));
|
||||
}
|
||||
|
||||
void gui_synclist_offset_left(struct gui_synclist * lists)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
gui_list_offset_left(&(lists->gui_list[i]));
|
||||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
void gui_synclist_select_previous_page(struct gui_synclist * lists,
|
||||
enum screen_type screen)
|
||||
{
|
||||
|
@ -555,6 +541,22 @@ void gui_synclist_flash(struct gui_synclist * lists)
|
|||
gui_list_flash(&(lists->gui_list[i]));
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
void gui_synclist_scroll_right(struct gui_synclist * lists)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
gui_list_scroll_right(&(lists->gui_list[i]));
|
||||
}
|
||||
|
||||
void gui_synclist_scroll_left(struct gui_synclist * lists)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
gui_list_scroll_left(&(lists->gui_list[i]));
|
||||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
|
||||
{
|
||||
gui_synclist_limit_scroll(lists, true);
|
||||
|
@ -588,7 +590,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
|
|||
gui_synclist_select_next(lists);
|
||||
gui_synclist_draw(lists);
|
||||
return LIST_NEXT;
|
||||
|
||||
|
||||
#ifdef LIST_PGRIGHT
|
||||
case LIST_PGRIGHT:
|
||||
case LIST_PGRIGHT | BUTTON_REPEAT:
|
||||
|
@ -596,7 +598,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
|
|||
case LIST_RC_PGRIGHT:
|
||||
case LIST_RC_PGRIGHT | BUTTON_REPEAT:
|
||||
#endif
|
||||
gui_synclist_offset_right(lists);
|
||||
gui_synclist_scroll_right(lists);
|
||||
gui_synclist_draw(lists);
|
||||
return true;
|
||||
#endif
|
||||
|
@ -608,7 +610,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
|
|||
case LIST_RC_PGLEFT:
|
||||
case LIST_RC_PGLEFT | BUTTON_REPEAT:
|
||||
#endif
|
||||
gui_synclist_offset_left(lists);
|
||||
gui_synclist_scroll_left(lists);
|
||||
gui_synclist_draw(lists);
|
||||
return true;
|
||||
#endif
|
||||
|
|
|
@ -126,19 +126,20 @@ typedef void list_get_icon(int selected_item,
|
|||
* a buffer when it's not necessary)
|
||||
* Returns a pointer to a string that contains the text to display
|
||||
*/
|
||||
|
||||
typedef char * list_get_name(int selected_item,
|
||||
void * data,
|
||||
char *buffer);
|
||||
|
||||
struct gui_list
|
||||
{
|
||||
int offsetval; /* value of screen offset */
|
||||
int nb_items;
|
||||
int selected_item;
|
||||
bool cursor_flash_state;
|
||||
int start_item; /* the item that is displayed at the top of the screen */
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
int offset_position; /* the list's screen scroll placement in pixels */
|
||||
#endif
|
||||
list_get_icon *callback_get_item_icon;
|
||||
list_get_name *callback_get_item_name;
|
||||
|
||||
|
@ -234,13 +235,6 @@ extern void gui_list_draw(struct gui_list * gui_list);
|
|||
* (Item 0 gets selected if the end of the list is reached)
|
||||
* - gui_list : the list structure
|
||||
*/
|
||||
|
||||
extern void gui_list_screen_scroll_step(int ofs);
|
||||
/* parse global setting to static int */
|
||||
|
||||
extern void gui_list_screen_scroll_out_of_view(bool enable);
|
||||
/* parse global setting to static bool */
|
||||
|
||||
extern void gui_list_select_next(struct gui_list * gui_list);
|
||||
|
||||
/*
|
||||
|
@ -250,27 +244,32 @@ extern void gui_list_select_next(struct gui_list * gui_list);
|
|||
*/
|
||||
extern void gui_list_select_previous(struct gui_list * gui_list);
|
||||
|
||||
/*
|
||||
* Go to next page if any, else selects the last item in the list
|
||||
* - gui_list : the list structure
|
||||
* - nb_lines : the number of lines to try to move the cursor
|
||||
*/
|
||||
|
||||
extern void gui_list_offset_right(struct gui_list * gui_list);
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
/*
|
||||
* Makes all the item in the list scroll by one step to the right.
|
||||
* Should stop increasing the value when reaching the widest item value
|
||||
* in the list.
|
||||
*/
|
||||
|
||||
extern void gui_list_offset_left(struct gui_list * gui_list);
|
||||
void gui_list_scroll_right(struct gui_list * gui_list);
|
||||
|
||||
/*
|
||||
* Makes all the item in the list scroll by one step to the left.
|
||||
* stops at starting position.
|
||||
*/
|
||||
|
||||
*/
|
||||
void gui_list_scroll_left(struct gui_list * gui_list);
|
||||
|
||||
/* parse global setting to static int */
|
||||
extern void gui_list_screen_scroll_step(int ofs);
|
||||
|
||||
/* parse global setting to static bool */
|
||||
extern void gui_list_screen_scroll_out_of_view(bool enable);
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
/*
|
||||
* Go to next page if any, else selects the last item in the list
|
||||
* - gui_list : the list structure
|
||||
* - nb_lines : the number of lines to try to move the cursor
|
||||
*/
|
||||
extern void gui_list_select_next_page(struct gui_list * gui_list,
|
||||
int nb_lines);
|
||||
|
||||
|
@ -347,8 +346,6 @@ extern void gui_synclist_select_item(struct gui_synclist * lists,
|
|||
int item_number);
|
||||
extern void gui_synclist_select_next(struct gui_synclist * lists);
|
||||
extern void gui_synclist_select_previous(struct gui_synclist * lists);
|
||||
extern void gui_synclist_offset_right(struct gui_synclist * lists);
|
||||
extern void gui_synclist_offset_left(struct gui_synclist * lists);
|
||||
extern void gui_synclist_select_next_page(struct gui_synclist * lists,
|
||||
enum screen_type screen);
|
||||
extern void gui_synclist_select_previous_page(struct gui_synclist * lists,
|
||||
|
@ -357,6 +354,8 @@ extern void gui_synclist_add_item(struct gui_synclist * lists);
|
|||
extern void gui_synclist_del_item(struct gui_synclist * lists);
|
||||
extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll);
|
||||
extern void gui_synclist_flash(struct gui_synclist * lists);
|
||||
void gui_synclist_scroll_right(struct gui_synclist * lists);
|
||||
void gui_synclist_scroll_left(struct gui_synclist * lists);
|
||||
|
||||
/*
|
||||
* Do the action implied by the given button,
|
||||
|
|
|
@ -67,15 +67,13 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
|
|||
screen->scroll_delay=&lcd_remote_scroll_delay;
|
||||
screen->scroll_step=&lcd_remote_scroll_step;
|
||||
screen->invertscroll=&lcd_remote_invertscroll;
|
||||
|
||||
screen->puts_scroll_style=&lcd_remote_puts_scroll_style;
|
||||
#endif /* LCD_REMOTE_DEPTH > 1 */
|
||||
screen->puts_offset=&lcd_remote_puts_offset;
|
||||
screen->puts_style_offset=&lcd_remote_puts_style_offset;
|
||||
screen->puts_scroll_style=&lcd_remote_puts_scroll_style;
|
||||
screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset;
|
||||
screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset;
|
||||
|
||||
screen->puts_offset=&lcd_remote_puts_offset;
|
||||
screen->puts_style=&lcd_remote_puts_style;
|
||||
screen->puts_style_offset=&lcd_remote_puts_style_offset;
|
||||
#endif /* LCD_REMOTE_DEPTH > 1 */
|
||||
|
||||
#if 0 /* no charcell remote LCDs so far */
|
||||
screen->width=11;
|
||||
screen->height=2;
|
||||
|
@ -99,7 +97,6 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
|
|||
screen->backlight_on=&remote_backlight_on;
|
||||
screen->backlight_off=&remote_backlight_off;
|
||||
break;
|
||||
|
||||
#endif /* HAVE_REMOTE_LCD */
|
||||
|
||||
case SCREEN_MAIN:
|
||||
|
@ -136,13 +133,11 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
|
|||
screen->scroll_delay=&lcd_scroll_delay;
|
||||
screen->scroll_step=&lcd_scroll_step;
|
||||
screen->invertscroll=&lcd_invertscroll;
|
||||
|
||||
screen->puts_scroll_offset=&lcd_puts_scroll_offset;
|
||||
screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset;
|
||||
|
||||
screen->puts_offset=&lcd_puts_offset;
|
||||
screen->puts_style_offset=&lcd_puts_style_offset;
|
||||
screen->puts_style=&lcd_puts_style;
|
||||
screen->puts_scroll_style=&lcd_puts_scroll_offset;
|
||||
screen->puts_scroll_offset=&lcd_puts_scroll_style;
|
||||
screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset;
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
|
|
|
@ -69,23 +69,17 @@ struct screen
|
|||
void (*setfont)(int newfont);
|
||||
int (*getstringsize)(const unsigned char *str, int *w, int *h);
|
||||
void (*putsxy)(int x, int y, const unsigned char *str);
|
||||
|
||||
void (*scroll_step)(int pixels);
|
||||
|
||||
|
||||
void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
|
||||
void (*puts_style_offset)(int x, int y, const unsigned char *str,
|
||||
int style, int offset);
|
||||
void (*puts_scroll_style)(int x, int y, const unsigned char *string,
|
||||
int style);
|
||||
void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
|
||||
int offset);
|
||||
void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string,
|
||||
int style, int offset);
|
||||
|
||||
void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
|
||||
void (*puts_style)(int x, int y, const unsigned char *string, int style);
|
||||
void (*puts_style_offset)(int x, int y, const unsigned char *str,
|
||||
int style, int offset);
|
||||
|
||||
|
||||
|
||||
int style, int offset);
|
||||
void (*mono_bitmap)(const unsigned char *src,
|
||||
int x, int y, int width, int height);
|
||||
void (*set_drawmode)(int mode);
|
||||
|
|
|
@ -319,8 +319,10 @@ struct user_settings
|
|||
int bidir_limit; /* bidir scroll length limit */
|
||||
int scroll_delay; /* delay (in 1/10s) before starting scroll */
|
||||
int scroll_step; /* pixels to advance per update */
|
||||
bool offset_out_of_view; /* should lines scroll out of the screen */
|
||||
int screen_scroll_step; /* pixels to advance screen view*/
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
bool offset_out_of_view;
|
||||
int screen_scroll_step;
|
||||
#endif
|
||||
|
||||
/* auto bookmark settings */
|
||||
int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */
|
||||
|
|
|
@ -1515,9 +1515,9 @@ static bool scroll_settings_menu(void)
|
|||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_SCROLL_SPEED), scroll_speed },
|
||||
{ ID2P(LANG_SCROLL_DELAY), scroll_delay },
|
||||
{ ID2P(LANG_SCROLL_DELAY), scroll_delay },
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
{ ID2P(LANG_SCROLL_STEP), scroll_step },
|
||||
{ ID2P(LANG_SCROLL_STEP), scroll_step },
|
||||
#endif
|
||||
{ ID2P(LANG_BIDIR_SCROLL), bidir_limit },
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
|
@ -1526,7 +1526,7 @@ static bool scroll_settings_menu(void)
|
|||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
{ ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll },
|
||||
{ ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step },
|
||||
{ ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -1138,7 +1138,7 @@ void lcd_remote_putsxy(int x, int y, const unsigned char *str)
|
|||
/* put a string at a given char position */
|
||||
void lcd_remote_puts(int x, int y, const unsigned char *str)
|
||||
{
|
||||
lcd_remote_puts_style(x, y, str, STYLE_DEFAULT);
|
||||
lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
|
||||
}
|
||||
|
||||
void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style)
|
||||
|
@ -1151,7 +1151,8 @@ void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset)
|
|||
lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
/* put a string at a given char position at a given style and with a given offset */
|
||||
/* put a string at a given char position, style, and pixel position,
|
||||
* skipping first offset pixel columns */
|
||||
void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset)
|
||||
{
|
||||
int xpos,ypos,w,h;
|
||||
|
@ -1223,16 +1224,16 @@ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string)
|
|||
|
||||
void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style)
|
||||
{
|
||||
lcd_remote_puts_scroll_style_offset(x, y, string, style, 0);
|
||||
lcd_remote_puts_scroll_style_offset(x, y, string, style, 0);
|
||||
}
|
||||
|
||||
|
||||
void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
|
||||
{
|
||||
lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string,
|
||||
int style, int offset)
|
||||
int style, int offset)
|
||||
{
|
||||
struct scrollinfo* s;
|
||||
int w, h;
|
||||
|
@ -1289,7 +1290,6 @@ void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *stri
|
|||
scrolling_lines &= ~(1<<y);
|
||||
}
|
||||
|
||||
|
||||
static void scroll_thread(void)
|
||||
{
|
||||
struct font* pf;
|
||||
|
|
|
@ -1057,9 +1057,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
|
|||
|
||||
/*** line oriented text output ***/
|
||||
|
||||
/* put a string at a given char position at a given style and with a given pixel position */
|
||||
void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
|
||||
int offset)
|
||||
/* put a string at a given char position */
|
||||
void lcd_puts(int x, int y, const unsigned char *str)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
|
||||
}
|
||||
|
||||
void lcd_puts_style(int x, int y, const unsigned char *str, int style)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, style, 0);
|
||||
}
|
||||
|
||||
void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
/* put a string at a given char position, style, and pixel position,
|
||||
* skipping first offset pixel columns */
|
||||
void lcd_puts_style_offset(int x, int y, const unsigned char *str,
|
||||
int style, int offset)
|
||||
{
|
||||
int xpos,ypos,w,h;
|
||||
int lastmode = drawmode;
|
||||
|
@ -1083,22 +1100,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
|
|||
}
|
||||
drawmode = lastmode;
|
||||
}
|
||||
void lcd_puts_style(int x, int y, const unsigned char *str, int style)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, style, 0);
|
||||
}
|
||||
|
||||
/* put a string at a given char position at a given offset mark */
|
||||
void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
/* put a string at a given char position */
|
||||
void lcd_puts(int x, int y, const unsigned char *str)
|
||||
{
|
||||
lcd_puts_style(x, y, str, STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
/*** scrolling ***/
|
||||
|
||||
|
@ -1226,7 +1227,7 @@ static void scroll_thread(void)
|
|||
while ( 1 ) {
|
||||
for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
|
||||
/* really scroll? */
|
||||
if ( !(scrolling_lines&(1<<index)))
|
||||
if ( !(scrolling_lines&(1<<index)) )
|
||||
continue;
|
||||
|
||||
s = &scroll[index];
|
||||
|
@ -1269,7 +1270,8 @@ static void scroll_thread(void)
|
|||
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
|
||||
drawmode = DRMODE_SOLID;
|
||||
lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
|
||||
if (s->invert) {
|
||||
if (s->invert)
|
||||
{
|
||||
drawmode = DRMODE_COMPLEMENT;
|
||||
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
|
||||
}
|
||||
|
|
|
@ -917,9 +917,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
|
|||
|
||||
/*** Line oriented text output ***/
|
||||
|
||||
/* put a string at a given char position at a given style and with a given pixel position */
|
||||
void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
|
||||
int offset)
|
||||
/* put a string at a given char position */
|
||||
void lcd_puts(int x, int y, const unsigned char *str)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
|
||||
}
|
||||
|
||||
void lcd_puts_style(int x, int y, const unsigned char *str, int style)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, style, 0);
|
||||
}
|
||||
|
||||
void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
/* put a string at a given char position, style, and pixel position,
|
||||
* skipping first offset pixel columns */
|
||||
void lcd_puts_style_offset(int x, int y, const unsigned char *str,
|
||||
int style, int offset)
|
||||
{
|
||||
int xpos,ypos,w,h;
|
||||
int lastmode = drawmode;
|
||||
|
@ -944,23 +961,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
|
|||
drawmode = lastmode;
|
||||
}
|
||||
|
||||
void lcd_puts_style(int x, int y, const unsigned char *str, int style)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, style, 0);
|
||||
}
|
||||
|
||||
/* put a string at a given char position at a given offset mark */
|
||||
void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
/* put a string at a given char position */
|
||||
void lcd_puts(int x, int y, const unsigned char *str)
|
||||
{
|
||||
lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
|
||||
}
|
||||
|
||||
/*** scrolling ***/
|
||||
|
||||
/* Reverse the invert setting of the scrolling line (if any) at given char
|
||||
|
@ -1002,20 +1002,21 @@ void lcd_bidir_scroll(int percent)
|
|||
|
||||
void lcd_puts_scroll(int x, int y, const unsigned char *string)
|
||||
{
|
||||
lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, 0);
|
||||
lcd_puts_scroll_style(x, y, string, STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
|
||||
{
|
||||
lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
|
||||
{
|
||||
lcd_puts_scroll_style_offset(x, y, string, style, 0);
|
||||
}
|
||||
|
||||
void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
|
||||
void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
|
||||
int offset)
|
||||
{
|
||||
lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
|
||||
}
|
||||
|
||||
void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
|
||||
int style, int offset)
|
||||
{
|
||||
struct scrollinfo* s;
|
||||
|
@ -1130,7 +1131,8 @@ static void scroll_thread(void)
|
|||
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
|
||||
drawmode = DRMODE_SOLID;
|
||||
lcd_putsxyofs(xpos, ypos, s->offset, s->line);
|
||||
if (s->invert) {
|
||||
if (s->invert)
|
||||
{
|
||||
drawmode = DRMODE_COMPLEMENT;
|
||||
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
|
||||
}
|
||||
|
|
|
@ -37,13 +37,11 @@ extern void lcd_remote_emireduce(bool state);
|
|||
extern void lcd_remote_clear_display(void);
|
||||
extern void lcd_remote_puts(int x, int y, const unsigned char *string);
|
||||
extern void lcd_remote_puts_style(int x, int y, const unsigned char *string,
|
||||
int style);
|
||||
int style);
|
||||
extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset);
|
||||
extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset);
|
||||
|
||||
extern void lcd_remote_putc(int x, int y, unsigned short ch);
|
||||
extern void lcd_remote_stop_scroll(void);
|
||||
|
||||
extern void lcd_remote_scroll_speed(int speed);
|
||||
extern void lcd_remote_scroll_delay(int ms);
|
||||
extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue