The dispatcher object in the MilleFeuille library
establish connection between graphic requests received from
murals or input events received from the iwork infrastructure and
feuilles which handle them. It also provide a mechanism to post
simple finalization jobs used to free graphics resources.
If graphic requests dispatch is straitforward input events
dispatch is more complex since the dispatcher manage a focus grab
queue for each devices: a feuille who grabs a device is guaranty
to receive this device events first before any other clients
registered for the device. Only one feuille can grab a given
device at a given time. Note that bounding box based dispatch is
not managed by the dispatcher but by object of type Collage. The
collage at the root of the hierarchy is just yet another client.
class GraphicEvent { public: Mural *mural; IWorkEvent *iwork_event; };
class GraphicFinalization { public: virtual void finalize() {}; };
class InteractionEvent { public: MuralU32 input_ID; MuralU32 sequence_number; bool button_1; Point<Mural32> absolute_position; Point<Mural32> relative_position; Mural *mural; IWorkEvent *iwork_event; };
enum InputDevice {Mouse = 0, LaserPointer = 1, Unistroke = 2};
InputDevice is used to identify the different possible input device in the system.
enum DispatchType {NamedDevice, Dispatched, FocusGrab, Grabbed, NamedDeviceGrabbed, DispatchedGrabbed};
Dispatcher(IWorkPluginNode *new_iwork_node);
~Dispatcher();
void add_graphic_dispatch(Mural *mural, MuralLayer layer, GraphicPtr feuille);
- add_graphic_dispatch is used to bind layer layer of mural mural to feuille. All graphics requests from layer will be dispatched to feuille.
void remove_graphic_dispatch(Mural *mural, MuralLayer layer, GraphicPtr feuille);
- remove_graphic_dispatch is used to remove the binding between layer layer of mural mural and feuille.
void add_interaction_dispatch(Mural *mural, MuralU32 device_id, InteractionPtr feuille);
- add_interaction_dispatch is used to bind events from device device_id to feuille. All events received from device_id will be dispatched to feuille.
void remove_interaction_dispatch(Mural *mural, MuralU32 device_id, InteractionPtr feuille);
- remove_interaction_dispatch is used to remove the binding between device device_id and feuille.
bool add_focus_grab(Mural *mural, MuralU32 device_ID, InteractionPtr feuille);
- After a call to add_focus_grab feuille will be the first to received events from device_id. Note that events may be dispatched to other feuilles after. The system maintain one grab per device but only one feuille can grab a specific device at a time. If add_focus_grab return true the grab was successful otherwise it failled.
void remove_focus_grab(Mural *mural, MuralU32 device_ID, InteractionPtr feuille);
- remove_focus_grab removes feuille from device_id grab.
void add_graphic_finalization(Mural * mural, GraphicFinalizationPtr new_job);
- add_graphic_finalization post new_job a graphic finalization job to the queue for mural mural. When posted jobs are run once by calling finalize() the next time a graphic request it received from mural and before the request is dispatched. These jobs can be used to free server resources like display lists of textures.
None
None
None