mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Updated plugin API
- Added new option to RmGet(): RMG_SKINNAME, RMG_SKINWINDOWHANDLE
This commit is contained in:
parent
71601d7564
commit
53f5ceb674
@ -78,6 +78,20 @@ void* __stdcall RmGet(void* rm, int type)
|
||||
{
|
||||
return (void*)Rainmeter->GetDataFile().c_str();
|
||||
}
|
||||
|
||||
case RMG_SKINNAME:
|
||||
{
|
||||
CMeterWindow* window = measure->GetMeterWindow();
|
||||
if (!window) break;
|
||||
return (void*)window->GetFolderPath().c_str();
|
||||
}
|
||||
|
||||
case RMG_SKINWINDOWHANDLE:
|
||||
{
|
||||
CMeterWindow* window = measure->GetMeterWindow();
|
||||
if (!window) break;
|
||||
return (void*)window->GetWindow();
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -64,9 +64,9 @@ namespace Rainmeter
|
||||
Debug = 4
|
||||
}
|
||||
|
||||
public unsafe string ReadString(string option, string defValue)
|
||||
public unsafe string ReadString(string option, string defValue, bool replaceMeasures = true)
|
||||
{
|
||||
char* value = RmReadString((void*)m_Rm, ToUnsafe(option), ToUnsafe(defValue), 1);
|
||||
char* value = RmReadString((void*)m_Rm, ToUnsafe(option), ToUnsafe(defValue), replaceMeasures ? 1 : 0);
|
||||
return new string(value);
|
||||
}
|
||||
|
||||
@ -98,6 +98,23 @@ namespace Rainmeter
|
||||
return (IntPtr)RmGet((void*)m_Rm, 1);
|
||||
}
|
||||
|
||||
public unsafe string GetSettingsFile()
|
||||
{
|
||||
char* value = (char*)RmGet((void*)m_Rm, 2);
|
||||
return new string(value);
|
||||
}
|
||||
|
||||
public unsafe string GetSkinName()
|
||||
{
|
||||
char* value = (char*)RmGet((void*)m_Rm, 3);
|
||||
return new string(value);
|
||||
}
|
||||
|
||||
public unsafe IntPtr GetSkinWindow()
|
||||
{
|
||||
return (IntPtr)RmGet((void*)m_Rm, 4);
|
||||
}
|
||||
|
||||
public static unsafe void Execute(IntPtr skin, string command)
|
||||
{
|
||||
RmExecute((void*)skin, ToUnsafe(command));
|
||||
|
@ -49,7 +49,9 @@ enum RmGetType
|
||||
{
|
||||
RMG_MEASURENAME = 0,
|
||||
RMG_SKIN = 1,
|
||||
RMG_SETTINGSFILE = 2
|
||||
RMG_SETTINGSFILE = 2,
|
||||
RMG_SKINNAME = 3,
|
||||
RMG_SKINWINDOWHANDLE = 4
|
||||
};
|
||||
|
||||
LIBRARY_EXPORT BOOL LSLog(int type, LPCWSTR unused, LPCWSTR message);
|
||||
@ -90,6 +92,16 @@ __inline void* RmGetSkin(void* rm)
|
||||
return (void*)RmGet(rm, RMG_SKIN);
|
||||
}
|
||||
|
||||
__inline LPCWSTR RmGetSkinName(void* rm)
|
||||
{
|
||||
return (LPCWSTR)RmGet(rm, RMG_SKINNAME);
|
||||
}
|
||||
|
||||
__inline void* RmGetSkinWindow(void* rm)
|
||||
{
|
||||
return (void*)RmGet(rm, RMG_SKINWINDOWHANDLE);
|
||||
}
|
||||
|
||||
__inline void RmLog(int level, LPCWSTR message)
|
||||
{
|
||||
LSLog(level, NULL, message);
|
||||
|
Loading…
Reference in New Issue
Block a user