remove RT-Thread GUI from RT-Thread temporary

This commit is contained in:
Bernard Xiong
2013-02-21 13:11:10 +08:00
parent c4bd0023f8
commit 385f682d7b
180 changed files with 0 additions and 69649 deletions
-2
View File
@@ -1,2 +0,0 @@
common/font_cmp_hz*.c
doc/doxygened/
File diff suppressed because it is too large Load Diff
-94
View File
@@ -1,94 +0,0 @@
import os
from building import *
common_src = Split("""
common/blit.c
common/color.c
common/region.c
common/rtgui_object.c
common/rtgui_system.c
common/rtgui_theme.c
common/rtgui_xml.c
common/rtgui_app.c
common/dc.c
common/dc_hw.c
common/dc_buffer.c
common/dc_client.c
common/filerw.c
common/image.c
common/image_xpm.c
common/image_hdc.c
common/image_bmp.c
common/image_png.c
common/image_jpg.c
common/image_container.c
common/font.c
common/font_bmp.c
common/font_hz_file.c
common/font_hz_bmp.c
common/asc12font.c
common/asc16font.c
common/hz12font.c
common/hz16font.c
common/framebuffer_driver.c
common/pixel_driver.c
common/rtgui_mv_model.c
""")
server_src = Split("""
server/driver.c
server/mouse.c
server/server.c
server/topwin.c
""")
widgets_src = Split("""
widgets/box.c
widgets/button.c
widgets/checkbox.c
widgets/combobox.c
widgets/iconbox.c
widgets/label.c
widgets/textview.c
widgets/listctrl.c
widgets/menu.c
widgets/progressbar.c
widgets/radiobox.c
widgets/slider.c
widgets/scrollbar.c
widgets/staticline.c
widgets/textbox.c
widgets/listbox.c
widgets/title.c
widgets/notebook.c
widgets/container.c
widgets/list_view.c
widgets/filelist_view.c
widgets/widget.c
widgets/window.c
widgets/panel.c
widgets/groupbox.c
widgets/edit.c
widgets/mv_view.c
widgets/plot.c
widgets/plot_curve.c
widgets/digtube.c
widgets/digfont.c
""")
if GetDepend('RTGUI_USING_FONT_COMPACT'):
import stract_cjk
common_src.append('common/font_cmp_hz16.c')
common_src.append('common/font_cmp_hz12.c')
RegisterPreBuildingAction(stract_cjk.gen_cmp_font_file)
# The set of source files associated with this SConscript file.
src = common_src + server_src + widgets_src
cwd = GetCurrentDir()
dirs = ['include', 'common', 'server', 'widgets']
path = [os.path.join(cwd, i) for i in dirs]
group = DefineGroup('RTGUI', src, depend = ['RT_USING_RTGUI'], CPPPATH = path)
Return('group')
-133
View File
@@ -1,133 +0,0 @@
/*
* File : asc12font.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#include <rtgui/font.h>
const rt_uint8_t asc12_font[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00,/*"!",1*/
0x00,0x28,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*""",2*/
0x00,0x00,0x28,0x28,0xFC,0x28,0x50,0xFC,0x50,0x50,0x00,0x00,/*"#",3*/
0x00,0x20,0x78,0xA8,0xA0,0x60,0x30,0x28,0xA8,0xF0,0x20,0x00,/*"$",4*/
0x00,0x00,0x48,0xA8,0xB0,0x50,0x28,0x34,0x54,0x48,0x00,0x00,/*"%",5*/
0x00,0x00,0x20,0x50,0x50,0x78,0xA8,0xA8,0x90,0x6C,0x00,0x00,/*"&",6*/
0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"'",7*/
0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x04,0x00,/*"(",8*/
0x00,0x40,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x40,0x00,/*")",9*/
0x00,0x00,0x00,0x20,0xA8,0x70,0x70,0xA8,0x20,0x00,0x00,0x00,/*"*",10*/
0x00,0x00,0x20,0x20,0x20,0xF8,0x20,0x20,0x20,0x00,0x00,0x00,/*"+",11*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x80,/*",",12*/
0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",13*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,/*".",14*/
0x00,0x08,0x10,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x80,0x00,/*"/",15*/
0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00,/*"0",16*/
0x00,0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,/*"1",17*/
0x00,0x00,0x70,0x88,0x88,0x10,0x20,0x40,0x80,0xF8,0x00,0x00,/*"2",18*/
0x00,0x00,0x70,0x88,0x08,0x30,0x08,0x08,0x88,0x70,0x00,0x00,/*"3",19*/
0x00,0x00,0x10,0x30,0x50,0x50,0x90,0x78,0x10,0x18,0x00,0x00,/*"4",20*/
0x00,0x00,0xF8,0x80,0x80,0xF0,0x08,0x08,0x88,0x70,0x00,0x00,/*"5",21*/
0x00,0x00,0x70,0x90,0x80,0xF0,0x88,0x88,0x88,0x70,0x00,0x00,/*"6",22*/
0x00,0x00,0xF8,0x90,0x10,0x20,0x20,0x20,0x20,0x20,0x00,0x00,/*"7",23*/
0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x88,0x70,0x00,0x00,/*"8",24*/
0x00,0x00,0x70,0x88,0x88,0x88,0x78,0x08,0x48,0x70,0x00,0x00,/*"9",25*/
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x20,0x00,0x00,/*":",26*/
0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x20,0x00,/*";",27*/
0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00,/*"<",28*/
0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,/*"=",29*/
0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,/*">",30*/
0x00,0x00,0x70,0x88,0x88,0x10,0x20,0x20,0x00,0x20,0x00,0x00,/*"?",31*/
0x00,0x00,0x70,0x88,0x98,0xA8,0xA8,0xB8,0x80,0x78,0x00,0x00,/*"@",32*/
0x00,0x00,0x20,0x20,0x30,0x50,0x50,0x78,0x48,0xCC,0x00,0x00,/*"A",33*/
0x00,0x00,0xF0,0x48,0x48,0x70,0x48,0x48,0x48,0xF0,0x00,0x00,/*"B",34*/
0x00,0x00,0x78,0x88,0x80,0x80,0x80,0x80,0x88,0x70,0x00,0x00,/*"C",35*/
0x00,0x00,0xF0,0x48,0x48,0x48,0x48,0x48,0x48,0xF0,0x00,0x00,/*"D",36*/
0x00,0x00,0xF8,0x48,0x50,0x70,0x50,0x40,0x48,0xF8,0x00,0x00,/*"E",37*/
0x00,0x00,0xF8,0x48,0x50,0x70,0x50,0x40,0x40,0xE0,0x00,0x00,/*"F",38*/
0x00,0x00,0x38,0x48,0x80,0x80,0x9C,0x88,0x48,0x30,0x00,0x00,/*"G",39*/
0x00,0x00,0xCC,0x48,0x48,0x78,0x48,0x48,0x48,0xCC,0x00,0x00,/*"H",40*/
0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0xF8,0x00,0x00,/*"I",41*/
0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0xE0,0x00,/*"J",42*/
0x00,0x00,0xEC,0x48,0x50,0x60,0x50,0x50,0x48,0xEC,0x00,0x00,/*"K",43*/
0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x44,0xFC,0x00,0x00,/*"L",44*/
0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xA8,0xA8,0xA8,0xA8,0x00,0x00,/*"M",45*/
0x00,0x00,0xDC,0x48,0x68,0x68,0x58,0x58,0x48,0xE8,0x00,0x00,/*"N",46*/
0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00,/*"O",47*/
0x00,0x00,0xF0,0x48,0x48,0x70,0x40,0x40,0x40,0xE0,0x00,0x00,/*"P",48*/
0x00,0x00,0x70,0x88,0x88,0x88,0x88,0xE8,0x98,0x70,0x18,0x00,/*"Q",49*/
0x00,0x00,0xF0,0x48,0x48,0x70,0x50,0x48,0x48,0xEC,0x00,0x00,/*"R",50*/
0x00,0x00,0x78,0x88,0x80,0x60,0x10,0x08,0x88,0xF0,0x00,0x00,/*"S",51*/
0x00,0x00,0xF8,0xA8,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,/*"T",52*/
0x00,0x00,0xCC,0x48,0x48,0x48,0x48,0x48,0x48,0x30,0x00,0x00,/*"U",53*/
0x00,0x00,0xCC,0x48,0x48,0x50,0x50,0x30,0x20,0x20,0x00,0x00,/*"V",54*/
0x00,0x00,0xA8,0xA8,0xA8,0x70,0x50,0x50,0x50,0x50,0x00,0x00,/*"W",55*/
0x00,0x00,0xD8,0x50,0x50,0x20,0x20,0x50,0x50,0xD8,0x00,0x00,/*"X",56*/
0x00,0x00,0xD8,0x50,0x50,0x20,0x20,0x20,0x20,0x70,0x00,0x00,/*"Y",57*/
0x00,0x00,0xF8,0x90,0x10,0x20,0x20,0x40,0x48,0xF8,0x00,0x00,/*"Z",58*/
0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00,/*"[",59*/
0x00,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08,0x00,0x00,/*"\",60*/
0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00,/*"]",61*/
0x00,0x20,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"^",62*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,/*"_",63*/
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"`",64*/
0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x38,0x48,0x3C,0x00,0x00,/*"a",65*/
0x00,0x00,0xC0,0x40,0x40,0x70,0x48,0x48,0x48,0x70,0x00,0x00,/*"b",66*/
0x00,0x00,0x00,0x00,0x00,0x38,0x48,0x40,0x40,0x38,0x00,0x00,/*"c",67*/
0x00,0x00,0x18,0x08,0x08,0x38,0x48,0x48,0x48,0x3C,0x00,0x00,/*"d",68*/
0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x78,0x40,0x38,0x00,0x00,/*"e",69*/
0x00,0x00,0x1C,0x20,0x20,0x78,0x20,0x20,0x20,0x78,0x00,0x00,/*"f",70*/
0x00,0x00,0x00,0x00,0x00,0x3C,0x48,0x30,0x40,0x78,0x44,0x38,/*"g",71*/
0x00,0x00,0xC0,0x40,0x40,0x70,0x48,0x48,0x48,0xEC,0x00,0x00,/*"h",72*/
0x00,0x00,0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x70,0x00,0x00,/*"i",73*/
0x00,0x00,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0xE0,/*"j",74*/
0x00,0x00,0xC0,0x40,0x40,0x5C,0x50,0x70,0x48,0xEC,0x00,0x00,/*"k",75*/
0x00,0x00,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0xF8,0x00,0x00,/*"l",76*/
0x00,0x00,0x00,0x00,0x00,0xF0,0xA8,0xA8,0xA8,0xA8,0x00,0x00,/*"m",77*/
0x00,0x00,0x00,0x00,0x00,0xF0,0x48,0x48,0x48,0xEC,0x00,0x00,/*"n",78*/
0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x30,0x00,0x00,/*"o",79*/
0x00,0x00,0x00,0x00,0x00,0xF0,0x48,0x48,0x48,0x70,0x40,0xE0,/*"p",80*/
0x00,0x00,0x00,0x00,0x00,0x38,0x48,0x48,0x48,0x38,0x08,0x1C,/*"q",81*/
0x00,0x00,0x00,0x00,0x00,0xD8,0x60,0x40,0x40,0xE0,0x00,0x00,/*"r",82*/
0x00,0x00,0x00,0x00,0x00,0x78,0x40,0x30,0x08,0x78,0x00,0x00,/*"s",83*/
0x00,0x00,0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x18,0x00,0x00,/*"t",84*/
0x00,0x00,0x00,0x00,0x00,0xD8,0x48,0x48,0x48,0x3C,0x00,0x00,/*"u",85*/
0x00,0x00,0x00,0x00,0x00,0xEC,0x48,0x50,0x30,0x20,0x00,0x00,/*"v",86*/
0x00,0x00,0x00,0x00,0x00,0xA8,0xA8,0x70,0x50,0x50,0x00,0x00,/*"w",87*/
0x00,0x00,0x00,0x00,0x00,0xD8,0x50,0x20,0x50,0xD8,0x00,0x00,/*"x",88*/
0x00,0x00,0x00,0x00,0x00,0xEC,0x48,0x50,0x30,0x20,0x20,0xC0,/*"y",89*/
0x00,0x00,0x00,0x00,0x00,0x78,0x10,0x20,0x20,0x78,0x00,0x00,/*"z",90*/
0x00,0x18,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x18,0x00,/*"{",91*/
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,/*"|",92*/
0x00,0x60,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x60,0x00,/*"}",93*/
0x40,0xA4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"~",94*/
};
const struct rtgui_font_bitmap asc12 =
{
asc12_font, /* bmp */
RT_NULL, /* each character width, NULL for fixed font */
RT_NULL, /* offset for each character */
6, /* width */
12, /* height */
32, /* first char */
127 /* last char */
};
struct rtgui_font rtgui_font_asc12 =
{
"asc", /* family */
12, /* height */
1, /* refer count */
&bmp_font_engine, /* font engine */
(struct rtgui_font_bitmap *) &asc12, /* font private data */
};
-136
View File
@@ -1,136 +0,0 @@
/*
* File : asc16font.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#include <rtgui/font.h>
#ifdef RTGUI_USING_FONT16
const unsigned char asc16_font[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x18,0x18,0x00,0x00,/*"!",1*/
0x00,0x12,0x36,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*""",2*/
0x00,0x00,0x00,0x24,0x24,0x24,0xFE,0x48,0x48,0x48,0xFE,0x48,0x48,0x48,0x00,0x00,/*"#",3*/
0x00,0x00,0x10,0x38,0x54,0x54,0x50,0x30,0x18,0x14,0x14,0x54,0x54,0x38,0x10,0x10,/*"$",4*/
0x00,0x00,0x00,0x44,0xA4,0xA8,0xA8,0xA8,0x54,0x1A,0x2A,0x2A,0x2A,0x44,0x00,0x00,/*"%",5*/
0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x50,0x6E,0xA4,0x94,0x88,0x89,0x76,0x00,0x00,/*"&",6*/
0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"'",7*/
0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00,/*"(",8*/
0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00,/*")",9*/
0x00,0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0x38,0xD6,0x10,0x10,0x00,0x00,0x00,0x00,/*"*",10*/
0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x10,0x00,0x00,0x00,/*"+",11*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x20,0xC0,/*",",12*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",13*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,/*".",14*/
0x00,0x00,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,/*"/",15*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,/*"0",16*/
0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,/*"1",17*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,/*"2",18*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,/*"3",19*/
0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,/*"4",20*/
0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,/*"5",21*/
0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,/*"6",22*/
0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,/*"7",23*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,/*"8",24*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,/*"9",25*/
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,/*":",26*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x20,/*";",27*/
0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,/*"<",28*/
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,/*"=",29*/
0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00,/*">",30*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x02,0x04,0x08,0x08,0x00,0x18,0x18,0x00,0x00,/*"?",31*/
0x00,0x00,0x00,0x38,0x44,0x5A,0xAA,0xAA,0xAA,0xAA,0xB4,0x42,0x44,0x38,0x00,0x00,/*"@",32*/
0x00,0x00,0x00,0x10,0x10,0x18,0x28,0x28,0x24,0x3C,0x44,0x42,0x42,0xE7,0x00,0x00,/*"A",33*/
0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x44,0x42,0x42,0x42,0x44,0xF8,0x00,0x00,/*"B",34*/
0x00,0x00,0x00,0x3E,0x42,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x44,0x38,0x00,0x00,/*"C",35*/
0x00,0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00,/*"D",36*/
0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x42,0x42,0xFC,0x00,0x00,/*"E",37*/
0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x40,0x40,0xE0,0x00,0x00,/*"F",38*/
0x00,0x00,0x00,0x3C,0x44,0x44,0x80,0x80,0x80,0x8E,0x84,0x44,0x44,0x38,0x00,0x00,/*"G",39*/
0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,/*"H",40*/
0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,/*"I",41*/
0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0xF0,/*"J",42*/
0x00,0x00,0x00,0xEE,0x44,0x48,0x50,0x70,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00,/*"K",43*/
0x00,0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0xFE,0x00,0x00,/*"L",44*/
0x00,0x00,0x00,0xEE,0x6C,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x54,0x54,0xD6,0x00,0x00,/*"M",45*/
0x00,0x00,0x00,0xC7,0x62,0x62,0x52,0x52,0x4A,0x4A,0x4A,0x46,0x46,0xE2,0x00,0x00,/*"N",46*/
0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00,/*"O",47*/
0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0xE0,0x00,0x00,/*"P",48*/
0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0xB2,0xCA,0x4C,0x38,0x06,0x00,/*"Q",49*/
0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x7C,0x48,0x48,0x44,0x44,0x42,0xE3,0x00,0x00,/*"R",50*/
0x00,0x00,0x00,0x3E,0x42,0x42,0x40,0x20,0x18,0x04,0x02,0x42,0x42,0x7C,0x00,0x00,/*"S",51*/
0x00,0x00,0x00,0xFE,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,/*"T",52*/
0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,/*"U",53*/
0x00,0x00,0x00,0xE7,0x42,0x42,0x44,0x24,0x24,0x28,0x28,0x18,0x10,0x10,0x00,0x00,/*"V",54*/
0x00,0x00,0x00,0xD6,0x92,0x92,0x92,0x92,0xAA,0xAA,0x6C,0x44,0x44,0x44,0x00,0x00,/*"W",55*/
0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00,/*"X",56*/
0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,/*"Y",57*/
0x00,0x00,0x00,0x7E,0x84,0x04,0x08,0x08,0x10,0x20,0x20,0x42,0x42,0xFC,0x00,0x00,/*"Z",58*/
0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00,/*"[",59*/
0x00,0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08,0x08,0x04,0x04,0x04,0x02,0x02,/*"\",60*/
0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00,/*"]",61*/
0x00,0x1C,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"^",62*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,/*"_",63*/
0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"`",64*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x1E,0x22,0x42,0x42,0x3F,0x00,0x00,/*"a",65*/
0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x64,0x58,0x00,0x00,/*"b",66*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x22,0x1C,0x00,0x00,/*"c",67*/
0x00,0x00,0x00,0x06,0x02,0x02,0x02,0x1E,0x22,0x42,0x42,0x42,0x26,0x1B,0x00,0x00,/*"d",68*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x40,0x42,0x3C,0x00,0x00,/*"e",69*/
0x00,0x00,0x00,0x0F,0x11,0x10,0x10,0x7E,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,/*"f",70*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x44,0x44,0x38,0x40,0x3C,0x42,0x42,0x3C,/*"g",71*/
0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,/*"h",72*/
0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,/*"i",73*/
0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x78,/*"j",74*/
0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x4E,0x48,0x50,0x68,0x48,0x44,0xEE,0x00,0x00,/*"k",75*/
0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,/*"l",76*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x49,0x49,0x49,0x49,0x49,0xED,0x00,0x00,/*"m",77*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,/*"n",78*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,/*"o",79*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x44,0x78,0x40,0xE0,/*"p",80*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x22,0x42,0x42,0x42,0x22,0x1E,0x02,0x07,/*"q",81*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x32,0x20,0x20,0x20,0x20,0xF8,0x00,0x00,/*"r",82*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x40,0x3C,0x02,0x42,0x7C,0x00,0x00,/*"s",83*/
0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,/*"t",84*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00,/*"u",85*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x28,0x10,0x10,0x00,0x00,/*"v",86*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD7,0x92,0x92,0xAA,0xAA,0x44,0x44,0x00,0x00,/*"w",87*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x24,0x18,0x18,0x18,0x24,0x76,0x00,0x00,/*"x",88*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x28,0x18,0x10,0x10,0xE0,/*"y",89*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x08,0x10,0x10,0x22,0x7E,0x00,0x00,/*"z",90*/
0x00,0x03,0x04,0x04,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x04,0x04,0x03,0x00,/*"{",91*/
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,/*"|",92*/
0x00,0x60,0x10,0x10,0x10,0x10,0x10,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x60,0x00,/*"}",93*/
0x30,0x4C,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"~",94*/
};
struct rtgui_font_bitmap asc16 =
{
(const rt_uint8_t *)asc16_font, /* bmp */
RT_NULL, /* each character width, NULL for fixed font */
RT_NULL, /* offset for each character */
8, /* width */
16, /* height */
32, /* first char */
127 /* last char */
};
struct rtgui_font rtgui_font_asc16 =
{
"asc", /* family */
16, /* height */
1, /* refer count */
&bmp_font_engine, /* font engine */
&asc16, /* font private data */
};
#endif
File diff suppressed because it is too large Load Diff
-30
View File
@@ -1,30 +0,0 @@
/*
* File : color.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#include <rtgui/color.h>
const rtgui_color_t red = RTGUI_RGB(0xff, 0x00, 0x00);
const rtgui_color_t green = RTGUI_RGB(0x00, 0xff, 0x00);
const rtgui_color_t blue = RTGUI_RGB(0x00, 0x00, 0xff);
const rtgui_color_t black = RTGUI_RGB(0x00, 0x00, 0x00);
const rtgui_color_t white = RTGUI_RGB(0xff, 0xff, 0xff);
const rtgui_color_t high_light = RTGUI_RGB(0xff, 0xff, 0xff);
const rtgui_color_t dark_grey = RTGUI_RGB(0x7f, 0x7f, 0x7f);
const rtgui_color_t light_grey = RTGUI_RGB(0xc0, 0xc0, 0xc0);
#define RTGUI_RGB_R(c) ((c) & 0xff)
#define RTGUI_RGB_G(c) (((c) >> 8) & 0xff)
#define RTGUI_RGB_B(c) (((c) >> 16) & 0xff)
#define RTGUI_RGB_A(c) (((c) >> 24) & 0xff)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-161
View File
@@ -1,161 +0,0 @@
/*
* File : font.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#include <rtgui/font.h>
#include <rtgui/dc.h>
static rtgui_list_t _rtgui_font_list;
static struct rtgui_font *rtgui_default_font;
extern struct rtgui_font rtgui_font_asc16;
extern struct rtgui_font rtgui_font_arial16;
extern struct rtgui_font rtgui_font_asc12;
extern struct rtgui_font rtgui_font_arial12;
#ifdef RTGUI_USING_FONTHZ
extern struct rtgui_font rtgui_font_hz16;
extern struct rtgui_font rtgui_font_hz12;
#endif
void rtgui_font_system_init()
{
rtgui_list_init(&(_rtgui_font_list));
/* set default font to NULL */
rtgui_default_font = RT_NULL;
#ifdef RTGUI_USING_FONT16
rtgui_font_system_add_font(&rtgui_font_asc16);
#ifdef RTGUI_USING_FONTHZ
rtgui_font_system_add_font(&rtgui_font_hz16);
#endif
#endif
#ifdef RTGUI_USING_FONT12
rtgui_font_system_add_font(&rtgui_font_asc12);
#ifdef RTGUI_USING_FONTHZ
rtgui_font_system_add_font(&rtgui_font_hz12);
#endif
#endif
#ifdef RTGUI_USING_FONT12
if (rtgui_default_font == RT_NULL)
rtgui_font_set_defaut(&rtgui_font_asc12);
#endif
#ifdef RTGUI_USING_FONT16
if (rtgui_default_font == RT_NULL)
rtgui_font_set_defaut(&rtgui_font_asc16);
#endif
}
void rtgui_font_system_add_font(struct rtgui_font *font)
{
rtgui_list_init(&(font->list));
rtgui_list_append(&_rtgui_font_list, &(font->list));
/* init font */
if (font->engine->font_init != RT_NULL)
font->engine->font_init(font);
/* first refer, load it */
if (font->engine->font_load != RT_NULL)
font->engine->font_load(font);
}
RTM_EXPORT(rtgui_font_system_add_font);
void rtgui_font_system_remove_font(struct rtgui_font *font)
{
rtgui_list_remove(&_rtgui_font_list, &(font->list));
}
RTM_EXPORT(rtgui_font_system_remove_font);
struct rtgui_font *rtgui_font_default()
{
return rtgui_default_font;
}
void rtgui_font_set_defaut(struct rtgui_font *font)
{
rtgui_default_font = font;
}
struct rtgui_font *rtgui_font_refer(const char *family, rt_uint16_t height)
{
/* search font */
struct rtgui_list_node *node;
struct rtgui_font *font;
rtgui_list_foreach(node, &_rtgui_font_list)
{
font = rtgui_list_entry(node, struct rtgui_font, list);
if ((rt_strncmp(font->family, family, RTGUI_NAME_MAX) == 0) &&
font->height == height)
{
font->refer_count ++;
return font;
}
}
return RT_NULL;
}
RTM_EXPORT(rtgui_font_refer);
void rtgui_font_derefer(struct rtgui_font *font)
{
RT_ASSERT(font != RT_NULL);
font->refer_count --;
/* no refer, remove font */
if (font->refer_count == 0)
{
rtgui_font_system_remove_font(font);
}
}
/* draw a text */
void rtgui_font_draw(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect)
{
RT_ASSERT(font != RT_NULL);
if (font->engine != RT_NULL &&
font->engine->font_draw_text != RT_NULL)
{
font->engine->font_draw_text(font, dc, text, len, rect);
}
}
int rtgui_font_get_string_width(struct rtgui_font *font, const char *text)
{
rtgui_rect_t rect;
/* get metrics */
rtgui_font_get_metrics(font, text, &rect);
return rect.x2 - rect.x1;
}
void rtgui_font_get_metrics(struct rtgui_font *font, const char *text, rtgui_rect_t *rect)
{
RT_ASSERT(font != RT_NULL);
if (font->engine != RT_NULL &&
font->engine->font_get_metrics != RT_NULL)
{
font->engine->font_get_metrics(font, text, rect);
}
else
{
/* no font engine found, set rect to zero */
rt_memset(rect, 0, sizeof(rtgui_rect_t));
}
}
-185
View File
@@ -1,185 +0,0 @@
/*
* File : font.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-09-15 Bernard first version
*/
#include <rtgui/font.h>
#include <rtgui/dc.h>
/* bitmap font private data */
static void rtgui_bitmap_font_draw_text(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect);
static void rtgui_bitmap_font_get_metrics(struct rtgui_font *font, const char *text, rtgui_rect_t *rect);
const struct rtgui_font_engine bmp_font_engine =
{
RT_NULL,
RT_NULL,
rtgui_bitmap_font_draw_text,
rtgui_bitmap_font_get_metrics
};
void rtgui_bitmap_font_draw_char(struct rtgui_font_bitmap *font, struct rtgui_dc *dc, const char ch,
rtgui_rect_t *rect)
{
rtgui_color_t bc;
const rt_uint8_t *font_ptr;
rt_uint16_t x, y, w, h, style;
register rt_base_t i, j, /*k,*/ word_bytes;
/* check first and last char */
if (ch < font->first_char || ch > font->last_char) return;
/* get text style */
style = rtgui_dc_get_gc(dc)->textstyle;
bc = rtgui_dc_get_gc(dc)->background;
x = rect->x1;
y = rect->y1;
/* get width */
if (font->char_width == RT_NULL)
{
word_bytes = (((font->width - 1) / 8) + 1);
font_ptr = font->bmp + (ch - font->first_char) * word_bytes * font->height;
}
else
{
word_bytes = ((font->char_width[ch - font->first_char] - 1) / 8) + 1;
font_ptr = font->bmp + font->offset[ch - font->first_char];
}
w = (font->width + x > rect->x2) ? rect->x2 - rect->x1 : font->width;
h = (font->height + y > rect->y2) ? rect->y2 - rect->y1 : font->height;
for (i = 0; i < h; i++)
{
rt_uint8_t chr = 0;
const rt_uint8_t *ptr = font_ptr + i * word_bytes;
for (j = 0; j < w; j++)
{
if (j % 8 == 0)
chr = *ptr++;
if (chr & 0x80)
rtgui_dc_draw_point(dc, j + x, i + y);
else if (style & RTGUI_TEXTSTYLE_DRAW_BACKGROUND)
rtgui_dc_draw_color_point(dc, j + x, i + y, bc);
chr <<= 1;
}
}
}
static void rtgui_bitmap_font_draw_text(struct rtgui_font *font, struct rtgui_dc *dc,
const char *text, rt_ubase_t len, struct rtgui_rect *rect)
{
rt_uint32_t length;
struct rtgui_font_bitmap *bmp_font = (struct rtgui_font_bitmap *)(font->data);
#ifdef RTGUI_USING_FONTHZ
struct rtgui_font *hz_font;
RT_ASSERT(bmp_font != RT_NULL);
if (rect->y1 > rect->y2) return;
hz_font = rtgui_font_refer("hz", font->height);
while ((rect->x1 < rect->x2) && len)
{
length = 0;
while ((rt_uint8_t) * (text + length) >= 0x80) length ++; /* it's not a ascii character */
if (length > 0)
{
if (hz_font != RT_NULL) rtgui_font_draw(hz_font, dc, text, length, rect);
text += length;
len -= length;
}
length = 0;
while (((rt_uint8_t) * (text + length) < 0x80) && *(text + length)) length ++;
if (length > 0)
{
len -= length;
while (length-- && rect->x1 < rect->x2)
{
rtgui_bitmap_font_draw_char(bmp_font, dc, *text, rect);
/* move x to next character */
if (bmp_font->char_width == RT_NULL)
rect->x1 += bmp_font->width;
else
rect->x1 += bmp_font->char_width[*text - bmp_font->first_char];
text ++;
}
}
}
if (hz_font != RT_NULL) rtgui_font_derefer(hz_font);
#else
if (rect->y1 > rect->y2) return;
while ((rect->x1 < rect->x2) && len)
{
length = 0;
while (((rt_uint8_t) * (text + length) < 0x80) && *(text + length)) length ++;
if (length > 0)
{
len -= length;
while (length-- && rect->x1 < rect->x2)
{
rtgui_bitmap_font_draw_char(bmp_font, dc, *text, rect);
/* move x to next character */
if (bmp_font->char_width == RT_NULL)
rect->x1 += bmp_font->width;
else
rect->x1 += bmp_font->char_width[*text - bmp_font->first_char];
text ++;
}
}
}
#endif
}
static void rtgui_bitmap_font_get_metrics(struct rtgui_font *font, const char *text, rtgui_rect_t *rect)
{
rt_uint32_t length;
struct rtgui_font_bitmap *bmp_font = (struct rtgui_font_bitmap *)(font->data);
RT_ASSERT(bmp_font != RT_NULL);
/* set init metrics rect */
rect->x1 = rect->y1 = 0;
rect->x2 = 0;
rect->y2 = bmp_font->height;
while (*text)
{
length = 0;
while ((rt_uint8_t) * (text + length) >= 0x80) length ++; /* it's not a ascii character */
rect->x2 += (font->height / 2) * length;
text += length;
length = 0;
while (((rt_uint8_t) * (text + length) < 0x80) && *(text + length)) length ++;
if (bmp_font->char_width != NULL)
{
/* get width for each character */
while (*text && ((rt_uint8_t)*text < 0x80))
{
rect->x2 += bmp_font->char_width[*text - bmp_font->first_char];
text ++;
}
}
else
{
/* set metrics rect */
rect->x2 += bmp_font->width * length;
text += length;
}
}
}
File diff suppressed because it is too large Load Diff
-159
View File
@@ -1,159 +0,0 @@
#include <rtgui/dc.h>
#include <rtgui/font.h>
#ifdef RTGUI_USING_HZ_BMP
static void rtgui_hz_bitmap_font_draw_text(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect);
static void rtgui_hz_bitmap_font_get_metrics(struct rtgui_font *font, const char *text, rtgui_rect_t *rect);
const struct rtgui_font_engine hz_bmp_font_engine =
{
RT_NULL,
RT_NULL,
rtgui_hz_bitmap_font_draw_text,
rtgui_hz_bitmap_font_get_metrics
};
#ifdef RTGUI_USING_FONT_COMPACT
extern rt_uint32_t rtgui_font_mph12(const rt_uint16_t key);
extern rt_uint32_t rtgui_font_mph16(const rt_uint16_t key);
rt_inline const rt_uint8_t *_rtgui_hz_bitmap_get_font_ptr(struct rtgui_font_bitmap *bmp_font,
rt_uint8_t *str,
rt_base_t font_bytes)
{
rt_uint16_t cha = *(rt_uint16_t *)str;
int idx;
if (bmp_font->height == 16)
idx = rtgui_font_mph16(cha);
else // asume the height is 12
idx = rtgui_font_mph12(cha);
/* don't access beyond the data */
if (idx < 0)
idx = 0;
/* get font pixel data */
return bmp_font->bmp + idx * font_bytes;
}
#else
rt_inline const rt_uint8_t *_rtgui_hz_bitmap_get_font_ptr(struct rtgui_font_bitmap *bmp_font,
rt_uint8_t *str,
rt_base_t font_bytes)
{
rt_ubase_t sect, index;
/* calculate section and index */
sect = *str - 0xA0;
index = *(str + 1) - 0xA0;
/* get font pixel data */
return bmp_font->bmp + (94 * (sect - 1) + (index - 1)) * font_bytes;
}
#endif
static void _rtgui_hz_bitmap_font_draw_text(struct rtgui_font_bitmap *bmp_font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect)
{
rtgui_color_t bc;
rt_uint16_t style;
rt_uint8_t *str;
register rt_base_t h, word_bytes, font_bytes;
RT_ASSERT(bmp_font != RT_NULL);
/* get text style */
style = rtgui_dc_get_gc(dc)->textstyle;
bc = rtgui_dc_get_gc(dc)->background;
/* drawing height */
h = (bmp_font->height + rect->y1 > rect->y2) ? rect->y2 - rect->y1 : bmp_font->height;
word_bytes = (bmp_font->width + 7) / 8;
font_bytes = word_bytes * bmp_font->height;
str = (rt_uint8_t *)text;
while (len > 0 && rect->x1 < rect->x2)
{
const rt_uint8_t *font_ptr;
register rt_base_t i, j, k;
/* get font pixel data */
font_ptr = _rtgui_hz_bitmap_get_font_ptr(bmp_font, str, font_bytes);
/* draw word */
for (i = 0; i < h; i ++)
{
for (j = 0; j < word_bytes; j++)
for (k = 0; k < 8; k++)
{
if (((font_ptr[i * word_bytes + j] >> (7 - k)) & 0x01) != 0 &&
(rect->x1 + 8 * j + k < rect->x2))
{
rtgui_dc_draw_point(dc, rect->x1 + 8 * j + k, rect->y1 + i);
}
else if (style & RTGUI_TEXTSTYLE_DRAW_BACKGROUND)
{
rtgui_dc_draw_color_point(dc, rect->x1 + 8 * j + k, rect->y1 + i, bc);
}
}
}
/* move x to next character */
rect->x1 += bmp_font->width;
str += 2;
len -= 2;
}
}
static void rtgui_hz_bitmap_font_draw_text(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t length, struct rtgui_rect *rect)
{
rt_uint32_t len;
struct rtgui_font *efont;
struct rtgui_font_bitmap *bmp_font = (struct rtgui_font_bitmap *)(font->data);
RT_ASSERT(dc != RT_NULL);
/* get English font */
efont = rtgui_font_refer("asc", bmp_font->height);
if (efont == RT_NULL) efont = rtgui_font_default(); /* use system default font */
while (length > 0)
{
len = 0;
while (((rt_uint8_t) * (text + len)) < 0x80 && *(text + len) && len < length) len ++;
/* draw text with English font */
if (len > 0)
{
rtgui_font_draw(efont, dc, text, len, rect);
text += len;
length -= len;
}
len = 0;
while (((rt_uint8_t) * (text + len)) >= 0x80 && len < length) len ++;
if (len > 0)
{
_rtgui_hz_bitmap_font_draw_text(bmp_font, dc, text, len, rect);
text += len;
length -= len;
}
}
rtgui_font_derefer(efont);
}
static void rtgui_hz_bitmap_font_get_metrics(struct rtgui_font *font, const char *text, rtgui_rect_t *rect)
{
struct rtgui_font_bitmap *bmp_font = (struct rtgui_font_bitmap *)(font->data);
RT_ASSERT(bmp_font != RT_NULL);
/* set metrics rect */
rect->x1 = rect->y1 = 0;
/* Chinese font is always fixed font */
rect->x2 = (rt_int16_t)(bmp_font->width * rt_strlen((const char *)text));
rect->y2 = bmp_font->height;
}
#endif
File diff suppressed because it is too large Load Diff
-35
View File
@@ -1,35 +0,0 @@
/* adapted from utils/perfect_hash/example1-C/states-tmpl.c */
#include <rtthread.h>
#include <string.h>
static const rt_uint32_t T1[] = { $S1 };
static const rt_uint32_t T2[] = { $S2 };
static const rt_uint16_t G[] = { $G };
static rt_uint32_t hash_g(const rt_uint16_t key, const rt_uint32_t *T)
{
rt_uint32_t sum = (T[0] * (key & 0xFF) + T[1] * (key >> 8)) % $NG;
return G[sum % $NG];
}
static rt_uint32_t perfect_hash(const rt_uint16_t key)
{
return (hash_g(key, T1) + hash_g(key, T2)) % $NG;
}
rt_uint32_t rtgui_font_mph${height}(const rt_uint16_t key)
{
rt_uint32_t hash_value = perfect_hash(key);
/*rt_kprintf("hash 0x7684 is %d", perfect_hash(0x7684));*/
/*RT_ASSERT(K[hash_value] == key);*/
/* NOTE: we trust you will not feed invalid data into me. So there is no
* more sanity check which will consume more flash and memory. */
if (hash_value < $NK)
return hash_value;
return -1;
}
const unsigned char hz${height}_font[] = { $font_data };
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-69
View File
@@ -1,69 +0,0 @@
RTGUI 0.6版发布纪要
# 为什么是 0.6?
RTGUI 是作为 RT-Thread 的一个组件存在的。这次新发布的版本是在原 RTGUI 基础上重
构而来的。原 RTGUI 没有独立的版本号。暂设其为 0.5。所以本版本号取 0.6,为在原有
基础上改进之意。以后我们会每个月发布一个新版本。下一个版本号会是 0.6.1。
# 运行环境
理论上原来可以运行 RTGUI 的设备上都可以运行新的 RTGUI。本版本自带一个 Windows
模拟器,用来方便地评估运行效果。默认的运行环境是 realtouch。RT-Thread 中的模拟
器也是可以运作的。
# 新版本有什么特点?
0. 新版本的 GUI 摒弃了原有的 workbench/view/window 的工作方式。转换成全面向
window的工作方式。原有的 workbench/view 可以用 notebook 来实现。
0. 用 `rtgui_app` 对线程进行了抽象。
0. 事件驱动更彻底:
0. 将事件处理机制集成进 `rtgui_object`。
0. 添加了`RTGUI_EVENT_SHOW` 和 `RTGUI_EVENT_HIDE` 来通知控件将要被显示/隐藏。
0. 底层代码中对事件的应用更加彻底。
0. 重构了自动布局方式。使得控件的摆放更加方便。
# 增强
- 添加了 TJPGD 引擎。使得小内存系统解码 jpeg 图片成为可能。(onelife)
- 添加了对单色屏的支持(onelife)
- bmp 图像引擎的重构(onelife)
- bmp 图像的旋转/缩放,以及功能性增强(amsl)
- 增加屏幕快照功能(amsl)
- PNG 引擎增加 Alpha 通道支持(amsl)
- 新增 edit 多行文本编辑控件。(amsl)
- 增加了 Model/View 的编程框架。(Grissiom)
- 添加了缩减字库的特性,开启后可以自动添加用到的汉字,不用的汉字字形不会加入到
字库当中。使得 GUI 能够在小 ROM 系统上得以应用。(Grissiom)
- 新增 digtube 七段码显示控件(prife)
- demo/benchmark 新增了 FPS 输出(amsl)
- 新增 box/panel/groupbox,支持自动布局(Bernard)
# API 变化
除了 workbench/view 的消失以外,还有如下的 API 变化:
- c05a301, 68e3e30: `rtgui_{menu,win}_hiden` 被重命名为 `rtgui_{menu,win}_hide`。
- 05e4894: 将 `struct rtgui_widget` 中的 `mini_{height,width}` 重命名为 `min_{height,width}`。
- 等等……
今后很长时间内,新版本的 RTGUI 会与此版本的 API 尽量只增不减,保持兼容。
# Bug fixes
- 00a6690: 解决了 `rtgui_notebook_set_current_by_index` 中重绘标签页的 bug。感
谢 prife 提交 bug 信息和补丁。
- 6850ff2: 解决了 `last_mevent_widget` 引起的事件传送失败。感谢 heryon 提交bug
报告。
- 9143e11: 解决了 jpeg 引擎中的内存泄漏。感谢 Young 提供 bug 信息。
- fbd567c: 解决了 `rtgui_textbox_set_line_length` 的 bug。
- 9b67b66: 修复了窗口标题栏渐变效果的绘制。
- fc3abbf: 修复了 `rtgui_label_set_text`。感谢 tanghong668 提供 bug 信息。
- d41586c: 修复了窗口激活时重复刷新的问题。感谢 onelife 提供 bug 信息。
- ab08de6: 修复了字库缓存的 bug。感谢 rtt\_fans 提供 bug 信息。
- 等等……
除了上面提到的,luoyuncong2012, lgnq, shaolin 也有贡献。上面的列表也必然是不完
整的。感谢编写了第一版 RTGUI 的 Bernard 和其他大侠们,没有他们的辛勤劳动,也不
会有今天的版本。感谢各位使用和支持RTGUI的开发人员,是你们 RTGUI 体现了 RTGUI 的
价值。
-18
View File
@@ -1,18 +0,0 @@
1, 对同一 window 销毁两次会引起 segfault。同时,如果在创建时设置了
RTGUI_WIN_STYLE_DESTROY_ON_CLOSE,close 窗口之后不要再去销毁窗口。
2, 所有的 window 由 topwin 进行管理,用户不要在指定创建具有父窗口的子窗口之后在
把这个窗口加为父窗口的 child。这可能会导致子窗口无法显示。
3, command 事件添加了 wid 参数,用于指定此事件需要传递的目标窗口。
4, 在 widget 中添加了 on_show 和 on_hide 事件回调函数。他们会在控件显示/隐藏的
时候被调用。
5, slider 控件改为左键减小数值,右键增加数值。横向的 slider 处理左右键,纵向的
slider 处理上下键,上面的值小,下面的值大。
6, view 不再提供 show 方法。如果想单独显示控件,请用 window 包含之。
7, 若窗口在销毁(destroy)时没有关闭,则 RTGUI 会先关闭之。也会调用 on_close 函数
但是此函数的返回值会被忽略。
@@ -1,70 +0,0 @@
RTGUI for 1.1 路线图(排名不分先后)
1, 把 rtgui_thread 给去掉,变成 rtgui_application ,消除原来的 rtgui_thread +
mq 的模式。rtgui_application 记录当前依附的 panel,和 panel 的 extent。(Done)
1.1, rtgui_application_run 运行主事件循环(Done)
1.2, rtgui_application 作为事件的接收者_和_事件派发者。(Done)
2, workbench,window并成一个,其事件主循环并合并到rtgui_application中。
2.1, window 作为有标题栏的 workbench(Done)
2.2, 将其事件主循环移至 application 中。(Done)
2.3, 将 window 的父类 toplevel 合并进 window 中。所有直接与服务器打交道的从
window 继承。(或者将 toplevel 合并进 application 中,因为只有 application 才
会和服务器打交道。)
2.4 在创建 window 的时候需要指定 parent,如果为 RT_NULL,则此 window 为 root
窗口,parent 为当前 rtgui_application。每一个 application 必须有且只有一个根
窗口。(Done)
2.5 添加一个 FULL_PANEL 的 STYLE。指定此 STYLE 之后会自动填满整个 panel。其
与 NO_TITLE 之类的合用可以达到之前 workbench 的效果。(Deprecated)
2.6 event_loop 可以设定顶层控件,只会把事件传递给顶层控件。这样可以方便的实
现模态窗口。event_loop 靠 object 的一个标志位来判断是否要退出当前循环。(Done)
3, 将 view 合并进 container,所有容器类继承 container。[note1](Done)
4, 事件循环完成后不主动销毁控件,销毁任务交由用户完成。但是有些自动销毁是必要的
,比如 container 自动销毁其包含的控件(Done)
4.1 对于 window 的 onclose事件,保证在其回调函数中可以(但不是必须)安全销毁窗
口。这个功能不保证能够实现。(onclose 是在将要关闭窗口的时候触发的,调用它之
后 RTGUI 还要进行其他的设置和清理工作,所以不能在 onclose 里销毁窗口)(Cannot
Implement)
4.2 对 window 添加 RTGUI_WIN_STYLE_DESTROY_ON_CLOSE 。使得其在被关闭时自动销
毁。注意:对同一 window 销毁两次会引起 segfault。同时,如果在创建时设置了
RTGUI_WIN_STYLE_DESTROY_ON_CLOSE,close 窗口之后不要再去销毁窗口。
5, API 清理。更详细的文档。
6, 使 panel 退化为无窗口标题的 window,这样 server 就只记录 window 一种东西的位
置。(Done, 删除了 panel,使得整体以 window 为主)
7, 指定名称的时候不再自己拷贝一份。(我觉得 90% 的情况下名称都是静态的字符串,这
时用 strdup其实并没有必要。)(Deprecated)
8, 添加一些工业控制当中用到的波形、仪表之类的控件。
9, 在 window 中记录焦点控件,键盘事件由 window 直接投送。各个控件不记录焦点控件
。(Done)
10, 在 widget 中添加 on_show 和 on_hide 事件回调函数。(Done)
11, 添加 EVENT_WIN_MODAL_ENTER 和 EVENT_WIN_MODAL_EXIT 事件,用来通知窗口管理器
(topwin)一个窗口进入模态。窗口管理器根据这个进行相应的设置。(Done)
12, rtgui_filelist_view 不必继承自 container。(Deprecated)
13, 添加 desktop window 支持。(Done)
概念与名词:
13.1 desktop window:最底层的桌面窗口。它会在所有窗口下面显示,并且不会被它
上面的窗口模态掉。它的子窗口是 root window。(继承关系由 RTGUI 管理,不
用用户管理)它只有在启用 RTGUI_USING_DESKTOP_WINDOW 时才有此特性。
13.2 root window:创建时父窗口为 RT_NULL 的窗口。是用户空间窗口继承树的根。
13.3 normal window:创建时父窗口不为 RT_NULL 的窗口。它始终会在父窗口之上显
示(它会 clip 父窗口)。normal windows 和 root window 组成一个窗口树。
13.4 模态:当一个 normal window 模态显示时会会模态自己所在树的同级窗口
和所有父级窗口,但不会影响别的窗口树。被模态的窗口不会接受到用户事
件(按键,触摸等)
----
[note1] 我们至少需要一种容器控件来盛放其他的控件,并且能把上层事件传递给被包含
的控件。实现这样的功能有一个就好,container 可以担当这个责任。其他需要放多个控
件的控件则可以继承/包含这个控件。然后多个容器控件轮换的,notebook 可以来做。
notebook可以是有标签和无标签的,有标签的对应一般的 tab 控件,无标签的对应 rtgui
for RTT 1.0 的 workbench+view。
-81
View File
@@ -1,81 +0,0 @@
/** @~english
@page pg-mv-model Model-View framework
@brief A overview of the Model-View framework
@section Glossary
@li view: widget dedicated to show the data. It could be a graph, list etc.
@li model: abstraction and combination of data.
@li data: things that needed to be delivered or shown. It could be a array of
votage values which is sampled from a AD in an interval. Or it could be the
attributes of all the files in a folder.
@section Design considerations and implementations
@li one model can respond to more than one views. one view can connect to
more than one models.
@li It is guaranteed that the change events of a model will be sent to all
the registered views.
@li Because there are so many formats of data, Model-View neither specify the
format data is stored nor try to abstract them. The only thing stored in
model is a pointer to the underlaying data. It is the responsibility of
inherited classed to implement the boxing/un-boxing operations.
@li Data can be multi-dimensional. The "dimension" does not only means
dimension geometry. It can also means attributes. For example, a folder could
have two attributes which are name and icon. So it's two-dimensional. If take
the size into consideration, it will be three-dimensional. The size of
dimension is saved in model. Each dimension is correspond to a pointer to some
sort of data. Model can save many of them. As above, model does not make
assumptions on the underlaying data structure. It only provide mechanism, not
policy and leave that to the inherited classes.
@section Events
@li model has a record of registered views. When data changes, model notify
views the change by sending events. The event contains the id of the model,
the id of target view, the scope of changed data.
@li views can handle the event by retrieve data from model, and update
themselves according to the scope that data has changed. The connected model
views should have the same presentation of data structure. Views should also
restore all the models it interested. In the case of repainting, it should
re-retrieve data from those models.
@li model send events by rtgui_send. So it's suitable for the synchronization
between threads and even could be used in ISR.
*/
/** @~chinese
@page pg-mv-model Model-View 框架
@brief 对于 Model-View 框架的简介
@section 名词解释
@li view:用于显示数据的控件。可以是诸如图表控件、列表控件的控件。
@li model:对于数据的组合和抽象。
@li 数据:需要显示或传递的数据。它可以是每隔一段时间就从AD读取的电压值,也可
以是一个目录下所有文件的属性列表。
@section 设计原则和实现
@li 一个 model 可以对应多个view。一个view可以对应多个 model。
@li 保证 model 的更新事件会同时发送到所有注册的 view 上。
@li 因为数据的形式与内容千差万别,所以 Model-View 不规定数据的存储形式,也不对其进
行抽象。只在 model 中保留指向第一个数据的指针。打包/解包由从m odel/view 派生出
的子类实现。
@li 数据源可以是多维的。这里的维度指的不只是几何的维度,而且可以是属性。比如
一个目录,它可以有名称、图标两个属性,那么它就是两维的。如果加入大小这个属性
,就是三维的。 model 内部存储数据的维度大小。一个维度对应一个数据首地址的指针
。model 中可以存储多个数据首地址。model 对底层数据结构不作假设。只提供机制,不
提供策略。只保证能够多维,但把具体的实现方式留给子类实现。
@subsection 事件
@li model 内部记录对自己感兴趣的 view。在数据变化时,用事件通知所有相关 view。事
件内容包含:自己的 id;目标 view 的 id;所变化数据的 index 范围。
@li view 收到事件之后通过 model id 拿到数据并根据事件中的变化范围更新自己。对于
指针的数据类型转换需要自己实现并保证和 model 一致。view 内部保存与自己相关的
model id,在需要重绘的时候要从所有相关 model 提取数据。
@li model 通过 rtgui_send 给 view 发送事件。使得这个模型适用于线程间同步,也
可以在中断上下文里通知事件的发生。
*/
-10
View File
@@ -1,10 +0,0 @@
#ifndef __RTGUI_BLIT_H__
#define __RTGUI_BLIT_H__
#include <rtgui/rtgui.h>
typedef void (*rtgui_blit_line_func)(rt_uint8_t *dst, rt_uint8_t *src, int line);
rtgui_blit_line_func rtgui_blit_line_get(int dst_bpp, int src_bpp);
rtgui_blit_line_func rtgui_blit_line_get_inv(int dst_bpp, int src_bpp);
#endif
-139
View File
@@ -1,139 +0,0 @@
/*
* File : color.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
* 2012-01-24 onelife add mono color support
*/
#ifndef __RTGUI_COLOR_H__
#define __RTGUI_COLOR_H__
#include <rtgui/rtgui.h>
#define RTGUI_ARGB(a, r, g, b) \
((rtgui_color_t)(((rt_uint8_t)(r)|\
(((unsigned)(rt_uint8_t)(g))<<8))|\
(((unsigned long)(rt_uint8_t)(b))<<16)|\
(((unsigned long)(rt_uint8_t)(a))<<24)))
#define RTGUI_RGB(r, g, b) RTGUI_ARGB(255, (r), (g), (b))
#define RTGUI_RGB_R(c) ((c) & 0xff)
#define RTGUI_RGB_G(c) (((c) >> 8) & 0xff)
#define RTGUI_RGB_B(c) (((c) >> 16) & 0xff)
#define RTGUI_RGB_A(c) (((c) >> 24) & 0xff)
extern const rtgui_color_t default_foreground;
extern const rtgui_color_t default_background;
extern const rtgui_color_t red;
extern const rtgui_color_t green;
extern const rtgui_color_t blue;
extern const rtgui_color_t black;
extern const rtgui_color_t white;
extern const rtgui_color_t high_light;
extern const rtgui_color_t dark_grey;
extern const rtgui_color_t light_grey;
/*
* RTGUI default color format
* BBBB BBBB GGGG GGGG RRRR RRRR
*/
/* convert rtgui color to mono */
rt_inline rt_uint8_t rtgui_color_to_mono(rtgui_color_t c)
{
rt_uint8_t pixel;
pixel = (RTGUI_RGB_R(c) | RTGUI_RGB_G(c) | RTGUI_RGB_B(c)) ? 0x01 : 0x00;
return pixel;
}
rt_inline rtgui_color_t rtgui_color_from_mono(rt_uint8_t pixel)
{
rtgui_color_t color;
if (pixel)
{
color = white;
}
else
{
color = black;
}
return color;
}
/* convert rtgui color to BBBBBGGGGGGRRRRR */
rt_inline rt_uint16_t rtgui_color_to_565(rtgui_color_t c)
{
rt_uint16_t pixel;
pixel = (rt_uint16_t)(((RTGUI_RGB_B(c) >> 3) << 11) | ((RTGUI_RGB_G(c) >> 2) << 5) | (RTGUI_RGB_R(c) >> 3));
return pixel;
}
rt_inline rtgui_color_t rtgui_color_from_565(rt_uint16_t pixel)
{
rt_uint16_t r, g, b;
rtgui_color_t color;
r = pixel & 0x1f;
g = (pixel >> 5) & 0x3f;
b = (pixel >> 11) & 0x1f;
color = r * 255 / 31 + ((g * 255 / 63) << 8) + ((b * 255 / 31) << 16);
return color;
}
/* convert rtgui color to RRRRRGGGGGGBBBBB */
rt_inline rt_uint16_t rtgui_color_to_565p(rtgui_color_t c)
{
rt_uint16_t pixel;
pixel = (rt_uint16_t)(((RTGUI_RGB_R(c) >> 3) << 11) | ((RTGUI_RGB_G(c) >> 2) << 5) | (RTGUI_RGB_B(c) >> 3));
return pixel;
}
rt_inline rtgui_color_t rtgui_color_from_565p(rt_uint16_t pixel)
{
rt_uint8_t r, g, b;
rtgui_color_t color;
r = (pixel >> 11) & 0x1f;
g = (pixel >> 5) & 0x3f;
b = pixel & 0x1f;
color = r * 255 / 31 + ((g * 255 / 63) << 8) + ((b * 255 / 31) << 16);
return color;
}
/* convert rtgui color to RGB */
rt_inline rt_uint32_t rtgui_color_to_888(rtgui_color_t c)
{
rt_uint32_t pixel;
pixel = RTGUI_RGB_R(c) << 16 | RTGUI_RGB_G(c) << 8 | RTGUI_RGB_B(c);
return pixel;
}
rt_inline rtgui_color_t rtgui_color_from_888(rt_uint32_t pixel)
{
rtgui_color_t color;
color = RTGUI_RGB(((pixel >> 16) & 0xff), ((pixel >> 8) & 0xff), pixel & 0xff);
return color;
}
#endif
File diff suppressed because it is too large Load Diff
@@ -1,27 +0,0 @@
/*
* File : dc_buffer.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-04-10 Bernard first version
* 2010-06-14 Bernard embedded hardware dc to each widget
* 2010-08-09 Bernard rename hardware dc to client dc
*/
#ifndef __RTGUI_DC_CLIENT_H__
#define __RTGUI_DC_CLIENT_H__
#include <rtgui/dc.h>
/* create a hardware dc */
struct rtgui_dc *rtgui_dc_client_create(rtgui_widget_t *owner);
void rtgui_dc_client_init(rtgui_widget_t *owner);
#endif
-24
View File
@@ -1,24 +0,0 @@
/*
* File : dc_buffer.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-04-10 Bernard first version
* 2010-06-14 Bernard embedded hardware dc to each widget
*/
#ifndef __RTGUI_DC_HW_H__
#define __RTGUI_DC_HW_H__
#include <rtgui/dc.h>
/* create a hardware dc */
struct rtgui_dc *rtgui_dc_hw_create(rtgui_widget_t *owner);
#endif
-119
View File
@@ -1,119 +0,0 @@
/*
* File : dlist.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2006-03-16 Bernard the first version
* 2006-09-07 Bernard move the kservice APIs to rtthread.h
* 2007-06-27 Bernard fix the rt_list_remove bug
* 2012-02-25 Grissiom move to rtgui/include/rtgui and some misc changes
*/
#ifndef __RTGUI_DLIST_H__
#define __RTGUI_DLIST_H__
/* This file is copied from kservice.h in RTT kernel. There are some differences:
* 1, naming. Use rtgui_dlist_ prefix instead of rt_list.
* 2, add rtgui_dlist_foreach for convenience.
* 3, move the definition of list node into this file.
*
* Please keep both of the files synchronized when fixing bugs.
*/
#ifdef __cplusplus
extern "C" {
#endif
struct rtgui_dlist_node
{
struct rtgui_dlist_node *next; /* point to next node. */
struct rtgui_dlist_node *prev; /* point to prev node. */
};
/**
* @brief initialize a list
*
* @param l list to be initialized
*/
rt_inline void rtgui_dlist_init(struct rtgui_dlist_node *l)
{
l->next = l->prev = l;
}
/**
* @brief insert a node after a list
*
* @param l list to insert it
* @param n new node to be inserted
*/
rt_inline void rtgui_dlist_insert_after(struct rtgui_dlist_node *l, struct rtgui_dlist_node *n)
{
l->next->prev = n;
n->next = l->next;
l->next = n;
n->prev = l;
}
/**
* @brief insert a node before a list
*
* @param n new node to be inserted
* @param l list to insert it
*/
rt_inline void rtgui_dlist_insert_before(struct rtgui_dlist_node *l, struct rtgui_dlist_node *n)
{
l->prev->next = n;
n->prev = l->prev;
l->prev = n;
n->next = l;
}
/**
* @brief remove node from list.
* @param n the node to remove from the list.
*/
rt_inline void rtgui_dlist_remove(struct rtgui_dlist_node *n)
{
n->next->prev = n->prev;
n->prev->next = n->next;
rtgui_dlist_init(n);
}
/**
* @brief tests whether a list is empty
* @param l the list to test.
*/
rt_inline int rtgui_dlist_isempty(const struct rtgui_dlist_node *l)
{
return l->next == l;
}
/**
* @brief get the struct for this entry
* @param node the entry point
* @param type the type of structure
* @param member the name of list in structure
*/
#define rtgui_dlist_entry(node, type, member) \
((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))
/* the direction can only be next or prev. If you want to iterate the list in
* normal order, use next. If you want to iterate the list with reverse order,
* use prev.*/
#define rtgui_dlist_foreach(node, list, direction) \
for ((node) = (list)->direction; (node) != list; (node) = (node)->direction)
#ifdef __cplusplus
}
#endif
#endif
-99
View File
@@ -1,99 +0,0 @@
/*
* File : driver.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
*/
#ifndef __RTGUI_DRIVER_H__
#define __RTGUI_DRIVER_H__
#include <rtgui/list.h>
#include <rtgui/color.h>
/* graphic driver operations */
struct rtgui_graphic_driver_ops
{
/* set and get pixel in (x, y) */
void (*set_pixel)(rtgui_color_t *c, int x, int y);
void (*get_pixel)(rtgui_color_t *c, int x, int y);
void (*draw_hline)(rtgui_color_t *c, int x1, int x2, int y);
void (*draw_vline)(rtgui_color_t *c, int x , int y1, int y2);
/* draw raw hline */
void (*draw_raw_hline)(rt_uint8_t *pixels, int x1, int x2, int y);
};
/* graphic extension operations */
struct rtgui_graphic_ext_ops
{
/* some 2D operations */
void (*draw_line)(rtgui_color_t *c, int x1, int y1, int x2, int y2);
void (*draw_rect)(rtgui_color_t *c, int x1, int y1, int x2, int y2);
void (*fill_rect)(rtgui_color_t *c, int x1, int y1, int x2, int y2);
void (*draw_circle)(rtgui_color_t *c, int x, int y, int r);
void (*fill_circle)(rtgui_color_t *c, int x, int y, int r);
void (*draw_ellipse)(rtgui_color_t *c, int x, int y, int rx, int ry);
void (*fill_ellipse)(rtgui_color_t *c, int x, int y, int rx, int ry);
};
struct rtgui_graphic_driver
{
/* pixel format and byte per pixel */
rt_uint8_t pixel_format;
rt_uint8_t bits_per_pixel;
rt_uint16_t pitch;
/* screen width and height */
rt_uint16_t width;
rt_uint16_t height;
/* framebuffer address and ops */
volatile rt_uint8_t *framebuffer;
struct rt_device* device;
const struct rtgui_graphic_driver_ops *ops;
const struct rtgui_graphic_ext_ops *ext_ops;
};
struct rtgui_graphic_driver *rtgui_graphic_driver_get_default(void);
void rtgui_graphic_driver_get_rect(const struct rtgui_graphic_driver *driver, rtgui_rect_t *rect);
void rtgui_graphic_driver_screen_update(const struct rtgui_graphic_driver *driver, rtgui_rect_t *rect);
rt_uint8_t *rtgui_graphic_driver_get_framebuffer(const struct rtgui_graphic_driver *driver);
rt_uint8_t *rtgui_graphic_driver_get_default_framebuffer(void);
rt_err_t rtgui_graphic_set_device(rt_device_t device);
rt_inline struct rtgui_graphic_driver *rtgui_graphic_get_device()
{
extern struct rtgui_graphic_driver _driver;
return &_driver;
}
#ifdef RTGUI_USING_HW_CURSOR
/*
* hardware cursor
*/
enum rtgui_cursor_type
{
RTGUI_CURSOR_ARROW,
RTGUI_CURSOR_HAND,
};
void rtgui_cursor_set_device(const char* device_name);
void rtgui_cursor_set_position(rt_uint16_t x, rt_uint16_t y);
void rtgui_cursor_set_image(enum rtgui_cursor_type type);
#endif
#endif
File diff suppressed because it is too large Load Diff
-60
View File
@@ -1,60 +0,0 @@
/*
* File : filerw.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_FILERW_H__
#define __RTGUI_FILERW_H__
#ifdef RTGUI_USING_DFS_FILERW
#ifdef _WIN32_NATIVE
#pragma warning(disable: 4996)
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#else
#include <dfs_posix.h>
#endif
#endif
#include <rtgui/rtgui.h>
#define RTGUI_FILE_SEEK_SET 0
#define RTGUI_FILE_SEEK_CUR 1
#define RTGUI_FILE_SEEK_END 2
struct rtgui_filerw
{
int (*seek)(struct rtgui_filerw *context, rt_off_t offset, int whence);
int (*read)(struct rtgui_filerw *context, void *buffer, rt_size_t size, rt_size_t count);
int (*write)(struct rtgui_filerw *context, const void *buffer, rt_size_t size, rt_size_t count);
int (*tell)(struct rtgui_filerw *context);
int (*eof)(struct rtgui_filerw *context);
int (*close)(struct rtgui_filerw *context);
};
typedef struct rtgui_filerw rtgui_filerw_t;
struct rtgui_filerw *rtgui_filerw_create_file(const char *filename, const char *mode);
struct rtgui_filerw *rtgui_filerw_create_mem(const rt_uint8_t *mem, rt_size_t size);
int rtgui_filerw_seek(struct rtgui_filerw *context, rt_off_t offset, int whence);
int rtgui_filerw_read(struct rtgui_filerw *context, void *buffer, rt_size_t size, rt_size_t count);
int rtgui_filerw_write(struct rtgui_filerw *context, const void *buffer, rt_size_t size, rt_size_t count);
int rtgui_filerw_tell(struct rtgui_filerw *context);
int rtgui_filerw_eof(struct rtgui_filerw *context);
int rtgui_filerw_close(struct rtgui_filerw *context);
int rtgui_filerw_unlink(const char *filename);
/* get memory data from filerw memory object */
const rt_uint8_t *rtgui_filerw_mem_getdata(struct rtgui_filerw *context);
#endif
-118
View File
@@ -1,118 +0,0 @@
/*
* File : font.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_FONT_H__
#define __RTGUI_FONT_H__
#include <rtgui/rtgui.h>
#include <rtgui/list.h>
struct rtgui_font;
struct rtgui_dc;
struct rtgui_rect;
struct rtgui_font_engine
{
/* font engine function */
void (*font_init)(struct rtgui_font *font);
void (*font_load)(struct rtgui_font *font);
void (*font_draw_text)(struct rtgui_font *font, struct rtgui_dc *dc, const char *text,
rt_ubase_t len, struct rtgui_rect *rect);
void (*font_get_metrics)(struct rtgui_font *font, const char *text, struct rtgui_rect *rect);
};
/*
* bitmap font engine
*/
struct rtgui_font_bitmap
{
const rt_uint8_t *bmp; /* bitmap font data */
const rt_uint8_t *char_width; /* each character width, NULL for fixed font */
const rt_uint32_t *offset; /* offset for each character */
rt_uint16_t width; /* font width */
rt_uint16_t height; /* font height */
rt_uint8_t first_char;
rt_uint8_t last_char;
};
extern const struct rtgui_font_engine bmp_font_engine;
#include <rtgui/tree.h>
SPLAY_HEAD(cache_tree, hz_cache);
struct hz_cache
{
SPLAY_ENTRY(hz_cache) hz_node;
rt_uint16_t hz_id;
};
struct rtgui_hz_file_font
{
struct cache_tree cache_root;
rt_uint16_t cache_size;
/* font size */
rt_uint16_t font_size;
rt_uint16_t font_data_size;
/* file descriptor */
int fd;
/* font file name */
const char *font_fn;
};
extern const struct rtgui_font_engine rtgui_hz_file_font_engine;
struct rtgui_font
{
/* font name */
char *family;
/* font height */
rt_uint16_t height;
/* refer count */
rt_uint32_t refer_count;
/* font engine */
const struct rtgui_font_engine *engine;
/* font private data */
void *data;
/* the font list */
rtgui_list_t list;
};
typedef struct rtgui_font rtgui_font_t;
void rtgui_font_system_init(void);
void rtgui_font_system_add_font(struct rtgui_font *font);
void rtgui_font_system_remove_font(struct rtgui_font *font);
struct rtgui_font *rtgui_font_default(void);
void rtgui_font_set_defaut(struct rtgui_font *font);
struct rtgui_font *rtgui_font_refer(const char *family, rt_uint16_t height);
void rtgui_font_derefer(struct rtgui_font *font);
/* draw a text */
void rtgui_font_draw(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect);
int rtgui_font_get_string_width(struct rtgui_font *font, const char *text);
void rtgui_font_get_metrics(struct rtgui_font *font, const char *text, struct rtgui_rect *rect);
/* used by stract font */
#define FONT_BMP_DATA_BEGIN
#define FONT_BMP_DATA_END
#endif
@@ -1,10 +0,0 @@
#ifndef __RTGUI_FONT_TTF_H__
#define __RTGUI_FONT_TTF_H__
#include <rtgui/dc.h>
#include <rtgui/font.h>
rtgui_font_t *rtgui_freetype_font_create(const char *filename, int bold, int italic, rt_size_t size);
void rtgui_freetype_font_destroy(rtgui_font_t *font);
#endif
-91
View File
@@ -1,91 +0,0 @@
/*
* File : image.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_IMAGE_H__
#define __RTGUI_IMAGE_H__
#include <rtgui/dc.h>
#include <rtgui/filerw.h>
#include <rtgui/region.h>
enum rtgui_img_zoom
{
RTGUI_IMG_ZOOM_NEAREST,
RTGUI_IMG_ZOOM_BILINEAR
};
struct rtgui_image;
struct rtgui_image_engine
{
const char *name;
struct rtgui_list_node list;
/* image engine function */
rt_bool_t (*image_check)(struct rtgui_filerw *file);
rt_bool_t (*image_load)(struct rtgui_image *image, struct rtgui_filerw *file, rt_bool_t load);
void (*image_unload)(struct rtgui_image *image);
void (*image_blit)(struct rtgui_image *image, struct rtgui_dc *dc, struct rtgui_rect *rect);
struct rtgui_image *(*image_zoom)(struct rtgui_image *image, float scalew, float scaleh, rt_uint32_t mode);
struct rtgui_image *(*image_rotate)(struct rtgui_image *image, float angle);
};
struct rtgui_image_palette
{
rtgui_color_t *colors;
rt_uint32_t ncolors;
};
typedef struct rtgui_image_palette rtgui_image_palette_t;
struct rtgui_image
{
/* image metrics */
rt_uint16_t w, h;
/* image engine */
const struct rtgui_image_engine *engine;
/* image palette */
rtgui_image_palette_t *palette;
/* image private data */
void *data;
};
typedef struct rtgui_image rtgui_image_t;
/* init rtgui image system */
void rtgui_system_image_init(void);
#if defined(RTGUI_USING_DFS_FILERW)
struct rtgui_image_engine *rtgui_image_get_engine_by_filename(const char *fn);
struct rtgui_image *rtgui_image_create_from_file(const char *type, const char *filename, rt_bool_t load);
struct rtgui_image *rtgui_image_create(const char *filename, rt_bool_t load);
#endif
struct rtgui_image *rtgui_image_create_from_mem(const char *type, const rt_uint8_t *data, rt_size_t length, rt_bool_t load);
void rtgui_image_destroy(struct rtgui_image *image);
/* get image's rect */
void rtgui_image_get_rect(struct rtgui_image *image, struct rtgui_rect *rect);
/* register an image engine */
void rtgui_image_register_engine(struct rtgui_image_engine *engine);
/* blit an image on DC */
void rtgui_image_blit(struct rtgui_image *image, struct rtgui_dc *dc, struct rtgui_rect *rect);
struct rtgui_image_palette *rtgui_image_palette_create(rt_uint32_t ncolors);
rtgui_image_t *rtgui_image_zoom(rtgui_image_t *image, float scalew, float scaleh, rt_uint32_t mode);
rtgui_image_t *rtgui_image_rotate(rtgui_image_t *image, float angle);
#endif
@@ -1,46 +0,0 @@
/*
* File : image_bmp.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-08-10 Bernard first version
*/
#ifndef __RTGUI_IMAGE_BMP_H__
#define __RTGUI_IMAGE_BMP_H__
#pragma pack(2)
struct rtgui_image_bmp_header
{
/* The Win32 BMP file header (14 bytes) */
rt_uint16_t bfType;
rt_uint32_t bfSize;
rt_uint16_t bfReserved1;
rt_uint16_t bfReserved2;
rt_uint32_t bfOffBits;
/* The Win32 BITMAPINFOHEADER struct (40 bytes) */
rt_uint32_t biSize;
rt_int32_t biWidth;
rt_int32_t biHeight;
rt_uint16_t biPlanes;
rt_uint16_t biBitCount;
rt_uint32_t biCompression;
rt_uint32_t biSizeImage;
rt_int32_t biXPelsPerMeter;
rt_int32_t biYPelsPerMeter;
rt_uint32_t biClrUsed;
rt_uint32_t biClrImportant;
};
#ifdef _WIN32_NATIVE
#pragma warning(disable : 4103)
#endif
void rtgui_image_bmp_init(void);
#endif
@@ -1,27 +0,0 @@
#ifndef __RTGUI_IMAGE_CONTAINER_H__
#define __RTGUI_IMAGE_CONTAINER_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#ifdef RTGUI_IMAGE_CONTAINER
/* image item in image container */
struct rtgui_image_item
{
rtgui_image_t *image;
char *filename;
rt_uint32_t refcount;
};
typedef struct rtgui_image_item rtgui_image_item_t;
void rtgui_system_image_container_init(rt_bool_t load);
#ifdef RTGUI_USING_DFS_FILERW
rtgui_image_item_t *rtgui_image_container_get(const char *filename);
#endif
rtgui_image_item_t *rtgui_image_container_get_from_mem(const rt_uint8_t *mem, const char *type, rt_uint32_t len);
void rtgui_image_container_put(rtgui_image_item_t *item);
#endif
#endif
@@ -1,37 +0,0 @@
/*
* File : image_xpm.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_IMAGE_HDC_H__
#define __RTGUI_IMAGE_HDC_H__
#include <rtgui/image.h>
struct rtgui_image_hdcmm
{
struct rtgui_image parent;
/* hdc image information */
rt_uint16_t byte_per_pixel;
rt_uint16_t pitch;
rt_uint8_t *pixels;
};
void rtgui_image_hdc_init(void);
extern const struct rtgui_image_engine rtgui_image_hdcmm_engine;
#define HDC_HEADER_SIZE (5 * 4)
#define RTGUI_IMAGE_HDC_DEF(bpp, w, h, pixels) \
{{w, h, &rtgui_image_hdcmm_engine, RT_NULL}, bpp, (bpp * w), ((rt_uint8_t*)pixels + HDC_HEADER_SIZE)}
#endif
@@ -1,8 +0,0 @@
#ifndef __RTGUI_IMAGE_JPEG_H__
#define __RTGUI_IMAGE_JPEG_H__
#include <rtgui/image.h>
void rtgui_image_jpeg_init(void);
#endif
@@ -1,21 +0,0 @@
/*
* File : image_png.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_IMAGE_PNG_H__
#define __RTGUI_IMAGE_PNG_H__
#include <rtgui/image.h>
void rtgui_image_png_init(void);
#endif
@@ -1,21 +0,0 @@
/*
* File : image_xpm.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_IMAGE_XPM_H__
#define __RTGUI_IMAGE_XPM_H__
#include <rtgui/image.h>
void rtgui_image_xpm_init(void);
#endif
File diff suppressed because it is too large Load Diff
-66
View File
@@ -1,66 +0,0 @@
/*
* File : list.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_LIST_H__
#define __RTGUI_LIST_H__
#include <rtgui/rtgui.h>
struct rtgui_list_node
{
struct rtgui_list_node *next;
};
typedef struct rtgui_list_node rtgui_list_t;
rt_inline void rtgui_list_init(rtgui_list_t *l)
{
l->next = (struct rtgui_list_node *)0;
}
rt_inline void rtgui_list_append(rtgui_list_t *l, rtgui_list_t *n)
{
struct rtgui_list_node *node;
node = l;
while (node->next) node = node->next;
/* append the node to the tail */
node->next = n;
n->next = (struct rtgui_list_node *) 0;
}
rt_inline void rtgui_list_insert(rtgui_list_t *l, rtgui_list_t *n)
{
n->next = l->next;
l->next = n;
}
rt_inline rtgui_list_t *rtgui_list_remove(rtgui_list_t *l, rtgui_list_t *n)
{
/* remove slist head */
struct rtgui_list_node *node = l;
while (node->next && node->next != n) node = node->next;
/* remove node */
if (node->next != (rtgui_list_t *)0) node->next = node->next->next;
return l;
}
#define rtgui_list_entry(node, type, member) \
((type *)((char*)(node)-(unsigned long)(&((type *)0)->member)))
#define rtgui_list_foreach(node, list) \
for ((node) = (list)->next; (node) != RT_NULL; (node) = (node)->next)
#endif
-104
View File
@@ -1,104 +0,0 @@
/*
* File : region.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_REGION_H__
#define __RTGUI_REGION_H__
#include <rtgui/rtgui.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
typedef struct rtgui_region_data rtgui_region_data_t;
struct rtgui_region_data
{
rt_uint32_t size;
rt_uint32_t numRects;
/* XXX: And why, exactly, do we have this bogus struct definition? */
/* rtgui_rect_t rects[size]; in memory but not explicitly declared */
};
typedef struct rtgui_region
{
rtgui_rect_t extents;
rtgui_region_data_t *data;
} rtgui_region_t;
typedef enum
{
RTGUI_REGION_STATUS_FAILURE,
RTGUI_REGION_STATUS_SUCCESS
} rtgui_region_status_t;
/* creation/destruction */
void rtgui_region_init(rtgui_region_t *region);
void rtgui_region_init_rect(rtgui_region_t *region,
int x, int y, unsigned int width, unsigned int height);
void rtgui_region_init_with_extents(rtgui_region_t *region, const rtgui_rect_t *extents);
void rtgui_region_fini(rtgui_region_t *region);
void rtgui_region_translate(rtgui_region_t *region, int x, int y);
rtgui_region_status_t rtgui_region_copy(rtgui_region_t *dest, rtgui_region_t *source);
rtgui_region_status_t rtgui_region_intersect(rtgui_region_t *newReg, rtgui_region_t *reg1, rtgui_region_t *reg2);
rtgui_region_status_t rtgui_region_intersect_rect(rtgui_region_t *newReg, rtgui_region_t *reg1, rtgui_rect_t *rect);
rtgui_region_status_t rtgui_region_union(rtgui_region_t *newReg, rtgui_region_t *reg1, rtgui_region_t *reg2);
rtgui_region_status_t rtgui_region_union_rect(rtgui_region_t *dest, rtgui_region_t *source, rtgui_rect_t *rect);
rtgui_region_status_t rtgui_region_subtract(rtgui_region_t *regD, rtgui_region_t *regM, rtgui_region_t *regS);
rtgui_region_status_t rtgui_region_subtract_rect(rtgui_region_t *regD, rtgui_region_t *regM, rtgui_rect_t *rect);
rtgui_region_status_t rtgui_region_inverse(rtgui_region_t *newReg, rtgui_region_t *reg1, rtgui_rect_t *invRect);
int rtgui_region_num_rects(rtgui_region_t *region);
rtgui_rect_t *rtgui_region_rects(rtgui_region_t *region);
#define RTGUI_REGION_OUT 0
#define RTGUI_REGION_IN 1
#define RTGUI_REGION_PART 2
int rtgui_region_contains_point(rtgui_region_t *region, int x, int y, rtgui_rect_t *box);
int rtgui_region_contains_rectangle(rtgui_region_t *rtgui_region_t, rtgui_rect_t *prect);
int rtgui_region_not_empty(rtgui_region_t *region);
rtgui_rect_t *rtgui_region_extents(rtgui_region_t *region);
rtgui_region_status_t rtgui_region_append(rtgui_region_t *dest, rtgui_region_t *region);
rtgui_region_status_t rtgui_region_validate(rtgui_region_t *badreg, int *pOverlap);
void rtgui_region_reset(rtgui_region_t *region, rtgui_rect_t *rect);
void rtgui_region_empty(rtgui_region_t *region);
void rtgui_region_dump(rtgui_region_t *region);
int rtgui_region_is_flat(rtgui_region_t *region);
/* rect functions */
extern rtgui_rect_t rtgui_empty_rect;
void rtgui_rect_moveto(rtgui_rect_t *rect, int x, int y);
void rtgui_rect_moveto_align(rtgui_rect_t *rect, rtgui_rect_t *to, int align);
void rtgui_rect_inflate(rtgui_rect_t *rect, int d);
void rtgui_rect_intersect(rtgui_rect_t *src, rtgui_rect_t *dest);
int rtgui_rect_contains_point(const rtgui_rect_t *rect, int x, int y);
int rtgui_rect_is_intersect(const rtgui_rect_t *rect1, const rtgui_rect_t *rect2);
int rtgui_rect_is_equal(const rtgui_rect_t *rect1, const rtgui_rect_t *rect2);
rtgui_rect_t *rtgui_rect_set(rtgui_rect_t *rect, int x, int y, int w, int h);
rt_bool_t rtgui_rect_is_empty(const rtgui_rect_t *rect);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* _PIXMAN_H_ */
-150
View File
@@ -1,150 +0,0 @@
/*
* File : rtgui.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
*/
#ifndef __RT_GUI_H__
#define __RT_GUI_H__
#include <rtthread.h>
#include <rtgui/rtgui_config.h>
#define RTGUI_VERSION 0L /**< major version number */
#define RTGUI_SUBVERSION 6L /**< minor version number */
#define RTGUI_REVISION 0L /**< revise version number */
#define RTGUI_CODENAME "Newton" /**< code name */
#define RT_INT16_MAX 32767
#define RT_INT16_MIN (-RT_INT16_MAX-1)
#define RTGUI_NOT_FOUND (-1)
struct rtgui_event;
struct rtgui_object;
struct rtgui_widget;
struct rtgui_win;
struct rtgui_font;
typedef struct rtgui_win rtgui_win_t;
typedef rt_bool_t (*rtgui_event_handler_ptr)(struct rtgui_object *object, struct rtgui_event *event);
typedef void (*rtgui_onbutton_func_t)(struct rtgui_object *object, struct rtgui_event *event);
/**
* Coordinate point
*/
struct rtgui_point
{
rt_int16_t x, y;
};
typedef struct rtgui_point rtgui_point_t;
extern rtgui_point_t rtgui_empty_point;
/**
* Rectangle structure
*/
struct rtgui_rect
{
rt_int16_t x1, y1, x2, y2;
};
typedef struct rtgui_rect rtgui_rect_t;
#define rtgui_rect_width(r) ((r).x2 - (r).x1)
#define rtgui_rect_height(r) ((r).y2 - (r).y1)
typedef unsigned long rtgui_color_t;
/**
* Graphic context
*/
struct rtgui_gc
{
/* foreground and background color */
rtgui_color_t foreground, background;
/* text style */
rt_uint16_t textstyle;
/* text align */
rt_uint16_t textalign;
/* font */
struct rtgui_font *font;
};
typedef struct rtgui_gc rtgui_gc_t;
enum RTGUI_MARGIN_STYLE
{
RTGUI_MARGIN_LEFT = 0x01,
RTGUI_MARGIN_RIGHT = 0x02,
RTGUI_MARGIN_TOP = 0x04,
RTGUI_MARGIN_BOTTOM = 0x08,
RTGUI_MARGIN_ALL = RTGUI_MARGIN_LEFT | RTGUI_MARGIN_RIGHT | RTGUI_MARGIN_TOP | RTGUI_MARGIN_BOTTOM
};
/**
* Border style
*/
enum RTGUI_BORDER_STYLE
{
RTGUI_BORDER_NONE = 0,
RTGUI_BORDER_SIMPLE,
RTGUI_BORDER_RAISE,
RTGUI_BORDER_SUNKEN,
RTGUI_BORDER_BOX,
RTGUI_BORDER_STATIC,
RTGUI_BORDER_EXTRA,
RTGUI_BORDER_UP,
RTGUI_BORDER_DOWN
};
#define RTGUI_BORDER_DEFAULT_WIDTH 2
#define RTGUI_WIDGET_DEFAULT_MARGIN 3
/**
* Orientation
*/
enum RTGUI_ORIENTATION
{
RTGUI_HORIZONTAL = 0x01,
RTGUI_VERTICAL = 0x02,
RTGUI_ORIENTATION_BOTH = RTGUI_HORIZONTAL | RTGUI_VERTICAL
};
enum RTGUI_ALIGN
{
RTGUI_ALIGN_NOT = 0x00,
RTGUI_ALIGN_CENTER_HORIZONTAL = 0x01,
RTGUI_ALIGN_LEFT = RTGUI_ALIGN_NOT,
RTGUI_ALIGN_TOP = RTGUI_ALIGN_NOT,
RTGUI_ALIGN_RIGHT = 0x02,
RTGUI_ALIGN_BOTTOM = 0x04,
RTGUI_ALIGN_CENTER_VERTICAL = 0x08,
RTGUI_ALIGN_CENTER = RTGUI_ALIGN_CENTER_HORIZONTAL | RTGUI_ALIGN_CENTER_VERTICAL,
RTGUI_ALIGN_EXPAND = 0x10,
RTGUI_ALIGN_STRETCH = 0x20,
};
enum RTGUI_TEXTSTYLE
{
RTGUI_TEXTSTYLE_NORMAL = 0x00,
RTGUI_TEXTSTYLE_DRAW_BACKGROUND = 0x01,
RTGUI_TEXTSTYLE_SHADOW = 0x02,
RTGUI_TEXTSTYLE_OUTLINE = 0x04,
};
enum RTGUI_MODAL_CODE
{
RTGUI_MODAL_OK,
RTGUI_MODAL_CANCEL
};
typedef enum RTGUI_MODAL_CODE rtgui_modal_code_t;
#include <rtgui/rtgui_object.h>
#endif
@@ -1,96 +0,0 @@
/*
* File : rtgui_app.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-01-13 Grissiom first version
*/
#ifndef __RTGUI_APP_H__
#define __RTGUI_APP_H__
#include <rtthread.h>
#include <rtgui/rtgui.h>
#include <rtgui/event.h>
#include <rtgui/rtgui_system.h>
DECLARE_CLASS_TYPE(application);
/** Gets the type of a application */
#define RTGUI_APP_TYPE (RTGUI_TYPE(application))
/** Casts the object to an rtgui_workbench */
#define RTGUI_APP(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_APP_TYPE, struct rtgui_app))
/** Checks if the object is an rtgui_workbench */
#define RTGUI_IS_APP(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_APP_TYPE))
enum rtgui_app_flag
{
RTGUI_APP_FLAG_EXITED = 0x04,
RTGUI_APP_FLAG_SHOWN = 0x08
};
typedef void (*rtgui_idle_func_t)(struct rtgui_object *obj, struct rtgui_event *event);
struct rtgui_app
{
struct rtgui_object parent;
/* application name */
unsigned char *name;
struct rtgui_image *icon;
enum rtgui_app_flag state_flag;
rt_uint16_t ref_count;
rt_uint16_t exit_code;
/* the thread id */
rt_thread_t tid;
/* the message queue of thread */
rt_mq_t mq;
/* event buffer */
rt_uint8_t event_buffer[sizeof(union rtgui_event_generic)];
/* if not RT_NULL, the application is in modal state by modal_object. If is
* RT_NULL, nothing modal windows. */
struct rtgui_object *modal_object;
struct rtgui_object *main_object;
/* on idle event handler */
rtgui_idle_func_t on_idle;
};
/**
* create an application named @myname on current thread.
*
* @param name the name of the application
*
* @return a pointer to struct rtgui_app on success. RT_NULL on failure.
*/
struct rtgui_app *rtgui_app_create(const char *name);
void rtgui_app_destroy(struct rtgui_app *app);
rt_bool_t rtgui_app_event_handler(struct rtgui_object *obj, rtgui_event_t *event);
rt_base_t rtgui_app_run(struct rtgui_app *app);
void rtgui_app_exit(struct rtgui_app *app, rt_uint16_t code);
void rtgui_app_activate(struct rtgui_app *app);
void rtgui_app_close(struct rtgui_app *app);
void rtgui_app_set_onidle(struct rtgui_app *app, rtgui_idle_func_t onidle);
rtgui_idle_func_t rtgui_app_get_onidle(struct rtgui_app *app);
/**
* return the rtgui_app struct on current thread
*/
struct rtgui_app *rtgui_app_self(void);
rt_err_t rtgui_app_set_as_wm(struct rtgui_app *app);
void rtgui_app_set_main_win(struct rtgui_app *app, struct rtgui_win *win);
#endif /* end of include guard: __RTGUI_APP_H__ */
@@ -1,51 +0,0 @@
/*
* File : rtgui_config.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
* 2010-02-08 Bernard move some RTGUI options to bsp
*/
#ifndef __RTGUI_CONFIG_H__
#define __RTGUI_CONFIG_H__
/* RTGUI options */
#ifndef RT_USING_DFS
#undef RTGUI_USING_DFS_FILERW
#undef RTGUI_USING_HZ_FILE
#endif
#if RTGUI_DEFAULT_FONT_SIZE == 0
#define RTGUI_DEFAULT_FONT_SIZE 12
#endif
#define RTGUI_SVR_THREAD_PRIORITY 15
#define RTGUI_SVR_THREAD_TIMESLICE 5
#ifdef RTGUI_USING_SMALL_SIZE
#define RTGUI_SVR_THREAD_STACK_SIZE 1024
#else
#define RTGUI_SVR_THREAD_STACK_SIZE 2048
#endif
#define RTGUI_APP_THREAD_PRIORITY 25
#define RTGUI_APP_THREAD_TIMESLICE 5
#ifdef RTGUI_USING_SMALL_SIZE
#define RTGUI_APP_THREAD_STACK_SIZE 1024
#else
#define RTGUI_APP_THREAD_STACK_SIZE 2048
#endif
#define RTGUI_USING_CAST_CHECK
//#define RTGUI_USING_DESKTOP_WINDOW
//#undef RTGUI_USING_SMALL_SIZE
#endif
@@ -1,58 +0,0 @@
/*
* File : rtgui_mv_model.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-09-15 Grissiom first version
*/
#ifndef __RTGUI_MV_MODEL_H__
#define __RTGUI_MV_MODEL_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/mv_view.h>
DECLARE_CLASS_TYPE(mv_model);
/** Gets the type of a mv_model */
#define RTGUI_MV_MODEL_TYPE (RTGUI_TYPE(mv_model))
/** Casts the object to an mv_model */
#define RTGUI_MV_MODEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_MV_MODEL_TYPE, struct rtgui_mv_model))
/** Checks if the object is an mv_model */
#define RTGUI_IS_MV_MODEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_MV_MODEL_TYPE))
struct rtgui_mv_model
{
struct rtgui_object parent;
rt_uint16_t dimension;
rt_uint16_t view_number;
/* the length of data */
rt_uint16_t length;
/* if the dimension is 1, the data is the pointer to the data. If the
* dimension is more than 1, data is a pointer to a array of pointers to
* data. */
void *data;
/* the content of view is like the content of data. If a model has more
* then one view, view is pointed to an array of pointers to views. */
void *view;
};
struct rtgui_mv_model *rtgui_mv_model_create(rt_uint16_t dimension);
void rtgui_mv_model_destroy(struct rtgui_mv_model *model);
rt_err_t rtgui_mv_model_set_dimension(struct rtgui_mv_model *model, rt_uint16_t dimension);
rt_err_t rtgui_mv_model_add_view(struct rtgui_mv_model *, struct rtgui_mv_view *);
void rtgui_mv_model_remove_view(struct rtgui_mv_model *, struct rtgui_mv_view *);
rt_bool_t rtgui_mv_model_has_view(struct rtgui_mv_model *model, struct rtgui_mv_view *view);
void rtgui_mv_model_set_data(struct rtgui_mv_model *model, rt_uint16_t dim, void *p);
void *rtgui_mv_model_get_data(struct rtgui_mv_model *model, rt_uint16_t dim);
void rtgui_mv_model_notify(struct rtgui_mv_model *model, struct rtgui_event_mv_model *em);
#endif /* end of include guard: __RTGUI_MV_MODEL_H__ */
@@ -1,148 +0,0 @@
/*
* File : rtgui_object.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
*/
#ifndef __RTGUI_OBJECT_H__
#define __RTGUI_OBJECT_H__
#include <rtthread.h>
#include <rtgui/rtgui.h>
#ifdef __cplusplus
extern "C" {
#endif
/* rtgui object type */
#define RTGUI_CONTAINER_OF(obj, type, member) \
((type *)((char *)(obj) - (unsigned long)(&((type *)0)->member)))
/** Casts the function pointer to an rtgui_constructor */
#define RTGUI_CONSTRUCTOR(constructor) ((rtgui_constructor_t)(constructor))
/** Casts the function pointer to an rtgui_constructor */
#define RTGUI_DESTRUCTOR(destructor) ((rtgui_destructor_t)(destructor))
/* pre-definition */
struct rtgui_object;
typedef struct rtgui_object rtgui_object_t;
typedef void (*rtgui_constructor_t)(rtgui_object_t *object);
typedef void (*rtgui_destructor_t)(rtgui_object_t *object);
/* rtgui type structure */
struct rtgui_type
{
/* type name */
char *name;
/* parent type link */
struct rtgui_type *parent;
/* constructor and destructor */
rtgui_constructor_t constructor;
rtgui_destructor_t destructor;
/* size of type */
int size;
};
typedef struct rtgui_type rtgui_type_t;
#define RTGUI_TYPE(type) (struct rtgui_type*)&(_rtgui_##type)
#define DECLARE_CLASS_TYPE(type) extern const struct rtgui_type _rtgui_##type
#define DEFINE_CLASS_TYPE(type, name, parent, constructor, destructor, size) \
const struct rtgui_type _rtgui_##type = { \
name, \
parent, \
RTGUI_CONSTRUCTOR(constructor), \
RTGUI_DESTRUCTOR(destructor), \
size }
void rtgui_type_object_construct(const rtgui_type_t *type, rtgui_object_t *object);
void rtgui_type_destructors_call(const rtgui_type_t *type, rtgui_object_t *object);
rt_bool_t rtgui_type_inherits_from(const rtgui_type_t *type, const rtgui_type_t *parent);
const rtgui_type_t *rtgui_type_parent_type_get(const rtgui_type_t *type);
const char *rtgui_type_name_get(const rtgui_type_t *type);
const rtgui_type_t *rtgui_object_object_type_get(rtgui_object_t *object);
#ifdef RTGUI_USING_CAST_CHECK
#define RTGUI_OBJECT_CAST(obj, obj_type, c_type) \
((c_type *)rtgui_object_check_cast((rtgui_object_t *)(obj), (obj_type), __FUNCTION__, __LINE__))
#else
#define RTGUI_OBJECT_CAST(obj, obj_type, c_type) ((c_type *)(obj))
#endif
#define RTGUI_OBJECT_CHECK_TYPE(_obj, _type) \
(rtgui_type_inherits_from(((rtgui_object_t *)(_obj))->type, (_type)))
DECLARE_CLASS_TYPE(object);
/** Gets the type of an object */
#define RTGUI_OBJECT_TYPE RTGUI_TYPE(object)
/** Casts the object to an rtgui_object_t */
#define RTGUI_OBJECT(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_OBJECT_TYPE, struct rtgui_object))
/** Checks if the object is an rtgui_Object */
#define RTGUI_IS_OBJECT(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_OBJECT_TYPE))
enum rtgui_object_flag
{
RTGUI_OBJECT_FLAG_NONE = 0x00,
RTGUI_OBJECT_FLAG_STATIC = 0x01,
RTGUI_OBJECT_FLAG_DISABLED = 0x02
};
/* rtgui base object */
struct rtgui_object
{
/* object type */
const rtgui_type_t *type;
/* the event handler */
rtgui_event_handler_ptr event_handler;
enum rtgui_object_flag flag;
};
rtgui_object_t *rtgui_object_create(rtgui_type_t *object_type);
void rtgui_object_destroy(rtgui_object_t *object);
/* set the event handler of object */
void rtgui_object_set_event_handler(struct rtgui_object *object, rtgui_event_handler_ptr handler);
/* object default event handler */
rt_bool_t rtgui_object_event_handler(struct rtgui_object *object, struct rtgui_event *event);
/* helper micro. widget event handlers could use this. */
#define RTGUI_WIDGET_EVENT_HANDLER_PREPARE \
struct rtgui_widget *widget; \
RT_ASSERT(object != RT_NULL); \
RT_ASSERT(event != RT_NULL); \
widget = RTGUI_WIDGET(object); \
/* supress compiler warning */ \
widget = widget;
/** handle @param event on @param object's own event handler
*
* If the @param object does not have an event handler, which means the object
* does not interested in any event, it will return RT_FALSE. Otherwise, the
* return code of that handler is returned.
*/
rt_inline rt_bool_t rtgui_object_handle(struct rtgui_object *object, struct rtgui_event *event)
{
if (object->event_handler)
return object->event_handler(object, event);
return RT_FALSE;
}
rtgui_object_t *rtgui_object_check_cast(rtgui_object_t *object, rtgui_type_t *type, const char *func, int line);
rtgui_type_t *rtk_object_object_type_get(rtgui_object_t *object);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,86 +0,0 @@
/*
* File : rtgui_server.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
*/
#ifndef __RTGUI_SERVER_H__
#define __RTGUI_SERVER_H__
#include <rtgui/list.h>
#include <rtgui/dlist.h>
/* RTGUI server definitions */
/* top window definitions in server */
enum rtgui_topwin_flag
{
WINTITLE_NO = 0x01,
WINTITLE_BORDER = 0x02,
WINTITLE_ACTIVATE = 0x04,
WINTITLE_CLOSEBOX = 0x08,
WINTITLE_MOVE = 0x0C,
WINTITLE_CB_PRESSED = 0x10,
WINTITLE_NOFOCUS = 0x20,
/* window is hidden by default */
WINTITLE_SHOWN = 0x40,
/* window is modaled by other window */
WINTITLE_MODALED = 0x80,
/* window is modaling other window */
WINTITLE_MODALING = 0x100,
WINTITLE_ONTOP = 0x200,
WINTITLE_ONBTM = 0x400,
};
#define WINTITLE_HEIGHT 20
#define WINTITLE_CB_WIDTH 16
#define WINTITLE_CB_HEIGHT 16
#define WINTITLE_BORDER_SIZE 2
struct rtgui_topwin
{
/* the window flag */
enum rtgui_topwin_flag flag;
/* event mask */
rt_uint32_t mask;
struct rtgui_wintitle *title;
/* the window id */
struct rtgui_win *wid;
/* which app I belong */
struct rtgui_app *app;
/* the extent information */
rtgui_rect_t extent;
struct rtgui_topwin *parent;
/* we need to iterate the topwin list with usual order(get target window)
* or reversely(painting). So it's better to use a double linked list */
struct rtgui_dlist_node list;
struct rtgui_dlist_node child_list;
/* the monitor rect list */
rtgui_list_t monitor_list;
};
typedef struct rtgui_topwin rtgui_topwin_t;
/* top win manager init */
void rtgui_topwin_init(void);
void rtgui_server_init(void);
/* post an event to server */
void rtgui_server_post_event(struct rtgui_event *event, rt_size_t size);
rt_err_t rtgui_server_post_event_sync(struct rtgui_event *event, rt_size_t size);
#endif
@@ -1,78 +0,0 @@
/*
* File : rtgui_system.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
*/
#ifndef __RTGUI_SYSTEM_H__
#define __RTGUI_SYSTEM_H__
#include <rtthread.h>
#include <rtgui/rtgui.h>
struct rtgui_dc;
struct rtgui_event;
struct rtgui_widget;
struct rtgui_timer;
typedef void (*rtgui_timeout_func)(struct rtgui_timer *timer, void *parameter);
struct rtgui_timer
{
/* the rtgui application it runs on */
struct rtgui_app* app;
/* rt timer */
struct rt_timer timer;
/* timeout function and user data */
rtgui_timeout_func timeout;
void *user_data;
};
typedef struct rtgui_timer rtgui_timer_t;
rtgui_timer_t *rtgui_timer_create(rt_int32_t time, rt_base_t flag, rtgui_timeout_func timeout, void *parameter);
void rtgui_timer_destory(rtgui_timer_t *timer);
void rtgui_timer_start(rtgui_timer_t *timer);
void rtgui_timer_stop(rtgui_timer_t *timer);
/* rtgui system initialization function */
void rtgui_system_server_init(void);
void *rtgui_malloc(rt_size_t size);
void rtgui_free(void *ptr);
void *rtgui_realloc(void *ptr, rt_size_t size);
#ifdef _WIN32_NATIVE
#define rtgui_enter_critical()
#define rtgui_exit_critical()
#else
#define rtgui_enter_critical rt_enter_critical
#define rtgui_exit_critical rt_exit_critical
#endif
struct rtgui_app* rtgui_get_server(void);
void rtgui_set_mainwin_rect(struct rtgui_rect *rect);
void rtgui_get_mainwin_rect(struct rtgui_rect *rect);
void rtgui_get_screen_rect(struct rtgui_rect *rect);
void rtgui_screen_lock(rt_int32_t timeout);
void rtgui_screen_unlock(void);
struct rtgui_event;
rt_err_t rtgui_send(struct rtgui_app* app, struct rtgui_event *event, rt_size_t event_size);
rt_err_t rtgui_send_urgent(struct rtgui_app* app, struct rtgui_event *event, rt_size_t event_size);
rt_err_t rtgui_send_sync(struct rtgui_app* app, struct rtgui_event *event, rt_size_t event_size);
rt_err_t rtgui_ack(struct rtgui_event *event, rt_int32_t status);
rt_err_t rtgui_recv(struct rtgui_event *event, rt_size_t event_size);
rt_err_t rtgui_recv_nosuspend(struct rtgui_event *event, rt_size_t event_size);
rt_err_t rtgui_recv_filter(rt_uint32_t type, struct rtgui_event *event, rt_size_t event_size);
#endif
@@ -1,66 +0,0 @@
/*
* File : rtgui_theme.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
*/
#ifndef __RTGUI_THEME_H__
#define __RTGUI_THEME_H__
#include <rtgui/rtgui.h>
#include <rtgui/rtgui_server.h>
#define CHECK_BOX_W 13
#define CHECK_BOX_H 13
#define RADIO_BOX_W 12
#define RADIO_BOX_H 12
#include <rtgui/widgets/label.h>
#include <rtgui/widgets/button.h>
#include <rtgui/widgets/textbox.h>
#include <rtgui/widgets/iconbox.h>
#include <rtgui/widgets/checkbox.h>
#include <rtgui/widgets/radiobox.h>
#include <rtgui/widgets/slider.h>
#include <rtgui/widgets/scrollbar.h>
#include <rtgui/widgets/progressbar.h>
#include <rtgui/widgets/staticline.h>
#ifdef __cplusplus
extern "C" {
#endif
void rtgui_system_theme_init(void);
void rtgui_theme_draw_win(struct rtgui_topwin *win);
void rtgui_theme_draw_button(rtgui_button_t *btn);
void rtgui_theme_draw_label(rtgui_label_t *label);
void rtgui_theme_draw_textbox(rtgui_textbox_t *box);
void rtgui_theme_draw_iconbox(rtgui_iconbox_t *iconbox);
void rtgui_theme_draw_checkbox(rtgui_checkbox_t *checkbox);
void rtgui_theme_draw_radiobutton(struct rtgui_radiobox *radiobox, rt_uint16_t item);
void rtgui_theme_draw_radiobox(struct rtgui_radiobox *radiobox);
void rtgui_theme_draw_slider(struct rtgui_slider *slider);
void rtgui_theme_draw_progressbar(struct rtgui_progressbar *bar);
void rtgui_theme_draw_staticline(struct rtgui_staticline *staticline);
rt_uint16_t rtgui_theme_get_selected_height(void);
void rtgui_theme_draw_selected(struct rtgui_dc *dc, rtgui_rect_t *rect);
rtgui_color_t rtgui_theme_default_bc(void);
rtgui_color_t rtgui_theme_default_fc(void);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,35 +0,0 @@
#ifndef __RTGUI_XML_H__
#define __RTGUI_XML_H__
#include <rtgui/rtgui.h>
/* Types of events: start element, end element, text, attr name, attr
val and start/end document. Other events can be ignored! */
enum
{
EVENT_START = 0, /* Start tag */
EVENT_END, /* End tag */
EVENT_TEXT, /* Text */
EVENT_NAME, /* Attribute name */
EVENT_VAL, /* Attribute value */
EVENT_END_DOC, /* End of document */
EVENT_COPY, /* Internal only; copies to internal buffer */
EVENT_NONE /* Internal only; should never see this event */
};
/* xml structure typedef */
typedef struct rtgui_xml rtgui_xml_t;
typedef int (*rtgui_xml_event_handler_t)(rt_uint8_t event, const char *text, rt_size_t len, void *user);
/* create a xml parser context */
rtgui_xml_t *rtgui_xml_create(rt_size_t buffer_size, rtgui_xml_event_handler_t handler, void *user);
/* destroy a xml parser context */
void rtgui_xml_destroy(rtgui_xml_t *rtgui_xml);
/* parse xml buffer */
int rtgui_xml_parse(rtgui_xml_t *rtgui_xml, const char *buf, rt_size_t len);
/* event string */
const char *rtgui_xml_event_str(rt_uint8_t event);
#endif
File diff suppressed because it is too large Load Diff
@@ -1,55 +0,0 @@
/*
* File : box.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_BOX_H__
#define __RTGUI_BOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/container.h>
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_CLASS_TYPE(box);
/** Gets the type of a box */
#define RTGUI_BOX_TYPE (RTGUI_TYPE(box))
/** Casts the object to an rtgui_box */
#define RTGUI_BOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_BOX_TYPE, rtgui_box_t))
/** Checks if the object is an rtgui_box */
#define RTGUI_IS_BOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_BOX_TYPE))
struct rtgui_box
{
struct rtgui_object parent;
rt_uint16_t orient;
rt_uint16_t border_size;
struct rtgui_container *container;
};
typedef struct rtgui_box rtgui_box_t;
struct rtgui_box *rtgui_box_create(int orientation, int border_size);
void rtgui_box_destroy(struct rtgui_box *box);
void rtgui_box_layout(rtgui_box_t *box);
void rtgui_box_layout_rect(rtgui_box_t *box, struct rtgui_rect *rect);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,92 +0,0 @@
/*
* File : button.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_BUTTON_H__
#define __RTGUI_BUTTON_H__
#include <rtgui/image.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/label.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup rtgui_button
* @{
*/
DECLARE_CLASS_TYPE(button);
/** Gets the type of a button */
#define RTGUI_BUTTON_TYPE (RTGUI_TYPE(button))
/** Casts the object to an rtgui_button */
#define RTGUI_BUTTON(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_BUTTON_TYPE, rtgui_button_t))
/** Checks if the object is an rtgui_button */
#define RTGUI_IS_BUTTON(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_BUTTON_TYPE))
#define RTGUI_BUTTON_FLAG_PRESS 0x01
#define RTGUI_BUTTON_FLAG_DEFAULT 0x02
#define RTGUI_BUTTON_TYPE_NORMAL 0x00
#define RTGUI_BUTTON_TYPE_PUSH 0x10
/*
* the button widget
*/
struct rtgui_button
{
/* inherit from label */
struct rtgui_label parent;
/* button flag */
rt_base_t flag;
/* pressed and unpressed image */
rtgui_image_t *pressed_image, *unpressed_image;
/* click button event handler */
rtgui_onbutton_func_t on_button;
};
typedef struct rtgui_button rtgui_button_t;
rtgui_button_t *rtgui_button_create(const char *text);
rtgui_button_t *rtgui_pushbutton_create(const char *text);
void rtgui_button_destroy(rtgui_button_t *btn);
void rtgui_button_set_pressed_image(rtgui_button_t *btn, rtgui_image_t *image);
void rtgui_button_set_unpressed_image(rtgui_button_t *btn, rtgui_image_t *image);
/** Set the callback function on button btn
*
* If the btn is a push button, the callback will be invoked every
* time the btn got "pushed", i.e., both pressed down @em and pressed
* up. If the button is a normal button, the callback will be invoked when
* the btn got "clicked", i.e., when pressed up @em after pressed
* down.
*
* @param btn the btn that the callback will be setted on.
* @param func the callback function.
*/
void rtgui_button_set_onbutton(rtgui_button_t *btn, rtgui_onbutton_func_t func);
rt_bool_t rtgui_button_event_handler(struct rtgui_object *object, struct rtgui_event *event);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
@@ -1,43 +0,0 @@
#ifndef __RTGUI_CHECKBOX_H__
#define __RTGUI_CHECKBOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/label.h>
DECLARE_CLASS_TYPE(checkbox);
/** Gets the type of a checkbox */
#define RTGUI_CHECKBOX_TYPE (RTGUI_TYPE(checkbox))
/** Casts the object to an rtgui_button */
#define RTGUI_CHECKBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_CHECKBOX_TYPE, struct rtgui_checkbox))
/** Checks if the object is an rtgui_button */
#define RTGUI_IS_CHECKBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_CHECKBOX_TYPE))
#define RTGUI_CHECKBOX_STATUS_CHECKED 0
#define RTGUI_CHECKBOX_STATUS_UNCHECKED 1
struct rtgui_checkbox
{
/* inherit from label */
struct rtgui_label parent;
/* check box status */
rt_uint8_t status_down;
/* click button event handler */
rtgui_onbutton_func_t on_button;
};
typedef struct rtgui_checkbox rtgui_checkbox_t;
rtgui_checkbox_t *rtgui_checkbox_create(const char *text, rt_bool_t checked);
void rtgui_checkbox_destroy(rtgui_checkbox_t *checkbox);
void rtgui_checkbox_set_checked(rtgui_checkbox_t *checkbox, rt_bool_t checked);
rt_bool_t rtgui_checkbox_get_checked(rtgui_checkbox_t *checkbox);
void rtgui_checkbox_set_onbutton(rtgui_checkbox_t *checkbox, rtgui_onbutton_func_t func);
rt_bool_t rtgui_checkbox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
#endif
@@ -1,49 +0,0 @@
#ifndef __RTGUI_COMBOBOX_H__
#define __RTGUI_COMBOBOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/widgets/window.h>
#include <rtgui/widgets/listbox.h>
DECLARE_CLASS_TYPE(combobox);
/** Gets the type of a combobox */
#define RTGUI_COMBOBOX_TYPE (RTGUI_TYPE(combobox))
/** Casts the object to a rtgui_combobox */
#define RTGUI_COMBOBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_COMBOBOX_TYPE, rtgui_combobox_t))
/** Checks if the object is a rtgui_combobox */
#define RTGUI_IS_COMBOBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_COMBOBOX_TYPE))
#define RTGUI_COMBOBOX_WIDTH 75
#define RTGUI_COMBOBOX_HEIGHT 20
#define RTGUI_COMBOBOX_BUTTON_WIDTH 18
struct rtgui_combobox
{
struct rtgui_widget parent;
/* widget private data */
/* pull down window */
struct rtgui_win *pd_win;
rt_bool_t pd_pressed;
/* combobox items */
struct rtgui_listbox_item *items;
rt_uint16_t items_count;
rt_uint16_t current_item;
/* call back */
rtgui_event_handler_ptr on_selected;
};
typedef struct rtgui_combobox rtgui_combobox_t;
rtgui_combobox_t *rtgui_combobox_create(struct rtgui_listbox_item *items, rt_uint16_t counter, struct rtgui_rect *rect);
void rtgui_combobox_destroy(rtgui_combobox_t *box);
rt_bool_t rtgui_combobox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
struct rtgui_listbox_item *rtgui_combox_get_select(struct rtgui_combobox *box);
void rtgui_combobox_set_onselected(struct rtgui_combobox *box, rtgui_event_handler_ptr func);
#endif
@@ -1,69 +0,0 @@
/*
* File : container.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_CONTAINER_H__
#define __RTGUI_CONTAINER_H__
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/box.h>
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_CLASS_TYPE(container);
/** Gets the type of a container */
#define RTGUI_CONTAINER_TYPE (RTGUI_TYPE(container))
/** Casts the object to an rtgui_container */
#define RTGUI_CONTAINER(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_CONTAINER_TYPE, rtgui_container_t))
/** Checks if the object is an rtgui_container */
#define RTGUI_IS_CONTAINER(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_CONTAINER_TYPE))
/*
* the container widget
*/
struct rtgui_container
{
struct rtgui_widget parent;
/* layout box */
struct rtgui_box *layout_box;
rtgui_list_t children;
};
typedef struct rtgui_container rtgui_container_t;
rtgui_container_t *rtgui_container_create(void);
void rtgui_container_destroy(rtgui_container_t *container);
rt_bool_t rtgui_container_event_handler(struct rtgui_object *widget, struct rtgui_event *event);
/* set layout box */
void rtgui_container_set_box(struct rtgui_container *container, struct rtgui_box *box);
void rtgui_container_layout(struct rtgui_container *container);
void rtgui_container_add_child(rtgui_container_t *container, rtgui_widget_t *child);
void rtgui_container_remove_child(rtgui_container_t *container, rtgui_widget_t *child);
void rtgui_container_destroy_children(rtgui_container_t *container);
rtgui_widget_t *rtgui_container_get_first_child(rtgui_container_t *container);
rt_bool_t rtgui_container_event_handler(struct rtgui_object *widget, rtgui_event_t *event);
rt_bool_t rtgui_container_dispatch_event(rtgui_container_t *container, rtgui_event_t *event);
rt_bool_t rtgui_container_dispatch_mouse_event(rtgui_container_t *container, struct rtgui_event_mouse *event);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,36 +0,0 @@
#ifndef DIG_FONT_H
#define DIG_FONT_H
struct rtgui_digitfont_data
{
rt_uint16_t x;
rt_uint16_t y;
rt_uint16_t len;
rt_uint16_t type; //ˮƽºÍ´¹Ö±
};
struct rtgui_digitfont
{
int seg1_len;
int seg1_hspace;
int seg1_vspace;
int seg1_nr; //9
int seg2_len;
int seg3_len;
struct rtgui_digitfont_data *data;
};
typedef struct rtgui_digitfont rtgui_digitfont_t;
extern struct rtgui_digitfont digitfont_40;
extern const char digtube_code_table[];
int rtgui_digitfont_create(struct rtgui_digitfont *font);
int rtgui_dc_draw_digitfont(struct rtgui_dc *dc, struct rtgui_digitfont *font, rtgui_rect_t *rect);
int rtgui_get_digfont_metrics(struct rtgui_digitfont * font, rtgui_rect_t * rect);
int rtgui_dc_draw_digitfont_code(struct rtgui_dc *dc, struct rtgui_digitfont * font, rtgui_rect_t * rect, char code);
#endif
@@ -1,68 +0,0 @@
/*
* File : digfont.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-12-21 pife first version
*/
#ifndef __RTGUI_DIGTUBE_H__
#define __RTGUI_DIGTUBE_H__
#include <rtgui/rtgui.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/digfont.h>
DECLARE_CLASS_TYPE(digtube);
/** Gets the type of a digit tubes */
#define RTGUI_DIGTUBE_TYPE (RTGUI_TYPE(digtube))
/** Casts the object to an rtgui_digtube */
#define RTGUI_DIGTUBE(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_DIGTUBE_TYPE, rtgui_digtube_t))
/** Checks if the object is an rtgui_digtube */
#define RTGUI_IS_DIGTUBE(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_DIGTUBE_TYPE))
/*
* the digit tube widget
*/
struct rtgui_digtube
{
struct rtgui_widget parent;
struct rtgui_digitfont digitfont;
/* number of tubes */
rt_uint8_t tube_count;
rt_uint8_t tube_style;
rt_uint8_t digit_hight;
rt_uint8_t digit_width;
rt_uint8_t digit_space;
rtgui_color_t digit_bc;
void * value;
};
typedef struct rtgui_digtube rtgui_digtube_t;
rtgui_digtube_t *rtgui_digtube_create( struct rtgui_digitfont * digitfont, int count, void * value, int style);
void rtgui_digtube_destroy(rtgui_digtube_t *digtube);
rt_bool_t rtgui_digtube_event_handler(struct rtgui_object *object, struct rtgui_event *event);
#define RTGUI_DIGTUBE_DEFAULT_BC RTGUI_RGB(0, 0, 0)
#define RTGUI_DIGTUBE_DEFAULT_FC RTGUI_RGB(0xFF, 0, 0)
#define RTGUI_DIGTUBE_DEFAULT_DIGIT_BC RTGUI_RGB(100, 100, 100)
#define RTGUI_DIGTUBE_DEFAULT_SPACE 10
#define RTGUI_DIGTUBE_STYLE_NOBACKFONT 0x01
#define RTGUI_DIGTUBE_STYLE_DISHEXNUM 0x02
#define RTGUI_DIGTUBE_STYLE_DISCODES 0x04
//void rtgui_digtube_set_text(rtgui_digtube_t *digtube, const char *text);
//char *rtgui_digtube_get_text(rtgui_digtube_t *digtube);
#endif
@@ -1,114 +0,0 @@
/*
* File : edit.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-06-04 amsl first version
*/
#ifndef __RTGUI_EDIT_H__
#define __RTGUI_EDIT_H__
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/container.h>
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_CLASS_TYPE(edit);
/** Gets the type of a edit */
#define RTGUI_EDIT_TYPE (RTGUI_TYPE(edit))
/** Casts the object to a rtgui_edit */
#define RTGUI_EDIT(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_EDIT_TYPE, struct rtgui_edit))
/** Checks if the object is a rtgui_edit */
#define RTGUI_IS_EDIT(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_EDIT_TYPE))
#define RTGUI_EDIT_NONE 0x00
#define RTGUI_EDIT_CARET 0x01
#define RTGUI_EDIT_VSCROLL 0x02
#define RTGUI_EDIT_HSCROLL 0x04
#define RTGUI_EDIT_SHIFT 0x10
#define RTGUI_EDIT_CTRL 0x20
#define RTGUI_EDIT_ALT 0x40
#define RTGUI_EDIT_CAPSLOCK 0x80
#define RTGUI_EDIT_NUMLOCK 0x100
struct edit_update
{
/* rt_uint32_t type; */ /* update type */
rtgui_point_t start, end; /* update area */
};
struct edit_line
{
rt_int16_t zsize; /* zone size */
rt_int16_t len;
struct edit_line *prev;
struct edit_line *next;
char *text;
};
struct rtgui_edit
{
/* inherit from container */
rtgui_container_t parent;
/* edit flag */
rt_uint32_t flag;
rt_int16_t max_rows, max_cols;
rt_int16_t row_per_page, col_per_page;
rtgui_point_t upleft;
rtgui_point_t visual;
rt_uint8_t tabsize;
rt_uint8_t item_height;
rt_uint8_t font_width, font_height;
rt_uint8_t margin;
rt_int16_t bzsize; /* base zone size */
struct rtgui_timer *caret_timer;
rtgui_color_t *caret;
rtgui_rect_t caret_rect;
struct edit_update update;
char *update_buf; /* speed up renewal process */
struct rtgui_dc *dbl_buf;
struct edit_line *head;
struct edit_line *tail;
struct edit_line *first_line;
#ifdef RTGUI_EDIT_USING_SCROLL
struct rtgui_scrollbar *hscroll;
struct rtgui_scrollbar *vscroll;
#endif
};
rt_bool_t rtgui_edit_append_line(struct rtgui_edit *edit, const char *text);
rt_bool_t rtgui_edit_insert_line(struct rtgui_edit *edit, struct edit_line *p, char *text);
rt_bool_t rtgui_edit_delete_line(struct rtgui_edit *edit, struct edit_line *line);
rt_bool_t rtgui_edit_connect_line(struct rtgui_edit *edit, struct edit_line *line, struct edit_line *connect);
void _rtgui_edit_constructor(struct rtgui_edit *box);
void _rtgui_edit_deconstructor(struct rtgui_edit *textbox);
struct rtgui_edit *rtgui_edit_create(struct rtgui_container *container, int left, int top, int w, int h);
void rtgui_edit_destroy(struct rtgui_edit *edit);
void rtgui_edit_update(struct rtgui_edit *edit);
void rtgui_edit_ondraw(struct rtgui_edit *edit);
rt_bool_t rtgui_edit_event_handler(struct rtgui_object *object, rtgui_event_t *event);
void rtgui_edit_set_text(struct rtgui_edit *edit, const char *text);
rtgui_point_t rtgui_edit_get_current_point(struct rtgui_edit *edit);
rt_uint32_t rtgui_edit_get_mem_consume(struct rtgui_edit *edit);
rt_bool_t rtgui_edit_readin_file(struct rtgui_edit *edit, const char *filename);
rt_bool_t rtgui_edit_saveas_file(struct rtgui_edit *edit, const char *filename);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,58 +0,0 @@
#ifndef __RTGUI_FILELIST_VIEW_H__
#define __RTGUI_FILELIST_VIEW_H__
#include <rtgui/widgets/container.h>
#if defined(RTGUI_USING_DFS_FILERW)
#define RTGUI_FITEM_FILE 0x0
#define RTGUI_FITEM_DIR 0x1
struct rtgui_file_item
{
char *name;
rt_uint32_t type;
rt_uint32_t size;
};
DECLARE_CLASS_TYPE(filelist);
/** Gets the type of a filelist view */
#define RTGUI_FILELIST_VIEW_TYPE (RTGUI_TYPE(filelist))
/** Casts the object to a filelist */
#define RTGUI_FILELIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_FILELIST_VIEW_TYPE, rtgui_filelist_view_t))
/** Checks if the object is a filelist view */
#define RTGUI_IS_FILELIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_FILELIST_VIEW_TYPE))
struct rtgui_filelist_view
{
struct rtgui_container parent;
/* widget private data */
/* current directory */
char *current_directory;
char *pattern;
/* the number of item in a page */
rt_uint16_t page_items;
rt_uint16_t items_count;
/* the selected item */
rt_uint16_t current_item;
/* items array */
struct rtgui_file_item *items;
};
typedef struct rtgui_filelist_view rtgui_filelist_view_t;
rtgui_filelist_view_t *rtgui_filelist_view_create(const char *directory,
const char *pattern,
const rtgui_rect_t *rect);
void rtgui_filelist_view_destroy(rtgui_filelist_view_t *view);
rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_filelist_view_set_directory(rtgui_filelist_view_t *view, const char *directory);
void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t *view, char *path, rt_size_t len);
#endif
#endif
@@ -1,73 +0,0 @@
/*
* File : groupbox.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-07-29 Bernard first version
*/
#ifndef __RTGUI_GROUPBOX_H__
#define __RTGUI_GROUPBOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/event.h>
#include <rtgui/widgets/panel.h>
#include <rtgui/widgets/box.h>
DECLARE_CLASS_TYPE(groupbox);
/** Gets the type of a groupbox */
#define RTGUI_GROUPBOX_TYPE (RTGUI_TYPE(groupbox))
/** Casts the object to an groupbox */
#define RTGUI_GROUPBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_GROUPBOX_TYPE, rtgui_groupbox_t))
/** Checks if the object is an rtgui_groupbox */
#define RTGUI_IS_GROUPBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_GROUPBOX_TYPE))
typedef void (*widget_select_t)(struct rtgui_widget *widget, rt_bool_t selected);
/*
* the groupbox widget
*
* The Group Box is a container widget, in which user can place some other widget into it.
* However, the current selected in group box must be notified by user:
* - invoke rtgui_groupbox_select_widget to notify group box the current selected widget;
* - when a widget has been selected, group box invokes groupbox->select_func to change
* the status of widget, for example un-select this widget.
*/
struct rtgui_groupbox
{
struct rtgui_panel parent;
char *label;
struct rtgui_box *box;
struct rtgui_widget *selected;
widget_select_t select_func;
rtgui_event_handler_ptr on_selected;
};
typedef struct rtgui_groupbox rtgui_groupbox_t;
rtgui_groupbox_t *rtgui_groupbox_create(const char *label, struct rtgui_rect *rect, int style, widget_select_t select_func);
void rtgui_groupbox_destroy(rtgui_groupbox_t *groupbox);
void rtgui_groupbox_layout(struct rtgui_groupbox *box);
void rtgui_groupbox_add_widget(struct rtgui_groupbox *box, struct rtgui_widget *widget);
void rtgui_groupbox_select_widget(struct rtgui_groupbox *box, struct rtgui_widget *widget);
struct rtgui_widget *rtgui_groupbox_get_selected(struct rtgui_groupbox *box);
rt_bool_t rtgui_groupbox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
rt_inline void rtgui_groupbox_set_onselected(struct rtgui_groupbox *box, rtgui_event_handler_ptr on_selected)
{
RT_ASSERT(box != RT_NULL);
box->on_selected = on_selected;
}
#endif
@@ -1,56 +0,0 @@
/*
* File : iconbox.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_ICONBOX_H__
#define __RTGUI_ICONBOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(iconbox);
/** Gets the type of a iconbox */
#define RTGUI_ICONBOX_TYPE (RTGUI_TYPE(iconbox))
/** Casts the object to a rtgui_iconbox */
#define RTGUI_ICONBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_ICONBOX_TYPE, rtgui_iconbox_t))
/** Checks if the object is a rtgui_iconbox */
#define RTGUI_IS_ICONBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_ICONBOX_TYPE))
#define RTGUI_ICONBOX_NOTEXT 0x00
#define RTGUI_ICONBOX_TEXT_RIGHT 0x01
#define RTGUI_ICONBOX_TEXT_BELOW 0x02
struct rtgui_iconbox
{
/* inherit from widget */
struct rtgui_widget parent;
/* widget private data */
struct rtgui_image *image;
char *text;
rt_ubase_t text_position;
rt_bool_t selected;
};
typedef struct rtgui_iconbox rtgui_iconbox_t;
struct rtgui_iconbox *rtgui_iconbox_create(struct rtgui_image *image, const char *text, int position);
void rtgui_iconbox_destroy(struct rtgui_iconbox *iconbox);
rt_bool_t rtgui_iconbox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_iconbox_set_text_position(struct rtgui_iconbox *iconbox, int position);
void rtgui_iconbox_set_selected(struct rtgui_iconbox *iconbox, rt_bool_t selected);
#endif
@@ -1,49 +0,0 @@
/*
* File : label.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_LABEL_H__
#define __RTGUI_LABEL_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(label);
/** Gets the type of a button */
#define RTGUI_LABEL_TYPE (RTGUI_TYPE(label))
/** Casts the object to an rtgui_button */
#define RTGUI_LABEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LABEL_TYPE, rtgui_label_t))
/** Checks if the object is an rtgui_button */
#define RTGUI_IS_LABEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LABEL_TYPE))
/*
* the label widget
*/
struct rtgui_label
{
struct rtgui_widget parent;
/* label */
char *text;
};
typedef struct rtgui_label rtgui_label_t;
rtgui_label_t *rtgui_label_create(const char *text);
void rtgui_label_destroy(rtgui_label_t *label);
rt_bool_t rtgui_label_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_label_set_text(rtgui_label_t *label, const char *text);
char *rtgui_label_get_text(rtgui_label_t *label);
#endif
@@ -1,76 +0,0 @@
/*
* File : list_view.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-01-06 Bernard first version
*/
#ifndef __RTGUI_LIST_VIEW_H__
#define __RTGUI_LIST_VIEW_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/container.h>
typedef void (*item_action)(struct rtgui_widget *widget, void *parameter);
struct rtgui_list_item
{
char *name;
rtgui_image_t *image;
item_action action;
void *parameter;
};
DECLARE_CLASS_TYPE(listview);
/** Gets the type of a list view */
#define RTGUI_LIST_VIEW_TYPE (RTGUI_TYPE(listview))
/** Casts the object to a filelist */
#define RTGUI_LIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LIST_VIEW_TYPE, rtgui_list_view_t))
/** Checks if the object is a filelist view */
#define RTGUI_IS_LIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LIST_VIEW_TYPE))
#define RTGUI_LIST_VIEW_LIST 0x00
#define RTGUI_LIST_VIEW_ICON 0x01
#define RTGUI_LIST_VIEW_REPORT 0x02
struct rtgui_list_view
{
struct rtgui_container parent;
/* widget private data */
/* list item */
const struct rtgui_list_item *items;
/* layout flag */
rt_uint16_t flag;
/* total number of items */
rt_uint16_t items_count;
/* the number of item in a page */
rt_uint16_t page_items;
/* current item */
rt_int16_t current_item;
/* icon layout */
rt_uint8_t row_items, col_items;
};
typedef struct rtgui_list_view rtgui_list_view_t;
rtgui_list_view_t *rtgui_list_view_create(const struct rtgui_list_item *items, rt_uint16_t count,
rtgui_rect_t *rect, rt_uint16_t flag);
void rtgui_list_view_destroy(rtgui_list_view_t *view);
rt_bool_t rtgui_list_view_event_handler(struct rtgui_object *widget, struct rtgui_event *event);
#endif
@@ -1,67 +0,0 @@
/*
* File : listbox.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-01-06 Bernard first version
*/
#ifndef __RTGUI_LISTBOX_H__
#define __RTGUI_LISTBOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/widget.h>
struct rtgui_listbox_item
{
char *name;
rtgui_image_t *image;
};
DECLARE_CLASS_TYPE(listbox);
/** Gets the type of a list box */
#define RTGUI_LISTBOX_TYPE (RTGUI_TYPE(listbox))
/** Casts the object to a filelist */
#define RTGUI_LISTBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LISTBOX_TYPE, rtgui_listbox_t))
/** Checks if the object is a filelist box */
#define RTGUI_IS_LISTBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LISTBOX_TYPE))
struct rtgui_listbox
{
struct rtgui_widget parent;
/* widget private data */
/* listbox item */
const struct rtgui_listbox_item *items;
/* item event handler */
rtgui_event_handler_ptr on_item;
/* total number of items */
rt_uint16_t items_count;
/* the number of item in a page */
rt_uint16_t page_items;
/* current item */
rt_int16_t current_item;
};
typedef struct rtgui_listbox rtgui_listbox_t;
rtgui_listbox_t *rtgui_listbox_create(const struct rtgui_listbox_item *items, rt_uint16_t count,
rtgui_rect_t *rect);
void rtgui_listbox_destroy(rtgui_listbox_t *box);
rt_bool_t rtgui_listbox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_listbox_set_onitem(rtgui_listbox_t *box, rtgui_event_handler_ptr func);
void rtgui_listbox_set_items(rtgui_listbox_t *box, struct rtgui_listbox_item *items, rt_uint16_t count);
void rtgui_listbox_set_current_item(rtgui_listbox_t *box, int index);
#endif
@@ -1,66 +0,0 @@
/*
* File : listctrl.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-12-06 Bernard first version
*/
#ifndef __RTGUI_LISTCTRL_H__
#define __RTGUI_LISTCTRL_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(listctrl);
/** Gets the type of a listctrl */
#define RTGUI_LISTCTRL_TYPE (RTGUI_TYPE(listctrl))
/** Casts the object to a listctrl */
#define RTGUI_LISTCTRL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LISTCTRL_TYPE, rtgui_listctrl_t))
/** Checks if the object is a listctrl */
#define RTGUI_IS_LISTCTRL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LISTCTRL_TYPE))
struct rtgui_listctrl
{
struct rtgui_widget parent;
/* widget private data */
/* listctrl items */
void *items;
/* total number of items */
rt_uint16_t items_count;
/* the number of item in a page */
rt_uint16_t page_items;
/* current item */
rt_int16_t current_item;
rt_uint16_t item_height;
/* item event handler */
rtgui_event_handler_ptr on_item;
void (*on_item_draw)(struct rtgui_listctrl *list, struct rtgui_dc *dc, rtgui_rect_t *rect, rt_uint16_t index);
};
typedef struct rtgui_listctrl rtgui_listctrl_t;
typedef void (*rtgui_onitem_draw_t)(struct rtgui_listctrl *list, struct rtgui_dc *dc, rtgui_rect_t *rect, rt_uint16_t index);
rtgui_listctrl_t *rtgui_listctrl_create(void *items, rt_uint16_t count,
rtgui_rect_t *rect, rtgui_onitem_draw_t ondraw);
void rtgui_listctrl_destroy(rtgui_listctrl_t *ctrl);
rt_bool_t rtgui_listctrl_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_listctrl_set_onitem(rtgui_listctrl_t *ctrl, rtgui_event_handler_ptr func);
void rtgui_listctrl_set_items(rtgui_listctrl_t *ctrl, void *items, rt_uint16_t count);
void rtgui_listctrl_set_current_item(struct rtgui_listctrl *ctrl, rt_uint16_t index);
rt_bool_t rtgui_listctrl_get_item_rect(rtgui_listctrl_t *ctrl, rt_uint16_t item, rtgui_rect_t *item_rect);
void rtgui_listctrl_set_itemheight(struct rtgui_listctrl *ctrl, int height);
#endif
@@ -1,78 +0,0 @@
#ifndef __RTGUI_MENU_H__
#define __RTGUI_MENU_H__
#include <rtgui/image.h>
#include <rtgui/widgets/window.h>
#include <rtgui/widgets/listctrl.h>
/* rtgui menu item */
enum rtgui_menu_item_type
{
RTGUI_ITEM_NORMAL,
RTGUI_ITEM_CHECK,
RTGUI_ITEM_SUBMENU,
RTGUI_ITEM_SEPARATOR
};
typedef enum rtgui_menu_item_type rtgui_menu_item_type_t;
struct rtgui_menu_item
{
rtgui_menu_item_type_t type;
/* menu text label */
const char *label;
/* menu image */
rtgui_image_t *image;
/* sub-menu item */
const struct rtgui_menu_item_t *submenu;
rt_uint16_t submenu_count;
/* menu action */
rt_bool_t (*on_menuaction)(struct rtgui_object *object, struct rtgui_event *event);
};
typedef struct rtgui_menu_item rtgui_menu_item_t;
DECLARE_CLASS_TYPE(menu);
/** Gets the type of a menu */
#define RTGUI_MENU_TYPE (RTGUI_TYPE(menu))
/** Casts the object to an rtgui_menu */
#define RTGUI_MENU(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_MENU_TYPE, rtgui_menu_t))
/** Checks if the object is an rtgui_menu */
#define RTGUI_IS_MENU(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_MENU_TYPE))
#define RTGUI_MENU_DEFAULT_WIDTH 100
struct rtgui_menu
{
/* inherited from window */
struct rtgui_win parent;
/* menu items */
const struct rtgui_menu_item *items;
rt_uint16_t items_count;
/* parent menu */
struct rtgui_menu *parent_menu;
struct rtgui_menu *sub_menu;
/* menu item list control */
struct rtgui_listctrl *items_list;
/* pop event handle */
rtgui_event_handler_ptr on_menupop;
rtgui_event_handler_ptr on_menuhide;
};
typedef struct rtgui_menu rtgui_menu_t;
struct rtgui_menu *rtgui_menu_create(const char *title, struct rtgui_menu *parent_menu,
const struct rtgui_menu_item *items, rt_uint16_t count);
void rtgui_menu_destroy(struct rtgui_menu *menu);
void rtgui_menu_set_onmenupop(struct rtgui_menu *menu, rtgui_event_handler_ptr handler);
void rtgui_menu_set_onmenuhide(struct rtgui_menu *menu, rtgui_event_handler_ptr handler);
void rtgui_menu_pop(struct rtgui_menu *menu, int x, int y);
void rtgui_menu_hide(struct rtgui_menu *menu);
#endif
@@ -1,44 +0,0 @@
/*
* File : mv_view.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-09-15 Grissiom first version
*/
#ifndef __MV_VIEW_H__
#define __MV_VIEW_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(mv_view);
/** Gets the type of a mv_view */
#define RTGUI_MV_VIEW_TYPE (RTGUI_TYPE(mv_view))
/** Casts the object to an mv_view */
#define RTGUI_MV_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_MV_VIEW_TYPE, struct rtgui_mv_view))
/** Checks if the object is an mv_view */
#define RTGUI_IS_MV_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_MV_VIEW_TYPE))
struct rtgui_mv_view
{
struct rtgui_widget parent;
rt_uint16_t model_number;
/* if the model_number is 1, the model is the pointer to the model. If the
* model_number is more than 1, model is a pointer to a array of pointers
* to model. */
void *model;
};
struct rtgui_mv_view *rtgui_mv_view_create(void);
void rtgui_mv_view_destroy(struct rtgui_mv_view *view);
struct rtgui_mv_model *rtgui_mv_view_foreach_in_model(struct rtgui_mv_view *view, rt_uint32_t *iter);
#endif /* end of include guard: __MV_VIEW_H__ */
@@ -1,72 +0,0 @@
#ifndef __RTGUI_NOTEBOOK_H__
#define __RTGUI_NOTEBOOK_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(notebook);
/** Gets the type of a notebook */
#define RTGUI_NOTEBOOK_TYPE (RTGUI_TYPE(notebook))
/** Casts the object to a notebook control */
#define RTGUI_NOTEBOOK(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_NOTEBOOK_TYPE, struct rtgui_notebook))
/** Checks if the object is a notebook control */
#define RTGUI_IS_NOTEBOOK(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_NOTEBOOK_TYPE))
#define RTGUI_NOTEBOOK_TOP 0x00
#define RTGUI_NOTEBOOK_BOTTOM 0x01
#define RTGUI_NOTEBOOK_NOTAB 0x02
#define RTGUI_NOTEBOOK_LEFT 0x03
#define RTGUI_NOTEBOOK_RIGHT 0x04
struct rtgui_notebook_tab;
struct rtgui_notebook
{
struct rtgui_widget parent;
rt_uint8_t flag;
/* widget private data */
struct rtgui_notebook_tab *childs;
rt_uint16_t count;
rt_int16_t current;
rt_uint16_t tab_w, tab_h;
};
struct rtgui_notebook *rtgui_notebook_create(const rtgui_rect_t *rect, rt_uint8_t style);
void rtgui_notebook_destroy(struct rtgui_notebook *notebook);
rt_inline void rtgui_notebook_set_tab_height(struct rtgui_notebook *notebook, rt_uint16_t height)
{
RT_ASSERT(notebook != RT_NULL);
notebook->tab_h = height;
}
rt_inline void rtgui_notebook_set_tab_width(struct rtgui_notebook *notebook, rt_uint16_t width)
{
RT_ASSERT(notebook != RT_NULL);
notebook->tab_w = width;
}
void rtgui_notebook_add(struct rtgui_notebook *notebook, const char *label, struct rtgui_widget *child);
#ifdef RTGUI_USING_NOTEBOOK_IMAGE
void rtgui_notebook_add_image(struct rtgui_notebook *notebook, const char *label, struct rtgui_widget *child,
struct rtgui_image *pressed_image, struct rtgui_image *unpressed_image);
#endif
void rtgui_notebook_remove(struct rtgui_notebook *notebook, rt_uint16_t index);
struct rtgui_widget *rtgui_notebook_get_current(struct rtgui_notebook *notebook);
rt_int16_t rtgui_notebook_get_current_index(struct rtgui_notebook *notebook);
int rtgui_notebook_get_count(struct rtgui_notebook *notebook);
void rtgui_notebook_get_client_rect(struct rtgui_notebook *notebook, struct rtgui_rect *rect);
void rtgui_notebook_set_current(struct rtgui_notebook *notebook, struct rtgui_widget *child);
void rtgui_notebook_set_current_by_index(struct rtgui_notebook *notebook, rt_uint16_t index);
struct rtgui_widget *rtgui_notebook_get_widget_at(struct rtgui_notebook *notebook, rt_uint16_t index);
rt_bool_t rtgui_notebook_event_handler(struct rtgui_object *widget, struct rtgui_event *event);
#endif
@@ -1,51 +0,0 @@
/*
* File : panel.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_PANEL_H__
#define __RTGUI_PANEL_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/container.h>
DECLARE_CLASS_TYPE(panel);
/** Gets the type of a panel */
#define RTGUI_PANEL_TYPE (RTGUI_TYPE(panel))
/** Casts the object to an panel */
#define RTGUI_PANEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PANEL_TYPE, rtgui_panel_t))
/** Checks if the object is an rtgui_panel */
#define RTGUI_IS_PANEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PANEL_TYPE))
/*
* the panel widget
*/
struct rtgui_panel
{
struct rtgui_container parent;
int border_style;
};
typedef struct rtgui_panel rtgui_panel_t;
rtgui_panel_t *rtgui_panel_create(int border_style);
void rtgui_panel_destroy(rtgui_panel_t *panel);
rt_inline void rtgui_panel_set_border(struct rtgui_panel *panel, int border_style)
{
RT_ASSERT(panel != RT_NULL);
panel->border_style = border_style;
}
rt_bool_t rtgui_panel_event_handler(struct rtgui_object *object, struct rtgui_event *event);
#endif
@@ -1,60 +0,0 @@
/*
* File : plot.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-09-03 Grissiom first version
*/
#ifndef __RTGUI_PLOT_H__
#define __RTGUI_PLOT_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/mv_view.h>
#include <rtgui/widgets/plot_curve.h>
DECLARE_CLASS_TYPE(plot);
/** Gets the type of a plot */
#define RTGUI_PLOT_TYPE (RTGUI_TYPE(plot))
/** Casts the object to an rtgui_plot */
#define RTGUI_PLOT(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PLOT_TYPE, struct rtgui_plot))
/** Checks if the object is an rtgui_plot */
#define RTGUI_IS_PLOT(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PLOT_TYPE))
enum rtgui_plot_type
{
RTGUI_PLOT_TYPE_SCAN,
RTGUI_PLOT_TYPE_INCREMENTAL,
};
/*
* the plot widget
*/
struct rtgui_plot
{
struct rtgui_mv_view parent;
enum rtgui_plot_type ptype;
rt_uint16_t scale_x;
rt_uint16_t scale_y;
rtgui_plot_curve_dtype base_x;
rtgui_plot_curve_dtype base_y;
};
struct rtgui_plot *rtgui_plot_create(void);
void rtgui_plot_destroy(struct rtgui_plot *plot);
void rtgui_plot_set_base(struct rtgui_plot *plot,
rtgui_plot_curve_dtype x, rtgui_plot_curve_dtype y);
rt_bool_t rtgui_plot_event_handler(struct rtgui_object *object, struct rtgui_event *event);
#endif
@@ -1,51 +0,0 @@
/*
* File : plot_curve.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-09-03 Grissiom first version
*/
#ifndef __RTGUI_PLOT_CURVE_H__
#define __RTGUI_PLOT_CURVE_H__
#include <rtgui/rtgui.h>
#include <rtgui/rtgui_mv_model.h>
DECLARE_CLASS_TYPE(plot_curve);
/** Gets the type of a plot_curve */
#define RTGUI_PLOT_CURVE_TYPE (RTGUI_TYPE(plot_curve))
/** Casts the object to an rtgui_plot */
#define RTGUI_PLOT_CURVE(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PLOT_CURVE_TYPE, struct rtgui_plot_curve))
/** Checks if the object is an rtgui_plot */
#define RTGUI_IS_PLOT_CURVE(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PLOT_CURVE_TYPE))
/* change this if you want to use other type of data.
* For example, rt_uint8_t or rt_uint32_t. */
#define rtgui_plot_curve_dtype rt_int16_t
struct rtgui_plot_curve
{
struct rtgui_mv_model parent;
rtgui_color_t color;
rtgui_plot_curve_dtype min_x, max_x;
rtgui_plot_curve_dtype min_y, max_y;
};
struct rtgui_plot_curve *rtgui_plot_curve_create(void);
void rtgui_plot_curve_destroy(struct rtgui_plot_curve *curve);
void rtgui_plot_curve_set_x(struct rtgui_plot_curve *curve, void *p);
void *rtgui_plot_curve_get_x(struct rtgui_plot_curve *curve);
void rtgui_plot_curve_set_y(struct rtgui_plot_curve *curve, void *p);
void *rtgui_plot_curve_get_y(struct rtgui_plot_curve *curve);
#endif
@@ -1,40 +0,0 @@
#ifndef __RTGUI_PROGRESSBAR_H__
#define __RTGUI_PROGRESSBAR_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(progressbar);
/** Gets the type of a progressbar */
#define RTGUI_PROGRESSBAR_TYPE (RTGUI_TYPE(progressbar))
/** Casts the object to a rtgui_progressbar */
#define RTGUI_PROGRESSBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PROGRESSBAR_TYPE, rtgui_progressbar_t))
/** Checks if the object is a rtgui_progressbar */
#define RTGUI_IS_PROGRESSBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PROGRESSBAR_TYPE))
#define DEFAULT_WIDTH 100
#define DEFAULT_HEIGHT 20
struct rtgui_progressbar
{
struct rtgui_widget parent;
int orient;
int range;
int position;
};
typedef struct rtgui_progressbar rtgui_progressbar_t;
struct rtgui_progressbar *rtgui_progressbar_create(int orientation, int range, rtgui_rect_t *r);
void rtgui_progressbar_destroy(struct rtgui_progressbar *p_bar);
rt_bool_t rtgui_progressbar_event_handler(struct rtgui_object *object,
struct rtgui_event *event);
void rtgui_progressbar_set_value(struct rtgui_progressbar *p_bar, int value);
int rtgui_progressbar_get_value(struct rtgui_progressbar *p_bar);
void rtgui_progressbar_set_range(struct rtgui_progressbar *p_bar, int range);
int rtgui_progressbar_get_range(struct rtgui_progressbar *p_bar);
#endif
@@ -1,45 +0,0 @@
#ifndef __RTGUI_RADIOBOX_H__
#define __RTGUI_RADIOBOX_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(radiobox);
/** Gets the type of a radiobox */
#define RTGUI_RADIOBOX_TYPE (RTGUI_TYPE(radiobox))
/** Casts the object to an rtgui_radiobox */
#define RTGUI_RADIOBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_RADIOBOX_TYPE, rtgui_radiobox_t))
/** Checks if the object is an rtgui_radiobox */
#define RTGUI_IS_RADIOBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_RADIOBOX_TYPE))
struct rtgui_radiobox
{
struct rtgui_widget parent;
/* widget private data */
char *text; /* radio box label */
/* box orient */
rt_uint8_t orient;
/* item size */
rt_uint8_t item_size;
char **items;
rt_uint16_t item_count;
rt_int16_t item_selection;
};
typedef struct rtgui_radiobox rtgui_radiobox_t;
struct rtgui_radiobox *rtgui_radiobox_create(const char *label, int orient, char **radio_items, int number);
void rtgui_radiobox_destroy(struct rtgui_radiobox *radiobox);
void rtgui_radiobox_set_selection(struct rtgui_radiobox *radiobox, int selection);
int rtgui_radiobox_get_selection(struct rtgui_radiobox *radiobox);
rt_bool_t rtgui_radiobox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_radiobox_set_orientation(struct rtgui_radiobox *radiobox, int orientation);
#endif
@@ -1,92 +0,0 @@
/*
* File : scrollbar.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-08-09 Bernard first version
*/
#ifndef __RTGUI_SCROLLBAR_H__
#define __RTGUI_SCROLLBAR_H__
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/container.h>
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_CLASS_TYPE(scrollbar);
/** Gets the type of a scrollbar */
#define RTGUI_SCROLLBAR_TYPE (RTGUI_TYPE(scrollbar))
/** Casts the object to an rtgui_scrollbar */
#define RTGUI_SCROLLBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_SCROLLBAR_TYPE, rtgui_scrollbar_t))
/** Checks if the object is an rtgui_scrollbar */
#define RTGUI_IS_SCROLLBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_SCROLLBAR_TYPE))
#define RTGUI_DEFAULT_SB_WIDTH 16
/* scrollbar status/positions*/
#define SBS_UNKNOWN 0x0000
#define SBS_LEFTARROW 0x0001
#define SBS_RIGHTARROW 0x0002
#define SBS_LEFTSPACE 0x0004 /* Need mouse_motion event */
#define SBS_RIGHTSPACE 0x0008 /* Need mouse_motion event */
#define SBS_HORZTHUMB 0x0010 /* Need mouse_motion event */
#define SBS_UPARROW 0x0020
#define SBS_DOWNARROW 0x0040
#define SBS_UPSPACE 0x0080 /* Need mouse_motion event */
#define SBS_DOWNSPACE 0x0100 /* Need mouse_motion event */
#define SBS_VERTTHUMB 0x0200 /* Need mouse_motion event */
#define SBS_UPTHUMB 0x0400 /* Need mouse_motion event */
#define SBS_DOWNTHUMB 0x0800 /* Need mouse_motion event */
#define SBS_LEFTTHUMB 0x1000 /* Need mouse_motion event */
#define SBS_RIGHTTHUMB 0x2000 /* Need mouse_motion event */
struct rtgui_scrollbar
{
/* inherit from widget */
rtgui_widget_t parent;
rt_uint8_t orient;
rt_uint32_t status;
/* page_step = display lines of scrollbar */
/* thumb_len = line_step * page_step / (page_step - (button width * 2)) */
rt_int16_t line_step, page_step;
rt_int16_t value, thumb_len,thumb_w;
/* position 1:1 width of scrollbar */
rt_int16_t count;
rtgui_widget_t *widget_link;/* be connected widget */
rt_bool_t (*on_scroll) (rtgui_object_t *obj, rtgui_event_t* event);
};
typedef struct rtgui_scrollbar rtgui_scrollbar_t;
rtgui_scrollbar_t* rtgui_scrollbar_create(rtgui_container_t *container,int left,int top,int w,int len,int orient);
void rtgui_scrollbar_destroy(rtgui_scrollbar_t* bar);
void rtgui_scrollbar_ondraw(rtgui_scrollbar_t* bar);
void rtgui_scrollbar_get_thumb_rect(rtgui_scrollbar_t *bar, rtgui_rect_t *erect);
void rtgui_scrollbar_set_range(rtgui_scrollbar_t* bar, int count);
void rtgui_scrollbar_set_value(rtgui_scrollbar_t* bar, rt_int16_t value);
void rtgui_scrollbar_set_onscroll(rtgui_scrollbar_t* bar, rtgui_event_handler_ptr handler);
void rtgui_scrollbar_set_orientation(rtgui_scrollbar_t* bar, int orient);
void rtgui_scrollbar_set_page_step(rtgui_scrollbar_t* bar, int step);
void rtgui_scrollbar_set_line_step(rtgui_scrollbar_t* bar, int step);
rt_bool_t rtgui_scrollbar_event_handler(rtgui_object_t *obj, rtgui_event_t* event);
void rtgui_scrollbar_hide(rtgui_scrollbar_t* bar);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,53 +0,0 @@
/*
* File : slider.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_SLIDER_H__
#define __RTGUI_SLIDER_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(slider);
/** Gets the type of a slider */
#define RTGUI_SLIDER_TYPE (RTGUI_TYPE(slider))
/** Casts the object to an rtgui_slider */
#define RTGUI_SLIDER(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_SLIDER_TYPE, rtgui_slider_t))
/** Checks if the object is an rtgui_slider */
#define RTGUI_IS_SLIDER(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_SLIDER_TYPE))
struct rtgui_slider
{
struct rtgui_widget parent;
/* widget private data */
rt_size_t min, max, value, ticks;
rt_size_t thumb_width;
int orient;
void (*on_changed)(struct rtgui_widget *widget, struct rtgui_event *event);
};
typedef struct rtgui_slider rtgui_slider_t;
struct rtgui_slider *rtgui_slider_create(rt_size_t min, rt_size_t max, int orient);
void rtgui_slider_destroy(struct rtgui_slider *slider);
rt_bool_t rtgui_slider_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_slider_set_range(struct rtgui_slider *slider, rt_size_t min, rt_size_t max);
void rtgui_slider_set_value(struct rtgui_slider *slider, rt_size_t value);
void rtgui_slider_set_orientation(struct rtgui_slider *slider, int orientation);
rt_size_t rtgui_slider_get_value(struct rtgui_slider *slider);
#endif
@@ -1,35 +0,0 @@
#ifndef __RTGUI_STATICLINE__H__
#define __RTGUI_STATICLINE__H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/widget.h>
/*
* the static line widget
*/
DECLARE_CLASS_TYPE(staticline);
/** Gets the type of a staticline */
#define RTGUI_STATICLINE_TYPE (RTGUI_TYPE(staticline))
/** Casts the object to an rtgui_staticline */
#define RTGUI_STATICLINE(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_STATICLINE_TYPE, rtgui_staticline_t))
/** Checks if the object is an rtgui_staticline */
#define RTGUI_IS_STATICLINE(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_STATICLINE_TYPE))
struct rtgui_staticline
{
/* inherit from widget */
struct rtgui_widget parent;
int orient;
};
typedef struct rtgui_staticline rtgui_staticline_t;
rtgui_staticline_t *rtgui_staticline_create(int orientation);
void rtgui_staticline_destroy(rtgui_staticline_t *staticline);
rt_bool_t rtgui_staticline_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_staticline_set_orientation(rtgui_staticline_t *staticline, int orientation);
#endif
@@ -1,107 +0,0 @@
/*
* File : textbox.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_TEXTBOX_H__
#define __RTGUI_TEXTBOX_H__
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/widget.h>
#include <rtgui/widgets/container.h>
#ifdef __cplusplus
extern "C" {
#endif
DECLARE_CLASS_TYPE(textbox);
/** Gets the type of a textbox */
#define RTGUI_TEXTBOX_TYPE (RTGUI_TYPE(textbox))
/** Casts the object to a rtgui_textbox_t */
#define RTGUI_TEXTBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_TEXTBOX_TYPE, rtgui_textbox_t))
/** Checks if the object is a rtgui_textbox_t */
#define RTGUI_IS_TEXTBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_TEXTBOX_TYPE))
#define RTGUI_TEXTBOX_DEFAULT_WIDTH 80
#define RTGUI_TEXTBOX_DEFAULT_HEIGHT 20
#define RTGUI_TEXTBOX_BORDER_WIDTH 1
#define RTGUI_TEXTBOX_SINGLE 0x00
#define RTGUI_TEXTBOX_MULTI 0x01 /* multiline */
#define RTGUI_TEXTBOX_MASK 0x02 /* ciphertext */
#define RTGUI_TEXTBOX_DIGIT 0x04 /* digit */
#define RTGUI_TEXTBOX_CARET_SHOW 0x10
#define RTGUI_TEXTBOX_CARET_STAT 0x20 /* unused */
#define RTGUI_TEXTBOX_LINE_MAX 128 /* text line cache */
struct rtgui_textbox
{
/* inherit from widget */
struct rtgui_widget parent;
/* text box flag */
rt_uint32_t flag;
/* current line and position */
rt_uint16_t line, line_begin, position;
/** maximum chars a line could hold excluding the NULL byte */
rt_uint16_t line_length;
rt_uint16_t dis_length; /*may be display length.*/
rt_uint16_t first_pos;
char mask_char;
/** a NULL terminated string that the textbox is holding */
char *text;
rt_size_t font_width;
rtgui_timer_t *caret_timer;
rtgui_color_t *caret;
rtgui_rect_t caret_rect;
/* textbox private data */
rt_bool_t (*on_enter)(struct rtgui_textbox *box, rtgui_event_t *event);
};
typedef struct rtgui_textbox rtgui_textbox_t;
rtgui_textbox_t *rtgui_textbox_create(const char *text, rt_uint32_t flag);
void rtgui_textbox_destroy(struct rtgui_textbox *box);
rt_bool_t rtgui_textbox_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_textbox_set_value(struct rtgui_textbox *box, const char *text);
const char *rtgui_textbox_get_value(struct rtgui_textbox *box);
void rtgui_textbox_set_mask_char(rtgui_textbox_t *box, const char ch);
char rtgui_textbox_get_mask_char(rtgui_textbox_t *box);
/** set the maximum chars a line could hold excluding the NULL byte
*
* It will truncate the current line if the length is smaller than the chars
* the box is currently holding. But the box->text is guaranteed to be NULL
* terminated anyway.
*
* @param box the text box it operate on
* @param length the new line length. It should be greater than 0.
*
* @return -RT_ERROR on invalid length; -RT_ENOMEM if there is no enough memory
* to allocate the new buffer. On returning -RT_ENOMEM, the original text would
* remain unchanged.
*/
rt_err_t rtgui_textbox_set_line_length(struct rtgui_textbox *box, rt_size_t length);
void rtgui_textbox_get_edit_rect(struct rtgui_textbox *box, rtgui_rect_t *rect);
void rtgui_textbox_ondraw(rtgui_textbox_t *box);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,67 +0,0 @@
/*
* File : textview.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2011-03-05 Bernard first version
*/
#ifndef __RTGUI_TEXTVIEW_H__
#define __RTGUI_TEXTVIEW_H__
#include <rtgui/widgets/widget.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup rtgui_textview
* @{
*/
DECLARE_CLASS_TYPE(textview);
/** Gets the type of a textview */
#define RTGUI_TEXTVIEW_TYPE (RTGUI_TYPE(textview))
/** Casts the object to an rtgui_textview */
#define RTGUI_TEXTVIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_TEXTVIEW_TYPE, rtgui_textview_t))
/** Checks if the object is an rtgui_textview */
#define RTGUI_IS_TEXTVIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_TEXTVIEW_TYPE))
/*
* the textview widget
*/
struct rtgui_textview
{
/* inherit from widget */
struct rtgui_widget parent;
rt_uint16_t line_width;
rt_uint16_t line_count;
char *lines;
rt_int16_t line_current;
rt_uint16_t line_page_count;
};
typedef struct rtgui_textview rtgui_textview_t;
rtgui_textview_t *rtgui_textview_create(const char *text, const rtgui_rect_t *rect);
void rtgui_textview_destroy(rtgui_textview_t *textview);
rt_bool_t rtgui_textview_event_handler(struct rtgui_object *object, struct rtgui_event *event);
void rtgui_textview_set_text(rtgui_textview_t *textview, const char *text);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
@@ -1,44 +0,0 @@
/*
* File : title.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#ifndef __RTGUI_TITLE__
#define __RTGUI_TITLE__
#include <rtgui/widgets/widget.h>
DECLARE_CLASS_TYPE(wintitle);
/** Gets the type of a title */
#define RTGUI_WINTITLE_TYPE (RTGUI_TYPE(wintitle))
/** Casts the object to an rtgui_wintitle */
#define RTGUI_WINTITLE(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_WINTITLE_TYPE, rtgui_wintitle_t))
/** Checks if the object is an rtgui_wintitle */
#define RTGUI_IS_WINTITLE(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_WINTITLE_TYPE))
struct rtgui_wintitle
{
struct rtgui_widget parent;
/* title */
char *title;
};
typedef struct rtgui_wintitle rtgui_wintitle_t;
rtgui_wintitle_t *rtgui_wintitle_create(struct rtgui_win *window, const char *title);
void rtgui_wintitle_destroy(rtgui_wintitle_t *wintitle);
rt_bool_t rtgui_wintile_event_handler(rtgui_widget_t *widget, rtgui_event_t *event);
void rtgui_wintitle_set_title(rtgui_wintitle_t *wintitle, const char *title);
char *rtgui_wintitle_get_title(rtgui_wintitle_t *wintitle);
#endif

Some files were not shown because too many files have changed in this diff Show More