Exemplo n.º 1
0
static int GetW(lua_State* L)
{
	DECLARE_SELF(L)
	lua_pushnumber(L, self->GetW());

	return 1;
}
Exemplo n.º 2
0
static QScriptValue setY(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, setY);
    qreal y = ctx->argument(0).toNumber();
    self->setY(y);
    return QScriptValue();
}
Exemplo n.º 3
0
static QScriptValue moveTop(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, moveTop);
    qreal top = ctx->argument(0).toNumber();
    self->moveTop(top);
    return QScriptValue();
}
Exemplo n.º 4
0
static QScriptValue moveRight(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, moveRight);
    qreal right = ctx->argument(0).toNumber();
    self->moveBottom(right);
    return QScriptValue();
}
Exemplo n.º 5
0
static int GetRelativeValue(lua_State* L)
{
	DECLARE_SELF(L)
	lua_pushnumber(L, self->GetRelativeValue());

	return 1;
}
Exemplo n.º 6
0
static int __stdcall
Test2_ITester2_Get(ITester2 *intf)
{
	DECLARE_SELF(Test2, ITester2, intf);
	
	return self->foo;
}
Exemplo n.º 7
0
static QScriptValue contains(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, contains);
    qreal x = ctx->argument(0).toNumber();
    qreal y = ctx->argument(1).toNumber();
    return QScriptValue(eng, self->contains(x, y));
}
Exemplo n.º 8
0
static int Enable(lua_State* L)
{
	DECLARE_SELF(L)
	self->Enable();

	return 0;
}
Exemplo n.º 9
0
static int GetName(lua_State* L)
{
	DECLARE_SELF(L)
	LuaManager::PushWide(L, self->GetName());

	return 1;
}
Exemplo n.º 10
0
static QScriptValue translate(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, translate);
    qreal dx = ctx->argument(0).toNumber();
    qreal dy = ctx->argument(1).toNumber();
    self->translate(dx, dy);
    return QScriptValue();
}
Exemplo n.º 11
0
static QScriptValue moveTo(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, moveTo);
    qreal x = ctx->argument(0).toNumber();
    qreal y = ctx->argument(1).toNumber();
    self->moveTo(x, y);
    return QScriptValue();
}
Exemplo n.º 12
0
static uint32_t __stdcall
Test2_ITester2_AddRef(ITester2 *intf)
{
	DECLARE_SELF(Test2, ITester2, intf);
	
	self->refcount++;
	fprintf(stderr, "Test2::AddRef(): refcount is now %u\n", self->refcount);
	return self->refcount;
}
Exemplo n.º 13
0
static com_result_t __stdcall
Test2_ITester2_Set(ITester2 *intf, int newval)
{
	DECLARE_SELF(Test2, ITester2, intf);
	
	fprintf(stderr, "Test2::Set(): foo was %d, now %d\n", self->foo, newval);
	self->foo = newval;
	return COM_S_OK;
}
Exemplo n.º 14
0
static QScriptValue setCoords(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, setCoords);
    qreal x1 = ctx->argument(0).toNumber();
    qreal y1 = ctx->argument(1).toNumber();
    qreal x2 = ctx->argument(2).toNumber();
    qreal y2 = ctx->argument(3).toNumber();
    self->setCoords(x1, y1, x2, y2);
    return QScriptValue();
}
Exemplo n.º 15
0
static QScriptValue setRect(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, setRect);
    qreal x = ctx->argument(0).toNumber();
    qreal y = ctx->argument(1).toNumber();
    qreal width = ctx->argument(2).toNumber();
    qreal height = ctx->argument(3).toNumber();
    self->setRect(x, y, width, height);
    return QScriptValue();
}
Exemplo n.º 16
0
static QScriptValue height(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, height);

    if (ctx->argumentCount() > 0) {
        int height = ctx->argument(0).toInt32();
        self->setHeight(height);
    }

    return QScriptValue(eng, self->height());
}
Exemplo n.º 17
0
static QScriptValue top(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, top);

    if (ctx->argumentCount() > 0) {
        int top = ctx->argument(0).toInt32();
        self->setTop(top);
    }

    return QScriptValue(eng, self->top());
}
Exemplo n.º 18
0
static QScriptValue adjusted(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, adjusted);
    qreal dx1 = ctx->argument(0).toNumber();
    qreal dy1 = ctx->argument(1).toNumber();
    qreal dx2 = ctx->argument(2).toNumber();
    qreal dy2 = ctx->argument(3).toNumber();

    QRectF tmp = self->adjusted(dx1, dy1, dx2, dy2);
    return qScriptValueFromValue(eng, tmp);
}
Exemplo n.º 19
0
static QScriptValue bottom(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, bottom);

    if (ctx->argumentCount() > 0) {
        int bottom = ctx->argument(0).toInt32();
        self->setBottom(bottom);
    }

    return QScriptValue(eng, self->bottom());
}
Exemplo n.º 20
0
static QScriptValue y(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, y);

    if (ctx->argumentCount() > 0) {
        int y = ctx->argument(0).toInt32();
        self->setY(y);
    }

    return QScriptValue(eng, self->y());
}
Exemplo n.º 21
0
static QScriptValue adjust(QScriptContext *ctx, QScriptEngine *)
{
    DECLARE_SELF(QRectF, adjust);
    qreal dx1 = ctx->argument(0).toNumber();
    qreal dy1 = ctx->argument(1).toNumber();
    qreal dx2 = ctx->argument(2).toNumber();
    qreal dy2 = ctx->argument(3).toNumber();

    self->adjust(dx1, dy1, dx2, dy2);
    return QScriptValue();
}
Exemplo n.º 22
0
static QScriptValue width(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, width);

    if (ctx->argumentCount() > 0) {
        int width = ctx->argument(0).toInt32();
        self->setWidth(width);
    }

    return QScriptValue(eng, self->width());
}
Exemplo n.º 23
0
static QScriptValue left(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, left);

    if (ctx->argumentCount() > 0) {
        int left = ctx->argument(0).toInt32();
        self->setLeft(left);
    }

    return QScriptValue(eng, self->left());
}
Exemplo n.º 24
0
static int GetOption(lua_State* L)
{
	DECLARE_SELF(L)
	MeterWindow* meterWindow = self->GetMeterWindow();
	ConfigParser& parser = meterWindow->GetParser();

	std::wstring strTmp = LuaManager::ToWide(L, 2);
	strTmp = parser.ReadString(self->GetName(), strTmp.c_str(), L"");

	LuaManager::PushWide(L, strTmp);
	return 1;
}
Exemplo n.º 25
0
static int GetNumberOption(lua_State* L)
{
	DECLARE_SELF(L)
	CMeterWindow* meterWindow = self->GetMeterWindow();
	CConfigParser& parser = meterWindow->GetParser();

	std::wstring strTmp = LuaManager::ToWide(L, 2);
	double value = parser.ReadFloat(self->GetName(), strTmp.c_str(), lua_tonumber(L, 3));

	lua_pushnumber(L, value);
	return 1;
}
Exemplo n.º 26
0
static int GetOption(lua_State* L)
{
	DECLARE_SELF(L)
	MeterWindow* meterWindow = self->GetMeterWindow();
	ConfigParser& parser = meterWindow->GetParser();

	const std::wstring section = LuaManager::ToWide(2);
	const std::wstring defValue = LuaManager::ToWide(3);
	const std::wstring& value =
		parser.ReadString(self->GetName(), section.c_str(), defValue.c_str());
	LuaManager::PushWide(value);
	return 1;
}
Exemplo n.º 27
0
static uint32_t __stdcall
Test2_ITester2_Release(ITester2 *intf)
{
	DECLARE_SELF(Test2, ITester2, intf);
	
	if(1 == self->refcount)
	{
		fprintf(stderr, "Test2::Release(): refcount is now 0, freeing\n");
		free(self);
		return 0;
	}
	self->refcount--;
	fprintf(stderr, "Test2::Release(): refcount is now %u\n", self->refcount);
	return self->refcount;
}
Exemplo n.º 28
0
static QScriptValue empty(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, empty);
    return QScriptValue(eng, self->isEmpty());
}
Exemplo n.º 29
0
static QScriptValue null(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, null);
    return QScriptValue(eng, self->isNull());
}
Exemplo n.º 30
0
static QScriptValue valid(QScriptContext *ctx, QScriptEngine *eng)
{
    DECLARE_SELF(QRectF, valid);
    return QScriptValue(eng, self->isValid());
}