Module ViewManager :: Class ViewManager
[hide private]
[frames] | no frames]

Class ViewManager

source code

object --+
         |
        ViewManager

Stores a root accessible representing the active view when an event occurs indicating that the view may have changed. Two view roots must be tracked by this object. The first, the raw view, is needed by Adapters which will handle raw view change events. The second, the AccessEngine view, is needed by the rest of the system when processing AEEvents.

Instance Methods [hide private]
 
__init__(self, ae)
Initializes instance variables that will store a reference to the EventManager and active view to None.
source code
 
init(self, event_man, tier_man, **kwargs)
Stores a reference to the EventManager.
source code
 
close(self)
Does nothing.
source code
 
initViews(self)
Walks through the top level applications on the first desktop.
source code
 
setEventInterest(self, kind, wants)
Sets or unsets an interest in a particular kind of AEEvent.
source code
boolean
getRawActive(self)
Gets the whether some view is active or not.
source code
 
setRawActive(self, val)
Sets the whether some view is active or not.
source code
POR
getRawView(self)
Gets the root POR of the active view according to the raw event stream.
source code
boolean
setRawView(self, accessible)
Stores the root POR of the active view according to the raw event stream.
source code
POR
getAEView(self)
Gets the root POR of the active view according to the AEEvent stream.
source code
 
setAEView(self, por)
Stores the root POR of the active view according to the AEEvent stream.
source code
boolean
onIterateApps(self)
Collects all application names and IDs and gives them to the TierManager so it can free any Tiers that are no longer associated with running applications.
source code
 
onRawEvent(self, event)
Based on a raw pyLinAcc.Event.Event posts AEEvents to the active Tier through the EventManager.
source code
 
onRawViewEvent(self, event)
Creates a AEEvent.ViewChange event in response to a window activation or deactivation.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
POR ae_view
Root POR represnting the active view according to the AEEvent stream.
EventManager event_manager
Reference to the EventManager
boolean raw_active
Is there an raw active view?
pyLinAcc.Accessible raw_view
Root accessible representing the active view according to the raw event stream.
TierManager tier_manager
Reference to the TierManager for clearing dead Tier objects on a set interval
dictionary wanted_events
Lookup table for what AEEvents are desired by any Task in any Perk in all Tiers.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ae)
(Constructor)

source code 

Initializes instance variables that will store a reference to the EventManager and active view to None.

Parameters:
Overrides: object.__init__

init(self, event_man, tier_man, **kwargs)

source code 

Stores a reference to the EventManager. Registers with the EventManager using the EventManager.EventManager.addClient to receive raw events related to the active view. Also registers for raw events that may indicate that this ViewManager needs to manage a new view. Called by AccessEngine at startup.

Parameters:

initViews(self)

source code 

Walks through the top level applications on the first desktop. Calls TierManager.TierManager.createTier for application encountered. If the TierManager determines that an app has at least one Perk written for that application, creates a Tier for the application and loads all of its Perks. If the Tier is created, this method sends AEEvent.ViewChange messages to the Tier with a flag of AEConstants.Event.EVENT_VIEW_STARTUP such that Perks in the Tier may initialize themselves and begin any desired background processes.

setEventInterest(self, kind, wants)

source code 

Sets or unsets an interest in a particular kind of AEEvent. This information is used to register or unregister for raw events on-demand as an optimization.

Parameters:
  • kind (AEEvent class) - Indicates the type of AEEvent some part of the system wants to be able to process
  • wants (boolean) - Does the system want to process the given kind of AEEvent?

getRawActive(self)

source code 

Gets the whether some view is active or not.

Returns: boolean
Value of raw_active

setRawActive(self, val)

source code 

Sets the whether some view is active or not.

Parameters:

getRawView(self)

source code 

Gets the root POR of the active view according to the raw event stream. This is the view known to Adapters.

Returns: POR
Root POR of the raw active view

See Also: setRawView

setRawView(self, accessible)

source code 

Stores the root POR of the active view according to the raw event stream. This is the view known to Adapters.

Parameters:
  • accessible (pyLinAcc.Accessible) - Event source that triggered the change of view. Usually a top level window or panel.
Returns: boolean
Was a new view root set or not?

See Also: getRawView

getAEView(self)

source code 

Gets the root POR of the active view according to the AEEvent stream. This is the view known to Perks.

Returns: POR
Root POR of the active AccessEngine view

See Also: setAEView

setAEView(self, por)

source code 

Stores the root POR of the active view according to the AEEvent stream. This is the view known to Adapters.

Parameters:
  • por (POR) - New root POR of the active AccessEngine view. May be set to None if there is no active view.

See Also: getAEView

onIterateApps(self)

source code 

Collects all application names and IDs and gives them to the TierManager so it can free any Tiers that are no longer associated with running applications.

Returns: boolean
True to continue receiving notifications

onRawEvent(self, event)

source code 

Based on a raw pyLinAcc.Event.Event posts AEEvents to the active Tier through the EventManager.

Parameters:

onRawViewEvent(self, event)

source code 

Creates a AEEvent.ViewChange event in response to a window activation or deactivation. Also responds to create or destroy events from floating windows. Called in response to any of the raw events returned by AEInterfaces.IEventHandler.getAEViewEvents and registered with the EventManager in the ViewManager.init method when this object was created.

Parameters:

Instance Variable Details [hide private]

wanted_events

Lookup table for what AEEvents are desired by any Task in any Perk in all Tiers. Used to optimize event dispatch and processing. Unwanted events are ignored.
Type:
dictionary