[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Re: C Callbacks
From: |
Udo Schneider |
Subject: |
[Help-smalltalk] Re: C Callbacks |
Date: |
Tue, 20 May 2008 13:02:53 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (Macintosh/20080421) |
Paolo,
No, but callbacks are available without using libffi. You use functions
in the vm_proxy, see the GLUT bindings in the opengl branch of my
repository for a simple example.
Nice examples! However as far as I see the callbacks are "static". The
callback functions are in C and in turn call Smalltalk methods via
vmproxy. What I was thinking of is defining a callback by providing a
method/block with appropriate arg and return types in Smalltalk
dynamically (something similar to ExternalCallbacks in Dolphin Smalltalk
http://www.object-arts.com/docs/externalcallbackobjects.htm)
E.g.
callback := ExternalCallback
block: [ :lplf :lptm :dwType :lpData | operation value: lplf
value: lptm value: dwType ]
argumentTypes: 'LOGFONT* lpvoid dword dword'.
Due to the fact that I need to create callbacks dynamically based on
third party data I get (dynamically as well :-( ) I think there is no
way around libffi. Maybe I can reuse the existing parameter stuff around
#cCall: for inbound calls.
Thanks,
Udo