public CairoBoard(ArrayList pos)
            : base()
        {
            //figure = new Figure ();
            fm = new FigureManager ();
            position = new Position (pos);
            info = new MoveInfo ();

            layout = new Pango.Layout (PangoContext);
            if (Config.WindowsBuild)
                colors = new CustomColorProvider ();
            else
                colors = new GtkBasedColorProvider (this);
        }
		public static void DrawPiece (Cairo.Context cairo,
					      Cairo.Color fill,
					      FigureManager fm,
					      FigureType fig, int x, int y,
					      int size)
		{
			//fill = new Cairo.Color (0, 0, 0, 1);

			ArrayList list = fm.GetPoints (fig);

			for (int i = 0; i < list.Count; i++)
			  {
				  SvgInfo info = (SvgInfo) list[i];
				  if (info.cmd == 'M')
				    {
					    cairo.MoveTo (x + info.x,
							  y + info.y);
					    continue;
				    }
				  else if (info.cmd == 'L')
				    {
					    cairo.LineTo (x + info.x,
							  y + info.y);
					    continue;
				    }
				  else if (info.cmd == 'z')
				    {
					    continue;
				    }

				  SvgInfo info2 = (SvgInfo) list[++i];
				  SvgInfo info3 = (SvgInfo) list[++i];

				  cairo.CurveTo (x + info.x, y + info.y,
						 x + info2.x, y + info2.y,
						 x + info3.x, y + info3.y);
			  }
			cairo.Color = fill;
			cairo.Fill ();
		}
		public static void DrawPiece (Cairo.Context cairo,
					      FigureManager fm,
					      FigureType fig, int x, int y,
					      int size)
		{
			DrawPiece (cairo, new Cairo.Color (0, 0, 0, 1), fm,
				   fig, x, y, size);
		}