OpenGLContext.events.eventhandlermixin
index
/home/mcfletch/pylive/OpenGLContext/events/eventhandlermixin.py

Mix in functionality for Context classes needing event support

 
Modules
       
Queue
logging

 
Classes
       
object
EventHandlerMixin

 
class EventHandlerMixin(object)
    This class provides mix in functionality for contexts
needing event support.
 
Contexts wishing to support particular types of event will
store pointers to each of the appropriate manager classes in
their EventManagerClasses attribute before calling the
EventHandlerMixin.initializeEventManagers() method. The format
for EventManagerClasses is [ ("eventType", managerClass), ... ].
 
Clients wishing to register particular event handlers will use
addEventHandler method to register each event handler.
 
Clients wishing to capture all events of a particular type for
a limited duration will use the captureEvents method, passing
in a pointer to an event manager which will handle the updates.
 
The event handler mix in provides a client API for the registration
and handling of events.
 
  Methods defined here:
DoEventCascade(self)
Do pre-rendering event cascade
 
Returns the total number of events generated by
timesensors and/or processed from the event cascade queue
ProcessEvent(self, event)
Primary dispatch point for events.
 
ProcessEvent uses the event's type attribute to determine the
appropriate manager for processing, then dispatches to that manager's
ProcessEvent method.
addEventHandler(self, eventType, *arguments, **namedarguments)
Add a new event handler function for the given event type
 
This is the primary client API for dealing with the event system.
Each event class will define a particular set of data values
required to form the routing key for the event.  Each event handler
class will define a registerCallback function which converts
its arguments into a matching key.
 
This function merely determines the appropriate handler then
dispatches to the handler's registerCallback method (without the
eventType argument).
 
See: mouseevents, keyboardevents
addEventManager(self, eventType, manager=None)
Add an event manager to the internal table of managers.
 
The return value is the previous manager or None if there was
no previous manager.
captureEvents(self, eventType, manager=None)
Temporarily capture events of a particular type.
 
This temporarily replaces a particular manager within the
dispatch set with provided manager.  This will normally be
used to create "modal" interfaces such as active drag
functions (where the interface is in a different "interaction
mode", so that actions have different meaning than in the
"default mode").
 
Passing None as the manager will restore the previous manager
to functioning.
 
Note: this function does not perform a "system capture"
of input (that is, mouse movements are only available if they
occur over the context's window and that window has focus).
 
Note: for capturing mouse input, you will likely want to
capture both movement and button events, it should be possible
to define a single handler to deal with both event types,
and pass that handler twice, once for each event type.
getEventManager(self, eventType)
Retrieve an event manager from the internal table of managers
 
Returns the appropriate manager, or None if there was no
manager registered for the given event type.
getTimeManager(self)
Get the time-event manager for this context
initializeEventManagers(self)
Initialize the event manager classes for this context.
 
This implementation iterates over self.EventManagerClasses
(a list of (eventType, managerClass) values) and calls
addEventManager for each item.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
EventManagerClasses = []
TimeManagerClass = None

 
Data
        __file__ = '/home/mcfletch/pylive/OpenGLContext/events/eventhandlermixin.pyc'
__name__ = 'OpenGLContext.events.eventhandlermixin'
__package__ = 'OpenGLContext.events'
log = <logging.Logger object>