Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoToolManager.h
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | |||||
114 | * | 114 | * | ||
115 | * KoToolManager also keeps track of the current tool based on a | 115 | * KoToolManager also keeps track of the current tool based on a | ||
116 | complex set of conditions and heuristics: | 116 | complex set of conditions and heuristics: | ||
117 | 117 | | |||
118 | - there is one active tool per KoCanvasController (and there is one KoCanvasController | 118 | - there is one active tool per KoCanvasController (and there is one KoCanvasController | ||
119 | per view, because this is a class with scrollbars and a zoomlevel and so on) | 119 | per view, because this is a class with scrollbars and a zoomlevel and so on) | ||
120 | - for every pointing device (determined by the unique id of tablet, | 120 | - for every pointing device (determined by the unique id of tablet, | ||
121 | or 0 for mice -- you may have more than one mouse attached, but | 121 | or 0 for mice -- you may have more than one mouse attached, but | ||
122 | Qt cannot distinquish between them, there is an associated tool. | 122 | Qt cannot distinguish between them, there is an associated tool. | ||
123 | - depending on things like tablet leave/enter proximity, incoming | 123 | - depending on things like tablet leave/enter proximity, incoming | ||
124 | mouse or tablet events and a little timer (that gets stopped when | 124 | mouse or tablet events and a little timer (that gets stopped when | ||
125 | we know what is what), the active pointing device is determined, | 125 | we know what is what), the active pointing device is determined, | ||
126 | and the active tool is set accordingly. | 126 | and the active tool is set accordingly. | ||
127 | 127 | | |||
128 | Nota bene: if you use KoToolManager and register your canvases with | 128 | Nota bene: if you use KoToolManager and register your canvases with | ||
129 | it you no longer have to manually implement methods to route mouse, | 129 | it you no longer have to manually implement methods to route mouse, | ||
130 | tablet, key or wheel events to the active tool. In fact, it's no | 130 | tablet, key or wheel events to the active tool. In fact, it's no | ||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |