instance arbitrary objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

instance arbitrary objects

EstebanLM
 
Hi,
I want to send-back a new instance of object "Event" (created by me)
with some inst vars...
It is possible to instance arbitrary objects on a plugin?

Thanks,
Esteban


Reply | Threaded
Open this post in threaded view
|

Re: instance arbitrary objects

John M McIntosh-2
 
Are you refering to sending up event objects via the get next event  
logic?
If so for the iPhone VM have have been experimenting with this

#define EventTypeComplex 6

typedef struct sqComplexEvent
        {
                int type; /* type of event;  EventTypeComplex */
                unsigned int timeStamp; /* time stamp */
                /* the interpretation of the following fields depend on the type  of  
the event */
                int action;        /* one of ComplexEventXXX (see below) */
                usqInt objectPointer; /* used to point to object */
                int unused1; /*  */
                int unused2; /*  */
                int unused3; /*  */
                int windowIndex; /* host window structure */
        } sqComplexEvent;

#define ComplexEventTypeTouchsDown 1 /*  */
#define ComplexEventTypeTouchsUp 2 /*  */
#define ComplexEventTypeTouchsMoved 3 /*  */
#define ComplexEventTypeTouchsStationary 4 /*  */
#define ComplexEventTypeTouchsCancelled 5 /*  */


To capture touch events. Later this week I'm adding the accleration  
and GPS data.
This requires a VM change to ensure the objectPointer is not converted  
from an OOPS address to a SmallInteger.
These changes are part of the iPhone SVN tree at isqueak.org

Lastly what is missing is there is no API to allow you to place an  
event on queue, obviously we should have a call back that
let's you place a event structure onto the current event queue.

On Oct 6, 2008, at 9:22 AM, Esteban Lorenzano wrote:

> Hi,
> I want to send-back a new instance of object "Event" (created by me)  
> with some inst vars...
> It is possible to instance arbitrary objects on a plugin?
>
> Thanks,
> Esteban
>
>

Reply | Threaded
Open this post in threaded view
|

Re: instance arbitrary objects

EstebanLM
In reply to this post by EstebanLM
 
Hi, John,
I'm doing something similar to what you show, but now, in my
primitive... let's say it "primitiveGetNextEvent", I'm instantiating an
Array, putting it the plain event struct data, and returning that array
to squeak. I want to return an instance of MyEvent instead...

Cheers,
Esteban