本文整理汇总了C++中dub_checksdata函数的典型用法代码示例。如果您正苦于以下问题:C++ dub_checksdata函数的具体用法?C++ dub_checksdata怎么用?C++ dub_checksdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dub_checksdata函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: b2BiFrictionJointDef_Initialize
/** void b2BiFrictionJointDef::Initialize(b2Body *body, const b2Vec2 &mu)
* vendor/Box2D/Box2D/Dynamics/Joints/b2BiFrictionJoint.h:35
*/
static int b2BiFrictionJointDef_Initialize(lua_State *L) {
try {
b2BiFrictionJointDef *self = *((b2BiFrictionJointDef **)dub_checksdata(L, 1, "b2.BiFrictionJointDef"));
int top__ = lua_gettop(L);
if (top__ >= 4) {
int type__ = lua_type(L, 4);
void **ptr4__;
if ( (ptr4__ = dub_issdata(L, 4, "b2.Mat22", type__)) ) {
b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
b2Mat22 *muStatic = *((b2Mat22 **)dub_checksdata(L, 3, "b2.Mat22"));
b2Mat22 *muKinetic = *((b2Mat22 **)ptr4__);
self->Initialize(body, *muStatic, *muKinetic);
return 0;
} else {
b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
b2Vec2 *muStatic = *((b2Vec2 **)dub_checksdata(L, 3, "b2.Vec2"));
b2Vec2 *muKinetic = *((b2Vec2 **)dub_checksdata(L, 4, "b2.Vec2"));
self->Initialize(body, *muStatic, *muKinetic);
return 0;
}
} else {
int type__ = lua_type(L, 3);
void **ptr3__;
if ( (ptr3__ = dub_issdata(L, 3, "b2.Mat22", type__)) ) {
b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
b2Mat22 *muStatic = *((b2Mat22 **)ptr3__);
self->Initialize(body, *muStatic);
return 0;
} else {
b2Body *body = *((b2Body **)dub_checksdata(L, 2, "b2.Body"));
b2Vec2 *mu = *((b2Vec2 **)dub_checksdata(L, 3, "b2.Vec2"));
self->Initialize(body, *mu);
return 0;
}
}
} catch (std::exception &e) {
lua_pushfstring(L, "Initialize: %s", e.what());
} catch (...) {
lua_pushfstring(L, "Initialize: Unknown exception");
}
return dub_error(L);
}
开发者ID:lubyk,项目名称:b2,代码行数:45,代码来源:b2_BiFrictionJointDef.cpp
示例17: b2Color_Set
/** void b2Color::Set(float32 ri, float32 gi, float32 bi)
* vendor/Box2D/Box2D/Common/b2Draw.h:29
*/
static int b2Color_Set(lua_State *L) {
try {
b2Color *self = *((b2Color **)dub_checksdata(L, 1, "b2.Color"));
float32 ri = dub_checknumber(L, 2);
float32 gi = dub_checknumber(L, 3);
float32 bi = dub_checknumber(L, 4);
self->Set(ri, gi, bi);
return 0;
} catch (std::exception &e) {
lua_pushfstring(L, "Set: %s", e.what());
} catch (...) {
lua_pushfstring(L, "Set: Unknown exception");
}
return dub_error(L);
}
开发者ID:lubyk,项目名称:b2,代码行数:18,代码来源:b2_Color.cpp
示例18: TableView_setSizePolicy
/** void QWidget::setSizePolicy(int horizontal, int vertical)
* bind/QWidget.h:59
*/
static int TableView_setSizePolicy(lua_State *L) {
try {
TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
int horizontal = dub_checkint(L, 2);
int vertical = dub_checkint(L, 3);
self->setSizePolicy((QSizePolicy::Policy)horizontal, (QSizePolicy::Policy)vertical);
self->updateGeometry();
return 0;
} catch (std::exception &e) {
lua_pushfstring(L, "setSizePolicy: %s", e.what());
} catch (...) {
lua_pushfstring(L, "setSizePolicy: Unknown exception");
}
return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:18,代码来源:mimas_TableView.cpp
示例19: TableView_setToolTip
/** void QWidget::setToolTip(const QString &text)
* bind/QWidget.h:39
*/
static int TableView_setToolTip(lua_State *L) {
try {
TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
size_t text_sz_;
const char *text = dub_checklstring(L, 2, &text_sz_);
self->setToolTip(QString::fromUtf8(text, text_sz_));
return 0;
} catch (std::exception &e) {
lua_pushfstring(L, "setToolTip: %s", e.what());
} catch (...) {
lua_pushfstring(L, "setToolTip: Unknown exception");
}
return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:18,代码来源:mimas_TableView.cpp
示例20: TableView_setObjectName
/** void QObject::setObjectName(const QString &name)
* bind/QObject.h:8
*/
static int TableView_setObjectName(lua_State *L) {
try {
TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
size_t name_sz_;
const char *name = dub_checklstring(L, 2, &name_sz_);
self->setObjectName(QString::fromUtf8(name, name_sz_));
return 0;
} catch (std::exception &e) {
lua_pushfstring(L, "setObjectName: %s", e.what());
} catch (...) {
lua_pushfstring(L, "setObjectName: Unknown exception");
}
return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:18,代码来源:mimas_TableView.cpp
注:本文中的dub_checksdata函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论