# Wayland display and input driver
Wayland display and input driver, with support for keyboard, pointer (i.e. mouse) and touchscreen.
Keyboard support is based on libxkbcommon.
Following shell are supported:
* wl_shell (deprecated)
* xdg_shell
> xdg_shell requires an extra build step; see section _Generate protocols_ below.
Basic client-side window decorations (simple title bar, minimize and close buttons)
are supported, while integration with desktop environments is not.
## Install headers and libraries
### Ubuntu
```
sudo apt-get install libwayland-dev libxkbcommon-dev libwayland-bin wayland-protocols
```
### Fedora
```
sudo dnf install wayland-devel libxkbcommon-devel wayland-utils wayland-protocols-devel
```
## Generate protocols
Support for non-basic shells (i.e. other than _wl_shell_) requires additional
source files to be generated before the first build of the project. To do so,
navigate to the _wayland_ folder (the one which includes this file) and issue
the following commands:
```
cmake .
make
```
## Build configuration under Eclipse
In "Project properties > C/C++ Build > Settings" set the followings:
- "Cross GCC Compiler > Command line pattern"
- Add ` ${wayland-cflags}` and ` ${xkbcommon-cflags}` to the end (add a space between the last command and this)
- "Cross GCC Linker > Command line pattern"
- Add ` ${wayland-libs}` and ` ${xkbcommon-libs}` to the end (add a space between the last command and this)
- In "C/C++ Build > Build variables"
- Configuration: [All Configuration]
- Add
- Variable name: `wayland-cflags`
- Type: `String`
- Value: `pkg-config --cflags wayland-client`
- Variable name: `wayland-libs`
- Type: `String`
- Value: `pkg-config --libs wayland-client`
- Variable name: `xkbcommon-cflags`
- Type: `String`
- Value: `pkg-config --cflags xkbcommon`
- Variable name: `xkbcommon-libs`
- Type: `String`
- Value: `pkg-config --libs xkbcommon`
## Init Wayland in LVGL
1. In `main.c` `#incude "lv_drivers/wayland/wayland.h"`
2. Enable the Wayland driver in `lv_drv_conf.h` with `USE_WAYLAND 1` and
configure its features below, enabling at least support for one shell.
3. `LV_COLOR_DEPTH` should be set either to `32` or `16` in `lv_conf.h`;
support for `8` and `1` depends on target platform.
4. After `lv_init()` call `lv_wayland_init()`.
5. Add a display (or more than one) using `lv_wayland_create_window()`,
possibly with a close callback to track the status of each display:
```c
#define H_RES (800)
#define V_RES (480)
/* Create a display */
lv_disp_t * disp = lv_wayland_create_window(H_RES, V_RES, "Window Title", close_cb);
```
As part of the above call, the Wayland driver will register four input devices
for each display:
- a KEYPAD connected to Wayland keyboard events
- a POINTER connected to Wayland touch events
- a POINTER connected to Wayland pointer events
- a ENCODER connected to Wayland pointer axis events
Handles for input devices of each display can be get using respectively
`lv_wayland_get_indev_keyboard()`, `lv_wayland_get_indev_touchscreen()`,
`lv_wayland_get_indev_pointer()` and `lv_wayland_get_indev_pointeraxis()`, using
`disp` as argument.
5. After `lv_deinit()` (if used), or in any case during de-initialization, call
`lv_wayland_deinit()`.
### Fullscreen mode
In order to set one window as fullscreen or restore it as a normal one,
call the `lv_wayland_window_set_fullscreen()` function respectively with `true`
or `false` as `fullscreen` argument.
### Disable window client-side decoration at runtime
Even when client-side decorations are enabled at compile time, they can be
disabled at runtime setting the `LV_WAYLAND_DISABLE_WINDOWDECORATION`
environment variable to `1`.
没有合适的资源?快使用搜索试试~ 我知道了~
lv_port_win_visual_studio lv drivers
共62个文件
h:26个
c:21个
md:3个
需积分: 8 1 下载量 179 浏览量
2022-03-19
10:11:23
上传
评论
收藏 132KB ZIP 举报
温馨提示
lv_port_win_visual_studio-master lv drivers
资源详情
资源评论
资源推荐
收起资源包目录
lv_drivers-1bd4368e71df5cafd68d1ad0a37ce0f92b8f6b88.zip (62个子文件)
lv_drivers-1bd4368e71df5cafd68d1ad0a37ce0f92b8f6b88
.gitignore 13B
lv_drivers.mk 365B
wayland
.gitignore 67B
wayland.c 68KB
README.md 4KB
wayland.h 2KB
CMakeLists.txt 2KB
library.json 340B
win32drv
win32drv.c 27KB
win32drv.h 1KB
LICENSE 1KB
sdl
sdl.h 2KB
sdl_gpu.c 16KB
sdl_gpu.h 3KB
sdl.c 17KB
win_drv.h 930B
.github
stale.yml 703B
auto-comment.yml 736B
README.md 364B
display
fbdev.c 7KB
ST7565.c 8KB
R61581.h 1KB
drm.c 18KB
UC1610.c 8KB
SHARP_MIP.c 6KB
fbdev.h 1KB
ILI9341.h 1KB
GC9A01.h 2KB
R61581.c 9KB
ILI9341.c 15KB
monitor.h 978B
drm.h 983B
SSD1963.h 5KB
SHARP_MIP.h 1KB
GC9A01.c 12KB
ST7565.h 1KB
UC1610.h 1KB
SSD1963.c 7KB
gtkdrv
gtkdrv.c 9KB
broadway.png 28KB
README.md 3KB
gtkdrv.h 1KB
lv_drv_conf_template.h 15KB
indev
libinput_drv.h 4KB
XPT2046.h 864B
evdev.h 1KB
FT5406EE8.h 880B
mousewheel.h 1KB
xkb.h 3KB
AD_touch.c 10KB
evdev.c 7KB
AD_touch.h 3KB
FT5406EE8.c 4KB
libinput.c 15KB
keyboard.h 1KB
mouse.h 1KB
xkb.c 6KB
XPT2046.c 4KB
docs
astyle_h 33B
astyle_c 169B
win_drv.c 8KB
CMakeLists.txt 1KB
共 62 条
- 1
lbaihao
- 粉丝: 554
- 资源: 120
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 成都市地图含高新区(高新南区,高新西区),天府新区,东部新区虚拟行政区划
- XILINXFPGA源码XilinxEDK设计试验
- XILINXFPGA源码XilinxEDKMicroBlaze内置USB固件程序
- 基于 django 的视频点播后台管理系统源代码+数据库
- 基于Java的网上医院预约挂号系统的设计与实现(部署视频)-kaic.mp4
- 新建项目opengrok
- XILINXFPGA源码XilinxDDR3最新VHDL代码(通过调试)
- XILINXFPGA源码XilinxDDR2存储器接口调试代码
- 班级事务管理系统设计与实现(部署视频)-kaic.mp4
- excel带下拉框展示(动态展示)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0