diff options
author | Timothy Pearson <[email protected]> | 2013-01-27 00:59:37 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2013-01-27 00:59:37 -0600 |
commit | f050f7c84cccf297921968acd454e6a462e30857 (patch) | |
tree | d2dbec79b7ecb12d9dd28b20e491a454b18ecb52 /sip/tdecore/tdeconfigdata.sip | |
parent | 6b87edd9b7b08ca0030e5633e8a9653576f73a32 (diff) | |
download | pytde-f050f7c84cccf297921968acd454e6a462e30857.tar.gz pytde-f050f7c84cccf297921968acd454e6a462e30857.zip |
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'sip/tdecore/tdeconfigdata.sip')
-rw-r--r-- | sip/tdecore/tdeconfigdata.sip | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/sip/tdecore/tdeconfigdata.sip b/sip/tdecore/tdeconfigdata.sip new file mode 100644 index 0000000..6c20ab9 --- /dev/null +++ b/sip/tdecore/tdeconfigdata.sip @@ -0,0 +1,172 @@ +// +// Copyright 2006 Jim Bublitz <[email protected]> +// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson +// may also apply + + +// Generated by preSip +// module tdecore version KDE 3.5.3 + + +// This software is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of +// the License, or (at your option) any later version. +// +// This software is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public +// License along with this library; see the file COPYING. +// If not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +class KEntry +{ +%TypeHeaderCode +#include <tdeconfigdata.h> +%End + + +public: + KEntry (); + TQCString mValue; + bool bDirty; + bool bNLS; + bool bGlobal; + bool bImmutable; + bool bDeleted; + +%If ( KDE_3_1_0 - ) + bool bExpand; +%End + + +}; // class KEntry + + +class KEntryKey +{ +%TypeHeaderCode +#include <tdeconfigdata.h> +%End + + +public: + KEntryKey (const TQCString& = TQCString ("" ), const TQCString& = TQCString ("" )); + TQCString mGroup; + TQCString mKey; + bool bLocal; + bool bDefault; + const char* c_key; + +}; // class KEntryKey + +//ig typedef TQMap<KEntryKey,KEntry>::Iterator KEntryMapIterator; +//ig typedef TQMap<KEntryKey,KEntry>::ConstIterator KEntryMapConstIterator; +//force +KEntryMap testKEntryMap (SIP_PYOBJECT) [KEntryMap (KEntryMap)]; +%MethodCode +//takes dict | (KEntryMap) +//returns (TQMap<KEntryKey,KEntry) + + int isErr = 0; + KEntryMap *map = (KEntryMap *)sipForceConvertToType(a0, sipType_KEntryMap, NULL, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &isErr); + + if (isErr) + sipRes = NULL; + else + sipRes = map; +%End + +//end + + +%MappedType KEntryMap +//converts a Python dict of KEntryKey:KEntry +{ +%TypeHeaderCode +#include <tqmap.h> +#include <tdeconfigdata.h> +%End + +%ConvertFromTypeCode + // Convert to a Python dict + + if (!sipCpp) + return PyDict_New(); + + PyObject *dict; + + // Create the dictionary. + + if ((dict = PyDict_New()) == NULL) + return NULL; + + // Get it. + + const KEntryMap cppmap = *sipCpp; + KEntryMap::ConstIterator it; + + for (it = cppmap.begin (); it != cppmap.end (); ++it) + { + KEntryKey acpp = it.key (); + KEntry bcpp = it.data (); + PyObject *ainst; + PyObject *binst = NULL; + if (((ainst = sipConvertFromNewType(new KEntryKey(acpp), sipType_KEntryKey, NULL)) == NULL) + || ((binst = sipConvertFromNewType(new KEntry(bcpp), sipType_KEntry, NULL)) == NULL) + || (PyDict_SetItem (dict, ainst, binst) < 0)) + { + Py_XDECREF (ainst); + Py_XDECREF (binst); + Py_DECREF (dict); + return NULL; + } + } + + return dict; +%End + + +%ConvertToTypeCode + // Convert a Python dictionary to a TQMap on the heap. + + if (sipIsErr == NULL) + return PyDict_Check(sipPy); + + + KEntryMap *cppmap = new KEntryMap; + + PyObject *aelem, *belem; + SIP_SSIZE_T pos = 0; + KEntryKey *acpp; + KEntry *bcpp; + + while (PyDict_Next(sipPy, &pos, &aelem, &belem)) + { + int iserr = 0; + + acpp = (KEntryKey *)sipForceConvertToType(aelem, sipType_KEntryKey, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr); + bcpp = (KEntry *)sipForceConvertToType(belem, sipType_KEntry, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr); + + if (iserr) + { + *sipIsErr = 1; + delete cppmap; + return 0; + } + + cppmap->insert (*acpp, *bcpp); + } + + *sipCppPtr = cppmap; + + return 1; +%End +}; + + |