summaryrefslogtreecommitdiff
path: root/plugins/BossKeyPlus
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/BossKeyPlus')
-rw-r--r--plugins/BossKeyPlus/BossKey_10.vcxproj1
-rw-r--r--plugins/BossKeyPlus/BossKey_10.vcxproj.filters3
-rw-r--r--plugins/BossKeyPlus/BossKey_11.vcxproj1
-rw-r--r--plugins/BossKeyPlus/BossKey_11.vcxproj.filters3
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp16
-rw-r--r--plugins/BossKeyPlus/src/BossKey.h3
-rw-r--r--plugins/BossKeyPlus/src/BossKeyTriggers.cpp146
7 files changed, 2 insertions, 171 deletions
diff --git a/plugins/BossKeyPlus/BossKey_10.vcxproj b/plugins/BossKeyPlus/BossKey_10.vcxproj
index f4abe8e8d0..9cb288004f 100644
--- a/plugins/BossKeyPlus/BossKey_10.vcxproj
+++ b/plugins/BossKeyPlus/BossKey_10.vcxproj
@@ -181,7 +181,6 @@
<ItemGroup>
<ClCompile Include="src\BossKey.cpp" />
<ClCompile Include="src\BossKeyIdle.cpp" />
- <ClCompile Include="src\BossKeyTriggers.cpp" />
<ClCompile Include="src\Options.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
diff --git a/plugins/BossKeyPlus/BossKey_10.vcxproj.filters b/plugins/BossKeyPlus/BossKey_10.vcxproj.filters
index 0ed628eb54..7fe41a705c 100644
--- a/plugins/BossKeyPlus/BossKey_10.vcxproj.filters
+++ b/plugins/BossKeyPlus/BossKey_10.vcxproj.filters
@@ -21,9 +21,6 @@
<ClCompile Include="src\BossKeyIdle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\BossKeyTriggers.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\Options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/BossKeyPlus/BossKey_11.vcxproj b/plugins/BossKeyPlus/BossKey_11.vcxproj
index ce537fe9e5..8ca054b772 100644
--- a/plugins/BossKeyPlus/BossKey_11.vcxproj
+++ b/plugins/BossKeyPlus/BossKey_11.vcxproj
@@ -186,7 +186,6 @@
<ItemGroup>
<ClCompile Include="src\BossKey.cpp" />
<ClCompile Include="src\BossKeyIdle.cpp" />
- <ClCompile Include="src\BossKeyTriggers.cpp" />
<ClCompile Include="src\Options.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
diff --git a/plugins/BossKeyPlus/BossKey_11.vcxproj.filters b/plugins/BossKeyPlus/BossKey_11.vcxproj.filters
index 0ed628eb54..7fe41a705c 100644
--- a/plugins/BossKeyPlus/BossKey_11.vcxproj.filters
+++ b/plugins/BossKeyPlus/BossKey_11.vcxproj.filters
@@ -21,9 +21,6 @@
<ClCompile Include="src\BossKeyIdle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\BossKeyTriggers.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\Options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index df278659e4..c4ab8cbd71 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -370,9 +370,6 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
if (g_bWindowHidden || g_fOptionsOpen) // already hidden or in options, no hiding
break;
- if (ServiceExists(MS_TRIGGER_REGISTERTRIGGER))
- BossKeyEvent(g_bWindowHidden, 0);
-
DWORD dwWndPID; // remember foreground window
HWND hForegroundWnd = GetForegroundWindow();
GetWindowThreadProcessId(hForegroundWnd,&dwWndPID);
@@ -464,13 +461,8 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
}
}
- if (ServiceExists(MS_TRIGGER_REGISTERTRIGGER))
- BossKeyEvent(g_bWindowHidden, 0);
-
if (g_wMask & OPT_CHANGESTATUS && g_wMask & OPT_SETONLINEBACK) // set back to some status
- {
BackAllProtoStatuses();
- }
HWND_ITEM *pCurWnd = g_pMirWnds;
while (pCurWnd != NULL)
@@ -773,10 +765,7 @@ int MirandaLoaded(WPARAM wParam,LPARAM lParam)
if (g_wMaskAdv & OPT_MENUITEM)
BossKeyMenuItemInit();
- if (ServiceExists(MS_TRIGGER_REGISTERTRIGGER))
- RegisterTrigger();
-
-// Register token for variables plugin
+ // Register token for variables plugin
if (ServiceExists(MS_VARS_REGISTERTOKEN))
{
TOKENREGISTER tr = {0};
@@ -796,8 +785,7 @@ int MirandaLoaded(WPARAM wParam,LPARAM lParam)
if (g_bOldSetting && !(g_wMaskAdv & OPT_RESTORE)) // Restore settings if Miranda was crushed or killed in hidden mode and "Restore hiding on startup after failure" option is disabled
RestoreOldSettings();
- if (g_wMaskAdv & OPT_HIDEONSTART ||
- (g_wMaskAdv & OPT_RESTORE && g_bOldSetting))
+ if ((g_wMaskAdv & OPT_HIDEONSTART) || (g_wMaskAdv & OPT_RESTORE && g_bOldSetting))
BossKeyHideMiranda(0, 0);
return(0);
diff --git a/plugins/BossKeyPlus/src/BossKey.h b/plugins/BossKeyPlus/src/BossKey.h
index e0f8cb61e1..6c7577afc2 100644
--- a/plugins/BossKeyPlus/src/BossKey.h
+++ b/plugins/BossKeyPlus/src/BossKey.h
@@ -44,7 +44,6 @@
#include <m_message.h>
#include <m_hotkeys.h>
-#include <m_trigger.h>
#include <m_variables.h>
#include <m_toptoolbar.h>
#include <m_msg_buttonsbar.h>
@@ -97,8 +96,6 @@ int OptsDlgInit(WPARAM wParam,LPARAM lParam);
INT_PTR BossKeyHideMiranda(WPARAM wParam, LPARAM lParam);
void BossKeyMenuItemInit(void);
void BossKeyMenuItemUnInit(void);
-int BossKeyEvent(WPARAM wParam, LPARAM lParam);
-int RegisterTrigger(void);
TCHAR *GetBossKeyText(void);
void InitIdleTimer(void);
void UninitIdleTimer(void);
diff --git a/plugins/BossKeyPlus/src/BossKeyTriggers.cpp b/plugins/BossKeyPlus/src/BossKeyTriggers.cpp
deleted file mode 100644
index bd1f39a7bd..0000000000
--- a/plugins/BossKeyPlus/src/BossKeyTriggers.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- BossKey - Hide Miranda from your boss :)
- Copyright (C) 2002-2003 Goblineye Entertainment, (C) 2007-2010 Billy_Bons
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "BossKey.h"
-extern HANDLE g_hIsHiddenService;
-
-static INT_PTR CALLBACK DlgProcOptsBossKeyTrigger(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
-
- switch (msg) {
- case WM_INITDIALOG: {
- /* lParam = (LPARAM)(DWORD)triggerID, or 0 if this is a new trigger */
- DWORD triggerID;
-
- triggerID = (DWORD)lParam;
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BK_HIDE, (DBGetTriggerSettingWord(triggerID, NULL, MOD_NAME, SETTING_TRIGGERON, 0)&TRIGGER_BK_HIDE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_BK_SHOW, (DBGetTriggerSettingWord(triggerID, NULL, MOD_NAME, SETTING_TRIGGERON, 0)&TRIGGER_BK_SHOW)?BST_CHECKED:BST_UNCHECKED);
- break;
- }
-
- case TM_ADDTRIGGER: {
- DWORD triggerID;
- int flags = 0;
-
- triggerID = (DWORD)wParam;
- flags |= IsDlgButtonChecked(hwndDlg, IDC_BK_HIDE)?TRIGGER_BK_HIDE:0;
- flags |= IsDlgButtonChecked(hwndDlg, IDC_BK_SHOW)?TRIGGER_BK_SHOW:0;
- DBWriteTriggerSettingWord(triggerID, NULL, MOD_NAME, SETTING_TRIGGERON, (WORD)flags);
- break;
- }
-
- case TM_DELTRIGGER: {
- DWORD triggerID;
- REMOVETRIGGERSETTINGS rts;
-
- triggerID = (DWORD)wParam;
- rts.cbSize = sizeof(REMOVETRIGGERSETTINGS);
- rts.prefix = PREFIX_TRIGGERID;
- rts.id = triggerID;
- rts.hContact = NULL;
- rts.szModule = MOD_NAME;
- CallService(MS_TRIGGER_REMOVESETTINGS, 0, (LPARAM)&rts);
- break;
- }
- }
-
- return FALSE;
-}
-
-int BossKeyEvent(WPARAM wParam, LPARAM lParam) {
-
- DWORD triggerID = 0;
- REPORTINFO ri;
- TRIGGERDATA td;
- int flags;
-
- do {
- triggerID = (DWORD)CallService(MS_TRIGGER_FINDNEXTTRIGGERID, triggerID, (LPARAM)TRIGGERNAME);
- if (triggerID == 0) {
- continue;
- }
- ZeroMemory(&td, sizeof(TRIGGERDATA));
- td.cbSize = sizeof(TRIGGERDATA);
- flags = DBGetTriggerSettingWord(triggerID, NULL, MOD_NAME, SETTING_TRIGGERON, 0);
- switch (wParam) {
- case 0:
- if (!(flags&TRIGGER_BK_HIDE)) {
- continue;
- }
- break;
- case 1:
- if (!(flags&TRIGGER_BK_SHOW)) {
- continue;
- }
- break;
- default:
- continue;
- break;
- }
- ZeroMemory(&ri, sizeof(REPORTINFO));
- ri.cbSize = sizeof(REPORTINFO);
- ri.flags = TRG_PERFORM;
- ri.triggerID = triggerID;
- ri.td = &td;
- CallService(MS_TRIGGER_REPORTEVENT, 0, (LPARAM)&ri);
- } while (triggerID != 0);
-
- return 0;
-}
-
-INT_PTR IsMirandaHidden(WPARAM wParam, LPARAM lParam) // for trigger plugin
-{
- return (INT_PTR)g_bWindowHidden;
-}
-
-int RegisterTrigger() {
-
- g_hIsHiddenService = CreateServiceFunction(MS_BOSSKEY_ISMIRANDAHIDDEN, IsMirandaHidden);
-
- TRIGGERREGISTER tr;
- ZeroMemory(&tr, sizeof(TRIGGERREGISTER));
- tr.cbSize = sizeof(TRIGGERREGISTER);
- tr.dFlags = DF_TCHAR;
- tr.pszName = TRIGGERNAME;
- tr.hInstance = g_hInstance;
- tr.pfnDlgProc = DlgProcOptsBossKeyTrigger;
- tr.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TRIGGER);
-
- CallService(MS_TRIGGER_REGISTERTRIGGER, 0, (LPARAM)&tr);
-
- CONDITIONREGISTER cr;
- ZeroMemory(&cr, sizeof(CONDITIONREGISTER));
- cr.cbSize = sizeof(CONDITIONREGISTER);
- cr.flags = CRF_TCHAR;
- cr.pszName = "BossKey: Miranda is hidden";
- cr.pszService = MS_BOSSKEY_ISMIRANDAHIDDEN;
-
- CallService(MS_TRIGGER_REGISTERCONDITION, 0, (LPARAM)&cr);
-
- ACTIONREGISTER ar;
- ZeroMemory(&ar, sizeof(ACTIONREGISTER));
- ar.cbSize = sizeof(ACTIONREGISTER);
- ar.flags = ARF_TCHAR;
- ar.pszName = "BossKey: Hide/Show Miranda";
- ar.pszService = MS_BOSSKEY_HIDE;
-
- CallService(MS_TRIGGER_REGISTERACTION, 0, (LPARAM)&ar);
-
- return 0;
-}