{"id":20572852,"url":"https://github.com/zlgopen/awtk-linux-fb","last_synced_at":"2025-04-04T22:06:35.568Z","repository":{"id":37819525,"uuid":"147609908","full_name":"zlgopen/awtk-linux-fb","owner":"zlgopen","description":"awtk port for linux framebuffer","archived":false,"fork":false,"pushed_at":"2025-03-12T01:39:59.000Z","size":6127,"stargazers_count":114,"open_issues_count":58,"forks_count":49,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T21:06:25.951Z","etag":null,"topics":["awtk","framebuffer","gui","linux"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zlgopen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-06T03:02:22.000Z","updated_at":"2025-03-12T01:40:03.000Z","dependencies_parsed_at":"2024-06-28T04:22:13.565Z","dependency_job_id":"2bbb3d8e-523f-4ac0-ac7c-6f05f985166d","html_url":"https://github.com/zlgopen/awtk-linux-fb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlgopen%2Fawtk-linux-fb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlgopen%2Fawtk-linux-fb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlgopen%2Fawtk-linux-fb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zlgopen%2Fawtk-linux-fb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zlgopen","download_url":"https://codeload.github.com/zlgopen/awtk-linux-fb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awtk","framebuffer","gui","linux"],"created_at":"2024-11-16T05:24:15.969Z","updated_at":"2025-04-04T22:06:35.548Z","avatar_url":"https://github.com/zlgopen.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWTK 针对 arm-linux 平台的移植。\n\n[AWTK](https://github.com/zlgopen/awtk) 是为嵌入式系统开发的 GUI 引擎库。\n\n[awtk-linux-fb](https://github.com/zlgopen/awtk-linux-fb) 是 AWTK 在 arm-linux 上的移植。\n\n本项目以 [ZLG 周立功 linux 开发套件 AWork 平台 iMX287A 入门级 ARM9 开发板](https://item.taobao.com/item.htm?spm=a230r.1.14.1.29c8b3f8qxjYf7\u0026id=536334628394\u0026ns=1\u0026abbucket=17#detail) 为载体移植，其它开发板可能要做些修改，有问题请请创建 issue。 \n\n## 使用方法\n\n#### 准备工作\n\n* 1. 获取源码\n\n\u003e 以下两者并列放在同一个目录，如果用户有自己的项目，也建议与以下两者并列放在同一目录。\n\n```\ngit clone https://github.com/zlgopen/awtk.git\ngit clone https://github.com/zlgopen/awtk-linux-fb.git\ncd awtk-linux-fb\n```\n\n* 2. 配置 scons 交叉编译工具链，在 awtk-linux-fb 目录创建 awtk_config_define.py 文件\n\n```\n# awtk_config_define.py\nTOOLS_PREFIX = \"/opt/28x/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-linux-\"\nTSLIB_LIB_DIR = \"/opt/28x/tslib/lib\"\nTSLIB_INC_DIR = \"/opt/28x/tslib/include\"\n```\n\n\u003e 如果不需要 tslib，不定义 TSLIB\\_LIB\\_DIR 和 TSLIB\\_INC\\_DIR 即可。如：\n\n```\n# awtk_config_define.py\nTSLIB_LIB_DIR = \"\"\nTSLIB_INC_DIR = \"\"\n```\n\n\u003e 详情可以看 scons help，或者可以通过 scons EXPORT_DEFINE_FILE=./awtk_config_define.py 导出一个完整的 awtk_config_define.py 文件。\n\n* 3. 配置设备文件路径，方法二选一：\n     1. 配置 config/devices.json 文件，详情请看 config/readme.md 文档。\n     \n     2. 修改 awtk-port/main\\_loop\\_linux.c 文件设置输入输出设备的文件名。\n     \n```c\n// main_loop_linux.c\n//   这个方法将来会弃用，如果运行时有 devices.json 文件则会优先使用 devices.json 的配置\n//\n#define FB_DEVICE_FILENAME \"/dev/fb0\"\n#define TS_DEVICE_FILENAME \"/dev/input/event0\"\n#define KB_DEVICE_FILENAME \"/dev/input/event1\"\n#define MICE_DEVICE_FILENAME \"/dev/input/mouse0\"\n```\n\n  **备注：**\n  可通过 \"hexdump  /dev/input/xx\" 命令识别正确的触摸或鼠标设备文件名。触摸设备也可以通过tslib自带的命令测试，如 \"ts_test\"、\"ts_print\"。\n\n  \u003e 注意：在有些平台下，如果设置 \"/dev/input/mice\"，会出现触摸不灵的问题。通过 hexdump /dev/input/mice 命令发现，该设备文件会同时接收触摸和鼠标事件，这种情况请不要使用该设备。\n\n#### 生成并部署AWTK内置DemoUI\n\n1. 请先安装 scons，并完成上面的**准备工作**\n2. 在命令行输入：\n\n```bash\ncd /home/user/awtk-linux-fb\nscons\n```\n\n3. 等待编译成功，生成发布压缩包，在命令行输入：\n\n```bash\nsh ./release.sh\n```\n\n4. 等待发布完成后，在 awtk-linux-fb 目录下会出现 release.tar.gz 的压缩包，该压缩包就是发布包\n5. 运行\n\n把 release.tar.gz （发布包）上传到开发板，并解压，然后运行：\n\n```bash\n# 程序运行可能要依赖awtk的so文件，如运行失败请尝试设置so文件的绝对路径\n# export LD_LIBRARY_PATH=/path/to/bin\nsudo ./release/bin/demoui\n```\n\n#### 生成并部署用户自己的应用程序\n\n1. 请先安装 scons，并完成上面的**准备工作**\n2.  awtk 与用户的程序目录结构如下所示\n\n```bash\n/home/user/\n\t|-- awtk/\n\t|-- awtk-linux-fb/\n\t|-- user_apps/\n```\n\n输入命令行命令：\n\n```bash\ncd /home/user/awtk-linux-fb\nscons APP=../user_apps/HelloDesigner-Demo\n```\n\n3.  等待编译成功，生成发布压缩包，在命令行输入：\n```bash\n./release.sh ../user_apps/HelloDesigner-Demo/res demo\n```\n\n4. 等待发布完成后，在 awtk-linux-fb 目录下会出现 release.tar.gz 的压缩包，该压缩包就是发布包\n5. 运行\n\n把 release.tar.gz （发布包）上传到开发板，并解压，然后运行：\n\n```bash\n# 程序运行可能要依赖awtk的so文件，如运行失败请尝试设置so文件的绝对路径\n# export LD_LIBRARY_PATH=/path/to/bin\nsudo ./release/bin/demo\n```\n\n## 文档\n\n* [如何搭建 Ubuntu 调试环境](docs/how_to_use_in_vmware.md)\n\n## 其他问题\n\n#### 1. 项目路径\n\n默认情况下，scons 脚本假设以下文件夹在同一个目录。\n\n```\nzlgopen\n  |-- awtk\n  |-- awtk-linux-fb\n```\n\n#### 2. 使用 Direct Rendering Manager (DRM)\n\n缺省使用 framebuffer，如果使用 DRM，请修改 awtk_config_define.py，指定 LCD_DEVICES 和 drm 的路径。\n\n```\nLCD_DEVICES = 'drm'\n```\n\u003e DRM 目前只在虚拟机中测试过，如果有问题请参考 awtk-port/lcd\\_linux\\_drm.c 进行调试。\n\n#### 3. 使用 EGL 硬件加速\n\n缺省使用 framebuffer，如果使用 EGL，请参考文档 [how_to_use_egl.md](docs/how_to_use_egl.md)。\n\n#### 4. 上传文件到开发板的方法\n\n如果开发板支持 ssh，可以使用 scp 命令上传文件或文件夹，比如上传文件：\n\n```\n# 开发板ip：192.168.1.136\n# 登录用户名：root\n# 上传文件 release.tar.gz 到 /opt 目录\nscp release.tar.gz root@192.168.1.136:/opt/release.tar.gz\n```\n\n上传文件夹：\n\n```\n# 创建文件夹 ./release 中所有文件到 /opt/awtk 目录\nscp -r ./release root@192.168.1.136:/opt/awtk\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzlgopen%2Fawtk-linux-fb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzlgopen%2Fawtk-linux-fb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzlgopen%2Fawtk-linux-fb/lists"}