diff --git a/PythonScript/src/CreateWrapper.py b/PythonScript/src/CreateWrapper.py index e555a815..acb91e05 100644 --- a/PythonScript/src/CreateWrapper.py +++ b/PythonScript/src/CreateWrapper.py @@ -199,6 +199,26 @@ def retStringFromEnc(v, out): return boost::python::str(result.c_str()); '''.format(v["Param1Name"], symbolName(v))) +def retStringFromName(v, out): + traceCall(v, out) + checkDisallowedInCallback(v, out) + out.write( +''' std::string nameString = getStringFromObject({0}); + PythonCompatibleStrBuffer result(callScintilla({1}, reinterpret_cast(nameString.c_str()), 0)); + callScintilla({1}, reinterpret_cast(nameString.c_str()), reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +'''.format(v["Param1Name"], symbolName(v))) + +def retStringFromUTF8(v, out): + traceCall(v, out) + checkDisallowedInCallback(v, out) + out.write( +''' std::string utf8String = getStringFromObject({0}); + PythonCompatibleStrBuffer result(callScintilla({1}, reinterpret_cast(utf8String.c_str()), 0)); + callScintilla({1}, reinterpret_cast(utf8String.c_str()), reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +'''.format(v["Param1Name"], symbolName(v))) + def findTextBody(v, out): traceCall(v, out) checkDisallowedInCallback(v, out) @@ -378,6 +398,8 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): ('int', 'length', 'stringresult', '', ('boost::python::str', '' , '', retString)), ('string', 'key', 'stringresult', '', ('boost::python::str', 'boost::python::object','', retStringFromKey)), ('string', 'encodedCharacter', 'stringresult', '', ('boost::python::str', 'boost::python::object','', retStringFromEnc)), + ('string', 'name', 'stringresult', '', ('boost::python::str', 'boost::python::object','', retStringFromName)), + ('string', 'utf8', 'stringresult', '', ('boost::python::str', 'boost::python::object','', retStringFromUTF8)), ('int', 'length', 'stringresult', '', ('boost::python::str', '' , '', retStringNoLength)), ('int', '', 'stringresult', '', ('boost::python::str', 'int', '', retStringNoLength)), ('', '', 'stringresult', '', ('boost::python::str', '', '', retStringNoLength)), diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index ae8e2526..6fe80d57 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -666,6 +666,13 @@ enum VirtualSpace PYSCR_SCVS_USERACCESSIBLE = SCVS_USERACCESSIBLE }; +enum PhasesDraw +{ + PYSCR_SC_PHASES_ONE = SC_PHASES_ONE, + PYSCR_SC_PHASES_TWO = SC_PHASES_TWO, + PYSCR_SC_PHASES_MULTIPLE = SC_PHASES_MULTIPLE +}; + enum EdgeVisualStyle { PYSCR_EDGE_NONE = EDGE_NONE, diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index f56489ab..dbc1893a 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -600,6 +600,11 @@ void export_enums() .value("RECTANGULARSELECTION", PYSCR_SCVS_RECTANGULARSELECTION) .value("USERACCESSIBLE", PYSCR_SCVS_USERACCESSIBLE); + boost::python::enum_("PHASESDRAW") + .value("ONE", PYSCR_SC_PHASES_ONE) + .value("TWO", PYSCR_SC_PHASES_TWO) + .value("MULTIPLE", PYSCR_SC_PHASES_MULTIPLE); + boost::python::enum_("EDGEVISUALSTYLE") .value("NONE", PYSCR_EDGE_NONE) .value("LINE", PYSCR_EDGE_LINE) diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index 78abcef1..cea44acc 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -1357,7 +1357,7 @@ get bool GetTwoPhaseDraw=2283(,) # and then the foreground. This avoids chopping off characters that overlap the next run. set void SetTwoPhaseDraw=2284(bool twoPhase,) -enu FontQuality=SC_PHASES_ +enu PhasesDraw=SC_PHASES_ val SC_PHASES_ONE=0 val SC_PHASES_TWO=1 val SC_PHASES_MULTIPLE=2 @@ -2451,7 +2451,7 @@ get int GetLineEndTypesActive=2658(,) # Set the way a character is drawn. set void SetRepresentation=2665(string encodedCharacter, string representation) -# Set the way a character is drawn. +# Get the way a character is drawn. # Result is NUL-terminated. get int GetRepresentation=2666(string encodedCharacter, stringresult representation) diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index affb5260..30b4437a 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -751,7 +751,7 @@ BOOST_PYTHON_MODULE(Npp) .def("getLineEndTypesAllowed", &ScintillaWrapper::GetLineEndTypesAllowed, "Get the line end types currently allowed.") .def("getLineEndTypesActive", &ScintillaWrapper::GetLineEndTypesActive, "Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation.") .def("setRepresentation", &ScintillaWrapper::SetRepresentation, boost::python::args("encodedCharacter", "representation"), "Set the way a character is drawn.") - .def("getRepresentation", &ScintillaWrapper::GetRepresentation, boost::python::args("encodedCharacter"), "Set the way a character is drawn.\nResult is NUL-terminated.") + .def("getRepresentation", &ScintillaWrapper::GetRepresentation, boost::python::args("encodedCharacter"), "Get the way a character is drawn.\nResult is NUL-terminated.") .def("clearRepresentation", &ScintillaWrapper::ClearRepresentation, boost::python::args("encodedCharacter"), "Remove a character representation.") .def("startRecord", &ScintillaWrapper::StartRecord, "Start notifying the container of all key presses and commands.") .def("stopRecord", &ScintillaWrapper::StopRecord, "Stop notifying the container of all key presses and commands.") diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index 2ad7d764..f28e7db0 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -4306,9 +4306,9 @@ void ScintillaWrapper::SetLengthForEncode(int bytes) boost::python::str ScintillaWrapper::EncodedFromUTF8(boost::python::object utf8) { DEBUG_TRACE(L"ScintillaWrapper::EncodedFromUTF8\n"); - std::string strinutf8 = getStringFromObject(utf8); - PythonCompatibleStrBuffer result(callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast(strinutf8.c_str()), 0)); - callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast(strinutf8.c_str()), reinterpret_cast(*result)); + std::string utf8String = getStringFromObject(utf8); + PythonCompatibleStrBuffer result(callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast(utf8String.c_str()), 0)); + callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast(utf8String.c_str()), reinterpret_cast(*result)); return boost::python::str(result.c_str()); } @@ -5662,9 +5662,9 @@ intptr_t ScintillaWrapper::PropertyType(boost::python::object name) boost::python::str ScintillaWrapper::DescribeProperty(boost::python::object name) { DEBUG_TRACE(L"ScintillaWrapper::DescribeProperty\n"); - std::string stringname = getStringFromObject(name); - PythonCompatibleStrBuffer result(callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast(stringname.c_str()), 0)); - callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast(stringname.c_str()), reinterpret_cast(*result)); + std::string nameString = getStringFromObject(name); + PythonCompatibleStrBuffer result(callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast(nameString.c_str()), 0)); + callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast(nameString.c_str()), reinterpret_cast(*result)); return boost::python::str(result.c_str()); } diff --git a/docs/source/enums.rst b/docs/source/enums.rst index 3cd21f0e..1dc1221b 100644 --- a/docs/source/enums.rst +++ b/docs/source/enums.rst @@ -1815,6 +1815,18 @@ ORDERING .. attribute:: ORDERING.CUSTOM +PHASESDRAW +---------- + +.. _PHASESDRAW: +.. class:: PHASESDRAW + +.. attribute:: PHASESDRAW.ONE + +.. attribute:: PHASESDRAW.TWO + +.. attribute:: PHASESDRAW.MULTIPLE + PRINTOPTION -----------