summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-04-10 07:41:09 +0000
committerJay Freeman <saurik@saurik.com>2008-04-10 07:41:09 +0000
commit0ac911e83177afaa52ec6d422c0b13dc8655817e (patch)
treec88b93ab525fd32468a9a1f5b40e7e8add9e37fe /data
parenta0063d08dcc6dad1a884480bb952531460a1019e (diff)
Ported UICaboodle.py to iPhoneOS 2.0.
git-svn-id: http://svn.telesphoreo.org/trunk@209 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data')
-rw-r--r--data/uicaboodle.py/make.sh2
-rw-r--r--data/uicaboodle.py/uicaboodle.m11
2 files changed, 11 insertions, 2 deletions
diff --git a/data/uicaboodle.py/make.sh b/data/uicaboodle.py/make.sh
index 0717ab445..2a0f85dd1 100644
--- a/data/uicaboodle.py/make.sh
+++ b/data/uicaboodle.py/make.sh
@@ -1,3 +1,3 @@
-${PKG_TARG}-gcc -o _uicaboodle.dylib "${PKG_DATA}/uicaboodle.m" -I"${PKG_ROOT}"/usr/include/python2.5 -I "$(PKG_WORK_ pyobjc)"/*/pyobjc-core/Modules/objc -lpython2.5 -framework UIKit -dynamiclib -framework Foundation
+${PKG_TARG}-gcc -o _uicaboodle.dylib "${PKG_DATA}/uicaboodle.m" -I"$(PKG_DEST_ python)"/usr/include/python2.5 -I "$(PKG_WORK_ pyobjc)"/*/pyobjc-core/Modules/objc -lpython2.5 -framework UIKit -dynamiclib -framework Foundation -lobjc -framework CoreFoundation
pkg: mkdir -p /usr/lib/python2.5/lib-dynload
pkg: cp -a _uicaboodle.dylib /usr/lib/python2.5/lib-dynload
diff --git a/data/uicaboodle.py/uicaboodle.m b/data/uicaboodle.py/uicaboodle.m
index 6cd372868..aa219ec52 100644
--- a/data/uicaboodle.py/uicaboodle.m
+++ b/data/uicaboodle.py/uicaboodle.m
@@ -26,6 +26,7 @@ static PyObject* objc_UIApplicationMain(
_assert(PyObjC_API != NULL);
_assert(args != NULL);
+ /* XXX: correctly parse __OBJC2__ condition */
if (!PyArg_ParseTuple(args, "OO", &arga, &_class)) {
PyErr_SetString(PyExc_TypeError, "Invalid Arguments");
return NULL;
@@ -62,7 +63,11 @@ static PyObject* objc_UIApplicationMain(
}
PyObjC_DURING
+#ifdef __OBJC2__
+ res = UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String:class_getName(PyObjC_API->cls_get_class(_class))]);
+#else
res = UIApplicationMain(argc, argv, PyObjC_API->cls_get_class(_class));
+#endif
PyObjC_HANDLER
PyObjCErr_FromObjC(localException);
PyObjC_ENDHANDLER
@@ -81,7 +86,11 @@ static PyMethodDef mod_methods[] = {{
"UIApplicationMain",
/*(PyCFunction)*/ objc_UIApplicationMain,
METH_VARARGS|METH_KEYWORDS,
- "int UIApplicationMain(int argc, const char *argv[], Class _class);"
+#ifdef __OBJC2__
+ "int UIApplicationMain(int argc, char *argv[], NSString *principalClassName, NSString *delegateClassName);"
+#else
+ "int UIApplicationMain(int argc, char *argv[], Class _class);"
+#endif
}, {
NULL, NULL, 0, NULL
}};