Files
luban-lite/packages/third-party/awtk-ui/awtk/src/lcd/lcd_mem_special.h
刘可亮 3b4064f334 v1.0.2
2023-11-30 19:48:02 +08:00

74 lines
2.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* File: lcd_mem_special.h
* Author: AWTK Develop Team
* Brief: lcd_mem_special
*
* Copyright (c) 2018 - 2023 Guangzhou ZHIYUAN Electronics Co.,Ltd.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* License file for more details.
*
*/
/**
* History:
* ================================================================
* 2019-06-17 Li XianJing <xianjimli@hotmail.com> created
*
*/
#ifndef LCD_MEM_SPECIAL_H
#define LCD_MEM_SPECIAL_H
#include "base/lcd.h"
#include "lcd/lcd_mem.h"
BEGIN_C_DECLS
/**
* @class lcd_mem_special_t
* @parent lcd_t
* 特殊的LCD。
*
* 通过重载flush函数来提交GUI绘制的结果到硬件。适用于
*
* * lcd 硬件不支持framebuffer如SPI接口的屏。
* * lcd 硬件支持framebuffer但是其格式特殊AWTK目前不支持。可以用flush进行格式转换。
*
*
*/
typedef struct _lcd_mem_special_t {
lcd_mem_t base;
bitmap_format_t format;
/*custom info*/
void* ctx;
lcd_flush_t on_flush;
lcd_resize_t on_resize;
lcd_destroy_t on_destroy;
} lcd_mem_special_t;
/**
* @method lcd_mem_special_create
*
* 创建lcd对象。
*
* @param {wh_t} w 宽度。
* @param {wh_t} h 高度。
* @param {bitmap_format_t} fmt 离线lcd的格式。一般用 BITMAP_FMT_BGR565 或 BITMAP_FMT_RGBA8888。
* @param {lcd_flush_t} on_flush 回调函数用于刷新GUI数据到实际的LCD。
* @param {lcd_resize_t} on_resize 用于调整LCD的大小。一般用NULL即可。
* @param {lcd_destroy_t} on_destroy lcd销毁时的回调函数。
* @param {void*} ctx 回调函数的上下文。
*
* @return {lcd_t*} 返回lcd对象。
*/
lcd_t* lcd_mem_special_create(wh_t w, wh_t h, bitmap_format_t fmt, lcd_flush_t on_flush,
lcd_resize_t on_resize, lcd_destroy_t on_destroy, void* ctx);
END_C_DECLS
#endif /*LCD_MEM_SPECIAL_H*/