From ab38beeb9a31a5df65b6e2a41251ca36574065f3 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 18 Jun 2019 13:21:05 +1000 Subject: Feature [feature-requests:#1297] 6: Support enumerated types in APIs. --- qt/ScintillaEdit/WidgetGen.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'qt') 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 -- cgit v1.2.3