feat(app-binding): lier les presets aux applications
Ajoute la configuration des associations application/preset, le service de suivi du focus, l'intégration GUI et les fichiers d'installation nécessaires. Ajoute les tests unitaires ciblés des bindings, du service de focus, des migrations et des composants GUI associés. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -21,6 +21,7 @@ import re
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, Tuple, Optional, Callable
|
||||
|
||||
from inputremapper.configs.app_binding import AppBinding
|
||||
from inputremapper.configs.input_config import InputCombination
|
||||
from inputremapper.configs.mapping import MappingData
|
||||
from inputremapper.gui.messages.message_types import (
|
||||
@ -124,3 +125,31 @@ class DoStackSwitch:
|
||||
|
||||
message_type = MessageType.do_stack_switch
|
||||
page_index: int
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AppBindingsData:
|
||||
"""Message with the current focus-driven application bindings and service state.
|
||||
|
||||
``backend`` is the name of the focus backend reported by the focus-service
|
||||
(e.g. "xorg", "sway", "hyprland", "wlr-foreign-toplevel"). ``supported`` is
|
||||
False when the service is reachable but reports no usable backend (e.g. on
|
||||
GNOME-Wayland). ``reachable`` is False when the focus-service is not running
|
||||
yet, in which case the backend state is simply unknown.
|
||||
"""
|
||||
|
||||
message_type = MessageType.app_bindings
|
||||
enabled: bool
|
||||
bindings: Tuple[AppBinding, ...]
|
||||
backend: Optional[str] = None
|
||||
supported: bool = False
|
||||
reachable: bool = False
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class FocusAppData:
|
||||
"""Message with the latest focused application, emitted during detection."""
|
||||
|
||||
message_type = MessageType.focused_app
|
||||
app_id: str
|
||||
title: str = ""
|
||||
|
||||
@ -55,6 +55,10 @@ class MessageType(Enum):
|
||||
|
||||
do_stack_switch = "do_stack_switch"
|
||||
|
||||
# focus-driven preset binding (application bindings)
|
||||
app_bindings = "app_bindings"
|
||||
focused_app = "focused_app"
|
||||
|
||||
# for unit tests:
|
||||
test1 = "test1"
|
||||
test2 = "test2"
|
||||
|
||||
Reference in New Issue
Block a user