Пример #1
0
/** bool ofFile::renameTo(string path, bool bRelativeToData=true, bool overwrite=false)
 * api/openFrameworks/utils/ofFileUtils.h:137
 */
static int ofFile_renameTo(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      bool overwrite = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->renameTo(std::string(path, path_sz_), bRelativeToData, overwrite));
      return 1;
    } else if (top__ >= 3) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      lua_pushboolean(L, self->renameTo(std::string(path, path_sz_), bRelativeToData));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      lua_pushboolean(L, self->renameTo(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "renameTo: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "renameTo: Unknown exception");
  }
  return dub_error(L);
}
Пример #2
0
/** static bool ofFile::moveFromTo(string pathSrc, string pathDst, bool bRelativeToData=true, bool overwrite=false)
 * api/openFrameworks/utils/ofFileUtils.h:184
 */
static int ofFile_moveFromTo(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t pathSrc_sz_;
      const char *pathSrc = dub_checklstring(L, 1, &pathSrc_sz_);
      size_t pathDst_sz_;
      const char *pathDst = dub_checklstring(L, 2, &pathDst_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      bool overwrite = dub_checkboolean(L, 4);
      lua_pushboolean(L, ofFile::moveFromTo(std::string(pathSrc, pathSrc_sz_), std::string(pathDst, pathDst_sz_), bRelativeToData, overwrite));
      return 1;
    } else if (top__ >= 3) {
      size_t pathSrc_sz_;
      const char *pathSrc = dub_checklstring(L, 1, &pathSrc_sz_);
      size_t pathDst_sz_;
      const char *pathDst = dub_checklstring(L, 2, &pathDst_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      lua_pushboolean(L, ofFile::moveFromTo(std::string(pathSrc, pathSrc_sz_), std::string(pathDst, pathDst_sz_), bRelativeToData));
      return 1;
    } else {
      size_t pathSrc_sz_;
      const char *pathSrc = dub_checklstring(L, 1, &pathSrc_sz_);
      size_t pathDst_sz_;
      const char *pathDst = dub_checklstring(L, 2, &pathDst_sz_);
      lua_pushboolean(L, ofFile::moveFromTo(std::string(pathSrc, pathSrc_sz_), std::string(pathDst, pathDst_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "moveFromTo: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "moveFromTo: Unknown exception");
  }
  return dub_error(L);
}
Пример #3
0
/** void ofPolyline::arc(const ofPoint &center, float radiusX, float radiusY, float angleBegin, float angleEnd, bool clockwise, int curveResolution=20)
 * api/openFrameworks/graphics/ofPolyline.h:41
 */
static int ofPolyline_arc(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    int top__ = lua_gettop(L);
    if (top__ >= 8) {
      ofVec3f *center = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      float radiusX = dub_checknumber(L, 3);
      float radiusY = dub_checknumber(L, 4);
      float angleBegin = dub_checknumber(L, 5);
      float angleEnd = dub_checknumber(L, 6);
      bool clockwise = dub_checkboolean(L, 7);
      int curveResolution = dub_checkint(L, 8);
      self->arc(*center, radiusX, radiusY, angleBegin, angleEnd, clockwise, curveResolution);
      return 0;
    } else {
      ofVec3f *center = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      float radiusX = dub_checknumber(L, 3);
      float radiusY = dub_checknumber(L, 4);
      float angleBegin = dub_checknumber(L, 5);
      float angleEnd = dub_checknumber(L, 6);
      bool clockwise = dub_checkboolean(L, 7);
      self->arc(*center, radiusX, radiusY, angleBegin, angleEnd, clockwise);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "arc: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "arc: Unknown exception");
  }
  return dub_error(L);
}
/** btGeneric6DofSpringConstraint::btGeneric6DofSpringConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
 * bind/btGeneric6DofSpringConstraint.h:9
 */
static int btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btTransform *frameInA = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
      btTransform *frameInB = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
      bool useLinearReferenceFrameA = dub_checkboolean(L, 5);
      btGeneric6DofSpringConstraint *retval__ = new btGeneric6DofSpringConstraint(*rbA, *rbB, *frameInA, *frameInB, useLinearReferenceFrameA);
      dub_pushudata(L, retval__, "bt.Generic6DofSpringConstraint", true);
      return 1;
    } else {
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btTransform *frameInB = *((btTransform **)dub_checksdata(L, 2, "bt.Transform"));
      bool useLinearReferenceFrameB = dub_checkboolean(L, 3);
      btGeneric6DofSpringConstraint *retval__ = new btGeneric6DofSpringConstraint(*rbB, *frameInB, useLinearReferenceFrameB);
      dub_pushudata(L, retval__, "bt.Generic6DofSpringConstraint", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
Пример #5
0
/** bool ofFile::open(string path, Mode mode=ReadOnly, bool binary=false)
 * api/openFrameworks/utils/ofFileUtils.h:106
 */
static int ofFile_open(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 3);
      bool binary = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->open(std::string(path, path_sz_), mode, binary));
      return 1;
    } else if (top__ >= 3) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 3);
      lua_pushboolean(L, self->open(std::string(path, path_sz_), mode));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      lua_pushboolean(L, self->open(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "open: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "open: Unknown exception");
  }
  return dub_error(L);
}
Пример #6
0
/** void b2Fixture::SetSensor(bool sensor)
 * vendor/Box2D/Box2D/Dynamics/b2Fixture.h:121
 */
static int b2Fixture_SetSensor(lua_State *L) {
  try {
    b2Fixture *self = *((b2Fixture **)dub_checksdata(L, 1, "b2.Fixture"));
    bool sensor = dub_checkboolean(L, 2);
    self->SetSensor(sensor);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "SetSensor: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "SetSensor: Unknown exception");
  }
  return dub_error(L);
}
Пример #7
0
/** void ofVideoGrabber::setUseTexture(bool bUse)
 * api/openFrameworks/video/ofVideoGrabber.h:37
 */
static int ofVideoGrabber_setUseTexture(lua_State *L) {
  try {
    ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata(L, 1, "ofVideoGrabber"));
    bool bUse = dub_checkboolean(L, 2);
    self->setUseTexture(bUse);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setUseTexture: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setUseTexture: Unknown exception");
  }
  return dub_error(L);
}
Пример #8
0
/** void btCollisionWorld::setForceUpdateAllAabbs(bool forceUpdateAllAabbs)
 * src/vendor/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h:512
 */
static int btCollisionWorld_setForceUpdateAllAabbs(lua_State *L) {
  try {
    btCollisionWorld *self = *((btCollisionWorld **)dub_checksdata(L, 1, "bt.CollisionWorld"));
    bool forceUpdateAllAabbs = dub_checkboolean(L, 2);
    self->setForceUpdateAllAabbs(forceUpdateAllAabbs);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setForceUpdateAllAabbs: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setForceUpdateAllAabbs: Unknown exception");
  }
  return dub_error(L);
}
Пример #9
0
/** void QWidget::setMouseTracking(bool enable)
 * bind/QWidget.h:28
 */
static int TableView_setMouseTracking(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    bool enable = dub_checkboolean(L, 2);
    self->setMouseTracking(enable);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setMouseTracking: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setMouseTracking: Unknown exception");
  }
  return dub_error(L);
}
Пример #10
0
/** void ofPolyline::setClosed(bool tf)
 * api/openFrameworks/graphics/ofPolyline.h:119
 */
