# wayland客户端c++封装生成器 **Repository Path**: maple1618/mayland ## Basic Information - **Project Name**: wayland客户端c++封装生成器 - **Description**: No description available - **Primary Language**: Python - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-04 - **Last Updated**: 2026-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Mayland - Wayland C++ Wrapper Generator Mayland 是一个用于从 Wayland XML 协议文件自动生成 C++ 包装器代码的工具。 ## 功能特性 - 自动解析 Wayland XML 协议文件 - 生成类型安全的 C++ 类框架 - 生成完整的方法定义和监听器接口 - 一键生成整个项目 ## 项目结构 ``` mayland/ ├── src/ # 源代码目录 │ ├── config.py # 配置文件 │ ├── generate_main.py # 生成类框架 │ ├── generate_funcion.py # 生成方法定义 │ ├── enum_generator.py # 生成枚举定义 │ ├── xml_parser.py # XML 解析器 │ ├── c_function.py # C 头文件处理 │ ├── get_headers.py # 协议头文件生成 │ └── insert_methods.py # 方法插入 ├── tools/ # 工具脚本 │ ├── all_run.py # 一键生成脚本 │ └── global.c # Wayland 全局接口查询工具 ├── include/ # 手写头文件 │ ├── mayland-all.hpp # 统一入口 │ ├── mayland-core.hpp # 核心基类 │ └── mayland-cursor.hpp # 光标支持 ├── docs/ # 文档目录 ├── tests/ # 测试目录 ├── README.md # 项目说明 └── LICENSE # 许可证 ``` ## 快速开始 ### 依赖 - Python 3.8+ - Wayland 开发库 - GCC(用于编译 global.c) ### 使用方法 ```bash # 一键生成所有代码 python tools/all_run.py # 自定义输出路径(修改 src/config.py) # perfix = "/your/output/path" # 清除缓存后生成 python tools/all_run.py --clean ``` ## 生成的文件 | 文件 | 说明 | |------|------| | `mayland.hpp` | 主类框架头文件 | | `mayland-function.hpp` | 内联方法定义 | | `mayland-enum.hpp` | 枚举定义 | | `mayland-listener.hpp` | 监听器接口 | | `mayland-c.hpp` | C 接口包装 | ## 许可证 LGPL3.0 License