NVDA with Japanese branch
リビジョン | 3d1ebac42da58070828e8ff28bce54df32f35116 (tree) |
---|---|
日時 | 2014-03-13 11:18:09 |
作者 | Takuya Nishimoto <nishimotz@gmai...> |
コミッター | Takuya Nishimoto |
reverted t3800 regarding ti33037
@@ -118,55 +118,6 @@ UIAEventIdsToNVDAEventNames={ | ||
118 | 118 | #UIA_ToolTipClosedEventId:"hide", |
119 | 119 | } |
120 | 120 | |
121 | -class MsaaProxyFactory(COMObject): | |
122 | - """Overrides the default MSAA proxy so it only handles windows for which NVDA uses UIA. | |
123 | - Generally, the MSAA proxy isn't needed, as NVDA uses MSAA directly, | |
124 | - so UIA proxying is redundant. | |
125 | - However, some native UIA implementations depend on the MSAA proxy. | |
126 | - """ | |
127 | - _com_interfaces_ = [IUIAutomationProxyFactoryEntry, IUIAutomationProxyFactory] | |
128 | - | |
129 | - def __init__(self, baseEntry): | |
130 | - self.baseEntry = baseEntry | |
131 | - self.baseFactory = baseEntry.ProxyFactory | |
132 | - super(MsaaProxyFactory, self).__init__() | |
133 | - self.factory = self.QueryInterface(IUIAutomationProxyFactory) | |
134 | - | |
135 | - # Forward most methods. | |
136 | - def IUIAutomationProxyFactoryEntry__get_AllowSubstringMatch(self): | |
137 | - return self.baseEntry.AllowSubstringMatch | |
138 | - def IUIAutomationProxyFactoryEntry__get_CanCheckBaseClass(self): | |
139 | - return self.baseEntry.CanCheckBaseClass | |
140 | - def IUIAutomationProxyFactoryEntry__get_ClassName(self): | |
141 | - return self.baseEntry.ClassName | |
142 | - def IUIAutomationProxyFactoryEntry__get_ImageName(self): | |
143 | - return self.baseEntry.ImageName | |
144 | - def IUIAutomationProxyFactoryEntry__get_NeedsAdviseEvents(self): | |
145 | - return self.baseEntry.NeedsAdviseEvents | |
146 | - | |
147 | - def IUIAutomationProxyFactoryEntry_GetWinEventsForAutomationEvent(self, eventId, propertyId): | |
148 | - try: | |
149 | - return self.baseEntry.GetWinEventsForAutomationEvent(eventId, propertyId) | |
150 | - except IndexError: | |
151 | - # comtypes can't seem to handle a NULL safearray pointer. | |
152 | - return () | |
153 | - | |
154 | - def IUIAutomationProxyFactoryEntry__get_ProxyFactory(self): | |
155 | - return self.factory | |
156 | - | |
157 | - def IUIAutomationProxyFactory__get_ProxyFactoryId(self): | |
158 | - return u"NVDA: MSAA Proxy" | |
159 | - | |
160 | - def IUIAutomationProxyFactory_CreateProvider(self, hwnd, idObject, idChild): | |
161 | - from UIAHandler import handler | |
162 | - if not handler: | |
163 | - # Still initialising. | |
164 | - return None | |
165 | - if not handler.isUIAWindow(hwnd): | |
166 | - # NVDA won't use UIA for this window at all, so don't proxy for it. | |
167 | - return None | |
168 | - return self.baseFactory.CreateProvider(hwnd, idObject, idChild) | |
169 | - | |
170 | 121 | class UIAHandler(COMObject): |
171 | 122 | _com_interfaces_=[IUIAutomationEventHandler,IUIAutomationFocusChangedEventHandler,IUIAutomationPropertyChangedEventHandler] |
172 | 123 |
@@ -191,27 +142,10 @@ class UIAHandler(COMObject): | ||
191 | 142 | windll.kernel32.CloseHandle(MTAThreadHandle) |
192 | 143 | del self.MTAThread |
193 | 144 | |
194 | - def setUIAProxies(self): | |
195 | - neededProxyIDs={'Microsoft: TreeView Proxy'} | |
196 | - mapping=self.clientObject.proxyFactoryMapping | |
197 | - msaaEntry = None | |
198 | - for index in reversed(xrange(mapping.count)): | |
199 | - entry=mapping.getEntry(index) | |
200 | - pfId = entry.proxyFactory.proxyFactoryId | |
201 | - if pfId=="Microsoft: MSAA Proxy": | |
202 | - msaaEntry = entry | |
203 | - if pfId not in neededProxyIDs: | |
204 | - mapping.removeEntry(index) | |
205 | - | |
206 | - if not msaaEntry: | |
207 | - return | |
208 | - mapping.InsertEntry(mapping.Count, MsaaProxyFactory(msaaEntry)) | |
209 | - | |
210 | 145 | def MTAThreadFunc(self): |
211 | 146 | try: |
212 | 147 | oledll.ole32.CoInitializeEx(None,comtypes.COINIT_MULTITHREADED) |
213 | 148 | self.clientObject=CoCreateInstance(CUIAutomation._reg_clsid_,interface=IUIAutomation,clsctx=CLSCTX_INPROC_SERVER) |
214 | - self.setUIAProxies() | |
215 | 149 | self.windowTreeWalker=self.clientObject.createTreeWalker(self.clientObject.CreateNotCondition(self.clientObject.CreatePropertyCondition(UIA_NativeWindowHandlePropertyId,0))) |
216 | 150 | self.windowCacheRequest=self.clientObject.CreateCacheRequest() |
217 | 151 | self.windowCacheRequest.AddProperty(UIA_NativeWindowHandlePropertyId) |