static int ofPolyline_setClosed(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    bool tf = dub_checkboolean(L, 2);
    self->setClosed(tf);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setClosed: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setClosed: Unknown exception");
  }
  return dub_error(L);
}
Пример #11
0
/** void btHingeConstraint::enableMotor(bool isEnableMotor)
 * bind/btHingeConstraint.h:38
 */
static int btHingeConstraint_enableMotor(lua_State *L) {
  try {
    btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata(L, 1, "bt.HingeConstraint"));
    bool isEnableMotor = dub_checkboolean(L, 2);
    self->enableMotor(isEnableMotor);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "enableMotor: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "enableMotor: Unknown exception");
  }
  return dub_error(L);
}
Пример #12
0
/** void ofFile::setExecutable(bool executable)
 * api/openFrameworks/utils/ofFileUtils.h:132
 */
static int ofFile_setExecutable(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    bool executable = dub_checkboolean(L, 2);
    self->setExecutable(executable);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setExecutable: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setExecutable: Unknown exception");
  }
  return dub_error(L);
}
Пример #13
0
/** void TableView::setVisibleHeaders(int orientation, bool visible)
 * include/mimas/TableView.h:58
 */
static int TableView_setVisibleHeaders(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int orientation = dub_checkint(L, 2);
    bool visible = dub_checkboolean(L, 3);
    self->setVisibleHeaders(orientation, visible);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setVisibleHeaders: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setVisibleHeaders: Unknown exception");
  }
  return dub_error(L);
}
/** void btGeneric6DofSpringConstraint::enableSpring(int index, bool onOff)
 * bind/btGeneric6DofSpringConstraint.h:16
 */
