-
-
Notifications
You must be signed in to change notification settings - Fork 766
Expand file tree
/
Copy pathia2_sconscript
More file actions
80 lines (70 loc) · 2.66 KB
/
ia2_sconscript
File metadata and controls
80 lines (70 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env python3
###
# This file is a part of the NVDA project.
# URL: http://www.nvda-project.org/
# Copyright (C) 2006-2017 NV Access Limited, Mozilla Corporation.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.0, as published by
# the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# This license can be found at:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
###
import re
Import("env")
# We want a single merged IDL, rather than the separate IDL files in the IA2 source.
RE_IDL_IMPORT = re.compile(r'import "[A-Z].*$', re.M)
def buildMergedIdl(target, source, env):
outFile = open(str(target[0]), "w")
# The first source is a header and should be included unmodified.
inFile = open(str(source[0]), "r")
outFile.write(inFile.read())
outFile.write("\n")
for idl in source[1:]:
# This source should be included with import statements removed.
inFile = open(str(idl), "r")
outFile.write(RE_IDL_IMPORT.sub("", inFile.read()))
outFile.write("\n")
return None
idlDir = env.Dir("#include/ia2/api")
idlFiles = [
# This file contains the header for the merged IDL.
"api_all_headers.idl",
# These files must be ordered based on dependencies.
# The order should not be changed without confirming dependencies first.
"IA2CommonTypes.idl",
"AccessibleRelation.idl",
"AccessibleAction.idl",
"AccessibleRole.idl",
"AccessibleStates.idl",
"Accessible2.idl",
"Accessible2_2.idl",
"AccessibleComponent.idl",
"AccessibleValue.idl",
"AccessibleText.idl",
"AccessibleText2.idl",
"AccessibleEditableText.idl",
"AccessibleHyperlink.idl",
"AccessibleHypertext.idl",
"AccessibleHypertext2.idl",
"AccessibleTable.idl",
"AccessibleTable2.idl",
"AccessibleTableCell.idl",
"AccessibleImage.idl",
"AccessibleEventID.idl",
"AccessibleApplication.idl",
"AccessibleDocument.idl",
"AccessibleTextSelectionContainer.idl",
"IA2TypeLibrary.idl",
]
idlFile = env.Command("ia2.idl", [idlDir.File(idl) for idl in idlFiles], buildMergedIdl)
tlbFile, headerFile, iidSourceFile, proxySourceFile, dlldataSourceFile = env.TypeLibrary(source=idlFile)
proxyDll = env.COMProxyDll(
target="IAccessible2proxy",
source=[iidSourceFile, proxySourceFile, dlldataSourceFile],
# This CLSID must be unique to this dll. A new one can be generated with import comtypes; comtypes.GUID.create_new()
proxyClsid="{62d295fe-2062-4369-a010-4f59b5e32d5e}",
)
Return(["proxyDll", "tlbFile", "headerFile", "iidSourceFile", "proxySourceFile", "dlldataSourceFile"])