Remove python scripting support

This commit is contained in:
David Sansome 2011-07-21 00:17:37 +01:00
parent a0258a9e81
commit dd3eee63e5
296 changed files with 13 additions and 334115 deletions

View File

@ -1,89 +0,0 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${PYTHON_INCLUDE_DIRS})
set(SOURCES
generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.cpp
generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin_init.cpp
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core0.cpp
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core1.cpp
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core2.cpp
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core_init.cpp
generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.cpp
generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin_init.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui10.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui1.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui2.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui3.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui4.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui5.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui6.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui7.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui8.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui9.cpp
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui_init.cpp
generated_cpp/com_trolltech_qt_network/com_trolltech_qt_network0.cpp
generated_cpp/com_trolltech_qt_network/com_trolltech_qt_network1.cpp
generated_cpp/com_trolltech_qt_network/com_trolltech_qt_network_init.cpp
src/gui/PythonQtScriptingConsole.cpp
src/PythonQtClassInfo.cpp
src/PythonQtClassWrapper.cpp
src/PythonQtConversion.cpp
src/PythonQt.cpp
src/PythonQtImporter.cpp
src/PythonQtInstanceWrapper.cpp
src/PythonQtMethodInfo.cpp
src/PythonQtMisc.cpp
src/PythonQtObjectPtr.cpp
src/PythonQtQFileImporter.cpp
src/PythonQtSignalReceiver.cpp
src/PythonQtSlot.cpp
src/PythonQtStdDecorators.cpp
src/PythonQtStdOut.cpp
)
set(HEADERS
generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin0.h
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core0.h
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core1.h
generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core2.h
generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin0.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui0.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui10.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui1.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui2.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui3.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui4.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui5.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui6.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui7.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui8.h
generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui9.h
generated_cpp/com_trolltech_qt_network/com_trolltech_qt_network0.h
generated_cpp/com_trolltech_qt_network/com_trolltech_qt_network1.h
src/gui/PythonQtScriptingConsole.h
src/PythonQt.h
src/PythonQtSignalReceiver.h
src/PythonQtStdDecorators.h
)
qt4_wrap_cpp(MOC ${HEADERS})
if(STATIC_PYTHONQT)
set(TYPE STATIC)
else(STATIC_PYTHONQT)
set(TYPE SHARED)
endif(STATIC_PYTHONQT)
add_definitions(-DPYTHONQT_EXPORTS)
add_library(pythonqt ${TYPE}
${SOURCES}
${MOC}
)
set_target_properties(pythonqt PROPERTIES COMPILE_FLAGS "-Wno-write-strings -Wno-format-nonliteral -Wno-format-security")
target_link_libraries(pythonqt
${PYTHON_LIBRARIES}
${QT_LIBRARIES}
)

View File

@ -1,10 +0,0 @@
HEADERS += \
$$PWD/com_trolltech_qt_core0.h \
$$PWD/com_trolltech_qt_core1.h \
$$PWD/com_trolltech_qt_core2.h \
SOURCES += \
$$PWD/com_trolltech_qt_core0.cpp \
$$PWD/com_trolltech_qt_core1.cpp \
$$PWD/com_trolltech_qt_core2.cpp \
$$PWD/com_trolltech_qt_core_init.cpp

File diff suppressed because one or more lines are too long

View File

@ -1,734 +0,0 @@
#include "com_trolltech_qt_core2.h"
#include <PythonQtConversion.h>
#include <PythonQtMethodInfo.h>
#include <PythonQtSignalReceiver.h>
#include <QVariant>
#include <qanimationgroup.h>
#include <qbytearray.h>
#include <qcoreevent.h>
#include <qdatastream.h>
#include <qeasingcurve.h>
#include <qlist.h>
#include <qmutex.h>
#include <qobject.h>
#include <qpair.h>
#include <qreadwritelock.h>
#include <qtconcurrentreducekernel.h>
#include <qtconcurrentthreadengine.h>
#include <qtranslator.h>
#include <quuid.h>
#include <qvariantanimation.h>
#include <qvector.h>
#include <qwaitcondition.h>
QTimerEvent* PythonQtWrapper_QTimerEvent::new_QTimerEvent(int timerId)
{
return new PythonQtShell_QTimerEvent(timerId); }
int PythonQtWrapper_QTimerEvent::timerId(QTimerEvent* theWrappedObject) const
{
return ( theWrappedObject->timerId());
}
void PythonQtShell_QTranslator::childEvent(QChildEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QChildEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QTranslator::childEvent(arg__1);
}
void PythonQtShell_QTranslator::customEvent(QEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QTranslator::customEvent(arg__1);
}
bool PythonQtShell_QTranslator::event(QEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QTranslator::event(arg__1);
}
bool PythonQtShell_QTranslator::eventFilter(QObject* arg__1, QEvent* arg__2)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
bool returnValue = 0;
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QTranslator::eventFilter(arg__1, arg__2);
}
bool PythonQtShell_QTranslator::isEmpty() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isEmpty");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
bool returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("isEmpty", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QTranslator::isEmpty();
}
void PythonQtShell_QTranslator::timerEvent(QTimerEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QTimerEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QTranslator::timerEvent(arg__1);
}
QString PythonQtShell_QTranslator::translate(const char* context, const char* sourceText, const char* disambiguation) const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "translate");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"QString" , "const char*" , "const char*" , "const char*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList);
QString returnValue;
void* args[4] = {NULL, (void*)&context, (void*)&sourceText, (void*)&disambiguation};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("translate", methodInfo, result);
} else {
returnValue = *((QString*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QTranslator::translate(context, sourceText, disambiguation);
}
QTranslator* PythonQtWrapper_QTranslator::new_QTranslator(QObject* parent)
{
return new PythonQtShell_QTranslator(parent); }
bool PythonQtWrapper_QTranslator::isEmpty(QTranslator* theWrappedObject) const
{
return ( ((PythonQtPublicPromoter_QTranslator*)theWrappedObject)->promoted_isEmpty());
}
bool PythonQtWrapper_QTranslator::load(QTranslator* theWrappedObject, const QString& filename, const QString& directory, const QString& search_delimiters, const QString& suffix)
{
return ( theWrappedObject->load(filename, directory, search_delimiters, suffix));
}
bool PythonQtWrapper_QTranslator::load(QTranslator* theWrappedObject, const uchar* data, int len)
{
return ( theWrappedObject->load(data, len));
}
QString PythonQtWrapper_QTranslator::translate(QTranslator* theWrappedObject, const char* context, const char* sourceText, const char* disambiguation) const
{
return ( ((PythonQtPublicPromoter_QTranslator*)theWrappedObject)->promoted_translate(context, sourceText, disambiguation));
}
QUuid* PythonQtWrapper_QUuid::new_QUuid()
{
return new PythonQtShell_QUuid(); }
QUuid* PythonQtWrapper_QUuid::new_QUuid(const QString& arg__1)
{
return new PythonQtShell_QUuid(arg__1); }
QUuid* PythonQtWrapper_QUuid::new_QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8)
{
return new PythonQtShell_QUuid(l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8); }
QUuid PythonQtWrapper_QUuid::static_QUuid_createUuid()
{
return (QUuid::createUuid());
}
bool PythonQtWrapper_QUuid::isNull(QUuid* theWrappedObject) const
{
return ( theWrappedObject->isNull());
}
bool PythonQtWrapper_QUuid::__ne__(QUuid* theWrappedObject, const QUuid& orig) const
{
return ( (*theWrappedObject)!= orig);
}
bool PythonQtWrapper_QUuid::__lt__(QUuid* theWrappedObject, const QUuid& other) const
{
return ( (*theWrappedObject)< other);
}
void PythonQtWrapper_QUuid::writeTo(QUuid* theWrappedObject, QDataStream& arg__1)
{
arg__1 << (*theWrappedObject);
}
bool PythonQtWrapper_QUuid::__eq__(QUuid* theWrappedObject, const QUuid& orig) const
{
return ( (*theWrappedObject)== orig);
}
bool PythonQtWrapper_QUuid::__gt__(QUuid* theWrappedObject, const QUuid& other) const
{
return ( (*theWrappedObject)> other);
}
void PythonQtWrapper_QUuid::readFrom(QUuid* theWrappedObject, QDataStream& arg__1)
{
arg__1 >> (*theWrappedObject);
}
QString PythonQtWrapper_QUuid::toString(QUuid* theWrappedObject) const
{
return ( theWrappedObject->toString());
}
QUuid::Variant PythonQtWrapper_QUuid::variant(QUuid* theWrappedObject) const
{
return ( theWrappedObject->variant());
}
QUuid::Version PythonQtWrapper_QUuid::version(QUuid* theWrappedObject) const
{
return ( theWrappedObject->version());
}
QString PythonQtWrapper_QUuid::py_toString(QUuid* obj) { return obj->toString(); }
void PythonQtShell_QVariantAnimation::childEvent(QChildEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QChildEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QVariantAnimation::childEvent(arg__1);
}
void PythonQtShell_QVariantAnimation::customEvent(QEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QVariantAnimation::customEvent(arg__1);
}
int PythonQtShell_QVariantAnimation::duration() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "duration");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"int"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
int returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("duration", methodInfo, result);
} else {
returnValue = *((int*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QVariantAnimation::duration();
}
bool PythonQtShell_QVariantAnimation::event(QEvent* event)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
void* args[2] = {NULL, (void*)&event};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QVariantAnimation::event(event);
}
bool PythonQtShell_QVariantAnimation::eventFilter(QObject* arg__1, QEvent* arg__2)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
bool returnValue = 0;
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QVariantAnimation::eventFilter(arg__1, arg__2);
}
QVariant PythonQtShell_QVariantAnimation::interpolated(const QVariant& from, const QVariant& to, qreal progress) const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "interpolated");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"QVariant" , "const QVariant&" , "const QVariant&" , "qreal"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList);
QVariant returnValue;
void* args[4] = {NULL, (void*)&from, (void*)&to, (void*)&progress};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("interpolated", methodInfo, result);
} else {
returnValue = *((QVariant*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QVariantAnimation::interpolated(from, to, progress);
}
void PythonQtShell_QVariantAnimation::timerEvent(QTimerEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QTimerEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QVariantAnimation::timerEvent(arg__1);
}
void PythonQtShell_QVariantAnimation::updateCurrentTime(int arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateCurrentTime");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "int"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QVariantAnimation::updateCurrentTime(arg__1);
}
void PythonQtShell_QVariantAnimation::updateCurrentValue(const QVariant& value)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateCurrentValue");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "const QVariant&"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&value};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
}
void PythonQtShell_QVariantAnimation::updateDirection(QAbstractAnimation::Direction direction)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateDirection");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QAbstractAnimation::Direction"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&direction};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QVariantAnimation::updateDirection(direction);
}
void PythonQtShell_QVariantAnimation::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateState");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QAbstractAnimation::State" , "QAbstractAnimation::State"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
void* args[3] = {NULL, (void*)&newState, (void*)&oldState};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QVariantAnimation::updateState(newState, oldState);
}
QVariantAnimation* PythonQtWrapper_QVariantAnimation::new_QVariantAnimation(QObject* parent)
{
return new PythonQtShell_QVariantAnimation(parent); }
QVariant PythonQtWrapper_QVariantAnimation::currentValue(QVariantAnimation* theWrappedObject) const
{
return ( theWrappedObject->currentValue());
}
int PythonQtWrapper_QVariantAnimation::duration(QVariantAnimation* theWrappedObject) const
{
return ( ((PythonQtPublicPromoter_QVariantAnimation*)theWrappedObject)->promoted_duration());
}
QEasingCurve PythonQtWrapper_QVariantAnimation::easingCurve(QVariantAnimation* theWrappedObject) const
{
return ( theWrappedObject->easingCurve());
}
QVariant PythonQtWrapper_QVariantAnimation::endValue(QVariantAnimation* theWrappedObject) const
{
return ( theWrappedObject->endValue());
}
bool PythonQtWrapper_QVariantAnimation::event(QVariantAnimation* theWrappedObject, QEvent* event)
{
return ( ((PythonQtPublicPromoter_QVariantAnimation*)theWrappedObject)->promoted_event(event));
}
QVariant PythonQtWrapper_QVariantAnimation::interpolated(QVariantAnimation* theWrappedObject, const QVariant& from, const QVariant& to, qreal progress) const
{
return ( ((PythonQtPublicPromoter_QVariantAnimation*)theWrappedObject)->promoted_interpolated(from, to, progress));
}
QVariant PythonQtWrapper_QVariantAnimation::keyValueAt(QVariantAnimation* theWrappedObject, qreal step) const
{
return ( theWrappedObject->keyValueAt(step));
}
QVector<QPair<qreal , QVariant > > PythonQtWrapper_QVariantAnimation::keyValues(QVariantAnimation* theWrappedObject) const
{
return ( theWrappedObject->keyValues());
}
void PythonQtWrapper_QVariantAnimation::setDuration(QVariantAnimation* theWrappedObject, int msecs)
{
( theWrappedObject->setDuration(msecs));
}
void PythonQtWrapper_QVariantAnimation::setEasingCurve(QVariantAnimation* theWrappedObject, const QEasingCurve& easing)
{
( theWrappedObject->setEasingCurve(easing));
}
void PythonQtWrapper_QVariantAnimation::setEndValue(QVariantAnimation* theWrappedObject, const QVariant& value)
{
( theWrappedObject->setEndValue(value));
}
void PythonQtWrapper_QVariantAnimation::setKeyValueAt(QVariantAnimation* theWrappedObject, qreal step, const QVariant& value)
{
( theWrappedObject->setKeyValueAt(step, value));
}
void PythonQtWrapper_QVariantAnimation::setKeyValues(QVariantAnimation* theWrappedObject, const QVector<QPair<qreal , QVariant > >& values)
{
( theWrappedObject->setKeyValues(values));
}
void PythonQtWrapper_QVariantAnimation::setStartValue(QVariantAnimation* theWrappedObject, const QVariant& value)
{
( theWrappedObject->setStartValue(value));
}
QVariant PythonQtWrapper_QVariantAnimation::startValue(QVariantAnimation* theWrappedObject) const
{
return ( theWrappedObject->startValue());
}
void PythonQtWrapper_QVariantAnimation::updateCurrentTime(QVariantAnimation* theWrappedObject, int arg__1)
{
( ((PythonQtPublicPromoter_QVariantAnimation*)theWrappedObject)->promoted_updateCurrentTime(arg__1));
}
void PythonQtWrapper_QVariantAnimation::updateState(QVariantAnimation* theWrappedObject, QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
{
( ((PythonQtPublicPromoter_QVariantAnimation*)theWrappedObject)->promoted_updateState(newState, oldState));
}
QWaitCondition* PythonQtWrapper_QWaitCondition::new_QWaitCondition()
{
return new QWaitCondition(); }
bool PythonQtWrapper_QWaitCondition::wait(QWaitCondition* theWrappedObject, QMutex* mutex, unsigned long time)
{
return ( theWrappedObject->wait(mutex, time));
}
bool PythonQtWrapper_QWaitCondition::wait(QWaitCondition* theWrappedObject, QReadWriteLock* readWriteLock, unsigned long time)
{
return ( theWrappedObject->wait(readWriteLock, time));
}
void PythonQtWrapper_QWaitCondition::wakeAll(QWaitCondition* theWrappedObject)
{
( theWrappedObject->wakeAll());
}
void PythonQtWrapper_QWaitCondition::wakeOne(QWaitCondition* theWrappedObject)
{
( theWrappedObject->wakeOne());
}
QString PythonQtShell_QXmlStreamEntityResolver::resolveEntity(const QString& publicId, const QString& systemId)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resolveEntity");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"QString" , "const QString&" , "const QString&"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
QString returnValue;
void* args[3] = {NULL, (void*)&publicId, (void*)&systemId};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("resolveEntity", methodInfo, result);
} else {
returnValue = *((QString*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QXmlStreamEntityResolver::resolveEntity(publicId, systemId);
}
QString PythonQtShell_QXmlStreamEntityResolver::resolveUndeclaredEntity(const QString& name)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resolveUndeclaredEntity");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"QString" , "const QString&"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
QString returnValue;
void* args[2] = {NULL, (void*)&name};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("resolveUndeclaredEntity", methodInfo, result);
} else {
returnValue = *((QString*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QXmlStreamEntityResolver::resolveUndeclaredEntity(name);
}
QXmlStreamEntityResolver* PythonQtWrapper_QXmlStreamEntityResolver::new_QXmlStreamEntityResolver()
{
return new PythonQtShell_QXmlStreamEntityResolver(); }
QString PythonQtWrapper_QXmlStreamEntityResolver::resolveEntity(QXmlStreamEntityResolver* theWrappedObject, const QString& publicId, const QString& systemId)
{
return ( ((PythonQtPublicPromoter_QXmlStreamEntityResolver*)theWrappedObject)->promoted_resolveEntity(publicId, systemId));
}
QString PythonQtWrapper_QXmlStreamEntityResolver::resolveUndeclaredEntity(QXmlStreamEntityResolver* theWrappedObject, const QString& name)
{
return ( ((PythonQtPublicPromoter_QXmlStreamEntityResolver*)theWrappedObject)->promoted_resolveUndeclaredEntity(name));
}

View File

@ -1,257 +0,0 @@
#include <PythonQt.h>
#include <QObject>
#include <QVariant>
#include <qanimationgroup.h>
#include <qbytearray.h>
#include <qcoreevent.h>
#include <qdatastream.h>
#include <qeasingcurve.h>
#include <qlist.h>
#include <qmutex.h>
#include <qobject.h>
#include <qpair.h>
#include <qreadwritelock.h>
#include <qtconcurrentexception.h>
#include <qtconcurrentreducekernel.h>
#include <qtconcurrentthreadengine.h>
#include <qtranslator.h>
#include <quuid.h>
#include <qvariantanimation.h>
#include <qvector.h>
#include <qwaitcondition.h>
#include <qxmlstream.h>
class PythonQtShell_QTimerEvent : public QTimerEvent
{
public:
PythonQtShell_QTimerEvent(int timerId):QTimerEvent(timerId),_wrapper(NULL) {};
PythonQtInstanceWrapper* _wrapper;
};
class PythonQtWrapper_QTimerEvent : public QObject
{ Q_OBJECT
public:
public slots:
QTimerEvent* new_QTimerEvent(int timerId);
void delete_QTimerEvent(QTimerEvent* obj) { delete obj; }
int timerId(QTimerEvent* theWrappedObject) const;
};
class PythonQtShell_QTranslator : public QTranslator
{
public:
PythonQtShell_QTranslator(QObject* parent = 0):QTranslator(parent),_wrapper(NULL) {};
virtual void childEvent(QChildEvent* arg__1);
virtual void customEvent(QEvent* arg__1);
virtual bool event(QEvent* arg__1);
virtual bool eventFilter(QObject* arg__1, QEvent* arg__2);
virtual bool isEmpty() const;
virtual void timerEvent(QTimerEvent* arg__1);
virtual QString translate(const char* context, const char* sourceText, const char* disambiguation = 0) const;
PythonQtInstanceWrapper* _wrapper;
};
class PythonQtPublicPromoter_QTranslator : public QTranslator
{ public:
inline bool promoted_isEmpty() const { return QTranslator::isEmpty(); }
inline QString promoted_translate(const char* context, const char* sourceText, const char* disambiguation = 0) const { return QTranslator::translate(context, sourceText, disambiguation); }
};
class PythonQtWrapper_QTranslator : public QObject
{ Q_OBJECT
public:
public slots:
QTranslator* new_QTranslator(QObject* parent = 0);
void delete_QTranslator(QTranslator* obj) { delete obj; }
bool isEmpty(QTranslator* theWrappedObject) const;
bool load(QTranslator* theWrappedObject, const QString& filename, const QString& directory = QString(), const QString& search_delimiters = QString(), const QString& suffix = QString());
bool load(QTranslator* theWrappedObject, const uchar* data, int len);
QString translate(QTranslator* theWrappedObject, const char* context, const char* sourceText, const char* disambiguation = 0) const;
};
class PythonQtShell_QUuid : public QUuid
{
public:
PythonQtShell_QUuid():QUuid(),_wrapper(NULL) {};
PythonQtShell_QUuid(const QString& arg__1):QUuid(arg__1),_wrapper(NULL) {};
PythonQtShell_QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8):QUuid(l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8),_wrapper(NULL) {};
PythonQtInstanceWrapper* _wrapper;
};
class PythonQtWrapper_QUuid : public QObject
{ Q_OBJECT
public:
Q_ENUMS(Variant Version )
enum Variant{
VarUnknown = QUuid::VarUnknown, NCS = QUuid::NCS, DCE = QUuid::DCE, Microsoft = QUuid::Microsoft, Reserved = QUuid::Reserved};
enum Version{
VerUnknown = QUuid::VerUnknown, Time = QUuid::Time, EmbeddedPOSIX = QUuid::EmbeddedPOSIX, Name = QUuid::Name, Random = QUuid::Random};
public slots:
QUuid* new_QUuid();
QUuid* new_QUuid(const QString& arg__1);
QUuid* new_QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8);
QUuid* new_QUuid(const QUuid& other) {
PythonQtShell_QUuid* a = new PythonQtShell_QUuid();
*((QUuid*)a) = other;
return a; }
void delete_QUuid(QUuid* obj) { delete obj; }
QUuid static_QUuid_createUuid();
bool isNull(QUuid* theWrappedObject) const;
bool __ne__(QUuid* theWrappedObject, const QUuid& orig) const;
bool __lt__(QUuid* theWrappedObject, const QUuid& other) const;
void writeTo(QUuid* theWrappedObject, QDataStream& arg__1);
bool __eq__(QUuid* theWrappedObject, const QUuid& orig) const;
bool __gt__(QUuid* theWrappedObject, const QUuid& other) const;
void readFrom(QUuid* theWrappedObject, QDataStream& arg__1);
QString toString(QUuid* theWrappedObject) const;
QUuid::Variant variant(QUuid* theWrappedObject) const;
QUuid::Version version(QUuid* theWrappedObject) const;
QString py_toString(QUuid*);
bool __nonzero__(QUuid* obj) { return !obj->isNull(); }
void py_set_data1(QUuid* theWrappedObject, uint data1){ theWrappedObject->data1 = data1; }
uint py_get_data1(QUuid* theWrappedObject){ return theWrappedObject->data1; }
void py_set_data2(QUuid* theWrappedObject, ushort data2){ theWrappedObject->data2 = data2; }
ushort py_get_data2(QUuid* theWrappedObject){ return theWrappedObject->data2; }
void py_set_data3(QUuid* theWrappedObject, ushort data3){ theWrappedObject->data3 = data3; }
ushort py_get_data3(QUuid* theWrappedObject){ return theWrappedObject->data3; }
};
class PythonQtShell_QVariantAnimation : public QVariantAnimation
{
public:
PythonQtShell_QVariantAnimation(QObject* parent = 0):QVariantAnimation(parent),_wrapper(NULL) {};
virtual void childEvent(QChildEvent* arg__1);
virtual void customEvent(QEvent* arg__1);
virtual int duration() const;
virtual bool event(QEvent* event);
virtual bool eventFilter(QObject* arg__1, QEvent* arg__2);
virtual QVariant interpolated(const QVariant& from, const QVariant& to, qreal progress) const;
virtual void timerEvent(QTimerEvent* arg__1);
virtual void updateCurrentTime(int arg__1);
virtual void updateCurrentValue(const QVariant& value);
virtual void updateDirection(QAbstractAnimation::Direction direction);
virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
PythonQtInstanceWrapper* _wrapper;
};
class PythonQtPublicPromoter_QVariantAnimation : public QVariantAnimation
{ public:
inline int promoted_duration() const { return QVariantAnimation::duration(); }
inline bool promoted_event(QEvent* event) { return QVariantAnimation::event(event); }
inline QVariant promoted_interpolated(const QVariant& from, const QVariant& to, qreal progress) const { return QVariantAnimation::interpolated(from, to, progress); }
inline void promoted_updateCurrentTime(int arg__1) { QVariantAnimation::updateCurrentTime(arg__1); }
inline void promoted_updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) { QVariantAnimation::updateState(newState, oldState); }
};
class PythonQtWrapper_QVariantAnimation : public QObject
{ Q_OBJECT
public:
public slots:
QVariantAnimation* new_QVariantAnimation(QObject* parent = 0);
void delete_QVariantAnimation(QVariantAnimation* obj) { delete obj; }
QVariant currentValue(QVariantAnimation* theWrappedObject) const;
int duration(QVariantAnimation* theWrappedObject) const;
QEasingCurve easingCurve(QVariantAnimation* theWrappedObject) const;
QVariant endValue(QVariantAnimation* theWrappedObject) const;
bool event(QVariantAnimation* theWrappedObject, QEvent* event);
QVariant interpolated(QVariantAnimation* theWrappedObject, const QVariant& from, const QVariant& to, qreal progress) const;
QVariant keyValueAt(QVariantAnimation* theWrappedObject, qreal step) const;
QVector<QPair<qreal , QVariant > > keyValues(QVariantAnimation* theWrappedObject) const;
void setDuration(QVariantAnimation* theWrappedObject, int msecs);
void setEasingCurve(QVariantAnimation* theWrappedObject, const QEasingCurve& easing);
void setEndValue(QVariantAnimation* theWrappedObject, const QVariant& value);
void setKeyValueAt(QVariantAnimation* theWrappedObject, qreal step, const QVariant& value);
void setKeyValues(QVariantAnimation* theWrappedObject, const QVector<QPair<qreal , QVariant > >& values);
void setStartValue(QVariantAnimation* theWrappedObject, const QVariant& value);
QVariant startValue(QVariantAnimation* theWrappedObject) const;
void updateCurrentTime(QVariantAnimation* theWrappedObject, int arg__1);
void updateState(QVariantAnimation* theWrappedObject, QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
};
class PythonQtWrapper_QWaitCondition : public QObject
{ Q_OBJECT
public:
public slots:
QWaitCondition* new_QWaitCondition();
void delete_QWaitCondition(QWaitCondition* obj) { delete obj; }
bool wait(QWaitCondition* theWrappedObject, QMutex* mutex, unsigned long time = 0xffffffffUL);
bool wait(QWaitCondition* theWrappedObject, QReadWriteLock* readWriteLock, unsigned long time = 0xffffffffUL);
void wakeAll(QWaitCondition* theWrappedObject);
void wakeOne(QWaitCondition* theWrappedObject);
};
class PythonQtShell_QXmlStreamEntityResolver : public QXmlStreamEntityResolver
{
public:
PythonQtShell_QXmlStreamEntityResolver():QXmlStreamEntityResolver(),_wrapper(NULL) {};
virtual QString resolveEntity(const QString& publicId, const QString& systemId);
virtual QString resolveUndeclaredEntity(const QString& name);
PythonQtInstanceWrapper* _wrapper;
};
class PythonQtPublicPromoter_QXmlStreamEntityResolver : public QXmlStreamEntityResolver
{ public:
inline QString promoted_resolveEntity(const QString& publicId, const QString& systemId) { return QXmlStreamEntityResolver::resolveEntity(publicId, systemId); }
inline QString promoted_resolveUndeclaredEntity(const QString& name) { return QXmlStreamEntityResolver::resolveUndeclaredEntity(name); }
};
class PythonQtWrapper_QXmlStreamEntityResolver : public QObject
{ Q_OBJECT
public:
public slots:
QXmlStreamEntityResolver* new_QXmlStreamEntityResolver();
void delete_QXmlStreamEntityResolver(QXmlStreamEntityResolver* obj) { delete obj; }
QString resolveEntity(QXmlStreamEntityResolver* theWrappedObject, const QString& publicId, const QString& systemId);
QString resolveUndeclaredEntity(QXmlStreamEntityResolver* theWrappedObject, const QString& name);
};
class PythonQtWrapper_QtConcurrent : public QObject
{ Q_OBJECT
public:
Q_ENUMS(ReduceOption ThreadFunctionResult )
Q_FLAGS(ReduceOptions )
enum ReduceOption{
UnorderedReduce = QtConcurrent::UnorderedReduce, OrderedReduce = QtConcurrent::OrderedReduce, SequentialReduce = QtConcurrent::SequentialReduce};
enum ThreadFunctionResult{
ThrottleThread = QtConcurrent::ThrottleThread, ThreadFinished = QtConcurrent::ThreadFinished};
Q_DECLARE_FLAGS(ReduceOptions, ReduceOption)
public slots:
};

View File

@ -1,108 +0,0 @@
#include <PythonQt.h>
#include "com_trolltech_qt_core_init.h"
#include "com_trolltech_qt_core0.h"
#include "com_trolltech_qt_core1.h"
#include "com_trolltech_qt_core2.h"
static void* polymorphichandler_QEvent(const void *ptr, char **class_name)
{
Q_ASSERT(ptr != 0);
QEvent *object = (QEvent *)ptr;
if (object->type() == QEvent::None) {
*class_name = "QEvent";
return (QEvent*)object;
}
if (object->type() == QEvent::ChildAdded || object->type() == QEvent::ChildPolished || object->type() == QEvent::ChildRemoved) {
*class_name = "QChildEvent";
return (QChildEvent*)object;
}
if (object->type() == QEvent::StateMachineWrapped) {
*class_name = "QStateMachine_WrappedEvent";
return (QStateMachine::WrappedEvent*)object;
}
if (object->type() == QEvent::StateMachineSignal) {
*class_name = "QStateMachine_SignalEvent";
return (QStateMachine::SignalEvent*)object;
}
if (object->type() == QEvent::Timer) {
*class_name = "QTimerEvent";
return (QTimerEvent*)object;
}
if (object->type() == QEvent::DynamicPropertyChange) {
*class_name = "QDynamicPropertyChangeEvent";
return (QDynamicPropertyChangeEvent*)object;
}
return NULL;
}
void PythonQt_init_QtCore(PyObject* module) {
PythonQt::priv()->registerClass(&QAbstractAnimation::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QAbstractAnimation>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractAnimation>, module, 0);
PythonQt::priv()->registerClass(&QAbstractItemModel::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QAbstractItemModel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractItemModel>, module, 0);
PythonQt::priv()->registerClass(&QAbstractListModel::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QAbstractListModel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractListModel>, module, 0);
PythonQt::priv()->registerClass(&QAbstractState::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QAbstractState>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractState>, module, 0);
PythonQt::priv()->registerClass(&QAbstractTransition::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QAbstractTransition>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractTransition>, module, 0);
PythonQt::priv()->registerClass(&QAnimationGroup::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QAnimationGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAnimationGroup>, module, 0);
PythonQt::priv()->registerCPPClass("QBasicTimer", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QBasicTimer>, NULL, module, 0);
PythonQt::priv()->registerClass(&QBuffer::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QBuffer>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QBuffer>, module, 0);
PythonQt::priv()->registerCPPClass("QByteArrayMatcher", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QByteArrayMatcher>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QChildEvent", "QEvent", "QtCore", PythonQtCreateObject<PythonQtWrapper_QChildEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QChildEvent>, module, 0);
PythonQt::priv()->registerClass(&QCoreApplication::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QCoreApplication>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCoreApplication>, module, 0);
PythonQt::priv()->registerCPPClass("QCryptographicHash", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QCryptographicHash>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QDataStream", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QDataStream>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDataStream>, module, 0);
PythonQt::priv()->registerCPPClass("QDir", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QDir>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QDirIterator", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QDirIterator>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDirIterator>, module, 0);
PythonQt::priv()->registerCPPClass("QDynamicPropertyChangeEvent", "QEvent", "QtCore", PythonQtCreateObject<PythonQtWrapper_QDynamicPropertyChangeEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QEasingCurve", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QEasingCurve>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QEvent", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QEvent>, module, 0);
PythonQt::priv()->registerClass(&QEventLoop::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QEventLoop>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QEventLoop>, module, 0);
PythonQt::priv()->registerClass(&QEventTransition::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QEventTransition>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QEventTransition>, module, 0);
PythonQt::priv()->registerCPPClass("QFactoryInterface", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QFactoryInterface>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFactoryInterface>, module, 0);
PythonQt::priv()->registerClass(&QFile::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QFile>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFile>, module, 0);
PythonQt::priv()->registerCPPClass("QFileInfo", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QFileInfo>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QFileSystemWatcher::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QFileSystemWatcher>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFileSystemWatcher>, module, 0);
PythonQt::priv()->registerClass(&QFinalState::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QFinalState>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFinalState>, module, 0);
PythonQt::priv()->registerClass(&QHistoryState::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QHistoryState>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHistoryState>, module, 0);
PythonQt::priv()->registerClass(&QIODevice::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QIODevice>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QIODevice>, module, 0);
PythonQt::priv()->registerCPPClass("QLibraryInfo", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QLibraryInfo>, NULL, module, 0);
PythonQt::priv()->registerClass(&QMimeData::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QMimeData>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMimeData>, module, 0);
PythonQt::priv()->registerCPPClass("QModelIndex", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QModelIndex>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QMutex", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QMutex>, NULL, module, 0);
PythonQt::priv()->registerClass(&QObject::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QObject>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QObject>, module, 0);
PythonQt::priv()->registerClass(&QParallelAnimationGroup::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QParallelAnimationGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QParallelAnimationGroup>, module, 0);
PythonQt::priv()->registerClass(&QPauseAnimation::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QPauseAnimation>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPauseAnimation>, module, 0);
PythonQt::priv()->registerClass(&QProcess::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QProcess>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QProcess>, module, 0);
PythonQt::priv()->registerCPPClass("QProcessEnvironment", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QProcessEnvironment>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QPropertyAnimation::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QPropertyAnimation>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPropertyAnimation>, module, 0);
PythonQt::priv()->registerCPPClass("QReadWriteLock", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QReadWriteLock>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QRunnable", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QRunnable>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QRunnable>, module, 0);
PythonQt::priv()->registerCPPClass("QSemaphore", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QSemaphore>, NULL, module, 0);
PythonQt::priv()->registerClass(&QSequentialAnimationGroup::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QSequentialAnimationGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSequentialAnimationGroup>, module, 0);
PythonQt::priv()->registerClass(&QSettings::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QSettings>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSettings>, module, 0);
PythonQt::priv()->registerClass(&QSignalMapper::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QSignalMapper>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSignalMapper>, module, 0);
PythonQt::priv()->registerClass(&QSignalTransition::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QSignalTransition>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSignalTransition>, module, 0);
PythonQt::priv()->registerClass(&QSocketNotifier::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QSocketNotifier>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSocketNotifier>, module, 0);
PythonQt::priv()->registerClass(&QState::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QState>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QState>, module, 0);
PythonQt::priv()->registerClass(&QStateMachine::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QStateMachine>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStateMachine>, module, 0);
PythonQt::priv()->registerCPPClass("QStateMachine::SignalEvent", "QEvent", "QtCore", PythonQtCreateObject<PythonQtWrapper_QStateMachine_SignalEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QStateMachine::WrappedEvent", "QEvent", "QtCore", PythonQtCreateObject<PythonQtWrapper_QStateMachine_WrappedEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QStringMatcher", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QStringMatcher>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QSystemSemaphore", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QSystemSemaphore>, NULL, module, 0);
PythonQt::priv()->registerClass(&QTemporaryFile::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QTemporaryFile>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTemporaryFile>, module, 0);
PythonQt::priv()->registerCPPClass("QTextBoundaryFinder", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTextBoundaryFinder>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTextCodec", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTextCodec>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextCodec>, module, 0);
PythonQt::priv()->registerCPPClass("QTextDecoder", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTextDecoder>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTextEncoder", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTextEncoder>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTextStream", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTextStream>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextStream>, module, 0);
PythonQt::priv()->registerClass(&QThreadPool::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QThreadPool>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QThreadPool>, module, 0);
PythonQt::priv()->registerClass(&QTimeLine::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QTimeLine>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTimeLine>, module, 0);
PythonQt::priv()->registerClass(&QTimer::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QTimer>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTimer>, module, 0);
PythonQt::priv()->registerCPPClass("QTimerEvent", "QEvent", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTimerEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTimerEvent>, module, 0);
PythonQt::priv()->registerClass(&QTranslator::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QTranslator>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTranslator>, module, 0);
PythonQt::priv()->registerCPPClass("QUuid", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QUuid>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUuid>, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QVariantAnimation::staticMetaObject, "QtCore", PythonQtCreateObject<PythonQtWrapper_QVariantAnimation>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QVariantAnimation>, module, 0);
PythonQt::priv()->registerCPPClass("QWaitCondition", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QWaitCondition>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QXmlStreamEntityResolver", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QXmlStreamEntityResolver>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QXmlStreamEntityResolver>, module, 0);
PythonQt::priv()->registerCPPClass("QtConcurrent", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QtConcurrent>, NULL, module, 0);
PythonQt::self()->addPolymorphicHandler("QEvent", polymorphichandler_QEvent);
}

View File

@ -1,8 +0,0 @@
#ifndef COM_TROLLTECH_QT_CORE_INIT_H
#define COM_TROLLTECH_QT_CORE_INIT_H
#include "PythonQtSystem.h"
PYTHONQT_EXPORT void PythonQt_init_QtCore(PyObject* module);
#endif // COM_TROLLTECH_QT_CORE_INIT_H

View File

@ -1,6 +0,0 @@
HEADERS += \
$$PWD/com_trolltech_qt_core_builtin0.h \
SOURCES += \
$$PWD/com_trolltech_qt_core_builtin0.cpp \
$$PWD/com_trolltech_qt_core_builtin_init.cpp

File diff suppressed because one or more lines are too long

View File

@ -1,23 +0,0 @@
#include <PythonQt.h>
#include "com_trolltech_qt_core_builtin0.h"
void PythonQt_init_QtCoreBuiltin(PyObject* module) {
PythonQt::priv()->registerCPPClass("QBitArray", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QBitArray>, NULL, module, PythonQt::Type_And|PythonQt::Type_NonZero|PythonQt::Type_InplaceXor|PythonQt::Type_InplaceOr|PythonQt::Type_Xor|PythonQt::Type_RichCompare|PythonQt::Type_Or|PythonQt::Type_InplaceAnd|PythonQt::Type_Invert);
PythonQt::priv()->registerCPPClass("QByteArray", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QByteArray>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QDate", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QDate>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QDateTime", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QDateTime>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QLine", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QLine>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare|PythonQt::Type_Multiply);
PythonQt::priv()->registerCPPClass("QLineF", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QLineF>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare|PythonQt::Type_Multiply);
PythonQt::priv()->registerCPPClass("QLocale", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QLocale>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QPoint", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QPoint>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QPointF", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QPointF>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QRect", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QRect>, NULL, module, PythonQt::Type_And|PythonQt::Type_NonZero|PythonQt::Type_InplaceOr|PythonQt::Type_RichCompare|PythonQt::Type_Or|PythonQt::Type_InplaceAnd);
PythonQt::priv()->registerCPPClass("QRectF", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QRectF>, NULL, module, PythonQt::Type_And|PythonQt::Type_NonZero|PythonQt::Type_InplaceOr|PythonQt::Type_RichCompare|PythonQt::Type_Or|PythonQt::Type_InplaceAnd);
PythonQt::priv()->registerCPPClass("QRegExp", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QRegExp>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QSize", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QSize>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QSizeF", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QSizeF>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QTime", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QTime>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QUrl", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_QUrl>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("Qt", "", "QtCore", PythonQtCreateObject<PythonQtWrapper_Qt>, NULL, module, 0);
}

View File

@ -1,26 +0,0 @@
HEADERS += \
$$PWD/com_trolltech_qt_gui0.h \
$$PWD/com_trolltech_qt_gui1.h \
$$PWD/com_trolltech_qt_gui2.h \
$$PWD/com_trolltech_qt_gui3.h \
$$PWD/com_trolltech_qt_gui4.h \
$$PWD/com_trolltech_qt_gui5.h \
$$PWD/com_trolltech_qt_gui6.h \
$$PWD/com_trolltech_qt_gui7.h \
$$PWD/com_trolltech_qt_gui8.h \
$$PWD/com_trolltech_qt_gui9.h \
$$PWD/com_trolltech_qt_gui10.h \
SOURCES += \
$$PWD/com_trolltech_qt_gui0.cpp \
$$PWD/com_trolltech_qt_gui1.cpp \
$$PWD/com_trolltech_qt_gui2.cpp \
$$PWD/com_trolltech_qt_gui3.cpp \
$$PWD/com_trolltech_qt_gui4.cpp \
$$PWD/com_trolltech_qt_gui5.cpp \
$$PWD/com_trolltech_qt_gui6.cpp \
$$PWD/com_trolltech_qt_gui7.cpp \
$$PWD/com_trolltech_qt_gui8.cpp \
$$PWD/com_trolltech_qt_gui9.cpp \
$$PWD/com_trolltech_qt_gui10.cpp \
$$PWD/com_trolltech_qt_gui_init.cpp

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,687 +0,0 @@
#include <PythonQt.h>
#include "com_trolltech_qt_gui_init.h"
#include "com_trolltech_qt_gui0.h"
#include "com_trolltech_qt_gui1.h"
#include "com_trolltech_qt_gui2.h"
#include "com_trolltech_qt_gui3.h"
#include "com_trolltech_qt_gui4.h"
#include "com_trolltech_qt_gui5.h"
#include "com_trolltech_qt_gui6.h"
#include "com_trolltech_qt_gui7.h"
#include "com_trolltech_qt_gui8.h"
#include "com_trolltech_qt_gui9.h"
#include "com_trolltech_qt_gui10.h"
static void* polymorphichandler_QStyleOption(const void *ptr, char **class_name)
{
Q_ASSERT(ptr != 0);
QStyleOption *object = (QStyleOption *)ptr;
if (object->type == QStyleOption::SO_Default) {
*class_name = "QStyleOption";
return (QStyleOption*)object;
}
if (object->type == QStyleOptionDockWidget::Type && object->version == QStyleOptionDockWidget::Version) {
*class_name = "QStyleOptionDockWidget";
return (QStyleOptionDockWidget*)object;
}
if (object->type == QStyleOptionToolBar::Type && object->version == QStyleOptionToolBar::Version) {
*class_name = "QStyleOptionToolBar";
return (QStyleOptionToolBar*)object;
}
if (object->type == QStyleOptionFrame::Type && object->version == QStyleOptionFrame::Version) {
*class_name = "QStyleOptionFrame";
return (QStyleOptionFrame*)object;
}
if (object->type == QStyleOptionComplex::Type && object->version == QStyleOptionComplex::Version) {
*class_name = "QStyleOptionComplex";
return (QStyleOptionComplex*)object;
}
if (object->type == QStyleOptionTab::Type && object->version == QStyleOptionTab::Version) {
*class_name = "QStyleOptionTab";
return (QStyleOptionTab*)object;
}
if (object->type == QStyleOptionProgressBar::Type && object->version == QStyleOptionProgressBar::Version) {
*class_name = "QStyleOptionProgressBar";
return (QStyleOptionProgressBar*)object;
}
if (object->type == QStyleOptionToolBox::Type && object->version == QStyleOptionToolBox::Version) {
*class_name = "QStyleOptionToolBox";
return (QStyleOptionToolBox*)object;
}
if (object->type == QStyleOptionGraphicsItem::Type && object->version == QStyleOptionGraphicsItem::Version) {
*class_name = "QStyleOptionGraphicsItem";
return (QStyleOptionGraphicsItem*)object;
}
if (object->type == QStyleOptionButton::Type && object->version == QStyleOptionButton::Version) {
*class_name = "QStyleOptionButton";
return (QStyleOptionButton*)object;
}
if (object->type == QStyleOptionFocusRect::Type && object->version == QStyleOptionFocusRect::Version) {
*class_name = "QStyleOptionFocusRect";
return (QStyleOptionFocusRect*)object;
}
if (object->type == QStyleOptionRubberBand::Type && object->version == QStyleOptionRubberBand::Version) {
*class_name = "QStyleOptionRubberBand";
return (QStyleOptionRubberBand*)object;
}
if (object->type == QStyleOptionMenuItem::Type && object->version == QStyleOptionMenuItem::Version) {
*class_name = "QStyleOptionMenuItem";
return (QStyleOptionMenuItem*)object;
}
if (object->type == QStyleOptionTabBarBase::Type && object->version == QStyleOptionTabBarBase::Version) {
*class_name = "QStyleOptionTabBarBase";
return (QStyleOptionTabBarBase*)object;
}
if (object->type == QStyleOptionViewItem::Type && object->version == QStyleOptionViewItem::Version) {
*class_name = "QStyleOptionViewItem";
return (QStyleOptionViewItem*)object;
}
if (object->type == QStyleOptionTabWidgetFrame::Type && object->version == QStyleOptionTabWidgetFrame::Version) {
*class_name = "QStyleOptionTabWidgetFrame";
return (QStyleOptionTabWidgetFrame*)object;
}
if (object->type == QStyleOptionHeader::Type && object->version == QStyleOptionHeader::Version) {
*class_name = "QStyleOptionHeader";
return (QStyleOptionHeader*)object;
}
if (object->type == QStyleOptionSpinBox::Type && object->version == QStyleOptionSpinBox::Version) {
*class_name = "QStyleOptionSpinBox";
return (QStyleOptionSpinBox*)object;
}
if (object->type == QStyleOptionProgressBarV2::Type && object->version == QStyleOptionProgressBarV2::Version) {
*class_name = "QStyleOptionProgressBarV2";
return (QStyleOptionProgressBarV2*)object;
}
if (object->type == QStyleOptionDockWidgetV2::Type && object->version == QStyleOptionDockWidgetV2::Version) {
*class_name = "QStyleOptionDockWidgetV2";
return (QStyleOptionDockWidgetV2*)object;
}
if (object->type == QStyleOptionTabV2::Type && object->version == QStyleOptionTabV2::Version) {
*class_name = "QStyleOptionTabV2";
return (QStyleOptionTabV2*)object;
}
if (object->type == QStyleOptionToolButton::Type && object->version == QStyleOptionToolButton::Version) {
*class_name = "QStyleOptionToolButton";
return (QStyleOptionToolButton*)object;
}
if (object->type == QStyleOptionFrameV2::Type && object->version == QStyleOptionFrameV2::Version) {
*class_name = "QStyleOptionFrameV2";
return (QStyleOptionFrameV2*)object;
}
if (object->type == QStyleOptionViewItemV2::Type && object->version == QStyleOptionViewItemV2::Version) {
*class_name = "QStyleOptionViewItemV2";
return (QStyleOptionViewItemV2*)object;
}
if (object->type == QStyleOptionTitleBar::Type && object->version == QStyleOptionTitleBar::Version) {
*class_name = "QStyleOptionTitleBar";
return (QStyleOptionTitleBar*)object;
}
if (object->type == QStyleOptionTabBarBaseV2::Type && object->version == QStyleOptionTabBarBaseV2::Version) {
*class_name = "QStyleOptionTabBarBaseV2";
return (QStyleOptionTabBarBaseV2*)object;
}
if (object->type == QStyleOptionSlider::Type && object->version == QStyleOptionSlider::Version) {
*class_name = "QStyleOptionSlider";
return (QStyleOptionSlider*)object;
}
if (object->type == QStyleOptionToolBoxV2::Type && object->version == QStyleOptionToolBoxV2::Version) {
*class_name = "QStyleOptionToolBoxV2";
return (QStyleOptionToolBoxV2*)object;
}
if (object->type == QStyleOptionComboBox::Type && object->version == QStyleOptionComboBox::Version) {
*class_name = "QStyleOptionComboBox";
return (QStyleOptionComboBox*)object;
}
if (object->type == QStyleOptionSizeGrip::Type && object->version == QStyleOptionSizeGrip::Version) {
*class_name = "QStyleOptionSizeGrip";
return (QStyleOptionSizeGrip*)object;
}
if (object->type == QStyleOptionGroupBox::Type && object->version == QStyleOptionGroupBox::Version) {
*class_name = "QStyleOptionGroupBox";
return (QStyleOptionGroupBox*)object;
}
if (object->type == QStyleOptionViewItemV3::Type && object->version == QStyleOptionViewItemV3::Version) {
*class_name = "QStyleOptionViewItemV3";
return (QStyleOptionViewItemV3*)object;
}
if (object->type == QStyleOptionTabV3::Type && object->version == QStyleOptionTabV3::Version) {
*class_name = "QStyleOptionTabV3";
return (QStyleOptionTabV3*)object;
}
if (object->type == QStyleOptionFrameV3::Type && object->version == QStyleOptionFrameV3::Version) {
*class_name = "QStyleOptionFrameV3";
return (QStyleOptionFrameV3*)object;
}
if (object->type == QStyleOptionViewItemV4::Type && object->version == QStyleOptionViewItemV4::Version) {
*class_name = "QStyleOptionViewItemV4";
return (QStyleOptionViewItemV4*)object;
}
return NULL;
}
static void* polymorphichandler_QGradient(const void *ptr, char **class_name)
{
Q_ASSERT(ptr != 0);
QGradient *object = (QGradient *)ptr;
if (object->type() == QGradient::NoGradient) {
*class_name = "QGradient";
return (QGradient*)object;
}
if (object->type() == QGradient::LinearGradient) {
*class_name = "QLinearGradient";
return (QLinearGradient*)object;
}
if (object->type() == QGradient::ConicalGradient) {
*class_name = "QConicalGradient";
return (QConicalGradient*)object;
}
if (object->type() == QGradient::RadialGradient) {
*class_name = "QRadialGradient";
return (QRadialGradient*)object;
}
return NULL;
}
static void* polymorphichandler_QEvent(const void *ptr, char **class_name)
{
Q_ASSERT(ptr != 0);
QEvent *object = (QEvent *)ptr;
if (object->type() == QEvent::FocusIn || object->type() == QEvent::FocusOut) {
*class_name = "QFocusEvent";
return (QFocusEvent*)object;
}
if (object->type() == QEvent::WhatsThisClicked) {
*class_name = "QWhatsThisClickedEvent";
return (QWhatsThisClickedEvent*)object;
}
if (object->type() == QEvent::Move) {
*class_name = "QMoveEvent";
return (QMoveEvent*)object;
}
if (object->type() == QEvent::HoverEnter || object->type() == QEvent::HoverLeave || object->type() == QEvent::HoverMove) {
*class_name = "QHoverEvent";
return (QHoverEvent*)object;
}
if (object->type() == QEvent::DragResponse) {
*class_name = "QDragResponseEvent";
return (QDragResponseEvent*)object;
}
if (object->type() == QEvent::DragLeave) {
*class_name = "QDragLeaveEvent";
return (QDragLeaveEvent*)object;
}
if (object->type() == QEvent::ToolTip || object->type() == QEvent::WhatsThis) {
*class_name = "QHelpEvent";
return (QHelpEvent*)object;
}
if (object->type() == QEvent::FileOpen) {
*class_name = "QFileOpenEvent";
return (QFileOpenEvent*)object;
}
if (object->type() == QEvent::Clipboard) {
*class_name = "QClipboardEvent";
return (QClipboardEvent*)object;
}
if (object->type() == QEvent::StatusTip) {
*class_name = "QStatusTipEvent";
return (QStatusTipEvent*)object;
}
if (object->type() == QEvent::IconDrag) {
*class_name = "QIconDragEvent";
return (QIconDragEvent*)object;
}
if (object->type() == QEvent::Paint) {
*class_name = "QPaintEvent";
return (QPaintEvent*)object;
}
if (object->type() == QEvent::Hide) {
*class_name = "QHideEvent";
return (QHideEvent*)object;
}
if (object->type() == QEvent::ToolBarChange) {
*class_name = "QToolBarChangeEvent";
return (QToolBarChangeEvent*)object;
}
if (object->type() == QEvent::ActionAdded || object->type() == QEvent::ActionRemoved || object->type() == QEvent::ActionChanged) {
*class_name = "QActionEvent";
return (QActionEvent*)object;
}
if (object->type() == QEvent::WindowStateChange) {
*class_name = "QWindowStateChangeEvent";
return (QWindowStateChangeEvent*)object;
}
if (object->type() == QEvent::Shortcut) {
*class_name = "QShortcutEvent";
return (QShortcutEvent*)object;
}
if (object->type() == QEvent::Close) {
*class_name = "QCloseEvent";
return (QCloseEvent*)object;
}
if (object->type() == QEvent::Show) {
*class_name = "QShowEvent";
return (QShowEvent*)object;
}
if (object->type() == QEvent::AccessibilityDescription || object->type() == QEvent::AccessibilityHelp) {
*class_name = "QAccessibleEvent";
return (QAccessibleEvent*)object;
}
if (object->type() == QEvent::Resize) {
*class_name = "QResizeEvent";
return (QResizeEvent*)object;
}
if (object->type() == QEvent::Drop) {
*class_name = "QDropEvent";
return (QDropEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneHoverEnter || object->type() == QEvent::GraphicsSceneHoverLeave || object->type() == QEvent::GraphicsSceneHoverMove) {
*class_name = "QGraphicsSceneHoverEvent";
return (QGraphicsSceneHoverEvent*)object;
}
if (object->type() == QEvent::KeyPress || object->type() == QEvent::KeyRelease) {
*class_name = "QKeyEvent";
return (QKeyEvent*)object;
}
if (object->type() == QEvent::MouseButtonDblClick || object->type() == QEvent::MouseButtonPress || object->type() == QEvent::MouseButtonRelease || object->type() == QEvent::MouseMove) {
*class_name = "QMouseEvent";
return (QMouseEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneHelp) {
*class_name = "QGraphicsSceneHelpEvent";
return (QGraphicsSceneHelpEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneMouseDoubleClick || object->type() == QEvent::GraphicsSceneMouseMove || object->type() == QEvent::GraphicsSceneMousePress || object->type() == QEvent::GraphicsSceneMouseRelease) {
*class_name = "QGraphicsSceneMouseEvent";
return (QGraphicsSceneMouseEvent*)object;
}
if (object->type() == QEvent::TouchBegin || object->type() == QEvent::TouchUpdate || object->type() == QEvent::TouchEnd) {
*class_name = "QTouchEvent";
return (QTouchEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneDragEnter || object->type() == QEvent::GraphicsSceneDragLeave || object->type() == QEvent::GraphicsSceneDragMove || object->type() == QEvent::GraphicsSceneDrop) {
*class_name = "QGraphicsSceneDragDropEvent";
return (QGraphicsSceneDragDropEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneResize) {
*class_name = "QGraphicsSceneResizeEvent";
return (QGraphicsSceneResizeEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneMove) {
*class_name = "QGraphicsSceneMoveEvent";
return (QGraphicsSceneMoveEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneContextMenu) {
*class_name = "QGraphicsSceneContextMenuEvent";
return (QGraphicsSceneContextMenuEvent*)object;
}
if (object->type() == QEvent::DragMove) {
*class_name = "QDragMoveEvent";
return (QDragMoveEvent*)object;
}
if (object->type() == QEvent::TabletMove || object->type() == QEvent::TabletPress || object->type() == QEvent::TabletRelease) {
*class_name = "QTabletEvent";
return (QTabletEvent*)object;
}
if (object->type() == QEvent::Wheel) {
*class_name = "QWheelEvent";
return (QWheelEvent*)object;
}
if (object->type() == QEvent::ContextMenu) {
*class_name = "QContextMenuEvent";
return (QContextMenuEvent*)object;
}
if (object->type() == QEvent::GraphicsSceneWheel) {
*class_name = "QGraphicsSceneWheelEvent";
return (QGraphicsSceneWheelEvent*)object;
}
if (object->type() == QEvent::DragEnter) {
*class_name = "QDragEnterEvent";
return (QDragEnterEvent*)object;
}
return NULL;
}
void PythonQt_init_QtGui(PyObject* module) {
PythonQt::priv()->registerClass(&QAbstractButton::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractButton>, module, 0);
PythonQt::priv()->registerCPPClass("QAbstractGraphicsShapeItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractGraphicsShapeItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractGraphicsShapeItem>, module, 0);
PythonQt::self()->addParentClass("QAbstractGraphicsShapeItem", "QGraphicsItem",PythonQtUpcastingOffset<QAbstractGraphicsShapeItem,QGraphicsItem>());
PythonQt::priv()->registerClass(&QAbstractItemDelegate::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractItemDelegate>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractItemDelegate>, module, 0);
PythonQt::priv()->registerClass(&QAbstractItemView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractItemView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractItemView>, module, 0);
PythonQt::priv()->registerClass(&QAbstractPageSetupDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractPageSetupDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractPageSetupDialog>, module, 0);
PythonQt::priv()->registerClass(&QAbstractPrintDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractPrintDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractPrintDialog>, module, 0);
PythonQt::priv()->registerClass(&QAbstractScrollArea::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractScrollArea>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractScrollArea>, module, 0);
PythonQt::priv()->registerClass(&QAbstractSlider::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractSlider>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractSlider>, module, 0);
PythonQt::priv()->registerClass(&QAbstractSpinBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractSpinBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractSpinBox>, module, 0);
PythonQt::priv()->registerClass(&QAbstractTableModel::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAbstractTableModel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractTableModel>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessible", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessible>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessible>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessible2Interface", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessible2Interface>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessible2Interface>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleBridge", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleBridge>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleBridge>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleInterface", "QAccessible", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleInterface>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleInterface>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleInterfaceEx", "QAccessibleInterface", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleInterfaceEx>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleInterfaceEx>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleObject", "QAccessibleInterface", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleObject>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleObject>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleObjectEx", "QAccessibleInterfaceEx", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleObjectEx>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleObjectEx>, module, 0);
PythonQt::priv()->registerClass(&QAccessiblePlugin::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessiblePlugin>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessiblePlugin>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleTableInterface", "QAccessible2Interface", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleTableInterface>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleTableInterface>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleWidget", "QAccessibleObject", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QAccessibleWidgetEx", "QAccessibleObjectEx", "QtGui", PythonQtCreateObject<PythonQtWrapper_QAccessibleWidgetEx>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAccessibleWidgetEx>, module, 0);
PythonQt::priv()->registerClass(&QAction::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QAction>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAction>, module, 0);
PythonQt::priv()->registerCPPClass("QActionEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QActionEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QActionGroup::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QActionGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QActionGroup>, module, 0);
PythonQt::priv()->registerClass(&QApplication::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QApplication>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QApplication>, module, 0);
PythonQt::priv()->registerClass(&QBoxLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QBoxLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QBoxLayout>, module, 0);
PythonQt::priv()->registerClass(&QButtonGroup::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QButtonGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QButtonGroup>, module, 0);
PythonQt::priv()->registerClass(&QCDEStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCDEStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCDEStyle>, module, 0);
PythonQt::priv()->registerClass(&QCalendarWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCalendarWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCalendarWidget>, module, 0);
PythonQt::priv()->registerClass(&QCheckBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCheckBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCheckBox>, module, 0);
PythonQt::priv()->registerClass(&QCleanlooksStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCleanlooksStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCleanlooksStyle>, module, 0);
PythonQt::priv()->registerClass(&QClipboard::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QClipboard>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QClipboardEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QClipboardEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QCloseEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QCloseEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QColorDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QColorDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QColorDialog>, module, 0);
PythonQt::priv()->registerClass(&QColumnView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QColumnView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QColumnView>, module, 0);
PythonQt::priv()->registerClass(&QComboBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QComboBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QComboBox>, module, 0);
PythonQt::priv()->registerClass(&QCommandLinkButton::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCommandLinkButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCommandLinkButton>, module, 0);
PythonQt::priv()->registerClass(&QCommonStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCommonStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCommonStyle>, module, 0);
PythonQt::priv()->registerClass(&QCompleter::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QCompleter>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QCompleter>, module, 0);
PythonQt::priv()->registerCPPClass("QConicalGradient", "QGradient", "QtGui", PythonQtCreateObject<PythonQtWrapper_QConicalGradient>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QContextMenuEvent", "QInputEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QContextMenuEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QContextMenuEvent>, module, 0);
PythonQt::priv()->registerClass(&QDataWidgetMapper::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDataWidgetMapper>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDataWidgetMapper>, module, 0);
PythonQt::priv()->registerClass(&QDateEdit::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDateEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDateEdit>, module, 0);
PythonQt::priv()->registerClass(&QDateTimeEdit::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDateTimeEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDateTimeEdit>, module, 0);
PythonQt::priv()->registerCPPClass("QDesktopServices", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QDesktopServices>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDesktopServices>, module, 0);
PythonQt::priv()->registerClass(&QDesktopWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDesktopWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDesktopWidget>, module, 0);
PythonQt::priv()->registerClass(&QDial::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDial>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDial>, module, 0);
PythonQt::priv()->registerClass(&QDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDialog>, module, 0);
PythonQt::priv()->registerClass(&QDialogButtonBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDialogButtonBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDialogButtonBox>, module, 0);
PythonQt::priv()->registerClass(&QDockWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDockWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDockWidget>, module, 0);
PythonQt::priv()->registerClass(&QDoubleSpinBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDoubleSpinBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDoubleSpinBox>, module, 0);
PythonQt::priv()->registerClass(&QDoubleValidator::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDoubleValidator>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDoubleValidator>, module, 0);
PythonQt::priv()->registerClass(&QDrag::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QDrag>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDrag>, module, 0);
PythonQt::priv()->registerCPPClass("QDragEnterEvent", "QDragMoveEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QDragEnterEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QDragLeaveEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QDragLeaveEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QDragMoveEvent", "QDropEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QDragMoveEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDragMoveEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QDragResponseEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QDragResponseEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDragResponseEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QDropEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QDropEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QDropEvent>, module, 0);
PythonQt::priv()->registerClass(&QErrorMessage::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QErrorMessage>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QErrorMessage>, module, 0);
PythonQt::priv()->registerClass(&QFileDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QFileDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFileDialog>, module, 0);
PythonQt::priv()->registerCPPClass("QFileIconProvider", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFileIconProvider>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFileIconProvider>, module, 0);
PythonQt::priv()->registerCPPClass("QFileOpenEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFileOpenEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QFocusEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFocusEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QFocusFrame::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QFocusFrame>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFocusFrame>, module, 0);
PythonQt::priv()->registerClass(&QFontComboBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QFontComboBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFontComboBox>, module, 0);
PythonQt::priv()->registerClass(&QFontDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QFontDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFontDialog>, module, 0);
PythonQt::priv()->registerCPPClass("QFontInfo", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFontInfo>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QFontMetrics", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFontMetrics>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QFontMetricsF", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFontMetricsF>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QFormLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QFormLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFormLayout>, module, 0);
PythonQt::priv()->registerClass(&QFrame::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QFrame>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFrame>, module, 0);
PythonQt::priv()->registerClass(&QGesture::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGesture>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGesture>, module, 0);
PythonQt::priv()->registerCPPClass("QGradient", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGradient>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QGraphicsAnchor::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsAnchor>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsAnchorLayout", "QGraphicsLayout", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsAnchorLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsAnchorLayout>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsEffect::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsEffect>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsEffect>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsEllipseItem", "QAbstractGraphicsShapeItem", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsEllipseItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsEllipseItem>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsGridLayout", "QGraphicsLayout", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsGridLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsGridLayout>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsItem>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsItemAnimation::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsItemAnimation>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsItemAnimation>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsItemGroup", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsItemGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsItemGroup>, module, 0);
PythonQt::self()->addParentClass("QGraphicsItemGroup", "QGraphicsItem",PythonQtUpcastingOffset<QGraphicsItemGroup,QGraphicsItem>());
PythonQt::priv()->registerCPPClass("QGraphicsLayout", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsLayout>, module, 0);
PythonQt::self()->addParentClass("QGraphicsLayout", "QGraphicsLayoutItem",PythonQtUpcastingOffset<QGraphicsLayout,QGraphicsLayoutItem>());
PythonQt::priv()->registerCPPClass("QGraphicsLayoutItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsLayoutItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsLayoutItem>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsLineItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsLineItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsLineItem>, module, 0);
PythonQt::self()->addParentClass("QGraphicsLineItem", "QGraphicsItem",PythonQtUpcastingOffset<QGraphicsLineItem,QGraphicsItem>());
PythonQt::priv()->registerCPPClass("QGraphicsLinearLayout", "QGraphicsLayout", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsLinearLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsLinearLayout>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsObject::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsObject>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsObject>, module, 0);
PythonQt::self()->addParentClass("QGraphicsObject", "QGraphicsItem",PythonQtUpcastingOffset<QGraphicsObject,QGraphicsItem>());
PythonQt::priv()->registerClass(&QGraphicsOpacityEffect::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsOpacityEffect>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsOpacityEffect>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsPathItem", "QAbstractGraphicsShapeItem", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsPathItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsPathItem>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsPixmapItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsPixmapItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsPixmapItem>, module, 0);
PythonQt::self()->addParentClass("QGraphicsPixmapItem", "QGraphicsItem",PythonQtUpcastingOffset<QGraphicsPixmapItem,QGraphicsItem>());
PythonQt::priv()->registerCPPClass("QGraphicsPolygonItem", "QAbstractGraphicsShapeItem", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsPolygonItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsPolygonItem>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsProxyWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsProxyWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsProxyWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsRectItem", "QAbstractGraphicsShapeItem", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsRectItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsRectItem>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsRotation::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsRotation>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsRotation>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsScale::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsScale>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsScale>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsScene::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsScene>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsScene>, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneContextMenuEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneContextMenuEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneDragDropEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneDragDropEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneHelpEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneHelpEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneHoverEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneHoverEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneMouseEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneMouseEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneMoveEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneMoveEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneResizeEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneResizeEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSceneWheelEvent", "QGraphicsSceneEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSceneWheelEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QGraphicsSimpleTextItem", "QAbstractGraphicsShapeItem", "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsSimpleTextItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsSimpleTextItem>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsTextItem::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsTextItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsTextItem>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsTransform::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsTransform>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsTransform>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsView>, module, 0);
PythonQt::priv()->registerClass(&QGraphicsWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGraphicsWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGraphicsWidget>, module, 0);
PythonQt::self()->addParentClass("QGraphicsWidget", "QGraphicsLayoutItem",PythonQtUpcastingOffset<QGraphicsWidget,QGraphicsLayoutItem>());
PythonQt::priv()->registerClass(&QGridLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGridLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGridLayout>, module, 0);
PythonQt::priv()->registerClass(&QGroupBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QGroupBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QGroupBox>, module, 0);
PythonQt::priv()->registerClass(&QHBoxLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QHBoxLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHBoxLayout>, module, 0);
PythonQt::priv()->registerClass(&QHeaderView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QHeaderView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHeaderView>, module, 0);
PythonQt::priv()->registerCPPClass("QHelpEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QHelpEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QHideEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QHideEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QHoverEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QHoverEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHoverEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QIconDragEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QIconDragEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QIconEngine", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QIconEngine>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QIconEngine>, module, 0);
PythonQt::priv()->registerClass(&QIconEnginePluginV2::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QIconEnginePluginV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QIconEnginePluginV2>, module, 0);
PythonQt::priv()->registerCPPClass("QImageIOHandler", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QImageIOHandler>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QImageIOHandler>, module, 0);
PythonQt::priv()->registerClass(&QImageIOPlugin::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QImageIOPlugin>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QImageIOPlugin>, module, 0);
PythonQt::priv()->registerCPPClass("QImageReader", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QImageReader>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QImageWriter", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QImageWriter>, NULL, module, 0);
PythonQt::priv()->registerClass(&QInputContext::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QInputContext>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QInputContext>, module, 0);
PythonQt::priv()->registerCPPClass("QInputContextFactory", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QInputContextFactory>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QInputContextFactory>, module, 0);
PythonQt::priv()->registerClass(&QInputContextPlugin::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QInputContextPlugin>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QInputContextPlugin>, module, 0);
PythonQt::priv()->registerClass(&QInputDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QInputDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QInputDialog>, module, 0);
PythonQt::priv()->registerCPPClass("QInputEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QInputEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QInputEvent>, module, 0);
PythonQt::priv()->registerClass(&QIntValidator::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QIntValidator>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QIntValidator>, module, 0);
PythonQt::priv()->registerClass(&QItemDelegate::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QItemDelegate>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QItemDelegate>, module, 0);
PythonQt::priv()->registerCPPClass("QItemEditorCreatorBase", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QItemEditorCreatorBase>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QItemEditorCreatorBase>, module, 0);
PythonQt::priv()->registerCPPClass("QItemEditorFactory", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QItemEditorFactory>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QItemEditorFactory>, module, 0);
PythonQt::priv()->registerCPPClass("QItemSelection", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QItemSelection>, NULL, module, PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Add);
PythonQt::priv()->registerClass(&QItemSelectionModel::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QItemSelectionModel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QItemSelectionModel>, module, 0);
PythonQt::priv()->registerCPPClass("QItemSelectionRange", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QItemSelectionRange>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QKeyEvent", "QInputEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QKeyEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QKeyEvent>, module, 0);
PythonQt::priv()->registerClass(&QKeyEventTransition::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QKeyEventTransition>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QKeyEventTransition>, module, 0);
PythonQt::priv()->registerClass(&QLCDNumber::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QLCDNumber>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLCDNumber>, module, 0);
PythonQt::priv()->registerClass(&QLabel::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QLabel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLabel>, module, 0);
PythonQt::priv()->registerClass(&QLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLayout>, module, 0);
PythonQt::self()->addParentClass("QLayout", "QLayoutItem",PythonQtUpcastingOffset<QLayout,QLayoutItem>());
PythonQt::priv()->registerCPPClass("QLayoutItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QLayoutItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLayoutItem>, module, 0);
PythonQt::priv()->registerClass(&QLineEdit::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QLineEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLineEdit>, module, 0);
PythonQt::priv()->registerCPPClass("QLinearGradient", "QGradient", "QtGui", PythonQtCreateObject<PythonQtWrapper_QLinearGradient>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QListView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QListView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QListView>, module, 0);
PythonQt::priv()->registerClass(&QListWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QListWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QListWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QListWidgetItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QListWidgetItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QListWidgetItem>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QMainWindow::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMainWindow>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMainWindow>, module, 0);
PythonQt::priv()->registerCPPClass("QMargins", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QMargins>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QMatrix4x4", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QMatrix4x4>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerClass(&QMdiArea::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMdiArea>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMdiArea>, module, 0);
PythonQt::priv()->registerClass(&QMdiSubWindow::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMdiSubWindow>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMdiSubWindow>, module, 0);
PythonQt::priv()->registerClass(&QMenu::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMenu>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMenu>, module, 0);
PythonQt::priv()->registerClass(&QMenuBar::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMenuBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMenuBar>, module, 0);
PythonQt::priv()->registerClass(&QMessageBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMessageBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMessageBox>, module, 0);
PythonQt::priv()->registerClass(&QMotifStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMotifStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMotifStyle>, module, 0);
PythonQt::priv()->registerCPPClass("QMouseEvent", "QInputEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QMouseEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMouseEvent>, module, 0);
PythonQt::priv()->registerClass(&QMouseEventTransition::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMouseEventTransition>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMouseEventTransition>, module, 0);
PythonQt::priv()->registerCPPClass("QMoveEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QMoveEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMoveEvent>, module, 0);
PythonQt::priv()->registerClass(&QMovie::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QMovie>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QMovie>, module, 0);
PythonQt::priv()->registerClass(&QPageSetupDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPageSetupDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPageSetupDialog>, module, 0);
PythonQt::priv()->registerCPPClass("QPaintDevice", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPaintDevice>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPaintDevice>, module, 0);
PythonQt::priv()->registerCPPClass("QPaintEngine", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPaintEngine>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPaintEngine>, module, 0);
PythonQt::priv()->registerCPPClass("QPaintEngineState", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPaintEngineState>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPaintEngineState>, module, 0);
PythonQt::priv()->registerCPPClass("QPaintEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPaintEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPaintEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QPainter", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPainter>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QPainterPath", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPainterPath>, NULL, module, PythonQt::Type_And|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_InplaceOr|PythonQt::Type_RichCompare|PythonQt::Type_Or|PythonQt::Type_InplaceAnd|PythonQt::Type_Subtract|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QPainterPathStroker", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPainterPathStroker>, NULL, module, 0);
PythonQt::priv()->registerClass(&QPanGesture::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPanGesture>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPanGesture>, module, 0);
PythonQt::priv()->registerCPPClass("QPicture", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPicture>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPicture>, module, PythonQt::Type_NonZero);
PythonQt::self()->addParentClass("QPicture", "QPaintDevice",PythonQtUpcastingOffset<QPicture,QPaintDevice>());
PythonQt::priv()->registerClass(&QPictureFormatPlugin::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPictureFormatPlugin>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPictureFormatPlugin>, module, 0);
PythonQt::priv()->registerCPPClass("QPictureIO", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPictureIO>, NULL, module, 0);
PythonQt::priv()->registerClass(&QPinchGesture::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPinchGesture>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPinchGesture>, module, 0);
PythonQt::priv()->registerCPPClass("QPixmapCache", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPixmapCache>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPixmapCache>, module, 0);
PythonQt::priv()->registerCPPClass("QPixmapCache::Key", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPixmapCache_Key>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QPlainTextDocumentLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPlainTextDocumentLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPlainTextDocumentLayout>, module, 0);
PythonQt::priv()->registerClass(&QPlainTextEdit::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPlainTextEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPlainTextEdit>, module, 0);
PythonQt::priv()->registerClass(&QPlastiqueStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPlastiqueStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPlastiqueStyle>, module, 0);
PythonQt::priv()->registerCPPClass("QPolygonF", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPolygonF>, NULL, module, PythonQt::Type_RichCompare|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerClass(&QPrintDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPrintDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPrintDialog>, module, 0);
PythonQt::priv()->registerCPPClass("QPrintEngine", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPrintEngine>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPrintEngine>, module, 0);
PythonQt::priv()->registerClass(&QPrintPreviewDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPrintPreviewDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPrintPreviewDialog>, module, 0);
PythonQt::priv()->registerClass(&QPrintPreviewWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPrintPreviewWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPrintPreviewWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QPrinter", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPrinter>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPrinter>, module, 0);
PythonQt::self()->addParentClass("QPrinter", "QPaintDevice",PythonQtUpcastingOffset<QPrinter,QPaintDevice>());
PythonQt::priv()->registerClass(&QProgressBar::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QProgressBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QProgressBar>, module, 0);
PythonQt::priv()->registerClass(&QProgressDialog::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QProgressDialog>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QProgressDialog>, module, 0);
PythonQt::priv()->registerClass(&QProxyStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QProxyStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QProxyStyle>, module, 0);
PythonQt::priv()->registerClass(&QPushButton::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QPushButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPushButton>, module, 0);
PythonQt::priv()->registerCPPClass("QQuaternion", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QQuaternion>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QRadialGradient", "QGradient", "QtGui", PythonQtCreateObject<PythonQtWrapper_QRadialGradient>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QRadioButton::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QRadioButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QRadioButton>, module, 0);
PythonQt::priv()->registerClass(&QRegExpValidator::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QRegExpValidator>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QRegExpValidator>, module, 0);
PythonQt::priv()->registerCPPClass("QResizeEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QResizeEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QResizeEvent>, module, 0);
PythonQt::priv()->registerClass(&QRubberBand::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QRubberBand>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QRubberBand>, module, 0);
PythonQt::priv()->registerClass(&QScrollArea::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QScrollArea>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QScrollArea>, module, 0);
PythonQt::priv()->registerClass(&QScrollBar::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QScrollBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QScrollBar>, module, 0);
PythonQt::priv()->registerClass(&QSessionManager::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSessionManager>, NULL, module, 0);
PythonQt::priv()->registerClass(&QShortcut::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QShortcut>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QShortcut>, module, 0);
PythonQt::priv()->registerCPPClass("QShortcutEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QShortcutEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QShortcutEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QShowEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QShowEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QSizeGrip::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSizeGrip>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSizeGrip>, module, 0);
PythonQt::priv()->registerClass(&QSlider::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSlider>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSlider>, module, 0);
PythonQt::priv()->registerClass(&QSound::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSound>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSound>, module, 0);
PythonQt::priv()->registerCPPClass("QSpacerItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QSpacerItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSpacerItem>, module, 0);
PythonQt::self()->addParentClass("QSpacerItem", "QLayoutItem",PythonQtUpcastingOffset<QSpacerItem,QLayoutItem>());
PythonQt::priv()->registerClass(&QSpinBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSpinBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSpinBox>, module, 0);
PythonQt::priv()->registerClass(&QSplashScreen::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSplashScreen>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSplashScreen>, module, 0);
PythonQt::priv()->registerClass(&QSplitter::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSplitter>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSplitter>, module, 0);
PythonQt::priv()->registerClass(&QSplitterHandle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSplitterHandle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSplitterHandle>, module, 0);
PythonQt::priv()->registerClass(&QStackedLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStackedLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStackedLayout>, module, 0);
PythonQt::priv()->registerClass(&QStackedWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStackedWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStackedWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QStandardItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStandardItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStandardItem>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QStandardItemModel::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStandardItemModel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStandardItemModel>, module, 0);
PythonQt::priv()->registerClass(&QStatusBar::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStatusBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStatusBar>, module, 0);
PythonQt::priv()->registerCPPClass("QStatusTipEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStatusTipEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QStringListModel::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStringListModel>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStringListModel>, module, 0);
PythonQt::priv()->registerClass(&QStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyle>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleFactory", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleFactory>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleFactory>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleHintReturn", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleHintReturn>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleHintReturn>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleHintReturnMask", "QStyleHintReturn", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleHintReturnMask>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleHintReturnMask>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleHintReturnVariant", "QStyleHintReturn", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleHintReturnVariant>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleHintReturnVariant>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOption", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOption>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOption>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionButton", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionButton>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionComboBox", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionComboBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionComboBox>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionDockWidget", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionDockWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionDockWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionDockWidgetV2", "QStyleOptionDockWidget", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionDockWidgetV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionDockWidgetV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionFocusRect", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionFocusRect>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionFocusRect>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionFrame", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionFrame>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionFrame>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionFrameV2", "QStyleOptionFrame", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionFrameV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionFrameV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionFrameV3", "QStyleOptionFrameV2", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionFrameV3>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionFrameV3>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionGraphicsItem", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionGraphicsItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionGraphicsItem>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionGroupBox", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionGroupBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionGroupBox>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionHeader", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionHeader>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionHeader>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionMenuItem", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionMenuItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionMenuItem>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionProgressBar", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionProgressBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionProgressBar>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionProgressBarV2", "QStyleOptionProgressBar", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionProgressBarV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionProgressBarV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionRubberBand", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionRubberBand>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionRubberBand>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionSizeGrip", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionSizeGrip>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionSizeGrip>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionSlider", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionSlider>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionSlider>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionSpinBox", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionSpinBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionSpinBox>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTab", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTab>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTab>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTabBarBase", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTabBarBase>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTabBarBase>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTabBarBaseV2", "QStyleOptionTabBarBase", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTabBarBaseV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTabBarBaseV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTabV2", "QStyleOptionTab", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTabV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTabV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTabV3", "QStyleOptionTabV2", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTabV3>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTabV3>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTabWidgetFrame", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTabWidgetFrame>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTabWidgetFrame>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionTitleBar", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionTitleBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionTitleBar>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionToolBar", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionToolBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionToolBar>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionToolBox", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionToolBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionToolBox>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionToolBoxV2", "QStyleOptionToolBox", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionToolBoxV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionToolBoxV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionToolButton", "QStyleOptionComplex", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionToolButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionToolButton>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionViewItem", "QStyleOption", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionViewItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionViewItem>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionViewItemV2", "QStyleOptionViewItem", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionViewItemV2>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionViewItemV2>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionViewItemV3", "QStyleOptionViewItemV2", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionViewItemV3>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionViewItemV3>, module, 0);
PythonQt::priv()->registerCPPClass("QStyleOptionViewItemV4", "QStyleOptionViewItemV3", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyleOptionViewItemV4>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyleOptionViewItemV4>, module, 0);
PythonQt::priv()->registerCPPClass("QStylePainter", "QPainter", "QtGui", PythonQtCreateObject<PythonQtWrapper_QStylePainter>, NULL, module, 0);
PythonQt::priv()->registerClass(&QStylePlugin::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStylePlugin>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStylePlugin>, module, 0);
PythonQt::priv()->registerClass(&QStyledItemDelegate::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QStyledItemDelegate>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QStyledItemDelegate>, module, 0);
PythonQt::priv()->registerClass(&QSwipeGesture::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSwipeGesture>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSwipeGesture>, module, 0);
PythonQt::priv()->registerClass(&QSyntaxHighlighter::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSyntaxHighlighter>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSyntaxHighlighter>, module, 0);
PythonQt::priv()->registerClass(&QSystemTrayIcon::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QSystemTrayIcon>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QSystemTrayIcon>, module, 0);
PythonQt::priv()->registerClass(&QTabBar::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTabBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTabBar>, module, 0);
PythonQt::priv()->registerClass(&QTabWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTabWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTabWidget>, module, 0);
PythonQt::priv()->registerClass(&QTableView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTableView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTableView>, module, 0);
PythonQt::priv()->registerClass(&QTableWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTableWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTableWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QTableWidgetItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTableWidgetItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTableWidgetItem>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTableWidgetSelectionRange", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTableWidgetSelectionRange>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTabletEvent", "QInputEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTabletEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTabletEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QTextBlock", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextBlock>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextBlockFormat", "QTextFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextBlockFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextBlockFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QTextBlockGroup::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextBlockGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextBlockGroup>, module, 0);
PythonQt::priv()->registerCPPClass("QTextBlockUserData", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextBlockUserData>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextBlockUserData>, module, 0);
PythonQt::priv()->registerClass(&QTextBrowser::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextBrowser>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextBrowser>, module, 0);
PythonQt::priv()->registerCPPClass("QTextCharFormat", "QTextFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextCharFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextCharFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QTextCodecPlugin::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextCodecPlugin>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextCodecPlugin>, module, 0);
PythonQt::priv()->registerCPPClass("QTextCursor", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextCursor>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QTextDocument::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextDocument>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextDocument>, module, 0);
PythonQt::priv()->registerCPPClass("QTextDocumentFragment", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextDocumentFragment>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTextDocumentWriter", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextDocumentWriter>, NULL, module, 0);
PythonQt::priv()->registerClass(&QTextEdit::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextEdit>, module, 0);
PythonQt::priv()->registerCPPClass("QTextFragment", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextFragment>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QTextFrame::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextFrame>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextFrame>, module, 0);
PythonQt::priv()->registerCPPClass("QTextFrameFormat", "QTextFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextFrameFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextFrameFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextImageFormat", "QTextCharFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextImageFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextImageFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextInlineObject", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextInlineObject>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTextItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextItem>, module, 0);
PythonQt::priv()->registerCPPClass("QTextLine", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextLine>, NULL, module, 0);
PythonQt::priv()->registerClass(&QTextList::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextList>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextList>, module, 0);
PythonQt::priv()->registerCPPClass("QTextListFormat", "QTextFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextListFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextListFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QTextObject::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextObject>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextObject>, module, 0);
PythonQt::priv()->registerClass(&QTextTable::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextTable>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextTable>, module, 0);
PythonQt::priv()->registerCPPClass("QTextTableCell", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextTableCell>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextTableCellFormat", "QTextCharFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextTableCellFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextTableCellFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextTableFormat", "QTextFrameFormat", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextTableFormat>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTextTableFormat>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTileRules", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTileRules>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTileRules>, module, 0);
PythonQt::priv()->registerClass(&QTimeEdit::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTimeEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTimeEdit>, module, 0);
PythonQt::priv()->registerClass(&QToolBar::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QToolBar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QToolBar>, module, 0);
PythonQt::priv()->registerCPPClass("QToolBarChangeEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QToolBarChangeEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QToolBox::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QToolBox>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QToolBox>, module, 0);
PythonQt::priv()->registerClass(&QToolButton::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QToolButton>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QToolButton>, module, 0);
PythonQt::priv()->registerCPPClass("QToolTip", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QToolTip>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTouchEvent", "QInputEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTouchEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTouchEvent>, module, 0);
PythonQt::priv()->registerCPPClass("QTouchEvent::TouchPoint", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTouchEvent_TouchPoint>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QTransform", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTransform>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerClass(&QTreeView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTreeView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTreeView>, module, 0);
PythonQt::priv()->registerClass(&QTreeWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QTreeWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTreeWidget>, module, 0);
PythonQt::priv()->registerCPPClass("QTreeWidgetItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTreeWidgetItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTreeWidgetItem>, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QUndoCommand", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QUndoCommand>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUndoCommand>, module, 0);
PythonQt::priv()->registerClass(&QUndoGroup::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QUndoGroup>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUndoGroup>, module, 0);
PythonQt::priv()->registerClass(&QUndoStack::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QUndoStack>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUndoStack>, module, 0);
PythonQt::priv()->registerClass(&QUndoView::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QUndoView>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUndoView>, module, 0);
PythonQt::priv()->registerClass(&QVBoxLayout::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QVBoxLayout>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QVBoxLayout>, module, 0);
PythonQt::priv()->registerClass(&QValidator::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QValidator>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QValidator>, module, 0);
PythonQt::priv()->registerCPPClass("QVector2D", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QVector2D>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QVector3D", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QVector3D>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QVector4D", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QVector4D>, NULL, module, PythonQt::Type_Divide|PythonQt::Type_InplaceDivide|PythonQt::Type_NonZero|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_RichCompare|PythonQt::Type_Subtract|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QWhatsThis", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QWhatsThis>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QWhatsThisClickedEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QWhatsThisClickedEvent>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QWheelEvent", "QInputEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QWheelEvent>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWheelEvent>, module, 0);
PythonQt::priv()->registerClass(&QWidget::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QWidget>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWidget>, module, 0);
PythonQt::self()->addParentClass("QWidget", "QPaintDevice",PythonQtUpcastingOffset<QWidget,QPaintDevice>());
PythonQt::priv()->registerClass(&QWidgetAction::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QWidgetAction>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWidgetAction>, module, 0);
PythonQt::priv()->registerCPPClass("QWidgetItem", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QWidgetItem>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWidgetItem>, module, 0);
PythonQt::self()->addParentClass("QWidgetItem", "QLayoutItem",PythonQtUpcastingOffset<QWidgetItem,QLayoutItem>());
PythonQt::priv()->registerCPPClass("QWindowStateChangeEvent", "QEvent", "QtGui", PythonQtCreateObject<PythonQtWrapper_QWindowStateChangeEvent>, NULL, module, 0);
PythonQt::priv()->registerClass(&QWindowsStyle::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QWindowsStyle>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWindowsStyle>, module, 0);
PythonQt::priv()->registerClass(&QWizard::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QWizard>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWizard>, module, 0);
PythonQt::priv()->registerClass(&QWizardPage::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QWizardPage>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWizardPage>, module, 0);
PythonQt::priv()->registerClass(&QWorkspace::staticMetaObject, "QtGui", PythonQtCreateObject<PythonQtWrapper_QWorkspace>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QWorkspace>, module, 0);
PythonQt::self()->addPolymorphicHandler("QStyleOption", polymorphichandler_QStyleOption);
PythonQt::self()->addPolymorphicHandler("QGradient", polymorphichandler_QGradient);
PythonQt::self()->addPolymorphicHandler("QEvent", polymorphichandler_QEvent);
}

View File

@ -1,8 +0,0 @@
#ifndef COM_TROLLTECH_QT_GUI_INIT_H
#define COM_TROLLTECH_QT_GUI_INIT_H
#include "PythonQtSystem.h"
PYTHONQT_EXPORT void PythonQt_init_QtGui(PyObject* module);
#endif // COM_TROLLTECH_QT_GUI_INIT_H

View File

@ -1,6 +0,0 @@
HEADERS += \
$$PWD/com_trolltech_qt_gui_builtin0.h \
SOURCES += \
$$PWD/com_trolltech_qt_gui_builtin0.cpp \
$$PWD/com_trolltech_qt_gui_builtin_init.cpp

View File

@ -1,25 +0,0 @@
#include <PythonQt.h>
#include "com_trolltech_qt_gui_builtin0.h"
void PythonQt_init_QtGuiBuiltin(PyObject* module) {
PythonQt::priv()->registerCPPClass("QBitmap", "QPixmap", "QtGui", PythonQtCreateObject<PythonQtWrapper_QBitmap>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QBitmap>, module, PythonQt::Type_NonZero);
PythonQt::priv()->registerCPPClass("QBrush", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QBrush>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QColor", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QColor>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QCursor", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QCursor>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QFont", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QFont>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QIcon", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QIcon>, NULL, module, PythonQt::Type_NonZero);
PythonQt::priv()->registerCPPClass("QImage", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QImage>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QImage>, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::self()->addParentClass("QImage", "QPaintDevice",PythonQtUpcastingOffset<QImage,QPaintDevice>());
PythonQt::priv()->registerCPPClass("QKeySequence", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QKeySequence>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QMatrix", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QMatrix>, NULL, module, PythonQt::Type_RichCompare|PythonQt::Type_InplaceMultiply|PythonQt::Type_Multiply);
PythonQt::priv()->registerCPPClass("QPalette", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPalette>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QPen", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPen>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QPixmap", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPixmap>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QPixmap>, module, PythonQt::Type_NonZero);
PythonQt::self()->addParentClass("QPixmap", "QPaintDevice",PythonQtUpcastingOffset<QPixmap,QPaintDevice>());
PythonQt::priv()->registerCPPClass("QPolygon", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QPolygon>, NULL, module, PythonQt::Type_RichCompare|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QRegion", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QRegion>, NULL, module, PythonQt::Type_And|PythonQt::Type_InplaceXor|PythonQt::Type_InplaceSubtract|PythonQt::Type_InplaceAdd|PythonQt::Type_InplaceOr|PythonQt::Type_Xor|PythonQt::Type_RichCompare|PythonQt::Type_Or|PythonQt::Type_InplaceAnd|PythonQt::Type_Subtract|PythonQt::Type_Multiply|PythonQt::Type_Add);
PythonQt::priv()->registerCPPClass("QSizePolicy", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QSizePolicy>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextFormat", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextFormat>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QTextLength", "", "QtGui", PythonQtCreateObject<PythonQtWrapper_QTextLength>, NULL, module, PythonQt::Type_RichCompare);
}

View File

@ -1,6 +0,0 @@
HEADERS += \
$$PWD/com_trolltech_qt_network0.h \
SOURCES += \
$$PWD/com_trolltech_qt_network0.cpp \
$$PWD/com_trolltech_qt_network_init.cpp

View File

@ -1,974 +0,0 @@
#include "com_trolltech_qt_network1.h"
#include <PythonQtConversion.h>
#include <PythonQtMethodInfo.h>
#include <PythonQtSignalReceiver.h>
#include <QVariant>
#include <qauthenticator.h>
#include <qbytearray.h>
#include <qcoreevent.h>
#include <qdatetime.h>
#include <qhostaddress.h>
#include <qiodevice.h>
#include <qlist.h>
#include <qnetworkproxy.h>
#include <qobject.h>
#include <qsslcertificate.h>
#include <qsslcipher.h>
#include <qsslconfiguration.h>
#include <qsslerror.h>
#include <qsslkey.h>
#include <qsslsocket.h>
#include <qurl.h>
QSslKey* PythonQtWrapper_QSslKey::new_QSslKey()
{
return new QSslKey(); }
QSslKey* PythonQtWrapper_QSslKey::new_QSslKey(QIODevice* device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format, QSsl::KeyType type, const QByteArray& passPhrase)
{
return new QSslKey(device, algorithm, format, type, passPhrase); }
QSslKey* PythonQtWrapper_QSslKey::new_QSslKey(const QByteArray& encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format, QSsl::KeyType type, const QByteArray& passPhrase)
{
return new QSslKey(encoded, algorithm, format, type, passPhrase); }
QSslKey* PythonQtWrapper_QSslKey::new_QSslKey(const QSslKey& other)
{
return new QSslKey(other); }
QSsl::KeyAlgorithm PythonQtWrapper_QSslKey::algorithm(QSslKey* theWrappedObject) const
{
return ( theWrappedObject->algorithm());
}
QByteArray PythonQtWrapper_QSslKey::toDer(QSslKey* theWrappedObject, const QByteArray& passPhrase) const
{
return ( theWrappedObject->toDer(passPhrase));
}
QSslKey* PythonQtWrapper_QSslKey::operator_assign(QSslKey* theWrappedObject, const QSslKey& other)
{
return &( (*theWrappedObject)= other);
}
void PythonQtWrapper_QSslKey::clear(QSslKey* theWrappedObject)
{
( theWrappedObject->clear());
}
int PythonQtWrapper_QSslKey::length(QSslKey* theWrappedObject) const
{
return ( theWrappedObject->length());
}
QByteArray PythonQtWrapper_QSslKey::toPem(QSslKey* theWrappedObject, const QByteArray& passPhrase) const
{
return ( theWrappedObject->toPem(passPhrase));
}
Qt::HANDLE PythonQtWrapper_QSslKey::handle(QSslKey* theWrappedObject) const
{
return ( theWrappedObject->handle());
}
QSsl::KeyType PythonQtWrapper_QSslKey::type(QSslKey* theWrappedObject) const
{
return ( theWrappedObject->type());
}
bool PythonQtWrapper_QSslKey::operator_equal(QSslKey* theWrappedObject, const QSslKey& key) const
{
return ( (*theWrappedObject)== key);
}
bool PythonQtWrapper_QSslKey::isNull(QSslKey* theWrappedObject) const
{
return ( theWrappedObject->isNull());
}
QString PythonQtWrapper_QSslKey::py_toString(QSslKey* obj) {
QString result;
#ifdef QT_DEBUG
QDebug d(&result);
d << *obj;
#endif
return result;
}
bool PythonQtShell_QSslSocket::canReadLine() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "canReadLine");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
bool returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("canReadLine", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::canReadLine();
}
qint64 PythonQtShell_QSslSocket::bytesToWrite() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "bytesToWrite");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
qint64 returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("bytesToWrite", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::bytesToWrite();
}
qint64 PythonQtShell_QSslSocket::readData(char* data, qint64 maxlen)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "readData");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64" , "char*" , "qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
qint64 returnValue = 0;
void* args[3] = {NULL, (void*)&data, (void*)&maxlen};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("readData", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::readData(data, maxlen);
}
qint64 PythonQtShell_QSslSocket::writeData(const char* data, qint64 len)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "writeData");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64" , "const char*" , "qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
qint64 returnValue = 0;
void* args[3] = {NULL, (void*)&data, (void*)&len};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("writeData", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::writeData(data, len);
}
qint64 PythonQtShell_QSslSocket::bytesAvailable() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "bytesAvailable");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
qint64 returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("bytesAvailable", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::bytesAvailable();
}
bool PythonQtShell_QSslSocket::waitForBytesWritten(int msecs)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "waitForBytesWritten");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "int"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
void* args[2] = {NULL, (void*)&msecs};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("waitForBytesWritten", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::waitForBytesWritten(msecs);
}
bool PythonQtShell_QSslSocket::atEnd() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "atEnd");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
bool returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("atEnd", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::atEnd();
}
void PythonQtShell_QSslSocket::close()
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "close");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={""};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
void* args[1] = {NULL};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QSslSocket::close();
}
bool PythonQtShell_QSslSocket::waitForReadyRead(int msecs)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "waitForReadyRead");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "int"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
void* args[2] = {NULL, (void*)&msecs};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("waitForReadyRead", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::waitForReadyRead(msecs);
}
qint64 PythonQtShell_QSslSocket::readLineData(char* data, qint64 maxlen)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "readLineData");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64" , "char*" , "qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
qint64 returnValue = 0;
void* args[3] = {NULL, (void*)&data, (void*)&maxlen};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("readLineData", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::readLineData(data, maxlen);
}
bool PythonQtShell_QSslSocket::isSequential() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isSequential");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
bool returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("isSequential", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::isSequential();
}
qint64 PythonQtShell_QSslSocket::size() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "size");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
qint64 returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("size", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::size();
}
qint64 PythonQtShell_QSslSocket::pos() const
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "pos");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
qint64 returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("pos", methodInfo, result);
} else {
returnValue = *((qint64*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::pos();
}
bool PythonQtShell_QSslSocket::reset()
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "reset");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
bool returnValue = 0;
void* args[1] = {NULL};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("reset", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::reset();
}
bool PythonQtShell_QSslSocket::open(QIODevice::OpenMode mode)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "open");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QIODevice::OpenMode"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
void* args[2] = {NULL, (void*)&mode};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("open", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::open(mode);
}
bool PythonQtShell_QSslSocket::seek(qint64 pos)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "seek");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "qint64"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
void* args[2] = {NULL, (void*)&pos};
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("seek", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::seek(pos);
}
void PythonQtShell_QSslSocket::childEvent(QChildEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QChildEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QSslSocket::childEvent(arg__1);
}
void PythonQtShell_QSslSocket::timerEvent(QTimerEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QTimerEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QSslSocket::timerEvent(arg__1);
}
void PythonQtShell_QSslSocket::customEvent(QEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
void* args[2] = {NULL, (void*)&arg__1};
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return;
}
Py_XDECREF(obj);
}
QSslSocket::customEvent(arg__1);
}
bool PythonQtShell_QSslSocket::event(QEvent* arg__1)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList);
bool returnValue = 0;
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::event(arg__1);
}
bool PythonQtShell_QSslSocket::eventFilter(QObject* arg__1, QEvent* arg__2)
{
if (_wrapper) {
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter");
PyErr_Clear();
if (obj && !PythonQtSlotFunction_Check(obj)) {
static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"};
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList);
bool returnValue = 0;
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) {
if (args[0]==NULL) {
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result);
} else {
returnValue = *((bool*)args[0]);
}
}
}
if (result) { Py_DECREF(result); }
Py_DECREF(obj);
return returnValue;
}
Py_XDECREF(obj);
}
return QSslSocket::eventFilter(arg__1, arg__2);
}
QSslSocket* PythonQtWrapper_QSslSocket::new_QSslSocket(QObject* parent)
{
return new PythonQtShell_QSslSocket(parent); }
QSslSocket::SslMode PythonQtWrapper_QSslSocket::mode(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->mode());
}
void PythonQtWrapper_QSslSocket::setProtocol(QSslSocket* theWrappedObject, QSsl::SslProtocol protocol)
{
( theWrappedObject->setProtocol(protocol));
}
void PythonQtWrapper_QSslSocket::static_QSslSocket_setDefaultCiphers(const QList<QSslCipher >& ciphers)
{
(QSslSocket::setDefaultCiphers(ciphers));
}
void PythonQtWrapper_QSslSocket::static_QSslSocket_setDefaultCaCertificates(const QList<QSslCertificate >& certificates)
{
(QSslSocket::setDefaultCaCertificates(certificates));
}
bool PythonQtWrapper_QSslSocket::static_QSslSocket_supportsSsl()
{
return (QSslSocket::supportsSsl());
}
void PythonQtWrapper_QSslSocket::setSocketOption(QSslSocket* theWrappedObject, QAbstractSocket::SocketOption option, const QVariant& value)
{
( theWrappedObject->setSocketOption(option, value));
}
bool PythonQtWrapper_QSslSocket::isEncrypted(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->isEncrypted());
}
bool PythonQtWrapper_QSslSocket::canReadLine(QSslSocket* theWrappedObject) const
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_canReadLine());
}
QSslKey PythonQtWrapper_QSslSocket::privateKey(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->privateKey());
}
QList<QSslCertificate > PythonQtWrapper_QSslSocket::static_QSslSocket_defaultCaCertificates()
{
return (QSslSocket::defaultCaCertificates());
}
QSslConfiguration PythonQtWrapper_QSslSocket::sslConfiguration(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->sslConfiguration());
}
qint64 PythonQtWrapper_QSslSocket::bytesToWrite(QSslSocket* theWrappedObject) const
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_bytesToWrite());
}
void PythonQtWrapper_QSslSocket::setCaCertificates(QSslSocket* theWrappedObject, const QList<QSslCertificate >& certificates)
{
( theWrappedObject->setCaCertificates(certificates));
}
QList<QSslCipher > PythonQtWrapper_QSslSocket::static_QSslSocket_defaultCiphers()
{
return (QSslSocket::defaultCiphers());
}
QList<QSslError > PythonQtWrapper_QSslSocket::sslErrors(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->sslErrors());
}
void PythonQtWrapper_QSslSocket::connectToHostEncrypted(QSslSocket* theWrappedObject, const QString& hostName, unsigned short port, const QString& sslPeerName, QIODevice::OpenMode mode)
{
( theWrappedObject->connectToHostEncrypted(hostName, port, sslPeerName, mode));
}
void PythonQtWrapper_QSslSocket::connectToHostEncrypted(QSslSocket* theWrappedObject, const QString& hostName, unsigned short port, QIODevice::OpenMode mode)
{
( theWrappedObject->connectToHostEncrypted(hostName, port, mode));
}
void PythonQtWrapper_QSslSocket::ignoreSslErrors(QSslSocket* theWrappedObject, const QList<QSslError >& errors)
{
( theWrappedObject->ignoreSslErrors(errors));
}
void PythonQtWrapper_QSslSocket::setCiphers(QSslSocket* theWrappedObject, const QString& ciphers)
{
( theWrappedObject->setCiphers(ciphers));
}
qint64 PythonQtWrapper_QSslSocket::encryptedBytesAvailable(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->encryptedBytesAvailable());
}
void PythonQtWrapper_QSslSocket::setCiphers(QSslSocket* theWrappedObject, const QList<QSslCipher >& ciphers)
{
( theWrappedObject->setCiphers(ciphers));
}
void PythonQtWrapper_QSslSocket::addCaCertificates(QSslSocket* theWrappedObject, const QList<QSslCertificate >& certificates)
{
( theWrappedObject->addCaCertificates(certificates));
}
bool PythonQtWrapper_QSslSocket::addCaCertificates(QSslSocket* theWrappedObject, const QString& path, QSsl::EncodingFormat format, QRegExp::PatternSyntax syntax)
{
return ( theWrappedObject->addCaCertificates(path, format, syntax));
}
bool PythonQtWrapper_QSslSocket::flush(QSslSocket* theWrappedObject)
{
return ( theWrappedObject->flush());
}
QSslSocket::PeerVerifyMode PythonQtWrapper_QSslSocket::peerVerifyMode(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->peerVerifyMode());
}
QSslCertificate PythonQtWrapper_QSslSocket::peerCertificate(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->peerCertificate());
}
bool PythonQtWrapper_QSslSocket::setSocketDescriptor(QSslSocket* theWrappedObject, int socketDescriptor, QAbstractSocket::SocketState state, QIODevice::OpenMode openMode)
{
return ( theWrappedObject->setSocketDescriptor(socketDescriptor, state, openMode));
}
QList<QSslCertificate > PythonQtWrapper_QSslSocket::caCertificates(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->caCertificates());
}
void PythonQtWrapper_QSslSocket::setPrivateKey(QSslSocket* theWrappedObject, const QString& fileName, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format, const QByteArray& passPhrase)
{
( theWrappedObject->setPrivateKey(fileName, algorithm, format, passPhrase));
}
qint64 PythonQtWrapper_QSslSocket::readData(QSslSocket* theWrappedObject, char* data, qint64 maxlen)
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_readData(data, maxlen));
}
QSslCipher PythonQtWrapper_QSslSocket::sessionCipher(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->sessionCipher());
}
void PythonQtWrapper_QSslSocket::setPrivateKey(QSslSocket* theWrappedObject, const QSslKey& key)
{
( theWrappedObject->setPrivateKey(key));
}
void PythonQtWrapper_QSslSocket::setReadBufferSize(QSslSocket* theWrappedObject, qint64 size)
{
( theWrappedObject->setReadBufferSize(size));
}
void PythonQtWrapper_QSslSocket::addCaCertificate(QSslSocket* theWrappedObject, const QSslCertificate& certificate)
{
( theWrappedObject->addCaCertificate(certificate));
}
qint64 PythonQtWrapper_QSslSocket::writeData(QSslSocket* theWrappedObject, const char* data, qint64 len)
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_writeData(data, len));
}
void PythonQtWrapper_QSslSocket::setSslConfiguration(QSslSocket* theWrappedObject, const QSslConfiguration& config)
{
( theWrappedObject->setSslConfiguration(config));
}
void PythonQtWrapper_QSslSocket::setPeerVerifyDepth(QSslSocket* theWrappedObject, int depth)
{
( theWrappedObject->setPeerVerifyDepth(depth));
}
void PythonQtWrapper_QSslSocket::abort(QSslSocket* theWrappedObject)
{
( theWrappedObject->abort());
}
qint64 PythonQtWrapper_QSslSocket::bytesAvailable(QSslSocket* theWrappedObject) const
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_bytesAvailable());
}
bool PythonQtWrapper_QSslSocket::waitForDisconnected(QSslSocket* theWrappedObject, int msecs)
{
return ( theWrappedObject->waitForDisconnected(msecs));
}
bool PythonQtWrapper_QSslSocket::waitForBytesWritten(QSslSocket* theWrappedObject, int msecs)
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_waitForBytesWritten(msecs));
}
bool PythonQtWrapper_QSslSocket::atEnd(QSslSocket* theWrappedObject) const
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_atEnd());
}
void PythonQtWrapper_QSslSocket::static_QSslSocket_addDefaultCaCertificate(const QSslCertificate& certificate)
{
(QSslSocket::addDefaultCaCertificate(certificate));
}
void PythonQtWrapper_QSslSocket::setPeerVerifyMode(QSslSocket* theWrappedObject, QSslSocket::PeerVerifyMode mode)
{
( theWrappedObject->setPeerVerifyMode(mode));
}
void PythonQtWrapper_QSslSocket::setLocalCertificate(QSslSocket* theWrappedObject, const QString& fileName, QSsl::EncodingFormat format)
{
( theWrappedObject->setLocalCertificate(fileName, format));
}
void PythonQtWrapper_QSslSocket::setLocalCertificate(QSslSocket* theWrappedObject, const QSslCertificate& certificate)
{
( theWrappedObject->setLocalCertificate(certificate));
}
QList<QSslCipher > PythonQtWrapper_QSslSocket::static_QSslSocket_supportedCiphers()
{
return (QSslSocket::supportedCiphers());
}
qint64 PythonQtWrapper_QSslSocket::encryptedBytesToWrite(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->encryptedBytesToWrite());
}
void PythonQtWrapper_QSslSocket::close(QSslSocket* theWrappedObject)
{
( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_close());
}
bool PythonQtWrapper_QSslSocket::waitForConnected(QSslSocket* theWrappedObject, int msecs)
{
return ( theWrappedObject->waitForConnected(msecs));
}
QList<QSslCertificate > PythonQtWrapper_QSslSocket::static_QSslSocket_systemCaCertificates()
{
return (QSslSocket::systemCaCertificates());
}
bool PythonQtWrapper_QSslSocket::waitForReadyRead(QSslSocket* theWrappedObject, int msecs)
{
return ( ((PythonQtPublicPromoter_QSslSocket*)theWrappedObject)->promoted_waitForReadyRead(msecs));
}
QSslCertificate PythonQtWrapper_QSslSocket::localCertificate(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->localCertificate());
}
bool PythonQtWrapper_QSslSocket::waitForEncrypted(QSslSocket* theWrappedObject, int msecs)
{
return ( theWrappedObject->waitForEncrypted(msecs));
}
QVariant PythonQtWrapper_QSslSocket::socketOption(QSslSocket* theWrappedObject, QAbstractSocket::SocketOption option)
{
return ( theWrappedObject->socketOption(option));
}
QList<QSslCertificate > PythonQtWrapper_QSslSocket::peerCertificateChain(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->peerCertificateChain());
}
QSsl::SslProtocol PythonQtWrapper_QSslSocket::protocol(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->protocol());
}
int PythonQtWrapper_QSslSocket::peerVerifyDepth(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->peerVerifyDepth());
}
void PythonQtWrapper_QSslSocket::static_QSslSocket_addDefaultCaCertificates(const QList<QSslCertificate >& certificates)
{
(QSslSocket::addDefaultCaCertificates(certificates));
}
bool PythonQtWrapper_QSslSocket::static_QSslSocket_addDefaultCaCertificates(const QString& path, QSsl::EncodingFormat format, QRegExp::PatternSyntax syntax)
{
return (QSslSocket::addDefaultCaCertificates(path, format, syntax));
}
QList<QSslCipher > PythonQtWrapper_QSslSocket::ciphers(QSslSocket* theWrappedObject) const
{
return ( theWrappedObject->ciphers());
}

View File

@ -1,168 +0,0 @@
#include <PythonQt.h>
#include <QObject>
#include <QVariant>
#include <qauthenticator.h>
#include <qbytearray.h>
#include <qcoreevent.h>
#include <qdatetime.h>
#include <qhostaddress.h>
#include <qiodevice.h>
#include <qlist.h>
#include <qnetworkproxy.h>
#include <qobject.h>
#include <qsslcertificate.h>
#include <qsslcipher.h>
#include <qsslconfiguration.h>
#include <qsslerror.h>
#include <qsslkey.h>
#include <qsslsocket.h>
#include <qurl.h>
class PythonQtWrapper_QSslKey : public QObject
{ Q_OBJECT
public:
public slots:
QSslKey* new_QSslKey();
QSslKey* new_QSslKey(QIODevice* device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray& passPhrase = QByteArray());
QSslKey* new_QSslKey(const QByteArray& encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray& passPhrase = QByteArray());
QSslKey* new_QSslKey(const QSslKey& other);
void delete_QSslKey(QSslKey* obj) { delete obj; }
QSsl::KeyAlgorithm algorithm(QSslKey* theWrappedObject) const;
QByteArray toDer(QSslKey* theWrappedObject, const QByteArray& passPhrase = QByteArray()) const;
QSslKey* operator_assign(QSslKey* theWrappedObject, const QSslKey& other);
void clear(QSslKey* theWrappedObject);
int length(QSslKey* theWrappedObject) const;
QByteArray toPem(QSslKey* theWrappedObject, const QByteArray& passPhrase = QByteArray()) const;
Qt::HANDLE handle(QSslKey* theWrappedObject) const;
QSsl::KeyType type(QSslKey* theWrappedObject) const;
bool operator_equal(QSslKey* theWrappedObject, const QSslKey& key) const;
bool isNull(QSslKey* theWrappedObject) const;
QString py_toString(QSslKey*);
};
class PythonQtShell_QSslSocket : public QSslSocket
{
public:
PythonQtShell_QSslSocket(QObject* parent = 0):QSslSocket(parent),_wrapper(NULL) {};
virtual bool canReadLine() const;
virtual qint64 bytesToWrite() const;
virtual qint64 readData(char* data, qint64 maxlen);
virtual qint64 writeData(const char* data, qint64 len);
virtual qint64 bytesAvailable() const;
virtual bool waitForBytesWritten(int msecs = 30000);
virtual bool atEnd() const;
virtual void close();
virtual bool waitForReadyRead(int msecs = 30000);
virtual qint64 readLineData(char* data, qint64 maxlen);
virtual bool isSequential() const;
virtual qint64 size() const;
virtual qint64 pos() const;
virtual bool reset();
virtual bool open(QIODevice::OpenMode mode);
virtual bool seek(qint64 pos);
virtual void childEvent(QChildEvent* arg__1);
virtual void timerEvent(QTimerEvent* arg__1);
virtual void customEvent(QEvent* arg__1);
virtual bool event(QEvent* arg__1);
virtual bool eventFilter(QObject* arg__1, QEvent* arg__2);
PythonQtInstanceWrapper* _wrapper;
};
class PythonQtPublicPromoter_QSslSocket : public QSslSocket
{ public:
inline bool promoted_canReadLine() const { return QSslSocket::canReadLine(); }
inline qint64 promoted_bytesToWrite() const { return QSslSocket::bytesToWrite(); }
inline qint64 promoted_readData(char* data, qint64 maxlen) { return QSslSocket::readData(data, maxlen); }
inline qint64 promoted_writeData(const char* data, qint64 len) { return QSslSocket::writeData(data, len); }
inline qint64 promoted_bytesAvailable() const { return QSslSocket::bytesAvailable(); }
inline bool promoted_waitForBytesWritten(int msecs = 30000) { return QSslSocket::waitForBytesWritten(msecs); }
inline bool promoted_atEnd() const { return QSslSocket::atEnd(); }
inline void promoted_close() { QSslSocket::close(); }
inline bool promoted_waitForReadyRead(int msecs = 30000) { return QSslSocket::waitForReadyRead(msecs); }
};
class PythonQtWrapper_QSslSocket : public QObject
{ Q_OBJECT
public:
Q_ENUMS(SslMode PeerVerifyMode )
enum SslMode{
UnencryptedMode = QSslSocket::UnencryptedMode, SslClientMode = QSslSocket::SslClientMode, SslServerMode = QSslSocket::SslServerMode};
enum PeerVerifyMode{
VerifyNone = QSslSocket::VerifyNone, QueryPeer = QSslSocket::QueryPeer, VerifyPeer = QSslSocket::VerifyPeer, AutoVerifyPeer = QSslSocket::AutoVerifyPeer};
public slots:
QSslSocket* new_QSslSocket(QObject* parent = 0);
void delete_QSslSocket(QSslSocket* obj) { delete obj; }
QSslSocket::SslMode mode(QSslSocket* theWrappedObject) const;
void setProtocol(QSslSocket* theWrappedObject, QSsl::SslProtocol protocol);
void static_QSslSocket_setDefaultCiphers(const QList<QSslCipher >& ciphers);
void static_QSslSocket_setDefaultCaCertificates(const QList<QSslCertificate >& certificates);
bool static_QSslSocket_supportsSsl();
void setSocketOption(QSslSocket* theWrappedObject, QAbstractSocket::SocketOption option, const QVariant& value);
bool isEncrypted(QSslSocket* theWrappedObject) const;
bool canReadLine(QSslSocket* theWrappedObject) const;
QSslKey privateKey(QSslSocket* theWrappedObject) const;
QList<QSslCertificate > static_QSslSocket_defaultCaCertificates();
QSslConfiguration sslConfiguration(QSslSocket* theWrappedObject) const;
qint64 bytesToWrite(QSslSocket* theWrappedObject) const;
void setCaCertificates(QSslSocket* theWrappedObject, const QList<QSslCertificate >& certificates);
QList<QSslCipher > static_QSslSocket_defaultCiphers();
QList<QSslError > sslErrors(QSslSocket* theWrappedObject) const;
void connectToHostEncrypted(QSslSocket* theWrappedObject, const QString& hostName, unsigned short port, const QString& sslPeerName, QIODevice::OpenMode mode = QIODevice::ReadWrite);
void connectToHostEncrypted(QSslSocket* theWrappedObject, const QString& hostName, unsigned short port, QIODevice::OpenMode mode = QIODevice::ReadWrite);
void ignoreSslErrors(QSslSocket* theWrappedObject, const QList<QSslError >& errors);
void setCiphers(QSslSocket* theWrappedObject, const QString& ciphers);
qint64 encryptedBytesAvailable(QSslSocket* theWrappedObject) const;
void setCiphers(QSslSocket* theWrappedObject, const QList<QSslCipher >& ciphers);
void addCaCertificates(QSslSocket* theWrappedObject, const QList<QSslCertificate >& certificates);
bool addCaCertificates(QSslSocket* theWrappedObject, const QString& path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString);
bool flush(QSslSocket* theWrappedObject);
QSslSocket::PeerVerifyMode peerVerifyMode(QSslSocket* theWrappedObject) const;
QSslCertificate peerCertificate(QSslSocket* theWrappedObject) const;
bool setSocketDescriptor(QSslSocket* theWrappedObject, int socketDescriptor, QAbstractSocket::SocketState state = QAbstractSocket::ConnectedState, QIODevice::OpenMode openMode = QIODevice::ReadWrite);
QList<QSslCertificate > caCertificates(QSslSocket* theWrappedObject) const;
void setPrivateKey(QSslSocket* theWrappedObject, const QString& fileName, QSsl::KeyAlgorithm algorithm = QSsl::Rsa, QSsl::EncodingFormat format = QSsl::Pem, const QByteArray& passPhrase = QByteArray());
qint64 readData(QSslSocket* theWrappedObject, char* data, qint64 maxlen);
QSslCipher sessionCipher(QSslSocket* theWrappedObject) const;
void setPrivateKey(QSslSocket* theWrappedObject, const QSslKey& key);
void setReadBufferSize(QSslSocket* theWrappedObject, qint64 size);
void addCaCertificate(QSslSocket* theWrappedObject, const QSslCertificate& certificate);
qint64 writeData(QSslSocket* theWrappedObject, const char* data, qint64 len);
void setSslConfiguration(QSslSocket* theWrappedObject, const QSslConfiguration& config);
void setPeerVerifyDepth(QSslSocket* theWrappedObject, int depth);
void abort(QSslSocket* theWrappedObject);
qint64 bytesAvailable(QSslSocket* theWrappedObject) const;
bool waitForDisconnected(QSslSocket* theWrappedObject, int msecs = 30000);
bool waitForBytesWritten(QSslSocket* theWrappedObject, int msecs = 30000);
bool atEnd(QSslSocket* theWrappedObject) const;
void static_QSslSocket_addDefaultCaCertificate(const QSslCertificate& certificate);
void setPeerVerifyMode(QSslSocket* theWrappedObject, QSslSocket::PeerVerifyMode mode);
void setLocalCertificate(QSslSocket* theWrappedObject, const QString& fileName, QSsl::EncodingFormat format = QSsl::Pem);
void setLocalCertificate(QSslSocket* theWrappedObject, const QSslCertificate& certificate);
QList<QSslCipher > static_QSslSocket_supportedCiphers();
qint64 encryptedBytesToWrite(QSslSocket* theWrappedObject) const;
void close(QSslSocket* theWrappedObject);
bool waitForConnected(QSslSocket* theWrappedObject, int msecs = 30000);
QList<QSslCertificate > static_QSslSocket_systemCaCertificates();
bool waitForReadyRead(QSslSocket* theWrappedObject, int msecs = 30000);
QSslCertificate localCertificate(QSslSocket* theWrappedObject) const;
bool waitForEncrypted(QSslSocket* theWrappedObject, int msecs = 30000);
QVariant socketOption(QSslSocket* theWrappedObject, QAbstractSocket::SocketOption option);
QList<QSslCertificate > peerCertificateChain(QSslSocket* theWrappedObject) const;
QSsl::SslProtocol protocol(QSslSocket* theWrappedObject) const;
int peerVerifyDepth(QSslSocket* theWrappedObject) const;
void static_QSslSocket_addDefaultCaCertificates(const QList<QSslCertificate >& certificates);
bool static_QSslSocket_addDefaultCaCertificates(const QString& path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString);
QList<QSslCipher > ciphers(QSslSocket* theWrappedObject) const;
};

View File

@ -1,38 +0,0 @@
#include <PythonQt.h>
#include "com_trolltech_qt_network_init.h"
#include "com_trolltech_qt_network0.h"
void PythonQt_init_QtNetwork(PyObject* module) {
PythonQt::priv()->registerClass(&QAbstractNetworkCache::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QAbstractNetworkCache>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractNetworkCache>, module, 0);
PythonQt::priv()->registerClass(&QAbstractSocket::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QAbstractSocket>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QAbstractSocket>, module, 0);
PythonQt::priv()->registerCPPClass("QAuthenticator", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QAuthenticator>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QFtp::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QFtp>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QFtp>, module, 0);
PythonQt::priv()->registerCPPClass("QHostAddress", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QHostAddress>, NULL, module, PythonQt::Type_NonZero|PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QHostInfo", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QHostInfo>, NULL, module, 0);
PythonQt::priv()->registerClass(&QHttp::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QHttp>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHttp>, module, 0);
PythonQt::priv()->registerCPPClass("QHttpHeader", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QHttpHeader>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHttpHeader>, module, 0);
PythonQt::priv()->registerCPPClass("QHttpRequestHeader", "QHttpHeader", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QHttpRequestHeader>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHttpRequestHeader>, module, 0);
PythonQt::priv()->registerCPPClass("QHttpResponseHeader", "QHttpHeader", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QHttpResponseHeader>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHttpResponseHeader>, module, 0);
PythonQt::priv()->registerCPPClass("QIPv6Address", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QIPv6Address>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QIPv6Address>, module, 0);
PythonQt::priv()->registerClass(&QLocalServer::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QLocalServer>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLocalServer>, module, 0);
PythonQt::priv()->registerClass(&QLocalSocket::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QLocalSocket>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QLocalSocket>, module, 0);
PythonQt::priv()->registerClass(&QNetworkAccessManager::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkAccessManager>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QNetworkAccessManager>, module, 0);
PythonQt::priv()->registerCPPClass("QNetworkAddressEntry", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkAddressEntry>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QNetworkCacheMetaData", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkCacheMetaData>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QNetworkCookie", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkCookie>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QNetworkCookieJar::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkCookieJar>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QNetworkCookieJar>, module, 0);
PythonQt::priv()->registerClass(&QNetworkDiskCache::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkDiskCache>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QNetworkDiskCache>, module, 0);
PythonQt::priv()->registerCPPClass("QNetworkInterface", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkInterface>, NULL, module, 0);
PythonQt::priv()->registerCPPClass("QNetworkProxy", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkProxy>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QNetworkProxyFactory", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkProxyFactory>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QNetworkProxyFactory>, module, 0);
PythonQt::priv()->registerCPPClass("QNetworkProxyQuery", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkProxyQuery>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerClass(&QNetworkReply::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkReply>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QNetworkReply>, module, 0);
PythonQt::priv()->registerCPPClass("QNetworkRequest", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QNetworkRequest>, NULL, module, PythonQt::Type_RichCompare);
PythonQt::priv()->registerCPPClass("QSsl", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QSsl>, NULL, module, 0);
PythonQt::priv()->registerClass(&QTcpServer::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QTcpServer>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTcpServer>, module, 0);
PythonQt::priv()->registerClass(&QTcpSocket::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QTcpSocket>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QTcpSocket>, module, 0);
PythonQt::priv()->registerClass(&QUdpSocket::staticMetaObject, "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QUdpSocket>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUdpSocket>, module, 0);
PythonQt::priv()->registerCPPClass("QUrlInfo", "", "QtNetwork", PythonQtCreateObject<PythonQtWrapper_QUrlInfo>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QUrlInfo>, module, PythonQt::Type_RichCompare);
}

View File

@ -1,8 +0,0 @@
#ifndef COM_TROLLTECH_QT_NETWORK_INIT_H
#define COM_TROLLTECH_QT_NETWORK_INIT_H
#include "PythonQtSystem.h"
PYTHONQT_EXPORT void PythonQt_init_QtNetwork(PyObject* module);
#endif // COM_TROLLTECH_QT_NETWORK_INIT_H

View File

@ -1,79 +0,0 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/parser)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/parser/rpp)
add_definitions(-DRXX_ALLOCATOR_INIT_0)
set(SOURCES
abstractmetabuilder.cpp
abstractmetalang.cpp
asttoxml.cpp
customtypes.cpp
fileout.cpp
generator.cpp
generatorset.cpp
generatorsetqtscript.cpp
main.cpp
metajava.cpp
metaqtscriptbuilder.cpp
metaqtscript.cpp
parser/ast.cpp
parser/binder.cpp
parser/class_compiler.cpp
parser/codemodel.cpp
parser/codemodel_finder.cpp
parser/compiler_utils.cpp
parser/control.cpp
parser/declarator_compiler.cpp
parser/default_visitor.cpp
parser/dumptree.cpp
parser/lexer.cpp
parser/list.cpp
parser/name_compiler.cpp
parser/parser.cpp
parser/rpp/builtin-macros.cpp
parser/rpp/preprocessor.cpp
parser/smallobject.cpp
parser/tokens.cpp
parser/type_compiler.cpp
parser/visitor.cpp
prigenerator.cpp
reporthandler.cpp
setupgenerator.cpp
shellgenerator.cpp
shellheadergenerator.cpp
shellimplgenerator.cpp
typeparser.cpp
typesystem.cpp
)
set(HEADERS
fileout.h
generator.h
generatorset.h
generatorsetqtscript.h
prigenerator.h
setupgenerator.h
shellgenerator.h
shellheadergenerator.h
shellimplgenerator.h
)
set(RESOURCES
generator.qrc
)
qt4_wrap_cpp(MOC ${HEADERS})
qt4_add_resources(QRC ${RESOURCES})
add_executable(pythonqt-generator
EXCLUDE_FROM_ALL
${SOURCES}
${MOC}
${QRC}
)
target_link_libraries(pythonqt-generator
${QT_LIBRARIES}
)

File diff suppressed because it is too large Load Diff

View File

@ -1,180 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ABSTRACTMETABUILDER_H
#define ABSTRACTMETABUILDER_H
#include "codemodel.h"
#include "abstractmetalang.h"
#include "typesystem.h"
#include "typeparser.h"
#include <QtCore/QSet>
class AbstractMetaBuilder
{
public:
enum RejectReason {
NotInTypeSystem,
GenerationDisabled,
RedefinedToNotClass,
UnmatchedArgumentType,
UnmatchedReturnType,
NoReason
};
AbstractMetaBuilder();
virtual ~AbstractMetaBuilder() {};
AbstractMetaClassList classes() const { return m_meta_classes; }
AbstractMetaClassList classesTopologicalSorted() const;
FileModelItem model() const { return m_dom; }
void setModel(FileModelItem item) { m_dom = item; }
ScopeModelItem popScope() { return m_scopes.takeLast(); }
void pushScope(ScopeModelItem item) { m_scopes << item; }
ScopeModelItem currentScope() const { return m_scopes.last(); }
QString fileName() const { return m_file_name; }
void setFileName(const QString &fileName) { m_file_name = fileName; }
void dumpLog();
bool build();
void figureOutEnumValuesForClass(AbstractMetaClass *meta_class, QSet<AbstractMetaClass *> *classes);
int figureOutEnumValue(const QString &name, int value, AbstractMetaEnum *meta_enum, AbstractMetaFunction *meta_function = 0);
void figureOutEnumValues();
void figureOutDefaultEnumArguments();
void addAbstractMetaClass(AbstractMetaClass *cls);
AbstractMetaClass *traverseTypeAlias(TypeAliasModelItem item);
AbstractMetaClass *traverseClass(ClassModelItem item);
bool setupInheritance(AbstractMetaClass *meta_class);
AbstractMetaClass *traverseNamespace(NamespaceModelItem item);
AbstractMetaEnum *traverseEnum(EnumModelItem item, AbstractMetaClass *enclosing, const QSet<QString> &enumsDeclarations);
void traverseEnums(ScopeModelItem item, AbstractMetaClass *parent, const QStringList &enumsDeclarations);
void traverseFunctions(ScopeModelItem item, AbstractMetaClass *parent);
void traverseFields(ScopeModelItem item, AbstractMetaClass *parent);
void traverseStreamOperator(FunctionModelItem function_item);
void traverseCompareOperator(FunctionModelItem item);
void traverseBinaryArithmeticOperator(FunctionModelItem item);
AbstractMetaFunction *traverseFunction(FunctionModelItem function);
AbstractMetaField *traverseField(VariableModelItem field, const AbstractMetaClass *cls);
void checkFunctionModifications();
void registerHashFunction(FunctionModelItem function_item);
void registerToStringCapability(FunctionModelItem function_item);
void parseQ_Property(AbstractMetaClass *meta_class, const QStringList &declarations);
void setupEquals(AbstractMetaClass *meta_class);
void setupComparable(AbstractMetaClass *meta_class);
void setupClonable(AbstractMetaClass *cls);
void setupFunctionDefaults(AbstractMetaFunction *meta_function, AbstractMetaClass *meta_class);
QString translateDefaultValue(ArgumentModelItem item, AbstractMetaType *type,
AbstractMetaFunction *fnc, AbstractMetaClass *,
int argument_index);
AbstractMetaType *translateType(const TypeInfo &type, bool *ok, bool resolveType = true, bool resolveScope = true);
void decideUsagePattern(AbstractMetaType *type);
bool inheritTemplate(AbstractMetaClass *subclass,
const AbstractMetaClass *template_class,
const TypeParser::Info &info);
AbstractMetaType *inheritTemplateType(const QList<AbstractMetaType *> &template_types, AbstractMetaType *meta_type, bool *ok = 0);
bool isQObject(const QString &qualified_name);
bool isEnum(const QStringList &qualified_name);
void fixQObjectForScope (TypeDatabase *types,
NamespaceModelItem item);
// QtScript
QSet<QString> qtMetaTypeDeclaredTypeNames() const
{ return m_qmetatype_declared_typenames; }
protected:
AbstractMetaClass *argumentToClass(ArgumentModelItem);
virtual AbstractMetaClass *createMetaClass() = 0;
virtual AbstractMetaEnum *createMetaEnum() = 0;
virtual AbstractMetaEnumValue *createMetaEnumValue() = 0;
virtual AbstractMetaField *createMetaField() = 0;
virtual AbstractMetaFunction *createMetaFunction() = 0;
virtual AbstractMetaArgument *createMetaArgument() = 0;
virtual AbstractMetaType *createMetaType() = 0;
private:
void sortLists();
QString m_file_name;
AbstractMetaClassList m_meta_classes;
AbstractMetaClassList m_templates;
FileModelItem m_dom;
QSet<const TypeEntry *> m_used_types;
QMap<QString, RejectReason> m_rejected_classes;
QMap<QString, RejectReason> m_rejected_enums;
QMap<QString, RejectReason> m_rejected_functions;
QMap<QString, RejectReason> m_rejected_fields;
QList<AbstractMetaEnum *> m_enums;
QList<QPair<AbstractMetaArgument *, AbstractMetaFunction *> > m_enum_default_arguments;
QHash<QString, AbstractMetaEnumValue *> m_enum_values;
AbstractMetaClass *m_current_class;
QList<ScopeModelItem> m_scopes;
QString m_namespace_prefix;
QSet<AbstractMetaClass *> m_setup_inheritance_done;
// QtScript
QSet<QString> m_qmetatype_declared_typenames;
};
#endif // ABSTRACTMETBUILDER_H

File diff suppressed because it is too large Load Diff

View File

@ -1,946 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ABSTRACTMETALANG_H
#define ABSTRACTMETALANG_H
#include "codemodel.h"
#include "typesystem.h"
#include <QSet>
#include <QStringList>
#include <QTextStream>
class AbstractMeta;
class AbstractMetaClass;
class AbstractMetaField;
class AbstractMetaFunction;
class AbstractMetaType;
class AbstractMetaVariable;
class AbstractMetaArgument;
class AbstractMetaEnumValue;
class AbstractMetaEnum;
class QPropertySpec;
typedef QList<AbstractMetaField *> AbstractMetaFieldList;
typedef QList<AbstractMetaArgument *> AbstractMetaArgumentList;
typedef QList<AbstractMetaFunction *> AbstractMetaFunctionList;
class AbstractMetaClassList : public QList<AbstractMetaClass *>
{
public:
AbstractMetaClass *findClass(const QString &name) const;
AbstractMetaEnumValue *findEnumValue(const QString &string) const;
AbstractMetaEnum *findEnum(const EnumTypeEntry *entry) const;
};
class AbstractMetaAttributes
{
public:
AbstractMetaAttributes() : m_attributes(0) { };
enum Attribute {
None = 0x00000000,
Private = 0x00000001,
Protected = 0x00000002,
Public = 0x00000004,
Friendly = 0x00000008,
Visibility = 0x0000000f,
Native = 0x00000010,
Abstract = 0x00000020,
Static = 0x00000040,
FinalInTargetLang = 0x00000080,
FinalInCpp = 0x00000100,
ForceShellImplementation = 0x00000200,
GetterFunction = 0x00000400,
SetterFunction = 0x00000800,
FinalOverload = 0x00001000,
InterfaceFunction = 0x00002000,
PropertyReader = 0x00004000,
PropertyWriter = 0x00008000,
PropertyResetter = 0x00010000,
Fake = 0x00020000,
Invokable = 0x00040000,
Final = FinalInTargetLang | FinalInCpp
};
uint attributes() const { return m_attributes; }
void setAttributes(uint attributes) { m_attributes = attributes; }
uint originalAttributes() const { return m_originalAttributes; }
void setOriginalAttributes(uint attributes) { m_originalAttributes = attributes; }
uint visibility() const { return m_attributes & Visibility; }
void setVisibility(uint visi) { m_attributes = (m_attributes & ~Visibility) | visi; }
void operator+=(Attribute attribute) { m_attributes |= attribute; }
void operator-=(Attribute attribute) { m_attributes &= ~attribute; }
bool isNative() const { return m_attributes & Native; }
bool isFinal() const { return (m_attributes & Final) == Final; }
bool isFinalInTargetLang() const { return m_attributes & FinalInTargetLang; }
bool isFinalInCpp() const { return m_attributes & FinalInCpp; }
bool isAbstract() const { return m_attributes & Abstract; }
bool isStatic() const { return m_attributes & Static; }
bool isForcedShellImplementation() const { return m_attributes & ForceShellImplementation; }
bool isInterfaceFunction() const { return m_attributes & InterfaceFunction; }
bool isFinalOverload() const { return m_attributes & FinalOverload; }
bool isInvokable() const { return m_attributes & Invokable; }
bool isPropertyReader() const { return m_attributes & PropertyReader; }
bool isPropertyWriter() const { return m_attributes & PropertyWriter; }
bool isPropertyResetter() const { return m_attributes & PropertyResetter; }
bool isPrivate() const { return m_attributes & Private; }
bool isProtected() const { return m_attributes & Protected; }
bool isPublic() const { return m_attributes & Public; }
bool isFriendly() const { return m_attributes & Friendly; }
bool wasPrivate() const { return m_originalAttributes & Private; }
bool wasProtected() const { return m_originalAttributes & Protected; }
bool wasPublic() const { return m_originalAttributes & Public; }
bool wasFriendly() const { return m_originalAttributes & Friendly; }
private:
uint m_attributes;
uint m_originalAttributes;
};
class AbstractMetaType
{
public:
enum TypeUsagePattern {
InvalidPattern,
PrimitivePattern,
FlagsPattern,
EnumPattern,
ValuePattern,
StringPattern,
CharPattern,
ObjectPattern,
QObjectPattern,
NativePointerPattern,
ContainerPattern,
VariantPattern,
JObjectWrapperPattern,
ArrayPattern,
ThreadPattern
};
AbstractMetaType() :
m_type_entry(0),
m_array_element_count(0),
m_array_element_type(0),
m_original_template_type(0),
m_pattern(InvalidPattern),
m_constant(false),
m_reference(false),
m_cpp_instantiation(true),
m_indirections(0),
m_reserved(0)
{
}
QString package() const { return m_type_entry->javaPackage(); }
QString name() const { return m_type_entry->targetLangName(); }
QString fullName() const { return m_type_entry->qualifiedTargetLangName(); }
void setTypeUsagePattern(TypeUsagePattern pattern) { m_pattern = pattern; }
TypeUsagePattern typeUsagePattern() const { return m_pattern; }
// true when use pattern is container
bool hasInstantiations() const { return !m_instantiations.isEmpty(); }
void addInstantiation(AbstractMetaType *inst) { m_instantiations << inst; }
void setInstantiations(const QList<AbstractMetaType *> &insts) { m_instantiations = insts; }
QList<AbstractMetaType *> instantiations() const { return m_instantiations; }
void setInstantiationInCpp(bool incpp) { m_cpp_instantiation = incpp; }
bool hasInstantiationInCpp() const { return hasInstantiations() && m_cpp_instantiation; }
QString minimalSignature() const;
// true when the type is a QtJambiObject subclass
bool hasNativeId() const;
// returns true if the typs is used as a non complex primitive, no & or *'s
bool isPrimitive() const { return m_pattern == PrimitivePattern; }
// returns true if the type is used as an enum
bool isEnum() const { return m_pattern == EnumPattern; }
// returns true if the type is used as a QObject *
bool isQObject() const { return m_pattern == QObjectPattern; }
// returns true if the type is used as an object, e.g. Xxx *
bool isObject() const { return m_pattern == ObjectPattern; }
// returns true if the type is used as an array, e.g. Xxx[42]
bool isArray() const { return m_pattern == ArrayPattern; }
// returns true if the type is used as a value type (X or const X &)
bool isValue() const { return m_pattern == ValuePattern; }
// returns true for more complex types...
bool isNativePointer() const { return m_pattern == NativePointerPattern; }
// returns true if the type was originally a QString or const QString & or equivalent for QLatin1String
bool isTargetLangString() const { return m_pattern == StringPattern; }
// returns true if the type was originally a QChar or const QChar &
bool isTargetLangChar() const { return m_pattern == CharPattern; }
// return true if the type was originally a QVariant or const QVariant &
bool isVariant() const { return m_pattern == VariantPattern; }
// return true if the type was originally a JObjectWrapper or const JObjectWrapper &
bool isJObjectWrapper() const { return m_pattern == JObjectWrapperPattern; }
// returns true if the type was used as a container
bool isContainer() const { return m_pattern == ContainerPattern; }
// returns true if the type was used as a flag
bool isFlags() const { return m_pattern == FlagsPattern; }
// returns true if the type was used as a thread
bool isThread() const { return m_pattern == ThreadPattern; }
bool isConstant() const { return m_constant; }
void setConstant(bool constant) { m_constant = constant; }
bool isReference() const { return m_reference; }
void setReference(bool ref) { m_reference = ref; }
// Returns true if the type is to be implemented using Java enums, e.g. not plain ints.
bool isTargetLangEnum() const { return isEnum() && !((EnumTypeEntry *) typeEntry())->forceInteger(); }
bool isIntegerEnum() const { return isEnum() && !isTargetLangEnum(); }
// Returns true if the type is to be implemented using Java QFlags, e.g. not plain ints.
bool isTargetLangFlags() const {
return isFlags() && !((FlagsTypeEntry *) typeEntry())->forceInteger(); }
bool isIntegerFlags() const { return isFlags() && !isTargetLangFlags(); }
int actualIndirections() const { return m_indirections + (isReference() ? 1 : 0); }
int indirections() const { return m_indirections; }
void setIndirections(int indirections) { m_indirections = indirections; }
void setArrayElementCount(int n) { m_array_element_count = n; }
int arrayElementCount() const { return m_array_element_count; }
AbstractMetaType *arrayElementType() const { return m_array_element_type; }
void setArrayElementType(AbstractMetaType *t) { m_array_element_type = t; }
QString cppSignature() const;
AbstractMetaType *copy() const;
const TypeEntry *typeEntry() const { return m_type_entry; }
void setTypeEntry(const TypeEntry *type) { m_type_entry = type; }
void setOriginalTypeDescription(const QString &otd) { m_original_type_description = otd; }
QString originalTypeDescription() const { return m_original_type_description; }
void setOriginalTemplateType(const AbstractMetaType *type) { m_original_template_type = type; }
const AbstractMetaType *originalTemplateType() const { return m_original_template_type; }
private:
const TypeEntry *m_type_entry;
QList <AbstractMetaType *> m_instantiations;
QString m_package;
QString m_original_type_description;
int m_array_element_count;
AbstractMetaType *m_array_element_type;
const AbstractMetaType *m_original_template_type;
TypeUsagePattern m_pattern;
uint m_constant : 1;
uint m_reference : 1;
uint m_cpp_instantiation : 1;
int m_indirections : 4;
uint m_reserved : 25; // unused
};
class AbstractMetaVariable
{
public:
AbstractMetaVariable() : m_type(0) { }
AbstractMetaType *type() const { return m_type; }
void setType(AbstractMetaType *type) { m_type = type; }
QString name() const { return m_name; }
void setName(const QString &name) { m_name = name; }
private:
QString m_name;
AbstractMetaType *m_type;
};
class AbstractMetaArgument : public AbstractMetaVariable
{
public:
AbstractMetaArgument() : m_argument_index(0) { };
QString defaultValueExpression() const { return m_expression; }
void setDefaultValueExpression(const QString &expr) { m_expression = expr; }
QString originalDefaultValueExpression() const { return m_original_expression; }
void setOriginalDefaultValueExpression(const QString &expr) { m_original_expression = expr; }
QString toString() const { return type()->name() + " " + AbstractMetaVariable::name() +
(m_expression.isEmpty() ? "" : " = " + m_expression); }
int argumentIndex() const { return m_argument_index; }
void setArgumentIndex(int argIndex) { m_argument_index = argIndex; }
QString argumentName() const;
QString indexedName() const;
AbstractMetaArgument *copy() const;
private:
// Just to force people to call argumentName() And indexedName();
QString name() const;
QString m_expression;
QString m_original_expression;
int m_argument_index;
};
class AbstractMetaField : public AbstractMetaVariable, public AbstractMetaAttributes
{
public:
AbstractMetaField();
~AbstractMetaField();
const AbstractMetaClass *enclosingClass() const { return m_class; }
void setEnclosingClass(const AbstractMetaClass *cls) { m_class = cls; }
const AbstractMetaFunction *getter() const;
const AbstractMetaFunction *setter() const;
FieldModificationList modifications() const;
AbstractMetaField *copy() const;
private:
mutable AbstractMetaFunction *m_getter;
mutable AbstractMetaFunction *m_setter;
const AbstractMetaClass *m_class;
};
class AbstractMetaFunction : public AbstractMetaAttributes
{
public:
enum FunctionType {
ConstructorFunction,
DestructorFunction,
NormalFunction,
SignalFunction,
EmptyFunction,
SlotFunction,
GlobalScopeFunction
};
enum CompareResult {
EqualName = 0x00000001,
EqualArguments = 0x00000002,
EqualAttributes = 0x00000004,
EqualImplementor = 0x00000008,
EqualReturnType = 0x00000010,
EqualDefaultValueOverload = 0x00000020,
EqualModifiedName = 0x00000040,
NameLessThan = 0x00001000,
PrettySimilar = EqualName | EqualArguments,
Equal = 0x0000001f,
NotEqual = 0x00001000
};
AbstractMetaFunction()
: m_function_type(NormalFunction),
m_type(0),
m_class(0),
m_implementing_class(0),
m_declaring_class(0),
m_interface_class(0),
m_property_spec(0),
m_constant(false),
m_invalid(false)
{
}
~AbstractMetaFunction();
QString name() const { return m_name; }
void setName(const QString &name) { m_name = name; }
QString originalName() const { return m_original_name.isEmpty() ? name() : m_original_name; }
void setOriginalName(const QString &name) { m_original_name = name; }
QString modifiedName() const;
QString minimalSignature() const;
QStringList possibleIntrospectionCompatibleSignatures() const;
QString marshalledName() const;
// true if one or more of the arguments are of QtJambiObject subclasses
bool argumentsHaveNativeId() const
{
foreach (const AbstractMetaArgument *arg, m_arguments) {
if (arg->type()->hasNativeId())
return true;
}
return false;
}
bool isModifiedRemoved(int types = TypeSystem::All) const;
AbstractMetaType *type() const { return m_type; }
void setType(AbstractMetaType *type) { m_type = type; }
// The class that has this function as a member.
const AbstractMetaClass *ownerClass() const { return m_class; }
void setOwnerClass(const AbstractMetaClass *cls) { m_class = cls; }
// The first class in a hierarchy that declares the function
const AbstractMetaClass *declaringClass() const { return m_declaring_class; }
void setDeclaringClass(const AbstractMetaClass *cls) { m_declaring_class = cls; }
// The class that actually implements this function
const AbstractMetaClass *implementingClass() const { return m_implementing_class; }
void setImplementingClass(const AbstractMetaClass *cls) { m_implementing_class = cls; }
bool needsCallThrough() const;
AbstractMetaArgumentList arguments() const { return m_arguments; }
void setArguments(const AbstractMetaArgumentList &arguments) { m_arguments = arguments; }
void addArgument(AbstractMetaArgument *argument) { m_arguments << argument; }
int actualMinimumArgumentCount() const;
void setInvalid(bool on) { m_invalid = on; }
bool isInvalid() const { return m_invalid; }
bool isDeprecated() const;
bool isDestructor() const { return functionType() == DestructorFunction; }
bool isConstructor() const { return functionType() == ConstructorFunction; }
bool isNormal() const { return functionType() == NormalFunction || isSlot() || isInGlobalScope(); }
bool isInGlobalScope() const { return functionType() == GlobalScopeFunction; }
bool isSignal() const { return functionType() == SignalFunction; }
bool isSlot() const { return functionType() == SlotFunction; }
bool isEmptyFunction() const { return functionType() == EmptyFunction; }
FunctionType functionType() const { return m_function_type; }
void setFunctionType(FunctionType type) { m_function_type = type; }
bool isVirtual() { return !(isFinal() || isSignal() || isStatic()); }
QStringList introspectionCompatibleSignatures(const QStringList &resolvedArguments = QStringList()) const;
QString signature() const;
QString targetLangSignature(bool minimal = false) const;
bool shouldReturnThisObject() const { return QLatin1String("this") == argumentReplaced(0); }
bool shouldIgnoreReturnValue() const { return QLatin1String("void") == argumentReplaced(0); }
bool isConstant() const { return m_constant; }
void setConstant(bool constant) { m_constant = constant; }
QString toString() const { return m_name; }
uint compareTo(const AbstractMetaFunction *other) const;
bool operator <(const AbstractMetaFunction &a) const;
AbstractMetaFunction *copy() const;
QString replacedDefaultExpression(const AbstractMetaClass *cls, int idx) const;
bool removedDefaultExpression(const AbstractMetaClass *cls, int idx) const;
QString conversionRule(TypeSystem::Language language, int idx) const;
QList<ReferenceCount> referenceCounts(const AbstractMetaClass *cls, int idx = -2) const;
bool nullPointersDisabled(const AbstractMetaClass *cls = 0, int argument_idx = 0) const;
QString nullPointerDefaultValue(const AbstractMetaClass *cls = 0, int argument_idx = 0) const;
bool resetObjectAfterUse(int argument_idx) const;
// Returns whether garbage collection is disabled for the argument in any context
bool disabledGarbageCollection(const AbstractMetaClass *cls, int key) const;
// Returns the ownership rules for the given argument in the given context
TypeSystem::Ownership ownership(const AbstractMetaClass *cls, TypeSystem::Language language, int idx) const;
bool isVirtualSlot() const;
QString typeReplaced(int argument_index) const;
bool isRemovedFromAllLanguages(const AbstractMetaClass *) const;
bool isRemovedFrom(const AbstractMetaClass *, TypeSystem::Language language) const;
bool argumentRemoved(int) const;
QString argumentReplaced(int key) const;
bool needsSuppressUncheckedWarning() const;
bool hasModifications(const AbstractMetaClass *implementor) const;
FunctionModificationList modifications(const AbstractMetaClass *implementor) const;
// If this function stems from an interface, this returns the
// interface that declares it.
const AbstractMetaClass *interfaceClass() const { return m_interface_class; }
void setInterfaceClass(const AbstractMetaClass *cl) { m_interface_class = cl; }
void setPropertySpec(QPropertySpec *spec) { m_property_spec = spec; }
QPropertySpec *propertySpec() const { return m_property_spec; }
private:
QString m_name;
QString m_original_name;
mutable QString m_cached_minimal_signature;
mutable QString m_cached_modified_name;
FunctionType m_function_type;
AbstractMetaType *m_type;
const AbstractMetaClass *m_class;
const AbstractMetaClass *m_implementing_class;
const AbstractMetaClass *m_declaring_class;
const AbstractMetaClass *m_interface_class;
QPropertySpec *m_property_spec;
AbstractMetaArgumentList m_arguments;
uint m_constant : 1;
uint m_invalid : 1;
};
class AbstractMetaEnumValue
{
public:
AbstractMetaEnumValue()
: m_value_set(false), m_value(0)
{
}
int value() const { return m_value; }
void setValue(int value) { m_value_set = true; m_value = value; }
QString stringValue() const { return m_string_value; }
void setStringValue(const QString &v) { m_string_value = v; }
QString name() const { return m_name; }
void setName(const QString &name) { m_name = name; }
bool isValueSet() const { return m_value_set; }
private:
QString m_name;
QString m_string_value;
bool m_value_set;
int m_value;
};
class AbstractMetaEnumValueList : public QList<AbstractMetaEnumValue *>
{
public:
AbstractMetaEnumValue *find(const QString &name) const;
};
class AbstractMetaEnum : public AbstractMetaAttributes
{
public:
AbstractMetaEnum() : m_type_entry(0), m_class(0), m_has_qenums_declaration(false) {}
AbstractMetaEnumValueList values() const { return m_enum_values; }
void addEnumValue(AbstractMetaEnumValue *enumValue) { m_enum_values << enumValue; }
QString name() const { return m_type_entry->targetLangName(); }
QString qualifier() const { return m_type_entry->javaQualifier(); }
QString package() const { return m_type_entry->javaPackage(); }
QString fullName() const { return package() + "." + qualifier() + "." + name(); }
// Has the enum been declared inside a Q_ENUMS() macro in its enclosing class?
void setHasQEnumsDeclaration(bool on) { m_has_qenums_declaration = on; }
bool hasQEnumsDeclaration() const { return m_has_qenums_declaration; }
EnumTypeEntry *typeEntry() const { return m_type_entry; }
void setTypeEntry(EnumTypeEntry *entry) { m_type_entry = entry; }
AbstractMetaClass *enclosingClass() const { return m_class; }
void setEnclosingClass(AbstractMetaClass *c) { m_class = c; }
private:
AbstractMetaEnumValueList m_enum_values;
EnumTypeEntry *m_type_entry;
AbstractMetaClass *m_class;
uint m_has_qenums_declaration : 1;
uint m_reserved : 31;
};
typedef QList<AbstractMetaEnum *> AbstractMetaEnumList;
class AbstractMetaClass : public AbstractMetaAttributes
{
public:
enum FunctionQueryOption {
Constructors = 0x000001, // Only constructors
//Destructors = 0x000002, // Only destructors. Not included in class.
VirtualFunctions = 0x000004, // Only virtual functions (virtual in both TargetLang and C++)
FinalInTargetLangFunctions = 0x000008, // Only functions that are non-virtual in TargetLang
FinalInCppFunctions = 0x000010, // Only functions that are non-virtual in C++
ClassImplements = 0x000020, // Only functions implemented by the current class
Inconsistent = 0x000040, // Only inconsistent functions (inconsistent virtualness in TargetLang/C++)
StaticFunctions = 0x000080, // Only static functions
Signals = 0x000100, // Only signals
NormalFunctions = 0x000200, // Only functions that aren't signals
Visible = 0x000400, // Only public and protected functions
ForcedShellFunctions = 0x000800, // Only functions that are overridden to be implemented in the shell class
WasPublic = 0x001000, // Only functions that were originally public
WasProtected = 0x002000, // Only functions that were originally protected
NonStaticFunctions = 0x004000, // No static functions
Empty = 0x008000, // Empty overrides of abstract functions
Invisible = 0x010000, // Only private functions
VirtualInCppFunctions = 0x020000, // Only functions that are virtual in C++
NonEmptyFunctions = 0x040000, // Only functions with JNI implementations
VirtualInTargetLangFunctions = 0x080000, // Only functions which are virtual in TargetLang
AbstractFunctions = 0x100000, // Only abstract functions
WasVisible = 0x200000, // Only functions that were public or protected in the original code
NotRemovedFromTargetLang = 0x400000, // Only functions that have not been removed from TargetLang
NotRemovedFromShell = 0x800000, // Only functions that have not been removed from the shell class
VirtualSlots = 0x1000000 // Only functions that are set as virtual slots in the type system
};
AbstractMetaClass()
: m_namespace(false),
m_qobject(false),
m_has_virtuals(false),
m_has_nonpublic(false),
m_has_virtual_slots(false),
m_has_nonprivateconstructor(false),
m_functions_fixed(false),
m_has_public_destructor(true),
m_force_shell_class(false),
m_has_hash_function(false),
m_has_equals_operator(false),
m_has_clone_operator(false),
m_is_type_alias(false),
m_enclosing_class(0),
m_base_class(0),
m_template_base_class(0),
m_extracted_interface(0),
m_primary_interface_implementor(0),
m_type_entry(0),
m_qDebug_stream_function(0)
{
}
virtual ~AbstractMetaClass();
AbstractMetaClass *extractInterface();
void fixFunctions();
AbstractMetaFunctionList functions() const { return m_functions; }
void setFunctions(const AbstractMetaFunctionList &functions);
void addFunction(AbstractMetaFunction *function);
bool hasFunction(const AbstractMetaFunction *f) const;
bool hasFunction(const QString &str) const;
bool hasSignal(const AbstractMetaFunction *f) const;
bool hasConstructors() const;
void addDefaultConstructor();
bool hasNonPrivateConstructor() const { return m_has_nonprivateconstructor; }
void setHasNonPrivateConstructor(bool on) { m_has_nonprivateconstructor = on; }
bool hasPublicDestructor() const { return m_has_public_destructor; }
void setHasPublicDestructor(bool on) { m_has_public_destructor = on; }
AbstractMetaFunctionList queryFunctionsByName(const QString &name) const;
AbstractMetaFunctionList queryFunctions(uint query) const;
inline AbstractMetaFunctionList allVirtualFunctions() const;
inline AbstractMetaFunctionList allFinalFunctions() const;
AbstractMetaFunctionList functionsInTargetLang() const;
AbstractMetaFunctionList functionsInShellClass() const;
inline AbstractMetaFunctionList cppInconsistentFunctions() const;
inline AbstractMetaFunctionList cppSignalFunctions() const;
AbstractMetaFunctionList publicOverrideFunctions() const;
AbstractMetaFunctionList virtualOverrideFunctions() const;
AbstractMetaFunctionList virtualFunctions() const;
AbstractMetaFunctionList nonVirtualShellFunctions() const;
AbstractMetaFieldList fields() const { return m_fields; }
void setFields(const AbstractMetaFieldList &fields) { m_fields = fields; }
void addField(AbstractMetaField *field) { m_fields << field; }
AbstractMetaEnumList enums() const { return m_enums; }
void setEnums(const AbstractMetaEnumList &enums) { m_enums = enums; }
void addEnum(AbstractMetaEnum *e) { m_enums << e; }
AbstractMetaEnum *findEnum(const QString &enumName);
AbstractMetaEnum *findEnumForValue(const QString &enumName);
AbstractMetaEnumValue *findEnumValue(const QString &enumName, AbstractMetaEnum *meta_enum);
AbstractMetaClassList interfaces() const { return m_interfaces; }
void addInterface(AbstractMetaClass *interface);
void setInterfaces(const AbstractMetaClassList &interface);
QString fullName() const { return package() + "." + name(); }
QString name() const;
QString baseClassName() const { return m_base_class ? m_base_class->name() : QString(); }
AbstractMetaClass *baseClass() const { return m_base_class; }
void setBaseClass(AbstractMetaClass *base_class) { m_base_class = base_class; }
const AbstractMetaClass *enclosingClass() const { return m_enclosing_class; }
void setEnclosingClass(AbstractMetaClass *cl) { m_enclosing_class = cl; }
QString package() const { return m_type_entry->javaPackage(); }
bool isInterface() const { return m_type_entry->isInterface(); }
bool isNamespace() const { return m_type_entry->isNamespace(); }
bool isQObject() const { return m_type_entry->isQObject(); }
bool isQtNamespace() const { return isNamespace() && name() == "Qt"; }
QString qualifiedCppName() const { return m_type_entry->qualifiedCppName(); }
bool hasInconsistentFunctions() const;
bool hasSignals() const;
bool inheritsFrom(const AbstractMetaClass *other) const;
void setForceShellClass(bool on) { m_force_shell_class = on; }
bool generateShellClass() const;
bool hasVirtualSlots() const { return m_has_virtual_slots; }
bool hasVirtualFunctions() const { return !isFinal() && m_has_virtuals; }
bool hasProtectedFunctions() const;
QList<TypeEntry *> templateArguments() const { return m_template_args; }
void setTemplateArguments(const QList<TypeEntry *> &args) { m_template_args = args; }
bool hasFieldAccessors() const;
// only valid during metajavabuilder's run
QStringList baseClassNames() const { return m_base_class_names; }
void setBaseClassNames(const QStringList &names) { m_base_class_names = names; }
AbstractMetaClass *primaryInterfaceImplementor() const { return m_primary_interface_implementor; }
void setPrimaryInterfaceImplementor(AbstractMetaClass *cl) { m_primary_interface_implementor = cl; }
const ComplexTypeEntry *typeEntry() const { return m_type_entry; }
ComplexTypeEntry *typeEntry() { return m_type_entry; }
void setTypeEntry(ComplexTypeEntry *type) { m_type_entry = type; }
void setHasHashFunction(bool on) { m_has_hash_function = on; }
bool hasHashFunction() const { return m_has_hash_function; }
void setToStringCapability(FunctionModelItem fun) { m_qDebug_stream_function= fun; }
FunctionModelItem hasToStringCapability() const { return m_qDebug_stream_function; }
virtual bool hasDefaultToStringFunction() const;
void setHasEqualsOperator(bool on) { m_has_equals_operator = on; }
bool hasEqualsOperator() const { return m_has_equals_operator; }
void setHasCloneOperator(bool on) { m_has_clone_operator = on; }
bool hasCloneOperator() const { return m_has_clone_operator; }
bool hasDefaultIsNull() const;
void addPropertySpec(QPropertySpec *spec) { m_property_specs << spec; }
QList<QPropertySpec *> propertySpecs() const { return m_property_specs; }
QPropertySpec *propertySpecForRead(const QString &name) const;
QPropertySpec *propertySpecForWrite(const QString &name) const;
QPropertySpec *propertySpecForReset(const QString &name) const;
QList<ReferenceCount> referenceCounts() const;
void setEqualsFunctions(const AbstractMetaFunctionList &lst) { m_equals_functions = lst; }
AbstractMetaFunctionList equalsFunctions() const { return m_equals_functions; }
void setNotEqualsFunctions(const AbstractMetaFunctionList &lst) { m_nequals_functions = lst; }
AbstractMetaFunctionList notEqualsFunctions() const { return m_nequals_functions; }
void setLessThanFunctions(const AbstractMetaFunctionList &lst) { m_less_than_functions = lst; }
AbstractMetaFunctionList lessThanFunctions() const { return m_less_than_functions; }
void setGreaterThanFunctions(const AbstractMetaFunctionList &lst) { m_greater_than_functions = lst; }
AbstractMetaFunctionList greaterThanFunctions() const { return m_greater_than_functions; }
void setLessThanEqFunctions(const AbstractMetaFunctionList &lst) { m_less_than_eq_functions = lst; }
AbstractMetaFunctionList lessThanEqFunctions() const { return m_less_than_eq_functions; }
void setGreaterThanEqFunctions(const AbstractMetaFunctionList &lst) { m_greater_than_eq_functions = lst; }
AbstractMetaFunctionList greaterThanEqFunctions() const { return m_greater_than_eq_functions; }
void sortFunctions();
const AbstractMetaClass *templateBaseClass() const { return m_template_base_class; }
void setTemplateBaseClass(const AbstractMetaClass *cls) { m_template_base_class = cls; }
void setTypeAlias(bool typeAlias) { m_is_type_alias = typeAlias; }
bool isTypeAlias() const { return m_is_type_alias; }
bool operator <(const AbstractMetaClass &a) const {
return qualifiedCppName() < a.qualifiedCppName();
}
private:
uint m_namespace : 1;
uint m_qobject : 1;
uint m_has_virtuals : 1;
uint m_has_nonpublic : 1;
uint m_has_virtual_slots : 1;
uint m_has_nonprivateconstructor : 1;
uint m_functions_fixed : 1;
uint m_has_public_destructor : 1;
uint m_force_shell_class : 1;
uint m_has_hash_function : 1;
uint m_has_equals_operator : 1;
uint m_has_clone_operator :1;
uint m_is_type_alias : 1;
uint m_reserved : 19;
const AbstractMetaClass *m_enclosing_class;
AbstractMetaClass *m_base_class;
const AbstractMetaClass *m_template_base_class;
AbstractMetaFunctionList m_functions;
AbstractMetaFieldList m_fields;
AbstractMetaEnumList m_enums;
AbstractMetaClassList m_interfaces;
AbstractMetaClass *m_extracted_interface;
AbstractMetaClass *m_primary_interface_implementor;
QList<QPropertySpec *> m_property_specs;
AbstractMetaFunctionList m_equals_functions;
AbstractMetaFunctionList m_nequals_functions;
AbstractMetaFunctionList m_less_than_functions;
AbstractMetaFunctionList m_greater_than_functions;
AbstractMetaFunctionList m_less_than_eq_functions;
AbstractMetaFunctionList m_greater_than_eq_functions;
QStringList m_base_class_names;
QList<TypeEntry *> m_template_args;
ComplexTypeEntry *m_type_entry;
FunctionModelItem m_qDebug_stream_function;
};
class QPropertySpec {
public:
QPropertySpec(const TypeEntry *type)
: m_type(type),
m_index(-1)
{
}
const TypeEntry *type() const { return m_type; }
QString name() const { return m_name; }
void setName(const QString &name) { m_name = name; }
QString read() const { return m_read; }
void setRead(const QString &read) { m_read = read; }
QString write() const { return m_write; }
void setWrite(const QString &write) { m_write = write; }
QString designable() const { return m_designable; }
void setDesignable(const QString &designable) { m_designable = designable; }
QString reset() const { return m_reset; }
void setReset(const QString &reset) { m_reset = reset; }
int index() const { return m_index; }
void setIndex(int index) { m_index = index; }
private:
QString m_name;
QString m_read;
QString m_write;
QString m_designable;
QString m_reset;
const TypeEntry *m_type;
int m_index;
};
inline AbstractMetaFunctionList AbstractMetaClass::allVirtualFunctions() const
{
return queryFunctions(VirtualFunctions
| NotRemovedFromTargetLang);
}
inline AbstractMetaFunctionList AbstractMetaClass::allFinalFunctions() const
{
return queryFunctions(FinalInTargetLangFunctions
| FinalInCppFunctions
| NotRemovedFromTargetLang);
}
inline AbstractMetaFunctionList AbstractMetaClass::cppInconsistentFunctions() const
{
return queryFunctions(Inconsistent
| NormalFunctions
| Visible
| NotRemovedFromTargetLang);
}
inline AbstractMetaFunctionList AbstractMetaClass::cppSignalFunctions() const
{
return queryFunctions(Signals
| Visible
| NotRemovedFromTargetLang);
}
#endif // ABSTRACTMETALANG_H

View File

@ -1,171 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "asttoxml.h"
#include "control.h"
#include "parser.h"
#include "binder.h"
#include <QXmlStreamWriter>
#include <QTextStream>
#include <QTextCodec>
#include <QFile>
void astToXML(QString name) {
QFile file(name);
if (!file.open(QFile::ReadOnly))
return;
QTextStream stream(&file);
stream.setCodec(QTextCodec::codecForName("UTF-8"));
QByteArray contents = stream.readAll().toUtf8();
file.close();
Control control;
Parser p(&control);
pool __pool;
TranslationUnitAST *ast = p.parse(contents, contents.size(), &__pool);
CodeModel model;
Binder binder(&model, p.location());
FileModelItem dom = binder.run(ast);
QFile outputFile;
if (!outputFile.open(stdout, QIODevice::WriteOnly))
{
return;
}
QXmlStreamWriter s( &outputFile);
s.setAutoFormatting( true );
s.writeStartElement("code");
QHash<QString, NamespaceModelItem> namespaceMap = dom->namespaceMap();
foreach (NamespaceModelItem item, namespaceMap.values()) {
writeOutNamespace(s, item);
}
QHash<QString, ClassModelItem> typeMap = dom->classMap();
foreach (ClassModelItem item, typeMap.values()) {
writeOutClass(s, item);
}
s.writeEndElement();
}
void writeOutNamespace(QXmlStreamWriter &s, NamespaceModelItem &item) {
s.writeStartElement("namespace");
s.writeAttribute("name", item->name());
QHash<QString, NamespaceModelItem> namespaceMap = item->namespaceMap();
foreach (NamespaceModelItem namespaceItem, namespaceMap.values()) {
writeOutNamespace(s, namespaceItem);
}
QHash<QString, ClassModelItem> typeMap = item->classMap();
foreach (ClassModelItem classItem, typeMap.values()) {
writeOutClass(s, classItem);
}
QHash<QString, EnumModelItem> enumMap = item->enumMap();
foreach (EnumModelItem enumItem, enumMap.values()) {
writeOutEnum(s, enumItem);
}
s.writeEndElement();
}
void writeOutEnum(QXmlStreamWriter &s, EnumModelItem &item) {
QString qualified_name = item->qualifiedName().join("::");
s.writeStartElement("enum");
s.writeAttribute("name", qualified_name);
EnumeratorList enumList = item->enumerators();
for(int i=0; i < enumList.size() ; i++) {
s.writeStartElement("enumerator");
if( !enumList[i]->value().isEmpty() )
s.writeAttribute("value", enumList[i]->value());
s.writeCharacters(enumList[i]->name());
s.writeEndElement();
}
s.writeEndElement();
}
void writeOutFunction(QXmlStreamWriter &s, FunctionModelItem &item) {
QString qualified_name = item->qualifiedName().join("::");
s.writeStartElement("function");
s.writeAttribute("name", qualified_name);
ArgumentList arguments = item->arguments();
for(int i=0; i < arguments.size() ; i++) {
s.writeStartElement("argument");
s.writeAttribute("type", arguments[i]->type().qualifiedName().join("::"));
s.writeEndElement();
}
s.writeEndElement();
}
void writeOutClass(QXmlStreamWriter &s, ClassModelItem &item) {
QString qualified_name = item->qualifiedName().join("::");
s.writeStartElement("class");
s.writeAttribute("name", qualified_name);
QHash<QString, EnumModelItem> enumMap = item->enumMap();
foreach (EnumModelItem enumItem, enumMap.values()) {
writeOutEnum(s, enumItem);
}
QHash<QString, FunctionModelItem> functionMap = item->functionMap();
foreach (FunctionModelItem funcItem, functionMap.values()) {
writeOutFunction(s, funcItem);
}
QHash<QString, ClassModelItem> typeMap = item->classMap();
foreach (ClassModelItem classItem, typeMap.values()) {
writeOutClass(s, classItem);
}
s.writeEndElement();
}

View File

@ -1,58 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ASTTOXML
#define ASTTOXML
#include "codemodel.h"
#include <QString>
#include <QXmlStreamWriter>
void astToXML(const QString name);
void writeOutNamespace(QXmlStreamWriter &s, NamespaceModelItem &item);
void writeOutEnum(QXmlStreamWriter &s, EnumModelItem &item);
void writeOutFunction(QXmlStreamWriter &s, FunctionModelItem &item);
void writeOutClass(QXmlStreamWriter &s, ClassModelItem &item);
#endif // ASTTOXML

View File

@ -1,69 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "customtypes.h"
#include "metajava.h"
#include <QtCore/QDebug>
#include <QtCore/QTextStream>
void QModelIndexTypeEntry::generateCppJavaToQt(QTextStream &s,
const AbstractMetaType *,
const QString &env_name,
const QString &qt_name,
const QString &java_name) const
{
s << "QModelIndex " << qt_name << " = qtjambi_to_QModelIndex(" << env_name << ", "
<< java_name << ")";
}
void QModelIndexTypeEntry::generateCppQtToJava(QTextStream &s,
const AbstractMetaType *,
const QString &env_name,
const QString &qt_name,
const QString &java_name) const
{
s << "jobject " << java_name << " = qtjambi_from_QModelIndex(" << env_name << ", "
<< qt_name << ")";
}

View File

@ -1,74 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CUSTOMTYPES_H
#define CUSTOMTYPES_H
#include "typesystem.h"
class QModelIndexTypeEntry : public CustomTypeEntry
{
public:
QModelIndexTypeEntry() : CustomTypeEntry("QModelIndex")
{
setCodeGeneration(GenerateNothing);
}
virtual QString javaPackage() const { return "com.trolltech.qt.core"; }
virtual bool isValue() const { return true; }
virtual void generateCppJavaToQt(QTextStream &s,
const AbstractMetaType *java_type,
const QString &env_name,
const QString &qt_name,
const QString &java_name) const;
virtual void generateCppQtToJava(QTextStream &s,
const AbstractMetaType *java_type,
const QString &env_name,
const QString &qt_name,
const QString &java_name) const;
};
#endif

View File

@ -1,238 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "fileout.h"
#include "reporthandler.h"
#include <QFileInfo>
#include <QDir>
bool FileOut::dummy = false;
bool FileOut::diff = false;
bool FileOut::license = false;
#ifdef Q_OS_LINUX
const char* colorDelete = "\033[31m";
const char* colorAdd = "\033[32m";
const char* colorInfo = "\033[36m";
const char* colorReset = "\033[0m";
#else
const char* colorDelete = "";
const char* colorAdd = "";
const char* colorInfo = "";
const char* colorReset = "";
#endif
FileOut::FileOut(QString n):
name(n),
stream(&tmp),
isDone(false)
{}
static int* lcsLength(QList<QByteArray> a, QList<QByteArray> b) {
const int height = a.size() + 1;
const int width = b.size() + 1;
int *res = new int[width * height];
for (int row=0; row<height; row++) {
res[width * row] = 0;
}
for (int col=0; col<width; col++) {
res[col] = 0;
}
for (int row=1; row<height; row++) {
for (int col=1; col<width; col++) {
if (a[row-1] == b[col-1])
res[width * row + col] = res[width * (row-1) + col-1] + 1;
else
res[width * row + col] = qMax(res[width * row + col-1],
res[width * (row-1) + col]);
}
}
return res;
}
enum Type {Add, Delete, Unchanged};
struct Unit
{
Unit(Type type, int pos) :
type(type),
start(pos),
end(pos)
{}
Type type;
int start;
int end;
void print(QList<QByteArray> a, QList<QByteArray> b){
{
if (type == Unchanged) {
if ((end - start) > 9) {
for (int i = start; i <= start+2; i++)
printf(" %s\n", a[i].data());
printf("%s=\n= %d more lines\n=%s\n", colorInfo, end - start - 6, colorReset);
for (int i = end-2; i <= end; i++)
printf(" %s\n", a[i].data());
}
else
for (int i = start; i <= end; i++)
printf(" %s\n", a[i].data());
}
else if(type == Add) {
printf("%s", colorAdd);
for (int i = start; i <= end; i++){
printf("+ %s\n", b[i].data());
}
printf("%s", colorReset);
}
else if (type == Delete) {
printf("%s", colorDelete);
for (int i = start; i <= end; i++) {
printf("- %s\n", a[i].data());
}
printf("%s", colorReset);
}
}
}
};
static QList<Unit*> *unitAppend(QList<Unit*> *res, Type type, int pos)
{
if (res == 0) {
res = new QList<Unit*>;
res->append(new Unit(type, pos));
return res;
}
Unit *last = res->last();
if (last->type == type) {
last->end = pos;
} else {
res->append(new Unit(type, pos));
}
return res;
}
static QList<Unit*> *diffHelper(int *lcs, QList<QByteArray> a, QList<QByteArray> b, int row, int col) {
if (row>0 && col>0 && (a[row-1] == b[col-1])) {
return unitAppend(diffHelper(lcs, a, b, row-1, col-1), Unchanged, row-1);
}
else {
int width = b.size()+1;
if ((col > 0) && ((row==0) ||
lcs[width * row + col-1] >= lcs[width * (row-1) + col]))
{
return unitAppend(diffHelper(lcs, a, b, row, col-1), Add, col-1);
}
else if((row > 0) && ((col==0) ||
lcs[width * row + col-1] < lcs[width * (row-1) + col])){
return unitAppend(diffHelper(lcs, a, b, row-1, col), Delete, row-1);;
}
}
delete lcs;
return 0;
}
static void diff(QList<QByteArray> a, QList<QByteArray> b) {
QList<Unit*> *res = diffHelper(lcsLength(a, b), a, b, a.size(), b.size());
for (int i=0; i < res->size(); i++) {
Unit *unit = res->at(i);
unit->print(a, b);
delete(unit);
}
delete(res);
}
bool FileOut::done() {
Q_ASSERT( !isDone );
isDone = true;
bool fileEqual = false;
QFile fileRead(name);
QFileInfo info(fileRead);
stream.flush();
QByteArray original;
if (info.exists() && (diff || (info.size() == tmp.size()))) {
if ( !fileRead.open(QIODevice::ReadOnly) ) {
ReportHandler::warning(QString("failed to open file '%1' for reading")
.arg(fileRead.fileName()));
return false;
}
original = fileRead.readAll();
fileRead.close();
fileEqual = (original == tmp);
}
if( !fileEqual ) {
if( !FileOut::dummy ) {
QDir dir(info.absolutePath());
if (!dir.mkpath(dir.absolutePath())) {
ReportHandler::warning(QString("unable to create directory '%1'")
.arg(dir.absolutePath()));
return false;
}
QFile fileWrite(name);
if (!fileWrite.open(QIODevice::WriteOnly)) {
ReportHandler::warning(QString("failed to open file '%1' for writing")
.arg(fileWrite.fileName()));
return false;
}
stream.setDevice(&fileWrite);
stream << tmp;
}
if (diff) {
printf("%sFile: %s%s\n", colorInfo, qPrintable(name), colorReset);
::diff(original.split('\n'), tmp.split('\n'));
printf("\n");
}
return true;
}
return false;
}

View File

@ -1,77 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef FILEOUT_H
#define FILEOUT_H
#include <QObject>
#include <QFile>
#include <QTextStream>
class FileOut : public QObject
{
Q_OBJECT
private:
QByteArray tmp;
QString name;
public:
FileOut(QString name);
~FileOut()
{
if( !isDone )
done();
}
bool done();
QTextStream stream;
static bool dummy;
static bool diff;
static bool license;
private:
bool isDone;
};
#endif // FILEOUT_H

View File

@ -1,142 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "generator.h"
#include "reporthandler.h"
#include "fileout.h"
#include <QDir>
#include <QFile>
#include <QFileInfo>
Generator::Generator()
{
m_num_generated = 0;
m_num_generated_written = 0;
m_out_dir = ".";
}
void Generator::generate()
{
if (m_classes.size() == 0) {
ReportHandler::warning(QString("%1: no java classes, skipping")
.arg(metaObject()->className()));
return;
}
qStableSort(m_classes);
foreach (AbstractMetaClass *cls, m_classes) {
if (!shouldGenerate(cls))
continue;
QString fileName = fileNameForClass(cls);
ReportHandler::debugSparse(QString("generating: %1").arg(fileName));
FileOut fileOut(outputDirectory() + "/" + subDirectoryForClass(cls) + "/" + fileName);
write(fileOut.stream, cls);
if( fileOut.done() )
++m_num_generated_written;
++m_num_generated;
}
}
void Generator::printClasses()
{
QTextStream s(stdout);
AbstractMetaClassList classes = m_classes;
qSort(classes);
foreach (AbstractMetaClass *cls, classes) {
if (!shouldGenerate(cls))
continue;
write(s, cls);
s << endl << endl;
}
}
void Generator::verifyDirectoryFor(const QFile &file)
{
QDir dir = QFileInfo(file).dir();
if (!dir.exists()) {
if (!dir.mkpath(dir.absolutePath()))
ReportHandler::warning(QString("unable to create directory '%1'")
.arg(dir.absolutePath()));
}
}
QString Generator::subDirectoryForClass(const AbstractMetaClass *) const
{
Q_ASSERT(false);
return QString();
}
QString Generator::fileNameForClass(const AbstractMetaClass *) const
{
Q_ASSERT(false);
return QString();
}
void Generator::write(QTextStream &, const AbstractMetaClass *)
{
Q_ASSERT(false);
}
bool Generator::hasDefaultConstructor(const AbstractMetaType *type)
{
QString full_name = type->typeEntry()->qualifiedTargetLangName();
QString class_name = type->typeEntry()->targetLangName();
foreach (const AbstractMetaClass *java_class, m_classes) {
if (java_class->typeEntry()->qualifiedTargetLangName() == full_name) {
AbstractMetaFunctionList functions = java_class->functions();
foreach (const AbstractMetaFunction *function, functions) {
if (function->arguments().size() == 0 && function->name() == class_name)
return true;
}
return false;
}
}
return false;
}

View File

@ -1,165 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef GENERATOR_H
#define GENERATOR_H
#include "metajava.h"
#include "typesystem.h"
#include "codemodel.h"
#include <QObject>
#include <QFile>
class Generator : public QObject
{
Q_OBJECT
Q_PROPERTY(QString outputDirectory READ outputDirectory WRITE setOutputDirectory);
public:
enum Option {
NoOption = 0x00000000,
BoxedPrimitive = 0x00000001,
ExcludeConst = 0x00000002,
ExcludeReference = 0x00000004,
UseNativeIds = 0x00000008,
EnumAsInts = 0x00000010,
SkipName = 0x00000020,
NoCasts = 0x00000040,
SkipReturnType = 0x00000080,
OriginalName = 0x00000100,
ShowStatic = 0x00000200,
UnderscoreSpaces = 0x00000400,
ForceEnumCast = 0x00000800,
ArrayAsPointer = 0x00001000,
VirtualCall = 0x00002000,
SkipTemplateParameters = 0x00004000,
SkipAttributes = 0x00008000,
OriginalTypeDescription = 0x00010000,
SkipRemovedArguments = 0x00020000,
IncludeDefaultExpression = 0x00040000,
NoReturnStatement = 0x00080000,
NoBlockedSlot = 0x00100000,
SuperCall = 0x00200000,
// These 2 are added for PythonQt
FirstArgIsWrappedObject = 0x00400000,
ConvertReferenceToPtr = 0x00800000,
GlobalRefJObject = 0x00100000,
ForceValueType = ExcludeReference | ExcludeConst
};
Generator();
void setClasses(const AbstractMetaClassList &classes) { m_classes = classes; }
AbstractMetaClassList classes() const { return m_classes; }
QString outputDirectory() const { return m_out_dir; }
void setOutputDirectory(const QString &outDir) { m_out_dir = outDir; }
virtual void generate();
void printClasses();
int numGenerated() { return m_num_generated; }
int numGeneratedAndWritten() { return m_num_generated_written; }
virtual bool shouldGenerate(const AbstractMetaClass *) const { return true; }
virtual QString subDirectoryForClass(const AbstractMetaClass *java_class) const;
virtual QString fileNameForClass(const AbstractMetaClass *java_class) const;
virtual void write(QTextStream &s, const AbstractMetaClass *java_class);
bool hasDefaultConstructor(const AbstractMetaType *type);
// QtScript
void setQtMetaTypeDeclaredTypeNames(const QSet<QString> &names)
{ m_qmetatype_declared_typenames = names; }
QSet<QString> qtMetaTypeDeclaredTypeNames() const
{ return m_qmetatype_declared_typenames; }
protected:
void verifyDirectoryFor(const QFile &file);
AbstractMetaClassList m_classes;
int m_num_generated;
int m_num_generated_written;
QString m_out_dir;
// QtScript
QSet<QString> m_qmetatype_declared_typenames;
};
class Indentor {
public:
Indentor():
indent(0)
{}
int indent;
};
class Indentation {
public:
Indentation(Indentor &indentor):
indentor(indentor)
{
indentor.indent++;
}
~Indentation()
{
indentor.indent--;
}
private:
Indentor &indentor;
};
inline QTextStream &operator <<(QTextStream &s, const Indentor &indentor)
{
for (int i=0; i<indentor.indent; ++i)
s << " ";
return s;
}
#endif // GENERATOR_H

View File

@ -1,9 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/trolltech/generator/">
<file>qtscript_masterinclude.h</file>
<file alias="typesystem_core.txt">typesystem_core.xml</file>
<file alias="typesystem_gui.txt">typesystem_gui.xml</file>
<file alias="typesystem_network.txt">typesystem_network.xml</file>
<file>parser/rpp/pp-qt-configuration</file>
</qresource>
</RCC>

View File

@ -1,57 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "generatorset.h"
GeneratorSet::GeneratorSet() :
outDir(".."),
printStdout(false)
{}
bool GeneratorSet::readParameters(const QMap<QString, QString> args) {
if (args.contains("output-directory")) {
outDir = args.value("output-directory");
}
printStdout = args.contains("print-stdout");
return !(args.contains("help") || args.contains("h") || args.contains("?"));
}

View File

@ -1,68 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef GENERATOR_SET_H
#define GENERATOR_SET_H
#include <QObject>
#include <QString>
#include <QStringList>
#include <QMap>
class GeneratorSet : public QObject
{
Q_OBJECT
public:
GeneratorSet();
virtual QString usage() = 0;
virtual bool readParameters(const QMap<QString, QString> args) = 0;
virtual void buildModel(const QString pp_file) = 0;
virtual void dumpObjectTree() = 0;
virtual QString generate() = 0;
static GeneratorSet *getInstance();
QString outDir;
bool printStdout;
};
#endif // GENERATOR_SET_H

View File

@ -1,123 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "generatorsetqtscript.h"
#include "reporthandler.h"
#include "shellheadergenerator.h"
#include "shellimplgenerator.h"
GeneratorSet *GeneratorSet::getInstance() {
return new GeneratorSetQtScript();
}
GeneratorSetQtScript::GeneratorSetQtScript()
{}
QString GeneratorSetQtScript::usage() {
QString usage =
"QtScript:\n"
" --nothing-to-report-yet \n";
return usage;
}
bool GeneratorSetQtScript::readParameters(const QMap<QString, QString> args) {
return GeneratorSet::readParameters(args);
}
void GeneratorSetQtScript::buildModel(const QString pp_file) {
// Building the code inforamation...
ReportHandler::setContext("MetaJavaBuilder");
builder.setFileName(pp_file);
builder.build();
}
void GeneratorSetQtScript::dumpObjectTree() {
}
QString GeneratorSetQtScript::generate() {
AbstractMetaClassList classes = builder.classesTopologicalSorted();
QSet<QString> declaredTypeNames = builder.qtMetaTypeDeclaredTypeNames();
PriGenerator priGenerator;
priGenerator.setOutputDirectory(outDir);
SetupGenerator setupGenerator;
setupGenerator.setOutputDirectory(outDir);
setupGenerator.setQtMetaTypeDeclaredTypeNames(declaredTypeNames);
setupGenerator.setClasses(classes);
ShellImplGenerator shellImplGenerator(&priGenerator);
shellImplGenerator.setOutputDirectory(outDir);
shellImplGenerator.setClasses(classes);
shellImplGenerator.setQtMetaTypeDeclaredTypeNames(declaredTypeNames);
shellImplGenerator.generate();
ShellHeaderGenerator shellHeaderGenerator(&priGenerator, &setupGenerator);
shellHeaderGenerator.setOutputDirectory(outDir);
shellHeaderGenerator.setClasses(classes);
shellHeaderGenerator.generate();
priGenerator.generate();
setupGenerator.generate();
return QString("Classes in typesystem: %1\n"
"Generated:\n"
" - header....: %4 (%5)\n"
" - impl......: %6 (%7)\n"
" - modules...: %8 (%9)\n"
" - pri.......: %10 (%11)\n"
)
.arg(builder.classes().size())
.arg(shellHeaderGenerator.numGenerated())
.arg(shellHeaderGenerator.numGeneratedAndWritten())
.arg(shellImplGenerator.numGenerated())
.arg(shellImplGenerator.numGeneratedAndWritten())
.arg(setupGenerator.numGenerated())
.arg(setupGenerator.numGeneratedAndWritten())
.arg(priGenerator.numGenerated())
.arg(priGenerator.numGeneratedAndWritten());
}

View File

@ -1,68 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef GENERATOR_SET_QT_SCRIPT_H
#define GENERATOR_SET_QT_SCRIPT_H
#include "generatorset.h"
#include "metaqtscriptbuilder.h"
class GeneratorSetQtScript : public GeneratorSet
{
Q_OBJECT
public:
GeneratorSetQtScript();
QString usage();
bool readParameters(const QMap<QString, QString> args);
void buildModel(const QString pp_file);
void dumpObjectTree();
QString generate( );
private:
MetaQtScriptBuilder builder;
};
#endif // GENERATOR_SET_QT_SCRIPT_H

View File

@ -1,182 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "main.h"
#include "asttoxml.h"
#include "reporthandler.h"
#include "typesystem.h"
#include "generatorset.h"
#include "fileout.h"
#include <QDir>
void displayHelp(GeneratorSet *generatorSet);
#include <QDebug>
int main(int argc, char *argv[])
{
GeneratorSet *gs = GeneratorSet::getInstance();
QString default_file = ":/trolltech/generator/qtscript_masterinclude.h";
QString default_system = ":/trolltech/generator/build_all.txt";
QString fileName;
QString typesystemFileName;
QString pp_file = ".preprocessed.tmp";
QStringList rebuild_classes;
QMap<QString, QString> args;
int argNum = 0;
for (int i=1; i<argc; ++i) {
QString arg(argv[i]);
arg = arg.trimmed();
if( arg.startsWith("--") ) {
int split = arg.indexOf("=");
if( split > 0 )
args[arg.mid(2).left(split-2)] = arg.mid(split + 1).trimmed();
else
args[arg.mid(2)] = QString();
} else if( arg.startsWith("-")) {
args[arg.mid(1)] = QString();
} else {
argNum++;
args[QString("arg-%1").arg(argNum)] = arg;
}
}
if (args.contains("no-suppress-warnings")) {
TypeDatabase *db = TypeDatabase::instance();
db->setSuppressWarnings(false);
}
if (args.contains("debug-level")) {
QString level = args.value("debug-level");
if (level == "sparse")
ReportHandler::setDebugLevel(ReportHandler::SparseDebug);
else if (level == "medium")
ReportHandler::setDebugLevel(ReportHandler::MediumDebug);
else if (level == "full")
ReportHandler::setDebugLevel(ReportHandler::FullDebug);
}
if (args.contains("dummy")) {
FileOut::dummy = true;
}
if (args.contains("diff")) {
FileOut::diff = true;
}
if (args.contains("license"))
FileOut::license = true;
if (args.contains("rebuild-only")) {
QStringList classes = args.value("rebuild-only").split(",", QString::SkipEmptyParts);
TypeDatabase::instance()->setRebuildClasses(classes);
}
fileName = args.value("arg-1");
typesystemFileName = args.value("arg-2");
if (args.contains("arg-3"))
displayHelp(gs);
if (fileName.isEmpty())
fileName = default_file;
if (typesystemFileName.isEmpty())
typesystemFileName = default_system;
if (fileName.isEmpty() || typesystemFileName.isEmpty() )
displayHelp(gs);
if (!gs->readParameters(args))
displayHelp(gs);
printf("Please wait while source files are being generated...\n");
if (!TypeDatabase::instance()->parseFile(typesystemFileName))
qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName));
if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) {
fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName));
return 1;
}
if (args.contains("ast-to-xml")) {
astToXML(pp_file);
return 0;
}
gs->buildModel(pp_file);
if (args.contains("dump-object-tree")) {
gs->dumpObjectTree();
return 0;
}
printf("%s\n", qPrintable(gs->generate()));
printf("Done, %d warnings (%d known issues)\n", ReportHandler::warningCount(),
ReportHandler::suppressedCount());
}
void displayHelp(GeneratorSet* generatorSet) {
#if defined(Q_OS_WIN32)
char path_splitter = ';';
#else
char path_splitter = ':';
#endif
printf("Usage:\n generator [options] header-file typesystem-file\n\n");
printf("Available options:\n\n");
printf("General:\n");
printf(" --debug-level=[sparse|medium|full] \n"
" --dump-object-tree \n"
" --help, -h or -? \n"
" --no-suppress-warnings \n"
" --output-directory=[dir] \n"
" --include-paths=<path>[%c<path>%c...] \n"
" --print-stdout \n",
path_splitter, path_splitter);
printf("%s", qPrintable( generatorSet->usage()));
exit(0);
}

View File

@ -1,144 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef MAIN_H
#define MAIN_H
#include "pp.h"
#include <QFile>
#include <QDir>
struct Preprocess
{
static bool preprocess(const QString &sourceFile, const QString &targetFile, const QString &commandLineIncludes = QString())
{
rpp::pp_environment env;
rpp::pp preprocess(env);
rpp::pp_null_output_iterator null_out;
const char *ppconfig = ":/trolltech/generator/parser/rpp/pp-qt-configuration";
QFile file(ppconfig);
if (!file.open(QFile::ReadOnly)) {
fprintf(stderr, "Preprocessor configuration file not found '%s'\n", ppconfig);
return false;
}
QByteArray ba = file.readAll();
file.close();
preprocess.operator() (ba.constData(), ba.constData() + ba.size(), null_out);
QStringList includes;
includes << QString(".");
#if defined(Q_OS_WIN32)
char *path_splitter = ";";
#else
const char *path_splitter = ":";
#endif
// Environment INCLUDE
QString includePath = getenv("INCLUDE");
if (!includePath.isEmpty())
includes += includePath.split(path_splitter);
// Includes from the command line
if (!commandLineIncludes.isEmpty())
includes += commandLineIncludes.split(path_splitter);
// Include Qt
QString qtdir = getenv ("QTDIR");
if (qtdir.isEmpty()) {
#if defined(Q_OS_MAC)
qWarning("QTDIR environment variable not set. Assuming standard binary install using frameworks.");
QString frameworkDir = "/Library/Frameworks";
includes << (frameworkDir + "/QtXml.framework/Headers");
includes << (frameworkDir + "/QtNetwork.framework/Headers");
includes << (frameworkDir + "/QtCore.framework/Headers");
includes << (frameworkDir + "/QtGui.framework/Headers");
includes << (frameworkDir + "/QtOpenGL.framework/Headers");
includes << frameworkDir;
#else
qWarning("QTDIR environment variable not set. This may cause problems with finding the necessary include files.");
#endif
} else {
qtdir += "/include";
includes << (qtdir + "/QtXml");
includes << (qtdir + "/QtNetwork");
includes << (qtdir + "/QtCore");
includes << (qtdir + "/QtGui");
includes << (qtdir + "/QtOpenGL");
includes << qtdir;
}
foreach (QString include, includes)
preprocess.push_include_path(QDir::convertSeparators(include).toStdString());
QString currentDir = QDir::current().absolutePath();
QFileInfo sourceInfo(sourceFile);
QDir::setCurrent(sourceInfo.absolutePath());
std::string result;
result.reserve (20 * 1024); // 20K
result += "# 1 \"builtins\"\n";
result += "# 1 \"";
result += sourceFile.toStdString();
result += "\"\n";
preprocess.file (sourceInfo.fileName().toStdString(),
rpp::pp_output_iterator<std::string> (result));
QDir::setCurrent(currentDir);
QFile f(targetFile);
if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) {
fprintf(stderr, "Failed to write preprocessed file: %s\n", qPrintable(targetFile));
}
f.write(result.c_str(), result.length());
return true;
}
};
#endif // MAIN_H

View File

@ -1,42 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "metajava.h"

View File

@ -1,79 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef METAJAVA_H
#define METAJAVA_H
#include "abstractmetalang.h"
class MetaJavaClass;
class MetaJavaField;
class MetaJavaFunction;
class MetaJavaType;
class MetaJavaVariable;
class MetaJavaArgument;
class MetaJavaEnumValue;
class MetaJavaEnum;
class MetaJavaType : public AbstractMetaType
{};
class MetaJavaArgument : public AbstractMetaArgument
{};
class MetaJavaField : public AbstractMetaField
{};
class MetaJavaFunction : public AbstractMetaFunction
{};
class MetaJavaEnumValue : public AbstractMetaEnumValue
{};
class MetaJavaEnum : public AbstractMetaEnum
{};
class MetaJavaClass : public AbstractMetaClass
{};
#endif // METAJAVA_H

View File

@ -1,48 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "metaqtscript.h"
bool MetaQtScriptClass::hasDefaultToStringFunction() const
{
return AbstractMetaClass::hasDefaultToStringFunction();
}

View File

@ -1,81 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef METAQTSCRIPT_H
#define METAQTSCRIPT_H
#include "abstractmetalang.h"
class MetaQtScriptClass;
class MetaQtScriptField;
class MetaQtScriptFunction;
class MetaQtScriptType;
class MetaQtScriptVariable;
class MetaQtScriptArgument;
class MetaQtScriptEnumValue;
class MetaQtScriptEnum;
class MetaQtScriptType : public AbstractMetaType
{};
class MetaQtScriptArgument : public AbstractMetaArgument
{};
class MetaQtScriptField : public AbstractMetaField
{};
class MetaQtScriptFunction : public AbstractMetaFunction
{};
class MetaQtScriptEnumValue : public AbstractMetaEnumValue
{};
class MetaQtScriptEnum : public AbstractMetaEnum
{};
class MetaQtScriptClass : public AbstractMetaClass
{
virtual bool hasDefaultToStringFunction() const;
};
#endif // METAQTSCRIPT_H

View File

@ -1,43 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "metaqtscriptbuilder.h"

View File

@ -1,89 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef METAQTSCRIPTBUILDER_H
#define METAQTSCRIPTBUILDER_H
#include "abstractmetabuilder.h"
#include "metaqtscript.h"
class MetaQtScriptBuilder : public AbstractMetaBuilder
{
protected:
virtual MetaQtScriptClass *createMetaClass()
{
return new MetaQtScriptClass();
};
virtual MetaQtScriptEnum *createMetaEnum()
{
return new MetaQtScriptEnum();
};
virtual MetaQtScriptEnumValue *createMetaEnumValue()
{
return new MetaQtScriptEnumValue();
};
virtual MetaQtScriptField *createMetaField()
{
return new MetaQtScriptField();
};
virtual MetaQtScriptFunction *createMetaFunction()
{
return new MetaQtScriptFunction();
};
virtual MetaQtScriptArgument *createMetaArgument()
{
return new MetaQtScriptArgument();
};
virtual MetaQtScriptType *createMetaType()
{
return new MetaQtScriptType();
};
};
#endif // METAQTSCRIPTBUILDER_H

View File

@ -1,52 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "ast.h"
#include "lexer.h"
// kate: space-indent on; indent-width 2; replace-tabs on;
QString AST::toString(TokenStream *stream) const
{
const Token &tk = stream->token((int) start_token);
const Token &end_tk = stream->token ((int) end_token);
return QString::fromLatin1(tk.text + tk.position, end_tk.position - tk.position);
}

View File

@ -1,899 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef AST_H
#define AST_H
#include "smallobject.h"
#include "list.h"
class QString;
#define DECLARE_AST_NODE(k) \
enum { __node_kind = Kind_##k };
class TokenStream;
struct AccessSpecifierAST;
struct AsmDefinitionAST;
struct BaseClauseAST;
struct BaseSpecifierAST;
struct BinaryExpressionAST;
struct CastExpressionAST;
struct ClassMemberAccessAST;
struct ClassSpecifierAST;
struct CompoundStatementAST;
struct ConditionAST;
struct ConditionalExpressionAST;
struct CppCastExpressionAST;
struct CtorInitializerAST;
struct DeclarationAST;
struct DeclarationStatementAST;
struct DeclaratorAST;
struct DeleteExpressionAST;
struct DoStatementAST;
struct ElaboratedTypeSpecifierAST;
struct EnumSpecifierAST;
struct EnumeratorAST;
struct ExceptionSpecificationAST;
struct ExpressionAST;
struct ExpressionOrDeclarationStatementAST;
struct ExpressionStatementAST;
struct ForStatementAST;
struct FunctionCallAST;
struct FunctionDefinitionAST;
struct IfStatementAST;
struct IncrDecrExpressionAST;
struct InitDeclaratorAST;
struct InitializerAST;
struct InitializerClauseAST;
struct LabeledStatementAST;
struct LinkageBodyAST;
struct LinkageSpecificationAST;
struct MemInitializerAST;
struct NameAST;
struct NamespaceAST;
struct NamespaceAliasDefinitionAST;
struct NewDeclaratorAST;
struct NewExpressionAST;
struct NewInitializerAST;
struct NewTypeIdAST;
struct OperatorAST;
struct OperatorFunctionIdAST;
struct ParameterDeclarationAST;
struct ParameterDeclarationClauseAST;
struct PostfixExpressionAST;
struct PrimaryExpressionAST;
struct PtrOperatorAST;
struct PtrToMemberAST;
struct ReturnStatementAST;
struct SimpleDeclarationAST;
struct SimpleTypeSpecifierAST;
struct SizeofExpressionAST;
struct StatementAST;
struct StringLiteralAST;
struct SubscriptExpressionAST;
struct SwitchStatementAST;
struct TemplateArgumentAST;
struct TemplateDeclarationAST;
struct TemplateParameterAST;
struct ThrowExpressionAST;
struct TranslationUnitAST;
struct TryBlockStatementAST;
struct TypeIdAST;
struct TypeIdentificationAST;
struct TypeParameterAST;
struct TypeSpecifierAST;
struct TypedefAST;
struct UnaryExpressionAST;
struct UnqualifiedNameAST;
struct UsingAST;
struct UsingDirectiveAST;
struct WhileStatementAST;
struct WinDeclSpecAST;
struct QPropertyAST;
struct QEnumsAST;
struct AST
{
enum NODE_KIND
{
Kind_UNKNOWN = 0,
Kind_AccessSpecifier,
Kind_AsmDefinition,
Kind_BaseClause,
Kind_BaseSpecifier,
Kind_BinaryExpression,
Kind_CastExpression,
Kind_ClassMemberAccess,
Kind_ClassSpecifier,
Kind_CompoundStatement,
Kind_Condition,
Kind_ConditionalExpression,
Kind_CppCastExpression,
Kind_CtorInitializer,
Kind_DeclarationStatement,
Kind_Declarator,
Kind_DeleteExpression,
Kind_DoStatement,
Kind_ElaboratedTypeSpecifier,
Kind_EnumSpecifier,
Kind_Enumerator,
Kind_ExceptionSpecification,
Kind_ExpressionOrDeclarationStatement,
Kind_ExpressionStatement,
Kind_ForStatement,
Kind_FunctionCall,
Kind_FunctionDefinition,
Kind_IfStatement,
Kind_IncrDecrExpression,
Kind_InitDeclarator,
Kind_Initializer,
Kind_InitializerClause,
Kind_LabeledStatement,
Kind_LinkageBody,
Kind_LinkageSpecification,
Kind_MemInitializer,
Kind_Name,
Kind_Namespace,
Kind_NamespaceAliasDefinition,
Kind_NewDeclarator,
Kind_NewExpression,
Kind_NewInitializer,
Kind_NewTypeId,
Kind_Operator,
Kind_OperatorFunctionId,
Kind_ParameterDeclaration,
Kind_ParameterDeclarationClause,
Kind_PostfixExpression,
Kind_PrimaryExpression,
Kind_PtrOperator,
Kind_PtrToMember,
Kind_ReturnStatement,
Kind_SimpleDeclaration,
Kind_SimpleTypeSpecifier,
Kind_SizeofExpression,
Kind_StringLiteral,
Kind_SubscriptExpression,
Kind_SwitchStatement,
Kind_TemplateArgument,
Kind_TemplateDeclaration,
Kind_TemplateParameter,
Kind_ThrowExpression,
Kind_TranslationUnit,
Kind_TryBlockStatement,
Kind_TypeId,
Kind_TypeIdentification,
Kind_TypeParameter,
Kind_Typedef,
Kind_UnaryExpression,
Kind_UnqualifiedName,
Kind_Using,
Kind_UsingDirective,
Kind_WhileStatement,
Kind_WinDeclSpec,
Kind_QPropertyAST,
Kind_ForwardDeclarationSpecifier,
Kind_QEnumsAST,
NODE_KIND_COUNT
};
QString toString(TokenStream *stream) const;
int kind;
std::size_t start_token;
std::size_t end_token;
};
struct TypeSpecifierAST: public AST
{
const ListNode<std::size_t> *cv;
};
struct StatementAST: public AST
{
};
struct ExpressionAST: public AST
{
};
struct DeclarationAST: public AST
{
};
struct AccessSpecifierAST: public DeclarationAST
{
DECLARE_AST_NODE(AccessSpecifier)
const ListNode<std::size_t> *specs;
};
struct AsmDefinitionAST: public DeclarationAST
{
DECLARE_AST_NODE(AsmDefinition)
const ListNode<std::size_t> *cv;
};
struct BaseClauseAST: public AST // ### kill me
{
DECLARE_AST_NODE(BaseClause)
const ListNode<BaseSpecifierAST*> *base_specifiers;
};
struct BaseSpecifierAST: public AST
{
DECLARE_AST_NODE(BaseSpecifier)
std::size_t virt;
std::size_t access_specifier;
NameAST *name;
};
struct BinaryExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(BinaryExpression)
std::size_t op;
ExpressionAST *left_expression;
ExpressionAST *right_expression;
};
struct CastExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(CastExpression)
TypeIdAST *type_id;
ExpressionAST *expression;
};
struct ClassMemberAccessAST: public ExpressionAST
{
DECLARE_AST_NODE(ClassMemberAccess)
std::size_t op;
NameAST *name;
};
struct ClassSpecifierAST: public TypeSpecifierAST
{
DECLARE_AST_NODE(ClassSpecifier)
WinDeclSpecAST *win_decl_specifiers;
std::size_t class_key;
NameAST *name;
BaseClauseAST *base_clause;
const ListNode<DeclarationAST*> *member_specs;
};
struct ForwardDeclarationSpecifierAST: public TypeSpecifierAST
{
DECLARE_AST_NODE(ForwardDeclarationSpecifier)
std::size_t class_key;
NameAST *name;
BaseClauseAST *base_clause;
};
struct CompoundStatementAST: public StatementAST
{
DECLARE_AST_NODE(CompoundStatement)
const ListNode<StatementAST*> *statements;
};
struct ConditionAST: public AST
{
DECLARE_AST_NODE(Condition)
TypeSpecifierAST *type_specifier;
DeclaratorAST *declarator;
ExpressionAST *expression;
};
struct ConditionalExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(ConditionalExpression)
ExpressionAST *condition;
ExpressionAST *left_expression;
ExpressionAST *right_expression;
};
struct CppCastExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(CppCastExpression)
std::size_t op;
TypeIdAST *type_id;
ExpressionAST *expression;
const ListNode<ExpressionAST*> *sub_expressions;
};
struct CtorInitializerAST: public AST
{
DECLARE_AST_NODE(CtorInitializer)
std::size_t colon;
const ListNode<MemInitializerAST*> *member_initializers;
};
struct DeclarationStatementAST: public StatementAST
{
DECLARE_AST_NODE(DeclarationStatement)
DeclarationAST *declaration;
};
struct DeclaratorAST: public AST
{
DECLARE_AST_NODE(Declarator)
const ListNode<PtrOperatorAST*> *ptr_ops;
DeclaratorAST *sub_declarator;
NameAST *id;
ExpressionAST *bit_expression;
const ListNode<ExpressionAST*> *array_dimensions;
ParameterDeclarationClauseAST *parameter_declaration_clause;
const ListNode<std::size_t> *fun_cv;
ExceptionSpecificationAST *exception_spec;
};
struct DeleteExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(DeleteExpression)
std::size_t scope_token;
std::size_t delete_token;
std::size_t lbracket_token;
std::size_t rbracket_token;
ExpressionAST *expression;
};
struct DoStatementAST: public StatementAST
{
DECLARE_AST_NODE(DoStatement)
StatementAST *statement;
ExpressionAST *expression;
};
struct ElaboratedTypeSpecifierAST: public TypeSpecifierAST
{
DECLARE_AST_NODE(ElaboratedTypeSpecifier)
std::size_t type;
NameAST *name;
};
struct EnumSpecifierAST: public TypeSpecifierAST
{
DECLARE_AST_NODE(EnumSpecifier)
NameAST *name;
const ListNode<EnumeratorAST*> *enumerators;
};
struct EnumeratorAST: public AST
{
DECLARE_AST_NODE(Enumerator)
std::size_t id;
ExpressionAST *expression;
};
struct ExceptionSpecificationAST: public AST
{
DECLARE_AST_NODE(ExceptionSpecification)
std::size_t ellipsis;
const ListNode<TypeIdAST*> *type_ids;
};
struct ExpressionOrDeclarationStatementAST: public StatementAST
{
DECLARE_AST_NODE(ExpressionOrDeclarationStatement)
StatementAST *expression;
StatementAST *declaration;
};
struct ExpressionStatementAST: public StatementAST
{
DECLARE_AST_NODE(ExpressionStatement)
ExpressionAST *expression;
};
struct FunctionCallAST: public ExpressionAST
{
DECLARE_AST_NODE(FunctionCall)
ExpressionAST *arguments;
};
struct FunctionDefinitionAST: public DeclarationAST
{
DECLARE_AST_NODE(FunctionDefinition)
const ListNode<std::size_t> *storage_specifiers;
const ListNode<std::size_t> *function_specifiers;
TypeSpecifierAST *type_specifier;
InitDeclaratorAST *init_declarator;
StatementAST *function_body;
WinDeclSpecAST *win_decl_specifiers;
};
struct ForStatementAST: public StatementAST
{
DECLARE_AST_NODE(ForStatement)
StatementAST *init_statement;
ConditionAST *condition;
ExpressionAST *expression;
StatementAST *statement;
};
struct IfStatementAST: public StatementAST
{
DECLARE_AST_NODE(IfStatement)
ConditionAST *condition;
StatementAST *statement;
StatementAST *else_statement;
};
struct IncrDecrExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(IncrDecrExpression)
std::size_t op;
};
struct InitDeclaratorAST: public AST
{
DECLARE_AST_NODE(InitDeclarator)
DeclaratorAST *declarator;
InitializerAST *initializer;
};
struct InitializerAST: public AST
{
DECLARE_AST_NODE(Initializer)
InitializerClauseAST *initializer_clause;
ExpressionAST *expression;
};
struct InitializerClauseAST: public AST
{
DECLARE_AST_NODE(InitializerClause)
ExpressionAST *expression;
};
struct LabeledStatementAST: public StatementAST
{
DECLARE_AST_NODE(LabeledStatement)
};
struct LinkageBodyAST: public AST
{
DECLARE_AST_NODE(LinkageBody)
const ListNode<DeclarationAST*> *declarations;
};
struct LinkageSpecificationAST: public DeclarationAST
{
DECLARE_AST_NODE(LinkageSpecification)
std::size_t extern_type;
LinkageBodyAST *linkage_body;
DeclarationAST *declaration;
};
struct MemInitializerAST: public AST
{
DECLARE_AST_NODE(MemInitializer)
NameAST *initializer_id;
ExpressionAST *expression;
};
struct NameAST: public AST
{
DECLARE_AST_NODE(Name)
bool global;
const ListNode<UnqualifiedNameAST*> *qualified_names;
UnqualifiedNameAST *unqualified_name;
};
struct NamespaceAST: public DeclarationAST
{
DECLARE_AST_NODE(Namespace)
std::size_t namespace_name;
LinkageBodyAST *linkage_body;
};
struct NamespaceAliasDefinitionAST: public DeclarationAST
{
DECLARE_AST_NODE(NamespaceAliasDefinition)
std::size_t namespace_name;
NameAST *alias_name;
};
struct NewDeclaratorAST: public AST
{
DECLARE_AST_NODE(NewDeclarator)
PtrOperatorAST *ptr_op;
NewDeclaratorAST *sub_declarator;
const ListNode<ExpressionAST*> *expressions;
};
struct NewExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(NewExpression)
std::size_t scope_token;
std::size_t new_token;
ExpressionAST *expression;
TypeIdAST *type_id;
NewTypeIdAST *new_type_id;
NewInitializerAST *new_initializer;
};
struct NewInitializerAST: public AST
{
DECLARE_AST_NODE(NewInitializer)
ExpressionAST *expression;
};
struct NewTypeIdAST: public AST
{
DECLARE_AST_NODE(NewTypeId)
TypeSpecifierAST *type_specifier;
NewInitializerAST *new_initializer;
NewDeclaratorAST *new_declarator;
};
struct OperatorAST: public AST
{
DECLARE_AST_NODE(Operator)
std::size_t op;
std::size_t open;
std::size_t close;
};
struct OperatorFunctionIdAST: public AST
{
DECLARE_AST_NODE(OperatorFunctionId)
OperatorAST *op;
TypeSpecifierAST *type_specifier;
const ListNode<PtrOperatorAST*> *ptr_ops;
};
struct ParameterDeclarationAST: public AST
{
DECLARE_AST_NODE(ParameterDeclaration)
TypeSpecifierAST *type_specifier;
DeclaratorAST *declarator;
ExpressionAST *expression;
};
struct ParameterDeclarationClauseAST: public AST
{
DECLARE_AST_NODE(ParameterDeclarationClause)
const ListNode<ParameterDeclarationAST*> *parameter_declarations;
std::size_t ellipsis;
};
struct PostfixExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(PostfixExpression)
TypeSpecifierAST *type_specifier;
ExpressionAST *expression;
const ListNode<ExpressionAST*> *sub_expressions;
};
struct PrimaryExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(PrimaryExpression)
StringLiteralAST *literal;
std::size_t token;
StatementAST *expression_statement;
ExpressionAST *sub_expression;
NameAST *name;
};
struct PtrOperatorAST: public AST
{
DECLARE_AST_NODE(PtrOperator)
const ListNode<std::size_t> *cv;
std::size_t op;
PtrToMemberAST *mem_ptr;
};
struct PtrToMemberAST: public AST
{
DECLARE_AST_NODE(PtrToMember)
};
struct ReturnStatementAST: public StatementAST
{
DECLARE_AST_NODE(ReturnStatement)
ExpressionAST *expression;
};
struct SimpleDeclarationAST: public DeclarationAST
{
DECLARE_AST_NODE(SimpleDeclaration)
const ListNode<std::size_t> *storage_specifiers;
const ListNode<std::size_t> *function_specifiers;
TypeSpecifierAST *type_specifier;
const ListNode<InitDeclaratorAST*> *init_declarators;
WinDeclSpecAST *win_decl_specifiers;
};
struct SimpleTypeSpecifierAST: public TypeSpecifierAST
{
DECLARE_AST_NODE(SimpleTypeSpecifier)
const ListNode<std::size_t> *integrals;
std::size_t type_of;
TypeIdAST *type_id;
ExpressionAST *expression;
NameAST *name;
};
struct SizeofExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(SizeofExpression)
std::size_t sizeof_token;
TypeIdAST *type_id;
ExpressionAST *expression;
};
struct StringLiteralAST: public AST
{
DECLARE_AST_NODE(StringLiteral)
const ListNode<std::size_t> *literals;
};
struct SubscriptExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(SubscriptExpression)
ExpressionAST *subscript;
};
struct SwitchStatementAST: public StatementAST
{
DECLARE_AST_NODE(SwitchStatement)
ConditionAST *condition;
StatementAST *statement;
};
struct TemplateArgumentAST: public AST
{
DECLARE_AST_NODE(TemplateArgument)
TypeIdAST *type_id;
ExpressionAST *expression;
};
struct TemplateDeclarationAST: public DeclarationAST
{
DECLARE_AST_NODE(TemplateDeclaration)
std::size_t exported;
const ListNode<TemplateParameterAST*> *template_parameters;
DeclarationAST* declaration;
};
struct TemplateParameterAST: public AST
{
DECLARE_AST_NODE(TemplateParameter)
TypeParameterAST *type_parameter;
ParameterDeclarationAST *parameter_declaration;
};
struct ThrowExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(ThrowExpression)
std::size_t throw_token;
ExpressionAST *expression;
};
struct TranslationUnitAST: public AST
{
DECLARE_AST_NODE(TranslationUnit)
const ListNode<DeclarationAST*> *declarations;
};
struct TryBlockStatementAST: public StatementAST
{
DECLARE_AST_NODE(TryBlockStatement)
};
struct TypeIdAST: public AST
{
DECLARE_AST_NODE(TypeId)
TypeSpecifierAST *type_specifier;
DeclaratorAST *declarator;
};
struct TypeIdentificationAST: public ExpressionAST
{
DECLARE_AST_NODE(TypeIdentification)
std::size_t typename_token;
NameAST *name;
ExpressionAST *expression;
};
struct TypeParameterAST: public AST
{
DECLARE_AST_NODE(TypeParameter)
std::size_t type;
NameAST *name;
TypeIdAST *type_id;
const ListNode<TemplateParameterAST*> *template_parameters;
NameAST *template_name;
};
struct TypedefAST: public DeclarationAST
{
DECLARE_AST_NODE(Typedef)
TypeSpecifierAST *type_specifier;
const ListNode<InitDeclaratorAST*> *init_declarators;
};
struct UnaryExpressionAST: public ExpressionAST
{
DECLARE_AST_NODE(UnaryExpression)
std::size_t op;
ExpressionAST *expression;
};
struct UnqualifiedNameAST: public AST
{
DECLARE_AST_NODE(UnqualifiedName)
std::size_t tilde;
std::size_t id;
OperatorFunctionIdAST *operator_id;
const ListNode<TemplateArgumentAST*> *template_arguments;
};
struct UsingAST: public DeclarationAST
{
DECLARE_AST_NODE(Using)
std::size_t type_name;
NameAST *name;
};
struct UsingDirectiveAST: public DeclarationAST
{
DECLARE_AST_NODE(UsingDirective)
NameAST *name;
};
struct WhileStatementAST: public StatementAST
{
DECLARE_AST_NODE(WhileStatement)
ConditionAST *condition;
StatementAST *statement;
};
struct WinDeclSpecAST: public AST
{
DECLARE_AST_NODE(WinDeclSpec)
std::size_t specifier;
std::size_t modifier;
};
struct QPropertyAST : public DeclarationAST
{
DECLARE_AST_NODE(QPropertyAST)
};
struct QEnumsAST : public DeclarationAST
{
DECLARE_AST_NODE(QEnumsAST)
};
template <class _Tp>
_Tp *CreateNode(pool *memory_pool)
{
_Tp *node = reinterpret_cast<_Tp*>(memory_pool->allocate(sizeof(_Tp)));
node->kind = _Tp::__node_kind;
return node;
}
template <class _Tp>
_Tp ast_cast(AST *item)
{
if (item && static_cast<_Tp>(0)->__node_kind == item->kind)
return static_cast<_Tp>(item);
return 0;
}
#endif // AST_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,923 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "binder.h"
#include "lexer.h"
#include "control.h"
#include "symbol.h"
#include "codemodel_finder.h"
#include "class_compiler.h"
#include "compiler_utils.h"
#include "tokens.h"
#include "dumptree.h"
#include <iostream>
#include <qdebug.h>
Binder::Binder(CodeModel *__model, LocationManager &__location, Control *__control)
: _M_model(__model),
_M_location(__location),
_M_token_stream(&_M_location.token_stream),
_M_control(__control),
_M_current_function_type(CodeModel::Normal),
type_cc(this),
name_cc(this),
decl_cc(this)
{
_M_qualified_types["char"] = QString();
_M_qualified_types["double"] = QString();
_M_qualified_types["float"] = QString();
_M_qualified_types["int"] = QString();
_M_qualified_types["long"] = QString();
_M_qualified_types["short"] = QString();
_M_qualified_types["void"] = QString();
}
Binder::~Binder()
{
}
FileModelItem Binder::run(AST *node)
{
FileModelItem old = _M_current_file;
_M_current_access = CodeModel::Public;
_M_current_file = model()->create<FileModelItem>();
updateItemPosition (_M_current_file->toItem(), node);
visit(node);
FileModelItem result = _M_current_file;
_M_current_file = old; // restore
return result;
}
ScopeModelItem Binder::currentScope()
{
if (_M_current_class)
return model_static_cast<ScopeModelItem>(_M_current_class);
else if (_M_current_namespace)
return model_static_cast<ScopeModelItem>(_M_current_namespace);
return model_static_cast<ScopeModelItem>(_M_current_file);
}
TemplateParameterList Binder::changeTemplateParameters(TemplateParameterList templateParameters)
{
TemplateParameterList old = _M_current_template_parameters;
_M_current_template_parameters = templateParameters;
return old;
}
CodeModel::FunctionType Binder::changeCurrentFunctionType(CodeModel::FunctionType functionType)
{
CodeModel::FunctionType old = _M_current_function_type;
_M_current_function_type = functionType;
return old;
}
CodeModel::AccessPolicy Binder::changeCurrentAccess(CodeModel::AccessPolicy accessPolicy)
{
CodeModel::AccessPolicy old = _M_current_access;
_M_current_access = accessPolicy;
return old;
}
NamespaceModelItem Binder::changeCurrentNamespace(NamespaceModelItem item)
{
NamespaceModelItem old = _M_current_namespace;
_M_current_namespace = item;
return old;
}
ClassModelItem Binder::changeCurrentClass(ClassModelItem item)
{
ClassModelItem old = _M_current_class;
_M_current_class = item;
return old;
}
FunctionDefinitionModelItem Binder::changeCurrentFunction(FunctionDefinitionModelItem item)
{
FunctionDefinitionModelItem old = _M_current_function;
_M_current_function = item;
return old;
}
int Binder::decode_token(std::size_t index) const
{
return _M_token_stream->kind(index);
}
CodeModel::AccessPolicy Binder::decode_access_policy(std::size_t index) const
{
switch (decode_token(index))
{
case Token_class:
return CodeModel::Private;
case Token_struct:
case Token_union:
return CodeModel::Public;
default:
return CodeModel::Public;
}
}
CodeModel::ClassType Binder::decode_class_type(std::size_t index) const
{
switch (decode_token(index))
{
case Token_class:
return CodeModel::Class;
case Token_struct:
return CodeModel::Struct;
case Token_union:
return CodeModel::Union;
default:
std::cerr << "** WARNING unrecognized class type" << std::endl;
}
return CodeModel::Class;
}
const NameSymbol *Binder::decode_symbol(std::size_t index) const
{
return _M_token_stream->symbol(index);
}
void Binder::visitAccessSpecifier(AccessSpecifierAST *node)
{
const ListNode<std::size_t> *it = node->specs;
if (it == 0)
return;
it = it->toFront();
const ListNode<std::size_t> *end = it;
do
{
switch (decode_token(it->element))
{
default:
break;
case Token_public:
changeCurrentAccess(CodeModel::Public);
changeCurrentFunctionType(CodeModel::Normal);
break;
case Token_protected:
changeCurrentAccess(CodeModel::Protected);
changeCurrentFunctionType(CodeModel::Normal);
break;
case Token_private:
changeCurrentAccess(CodeModel::Private);
changeCurrentFunctionType(CodeModel::Normal);
break;
case Token_signals:
changeCurrentAccess(CodeModel::Protected);
changeCurrentFunctionType(CodeModel::Signal);
break;
case Token_slots:
changeCurrentFunctionType(CodeModel::Slot);
break;
}
it = it->next;
}
while (it != end);
}
void Binder::visitSimpleDeclaration(SimpleDeclarationAST *node)
{
visit(node->type_specifier);
if (const ListNode<InitDeclaratorAST*> *it = node->init_declarators)
{
it = it->toFront();
const ListNode<InitDeclaratorAST*> *end = it;
do
{
InitDeclaratorAST *init_declarator = it->element;
declare_symbol(node, init_declarator);
it = it->next;
}
while (it != end);
}
}
void Binder::declare_symbol(SimpleDeclarationAST *node, InitDeclaratorAST *init_declarator)
{
DeclaratorAST *declarator = init_declarator->declarator;
while (declarator && declarator->sub_declarator)
declarator = declarator->sub_declarator;
NameAST *id = declarator->id;
if (! declarator->id)
{
std::cerr << "** WARNING expected a declarator id" << std::endl;
return;
}
CodeModelFinder finder(model(), this);
ScopeModelItem symbolScope = finder.resolveScope(id, currentScope());
if (! symbolScope)
{
name_cc.run(id);
std::cerr << "** WARNING scope not found for symbol:"
<< qPrintable(name_cc.name()) << std::endl;
return;
}
decl_cc.run(declarator);
if (decl_cc.isFunction())
{
name_cc.run(id->unqualified_name);
FunctionModelItem fun = model()->create<FunctionModelItem>();
updateItemPosition (fun->toItem(), node);
fun->setAccessPolicy(_M_current_access);
fun->setFunctionType(_M_current_function_type);
fun->setName(name_cc.name());
fun->setAbstract(init_declarator->initializer != 0);
fun->setConstant(declarator->fun_cv != 0);
fun->setTemplateParameters(_M_current_template_parameters);
applyStorageSpecifiers(node->storage_specifiers, model_static_cast<MemberModelItem>(fun));
applyFunctionSpecifiers(node->function_specifiers, fun);
// build the type
TypeInfo typeInfo = CompilerUtils::typeDescription(node->type_specifier,
declarator,
this);
fun->setType(qualifyType(typeInfo, symbolScope->qualifiedName()));
fun->setVariadics (decl_cc.isVariadics ());
// ... and the signature
foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
{
ArgumentModelItem arg = model()->create<ArgumentModelItem>();
arg->setType(qualifyType(p.type, _M_context));
arg->setName(p.name);
arg->setDefaultValue(p.defaultValue);
if (p.defaultValue)
arg->setDefaultValueExpression(p.defaultValueExpression);
fun->addArgument(arg);
}
fun->setScope(symbolScope->qualifiedName());
symbolScope->addFunction(fun);
}
else
{
VariableModelItem var = model()->create<VariableModelItem>();
updateItemPosition (var->toItem(), node);
var->setTemplateParameters(_M_current_template_parameters);
var->setAccessPolicy(_M_current_access);
name_cc.run(id->unqualified_name);
var->setName(name_cc.name());
TypeInfo typeInfo = CompilerUtils::typeDescription(node->type_specifier,
declarator,
this);
if (declarator != init_declarator->declarator
&& init_declarator->declarator->parameter_declaration_clause != 0)
{
typeInfo.setFunctionPointer (true);
decl_cc.run (init_declarator->declarator);
foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
typeInfo.addArgument(p.type);
}
var->setType(qualifyType(typeInfo, _M_context));
applyStorageSpecifiers(node->storage_specifiers, model_static_cast<MemberModelItem>(var));
var->setScope(symbolScope->qualifiedName());
symbolScope->addVariable(var);
}
}
void Binder::visitFunctionDefinition(FunctionDefinitionAST *node)
{
Q_ASSERT(node->init_declarator != 0);
ScopeModelItem scope = currentScope();
InitDeclaratorAST *init_declarator = node->init_declarator;
DeclaratorAST *declarator = init_declarator->declarator;
// in the case of "void (func)()" or "void ((func))()" we need to
// skip to the inner most. This is in line with how the declarator
// node is generated in 'parser.cpp'
while (declarator && declarator->sub_declarator)
declarator = declarator->sub_declarator;
Q_ASSERT(declarator->id);
CodeModelFinder finder(model(), this);
ScopeModelItem functionScope = finder.resolveScope(declarator->id, scope);
if (! functionScope)
{
name_cc.run(declarator->id);
std::cerr << "** WARNING scope not found for function definition:"
<< qPrintable(name_cc.name()) << std::endl
<< "\tdefinition *ignored*"
<< std::endl;
return;
}
decl_cc.run(declarator);
Q_ASSERT(! decl_cc.id().isEmpty());
FunctionDefinitionModelItem
old = changeCurrentFunction(_M_model->create<FunctionDefinitionModelItem>());
_M_current_function->setScope(functionScope->qualifiedName());
updateItemPosition (_M_current_function->toItem(), node);
Q_ASSERT(declarator->id->unqualified_name != 0);
name_cc.run(declarator->id->unqualified_name);
QString unqualified_name = name_cc.name();
_M_current_function->setName(unqualified_name);
TypeInfo tmp_type = CompilerUtils::typeDescription(node->type_specifier,
declarator, this);
_M_current_function->setType(qualifyType(tmp_type, _M_context));
_M_current_function->setAccessPolicy(_M_current_access);
_M_current_function->setFunctionType(_M_current_function_type);
_M_current_function->setConstant(declarator->fun_cv != 0);
_M_current_function->setTemplateParameters(_M_current_template_parameters);
applyStorageSpecifiers(node->storage_specifiers,
model_static_cast<MemberModelItem>(_M_current_function));
applyFunctionSpecifiers(node->function_specifiers,
model_static_cast<FunctionModelItem>(_M_current_function));
_M_current_function->setVariadics (decl_cc.isVariadics ());
foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
{
ArgumentModelItem arg = model()->create<ArgumentModelItem>();
arg->setType(qualifyType(p.type, functionScope->qualifiedName()));
arg->setName(p.name);
arg->setDefaultValue(p.defaultValue);
if (p.defaultValue)
arg->setDefaultValueExpression(p.defaultValueExpression);
_M_current_function->addArgument(arg);
}
functionScope->addFunctionDefinition(_M_current_function);
FunctionModelItem prototype = model_static_cast<FunctionModelItem>(_M_current_function);
FunctionModelItem declared = functionScope->declaredFunction(prototype);
// try to find a function declaration for this definition..
if (! declared)
{
functionScope->addFunction(prototype);
}
else
{
applyFunctionSpecifiers(node->function_specifiers, declared);
// fix the function type and the access policy
_M_current_function->setAccessPolicy(declared->accessPolicy());
_M_current_function->setFunctionType(declared->functionType());
}
changeCurrentFunction(old);
}
void Binder::visitTemplateDeclaration(TemplateDeclarationAST *node)
{
const ListNode<TemplateParameterAST*> *it = node->template_parameters;
if (it == 0) {
// QtScript: we want to visit the declaration still, so that
// e.g. QMetaTypeId<Foo> is added to the code model
visit(node->declaration);
return;
}
TemplateParameterList savedTemplateParameters = changeTemplateParameters(TemplateParameterList());
it = it->toFront();
const ListNode<TemplateParameterAST*> *end = it;
TemplateParameterList templateParameters;
do {
TemplateParameterAST *parameter = it->element;
TypeParameterAST *type_parameter = parameter->type_parameter;
NameAST *name;
if (!type_parameter) {
// A hacky hack to work around missing support for parameter declarations in
// templates. We just need the to get the name of the variable, since we
// aren't actually compiling these anyway. We are still not supporting much
// more, but we are refusing to fail for a few more declarations
if (parameter->parameter_declaration == 0 ||
parameter->parameter_declaration->declarator == 0 ||
parameter->parameter_declaration->declarator->id == 0) {
/*std::cerr << "** WARNING template declaration not supported ``";
Token const &tk = _M_token_stream->token ((int) node->start_token);
Token const &end_tk = _M_token_stream->token ((int) node->declaration->start_token);
std::cerr << std::string (&tk.text[tk.position], (end_tk.position) - tk.position) << "''"
<< std::endl << std::endl;*/
changeTemplateParameters(savedTemplateParameters);
return;
}
name = parameter->parameter_declaration->declarator->id;
} else {
int tk = decode_token(type_parameter->type);
if (tk != Token_typename && tk != Token_class)
{
/*std::cerr << "** WARNING template declaration not supported ``";
Token const &tk = _M_token_stream->token ((int) node->start_token);
Token const &end_tk = _M_token_stream->token ((int) node->declaration->start_token);
std::cerr << std::string (&tk.text[tk.position], (end_tk.position) - tk.position) << "''"
<< std::endl << std::endl;*/
changeTemplateParameters(savedTemplateParameters);
return;
}
assert(tk == Token_typename || tk == Token_class);
name = type_parameter->name;
}
TemplateParameterModelItem p = model()->create<TemplateParameterModelItem>();
name_cc.run(name);
p->setName(name_cc.name());
_M_current_template_parameters.append(p);
it = it->next;
} while (it != end);
visit(node->declaration);
changeTemplateParameters(savedTemplateParameters);
}
void Binder::visitTypedef(TypedefAST *node)
{
const ListNode<InitDeclaratorAST*> *it = node->init_declarators;
if (it == 0)
return;
it = it->toFront();
const ListNode<InitDeclaratorAST*> *end = it;
do
{
InitDeclaratorAST *init_declarator = it->element;
it = it->next;
Q_ASSERT(init_declarator->declarator != 0);
// the name
decl_cc.run (init_declarator->declarator);
QString alias_name = decl_cc.id ();
if (alias_name.isEmpty ())
{
std::cerr << "** WARNING anonymous typedef not supported! ``";
Token const &tk = _M_token_stream->token ((int) node->start_token);
Token const &end_tk = _M_token_stream->token ((int) node->end_token);
std::cerr << std::string (&tk.text[tk.position], end_tk.position - tk.position) << "''"
<< std::endl << std::endl;
continue;
}
// build the type
TypeInfo typeInfo = CompilerUtils::typeDescription (node->type_specifier,
init_declarator->declarator,
this);
DeclaratorAST *decl = init_declarator->declarator;
while (decl && decl->sub_declarator)
decl = decl->sub_declarator;
if (decl != init_declarator->declarator
&& init_declarator->declarator->parameter_declaration_clause != 0)
{
typeInfo.setFunctionPointer (true);
decl_cc.run (init_declarator->declarator);
foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
typeInfo.addArgument(p.type);
}
ScopeModelItem scope = currentScope();
DeclaratorAST *declarator = init_declarator->declarator;
CodeModelFinder finder(model(), this);
ScopeModelItem typedefScope = finder.resolveScope(declarator->id, scope);
TypeAliasModelItem typeAlias = model ()->create<TypeAliasModelItem> ();
updateItemPosition (typeAlias->toItem (), node);
typeAlias->setName (alias_name);
typeAlias->setType (qualifyType (typeInfo, currentScope ()->qualifiedName ()));
typeAlias->setScope (typedefScope->qualifiedName());
_M_qualified_types[typeAlias->qualifiedName().join(".")] = QString();
currentScope ()->addTypeAlias (typeAlias);
}
while (it != end);
}
void Binder::visitNamespace(NamespaceAST *node)
{
bool anonymous = (node->namespace_name == 0);
ScopeModelItem scope = currentScope();
NamespaceModelItem old;
if (! anonymous)
{
QString name = decode_symbol(node->namespace_name)->as_string();
QStringList qualified_name = scope->qualifiedName();
qualified_name += name;
NamespaceModelItem ns =
model_safe_cast<NamespaceModelItem>(_M_model->findItem(qualified_name,
_M_current_file->toItem()));
if (!ns)
{
ns = _M_model->create<NamespaceModelItem>();
updateItemPosition (ns->toItem(), node);
ns->setName(name);
ns->setScope(scope->qualifiedName());
}
old = changeCurrentNamespace(ns);
_M_context.append(name);
}
DefaultVisitor::visitNamespace(node);
if (! anonymous)
{
Q_ASSERT(scope->kind() == _CodeModelItem::Kind_Namespace
|| scope->kind() == _CodeModelItem::Kind_File);
_M_context.removeLast();
if (NamespaceModelItem ns = model_static_cast<NamespaceModelItem>(scope))
{
ns->addNamespace(_M_current_namespace);
}
changeCurrentNamespace(old);
}
}
void Binder::visitForwardDeclarationSpecifier(ForwardDeclarationSpecifierAST *node)
{
name_cc.run(node->name);
if (name_cc.name().isEmpty())
return;
ScopeModelItem scope = currentScope();
_M_qualified_types[(scope->qualifiedName() + name_cc.qualifiedName()).join(".") ] = QString();
}
void Binder::visitClassSpecifier(ClassSpecifierAST *node)
{
ClassCompiler class_cc(this);
class_cc.run(node);
if (class_cc.name().isEmpty())
{
// anonymous not supported
return;
}
Q_ASSERT(node->name != 0 && node->name->unqualified_name != 0);
ScopeModelItem scope = currentScope();
ClassModelItem old = changeCurrentClass(_M_model->create<ClassModelItem>());
updateItemPosition (_M_current_class->toItem(), node);
_M_current_class->setName(class_cc.name());
QStringList baseClasses = class_cc.baseClasses(); TypeInfo info;
for (int i=0; i<baseClasses.size(); ++i)
{
info.setQualifiedName(baseClasses.at(i).split("::"));
baseClasses[i] = qualifyType(info, scope->qualifiedName()).qualifiedName().join("::");
}
_M_current_class->setBaseClasses(baseClasses);
_M_current_class->setClassType(decode_class_type(node->class_key));
_M_current_class->setTemplateParameters(_M_current_template_parameters);
if (! _M_current_template_parameters.isEmpty())
{
QString name = _M_current_class->name();
name += "<";
for (int i = 0; i<_M_current_template_parameters.size(); ++i)
{
if (i != 0)
name += ",";
name += _M_current_template_parameters.at(i)->name();
}
name += ">";
_M_current_class->setName(name);
}
CodeModel::AccessPolicy oldAccessPolicy = changeCurrentAccess(decode_access_policy(node->class_key));
CodeModel::FunctionType oldFunctionType = changeCurrentFunctionType(CodeModel::Normal);
_M_current_class->setScope(scope->qualifiedName());
_M_qualified_types[_M_current_class->qualifiedName().join(".")] = QString();
scope->addClass(_M_current_class);
name_cc.run(node->name->unqualified_name);
_M_context.append(name_cc.name());
visitNodes(this, node->member_specs);
_M_context.removeLast();
changeCurrentClass(old);
changeCurrentAccess(oldAccessPolicy);
changeCurrentFunctionType(oldFunctionType);
}
void Binder::visitLinkageSpecification(LinkageSpecificationAST *node)
{
DefaultVisitor::visitLinkageSpecification(node);
}
void Binder::visitUsing(UsingAST *node)
{
DefaultVisitor::visitUsing(node);
}
void Binder::visitEnumSpecifier(EnumSpecifierAST *node)
{
CodeModelFinder finder(model(), this);
ScopeModelItem scope = currentScope();
ScopeModelItem enumScope = finder.resolveScope(node->name, scope);
name_cc.run(node->name);
QString name = name_cc.name();
if (name.isEmpty())
{
// anonymous enum
QString key = _M_context.join("::");
int current = ++_M_anonymous_enums[key];
name += QLatin1String("enum_");
name += QString::number(current);
}
_M_current_enum = model()->create<EnumModelItem>();
_M_current_enum->setAccessPolicy(_M_current_access);
updateItemPosition (_M_current_enum->toItem(), node);
_M_current_enum->setName(name);
_M_current_enum->setScope(enumScope->qualifiedName());
_M_qualified_types[_M_current_enum->qualifiedName().join(".")] = QString();
enumScope->addEnum(_M_current_enum);
DefaultVisitor::visitEnumSpecifier(node);
_M_current_enum = 0;
}
static QString strip_preprocessor_lines(const QString &name)
{
QStringList lst = name.split("\n");
QString s;
for (int i=0; i<lst.size(); ++i) {
if (!lst.at(i).startsWith('#'))
s += lst.at(i);
}
return s.trimmed();
}
void Binder::visitEnumerator(EnumeratorAST *node)
{
Q_ASSERT(_M_current_enum != 0);
EnumeratorModelItem e = model()->create<EnumeratorModelItem>();
updateItemPosition (e->toItem(), node);
e->setName(decode_symbol(node->id)->as_string());
if (ExpressionAST *expr = node->expression)
{
const Token &start_token = _M_token_stream->token((int) expr->start_token);
const Token &end_token = _M_token_stream->token((int) expr->end_token);
e->setValue(strip_preprocessor_lines(QString::fromUtf8(&start_token.text[start_token.position],
(int) (end_token.position - start_token.position)).trimmed()).remove(' '));
}
_M_current_enum->addEnumerator(e);
}
void Binder::visitUsingDirective(UsingDirectiveAST *node)
{
DefaultVisitor::visitUsingDirective(node);
}
void Binder::visitQEnums(QEnumsAST *node)
{
const Token &start = _M_token_stream->token((int) node->start_token);
const Token &end = _M_token_stream->token((int) node->end_token);
QStringList enum_list = QString::fromLatin1(start.text + start.position,
end.position - start.position).split(' ');
ScopeModelItem scope = currentScope();
for (int i=0; i<enum_list.size(); ++i)
scope->addEnumsDeclaration(enum_list.at(i));
}
void Binder::visitQProperty(QPropertyAST *node)
{
const Token &start = _M_token_stream->token((int) node->start_token);
const Token &end = _M_token_stream->token((int) node->end_token);
QString property = QString::fromLatin1(start.text + start.position,
end.position - start.position);
_M_current_class->addPropertyDeclaration(property);
}
void Binder::applyStorageSpecifiers(const ListNode<std::size_t> *it, MemberModelItem item)
{
if (it == 0)
return;
it = it->toFront();
const ListNode<std::size_t> *end = it;
do
{
switch (decode_token(it->element))
{
default:
break;
case Token_friend:
item->setFriend(true);
break;
case Token_auto:
item->setAuto(true);
break;
case Token_register:
item->setRegister(true);
break;
case Token_static:
item->setStatic(true);
break;
case Token_extern:
item->setExtern(true);
break;
case Token_mutable:
item->setMutable(true);
break;
}
it = it->next;
}
while (it != end);
}
void Binder::applyFunctionSpecifiers(const ListNode<std::size_t> *it, FunctionModelItem item)
{
if (it == 0)
return;
it = it->toFront();
const ListNode<std::size_t> *end = it;
do
{
switch (decode_token(it->element))
{
default:
break;
case Token_inline:
item->setInline(true);
break;
case Token_virtual:
item->setVirtual(true);
break;
case Token_explicit:
item->setExplicit(true);
break;
case Token_Q_INVOKABLE:
item->setInvokable(true);
break;
}
it = it->next;
}
while (it != end);
}
TypeInfo Binder::qualifyType(const TypeInfo &type, const QStringList &context) const
{
// ### Potentially improve to use string list in the name table to
if (context.size() == 0)
{
// ### We can assume that this means global namespace for now...
return type;
}
else if (_M_qualified_types.contains(type.qualifiedName().join(".")))
{
return type;
}
else
{
QStringList expanded = context;
expanded << type.qualifiedName();
if (_M_qualified_types.contains(expanded.join(".")))
{
TypeInfo modified_type = type;
modified_type.setQualifiedName(expanded);
return modified_type;
}
else
{
CodeModelItem scope = model ()->findItem (context, _M_current_file->toItem ());
if (ClassModelItem klass = model_dynamic_cast<ClassModelItem> (scope))
{
foreach (QString base, klass->baseClasses ())
{
QStringList ctx = context;
ctx.removeLast();
ctx.append (base);
TypeInfo qualified = qualifyType (type, ctx);
if (qualified != type)
return qualified;
}
}
QStringList copy = context;
copy.removeLast();
return qualifyType(type, copy);
}
}
}
void Binder::updateItemPosition(CodeModelItem item, AST *node)
{
QString filename;
int line, column;
assert (node != 0);
_M_location.positionAt (_M_token_stream->position(node->start_token), &line, &column, &filename);
item->setFileName (filename);
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,136 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef BINDER_H
#define BINDER_H
#include "default_visitor.h"
#include "codemodel.h"
#include "type_compiler.h"
#include "name_compiler.h"
#include "declarator_compiler.h"
class TokenStream;
class LocationManager;
class Control;
struct NameSymbol;
class Binder: protected DefaultVisitor
{
public:
Binder(CodeModel *__model, LocationManager &__location, Control *__control = 0);
virtual ~Binder();
inline TokenStream *tokenStream() const { return _M_token_stream; }
inline CodeModel *model() const { return _M_model; }
ScopeModelItem currentScope();
FileModelItem run(AST *node);
// utils
TypeInfo qualifyType(const TypeInfo &type, const QStringList &context) const;
protected:
virtual void visitAccessSpecifier(AccessSpecifierAST *);
virtual void visitClassSpecifier(ClassSpecifierAST *);
virtual void visitEnumSpecifier(EnumSpecifierAST *);
virtual void visitEnumerator(EnumeratorAST *);
virtual void visitFunctionDefinition(FunctionDefinitionAST *);
virtual void visitLinkageSpecification(LinkageSpecificationAST *);
virtual void visitNamespace(NamespaceAST *);
virtual void visitSimpleDeclaration(SimpleDeclarationAST *);
virtual void visitTemplateDeclaration(TemplateDeclarationAST *);
virtual void visitTypedef(TypedefAST *);
virtual void visitUsing(UsingAST *);
virtual void visitUsingDirective(UsingDirectiveAST *);
virtual void visitQProperty(QPropertyAST *);
virtual void visitForwardDeclarationSpecifier(ForwardDeclarationSpecifierAST *);
virtual void visitQEnums(QEnumsAST *);
private:
int decode_token(std::size_t index) const;
const NameSymbol *decode_symbol(std::size_t index) const;
CodeModel::AccessPolicy decode_access_policy(std::size_t index) const;
CodeModel::ClassType decode_class_type(std::size_t index) const;
CodeModel::FunctionType changeCurrentFunctionType(CodeModel::FunctionType functionType);
CodeModel::AccessPolicy changeCurrentAccess(CodeModel::AccessPolicy accessPolicy);
NamespaceModelItem changeCurrentNamespace(NamespaceModelItem item);
ClassModelItem changeCurrentClass(ClassModelItem item);
FunctionDefinitionModelItem changeCurrentFunction(FunctionDefinitionModelItem item);
TemplateParameterList changeTemplateParameters(TemplateParameterList templateParameters);
void declare_symbol(SimpleDeclarationAST *node, InitDeclaratorAST *init_declarator);
void applyStorageSpecifiers(const ListNode<std::size_t> *storage_specifiers, MemberModelItem item);
void applyFunctionSpecifiers(const ListNode<std::size_t> *it, FunctionModelItem item);
void updateItemPosition(CodeModelItem item, AST *node);
private:
CodeModel *_M_model;
LocationManager &_M_location;
TokenStream *_M_token_stream;
Control *_M_control;
CodeModel::FunctionType _M_current_function_type;
CodeModel::AccessPolicy _M_current_access;
FileModelItem _M_current_file;
NamespaceModelItem _M_current_namespace;
ClassModelItem _M_current_class;
FunctionDefinitionModelItem _M_current_function;
EnumModelItem _M_current_enum;
QStringList _M_context;
TemplateParameterList _M_current_template_parameters; // ### check me
QHash<QString, QString> _M_qualified_types;
QHash<QString, int> _M_anonymous_enums;
protected:
TypeCompiler type_cc;
NameCompiler name_cc;
DeclaratorCompiler decl_cc;
};
#endif // BINDER_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,83 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "class_compiler.h"
#include "lexer.h"
#include "binder.h"
ClassCompiler::ClassCompiler(Binder *binder)
: _M_binder (binder),
_M_token_stream(binder->tokenStream ()),
name_cc(_M_binder),
type_cc(_M_binder)
{
}
ClassCompiler::~ClassCompiler()
{
}
void ClassCompiler::run(ClassSpecifierAST *node)
{
name_cc.run(node->name);
_M_name = name_cc.name();
_M_base_classes.clear();
visit(node);
}
void ClassCompiler::visitClassSpecifier(ClassSpecifierAST *node)
{
visit(node->base_clause);
}
void ClassCompiler::visitBaseSpecifier(BaseSpecifierAST *node)
{
name_cc.run(node->name);
QString name = name_cc.name();
if (! name.isEmpty())
_M_base_classes.append(name);
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,82 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CLASS_COMPILER_H
#define CLASS_COMPILER_H
#include <QtCore/qglobal.h>
#include <QtCore/QStringList>
#include "default_visitor.h"
#include "name_compiler.h"
#include "type_compiler.h"
class TokenStream;
class Binder;
class ClassCompiler: protected DefaultVisitor
{
public:
ClassCompiler(Binder *binder);
virtual ~ClassCompiler();
inline QString name() const { return _M_name; }
inline QStringList baseClasses() const { return _M_base_classes; }
void run(ClassSpecifierAST *node);
protected:
virtual void visitClassSpecifier(ClassSpecifierAST *node);
virtual void visitBaseSpecifier(BaseSpecifierAST *node);
private:
Binder *_M_binder;
TokenStream *_M_token_stream;
QString _M_name;
QStringList _M_base_classes;
NameCompiler name_cc;
TypeCompiler type_cc;
};
#endif // CLASS_COMPILER_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,968 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "codemodel.h"
// ---------------------------------------------------------------------------
CodeModel::CodeModel()
: _M_creation_id(0)
{
_M_globalNamespace = create<NamespaceModelItem>();
}
CodeModel::~CodeModel()
{
}
void CodeModel::wipeout()
{
_M_globalNamespace = create<NamespaceModelItem>();
_M_files.clear();
}
FileList CodeModel::files() const
{
return _M_files.values();
}
NamespaceModelItem CodeModel::globalNamespace() const
{
return _M_globalNamespace;
}
void CodeModel::addFile(FileModelItem item)
{
_M_creation_id = 0; // reset the creation id
_M_files.insert(item->name(), item);
}
void CodeModel::removeFile(FileModelItem item)
{
QHash<QString, FileModelItem>::Iterator it = _M_files.find(item->name());
if (it != _M_files.end() && it.value() == item)
_M_files.erase(it);
}
FileModelItem CodeModel::findFile(const QString &name) const
{
return _M_files.value(name);
}
QHash<QString, FileModelItem> CodeModel::fileMap() const
{
return _M_files;
}
CodeModelItem CodeModel::findItem(const QStringList &qualifiedName, CodeModelItem scope) const
{
for (int i=0; i<qualifiedName.size(); ++i) {
// ### Extend to look for members etc too.
const QString &name = qualifiedName.at(i);
if (NamespaceModelItem ns = model_dynamic_cast<NamespaceModelItem>(scope))
{
if (NamespaceModelItem tmp_ns = ns->findNamespace(name)) {
scope = tmp_ns;
continue;
}
}
if (ScopeModelItem ss = model_dynamic_cast<ScopeModelItem>(scope))
{
if (ClassModelItem cs = ss->findClass(name))
{
scope = cs;
}
else if (EnumModelItem es = ss->findEnum(name))
{
if (i == qualifiedName.size () - 1)
return es->toItem();
}
else if (TypeAliasModelItem tp = ss->findTypeAlias(name))
{
if (i == qualifiedName.size () - 1)
return tp->toItem ();
}
else
{
// If we don't find the name in the scope chain we
// need to return an empty item to indicate failure...
return CodeModelItem();
}
}
}
return scope;
}
// ---------------------------------------------------------------------------
TypeInfo TypeInfo::combine (const TypeInfo &__lhs, const TypeInfo &__rhs)
{
TypeInfo __result = __lhs;
__result.setConstant (__result.isConstant () || __rhs.isConstant ());
__result.setVolatile (__result.isVolatile () || __rhs.isVolatile ());
__result.setReference (__result.isReference () || __rhs.isReference ());
__result.setIndirections (__result.indirections () + __rhs.indirections ());
__result.setArrayElements (__result.arrayElements () + __rhs.arrayElements ());
return __result;
}
TypeInfo TypeInfo::resolveType (TypeInfo const &__type, CodeModelItem __scope)
{
CodeModel *__model = __scope->model ();
Q_ASSERT (__model != 0);
CodeModelItem __item = __model->findItem (__type.qualifiedName (), __scope);
// Copy the type and replace with the proper qualified name. This
// only makes sence to do if we're actually getting a resolved
// type with a namespace. We only get this if the returned type
// has more than 2 entries in the qualified name... This test
// could be improved by returning if the type was found or not.
TypeInfo otherType(__type);
if (__item && __item->qualifiedName().size() > 1) {
otherType.setQualifiedName(__item->qualifiedName());
}
if (TypeAliasModelItem __alias = model_dynamic_cast<TypeAliasModelItem> (__item))
return resolveType (TypeInfo::combine (__alias->type (), otherType), __scope);
return otherType;
}
QString TypeInfo::toString() const
{
QString tmp;
tmp += m_qualifiedName.join("::");
if (isConstant())
tmp += QLatin1String(" const");
if (isVolatile())
tmp += QLatin1String(" volatile");
if (indirections())
tmp += QString(indirections(), QLatin1Char('*'));
if (isReference())
tmp += QLatin1Char('&');
if (isFunctionPointer())
{
tmp += QLatin1String(" (*)(");
for (int i=0; i<m_arguments.count(); ++i)
{
if (i != 0)
tmp += QLatin1String(", ");
tmp += m_arguments.at(i).toString();
}
tmp += QLatin1String(")");
}
foreach (QString elt, arrayElements ())
{
tmp += QLatin1String ("[");
tmp += elt;
tmp += QLatin1String ("]");
}
return tmp;
}
bool TypeInfo::operator==(const TypeInfo &other)
{
if (arrayElements().count() != other.arrayElements().count())
return false;
#if defined (RXX_CHECK_ARRAY_ELEMENTS) // ### it'll break
for (int i=0; i<arrayElements().count(); ++i)
{
QString elt1 = arrayElements ().at (i).trimmed ();
QString elt2 = other.arrayElements ().at (i).trimmed ();
if (elt1 != elt2)
return false;
}
#endif
return flags == other.flags
&& m_qualifiedName == other.m_qualifiedName
&& (!m_functionPointer || m_arguments == other.m_arguments);
}
// ---------------------------------------------------------------------------
_CodeModelItem::_CodeModelItem(CodeModel *model, int kind)
: _M_model(model),
_M_kind(kind),
_M_startLine(0),
_M_startColumn(0),
_M_endLine(0),
_M_endColumn(0),
_M_creation_id(0)
{
}
_CodeModelItem::~_CodeModelItem()
{
}
CodeModelItem _CodeModelItem::toItem() const
{
return CodeModelItem(const_cast<_CodeModelItem*>(this));
}
int _CodeModelItem::kind() const
{
return _M_kind;
}
void _CodeModelItem::setKind(int kind)
{
_M_kind = kind;
}
QStringList _CodeModelItem::qualifiedName() const
{
QStringList q = scope();
if (!name().isEmpty())
q += name();
return q;
}
QString _CodeModelItem::name() const
{
return _M_name;
}
void _CodeModelItem::setName(const QString &name)
{
_M_name = name;
}
QStringList _CodeModelItem::scope() const
{
return _M_scope;
}
void _CodeModelItem::setScope(const QStringList &scope)
{
_M_scope = scope;
}
QString _CodeModelItem::fileName() const
{
return _M_fileName;
}
void _CodeModelItem::setFileName(const QString &fileName)
{
_M_fileName = fileName;
}
FileModelItem _CodeModelItem::file() const
{
return model()->findFile(fileName());
}
void _CodeModelItem::getStartPosition(int *line, int *column)
{
*line = _M_startLine;
*column = _M_startColumn;
}
void _CodeModelItem::setStartPosition(int line, int column)
{
_M_startLine = line;
_M_startColumn = column;
}
void _CodeModelItem::getEndPosition(int *line, int *column)
{
*line = _M_endLine;
*column = _M_endColumn;
}
void _CodeModelItem::setEndPosition(int line, int column)
{
_M_endLine = line;
_M_endColumn = column;
}
// ---------------------------------------------------------------------------
QStringList _ClassModelItem::baseClasses() const
{
return _M_baseClasses;
}
void _ClassModelItem::setBaseClasses(const QStringList &baseClasses)
{
_M_baseClasses = baseClasses;
}
TemplateParameterList _ClassModelItem::templateParameters() const
{
return _M_templateParameters;
}
void _ClassModelItem::setTemplateParameters(const TemplateParameterList &templateParameters)
{
_M_templateParameters = templateParameters;
}
void _ClassModelItem::addBaseClass(const QString &baseClass)
{
_M_baseClasses.append(baseClass);
}
void _ClassModelItem::removeBaseClass(const QString &baseClass)
{
_M_baseClasses.removeAt(_M_baseClasses.indexOf(baseClass));
}
bool _ClassModelItem::extendsClass(const QString &name) const
{
return _M_baseClasses.contains(name);
}
void _ClassModelItem::setClassType(CodeModel::ClassType type)
{
_M_classType = type;
}
CodeModel::ClassType _ClassModelItem::classType() const
{
return _M_classType;
}
void _ClassModelItem::addPropertyDeclaration(const QString &propertyDeclaration)
{
_M_propertyDeclarations << propertyDeclaration;
}
// ---------------------------------------------------------------------------
FunctionModelItem _ScopeModelItem::declaredFunction(FunctionModelItem item)
{
FunctionList function_list = findFunctions(item->name());
foreach (FunctionModelItem fun, function_list)
{
if (fun->isSimilar(item))
return fun;
}
return FunctionModelItem();
}
ClassList _ScopeModelItem::classes() const
{
return _M_classes.values();
}
TypeAliasList _ScopeModelItem::typeAliases() const
{
return _M_typeAliases.values();
}
VariableList _ScopeModelItem::variables() const
{
return _M_variables.values();
}
FunctionList _ScopeModelItem::functions() const
{
return _M_functions.values();
}
void _ScopeModelItem::addEnumsDeclaration(const QString &enumsDeclaration)
{
_M_enumsDeclarations << enumsDeclaration;
}
FunctionDefinitionList _ScopeModelItem::functionDefinitions() const
{
return _M_functionDefinitions.values();
}
EnumList _ScopeModelItem::enums() const
{
return _M_enums.values();
}
void _ScopeModelItem::addClass(ClassModelItem item)
{
QString name = item->name();
int idx = name.indexOf("<");
if (idx > 0)
_M_classes.insert(name.left(idx), item);
_M_classes.insert(name, item);
}
void _ScopeModelItem::addFunction(FunctionModelItem item)
{
_M_functions.insert(item->name(), item);
}
void _ScopeModelItem::addFunctionDefinition(FunctionDefinitionModelItem item)
{
_M_functionDefinitions.insert(item->name(), item);
}
void _ScopeModelItem::addVariable(VariableModelItem item)
{
_M_variables.insert(item->name(), item);
}
void _ScopeModelItem::addTypeAlias(TypeAliasModelItem item)
{
_M_typeAliases.insert(item->name(), item);
}
void _ScopeModelItem::addEnum(EnumModelItem item)
{
_M_enums.insert(item->name(), item);
}
void _ScopeModelItem::removeClass(ClassModelItem item)
{
QHash<QString, ClassModelItem>::Iterator it = _M_classes.find(item->name());
if (it != _M_classes.end() && it.value() == item)
_M_classes.erase(it);
}
void _ScopeModelItem::removeFunction(FunctionModelItem item)
{
QMultiHash<QString, FunctionModelItem>::Iterator it = _M_functions.find(item->name());
while (it != _M_functions.end() && it.key() == item->name()
&& it.value() != item)
{
++it;
}
if (it != _M_functions.end() && it.value() == item)
{
_M_functions.erase(it);
}
}
void _ScopeModelItem::removeFunctionDefinition(FunctionDefinitionModelItem item)
{
QMultiHash<QString, FunctionDefinitionModelItem>::Iterator it = _M_functionDefinitions.find(item->name());
while (it != _M_functionDefinitions.end() && it.key() == item->name()
&& it.value() != item)
{
++it;
}
if (it != _M_functionDefinitions.end() && it.value() == item)
{
_M_functionDefinitions.erase(it);
}
}
void _ScopeModelItem::removeVariable(VariableModelItem item)
{
QHash<QString, VariableModelItem>::Iterator it = _M_variables.find(item->name());
if (it != _M_variables.end() && it.value() == item)
_M_variables.erase(it);
}
void _ScopeModelItem::removeTypeAlias(TypeAliasModelItem item)
{
QHash<QString, TypeAliasModelItem>::Iterator it = _M_typeAliases.find(item->name());
if (it != _M_typeAliases.end() && it.value() == item)
_M_typeAliases.erase(it);
}
void _ScopeModelItem::removeEnum(EnumModelItem item)
{
QHash<QString, EnumModelItem>::Iterator it = _M_enums.find(item->name());
if (it != _M_enums.end() && it.value() == item)
_M_enums.erase(it);
}
ClassModelItem _ScopeModelItem::findClass(const QString &name) const
{
return _M_classes.value(name);
}
VariableModelItem _ScopeModelItem::findVariable(const QString &name) const
{
return _M_variables.value(name);
}
TypeAliasModelItem _ScopeModelItem::findTypeAlias(const QString &name) const
{
return _M_typeAliases.value(name);
}
EnumModelItem _ScopeModelItem::findEnum(const QString &name) const
{
return _M_enums.value(name);
}
FunctionList _ScopeModelItem::findFunctions(const QString &name) const
{
return _M_functions.values(name);
}
FunctionDefinitionList _ScopeModelItem::findFunctionDefinitions(const QString &name) const
{
return _M_functionDefinitions.values(name);
}
// ---------------------------------------------------------------------------
NamespaceList _NamespaceModelItem::namespaces() const
{
return _M_namespaces.values();
}
void _NamespaceModelItem::addNamespace(NamespaceModelItem item)
{
_M_namespaces.insert(item->name(), item);
}
void _NamespaceModelItem::removeNamespace(NamespaceModelItem item)
{
QHash<QString, NamespaceModelItem>::Iterator it = _M_namespaces.find(item->name());
if (it != _M_namespaces.end() && it.value() == item)
_M_namespaces.erase(it);
}
NamespaceModelItem _NamespaceModelItem::findNamespace(const QString &name) const
{
return _M_namespaces.value(name);
}
// ---------------------------------------------------------------------------
TypeInfo _ArgumentModelItem::type() const
{
return _M_type;
}
void _ArgumentModelItem::setType(const TypeInfo &type)
{
_M_type = type;
}
bool _ArgumentModelItem::defaultValue() const
{
return _M_defaultValue;
}
void _ArgumentModelItem::setDefaultValue(bool defaultValue)
{
_M_defaultValue = defaultValue;
}
// ---------------------------------------------------------------------------
bool _FunctionModelItem::isSimilar(FunctionModelItem other) const
{
if (name() != other->name())
return false;
if (isConstant() != other->isConstant())
return false;
if (isVariadics() != other->isVariadics())
return false;
if (arguments().count() != other->arguments().count())
return false;
// ### check the template parameters
for (int i=0; i<arguments().count(); ++i)
{
ArgumentModelItem arg1 = arguments().at(i);
ArgumentModelItem arg2 = other->arguments().at(i);
if (arg1->type() != arg2->type())
return false;
}
return true;
}
ArgumentList _FunctionModelItem::arguments() const
{
return _M_arguments;
}
void _FunctionModelItem::addArgument(ArgumentModelItem item)
{
_M_arguments.append(item);
}
void _FunctionModelItem::removeArgument(ArgumentModelItem item)
{
_M_arguments.removeAt(_M_arguments.indexOf(item));
}
CodeModel::FunctionType _FunctionModelItem::functionType() const
{
return _M_functionType;
}
void _FunctionModelItem::setFunctionType(CodeModel::FunctionType functionType)
{
_M_functionType = functionType;
}
bool _FunctionModelItem::isVariadics() const
{
return _M_isVariadics;
}
void _FunctionModelItem::setVariadics(bool isVariadics)
{
_M_isVariadics = isVariadics;
}
bool _FunctionModelItem::isVirtual() const
{
return _M_isVirtual;
}
void _FunctionModelItem::setVirtual(bool isVirtual)
{
_M_isVirtual = isVirtual;
}
bool _FunctionModelItem::isInline() const
{
return _M_isInline;
}
void _FunctionModelItem::setInline(bool isInline)
{
_M_isInline = isInline;
}
bool _FunctionModelItem::isExplicit() const
{
return _M_isExplicit;
}
void _FunctionModelItem::setExplicit(bool isExplicit)
{
_M_isExplicit = isExplicit;
}
bool _FunctionModelItem::isAbstract() const
{
return _M_isAbstract;
}
void _FunctionModelItem::setAbstract(bool isAbstract)
{
_M_isAbstract = isAbstract;
}
// Qt
bool _FunctionModelItem::isInvokable() const
{
return _M_isInvokable;
}
void _FunctionModelItem::setInvokable(bool isInvokable)
{
_M_isInvokable = isInvokable;
}
// ---------------------------------------------------------------------------
TypeInfo _TypeAliasModelItem::type() const
{
return _M_type;
}
void _TypeAliasModelItem::setType(const TypeInfo &type)
{
_M_type = type;
}
// ---------------------------------------------------------------------------
CodeModel::AccessPolicy _EnumModelItem::accessPolicy() const
{
return _M_accessPolicy;
}
void _EnumModelItem::setAccessPolicy(CodeModel::AccessPolicy accessPolicy)
{
_M_accessPolicy = accessPolicy;
}
EnumeratorList _EnumModelItem::enumerators() const
{
return _M_enumerators;
}
void _EnumModelItem::addEnumerator(EnumeratorModelItem item)
{
_M_enumerators.append(item);
}
void _EnumModelItem::removeEnumerator(EnumeratorModelItem item)
{
_M_enumerators.removeAt(_M_enumerators.indexOf(item));
}
// ---------------------------------------------------------------------------
QString _EnumeratorModelItem::value() const
{
return _M_value;
}
void _EnumeratorModelItem::setValue(const QString &value)
{
_M_value = value;
}
// ---------------------------------------------------------------------------
TypeInfo _TemplateParameterModelItem::type() const
{
return _M_type;
}
void _TemplateParameterModelItem::setType(const TypeInfo &type)
{
_M_type = type;
}
bool _TemplateParameterModelItem::defaultValue() const
{
return _M_defaultValue;
}
void _TemplateParameterModelItem::setDefaultValue(bool defaultValue)
{
_M_defaultValue = defaultValue;
}
// ---------------------------------------------------------------------------
ScopeModelItem _ScopeModelItem::create(CodeModel *model)
{
ScopeModelItem item(new _ScopeModelItem(model));
return item;
}
ClassModelItem _ClassModelItem::create(CodeModel *model)
{
ClassModelItem item(new _ClassModelItem(model));
return item;
}
NamespaceModelItem _NamespaceModelItem::create(CodeModel *model)
{
NamespaceModelItem item(new _NamespaceModelItem(model));
return item;
}
FileModelItem _FileModelItem::create(CodeModel *model)
{
FileModelItem item(new _FileModelItem(model));
return item;
}
ArgumentModelItem _ArgumentModelItem::create(CodeModel *model)
{
ArgumentModelItem item(new _ArgumentModelItem(model));
return item;
}
FunctionModelItem _FunctionModelItem::create(CodeModel *model)
{
FunctionModelItem item(new _FunctionModelItem(model));
return item;
}
FunctionDefinitionModelItem _FunctionDefinitionModelItem::create(CodeModel *model)
{
FunctionDefinitionModelItem item(new _FunctionDefinitionModelItem(model));
return item;
}
VariableModelItem _VariableModelItem::create(CodeModel *model)
{
VariableModelItem item(new _VariableModelItem(model));
return item;
}
TypeAliasModelItem _TypeAliasModelItem::create(CodeModel *model)
{
TypeAliasModelItem item(new _TypeAliasModelItem(model));
return item;
}
EnumModelItem _EnumModelItem::create(CodeModel *model)
{
EnumModelItem item(new _EnumModelItem(model));
return item;
}
EnumeratorModelItem _EnumeratorModelItem::create(CodeModel *model)
{
EnumeratorModelItem item(new _EnumeratorModelItem(model));
return item;
}
TemplateParameterModelItem _TemplateParameterModelItem::create(CodeModel *model)
{
TemplateParameterModelItem item(new _TemplateParameterModelItem(model));
return item;
}
// ---------------------------------------------------------------------------
TypeInfo _MemberModelItem::type() const
{
return _M_type;
}
void _MemberModelItem::setType(const TypeInfo &type)
{
_M_type = type;
}
CodeModel::AccessPolicy _MemberModelItem::accessPolicy() const
{
return _M_accessPolicy;
}
void _MemberModelItem::setAccessPolicy(CodeModel::AccessPolicy accessPolicy)
{
_M_accessPolicy = accessPolicy;
}
bool _MemberModelItem::isStatic() const
{
return _M_isStatic;
}
void _MemberModelItem::setStatic(bool isStatic)
{
_M_isStatic = isStatic;
}
bool _MemberModelItem::isConstant() const
{
return _M_isConstant;
}
void _MemberModelItem::setConstant(bool isConstant)
{
_M_isConstant = isConstant;
}
bool _MemberModelItem::isVolatile() const
{
return _M_isVolatile;
}
void _MemberModelItem::setVolatile(bool isVolatile)
{
_M_isVolatile = isVolatile;
}
bool _MemberModelItem::isAuto() const
{
return _M_isAuto;
}
void _MemberModelItem::setAuto(bool isAuto)
{
_M_isAuto = isAuto;
}
bool _MemberModelItem::isFriend() const
{
return _M_isFriend;
}
void _MemberModelItem::setFriend(bool isFriend)
{
_M_isFriend = isFriend;
}
bool _MemberModelItem::isRegister() const
{
return _M_isRegister;
}
void _MemberModelItem::setRegister(bool isRegister)
{
_M_isRegister = isRegister;
}
bool _MemberModelItem::isExtern() const
{
return _M_isExtern;
}
void _MemberModelItem::setExtern(bool isExtern)
{
_M_isExtern = isExtern;
}
bool _MemberModelItem::isMutable() const
{
return _M_isMutable;
}
void _MemberModelItem::setMutable(bool isMutable)
{
_M_isMutable = isMutable;
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,765 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CODEMODEL_H
#define CODEMODEL_H
#include "codemodel_fwd.h"
#include <codemodel_pointer.h>
#include <QtCore/QHash>
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVector>
#define DECLARE_MODEL_NODE(k) \
enum { __node_kind = Kind_##k }; \
typedef CodeModelPointer<k##ModelItem> Pointer;
template <class _Target, class _Source>
_Target model_static_cast(_Source item)
{
typedef typename _Target::Type * _Target_pointer;
_Target ptr (static_cast<_Target_pointer>(item.data()));
return ptr;
}
class CodeModel
{
public:
enum AccessPolicy
{
Public,
Protected,
Private
};
enum FunctionType
{
Normal,
Signal,
Slot
};
enum ClassType
{
Class,
Struct,
Union
};
public:
CodeModel();
virtual ~CodeModel();
template <class _Target> _Target create()
{
typedef typename _Target::Type _Target_type;
_Target result = _Target_type::create(this);
result->setCreationId(_M_creation_id++);
return result;
}
FileList files() const;
NamespaceModelItem globalNamespace() const;
void addFile(FileModelItem item);
void removeFile(FileModelItem item);
FileModelItem findFile(const QString &name) const;
QHash<QString, FileModelItem> fileMap() const;
CodeModelItem findItem(const QStringList &qualifiedName, CodeModelItem scope) const;
void wipeout();
private:
QHash<QString, FileModelItem> _M_files;
NamespaceModelItem _M_globalNamespace;
std::size_t _M_creation_id;
private:
CodeModel(const CodeModel &other);
void operator = (const CodeModel &other);
};
class TypeInfo
{
public:
TypeInfo(const TypeInfo &other)
: flags(other.flags),
m_qualifiedName(other.m_qualifiedName),
m_arrayElements(other.m_arrayElements),
m_arguments(other.m_arguments)
{
}
TypeInfo():
flags (0) {}
QStringList qualifiedName() const { return m_qualifiedName; }
void setQualifiedName(const QStringList &qualified_name) { m_qualifiedName = qualified_name; }
bool isConstant() const { return m_constant; }
void setConstant(bool is) { m_constant = is; }
bool isVolatile() const { return m_volatile; }
void setVolatile(bool is) { m_volatile = is; }
bool isReference() const { return m_reference; }
void setReference(bool is) { m_reference = is; }
int indirections() const { return m_indirections; }
void setIndirections(int indirections) { m_indirections = indirections; }
bool isFunctionPointer() const { return m_functionPointer; }
void setFunctionPointer(bool is) { m_functionPointer = is; }
QStringList arrayElements() const { return m_arrayElements; }
void setArrayElements(const QStringList &arrayElements) { m_arrayElements = arrayElements; }
QList<TypeInfo> arguments() const { return m_arguments; }
void setArguments(const QList<TypeInfo> &arguments);
void addArgument(const TypeInfo &arg) { m_arguments.append(arg); }
bool operator==(const TypeInfo &other);
bool operator!=(const TypeInfo &other) { return !(*this==other); }
// ### arrays and templates??
QString toString() const;
static TypeInfo combine (const TypeInfo &__lhs, const TypeInfo &__rhs);
static TypeInfo resolveType (TypeInfo const &__type, CodeModelItem __scope);
private:
union
{
uint flags;
struct
{
uint m_constant: 1;
uint m_volatile: 1;
uint m_reference: 1;
uint m_functionPointer: 1;
uint m_indirections: 6;
uint m_padding: 22;
};
};
QStringList m_qualifiedName;
QStringList m_arrayElements;
QList<TypeInfo> m_arguments;
};
class _CodeModelItem: public QSharedData
{
public:
enum Kind
{
/* These are bit-flags resembling inheritance */
Kind_Scope = 0x1,
Kind_Namespace = 0x2 | Kind_Scope,
Kind_Member = 0x4,
Kind_Function = 0x8 | Kind_Member,
KindMask = 0xf,
/* These are for classes that are not inherited from */
FirstKind = 0x8,
Kind_Argument = 1 << FirstKind,
Kind_Class = 2 << FirstKind | Kind_Scope,
Kind_Enum = 3 << FirstKind,
Kind_Enumerator = 4 << FirstKind,
Kind_File = 5 << FirstKind | Kind_Namespace,
Kind_FunctionDefinition = 6 << FirstKind | Kind_Function,
Kind_TemplateParameter = 7 << FirstKind,
Kind_TypeAlias = 8 << FirstKind,
Kind_Variable = 9 << FirstKind | Kind_Member
};
public:
virtual ~_CodeModelItem();
int kind() const;
QStringList qualifiedName() const;
QString name() const;
void setName(const QString &name);
QStringList scope() const;
void setScope(const QStringList &scope);
QString fileName() const;
void setFileName(const QString &fileName);
FileModelItem file() const;
void getStartPosition(int *line, int *column);
void setStartPosition(int line, int column);
void getEndPosition(int *line, int *column);
void setEndPosition(int line, int column);
inline std::size_t creationId() const { return _M_creation_id; }
inline void setCreationId(std::size_t creation_id) { _M_creation_id = creation_id; }
inline CodeModel *model() const { return _M_model; }
CodeModelItem toItem() const;
protected:
_CodeModelItem(CodeModel *model, int kind);
void setKind(int kind);
private:
CodeModel *_M_model;
int _M_kind;
int _M_startLine;
int _M_startColumn;
int _M_endLine;
int _M_endColumn;
std::size_t _M_creation_id;
QString _M_name;
QString _M_fileName;
QStringList _M_scope;
private:
_CodeModelItem(const _CodeModelItem &other);
void operator = (const _CodeModelItem &other);
};
class _ScopeModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(Scope)
static ScopeModelItem create(CodeModel *model);
public:
ClassList classes() const;
EnumList enums() const;
FunctionDefinitionList functionDefinitions() const;
FunctionList functions() const;
TypeAliasList typeAliases() const;
VariableList variables() const;
void addClass(ClassModelItem item);
void addEnum(EnumModelItem item);
void addFunction(FunctionModelItem item);
void addFunctionDefinition(FunctionDefinitionModelItem item);
void addTypeAlias(TypeAliasModelItem item);
void addVariable(VariableModelItem item);
void removeClass(ClassModelItem item);
void removeEnum(EnumModelItem item);
void removeFunction(FunctionModelItem item);
void removeFunctionDefinition(FunctionDefinitionModelItem item);
void removeTypeAlias(TypeAliasModelItem item);
void removeVariable(VariableModelItem item);
ClassModelItem findClass(const QString &name) const;
EnumModelItem findEnum(const QString &name) const;
FunctionDefinitionList findFunctionDefinitions(const QString &name) const;
FunctionList findFunctions(const QString &name) const;
TypeAliasModelItem findTypeAlias(const QString &name) const;
VariableModelItem findVariable(const QString &name) const;
void addEnumsDeclaration(const QString &enumsDeclaration);
QStringList enumsDeclarations() const { return _M_enumsDeclarations; }
inline QHash<QString, ClassModelItem> classMap() const { return _M_classes; }
inline QHash<QString, EnumModelItem> enumMap() const { return _M_enums; }
inline QHash<QString, TypeAliasModelItem> typeAliasMap() const { return _M_typeAliases; }
inline QHash<QString, VariableModelItem> variableMap() const { return _M_variables; }
inline QMultiHash<QString, FunctionDefinitionModelItem> functionDefinitionMap() const { return _M_functionDefinitions; }
inline QMultiHash<QString, FunctionModelItem> functionMap() const { return _M_functions; }
FunctionModelItem declaredFunction(FunctionModelItem item);
protected:
_ScopeModelItem(CodeModel *model, int kind = __node_kind)
: _CodeModelItem(model, kind) {}
private:
QHash<QString, ClassModelItem> _M_classes;
QHash<QString, EnumModelItem> _M_enums;
QHash<QString, TypeAliasModelItem> _M_typeAliases;
QHash<QString, VariableModelItem> _M_variables;
QMultiHash<QString, FunctionDefinitionModelItem> _M_functionDefinitions;
QMultiHash<QString, FunctionModelItem> _M_functions;
private:
_ScopeModelItem(const _ScopeModelItem &other);
void operator = (const _ScopeModelItem &other);
QStringList _M_enumsDeclarations;
};
class _ClassModelItem: public _ScopeModelItem
{
public:
DECLARE_MODEL_NODE(Class)
static ClassModelItem create(CodeModel *model);
public:
QStringList baseClasses() const;
void setBaseClasses(const QStringList &baseClasses);
void addBaseClass(const QString &baseClass);
void removeBaseClass(const QString &baseClass);
TemplateParameterList templateParameters() const;
void setTemplateParameters(const TemplateParameterList &templateParameters);
bool extendsClass(const QString &name) const;
void setClassType(CodeModel::ClassType type);
CodeModel::ClassType classType() const;
void addPropertyDeclaration(const QString &propertyDeclaration);
QStringList propertyDeclarations() const { return _M_propertyDeclarations; }
protected:
_ClassModelItem(CodeModel *model, int kind = __node_kind)
: _ScopeModelItem(model, kind), _M_classType(CodeModel::Class) {}
private:
QStringList _M_baseClasses;
TemplateParameterList _M_templateParameters;
CodeModel::ClassType _M_classType;
QStringList _M_propertyDeclarations;
private:
_ClassModelItem(const _ClassModelItem &other);
void operator = (const _ClassModelItem &other);
};
class _NamespaceModelItem: public _ScopeModelItem
{
public:
DECLARE_MODEL_NODE(Namespace)
static NamespaceModelItem create(CodeModel *model);
public:
NamespaceList namespaces() const;
void addNamespace(NamespaceModelItem item);
void removeNamespace(NamespaceModelItem item);
NamespaceModelItem findNamespace(const QString &name) const;
inline QHash<QString, NamespaceModelItem> namespaceMap() const { return _M_namespaces; };
protected:
_NamespaceModelItem(CodeModel *model, int kind = __node_kind)
: _ScopeModelItem(model, kind) {}
private:
QHash<QString, NamespaceModelItem> _M_namespaces;
private:
_NamespaceModelItem(const _NamespaceModelItem &other);
void operator = (const _NamespaceModelItem &other);
};
class _FileModelItem: public _NamespaceModelItem
{
public:
DECLARE_MODEL_NODE(File)
static FileModelItem create(CodeModel *model);
protected:
_FileModelItem(CodeModel *model, int kind = __node_kind)
: _NamespaceModelItem(model, kind) {}
private:
_FileModelItem(const _FileModelItem &other);
void operator = (const _FileModelItem &other);
};
class _ArgumentModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(Argument)
static ArgumentModelItem create(CodeModel *model);
public:
TypeInfo type() const;
void setType(const TypeInfo &type);
bool defaultValue() const;
void setDefaultValue(bool defaultValue);
QString defaultValueExpression() const { return _M_defaultValueExpression; }
void setDefaultValueExpression(const QString &expr) { _M_defaultValueExpression = expr; }
protected:
_ArgumentModelItem(CodeModel *model, int kind = __node_kind)
: _CodeModelItem(model, kind), _M_defaultValue(false) {}
private:
TypeInfo _M_type;
QString _M_defaultValueExpression;
bool _M_defaultValue;
private:
_ArgumentModelItem(const _ArgumentModelItem &other);
void operator = (const _ArgumentModelItem &other);
};
class _MemberModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(Member)
bool isConstant() const;
void setConstant(bool isConstant);
bool isVolatile() const;
void setVolatile(bool isVolatile);
bool isStatic() const;
void setStatic(bool isStatic);
bool isAuto() const;
void setAuto(bool isAuto);
bool isFriend() const;
void setFriend(bool isFriend);
bool isRegister() const;
void setRegister(bool isRegister);
bool isExtern() const;
void setExtern(bool isExtern);
bool isMutable() const;
void setMutable(bool isMutable);
CodeModel::AccessPolicy accessPolicy() const;
void setAccessPolicy(CodeModel::AccessPolicy accessPolicy);
TemplateParameterList templateParameters() const
{ return _M_templateParameters; }
void setTemplateParameters(const TemplateParameterList &templateParameters)
{ _M_templateParameters = templateParameters; }
TypeInfo type() const;
void setType(const TypeInfo &type);
protected:
_MemberModelItem(CodeModel *model, int kind)
: _CodeModelItem(model, kind),
_M_accessPolicy(CodeModel::Public),
_M_flags(0)
{}
private:
TemplateParameterList _M_templateParameters;
TypeInfo _M_type;
CodeModel::AccessPolicy _M_accessPolicy;
union
{
struct
{
uint _M_isConstant: 1;
uint _M_isVolatile: 1;
uint _M_isStatic: 1;
uint _M_isAuto: 1;
uint _M_isFriend: 1;
uint _M_isRegister: 1;
uint _M_isExtern: 1;
uint _M_isMutable: 1;
};
uint _M_flags;
};
};
class _FunctionModelItem: public _MemberModelItem
{
public:
DECLARE_MODEL_NODE(Function)
static FunctionModelItem create(CodeModel *model);
public:
ArgumentList arguments() const;
void addArgument(ArgumentModelItem item);
void removeArgument(ArgumentModelItem item);
CodeModel::FunctionType functionType() const;
void setFunctionType(CodeModel::FunctionType functionType);
bool isVirtual() const;
void setVirtual(bool isVirtual);
bool isInline() const;
void setInline(bool isInline);
bool isExplicit() const;
void setExplicit(bool isExplicit);
bool isInvokable() const; // Qt
void setInvokable(bool isInvokable); // Qt
bool isAbstract() const;
void setAbstract(bool isAbstract);
bool isVariadics() const;
void setVariadics(bool isVariadics);
bool isSimilar(FunctionModelItem other) const;
protected:
_FunctionModelItem(CodeModel *model, int kind = __node_kind)
: _MemberModelItem(model, kind),
_M_functionType(CodeModel::Normal),
_M_flags(0)
{}
private:
ArgumentList _M_arguments;
CodeModel::FunctionType _M_functionType;
union
{
struct
{
uint _M_isVirtual: 1;
uint _M_isInline: 1;
uint _M_isAbstract: 1;
uint _M_isExplicit: 1;
uint _M_isVariadics: 1;
uint _M_isInvokable : 1; // Qt
};
uint _M_flags;
};
private:
_FunctionModelItem(const _FunctionModelItem &other);
void operator = (const _FunctionModelItem &other);
};
class _FunctionDefinitionModelItem: public _FunctionModelItem
{
public:
DECLARE_MODEL_NODE(FunctionDefinition)
static FunctionDefinitionModelItem create(CodeModel *model);
protected:
_FunctionDefinitionModelItem(CodeModel *model, int kind = __node_kind)
: _FunctionModelItem(model, kind) {}
private:
_FunctionDefinitionModelItem(const _FunctionDefinitionModelItem &other);
void operator = (const _FunctionDefinitionModelItem &other);
};
class _VariableModelItem: public _MemberModelItem
{
public:
DECLARE_MODEL_NODE(Variable)
static VariableModelItem create(CodeModel *model);
protected:
_VariableModelItem(CodeModel *model, int kind = __node_kind)
: _MemberModelItem(model, kind)
{}
private:
_VariableModelItem(const _VariableModelItem &other);
void operator = (const _VariableModelItem &other);
};
class _TypeAliasModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(TypeAlias)
static TypeAliasModelItem create(CodeModel *model);
public:
TypeInfo type() const;
void setType(const TypeInfo &type);
protected:
_TypeAliasModelItem(CodeModel *model, int kind = __node_kind)
: _CodeModelItem(model, kind) {}
private:
TypeInfo _M_type;
private:
_TypeAliasModelItem(const _TypeAliasModelItem &other);
void operator = (const _TypeAliasModelItem &other);
};
class _EnumModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(Enum)
static EnumModelItem create(CodeModel *model);
public:
CodeModel::AccessPolicy accessPolicy() const;
void setAccessPolicy(CodeModel::AccessPolicy accessPolicy);
EnumeratorList enumerators() const;
void addEnumerator(EnumeratorModelItem item);
void removeEnumerator(EnumeratorModelItem item);
protected:
_EnumModelItem(CodeModel *model, int kind = __node_kind)
: _CodeModelItem(model, kind),
_M_accessPolicy(CodeModel::Public)
{}
private:
CodeModel::AccessPolicy _M_accessPolicy;
EnumeratorList _M_enumerators;
private:
_EnumModelItem(const _EnumModelItem &other);
void operator = (const _EnumModelItem &other);
};
class _EnumeratorModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(Enumerator)
static EnumeratorModelItem create(CodeModel *model);
public:
QString value() const;
void setValue(const QString &value);
protected:
_EnumeratorModelItem(CodeModel *model, int kind = __node_kind)
: _CodeModelItem(model, kind) {}
private:
QString _M_value;
private:
_EnumeratorModelItem(const _EnumeratorModelItem &other);
void operator = (const _EnumeratorModelItem &other);
};
class _TemplateParameterModelItem: public _CodeModelItem
{
public:
DECLARE_MODEL_NODE(TemplateParameter)
static TemplateParameterModelItem create(CodeModel *model);
public:
TypeInfo type() const;
void setType(const TypeInfo &type);
bool defaultValue() const;
void setDefaultValue(bool defaultValue);
protected:
_TemplateParameterModelItem(CodeModel *model, int kind = __node_kind)
: _CodeModelItem(model, kind), _M_defaultValue(false) {}
private:
TypeInfo _M_type;
bool _M_defaultValue;
private:
_TemplateParameterModelItem(const _TemplateParameterModelItem &other);
void operator = (const _TemplateParameterModelItem &other);
};
template <class _Target, class _Source>
_Target model_safe_cast(_Source item)
{
typedef typename _Target::Type * _Target_pointer;
typedef typename _Source::Type * _Source_pointer;
_Source_pointer source = item.data();
if (source && source->kind() == _Target_pointer(0)->__node_kind)
{
_Target ptr(static_cast<_Target_pointer>(source));
return ptr;
}
return _Target();
}
template <typename _Target, typename _Source>
_Target model_dynamic_cast(_Source item)
{
typedef typename _Target::Type * _Target_pointer;
typedef typename _Source::Type * _Source_pointer;
_Source_pointer source = item.data();
if (source && (source->kind() == _Target_pointer(0)->__node_kind
|| (int(_Target_pointer(0)->__node_kind) <= int(_CodeModelItem::KindMask)
&& ((source->kind() & _Target_pointer(0)->__node_kind)
== _Target_pointer(0)->__node_kind))))
{
_Target ptr(static_cast<_Target_pointer>(source));
return ptr;
}
return _Target();
}
#endif // CODEMODEL_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,122 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "codemodel_finder.h"
#include "codemodel.h"
#include "binder.h"
CodeModelFinder::CodeModelFinder(CodeModel *model, Binder *binder)
: _M_model(model),
_M_binder (binder),
_M_token_stream(binder->tokenStream ()),
name_cc(_M_binder),
_M_resolve_policy(ResolveItem)
{
}
CodeModelFinder::~CodeModelFinder()
{
}
ScopeModelItem CodeModelFinder::resolveScope(NameAST *name, ScopeModelItem scope)
{
Q_ASSERT(scope != 0);
ResolvePolicy saved_resolve_policy = _M_resolve_policy;
_M_resolve_policy = ResolveScope;
ScopeModelItem old = changeCurrentScope(scope);
visit(name);
ScopeModelItem result = _M_current_scope;
changeCurrentScope(old); // restore
_M_resolve_policy = saved_resolve_policy;
return result;
}
ScopeModelItem CodeModelFinder::changeCurrentScope(ScopeModelItem scope)
{
ScopeModelItem old = _M_current_scope;
_M_current_scope = scope;
return old;
}
void CodeModelFinder::visitName(NameAST *node)
{
visitNodes(this, node->qualified_names);
if (_M_resolve_policy == ResolveItem)
visit(node->unqualified_name);
}
void CodeModelFinder::visitUnqualifiedName(UnqualifiedNameAST *node)
{
if (!_M_current_scope)
{
// nothing to do
return;
}
name_cc.run(node);
QString id = name_cc.name();
if (ClassModelItem klass = _M_current_scope->findClass(id))
{
_M_current_scope = klass;
}
else if (NamespaceModelItem parentNamespace = model_safe_cast<NamespaceModelItem>(_M_current_scope))
{
NamespaceModelItem ns = parentNamespace->findNamespace(id);
_M_current_scope = model_static_cast<ScopeModelItem>(ns);
}
else if (FileModelItem file = model_safe_cast<FileModelItem>(_M_current_scope))
{
NamespaceModelItem ns = file->findNamespace(id);
_M_current_scope = model_static_cast<ScopeModelItem>(ns);
}
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,87 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CODEMODEL_FINDER_H
#define CODEMODEL_FINDER_H
#include "default_visitor.h"
#include "codemodel_fwd.h"
#include "name_compiler.h"
class TokenStream;
class Binder;
class CodeModelFinder: protected DefaultVisitor
{
enum ResolvePolicy
{
ResolveScope,
ResolveItem
};
public:
CodeModelFinder(CodeModel *model, Binder *binder);
virtual ~CodeModelFinder();
ScopeModelItem resolveScope(NameAST *name, ScopeModelItem scope);
inline CodeModel *model() const { return _M_model; }
protected:
virtual void visitName(NameAST *node);
virtual void visitUnqualifiedName(UnqualifiedNameAST *node);
ScopeModelItem changeCurrentScope(ScopeModelItem scope);
private:
CodeModel *_M_model;
Binder *_M_binder;
TokenStream *_M_token_stream;
NameCompiler name_cc;
ScopeModelItem _M_current_scope;
ResolvePolicy _M_resolve_policy;
};
#endif // CODEMODEL_FINDER_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,97 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CODEMODEL_FWD_H
#define CODEMODEL_FWD_H
#include <codemodel_pointer.h>
#include <QtCore/QList>
// forward declarations
class CodeModel;
class _ArgumentModelItem;
class _ClassModelItem;
class _CodeModelItem;
class _EnumModelItem;
class _EnumeratorModelItem;
class _FileModelItem;
class _FunctionDefinitionModelItem;
class _FunctionModelItem;
class _NamespaceModelItem;
class _ScopeModelItem;
class _TemplateParameterModelItem;
class _TypeAliasModelItem;
class _VariableModelItem;
class _MemberModelItem;
class TypeInfo;
typedef CodeModelPointer<_ArgumentModelItem> ArgumentModelItem;
typedef CodeModelPointer<_ClassModelItem> ClassModelItem;
typedef CodeModelPointer<_CodeModelItem> CodeModelItem;
typedef CodeModelPointer<_EnumModelItem> EnumModelItem;
typedef CodeModelPointer<_EnumeratorModelItem> EnumeratorModelItem;
typedef CodeModelPointer<_FileModelItem> FileModelItem;
typedef CodeModelPointer<_FunctionDefinitionModelItem> FunctionDefinitionModelItem;
typedef CodeModelPointer<_FunctionModelItem> FunctionModelItem;
typedef CodeModelPointer<_NamespaceModelItem> NamespaceModelItem;
typedef CodeModelPointer<_ScopeModelItem> ScopeModelItem;
typedef CodeModelPointer<_TemplateParameterModelItem> TemplateParameterModelItem;
typedef CodeModelPointer<_TypeAliasModelItem> TypeAliasModelItem;
typedef CodeModelPointer<_VariableModelItem> VariableModelItem;
typedef CodeModelPointer<_MemberModelItem> MemberModelItem;
typedef QList<ArgumentModelItem> ArgumentList;
typedef QList<ClassModelItem> ClassList;
typedef QList<CodeModelItem> ItemList;
typedef QList<EnumModelItem> EnumList;
typedef QList<EnumeratorModelItem> EnumeratorList;
typedef QList<FileModelItem> FileList;
typedef QList<FunctionDefinitionModelItem> FunctionDefinitionList;
typedef QList<FunctionModelItem> FunctionList;
typedef QList<NamespaceModelItem> NamespaceList;
typedef QList<ScopeModelItem> ScopeList;
typedef QList<TemplateParameterModelItem> TemplateParameterList;
typedef QList<TypeAliasModelItem> TypeAliasList;
typedef QList<VariableModelItem> VariableList;
typedef QList<MemberModelItem> MemberList;
#endif // CODEMODEL_FWD_H

View File

@ -1,131 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CODEMODEL_POINTER_H
#define CODEMODEL_POINTER_H
#include <QtCore/QSharedData>
// Since the atomic API changed in 4.4 we need to hack a little here
// to make it work with both 4.3 and 4.4 until that is not required
#if QT_VERSION >= 0x040400
# include <QtCore/qatomic.h>
template <class T> class CodeModelPointer: public QAtomicPointer<T>
#else
template <class T> class CodeModelPointer
#endif // QT_VERSION >= 0x040400
{
public:
typedef T Type;
#if QT_VERSION < 0x040400
inline T &operator*() { return *d; }
inline const T &operator*() const { return *d; }
inline T *operator->() { return d; }
inline const T *operator->() const { return d; }
inline operator T *() { return d; }
inline operator const T *() const { return d; }
inline T *data() { return d; }
inline const T *data() const { return d; }
inline const T *constData() const { return d; }
inline bool operator==(const CodeModelPointer<T> &other) const { return d == other.d; }
inline bool operator!=(const CodeModelPointer<T> &other) const { return d != other.d; }
inline bool operator==(const T *ptr) const { return d == ptr; }
inline bool operator!=(const T *ptr) const { return d != ptr; }
inline CodeModelPointer() { d = 0; }
inline ~CodeModelPointer() { if (d && !d->ref.deref()) delete d; }
explicit CodeModelPointer(T *data);
inline CodeModelPointer(const CodeModelPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
inline CodeModelPointer<T> & operator=(const CodeModelPointer<T> &o) {
if (o.d != d) {
T *x = o.d;
if (x) x->ref.ref();
x = qAtomicSetPtr(&d, x);
if (x && !x->ref.deref())
delete x;
}
return *this;
}
inline CodeModelPointer &operator=(T *o) {
if (o != d) {
T *x = o;
if (x) x->ref.ref();
x = qAtomicSetPtr(&d, x);
if (x && !x->ref.deref())
delete x;
}
return *this;
}
inline bool operator!() const { return !d; }
private:
T *d;
#else // QT_VERSION < 0x040400
inline CodeModelPointer(T *value = 0) : QAtomicPointer<T>(value) {}
inline CodeModelPointer &operator=(T *o) {
QAtomicPointer<T>::operator=(o);
return *this;
}
inline T *data() { return (T *) *this; }
inline const T *data() const { return (const T *) *this; }
inline const T *constData() const { return (const T *) *this; }
#endif
};
#if QT_VERSION < 0x040400
template <class T>
Q_INLINE_TEMPLATE CodeModelPointer<T>::CodeModelPointer(T *adata) : d(adata)
{ if (d) d->ref.ref(); }
#endif
#endif // CODEMODEL_POINTER_H

View File

@ -1,69 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "compiler_utils.h"
#include "type_compiler.h"
#include "name_compiler.h"
#include "declarator_compiler.h"
#include "ast.h"
#include "binder.h"
TypeInfo CompilerUtils::typeDescription(TypeSpecifierAST *type_specifier, DeclaratorAST *declarator, Binder *binder)
{
TypeCompiler type_cc (binder);
DeclaratorCompiler decl_cc (binder);
type_cc.run (type_specifier);
decl_cc.run (declarator);
TypeInfo typeInfo;
typeInfo.setQualifiedName (type_cc.qualifiedName ());
typeInfo.setConstant (type_cc.isConstant ());
typeInfo.setVolatile (type_cc.isVolatile ());
typeInfo.setReference (decl_cc.isReference ());
typeInfo.setIndirections (decl_cc.indirection ());
typeInfo.setArrayElements (decl_cc.arrayElements ());
return typeInfo;
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,66 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef COMPILER_UTILS_H
#define COMPILER_UTILS_H
#include <utility>
#include "codemodel.h"
class QString;
class QStringList;
struct TypeSpecifierAST;
struct DeclaratorAST;
class TokenStream;
class Binder;
namespace CompilerUtils
{
TypeInfo typeDescription(TypeSpecifierAST *type_specifier, DeclaratorAST *declarator, Binder *binder);
} // namespace CompilerUtils
#endif // COMPILER_UTILS_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,147 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "control.h"
#include "lexer.h"
Control::Control()
: current_context(0),
_M_skipFunctionBody(false),
_M_lexer(0),
_M_parser(0)
{
pushContext();
declareTypedef(findOrInsertName("__builtin_va_list",
strlen("__builtin_va_list")), 0);
}
Control::~Control()
{
popContext();
Q_ASSERT(current_context == 0);
}
Lexer *Control::changeLexer(Lexer *lexer)
{
Lexer *old = _M_lexer;
_M_lexer = lexer;
return old;
}
Parser *Control::changeParser(Parser *parser)
{
Parser *old = _M_parser;
_M_parser = parser;
return old;
}
Type *Control::lookupType(const NameSymbol *name) const
{
Q_ASSERT(current_context != 0);
return current_context->resolve(name);
}
void Control::declare(const NameSymbol *name, Type *type)
{
//printf("*** Declare:");
//printSymbol(name);
//putchar('\n');
Q_ASSERT(current_context != 0);
current_context->bind(name, type);
}
void Control::pushContext()
{
// printf("+Context\n");
Context *new_context = new Context;
new_context->parent = current_context;
current_context = new_context;
}
void Control::popContext()
{
// printf("-Context\n");
Q_ASSERT(current_context != 0);
Context *old_context = current_context;
current_context = current_context->parent;
delete old_context;
}
void Control::declareTypedef(const NameSymbol *name, Declarator *d)
{
// printf("declared typedef:");
// printSymbol(name);
// printf("\n");
stl_typedef_table.insert(name, d);
}
bool Control::isTypedef(const NameSymbol *name) const
{
// printf("is typedef:");
// printSymbol(name);
// printf("= %d\n", (stl_typedef_table.find(name) != stl_typedef_table.end()));
return stl_typedef_table.contains(name);
}
QList<Control::ErrorMessage> Control::errorMessages () const
{
return _M_error_messages;
}
void Control::clearErrorMessages ()
{
_M_error_messages.clear ();
}
void Control::reportError (const ErrorMessage &errmsg)
{
_M_error_messages.append(errmsg);
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,152 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CONTROL_H
#define CONTROL_H
#include "symbol.h"
#include "smallobject.h"
#include <QtCore/QHash>
struct Declarator;
struct Type;
class Lexer;
class Parser;
struct Context
{
Context *parent;
inline void bind(const NameSymbol *name, Type *type)
{ symbol_table.insert(name, type); }
inline Type *resolve(const NameSymbol *name) const
{
if (Type *type = symbol_table.value(name))
return type;
else if (parent)
return parent->resolve(name);
return 0;
}
typedef QHash<const NameSymbol*, Type*> symbol_table_t;
symbol_table_t symbol_table;
};
class Control
{
public:
class ErrorMessage
{
public:
ErrorMessage ():
_M_line (0),
_M_column (0) {}
inline int line () const { return _M_line; }
inline void setLine (int line) { _M_line = line; }
inline int column () const { return _M_column; }
inline void setColumn (int column) { _M_column = column; }
inline QString fileName () const { return _M_fileName; }
inline void setFileName (const QString &fileName) { _M_fileName = fileName; }
inline QString message () const { return _M_message; }
inline void setMessage (const QString &message) { _M_message = message; }
private:
int _M_line;
int _M_column;
QString _M_fileName;
QString _M_message;
};
Control();
~Control();
inline bool skipFunctionBody() const { return _M_skipFunctionBody; }
inline void setSkipFunctionBody(bool skip) { _M_skipFunctionBody = skip; }
Lexer *changeLexer(Lexer *lexer);
Parser *changeParser(Parser *parser);
Lexer *currentLexer() const { return _M_lexer; }
Parser *currentParser() const { return _M_parser; }
Context *current_context;
inline Context *currentContext() const
{ return current_context; }
void pushContext();
void popContext();
Type *lookupType(const NameSymbol *name) const;
void declare(const NameSymbol *name, Type *type);
inline const NameSymbol *findOrInsertName(const char *data, size_t count)
{ return name_table.findOrInsert(data, count); }
void declareTypedef(const NameSymbol *name, Declarator *d);
bool isTypedef(const NameSymbol *name) const;
void reportError (const ErrorMessage &errmsg);
QList<ErrorMessage> errorMessages () const;
void clearErrorMessages ();
private:
NameTable name_table;
QHash<const NameSymbol*, Declarator*> stl_typedef_table;
bool _M_skipFunctionBody;
Lexer *_M_lexer;
Parser *_M_parser;
QList<ErrorMessage> _M_error_messages;
};
#endif // CONTROL_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,179 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "declarator_compiler.h"
#include "name_compiler.h"
#include "type_compiler.h"
#include "compiler_utils.h"
#include "lexer.h"
#include "binder.h"
#include "tokens.h"
#include <qdebug.h>
DeclaratorCompiler::DeclaratorCompiler(Binder *binder)
: _M_binder (binder), _M_token_stream (binder->tokenStream ())
{
}
void DeclaratorCompiler::run(DeclaratorAST *node)
{
_M_id.clear();
_M_parameters.clear();
_M_array.clear();
_M_function = false;
_M_reference = false;
_M_variadics = false;
_M_indirection = 0;
if (node)
{
NameCompiler name_cc(_M_binder);
DeclaratorAST *decl = node;
while (decl && decl->sub_declarator)
decl = decl->sub_declarator;
Q_ASSERT (decl != 0);
name_cc.run(decl->id);
_M_id = name_cc.name();
_M_function = (node->parameter_declaration_clause != 0);
if (node->parameter_declaration_clause && node->parameter_declaration_clause->ellipsis)
_M_variadics = true;
visitNodes(this, node->ptr_ops);
visit(node->parameter_declaration_clause);
if (const ListNode<ExpressionAST*> *it = node->array_dimensions)
{
it->toFront();
const ListNode<ExpressionAST*> *end = it;
do
{
QString elt;
if (ExpressionAST *expr = it->element)
{
const Token &start_token = _M_token_stream->token((int) expr->start_token);
const Token &end_token = _M_token_stream->token((int) expr->end_token);
elt += QString::fromUtf8(&start_token.text[start_token.position],
(int) (end_token.position - start_token.position)).trimmed();
}
_M_array.append (elt);
it = it->next;
}
while (it != end);
}
}
}
void DeclaratorCompiler::visitPtrOperator(PtrOperatorAST *node)
{
std::size_t op = _M_token_stream->kind(node->op);
switch (op)
{
case '&':
_M_reference = true;
break;
case '*':
++_M_indirection;
break;
default:
break;
}
if (node->mem_ptr)
{
#if defined(__GNUC__)
#warning "ptr to mem -- not implemented"
#endif
}
}
void DeclaratorCompiler::visitParameterDeclaration(ParameterDeclarationAST *node)
{
Parameter p;
TypeCompiler type_cc(_M_binder);
DeclaratorCompiler decl_cc(_M_binder);
decl_cc.run(node->declarator);
p.name = decl_cc.id();
p.type = CompilerUtils::typeDescription(node->type_specifier, node->declarator, _M_binder);
// ignore case a single void parameter
if (_M_parameters.isEmpty() && p.name.isEmpty() && p.type.toString() == "void")
{
return;
}
if (node->expression != 0)
{
const Token &start = _M_token_stream->token((int) node->expression->start_token);
const Token &end = _M_token_stream->token((int) node->expression->end_token);
int length = (int) (end.position - start.position);
p.defaultValueExpression = QString();
QString source = QString::fromUtf8(&start.text[start.position], length).trimmed();
QStringList list = source.split("\n");
for (int i=0; i<list.size(); ++i) {
if (!list.at(i).startsWith("#"))
p.defaultValueExpression += list.at(i).trimmed();
}
p.defaultValue = p.defaultValueExpression.size() > 0;
}
_M_parameters.append(p);
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,100 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DECLARATOR_COMPILER_H
#define DECLARATOR_COMPILER_H
#include "default_visitor.h"
#include "codemodel.h"
#include <QtCore/QString>
#include <QtCore/QList>
class TokenStream;
class Binder;
class DeclaratorCompiler: protected DefaultVisitor
{
public:
struct Parameter
{
TypeInfo type;
QString name;
QString defaultValueExpression;
bool defaultValue;
Parameter(): defaultValue(false) {}
};
public:
DeclaratorCompiler(Binder *binder);
void run(DeclaratorAST *node);
inline QString id() const { return _M_id; }
inline QStringList arrayElements() const { return _M_array; }
inline bool isFunction() const { return _M_function; }
inline bool isVariadics() const { return _M_variadics; }
inline bool isReference() const { return _M_reference; }
inline int indirection() const { return _M_indirection; }
inline QList<Parameter> parameters() const { return _M_parameters; }
protected:
virtual void visitPtrOperator(PtrOperatorAST *node);
virtual void visitParameterDeclaration(ParameterDeclarationAST *node);
private:
Binder *_M_binder;
TokenStream *_M_token_stream;
bool _M_function;
bool _M_reference;
bool _M_variadics;
int _M_indirection;
QString _M_id;
QStringList _M_array;
QList<Parameter> _M_parameters;
};
#endif // DECLARATOR_COMPILER_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,476 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "default_visitor.h"
void DefaultVisitor::visitAccessSpecifier(AccessSpecifierAST *)
{
// nothing to do
}
void DefaultVisitor::visitAsmDefinition(AsmDefinitionAST *)
{
// nothing to do
}
void DefaultVisitor::visitBaseClause(BaseClauseAST *node)
{
visitNodes(this, node->base_specifiers);
}
void DefaultVisitor::visitBaseSpecifier(BaseSpecifierAST *node)
{
visit(node->name);
}
void DefaultVisitor::visitBinaryExpression(BinaryExpressionAST *node)
{
visit(node->left_expression);
visit(node->right_expression);
}
void DefaultVisitor::visitCastExpression(CastExpressionAST *node)
{
visit(node->type_id);
visit(node->expression);
}
void DefaultVisitor::visitClassMemberAccess(ClassMemberAccessAST *node)
{
visit(node->name);
}
void DefaultVisitor::visitClassSpecifier(ClassSpecifierAST *node)
{
visit(node->win_decl_specifiers);
visit(node->name);
visit(node->base_clause);
visitNodes(this, node->member_specs);
}
void DefaultVisitor::visitCompoundStatement(CompoundStatementAST *node)
{
visitNodes(this, node->statements);
}
void DefaultVisitor::visitCondition(ConditionAST *node)
{
visit(node->type_specifier);
visit(node->declarator);
visit(node->expression);
}
void DefaultVisitor::visitConditionalExpression(ConditionalExpressionAST *node)
{
visit(node->condition);
visit(node->left_expression);
visit(node->right_expression);
}
void DefaultVisitor::visitCppCastExpression(CppCastExpressionAST *node)
{
visit(node->type_id);
visit(node->expression);
visitNodes(this, node->sub_expressions);
}
void DefaultVisitor::visitCtorInitializer(CtorInitializerAST *node)
{
visitNodes(this, node->member_initializers);
}
void DefaultVisitor::visitDeclarationStatement(DeclarationStatementAST *node)
{
visit(node->declaration);
}
void DefaultVisitor::visitDeclarator(DeclaratorAST *node)
{
visit(node->sub_declarator);
visitNodes(this, node->ptr_ops);
visit(node->id);
visit(node->bit_expression);
visitNodes(this, node->array_dimensions);
visit(node->parameter_declaration_clause);
visit(node->exception_spec);
}
void DefaultVisitor::visitDeleteExpression(DeleteExpressionAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitDoStatement(DoStatementAST *node)
{
visit(node->statement);
visit(node->expression);
}
void DefaultVisitor::visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *node)
{
visit(node->name);
}
void DefaultVisitor::visitEnumSpecifier(EnumSpecifierAST *node)
{
visit(node->name);
visitNodes(this, node->enumerators);
}
void DefaultVisitor::visitEnumerator(EnumeratorAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitExceptionSpecification(ExceptionSpecificationAST *node)
{
visitNodes(this, node->type_ids);
}
void DefaultVisitor::visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *node)
{
visit(node->expression);
visit(node->declaration);
}
void DefaultVisitor::visitExpressionStatement(ExpressionStatementAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitForStatement(ForStatementAST *node)
{
visit(node->init_statement);
visit(node->condition);
visit(node->expression);
visit(node->statement);
}
void DefaultVisitor::visitFunctionCall(FunctionCallAST *node)
{
visit(node->arguments);
}
void DefaultVisitor::visitFunctionDefinition(FunctionDefinitionAST *node)
{
visit(node->type_specifier);
visit(node->init_declarator);
visit(node->function_body);
visit(node->win_decl_specifiers);
}
void DefaultVisitor::visitIfStatement(IfStatementAST *node)
{
visit(node->condition);
visit(node->statement);
visit(node->else_statement);
}
void DefaultVisitor::visitIncrDecrExpression(IncrDecrExpressionAST *)
{
// nothing to do
}
void DefaultVisitor::visitInitDeclarator(InitDeclaratorAST *node)
{
visit(node->declarator);
visit(node->initializer);
}
void DefaultVisitor::visitInitializer(InitializerAST *node)
{
visit(node->initializer_clause);
visit(node->expression);
}
void DefaultVisitor::visitInitializerClause(InitializerClauseAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitLabeledStatement(LabeledStatementAST *)
{
// nothing to do
}
void DefaultVisitor::visitLinkageBody(LinkageBodyAST *node)
{
visitNodes(this, node->declarations);
}
void DefaultVisitor::visitLinkageSpecification(LinkageSpecificationAST *node)
{
visit(node->linkage_body);
visit(node->declaration);
}
void DefaultVisitor::visitMemInitializer(MemInitializerAST *node)
{
visit(node->initializer_id);
visit(node->expression);
}
void DefaultVisitor::visitName(NameAST *node)
{
visitNodes(this, node->qualified_names);
visit(node->unqualified_name);
}
void DefaultVisitor::visitNamespace(NamespaceAST *node)
{
visit(node->linkage_body);
}
void DefaultVisitor::visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *node)
{
visit(node->alias_name);
}
void DefaultVisitor::visitNewDeclarator(NewDeclaratorAST *node)
{
visit(node->ptr_op);
visit(node->sub_declarator);
visitNodes(this, node->expressions);
}
void DefaultVisitor::visitNewExpression(NewExpressionAST *node)
{
visit(node->expression);
visit(node->type_id);
visit(node->new_type_id);
visit(node->new_initializer);
}
void DefaultVisitor::visitNewInitializer(NewInitializerAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitNewTypeId(NewTypeIdAST *node)
{
visit(node->type_specifier);
visit(node->new_initializer);
visit(node->new_declarator);
}
void DefaultVisitor::visitOperator(OperatorAST *)
{
// nothing to do
}
void DefaultVisitor::visitOperatorFunctionId(OperatorFunctionIdAST *node)
{
visit(node->op);
visit(node->type_specifier);
visitNodes(this, node->ptr_ops);
}
void DefaultVisitor::visitParameterDeclaration(ParameterDeclarationAST *node)
{
visit(node->type_specifier);
visit(node->declarator);
visit(node->expression);
}
void DefaultVisitor::visitParameterDeclarationClause(ParameterDeclarationClauseAST *node)
{
visitNodes(this, node->parameter_declarations);
}
void DefaultVisitor::visitPostfixExpression(PostfixExpressionAST *node)
{
visit(node->type_specifier);
visit(node->expression);
visitNodes(this, node->sub_expressions);
}
void DefaultVisitor::visitPrimaryExpression(PrimaryExpressionAST *node)
{
visit(node->literal);
visit(node->expression_statement);
visit(node->sub_expression);
visit(node->name);
}
void DefaultVisitor::visitPtrOperator(PtrOperatorAST *node)
{
visit(node->mem_ptr);
}
void DefaultVisitor::visitPtrToMember(PtrToMemberAST *)
{
// nothing to do
}
void DefaultVisitor::visitReturnStatement(ReturnStatementAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitSimpleDeclaration(SimpleDeclarationAST *node)
{
visit(node->type_specifier);
visitNodes(this, node->init_declarators);
visit(node->win_decl_specifiers);
}
void DefaultVisitor::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node)
{
visit(node->name);
visit(node->type_id);
visit(node->expression);
}
void DefaultVisitor::visitSizeofExpression(SizeofExpressionAST *node)
{
visit(node->type_id);
visit(node->expression);
}
void DefaultVisitor::visitStringLiteral(StringLiteralAST *)
{
// nothing to do
}
void DefaultVisitor::visitSubscriptExpression(SubscriptExpressionAST *node)
{
visit(node->subscript);
}
void DefaultVisitor::visitSwitchStatement(SwitchStatementAST *node)
{
visit(node->condition);
visit(node->statement);
}
void DefaultVisitor::visitTemplateArgument(TemplateArgumentAST *node)
{
visit(node->type_id);
visit(node->expression);
}
void DefaultVisitor::visitTemplateDeclaration(TemplateDeclarationAST *node)
{
visitNodes(this, node->template_parameters);
visit(node->declaration);
}
void DefaultVisitor::visitTemplateParameter(TemplateParameterAST *node)
{
visit(node->type_parameter);
visit(node->parameter_declaration);
}
void DefaultVisitor::visitThrowExpression(ThrowExpressionAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitTranslationUnit(TranslationUnitAST *node)
{
visitNodes(this, node->declarations);
}
void DefaultVisitor::visitTryBlockStatement(TryBlockStatementAST *)
{
// nothing to do
}
void DefaultVisitor::visitTypeId(TypeIdAST *node)
{
visit(node->type_specifier);
visit(node->declarator);
}
void DefaultVisitor::visitTypeIdentification(TypeIdentificationAST *node)
{
visit(node->name);
visit(node->expression);
}
void DefaultVisitor::visitTypeParameter(TypeParameterAST *node)
{
visit(node->name);
visit(node->type_id);
visitNodes(this, node->template_parameters);
visit(node->template_name);
}
void DefaultVisitor::visitTypedef(TypedefAST *node)
{
visit(node->type_specifier);
visitNodes(this, node->init_declarators);
}
void DefaultVisitor::visitUnaryExpression(UnaryExpressionAST *node)
{
visit(node->expression);
}
void DefaultVisitor::visitUnqualifiedName(UnqualifiedNameAST *node)
{
visit(node->operator_id);
visitNodes(this, node->template_arguments);
}
void DefaultVisitor::visitUsing(UsingAST *node)
{
visit(node->name);
}
void DefaultVisitor::visitUsingDirective(UsingDirectiveAST *node)
{
visit(node->name);
}
void DefaultVisitor::visitWhileStatement(WhileStatementAST *node)
{
visit(node->condition);
visit(node->statement);
}
void DefaultVisitor::visitWinDeclSpec(WinDeclSpecAST *)
{
// nothing to do
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,135 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DEFAULT_VISITOR_H
#define DEFAULT_VISITOR_H
#include "visitor.h"
class DefaultVisitor: public Visitor
{
public:
DefaultVisitor() {}
protected:
virtual void visitAccessSpecifier(AccessSpecifierAST *);
virtual void visitAsmDefinition(AsmDefinitionAST *);
virtual void visitBaseClause(BaseClauseAST *);
virtual void visitBaseSpecifier(BaseSpecifierAST *);
virtual void visitBinaryExpression(BinaryExpressionAST *);
virtual void visitCastExpression(CastExpressionAST *);
virtual void visitClassMemberAccess(ClassMemberAccessAST *);
virtual void visitClassSpecifier(ClassSpecifierAST *);
virtual void visitCompoundStatement(CompoundStatementAST *);
virtual void visitCondition(ConditionAST *);
virtual void visitConditionalExpression(ConditionalExpressionAST *);
virtual void visitCppCastExpression(CppCastExpressionAST *);
virtual void visitCtorInitializer(CtorInitializerAST *);
virtual void visitDeclarationStatement(DeclarationStatementAST *);
virtual void visitDeclarator(DeclaratorAST *);
virtual void visitDeleteExpression(DeleteExpressionAST *);
virtual void visitDoStatement(DoStatementAST *);
virtual void visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *);
virtual void visitEnumSpecifier(EnumSpecifierAST *);
virtual void visitEnumerator(EnumeratorAST *);
virtual void visitExceptionSpecification(ExceptionSpecificationAST *);
virtual void visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *);
virtual void visitExpressionStatement(ExpressionStatementAST *);
virtual void visitForStatement(ForStatementAST *);
virtual void visitFunctionCall(FunctionCallAST *);
virtual void visitFunctionDefinition(FunctionDefinitionAST *);
virtual void visitIfStatement(IfStatementAST *);
virtual void visitIncrDecrExpression(IncrDecrExpressionAST *);
virtual void visitInitDeclarator(InitDeclaratorAST *);
virtual void visitInitializer(InitializerAST *);
virtual void visitInitializerClause(InitializerClauseAST *);
virtual void visitLabeledStatement(LabeledStatementAST *);
virtual void visitLinkageBody(LinkageBodyAST *);
virtual void visitLinkageSpecification(LinkageSpecificationAST *);
virtual void visitMemInitializer(MemInitializerAST *);
virtual void visitName(NameAST *);
virtual void visitNamespace(NamespaceAST *);
virtual void visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *);
virtual void visitNewDeclarator(NewDeclaratorAST *);
virtual void visitNewExpression(NewExpressionAST *);
virtual void visitNewInitializer(NewInitializerAST *);
virtual void visitNewTypeId(NewTypeIdAST *);
virtual void visitOperator(OperatorAST *);
virtual void visitOperatorFunctionId(OperatorFunctionIdAST *);
virtual void visitParameterDeclaration(ParameterDeclarationAST *);
virtual void visitParameterDeclarationClause(ParameterDeclarationClauseAST *);
virtual void visitPostfixExpression(PostfixExpressionAST *);
virtual void visitPrimaryExpression(PrimaryExpressionAST *);
virtual void visitPtrOperator(PtrOperatorAST *);
virtual void visitPtrToMember(PtrToMemberAST *);
virtual void visitReturnStatement(ReturnStatementAST *);
virtual void visitSimpleDeclaration(SimpleDeclarationAST *);
virtual void visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *);
virtual void visitSizeofExpression(SizeofExpressionAST *);
virtual void visitStringLiteral(StringLiteralAST *);
virtual void visitSubscriptExpression(SubscriptExpressionAST *);
virtual void visitSwitchStatement(SwitchStatementAST *);
virtual void visitTemplateArgument(TemplateArgumentAST *);
virtual void visitTemplateDeclaration(TemplateDeclarationAST *);
virtual void visitTemplateParameter(TemplateParameterAST *);
virtual void visitThrowExpression(ThrowExpressionAST *);
virtual void visitTranslationUnit(TranslationUnitAST *);
virtual void visitTryBlockStatement(TryBlockStatementAST *);
virtual void visitTypeId(TypeIdAST *);
virtual void visitTypeIdentification(TypeIdentificationAST *);
virtual void visitTypeParameter(TypeParameterAST *);
virtual void visitTypedef(TypedefAST *);
virtual void visitUnaryExpression(UnaryExpressionAST *);
virtual void visitUnqualifiedName(UnqualifiedNameAST *);
virtual void visitUsing(UsingAST *);
virtual void visitUsingDirective(UsingDirectiveAST *);
virtual void visitWhileStatement(WhileStatementAST *);
virtual void visitWinDeclSpec(WinDeclSpecAST *);
private:
typedef void (Visitor::*visitor_fun_ptr)(AST *);
static visitor_fun_ptr _S_table[];
};
#endif // VISITOR_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,142 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "dumptree.h"
#include <QtCore/QString>
#include <QtCore/qdebug.h>
static char const * const names[] = {
0,
"AccessSpecifier",
"AsmDefinition",
"BaseClause",
"BaseSpecifier",
"BinaryExpression",
"CastExpression",
"ClassMemberAccess",
"ClassSpecifier",
"CompoundStatement",
"Condition",
"ConditionalExpression",
"CppCastExpression",
"CtorInitializer",
"DeclarationStatement",
"Declarator",
"DeleteExpression",
"DoStatement",
"ElaboratedTypeSpecifier",
"EnumSpecifier",
"Enumerator",
"ExceptionSpecification",
"ExpressionOrDeclarationStatement",
"ExpressionStatement",
"ForStatement",
"FunctionCall",
"FunctionDefinition",
"IfStatement",
"IncrDecrExpression",
"InitDeclarator",
"Initializer",
"InitializerClause",
"LabeledStatement",
"LinkageBody",
"LinkageSpecification",
"MemInitializer",
"Name",
"Namespace",
"NamespaceAliasDefinition",
"NewDeclarator",
"NewExpression",
"NewInitializer",
"NewTypeId",
"Operator",
"OperatorFunctionId",
"ParameterDeclaration",
"ParameterDeclarationClause",
"PostfixExpression",
"PrimaryExpression",
"PtrOperator",
"PtrToMember",
"ReturnStatement",
"SimpleDeclaration",
"SimpleTypeSpecifier",
"SizeofExpression",
"StringLiteral",
"SubscriptExpression",
"SwitchStatement",
"TemplateArgument",
"TemplateDeclaration",
"TemplateParameter",
"ThrowExpression",
"TranslationUnit",
"TryBlockStatement",
"TypeId",
"TypeIdentification",
"TypeParameter",
"Typedef",
"UnaryExpression",
"UnqualifiedName",
"Using",
"UsingDirective",
"WhileStatement",
"WinDeclSpec"
};
DumpTree::DumpTree()
{
}
void DumpTree::visit(AST *node)
{
static int indent = 0;
if (node)
qDebug() << QString(indent * 2, ' ').toLatin1().constData() << names[node->kind]
<< '[' << node->start_token << ", " << node->end_token << ']';
++indent;
DefaultVisitor::visit(node);
--indent;
}
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,61 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DUMPTREE_H
#define DUMPTREE_H
#include "default_visitor.h"
class DumpTree: protected DefaultVisitor
{
public:
DumpTree();
void dump(AST *node) { visit(node); }
protected:
virtual void visit(AST *node);
};
#endif // DUMPTREE_H
// kate: space-indent on; indent-width 2; replace-tabs on;

View File

@ -1,64 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Script Generator project on Qt Labs.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef __STDARG
#define __STDARG
#if !defined(_VA_LIST) && !defined(__VA_LIST_DEFINED)
#define _VA_LIST
#define _VA_LIST_DEFINED
typedef char *__va_list;
#endif
static float __va_arg_tmp;
typedef __va_list va_list;
#define va_start(list, start) ((void)0)
#define __va_arg(list, mode, n) ((void)0)
#define _bigendian_va_arg(list, mode, n) ((void)0)
#define _littleendian_va_arg(list, mode, n) ((void)0)
#define va_end(list) ((void)0)
#define va_arg(list, mode) ((void)0)
typedef void *__gnuc_va_list;
#endif

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More