#include using namespace std; #include "canvas.h" canvas::canvas(unsigned width, unsigned height) : width(width), height(height) { cout << "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n"; } canvas& operator<<(canvas& c, const line& l) { cout << "\n" "\tcontext.beginPath();\n" "\tcontext.moveTo(" << l.A.x << ", " << l.A.y << ");\n" "\tcontext.lineTo(" << l.B.x << ", " << l.B.y << ");\n" "\tcontext.stroke();\n"; } //i/o manipulators canvas& black(canvas& c) { cout << "\tcontext.strokeStyle = \"#000000\";\n"; } canvas& red(canvas& c) { cout << "\tcontext.strokeStyle = \"#FF0000\";\n"; }