From 4a966be3c32e745b2567e51c27766942f798f77d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 26 Jul 2015 12:33:08 +0000 Subject: common projects git-svn-id: http://svn.miranda-ng.org/main/trunk@14724 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/src/AniSmileyObject.cpp | 2 +- plugins/SmileyAdd/src/SmileyBase.cpp | 2 +- plugins/SmileyAdd/src/anim.cpp | 2 +- plugins/SmileyAdd/src/customsmiley.cpp | 2 +- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 2 +- plugins/SmileyAdd/src/download.cpp | 2 +- plugins/SmileyAdd/src/general.cpp | 2 +- plugins/SmileyAdd/src/general.h | 192 ----------------------------- plugins/SmileyAdd/src/imagecache.cpp | 2 +- plugins/SmileyAdd/src/main.cpp | 2 +- plugins/SmileyAdd/src/options.cpp | 2 +- plugins/SmileyAdd/src/regexp/WCMatcher.cpp | 2 +- plugins/SmileyAdd/src/regexp/WCPattern.cpp | 2 +- plugins/SmileyAdd/src/richcall.cpp | 2 +- plugins/SmileyAdd/src/services.cpp | 2 +- plugins/SmileyAdd/src/smileyroutines.cpp | 2 +- plugins/SmileyAdd/src/smileys.cpp | 2 +- plugins/SmileyAdd/src/smltool.cpp | 2 +- plugins/SmileyAdd/src/stdafx.cpp | 18 --- plugins/SmileyAdd/src/stdafx.cxx | 18 +++ plugins/SmileyAdd/src/stdafx.h | 191 ++++++++++++++++++++++++++++ 21 files changed, 226 insertions(+), 227 deletions(-) delete mode 100644 plugins/SmileyAdd/src/general.h delete mode 100644 plugins/SmileyAdd/src/stdafx.cpp create mode 100644 plugins/SmileyAdd/src/stdafx.cxx create mode 100644 plugins/SmileyAdd/src/stdafx.h (limited to 'plugins/SmileyAdd/src') diff --git a/plugins/SmileyAdd/src/AniSmileyObject.cpp b/plugins/SmileyAdd/src/AniSmileyObject.cpp index 0e7d0e9594..9411da6b6b 100644 --- a/plugins/SmileyAdd/src/AniSmileyObject.cpp +++ b/plugins/SmileyAdd/src/AniSmileyObject.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" class CAniSmileyObject; diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp index b2d496c347..69af533942 100644 --- a/plugins/SmileyAdd/src/SmileyBase.cpp +++ b/plugins/SmileyAdd/src/SmileyBase.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" static void HiMetricToPixel(const SIZEL * lpSizeInHiMetric, LPSIZEL lpSizeInPix) { diff --git a/plugins/SmileyAdd/src/anim.cpp b/plugins/SmileyAdd/src/anim.cpp index 46b66000aa..9ad5f9b7eb 100644 --- a/plugins/SmileyAdd/src/anim.cpp +++ b/plugins/SmileyAdd/src/anim.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" Animate::Animate(SmileyType *sml, RECT& rect, HDC hdcMem, HBRUSH hbr, bool clip) : m_sml(sml), diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index 894545ed74..0b725d6a9f 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" SmileyPackCListType g_SmileyPackCStore; diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 06fe5e161e..05cdc7343e 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" //***************************************************// // DISCLAIMER!!! diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 338b84d279..47ec9317b9 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" HANDLE hNetlibUser; static HANDLE hFolder; diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index fd4bca89cc..1416db2f6b 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" static ULONG_PTR g_gdiplusToken = 0; static bool gdiPlusFail = false; diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h deleted file mode 100644 index 964eea0f8b..0000000000 --- a/plugins/SmileyAdd/src/general.h +++ /dev/null @@ -1,192 +0,0 @@ -/* -Miranda SmileyAdd Plugin -Copyright (C) 2005 - 2011 Boris Krasnovskiy -Copyright (C) 2003 - 2004 Rein-Peter de Boer - -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 . -*/ - -#ifndef _GENERAL_ -#define _GENERAL_ - -#define _CRT_SECURE_NO_WARNINGS -#define _SCL_SECURE_NO_WARNINGS - -#define _HAS_EXCEPTIONS 0 -#define _SECURE_SCL 0 -#define _SECURE_SCL_THROWS 0 -#define _STRALIGN_USE_SECURE_CRT 0 -#define _NO_EXCEPTIONS -#define _CRTDBG_MAP_ALLOC - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define NETLIB_NOLOGGING - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "regexp\wcpattern.h" -#include "regexp\wcmatcher.h" - -typedef WCPattern _TPattern; -typedef WCMatcher _TMatcher; -#define createTMatcher createWCMatcher - -#include "resource.h" -#include "version.h" -#include "imagecache.h" -#include "smileys.h" -#include "customsmiley.h" -#include "services.h" -#include "options.h" -#include "download.h" -#include "anim.h" -#include "SmileyBase.h" -#include "smileyroutines.h" -#include "smltool.h" - -extern HINSTANCE g_hInst; -extern HANDLE hNetlibUser; -extern HANDLE hEvent1; -extern HGENMENU hContactMenuItem; -extern SmileyCategoryListType g_SmileyCategories; -extern SmileyPackListType g_SmileyPacks; -extern LIST menuHandleArray; - -#define IDC_SMLBUTTON (WM_USER + 33) - -/////////////////////////////////////////////////// -// -//defines from miranda im sources (undocumented!) -// -#define MI_IDC_LOG 1001 //rich edit -#define MI_IDC_MESSAGE 1002 //edit control -#define MI_IDC_QUOTE 1034 //button control -#define MI_IDC_NAME 1009 //text control -#define MI_IDC_ADD 1070 //Add button. - -#define DM_REMAKELOG (WM_USER + 11) -#define DM_OPTIONSAPPLIED (WM_USER + 14) -#define DM_APPENDTOLOG (WM_USER + 17) - -#define WM_REMAKERICH (WM_USER + 0x3457) - -///////////////////////////////////////////////////// - -#define MAX_SMILEY_LENGTH 96 - -class A2W_SM -{ -public: - wchar_t* m_psz; - - A2W_SM(const char* psz, unsigned nCodePage = CP_ACP) - { - const int nLength = MultiByteToWideChar(nCodePage, 0, psz, -1, NULL, 0); - m_psz = new wchar_t[nLength]; - MultiByteToWideChar(nCodePage, 0, psz, -1, m_psz, nLength); - } - ~A2W_SM() { delete [] m_psz; } - operator wchar_t*() const { return m_psz; } -}; - - -class W2A_SM -{ -public: - char* m_psz; - - W2A_SM(const wchar_t* psz, unsigned nCodePage = CP_ACP) - { - const int nLength = WideCharToMultiByte(nCodePage, 0, psz, -1, NULL, 0, NULL, NULL); - m_psz = new char[nLength]; - WideCharToMultiByte(nCodePage, 0, psz, -1, m_psz, nLength, NULL, NULL); - } - ~W2A_SM() { delete [] m_psz; } - operator char*() const { return m_psz; } -}; - -#define T2A_SM (char*)W2A_SM -#define T2W_SM(p1) (wchar_t*)p1 -#define A2T_SM (wchar_t*)A2W_SM -#define W2T_SM(p1) (TCHAR*)p1 - -// init functions -void InstallDialogBoxHook(void); -void RemoveDialogBoxHook(void); -int UpdateSrmmDlg(WPARAM wParam, LPARAM lParam); -bool IsOldSrmm(void); - -//functions for general use (defined in general.cpp) -int CalculateTextHeight(HDC hdc, CHARFORMAT2* chf); -const TCHAR* GetImageExt(CMString &fname); - -MCONTACT DecodeMetaContact(MCONTACT hContact); -bool IsSmileyProto(char* proto); - -HICON ImageList_GetIconFixed (HIMAGELIST himl, INT i, UINT fStyle); - -void pathToRelative(const CMString& pSrc, CMString& pOut); -void pathToAbsolute(const CMString& pSrc, CMString& pOut); - -bool InitGdiPlus(void); -void DestroyGdiPlus(void); - -void ReportError(const TCHAR* errmsg); -HICON GetDefaultIcon(bool copy = true); - -void CloseRichCallback(HWND hwnd); -void CloseRichOwnerCallback(HWND hwnd); -bool SetRichCallback(HWND hwnd, MCONTACT hContact, bool subany, bool subnew); -void SetRichOwnerCallback(HWND hwnd, HWND hwndInput, HWND hwndLog); -void ProcessAllInputAreas(bool restoreText); -void RichEditData_Destroy(void); - -void CloseSmileys(void); -void DestroyAniSmileys(void); - -void UrlDecode(char* str); - -#endif diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp index e9cd07afa6..9ad9aaa8a0 100644 --- a/plugins/SmileyAdd/src/imagecache.cpp +++ b/plugins/SmileyAdd/src/imagecache.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" static FI_INTERFACE *fei; diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index b375da5499..a162557236 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" //globals HINSTANCE g_hInst; diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 0d219b0dbe..c57af0a88a 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" OptionsType opt; diff --git a/plugins/SmileyAdd/src/regexp/WCMatcher.cpp b/plugins/SmileyAdd/src/regexp/WCMatcher.cpp index 8311c039ef..3cd0808373 100644 --- a/plugins/SmileyAdd/src/regexp/WCMatcher.cpp +++ b/plugins/SmileyAdd/src/regexp/WCMatcher.cpp @@ -1,4 +1,4 @@ -#include "..\general.h" +#include "..\stdafx.h" const int WCMatcher::MATCH_ENTIRE_STRING = 0x01; diff --git a/plugins/SmileyAdd/src/regexp/WCPattern.cpp b/plugins/SmileyAdd/src/regexp/WCPattern.cpp index 3081143e75..f2b128c980 100644 --- a/plugins/SmileyAdd/src/regexp/WCPattern.cpp +++ b/plugins/SmileyAdd/src/regexp/WCPattern.cpp @@ -23,7 +23,7 @@ @version 1.07.00 */ -#include "..\general.h" +#include "..\stdafx.h" std::map WCPattern::compiledWCPatterns; std::map > WCPattern::registeredWCPatterns; diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp index 9257a6c796..e38a3eeec0 100644 --- a/plugins/SmileyAdd/src/richcall.cpp +++ b/plugins/SmileyAdd/src/richcall.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" struct RichEditData { diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 0822108f9b..41d34a9775 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" LIST menuHandleArray(5); diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp index 20b7dcc85d..0f337b892a 100644 --- a/plugins/SmileyAdd/src/smileyroutines.cpp +++ b/plugins/SmileyAdd/src/smileyroutines.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" ISmileyBase* CreateSmileyObject(SmileyType* sml); ISmileyBase* CreateAniSmileyObject(SmileyType* sml, COLORREF clr, bool ishpp); diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index c2a688ae97..6de0bb0b2e 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" SmileyPackListType g_SmileyPacks; SmileyCategoryListType g_SmileyCategories; diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index e8adc50c89..f4b6c9ba5d 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "general.h" +#include "stdafx.h" #define SB_MYMOVE 20 diff --git a/plugins/SmileyAdd/src/stdafx.cpp b/plugins/SmileyAdd/src/stdafx.cpp deleted file mode 100644 index 340d477dc9..0000000000 --- a/plugins/SmileyAdd/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 "general.h" \ No newline at end of file diff --git a/plugins/SmileyAdd/src/stdafx.cxx b/plugins/SmileyAdd/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/SmileyAdd/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/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h new file mode 100644 index 0000000000..287a1ccf17 --- /dev/null +++ b/plugins/SmileyAdd/src/stdafx.h @@ -0,0 +1,191 @@ +/* +Miranda SmileyAdd Plugin +Copyright (C) 2005 - 2011 Boris Krasnovskiy +Copyright (C) 2003 - 2004 Rein-Peter de Boer + +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 . +*/ + +#ifndef _GENERAL_ +#define _GENERAL_ + +#define _SCL_SECURE_NO_WARNINGS + +#define _HAS_EXCEPTIONS 0 +#define _SECURE_SCL 0 +#define _SECURE_SCL_THROWS 0 +#define _STRALIGN_USE_SECURE_CRT 0 +#define _NO_EXCEPTIONS +#define _CRTDBG_MAP_ALLOC + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NETLIB_NOLOGGING + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "regexp\wcpattern.h" +#include "regexp\wcmatcher.h" + +typedef WCPattern _TPattern; +typedef WCMatcher _TMatcher; +#define createTMatcher createWCMatcher + +#include "resource.h" +#include "version.h" +#include "imagecache.h" +#include "smileys.h" +#include "customsmiley.h" +#include "services.h" +#include "options.h" +#include "download.h" +#include "anim.h" +#include "SmileyBase.h" +#include "smileyroutines.h" +#include "smltool.h" + +extern HINSTANCE g_hInst; +extern HANDLE hNetlibUser; +extern HANDLE hEvent1; +extern HGENMENU hContactMenuItem; +extern SmileyCategoryListType g_SmileyCategories; +extern SmileyPackListType g_SmileyPacks; +extern LIST menuHandleArray; + +#define IDC_SMLBUTTON (WM_USER + 33) + +/////////////////////////////////////////////////// +// +//defines from miranda im sources (undocumented!) +// +#define MI_IDC_LOG 1001 //rich edit +#define MI_IDC_MESSAGE 1002 //edit control +#define MI_IDC_QUOTE 1034 //button control +#define MI_IDC_NAME 1009 //text control +#define MI_IDC_ADD 1070 //Add button. + +#define DM_REMAKELOG (WM_USER + 11) +#define DM_OPTIONSAPPLIED (WM_USER + 14) +#define DM_APPENDTOLOG (WM_USER + 17) + +#define WM_REMAKERICH (WM_USER + 0x3457) + +///////////////////////////////////////////////////// + +#define MAX_SMILEY_LENGTH 96 + +class A2W_SM +{ +public: + wchar_t* m_psz; + + A2W_SM(const char* psz, unsigned nCodePage = CP_ACP) + { + const int nLength = MultiByteToWideChar(nCodePage, 0, psz, -1, NULL, 0); + m_psz = new wchar_t[nLength]; + MultiByteToWideChar(nCodePage, 0, psz, -1, m_psz, nLength); + } + ~A2W_SM() { delete [] m_psz; } + operator wchar_t*() const { return m_psz; } +}; + + +class W2A_SM +{ +public: + char* m_psz; + + W2A_SM(const wchar_t* psz, unsigned nCodePage = CP_ACP) + { + const int nLength = WideCharToMultiByte(nCodePage, 0, psz, -1, NULL, 0, NULL, NULL); + m_psz = new char[nLength]; + WideCharToMultiByte(nCodePage, 0, psz, -1, m_psz, nLength, NULL, NULL); + } + ~W2A_SM() { delete [] m_psz; } + operator char*() const { return m_psz; } +}; + +#define T2A_SM (char*)W2A_SM +#define T2W_SM(p1) (wchar_t*)p1 +#define A2T_SM (wchar_t*)A2W_SM +#define W2T_SM(p1) (TCHAR*)p1 + +// init functions +void InstallDialogBoxHook(void); +void RemoveDialogBoxHook(void); +int UpdateSrmmDlg(WPARAM wParam, LPARAM lParam); +bool IsOldSrmm(void); + +//functions for general use (defined in general.cpp) +int CalculateTextHeight(HDC hdc, CHARFORMAT2* chf); +const TCHAR* GetImageExt(CMString &fname); + +MCONTACT DecodeMetaContact(MCONTACT hContact); +bool IsSmileyProto(char* proto); + +HICON ImageList_GetIconFixed (HIMAGELIST himl, INT i, UINT fStyle); + +void pathToRelative(const CMString& pSrc, CMString& pOut); +void pathToAbsolute(const CMString& pSrc, CMString& pOut); + +bool InitGdiPlus(void); +void DestroyGdiPlus(void); + +void ReportError(const TCHAR* errmsg); +HICON GetDefaultIcon(bool copy = true); + +void CloseRichCallback(HWND hwnd); +void CloseRichOwnerCallback(HWND hwnd); +bool SetRichCallback(HWND hwnd, MCONTACT hContact, bool subany, bool subnew); +void SetRichOwnerCallback(HWND hwnd, HWND hwndInput, HWND hwndLog); +void ProcessAllInputAreas(bool restoreText); +void RichEditData_Destroy(void); + +void CloseSmileys(void); +void DestroyAniSmileys(void); + +void UrlDecode(char* str); + +#endif -- cgit v1.2.3