Ported over Orca d-bus remote improvements.

This commit is contained in:
Storm Dragon
2025-09-16 22:44:29 -04:00
parent 928bae6d86
commit 10d94792ed
11 changed files with 1505 additions and 19 deletions

View File

@@ -791,29 +791,32 @@ busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service org.
- 🔄 **Module registration**: Ready for individual managers to register D-Bus commands
- 🔄 **Plugin integration**: Plugins can expose D-Bus commands using decorators
### **✅ COMPLETED - D-Bus Remote Controller Integration**
The D-Bus Remote Controller from Orca v49.alpha has been successfully integrated into Cthulhu and is fully functional.
### **✅ COMPLETED - Enhanced D-Bus Remote Controller with Speech and Key Echo Controls**
The D-Bus Remote Controller from Orca v49.alpha has been successfully re-ported and enhanced with comprehensive speech and typing echo controls.
**Root Cause of Issues**: D-Bus service startup timing conflicts with ATSPI registry initialization.
**Latest Enhancement (2025)**:
- **SpeechManager Module**: Complete D-Bus control over speech settings (muting, verbosity, punctuation, capitalization, number pronunciation)
- **TypingEchoManager Module**: Granular key echo controls (character/word/sentence echo, per-key-type settings)
- **No systemd dependency**: Direct session bus registration without service files
- **Real-time effect**: All settings take effect immediately
**Solution Implemented**:
- Deferred D-Bus service startup using `GObject.idle_add()` after ATSPI event loop is running
- Fixed all API naming convention differences between Orca and Cthulhu
**Files Created/Modified for Enhanced D-Bus Integration**:
- `src/cthulhu/speech_and_verbosity_manager.py` - Enhanced with D-Bus getters/setters for all speech settings
- `src/cthulhu/typing_echo_presenter.py` (NEW FILE) - Complete typing echo system with D-Bus controls
- `src/cthulhu/cthulhu.py` - D-Bus service registration for speech and typing echo managers
- `src/cthulhu/meson.build` - Added typing_echo_presenter.py to build
- `README-REMOTE-CONTROLLER.md` - Updated with comprehensive speech and key echo examples
**Files Modified for D-Bus Integration**:
- `src/cthulhu/dbus_service.py` (NEW FILE) - Complete D-Bus service port with Cthulhu API fixes
- `src/cthulhu/input_event.py` - Added RemoteControllerEvent + GDK version fix
- `src/cthulhu/cthulhu.py` - D-Bus integration + lazy BrailleEvent import + settings manager activation + deferred startup
- `src/cthulhu/Makefile.am` - Added dbus_service.py to build
- Multiple presenter files - Converted to lazy initialization pattern
- `src/cthulhu/keybindings.py` - Fixed GDK version requirement
- `README-REMOTE-CONTROLLER.md` (NEW FILE) - Complete documentation with examples
**Available D-Bus Modules**:
- **SpeechManager**: Speech muting, verbosity, punctuation, capitalization, number styles, indentation speech
- **TypingEchoManager**: Master key echo, character/word/sentence echo, per-key-type controls (alphabetic, numeric, punctuation, space, modifier, function, action, navigation, diacritical keys)
- **DefaultScript**: Core Cthulhu commands
**API Fixes Applied**:
- `debug.print_message` → `debug.printMessage`
- `script_manager.get_manager()` → `script_manager.getManager()`
- `get_active_script()` → `cthulhu_state.activeScript`
- `get_default_script()` → `getDefaultScript()`
**D-Bus Interface Design**:
- Service: `org.stormux.Cthulhu.Service`
- Module paths: `/org/stormux/Cthulhu/Service/ModuleName`
- Generic interface: `org.stormux.Cthulhu.Module`
- Methods: `ExecuteRuntimeGetter`, `ExecuteRuntimeSetter`, `ExecuteCommand`
### Bug Fixes Applied
- Fixed circular imports in presenter modules (learn_mode_presenter, notification_presenter, etc.)