23 #include "visdisplay.h"
25 #include <interfaces/VisualDisplay2DInterface.h>
27 using namespace fawkes;
46 for (__sit = __shapes.begin(); __sit != __shapes.end(); ++__sit) {
59 __interface = interface;
70 while (! __interface->msgq_empty()) {
73 __shapes[m->
id()] =
new Line(m->
x(0), m->
y(0), m->
x(1), m->
y(1),
101 for (__sit = __shapes.begin(); __sit != __shapes.end(); ++__sit) {
102 delete __sit->second;
107 __interface->msgq_pop();
120 for (__sit = __shapes.begin(); __sit != __shapes.end(); ++__sit) {
122 __sit->second->color(r, g, b, a);
123 __sit->second->apply_style(cr);
124 __sit->second->draw(cr);
181 unsigned char r,
unsigned char g,
182 unsigned char b,
unsigned char a)
186 _line_style = line_style;
187 _color_r = r / 255.f;
188 _color_g = g / 255.f;
189 _color_b = b / 255.f;
190 _color_a = a / 255.f;
220 unsigned int id,
unsigned int owner,
222 unsigned char r,
unsigned char g,
223 unsigned char b,
unsigned char a)
224 :
Shape(id, owner, line_style, r, g, b, a)
236 cr->move_to(__x1, __y1);
237 cr->line_to(__x2, __y2);
264 unsigned int id,
unsigned int owner,
266 unsigned char r,
unsigned char g,
267 unsigned char b,
unsigned char a)
268 :
Shape(id, owner, line_style, r, g, b, a)
280 cr->rectangle(__x, __y, __width, __height);
304 unsigned int id,
unsigned int owner,
306 unsigned char r,
unsigned char g,
307 unsigned char b,
unsigned char a)
308 :
Shape(id, owner, line_style, r, g, b, a)
319 cr->arc(__x, __y, __radius, 0, 2*M_PI);
346 unsigned int id,
unsigned int owner,
347 unsigned char r,
unsigned char g,
348 unsigned char b,
unsigned char a)
364 cr->rotate(-0.5 * M_PI);
365 cr->set_font_size(1.36 * __size);
367 Cairo::TextExtents te;
368 cr->get_text_extents(__text, te);
370 float x = __x, y = __y;
372 case VisualDisplay2DInterface::CENTERED:
373 x = __x - te.width / 2.; y = __y + te.height / 2.;
break;
374 case VisualDisplay2DInterface::NORTH:
375 x = __x - te.width / 2.; y = __y + te.height;
break;
376 case VisualDisplay2DInterface::EAST:
377 x = __x - te.width; y = __y + te.height / 2.;
break;
378 case VisualDisplay2DInterface::SOUTH:
379 x = __x - te.width / 2.;
break;
380 case VisualDisplay2DInterface::WEST:
381 y = __y + te.height / 2.;
break;
382 case VisualDisplay2DInterface::NORTH_EAST:
383 x = __x - te.width; y = __y + te.height;
break;
384 case VisualDisplay2DInterface::SOUTH_EAST:
385 x = __x - te.width;
break;
386 case VisualDisplay2DInterface::SOUTH_WEST:
388 case VisualDisplay2DInterface::NORTH_WEST:
389 y = __y + te.height;
break;
393 cr->show_text(__text);