feat(sdk): migrate editing context API to kcsdk (#351) #359

Merged
forbes merged 2 commits from feat/kcsdk-scaffold into main 2026-02-28 18:50:57 +00:00
Owner

Summary

Migrates the editing context/overlay registration API through the KCSDK C++ library and kcsdk pybind11 module.

Closes #351 (Phase 2 of KCSDK epic #346).

Changes

New files:

  • src/Gui/SDK/Types.hContextDef, OverlayDef, ContextSnapshot structs (plain C++, no Qt in public API)

Modified:

  • src/Gui/SDK/SDKRegistry.h/.cppregisterContext(), unregisterContext(), registerOverlay(), unregisterOverlay(), injectCommands(), currentContext(), refresh() — all delegate to EditingContextResolver with std↔Qt conversion
  • src/Gui/SDK/CMakeLists.txt — Add Types.h, link FreeCADGui
  • src/Gui/SDK/bindings/kcsdk_py.cpp — Bind all context functions with GIL-safe match callable wrapping and dict-based snapshot return
  • mods/sdk/kindred_sdk/context.py — Try kcsdk first, fall back to FreeCADGui for backwards compatibility

API surface

import kcsdk
kcsdk.register_context(id, label, color, toolbars, match, priority=50)
kcsdk.unregister_context(id)
kcsdk.register_overlay(id, toolbars, match)
kcsdk.unregister_overlay(id)
kcsdk.inject_commands(context_id, toolbar_name, commands)
kcsdk.current_context()   # -> dict or None
kcsdk.refresh()

Next steps

Issue #352 will add the panel provider system (IPanelProvider).

## Summary Migrates the editing context/overlay registration API through the KCSDK C++ library and `kcsdk` pybind11 module. Closes #351 (Phase 2 of KCSDK epic #346). ## Changes **New files:** - `src/Gui/SDK/Types.h` — `ContextDef`, `OverlayDef`, `ContextSnapshot` structs (plain C++, no Qt in public API) **Modified:** - `src/Gui/SDK/SDKRegistry.h/.cpp` — `registerContext()`, `unregisterContext()`, `registerOverlay()`, `unregisterOverlay()`, `injectCommands()`, `currentContext()`, `refresh()` — all delegate to `EditingContextResolver` with std↔Qt conversion - `src/Gui/SDK/CMakeLists.txt` — Add `Types.h`, link `FreeCADGui` - `src/Gui/SDK/bindings/kcsdk_py.cpp` — Bind all context functions with GIL-safe match callable wrapping and dict-based snapshot return - `mods/sdk/kindred_sdk/context.py` — Try `kcsdk` first, fall back to `FreeCADGui` for backwards compatibility ## API surface ```python import kcsdk kcsdk.register_context(id, label, color, toolbars, match, priority=50) kcsdk.unregister_context(id) kcsdk.register_overlay(id, toolbars, match) kcsdk.unregister_overlay(id) kcsdk.inject_commands(context_id, toolbar_name, commands) kcsdk.current_context() # -> dict or None kcsdk.refresh() ``` ## Next steps Issue #352 will add the panel provider system (IPanelProvider).
forbes added the enhancement label 2026-02-27 20:05:43 +00:00
forbes added 1 commit 2026-02-27 20:05:44 +00:00
feat(sdk): migrate editing context API to kcsdk (#351)
All checks were successful
Build and Test / build (pull_request) Successful in 29m14s
f44aba7388
Add context/overlay registration, injection, query, and refresh to the
KCSDK C++ library and kcsdk pybind11 module.

New files:
- src/Gui/SDK/Types.h — ContextDef, OverlayDef, ContextSnapshot structs
  (plain C++, no Qt in public API)

Modified:
- src/Gui/SDK/SDKRegistry.h/.cpp — register_context/overlay, unregister,
  inject_commands, current_context, refresh (delegates to
  EditingContextResolver with std↔Qt conversion)
- src/Gui/SDK/CMakeLists.txt — add Types.h, link FreeCADGui
- src/Gui/SDK/bindings/kcsdk_py.cpp — bind all context functions with
  GIL-safe match callable wrapping and dict-based snapshot return
- mods/sdk/kindred_sdk/context.py — try kcsdk first, fall back to
  FreeCADGui for backwards compatibility
forbes added 2 commits 2026-02-28 18:50:48 +00:00
Merge pull request 'feat(sdk): scaffold KCSDK library + kcsdk pybind11 module (#350)' (#358) from feat/kcsdk-scaffold into main
All checks were successful
Sync Silo Server Docs / sync (push) Successful in 1m3s
Build and Test / build (push) Successful in 29m51s
169c177b69
Reviewed-on: #358
Merge branch 'main' into feat/kcsdk-scaffold
All checks were successful
Build and Test / build (pull_request) Successful in 30m14s
81a2e75477
forbes merged commit 9fc0d064f8 into main 2026-02-28 18:50:57 +00:00
forbes deleted branch feat/kcsdk-scaffold 2026-02-28 18:50:57 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#359