From b84ab26307388f6c61d4f6d8c82c99229cd13bdd Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 23 Jun 2012 13:15:04 +0000 Subject: HistoryLinkListPlus: plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@548 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryLinkListPlus/linklist.cpp | 91 ++++++---------------- plugins/HistoryLinkListPlus/linklist.h | 24 +++++- plugins/HistoryLinkListPlus/linklist.vcxproj | 8 +- .../HistoryLinkListPlus/linklist.vcxproj.filters | 8 +- plugins/HistoryLinkListPlus/linklist_fct.h | 4 - 5 files changed, 53 insertions(+), 82 deletions(-) (limited to 'plugins') diff --git a/plugins/HistoryLinkListPlus/linklist.cpp b/plugins/HistoryLinkListPlus/linklist.cpp index 56c4c2caaf..053b80d200 100644 --- a/plugins/HistoryLinkListPlus/linklist.cpp +++ b/plugins/HistoryLinkListPlus/linklist.cpp @@ -15,30 +15,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -#include -#include "resource.h" -#ifdef _DEBUG -#include -#endif - -// Miranda SDK Includes -#pragma warning(disable:4996) -#pragma warning(disable:4100) -#include -#include -#include -#include -#include -#include -#pragma warning(default:4100) -#pragma warning(default:4996) - -#include "linklist_dlg.h" -#include "linklist_fct.h" #include "linklist.h" -#include "language.h" - -#define MIID_LINKLIST { 0xc9c94733, 0xa054, 0x42b9, { 0x89, 0xcb, 0xb9, 0x71, 0x27, 0xa7, 0xa3, 0x43 } } // Global variables HINSTANCE hInst; @@ -47,12 +24,13 @@ PLUGINLINK *pluginLink; HANDLE hWindowList; HCURSOR splitCursor; int hLangpack; +struct MM_INTERFACE mmi; PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), "History Linklist Plus", PLUGIN_MAKE_VERSION(0,0,0,2), - "Generates a list of extracted URIs from the history", + "Generates a list of extracted URIs from the history.", "Thomas Wendel, gureedo", "gureedo@gmail.com", "© 2010-2011 gureedo", @@ -62,56 +40,37 @@ PLUGININFOEX pluginInfo = { { 0xDA0B09F5, 0x9C66, 0x488C, { 0xAE, 0x37, 0x8A, 0x5F, 0x19, 0x1C, 0x90, 0x79 } } // {DA0B09F5-9C66-488C-AE37-8A5F191C9079} }; -static const MUUID interfaces[] = {MIID_LINKLIST, MIID_LAST}; -struct MM_INTERFACE mmi; - -// Functions - -__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) -{ - return interfaces; -} - BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - UNREFERENCED_PARAMETER(lpvReserved); - hInst = hinstDLL; - // Load Rich Edit control - if ( fdwReason == DLL_PROCESS_ATTACH || fdwReason == DLL_THREAD_ATTACH ) - { - hRichEdit = LoadLibrary(_T("RICHED32.DLL")); - if ( !hRichEdit ) - { - // If Rich Edit DLL load fails, exit - MessageBox(NULL, _T("Unable to load the Rich Edit control!"), _T("Error"), MB_OK | MB_ICONEXCLAMATION); - return FALSE; - } - -#ifdef DEBUG - { - int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - flag |= _CRTDBG_LEAK_CHECK_DF|_CRTDBG_CHECK_ALWAYS_DF; - _CrtSetDbgFlag(flag); - } -#endif - - DisableThreadLibraryCalls(hinstDLL); - } - if ( fdwReason == DLL_PROCESS_DETACH || fdwReason == DLL_THREAD_DETACH ) { - FreeLibrary(hRichEdit); - } - return TRUE; } -int __declspec(dllexport) Load(PLUGINLINK *link) +extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) { CLISTMENUITEM linklistmenuitem; WNDCLASS wndclass; pluginLink = link; mir_getLP(&pluginInfo); + // Load Rich Edit control + hRichEdit = LoadLibrary(_T("RICHED32.DLL")); + if (!hRichEdit) + { + // If Rich Edit DLL load fails, exit + MessageBox(NULL, _T("Unable to load the Rich Edit control!"), _T("Error"), MB_OK | MB_ICONEXCLAMATION); + FreeLibrary(hRichEdit); + return 1; + } + +#ifdef DEBUG + { + int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); + flag |= _CRTDBG_LEAK_CHECK_DF|_CRTDBG_CHECK_ALWAYS_DF; + _CrtSetDbgFlag(flag); + } +#endif + CreateServiceFunction("Linklist/MenuCommand", LinkList_Main); ZeroMemory(&linklistmenuitem, sizeof(linklistmenuitem)); linklistmenuitem.cbSize = sizeof(linklistmenuitem); @@ -145,14 +104,12 @@ int __declspec(dllexport) Load(PLUGINLINK *link) return 0; } -__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { - UNREFERENCED_PARAMETER(mirandaVersion); - return &pluginInfo; } -int __declspec(dllexport) Unload(void) +extern "C" __declspec(dllexport) int Unload(void) { UnhookEvent(ME_DB_EVENT_ADDED); DestroyCursor(splitCursor); @@ -171,7 +128,7 @@ int InitOptionsDlg(WPARAM wParam, LPARAM lParam) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_DLG); odp.pfnDlgProc = OptionsDlgProc; odp.flags = ODPF_BOLDGROUPS; - Options_AddPage(wParam, (LPARAM)&odp); + Options_AddPage(wParam, &odp); return 0; } diff --git a/plugins/HistoryLinkListPlus/linklist.h b/plugins/HistoryLinkListPlus/linklist.h index 4d56733a7d..17cc63e9c9 100644 --- a/plugins/HistoryLinkListPlus/linklist.h +++ b/plugins/HistoryLinkListPlus/linklist.h @@ -20,8 +20,25 @@ #ifndef _LINKLIST_H #define _LINKLIST_H +#define _CRT_SECURE_NO_WARNINGS +#include +#ifdef _DEBUG +#include +#endif #include +// Miranda SDK Includes +#include +#include +#include +#include +#include +#include + +#include "resource.h" +#include "linklist_dlg.h" +#include "language.h" + // Filter Flags #define WLL_URL 0x01 #define WLL_MAIL 0x02 @@ -129,10 +146,11 @@ typedef struct{ BYTE showType; }LISTOPTIONS; -BOOL WINAPI DllMain(HINSTANCE ,DWORD ,LPVOID ); -int __declspec(dllexport) Load(PLUGINLINK*); -int __declspec(dllexport) Unload(void); static INT_PTR LinkList_Main(WPARAM, LPARAM); int InitOptionsDlg(WPARAM, LPARAM); +int DBUpdate(WPARAM, LPARAM); +int ExtractURI(DBEVENTINFO*, HANDLE, LISTELEMENT*); +int RemoveList(LISTELEMENT*); +int ListCount(LISTELEMENT*); #endif //_LINKLIST_H \ No newline at end of file diff --git a/plugins/HistoryLinkListPlus/linklist.vcxproj b/plugins/HistoryLinkListPlus/linklist.vcxproj index ddf7701a56..fa7a1a5492 100644 --- a/plugins/HistoryLinkListPlus/linklist.vcxproj +++ b/plugins/HistoryLinkListPlus/linklist.vcxproj @@ -176,10 +176,10 @@ - - - - + + + + diff --git a/plugins/HistoryLinkListPlus/linklist.vcxproj.filters b/plugins/HistoryLinkListPlus/linklist.vcxproj.filters index 9e8698f21a..e71bcb3719 100644 --- a/plugins/HistoryLinkListPlus/linklist.vcxproj.filters +++ b/plugins/HistoryLinkListPlus/linklist.vcxproj.filters @@ -15,16 +15,16 @@ - + Source Files - + Source Files - + Source Files - + Source Files diff --git a/plugins/HistoryLinkListPlus/linklist_fct.h b/plugins/HistoryLinkListPlus/linklist_fct.h index 1a9b191b29..b29c8f82db 100644 --- a/plugins/HistoryLinkListPlus/linklist_fct.h +++ b/plugins/HistoryLinkListPlus/linklist_fct.h @@ -22,9 +22,6 @@ #include "linklist.h" -int ExtractURI(DBEVENTINFO*, HANDLE, LISTELEMENT*); -int RemoveList(LISTELEMENT*); -int ListCount(LISTELEMENT*); void DrawLine(HWND, size_t); BYTE GetFlags(HMENU); void GetFilterText(HMENU, LPTSTR, size_t); @@ -41,7 +38,6 @@ void GetDBColour(MYCOLOURSET*); void SetDBColour(MYCOLOURSET*); int GetMirandaColour(MYCOLOURSET*); BYTE GetUpdateSetting(void); -int DBUpdate(WPARAM, LPARAM); int LinklistResizer(HWND,LPARAM,UTILRESIZECONTROL*); // RTF Save functions BOOL SaveEditAsStream( HWND ); -- cgit v1.2.3