head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.4 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.2 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.3.0.14 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.12 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.10 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.8 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.6 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.4 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.2 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.2.0.2 pkgsrc-2010Q1-base:1.2; locks; strict; comment @# @; 1.4 date 2012.03.19.19.44.02; author markd; state dead; branches; next 1.3; 1.3 date 2010.04.10.02.45.05; author markd; state Exp; branches; next 1.2; 1.2 date 2010.02.07.15.26.40; author wiz; state Exp; branches; next 1.1; 1.1 date 2010.02.07.15.14.10; author wiz; state Exp; branches; next ; desc @@ 1.4 log @Update to KDE SC 4.8.0 add kactivities rename kdebase4 -> kde-baseapps4 rename kdebase-runtime4 -> kde-runtime4 rename kdebase-workspace4 -> kde-workspace4 rename kdebindings4-python -> py-kde4 @ text @$NetBSD: patch-ac,v 1.3 2010/04/10 02:45:05 markd Exp $ --- CMakeLists.txt.orig 2010-04-04 12:10:19.000000000 +0000 +++ CMakeLists.txt @@@@ -1,6 +1,6 @@@@ project(kdebindings) -add_subdirectory(generator) +#add_subdirectory(generator) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules ) @ 1.3 log @Update KDE to 4.4.2 For 4.4.0 major new technologies have been introduced, including social networking and online collaboration features, a new netbook-oriented interface and infrastructural innovations such as the KAuth authentication framework. According to KDE's bug-tracking system, 7293 bugs have been fixed and 1433 new feature requests were implemented. KDE SC 4.4.1 has a number of improvements: A performance problem in KMail when sending emails has been fixed Various fixes in Plasma widgets and other addons, such as the analog clock and the picture frame A number of fixes in Konsole, KDE's powerful terminal application KDE SC 4.4.2 has a number of improvements: Possible crashes in Plasma, Dolphin and Okular have been fixed The Microblog applet now shows the correct time in the timeline The audioplayer KRunner plugin has been fixed to not freeze the KRunner UI anymore @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Use a simpler patch from KDE's svn. @ text @d3 4 a6 7 http://websvn.kde.org/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip?r1=1061966&r2=1064763&view=patch --- python/pykde4/sip/kdecore/typedefs.sip.orig 2009-10-02 08:21:29.000000000 +0000 +++ python/pykde4/sip/kdecore/typedefs.sip @@@@ -466,91 +466,6 @@@@ template %End }; d8 5 a12 88 - -template -%MappedType QSet -{ -%TypeHeaderCode -#include -%End - -%ConvertFromTypeCode - // Create the list. - PyObject *l; - - if ((l = PyList_New(sipCpp->size())) == NULL) - return NULL; - - // Set the list elements. - QSet set = *sipCpp; - int i = 0; - foreach ((TYPE *)value, set) - { - PyObject *obj = sipConvertFromNewType(value, sipType_TYPE, sipTransferObj); - if (obj == NULL || PyList_SET_ITEM (l, i, obj) < 0) - { - Py_DECREF(l); - - if (obj) - Py_DECREF(obj); - - return NULL; - } - - Py_DECREF(obj); - i++; - } - - return l; -%End - -%ConvertToTypeCode - // Check the type if that is all that is required. - if (sipIsErr == NULL) - { - if (!PyList_Check(sipPy)) - return 0; - } - - // Check the type if that is all that is required. - if (sipIsErr == NULL) - { - if (!PyList_Check(sipPy)) - return 0; - - for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) - if (!sipCanConvertToType(PyList_GET_ITEM (sipPy, i), sipType_TYPE, SIP_NOT_NONE)) - return 0; - } - - QSet *qs = new QSet; - - for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) - { - int state; - - TYPE *t = reinterpret_cast(sipConvertToType(PyList_GET_ITEM (l, i), sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); - - if (*sipIsErr) - { - sipReleaseType(t, sipType_TYPE, state); - - delete qs; - return 0; - } - - *qs << t; - - sipReleaseType(t, sipType_TYPE, state); - } - - *sipCppPtr = qs; - - return sipGetState(sipTransferObj); -%End -}; - - template %MappedType QSet { @ 1.1 log @Make build with py-sip-4.10, and depend on it. Patch from gentoo bug #301106 via drochner. @ text @d3 2 d7 1 a7 139 @@@@ -215,6 +215,122 @@@@ template %End }; +template +%MappedType QMap +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Create the dictionary. + PyObject *d = PyDict_New(); + + if (!d) + return NULL; + + // Set the dictionary elements. + QMap::const_iterator i = sipCpp->constBegin(); + + while (i != sipCpp->constEnd()) + { + TYPE1 *t1 = new TYPE1(i.key()); + int t2 = i.value(); + + PyObject *t1obj = sipConvertFromNewType(t1, sipType_TYPE1, sipTransferObj); +#if PY_MAJOR_VERSION >= 3 + PyObject *t2obj = PyLong_FromLong(t2); +#else + PyObject *t2obj = PyInt_FromLong(t2); +#endif + + if (t1obj == NULL || t2obj == NULL || PyDict_SetItem(d, t1obj, t2obj) < 0) + { + Py_DECREF(d); + + if (t1obj) { + Py_DECREF(t1obj); + } else { + delete t1; + } + + if (t2obj) { + Py_DECREF(t2obj); + } + return NULL; + } + + Py_DECREF(t1obj); + Py_DECREF(t2obj); + + ++i; + } + + return d; +%End + +%ConvertToTypeCode + PyObject *t1obj; + PyObject *t2obj; + SIP_SSIZE_T i = 0; + + // Check the type if that is all that is required. + if (sipIsErr == NULL) + { + if (!PyDict_Check(sipPy)) + return 0; + + while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) + { + if (!sipCanConvertToType(t1obj, sipType_TYPE1, SIP_NOT_NONE)) + return 0; + +#if PY_MAJOR_VERSION >= 3 + if (!PyNumber_Check(t2obj)) +#else + if (!PyInt_Check(t2obj)) +#endif + return 0; + } + + return 1; + } + + QMap *qm = new QMap; + + i = 0; + while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) + { + int state1; + + TYPE1 *t1 = reinterpret_cast(sipConvertToType(t1obj, sipType_TYPE1, sipTransferObj, SIP_NOT_NONE, &state1, sipIsErr)); + +#if PY_MAJOR_VERSION >= 3 + int t2 = PyLong_AsLong (t2obj); +#else + int t2 = PyInt_AS_LONG (t2obj); +#endif + + if (*sipIsErr) + { + sipReleaseType(t1, sipType_TYPE1, state1); + + delete qm; + return 0; + } + + qm->insert(*t1, t2); + + sipReleaseType(t1, sipType_TYPE1, state1); + } + + *sipCppPtr = qm; + + return sipGetState(sipTransferObj); +%End +}; + + class KShared; template @@@@ -239,10 +355,10 @@@@ template %ConvertToTypeCode // Convert a Python instance to a Ptr on the heap. - - if (sipIsErr == NULL) - return PyInstance_Check(sipPy); - + if (sipIsErr == NULL) { + return 1; + } + int iserr = 0; TYPE *cpp = (TYPE *)sipForceConvertToType(sipPy, sipType_TYPE, NULL, 0, NULL, &iserr); @@@@ -466,91 +582,6 @@@@ template a98 153 @@@@ -716,12 +747,14 @@@@ template return NULL; // Set the list elements. - for (int i = 0; i < sipCpp->size(); ++i) - { + for (int i = 0; i < sipCpp->size(); ++i) { PyObject *pobj; - if ((pobj = PyInt_FromLong(sipCpp->value(i))) == NULL) - { +#if PY_MAJOR_VERSION >= 3 + if ((pobj = PyLong_FromLong(sipCpp->value(i))) == NULL) { +#else + if ((pobj = PyInt_FromLong(sipCpp->value(i))) == NULL) { +#endif Py_DECREF(l); return NULL; @@@@ -740,9 +773,14 @@@@ template QList *ql = new QList; - for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { +#if PY_MAJOR_VERSION >= 3 + ql->append(PyLong_AsLong(PyList_GET_ITEM(sipPy, i))); +#else ql->append(PyInt_AsLong(PyList_GET_ITEM(sipPy, i))); - +#endif + } + *sipCppPtr = ql; return sipGetState(sipTransferObj); @@@@ -824,3 +862,116 @@@@ template %End }; +%MappedType QHash +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Create the dictionary. + PyObject *d = PyDict_New(); + + if (!d) + return NULL; + + // Set the dictionary elements. + QHash::const_iterator i = sipCpp->constBegin(); + + while (i != sipCpp->constEnd()) + { + int t1 = i.key(); + int t2 = i.value(); + +#if PY_MAJOR_VERSION >= 3 + PyObject *t1obj = PyLong_FromLong ((long)t1); + PyObject *t2obj = PyLong_FromLong ((long)t2); +#else + PyObject *t1obj = PyInt_FromLong ((long)t1); + PyObject *t2obj = PyInt_FromLong ((long)t2); +#endif + + if (PyDict_SetItem(d, t1obj, t2obj) < 0) + { + Py_DECREF(d); + + if (t1obj) + Py_DECREF(t1obj); + + if (t2obj) + Py_DECREF(t2obj); + + return NULL; + } + + Py_DECREF(t1obj); + Py_DECREF(t2obj); + + ++i; + } + + return d; +%End + +%ConvertToTypeCode + PyObject *t1obj, *t2obj; + SIP_SSIZE_T i = 0; + + // Check the type if that is all that is required. + if (sipIsErr == NULL) + { + if (!PyDict_Check(sipPy)) + return 0; + + while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) + { +#if PY_MAJOR_VERSION >= 3 + if (!PyNumber_Check (t1obj)) +#else + if (!PyInt_Check (t1obj)) +#endif + return 0; + +#if PY_MAJOR_VERSION >= 3 + if (!PyNumber_Check (t2obj)) +#else + if (!PyInt_Check (t2obj)) +#endif + return 0; + } + + return 1; + } + + QHash *qm = new QHash; + + while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) + { + int state2; + +#if PY_MAJOR_VERSION >= 3 + int t1 = PyLong_AsLong (t1obj); +#else + int t1 = PyInt_AS_LONG (t1obj); +#endif + +#if PY_MAJOR_VERSION >= 3 + int t2 = PyLong_AsLong (t2obj); +#else + int t2 = PyInt_AS_LONG (t2obj); +#endif + + if (*sipIsErr) + { + delete qm; + return 0; + } + + qm->insert(t1, t2); + } + + *sipCppPtr = qm; + + return sipGetState(sipTransferObj); +%End +}; @