Eventing System

Extending from my ideas in in the web workers thread: The parts of the API that are delegated to workers can work with the user directly, in the UI thread. I think we can avoid sending UI event stuff to a worker and back. There can perhaps be a scene graph that serves for the purposes of managing UI-side events and live in the UI thread. The first worker-side graph lives in at least one worker thread, and exists for the purposes of matrix calculations, etc. The UI-side graph would obviously mirror the structure of the worker-side graph. So, if a UI event happens on a leaf node, that can propagate up the ui-side graph (depending on how it’s wired by the user (shouldn’t be exclusively predetermined like it is in Famous Engine)), and if the event handler tells a node to update it’s position (or size, align, etc), only then will a message go to a worker. So, basically, the ui-side graph might exist merely to house event handler functions, and other UI-side things. Those functions themselves can call things like node.setPosition which would cause messages to go to corresponding parts of a the worker graph.