<?xml version="1.0"?>
<typesystem package="ScintillaEditPy">
	<load-typesystem name="typesystem_core.xml" generate="no" />
	<load-typesystem name="typesystem_gui_common.xml" generate="no"/>
	<primitive-type name="sptr_t"/>
	<primitive-type name="uptr_t"/>
	<value-type name="Sci_NotifyHeader" />
	<rejection class="Sci_NotifyHeader" field-name="hwndFrom" />
	<value-type name="SCNotification" />
	<object-type name="ScintillaEditBase" />
	<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>
		<modify-function signature="setMarginMaskN(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;setMarginMaskN(margin, static_cast&lt;int&gt;(mask));
				Py_RETURN_NONE;
			</inject-code>
		</modify-function>
		<modify-function signature="marginMaskN(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;marginMaskN(margin);
				%PYARG_0 = PyInt_FromSize_t(mask);
			</inject-code>
		</modify-function>

	</object-type>
	<object-type name="ScintillaDocument" />
</typesystem>
