Fwd: Calling Objective-C++ code

Douglas Roark <[email protected]> Tue, 22 Jul 2014 01:14:58 -0400
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <CAH=+FUh6xyPKht-EnBtP5BuWz-k+WtWaPek0tf+REm3NeBLOHw@mail.gmail.com>
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

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds