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/SendScreenshotPlus/src/CSend.cpp | 2 +- plugins/SendScreenshotPlus/src/CSendDropbox.cpp | 2 +- plugins/SendScreenshotPlus/src/CSendEmail.cpp | 2 +- plugins/SendScreenshotPlus/src/CSendFTPFile.cpp | 2 +- plugins/SendScreenshotPlus/src/CSendFile.cpp | 2 +- plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp | 2 +- .../src/CSendHost_ImageShack.cpp | 2 +- plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp | 2 +- .../SendScreenshotPlus/src/CSendHost_uploadpie.cpp | 2 +- plugins/SendScreenshotPlus/src/Main.cpp | 2 +- plugins/SendScreenshotPlus/src/UAboutForm.cpp | 2 +- plugins/SendScreenshotPlus/src/UMainForm.cpp | 2 +- plugins/SendScreenshotPlus/src/Utils.cpp | 2 +- plugins/SendScreenshotPlus/src/ctrl_button.cpp | 2 +- plugins/SendScreenshotPlus/src/dlg_msgbox.cpp | 9 +- plugins/SendScreenshotPlus/src/global.h | 185 --------------------- plugins/SendScreenshotPlus/src/mir_string.cpp | 2 +- plugins/SendScreenshotPlus/src/stdafx.cpp | 18 -- plugins/SendScreenshotPlus/src/stdafx.cxx | 18 ++ plugins/SendScreenshotPlus/src/stdafx.h | 185 +++++++++++++++++++++ 20 files changed, 220 insertions(+), 225 deletions(-) delete mode 100644 plugins/SendScreenshotPlus/src/global.h delete mode 100644 plugins/SendScreenshotPlus/src/stdafx.cpp create mode 100644 plugins/SendScreenshotPlus/src/stdafx.cxx create mode 100644 plugins/SendScreenshotPlus/src/stdafx.h (limited to 'plugins/SendScreenshotPlus/src') diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 8ab4a7063d..9386894343 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" #define CSEND_DIALOG 8800 //--------------------------------------------------------------------------- diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp index b0756b8811..b6eaf6764f 100644 --- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp +++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //--------------------------------------------------------------------------- -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- CSendDropbox::CSendDropbox(HWND Owner, MCONTACT hContact, bool bAsync) diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp index 6083dce157..ee5628e420 100644 --- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp +++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //--------------------------------------------------------------------------- -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- CSendEmail::CSendEmail(HWND Owner, MCONTACT hContact, bool /*bAsync*/) diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp index 8c7aa8e51b..e1fa16f726 100644 --- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //--------------------------------------------------------------------------- -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- diff --git a/plugins/SendScreenshotPlus/src/CSendFile.cpp b/plugins/SendScreenshotPlus/src/CSendFile.cpp index 4928232a13..adaf83e63d 100644 --- a/plugins/SendScreenshotPlus/src/CSendFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFile.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //--------------------------------------------------------------------------- -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- CSendFile::CSendFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/) diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index 4f6f141212..2f50e7a6c5 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //--------------------------------------------------------------------------- -#include "global.h" +#include "stdafx.h" INT_PTR (*g_MirCallService)(const char *, WPARAM, LPARAM)=NULL; //INT_PTR (*CallService)(const char *,WPARAM,LPARAM); diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index 40644e37ba..a0f03d11eb 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //--------------------------------------------------------------------------- -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- CSendHost_ImageShack::CSendHost_ImageShack(HWND Owner, MCONTACT hContact, bool bAsync) diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index dd19d18176..6b1b638083 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -13,7 +13,7 @@ 0. You just DO WHAT THE FUCK YOU WANT TO. */ -#include "global.h" +#include "stdafx.h" CSendHost_Imgur::CSendHost_Imgur(HWND Owner, MCONTACT hContact, bool bAsync) : CSend(Owner,hContact,bAsync) diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp index a19cfa3ced..68aae59b29 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp @@ -13,7 +13,7 @@ 0. You just DO WHAT THE FUCK YOU WANT TO. */ -#include "global.h" +#include "stdafx.h" CSendHost_UploadPie::CSendHost_UploadPie(HWND Owner, MCONTACT hContact, bool bAsync, int expire) : m_expire(expire), CSend(Owner,hContact,bAsync) diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index e997646d10..4474b47732 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" #include "Main.h" // Prototypes /////////////////////////////////////////////////////////////////////////// diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index 8e0eb9e5ef..f3b50a740d 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" #include void TfrmAbout::Unload(){ diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 03fead478e..c887f14c12 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" #include void TfrmMain::Unload(){ diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp index fd7ab70eb4..a8d8fe0146 100644 --- a/plugins/SendScreenshotPlus/src/Utils.cpp +++ b/plugins/SendScreenshotPlus/src/Utils.cpp @@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- //Workaround for MS bug ComboBox_SelectItemData diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index 4a217d2430..3211931d70 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" // Used for our own cheap TrackMouseEvent #define BUTTON_POLLID 100 diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 82ff842cdb..34d9f65c4f 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -19,14 +19,9 @@ 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 "commonheaders.h" -#include -#include -#include -*/ + /// SendSS compatibility: -#include "global.h" +#include "stdafx.h" #define ghInst g_hSendSS #define myGlobals g_myGlobals #define MODNAME SZ_SENDSS diff --git a/plugins/SendScreenshotPlus/src/global.h b/plugins/SendScreenshotPlus/src/global.h deleted file mode 100644 index cec50a38c3..0000000000 --- a/plugins/SendScreenshotPlus/src/global.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (с) 2012-15 Miranda NG project (http://miranda-ng.org), -Copyright (c) 2000-09 Miranda ICQ/IM project, - -This file is part of Send Screenshot Plus, a Miranda IM plugin. -Copyright (c) 2010 Ing.U.Horn - -Parts of this file based on original sorce code -(c) 2004-2006 Sérgio Vieira Rolanski (portet from Borland C++) - -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. -*/ -#ifndef _GLOBAL_H_ -#define _GLOBAL_H_ - -#define _CRT_SECURE_NO_WARNINGS -#define OEMRESOURCE - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -using namespace std; - -#ifdef ComboBox_SelectItemData - // use Workaround for MS bug ComboBox_SelectItemData; - #undef ComboBox_SelectItemData -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "mir_string.h" -#include "ctrl_button.h" -#include "dlg_msgbox.h" -#include "resource.h" -#include "version.h" -#include "CSend.h" -#include "CSendEmail.h" -#include "CSendFile.h" -#include "CSendFTPFile.h" -#include "CSendHTTPServer.h" -#include "CSendDropbox.h" -#include "CSendHost_ImageShack.h" -#include "CSendHost_uploadpie.h" -#include "CSendHost_imgur.h" -#include "DevKey.h" -#include "UMainForm.h" -#include "UAboutForm.h" -#include "Utils.h" - -#define UM_CLOSING WM_USER+1 -#define UM_EVENT WM_USER+2 - -// Generic Message Box for Errors -#define MSGERROR(text) MessageBox(NULL, text, _T("SendSS"), MB_OK | MB_ICONERROR) -#define MSGINFO (text) MessageBox(NULL, text, _T("SendSS"), MB_OK | MB_ICONINFORMATION) - -typedef struct _MGLOBAL { - DWORD mirandaVersion; // mirandaVersion - BOOLEAN PopupExist : 1; // Popup or MS_POPUP_ADDPOPUP exist - BOOLEAN PopupActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist - BOOLEAN PluginHTTPExist : 1; // HTTPServer or MS_HTTP_ACCEPT_CONNECTIONS exist - BOOLEAN PluginFTPExist : 1; // FTPFile or MS_FTPFILE_SHAREFILE exist - BOOLEAN PluginDropboxExist : 1; // Dropbox or MS_DROPBOX_SEND_FILE exists - -} MGLOBAL, *LPMGLOBAL; - -//--------------------------------------------------------------------------- -#define ERROR_TITLE TranslateT("SendScreenshot - Error") - -// Miranda Database Key -#define SZ_SENDSS "SendSS" - -extern ATOM g_clsTargetHighlighter; -extern HINSTANCE g_hSendSS; -extern MGLOBAL g_myGlobals; -extern HANDLE g_hNetlibUser; - - -enum{ - ICO_MAIN=0, - ICO_MAINXS, - ICO_TARGET, - ICO_MONITOR, - ICO_END_, - ICO_BTN_HELP=0, - ICO_BTN_FOLDER, - ICO_BTN_DESC, - ICO_BTN_DESCON, - ICO_BTN_DEL, - ICO_BTN_DELON, - ICO_BTN_ARROWL, - ICO_BTN_ARROWR, - ICO_BTN_UPDATE, - ICO_BTN_OK, - ICO_BTN_CANCEL, -// ICO_BTN_APPLY, - ICO_BTN_EDIT, - ICO_BTN_EDITON, - ICO_BTN_COPY, - ICO_BTN_BBC, - ICO_BTN_BBCLNK, - ICO_BTN_DOWNARROW, - ICO_BTN_END_, -}; -#define GetIconHandle(ico) ICONS[ico].hIcolib -#define GetIcon(ico) IcoLib_GetIconByHandle(GetIconHandle(ico)) -extern IconItem ICONS[ICO_END_]; -#define GetIconBtnHandle(ico) ICONS_BTN[ico].hIcolib -#define GetIconBtn(ico) IcoLib_GetIconByHandle(GetIconBtnHandle(ico)) -extern IconItem ICONS_BTN[ICO_BTN_END_]; - -#define PtrIsValid(p) (((p)!=0)&&(((HANDLE)(p))!=INVALID_HANDLE_VALUE)) -#define MIR_FREE(p) {if (PtrIsValid(p)){mir_free((void*)p);(p)=NULL;}} -#ifdef _DEBUG -# define DBGMSG(str,...) do{char tmp[1024];sprintf(tmp,str,##__VA_ARGS__);OutputDebugStringA(tmp);}while(0) -#else -# define DBGMSG(str,...) -#endif - -template -std::basic_string<_Elem> replace(const std::basic_string<_Elem> & Origninal, const std::basic_string<_Elem> & What, const std::basic_string<_Elem> & With) -{ - std::basic_string<_Elem> res; - size_t l = 0; - for (size_t p = Origninal.find(What.c_str(), 0); p != std::basic_string<_Elem>::npos; p = Origninal.find(What.c_str(), l)) - { - if (l != p) - res.append(Origninal.c_str() + l, p - l); - res.append(With); - l = p + What.length(); - } - if (l < Origninal.length()) - res.append(Origninal.c_str() + l); - - return res; -} - -#endif diff --git a/plugins/SendScreenshotPlus/src/mir_string.cpp b/plugins/SendScreenshotPlus/src/mir_string.cpp index 0a11dfa287..a363f21415 100644 --- a/plugins/SendScreenshotPlus/src/mir_string.cpp +++ b/plugins/SendScreenshotPlus/src/mir_string.cpp @@ -25,7 +25,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "global.h" +#include "stdafx.h" //--------------------------------------------------------------------------- void mir_stradd(char* &pszDest, const char* pszSrc) diff --git a/plugins/SendScreenshotPlus/src/stdafx.cpp b/plugins/SendScreenshotPlus/src/stdafx.cpp deleted file mode 100644 index 93691c05e8..0000000000 --- a/plugins/SendScreenshotPlus/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 "global.h" \ No newline at end of file diff --git a/plugins/SendScreenshotPlus/src/stdafx.cxx b/plugins/SendScreenshotPlus/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/SendScreenshotPlus/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/SendScreenshotPlus/src/stdafx.h b/plugins/SendScreenshotPlus/src/stdafx.h new file mode 100644 index 0000000000..cec50a38c3 --- /dev/null +++ b/plugins/SendScreenshotPlus/src/stdafx.h @@ -0,0 +1,185 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (с) 2012-15 Miranda NG project (http://miranda-ng.org), +Copyright (c) 2000-09 Miranda ICQ/IM project, + +This file is part of Send Screenshot Plus, a Miranda IM plugin. +Copyright (c) 2010 Ing.U.Horn + +Parts of this file based on original sorce code +(c) 2004-2006 Sérgio Vieira Rolanski (portet from Borland C++) + +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. +*/ +#ifndef _GLOBAL_H_ +#define _GLOBAL_H_ + +#define _CRT_SECURE_NO_WARNINGS +#define OEMRESOURCE + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +using namespace std; + +#ifdef ComboBox_SelectItemData + // use Workaround for MS bug ComboBox_SelectItemData; + #undef ComboBox_SelectItemData +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "mir_string.h" +#include "ctrl_button.h" +#include "dlg_msgbox.h" +#include "resource.h" +#include "version.h" +#include "CSend.h" +#include "CSendEmail.h" +#include "CSendFile.h" +#include "CSendFTPFile.h" +#include "CSendHTTPServer.h" +#include "CSendDropbox.h" +#include "CSendHost_ImageShack.h" +#include "CSendHost_uploadpie.h" +#include "CSendHost_imgur.h" +#include "DevKey.h" +#include "UMainForm.h" +#include "UAboutForm.h" +#include "Utils.h" + +#define UM_CLOSING WM_USER+1 +#define UM_EVENT WM_USER+2 + +// Generic Message Box for Errors +#define MSGERROR(text) MessageBox(NULL, text, _T("SendSS"), MB_OK | MB_ICONERROR) +#define MSGINFO (text) MessageBox(NULL, text, _T("SendSS"), MB_OK | MB_ICONINFORMATION) + +typedef struct _MGLOBAL { + DWORD mirandaVersion; // mirandaVersion + BOOLEAN PopupExist : 1; // Popup or MS_POPUP_ADDPOPUP exist + BOOLEAN PopupActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist + BOOLEAN PluginHTTPExist : 1; // HTTPServer or MS_HTTP_ACCEPT_CONNECTIONS exist + BOOLEAN PluginFTPExist : 1; // FTPFile or MS_FTPFILE_SHAREFILE exist + BOOLEAN PluginDropboxExist : 1; // Dropbox or MS_DROPBOX_SEND_FILE exists + +} MGLOBAL, *LPMGLOBAL; + +//--------------------------------------------------------------------------- +#define ERROR_TITLE TranslateT("SendScreenshot - Error") + +// Miranda Database Key +#define SZ_SENDSS "SendSS" + +extern ATOM g_clsTargetHighlighter; +extern HINSTANCE g_hSendSS; +extern MGLOBAL g_myGlobals; +extern HANDLE g_hNetlibUser; + + +enum{ + ICO_MAIN=0, + ICO_MAINXS, + ICO_TARGET, + ICO_MONITOR, + ICO_END_, + ICO_BTN_HELP=0, + ICO_BTN_FOLDER, + ICO_BTN_DESC, + ICO_BTN_DESCON, + ICO_BTN_DEL, + ICO_BTN_DELON, + ICO_BTN_ARROWL, + ICO_BTN_ARROWR, + ICO_BTN_UPDATE, + ICO_BTN_OK, + ICO_BTN_CANCEL, +// ICO_BTN_APPLY, + ICO_BTN_EDIT, + ICO_BTN_EDITON, + ICO_BTN_COPY, + ICO_BTN_BBC, + ICO_BTN_BBCLNK, + ICO_BTN_DOWNARROW, + ICO_BTN_END_, +}; +#define GetIconHandle(ico) ICONS[ico].hIcolib +#define GetIcon(ico) IcoLib_GetIconByHandle(GetIconHandle(ico)) +extern IconItem ICONS[ICO_END_]; +#define GetIconBtnHandle(ico) ICONS_BTN[ico].hIcolib +#define GetIconBtn(ico) IcoLib_GetIconByHandle(GetIconBtnHandle(ico)) +extern IconItem ICONS_BTN[ICO_BTN_END_]; + +#define PtrIsValid(p) (((p)!=0)&&(((HANDLE)(p))!=INVALID_HANDLE_VALUE)) +#define MIR_FREE(p) {if (PtrIsValid(p)){mir_free((void*)p);(p)=NULL;}} +#ifdef _DEBUG +# define DBGMSG(str,...) do{char tmp[1024];sprintf(tmp,str,##__VA_ARGS__);OutputDebugStringA(tmp);}while(0) +#else +# define DBGMSG(str,...) +#endif + +template +std::basic_string<_Elem> replace(const std::basic_string<_Elem> & Origninal, const std::basic_string<_Elem> & What, const std::basic_string<_Elem> & With) +{ + std::basic_string<_Elem> res; + size_t l = 0; + for (size_t p = Origninal.find(What.c_str(), 0); p != std::basic_string<_Elem>::npos; p = Origninal.find(What.c_str(), l)) + { + if (l != p) + res.append(Origninal.c_str() + l, p - l); + res.append(With); + l = p + What.length(); + } + if (l < Origninal.length()) + res.append(Origninal.c_str() + l); + + return res; +} + +#endif -- cgit v1.2.3