KJS::Object KstBindEllipse::construct(KJS::ExecState *exec, const KJS::List& args) {
  if (args.size() != 1) {
    KJS::Object eobj = KJS::Error::create(exec, KJS::SyntaxError);
    exec->setException(eobj);
    return KJS::Object();
  }

  KstViewObjectPtr view = extractViewObject(exec, args[0]);
  if (!view) {
    KstViewWindow *w = extractWindow(exec, args[0]);
    if (w) {
      view = w->view();
    } else {
      KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
      exec->setException(eobj);
      return KJS::Object();
    }
  }

  KstViewEllipsePtr b = new KstViewEllipse;
  view->appendChild(b.data());
  KstApp::inst()->paintAll(KstPainter::P_PAINT);
  return KJS::Object(new KstBindEllipse(exec, b));
}
KstBindEllipse::KstBindEllipse(KJS::ExecState *exec, KstViewEllipsePtr d, const char *name)
: KstBindViewObject(exec, d.data(), name ? name : "Ellipse") {
  KJS::Object o(this);
  addBindings(exec, o);
}