Added JamesAC's new bangs to change "settings" in Rainmeter.ini for one / group / all skins at once.

!RainmeterDraggable/!RainmeterDraggableGroup
!RainmeterKeepOnScreen/!RainmeterKeepOnScreenGroup
!RainmeterClickThrough/!RainmeterClickThroughGroup
!RainmeterSnapEdges/!RainmeterSnapEdgesGroup

!RainmeterSnapEdges [parm1] (Config | *)
!RainmeterSnapEdgesGroup [parm1] [GroupName]

Parm1:
-1 toggles the setting.
0 forces the setting to off.
1 forces to setting to on.
This commit is contained in:
jsmorley 2010-08-22 12:08:38 +00:00
parent 2edde5af1c
commit 10f0640298
6 changed files with 224 additions and 6 deletions

View File

@ -28,8 +28,8 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,507 FILEVERSION 1,3,0,513
PRODUCTVERSION 1,3,0,507 PRODUCTVERSION 1,3,0,513
FILEFLAGSMASK 0x17L FILEFLAGSMASK 0x17L
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -45,12 +45,12 @@ BEGIN
BLOCK "040b04b0" BLOCK "040b04b0"
BEGIN BEGIN
VALUE "FileDescription", "Rainmeter - A Customizable Resource Meter" VALUE "FileDescription", "Rainmeter - A Customizable Resource Meter"
VALUE "FileVersion", "1, 3, 0, 507" VALUE "FileVersion", "1, 3, 0, 513"
VALUE "InternalName", "Rainmeter" VALUE "InternalName", "Rainmeter"
VALUE "LegalCopyright", "Copyright (C) 2010 - Rainy" VALUE "LegalCopyright", "Copyright (C) 2010 - Rainy"
VALUE "OriginalFilename", "Rainmeter.exe" VALUE "OriginalFilename", "Rainmeter.exe"
VALUE "ProductName", "Rainmeter" VALUE "ProductName", "Rainmeter"
VALUE "ProductVersion", "1, 3, 0, 507" VALUE "ProductVersion", "1, 3, 0, 513"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -771,6 +771,76 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
ChangeZPos((ZPOSITION)_wtoi(arg)); ChangeZPos((ZPOSITION)_wtoi(arg));
break; break;
case BANG_CLICKTHROUGH:
if (_wtoi(arg) == -1)
{
m_ClickThrough = !m_ClickThrough;
}
else
{
m_ClickThrough = _wtoi(arg);
}
WriteConfig();
if (!m_ClickThrough)
{
// Remove transparent flag
LONG style = GetWindowLong(m_Window, GWL_EXSTYLE);
if ((style & WS_EX_TRANSPARENT) != 0)
{
SetWindowLong(m_Window, GWL_EXSTYLE, style & ~WS_EX_TRANSPARENT);
}
}
break;
case BANG_DRAGGABLE:
if (_wtoi(arg) == -1)
{
m_WindowDraggable = !m_WindowDraggable;
}
else
{
m_WindowDraggable = _wtoi(arg);
}
WriteConfig();
break;
case BANG_SNAPEDGES:
if (_wtoi(arg) == -1)
{
m_SnapEdges = !m_SnapEdges;
}
else
{
m_SnapEdges = _wtoi(arg);
}
WriteConfig();
break;
case BANG_KEEPONSCREEN:
if (_wtoi(arg) == -1)
{
m_KeepOnScreen = !m_KeepOnScreen;
}
else
{
m_KeepOnScreen = _wtoi(arg);
}
WriteConfig();
if (m_KeepOnScreen)
{
int x = m_ScreenX;
int y = m_ScreenY;
MapCoordsToScreen(x, y, m_WindowW, m_WindowH);
if (x != m_ScreenX || y != m_ScreenY)
{
MoveWindow(x, y);
}
}
break;
case BANG_SETTRANSPARENCY: case BANG_SETTRANSPARENCY:
if (arg != NULL) if (arg != NULL)
{ {

View File

@ -113,6 +113,10 @@ enum BANGCOMMAND
BANG_MOVE, BANG_MOVE,
BANG_ZPOS, BANG_ZPOS,
BANG_SETTRANSPARENCY, BANG_SETTRANSPARENCY,
BANG_CLICKTHROUGH,
BANG_DRAGGABLE,
BANG_SNAPEDGES,
BANG_KEEPONSCREEN,
BANG_TOGGLEMETERGROUP, BANG_TOGGLEMETERGROUP,
BANG_SHOWMETERGROUP, BANG_SHOWMETERGROUP,

View File

@ -591,6 +591,50 @@ void RainmeterZPos(HWND, const char* arg)
BangWithArgs(BANG_ZPOS, ConvertToWide(arg).c_str(), 1); BangWithArgs(BANG_ZPOS, ConvertToWide(arg).c_str(), 1);
} }
/*
** RainmeterClickThrough
**
** Callback for the !RainmeterClickThrough bang
**
*/
void RainmeterClickThrough(HWND, const char* arg)
{
BangWithArgs(BANG_CLICKTHROUGH, ConvertToWide(arg).c_str(), 1);
}
/*
** RainmeterDraggable
**
** Callback for the !RainmeterDraggable bang
**
*/
void RainmeterDraggable(HWND, const char* arg)
{
BangWithArgs(BANG_DRAGGABLE, ConvertToWide(arg).c_str(), 1);
}
/*
** RainmeterSnapEdges
**
** Callback for the !RainmeterSnapEdges bang
**
*/
void RainmeterSnapEdges(HWND, const char* arg)
{
BangWithArgs(BANG_SNAPEDGES, ConvertToWide(arg).c_str(), 1);
}
/*
** RainmeterKeepOnScreen
**
** Callback for the !RainmeterKeepOnScreen bang
**
*/
void RainmeterKeepOnScreen(HWND, const char* arg)
{
BangWithArgs(BANG_KEEPONSCREEN, ConvertToWide(arg).c_str(), 1);
}
/* /*
** RainmeterSetTransparency ** RainmeterSetTransparency
** **
@ -808,6 +852,50 @@ void RainmeterZPosGroup(HWND, const char* arg)
BangGroupWithArgs(BANG_ZPOS, ConvertToWide(arg).c_str(), 1); BangGroupWithArgs(BANG_ZPOS, ConvertToWide(arg).c_str(), 1);
} }
/*
** RainmeterClickThroughGroup
**
** Callback for the !RainmeterClickThroughGroup bang
**
*/
void RainmeterClickThroughGroup(HWND, const char* arg)
{
BangGroupWithArgs(BANG_CLICKTHROUGH, ConvertToWide(arg).c_str(), 1);
}
/*
** RainmeterDraggableGroup
**
** Callback for the !RainmeterDraggableGroup bang
**
*/
void RainmeterDraggableGroup(HWND, const char* arg)
{
BangGroupWithArgs(BANG_DRAGGABLE, ConvertToWide(arg).c_str(), 1);
}
/*
** RainmeterSnapEdgesGroup
**
** Callback for the !RainmeterSnapEdgesGroup bang
**
*/
void RainmeterSnapEdgesGroup(HWND, const char* arg)
{
BangGroupWithArgs(BANG_SNAPEDGES, ConvertToWide(arg).c_str(), 1);
}
/*
** RainmeterKeepOnScreenGroup
**
** Callback for the !RainmeterKeepOnScreenGroup bang
**
*/
void RainmeterKeepOnScreenGroup(HWND, const char* arg)
{
BangGroupWithArgs(BANG_KEEPONSCREEN, ConvertToWide(arg).c_str(), 1);
}
/* /*
** RainmeterSetTransparencyGroup ** RainmeterSetTransparencyGroup
** **
@ -1463,6 +1551,10 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
AddBangCommand("!RainmeterToggleConfig", RainmeterToggleConfig); AddBangCommand("!RainmeterToggleConfig", RainmeterToggleConfig);
AddBangCommand("!RainmeterMove", RainmeterMove); AddBangCommand("!RainmeterMove", RainmeterMove);
AddBangCommand("!RainmeterZPos", RainmeterZPos); AddBangCommand("!RainmeterZPos", RainmeterZPos);
AddBangCommand("!RainmeterClickThrough", RainmeterClickThrough);
AddBangCommand("!RainmeterDraggable", RainmeterDraggable);
AddBangCommand("!RainmeterSnapEdges", RainmeterSnapEdges);
AddBangCommand("!RainmeterKeepOnScreen", RainmeterKeepOnScreen);
AddBangCommand("!RainmeterSetTransparency", RainmeterSetTransparency); AddBangCommand("!RainmeterSetTransparency", RainmeterSetTransparency);
AddBangCommand("!RainmeterSetVariable", RainmeterSetVariable); AddBangCommand("!RainmeterSetVariable", RainmeterSetVariable);
@ -1482,6 +1574,10 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
AddBangCommand("!RainmeterToggleMeasureGroup", RainmeterToggleMeasureGroup); AddBangCommand("!RainmeterToggleMeasureGroup", RainmeterToggleMeasureGroup);
AddBangCommand("!RainmeterDeactivateConfigGroup", RainmeterDeactivateConfigGroup); AddBangCommand("!RainmeterDeactivateConfigGroup", RainmeterDeactivateConfigGroup);
AddBangCommand("!RainmeterZPosGroup", RainmeterZPosGroup); AddBangCommand("!RainmeterZPosGroup", RainmeterZPosGroup);
AddBangCommand("!RainmeterClickThroughGroup", RainmeterClickThroughGroup);
AddBangCommand("!RainmeterDraggableGroup", RainmeterDraggableGroup);
AddBangCommand("!RainmeterSnapEdgesGroup", RainmeterSnapEdgesGroup);
AddBangCommand("!RainmeterKeepOnScreenGroup", RainmeterKeepOnScreenGroup);
AddBangCommand("!RainmeterSetTransparencyGroup", RainmeterSetTransparencyGroup); AddBangCommand("!RainmeterSetTransparencyGroup", RainmeterSetTransparencyGroup);
AddBangCommand("!RainmeterSetVariableGroup", RainmeterSetVariableGroup); AddBangCommand("!RainmeterSetVariableGroup", RainmeterSetVariableGroup);
@ -2013,6 +2109,10 @@ void CRainmeter::Quit(HINSTANCE dllInst)
RemoveBangCommand("!RainmeterToggleConfig"); RemoveBangCommand("!RainmeterToggleConfig");
RemoveBangCommand("!RainmeterMove"); RemoveBangCommand("!RainmeterMove");
RemoveBangCommand("!RainmeterZPos"); RemoveBangCommand("!RainmeterZPos");
RemoveBangCommand("!RainmeterClickThrough");
RemoveBangCommand("!RainmeterDraggable");
RemoveBangCommand("!RainmeterSnapEdges");
RemoveBangCommand("!RainmeterKeepOnScreen");
RemoveBangCommand("!RainmeterSetTransparency"); RemoveBangCommand("!RainmeterSetTransparency");
RemoveBangCommand("!RainmeterSetVariable"); RemoveBangCommand("!RainmeterSetVariable");
@ -2032,6 +2132,10 @@ void CRainmeter::Quit(HINSTANCE dllInst)
RemoveBangCommand("!RainmeterToggleMeasureGroup"); RemoveBangCommand("!RainmeterToggleMeasureGroup");
RemoveBangCommand("!RainmeterDeactivateConfigGroup"); RemoveBangCommand("!RainmeterDeactivateConfigGroup");
RemoveBangCommand("!RainmeterZPosGroup"); RemoveBangCommand("!RainmeterZPosGroup");
RemoveBangCommand("!RainmeterClickThroughGroup");
RemoveBangCommand("!RainmeterDraggableGroup");
RemoveBangCommand("!RainmeterSnapEdgesGroup");
RemoveBangCommand("!RainmeterKeepOnScreenGroup");
RemoveBangCommand("!RainmeterSetTransparencyGroup"); RemoveBangCommand("!RainmeterSetTransparencyGroup");
RemoveBangCommand("!RainmeterSetVariableGroup"); RemoveBangCommand("!RainmeterSetVariableGroup");
@ -2269,6 +2373,22 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
{ {
BangWithArgs(BANG_ZPOS, arg.c_str(), 1); BangWithArgs(BANG_ZPOS, arg.c_str(), 1);
} }
else if (wcsicmp(bang.c_str(), L"!RainmeterClickThrough") == 0)
{
BangWithArgs(BANG_CLICKTHROUGH, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDraggable") == 0)
{
BangWithArgs(BANG_DRAGGABLE, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSnapEdges") == 0)
{
BangWithArgs(BANG_SNAPEDGES, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterKeepOnScreen") == 0)
{
BangWithArgs(BANG_KEEPONSCREEN, arg.c_str(), 1);
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSetTransparency") == 0) else if (wcsicmp(bang.c_str(), L"!RainmeterSetTransparency") == 0)
{ {
BangWithArgs(BANG_SETTRANSPARENCY, arg.c_str(), 1); BangWithArgs(BANG_SETTRANSPARENCY, arg.c_str(), 1);
@ -2341,6 +2461,22 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
{ {
RainmeterZPosGroup(NULL, ConvertToAscii(arg.c_str()).c_str()); RainmeterZPosGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
} }
else if (wcsicmp(bang.c_str(), L"!RainmeterClickThroughGroup") == 0)
{
RainmeterClickThroughGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterDraggableGroup") == 0)
{
RainmeterDraggableGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSnapEdgesGroup") == 0)
{
RainmeterSnapEdgesGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterKeepOnScreenGroup") == 0)
{
RainmeterKeepOnScreenGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
}
else if (wcsicmp(bang.c_str(), L"!RainmeterSetTransparencyGroup") == 0) else if (wcsicmp(bang.c_str(), L"!RainmeterSetTransparencyGroup") == 0)
{ {
RainmeterSetTransparencyGroup(NULL, ConvertToAscii(arg.c_str()).c_str()); RainmeterSetTransparencyGroup(NULL, ConvertToAscii(arg.c_str()).c_str());
@ -3642,7 +3778,7 @@ void CRainmeter::TestSettingsFile(bool bDefaultIniLocation)
error += L"\n\nto\n\n"; error += L"\n\nto\n\n";
error += strTarget; error += strTarget;
error += L"\n\nAlternatively you can also just remove the file and\n"; error += L"\n\nAlternatively you can also just remove the file and\n";
error += L"it will be automatically recreated to the correct location\n"; error += L"it will be automatically recreated in the correct location\n";
error += L"when Rainmeter is restarted the next time (you\'ll lose your\n"; error += L"when Rainmeter is restarted the next time (you\'ll lose your\n";
error += L"current settings though).\n"; error += L"current settings though).\n";
} }

View File

@ -69,6 +69,10 @@ void RainmeterDeactivateConfig(HWND, const char* arg);
void RainmeterToggleConfig(HWND, const char* arg); void RainmeterToggleConfig(HWND, const char* arg);
void RainmeterMove(HWND, const char* arg); void RainmeterMove(HWND, const char* arg);
void RainmeterZPos(HWND, const char* arg); void RainmeterZPos(HWND, const char* arg);
void RainmeterClickThrough(HWND, const char* arg);
void RainmeterDraggable(HWND, const char* arg);
void RainmeterSnapEdges(HWND, const char* arg);
void RainmeterKeepOnScreen(HWND, const char* arg);
void RainmeterSetTransparency(HWND, const char* arg); void RainmeterSetTransparency(HWND, const char* arg);
void RainmeterSetVariable(HWND, const char* arg); void RainmeterSetVariable(HWND, const char* arg);
@ -88,6 +92,10 @@ void RainmeterDisableMeasureGroup(HWND, const char* arg);
void RainmeterToggleMeasureGroup(HWND, const char* arg); void RainmeterToggleMeasureGroup(HWND, const char* arg);
void RainmeterDeactivateConfigGroup(HWND, const char* arg); void RainmeterDeactivateConfigGroup(HWND, const char* arg);
void RainmeterZPosGroup(HWND, const char* arg); void RainmeterZPosGroup(HWND, const char* arg);
void RainmeterClickThroughGroup(HWND, const char* arg);
void RainmeterDraggableGroup(HWND, const char* arg);
void RainmeterSnapEdgesGroup(HWND, const char* arg);
void RainmeterKeepOnScreenGroup(HWND, const char* arg);
void RainmeterSetTransparencyGroup(HWND, const char* arg); void RainmeterSetTransparencyGroup(HWND, const char* arg);
void RainmeterSetVariableGroup(HWND, const char* arg); void RainmeterSetVariableGroup(HWND, const char* arg);

View File

@ -1,3 +1,3 @@
#pragma once #pragma once
const int revision_number = 507; const int revision_number = 513;
const bool revision_beta = true; const bool revision_beta = true;