|
|
726e8a |
using System;
|
|
|
589f9a |
using System.Collections.Generic;
|
|
|
726e8a |
|
|
|
726e8a |
namespace Assistance {
|
|
|
a62e15 |
public class Tool {
|
|
|
61bedf |
[Flags]
|
|
|
61bedf |
public enum ModifierTypes {
|
|
|
61bedf |
None = 0,
|
|
|
61bedf |
Tangents = 1,
|
|
|
ed66f8 |
Segmentation = 2,
|
|
|
61bedf |
Guideline = 4,
|
|
|
720280 |
Multiline = 8,
|
|
|
720280 |
All = 15
|
|
|
61bedf |
};
|
|
|
720280 |
|
|
|
720280 |
|
|
|
720280 |
public readonly Workarea workarea;
|
|
|
720280 |
|
|
|
720280 |
|
|
|
720280 |
public Tool(Workarea workarea)
|
|
|
720280 |
{ this.workarea = workarea; }
|
|
|
61bedf |
|
|
|
61bedf |
public virtual ModifierTypes getAvailableModifierTypes()
|
|
|
61bedf |
{ return ModifierTypes.None; }
|
|
|
61bedf |
|
|
|
61bedf |
public virtual void activate() { }
|
|
|
61bedf |
|
|
|
61bedf |
public virtual void keyEvent(bool press, Gdk.Key key, InputState state) { }
|
|
|
61bedf |
public virtual void buttonEvent(bool press, Gdk.Device device, uint button, InputState state) { }
|
|
|
38c95c |
|
|
|
61bedf |
// create new painting level and return true, or do nothing and return false
|
|
|
61bedf |
// was: ------O-------O------
|
|
|
61bedf |
// become: ------O-------O------O
|
|
|
61bedf |
public virtual bool paintPush() { return false; }
|
|
|
61bedf |
|
|
|
61bedf |
// paint several track-points at the top painting level
|
|
|
61bedf |
// was: ------O-------O------
|
|
|
61bedf |
// become: ------O-------O------------
|
|
|
61bedf |
public virtual void paintTracks(List<track> tracks) { }
|
|
|
61bedf |
|
|
|
720280 |
// try to merge N top painting levels and return count of levels that actually merged
|
|
|
61bedf |
// was: ------O-------O------O------
|
|
|
61bedf |
// become (N = 2): ------O---------------------
|
|
|
589f9a |
public virtual int paintApply(int count) { return 0; }
|
|
|
61bedf |
|
|
|
61bedf |
// reset top level to initial state
|
|
|
61bedf |
// was: ------O-------O------O------
|
|
|
61bedf |
// become: ------O-------O------O
|
|
|
61bedf |
public virtual void paintCancel() { }
|
|
|
61bedf |
|
|
|
61bedf |
// cancel and pop N painting levels
|
|
|
61bedf |
// was: ------O-------O------O------
|
|
|
61bedf |
// become (N = 2): ------O-------
|
|
|
61bedf |
public virtual void paintPop(int count) { }
|
|
|
61bedf |
|
|
|
38c95c |
|
|
|
61bedf |
public virtual void draw(Cairo.Context context) { }
|
|
|
77e178 |
|
|
|
61bedf |
public virtual void deactivate() { }
|
|
|
726e8a |
}
|
|
|
726e8a |
}
|