Steven Truppe wrote:
> 1) My problem here is that i don't understand CS_EVENTHANDLER_PHASE_3D()
> because i've no idea about the string i should use in my implementation.
> I found no other string in the walktest sources that's
> "crystalspace.walktest.frame.3d") nor does i found parts of this string
> somewhere else (for example "frame.3d"). I know this is to tell when the
> event handler is called, so it's very important for my project. I'm
> reading the API references the last few days now but found nothing about
> this, help !
>
> My project where i've used the simple1 sources to start with, is using
> this for the csApplicationFramwork class:
> CS_EVENTHANDLER_PHASE_LOGIC("application.rockenc")
>
> So here i have another string... "application.myappname", i'm confused
> about the strings, and i found no description, nor a list with the
> available strings... again - help!
>
AFAIK, those strings are just names used to identify the event handler.
They could be anything, although it is sensible to follow some sort of
naming convention. What matters is which particular
CS_EVENTHANDLER_PHASE_ macro you use; that is what specifies the point
at which the handler is called.
BTW, I don't think walktest is really considered a good example for
learning good CS practices.
> 2) The two macros
>
> CS_EVENTHANDLER_NAMES
> <mailbox:///C%7C/Users/stuv/AppData/Roaming/Thunderbird/Profiles/4mwmvhjl.default/Mail/mail5.world4you.com/Sent?number=536092&part=1.2&filename=group__event__handling.html>
> and
> CS_EVENTHANDLER_NIL_CONSTRAINTS
> <mailbox:///C%7C/Users/stuv/AppData/Roaming/Thunderbird/Profiles/4mwmvhjl.default/Mail/mail5.world4you.com/Sent?number=536092&part=1.2&filename=group__event__handling.html>
>
> I know they are used to provide default stuff for the evenhandler
> implementation, but i also don't know about the string i should use for
> CS_EVENTHANDLER_NAMES("...")
>
Don't use CS_EVENTHANDLER_NAMES or CS_EVENTHANDLER_NIL_CONSTRAINTS in
combination with a CS_EVENTHANDLER_PHASE_ macro. The PHASE macros define
the name and constraints themselves. Essentially they are convenience
macros that do NAMES and CONSTRAINTS for you, and define common
GenericPrec and GenericSucc method implementations so you don't have to.
> 3) I still have no idea what the macro _CS_DECLARE_EVENT_SHORTCUTS _ is
> about.
>
If you have CS_DECLARE_EVENT_SHORTCUTS in your class definition, and
CS_INITIALIZE_EVENT_SHORTCUTS(object_reg) in your class's constructor,
then you get class members of type csEventID named SystemOpen,
SystemClose, Frame, KeyboardEvent, MouseEvent and JoystickEvent.
Convenience IDs so you don't have to store an iObjectRegistry* in the
class to be able to get at the IDs during the rest of the lifetime of
the object. If the handler is only subscribed to one type of event then
I don't think there's much point.
http://www.crystalspace3d.org/docs/online/manual/Event-System.html
http://www.crystalspace3d.org/docs/online/api/csutil_2eventhandlers_8h-source.html
http://www.crystalspace3d.org/docs/online/api/csutil_2eventnames_8h-source.html
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe:
mailto:[email protected]?subject=unsubscribe