+
     i  c                  s    ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ^ RIHtHt ^ R	IHtHtHt ^ R
IHt  ! R R]4      t ! R R]4      tR# )    )annotations)Optional)Gtk)FlowBoxEntryFlowBoxWrapper)ICON_PRIORITIES
ICON_NAMES)Stack)
Controller)MessageBrokerMessageType)
GroupsData	GroupDataDoStackSwitch)loggerc                  s<   a  ] tR t^*tRtR tR V 3R lltR tRtV ;t	# )DeviceGroupEntryzNA device that can be selected in the GUI.

For example a keyboard or a mouse.
c               s(    V ^8  d   QhRRRRRRRR/# )	   message_brokerr
   
controllerr	   	icon_namezOptional[str]	group_keyZstr Zformat   "O/usr/lib/python3.14/site-packages/inputremapper/gui/components/device_groups.py__annotate__ZDeviceGroupEntry.__annotate__2   s2     # #%# # !	#
 #    c                	s:   < \         SV `  VVVVR 7       W@n        R# ))r   r   r   ZnameN)super__init__r   )selfr   r   r   r   	__class__s   &&&&&r   r   ZDeviceGroupEntry.__init__2   s*     	)!	 	 	
 #r   c                	s    \         P                  ! R V P                  4       V P                  P	                  V P                  4       V P
                  P                  \        \        P                  4      4       R# )zSelecting device "%s"N)
r   debugr   _controllerZ
load_groupr   Zpublishr   r   Zpresets_page)r   Z_Z__s   &*,r   _on_gtk_toggleZDeviceGroupEntry._on_gtk_toggleA   sL    ,dnn=##DNN3##M%2D2D$EFr   )r   )
__name__
__module____qualname____firstlineno____doc__Z__gtype_name__r   r"   __static_attributes____classcell__r      @r   r   r   *   s%    
 (N# #G Gr   r   c                  sJ   a  ] tR t^GtRtR V 3R lltR R ltR R ltRtV ;t	# )	DeviceGroupSelectionzRA wrapper for the container with our groups.

A group is a collection of devices.
c               s$    V ^8  d   QhRRRRRR/# )r   r   r
   r   r	   flowboxzGtk.FlowBoxr   r   r   r   r   !DeviceGroupSelection.__annotate__M   s-     R R%R R 	Rr   c                	s  < \         SV `  V4       Wn        W n        W0n        V P                  P                  \        P                  V P                  4       V P                  P                  \        P                  V P                  4       R # N)r   r   _message_brokerr!   _guiZ	subscriber   groups_on_groups_changedZgroup_on_group_changed)r   r   r   r-   r   s   &&&&r   r   ZDeviceGroupSelection.__init__M   sg     	!-%	&&{'9'94;R;RS&&{'8'8$:P:PQr   c                   V ^8  d   QhRR/# )r   datar   r   r   r   r   r   r.   \   s     S Sz Sr   c                	s   V P                   P                  V P                   P                  4       VP                  P	                  4        F  w  r#\        V4      ^ 8  d1   \        V\        P                  R7      ^ ,          p\        V,          pMRp\        P                  ! RV4       \        V P                  V P                  VV4      pV P                   P                  VR4       K  	  V P                  P                   P"                  '       d<   V P%                  V P                  P                   P"                  P&                  4       R# R# )r    )keyNzadding %s to device selectioni)r1   ZforeachZremover2   ZitemsZlenZsortedr   Zindexr   r   r    r   r0   r!   ZinsertZdata_managerZactive_groupshow_active_entryr7   )r   r6   r   ZtypesZdevice_typer   Zdevice_group_entrys   &&     r   r3   Z'DeviceGroupSelection._on_groups_changed\   s    		$))**+ $ 1 1 3I5zA~$U0E0EFqI&{3	 	LL8)D!1$$  	" II/4 !4  ((555""4#3#3#@#@#M#M#Q#QR 6r   c               r5   )r   r6   r   r   r   r   r   r   r.   r   s     / /i /r   c                	s<    V P                  VP                  4       R # r/   )r8   r   )r   r6   s   &&r   r4   Z&DeviceGroupSelection._on_group_changedr   s    t~~.r   )r!   r1   r0   )
r#   r$   r%   r&   r'   r   r3   r4   r(   r)   r*   r+   r   r,   r,   G   s$    
R RS,/ /r   r,   N)Z
__future__r   Ztypingr   Zgi.repositoryr   Z#inputremapper.gui.components.commonr   r   Z#inputremapper.gui.components.editorr   r   Z!inputremapper.gui.components.mainr   Zinputremapper.gui.controllerr	   Z)inputremapper.gui.messages.message_brokerr
   r   Z'inputremapper.gui.messages.message_datar   r   r   Zinputremapper.logging.loggerr   r   r,   r   r   r   <module>r9      sJ   ( #   L K 3 3 
 0G| G:,/> ,/r   