From aaa6b9eba58239dee4b2b6817ac809b80461c630 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 8 Jul 2012 17:26:53 +0000 Subject: SendScreenshotPlus: adopted git-svn-id: http://svn.miranda-ng.org/main/trunk@856 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/CSendHTTPServer.cpp | 3 - plugins/SendScreenshotPlus/Main.cpp | 50 +- plugins/SendScreenshotPlus/SendSS_10.vcxproj | 229 ++++++++ .../SendScreenshotPlus/SendSS_10.vcxproj.filters | 199 +++++++ plugins/SendScreenshotPlus/SendSS_9.vcproj | 621 --------------------- plugins/SendScreenshotPlus/dlg_msgbox.cpp | 2 +- plugins/SendScreenshotPlus/global.h | 18 +- plugins/SendScreenshotPlus/mir_icolib.cpp | 2 +- plugins/SendScreenshotPlus/mir_string.h | 22 - 9 files changed, 442 insertions(+), 704 deletions(-) create mode 100644 plugins/SendScreenshotPlus/SendSS_10.vcxproj create mode 100644 plugins/SendScreenshotPlus/SendSS_10.vcxproj.filters delete mode 100644 plugins/SendScreenshotPlus/SendSS_9.vcproj (limited to 'plugins') diff --git a/plugins/SendScreenshotPlus/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/CSendHTTPServer.cpp index 27eb42d9b4..788ebca4d1 100644 --- a/plugins/SendScreenshotPlus/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/CSendHTTPServer.cpp @@ -98,12 +98,9 @@ void CSendHTTPServer::SendThread() { else { //original plugin m_fsi.dwOptions = OPT_SEND_LINK; - g_MirCallService = pluginLink->CallService; //backup Miranda CallService - pluginLink->CallService = MyCallService; //Hack on Miranda CallService //send DATA and wait for reply ret = (int)CallService(MS_HTTP_ADD_CHANGE_REMOVE, (WPARAM)m_hContact, (LPARAM)&m_fsi); - pluginLink->CallService = g_MirCallService; //restore Miranda CallService } if (ret != 0) { diff --git a/plugins/SendScreenshotPlus/Main.cpp b/plugins/SendScreenshotPlus/Main.cpp index 66a9b074e1..e1c87a0239 100644 --- a/plugins/SendScreenshotPlus/Main.cpp +++ b/plugins/SendScreenshotPlus/Main.cpp @@ -34,15 +34,13 @@ Last change by : $Author: ing.u.horn $ #include "main.h" // Prototypes /////////////////////////////////////////////////////////////////////////// -MM_INTERFACE mmi; -UTF8_INTERFACE utfi; //LIST_INTERFACE li; FI_INTERFACE *FIP = 0; HINSTANCE hInst; //!< Global reference to the application MGLOBAL myGlobals; +int hLangpack; -PLUGINLINK *pluginLink; //!< Link between Miranda and this plugin //Information gathered by Miranda, displayed in the plugin pane of the Option Dialog PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), @@ -89,11 +87,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRe * It only returns the PLUGININFO structure, without any test on the version * @param mirandaVersion The version of the application calling this function */ -extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) { - pluginInfo.cbSize = sizeof(PLUGININFO); - return (PLUGININFO*) &pluginInfo; -} - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { pluginInfo.cbSize = sizeof(PLUGININFOEX); myGlobals.mirandaVersion = mirandaVersion; @@ -109,8 +102,8 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) { * Initializes the services provided and the link to those needed * Called when the plugin is loaded into Miranda */ -extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { - pluginLink = link; +extern "C" int __declspec(dllexport) Load(void) { + mir_getLP(&pluginInfo); INT_PTR result = CALLSERVICE_NOTFOUND; if(ServiceExists(MS_IMG_GETINTERFACE)) @@ -121,11 +114,6 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { return 1; } - mmi.cbSize = sizeof(mmi); - mir_getMMI(&mmi); - utfi.cbSize = sizeof(utfi); - mir_getUTFI(&utfi); - // load icon library (use UserInfoEx icon Pack) IcoLib_LoadModule(); @@ -163,32 +151,6 @@ int hook_ModulesLoaded(WPARAM, LPARAM) { hFolderScreenshot = (HANDLE) FoldersRegisterCustomPathT("SendSS", "Screenshots", _T(PROFILE_PATH)_T("\\")_T(CURRENT_PROFILE)_T("\\Screenshots")); } - // updater plugin support - if(ServiceExists(MS_UPDATE_REGISTER)) { - Update update = {0}; - char szVersion[16]; - update.cbSize = sizeof(Update); - update.szComponentName = pluginInfo.shortName; - update.pbVersion = (BYTE *)CreateVersionStringPluginEx(&pluginInfo, szVersion); - update.cpbVersion = (int)strlen((char *)update.pbVersion); - - update.szVersionURL = __FLVersionURL; - update.pbVersionPrefix = (BYTE *)__FLVersionPrefix; - update.cpbVersionPrefix = (int)strlen((char *)update.pbVersionPrefix); - update.szUpdateURL = __FLUpdateURL; - // update.szUpdateURL = UPDATER_AUTOREGISTER; - - update.szBetaVersionURL = __BetaVersionURL; - // bytes occuring in VersionURL before the version, used to locate the version information within the URL data - update.pbBetaVersionPrefix = (BYTE *)__BetaVersionPrefix; - update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix); - update.szBetaUpdateURL = __BetaUpdateURL; - - // url for displaying changelog for beta versions - update.szBetaChangelogURL = __BetaChangelogURL; - - CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); - } return 0; } @@ -352,21 +314,21 @@ void AddMenuItems(void) { mi.ptszName = LPGENT("Send Screenshot"); mi.hIcon = IcoLib_GetIcon(ICO_PLUG_SSWINDOW2); mi.pszService = MS_SENDSS_OPENDIALOG; - CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi); + Menu_AddContactMenuItem(&mi); // Add item to contact menu mi.position = 1000001; mi.ptszName = LPGENT("Send desktop screenshot"); mi.hIcon = IcoLib_GetIcon(ICO_PLUG_SSWINDOW2); mi.pszService = MS_SENDSS_SENDDESKTOP; - CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi); + Menu_AddContactMenuItem(&mi); // Add item to main menu mi.position = 1000001; mi.ptszName = LPGENT("Take a screenshot"); mi.hIcon = IcoLib_GetIcon(ICO_PLUG_SSWINDOW2); mi.pszService = MS_SENDSS_OPENDIALOG; - CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi); + Menu_AddMainMenuItem(&mi); } //--------------------------------------------------------------------------- diff --git a/plugins/SendScreenshotPlus/SendSS_10.vcxproj b/plugins/SendScreenshotPlus/SendSS_10.vcxproj new file mode 100644 index 0000000000..2c50d8b867 --- /dev/null +++ b/plugins/SendScreenshotPlus/SendSS_10.vcxproj @@ -0,0 +1,229 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SendSS + {CEAD8BCF-1F22-4E00-9F6D-E33405B00552} + + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + sdk;..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Level3 + Full + Size + + + gdiplus.lib;msimg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + $(SolutionDir)\lib + Windows + true + true + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + Disabled + sdk;..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + EditAndContinue + + + gdiplus.lib;msimg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + $(SolutionDir)\lib + Windows + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + sdk;..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Level3 + Full + Size + + + gdiplus.lib;msimg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + $(SolutionDir)\lib + Windows + true + true + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + Disabled + sdk;..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + + + gdiplus.lib;msimg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + $(SolutionDir)\lib + Windows + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/SendScreenshotPlus/SendSS_10.vcxproj.filters b/plugins/SendScreenshotPlus/SendSS_10.vcxproj.filters new file mode 100644 index 0000000000..1c963f799a --- /dev/null +++ b/plugins/SendScreenshotPlus/SendSS_10.vcxproj.filters @@ -0,0 +1,199 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {2e2953d9-74f5-47c7-a652-0da67d678000} + + + + + Class Form + + + Class Form + + + Helper + + + Helper + + + Helper + + + Helper + + + Helper + + + Class Send + + + Class Send + + + Class Send + + + Class Send + + + Class Send + + + Class Send + + + Class Form + + + + + Class Form + + + Class Form + + + Helper + + + Helper + + + Helper + + + Helper + + + Helper + + + Resource Files + + + Class Send + + + Class Send + + + Class Send + + + Class Send + + + Class Send + + + Class Send + + + Helper + + + Helper + + + Helper + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/plugins/SendScreenshotPlus/SendSS_9.vcproj b/plugins/SendScreenshotPlus/SendSS_9.vcproj deleted file mode 100644 index 25fc100659..0000000000 --- a/plugins/SendScreenshotPlus/SendSS_9.vcproj +++ /dev/null @@ -1,621 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/SendScreenshotPlus/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/dlg_msgbox.cpp index 86fa25cbae..f1b1535802 100644 --- a/plugins/SendScreenshotPlus/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/dlg_msgbox.cpp @@ -571,7 +571,7 @@ INT_PTR CALLBACK MsgBoxPop(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_INITDIALOG: { - POPUPDATAT pd; + POPUPDATAT_V2 pd; LPMSGPOPUPDATA pmpd; LPMSGBOX pMsgBox = (LPMSGBOX)lParam; diff --git a/plugins/SendScreenshotPlus/global.h b/plugins/SendScreenshotPlus/global.h index 0320949957..2710be0e17 100644 --- a/plugins/SendScreenshotPlus/global.h +++ b/plugins/SendScreenshotPlus/global.h @@ -38,12 +38,8 @@ Last change by : $Author: ing.u.horn $ #define _WIN32_IE 0x0601 #define OEMRESOURCE - -#define MIRANDA_VER 0x0800 - -#ifdef _WIN32 - #pragma warning(disable:4786) -#endif +#define _CRT_SECURE_NO_WARNINGS +#define MIRANDA_VER 0x0A00 // Windows includes #include @@ -86,17 +82,17 @@ using namespace std; #include #include #include +#include // plugins SDK #include -#include #include #include -#include "sdk/m_popup.h" // -#include "sdk/icons.h" //from uiex icon pack +#include +#include "icons.h" //from uiex icon pack // Project resources -#include "sdk/m_sendss.h" +#include "m_sendss.h" #include "mir_string.h" #include "mir_icolib.h" #include "ctrl_button.h" @@ -135,8 +131,6 @@ typedef struct _MGLOBAL { extern HINSTANCE hInst; extern MGLOBAL myGlobals; -extern MM_INTERFACE mmi; -extern UTF8_INTERFACE utfi; extern HANDLE hNetlibUser; #define PtrIsValid(p) (((p)!=0)&&(((HANDLE)(p))!=INVALID_HANDLE_VALUE)) diff --git a/plugins/SendScreenshotPlus/mir_icolib.cpp b/plugins/SendScreenshotPlus/mir_icolib.cpp index dc9a7ad02f..33718faf98 100644 --- a/plugins/SendScreenshotPlus/mir_icolib.cpp +++ b/plugins/SendScreenshotPlus/mir_icolib.cpp @@ -301,7 +301,7 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L sid.hDefaultIcon = hDefIcon; sid.iDefaultIndex = -1; } - hIconHandle = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + hIconHandle = Skin_AddIcon(&sid); } mir_freeAndNil(sid.ptszDescription); mir_freeAndNil(sid.ptszSection); diff --git a/plugins/SendScreenshotPlus/mir_string.h b/plugins/SendScreenshotPlus/mir_string.h index 11f8276d1b..882cd38896 100644 --- a/plugins/SendScreenshotPlus/mir_string.h +++ b/plugins/SendScreenshotPlus/mir_string.h @@ -33,28 +33,6 @@ Last change by : $Author: ing.u.horn $ #ifndef _MIR_STRING_H_INCLUDED_ #define _MIR_STRING_H_INCLUDED_ -class _A2T -{ - public: - _A2T(const char* s) : - buf(mir_a2t(s)) - {} - - _A2T(const char* s, int cp) : - buf(mir_a2t_cp(s, cp)) - {} - - ~_A2T() - { mir_free(buf); - } - - __inline operator TCHAR*() const - { return buf; - } - - private: TCHAR* buf; -}; - #define mir_wcsdup mir_wstrdup #ifdef _UNICODE -- cgit v1.2.3