2005-10-28 00:17:15 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2005-10-30 01:24:35 +00:00
|
|
|
* Copyright (C) 2005 by Kevin Ferrare
|
2005-10-28 00:17:15 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-10-28 00:17:15 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _SCREEN_ACCESS_H_
|
|
|
|
#define _SCREEN_ACCESS_H_
|
|
|
|
|
|
|
|
#include "lcd.h"
|
2013-12-20 22:34:28 +00:00
|
|
|
#include "scroll_engine.h"
|
2009-08-06 00:14:40 +00:00
|
|
|
#include "backdrop.h"
|
2013-12-20 22:34:28 +00:00
|
|
|
#include "line.h"
|
2005-10-30 01:24:35 +00:00
|
|
|
|
2005-11-02 02:28:12 +00:00
|
|
|
#if defined(HAVE_REMOTE_LCD) && !defined (ROCKBOX_HAS_LOGF)
|
2005-10-28 00:17:15 +00:00
|
|
|
#define NB_SCREENS 2
|
2011-09-24 13:19:34 +00:00
|
|
|
void screen_helper_remote_setfont(int font);
|
2005-10-28 00:17:15 +00:00
|
|
|
#else
|
|
|
|
#define NB_SCREENS 1
|
|
|
|
#endif
|
2011-09-24 13:19:34 +00:00
|
|
|
void screen_helper_setfont(int font);
|
2005-10-28 00:17:15 +00:00
|
|
|
|
2011-10-15 19:35:02 +00:00
|
|
|
#define FOR_NB_SCREENS(i) for(int i = 0; i < NB_SCREENS; i++)
|
2005-11-09 22:47:15 +00:00
|
|
|
|
2007-04-16 23:55:19 +00:00
|
|
|
typedef void screen_bitmap_part_func(const void *src, int src_x, int src_y,
|
|
|
|
int stride, int x, int y, int width, int height);
|
|
|
|
typedef void screen_bitmap_func(const void *src, int x, int y, int width,
|
|
|
|
int height);
|
|
|
|
|
2007-09-18 19:05:35 +00:00
|
|
|
/* if this struct is changed the plugin api may break so bump the api
|
|
|
|
versions in plugin.h */
|
2005-10-28 00:17:15 +00:00
|
|
|
struct screen
|
|
|
|
{
|
|
|
|
enum screen_type screen_type;
|
2008-06-28 20:45:21 +00:00
|
|
|
int lcdwidth, lcdheight;
|
2005-10-28 00:17:15 +00:00
|
|
|
int depth;
|
2008-09-07 20:09:11 +00:00
|
|
|
int (*getnblines)(void);
|
2007-08-04 03:01:46 +00:00
|
|
|
int pixel_format;
|
2008-09-07 20:09:11 +00:00
|
|
|
int (*getcharwidth)(void);
|
|
|
|
int (*getcharheight)(void);
|
2007-09-18 19:05:35 +00:00
|
|
|
bool is_color;
|
2007-02-18 05:07:19 +00:00
|
|
|
#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
|
2005-11-20 01:02:14 +00:00
|
|
|
bool has_disk_led;
|
2005-10-30 22:34:51 +00:00
|
|
|
#endif
|
2013-12-20 22:34:28 +00:00
|
|
|
void (*set_drawmode)(int mode);
|
2020-10-07 06:01:35 +00:00
|
|
|
struct viewport* (*init_viewport)(struct viewport* vp);
|
|
|
|
struct viewport* (*set_viewport)(struct viewport* vp);
|
|
|
|
struct viewport* (*set_viewport_ex)(struct viewport* vp, int flags);
|
|
|
|
void (*viewport_set_buffer)(struct viewport *vp, struct frame_buffer_t *buffer);
|
|
|
|
struct viewport** current_viewport;
|
2008-01-08 01:22:14 +00:00
|
|
|
int (*getwidth)(void);
|
|
|
|
int (*getheight)(void);
|
2005-10-28 00:17:15 +00:00
|
|
|
int (*getstringsize)(const unsigned char *str, int *w, int *h);
|
2007-03-26 07:52:13 +00:00
|
|
|
void (*setfont)(int newfont);
|
2011-11-08 10:09:33 +00:00
|
|
|
int (*getuifont)(void);
|
|
|
|
void (*setuifont)(int newfont);
|
2006-01-22 01:42:05 +00:00
|
|
|
|
2006-01-22 04:24:26 +00:00
|
|
|
void (*scroll_step)(int pixels);
|
2005-10-28 00:17:15 +00:00
|
|
|
void (*mono_bitmap)(const unsigned char *src,
|
|
|
|
int x, int y, int width, int height);
|
2006-02-10 13:57:11 +00:00
|
|
|
void (*mono_bitmap_part)(const unsigned char *src, int src_x, int src_y,
|
|
|
|
int stride, int x, int y, int width, int height);
|
2007-04-16 23:55:19 +00:00
|
|
|
void (*bitmap)(const void *src,
|
2006-01-28 12:12:42 +00:00
|
|
|
int x, int y, int width, int height);
|
2007-04-16 23:55:19 +00:00
|
|
|
void (*bitmap_part)(const void *src, int src_x, int src_y,
|
2006-10-14 01:32:58 +00:00
|
|
|
int stride, int x, int y, int width, int height);
|
2007-04-16 23:55:19 +00:00
|
|
|
void (*transparent_bitmap)(const void *src,
|
2006-01-28 23:12:20 +00:00
|
|
|
int x, int y, int width, int height);
|
2007-04-16 23:55:19 +00:00
|
|
|
void (*transparent_bitmap_part)(const void *src, int src_x, int src_y,
|
2006-02-10 13:57:11 +00:00
|
|
|
int stride, int x, int y, int width, int height);
|
2011-11-08 21:34:46 +00:00
|
|
|
void (*bmp)(const struct bitmap *bm, int x, int y);
|
|
|
|
void (*bmp_part)(const struct bitmap* bm, int src_x, int src_y,
|
|
|
|
int x, int y, int width, int height);
|
2007-02-17 21:54:17 +00:00
|
|
|
#if defined(HAVE_LCD_COLOR) && defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1
|
2006-10-14 01:32:58 +00:00
|
|
|
unsigned (*color_to_native)(unsigned color);
|
|
|
|
#endif
|
2007-02-17 23:07:39 +00:00
|
|
|
#if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1))
|
2006-02-02 22:00:56 +00:00
|
|
|
unsigned (*get_background)(void);
|
|
|
|
unsigned (*get_foreground)(void);
|
2005-11-16 21:09:23 +00:00
|
|
|
void (*set_background)(unsigned background);
|
2006-02-02 22:00:56 +00:00
|
|
|
void (*set_foreground)(unsigned foreground);
|
2005-11-19 11:45:08 +00:00
|
|
|
#endif /* (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1) */
|
2005-10-28 00:17:15 +00:00
|
|
|
void (*update_rect)(int x, int y, int width, int height);
|
2008-01-08 01:22:14 +00:00
|
|
|
void (*update_viewport_rect)(int x, int y, int width, int height);
|
2005-10-28 00:17:15 +00:00
|
|
|
void (*fillrect)(int x, int y, int width, int height);
|
|
|
|
void (*drawrect)(int x, int y, int width, int height);
|
2010-10-11 01:19:55 +00:00
|
|
|
void (*fill_viewport)(void);
|
|
|
|
void (*draw_border_viewport)(void);
|
2005-10-28 00:17:15 +00:00
|
|
|
void (*drawpixel)(int x, int y);
|
|
|
|
void (*drawline)(int x1, int y1, int x2, int y2);
|
|
|
|
void (*vline)(int x, int y1, int y2);
|
|
|
|
void (*hline)(int x1, int x2, int y);
|
|
|
|
|
2007-03-26 07:52:13 +00:00
|
|
|
void (*putsxy)(int x, int y, const unsigned char *str);
|
|
|
|
void (*puts)(int x, int y, const unsigned char *str);
|
2009-10-17 18:02:48 +00:00
|
|
|
void (*putsf)(int x, int y, const unsigned char *str, ...);
|
2014-01-12 00:30:26 +00:00
|
|
|
bool (*puts_scroll)(int x, int y, const unsigned char *string);
|
|
|
|
bool (*putsxy_scroll_func)(int x, int y, const unsigned char *string,
|
2013-12-20 22:34:28 +00:00
|
|
|
void (*scroll_func)(struct scrollinfo *),
|
|
|
|
void *data, int x_offset);
|
2005-10-28 00:17:15 +00:00
|
|
|
void (*scroll_speed)(int speed);
|
|
|
|
void (*scroll_delay)(int ms);
|
|
|
|
void (*clear_display)(void);
|
2008-01-08 01:22:14 +00:00
|
|
|
void (*clear_viewport)(void);
|
2013-04-03 14:33:23 +00:00
|
|
|
void (*scroll_stop)(void);
|
|
|
|
void (*scroll_stop_viewport)(const struct viewport *vp);
|
2013-01-31 06:24:19 +00:00
|
|
|
void (*scroll_stop_viewport_rect)(const struct viewport* vp, int x, int y, int width, int height);
|
2005-10-28 00:17:15 +00:00
|
|
|
void (*update)(void);
|
2008-01-08 01:22:14 +00:00
|
|
|
void (*update_viewport)(void);
|
2005-11-22 03:38:07 +00:00
|
|
|
void (*backlight_on)(void);
|
|
|
|
void (*backlight_off)(void);
|
2008-04-02 22:16:14 +00:00
|
|
|
bool (*is_backlight_on)(bool ignore_always_off);
|
2006-07-01 10:14:27 +00:00
|
|
|
void (*backlight_set_timeout)(int index);
|
2010-01-27 06:47:56 +00:00
|
|
|
#if LCD_DEPTH > 1
|
2010-01-29 07:52:13 +00:00
|
|
|
bool (*backdrop_load)(const char *filename, char* backdrop_buffer);
|
|
|
|
void (*backdrop_show)(char* backdrop_buffer);
|
2010-01-27 06:47:56 +00:00
|
|
|
#endif
|
2020-10-26 16:38:22 +00:00
|
|
|
#if defined(HAVE_LCD_COLOR)
|
2012-03-15 11:50:17 +00:00
|
|
|
void (*gradient_fillrect)(int x, int y, int width, int height,
|
|
|
|
unsigned start, unsigned end);
|
2013-12-20 22:34:28 +00:00
|
|
|
void (*gradient_fillrect_part)(int x, int y, int width, int height,
|
|
|
|
unsigned start, unsigned end, int src_height, int row_skip);
|
2012-03-15 11:50:17 +00:00
|
|
|
#endif
|
2012-12-03 09:43:58 +00:00
|
|
|
void (*nine_segment_bmp)(const struct bitmap* bm, int x, int y,
|
|
|
|
int width, int height);
|
2013-12-20 22:34:28 +00:00
|
|
|
void (*put_line)(int x, int y, struct line_desc *line, const char *fmt, ...);
|
2005-10-28 00:17:15 +00:00
|
|
|
};
|
|
|
|
|
2005-11-09 01:17:57 +00:00
|
|
|
/*
|
|
|
|
* Clear only a given area of the screen
|
|
|
|
* - screen : the screen structure
|
|
|
|
* - xstart, ystart : where the area starts
|
|
|
|
* - width, height : size of the area
|
|
|
|
*/
|
|
|
|
void screen_clear_area(struct screen * display, int xstart, int ystart,
|
|
|
|
int width, int height);
|
|
|
|
|
2005-10-28 00:17:15 +00:00
|
|
|
/*
|
|
|
|
* exported screens array that should be used
|
|
|
|
* by each app that wants to write to access display
|
|
|
|
*/
|
|
|
|
extern struct screen screens[NB_SCREENS];
|
|
|
|
|
|
|
|
#endif /*_SCREEN_ACCESS_H_*/
|