当前位置: 首页>>代码示例>>C++>>正文


C++ dub_checksdata函数代码示例

本文整理汇总了C++中dub_checksdata函数的典型用法代码示例。如果您正苦于以下问题:C++ dub_checksdata函数的具体用法?C++ dub_checksdata怎么用?C++ dub_checksdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dub_checksdata函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MenuBar_parentWidget

/** QWidget* QWidget::parentWidget()
 * bind/QWidget.h:17
 */
static int MenuBar_parentWidget(lua_State *L) {
  try {
    MenuBar *self = *((MenuBar **)dub_checksdata(L, 1, "mimas.MenuBar"));
    QWidget *retval__ = self->parentWidget();
    if (!retval__) return 0;
    dub_pushudata(L, retval__, "mimas.QWidget", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "parentWidget: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "parentWidget: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_MenuBar.cpp

示例2: MenuBar_setAttribute

/** void QWidget::setAttribute(int attr, bool enabled)
 * bind/QWidget.h:22
 */
static int MenuBar_setAttribute(lua_State *L) {
  try {
    MenuBar *self = *((MenuBar **)dub_checksdata(L, 1, "mimas.MenuBar"));
    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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_MenuBar.cpp

示例3: ofBuffer_operator_sete

/** ofBuffer& ofBuffer::operator=(const string &text)
 * api/openFrameworks/utils/ofFileUtils.h:38
 */
static int ofBuffer_operator_sete(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    size_t text_sz_;
    const char *text = dub_checklstring(L, 2, &text_sz_);
    dub_pushudata(L, &self->operator=(std::string(text, text_sz_)), "ofBuffer", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "set: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "set: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:17,代码来源:ofBuffer.cpp

示例4: MenuBar_resize

/** void QWidget::resize(int w, int h)
 * bind/QWidget.h:11
 */
static int MenuBar_resize(lua_State *L) {
  try {
    MenuBar *self = *((MenuBar **)dub_checksdata(L, 1, "mimas.MenuBar"));
    int w = dub_checkint(L, 2);
    int h = dub_checkint(L, 3);
    self->resize(w, h);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "resize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "resize: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_MenuBar.cpp

示例5: GLWidget_setProperty

/** bool QObject::setProperty(const char *name, const QVariant &value)
 * bind/QObject.h:10
 */
static int GLWidget_setProperty(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例6: GLWidget_parent

/** QObject* QObject::parent()
 * bind/QObject.h:12
 */
static int GLWidget_parent(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    QObject *retval__ = self->parent();
    if (!retval__) return 0;
    dub_pushudata(L, retval__, "mimas.QObject", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "parent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "parent: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例7: GLWidget_textSize

/** void QWidget::textSize(const char *text)
 * bind/QWidget.h:55
 */
static int GLWidget_textSize(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例8: GLWidget_globalPosition

/** LuaStackSize QWidget::globalPosition()
 * bind/QWidget.h:70
 */
static int GLWidget_globalPosition(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    QPoint pt = self->mapToGlobal(QPoint(0, 0));
    lua_pushnumber(L, pt.x());
    lua_pushnumber(L, pt.y());
    return 2;
  } catch (std::exception &e) {
    lua_pushfstring(L, "globalPosition: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "globalPosition: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例9: GLWidget_size

/** LuaStackSize QWidget::size()
 * bind/QWidget.h:50
 */
static int GLWidget_size(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    QRect rect = self->geometry();
    lua_pushnumber(L, rect.width());
    lua_pushnumber(L, rect.height());
    return 2;
  } catch (std::exception &e) {
    lua_pushfstring(L, "size: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "size: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例10: GLWidget_setMinimumSize

/** void QWidget::setMinimumSize(float w, float h)
 * bind/QWidget.h:25
 */
static int GLWidget_setMinimumSize(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    float w = dub_checknumber(L, 2);
    float h = dub_checknumber(L, 3);
    self->setMinimumSize(w, h);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setMinimumSize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setMinimumSize: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例11: GLWidget_move

/** void QWidget::move(int x, int y)
 * bind/QWidget.h:10
 */
static int GLWidget_move(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    int x = dub_checkint(L, 2);
    int y = dub_checkint(L, 3);
    self->move(x, y);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "move: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "move: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_GLWidget.cpp

示例12: btGeneric6DofSpringConstraint_enableSpring

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:17,代码来源:bt_Generic6DofSpringConstraint.cpp

示例13: btGeneric6DofSpringConstraint_setDamping

/** void btGeneric6DofSpringConstraint::setDamping(int index, btScalar damping)
 * bind/btGeneric6DofSpringConstraint.h:18
 */
static int btGeneric6DofSpringConstraint_setDamping(lua_State *L) {
  try {
    btGeneric6DofSpringConstraint *self = *((btGeneric6DofSpringConstraint **)dub_checksdata(L, 1, "bt.Generic6DofSpringConstraint"));
    int index = dub_checkint(L, 2);
    btScalar damping = dub_checknumber(L, 3);
    self->setDamping(index, damping);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setDamping: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setDamping: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:17,代码来源:bt_Generic6DofSpringConstraint.cpp

示例14: ofVbo_setTexCoordData

/** void ofVbo::setTexCoordData(const ofVec2f *texCoords, int total, int usage)
 * api/openFrameworks/gl/ofVbo.h:26
 */
static int ofVbo_setTexCoordData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      float * texCoord0x = (float *) lua_touserdata (L, 2);
      
      int total = dub_checkint(L, 3);
      int usage = dub_checkint(L, 4);
      int stride = dub_checkint(L, 5);
      self->setTexCoordData((float *) texCoord0x, total, usage, stride);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "float *", type__)) ) {
        float * texCoord0x = (float *) lua_touserdata (L, 2);
        
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setTexCoordData((float *) texCoord0x, total, usage);
        return 0;
      } else {
        ofVec2f *texCoords = *((ofVec2f **)dub_checksdata(L, 2, "ofVec2f"));
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setTexCoordData(texCoords, total, usage);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setTexCoordData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setTexCoordData: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:40,代码来源:ofVbo.cpp

示例15: ofFbo_allocate

/** void ofFbo::allocate(int width, int height, int internalformat=GL_RGBA, int numSamples=0)
 * api/openFrameworks/gl/ofFbo.h:14
 */
static int ofFbo_allocate(lua_State *L) {
  try {
    ofFbo *self = *((ofFbo **)dub_checksdata(L, 1, "ofFbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      int width = dub_checkint(L, 2);
      int height = dub_checkint(L, 3);
      int internalformat = dub_checkint(L, 4);
      int numSamples = dub_checkint(L, 5);
      self->allocate(width, height, internalformat, numSamples);
      return 0;
    } else if (top__ >= 4) {
      int width = dub_checkint(L, 2);
      int height = dub_checkint(L, 3);
      int internalformat = dub_checkint(L, 4);
      self->allocate(width, height, internalformat);
      return 0;
    } else if (top__ >= 3) {
      int width = dub_checkint(L, 2);
      int height = dub_checkint(L, 3);
      self->allocate(width, height);
      return 0;
    } else if (top__ >= 2) {
      ofFbo::Settings *settings = *((ofFbo::Settings **)dub_checksdata(L, 2, "ofFbo.Settings"));
      self->allocate(*settings);
      return 0;
    } else {
      self->allocate();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "allocate: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "allocate: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:40,代码来源:ofFbo.cpp


注:本文中的dub_checksdata函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。