app: allow adding and removing sliders to/from a GimpToolLine
Add support for adding and removing sliders to/from a GimpToolLine, using three new signals: - can-add-slider: Takes a double argument in the range [0,1], indicating a location along the line, and returns a boolean value, indicating whether a slider can be added at that location. - add-slider: Takes a double argument in the range [0,1], indicating a location along the line, for which can-add-slider returned TRUE. In response, should add a new slider at that location, and return its index, or a negative value if no slider was added. - remove-slider: Takes a slider index. In response, may remove the slider. On the UI side, when the cursor is close enough to the line, but not within the hit area of an existing handle, GimpToolLine checks if a slider can be added at the cursor position, using can-add- slider. If a slider can be added, a dashed circle appears at the cursor position along the line, indicating where a slider will be added. The cursor is added by clicking, which emits an add-slider signal; if the signal returns a slider index, the new slider is selected, and can be subsequently dragged. Removing a slider is done by either selecting the slider and pressing backspace (or delete, although we don't actually forward it to the tool atm,) or by "tearing" the slider: when dragging the slider, if the cursor is far enough from the liner, a dashed circle appears around the slider, and releasing the mouse removes the slider.
Showing with 288 additions and 54 deletions