Rendezvous, event loops, and why I need SDK docs

MisterX x at monsieurx.com
Wed Nov 12 00:44:38 EST 2003


The xcmd examples (the only I've found from MC/RR) is divided in different
parts. You have to find the externals "tutorial" stack buried inside
the MCTools Help Menu under Tutorial! 

There you have the principal functions of the externals explained.

of which the call back test for example

# call the external routine, passing the names/nums/ids of the objects
# that the external should work on as arguments.
on mouseUp
  global MCExternalTest
  local tVar, x
  put 2 into x
  put "x + 1" into tVar
  callbacktests "SendCardMessage", "SendMCMessage", "MCExternalTest", \
      "GetFieldByName", \
      the number of field "GetFieldByNum", \
      the id of field "GetFieldById", \
      "SetFieldByName", \
      the number of field "SetFieldByNum", \
      the id of field "SetFieldById",\
      "tVar"
  put the result into field "results"
  put "tVar set to" && tVar
end mouseUp

In the xcmd, you have the normal c/c++ stuff and the xcmd/xfcn part.
Try to follow the name between the "external" call in the beginning
of the c code (there's a comment about it) and the "respective" functions
for that external call. They are bunched together before the functions! 

This is a nice example of "more than one" external in a dll. Im not sure
how it would work for Mac's XCMD/XFCN resource name=function name.
(Lower case resource names are for PPC coded resources in case you wonder)

Facts:
XCMD = a void action (no return info - normally)
XFCN = a function with a return value

XCMD's model is based on Pascal and the old HC external glue so pointer 
limitations and limited variables are possible - also depends on OS...

To compile
On Windows, Visual C++ works great. I havent tried other compilers. 
On the mac the best was compileIt or Metrowerks.

To use
Make sure your stack has the external assigned to it!
MC: Stack properties -> Components -> Externals
RR: Stack props -> External references
Save stack
Restart the stack (make sure it's purged) or restart MC/RR

Then you start the crash/test dummy loop...
Working with externals means you work on a clean version of MC/RR not your
std environment because IT WILL CRASH!!!

Save often, pick up a good book on C. That C code is hellish! Doing the
advanced stuff like the Life game or the imagine stuff on the tutorial is
impressive! But should be easy with practice and time.

Ken has some good stuff about it...
http://www.rpi.edu/~simonk/technical.html

Let me know if you can't find the tutorial stack...
Anyone seen it in RR?

cheers
Xavier



> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Alex Rice
> Sent: Tuesday, November 11, 2003 22:43
> To: How to use Revolution
> Subject: Re: Rendezvous, event loops, and why I need SDK docs
> 
> 
> 
> On Nov 11, 2003, at 2:14 PM, tuviah snyder wrote:
> >>
> > Embedded Revolution supports access to the main event loop. The idea 
> > behind embedded Revolution is you would link your external code with 
> > librev and compile a custom engine. The advantages are
> >
> > 1) no external overhead on Linux.
> > 2) Single file executable
> > 3) Access to event loops.
> 
> That's good to know. What is the availability/licensing of Embedded 
> Revolution?
> 
> > I don't see why we can't support access to the event loop for 
> > externals as well..the external would need to register the callback 
> > however to avoid any performance problems.
> 
> Can you describe the purpose of X_main_loop(), 
> X_set_pre_xevent_handler(), and X_set_post_xevent_handler() in 
> XCmdGlue.c? Is that what you are referring to in item 3) above, or is 
> it something else?
> 
> >> SDK docs would be good, but I fear they would only confirm we have a
> >> lot of work to do to do any useful externals.
> > We are working on it.  Tim Monroe just wrote an excellent article on  
> > developing QT externals with Rev, and we plan to extend on some of 
> > that for our own docs
> 
> Is RR providing externals API documentation in addition to a tutorial? 
> Not knowing the purpose and usage of most of these functions is the 
> main problem for me.
> 
> Alex Rice <alex at mindlube.com> | Mindlube Software | 
> <http://mindlube.com>
> 
> what a waste of thumbs that are opposable
> to make machines that are disposable  -Ani DiFranco
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 


More information about the use-livecode mailing list