Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] How do I get at a Carbon constant?

Hi,

I was working on <https://bugs.eclipse.org/bugs/show_bug.cgi?id=263999>
today and was able to get keycode derivation (via UCKeyTranslate) working
with newer, 64-bit-friendly APIs. To implement it, however, I need a
CFStringRef that¹s defined in Carbon.framework. I was able to use
'flags=const' to generate a C function to return the value but I can¹t find
a way to build the JNI lib without adding <Carbon/Carbon.h> to os.h and
'-framework Carbon' to the PI makefile.

It looks like we could do this dynamically with
CFBundleGetDataPointerForName much like we do with
CFBundleGetFunctionPointerForName for functions. Something like
'flags=dynamic,const' to trigger a symbol lookup instead of a function
lookup. I can try modifying the JNI generator if this is worth doing; I
don't know if we'll need to do this more than once.

Also, some of the routines I used couldn't be generated from the
bridgesupport files, so I also added some 'flags=dynamic' native methods in
OS.java. I also had to add a '#define  <function>_LIB' in os_custom.h for
each of the new routines I added.  Is that the way to do it?

-- Scott

--------------- 
Scott Kovatch
Flex Engineering
Adobe Systems, Inc.
skovatch@xxxxxxxxx

I am Scott Kovatch, and I approved this message.



Back to the top