From 920aa970afa086a3a143b39005747210b94f237b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Apr 2013 20:25:38 +0000 Subject: Trigger plugin's support removed, cause this plugin is dead git-svn-id: http://svn.miranda-ng.org/main/trunk@4374 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/KeyboardNotify/src/Common.h | 2 - plugins/KeyboardNotify/src/main.cpp | 7 -- plugins/KeyboardNotify/src/trigger.cpp | 165 --------------------------------- plugins/KeyboardNotify/src/trigger.h | 20 ---- 4 files changed, 194 deletions(-) delete mode 100644 plugins/KeyboardNotify/src/trigger.cpp delete mode 100644 plugins/KeyboardNotify/src/trigger.h (limited to 'plugins/KeyboardNotify/src') diff --git a/plugins/KeyboardNotify/src/Common.h b/plugins/KeyboardNotify/src/Common.h index d8cef2f67c..00705df8b6 100644 --- a/plugins/KeyboardNotify/src/Common.h +++ b/plugins/KeyboardNotify/src/Common.h @@ -43,12 +43,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include "flash.h" #include "ignore.h" #include "keyboard.h" -#include "trigger.h" #include "constants.h" #include "protolist.h" #include "EnumProc.h" diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 5383bc5acd..b44e1de20d 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -901,7 +901,6 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) hFlashingEventService = CreateServiceFunction(MS_KBDNOTIFY_FLASHINGACTIVE, IsFlashingActiveService); hNormalizeSequenceService = CreateServiceFunction(MS_KBDNOTIFY_NORMALSEQUENCE, NormalizeSequenceService); - RegisterAction(); if (ServiceExists("DBEditorpp/RegisterSingleModule")) CallService("DBEditorpp/RegisterSingleModule", (WPARAM)KEYBDMODULE, 0); @@ -912,11 +911,8 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - hInst = hinstDLL; - return TRUE; - } extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) @@ -926,7 +922,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) int Load(void) { - mir_getLP(&pluginInfo); GetWindowsVersion(); @@ -955,9 +950,7 @@ void destroyProtocolList(void) extern "C" __declspec(dllexport) int Unload(void) { - UnhookWindowsHooks(); - DeInitAction(); if (hModulesLoaded) UnhookEvent(hModulesLoaded); if (hMsgEventHook) diff --git a/plugins/KeyboardNotify/src/trigger.cpp b/plugins/KeyboardNotify/src/trigger.cpp deleted file mode 100644 index 147744b96d..0000000000 --- a/plugins/KeyboardNotify/src/trigger.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - -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 "Common.h" - -extern HINSTANCE hInst; - -void StartBlinkAction(char *, WORD); - - -int getCustomNro(DWORD actionID, HWND hwndDlg, int nItems) -{ - int i; - DBVARIANT dbv; - char theme[MAX_PATH+1]; - - if (DBGetTriggerSetting(actionID, NULL, KEYBDMODULE, "custom", &dbv)) - return DEF_SETTING_CUSTOMTHEME; - - for (i=0; i < nItems; i++) { - SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)theme); - if (!strcmp(dbv.pszVal, theme)) { - db_free(&dbv); - return i; - } - } - - db_free(&dbv); - return DEF_SETTING_CUSTOMTHEME; -} - -static INT_PTR CALLBACK DlgProcOptsActionKbdNotify(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - DBVARIANT dbv; - DWORD actionID; - int i, nItems; - char theme[MAX_PATH+1]; - - switch (msg) { - case WM_INITDIALOG: - actionID = (DWORD)lParam; - TranslateDialogDefault(hwndDlg); - - for (i=0; !db_get(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) { - int index = SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)dbv.pszVal); - db_free(&dbv); - if (index != CB_ERR && index != CB_ERRSPACE) - SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i); - } - - nItems = SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_GETCOUNT, 0, 0); - - CheckDlgButton(hwndDlg, IDC_USECUSTOM, nItems && DBGetTriggerSettingByte(actionID, NULL, KEYBDMODULE, "usecustom", 0) ? BST_CHECKED:BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_USECUSTOM), nItems); - - SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_SETCURSEL, (WPARAM)getCustomNro(actionID, hwndDlg, nItems), 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMTHEME), IsDlgButtonChecked(hwndDlg, IDC_USECUSTOM) == BST_CHECKED); - - SendDlgItemMessage(hwndDlg, IDC_FORCEOPEN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_SFORCEOPEN), 0); - SendDlgItemMessage(hwndDlg, IDC_FORCEOPEN, UDM_SETRANGE32, 1, MAKELONG(UD_MAXVAL, 0)); - SendDlgItemMessage(hwndDlg, IDC_FORCEOPEN, UDM_SETPOS, 0, MAKELONG(DBGetTriggerSettingWord(actionID, NULL, KEYBDMODULE, "forceopen", DEF_SETTING_NBLINKS), 0)); - - break; - - case TM_ADDACTION: // save the settings - actionID = (DWORD)wParam; - DBWriteTriggerSettingByte(actionID, NULL, KEYBDMODULE, "usecustom", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_USECUSTOM) == BST_CHECKED ? 1:0)); - SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_GETLBTEXT, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_GETCURSEL, 0, 0), (LPARAM)theme); - DBWriteTriggerSettingString(actionID, NULL, KEYBDMODULE, "custom", theme); - DBWriteTriggerSettingWord(actionID, NULL, KEYBDMODULE, "forceopen", (WORD)SendDlgItemMessage(hwndDlg, IDC_FORCEOPEN, UDM_GETPOS, 0, 0)); - break; - - case WM_COMMAND: - if (LOWORD(wParam) == IDC_USECUSTOM) - EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMTHEME), IsDlgButtonChecked(hwndDlg, IDC_USECUSTOM) == BST_CHECKED); - break; - - case WM_DESTROY: - break; - } - - return FALSE; -} - -char *getCustomString(DWORD actionID) -{ - int i; - DBVARIANT dbv, dbv2; - static char customString[MAX_PATH+1]; - - if (DBGetTriggerSetting(actionID, NULL, KEYBDMODULE, "custom", &dbv)) - return NULL; - - for (i=0; !db_get(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv2); i++) { - if (!strcmp(dbv.pszVal, dbv2.pszVal)) { - db_free(&dbv); - db_free(&dbv2); - if(db_get(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv2)) - return NULL; - strcpy(customString, dbv2.pszVal); - db_free(&dbv2); - return customString; - } - db_free(&dbv2); - } - - db_free(&dbv); - return NULL; -} - -static int TriggerStartBlinkFunction(DWORD actionID, REPORTINFO *ri) -{ - if (ri->flags&ACT_PERFORM) { - char *customStr; - - if (!DBGetTriggerSettingByte(actionID, NULL, KEYBDMODULE, "usecustom", 0)) - customStr = NULL; - else - customStr = getCustomString(actionID); - StartBlinkAction(customStr, DBGetTriggerSettingWord(actionID, NULL, KEYBDMODULE, "forceopen", DEF_SETTING_NBLINKS)); - } - if (ri->flags&ACT_CLEANUP) { // request to delete all associated settings - RemoveAllActionSettings(actionID, KEYBDMODULE); - } - - return 0; // all ok -} - -int RegisterAction() -{ - ACTIONREGISTER ar; - - if (!ServiceExists(MS_TRIGGER_REGISTERACTION)) - return -1; - - ZeroMemory(&ar, sizeof(ar)); - ar.cbSize = sizeof(ar); - ar.pszName = "Keyboard Flash: Start Blinking"; - ar.actionFunction = TriggerStartBlinkFunction; - ar.hInstance = hInst; - ar.pfnDlgProc = DlgProcOptsActionKbdNotify; - ar.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_KN_ACTION); - ar.flags = ARF_FUNCTION; - return CallService(MS_TRIGGER_REGISTERACTION, 0, (LPARAM)&ar); -} - -int DeInitAction() -{ - return 0; -} diff --git a/plugins/KeyboardNotify/src/trigger.h b/plugins/KeyboardNotify/src/trigger.h deleted file mode 100644 index 41d830938c..0000000000 --- a/plugins/KeyboardNotify/src/trigger.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - -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. - -*/ - -int RegisterAction(); -int DeInitAction(); -- cgit v1.2.3