gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about RunLoop, joystick support and so on


From: Xavier Glattard
Subject: Re: about RunLoop, joystick support and so on
Date: Fri, 9 Feb 2007 17:55:04 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Richard Frith-Macdonald <rfm <at> gnu.org> writes:

> 
> 
> On 8 Feb 2007, at 11:06, Xavier Glattard wrote:
> 
> > Hi all
> >
> > I try to understand NSRunLoop and event management.
> >
> > I have found the following text in NSRunLoop.h
> > It's about GSRunLoopWatcher
> >
> (...)
> >
> > What is the status of GSRunLoopWatcher ?
> 
> Current, as described in the text you quote which warns that Apple  
> appear to be close to providing a general API for the task (even  
> though it's not clear yet) and we will probably adopt it.
> 
> > Why is it not use in backend ?
> 
> It is used in the backend ... see back/Source/win32/WIN32Server.m  
> which handles the received events.
> 
> > (under win32, PeekMessage/DispatchMessage are called firth by the  
> > DisplayServer
> > then by GSRunLoopCtxt)
> 
> If you look carefully at the GSRunLoopCtxt code, you will see that  
> DispatchMessage is called only for unhandled messages (ie those not  
> passed on to a GSRunLoopWatcher).
> I don't know why the -callback: method is also called ... I would  
> have thought that it was unnecessary, but perhaps it's a performance  
> tweak. ie, after receiving an event via the runloop mechanism the  
> code then removes any other events from the windows queue directly.   
> Maybe someone else can better answer this.
> 
> > Is there an other mechanism on the way ?
> 
> Not yet.
> 
> > If i want to add joystick support to GNUstep, which interface do i
> > have to use ?
> 
> I think that depends on how the operating system presents the  
> joystick interface.  If it appears as a file from which you read  
> data, then it's probably best to open that file as an NSInputStream  
> and use that API, otherwise using GSRunLoopWatcher is the way to go.
> You can look at the code of the NSStream subclasses to see how then  
> use GSRunLoopWatcher internally.
> 

phew !

My brain boiled three times (and fried twice) before 
i understand anything...
And many pieces of code are still quite obscure to me.
I would not be a very good compiler.
But i found out what you talk about.

Where you see a performance tweak I see... hum... 
In french i would said 'un sac de noeuds' ;-)
(bag of knots)
I wonder if the weird behaviors of my opengl test couldn't
be explained by this much more weird code.

About joystick support :
NSStream seems to be what i need :-)
Does it work ?
Do you plan to use streams instead of watchers ?
Is someone working on that ? Need help ?

Many thanks

Xavier






reply via email to

[Prev in Thread] Current Thread [Next in Thread]