feat(factory): 内容工厂与链接处理

- 第三栏内容工厂:按拖入类型展示动作,动作按钮本身可接收 drop
- 链接分类:http(s) 按扩展名判定图片/音视频/文档/压缩包/网页
- http 链接动作:打开、下载、另存为、复制、Markdown、复制文件名、待办、问小埃
- 非标准 scheme:尝试打开、复制;thunder 解析 base64 真实地址,magnet 解析 dn
- 文字动作:ICU 分词、正则提取链接、朗读(spd-say)、复制、待办
- 文件/图片动作:打开、提取文字(占位)、生成描述、保存图片、复制路径、待办
- Downloader:异步下载到 XDG 下载目录 / 另存为,面板 toast 提示
- TodoModel:持久化到 todo.json,供「添加到待办」使用
- 无头自测 gxde-ai-see-selftest:链接分类/分词/提取链接/动作匹配
- 合成器 portal 自测脚本 tests/portal(虚拟指针 + GTK 源/目标)
This commit is contained in:
2026-10-30 20:09:01 +08:00
parent 68d3eb1a24
commit 3a73a8c5d1
26 changed files with 2822 additions and 6 deletions
+20
View File
@@ -15,6 +15,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Network DBus Svg)
find_package(PkgConfig REQUIRED)
pkg_check_modules(DTK2WIDGET REQUIRED dtk2widget)
pkg_check_modules(ICU REQUIRED icu-i18n icu-uc)
find_package(LayerShellQt QUIET)
set(GXDE_AI_SEE_SOURCES
@@ -23,6 +24,13 @@ set(GXDE_AI_SEE_SOURCES
src/config.cpp
src/staging/stagingmodel.cpp
src/portal/portalclient.cpp
src/factory/linktools.cpp
src/factory/contentclassifier.cpp
src/factory/factoryactions.cpp
src/factory/contentfactory.cpp
src/actions/downloader.cpp
src/actions/texttools.cpp
src/todo/todomodel.cpp
src/ui/portalpanel.cpp
)
@@ -31,6 +39,7 @@ add_executable(gxde-ai-see ${GXDE_AI_SEE_SOURCES})
target_include_directories(gxde-ai-see PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${DTK2WIDGET_INCLUDE_DIRS}
${ICU_INCLUDE_DIRS}
)
target_link_libraries(gxde-ai-see PRIVATE
@@ -41,6 +50,7 @@ target_link_libraries(gxde-ai-see PRIVATE
Qt6::DBus
Qt6::Svg
${DTK2WIDGET_LIBRARIES}
${ICU_LIBRARIES}
)
target_link_directories(gxde-ai-see PRIVATE ${DTK2WIDGET_LIBRARY_DIRS})
@@ -50,6 +60,16 @@ if (LayerShellQt_FOUND)
target_compile_definitions(gxde-ai-see PRIVATE GXDE_HAVE_LAYERSHELLQT=1)
endif ()
add_executable(gxde-ai-see-selftest
tests/selftest.cpp
src/factory/linktools.cpp
src/factory/contentclassifier.cpp
src/factory/factoryactions.cpp
src/actions/texttools.cpp
)
target_include_directories(gxde-ai-see-selftest PRIVATE src ${ICU_INCLUDE_DIRS})
target_link_libraries(gxde-ai-see-selftest PRIVATE Qt6::Core Qt6::Gui ${ICU_LIBRARIES})
install(TARGETS gxde-ai-see RUNTIME DESTINATION bin)
install(FILES data/gxde-ai-see.desktop DESTINATION share/applications)
install(DIRECTORY data/icons/ DESTINATION share/icons/hicolor)