diff options
author | Neil <nyamatongwe@gmail.com> | 2019-06-18 13:21:05 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-06-18 13:21:05 +1000 |
commit | 838b815992bc784e85120b9254c1c6299d4e0f1d (patch) | |
tree | d1b3e8be1f46c9e2024dd418001d8a5c18e3c9d0 /qt/ScintillaEdit/WidgetGen.py | |
parent | f535791769ca4e89dc3deade86e1d893f5f31103 (diff) | |
download | scintilla-mirror-838b815992bc784e85120b9254c1c6299d4e0f1d.tar.gz |
Backport: Feature [feature-requests:#1297] 6: Support enumerated types in APIs.
Backport of changeset 7589:156d66aebfa1.
Diffstat (limited to 'qt/ScintillaEdit/WidgetGen.py')
-rw-r--r-- | qt/ScintillaEdit/WidgetGen.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/qt/ScintillaEdit/WidgetGen.py b/qt/ScintillaEdit/WidgetGen.py index 2fa63279e..44349a90b 100644 --- a/qt/ScintillaEdit/WidgetGen.py +++ b/qt/ScintillaEdit/WidgetGen.py @@ -51,21 +51,26 @@ typeAliases = { def cppAlias(s): if s in typeAliases: return typeAliases[s] + elif Face.IsEnumeration(s): + return "int" else: return s understoodTypes = ["", "void", "int", "bool", "position", "line", "pointer", "colour", "keymod", "string", "stringresult", "cells"] +def understoodType(t): + return t in understoodTypes or Face.IsEnumeration(t) + def checkTypes(name, v): understandAllTypes = True - if v["ReturnType"] not in understoodTypes: + if not understoodType(v["ReturnType"]): #~ print("Do not understand", v["ReturnType"], "for", name) understandAllTypes = False - if v["Param1Type"] not in understoodTypes: + if not understoodType(v["Param1Type"]): #~ print("Do not understand", v["Param1Type"], "for", name) understandAllTypes = False - if v["Param2Type"] not in understoodTypes: + if not understoodType(v["Param2Type"]): #~ print("Do not understand", v["Param2Type"], "for", name) understandAllTypes = False return understandAllTypes |