aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/ScintillaCallable.py
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-05-12 09:07:49 +1000
committerNeil <nyamatongwe@gmail.com>2021-05-12 09:07:49 +1000
commit5468995af334359c04625dbd374658bbf91b0449 (patch)
tree5b87e53da6b2618c848910299040d114af09ec57 /test/ScintillaCallable.py
parent1cfccee93cc5fd4d0fb56937b0402611b354e8c2 (diff)
downloadscintilla-mirror-5468995af334359c04625dbd374658bbf91b0449.tar.gz
Allow property-style access to colour and colouralpha APIs.
Diffstat (limited to 'test/ScintillaCallable.py')
-rw-r--r--test/ScintillaCallable.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/ScintillaCallable.py b/test/ScintillaCallable.py
index 6d97eb25a..1164631ae 100644
--- a/test/ScintillaCallable.py
+++ b/test/ScintillaCallable.py
@@ -9,6 +9,11 @@ from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
def IsEnumeration(t):
return t[:1].isupper()
+basicTypes = ["bool", "int", "position", "line", "pointer", "colour", "colouralpha"]
+
+def BasicTypeOrEnumeration(t):
+ return t in basicTypes or IsEnumeration(t)
+
class TEXTRANGE(ctypes.Structure):
_fields_= (\
('cpMin', c_long),
@@ -86,8 +91,7 @@ class ScintillaCallable:
not name.startswith("Get") and \
not feature["Param1Type"] and \
not feature["Param2Type"] and \
- (feature["ReturnType"] in ["bool", "int", "position", "line", "pointer"] or \
- IsEnumeration(feature["ReturnType"])):
+ BasicTypeOrEnumeration(feature["ReturnType"]):
#~ print("property", feature)
return self._scifn(self._sciptr, value, None, None)
elif name.startswith("SCN_") and name in self.k:
@@ -105,7 +109,7 @@ class ScintillaCallable:
value = int(feature["Value"], 0)
#~ print("setproperty", feature)
if feature["FeatureType"] == "set" and not name.startswith("Set"):
- if feature["Param1Type"] in ["bool", "int", "position", "line"] or IsEnumeration(feature["Param1Type"]):
+ if BasicTypeOrEnumeration(feature["Param1Type"]):
return self._scifn(self._sciptr, value, c_char_p(val), None)
elif feature["Param2Type"] in ["string"]:
return self._scifn(self._sciptr, value, None, c_char_p(val))