
    ?g|V                         d dl Z d dlZ ej                  dd       d dlmZ d dlmZmZmZm	Z	 d dl
 dZdZd	Zd
ZdZdZdZdZdZdZ G d d      Zy)    NGtkz3.0)r   )SidePageGSettingsDependencySwitchDependencyCheckInstallButtonGSettingsSoundFileChooser)*g      ?      ?HighContrastztext-scaling-factorz	gtk-themezgtk-theme-backupz
icon-themezicon-theme-backupthemeztheme-backupc                   N    e Zd ZdZ ed      ZdZd Zd Zd Z	d Z
d Zd	 Zd
 Zy)Moduleaccessibilityz Configure accessibility featuresprefsc                 Z    t        d      }t        t        d      d|||       }|| _        y )Nz-magnifier, talk, access, zoom, keys, contrastAccessibilityzcs-universal-access)module)_r   sidePage)selfcontent_boxkeywordsr   s       A/usr/share/cinnamon/cinnamon-settings/modules/cs_accessibility.py__init__zModule.__init__   s.    DEAo.0ExQ\eij     c                    | j                   st        d       t        j                  d      | _        t        j                  d      | _        t        j                  d      | _        t               | j                  _	        | j                  j                  | j                  j                         t               }| j                  j                  j                  |dt        d             |j                  t        d            }t        t        d	            }| j                  j!                  t"        |j$                  d
