Skip to content

Commit 9154a6f

Browse files
committed
New architecture stub
1 parent 95c6d2a commit 9154a6f

File tree

138 files changed

+7470
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+7470
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/__pycache__/**

documentation/api.graphml

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
3+
<!--Created by yEd 3.15.0.2-->
4+
<key attr.name="Description" attr.type="string" for="graph" id="d0"/>
5+
<key for="port" id="d1" yfiles.type="portgraphics"/>
6+
<key for="port" id="d2" yfiles.type="portgeometry"/>
7+
<key for="port" id="d3" yfiles.type="portuserdata"/>
8+
<key attr.name="url" attr.type="string" for="node" id="d4"/>
9+
<key attr.name="description" attr.type="string" for="node" id="d5"/>
10+
<key for="node" id="d6" yfiles.type="nodegraphics"/>
11+
<key for="graphml" id="d7" yfiles.type="resources"/>
12+
<key attr.name="url" attr.type="string" for="edge" id="d8"/>
13+
<key attr.name="description" attr.type="string" for="edge" id="d9"/>
14+
<key for="edge" id="d10" yfiles.type="edgegraphics"/>
15+
<graph edgedefault="directed" id="G">
16+
<data key="d0"/>
17+
<node id="n0">
18+
<data key="d4"/>
19+
<data key="d5"/>
20+
<data key="d6">
21+
<y:UMLClassNode>
22+
<y:Geometry height="28.0" width="100.0" x="456.0" y="287.0"/>
23+
<y:Fill hasColor="false" transparent="false"/>
24+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
25+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="28.42578125" x="35.787109375" y="3.0">API<y:LabelModel>
26+
<y:SmartNodeLabelModel distance="4.0"/>
27+
</y:LabelModel>
28+
<y:ModelParameter>
29+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
30+
</y:ModelParameter>
31+
</y:NodeLabel>
32+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
33+
<y:AttributeLabel/>
34+
<y:MethodLabel/>
35+
</y:UML>
36+
</y:UMLClassNode>
37+
</data>
38+
</node>
39+
<node id="n1">
40+
<data key="d4"/>
41+
<data key="d5"/>
42+
<data key="d6">
43+
<y:UMLClassNode>
44+
<y:Geometry height="28.0" width="100.0" x="687.0" y="287.0"/>
45+
<y:Fill hasColor="false" transparent="false"/>
46+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
47+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="61.1669921875" x="19.41650390625" y="3.0">Feature<y:LabelModel>
48+
<y:SmartNodeLabelModel distance="4.0"/>
49+
</y:LabelModel>
50+
<y:ModelParameter>
51+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
52+
</y:ModelParameter>
53+
</y:NodeLabel>
54+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
55+
<y:AttributeLabel/>
56+
<y:MethodLabel/>
57+
</y:UML>
58+
</y:UMLClassNode>
59+
</data>
60+
</node>
61+
<node id="n2">
62+
<data key="d4"/>
63+
<data key="d5"/>
64+
<data key="d6">
65+
<y:UMLClassNode>
66+
<y:Geometry height="28.0" width="100.0" x="578.0" y="395.0"/>
67+
<y:Fill hasColor="false" transparent="false"/>
68+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
69+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="83.66943359375" x="8.165283203125" y="3.0">Extensions<y:LabelModel>
70+
<y:SmartNodeLabelModel distance="4.0"/>
71+
</y:LabelModel>
72+
<y:ModelParameter>
73+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
74+
</y:ModelParameter>
75+
</y:NodeLabel>
76+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
77+
<y:AttributeLabel/>
78+
<y:MethodLabel/>
79+
</y:UML>
80+
</y:UMLClassNode>
81+
</data>
82+
</node>
83+
<node id="n3">
84+
<data key="d4"/>
85+
<data key="d5"/>
86+
<data key="d6">
87+
<y:UMLClassNode>
88+
<y:Geometry height="28.0" width="100.0" x="456.0" y="494.0"/>
89+
<y:Fill hasColor="false" transparent="false"/>
90+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
91+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="39.46435546875" x="30.267822265625" y="3.0">Type<y:LabelModel>
92+
<y:SmartNodeLabelModel distance="4.0"/>
93+
</y:LabelModel>
94+
<y:ModelParameter>
95+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
96+
</y:ModelParameter>
97+
</y:NodeLabel>
98+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
99+
<y:AttributeLabel/>
100+
<y:MethodLabel/>
101+
</y:UML>
102+
</y:UMLClassNode>
103+
</data>
104+
</node>
105+
<node id="n4">
106+
<data key="d4"/>
107+
<data key="d5"/>
108+
<data key="d6">
109+
<y:UMLClassNode>
110+
<y:Geometry height="28.0" width="100.0" x="278.0" y="406.0"/>
111+
<y:Fill hasColor="false" transparent="false"/>
112+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
113+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="76.896484375" x="11.5517578125" y="3.0">Command<y:LabelModel>
114+
<y:SmartNodeLabelModel distance="4.0"/>
115+
</y:LabelModel>
116+
<y:ModelParameter>
117+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
118+
</y:ModelParameter>
119+
</y:NodeLabel>
120+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
121+
<y:AttributeLabel/>
122+
<y:MethodLabel/>
123+
</y:UML>
124+
</y:UMLClassNode>
125+
</data>
126+
</node>
127+
<node id="n5">
128+
<data key="d4"/>
129+
<data key="d5"/>
130+
<data key="d6">
131+
<y:UMLClassNode>
132+
<y:Geometry height="28.0" width="100.0" x="278.0" y="547.0"/>
133+
<y:Fill hasColor="false" transparent="false"/>
134+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
135+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="81.2890625" x="9.35546875" y="3.0">Parameter<y:LabelModel>
136+
<y:SmartNodeLabelModel distance="4.0"/>
137+
</y:LabelModel>
138+
<y:ModelParameter>
139+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
140+
</y:ModelParameter>
141+
</y:NodeLabel>
142+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
143+
<y:AttributeLabel/>
144+
<y:MethodLabel/>
145+
</y:UML>
146+
</y:UMLClassNode>
147+
</data>
148+
</node>
149+
<node id="n6">
150+
<data key="d4"/>
151+
<data key="d5"/>
152+
<data key="d6">
153+
<y:UMLClassNode>
154+
<y:Geometry height="28.0" width="100.0" x="456.0" y="587.0"/>
155+
<y:Fill hasColor="false" transparent="false"/>
156+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
157+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="96.68212890625" x="1.658935546875" y="3.0">NamedValue<y:LabelModel>
158+
<y:SmartNodeLabelModel distance="4.0"/>
159+
</y:LabelModel>
160+
<y:ModelParameter>
161+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
162+
</y:ModelParameter>
163+
</y:NodeLabel>
164+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
165+
<y:AttributeLabel/>
166+
<y:MethodLabel/>
167+
</y:UML>
168+
</y:UMLClassNode>
169+
</data>
170+
</node>
171+
<node id="n7">
172+
<data key="d4"/>
173+
<data key="d5"/>
174+
<data key="d6">
175+
<y:UMLClassNode>
176+
<y:Geometry height="28.0" width="100.0" x="633.0" y="537.0"/>
177+
<y:Fill hasColor="false" transparent="false"/>
178+
<y:BorderStyle color="#000000" type="line" width="1.0"/>
179+
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" modelName="custom" textColor="#000000" visible="true" width="89.9345703125" x="5.03271484375" y="3.0">ValueGroup<y:LabelModel>
180+
<y:SmartNodeLabelModel distance="4.0"/>
181+
</y:LabelModel>
182+
<y:ModelParameter>
183+
<y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="-0.03703090122767855" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
184+
</y:ModelParameter>
185+
</y:NodeLabel>
186+
<y:UML clipContent="true" constraint="" omitDetails="false" stereotype="" use3DEffect="false">
187+
<y:AttributeLabel/>
188+
<y:MethodLabel/>
189+
</y:UML>
190+
</y:UMLClassNode>
191+
</data>
192+
</node>
193+
</graph>
194+
<data key="d7">
195+
<y:Resources/>
196+
</data>
197+
</graphml>

generate.py

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/python
2+
3+
import os, sys, getopt, json
4+
5+
from khrparser.ParserDetector import ParserDetector
6+
from khrparser.Profile import Profile
7+
8+
from khrparser.gl.GLParser import GLParser
9+
from khrparser.egl.EGLParser import EGLParser
10+
from khrparser.vk.VKParser import VKParser
11+
12+
from khrapi.API import API
13+
14+
from khrgenerator.cpp.CPPGenerator import CPPGenerator
15+
16+
17+
def main(argv):
18+
try:
19+
opts, args = getopt.getopt(argv[1:], "p:d:", ["profile=", "directory=" ])
20+
except getopt.GetoptError:
21+
print("usage: %s -p <profile JSON> [-d <output directory>]" % argv[0])
22+
sys.exit(1)
23+
24+
profileFile = None
25+
targetDir = "."
26+
27+
for opt, arg in opts:
28+
if opt in ("-p", "--profile"):
29+
profileFile = arg
30+
31+
if opt in ("-d", "--directory"):
32+
targetDir = arg
33+
34+
if profileFile == None or not os.path.isfile(profileFile):
35+
print("no profile given or not readable")
36+
sys.exit(1)
37+
38+
profile = Profile(json.load(open(profileFile)), targetDir)
39+
40+
parsers = {
41+
"gl": GLParser,
42+
"egl": EGLParser,
43+
"vk": VKParser,
44+
# "idl": IDLParser
45+
# "auto": ParserDetector
46+
}
47+
48+
generators = {
49+
"cpp": CPPGenerator
50+
}
51+
52+
if profile.parserIdentifier in parsers:
53+
khrParser = parsers[profile.parserIdentifier]
54+
else:
55+
print("Parser " + profile.parserIdentifier + " not registered")
56+
sys.exit(1)
57+
58+
if profile.generatorIdentifier in generators:
59+
khrGenerator = generators[profile.generatorIdentifier]
60+
else:
61+
print("Generator " + profile.generatorIdentifier + " not registered")
62+
sys.exit(1)
63+
64+
# api = khrParser.parse(profile)
65+
# khrGenerator.generate(profile, api)
66+
67+
if __name__ == "__main__":
68+
main(sys.argv)

khrapi/API.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
class API:
3+
pass

khrapi/Command.py

Whitespace-only changes.

khrapi/Extension.py

Whitespace-only changes.

khrapi/Feature.py

Whitespace-only changes.

khrapi/NamedValue.py

Whitespace-only changes.

khrapi/Parameter.py

Whitespace-only changes.

khrapi/Type.py

Whitespace-only changes.

khrapi/ValueGroup.py

Whitespace-only changes.

khrapi/__init__.py

Whitespace-only changes.

khrgenerator/__init__.py

Whitespace-only changes.

khrgenerator/cpp/CPPGenerator.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
class CPPGenerator:
3+
pass

khrgenerator/cpp/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
#include <gmock/gmock.h>
3+
4+
{{#apiMemberSets.items}}
5+
#include <{{api}}binding/{{api}}{{item.memberSet}}/{{api}}.h>
6+
{{/apiMemberSets.items}}
7+
8+
9+
TEST(AllVersions, Compilation)
10+
{
11+
SUCCEED(); // compiling this file without errors and warnings results in successful test
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
#include "Binding_pch.h"
3+
4+
5+
using namespace {{api}};
6+
7+
8+
namespace {{api}}binding
9+
{
10+
11+
12+
const Binding::array_t Binding::s_functions =
13+
{{=| |=}}{{|={{ }}=|
14+
{{#functions.items}}
15+
&{{item.identifierNoGl}}{{^last}},{{/last}}
16+
{{/functions.items}}
17+
{{=| |=}}}}|={{ }}=|;
18+
19+
20+
} // namespace {{api}}binding
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#include "Binding_pch.h"
3+
4+
5+
using namespace {{api}};
6+
7+
8+
namespace {{binding}}
9+
{
10+
11+
12+
{{#currentFunctionGroup.items}}{{#item}}Function<{{>partials/general_type}}{{^params.empty}}, {{>partials/general_paramSignature}}{{/params.empty}}> Binding::{{identifierNoGl}}("{{identifier}}");
13+
{{/item}}{{/currentFunctionGroup.items}}
14+
15+
16+
} // namespace {{binding}}

0 commit comments

Comments
 (0)