static int btGeneric6DofSpringConstraint_enableSpring(lua_State *L) {
  try {
    btGeneric6DofSpringConstraint *self = *((btGeneric6DofSpringConstraint **)dub_checksdata(L, 1, "bt.Generic6DofSpringConstraint"));
    int index = dub_checkint(L, 2);
    bool onOff = dub_checkboolean(L, 3);
    self->enableSpring(index, onOff);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "enableSpring: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "enableSpring: Unknown exception");
  }
  return dub_error(L);
}
Пример #15
0
/** void QWidget::setAttribute(int attr, bool enabled)
 * bind/QWidget.h:22
 */
static int TableView_setAttribute(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int attr = dub_checkint(L, 2);
    bool enabled = dub_checkboolean(L, 3);
    self->setAttribute((Qt::WidgetAttribute)attr, enabled);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setAttribute: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setAttribute: Unknown exception");
  }
  return dub_error(L);
}
Пример #16
0
/** void ofThread::startThread(bool blocking=true, bool verbose=false)
 * api/openFrameworks/utils/ofThread.h:36
 */
static int ofURLFileLoader_startThread(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      bool blocking = dub_checkboolean(L, 2);
      bool verbose = dub_checkboolean(L, 3);
      self->startThread(blocking, verbose);
      return 0;
    } else if (top__ >= 2) {
      bool blocking = dub_checkboolean(L, 2);
      self->startThread(blocking);
      return 0;
    } else {
      self->startThread();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "startThread: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "startThread: Unknown exception");
  }
  return dub_error(L);
}
Пример #17
0
/** void btHingeConstraint::enableAngularMotor(bool enableMotor, btScalar targetVelocity, btScalar maxMotorImpulse)
 * bind/btHingeConstraint.h:34
 */
static int btHingeConstraint_enableAngularMotor(lua_State *L) {
  try {
    btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata(L, 1, "bt.HingeConstraint"));
    bool enableMotor = dub_checkboolean(L, 2);
    btScalar targetVelocity = dub_checknumber(L, 3);
    btScalar maxMotorImpulse = dub_checknumber(L, 4);
    self->enableAngularMotor(enableMotor, targetVelocity, maxMotorImpulse);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "enableAngularMotor: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "enableAngularMotor: Unknown exception");
  }
  return dub_error(L);
}
Пример #18
0
/** ofFile::ofFile()
 * api/openFrameworks/utils/ofFileUtils.h:100
 */
static int ofFile_ofFile(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      size_t filePath_sz_;
      const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      bool binary = dub_checkboolean(L, 3);
      ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_), mode, binary);
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    } else if (top__ >= 2) {
      size_t filePath_sz_;
      const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_), mode);
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "ofFile", type__)) ) {
        ofFile *mom = *((ofFile **)ptr1__);
        ofFile *retval__ = new ofFile(*mom);
        dub_pushudata(L, retval__, "ofFile", true);
        return 1;
      } else {
        size_t filePath_sz_;
        const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
        ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_));
        dub_pushudata(L, retval__, "ofFile", true);
        return 1;
      }
    } else {
      ofFile *retval__ = new ofFile();
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
Пример #19
0
/** void ofThread::waitForThread(bool stop=true)
 * api/openFrameworks/utils/ofThread.h:67
 */
static int ofURLFileLoader_waitForThread(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      bool stop = dub_checkboolean(L, 2);
      self->waitForThread(stop);
      return 0;
    } else {
      self->waitForThread();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "waitForThread: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "waitForThread: Unknown exception");
  }
  return dub_error(L);
}
Пример #20
0
/** void ofFbo::begin(bool setupScreen=true)
 * api/openFrameworks/gl/ofFbo.h:34
 */
static int ofFbo_begin(lua_State *L) {
  try {
    ofFbo *self = *((ofFbo **)dub_checksdata(L, 1, "ofFbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      bool setupScreen = dub_checkboolean(L, 2);
      self->begin(setupScreen);
      return 0;
    } else {
      self->begin();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "begin: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "begin: Unknown exception");
  }
  return dub_error(L);
}
Пример #21
0
/** bool ofFile::remove(bool recursive=false)
 * api/openFrameworks/utils/ofFileUtils.h:141
 */
static int ofFile_remove(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      bool recursive = dub_checkboolean(L, 2);
      lua_pushboolean(L, self->remove(recursive));
      return 1;
    } else {
      lua_pushboolean(L, self->remove());
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "remove: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "remove: Unknown exception");
  }
  return dub_error(L);
}
Пример #22
0
/** bool ofFile::changeMode(Mode mode, bool binary=false)
 * api/openFrameworks/utils/ofFileUtils.h:107
 */
static int ofFile_changeMode(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      bool binary = dub_checkboolean(L, 3);
      lua_pushboolean(L, self->changeMode(mode, binary));
      return 1;
    } else {
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      lua_pushboolean(L, self->changeMode(mode));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "changeMode: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "changeMode: Unknown exception");
  }
  return dub_error(L);
}
Пример #23
0
/** static bool ofFile::doesFileExist(string fPath, bool bRelativeToData=true)
 * api/openFrameworks/utils/ofFileUtils.h:185
 */
