mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
New plugin API: Added rm parameter to Initialize.
This commit is contained in:
parent
b65b26c2b7
commit
85e59b5583
@ -180,7 +180,7 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
|
||||
if (initializeFunc)
|
||||
{
|
||||
((NEWINITIALIZE)initializeFunc)(&m_PluginData);
|
||||
((NEWINITIALIZE)initializeFunc)(&m_PluginData, this);
|
||||
}
|
||||
|
||||
((NEWRELOAD)m_ReloadFunc)(m_PluginData, this, &m_MaxValue);
|
||||
|
@ -29,7 +29,7 @@ typedef double (*UPDATE2)(UINT);
|
||||
typedef LPCTSTR (*GETSTRING)(UINT, UINT);
|
||||
typedef void (*EXECUTEBANG)(LPCWSTR, UINT);
|
||||
|
||||
typedef void (*NEWINITIALIZE)(void*);
|
||||
typedef void (*NEWINITIALIZE)(void*, void*);
|
||||
typedef void (*NEWRELOAD)(void*, void*, double*);
|
||||
typedef void (*NEWFINALIZE)(void*);
|
||||
typedef double (*NEWUPDATE)(void*);
|
||||
|
@ -49,7 +49,7 @@ eMeasureType convertStringToMeasureType(LPCWSTR i_String);
|
||||
bool areStringsEqual(LPCWSTR i_String1, LPCWSTR i_Strting2);
|
||||
float getHighestTemp();
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -47,7 +47,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
Measure* measure = new Measure;
|
||||
*data = measure;
|
||||
|
@ -48,7 +48,7 @@ struct MeasureData
|
||||
static CRITICAL_SECTION g_CriticalSection;
|
||||
static UINT g_Instances = 0;
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -62,7 +62,7 @@ void NullCRTInvalidParameterHandler(const wchar_t* expression, const wchar_t* fu
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -37,7 +37,7 @@ static std::vector<MeasureData*> g_Measures;
|
||||
|
||||
void CheckProcesses();
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
g_Measures.push_back(measure);
|
||||
@ -77,6 +77,13 @@ PLUGIN_EXPORT void Finalize(void* data)
|
||||
delete measure;
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT void ExecuteBang(void* data, LPCWSTR params[], int count)
|
||||
{
|
||||
if (count >= 1) MessageBox(NULL, params[0], NULL, MB_OK | MB_TOPMOST);
|
||||
if (count >= 2) MessageBox(NULL, params[1], NULL, MB_OK | MB_TOPMOST);
|
||||
if (count >= 3) MessageBox(NULL, params[2], NULL, MB_OK | MB_TOPMOST);
|
||||
}
|
||||
|
||||
void CheckProcesses()
|
||||
{
|
||||
// Set everything to false
|
||||
|
@ -112,7 +112,7 @@ void ScanFolder(std::vector<std::wstring>& files, std::vector<std::wstring>& fil
|
||||
while (FindNextFile(hSearch, &fileData));
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -38,7 +38,7 @@ struct MeasureData
|
||||
MeasureData() : type(NUMRECYCLE) {}
|
||||
};
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -59,7 +59,7 @@ BOOL CALLBACK EnumWindowProc(HWND hWnd, LPARAM lParam)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -65,7 +65,7 @@ struct MeasureData
|
||||
|
||||
void ReadSharedData(SensorType type, ScaleType scale, UINT number, double* value);
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
@ -34,7 +34,7 @@ struct MeasureData
|
||||
MeasureData() : wParam(), lParam(), uMsg() {}
|
||||
};
|
||||
|
||||
PLUGIN_EXPORT void Initialize(void** data)
|
||||
PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
||||
{
|
||||
MeasureData* measure = new MeasureData;
|
||||
*data = measure;
|
||||
|
Loading…
Reference in New Issue
Block a user