Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions PythonScript/src/CreateWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<WPARAM>(nameString.c_str()), 0));
callScintilla({1}, reinterpret_cast<WPARAM>(nameString.c_str()), reinterpret_cast<LPARAM>(*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<WPARAM>(utf8String.c_str()), 0));
callScintilla({1}, reinterpret_cast<WPARAM>(utf8String.c_str()), reinterpret_cast<LPARAM>(*result));
return boost::python::str(result.c_str());
'''.format(v["Param1Name"], symbolName(v)))

def findTextBody(v, out):
traceCall(v, out)
checkDisallowedInCallback(v, out)
Expand Down Expand Up @@ -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)),
Expand Down
7 changes: 7 additions & 0 deletions PythonScript/src/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions PythonScript/src/EnumsWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,11 @@ void export_enums()
.value("RECTANGULARSELECTION", PYSCR_SCVS_RECTANGULARSELECTION)
.value("USERACCESSIBLE", PYSCR_SCVS_USERACCESSIBLE);

boost::python::enum_<PhasesDraw>("PHASESDRAW")
.value("ONE", PYSCR_SC_PHASES_ONE)
.value("TWO", PYSCR_SC_PHASES_TWO)
.value("MULTIPLE", PYSCR_SC_PHASES_MULTIPLE);

boost::python::enum_<EdgeVisualStyle>("EDGEVISUALSTYLE")
.value("NONE", PYSCR_EDGE_NONE)
.value("LINE", PYSCR_EDGE_LINE)
Expand Down
4 changes: 2 additions & 2 deletions PythonScript/src/Scintilla.iface
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion PythonScript/src/ScintillaPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
12 changes: 6 additions & 6 deletions PythonScript/src/ScintillaWrapperGenerated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<WPARAM>(strinutf8.c_str()), 0));
callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast<WPARAM>(strinutf8.c_str()), reinterpret_cast<LPARAM>(*result));
std::string utf8String = getStringFromObject(utf8);
PythonCompatibleStrBuffer result(callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast<WPARAM>(utf8String.c_str()), 0));
callScintilla(SCI_ENCODEDFROMUTF8, reinterpret_cast<WPARAM>(utf8String.c_str()), reinterpret_cast<LPARAM>(*result));
return boost::python::str(result.c_str());
}

Expand Down Expand Up @@ -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<WPARAM>(stringname.c_str()), 0));
callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast<WPARAM>(stringname.c_str()), reinterpret_cast<LPARAM>(*result));
std::string nameString = getStringFromObject(name);
PythonCompatibleStrBuffer result(callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast<WPARAM>(nameString.c_str()), 0));
callScintilla(SCI_DESCRIBEPROPERTY, reinterpret_cast<WPARAM>(nameString.c_str()), reinterpret_cast<LPARAM>(*result));
return boost::python::str(result.c_str());
}

Expand Down
12 changes: 12 additions & 0 deletions docs/source/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,18 @@ ORDERING

.. attribute:: ORDERING.CUSTOM

PHASESDRAW
----------

.. _PHASESDRAW:
.. class:: PHASESDRAW

.. attribute:: PHASESDRAW.ONE

.. attribute:: PHASESDRAW.TWO

.. attribute:: PHASESDRAW.MULTIPLE

PRINTOPTION
-----------

Expand Down