Skip to content

Commit

Permalink
Revert the change to how NVDA uses comtypes (r1125) because although …
Browse files Browse the repository at this point in the history
…it did allow NVDA to work with comtypes 0.3.2 when running from source, comtypes 0.3.2 has problems when compiled with py2exe 0.6.5/0.6.6. NVDA from now on can only really use comtypes 0.2.1, unless we get parts of comtypes re-written to properly handle movement of the gen module.
  • Loading branch information
mdcurran committed Aug 17, 2007
1 parent cdd84c3 commit 8c6371d
Show file tree
Hide file tree
Showing 16 changed files with 599 additions and 56 deletions.
6 changes: 3 additions & 3 deletions source/IA2Handler.py
Expand Up @@ -4,15 +4,15 @@
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

import comtypes.client
import comtypesClient
import ctypes
import api
import eventHandler
import speech
import NVDAObjects.IAccessible

IServiceProvider=comtypes.client.GetModule('lib/ServProv.tlb').IServiceProvider
IA2Lib=comtypes.client.GetModule('lib/ia2.tlb')
IServiceProvider=comtypesClient.GetModule('lib/ServProv.tlb').IServiceProvider
IA2Lib=comtypesClient.GetModule('lib/ia2.tlb')

TEXT_BOUNDARY_CHAR=0
TEXT_BOUNDARY_WORD=1
Expand Down
16 changes: 8 additions & 8 deletions source/IAccessibleHandler.py
Expand Up @@ -146,7 +146,7 @@

import tones
import ctypes
import comtypes.client
import comtypesClient
import comtypes.automation
import debug
import JABHandler
Expand All @@ -168,7 +168,7 @@
lastEventParams=None

#Load IAccessible from oleacc.dll
IAccessible=comtypes.client.GetModule('oleacc.dll').IAccessible
IAccessible=comtypesClient.GetModule('oleacc.dll').IAccessible
pointer_IAccessible=ctypes.POINTER(IAccessible)
oleAcc=ctypes.windll.oleacc

Expand Down Expand Up @@ -257,7 +257,7 @@ def accessibleChildren(ia,startIndex,numChildren):
for childNum in xrange(len(children)):
if isinstance(children[childNum],pointer_IAccessible):
children[childNum]=(children[childNum],0)
elif isinstance(children[childNum],comtypes.client.dynamic._Dispatch):
elif isinstance(children[childNum],comtypesClient._Dispatch):
children[childNum]=(children[childNum].QueryInterface(IAccessible),0)
elif isinstance(children[childNum],int):
children[childNum]=(ia,children[childNum])
Expand Down Expand Up @@ -342,7 +342,7 @@ def accFocus(ia):
if isinstance(res,pointer_IAccessible):
new_ia=res
new_child=0
elif isinstance(res,comtypes.client.dynamic._Dispatch):
elif isinstance(res,comtypesClient._Dispatch):
new_ia=res.QueryInterface(IAccessible)
new_child=0
elif isinstance(res,int):
Expand All @@ -361,7 +361,7 @@ def accHitTest(ia,child,x,y):
if isinstance(res,pointer_IAccessible):
new_ia=res
new_child=0
elif isinstance(res,comtypes.client.dynamic._Dispatch):
elif isinstance(res,comtypesClient._Dispatch):
new_ia=res.QueryInterface(IAccessible)
new_child=0
elif isinstance(res,int) and res!=child:
Expand All @@ -380,7 +380,7 @@ def accChild(ia,child):
if isinstance(res,pointer_IAccessible):
new_ia=res
new_child=0
elif isinstance(res,comtypes.client.dynamic._Dispatch):
elif isinstance(res,comtypesClient._Dispatch):
new_ia=res.QueryInterface(IAccessible)
new_child=0
elif isinstance(res,int):
Expand All @@ -404,7 +404,7 @@ def accParent(ia,child):
if isinstance(res,pointer_IAccessible):
new_ia=res
new_child=0
elif isinstance(res,comtypes.client.dynamic._Dispatch):
elif isinstance(res,comtypesClient._Dispatch):
new_ia=res.QueryInterface(IAccessible)
new_child=0
elif isinstance(res,int):
Expand All @@ -427,7 +427,7 @@ def accNavigate(ia,child,direction):
elif isinstance(res,int):
new_ia=ia
new_child=res
elif isinstance(res,comtypes.client.dynamic._Dispatch):
elif isinstance(res,comtypesClient._Dispatch):
new_ia=res.QueryInterface(IAccessible)
new_child=0
else:
Expand Down
2 changes: 1 addition & 1 deletion source/NVDAObjects/IAccessible/IA2/__init__.py
Expand Up @@ -112,7 +112,7 @@ class IA2(IAccessible):