t        j&                  j(                  | j*                  | j,                         |j/                  |       t        t        d            }| j                  j!                  t0        |j$                  d
t        j&                  j(                  | j2                  | j4                         |j/                  |       t7        t        d      ddd dgdg      }|j/                  |       d }t9        t        d      |      }|j;                  |dd       |j                  t        d            }t=        t        d      dd      }|j/                  |       t?        t        d      ddd ddd      }|j;                  |dd       dt        d      gddgddgd d gd!d!gg}tA        t        d"      dd#|      }|jC                  t        d$             |j;                  |dd       t=        t        d%      dd&      }|j;                  |dd       d't        d(      gd)t        d*      gd+t        d,      gg}	tA        t        d-      dd.|	      }|j;                  |dd       t=        t        d/      dd0      }|j;                  |dd       t               | _"        | jD                  jG                  tH        jJ                  jL                         d1t        d2      gd3t        d4      gd5t        d6      gg}
tA        t        d7      dd8|
      }| jD                  jO                  |d9       d:t        d;      gd<t        d=      gd>t        d?      gd@t        dA      gdBt        dC      gg}tA        t        dD      ddE|      }| jD                  jO                  |dF       |j;                  | jD                  dd       | j                  j!                  d0| jD                  dGt        j&                  jP                  | jR                  d        | j                  jU                  d0      r| jD                  jW                  d9       n| jD                  jW                  dF       t               }| j                  j                  j                  |dHt        dI             |j                  t        dJ            }t=        t        dK      ddLd       }|j/                  |       dMt        dN      gdOt        dP      gdQt        dR      gdSt        dT      gg}tA        t        dU      dVdW|      }|j;                  |ddL       dXt        dY      gdZt        d[      gg}tA        t        d\      dVd]|      }|j;                  |ddL       d^t        d_      gd`t        da      gdbt        dc      gg}tA        t        dd      dVde|      }|j;                  |ddL       dft        dg      gdht        di      gg}tA        t        dj      dVdk|      }|j;                  |ddL       |j                  t        dl            }t=        t        dm      dndo      }|j/                  |       t=        t        dp      dndq      }|j/                  |       tY        t        dr      dnds      }|j;                  |dndq       tY        t        dt      dndu      }|j;                  |dndq       |j                  t        dv            }t=        t        dw      ddx      }|j/                  |       dyt        dz      gd{t        d|      gg}tA        t        d}      dd~|      }|j;                  |ddx       t=        t        d      dd      }|j/                  |       tY        t        d      dd      }|j;                  |dd       t               }| j                  j                  j                  |dt        d             |j                  t        d            }t=        t        d      dndd       }|j/                  |       t=        t        d      dndd       }|j;                  |dnd       t=        t        d      dndd      }|j;                  |dnd       |j                  t        d            }t=        t        d      dndd       }|j/                  |       t=        t        d      dndd      }|j;                  |dnd       t=        t        d      dndd      }|j;                  |dnd       t=        t        d      dndd      }|j;                  |dnd       t[        t        d      dndt        d      t        d      dddd	      }|j;                  |dnd       |j                  t        d            }t=        t        d      dndd       }|j/                  |       t=        t        d      dndd      }|j;                  |dnd       t[        t        d      dndt        d      t        d      dddd	      }|j;                  |dnd       t               }| j                  j                  j                  |dt        d             |j                  t        d            }t=        t        d      dndd       }|j/                  |       t[        t        d      dndt        d      t        d      dddd	      }|j;                  |dnd       t[        t        d      dndt        d      t        d      dddd	      }|j;                  |dnd       t[        t        d      dndt        d      t        d      dddd	      }|j;                  |dnd       |j                  t        d            }t=        t        d      ddd       }|j/                  |       t[        t        d      ddt        d      t        d      dddd	      }|j;                  |dd       |j                  t        d            }t=        t        d      ddd       }|j/                  |       t[        t        d      ddt        d      t        d      dddd	      }|j;                  |dd       t[        t        dë      ddt        dū      t        dƫ      dddd	      }|j;                  |dd       y y )NzLoading Accessibility modulezorg.cinnamon.desktop.interface)	schema_idz#org.cinnamon.desktop.wm.preferencesz#org.cinnamon.desktop.a11y.magnifiervisualVisualzVisual AidszHigh contrastactivez
Large textzScreen readerz&org.cinnamon.desktop.a11y.applicationszscreen-reader-enabledorcaz
gnome-orcac                 2    t        j                  ddg       y )Nr    z--setup)
subprocessPopen)buttons    r   config_orcaz.Module.on_module_selected.<locals>.config_orcaN   s      &)!45r   zConfigure screen readerzDesktop ZoomzEnable zoomzscreen-magnifier-enabledMagnificationz
mag-factorr	   g      .@g      ?)step Disabledz<Alt>z<Super>z	<Control>z<Shift>zMouse wheel modifierzmouse-button-zoom-modifierzOWhile this modifier is pressed, mouse scrolling will increase or decrease zoom.zScroll at screen edgeszscroll-at-edgescenteredzKeep cursor centeredproportionalzCursor moves with contentspushzCursor pushes contents aroundzMouse tracking modezmouse-trackingz	Lens modez	lens-modesquareSquare
horizontalzHorizontal stripverticalzVertical stripz
Lens shapez
lens-shapeshapezfull-screenzFull screenztop-halfzTop halfzbottom-halfzBottom halfz	left-halfz	Left halfz
right-halfz
Right halfzScreen positionzscreen-positionscreenzvisible-child-namekeyboardKeyboardzVirtual keyboardzEnable the on-screen keyboardzscreen-keyboard-enabledtabletTablettouchTouch	fullscalez
Full scalescanScanningzKeyboard layoutzorg.cinnamon.keyboardzkeyboard-typebottomzAt the bottom of the screentopzAt the top of the screenzKeyboard positionzkeyboard-position   zA quarter of the screen   zA third of the screen   zHalf of the screenzKeyboard sizezkeyboard-size
accessiblez2Show the keyboard any time something expects inputz	on-demandz-Show keyboard only when the user activates itzActivation modezactivation-modezKeyboard indicatorsz)Use visual indicator on Caps and Num Lockz"org.cinnamon.desktop.a11y.keyboardztogglekeys-enable-osdz(Use audio indicator on Caps and Num Lockztogglekeys-enable-beepz Sound to use Caps or Num Lock onztogglekeys-sound-onz!Sound to use Caps or Num Lock offztogglekeys-sound-offz6Event feedback (required for typing assistance alerts)zEnable visual alertszvisual-bellzfullscreen-flashzFlash the entire monitorzframe-flashzFlash the active windowzVisual stylezvisual-bell-typezEnable audio alertszaudible-bellzSound to use for window alertsz
bell-soundtypingzTyping assistancezSticky keysz2Treat a sequence of modifier keys as a combinationzstickykeys-enablez-Disable if two modifiers are pressed togetherzstickykeys-two-key-offz$Alert when a modifier key is pressedzstickykeys-modifier-beepz'org.cinnamon.desktop.sound/event-soundsz	Slow keyszAPut a delay between when a key is pressed and when it is acceptedzslowkeys-enablezAlert when a key is pressedzslowkeys-beep-presszAlert when a key is acceptedzslowkeys-beep-acceptzAlert when a key is rejectedzslowkeys-beep-rejectzAcceptance delayzslowkeys-delayShortLongr   i  
   F)
show_valuezBounce keysz Ignore fast duplicate keypresseszbouncekeys-enablezbouncekeys-beep-rejectzbouncekeys-delayi  mouseMousez
Mouse keysz$Control the pointer using the keypadzmousekeys-enablezInitial delayzmousekeys-init-delayShorterLongeri  zAcceleration timezmousekeys-accel-timezMaximum speedzmousekeys-max-speedSlowerFaster   zSimulated secondary clickz<Trigger a secondary click by holding down the primary buttonzorg.cinnamon.desktop.a11y.mousezsecondary-click-enabledzsecondary-click-timeg      @g?zHover clickz'Trigger a click when the pointer hoverszdwell-click-enabledDelayz
dwell-timeg?zMotion thresholdzdwell-thresholdSmallLarge   ).loadedprintGioSettingsiface_settingswm_settingsmag_settingsSettingsStackr   stack
add_widgetSettingsPage
add_titledr   add_sectionSwitchbind_with_mappingKEY_GTK_THEMEcontent_widgetSettingsBindFlagsDEFAULThi_con_get_mappinghi_con_set_mappingadd_rowKEY_TEXT_SCALING_FACTORlg_text_get_mappinglg_text_set_mappingr   Buttonadd_reveal_rowGSettingsSwitchGSettingsSpinButtonGSettingsComboBoxset_tooltip_text
zoom_stackset_transition_typer   StackTransitionType	CROSSFADE	add_namedGETzoom_stack_getget_booleanset_visible_child_namer   GSettingsRange)r   pagesettingsswitchr%   r$   spinzoom_key_optionswidgetmouse_track_optionslens_shape_optionsscreen_pos_optionskeyboard_type_optionskeyboard_position_optionskeyboard_size_optionsactivation_mode_optionssound_pickervisual_bell_optionssliders                      r   on_module_selectedzModule.on_module_selected"   s    {{01"%,,9Y,"ZD"||6[|\D #7\ ]D"//DMMMM$$T]]%8%89  >DMM**41X;G ''-(89HAo./F11-282G2G252G2G2O2O262I2I262I2I	K
 V$AlO,F112I282G2G252G2G2O2O262J2J262J2J	L
 V$.q/A/W/F/306x0<~?F V$6 A78+FF##F,TVmn ''.(9:H$Q}%57_a{|FV$&q'9;`bnptvy{  GJ  KD##D*RTno!#Qz] 3gw5GT]H^`kmx_y  }F  HQ  |R   S&q)?'@Bg  jF  HX  YF##A&w$xy##F,TVpq$Q'?%@Bgiz{F##F,TVpq$.A6L4M#N$2A6R4S#T$*A6U4V#W#Y 'q)>'?Afhx  {N  OF##F,TVpq$Q{^5Z\ghF##F,TVpq+oDOOO//0G0G0Q0QR#+ak"B#/a8J6K"L#-a8H6I"J"L 'q8]_km  AFOO%%fg6#0a6F"G#-a
m"D#0a6F"G#.an"E#/ao"F	"H 'q):';=bdu  xJ  KFOO%%fh7##DOO5]_yz//04AU030E0E0I0I040C0C04	6   ,,[966w?66x@  >DMM**4Qz]K ''*<(=>H$Q'F%G%M%>%)+F
 V$&.AhK%@&-1W:%>&11\?%C&,1Z=%A%C!
 'q):';=TVeg|}F##F,TVop*2:W8X)Y*/Q7Q5R)S)U%&q)<'=?VXk  nG  HF##F,TVop&'Q/H-I%J&'Q/F-G%H&'+?)@%A%C! 'q'9;RTcez{F##F,TVop(4a8l6m'n(3a8g6h'i'k# 'q):';=TVg  jA  BF##F,TVop ''*?(@AH$Q'R%S%I%<>F V$$Q'Q%R%I%=?F V$4Q7Y5Z5Y5JLL ##L2VXpq4Q7Z5[5Y5KML ##L2VXpq''*b(cdH$Q'=%>%J%24F V$$6A>X<Y#Z$115N3O#P#R 'q'8:_as  vI  JF##F,QS`a$Q'<%=%J%35F V$4Q7W5X5Z5ACL ##L2WYgh  >DMM**41=P;QR ''-(89H$Q'[%\%I%8%)+F
 V$$Q'V%W%I%=%)+F
 ##F,PRef$Q'M%N%I%?%NPF
 ##F,PRef ''+7H$Q'j%k%I%6%)+F
 V$$Q'D%E%I%:%NPF
 ##F,PRcd$Q'E%F%I%;%NPF
 ##F,PRcd$Q'E%F%I%;%NPF
 ##F,PRcd#A&8$9$H$4$%gJ&	$%sB5	BF ##F,PRcd ''-(89H$Q'I%J%I%8%)+F
 V$$Q'E%F%I%=%NPF
 ##F,PRef#A&8$9$H$6$%gJ&	$%sB5	BF ##F,PRef  >DMM**4!G*E '',8H$Q'M%N%I%7%)+F
 V$#Ao$6$H$:$%iL!H+$&bU	DF ##F,PRde#A&9$:$H$:$%iL!H+$&bU	DF ##F,PRde#Ao$6$H$9$%hK8$%sA%	AF ##F,PRde ''*E(FGH$Q'e%f%F%>%)+F
 V$#A&8$9$E$:$%iL!H+$'ce	EF ##F,MOhi ''-(89H$Q'P%Q%F%:%)+F
 V$#AgJ$E$0$%gJ&	$'ce	EF ##F,MOde#A&8$9$E$5$%gJ'
