~stomato463/+junk/nvdajp

« back to all changes in this revision

Viewing changes to source/virtualBuffers/adobeAcrobat.py

  • Committer: Masataka Shinke
  • Date: 2011-10-25 12:35:26 UTC
  • mfrom: (4185 jpmain)
  • mto: This revision was merged to the branch mainline in revision 4211.
  • Revision ID: mshinke@users.sourceforge.jp-20111025123526-ze527a2rl3z0g2ky
lp:~nishimotz/nvdajp/main : 4185 をマージ

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
import oleacc
8
8
from logHandler import log
9
9
import textInfos
 
10
import languageHandler
10
11
 
11
12
class AdobeAcrobat_TextInfo(VirtualBufferTextInfo):
12
13
 
33
34
                        attrs["level"] = level
34
35
                return super(AdobeAcrobat_TextInfo, self)._normalizeControlField(attrs)
35
36
 
 
37
        def _normalizeFormatField(self, attrs):
 
38
                try:
 
39
                        attrs["language"] = languageHandler.normalizeLanguage(attrs["language"])
 
40
                except KeyError:
 
41
                        pass
 
42
                return attrs
 
43
 
36
44
class AdobeAcrobat(VirtualBuffer):
37
45
        TextInfo = AdobeAcrobat_TextInfo
38
46
        programmaticScrollMayFireEvent = True
40
48
        def __init__(self,rootNVDAObject):
41
49
                super(AdobeAcrobat,self).__init__(rootNVDAObject,backendName="adobeAcrobat")
42
50
 
43
 
        def isNVDAObjectInVirtualBuffer(self,obj):
 
51
        def __contains__(self,obj):
44
52
                return winUser.isDescendantWindow(self.rootNVDAObject.windowHandle, obj.windowHandle)
45
53
 
46
 
        def isAlive(self):
 
54
        def _get_isAlive(self):
 
55
                if self.isLoading:
 
56
                        return True
47
57
                root=self.rootNVDAObject
48
58
                if not root:
49
59
                        return False
55
65
                return NVDAObjects.IAccessible.getNVDAObjectFromEvent(docHandle, winUser.OBJID_CLIENT, ID)
56
66
 
57
67
        def getIdentifierFromNVDAObject(self,obj):
58
 
                return obj.windowHandle, obj.event_objectID if obj.event_objectID > 0 else obj.event_childID
 
68
                return obj.windowHandle, obj.accID
59
69
 
60
70
        def _searchableAttribsForNodeType(self,nodeType):
61
71
                if nodeType in ("link", "unvisitedLink"):
84
94
                        attrs = {"acrobat::stdname": ["BlockQuote"]}
85
95
                elif nodeType=="focusable":
86
96
                        attrs={"IAccessible::state_%s"%oleacc.STATE_SYSTEM_FOCUSABLE:[1]}
 
97
                elif nodeType=="graphic":
 
98
                        attrs={"IAccessible::role":[oleacc.ROLE_SYSTEM_GRAPHIC]}
 
99
                elif nodeType=="comboBox":
 
100
                        attrs={"IAccessible::role":[oleacc.ROLE_SYSTEM_COMBOBOX]}
87
101
                else:
88
102
                        return None
89
103
                return attrs