- Added ability to escape real variables and measures as follows: #*RealVar*# [*RealMeasure*]

- NowPlayingPlugin: Addition change to r880 OpenPlayer fix
- Removing tolua++ generation package files
This commit is contained in:
Birunthan Mohanathas
2011-07-29 17:18:21 +00:00
parent d7dedcfc75
commit e74d6f4619
13 changed files with 77 additions and 224 deletions

View File

@ -1,23 +0,0 @@
#include "../../StdAfx.h"
#include "../LuaManager.h"
#include "../../Group.h"
static int Group_BelongsToGroup(lua_State* L)
{
CGroup* self = (CGroup*)tolua_tousertype(L, 1, 0);
const std::wstring group = (const std::wstring)to_wstring(L, 2, 0);
bool val = self->BelongsToGroup(group);
lua_pushboolean(L, val);
return 1;
}
void LuaManager::RegisterGroup(lua_State* L)
{
tolua_usertype(L, "CGroup");
tolua_cclass(L, "CGroup", "CGroup", "", NULL);
tolua_beginmodule(L, "CGroup");
tolua_function(L, "BelongsToGroup", Group_BelongsToGroup);
tolua_endmodule(L);
}

View File

@ -25,11 +25,7 @@ static int Measure_GetOption(lua_State* L)
parser.SetBuiltInVariable(L"CURRENTSECTION", self->GetName()); // Set temporarily
parser.ReplaceVariables(strTmp);
parser.SetBuiltInVariable(L"CURRENTSECTION", L""); // Reset
if (self->HasDynamicVariables())
{
parser.ReplaceMeasures(strTmp);
}
parser.ReplaceMeasures(strTmp);
push_wchar(L, strTmp.c_str());
return 1;
@ -113,7 +109,7 @@ static int Measure_GetStringValue(lua_State* L)
void LuaManager::RegisterMeasure(lua_State* L)
{
tolua_usertype(L, "CMeasure");
tolua_cclass(L, "CMeasure", "CMeasure", "CGroup", NULL);
tolua_cclass(L, "CMeasure", "CMeasure", "", NULL);
tolua_beginmodule(L, "CMeasure");
tolua_function(L, "GetName", Measure_GetName);

View File

@ -23,11 +23,7 @@ static int Meter_GetOption(lua_State* L)
parser.SetBuiltInVariable(L"CURRENTSECTION", self->GetName()); // Set temporarily
parser.ReplaceVariables(strTmp);
parser.SetBuiltInVariable(L"CURRENTSECTION", L""); // Reset
if (self->HasDynamicVariables())
{
parser.ReplaceMeasures(strTmp);
}
parser.ReplaceMeasures(strTmp);
push_wchar(L, strTmp.c_str());
return 1;
@ -127,7 +123,7 @@ static int Meter_Show(lua_State* L)
void LuaManager::RegisterMeter(lua_State* L)
{
tolua_usertype(L, "CMeter");
tolua_cclass(L, "CMeter", "CMeter", "CGroup", NULL);
tolua_cclass(L, "CMeter", "CMeter", "", NULL);
tolua_beginmodule(L, "CMeter");
tolua_function(L, "GetName", Meter_GetName);

View File

@ -4,106 +4,6 @@
#include "../../MeterWindow.h"
#include "../../MeterString.h"
static int MeterWindow_MoveMeter(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
int x = (int)tolua_tonumber(L, 2, 0);
int y = (int)tolua_tonumber(L, 3, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 4, 0));
self->MoveMeter(x, y, name);
return 0;
}
static int MeterWindow_HideMeter(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->HideMeter(name, group);
return 0;
}
static int MeterWindow_ShowMeter(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->ShowMeter(name, group);
return 0;
}
static int MeterWindow_ToggleMeter(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->ToggleMeter(name, group);
return 0;
}
static int MeterWindow_UpdateMeter(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->UpdateMeter(name, group);
return 0;
}
static int MeterWindow_DisableMeasure(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->DisableMeasure(name, group);
return 0;
}
static int MeterWindow_EnableMeasure(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->EnableMeasure(name, group);
return 0;
}
static int MeterWindow_ToggleMeasure(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->ToggleMeasure(name, group);
return 0;
}
static int MeterWindow_UpdateMeasure(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
const WCHAR* name = ((const WCHAR*)to_wchar(L, 2, 0));
bool group = ((bool)tolua_toboolean(L, 3, false));
self->UpdateMeasure(name, group);
return 0;
}
static int MeterWindow_Redraw(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
self->Redraw();
return 0;
}
static int MeterWindow_MoveWindow(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
@ -179,24 +79,6 @@ static int MeterWindow_GetY(lua_State* L)
return 1;
}
static int MeterWindow_GetXScreen(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
int val = (int)self->GetXScreen();
lua_pushnumber(L, (lua_Number)val);
return 1;
}
static int MeterWindow_GetYScreen(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
int val = (int)self->GetYScreen();
lua_pushnumber(L, (lua_Number)val);
return 1;
}
static int MeterWindow_MakePathAbsolute(lua_State* L)
{
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
@ -294,19 +176,9 @@ static int MeterWindow_Bang(lua_State* L)
void LuaManager::RegisterMeterWindow(lua_State* L)
{
tolua_usertype(L, "CMeterWindow");
tolua_cclass(L, "CMeterWindow", "CMeterWindow", "CGroup", NULL);
tolua_cclass(L, "CMeterWindow", "CMeterWindow", "", NULL);
tolua_beginmodule(L, "CMeterWindow");
tolua_function(L, "MoveMeter", MeterWindow_MoveMeter);
tolua_function(L, "HideMeter", MeterWindow_HideMeter);
tolua_function(L, "ShowMeter", MeterWindow_ShowMeter);
tolua_function(L, "ToggleMeter", MeterWindow_ToggleMeter);
tolua_function(L, "UpdateMeter", MeterWindow_UpdateMeter);
tolua_function(L, "DisableMeasure", MeterWindow_DisableMeasure);
tolua_function(L, "EnableMeasure", MeterWindow_EnableMeasure);
tolua_function(L, "ToggleMeasure", MeterWindow_ToggleMeasure);
tolua_function(L, "UpdateMeasure", MeterWindow_UpdateMeasure);
tolua_function(L, "Redraw", MeterWindow_Redraw);
tolua_function(L, "MoveWindow", MeterWindow_MoveWindow);
tolua_function(L, "FadeWindow", MeterWindow_FadeWindow);
tolua_function(L, "GetSkinName", MeterWindow_GetSkinName);
@ -315,8 +187,6 @@ void LuaManager::RegisterMeterWindow(lua_State* L)
tolua_function(L, "GetH", MeterWindow_GetH);
tolua_function(L, "GetX", MeterWindow_GetX);
tolua_function(L, "GetY", MeterWindow_GetY);
tolua_function(L, "GetXScreen", MeterWindow_GetXScreen);
tolua_function(L, "GetYScreen", MeterWindow_GetYScreen);
tolua_function(L, "MakePathAbsolute", MeterWindow_MakePathAbsolute);
tolua_function(L, "GetMeter", MeterWindow_GetMeter);
tolua_function(L, "GetMeasure", MeterWindow_GetMeasure);