Add plugin system for runtime-loaded framework providers#3
Merged
Conversation
eca7e6b to
cdae23c
Compare
Add a generic plugin architecture that allows external DLLs to extend lvt with additional UI framework support. Plugins are discovered at startup from %USERPROFILE%/.lvt/plugins/ and loaded dynamically via a C ABI. Core changes: - src/plugin.h: C ABI plugin interface with versioning (LvtPluginInfo, LvtFrameworkDetection, LvtEnrichTreeFn, etc.) - src/plugin_loader.h/cpp: Plugin discovery, loading, framework detection delegation, and JSON-based tree grafting. Plugins return JSON tree data which is grafted into the Win32 element tree by matching target_hwnd. - framework_detector.h/cpp: Added Framework::Plugin enum value with string name field. Plugin-detected frameworks are appended after built-in ones. - tree_builder.cpp: Calls enrich_with_plugin() for plugin-detected frameworks. - main.cpp: Plugin load/unload lifecycle, framework_display_name() for output. - CMakeLists.txt: Added plugin_loader.cpp to lvt and test targets. TAP DLL cleanup: - WPF TAP DLL now calls FreeLibraryAndExitThread to unload itself after collection, matching the convention for all injected DLLs. Removed the MonitorThread/trigger event mechanism (no longer needed since each run is a fresh injection). Tests: - 8 new PluginGraft tests: HWND matching, root fallback, multiple roots, nested children, properties, invalid JSON, deep matching. - 3 new FrameworkDisplayName tests. - All 44 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cdae23c to
26854c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a generic plugin architecture that allows external DLLs to extend lvt with additional UI framework support.
What this does
Plugins are DLLs placed in %USERPROFILE%/.lvt/plugins/\ and discovered at startup. Each plugin exports C ABI functions to detect frameworks and enrich the element tree with additional subtrees.
Core changes
Plugin contract
Plugins export:
JSON tree roots specify a \ arget_hwnd\ field to indicate which existing Win32 element to graft under.
Tests
11 new tests (44 total, all passing):