HSystem
Description
Main container of global operations onHView and
HApplication -derived classes.
HSystem is used to keep HApplication and HView instances
globally managed. The managed classes themself calls HSystem methods,
so there is no real need to access HSystem directly from user-level code.
addApp( app, priority )
Description
Adds the structures needed for a newHApplication instance.
Called from inside the HApplication constructor.
Binds an app and gives it a unique id.
Parameters
app |
The reference to the HApplication instance object. |
|---|---|
priority |
The app priority. |
Returns
The app id.windowFocus( view )
Description
Focuses the window given and blurs the previous one.Parameters
view |
The HView instance, this is almost always a HWindow instance. |
|---|
updateZIndexOfChildren( viewId )
Updates the z-indexes of the children of the given viewId.
killApp( appId, forced )
Description
Stops polling and deletes an app instance (and its components).Parameters
appId |
The unique id of the app. |
|---|---|
forced |
(Optional) The doesn't wait for the last poll to finish. |
addView( view )
Description
Adds a view and assigns it an id.Parameters
view |
The HView instance. |
|---|
Returns
The new view id.reniceApp( appId, priority )
Description
Changes the priority of the app. CallsstopApp and startApp.
Parameters
appId |
The id of the app. |
|---|---|
priority |
The app priority. |
scheduler( )
Calls applications, uses the prority as a prioritizer.
delView( viewId )
Description
Removes a view and recycles its id.Parameters
viewId |
The view id to delete. |
|---|
stopApp( appId )
Description
Stops polling an app instance (and its components).Parameters
appId |
The id of the app. |
|---|
startApp( appId, priority )
Description
Starts polling an app instance (and its components).Parameters
appId |
The unique id of the app. |
|---|---|
priority |
The app priority. |
ticker( )
Calls the scheduler and then calls itself after a timeout to keep the loop going on.
Other Singleton Members
ticks = 0
This is the internal "clock" counter. Gets updated on every tick.
apps = []
Singleton class; has no constructor
constructor: null,
An array of HApplication instances, index is the appIdbusyApps = []
An array (in the same order as apps): holds busy status
windowFocusMode = 1
When the focus behaviour is 1, clicking on any subview brings the window to front, if attached to a HWindow instance. If the behaviour is 0, only direct clicks on the HWindow controls brings the window to front.
views = []
All HView instances that are defined
freeAppIds = []
This array holds free app id:s
appPriorities = []
An array (in the same order as apps): holds priority values
viewsZOrder = []
The z-index of root-level HView instances. All the array operations
are done by the inner logic of HApplication and HView instances.
maxAppRunTime = 5000
Time in milliseconds for the timeout of a poll to finish before being classified as stuck and thus forcibly terminated.