$%r1	@F ##F,MOdey r   c                     d}|rd}|S d}|S )Nr2   r1    )r   	lens_moderets      r   rw   zModule.zoom_stack_get  s"    C 
 C
r   c                     |t         k(  S N)HIGH_CONTRAST_THEME)r   strings     r   re   zModule.hi_con_get_mapping  s    ,,,r   c                 d   d }|rt         }| j                  j                  t              }| j                  j	                  t
        |       | j                  j                  t              }| j                  j	                  t        |       | j                  j	                  t        t                | j                  j                  t              }| j                  j	                  t        |       | j                  j	                  t        t                |S | j                  j                  t
              }| j                  j                  t              }| j                  j	                  t        |       | j                  j                  t              }| j                  j	                  t        |       |S r   )r   rV   
get_stringra   
set_stringKEY_GTK_THEME_BACKUPKEY_ICON_THEMEKEY_ICON_THEME_BACKUPrW   KEY_WM_THEMEKEY_WM_THEME_BACKUP)r   r   r   r   s       r   rf   zModule.hi_con_set_mapping  sC   %C''22=AE**+?G''22>BE**+@%H**>;NO$$//=E''(;UC''6IJ 
 %%001EFC''223HIE**>5A$$//0CDE''e<
r   c                     |t         kD  S r   )DPI_FACTOR_NORMAL)r   factors     r   ri   zModule.lg_text_get_mapping  s    )))r   c                 x    d }|rt         }|S | j                  j                  t              j	                         }|S r   )DPI_FACTOR_LARGErV   get_default_valuerh   
get_double)r   r   r   s      r   rj   zModule.lg_text_set_mapping  s=    "C 
 %%778OP[[]C
r   N)__name__
__module____qualname__namer   commentcategoryr   r   rw   re   rf   ri   rj   r   r   r   r   r      s=    D23GH!
}f~-6*r   r   )r"   girequire_versiongi.repositoryr   SettingsWidgetsr   r   r   r   xapp.GSettingsWidgetsr   r   r   rh   ra   r   r   r   r   r   r   r   r   r   <module>r      sp     	   5%    x x #  ) 0 &- '. ") | |r   