uCGUI 简介.pdf
uCGUI的性能与资源占用.pdf
第01章 uCGUI的介绍.pdf
第02章 入门指南.pdf
第03章 仿真器.pdf
第04章 文本显示.pdf
第05章 显示数值.pdf
第06章 2-D图形库.pdf
第07章 字体.pdf
第08章 位图转换器.pdf
第09章 颜色.pdf
第10章 存储设备.pdf
第11章 运行模式:单、多任务.pdf
第12章 视窗管理器(WM).pdf
第13章 窗口对象(控件).pdf
第14章 对话框.pdf
第15章 抗锯齿.pdf
第16章 Unicode.pdf
第17章 Shift-JIS支持.pdf
第18章 输入设备.pdf
第19章 与时间相关的函数.pdf
第20章 底层配置.pdf
第21章 高层次配置.pdf
第22章 LCD驱动程序.pdf
第23章 LCD驱动API函数.pdf
第24章 性能和资源占用.pdf
ucgui 3.98源码 带 memdev(内存设备):uCGUI3_98_with_memdev.rar
VC6绿色版下载: vc++6.0_green.7z
上面这个ucgui3.98代码用 VC2015打开直接奔溃,所以上传一个VC6绿色版本给大家下载.
2018-08-06:
-----------------------------------
VC2015奔溃原因是VS的插件导致, 卸载就解决了奔溃问题,但是VC2015打开项目之后也要折腾很久才能正常编译、链接、运行。
2018-08-07:
-----------------------------------
SDL版本 ucgui3.98可执行程序下载: ucgui398_memdev.7z
2018-08-10:
-----------------------------------
超级酷界面 ucgui3.90a 源码下载: uCGUI_V390a_demo_very_nice.rar
离线
整齐
离线
谢谢分享。。。。。。。。。
离线
请教大神们, emwin/ucgui的内存设备(memdev)可以用来干嘛?
离线
内存设备
内存设备是绘图操作中独立于硬件的目标设备。
若已创建内存设备 (通过调用 GUI_MEMDEV_Create())并生效 (通过调用
GUI_MEMDEV_Select())则所有的绘图操作均在内存中执行。仅当完成所有操作之后,才
会在画面上显示最终结果。该动作通过调用 GUI_MEMDEV_CopyToLCD() 来完成。
内存设备可用于:
• 避免 (向显示器直接绘图而产生的)闪烁效果,
• 作为解压图像的容器,
• 用于旋转操作 (GUI_MEMDEV_Rotate())和缩放操作 (图 7),
• 用于淡入淡出效果,
• 用于窗口动画,
• 用于透明效果。
由于内存设备需要使用大量内存空间 (参见 表 7 中的 “ 内存设备 ” 组件,如果有条件的话建
议使用外部存储器。
离线
学习学习,果然权威。
离线
请问ucGUI在NANO上用Linux移植,是怎么移植?
离线
有这样的例子可以照搬照样来学习?
离线
不久把ucgui-3.90a移植到了Linux下,还是写个总结吧。。。
ucgui的可移植性很高,只需要做很少的改动就可以移植到各个平台,移植到Linux下也一样。
首先编辑GUIConf.h这个文件:
#ifndef GUICONF_H
#define GUICONF_H
#define GUI_OS (1) /* Compile with multitasking support */
#define GUI_SUPPORT_TOUCH (0) /* Support a touch screen (req. win-manager), for linux */
#define GUI_SUPPORT_UNICODE (1) /* Support mixed ASCII/UNICODE strings, for linux */
#define GUI_DEFAULT_FONT &GUI_Font6x8
#define GUI_ALLOC_SIZE 25*1024 /* Size of dynamic memory */
#define GUI_SUPPORT_CURSOR (1) /* for linux*/
#define GUI_WINSUPPORT 1 /* Window manager package available */
#define GUI_SUPPORT_MEMDEV 1 /* Memory devices available */
#define GUI_SUPPORT_AA 1 /* Anti aliasing available */
#endif /* Avoid multiple inclusion */
接着修改LCDConf.h文件,因为我们直接使用framebuffer设备,所以只需要修改LCDConf.h文件的前面部分即可:
#define LCD_XSIZE (720) /* X-resolution of LCD, Logical coor. for linux */
#define LCD_YSIZE (576) /* Y-resolution of LCD, Logical coor. for linux */
#define LCD_BITSPERPIXEL (16) /* for linux */
#define LCD_SWAP_RB (1) /* for linux, actually 1555 format */
#define LCD_FIXEDPALETTE (555) /* for linux, actually 1555 format */
#define LCD_CONTROLLER (-1) /* for linux */
接下来修改LCDDummy.c,添加对framebuffer的支持:
/* for linux framebuffer */
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
static struct fb_var_screeninfo vinfo;
static struct fb_fix_screeninfo finfo;
static char *pFrameBuffer = NULL;
........................................................
void LCD_L0_SetPixelIndex(int x, int y, int PixelIndex)
{
/* Convert logical into physical coordinates (Dep. on LCDConf.h) */
#if LCD_SWAP_XY | LCD_MIRROR_X| LCD_MIRROR_Y
int xPhys = LOG2PHYS_X(x, y);
int yPhys = LOG2PHYS_Y(x, y);
#else
#define xPhys x
#define yPhys y
#endif
int location = 0;
location = (x + vinfo.xoffset) * (vinfo.bits_per_pixel >> 3) + (y+vinfo.yoffset) * finfo.line_length;
*(short*)(pFrameBuffer + location) = (short)PixelIndex; /* 16bpp */
return;
}
unsigned int LCD_L0_GetPixelIndex(int x, int y)
{
LCD_PIXELINDEX PixelIndex;
/* Convert logical into physical coordinates (Dep. on LCDConf.h) */
#if LCD_SWAP_XY | LCD_MIRROR_X| LCD_MIRROR_Y
int xPhys = LOG2PHYS_X(x, y);
int yPhys = LOG2PHYS_Y(x, y);
#else
#define xPhys x
#define yPhys y
#endif
/* Read from hardware ... Adapt to your system */
{
int location = 0;
location = (x + vinfo.xoffset) * (vinfo.bits_per_pixel >> 3) + (y+vinfo.yoffset) * finfo.line_length;
PixelIndex = *(short*)(pFrameBuffer + location); /* 16bpp */
}
return PixelIndex;
}
....................................................
int LCD_L0_Init(void)
{
int f_fbDev;
int ScreenSize;
static struct fb_bitfield g_r16 = {10, 5, 0};
static struct fb_bitfield g_g16 = {5, 5, 0};
static struct fb_bitfield g_b16 = {0, 5, 0};
static struct fb_bitfield g_a16 = {15, 1, 0};
f_fbDev = open("/dev/fb0", O_RDWR);
if (f_fbDev <= 0)
{
printf("Error: cannot open framebuffer device.\n");
return (-1);
}
if (ioctl(f_fbDev, FBIOGET_VSCREENINFO, &vinfo) < 0)
{
printf("Error reading variable information.\n");
close(f_fbDev);
return (-1);
}
vinfo.xres = vinfo.xres_virtual = 720;
vinfo.yres = 576;
vinfo.yres_virtual = 576*2;
vinfo.transp= g_a16;
vinfo.red = g_r16;
vinfo.green = g_g16;
vinfo.blue = g_b16;
vinfo.bits_per_pixel = 16;
if (ioctl(f_fbDev, FBIOPUT_VSCREENINFO, &vinfo) < 0)
{
printf("Put variable screen info failed!\n");
close(f_fbDev);
return -1;
}
if (ioctl(f_fbDev, FBIOGET_FSCREENINFO, &finfo))
{
printf("Error reading fixed information.\n");
return -1;
}
printf("xres is %d\n, yres is %d\n", vinfo.xres, vinfo.yres);
ScreenSize = vinfo.xres * vinfo.yres * (vinfo.bits_per_pixel >> 3);
pFrameBuffer =(char *)mmap(0, ScreenSize, PROT_READ | PROT_WRITE, MAP_SHARED,f_fbDev, 0);
if ((long)pFrameBuffer == -1)
{
printf("Error: failed to map framebuffer device to memory.\n");
close(f_fbDev);
return (-1);
}
return 0;
}
至此,LCDDummy.c修改完毕。
接下来添加鼠标支持,新建一个GUI_MOUSE_DriverLinux.c代替原来的GUI_MOUSE_DriverPS2.c,这里的思路是用一个线程来读取鼠标设备:
.................................................
void *ThreadReamMouse(void)
{
int ret;
int fd;
fd_set readfs;
int maxfd = 0;
char temp[3];
fd = open ("/dev/mouse0",O_RDWR);
if (fd < 0)
{
printf ("%s open failed\n", "/dev/mouse0");
return NULL;
}
printf("open %s success, fd is %d\n", "/dev/mouse0", fd);
maxfd = fd + 1;
for (; ;)
{
FD_ZERO(&readfs);
FD_SET(fd, &readfs);
ret = select(maxfd, &readfs, NULL, NULL, NULL);
if (ret < 0)
{
printf("select failure!\n");
return NULL;
}
if (FD_ISSET(fd, &readfs))
{
/*
* 读取鼠标
*/
_NumBytesInBuffer = read(fd, _abInBuffer, sizeof(_abInBuffer));
if ((_NumBytesInBuffer == 3) && ((_abInBuffer[0] & 0x0c) == 0x08))
{
_EvaPacket();
//printf("Get mouse data!\n");
}
}
}
}
void GUI_MOUSE_DRIVER_PS2_Init(void)
{
pthread_t pidReadMouse;
_NumBytesInBuffer = 0;
pthread_create(&pidReadMouse, NULL, (void *)ThreadReamMouse, NULL);
printf("Create thread sucess!\n");
}
GUI_MOUSE_DRIVER_PS2_Init()函数需要在哪里调用呢?不调用的话,鼠标没法用啊。增加GUI_X_Linux.c文件:
.............................................................
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
..............................................................
void GUI_X_ExecIdle(void)
{
usleep(1000);
return;
}
int GUI_X_GetTime(void)
{
struct timeval tv;
int tm;
gettimeofday(&tv, NULL);
tm = tv.tv_sec*1024 + tv.tv_usec/1024;
return tm;
}
void GUI_X_Delay(int Period)
{
while(Period--)
{
usleep(1000);
}
return;
}
void GUI_X_Unlock(void)
{
pthread_mutex_unlock(&mutex);
return;
}
void GUI_X_Lock(void)
{
pthread_mutex_lock(&mutex);
return;
}
U32 GUI_X_GetTaskId(void)
{
pthread_t id;
id = pthread_self();
printf("GUI_X_GetTaskId %d \n", (U32)id);
return ((U32)id);
}
void GUI_X_InitOS(void)
{
printf("GUI_X_InitOS\n");
GUI_MOUSE_DRIVER_PS2_Init(); /* create read mouse thread for linux */
return;
}
.....................................................
至此,该修改的文件都修改完毕了,可以开始编译了。但是ucgui的工程一般是在windows下编译的,在Linux下交叉编译需要写Makefile,按照Linux的惯例,在每个文件夹下增加Makefile,如下:
CC = arm-linux-gcc
CFLAGS=-I../Core -I../../Config/ -I../WM/
#all c files at current directory
SRCS:=$(wildcard *.c)
#replace .c to .o in SRCS
OBJS:=$(SRCS:%.c=%.o)
all:$(OBJS)
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY : clean
clean:
rm *.o
再增加一个编译gui库的Makefile:
SUBDIRS=AntiAlias ConvertMono Font LCDDriver MemDev Widget ConvertColor Core JPEG MultiLayer WM
LIBOBJS=
LIBOBJS+=$(wildcard AntiAlias/*.o)
LIBOBJS+=$(wildcard ConvertMono/*.o)
LIBOBJS+=$(wildcard Font/*.o)
LIBOBJS+=$(wildcard LCDDriver/*.o)
LIBOBJS+=$(wildcard MemDev/*.o)
LIBOBJS+=$(wildcard ConvertColor/*.o)
LIBOBJS+=$(wildcard Core/*.o)
LIBOBJS+=$(wildcard JPEG/*.o)
LIBOBJS+=$(wildcard MultiLayer/*.o)
LIBOBJS+=$(wildcard WM/*.o)
LIBOBJS+=$(wildcard Widget/*.o)
all:
for name in $(SUBDIRS); do (cd $$name && make && cd ../) done
make guilib
.PHONY:guilib
guilib:
arm-linux-ar rv libucgui.a $(LIBOBJS)
.PHONY:clean
clean:
@rm -f libucgui.a
@for name in $(SUBDIRS); do (cd $$name && make clean && cd ../) done
至此,整个移植过程就告一段落,直接make 就可以了。。。
这样正确吗
离线
在nano怎么下载
离线
Linux下放在哪个目录?
离线
和Linux没有关系, 你把Makefile写好就可以了, 如果不会Makefile语法, 就用gcc命令行一行搞定也行.
类似这种:
gcc -o demo AA.c BB.c DD.c -lpthread
离线
谢谢分享了,不错
离线
离线
ucgui在Linux需要下载安装吗?
离线
ucgui在Linux需要下载安装吗?
一句话说不清楚,
如果会VC/Qt 你最好能移植模拟器(实现画点即可),
这样移植到linux(framebuffer)几乎没有难度。
离线
现在都是emwin啦
离线
我在 pudn 下载的版本不支持 memdev, 试一试楼主的版本。
离线
好资料!
离线
酷炫汽车仪表盘!
离线
终于找到五指棋的 ucgui demo 了,感谢楼主.
离线
请问大家如何去掉 ucgui 串口的标题条?
离线
在窗口回调函数中:
WM_INIT_DIALOG 消息中执行 FRAMEWIN_SetTitleVis
static void _cbCallBack(WM_MESSAGE* pMsg)
{
WM_HWIN hWin = pMsg->hWin;
switch(pMsg->MsgId)
{
case WM_INIT_DIALOG:
FRAMEWIN_SetTitleVis(hWin, 0);
离线
好贴,好网站
离线
谢谢分享!!!
离线
好东西,谢谢分享d=====( ̄▽ ̄*)b
离线
有这样的例子可以照搬照样来学习?
离线
vc++6.0文件失效了吗?
离线
ucgui 3.9.8是经典版本,之后好像就不开源了
离线
vc++6.0文件失效了吗?
一楼的下载链接已修复: VC6绿色版下载: vc++6.0_green.7z
离线
谢谢分享, rtt上可以用下
离线
可以下载了,没想到vc6竟然这么小
离线
谢谢分享,还是VC6经典
离线
谢谢分享
离线
谢谢分享,好资料!
离线
研究研究,看看字库,UCGUI和emwin同源?
离线
离线
VC6绿色版下载,哪还能下?
离线
离线
谢谢分享,一直想学习ucgui的,占楼怕以后找不到了
离线