2
* Copyright (c) 2008, Thomas Jaeger <ThJaeger@gmail.com>
2
* Copyright (c) 2008-2009, Thomas Jaeger <ThJaeger@gmail.com>
4
4
* Permission to use, copy, modify, and/or distribute this software for any
5
5
* purpose with or without fee is hereby granted, provided that the above
86
86
double length() const;
87
87
int size() const { return points.size(); }
89
Stroke(PreStroke &s, int trigger_, int button_);
89
Stroke(PreStroke &s, int trigger_, int button_, bool timeout_);
91
Glib::RefPtr<Gdk::Pixbuf> draw_(int) const;
92
mutable Glib::RefPtr<Gdk::Pixbuf> pb;
91
Glib::RefPtr<Gdk::Pixbuf> draw_(int, bool) const;
92
mutable Glib::RefPtr<Gdk::Pixbuf> pb[2];
93
93
std::vector<Point> points;
95
95
static Glib::RefPtr<Gdk::Pixbuf> drawEmpty_(int);
102
102
if (version >= 2)
105
trigger = get_default_button();
104
if (version < 4 && (!button || trigger == get_default_button()))
112
Stroke() : trigger(0), button(0) {}
113
static RStroke create(PreStroke &s, int trigger_, int button_) { return RStroke(new Stroke(s, trigger_, button_)); }
115
Glib::RefPtr<Gdk::Pixbuf> draw(int size) const;
116
void draw(Cairo::RefPtr<Cairo::Surface> surface, int x, int y, int w, int h, bool invert = true) const;
116
Stroke() : trigger(0), button(0), timeout(false) {}
117
static RStroke create(PreStroke &s, int trigger_, int button_, bool timeout_) {
118
return RStroke(new Stroke(s, trigger_, button_, timeout_));
120
Glib::RefPtr<Gdk::Pixbuf> draw(int size, bool big = false) const;
121
void draw(Cairo::RefPtr<Cairo::Surface> surface, int x, int y, int w, int h, bool big) const;
117
122
void draw_svg(std::string filename) const;
118
123
bool show_icon();
120
125
static RStroke trefoil();
121
static double compare(RStroke, RStroke);
122
static double compare(RStroke, RStroke, double);
126
static bool compare(RStroke, RStroke, double &);
123
127
static Glib::RefPtr<Gdk::Pixbuf> drawEmpty(int);
125
129
void print() const;
126
130
void normalize();
127
131
bool trivial() const { return size() == 0 && button == 0; }
132
bool is_timeout() const { return timeout; }
129
BOOST_CLASS_VERSION(Stroke, 2)
134
BOOST_CLASS_VERSION(Stroke, 4)
131
136
class PreStroke : public std::vector<RTriple> {