summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 18:36:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 18:36:28 +0000
commit8af82ecb2b91203e152d9a238bb268527fd4848d (patch)
treeef363ecf2d96a23364fbe1a385f4c1390db754ce /protocols
parent6e7708ae1760c85840f2e30e9af7221d2b149905 (diff)
mRadio, RSS, Quotes & YAMN became virtual
git-svn-id: http://svn.miranda-ng.org/main/trunk@2542 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/NewsAggregator/Src/NewsAggregator.cpp8
-rw-r--r--protocols/Quotes/src/Forex.cpp29
-rw-r--r--protocols/YAMN/src/main.cpp34
-rw-r--r--protocols/mRadio/mradio.dpr4
4 files changed, 36 insertions, 39 deletions
diff --git a/protocols/NewsAggregator/Src/NewsAggregator.cpp b/protocols/NewsAggregator/Src/NewsAggregator.cpp
index 3ab146ccbb..57795ac15d 100644
--- a/protocols/NewsAggregator/Src/NewsAggregator.cpp
+++ b/protocols/NewsAggregator/Src/NewsAggregator.cpp
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2012 Mataes
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
#include "Common.h"
@@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) int Load(void)
lstrcpyn(tszRoot, tszFolder, SIZEOF(tszRoot));
mir_free(tszFolder);
}
-
+
// Add options hook
hOptHook = HookEvent(ME_OPT_INITIALISE, OptInit);
hLoadHook = HookEvent(ME_SYSTEM_MODULESLOADED, NewsAggrInit);
@@ -88,7 +88,7 @@ extern "C" __declspec(dllexport) int Load(void)
// register weather protocol
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = MODULE;
- pd.type = PROTOTYPE_PROTOCOL;
+ pd.type = PROTOTYPE_VIRTUAL;
CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
hProtoService[0] = CreateProtoServiceFunction(MODULE, PS_GETNAME, NewsAggrGetName);
diff --git a/protocols/Quotes/src/Forex.cpp b/protocols/Quotes/src/Forex.cpp
index d5cbf7eb42..6aa7d90dcf 100644
--- a/protocols/Quotes/src/Forex.cpp
+++ b/protocols/Quotes/src/Forex.cpp
@@ -83,7 +83,7 @@ namespace
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenuRoot);
-
+
mi.ptszName = _T("Refresh All Quotes\\Rates");
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
//mi.position = 0x0FFFFFFF;
@@ -123,7 +123,7 @@ namespace
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_ImportAll);
g_ahServices.push_back(h);
-#endif
+#endif
bool bSubGroups = 1 == ServiceExists(MS_CLIST_MENUBUILDSUBGROUP);
@@ -142,7 +142,7 @@ namespace
tstring sProtocolName = quotes_a2t(QUOTES_PROTOCOL_NAME);
mi.ptszName = const_cast<TCHAR*>(sProtocolName.c_str());//A2T(QUOTES_PROTOCOL_NAME);
mi.position = 0;
-
+
hMenuRoot = Menu_AddContactMenuItem(&mi);
}
@@ -151,7 +151,7 @@ namespace
{
mi.flags |= CMIF_CHILDPOPUP;
mi.pszPopupName = (char*)hMenuRoot;
- }
+ }
mi.ptszName = _T("Refresh");
mi.popupPosition = 0;
@@ -212,7 +212,7 @@ namespace
g_hEventWorkThreadStop = ::CreateEvent(NULL,TRUE,FALSE,NULL);
h = (ME_USERINFO_INITIALISE,QuotesEventFunc_OnUserInfoInit);
g_ahEvents.push_back(h);
-
+
h = HookEvent(ME_CLIST_DOUBLECLICKED,Quotes_OnContactDoubleClick);
g_ahEvents.push_back(h);
@@ -287,7 +287,7 @@ namespace
return 0;
}
- int QuotesEventFunc_PreShutdown(WPARAM wParam, LPARAM lParam)
+ int QuotesEventFunc_PreShutdown(WPARAM wParam, LPARAM lParam)
{
QuoteProtoFunc_SetStatus(ID_STATUS_OFFLINE,0);
//WindowList_Broadcast(g_hWindowListEditSettings,WM_CLOSE,0,0);
@@ -306,13 +306,13 @@ namespace
{
return 1;
}
- }
+ }
INT_PTR QuoteProtoFunc_GetCaps(WPARAM wp,LPARAM lp)
{
int ret = 0;
switch(wp)
- {
+ {
case PFLAGNUM_1:
ret = PF1_PEER2PEER;
break;
@@ -330,7 +330,7 @@ namespace
}
INT_PTR QuoteProtoFunc_LoadIcon(WPARAM wp,LPARAM /*lp*/)
- {
+ {
if ((wp & 0xffff) == PLI_PROTOCOL)
{
return reinterpret_cast<int>(::CopyIcon(Quotes_LoadIconEx(ICON_STR_MAIN)));
@@ -378,7 +378,7 @@ namespace
// g_Instances.insert(ppro);
// return ppro;
// }
-//
+//
// int protoUninit(PROTO_INTERFACE* ppro)
// {
// g_Instances.remove((CAimProto*)ppro);
@@ -393,7 +393,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
return TRUE;
}
-extern "C"
+extern "C"
{
__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
@@ -423,10 +423,7 @@ extern "C"
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = QUOTES_PROTOCOL_NAME;
- pd.type = PROTOTYPE_PROTOCOL;
-// pd.fnInit = protoInit;
-// pd.fnUninit = protoUninit;
-
+ pd.type = PROTOTYPE_VIRTUAL;
CallService( MS_PROTO_REGISTERMODULE, 0, ( LPARAM )&pd );
HANDLE h = CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETNAME, QuoteProtoFunc_GetName);
@@ -462,7 +459,7 @@ extern "C"
std::for_each(g_ahServices.begin(),g_ahServices.end(),boost::bind(Quotes_DestroyServiceFunction,_1));
std::for_each(g_ahEvents.begin(),g_ahEvents.end(),boost::bind(Quotes_UnhookEvent,_1));
std::for_each(g_ahMenus.begin(),g_ahMenus.end(),boost::bind(Quotes_RemoveMenuItem,_1));
-
+
WaitForWorkingThreads();
::CloseHandle(g_hEventWorkThreadStop);
diff --git a/protocols/YAMN/src/main.cpp b/protocols/YAMN/src/main.cpp
index 4fa4991e8c..018d9f9565 100644
--- a/protocols/YAMN/src/main.cpp
+++ b/protocols/YAMN/src/main.cpp
@@ -38,15 +38,15 @@ YAMN_VARIABLES YAMNVar;
int hLangpack;
PLUGININFOEX pluginInfo = {
- sizeof(PLUGININFOEX),
- YAMN_SHORTNAME,
- YAMN_VERSION,
- "Mail notifier and browser for Miranda NG. Included POP3 protocol.",
- "y_b tweety (majvan)",
- "francois.mean@skynet.be",
- "© (2002-2004 majvan) 2005-2007 tweety y_b Miranda community",
- "http://miranda-ng.org/", //"http://www.majvan.host.sk/Projekty/YAMN?fm = soft",
- UNICODE_AWARE,
+ sizeof(PLUGININFOEX),
+ YAMN_SHORTNAME,
+ YAMN_VERSION,
+ "Mail notifier and browser for Miranda NG. Included POP3 protocol.",
+ "y_b tweety (majvan)",
+ "francois.mean@skynet.be",
+ "© (2002-2004 majvan) 2005-2007 tweety y_b Miranda community",
+ "http://miranda-ng.org/", //"http://www.majvan.host.sk/Projekty/YAMN?fm = soft",
+ UNICODE_AWARE,
{ 0xb047a7e5, 0x27a, 0x4cfc, { 0x8b, 0x18, 0xed, 0xa8, 0x34, 0x5d, 0x27, 0x90 } } // {B047A7E5-027A-4cfc-8B18-EDA8345D2790}
};
@@ -251,7 +251,7 @@ struct TIconListItem
HANDLE hIcon;
};
-static TIconListItem iconList[] =
+static TIconListItem iconList[] =
{
{LPGENT("Check mail"), "YAMN_Check", IDI_CHECKMAIL, 0},
@@ -317,15 +317,15 @@ static void LoadPlugins()
TCHAR *dot = _tcsrchr(fd.cFileName, '.');
if (dot == NULL )
continue;
-
+
// we have a dot
int len = (int)lstrlen(fd.cFileName); // find the length of the string
TCHAR* end = fd.cFileName+len; // get a pointer to the NULL
int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL
-
+
if ((safe!=3) || (lstrcmpi(dot+1, _T("dll"))!=0)) //not bound, however the "dll" string should mean only 3 chars are compared
continue;
-
+
HINSTANCE hDll;
LOADFILTERFCN LoadFilter;
@@ -339,7 +339,7 @@ static void LoadPlugins()
hDll = NULL;
continue;
}
-
+
if (!(*LoadFilter)(GetFcnPtrSvc)) {
FreeLibrary(hDll);
hDll = NULL;
@@ -349,7 +349,7 @@ static void LoadPlugins()
hDllPlugins = (HINSTANCE *)realloc((void *)hDllPlugins, (iDllPlugins+1)*sizeof(HINSTANCE));
hDllPlugins[iDllPlugins++] = hDll;
}
- }
+ }
while(FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -379,7 +379,7 @@ extern "C" int __declspec(dllexport) Load(void)
// we get the user path where our yamn-account.book.ini is stored from mirandaboot.ini file
GetProfileDirectory(UserDirectory, SIZEOF(UserDirectory));
-
+
// Enumerate all the code pages available for the System Locale
EnumSystemCodePages(EnumSystemCodePagesProc, CP_INSTALLED);
CodePageNamesSupp = new _tcptable[CPLENSUPP];
@@ -392,7 +392,7 @@ extern "C" int __declspec(dllexport) Load(void)
// Registering YAMN as protocol
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
pd.szName = YAMN_DBMODULE;
- pd.type = PROTOTYPE_PROTOCOL;
+ pd.type = PROTOTYPE_VIRTUAL;
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
InitializeCriticalSection(&AccountStatusCS);
diff --git a/protocols/mRadio/mradio.dpr b/protocols/mRadio/mradio.dpr
index 274fbd8977..f5e09dab4f 100644
--- a/protocols/mRadio/mradio.dpr
+++ b/protocols/mRadio/mradio.dpr
@@ -173,7 +173,7 @@ begin
if NumTries<1 then NumTries:=1;
SetStatus(0,ID_STATUS_OFFLINE);
-
+
StatusTmpl:=DBReadUnicode(0,PluginName,optStatusTmpl,'%radio_title%');
CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_NOSTATION);
@@ -297,7 +297,7 @@ begin
FillChar(desc,SizeOf(desc),0);
desc.cbSize:=PROTOCOLDESCRIPTOR_V3_SIZE;//SizeOf(desc);
desc.szName:=PluginName;
- desc._type :=PROTOTYPE_PROTOCOL;
+ desc._type :=PROTOTYPE_VIRTUAL;
CallService(MS_PROTO_REGISTERMODULE,0,lparam(@desc));
hhRadioStatus:=CreateHookableEvent(ME_RADIO_STATUS);