
#include <mingpp.h>

SWFShape *makeRect(int r, int g, int b)
{
  SWFShape *s = new SWFShape();

  s->setRightFill(s->addSolidFill(r, g, b));
  s->movePenTo(-500,-500);
  s->drawLineTo(500,-500);
  s->drawLineTo(500,500);
  s->drawLineTo(-500,500);
  s->drawLineTo(-500,-500);
  return s;
}

int main()
{
  Ming_init();
  Ming_setScale(1.0);

  SWFButton *b = new SWFButton();
  b->addShape(makeRect(0xff, 0, 0), SWFBUTTON_UP);
  b->addShape(makeRect(0, 0xff, 0), SWFBUTTON_OVER);
  b->addShape(makeRect(0, 0, 0xff), SWFBUTTON_DOWN);
  b->addShape(makeRect(0, 0, 0), SWFBUTTON_HIT);

  SWFMovie *m = new SWFMovie();
  m->setDimension(2000,2000);
  m->setBackground(0xff, 0xff, 0xff);

  SWFDisplayItem *i = m->add(b);
  i->moveTo(1000,1000);

  m->save("test.swf");

  exit(0);
}
