Esempio n. 1
0
/** LineEdit::LineEdit(const char *content=NULL, QWidget *parent=NULL)
 * include/mimas/LineEdit.h:47
 */
static int LineEdit_LineEdit(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      const char *content = dub_checkstring(L, 1);
      QWidget *parent = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      LineEdit *retval__ = new LineEdit(content, parent);
      retval__->pushobject(L, retval__, "mimas.LineEdit", true);
      return 1;
    } else if (top__ >= 1) {
      const char *content = dub_checkstring(L, 1);
      LineEdit *retval__ = new LineEdit(content);
      retval__->pushobject(L, retval__, "mimas.LineEdit", true);
      return 1;
    } else {
      LineEdit *retval__ = new LineEdit();
      retval__->pushobject(L, retval__, "mimas.LineEdit", 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);
}
Esempio n. 2
0
/** LuaStackSize Widget::getExistingDirectory(const char *caption, const char *base_dir, int options, lua_State *L)
 * include/mimas/Widget.h:113
 */
static int Widget_getExistingDirectory(lua_State *L) {
  try {
    Widget *self = *((Widget **)dub_checksdata(L, 1, "mimas.Widget"));
    const char *caption = dub_checkstring(L, 2);
    const char *base_dir = dub_checkstring(L, 3);
    int options = dub_checkint(L, 4);
    return self->getExistingDirectory(caption, base_dir, options, L);
  } catch (std::exception &e) {
    lua_pushfstring(L, "getExistingDirectory: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getExistingDirectory: Unknown exception");
  }
  return dub_error(L);
}
/** void ofConsoleLoggerChannel::log(ofLogLevel level, const string &module, const string &message)
 * api/openFrameworks/utils/ofLog.h:156
 */
static int ofConsoleLoggerChannel_log(lua_State *L) {
  try {
    ofConsoleLoggerChannel *self = *((ofConsoleLoggerChannel **)dub_checksdata(L, 1, "ofConsoleLoggerChannel"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      ofLogLevel logLevel = (ofLogLevel)dub_checkint(L, 2);
      size_t module_sz_;
      const char *module = dub_checklstring(L, 3, &module_sz_);
      const char *format = dub_checkstring(L, 4);
      va_list *args = *((va_list **)dub_checksdata(L, 5, "va"));
      self->log(logLevel, std::string(module, module_sz_), format, *args);
      return 0;
    } else {
      ofLogLevel level = (ofLogLevel)dub_checkint(L, 2);
      size_t module_sz_;
      const char *module = dub_checklstring(L, 3, &module_sz_);
      size_t message_sz_;
      const char *message = dub_checklstring(L, 4, &message_sz_);
      self->log(level, std::string(module, module_sz_), std::string(message, message_sz_));
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "log: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "log: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 4
0
/** void ofBuffer::set(const char *_buffer, unsigned int _size)
 * api/openFrameworks/utils/ofFileUtils.h:21
 */
static int ofBuffer_set(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      const char *_buffer = dub_checkstring(L, 2);
      unsigned int _size = dub_checkint(L, 3);
      self->set(_buffer, _size);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "istream", type__)) ) {
        istream *stream = *((istream **)ptr2__);
        lua_pushboolean(L, self->set(*stream));
        return 1;
      } else {
        size_t text_sz_;
        const char *text = dub_checklstring(L, 2, &text_sz_);
        self->set(std::string(text, text_sz_));
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "set: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "set: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 5
0
/** QVariant QObject::property(const char *name)
 * bind/QObject.h:9
 */
static int TableView_property(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    const char *name = dub_checkstring(L, 2);
    return pushVariantInLua(L, self->property(name));
  } catch (std::exception &e) {
    lua_pushfstring(L, "property: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "property: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 6
0
/** void QWidget::setStyleSheet(const char *text)
 * bind/QWidget.h:52
 */
static int TableView_setStyleSheet(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    const char *text = dub_checkstring(L, 2);
    self->setStyleSheet(text);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setStyleSheet: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setStyleSheet: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 7
0
/** void QWidget::setStyle(const char *text)
 * bind/QWidget.h:51
 */
static int TableView_setStyle(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    const char *text = dub_checkstring(L, 2);
    self->setStyleSheet(QString("%1 { %2 }").arg(self->metaObject()->className()).arg(text));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setStyle: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setStyle: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 8
0
/** void Widget::setStyle(const char *text)
 * include/mimas/Widget.h:80
 */
static int Widget_setStyle(lua_State *L) {
  try {
    Widget *self = *((Widget **)dub_checksdata(L, 1, "mimas.Widget"));
    const char *text = dub_checkstring(L, 2);
    self->setStyle(text);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setStyle: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setStyle: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 9
0
/** void QWidget::textSize(const char *text)
 * bind/QWidget.h:55
 */
static int TableView_textSize(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    const char *text = dub_checkstring(L, 2);
    lua_pushnumber(L, self->fontMetrics().width(text));
    lua_pushnumber(L, self->fontMetrics().height());
    return 2;
  } catch (std::exception &e) {
    lua_pushfstring(L, "textSize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "textSize: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 10
0
/** bool QObject::setProperty(const char *name, const QVariant &value)
 * bind/QObject.h:10
 */
static int TableView_setProperty(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    const char *name = dub_checkstring(L, 2);
    QVariant value(variantFromLua(L, 3));
    lua_pushboolean(L, self->setProperty(name, value));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setProperty: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setProperty: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 11
0
/** ofBuffer::ofBuffer()
 * api/openFrameworks/utils/ofFileUtils.h:13
 */
static int ofBuffer_ofBuffer(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      const char *buffer = dub_checkstring(L, 1);
      unsigned int size = dub_checkint(L, 2);
      ofBuffer *retval__ = new ofBuffer(buffer, size);
      dub_pushudata(L, retval__, "ofBuffer", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "istream", type__)) ) {
        istream *stream = *((istream **)ptr1__);
        ofBuffer *retval__ = new ofBuffer(*stream);
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      } else if ( (ptr1__ = dub_issdata(L, 1, "ofBuffer", type__)) ) {
        ofBuffer *buffer_ = *((ofBuffer **)ptr1__);
        ofBuffer *retval__ = new ofBuffer(*buffer_);
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      } else {
        size_t text_sz_;
        const char *text = dub_checklstring(L, 1, &text_sz_);
        ofBuffer *retval__ = new ofBuffer(std::string(text, text_sz_));
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      }
    } else {
      ofBuffer *retval__ = new ofBuffer();
      dub_pushudata(L, retval__, "ofBuffer", 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);
}
Esempio n. 12
0
/** void ofBuffer::append(const string &_buffer)
 * api/openFrameworks/utils/ofFileUtils.h:24
 */
static int ofBuffer_append(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      const char *_buffer = dub_checkstring(L, 2);
      unsigned int _size = dub_checkint(L, 3);
      self->append(_buffer, _size);
      return 0;
    } else {
      size_t _buffer_sz_;
      const char *_buffer = dub_checklstring(L, 2, &_buffer_sz_);
      self->append(std::string(_buffer, _buffer_sz_));
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "append: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "append: Unknown exception");
  }
  return dub_error(L);
}