Some XRtn questions.

External developers... This forum's for you!

Some XRtn questions.

Postby Dave_Higgins » Sat Oct 16, 2010 9:29 pm

Most of the events that an XRtn can trap for are pretty obvious, but I can't find any reference to what xcontentEvent is about.

Also, I can't find any more reference to waitnextevent than
Code: Select all
xnullEvent,    // any time waitnextevent returns false
xuniversalEvent, // any time waitnextevent returns true

I assume it defaults to false seeing that xnullEvent can be handled without mentioning waitnextevent.
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: Some XRtn questions.

Postby codegreen » Sat Oct 16, 2010 10:11 pm

Dave Higgins wrote:Most of the events that an XRtn can trap for are pretty obvious, but I can't find any reference to what xcontentEvent is about.

It's sent whenever the user clicks in the content area of an active window.

Also, I can't find any more reference to waitnextevent

WaitNextEvent is a Carbon Toolbox routine that retrieves events one at a time from the event manager; SC calls it each time around its main event loop. WNE returns false if the event is a null event or if it has intercepted the event (e.g., Cmd-Shift-number keystrokes) or true otherwise.

-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm

Re: Some XRtn questions.

Postby Dave_Higgins » Sat Oct 16, 2010 11:14 pm

Ahhh Poo... I meant to put this thread in the Xcode forum. Scott... Can you move it?
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: Some XRtn questions.

Postby Dave_Higgins » Sun Oct 17, 2010 12:08 am

mark wrote:It's sent whenever the user clicks in the content area of an active window.

I see... Would this be sent no matter what was clicked (button, grc, etc...), or only in a condition where SC would send mouseDown/mouseUp directly to the card (or bg if editBG is true, I guess (empty card/bg/wd area)) if we didn't trap it?

WaitNextEvent is a Carbon Toolbox routine that retrieves events one at a time from the event manager; SC calls it each time around its main event loop. WNE returns false if the event is a null event or if it has intercepted the event (e.g., Cmd-Shift-number keystrokes) or true otherwise.

Okayyyyy... I follow the null event. That would be like an open idle message working it's way through and you're free to do whatever you want while no event is being handled (as in Timers).

As for your e.g... Let's say a user does a Cmd-Shift-3 for a screenShot... Does this mean, then, that we would receive the xnullEvent event_event, meaning that the OS has pulled rank (created the screenShot) and is now telling you that you're not allowed to use this event, but it'll pass you a null (/idle) event?

This leads me to wonder under what condition we would then get a xuniversalEvent... Maybe anything that's not covered by the others in the list (the enum of event types), and therefore it's up to us to work out what's going on given the EventRecord?
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: Some XRtn questions.

Postby codegreen » Sun Oct 17, 2010 1:14 am

Dave Higgins wrote:
mark wrote:It's sent whenever the user clicks in the content area of an active window.

I see... Would this be sent no matter what was clicked (button, grc, etc...), or only in a condition where SC would send mouseDown/mouseUp directly to the card (or bg if editBG is true, I guess (empty card/bg/wd area)) if we didn't trap it?

I thought this was reasonably unambiguous. What part of WHENEVER did you not understand? :?

WaitNextEvent is a Carbon Toolbox routine that retrieves events one at a time from the event manager; SC calls it each time around its main event loop. WNE returns false if the event is a null event or if it has intercepted the event (e.g., Cmd-Shift-number keystrokes) or true otherwise.

Okayyyyy... I follow the null event. That would be like an open idle message working it's way through and you're free to do whatever you want while no event is being handled (as in Timers).

As for your e.g... Let's say a user does a Cmd-Shift-3 for a screenShot... Does this mean, then, that we would receive the xnullEvent event_event, meaning that the OS has pulled rank (created the screenShot) and is now telling you that you're not allowed to use this event, but it'll pass you a null (/idle) event?

This leads me to wonder under what condition we would then get a xuniversalEvent... Maybe anything that's not covered by the others in the list (the enum of event types), and therefore it's up to us to work out what's going on given the EventRecord?

WHENEVER SC processes an event in its main event loop, whether received via WNE or synthesized from a CarbonEvent, either xuniversalEvent or xnullEvent will be sent to any XRtn(s) registered for them (the only possible exception to this is if an error occurs while servicing an open Quicktime movie). If WNE returns false, you'll get xnullEvent; otherwise you'll get xuniversalEvent. FULL STOP.

-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm


Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest