[Pyobjc-dev] Fwd: Calling Objective-C++ code
Brought to you by:
ronaldoussoren
From: Douglas R. <jo...@vt...> - 2014-07-22 05:15:12
|
Hello. I'd like to request a little help. I'm trying to taking some Objective-C++ code and call it from Python. I seem to be stuck and could use a little help getting out of the proverbial mud. I'm new to ObjC and am trying to figure out how to get a feature working. There's some ObjC++ code that's already written and can probably be used after making a few mods. The ObjC++ code basically uses C++-style headers, although one includes a "signals:" section (i.e., it's not pure C++). The underlying .mm code is your standard C++/ObjC mix. My initial thought was that I could use PyObjC to call the ObjC++ code from Python. The more I look into it, though, the more I think PyObjC may not be able to create a bridge as-is; pure ObjC code seems to be necessary. I don't think SWIG or SIP are able to handle ObjC++ either. This leads me to believe that I'll have to rewrite the ObjC++ code in pure ObjC and then call it from PyObjC (or maybe, if it's possible, just rewrite the header files). I have a couple of questions before I go much further. -Is my understanding correct? In other words, is PyObjC unable to handle to handle such headers? (See https://github.com/bitcoin/bitcoin/blob/0.9.2/src/qt/macdockiconhandler.h for one such header I'm trying to use.) -Is it possible to mix-and-match ObjC header files with C++-style definitions in the implementation (i.e., can I rewrite only the header files)? My gut says this isn't possible. -If I'm incorrect, and PyObjC can call this code, are there any examples or douments online? I think I have a good idea of how to call the ObjC code, just not any potential ObjC++ code. Thanks in advance for any help you can give! Doug |