aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2013-06-10 20:59:01 -0400
committerJohn Ehresman <jpe@wingware.com>2013-06-10 20:59:01 -0400
commit5baa78cf911281442341a406b6f53cbef577561c (patch)
tree80882138a3a3e7393da1702125ab7e76985aeb9b
parent94ecb8c5020fb77da31a4d0d4ba2f4aac6c5ee81 (diff)
downloadscintilla-mirror-5baa78cf911281442341a406b6f53cbef577561c.tar.gz
Define custom get_ / set_ margin_mask_n to treat values as a bitmask
-rw-r--r--qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template27
1 files changed, 27 insertions, 0 deletions
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 @@
<object-type name="ScintillaEdit">
<!-- ++Autogenerated start of section automatically generated from Scintilla.iface -->
<!-- ~~Autogenerated end of section automatically generated from Scintilla.iface -->
+
+ <!-- Custom implementation of get and set_margin_mask_n: mask is defined
+ as an int but is really a bitfield and the numeric value can be
+ greater than max value of an int -->
+ <modify-function signature="set_margin_mask_n(int, int)">
+ <inject-code>
+ int margin = PyInt_AsLong(%PYARG_1);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+ unsigned long mask = PyInt_AsUnsignedLongMask(%PYARG_2);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+
+ %CPPSELF-&gt;set_margin_mask_n(margin, static_cast&lt;int&gt;(mask));
+ Py_RETURN_NONE;
+ </inject-code>
+ </modify-function>
+ <modify-function signature="get_margin_mask_n(int) const">
+ <inject-code>
+ int margin = PyInt_AsLong(%PYARG_1);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+ unsigned int mask = (unsigned int)%CPPSELF-&gt;get_margin_mask_n(margin);
+ %PYARG_0 = PyInt_FromSize_t(mask);
+ </inject-code>
+ </modify-function>
+
</object-type>
<object-type name="ScintillaDocument" />
</typesystem>