79
Stroke(PreStroke &s, int trigger_, int button_, bool timeout_);
77
Stroke(PreStroke &s, int trigger_, int button_, unsigned int modifiers_, bool timeout_);
81
79
Glib::RefPtr<Gdk::Pixbuf> draw_(int size, double width = 2.0, bool inv = false) const;
82
80
mutable Glib::RefPtr<Gdk::Pixbuf> pb[2];
85
83
static Glib::RefPtr<Gdk::Pixbuf> pbEmpty;
87
85
BOOST_SERIALIZATION_SPLIT_MEMBER()
88
template<class Archive> void save(Archive & ar, const unsigned int version) const {
89
std::vector<Point> ps;
90
for (unsigned int i = 0; i < size(); i++)
91
ps.push_back(points(i));
97
template<class Archive> void load(Archive & ar, const unsigned int version) {
98
std::vector<Point> ps;
101
stroke_t *s = stroke_alloc(ps.size());
102
for (std::vector<Point>::iterator i = ps.begin(); i != ps.end(); ++i)
103
stroke_add_point(s, i->x, i->y);
105
stroke.reset(s, &stroke_free);
107
if (version == 0) return;
111
if (version < 4 && (!button || trigger == get_default_button()))
86
template<class Archive> void load(Archive & ar, const unsigned int version);
87
template<class Archive> void save(Archive & ar, const unsigned int version) const;
91
unsigned int modifiers;
122
93
boost::shared_ptr<stroke_t> stroke;
124
Stroke() : trigger(0), button(0), timeout(false) {}
125
static RStroke create(PreStroke &s, int trigger_, int button_, bool timeout_) {
126
return RStroke(new Stroke(s, trigger_, button_, timeout_));
95
Stroke() : trigger(0), button(0), modifiers(AnyModifier), timeout(false) {}
96
static RStroke create(PreStroke &s, int trigger_, int button_, unsigned int modifiers_, bool timeout_) {
97
return RStroke(new Stroke(s, trigger_, button_, modifiers_, timeout_));
128
99
Glib::RefPtr<Gdk::Pixbuf> draw(int size, double width = 2.0, bool inv = false) const;
129
100
void draw(Cairo::RefPtr<Cairo::Surface> surface, int x, int y, int w, int h, double width = 2.0, bool inv = false) const;
141
112
double time(int n) const { return stroke_get_time(stroke.get(), n); }
142
113
bool is_timeout() const { return timeout; }
144
BOOST_CLASS_VERSION(Stroke, 4)
115
BOOST_CLASS_VERSION(Stroke, 5)
145
116
BOOST_CLASS_VERSION(Stroke::Point, 1)
147
118
class PreStroke : public std::vector<RTriple> {