PythonQtWrapper_QSyntaxHighlighter.cpp
164 lines
| 5.9 KiB
| text/x-c
|
CppLexer
|
r13 | #include "PythonQtWrapper_QSyntaxHighlighter.h" | ||
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qcolor.h> | ||||
#include <qcoreevent.h> | ||||
#include <qfont.h> | ||||
#include <qlist.h> | ||||
#include <qobject.h> | ||||
#include <qsyntaxhighlighter.h> | ||||
#include <qtextdocument.h> | ||||
#include <qtextedit.h> | ||||
#include <qtextformat.h> | ||||
#include <qtextobject.h> | ||||
|
r24 | void PythonQtShell_QSyntaxHighlighter::childEvent(QChildEvent* arg__1) | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
|
r73 | static const char* argumentList[] ={"" , "QChildEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QSyntaxHighlighter::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QSyntaxHighlighter::customEvent(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
|
r73 | static const char* argumentList[] ={"" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QSyntaxHighlighter::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QSyntaxHighlighter::event(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
|
r73 | static const char* argumentList[] ={"bool" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
bool returnValue; | ||||
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QSyntaxHighlighter::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QSyntaxHighlighter::eventFilter(QObject* arg__1, QEvent* arg__2) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
|
r73 | static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); | ||||
bool returnValue; | ||||
|
r24 | void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QSyntaxHighlighter::eventFilter(arg__1, arg__2); | ||||
} | ||||
void PythonQtShell_QSyntaxHighlighter::highlightBlock(const QString& text) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "highlightBlock"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
|
r73 | static const char* argumentList[] ={"" , "const QString&"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
|
r24 | void* args[2] = {NULL, (void*)&text}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
} | ||||
void PythonQtShell_QSyntaxHighlighter::timerEvent(QTimerEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
|
r73 | static const char* argumentList[] ={"" , "QTimerEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QSyntaxHighlighter::timerEvent(arg__1); | ||||
} | ||||
QSyntaxHighlighter* PythonQtWrapper_QSyntaxHighlighter::new_QSyntaxHighlighter(QObject* parent) | ||||
{ | ||||
return new PythonQtShell_QSyntaxHighlighter(parent); } | ||||
QSyntaxHighlighter* PythonQtWrapper_QSyntaxHighlighter::new_QSyntaxHighlighter(QTextDocument* parent) | ||||
{ | ||||
return new PythonQtShell_QSyntaxHighlighter(parent); } | ||||
QSyntaxHighlighter* PythonQtWrapper_QSyntaxHighlighter::new_QSyntaxHighlighter(QTextEdit* parent) | ||||
{ | ||||
return new PythonQtShell_QSyntaxHighlighter(parent); } | ||||
|
r73 | void PythonQtWrapper_QSyntaxHighlighter::setDocument(QSyntaxHighlighter* theWrappedObject, QTextDocument* doc) | ||
|
r13 | { | ||
|
r73 | ( theWrappedObject->setDocument(doc)); | ||
|
r13 | } | ||
|
r73 | QTextDocument* PythonQtWrapper_QSyntaxHighlighter::document(QSyntaxHighlighter* theWrappedObject) const | ||
|
r13 | { | ||
|
r73 | return ( theWrappedObject->document()); | ||
|
r13 | } | ||