From c1d55f386dda0203be456f8188070d0397711e32 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 1 Aug 2015 18:59:39 +0000 Subject: stopspam: common project git-svn-id: http://svn.miranda-ng.org/main/trunk@14786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StopSpamPlus/src/eventhooker.cpp | 2 +- plugins/StopSpamPlus/src/events.cpp | 2 +- plugins/StopSpamPlus/src/headers.h | 58 -------------------------------- plugins/StopSpamPlus/src/opt_proto.cpp | 2 +- plugins/StopSpamPlus/src/options.cpp | 2 +- plugins/StopSpamPlus/src/services.cpp | 2 +- plugins/StopSpamPlus/src/settings.cpp | 2 +- plugins/StopSpamPlus/src/stdafx.cpp | 18 ---------- plugins/StopSpamPlus/src/stdafx.cxx | 18 ++++++++++ plugins/StopSpamPlus/src/stdafx.h | 58 ++++++++++++++++++++++++++++++++ plugins/StopSpamPlus/src/stopspam.cpp | 2 +- plugins/StopSpamPlus/src/utils.cpp | 2 +- 12 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 plugins/StopSpamPlus/src/headers.h delete mode 100644 plugins/StopSpamPlus/src/stdafx.cpp create mode 100644 plugins/StopSpamPlus/src/stdafx.cxx create mode 100644 plugins/StopSpamPlus/src/stdafx.h (limited to 'plugins/StopSpamPlus/src') diff --git a/plugins/StopSpamPlus/src/eventhooker.cpp b/plugins/StopSpamPlus/src/eventhooker.cpp index a7ddd04d3f..8007779c01 100644 --- a/plugins/StopSpamPlus/src/eventhooker.cpp +++ b/plugins/StopSpamPlus/src/eventhooker.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "headers.h" +#include "stdafx.h" namespace miranda { diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index e4b7d41e9c..b0c9802ac5 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) { diff --git a/plugins/StopSpamPlus/src/headers.h b/plugins/StopSpamPlus/src/headers.h deleted file mode 100644 index 1b2ac5b2e1..0000000000 --- a/plugins/StopSpamPlus/src/headers.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _stopspam_headers_h -#define _stopspam_headers_h - -// disable security warnings about "*_s" functions -#define _CRT_SECURE_NO_DEPRECATE - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -typedef std::wstring tstring; -#define PREF_TCHAR2 PREF_UTF - -#include "eventhooker.h" -#include "version.h" -#include "resource.h" -#include "settings.h" - -#define pluginName LPGEN("StopSpam") - -extern TCHAR * pluginDescription; -extern TCHAR const * infTalkProtPrefix; -extern char const * answeredSetting; -extern char const * questCountSetting; -extern HANDLE hLoadHook; -extern HINSTANCE hInst; - -//options -INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - -//utils -void SetDlgItemString(HWND hwndDlg, UINT idItem, std::string const &str); -void SetDlgItemString(HWND hwndDlg, UINT idItem, std::wstring const &str); -tstring &GetDlgItemString(HWND hwnd, int id); -bool IsExistMyMessage(MCONTACT hContact); -tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact); -tstring trim(tstring const &tstr, tstring const &trimChars = _T(" \f\n\r\t\v")); - -INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/); -INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam); -int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam); -#endif diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp index cd3f17909c..ab4e3c7df0 100644 --- a/plugins/StopSpamPlus/src/opt_proto.cpp +++ b/plugins/StopSpamPlus/src/opt_proto.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" struct ProtocolData { diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 32c0b095f5..03105de55d 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" TCHAR * pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you."); TCHAR const * infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n"); diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 63fc504c18..2872181726 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" INT_PTR IsContactPassed(WPARAM hContact, LPARAM /*lParam*/) { diff --git a/plugins/StopSpamPlus/src/settings.cpp b/plugins/StopSpamPlus/src/settings.cpp index 0dce70de52..8e6e3cbbc6 100644 --- a/plugins/StopSpamPlus/src/settings.cpp +++ b/plugins/StopSpamPlus/src/settings.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" //reading from database------------- tstring db_usage::DBGetPluginSetting(std::string const &name, tstring const &defValue) diff --git a/plugins/StopSpamPlus/src/stdafx.cpp b/plugins/StopSpamPlus/src/stdafx.cpp deleted file mode 100644 index 7e0216078c..0000000000 --- a/plugins/StopSpamPlus/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) - -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 version 2 -of the License. - -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, see . -*/ - -#include "headers.h" \ No newline at end of file diff --git a/plugins/StopSpamPlus/src/stdafx.cxx b/plugins/StopSpamPlus/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/StopSpamPlus/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) + +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 version 2 +of the License. + +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, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/plugins/StopSpamPlus/src/stdafx.h b/plugins/StopSpamPlus/src/stdafx.h new file mode 100644 index 0000000000..1b2ac5b2e1 --- /dev/null +++ b/plugins/StopSpamPlus/src/stdafx.h @@ -0,0 +1,58 @@ +#ifndef _stopspam_headers_h +#define _stopspam_headers_h + +// disable security warnings about "*_s" functions +#define _CRT_SECURE_NO_DEPRECATE + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +typedef std::wstring tstring; +#define PREF_TCHAR2 PREF_UTF + +#include "eventhooker.h" +#include "version.h" +#include "resource.h" +#include "settings.h" + +#define pluginName LPGEN("StopSpam") + +extern TCHAR * pluginDescription; +extern TCHAR const * infTalkProtPrefix; +extern char const * answeredSetting; +extern char const * questCountSetting; +extern HANDLE hLoadHook; +extern HINSTANCE hInst; + +//options +INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +//utils +void SetDlgItemString(HWND hwndDlg, UINT idItem, std::string const &str); +void SetDlgItemString(HWND hwndDlg, UINT idItem, std::wstring const &str); +tstring &GetDlgItemString(HWND hwnd, int id); +bool IsExistMyMessage(MCONTACT hContact); +tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact); +tstring trim(tstring const &tstr, tstring const &trimChars = _T(" \f\n\r\t\v")); + +INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/); +INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam); +int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam); +#endif diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index 287026da00..cb60154cca 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" HANDLE hFunc, hTempRemove, hLoadHook; int hLangpack; diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index 2e83400e19..e9fa955ba7 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -1,4 +1,4 @@ -#include "headers.h" +#include "stdafx.h" tstring &GetDlgItemString(HWND hwnd, int id) { -- cgit v1.2.3