Wayland Tool Kit:Wayland工具库
Wayland工具库为了更方便得使用Wayland。
源代码地址
http://git.oschina.net/afxmain/WTK.git
说明
头文件:<wayland/wtk.h>
库文件:-lwayland-wtk
函数API:
int wlInit(); /* 初始化Registry结构体 */
wlInit函数必须第一个调用,用来创建与Wayland服务器的连接和初始化Registry结构。
/* Wayland的全局对象都放在Registry中 */LPWAYLANDREGISTRY wlGetRegistry ();
获取Wayland全局对象注册表
int wlDispatch(); /* 消息分发函数,主线程循环调用 */
消息分发函数,分发主消息队列。
HSURFACE wlCreateSurface(const char* title, int width, int height);
创建窗口,默认不显示,且没有任何显示内容。
void wlBeginPaint ( HSURFACE surface , LPPAINTSTRUCTURE lpPaint );void wlEndPaint ( HSURFACE surface , LPPAINTSTRUCTURE lpPaint );
绘图函数调用依赖的两个函数。lpPaint->buffer->hdc是cairo绘图库的设备上下文。lpPaint->buffer->data 是像素存放位置。