From 9555e18a77b0122ebc0f87fda4e92a1cd8d9acbf Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Mon, 10 Jun 2013 20:59:01 -0400 Subject: Define custom get_ / set_ margin_mask_n to treat values as a bitmask --- .../typesystem_ScintillaEdit.xml.template | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'qt') diff --git a/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template b/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template index 4c2c897a2..a26b04352 100644 --- a/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template +++ b/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template @@ -11,6 +11,33 @@ + + + + + int margin = PyInt_AsLong(%PYARG_1); + if (margin == -1 && PyErr_Occurred()) + return NULL; + unsigned long mask = PyInt_AsUnsignedLongMask(%PYARG_2); + if (margin == -1 && PyErr_Occurred()) + return NULL; + + %CPPSELF->set_margin_mask_n(margin, static_cast<int>(mask)); + Py_RETURN_NONE; + + + + + int margin = PyInt_AsLong(%PYARG_1); + if (margin == -1 && PyErr_Occurred()) + return NULL; + unsigned int mask = (unsigned int)%CPPSELF->get_margin_mask_n(margin); + %PYARG_0 = PyInt_FromSize_t(mask); + + + -- cgit v1.2.3