static int ofFile_doesFileExist(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      size_t fPath_sz_;
      const char *fPath = dub_checklstring(L, 1, &fPath_sz_);
      bool bRelativeToData = dub_checkboolean(L, 2);
      lua_pushboolean(L, ofFile::doesFileExist(std::string(fPath, fPath_sz_), bRelativeToData));
      return 1;
    } else {
      size_t fPath_sz_;
      const char *fPath = dub_checklstring(L, 1, &fPath_sz_);
      lua_pushboolean(L, ofFile::doesFileExist(std::string(fPath, fPath_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "doesFileExist: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "doesFileExist: Unknown exception");
  }
  return dub_error(L);
}
Пример #24
0
/** static bool ofFile::removeFile(string path, bool bRelativeToData=true)
 * api/openFrameworks/utils/ofFileUtils.h:186
 */
static int ofFile_removeFile(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 1, &path_sz_);
      bool bRelativeToData = dub_checkboolean(L, 2);
      lua_pushboolean(L, ofFile::removeFile(std::string(path, path_sz_), bRelativeToData));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 1, &path_sz_);
      lua_pushboolean(L, ofFile::removeFile(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "removeFile: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "removeFile: Unknown exception");
  }
  return dub_error(L);
}
Пример #25
0
/** bool ofVideoGrabber::initGrabber(int w, int h)
 * api/openFrameworks/video/ofVideoGrabber.h:24
 */
static int ofVideoGrabber_initGrabber(lua_State *L) {
  try {
    ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata(L, 1, "ofVideoGrabber"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      int w = dub_checkint(L, 2);
      int h = dub_checkint(L, 3);
      bool bTexture = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->initGrabber(w, h, bTexture));
      return 1;
    } else {
      int w = dub_checkint(L, 2);
      int h = dub_checkint(L, 3);
      lua_pushboolean(L, self->initGrabber(w, h));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "initGrabber: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "initGrabber: Unknown exception");
  }
  return dub_error(L);
}
Пример #26
0
/** void QWidget::showFullScreen(bool enable=true)
 * bind/QWidget.h:61
 */
static int TableView_showFullScreen(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      bool enable = dub_checkboolean(L, 2);
      if (enable) {
        self->showFullScreen();
      } else {
        self->showNormal();
      }
      return 0;
    } else {
      self->showFullScreen();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "showFullScreen: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "showFullScreen: Unknown exception");
  }
  return dub_error(L);
}
Пример #27
0
/** btHingeConstraint::btHingeConstraint(btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
 * bind/btHingeConstraint.h:7
 */
static int btHingeConstraint_btHingeConstraint(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 7) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
      btVector3 *pivotInB = *((btVector3 **)dub_checksdata(L, 4, "bt.Vector3"));
      btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 5, "bt.Vector3"));
      btVector3 *axisInB = *((btVector3 **)dub_checksdata(L, 6, "bt.Vector3"));
      bool useReferenceFrameA = dub_checkboolean(L, 7);
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *pivotInA, *pivotInB, *axisInA, *axisInB, useReferenceFrameA);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    } else if (top__ >= 6) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
      btVector3 *pivotInB = *((btVector3 **)dub_checksdata(L, 4, "bt.Vector3"));
      btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 5, "bt.Vector3"));
      btVector3 *axisInB = *((btVector3 **)dub_checksdata(L, 6, "bt.Vector3"));
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *pivotInA, *pivotInB, *axisInA, *axisInB);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    } else if (top__ >= 5) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
      btTransform *rbBFrame = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
      bool useReferenceFrameA = dub_checkboolean(L, 5);
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *rbAFrame, *rbBFrame, useReferenceFrameA);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    } else if (top__ >= 4) {
      int type__ = lua_type(L, 4);
      if (type__ == LUA_TBOOLEAN) {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 2, "bt.Vector3"));
        btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
        bool useReferenceFrameA = dub_checkboolean(L, 4);
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *pivotInA, *axisInA, useReferenceFrameA);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      } else {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
        btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
        btTransform *rbBFrame = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *rbAFrame, *rbBFrame);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      }
    } else if (top__ >= 3) {
      int type__ = lua_type(L, 3);
      if (type__ == LUA_TBOOLEAN) {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 2, "bt.Transform"));
        bool useReferenceFrameA = dub_checkboolean(L, 3);
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbAFrame, useReferenceFrameA);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      } else {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 2, "bt.Vector3"));
        btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *pivotInA, *axisInA);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      }
    } else {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 2, "bt.Transform"));
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbAFrame);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}