Added Lua Stuff

There are a few changes to the core Rainmeter code.
This commit is contained in:
mapeki
2010-12-12 17:08:36 +00:00
parent 416232dff2
commit c516bf8310
96 changed files with 26523 additions and 7 deletions

View File

@ -31,6 +31,7 @@
#include "MeasurePlugin.h"
#include "MeterButton.h"
#include "TintedImage.h"
#include "MeasureScript.h"
using namespace Gdiplus;
@ -330,6 +331,7 @@ void CMeterWindow::Refresh(bool init, bool all)
delete (*i);
}
m_Measures.clear();
m_ScriptMeasures.clear();
std::list<CMeter*>::iterator j = m_Meters.begin();
for( ; j != m_Meters.end(); ++j)
@ -1926,6 +1928,12 @@ bool CMeterWindow::ReadSkin()
{
m_HasNetMeasures = true;
}
CMeasureScript* measureScript = dynamic_cast<CMeasureScript*>(measure);
if(measureScript)
{
m_ScriptMeasures.push_back(measureScript);
}
}
}
else if (meterName.length() > 0)
@ -4016,6 +4024,12 @@ bool CMeterWindow::DoAction(int x, int y, MOUSE mouse, bool test)
if ((*j)->HitTest(x, y))
{
std::list<CMeasureScript*>::iterator k = m_ScriptMeasures.begin();
for( ; k != m_ScriptMeasures.end(); ++k)
{
(*k)->MeterMouseEvent((*j), mouse);
}
switch (mouse)
{
case MOUSE_LMB_DOWN:
@ -4603,3 +4617,44 @@ std::wstring CMeterWindow::MakePathAbsolute(const std::wstring& path)
return root + path;
}
CMeter* CMeterWindow::GetMeter(std::wstring meterName)
{
std::list<CMeter*>::const_iterator j = m_Meters.begin();
for( ; j != m_Meters.end(); ++j)
{
if (_wcsicmp((*j)->GetName(), meterName.c_str()) == 0)
{
return (*j);
}
}
return 0;
}
CMeasure* CMeterWindow::GetMeasure(std::wstring measureName)
{
std::list<CMeasure*>::const_iterator j = m_Measures.begin();
for( ; j != m_Measures.end(); ++j)
{
if (_wcsicmp((*j)->GetName(), measureName.c_str()) == 0)
{
return (*j);
}
}
return 0;
}
const char* CMeterWindow::ReplaceVariables(const char* p_str)
{
static std::string aStr = "";
std::wstring value = ConvertToWide(p_str);
m_Parser.ReplaceVariables(value);
m_Parser.ReplaceMeasures(value);
aStr = ConvertToAscii(value.c_str());
const char* str = aStr.c_str();
return str;
}