Capture added interfaces for a ` ` or ` `. - interface - Element for ` ` or ` `, containing ` ` and ` ` tags - featurename - name of the feature - api - string specifying API name being generated - profile
(self, interface, featurename, api, profile)
| 1346 | return False |
| 1347 | |
| 1348 | def fillFeatureDictionary(self, interface, featurename, api, profile): |
| 1349 | """Capture added interfaces for a `<version>` or `<extension>`. |
| 1350 | |
| 1351 | - interface - Element for `<version>` or `<extension>`, containing |
| 1352 | `<require>` and `<remove>` tags |
| 1353 | - featurename - name of the feature |
| 1354 | - api - string specifying API name being generated |
| 1355 | - profile - string specifying API profile being generated""" |
| 1356 | |
| 1357 | # Explicitly initialize known types - errors for unhandled categories |
| 1358 | self.gen.featureDictionary[featurename] = { |
| 1359 | "enumconstant": {}, |
| 1360 | "command": {}, |
| 1361 | "enum": {}, |
| 1362 | "struct": {}, |
| 1363 | "handle": {}, |
| 1364 | "basetype": {}, |
| 1365 | "include": {}, |
| 1366 | "define": {}, |
| 1367 | "bitmask": {}, |
| 1368 | "union": {}, |
| 1369 | "funcpointer": {}, |
| 1370 | } |
| 1371 | |
| 1372 | # <require> marks things that are required by this version/profile |
| 1373 | for require in interface.findall('require'): |
| 1374 | if matchAPIProfile(api, profile, require) and self.requireDependsSatisfied(require): |
| 1375 | |
| 1376 | # Determine the required extension or version needed for a require block |
| 1377 | # Assumes that only one of these is specified |
| 1378 | # 'extension', and therefore 'required_key', may be a boolean |
| 1379 | # expression of extension names. |
| 1380 | # 'required_key' is used only as a dictionary key at |
| 1381 | # present, and passed through to the script generators, so |
| 1382 | # they must be prepared to parse that boolean expression. |
| 1383 | required_key = require.get('depends') |
| 1384 | |
| 1385 | # Loop over types, enums, and commands in the tag |
| 1386 | for typeElem in require.findall('type'): |
| 1387 | typename = typeElem.get('name') |
| 1388 | typeinfo = self.lookupElementInfo(typename, self.typedict) |
| 1389 | |
| 1390 | if typeinfo: |
| 1391 | # Remove aliases in the same extension/feature; these are always added as a correction. Do not need the original to be visible. |
| 1392 | alias = self.getAlias(typeElem, self.typedict) |
| 1393 | if not self.checkForCorrectionAliases(alias, require, 'type'): |
| 1394 | # Resolve the type info to the actual type, so we get an accurate read for 'structextends' |
| 1395 | while alias: |
| 1396 | typeinfo = self.lookupElementInfo(alias, self.typedict) |
| 1397 | if not typeinfo: |
| 1398 | raise RuntimeError(f"Missing alias {alias}") |
| 1399 | alias = typeinfo.elem.get('alias') |
| 1400 | |
| 1401 | typecat = typeinfo.elem.get('category') |
| 1402 | typeextends = typeinfo.elem.get('structextends') |
| 1403 | if not required_key in self.gen.featureDictionary[featurename][typecat]: |
| 1404 | self.gen.featureDictionary[featurename][typecat][required_key] = {} |
| 1405 | if not typeextends in self.gen.featureDictionary[featurename][typecat][required_key]: |
no test coverage detected