summaryrefslogtreecommitdiff
path: root/src/modules/srurl/url.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
commite58823d961a630eb62e60d2ccb443761ba5f1704 (patch)
tree62d071be480d57af2a53f154a1468abe0b9449ff /src/modules/srurl/url.cpp
parent721aea0764451e985d575236205808bbef298244 (diff)
- all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs.
- massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/srurl/url.cpp')
-rw-r--r--src/modules/srurl/url.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/modules/srurl/url.cpp b/src/modules/srurl/url.cpp
index 5db30d7fda..4ad806c111 100644
--- a/src/modules/srurl/url.cpp
+++ b/src/modules/srurl/url.cpp
@@ -11,7 +11,7 @@ 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,
+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.
@@ -34,39 +34,39 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
static INT_PTR ReadUrlCommand(WPARAM, LPARAM lParam)
{
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_URLRECV),NULL,DlgProcUrlRecv,lParam);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_URLRECV), NULL, DlgProcUrlRecv, lParam);
return 0;
}
-static int UrlEventAdded(WPARAM wParam,LPARAM lParam)
+static int UrlEventAdded(WPARAM wParam, LPARAM lParam)
{
CLISTEVENT cle;
DBEVENTINFO dbei;
TCHAR szTooltip[256];
- ZeroMemory(&dbei,sizeof(dbei));
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
dbei.cbBlob=0;
- CallService(MS_DB_EVENT_GET,lParam,(LPARAM)&dbei);
+ CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei);
if (dbei.flags&(DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL) return 0;
SkinPlaySound("RecvUrl");
- ZeroMemory(&cle,sizeof(cle));
+ ZeroMemory(&cle, sizeof(cle));
cle.cbSize=sizeof(cle);
cle.flags = CLEF_TCHAR;
cle.hContact=(HANDLE)wParam;
cle.hDbEvent=(HANDLE)lParam;
cle.hIcon = LoadSkinIcon( SKINICON_EVENT_URL );
cle.pszService="SRUrl/ReadUrl";
- mir_sntprintf(szTooltip,SIZEOF(szTooltip),TranslateT("URL from %s"), cli.pfnGetContactDisplayName(( HANDLE )wParam, 0 ));
+ mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), cli.pfnGetContactDisplayName(( HANDLE )wParam, 0 ));
cle.ptszTooltip=szTooltip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
return 0;
}
static INT_PTR SendUrlCommand(WPARAM wParam, LPARAM)
{
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_URLSEND),NULL,DlgProcUrlSend,wParam);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_URLSEND), NULL, DlgProcUrlSend, wParam);
return 0;
}
@@ -75,30 +75,30 @@ static void RestoreUnreadUrlAlerts(void)
CLISTEVENT cle={0};
DBEVENTINFO dbei={0};
TCHAR toolTip[256];
- HANDLE hDbEvent,hContact;
+ HANDLE hDbEvent, hContact;
dbei.cbSize=sizeof(dbei);
cle.cbSize=sizeof(cle);
cle.hIcon = LoadSkinIcon( SKINICON_EVENT_URL );
cle.pszService="SRUrl/ReadUrl";
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) {
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
+ hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0);
while (hDbEvent) {
dbei.cbBlob=0;
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_URL) {
cle.hContact=hContact;
cle.hDbEvent=hDbEvent;
cle.flags = CLEF_TCHAR;
- mir_sntprintf(toolTip,SIZEOF(toolTip),TranslateT("URL from %s"), cli.pfnGetContactDisplayName( hContact, 0 ));
+ mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("URL from %s"), cli.pfnGetContactDisplayName( hContact, 0 ));
cle.ptszTooltip=toolTip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
+ hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0);
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
}
@@ -107,9 +107,9 @@ static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
- if (lstrcmpA(cws->szModule,"CList") && (szProto == NULL || lstrcmpA(cws->szModule,szProto))) return 0;
- WindowList_Broadcast(hUrlWindowList,DM_UPDATETITLE,0,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto))) return 0;
+ WindowList_Broadcast(hUrlWindowList, DM_UPDATETITLE, 0, 0);
return 0;
}
@@ -137,7 +137,7 @@ static int SRUrlModulesLoaded(WPARAM, LPARAM)
mi.icolibItem = GetSkinIconHandle( SKINICON_EVENT_URL );
mi.pszName = LPGEN("Web Page Address (&URL)");
mi.pszService = MS_URL_SENDURL;
- hSRUrlMenuItem = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi );
+ hSRUrlMenuItem = Menu_AddContactMenuItem(&mi);
RestoreUnreadUrlAlerts();
return 0;
@@ -159,24 +159,24 @@ static int SRUrlShutdown(WPARAM, LPARAM)
int UrlContactDeleted(WPARAM wParam, LPARAM)
{
- HWND h = WindowList_Find(hUrlWindowList,(HANDLE)wParam);
+ HWND h = WindowList_Find(hUrlWindowList, (HANDLE)wParam);
if ( h )
- SendMessage(h,WM_CLOSE,0,0);
+ SendMessage(h, WM_CLOSE, 0, 0);
return 0;
}
int LoadSendRecvUrlModule(void)
{
- hUrlWindowList=(HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
- HookEvent(ME_SYSTEM_MODULESLOADED,SRUrlModulesLoaded);
- HookEvent(ME_DB_EVENT_ADDED,UrlEventAdded);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SRUrlPreBuildMenu);
+ hUrlWindowList=(HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ HookEvent(ME_SYSTEM_MODULESLOADED, SRUrlModulesLoaded);
+ HookEvent(ME_DB_EVENT_ADDED, UrlEventAdded);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SRUrlPreBuildMenu);
hEventContactSettingChange = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
hContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, UrlContactDeleted);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,SRUrlShutdown);
- CreateServiceFunction(MS_URL_SENDURL,SendUrlCommand);
- CreateServiceFunction("SRUrl/ReadUrl",ReadUrlCommand);
- SkinAddNewSoundEx("RecvUrl","URL","Incoming");
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, SRUrlShutdown);
+ CreateServiceFunction(MS_URL_SENDURL, SendUrlCommand);
+ CreateServiceFunction("SRUrl/ReadUrl", ReadUrlCommand);
+ SkinAddNewSoundEx("RecvUrl", "URL", "Incoming");
return 0;
}