def __init__(self,windowHandle=None,IAccessibleObject=None,IAccessibleChildID=None,IAccessibleOrigChildID=None,IAccessibleObjectID=None):
if not windowHandle:
windowHandle=IAccessibleObject.WindowHandle
pass #windowHandle=IAccessibleObject.WindowHandle
IAccessible.__init__(self,windowHandle=windowHandle,IAccessibleObject=IAccessibleObject,IAccessibleChildID=IAccessibleChildID,IAccessibleOrigChildID=IAccessibleOrigChildID,IAccessibleObjectID=IAccessibleObjectID)
try:
self.IAccessibleTextObject=IAccessibleObject.QueryInterface(IA2Handler.IA2Lib.IAccessibleText)
Expand Down
4 changes: 2 additions & 2 deletions source/NVDAObjects/IAccessible/MSHTML.py
Expand Up @@ -6,7 +6,7 @@

import time
import ctypes
import comtypes.client
import comtypesClient
import comtypes.automation
import pythoncom
import win32com.client
Expand All @@ -23,7 +23,7 @@
lastMSHTMLEditGainFocusTimeStamp=0


IServiceProvider=comtypes.client.GetModule('lib/Servprov.tlb').IServiceProvider
IServiceProvider=comtypesClient.GetModule('lib/Servprov.tlb').IServiceProvider

IID_IHTMLElement=comtypes.GUID('{3050F1FF-98B5-11CF-BB82-00AA00BDCE0B}')
IID_DispHTMLGenericElement=comtypes.GUID('{3050F563-98B5-11CF-BB82-00AA00BDCE0B}')
Expand Down
2 changes: 1 addition & 1 deletion source/NVDAObjects/IAccessible/__init__.py
Expand Up @@ -12,7 +12,7 @@
import difflib
import ctypes
import comtypes.automation
import comtypes.client
import comtypesClient
import debug
import appModuleHandler
from keyUtils import sendKey, key
Expand Down
6 changes: 3 additions & 3 deletions source/NVDAObjects/IAccessible/edit.py
Expand Up @@ -5,7 +5,7 @@
#See the file COPYING for more details.

import locale
import comtypes.client
import comtypesClient
import struct
import ctypes
import pythoncom
Expand All @@ -25,7 +25,7 @@
from . import IAccessible
from .. import NVDAObjectTextInfo

IServiceProvider=comtypes.client.GetModule('lib/ServProv.tlb').IServiceProvider
IServiceProvider=comtypesClient.GetModule('lib/ServProv.tlb').IServiceProvider

#Edit control window messages
EM_GETSEL=176
Expand Down Expand Up @@ -150,7 +150,7 @@ class getTextLengthExStruct(ctypes.Structure):
class EditTextInfo(NVDAObjectTextInfo):

def _getTextRangeWithEmbeddedObjects(self,start,end):
ptr=ctypes.POINTER(comtypes.client.GetModule('msftedit.dll').ITextDocument)()
ptr=ctypes.POINTER(comtypesClient.GetModule('msftedit.dll').ITextDocument)()
ctypes.windll.oleacc.AccessibleObjectFromWindow(self.obj.windowHandle,-16,ctypes.byref(ptr._iid_),ctypes.byref(ptr))
r=ptr.Range(self._startOffset,self._endOffset)
bufText=r.text
Expand Down
2 changes: 1 addition & 1 deletion source/NVDAObjects/window.py
Expand Up @@ -29,7 +29,7 @@ class Window(NVDAObject):

def __init__(self,windowHandle=None,windowClassName=None):
if not windowHandle:
raise ValueError("invalid or not specified window handle")
pass #raise ValueError("invalid or not specified window handle")
NVDAObject.__init__(self)
if windowClassName:
self.windowClassName=windowClassName
Expand Down
2 changes: 1 addition & 1 deletion source/appModules/_default.py
Expand Up @@ -5,7 +5,7 @@
#See the file COPYING for more details.

import gc
import comtypes.client
import comtypesClient
import datetime
import time
import tones
Expand Down
Empty file.

0 comments on commit 8c6371d

Please sign in to comment.