mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- Added !SetOption/!SetOptionGroup bangs.
- Script: Added GetOption() function
This commit is contained in:
@ -7,7 +7,7 @@ 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);
|
||||
tolua_pushboolean(L, val);
|
||||
lua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "../../StdAfx.h"
|
||||
#include "../LuaManager.h"
|
||||
#include "../../Measure.h"
|
||||
#include "../../MeterWindow.h"
|
||||
|
||||
static int Measure_GetName(lua_State* L)
|
||||
{
|
||||
@ -11,12 +12,26 @@ static int Measure_GetName(lua_State* L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Measure_GetANSIName(lua_State* L)
|
||||
static int Measure_GetOption(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
const char* val = (const char*)self->GetANSIName();
|
||||
tolua_pushstring(L, (const char*)val);
|
||||
CMeterWindow* meterWindow = self->GetMeterWindow();
|
||||
CConfigParser& parser = meterWindow->GetParser();
|
||||
|
||||
const char* arg = (const char*)tolua_tostring(L, 2, 0);
|
||||
std::wstring strTmp = ConvertToWide(arg);
|
||||
strTmp = parser.GetValue(self->GetName(), strTmp, L"");
|
||||
|
||||
parser.SetBuiltInVariable(L"CURRENTSECTION", self->GetName()); // Set temporarily
|
||||
parser.ReplaceVariables(strTmp);
|
||||
parser.SetBuiltInVariable(L"CURRENTSECTION", L""); // Reset
|
||||
|
||||
if (self->HasDynamicVariables())
|
||||
{
|
||||
parser.ReplaceMeasures(strTmp);
|
||||
}
|
||||
|
||||
push_wchar(L, strTmp.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -36,29 +51,11 @@ static int Measure_Enable(lua_State* L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Measure_IsDisabled(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->IsDisabled();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Measure_HasDynamicVariables(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->HasDynamicVariables();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Measure_GetValue(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
double val = (double)self->GetValue();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -67,7 +64,7 @@ static int Measure_GetRelativeValue(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
double val = (double)self->GetRelativeValue();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -76,7 +73,7 @@ static int Measure_GetValueRange(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
double val = (double)self->GetValueRange();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -85,7 +82,7 @@ static int Measure_GetMinValue(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
double val = (double)self->GetMinValue();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -94,7 +91,7 @@ static int Measure_GetMaxValue(lua_State* L)
|
||||
{
|
||||
CMeasure* self = (CMeasure*)tolua_tousertype(L, 1, 0);
|
||||
double val = (double)self->GetMaxValue();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -115,23 +112,14 @@ static int Measure_GetStringValue(lua_State* L)
|
||||
|
||||
void LuaManager::RegisterMeasure(lua_State* L)
|
||||
{
|
||||
tolua_constant(L, "AUTOSCALE_1024", AUTOSCALE_1024);
|
||||
tolua_constant(L, "AUTOSCALE_1000", AUTOSCALE_1000);
|
||||
tolua_constant(L, "AUTOSCALE_1024K", AUTOSCALE_1024K);
|
||||
tolua_constant(L, "AUTOSCALE_1000K", AUTOSCALE_1000K);
|
||||
tolua_constant(L, "AUTOSCALE_OFF", AUTOSCALE_OFF);
|
||||
tolua_constant(L, "AUTOSCALE_ON", AUTOSCALE_ON);
|
||||
|
||||
tolua_usertype(L, "CMeasure");
|
||||
tolua_cclass(L, "CMeasure", "CMeasure", "CGroup", NULL);
|
||||
|
||||
tolua_beginmodule(L, "CMeasure");
|
||||
tolua_function(L, "GetName", Measure_GetName);
|
||||
tolua_function(L, "GetANSIName", Measure_GetANSIName);
|
||||
tolua_function(L, "GetOption", Measure_GetOption);
|
||||
tolua_function(L, "Disable", Measure_Disable);
|
||||
tolua_function(L, "Enable", Measure_Enable);
|
||||
tolua_function(L, "IsDisabled", Measure_IsDisabled);
|
||||
tolua_function(L, "HasDynamicVariables", Measure_HasDynamicVariables);
|
||||
tolua_function(L, "GetValue", Measure_GetValue);
|
||||
tolua_function(L, "GetRelativeValue", Measure_GetRelativeValue);
|
||||
tolua_function(L, "GetValueRange", Measure_GetValueRange);
|
||||
|
@ -2,12 +2,34 @@
|
||||
#include "../LuaManager.h"
|
||||
#include "../../Meter.h"
|
||||
|
||||
static int Meter_HasDynamicVariables(lua_State* L)
|
||||
static int Meter_GetName(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->HasDynamicVariables();
|
||||
tolua_pushboolean(L, val);
|
||||
const WCHAR* val = (const WCHAR*)self->GetName();
|
||||
push_wchar(L, val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Meter_GetOption(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
CMeterWindow* meterWindow = self->GetMeterWindow();
|
||||
CConfigParser& parser = meterWindow->GetParser();
|
||||
|
||||
const char* arg = (const char*)tolua_tostring(L, 2, 0);
|
||||
std::wstring strTmp = ConvertToWide(arg);
|
||||
strTmp = parser.GetValue(self->GetName(), strTmp, L"");
|
||||
|
||||
parser.SetBuiltInVariable(L"CURRENTSECTION", self->GetName()); // Set temporarily
|
||||
parser.ReplaceVariables(strTmp);
|
||||
parser.SetBuiltInVariable(L"CURRENTSECTION", L""); // Reset
|
||||
|
||||
if (self->HasDynamicVariables())
|
||||
{
|
||||
parser.ReplaceMeasures(strTmp);
|
||||
}
|
||||
|
||||
push_wchar(L, strTmp.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -15,7 +37,7 @@ static int Meter_GetW(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetW();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -24,7 +46,7 @@ static int Meter_GetH(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetH();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
|
||||
@ -35,7 +57,7 @@ static int Meter_GetX(lua_State* L)
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool abs = ((bool)tolua_toboolean(L, 2, false));
|
||||
int val = (int)self->GetX(abs);
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -45,7 +67,7 @@ static int Meter_GetY(lua_State* L)
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool abs = ((bool)tolua_toboolean(L, 2, false));
|
||||
int val = (int)self->GetY(abs);
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -86,60 +108,6 @@ static int Meter_SetY(lua_State* L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Meter_GetToolTipText(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
const std::wstring& val = self->GetToolTipText();
|
||||
push_wchar(L, val.c_str());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Meter_HasToolTip(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->HasToolTip();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Meter_SetToolTipHidden(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool b = (bool)tolua_toboolean(L, 2, 0);
|
||||
self->SetToolTipHidden(b);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Meter_HasMouseAction(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->HasMouseAction();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Meter_HasMouseActionCursor(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->HasMouseActionCursor();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Meter_SetMouseActionCursor(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool b = (bool)tolua_toboolean(L, 2, 0);
|
||||
self->SetMouseActionCursor(b);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Meter_Hide(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
@ -156,30 +124,14 @@ static int Meter_Show(lua_State* L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Meter_IsHidden(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->IsHidden();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Meter_GetName(lua_State* L)
|
||||
{
|
||||
CMeter* self = (CMeter*)tolua_tousertype(L, 1, 0);
|
||||
const WCHAR* val = (const WCHAR*)self->GetName();
|
||||
push_wchar(L, val);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void LuaManager::RegisterMeter(lua_State* L)
|
||||
{
|
||||
tolua_usertype(L, "CMeter");
|
||||
tolua_cclass(L, "CMeter", "CMeter", "CGroup", NULL);
|
||||
|
||||
tolua_beginmodule(L, "CMeter");
|
||||
tolua_function(L, "HasDynamicVariables", Meter_HasDynamicVariables);
|
||||
tolua_function(L, "GetName", Meter_GetName);
|
||||
tolua_function(L, "GetOption", Meter_GetOption);
|
||||
tolua_function(L, "GetW", Meter_GetW);
|
||||
tolua_function(L, "GetH", Meter_GetH);
|
||||
tolua_function(L, "GetX", Meter_GetX);
|
||||
@ -188,15 +140,7 @@ void LuaManager::RegisterMeter(lua_State* L)
|
||||
tolua_function(L, "SetH", Meter_SetH);
|
||||
tolua_function(L, "SetX", Meter_SetX);
|
||||
tolua_function(L, "SetY", Meter_SetY);
|
||||
tolua_function(L, "GetToolTipText", Meter_GetToolTipText);
|
||||
tolua_function(L, "HasToolTip", Meter_HasToolTip);
|
||||
tolua_function(L, "SetToolTipHidden", Meter_SetToolTipHidden);
|
||||
tolua_function(L, "HasMouseAction", Meter_HasMouseAction);
|
||||
tolua_function(L, "HasMouseActionCursor", Meter_HasMouseActionCursor);
|
||||
tolua_function(L, "SetMouseActionCursor", Meter_SetMouseActionCursor);
|
||||
tolua_function(L, "Hide", Meter_Hide);
|
||||
tolua_function(L, "Show", Meter_Show);
|
||||
tolua_function(L, "IsHidden", Meter_IsHidden);
|
||||
tolua_function(L, "GetName", Meter_GetName);
|
||||
tolua_endmodule(L);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ static int MeterString_GetX(lua_State* L)
|
||||
CMeterString* self = (CMeterString*)tolua_tousertype(L, 1, 0);
|
||||
bool abs = (bool)tolua_toboolean(L, 2, false);
|
||||
int val = self->GetX(abs);
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -16,7 +16,7 @@ static int MeterString_Update(lua_State* L)
|
||||
{
|
||||
CMeterString* self = (CMeterString*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->Update();
|
||||
tolua_pushboolean(L, val);
|
||||
lua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ static int MeterWindow_GetW(lua_State* L)
|
||||
{
|
||||
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetW();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -156,7 +156,7 @@ static int MeterWindow_GetH(lua_State* L)
|
||||
{
|
||||
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetH();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -165,7 +165,7 @@ static int MeterWindow_GetX(lua_State* L)
|
||||
{
|
||||
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetX();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -174,7 +174,7 @@ static int MeterWindow_GetY(lua_State* L)
|
||||
{
|
||||
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetY();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -183,7 +183,7 @@ static int MeterWindow_GetXScreen(lua_State* L)
|
||||
{
|
||||
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetXScreen();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -192,7 +192,7 @@ static int MeterWindow_GetYScreen(lua_State* L)
|
||||
{
|
||||
CMeterWindow* self = (CMeterWindow*)tolua_tousertype(L, 1, 0);
|
||||
int val = (int)self->GetYScreen();
|
||||
tolua_pushnumber(L, (lua_Number)val);
|
||||
lua_pushnumber(L, (lua_Number)val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,61 +0,0 @@
|
||||
#include "../../StdAfx.h"
|
||||
#include "../LuaManager.h"
|
||||
#include "../../Rainmeter.h"
|
||||
|
||||
static int Rainmeter_GetConfigEditor(lua_State* L)
|
||||
{
|
||||
CRainmeter* self = (CRainmeter*)tolua_tousertype(L, 1, 0);
|
||||
const std::wstring& val = self->GetConfigEditor();
|
||||
push_wstring(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Rainmeter_GetLogViewer(lua_State* L)
|
||||
{
|
||||
CRainmeter* self = (CRainmeter*)tolua_tousertype(L, 1, 0);
|
||||
const std::wstring& val = self->GetLogViewer();
|
||||
push_wstring(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Rainmeter_GetStatsDate(lua_State* L)
|
||||
{
|
||||
CRainmeter* self = (CRainmeter*)tolua_tousertype(L, 1, 0);
|
||||
const std::wstring& val = self->GetStatsDate();
|
||||
push_wstring(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Rainmeter_GetDebug(lua_State* L)
|
||||
{
|
||||
bool val = CRainmeter::GetDebug();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Rainmeter_IsMenuActive(lua_State* L)
|
||||
{
|
||||
CRainmeter* self = (CRainmeter*)tolua_tousertype(L, 1, 0);
|
||||
bool val = self->IsMenuActive();
|
||||
tolua_pushboolean(L, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void LuaManager::RegisterRainmeter(lua_State* L)
|
||||
{
|
||||
tolua_usertype(L, "CRainmeter");
|
||||
tolua_cclass(L, "CRainmeter", "CRainmeter", "", NULL);
|
||||
|
||||
tolua_beginmodule(L, "CRainmeter");
|
||||
tolua_function(L, "GetConfigEditor", Rainmeter_GetConfigEditor);
|
||||
tolua_function(L, "GetLogViewer", Rainmeter_GetLogViewer);
|
||||
tolua_function(L, "GetStatsDate", Rainmeter_GetStatsDate);
|
||||
tolua_function(L, "GetDebug", Rainmeter_GetDebug);
|
||||
tolua_function(L, "IsMenuActive", Rainmeter_IsMenuActive);
|
||||
tolua_endmodule(L);
|
||||
}
|
@ -1,116 +0,0 @@
|
||||
/*
|
||||
** Lua binding: meter_image
|
||||
** Generated automatically by tolua++-1.0.92 on 02/15/11 03:01:12.
|
||||
*/
|
||||
|
||||
#include "../../StdAfx.h"
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include "stdlib.h"
|
||||
#endif
|
||||
#include "string.h"
|
||||
|
||||
#include "tolua++.h"
|
||||
|
||||
/* Exported function */
|
||||
TOLUA_API int tolua_meter_image_open (lua_State* tolua_S);
|
||||
|
||||
#include "../../MeterImage.h"
|
||||
#include "../LuaPush.h"
|
||||
|
||||
/* function to register type */
|
||||
static void tolua_reg_types (lua_State* tolua_S)
|
||||
{
|
||||
tolua_usertype(tolua_S,"CMeterImage");
|
||||
tolua_usertype(tolua_S,"WCHAR");
|
||||
tolua_usertype(tolua_S,"CMeter");
|
||||
}
|
||||
|
||||
/* method: SetImage of class CMeterImage */
|
||||
#ifndef TOLUA_DISABLE_tolua_meter_image_CMeterImage_SetImage00
|
||||
static int tolua_meter_image_CMeterImage_SetImage00(lua_State* tolua_S)
|
||||
{
|
||||
#ifndef TOLUA_RELEASE
|
||||
tolua_Error tolua_err;
|
||||
if (
|
||||
!tolua_isusertype(tolua_S,1,"CMeterImage",0,&tolua_err) ||
|
||||
!is_wchar(tolua_S,2,"const WCHAR",0,&tolua_err) ||
|
||||
!tolua_isnoobj(tolua_S,3,&tolua_err)
|
||||
)
|
||||
goto tolua_lerror;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
CMeterImage* self = (CMeterImage*) tolua_tousertype(tolua_S,1,0);
|
||||
const WCHAR* imageName = ((const WCHAR*) to_wchar(tolua_S,2,0));
|
||||
#ifndef TOLUA_RELEASE
|
||||
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetImage'", NULL);
|
||||
#endif
|
||||
{
|
||||
self->SetImage(imageName);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
#ifndef TOLUA_RELEASE
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'SetImage'.",&tolua_err);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif //#ifndef TOLUA_DISABLE
|
||||
|
||||
/* method: GetImage of class CMeterImage */
|
||||
#ifndef TOLUA_DISABLE_tolua_meter_image_CMeterImage_GetImage00
|
||||
static int tolua_meter_image_CMeterImage_GetImage00(lua_State* tolua_S)
|
||||
{
|
||||
#ifndef TOLUA_RELEASE
|
||||
tolua_Error tolua_err;
|
||||
if (
|
||||
!tolua_isusertype(tolua_S,1,"CMeterImage",0,&tolua_err) ||
|
||||
!tolua_isnoobj(tolua_S,2,&tolua_err)
|
||||
)
|
||||
goto tolua_lerror;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
CMeterImage* self = (CMeterImage*) tolua_tousertype(tolua_S,1,0);
|
||||
#ifndef TOLUA_RELEASE
|
||||
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetImage'", NULL);
|
||||
#endif
|
||||
{
|
||||
const WCHAR* tolua_ret = (const WCHAR*) self->GetImage();
|
||||
push_wchar(tolua_S,(void*)tolua_ret,"const WCHAR");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
#ifndef TOLUA_RELEASE
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'GetImage'.",&tolua_err);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif //#ifndef TOLUA_DISABLE
|
||||
|
||||
/* Open function */
|
||||
TOLUA_API int tolua_meter_image_open (lua_State* tolua_S)
|
||||
{
|
||||
tolua_open(tolua_S);
|
||||
tolua_reg_types(tolua_S);
|
||||
tolua_module(tolua_S,NULL,0);
|
||||
tolua_beginmodule(tolua_S,NULL);
|
||||
tolua_cclass(tolua_S,"CMeterImage","CMeterImage","CMeter",NULL);
|
||||
tolua_beginmodule(tolua_S,"CMeterImage");
|
||||
tolua_function(tolua_S,"SetImage",tolua_meter_image_CMeterImage_SetImage00);
|
||||
tolua_function(tolua_S,"GetImage",tolua_meter_image_CMeterImage_GetImage00);
|
||||
tolua_endmodule(tolua_S);
|
||||
tolua_endmodule(tolua_S);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
|
||||
TOLUA_API int luaopen_meter_image (lua_State* tolua_S) {
|
||||
return tolua_meter_image_open(tolua_S);
|
||||
};
|
||||
#endif
|
||||
|
@ -1,11 +0,0 @@
|
||||
$#include "../../MeterImage.h"
|
||||
$#include "../LuaPush.h"
|
||||
|
||||
class CMeterImage : public CMeter
|
||||
{
|
||||
public:
|
||||
|
||||
void SetImage(const WCHAR* imageName);
|
||||
const WCHAR* GetImage();
|
||||
|
||||
};
|
Reference in New Issue
Block a user