diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-14 15:51:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-14 15:51:34 +0000 |
commit | e58823d961a630eb62e60d2ccb443761ba5f1704 (patch) | |
tree | 62d071be480d57af2a53f154a1468abe0b9449ff | |
parent | 721aea0764451e985d575236205808bbef298244 (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
305 files changed, 6785 insertions, 6898 deletions
diff --git a/docs/contributors.txt b/docs/contributors.txt index e721164f96..70036e8dde 100644 --- a/docs/contributors.txt +++ b/docs/contributors.txt @@ -50,4 +50,4 @@ Special mention to Piotr Lukaszewski aka nowotny, not always smiling, but always Our forum residents, who discover new and exciting ways to break Miranda daily and who are the gestalt
slash 'mob' that shapes how Miranda IM works and evolves.
-Our users, who...er...use it, and without who...well...we love that you love Miranda.
\ No newline at end of file +Our users, who...er...use it, and without who...well...we love that you love Miranda.
diff --git a/include/m_acc.h b/include/m_acc.h index 9e88087c07..0881098274 100644 --- a/include/m_acc.h +++ b/include/m_acc.h @@ -1,4 +1,4 @@ -/*
+/*
Copyright (C) 2006 Ricardo Pescuma Domenecci, Nightwish
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.
*/
diff --git a/include/m_addcontact.h b/include/m_addcontact.h index 00bf86c682..e6c0573821 100644 --- a/include/m_addcontact.h +++ b/include/m_addcontact.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -26,18 +26,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct{
int handleType; //one of the HANDLE_ constants
- HANDLE handle; //hDbEvent if acs.handleType==HANDLE_EVENT, hContact if acs.handleType==HANDLE_CONTACT, ignored if acs.handleType==HANDLE_SEARCHRESULT
- const char *szProto; //ignored if acs.handleType!=HANDLE_SEARCHRESULT
- PROTOSEARCHRESULT *psr; //ignored if acs.handleType!=HANDLE_SEARCHRESULT
+ HANDLE handle; //hDbEvent if acs.handleType == HANDLE_EVENT, hContact if acs.handleType == HANDLE_CONTACT, ignored if acs.handleType == HANDLE_SEARCHRESULT
+ const char *szProto; //ignored if acs.handleType != HANDLE_SEARCHRESULT
+ PROTOSEARCHRESULT *psr; //ignored if acs.handleType != HANDLE_SEARCHRESULT
}ADDCONTACTSTRUCT;
/*
Description: Open the add contact dialog, see notes
-
+
wParam=[ (WPARAM)hWndParent ]
lParam=(LPARAM)(ADDCONTACTSTRUCT*)&acs
- Notes:
+ Notes:
During 0.3.0.0 development (circa 2003/06/08)
@@ -47,10 +47,10 @@ typedef struct{ if you pass a structure that is bigger than PROTOSEARCHRESULT
then do not use pointers in the newly defined area because
they will not be copied.
-
- passing wParam==NULL will result in a dialog that is created modeless
- Before the circa, a modal dialog was *always* created and
+ passing wParam == NULL will result in a dialog that is created modeless
+
+ Before the circa, a modal dialog was *always* created and
strings within PROTOSEARCHRESULT were not copied.
*/
diff --git a/include/m_awaymsg.h b/include/m_awaymsg.h index 363b12c395..5b2eb974ee 100644 --- a/include/m_awaymsg.h +++ b/include/m_awaymsg.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_button.h b/include/m_button.h index 3021c57f61..293d30c893 100644 --- a/include/m_button.h +++ b/include/m_button.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -31,32 +31,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Sets whether a dropdown arrow is used
// wParam = TRUE/FALSE turns arrow on or off
// lParam = not used
-// Usage: SendMessage(hwndbutton,BUTTONSETARROW,1,0);
+// Usage: SendMessage(hwndbutton, BUTTONSETARROW, 1, 0);
// Only works on MButtonClass buttons
#define BUTTONSETARROW (WM_USER+1)
// Sets whether the button is a default button
// wParam = TRUE/FALSE default on/off
// lParam = not used
-// Usage: SendMessage(hwndbutton,BUTTONSETDEFAULT,1,0);
+// Usage: SendMessage(hwndbutton, BUTTONSETDEFAULT, 1, 0);
// Only works on MButtonClass buttons
#define BUTTONSETDEFAULT (WM_USER+2)
// Sets the button as a push button
// wParam = lParam = not used
-// Usage: SendMessage(hwndbutton,BUTTONSETASPUSHBTN,0,0);
+// Usage: SendMessage(hwndbutton, BUTTONSETASPUSHBTN, 0, 0);
// Only works on MButtonClass buttons
#define BUTTONSETASPUSHBTN (WM_USER+3)
// Sets the button type as a flat button without borders v0.3.3+
-// Usage: SendMessage(hwndbutton,BUTTONSETASFLATBTN,0,0);
+// Usage: SendMessage(hwndbutton, BUTTONSETASFLATBTN, 0, 0);
// Only works on MButtonClass buttons
#define BUTTONSETASFLATBTN (WM_USER+4)
// Sets a tooltip for the button v0.3.3+
// wParam = (WPARAM)(char *)szTip
// lParam = not used
-// Usage: SendMessage(hwndButton,BUTTONADDTOOLTIP,(WPARAM)"My Tip",BATF_* flags);
+// Usage: SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)"My Tip", BATF_* flags);
#define BATF_UNICODE 1
#if defined( _UNICODE )
#define BATF_TCHAR BATF_UNICODE
diff --git a/include/m_clc.h b/include/m_clc.h index 36a16e898b..e2b6cd036a 100644 --- a/include/m_clc.h +++ b/include/m_clc.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -190,8 +190,8 @@ typedef struct { #define CLM_SETTEXTCOLOR (CLM_FIRST+52) //wParam=FONTID_, lParam=COLORREF
//DO NOT USE IT EXTERNALLY CAN BE NOT SUPPORTED BY CLIST
-#define CLM_SETWIDEEXTRAIMAGE (CLM_FIRST+60) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFFFF is a blank
-#define CLM_GETWIDEEXTRAIMAGE (CLM_FIRST+61) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF
+#define CLM_SETWIDEEXTRAIMAGE (CLM_FIRST+60) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based), iImage). iImage=0xFFFF is a blank
+#define CLM_GETWIDEEXTRAIMAGE (CLM_FIRST+61) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based), 0), returns iImage or 0xFF
#define CLM_GETWIDEEXTRAIMAGELIST (CLM_FIRST+62) //returns HWIDEIMAGELIST
//notifications (most are omitted because the control processes everything)
@@ -208,16 +208,16 @@ typedef struct { #define CLN_FIRST (0U-100U)
#define CLN_EXPANDED (CLN_FIRST-0) //hItem=hGroup, action=CLE_*
#define CLN_LISTREBUILT (CLN_FIRST-1)
-#define CLN_ITEMCHECKED (CLN_FIRST-2) //todo //hItem,action,flags valid
-#define CLN_DRAGGING (CLN_FIRST-3) //hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
-#define CLN_DROPPED (CLN_FIRST-4) //hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+#define CLN_ITEMCHECKED (CLN_FIRST-2) //todo //hItem, action, flags valid
+#define CLN_DRAGGING (CLN_FIRST-3) //hItem, pt, flags valid. only sent when cursor outside window, return nonzero if processed
+#define CLN_DROPPED (CLN_FIRST-4) //hItem, pt, flags valid. only sent when cursor outside window, return nonzero if processed
#define CLN_LISTSIZECHANGE (CLN_FIRST-5) //pt.y valid. the vertical height of the visible items in the list has changed.
#define CLN_OPTIONSCHANGED (CLN_FIRST-6) //nothing valid. If you set some extended options they have been overwritten and should be re-set
-#define CLN_DRAGSTOP (CLN_FIRST-7) //hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed
-#define CLN_NEWCONTACT (CLN_FIRST-8) //hItem,flags valid. sent when a new contact is added without a full list rebuild
-#define CLN_CONTACTMOVED (CLN_FIRST-9) //hItem,flags valid. sent when contact is moved without a full list rebuild
-#define CLN_CHECKCHANGED (CLN_FIRST-10) //hItem,flags valid. sent when any check mark is changed, but only for one change if there are many
-//NM_CLICK //hItem,iColumn,pt,flags valid
+#define CLN_DRAGSTOP (CLN_FIRST-7) //hItem, flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed
+#define CLN_NEWCONTACT (CLN_FIRST-8) //hItem, flags valid. sent when a new contact is added without a full list rebuild
+#define CLN_CONTACTMOVED (CLN_FIRST-9) //hItem, flags valid. sent when contact is moved without a full list rebuild
+#define CLN_CHECKCHANGED (CLN_FIRST-10) //hItem, flags valid. sent when any check mark is changed, but only for one change if there are many
+//NM_CLICK //hItem, iColumn, pt, flags valid
//NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing
//an infotip for an item should be shown now
@@ -266,7 +266,7 @@ typedef struct { //wParam=newTime
//lParam=0
//Returns 0 on success or nonzero on failure
-//The value of this setting is applied to all current CLC windows, and saved
+//The value of this setting is applied to all current CLC windows, and saved
//to be applied to all future windows, including after restarts.
//newTime is in ms.
//The default is 750ms.
diff --git a/include/m_clist.h b/include/m_clist.h index 334e7d986c..2417932122 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "statusmodes.h"
+extern int hLangpack;
+
#if defined _STATIC
typedef struct _tagIntMenuItem* HGENMENU;
#else
@@ -106,12 +108,14 @@ typedef struct { int popupPosition; //position of the popup menu on the root menu. Ignored
//if pszPopupName is NULL or the popup menu already
//existed
- DWORD hotKey; //keyboard accelerator, same as lParam of WM_HOTKEY,0 for none
+ DWORD hotKey; //keyboard accelerator, same as lParam of WM_HOTKEY, 0 for none
char *pszContactOwner; //contact menus only. The protocol module that owns
//the contacts to which this menu item applies. NULL if it
//applies to all contacts. If it applies to multiple but not all
//protocols, add multiple menu items or use ME_CLIST_PREBUILDCONTACTMENU
-} CLISTMENUITEM;
+ int hLangpack; //plugin's hLangpack (added automatically)
+}
+ CLISTMENUITEM;
#define HGENMENU_ROOT (( HGENMENU )-1)
@@ -139,7 +143,10 @@ typedef struct { #define CMIF_ROOTPOPUP 128 //root item for new popup(save return id for childs)
#define CMIF_CHILDPOPUP 256 //child for rootpopup menu
-#define MS_CLIST_ADDMAINMENUITEM "CList/AddMainMenuItem"
+__inline static HGENMENU Menu_AddMainMenuItem(CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddMainMenuItem", 0, (LPARAM)mi);
+}
//add a new item to the user contact menus
//identical to clist/addmainmenuitem except when item is selected the service
@@ -149,11 +156,21 @@ typedef struct { //If ctrl is held down when right clicking, the menu position numbers will be
//displayed in brackets after the menu item text. This only works in debug
//builds.
-#define MS_CLIST_ADDCONTACTMENUITEM "CList/AddContactMenuItem"
-#define MS_CLIST_ADDSTATUSMENUITEM "CList/AddStatusMenuItem"
-//adds a protocol menu item v0.9+
-#define MS_CLIST_ADDPROTOMENUITEM "CList/AddProtoMenuItem"
+__inline static HGENMENU Menu_AddContactMenuItem(CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddContactMenuItem", 0, (LPARAM)mi);
+}
+
+__inline static HGENMENU Menu_AddStatusMenuItem(CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddStatusMenuItem", 0, (LPARAM)mi);
+}
+
+__inline static HGENMENU Menu_AddProtoMenuItem(CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddProtoMenuItem", 0, (LPARAM)mi);
+}
//modify an existing menu item v0.1.0.1+
//wParam=(WPARAM)(HANDLE)hMenuItem
@@ -363,7 +380,7 @@ typedef struct { //processes a menu selection from a menu v0.1.1.0+
-//wParam=MAKEWPARAM(LOWORD(wParam from WM_COMMAND),flags)
+//wParam=MAKEWPARAM(LOWORD(wParam from WM_COMMAND), flags)
//lParam=(LPARAM)(HANDLE)hContact
//returns TRUE if it processed the command, FALSE otherwise
//hContact is the currently selected contact. It it not used if this is a main
@@ -478,7 +495,7 @@ typedef struct { //changes the flags for a group v0.1.2.1+
//wParam=(WPARAM)(HANDLE)hGroup
-//lParam=MAKELPARAM(flags,flagsMask)
+//lParam=MAKELPARAM(flags, flagsMask)
//returns 0 on success, nonzero on failure
//Only the flags given in flagsMask are altered.
//CLUI is called on changes to GROUPF_HIDEOFFLINE.
diff --git a/include/m_clistint.h b/include/m_clistint.h index 1e88b13148..8f58397b8e 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -30,8 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define HCONTACT_ISGROUP 0x80000000
#define HCONTACT_ISINFO 0xFFFF0000
#define IsHContactGroup(h) (((UINT_PTR)(h)^HCONTACT_ISGROUP)<(HCONTACT_ISGROUP^HCONTACT_ISINFO))
-#define IsHContactInfo(h) (((UINT_PTR)(h)&HCONTACT_ISINFO)==HCONTACT_ISINFO)
-#define IsHContactContact(h) (((UINT_PTR)(h)&HCONTACT_ISGROUP)==0)
+#define IsHContactInfo(h) (((UINT_PTR)(h)&HCONTACT_ISINFO) == HCONTACT_ISINFO)
+#define IsHContactContact(h) (((UINT_PTR)(h)&HCONTACT_ISGROUP) == 0)
#define MAXEXTRACOLUMNS 16
#define MAX_TIP_SIZE 2048
@@ -89,7 +89,7 @@ typedef struct struct ClcGroup
{
ContactList cl;
- int expanded,hideOffline,groupId;
+ int expanded, hideOffline, groupId;
struct ClcGroup *parent;
int scanIndex;
int totalMembers;
@@ -98,7 +98,7 @@ struct ClcGroup struct ClcFontInfo
{
HFONT hFont;
- int fontHeight,changed;
+ int fontHeight, changed;
COLORREF colour;
};
@@ -155,8 +155,8 @@ typedef struct _menuProto #define CLCDEFAULT_SELBKCOLOUR GetSysColor(COLOR_HIGHLIGHT)
#define CLCDEFAULT_TEXTCOLOUR GetSysColor(COLOR_WINDOWTEXT)
#define CLCDEFAULT_SELTEXTCOLOUR GetSysColor(COLOR_HIGHLIGHTTEXT)
-#define CLCDEFAULT_HOTTEXTCOLOUR (IsWinVer98Plus()?RGB(0,0,255):GetSysColor(COLOR_HOTLIGHT))
-#define CLCDEFAULT_QUICKSEARCHCOLOUR RGB(255,255,0)
+#define CLCDEFAULT_HOTTEXTCOLOUR (IsWinVer98Plus()?RGB(0, 0, 255):GetSysColor(COLOR_HOTLIGHT))
+#define CLCDEFAULT_QUICKSEARCHCOLOUR RGB(255, 255, 0)
#define CLCDEFAULT_LEFTMARGIN 0
#define CLCDEFAULT_GAMMACORRECT 1
#define CLCDEFAULT_SHOWIDLE 1
@@ -232,7 +232,7 @@ typedef struct void ( *pfnFreeGroup )( struct ClcGroup *group );
int ( *pfnAddInfoItemToGroup )(struct ClcGroup *group, int flags, const TCHAR *pszText);
- int ( *pfnAddItemToGroup )( struct ClcGroup *group,int iAboveItem );
+ int ( *pfnAddItemToGroup )( struct ClcGroup *group, int iAboveItem );
int ( *pfnAddContactToGroup )( struct ClcData *dat, struct ClcGroup *group, HANDLE hContact );
void ( *pfnAddContactToTree )( HWND hwnd, struct ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline);
void ( *pfnDeleteItemFromTree )( HWND hwnd, HANDLE hItem );
@@ -312,7 +312,7 @@ typedef struct void ( *pfnCluiProtocolStatusChanged )( int status, const char* szProto );
void ( *pfnDrawMenuItem )( LPDRAWITEMSTRUCT, HICON, HICON );
void ( *pfnLoadCluiGlobalOpts )( void );
- BOOL ( *pfnInvalidateRect )( HWND hwnd, CONST RECT* lpRect,BOOL bErase );
+ BOOL ( *pfnInvalidateRect )( HWND hwnd, CONST RECT* lpRect, BOOL bErase );
void ( *pfnOnCreateClc )( void );
/* contact.c */
diff --git a/include/m_clui.h b/include/m_clui.h index c811feedc4..c02d8ed26c 100644 --- a/include/m_clui.h +++ b/include/m_clui.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -141,14 +141,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CLUIF_HASAUTOHIDEOPTION 8 //the clui options page provides a way to
//change the list auto hide options. It should read and write the
//byte "CList"/"AutoHide" and the word "CList"/"HideTime". No other
- //action is needed.
+ //action is needed.
#define CLUICAPS_FLAGS2 1 //Returns info about extra icons
//HIWORD is the first extra icon number, LOWORD is the extra icons count
//LPARAMS for CLUICAPS_FLAGS2
#define CLUIF2_PLUGININFO 1 //returns pointer to plugininfo
-#define CLUIF2_CLISTTYPE 2 // the genaration of list in chronologic
+#define CLUIF2_CLISTTYPE 2 // the genaration of list in chronologic
// modern layered return 0x07 (assuming classic, mw, meta, nicer1, modern1, nicer++, modernLayered)
// +0x0100 for unicode
#define CLUIF2_EXTRACOLUMNCOUNT 3 // return max number of extra icon available to be set in main window
@@ -158,13 +158,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //a contact is being dragged outside the main window v0.1.2.0+
//wParam=(WPARAM)(HANDLE)hContact
-//lParam=MAKELPARAM(screenX,screenY)
+//lParam=MAKELPARAM(screenX, screenY)
//return nonzero to make the cursor a 'can drop here', or zero for 'no'
#define ME_CLUI_CONTACTDRAGGING "CLUI/ContactDragging"
//a contact has just been dropped outside the main window v0.1.2.0+
//wParam=(WPARAM)(HANDLE)hContact
-//lParam=MAKELPARAM(screenX,screenY)
+//lParam=MAKELPARAM(screenX, screenY)
//return nonzero if your hook processed this, so no other hooks get it
#define ME_CLUI_CONTACTDROPPED "CLUI/ContactDropped"
diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h index dbed148cea..844d2f5e16 100644 --- a/include/m_cluiframes.h +++ b/include/m_cluiframes.h @@ -1,5 +1,5 @@ /*
-Miranda ICQ: the free icq client for MS Windows
+Miranda ICQ: the free icq client for MS Windows
Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
This program is free software; you can redistribute it and/or
@@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#if !defined(M_GENMENU_H)
+#include "m_genmenu.h"
+#endif
+
//Extra columns type.
//column arranged in this way
//
@@ -55,7 +59,7 @@ typedef struct //See above for supported columns
#define MS_CLIST_EXTRA_SET_ICON "CListFrames/SetIconForExraColumn"
-//Adding icon to extra image list.
+//Adding icon to extra image list.
//Call this in ME_CLIST_EXTRA_LIST_REBUILD event
//
//wparam=hIcon
@@ -110,7 +114,7 @@ typedef struct tagCLISTFrame { #define F_NOBORDER 16 //Dont apply WS_BORDER style for window
#define F_SHOWTBTIP 32 //Show titlebar tooltip
#define F_CANBEVERTICAL 64 //frames can be vertical
-#define F_CANNOTBEHORIZONTAL 128 //frames can NOT be horizontal F_CANBEVERTICAL have to be set
+#define F_CANNOTBEHORIZONTAL 128 //frames can NOT be horizontal F_CANBEVERTICAL have to be set
#define F_NO_SUBCONTAINER 1024 //Support skining no subcontainer needed
#define F_SKINNED 2048 // skinned frame (for owned subframe only)
#define F_UNICODE 32768 //Use unicode text
@@ -125,11 +129,11 @@ typedef struct tagCLISTFrame { #define alBottom 0x00000002
#define alClient 0x00000004 //only one alClient frame
-// since 0.7.0.20
+// since 0.7.0.20
#define alLeft 0x00000011 // frame is vertical
#define alRight 0x00000012
-#define alVertFrameMask 0x00000010
+#define alVertFrameMask 0x00000010
#define FU_TBREDRAW 1 //redraw titlebar
#define FU_FMREDRAW 2 //redraw Frame
@@ -194,14 +198,14 @@ typedef struct tagCLISTFrame { //wParam=lParam=0
//returns 0 on success, -1 on failure
#define MS_CLIST_FRAMES_HIDEALLFRAMESTB "CListFrames/HideALLFramesTB"
-
+
//////////////////////////////////////////////////////////////////////////
//shows the frame if it is hidden,
//hides the frame if it is shown
//wParam = FrameId
//lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
-//note that Frame number will be taken only if wParam == 0
+//note that Frame number will be taken only if wParam == 0
#define MS_CLIST_FRAMES_SHFRAME "CListFrames/SHFrame"
//////////////////////////////////////////////////////////////////////////
@@ -210,7 +214,7 @@ typedef struct tagCLISTFrame { //wParam=FrameId
//lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
-//note that Frame number will be taken only if wParam == 0
+//note that Frame number will be taken only if wParam == 0
#define MS_CLIST_FRAMES_SHFRAMETITLEBAR "CListFrame/SHFrameTitleBar"
//////////////////////////////////////////////////////////////////////////
@@ -219,7 +223,7 @@ typedef struct tagCLISTFrame { //wParam=FrameId
//lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
-//note that Frame number will be taken only if wParam == 0
+//note that Frame number will be taken only if wParam == 0
#define MS_CLIST_FRAMES_ULFRAME "CListFrame/ULFrame"
//////////////////////////////////////////////////////////////////////////
@@ -228,7 +232,7 @@ typedef struct tagCLISTFrame { //wParam=FrameId
//lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
-//note that Frame number will be taken only if wParam == 0
+//note that Frame number will be taken only if wParam == 0
#define MS_CLIST_FRAMES_UCOLLFRAME "CListFrame/UCOLLFrame"
//////////////////////////////////////////////////////////////////////////
@@ -236,7 +240,7 @@ typedef struct tagCLISTFrame { //wparam=frameid
//lParam = Frame number (can be shown in profile in CLUIFrames key)
//returns 0 on success, -1 on failure
-//note that Frame number will be taken only if wParam == 0
+//note that Frame number will be taken only if wParam == 0
#define MS_CLIST_FRAMES_SETUNBORDER "CListFrame/SetUnBorder"
//////////////////////////////////////////////////////////////////////////
@@ -278,7 +282,11 @@ typedef struct tagCLISTFrame { //returns a handle to the new item
//popupposition=frameid
//contactowner=advanced parameter
-#define MS_CLIST_ADDCONTEXTFRAMEMENUITEM "CList/AddContextFrameMenuItem"
+
+__inline static HGENMENU Menu_AddContextFrameMenuItem(CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddContextFrameMenuItem", 0, (LPARAM)mi);
+}
//////////////////////////////////////////////////////////////////////////
//remove a item from context frame menu
@@ -296,14 +304,14 @@ typedef struct tagCLISTFrame { //////////////////////////////////////////////////////////////////////////
// the frame menu is about to be built
-// wparam=frameid
+// wparam=frameid
// lparam=
// -1 for build from titlebar,
// use
-// MS_CLIST_ADDCONTEXTFRAMEMENUITEM
+// MS_CLIST_ADDCONTEXTFRAMEMENUITEM
// MS_CLIST_REMOVECONTEXTFRAMEMENUITEM
//
-// >0 for build in main menu,
+// >0 for build in main menu,
// must be popupname=lparam to place your items in right popup of main menu.
// use
// MS_CLIST_ADDMAINMENUITEM
@@ -315,4 +323,3 @@ typedef struct tagCLISTFrame { //needed by cluiframes module to add frames menu to main menu.
//it just calls NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
#define MS_CLIST_FRAMEMENUNOTIFY "CList/ContextFrameMenuNotify"
-
diff --git a/include/m_contactdir.h b/include/m_contactdir.h index 805fa27d64..ac7fcb0ed7 100644 --- a/include/m_contactdir.h +++ b/include/m_contactdir.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2005 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2005 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -24,25 +24,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_CONTACTDIR_H__
#define M_CONTACTDIR_H__ 1
-/* Contactdir module was created on 2005/05/17, 0.4.0.1
+/* Contactdir module was created on 2005/05/17, 0.4.0.1
-- How you use this module as a protocol --
-
+
On Load() Register your protocol with the setting name that stores unique IDs, example:
-
+
if ( ContactDir_SupportExists() ) g_Atom=ContactDir_Register("ICQ", "UIN");
-
+
This will register your protocol and walk the database looking for all contacts on PROTOCOL_NAME which have
- a "UIN" setting and store it in memory (converting to a string as needed) You of course have to
+ a "UIN" setting and store it in memory (converting to a string as needed) You of course have to
provide fallback if the services don't exist, it's an idea to keep existing code for that.
-
+
-
-
- When you add a new contact via MS_DB_CONTACT_ADD, you must register it with your protocol atom too, via
+
+ When you add a new contact via MS_DB_CONTACT_ADD, you must register it with your protocol atom too, via
ContactDir_AddContact(atom, "UIN #", hContact) and when it is deleted ContactDir_RemoveContact(atom, "UIN #")
-
+
-
-
+
To find a contact, use ContactDir_Lookup(atom, "ICQ #") which will return the hContact.
*/
@@ -128,7 +128,7 @@ static HANDLE ContactDir_Register(char * szProto, char * szSetting) return cd.atom;
}
-static __inline HANDLE ContactDir_Lookup(HANDLE atom, char * szID)
+static __inline HANDLE ContactDir_Lookup(HANDLE atom, char * szID)
{
CONTACTDIRECTORYLOOKUP f;
f.cbSize=sizeof(f);
@@ -142,7 +142,7 @@ static __inline HANDLE ContactDir_Lookup(HANDLE atom, char * szID) static __inline void ContactDir_AddContact(HANDLE atom, char * szID, HANDLE hContact)
{
CONTACTDIRECTORYLOOKUP c = {0};
- c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
+ c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
c.atom=atom;
c.szID=szID;
c.hContact=hContact;
@@ -152,7 +152,7 @@ static __inline void ContactDir_AddContact(HANDLE atom, char * szID, HANDLE hCon static __inline void ContactDir_RemoveContact(HANDLE atom, char * szID)
{
CONTACTDIRECTORYLOOKUP c = {0};
- c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
+ c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
c.atom=atom;
c.szID=szID;
c.hContact=NULL;
diff --git a/include/m_contacts.h b/include/m_contacts.h index 5b3e9980cc..549c9d589e 100644 --- a/include/m_contacts.h +++ b/include/m_contacts.h @@ -46,8 +46,8 @@ typedef struct { #define CNF_PHONE 9 // returns phone (string)
#define CNF_HOMEPAGE 10 // returns homepage (string)
#define CNF_ABOUT 11 // returns about info (string)
-#define CNF_GENDER 12 // returns gender (byte,'M','F' character)
-#define CNF_AGE 13 // returns age (byte, 0==unspecified)
+#define CNF_GENDER 12 // returns gender (byte, 'M', 'F' character)
+#define CNF_AGE 13 // returns age (byte, 0 == unspecified)
#define CNF_FIRSTLAST 14 // returns first name + last name (string)
#define CNF_UNIQUEID 15 // returns uniqueid, protocol username (must check type for type of return)
#define CNF_FAX 18 // returns fax (string)
diff --git a/include/m_database.h b/include/m_database.h index bf83d31d0e..2675b5e148 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -178,7 +178,7 @@ setting would be successfully read (which was a bug because the pValue was often garbage and maybe not even NULL terminated)
To test for existing but 'deleted' settings, the return value will
-be 2, and pValue->type==DBVT_DELETED, at this point pValue is undefined.
+be 2, and pValue->type == DBVT_DELETED, at this point pValue is undefined.
*/
typedef struct {
const char *szModule; // pointer to name of the module that wrote the
@@ -287,7 +287,7 @@ Use db/modules/enum to get a complete list of module names szSetting is only guaranteed to be valid for the duration of the callback. If
you want to keep it for longer you must allocation your own storage.
*/
-typedef int (*DBSETTINGENUMPROC)(const char *szSetting,LPARAM lParam);
+typedef int (*DBSETTINGENUMPROC)(const char *szSetting, LPARAM lParam);
typedef struct {
DBSETTINGENUMPROC pfnEnumProc;
LPARAM lParam; //passed direct to pfnEnumProc
@@ -516,17 +516,17 @@ typedef struct { __inline static char* DbGetEventTextA( DBEVENTINFO* dbei, int codepage )
{ DBEVENTGETTEXT temp = { dbei, DBVT_ASCIIZ, codepage };
- return (char*)CallService(MS_DB_EVENT_GETTEXT,0,(LPARAM)&temp);
+ return (char*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&temp);
}
__inline static WCHAR* DbGetEventTextW( DBEVENTINFO* dbei, int codepage )
{ DBEVENTGETTEXT temp = { dbei, DBVT_WCHAR, codepage };
- return (WCHAR*)CallService(MS_DB_EVENT_GETTEXT,0,(LPARAM)&temp);
+ return (WCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&temp);
}
__inline static TCHAR* DbGetEventTextT( DBEVENTINFO* dbei, int codepage )
{ DBEVENTGETTEXT temp = { dbei, DBVT_TCHAR, codepage };
- return (TCHAR*)CallService(MS_DB_EVENT_GETTEXT,0,(LPARAM)&temp);
+ return (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&temp);
}
/* DB/Event/GetIcon (0.7.0.1+)
@@ -749,11 +749,11 @@ Writing to the database while module names are being enumerated will cause unpredictable results in the enumeration, but the write will work.
szModuleName is only guaranteed to be valid for the duration of the callback.
If you want to keep it for longer you must allocation your own storage.
-**BUG**: Prior to 0.1.2.0 dbmep was called as (lParam)(szMod,ofsMod,lParam).
+**BUG**: Prior to 0.1.2.0 dbmep was called as (lParam)(szMod, ofsMod, lParam).
This means that the lParam parameter to dbmep was useless, and explains the
slightly odd 'wParam=lParam' in the definition.
*/
-typedef int (*DBMODULEENUMPROC)(const char *szModuleName,DWORD ofsModuleName,LPARAM lParam);
+typedef int (*DBMODULEENUMPROC)(const char *szModuleName, DWORD ofsModuleName, LPARAM lParam);
#define MS_DB_MODULES_ENUM "DB/Modules/Enum"
/* DB/Module/Delete 0.8.0+
@@ -860,34 +860,34 @@ Disables a setting saving to the database. #ifndef DB_NOHELPERFUNCTIONS
-#define db_byte_get(a,b,c,d) DBGetContactSettingByte(a,b,c,d)
-#define db_word_get(a,b,c,d) DBGetContactSettingWord(a,b,c,d)
-#define db_dword_get(a,b,c,d) DBGetContactSettingDword(a,b,c,d)
-#define db_get(a,b,c,d) DBGetContactSetting(a,b,c,d)
+#define db_byte_get(a, b, c, d) DBGetContactSettingByte(a, b, c, d)
+#define db_word_get(a, b, c, d) DBGetContactSettingWord(a, b, c, d)
+#define db_dword_get(a, b, c, d) DBGetContactSettingDword(a, b, c, d)
+#define db_get(a, b, c, d) DBGetContactSetting(a, b, c, d)
-#define db_byte_set(a,b,c,d) DBWriteContactSettingByte(a,b,c,d)
-#define db_word_set(a,b,c,d) DBWriteContactSettingWord(a,b,c,d)
-#define db_dword_set(a,b,c,d) DBWriteContactSettingDword(a,b,c,d)
-#define db_string_set(a,b,c,d) DBWriteContactSettingString(a,b,c,d)
+#define db_byte_set(a, b, c, d) DBWriteContactSettingByte(a, b, c, d)
+#define db_word_set(a, b, c, d) DBWriteContactSettingWord(a, b, c, d)
+#define db_dword_set(a, b, c, d) DBWriteContactSettingDword(a, b, c, d)
+#define db_string_set(a, b, c, d) DBWriteContactSettingString(a, b, c, d)
-#define db_unset(a,b,c) DBDeleteContactSetting(a,b,c);
+#define db_unset(a, b, c) DBDeleteContactSetting(a, b, c);
#ifdef _DEBUG
- #define DBGetContactSettingByte(a,b,c,d) DBGetContactSettingByte_Helper(a,b,c,d,__FILE__,__LINE__)
- #define DBGetContactSettingWord(a,b,c,d) DBGetContactSettingWord_Helper(a,b,c,d,__FILE__,__LINE__)
- #define DBGetContactSettingDword(a,b,c,d) DBGetContactSettingDword_Helper(a,b,c,d,__FILE__,__LINE__)
- #define DBGetContactSetting(a,b,c,d) DBGetContactSetting_Helper(a,b,c,d,__FILE__,__LINE__)
- #define DBGetContactSettingString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,DBVT_ASCIIZ)
- #define DBGetContactSettingWString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,DBVT_WCHAR)
- #define DBGetContactSettingUTF8String(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,DBVT_UTF8)
+ #define DBGetContactSettingByte(a, b, c, d) DBGetContactSettingByte_Helper(a, b, c, d, __FILE__, __LINE__)
+ #define DBGetContactSettingWord(a, b, c, d) DBGetContactSettingWord_Helper(a, b, c, d, __FILE__, __LINE__)
+ #define DBGetContactSettingDword(a, b, c, d) DBGetContactSettingDword_Helper(a, b, c, d, __FILE__, __LINE__)
+ #define DBGetContactSetting(a, b, c, d) DBGetContactSetting_Helper(a, b, c, d, __FILE__, __LINE__)
+ #define DBGetContactSettingString(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, __FILE__, __LINE__, DBVT_ASCIIZ)
+ #define DBGetContactSettingWString(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, __FILE__, __LINE__, DBVT_WCHAR)
+ #define DBGetContactSettingUTF8String(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, __FILE__, __LINE__, DBVT_UTF8)
#else
- #define DBGetContactSettingByte(a,b,c,d) DBGetContactSettingByte_Helper(a,b,c,d)
- #define DBGetContactSettingWord(a,b,c,d) DBGetContactSettingWord_Helper(a,b,c,d)
- #define DBGetContactSettingDword(a,b,c,d) DBGetContactSettingDword_Helper(a,b,c,d)
- #define DBGetContactSetting(a,b,c,d) DBGetContactSetting_Helper(a,b,c,d)
- #define DBGetContactSettingString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,DBVT_ASCIIZ)
- #define DBGetContactSettingWString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,DBVT_WCHAR)
- #define DBGetContactSettingUTF8String(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,DBVT_UTF8)
+ #define DBGetContactSettingByte(a, b, c, d) DBGetContactSettingByte_Helper(a, b, c, d)
+ #define DBGetContactSettingWord(a, b, c, d) DBGetContactSettingWord_Helper(a, b, c, d)
+ #define DBGetContactSettingDword(a, b, c, d) DBGetContactSettingDword_Helper(a, b, c, d)
+ #define DBGetContactSetting(a, b, c, d) DBGetContactSetting_Helper(a, b, c, d)
+ #define DBGetContactSettingString(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, DBVT_ASCIIZ)
+ #define DBGetContactSettingWString(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, DBVT_WCHAR)
+ #define DBGetContactSettingUTF8String(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, DBVT_UTF8)
#endif
#ifdef _UNICODE
@@ -896,15 +896,15 @@ Disables a setting saving to the database. #define DBGetContactSettingTString DBGetContactSettingString
#endif
-#define db_msg_dbg(s) MessageBoxA(0,(s),"",0);
+#define db_msg_dbg(s) MessageBoxA(0, (s), "", 0);
/* Deprecated & bizarre aliases */
#define DBGetContactSettingStringUtf DBGetContactSettingUTF8String
#define DBWriteContactSettingStringUtf DBWriteContactSettingUTF8String
#ifdef _DEBUG
- #define DBGetContactSettingW(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,0)
+ #define DBGetContactSettingW(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, __FILE__, __LINE__, 0)
#else
- #define DBGetContactSettingW(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,0)
+ #define DBGetContactSettingW(a, b, c, d) DBGetContactSettingString_Helper(a, b, c, d, 0)
#endif
#ifdef _DEBUG
@@ -913,7 +913,7 @@ Disables a setting saving to the database. __inline static int DBGetContactSettingByte_Helper(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue
#ifdef _DEBUG
- ,const char *szFile, const int nLine
+ , const char *szFile, const int nLine
#endif
)
{
@@ -923,12 +923,12 @@ __inline static int DBGetContactSettingByte_Helper(HANDLE hContact, const char * cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
- if(CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
+ if(CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&cgs))
return errorValue;
#ifdef _DEBUG
- if(dbv.type!=DBVT_BYTE) {
+ if(dbv.type != DBVT_BYTE) {
char buf[128];
- _snprintf(buf,sizeof(buf),"%s:%d for %s/%s not a byte, return: %d",szFile,nLine,szModule,szSetting,dbv.type);
+ _snprintf(buf, sizeof(buf), "%s:%d for %s/%s not a byte, return: %d", szFile, nLine, szModule, szSetting, dbv.type);
buf[sizeof(buf)-1]=0;
db_msg_dbg(buf);
}
@@ -936,9 +936,9 @@ __inline static int DBGetContactSettingByte_Helper(HANDLE hContact, const char * return dbv.bVal;
}
-__inline static int DBGetContactSettingWord_Helper(HANDLE hContact,const char *szModule,const char *szSetting,int errorValue
+__inline static int DBGetContactSettingWord_Helper(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue
#ifdef _DEBUG
- ,const char *szFile, const int nLine
+ , const char *szFile, const int nLine
#endif
)
{
@@ -948,12 +948,12 @@ __inline static int DBGetContactSettingWord_Helper(HANDLE hContact,const char *s cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
- if(CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
+ if(CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&cgs))
return errorValue;
#ifdef _DEBUG
- if(dbv.type!=DBVT_WORD) {
+ if(dbv.type != DBVT_WORD) {
char buf[128];
- _snprintf(buf,sizeof(buf),"%s:%d for %s/%s not a word, return: %d",szFile,nLine,szModule,szSetting,dbv.type);
+ _snprintf(buf, sizeof(buf), "%s:%d for %s/%s not a word, return: %d", szFile, nLine, szModule, szSetting, dbv.type);
buf[sizeof(buf)-1]=0;
db_msg_dbg(buf);
}
@@ -961,9 +961,9 @@ __inline static int DBGetContactSettingWord_Helper(HANDLE hContact,const char *s return dbv.wVal;
}
-__inline static DWORD DBGetContactSettingDword_Helper(HANDLE hContact,const char *szModule, const char *szSetting, DWORD errorValue
+__inline static DWORD DBGetContactSettingDword_Helper(HANDLE hContact, const char *szModule, const char *szSetting, DWORD errorValue
#ifdef _DEBUG
- ,const char *szFile, const int nLine
+ , const char *szFile, const int nLine
#endif
)
{
@@ -973,12 +973,12 @@ __inline static DWORD DBGetContactSettingDword_Helper(HANDLE hContact,const char cgs.szModule=szModule;
cgs.szSetting=szSetting;
cgs.pValue=&dbv;
- if(CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
+ if(CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&cgs))
return errorValue;
#ifdef _DEBUG
- if(dbv.type!=DBVT_DWORD) {
+ if(dbv.type != DBVT_DWORD) {
char buf[128];
- _snprintf(buf,sizeof(buf),"%s:%d for %s/%s not a dword, return: %d",szFile,nLine,szModule,szSetting,dbv.type);
+ _snprintf(buf, sizeof(buf), "%s:%d for %s/%s not a dword, return: %d", szFile, nLine, szModule, szSetting, dbv.type);
buf[sizeof(buf)-1]=0;
db_msg_dbg(buf);
}
@@ -986,9 +986,9 @@ __inline static DWORD DBGetContactSettingDword_Helper(HANDLE hContact,const char return dbv.dVal;
}
-__inline static INT_PTR DBGetContactSetting_Helper(HANDLE hContact,const char *szModule,const char *szSetting,DBVARIANT *dbv
+__inline static INT_PTR DBGetContactSetting_Helper(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv
#if defined(_DEBUG)
- ,const char *szFile, const int nLine
+ , const char *szFile, const int nLine
#endif
)
{
@@ -998,18 +998,18 @@ __inline static INT_PTR DBGetContactSetting_Helper(HANDLE hContact,const char *s cgs.szSetting=szSetting;
cgs.pValue=dbv;
- rc=CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs);
+ rc=CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&cgs);
#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
if (rc != 0) {
char buf[128];
- _snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
+ _snprintf(buf, sizeof(buf), "%s:%d failed to fetch %s/%s", szFile, nLine, szModule, szSetting);
db_msg_dbg(buf);
}
#endif
return rc;
}
-__inline static INT_PTR DBGetContactSettingString_Helper(HANDLE hContact,const char *szModule,const char *szSetting,DBVARIANT *dbv,
+__inline static INT_PTR DBGetContactSettingString_Helper(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv,
#if defined(_DEBUG)
const char *szFile, const int nLine,
#endif
@@ -1022,11 +1022,11 @@ __inline static INT_PTR DBGetContactSettingString_Helper(HANDLE hContact,const c cgs.pValue=dbv;
dbv->type=(BYTE)nType;
- rc=CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
+ rc=CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&cgs);
#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
if (rc != 0) {
char buf[128];
- _snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
+ _snprintf(buf, sizeof(buf), "%s:%d failed to fetch %s/%s", szFile, nLine, szModule, szSetting);
db_msg_dbg(buf);
}
#endif
@@ -1035,15 +1035,15 @@ __inline static INT_PTR DBGetContactSettingString_Helper(HANDLE hContact,const c __inline static INT_PTR DBFreeVariant(DBVARIANT *dbv)
{
- return CallService(MS_DB_CONTACT_FREEVARIANT,0,(LPARAM)dbv);
+ return CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)dbv);
}
-__inline static char *DBGetString(HANDLE hContact,const char *szModule,const char *szSetting)
+__inline static char *DBGetString(HANDLE hContact, const char *szModule, const char *szSetting)
{
char *str=NULL;
DBVARIANT dbv={0};
- DBGetContactSettingString(hContact,szModule,szSetting,&dbv);
- if(dbv.type==DBVT_ASCIIZ)
+ DBGetContactSettingString(hContact, szModule, szSetting, &dbv);
+ if(dbv.type == DBVT_ASCIIZ)
str=mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
return str;
@@ -1051,12 +1051,12 @@ __inline static char *DBGetString(HANDLE hContact,const char *szModule,const cha #define DBGetStringA DBGetString
-__inline static wchar_t *DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting)
+__inline static wchar_t *DBGetStringW(HANDLE hContact, const char *szModule, const char *szSetting)
{
wchar_t *str=NULL;
DBVARIANT dbv={0};
- DBGetContactSettingWString(hContact,szModule,szSetting,&dbv);
- if(dbv.type==DBVT_WCHAR)
+ DBGetContactSettingWString(hContact, szModule, szSetting, &dbv);
+ if(dbv.type == DBVT_WCHAR)
str=mir_wstrdup(dbv.pwszVal);
DBFreeVariant(&dbv);
return str;
@@ -1068,15 +1068,15 @@ __inline static wchar_t *DBGetStringW(HANDLE hContact,const char *szModule,const #define DBGetStringT DBGetString
#endif
-__inline static INT_PTR DBDeleteContactSetting(HANDLE hContact,const char *szModule,const char *szSetting)
+__inline static INT_PTR DBDeleteContactSetting(HANDLE hContact, const char *szModule, const char *szSetting)
{
DBCONTACTGETSETTING cgs;
cgs.szModule=szModule;
cgs.szSetting=szSetting;
- return CallService(MS_DB_CONTACT_DELETESETTING,(WPARAM)hContact,(LPARAM)&cgs);
+ return CallService(MS_DB_CONTACT_DELETESETTING, (WPARAM)hContact, (LPARAM)&cgs);
}
-__inline static INT_PTR DBWriteContactSettingByte(HANDLE hContact,const char *szModule,const char *szSetting,BYTE val)
+__inline static INT_PTR DBWriteContactSettingByte(HANDLE hContact, const char *szModule, const char *szSetting, BYTE val)
{
DBCONTACTWRITESETTING cws;
@@ -1084,10 +1084,10 @@ __inline static INT_PTR DBWriteContactSettingByte(HANDLE hContact,const char *sz cws.szSetting=szSetting;
cws.value.type=DBVT_BYTE;
cws.value.bVal=val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
-__inline static INT_PTR DBWriteContactSettingWord(HANDLE hContact,const char *szModule,const char *szSetting,WORD val)
+__inline static INT_PTR DBWriteContactSettingWord(HANDLE hContact, const char *szModule, const char *szSetting, WORD val)
{
DBCONTACTWRITESETTING cws;
@@ -1095,10 +1095,10 @@ __inline static INT_PTR DBWriteContactSettingWord(HANDLE hContact,const char *sz cws.szSetting=szSetting;
cws.value.type=DBVT_WORD;
cws.value.wVal=val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
-__inline static INT_PTR DBWriteContactSettingDword(HANDLE hContact,const char *szModule,const char *szSetting,DWORD val)
+__inline static INT_PTR DBWriteContactSettingDword(HANDLE hContact, const char *szModule, const char *szSetting, DWORD val)
{
DBCONTACTWRITESETTING cws;
@@ -1106,10 +1106,10 @@ __inline static INT_PTR DBWriteContactSettingDword(HANDLE hContact,const char *s cws.szSetting=szSetting;
cws.value.type=DBVT_DWORD;
cws.value.dVal=val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
-__inline static INT_PTR DBWriteContactSettingString(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
+__inline static INT_PTR DBWriteContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, const char *val)
{
DBCONTACTWRITESETTING cws;
@@ -1117,10 +1117,10 @@ __inline static INT_PTR DBWriteContactSettingString(HANDLE hContact,const char * cws.szSetting=szSetting;
cws.value.type=DBVT_ASCIIZ;
cws.value.pszVal=(char*)val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
-__inline static INT_PTR DBWriteContactSettingWString(HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val)
+__inline static INT_PTR DBWriteContactSettingWString(HANDLE hContact, const char *szModule, const char *szSetting, const WCHAR *val)
{
DBCONTACTWRITESETTING cws;
@@ -1128,7 +1128,7 @@ __inline static INT_PTR DBWriteContactSettingWString(HANDLE hContact,const char cws.szSetting=szSetting;
cws.value.type=DBVT_WCHAR;
cws.value.pwszVal=(WCHAR*)val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
#ifdef _UNICODE
@@ -1137,7 +1137,7 @@ __inline static INT_PTR DBWriteContactSettingWString(HANDLE hContact,const char #define DBWriteContactSettingTString DBWriteContactSettingString
#endif
-__inline static INT_PTR DBWriteContactSettingUTF8String(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
+__inline static INT_PTR DBWriteContactSettingUTF8String(HANDLE hContact, const char *szModule, const char *szSetting, const char *val)
{
DBCONTACTWRITESETTING cws;
@@ -1145,10 +1145,10 @@ __inline static INT_PTR DBWriteContactSettingUTF8String(HANDLE hContact,const ch cws.szSetting=szSetting;
cws.value.type=DBVT_UTF8;
cws.value.pszVal=(char*)val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
-__inline static INT_PTR DBWriteContactSettingBlob(HANDLE hContact,const char *szModule,const char *szSetting,void *val,unsigned len)
+__inline static INT_PTR DBWriteContactSettingBlob(HANDLE hContact, const char *szModule, const char *szSetting, void *val, unsigned len)
{
DBCONTACTWRITESETTING cws;
@@ -1157,7 +1157,7 @@ __inline static INT_PTR DBWriteContactSettingBlob(HANDLE hContact,const char *sz cws.value.type=DBVT_BLOB;
cws.value.cpbVal = (WORD)len;
cws.value.pbVal=(unsigned char*)val;
- return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+ return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
/* inlined range tolerate versions */
@@ -1168,9 +1168,9 @@ __inline static BYTE DBGetContactSettingRangedByte(HANDLE hContact, const char * if (bVal < minValue || bVal > maxValue) {
#ifdef _DEBUG
char szBuf[MAX_PATH];
- _snprintf(szBuf,sizeof(szBuf),"(%s:%s) not in range of %d..%d",szModule,szSetting,minValue,maxValue);
+ _snprintf(szBuf, sizeof(szBuf), "(%s:%s) not in range of %d..%d", szModule, szSetting, minValue, maxValue);
szBuf[sizeof(szBuf)-1]=0;
- MessageBoxA(0,szBuf,"DBGetContactSettingRangedByte failed",MB_ICONERROR);
+ MessageBoxA(0, szBuf, "DBGetContactSettingRangedByte failed", MB_ICONERROR);
#endif
return errorValue;
}
@@ -1183,9 +1183,9 @@ __inline static WORD DBGetContactSettingRangedWord(HANDLE hContact, const char * if (wVal < minValue || wVal > maxValue) {
#ifdef _DEBUG
char szBuf[MAX_PATH];
- _snprintf(szBuf,sizeof(szBuf),"(%s:%s) not in range of %d..%d",szModule,szSetting,minValue,maxValue);
+ _snprintf(szBuf, sizeof(szBuf), "(%s:%s) not in range of %d..%d", szModule, szSetting, minValue, maxValue);
szBuf[sizeof(szBuf)-1]=0;
- MessageBoxA(0,szBuf,"DBGetContactSettingRangedWord failed",MB_ICONERROR);
+ MessageBoxA(0, szBuf, "DBGetContactSettingRangedWord failed", MB_ICONERROR);
#endif
return errorValue;
}
@@ -1198,9 +1198,9 @@ __inline static DWORD DBGetContactSettingRangedDword(HANDLE hContact, const char if (dVal < minValue || dVal > maxValue) {
#ifdef _DEBUG
char szBuf[MAX_PATH];
- _snprintf(szBuf,sizeof(szBuf),"(%s:%s) not in range of %d..%d",szModule,szSetting,minValue,maxValue);
+ _snprintf(szBuf, sizeof(szBuf), "(%s:%s) not in range of %d..%d", szModule, szSetting, minValue, maxValue);
szBuf[sizeof(szBuf)-1]=0;
- MessageBoxA(0,szBuf,"DBGetContactSettingRangedDword failed",MB_ICONERROR);
+ MessageBoxA(0, szBuf, "DBGetContactSettingRangedDword failed", MB_ICONERROR);
#endif
return errorValue;
}
diff --git a/include/m_email.h b/include/m_email.h index db963a877f..5ff1962328 100644 --- a/include/m_email.h +++ b/include/m_email.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_errors.h b/include/m_errors.h index c19e76dfe7..86b053ec7d 100644 --- a/include/m_errors.h +++ b/include/m_errors.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_file.h b/include/m_file.h index 73cd51d5a5..44c9ff1c27 100644 --- a/include/m_file.h +++ b/include/m_file.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_findadd.h b/include/m_findadd.h index 2ea19815f0..ed0cd60ec8 100644 --- a/include/m_findadd.h +++ b/include/m_findadd.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@ open. wParam=lParam=0
returns 0 always
*/
-#define MS_FINDADD_FINDADD "FindAdd/FindAddCommand"
+#define MS_FINDADD_FINDADD "FindAdd/FindAddCommand"
#endif // M_FINDADD_H__
diff --git a/include/m_freeimage.h b/include/m_freeimage.h index 17e471a820..251408aa50 100644 --- a/include/m_freeimage.h +++ b/include/m_freeimage.h @@ -60,10 +60,10 @@ #else
#if defined(_WIN32) || defined(__WIN32__)
#define DLL_CALLCONV __stdcall
- // The following ifdef block is the standard way of creating macros which make exporting
+ // The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the FREEIMAGE_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
- // that uses this DLL. This way any other project whose source files include this file see
+ // that uses this DLL. This way any other project whose source files include this file see
// DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef FREEIMAGE_EXPORTS
@@ -71,7 +71,7 @@ #else
#define DLL_API __declspec(dllimport)
#endif // FREEIMAGE_EXPORTS
- #else
+ #else
// try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility)
#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#ifndef GCC_HASCLASSVISIBILITY
@@ -83,7 +83,7 @@ #define DLL_API __attribute__ ((visibility("default")))
#else
#define DLL_API
- #endif
+ #endif
#endif // WIN32 / !WIN32
#endif // FREEIMAGE_LIB
@@ -207,20 +207,20 @@ typedef struct tagRGBTRIPLE { typedef struct tagBITMAPINFOHEADER{
DWORD biSize;
- LONG biWidth;
- LONG biHeight;
- WORD biPlanes;
+ LONG biWidth;
+ LONG biHeight;
+ WORD biPlanes;
WORD biBitCount;
- DWORD biCompression;
- DWORD biSizeImage;
- LONG biXPelsPerMeter;
- LONG biYPelsPerMeter;
- DWORD biClrUsed;
+ DWORD biCompression;
+ DWORD biSizeImage;
+ LONG biXPelsPerMeter;
+ LONG biYPelsPerMeter;
+ DWORD biClrUsed;
DWORD biClrImportant;
-} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
+} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
-typedef struct tagBITMAPINFO {
- BITMAPINFOHEADER bmiHeader;
+typedef struct tagBITMAPINFO {
+ BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO, *PBITMAPINFO;
@@ -234,7 +234,7 @@ typedef struct tagBITMAPINFO { #pragma pack(1)
#endif // WIN32
-/** 48-bit RGB
+/** 48-bit RGB
*/
typedef struct tagFIRGB16 {
WORD red;
@@ -370,7 +370,7 @@ typedef struct tagFICOMPLEX { #define FIICC_DEFAULT 0x00
#define FIICC_COLOR_IS_CMYK 0x01
-FI_STRUCT (FIICCPROFILE) {
+FI_STRUCT (FIICCPROFILE) {
WORD flags; // info flag
DWORD size; // profile's size measured in bytes
void *data; // points to a block of contiguous memory containing the profile
@@ -493,7 +493,7 @@ FI_ENUM(FREE_IMAGE_TMO) { FITMO_FATTAL02 = 2 // Gradient domain high dynamic range compression (R. Fattal, 2002)
};
-/** Upsampling / downsampling filters.
+/** Upsampling / downsampling filters.
Constants used in FreeImage_Rescale.
*/
FI_ENUM(FREE_IMAGE_FILTER) {
@@ -529,21 +529,21 @@ FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) { Note: RATIONALs are the ratio of two 32-bit integer values.
*/
FI_ENUM(FREE_IMAGE_MDTYPE) {
- FIDT_NOTYPE = 0, // placeholder
- FIDT_BYTE = 1, // 8-bit unsigned integer
- FIDT_ASCII = 2, // 8-bit bytes w/ last byte null
- FIDT_SHORT = 3, // 16-bit unsigned integer
- FIDT_LONG = 4, // 32-bit unsigned integer
- FIDT_RATIONAL = 5, // 64-bit unsigned fraction
- FIDT_SBYTE = 6, // 8-bit signed integer
- FIDT_UNDEFINED = 7, // 8-bit untyped data
- FIDT_SSHORT = 8, // 16-bit signed integer
- FIDT_SLONG = 9, // 32-bit signed integer
- FIDT_SRATIONAL = 10, // 64-bit signed fraction
- FIDT_FLOAT = 11, // 32-bit IEEE floating point
- FIDT_DOUBLE = 12, // 64-bit IEEE floating point
- FIDT_IFD = 13, // 32-bit unsigned integer (offset)
- FIDT_PALETTE = 14 // 32-bit RGBQUAD
+ FIDT_NOTYPE = 0, // placeholder
+ FIDT_BYTE = 1, // 8-bit unsigned integer
+ FIDT_ASCII = 2, // 8-bit bytes w/ last byte null
+ FIDT_SHORT = 3, // 16-bit unsigned integer
+ FIDT_LONG = 4, // 32-bit unsigned integer
+ FIDT_RATIONAL = 5, // 64-bit unsigned fraction
+ FIDT_SBYTE = 6, // 8-bit signed integer
+ FIDT_UNDEFINED = 7, // 8-bit untyped data
+ FIDT_SSHORT = 8, // 16-bit signed integer
+ FIDT_SLONG = 9, // 32-bit signed integer
+ FIDT_SRATIONAL = 10, // 64-bit signed fraction
+ FIDT_FLOAT = 11, // 32-bit IEEE floating point
+ FIDT_DOUBLE = 12, // 64-bit IEEE floating point
+ FIDT_IFD = 13, // 32-bit unsigned integer (offset)
+ FIDT_PALETTE = 14 // 32-bit RGBQUAD
};
/**
@@ -690,9 +690,9 @@ typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id); #define JPEG_QUALITYAVERAGE 0x0400 // save with average quality (25:1)
#define JPEG_QUALITYBAD 0x0800 // save with bad quality (10:1)
#define JPEG_PROGRESSIVE 0x2000 // save as a progressive-JPEG (use | to combine with other save flags)
-#define JPEG_SUBSAMPLING_411 0x1000 // save with high 4x1 chroma subsampling (4:1:1)
+#define JPEG_SUBSAMPLING_411 0x1000 // save with high 4x1 chroma subsampling (4:1:1)
#define JPEG_SUBSAMPLING_420 0x4000 // save with medium 2x2 medium chroma subsampling (4:2:0) - default value
-#define JPEG_SUBSAMPLING_422 0x8000 // save with low 2x1 chroma subsampling (4:2:2)
+#define JPEG_SUBSAMPLING_422 0x8000 // save with low 2x1 chroma subsampling (4:2:2)
#define JPEG_SUBSAMPLING_444 0x10000 // save with no chroma subsampling (4:4:4)
#define KOALA_DEFAULT 0
#define LBM_DEFAULT 0
@@ -763,9 +763,9 @@ DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void); // Message output functions -------------------------------------------------
typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg);
-typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg);
+typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg);
-DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf);
+DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf);
DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf);
DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...);
diff --git a/include/m_fuse.h b/include/m_fuse.h index 8a2ff8169f..7df4d1e89b 100644 --- a/include/m_fuse.h +++ b/include/m_fuse.h @@ -4,8 +4,8 @@ #define CALLSERVICE_NOTFOUND ((int)0x80000000)
#define MAXMODULELABELLENGTH 64
-typedef int (*MIRANDAHOOK)(WPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM);
+typedef int (*MIRANDAHOOK)(WPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICE)(WPARAM, LPARAM);
#define FUSE_INIT 0 // core started, Param=**FUSE_LINK
#define FUSE_DEINIT 1 // core stopped
@@ -16,16 +16,16 @@ typedef struct { int cbSize;
HANDLE (*CreateHookableEvent)(const char *);
int (*DestroyHookableEvent)(HANDLE);
- int (*NotifyEventHooks)(HANDLE,WPARAM,LPARAM);
- HANDLE (*HookEvent)(const char *,MIRANDAHOOK);
- HANDLE (*HookEventMessage)(const char *,HWND,UINT);
+ int (*NotifyEventHooks)(HANDLE, WPARAM, LPARAM);
+ HANDLE (*HookEvent)(const char *, MIRANDAHOOK);
+ HANDLE (*HookEventMessage)(const char *, HWND, UINT);
int (*UnhookEvent)(HANDLE);
- HANDLE (*CreateServiceFunction)(const char *,MIRANDASERVICE);
- HANDLE (*CreateTransientServiceFunction)(const char *,MIRANDASERVICE);
+ HANDLE (*CreateServiceFunction)(const char *, MIRANDASERVICE);
+ HANDLE (*CreateTransientServiceFunction)(const char *, MIRANDASERVICE);
int (*DestroyServiceFunction)(HANDLE);
- int (*CallService)(const char *,WPARAM,LPARAM);
+ int (*CallService)(const char *, WPARAM, LPARAM);
int (*ServiceExists)(const char *); //v0.1.0.1+
- int (*CallServiceSync)(const char*,WPARAM,LPARAM); //v0.1.2.2+
+ int (*CallServiceSync)(const char*, WPARAM, LPARAM); //v0.1.2.2+
} FUSE_LINK;
#endif
diff --git a/include/m_genmenu.h b/include/m_genmenu.h index cea3107730..c0d20fc9f1 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -5,6 +5,8 @@ #include <m_clist.h>
#endif
+extern int hLangpack;
+
/*
Main features:
1) Independet from clist,may be used in any module.
@@ -96,6 +98,13 @@ plugin may add different menu items with some service. */
// SubGroup MENU
+
+// Group MENU
+typedef struct{
+int wParam;
+int lParam;
+}GroupMenuParam,*lpGroupMenuParam;
+
//remove a item from SubGroup menu
//wParam=hMenuItem returned by MS_CLIST_ADDSubGroupMENUITEM
//lParam=0
@@ -110,22 +119,18 @@ plugin may add different menu items with some service. //add a new item to the SubGroup menus
//wParam=lpGroupMenuParam, params to call when exec menuitem
//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-#define MS_CLIST_ADDSUBGROUPMENUITEM "CList/AddSubGroupMenuItem"
+
+__inline static HGENMENU Menu_AddSubGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddSubGroupMenuItem", (WPARAM)gmp, (LPARAM)mi);
+}
//the SubGroup menu is about to be built
//wParam=lParam=0
#define ME_CLIST_PREBUILDSUBGROUPMENU "CList/PreBuildSubGroupMenu"
-// SubGroup MENU
-
-// Group MENU
-typedef struct{
-int wParam;
-int lParam;
-}GroupMenuParam,*lpGroupMenuParam;
-
//remove a item from Group menu
-//wParam=hMenuItem returned by MS_CLIST_ADDGroupMENUITEM
+//wParam=hMenuItem returned by MS_CLIST_ADDGROUPMENUITEM
//lParam=0
//returns 0 on success, nonzero on failure
#define MS_CLIST_REMOVEGROUPMENUITEM "CList/RemoveGroupMenuItem"
@@ -138,7 +143,11 @@ int lParam; //add a new item to the Group menus
//wParam=lpGroupMenuParam, params to call when exec menuitem
//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-#define MS_CLIST_ADDGROUPMENUITEM "CList/AddGroupMenuItem"
+
+__inline static HGENMENU Menu_AddGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddGroupMenuItem", (WPARAM)gmp, (LPARAM)mi);
+}
//the Group menu is about to be built
//wParam=lParam=0
@@ -162,7 +171,11 @@ int lParam; //add a new item to the tray menus
//wParam=0
//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-#define MS_CLIST_ADDTRAYMENUITEM "CList/AddTrayMenuItem"
+
+__inline static HGENMENU Menu_AddTrayMenuItem(CLISTMENUITEM *mi)
+{ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddTrayMenuItem", 0, (LPARAM)mi);
+}
//the tray menu is about to be built
//wParam=lParam=0
@@ -174,11 +187,6 @@ int lParam; //wParam=lParam=0
#define ME_CLIST_PREBUILDSTATUSMENU "CList/PreBuildStatusMenu"
-//add a new item to the status menu
-//wParam=0
-//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-#define MS_CLIST_ADDSTATUSMENUITEM "CList/AddStatusMenuItem"
-
//remove a item from main menu
//wParam=hMenuItem returned by MS_CLIST_ADDMAINMENUITEM
//lParam=0
diff --git a/include/m_help.h b/include/m_help.h index 15b404c2e4..70de3e2936 100644 --- a/include/m_help.h +++ b/include/m_help.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // wParam = 0
// lParam = (char *)url;
-// Sends the bug report url in lParam. Is usually called from
-// the Help/Report Bug menu.
+// Sends the bug report url in lParam. Is usually called from
+// the Help/Report Bug menu.
#define ME_HELP_BUGREPORT "Help/ReportBug"
#endif // M_HELP_H__
diff --git a/include/m_history.h b/include/m_history.h index d4f1b9ec15..cf6b85cf70 100644 --- a/include/m_history.h +++ b/include/m_history.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // wParam=(WPARAM)(HANDLE)hContact
// lParam=0
//hContact can be NULL to show system messages
-#define MS_HISTORY_SHOWCONTACTHISTORY "History/ShowContactHistory"
+#define MS_HISTORY_SHOWCONTACTHISTORY "History/ShowContactHistory"
#endif // M_HISTORY_H__
diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h index d8484e5c2e..5522f49bc9 100644 --- a/include/m_hotkeys.h +++ b/include/m_hotkeys.h @@ -57,7 +57,7 @@ typedef struct /* use this macro to defile hotkey codes like this:
hkd.DefHotkey = HOTKEYCODE(HOTKEYF_SHIFT|HOTKEYF_EXT, 'A');
*/
-#define HOTKEYCODE(mod,vk) (MAKEWORD((vk),(mod)))
+#define HOTKEYCODE(mod, vk) (MAKEWORD((vk), (mod)))
/* CoreHotkeys/Register service
Registers new hotkey
diff --git a/include/m_icolib.h b/include/m_icolib.h index a5e97db2e9..f9056b2a58 100644 --- a/include/m_icolib.h +++ b/include/m_icolib.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_icq.h b/include/m_icq.h index 91e1b9237a..eb585715c3 100644 --- a/include/m_icq.h +++ b/include/m_icq.h @@ -1,33 +1,27 @@ // ---------------------------------------------------------------------------80
// ICQ plugin for Miranda Instant Messenger
// ________________________________________
-//
+//
// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
// Copyright © 2001-2002 Jon Keating, Richard Hughes
// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
// Copyright © 2004-2010 Joe Kucera
-//
+//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// -----------------------------------------------------------------------------
-//
-// File name : $URL: http://miranda.googlecode.com/svn/trunk/miranda/include/m_icq.h $
-// Revision : $Revision: 11723 $
-// Last change on : $Date: 2010-05-09 14:55:59 +0300 (Ð’Ñ, 09 май 2010) $
-// Last change by : $Author: borkra $
-//
// DESCRIPTION:
//
// Public headers for ICQ protocol plug-in
@@ -106,7 +100,7 @@ typedef struct { //"<sms_message><source>MTN</source><destination_UIN>[UIN of recipient, ie this account]</destination_UIN><sender>[sending phone number, without +]</sender><senders_network>[contains one space, because I sent from ICQ]</senders_network><text>[body of the message]</text><time>Fri, 16 Nov 2001 03:12:33 GMT</time></sms_message>"
#define ICQACKTYPE_SMS 1001
#define ICQEVENTTYPE_SMS 2001 //database event type
-#define MS_ICQ_SENDSMS "/SendSMS"
+#define MS_ICQ_SENDSMS "/SendSMS"
//e-mail express
//db event added to NULL contact
@@ -229,7 +223,7 @@ typedef struct { // Sets owner current custom status (obsolete)
//wParam = (int)N // custom status id (1-32)
-//lParam = 0
+//lParam = 0
//return = N (id of status set) or 0 (failed - probably bad params)
#define PS_ICQ_SETCUSTOMSTATUS "/SetXStatus"
@@ -261,7 +255,7 @@ typedef struct { // Request Custom status details (messages) for specified contact
//wParam = hContact // request custom status details for this contact
-//lParam = 0
+//lParam = 0
//return = (int)dwSequence // if successful it is sequence for ICQACKTYPE_XSTATUS_RESPONSE
// 0 failed to request (e.g. auto-request enabled)
// -1 delayed (rate control) - sequence unknown
@@ -272,7 +266,7 @@ typedef struct { //lParam = hIcon // HANDLE to clist extra icon set as custom status
#define ME_ICQ_CUSTOMSTATUS_EXTRAICON_CHANGED "/XStatusExtraIconChanged"
-// Called when a contact changes its custom status
+// Called when a contact changes its custom status
// wParam = hContact
// lParam = 0
#define ME_ICQ_CUSTOMSTATUS_CHANGED "/XStatusChanged"
diff --git a/include/m_idle.h b/include/m_idle.h index 97a6a203bb..57394c9cc9 100644 --- a/include/m_idle.h +++ b/include/m_idle.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2005 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2005 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* The idle module checks how long the user has been idle, it can be at the Miranda level
or the OS level - the user has optional two settings, one for "short" idle and another
for "long" idle. Thie module will generate long/short events based on these user preferences
-and other information too. If you are unsure which idle mode to report for, report it
+and other information too. If you are unsure which idle mode to report for, report it
for short idle.*/
#define IDF_ISIDLE 0x1 // idle has become active (if not set, inactive)
@@ -63,7 +63,7 @@ typedef struct { /*
wParam; 0
lParam: &MIRANDA_IDLE_INFO
- Affect: Return information about current idle settings, like short/long idle time in mins
+ Affect: Return information about current idle settings, like short/long idle time in mins
and if the user wants that info kept private, etc
Returns: zero on success, non zero on failure
Version: 0.3.4 (2004/09/16)
diff --git a/include/m_ignore.h b/include/m_ignore.h index 312d0f70e8..9dd861bf3e 100644 --- a/include/m_ignore.h +++ b/include/m_ignore.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_imgsrvc.h b/include/m_imgsrvc.h index 55f4ebe8b3..e1627754f3 100644 --- a/include/m_imgsrvc.h +++ b/include/m_imgsrvc.h @@ -1,8 +1,8 @@ /*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2012 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -----------------------------------------------------------------------
Miranda Image services plugin / API definitions
-Provides various services for image loading, saving and manipulations.
+Provides various services for image loading, saving and manipulations.
This module is based on the freeimage library, copyrighted by the FreeImage
Project members.
@@ -82,9 +82,9 @@ typedef struct _tagFI_interface { FIBITMAP *(DLL_CALLCONV *FI__AllocateT)(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
FIBITMAP *(DLL_CALLCONV *FI_Clone)(FIBITMAP *dib);
void (DLL_CALLCONV *FI_Unload)(FIBITMAP *dib);
-
+
// Load / Save routines -----------------------------------------------------
-
+
FIBITMAP *(DLL_CALLCONV *FI_Load)(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
FIBITMAP *(DLL_CALLCONV *FI_LoadU)(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
FIBITMAP *(DLL_CALLCONV *FI_LoadFromHandle)(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
@@ -356,7 +356,7 @@ typedef struct _tagFI_interface { /*
* image services
- *
+ *
* only basic functionality is wrapped around Miranda services, because otherwise we would get a huge
* load of services with complex parameter marshalling requirements.
*/
@@ -376,21 +376,21 @@ typedef struct _tagFI_interface { // the interface is populated during the _DllMain() handler, so you can assume it is ready when Miranda
// calls the Load() handler of your plugin and you can return 1 in your Load() to disable your plugin when
// it depends on the freeimage interface and the freeimage plugin is missing
-//
+//
// example:
-//
+//
// FI_INTERFACE *fii = NULL;
-//
+//
// result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii);
-//
+//
// if(result != S_OK)
// failed, in this case, fei will be NULL and your plugin will crash when using the interface,
-// so ALWAYS check it
+// so ALWAYS check it
#define MS_IMG_GETINTERFACE "IMG/GetInterface"
-#define IMGL_RETURNDIB 1 // will NOT return a HBITMAP but a FIBITMAP * instead (useful, if you
+#define IMGL_RETURNDIB 1 // will NOT return a HBITMAP but a FIBITMAP * instead (useful, if you
// want to do further image manipulations before converting to a Win32 bitmap
// caller MUST then free the FIBITMAP * using fii->FI_Unload() or MS_IMG_UNLOAD (see below)
@@ -474,7 +474,7 @@ typedef struct _tagIMGSRVC_INFO { */
#define RESIZEBITMAP_STRETCH 0 // Distort bitmap to size in (max_width, max_height)
-#define RESIZEBITMAP_KEEP_PROPORTIONS 1 // Keep bitmap proportions (probabily only one of the
+#define RESIZEBITMAP_KEEP_PROPORTIONS 1 // Keep bitmap proportions (probabily only one of the
// max_width/max_height will be respected, and the other will be
// smaller)
#define RESIZEBITMAP_CROP 2 // Keep bitmap proportions but crop it to fix exactly in (max_width, max_height)
@@ -506,10 +506,10 @@ typedef struct { /*
* format conversion helpers
- *
+ *
* these helper macros allow converting HBITMAP to FIBITMAP * format and vice vera. In any case,
* the caller is responsible for freeing or deleting the original object.
- * These macros wrap around the FI_CreateHBITMAPFromDib() and FI_CreateDIBFromHBITMAP() interface
+ * These macros wrap around the FI_CreateHBITMAPFromDib() and FI_CreateDIBFromHBITMAP() interface
* functions.
*/
diff --git a/include/m_jabber.h b/include/m_jabber.h index b19a656521..d660528b60 100644 --- a/include/m_jabber.h +++ b/include/m_jabber.h @@ -20,11 +20,6 @@ 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.
-File name : $URL: https://miranda.svn.sourceforge.net/svnroot/miranda/trunk/miranda/include/m_jabber.h $
-Revision : $Revision: 9996 $
-Last change on : $Date: 2009-11-15 13:27:32 +0200 $
-Last change by : $Author: dchervov $
-
*/
#ifndef M_JABBER_H__
diff --git a/include/m_keybindings.h b/include/m_keybindings.h index 80f6ed1e2b..faac722791 100644 --- a/include/m_keybindings.h +++ b/include/m_keybindings.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_langpack.h b/include/m_langpack.h index da15c63ea0..e601b58c49 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -46,21 +46,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern int hLangpack;
__inline static char* Translate(const char* str)
-{ return (char*)CallService(MS_LANGPACK_TRANSLATESTRING,hLangpack,(LPARAM)(str));
+{ return (char*)CallService(MS_LANGPACK_TRANSLATESTRING, hLangpack, (LPARAM)(str));
}
__inline static WCHAR* TranslateW(const WCHAR* str)
-{ return (WCHAR*)CallService(MS_LANGPACK_TRANSLATESTRING,hLangpack+LANG_UNICODE,(LPARAM)(str));
+{ return (WCHAR*)CallService(MS_LANGPACK_TRANSLATESTRING, hLangpack+LANG_UNICODE, (LPARAM)(str));
}
#else
__inline static char* Translate(const char* str)
-{ return (char*)CallService(MS_LANGPACK_TRANSLATESTRING,0,(LPARAM)(str));
+{ return (char*)CallService(MS_LANGPACK_TRANSLATESTRING, 0, (LPARAM)(str));
}
__inline static WCHAR* TranslateW(const WCHAR* str)
-{ return (WCHAR*)CallService(MS_LANGPACK_TRANSLATESTRING,LANG_UNICODE,(LPARAM)(str));
+{ return (WCHAR*)CallService(MS_LANGPACK_TRANSLATESTRING, LANG_UNICODE, (LPARAM)(str));
}
#endif
@@ -114,7 +114,7 @@ __inline static INT_PTR TranslateDialogDefault(HWND hwndDlg) lptd.flags=hLangpack;
lptd.hwndDlg=hwndDlg;
lptd.ignoreControls=NULL;
- return CallService(MS_LANGPACK_TRANSLATEDIALOG,0,(LPARAM)&lptd);
+ return CallService(MS_LANGPACK_TRANSLATEDIALOG, 0, (LPARAM)&lptd);
}
#else
@@ -126,7 +126,7 @@ __inline static INT_PTR TranslateDialogDefault(HWND hwndDlg) lptd.flags=0;
lptd.hwndDlg=hwndDlg;
lptd.ignoreControls=NULL;
- return CallService(MS_LANGPACK_TRANSLATEDIALOG,0,(LPARAM)&lptd);
+ return CallService(MS_LANGPACK_TRANSLATEDIALOG, 0, (LPARAM)&lptd);
}
#endif
diff --git a/include/m_message.h b/include/m_message.h index 4b6a7933c0..4c503704ea 100644 --- a/include/m_message.h +++ b/include/m_message.h @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //returns immediately, just after the dialog is shown
//szText is the text to put in the edit box of the window (but not send)
//szText=NULL will not use any text
-//szText!=NULL is only supported on v0.1.2.0+
+//szText != NULL is only supported on v0.1.2.0+
#define MS_MSG_SENDMESSAGE "SRMsg/SendCommand"
#define MS_MSG_SENDMESSAGEW "SRMsg/SendCommandW"
@@ -71,7 +71,7 @@ typedef struct { //wparam=0
//lparam=0
//Returns a dword with the current message api version
-//Current version is 0,0,0,4
+//Current version is 0, 0, 0, 4
#define MS_MSG_GETWINDOWCLASS "MessageAPI/WindowClass"
//wparam=(char*)szBuf
diff --git a/include/m_netlib.h b/include/m_netlib.h index 8a810a32f7..689d352ea9 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -55,10 +55,10 @@ typedef struct NETLIBOPENCONNECTION_tag NETLIBOPENCONNECTION; //of the netlib options page.
//See notes below this function for the behaviour of HTTP gateways
//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY, ERROR_DUP_NAME
-typedef int (*NETLIBHTTPGATEWAYINITPROC)(HANDLE hConn,NETLIBOPENCONNECTION *nloc,NETLIBHTTPREQUEST *nlhr);
-typedef int (*NETLIBHTTPGATEWAYBEGINPROC)(HANDLE hConn,NETLIBOPENCONNECTION *nloc);
-typedef int (*NETLIBHTTPGATEWAYWRAPSENDPROC)(HANDLE hConn,PBYTE buf,int len,int flags,MIRANDASERVICE pfnNetlibSend);
-typedef PBYTE (*NETLIBHTTPGATEWAYUNWRAPRECVPROC)(NETLIBHTTPREQUEST *nlhr,PBYTE buf,int len,int *outBufLen,void *(*NetlibRealloc)(void*,size_t));
+typedef int (*NETLIBHTTPGATEWAYINITPROC)(HANDLE hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPREQUEST *nlhr);
+typedef int (*NETLIBHTTPGATEWAYBEGINPROC)(HANDLE hConn, NETLIBOPENCONNECTION *nloc);
+typedef int (*NETLIBHTTPGATEWAYWRAPSENDPROC)(HANDLE hConn, PBYTE buf, int len, int flags, MIRANDASERVICE pfnNetlibSend);
+typedef PBYTE (*NETLIBHTTPGATEWAYUNWRAPRECVPROC)(NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, int *outBufLen, void *(*NetlibRealloc)(void*, size_t));
typedef struct {
int cbSize;
char *szSettingsModule; //used for db settings and log
@@ -150,7 +150,7 @@ MSG_NOHTTPGATEWAYWRAP. nlu.pfnHttpGatewayWrapSend should return the a number of the same type as MS_NETLIB_SEND, ie the number of bytes sent or
SOCKET_ERROR. The number of wrapping bytes should be subtracted so that the
return value appears as if the proxy wasn't there.
-pfnNetlibSend() is identical to CallService(MS_NETLIB_SEND,...) but it's
+pfnNetlibSend() is identical to CallService(MS_NETLIB_SEND, ...) but it's
quicker to call using this pointer than to do the CallService() lookup again.
Whenever an HTTP reply is received inside MS_NETLIB_RECV the headers and data
@@ -196,7 +196,7 @@ typedef struct { int useProxyAuthNtlm; // 1 or 0, only used by HTTP, HTTPS
int dnsThroughProxy; // 1 or 0
int specifyIncomingPorts; // 1 or 0
- char *szIncomingPorts; // can be NULL. Of form "1024-1050,1060-1070,2000"
+ char *szIncomingPorts; // can be NULL. Of form "1024-1050, 1060-1070, 2000"
int specifyOutgoingPorts; // 0.3.3a+
char *szOutgoingPorts; // 0.3.3a+
int enableUPnP; // 0.6.1+ only for NUF_INCOMING
@@ -224,7 +224,7 @@ typedef struct { //socket will be closed.
//Errors: ERROR_INVALID_PARAMETER
#define MS_NETLIB_CLOSEHANDLE "Netlib/CloseHandle"
-__inline static INT_PTR Netlib_CloseHandle(HANDLE h) {return CallService(MS_NETLIB_CLOSEHANDLE,(WPARAM)h,0);}
+__inline static INT_PTR Netlib_CloseHandle(HANDLE h) {return CallService(MS_NETLIB_CLOSEHANDLE, (WPARAM)h, 0);}
//Open a port and wait for connections on it
//wParam=(WPARAM)(HANDLE)hUser
@@ -248,7 +248,7 @@ __inline static INT_PTR Netlib_CloseHandle(HANDLE h) {return CallService(MS_NETL // for such conditions.
//
// passing wPort != 0 is for people who need to open a set port for
-// daemon activities, usually passing wPort==0 is what you want and
+// daemon activities, usually passing wPort == 0 is what you want and
// will result in a free port given by the TCP/IP socket layer and/or
// seeded from the user selected port ranges.
//
@@ -260,8 +260,8 @@ it shouldnt matter */ #define NETLIBBIND_SIZEOF_V1 16 // sizeof(NETLIBBIND) prior to 0.3.4+ (2004/08/05)
#define NETLIBBIND_SIZEOF_V2 20 // sizeof(NETLIBBIND) prior to 0.6+ (2006/07/03)
-typedef void (*NETLIBNEWCONNECTIONPROC_V2)(HANDLE hNewConnection,DWORD dwRemoteIP, void * pExtra);
-typedef void (*NETLIBNEWCONNECTIONPROC)(HANDLE hNewConnection,DWORD dwRemoteIP);
+typedef void (*NETLIBNEWCONNECTIONPROC_V2)(HANDLE hNewConnection, DWORD dwRemoteIP, void * pExtra);
+typedef void (*NETLIBNEWCONNECTIONPROC)(HANDLE hNewConnection, DWORD dwRemoteIP);
/* This is NETLIBBIND prior to 2004/08/05+, DONT use this anymore unless you want to work
with older cores, pExtra isnt available on older cores and never will be - for a period of time, the ABI
for this service was broken and older NETLIBBINDs were not supported, if NULL is returned and the
@@ -364,7 +364,7 @@ typedef struct { DWORD flags;
char *szHttpPostUrl;
char *szHttpGetUrl;
- int firstGetSequence,firstPostSequence;
+ int firstGetSequence, firstPostSequence;
int combinePackets;
} NETLIBHTTPPROXYINFO;
#define MS_NETLIB_SETHTTPPROXYINFO "Netlib/SetHttpProxyInfo"
@@ -384,7 +384,7 @@ typedef struct { //wParam=0
//lParam=(LPARAM)(const char *)pszString
//Returns a char* containing the new string. This must be freed with
-//HeapFree(GetProcessHeap(),0,pszReturnString) when you're done with it.
+//HeapFree(GetProcessHeap(), 0, pszReturnString) when you're done with it.
//Returns NULL on error.
//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY
#define MS_NETLIB_URLENCODE "Netlib/UrlEncode"
@@ -575,10 +575,10 @@ struct NETLIBHTTPREQUEST_tag { //szValue=NULL.
//In the return value headers, headerCount, pData, dataLength, resultCode and
//szResultDescr are all valid.
-//In the return value pData[dataLength]==0 always, as an extra safeguard
+//In the return value pData[dataLength] == 0 always, as an extra safeguard
//against programming slips.
//Note that the function can succeed (ie not return NULL) yet result in an HTTP
-//error code. You should check that resultCode==2xx before proceeding.
+//error code. You should check that resultCode == 2xx before proceeding.
//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY, anything from the above
// list of functions
#define MS_NETLIB_HTTPTRANSACTION "Netlib/HttpTransaction"
@@ -605,9 +605,9 @@ typedef struct { int flags;
} NETLIBBUFFER;
#define MS_NETLIB_SEND "Netlib/Send"
-static __inline INT_PTR Netlib_Send(HANDLE hConn,const char *buf,int len,int flags) {
- NETLIBBUFFER nlb={(char*)buf,len,flags};
- return CallService(MS_NETLIB_SEND,(WPARAM)hConn,(LPARAM)&nlb);
+static __inline INT_PTR Netlib_Send(HANDLE hConn, const char *buf, int len, int flags) {
+ NETLIBBUFFER nlb={(char*)buf, len, flags};
+ return CallService(MS_NETLIB_SEND, (WPARAM)hConn, (LPARAM)&nlb);
}
//Receive data over a connection
@@ -632,9 +632,9 @@ static __inline INT_PTR Netlib_Send(HANDLE hConn,const char *buf,int len,int fla // nlu.pfnHttpGatewayUnwrapRecv, socket(), connect(),
// MS_NETLIB_SENDHTTPREQUEST
#define MS_NETLIB_RECV "Netlib/Recv"
-static __inline INT_PTR Netlib_Recv(HANDLE hConn,char *buf,int len,int flags) {
- NETLIBBUFFER nlb={buf,len,flags};
- return CallService(MS_NETLIB_RECV,(WPARAM)hConn,(LPARAM)&nlb);
+static __inline INT_PTR Netlib_Recv(HANDLE hConn, char *buf, int len, int flags) {
+ NETLIBBUFFER nlb={buf, len, flags};
+ return CallService(MS_NETLIB_RECV, (WPARAM)hConn, (LPARAM)&nlb);
}
//Determine the status of one or more connections
@@ -676,7 +676,7 @@ typedef struct { //lParam=(LPARAM)0
//Returns 0
#define MS_NETLIB_SHUTDOWN "Netlib/Shutdown"
-__inline static void Netlib_Shutdown(HANDLE h) {CallService(MS_NETLIB_SHUTDOWN,(WPARAM)h,0);}
+__inline static void Netlib_Shutdown(HANDLE h) {CallService(MS_NETLIB_SHUTDOWN, (WPARAM)h, 0);}
//Create a packet receiver
//wParam=(WPARAM)(HANDLE)hConnection
@@ -776,7 +776,7 @@ static INT_PTR Netlib_Logf(HANDLE hUser, const char *fmt, ...) __try
{
- va_start(va,fmt);
+ va_start(va, fmt);
mir_vsntprintf(szText, sizeof(szText), fmt, va);
va_end(va);
return CallService(MS_NETLIB_LOGW, (WPARAM)hUser, (LPARAM)szText);
diff --git a/include/m_plugins.h b/include/m_plugins.h index c47d29e75b..402da041d7 100644 --- a/include/m_plugins.h +++ b/include/m_plugins.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2012 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -78,7 +78,7 @@ typedef struct PLUGIN_DB_ENUM { //this is primarily for use by the core's module initialiser, but could also
//be used by modules that are doing naughty things that are very
//feature-dependent
-#define MS_PLUGINS_GETDISABLEDEFAULTARRAY "Plugins/GetDisableDefaultArray"
+#define MS_PLUGINS_GETDISABLEDEFAULTARRAY "Plugins/GetDisableDefaultArray"
#endif // M_PLUGINS_H__
diff --git a/include/m_png.h b/include/m_png.h index 75f1170fc8..b1c4a6976f 100644 --- a/include/m_png.h +++ b/include/m_png.h @@ -23,11 +23,6 @@ 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.
-File name : $Source: /cvsroot/miranda/miranda/include/m_png.h,v $
-Revision : $Revision: 2876 $
-Last change on : $Date: 2006-05-17 00:56:03 +0300 (Ср, 17 май 2006) $
-Last change by : $Author: rainwater $
-
*/
/* Image/Dib2Png
diff --git a/include/m_popup.h b/include/m_popup.h index 62d64ea73d..afac6c1696 100644 --- a/include/m_popup.h +++ b/include/m_popup.h @@ -1,10 +1,10 @@ /*
-===============================================================================
+ == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
PopUp plugin
Plugin Name: PopUp
Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
Victor Pavlychko aka zazoo (nullbie@gmail.com)
-===============================================================================
+ == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
The purpose of this plugin is to give developers a common "platform/interface"
to show PopUps. It is born from the source code of NewStatusNotify, another
plugin I've made.
@@ -12,7 +12,7 @@ plugin I've made. Remember that users *must* have this plugin enabled, or they won't get any
popup. Write this in the requirements, do whatever you wish ;-)... but tell
them!
-===============================================================================
+ == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == =
*/
#ifndef M_POPUP_H
@@ -125,17 +125,17 @@ You may pass additional creation flags via lParam: #define MS_POPUP_ADDPOPUP "PopUp/AddPopUp"
static INT_PTR __inline PUAddPopUp(POPUPDATA* ppdp) {
- return CallService(MS_POPUP_ADDPOPUP, (WPARAM)ppdp,0);
+ return CallService(MS_POPUP_ADDPOPUP, (WPARAM)ppdp, 0);
}
#define MS_POPUP_ADDPOPUPEX "PopUp/AddPopUpEx"
static INT_PTR __inline PUAddPopUpEx(POPUPDATAEX* ppdp) {
- return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
+ return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp, 0);
}
#define MS_POPUP_ADDPOPUPW "PopUp/AddPopUpW"
static INT_PTR __inline PUAddPopUpW(POPUPDATAW* ppdp) {
- return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp,0);
+ return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp, 0);
}
#if defined(_UNICODE) || defined(UNICODE)
@@ -157,7 +157,7 @@ Returns: the HANDLE of the contact. Can return NULL, meaning it's the main conta */
#define MS_POPUP_GETCONTACT "PopUp/GetContact"
static HANDLE __inline PUGetContact(HWND hPopUpWindow) {
- return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopUpWindow,0);
+ return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopUpWindow, 0);
}
/* PopUp/GetPluginData
@@ -179,7 +179,7 @@ and it will work. Just look at the example I've written above (PopUpDlgProc). #define MS_POPUP_GETPLUGINDATA "PopUp/GetPluginData"
static void __inline * PUGetPluginData(HWND hPopUpWindow) {
long * uselessPointer = NULL;
- return (void*)CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hPopUpWindow,(LPARAM)uselessPointer);
+ return (void*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hPopUpWindow, (LPARAM)uselessPointer);
}
/* PopUp/IsSecondLineShown
@@ -192,7 +192,7 @@ Returns: 0 if the user has chosen not to have the second line, 1 if he choose to */
#define MS_POPUP_ISSECONDLINESHOWN "PopUp/IsSecondLineShown"
static BOOL __inline PUIsSecondLineShown() {
- return (BOOL)CallService(MS_POPUP_ISSECONDLINESHOWN,0,0);
+ return (BOOL)CallService(MS_POPUP_ISSECONDLINESHOWN, 0, 0);
}
/* PopUp/Query
@@ -226,7 +226,7 @@ lParam = 0 */
#define UM_DESTROYPOPUP (WM_USER + 0x0201)
static int __inline PUDeletePopUp(HWND hWndPopUp) {
- return (int)SendMessage(hWndPopUp, UM_DESTROYPOPUP,0,0);
+ return (int)SendMessage(hWndPopUp, UM_DESTROYPOPUP, 0, 0);
}
/* UM_INITPOPUP
@@ -333,11 +333,11 @@ Returns: 0 if the popup was shown, -1 in case of failure. #define MS_POPUP_SHOWMESSAGEW "PopUp/ShowMessageW"
static int __inline PUShowMessage(char *lpzText, DWORD kind) {
- return (int)CallService(MS_POPUP_SHOWMESSAGE, (WPARAM)lpzText,(LPARAM)kind);
+ return (int)CallService(MS_POPUP_SHOWMESSAGE, (WPARAM)lpzText, (LPARAM)kind);
}
static int __inline PUShowMessageW(wchar_t *lpwzText, DWORD kind) {
- return (int)CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)lpwzText,(LPARAM)kind);
+ return (int)CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)lpwzText, (LPARAM)kind);
}
#ifdef _UNICODE
diff --git a/include/m_protocols.h b/include/m_protocols.h index 887ab4e1e4..8ee54722c2 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -98,7 +98,7 @@ typedef struct { // long to be delivered". If no error message is specified, lParam must be NULL.
// Right now only explanations from ACKTYPE_MESSAGE is shown.
-//when type==ACKTYPE_FILE && (result==ACKRESULT_DATA || result==ACKRESULT_FILERESUME),
+//when type == ACKTYPE_FILE && (result == ACKRESULT_DATA || result == ACKRESULT_FILERESUME),
//lParam points to this
#define FNAMECHAR TCHAR
@@ -114,7 +114,7 @@ typedef struct { #define PFTS_TCHAR 0
#endif
-typedef struct tagPROTOFILETRANSFERSTATUS
+typedef struct tagPROTOFILETRANSFERSTATUS
{
size_t cbSize;
HANDLE hContact;
@@ -146,7 +146,7 @@ typedef struct tagPROTOFILETRANSFERSTATUS unsigned __int64 currentFileSize;
unsigned __int64 currentFileProgress;
unsigned __int64 currentFileTime; //as seconds since 1970
-}
+}
PROTOFILETRANSFERSTATUS;
//Enumerate the currently running protocols
@@ -161,7 +161,7 @@ PROTOFILETRANSFERSTATUS; //program's lifetime. Do not use this list in the global context, copy protocols
//names otherwise.
//IMPORTANT NOTE #2: in version 0.8 this service is mapped to the MS_PROTO_ENUMACCOUNTS
-//service to provide the compatibility with old plugins (first three members of
+//service to provide the compatibility with old plugins (first three members of
//PROTOACCOUNT are equal to the old PROTOCOLDESCRIPTOR format). If you declare the
//MIRANDA_VER macro with value greater or equal to 0x800, use MS_PROTO_ENUMPROTOS
//service instead to obtain the list of running protocols instead of accounts.
@@ -267,7 +267,7 @@ typedef struct { //lParam=(LPARAM)(int)typing state
#define ME_PROTO_CONTACTISTYPING "Proto/ContactIsTypingEvent"
-// -------------- accounts support --------------------- 0.8.0+
+// -------------- accounts support --------------------- 0.8.0+
typedef struct tagACCOUNT
{
@@ -323,7 +323,7 @@ __inline static PROTOACCOUNT* ProtoGetAccount( const char* accName ) //displays the Account Manager
//wParam=0
//lParam=0
-#define MS_PROTO_SHOWACCMGR "Protos/ShowAccountManager"
+#define MS_PROTO_SHOWACCMGR "Protos/ShowAccountManager"
//determines if an account is enabled or not
//wParam = 0
diff --git a/include/m_protoint.h b/include/m_protoint.h index b069f2dcf2..0eac0f0015 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_PROTOINT_H__
#define M_PROTOINT_H__ 1
-typedef enum
+typedef enum
{
EV_PROTO_ONLOAD,
EV_PROTO_ONREADYTOEXIT,
diff --git a/include/m_protomod.h b/include/m_protomod.h index bae8146373..ee28bf232d 100644 --- a/include/m_protomod.h +++ b/include/m_protomod.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -65,12 +65,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //If they are called with CallContactService() (PSS_ and PSR_ services) then
//they are called with lParam=(CCSDATA*)&ccs and wParam an opaque internal
//reference that should be passed unchanged to MS_PROTO_CHAIN*.
-__inline static HANDLE CreateProtoServiceFunction(const char *szModule,const char *szService,MIRANDASERVICE serviceProc)
+__inline static HANDLE CreateProtoServiceFunction(const char *szModule, const char *szService, MIRANDASERVICE serviceProc)
{
char str[MAXMODULELABELLENGTH];
_snprintf(str, sizeof(str), "%s%s", szModule, szService);
str[MAXMODULELABELLENGTH-1] = 0;
- return CreateServiceFunction(str,serviceProc);
+ return CreateServiceFunction(str, serviceProc);
}
//Call the next service in the chain for this send operation
@@ -81,7 +81,7 @@ __inline static HANDLE CreateProtoServiceFunction(const char *szModule,const cha //called with. wParam must remain untouched but lParam is a CCSDATA structure
//that can be copied and modified if needed.
//Typically, the last line of any chaining protocol function is
-//return CallService(MS_PROTO_CHAINSEND,wParam,lParam);
+//return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
#define MS_PROTO_CHAINSEND "Proto/ChainSend"
//Call the next service in the chain for this receive operation
@@ -106,14 +106,14 @@ __inline static HANDLE CreateProtoServiceFunction(const char *szModule,const cha //Thread safety: me_proto_ack is completely thread safe since 0.1.2.0
//See the notes in core/modules.h under NotifyEventHooks()
#define MS_PROTO_BROADCASTACK "Proto/BroadcastAck"
-__inline static INT_PTR ProtoBroadcastAck(const char *szModule,HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam)
+__inline static INT_PTR ProtoBroadcastAck(const char *szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
ACKDATA ack={0};
ack.cbSize=sizeof(ACKDATA);
ack.szModule=szModule; ack.hContact=hContact;
ack.type=type; ack.result=result;
ack.hProcess=hProcess; ack.lParam=lParam;
- return CallService(MS_PROTO_BROADCASTACK,0,(LPARAM)&ack);
+ return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
}
/* -- Added during 0.3.4 (2004/09/27) development! -----
diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 5f997b593c..3eb934b532 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -36,9 +36,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ******************************************
Only new style protocols (Miranda 0.9+) with m_iVersion set to 2 or higher
-support Unicode services documented below, all other support only ANSI.
+support Unicode services documented below, all other support only ANSI.
-For all other that do not support Unicode services, Miranda core will
+For all other that do not support Unicode services, Miranda core will
convert Unicode to ANSI and call the appropriate service.
*/
@@ -412,7 +412,7 @@ typedef struct { #define PS_ADDTOLIST "/AddToList"
//Adds a contact to the contact list given an auth, added or contacts event
-//wParam=MAKEWPARAM(flags,iContact)
+//wParam=MAKEWPARAM(flags, iContact)
//lParam=(LPARAM)(HANDLE)hDbEvent
//Returns a HANDLE to the new contact, or NULL on failure
//hDbEvent must be either EVENTTYPE_AUTHREQ or EVENTTYPE_ADDED
@@ -457,7 +457,7 @@ typedef struct { #define FILERESUME_SKIP 4
typedef struct {
int action; //a FILERESUME_ flag
- const FNAMECHAR *szFilename; //full path. Only valid if action==FILERESUME_RENAME
+ const FNAMECHAR *szFilename; //full path. Only valid if action == FILERESUME_RENAME
} PROTOFILERESUME;
#define PS_FILERESUME "/FileResume"
#define PS_FILERESUMEW "/FileResumeW"
@@ -490,7 +490,7 @@ typedef struct { // Asks protocol for the status message for a status
// wParam=(WORD) 0 for current status or a status id
// lParam=SGMA_xxx
-// Returns status msg or NULL if there is none. The protocol have to handle only the current
+// Returns status msg or NULL if there is none. The protocol have to handle only the current
// status. Handling messages for other statuses is optional.
// Remember to mir_free the return value
@@ -595,7 +595,7 @@ typedef struct { #define PSS_URL "/SendUrl"
//Send a set of contacts
-//wParam=MAKEWPARAM(flags,nContacts)
+//wParam=MAKEWPARAM(flags, nContacts)
//lParam=(LPARAM)(HANDLE*)hContactsList
//returns a hProcess corresponding to the one in the ack event, NULL on
//failure.
diff --git a/include/m_skin.h b/include/m_skin.h index 1b6880b210..b36620311a 100644 --- a/include/m_skin.h +++ b/include/m_skin.h @@ -31,9 +31,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //returns NULL if id is invalid, but will always succeed for a valid id
#define MS_SKIN_LOADICON "Skin/Icons/Load"
//nice function to wrap this:
-__inline static HICON LoadSkinnedIcon(int id) {return (HICON)CallService(MS_SKIN_LOADICON,id,0);}
-__inline static HANDLE LoadSkinnedIconHandle(int id) {return (HANDLE)CallService(MS_SKIN_LOADICON,id,1);}
-__inline static HICON LoadSkinnedIconBig(int id) {return (HICON)CallService(MS_SKIN_LOADICON,id,2);}
+__inline static HICON LoadSkinnedIcon(int id) {return (HICON)CallService(MS_SKIN_LOADICON, id, 0);}
+__inline static HANDLE LoadSkinnedIconHandle(int id) {return (HANDLE)CallService(MS_SKIN_LOADICON, id, 1);}
+__inline static HICON LoadSkinnedIconBig(int id) {return (HICON)CallService(MS_SKIN_LOADICON, id, 2);}
//event icons
#define SKINICON_EVENT_MESSAGE 100
@@ -109,8 +109,8 @@ __inline static HICON LoadSkinnedIconBig(int id) {return (HICON)CallService(MS_S #define MS_SKIN_LOADPROTOICON "Skin/Icons/LoadProto"
#define MS_SKIN_LOADPROTOICONBIG "Skin/Icons/LoadProtoBig"
//nice function to wrap this:
-__inline static HICON LoadSkinnedProtoIcon(const char *szProto,int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICON,(WPARAM)szProto,status);}
-__inline static HICON LoadSkinnedProtoIconBig(const char *szProto,int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICONBIG,(WPARAM)szProto,status);}
+__inline static HICON LoadSkinnedProtoIcon(const char *szProto, int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICON, (WPARAM)szProto, status);}
+__inline static HICON LoadSkinnedProtoIconBig(const char *szProto, int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICONBIG, (WPARAM)szProto, status);}
//add a new sound so it has a default and can be changed in the options dialog
//wParam=0
@@ -157,10 +157,10 @@ typedef struct { #define MS_SKIN_ADDNEWSOUND "Skin/Sounds/AddNew"
// inline only works after 0.3.4+ (2004/10/*)
-__inline static INT_PTR SkinAddNewSoundEx(const char *name,const char *section,const char *description)
+__inline static INT_PTR SkinAddNewSoundEx(const char *name, const char *section, const char *description)
{
SKINSOUNDDESCEX ssd;
- ZeroMemory(&ssd,sizeof(ssd));
+ ZeroMemory(&ssd, sizeof(ssd));
ssd.cbSize=sizeof(ssd);
ssd.pszName=name;
ssd.pszSection=section;
@@ -168,10 +168,10 @@ __inline static INT_PTR SkinAddNewSoundEx(const char *name,const char *section,c return CallService(MS_SKIN_ADDNEWSOUND, 0, (LPARAM)&ssd);
}
-__inline static INT_PTR SkinAddNewSound(const char *name,const char *description,const char *defaultFile)
+__inline static INT_PTR SkinAddNewSound(const char *name, const char *description, const char *defaultFile)
{
SKINSOUNDDESC ssd;
- ZeroMemory(&ssd,sizeof(ssd));
+ ZeroMemory(&ssd, sizeof(ssd));
ssd.cbSize=sizeof(ssd);
ssd.pszName=name;
ssd.pszDescription=description;
@@ -180,7 +180,7 @@ __inline static INT_PTR SkinAddNewSound(const char *name,const char *description }
// 0.9.0+
-__inline static INT_PTR SkinAddNewSoundExT(const char *name,const TCHAR *section,const TCHAR *description)
+__inline static INT_PTR SkinAddNewSoundExT(const char *name, const TCHAR *section, const TCHAR *description)
{
SKINSOUNDDESCEX ssd = { 0 };
ssd.cbSize=sizeof(ssd);
@@ -191,7 +191,7 @@ __inline static INT_PTR SkinAddNewSoundExT(const char *name,const TCHAR *section return CallService(MS_SKIN_ADDNEWSOUND, 0, (LPARAM)&ssd);
}
-__inline static INT_PTR SkinAddNewSoundT(const char *name,const TCHAR *description,const TCHAR *defaultFile)
+__inline static INT_PTR SkinAddNewSoundT(const char *name, const TCHAR *description, const TCHAR *defaultFile)
{
SKINSOUNDDESCEX ssd = { 0 };
ssd.cbSize=sizeof(ssd);
@@ -208,7 +208,7 @@ __inline static INT_PTR SkinAddNewSoundT(const char *name,const TCHAR *descripti //pszName should have been added with Skin/Sounds/AddNew, but if not the
//function will not fail, it will play the Windows default sound instead.
#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
-__inline static INT_PTR SkinPlaySound(const char *name) {return CallService(MS_SKIN_PLAYSOUND,0,(LPARAM)name);}
+__inline static INT_PTR SkinPlaySound(const char *name) {return CallService(MS_SKIN_PLAYSOUND, 0, (LPARAM)name);}
//sent when the icons DLL has been changed in the options dialog, and everyone
//should re-make their image lists
diff --git a/include/m_ssl.h b/include/m_ssl.h index cba88e13c8..097847dfd5 100644 --- a/include/m_ssl.h +++ b/include/m_ssl.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -45,7 +45,7 @@ typedef struct extern SSL_API si;
/*
-a service to obtain the SSL API
+a service to obtain the SSL API
wParam = 0;
lParam = (LPARAM)(SSL_API*).
diff --git a/include/m_system.h b/include/m_system.h index 63a2002743..1b2ed6f11f 100644 --- a/include/m_system.h +++ b/include/m_system.h @@ -93,7 +93,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //wParam=(WPARAM)(HANDLE)hObject
//lParam=(LPARAM)(const char*)pszService
//returns 0 on success or nonzero on failure
-//Causes pszService to be CallService()d (wParam=hObject,lParam=0) from the
+//Causes pszService to be CallService()d (wParam=hObject, lParam=0) from the
//main thread whenever hObject is signalled.
//The Miranda message loop has a MsgWaitForMultipleObjects() call in it to
//implement this feature. See the documentation for that function for
@@ -172,19 +172,19 @@ __forceinline INT_PTR mir_getMMI( struct MM_INTERFACE* dest ) extern struct MM_INTERFACE mmi;
#define mir_alloc(n) mmi.mmi_malloc(n)
#define mir_free(ptr) mmi.mmi_free(ptr)
- #define mir_realloc(ptr,size) mmi.mmi_realloc(ptr,size)
+ #define mir_realloc(ptr, size) mmi.mmi_realloc(ptr, size)
#define mir_calloc(n) mmi.mmi_calloc(n)
#define mir_strdup(str) mmi.mmi_strdup(str)
#define mir_wstrdup(str) mmi.mmi_wstrdup(str)
#define mir_snprintf mmi.mir_snprintf
- #define mir_sntprintf mmi.mir_sntprintf
+ #define mir_sntprintf mmi.mir_sntprintf
#define mir_vsnprintf mmi.mir_vsnprintf
#define mir_vsntprintf mmi.mir_vsntprintf
- #define mir_a2u_cp(src,cp) mmi.mir_a2u_cp(src,cp)
+ #define mir_a2u_cp(src, cp) mmi.mir_a2u_cp(src, cp)
#define mir_a2u(src) mmi.mir_a2u(src)
- #define mir_u2a_cp(src,cp) mmi.mir_u2a_cp(src,cp)
+ #define mir_u2a_cp(src, cp) mmi.mir_u2a_cp(src, cp)
#define mir_u2a(src) mmi.mir_u2a(src)
#else
char* mir_strdup(const char *src);
@@ -212,9 +212,9 @@ wParam=0, lParam = (LPARAM)LIST_INTERFACE* typedef int ( *FSortFunc )( void*, void* );
-// Assumes first 32 bit value of the data is the numeric key
+// Assumes first 32 bit value of the data is the numeric key
// and uses it to perform sort/search operations, this results
-// in much better performance as no compare function calls needed
+// in much better performance as no compare function calls needed
// Incredibly useful for Hash Tables
#define NumericKeySort (FSortFunc)(void*) -1
#define HandleKeySort (FSortFunc)(void*) -2
@@ -293,7 +293,7 @@ struct UTF8_INTERFACE // the input buffer remains unchanged
wchar_t* ( *utf8_decodeW )( const char* str );
- // returns the predicted length of the utf-8 string
+ // returns the predicted length of the utf-8 string
int ( *utf8_lenW )( const wchar_t* src );
};
@@ -307,11 +307,11 @@ __forceinline INT_PTR mir_getUTFI( struct UTF8_INTERFACE* dest ) extern struct UTF8_INTERFACE utfi;
-#define mir_utf8decode(A,B) utfi.utf8_decode(A,B)
-#define mir_utf8decodecp(A,B,C) utfi.utf8_decodecp(A,B,C)
+#define mir_utf8decode(A, B) utfi.utf8_decode(A, B)
+#define mir_utf8decodecp(A, B, C) utfi.utf8_decodecp(A, B, C)
#define mir_utf8decodeW(A) utfi.utf8_decodeW(A)
#define mir_utf8encode(A) utfi.utf8_encode(A)
-#define mir_utf8encodecp(A,B) utfi.utf8_encodecp(A,B)
+#define mir_utf8encodecp(A, B) utfi.utf8_encodecp(A, B)
#define mir_utf8encodeW(A) utfi.utf8_encodeW(A)
#define mir_utf8lenW(A) utfi.utf8_lenW(A)
@@ -385,10 +385,10 @@ __forceinline char* mir_utf8decodeA(const char* src) int run=1;
for (;run;)
{
- Beep(4391,500);
- SleepEx(1500,TRUE);
+ Beep(4391, 500);
+ SleepEx(1500, TRUE);
if (Miranda_Terminated()) {
- Beep(5000,150); run=0;
+ Beep(5000, 150); run=0;
} //if
} //for
}
@@ -577,7 +577,7 @@ __inline static INT_PTR Miranda_Terminated(void) #else
__inline static INT_PTR Miranda_Terminated(void)
{
- return CallService(MS_SYSTEM_TERMINATED,0,0);
+ return CallService(MS_SYSTEM_TERMINATED, 0, 0);
}
#endif
diff --git a/include/m_timezones.h b/include/m_timezones.h index 35a5651696..335cce00f2 100644 --- a/include/m_timezones.h +++ b/include/m_timezones.h @@ -77,7 +77,7 @@ typedef struct extern TIME_API tmi;
/*
-a service to obtain the Time API
+a service to obtain the Time API
wParam = 0;
lParam = (LPARAM)(TIME_API*).
diff --git a/include/m_url.h b/include/m_url.h index e943fb6c01..1ca41eac5b 100644 --- a/include/m_url.h +++ b/include/m_url.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_userinfo.h b/include/m_userinfo.h index a30243e8ea..bb11722b1c 100644 --- a/include/m_userinfo.h +++ b/include/m_userinfo.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/m_utils.h b/include/m_utils.h index 7ea24f528e..4d5ee302a7 100644 --- a/include/m_utils.h +++ b/include/m_utils.h @@ -70,7 +70,7 @@ typedef struct { SIZE dlgOriginalSize; //size of dialog client area in template
SIZE dlgNewSize; //current size of dialog client area
} UTILRESIZECONTROL;
-typedef int (*DIALOGRESIZERPROC)(HWND hwndDlg,LPARAM lParam,UTILRESIZECONTROL *urc);
+typedef int (*DIALOGRESIZERPROC)(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc);
typedef struct {
int cbSize;
HWND hwndDlg;
@@ -130,18 +130,18 @@ typedef struct { HANDLE hContact;
} WINDOWLISTENTRY;
#define MS_UTILS_ADDTOWINDOWLIST "Utils/AddToWindowList"
-__inline static INT_PTR WindowList_Add(HANDLE hList,HWND hwnd,HANDLE hContact) {
+__inline static INT_PTR WindowList_Add(HANDLE hList, HWND hwnd, HANDLE hContact) {
WINDOWLISTENTRY wle;
wle.hList=hList; wle.hwnd=hwnd; wle.hContact=hContact;
- return CallService(MS_UTILS_ADDTOWINDOWLIST,0,(LPARAM)&wle);
+ return CallService(MS_UTILS_ADDTOWINDOWLIST, 0, (LPARAM)&wle);
}
//removes a window from the specified window list v0.1.0.1+
//wParam=(WPARAM)(HANDLE)hList
//lParam=(LPARAM)(HWND)hwnd
//returns 0 on success, nonzero on failure
#define MS_UTILS_REMOVEFROMWINDOWLIST "Utils/RemoveFromWindowList"
-__inline static INT_PTR WindowList_Remove(HANDLE hList,HWND hwnd) {
- return CallService(MS_UTILS_REMOVEFROMWINDOWLIST,(WPARAM)hList,(LPARAM)hwnd);
+__inline static INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
+ return CallService(MS_UTILS_REMOVEFROMWINDOWLIST, (WPARAM)hList, (LPARAM)hwnd);
}
//finds a window given the hContact v0.1.0.1+
@@ -149,8 +149,8 @@ __inline static INT_PTR WindowList_Remove(HANDLE hList,HWND hwnd) { //lParam=(WPARAM)(HANDLE)hContact
//returns the window handle on success, or NULL on failure
#define MS_UTILS_FINDWINDOWINLIST "Utils/FindWindowInList"
-__inline static HWND WindowList_Find(HANDLE hList,HANDLE hContact) {
- return (HWND)CallService(MS_UTILS_FINDWINDOWINLIST,(WPARAM)hList,(LPARAM)hContact);
+__inline static HWND WindowList_Find(HANDLE hList, HANDLE hContact) {
+ return (HWND)CallService(MS_UTILS_FINDWINDOWINLIST, (WPARAM)hList, (LPARAM)hContact);
}
//broadcasts a message to all windows in a list v0.1.0.1+
@@ -159,10 +159,10 @@ __inline static HWND WindowList_Find(HANDLE hList,HANDLE hContact) { //returns 0 on success, nonzero on failure
//Only msg.message, msg.wParam and msg.lParam are used
#define MS_UTILS_BROADCASTTOWINDOWLIST "Utils/BroadcastToWindowList"
-__inline static INT_PTR WindowList_Broadcast(HANDLE hList,UINT message,WPARAM wParam,LPARAM lParam) {
+__inline static INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
MSG msg;
msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
- return CallService(MS_UTILS_BROADCASTTOWINDOWLIST,(WPARAM)hList,(LPARAM)&msg);
+ return CallService(MS_UTILS_BROADCASTTOWINDOWLIST, (WPARAM)hList, (LPARAM)&msg);
}
/*
@@ -178,10 +178,10 @@ __inline static INT_PTR WindowList_Broadcast(HANDLE hList,UINT message,WPARAM wP */
#define MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC "Utils/BroadcastToWindowListAsync"
-__inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList,UINT message,WPARAM wParam,LPARAM lParam) {
+__inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
MSG msg;
msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
- return CallService(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC,(WPARAM)hList,(LPARAM)&msg);
+ return CallService(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, (WPARAM)hList, (LPARAM)&msg);
}
/***************************** Hyperlink windows ********************************/
@@ -213,10 +213,10 @@ typedef struct { const char *szNamePrefix; //text to prefix on "x", "width", etc, to form setting names
} SAVEWINDOWPOS;
#define MS_UTILS_SAVEWINDOWPOSITION "Utils/SaveWindowPos"
-__inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+__inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
- return CallService(MS_UTILS_SAVEWINDOWPOSITION,0,(LPARAM)&swp);
+ return CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&swp);
}
//restores the position of a window from the database v0.1.1.0+
@@ -232,18 +232,18 @@ __inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd,HANDLE hContact,const #define RWPF_NOACTIVATE 4 //show but don't activate v0.3.3.0+
#define RWPF_HIDDEN 8 //make it hidden
#define MS_UTILS_RESTOREWINDOWPOSITION "Utils/RestoreWindowPos"
-__inline static INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd,int flags,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+__inline static INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd, int flags, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
- return CallService(MS_UTILS_RESTOREWINDOWPOSITION,flags,(LPARAM)&swp);
+ return CallService(MS_UTILS_RESTOREWINDOWPOSITION, flags, (LPARAM)&swp);
}
-__inline static INT_PTR Utils_RestoreWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+__inline static INT_PTR Utils_RestoreWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
return Utils_RestoreWindowPositionEx(hwnd, 0, hContact, szModule, szNamePrefix);
}
-__inline static INT_PTR Utils_RestoreWindowPositionNoSize(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+__inline static INT_PTR Utils_RestoreWindowPositionNoSize(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOSIZE, hContact, szModule, szNamePrefix);
}
-__inline static INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+__inline static INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOMOVE, hContact, szModule, szNamePrefix);
}
@@ -253,7 +253,7 @@ __inline static INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd,HANDLE hCont //returns <0 on error, 0 if not changed the rect, 1 if changed the rect
#define MS_UTILS_ASSERTINSIDESCREEN "Utils/AssertInsideScreen"
__inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
- return CallService(MS_UTILS_ASSERTINSIDESCREEN,(WPARAM)rc,0);
+ return CallService(MS_UTILS_ASSERTINSIDESCREEN, (WPARAM)rc, 0);
}
/************************ Colour Picker Control (0.1.2.1+) **********************/
@@ -474,7 +474,7 @@ typedef struct { mir_sha1_long_t H[5];
mir_sha1_long_t W[80];
int lenW;
- mir_sha1_long_t sizeHi,sizeLo;
+ mir_sha1_long_t sizeHi, sizeLo;
} mir_sha1_ctx;
struct SHA1_INTERFACE
diff --git a/include/m_xml.h b/include/m_xml.h index 7ce8f6efa2..0ad119d326 100644 --- a/include/m_xml.h +++ b/include/m_xml.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -92,7 +92,7 @@ typedef struct void ( *setClear )( HXML, int i, LPCTSTR lpszValue );
int ( *getElementCount )( HXML );
int ( *getElement )( HXML, XML_ELEMENT_POS n, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag );
- // With getElement() it's possible to enumerate all the different contents (attribute,child,text, clear) of the current node. The order is reflecting the order of the original file/string. NOTE: 0 <= i < getElementCount().
+ // With getElement() it's possible to enumerate all the different contents (attribute, child, text, clear) of the current node. The order is reflecting the order of the original file/string. NOTE: 0 <= i < getElementCount().
// type, child, value, name, openTag, closeTag will be filled on return, depending on type:
// for XML_ELEM_TYPE_CHILD, child is valid;
// for XML_ELEM_TYPE_ATTRIBUTE, name and value are valid;
@@ -119,7 +119,7 @@ typedef struct extern XML_API xi;
/*
-a service to obtain the XML API
+a service to obtain the XML API
wParam = 0;
lParam = (LPARAM)(XML_API*).
diff --git a/include/msapi/vsstyle.h b/include/msapi/vsstyle.h index b65e223b51..bcd4dcbf56 100644 --- a/include/msapi/vsstyle.h +++ b/include/msapi/vsstyle.h @@ -15,7 +15,7 @@ //
-// AEROWIZARDSTYLE class parts and states
+// AEROWIZARDSTYLE class parts and states
//
#define VSCLASS_AEROWIZARDSTYLE L"AEROWIZARDSTYLE"
#define VSCLASS_AEROWIZARD L"AEROWIZARD"
@@ -45,7 +45,7 @@ enum CONTENTAREASTATES { //
-// BUTTONSTYLE class parts and states
+// BUTTONSTYLE class parts and states
//
#define VSCLASS_BUTTONSTYLE L"BUTTONSTYLE"
#define VSCLASS_BUTTON L"BUTTON"
@@ -129,7 +129,7 @@ enum COMMANDLINKGLYPHSTATES { //
-// COMBOBOXSTYLE class parts and states
+// COMBOBOXSTYLE class parts and states
//
#define VSCLASS_COMBOBOXSTYLE L"COMBOBOXSTYLE"
#define VSCLASS_COMBOBOX L"COMBOBOX"
@@ -198,7 +198,7 @@ enum CUEBANNERSTATES { //
-// COMMUNICATIONSSTYLE class parts and states
+// COMMUNICATIONSSTYLE class parts and states
//
#define VSCLASS_COMMUNICATIONSSTYLE L"COMMUNICATIONSSTYLE"
#define VSCLASS_COMMUNICATIONS L"COMMUNICATIONS"
@@ -217,7 +217,7 @@ enum TABSTATES { //
-// CONTROLPANELSTYLE class parts and states
+// CONTROLPANELSTYLE class parts and states
//
#define VSCLASS_CONTROLPANELSTYLE L"CONTROLPANELSTYLE"
#define VSCLASS_CONTROLPANEL L"CONTROLPANEL"
@@ -275,7 +275,7 @@ enum SECTIONTITLELINKSTATES { //
-// DATEPICKERSTYLE class parts and states
+// DATEPICKERSTYLE class parts and states
//
#define VSCLASS_DATEPICKERSTYLE L"DATEPICKERSTYLE"
#define VSCLASS_DATEPICKER L"DATEPICKER"
@@ -310,7 +310,7 @@ enum SHOWCALENDARBUTTONRIGHTSTATES { //
-// DRAGDROPSTYLE class parts and states
+// DRAGDROPSTYLE class parts and states
//
#define VSCLASS_DRAGDROPSTYLE L"DRAGDROPSTYLE"
#define VSCLASS_DRAGDROP L"DRAGDROP"
@@ -360,7 +360,7 @@ enum NONESTATES { //
-// EDITSTYLE class parts and states
+// EDITSTYLE class parts and states
//
#define VSCLASS_EDITSTYLE L"EDITSTYLE"
#define VSCLASS_EDIT L"EDIT"
@@ -436,7 +436,7 @@ enum EDITBORDER_HVSCROLLSTATES { //
-// EXPLORERBARSTYLE class parts and states
+// EXPLORERBARSTYLE class parts and states
//
#define VSCLASS_EXPLORERBARSTYLE L"EXPLORERBARSTYLE"
#define VSCLASS_EXPLORERBAR L"EXPLORERBAR"
@@ -505,7 +505,7 @@ enum SPECIALGROUPEXPANDSTATES { //
-// FLYOUTSTYLE class parts and states
+// FLYOUTSTYLE class parts and states
//
#define VSCLASS_FLYOUTSTYLE L"FLYOUTSTYLE"
#define VSCLASS_FLYOUT L"FLYOUT"
@@ -547,7 +547,7 @@ enum LINKHEADERSTATES { //
-// HEADERSTYLE class parts and states
+// HEADERSTYLE class parts and states
//
#define VSCLASS_HEADERSTYLE L"HEADERSTYLE"
#define VSCLASS_HEADER L"HEADER"
@@ -620,7 +620,7 @@ enum HEADEROVERFLOWSTATES { //
-// LISTBOXSTYLE class parts and states
+// LISTBOXSTYLE class parts and states
//
#define VSCLASS_LISTBOXSTYLE L"LISTBOXSTYLE"
#define VSCLASS_LISTBOX L"LISTBOX"
@@ -672,7 +672,7 @@ enum ITEMSTATES { //
-// LISTVIEWSTYLE class parts and states
+// LISTVIEWSTYLE class parts and states
//
#define VSCLASS_LISTVIEWSTYLE L"LISTVIEWSTYLE"
#define VSCLASS_LISTVIEW L"LISTVIEW"
@@ -753,7 +753,7 @@ enum COLLAPSEBUTTONSTATES { //
-// MENUSTYLE class parts and states
+// MENUSTYLE class parts and states
//
#define VSCLASS_MENUSTYLE L"MENUSTYLE"
#define VSCLASS_MENU L"MENU"
@@ -844,7 +844,7 @@ enum SYSTEMRESTORESTATES { //
-// NAVIGATION class parts and states
+// NAVIGATION class parts and states
//
#define VSCLASS_NAVIGATION L"NAVIGATION"
@@ -877,7 +877,7 @@ enum NAV_MENUBUTTONSTATES { //
-// PROGRESSSTYLE class parts and states
+// PROGRESSSTYLE class parts and states
//
#define VSCLASS_PROGRESSSTYLE L"PROGRESSSTYLE"
#define VSCLASS_PROGRESS L"PROGRESS"
@@ -925,7 +925,7 @@ enum FILLVERTSTATES { //
-// REBARSTYLE class parts and states
+// REBARSTYLE class parts and states
//
#define VSCLASS_REBARSTYLE L"REBARSTYLE"
#define VSCLASS_REBAR L"REBAR"
@@ -969,7 +969,7 @@ enum SPLITTERVERTSTATES { //
-// SCROLLBARSTYLE class parts and states
+// SCROLLBARSTYLE class parts and states
//
#define VSCLASS_SCROLLBARSTYLE L"SCROLLBARSTYLE"
#define VSCLASS_SCROLLBAR L"SCROLLBAR"
@@ -1033,7 +1033,7 @@ enum SIZEBOXSTATES { //
-// SPINSTYLE class parts and states
+// SPINSTYLE class parts and states
//
#define VSCLASS_SPINSTYLE L"SPINSTYLE"
#define VSCLASS_SPIN L"SPIN"
@@ -1077,7 +1077,7 @@ enum DOWNHORZSTATES { //
-// STATUSSTYLE class parts and states
+// STATUSSTYLE class parts and states
//
#define VSCLASS_STATUSSTYLE L"STATUSSTYLE"
#define VSCLASS_STATUS L"STATUS"
@@ -1092,7 +1092,7 @@ enum STATUSPARTS { //
-// TABSTYLE class parts and states
+// TABSTYLE class parts and states
//
#define VSCLASS_TABSTYLE L"TABSTYLE"
#define VSCLASS_TAB L"TAB"
@@ -1179,7 +1179,7 @@ enum TOPTABITEMBOTHEDGESTATES { //
-// TASKDIALOGSTYLE class parts and states
+// TASKDIALOGSTYLE class parts and states
//
#define VSCLASS_TASKDIALOGSTYLE L"TASKDIALOGSTYLE"
#define VSCLASS_TASKDIALOG L"TASKDIALOG"
@@ -1225,7 +1225,7 @@ enum EXPANDOBUTTONSTATES { //
-// TEXTSTYLE class parts and states
+// TEXTSTYLE class parts and states
//
#define VSCLASS_TEXTSTYLE L"TEXTSTYLE"
@@ -1255,7 +1255,7 @@ enum CONTROLLABELSTATES { //
-// TOOLBARSTYLE class parts and states
+// TOOLBARSTYLE class parts and states
//
#define VSCLASS_TOOLBARSTYLE L"TOOLBARSTYLE"
#define VSCLASS_TOOLBAR L"TOOLBAR"
@@ -1285,7 +1285,7 @@ enum TOOLBARSTYLESTATES { //
-// TOOLTIPSTYLE class parts and states
+// TOOLTIPSTYLE class parts and states
//
#define VSCLASS_TOOLTIPSTYLE L"TOOLTIPSTYLE"
#define VSCLASS_TOOLTIP L"TOOLTIP"
@@ -1335,7 +1335,7 @@ enum WRENCHSTATES { //
-// TRACKBARSTYLE class parts and states
+// TRACKBARSTYLE class parts and states
//
#define VSCLASS_TRACKBARSTYLE L"TRACKBARSTYLE"
#define VSCLASS_TRACKBAR L"TRACKBAR"
@@ -1425,7 +1425,7 @@ enum TICSVERTSTATES { //
-// TREEVIEWSTYLE class parts and states
+// TREEVIEWSTYLE class parts and states
//
#define VSCLASS_TREEVIEWSTYLE L"TREEVIEWSTYLE"
#define VSCLASS_TREEVIEW L"TREEVIEW"
@@ -1460,7 +1460,7 @@ enum HOTGLYPHSTATES { //
-// WINDOWSTYLE class parts and states
+// WINDOWSTYLE class parts and states
//
#define VSCLASS_WINDOWSTYLE L"WINDOWSTYLE"
#define VSCLASS_WINDOW L"WINDOW"
diff --git a/include/msapi/vssym32.h b/include/msapi/vssym32.h index ea3d3cbc9f..ae1c05c405 100644 --- a/include/msapi/vssym32.h +++ b/include/msapi/vssym32.h @@ -442,7 +442,7 @@ enum GLYPHFONTSIZINGTYPE { //
-// LINK class parts and states
+// LINK class parts and states
//
#define VSCLASS_LINK L"LINK"
@@ -457,7 +457,7 @@ enum HYPERLINKSTATES { //
-// EMPTYMARKUP class parts and states
+// EMPTYMARKUP class parts and states
//
#define VSCLASS_EMPTYMARKUP L"EMPTYMARKUP"
@@ -472,7 +472,7 @@ enum MARKUPTEXTSTATES { //
-// STATIC class parts and states
+// STATIC class parts and states
//
#define VSCLASS_STATIC L"STATIC"
@@ -482,7 +482,7 @@ enum STATICPARTS { //
-// PAGE class parts and states
+// PAGE class parts and states
//
#define VSCLASS_PAGE L"PAGE"
@@ -495,7 +495,7 @@ enum PAGEPARTS { //
-// MONTHCAL class parts and states
+// MONTHCAL class parts and states
//
#define VSCLASS_MONTHCAL L"MONTHCAL"
@@ -563,7 +563,7 @@ enum NAVPREVSTATES { //
-// CLOCK class parts and states
+// CLOCK class parts and states
//
#define VSCLASS_CLOCK L"CLOCK"
@@ -579,7 +579,7 @@ enum CLOCKSTATES { //
-// TRAYNOTIFY class parts and states
+// TRAYNOTIFY class parts and states
//
#define VSCLASS_TRAYNOTIFY L"TRAYNOTIFY"
@@ -590,7 +590,7 @@ enum TRAYNOTIFYPARTS { //
-// TASKBAR class parts and states
+// TASKBAR class parts and states
//
#define VSCLASS_TASKBAR L"TASKBAR"
@@ -607,7 +607,7 @@ enum TASKBARPARTS { //
-// TASKBAND class parts and states
+// TASKBAND class parts and states
//
#define VSCLASS_TASKBAND L"TASKBAND"
@@ -619,7 +619,7 @@ enum TASKBANDPARTS { //
-// STARTPANEL class parts and states
+// STARTPANEL class parts and states
//
#define VSCLASS_STARTPANEL L"STARTPANEL"
@@ -689,7 +689,7 @@ enum LOGOFFBUTTONSSTATES { //
-// MENUBAND class parts and states
+// MENUBAND class parts and states
//
#define VSCLASS_MENUBAND L"MENUBAND"
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index edf35b99b2..d81fd6f4cd 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_plugins.h"
-#define PLUGIN_MAKE_VERSION(a,b,c,d) (((((DWORD)(a))&0xFF)<<24)|((((DWORD)(b))&0xFF)<<16)|((((DWORD)(c))&0xFF)<<8)|(((DWORD)(d))&0xFF))
+#define PLUGIN_MAKE_VERSION(a, b, c, d) (((((DWORD)(a))&0xFF)<<24)|((((DWORD)(b))&0xFF)<<16)|((((DWORD)(c))&0xFF)<<8)|(((DWORD)(d))&0xFF))
#define MAXMODULELABELLENGTH 64
#if defined( _UNICODE )
@@ -148,15 +148,15 @@ typedef struct { #define ME_SYSTEM_MODULEUNLOAD "Miranda/System/UnloadModule"
#ifndef MODULES_H_
- typedef int (*MIRANDAHOOK)(WPARAM,LPARAM);
- typedef int (*MIRANDAHOOKPARAM)(WPARAM,LPARAM,LPARAM);
- typedef int (*MIRANDAHOOKOBJ)(void*,WPARAM,LPARAM);
- typedef int (*MIRANDAHOOKOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+ typedef int (*MIRANDAHOOK)(WPARAM, LPARAM);
+ typedef int (*MIRANDAHOOKPARAM)(WPARAM, LPARAM, LPARAM);
+ typedef int (*MIRANDAHOOKOBJ)(void*, WPARAM, LPARAM);
+ typedef int (*MIRANDAHOOKOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
- typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM);
- typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM,LPARAM,LPARAM);
- typedef INT_PTR (*MIRANDASERVICEOBJ)(void*,WPARAM,LPARAM);
- typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+ typedef INT_PTR (*MIRANDASERVICE)(WPARAM, LPARAM);
+ typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM, LPARAM, LPARAM);
+ typedef INT_PTR (*MIRANDASERVICEOBJ)(void*, WPARAM, LPARAM);
+ typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
#ifdef _WIN64
#define CALLSERVICE_NOTFOUND ((INT_PTR)0x8000000000000000)
@@ -170,27 +170,27 @@ typedef struct { typedef struct tagPLUGINLINK {
HANDLE (*CreateHookableEvent)(const char *);
int (*DestroyHookableEvent)(HANDLE);
- int (*NotifyEventHooks)(HANDLE,WPARAM,LPARAM);
- HANDLE (*HookEvent)(const char *,MIRANDAHOOK);
- HANDLE (*HookEventMessage)(const char *,HWND,UINT);
+ int (*NotifyEventHooks)(HANDLE, WPARAM, LPARAM);
+ HANDLE (*HookEvent)(const char *, MIRANDAHOOK);
+ HANDLE (*HookEventMessage)(const char *, HWND, UINT);
int (*UnhookEvent)(HANDLE);
- HANDLE (*CreateServiceFunction)(const char *,MIRANDASERVICE);
- HANDLE (*CreateTransientServiceFunction)(const char *,MIRANDASERVICE);
+ HANDLE (*CreateServiceFunction)(const char *, MIRANDASERVICE);
+ HANDLE (*CreateTransientServiceFunction)(const char *, MIRANDASERVICE);
int (*DestroyServiceFunction)(HANDLE);
- INT_PTR (*CallService)(const char *,WPARAM,LPARAM);
+ INT_PTR (*CallService)(const char *, WPARAM, LPARAM);
int (*ServiceExists)(const char *); //v0.1.0.1+
- INT_PTR (*CallServiceSync)(const char *,WPARAM,LPARAM); //v0.3.3+
+ INT_PTR (*CallServiceSync)(const char *, WPARAM, LPARAM); //v0.3.3+
int (*CallFunctionAsync) (void (__stdcall *)(void *), void *); //v0.3.4+
int (*SetHookDefaultForHookableEvent) (HANDLE, MIRANDAHOOK); // v0.3.4 (2004/09/15)
- HANDLE (*CreateServiceFunctionParam)(const char *,MIRANDASERVICEPARAM,LPARAM); // v0.7+ (2007/04/24)
- int (*NotifyEventHooksDirect)(HANDLE,WPARAM,LPARAM); // v0.7+
+ HANDLE (*CreateServiceFunctionParam)(const char *, MIRANDASERVICEPARAM, LPARAM); // v0.7+ (2007/04/24)
+ int (*NotifyEventHooksDirect)(HANDLE, WPARAM, LPARAM); // v0.7+
INT_PTR (*CallProtoService)(const char *, const char *, WPARAM, LPARAM );
INT_PTR (*CallContactService)( HANDLE, const char *, WPARAM, LPARAM );
- HANDLE (*HookEventParam)(const char *,MIRANDAHOOKPARAM,LPARAM);
- HANDLE (*HookEventObj)(const char *,MIRANDAHOOKOBJ, void* );
+ HANDLE (*HookEventParam)(const char *, MIRANDAHOOKPARAM, LPARAM);
+ HANDLE (*HookEventObj)(const char *, MIRANDAHOOKOBJ, void* );
HANDLE (*HookEventObjParam)(const char *, MIRANDAHOOKOBJPARAM, void*, LPARAM);
- HANDLE (*CreateServiceFunctionObj)(const char *,MIRANDASERVICEOBJ,void*);
- HANDLE (*CreateServiceFunctionObjParam)(const char *,MIRANDASERVICEOBJPARAM,void*,LPARAM);
+ HANDLE (*CreateServiceFunctionObj)(const char *, MIRANDASERVICEOBJ, void*);
+ HANDLE (*CreateServiceFunctionObjParam)(const char *, MIRANDASERVICEOBJPARAM, void*, LPARAM);
void (*KillObjectServices)(void *);
void (*KillObjectEventHooks)(void *);
} PLUGINLINK;
@@ -201,27 +201,27 @@ typedef struct tagPLUGINLINK { extern PLUGINLINK *pluginLink;
#define CreateHookableEvent(a) pluginLink->CreateHookableEvent(a)
#define DestroyHookableEvent(a) pluginLink->DestroyHookableEvent(a)
- #define NotifyEventHooks(a,b,c) pluginLink->NotifyEventHooks(a,b,c)
- #define HookEventMessage(a,b,c) pluginLink->HookEventMessage(a,b,c)
- #define HookEvent(a,b) pluginLink->HookEvent(a,b)
+ #define NotifyEventHooks(a, b, c) pluginLink->NotifyEventHooks(a, b, c)
+ #define HookEventMessage(a, b, c) pluginLink->HookEventMessage(a, b, c)
+ #define HookEvent(a, b) pluginLink->HookEvent(a, b)
#define UnhookEvent(a) pluginLink->UnhookEvent(a)
- #define CreateServiceFunction(a,b) pluginLink->CreateServiceFunction(a,b)
- #define CreateTransientServiceFunction(a,b) pluginLink->CreateTransientServiceFunction(a,b)
+ #define CreateServiceFunction(a, b) pluginLink->CreateServiceFunction(a, b)
+ #define CreateTransientServiceFunction(a, b) pluginLink->CreateTransientServiceFunction(a, b)
#define DestroyServiceFunction(a) pluginLink->DestroyServiceFunction(a)
- #define CallService(a,b,c) pluginLink->CallService(a,b,c)
+ #define CallService(a, b, c) pluginLink->CallService(a, b, c)
#define ServiceExists(a) pluginLink->ServiceExists(a)
- #define CallServiceSync(a,b,c) pluginLink->CallServiceSync(a,b,c)
- #define CallFunctionAsync(a,b) pluginLink->CallFunctionAsync(a,b)
- #define SetHookDefaultForHookableEvent(a,b) pluginLink->SetHookDefaultForHookableEvent(a,b)
- #define CreateServiceFunctionParam(a,b,c) pluginLink->CreateServiceFunctionParam(a,b,c)
- #define NotifyEventHooksDirect(a,b,c) pluginLink->NotifyEventHooksDirect(a,b,c)
- #define CallProtoService(a,b,c,d) pluginLink->CallProtoService(a,b,c,d)
- #define CallContactService(a,b,c,d) pluginLink->CallContactService(a,b,c,d)
- #define HookEventParam(a,b,c) pluginLink->HookEventParam(a,b,c)
- #define HookEventObj(a,b,c) pluginLink->HookEventObj(a,b,c)
- #define HookEventObjParam(a,b,c,d) pluginLink->HookEventObjParam(a,b,c,d)
- #define CreateServiceFunctionObj(a,b,c) pluginLink->CreateServiceFunctionObj(a,b,c)
- #define CreateServiceFunctionObjParam(a,b,c,d) pluginLink->CreateServiceFunctionObjParam(a,b,c,d)
+ #define CallServiceSync(a, b, c) pluginLink->CallServiceSync(a, b, c)
+ #define CallFunctionAsync(a, b) pluginLink->CallFunctionAsync(a, b)
+ #define SetHookDefaultForHookableEvent(a, b) pluginLink->SetHookDefaultForHookableEvent(a, b)
+ #define CreateServiceFunctionParam(a, b, c) pluginLink->CreateServiceFunctionParam(a, b, c)
+ #define NotifyEventHooksDirect(a, b, c) pluginLink->NotifyEventHooksDirect(a, b, c)
+ #define CallProtoService(a, b, c, d) pluginLink->CallProtoService(a, b, c, d)
+ #define CallContactService(a, b, c, d) pluginLink->CallContactService(a, b, c, d)
+ #define HookEventParam(a, b, c) pluginLink->HookEventParam(a, b, c)
+ #define HookEventObj(a, b, c) pluginLink->HookEventObj(a, b, c)
+ #define HookEventObjParam(a, b, c, d) pluginLink->HookEventObjParam(a, b, c, d)
+ #define CreateServiceFunctionObj(a, b, c) pluginLink->CreateServiceFunctionObj(a, b, c)
+ #define CreateServiceFunctionObjParam(a, b, c, d) pluginLink->CreateServiceFunctionObjParam(a, b, c, d)
#define KillObjectServices(a) pluginLink->KillObjectServices(a)
#define KillObjectEventHooks(a) pluginLink->KillObjectEventHooks(a)
#endif
diff --git a/include/statusmodes.h b/include/statusmodes.h index da973ab79c..2120f2d979 100644 --- a/include/statusmodes.h +++ b/include/statusmodes.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
diff --git a/include/win2k.h b/include/win2k.h index 37df1d8f12..d71504dc2b 100644 --- a/include/win2k.h +++ b/include/win2k.h @@ -41,15 +41,15 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ //These macros use the above order, not release order.
#define WinVerMajor() LOBYTE(LOWORD(GetVersion()))
#define WinVerMinor() HIBYTE(LOWORD(GetVersion()))
-#define IsWinVerNT() ((GetVersion()&0x80000000)==0)
+#define IsWinVerNT() ((GetVersion()&0x80000000) == 0)
// IsWinVerNT4Plus() is buggy, Windows 98 is 4.10.1998
#define IsWinVerNT4Plus() (WinVerMajor()>=5 || WinVerMinor()>0 || IsWinVerNT())
-#define IsWinVer98Plus() (LOWORD(GetVersion())!=4)
+#define IsWinVer98Plus() (LOWORD(GetVersion()) != 4)
#define IsWinVerMEPlus() (WinVerMajor()>=5 || WinVerMinor()>10)
#define IsWinVer2000Plus() (WinVerMajor()>=5 && IsWinVerNT())
-#define IsWinVerXPPlus() (WinVerMajor()>=5 && LOWORD(GetVersion())!=5)
+#define IsWinVerXPPlus() (WinVerMajor()>=5 && LOWORD(GetVersion()) != 5)
#define IsWinVerVistaPlus() (WinVerMajor()>=6)
-#define IsWinVer7Plus() (WinVerMajor()>6 || (WinVerMajor()==6 && WinVerMinor()>=1))
+#define IsWinVer7Plus() (WinVerMajor()>6 || (WinVerMajor() == 6 && WinVerMinor()>=1))
// put stuff that's not apart of any SDKs but is used nonetheless
@@ -59,7 +59,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ #define MENUITEMINFO_V4_SIZE sizeof(MENUITEMINFO)
#else
//mii was extended for NT5/Win98, so need the old length for some stuff
-#define MENUITEMINFO_V4_SIZE (offsetof(MENUITEMINFO,cch)+sizeof((*((MENUITEMINFO*)0)).cch))
+#define MENUITEMINFO_V4_SIZE (offsetof(MENUITEMINFO, cch)+sizeof((*((MENUITEMINFO*)0)).cch))
#endif
#if _MSC_VER >= 1300
@@ -96,9 +96,9 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ #define DTBG_OMITCONTENT 0x00000008 // don't draw content area of part
#define DTBG_COMPUTINGREGION 0x00000010 // TRUE if calling to compute region
#define DTBG_MIRRORDC 0x00000020 // assume the hdc is mirrorred and
- // flip images as appropriate (currently
+ // flip images as appropriate (currently
// only supported for bgtype=imagefile)
- #define DTBG_NOMIRROR 0x00000040 // don't mirror the output, overrides everything else
+ #define DTBG_NOMIRROR 0x00000040 // don't mirror the output, overrides everything else
typedef struct _DTBGOPTS
{
@@ -123,7 +123,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ #define DTT_CALLBACK (1UL << 12) // pfnDrawTextCallback has been specified
#define DTT_COMPOSITED (1UL << 13) // Draws text with antialiased alpha (needs a DIB section)
- typedef
+ typedef
int
(WINAPI *DTT_CALLBACK_PROC)
(
@@ -151,7 +151,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ int iGlowSize; // Glow radious around text
DTT_CALLBACK_PROC pfnDrawTextCallback; // Callback for DrawText
LPARAM lParam; // Parameter for callback
- } DTTOPTS, *PDTTOPTS;
+ } DTTOPTS, *PDTTOPTS;
#define WTNCA_NODRAWCAPTION 0x00000001 // don't draw the window caption
#define WTNCA_NODRAWICON 0x00000002 // don't draw the system icon
@@ -181,7 +181,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ #ifdef __cplusplus
extern "C" {
#endif
- WINGDIAPI BOOL WINAPI AlphaBlend(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
+ WINGDIAPI BOOL WINAPI AlphaBlend(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
#ifdef __cplusplus
}
#endif
@@ -192,7 +192,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
#endif
#ifndef OPENFILENAME_SIZE_VERSION_400
- #define OPENFILENAME_SIZE_VERSION_400 CDSIZEOF_STRUCT(OPENFILENAME,lpTemplateName)
+ #define OPENFILENAME_SIZE_VERSION_400 CDSIZEOF_STRUCT(OPENFILENAME, lpTemplateName)
#endif
#ifndef NOTIFYICONDATAA_V1_SIZE
#define NOTIFYICONDATAA_V1_SIZE CDSIZEOF_STRUCT(NOTIFYICONDATAA, szTip[64])
@@ -201,7 +201,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ #define NOTIFYICONDATA_V1_SIZE CDSIZEOF_STRUCT(NOTIFYICONDATA, szTip[64])
#endif
#ifndef OPENFILENAMEW_SIZE_VERSION_400
- #define OPENFILENAMEW_SIZE_VERSION_400 CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)
+ #define OPENFILENAMEW_SIZE_VERSION_400 CDSIZEOF_STRUCT(OPENFILENAMEW, lpTemplateName)
#endif
#ifndef NOTIFYICONDATAW_V1_SIZE
#define NOTIFYICONDATAW_V1_SIZE CDSIZEOF_STRUCT(NOTIFYICONDATAW, szTip[64])
@@ -255,7 +255,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ #define CBS_CHECKEDNORMAL 5
#define CBS_CHECKEDHOT 6
#define CFM_WEIGHT 0x00400000
- #define CFM_UNDERLINETYPE 0x00800000
+ #define CFM_UNDERLINETYPE 0x00800000
#define CFM_BACKCOLOR 0x04000000
#define CFU_UNDERLINE 1
#define CFU_UNDERLINEWORD 2
@@ -499,7 +499,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ typedef
enum TBPFLAG
- {
+ {
TBPF_NOPROGRESS = 0,
TBPF_INDETERMINATE = 0x1,
TBPF_NORMAL = 0x2,
@@ -508,7 +508,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ } TBPFLAG;
typedef struct THUMBBUTTON *LPTHUMBBUTTON;
-
+
static const GUID IID_ITaskbarList3 = { 0xea1afb91, 0x9e28, 0x4b86, { 0x90, 0xE9, 0x9e, 0x9f, 0x8a, 0x5e, 0xef, 0xaf } };
#ifdef INTERFACE
@@ -533,7 +533,7 @@ File created by Christian Kästner, and tweaked a bit by Richard Hughes*/ // ITaskbarList3 members
STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE;
- STDMETHOD (RegisterTab) (THIS_ HWND hwndTab,HWND hwndMDI) PURE;
+ STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE;
STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE;
STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE;
STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE;
diff --git a/plugins/AddContactPlus/main.cpp b/plugins/AddContactPlus/main.cpp index 7d1475d72c..932105e175 100644 --- a/plugins/AddContactPlus/main.cpp +++ b/plugins/AddContactPlus/main.cpp @@ -110,7 +110,7 @@ static int OnAccListChanged(WPARAM, LPARAM) mi.icolibItem = hIconLibItem;
mi.ptszName = LPGENT("&Add Contact...");
mi.pszService = MS_ADDCONTACTPLUS_SHOW;
- hMainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMainMenuItem = Menu_AddMainMenuItem(&mi);
if (ServiceExists(MS_TB_ADDBUTTON))
{
diff --git a/plugins/Alarms/frame.cpp b/plugins/Alarms/frame.cpp index e298cae41d..cc36c3bc86 100644 --- a/plugins/Alarms/frame.cpp +++ b/plugins/Alarms/frame.cpp @@ -567,17 +567,17 @@ int CreateFrame() // create menu item
CreateServiceFunction(MODULE "/ShowHideReminders", ShowHideMenuFunc);
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = {0};
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL;
+ mi.cbSize=sizeof(mi);
+ mi.flags = CMIM_ALL;
- menu.hIcon=hIconMenuShowHide;
- menu.pszName = Translate("Show Reminders");
- menu.pszService= MODULE "/ShowHideReminders";
- menu.pszPopupName = Translate("Alarms");
- menu.position = 500010000;
- hMenuShowReminders = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu);
+ mi.hIcon=hIconMenuShowHide;
+ mi.pszName = Translate("Show Reminders");
+ mi.pszService= MODULE "/ShowHideReminders";
+ mi.pszPopupName = Translate("Alarms");
+ mi.position = 500010000;
+ hMenuShowReminders = Menu_AddMainMenuItem(&mi);
/////////////////////
if (!options.auto_showhide) {
diff --git a/plugins/Alarms/options.cpp b/plugins/Alarms/options.cpp index 4b6076e6bb..9f2b9d1222 100644 --- a/plugins/Alarms/options.cpp +++ b/plugins/Alarms/options.cpp @@ -696,22 +696,20 @@ void AddMenuItem() {
if (hMainMenuItem) return;
- CLISTMENUITEM menu = {0};
-
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL;
- menu.hIcon=hIconMenuSet;
-
- menu.pszName = Translate("Set Alarm");
- menu.pszService= MODULE "/NewAlarm";
- menu.position = 500010000;
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_ALL;
+ mi.hIcon = hIconMenuSet;
+ mi.pszName = "Set Alarm";
+ mi.pszService = MODULE "/NewAlarm";
+ mi.position = 500010000;
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
- menu.pszPopupName = Translate("Alarms");
- if (ServiceExists(MS_CLIST_ADDGROUPMENUITEM)) {
+ mi.pszPopupName = "Alarms";
+ if (ServiceExists(MS_CLIST_REMOVEGROUPMENUITEM)) {
GroupMenuParam gmp = {0};
- hGroupMenuItem = (HANDLE)CallService(MS_CLIST_ADDGROUPMENUITEM,(WPARAM)&gmp,(LPARAM)&menu);
+ hGroupMenuItem = Menu_AddGroupMenuItem(&gmp, &mi);
}
- hMainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+ hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
///////////////////////
diff --git a/plugins/AuthState/main.cpp b/plugins/AuthState/main.cpp index ba5a006f2d..890e3689b1 100644 --- a/plugins/AuthState/main.cpp +++ b/plugins/AuthState/main.cpp @@ -369,7 +369,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mi.flags = CMIF_TCHAR;
mi.ptszName = _T("Enable AuthState icons");
mi.pszService = "AuthState/MenuItem";
- hUserMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hUserMenu = Menu_AddContactMenuItem(&mi);
}
g_IECClear.cbSize = sizeof(IconExtraColumn);
diff --git a/plugins/AutoRun/main.c b/plugins/AutoRun/main.c index 31eb9790cd..c1c7263d68 100644 --- a/plugins/AutoRun/main.c +++ b/plugins/AutoRun/main.c @@ -1,3 +1,5 @@ +#define _CRT_SECURE_NO_WARNINGS
+
#include <windows.h>
#include "autorun.h"
diff --git a/plugins/BasicHistory/BasicHistory.cpp b/plugins/BasicHistory/BasicHistory.cpp index bbe74a1629..975cd061ed 100644 --- a/plugins/BasicHistory/BasicHistory.cpp +++ b/plugins/BasicHistory/BasicHistory.cpp @@ -140,18 +140,18 @@ void InitMenuItems() mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_HISTORY);
mi.pszName = LPGEN("View &History");
mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY;
- hContactMenu = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hContactMenu = Menu_AddContactMenuItem(&mi);
mi.position = 500060000;
mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.position = 1000090001;
mi.flags = CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_DELETE);
mi.pszName = LPGEN("Delete All User History");
mi.pszService = MS_HISTORY_DELETEALLCONTACTHISTORY;
- hDeleteContactMenu = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hDeleteContactMenu = Menu_AddContactMenuItem(&mi);
hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
}
@@ -168,7 +168,7 @@ void InitTaskMenuItems() mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_HISTORY);
mi.pszName = LPGEN("Execute history task");
- hTaskMainMenu = (HGENMENU)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hTaskMainMenu = Menu_AddMainMenuItem(&mi);
}
std::vector<TaskOptions>::iterator taskIt = Options::instance->taskOptions.begin();
@@ -202,7 +202,7 @@ void InitTaskMenuItems() mi.hParentMenu = hTaskMainMenu;
mi.popupPosition = pos++;
mi.ptszName = (TCHAR*)taskIt->taskName.c_str();
- HGENMENU menu = (HGENMENU)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ HGENMENU menu = Menu_AddMainMenuItem(&mi);
taskMenus.push_back(menu);
}
}
diff --git a/plugins/Boltun/boltun.cpp b/plugins/Boltun/boltun.cpp index c67c56949f..a26b68c862 100644 --- a/plugins/Boltun/boltun.cpp +++ b/plugins/Boltun/boltun.cpp @@ -668,19 +668,19 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mi.pszContactOwner = NULL;
mi.pszName = BOLTUN_AUTO_CHAT;
mi.pszService = SERV_CONTACT_AUTO_CHAT;
- hMenuItemAutoChat = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hMenuItemAutoChat = Menu_AddContactMenuItem(&mi);
mi.position = -50010001; //TODO: check the warning
mi.pszName = BOLTUN_NOT_TO_CHAT;
mi.pszService = SERV_CONTACT_NOT_TO_CHAT;
- hMenuItemNotToChat = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hMenuItemNotToChat = Menu_AddContactMenuItem(&mi);
mi.flags = CMIF_NOTOFFLINE;
mi.position = -50010000; //TODO: check the warning
- mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RECVMSG));
+ mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RECVMSG));
mi.pszName = BOLTUN_START_CHATTING;
mi.pszService = SERV_CONTACT_START_CHATTING;
- hMenuItemStartChatting = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hMenuItemStartChatting = Menu_AddContactMenuItem(&mi);
}
int line;
blInit = LoadMind(Config.MindFileName, line);
diff --git a/plugins/BossKeyPlus/BossKey.cpp b/plugins/BossKeyPlus/BossKey.cpp index b0a21ef6d2..8cf8e3cfdc 100644 --- a/plugins/BossKeyPlus/BossKey.cpp +++ b/plugins/BossKeyPlus/BossKey.cpp @@ -659,7 +659,7 @@ void BossKeyMenuItemInit(void) // Add menu item mi.ptszName = _T("Hide");
mi.pszService = MS_BOSSKEY_HIDE;
- g_hMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ g_hMenuItem = Menu_AddMainMenuItem(&mi);
g_hmGenMenuInit = HookEvent(ME_CLIST_PREBUILDMAINMENU, GenMenuInit);
}
diff --git a/plugins/BuddyExpectator/BuddyExpectator.cpp b/plugins/BuddyExpectator/BuddyExpectator.cpp index c8d1aebeac..ebf4625b93 100644 --- a/plugins/BuddyExpectator/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/BuddyExpectator.cpp @@ -818,7 +818,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.position = 200000;
mi.pszName = Translate("Enable Miss You");
mi.pszService = "BuddyExpectator/actionMissYouClick";
- hContactMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hContactMenu = Menu_AddContactMenuItem(&mi);
}
// Updater plugin support
diff --git a/plugins/CSList/cslist.cpp b/plugins/CSList/cslist.cpp index f354d68519..edb87b0175 100644 --- a/plugins/CSList/cslist.cpp +++ b/plugins/CSList/cslist.cpp @@ -424,7 +424,7 @@ void CSList::addProtoStatusMenuItem( char* protoName, void* arg ) mi.position = 2000040000;
mi.pszService = buf;
mi.ptszPopupName = pdescr->tszAccountName;
- CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddStatusMenuItem(&mi);
cslist->registerHotkeys(buf, pdescr->tszAccountName, pdescr->iOrder);
}
diff --git a/plugins/Chat/services.c b/plugins/Chat/services.c index 5687e9cb99..53ed1a03c0 100644 --- a/plugins/Chat/services.c +++ b/plugins/Chat/services.c @@ -227,14 +227,14 @@ static int ModulesLoaded(WPARAM wParam,LPARAM lParam) mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN );
mi.pszName = LPGEN("&Join");
mi.pszService = "GChat/JoinChat";
- hJoinMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hJoinMenuItem = Menu_AddContactMenuItem(&mi);
mi.position = -2000090000;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_LEAVE );
mi.flags = CMIF_NOTOFFLINE | CMIF_ICONFROMICOLIB;
mi.pszName = LPGEN("&Leave");
mi.pszService = "GChat/LeaveChat";
- hLeaveMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hLeaveMenuItem = Menu_AddContactMenuItem(&mi);
}
g_hFontsChanged = HookEvent(ME_FONT_RELOAD, FontsChanged);
diff --git a/plugins/ClientChangeNotify/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/ClientChangeNotify.cpp index ee629a7409..a19c41e128 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/ClientChangeNotify.cpp @@ -442,7 +442,7 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) mi.pszService = MS_CCN_TOGGLEPOPUPS;
mi.ptszPopupName = TranslateT("PopUps");
- g_hTogglePopupsMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi);
}
// seems that Fingerprint is not installed
diff --git a/plugins/Clist/clcfonts.c b/plugins/Clist/clcfonts.c index b1720e0814..9ff56524a4 100644 --- a/plugins/Clist/clcfonts.c +++ b/plugins/Clist/clcfonts.c @@ -59,11 +59,6 @@ static int fontListOrder[CLIST_FONTID_MAX + 1] = CLIST_FONTID_DIVIDERS
};
-#define CLCDEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
-#define CLCDEFAULT_SELTEXTCOLOUR GetSysColor(COLOR_HIGHLIGHTTEXT)
-#define CLCDEFAULT_HOTTEXTCOLOUR (IsWinVer98Plus()?RGB(0,0,255):GetSysColor(COLOR_HOTLIGHT))
-#define CLCDEFAULT_QUICKSEARCHCOLOUR RGB(255,255,0)
-
static int FS_FontsChanged(WPARAM wParam, LPARAM lParam)
{
pcli->pfnClcOptionsChanged();
diff --git a/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp index f260db6058..3bf3eb1700 100644 --- a/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp @@ -646,7 +646,7 @@ int CLUIFramesGetalClientFrame(void) return -1;
}
-HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *addservice)
+HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
CLISTMENUITEM mi;
//TMO_MenuItem tmi;
@@ -665,7 +665,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.pszName = LPGEN("&FrameTitle");
mi.flags = CMIF_CHILDPOPUP | CMIF_GRAYED | CMIF_ICONFROMICOLIB;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMITitle = menuid;
else Frames[framepos].MenuHandles.MITitle = menuid;
@@ -679,7 +679,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszContactOwner = (char *)0;
mi.pszService = MS_CLIST_FRAMES_SHFRAME;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIVisible = menuid;
else Frames[framepos].MenuHandles.MIVisible = menuid;
@@ -690,7 +690,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SHFRAMETITLEBAR;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMITBVisible = menuid;
else Frames[framepos].MenuHandles.MITBVisible = menuid;
@@ -704,7 +704,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_ULFRAME;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMILock = menuid;
else Frames[framepos].MenuHandles.MILock = menuid;
@@ -715,7 +715,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_UCOLLFRAME;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIColl = menuid;
else Frames[framepos].MenuHandles.MIColl = menuid;
@@ -727,7 +727,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP;
mi.pszService = "Set_Floating";
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIFloating = menuid;
else Frames[framepos].MenuHandles.MIFloating = menuid;
@@ -741,7 +741,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETUNBORDER;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIBorder = menuid;
else Frames[framepos].MenuHandles.MIBorder = menuid;
@@ -754,7 +754,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETSKINNED;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMISkinned = menuid;
else Frames[framepos].MenuHandles.MISkinned = menuid;
@@ -769,7 +769,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
mi.pszService = "";
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignRoot = menuid;
else Frames[framepos].MenuHandles.MIAlignRoot = menuid;
@@ -781,7 +781,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.pszName = LPGEN("&Top");
mi.pszService = CLUIFRAMESSETALIGNALTOP;
mi.pszContactOwner = (char *)alTop;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignTop = menuid;
else Frames[framepos].MenuHandles.MIAlignTop = menuid;
@@ -791,7 +791,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.pszName = LPGEN("&Client");
mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
mi.pszContactOwner = (char *)alClient;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignClient = menuid;
else Frames[framepos].MenuHandles.MIAlignClient = menuid;
@@ -800,7 +800,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.pszName = LPGEN("&Bottom");
mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
mi.pszContactOwner = (char *)alBottom;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignBottom = menuid;
else Frames[framepos].MenuHandles.MIAlignBottom = menuid;
@@ -815,7 +815,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
mi.pszService = "";
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice, 0, (LPARAM) & mi);
+ menuid = pfnAdd(&mi);
mi.pszPopupName = (char *)menuid;
mi.popupPosition = frameid;
@@ -824,7 +824,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP;
mi.pszService = CLUIFRAMESMOVEUP;
mi.pszContactOwner = (char *)1;
- CallService(addservice, 0, (LPARAM)&mi);
+ pfnAdd(&mi);
mi.pszPopupName = (char *)menuid;
mi.popupPosition = frameid;
@@ -833,8 +833,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, char *ad mi.flags = CMIF_CHILDPOPUP;
mi.pszService = CLUIFRAMESMOVEDOWN;
mi.pszContactOwner = (char *) - 1;
- CallService(addservice, 0, (LPARAM)&mi);
-
+ pfnAdd(&mi);
}
return 0;
@@ -1633,7 +1632,7 @@ static int CLUIFramesLoadMainMenu() mi.pszPopupName = (char*) - 1;
mi.pszName = LPGEN("Frames");
mi.pszService = 0;
- MainMIRoot = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) & mi);
+ MainMIRoot = Menu_AddMainMenuItem(&mi);
// create frames menu
separator = (int)3000200000;
@@ -1644,8 +1643,8 @@ static int CLUIFramesLoadMainMenu() mi.pszPopupName = (char*)MainMIRoot;
mi.ptszName = Frames[i].TitleBar.tbname ? Frames[i].TitleBar.tbname : Frames[i].name;
mi.pszService = 0;
- Frames[i].MenuHandles.MainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) & mi);
- CLUIFramesCreateMenuForFrame(Frames[i].id, (int)Frames[i].MenuHandles.MainMenuItem, separator, MS_CLIST_ADDMAINMENUITEM);
+ Frames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
+ CLUIFramesCreateMenuForFrame(Frames[i].id, (int)Frames[i].MenuHandles.MainMenuItem, separator, Menu_AddMainMenuItem);
CLUIFramesModifyMainMenuItems(Frames[i].id, 0);
//NotifyEventHooks(hPreBuildFrameMenuEvent,i,(LPARAM)Frames[i].MenuHandles.MainMenuItem);
CallService(MS_CLIST_FRAMEMENUNOTIFY, (WPARAM)Frames[i].id, (LPARAM)Frames[i].MenuHandles.MainMenuItem);
@@ -1661,7 +1660,7 @@ static int CLUIFramesLoadMainMenu() mi.pszPopupName = (char*)MainMIRoot;
mi.pszName = LPGEN("Show All Frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "show all titlebars" menu
mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_HELP));
@@ -1670,7 +1669,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_CHILDPOPUP;
mi.pszName = LPGEN("Show All Titlebars");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "hide all titlebars" menu
mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_HELP));
@@ -1679,7 +1678,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_CHILDPOPUP;
mi.pszName = LPGEN("Hide All Titlebars");
mi.pszService = MS_CLIST_FRAMES_HIDEALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
return 0;
}
@@ -3363,7 +3362,7 @@ static int CLUIFrameOnModulesLoad(WPARAM wParam, LPARAM lParam) hThreadMFUpdate = (HANDLE)mir_forkthreadex(reinterpret_cast<pThreadFuncEx>(MF_UpdateThread), NULL, 0, NULL);
SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE);
CLUIFramesLoadMainMenu();
- CLUIFramesCreateMenuForFrame(-1, -1, 000010000, MS_CLIST_ADDCONTEXTFRAMEMENUITEM);
+ CLUIFramesCreateMenuForFrame(-1, -1, 000010000, Menu_AddContextFrameMenuItem);
return 0;
}
@@ -3371,7 +3370,7 @@ static int CLUIFrameOnModulesUnload(WPARAM wParam, LPARAM lParam) {
mf_updatethread_running = FALSE;
- SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_NORMAL);
+ SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_NORMAL);
SetEvent(g_hEventThread);
WaitForSingleObject(hThreadMFUpdate, 2000);
CloseHandle(hThreadMFUpdate);
diff --git a/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp index 818f32ffd5..1d5b0dd850 100644 --- a/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_nicer/CLUIFrames/framesmenu.cpp @@ -210,7 +210,7 @@ int InitFramesMenus(void) CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_ADDCONTEXTFRAMEMENUITEM,AddContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
hPreBuildFrameMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
diff --git a/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp index 82786d9a45..52bdb33c01 100644 --- a/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/CLUIFrames/groupmenu.cpp @@ -321,7 +321,7 @@ void InitGroupMenus(void) CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper",UseGroupsHelper);
CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);
- CreateServiceFunction(MS_CLIST_ADDGROUPMENUITEM,AddGroupMenuItem);
+ CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
hPreBuildGroupMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
@@ -673,7 +673,7 @@ void InitSubGroupMenus(void) //CreateServiceFunction("CLISTMENUSSubGroup/UseSubGroupsHelper",UseSubGroupsHelper);
//CreateServiceFunction("CLISTMENUSSubGroup/HideOfflineRootHelper",HideOfflineRootHelper);
- CreateServiceFunction(MS_CLIST_ADDSUBGROUPMENUITEM,AddSubGroupMenuItem);
+ CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM,RemoveSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
hPreBuildSubGroupMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
diff --git a/plugins/Clist_nicer/CLUIFrames/movetogroup.cpp b/plugins/Clist_nicer/CLUIFrames/movetogroup.cpp index 5bb1218408..89bc2a42e4 100644 --- a/plugins/Clist_nicer/CLUIFrames/movetogroup.cpp +++ b/plugins/Clist_nicer/CLUIFrames/movetogroup.cpp @@ -23,7 +23,7 @@ static int OnContactMenuBuild(WPARAM wParam,LPARAM lParam) if (SendMessage(pcli->hwndContactTree, CLM_QUERYFLOATINGCONTACT, wParam, 0))
mi.flags=CMIF_CHECKED;
}
- hFloatingItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hFloatingItem = Menu_AddContactMenuItem(&mi);
}
else if (!bSetting && hFloatingItem)
{
diff --git a/plugins/Clist_nicer/SRC/clistmenus.cpp b/plugins/Clist_nicer/SRC/clistmenus.cpp index 074bbcf355..bd28435954 100644 --- a/plugins/Clist_nicer/SRC/clistmenus.cpp +++ b/plugins/Clist_nicer/SRC/clistmenus.cpp @@ -478,7 +478,7 @@ int InitCustomMenus(void) mi.pszPopupName = ( char* )-1;
mi.pszService = "CList/SetContactIgnore";
mi.pszName = LPGEN("&Contact list settings...");
- hIgnoreItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hIgnoreItem = Menu_AddContactMenuItem(&mi);
}
}
hMainStatusMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
diff --git a/plugins/Console/Console.c b/plugins/Console/Console.c index 9d4567da11..7692260239 100644 --- a/plugins/Console/Console.c +++ b/plugins/Console/Console.c @@ -1384,7 +1384,7 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) mi.position=1000000000;
mi.ptszName=(IsWindowVisible(hwndConsole))?TranslateT("Hide Console"):TranslateT("Show Console");
mi.pszService=MS_CONSOLE_SHOW_HIDE;
- hMenu = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hMenu = Menu_AddMainMenuItem(&mi);
OnFontChange(0,0);
OnColourChange(0,0);
diff --git a/plugins/ContactsPlus/main.cpp b/plugins/ContactsPlus/main.cpp index b1fa14744e..b8b86731c0 100644 --- a/plugins/ContactsPlus/main.cpp +++ b/plugins/ContactsPlus/main.cpp @@ -200,8 +200,8 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam) mi.flags |= CMIF_UNICODE;
mi.pszService = MS_CONTACTS_SEND;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS));
+ hContactMenuItem = Menu_AddContactMenuItem(&mi);
- hContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
hHookPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, HookPreBuildContactMenu);
ghSendWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
diff --git a/plugins/CyrTranslit/MirandaContact.cpp b/plugins/CyrTranslit/MirandaContact.cpp index 0906db3769..1a0f149ef8 100644 --- a/plugins/CyrTranslit/MirandaContact.cpp +++ b/plugins/CyrTranslit/MirandaContact.cpp @@ -120,11 +120,7 @@ void MirandaContact::generateMenuItemsForAllContacts() {
CLISTMENUITEM mi;
fillInMenuItem(mi);
-
- int hItem = CallService(
- MS_CLIST_ADDCONTACTMENUITEM, 0, reinterpret_cast<LPARAM>(&mi));
-
- hTransliterateCmdMenuItem = reinterpret_cast<HANDLE>(hItem);
+ hTransliterateCmdMenuItem = Menu_AddContactMenuItem(&mi);
}
//------------------------------------------------------------------------------
diff --git a/plugins/CyrTranslit/main.cpp b/plugins/CyrTranslit/main.cpp index dc675ff654..4d07deb714 100644 --- a/plugins/CyrTranslit/main.cpp +++ b/plugins/CyrTranslit/main.cpp @@ -20,21 +20,21 @@ #include "plugin.h"
#include "MirandaContact.h"
-
HINSTANCE hInst;
PLUGINLINK *pluginLink;
struct UTF8_INTERFACE utfi;
struct MM_INTERFACE mmi;
+int hLangpack = 0;
PLUGININFOEX pluginInfoEx={
sizeof(PLUGININFOEX),
- PLG_SHORTNAME,
+ PLG_SHORTNAME,
PLG_VERSION,
PLG_DESCRIPTION,
- PLG_AUTHOR,
- PLG_AUTHOREMAIL,
- PLG_COPYRIGHT,
- PLG_HOMEPAGE,
+ PLG_AUTHOR,
+ PLG_AUTHOREMAIL,
+ PLG_COPYRIGHT,
+ PLG_HOMEPAGE,
PLG_FLAGS,
PLG_REPLACESDEFMODULE,
MIID_V_CYRTRANSLIT,
@@ -59,32 +59,22 @@ static const MUUID interfaces[] = {MIID_V_CYRTRANSLIT, MIID_LAST}; extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
- //#if defined (_UNICODE)
- pluginInfoEx.flags = 1; // dynamic UNICODE_AWARE
- //#endif
return interfaces;
}
-
//------------------------------------------------------------------------------
extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
//system inits:
pluginLink = link;
-
- memset(&utfi, 0, sizeof(utfi));
mir_getUTFI(&utfi);
-
- memset(&mmi, 0, sizeof(mmi));
mir_getMMI(&mmi);
-
+ mir_getLP(&pluginInfoEx);
//plugin inits: PLACE IT ONLY AFTER THIS LINE
- CyrTranslit::MirandaContact::initialize();
-
-
+ CyrTranslit::MirandaContact::initialize();
return 0;
}
diff --git a/plugins/CyrTranslit/plugin.h b/plugins/CyrTranslit/plugin.h index fd76b71391..48310a1a3a 100644 --- a/plugins/CyrTranslit/plugin.h +++ b/plugins/CyrTranslit/plugin.h @@ -41,7 +41,7 @@ #include "m_protosvc.h"
#include "m_system.h"
#include "m_clist.h"
-
+#include "m_langpack.h"
/****** PLUGIN DEFINES *******************************************************/
diff --git a/plugins/Db_autobackups/main.c b/plugins/Db_autobackups/main.c index c7183820c3..e90f08b0c8 100644 --- a/plugins/Db_autobackups/main.c +++ b/plugins/Db_autobackups/main.c @@ -86,22 +86,22 @@ static void IcoLibInit(void) static void MenuInit(void)
{
- CLISTMENUITEM menu = {0};
- menu.cbSize = sizeof(menu);
- menu.flags = CMIF_TCHAR;
- menu.hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"backup");
- menu.ptszPopupName = LPGENT("Database");
-
- menu.ptszName = LPGENT("Backup Profile");
- menu.pszService = MS_AB_BACKUP;
- menu.position = 500100000;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
-
- menu.hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"saveas");
- menu.ptszName = LPGENT("Save Profile As...");
- menu.pszService = MS_AB_SAVEAS;
- menu.position = 500100001;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"backup");
+ mi.ptszPopupName = LPGENT("Database");
+
+ mi.ptszName = LPGENT("Backup Profile");
+ mi.pszService = MS_AB_BACKUP;
+ mi.position = 500100000;
+ Menu_AddMainMenuItem(&mi);
+
+ mi.hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"saveas");
+ mi.ptszName = LPGENT("Save Profile As...");
+ mi.pszService = MS_AB_SAVEAS;
+ mi.position = 500100001;
+ Menu_AddMainMenuItem(&mi);
}
static void TriggerActionInit(void)
diff --git a/plugins/Dbx_mmap_SA/Import_SA/main.c b/plugins/Dbx_mmap_SA/Import_SA/main.c index 87a3a76b0b..f6fd4bc67a 100644 --- a/plugins/Dbx_mmap_SA/Import_SA/main.c +++ b/plugins/Dbx_mmap_SA/Import_SA/main.c @@ -143,7 +143,7 @@ int __declspec(dllexport) Load(PLUGINLINK *link) mi.pszName = LPGEN("&Import...");
mi.position = 500050000;
mi.pszService = IMPORT_SERVICE;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
}
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
hHookOnExit = HookEvent(ME_SYSTEM_OKTOEXIT, OnExit);
diff --git a/plugins/Dbx_mmap_SA/dialogs.c b/plugins/Dbx_mmap_SA/dialogs.c index 15405ff5ee..eda06729d6 100644 --- a/plugins/Dbx_mmap_SA/dialogs.c +++ b/plugins/Dbx_mmap_SA/dialogs.c @@ -126,7 +126,7 @@ static int ModulesLoad(WPARAM wParam, LPARAM lParam) menu.pszService = MS_DB_CHANGEPASSWORD;
menu.position = 500100000;
- hSetPwdMenu = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+ hSetPwdMenu = Menu_AddMainMenuItem(&menu);
ZeroMemory(&menu,sizeof(menu));
menu.cbSize = sizeof(menu);
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 8df1bcf648..77711caee3 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -375,7 +375,7 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK * link) mi.position = 1900000000;
mi.pszName = LPGEN("&Favourite Contacts...");
mi.pszService = MS_FAVCONTACTS_SHOWMENU;
- CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddMainMenuItem(&mi);
#endif
return 0;
diff --git a/plugins/FloatingContacts/main.cpp b/plugins/FloatingContacts/main.cpp index 17c2c238e1..e8b47a684c 100644 --- a/plugins/FloatingContacts/main.cpp +++ b/plugins/FloatingContacts/main.cpp @@ -1079,7 +1079,7 @@ static void LoadMenus() mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_HIDE ) );
mi.ptszName = _T("Remove thumb");
mi.pszService = sModule "/RemoveThumb";
- hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ hMenuItemRemove = Menu_AddContactMenuItem(&mi);
// Hide all thumbs main menu item
hMainHideAllThumbs = CreateServiceFunction( sModule "/MainHideAllThumbs", OnMainMenu_HideAll );
@@ -1091,7 +1091,7 @@ static void LoadMenus() mi.hIcon = LoadIcon( hInst, MAKEINTRESOURCE( fcOpt.bHideAll ? IDI_SHOW : IDI_HIDE ) );
mi.ptszName = fcOpt.bHideAll ? _T("Show all thumbs") : _T("Hide all thumbs");
mi.pszService = sModule "/MainHideAllThumbs";
- hMainMenuItemHideAll = (HANDLE)CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddMainMenuItem(&mi);
if (ServiceExists(MS_HOTKEY_REGISTER)) {
HOTKEYDESC hkd = {0};
diff --git a/plugins/Folders/folders.cpp b/plugins/Folders/folders.cpp index 7967aae009..c7e51d486f 100644 --- a/plugins/Folders/folders.cpp +++ b/plugins/Folders/folders.cpp @@ -194,7 +194,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mi.hIcon=0;
mi.pszName=Translate("Test folders");
mi.pszService=MS_FOLDERS_TEST_PLUGIN;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
#endif
#if _MSC_VER >= 1300
Log("%s", "Hooking events ...");
diff --git a/plugins/Gender/commonheaders.h b/plugins/Gender/commonheaders.h index dd81cada93..e2add20d25 100644 --- a/plugins/Gender/commonheaders.h +++ b/plugins/Gender/commonheaders.h @@ -26,6 +26,7 @@ #ifndef COMMHEADERS_H
#define COMMHEADERS_H
+#define _CRT_SECURE_NO_WARNINGS
#define MIRANDA_VER 0x0A00
#include <stdio.h> //needed by m_utils.h
diff --git a/plugins/Gender/main.cpp b/plugins/Gender/main.cpp index fb66488c48..a95d5593c9 100644 --- a/plugins/Gender/main.cpp +++ b/plugins/Gender/main.cpp @@ -315,7 +315,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) // Adding menu items, submenu even if clist supports that
if (bContactMenuItems)
{
- if(ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM))
+ if(ServiceExists(MS_CLIST_MENUBUILDSUBGROUP))
{
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(CLISTMENUITEM);
@@ -325,7 +325,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) mi.position = 203;
mi.ptszName = LPGENT("Set Gender");
mi.pszService = NULL;
- hContactMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ hContactMenu = Menu_AddContactMenuItem(&mi);
mi.flags = CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.position = 1001;
@@ -334,46 +334,42 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) mi.ptszName = LPGENT("Male");
mi.icolibItem = g_hIconMale;
mi.pszService = "Gender/MenuItemSetMale";
- hContactMenuMale = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ hContactMenuMale = Menu_AddContactMenuItem(&mi);
mi.ptszName = LPGENT("Female");
mi.icolibItem = g_hIconFemale;
mi.pszService = "Gender/MenuItemSetFemale";
- hContactMenuFemale = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ hContactMenuFemale = Menu_AddContactMenuItem(&mi);
mi.ptszName = LPGENT("Undefined");
mi.hIcon = NULL;
mi.pszService = "Gender/MenuItemSetUndef";
- hContactMenuNotDef = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ hContactMenuNotDef = Menu_AddContactMenuItem(&mi);
}
else
{
- CLISTMENUITEM mimale = {0};
- mimale.cbSize = sizeof(CLISTMENUITEM);
- mimale.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
- mimale.position = 1001;
- mimale.ptszName = LPGENT("Set Male");
- mimale.icolibItem = g_hIconMale;
- mimale.pszService = "Gender/MenuItemSetMale";
- hContactMenuMale = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mimale);
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(CLISTMENUITEM);
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
+ mi.position = 1001;
+ mi.ptszName = LPGENT("Set Male");
+ mi.icolibItem = g_hIconMale;
+ mi.pszService = "Gender/MenuItemSetMale";
+ hContactMenuMale = Menu_AddContactMenuItem(&mi);
- CLISTMENUITEM mifemale = {0};
- mifemale.cbSize = sizeof(CLISTMENUITEM);
- mifemale.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
- mifemale.position = 1002;
- mifemale.ptszName = LPGENT("Set Female");
- mifemale.icolibItem = g_hIconFemale;
- mifemale.pszService = "Gender/MenuItemSetFemale";
- hContactMenuFemale = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mifemale);
+ mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
+ mi.position = 1002;
+ mi.ptszName = LPGENT("Set Female");
+ mi.icolibItem = g_hIconFemale;
+ mi.pszService = "Gender/MenuItemSetFemale";
+ hContactMenuFemale = Menu_AddContactMenuItem(&mi);
- CLISTMENUITEM miundef = {0};
- miundef.cbSize = sizeof(CLISTMENUITEM);
- miundef.flags = CMIF_TCHAR;
- miundef.position = 1003;
- miundef.ptszName = LPGENT("Set Undefined");
- miundef.pszService = "Gender/MenuItemSetUndef";
- miundef.hIcon = NULL;
- hContactMenuNotDef = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &miundef);
+ mi.flags = CMIF_TCHAR;
+ mi.position = 1003;
+ mi.ptszName = LPGENT("Set Undefined");
+ mi.pszService = "Gender/MenuItemSetUndef";
+ mi.hIcon = NULL;
+ hContactMenuNotDef = Menu_AddContactMenuItem(&mi);
}
}
diff --git a/plugins/HistoryLinkListPlus/linklist.c b/plugins/HistoryLinkListPlus/linklist.c index f41ce4de97..d6e3462d7f 100644 --- a/plugins/HistoryLinkListPlus/linklist.c +++ b/plugins/HistoryLinkListPlus/linklist.c @@ -120,7 +120,7 @@ int __declspec(dllexport) Load(PLUGINLINK *link) linklistmenuitem.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
linklistmenuitem.ptszName = LPGENT("&Create Linklist");
linklistmenuitem.pszService = "Linklist/MenuCommand";
- CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&linklistmenuitem);
+ Menu_AddContactMenuItem(&linklistmenuitem);
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
diff --git a/plugins/Import/main.c b/plugins/Import/main.c index 6777702db0..36589b486e 100644 --- a/plugins/Import/main.c +++ b/plugins/Import/main.c @@ -145,7 +145,7 @@ int __declspec(dllexport) Load(PLUGINLINK *link) mi.pszName = LPGEN("&Import...");
mi.position = 500050000;
mi.pszService = IMPORT_SERVICE;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
}
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
hHookOnExit = HookEvent(ME_SYSTEM_OKTOEXIT, OnExit);
diff --git a/plugins/LangMan/main.cpp b/plugins/LangMan/main.cpp index cc023a91fa..a1e9b1bd3f 100644 --- a/plugins/LangMan/main.cpp +++ b/plugins/LangMan/main.cpp @@ -143,7 +143,7 @@ __declspec(dllexport) int Load(PLUGINLINK *link) mi.icolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RELOAD));
mi.pszName = LPGEN("Reload langpack");
mi.pszService = MS_LANGPACK_RELOAD;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
/* installation */
InstallFile(_T("LangMan-Readme.txt"), _T("Docs\\"));
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp index f5fbfd6d20..0dfb23d68b 100644 --- a/plugins/ListeningTo/listeningto.cpp +++ b/plugins/ListeningTo/listeningto.cpp @@ -60,7 +60,7 @@ static std::vector<HANDLE> hHooks; static std::vector<HANDLE> hServices;
static HANDLE hEnableStateChangedEvent;
HANDLE hExtraIcon, hIcon1, hIcon2;
-static HANDLE hMainMenuGroup = NULL;
+static HGENMENU hMainMenuGroup = NULL;
static HANDLE hListeningInfoChangedEvent = NULL;
static HANDLE hTTB = NULL;
@@ -237,7 +237,7 @@ void RebuildMenu() | (ListeningToEnabled(info->proto, TRUE) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
- info->hMenu = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ info->hMenu = Menu_AddMainMenuItem(&mi);
}
UpdateGlobalStatusMenus();
@@ -367,12 +367,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.pszName = "Listening to";
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
mi.icolibItem = hIcon1;
-
- hMainMenuGroup = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &mi);
+ hMainMenuGroup = Menu_AddMainMenuItem(&mi);
IcoLib_ReleaseIcon(mi.hIcon);
- mi.pszPopupName = (char *) hMainMenuGroup;
+ mi.hParentMenu = hMainMenuGroup;
mi.popupPosition = 500080000;
mi.position = 0;
mi.pszService = MS_LISTENINGTO_MAINMENU;
@@ -384,7 +383,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) | (ListeningToEnabled(NULL, TRUE) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
proto_itens.resize(1);
- proto_itens[0].hMenu = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ proto_itens[0].hMenu = Menu_AddMainMenuItem(&mi);
proto_itens[0].proto[0] = 0;
proto_itens[0].account[0] = 0;
proto_itens[0].old_xstatus = 0;
diff --git a/plugins/MenuItemEx/main.c b/plugins/MenuItemEx/main.c index 6bce1486b3..537d277262 100644 --- a/plugins/MenuItemEx/main.c +++ b/plugins/MenuItemEx/main.c @@ -39,7 +39,7 @@ struct { TCHAR *fullName;
char flag;
}
-static const statusMsg[]={
+static const statusMsg[] = {
{ "CList", "StatusMsg", LPGENT("Status message"), 1 },
{ 0, "XStatusName", LPGENT("XStatus title"), 4 },
{ 0, "XStatusMsg", LPGENT("XStatus message"), 2 },
@@ -124,9 +124,9 @@ int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBV {
DBCONTACTGETSETTING cgs;
- cgs.szModule=szModule;
- cgs.szSetting=szSetting;
- cgs.pValue=dbv;
+ cgs.szModule = szModule;
+ cgs.szSetting = szSetting;
+ cgs.pValue = dbv;
dbv->type = 0;
return CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
@@ -290,7 +290,7 @@ BOOL DirectoryExists(HANDLE hContact) char path[MAX_PATH];
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, (WPARAM)hContact, (LPARAM)&path);
attr = GetFileAttributesA(path);
- return (attr!=-1) && (attr&FILE_ATTRIBUTE_DIRECTORY);
+ return (attr != -1) && (attr&FILE_ATTRIBUTE_DIRECTORY);
}
void CopyToClipboard(HWND hwnd,LPSTR pszMsg, LPTSTR ptszMsg)
@@ -360,14 +360,14 @@ void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID) if ( uID == (LPSTR)CALLSERVICE_NOTFOUND )
uID = NULL;
- *szID='\0';
+ *szID = '\0';
- if ( uID && DBGetContactSetting(hContact, szProto, uID ,&dbv_uniqueid)==0 ) {
- if (dbv_uniqueid.type ==DBVT_DWORD)
+ if ( uID && DBGetContactSetting(hContact, szProto, uID ,&dbv_uniqueid) == 0 ) {
+ if (dbv_uniqueid.type == DBVT_DWORD)
wsprintfA(szID, "%u", dbv_uniqueid.dVal);
- else if (dbv_uniqueid.type ==DBVT_WORD)
+ else if (dbv_uniqueid.type == DBVT_WORD)
wsprintfA(szID, "%u", dbv_uniqueid.wVal);
- else if (dbv_uniqueid.type ==DBVT_BLOB)
+ else if (dbv_uniqueid.type == DBVT_BLOB)
wsprintfA(szID, "%s", dbv_uniqueid.cpbVal);
else
wsprintfA(szID, "%s", dbv_uniqueid.pszVal);
@@ -380,7 +380,7 @@ int StatusMsgExists(HANDLE hContact) {
LPSTR module,msg;
char par[32];
- BOOL ret=0;
+ BOOL ret = 0;
int i;
module = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -413,13 +413,13 @@ BOOL IPExists(HANDLE hContact) mIP = DBGetContactSettingDword(hContact, szProto, "IP", 0);
rIP = DBGetContactSettingDword(hContact, szProto, "RealIP", 0);
- return (mIP!=0 || rIP!=0);
+ return (mIP != 0 || rIP != 0);
}
BOOL MirVerExists(HANDLE hContact)
{
LPSTR szProto, msg;
- BOOL ret=0;
+ BOOL ret = 0;
szProto = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (!szProto) return 0;
@@ -435,8 +435,8 @@ BOOL MirVerExists(HANDLE hContact) void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP)
{
- char szmIP[64]={0};
- char szrIP[64]={0};
+ char szmIP[64] = {0};
+ char szrIP[64] = {0};
DWORD mIP = DBGetContactSettingDword(hContact, szProto, "IP", 0);
DWORD rIP = DBGetContactSettingDword(hContact, szProto, "RealIP", 0);
if ( mIP ) wsprintfA(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP>>24,(mIP>>16)&0xFF,(mIP>>8)&0xFF,mIP&0xFF);
@@ -492,7 +492,7 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) OldAuthReqEditProc = SetWindowLongPtr(GetDlgItem(hdlg, IDC_REASON), GWLP_WNDPROC, (LONG_PTR)AuthReqEditSubclassProc);
SendDlgItemMessage(hdlg, IDC_REASON, EM_LIMITTEXT, (WPARAM)255, 0);
SetDlgItemText(hdlg, IDC_REASON, TranslateT("Please authorize me to add you to my contact list."));
- hcontact=(HANDLE)lparam;
+ hcontact = (HANDLE)lparam;
break;
case WM_COMMAND:
@@ -530,15 +530,15 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) BOOL isVisSupport(HANDLE hContact)
{
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if(szProto==NULL) return 0;
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ if(szProto == NULL) return 0;
return CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0)&PF1_INVISLIST;
}
BOOL isInvSupport(HANDLE hContact)
{
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if(szProto==NULL) return 0;
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ if(szProto == NULL) return 0;
return CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0)&PF1_VISLIST;
}
@@ -559,9 +559,9 @@ INT_PTR onSendAuthRequest(WPARAM wparam,LPARAM lparam) DWORD flags;
char *szProto;
- szProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0);
+ szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0);
- flags=CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_4,0);
+ flags = CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_4,0);
if (flags&PF4_NOCUSTOMAUTH)
CallContactService((HANDLE)wparam,PSS_AUTHREQUEST,0, (LPARAM)"");
else
@@ -579,14 +579,14 @@ INT_PTR onSendAdded(WPARAM wparam,LPARAM lparam) // set the invisible-flag in db
INT_PTR onSetInvis(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(DBGetContactSettingWord((HANDLE)wparam,(const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0),"ApparentMode",0)==ID_STATUS_OFFLINE)?0:ID_STATUS_OFFLINE,0);
+ CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(DBGetContactSettingWord((HANDLE)wparam,(const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0),"ApparentMode",0) == ID_STATUS_OFFLINE)?0:ID_STATUS_OFFLINE,0);
return 0;
}
// set visible-flag in db
INT_PTR onSetVis(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(DBGetContactSettingWord((HANDLE)wparam,(const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0),"ApparentMode",0)==ID_STATUS_ONLINE)?0:ID_STATUS_ONLINE,0);
+ CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(DBGetContactSettingWord((HANDLE)wparam,(const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0),"ApparentMode",0) == ID_STATUS_ONLINE)?0:ID_STATUS_ONLINE,0);
return 0;
}
@@ -599,7 +599,7 @@ INT_PTR onHide(WPARAM wparam,LPARAM lparam) void ShowItem(CLISTMENUITEM *cli, HANDLE hmenu)
{
- cli->flags=CMIM_FLAGS | CMIF_TCHAR;
+ cli->flags = CMIM_FLAGS | CMIF_TCHAR;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenu,(LPARAM)cli);
}
@@ -682,7 +682,7 @@ void ModifyCopyID(CLISTMENUITEM *cli, HANDLE hContact, BOOL bShowID, BOOL bTrimI cli->ptszName = _T("Copy ID");
}
else {
- cli->flags=CMIM_FLAGS|CMIF_HIDDEN;
+ cli->flags = CMIM_FLAGS|CMIF_HIDDEN;
}
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenuCopyID,(LPARAM)cli);
DestroyIcon(hIconCID);
@@ -737,7 +737,7 @@ void ModifyCopyMirVer(CLISTMENUITEM *cli,HANDLE hContact) {
LPSTR msg;
cli->flags|=CMIM_ICON;
- cli->hIcon=NULL;
+ cli->hIcon = NULL;
if(ServiceExists(MS_FP_GETCLIENTICON)) {
msg = getMirVer(hContact);
if(msg) {
@@ -793,12 +793,12 @@ INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam) char par[32];
TCHAR buffer[2048];
int i;
- DWORD flags=DBGetContactSettingDword(NULL,VISPLG,"flags",vf_default);
+ DWORD flags = DBGetContactSettingDword(NULL,VISPLG,"flags",vf_default);
module = (LPSTR) CallService(MS_PROTO_GETCONTACTBASEPROTO, wparam, 0);
if (!module) return 0;
- buffer[0]=0;
+ buffer[0] = 0;
for(i = 0; i < SIZEOF(statusMsg); i++) {
if (statusMsg[i].flag & 8)
mir_snprintf(par, SIZEOF(par), "%s/%s", module, statusMsg[i].name);
@@ -929,27 +929,27 @@ INT_PTR onIgnore(WPARAM wparam,LPARAM lparam) static HANDLE AddSubmenuItem(HANDLE hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, int param)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.hParentMenu = hRoot;
- mi.pszPopupName = (char*)hRoot; // for Miranda 0.7
- mi.popupPosition = param;
- mi.position = pos;
- mi.ptszName = name;
- mi.hIcon = icon;
- mi.flags = CMIF_TCHAR | CMIF_CHILDPOPUP;
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof(mi);
+ mi.hParentMenu = hRoot;
+ mi.pszPopupName = (char*)hRoot; // for Miranda 0.7
+ mi.popupPosition = param;
+ mi.position = pos;
+ mi.ptszName = name;
+ mi.hIcon = icon;
+ mi.flags = CMIF_TCHAR | CMIF_CHILDPOPUP;
if (flag)
mi.flags |= flag;
- mi.pszService = service;
- return ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, param, (LPARAM)&mi);
+ mi.pszService = service;
+ return Menu_AddContactMenuItem(&mi);
}
static void ModifySubmenuItem(HANDLE hItem, TCHAR* name, int checked, int hidden)
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.ptszName = name;
- mi.flags = CMIM_FLAGS | CMIF_TCHAR;
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof(mi);
+ mi.ptszName = name;
+ mi.flags = CMIM_FLAGS | CMIF_TCHAR;
if ( checked )
mi.flags |= CMIF_CHECKED;
if ( hidden )
@@ -960,8 +960,8 @@ static void ModifySubmenuItem(HANDLE hItem, TCHAR* name, int checked, int hidden // called when the contact-menu is built
int BuildMenu(WPARAM wparam,LPARAM lparam)
{
- CLISTMENUITEM miAV={0},miNV,miHFL,miIGN,miPROTO,miADD,miREQ,miCID,miRECV,miSTAT,miCIP,miCMV;
- DWORD flags=DBGetContactSettingDword(NULL,VISPLG,"flags",vf_default);
+ CLISTMENUITEM miAV = {0},miNV,miHFL,miIGN,miPROTO,miADD,miREQ,miCID,miRECV,miSTAT,miCIP,miCMV;
+ DWORD flags = DBGetContactSettingDword(NULL,VISPLG,"flags",vf_default);
int i = 0, j = 0, check = 0, all = 0, hide = 0;
BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED;
PROTOACCOUNT* pa;
@@ -972,11 +972,11 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) bIsOnline = isProtoOnline(pszProto);
- miAV.cbSize=sizeof(CLISTMENUITEM);
- miAV.flags=CMIM_FLAGS | CMIF_TCHAR;
- miAV.hIcon=NULL;
- miAV.pszContactOwner=NULL;
- miNV=miHFL=miIGN=miPROTO=miADD=miREQ=miCID=miRECV=miSTAT=miCIP=miCMV=miAV;
+ miAV.cbSize = sizeof(CLISTMENUITEM);
+ miAV.flags = CMIM_FLAGS | CMIF_TCHAR;
+ miAV.hIcon = NULL;
+ miAV.pszContactOwner = NULL;
+ miNV = miHFL = miIGN = miPROTO = miADD = miREQ = miCID = miRECV = miSTAT = miCIP = miCMV = miAV;
if(bShowAll || flags&VF_VS) {
ShowItem(&miAV,hmenuVis);
@@ -1078,10 +1078,10 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) if(bShowAll || (flags&VF_VS))
{
- int apparent=DBGetContactSettingWord((HANDLE)wparam,(const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0),"ApparentMode",0);
- if(isVisSupport((HANDLE)wparam)) ModifyVisibleSet(&miAV,apparent==ID_STATUS_ONLINE,flags&VF_SAI);
+ int apparent = DBGetContactSettingWord((HANDLE)wparam,(const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wparam,0),"ApparentMode",0);
+ if(isVisSupport((HANDLE)wparam)) ModifyVisibleSet(&miAV,apparent == ID_STATUS_ONLINE,flags&VF_SAI);
else HideItem(&miAV,hmenuVis);
- if(isInvSupport((HANDLE)wparam)) ModifyInvisSet(&miNV,apparent==ID_STATUS_OFFLINE,flags&VF_SAI);
+ if(isInvSupport((HANDLE)wparam)) ModifyInvisSet(&miNV,apparent == ID_STATUS_OFFLINE,flags&VF_SAI);
else HideItem(&miAV,hmenuOff);
}
return 0;
@@ -1117,7 +1117,7 @@ int EnumProtoSubmenu(WPARAM wparam, LPARAM lparam) // Tabsrmm toolbar support
static int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
- CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam;
+ CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
if (!strcmp(cbcd->pszModule, MODULENAME) && cbcd->dwButtonId == 0)
onRecvFiles(wParam, 0);
@@ -1229,8 +1229,8 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) IconsInit();
- bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT)!=0;
- bMir_08 = ServiceExists(MS_PROTO_GETACCOUNT)!=0;
+ bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT) != 0;
+ bMir_08 = ServiceExists(MS_PROTO_GETACCOUNT) != 0;
hServices[0] = CreateServiceFunction(MS_SETINVIS,onSetInvis);
hServices[1] = CreateServiceFunction(MS_SETVIS,onSetVis);
@@ -1246,40 +1246,39 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) hServices[10] = CreateServiceFunction(MS_COPYIP,onCopyIP);
hServices[11] = CreateServiceFunction(MS_COPYMIRVER,onCopyMirVer);
- mi.cbSize=sizeof(CLISTMENUITEM);
+ mi.cbSize = sizeof(CLISTMENUITEM);
mi.flags = CMIF_TCHAR;
- mi.hIcon=NULL;
- mi.pszContactOwner=NULL;
+ mi.hIcon = NULL;
+ mi.pszContactOwner = NULL;
- mi.position=120000;
- mi.ptszName=LPGENT("Always visible");
- mi.pszService=MS_SETVIS;
- hmenuVis=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.position = 120000;
+ mi.ptszName = LPGENT("Always visible");
+ mi.pszService = MS_SETVIS;
+ hmenuVis = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Never visible");
- mi.pszService=MS_SETINVIS;
- hmenuOff=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Never visible");
+ mi.pszService = MS_SETINVIS;
+ hmenuOff = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=NULL;
- mi.pszService=MS_HIDE;
- hmenuHide=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = NULL;
+ mi.pszService = MS_HIDE;
+ hmenuHide = Menu_AddContactMenuItem(&mi);
mi.position++;
mi.pszPopupName = (char*)-1; // for Miranda 0.7
- mi.ptszName=LPGENT("Ignore");
+ mi.ptszName = LPGENT("Ignore");
mi.pszService = 0;
mi.flags |= CMIF_ROOTHANDLE;
- mi.hIcon=(HICON)CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_ignore" );
- hmenuIgnore=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.hIcon = (HICON)CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_ignore" );
+ hmenuIgnore = Menu_AddContactMenuItem(&mi);
hIgnoreItem[0] = AddSubmenuItem(hmenuIgnore, ii[0].name, LoadSkinnedIcon(ii[0].icon), 0, MS_IGNORE, pos, ii[0].type );
pos += 100000; // insert separator
for (i = 1; i < SIZEOF(ii); i++)
- {
hIgnoreItem[i] = AddSubmenuItem(hmenuIgnore, ii[i].name, LoadSkinnedIcon(ii[i].icon), 0, MS_IGNORE, pos++, ii[i].type );
- }
+
pos += 100000; // insert separator
ood.cbSize = sizeof(ood);
ood.pszGroup = "Events";
@@ -1287,13 +1286,12 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) AddSubmenuItem(hmenuIgnore, LPGENT("Open ignore settings"), (HICON)CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_ignore"), 0, MS_OPT_OPENOPTIONS, pos, (int)&ood );
mi.pszPopupName = 0;
- if (bMir_08)
- {
+ if (bMir_08) {
mi.position++;
- mi.ptszName=LPGENT("Copy to Account");
- mi.pszService=MS_PROTO;
- mi.hIcon=( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_protocol");
- hmenuProto=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Copy to Account");
+ mi.pszService = MS_PROTO;
+ mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_protocol");
+ hmenuProto = Menu_AddContactMenuItem(&mi);
EnumProtoSubmenu(0, 0);
}
@@ -1301,43 +1299,43 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) mi.flags = CMIF_TCHAR;
mi.position++;
- mi.ptszName=LPGENT("Send 'You were added'");
- mi.pszService=MS_ADDED;
- mi.hIcon=( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_added");
- hmenuAdded=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Send 'You were added'");
+ mi.pszService = MS_ADDED;
+ mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_added");
+ hmenuAdded = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Request authorization");
- mi.pszService=MS_AUTHREQ;
- mi.hIcon=( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_authorization");
- hmenuAuthReq=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Request authorization");
+ mi.pszService = MS_AUTHREQ;
+ mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_authorization");
+ hmenuAuthReq = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Copy ID");
- mi.pszService=MS_COPYID;
- hmenuCopyID=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Copy ID");
+ mi.pszService = MS_COPYID;
+ hmenuCopyID = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Browse Received Files");
- mi.pszService=MS_RECVFILES;
- mi.hIcon=( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_recfiles");
- hmenuRecvFiles=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Browse Received Files");
+ mi.pszService = MS_RECVFILES;
+ mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_recfiles");
+ hmenuRecvFiles = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Copy Status Message");
- mi.pszService=MS_STATUSMSG;
- mi.hIcon=NULL;//LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ICON5));
- hmenuStatusMsg=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Copy Status Message");
+ mi.pszService = MS_STATUSMSG;
+ mi.hIcon = NULL;//LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ICON5));
+ hmenuStatusMsg = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Copy IP");
- mi.pszService=MS_COPYIP;
- hmenuCopyIP=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Copy IP");
+ mi.pszService = MS_COPYIP;
+ hmenuCopyIP = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.ptszName=LPGENT("Copy MirVer");
- mi.pszService=MS_COPYMIRVER;
- hmenuCopyMirVer=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ mi.ptszName = LPGENT("Copy MirVer");
+ mi.pszService = MS_COPYMIRVER;
+ hmenuCopyMirVer = Menu_AddContactMenuItem(&mi);
hIcon[0] = ( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_copymver");
hIcon[1] = ( HICON )CallService( MS_SKIN2_GETICON, 0, (LPARAM)"miex_vis");
@@ -1376,7 +1374,7 @@ __declspec(dllexport) MUUID* MirandaPluginInterfaces(void) { __declspec(dllexport)int Load(PLUGINLINK *link)
{
- pluginLink=link;
+ pluginLink = link;
mir_getMMI( &mmi );
mir_getLP(&pluginInfoEx);
hHooks[7] = HookEvent(ME_SYSTEM_MODULESLOADED,PluginInit);
@@ -1404,6 +1402,6 @@ __declspec(dllexport)int Unload(void) BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved)
{
- hinstance=hinst;
+ hinstance = hinst;
return 1;
}
diff --git a/plugins/MetaContacts/addto.c b/plugins/MetaContacts/addto.c index 6b9721d504..b92e97b978 100644 --- a/plugins/MetaContacts/addto.c +++ b/plugins/MetaContacts/addto.c @@ -73,16 +73,16 @@ int FillList(HWND list, BOOL sort) // get contact display name from clist
char *szCDN = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hMetaUser, 0);
- if(os_unicode_enabled) {
+ if (os_unicode_enabled) {
wchar_t *swzCDN = (wchar_t *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hMetaUser, GCDNF_UNICODE),
*swzContactDisplayName;
// detect if the clist provided unicode display name by comparing with non-unicode
- if(szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0) {
+ if (szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0) {
swzContactDisplayName = swzCDN;
} else {
// no? convert to unicode
- if(szCDN) {
+ if (szCDN) {
swzContactDisplayName = (wchar_t *) _alloca(sizeof(wchar_t) * (strlen(szCDN) + 1));
MultiByteToWideChar(CP_ACP, 0, (char *) szCDN, -1, swzContactDisplayName, (int)strlen((char *)szCDN) + 1);
} else {
@@ -91,15 +91,15 @@ int FillList(HWND list, BOOL sort) }
// don't insert huge strings that we have to compare with later
- if(wcslen(swzContactDisplayName) > 1023)
+ if (wcslen(swzContactDisplayName) > 1023)
swzContactDisplayName[1024] = 0;
- if(sort) {
+ if (sort) {
int j;
wchar_t buff[1024];
- for(j = 0; j < i; j++) {
+ for (j = 0; j < i; j++) {
SendMessageW(list, LB_GETTEXT, j, (LPARAM)buff);
- if(wcscmp(buff, swzContactDisplayName) > 0) break;
+ if (wcscmp(buff, swzContactDisplayName) > 0) break;
}
index = SendMessageW(list, LB_INSERTSTRING, (WPARAM)j, (LPARAM)swzContactDisplayName);
} else {
@@ -107,15 +107,15 @@ int FillList(HWND list, BOOL sort) }
} else {
// don't insert huge strings that we have to compare with later
- if(strlen(szCDN) > 1023)
+ if (strlen(szCDN) > 1023)
szCDN[1024] = 0;
- if(sort) {
+ if (sort) {
int j;
char buff[1024];
- for(j = 0; j < i; j++) {
+ for (j = 0; j < i; j++) {
SendMessage(list, LB_GETTEXT, j, (LPARAM)buff);
- if(strcmp(buff, szCDN) > 0) break;
+ if (strcmp(buff, szCDN) > 0) break;
}
index = SendMessage(list, LB_INSERTSTRING, (WPARAM)j, (LPARAM)szCDN);
} else {
@@ -172,14 +172,14 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP TranslateDialogDefault( hwndDlg );
- if(DBGetContactSettingDword((HANDLE)lParam,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1)
+ if (DBGetContactSettingDword((HANDLE)lParam,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1)
{
MessageBox(hwndDlg,Translate("This contact is a MetaContact.\nYou can't add a MetaContact to another MetaContact.\n\nPlease choose another."),
Translate("MetaContact Conflict"),MB_ICONERROR);
DestroyWindow(hwndDlg);
return TRUE;
}
- if(DBGetContactSettingDword((HANDLE)lParam,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1)
+ if (DBGetContactSettingDword((HANDLE)lParam,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1)
{
MessageBox(hwndDlg,Translate("This contact is already associated to a MetaContact.\nYou cannot add a contact to multiple MetaContacts."),
Translate("Multiple MetaContacts"),MB_ICONERROR);
@@ -195,9 +195,9 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // Initialize the graphical part
CheckDlgButton(hwndDlg,IDC_ONLYAVAIL,BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
- if(BuildList(GetDlgItem(hwndDlg,IDC_METALIST), FALSE)<=0)
+ if (BuildList(GetDlgItem(hwndDlg,IDC_METALIST), FALSE)<=0)
{
- if(MessageBox(hwndDlg,Translate("Either there is no MetaContact in the database (in this case you should first convert a contact into one)\n"
+ if (MessageBox(hwndDlg,Translate("Either there is no MetaContact in the database (in this case you should first convert a contact into one)\n"
"or there is none that can host this contact.\n"
"Another solution could be to convert this contact into a new MetaContact.\n\nConvert this contact into a new MetaContact?"),
Translate("No suitable MetaContact found"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1)==IDYES)
@@ -211,17 +211,17 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // get contact display name from clist
char *szCDN = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)lParam, 0);
- if(os_unicode_enabled) {
+ if (os_unicode_enabled) {
wchar_t *swzCDN = (wchar_t *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)lParam, GCDNF_UNICODE),
*swzContactDisplayName;
wchar_t buf[256];
// detect if the clist provided unicode display name by comparing with non-unicode
- if(szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0) {
+ if (szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0) {
swzContactDisplayName = swzCDN;
} else {
// no? convert to unicode
- if(szCDN) {
+ if (szCDN) {
swzContactDisplayName = (wchar_t *) _alloca(sizeof(wchar_t) * (strlen(szCDN) + 1));
MultiByteToWideChar(CP_ACP, 0, (char *) szCDN, -1, swzContactDisplayName, (int)strlen((char *)szCDN) + 1);
} else {
@@ -249,7 +249,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
}
case WM_COMMAND:
- if(HIWORD(wParam)!=BN_CLICKED)
+ if (HIWORD(wParam)!=BN_CLICKED)
break; // Only clicks of buttons are relevant, let other COMMANDs through
switch(LOWORD(wParam))
{
@@ -275,9 +275,9 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_CHK_SRT:
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE) ^ LBS_SORT);
- if(BuildList(GetDlgItem(hwndDlg,IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE)<=0)
+ if (BuildList(GetDlgItem(hwndDlg,IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE)<=0)
{
- if(MessageBox(hwndDlg,Translate("Either there is no MetaContact in the database (in this case you should first convert a contact into one)\n"
+ if (MessageBox(hwndDlg,Translate("Either there is no MetaContact in the database (in this case you should first convert a contact into one)\n"
"or there is none that can host this contact.\n"
"Another solution could be to convert this contact into a new MetaContact.\n\nConvert this contact into a new MetaContact?"),
Translate("No suitable MetaContact found"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1)==IDYES)
diff --git a/plugins/MetaContacts/edit.c b/plugins/MetaContacts/edit.c index d5c422d71c..bc4d94ba8a 100644 --- a/plugins/MetaContacts/edit.c +++ b/plugins/MetaContacts/edit.c @@ -63,7 +63,7 @@ void FillContactList(HWND hWndDlg, CHANGES *chg) { LvItemW.mask=LVIF_TEXT; // Text Style
LvItemW.cchTextMax = 256; // Max size of test
- for(i = 0; i < chg->num_contacts; i++) {
+ for (i = 0; i < chg->num_contacts; i++) {
LvItem.iItem = i;
LvItemW.iItem = i;
@@ -71,18 +71,18 @@ void FillContactList(HWND hWndDlg, CHANGES *chg) { char *szCDN = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)chg->hContact[i], 0);
- if(os_unicode_enabled) {
+ if (os_unicode_enabled) {
wchar_t *swzCDN = (wchar_t *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)chg->hContact[i], GCDNF_UNICODE),
*swzContactDisplayName;
LvItemW.iSubItem = 0; // clist display name
// detect if the clist provided unicode display name by comparing with non-unicode
- if(szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0 && wcslen(swzCDN) >= strlen(szCDN)) {
+ if (szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0 && wcslen(swzCDN) >= strlen(szCDN)) {
swzContactDisplayName = swzCDN;
} else {
// no? convert to unicode
- if(szCDN) {
+ if (szCDN) {
swzContactDisplayName = (wchar_t *) _alloca(sizeof(wchar_t) * (strlen(szCDN) + 1));
MultiByteToWideChar(CP_ACP, 0, (char *) szCDN, -1, swzContactDisplayName, (int)strlen((char *)szCDN) + 1);
} else {
@@ -104,7 +104,7 @@ void FillContactList(HWND hWndDlg, CHANGES *chg) { LvItem.iSubItem = 1; // id
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)chg->hContact[i], 0);
- if(proto) {
+ if (proto) {
field = (char *)CallProtoService(proto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
DBGetContactSetting(chg->hContact[i],proto,field,&dbv);
@@ -176,31 +176,31 @@ void ApplyChanges(CHANGES *chg) int i;
// remove removed contacts
- for(i = 0; i < chg->num_deleted; i++) {
+ for (i = 0; i < chg->num_deleted; i++) {
Meta_Delete((WPARAM)chg->hDeletedContacts[i], 0);
- if(chg->hDeletedContacts[i] == chg->hDefaultContact)
+ if (chg->hDeletedContacts[i] == chg->hDefaultContact)
chg->hDefaultContact = 0;
- if(chg->hDeletedContacts[i] == chg->hOfflineContact)
+ if (chg->hDeletedContacts[i] == chg->hOfflineContact)
chg->hOfflineContact = 0;
}
// set contact positions
- for(i = 0; i < chg->num_contacts; i++) {
- if(Meta_GetContactNumber(chg->hContact[i]) != i)
+ for (i = 0; i < chg->num_contacts; i++) {
+ if (Meta_GetContactNumber(chg->hContact[i]) != i)
Meta_SwapContacts(chg->hMeta, Meta_GetContactNumber(chg->hContact[i]), i);
}
NotifyEventHooks(hSubcontactsChanged, (WPARAM)chg->hMeta, (LPARAM)chg->hDefaultContact);
// set default
- if(chg->hDefaultContact)
+ if (chg->hDefaultContact)
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "Default", Meta_GetContactNumber(chg->hDefaultContact));
else
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "Default", 0);
NotifyEventHooks(hEventDefaultChanged, (WPARAM)chg->hMeta, (LPARAM)chg->hDefaultContact);
// set offline
- if(chg->hOfflineContact)
+ if (chg->hOfflineContact)
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "OfflineSend", Meta_GetContactNumber(chg->hOfflineContact));
else
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "OfflineSend", (DWORD)-1);
@@ -214,7 +214,7 @@ void ApplyChanges(CHANGES *chg) // fix avatar
most_online = Meta_GetMostOnlineSupporting(chg->hMeta, PFLAGNUM_4, PF4_AVATARS);
- if(most_online) {
+ if (most_online) {
PROTO_AVATAR_INFORMATION AI;
AI.cbSize = sizeof(AI);
@@ -226,7 +226,7 @@ void ApplyChanges(CHANGES *chg) DBWriteContactSettingString(chg->hMeta, "ContactPhoto", "File",AI.filename);
}
- if(MetaAPI_GetForceState((WPARAM)chg->hMeta, 0) != chg->force_default)
+ if (MetaAPI_GetForceState((WPARAM)chg->hMeta, 0) != chg->force_default)
MetaAPI_ForceDefault((WPARAM)chg->hMeta, 0);
}
@@ -253,7 +253,7 @@ LRESULT ProcessCustomDraw (LPARAM lParam) lplvcd->clrTextBk = RGB(255,255,255);
}
*/
- if(changes.hContact[(int)lplvcd->nmcd.dwItemSpec] == changes.hDefaultContact) {
+ if (changes.hContact[(int)lplvcd->nmcd.dwItemSpec] == changes.hDefaultContact) {
lplvcd->clrText = RGB(255, 0, 0);
}
return CDRF_NEWFONT;
@@ -346,7 +346,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR changes.num_deleted = 0;
changes.hDefaultContact = Meta_GetContactHandle((HANDLE)lParam, default_contact_number);
changes.hOfflineContact = Meta_GetContactHandle((HANDLE)lParam, offline_contact_number);
- for(i = 0; i < nb_contacts; i++)
+ for (i = 0; i < nb_contacts; i++)
changes.hContact[i] = Meta_GetContactHandle((HANDLE)lParam, i);
changes.force_default = MetaAPI_GetForceState((WPARAM)lParam, 0);
@@ -361,16 +361,16 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR {
char *szCDN = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)lParam, 0);
- if(os_unicode_enabled) {
+ if (os_unicode_enabled) {
wchar_t *swzCDN = (wchar_t *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)lParam, GCDNF_UNICODE),
*swzContactDisplayName;
// detect if the clist provided unicode display name by comparing with non-unicode
- if(szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0 && wcslen(swzCDN) >= strlen(szCDN)) {
+ if (szCDN && swzCDN && strncmp(szCDN, (char *)swzCDN, strlen(szCDN)) != 0 && wcslen(swzCDN) >= strlen(szCDN)) {
swzContactDisplayName = swzCDN;
} else {
// no? convert to unicode
- if(szCDN) {
+ if (szCDN) {
swzContactDisplayName = (wchar_t *) _alloca(sizeof(wchar_t) * (strlen(szCDN) + 1));
MultiByteToWideChar(CP_ACP, 0, (char *) szCDN, -1, swzContactDisplayName, (int)strlen((char *)szCDN) + 1);
} else {
@@ -419,9 +419,9 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR switch(LOWORD(wParam))
{
case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact.
- if(changes.num_contacts == 0) // Otherwise, delete the metacontact.
+ if (changes.num_contacts == 0) // Otherwise, delete the metacontact.
{
- if(MessageBox(hwndDlg,Translate("You are going to remove all the contacts associated with this MetaContact.\nThis will delete the MetaContact.\n\nProceed Anyway?"),
+ if (MessageBox(hwndDlg,Translate("You are going to remove all the contacts associated with this MetaContact.\nThis will delete the MetaContact.\n\nProceed Anyway?"),
Translate("Delete MetaContact?"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1)!=IDYES)
return TRUE;
else
@@ -437,11 +437,11 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow(GetDlgItem(hwndDlg,IDC_VALIDATE),FALSE);
break;
case IDOK:
- if(IsWindowEnabled(GetDlgItem(hwndDlg,IDC_VALIDATE)))
+ if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_VALIDATE)))
{ // If there are changes that could be made,
- if(changes.num_contacts == 0) // do the work that would have be done if
+ if (changes.num_contacts == 0) // do the work that would have be done if
{ // the button 'Apply' has been clicked.
- if(MessageBox(hwndDlg,Translate("You are going to remove all the contacts associated with this MetaContact.\nThis will delete the MetaContact.\n\nProceed Anyway?"),
+ if (MessageBox(hwndDlg,Translate("You are going to remove all the contacts associated with this MetaContact.\nThis will delete the MetaContact.\n\nProceed Anyway?"),
Translate("Delete MetaContact?"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1)!=IDYES)
{
return TRUE;
@@ -494,8 +494,8 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR sel=SendMessage(hwnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED|LVNI_SELECTED); // return item selected
changes.num_contacts--;
changes.hDeletedContacts[changes.num_deleted++] = changes.hContact[sel];
- if(changes.hDefaultContact == changes.hContact[sel]) {
- if(changes.num_contacts > 0) {
+ if (changes.hDefaultContact == changes.hContact[sel]) {
+ if (changes.num_contacts > 0) {
changes.hDefaultContact = changes.hContact[0];
str = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)changes.hDefaultContact, 0);
SetWindowText(GetDlgItem(hwndDlg,IDC_ED_DEFAULT),str);
@@ -506,7 +506,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
- for(i = sel; i < changes.num_contacts; i++)
+ for (i = sel; i < changes.num_contacts; i++)
changes.hContact[i] = changes.hContact[i + 1];
FillContactList(hwndDlg, &changes);
// disable buttons
diff --git a/plugins/MetaContacts/meta_api.c b/plugins/MetaContacts/meta_api.c index 6a8781f6e1..331bdb55d5 100644 --- a/plugins/MetaContacts/meta_api.c +++ b/plugins/MetaContacts/meta_api.c @@ -41,7 +41,7 @@ INT_PTR MetaAPI_GetMeta(WPARAM wParam, LPARAM lParam) { //returns a handle to the default contact, or null on failure
INT_PTR MetaAPI_GetDefault(WPARAM wParam, LPARAM lParam) {
DWORD default_contact_number = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1);
- if(default_contact_number != -1) {
+ if (default_contact_number != -1) {
return (int)Meta_GetContactHandle((HANDLE)wParam, default_contact_number);
}
return 0;
@@ -86,11 +86,11 @@ INT_PTR MetaAPI_GetContact(WPARAM wParam, LPARAM lParam) { //returns 0 on success
INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) {
DWORD num_contacts = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "NumContacts", -1);
- if(num_contacts == -1)
+ if (num_contacts == -1)
return 1;
if ((DWORD)lParam >= num_contacts || (DWORD)lParam < 0)
return 1;
- if(DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "Default", (DWORD)lParam))
+ if (DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "Default", (DWORD)lParam))
return 1;
NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, (int)lParam));
@@ -104,9 +104,9 @@ INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) { INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) {
HANDLE hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)lParam, META_PROTO, "Handle", 0);
DWORD contact_number = Meta_GetContactNumber((HANDLE)lParam);
- if(contact_number == -1 || !hMeta || hMeta != (HANDLE)wParam)
+ if (contact_number == -1 || !hMeta || hMeta != (HANDLE)wParam)
return 1;
- if(DBWriteContactSettingDword(hMeta, META_PROTO, "Default", contact_number))
+ if (DBWriteContactSettingDword(hMeta, META_PROTO, "Default", contact_number))
return 1;
NotifyEventHooks(hEventDefaultChanged, wParam, lParam);
@@ -150,7 +150,7 @@ INT_PTR MetaAPI_ForceSendContact(WPARAM wParam, LPARAM lParam) { //lParam=0
//returns 0 on success (will fail if 'force default' is in effect)
INT_PTR MetaAPI_UnforceSendContact(WPARAM wParam, LPARAM lParam) {
- if(DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", 0))
+ if (DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", 0))
return 1;
DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "ForceSend", 0);
@@ -184,17 +184,17 @@ INT_PTR MetaAPI_GetForceState(WPARAM wParam, LPARAM lParam) { if (!hMeta) return 0;
- if(DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0)) {
- if(lParam) *(DWORD *)lParam = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1);
+ if (DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0)) {
+ if (lParam) *(DWORD *)lParam = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1);
return 1;
}
hContact = (HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0);
if (!hContact) {
- if(lParam) *(DWORD *)lParam = -1;
+ if (lParam) *(DWORD *)lParam = -1;
} else {
- if(lParam) *(DWORD *)lParam = (DWORD)Meta_GetContactNumber(hContact);
+ if (lParam) *(DWORD *)lParam = (DWORD)Meta_GetContactNumber(hContact);
}
return 0;
diff --git a/plugins/MetaContacts/meta_main.c b/plugins/MetaContacts/meta_main.c index 30681a211e..dbe2f67224 100644 --- a/plugins/MetaContacts/meta_main.c +++ b/plugins/MetaContacts/meta_main.c @@ -169,7 +169,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link) os_unicode_enabled = IsUnicodeOS();
- if(ServiceExists(MS_DB_SETSETTINGRESIDENT)) { // 0.6+
+ if (ServiceExists(MS_DB_SETSETTINGRESIDENT)) { // 0.6+
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)(META_PROTO "/Status"));
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)(META_PROTO "/IdleTS"));
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)(META_PROTO "/ContactCountCheck"));
@@ -191,7 +191,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link) DBWriteContactSettingByte(hContact, META_PROTO, "ContactCountCheck", 0);
// restore any saved defaults that might have remained if miranda was closed or crashed while a convo was happening
- if(DBGetContactSettingDword(hContact, META_PROTO, "SavedDefault", (DWORD)-1) != (DWORD)-1) {
+ if (DBGetContactSettingDword(hContact, META_PROTO, "SavedDefault", (DWORD)-1) != (DWORD)-1) {
DBWriteContactSettingDword(hContact, META_PROTO, "Default", DBGetContactSettingDword(hContact, META_PROTO, "SavedDefault", 0));
DBWriteContactSettingDword(hContact, META_PROTO, "SavedDefault", (DWORD)-1);
}
@@ -212,7 +212,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link) // also verifies that subcontacts: have metacontacts, and that contact numbers are reasonable,
// that metacontacts: have the correct number of subcontacts, and have reasonable defaults
- if(Meta_SetHandles()) {
+ if (Meta_SetHandles()) {
// error - db corruption
if (!DBGetContactSettingByte(0, META_PROTO, "DisabledMessageShown", 0)) {
MessageBox(0, Translate("Error - Database corruption.\nPlugin disabled."), Translate("MetaContacts"), MB_OK | MB_ICONERROR);
@@ -255,7 +255,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link) // check protocol for jabber hack, and the proto modules must be loaded
//Meta_HideLinkedContactsAndSetHandles();
- if(ServiceExists(MS_MSG_GETWINDOWAPI)) {
+ if (ServiceExists(MS_MSG_GETWINDOWAPI)) {
message_window_api_enabled = TRUE;
}
diff --git a/plugins/MetaContacts/meta_menu.c b/plugins/MetaContacts/meta_menu.c index 37ceb1116a..6e7ad9f1c6 100644 --- a/plugins/MetaContacts/meta_menu.c +++ b/plugins/MetaContacts/meta_menu.c @@ -52,7 +52,7 @@ INT_PTR Meta_Convert(WPARAM wParam,LPARAM lParam) hMetaContact = (HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
// Add the info for the metacontact
- if(hMetaContact)
+ if (hMetaContact)
{
DBWriteContactSettingDword(hMetaContact,META_PROTO,META_ID,nextMetaID);
@@ -62,8 +62,8 @@ INT_PTR Meta_Convert(WPARAM wParam,LPARAM lParam) // Add the MetaContact protocol to the new meta contact
CallService( MS_PROTO_ADDTOCONTACT, ( WPARAM )hMetaContact, ( LPARAM )META_PROTO );
- if(group) {
- if(ServiceExists(MS_DB_CONTACT_GETSETTING_STR))
+ if (group) {
+ if (ServiceExists(MS_DB_CONTACT_GETSETTING_STR))
DBWriteContactSettingStringUtf(hMetaContact,"CList","Group",group);
else
DBWriteContactSettingString(hMetaContact,"CList","Group",group);
@@ -147,7 +147,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) { num_contacts = DBGetContactSettingDword(hMeta, META_PROTO, "NumContacts", 0);
default_contact = DBGetContactSettingDword(hMeta, META_PROTO, "Default", -1);
- if(number >= 0 && number < num_contacts) {
+ if (number >= 0 && number < num_contacts) {
// get the handle
hContact = Meta_GetContactHandle(hMeta, number);
@@ -166,7 +166,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) { //CallService(MS_PROTO_REMOVEFROMCONTACT,(WPARAM)hContact,(LPARAM)META_PROTO);
CallService(MS_PROTO_REMOVEFROMCONTACT,(WPARAM)hContact,(LPARAM)META_FILTER);
// stop ignoring, if we were
- if(options.suppress_status)
+ if (options.suppress_status)
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
@@ -175,7 +175,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) { // each contact from 'number' upwards will be moved down one
// and the last one will be deleted
- for(i = number + 1; i < num_contacts; i++) {
+ for (i = number + 1; i < num_contacts; i++) {
Meta_SwapContacts(hMeta, i, i-1);
}
@@ -203,9 +203,9 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) { DBDeleteContactSetting(hMeta, META_PROTO, buffer);
// if the default contact was equal to or greater than 'number', decrement it (and deal with ends)
- if(default_contact >= number) {
+ if (default_contact >= number) {
default_contact--;
- if(default_contact < 0)
+ if (default_contact < 0)
default_contact = 0;
DBWriteContactSettingDword(hMeta, META_PROTO, "Default", (DWORD)default_contact);
@@ -223,7 +223,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) { // fix avatar
hContact = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_4, PF4_AVATARS);
- if(hContact) {
+ if (hContact) {
PROTO_AVATAR_INFORMATION AI;
AI.cbSize = sizeof(AI);
@@ -253,7 +253,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) if ((metaID=DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1)
{// The wParam is a metacontact
if (!lParam) { // check from recursion - see second half of this function
- if(MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),Translate("This will remove the MetaContact permanently.\n\nProceed Anyway?"),
+ if (MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),Translate("This will remove the MetaContact permanently.\n\nProceed Anyway?"),
Translate("Are you sure?"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2)!=IDYES)
{
return 0;
@@ -263,7 +263,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
while(hContact)
{ // Scans the database to get all the contacts that have been previously linked to this MetaContact
- if(DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)==metaID)
+ if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)==metaID)
{ // This contact is assigned to the MetaContact that will be deleted, clear the "MetaContacts" information
DBDeleteContactSetting(hContact,META_PROTO,"IsSubcontact");
DBDeleteContactSetting(hContact,META_PROTO,META_LINK);
@@ -275,7 +275,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) CallService(MS_PROTO_REMOVEFROMCONTACT,(WPARAM)hContact,(LPARAM)META_FILTER);
// stop ignoring, if we were
- if(options.suppress_status)
+ if (options.suppress_status)
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
@@ -288,7 +288,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) }
else
{// The wParam is a simple contact
- //if(lParam == 0)
+ //if (lParam == 0)
// return 1; // The function has been called by the menu of a simple contact. Should not happen.
//else
{// The function has been called by the edit dialog
@@ -297,8 +297,8 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) DWORD num_contacts = DBGetContactSettingDword(hMeta, META_PROTO, "NumContacts", -1);
- if(num_contacts == 1) {
- if(MessageBox(0,Translate("You are going to remove all the contacts associated with this MetaContact.\nThis will delete the MetaContact.\n\nProceed Anyway?"),
+ if (num_contacts == 1) {
+ if (MessageBox(0,Translate("You are going to remove all the contacts associated with this MetaContact.\nThis will delete the MetaContact.\n\nProceed Anyway?"),
Translate("Delete MetaContact?"),MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON1)==IDYES)
{
// recurse - once
@@ -345,7 +345,7 @@ INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam) */
INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam)
{
- if(DBGetContactSettingDword((HANDLE)wParam,META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
+ if (DBGetContactSettingDword((HANDLE)wParam,META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
{ // the wParam is a MetaContact
BOOL current = DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", 0);
@@ -354,7 +354,7 @@ INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam) DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "ForceSend", 0);
- if(current) NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1)));
+ if (current) NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1)));
else NotifyEventHooks(hEventUnforceSend, wParam, 0);
}
return 0;
@@ -408,7 +408,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) mi.flags = CMIM_FLAGS;
mi.cbSize = sizeof(CLISTMENUITEM);
- if(DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,-1) != (DWORD)-1)
+ if (DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,-1) != (DWORD)-1)
{
int num_contacts, i;
@@ -418,7 +418,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) // This is a MetaContact, show the edit, force default, and the delete menu, and hide the others
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
//mi.flags |= CMIM_NAME;
- //if(DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", 0))
+ //if (DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", 0))
// mi.pszName = Translate("Unforce Default");
//else
// mi.pszName = Translate("Force Default");
@@ -434,8 +434,8 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) //show subcontact menu items
num_contacts = DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "NumContacts", 0);
- for(i = 0; i < MAX_CONTACTS; i++) {
- if(i < num_contacts) {
+ for (i = 0; i < MAX_CONTACTS; i++) {
+ if (i < num_contacts) {
hContact = Meta_GetContactHandle((HANDLE)wParam, i);
proto = _strdup((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
@@ -444,7 +444,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) else
status = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
- if(options.menu_contact_label == DNT_UID) {
+ if (options.menu_contact_label == DNT_UID) {
strcpy(buf, "Login");
strcat(buf, _itoa(i, buffer2, 10));
@@ -473,7 +473,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) char *name = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0);
char *wname = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_UNICODE);
- if(wname && strncmp(name, wname, strlen(name)) != 0) {
+ if (wname && strncmp(name, wname, strlen(name)) != 0) {
mi.pszName = wname;
mi.flags = CMIF_UNICODE;
}
@@ -522,12 +522,12 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
- for(i = 0; i < MAX_CONTACTS; i++) {
+ for (i = 0; i < MAX_CONTACTS; i++) {
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuContact[i], (LPARAM)&mi);
}
- } else if(DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ } else if (DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
// The contact is affected to a metacontact.
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
mi.flags |= CMIM_NAME;
@@ -537,7 +537,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
- for(i = 0; i < MAX_CONTACTS; i++) {
+ for (i = 0; i < MAX_CONTACTS; i++) {
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuContact[i], (LPARAM)&mi);
}
@@ -549,7 +549,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
- for(i = 0; i < MAX_CONTACTS; i++) {
+ for (i = 0; i < MAX_CONTACTS; i++) {
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuContact[i], (LPARAM)&mi);
}
diff --git a/plugins/MetaContacts/meta_options.c b/plugins/MetaContacts/meta_options.c index af23243c5e..cceb484f6f 100644 --- a/plugins/MetaContacts/meta_options.c +++ b/plugins/MetaContacts/meta_options.c @@ -131,7 +131,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_UID:
hw = GetDlgItem(hwndDlg, IDC_RAD_UID);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_UID)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_UID)) {
options_changes.menu_contact_label = DNT_UID;
CheckDlgButton(hwndDlg, IDC_RAD_DID, FALSE);
}
@@ -139,7 +139,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_DID:
hw = GetDlgItem(hwndDlg, IDC_RAD_DID);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_DID)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_DID)) {
options_changes.menu_contact_label = DNT_DID;
CheckDlgButton(hwndDlg, IDC_RAD_UID, FALSE);
}
@@ -147,7 +147,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_MSG:
hw = GetDlgItem(hwndDlg, IDC_RAD_MSG);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_MSG)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_MSG)) {
options_changes.menu_function = FT_MSG;
CheckDlgButton(hwndDlg, IDC_RAD_MENU, FALSE);
CheckDlgButton(hwndDlg, IDC_RAD_INFO, FALSE);
@@ -156,7 +156,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_MENU:
hw = GetDlgItem(hwndDlg, IDC_RAD_MENU);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_MENU)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_MENU)) {
options_changes.menu_function = FT_MENU;
CheckDlgButton(hwndDlg, IDC_RAD_MSG, FALSE);
CheckDlgButton(hwndDlg, IDC_RAD_INFO, FALSE);
@@ -165,7 +165,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_INFO:
hw = GetDlgItem(hwndDlg, IDC_RAD_INFO);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_INFO)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_INFO)) {
options_changes.menu_function = FT_INFO;
CheckDlgButton(hwndDlg, IDC_RAD_MSG, FALSE);
CheckDlgButton(hwndDlg, IDC_RAD_MENU, FALSE);
@@ -174,7 +174,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_NICK:
hw = GetDlgItem(hwndDlg, IDC_RAD_NICK);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_NICK)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_NICK)) {
options_changes.clist_contact_name = CNNT_NICK;
CheckDlgButton(hwndDlg, IDC_RAD_NAME, FALSE);
}
@@ -182,7 +182,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_RAD_NAME:
hw = GetDlgItem(hwndDlg, IDC_RAD_NAME);
- if(IsDlgButtonChecked(hwndDlg, IDC_RAD_NAME)) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_RAD_NAME)) {
options_changes.clist_contact_name = CNNT_DISPLAYNAME;
CheckDlgButton(hwndDlg, IDC_RAD_NICK, FALSE);
}
@@ -192,7 +192,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara hw = GetDlgItem(hwndDlg, IDC_CHK_SUBWINDOW);
options_changes.subcontact_windows = IsDlgButtonChecked(hwndDlg, IDC_CHK_SUBWINDOW);
- if(options_changes.subcontact_windows) {
+ if (options_changes.subcontact_windows) {
hw = GetDlgItem(hwndDlg, IDC_CHK_METAHISTORY);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_CHK_SUBHISTORY);
@@ -223,7 +223,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
hw = GetDlgItem(hwndDlg, IDC_ED_DAYS);
GetWindowText(hw, buff, 512);
- if(strlen(buff) > 0)
+ if (strlen(buff) > 0)
options_changes.days_history = atoi(buff);
options = options_changes;
@@ -262,7 +262,7 @@ int Meta_WriteOptions(MetaOptions *opt) { else
DBWriteContactSettingByte(NULL, META_PROTO, "MetaHistory", (BYTE)(opt->metahistory ? 1 : 0));
- if(opt->subcontact_windows)
+ if (opt->subcontact_windows)
DBWriteContactSettingByte(NULL, META_PROTO, "SubcontactHistory", 1);
else
DBWriteContactSettingByte(NULL, META_PROTO, "SubcontactHistory", (BYTE)(opt->subhistory ? 1 : 0));
@@ -294,7 +294,7 @@ int Meta_ReadOptions(MetaOptions *opt) { else
opt->metahistory = (DBGetContactSettingByte(NULL, META_PROTO, "MetaHistory", 1) == 1 ? TRUE : FALSE);
- if(opt->subcontact_windows)
+ if (opt->subcontact_windows)
opt->subhistory = TRUE;
else
opt->subhistory = (DBGetContactSettingByte(NULL, META_PROTO, "SubcontactHistory", 1) == 1 ? TRUE : FALSE);
@@ -347,7 +347,7 @@ int GetRealPriority(char *proto, int status) { int prio;
mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", proto, status);
prio = DBGetContactSettingWord(0, META_PROTO, szSetting, 0xFFFF);
- if(prio == 0xFFFF) {
+ if (prio == 0xFFFF) {
mir_snprintf(szSetting, 256, "DefaultPrio_%d", status);
return DBGetContactSettingWord(0, META_PROTO, szSetting, GetDefaultPrio(status));
} else
@@ -366,14 +366,14 @@ void ReadPriorities() { CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc);
current = priorities = (ProtoStatusPrio *)malloc((num_protocols + 1) * sizeof(ProtoStatusPrio));
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
mir_snprintf(szSetting, 256, "DefaultPrio_%d", i);
current->def[i - ID_STATUS_OFFLINE] = TRUE;
current->prio[i - ID_STATUS_OFFLINE] = DBGetContactSettingWord(0, META_PROTO, szSetting, GetDefaultPrio(i));
}
- for(i = 0; i < num_protocols; i++) {
+ for (i = 0; i < num_protocols; i++) {
current = priorities + (i + 1);
- for(j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
+ for (j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szName, j);
current->prio[j - ID_STATUS_OFFLINE] = DBGetContactSettingWord(0, META_PROTO, szSetting, 0xFFFF);
current->def[j - ID_STATUS_OFFLINE] = (current->prio[j - ID_STATUS_OFFLINE] == 0xFFFF);
@@ -390,16 +390,16 @@ void WritePriorities() { CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc);
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
mir_snprintf(szSetting, 256, "DefaultPrio_%d", i);
- if(current->prio[i - ID_STATUS_OFFLINE] != GetDefaultPrio(i))
+ if (current->prio[i - ID_STATUS_OFFLINE] != GetDefaultPrio(i))
DBWriteContactSettingWord(0, META_PROTO, szSetting, (WORD)current->prio[i - ID_STATUS_OFFLINE]);
else
DBDeleteContactSetting(0, META_PROTO, szSetting);
}
- for(i = 0; i < num_protocols; i++) {
+ for (i = 0; i < num_protocols; i++) {
current = priorities + (i + 1);
- for(j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
+ for (j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
mir_snprintf(szSetting, 256, "ProtoPrio_%s%d", pppDesc[i]->szName, j);
if (!current->def[j - ID_STATUS_OFFLINE])
DBWriteContactSettingWord(0, META_PROTO, szSetting, (WORD)current->prio[j - ID_STATUS_OFFLINE]);
@@ -415,12 +415,12 @@ int GetIsDefault(int proto_index, int status) { BOOL GetPriority(int proto_index, int status) {
ProtoStatusPrio * current;
- if(proto_index == -1) {
+ if (proto_index == -1) {
current = priorities;
return current->prio[status - ID_STATUS_OFFLINE];
} else {
current = priorities + (proto_index + 1);
- if(current->def[status - ID_STATUS_OFFLINE]) {
+ if (current->def[status - ID_STATUS_OFFLINE]) {
current = priorities;
}
return current->prio[status - ID_STATUS_OFFLINE];
@@ -430,9 +430,9 @@ BOOL GetPriority(int proto_index, int status) { void SetPriority(int proto_index, int status, BOOL def, int prio) {
ProtoStatusPrio * current;
- if(prio < 0) prio = 0;
- if(prio > 500) prio = 500;
- if(proto_index == -1) {
+ if (prio < 0) prio = 0;
+ if (prio > 500) prio = 500;
+ if (proto_index == -1) {
current = priorities;
current->prio[status - ID_STATUS_OFFLINE] = prio;
} else {
@@ -453,13 +453,13 @@ void ResetPriorities() { CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&num_protocols, (WPARAM)&pppDesc);
current = priorities;
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
current->def[i - ID_STATUS_OFFLINE] = TRUE;
current->prio[i - ID_STATUS_OFFLINE] = GetDefaultPrio(i);
}
- for(i = 0; i < num_protocols; i++) {
+ for (i = 0; i < num_protocols; i++) {
current = priorities + (i + 1);
- for(j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
+ for (j = ID_STATUS_OFFLINE; j <= ID_STATUS_OUTTOLUNCH; j++) {
current->def[j - ID_STATUS_OFFLINE] = TRUE;
}
}
@@ -486,9 +486,9 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP hw = GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL);
index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)Translate("<default>"));
SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, -1);
- for(i = 0; i < num_protocols; i++) {
- if(pppDesc[i]->type == PROTOTYPE_PROTOCOL) {
- if(strcmp(pppDesc[i]->szName, META_PROTO) != 0) {
+ for (i = 0; i < num_protocols; i++) {
+ if (pppDesc[i]->type == PROTOTYPE_PROTOCOL) {
+ if (strcmp(pppDesc[i]->szName, META_PROTO) != 0) {
index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)pppDesc[i]->szName);
SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, i);
}
@@ -503,19 +503,19 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WMU_FILLPRIODATA:
{
int sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
int index = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETITEMDATA, (WPARAM)sel, 0);
sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_STATUS), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
int status = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_STATUS), CB_GETITEMDATA, (WPARAM)sel, 0);
SetDlgItemInt(hwndDlg, IDC_ED_PRIORITY, GetPriority(index, status), FALSE);
- if(index == -1) {
+ if (index == -1) {
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_PRIORITY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SP_PRIORITY), TRUE);
CheckDlgButton(hwndDlg, IDC_CHK_DEFAULT, TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DEFAULT), FALSE);
} else {
- if(GetIsDefault(index, status)) {
+ if (GetIsDefault(index, status)) {
CheckDlgButton(hwndDlg, IDC_CHK_DEFAULT, TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_PRIORITY), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SP_PRIORITY), FALSE);
@@ -534,13 +534,13 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WMU_FILLSTATUSCMB:
{
int sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
int index = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETITEMDATA, (WPARAM)sel, 0);
HWND hw = GetDlgItem(hwndDlg, IDC_CMB_STATUS);
SendMessage(hw, CB_RESETCONTENT, 0, 0);
- if(index == -1) {
+ if (index == -1) {
int i;
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)(char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, i, 0));
SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, i);
}
@@ -551,8 +551,8 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP caps = CallProtoService(pppDesc[index]->szName, PS_GETCAPS, PFLAGNUM_2, 0);
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- if(caps & Proto_Status2Flag(i)) {
+ for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ if (caps & Proto_Status2Flag(i)) {
index = SendMessage(hw, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)(char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, i, 0));
SendMessage(hw, CB_SETITEMDATA, (WPARAM)index, i);
}
@@ -569,13 +569,13 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_CHK_DEFAULT:
{
int sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
int index = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETITEMDATA, (WPARAM)sel, 0);
sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_STATUS), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
BOOL checked = IsDlgButtonChecked(hwndDlg, IDC_CHK_DEFAULT);
int status = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_STATUS), CB_GETITEMDATA, (WPARAM)sel, 0);
- if(checked) {
+ if (checked) {
SetPriority(index, status, TRUE, 0);
SetDlgItemInt(hwndDlg, IDC_ED_PRIORITY, GetPriority(index, status), FALSE);
} else {
@@ -599,14 +599,14 @@ INT_PTR CALLBACK DlgProcOptsPriorities(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
if ( HIWORD( wParam ) == EN_CHANGE && LOWORD(wParam) == IDC_ED_PRIORITY && ( HWND )lParam == GetFocus()) {
int sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
int index = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTOCOL), CB_GETITEMDATA, (WPARAM)sel, 0);
sel = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_STATUS), CB_GETCURSEL, 0, 0);
- if(sel != -1) {
+ if (sel != -1) {
int status = SendMessage(GetDlgItem(hwndDlg, IDC_CMB_STATUS), CB_GETITEMDATA, (WPARAM)sel, 0);
int prio = GetDlgItemInt(hwndDlg, IDC_ED_PRIORITY, 0, FALSE);
SetPriority(index, status, FALSE, prio);
- if(prio != GetPriority(index, status))
+ if (prio != GetPriority(index, status))
SetDlgItemInt(hwndDlg, IDC_ED_PRIORITY, GetPriority(index, status), FALSE);
SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
}
diff --git a/plugins/MetaContacts/meta_services.c b/plugins/MetaContacts/meta_services.c index 67644af23c..92e503568d 100644 --- a/plugins/MetaContacts/meta_services.c +++ b/plugins/MetaContacts/meta_services.c @@ -43,20 +43,21 @@ hHooks[NB_HOOKS] = {0}; //!< list of all hooks set up (see Meta_CloseHandles()) HANDLE *hNudgeEvents = 0;
int iNudgeProtos = 0;
-HANDLE hMenuConvert, //!< \c HANDLE to the convert menu item.
- hMenuAdd, //!< \c HANDLE to the add to menu item.
- hMenuEdit, //!< \c HANDLE to the edit menu item.
- hMenuDelete, //!< \c HANDLE to the delete menu item.
- hMenuDefault, //!< \c HANDLE to the delete menu item.
- hMenuForceDefault; //!< \c HANDLE to the delete menu item.
-
-HANDLE hMenuOnOff; //!< \c HANDLE to the enable/disable menu item.
-
-HANDLE hEventDefaultChanged, //!< \c HANDLE to the 'default changed' event
- hEventForceSend, //!< \c HANDLE to the 'force send' event
- hEventUnforceSend, //!< \c HANDLE to the 'unforce send' event
- hSubcontactsChanged, //!< \c HANDLE to the 'contacts changed' event
- hEventNudge;
+HGENMENU
+ hMenuConvert, //!< \c HANDLE to the convert menu item.
+ hMenuAdd, //!< \c HANDLE to the add to menu item.
+ hMenuEdit, //!< \c HANDLE to the edit menu item.
+ hMenuDelete, //!< \c HANDLE to the delete menu item.
+ hMenuDefault, //!< \c HANDLE to the delete menu item.
+ hMenuForceDefault, //!< \c HANDLE to the delete menu item.
+ hMenuOnOff; //!< \c HANDLE to the enable/disable menu item.
+
+HANDLE
+ hEventDefaultChanged, //!< \c HANDLE to the 'default changed' event
+ hEventForceSend, //!< \c HANDLE to the 'force send' event
+ hEventUnforceSend, //!< \c HANDLE to the 'unforce send' event
+ hSubcontactsChanged, //!< \c HANDLE to the 'contacts changed' event
+ hEventNudge;
DWORD nextMetaID; //!< Global variable specifying the ID value the next MetaContact will have.
@@ -130,7 +131,7 @@ INT_PTR Meta_GetName(WPARAM wParam,LPARAM lParam) {
char *name = (char *)Translate(META_PROTO);
size_t size = min(strlen(name),wParam-1); // copy only the first size bytes.
- if(strncpy((char *)lParam,name,size)==NULL)
+ if (strncpy((char *)lParam,name,size)==NULL)
return 1;
((char *)lParam)[size]='\0';
return 0;
@@ -189,7 +190,7 @@ void CALLBACK SetStatusThread(HWND hWnd, UINT msg, UINT_PTR id, DWORD dw) INT_PTR Meta_SetStatus(WPARAM wParam,LPARAM lParam)
{
// firstSetOnline starts out true - used to delay metacontact's 'onlineness' to prevent double status notifications on startup
- if(mcStatus == ID_STATUS_OFFLINE && firstSetOnline) {
+ if (mcStatus == ID_STATUS_OFFLINE && firstSetOnline) {
// causes crash on exit if miranda is closed in under options.set_status_from_offline milliseconds!
//CloseHandle( CreateThread( NULL, 0, SetStatusThread, (void *)wParam, 0, 0 ));
setStatusTimerId = SetTimer(0, 0, options.set_status_from_offline_delay, SetStatusThread);
@@ -269,18 +270,18 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) }
// if subcontact sending, add db event to keep metacontact history correct
- if(options.metahistory && !(ccs->wParam & PREF_METANODB)) {
+ if (options.metahistory && !(ccs->wParam & PREF_METANODB)) {
// reject "file As Message" messages
- if(strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%fAM", 5) == 0)
+ if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%fAM", 5) == 0)
return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
// reject "data As Message" messages
- if(strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%dAM", 5) == 0)
+ if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%dAM", 5) == 0)
return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
// reject "OTR" messages
- if(strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "?OTR", 4) == 0)
+ if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "?OTR", 4) == 0)
return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
ZeroMemory(&dbei, sizeof(dbei));
@@ -289,8 +290,8 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) dbei.flags = DBEF_SENT;
dbei.timestamp = time(NULL);
dbei.eventType = EVENTTYPE_MESSAGE;
- if(ccs->wParam & PREF_RTL) dbei.flags |= DBEF_RTL;
- if(ccs->wParam & PREF_UTF) dbei.flags |= DBEF_UTF;
+ if (ccs->wParam & PREF_RTL) dbei.flags |= DBEF_RTL;
+ if (ccs->wParam & PREF_UTF) dbei.flags |= DBEF_UTF;
dbei.cbBlob = (DWORD)strlen((char *)ccs->lParam) + 1;
if ( ccs->wParam & PREF_UNICODE )
dbei.cbBlob *= ( sizeof( wchar_t )+1 );
@@ -379,14 +380,14 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam) // don't bypass filters etc
strncpy(szServiceName, PSS_MESSAGE, sizeof(szServiceName));
- if(ccs->wParam & PREF_UNICODE) {
+ if (ccs->wParam & PREF_UNICODE) {
char szTemp[100];
_snprintf(szTemp, sizeof(szTemp), "%s%sW", proto, PSS_MESSAGE);
if (ServiceExists(szTemp))
strncpy(szServiceName, PSS_MESSAGE "W", sizeof(szServiceName));
}
- if(options.subhistory && !(ccs->wParam & PREF_METANODB)) {
+ if (options.subhistory && !(ccs->wParam & PREF_METANODB)) {
// add sent event to subcontact
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
@@ -394,8 +395,8 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam) dbei.flags = DBEF_SENT;
dbei.timestamp = time(NULL);
dbei.eventType = EVENTTYPE_MESSAGE;
- if(ccs->wParam & PREF_RTL) dbei.flags |= DBEF_RTL;
- if(ccs->wParam & PREF_UTF) dbei.flags |= DBEF_UTF;
+ if (ccs->wParam & PREF_RTL) dbei.flags |= DBEF_RTL;
+ if (ccs->wParam & PREF_UTF) dbei.flags |= DBEF_UTF;
dbei.cbBlob = (DWORD)strlen((char *)ccs->lParam) + 1;
if ( ccs->wParam & PREF_UNICODE )
dbei.cbBlob *= ( sizeof( wchar_t )+1 );
@@ -435,8 +436,8 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) return 0;
}
- if(options.set_default_on_recv) {
- if(options.temp_default && DBGetContactSettingDword(hMeta, META_PROTO, "SavedDefault", (DWORD)-1) == (DWORD)-1)
+ if (options.set_default_on_recv) {
+ if (options.temp_default && DBGetContactSettingDword(hMeta, META_PROTO, "SavedDefault", (DWORD)-1) == (DWORD)-1)
DBWriteContactSettingDword(hMeta, META_PROTO, "SavedDefault", DBGetContactSettingDword(hMeta, META_PROTO, "Default", 0));
DBWriteContactSettingDword(hMeta, META_PROTO, "Default", DBGetContactSettingDword(ccs->hContact, META_PROTO, "ContactNumber", 0));
NotifyEventHooks(hEventDefaultChanged, (WPARAM)hMeta, (LPARAM)ccs->hContact); // nick set in event handler
@@ -451,7 +452,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) // add a clist event, so that e.g. there is an icon flashing
// (only add it when message api available, 'cause then we can remove the event when the message window is opened)
- if(message_window_api_enabled
+ if (message_window_api_enabled
&& DBGetContactSettingByte(ccs->hContact, META_PROTO, "WindowOpen", 0) == 0
&& DBGetContactSettingByte(hMeta, META_PROTO, "WindowOpen", 0) == 0
&& options.flash_meta_message_icon)
@@ -471,23 +472,23 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) CallService(MS_CLIST_ADDEVENT, 0, (LPARAM) & cle);
}
- if(options.metahistory) {
+ if (options.metahistory) {
BOOL added = FALSE;
// should be able to do this, but some protos mess with the memory
- if(options.use_proto_recv)
+ if (options.use_proto_recv)
{
// use the subcontact's protocol 'recv' service to add the meta's history (AIMOSCAR removes HTML here!) if possible
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
- if(proto) {
+ if (proto) {
char service[256];
HANDLE hSub = ccs->hContact;
DWORD flags = pre->flags;
mir_snprintf(service, 256, "%s%s", proto, PSR_MESSAGE);
ccs->hContact = hMeta;
pre->flags |= (DBGetContactSettingByte(hMeta, META_PROTO, "WindowOpen", 0) ? 0 : PREF_CREATEREAD);
- if(ServiceExists(service) && !CallService(service, 0, (LPARAM)ccs))
+ if (ServiceExists(service) && !CallService(service, 0, (LPARAM)ccs))
added = TRUE;
ccs->hContact = hSub;
pre->flags = flags;
@@ -501,8 +502,8 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) dbei.szModule = META_PROTO;
dbei.timestamp = pre->timestamp;
dbei.flags = (DBGetContactSettingByte(hMeta, META_PROTO, "WindowOpen", 0) ? 0 : DBEF_READ);
- if(pre->flags & PREF_RTL) dbei.flags |= DBEF_RTL;
- if(pre->flags & PREF_UTF) dbei.flags |= DBEF_UTF;
+ if (pre->flags & PREF_RTL) dbei.flags |= DBEF_RTL;
+ if (pre->flags & PREF_UTF) dbei.flags |= DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (DWORD)strlen(pre->szMessage) + 1;
if ( pre->flags & PREF_UNICODE ) {
@@ -521,13 +522,13 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) /*
// add event to subcontact history (would do it in meta_recvmessage, but here we have the hcontact)
// should be able to use the method below, except some protos can mess with the memory
- if(options.subhistory) {
+ if (options.subhistory) {
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
dbei.szModule = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
dbei.timestamp = pre->timestamp;
dbei.flags = (DBGetContactSettingByte(ccs->hContact, META_PROTO, "WindowOpen", 0) ? 0 : DBEF_READ);
- if(pre->flags & PREF_RTL) dbei.flags |= DBEF_RTL;
+ if (pre->flags & PREF_RTL) dbei.flags |= DBEF_RTL;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = strlen(pre->szMessage) + 1;
if ( pre->flags & PREF_UNICODE )
@@ -546,7 +547,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) ccs->hContact = hSub;
}
- if(options.subhistory && !(ccs->wParam & PREF_METANODB)) {
+ if (options.subhistory && !(ccs->wParam & PREF_METANODB)) {
// allow event pass through and thereby be added to subcontact history
pre->flags |= (DBGetContactSettingByte(ccs->hContact, META_PROTO, "WindowOpen", 0) ? 0 : PREF_CREATEREAD);
CallService(MS_PROTO_CHAINRECV, wParam, (LPARAM)ccs); // pass through as normal
@@ -575,12 +576,12 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam) return 0;
}
- if(options.use_proto_recv)
+ if (options.use_proto_recv)
{
// use the subcontact's protocol to add the db if possible (AIMOSCAR removes HTML here!)
HANDLE most_online = Meta_GetMostOnline(ccs->hContact);
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
- if(proto) {
+ if (proto) {
char service[256];
mir_snprintf(service, 256, "%s%s", proto, PSR_MESSAGE);
if (CallService(service, wParam, lParam) != CALLSERVICE_NOTFOUND)
@@ -595,8 +596,8 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam) dbei.szModule = META_PROTO;
dbei.timestamp = pre->timestamp;
dbei.flags = (pre->flags & PREF_CREATEREAD ? DBEF_READ : 0);
- if(pre->flags & PREF_RTL) dbei.flags |= DBEF_RTL;
- if(pre->flags & PREF_UTF) dbei.flags |= DBEF_UTF;
+ if (pre->flags & PREF_RTL) dbei.flags |= DBEF_RTL;
+ if (pre->flags & PREF_UTF) dbei.flags |= DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (DWORD)strlen(pre->szMessage) + 1;
if ( pre->flags & PREF_UNICODE )
@@ -625,7 +626,7 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam) ACKDATA *ack = (ACKDATA*) lParam;
HANDLE hUser;
- if(ack->hContact == 0 || (hUser = (HANDLE)DBGetContactSettingDword(ack->hContact,META_PROTO,"Handle",0)) == 0)
+ if (ack->hContact == 0 || (hUser = (HANDLE)DBGetContactSettingDword(ack->hContact,META_PROTO,"Handle",0)) == 0)
return 0; // Can't find the MetaID, let through the protocol chain
@@ -634,7 +635,7 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam) }
// if it's for something we don't support, ignore
- if(ack->type != ACKTYPE_MESSAGE && ack->type != ACKTYPE_CHAT && ack->type != ACKTYPE_FILE && ack->type != ACKTYPE_AWAYMSG
+ if (ack->type != ACKTYPE_MESSAGE && ack->type != ACKTYPE_CHAT && ack->type != ACKTYPE_FILE && ack->type != ACKTYPE_AWAYMSG
&& ack->type != ACKTYPE_AVATAR && ack->type != ACKTYPE_GETINFO)
{
@@ -642,15 +643,15 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam) }
// change the hContact in the avatar info struct, if it's the avatar we're using - else drop it
- if(ack->type == ACKTYPE_AVATAR) {
- if(ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED || ack->result == ACKRESULT_STATUS) {
+ if (ack->type == ACKTYPE_AVATAR) {
+ if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED || ack->result == ACKRESULT_STATUS) {
HANDLE most_online;
DBVARIANT dbv;
// change avatar if the most online supporting avatars changes, or if we don't have one
most_online = Meta_GetMostOnlineSupporting(hUser, PFLAGNUM_4, PF4_AVATARS);
- //if(AI.hContact == 0 || AI.hContact != most_online) {
- if(ack->hContact == 0 || ack->hContact != most_online) {
+ //if (AI.hContact == 0 || AI.hContact != most_online) {
+ if (ack->hContact == 0 || ack->hContact != most_online) {
return 0;
}
@@ -660,10 +661,10 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam) DBFreeVariant(&dbv);
}
- if(ack->hProcess) {
+ if (ack->hProcess) {
PROTO_AVATAR_INFORMATION AI;
memcpy(&AI, (PROTO_AVATAR_INFORMATION *)ack->hProcess, sizeof(PROTO_AVATAR_INFORMATION));
- if(AI.hContact)
+ if (AI.hContact)
AI.hContact = hUser;
return ProtoBroadcastAck(META_PROTO,hUser,ack->type,ack->result, (HANDLE)&AI, ack->lParam);
@@ -696,7 +697,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // hide metacontacts when groups disabled
- if(wParam == 0
+ if (wParam == 0
&& ((strcmp(dcws->szModule, "CList") == 0 && strcmp(dcws->szSetting, "UseGroups") == 0)
|| (strcmp(dcws->szModule, META_PROTO) == 0 && strcmp(dcws->szSetting, "Enabled") == 0)))
{
@@ -704,7 +705,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) return 0;
}
- if(wParam == 0
+ if (wParam == 0
&& strcmp(dcws->szModule, "Import") == 0 && strcmp(dcws->szSetting, "Completed") == 0)
{
// import process has just been run...call startup routines...
@@ -724,7 +725,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) Meta_SuppressStatus(options.suppress_status);
}
- if(wParam == 0
+ if (wParam == 0
&& strcmp(dcws->szModule, "CListGroups") == 0 && dcws->value.type != DBVT_DELETED && strcmp(dcws->value.pszVal, META_HIDDEN_GROUP) == 0)
{
// someone is creating our hidden group!!
@@ -732,7 +733,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) }
// from here on, we're just interested in contact settings
- if(wParam == 0) return 0;
+ if (wParam == 0) return 0;
if ((hMeta=(HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Handle",0))!=0
&& CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
@@ -740,7 +741,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) { // This contact is attached to a MetaContact.
contact_number = Meta_GetContactNumber((HANDLE)wParam);
- if(contact_number == -1) return 0; // exit - db corruption
+ if (contact_number == -1) return 0; // exit - db corruption
if (!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Group") &&
Meta_IsEnabled() && DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
@@ -748,7 +749,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // subcontact group reassigned - copy to saved group
MyDBWriteContactSetting((HANDLE)wParam, META_PROTO, "OldCListGroup", &dcws->value);
DBWriteContactSettingString((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
- } else if(dcws->value.type == DBVT_DELETED) {
+ } else if (dcws->value.type == DBVT_DELETED) {
DBDeleteContactSetting((HANDLE)wParam, META_PROTO, "OldCListGroup");
DBWriteContactSettingString((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
}
@@ -756,7 +757,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // copy IP
if (!strcmp(dcws->szSetting, "IP")) {
- if(dcws->value.type == DBVT_DWORD)
+ if (dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "IP", dcws->value.dVal);
else
DBDeleteContactSetting(hMeta, META_PROTO, "IP");
@@ -764,7 +765,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // copy RealIP
if (!strcmp(dcws->szSetting, "RealIP")) {
- if(dcws->value.type == DBVT_DWORD)
+ if (dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "RealIP", dcws->value.dVal);
else
DBDeleteContactSetting(hMeta, META_PROTO, "RealIP");
@@ -797,7 +798,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) strcat(buffer, _itoa(contact_number, buffer2, 10));
MyDBWriteContactSetting(hMeta, META_PROTO, buffer, &dcws->value);
- if(MyDBGetContactSetting((HANDLE)wParam, "CList", "MyHandle", &dbv)) {
+ if (MyDBGetContactSetting((HANDLE)wParam, "CList", "MyHandle", &dbv)) {
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, buffer2, 10));
MyDBWriteContactSetting(hMeta, META_PROTO, buffer, &dcws->value);
@@ -813,29 +814,29 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) } else
if (!strcmp(dcws->szSetting, "IdleTS")) {
- if(dcws->value.type == DBVT_DWORD)
+ if (dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "IdleTS", dcws->value.dVal);
- else if(dcws->value.type == DBVT_DELETED)
+ else if (dcws->value.type == DBVT_DELETED)
DBWriteContactSettingDword(hMeta, META_PROTO, "IdleTS", 0);
} else
if (!strcmp(dcws->szSetting, "LogonTS")) {
- if(dcws->value.type == DBVT_DWORD)
+ if (dcws->value.type == DBVT_DWORD)
DBWriteContactSettingDword(hMeta, META_PROTO, "LogonTS", dcws->value.dVal);
- else if(dcws->value.type == DBVT_DELETED)
+ else if (dcws->value.type == DBVT_DELETED)
DBWriteContactSettingDword(hMeta, META_PROTO, "LogonTS", 0);
} else
if (!strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "MyHandle")) {
HANDLE most_online;
- if(dcws->value.type == DBVT_DELETED) {
+ if (dcws->value.type == DBVT_DELETED) {
DBVARIANT dbv;
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, buffer2, 10));
- if(proto && !MyDBGetContactSetting((HANDLE)wParam, proto, "Nick", &dbv)) {
+ if (proto && !MyDBGetContactSetting((HANDLE)wParam, proto, "Nick", &dbv)) {
MyDBWriteContactSetting(hMeta, META_PROTO, buffer, &dbv);
DBFreeVariant(&dbv);
} else {
@@ -883,7 +884,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // most online contact with avatar support might have changed - update avatar
most_online = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_4, PF4_AVATARS);
- if(most_online) {
+ if (most_online) {
PROTO_AVATAR_INFORMATION AI;
AI.cbSize = sizeof(AI);
@@ -896,11 +897,11 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) }
} else
- if(strcmp(dcws->szSetting, "XStatusId") == 0 || strcmp(dcws->szSetting, "XStatusMsg") == 0 || strcmp(dcws->szSetting, "XStatusName") == 0 || strcmp(dcws->szSetting, "StatusMsg") == 0) {
+ if (strcmp(dcws->szSetting, "XStatusId") == 0 || strcmp(dcws->szSetting, "XStatusMsg") == 0 || strcmp(dcws->szSetting, "XStatusName") == 0 || strcmp(dcws->szSetting, "StatusMsg") == 0) {
Meta_CopyData(hMeta);
} else
- if(strcmp(dcws->szSetting, "MirVer") == 0) {
+ if (strcmp(dcws->szSetting, "MirVer") == 0) {
Meta_CopyData(hMeta);
} else
@@ -922,7 +923,7 @@ int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam) { // is a subcontact - update meta contact
hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Handle", 0);
- if(hMeta) {
+ if (hMeta) {
Meta_RemoveContactNumber(hMeta, DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "ContactNumber", -1));
NotifyEventHooks(hSubcontactsChanged, (WPARAM)hMeta, 0);
return 0;
@@ -932,14 +933,14 @@ int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam) { int i;
HANDLE hContact;
- if(num_contacts) NotifyEventHooks(hSubcontactsChanged, (WPARAM)wParam, 0);
+ if (num_contacts) NotifyEventHooks(hSubcontactsChanged, (WPARAM)wParam, 0);
// remove & restore all subcontacts
- for(i = 0; i < num_contacts; i++) {
+ for (i = 0; i < num_contacts; i++) {
hContact = Meta_GetContactHandle((HANDLE)wParam, i);
- if(hContact && (HANDLE)DBGetContactSettingDword(hContact, META_PROTO, "Handle", 0) == (HANDLE)wParam) {
- if(DBGetContactSettingByte(hContact, META_PROTO, "IsSubcontact", 0) == 1)
+ if (hContact && (HANDLE)DBGetContactSettingDword(hContact, META_PROTO, "Handle", 0) == (HANDLE)wParam) {
+ if (DBGetContactSettingByte(hContact, META_PROTO, "IsSubcontact", 0) == 1)
DBDeleteContactSetting(hContact,META_PROTO,"IsSubcontact");
DBDeleteContactSetting(hContact,META_PROTO,META_LINK);
DBDeleteContactSetting(hContact,META_PROTO,"Handle");
@@ -949,7 +950,7 @@ int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam) { CallService(MS_PROTO_REMOVEFROMCONTACT, (WPARAM)hContact, (LPARAM)META_FILTER);
// stop ignoring, if we were
- if(options.suppress_status)
+ if (options.suppress_status)
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
}
@@ -970,7 +971,7 @@ INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam) char *proto;
char buff[512];
- if(DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,(DWORD)-1) == (DWORD)-1)
+ if (DBGetContactSettingDword((HANDLE)wParam,META_PROTO,META_ID,(DWORD)-1) == (DWORD)-1)
{
// This is a simple contact, let through the stack of protocols
return 0;
@@ -985,11 +986,11 @@ INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam) if (!most_online) return 0;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
- if(proto) {
+ if (proto) {
strncpy(buff, proto, 512);
strncpy(buff + strlen(proto), PSS_USERISTYPING, 512 - strlen(proto));
- if(ServiceExists(buff)) {
+ if (ServiceExists(buff)) {
CallService(buff, (WPARAM)most_online, (LPARAM)lParam);
}
}
@@ -1036,7 +1037,7 @@ int Meta_UserInfo(WPARAM wParam, LPARAM lParam) {
DWORD default_contact_number = DBGetContactSettingDword((HANDLE)lParam, META_PROTO, "Default", (DWORD)-1);
- if(default_contact_number == -1) // not a meta contact
+ if (default_contact_number == -1) // not a meta contact
return 0;
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle((HANDLE)lParam, default_contact_number), 0);
@@ -1056,13 +1057,13 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) { || DBGetContactSettingDword(mwed->hContact, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
{
// contact is subcontact of metacontact, or an actual metacontact - record whether window is open or closed
- if(mwed->uType == MSG_WINDOW_EVT_OPEN || mwed->uType == MSG_WINDOW_EVT_OPENING) {
+ if (mwed->uType == MSG_WINDOW_EVT_OPEN || mwed->uType == MSG_WINDOW_EVT_OPENING) {
DBWriteContactSettingByte(mwed->hContact, META_PROTO, "WindowOpen", 1);
- if(hMeta) { // subcontact window opened - remove clist events we added for metacontact
+ if (hMeta) { // subcontact window opened - remove clist events we added for metacontact
while(!CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hMeta, (LPARAM)mwed->hContact));
}
- } else if(mwed->uType == MSG_WINDOW_EVT_CLOSE || mwed->uType == MSG_WINDOW_EVT_CLOSING) {
+ } else if (mwed->uType == MSG_WINDOW_EVT_CLOSE || mwed->uType == MSG_WINDOW_EVT_CLOSING) {
DBWriteContactSettingByte(mwed->hContact, META_PROTO, "WindowOpen", 0);
if (!hMeta) { // hMeta is 0 for metacontact (sorry)
DWORD saved_def;
@@ -1070,9 +1071,9 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) { MetaAPI_UnforceSendContact((WPARAM)mwed->hContact, 0);
// restore saved default contact
- if(options.set_default_on_recv) {
+ if (options.set_default_on_recv) {
saved_def = DBGetContactSettingDword(mwed->hContact, META_PROTO, "SavedDefault", -1);
- if(options.temp_default && saved_def != (DWORD)-1) {
+ if (options.temp_default && saved_def != (DWORD)-1) {
DBWriteContactSettingDword(mwed->hContact, META_PROTO, "Default", saved_def);
DBWriteContactSettingDword(mwed->hContact, META_PROTO, "SavedDefault", (DWORD)-1);
NotifyEventHooks(hEventDefaultChanged, (WPARAM)mwed->hContact, (LPARAM)Meta_GetContactHandle(hMeta, saved_def)); // nick set in event handler
@@ -1091,12 +1092,12 @@ int Meta_LoadIcons(WPARAM wParam, LPARAM lParam) { //MessageBox(0, "LoadIcons", "Event", MB_OK);
- if(ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
+ if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
int index = 0, i;
CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&proto_count,(LPARAM)&protos);
- for(i = 0; i < proto_count && i < MAX_PROTOCOLS; i++) {
- if(protos[i]->type!=PROTOTYPE_PROTOCOL || CallProtoService(protos[i]->szName,PS_GETCAPS,PFLAGNUM_2,0)==0)
+ for (i = 0; i < proto_count && i < MAX_PROTOCOLS; i++) {
+ if (protos[i]->type!=PROTOTYPE_PROTOCOL || CallProtoService(protos[i]->szName,PS_GETCAPS,PFLAGNUM_2,0)==0)
continue;
strncpy(proto_names + (index * 128), protos[i]->szName, 128);
@@ -1126,8 +1127,8 @@ int Meta_CListMW_ExtraIconsRebuild(WPARAM wParam, LPARAM lParam) { //MessageBox(0, "IconsRebuild", "Event", MB_OK);
Meta_LoadIcons(0, 0);
- if(ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
- for(i = 0; i < proto_count; i++) {
+ if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
+ for (i = 0; i < proto_count; i++) {
hExtraImage[i * 2] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hProtoIcons[i * 2], 0);
hExtraImage[i * 2 + 1] = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hProtoIcons[i * 2 + 1], 0);
}
@@ -1140,20 +1141,20 @@ int Meta_CListMW_ExtraIconsApply(WPARAM wParam, LPARAM lParam) { //MessageBox(0, "IconsApply", "Event", MB_OK);
- if(DBGetContactSettingDword((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
- if(ServiceExists(MS_CLIST_EXTRA_SET_ICON)) {
+ if (DBGetContactSettingDword((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ if (ServiceExists(MS_CLIST_EXTRA_SET_ICON)) {
IconExtraColumn iec;
HANDLE most_online_im = Meta_GetMostOnline((HANDLE)wParam);
int i;
- if(most_online_im) {
+ if (most_online_im) {
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online_im, 0);
- if(proto) {
+ if (proto) {
WORD status = DBGetContactSettingWord(most_online_im, proto, "Status", ID_STATUS_OFFLINE);
iec.cbSize = sizeof(iec);
- for(i = 0; i < proto_count; i++) {
+ for (i = 0; i < proto_count; i++) {
if (!strcmp((proto_names + i * 128), proto)) {
- if(hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)]) {
+ if (hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)]) {
iec.hImage = hExtraImage[i * 2 + (status == ID_STATUS_OFFLINE ? 1 : 0)];
iec.ColumnType = EXTRA_ICON_ADV2;
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)wParam, (LPARAM)&iec);
@@ -1172,7 +1173,7 @@ int Meta_CListMW_ExtraIconsApply(WPARAM wParam, LPARAM lParam) { */
int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) {
- if(DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Default",(WORD)-1) == (WORD)-1)
+ if (DBGetContactSettingDword((HANDLE)wParam,META_PROTO,"Default",(WORD)-1) == (WORD)-1)
{
// This is a simple contact
return 0;
@@ -1189,8 +1190,8 @@ int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) { if (!most_online)
return 0;
- if(options.subcontact_windows) {
- if(lParam) {
+ if (options.subcontact_windows) {
+ if (lParam) {
// contact from incoming message in lParam via (at this point) clist message event
CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)lParam, 0);
} else {
@@ -1201,7 +1202,7 @@ int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) { } else {
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
- if(proto) {
+ if (proto) {
strcpy(buffer, proto);
strcat(buffer, PS_GETCAPS);
@@ -1237,7 +1238,7 @@ int NudgeRecieved(WPARAM wParam, LPARAM lParam) { /*
// already being forwarded by someone
HANDLE hMeta = (HANDLE)DBGetContactSettingDword((HANDLE)wParam,META_PROTO, "Handle", (DWORD)0);
- if(hMeta)
+ if (hMeta)
NotifyEventHooks(hEventNudge, (WPARAM)hMeta, 0);
*/
return 0;
@@ -1250,15 +1251,14 @@ int NudgeRecieved(WPARAM wParam, LPARAM lParam) { */
int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = {0};
char buffer[512], buffer2[512], buffer3[512];
int i;
- if(ServiceExists(MS_MSG_GETWINDOWAPI)) {
+ if (ServiceExists(MS_MSG_GETWINDOWAPI))
message_window_api_enabled = TRUE;
- }
- if(ServiceExists(MS_UPDATE_REGISTER)) {
+ if (ServiceExists(MS_UPDATE_REGISTER)) {
// register with updater
Update update = {0};
char szVersion[16];
@@ -1285,19 +1285,17 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
}
-
// disable group hack for older nicer versions without the fix
- if(ServiceExists(MS_CLUI_GETVERSION)) {
+ if (ServiceExists(MS_CLUI_GETVERSION)) {
char *version = (char *)CallService(MS_CLUI_GETVERSION, 0, 0);
- if(version && strlen(version) >= strlen("CList Nicer+") && strncmp(version, "CList Nicer+", strlen("CList Nicer+")) == 0)
+ if (version && strlen(version) >= strlen("CList Nicer+") && strncmp(version, "CList Nicer+", strlen("CList Nicer+")) == 0)
meta_group_hack_disabled = TRUE;
}
// for database editor++ ver 3+
- if(ServiceExists("DBEditorpp/RegisterSingleModule"))
+ if (ServiceExists("DBEditorpp/RegisterSingleModule"))
CallService("DBEditorpp/RegisterSingleModule",(WPARAM)META_PROTO,0);
-
hHooks[11] = (HANDLE)HookEvent(ME_CLIST_PREBUILDCONTACTMENU, Meta_ModifyMenu);
hHooks[12] = (HANDLE)HookEvent(ME_CLIST_DOUBLECLICKED, Meta_ClistDoubleClicked );
//hHooks[13] = (HANDLE)HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, Meta_CListMW_ExtraIconsRebuild);
@@ -1307,56 +1305,60 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) // (BUT, the me_clist_extra_list_rebuild is send FIRST...so, we ignore this one...)
hHooks[15] = 0;//(HANDLE)HookEvent(ME_SKIN_ICONSCHANGED, Meta_LoadIcons);
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL;
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_ALL;
// main menu item
- menu.pszName = "Toggle MetaContacts Off";
- menu.pszService = "MetaContacts/OnOff";
- menu.position = 500010000;
- hMenuOnOff = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+ mi.pszName = "Toggle MetaContacts Off";
+ mi.pszService = "MetaContacts/OnOff";
+ mi.position = 500010000;
+ hMenuOnOff = Menu_AddMainMenuItem(&mi);
// contact menu items
- menu.position = -200010;
- menu.pszName = "Convert to MetaContact";
- menu.pszService = "MetaContacts/Convert";
- hMenuConvert = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
- menu.position = -200009;
- menu.pszName = "Add to existing MetaContact...";
- menu.pszService = "MetaContacts/AddTo";
- hMenuAdd = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
-
- menu.position = -200010;
- menu.pszName = "Edit MetaContact...";
- menu.pszService = "MetaContacts/Edit";
- hMenuEdit = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
- menu.position = -200009;
- menu.pszName = "Set as MetaContact default";
- menu.pszService = "MetaContacts/Default";
- hMenuDefault = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
- menu.position = -200008;
- menu.pszName = "Delete MetaContact";
- menu.pszService = "MetaContacts/Delete";
- hMenuDelete = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
- //menu.pszName = "Force Default";
- //menu.pszService = "MetaContacts/ForceDefault";
- //hMenuForceDefault = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
-
- menu.flags |= CMIF_HIDDEN;
- menu.pszContactOwner = META_PROTO;
-
- menu.position = -99000;
- for(i = 0; i < MAX_CONTACTS; i++) {
- menu.position--;
+ mi.position = -200010;
+ mi.pszName = "Convert to MetaContact";
+ mi.pszService = "MetaContacts/Convert";
+ hMenuConvert = Menu_AddContactMenuItem(&mi);
+
+ mi.position = -200009;
+ mi.pszName = "Add to existing MetaContact...";
+ mi.pszService = "MetaContacts/AddTo";
+ hMenuAdd = Menu_AddContactMenuItem(&mi);
+
+ mi.position = -200010;
+ mi.pszName = "Edit MetaContact...";
+ mi.pszService = "MetaContacts/Edit";
+ hMenuEdit = Menu_AddContactMenuItem(&mi);
+
+ mi.position = -200009;
+ mi.pszName = "Set as MetaContact default";
+ mi.pszService = "MetaContacts/Default";
+ hMenuDefault = Menu_AddContactMenuItem(&mi);
+
+ mi.position = -200008;
+ mi.pszName = "Delete MetaContact";
+ mi.pszService = "MetaContacts/Delete";
+ hMenuDelete = Menu_AddContactMenuItem(&mi);
+
+ //mi.pszName = "Force Default";
+ //mi.pszService = "MetaContacts/ForceDefault";
+ //hMenuForceDefault = Menu_AddContactMenuItem(&mi);
+
+ mi.flags |= CMIF_HIDDEN;
+ mi.pszContactOwner = META_PROTO;
+
+ mi.position = -99000;
+ for (i = 0; i < MAX_CONTACTS; i++) {
+ mi.position--;
strcpy(buffer3, (char *)Translate("Context"));
strcat(buffer3, _itoa(i, buffer2, 10));
- menu.pszName = buffer3;
+ mi.pszName = buffer3;
strcpy(buffer, "MetaContacts/MenuFunc");
strcat(buffer, _itoa(i, buffer2, 10));
- menu.pszService= buffer;
+ mi.pszService= buffer;
- hMenuContact[i] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
+ hMenuContact[i] = Menu_AddContactMenuItem(&mi);
}
nextMetaID = DBGetContactSettingDword(NULL,META_PROTO,"NextMetaID",(DWORD)0);
@@ -1365,7 +1367,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) //hHooks[] = (HANDLE)HookEvent(ME_USERINFO_INITIALISE, Meta_UserInfo);
// loop and copy data from subcontacts
- if(options.copydata) {
+ if (options.copydata) {
HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
int meta_id;
while ( hContact != NULL ) {
@@ -1383,9 +1385,9 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) if (!Meta_IsEnabled())
{
// modify main menu item
- menu.flags = CMIM_NAME;
- menu.pszName = "Toggle MetaContacts On";
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&menu);
+ mi.flags = CMIM_NAME;
+ mi.pszName = "Toggle MetaContacts On";
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
Meta_HideMetaContacts(TRUE);
} else {
@@ -1394,7 +1396,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) // hook srmm window close/open events - message api ver 0.0.0.1+
hHooks[16] = (HANDLE)HookEvent(ME_MSG_WINDOWEVENT, Meta_MessageWindowEvent);
- if(hHooks[16]) // message api available
+ if (hHooks[16]) // message api available
message_window_api_enabled = TRUE;
// hook protocol nudge events to forward to subcontacts
@@ -1404,16 +1406,16 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) HANDLE hNudgeEvent = NULL;
PROTOCOLDESCRIPTOR ** ppProtocolDescriptors;
ret = CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM) &numberOfProtocols,(LPARAM)&ppProtocolDescriptors);
- if(ret == 0)
+ if (ret == 0)
{
- for(i = 0; i < numberOfProtocols ; i++)
+ for (i = 0; i < numberOfProtocols ; i++)
{
- if(ppProtocolDescriptors[i]->type == PROTOTYPE_PROTOCOL)
+ if (ppProtocolDescriptors[i]->type == PROTOTYPE_PROTOCOL)
{
- if(strcmp(ppProtocolDescriptors[i]->szName, META_PROTO)) {
+ if (strcmp(ppProtocolDescriptors[i]->szName, META_PROTO)) {
sprintf(str,"%s/Nudge",ppProtocolDescriptors[i]->szName);
hNudgeEvent = HookEvent(str, NudgeRecieved);
- if(hNudgeEvent != NULL) {
+ if (hNudgeEvent != NULL) {
++iNudgeProtos;
hNudgeEvents = realloc(hNudgeEvents, sizeof(HANDLE) * iNudgeProtos);
hNudgeEvents[iNudgeProtos - 1] = hNudgeEvent;
@@ -1449,7 +1451,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam) { HANDLE hContact;
hContact = Meta_GetContactHandle((HANDLE)wParam, (int)lParam);
- if(options.menu_function == FT_MSG) {
+ if (options.menu_function == FT_MSG) {
// open message window if protocol supports message sending or chat, else simulate double click
int caps;
@@ -1458,7 +1460,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam) { proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(proto) {
+ if (proto) {
strcpy(buffer, proto);
strcat(buffer, PS_GETCAPS);
@@ -1476,10 +1478,10 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam) { // protocol does not support messaging - simulate double click
CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)hContact, 0);
- } else if(options.menu_function == FT_MENU) {
+ } else if (options.menu_function == FT_MENU) {
// show contact's context menu
CallFunctionAsync(sttMenuThread, hContact);
- } else if(options.menu_function == FT_INFO) {
+ } else if (options.menu_function == FT_INFO) {
// show user info for subcontact
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
}
@@ -1497,7 +1499,7 @@ INT_PTR Meta_FileResume(WPARAM wParam, LPARAM lParam) CCSDATA *ccs = (CCSDATA *) lParam;
char *proto = 0;
- if(DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
+ if (DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1534,7 +1536,7 @@ INT_PTR Meta_FileAllow(WPARAM wParam, LPARAM lParam) CCSDATA *ccs = (CCSDATA *) lParam;
char *proto = 0;
- if(DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
+ if (DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1570,7 +1572,7 @@ INT_PTR Meta_FileDeny(WPARAM wParam, LPARAM lParam) CCSDATA *ccs = (CCSDATA *) lParam;
char *proto = 0;
- if(DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
+ if (DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1607,7 +1609,7 @@ INT_PTR Meta_FileRecv(WPARAM wParam, LPARAM lParam) CCSDATA *ccs = (CCSDATA *) lParam;
char *proto = 0;
- if(DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
+ if (DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1645,7 +1647,7 @@ int Meta_FileCancel(WPARAM wParam, LPARAM lParam) CCSDATA *ccs = (CCSDATA *) lParam;
char *proto = 0;
- if(DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
+ if (DBGetContactSetting(ccs->hContact,META_PROTO,"Default",&dbv))
{
// This is a simple contact
// (this should normally not happen, since linked contacts do not appear on the list.)
@@ -1706,7 +1708,7 @@ INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam) proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
//Meta_CopyContactNick(ccs->hContact, most_online, proto);
- if(proto) {
+ if (proto) {
//ccs->hContact = most_online;
//Meta_SetNick(proto);
@@ -1892,25 +1894,25 @@ int Meta_CallMostOnline(WPARAM wParam, LPARAM lParam) { INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam) {
- CLISTMENUITEM menu;
- menu.cbSize = sizeof(CLISTMENUITEM);
+ CLISTMENUITEM mi;
+ mi.cbSize = sizeof(CLISTMENUITEM);
// just write to db - the rest is handled in the Meta_SettingChanged function
- if(DBGetContactSettingByte(0, META_PROTO, "Enabled", 1)) {
+ if (DBGetContactSettingByte(0, META_PROTO, "Enabled", 1)) {
DBWriteContactSettingByte(0, META_PROTO, "Enabled", 0);
- // modify main menu item
- menu.flags = CMIM_NAME | CMIM_ICON;
- menu.hIcon = LoadIconEx(I_MENU);
- menu.pszName = "Toggle MetaContacts On";
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&menu);
+ // modify main mi item
+ mi.flags = CMIM_NAME | CMIM_ICON;
+ mi.hIcon = LoadIconEx(I_MENU);
+ mi.pszName = "Toggle MetaContacts On";
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
} else {
DBWriteContactSettingByte(0, META_PROTO, "Enabled", 1);
- // modify main menu item
- menu.flags = CMIM_NAME | CMIM_ICON;
- menu.hIcon = LoadIconEx(I_MENUOFF);
- menu.pszName = "Toggle MetaContacts Off";
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&menu);
+ // modify main mi item
+ mi.flags = CMIM_NAME | CMIM_ICON;
+ mi.hIcon = LoadIconEx(I_MENUOFF);
+ mi.pszName = "Toggle MetaContacts Off";
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuOnOff, (LPARAM)&mi);
}
- ReleaseIconEx(menu.hIcon);
+ ReleaseIconEx(mi.hIcon);
return 0;
}
@@ -1924,7 +1926,7 @@ int Meta_PreShutdown(WPARAM wParam, LPARAM lParam) { //MessageBox(0, "Status is OFFLINE", "MC", MB_OK);
//MessageBox(0, "Preshutdown complete", "MC", MB_OK);
- if(setStatusTimerId) KillTimer(0, setStatusTimerId);
+ if (setStatusTimerId) KillTimer(0, setStatusTimerId);
return 0;
}
@@ -1949,9 +1951,9 @@ void Meta_InitServices() previousMode = mcStatus = ID_STATUS_OFFLINE;
// set hooks pointers and services pointers to zero - in case we do not initialize them all correctly
- for(i=0;i<NB_HOOKS;i++)
+ for (i=0;i<NB_HOOKS;i++)
hHooks[i] = 0;
- for(i=0;i<NB_SERVICES;i++)
+ for (i=0;i<NB_SERVICES;i++)
hServices[i] = 0;
hServices[0] = CreateServiceFunction("MetaContacts/Convert",Meta_Convert);
@@ -2077,17 +2079,17 @@ void Meta_CloseHandles() {
int i;
- for(i=0;i<iNudgeProtos;i++) // Idem for the hooks.
+ for (i=0;i<iNudgeProtos;i++) // Idem for the hooks.
{
UnhookEvent(hNudgeEvents[i]);
}
free(hNudgeEvents);
iNudgeProtos = 0;
- for(i=0;i<NB_HOOKS;i++) // Idem for the hooks.
- if(hHooks[i]) UnhookEvent(hHooks[i]);
+ for (i=0;i<NB_HOOKS;i++) // Idem for the hooks.
+ if (hHooks[i]) UnhookEvent(hHooks[i]);
- if(ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
+ if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
proto_count = 0;
}
@@ -2099,8 +2101,8 @@ void Meta_CloseHandles() DestroyHookableEvent(hEventNudge);
// lets leave them, hey? (why?)
- for(i=0;i<NB_SERVICES;i++) // Scan each 'HANDLE' and Destroy the service attached to it.
- if(hServices[i]) DestroyServiceFunction(hServices[i]);
+ for (i=0;i<NB_SERVICES;i++) // Scan each 'HANDLE' and Destroy the service attached to it.
+ if (hServices[i]) DestroyServiceFunction(hServices[i]);
DeinitIcons();
}
diff --git a/plugins/MetaContacts/meta_utils.c b/plugins/MetaContacts/meta_utils.c index ccee31e2a5..9fa350497f 100644 --- a/plugins/MetaContacts/meta_utils.c +++ b/plugins/MetaContacts/meta_utils.c @@ -43,7 +43,7 @@ INT_PTR MyDBGetContactSetting(HANDLE hContact, const char *szModule, const char if (!strsvcset) {strsvc = ServiceExists(MS_DB_CONTACT_GETSETTING_STR); strsvcset = TRUE;}
// preserve unicode strings - this service should return other data types unchanged
- if(strsvc) return DBGetContactSettingW(hContact, szModule, szSetting, dbv);
+ if (strsvc) return DBGetContactSettingW(hContact, szModule, szSetting, dbv);
return DBGetContactSetting(hContact, szModule, szSetting, dbv);
}
@@ -51,7 +51,7 @@ INT_PTR MyDBGetContactSetting(HANDLE hContact, const char *szModule, const char int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id) {
DWORD res = 1;
int i;
- if(dbv->type == id->type)
+ if (dbv->type == id->type)
{ // If the id parameter and the value returned by the DBGetContactSetting
// are the same, this is the correct HANDLE, return it.
switch(dbv->type)
@@ -59,13 +59,13 @@ int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id) { case DBVT_DELETED:
return 1;
case DBVT_BYTE:
- if(dbv->bVal == id->bVal)
+ if (dbv->bVal == id->bVal)
return 1;
case DBVT_WORD:
- if(dbv->wVal == id->wVal)
+ if (dbv->wVal == id->wVal)
return 1;
case DBVT_DWORD:
- if(dbv->dVal == id->dVal)
+ if (dbv->dVal == id->dVal)
return 1;
break;
case DBVT_ASCIIZ:
@@ -76,18 +76,18 @@ int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id) { if (!wcscmp(dbv->pwszVal,id->pwszVal))
return 1;
case DBVT_BLOB:
- if(dbv->cpbVal == id->cpbVal)
+ if (dbv->cpbVal == id->cpbVal)
{
- for(i=dbv->cpbVal;res && i<=0;i--)
+ for (i=dbv->cpbVal;res && i<=0;i--)
res = (dbv->pbVal[i] == id->pbVal[i]);
- if(res)
+ if (res)
{
return 1;
}
}
break;
} // end switch
- } // end if(dbv.type == id.type)
+ } // end if (dbv.type == id.type)
return 0;
}
@@ -119,7 +119,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id) { // Scan the database and retrieve the field for each contact
if (!DBGetContactSetting(hUser,protocol,field,&dbv))
{
- if(dbv.type == id->type)
+ if (dbv.type == id->type)
{ // If the id parameter and the value returned by the DBGetContactSetting
// are the same, this is the correct HANDLE, return it.
switch(dbv.type)
@@ -127,15 +127,15 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id) case DBVT_DELETED:
break;
case DBVT_BYTE:
- if(dbv.bVal == id->bVal)
+ if (dbv.bVal == id->bVal)
return hUser;
break;
case DBVT_WORD:
- if(dbv.wVal == id->wVal)
+ if (dbv.wVal == id->wVal)
return hUser;
break;
case DBVT_DWORD:
- if(dbv.dVal == id->dVal)
+ if (dbv.dVal == id->dVal)
return hUser;
break;
case DBVT_ASCIIZ:
@@ -162,11 +162,11 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id) break;
}
case DBVT_BLOB:
- if(dbv.cpbVal == id->cpbVal)
+ if (dbv.cpbVal == id->cpbVal)
{
- for(i=dbv.cpbVal;res && i<=0;i--)
+ for (i=dbv.cpbVal;res && i<=0;i--)
res = (dbv.pbVal[i] == id->pbVal[i]);
- if(res)
+ if (res)
{
DBFreeVariant(&dbv);
return hUser;
@@ -201,29 +201,29 @@ int Meta_SetNick(char *proto) ci.dwFlag = CNF_DISPLAY;
ci.hContact = NULL;
ci.szProto = proto;
- if(CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci))
+ if (CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci))
return 1;
switch(ci.type)
{
case CNFT_BYTE:
- if(DBWriteContactSettingByte(NULL,META_PROTO,"Nick",ci.bVal))
+ if (DBWriteContactSettingByte(NULL,META_PROTO,"Nick",ci.bVal))
return 1;
break;
case CNFT_WORD:
- if(DBWriteContactSettingWord(NULL,META_PROTO,"Nick",ci.wVal))
+ if (DBWriteContactSettingWord(NULL,META_PROTO,"Nick",ci.wVal))
return 1;
break;
case CNFT_DWORD:
- if(DBWriteContactSettingDword(NULL,META_PROTO,"Nick",ci.dVal))
+ if (DBWriteContactSettingDword(NULL,META_PROTO,"Nick",ci.dVal))
return 1;
break;
case CNFT_ASCIIZ:
- if(DBWriteContactSettingString(NULL,META_PROTO,"Nick",ci.pszVal))
+ if (DBWriteContactSettingString(NULL,META_PROTO,"Nick",ci.pszVal))
return 1;
mir_free(ci.pszVal);
break;
default:
- if(DBWriteContactSettingString(NULL,META_PROTO,"Nick",(char *)Translate("Sender")))
+ if (DBWriteContactSettingString(NULL,META_PROTO,"Nick",(char *)Translate("Sender")))
return 1;
break;
}
@@ -264,20 +264,20 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) // Get the login of the subcontact
field = (char *)CallProtoService(proto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
- if(DBGetContactSetting(src,proto,field,&cws.value)) {
+ if (DBGetContactSetting(src,proto,field,&cws.value)) {
MessageBox(0, Translate("Could not get unique id of contact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
// Check that is is 'on the list'
- if(DBGetContactSettingByte(src, "CList", "NotOnList", 0) == 1) {
+ if (DBGetContactSettingByte(src, "CList", "NotOnList", 0) == 1) {
MessageBox(0, Translate("Contact is 'Not on List' - please add the contact to your contact list before assigning."), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
DBFreeVariant(&cws.value);
return FALSE;
}
num_contacts++;
- if(num_contacts >= MAX_CONTACTS) {
+ if (num_contacts >= MAX_CONTACTS) {
MessageBox(0, Translate("MetaContact is full"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
DBFreeVariant(&cws.value);
return FALSE;
@@ -287,7 +287,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) strcpy(buffer, "Protocol");
strcat(buffer, _itoa((int)(num_contacts -1), buffer2, 10));
- if(DBWriteContactSettingString(dest, META_PROTO, buffer, proto)) {
+ if (DBWriteContactSettingString(dest, META_PROTO, buffer, proto)) {
MessageBox(0, Translate("Could not write contact protocol to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
DBFreeVariant(&cws.value);
return FALSE;
@@ -300,7 +300,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) cws.szModule=META_PROTO;
cws.szSetting=buffer;
- if(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)dest,(LPARAM)&cws)) {
+ if (CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)dest,(LPARAM)&cws)) {
MessageBox(0, Translate("Could not write unique id of contact to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
DBFreeVariant(&cws.value);
return FALSE;
@@ -317,7 +317,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) cws.szModule=META_PROTO;
cws.szSetting=buffer;
- if(CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)dest,(LPARAM)&cws)) {
+ if (CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)dest,(LPARAM)&cws)) {
MessageBox(0, Translate("Could not write nickname of contact to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
@@ -334,7 +334,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) strcpy(buffer, "CListName");
strcat(buffer, _itoa((int)(num_contacts - 1), buffer2, 10));
- if(wname && strncmp(name, (char *)wname, strlen(name)) != 0) {
+ if (wname && strncmp(name, (char *)wname, strlen(name)) != 0) {
DBWriteContactSettingWString(dest, META_PROTO, buffer, wname);
} else
DBWriteContactSettingString(dest, META_PROTO, buffer, name);
@@ -349,7 +349,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) // write the status
strcpy(buffer, "Status");
strcat(buffer, _itoa((int)(num_contacts - 1), buffer2, 10));
- if(DBWriteContactSettingWord(dest, META_PROTO, buffer, status)) {
+ if (DBWriteContactSettingWord(dest, META_PROTO, buffer, status)) {
MessageBox(0, Translate("Could not write contact status to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
@@ -357,7 +357,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) // write the handle
strcpy(buffer, "Handle");
strcat(buffer, _itoa((int)(num_contacts - 1), buffer2, 10));
- if(DBWriteContactSettingDword(dest, META_PROTO, buffer, (DWORD)src)) {
+ if (DBWriteContactSettingDword(dest, META_PROTO, buffer, (DWORD)src)) {
MessageBox(0, Translate("Could not write contact handle to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
@@ -366,7 +366,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) strcpy(buffer, "StatusString");
strcat(buffer, _itoa((int)(num_contacts - 1), buffer2, 10));
Meta_GetStatusString(status, buffer2, 512);
- if(DBWriteContactSettingString(dest, META_PROTO, buffer, buffer2)) {
+ if (DBWriteContactSettingString(dest, META_PROTO, buffer, buffer2)) {
MessageBox(0, Translate("Could not write contact status string to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
@@ -377,30 +377,30 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) CallService( MS_PROTO_ADDTOCONTACT, (WPARAM)src, ( LPARAM )META_FILTER );
// Write the link in the contact
- if(DBWriteContactSettingDword(src,META_PROTO,META_LINK,metaID)) {
+ if (DBWriteContactSettingDword(src,META_PROTO,META_LINK,metaID)) {
MessageBox(0, Translate("Could not write MetaContact id to contact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
// Write the contact number in the contact
- if(DBWriteContactSettingDword(src,META_PROTO,"ContactNumber",(DWORD)(num_contacts - 1))) {
+ if (DBWriteContactSettingDword(src,META_PROTO,"ContactNumber",(DWORD)(num_contacts - 1))) {
MessageBox(0, Translate("Could not write MetaContact contact number to contact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
// Write the handle in the contact
- if(DBWriteContactSettingDword(src,META_PROTO,"Handle",(DWORD)dest)) {
+ if (DBWriteContactSettingDword(src,META_PROTO,"Handle",(DWORD)dest)) {
MessageBox(0, Translate("Could not write MetaContact contact number to contact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
// update count of contacts
- if(DBWriteContactSettingDword(dest,META_PROTO,"NumContacts",num_contacts)) {
+ if (DBWriteContactSettingDword(dest,META_PROTO,"NumContacts",num_contacts)) {
MessageBox(0, Translate("Could not write contact count to MetaContact"), Translate("Assignment Error"), MB_OK | MB_ICONWARNING);
return FALSE;
}
- if(set_as_default) {
+ if (set_as_default) {
DBWriteContactSettingDword(dest, META_PROTO, "Default", (WORD)(num_contacts - 1));
NotifyEventHooks(hEventDefaultChanged, (WPARAM)dest, (LPARAM)src);
}
@@ -415,7 +415,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) // if the new contact is the most online contact with avatar support, get avatar info
most_online = Meta_GetMostOnlineSupporting(dest, PFLAGNUM_4, PF4_AVATARS);
- if(most_online == src) {
+ if (most_online == src) {
PROTO_AVATAR_INFORMATION AI;
AI.cbSize = sizeof(AI);
@@ -431,11 +431,11 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) Meta_SetGroup(src);
// copy history
- if(options.copy_subcontact_history)
+ if (options.copy_subcontact_history)
copyHistory(src, dest);
// Ignore status if the option is on
- if(options.suppress_status)
+ if (options.suppress_status)
CallService(MS_IGNORE_IGNORE, (WPARAM)src, (WPARAM)IGNOREEVENT_USERONLINE);
// copy other data
@@ -477,36 +477,36 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca }
// if the default is beyond the end of the list (eek!) return null
- if(default_contact_number >= (num_contacts = DBGetContactSettingDword(hMeta, META_PROTO, "NumContacts", 0)))
+ if (default_contact_number >= (num_contacts = DBGetContactSettingDword(hMeta, META_PROTO, "NumContacts", 0)))
return NULL;
most_online_contact = Meta_GetContactHandle(hMeta, default_contact_number);
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online_contact, 0);
caps = proto ? CallProtoService(proto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
- if(proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
+ if (proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
// we are forced to do use default for sending - '-1' capability indicates no specific capability, but respect 'Force Default'
- if(proto && DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0) && capability != 0 && (capability == -1 || (caps & capability) == capability)) // capability is 0 when we're working out status
+ if (proto && DBGetContactSettingByte(hMeta, META_PROTO, "ForceDefault", 0) && capability != 0 && (capability == -1 || (caps & capability) == capability)) // capability is 0 when we're working out status
return most_online_contact;
// a subcontact is being temporarily 'forced' to do sending
if ((most_online_contact = (HANDLE)DBGetContactSettingDword(hMeta, META_PROTO, "ForceSend", 0))) {
caps = proto ? CallProtoService(proto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
- if(proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
- if(proto && (caps & capability) == capability && capability != 0) // capability is 0 when we're working out status
+ if (proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
+ if (proto && (caps & capability) == capability && capability != 0) // capability is 0 when we're working out status
return most_online_contact;
}
most_online_contact = Meta_GetContactHandle(hMeta, default_contact_number);
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online_contact, 0);
- if(proto && CallProtoService(proto, PS_GETSTATUS, 0, 0) >= ID_STATUS_ONLINE) {
+ if (proto && CallProtoService(proto, PS_GETSTATUS, 0, 0) >= ID_STATUS_ONLINE) {
caps = proto ? CallProtoService(proto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
- if(proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
- if(proto && (capability == -1 || (caps & capability) == capability)) {
+ if (proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
+ if (proto && (capability == -1 || (caps & capability) == capability)) {
most_online_status = DBGetContactSettingWord(most_online_contact, proto, "Status", ID_STATUS_OFFLINE);
// if our default is not offline, and option to use default is set - return default
// and also if our default is online, return it
- if(most_online_status == ID_STATUS_ONLINE || (most_online_status != ID_STATUS_OFFLINE && options.always_use_default)) {
+ if (most_online_status == ID_STATUS_ONLINE || (most_online_status != ID_STATUS_OFFLINE && options.always_use_default)) {
return most_online_contact;
}
} else
@@ -516,8 +516,8 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca most_online_proto = proto;
// otherwise, check all the subcontacts for the one closest to the ONLINE state which supports the required capability
- for(i = 0; i < num_contacts; i++) {
- if(i == default_contact_number) // already checked that (i.e. initial value of most_online_contact and most_online_status are those of the default contact)
+ for (i = 0; i < num_contacts; i++) {
+ if (i == default_contact_number) // already checked that (i.e. initial value of most_online_contact and most_online_status are those of the default contact)
continue;
hContact = Meta_GetContactHandle(hMeta, i);
@@ -527,19 +527,19 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca continue;
caps = proto ? CallProtoService(proto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
- if(proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
- if(proto && (capability == -1 || (caps & capability) == capability)) {
+ if (proto && strcmp(proto, "IRC") == 0) caps |= PF1_IM;
+ if (proto && (capability == -1 || (caps & capability) == capability)) {
status = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
- if(status == ID_STATUS_ONLINE) {
+ if (status == ID_STATUS_ONLINE) {
most_online_contact = hContact;
most_online_proto = proto;
return most_online_contact;
- } else if(status <= ID_STATUS_OFFLINE) // status below ID_STATUS_OFFLINE is a connecting status
+ } else if (status <= ID_STATUS_OFFLINE) // status below ID_STATUS_OFFLINE is a connecting status
continue;
else {
- if(GetRealPriority(proto, status) < GetRealPriority(most_online_proto, most_online_status)) {
+ if (GetRealPriority(proto, status) < GetRealPriority(most_online_proto, most_online_status)) {
most_online_status = status;
most_online_contact = hContact;
most_online_proto = proto;
@@ -549,9 +549,9 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca }
// no online contacts? if we're trying to message, use 'send offline' contact
- if(most_online_status == ID_STATUS_OFFLINE && capability == PF1_IM) {
+ if (most_online_status == ID_STATUS_OFFLINE && capability == PF1_IM) {
HANDLE hOffline = Meta_GetContactHandle(hMeta, DBGetContactSettingDword(hMeta, META_PROTO, "OfflineSend", (DWORD)-1));
- if(hOffline)
+ if (hOffline)
most_online_contact = hOffline;
}
@@ -563,7 +563,7 @@ int Meta_GetContactNumber(HANDLE hContact) { }
BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) {
- if(dbv1->type != dbv2->type) return FALSE;
+ if (dbv1->type != dbv2->type) return FALSE;
switch(dbv1->type) {
case DBVT_BYTE:
@@ -597,36 +597,36 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) { BOOL use_default = FALSE;
int source_contact = (use_default ? default_contact : most_online);
- if(source_contact < 0 || source_contact >= num_contacts) return;
+ if (source_contact < 0 || source_contact >= num_contacts) return;
- for(i = 0; i < num_settings; i++) {
+ for (i = 0; i < num_settings; i++) {
bDataWritten = FALSE;
- for(j = 0; j < num_contacts && !bDataWritten; j++) {
+ for (j = 0; j < num_contacts && !bDataWritten; j++) {
// do source (most online) first
- if(j == 0)
+ if (j == 0)
hContact = Meta_GetContactHandle(hMeta, source_contact);
- else if(j <= source_contact)
+ else if (j <= source_contact)
hContact = Meta_GetContactHandle(hMeta, j - 1);
else
hContact = Meta_GetContactHandle(hMeta, j);
- if(hContact) {
+ if (hContact) {
if (!module) {
used_mod = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (!used_mod) continue; // next contact
} else
used_mod = module;
- if(j == 0 && strcmp(settings[i], "MirVer") == 0) { //Always reset MirVer
+ if (j == 0 && strcmp(settings[i], "MirVer") == 0) { //Always reset MirVer
DBDeleteContactSetting(hMeta, (module ? used_mod : META_PROTO), settings[i]);
}
got_val = !MyDBGetContactSetting(hContact, used_mod, settings[i], &dbv2);
- if(got_val) {
+ if (got_val) {
free = !MyDBGetContactSetting(hMeta, (module ? used_mod : META_PROTO), settings[i], &dbv1);
- if(strcmp(settings[i], "MirVer") == 0) {
- if(DBGetContactSettingWord(hContact, used_mod, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
+ if (strcmp(settings[i], "MirVer") == 0) {
+ if (DBGetContactSettingWord(hContact, used_mod, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
if (!free || (dbv1.pszVal == NULL || strcmp(dbv1.pszVal, "") == 0 || strlen(dbv1.pszVal) < 2)) {
MyDBWriteContactSetting(hMeta, (module ? used_mod : META_PROTO), settings[i], &dbv2);
bDataWritten = TRUE; //only break if found something to copy
@@ -636,11 +636,11 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) { } else {
if (!free || !dbv_same(&dbv1, &dbv2)) {
MyDBWriteContactSetting(hMeta, (module ? used_mod : META_PROTO), settings[i], &dbv2);
- if(dbv2.type == DBVT_ASCIIZ || dbv2.type == DBVT_UTF8) {
- if(dbv2.pszVal != NULL && strcmp(dbv2.pszVal, "") != 0)
+ if (dbv2.type == DBVT_ASCIIZ || dbv2.type == DBVT_UTF8) {
+ if (dbv2.pszVal != NULL && strcmp(dbv2.pszVal, "") != 0)
bDataWritten = TRUE; //only break if found something to copy
- } else if(dbv2.type == DBVT_WCHAR) {
- if(dbv2.pwszVal != 0 && wcscmp(dbv2.pwszVal, L"") != 0)
+ } else if (dbv2.type == DBVT_WCHAR) {
+ if (dbv2.pwszVal != 0 && wcscmp(dbv2.pwszVal, L"") != 0)
bDataWritten = TRUE; //only break if found something to copy
} else
bDataWritten = TRUE; //only break if found something to copy
@@ -650,7 +650,7 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) { }
DBFreeVariant(&dbv2);
- if(free)DBFreeVariant(&dbv1);
+ if (free)DBFreeVariant(&dbv1);
}
}
}
@@ -695,17 +695,17 @@ void CopyStatusData(HANDLE hMeta) { BOOL bDoneStatus = FALSE, bDoneXStatus = FALSE;
int i;
- for(i = 0; i < num_contacts; i++) {
- if(i == 0)
+ for (i = 0; i < num_contacts; i++) {
+ if (i == 0)
hContact = Meta_GetContactHandle(hMeta, most_online);
- else if(i <= most_online)
+ else if (i <= most_online)
hContact = Meta_GetContactHandle(hMeta, i - 1);
else
hContact = Meta_GetContactHandle(hMeta, i);
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(proto && DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE) == status) {
+ if (proto && DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE) == status) {
if (!bDoneStatus && !MyDBGetContactSetting(hContact, "CList", "StatusMsg", &dbv)) {
MyDBWriteContactSetting(hMeta, "CList", "StatusMsg", &dbv);
DBFreeVariant(&dbv);
@@ -728,7 +728,7 @@ void CopyStatusData(HANDLE hMeta) { }
}
- if(bDoneStatus && bDoneXStatus) break;
+ if (bDoneStatus && bDoneXStatus) break;
}
if (!bDoneStatus) DBDeleteContactSetting(hMeta, "CList", "StatusMsg");
@@ -740,14 +740,14 @@ void CopyStatusData(HANDLE hMeta) { }
void Meta_CopyData(HANDLE hMeta) {
- if(options.copydata) {
+ if (options.copydata) {
CopyStatusData(hMeta);
copy_settings_array(hMeta, 0, ProtoSettings, 25);
copy_settings_array(hMeta, "mBirthday", UserInfoSettings, 3);
copy_settings_array(hMeta, "ContactPhoto", ContactPhotoSettings, 5);
- if(options.copy_userinfo)
+ if (options.copy_userinfo)
copy_settings_array(hMeta, "UserInfo", UserInfoSettings, 71);
}
}
@@ -757,7 +757,7 @@ HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number) { char buffer[512], buffer2[512];
int num_contacts = DBGetContactSettingDword(hMeta, META_PROTO, "NumContacts", 0);
- if(contact_number >= num_contacts || contact_number < 0) return 0;
+ if (contact_number >= num_contacts || contact_number < 0) return 0;
strcpy(buffer, "Handle");
strcat(buffer, _itoa(contact_number, buffer2, 10));
@@ -784,7 +784,7 @@ int Meta_SetHandles(void) { strcat(nick_buffer, ", contact num: ");
strcat(nick_buffer, _itoa(contact_number, buffer2, 10));
- if(contact_number < 0) {
+ if (contact_number < 0) {
// problem!
MessageBox(0, "Subcontact contact number < 0 - deleting MetaContact", nick_buffer, MB_OK | MB_ICONERROR);
//CallService(MS_DB_CONTACT_DELETE, (WPARMA)hContact, 0);
@@ -804,7 +804,7 @@ int Meta_SetHandles(void) { hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact2 != NULL ) {
- if(DBGetContactSettingDword(hContact2,META_PROTO,META_ID,(DWORD)-1) == meta_id) {
+ if (DBGetContactSettingDword(hContact2,META_PROTO,META_ID,(DWORD)-1) == meta_id) {
found = TRUE;
// set handle
@@ -815,7 +815,7 @@ int Meta_SetHandles(void) { (unsigned char)(DBGetContactSettingByte(hContact2, META_PROTO, "ContactCountCheck", 0) + 1));
num_contacts = DBGetContactSettingDword(hContact2, META_PROTO, "NumContacts", (DWORD)-1);
- if(contact_number >= 0 && contact_number < num_contacts) {
+ if (contact_number >= 0 && contact_number < num_contacts) {
// set metacontact's handle to us
strcpy(buffer, "Handle");
strcat(buffer, _itoa((int)contact_number, buffer2, 10));
@@ -851,7 +851,7 @@ int Meta_SetHandles(void) { CallService(MS_PROTO_REMOVEFROMCONTACT, (WPARAM)hContact, (LPARAM)META_FILTER);
// stop ignoring, if we were
- if(options.suppress_status)
+ if (options.suppress_status)
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
} else {
@@ -876,7 +876,7 @@ int Meta_SetHandles(void) { contact_number = DBGetContactSettingDword(hContact, META_PROTO, "Default", -1);
num_contacts = DBGetContactSettingDword(hContact, META_PROTO, "NumContacts", (DWORD)-1);
- if(num_contacts < 0) {
+ if (num_contacts < 0) {
// problem
MessageBox(0, "MetaContact number of contacts < 0 - deleting MetaContact", nick_buffer, MB_OK | MB_ICONERROR);
//CallService(MS_DB_CONTACT_DELETE, (WPARMA)hContact, 0);
@@ -887,7 +887,7 @@ int Meta_SetHandles(void) { //return 1;
}
- if(contact_number < 0 || contact_number >= num_contacts) {
+ if (contact_number < 0 || contact_number >= num_contacts) {
// problem
MessageBox(0, "MetaContact default contact number out of range - deleting MetaContact", nick_buffer, MB_OK | MB_ICONERROR);
hNextContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
@@ -911,9 +911,9 @@ int Meta_SetHandles(void) { strcat(nick_buffer, _itoa(meta_id, buffer2, 10));
num_contacts = DBGetContactSettingByte(hContact, META_PROTO, "ContactCountCheck", -2);
- if(num_contacts != (DWORD)DBGetContactSettingDword(hContact, META_PROTO, "NumContacts", (DWORD)-1)) {
+ if (num_contacts != (DWORD)DBGetContactSettingDword(hContact, META_PROTO, "NumContacts", (DWORD)-1)) {
// mismatch
- //if(MessageBox(0, Translate("MetaContact corrupted - the number of subcontacts is incorrect.\nDelete MetaContact?"), nick_buffer, MB_YESNO | MB_ICONERROR) == IDYES) {
+ //if (MessageBox(0, Translate("MetaContact corrupted - the number of subcontacts is incorrect.\nDelete MetaContact?"), nick_buffer, MB_YESNO | MB_ICONERROR) == IDYES) {
// Meta_Delete((WPARAM)hContact, (LPARAM)1); // second param prevents confirm dialog
//} else
// return 1;
@@ -950,7 +950,7 @@ int Meta_HideLinkedContacts(void) { // (sometimes protocol server side groups are to blame - msn and icq)
if (!meta_group_hack_disabled) do {
group_name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0);
- if(group_name && !strcmp(group_name, META_HIDDEN_GROUP)) {
+ if (group_name && !strcmp(group_name, META_HIDDEN_GROUP)) {
// disabled because it shows a message box
//CallService(MS_CLIST_GROUPDELETE, (WPARAM)hGroup, 0);
MessageBox(0, Translate("The 'MetaContacts Hidden Group' has been added to your contact list.\n"
@@ -988,9 +988,9 @@ int Meta_HideLinkedContacts(void) { hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact2 != NULL ) {
- if(DBGetContactSettingDword(hContact2,META_PROTO,META_ID,(DWORD)-1) == meta_id) {
+ if (DBGetContactSettingDword(hContact2,META_PROTO,META_ID,(DWORD)-1) == meta_id) {
num_contacts = DBGetContactSettingDword(hContact2, META_PROTO, "NumContacts", (DWORD)-1);
- if(contact_number >= 0 && contact_number < num_contacts) {
+ if (contact_number >= 0 && contact_number < num_contacts) {
if (!proto)
status = ID_STATUS_OFFLINE;
@@ -1003,14 +1003,14 @@ int Meta_HideLinkedContacts(void) { DBWriteContactSettingWord(hContact2, META_PROTO, buffer, status);
// update metacontact's record of nick for this contact
- if(proto && !DBGetContactSetting(hContact, proto, "Nick", &dbv)) {
+ if (proto && !DBGetContactSetting(hContact, proto, "Nick", &dbv)) {
strcpy(buffer, "Nick");
strcat(buffer, _itoa(contact_number, buffer2, 10));
MyDBWriteContactSetting(hContact2, META_PROTO, buffer, &dbv);
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, buffer2, 10));
- if(DBGetContactSetting(hContact, "CList", "MyHandle", &dbv2)) {
+ if (DBGetContactSetting(hContact, "CList", "MyHandle", &dbv2)) {
MyDBWriteContactSetting(hContact2, META_PROTO, buffer, &dbv);
} else {
MyDBWriteContactSetting(hContact2, META_PROTO, buffer, &dbv2);
@@ -1032,7 +1032,7 @@ int Meta_HideLinkedContacts(void) { hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact2, 0 );
}
- if(options.suppress_status)
+ if (options.suppress_status)
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
@@ -1042,7 +1042,7 @@ int Meta_HideLinkedContacts(void) { // do metacontacts after handles set properly above
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
- if(DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
+ if (DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
HANDLE hMostOnline = Meta_GetMostOnline(hContact); // set nick
Meta_CopyContactNick(hContact, hMostOnline);
@@ -1065,7 +1065,7 @@ int Meta_UnhideLinkedContacts(void) { HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
- if(DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
// has a link - unhide it
// restore old group
Meta_RestoreGroup(hContact);
@@ -1083,21 +1083,21 @@ int Meta_HideMetaContacts(int hide) { HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
// set status suppression
- if(hide) Meta_SuppressStatus(FALSE);
+ if (hide) Meta_SuppressStatus(FALSE);
else Meta_SuppressStatus(options.suppress_status);
while ( hContact != NULL ) {
- if(DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
+ if (DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
- if(hide)
+ if (hide)
DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
else
DBDeleteContactSetting(hContact, "CList", "Hidden");
- } else if(DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ } else if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
// when metacontacts are hidden, show subcontacts, and vice versa
- if(hide) {
+ if (hide) {
Meta_RestoreGroup(hContact);
} else {
Meta_SetGroup(hContact);
@@ -1114,16 +1114,16 @@ int Meta_HideMetaContacts(int hide) { void Meta_RestoreGroup(HANDLE hContact) {
- if(meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
+ if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
// the existence of this service means that clist_meta_mw is active and will do the hiding for us
- if(ServiceExists(MS_CLUI_METASUPPORT)) return;
+ if (ServiceExists(MS_CLUI_METASUPPORT)) return;
// show it anyway - users are reporting contacts removed from meta remain 'hidden'
// possible suspect - server side groups cause hidden group hack to fail, users hide contacts via clist->delete->hide option
DBDeleteContactSetting(hContact, META_PROTO, "Hidden");
- if(DBGetContactSettingByte(hContact, META_PROTO, "Hidden", 0) == 1)
+ if (DBGetContactSettingByte(hContact, META_PROTO, "Hidden", 0) == 1)
{
// if we hid it, unhide it
DBDeleteContactSetting(hContact, META_PROTO, "Hidden");
@@ -1141,14 +1141,14 @@ void Meta_RestoreGroup(HANDLE hContact) { BOOL found = FALSE;
do {
name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0);
- if(name && !strcmp(name, cws.value.pszVal)) {
+ if (name && !strcmp(name, cws.value.pszVal)) {
found = TRUE;
break;
}
hGroup++;
} while(name);
- if(found) {
+ if (found) {
cws.szModule = "CList";
cws.szSetting = "Group";
CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
@@ -1157,7 +1157,7 @@ void Meta_RestoreGroup(HANDLE hContact) { // put back into metacontact's group
DBVARIANT dbv;
HANDLE hMeta = (HANDLE)DBGetContactSettingDword(hContact, META_PROTO, "Handle", 0);
- if(hMeta && !MyDBGetContactSetting(hMeta, "CList", "Group", &dbv)) {
+ if (hMeta && !MyDBGetContactSetting(hMeta, "CList", "Group", &dbv)) {
MyDBWriteContactSetting(hContact, "CList", "Group", &dbv);
DBFreeVariant(&dbv);
} else
@@ -1184,16 +1184,16 @@ void Meta_RestoreGroup(HANDLE hContact) { void Meta_SetGroup(HANDLE hContact) {
char *proto, *uid;
- if(meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
+ if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
// the existence of this service means that clist_meta_mw is active and will do the hiding for us
- if(ServiceExists(MS_CLUI_METASUPPORT)) return;
+ if (ServiceExists(MS_CLUI_METASUPPORT)) return;
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (proto)
uid = (char *)CallProtoService(proto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if(proto && uid && (INT_PTR)uid != CALLSERVICE_NOTFOUND && !strcmp(JABBER_UNIQUE_ID_SETTING, uid)) {
+ if (proto && uid && (INT_PTR)uid != CALLSERVICE_NOTFOUND && !strcmp(JABBER_UNIQUE_ID_SETTING, uid)) {
// if it's a jabber contact, hide it, and record the fact that it was us who did
DBWriteContactSettingByte(hContact, META_PROTO, "Hidden", 1);
DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
@@ -1261,9 +1261,9 @@ int Meta_SuppressStatus(BOOL suppress) { HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
- if(DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
// is a subcontact
- if(suppress)
+ if (suppress)
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
else
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
@@ -1279,7 +1279,7 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) { DBVARIANT dbv, dbv_proto;
char *proto;
- if(options.lockHandle) {
+ if (options.lockHandle) {
hContact = Meta_GetContactHandle(hMeta, 0);
}
@@ -1290,7 +1290,7 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) { if (!DBGetContactSetting(hContact, "Protocol", "p", &dbv_proto)) {
proto = dbv_proto.pszVal;
- if(options.clist_contact_name == CNNT_NICK && proto) {
+ if (options.clist_contact_name == CNNT_NICK && proto) {
if (!MyDBGetContactSetting(hContact, proto, "Nick", &dbv)) {
MyDBWriteContactSetting(hMeta, META_PROTO, "Nick", &dbv);
DBFreeVariant(&dbv);
@@ -1299,12 +1299,12 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) { DBFreeVariant(&dbv_proto);
return 0;
}
- } else if(options.clist_contact_name == CNNT_DISPLAYNAME) {
+ } else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
char *name = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0);
wchar_t *wname = (wchar_t *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_UNICODE);
- if(name && strcmp(name, Translate("(Unknown Contact)")) != 0) {
- if(wname && strncmp(name, (char *)wname, strlen(name)) != 0) {
+ if (name && strcmp(name, Translate("(Unknown Contact)")) != 0) {
+ if (wname && strncmp(name, (char *)wname, strlen(name)) != 0) {
DBVARIANT dbv;
dbv.pwszVal = wname;
dbv.type = DBVT_WCHAR;
@@ -1327,7 +1327,7 @@ int Meta_SetAllNicks() { HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ), most_online;
while ( hContact != NULL ) {
- if(DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
+ if (DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
most_online = Meta_GetMostOnline(hContact);
Meta_CopyContactNick(hContact, most_online);
Meta_FixStatus(hContact);
@@ -1340,7 +1340,7 @@ int Meta_SetAllNicks() { }
int Meta_IsHiddenGroup(const char *group_name) {
- if(group_name && !strcmp(group_name, META_HIDDEN_GROUP)) return 1;
+ if (group_name && !strcmp(group_name, META_HIDDEN_GROUP)) return 1;
return 0;
}
@@ -1360,11 +1360,11 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok2 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
}
- if(ok2) {
+ if (ok2) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
}
@@ -1376,11 +1376,11 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
}
- if(ok2) {
+ if (ok2) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
}
@@ -1392,11 +1392,11 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok2 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
}
- if(ok2) {
+ if (ok2) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
}
@@ -1408,12 +1408,12 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok2 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
DBDeleteContactSetting(hMeta, META_PROTO, buff2);
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
}
- if(ok2) {
+ if (ok2) {
DBDeleteContactSetting(hMeta, META_PROTO, buff1);
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
@@ -1426,13 +1426,13 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok2 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
} else {
DBDeleteContactSetting(hMeta, META_PROTO, buff2);
}
- if(ok2) {
+ if (ok2) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
} else {
@@ -1446,13 +1446,13 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok2 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
} else {
DBDeleteContactSetting(hMeta, META_PROTO, buff2);
}
- if(ok2) {
+ if (ok2) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
} else {
@@ -1466,13 +1466,13 @@ int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2 strcat(buff2, _itoa(contact_number2, buff22, 10));
ok1 = !MyDBGetContactSetting(hMeta, META_PROTO, buff1, &dbv1);
ok2 = !MyDBGetContactSetting(hMeta, META_PROTO, buff2, &dbv2);
- if(ok1) {
+ if (ok1) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff2, &dbv1);
DBFreeVariant(&dbv1);
} else {
DBDeleteContactSetting(hMeta, META_PROTO, buff2);
}
- if(ok2) {
+ if (ok2) {
MyDBWriteContactSetting(hMeta, META_PROTO, buff1, &dbv2);
DBFreeVariant(&dbv2);
} else {
@@ -1544,15 +1544,15 @@ void copyHistory(HANDLE hContactFrom,HANDLE hContactTo) break;
// i.e. optoins.days_history == 0;
- if(time_now == earliest_time) earliest_time = dbei.timestamp;
+ if (time_now == earliest_time) earliest_time = dbei.timestamp;
- if(dbei.timestamp < earliest_time)
+ if (dbei.timestamp < earliest_time)
continue;
- if(dbei.eventType != EVENTTYPE_MESSAGE && dbei.eventType != EVENTTYPE_FILE && dbei.eventType != EVENTTYPE_URL)
+ if (dbei.eventType != EVENTTYPE_MESSAGE && dbei.eventType != EVENTTYPE_FILE && dbei.eventType != EVENTTYPE_URL)
continue;
- if(time_now > earliest_time) { // just in case!
+ if (time_now > earliest_time) { // just in case!
SendMessage(prog, PBM_SETPOS, (WPARAM)(int)(100.0 * (dbei.timestamp - earliest_time) / (time_now - earliest_time)), 0);
UpdateWindow(progress_dialog);
}
@@ -1567,7 +1567,7 @@ void copyHistory(HANDLE hContactFrom,HANDLE hContactTo) //CallService(MS_DB_SETSAFETYMODE, (WPARAM)TRUE, 0);
DestroyWindow(progress_dialog);
- if(buffer) mir_free(buffer);
+ if (buffer) mir_free(buffer);
//mir_free(id);
}
@@ -1608,19 +1608,19 @@ void Meta_RemoveHistory(HANDLE hContactRemoveFrom, HANDLE hContactSource) { if (CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei)) break;
- if(dbei.timestamp < earliest_time)
+ if (dbei.timestamp < earliest_time)
earliest_time = dbei.timestamp;
- if(dbei.eventType != EVENTTYPE_MESSAGE && dbei.eventType != EVENTTYPE_FILE && dbei.eventType != EVENTTYPE_URL) {
+ if (dbei.eventType != EVENTTYPE_MESSAGE && dbei.eventType != EVENTTYPE_FILE && dbei.eventType != EVENTTYPE_URL) {
hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
continue;
}
- if(dbei.cbBlob >= id_length && strncmp((char *)(dbei.pBlob + dbei.cbBlob - id_length), id, id_length - 1) == 0) {
+ if (dbei.cbBlob >= id_length && strncmp((char *)(dbei.pBlob + dbei.cbBlob - id_length), id, id_length - 1) == 0) {
// event is tagged with source contact id - remove
HANDLE hDbEventNext;
- if(time_now > earliest_time) { // just in case
+ if (time_now > earliest_time) { // just in case
SendMessage(prog, PBM_SETPOS, (WPARAM)(int)(100.0 * (dbei.timestamp - earliest_time) / (time_now - earliest_time)), 0);
UpdateWindow(progress_dialog);
}
@@ -1636,7 +1636,7 @@ void Meta_RemoveHistory(HANDLE hContactRemoveFrom, HANDLE hContactSource) { //CallService(MS_DB_SETSAFETYMODE, (WPARAM)TRUE, 0);
DestroyWindow(progress_dialog);
- if(buffer) mir_free(buffer);
+ if (buffer) mir_free(buffer);
mir_free(id);
}
@@ -1681,7 +1681,7 @@ char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused) { DBFreeVariant(&dbv);
strncpy(id + used, buff, 256 - used);
- if(used) {
+ if (used) {
*pused = (DWORD)(used + strlen(buff) + 1);
if (*pused > 256) *pused = 256;
}
@@ -1691,9 +1691,9 @@ char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused) { */
void Meta_FixStatus(HANDLE hMeta) {
HANDLE most_online = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, 0);
- if(most_online) {
+ if (most_online) {
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
- if(proto) {
+ if (proto) {
WORD status = (WORD)DBGetContactSettingWord(most_online, proto, "Status", (WORD)ID_STATUS_OFFLINE);
DBWriteContactSettingWord(hMeta, META_PROTO, "Status", status);
} else
@@ -1702,7 +1702,7 @@ void Meta_FixStatus(HANDLE hMeta) { DBWriteContactSettingWord(hMeta, META_PROTO, "Status", (WORD)ID_STATUS_OFFLINE);
// trigger setting changed in mw_clist to reset extra icons
- if(ServiceExists(MS_CLIST_EXTRA_SET_ICON)) {
+ if (ServiceExists(MS_CLIST_EXTRA_SET_ICON)) {
DBWriteContactSettingString(hMeta, "DummyModule", "e-mail", "blah");
//DBDeleteContactSetting(hMeta, "DummyModule", "e-mail"); // causes 'empty settings group' error in dbtool
}
diff --git a/plugins/MetaContacts/metacontacts.h b/plugins/MetaContacts/metacontacts.h index 790fb9a6a4..873b0e2e12 100644 --- a/plugins/MetaContacts/metacontacts.h +++ b/plugins/MetaContacts/metacontacts.h @@ -103,15 +103,7 @@ extern HINSTANCE hInstance; extern PLUGININFOEX pluginInfo;
// contact menu items
-extern HANDLE hMenuConvert,
- hMenuAdd,
- hMenuEdit,
- hMenuDelete,
- hMenuDefault,
- hMenuForceDefault;
-
-// main menu item
-extern HANDLE hMenuOnOff;
+extern HGENMENU hMenuConvert, hMenuAdd, hMenuEdit, hMenuDelete, hMenuDefault, hMenuForceDefault, hMenuOnOff;
extern DWORD nextMetaID;
extern int mcStatus;
diff --git a/plugins/Modernb/hdr/modern_clc.h b/plugins/Modernb/hdr/modern_clc.h index 773d34fb32..56c7a8b4c0 100644 --- a/plugins/Modernb/hdr/modern_clc.h +++ b/plugins/Modernb/hdr/modern_clc.h @@ -31,9 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "modern_defsettings.h"
#include "modern_clist.h"
-
-
-
#define SETTING_TRAYICON_SINGLE 0
#define SETTING_TRAYICON_CYCLE 1
#define SETTING_TRAYICON_MULTI 2
@@ -173,11 +170,6 @@ struct ClcGroup; #define TEXT_TEXT_MAX_LENGTH 1024
-
-#define IsHContactGroup(h) (((UINT_PTR)(h)^HCONTACT_ISGROUP)<(HCONTACT_ISGROUP^HCONTACT_ISINFO))
-#define IsHContactInfo(h) (((UINT_PTR)(h)&HCONTACT_ISINFO)==HCONTACT_ISINFO)
-#define IsHContactContact(h) (((UINT_PTR)(h)&HCONTACT_ISGROUP)==0)
-
typedef struct tagClcContactTextPiece
{
int type;
diff --git a/plugins/Modernb/modern_clistmenus.cpp b/plugins/Modernb/modern_clistmenus.cpp index e69e08fe15..95e41c4d81 100644 --- a/plugins/Modernb/modern_clistmenus.cpp +++ b/plugins/Modernb/modern_clistmenus.cpp @@ -128,7 +128,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) //mi.pszService="ContactRate MenuItem NoService Fake";
mi.flags=CMIF_ROOTPOPUP|CMIF_TCHAR;
if (!hFavoriteContactMenu)
- hFavoriteContactMenu=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
else
{
mi.flags|=CMIM_FLAGS|CMIM_ICON|CMIM_NAME;
@@ -164,26 +164,22 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.flags|=CMIM_FLAGS|CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
}
- else
- hFavoriteContactMenuItems[i]=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
CallService(MS_SKIN2_RELEASEICON,(WPARAM)mi.hIcon,0);
if (mi.hIcon && NeedFree) DestroyIcon(mi.hIcon);
}
- {
- mi.hIcon=NULL;
- mi.ptszName=_T("Show even if offline");
- mi.flags=CMIF_CHILDPOPUP|CMIF_TCHAR|(ModernGetSettingByte((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
- mi.pszService=CLUI_FAVTOGGLESHOWOFFLINE;
- mi.popupPosition=i+100000000;
- mi.position=-100000000;
- if (bModifyMenu && hShowIfOflineItem)
- {
- mi.flags|=CMIM_FLAGS|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
- }
- else
- hShowIfOflineItem=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+
+ mi.hIcon=NULL;
+ mi.ptszName=_T("Show even if offline");
+ mi.flags=CMIF_CHILDPOPUP|CMIF_TCHAR|(ModernGetSettingByte((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
+ mi.pszService=CLUI_FAVTOGGLESHOWOFFLINE;
+ mi.popupPosition=i+100000000;
+ mi.position=-100000000;
+ if (bModifyMenu && hShowIfOflineItem) {
+ mi.flags|=CMIM_FLAGS|CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
}
+ else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
}
return 0;
}
diff --git a/plugins/Modernb/modern_clisttray.cpp b/plugins/Modernb/modern_clisttray.cpp index f94e25a668..521785066d 100644 --- a/plugins/Modernb/modern_clisttray.cpp +++ b/plugins/Modernb/modern_clisttray.cpp @@ -166,7 +166,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) if (!pcli->pfnGetProtocolVisibility(szChangedProto)) return;
- pcli->pfnLockTray();
+ pcli->pfnLockTray();
if ( pcli->cycleTimerId ) {
KillTimer( NULL, pcli->cycleTimerId);
pcli->cycleTimerId=0;
@@ -258,7 +258,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) pcli->cycleTimerId=0;
{
HICON hIcon;
- // 1 check if multi connecting icon
+ // 1 check if multi connecting icon
if (g_bMultiConnectionMode)
if (_strcmpi(szChangedProto,g_szConnectingProto))
{ pcli->pfnUnlockTray(); return; }
@@ -323,26 +323,26 @@ void cliTrayIconUpdateBase(const char *szChangedProto) break;
} }
}
- else if ( pcli->pfnGetProtocolVisibility( szChangedProto ))
+ else if ( pcli->pfnGetProtocolVisibility( szChangedProto ))
{
DBVARIANT dbv={DBVT_DELETED};
char *szProto;
int status=CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
-
- if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
+
+ if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
HICON hIcon = ( HICON )CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);;
- if (hIcon)
+ if (hIcon)
changed=pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
}
- else if (status>=ID_STATUS_OFFLINE && status<=ID_STATUS_IDLE)
+ else if (status>=ID_STATUS_OFFLINE && status<=ID_STATUS_IDLE)
{
if(ModernGetSettingString(NULL,"CList","PrimaryStatus",&dbv))
szProto=NULL;
- else
+ else
szProto=dbv.pszVal;
changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,status),NULL);
- if (szProto)
+ if (szProto)
mir_free_and_nill(szProto);
}
}
@@ -370,7 +370,7 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd,UINT message,UINT_PTR idEve INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam)
{
- if (ModernGetSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT))
+ if (ModernGetSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT))
{
if (GetActiveWindow() != pcli->hwndContactList
&& GetWindow(GetParent(GetActiveWindow()),GW_OWNER) != pcli->hwndContactList)
@@ -420,7 +420,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) if(ModernGetSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT)) {
if (LOWORD(msg->wParam)==WA_INACTIVE && h2!=h4)
autoHideTimerId=CLUI_SafeSetTimer(NULL,0,1000*ModernGetSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
- else {
+ else {
KillTimer(NULL,autoHideTimerId);
autoHideTimerId = 0;
}
@@ -628,10 +628,10 @@ void InitTrayMenus(void) CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu);
CreateServiceFunction("CLISTMENUSTRAY/TrayMenuonAddService",TrayMenuonAddService);
- CreateServiceFunction(MS_CLIST_ADDTRAYMENUITEM,AddTrayMenuItem);
+ CreateServiceFunction("CList/AddTrayMenuItem",AddTrayMenuItem);
CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM,RemoveTrayMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu);
-
+
//Tray menu
memset(&tmp,0,sizeof(tmp));
diff --git a/plugins/Modernb/modern_clui.cpp b/plugins/Modernb/modern_clui.cpp index cf70313d70..8830f119d6 100644 --- a/plugins/Modernb/modern_clui.cpp +++ b/plugins/Modernb/modern_clui.cpp @@ -334,7 +334,7 @@ HRESULT CLUI::RegisterAvatarMenu() mi.hIcon=LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_SHOW_AVATAR));
mi.pszName=LPGEN("Show Contact &Avatar");
mi.pszService="CList/ShowContactAvatar";
- hShowAvatarMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hShowAvatarMenuItem = Menu_AddContactMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
CreateServiceFunction("CList/HideContactAvatar",CLUI::Service_Menu_HideContactAvatar);
@@ -342,7 +342,7 @@ HRESULT CLUI::RegisterAvatarMenu() mi.hIcon=LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_HIDE_AVATAR));
mi.pszName=LPGEN("Hide Contact &Avatar");
mi.pszService="CList/HideContactAvatar";
- hHideAvatarMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hHideAvatarMenuItem = Menu_AddContactMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
ModernHookEvent(ME_CLIST_PREBUILDCONTACTMENU, CLUI::OnEvent_ContactMenuPreBuild);
diff --git a/plugins/Modernb/modern_cluiframes.cpp b/plugins/Modernb/modern_cluiframes.cpp index 32f8635d4f..ee88e5a4de 100644 --- a/plugins/Modernb/modern_cluiframes.cpp +++ b/plugins/Modernb/modern_cluiframes.cpp @@ -832,7 +832,7 @@ static int CLUIFramesGetalClientFrame(void) return -1;
}
-static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addservice)
+static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd)(CLISTMENUITEM*))
{
//TMO_MenuItem tmi;
HGENMENU menuid;
@@ -851,7 +851,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszContactOwner=(char *)0;
mi.pszService=MS_CLIST_FRAMES_SHFRAME;
- menuid = (HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if(frameid==-1) _hmiVisible=menuid;
else g_pfwFrames[framepos].MenuHandles.MIVisible=menuid;
@@ -864,7 +864,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService=MS_CLIST_FRAMES_SHFRAMETITLEBAR;
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiTBVisible=menuid;
else g_pfwFrames[framepos].MenuHandles.MITBVisible=menuid;
@@ -875,7 +875,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService=MS_CLIST_FRAMES_ULFRAME;
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiLock=menuid;
else g_pfwFrames[framepos].MenuHandles.MILock=menuid;
@@ -886,7 +886,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService=MS_CLIST_FRAMES_UCOLLFRAME;
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiColl=menuid;
else g_pfwFrames[framepos].MenuHandles.MIColl=menuid;
@@ -898,7 +898,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP;
mi.pszService="Set_Floating";
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiFloating=menuid;
else g_pfwFrames[framepos].MenuHandles.MIFloating=menuid;
@@ -909,7 +909,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService=MS_CLIST_FRAMES_SETUNBORDER;
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiBorder=menuid;
else g_pfwFrames[framepos].MenuHandles.MIBorder=menuid;
@@ -924,7 +924,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
mi.pszService="";
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiAlignRoot=menuid;
else g_pfwFrames[framepos].MenuHandles.MIAlignRoot=menuid;
@@ -936,7 +936,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.pszName=LPGEN("&Top");
mi.pszService=CLUIFRAMESSETALIGNALTOP;
mi.pszContactOwner=(char *)alTop;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiAlignTop=menuid;
else g_pfwFrames[framepos].MenuHandles.MIAlignTop=menuid;
@@ -946,7 +946,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.pszName=LPGEN("&Client");
mi.pszService=CLUIFRAMESSETALIGNALCLIENT;
mi.pszContactOwner=(char *)alClient;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiAlignClient=menuid;
else g_pfwFrames[framepos].MenuHandles.MIAlignClient=menuid;
@@ -955,7 +955,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.pszName=LPGEN("&Bottom");
mi.pszService=CLUIFRAMESSETALIGNALBOTTOM;
mi.pszContactOwner=(char *)alBottom;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiAlignBottom=menuid;
else g_pfwFrames[framepos].MenuHandles.MIAlignBottom=menuid;
@@ -970,7 +970,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
mi.pszService="";
mi.pszContactOwner=(char *)0;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiPosRoot=menuid;
else g_pfwFrames[framepos].MenuHandles.MIPosRoot=menuid;
//??????
@@ -981,7 +981,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP;
mi.pszService=CLUIFRAMESMOVEUP;
mi.pszContactOwner=(char *)1;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiPosUp=menuid;
else g_pfwFrames[framepos].MenuHandles.MIPosUp=menuid;
@@ -991,7 +991,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char mi.flags=CMIF_CHILDPOPUP;
mi.pszService=CLUIFRAMESMOVEDOWN;
mi.pszContactOwner=(char *)-1;
- menuid=(HGENMENU)CallService(addservice,0,(LPARAM)&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiPosDown=menuid;
else g_pfwFrames[framepos].MenuHandles.MIPosDown=menuid;
@@ -1824,7 +1824,7 @@ static int CLUIFramesLoadMainMenu() mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
mi.position = 3000090000;
mi.pszName = LPGEN("Frames");
- _hmiRoot = (HGENMENU)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ _hmiRoot = Menu_AddMainMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
// create frames menu
int separator=3000200000;
@@ -1835,8 +1835,8 @@ static int CLUIFramesLoadMainMenu() mi.hParentMenu = _hmiRoot;
mi.ptszName = g_pfwFrames[i].TitleBar.tbname ? g_pfwFrames[i].TitleBar.tbname : g_pfwFrames[i].Name;
mi.pszService = 0;
- g_pfwFrames[i].MenuHandles.MainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
- CLUIFramesCreateMenuForFrame(g_pfwFrames[i].id,(int)g_pfwFrames[i].MenuHandles.MainMenuItem,separator,MS_CLIST_ADDMAINMENUITEM);
+ g_pfwFrames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
+ CLUIFramesCreateMenuForFrame(g_pfwFrames[i].id,(int)g_pfwFrames[i].MenuHandles.MainMenuItem,separator,Menu_AddMainMenuItem);
CLUIFramesModifyMainMenuItems(g_pfwFrames[i].id,0);
CallService(MS_CLIST_FRAMEMENUNOTIFY,(WPARAM)g_pfwFrames[i].id,(LPARAM)g_pfwFrames[i].MenuHandles.MainMenuItem);
separator++;
@@ -1851,20 +1851,19 @@ static int CLUIFramesLoadMainMenu() mi.hParentMenu = _hmiRoot;
mi.pszName = LPGEN("Show All Frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "show all titlebars" menu
mi.position = separator++;
mi.pszName = LPGEN("Show All Titlebars");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "hide all titlebars" menu
mi.position = separator++;
mi.pszName = LPGEN("Hide All Titlebars");
mi.pszService = MS_CLIST_FRAMES_HIDEALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
-
+ Menu_AddMainMenuItem(&mi);
return 0;
}
@@ -4014,7 +4013,7 @@ int CLUIFrameOnModulesLoad(WPARAM wParam,LPARAM lParam) {
/* HOOK */
CLUIFramesLoadMainMenu();
- CLUIFramesCreateMenuForFrame(-1,-1,000010000,MS_CLIST_ADDCONTEXTFRAMEMENUITEM);
+ CLUIFramesCreateMenuForFrame(-1,-1,000010000,Menu_AddContextFrameMenuItem);
return 0;
}
int CLUIFrameOnModulesUnload(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/Modernb/modern_framesmenu.cpp b/plugins/Modernb/modern_framesmenu.cpp index 9e2aed8418..5a8552f0cb 100644 --- a/plugins/Modernb/modern_framesmenu.cpp +++ b/plugins/Modernb/modern_framesmenu.cpp @@ -197,7 +197,7 @@ int InitFramesMenus(void) CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_ADDCONTEXTFRAMEMENUITEM,AddContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
diff --git a/plugins/Modernb/modern_groupmenu.cpp b/plugins/Modernb/modern_groupmenu.cpp index e6ba5aba31..dcfa6db2a8 100644 --- a/plugins/Modernb/modern_groupmenu.cpp +++ b/plugins/Modernb/modern_groupmenu.cpp @@ -297,7 +297,7 @@ void GroupMenus_Init(void) CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);
CreateServiceFunction("CLISTMENUSGroup/CreateGroupHelper",CreateGroupHelper);
- CreateServiceFunction(MS_CLIST_ADDGROUPMENUITEM,AddGroupMenuItem);
+ CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
@@ -689,24 +689,23 @@ void InitSubGroupMenus(void) {
TMenuParam tmp;
OptParam op;
-
+
CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService",SubGroupMenuCheckService);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService",SubGroupMenuCheckService);
CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy",GroupMenuExecProxy);
//CreateServiceFunction("CLISTMENUSSubGroup/HideSubGroupsHelper",HideSubGroupsHelper);
//CreateServiceFunction("CLISTMENUSSubGroup/UseSubGroupsHelper",UseSubGroupsHelper);
//CreateServiceFunction("CLISTMENUSSubGroup/HideOfflineRootHelper",HideOfflineRootHelper);
- CreateServiceFunction(MS_CLIST_ADDSUBGROUPMENUITEM,AddSubGroupMenuItem);
+ CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM,RemoveSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
ModernHookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
-
//SubGroup menu
memset(&tmp,0,sizeof(tmp));
tmp.cbSize=sizeof(tmp);
@@ -714,13 +713,12 @@ void InitSubGroupMenus(void) tmp.ExecService="CLISTMENUSSubGroup/ExecService";
tmp.name=LPGEN("SubGroupMenu");
hSubGroupMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
-
-
+
op.Handle=hSubGroupMenuObject;
op.Setting=OPT_USERDEFINEDITEMS;
op.Value=TRUE;
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
-
+
op.Handle=hSubGroupMenuObject;
op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
op.Value=(INT_PTR)"CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu";
@@ -731,17 +729,15 @@ void InitSubGroupMenus(void) op.Value=(INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hSubGroupMenuObject;
+ op.Handle=hSubGroupMenuObject;
op.Setting=OPT_MENUOBJECT_SET_CHECK_SERVICE;
op.Value=(INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuCheckService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
-
- {
//add exit command to menu
CLISTMENUITEM mi;
GroupMenuParam gmp;
-
+
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=1000;
@@ -782,7 +778,7 @@ void InitSubGroupMenus(void) gmp.lParam=0;gmp.wParam=POPUP_RENAMEGROUP;
AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
-
+
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=900002;
@@ -793,9 +789,6 @@ void InitSubGroupMenus(void) gmp.lParam=0;gmp.wParam=POPUP_DELETEGROUP;
AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
- //MS_CLIST_SubGroupCREATE
-
- };
}
//////////////////////////////END SubGroup MENU/////////////////////////
diff --git a/plugins/Mwclist/CLUIFrames/cluiframes.cpp b/plugins/Mwclist/CLUIFrames/cluiframes.cpp index 12d4f71ac4..ab56da832d 100644 --- a/plugins/Mwclist/CLUIFrames/cluiframes.cpp +++ b/plugins/Mwclist/CLUIFrames/cluiframes.cpp @@ -630,7 +630,7 @@ int CLUIFramesGetalClientFrame(void) return -1;
}
-HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addservice)
+HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
CLISTMENUITEM mi;
//TMO_MenuItem tmi;
@@ -647,7 +647,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.pszName = LPGEN("&FrameTitle");
mi.flags = CMIF_CHILDPOPUP|CMIF_GRAYED;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMITitle = menuid;
else Frames[framepos].MenuHandles.MITitle = menuid;
@@ -661,7 +661,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszContactOwner = (char *)0;
mi.pszService = MS_CLIST_FRAMES_SHFRAME;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIVisible = menuid;
else Frames[framepos].MenuHandles.MIVisible = menuid;
@@ -672,7 +672,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SHFRAMETITLEBAR;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMITBVisible = menuid;
else Frames[framepos].MenuHandles.MITBVisible = menuid;
@@ -686,7 +686,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_ULFRAME;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMILock = menuid;
else Frames[framepos].MenuHandles.MILock = menuid;
@@ -697,7 +697,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_UCOLLFRAME;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIColl = menuid;
else Frames[framepos].MenuHandles.MIColl = menuid;
@@ -709,7 +709,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP;
mi.pszService = "Set_Floating";
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIFloating = menuid;
else Frames[framepos].MenuHandles.MIFloating = menuid;
@@ -723,7 +723,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETUNBORDER;
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIBorder = menuid;
else Frames[framepos].MenuHandles.MIBorder = menuid;
@@ -737,7 +737,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
mi.pszService = "";
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignRoot = menuid;
else Frames[framepos].MenuHandles.MIAlignRoot = menuid;
@@ -749,7 +749,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.pszName = LPGEN("&Top");
mi.pszService = CLUIFRAMESSETALIGNALTOP;
mi.pszContactOwner = (char *)alTop;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignTop = menuid;
else Frames[framepos].MenuHandles.MIAlignTop = menuid;
@@ -759,7 +759,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.pszName = LPGEN("&Client");
mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
mi.pszContactOwner = (char *)alClient;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignClient = menuid;
else Frames[framepos].MenuHandles.MIAlignClient = menuid;
@@ -768,7 +768,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.pszName = LPGEN("&Bottom");
mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
mi.pszContactOwner = (char *)alBottom;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
if (frameid == -1) contMIAlignBottom = menuid;
else Frames[framepos].MenuHandles.MIAlignBottom = menuid;
@@ -781,7 +781,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
mi.pszService = "";
mi.pszContactOwner = (char *)0;
- menuid = (HANDLE)CallService(addservice,0,(LPARAM)&mi);
+ menuid = pfnAdd(&mi);
mi.pszPopupName = (char *)menuid;
mi.popupPosition = frameid;
@@ -790,7 +790,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP;
mi.pszService = CLUIFRAMESMOVEUPDOWN;
mi.pszContactOwner = (char *)1;
- CallService(addservice,0,(LPARAM)&mi);
+ pfnAdd(&mi);
mi.pszPopupName = (char *)menuid;
mi.popupPosition = frameid;
@@ -799,7 +799,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,char *addse mi.flags = CMIF_CHILDPOPUP;
mi.pszService = CLUIFRAMESMOVEUPDOWN;
mi.pszContactOwner = (char *)-1;
- CallService(addservice,0,(LPARAM)&mi);
+ pfnAdd(&mi);
return 0;
}
@@ -1433,7 +1433,7 @@ static int CLUIFramesLoadMainMenu() mi.pszPopupName = LPGEN("Frames");
mi.pszName = LPGEN("New Menu System not Found...");
mi.pszService = "";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "show all frames" menu
mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA));
@@ -1442,7 +1442,7 @@ static int CLUIFramesLoadMainMenu() mi.pszPopupName = LPGEN("Frames");
mi.pszName = LPGEN("Show All Frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_HELP));
mi.position = 10100001;
@@ -1450,7 +1450,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_CHILDPOPUP;
mi.pszName = LPGEN("Show All Titlebars");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
return 0;
}
@@ -1469,7 +1469,7 @@ static int CLUIFramesLoadMainMenu() mi.pszPopupName = (char*)-1;
mi.pszName = LPGEN("Frames");
mi.pszService = 0;
- MainMIRoot = (HGENMENU)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ MainMIRoot = Menu_AddMainMenuItem(&mi);
// create frames menu
separator = 3000200000;
@@ -1480,8 +1480,8 @@ static int CLUIFramesLoadMainMenu() mi.hParentMenu = MainMIRoot;
mi.ptszName = Frames[i].TitleBar.tbname ? Frames[i].TitleBar.tbname : Frames[i].name;
mi.pszService = 0;
- Frames[i].MenuHandles.MainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
- CLUIFramesCreateMenuForFrame(Frames[i].id,(int)Frames[i].MenuHandles.MainMenuItem,separator,MS_CLIST_ADDMAINMENUITEM);
+ Frames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
+ CLUIFramesCreateMenuForFrame(Frames[i].id,(int)Frames[i].MenuHandles.MainMenuItem,separator,Menu_AddMainMenuItem);
CLUIFramesModifyMainMenuItems(Frames[i].id,0);
//NotifyEventHooks(hPreBuildFrameMenuEvent,i,(LPARAM)Frames[i].MenuHandles.MainMenuItem);
CallService(MS_CLIST_FRAMEMENUNOTIFY,(WPARAM)Frames[i].id,(LPARAM)Frames[i].MenuHandles.MainMenuItem);
@@ -1497,7 +1497,7 @@ static int CLUIFramesLoadMainMenu() mi.hParentMenu = MainMIRoot;
mi.pszName = LPGEN("Show All Frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "show all titlebars" menu
mi.hIcon = NULL;
@@ -1506,7 +1506,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_CHILDPOPUP;
mi.pszName = LPGEN("Show All Titlebars");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// create "hide all titlebars" menu
mi.hIcon = NULL;
@@ -1515,7 +1515,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_CHILDPOPUP;
mi.pszName = LPGEN("Hide All Titlebars");
mi.pszService = MS_CLIST_FRAMES_HIDEALLFRAMESTB;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
return 0;
}
@@ -2869,7 +2869,7 @@ static void CLUIRegisterFonts() static int CLUIFrameOnModulesLoad(WPARAM wParam,LPARAM lParam)
{
CLUIFramesLoadMainMenu();
- CLUIFramesCreateMenuForFrame(-1,-1,000010000,MS_CLIST_ADDCONTEXTFRAMEMENUITEM);
+ CLUIFramesCreateMenuForFrame(-1,-1,000010000,Menu_AddContextFrameMenuItem);
CLUIRegisterFonts();
return 0;
}
diff --git a/plugins/Mwclist/CLUIFrames/framesmenu.cpp b/plugins/Mwclist/CLUIFrames/framesmenu.cpp index fc47474b2a..7a34206512 100644 --- a/plugins/Mwclist/CLUIFrames/framesmenu.cpp +++ b/plugins/Mwclist/CLUIFrames/framesmenu.cpp @@ -205,7 +205,7 @@ int InitFramesMenus(void) CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_ADDCONTEXTFRAMEMENUITEM,AddContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
diff --git a/plugins/Mwclist/clcfonts.cpp b/plugins/Mwclist/clcfonts.cpp index d6039ecb27..346c53c9f3 100644 --- a/plugins/Mwclist/clcfonts.cpp +++ b/plugins/Mwclist/clcfonts.cpp @@ -56,8 +56,6 @@ static int fontListOrder[FONTID_MAX + 1] = #define CLCDEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
#define CLCDEFAULT_SELTEXTCOLOUR GetSysColor(COLOR_HIGHLIGHTTEXT)
-#define CLCDEFAULT_HOTTEXTCOLOUR (IsWinVer98Plus()?RGB(0,0,255):GetSysColor(COLOR_HOTLIGHT))
-#define CLCDEFAULT_QUICKSEARCHCOLOUR RGB(255,255,0)
static int FS_FontsChanged(WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/Mwclist/clisttray.cpp b/plugins/Mwclist/clisttray.cpp index 04e71c6a0c..82ce1a2f16 100644 --- a/plugins/Mwclist/clisttray.cpp +++ b/plugins/Mwclist/clisttray.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2003 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@ INT_PTR TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) case TIM_CALLBACK:
if (msg->lParam == WM_RBUTTONUP)
{
- POINT pt;
+ POINT pt;
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDTRAY,(WPARAM)0,(LPARAM)0);
SetForegroundWindow(msg->hwnd);
@@ -56,7 +56,7 @@ INT_PTR TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) *((LRESULT*)lParam) = 0;
return TRUE;
}
-
+
return saveTrayIconProcessMessage( wParam, lParam );
}
@@ -95,7 +95,7 @@ static INT_PTR BuildTrayMenu(WPARAM wParam,LPARAM lParam) hMenu = CreatePopupMenu();
//hMenu = wParam;
tick = GetTickCount();
-
+
NotifyEventHooks(hPreBuildTrayMenuEvent,0,0);
CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
@@ -125,17 +125,17 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam) tmi.root = (HGENMENU)mi->pszPopupName;
tmi.ownerdata = NULL;
-
+
{
lpTrayMenuExecParam mmep;
mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
if (mmep == NULL)
return 0;
-
+
//we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
mmep->Param1 = mi->popupPosition;
-
+
tmi.ownerdata = mmep;
}
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
@@ -145,12 +145,12 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam) return (INT_PTR)op.Handle;
}
-INT_PTR TrayMenuCheckService(WPARAM wParam,LPARAM lParam)
+INT_PTR TrayMenuCheckService(WPARAM wParam,LPARAM lParam)
{
return 0;
}
-INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam)
+INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
if (mii == NULL) return 0;
@@ -162,12 +162,12 @@ INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam) if (hTrayMainMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
}
if (hTrayStatusMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
return(TRUE);
@@ -180,13 +180,13 @@ INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam) INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) {
if (wParam != 0)
{
- lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam;
+ lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam;
if (!strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
}
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName,mmep->Param1,lParam);
}
return(1);
}
@@ -216,21 +216,21 @@ void InitTrayMenus(void) tmp.ExecService = "CLISTMENUSTRAY/ExecService";
tmp.name = "TrayMenu";
hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
-
+
CreateServiceFunction("CLISTMENUSTRAY/ExecService",TrayMenuExecService);
CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu);
CreateServiceFunction("CLISTMENUSTRAY/TrayMenuonAddService",TrayMenuonAddService);
- CreateServiceFunction(MS_CLIST_ADDTRAYMENUITEM,AddTrayMenuItem);
+ CreateServiceFunction("CList/AddTrayMenuItem",AddTrayMenuItem);
CreateServiceFunction(MS_CLIST_REMOVETRAYMENUITEM,RemoveTrayMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu);
hPreBuildTrayMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
-
+
op.Handle = hTrayMenuObject;
op.Setting = OPT_USERDEFINEDITEMS;
op.Value = TRUE;
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
-
+
op.Handle = hTrayMenuObject;
op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
op.Value = (INT_PTR)"CLISTMENUSTRAY/FreeOwnerDataTrayMenu";
@@ -241,7 +241,7 @@ void InitTrayMenus(void) op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- {
+ {
//add exit command to menu
CLISTMENUITEM mi;
@@ -266,7 +266,7 @@ void InitTrayMenus(void) mi.pszService = "FindAdd/FindAddCommand";
mi.pszName = LPGEN("&Find/Add Contacts...");
AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
-
+
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 300000;
diff --git a/plugins/Mwclist/groupmenu.cpp b/plugins/Mwclist/groupmenu.cpp index 815b55274a..fab616f6fb 100644 --- a/plugins/Mwclist/groupmenu.cpp +++ b/plugins/Mwclist/groupmenu.cpp @@ -281,7 +281,7 @@ void InitGroupMenus(void) CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper",UseGroupsHelper);
CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);
- CreateServiceFunction(MS_CLIST_ADDGROUPMENUITEM,AddGroupMenuItem);
+ CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
@@ -598,7 +598,7 @@ void InitSubGroupMenus(void) CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy",GroupMenuExecProxy);
- CreateServiceFunction(MS_CLIST_ADDSUBGROUPMENUITEM,AddSubGroupMenuItem);
+ CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM,RemoveSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
hPreBuildSubGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
diff --git a/plugins/NewAwaySysMod/AwaySys.cpp b/plugins/NewAwaySysMod/AwaySys.cpp index 26bb4bdd5b..0e10dd9eeb 100644 --- a/plugins/NewAwaySysMod/AwaySys.cpp +++ b/plugins/NewAwaySysMod/AwaySys.cpp @@ -877,6 +877,7 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) hHooks.AddElem(HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit));
g_hReadWndList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
int SendOnEvent = CContactSettings(g_ProtoStates[(char*)NULL].Status).Autoreply;
+
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(mi);
mi.position = 1000020000;
@@ -884,18 +885,16 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) mi.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(SendOnEvent ? IDI_SOE_ENABLED : IDI_SOE_DISABLED));
mi.ptszName = SendOnEvent ? DISABLE_SOE_COMMAND : ENABLE_SOE_COMMAND;
mi.pszService = MS_AWAYSYS_AUTOREPLY_TOGGLE;
- g_hToggleSOEMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ g_hToggleSOEMenuItem = Menu_AddMainMenuItem(&mi);
+
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = -2000005000;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE | CMIF_HIDDEN;
- mi.hIcon = NULL;
- mi.pszContactOwner = NULL;
mi.ptszName = LPGENT("Read status message"); // never seen...
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
- g_hReadStatMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
- if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USEMENUITEM))
- {
+ g_hReadStatMenuItem = Menu_AddContactMenuItem(&mi);
+ if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USEMENUITEM)) {
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
@@ -903,7 +902,7 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) mi.position = 1000020000;
mi.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_MSGICON));
mi.pszService = MS_AWAYSYS_SETCONTACTSTATMSG;
- g_hContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItem = Menu_AddContactMenuItem(&mi);
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -912,25 +911,27 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) mi.pszPopupName = (char*)-1;
mi.position = 1000020000;
mi.ptszName = LPGENT("Autoreply");
- g_hToggleSOEContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
mi.flags = CMIF_TCHAR | CMIF_CHILDPOPUP;
mi.pszPopupName = (char*)g_hToggleSOEContactMenuItem;
- mi.popupPosition = 1000020000;
+ mi.popupPosition = 1000020000;
mi.position = 1000020000;
mi.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_SOE_ENABLED));
mi.ptszName = LPGENT("On");
mi.pszService = MS_AWAYSYS_AUTOREPLY_ON;
- g_hAutoreplyOnContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hAutoreplyOnContactMenuItem = Menu_AddContactMenuItem(&mi);
+
mi.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_SOE_DISABLED));
mi.ptszName = LPGENT("Off");
mi.pszService = MS_AWAYSYS_AUTOREPLY_OFF;
- g_hAutoreplyOffContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hAutoreplyOffContactMenuItem = Menu_AddContactMenuItem(&mi);
+
mi.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_DOT));
mi.ptszName = LPGENT("Use the default setting");
mi.pszService = MS_AWAYSYS_AUTOREPLY_USEDEFAULT;
- g_hAutoreplyUseDefaultContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hAutoreplyUseDefaultContactMenuItem = Menu_AddContactMenuItem(&mi);
}
// add that funky thingy (just tweaked a bit, was spotted in Miranda's src code)
// we have to read the status message from contacts too... err
diff --git a/plugins/NewXstatusNotify/main.cpp b/plugins/NewXstatusNotify/main.cpp index ad2c628692..ab6677e0cb 100644 --- a/plugins/NewXstatusNotify/main.cpp +++ b/plugins/NewXstatusNotify/main.cpp @@ -1293,7 +1293,7 @@ void InitMainMenuItem() mi.flags = CMIF_TCHAR | CMIF_ICONFROMICOLIB;
mi.ptszPopupName = ServiceExists(MS_POPUP_ADDPOPUP) ? _T("PopUps") : NULL;
mi.pszService = MS_STATUSCHANGE_MENUCOMMAND;
- hEnableDisableMenu = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hEnableDisableMenu = Menu_AddMainMenuItem(&mi);
opt.TempDisabled = !opt.TempDisabled;
EnableDisableMenuCommand(0, 0);
diff --git a/plugins/Nudge/headers.h b/plugins/Nudge/headers.h index 810edc6242..062bc8ee77 100644 --- a/plugins/Nudge/headers.h +++ b/plugins/Nudge/headers.h @@ -48,6 +48,7 @@ #include <m_metacontacts.h>
#include <m_updater.h>
#include <m_icolib.h>
+#include <win2k.h>
#include "resource.h"
#include "m_nudge.h"
diff --git a/plugins/Nudge/main.cpp b/plugins/Nudge/main.cpp index fb4575b50e..5500451eff 100644 --- a/plugins/Nudge/main.cpp +++ b/plugins/Nudge/main.cpp @@ -795,44 +795,36 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) newNudge->next = NudgeList;
NudgeList = newNudge;
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid = {0};
- TCHAR szFilename[MAX_PATH];
- char iconName[MAXMODULELABELLENGTH + 10];
- TCHAR iconDesc[MAXMODULELABELLENGTH + 10];
- GetModuleFileName(hInst,szFilename,MAX_PATH);
-
- sid.cbSize = SKINICONDESC_SIZE;
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = LPGENT("Nudge");
- sid.ptszDefaultFile = szFilename;
- mir_snprintf(iconName,sizeof(iconName),"Nudge_%s",proto->szModuleName);
- sid.pszName = iconName;
- mir_sntprintf(iconDesc,sizeof(iconDesc),TranslateT("Nudge for %s"),proto->tszAccountName);
- sid.ptszDescription = iconDesc;
- sid.iDefaultIndex = -IDI_NUDGE;
- sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE));
- newNudge->item.hIcoLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- }
+ char iconName[MAXMODULELABELLENGTH + 10];
+ mir_snprintf(iconName,sizeof(iconName),"Nudge_%s",proto->szModuleName);
+
+ TCHAR szFilename[MAX_PATH], iconDesc[MAXMODULELABELLENGTH + 10];
+ GetModuleFileName(hInst,szFilename,MAX_PATH);
+ mir_sntprintf(iconDesc, SIZEOF(iconDesc), TranslateT("Nudge for %s"), proto->tszAccountName);
+
+ SKINICONDESC sid = {0};
+ sid.cbSize = SKINICONDESC_SIZE;
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszSection = LPGENT("Nudge");
+ sid.ptszDefaultFile = szFilename;
+ sid.pszName = iconName;
+ sid.ptszDescription = iconDesc;
+ sid.iDefaultIndex = -IDI_NUDGE;
+ sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE));
+ newNudge->item.hIcoLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
//Add contact menu entry
- if(ServiceExists(MS_CLIST_ADDCONTACTMENUITEM))
- {
- //Add contact menu entry
- CLISTMENUITEM mi = {0};
- mi.cbSize = sizeof(mi);
-
- mi.popupPosition = 500085000;
- mi.pszContactOwner = proto->szModuleName;
- mi.pszPopupName = proto->szModuleName;
- mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
- mi.position = -500050004;
- mi.icolibItem = newNudge->item.hIcoLibItem;
- mi.ptszName = LPGENT( "Send &Nudge" );
- mi.pszService = MS_NUDGE_SEND;
- newNudge->item.hContactMenu = (HANDLE) CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
- }
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.popupPosition = 500085000;
+ mi.pszContactOwner = proto->szModuleName;
+ mi.pszPopupName = proto->szModuleName;
+ mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
+ mi.position = -500050004;
+ mi.icolibItem = newNudge->item.hIcoLibItem;
+ mi.ptszName = LPGENT( "Send &Nudge" );
+ mi.pszService = MS_NUDGE_SEND;
+ newNudge->item.hContactMenu = Menu_AddContactMenuItem(&mi);
}
void AutoResendNudge(void *wParam)
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index fb432941a8..49cf9dab11 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -87,7 +87,8 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) mi.hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"check_update");
mi.ptszName = _T("Check for pack updates");
mi.pszService = MODNAME"/CheckUpdates";
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
+
// Add empty updates folder menu item
hEmptyFolder = CreateServiceFunction(MODNAME"/EmptyFolder", EmptyFolder);
ZeroMemory(&mi, sizeof(mi));
@@ -97,7 +98,7 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) mi.hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"empty_folder");
mi.ptszName = _T("Clear pack updates folder");
mi.pszService = MODNAME"/EmptyFolder";
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// Add options hook
hOptHook = HookEvent(ME_OPT_INITIALISE, OptInit);
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index afebbe75e3..debafada7a 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -321,7 +321,7 @@ void InitMenuItems(void) { mi.position = -1000000000 /*1000001*/;
mi.ptszName = LPGENT(MODULNAME_PLU);
mi.hIcon = IcoLib_GetIcon(PopUpOptions.ModuleIsEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF ,0);
- hMenuRoot = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuRoot = Menu_AddMainMenuItem(&mi);
// Add item to main menu
mi.hParentMenu = (HGENMENU)hMenuRoot;
@@ -329,7 +329,7 @@ void InitMenuItems(void) { hTogglePopup = CreateServiceFunction(MENUCOMMAND_SVC, svcEnableDisableMenuCommand);
mi.ptszName = PopUpOptions.ModuleIsEnabled ? LPGENT("Disable &popup module") : LPGENT("Enable &popup module");
mi.pszService = MENUCOMMAND_SVC;
- hMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuItem = Menu_AddMainMenuItem(&mi);
// Popup History
hShowHistory = CreateServiceFunction(MENUCOMMAND_HISTORY, svcShowHistory);
@@ -338,7 +338,7 @@ void InitMenuItems(void) { mi.ptszName = LPGENT("Popup History");
mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
mi.pszService = MENUCOMMAND_HISTORY;
- hMenuItemHistory = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuItemHistory = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/ProfileManager/pmanagerEx.c b/plugins/ProfileManager/pmanagerEx.c index 8bc9fec652..6556478e25 100644 --- a/plugins/ProfileManager/pmanagerEx.c +++ b/plugins/ProfileManager/pmanagerEx.c @@ -97,7 +97,7 @@ int __declspec(dllexport) Load(PLUGINLINK *link) mi.pszPopupName = "Database";
mi.pszName=LPGEN("Load profile");
mi.pszService="Database/LoadPM";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
CreateServiceFunction("Database/ChangePM",ChangePM);
ZeroMemory(&mi,sizeof(mi));
@@ -108,7 +108,7 @@ int __declspec(dllexport) Load(PLUGINLINK *link) mi.pszPopupName = "Database";
mi.pszName=LPGEN("Change profile");
mi.pszService="Database/ChangePM";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp index cbb77d8491..8e0d13cd5d 100644 --- a/plugins/RecentContacts/RecentContacts.cpp +++ b/plugins/RecentContacts/RecentContacts.cpp @@ -481,7 +481,7 @@ int Create_MenuitemShowList(void) mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, ( LPARAM )"recent_main" );
mi.pszName = msLastUC_ShowListName;
mi.pszService = msLastUC_ShowList;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
ZeroMemory( &mi, sizeof( mi ));
mi.cbSize = sizeof( mi );
@@ -489,8 +489,7 @@ int Create_MenuitemShowList(void) mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, ( LPARAM )"recent_main" );
mi.ptszName = _T("Toggle Ignore");
mi.pszService = V_RECENTCONTACTS_TOGGLE_IGNORE;
- hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM,0, ( LPARAM )&mi );
-
+ hMenuItemRemove = Menu_AddContactMenuItem(&mi);
return 0;
}
diff --git a/plugins/SRMM/msgs.c b/plugins/SRMM/msgs.c index bfba1b6299..8b822c2b42 100644 --- a/plugins/SRMM/msgs.c +++ b/plugins/SRMM/msgs.c @@ -326,7 +326,7 @@ static int SplitmsgModulesLoaded(WPARAM wParam, LPARAM lParam) mi.icolibItem = LoadSkinnedIconHandle( SKINICON_EVENT_MESSAGE );
mi.pszName = LPGEN("&Message");
mi.pszService = MS_MSG_SENDMESSAGE;
- hMsgMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hMsgMenuItem = Menu_AddContactMenuItem(&mi);
}
HookEvent(ME_FONT_RELOAD, FontsChanged);
diff --git a/plugins/Scriver/chat/main.c b/plugins/Scriver/chat/main.c index 115eca156d..aa14d7f8df 100644 --- a/plugins/Scriver/chat/main.c +++ b/plugins/Scriver/chat/main.c @@ -84,14 +84,14 @@ int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam) mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN );
mi.pszName = LPGEN("&Join");
mi.pszService = "GChat/JoinChat";
- hJoinMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hJoinMenuItem = Menu_AddContactMenuItem(&mi);
mi.position = -2000090000;
mi.flags = CMIF_NOTOFFLINE | CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_LEAVE );
mi.pszName = LPGEN("&Leave");
mi.pszService = "GChat/LeaveChat";
- hLeaveMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hLeaveMenuItem = Menu_AddContactMenuItem(&mi);
}
CList_SetAllOffline(TRUE, NULL);
return 0;
diff --git a/plugins/Scriver/msgs.c b/plugins/Scriver/msgs.c index c0f63b6538..0ce59281ea 100644 --- a/plugins/Scriver/msgs.c +++ b/plugins/Scriver/msgs.c @@ -537,7 +537,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) }
mi.pszName = LPGEN("&Message");
mi.pszService = MS_MSG_SENDMESSAGE;
- hMsgMenuItem = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hMsgMenuItem = Menu_AddContactMenuItem(&mi);
CallService(MS_SKIN2_RELEASEICON,(WPARAM)mi.hIcon, 0);
HookEvent_Ex(ME_SMILEYADD_OPTIONSCHANGED, SmileySettingsChanged);
diff --git a/plugins/SecureIM/main.cpp b/plugins/SecureIM/main.cpp index 926f68512a..24950bbacf 100644 --- a/plugins/SecureIM/main.cpp +++ b/plugins/SecureIM/main.cpp @@ -50,10 +50,9 @@ void AddHookFunction(LPCSTR eventName, MIRANDAHOOK hookFunction) { }
-HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0) {
-
- CLISTMENUITEM mi;
- memset(&mi,0,sizeof(mi));
+HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0)
+{
+ CLISTMENUITEM mi = { 0 };
mi.cbSize=sizeof(mi);
mi.flags=flags | CMIF_HIDDEN;
mi.position=pos;
@@ -61,23 +60,23 @@ HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WP mi.pszName= (char*)name;
mi.pszPopupName=(char*)-1;
mi.pszService=(char*)service;
- return((HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,wParam,(LPARAM)&mi));
+ return Menu_AddContactMenuItem(&mi);
}
-HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0) {
-
- CLISTMENUITEM mi;
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=CMIF_CHILDPOPUP | CMIF_HIDDEN;
- mi.position=pos;
- mi.popupPosition=poppos;
- mi.hIcon=NULL;
- mi.pszName=(char*)name;
- mi.pszPopupName=(char*)rootid;
- mi.pszService=(char*)service;
- return((HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,wParam,(LPARAM)&mi));
+HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0)
+{
+ CLISTMENUITEM mi = { 0 };
+ memset(&mi,0,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.flags=CMIF_CHILDPOPUP | CMIF_HIDDEN;
+ mi.position=pos;
+ mi.popupPosition=poppos;
+ mi.hIcon=NULL;
+ mi.pszName=(char*)name;
+ mi.pszPopupName=(char*)rootid;
+ mi.pszService=(char*)service;
+ return Menu_AddContactMenuItem(&mi);
}
@@ -416,7 +415,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { g_hMenu[0] = AddMenuItem(sim301,110000,g_hICO[ICO_CM_EST],MODULENAME"/SIM_EST",CMIF_NOTOFFLINE);
g_hMenu[1] = AddMenuItem(sim302,110001,g_hICO[ICO_CM_DIS],MODULENAME"/SIM_DIS",CMIF_NOTOFFLINE);
- if(ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
+ if(ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) {
g_hMenu[2] = AddMenuItem(sim312[0],110002,NULL,NULL,CMIF_ROOTPOPUP);
g_hMenu[3] = AddSubItem(g_hMenu[2],sim232[0],110003,110002,MODULENAME"/SIM_ST_DIS");
g_hMenu[4] = AddSubItem(g_hMenu[2],sim232[1],110004,110002,MODULENAME"/SIM_ST_ENA");
@@ -450,7 +449,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { #if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("create Mode menu");
#endif
- if(ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
+ if(ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) {
g_hMenu[10] = AddMenuItem(sim311[0],110010,NULL,NULL,CMIF_ROOTPOPUP);
g_hMenu[11] = AddSubItem(g_hMenu[10],sim231[0],110011,110010,MODULENAME"/MODE_NAT");
g_hMenu[12] = AddSubItem(g_hMenu[10],sim231[1],110012,110010,MODULENAME"/MODE_PGP");
diff --git a/plugins/SecureIM/options.cpp b/plugins/SecureIM/options.cpp index fa61e021b4..3f84c98b10 100644 --- a/plugins/SecureIM/options.cpp +++ b/plugins/SecureIM/options.cpp @@ -1131,13 +1131,6 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) { SendMessage(GetDlgItem(hDlg,IDC_AAK),BM_SETCHECK,(bAAK)?BST_CHECKED:BST_UNCHECKED,0L);
SendMessage(GetDlgItem(hDlg,IDC_MCM),BM_SETCHECK,(bMCM)?BST_CHECKED:BST_UNCHECKED,0L);
-/* // CList_classic
- if (!ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
- EnableWindow(GetDlgItem(hDlg,IDC_ASI),FALSE);
- for(i=2;i<ADV_CNT;i++)
- EnableWindow(GetDlgItem(hDlg,IDC_ADV1+i),FALSE);
- }
-*/
// Advanced
SendMessage(GetDlgItem(hDlg, IDC_ADVICON), CB_SETCURSEL, bADV, 0);
if ( g_hCLIcon ) {
diff --git a/plugins/SeenPlugin/menu.c b/plugins/SeenPlugin/menu.c index c6a5ca8884..02f241b793 100644 --- a/plugins/SeenPlugin/menu.c +++ b/plugins/SeenPlugin/menu.c @@ -99,8 +99,7 @@ void InitMenuitem() cmi.pszContactOwner=NULL;
cmi.pszName="<none>";
cmi.pszService="LastSeenUserDetails";
-
- hmenuitem=(HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&cmi);
+ hmenuitem = Menu_AddContactMenuItem(&cmi);
hBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,BuildContactMenu);
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 7ca99f5601..496b279efd 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -968,23 +968,23 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) cl.ptszPopupName = _T("Sessions Manager");
cl.hIcon = hiSessions;
cl.pszService = MS_SESSIONS_SAVEUSERSESSION;
- hmSaveCurrentSession = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmSaveCurrentSession = Menu_AddMainMenuItem(&cl);
cl.ptszName = _T("Load session...");
cl.pszService = MS_SESSIONS_OPENMANAGER;
cl.hIcon = hiSessionsLoad;
- hmLoadLastSession = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmLoadLastSession = Menu_AddMainMenuItem(&cl);
cl.ptszName = _T("Close session");
cl.pszService = MS_SESSIONS_CLOSESESSION;
cl.hIcon = 0;
- hmLoadSession = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmLoadSession = Menu_AddMainMenuItem(&cl);
cl.ptszName = _T("Load last session");
cl.pszService = MS_SESSIONS_RESTORELASTSESSION;
cl.hIcon = hiSessionsLoadLast;
cl.position = 10100000;
- hmLoadSession = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmLoadSession = Menu_AddMainMenuItem(&cl);
ZeroMemory(&cl, sizeof(cl));
cl.cbSize = sizeof(cl);
diff --git a/plugins/SimpleAR/Src/Main.cpp b/plugins/SimpleAR/Src/Main.cpp index 1705ce2e00..ac9a2d002f 100644 --- a/plugins/SimpleAR/Src/Main.cpp +++ b/plugins/SimpleAR/Src/Main.cpp @@ -335,7 +335,7 @@ extern "C" int __declspec(dllexport)Load(PLUGINLINK *link) mi.position = 500090000;
mi.ptszName = _T("");
mi.pszService = protocolname"/ToggleEnable";
- hEnableMenu = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hEnableMenu = Menu_AddMainMenuItem(&mi);
hToggleAutoanswer = CreateServiceFunction(protocolname"/ToggleAutoanswer",Toggle);
ZeroMemory(&mi, sizeof(mi));
@@ -343,7 +343,7 @@ extern "C" int __declspec(dllexport)Load(PLUGINLINK *link) mi.position=-0x7FFFFFFF;
mi.ptszName=_T("");
mi.pszService=protocolname"/ToggleAutoanswer";
- hToggle = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hToggle = Menu_AddContactMenuItem(&mi);
//add hook
hOptHook = HookEvent(ME_OPT_INITIALISE, OptInit);
diff --git a/plugins/SimpleStatusMsg/awaymsg.cpp b/plugins/SimpleStatusMsg/awaymsg.cpp index 062b702254..4932f475a1 100644 --- a/plugins/SimpleStatusMsg/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/awaymsg.cpp @@ -508,7 +508,7 @@ int LoadAwayMsgModule(void) mi.position = -2000005000;
mi.ptszName = LPGENT("Re&ad Away Message");
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
- hAwayMsgMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hAwayMsgMenuItem = Menu_AddContactMenuItem(&mi);
mi.flags |= CMIF_ICONFROMICOLIB;
CreateServiceFunctionEx(MS_SIMPLESTATUSMSG_COPYMSG, CopyAwayMsgCommand);
@@ -516,14 +516,14 @@ int LoadAwayMsgModule(void) mi.icolibItem = GetIconHandle(IDI_COPY);
mi.ptszName = LPGENT("Copy Away Message");
mi.pszService = MS_SIMPLESTATUSMSG_COPYMSG;
- hCopyMsgMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hCopyMsgMenuItem = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionEx(MS_SIMPLESTATUSMSG_GOTOURLMSG, GoToURLMsgCommand);
mi.position = -2000007000;
mi.icolibItem = GetIconHandle(IDI_GOTOURL);
mi.ptszName = LPGENT("&Go to URL in Away Message");
mi.pszService = MS_SIMPLESTATUSMSG_GOTOURLMSG;
- hGoToURLMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hGoToURLMenuItem = Menu_AddContactMenuItem(&mi);
HookEventEx(ME_CLIST_PREBUILDCONTACTMENU, AwayMsgPreBuildMenu);
diff --git a/plugins/SimpleStatusMsg/main.cpp b/plugins/SimpleStatusMsg/main.cpp index def96c25c3..4cdaee3023 100644 --- a/plugins/SimpleStatusMsg/main.cpp +++ b/plugins/SimpleStatusMsg/main.cpp @@ -1711,7 +1711,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) mi.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
mi.ptszName = LPGENT("Status Message...");
mi.position = 2000200000;
- CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddStatusMenuItem(&mi);
mi.popupPosition = 500084000;
mi.position = 2000040000;
@@ -1746,7 +1746,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) mi.ptszPopupName = szBuffer;
}
else mi.ptszPopupName = pa[i]->tszAccountName;
- hProtoStatusMenuItem[i] = (HANDLE)CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ hProtoStatusMenuItem[i] = Menu_AddStatusMenuItem(&mi);
}
return 0;
diff --git a/plugins/SmileyAdd/main.cpp b/plugins/SmileyAdd/main.cpp index 2515c6c076..e0965d8655 100644 --- a/plugins/SmileyAdd/main.cpp +++ b/plugins/SmileyAdd/main.cpp @@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //globals
HINSTANCE g_hInst;
HANDLE hEvent1, hContactMenuItem;
-extern LIST<HANDLE> menuHandleArray;
+extern LIST<void> menuHandleArray;
char* metaProtoName;
@@ -105,7 +105,7 @@ static int ModulesLoaded(WPARAM, LPARAM) mi.icolibItem = hSkinIcon;
mi.pszPopupName = (char*)-1;
mi.pszName = "Assign Smiley Category";
- hContactMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hContactMenuItem = Menu_AddContactMenuItem(&mi);
DownloadInit();
@@ -124,7 +124,6 @@ static int MirandaShutdown(WPARAM, LPARAM) return 0;
}
-
extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
pluginLink = link;
diff --git a/plugins/SmileyAdd/services.cpp b/plugins/SmileyAdd/services.cpp index 71b43145dc..1993e7e733 100644 --- a/plugins/SmileyAdd/services.cpp +++ b/plugins/SmileyAdd/services.cpp @@ -27,8 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //globals, defined int main.cpp
extern HANDLE hEvent1, hContactMenuItem;
-LIST<HANDLE> menuHandleArray(5);
-
+LIST<void> menuHandleArray(5);
//implementation of service functions
@@ -444,7 +443,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
bool nonecheck = true;
- HANDLE* hMenu;
+ HGENMENU hMenu;
for (i = 0; i < smc.getCount(); i++)
{
@@ -462,7 +461,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) nonecheck = false;
}
- hMenu = (HANDLE*)CallService(MS_CLIST_ADDCONTACTMENUITEM, ind, (LPARAM)&mi);
+ hMenu = Menu_AddContactMenuItem(&mi);
menuHandleArray.insert(hMenu);
mi.flags &= ~CMIF_CHECKED;
}
@@ -470,13 +469,12 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.position = 1;
mi.popupPosition = 1;
mi.ptszName = _T("<None>");
- if (cat == _T("<None>"))
- {
+ if (cat == _T("<None>")) {
mi.flags |= CMIF_CHECKED;
nonecheck = false;
}
- hMenu = (HANDLE*)CallService(MS_CLIST_ADDCONTACTMENUITEM, 1, (LPARAM)&mi);
+ hMenu = Menu_AddContactMenuItem(&mi);
menuHandleArray.insert(hMenu);
mi.position = 2;
@@ -484,7 +482,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.ptszName = _T("Protocol specific");
if (nonecheck) mi.flags |= CMIF_CHECKED; else mi.flags &= ~CMIF_CHECKED;
- hMenu = (HANDLE*)CallService(MS_CLIST_ADDCONTACTMENUITEM, 2, (LPARAM)&mi);
+ hMenu = Menu_AddContactMenuItem(&mi);
menuHandleArray.insert(hMenu);
}
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 4e18efd5b7..008aa3b8f7 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -356,8 +356,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.position = -0x7FFFFFFF;
mi.ptszName = _T("Call Splash Service");
mi.pszService = "Splash/Test";
-
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
#endif
if (ServiceExists(MS_UPDATE_REGISTER))
diff --git a/plugins/StatusPlugins/KeepStatus/version.h b/plugins/StatusPlugins/KeepStatus/version.h index 26a301582a..bd3f501a94 100644 --- a/plugins/StatusPlugins/KeepStatus/version.h +++ b/plugins/StatusPlugins/KeepStatus/version.h @@ -1,9 +1,3 @@ -// Set the version number here - it will affect the version resource and the version field of the pluginInfo structure
-// (Be careful that you don't have the resource file open when you change this and rebuild, otherwise the changes may not
-// take effect within the version resource)
-// Do not forget to define symbol "_DEBUG" for resource compiler if you use debug configuration (in VisualStudio you can
-// find it under Project properties - Configuration properties - Resource - General - Preprocessor definitions)
-
// plugin version part
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 8
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 91b437f7ed..3aef57390c 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -537,8 +537,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP bInitDone = false;
TranslateDialogDefault(hwndDlg);
- if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
- SetDlgItemText(hwndDlg, IDC_CREATEMMI, TranslateT("Create a status menu item"));
+ SetDlgItemText(hwndDlg, IDC_CREATEMMI, TranslateT("Create a status menu item"));
profileCount = GetProfileCount((WPARAM)&defProfile, 0);
if (profileCount == 0) {
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 339733b31a..cc98753df6 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -132,17 +132,10 @@ static int CreateMainMenuItems(WPARAM wParam, LPARAM lParam) return 0;
}
mi.pszService = servicename;
- if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM)) {
- if (CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi)) {
- menuprofiles[mcount] = i;
- mcount += 1;
- }
- }
- else {
- if (CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi)) {
- menuprofiles[mcount] = i;
- mcount += 1;
- } } }
+ if (Menu_AddStatusMenuItem(&mi)) {
+ menuprofiles[mcount] = i;
+ mcount += 1;
+ } }
return 0;
}
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h index c1e8e69bb8..0d9a325839 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.h +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.h @@ -127,9 +127,6 @@ typedef struct { #define DOCKED_LEFT 1
#define DOCKED_RIGHT 2
-#ifndef MS_CLIST_ADDSTATUSMENUITEM
-#define MS_CLIST_ADDSTATUSMENUITEM "CList/AddStatusMenuItem"
-#endif
#define MS_SS_MENUSETPROFILEPREFIX "StartupStatus/SetProfile_"
// options
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index beac3f3481..1ff5a0ef28 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -78,7 +78,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
mi.ptszName = _T("Remove Temporary Contacts");
mi.pszService = pluginName"/RemoveTempContacts";
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
miranda::EventHooker::HookAll();
return 0;
diff --git a/plugins/Svc_crshdmp/crshdmp.cpp b/plugins/Svc_crshdmp/crshdmp.cpp index 6a800d837f..4869ed7182 100644 --- a/plugins/Svc_crshdmp/crshdmp.cpp +++ b/plugins/Svc_crshdmp/crshdmp.cpp @@ -321,7 +321,7 @@ static int ModulesLoaded(WPARAM, LPARAM) mi.icolibItem = GetIconHandle("versionInfo");
mi.ptszName = LPGENT("Version Information");
mi.pszPopupName = (char *)-1;
- HANDLE hMenuRoot = (HANDLE)CallService( MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ HANDLE hMenuRoot = Menu_AddMainMenuItem(&mi);
mi.flags = CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.pszPopupName = (char *)hMenuRoot;
@@ -331,46 +331,46 @@ static int ModulesLoaded(WPARAM, LPARAM) mi.ptszName = LPGENT("Copy to clipboard");
mi.icolibItem = GetIconHandle("storeToClip");
mi.pszService = MS_CRASHDUMPER_STORETOCLIP;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.position = 2000089996;
mi.ptszName = LPGENT("Store to file");
mi.icolibItem = GetIconHandle("storeToFile");
mi.pszService = MS_CRASHDUMPER_STORETOFILE;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.position = 2000089997;
mi.ptszName = LPGENT("Show");
mi.icolibItem = GetIconHandle("showInfo");
mi.pszService = MS_CRASHDUMPER_VIEWINFO;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.popupPosition = 1;
mi.position = 2000089998;
mi.ptszName = LPGENT("Show with DLLs");
mi.icolibItem = GetIconHandle("showInfo");
mi.pszService = MS_CRASHDUMPER_VIEWINFO;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.popupPosition = 0;
mi.position = 2000089999;
mi.ptszName = LPGENT("Upload");
mi.icolibItem = GetIconHandle("uploadInfo");
mi.pszService = MS_CRASHDUMPER_UPLOAD;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.position = 2000099990;
mi.ptszName = LPGENT("Open crash report directory");
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_EVENT_FILE);
mi.pszService = MS_CRASHDUMPER_URL;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.popupPosition = 1;
mi.position = 2000099991;
mi.ptszName = LPGENT("Open miranda-vi.org");
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_EVENT_URL);
mi.pszService = MS_CRASHDUMPER_URL;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
HOTKEYDESC hk = {0};
hk.cbSize = sizeof(hk);
diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp index 4860f13e09..a7145fe23f 100644 --- a/plugins/Svc_dbepp/main.cpp +++ b/plugins/Svc_dbepp/main.cpp @@ -302,14 +302,6 @@ INT_PTR ImportFromFile(WPARAM wParam,LPARAM lParam) extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
- CLISTMENUITEM mi;
-/*
- #ifndef NDEBUG //mem leak detector :-) Thanks Tornado!
- int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // Get current flag
- flag |= _CRTDBG_LEAK_CHECK_DF; // Turn on leak-checking bit
- _CrtSetDbgFlag(flag); // Set flag to the new value
- #endif
-*/
pluginLink = link;
mir_getMMI(&mmi);
mir_getUTFI( &utfi );
@@ -327,7 +319,8 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) sRegisterModule = CreateServiceFunction("DBEditorpp/RegisterModule", RegisterModule);
sRegisterSingleModule = CreateServiceFunction("DBEditorpp/RegisterSingleModule", RegisterSingleModule);
sImport = CreateServiceFunction("DBEditorpp/Import", ImportFromFile);
- ZeroMemory(&mi, sizeof(mi));
+
+ CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
mi.position = 1900000001;
mi.flags = CMIF_TCHAR;
@@ -335,7 +328,7 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) mi.ptszName = _T(modFullname);
mi.pszService = "DBEditorpp/MenuCommand";
mi.pszContactOwner = NULL;
- CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -345,7 +338,7 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) mi.ptszName = LPGENT("Open user tree in DBE++");
mi.pszService = "DBEditorpp/MenuCommand";
mi.pszContactOwner = NULL;
- hUserMenu = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hUserMenu = Menu_AddContactMenuItem(&mi);
sServicemodeLaunch = CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode);
diff --git a/plugins/Svc_vi/main.cpp b/plugins/Svc_vi/main.cpp index f6a9c7bd99..207e4fc433 100644 --- a/plugins/Svc_vi/main.cpp +++ b/plugins/Svc_vi/main.cpp @@ -121,21 +121,15 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) }
//Menu item
- //if (DBGetContactSettingByte(NULL, ModuleName, "MenuItem", TRUE)) {
- {
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.position = mi.popupPosition = 2000089999;
- mi.flags = 0;
- mi.hIcon = hiVIIcon;
- mi.pszName = Translate("Version Information");
- mi.pszService = MS_VERSIONINFO_MENU_COMMAND;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
-// mi.pszPopupName = "Version Information";
-// mi.popupPosition = 2;
-// mi.pszName = "Test 1";
-// CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &mi);
- }
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof(mi);
+ mi.position = mi.popupPosition = 2000089999;
+ mi.flags = 0;
+ mi.hIcon = hiVIIcon;
+ mi.pszName = Translate("Version Information");
+ mi.pszService = MS_VERSIONINFO_MENU_COMMAND;
+ Menu_AddMainMenuItem(&mi);
+
if (LoadLibraryA("RichEd32.dll") == NULL)
MessageBoxA(NULL, "d'oh", "d'oh", MB_OK);
diff --git a/plugins/TabSRMM/chat/services.cpp b/plugins/TabSRMM/chat/services.cpp index c24af3af6b..a7033f8a62 100644 --- a/plugins/TabSRMM/chat/services.cpp +++ b/plugins/TabSRMM/chat/services.cpp @@ -91,14 +91,14 @@ int Chat_ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN );
mi.pszName = LPGEN("&Join");
mi.pszService = "GChat/JoinChat";
- hJoinMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hJoinMenuItem = Menu_AddContactMenuItem(&mi);
mi.position = -2000090000;
mi.flags = CMIF_NOTOFFLINE | CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_LEAVE );
mi.pszName = LPGEN("&Leave");
mi.pszService = "GChat/LeaveChat";
- hLeaveMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hLeaveMenuItem = Menu_AddContactMenuItem(&mi);
CList_SetAllOffline(TRUE, NULL);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index a92d20c92c..c924b06675 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -258,7 +258,7 @@ void CGlobals::reloadSystemModulesChanged() }
mi.pszName = LPGEN("&Message");
mi.pszService = MS_MSG_SENDMESSAGE;
- PluginConfig.m_hMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ PluginConfig.m_hMenuItem = Menu_AddContactMenuItem(&mi);
m_useAeroPeek = M->GetByte("useAeroPeek", 1);
}
@@ -444,7 +444,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.pszContactOwner = NULL;
mi.pszName = LPGEN("&Messaging settings...");
mi.pszService = MS_TABMSG_SETUSERPREFS;
- PluginConfig.m_UserMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ PluginConfig.m_UserMenuItem = Menu_AddContactMenuItem(&mi);
if(sendLater->isAvail()) {
mi.cbSize = sizeof(mi);
@@ -453,7 +453,7 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.pszContactOwner = NULL;
mi.pszName = LPGEN("&Send later job list...");
mi.pszService = MS_TABMSG_SLQMGR;
- PluginConfig.m_UserMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) & mi);
+ PluginConfig.m_UserMenuItem = Menu_AddMainMenuItem(&mi);
}
RestoreUnreadMessageAlerts();
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 7878715850..4a892a9390 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -558,7 +558,7 @@ int TN_ModuleInit() }
mi.pszService = "TypingNotify/EnableDisableMenuCommand";
mi.pszPopupName = LPGEN("PopUps");
- hDisableMenu = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hDisableMenu = Menu_AddMainMenuItem(&mi);
}
SkinAddNewSoundEx("TNStart", "Instant messages", "Contact started typing");
SkinAddNewSoundEx("TNStop", "Instant messages", "Contact stopped typing");
diff --git a/plugins/Updater/common.h b/plugins/Updater/common.h index b1a070f78e..d51a1db85b 100644 --- a/plugins/Updater/common.h +++ b/plugins/Updater/common.h @@ -27,6 +27,7 @@ #include <m_netlib.h>
#include <m_utils.h>
#include <m_clist.h>
+#include <m_genmenu.h>
#include <m_icoLib.h>
#include <win2k.h>
diff --git a/plugins/Updater/options.cpp b/plugins/Updater/options.cpp index 22ace012a6..7539ce2047 100644 --- a/plugins/Updater/options.cpp +++ b/plugins/Updater/options.cpp @@ -9,30 +9,28 @@ HWND hwndOptions; HANDLE hMainMenuItemRestart, hMainMenuItemUpdateAndExit;
HANDLE hBackupPath, hDataPath, hArchivePath;
-void add_restart_menu_item() {
- CLISTMENUITEM menu = {0};
-
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
- menu.icolibItem = GetIconHandle(I_RSTRT);
-
- menu.pszName = "Restart";
- menu.pszService= MS_UPDATE_MENURESTART;
- menu.position = 2000099900;
- hMainMenuItemRestart = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+void add_restart_menu_item()
+{
+ CLISTMENUITEM mi = {0};
+ mi.cbSize=sizeof(mi);
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = GetIconHandle(I_RSTRT);
+ mi.pszName = "Restart";
+ mi.pszService= MS_UPDATE_MENURESTART;
+ mi.position = 2000099900;
+ hMainMenuItemRestart = Menu_AddMainMenuItem(&mi);
}
-void add_update_and_exit_menu_item() {
- CLISTMENUITEM menu = {0};
-
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
- menu.icolibItem = GetIconHandle(I_CHKUPDEXT);
-
- menu.pszName = "Update and Exit";
- menu.pszService= MS_UPDATE_MENUUPDATEANDEXIT;
- menu.position = 2000099901;
- hMainMenuItemUpdateAndExit = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+void add_update_and_exit_menu_item()
+{
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = GetIconHandle(I_CHKUPDEXT);
+ mi.pszName = "Update and Exit";
+ mi.pszService = MS_UPDATE_MENUUPDATEANDEXIT;
+ mi.position = 2000099901;
+ hMainMenuItemUpdateAndExit = Menu_AddMainMenuItem(&mi);
}
void remove_restart_menu_item() {
diff --git a/plugins/Updater/services.cpp b/plugins/Updater/services.cpp index 8d3883b895..3b11ddf850 100644 --- a/plugins/Updater/services.cpp +++ b/plugins/Updater/services.cpp @@ -788,26 +788,26 @@ VOID CALLBACK StartupTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwT HANDLE hEventServicesModulesLoaded2;
-int ServicesModulesLoaded(WPARAM wParam, LPARAM lParam) {
+int ServicesModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
// add main menu item
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = {0};
- menu.cbSize=sizeof(menu);
- menu.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
- menu.icolibItem = GetIconHandle(I_CHKUPD);
+ mi.cbSize=sizeof(mi);
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = GetIconHandle(I_CHKUPD);
- menu.pszName = "Check for updates";
- menu.pszService= MS_UPDATE_CHECKFORUPDATES;
- menu.position = 500010000;
+ mi.pszName = "Check for updates";
+ mi.pszService= MS_UPDATE_CHECKFORUPDATES;
+ mi.position = 500010000;
-#ifdef MS_CLIST_ADDGROUPMENUITEM
- if (ServiceExists(MS_CLIST_ADDGROUPMENUITEM)) {
+ if (ServiceExists(MS_CLIST_REMOVEGROUPMENUITEM)) {
GroupMenuParam gmp = {0};
- hGroupMenuItem = (HANDLE)CallService(MS_CLIST_ADDGROUPMENUITEM,(WPARAM)&gmp,(LPARAM)&menu);
+ hGroupMenuItem = Menu_AddGroupMenuItem(&gmp, &mi);
}
-#endif
- hMainMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
+
+ hMainMenuItem = Menu_AddMainMenuItem(&mi);
hEventServicesModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ServicesModulesLoaded2);
startup_timer_id = SetTimer(0, 0, 5000, StartupTimerProc);
diff --git a/plugins/UserGuide/main.c b/plugins/UserGuide/main.c index 95b7c6b731..8e63d94d08 100644 --- a/plugins/UserGuide/main.c +++ b/plugins/UserGuide/main.c @@ -93,7 +93,7 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_HELP);
mi.pszName=LPGEN("User Guide");
mi.pszService="UserGuide/ShowGuide";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/plugins/UserInfoEx/mir_menuitems.cpp b/plugins/UserInfoEx/mir_menuitems.cpp index 9fd7f031a6..05707ba7c0 100644 --- a/plugins/UserInfoEx/mir_menuitems.cpp +++ b/plugins/UserInfoEx/mir_menuitems.cpp @@ -118,7 +118,7 @@ VOID RebuildContact() mi.popupPosition = 1000050000;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
mi.pszName = LPGEN(MODULELONGNAME);
- mhRoot = (HGENMENU) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ mhRoot = Menu_AddContactMenuItem(&mi);
hMenuItem[item++] = mhRoot;
mhExIm = mhRoot;
break;
@@ -128,7 +128,7 @@ VOID RebuildContact() mi.popupPosition = 1000050100;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Ex-/Import contact");
- mhExIm = (HGENMENU) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ mhExIm = Menu_AddContactMenuItem(&mi);
hMenuItem[item++] = mhExIm;
mhRoot = HGENMENU_ROOT;
break;
@@ -146,7 +146,7 @@ VOID RebuildContact() mi.position = 1000050000;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
mi.hotKey = MAKELPARAM(VK_F3, MOD_ALT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddContactMenuItem(&mi);
mi.hotKey = NULL;
}
@@ -158,14 +158,14 @@ VOID RebuildContact() mi.pszName = mhExIm != HGENMENU_ROOT ? LPGEN("&Export") : LPGEN("&Export User Details");
mi.position = 1000050200;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddContactMenuItem(&mi);
// Import
mi.pszService = MS_USERINFO_VCARD_IMPORT;
mi.pszName = mhExIm != HGENMENU_ROOT ? LPGEN("&Import") : LPGEN("&Import User Details");
mi.position = 1000050300;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddContactMenuItem(&mi);
}
}
@@ -217,7 +217,7 @@ VOID RebuildMain() mi.popupPosition = 500050000;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
mi.pszName = LPGEN(MODULELONGNAME);
- mhRoot = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ mhRoot = Menu_AddMainMenuItem(&mi);
hMenuItem[item++] = mhRoot;
mhExIm = mhRoot;
break;
@@ -227,7 +227,7 @@ VOID RebuildMain() mi.popupPosition = 500050000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Ex-/Import contact");
- mhExIm = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ mhExIm = Menu_AddMainMenuItem(&mi);
hMenuItem[item++] = mhExIm;
mhRoot = HGENMENU_ROOT;
break;
@@ -244,7 +244,7 @@ VOID RebuildMain() mi.pszName = LPGEN("View/Change My &Details...");
mi.position = 500050000;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
// VCard's Ex/Import menuitems
@@ -255,14 +255,14 @@ VOID RebuildMain() mi.pszName = LPGEN("Export all contacts");
mi.position = 500150000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// Import
mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
mi.pszName = LPGEN("Import all contacts");
mi.position = 500151000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
mi.hParentMenu = mhRoot;
@@ -278,13 +278,13 @@ VOID RebuildMain() mi.pszName = LPGEN("Backup birthdays");
mi.position = 500253000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_BDAY_BACKUP);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// Check anniversaries
mi.pszService = MS_USERINFO_REMINDER_CHECK;
mi.pszName = LPGEN("Check anniversaries");
mi.position = 500251000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_SEARCH);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
else {
hMenuItem[item++] = NULL;
@@ -295,7 +295,7 @@ VOID RebuildMain() mi.pszName = LPGEN("Refresh Contact Details");
mi.position = 500254000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_UPDATE);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
// anniversary list
@@ -304,7 +304,7 @@ VOID RebuildMain() mi.pszName = LPGEN("Anniversary list");
mi.position = 500252000;
mi.hIcon = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
}
@@ -363,7 +363,7 @@ VOID RebuildGroup() mi.popupPosition = 250000;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
mi.pszName = LPGEN(MODULELONGNAME);
- mhRoot = (HGENMENU) CallService(MS_CLIST_ADDGROUPMENUITEM, 0, (LPARAM)&mi);
+ mhRoot = Menu_AddGroupMenuItem(0, &mi);
hMenuItem[item++] = mhRoot;
mhExIm = mhRoot;
break;
@@ -373,7 +373,7 @@ VOID RebuildGroup() mi.popupPosition = 250100;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Ex-/Import contact");
- mhExIm = (HGENMENU) CallService(MS_CLIST_ADDGROUPMENUITEM, 0, (LPARAM)&mi);
+ mhExIm = Menu_AddGroupMenuItem(0, &mi);
hMenuItem[item++] = mhExIm;
mhRoot = HGENMENU_ROOT;
break;
@@ -391,14 +391,14 @@ VOID RebuildGroup() mi.pszName = LPGEN("Export all contacts");
mi.position = 250200;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDGROUPMENUITEM, (WPARAM)&gmp, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
// Import
mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
mi.pszName = LPGEN("Import all contacts");
mi.position = 250300;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDGROUPMENUITEM, (WPARAM)&gmp, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
}
}
@@ -461,7 +461,7 @@ VOID RebuildSubGroup() mi.popupPosition = 1050000;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
mi.pszName = LPGEN(MODULELONGNAME);
- mhRoot = (HGENMENU) CallService(MS_CLIST_ADDSUBGROUPMENUITEM, 0, (LPARAM)&mi);
+ mhRoot = Menu_AddSubGroupMenuItem(0, &mi);
hMenuItem[item++] = mhRoot;
mhExIm = mhRoot;
break;
@@ -471,7 +471,7 @@ VOID RebuildSubGroup() mi.popupPosition = 1050100;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Ex-/Import Group");
- mhExIm = (HGENMENU) CallService(MS_CLIST_ADDSUBGROUPMENUITEM, 0, (LPARAM)&mi);
+ mhExIm = Menu_AddSubGroupMenuItem(0, &mi);
hMenuItem[item++] = mhExIm;
mhRoot = HGENMENU_ROOT;
break;
@@ -492,7 +492,7 @@ VOID RebuildSubGroup() mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
gmp.lParam=0;
gmp.wParam=TRUE;
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDSUBGROUPMENUITEM, (WPARAM)&gmp, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
// Import
strcpy( tDest, "/ImportGroup"); //mi.pszService
@@ -502,7 +502,7 @@ VOID RebuildSubGroup() mi.hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
gmp.lParam=0;
gmp.wParam=FALSE;
- hMenuItem[item++] = (HGENMENU) CallService(MS_CLIST_ADDSUBGROUPMENUITEM, (WPARAM)&gmp, (LPARAM)&mi);
+ hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
}
}
@@ -588,14 +588,14 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) mhExIm = mhRoot;
// seperator
mi.position = 50100;
- hMenuItemAccount[mItems*i + item++] = (HGENMENU) CallService( MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
break;
case 5:
//cascade all
mi.position = 50100;
mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
mi.ptszName = TranslateT(MODULELONGNAME);
- hMenuItemAccount[mItems*i + item] = (HGENMENU) CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemAccount[mItems*i + item] = Menu_AddStatusMenuItem(&mi);
mhRoot = hMenuItemAccount[mItems*i + item++];
mhExIm = mhRoot;
break;
@@ -605,7 +605,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mir_sntprintf(sztName, SIZEOF(sztName),_T("%s %s"), pAccountName->tszAccountName, TranslateT("Ex-/Import"));
mi.ptszName = sztName;
- hMenuItemAccount[mItems*i + item] = (HGENMENU) CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemAccount[mItems*i + item] = Menu_AddStatusMenuItem(&mi);
mhExIm = hMenuItemAccount[mItems*i + item++];
break;
default:
@@ -624,7 +624,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) mi.ptszName = sztName;
mi.position = 50200;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItemAccount[mItems*i + item++] = (HGENMENU) CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
// Import
strcpy( tDest, "/ImportAccount"); //mi.pszService
@@ -633,7 +633,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) mi.ptszName = sztName;
mi.position = 50300;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItemAccount[mItems*i + item++] = (HGENMENU) CallService(MS_CLIST_ADDSTATUSMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
}
}
return 0;
diff --git a/plugins/UserInfoEx/svc_email.cpp b/plugins/UserInfoEx/svc_email.cpp index 2d74c96e75..d1a8ba02d6 100644 --- a/plugins/UserInfoEx/svc_email.cpp +++ b/plugins/UserInfoEx/svc_email.cpp @@ -265,7 +265,7 @@ VOID SvcEMailRebuildMenu() mi.hIcon = IcoLib_GetIcon(ICO_BTN_EMAIL);
mi.pszName = "&E-mail";
mi.pszService = MS_EMAIL_SENDEMAIL;
- ghMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ ghMenuItem = Menu_AddContactMenuItem(&mi);
}
}
else
diff --git a/plugins/UserInfoEx/svc_homepage.cpp b/plugins/UserInfoEx/svc_homepage.cpp index 4d0ac22554..4c0a619168 100644 --- a/plugins/UserInfoEx/svc_homepage.cpp +++ b/plugins/UserInfoEx/svc_homepage.cpp @@ -224,7 +224,7 @@ VOID SvcHomepageRebuildMenu() mi.hIcon = IcoLib_GetIcon(ICO_BTN_GOTO);
mi.pszName = "&Homepage";
mi.pszService = MS_USERINFO_HOMEPAGE_OPENURL;
- ghMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ ghMenuItem = Menu_AddContactMenuItem(&mi);
}
}
else
diff --git a/plugins/WhenWasIt/hooked_events.cpp b/plugins/WhenWasIt/hooked_events.cpp index e24e642612..41a956f1b1 100644 --- a/plugins/WhenWasIt/hooked_events.cpp +++ b/plugins/WhenWasIt/hooked_events.cpp @@ -127,35 +127,35 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) cl.pszService = MS_WWI_CHECK_BIRTHDAYS;
cl.pszName = "Check for birthdays";
cl.pszPopupName = "Birthdays (When Was It)";
- hmCheckBirthdays = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmCheckBirthdays = Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_LIST_SHOW;
cl.pszName = "Birthday list";
cl.hIcon = hiListMenu;
- hmBirthdayList = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmBirthdayList = Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_REFRESH_USERDETAILS;
cl.position = 10100000;
cl.pszName = "Refresh user details";
cl.hIcon = hiRefreshUserDetails;
- hmRefreshDetails = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmRefreshDetails = Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_IMPORT_BIRTHDAYS;
cl.position = 10200000;
cl.pszName = "Import birthdays";
cl.hIcon = hiImportBirthdays;
- hmImportBirthdays = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmImportBirthdays = Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_EXPORT_BIRTHDAYS;
cl.pszName = "Export birthdays";
cl.hIcon = hiExportBirthdays;
- hmExportBirthdays = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM) &cl);
+ hmExportBirthdays = Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_ADD_BIRTHDAY;
cl.position = 10000000;
cl.hIcon = hiAddBirthdayContact;
cl.pszName = "Add/change user &birthday";
- hmAddChangeBirthday = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &cl);
+ hmAddChangeBirthday = Menu_AddMainMenuItem(&cl);
if(ServiceExists(MS_HOTKEY_REGISTER)) {
HOTKEYDESC hotkey = {0};
diff --git a/plugins/YAPP/services.cpp b/plugins/YAPP/services.cpp index 751b82387e..12b7110264 100644 --- a/plugins/YAPP/services.cpp +++ b/plugins/YAPP/services.cpp @@ -242,11 +242,11 @@ INT_PTR IsSecondLineShown(WPARAM wParam, LPARAM lParam) { }
void UpdateMenu() {
- CLISTMENUITEM menu = {0};
- menu.cbSize = sizeof(CLISTMENUITEM);
- menu.pszName = (char*)(DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1 ? LPGEN("Disable Popups") : LPGEN("Enable Popups"));
- menu.flags = CMIM_NAME;// | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggleOnOff, (LPARAM)&menu);
+ CLISTMENUITEM mi = {0};
+ mi.cbSize = sizeof(CLISTMENUITEM);
+ mi.pszName = (char*)(DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1 ? LPGEN("Disable Popups") : LPGEN("Enable Popups"));
+ mi.flags = CMIM_NAME;// | CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggleOnOff, (LPARAM)&mi);
}
INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam) {
@@ -485,25 +485,25 @@ void InitServices() hService[i++] = CreateServiceFunction("YAPP/RegisterClass", RegisterPopupClass);
hService[i++] = CreateServiceFunction("YAPP/ClassInstance", CreateClassPopup);
- CLISTMENUITEM menu = {0};
+ CLISTMENUITEM mi = {0};
- menu.cbSize = sizeof(menu);
- menu.flags = CMIM_ALL;
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_ALL;
- menu.position = 500010000;
- menu.pszPopupName = LPGEN("PopUps");
+ mi.position = 500010000;
+ mi.pszPopupName = LPGEN("PopUps");
hiPopupHistory = LoadIcon(hInst, MAKEINTRESOURCE(IDI_POPUP_HISTORY));
- menu.hIcon = hiPopupHistory;
- menu.pszService= MS_POPUP_SHOWHISTORY;
- menu.pszName = LPGEN("Popup History");
- hMenuShowHistory = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu);
+ mi.hIcon = hiPopupHistory;
+ mi.pszService= MS_POPUP_SHOWHISTORY;
+ mi.pszName = LPGEN("Popup History");
+ hMenuShowHistory = Menu_AddMainMenuItem(&mi);
- menu.hIcon = NULL;
- menu.pszService = "PopUp/ToggleEnabled";
- menu.pszName = (char*)(DBGetContactSettingByte(0, MODULE, "Enabled", 1) ?
+ mi.hIcon = NULL;
+ mi.pszService = "PopUp/ToggleEnabled";
+ mi.pszName = (char*)(DBGetContactSettingByte(0, MODULE, "Enabled", 1) ?
LPGEN("Disable Popups") : LPGEN("Enable Popups"));
- hMenuToggleOnOff = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu);
+ hMenuToggleOnOff = Menu_AddMainMenuItem(&mi);
hEventBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildMenu);
}
diff --git a/plugins/ZeroNotification/main.c b/plugins/ZeroNotification/main.c index 914df953ee..077b9748a8 100644 --- a/plugins/ZeroNotification/main.c +++ b/plugins/ZeroNotification/main.c @@ -17,7 +17,7 @@ HINSTANCE hInst; PLUGINLINK *pluginLink;
static HANDLE hEventSoundSettingChange, hEventStatusModeChange, hEventOptionsInitialize, hAckEvent;
CLISTMENUITEM mi;
-int noSoundMenu;
+HGENMENU noSoundMenu;
int hLangpack;
struct CheckBoxValues_t {
@@ -281,8 +281,8 @@ int __declspec(dllexport) Load(PLUGINLINK *link) mi.flags=0;
UpdateMenuItem();
- mi.pszService=PLUGINNAME_SHORT "/MenuCommand";
- noSoundMenu = CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ mi.pszService = PLUGINNAME_SHORT "/MenuCommand";
+ noSoundMenu = Menu_AddMainMenuItem(&mi);
}
//The menu item - end
diff --git a/protocols/AimOscar/theme.cpp b/protocols/AimOscar/theme.cpp index 315fd1d0e4..326401052c 100644 --- a/protocols/AimOscar/theme.cpp +++ b/protocols/AimOscar/theme.cpp @@ -445,18 +445,16 @@ void CAimProto::InitMainMenus(void) mi.cbSize = sizeof(mi);
HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName);
- if (hRoot == NULL)
- {
+ if (hRoot == NULL) {
mi.flags = CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle("aim");
mi.ptszName = m_tszUserName;
mi.hParentMenu = HGENMENU_ROOT;
mi.popupPosition = 500090000;
mi.position = 500090000;
- hRoot = hMenuRoot = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
- else
- {
+ else {
RemoveMainMenus();
hMenuRoot = NULL;
}
@@ -470,21 +468,21 @@ void CAimProto::InitMainMenus(void) mi.position = 201001;
mi.icolibItem = GetIconHandle("aim");
mi.pszName = LPGEN("Manage Account");
- hMainMenu[0] = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/InstantIdle");
CreateProtoService("/InstantIdle",&CAimProto::InstantIdle);
mi.position = 201002;
mi.icolibItem = GetIconHandle("idle");
mi.pszName = LPGEN("Instant Idle");
- hMainMenu[1] = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CAimProto::JoinChatUI);
mi.position = 201003;
mi.icolibItem = GetIconHandle("aol");
mi.pszName = LPGEN( "Join Chat Room" );
- hMainMenu[2] = (HGENMENU)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
}
void CAimProto::InitContactMenus(void)
@@ -503,7 +501,7 @@ void CAimProto::InitContactMenus(void) mi.icolibItem = GetIconHandle("away");
mi.pszName = LPGEN("Read &HTML Away Message");
mi.flags = CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_ICONFROMICOLIB;
- hHTMLAwayContextMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetProfile");
CreateProtoService("/GetProfile", &CAimProto::GetProfile);
@@ -511,7 +509,7 @@ void CAimProto::InitContactMenus(void) mi.icolibItem = GetIconHandle("profile");
mi.pszName = LPGEN("Read Profile");
mi.flags = CMIF_NOTOFFLINE | CMIF_ICONFROMICOLIB;
- hReadProfileMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
@@ -519,7 +517,7 @@ void CAimProto::InitContactMenus(void) mi.icolibItem = GetIconHandle("add");
mi.pszName = LPGEN("Add To Server List");
mi.flags = CMIF_NOTONLINE | CMIF_HIDDEN | CMIF_ICONFROMICOLIB;
- hAddToServerListContextMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/BlockCommand");
CreateProtoService("/BlockCommand", &CAimProto::BlockBuddy);
@@ -527,7 +525,7 @@ void CAimProto::InitContactMenus(void) mi.icolibItem = GetIconHandle("block");
mi.pszName = LPGEN("&Block");
mi.flags = CMIF_ICONFROMICOLIB | CMIF_HIDDEN;
- hBlockContextMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hBlockContextMenuItem = Menu_AddContactMenuItem(&mi);
}
void CAimProto::RemoveMainMenus(void)
diff --git a/protocols/FacebookRM/theme.cpp b/protocols/FacebookRM/theme.cpp index c6712c37ee..02c28a4b8e 100644 --- a/protocols/FacebookRM/theme.cpp +++ b/protocols/FacebookRM/theme.cpp @@ -158,40 +158,35 @@ void InitContactMenus() mi.pszName = GetIconDescription("homepage");
mi.pszService = "FacebookProto/VisitProfile";
g_hContactMenuSvc[CMI_VISIT_PROFILE] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::VisitProfile>);
- g_hContactMenuItems[CMI_VISIT_PROFILE] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_VISIT_PROFILE] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006001;
mi.icolibItem = GetIconHandle("authRevoke");
mi.pszName = GetIconDescription("authRevoke");
mi.pszService = "FacebookProto/CancelFriendship";
g_hContactMenuSvc[CMI_AUTH_REVOKE] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::CancelFriendship>);
- g_hContactMenuItems[CMI_AUTH_REVOKE] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_REVOKE] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006001;
mi.icolibItem = GetIconHandle("authRevokeReq");
mi.pszName = GetIconDescription("authRevokeReq");
mi.pszService = "FacebookProto/CancelFriendshipRequest";
g_hContactMenuSvc[CMI_AUTH_CANCEL] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::OnCancelFriendshipRequest>);
- g_hContactMenuItems[CMI_AUTH_CANCEL] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_CANCEL] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006002;
mi.icolibItem = GetIconHandle("authAsk");
mi.pszName = GetIconDescription("authAsk");
mi.pszService = "FacebookProto/RequestFriendship";
g_hContactMenuSvc[CMI_AUTH_ASK] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::RequestFriendship>);
- g_hContactMenuItems[CMI_AUTH_ASK] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_ASK] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006003;
mi.icolibItem = GetIconHandle("authGrant");
mi.pszName = GetIconDescription("authGrant");
mi.pszService = "FacebookProto/ApproveFriendship";
g_hContactMenuSvc[CMI_AUTH_GRANT] = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::ApproveFriendship>);
- g_hContactMenuItems[CMI_AUTH_GRANT] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
}
void UninitContactMenus()
@@ -255,8 +250,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | ( this->isOnline() ? 0 : CMIF_GRAYED );
mi.icolibItem = GetIconHandle( "facebook" );
mi.ptszName = m_tszUserName;
- hRoot = m_hMenuRoot = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDPROTOMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ hRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
} else {
if ( m_hMenuRoot )
CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )m_hMenuRoot, 0 );
@@ -271,8 +265,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) mi.hParentMenu = hRoot;
mi.pszName = LPGEN("Mind...");
mi.icolibItem = GetIconHandle("mind");
- m_hStatusMind = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDPROTOMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ m_hStatusMind = Menu_AddProtoMenuItem(&mi);
CreateProtoService(m_szModuleName,"/VisitProfile",&FacebookProto::VisitProfile,this);
strcpy(tDest,"/VisitProfile");
@@ -280,8 +273,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) mi.pszName = LPGEN("Visit Profile");
mi.icolibItem = GetIconHandle("homepage");
// TODO RM: remember and properly free in destructor?
- /*m_hStatusMind = */reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDPROTOMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ /*m_hStatusMind = */Menu_AddProtoMenuItem(&mi);
return 0;
}
diff --git a/protocols/GTalkExt/menu.cpp b/protocols/GTalkExt/menu.cpp index fc1a2f5503..26c81a165f 100644 --- a/protocols/GTalkExt/menu.cpp +++ b/protocols/GTalkExt/menu.cpp @@ -67,7 +67,7 @@ BOOL InitMenus(BOOL init) cmi.hIcon = g_hPopupIcon;
cmi.ptszName = _T(OPEN_MAILBOX_ITEM_CAPTION);
cmi.pszService = MS_GTALKEXT_OPENMAILBOX;
- hOpenMailboxMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&cmi);
+ hOpenMailboxMenuItem = Menu_AddContactMenuItem(&cmi);
if (!hOpenMailboxMenuItem) {
InitMenus(FALSE);
diff --git a/protocols/Gadu-Gadu/gg.c b/protocols/Gadu-Gadu/gg.c index 2cc361b57a..8e573ba6ce 100644 --- a/protocols/Gadu-Gadu/gg.c +++ b/protocols/Gadu-Gadu/gg.c @@ -317,7 +317,7 @@ static void gg_block_init(GGPROTO *gg) mi.pszName = LPGEN("&Block");
mi.pszService = service;
mi.pszContactOwner = GG_PROTO;
- gg->hBlockMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ gg->hBlockMenuItem = Menu_AddContactMenuItem(&mi);
gg->hPrebuildMenuHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, gg_prebuildcontactmenu);
}
@@ -345,7 +345,7 @@ void gg_menus_init(GGPROTO *gg) mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_GG);
- hGCRoot = hCLRoot = hRoot = gg->hMenuRoot = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ hGCRoot = hCLRoot = hRoot = gg->hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else
{
@@ -355,12 +355,12 @@ void gg_menus_init(GGPROTO *gg) mi.ptszName = LPGENT("Conference");
mi.position = 200001;
mi.icolibItem = GetIconHandle(IDI_CONFERENCE);
- hGCRoot = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ hGCRoot = Menu_AddProtoMenuItem(&mi);
mi.ptszName = LPGENT("Contact list");
mi.position = 200002;
mi.icolibItem = GetIconHandle(IDI_LIST);
- hCLRoot = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ hCLRoot = Menu_AddProtoMenuItem(&mi);
if (gg->hMenuRoot)
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)gg->hMenuRoot, 0);
diff --git a/protocols/Gadu-Gadu/groupchat.c b/protocols/Gadu-Gadu/groupchat.c index 9ead102cf8..ddeea1a7cf 100644 --- a/protocols/Gadu-Gadu/groupchat.c +++ b/protocols/Gadu-Gadu/groupchat.c @@ -79,7 +79,7 @@ void gg_gc_menus_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_CONFERENCE);
mi.pszName = LPGEN("Open &conference...");
mi.pszService = service;
- gg->hMainMenu[0] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
// Clear ignored conferences
mir_snprintf(service, sizeof(service), GGS_CLEAR_IGNORED, GG_PROTO);
@@ -88,7 +88,7 @@ void gg_gc_menus_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_CLEAR_CONFERENCE);
mi.pszName = LPGEN("&Clear ignored conferences");
mi.pszService = service;
- gg->hMainMenu[1] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
}
}
diff --git a/protocols/Gadu-Gadu/image.c b/protocols/Gadu-Gadu/image.c index fa32fedee9..b04bb758b4 100644 --- a/protocols/Gadu-Gadu/image.c +++ b/protocols/Gadu-Gadu/image.c @@ -82,7 +82,7 @@ int gg_img_init(GGPROTO *gg) mi.pszName = LPGEN("&Image");
mi.pszService = service;
mi.pszContactOwner = GG_PROTO;
- gg->hImageMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ gg->hImageMenuItem = Menu_AddContactMenuItem(&mi);
// Receive image
mir_snprintf(service, sizeof(service), GGS_RECVIMAGE, GG_PROTO);
diff --git a/protocols/Gadu-Gadu/import.c b/protocols/Gadu-Gadu/import.c index 43a0367402..460c417a0e 100644 --- a/protocols/Gadu-Gadu/import.c +++ b/protocols/Gadu-Gadu/import.c @@ -630,7 +630,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_IMPORT_SERVER);
mi.pszName = LPGEN("Import List From &Server");
mi.pszService = service;
- gg->hMainMenu[2] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[2] = Menu_AddProtoMenuItem(&mi);
// Import from textfile
mir_snprintf(service, sizeof(service), GGS_IMPORT_TEXT, GG_PROTO);
@@ -639,7 +639,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_IMPORT_TEXT);
mi.pszName = LPGEN("Import List From &Text File...");
mi.pszService = service;
- gg->hMainMenu[3] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[3] = Menu_AddProtoMenuItem(&mi);
// Remove from server
mir_snprintf(service, sizeof(service), GGS_REMOVE_SERVER, GG_PROTO);
@@ -648,7 +648,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_REMOVE_SERVER);
mi.pszName = LPGEN("&Remove List From Server");
mi.pszService = service;
- gg->hMainMenu[4] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[4] = Menu_AddProtoMenuItem(&mi);
// Export to server
mir_snprintf(service, sizeof(service), GGS_EXPORT_SERVER, GG_PROTO);
@@ -657,7 +657,7 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_EXPORT_SERVER);
mi.pszName = LPGEN("Export List To &Server");
mi.pszService = service;
- gg->hMainMenu[5] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[5] = Menu_AddProtoMenuItem(&mi);
// Export to textfile
mir_snprintf(service, sizeof(service), GGS_EXPORT_TEXT, GG_PROTO);
@@ -666,5 +666,5 @@ void gg_import_init(GGPROTO *gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_EXPORT_TEXT);
mi.pszName = LPGEN("Export List To &Text File...");
mi.pszService = service;
- gg->hMainMenu[6] = (HANDLE)CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM) &mi);
+ gg->hMainMenu[6] = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/Gadu-Gadu/sessions.c b/protocols/Gadu-Gadu/sessions.c index 39348fef61..d5ea8b5577 100644 --- a/protocols/Gadu-Gadu/sessions.c +++ b/protocols/Gadu-Gadu/sessions.c @@ -441,5 +441,5 @@ void gg_sessions_menus_init(GGPROTO* gg, HGENMENU hRoot) mi.icolibItem = GetIconHandle(IDI_SESSIONS);
mi.ptszName = LPGENT("Concurrent &sessions");
mi.pszService = service;
- CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/IRCG/services.cpp b/protocols/IRCG/services.cpp index 5d9e7d068f..745ebe80d6 100644 --- a/protocols/IRCG/services.cpp +++ b/protocols/IRCG/services.cpp @@ -41,7 +41,7 @@ void CIrcProto::InitMainMenus(void) mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MAIN);
- hRoot = hMenuRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
if (hMenuRoot)
@@ -55,7 +55,7 @@ void CIrcProto::InitMainMenus(void) strcpy( d, IRC_QUICKCONNECT );
mi.position = 201001;
mi.hParentMenu = hRoot;
- hMenuQuick = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuQuick = Menu_AddProtoMenuItem(&mi);
if (m_iStatus != ID_STATUS_OFFLINE) mi.flags |= CMIF_GRAYED;
@@ -63,26 +63,26 @@ void CIrcProto::InitMainMenus(void) mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);//GetIconHandle(IDI_JOIN);
strcpy( d, IRC_JOINCHANNEL );
mi.position = 201002;
- hMenuJoin = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuJoin = Menu_AddProtoMenuItem(&mi);
mi.pszName = LPGEN("&Change your nickname");
mi.icolibItem = GetIconHandle(IDI_RENAME);
strcpy( d, IRC_CHANGENICK );
mi.position = 201003;
- hMenuNick = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuNick = Menu_AddProtoMenuItem(&mi);
mi.pszName = LPGEN("Show the &list of available channels");
mi.icolibItem = GetIconHandle(IDI_LIST);
strcpy( d, IRC_SHOWLIST );
mi.position = 201004;
- hMenuList = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuList = Menu_AddProtoMenuItem(&mi);
if (m_useServer) mi.flags &= ~CMIF_GRAYED;
mi.pszName = LPGEN("&Show the server window");
mi.icolibItem = GetIconHandle(IDI_SERVER);
strcpy( d, IRC_SHOWSERVER );
mi.position = 201005;
- hMenuServer = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hMenuServer = Menu_AddProtoMenuItem(&mi);
}
}
@@ -157,28 +157,28 @@ void InitContactMenus(void) mi.icolibItem = GetIconHandle(IDI_MANAGER);
strcpy(d, IRC_UM_CHANSETTINGS);
mi.popupPosition = 500090002;
- hUMenuChanSettings = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuChanSettings = Menu_AddContactMenuItem(&mi);
hMenuChanSettings = CreateServiceFunction(temp, IrcMenuChanSettings);
mi.pszName = LPGEN("&WhoIs info");
mi.icolibItem = GetIconHandle(IDI_WHOIS);
strcpy(d, IRC_UM_WHOIS);
mi.popupPosition = 500090001;
- hUMenuWhois = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuWhois = Menu_AddContactMenuItem(&mi);
hMenuWhois = CreateServiceFunction(temp, IrcMenuWhois);
mi.pszName = LPGEN("Di&sconnect");
mi.icolibItem = GetIconHandle(IDI_DELETE);
strcpy(d, IRC_UM_DISCONNECT);
mi.popupPosition = 500090001;
- hUMenuDisconnect = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuDisconnect = Menu_AddContactMenuItem(&mi);
hMenuDisconnect = CreateServiceFunction(temp, IrcMenuDisconnect);
mi.pszName = LPGEN("&Add to ignore list");
mi.icolibItem = GetIconHandle(IDI_BLOCK);
strcpy(d, IRC_UM_IGNORE);
mi.popupPosition = 500090002;
- hUMenuIgnore = (HGENMENU)CallService( MS_CLIST_ADDCONTACTMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hUMenuIgnore = Menu_AddContactMenuItem(&mi);
hMenuIgnore = CreateServiceFunction( temp, IrcMenuIgnore );
hPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, IrcPrebuildContactMenu);
diff --git a/protocols/IcqOscarJ/icq_menu.cpp b/protocols/IcqOscarJ/icq_menu.cpp index 7b62c370f7..f6aeb99161 100644 --- a/protocols/IcqOscarJ/icq_menu.cpp +++ b/protocols/IcqOscarJ/icq_menu.cpp @@ -143,7 +143,7 @@ void g_MenuInit(void) mi.position = 1000030000;
mi.icolibItem = hStaticIcons[ISI_AUTH_REQUEST]->Handle();
strcpy(pszDest, MS_REQ_AUTH);
- g_hContactMenuItems[ICMI_AUTH_REQUEST] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_AUTH_REQUEST] = CreateServiceFunction( str, IcqMenuHandleRequestAuth );
// "Grant authorization"
@@ -151,7 +151,7 @@ void g_MenuInit(void) mi.position = 1000029999;
mi.icolibItem = hStaticIcons[ISI_AUTH_GRANT]->Handle();
strcpy(pszDest, MS_GRANT_AUTH);
- g_hContactMenuItems[ICMI_AUTH_GRANT] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_AUTH_GRANT] = CreateServiceFunction(mi.pszService, IcqMenuHandleGrantAuth);
// "Revoke authorization"
@@ -159,7 +159,7 @@ void g_MenuInit(void) mi.position = 1000029998;
mi.icolibItem = hStaticIcons[ISI_AUTH_REVOKE]->Handle();
strcpy(pszDest, MS_REVOKE_AUTH);
- g_hContactMenuItems[ICMI_AUTH_REVOKE] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_AUTH_REVOKE] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_AUTH_REVOKE] = CreateServiceFunction(mi.pszService, IcqMenuHandleRevokeAuth);
// "Add to server list"
@@ -167,7 +167,7 @@ void g_MenuInit(void) mi.position = -2049999999;
mi.icolibItem = hStaticIcons[ISI_ADD_TO_SERVLIST]->Handle();
strcpy(pszDest, MS_ICQ_ADDSERVCONTACT);
- g_hContactMenuItems[ICMI_ADD_TO_SERVLIST] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_ADD_TO_SERVLIST] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_ADD_TO_SERVLIST] = CreateServiceFunction(mi.pszService, IcqMenuHandleAddServContact);
// "Show custom status details"
@@ -175,14 +175,14 @@ void g_MenuInit(void) mi.position = -2000004999;
mi.flags = 0;
strcpy(pszDest, MS_XSTATUS_SHOWDETAILS);
- g_hContactMenuItems[ICMI_XSTATUS_DETAILS] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_XSTATUS_DETAILS] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_XSTATUS_DETAILS] = CreateServiceFunction(mi.pszService, IcqMenuHandleXStatusDetails);
// "Open ICQ profile"
mi.pszName = LPGEN("Open ICQ profile");
mi.position = 1000029997;
strcpy(pszDest, MS_OPEN_PROFILE);
- g_hContactMenuItems[ICMI_OPEN_PROFILE] = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hContactMenuItems[ICMI_OPEN_PROFILE] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[ICMI_OPEN_PROFILE] = CreateServiceFunction(mi.pszService, IcqMenuHandleOpenProfile);
}
diff --git a/protocols/IcqOscarJ/icq_xstatus.cpp b/protocols/IcqOscarJ/icq_xstatus.cpp index 9a1abb5df5..44bd02157c 100644 --- a/protocols/IcqOscarJ/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/icq_xstatus.cpp @@ -1057,7 +1057,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) mi.pszService = srvFce;
mi.pszContactOwner = m_szModuleName;
- hXStatusItems[i] = (HANDLE)CallService(MS_CLIST_ADDSTATUSMENUITEM, (WPARAM)&hXStatusRoot, (LPARAM)&mi);
+ hXStatusItems[i] = Menu_AddStatusMenuItem(&mi);
// CMIF_HIDDEN does not work for adding services
CListShowMenuItem(hXStatusItems[i], !(m_bHideXStatusUI || m_bHideXStatusMenu));
diff --git a/protocols/JabberG/jabber_menu.cpp b/protocols/JabberG/jabber_menu.cpp index 6d7616db10..4ddfaa7ea6 100644 --- a/protocols/JabberG/jabber_menu.cpp +++ b/protocols/JabberG/jabber_menu.cpp @@ -232,7 +232,7 @@ void g_MenuInit( void ) mi.position = -2000001000;
mi.icolibItem = g_GetIconHandle( IDI_REQUEST );
mi.pszService = "Jabber/ReqAuth";
- g_hMenuRequestAuth = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRequestAuth = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleRequestAuth ));
// "Grant authorization"
@@ -240,7 +240,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Grant authorization");
mi.position = -2000001001;
mi.icolibItem = g_GetIconHandle( IDI_GRANT );
- g_hMenuGrantAuth = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuGrantAuth = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuHandleGrantAuth ));
// Revoke auth
@@ -248,7 +248,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Revoke authorization");
mi.position = -2000001002;
mi.icolibItem = g_GetIconHandle( IDI_AUTHREVOKE );
- g_hMenuRevokeAuth = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRevokeAuth = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRevokeAuth ));
// "Convert Chat/Contact"
@@ -256,7 +256,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Convert");
mi.position = -1999901004;
mi.icolibItem = g_GetIconHandle( IDI_USER2ROOM );
- g_hMenuConvert = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuConvert = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuConvertChatContact ));
// "Add to roster"
@@ -264,7 +264,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Add to roster");
mi.position = -1999901005;
mi.icolibItem = g_GetIconHandle( IDI_ADDROSTER );
- g_hMenuRosterAdd = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRosterAdd = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuRosterAdd ));
// "Add to Bookmarks"
@@ -272,7 +272,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Add to Bookmarks");
mi.position = -1999901006;
mi.icolibItem = g_GetIconHandle( IDI_BOOKMARKS);
- g_hMenuAddBookmark = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuBookmarkAdd ));
// Login/logout
@@ -280,7 +280,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Login/logout");
mi.position = -1999901007;
mi.icolibItem = g_GetIconHandle( IDI_LOGIN );
- g_hMenuLogin = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuLogin = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportLogin ));
// Retrieve nicks
@@ -288,7 +288,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Resolve nicks");
mi.position = -1999901008;
mi.icolibItem = g_GetIconHandle( IDI_REFRESH );
- g_hMenuRefresh = ( HGENMENU ) JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuTransportResolve ));
// Run Commands
@@ -296,7 +296,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Commands");
mi.position = -1999901009;
mi.icolibItem = g_GetIconHandle( IDI_COMMAND );
- g_hMenuCommands = ( HGENMENU )JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuCommands = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberContactMenuRunCommands ));
// Send Note
@@ -304,7 +304,7 @@ void g_MenuInit( void ) mi.pszName = LPGEN("Send Note");
mi.position = -1999901010;
mi.icolibItem = g_GetIconHandle( IDI_SEND_NOTE);
- g_hMenuSendNote = ( HGENMENU )JCallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunction( mi.pszService, JabberMenuSendNote ));
// Direct Presence
@@ -313,7 +313,7 @@ void g_MenuInit( void ) mi.position = -1999901011;
mi.pszPopupName = (char *)-1;
mi.icolibItem = g_GetIconHandle( IDI_NOTES );
- g_hMenuDirectPresence[0] = ( HGENMENU )JCallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
mi.flags |= CMIF_ROOTHANDLE;
mi.flags &= ~CMIF_ICONFROMICOLIB;
@@ -327,7 +327,7 @@ void g_MenuInit( void ) mi.position = -1999901000;
mi.hParentMenu = g_hMenuDirectPresence[0];
mi.icolibItem = LoadSkinnedIcon(PresenceModeArray[i].icon);
- g_hMenuDirectPresence[i+1] = ( HGENMENU )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuDirectPresence[i+1] = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode ));
}
@@ -340,7 +340,7 @@ void g_MenuInit( void ) mi.position = -1999901011;
mi.pszPopupName = (char *)-1;
mi.icolibItem = g_GetIconHandle( IDI_JABBER );
- g_hMenuResourcesRoot = ( HGENMENU )JCallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuResourcesRoot = Menu_AddContactMenuItem(&mi);
mi.pszService = "Jabber/UseResource_last";
mi.pszName = LPGEN("Last Active");
@@ -348,7 +348,7 @@ void g_MenuInit( void ) mi.hParentMenu = g_hMenuResourcesRoot;
mi.icolibItem = g_GetIconHandle( IDI_JABBER );
mi.flags |= CMIF_ROOTHANDLE;
- g_hMenuResourcesActive = ( HGENMENU )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuResourcesActive = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN ));
mi.pszService = "Jabber/UseResource_server";
@@ -356,7 +356,7 @@ void g_MenuInit( void ) mi.position = -1999901000;
mi.pszPopupName = (char *)g_hMenuResourcesRoot;
mi.icolibItem = g_GetIconHandle( IDI_NODE_SERVER );
- g_hMenuResourcesServer = ( HGENMENU )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
li.List_InsertPtr( &arServices, CreateServiceFunctionParam( mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER ));
}
@@ -483,7 +483,7 @@ int CJabberProto::OnPrebuildContactMenu( WPARAM wParam, LPARAM ) mi.pszName = "";
mi.position = i;
mi.pszPopupName = (char *)g_hMenuResourcesRoot;
- m_phMenuResourceItems[i] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ m_phMenuResourceItems[i] = Menu_AddContactMenuItem(&mi);
}
if ( i < item->resourceCount ) {
CLISTMENUITEM clmi = {0};
@@ -720,7 +720,7 @@ void CJabberProto::MenuInit() mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle( IDI_JABBER );
- hJabberRoot = m_hMenuRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi );
+ hJabberRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
if ( m_hMenuRoot )
@@ -736,7 +736,7 @@ void CJabberProto::MenuInit() mi.pszName = LPGEN("Bookmarks");
mi.position = 200001;
mi.icolibItem = GetIconHandle( IDI_BOOKMARKS );
- m_hMenuBookmarks = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuBookmarks = Menu_AddProtoMenuItem(&mi);
// "Options..."
JCreateService( "/Options", &CJabberProto::OnMenuOptions );
@@ -744,14 +744,14 @@ void CJabberProto::MenuInit() mi.pszName = LPGEN("Options...");
mi.position = 200002;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
- JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
// "Services..."
mi.pszName = LPGEN("Services...");
strcpy( tDest, "/Services" );
mi.position = 200003;
mi.icolibItem = GetIconHandle( IDI_SERVICE_DISCOVERY );
- HGENMENU hMenuServicesRoot = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ HGENMENU hMenuServicesRoot = Menu_AddProtoMenuItem(&mi);
// "Service Discovery..."
JCreateService( "/ServiceDiscovery", &CJabberProto::OnMenuHandleServiceDiscovery );
@@ -761,35 +761,35 @@ void CJabberProto::MenuInit() mi.position = 2000050001;
mi.icolibItem = GetIconHandle( IDI_SERVICE_DISCOVERY );
mi.hParentMenu = hMenuServicesRoot;
- m_hMenuServiceDiscovery = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuServiceDiscovery = Menu_AddProtoMenuItem(&mi);
JCreateService( "/SD/MyTransports", &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports );
strcpy( tDest, "/SD/MyTransports" );
mi.pszName = LPGEN("Registered Transports");
mi.position = 2000050003;
mi.icolibItem = GetIconHandle( IDI_TRANSPORTL );
- m_hMenuSDMyTransports = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuSDMyTransports = Menu_AddProtoMenuItem(&mi);
JCreateService( "/SD/Transports", &CJabberProto::OnMenuHandleServiceDiscoveryTransports );
strcpy( tDest, "/SD/Transports" );
mi.pszName = LPGEN("Local Server Transports");
mi.position = 2000050004;
mi.icolibItem = GetIconHandle( IDI_TRANSPORT );
- m_hMenuSDTransports = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuSDTransports = Menu_AddProtoMenuItem(&mi);
JCreateService( "/SD/Conferences", &CJabberProto::OnMenuHandleServiceDiscoveryConferences );
strcpy( tDest, "/SD/Conferences" );
mi.pszName = LPGEN("Browse Chatrooms");
mi.position = 2000050005;
mi.icolibItem = GetIconHandle( IDI_GROUP );
- m_hMenuSDConferences = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuSDConferences = Menu_AddProtoMenuItem(&mi);
JCreateService( "/Groupchat", &CJabberProto::OnMenuHandleJoinGroupchat );
strcpy( tDest, "/Groupchat" );
mi.pszName = LPGEN("Create/Join groupchat");
mi.position = 2000050006;
mi.icolibItem = GetIconHandle( IDI_GROUP );
- m_hMenuGroupchat = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuGroupchat = Menu_AddProtoMenuItem(&mi);
// "Change Password..."
JCreateService( "/ChangePassword", &CJabberProto::OnMenuHandleChangePassword );
@@ -797,7 +797,7 @@ void CJabberProto::MenuInit() mi.pszName = LPGEN("Change Password");
mi.position = 2000050007;
mi.icolibItem = GetIconHandle( IDI_KEYS );
- m_hMenuChangePassword = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuChangePassword = Menu_AddProtoMenuItem(&mi);
// "Roster editor"
JCreateService( "/RosterEditor", &CJabberProto::OnMenuHandleRosterControl );
@@ -805,7 +805,7 @@ void CJabberProto::MenuInit() mi.pszName = LPGEN("Roster editor");
mi.position = 2000050009;
mi.icolibItem = GetIconHandle( IDI_AGENTS );
- m_hMenuRosterControl = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuRosterControl = Menu_AddProtoMenuItem(&mi);
// "XML Console"
JCreateService( "/XMLConsole", &CJabberProto::OnMenuHandleConsole );
@@ -813,14 +813,14 @@ void CJabberProto::MenuInit() mi.pszName = LPGEN("XML Console");
mi.position = 2000050010;
mi.icolibItem = GetIconHandle( IDI_CONSOLE );
- JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
JCreateService( "/Notes", &CJabberProto::OnMenuHandleNotes );
strcpy( tDest, "/Notes" );
mi.pszName = LPGEN("Notes");
mi.position = 2000050011;
mi.icolibItem = GetIconHandle( IDI_NOTES);
- m_hMenuNotes = ( HGENMENU ) JCallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuNotes = Menu_AddProtoMenuItem(&mi);
BuildPrivacyMenu();
if ( m_menuItemsStatus )
@@ -837,7 +837,7 @@ void CJabberProto::MenuInit() mi.hParentMenu = hJabberRoot;
mi.pszName = LPGEN("Resource priority");
mi.flags = CMIF_ROOTPOPUP | CMIF_HIDDEN;
- m_hMenuPriorityRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
char szName[128], srvFce[MAX_PATH + 64], *svcName = srvFce+strlen( m_szModuleName );
mi.pszService = srvFce;
@@ -867,7 +867,7 @@ void CJabberProto::MenuInit() JCreateServiceParam(svcName, &CJabberProto::OnMenuSetPriority, (LPARAM)steps[i]);
mi.position++;
- CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
}
UpdatePriorityMenu((short)JGetWord(NULL, "Priority", 0));
diff --git a/protocols/JabberG/jabber_privacy.cpp b/protocols/JabberG/jabber_privacy.cpp index 5a8d1b7de6..ada79a9c52 100644 --- a/protocols/JabberG/jabber_privacy.cpp +++ b/protocols/JabberG/jabber_privacy.cpp @@ -2263,7 +2263,7 @@ void CJabberProto::BuildPrivacyMenu() mi.flags = CMIF_ROOTPOPUP | CMIF_CHILDPOPUP | CMIF_ICONFROMICOLIB | CMIF_HIDDEN;
mi.pszName = LPGEN("Privacy Lists");
mi.hParentMenu = MO_GetProtoRootMenu( m_szModuleName );
- m_hPrivacyMenuRoot = ( HGENMENU )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ m_hPrivacyMenuRoot = Menu_AddProtoMenuItem(&mi);
JCreateService( "/PrivacyLists", &CJabberProto::OnMenuHandlePrivacyLists );
char srvFce[MAX_PATH + 64];
@@ -2274,7 +2274,7 @@ void CJabberProto::BuildPrivacyMenu() mi.icolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
mi.ptszName = LPGENT("List Editor...");
mi.hParentMenu = m_hPrivacyMenuRoot;
- CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddProtoMenuItem(&mi);
}
void CJabberProto::BuildPrivacyListsMenu( bool bDeleteOld )
@@ -2308,7 +2308,7 @@ void CJabberProto::BuildPrivacyListsMenu( bool bDeleteOld ) SKINICON_OTHER_SMALLDOT :
SKINICON_OTHER_EMPTYBLOB);
mi.ptszName = LPGENT("<none>");
- m_hPrivacyMenuItems.insert(( HANDLE )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi ));
+ m_hPrivacyMenuItems.insert( Menu_AddProtoMenuItem(&mi));
for ( CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) {
++i;
@@ -2325,7 +2325,7 @@ void CJabberProto::BuildPrivacyListsMenu( bool bDeleteOld ) SKINICON_OTHER_SMALLDOT :
SKINICON_OTHER_EMPTYBLOB);
mi.ptszName = pList->GetListName();
- m_hPrivacyMenuItems.insert(( HANDLE )CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi ));
+ m_hPrivacyMenuItems.insert( Menu_AddProtoMenuItem(&mi));
}
m_privacyListManager.Unlock();
diff --git a/protocols/JabberG/jabber_xstatus.cpp b/protocols/JabberG/jabber_xstatus.cpp index 28e1c63096..fdd7a44e2e 100644 --- a/protocols/JabberG/jabber_xstatus.cpp +++ b/protocols/JabberG/jabber_xstatus.cpp @@ -498,7 +498,7 @@ void CPepGuiService::RebuildMenu() mi.icolibItem = m_hIcolibItem;
mi.ptszName = m_szText ? m_szText : _T("<advanced status slot>");
- m_hMenuItem = ( HANDLE )CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ m_hMenuItem = Menu_AddProtoMenuItem(&mi);
} }
bool CPepGuiService::LaunchSetGui(BYTE bQuiet)
diff --git a/protocols/MRA/Mra.h b/protocols/MRA/Mra.h index c888e8f78c..3f5a1f1394 100644 --- a/protocols/MRA/Mra.h +++ b/protocols/MRA/Mra.h @@ -399,7 +399,7 @@ DWORD ProtoBroadcastAckAsynchEx (const char *szModule,HANDLE hC void MraUserAPCThreadProc (LPVOID lpParameter);
DWORD CreateBlobFromContact (HANDLE hContact,LPWSTR lpwszRequestReason,SIZE_T dwRequestReasonSize,LPBYTE lpbBuff,SIZE_T dwBuffSize,SIZE_T *pdwBuffSizeRet);
-void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult);
+void CListCreateMenu (LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,BOOL bIsStatus,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult);
void CListDestroyMenu (const GUI_DISPLAY_ITEM *pgdiItems,SIZE_T dwCount);
void CListShowMenuItem (HANDLE hMenuItem,BOOL bShow);
int ExtraSetIcon (HANDLE hExtraIcon,HANDLE hContact,HANDLE hImage,int iColumnType);
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp index bb88dc3dcd..1cd2630f1c 100644 --- a/protocols/MRA/Mra_functions.cpp +++ b/protocols/MRA/Mra_functions.cpp @@ -1393,7 +1393,7 @@ return(dwRetErrorCode); -void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,LPSTR lpszCListMenuType,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult)
+void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR pszContactOwner,BOOL bIsMain,const GUI_DISPLAY_ITEM *pgdiItems,HANDLE *hIcoLibIcons,SIZE_T dwCount,HANDLE *hResult)
{
if (pgdiItems && hIcoLibIcons && dwCount && hResult)
{
@@ -1423,7 +1423,7 @@ void CListCreateMenu(LONG lPosition,LONG lPopupPosition,HANDLE hMainIcon,LPSTR p mi.flags=(CMIF_UNICODE);
}
- hResult[i]=(HANDLE)CallService(lpszCListMenuType,0,(LPARAM)&mi);
+ hResult[i] = (bIsMain) ? Menu_AddMainMenuItem(&mi) : Menu_AddContactMenuItem(&mi);
if (i==0 && hMainIcon)
{
diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp index fa996b1e0c..cb194fb575 100644 --- a/protocols/MRA/Mra_svcs.cpp +++ b/protocols/MRA/Mra_svcs.cpp @@ -30,8 +30,7 @@ INT_PTR LoadServices(void) pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
// Service creation
- for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
- {
+ for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++) {
memmove(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
CreateServiceFunction(szServiceFunction,siPluginServices[i].lpFunc);
}
@@ -67,28 +66,24 @@ INT_PTR LoadModules(void) // Main menu initialization
- CListCreateMenu(2000060000,500085000,(HANDLE)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(IDI_MRA),IMAGE_ICON,0,0,LR_SHARED),NULL,MS_CLIST_ADDMAINMENUITEM,gdiMenuItems,masMraSettings.hMainMenuIcons,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuItems);
+ CListCreateMenu(2000060000,500085000,(HANDLE)LoadImage(masMraSettings.hInstance,MAKEINTRESOURCE(IDI_MRA),IMAGE_ICON,0,0,LR_SHARED),NULL,TRUE,gdiMenuItems,masMraSettings.hMainMenuIcons,SIZEOF(gdiMenuItems),masMraSettings.hMainMenuItems);
// Contact menu initialization
- CListCreateMenu(2000060000,-500050000,NULL,NULL,MS_CLIST_ADDCONTACTMENUITEM,gdiContactMenuItems,masMraSettings.hContactMenuIcons,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)),masMraSettings.hContactMenuItems);
+ CListCreateMenu(2000060000,-500050000,NULL,NULL,FALSE,gdiContactMenuItems,masMraSettings.hContactMenuIcons,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)),masMraSettings.hContactMenuItems);
// xstatus menu
- if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
- {
- InitXStatusIcons();
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
- {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
- CreateServiceFunctionParam(szServiceFunction,MraXStatusMenu,i);
- }
+ InitXStatusIcons();
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++) {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ CreateServiceFunctionParam(szServiceFunction,MraXStatusMenu,i);
+ }
- masMraSettings.bHideXStatusUI=FALSE;
- masMraSettings.dwXStatusMode=DB_Mra_GetByte(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
- if (IsXStatusValid(masMraSettings.dwXStatusMode)==FALSE) masMraSettings.dwXStatusMode=MRA_MIR_XSTATUS_NONE;
+ masMraSettings.bHideXStatusUI=FALSE;
+ masMraSettings.dwXStatusMode=DB_Mra_GetByte(NULL,DBSETTING_XSTATUSID,MRA_MIR_XSTATUS_NONE);
+ if (IsXStatusValid(masMraSettings.dwXStatusMode)==FALSE) masMraSettings.dwXStatusMode=MRA_MIR_XSTATUS_NONE;
- masMraSettings.hHookRebuildStatusMenu=HookEvent(ME_CLIST_PREBUILDSTATUSMENU,MraRebuildStatusMenu);
- MraRebuildStatusMenu(0,0);
- }
+ masMraSettings.hHookRebuildStatusMenu=HookEvent(ME_CLIST_PREBUILDSTATUSMENU,MraRebuildStatusMenu);
+ MraRebuildStatusMenu(0,0);
MraExtraIconsRebuild(0,0);
@@ -119,19 +114,19 @@ void UnloadModules() }
// xstatus menu destroy
- if (ServiceExists(MS_CLIST_ADDSTATUSMENUITEM))
- {
- if (masMraSettings.hHookRebuildStatusMenu) {UnhookEvent(masMraSettings.hHookRebuildStatusMenu); masMraSettings.hHookRebuildStatusMenu=NULL;}
+ if (masMraSettings.hHookRebuildStatusMenu) {
+ UnhookEvent(masMraSettings.hHookRebuildStatusMenu);
+ masMraSettings.hHookRebuildStatusMenu=NULL;
+ }
- bzero(masMraSettings.hXStatusMenuItems,sizeof(masMraSettings.hXStatusMenuItems));
- // Service deletion
- for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++)
- {
- mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
- DestroyServiceFunction(szServiceFunction);
- }
- DestroyXStatusIcons();
+ bzero(masMraSettings.hXStatusMenuItems,sizeof(masMraSettings.hXStatusMenuItems));
+
+ // Service deletion
+ for(SIZE_T i=0;i<MRA_XSTATUS_COUNT;i++) {
+ mir_snprintf(pszServiceFunctionName,(SIZEOF(szServiceFunction)-PROTOCOL_NAME_LEN),"/menuXStatus%ld",i);
+ DestroyServiceFunction(szServiceFunction);
}
+ DestroyXStatusIcons();
// Main menu destroy
CListDestroyMenu(gdiMenuItems,SIZEOF(gdiMenuItems));
@@ -943,7 +938,6 @@ int MraRebuildStatusMenu(WPARAM wParam,LPARAM lParam) {
CHAR szServiceFunction[MAX_PATH*2],*pszServiceFunctionName,szValueName[MAX_PATH];
WCHAR szItem[MAX_PATH+64],szStatusTitle[STATUS_TITLE_MAX+4];
- HANDLE hXStatusRoot;
CLISTMENUITEM mi={0};
memmove(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
@@ -979,7 +973,7 @@ int MraRebuildStatusMenu(WPARAM wParam,LPARAM lParam) mi.ptszName=lpcszXStatusNameDef[i];
mi.hIcon=NULL;
}
- masMraSettings.hXStatusMenuItems[i]=(HANDLE)CallService(MS_CLIST_ADDSTATUSMENUITEM,(WPARAM)&hXStatusRoot,(LPARAM)&mi);
+ masMraSettings.hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi);
}
return(0);
}
diff --git a/protocols/MSN/msn_menu.cpp b/protocols/MSN/msn_menu.cpp index bcd88543be..e90480fb32 100644 --- a/protocols/MSN/msn_menu.cpp +++ b/protocols/MSN/msn_menu.cpp @@ -306,7 +306,7 @@ void CMsnProto::MsnInitMainMenu(void) mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MSN);
mi.ptszName = m_tszUserName;
- hRoot = mainMenuRoot = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else
{
@@ -323,35 +323,35 @@ void CMsnProto::MsnInitMainMenu(void) mi.position = 201001;
mi.icolibItem = GetIconHandle(IDI_MSN);
mi.pszName = LPGEN("Set &Nickname");
- menuItemsMain[0] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MSN_INVITE);
CreateProtoService(MSN_INVITE, &CMsnProto::MsnInviteCommand);
mi.position = 201002;
mi.icolibItem = GetIconHandle(IDI_INVITE);
mi.pszName = LPGEN("Create &Chat");
- menuItemsMain[0] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[0] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_GOTO_INBOX);
CreateProtoService(MS_GOTO_INBOX, &CMsnProto::MsnGotoInbox);
mi.position = 201003;
mi.icolibItem = GetIconHandle(IDI_INBOX);
mi.pszName = LPGEN("Display &Hotmail Inbox");
- menuItemsMain[1] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[1] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_EDIT_PROFILE);
CreateProtoService(MS_EDIT_PROFILE, &CMsnProto::MsnEditProfile);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("View &Profile");
- menuItemsMain[2] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[2] = Menu_AddProtoMenuItem(&mi);
strcpy(tDest, MS_EDIT_ALERTS);
CreateProtoService(MS_EDIT_ALERTS, &CMsnProto::MsnSetupAlerts);
mi.position = 201004;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("Setup Live &Alerts");
- menuItemsMain[3] = (HGENMENU)MSN_CallService(MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi);
+ menuItemsMain[3] = Menu_AddProtoMenuItem(&mi);
MSN_EnableMenuItems(m_iStatus >= ID_STATUS_ONLINE);
}
@@ -467,14 +467,14 @@ void MSN_InitContactMenu(void) mi.position = -500050000;
mi.icolibItem = GetIconHandle(IDI_MSNBLOCK);
mi.pszName = LPGEN("&Block");
- hBlockMenuItem = (HGENMENU)MSN_CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hBlockMenuItem = Menu_AddContactMenuItem(&mi);
strcpy(tDest, MSN_VIEW_PROFILE);
hViewProfile = CreateServiceFunction(servicefunction, MsnMenuViewProfile);
mi.position = -500050003;
mi.icolibItem = GetIconHandle(IDI_PROFILE);
mi.pszName = LPGEN("View &Profile");
- hLiveSpaceMenuItem = (HGENMENU)MSN_CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hLiveSpaceMenuItem = Menu_AddContactMenuItem(&mi);
strcpy(tDest, MSN_NETMEETING);
hNetMeeting = CreateServiceFunction(servicefunction, MsnMenuSendNetMeeting);
@@ -482,7 +482,7 @@ void MSN_InitContactMenu(void) mi.position = -500050002;
mi.icolibItem = GetIconHandle(IDI_NETMEETING);
mi.pszName = LPGEN("&Start Netmeeting");
- hNetmeetingMenuItem = (HGENMENU)MSN_CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hNetmeetingMenuItem = Menu_AddContactMenuItem(&mi);
strcpy(tDest, "/SendHotmail");
hSendHotMail = CreateServiceFunction(servicefunction, MsnMenuSendHotmail);
@@ -490,7 +490,7 @@ void MSN_InitContactMenu(void) mi.flags = CMIF_ICONFROMICOLIB | CMIF_HIDDEN;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SENDEMAIL);
mi.pszName = LPGEN("Open &Hotmail Inbox");
- hOpenInboxMenuItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) &mi);
+ hOpenInboxMenuItem = Menu_AddContactMenuItem(&mi);
hPrebuildMenuHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MSN_OnPrebuildContactMenu);
}
diff --git a/protocols/NewsAggregator/Src/Menus.cpp b/protocols/NewsAggregator/Src/Menus.cpp index 2ff20ce596..62a5da045d 100644 --- a/protocols/NewsAggregator/Src/Menus.cpp +++ b/protocols/NewsAggregator/Src/Menus.cpp @@ -36,39 +36,39 @@ VOID InitMenu() mi.icolibItem = GetIconHandle("main");
mi.ptszName = LPGENT("Check All Feeds");
mi.pszService = MS_NEWSAGGR_CHECKALLFEEDS;
- hService2[0] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[0] = Menu_AddMainMenuItem(&mi);
mi.position=10100002;
mi.icolibItem = GetIconHandle("addfeed");
mi.ptszName = LPGENT("Add Feed");
mi.pszService = MS_NEWSAGGR_ADDFEED;
- hService2[1] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[1] = Menu_AddMainMenuItem(&mi);
mi.position=10100003;
mi.icolibItem = GetIconHandle("importfeeds");
mi.ptszName = LPGENT("Import Feeds");
mi.pszService = MS_NEWSAGGR_IMPORTFEEDS;
- hService2[2] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[2] = Menu_AddMainMenuItem(&mi);
mi.position=10100004;
mi.icolibItem = GetIconHandle("exportfeeds");
mi.ptszName = LPGENT("Export Feeds");
mi.pszService = MS_NEWSAGGR_EXPORTFEEDS;
- hService2[3] = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hService2[3] = Menu_AddMainMenuItem(&mi);
// adding contact menu items
mi.position=-0x7FFFFFFA;
mi.icolibItem = GetIconHandle("checkfeed");
mi.ptszName = LPGENT("Check feed");
mi.pszService = MS_NEWSAGGR_CHECKFEED;
- hService2[4] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hService2[4] = Menu_AddContactMenuItem(&mi);
// adding contact menu items
mi.position=-0x7FFFFFFA;
//mi.icolibItem = GetIconHandle("checkfeed");
mi.ptszName = LPGENT("Change feed");
mi.pszService = MS_NEWSAGGR_CHANGEFEED;
- hService2[5] = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hService2[5] = Menu_AddContactMenuItem(&mi);
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
diff --git a/protocols/Quotes/Forex.cpp b/protocols/Quotes/Forex.cpp index e0df9c34fd..62f2c6af28 100644 --- a/protocols/Quotes/Forex.cpp +++ b/protocols/Quotes/Forex.cpp @@ -86,7 +86,7 @@ namespace mi.ptszName = _T("Quotes");
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTPOPUP;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
- HGENMENU hMenuRoot = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenuRoot);
mi.ptszName = _T("Refresh All Quotes\\Rates");
@@ -95,7 +95,7 @@ namespace mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
mi.pszService = "Quotes/RefreshAll";
mi.hParentMenu = hMenuRoot;
- HGENMENU hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ HGENMENU hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
HANDLE h = CreateServiceFunction(mi.pszService, QuotesMenu_RefreshAll);
g_ahServices.push_back(h);
@@ -105,7 +105,7 @@ namespace //mi.position = 0x0FFFFFFF;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_CURRENCY_CONVERTER);
mi.pszService = "Quotes/CurrencyConverter";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_CurrencyConverter);
g_ahServices.push_back(h);
@@ -115,7 +115,7 @@ namespace //mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_EXPORT);
mi.pszService = "Quotes/ExportAll";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_ExportAll);
g_ahServices.push_back(h);
@@ -124,13 +124,13 @@ namespace //mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_IMPORT);
mi.pszService = "Quotes/ImportAll";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDMAINMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddMainMenuItem(&mi);
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_ImportAll);
g_ahServices.push_back(h);
#endif
- bool bSubGroups = 1 == ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM);
+ bool bSubGroups = 1 == ServiceExists(MS_CLIST_MENUBUILDSUBGROUP);
h = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,Quotes_PrebuildContactMenu);
g_ahEvents.push_back(h);
@@ -148,7 +148,7 @@ namespace mi.ptszName = const_cast<TCHAR*>(sProtocolName.c_str());//A2T(QUOTES_PROTOCOL_NAME);
mi.position = 0;
- hMenuRoot = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenuRoot = Menu_AddContactMenuItem(&mi);
}
mi.flags = CMIF_TCHAR;
@@ -163,7 +163,7 @@ namespace mi.flags |= CMIF_ICONFROMICOLIB;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuRefresh = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_RefreshContact);
@@ -173,7 +173,7 @@ namespace mi.popupPosition = 1;
mi.icolibItem = NULL;
mi.pszService = "Quotes/OpenLogFile";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuOpenLogFile = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_OpenLogFile);
@@ -184,7 +184,7 @@ namespace mi.popupPosition = 2;
mi.icolibItem = NULL;
mi.pszService = "Quotes/Chart";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuChart = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_Chart);
@@ -199,7 +199,7 @@ namespace #endif
mi.icolibItem = NULL;
mi.pszService = "Quotes/EditSettings";
- hMenu = reinterpret_cast<HGENMENU>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,reinterpret_cast<LPARAM>(&mi)));
+ hMenu = Menu_AddContactMenuItem(&mi);
g_hMenuEditSettings = hMenu;
g_ahMenus.push_back(hMenu);
h = CreateServiceFunction(mi.pszService, QuotesMenu_EditSettings);
diff --git a/protocols/Twitter/proto.cpp b/protocols/Twitter/proto.cpp index a3d9b24e07..6f23a185a4 100644 --- a/protocols/Twitter/proto.cpp +++ b/protocols/Twitter/proto.cpp @@ -341,8 +341,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) mi.flags = CMIF_ICONFROMICOLIB|CMIF_ROOTHANDLE;
mi.position = 1001;
- HANDLE m_hMenuRoot = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDSTATUSMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
+ HANDLE m_hMenuRoot = Menu_AddStatusMenuItem(&mi);
// TODO: Disable this menu item when offline
// "Send Tweet..."
@@ -351,9 +350,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM wParam,LPARAM lParam) mi.pszName = LPGEN("Send Tweet...");
mi.popupPosition = 200001;
mi.icolibItem = GetIconHandle("tweet");
- HANDLE m_hMenuBookmarks = reinterpret_cast<HGENMENU>( CallService(
- MS_CLIST_ADDSTATUSMENUITEM,0,reinterpret_cast<LPARAM>(&mi)) );
-
+ HANDLE m_hMenuBookmarks = Menu_AddStatusMenuItem(&mi);
return 0;
}
diff --git a/protocols/Twitter/theme.cpp b/protocols/Twitter/theme.cpp index 5afb3b7e36..d6f0be38bb 100644 --- a/protocols/Twitter/theme.cpp +++ b/protocols/Twitter/theme.cpp @@ -143,7 +143,7 @@ void InitContactMenus() mi.pszName = LPGEN("Reply...");
mi.pszService = "Twitter/ReplyToTweet";
g_hMenuEvts[1] = CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::ReplyToTweet>);
- g_hMenuItems[0] = reinterpret_cast<HANDLE>(CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hMenuItems[0] = Menu_AddContactMenuItem(&mi);
mi.position=-2000006000;
mi.icolibItem = GetIconHandle("homepage");
@@ -151,8 +151,7 @@ void InitContactMenus() mi.pszService = "Twitter/VisitHomepage";
g_hMenuEvts[2] = CreateServiceFunction(mi.pszService,
GlobalService<&TwitterProto::VisitHomepage>);
- g_hMenuItems[1] = reinterpret_cast<HANDLE>(
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+ g_hMenuItems[1] = Menu_AddContactMenuItem(&mi);
}
void UninitContactMenus()
diff --git a/protocols/Weather/weather_svcs.cpp b/protocols/Weather/weather_svcs.cpp index 23cb105d3b..30559334b1 100644 --- a/protocols/Weather/weather_svcs.cpp +++ b/protocols/Weather/weather_svcs.cpp @@ -25,8 +25,8 @@ building/changing the weather menu items. #include "weather.h"
-static int hEnableDisablePopupMenu;
-static int hEnableDisableMenu;
+static HGENMENU hEnableDisablePopupMenu;
+static HGENMENU hEnableDisableMenu;
static HANDLE hService[27];
@@ -354,49 +354,49 @@ void AddMenuItems(void) mi.icolibItem = GetIconHandle("update");
mi.pszName="Update Weather";
mi.pszService = MS_WEATHER_UPDATE;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[16] = CreateServiceFunction(MS_WEATHER_REFRESH, UpdateSingleRemove);
mi.position=-0x7FFFFFF9;
mi.icolibItem = GetIconHandle("update2");
mi.pszName="Remove Old Data then Update";
mi.pszService = MS_WEATHER_REFRESH;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[17] = CreateServiceFunction(MS_WEATHER_BRIEF, BriefInfoSvc);
mi.position=-0x7FFFFFF8;
mi.icolibItem = GetIconHandle("brief");
mi.pszName="Brief Information";
mi.pszService = MS_WEATHER_BRIEF;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[18] = CreateServiceFunction(MS_WEATHER_COMPLETE, LoadForecast);
mi.position=-0x7FFFFFF7;
mi.icolibItem = GetIconHandle("read");
mi.pszName="Read Complete Forecast";
mi.pszService = MS_WEATHER_COMPLETE;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[19] = CreateServiceFunction(MS_WEATHER_MAP, WeatherMap);
mi.position=-0x7FFFFFF6;
mi.icolibItem = GetIconHandle("map");
mi.pszName="Weather Map";
mi.pszService = MS_WEATHER_MAP;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[20] = CreateServiceFunction(MS_WEATHER_LOG, ViewLog);
mi.position=-0x7FFFFFF5;
mi.icolibItem = GetIconHandle("log");
mi.pszName="View Log";
mi.pszService = MS_WEATHER_LOG;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
hService[21] = CreateServiceFunction(MS_WEATHER_EDIT, EditSettings);
mi.position=-0x7FFFFFF4;
mi.icolibItem = GetIconHandle("edit");
mi.pszName="Edit Settings";
mi.pszService = MS_WEATHER_EDIT;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
// adding main menu items
mi.pszPopupName = "Weather";
@@ -407,7 +407,7 @@ void AddMenuItems(void) mi.icolibItem = GetIconHandle("main");
mi.position=10100001;
mi.pszService = MS_WEATHER_ENABLED;
- hEnableDisableMenu = CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hEnableDisableMenu = Menu_AddMainMenuItem(&mi);
UpdateMenu(opt.AutoUpdate);
hService[23] = CreateServiceFunction(MS_WEATHER_UPDATEALL, UpdateAllInfo);
@@ -415,14 +415,14 @@ void AddMenuItems(void) mi.icolibItem = GetIconHandle("update");
mi.pszName="Update All Weather";
mi.pszService = MS_WEATHER_UPDATEALL;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
hService[24] = CreateServiceFunction(MS_WEATHER_REFRESHALL, UpdateAllRemove);
mi.position=20100002;
mi.icolibItem = GetIconHandle("update2");
mi.pszName="Remove Old Data then Update All";
mi.pszService = MS_WEATHER_REFRESHALL;
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
// only run if popup service exists
if (ServiceExists(MS_POPUP_ADDPOPUP)) {
@@ -432,7 +432,7 @@ void AddMenuItems(void) mi.position = 0;
mi.pszPopupName = "PopUps";
mi.pszService = WEATHERPROTONAME "/PopupMenu";
- hEnableDisablePopupMenu = CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ hEnableDisablePopupMenu = Menu_AddMainMenuItem(&mi);
UpdatePopupMenu(opt.UsePopup);
}
@@ -443,6 +443,6 @@ void AddMenuItems(void) mi.flags = 0;
mi.pszName = "Display in a frame";
mi.pszService = "Weather/mwin_menu";
- hMwinMenu = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hMwinMenu = Menu_AddContactMenuItem(&mi);
}
}
diff --git a/protocols/YAMN/main.cpp b/protocols/YAMN/main.cpp index 6076a49c51..20a4adc20b 100644 --- a/protocols/YAMN/main.cpp +++ b/protocols/YAMN/main.cpp @@ -242,18 +242,18 @@ int SystemModulesLoaded(WPARAM, LPARAM) mi.pszName = "Check &mail (All Account)";
mi.pszPopupName = NULL;//YAMN_DBMODULE;
mi.pszService = MS_YAMN_FORCECHECK;
- hMenuItemMain = (HANDLE) CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemMain = Menu_AddMainMenuItem(&mi);
mi.pszName = "Check &mail (This Account)";
mi.pszContactOwner = YAMN_DBMODULE;
mi.pszService = MS_YAMN_CLISTCONTEXT;
- hMenuItemCont = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemCont = Menu_AddContactMenuItem(&mi);
mi.icolibItem = g_GetIconHandle(4);
mi.pszName = "Launch application";
mi.pszContactOwner = YAMN_DBMODULE;
mi.pszService = MS_YAMN_CLISTCONTEXTAPP;
- hMenuItemContApp = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMenuItemContApp = Menu_AddContactMenuItem(&mi);
CheckMenuItems();
diff --git a/protocols/Yahoo/services.cpp b/protocols/Yahoo/services.cpp index 8bf397ce95..a6e7fa5012 100644 --- a/protocols/Yahoo/services.cpp +++ b/protocols/Yahoo/services.cpp @@ -389,7 +389,7 @@ void CYahooProto::MenuMainInit( void ) mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle( IDI_YAHOO );
mi.ptszName = m_tszUserName;
- hRoot = mainMenuRoot = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, (WPARAM)0, (LPARAM)&mi);
+ hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
if ( mainMenuRoot )
@@ -408,7 +408,7 @@ void CYahooProto::MenuMainInit( void ) mi.icolibItem = GetIconHandle( IDI_SET_STATUS );
mi.pszName = LPGEN( "Set &Custom Status" );
- menuItemsAll[0] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, (LPARAM)&mi );
+ menuItemsAll[0] = Menu_AddProtoMenuItem(&mi);
// Edit My profile
lstrcpyA( tDest, YAHOO_EDIT_MY_PROFILE );
@@ -417,7 +417,7 @@ void CYahooProto::MenuMainInit( void ) mi.position = 290005;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN( "&Edit My Profile" );
- menuItemsAll[1] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[1] = Menu_AddProtoMenuItem(&mi);
// Show My profile
lstrcpyA( tDest, YAHOO_SHOW_MY_PROFILE );
@@ -426,7 +426,7 @@ void CYahooProto::MenuMainInit( void ) mi.position = 290006;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN( "&My Profile" );
- menuItemsAll[2] = ( HGENMENU ) YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[2] = Menu_AddProtoMenuItem(&mi);
// Show Yahoo mail
strcpy( tDest, YAHOO_YAHOO_MAIL );
@@ -435,7 +435,7 @@ void CYahooProto::MenuMainInit( void ) mi.position = 290010;
mi.icolibItem = GetIconHandle( IDI_INBOX );
mi.pszName = LPGEN( "&Yahoo Mail" );
- menuItemsAll[3] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[3] = Menu_AddProtoMenuItem(&mi);
// Show Address Book
strcpy( tDest, YAHOO_AB );
@@ -444,7 +444,7 @@ void CYahooProto::MenuMainInit( void ) mi.position = 290015;
mi.icolibItem = GetIconHandle( IDI_YAB );
mi.pszName = LPGEN( "&Address Book" );
- menuItemsAll[4] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[4] = Menu_AddProtoMenuItem(&mi);
// Show Calendar
strcpy( tDest, YAHOO_CALENDAR );
@@ -453,7 +453,7 @@ void CYahooProto::MenuMainInit( void ) mi.position = 290017;
mi.icolibItem = GetIconHandle( IDI_CALENDAR );
mi.pszName = LPGEN( "&Calendar" );
- menuItemsAll[5] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[5] = Menu_AddProtoMenuItem(&mi);
// Show Refresh
/*strcpy( tDest, YAHOO_REFRESH );
@@ -462,7 +462,7 @@ void CYahooProto::MenuMainInit( void ) mi.position = 500090015;
mi.icolibItem = GetIconHandle( IDI_REFRESH );
mi.pszName = LPGEN( "&Refresh" );
- menuItemsAll[6] = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDPROTOMENUITEM, 0, ( LPARAM )&mi );
+ menuItemsAll[6] = Menu_AddProtoMenuItem(&mi);
*/
}
@@ -485,7 +485,7 @@ void CYahooProto::MenuContactInit( void ) mi.position = -2000006000;
mi.icolibItem = GetIconHandle( IDI_PROFILE );
mi.pszName = LPGEN( "&Show Profile" );
- hShowProfileMenuItem = ( HGENMENU )YAHOO_CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi );
+ hShowProfileMenuItem = Menu_AddContactMenuItem(&mi);
}
diff --git a/src/core/commonheaders.h b/src/core/commonheaders.h index c367fe9a78..e47ba25fb3 100644 --- a/src/core/commonheaders.h +++ b/src/core/commonheaders.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/core/forkthread.h b/src/core/forkthread.h index d920b7867e..2062192557 100644 --- a/src/core/forkthread.h +++ b/src/core/forkthread.h @@ -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.
@@ -48,16 +48,16 @@ Cavets: */
UINT_PTR forkthread (
- void (__cdecl *threadcode)(void*),
- unsigned long stacksize,
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
void *arg
);
UINT_PTR forkthreadex(
- void *sec,
- unsigned stacksize,
- unsigned (__stdcall *threadcode)(void*),
- void *owner,
- void *arg,
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void *owner,
+ void *arg,
unsigned *thraddr
);
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 04252e1c34..8dbb7b2ecc 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.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.
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp index e2335b27a9..2403b5aaf8 100644 --- a/src/core/miranda.cpp +++ b/src/core/miranda.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -42,7 +42,7 @@ pfnMyMonitorFromRect MyMonitorFromRect; pfnMyMonitorFromWindow MyMonitorFromWindow;
pfnMyGetMonitorInfo MyGetMonitorInfo;
-typedef DWORD (WINAPI *pfnMsgWaitForMultipleObjectsEx)(DWORD,CONST HANDLE*,DWORD,DWORD,DWORD);
+typedef DWORD (WINAPI *pfnMsgWaitForMultipleObjectsEx)(DWORD, CONST HANDLE*, DWORD, DWORD, DWORD);
pfnMsgWaitForMultipleObjectsEx msgWaitForMultipleObjectsEx;
pfnSHAutoComplete shAutoComplete;
@@ -84,16 +84,17 @@ LPFN_WSAADDRESSTOSTRINGA MyWSAAddressToString; ITaskbarList3 * pTaskbarInterface;
-static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
+static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
DWORD dwMsecs, DWORD dwWakeMask, DWORD dwFlags);
-HANDLE hOkToExitEvent,hModulesLoadedEvent;
-static HANDLE hShutdownEvent,hPreShutdownEvent;
+HANDLE hOkToExitEvent, hModulesLoadedEvent;
+static HANDLE hShutdownEvent, hPreShutdownEvent;
static HANDLE hWaitObjects[MAXIMUM_WAIT_OBJECTS-1];
static char *pszWaitServices[MAXIMUM_WAIT_OBJECTS-1];
-static int waitObjectCount=0;
-HANDLE hStackMutex,hMirandaShutdown,hThreadQueueEmpty;
+static int waitObjectCount = 0;
+HANDLE hStackMutex, hMirandaShutdown, hThreadQueueEmpty;
HINSTANCE hMirandaInst;
+int hLangpack = 0;
/////////////////////////////////////////////////////////////////////////////////////////
// exception handling
@@ -148,7 +149,7 @@ void __cdecl forkthread_r(void * arg) struct FORK_ARG * fa = (struct FORK_ARG *) arg;
void (*callercode)(void*)=fa->threadcode;
void * cookie=fa->arg;
- CallService(MS_SYSTEM_THREAD_PUSH,0,(LPARAM)callercode);
+ CallService(MS_SYSTEM_THREAD_PUSH, 0, (LPARAM)callercode);
SetEvent(fa->hEvent);
__try
{
@@ -160,24 +161,24 @@ void __cdecl forkthread_r(void * arg) }
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
- CallService(MS_SYSTEM_THREAD_POP,0,0);
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
return;
}
UINT_PTR forkthread (
- void (__cdecl *threadcode)(void*),
- unsigned long stacksize,
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
void *arg
)
{
UINT_PTR rc;
struct FORK_ARG fa;
- fa.hEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
+ fa.hEvent=CreateEvent(NULL, FALSE, FALSE, NULL);
fa.threadcode=threadcode;
fa.arg=arg;
- rc=_beginthread(forkthread_r,stacksize,&fa);
+ rc=_beginthread(forkthread_r, stacksize, &fa);
if ((UINT_PTR)-1L != rc)
- WaitForSingleObject(fa.hEvent,INFINITE);
+ WaitForSingleObject(fa.hEvent, INFINITE);
CloseHandle(fa.hEvent);
return rc;
@@ -215,16 +216,16 @@ unsigned __stdcall forkthreadex_r(void * arg) }
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
- CallService(MS_SYSTEM_THREAD_POP,0,0);
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
return rc;
}
UINT_PTR forkthreadex(
- void *sec,
- unsigned stacksize,
- unsigned (__stdcall *threadcode)(void*),
- void* owner,
- void *arg,
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void* owner,
+ void *arg,
unsigned *thraddr )
{
UINT_PTR rc;
@@ -232,10 +233,10 @@ UINT_PTR forkthreadex( fa.threadcodeex = threadcode;
fa.arg = arg;
fa.owner = owner;
- fa.hEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
- rc = _beginthreadex(sec,stacksize,forkthreadex_r,(void *)&fa,0,thraddr);
+ fa.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ rc = _beginthreadex(sec, stacksize, forkthreadex_r, (void *)&fa, 0, thraddr);
if (rc)
- WaitForSingleObject(fa.hEvent,INFINITE);
+ WaitForSingleObject(fa.hEvent, INFINITE);
CloseHandle(fa.hEvent);
return rc;
@@ -286,7 +287,7 @@ VOID CALLBACK KillAllThreads(HWND, UINT, UINT_PTR, DWORD) THREAD_WAIT_ENTRY* p = threads[j];
char szModuleName[ MAX_PATH ];
GetModuleFileNameA( p->hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf( NULL, "Thread %p was abnormally terminated because module '%s' didn't release it. Entry point: %p",
+ Netlib_Logf( NULL, "Thread %p was abnormally terminated because module '%s' didn't release it. Entry point: %p",
p->hThread, szModuleName, p->addr );
TerminateThread( p->hThread, 9999 );
CloseHandle(p->hThread);
@@ -342,7 +343,7 @@ static void UnwindThreadWait(void) if ( MirandaWaitForMutex(hStackMutex) ) {
int j;
for ( j=0; j < threads.getCount(); j++ )
- QueueUserAPC(DummyAPCFunc,threads[j]->hThread, 0);
+ QueueUserAPC(DummyAPCFunc, threads[j]->hThread, 0);
ReleaseMutex(hStackMutex);
}
@@ -379,7 +380,7 @@ void* GetCurrentThreadEntryPoint() return ( void* )dwStartAddress;
}
-INT_PTR UnwindThreadPush(WPARAM wParam,LPARAM lParam)
+INT_PTR UnwindThreadPush(WPARAM wParam, LPARAM lParam)
{
ResetEvent(hThreadQueueEmpty); // thread list is not empty
if (WaitForSingleObject(hStackMutex, INFINITE) == WAIT_OBJECT_0)
@@ -399,9 +400,9 @@ INT_PTR UnwindThreadPush(WPARAM wParam,LPARAM lParam) return 0;
}
-INT_PTR UnwindThreadPop(WPARAM,LPARAM)
+INT_PTR UnwindThreadPop(WPARAM, LPARAM)
{
- if (WaitForSingleObject(hStackMutex,INFINITE) == WAIT_OBJECT_0)
+ if (WaitForSingleObject(hStackMutex, INFINITE) == WAIT_OBJECT_0)
{
DWORD dwThreadId=GetCurrentThreadId();
int j;
@@ -432,7 +433,7 @@ INT_PTR UnwindThreadPop(WPARAM,LPARAM) INT_PTR MirandaIsTerminated(WPARAM, LPARAM)
{
- return WaitForSingleObject(hMirandaShutdown,0) == WAIT_OBJECT_0;
+ return WaitForSingleObject(hMirandaShutdown, 0) == WAIT_OBJECT_0;
}
static void __cdecl compactHeapsThread(void*)
@@ -441,20 +442,20 @@ static void __cdecl compactHeapsThread(void*) {
HANDLE hHeaps[256];
DWORD hc;
- SleepEx((1000*60)*5,TRUE); // every 5 minutes
- hc=GetProcessHeaps(255,(PHANDLE)&hHeaps);
+ SleepEx((1000*60)*5, TRUE); // every 5 minutes
+ hc=GetProcessHeaps(255, (PHANDLE)&hHeaps);
if (hc != 0 && hc < 256) {
DWORD j;
- for (j=0;j<hc;j++) HeapCompact(hHeaps[j],0);
+ for (j=0;j<hc;j++) HeapCompact(hHeaps[j], 0);
}
} //while
}
LRESULT CALLBACK APCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (msg == WM_NULL) SleepEx(0,TRUE);
+ if (msg == WM_NULL) SleepEx(0, TRUE);
if (msg == WM_TIMECHANGE) RecalculateTime();
- return DefWindowProc(hwnd,msg,wParam,lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
}
HWND hAPCWindow=NULL;
@@ -486,7 +487,7 @@ static INT_PTR SystemGetIdle(WPARAM, LPARAM lParam) return 0;
}
-static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
+static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
DWORD dwMsecs, DWORD dwWakeMask, DWORD dwFlags)
{
DWORD rc;
@@ -584,16 +585,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int ) #endif
hShFolder = GetModuleHandleA("shell32");
- shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder,"SHGetSpecialFolderPathA");
- shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder,"SHGetSpecialFolderPathW");
+ shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
+ shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
if (shGetSpecialFolderPathA == NULL)
{
hShFolder = LoadLibraryA("ShFolder.dll");
- shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder,"SHGetSpecialFolderPathA");
- shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder,"SHGetSpecialFolderPathW");
+ shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
+ shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
}
- shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
+ shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
if (IsWinVerXPPlus()) {
hThemeAPI = LoadLibraryA("uxtheme.dll");
@@ -604,7 +605,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int ) drawThemeBackground = (pfnDrawThemeBackground)GetProcAddress(hThemeAPI, "DrawThemeBackground");
drawThemeText = (pfnDrawThemeText)GetProcAddress(hThemeAPI, "DrawThemeText");
drawThemeTextEx = (pfnDrawThemeTextEx)GetProcAddress(hThemeAPI, "DrawThemeTextEx");
- getThemeBackgroundContentRect = (pfnGetThemeBackgroundContentRect)GetProcAddress(hThemeAPI ,"GetThemeBackgroundContentRect");
+ getThemeBackgroundContentRect = (pfnGetThemeBackgroundContentRect)GetProcAddress(hThemeAPI , "GetThemeBackgroundContentRect");
getThemeFont = (pfnGetThemeFont)GetProcAddress(hThemeAPI, "GetThemeFont");
closeThemeData = (pfnCloseThemeData)GetProcAddress(hThemeAPI, "CloseThemeData");
enableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture");
@@ -622,8 +623,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int ) if (IsWinVerVistaPlus()) {
hDwmApi = LoadLibraryA("dwmapi.dll");
if (hDwmApi) {
- dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi,"DwmExtendFrameIntoClientArea");
- dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled");
+ dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi, "DwmExtendFrameIntoClientArea");
+ dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
}
}
@@ -644,19 +645,19 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int ) // ParseCommandLine();
if (LoadDefaultModules()) {
- NotifyEventHooks(hShutdownEvent,0,0);
+ NotifyEventHooks(hShutdownEvent, 0, 0);
UnloadDefaultModules();
result = 1;
goto exit;
}
- NotifyEventHooks(hModulesLoadedEvent,0,0);
+ NotifyEventHooks(hModulesLoadedEvent, 0, 0);
// ensure that the kernel hooks the SystemShutdownProc() after all plugins
- HookEvent(ME_SYSTEM_SHUTDOWN,SystemShutdownProc);
+ HookEvent(ME_SYSTEM_SHUTDOWN, SystemShutdownProc);
- forkthread(compactHeapsThread,0,NULL);
- CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK,SystemSetIdleCallback);
+ forkthread(compactHeapsThread, 0, NULL);
+ CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK, SystemSetIdleCallback);
CreateServiceFunction(MS_SYSTEM_GETIDLE, SystemGetIdle);
dwEventTime=GetTickCount();
myPid=GetCurrentProcessId();
@@ -725,7 +726,7 @@ exit: static INT_PTR OkToExit(WPARAM, LPARAM)
{
- return NotifyEventHooks(hOkToExitEvent,0,0) == 0;
+ return NotifyEventHooks(hOkToExitEvent, 0, 0) == 0;
}
static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
@@ -738,11 +739,11 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM) VS_FIXEDFILEINFO *vsffi;
DWORD ver;
- GetModuleFileName(NULL,filename,SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename,&unused);
+ GetModuleFileName(NULL, filename, SIZEOF(filename));
+ verInfoSize=GetFileVersionInfoSize(filename, &unused);
pVerInfo=mir_alloc(verInfoSize);
- GetFileVersionInfo(filename,0,verInfoSize,pVerInfo);
- VerQueryValue(pVerInfo,_T("\\"),(PVOID*)&vsffi,&blockSize);
+ GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
+ VerQueryValue(pVerInfo, _T("\\"), (PVOID*)&vsffi, &blockSize);
ver=(((vsffi->dwProductVersionMS>>16)&0xFF)<<24)|
((vsffi->dwProductVersionMS&0xFF)<<16)|
(((vsffi->dwProductVersionLS>>16)&0xFF)<<8)|
@@ -751,7 +752,7 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM) return (INT_PTR)ver;
}
-static INT_PTR GetMirandaVersionText(WPARAM wParam,LPARAM lParam)
+static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam)
{
TCHAR filename[MAX_PATH], *productVersion;
DWORD unused;
@@ -759,23 +760,23 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam,LPARAM lParam) UINT blockSize;
PVOID pVerInfo;
- GetModuleFileName(NULL,filename,SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename,&unused);
+ GetModuleFileName(NULL, filename, SIZEOF(filename));
+ verInfoSize=GetFileVersionInfoSize(filename, &unused);
pVerInfo=mir_alloc(verInfoSize);
- GetFileVersionInfo(filename,0,verInfoSize,pVerInfo);
- VerQueryValue(pVerInfo,_T("\\StringFileInfo\\000004b0\\ProductVersion"),(LPVOID*)&productVersion,&blockSize);
+ GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
+ VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\ProductVersion"), (LPVOID*)&productVersion, &blockSize);
#if defined( _WIN64 )
mir_snprintf(( char* )lParam, wParam, "%S x64 Unicode", productVersion );
#elif defined( _UNICODE )
mir_snprintf(( char* )lParam, wParam, "%S Unicode", productVersion );
#else
- lstrcpyn((char*)lParam,productVersion,wParam);
+ lstrcpyn((char*)lParam, productVersion, wParam);
#endif
mir_free(pVerInfo);
return 0;
}
-INT_PTR WaitOnHandle(WPARAM wParam,LPARAM lParam)
+INT_PTR WaitOnHandle(WPARAM wParam, LPARAM lParam)
{
if (waitObjectCount>=MAXIMUM_WAIT_OBJECTS-1) return 1;
hWaitObjects[waitObjectCount]=(HANDLE)wParam;
@@ -793,8 +794,8 @@ static INT_PTR RemoveWait(WPARAM wParam, LPARAM) break;
if (i == waitObjectCount) return 1;
waitObjectCount--;
- MoveMemory(&hWaitObjects[i],&hWaitObjects[i+1],sizeof(HANDLE)*(waitObjectCount-i));
- MoveMemory(&pszWaitServices[i],&pszWaitServices[i+1],sizeof(char*)*(waitObjectCount-i));
+ MoveMemory(&hWaitObjects[i], &hWaitObjects[i+1], sizeof(HANDLE)*(waitObjectCount-i));
+ MoveMemory(&pszWaitServices[i], &pszWaitServices[i+1], sizeof(char*)*(waitObjectCount-i));
return 0;
}
@@ -904,38 +905,38 @@ int LoadSystemModule(void) InitCommonControlsEx(&icce);
if (IsWinVerXPPlus()) {
- hAPCWindow=CreateWindowEx(0,_T("ComboLBox"),NULL,0, 0,0,0,0, NULL,NULL,NULL,NULL);
+ hAPCWindow=CreateWindowEx(0, _T("ComboLBox"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetClassLongPtr(hAPCWindow, GCL_STYLE, GetClassLongPtr(hAPCWindow, GCL_STYLE) | CS_DROPSHADOW);
DestroyWindow(hAPCWindow);
hAPCWindow = NULL;
}
- hAPCWindow=CreateWindowEx(0,_T("STATIC"),NULL,0, 0,0,0,0, NULL,NULL,NULL,NULL); // lame
- SetWindowLongPtr(hAPCWindow,GWLP_WNDPROC,(LONG_PTR)APCWndProc);
- hStackMutex=CreateMutex(NULL,FALSE,NULL);
- hMirandaShutdown=CreateEvent(NULL,TRUE,FALSE,NULL);
- hThreadQueueEmpty=CreateEvent(NULL,TRUE,TRUE,NULL);
+ hAPCWindow=CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); // lame
+ SetWindowLongPtr(hAPCWindow, GWLP_WNDPROC, (LONG_PTR)APCWndProc);
+ hStackMutex=CreateMutex(NULL, FALSE, NULL);
+ hMirandaShutdown=CreateEvent(NULL, TRUE, FALSE, NULL);
+ hThreadQueueEmpty=CreateEvent(NULL, TRUE, TRUE, NULL);
hShutdownEvent=CreateHookableEvent(ME_SYSTEM_SHUTDOWN);
hPreShutdownEvent=CreateHookableEvent(ME_SYSTEM_PRESHUTDOWN);
hModulesLoadedEvent=CreateHookableEvent(ME_SYSTEM_MODULESLOADED);
hOkToExitEvent=CreateHookableEvent(ME_SYSTEM_OKTOEXIT);
- CreateServiceFunction(MS_SYSTEM_FORK_THREAD,ForkThreadService);
- CreateServiceFunction(MS_SYSTEM_FORK_THREAD_EX,ForkThreadServiceEx);
- CreateServiceFunction(MS_SYSTEM_THREAD_PUSH,UnwindThreadPush);
- CreateServiceFunction(MS_SYSTEM_THREAD_POP,UnwindThreadPop);
- CreateServiceFunction(MS_SYSTEM_TERMINATED,MirandaIsTerminated);
- CreateServiceFunction(MS_SYSTEM_OKTOEXIT,OkToExit);
- CreateServiceFunction(MS_SYSTEM_GETVERSION,GetMirandaVersion);
- CreateServiceFunction(MS_SYSTEM_GETVERSIONTEXT,GetMirandaVersionText);
- CreateServiceFunction(MS_SYSTEM_WAITONHANDLE,WaitOnHandle);
- CreateServiceFunction(MS_SYSTEM_REMOVEWAIT,RemoveWait);
- CreateServiceFunction(MS_SYSTEM_GET_LI,GetListInterface);
- CreateServiceFunction(MS_SYSTEM_GET_MMI,GetMemoryManagerInterface);
- CreateServiceFunction(MS_SYSTEM_GET_UTFI,GetUtfInterface);
- CreateServiceFunction(MS_SYSTEM_GETEXCEPTFILTER,GetExceptionFilter);
- CreateServiceFunction(MS_SYSTEM_SETEXCEPTFILTER,SetExceptionFilter);
+ CreateServiceFunction(MS_SYSTEM_FORK_THREAD, ForkThreadService);
+ CreateServiceFunction(MS_SYSTEM_FORK_THREAD_EX, ForkThreadServiceEx);
+ CreateServiceFunction(MS_SYSTEM_THREAD_PUSH, UnwindThreadPush);
+ CreateServiceFunction(MS_SYSTEM_THREAD_POP, UnwindThreadPop);
+ CreateServiceFunction(MS_SYSTEM_TERMINATED, MirandaIsTerminated);
+ CreateServiceFunction(MS_SYSTEM_OKTOEXIT, OkToExit);
+ CreateServiceFunction(MS_SYSTEM_GETVERSION, GetMirandaVersion);
+ CreateServiceFunction(MS_SYSTEM_GETVERSIONTEXT, GetMirandaVersionText);
+ CreateServiceFunction(MS_SYSTEM_WAITONHANDLE, WaitOnHandle);
+ CreateServiceFunction(MS_SYSTEM_REMOVEWAIT, RemoveWait);
+ CreateServiceFunction(MS_SYSTEM_GET_LI, GetListInterface);
+ CreateServiceFunction(MS_SYSTEM_GET_MMI, GetMemoryManagerInterface);
+ CreateServiceFunction(MS_SYSTEM_GET_UTFI, GetUtfInterface);
+ CreateServiceFunction(MS_SYSTEM_GETEXCEPTFILTER, GetExceptionFilter);
+ CreateServiceFunction(MS_SYSTEM_SETEXCEPTFILTER, SetExceptionFilter);
InitPathUtils();
return 0;
diff --git a/src/core/miranda.h b/src/core/miranda.h index 3596dd3e13..f9d6340fb4 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -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.
@@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1),A)
-#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)),A)
+#define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1), A)
+#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)), A)
typedef HMONITOR (WINAPI *pfnMyMonitorFromPoint)(POINT, DWORD);
extern pfnMyMonitorFromPoint MyMonitorFromPoint;
@@ -36,7 +36,7 @@ extern pfnMyMonitorFromWindow MyMonitorFromWindow; typedef BOOL(WINAPI *pfnMyGetMonitorInfo) (HMONITOR, LPMONITORINFO);
extern pfnMyGetMonitorInfo MyGetMonitorInfo;
-typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND,DWORD);
+typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND, DWORD);
extern pfnSHAutoComplete shAutoComplete;
typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL );
@@ -142,7 +142,7 @@ char* mir_u2a( const wchar_t* src); /**** miranda.c ************************************************************************/
extern HINSTANCE hMirandaInst;
-extern HANDLE hOkToExitEvent,hModulesLoadedEvent;
+extern HANDLE hOkToExitEvent, hModulesLoadedEvent;
extern pfnExceptionFilter pMirandaExceptFilter;
/**** modules.c ************************************************************************/
diff --git a/src/core/modules.cpp b/src/core/modules.cpp index a24d554a29..43ac51ce78 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -73,7 +73,7 @@ typedef struct // other static variables
static BOOL bServiceMode = FALSE;
-static CRITICAL_SECTION csHooks,csServices;
+static CRITICAL_SECTION csHooks, csServices;
static DWORD mainThreadId;
static int hookId = 1;
static HANDLE hMainThread;
@@ -176,7 +176,7 @@ int LoadDefaultModules(void) }
//this info will be available at LoadNewPluginsModule()
- INT_PTR *disableDefaultModule=(INT_PTR*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY,0,0);
+ INT_PTR *disableDefaultModule=(INT_PTR*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY, 0, 0);
if (LoadSkinSounds()) return 1;
if (LoadSkinHotkeys()) return 1;
@@ -245,7 +245,7 @@ int InitialiseModularEngine(void) InitializeCriticalSection(&csServices);
mainThreadId=GetCurrentThreadId();
- DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&hMainThread,0,FALSE,DUPLICATE_SAME_ACCESS);
+ DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
hMissingService = CreateHookableEvent(ME_SYSTEM_MISSINGSERVICE);
return 0;
@@ -443,7 +443,7 @@ int NotifyEventHooks( HANDLE hEvent, WPARAM wParam, LPARAM lParam ) if ( GetCurrentThreadId() != mainThreadId ) {
THookToMainThreadItem item;
- item.hDoneEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
item.hook = ( THook* )hEvent;
item.wParam = wParam;
item.lParam = lParam;
@@ -518,7 +518,7 @@ HANDLE HookEventMessage( const char* name, HWND hwnd, UINT message ) EnterCriticalSection( &csHooks );
if (( idx = hooks.getIndex(( THook* )name )) == -1 ) {
#ifdef _DEBUG
- MessageBoxA(NULL,"Attempt to hook non-existant event",name,MB_OK);
+ MessageBoxA(NULL, "Attempt to hook non-existant event", name, MB_OK);
#endif
LeaveCriticalSection(&csHooks);
return NULL;
@@ -589,7 +589,7 @@ void KillModuleEventHooks( HINSTANCE hInst ) if ( hooks[i]->subscriber[j].hOwner == hInst ) {
char szModuleName[ MAX_PATH ];
GetModuleFileNameA( hooks[i]->subscriber[j].hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf( NULL, "A hook %08x for event '%s' was abnormally deleted because module '%s' didn't released it",
+ Netlib_Logf( NULL, "A hook %08x for event '%s' was abnormally deleted because module '%s' didn't released it",
hooks[i]->subscriber[j].pfnHook, hooks[i]->name, szModuleName );
UnhookEvent(( HANDLE )(( hooks[i]->id << 16 ) + j + 1 ));
if ( hooks[i]->subscriberCount == 0 )
@@ -660,17 +660,17 @@ HANDLE CreateServiceFunction( const char *name, MIRANDASERVICE serviceProc ) return CreateServiceInt( 0, name, serviceProc, 0, 0 );
}
-HANDLE CreateServiceFunctionParam(const char *name,MIRANDASERVICEPARAM serviceProc,LPARAM lParam)
+HANDLE CreateServiceFunctionParam(const char *name, MIRANDASERVICEPARAM serviceProc, LPARAM lParam)
{
return CreateServiceInt( 1, name, (MIRANDASERVICE)serviceProc, 0, lParam );
}
-HANDLE CreateServiceFunctionObj(const char *name,MIRANDASERVICEOBJ serviceProc,void* object)
+HANDLE CreateServiceFunctionObj(const char *name, MIRANDASERVICEOBJ serviceProc, void* object)
{
return CreateServiceInt( 2, name, (MIRANDASERVICE)serviceProc, object, 0 );
}
-HANDLE CreateServiceFunctionObjParam(const char *name,MIRANDASERVICEOBJPARAM serviceProc,void* object,LPARAM lParam)
+HANDLE CreateServiceFunctionObjParam(const char *name, MIRANDASERVICEOBJPARAM serviceProc, void* object, LPARAM lParam)
{
return CreateServiceInt( 3, name, (MIRANDASERVICE)serviceProc, object, lParam );
}
@@ -700,11 +700,11 @@ int ServiceExists(const char *name) return ret;
}
-INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam)
+INT_PTR CallService(const char *name, WPARAM wParam, LPARAM lParam)
{
#ifdef _DEBUG
if (name == NULL) {
- MessageBoxA(0,"Someone tried to CallService(NULL,..) see stack trace for details","",0);
+ MessageBoxA(0, "Someone tried to CallService(NULL, ..) see stack trace for details", "", 0);
DebugBreak();
return CALLSERVICE_NOTFOUND;
}
@@ -717,13 +717,13 @@ INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam) if (pService == NULL) {
LeaveCriticalSection(&csServices);
#ifdef _DEBUG
- //MessageBoxA(NULL,"Attempt to call non-existant service",name,MB_OK);
+ //MessageBoxA(NULL, "Attempt to call non-existant service", name, MB_OK);
OutputDebugStringA("Missing service called: \t");
OutputDebugStringA(name);
OutputDebugStringA("\n");
#endif
/* { MISSING_SERVICE_PARAMS params = { name, wParam, lParam };
- int result = NotifyEventHooks(hMissingService,0,(LPARAM)¶ms);
+ int result = NotifyEventHooks(hMissingService, 0, (LPARAM)¶ms);
if (result != 0)
return params.lParam;
} */
@@ -736,10 +736,10 @@ INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam) void* object = pService->object;
LeaveCriticalSection(&csServices);
switch( flags ) {
- case 1: return ((MIRANDASERVICEPARAM)pfnService)(wParam,lParam,fnParam);
- case 2: return ((MIRANDASERVICEOBJ)pfnService)(object,wParam,lParam);
- case 3: return ((MIRANDASERVICEOBJPARAM)pfnService)(object,wParam,lParam,fnParam);
- default: return pfnService(wParam,lParam);
+ case 1: return ((MIRANDASERVICEPARAM)pfnService)(wParam, lParam, fnParam);
+ case 2: return ((MIRANDASERVICEOBJ)pfnService)(object, wParam, lParam);
+ case 3: return ((MIRANDASERVICEOBJPARAM)pfnService)(object, wParam, lParam, fnParam);
+ default: return pfnService(wParam, lParam);
} }
static void CALLBACK CallServiceToMainAPCFunc(ULONG_PTR dwParam)
@@ -764,7 +764,7 @@ INT_PTR CallServiceSync(const char *name, WPARAM wParam, LPARAM lParam) item.name = name;
item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
QueueUserAPC(CallServiceToMainAPCFunc, hMainThread, (ULONG_PTR) &item);
- PostMessage(hAPCWindow,WM_NULL,0,0); // let this get processed in its own time
+ PostMessage(hAPCWindow, WM_NULL, 0, 0); // let this get processed in its own time
WaitForSingleObject(item.hDoneEvent, INFINITE);
CloseHandle(item.hDoneEvent);
return item.result;
@@ -777,7 +777,7 @@ int CallFunctionAsync( void (__stdcall *func)(void *), void *arg) {
extern HWND hAPCWindow;
int r = QueueUserAPC(( void (__stdcall *)( ULONG_PTR ))func, hMainThread, ( ULONG_PTR )arg );
- PostMessage(hAPCWindow,WM_NULL,0,0);
+ PostMessage(hAPCWindow, WM_NULL, 0, 0);
return r;
}
@@ -790,7 +790,7 @@ void KillModuleServices( HINSTANCE hInst ) if ( services[i]->hOwner == hInst ) {
char szModuleName[ MAX_PATH ];
GetModuleFileNameA( services[i]->hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf( NULL, "A service function '%s' was abnormally deleted because module '%s' didn't released it",
+ Netlib_Logf( NULL, "A service function '%s' was abnormally deleted because module '%s' didn't released it",
services[i]->name, szModuleName );
DestroyServiceFunction(( HANDLE )services[i]->nameHash );
} }
diff --git a/src/core/modules.h b/src/core/modules.h index f40fc885e6..dc993a97b1 100644 --- a/src/core/modules.h +++ b/src/core/modules.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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,15 +34,15 @@ restructuring modules.c for performance. */
#define MAXMODULELABELLENGTH 64
-typedef int (*MIRANDAHOOK)(WPARAM,LPARAM);
-typedef int (*MIRANDAHOOKPARAM)(WPARAM,LPARAM,LPARAM);
-typedef int (*MIRANDAHOOKOBJ)(void*,WPARAM,LPARAM);
-typedef int (*MIRANDAHOOKOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+typedef int (*MIRANDAHOOK)(WPARAM, LPARAM);
+typedef int (*MIRANDAHOOKPARAM)(WPARAM, LPARAM, LPARAM);
+typedef int (*MIRANDAHOOKOBJ)(void*, WPARAM, LPARAM);
+typedef int (*MIRANDAHOOKOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
-typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM,LPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICEOBJ)(void*,LPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+typedef INT_PTR (*MIRANDASERVICE)(WPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM, LPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICEOBJ)(void*, LPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
typedef struct
{
@@ -116,7 +116,7 @@ considerably slower than from the main thread, but will consume only slightly more actual CPU time, the rest will mostly be spent waiting for the main thread
to return to the message loop so it can be interrupted neatly.
*/
-int NotifyEventHooks(HANDLE hEvent,WPARAM wParam,LPARAM lParam);
+int NotifyEventHooks(HANDLE hEvent, WPARAM wParam, LPARAM lParam);
/* CallHookSubscribers
Works precisely like NotifyEventHooks, but without switching to the first thread
@@ -144,7 +144,7 @@ referring to the hook otherwise. Note that debug builds will warn with a MessageBoxA if a hook is attempted on an unknown event. All hooks will be
automatically destroyed when their parent event is destroyed or the programme
ends, but can be unhooked earlier using UnhookEvent(). hookProc() is defined as
- int HookProc(WPARAM wParam,LPARAM lParam)
+ int HookProc(WPARAM wParam, LPARAM lParam)
where you can substitute your own name for HookProc. wParam and lParam are
defined by the creator of the event when NotifyEventHooks() is called.
The return value is 0 to continue processing the other hooks, or nonzero
@@ -152,9 +152,9 @@ to stop immediately. This abort value is returned to the caller of NotifyEventHooks() and should not be -1 since that is a special return code
for NotifyEventHooks() (see above)
*/
-HANDLE HookEvent(const char *name,MIRANDAHOOK hookProc);
+HANDLE HookEvent(const char *name, MIRANDAHOOK hookProc);
HANDLE HookEventParam(const char *name, MIRANDAHOOKPARAM hookProc, LPARAM lParam);
-HANDLE HookEventObj(const char *name,MIRANDAHOOKOBJ hookProc, void* object);
+HANDLE HookEventObj(const char *name, MIRANDAHOOKOBJ hookProc, void* object);
HANDLE HookEventObjParam(const char *name, MIRANDAHOOKOBJPARAM hookProc, void* object, LPARAM lParam);
/* HookEventMessage
@@ -167,7 +167,7 @@ The window procedure is called with the message 'message' and the wParam and lParam given to NotifyEventHooks(). The return value of SendMessage() is used
in the same way as the return value in HookEvent().
*/
-HANDLE HookEventMessage(const char *name,HWND hwnd,UINT message);
+HANDLE HookEventMessage(const char *name, HWND hwnd, UINT message);
/* UnhookEvent
Removes a hook from its event chain. It will no longer receive any events.
@@ -185,37 +185,37 @@ on exit, but can be removed from the list earlier using DestroyServiceFunction()
Returns NULL if name has already been used. serviceProc is defined by the
caller as
- int ServiceProc(WPARAM wParam,LPARAM lParam)
+ int ServiceProc(WPARAM wParam, LPARAM lParam)
where the creator publishes the meanings of wParam, lParam and the return value
Service functions must not return CALLSERVICE_NOTFOUND since that would confuse
callers of CallService().
*/
-HANDLE CreateServiceFunction(const char *name,MIRANDASERVICE serviceProc);
+HANDLE CreateServiceFunction(const char *name, MIRANDASERVICE serviceProc);
/* CreateServiceFunctionParam
Same as CreateServiceFunction - adds new parameter, to pass to service handler function.
serviceProc is defined by the caller as
- int ServiceProc(WPARAM wParam,LPARAM lParam,LPARAM fnParam)
+ int ServiceProc(WPARAM wParam, LPARAM lParam, LPARAM fnParam)
where fnParam does not need to be publicly known. Gives the ability to handle multiple services
with the same function.
added during 0.7+ (2007/04/24)
*/
-HANDLE CreateServiceFunctionParam(const char *name,MIRANDASERVICEPARAM serviceProc,LPARAM lParam);
+HANDLE CreateServiceFunctionParam(const char *name, MIRANDASERVICEPARAM serviceProc, LPARAM lParam);
/* CreateServiceFunctionObj
CreateServiceFunctionObjParam
Same as CreateServiceFunction - adds new parameter, an object, to pass to service handler function.
serviceProc is defined by the caller as
- int ServiceProc(void* object, WPARAM wParam,LPARAM lParam[,LPARAM fnParam])
+ int ServiceProc(void* object, WPARAM wParam, LPARAM lParam[, LPARAM fnParam])
where fnParam does not need to be publicly known. Gives the ability to handle multiple services
with the same function.
added during 0.7+ (2007/04/24)
*/
-HANDLE CreateServiceFunctionObj(const char *name,MIRANDASERVICEOBJ serviceProc,void* object);
-HANDLE CreateServiceFunctionObjParam(const char *name,MIRANDASERVICEOBJPARAM serviceProc,void* object,LPARAM lParam);
+HANDLE CreateServiceFunctionObj(const char *name, MIRANDASERVICEOBJ serviceProc, void* object);
+HANDLE CreateServiceFunctionObjParam(const char *name, MIRANDASERVICEOBJPARAM serviceProc, void* object, LPARAM lParam);
/* DestroyServiceFunction
Removes the function associated with hService from the global service function
@@ -236,7 +236,7 @@ created, or the value the service function returned otherwise. #else
#define CALLSERVICE_NOTFOUND ((int)0x80000000)
#endif
-INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam);
+INT_PTR CallService(const char *name, WPARAM wParam, LPARAM lParam);
/* ServiceExists
Finds if a service with the given name exists
diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index 5a72b7b6e9..b9c3fbb683 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "..\..\core\commonheaders.h"
-INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
+INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
ADDCONTACTSTRUCT *acs;
@@ -31,7 +31,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara {
char szUin[10];
acs=(ADDCONTACTSTRUCT *)lparam;
- SetWindowLongPtr(hdlg,GWLP_USERDATA,(LONG_PTR)acs);
+ SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)acs);
TranslateDialogDefault(hdlg);
Window_SetIcon_IcoLib(hdlg, SKINICON_OTHER_ADDCONTACT);
@@ -41,8 +41,8 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara dbei.cbSize=sizeof(dbei);
dbei.cbBlob=sizeof(DWORD);
dbei.pBlob=(PBYTE)&dwUin;
- CallService(MS_DB_EVENT_GET,(WPARAM)acs->handle,(LPARAM)&dbei);
- _ltoa(dwUin,szUin,10);
+ CallService(MS_DB_EVENT_GET, (WPARAM)acs->handle, (LPARAM)&dbei);
+ _ltoa(dwUin, szUin, 10);
acs->szProto = dbei.szModule;
}
{
@@ -56,11 +56,11 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara DBEVENTINFO dbei;
HANDLE hcontact;
- ZeroMemory(&dbei,sizeof(dbei));
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)acs->handle,0);
+ dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)acs->handle, 0);
dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
- CallService(MS_DB_EVENT_GET,(WPARAM)acs->handle,(LPARAM)&dbei);
+ CallService(MS_DB_EVENT_GET, (WPARAM)acs->handle, (LPARAM)&dbei);
hcontact=*((PHANDLE)(dbei.pBlob+sizeof(DWORD)));
mir_free(dbei.pBlob);
if (hcontact != INVALID_HANDLE_VALUE) {
@@ -84,7 +84,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara if ( acs->handleType == HANDLE_CONTACT && acs->handle )
if ( acs->szProto == NULL || (acs->szProto != NULL && *acs->szProto == 0 ))
- acs->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)acs->handle,0);
+ acs->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)acs->handle, 0);
{
int groupId;
@@ -92,36 +92,36 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara DBVARIANT dbv;
char idstr[4];
int id;
- _itoa(groupId,idstr,10);
- if (DBGetContactSettingTString(NULL,"CListGroups",idstr,&dbv)) break;
- id = SendDlgItemMessage(hdlg,IDC_GROUP,CB_ADDSTRING,0,(LPARAM)(dbv.ptszVal+1));
- SendDlgItemMessage(hdlg,IDC_GROUP,CB_SETITEMDATA ,id,groupId+1);
+ _itoa(groupId, idstr, 10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv)) break;
+ id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)(dbv.ptszVal+1));
+ SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA , id, groupId+1);
DBFreeVariant(&dbv);
} }
- SendDlgItemMessage(hdlg,IDC_GROUP,CB_INSERTSTRING,0,(LPARAM)TranslateT("None"));
- SendDlgItemMessage(hdlg,IDC_GROUP,CB_SETCURSEL,0,0);
+ SendDlgItemMessage(hdlg, IDC_GROUP, CB_INSERTSTRING, 0, (LPARAM)TranslateT("None"));
+ SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETCURSEL, 0, 0);
/* acs->szProto may be NULL don't expect it */
{
// By default check both checkboxes
- CheckDlgButton(hdlg,IDC_ADDED,BST_CHECKED);
- CheckDlgButton(hdlg,IDC_AUTH,BST_CHECKED);
+ CheckDlgButton(hdlg, IDC_ADDED, BST_CHECKED);
+ CheckDlgButton(hdlg, IDC_AUTH, BST_CHECKED);
- DWORD flags = (acs->szProto) ? CallProtoService(acs->szProto,PS_GETCAPS,PFLAGNUM_4,0) : 0;
+ DWORD flags = (acs->szProto) ? CallProtoService(acs->szProto, PS_GETCAPS, PFLAGNUM_4, 0) : 0;
if (flags&PF4_FORCEADDED) { // force you were added requests for this protocol
- EnableWindow(GetDlgItem(hdlg,IDC_ADDED),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ADDED), FALSE);
}
if (flags&PF4_FORCEAUTH) { // force auth requests for this protocol
- EnableWindow(GetDlgItem(hdlg,IDC_AUTH),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTH), FALSE);
}
if (flags&PF4_NOCUSTOMAUTH) {
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), FALSE);
}
else {
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),IsDlgButtonChecked(hdlg,IDC_AUTH));
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),IsDlgButtonChecked(hdlg,IDC_AUTH));
- SetDlgItemText(hdlg,IDC_AUTHREQ,TranslateT("Please authorize my request and add me to your contact list."));
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), IsDlgButtonChecked(hdlg, IDC_AUTH));
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), IsDlgButtonChecked(hdlg, IDC_AUTH));
+ SetDlgItemText(hdlg, IDC_AUTHREQ, TranslateT("Please authorize my request and add me to your contact list."));
}
}
break;
@@ -133,14 +133,14 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara {
case IDC_AUTH:
{
- DWORD flags = CallProtoService(acs->szProto,PS_GETCAPS,PFLAGNUM_4,0);
+ DWORD flags = CallProtoService(acs->szProto, PS_GETCAPS, PFLAGNUM_4, 0);
if (flags & PF4_NOCUSTOMAUTH) {
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), FALSE);
}
else {
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),IsDlgButtonChecked(hdlg,IDC_AUTH));
- EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),IsDlgButtonChecked(hdlg,IDC_AUTH));
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), IsDlgButtonChecked(hdlg, IDC_AUTH));
+ EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), IsDlgButtonChecked(hdlg, IDC_AUTH));
}
}
break;
@@ -219,7 +219,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara case WM_DESTROY:
Window_FreeIcon_IcoLib(hdlg);
- acs = ( ADDCONTACTSTRUCT* )GetWindowLongPtr(hdlg,GWLP_USERDATA);
+ acs = ( ADDCONTACTSTRUCT* )GetWindowLongPtr(hdlg, GWLP_USERDATA);
if (acs) {
if (acs->psr) {
mir_free(acs->psr->nick);
@@ -236,7 +236,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara return FALSE;
}
-INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam)
+INT_PTR AddContactDialog(WPARAM wParam, LPARAM lParam)
{
if (lParam) {
ADDCONTACTSTRUCT* acs = ( ADDCONTACTSTRUCT* )mir_alloc(sizeof(ADDCONTACTSTRUCT));
@@ -245,7 +245,7 @@ INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) PROTOSEARCHRESULT *psr;
/* bad! structures that are bigger than psr will cause crashes if they define pointers within unreachable structural space */
psr = (PROTOSEARCHRESULT *)mir_alloc(acs->psr->cbSize);
- memmove(psr,acs->psr,acs->psr->cbSize);
+ memmove(psr, acs->psr, acs->psr->cbSize);
psr->nick = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->nick) : mir_a2t((char*)psr->nick);
psr->firstName = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->firstName) : mir_a2t((char*)psr->firstName);
psr->lastName = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->lastName) : mir_a2t((char*)psr->lastName);
@@ -256,9 +256,9 @@ INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) }
if ( wParam )
- DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(IDD_ADDCONTACT),(HWND)wParam,AddContactDlgProc,(LPARAM)acs);
+ DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_ADDCONTACT), (HWND)wParam, AddContactDlgProc, (LPARAM)acs);
else
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_ADDCONTACT),(HWND)wParam,AddContactDlgProc,(LPARAM)acs);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_ADDCONTACT), (HWND)wParam, AddContactDlgProc, (LPARAM)acs);
return 0;
}
return 1;
@@ -266,6 +266,6 @@ INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) int LoadAddContactModule(void)
{
- CreateServiceFunction(MS_ADDCONTACT_SHOW,AddContactDialog);
+ CreateServiceFunction(MS_ADDCONTACT_SHOW, AddContactDialog);
return 0;
}
diff --git a/src/modules/autoaway/autoaway.cpp b/src/modules/autoaway/autoaway.cpp index 46bc9c917b..af774200d9 100644 --- a/src/modules/autoaway/autoaway.cpp +++ b/src/modules/autoaway/autoaway.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.
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index 5bbc752d5d..86282fe47f 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -146,8 +146,8 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) HDC dc = GetDC(hwndParent);
HBRUSH oldBrush = (HBRUSH)GetCurrentObject( dc, OBJ_BRUSH );
hbr = (HBRUSH)SendMessage(hwndParent, WM_CTLCOLORDLG, (WPARAM)dc, (LPARAM)hwndParent);
- SelectObject(dc,oldBrush);
- ReleaseDC(hwndParent,dc);
+ SelectObject(dc, oldBrush);
+ ReleaseDC(hwndParent, dc);
}
if (hbr) {
FillRect(hdcMem, &rcClient, hbr);
@@ -155,11 +155,11 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) }
if (ctl->stateId == PBS_HOT||ctl->focus) {
if (ctl->pbState)
- DrawEdge(hdcMem,&rcClient, EDGE_ETCHED,BF_RECT|BF_SOFT);
- else DrawEdge(hdcMem,&rcClient, BDR_RAISEDOUTER,BF_RECT|BF_SOFT|BF_FLAT);
+ DrawEdge(hdcMem, &rcClient, EDGE_ETCHED, BF_RECT|BF_SOFT);
+ else DrawEdge(hdcMem, &rcClient, BDR_RAISEDOUTER, BF_RECT|BF_SOFT|BF_FLAT);
}
else if (ctl->stateId == PBS_PRESSED)
- DrawEdge(hdcMem, &rcClient, BDR_SUNKENOUTER,BF_RECT|BF_SOFT);
+ DrawEdge(hdcMem, &rcClient, BDR_SUNKENOUTER, BF_RECT|BF_SOFT);
}
}
else {
@@ -197,10 +197,10 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) HIMAGELIST hImageList;
HICON hIconNew;
- hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0);
+ hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0);
ImageList_AddIcon(hImageList, ctl->hIcon);
hIconNew = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
- DrawState(hdcMem,NULL,NULL,(LPARAM)hIconNew,0,ix,iy,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),IsWindowEnabled(ctl->hwnd)?DST_ICON|DSS_NORMAL:DST_ICON|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)hIconNew, 0, ix, iy, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWindowEnabled(ctl->hwnd)?DST_ICON|DSS_NORMAL:DST_ICON|DSS_DISABLED);
ImageList_RemoveAll(hImageList);
ImageList_Destroy(hImageList);
DestroyIcon(hIconNew);
@@ -208,7 +208,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) }
else if (ctl->hBitmap) {
BITMAP bminfo;
- int ix,iy;
+ int ix, iy;
GetObject(ctl->hBitmap, sizeof(bminfo), &bminfo);
ix = (rcClient.right-rcClient.left)/2 - (bminfo.bmWidth/2);
@@ -217,7 +217,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) ix++;
iy++;
}
- DrawState(hdcMem,NULL,NULL,(LPARAM)ctl->hBitmap,0,ix,iy,bminfo.bmWidth,bminfo.bmHeight,IsWindowEnabled(ctl->hwnd)?DST_BITMAP:DST_BITMAP|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->hBitmap, 0, ix, iy, bminfo.bmWidth, bminfo.bmHeight, IsWindowEnabled(ctl->hwnd)?DST_BITMAP:DST_BITMAP|DSS_DISABLED);
}
else if (GetWindowTextLength(ctl->hwnd)) {
// Draw the text and optinally the arrow
@@ -240,10 +240,10 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) sz.cx -= szHot.cx;
}
if (ctl->arrow) {
- DrawState(hdcMem,NULL,NULL,(LPARAM)ctl->arrow,0,rcClient.right-rcClient.left-5-GetSystemMetrics(SM_CXSMICON)+(!ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0),(rcClient.bottom-rcClient.top)/2-GetSystemMetrics(SM_CYSMICON)/2+(!ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0),GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-GetSystemMetrics(SM_CXSMICON)+(!ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-GetSystemMetrics(SM_CYSMICON)/2+(!ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
}
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem,NULL,NULL,(LPARAM)szText,0,(rcText.right-rcText.left-sz.cx)/2+(!ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0),ctl->hThemeButton?(rcText.bottom-rcText.top-sz.cy)/2:(rcText.bottom-rcText.top-sz.cy)/2-(ctl->stateId == PBS_PRESSED?0:1),sz.cx,sz.cy,IsWindowEnabled(ctl->hwnd)||ctl->hThemeButton?DST_PREFIXTEXT|DSS_NORMAL:DST_PREFIXTEXT|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)szText, 0, (rcText.right-rcText.left-sz.cx)/2+(!ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0), ctl->hThemeButton?(rcText.bottom-rcText.top-sz.cy)/2:(rcText.bottom-rcText.top-sz.cy)/2-(ctl->stateId == PBS_PRESSED?0:1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd)||ctl->hThemeButton?DST_PREFIXTEXT|DSS_NORMAL:DST_PREFIXTEXT|DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
BitBlt(hdcPaint, 0, 0, rcClient.right-rcClient.left, rcClient.bottom-rcClient.top, hdcMem, 0, 0, SRCCOPY);
@@ -566,17 +566,17 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L InvalidateRect(bct->hwnd, NULL, TRUE);
}
// Call timer, used to start cheesy TrackMouseEvent faker
- SetTimer(hwndDlg,BUTTON_POLLID,BUTTON_POLLDELAY,NULL);
+ SetTimer(hwndDlg, BUTTON_POLLID, BUTTON_POLLDELAY, NULL);
break;
case WM_TIMER: // use a timer to check if they have did a mouseout
if (wParam == BUTTON_POLLID) {
RECT rc;
POINT pt;
- GetWindowRect(hwndDlg,&rc);
+ GetWindowRect(hwndDlg, &rc);
GetCursorPos(&pt);
- if (!PtInRect(&rc,pt)) { // mouse must be gone, trigger mouse leave
- PostMessage(hwndDlg,WM_MOUSELEAVE,0,0L);
- KillTimer(hwndDlg,BUTTON_POLLID);
+ if (!PtInRect(&rc, pt)) { // mouse must be gone, trigger mouse leave
+ PostMessage(hwndDlg, WM_MOUSELEAVE, 0, 0L);
+ KillTimer(hwndDlg, BUTTON_POLLID);
} }
break;
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index 4c32b7335e..95bffa718f 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.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.
@@ -349,9 +349,9 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2,
- pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2,
+ pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2,
DBGetContactSettingDword(NULL, "CList", "Width", 0),
- DBGetContactSettingDword(NULL, "CList", "Height", 0),
+ DBGetContactSettingDword(NULL, "CList", "Height", 0),
SWP_NOZORDER);
Docking_Command(msg->hwnd, ABM_REMOVE);
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index f260a8c452..1a9e32617f 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -151,7 +151,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam) int i;
if (ack->type == ACKTYPE_STATUS) {
- WindowList_BroadcastAsync(hClcWindowList,INTM_INVALIDATE,0,0);
+ WindowList_BroadcastAsync(hClcWindowList, INTM_INVALIDATE, 0, 0);
if (ack->result == ACKRESULT_SUCCESS) {
for (i = 0; i < cli.hClcProtoCount; i++) {
if (!lstrcmpA(cli.clcProto[i].szProto, ack->szModule)) {
@@ -166,25 +166,25 @@ static int ClcProtoAck(WPARAM, LPARAM lParam) static int ClcContactAdded(WPARAM wParam, LPARAM lParam)
{
- WindowList_BroadcastAsync(hClcWindowList,INTM_CONTACTADDED,wParam,lParam);
+ WindowList_BroadcastAsync(hClcWindowList, INTM_CONTACTADDED, wParam, lParam);
return 0;
}
static int ClcContactDeleted(WPARAM wParam, LPARAM lParam)
{
- WindowList_BroadcastAsync(hClcWindowList,INTM_CONTACTDELETED,wParam,lParam);
+ WindowList_BroadcastAsync(hClcWindowList, INTM_CONTACTDELETED, wParam, lParam);
return 0;
}
static int ClcContactIconChanged(WPARAM wParam, LPARAM lParam)
{
- WindowList_BroadcastAsync(hClcWindowList,INTM_ICONCHANGED,wParam,lParam);
+ WindowList_BroadcastAsync(hClcWindowList, INTM_ICONCHANGED, wParam, lParam);
return 0;
}
static int ClcIconsChanged(WPARAM, LPARAM)
{
- WindowList_BroadcastAsync(hClcWindowList,INTM_INVALIDATE,0,0);
+ WindowList_BroadcastAsync(hClcWindowList, INTM_INVALIDATE, 0, 0);
return 0;
}
@@ -287,10 +287,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, dat->needsResort = 1;
cli.pfnLoadClcOptions(hwnd, dat);
if (!IsWindowVisible(hwnd))
- SetTimer(hwnd,TIMERID_REBUILDAFTER,10,NULL);
+ SetTimer(hwnd, TIMERID_REBUILDAFTER, 10, NULL);
else
{
- cli.pfnRebuildEntireList(hwnd,dat);
+ cli.pfnRebuildEntireList(hwnd, dat);
NMCLISTCONTROL nm;
nm.hdr.code = CLN_LISTREBUILT;
nm.hdr.hwndFrom = hwnd;
@@ -321,7 +321,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnRecalcScrollBar(hwnd, dat);
{ // creating imagelist containing blue line for highlight
HBITMAP hBmp, hBmpMask, hoBmp, hoMaskBmp;
- HDC hdc,hdcMem;
+ HDC hdc, hdcMem;
RECT rc;
int depth;
HBRUSH hBrush;
@@ -509,7 +509,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM) & nm);
dat->needsResort = 1;
}
- SetTimer(hwnd,TIMERID_REBUILDAFTER,1,NULL);
+ SetTimer(hwnd, TIMERID_REBUILDAFTER, 1, NULL);
break;
}
case INTM_ICONCHANGED:
@@ -579,7 +579,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (!cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
- lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam,0), SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText));
dat->needsResort = 1;
SortClcByTimer(hwnd);
break;
@@ -591,7 +591,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
contact->proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
cli.pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
- lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam,0), SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText));
SortClcByTimer(hwnd);
break;
}
@@ -680,7 +680,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, HDC hdc;
PAINTSTRUCT ps;
hdc = BeginPaint(hwnd, &ps);
- /* we get so many cli.pfnInvalidateRect()'s that there is no point painting,
+ /* we get so many cli.pfnInvalidateRect()'s that there is no point painting,
Windows in theory shouldn't queue up WM_PAINTs in this case but it does so
we'll just ignore them */
if (IsWindowVisible(hwnd))
@@ -909,16 +909,16 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
}
case TIMERID_REBUILDAFTER:
- KillTimer(hwnd,TIMERID_REBUILDAFTER);
- cli.pfnInvalidateRect(hwnd,NULL,FALSE);
- cli.pfnSaveStateAndRebuildList(hwnd,dat);
+ KillTimer(hwnd, TIMERID_REBUILDAFTER);
+ cli.pfnInvalidateRect(hwnd, NULL, FALSE);
+ cli.pfnSaveStateAndRebuildList(hwnd, dat);
break;
case TIMERID_DELAYEDRESORTCLC:
- KillTimer(hwnd,TIMERID_DELAYEDRESORTCLC);
- cli.pfnInvalidateRect(hwnd,NULL,FALSE);
- cli.pfnSortCLC(hwnd,dat,1);
- cli.pfnRecalcScrollBar(hwnd,dat);
+ KillTimer(hwnd, TIMERID_DELAYEDRESORTCLC);
+ cli.pfnInvalidateRect(hwnd, NULL, FALSE);
+ cli.pfnSortCLC(hwnd, dat, 1);
+ cli.pfnRecalcScrollBar(hwnd, dat);
break;
}
break;
@@ -958,7 +958,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (dat->selection != -1) {
dat->selection =
- cli.pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl,selcontact));
+ cli.pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact));
if (dat->selection == -1)
dat->selection = cli.pfnGetRowsPriorTo(&dat->list, contact->group, -1);
}
@@ -1321,7 +1321,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, case POPUP_GROUPHIDEOFFLINE:
if (contact->type != CLCIT_GROUP)
break;
- CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId,
+ CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId,
MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
break;
}
diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h index 0bbf197b44..f9ac61e634 100644 --- a/src/modules/clist/clc.h +++ b/src/modules/clist/clc.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -103,7 +103,7 @@ struct ClcGroup* fnRemoveItemFromGroup(HWND hwnd, struct ClcGroup *group, struct void fnFreeContact( struct ClcContact *p );
void fnFreeGroup( struct ClcGroup *group );
int fnAddInfoItemToGroup(struct ClcGroup *group, int flags, const TCHAR *pszText);
-int fnAddItemToGroup( struct ClcGroup *group,int iAboveItem );
+int fnAddItemToGroup( struct ClcGroup *group, int iAboveItem );
void fnAddContactToTree( HWND hwnd, struct ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline);
int fnAddContactToGroup( struct ClcData *dat, struct ClcGroup *group, HANDLE hContact);
void fnDeleteItemFromTree( HWND hwnd, HANDLE hItem );
@@ -149,9 +149,9 @@ int fnGetRowTotalHeight(struct ClcData *dat); int fnRowHitTest(struct ClcData *dat, int y);
/* clcopts.c */
-int ClcOptInit(WPARAM wParam,LPARAM lParam);
+int ClcOptInit(WPARAM wParam, LPARAM lParam);
DWORD GetDefaultExStyle(void);
-void GetFontSetting(int i,LOGFONTA *lf,COLORREF *colour);
+void GetFontSetting(int i, LOGFONTA *lf, COLORREF *colour);
/* clistmenus.c */
HGENMENU fnGetProtocolMenu( const char* );
@@ -224,7 +224,7 @@ VOID CALLBACK fnTrayCycleTimerProc(HWND hwnd, UINT message, UINT_PTR idEvent, DW /* clui.c */
LRESULT CALLBACK fnContactListWndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
void fnLoadCluiGlobalOpts( void );
-void fnCluiProtocolStatusChanged(int,const char*);
+void fnCluiProtocolStatusChanged(int, const char*);
void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon);
/* contact.c */
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index beff769bce..54660267c9 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.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.
diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index 37a7bb7f0e..1256ad4c8b 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.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.
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index f5c0e87300..261710c078 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.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.
@@ -205,7 +205,7 @@ int fnAddContactToGroup(struct ClcData *dat, struct ClcGroup *group, HANDLE hCon idleMode = szProto != NULL ? DBGetContactSettingDword(hContact, szProto, "IdleTS", 0) : 0;
if (idleMode)
group->cl.items[i]->flags |= CONTACTF_IDLE;
- lstrcpyn(group->cl.items[i]->szText, cli.pfnGetContactDisplayName(hContact,0), SIZEOF(group->cl.items[i]->szText));
+ lstrcpyn(group->cl.items[i]->szText, cli.pfnGetContactDisplayName(hContact, 0), SIZEOF(group->cl.items[i]->szText));
{ ClcCacheEntryBase* p = cli.pfnGetCacheEntry(hContact);
if ( p != NULL ) {
@@ -573,7 +573,7 @@ void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort) }
if (hSelItem)
if (cli.pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
- dat->selection = cli.pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl,selcontact));
+ dat->selection = cli.pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact));
cli.pfnRecalcScrollBar(hwnd, dat);
}
@@ -637,7 +637,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) {
SavedContactState_t* p = new SavedContactState_t;
p->hContact = group->cl.items[group->scanIndex]->hContact;
- CopyMemory( p->iExtraImage, group->cl.items[group->scanIndex]->iExtraImage,
+ CopyMemory( p->iExtraImage, group->cl.items[group->scanIndex]->iExtraImage,
sizeof(group->cl.items[group->scanIndex]->iExtraImage));
p->checked = group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED;
saveContact.insert( p );
@@ -676,7 +676,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) SavedContactState_t tmp, *p;
tmp.hContact = group->cl.items[group->scanIndex]->hContact;
if (( p = saveContact.find( &tmp )) != NULL ) {
- CopyMemory(group->cl.items[group->scanIndex]->iExtraImage, p->iExtraImage,
+ CopyMemory(group->cl.items[group->scanIndex]->iExtraImage, p->iExtraImage,
SIZEOF(group->cl.items[group->scanIndex]->iExtraImage));
if (p->checked)
group->cl.items[group->scanIndex]->flags |= CONTACTF_CHECKED;
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index 17bf8834e7..116beb3486 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -76,7 +76,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR }
case CLM_AUTOREBUILD:
- KillTimer(hwnd,TIMERID_REBUILDAFTER);
+ KillTimer(hwnd, TIMERID_REBUILDAFTER);
cli.pfnSaveStateAndRebuildList(hwnd, dat);
break;
@@ -103,7 +103,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- cli.pfnEnsureVisible(hwnd, dat, cli.pfnGetRowsPriorTo(&dat->list, group, List_IndexOf((SortedList*)&group->cl,contact)), 0);
+ cli.pfnEnsureVisible(hwnd, dat, cli.pfnGetRowsPriorTo(&dat->list, group, List_IndexOf((SortedList*)&group->cl, contact)), 0);
break;
}
@@ -219,7 +219,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR if (!cli.pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
return NULL;
- int i = List_IndexOf((SortedList*)&group->cl,contact);
+ int i = List_IndexOf((SortedList*)&group->cl, contact);
switch (wParam) {
case CLGN_CHILD:
if (contact->type != CLCIT_GROUP)
@@ -324,7 +324,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, List_IndexOf((SortedList*)&group->cl,contact));
+ dat->selection = cli.pfnGetRowsPriorTo(&dat->list, group, List_IndexOf((SortedList*)&group->cl, contact));
cli.pfnEnsureVisible(hwnd, dat, dat->selection, 0);
break;
}
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 40b923d78e..054657878f 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -410,7 +410,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) if (contact->type == CLCIT_GROUP) {
if (contact->group->parent && contact->group->parent->parent) {
TCHAR szFullName[256];
- mir_sntprintf(szFullName, SIZEOF(szFullName), _T("%s\\%s"),
+ mir_sntprintf(szFullName, SIZEOF(szFullName), _T("%s\\%s"),
cli.pfnGetGroupName(contact->group->parent->groupId, NULL), text);
cli.pfnRenameGroup(contact->groupId, szFullName);
}
@@ -734,7 +734,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) dat->fontInfo[i].hFont = CreateFontIndirect(&lf);
dat->fontInfo[i].changed = 0;
- HFONT holdfont = (HFONT)SelectObject(hdc,dat->fontInfo[i].hFont);
+ HFONT holdfont = (HFONT)SelectObject(hdc, dat->fontInfo[i].hFont);
GetTextExtentPoint32(hdc, _T("x"), 1, &fontSize);
SelectObject(hdc, holdfont);
diff --git a/src/modules/clist/clistcore.cpp b/src/modules/clist/clistcore.cpp index 6821b3a577..ad3f6832de 100644 --- a/src/modules/clist/clistcore.cpp +++ b/src/modules/clist/clistcore.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -44,7 +44,7 @@ static struct ClcContact* fnCreateClcContact( void ) return ( struct ClcContact* )mir_calloc( sizeof( struct ClcContact ));
}
-static BOOL fnInvalidateRect( HWND hwnd, CONST RECT* lpRect,BOOL bErase )
+static BOOL fnInvalidateRect( HWND hwnd, CONST RECT* lpRect, BOOL bErase )
{
return InvalidateRect( hwnd, lpRect, bErase );
}
@@ -58,7 +58,7 @@ static void fnReloadProtoMenus( void ) RebuildMenuOrder();
if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
BuildProtoMenus();
- cli.pfnCluiProtocolStatusChanged(0,0);
+ cli.pfnCluiProtocolStatusChanged(0, 0);
}
static INT_PTR srvRetrieveInterface( WPARAM, LPARAM lParam )
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 6f8b0c4049..9ccaa40c09 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -113,7 +113,7 @@ static void ShowEventsInTray() {
int j;
for (j=0; j<nTrayProtoCnt; j++)
- if ( iEventProto && pTrayProtos[j] && !lstrcmpA(pTrayProtos[j],iEventProto))
+ if ( iEventProto && pTrayProtos[j] && !lstrcmpA(pTrayProtos[j], iEventProto))
break;
if ( j>=nTrayProtoCnt ) j=0; //event was not found so assume first icon
if ( pTrayProtos[j] ) //if not already set
@@ -218,8 +218,8 @@ int fnRemoveEvent( HANDLE hContact, HANDLE dbEvent ) // Update contact's icon
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact,
- CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->cle.hContact, 1),
+ cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact,
+ CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->cle.hContact, 1),
0);
// Free any memory allocated to the event
@@ -236,7 +236,7 @@ int fnRemoveEvent( HANDLE hContact, HANDLE dbEvent ) szEventProto=(char *) cli.events.items[i]->cle.lpszProtocol;
else
szEventProto = NULL;
- if (szEventProto && szProto && !lstrcmpA(szEventProto,szProto))
+ if (szEventProto && szProto && !lstrcmpA(szEventProto, szProto))
nSameProto++;
}
@@ -391,10 +391,10 @@ static int CListEventSettingsChanged(WPARAM wParam, LPARAM lParam) /***************************************************************************************/
-INT_PTR AddEventSyncStub(WPARAM wParam, LPARAM lParam) { return CallServiceSync(MS_CLIST_ADDEVENT"_SYNC",wParam, lParam); }
+INT_PTR AddEventSyncStub(WPARAM wParam, LPARAM lParam) { return CallServiceSync(MS_CLIST_ADDEVENT"_SYNC", wParam, lParam); }
INT_PTR AddEventStub(WPARAM, LPARAM lParam) { return cli.pfnAddEvent((CLISTEVENT*)lParam ) == NULL; }
-INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent((HANDLE)wParam,(HANDLE)lParam ); }
-INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent((HANDLE)wParam,(int)lParam); }
+INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent((HANDLE)wParam, (HANDLE)lParam ); }
+INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent((HANDLE)wParam, (int)lParam); }
int InitCListEvents(void)
{
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 051cc4cee6..2a77fbb731 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -40,7 +40,7 @@ typedef struct { int iconId;
CLISTMENUITEM mi;
}
- CListIntMenuItem,*lpCListIntMenuItem;
+ CListIntMenuItem, *lpCListIntMenuItem;
//new menu sys
HANDLE hMainMenuObject = 0;
@@ -57,22 +57,22 @@ HANDLE hPreBuildMainMenuEvent, hStatusModeChangeEvent, hPreBuildContactMenuEvent static HANDLE hAckHook;
-static HMENU hMainMenu,hStatusMenu = 0;
+static HMENU hMainMenu, hStatusMenu = 0;
static const int statusModeList[ MAX_STATUS_COUNT ] =
{
- ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED,
+ ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED,
ID_STATUS_DND, ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH
};
static const int skinIconStatusList[ MAX_STATUS_COUNT ] =
{
- SKINICON_STATUS_OFFLINE, SKINICON_STATUS_ONLINE, SKINICON_STATUS_AWAY, SKINICON_STATUS_NA, SKINICON_STATUS_OCCUPIED,
+ SKINICON_STATUS_OFFLINE, SKINICON_STATUS_ONLINE, SKINICON_STATUS_AWAY, SKINICON_STATUS_NA, SKINICON_STATUS_OCCUPIED,
SKINICON_STATUS_DND, SKINICON_STATUS_FREE4CHAT, SKINICON_STATUS_INVISIBLE, SKINICON_STATUS_ONTHEPHONE, SKINICON_STATUS_OUTTOLUNCH
};
static const int statusModePf2List[ MAX_STATUS_COUNT ] =
{
- 0xFFFFFFFF, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND,
+ 0xFFFFFFFF, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND,
PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH
};
@@ -87,7 +87,7 @@ typedef struct int protostatus[ MAX_STATUS_COUNT ];
PMO_IntMenuItem menuhandle[ MAX_STATUS_COUNT ];
}
- tStatusMenuHandles,*lpStatusMenuHandles;
+ tStatusMenuHandles, *lpStatusMenuHandles;
lpStatusMenuHandles hStatusMenuHandles;
int hStatusMenuHandlesCnt;
@@ -99,7 +99,7 @@ typedef struct TCHAR *szMenuName;
int Param1;
}
- MainMenuExecParam,*lpMainMenuExecParam;
+ MainMenuExecParam, *lpMainMenuExecParam;
//contactmenu exec param(ownerdata)
//also used in checkservice
@@ -109,7 +109,7 @@ typedef struct char *pszContactOwner;//for check proc
int param;
}
- ContactMenuExecParam,*lpContactMenuExecParam;
+ ContactMenuExecParam, *lpContactMenuExecParam;
typedef struct
{
@@ -129,7 +129,7 @@ typedef struct char *svc;
HANDLE hMenuItem;
}
- StatusMenuExecParam,*lpStatusMenuExecParam;
+ StatusMenuExecParam, *lpStatusMenuExecParam;
typedef struct _MenuItemHandles
{
@@ -192,7 +192,7 @@ return 0 on success. static INT_PTR RemoveMainMenuItem(WPARAM wParam, LPARAM)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -201,10 +201,10 @@ static INT_PTR BuildMainMenu(WPARAM, LPARAM) ListParam param = { 0 };
param.MenuObjectHandle = hMainMenuObject;
- NotifyEventHooks(hPreBuildMainMenuEvent,(WPARAM)0,(LPARAM)0);
+ NotifyEventHooks(hPreBuildMainMenuEvent, (WPARAM)0, (LPARAM)0);
- CallService(MO_BUILDMENU,(WPARAM)hMainMenu,(LPARAM)¶m);
- DrawMenuBar((HWND)CallService("CLUI/GetHwnd",(WPARAM)0,(LPARAM)0));
+ CallService(MO_BUILDMENU, (WPARAM)hMainMenu, (LPARAM)¶m);
+ DrawMenuBar((HWND)CallService("CLUI/GetHwnd", (WPARAM)0, (LPARAM)0));
return (INT_PTR)hMainMenu;
}
@@ -270,11 +270,11 @@ INT_PTR MainMenuExecService(WPARAM wParam, LPARAM lParam) {
lpMainMenuExecParam mmep = ( lpMainMenuExecParam )wParam;
if ( mmep != NULL ) {
- // bug in help.c,it used wparam as parent window handle without reason.
- if ( !lstrcmpA(mmep->szServiceName,"Help/AboutCommand"))
+ // bug in help.c, it used wparam as parent window handle without reason.
+ if ( !lstrcmpA(mmep->szServiceName, "Help/AboutCommand"))
mmep->Param1 = 0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
return 1;
}
@@ -294,7 +294,7 @@ INT_PTR FreeOwnerDataMainMenu(WPARAM, LPARAM lParam) static INT_PTR RemoveContactMenuItem(WPARAM wParam, LPARAM)
{
- CallService(MO_REMOVEMENUITEM,wParam,0);
+ CallService(MO_REMOVEMENUITEM, wParam, 0);
return 0;
}
@@ -351,21 +351,21 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam) static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM)
{
HANDLE hContact = ( HANDLE )wParam;
- NotifyEventHooks(hPreBuildContactMenuEvent,(WPARAM)hContact,0);
+ NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0);
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
BuildContactParam bcp;
bcp.szProto = szProto;
- bcp.isOnList = ( DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 0 );
- bcp.isOnline = ( szProto != NULL && ID_STATUS_OFFLINE != DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE));
+ bcp.isOnList = ( DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 0 );
+ bcp.isOnline = ( szProto != NULL && ID_STATUS_OFFLINE != DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE));
ListParam param = { 0 };
param.MenuObjectHandle = hContactMenuObject;
param.wParam = (WPARAM)&bcp;
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)¶m);
return (INT_PTR)hMenu;
}
@@ -373,18 +373,18 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM) //called with:
//wparam - ownerdata
//lparam - lparam from winproc
-INT_PTR ContactMenuExecService(WPARAM wParam,LPARAM lParam)
+INT_PTR ContactMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
lpContactMenuExecParam cmep=(lpContactMenuExecParam)wParam;
- //call with wParam=(WPARAM)(HANDLE)hContact,lparam=popupposition
- CallService(cmep->szServiceName,lParam,cmep->param);
+ //call with wParam=(WPARAM)(HANDLE)hContact, lparam=popupposition
+ CallService(cmep->szServiceName, lParam, cmep->param);
}
return 0;
}
-//true - ok,false ignore
-INT_PTR ContactMenuCheckService(WPARAM wParam,LPARAM)
+//true - ok, false ignore
+INT_PTR ContactMenuCheckService(WPARAM wParam, LPARAM)
{
PCheckProcParam pcpp = ( PCheckProcParam )wParam;
BuildContactParam *bcp=NULL;
@@ -442,7 +442,7 @@ BOOL FindMenuHandleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itd mii.cbSize = MENUITEMINFO_V4_SIZE;
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for ( i = GetMenuItemCount( hMenu )-1; i >= 0; i-- ) {
- GetMenuItemInfo(hMenu,i,TRUE,&mii);
+ GetMenuItemInfo(hMenu, i, TRUE, &mii);
if ( mii.fType == MFT_SEPARATOR )
continue;
if ( mii.hSubMenu )
@@ -543,7 +543,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) } } }
}
else if ( smep && smep->status && !smep->custom ) {
- int curProtoStatus = ( smep->proto ) ? CallProtoService(smep->proto,PS_GETSTATUS,0,0) : GetAverageMode();
+ int curProtoStatus = ( smep->proto ) ? CallProtoService(smep->proto, PS_GETSTATUS, 0, 0) : GetAverageMode();
if ( smep->status == curProtoStatus )
timi->mi.flags |= CMIF_CHECKED;
else
@@ -568,13 +568,13 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if ( Proto_GetAccount( prot ) == NULL )
return TRUE;
- if (( curProtoStatus = CallProtoService(prot,PS_GETSTATUS,0,0)) == CALLSERVICE_NOTFOUND )
+ if (( curProtoStatus = CallProtoService(prot, PS_GETSTATUS, 0, 0)) == CALLSERVICE_NOTFOUND )
curProtoStatus = 0;
if ( curProtoStatus >= ID_STATUS_OFFLINE && curProtoStatus < ID_STATUS_IDLE )
- timi->mi.hIcon = LoadSkinProtoIcon(prot,curProtoStatus);
+ timi->mi.hIcon = LoadSkinProtoIcon(prot, curProtoStatus);
else {
- timi->mi.hIcon=(HICON)CallProtoService(prot,PS_LOADICON,PLI_PROTOCOL|PLIF_SMALL,0);
+ timi->mi.hIcon=(HICON)CallProtoService(prot, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if ( timi->mi.hIcon == (HICON)CALLSERVICE_NOTFOUND )
timi->mi.hIcon = NULL;
else
@@ -588,7 +588,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) DestroyIcon( timi->mi.hIcon );
timi->mi.hIcon = NULL;
}
- else IconLib_ReleaseIcon(timi->mi.hIcon,0);
+ else IconLib_ReleaseIcon(timi->mi.hIcon, 0);
} }
return TRUE;
@@ -608,8 +608,8 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) char *prot = smep->proto;
char szHumanName[64]={0};
PROTOACCOUNT * acc = Proto_GetAccount( smep->proto );
- int i=(DBGetContactSettingByte(NULL,prot,"LockMainStatus",0)?0:1);
- DBWriteContactSettingByte(NULL,prot,"LockMainStatus",(BYTE)i);
+ int i=(DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
+ DBWriteContactSettingByte(NULL, prot, "LockMainStatus", (BYTE)i);
CallProtoService( smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName );
pimi = MO_GetIntMenuItem(( HGENMENU )smep->protoindex );
@@ -620,7 +620,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) TCHAR buf[256];
pimi->mi.flags|=CMIF_CHECKED;
if ( cli.bDisplayLocked ) {
- mir_sntprintf(buf,SIZEOF(buf),TranslateT("%s (locked)"),acc->tszAccountName);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s (locked)"), acc->tszAccountName);
pimi->mi.ptszName = mir_tstrdup( buf );
root->mi.ptszName = mir_tstrdup( buf );
}
@@ -683,7 +683,7 @@ INT_PTR FreeOwnerDataStatusMenu(WPARAM, LPARAM lParam) // Other menu functions
//wparam MenuItemHandle
-static INT_PTR ModifyCustomMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR ModifyCustomMenuItem(WPARAM wParam, LPARAM lParam)
{
CLISTMENUITEM *mi=(CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
@@ -701,7 +701,7 @@ static INT_PTR ModifyCustomMenuItem(WPARAM wParam,LPARAM lParam) return MO_ModifyMenuItem(( PMO_IntMenuItem )wParam, &tmi );
}
-INT_PTR MenuProcessCommand(WPARAM wParam,LPARAM lParam)
+INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam)
{
WORD cmd = LOWORD(wParam);
@@ -774,7 +774,7 @@ static int MenuIconsChanged(WPARAM, LPARAM) {
//just rebuild menu
RebuildMenuOrder();
- cli.pfnCluiProtocolStatusChanged(0,0);
+ cli.pfnCluiProtocolStatusChanged(0, 0);
return 0;
}
@@ -802,7 +802,7 @@ int RecursiveDeleteMenu(HMENU hMenu) static INT_PTR MenuGetMain(WPARAM, LPARAM)
{
RecursiveDeleteMenu(hMainMenu);
- BuildMainMenu(0,0);
+ BuildMainMenu(0, 0);
return (INT_PTR)hMainMenu;
}
@@ -812,7 +812,7 @@ static INT_PTR BuildStatusMenu(WPARAM, LPARAM) param.MenuObjectHandle = hStatusMenuObject;
RecursiveDeleteMenu(hStatusMenu);
- CallService(MO_BUILDMENU,(WPARAM)hStatusMenu,(LPARAM)¶m);
+ CallService(MO_BUILDMENU, (WPARAM)hStatusMenu, (LPARAM)¶m);
return (INT_PTR)hStatusMenu;
}
@@ -867,7 +867,7 @@ int fnGetAccountIndexByPos(int Pos) void RebuildMenuOrder( void )
{
- int i,j,s;
+ int i, j, s;
DWORD flags;
BYTE bHideStatusMenu = DBGetContactSettingByte( NULL, "CLUI", "DontHideStatusMenu", 0 ); // cool perversion, though
@@ -877,7 +877,7 @@ void RebuildMenuOrder( void ) //status menu
if ( hStatusMenuObject != 0 ) {
- CallService(MO_REMOVEMENUOBJECT,(WPARAM)hStatusMenuObject,0);
+ CallService(MO_REMOVEMENUOBJECT, (WPARAM)hStatusMenuObject, 0);
mir_free( hStatusMainMenuHandles );
mir_free( hStatusMenuHandles );
}
@@ -888,7 +888,7 @@ void RebuildMenuOrder( void ) tmp.CheckService = "StatusMenuCheckService";
tmp.name = "StatusMenu";
- hStatusMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
+ hStatusMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
MO_SetOptionsMenuObject( hStatusMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, (INT_PTR)"CLISTMENUS/FreeOwnerDataStatusMenu" );
hStatusMainMenuHandles = ( PMO_IntMenuItem* )mir_calloc( SIZEOF(statusModeList) * sizeof( PMO_IntMenuItem* ));
@@ -935,7 +935,7 @@ void RebuildMenuOrder( void ) }
PMO_IntMenuItem rootmenu = MO_AddNewMenuItem( hStatusMenuObject, &tmi );
- memset(&tmi,0,sizeof(tmi));
+ memset(&tmi, 0, sizeof(tmi));
tmi.cbSize = sizeof(tmi);
tmi.flags = CMIF_TCHAR | CMIF_ROOTHANDLE | CMIF_KEEPUNTRANSLATED;
tmi.root = rootmenu;
@@ -963,7 +963,7 @@ void RebuildMenuOrder( void ) MO_ModifyMenuItem( menuHandle, &tmi );
cli.menuProtos=(MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount+1));
- memset(&(cli.menuProtos[cli.menuProtoCount]),0,sizeof(MenuProto));
+ memset(&(cli.menuProtos[cli.menuProtoCount]), 0, sizeof(MenuProto));
cli.menuProtos[cli.menuProtoCount].pMenu = rootmenu;
cli.menuProtos[cli.menuProtoCount].szProto = mir_strdup(pa->szModuleName);
@@ -1005,10 +1005,10 @@ void RebuildMenuOrder( void ) hStatusMenuHandles[i].menuhandle[j] = MO_AddNewMenuItem( hStatusMenuObject, &tmi );
{
char buf[ 256 ];
- mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s",pa->szModuleName,tmi.pszName);
+ mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem( hStatusMenuHandles[i].menuhandle[j], OPT_MENUITEMSETUNIQNAME, ( INT_PTR )buf );
}
- IconLib_ReleaseIcon(tmi.hIcon,0);
+ IconLib_ReleaseIcon(tmi.hIcon, 0);
} }
NotifyEventHooks(cli.hPreBuildStatusMenuEvent, 0, 0);
@@ -1033,7 +1033,7 @@ void RebuildMenuOrder( void ) tmi.hIcon = LoadSkinIcon( skinIconStatusList[j] );
tmi.position = pos++;
- tmi.hotKey = MAKELPARAM(MOD_CONTROL,'0'+j);
+ tmi.hotKey = MAKELPARAM(MOD_CONTROL, '0'+j);
{
//owner data
lpStatusMenuExecParam smep = ( lpStatusMenuExecParam )mir_alloc( sizeof( StatusMenuExecParam ));
@@ -1047,7 +1047,7 @@ void RebuildMenuOrder( void ) TCHAR buf[ 256 ], hotkeyName[ 100 ];
WORD hotKey = GetHotkeyValue( statusHotkeys[j] );
HotkeyToName( hotkeyName, SIZEOF(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
- mir_sntprintf( buf, SIZEOF( buf ), TranslateT("%s\t%s"),
+ mir_sntprintf( buf, SIZEOF( buf ), TranslateT("%s\t%s"),
cli.pfnGetStatusModeDescription( statusModeList[j], 0 ), hotkeyName );
tmi.ptszName = buf;
tmi.hotKey = MAKELONG(HIBYTE(hotKey), LOBYTE(hotKey));
@@ -1062,7 +1062,7 @@ void RebuildMenuOrder( void ) break;
} }
- BuildStatusMenu(0,0);
+ BuildStatusMenu(0, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1077,7 +1077,7 @@ static int sttRebuildHotkeys( WPARAM, LPARAM ) TCHAR buf[ 256 ], hotkeyName[ 100 ];
WORD hotKey = GetHotkeyValue( statusHotkeys[j] );
HotkeyToName( hotkeyName, SIZEOF(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
- mir_sntprintf( buf, SIZEOF( buf ), TranslateT("%s\t%s"),
+ mir_sntprintf( buf, SIZEOF( buf ), TranslateT("%s\t%s"),
cli.pfnGetStatusModeDescription( statusModeList[j], 0 ), hotkeyName );
tmi.ptszName = buf;
tmi.hotKey = MAKELONG(HIBYTE(hotKey), LOBYTE(hotKey));
@@ -1114,7 +1114,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) overallStatus = GetAverageMode();
- memset(&tmi,0,sizeof(tmi));
+ memset(&tmi, 0, sizeof(tmi));
tmi.cbSize=sizeof(tmi);
if (overallStatus >= ID_STATUS_OFFLINE) {
int pos = statustopos(cli.currentStatusMenuItem);
@@ -1144,7 +1144,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) tmi.flags = CMIM_FLAGS | CMIF_ROOTHANDLE;
MO_ModifyMenuItem( hStatusMainMenuHandles[pos], &tmi );
}
- //SetMenuDefaultItem(hStatusMenu,-1,FALSE);
+ //SetMenuDefaultItem(hStatusMenu, -1, FALSE);
cli.currentStatusMenuItem=0;
}
@@ -1169,7 +1169,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) break;
} }
- //BuildStatusMenu(0,0);
+ //BuildStatusMenu(0, 0);
return 0;
}
@@ -1195,7 +1195,7 @@ HGENMENU fnGetProtocolMenu( const char* proto ) return NULL;
}
-static INT_PTR AddStatusMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
{
CLISTMENUITEM *mi = ( CLISTMENUITEM* )lParam;
if ( mi->cbSize != sizeof( CLISTMENUITEM ))
@@ -1284,7 +1284,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam,LPARAM lParam) return ( INT_PTR )menuHandle;
}
-static INT_PTR HotkeySetStatus(WPARAM wParam,LPARAM lParam)
+static INT_PTR HotkeySetStatus(WPARAM wParam, LPARAM lParam)
{
return SetStatusMode( lParam, 0 );
}
@@ -1292,7 +1292,7 @@ static INT_PTR HotkeySetStatus(WPARAM wParam,LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
// PROTOCOL MENU
-static INT_PTR AddProtoMenuItem(WPARAM wParam,LPARAM lParam)
+static INT_PTR AddProtoMenuItem(WPARAM wParam, LPARAM lParam)
{
if ( DBGetContactSettingByte( NULL, "CList", "MoveProtoMenus", TRUE ))
return AddStatusMenuItem( wParam, lParam );
@@ -1304,47 +1304,47 @@ static INT_PTR AddProtoMenuItem(WPARAM wParam,LPARAM lParam) void InitCustomMenus(void)
{
- CreateServiceFunction("MainMenuExecService",MainMenuExecService);
+ CreateServiceFunction("MainMenuExecService", MainMenuExecService);
- CreateServiceFunction("ContactMenuExecService",ContactMenuExecService);
- CreateServiceFunction("ContactMenuCheckService",ContactMenuCheckService);
+ CreateServiceFunction("ContactMenuExecService", ContactMenuExecService);
+ CreateServiceFunction("ContactMenuCheckService", ContactMenuCheckService);
- CreateServiceFunction("StatusMenuExecService",StatusMenuExecService);
- CreateServiceFunction("StatusMenuCheckService",StatusMenuCheckService);
+ CreateServiceFunction("StatusMenuExecService", StatusMenuExecService);
+ CreateServiceFunction("StatusMenuCheckService", StatusMenuCheckService);
//free services
- CreateServiceFunction("CLISTMENUS/FreeOwnerDataMainMenu",FreeOwnerDataMainMenu);
- CreateServiceFunction("CLISTMENUS/FreeOwnerDataContactMenu",FreeOwnerDataContactMenu);
- CreateServiceFunction("CLISTMENUS/FreeOwnerDataStatusMenu",FreeOwnerDataStatusMenu);
+ CreateServiceFunction("CLISTMENUS/FreeOwnerDataMainMenu", FreeOwnerDataMainMenu);
+ CreateServiceFunction("CLISTMENUS/FreeOwnerDataContactMenu", FreeOwnerDataContactMenu);
+ CreateServiceFunction("CLISTMENUS/FreeOwnerDataStatusMenu", FreeOwnerDataStatusMenu);
CreateServiceFunction(MS_CLIST_SETSTATUSMODE, SetStatusMode);
- CreateServiceFunction(MS_CLIST_ADDMAINMENUITEM,AddMainMenuItem);
- CreateServiceFunction(MS_CLIST_ADDSTATUSMENUITEM,AddStatusMenuItem);
- CreateServiceFunction(MS_CLIST_MENUGETMAIN,MenuGetMain);
- CreateServiceFunction(MS_CLIST_REMOVEMAINMENUITEM,RemoveMainMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDMAIN,BuildMainMenu);
+ CreateServiceFunction("CList/AddMainMenuItem", AddMainMenuItem);
+ CreateServiceFunction("CList/AddStatusMenuItem", AddStatusMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUGETMAIN, MenuGetMain);
+ CreateServiceFunction(MS_CLIST_REMOVEMAINMENUITEM, RemoveMainMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDMAIN, BuildMainMenu);
- CreateServiceFunction(MS_CLIST_ADDCONTACTMENUITEM,AddContactMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDCONTACT,BuildContactMenu);
- CreateServiceFunction(MS_CLIST_REMOVECONTACTMENUITEM,RemoveContactMenuItem);
+ CreateServiceFunction("CList/AddContactMenuItem", AddContactMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDCONTACT, BuildContactMenu);
+ CreateServiceFunction(MS_CLIST_REMOVECONTACTMENUITEM, RemoveContactMenuItem);
- CreateServiceFunction(MS_CLIST_MODIFYMENUITEM,ModifyCustomMenuItem);
- CreateServiceFunction(MS_CLIST_MENUMEASUREITEM,MeasureMenuItem);
- CreateServiceFunction(MS_CLIST_MENUDRAWITEM,DrawMenuItem);
+ CreateServiceFunction(MS_CLIST_MODIFYMENUITEM, ModifyCustomMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUMEASUREITEM, MeasureMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUDRAWITEM, DrawMenuItem);
- CreateServiceFunction(MS_CLIST_MENUGETSTATUS,BuildStatusMenu);
- CreateServiceFunction(MS_CLIST_MENUPROCESSCOMMAND,MenuProcessCommand);
- CreateServiceFunction(MS_CLIST_MENUPROCESSHOTKEY,MenuProcessHotkey);
+ CreateServiceFunction(MS_CLIST_MENUGETSTATUS, BuildStatusMenu);
+ CreateServiceFunction(MS_CLIST_MENUPROCESSCOMMAND, MenuProcessCommand);
+ CreateServiceFunction(MS_CLIST_MENUPROCESSHOTKEY, MenuProcessHotkey);
- CreateServiceFunction(MS_CLIST_ADDPROTOMENUITEM,AddProtoMenuItem);
+ CreateServiceFunction("CList/AddProtoMenuItem", AddProtoMenuItem);
hPreBuildContactMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
hPreBuildMainMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU);
cli.hPreBuildStatusMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU);
hStatusModeChangeEvent = CreateHookableEvent( ME_CLIST_STATUSMODECHANGE );
- hAckHook=(HANDLE)HookEvent(ME_PROTO_ACK,MenuProtoAck);
+ hAckHook=(HANDLE)HookEvent(ME_PROTO_ACK, MenuProtoAck);
hMainMenu = CreatePopupMenu();
hStatusMenu = CreatePopupMenu();
@@ -1365,7 +1365,7 @@ void InitCustomMenus(void) tmp.CheckService=NULL;
tmp.ExecService="MainMenuExecService";
tmp.name="MainMenu";
- hMainMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
+ hMainMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
}
MO_SetOptionsMenuObject( hMainMenuObject, OPT_USERDEFINEDITEMS, TRUE );
@@ -1378,7 +1378,7 @@ void InitCustomMenus(void) tmp.CheckService="ContactMenuCheckService";
tmp.ExecService="ContactMenuExecService";
tmp.name="ContactMenu";
- hContactMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
+ hContactMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT, (WPARAM)0, (LPARAM)&tmp);
}
MO_SetOptionsMenuObject( hContactMenuObject, OPT_USERDEFINEDITEMS, TRUE );
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index ab8ca13965..ff667bcb38 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -194,7 +194,7 @@ static INT_PTR GetContactIcon(WPARAM wParam, LPARAM) char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
HANDLE hContact = (HANDLE)wParam;
- return cli.pfnIconFromStatusMode(szProto,
+ return cli.pfnIconFromStatusMode(szProto,
szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact);
}
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 0efc919ba8..f8a0501358 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.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.
@@ -317,9 +317,9 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) szProto = NULL;
else
szProto = cws->value.pszVal;
- cli.pfnChangeContactIcon(hContact,
- cli.pfnIconFromStatusMode(szProto,
- szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord(hContact, szProto, "Status",
+ cli.pfnChangeContactIcon(hContact,
+ cli.pfnIconFromStatusMode(szProto,
+ szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord(hContact, szProto, "Status",
ID_STATUS_OFFLINE), hContact), 0);
} }
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 00d4074b33..519cf0f875 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -161,7 +161,7 @@ TCHAR* fnTrayIconMakeTooltip( const TCHAR *szPrefix, const char *szProto ) if ( DBGetContactSettingByte( NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT )) {
if ( mToolTipTrayTips ) {
if ( ProtoXStatus )
- mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s<b>%-12.12s</b>\t%s%s%-24.24s"), szPrefix, szSeparator, pa->tszAccountName, szStatus,szSeparator,ProtoXStatus);
+ mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s<b>%-12.12s</b>\t%s%s%-24.24s"), szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus);
else
mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s<b>%-12.12s</b>\t%s"), szPrefix, szSeparator, pa->tszAccountName, szStatus);
}
@@ -172,7 +172,7 @@ TCHAR* fnTrayIconMakeTooltip( const TCHAR *szPrefix, const char *szProto ) else {
if ( mToolTipTrayTips ) {
if ( ProtoXStatus )
- mir_sntprintf( cli.szTip, MAX_TIP_SIZE, _T("<b>%-12.12s</b>\t%s\n%-24.24s"), pa->tszAccountName, szStatus,ProtoXStatus);
+ mir_sntprintf( cli.szTip, MAX_TIP_SIZE, _T("<b>%-12.12s</b>\t%s\n%-24.24s"), pa->tszAccountName, szStatus, ProtoXStatus);
else
mir_sntprintf( cli.szTip, MAX_TIP_SIZE, _T("<b>%-12.12s</b>\t%s"), pa->tszAccountName, szStatus);
}
@@ -357,7 +357,7 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD) {
int i;
if ( RefreshTimerId ) {
- KillTimer(NULL,RefreshTimerId);
+ KillTimer(NULL, RefreshTimerId);
RefreshTimerId=0;
}
for (i=0; i < accounts.getCount(); i++) {
@@ -422,13 +422,13 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer SetTaskBarIcon(NULL, NULL);
cli.trayIcon[i].isBase = isBase;
- if (DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
+ if (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
{
- DWORD time1=DBGetContactSettingWord(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT)*200;
- DWORD time2=DBGetContactSettingWord(NULL,"CList","IconFlashTime",550)+1000;
- DWORD time=max(max(2000,time1),time2);
- if (RefreshTimerId) {KillTimer(NULL,RefreshTimerId); RefreshTimerId=0;}
- RefreshTimerId=SetTimer(NULL,0,time,RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
+ DWORD time1=DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
+ DWORD time2=DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
+ DWORD time=max(max(2000, time1), time2);
+ if (RefreshTimerId) {KillTimer(NULL, RefreshTimerId); RefreshTimerId=0;}
+ RefreshTimerId=SetTimer(NULL, 0, time, RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
}
{ ulock; return i; }
}
@@ -455,8 +455,8 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto) }
if ((cli.pfnGetProtocolVisibility(szPreferredProto))
&& (GetAverageMode() == -1)
- && (DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
- && !(DBGetContactSettingByte(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT)))
+ && (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
+ && !(DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
goto LBL_Error;
}
@@ -555,7 +555,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) szProto = NULL;
else
szProto = dbv.pszVal;
- changed = cli.pfnTrayIconSetBaseInfo( cli.pfnGetIconFromStatusMode( NULL, szProto, szProto ? CallProtoService(szProto, PS_GETSTATUS, 0,0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto );
+ changed = cli.pfnTrayIconSetBaseInfo( cli.pfnGetIconFromStatusMode( NULL, szProto, szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto );
DBFreeVariant(&dbv);
break;
}
@@ -564,7 +564,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
changed =
cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon
- (hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), NULL),
+ (hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), NULL),
ILD_NORMAL), NULL);
break;
case SETTING_TRAYICON_MULTI:
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index a9619b6302..d5bceade30 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
- Copyright 2000-2010 Miranda ICQ/IM project,
+ Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ 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.
@@ -52,7 +52,7 @@ void fnLoadCluiGlobalOpts() {
cluiopt.showsbar = DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1);
cluiopt.showgrip = DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1);
- cluiopt.transparent = DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT);
+ cluiopt.transparent = DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
cluiopt.alpha = DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
}
@@ -205,8 +205,8 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
// Set a flag so we remember to delete the contact when the protocol goes online the next time
DBWriteContactSettingByte((HANDLE) wParam, "CList", "Delete", 1);
- MessageBox( NULL,
- TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."),
+ MessageBox( NULL,
+ TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."),
TranslateT("Delete Contact"), MB_OK);
return 0;
} } }
@@ -322,13 +322,13 @@ int LoadCLUIModule(void) Utils_AssertInsideScreen(&pos);
cli.hwndContactList = CreateWindowEx(
- (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
- _T(MIRANDACLASS),
- titleText,
+ (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
+ _T(MIRANDACLASS),
+ titleText,
WS_POPUPWINDOW | WS_THICKFRAME | WS_CLIPCHILDREN |
(DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU |
- (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
- pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top,
+ (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
+ pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top,
NULL, NULL, cli.hInst, NULL);
if (DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0)) {
@@ -365,7 +365,7 @@ int LoadCLUIModule(void) mi.pszContactOwner = NULL; //on every contact
mi.pszName = LPGEN("De&lete");
mi.pszService = "CList/DeleteContactCommand";
- CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ Menu_AddContactMenuItem(&mi);
CreateServiceFunction("CList/RenameContactCommand", MenuItem_RenameContact);
mi.position = 2000050000;
@@ -373,7 +373,7 @@ int LoadCLUIModule(void) mi.pszContactOwner = NULL; //on every contact
mi.pszName = LPGEN("&Rename");
mi.pszService = "CList/RenameContactCommand";
- hRenameMenuItem = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ hRenameMenuItem = Menu_AddContactMenuItem(&mi);
CreateServiceFunction("CList/AddToListContactCommand", MenuItem_AddContactToList);
mi.position = -2050000000;
@@ -381,7 +381,7 @@ int LoadCLUIModule(void) mi.icolibItem = GetSkinIconHandle( SKINICON_OTHER_ADDCONTACT );
mi.pszName = LPGEN("&Add permanently to list");
mi.pszService = "CList/AddToListContactCommand";
- CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
+ Menu_AddContactMenuItem(&mi);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MenuItem_PreBuild);
}
@@ -527,7 +527,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE;
case M_CREATECLC:
- cli.hwndContactTree = CreateWindow( CLISTCONTROL_CLASS, _T(""),
+ cli.hwndContactTree = CreateWindow( CLISTCONTROL_CLASS, _T(""),
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
| CLS_CONTACTLIST
| (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
@@ -637,9 +637,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_SETCURSOR:
if (cluiopt.transparent) {
if (!transparentFocus && GetForegroundWindow() != hwnd && setLayeredWindowAttributes) {
- setLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)cluiopt.alpha, LWA_ALPHA);
+ setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)cluiopt.alpha, LWA_ALPHA);
transparentFocus=1;
- SetTimer(hwnd, TM_AUTOALPHA,250,NULL);
+ SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
}
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -711,7 +711,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM thisTick = GetTickCount();
if (thisTick >= startTick + 200)
break;
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0),
+ setLayeredWindowAttributes(hwnd, RGB(0, 0, 0),
(BYTE) (sourceAlpha + (destAlpha - sourceAlpha) * (int) (thisTick - startTick) / 200), LWA_ALPHA);
}
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) destAlpha, LWA_ALPHA);
@@ -906,7 +906,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (rcWindow.bottom > rcWorkArea.bottom)
rcWindow.bottom = rcWorkArea.bottom;
}
- SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top,
+ SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top,
SWP_NOZORDER | SWP_NOACTIVATE);
break;
}
@@ -1004,10 +1004,10 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HMENU hMenu;
hMenu = GetSubMenu(LoadMenu(cli.hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 1);
CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hMenu, 0);
- CheckMenuItem(hMenu, POPUP_HIDEOFFLINE,
+ CheckMenuItem(hMenu, POPUP_HIDEOFFLINE,
DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, POPUP_HIDEOFFLINEROOT, SendMessage(cli.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(hMenu, POPUP_HIDEEMPTYGROUPS,
+ CheckMenuItem(hMenu, POPUP_HIDEEMPTYGROUPS,
GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, POPUP_DISABLEGROUPS, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? MF_UNCHECKED : MF_CHECKED);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
@@ -1047,15 +1047,15 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM x = dis->rcItem.left;
if (showOpts & 1) {
HICON hIcon = LoadSkinProtoIcon(szProto, status);
- DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
+ DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon,0);
+ IconLib_ReleaseIcon(hIcon, 0);
if ( Proto_IsAccountLocked( Proto_GetAccount( szProto ))) {
hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hIcon != NULL) {
- DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
+ DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
- IconLib_ReleaseIcon(hIcon,0);
+ IconLib_ReleaseIcon(hIcon, 0);
}
}
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index 2d8f06ab2f..d96f688997 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -135,7 +135,7 @@ static INT_PTR GetCaps(WPARAM wParam, LPARAM) void LoadCluiServices(void)
{
CreateServiceFunction(MS_CLUI_GETHWND, GetHwnd);
- CreateServiceFunction(MS_CLUI_GETHWNDTREE,GetHwndTree);
+ CreateServiceFunction(MS_CLUI_GETHWNDTREE, GetHwndTree);
CreateServiceFunction(MS_CLUI_PROTOCOLSTATUSCHANGED, CluiProtocolStatusChanged);
CreateServiceFunction(MS_CLUI_GROUPADDED, GroupAdded);
CreateServiceFunction(MS_CLUI_CONTACTSETICON, ContactSetIcon);
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index d122ef4836..c0b1c9e8d1 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.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.
@@ -30,18 +30,18 @@ int sortByStatus; int sortByProto;
static const struct {
- int status,order;
+ int status, order;
} statusModeOrder[]={
- {ID_STATUS_OFFLINE,500},
- {ID_STATUS_ONLINE,10},
- {ID_STATUS_AWAY,200},
- {ID_STATUS_DND,110},
- {ID_STATUS_NA,450},
- {ID_STATUS_OCCUPIED,100},
- {ID_STATUS_FREECHAT,0},
- {ID_STATUS_INVISIBLE,20},
- {ID_STATUS_ONTHEPHONE,150},
- {ID_STATUS_OUTTOLUNCH,425}};
+ {ID_STATUS_OFFLINE, 500},
+ {ID_STATUS_ONLINE, 10},
+ {ID_STATUS_AWAY, 200},
+ {ID_STATUS_DND, 110},
+ {ID_STATUS_NA, 450},
+ {ID_STATUS_OCCUPIED, 100},
+ {ID_STATUS_FREECHAT, 0},
+ {ID_STATUS_INVISIBLE, 20},
+ {ID_STATUS_ONTHEPHONE, 150},
+ {ID_STATUS_OUTTOLUNCH, 425}};
static int GetContactStatus(HANDLE hContact)
{
@@ -167,7 +167,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) grpChg.pszNewName = cli.pfnGetGroupName(lParam, NULL);
DBWriteContactSettingTString((HANDLE) wParam, "CList", "Group", grpChg.pszNewName);
}
- CallService(MS_CLUI_CONTACTADDED, wParam,
+ CallService(MS_CLUI_CONTACTADDED, wParam,
cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0), GetContactStatus((HANDLE) wParam), (HANDLE) wParam));
NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg);
@@ -184,7 +184,7 @@ int fnSetHideOffline(WPARAM wParam, LPARAM) DBWriteContactSettingByte(NULL, "CList", "HideOffline", 1);
break;
case -1:
- DBWriteContactSettingByte(NULL, "CList", "HideOffline",
+ DBWriteContactSettingByte(NULL, "CList", "HideOffline",
(BYTE) ! DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
break;
}
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 73b3e972d5..13e9d61e46 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -115,7 +115,7 @@ int MO_MeasureMenuItem( LPMEASUREITEMSTRUCT mis ) if ( pimi->iconId == -1 )
return FALSE;
- mis->itemWidth = max(0,GetSystemMetrics(SM_CXSMICON)-GetSystemMetrics(SM_CXMENUCHECK)+4);
+ mis->itemWidth = max(0, GetSystemMetrics(SM_CXSMICON)-GetSystemMetrics(SM_CXMENUCHECK)+4);
mis->itemHeight = GetSystemMetrics(SM_CYSMICON)+2;
return TRUE;
}
@@ -154,16 +154,16 @@ int MO_DrawMenuItem( LPDRAWITEMSTRUCT dis ) RECT rc;
rc.left = 0; rc.right = GetSystemMetrics(SM_CXSMICON)+4;
rc.top = y-2; rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON)+4;
- DrawEdge(dis->hDC,&rc,BDR_SUNKENOUTER,BF_RECT);
- InflateRect(&rc,-1,-1);
+ DrawEdge(dis->hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
+ InflateRect(&rc, -1, -1);
COLORREF menuCol = GetSysColor(COLOR_MENU);
COLORREF hiliteCol = GetSysColor(COLOR_3DHIGHLIGHT);
- HBRUSH hBrush = CreateSolidBrush(RGB((GetRValue(menuCol)+GetRValue(hiliteCol))/2,(GetGValue(menuCol)+GetGValue(hiliteCol))/2,(GetBValue(menuCol)+GetBValue(hiliteCol))/2));
- FillRect(dis->hDC,&rc,GetSysColorBrush(COLOR_MENU));
+ HBRUSH hBrush = CreateSolidBrush(RGB((GetRValue(menuCol)+GetRValue(hiliteCol))/2, (GetGValue(menuCol)+GetGValue(hiliteCol))/2, (GetBValue(menuCol)+GetBValue(hiliteCol))/2));
+ FillRect(dis->hDC, &rc, GetSysColorBrush(COLOR_MENU));
DeleteObject(hBrush);
- ImageList_DrawEx(pimi->parent->m_hMenuIcons,pimi->iconId,dis->hDC,2,y,0,0,CLR_NONE,GetSysColor(COLOR_MENU),ILD_BLEND50);
+ ImageList_DrawEx(pimi->parent->m_hMenuIcons, pimi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, GetSysColor(COLOR_MENU), ILD_BLEND50);
}
- else ImageList_DrawEx(pimi->parent->m_hMenuIcons,pimi->iconId,dis->hDC,2,y,0,0,CLR_NONE,CLR_NONE,ILD_NORMAL);
+ else ImageList_DrawEx(pimi->parent->m_hMenuIcons, pimi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
}
LeaveCriticalSection( &csMenuHook );
return TRUE;
@@ -230,7 +230,7 @@ INT_PTR MO_ProcessHotKeys( HANDLE menuHandle, INT_PTR vKey ) return FALSE;
}
-INT_PTR MO_GetProtoRootMenu(WPARAM wParam,LPARAM lParam)
+INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam)
{
char* szProto = ( char* )wParam;
if ( szProto == NULL )
@@ -257,7 +257,7 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam,LPARAM lParam) //wparam=MenuItemHandle
//lparam=PMO_MenuItem
-INT_PTR MO_GetMenuItem(WPARAM wParam,LPARAM lParam)
+INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam)
{
PMO_MenuItem mi = (PMO_MenuItem)lParam;
if ( !bIsGenMenuInited || mi == NULL )
@@ -316,7 +316,7 @@ int MO_ModifyMenuItem( PMO_IntMenuItem menuHandle, PMO_MenuItem pmi ) if ( pmi->flags & CMIM_NAME ) {
FreeAndNil(( void** )&pimi->mi.pszName );
-#if defined( _UNICODE )
+
if ( pmi->flags & CMIF_UNICODE )
pimi->mi.ptszName = mir_tstrdup(( pmi->flags & CMIF_KEEPUNTRANSLATED ) ? pmi->ptszName : TranslateTS( pmi->ptszName ));
else {
@@ -328,9 +328,6 @@ int MO_ModifyMenuItem( PMO_IntMenuItem menuHandle, PMO_MenuItem pmi ) }
else pimi->mi.ptszName = LangPackPcharToTchar( pmi->pszName );
}
-#else
- pimi->mi.ptszName = mir_strdup(( pmi->flags & CMIF_KEEPUNTRANSLATED ) ? pmi->ptszName : Translate( pmi->ptszName ));
-#endif
}
if ( pmi->flags & CMIM_FLAGS ) {
oldflags = pimi->mi.flags & ( CMIF_ROOTHANDLE | CMIF_ICONFROMICOLIB );
@@ -364,7 +361,7 @@ int MO_ModifyMenuItem( PMO_IntMenuItem menuHandle, PMO_MenuItem pmi ) }
//wparam MenuItemHandle
-//return ownerdata useful to free ownerdata before delete menu item,
+//return ownerdata useful to free ownerdata before delete menu item,
//NULL on error.
INT_PTR MO_MenuItemGetOwnerData(WPARAM wParam, LPARAM)
{
@@ -432,7 +429,7 @@ int MO_ProcessCommandBySubMenuIdent(int menuID, int command, LPARAM lParam) return -1;
}
-INT_PTR MO_ProcessCommandByMenuIdent(WPARAM wParam,LPARAM lParam)
+INT_PTR MO_ProcessCommandByMenuIdent(WPARAM wParam, LPARAM lParam)
{
if ( !bIsGenMenuInited )
return -1;
@@ -656,18 +653,15 @@ PMO_IntMenuItem MO_AddNewMenuItem( HANDLE menuobjecthandle, PMO_MenuItem pmi ) p->iconId = -1;
p->OverrideShow = TRUE;
p->originalPosition = pmi->position;
- #if defined( _UNICODE )
- if ( pmi->flags & CMIF_UNICODE )
- p->mi.ptszName = mir_tstrdup(( pmi->flags & CMIF_KEEPUNTRANSLATED ) ? pmi->ptszName : TranslateTS( pmi->ptszName ));
- else {
- if ( pmi->flags & CMIF_KEEPUNTRANSLATED )
- p->mi.ptszName = mir_a2u(pmi->pszName);
- else
- p->mi.ptszName = LangPackPcharToTchar( pmi->pszName );
- }
- #else
- p->mi.ptszName = mir_strdup(( pmi->flags & CMIF_KEEPUNTRANSLATED ) ? pmi->ptszName : Translate( pmi->ptszName ));
- #endif
+
+ if ( pmi->flags & CMIF_UNICODE )
+ p->mi.ptszName = mir_tstrdup(( pmi->flags & CMIF_KEEPUNTRANSLATED ) ? pmi->ptszName : TranslateTS( pmi->ptszName ));
+ else {
+ if ( pmi->flags & CMIF_KEEPUNTRANSLATED )
+ p->mi.ptszName = mir_a2u(pmi->pszName);
+ else
+ p->mi.ptszName = LangPackPcharToTchar( pmi->pszName );
+ }
if ( pmi->hIcon != NULL && !bIconsDisabled ) {
if ( pmi->flags & CMIF_ICONFROMICOLIB ) {
@@ -733,10 +727,10 @@ PMO_IntMenuItem MO_AddOldNewMenuItem( HANDLE menuobjecthandle, PMO_MenuItem pmi //is item with popup or not
if ( pmi->root == 0 ) {
- //yes,this without popup
+ //yes, this without popup
pmi->root = NULL; //first level
}
- else { // no,search for needed root and create it if need
+ else { // no, search for needed root and create it if need
TCHAR* tszRoot;
#if defined( _UNICODE )
if ( pmi->flags & CMIF_UNICODE )
@@ -751,7 +745,7 @@ PMO_IntMenuItem MO_AddOldNewMenuItem( HANDLE menuobjecthandle, PMO_MenuItem pmi mir_free( tszRoot );
if ( oldroot == NULL ) {
- //not found,creating root
+ //not found, creating root
TMO_MenuItem tmi = { 0 };
tmi = *pmi;
tmi.flags |= CMIF_ROOTHANDLE;
@@ -871,7 +865,7 @@ static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, MENUITEMINFO *l //wparam started hMenu
//lparam ListParam*
//result hMenu
-INT_PTR MO_BuildMenu(WPARAM wParam,LPARAM lParam)
+INT_PTR MO_BuildMenu(WPARAM wParam, LPARAM lParam)
{
if ( !bIsGenMenuInited )
return -1;
@@ -1029,7 +1023,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para #ifdef PUTPOSITIONSONMENU
if ( GetKeyState(VK_CONTROL) & 0x8000) {
TCHAR str[256];
- mir_sntprintf( str, SIZEOF(str), _T( "%s (%d,id %x)" ), mi->pszName, mi->position, mii.dwItemData );
+ mir_sntprintf( str, SIZEOF(str), _T( "%s (%d, id %x)" ), mi->pszName, mi->position, mii.dwItemData );
mii.dwTypeData = str;
}
#endif
@@ -1044,7 +1038,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para #ifdef PUTPOSITIONSONMENU
if ( GetKeyState(VK_CONTROL) & 0x8000) {
TCHAR str[256];
- mir_sntprintf( str, SIZEOF(str), _T("%s (%d,id %x)"), mi->pszName, mi->position, mii.dwItemData );
+ mir_sntprintf( str, SIZEOF(str), _T("%s (%d, id %x)"), mi->pszName, mi->position, mii.dwItemData );
mii.dwTypeData = str;
}
#endif
@@ -1069,7 +1063,7 @@ static int MO_ReloadIcon( PMO_IntMenuItem pmi, void* ) if ( newIcon )
ImageList_ReplaceIcon( pmi->parent->m_hMenuIcons, pmi->iconId, newIcon );
- IconLib_ReleaseIcon(newIcon,0);
+ IconLib_ReleaseIcon(newIcon, 0);
}
return FALSE;
@@ -1120,7 +1114,7 @@ static int MO_RegisterIcon( PMO_IntMenuItem pmi, void* ) if (( start = strchr( start, '&' )) == NULL )
break;
- memmove(start,start+1,strlen(start+1)+1);
+ memmove(start, start+1, strlen(start+1)+1);
if (*start != '\0') start++;
else break;
}
@@ -1170,7 +1164,7 @@ int TryProcessDoubleClick( HANDLE hContact ) {
int iMenuID = GetMenuObjbyId( (int)hContactMenuObject );
if ( iMenuID != -1 ) {
- NotifyEventHooks(hPreBuildContactMenuEvent,(WPARAM)hContact,0);
+ NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0);
PMO_IntMenuItem pimi = ( PMO_IntMenuItem )MO_GetDefaultMenuItem(( WPARAM )g_menus[ iMenuID ]->m_items.first, 0 );
if ( pimi != NULL ) {
@@ -1195,7 +1189,7 @@ static VOID CALLBACK PostRegisterIcons( HWND, UINT, UINT_PTR, DWORD ) static int OnModulesLoaded(WPARAM, LPARAM)
{
posttimerid = SetTimer(( HWND )NULL, 0, 5, ( TIMERPROC )PostRegisterIcons );
- HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibChanges);
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibChanges);
return 0;
}
diff --git a/src/modules/clist/genmenu.h b/src/modules/clist/genmenu.h index 63c665b940..14d820575e 100644 --- a/src/modules/clist/genmenu.h +++ b/src/modules/clist/genmenu.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -54,7 +54,7 @@ typedef struct _tagIntMenuItem TMO_LinkedList *owner;
TMO_LinkedList submenu;
}
- TMO_IntMenuItem,*PMO_IntMenuItem;
+ TMO_IntMenuItem, *PMO_IntMenuItem;
struct TIntMenuObject
{
@@ -118,7 +118,7 @@ INT_PTR MO_ProcessHotKeys( HANDLE menuHandle, INT_PTR vKey ); int MO_SetOptionsMenuItem( PMO_IntMenuItem menuobjecthandle, int setting, INT_PTR value );
int MO_SetOptionsMenuObject( HANDLE menuobjecthandle, int setting, INT_PTR value );
-INT_PTR MO_ProcessCommandByMenuIdent(WPARAM wParam,LPARAM lParam);
+INT_PTR MO_ProcessCommandByMenuIdent(WPARAM wParam, LPARAM lParam);
int MO_ProcessCommandBySubMenuIdent(int menuID, int command, LPARAM lParam);
// function returns TRUE if the walk should be immediately stopped
@@ -138,9 +138,9 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, int globalID, struct _MenuItemHandles int GenMenuOptInit(WPARAM wParam, LPARAM lParam);
int GetMenuObjbyId(const int id);
-int GetMenuItembyId(const int objpos,const int id);
-INT_PTR MO_GetMenuItem(WPARAM wParam,LPARAM lParam);
+int GetMenuItembyId(const int objpos, const int id);
+INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam);
void FreeAndNil(void **p);
-static int RemoveFromList(int pos,void **lpList,int *ListElemCount,int ElemSize);
-static int RemoveFromList(int pos,void **lpList,int *ListElemCount,int ElemSize);
+static int RemoveFromList(int pos, void **lpList, int *ListElemCount, int ElemSize);
+static int RemoveFromList(int pos, void **lpList, int *ListElemCount, int ElemSize);
#endif
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 84fbaa9e6a..421616b5e5 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -50,7 +50,7 @@ typedef struct tagMenuItemOptData PMO_IntMenuItem pimi;
}
- MenuItemOptData,*lpMenuItemOptData;
+ MenuItemOptData, *lpMenuItemOptData;
static BOOL GetCurrentMenuObjectID(HWND hwndDlg, int* result)
{
@@ -130,7 +130,7 @@ static int SaveTree(HWND hwndDlg) static int BuildMenuObjectsTree(HWND hwndDlg)
{
TVINSERTSTRUCT tvis;
- HWND hTree = GetDlgItem(hwndDlg,IDC_MENUOBJECTS);
+ HWND hTree = GetDlgItem(hwndDlg, IDC_MENUOBJECTS);
int i;
tvis.hParent = NULL;
@@ -153,9 +153,9 @@ static int BuildMenuObjectsTree(HWND hwndDlg) return 1;
}
-static int sortfunc(const void *a,const void *b)
+static int sortfunc(const void *a, const void *b)
{
- lpMenuItemOptData *sd1,*sd2;
+ lpMenuItemOptData *sd1, *sd2;
sd1=(lpMenuItemOptData *)a;
sd2=(lpMenuItemOptData *)b;
if ((*sd1)->pos > (*sd2)->pos)
@@ -203,7 +203,7 @@ static int InsertSeparator(HWND hwndDlg) static void FreeTreeData( HWND hwndDlg )
{
- HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_MENUITEMS));
+ HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_MENUITEMS));
while ( hItem != NULL ) {
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
@@ -217,18 +217,18 @@ static void FreeTreeData( HWND hwndDlg ) }
tvi.lParam = 0;
- TreeView_SetItem(GetDlgItem(hwndDlg,IDC_MENUITEMS), &tvi);
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
- hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg,IDC_MENUITEMS), hItem);
+ hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_MENUITEMS), hItem);
} }
-static int BuildTree(HWND hwndDlg,int MenuObjectId, BOOL bReread)
+static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread)
{
- char menuItemName[256],MenuNameItems[256];
+ char menuItemName[256], MenuNameItems[256];
char buf[256];
FreeTreeData( hwndDlg );
- TreeView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_MENUITEMS));
+ TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_MENUITEMS));
int menupos = GetMenuObjbyId( MenuObjectId );
if ( menupos == -1 )
@@ -319,7 +319,7 @@ static int BuildTree(HWND hwndDlg,int MenuObjectId, BOOL bReread) HTREEITEM hti = (HTREEITEM)SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, TVM_INSERTITEM, 0, (LPARAM)&tvis);
if ( first ) {
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_MENUITEMS),hti);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), hti);
first=FALSE;
}
@@ -328,7 +328,7 @@ static int BuildTree(HWND hwndDlg,int MenuObjectId, BOOL bReread) SendDlgItemMessage( hwndDlg, IDC_MENUITEMS, WM_SETREDRAW, TRUE, 0 );
mir_free( PDar );
- ShowWindow( GetDlgItem( hwndDlg, IDC_NOTSUPPORTWARNING ),( pimo->m_bUseUserDefinedItems ) ? SW_HIDE : SW_SHOW );
+ ShowWindow( GetDlgItem( hwndDlg, IDC_NOTSUPPORTWARNING ), ( pimo->m_bUseUserDefinedItems ) ? SW_HIDE : SW_SHOW );
EnableWindow( GetDlgItem( hwndDlg, IDC_MENUITEMS ), pimo->m_bUseUserDefinedItems );
EnableWindow( GetDlgItem( hwndDlg, IDC_INSERTSEPARATOR ), pimo->m_bUseUserDefinedItems );
return 1;
@@ -369,7 +369,7 @@ static HTREEITEM MoveItemAbove(HWND hTreeWnd, HTREEITEM hItem, HTREEITEM hInsert tvis.item.iImage = tvis.item.iSelectedImage = (( MenuItemOptData* )tvi.lParam)->show;
if (!SendMessage(hTreeWnd, TVM_GETITEM, 0, (LPARAM)&tvis.item))
return NULL;
- if (!TreeView_DeleteItem(hTreeWnd,hItem))
+ if (!TreeView_DeleteItem(hTreeWnd, hItem))
return NULL;
tvis.hParent=NULL;
tvis.hInsertAfter=hInsertAfter;
@@ -380,16 +380,16 @@ static HTREEITEM MoveItemAbove(HWND hTreeWnd, HTREEITEM hItem, HTREEITEM hInsert WNDPROC MyOldWindowProc=NULL;
-LRESULT CALLBACK LBTNDOWNProc(HWND hwnd,UINT uMsg, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK LBTNDOWNProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_LBUTTONDOWN && !(GetKeyState(VK_CONTROL)&0x8000)) {
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(lParam);
hti.pt.y=(short)HIWORD(lParam);
- // ClientToScreen(hwndDlg,&hti.pt);
- // ScreenToClient(GetDlgItem(hwndDlg,IDC_MENUITEMS),&hti.pt);
- TreeView_HitTest(hwnd,&hti);
+ // ClientToScreen(hwndDlg, &hti.pt);
+ // ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
+ TreeView_HitTest(hwnd, &hti);
if (hti.flags&TVHT_ONITEMLABEL) {
/// LabelClicked Set/unset selection
TVITEM tvi;
@@ -415,36 +415,36 @@ LRESULT CALLBACK LBTNDOWNProc(HWND hwnd,UINT uMsg, WPARAM wParam, LPARAM lParam) ((MenuItemOptData *)tvi.lParam)->isSelected=1;
TreeView_SetItem(tvw, &tvi);
}
- while (hit=TreeView_GetNextSibling(tvw,hit));
+ while (hit=TreeView_GetNextSibling(tvw, hit));
} } }
- return CallWindowProc(MyOldWindowProc,hwnd,uMsg,wParam,lParam);
+ return CallWindowProc(MyOldWindowProc, hwnd, uMsg, wParam, lParam);
}
static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct OrderData *dat = (struct OrderData*)GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MENUITEMS),GWLP_USERDATA);
+ struct OrderData *dat = (struct OrderData*)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA);
LPNMHDR hdr;
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
dat=(struct OrderData*)mir_alloc(sizeof(struct OrderData));
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MENUITEMS),GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging = 0;
dat->iInitMenuValue = DBGetContactSettingByte( NULL, "CList", "MoveProtoMenus", TRUE );
- MyOldWindowProc = (WNDPROC)GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MENUITEMS),GWLP_WNDPROC);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MENUITEMS),GWLP_WNDPROC,(LONG_PTR)&LBTNDOWNProc);
+ MyOldWindowProc = (WNDPROC)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC, (LONG_PTR)&LBTNDOWNProc);
{
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
+ himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
(IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 2, 2);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK);
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_MENUOBJECTS),himlCheckBoxes,TVSIL_NORMAL);
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_MENUITEMS),himlCheckBoxes,TVSIL_NORMAL);
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_MENUOBJECTS), himlCheckBoxes, TVSIL_NORMAL);
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_MENUITEMS), himlCheckBoxes, TVSIL_NORMAL);
}
CheckDlgButton(hwndDlg, dat->iInitMenuValue ? IDC_RADIO2 : IDC_RADIO1, TRUE );
CheckDlgButton(hwndDlg, IDC_DISABLEMENUICONS, bIconsDisabled );
@@ -476,13 +476,13 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HTREEITEM hti;
MenuItemOptData *iod;
- hti=TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_MENUITEMS));
+ hti=TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
if (hti == NULL)
break;
tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
tvi.hItem=hti;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_MENUITEMS),&tvi);
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
iod = ( MenuItemOptData * )tvi.lParam;
if ( iod->name && _tcsstr( iod->name, STR_SEPARATOR ))
@@ -504,7 +504,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TCHAR buf[256];
MenuItemOptData *iod;
- HTREEITEM hti = TreeView_GetSelection( GetDlgItem( hwndDlg,IDC_MENUITEMS ));
+ HTREEITEM hti = TreeView_GetSelection( GetDlgItem( hwndDlg, IDC_MENUITEMS ));
if ( hti == NULL )
break;
@@ -516,7 +516,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if ( iod->name && _tcsstr(iod->name, STR_SEPARATOR ))
break;
- ZeroMemory(buf,sizeof( buf ));
+ ZeroMemory(buf, sizeof( buf ));
GetDlgItemText( hwndDlg, IDC_GENMENU_CUSTOMNAME, buf, SIZEOF( buf ));
if (iod->name)
mir_free(iod->name);
@@ -557,7 +557,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (hdr->code) {
case NM_CUSTOMDRAW:
{
- int i= handleCustomDraw(GetDlgItem(hwndDlg,IDC_MENUITEMS),(LPNMTVCUSTOMDRAW) lParam);
+ int i= handleCustomDraw(GetDlgItem(hwndDlg, IDC_MENUITEMS), (LPNMTVCUSTOMDRAW) lParam);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, i);
return TRUE;
}
@@ -566,7 +566,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetCapture(hwndDlg);
dat->dragging=1;
dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_MENUITEMS),dat->hDragItem);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), dat->hDragItem);
break;
case NM_CLICK:
@@ -574,21 +574,21 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(hdr->hwndFrom,&hti.pt);
- if (TreeView_HitTest(hdr->hwndFrom,&hti)) {
+ ScreenToClient(hdr->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(hdr->hwndFrom, &hti)) {
if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
tvi.hItem=hti.hItem;
- TreeView_GetItem(hdr->hwndFrom,&tvi);
+ TreeView_GetItem(hdr->hwndFrom, &tvi);
tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
((MenuItemOptData *)tvi.lParam)->show=tvi.iImage;
- TreeView_SetItem(hdr->hwndFrom,&tvi);
+ TreeView_SetItem(hdr->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
//all changes take effect in runtime
- //ShowWindow(GetDlgItem(hwndDlg,IDC_BUTTONORDERTREEWARNING),SW_SHOW);
+ //ShowWindow(GetDlgItem(hwndDlg, IDC_BUTTONORDERTREEWARNING), SW_SHOW);
}
/*--------MultiSelection----------*/
if (hti.flags&TVHT_ONITEMLABEL) {
@@ -597,13 +597,13 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HWND tvw=hdr->hwndFrom;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
tvi.hItem=hti.hItem;
- TreeView_GetItem(tvw,&tvi);
+ TreeView_GetItem(tvw, &tvi);
if (GetKeyState(VK_CONTROL)&0x8000) {
if (((MenuItemOptData *)tvi.lParam)->isSelected)
((MenuItemOptData *)tvi.lParam)->isSelected=0;
else
((MenuItemOptData *)tvi.lParam)->isSelected=1; //current selection order++.
- TreeView_SetItem(tvw,&tvi);
+ TreeView_SetItem(tvw, &tvi);
}
else if (GetKeyState(VK_SHIFT)&0x8000) {
; // shifted click
@@ -617,15 +617,15 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM tvi={0};
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
tvi.hItem=hit;
- TreeView_GetItem(tvw,&tvi);
+ TreeView_GetItem(tvw, &tvi);
if (hti.hItem != hit)
((MenuItemOptData *)tvi.lParam)->isSelected=0;
else
((MenuItemOptData *)tvi.lParam)->isSelected=1;
- TreeView_SetItem(tvw,&tvi);
+ TreeView_SetItem(tvw, &tvi);
}
- while (hit=TreeView_GetNextSibling(tvw,hit));
+ while (hit=TreeView_GetNextSibling(tvw, hit));
} } }
break;
}
@@ -646,20 +646,20 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HTREEITEM hti;
MenuItemOptData *iod;
- SetDlgItemTextA(hwndDlg,IDC_GENMENU_CUSTOMNAME,"");
- SetDlgItemTextA(hwndDlg,IDC_GENMENU_SERVICE,"");
+ SetDlgItemTextA(hwndDlg, IDC_GENMENU_CUSTOMNAME, "");
+ SetDlgItemTextA(hwndDlg, IDC_GENMENU_SERVICE, "");
- EnableWindow(GetDlgItem(hwndDlg,IDC_GENMENU_CUSTOMNAME),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_GENMENU_DEFAULT),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_GENMENU_SET),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_SET), FALSE);
- hti=TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_MENUITEMS));
+ hti=TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS));
if (hti == NULL)
break;
tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
tvi.hItem=hti;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_MENUITEMS),&tvi);
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi);
if ( tvi.lParam == 0 )
break;
@@ -669,14 +669,14 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if ( iod->name && _tcsstr(iod->name, STR_SEPARATOR))
break;
- SetDlgItemText(hwndDlg,IDC_GENMENU_CUSTOMNAME,iod->name);
+ SetDlgItemText(hwndDlg, IDC_GENMENU_CUSTOMNAME, iod->name);
if (iod->pimi->submenu.first == NULL && iod->uniqname)
SetDlgItemTextA(hwndDlg, IDC_GENMENU_SERVICE, iod->uniqname);
- EnableWindow(GetDlgItem(hwndDlg,IDC_GENMENU_DEFAULT), lstrcmp(iod->name, iod->defname) != 0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_GENMENU_SET),TRUE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_GENMENU_CUSTOMNAME),TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), lstrcmp(iod->name, iod->defname) != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_SET), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), TRUE);
break;
}
break;
@@ -690,22 +690,22 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hti.pt.x=(short)LOWORD(lParam);
hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_MENUITEMS),&hti.pt);
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_MENUITEMS),&hti);
+ ClientToScreen(hwndDlg, &hti.pt);
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
HTREEITEM it = hti.hItem;
- hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_MENUITEMS))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_MENUITEMS),&hti);
+ hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_MENUITEMS))/2;
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
if (!(hti.flags&TVHT_ABOVE))
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_MENUITEMS),hti.hItem,1);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), hti.hItem, 1);
else
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_MENUITEMS),it,0);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), it, 0);
}
else {
- if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_MENUITEMS,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
- if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_MENUITEMS,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_MENUITEMS),NULL,0);
+ if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
+ if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0);
} }
break;
@@ -713,17 +713,17 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (!dat->dragging)
break;
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_MENUITEMS),NULL,0);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0);
dat->dragging=0;
ReleaseCapture();
{
TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(lParam);
hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_MENUITEMS),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_MENUITEMS))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_MENUITEMS),&hti);
+ ClientToScreen(hwndDlg, &hti.pt);
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt);
+ hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_MENUITEMS))/2;
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti);
if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
if (dat->hDragItem == hti.hItem) break;
dat->hDragItem=NULL;
@@ -731,8 +731,8 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HWND tvw;
HTREEITEM * pSIT;
HTREEITEM FirstItem=NULL;
- UINT uITCnt,uSic ;
- tvw=GetDlgItem(hwndDlg,IDC_MENUITEMS);
+ UINT uITCnt, uSic ;
+ tvw=GetDlgItem(hwndDlg, IDC_MENUITEMS);
uITCnt=TreeView_GetCount(tvw);
uSic=0;
if (uITCnt) {
@@ -745,20 +745,20 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM tvi={0};
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
tvi.hItem=hit;
- TreeView_GetItem(tvw,&tvi);
+ TreeView_GetItem(tvw, &tvi);
if (((MenuItemOptData *)tvi.lParam)->isSelected) {
pSIT[uSic]=tvi.hItem;
uSic++;
}
- }while (hit=TreeView_GetNextSibling(tvw,hit));
+ }while (hit=TreeView_GetNextSibling(tvw, hit));
// Proceed moving
{
UINT i;
HTREEITEM insertAfter;
insertAfter=hti.hItem;
for (i=0; i<uSic; i++) {
- if (insertAfter) insertAfter=MoveItemAbove(tvw,pSIT[i],insertAfter);
+ if (insertAfter) insertAfter=MoveItemAbove(tvw, pSIT[i], insertAfter);
else break;
if (!i) FirstItem=insertAfter;
} }
@@ -766,7 +766,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_free(pSIT);
} }
- if (FirstItem) TreeView_SelectItem(tvw,FirstItem);
+ if (FirstItem) TreeView_SelectItem(tvw, FirstItem);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
SaveTree(hwndDlg);
} }
@@ -776,7 +776,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if ( dat )
mir_free( dat );
- ImageList_Destroy(TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_MENUOBJECTS),NULL,TVSIL_NORMAL));
+ ImageList_Destroy(TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_MENUOBJECTS), NULL, TVSIL_NORMAL));
FreeTreeData( hwndDlg );
break;
@@ -824,17 +824,17 @@ long handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) RECT rc;
k=1;
- GetTextExtentPoint32(pNMTVCD->nmcd.hdc,tvi.pszText,lstrlen(tvi.pszText),&sz);
+ GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, lstrlen(tvi.pszText), &sz);
if (sz.cx+3>pNMTVCD->nmcd.rc.right-pNMTVCD->nmcd.rc.left) rc=pNMTVCD->nmcd.rc;
- else SetRect(&rc,pNMTVCD->nmcd.rc.left,pNMTVCD->nmcd.rc.top,pNMTVCD->nmcd.rc.left+sz.cx+3,pNMTVCD->nmcd.rc.bottom);
+ else SetRect(&rc, pNMTVCD->nmcd.rc.left, pNMTVCD->nmcd.rc.top, pNMTVCD->nmcd.rc.left+sz.cx+3, pNMTVCD->nmcd.rc.bottom);
br=CreateSolidBrush(pNMTVCD->clrTextBk);
- SetTextColor(pNMTVCD->nmcd.hdc,pNMTVCD->clrText);
- SetBkColor(pNMTVCD->nmcd.hdc,pNMTVCD->clrTextBk);
- FillRect(pNMTVCD->nmcd.hdc,&rc,br);
+ SetTextColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrText);
+ SetBkColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrTextBk);
+ FillRect(pNMTVCD->nmcd.hdc, &rc, br);
DeleteObject(br);
- DrawText(pNMTVCD->nmcd.hdc,tvi.pszText,lstrlen(tvi.pszText),&pNMTVCD->nmcd.rc,DT_LEFT|DT_VCENTER|DT_NOPREFIX);
+ DrawText(pNMTVCD->nmcd.hdc, tvi.pszText, lstrlen(tvi.pszText), &pNMTVCD->nmcd.rc, DT_LEFT|DT_VCENTER|DT_NOPREFIX);
}
return CDRF_NEWFONT|(k?CDRF_SKIPDEFAULT:0);
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index ddf7c287b4..c958823ebb 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp index e02abed203..cb8a428f22 100644 --- a/src/modules/clist/keyboard.cpp +++ b/src/modules/clist/keyboard.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -26,15 +26,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR hkHideShow(WPARAM, LPARAM)
{
- cli.pfnShowHide(0,0);
+ cli.pfnShowHide(0, 0);
return 0;
}
/*
-INT_PTR hkSearch(WPARAM wParam,LPARAM lParam)
+INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv={0};
- if (!DBGetContactSettingString(NULL,"CList","SearchUrl",&dbv)) {
- CallService(MS_UTILS_OPENURL,DBGetContactSettingByte(NULL,"CList","HKSearchNewWnd",0),(LPARAM)dbv.pszVal);
+ if (!DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
+ CallService(MS_UTILS_OPENURL, DBGetContactSettingByte(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
DBFreeVariant(&dbv);
}
return 0;
@@ -50,17 +50,17 @@ static INT_PTR hkRead(WPARAM, LPARAM) static INT_PTR hkOpts(WPARAM, LPARAM)
{
- CallService("Options/OptionsCommand",0, 0);
+ CallService("Options/OptionsCommand", 0, 0);
return 0;
}
/*
-static INT_PTR hkCloseMiranda(WPARAM wParam,LPARAM lParam)
+static INT_PTR hkCloseMiranda(WPARAM wParam, LPARAM lParam)
{
CallService("CloseAction", 0, 0);
return 0;
}
-INT_PTR hkRestoreStatus(WPARAM wParam,LPARAM lParam)
+INT_PTR hkRestoreStatus(WPARAM wParam, LPARAM lParam)
{
int nStatus = DBGetContactSettingWord(NULL, "CList", "Status", ID_STATUS_OFFLINE);
CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0);
@@ -77,12 +77,12 @@ int InitClistHotKeys(void) {
HOTKEYDESC shk = {0};
- CreateServiceFunction("CLIST/HK/SHOWHIDE",hkHideShow);
- CreateServiceFunction("CLIST/HK/Opts",hkOpts);
- CreateServiceFunction("CLIST/HK/Read",hkRead);
-// CreateServiceFunction("CLIST/HK/CloseMiranda",hkCloseMiranda);
-// CreateServiceFunction("CLIST/HK/RestoreStatus",hkRestoreStatus);
-// CreateServiceFunction("CLIST/HK/AllOffline",hkAllOffline);
+ CreateServiceFunction("CLIST/HK/SHOWHIDE", hkHideShow);
+ CreateServiceFunction("CLIST/HK/Opts", hkOpts);
+ CreateServiceFunction("CLIST/HK/Read", hkRead);
+// CreateServiceFunction("CLIST/HK/CloseMiranda", hkCloseMiranda);
+// CreateServiceFunction("CLIST/HK/RestoreStatus", hkRestoreStatus);
+// CreateServiceFunction("CLIST/HK/AllOffline", hkAllOffline);
shk.cbSize=sizeof(shk);
shk.pszDescription="Show Hide Contact List";
@@ -90,42 +90,42 @@ int InitClistHotKeys(void) shk.pszSection="Main";
shk.pszService="CLIST/HK/SHOWHIDE";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A');
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
shk.pszDescription="Read Message";
shk.pszName="ReadMessage";
shk.pszSection="Main";
shk.pszService="CLIST/HK/Read";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
/*
shk.pszDescription="Search in site";
shk.pszName="SearchInWeb";
shk.pszSection="Main";
shk.pszService="CLIST/HK/Search";
shk.DefHotKey=846;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
*/
shk.pszDescription = "Open Options Page";
shk.pszName = "ShowOptions";
shk.pszSection = "Main";
shk.pszService = "CLIST/HK/Opts";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
shk.pszDescription = "Open Logging Options";
shk.pszName = "ShowLogOptions";
shk.pszSection = "Main";
shk.pszService = "Netlib/Log/Win";
shk.DefHotKey = 0;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
shk.pszDescription="Open Find User Dialog";
shk.pszName="FindUsers";
shk.pszSection="Main";
shk.pszService="FindAdd/FindAddCommand";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
/*
shk.pszDescription="Close Miranda";
@@ -133,21 +133,21 @@ int InitClistHotKeys(void) shk.pszSection="Main";
shk.pszService="CLIST/HK/CloseMiranda";
shk.DefHotKey=0;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
shk.pszDescription="Restore last status";
shk.pszName="RestoreLastStatus";
shk.pszSection="Status";
shk.pszService="CLIST/HK/RestoreStatus";
shk.DefHotKey=0;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
shk.pszDescription="Set All Offline";
shk.pszName="AllOffline";
shk.pszSection="Status";
shk.pszService="CLIST/HK/AllOffline";
shk.DefHotKey=0;
- CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk);
*/
return 0;
}
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index 4cdda53de8..5fd05e87a0 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -76,13 +76,13 @@ static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, boo if ( checked )
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
- HANDLE result = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, param, (LPARAM)&mi);
+ HANDLE result = Menu_AddContactMenuItem(&mi);
mir_free( mi.ptszName );
lphGroupsItems.insert((HANDLE*)result);
}
-static int OnContactMenuBuild(WPARAM wParam,LPARAM)
+static int OnContactMenuBuild(WPARAM wParam, LPARAM)
{
int i;
OBJLIST<GroupItemSort> groups(10, GroupItemSort::compare);
@@ -97,7 +97,7 @@ static int OnContactMenuBuild(WPARAM wParam,LPARAM) mi.flags = CMIF_ROOTHANDLE | CMIF_ICONFROMICOLIB;
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_GROUP);
- hMoveToGroupItem = (HGENMENU)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
}
for (i = 0; i < lphGroupsItems.getCount(); i++)
@@ -139,7 +139,7 @@ static int OnContactMenuBuild(WPARAM wParam,LPARAM) return 0;
}
-static INT_PTR MTG_DOMOVE(WPARAM wParam,LPARAM lParam)
+static INT_PTR MTG_DOMOVE(WPARAM wParam, LPARAM lParam)
{
CallService(MS_CLIST_CONTACTCHANGEGROUP, wParam, lParam < 0 ? 0 : lParam);
return 0;
@@ -147,8 +147,8 @@ static INT_PTR MTG_DOMOVE(WPARAM wParam,LPARAM lParam) void MTG_OnmodulesLoad()
{
- hOnCntMenuBuild=HookEvent(ME_CLIST_PREBUILDCONTACTMENU,OnContactMenuBuild);
- CreateServiceFunction(MTG_MOVE,MTG_DOMOVE);
+ hOnCntMenuBuild=HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnContactMenuBuild);
+ CreateServiceFunction(MTG_MOVE, MTG_DOMOVE);
}
int UnloadMoveToGroup(void)
diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp index c40792a095..41a5b5beba 100644 --- a/src/modules/clist/protocolorder.cpp +++ b/src/modules/clist/protocolorder.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -254,19 +254,19 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if ( TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti )) {
if ( hti.flags & TVHT_ONITEMICON ) {
TVITEMA tvi;
tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
tvi.hItem = hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
ProtocolData *pData = ( ProtocolData* )tvi.lParam;
if ( pData->enabled ) {
tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
pData->show = tvi.iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
} } } } }
break;
diff --git a/src/modules/contacts/contacts.cpp b/src/modules/contacts/contacts.cpp index 562965ad17..1b8041a066 100644 --- a/src/modules/contacts/contacts.cpp +++ b/src/modules/contacts/contacts.cpp @@ -6,7 +6,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.
@@ -20,13 +20,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NAMEORDERCOUNT 8
static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] =
{
- _T( "My custom name (not moveable)" ),
- _T( "Nick" ),
- _T( "FirstName" ),
- _T( "E-mail" ),
- _T( "LastName" ),
- _T( "Username" ),
- _T( "FirstName LastName" ),
+ _T( "My custom name (not moveable)" ),
+ _T( "Nick" ),
+ _T( "FirstName" ),
+ _T( "E-mail" ),
+ _T( "LastName" ),
+ _T( "Username" ),
+ _T( "FirstName LastName" ),
_T( "'(Unknown Contact)' (not moveable)" )
};
@@ -44,9 +44,9 @@ static int GetDatabaseString( CONTACTINFO *ci, const char* setting, DBVARIANT* d }
if ( ci->dwFlag & CNF_UNICODE )
- return DBGetContactSettingWString(ci->hContact,ci->szProto,setting,dbv);
+ return DBGetContactSettingWString(ci->hContact, ci->szProto, setting, dbv);
- return DBGetContactSettingString(ci->hContact,ci->szProto,setting,dbv);
+ return DBGetContactSettingString(ci->hContact, ci->szProto, setting, dbv);
}
static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting)
@@ -92,7 +92,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { CONTACTINFO *ci = (CONTACTINFO*)lParam;
if (ci == NULL) return 1;
- if (ci->szProto == NULL) ci->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT,(WPARAM)ci->hContact,0);
+ if (ci->szProto == NULL) ci->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)ci->hContact, 0);
if (ci->szProto == NULL) return 1;
ci->type = 0;
switch(ci->dwFlag & 0x7F) {
@@ -143,9 +143,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { if ( !DBGetContactSetting( ci->hContact, ci->szProto, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv )) {
if ( dbv.type == DBVT_WORD ) {
- int i,countryCount;
+ int i, countryCount;
struct CountryListEntry *countries;
- CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&countryCount,(LPARAM)&countries);
+ CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries);
for (i=0;i<countryCount;i++) {
if (countries[i].id != dbv.wVal) continue;
@@ -171,7 +171,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { case CNF_FIRSTLAST:
if ( !GetDatabaseString( ci, "FirstName", &dbv )) {
DBVARIANT dbv2;
- if (!GetDatabaseString(ci,"LastName",&dbv2)) {
+ if (!GetDatabaseString(ci, "LastName", &dbv2)) {
ci->type = CNFT_ASCIIZ;
if ( ci->dwFlag & CNF_UNICODE ) {
size_t len = wcslen(dbv.pwszVal) + wcslen(dbv2.pwszVal) + 2;
@@ -197,9 +197,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { case CNF_UNIQUEID:
{
- char *uid = (char*)CallProtoService(ci->szProto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
+ char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)uid != CALLSERVICE_NOTFOUND&&uid)
- if (!ProcessDatabaseValueDefault(ci,uid))
+ if (!ProcessDatabaseValueDefault(ci, uid))
return 0;
break;
@@ -208,9 +208,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { {
if (!ProcessDatabaseValueDefault(ci, "display_uid"))
return 0;
- char *uid = (char*)CallProtoService(ci->szProto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
+ char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)uid != CALLSERVICE_NOTFOUND&&uid)
- if (!ProcessDatabaseValueDefault(ci,uid))
+ if (!ProcessDatabaseValueDefault(ci, uid))
return 0;
break;
@@ -226,7 +226,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { // make sure we aren't in CNF_DISPLAYNC mode
// don't get custom name for NULL contact
char* saveProto = ci->szProto; ci->szProto = "CList";
- if (ci->hContact != NULL && (ci->dwFlag&0x7F) == CNF_DISPLAY && !ProcessDatabaseValueDefault(ci,"MyHandle")) {
+ if (ci->hContact != NULL && (ci->dwFlag&0x7F) == CNF_DISPLAY && !ProcessDatabaseValueDefault(ci, "MyHandle")) {
ci->szProto = saveProto;
return 0;
}
@@ -252,9 +252,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { case 5: // Unique id
{
// protocol must define a PFLAG_UNIQUEIDSETTING
- char *uid = (char*)CallProtoService(ci->szProto,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
+ char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR)uid != CALLSERVICE_NOTFOUND&&uid) {
- if (!GetDatabaseString(ci,uid,&dbv)) {
+ if (!GetDatabaseString(ci, uid, &dbv)) {
if ( dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD ) {
long value = (dbv.type == DBVT_BYTE) ? dbv.bVal:(dbv.type == DBVT_WORD ? dbv.wVal : dbv.dVal);
if ( ci->dwFlag & CNF_UNICODE ) {
@@ -283,9 +283,9 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { break;
}
case 6: // first + last name
- if (!GetDatabaseString(ci,"FirstName",&dbv)) {
+ if (!GetDatabaseString(ci, "FirstName", &dbv)) {
DBVARIANT dbv2;
- if (!GetDatabaseString(ci,"LastName",&dbv2)) {
+ if (!GetDatabaseString(ci, "LastName", &dbv2)) {
ci->type = CNFT_ASCIIZ;
if ( ci->dwFlag & CNF_UNICODE ) {
@@ -338,7 +338,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { }
case CNF_MYNOTES: {
char* saveProto = ci->szProto; ci->szProto = "UserInfo";
- if (!ProcessDatabaseValueDefault(ci,"MyNotes")) {
+ if (!ProcessDatabaseValueDefault(ci, "MyNotes")) {
ci->szProto = saveProto;
return 0;
}
@@ -357,15 +357,15 @@ struct ContactOptionsData { static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{ struct ContactOptionsData *dat;
- dat=(struct ContactOptionsData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ dat=(struct ContactOptionsData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
{ TranslateDialogDefault(hwndDlg);
dat=(struct ContactOptionsData*)mir_alloc(sizeof(struct ContactOptionsData));
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging=0;
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NAMEORDER),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NAMEORDER),GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NAMEORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NAMEORDER), GWL_STYLE)|TVS_NOHSCROLL);
{ TVINSERTSTRUCT tvis;
int i;
tvis.hParent = NULL;
@@ -374,7 +374,7 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara for (i=0; i < SIZEOF(nameOrderDescr); i++ ) {
tvis.item.lParam = nameOrder[i];
tvis.item.pszText = TranslateTS( nameOrderDescr[ nameOrder[i]] );
- TreeView_InsertItem( GetDlgItem(hwndDlg,IDC_NAMEORDER), &tvis );
+ TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvis );
} }
return TRUE;
}
@@ -390,16 +390,16 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara cws.value.type = DBVT_BLOB;
cws.value.cpbVal = SIZEOF(nameOrderDescr);
cws.value.pbVal = nameOrder;
- tvi.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_NAMEORDER));
+ tvi.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_NAMEORDER));
i=0;
while ( tvi.hItem != NULL ) {
tvi.mask = TVIF_PARAM | TVIF_HANDLE;
- TreeView_GetItem( GetDlgItem(hwndDlg,IDC_NAMEORDER), &tvi );
+ TreeView_GetItem( GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvi );
nameOrder[i++] = (BYTE)tvi.lParam;
- tvi.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg,IDC_NAMEORDER),tvi.hItem);
+ tvi.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_NAMEORDER), tvi.hItem);
}
- CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)(HANDLE)NULL,(LPARAM)&cws);
- CallService(MS_CLIST_INVALIDATEDISPLAYNAME,(WPARAM)INVALID_HANDLE_VALUE,0);
+ CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cws);
+ CallService(MS_CLIST_INVALIDATEDISPLAYNAME, (WPARAM)INVALID_HANDLE_VALUE, 0);
}
break;
case IDC_NAMEORDER:
@@ -410,7 +410,7 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara SetCapture(hwndDlg);
dat->dragging=1;
dat->hDragItem=((LPNMTREEVIEW)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_NAMEORDER),dat->hDragItem);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), dat->hDragItem);
}
break;
}
@@ -420,38 +420,38 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara { TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(lParam);
hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_NAMEORDER),&hti.pt);
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_NAMEORDER),&hti);
+ ClientToScreen(hwndDlg, &hti.pt);
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti.pt);
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti);
if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_NAMEORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_NAMEORDER),&hti);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_NAMEORDER),hti.hItem,1);
+ hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_NAMEORDER))/2;
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_NAMEORDER), hti.hItem, 1);
}
else {
- if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_NAMEORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
- if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_NAMEORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_NAMEORDER),NULL,0);
+ if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg, IDC_NAMEORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
+ if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg, IDC_NAMEORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_NAMEORDER), NULL, 0);
}
}
break;
case WM_LBUTTONUP:
if (!dat->dragging) break;
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_NAMEORDER),NULL,0);
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_NAMEORDER), NULL, 0);
dat->dragging=0;
ReleaseCapture();
{ TVHITTESTINFO hti;
TVITEM tvi;
hti.pt.x=(short)LOWORD(lParam);
hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_NAMEORDER),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_NAMEORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_NAMEORDER),&hti);
+ ClientToScreen(hwndDlg, &hti.pt);
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti.pt);
+ hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_NAMEORDER))/2;
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_NAMEORDER), &hti);
if (dat->hDragItem == hti.hItem) break;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
tvi.hItem=hti.hItem;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_NAMEORDER),&tvi);
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvi);
if (tvi.lParam == SIZEOF(nameOrderDescr)-1) break;
if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
TVINSERTSTRUCT tvis;
@@ -461,11 +461,11 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara tvis.item.pszText=name;
tvis.item.cchTextMax=SIZEOF(name);
tvis.item.hItem=dat->hDragItem;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_NAMEORDER),&tvis.item);
- TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_NAMEORDER),dat->hDragItem);
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvis.item);
+ TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), dat->hDragItem);
tvis.hParent=NULL;
tvis.hInsertAfter=hti.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_NAMEORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_NAMEORDER),&tvis));
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_NAMEORDER), &tvis));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
@@ -501,13 +501,13 @@ int LoadContactsModule(void) { for (i=0; i<NAMEORDERCOUNT; i++)
nameOrder[i]=i;
- if (!DBGetContactSetting(NULL,"Contact","NameOrder",&dbv))
+ if (!DBGetContactSetting(NULL, "Contact", "NameOrder", &dbv))
{
- CopyMemory(nameOrder,dbv.pbVal,dbv.cpbVal);
+ CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal);
DBFreeVariant(&dbv);
}
}
- CreateServiceFunction(MS_CONTACT_GETCONTACTINFO,GetContactInfo);
- HookEvent(ME_OPT_INITIALISE,ContactOptInit);
+ CreateServiceFunction(MS_CONTACT_GETCONTACTINFO, GetContactInfo);
+ HookEvent(ME_OPT_INITIALISE, ContactOptInit);
return 0;
}
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index 0ed1001308..e4b2663b60 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -333,9 +333,9 @@ static int getProfile(TCHAR * szProfile, size_t cch) getProfileCmdLine(szProfile, cch, g_profileDir);
if (IsInsideRootDir(g_profileDir, true))
{
- MessageBox(NULL,
+ MessageBox(NULL,
_T("Profile cannot be placed into Miranda root folder.\n")
- _T("Please move Miranda profile to some other location."),
+ _T("Please move Miranda profile to some other location."),
_T("Miranda IM"), MB_ICONERROR | MB_OK);
return 0;
}
@@ -395,8 +395,8 @@ int makeDatabase(TCHAR * profile, DATABASELINK * link, HWND hwndDlg) sf.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
mir_sntprintf(buf, SIZEOF(buf), _T("%s\0"), profile);
if ( SHFileOperation(&sf) != 0 ) {
- mir_sntprintf(buf, SIZEOF(buf),TranslateT("Couldn't move '%s' to the Recycle Bin, Please select another profile name."),file);
- MessageBox(0,buf,TranslateT("Problem moving profile"),MB_ICONINFORMATION|MB_OK);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Couldn't move '%s' to the Recycle Bin, Please select another profile name."), file);
+ MessageBox(0, buf, TranslateT("Problem moving profile"), MB_ICONINFORMATION|MB_OK);
return 0;
}
// now the file should be gone!
@@ -405,8 +405,8 @@ int makeDatabase(TCHAR * profile, DATABASELINK * link, HWND hwndDlg) CreatePathToFileT(profile);
char *prf = makeFileName(profile);
if (link->makeDatabase(prf, &err)) {
- mir_sntprintf(buf, SIZEOF(buf),TranslateT("Unable to create the profile '%s', the error was %x"),file, err);
- MessageBox(hwndDlg,buf,TranslateT("Problem creating profile"),MB_ICONERROR|MB_OK);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Unable to create the profile '%s', the error was %x"), file, err);
+ MessageBox(hwndDlg, buf, TranslateT("Problem creating profile"), MB_ICONERROR|MB_OK);
mir_free(prf);
return 0;
}
@@ -488,7 +488,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam) TCHAR classname[256];
ENUMMIRANDAWINDOW * x = (ENUMMIRANDAWINDOW *)lParam;
DWORD_PTR res=0;
- if ( GetClassName(hwnd,classname,SIZEOF(classname)) && lstrcmp( _T("Miranda"),classname) == 0 ) {
+ if ( GetClassName(hwnd, classname, SIZEOF(classname)) && lstrcmp( _T("Miranda"), classname) == 0 ) {
if ( SendMessageTimeout(hwnd, x->msg, (WPARAM)x->aPath, 0, SMTO_ABORTIFHUNG, 100, &res) && res ) {
x->found++;
return FALSE;
@@ -527,9 +527,9 @@ int LoadDatabaseModule(void) dbe.lParam = (LPARAM)szProfile;
if ( _taccess(szProfile, 0) && shouldAutoCreate( szProfile ))
- dbe.pfnEnumCallback=( int(*) (const char*,void*,LPARAM) )FindDbPluginAutoCreate;
+ dbe.pfnEnumCallback=( int(*) (const char*, void*, LPARAM) )FindDbPluginAutoCreate;
else
- dbe.pfnEnumCallback=( int(*) (const char*,void*,LPARAM) )FindDbPluginForProfile;
+ dbe.pfnEnumCallback=( int(*) (const char*, void*, LPARAM) )FindDbPluginForProfile;
// find a driver to support the given profile
bool retry;
@@ -541,9 +541,9 @@ int LoadDatabaseModule(void) case -1: {
// no plugins at all
TCHAR buf[256];
- TCHAR* p = _tcsrchr(szProfile,'\\');
- mir_sntprintf(buf,SIZEOF(buf),TranslateT("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_3x.dll or equivalent."), p ? ++p : szProfile );
- MessageBox(0,buf,TranslateT("No profile support installed!"),MB_OK | MB_ICONERROR);
+ TCHAR* p = _tcsrchr(szProfile, '\\');
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_3x.dll or equivalent."), p ? ++p : szProfile );
+ MessageBox(0, buf, TranslateT("No profile support installed!"), MB_OK | MB_ICONERROR);
break;
}
case 1:
@@ -551,15 +551,15 @@ int LoadDatabaseModule(void) if (fileExist(szProfile)) {
// file isn't locked, just no driver could open it.
TCHAR buf[256];
- TCHAR* p = _tcsrchr(szProfile,'\\');
- mir_sntprintf(buf,SIZEOF(buf),TranslateT("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DB-tool which should be installed."), p ? ++p : szProfile);
- MessageBox(0,buf,TranslateT("Miranda can't understand that profile"),MB_OK | MB_ICONERROR);
+ TCHAR* p = _tcsrchr(szProfile, '\\');
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DB-tool which should be installed."), p ? ++p : szProfile);
+ MessageBox(0, buf, TranslateT("Miranda can't understand that profile"), MB_OK | MB_ICONERROR);
}
else if (!FindMirandaForProfile(szProfile)) {
TCHAR buf[256];
- TCHAR* p = _tcsrchr(szProfile,'\\');
- mir_sntprintf(buf,SIZEOF(buf),TranslateT("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance"), p ? ++p : szProfile);
- retry = MessageBox(0,buf,TranslateT("Miranda can't open that profile"),MB_RETRYCANCEL | MB_ICONERROR) == IDRETRY;
+ TCHAR* p = _tcsrchr(szProfile, '\\');
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance"), p ? ++p : szProfile);
+ retry = MessageBox(0, buf, TranslateT("Miranda can't open that profile"), MB_RETRYCANCEL | MB_ICONERROR) == IDRETRY;
}
break;
}
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index cecbef4dd8..ce01d20dc8 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.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.
@@ -30,7 +30,7 @@ static HANDLE hIniChangeNotification; extern TCHAR mirandabootini[MAX_PATH];
extern bool dbCreated;
-static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_INITDIALOG:
@@ -62,7 +62,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg,UINT message,WPARAM wPara case IDOK:
case IDCANCEL:
case IDC_NOTOALL:
- EndDialog(hwndDlg,LOWORD(wParam));
+ EndDialog(hwndDlg, LOWORD(wParam));
break;
}
break;
@@ -70,13 +70,13 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg,UINT message,WPARAM wPara return FALSE;
}
-static bool IsInSpaceSeparatedList(const char *szWord,const char *szList)
+static bool IsInSpaceSeparatedList(const char *szWord, const char *szList)
{
- const char *szItem,*szEnd;
+ const char *szItem, *szEnd;
int wordLen = lstrlenA(szWord);
for (szItem = szList;;) {
- szEnd = strchr(szItem,' ');
+ szEnd = strchr(szItem, ' ');
if (szEnd == NULL)
return !lstrcmpA( szItem, szWord );
if ( szEnd - szItem == wordLen ) {
@@ -93,10 +93,10 @@ struct warnSettingChangeInfo_t { char *szUnsafeSections;
char *szName;
char *szValue;
- int warnNoMore,cancel;
+ int warnNoMore, cancel;
};
-static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
static struct warnSettingChangeInfo_t *warnInfo;
@@ -108,17 +108,17 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg,UINT message,WPARAM wP TranslateDialogDefault(hwndDlg);
SetDlgItemText(hwndDlg, IDC_ININAME, warnInfo->szIniPath);
lstrcpyA(szSettingName, warnInfo->szSection);
- lstrcatA(szSettingName," / ");
- lstrcatA(szSettingName,warnInfo->szName);
- SetDlgItemTextA(hwndDlg,IDC_SETTINGNAME,szSettingName);
- SetDlgItemTextA(hwndDlg,IDC_NEWVALUE,warnInfo->szValue);
- if (IsInSpaceSeparatedList(warnInfo->szSection,warnInfo->szSafeSections))
+ lstrcatA(szSettingName, " / ");
+ lstrcatA(szSettingName, warnInfo->szName);
+ SetDlgItemTextA(hwndDlg, IDC_SETTINGNAME, szSettingName);
+ SetDlgItemTextA(hwndDlg, IDC_NEWVALUE, warnInfo->szValue);
+ if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szSafeSections))
pszSecurityInfo=LPGENT("This change is known to be safe.");
- else if (IsInSpaceSeparatedList(warnInfo->szSection,warnInfo->szUnsafeSections))
+ else if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szUnsafeSections))
pszSecurityInfo=LPGENT("This change is known to be potentially hazardous.");
else
pszSecurityInfo=LPGENT("This change is not known to be safe.");
- SetDlgItemText(hwndDlg,IDC_SECURITYINFO,TranslateTS(pszSecurityInfo));
+ SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
return TRUE;
}
case WM_COMMAND:
@@ -127,8 +127,8 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg,UINT message,WPARAM wP warnInfo->cancel=1;
case IDYES:
case IDNO:
- warnInfo->warnNoMore=IsDlgButtonChecked(hwndDlg,IDC_WARNNOMORE);
- EndDialog(hwndDlg,LOWORD(wParam));
+ warnInfo->warnNoMore=IsDlgButtonChecked(hwndDlg, IDC_WARNNOMORE);
+ EndDialog(hwndDlg, LOWORD(wParam));
break;
}
break;
@@ -136,22 +136,22 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg,UINT message,WPARAM wP return FALSE;
}
-static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg,IDC_ININAME,(TCHAR*)lParam);
- SetDlgItemText(hwndDlg,IDC_NEWNAME,(TCHAR*)lParam);
+ SetDlgItemText(hwndDlg, IDC_ININAME, (TCHAR*)lParam);
+ SetDlgItemText(hwndDlg, IDC_NEWNAME, (TCHAR*)lParam);
return TRUE;
case WM_COMMAND:
{ TCHAR szIniPath[MAX_PATH];
- GetDlgItemText(hwndDlg,IDC_ININAME,szIniPath,SIZEOF(szIniPath));
+ GetDlgItemText(hwndDlg, IDC_ININAME, szIniPath, SIZEOF(szIniPath));
switch(LOWORD(wParam)) {
case IDC_DELETE:
DeleteFile(szIniPath);
case IDC_LEAVE:
- EndDialog(hwndDlg,LOWORD(wParam));
+ EndDialog(hwndDlg, LOWORD(wParam));
break;
case IDC_RECYCLE:
{ SHFILEOPSTRUCT shfo={0};
@@ -161,14 +161,14 @@ static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg,UINT message,WPARAM wP shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
- EndDialog(hwndDlg,LOWORD(wParam));
+ EndDialog(hwndDlg, LOWORD(wParam));
break;
case IDC_MOVE:
{ TCHAR szNewPath[MAX_PATH];
- GetDlgItemText(hwndDlg,IDC_NEWNAME,szNewPath,SIZEOF(szNewPath));
- MoveFile(szIniPath,szNewPath);
+ GetDlgItemText(hwndDlg, IDC_NEWNAME, szNewPath, SIZEOF(szNewPath));
+ MoveFile(szIniPath, szNewPath);
}
- EndDialog(hwndDlg,LOWORD(wParam));
+ EndDialog(hwndDlg, LOWORD(wParam));
break;
}
break;
@@ -205,7 +205,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf while (!feof(fp)) {
char szLine[2048];
- if (fgets(szLine,sizeof(szLine),fp) == NULL)
+ if (fgets(szLine, sizeof(szLine), fp) == NULL)
break;
int lineLength = lstrlenA(szLine);
@@ -216,14 +216,14 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf continue;
if (szLine[0] == '[') {
- char *szEnd = strchr(szLine+1,']');
+ char *szEnd = strchr(szLine+1, ']');
if (szEnd == NULL)
continue;
if (szLine[1] == '!')
szSection[0] = '\0';
else {
- lstrcpynA(szSection,szLine+1,min(sizeof(szSection),(int)(szEnd-szLine)));
+ lstrcpynA(szSection, szLine+1, min(sizeof(szSection), (int)(szEnd-szLine)));
switch (secur) {
case 0:
warnThisSection = false;
@@ -246,10 +246,10 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf if (szLine[1] == '?') {
DBCONTACTENUMSETTINGS dbces;
dbces.pfnEnumProc=SettingsEnumProc;
- lstrcpynA(szSection,szLine+2,min(sizeof(szSection),(int)(szEnd-szLine-1)));
+ lstrcpynA(szSection, szLine+2, min(sizeof(szSection), (int)(szEnd-szLine-1)));
dbces.szModule=szSection;
dbces.ofsSettings=0;
- CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
+ CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
while (setting_items) {
SettingsList *next = setting_items->next;
@@ -269,12 +269,12 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf if (szSection[0] == '\0')
continue;
- char *szValue=strchr(szLine,'=');
+ char *szValue=strchr(szLine, '=');
if ( szValue == NULL )
continue;
char szName[128];
- lstrcpynA(szName,szLine,min(sizeof(szName),(int)(szValue-szLine+1)));
+ lstrcpynA(szName, szLine, min(sizeof(szName), (int)(szValue-szLine+1)));
szValue++;
{
warnSettingChangeInfo_t warnInfo;
@@ -286,7 +286,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf warnInfo.szValue=szValue;
warnInfo.warnNoMore=0;
warnInfo.cancel=0;
- if (warnThisSection && IDNO == DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(IDD_WARNINICHANGE),NULL,WarnIniChangeDlgProc,(LPARAM)&warnInfo))
+ if (warnThisSection && IDNO == DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_WARNINICHANGE), NULL, WarnIniChangeDlgProc, (LPARAM)&warnInfo))
continue;
if (warnInfo.cancel)
break;
@@ -297,26 +297,26 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf switch(szValue[0]) {
case 'b':
case 'B':
- DBWriteContactSettingByte(NULL,szSection,szName,(BYTE)strtol(szValue+1,NULL,0));
+ DBWriteContactSettingByte(NULL, szSection, szName, (BYTE)strtol(szValue+1, NULL, 0));
break;
case 'w':
case 'W':
- DBWriteContactSettingWord(NULL,szSection,szName,(WORD)strtol(szValue+1,NULL,0));
+ DBWriteContactSettingWord(NULL, szSection, szName, (WORD)strtol(szValue+1, NULL, 0));
break;
case 'd':
case 'D':
- DBWriteContactSettingDword(NULL,szSection,szName,(DWORD)strtoul(szValue+1,NULL,0));
+ DBWriteContactSettingDword(NULL, szSection, szName, (DWORD)strtoul(szValue+1, NULL, 0));
break;
case 'l':
case 'L':
- DBDeleteContactSetting(NULL,szSection,szName);
+ DBDeleteContactSetting(NULL, szSection, szName);
break;
case 'e':
case 'E':
ConvertBackslashes(szValue+1, LangPackGetDefaultCodePage());
case 's':
case 'S':
- DBWriteContactSettingString(NULL,szSection,szName,szValue+1);
+ DBWriteContactSettingString(NULL, szSection, szName, szValue+1);
break;
case 'g':
case 'G':
@@ -329,11 +329,11 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf case 'r': *pstr='\r'; break;
default: *pstr=pstr[1]; break;
}
- MoveMemory(pstr+1,pstr+2,lstrlenA(pstr+2)+1);
+ MoveMemory(pstr+1, pstr+2, lstrlenA(pstr+2)+1);
} } }
case 'u':
case 'U':
- DBWriteContactSettingStringUtf(NULL,szSection,szName,szValue+1);
+ DBWriteContactSettingStringUtf(NULL, szSection, szName, szValue+1);
break;
case 'n':
case 'h':
@@ -341,12 +341,12 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf case 'H':
{ PBYTE buf;
int len;
- char *pszValue,*pszEnd;
+ char *pszValue, *pszEnd;
DBCONTACTWRITESETTING cws;
buf=(PBYTE)mir_alloc(lstrlenA(szValue+1));
- for (len=0,pszValue=szValue+1;;len++) {
- buf[len]=(BYTE)strtol(pszValue,&pszEnd,0x10);
+ for (len=0, pszValue=szValue+1;;len++) {
+ buf[len]=(BYTE)strtol(pszValue, &pszEnd, 0x10);
if (pszValue == pszEnd) break;
pszValue=pszEnd;
}
@@ -355,12 +355,12 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf cws.value.type=DBVT_BLOB;
cws.value.pbVal=buf;
cws.value.cpbVal=len;
- CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)(HANDLE)NULL,(LPARAM)&cws);
+ CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cws);
mir_free(buf);
}
break;
default:
- MessageBox(NULL,TranslateT("Invalid setting type. The first character of every value must be b, w, d, l, s, e, u, g, h or n."),TranslateT("Install Database Settings"),MB_OK);
+ MessageBox(NULL, TranslateT("Invalid setting type. The first character of every value must be b, w, d, l, s, e, u, g, h or n."), TranslateT("Install Database Settings"), MB_OK);
break;
}
}
@@ -375,20 +375,20 @@ static void DoAutoExec(void) char *szSafeSections, *szUnsafeSections;
int secur;
- GetPrivateProfileString(_T("AutoExec"),_T("Use"),_T("prompt"),szUse,SIZEOF(szUse),mirandabootini);
- if (!lstrcmpi(szUse,_T("no"))) return;
- GetPrivateProfileString(_T("AutoExec"),_T("Safe"),_T("CLC Icons CLUI CList SkinSounds"),buf,SIZEOF(buf),mirandabootini);
+ GetPrivateProfileString(_T("AutoExec"), _T("Use"), _T("prompt"), szUse, SIZEOF(szUse), mirandabootini);
+ if (!lstrcmpi(szUse, _T("no"))) return;
+ GetPrivateProfileString(_T("AutoExec"), _T("Safe"), _T("CLC Icons CLUI CList SkinSounds"), buf, SIZEOF(buf), mirandabootini);
szSafeSections = mir_t2a(buf);
- GetPrivateProfileString(_T("AutoExec"),_T("Unsafe"),_T("ICQ MSN"),buf,SIZEOF(buf),mirandabootini);
+ GetPrivateProfileString(_T("AutoExec"), _T("Unsafe"), _T("ICQ MSN"), buf, SIZEOF(buf), mirandabootini);
szUnsafeSections = mir_t2a(buf);
- GetPrivateProfileString(_T("AutoExec"),_T("Warn"),_T("notsafe"),szSecurity,SIZEOF(szSecurity),mirandabootini);
- if (!lstrcmpi(szSecurity,_T("none"))) secur = 0;
- else if (!lstrcmpi(szSecurity,_T("notsafe"))) secur = 1;
- else if (!lstrcmpi(szSecurity,_T("onlyunsafe"))) secur = 2;
-
- GetPrivateProfileString(_T("AutoExec"),_T("OverrideSecurityFilename"),_T(""),szOverrideSecurityFilename,SIZEOF(szOverrideSecurityFilename),mirandabootini);
- GetPrivateProfileString(_T("AutoExec"),_T("OnCreateFilename"),_T(""),szOnCreateFilename,SIZEOF(szOnCreateFilename),mirandabootini);
- GetPrivateProfileString(_T("AutoExec"),_T("Glob"),_T("autoexec_*.ini"),szFindPath,SIZEOF(szFindPath),mirandabootini);
+ GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, SIZEOF(szSecurity), mirandabootini);
+ if (!lstrcmpi(szSecurity, _T("none"))) secur = 0;
+ else if (!lstrcmpi(szSecurity, _T("notsafe"))) secur = 1;
+ else if (!lstrcmpi(szSecurity, _T("onlyunsafe"))) secur = 2;
+
+ GetPrivateProfileString(_T("AutoExec"), _T("OverrideSecurityFilename"), _T(""), szOverrideSecurityFilename, SIZEOF(szOverrideSecurityFilename), mirandabootini);
+ GetPrivateProfileString(_T("AutoExec"), _T("OnCreateFilename"), _T(""), szOnCreateFilename, SIZEOF(szOnCreateFilename), mirandabootini);
+ GetPrivateProfileString(_T("AutoExec"), _T("Glob"), _T("autoexec_*.ini"), szFindPath, SIZEOF(szFindPath), mirandabootini);
if (dbCreated && szOnCreateFilename[0]) {
str2 = Utils_ReplaceVarsT(szOnCreateFilename);
@@ -415,11 +415,11 @@ static void DoAutoExec(void) else str2[1] = 0;
do {
- bool secFN = lstrcmpi(fd.cFileName,szOverrideSecurityFilename) == 0;
+ bool secFN = lstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0;
mir_sntprintf(szIniPath, SIZEOF(szIniPath), _T("%s%s"), szFindPath, fd.cFileName);
- if (!lstrcmpi(szUse,_T("prompt")) && !secFN) {
- int result=DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(IDD_INSTALLINI),NULL,InstallIniDlgProc,(LPARAM)szIniPath);
+ if (!lstrcmpi(szUse, _T("prompt")) && !secFN) {
+ int result=DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
if (result == IDC_NOTOALL) break;
if (result == IDCANCEL) continue;
}
@@ -430,10 +430,10 @@ static void DoAutoExec(void) DeleteFile(szIniPath);
else {
TCHAR szOnCompletion[8];
- GetPrivateProfileString(_T("AutoExec"),_T("OnCompletion"),_T("recycle"),szOnCompletion,SIZEOF(szOnCompletion),mirandabootini);
- if (!lstrcmpi(szOnCompletion,_T("delete")))
+ GetPrivateProfileString(_T("AutoExec"), _T("OnCompletion"), _T("recycle"), szOnCompletion, SIZEOF(szOnCompletion), mirandabootini);
+ if (!lstrcmpi(szOnCompletion, _T("delete")))
DeleteFile(szIniPath);
- else if (!lstrcmpi(szOnCompletion,_T("recycle"))) {
+ else if (!lstrcmpi(szOnCompletion, _T("recycle"))) {
SHFILEOPSTRUCT shfo={0};
shfo.wFunc=FO_DELETE;
shfo.pFrom=szIniPath;
@@ -441,17 +441,17 @@ static void DoAutoExec(void) shfo.fFlags=FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
- else if (!lstrcmpi(szOnCompletion,_T("rename"))) {
+ else if (!lstrcmpi(szOnCompletion, _T("rename"))) {
TCHAR szRenamePrefix[MAX_PATH];
TCHAR szNewPath[MAX_PATH];
- GetPrivateProfileString(_T("AutoExec"),_T("RenamePrefix"),_T("done_"),szRenamePrefix,SIZEOF(szRenamePrefix),mirandabootini);
- lstrcpy(szNewPath,szFindPath);
- lstrcat(szNewPath,szRenamePrefix);
- lstrcat(szNewPath,fd.cFileName);
- MoveFile(szIniPath,szNewPath);
+ GetPrivateProfileString(_T("AutoExec"), _T("RenamePrefix"), _T("done_"), szRenamePrefix, SIZEOF(szRenamePrefix), mirandabootini);
+ lstrcpy(szNewPath, szFindPath);
+ lstrcat(szNewPath, szRenamePrefix);
+ lstrcat(szNewPath, fd.cFileName);
+ MoveFile(szIniPath, szNewPath);
}
- else if (!lstrcmpi(szOnCompletion,_T("ask")))
- DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(IDD_INIIMPORTDONE),NULL,IniImportDoneDlgProc,(LPARAM)szIniPath);
+ else if (!lstrcmpi(szOnCompletion, _T("ask")))
+ DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_INIIMPORTDONE), NULL, IniImportDoneDlgProc, (LPARAM)szIniPath);
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -485,6 +485,6 @@ int InitIni(void) void UninitIni(void)
{
if ( !bModuleInitialized ) return;
- CallService(MS_SYSTEM_REMOVEWAIT,(WPARAM)hIniChangeNotification,0);
+ CallService(MS_SYSTEM_REMOVEWAIT, (WPARAM)hIniChangeNotification, 0);
FindCloseChangeNotification(hIniChangeNotification);
}
diff --git a/src/modules/database/dblists.cpp b/src/modules/database/dblists.cpp index 491a6ed33b..c4dabf8fae 100644 --- a/src/modules/database/dblists.cpp +++ b/src/modules/database/dblists.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/modules/database/dblists.h b/src/modules/database/dblists.h index 30886973a4..160e45eca3 100644 --- a/src/modules/database/dblists.h +++ b/src/modules/database/dblists.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -36,4 +36,4 @@ int List_InsertPtr( SortedList* list, void* p ); int List_RemovePtr( SortedList* list, void* p );
void List_Copy( SortedList*, SortedList*, size_t );
-void List_ObjCopy( SortedList*, SortedList*, size_t );
\ No newline at end of file +void List_ObjCopy( SortedList*, SortedList*, size_t );
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 7d644b02eb..6cbf8ca781 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -337,11 +337,11 @@ int InitUtils() CreateServiceFunction(MS_DB_MODULE_DELETE, DbDeleteModule);
- CreateServiceFunction(MS_DB_GETPROFILEPATH,GetProfilePath);
- CreateServiceFunction(MS_DB_GETPROFILENAME,GetProfileName);
+ CreateServiceFunction(MS_DB_GETPROFILEPATH, GetProfilePath);
+ CreateServiceFunction(MS_DB_GETPROFILENAME, GetProfileName);
#if defined( _UNICODE )
- CreateServiceFunction(MS_DB_GETPROFILEPATHW,GetProfilePathW);
- CreateServiceFunction(MS_DB_GETPROFILENAMEW,GetProfileNameW);
+ CreateServiceFunction(MS_DB_GETPROFILEPATHW, GetProfilePathW);
+ CreateServiceFunction(MS_DB_GETPROFILENAMEW, GetProfileNameW);
#endif
return 0;
}
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index b764a43ff3..cf1521872d 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -110,9 +110,9 @@ static LRESULT CALLBACK ProfileNameValidate(HWND edit, UINT msg, WPARAM wParam, if ( msg == WM_CHAR ) {
if ( _tcschr( _T(".?/\\#' "), (TCHAR)wParam) != 0 )
return 0;
- PostMessage(GetParent(edit),WM_INPUTCHANGED,0,0);
+ PostMessage(GetParent(edit), WM_INPUTCHANGED, 0, 0);
}
- return CallWindowProc((WNDPROC)GetWindowLongPtr(edit,GWLP_USERDATA),edit,msg,wParam,lParam);
+ return CallWindowProc((WNDPROC)GetWindowLongPtr(edit, GWLP_USERDATA), edit, msg, wParam, lParam);
}
static int FindDbProviders(const char*, DATABASELINK * dblink, LPARAM lParam)
@@ -121,7 +121,7 @@ static int FindDbProviders(const char*, DATABASELINK * dblink, LPARAM lParam) HWND hwndCombo = GetDlgItem(hwndDlg, IDC_PROFILEDRIVERS);
char szName[64];
- if ( dblink->getFriendlyName(szName,SIZEOF(szName),1) == 0 ) {
+ if ( dblink->getFriendlyName(szName, SIZEOF(szName), 1) == 0 ) {
// add to combo box
TCHAR* p = LangPackPcharToTchar( szName );
LRESULT index = SendMessage( hwndCombo, CB_ADDSTRING, 0, (LPARAM)p );
@@ -133,7 +133,7 @@ static int FindDbProviders(const char*, DATABASELINK * dblink, LPARAM lParam) static INT_PTR CALLBACK DlgProfileNew(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct DlgProfData * dat = (struct DlgProfData *)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ struct DlgProfData * dat = (struct DlgProfData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
@@ -143,7 +143,7 @@ static INT_PTR CALLBACK DlgProfileNew(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // fill in the db plugins present
PLUGIN_DB_ENUM dbe;
dbe.cbSize = sizeof(dbe);
- dbe.pfnEnumCallback = (int(*)(const char*,void*,LPARAM))FindDbProviders;
+ dbe.pfnEnumCallback = (int(*)(const char*, void*, LPARAM))FindDbProviders;
dbe.lParam = (LPARAM)hwndDlg;
if ( CallService( MS_PLUGINS_ENUMDBPLUGINS, 0, ( LPARAM )&dbe ) == -1 ) {
// no plugins?!
@@ -158,8 +158,8 @@ static INT_PTR CALLBACK DlgProfileNew(HWND hwndDlg, UINT msg, WPARAM wParam, LPA {
HWND hwndProfile = GetDlgItem(hwndDlg, IDC_PROFILENAME);
WNDPROC proc = (WNDPROC)GetWindowLongPtr(hwndProfile, GWLP_WNDPROC);
- SetWindowLongPtr(hwndProfile,GWLP_USERDATA,(LONG_PTR)proc);
- SetWindowLongPtr(hwndProfile,GWLP_WNDPROC,(LONG_PTR)ProfileNameValidate);
+ SetWindowLongPtr(hwndProfile, GWLP_USERDATA, (LONG_PTR)proc);
+ SetWindowLongPtr(hwndProfile, GWLP_WNDPROC, (LONG_PTR)ProfileNameValidate);
}
// decide if there is a default profile name given in the INI and if it should be used
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK DlgProfileNew(HWND hwndDlg, UINT msg, WPARAM wParam, LPA NMHDR* hdr = ( NMHDR* )lParam;
if ( hdr && hdr->code == PSN_APPLY && dat && IsWindowVisible( hwndDlg )) {
TCHAR szName[MAX_PATH];
- LRESULT curSel = SendDlgItemMessage(hwndDlg,IDC_PROFILEDRIVERS,CB_GETCURSEL,0,0);
+ LRESULT curSel = SendDlgItemMessage(hwndDlg, IDC_PROFILEDRIVERS, CB_GETCURSEL, 0, 0);
if ( curSel == CB_ERR ) break; // should never happen
GetDlgItemText(hwndDlg, IDC_PROFILENAME, szName, SIZEOF( szName ));
if ( szName[0] == 0 )
@@ -271,11 +271,11 @@ BOOL EnumProfilesForList(TCHAR * fullpath, TCHAR * profile, LPARAM lParam) if ( _tstat(fullpath, &statbuf) == 0) {
if ( statbuf.st_size > 1000000 ) {
- mir_sntprintf(sizeBuf,SIZEOF(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1048576.0 );
+ mir_sntprintf(sizeBuf, SIZEOF(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1048576.0 );
_tcscpy(sizeBuf+5, _T(" MB"));
}
else {
- mir_sntprintf(sizeBuf,SIZEOF(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1024.0 );
+ mir_sntprintf(sizeBuf, SIZEOF(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1024.0 );
_tcscpy(sizeBuf+5, _T(" KB"));
}
bFileExists = TRUE;
@@ -303,7 +303,7 @@ BOOL EnumProfilesForList(TCHAR * fullpath, TCHAR * profile, LPARAM lParam) item2.iItem = iItem;
dbe.cbSize = sizeof(dbe);
- dbe.pfnEnumCallback = (int(*)(const char*,void*,LPARAM))DetectDbProvider;
+ dbe.pfnEnumCallback = (int(*)(const char*, void*, LPARAM))DetectDbProvider;
dbe.lParam = (LPARAM)szPath;
_tcscpy(szPath, fullpath);
if ( CallService( MS_PLUGINS_ENUMDBPLUGINS, 0, ( LPARAM )&dbe ) == 1 ) {
@@ -406,7 +406,7 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, // LV will destroy the image list
SetWindowLongPtr(hwndList, GWL_STYLE, GetWindowLongPtr(hwndList, GWL_STYLE) | LVS_SORTASCENDING);
ListView_SetImageList(hwndList, hImgList, LVSIL_SMALL);
- ListView_SetExtendedListViewStyle(hwndList,
+ ListView_SetExtendedListViewStyle(hwndList,
ListView_GetExtendedListViewStyle(hwndList) | LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT);
// find all the profiles
@@ -545,8 +545,8 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, struct DlgProfData * prof = (struct DlgProfData *)lParam;
PROPSHEETHEADER *psh = prof->psh;
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDI_USERDETAILS),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0));
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDI_USERDETAILS),IMAGE_ICON,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON),0));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0));
dat = (struct DetailsData*)mir_alloc(sizeof(struct DetailsData));
dat->prof = prof;
prof->hwndOK = GetDlgItem( hwndDlg, IDOK );
@@ -571,7 +571,7 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, tci.mask = TCIF_TEXT;
for ( i=0; i < dat->pageCount; i++ ) {
- dat->opd[i].pTemplate = (DLGTEMPLATE *)LockResource(LoadResource(odp[i].hInstance,FindResourceA(odp[i].hInstance,odp[i].pszTemplate,MAKEINTRESOURCEA(5))));
+ dat->opd[i].pTemplate = (DLGTEMPLATE *)LockResource(LoadResource(odp[i].hInstance, FindResourceA(odp[i].hInstance, odp[i].pszTemplate, MAKEINTRESOURCEA(5))));
dat->opd[i].dlgProc = odp[i].pfnDlgProc;
dat->opd[i].hInst = odp[i].hInstance;
dat->opd[i].hwnd = NULL;
@@ -579,19 +579,19 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, tci.pszText = ( TCHAR* )odp[i].ptszTitle;
if (dat->prof->pd->noProfiles || shouldAutoCreate(dat->prof->pd->szProfile))
dat->currentPage = 1;
- TabCtrl_InsertItem( GetDlgItem(hwndDlg,IDC_TABS), i, &tci );
+ TabCtrl_InsertItem( GetDlgItem(hwndDlg, IDC_TABS), i, &tci );
} }
- GetWindowRect(GetDlgItem(hwndDlg,IDC_TABS),&dat->rcDisplay);
- TabCtrl_AdjustRect(GetDlgItem(hwndDlg,IDC_TABS),FALSE,&dat->rcDisplay);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_TABS), &dat->rcDisplay);
+ TabCtrl_AdjustRect(GetDlgItem(hwndDlg, IDC_TABS), FALSE, &dat->rcDisplay);
{
- POINT pt = {0,0};
+ POINT pt = {0, 0};
ClientToScreen( hwndDlg, &pt );
OffsetRect( &dat->rcDisplay, -pt.x, -pt.y );
}
TabCtrl_SetCurSel( GetDlgItem( hwndDlg, IDC_TABS ), dat->currentPage );
- dat->opd[dat->currentPage].hwnd = CreateDialogIndirectParam(dat->opd[dat->currentPage].hInst,dat->opd[dat->currentPage].pTemplate,hwndDlg,dat->opd[dat->currentPage].dlgProc,(LPARAM)dat->prof);
+ dat->opd[dat->currentPage].hwnd = CreateDialogIndirectParam(dat->opd[dat->currentPage].hInst, dat->opd[dat->currentPage].pTemplate, hwndDlg, dat->opd[dat->currentPage].dlgProc, (LPARAM)dat->prof);
ThemeDialogBackground( dat->opd[dat->currentPage].hwnd );
SetWindowPos( dat->opd[dat->currentPage].hwnd, HWND_TOP, dat->rcDisplay.left, dat->rcDisplay.top, 0, 0, SWP_NOSIZE );
{ PSHNOTIFY pshn;
@@ -649,7 +649,7 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, for ( i=0; i < dat->pageCount; i++ ) {
pshn.hdr.hwndFrom = dat->opd[i].hwnd;
if ( dat->opd[i].hwnd != NULL )
- SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
break;
}
@@ -675,20 +675,20 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, if ( dat->currentPage != -1 && dat->opd[dat->currentPage].hwnd != NULL )
ShowWindow( dat->opd[ dat->currentPage ].hwnd, SW_HIDE );
- dat->currentPage = TabCtrl_GetCurSel(GetDlgItem(hwndDlg,IDC_TABS));
+ dat->currentPage = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS));
if ( dat->currentPage != -1 ) {
if ( dat->opd[dat->currentPage].hwnd == NULL ) {
PSHNOTIFY pshn;
- dat->opd[dat->currentPage].hwnd=CreateDialogIndirectParam(dat->opd[dat->currentPage].hInst,dat->opd[dat->currentPage].pTemplate,hwndDlg,dat->opd[dat->currentPage].dlgProc,(LPARAM)dat->prof);
+ dat->opd[dat->currentPage].hwnd=CreateDialogIndirectParam(dat->opd[dat->currentPage].hInst, dat->opd[dat->currentPage].pTemplate, hwndDlg, dat->opd[dat->currentPage].dlgProc, (LPARAM)dat->prof);
ThemeDialogBackground(dat->opd[dat->currentPage].hwnd);
- SetWindowPos(dat->opd[dat->currentPage].hwnd,HWND_TOP,dat->rcDisplay.left,dat->rcDisplay.top,0,0,SWP_NOSIZE);
+ SetWindowPos(dat->opd[dat->currentPage].hwnd, HWND_TOP, dat->rcDisplay.left, dat->rcDisplay.top, 0, 0, SWP_NOSIZE);
pshn.hdr.code=PSN_INFOCHANGED;
pshn.hdr.hwndFrom=dat->opd[dat->currentPage].hwnd;
pshn.hdr.idFrom=0;
pshn.lParam=(LPARAM)0;
- SendMessage(dat->opd[dat->currentPage].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
- ShowWindow(dat->opd[dat->currentPage].hwnd,SW_SHOW);
+ ShowWindow(dat->opd[dat->currentPage].hwnd, SW_SHOW);
}
break;
}
@@ -707,9 +707,9 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, for (i=0;i<dat->pageCount;i++) {
if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
- EndDialog(hwndDlg,0);
+ EndDialog(hwndDlg, 0);
}
break;
@@ -748,14 +748,14 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, ShowWindow( dat->opd[dat->currentPage].hwnd, SW_SHOW );
return 0;
} }
- EndDialog(hwndDlg,1);
+ EndDialog(hwndDlg, 1);
break;
} }
break;
case WM_DESTROY:
{
- LRESULT curSel = SendDlgItemMessage(hwndDlg,IDC_SM_COMBO,CB_GETCURSEL,0,0);
+ LRESULT curSel = SendDlgItemMessage(hwndDlg, IDC_SM_COMBO, CB_GETCURSEL, 0, 0);
if ( curSel != CB_ERR ) {
int idx = SendDlgItemMessage( hwndDlg, IDC_SM_COMBO, CB_GETITEMDATA, ( WPARAM )curSel, 0 );
SetServiceModePlugin(idx);
@@ -833,7 +833,7 @@ int getProfileManager(PROFILEMANAGERDATA * pd) DlgProfData prof;
prof.pd = pd;
prof.psh = &psh;
- int rc = DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(IDD_PROFILEMANAGER),NULL,DlgProfileManager,(LPARAM)&prof);
+ int rc = DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_PROFILEMANAGER), NULL, DlgProfileManager, (LPARAM)&prof);
if ( rc != -1 )
for ( int i=0; i < opi.pageCount; i++ ) {
diff --git a/src/modules/database/profilemanager.h b/src/modules/database/profilemanager.h index fc6bd56020..f132dfad84 100644 --- a/src/modules/database/profilemanager.h +++ b/src/modules/database/profilemanager.h @@ -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.
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index 380e644228..d483844f9b 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -31,11 +31,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static HWND hwndFindAdd=NULL;
static HANDLE hHookModulesLoaded = 0;
static HANDLE hMainMenuItem = NULL;
-static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam);
+static int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam);
-static int FindAddDlgResizer(HWND,LPARAM lParam,UTILRESIZECONTROL *urc)
+static int FindAddDlgResizer(HWND, LPARAM lParam, UTILRESIZECONTROL *urc)
{
- static int y,nextY,oldTop;
+ static int y, nextY, oldTop;
struct FindAddDlgData *dat;
dat=(struct FindAddDlgData*)lParam;
@@ -58,19 +58,19 @@ static int FindAddDlgResizer(HWND,LPARAM lParam,UTILRESIZECONTROL *urc) oldTop=urc->rcItem.top;
y=nextY;
if (dat->showEmail) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
- OffsetRect(&urc->rcItem,0,y-oldTop);
+ OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_NAMEGROUP:
oldTop=urc->rcItem.top;
y=nextY;
if (dat->showName) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
- OffsetRect(&urc->rcItem,0,y-oldTop);
+ OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_ADVANCEDGROUP:
oldTop=urc->rcItem.top;
y=nextY;
if (dat->showAdvanced) nextY=y+urc->rcItem.bottom-urc->rcItem.top+7;
- OffsetRect(&urc->rcItem,0,y-oldTop);
+ OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_TINYEXTENDEDGROUP:
oldTop=urc->rcItem.top;
@@ -94,7 +94,7 @@ static int FindAddDlgResizer(HWND,LPARAM lParam,UTILRESIZECONTROL *urc) case IDC_BYADVANCED:
case IDC_BYCUSTOM:
case IDC_ADVANCED:
- OffsetRect(&urc->rcItem,0,y-oldTop);
+ OffsetRect(&urc->rcItem, 0, y-oldTop);
return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
case IDC_HEADERBAR:
return RD_ANCHORX_LEFT|RD_ANCHORY_TOP|RD_ANCHORX_WIDTH;
@@ -102,16 +102,16 @@ static int FindAddDlgResizer(HWND,LPARAM lParam,UTILRESIZECONTROL *urc) return RD_ANCHORX_LEFT|RD_ANCHORY_TOP;
}
-static void RenderThrobber(HDC hdc,RECT *rcItem,int *throbbing,int *pivot)
+static void RenderThrobber(HDC hdc, RECT *rcItem, int *throbbing, int *pivot)
{
HBRUSH hBr;
HDC hMemDC;
HBITMAP hBitmap;
HPEN hPen;
RECT rc;
- int x,width,height,height2;
+ int x, width, height, height2;
- InflateRect(rcItem,-1,0);
+ InflateRect(rcItem, -1, 0);
width=rcItem->right-rcItem->left;
height=rcItem->bottom-rcItem->top;
height2=height/2;
@@ -119,29 +119,29 @@ static void RenderThrobber(HDC hdc,RECT *rcItem,int *throbbing,int *pivot) if (*throbbing) {
/* create memdc */
hMemDC=CreateCompatibleDC(0);
- hBitmap=( HBITMAP )SelectObject(hMemDC, CreateCompatibleBitmap(hdc,width,height));
+ hBitmap=( HBITMAP )SelectObject(hMemDC, CreateCompatibleBitmap(hdc, width, height));
/* flush it */
rc.left=rc.top=0;
rc.right=width;
rc.bottom=height;
hBr=GetSysColorBrush(COLOR_BTNFACE);
- FillRect(hMemDC,&rc,hBr);
+ FillRect(hMemDC, &rc, hBr);
DeleteObject(hBr);
/* set up the pen */
- hPen=(HPEN)SelectObject(hMemDC,CreatePen(PS_SOLID,4,GetSysColor(COLOR_BTNSHADOW)));
+ hPen=(HPEN)SelectObject(hMemDC, CreatePen(PS_SOLID, 4, GetSysColor(COLOR_BTNSHADOW)));
/* draw everything before the pivot */
x=*pivot;
while (x>(-height)) {
- MoveToEx(hMemDC,x+height2,0,NULL);
- LineTo(hMemDC,x-height2,height);
+ MoveToEx(hMemDC, x+height2, 0, NULL);
+ LineTo(hMemDC, x-height2, height);
x-=12;
}
/* draw everything after the pivot */
x = *pivot;
while (x < width+height) {
- MoveToEx(hMemDC,x+height2,0,NULL);
- LineTo(hMemDC,x-height2,height);
+ MoveToEx(hMemDC, x+height2, 0, NULL);
+ LineTo(hMemDC, x-height2, height);
x+=12;
}
@@ -150,111 +150,111 @@ static void RenderThrobber(HDC hdc,RECT *rcItem,int *throbbing,int *pivot) /* reset the pivot point if it gets past the rect */
if (*pivot>width) *pivot=0;
/* put back the old pen and delete the new one */
- DeleteObject(SelectObject(hMemDC,hPen));
+ DeleteObject(SelectObject(hMemDC, hPen));
/* cap the top and bottom */
- hPen=(HPEN)SelectObject(hMemDC,CreatePen(PS_SOLID,1,GetSysColor(COLOR_BTNFACE)));
- MoveToEx(hMemDC,0,0,NULL);
- LineTo(hMemDC,width,0);
- MoveToEx(hMemDC,0,height-1,NULL);
- LineTo(hMemDC,width,height-1);
+ hPen=(HPEN)SelectObject(hMemDC, CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNFACE)));
+ MoveToEx(hMemDC, 0, 0, NULL);
+ LineTo(hMemDC, width, 0);
+ MoveToEx(hMemDC, 0, height-1, NULL);
+ LineTo(hMemDC, width, height-1);
/* select in the old pen and delete the new pen */
- DeleteObject(SelectObject(hMemDC,hPen));
+ DeleteObject(SelectObject(hMemDC, hPen));
/* paint to screen */
- BitBlt(hdc,rcItem->left,rcItem->top,width,height,hMemDC,0,0,SRCCOPY);
+ BitBlt(hdc, rcItem->left, rcItem->top, width, height, hMemDC, 0, 0, SRCCOPY);
/* select back in the old bitmap and delete the created one, as well as freeing the mem dc. */
- hBitmap=( HBITMAP )SelectObject(hMemDC,hBitmap);
+ hBitmap=( HBITMAP )SelectObject(hMemDC, hBitmap);
DeleteObject(hBitmap);
DeleteDC(hMemDC);
}
else {
/* just flush the DC */
hBr=GetSysColorBrush(COLOR_BTNFACE);
- FillRect(hdc,rcItem,hBr);
+ FillRect(hdc, rcItem, hBr);
DeleteObject(hBr);
} }
-static void StartThrobber(HWND hwndDlg,struct FindAddDlgData *dat)
+static void StartThrobber(HWND hwndDlg, struct FindAddDlgData *dat)
{
dat->throbbing=1;
- SetTimer(hwndDlg,TIMERID_THROBBER,25,NULL);
+ SetTimer(hwndDlg, TIMERID_THROBBER, 25, NULL);
}
-static void StopThrobber(HWND hwndDlg,struct FindAddDlgData *dat)
+static void StopThrobber(HWND hwndDlg, struct FindAddDlgData *dat)
{
- KillTimer(hwndDlg,TIMERID_THROBBER);
+ KillTimer(hwndDlg, TIMERID_THROBBER);
dat->throbbing=0;
dat->pivot=0;
- InvalidateRect(GetDlgItem(hwndDlg,IDC_STATUSBAR),NULL,FALSE);
+ InvalidateRect(GetDlgItem(hwndDlg, IDC_STATUSBAR), NULL, FALSE);
}
-static void ShowAdvancedSearchDlg(HWND hwndDlg,struct FindAddDlgData *dat)
+static void ShowAdvancedSearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
{
- char *szProto=(char*)SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCURSEL,0,0),0);
+ char *szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if (szProto == NULL) return;
if (dat->hwndAdvSearch == NULL) {
RECT rc;
- dat->hwndAdvSearch=(HWND)CallProtoService(szProto,PS_CREATEADVSEARCHUI,0,(LPARAM)hwndDlg);
- GetWindowRect(GetDlgItem(hwndDlg,IDC_RESULTS),&rc);
- SetWindowPos(dat->hwndAdvSearch,0,rc.left,rc.top,0,0,SWP_NOZORDER|SWP_NOSIZE);
+ dat->hwndAdvSearch=(HWND)CallProtoService(szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)hwndDlg);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_RESULTS), &rc);
+ SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
}
if (animateWindow) {
- animateWindow(dat->hwndAdvSearch,150,AW_ACTIVATE|AW_SLIDE|AW_HOR_POSITIVE);
- RedrawWindow(dat->hwndAdvSearch,NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
- } else ShowWindow(dat->hwndAdvSearch,SW_SHOW);
- CheckDlgButton(hwndDlg,IDC_ADVANCED,BST_CHECKED);
+ animateWindow(dat->hwndAdvSearch, 150, AW_ACTIVATE|AW_SLIDE|AW_HOR_POSITIVE);
+ RedrawWindow(dat->hwndAdvSearch, NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ } else ShowWindow(dat->hwndAdvSearch, SW_SHOW);
+ CheckDlgButton(hwndDlg, IDC_ADVANCED, BST_CHECKED);
}
-static void ReposTinySearchDlg(HWND hwndDlg,struct FindAddDlgData *dat)
+static void ReposTinySearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
{
if ( dat->hwndTinySearch != NULL ) {
RECT rc;
RECT clientRect;
- POINT pt={0,0};
- GetWindowRect(GetDlgItem(hwndDlg,IDC_TINYEXTENDEDGROUP),&rc);
- GetWindowRect(dat->hwndTinySearch,&clientRect);
+ POINT pt={0, 0};
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_TINYEXTENDEDGROUP), &rc);
+ GetWindowRect(dat->hwndTinySearch, &clientRect);
pt.x=rc.left;
pt.y=rc.top;
- ScreenToClient(hwndDlg,&pt);
- SetWindowPos(dat->hwndTinySearch,0,pt.x+5,pt.y+15,rc.right-rc.left-10,rc.bottom-rc.top-30,SWP_NOZORDER);
- //SetWindowPos(GetDlgItem(hwndDlg,IDC_TINYEXTENDEDGROUP),0,0,0,rc.right-rc.left,clientRect.bottom-clientRect.top+20,SWP_NOMOVE|SWP_NOZORDER);
+ ScreenToClient(hwndDlg, &pt);
+ SetWindowPos(dat->hwndTinySearch, 0, pt.x+5, pt.y+15, rc.right-rc.left-10, rc.bottom-rc.top-30, SWP_NOZORDER);
+ //SetWindowPos(GetDlgItem(hwndDlg, IDC_TINYEXTENDEDGROUP), 0, 0, 0, rc.right-rc.left, clientRect.bottom-clientRect.top+20, SWP_NOMOVE|SWP_NOZORDER);
} }
-static void ShowTinySearchDlg(HWND hwndDlg,struct FindAddDlgData *dat)
+static void ShowTinySearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
{
- char *szProto=(char*)SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCURSEL,0,0),0);
+ char *szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if (szProto == NULL) return;
if (dat->hwndTinySearch == NULL) {
- dat->hwndTinySearch=(HWND)CallProtoService(szProto,PS_CREATEADVSEARCHUI,0,(LPARAM)/*GetDlgItem(*/hwndDlg/*,IDC_TINYEXTENDEDGROUP)*/);
+ dat->hwndTinySearch=(HWND)CallProtoService(szProto, PS_CREATEADVSEARCHUI, 0, (LPARAM)/*GetDlgItem(*/hwndDlg/*, IDC_TINYEXTENDEDGROUP)*/);
if (dat->hwndTinySearch)
ReposTinySearchDlg(hwndDlg, dat);
else
dat->showTiny = false;
}
- ShowWindow(dat->hwndTinySearch,SW_SHOW);
+ ShowWindow(dat->hwndTinySearch, SW_SHOW);
}
-static void HideAdvancedSearchDlg(HWND hwndDlg,struct FindAddDlgData *dat)
+static void HideAdvancedSearchDlg(HWND hwndDlg, struct FindAddDlgData *dat)
{
if (dat->hwndAdvSearch == NULL) return;
if (animateWindow && IsWinVerXPPlus()) //blending is quite slow on win2k
- animateWindow(dat->hwndAdvSearch,150,AW_HIDE|AW_BLEND);
- else ShowWindow(dat->hwndAdvSearch,SW_HIDE);
- CheckDlgButton(hwndDlg,IDC_ADVANCED,BST_UNCHECKED);
+ animateWindow(dat->hwndAdvSearch, 150, AW_HIDE|AW_BLEND);
+ else ShowWindow(dat->hwndAdvSearch, SW_HIDE);
+ CheckDlgButton(hwndDlg, IDC_ADVANCED, BST_UNCHECKED);
}
-void EnableResultButtons(HWND hwndDlg,int enable)
+void EnableResultButtons(HWND hwndDlg, int enable)
{
- EnableWindow(GetDlgItem(hwndDlg,IDC_ADD), enable || IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID));
- EnableWindow(GetDlgItem(hwndDlg,IDC_MOREOPTIONS),enable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADD), enable || IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MOREOPTIONS), enable);
}
-static void CheckSearchTypeRadioButton(HWND hwndDlg,int idControl)
+static void CheckSearchTypeRadioButton(HWND hwndDlg, int idControl)
{
int i;
- static const int controls[]={IDC_BYPROTOID,IDC_BYEMAIL,IDC_BYNAME,IDC_BYADVANCED,IDC_BYCUSTOM};
+ static const int controls[]={IDC_BYPROTOID, IDC_BYEMAIL, IDC_BYNAME, IDC_BYADVANCED, IDC_BYCUSTOM};
for ( i=0; i < SIZEOF(controls); i++ )
- CheckDlgButton(hwndDlg,controls[i],idControl == controls[i]?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, controls[i], idControl == controls[i]?BST_CHECKED:BST_UNCHECKED);
}
#define sttErrMsg TranslateT("You haven't filled in the search field. Please enter a search term and try again.")
@@ -280,7 +280,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (msg) {
case WM_INITDIALOG:
{
- int i,netProtoCount;
+ int i, netProtoCount;
COMBOBOXEXITEM cbei;
HICON hIcon;
@@ -291,16 +291,16 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->notSearchedYet=1;
dat->iLastColumnSortIndex=1;
dat->bSortAscending=1;
- dat->hBmpSortUp=(HBITMAP)LoadImage(hMirandaInst,MAKEINTRESOURCE(IDB_SORTCOLUP),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS);
- dat->hBmpSortDown=(HBITMAP)LoadImage(hMirandaInst,MAKEINTRESOURCE(IDB_SORTCOLDOWN),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS);
- SendDlgItemMessage(hwndDlg,IDC_MOREOPTIONS,BUTTONSETARROW,1,0);
- ListView_SetExtendedListViewStyle(hwndList,LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP);
+ dat->hBmpSortUp=(HBITMAP)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDB_SORTCOLUP), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);
+ dat->hBmpSortDown=(HBITMAP)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDB_SORTCOLDOWN), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS);
+ SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0);
+ ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP);
{ LVCOLUMN lvc;
RECT rc;
LVITEM lvi;
- GetClientRect(hwndList,&rc);
+ GetClientRect(hwndList, &rc);
lvc.mask = LVCF_TEXT | LVCF_WIDTH;
lvc.pszText = TranslateT("Results");
lvc.cx = rc.right-1;
@@ -317,18 +317,18 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP SIZE textSize;
HDC hdc;
- hdc=GetDC(GetDlgItem(hwndDlg,IDC_STATUSBAR));
- SelectObject(hdc,(HFONT)SendDlgItemMessage(hwndDlg,IDC_STATUSBAR,WM_GETFONT,0,0));
- GetTextExtentPoint32(hdc,TranslateT("Searching"),lstrlen(TranslateT("Searching")),&textSize);
+ hdc=GetDC(GetDlgItem(hwndDlg, IDC_STATUSBAR));
+ SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, WM_GETFONT, 0, 0));
+ GetTextExtentPoint32(hdc, TranslateT("Searching"), lstrlen(TranslateT("Searching")), &textSize);
partWidth[0]=textSize.cx;
- GetTextExtentPoint32(hdc,_T("01234567890123456789"), 20, &textSize );
+ GetTextExtentPoint32(hdc, _T("01234567890123456789"), 20, &textSize );
partWidth[0]+=textSize.cx;
- ReleaseDC(GetDlgItem(hwndDlg,IDC_STATUSBAR),hdc);
+ ReleaseDC(GetDlgItem(hwndDlg, IDC_STATUSBAR), hdc);
partWidth[1]=partWidth[0]+150;
partWidth[2]=-1;
- SendDlgItemMessage(hwndDlg,IDC_STATUSBAR,SB_SETPARTS,SIZEOF(partWidth),(LPARAM)partWidth);
- SendDlgItemMessage(hwndDlg,IDC_STATUSBAR,SB_SETTEXT,1|SBT_OWNERDRAW,0);
- SetStatusBarSearchInfo(GetDlgItem(hwndDlg,IDC_STATUSBAR),dat);
+ SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETPARTS, SIZEOF(partWidth), (LPARAM)partWidth);
+ SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETTEXT, 1|SBT_OWNERDRAW, 0);
+ SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
}
{
TCHAR *szProto = NULL;
@@ -348,19 +348,19 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (caps & PF1_BASICSEARCH || caps & PF1_EXTSEARCH || caps & PF1_SEARCHBYEMAIL || caps & PF1_SEARCHBYNAME)
netProtoCount++;
}
- dat->himlComboIcons=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),(IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,netProtoCount+1,netProtoCount+1);
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CBEM_SETIMAGELIST,0,(LPARAM)dat->himlComboIcons);
+ dat->himlComboIcons=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, netProtoCount+1, netProtoCount+1);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_SETIMAGELIST, 0, (LPARAM)dat->himlComboIcons);
cbei.mask=CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_TEXT|CBEIF_LPARAM;
cbei.iItem=0;
hdc=GetDC(hwndDlg);
- SelectObject(hdc,(HFONT)SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,WM_GETFONT,0,0));
+ SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, WM_GETFONT, 0, 0));
if (netProtoCount>1) {
cbei.pszText=TranslateT("All Networks");
- GetTextExtentPoint32(hdc,cbei.pszText,lstrlen(cbei.pszText),&textSize);
+ GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
if (textSize.cx>cbwidth) cbwidth = textSize.cx;
cbei.iImage=cbei.iSelectedImage=ImageList_AddIcon_IconLibLoaded(dat->himlComboIcons, SKINICON_OTHER_SEARCHALL);
cbei.lParam=0;
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CBEM_INSERTITEM,0,(LPARAM)&cbei);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
cbei.iItem++;
}
for ( i=0; i < accounts.getCount(); i++ ) {
@@ -371,26 +371,26 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP continue;
cbei.pszText = pa->tszAccountName;
- GetTextExtentPoint32(hdc,cbei.pszText,lstrlen(cbei.pszText),&textSize);
+ GetTextExtentPoint32(hdc, cbei.pszText, lstrlen(cbei.pszText), &textSize);
if (textSize.cx>cbwidth) cbwidth = textSize.cx;
- hIcon=(HICON)CallProtoService( pa->szModuleName,PS_LOADICON,PLI_PROTOCOL|PLIF_SMALL,0);
- cbei.iImage=cbei.iSelectedImage=ImageList_AddIcon(dat->himlComboIcons,hIcon);
+ hIcon=(HICON)CallProtoService( pa->szModuleName, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ cbei.iImage=cbei.iSelectedImage=ImageList_AddIcon(dat->himlComboIcons, hIcon);
DestroyIcon(hIcon);
cbei.lParam=(LPARAM)pa->szModuleName;
- SendDlgItemMessageA(hwndDlg,IDC_PROTOLIST,CBEM_INSERTITEM,0,(LPARAM)&cbei);
+ SendDlgItemMessageA(hwndDlg, IDC_PROTOLIST, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
if (szProto && cbei.pszText && !lstrcmp( szProto, pa->tszAccountName ))
index = cbei.iItem;
cbei.iItem++;
}
cbwidth+=32;
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETDROPPEDCONTROLRECT,0,(LPARAM)&rect);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&rect);
if ((rect.right-rect.left)<cbwidth)
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_SETDROPPEDWIDTH,cbwidth,0);
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_SETCURSEL,index,0);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_SETDROPPEDWIDTH, cbwidth, 0);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_SETCURSEL, index, 0);
DBFreeVariant(&dbv); /* free string szProto was fetched with */
}
- SendMessage(hwndDlg,M_SETGROUPVISIBILITIES,0,0);
- Utils_RestoreWindowPosition(hwndDlg,NULL,"FindAdd","");
+ SendMessage(hwndDlg, M_SETGROUPVISIBILITIES, 0, 0);
+ Utils_RestoreWindowPosition(hwndDlg, NULL, "FindAdd", "");
return TRUE;
}
@@ -402,13 +402,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP urd.lpTemplate=MAKEINTRESOURCEA(IDD_FINDADD);
urd.lParam=(LPARAM)dat;
urd.pfnResizer=FindAddDlgResizer;
- CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd);
+ CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
ReposTinySearchDlg(hwndDlg, dat);
- SendDlgItemMessage(hwndDlg,IDC_STATUSBAR,WM_SIZE,0,0);
+ SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, WM_SIZE, 0, 0);
if (dat->notSearchedYet) {
RECT rc;
- GetClientRect(hwndList,&rc);
- ListView_SetColumnWidth(hwndList,0,rc.right);
+ GetClientRect(hwndList, &rc);
+ ListView_SetColumnWidth(hwndList, 0, rc.right);
}
}
//fall through
@@ -416,23 +416,23 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat && dat->hwndAdvSearch)
{
RECT rc;
- GetWindowRect(hwndList,&rc);
- SetWindowPos(dat->hwndAdvSearch,0,rc.left,rc.top,0,0,SWP_NOZORDER|SWP_NOSIZE);
+ GetWindowRect(hwndList, &rc);
+ SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
}
break;
case WM_GETMINMAXINFO:
{ MINMAXINFO *mmi=(MINMAXINFO*)lParam;
- RECT rc,rc2;
- GetWindowRect(hwndList,&rc);
- GetWindowRect(hwndDlg,&rc2);
+ RECT rc, rc2;
+ GetWindowRect(hwndList, &rc);
+ GetWindowRect(hwndDlg, &rc2);
mmi->ptMinTrackSize.x=rc.left-rc2.left+10+GetSystemMetrics(SM_CXFRAME);
- GetClientRect(GetDlgItem(hwndDlg,IDC_MOREOPTIONS),&rc);
+ GetClientRect(GetDlgItem(hwndDlg, IDC_MOREOPTIONS), &rc);
mmi->ptMinTrackSize.x+=rc.right+5;
- GetClientRect(GetDlgItem(hwndDlg,IDC_ADD),&rc);
+ GetClientRect(GetDlgItem(hwndDlg, IDC_ADD), &rc);
mmi->ptMinTrackSize.x+=rc.right+5;
- GetClientRect(GetDlgItem(hwndDlg,IDC_STATUSBAR),&rc);
+ GetClientRect(GetDlgItem(hwndDlg, IDC_STATUSBAR), &rc);
mmi->ptMinTrackSize.y=dat->minDlgHeight+20+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYFRAME);
- GetClientRect(GetDlgItem(hwndDlg,IDC_STATUSBAR),&rc);
+ GetClientRect(GetDlgItem(hwndDlg, IDC_STATUSBAR), &rc);
mmi->ptMinTrackSize.y+=rc.bottom;
return 0;
}
@@ -445,20 +445,20 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP int checkmarkVisible;
dat->showAdvanced = dat->showEmail = dat->showName = dat->showProtoId = dat->showTiny = 0;
- szProto=(char*)SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCURSEL,0,0),0);
+ szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if ( szProto == (char *)CB_ERR )
break;
if ( szProto == NULL ) {
for ( i=0; i < accounts.getCount(); i++ ) {
PROTOACCOUNT* pa = accounts[i];
if (!Proto_IsAccountEnabled(pa)) continue;
- protoCaps=(DWORD)CallProtoService(pa->szModuleName,PS_GETCAPS,PFLAGNUM_1,0);
+ protoCaps=(DWORD)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (protoCaps&PF1_SEARCHBYEMAIL) dat->showEmail=1;
if (protoCaps&PF1_SEARCHBYNAME) dat->showName=1;
}
}
else {
- protoCaps=(DWORD)CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0);
+ protoCaps=(DWORD)CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if (protoCaps&PF1_BASICSEARCH) dat->showProtoId=1;
if (protoCaps&PF1_SEARCHBYEMAIL) dat->showEmail=1;
if (protoCaps&PF1_SEARCHBYNAME) dat->showName=1;
@@ -467,19 +467,19 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (protoCaps&PF1_USERIDISEMAIL && dat->showProtoId) {dat->showProtoId=0; dat->showEmail=1;}
if (dat->showProtoId) {
char *szUniqueId;
- szUniqueId=(char*)CallProtoService(szProto,PS_GETCAPS,PFLAG_UNIQUEIDTEXT,0);
+ szUniqueId=(char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
if (szUniqueId) {
#if defined( _UNICODE )
TCHAR* p = mir_a2u(szUniqueId);
- SetDlgItemText(hwndDlg,IDC_BYPROTOID,p);
+ SetDlgItemText(hwndDlg, IDC_BYPROTOID, p);
mir_free(p);
#else
- SetDlgItemTextA(hwndDlg,IDC_BYPROTOID,szUniqueId);
+ SetDlgItemTextA(hwndDlg, IDC_BYPROTOID, szUniqueId);
#endif
}
- else SetDlgItemText(hwndDlg,IDC_BYPROTOID,TranslateT("Handle"));
- if (protoCaps&PF1_NUMERICUSERID) SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOID),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOID),GWL_STYLE)|ES_NUMBER);
- else SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOID),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOID),GWL_STYLE)&~ES_NUMBER);
+ else SetDlgItemText(hwndDlg, IDC_BYPROTOID, TranslateT("Handle"));
+ if (protoCaps&PF1_NUMERICUSERID) SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOID), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOID), GWL_STYLE)|ES_NUMBER);
+ else SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOID), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOID), GWL_STYLE)&~ES_NUMBER);
}
}
@@ -491,34 +491,34 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->hwndTinySearch=NULL;
} }
-#define en(id,t) ShowWindow(GetDlgItem(hwndDlg,IDC_##id),dat->show##t?SW_SHOW:SW_HIDE)
- en(PROTOIDGROUP,ProtoId); en(BYPROTOID,ProtoId); en(PROTOID,ProtoId);
- en(EMAILGROUP,Email); en(BYEMAIL,Email); en(EMAIL,Email);
- en(NAMEGROUP,Name); en(BYNAME,Name);
- en(STNAMENICK,Name); en(NAMENICK,Name);
- en(STNAMEFIRST,Name); en(NAMEFIRST,Name);
- en(STNAMELAST,Name); en(NAMELAST,Name);
- en(ADVANCEDGROUP,Advanced); en(BYADVANCED,Advanced); en(ADVANCED,Advanced);
+#define en(id, t) ShowWindow(GetDlgItem(hwndDlg, IDC_##id), dat->show##t?SW_SHOW:SW_HIDE)
+ en(PROTOIDGROUP, ProtoId); en(BYPROTOID, ProtoId); en(PROTOID, ProtoId);
+ en(EMAILGROUP, Email); en(BYEMAIL, Email); en(EMAIL, Email);
+ en(NAMEGROUP, Name); en(BYNAME, Name);
+ en(STNAMENICK, Name); en(NAMENICK, Name);
+ en(STNAMEFIRST, Name); en(NAMEFIRST, Name);
+ en(STNAMELAST, Name); en(NAMELAST, Name);
+ en(ADVANCEDGROUP, Advanced); en(BYADVANCED, Advanced); en(ADVANCED, Advanced);
en(BYCUSTOM, Tiny); en(TINYEXTENDEDGROUP, Tiny);
#undef en
- checkmarkVisible=(dat->showAdvanced && IsDlgButtonChecked(hwndDlg,IDC_BYADVANCED)) ||
- (dat->showEmail && IsDlgButtonChecked(hwndDlg,IDC_BYEMAIL)) ||
- (dat->showTiny && IsDlgButtonChecked(hwndDlg,IDC_BYCUSTOM)) ||
- (dat->showName && IsDlgButtonChecked(hwndDlg,IDC_BYNAME)) ||
- (dat->showProtoId && IsDlgButtonChecked(hwndDlg,IDC_BYPROTOID));
+ checkmarkVisible=(dat->showAdvanced && IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) ||
+ (dat->showEmail && IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) ||
+ (dat->showTiny && IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) ||
+ (dat->showName && IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) ||
+ (dat->showProtoId && IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID));
if (!checkmarkVisible) {
- if (dat->showProtoId) CheckSearchTypeRadioButton(hwndDlg,IDC_BYPROTOID);
- else if (dat->showEmail) CheckSearchTypeRadioButton(hwndDlg,IDC_BYEMAIL);
- else if (dat->showName) CheckSearchTypeRadioButton(hwndDlg,IDC_BYNAME);
- else if (dat->showAdvanced) CheckSearchTypeRadioButton(hwndDlg,IDC_BYADVANCED);
- else if (dat->showTiny) CheckSearchTypeRadioButton(hwndDlg,IDC_BYCUSTOM);
+ if (dat->showProtoId) CheckSearchTypeRadioButton(hwndDlg, IDC_BYPROTOID);
+ else if (dat->showEmail) CheckSearchTypeRadioButton(hwndDlg, IDC_BYEMAIL);
+ else if (dat->showName) CheckSearchTypeRadioButton(hwndDlg, IDC_BYNAME);
+ else if (dat->showAdvanced) CheckSearchTypeRadioButton(hwndDlg, IDC_BYADVANCED);
+ else if (dat->showTiny) CheckSearchTypeRadioButton(hwndDlg, IDC_BYCUSTOM);
}
- SendMessage(hwndDlg,WM_SIZE,0,0);
- SendMessage(hwndDlg,WM_GETMINMAXINFO,0,(LPARAM)&mmi);
- GetWindowRect(hwndDlg,&rc);
- if (rc.bottom-rc.top<mmi.ptMinTrackSize.y) SetWindowPos(hwndDlg,0,0,0,rc.right-rc.left,mmi.ptMinTrackSize.y,SWP_NOZORDER|SWP_NOMOVE);
+ SendMessage(hwndDlg, WM_SIZE, 0, 0);
+ SendMessage(hwndDlg, WM_GETMINMAXINFO, 0, (LPARAM)&mmi);
+ GetWindowRect(hwndDlg, &rc);
+ if (rc.bottom-rc.top<mmi.ptMinTrackSize.y) SetWindowPos(hwndDlg, 0, 0, 0, rc.right-rc.left, mmi.ptMinTrackSize.y, SWP_NOZORDER|SWP_NOMOVE);
break;
}
case WM_TIMER:
@@ -526,18 +526,18 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP RECT rc;
HDC hdc;
int borders[3];
- SendDlgItemMessage(hwndDlg,IDC_STATUSBAR,SB_GETBORDERS,0,(LPARAM)borders);
- SendDlgItemMessage(hwndDlg,IDC_STATUSBAR,SB_GETRECT,1,(LPARAM)&rc);
- InflateRect(&rc,-borders[2]/2,-borders[1]/2);
- hdc=GetDC(GetDlgItem(hwndDlg,IDC_STATUSBAR));
- RenderThrobber(hdc,&rc,&dat->throbbing,&dat->pivot);
- ReleaseDC(GetDlgItem(hwndDlg,IDC_STATUSBAR),hdc);
+ SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_GETBORDERS, 0, (LPARAM)borders);
+ SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_GETRECT, 1, (LPARAM)&rc);
+ InflateRect(&rc, -borders[2]/2, -borders[1]/2);
+ hdc=GetDC(GetDlgItem(hwndDlg, IDC_STATUSBAR));
+ RenderThrobber(hdc, &rc, &dat->throbbing, &dat->pivot);
+ ReleaseDC(GetDlgItem(hwndDlg, IDC_STATUSBAR), hdc);
}
break;
case WM_DRAWITEM:
{ DRAWITEMSTRUCT *dis=(DRAWITEMSTRUCT*)lParam;
if (dis->CtlID == IDC_STATUSBAR && dis->itemID == 1) {
- RenderThrobber(dis->hDC,&dis->rcItem,&dat->throbbing,&dat->pivot);
+ RenderThrobber(dis->hDC, &dis->rcItem, &dat->throbbing, &dat->pivot);
return TRUE;
}
break;
@@ -548,7 +548,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP case LVN_ITEMCHANGED:
{ int count=ListView_GetSelectedCount(hwndList);
if (dat->notSearchedYet) count=0;
- EnableResultButtons(hwndDlg,count);
+ EnableResultButtons(hwndDlg, count);
break;
}
case LVN_COLUMNCLICK:
@@ -558,7 +558,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP hdi.mask=HDI_BITMAP|HDI_FORMAT;
hdi.fmt=HDF_LEFT|HDF_STRING;
- Header_SetItem(ListView_GetHeader(hwndList),dat->iLastColumnSortIndex,&hdi);
+ Header_SetItem(ListView_GetHeader(hwndList), dat->iLastColumnSortIndex, &hdi);
if (nmlv->iSubItem != dat->iLastColumnSortIndex)
{
@@ -569,7 +569,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP hdi.fmt=HDF_LEFT|HDF_BITMAP|HDF_STRING|HDF_BITMAP_ON_RIGHT;
hdi.hbm=dat->bSortAscending?dat->hBmpSortDown:dat->hBmpSortUp;
- Header_SetItem(ListView_GetHeader(hwndList),dat->iLastColumnSortIndex,&hdi);
+ Header_SetItem(ListView_GetHeader(hwndList), dat->iLastColumnSortIndex, &hdi);
ListView_SortItemsEx(hwndList, SearchResultsCompareFunc, (LPARAM)hwndDlg);
}
@@ -581,7 +581,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch(LOWORD(wParam)) {
case IDC_PROTOLIST:
if (HIWORD(wParam) == CBN_SELCHANGE) {
- HideAdvancedSearchDlg(hwndDlg,dat);
+ HideAdvancedSearchDlg(hwndDlg, dat);
if (dat->hwndAdvSearch) {
DestroyWindow(dat->hwndAdvSearch);
dat->hwndAdvSearch=NULL;
@@ -590,107 +590,107 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP DestroyWindow(dat->hwndTinySearch);
dat->hwndTinySearch=NULL;
}
- SendMessage(hwndDlg,M_SETGROUPVISIBILITIES,0,0);
+ SendMessage(hwndDlg, M_SETGROUPVISIBILITIES, 0, 0);
}
break;
case IDC_BYPROTOID:
- EnableWindow(GetDlgItem(hwndDlg,IDC_ADD),TRUE);
- HideAdvancedSearchDlg(hwndDlg,dat);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADD), TRUE);
+ HideAdvancedSearchDlg(hwndDlg, dat);
break;
case IDC_BYEMAIL:
case IDC_BYNAME:
- EnableWindow(GetDlgItem(hwndDlg,IDC_ADD), ListView_GetSelectedCount(hwndList) > 0);
- HideAdvancedSearchDlg(hwndDlg,dat);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADD), ListView_GetSelectedCount(hwndList) > 0);
+ HideAdvancedSearchDlg(hwndDlg, dat);
break;
case IDC_PROTOID:
if (HIWORD(wParam) == EN_CHANGE) {
- HideAdvancedSearchDlg(hwndDlg,dat);
- CheckSearchTypeRadioButton(hwndDlg,IDC_BYPROTOID);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ADD),TRUE);
+ HideAdvancedSearchDlg(hwndDlg, dat);
+ CheckSearchTypeRadioButton(hwndDlg, IDC_BYPROTOID);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADD), TRUE);
}
break;
case IDC_EMAIL:
if (HIWORD(wParam) == EN_CHANGE) {
- HideAdvancedSearchDlg(hwndDlg,dat);
- CheckSearchTypeRadioButton(hwndDlg,IDC_BYEMAIL);
+ HideAdvancedSearchDlg(hwndDlg, dat);
+ CheckSearchTypeRadioButton(hwndDlg, IDC_BYEMAIL);
}
break;
case IDC_NAMENICK:
case IDC_NAMEFIRST:
case IDC_NAMELAST:
if (HIWORD(wParam) == EN_CHANGE) {
- HideAdvancedSearchDlg(hwndDlg,dat);
- CheckSearchTypeRadioButton(hwndDlg,IDC_BYNAME);
+ HideAdvancedSearchDlg(hwndDlg, dat);
+ CheckSearchTypeRadioButton(hwndDlg, IDC_BYNAME);
}
break;
case IDC_ADVANCED:
- EnableWindow(GetDlgItem(hwndDlg,IDC_ADD), ListView_GetSelectedCount(hwndList) > 0);
- if (IsDlgButtonChecked(hwndDlg,IDC_ADVANCED))
- ShowAdvancedSearchDlg(hwndDlg,dat);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADD), ListView_GetSelectedCount(hwndList) > 0);
+ if (IsDlgButtonChecked(hwndDlg, IDC_ADVANCED))
+ ShowAdvancedSearchDlg(hwndDlg, dat);
else
- HideAdvancedSearchDlg(hwndDlg,dat);
- CheckSearchTypeRadioButton(hwndDlg,IDC_BYADVANCED);
+ HideAdvancedSearchDlg(hwndDlg, dat);
+ CheckSearchTypeRadioButton(hwndDlg, IDC_BYADVANCED);
break;
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
case IDOK:
{
- HideAdvancedSearchDlg(hwndDlg,dat);
+ HideAdvancedSearchDlg(hwndDlg, dat);
if (dat->searchCount) { //cancel search
- SetDlgItemText(hwndDlg,IDOK,TranslateT("&Search"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("&Search"));
if (dat->hResultHook) {UnhookEvent(dat->hResultHook); dat->hResultHook=NULL;}
if (dat->search) {mir_free(dat->search); dat->search=NULL;}
dat->searchCount=0;
- StopThrobber(hwndDlg,dat);
- SetStatusBarSearchInfo(GetDlgItem(hwndDlg,IDC_STATUSBAR),dat);
+ StopThrobber(hwndDlg, dat);
+ SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
break;
}
- char *szProto=(char*)SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCURSEL,0,0),0);
+ char *szProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
if (dat->search) {mir_free(dat->search); dat->search=NULL;}
dat->searchCount=0;
- dat->hResultHook=HookEventMessage(ME_PROTO_ACK,hwndDlg,HM_SEARCHACK);
- if (IsDlgButtonChecked(hwndDlg,IDC_BYCUSTOM))
+ dat->hResultHook=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_SEARCHACK);
+ if (IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM))
{
- BeginSearch(hwndDlg,dat,szProto,PS_SEARCHBYADVANCED,PF1_EXTSEARCHUI,dat->hwndTinySearch);
+ BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYADVANCED, PF1_EXTSEARCHUI, dat->hwndTinySearch);
}
- else if (IsDlgButtonChecked(hwndDlg,IDC_BYPROTOID)) {
+ else if (IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID)) {
TCHAR str[256];
- GetDlgItemText(hwndDlg,IDC_PROTOID,str,SIZEOF(str));
+ GetDlgItemText(hwndDlg, IDC_PROTOID, str, SIZEOF(str));
rtrim(str);
if (str[0] == 0)
- MessageBox(hwndDlg,sttErrMsg,sttErrTitle,MB_OK);
+ MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_OK);
else
- BeginSearch(hwndDlg,dat,szProto,PS_BASICSEARCHT,PF1_BASICSEARCH,str);
+ BeginSearch(hwndDlg, dat, szProto, PS_BASICSEARCHT, PF1_BASICSEARCH, str);
}
- else if (IsDlgButtonChecked(hwndDlg,IDC_BYEMAIL)) {
+ else if (IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) {
TCHAR str[256];
- GetDlgItemText(hwndDlg,IDC_EMAIL,str,SIZEOF(str));
+ GetDlgItemText(hwndDlg, IDC_EMAIL, str, SIZEOF(str));
rtrim(str);
if (str[0] == 0)
- MessageBox(hwndDlg,sttErrMsg,sttErrTitle,MB_OK);
+ MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_OK);
else
- BeginSearch(hwndDlg,dat,szProto,PS_SEARCHBYEMAILT,PF1_SEARCHBYEMAIL,str);
+ BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYEMAILT, PF1_SEARCHBYEMAIL, str);
}
- else if (IsDlgButtonChecked(hwndDlg,IDC_BYNAME)) {
- TCHAR nick[256],first[256],last[256];
+ else if (IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) {
+ TCHAR nick[256], first[256], last[256];
PROTOSEARCHBYNAME psbn;
- GetDlgItemText(hwndDlg,IDC_NAMENICK,nick,SIZEOF(nick));
- GetDlgItemText(hwndDlg,IDC_NAMEFIRST,first,SIZEOF(first));
- GetDlgItemText(hwndDlg,IDC_NAMELAST,last,SIZEOF(last));
+ GetDlgItemText(hwndDlg, IDC_NAMENICK, nick, SIZEOF(nick));
+ GetDlgItemText(hwndDlg, IDC_NAMEFIRST, first, SIZEOF(first));
+ GetDlgItemText(hwndDlg, IDC_NAMELAST, last, SIZEOF(last));
psbn.pszFirstName = first;
psbn.pszLastName = last;
psbn.pszNick = nick;
if (nick[0] == 0 && first[0] == 0 && last[0] == 0)
- MessageBox(hwndDlg,sttErrMsg,sttErrTitle,MB_OK);
+ MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_OK);
else
- BeginSearch(hwndDlg,dat,szProto,PS_SEARCHBYNAMET,PF1_SEARCHBYNAME,&psbn);
+ BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYNAMET, PF1_SEARCHBYNAME, &psbn);
}
- else if (IsDlgButtonChecked(hwndDlg,IDC_BYADVANCED)) {
+ else if (IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) {
if (dat->hwndAdvSearch == NULL)
- MessageBox(hwndDlg,sttErrMsg,sttErrTitle,MB_OK);
+ MessageBox(hwndDlg, sttErrMsg, sttErrTitle, MB_OK);
else
- BeginSearch(hwndDlg,dat,szProto,PS_SEARCHBYADVANCED,PF1_EXTSEARCHUI,dat->hwndAdvSearch);
+ BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYADVANCED, PF1_EXTSEARCHUI, dat->hwndAdvSearch);
}
if (dat->searchCount == 0) {
@@ -701,10 +701,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->notSearchedYet=0;
FreeSearchResults(hwndList);
- CreateResultsColumns(hwndList,dat,szProto);
- SetStatusBarSearchInfo(GetDlgItem(hwndDlg,IDC_STATUSBAR),dat);
+ CreateResultsColumns(hwndList, dat, szProto);
+ SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
SetStatusBarResultInfo(hwndDlg);
- StartThrobber(hwndDlg,dat);
+ StartThrobber(hwndDlg, dat);
SetDlgItemText(hwndDlg, IDOK, TranslateT("Cancel"));
break;
}
@@ -734,7 +734,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP psr.id = str;
acs.psr = &psr;
- acs.szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA,
+ acs.szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA,
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
}
@@ -744,8 +744,8 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case IDC_MOREOPTIONS:
{ RECT rc;
- GetWindowRect(GetDlgItem(hwndDlg,IDC_MOREOPTIONS),&rc);
- ShowMoreOptionsMenu(hwndDlg,rc.left,rc.bottom);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_MOREOPTIONS), &rc);
+ ShowMoreOptionsMenu(hwndDlg, rc.left, rc.bottom);
break;
}
}
@@ -761,13 +761,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
lvhti.pt=pt;
- ScreenToClient(hwndDlg,&pt);
- switch(GetDlgCtrlID(ChildWindowFromPoint(hwndDlg,pt))) {
+ ScreenToClient(hwndDlg, &pt);
+ switch(GetDlgCtrlID(ChildWindowFromPoint(hwndDlg, pt))) {
case IDC_RESULTS:
if (dat->notSearchedYet) return TRUE;
- ScreenToClient(hwndList,&lvhti.pt);
- if (ListView_HitTest(hwndList,&lvhti) == -1) break;
- ShowMoreOptionsMenu(hwndDlg,(short)LOWORD(lParam),(short)HIWORD(lParam));
+ ScreenToClient(hwndList, &lvhti.pt);
+ if (ListView_HitTest(hwndList, &lvhti) == -1) break;
+ ShowMoreOptionsMenu(hwndDlg, (short)LOWORD(lParam), (short)HIWORD(lParam));
return TRUE;
}
break;
@@ -778,21 +778,21 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (ack->type != ACKTYPE_SEARCH) break;
for (i=0;i<dat->searchCount;i++)
- if (dat->search[i].hProcess == ack->hProcess && dat->search[i].hProcess != NULL && !lstrcmpA(dat->search[i].szProto,ack->szModule)) break;
+ if (dat->search[i].hProcess == ack->hProcess && dat->search[i].hProcess != NULL && !lstrcmpA(dat->search[i].szProto, ack->szModule)) break;
if (i == dat->searchCount) break;
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) {
dat->searchCount--;
- memmove(dat->search+i,dat->search+i+1,sizeof(struct ProtoSearchInfo)*(dat->searchCount-i));
+ memmove(dat->search+i, dat->search+i+1, sizeof(struct ProtoSearchInfo)*(dat->searchCount-i));
if (dat->searchCount == 0) {
mir_free(dat->search);
dat->search=NULL;
UnhookEvent(dat->hResultHook);
dat->hResultHook=NULL;
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Search"));
- StopThrobber(hwndDlg,dat);
+ StopThrobber(hwndDlg, dat);
}
ListView_SortItemsEx(hwndList, SearchResultsCompareFunc, (LPARAM)hwndDlg);
- SetStatusBarSearchInfo(GetDlgItem(hwndDlg,IDC_STATUSBAR),dat);
+ SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
}
else if (ack->result == ACKRESULT_SEARCHRESULT && ack->lParam) {
@@ -810,7 +810,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP FreeSearchResults(hwndList);
ListView_DeleteAllItems(hwndList); //not sure if previous delete list items too
//secondly remove all columns
- while (ListView_DeleteColumn(hwndList,1)); //will delete fist column till it possible
+ while (ListView_DeleteColumn(hwndList, 1)); //will delete fist column till it possible
//now will add columns and captions;
lvc.mask=LVCF_TEXT;
for (iColumn=0; iColumn<csr->nFieldCount; iColumn++)
@@ -827,7 +827,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP char *szComboProto;
COMBOBOXEXITEM cbei = {0};
- lsr = (struct ListSearchResult*)mir_alloc(offsetof(struct ListSearchResult,psr)+psr->cbSize);
+ lsr = (struct ListSearchResult*)mir_alloc(offsetof(struct ListSearchResult, psr)+psr->cbSize);
lsr->szProto = ack->szModule;
memcpy(&lsr->psr, psr, psr->cbSize);
@@ -857,11 +857,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
szComboProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0);
if (szComboProto == NULL) continue;
- if (!lstrcmpA(szComboProto,ack->szModule))
+ if (!lstrcmpA(szComboProto, ack->szModule))
{
cbei.mask = CBEIF_IMAGE;
cbei.iItem = i;
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CBEM_GETITEM,0,(LPARAM)&cbei);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_GETITEM, 0, (LPARAM)&cbei);
lvi.iImage = cbei.iImage;
}
}
@@ -878,13 +878,13 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else if (ack->result == ACKRESULT_DATA) {
LVITEM lvi={0};
- int i,col;
+ int i, col;
PROTOSEARCHRESULT *psr=(PROTOSEARCHRESULT*)ack->lParam;
struct ListSearchResult *lsr;
char *szComboProto;
COMBOBOXEXITEM cbei={0};
dat->bFlexSearchResult=FALSE;
- lsr=(struct ListSearchResult*)mir_alloc(offsetof(struct ListSearchResult,psr)+psr->cbSize);
+ lsr=(struct ListSearchResult*)mir_alloc(offsetof(struct ListSearchResult, psr)+psr->cbSize);
lsr->szProto=ack->szModule;
CopyMemory(&lsr->psr, psr, psr->cbSize);
@@ -897,14 +897,14 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lvi.mask = LVIF_PARAM|LVIF_IMAGE;
lvi.lParam=(LPARAM)lsr;
- for (i = SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCOUNT,0,0); i--; )
+ for (i = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCOUNT, 0, 0); i--; )
{
- szComboProto=(char*)SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETITEMDATA,i,0);
+ szComboProto=(char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0);
if (szComboProto == NULL) continue;
- if (!lstrcmpA(szComboProto,ack->szModule)) {
+ if (!lstrcmpA(szComboProto, ack->szModule)) {
cbei.mask=CBEIF_IMAGE;
cbei.iItem=i;
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CBEM_GETITEM,0,(LPARAM)&cbei);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_GETITEM, 0, (LPARAM)&cbei);
lvi.iImage=cbei.iImage;
break;
}
@@ -926,10 +926,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_DESTROY:
{
TCHAR *szProto;
- int len = SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETLBTEXTLEN,SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCURSEL,0,0),0);
+ int len = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
szProto = ( TCHAR* )alloca( sizeof(TCHAR)*( len+1 ));
*szProto='\0';
- SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETLBTEXT,SendDlgItemMessage(hwndDlg,IDC_PROTOLIST,CB_GETCURSEL,0,0),(LPARAM)szProto);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto);
DBWriteContactSettingTString(NULL, "FindAdd", "LastSearched", szProto?szProto:_T(""));
}
SaveColumnSizes(hwndList);
@@ -949,7 +949,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP DeleteObject(dat->hBmpSortUp);
mir_free(dat);
Window_FreeIcon_IcoLib(hwndDlg);
- Utils_SaveWindowPosition(hwndDlg,NULL,"FindAdd","");
+ Utils_SaveWindowPosition(hwndDlg, NULL, "FindAdd", "");
break;
}
@@ -959,7 +959,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP static INT_PTR FindAddCommand(WPARAM, LPARAM)
{
if (IsWindow(hwndFindAdd)) {
- ShowWindow(hwndFindAdd,SW_SHOWNORMAL);
+ ShowWindow(hwndFindAdd, SW_SHOWNORMAL);
SetForegroundWindow(hwndFindAdd);
SetFocus(hwndFindAdd);
}
@@ -995,10 +995,10 @@ int FindAddPreShutdown(WPARAM, LPARAM) int LoadFindAddModule(void)
{
- CreateServiceFunction(MS_FINDADD_FINDADD,FindAddCommand);
+ CreateServiceFunction(MS_FINDADD_FINDADD, FindAddCommand);
HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, OnSystemModulesLoaded);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,FindAddPreShutdown);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, FindAddPreShutdown);
CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
@@ -1007,7 +1007,7 @@ int LoadFindAddModule(void) mi.icolibItem = GetSkinIconHandle( SKINICON_OTHER_FINDUSER );
mi.pszName = LPGEN("&Find/Add Contacts...");
mi.pszService = MS_FINDADD_FINDADD;
- hMainMenuItem = ( HANDLE )CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ hMainMenuItem = Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/src/modules/findadd/findadd.h b/src/modules/findadd/findadd.h index 8e5fcb29e1..edd0c46bb9 100644 --- a/src/modules/findadd/findadd.h +++ b/src/modules/findadd/findadd.h @@ -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.
@@ -35,12 +35,12 @@ struct FindAddDlgData { int bSortAscending;
int iLastColumnSortIndex;
HIMAGELIST himlComboIcons;
- int showProtoId,showEmail,showName,showAdvanced,showTiny;
+ int showProtoId, showEmail, showName, showAdvanced, showTiny;
int minDlgHeight;
int notSearchedYet;
struct ProtoSearchInfo *search;
int searchCount;
- HBITMAP hBmpSortUp,hBmpSortDown;
+ HBITMAP hBmpSortUp, hBmpSortDown;
int throbbing;
int pivot;
HWND hwndAdvSearch;
@@ -50,10 +50,10 @@ struct FindAddDlgData { int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
void FreeSearchResults(HWND hwndResults);
-int BeginSearch(HWND hwndDlg,struct FindAddDlgData *dat,const char *szProto,const char *szSearchService,DWORD requiredCapability,void *pvSearchParams);
-void SetStatusBarSearchInfo(HWND hwndStatus,struct FindAddDlgData *dat);
+int BeginSearch(HWND hwndDlg, struct FindAddDlgData *dat, const char *szProto, const char *szSearchService, DWORD requiredCapability, void *pvSearchParams);
+void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat);
void SetStatusBarResultInfo(HWND hwndDlg);
-void CreateResultsColumns(HWND hwndResults,struct FindAddDlgData *dat,char *szProto);
-void EnableResultButtons(HWND hwndDlg,int enable);
-void ShowMoreOptionsMenu(HWND hwndDlg,int x,int y);
+void CreateResultsColumns(HWND hwndResults, struct FindAddDlgData *dat, char *szProto);
+void EnableResultButtons(HWND hwndDlg, int enable);
+void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y);
void SaveColumnSizes(HWND hwndResults);
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index cc3622609f..827fe920b0 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.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.
@@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "findadd.h"
enum {
- COLUMNID_PROTO,
- COLUMNID_HANDLE,
- COLUMNID_NICK,
- COLUMNID_FIRST,
- COLUMNID_LAST,
- COLUMNID_EMAIL,
+ COLUMNID_PROTO,
+ COLUMNID_HANDLE,
+ COLUMNID_NICK,
+ COLUMNID_FIRST,
+ COLUMNID_LAST,
+ COLUMNID_EMAIL,
NUM_COLUMNID
};
@@ -41,24 +41,24 @@ void SaveColumnSizes(HWND hwndResults) int i;
struct FindAddDlgData *dat;
- dat=(struct FindAddDlgData*)GetWindowLongPtr(GetParent(hwndResults),GWLP_USERDATA);
+ dat=(struct FindAddDlgData*)GetWindowLongPtr(GetParent(hwndResults), GWLP_USERDATA);
columnCount=Header_GetItemCount(ListView_GetHeader(hwndResults));
if (columnCount != NUM_COLUMNID) return;
- ListView_GetColumnOrderArray(hwndResults,columnCount,columnOrder);
+ ListView_GetColumnOrderArray(hwndResults, columnCount, columnOrder);
for (i=0; i < NUM_COLUMNID; i++) {
mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
- DBWriteContactSettingByte(NULL,"FindAdd",szSetting,(BYTE)columnOrder[i]);
+ DBWriteContactSettingByte(NULL, "FindAdd", szSetting, (BYTE)columnOrder[i]);
if (i>=columnCount) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
- DBWriteContactSettingWord(NULL,"FindAdd",szSetting,(WORD)ListView_GetColumnWidth(hwndResults,i));
+ DBWriteContactSettingWord(NULL, "FindAdd", szSetting, (WORD)ListView_GetColumnWidth(hwndResults, i));
}
- DBWriteContactSettingByte(NULL,"FindAdd","SortColumn",(BYTE)dat->iLastColumnSortIndex);
- DBWriteContactSettingByte(NULL,"FindAdd","SortAscending",(BYTE)dat->bSortAscending);
+ DBWriteContactSettingByte(NULL, "FindAdd", "SortColumn", (BYTE)dat->iLastColumnSortIndex);
+ DBWriteContactSettingByte(NULL, "FindAdd", "SortAscending", (BYTE)dat->bSortAscending);
}
static const TCHAR *szColumnNames[] = { NULL, NULL, _T("Nick"), _T("First Name"), _T("Last Name"), _T("E-mail") };
-static int defaultColumnSizes[]={0,90,100,100,100,2000};
-void LoadColumnSizes(HWND hwndResults,const char *szProto)
+static int defaultColumnSizes[]={0, 90, 100, 100, 100, 2000};
+void LoadColumnSizes(HWND hwndResults, const char *szProto)
{
HDITEM hdi;
int columnOrder[NUM_COLUMNID];
@@ -88,9 +88,9 @@ void LoadColumnSizes(HWND hwndResults,const char *szProto) {
#if defined( _UNICODE )
bNeedsFree = TRUE;
- lvc.pszText = mir_a2t((char*)CallProtoService(szProto,PS_GETCAPS,PFLAG_UNIQUEIDTEXT,0));
+ lvc.pszText = mir_a2t((char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0));
#else
- lvc.pszText = (char*)CallProtoService(szProto,PS_GETCAPS,PFLAG_UNIQUEIDTEXT,0);
+ lvc.pszText = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
#endif
}
else
@@ -128,7 +128,7 @@ static LPARAM ListView_GetItemLParam(HWND hwndList, int idx) LVITEM lv;
lv.iItem = idx;
lv.mask = LVIF_PARAM;
- ListView_GetItem(hwndList,&lv);
+ ListView_GetItem(hwndList, &lv);
return lv.lParam;
}
@@ -168,8 +168,8 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa {
TCHAR szText1[100];
TCHAR szText2[100];
- ListView_GetItemText(hList,(int)lParam1,sortCol,szText1,SIZEOF(szText1));
- ListView_GetItemText(hList,(int)lParam2,sortCol,szText2,SIZEOF(szText2));
+ ListView_GetItemText(hList, (int)lParam1, sortCol, szText1, SIZEOF(szText1));
+ ListView_GetItemText(hList, (int)lParam2, sortCol, szText2, SIZEOF(szText2));
return _tcsicmp(szText1, szText2)*sortMultiplier;
}
return 0;
@@ -181,7 +181,7 @@ void FreeSearchResults(HWND hwndResults) struct ListSearchResult *lsr;
for (lvi.iItem=ListView_GetItemCount(hwndResults)-1;lvi.iItem>=0;lvi.iItem--) {
lvi.mask=LVIF_PARAM;
- ListView_GetItem(hwndResults,&lvi);
+ ListView_GetItem(hwndResults, &lvi);
lsr=(struct ListSearchResult*)lvi.lParam;
if (lsr == NULL) continue;
mir_free(lsr->psr.id);
@@ -192,7 +192,7 @@ void FreeSearchResults(HWND hwndResults) mir_free(lsr);
}
ListView_DeleteAllItems(hwndResults);
- EnableResultButtons(GetParent(hwndResults),0);
+ EnableResultButtons(GetParent(hwndResults), 0);
}
// on its own thread
@@ -201,16 +201,16 @@ static void BeginSearchFailed(void * arg) TCHAR buf[128];
if ( arg != NULL ) {
const TCHAR* protoName = (TCHAR*)arg;
- mir_sntprintf(buf,SIZEOF(buf),
- TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
- protoName,protoName);
+ mir_sntprintf(buf, SIZEOF(buf),
+ TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
+ protoName, protoName);
mir_free((char*)arg);
}
- else lstrcpyn(buf,TranslateT("Could not search on any of the protocols, are you online?"),SIZEOF(buf));
- MessageBox(0,buf,TranslateT("Problem with search"),MB_OK | MB_ICONERROR);
+ else lstrcpyn(buf, TranslateT("Could not search on any of the protocols, are you online?"), SIZEOF(buf));
+ MessageBox(0, buf, TranslateT("Problem with search"), MB_OK | MB_ICONERROR);
}
-int BeginSearch(HWND,struct FindAddDlgData *dat,const char *szProto,const char *szSearchService,DWORD requiredCapability,void *pvSearchParams)
+int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const char *szSearchService, DWORD requiredCapability, void *pvSearchParams)
{
int i;
if ( szProto == NULL ) {
@@ -220,9 +220,9 @@ int BeginSearch(HWND,struct FindAddDlgData *dat,const char *szProto,const char * for ( i=0; i < accounts.getCount();i++) {
PROTOACCOUNT* pa = accounts[i];
if (!Proto_IsAccountEnabled(pa)) continue;
- DWORD caps=(DWORD)CallProtoService(pa->szModuleName,PS_GETCAPS,PFLAGNUM_1,0);
+ DWORD caps=(DWORD)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (!(caps&requiredCapability)) continue;
- dat->search[dat->searchCount].hProcess = (HANDLE)CallProtoService(pa->szModuleName,szSearchService,0,(LPARAM)pvSearchParams);
+ dat->search[dat->searchCount].hProcess = (HANDLE)CallProtoService(pa->szModuleName, szSearchService, 0, (LPARAM)pvSearchParams);
dat->search[dat->searchCount].szProto = pa->szModuleName;
if ( dat->search[dat->searchCount].hProcess == NULL ) failures++;
else dat->searchCount++;
@@ -230,7 +230,7 @@ int BeginSearch(HWND,struct FindAddDlgData *dat,const char *szProto,const char * if (failures) {
//infuriatingly vague error message. fixme.
if (dat->searchCount == 0) {
- forkthread(BeginSearchFailed,0,NULL);
+ forkthread(BeginSearchFailed, 0, NULL);
mir_free(dat->search);
dat->search=NULL;
return 1;
@@ -239,7 +239,7 @@ int BeginSearch(HWND,struct FindAddDlgData *dat,const char *szProto,const char * else {
dat->search=(struct ProtoSearchInfo*)mir_alloc(sizeof(struct ProtoSearchInfo));
dat->searchCount=1;
- dat->search[0].hProcess=(HANDLE)CallProtoService(szProto,szSearchService,0,(LPARAM)pvSearchParams);
+ dat->search[0].hProcess=(HANDLE)CallProtoService(szProto, szSearchService, 0, (LPARAM)pvSearchParams);
dat->search[0].szProto=szProto;
if (dat->search[0].hProcess == NULL) {
//infuriatingly vague error message. fixme.
@@ -255,7 +255,7 @@ int BeginSearch(HWND,struct FindAddDlgData *dat,const char *szProto,const char * }
// !!!!!!!! this code is dangerous like a hell
-void SetStatusBarSearchInfo(HWND hwndStatus,struct FindAddDlgData *dat)
+void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat)
{
TCHAR str[256];
@@ -268,7 +268,7 @@ void SetStatusBarSearchInfo(HWND hwndStatus,struct FindAddDlgData *dat) if ( !pa )
continue;
- lstrcat(str, i ? _T(",") : _T( " " ));
+ lstrcat(str, i ? _T(", ") : _T( " " ));
lstrcat(str, pa->tszAccountName );
} }
else lstrcpy(str, TranslateT("Idle"));
@@ -282,19 +282,19 @@ struct ProtoResultsSummary { };
void SetStatusBarResultInfo(HWND hwndDlg)
{
- HWND hwndStatus=GetDlgItem(hwndDlg,IDC_STATUSBAR);
- HWND hwndResults=GetDlgItem(hwndDlg,IDC_RESULTS);
+ HWND hwndStatus=GetDlgItem(hwndDlg, IDC_STATUSBAR);
+ HWND hwndResults=GetDlgItem(hwndDlg, IDC_RESULTS);
LV_ITEM lvi;
struct ListSearchResult *lsr;
struct ProtoResultsSummary *subtotal=NULL;
int subtotalCount=0;
- int i,total;
+ int i, total;
TCHAR str[256];
total=ListView_GetItemCount(hwndResults);
for (lvi.iItem=total-1;lvi.iItem>=0;lvi.iItem--) {
lvi.mask=LVIF_PARAM;
- ListView_GetItem(hwndResults,&lvi);
+ ListView_GetItem(hwndResults, &lvi);
lsr=(struct ListSearchResult*)lvi.lParam;
if (lsr == NULL) continue;
for (i=0;i<subtotalCount;i++) {
@@ -304,7 +304,7 @@ void SetStatusBarResultInfo(HWND hwndDlg) }
}
if (i == subtotalCount) {
- subtotal=(struct ProtoResultsSummary*)mir_realloc(subtotal,sizeof(struct ProtoResultsSummary)*(subtotalCount+1));
+ subtotal=(struct ProtoResultsSummary*)mir_realloc(subtotal, sizeof(struct ProtoResultsSummary)*(subtotalCount+1));
subtotal[subtotalCount].szProto=lsr->szProto;
subtotal[subtotalCount++].count=1;
}
@@ -320,7 +320,7 @@ void SetStatusBarResultInfo(HWND hwndDlg) else mir_sntprintf( str, SIZEOF(str), TranslateT("%d %s users found"), total, pa->tszAccountName );
}
else {
- mir_sntprintf( str, SIZEOF(str), TranslateT("%d users found ("),total);
+ mir_sntprintf( str, SIZEOF(str), TranslateT("%d users found ("), total);
for ( i=0; i < subtotalCount; i++ ) {
if ( i ) {
if (( pa = Proto_GetAccount( subtotal[i].szProto )) == NULL )
@@ -338,35 +338,35 @@ void SetStatusBarResultInfo(HWND hwndDlg) SendMessage(hwndStatus, SB_SETTEXT, 2, (LPARAM)str );
}
-void CreateResultsColumns(HWND hwndResults,struct FindAddDlgData *dat,char *szProto)
+void CreateResultsColumns(HWND hwndResults, struct FindAddDlgData *dat, char *szProto)
{
SaveColumnSizes(hwndResults);
- while (ListView_DeleteColumn(hwndResults,0));
- ListView_SetImageList(hwndResults,dat->himlComboIcons,LVSIL_SMALL);
- LoadColumnSizes(hwndResults,szProto);
+ while (ListView_DeleteColumn(hwndResults, 0));
+ ListView_SetImageList(hwndResults, dat->himlComboIcons, LVSIL_SMALL);
+ LoadColumnSizes(hwndResults, szProto);
}
-void ShowMoreOptionsMenu(HWND hwndDlg,int x,int y)
+void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y)
{
struct FindAddDlgData *dat;
- HMENU hPopupMenu,hMenu;
+ HMENU hPopupMenu, hMenu;
int commandId;
struct ListSearchResult *lsr;
- dat=(struct FindAddDlgData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ dat=(struct FindAddDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
{ LVITEM lvi;
- if (ListView_GetSelectedCount(GetDlgItem(hwndDlg,IDC_RESULTS)) != 1) return;
+ if (ListView_GetSelectedCount(GetDlgItem(hwndDlg, IDC_RESULTS)) != 1) return;
lvi.mask=LVIF_PARAM;
- lvi.iItem=ListView_GetNextItem(GetDlgItem(hwndDlg,IDC_RESULTS),-1,LVNI_ALL|LVNI_SELECTED);
- ListView_GetItem(GetDlgItem(hwndDlg,IDC_RESULTS),&lvi);
+ lvi.iItem=ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_RESULTS), -1, LVNI_ALL|LVNI_SELECTED);
+ ListView_GetItem(GetDlgItem(hwndDlg, IDC_RESULTS), &lvi);
lsr=(struct ListSearchResult*)lvi.lParam;
}
- hMenu=LoadMenu(hMirandaInst,MAKEINTRESOURCE(IDR_CONTEXT));
- hPopupMenu=GetSubMenu(hMenu,4);
- CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)hPopupMenu,0);
- commandId=TrackPopupMenu(hPopupMenu,TPM_RIGHTBUTTON|TPM_RETURNCMD,x,y,0,hwndDlg,NULL);
+ hMenu=LoadMenu(hMirandaInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ hPopupMenu=GetSubMenu(hMenu, 4);
+ CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hPopupMenu, 0);
+ commandId=TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON|TPM_RETURNCMD, x, y, 0, hwndDlg, NULL);
switch(commandId) {
case IDC_ADD:
{ ADDCONTACTSTRUCT acs;
@@ -375,19 +375,19 @@ void ShowMoreOptionsMenu(HWND hwndDlg,int x,int y) acs.handleType=HANDLE_SEARCHRESULT;
acs.szProto=lsr->szProto;
acs.psr=&lsr->psr;
- CallService(MS_ADDCONTACT_SHOW,(WPARAM)hwndDlg,(LPARAM)&acs);
+ CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
break;
}
case IDC_DETAILS:
{ HANDLE hContact;
- hContact=(HANDLE)CallProtoService(lsr->szProto,PS_ADDTOLIST,PALF_TEMPORARY,(LPARAM)&lsr->psr);
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)hContact,0);
+ hContact=(HANDLE)CallProtoService(lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
break;
}
case IDC_SENDMESSAGE:
{ HANDLE hContact;
- hContact=(HANDLE)CallProtoService(lsr->szProto,PS_ADDTOLIST,PALF_TEMPORARY,(LPARAM)&lsr->psr);
- CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,(LPARAM)(const char*)NULL);
+ hContact=(HANDLE)CallProtoService(lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
+ CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, (LPARAM)(const char*)NULL);
break;
}
}
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 961c598c3b..12291fb933 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -486,47 +486,47 @@ static INT_PTR CALLBACK ChooseEffectDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wPa int i;
TCHAR * ModernEffectNames[]=
{
- _T("<none>"),
- _T("Shadow at left"),
- _T("Shadow at right"),
- _T("Outline"),
- _T("Outline smooth"),
- _T("Smooth bump"),
- _T("Contour thin"),
- _T("Contour heavy"),
+ _T("<none>"),
+ _T("Shadow at left"),
+ _T("Shadow at right"),
+ _T("Outline"),
+ _T("Outline smooth"),
+ _T("Smooth bump"),
+ _T("Contour thin"),
+ _T("Contour heavy"),
};
for ( i=0; i<SIZEOF(ModernEffectNames) ; i++ )
{
- int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING,0,(LPARAM)TranslateTS(ModernEffectNames[i]));
+ int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(ModernEffectNames[i]));
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETITEMDATA, itemid, i );
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, 0, 0 );
}
int cnt=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETCOUNT, 0, 0 );
for ( i = 0; i < cnt; i++ ) {
- if (SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_GETITEMDATA,i,0) == pEffect->effectIndex ) {
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_SETCURSEL, i, 0 );
+ if (SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0) == pEffect->effectIndex ) {
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, i, 0 );
break;
} } }
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR1,CPM_SETCOLOUR,0,pEffect->baseColour&0x00FFFFFF);
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR2,CPM_SETCOLOUR,0,pEffect->secondaryColour&0x00FFFFFF);
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR1, CPM_SETCOLOUR, 0, pEffect->baseColour&0x00FFFFFF);
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR2, CPM_SETCOLOUR, 0, pEffect->secondaryColour&0x00FFFFFF);
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN1,UDM_SETRANGE,0,MAKELONG(255,0));
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN2,UDM_SETRANGE,0,MAKELONG(255,0));
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN1,UDM_SETPOS,0,MAKELONG((BYTE)~((BYTE)((pEffect->baseColour&0xFF000000)>>24)),0));
- SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN2,UDM_SETPOS,0,MAKELONG((BYTE)~((BYTE)((pEffect->secondaryColour&0xFF000000)>>24)),0));
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_SETRANGE, 0, MAKELONG(255, 0));
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_SETRANGE, 0, MAKELONG(255, 0));
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_SETPOS, 0, MAKELONG((BYTE)~((BYTE)((pEffect->baseColour&0xFF000000)>>24)), 0));
+ SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_SETPOS, 0, MAKELONG((BYTE)~((BYTE)((pEffect->secondaryColour&0xFF000000)>>24)), 0));
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
{
- int i = SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_GETCURSEL, 0, 0 );
- pEffect->effectIndex=(BYTE)SendDlgItemMessage(hwndDlg,IDC_EFFECT_COMBO,CB_GETITEMDATA,i,0);
- pEffect->baseColour=SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR1,CPM_GETCOLOUR,0,0)|((~(BYTE)SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN1,UDM_GETPOS,0,0))<<24);
- pEffect->secondaryColour=SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR2,CPM_GETCOLOUR,0,0)|((~(BYTE)SendDlgItemMessage(hwndDlg,IDC_EFFECT_COLOUR_SPIN2,UDM_GETPOS,0,0))<<24);;
+ int i = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETCURSEL, 0, 0 );
+ pEffect->effectIndex=(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_GETITEMDATA, i, 0);
+ pEffect->baseColour=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR1, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN1, UDM_GETPOS, 0, 0))<<24);
+ pEffect->secondaryColour=SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR2, CPM_GETCOLOUR, 0, 0)|((~(BYTE)SendDlgItemMessage(hwndDlg, IDC_EFFECT_COLOUR_SPIN2, UDM_GETPOS, 0, 0))<<24);;
}
EndDialog( hwndDlg, IDOK );
return TRUE;
@@ -879,10 +879,10 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, hbrBack = CreateBrushIndirect(&lb);
}
- SetRect(&rc,
- dis->rcItem.left+FSUI_COLORBOXLEFT,
- dis->rcItem.top+FSUI_FONTFRAMEVERT,
- dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH,
+ SetRect(&rc,
+ dis->rcItem.left+FSUI_COLORBOXLEFT,
+ dis->rcItem.top+FSUI_FONTFRAMEVERT,
+ dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH,
dis->rcItem.bottom-FSUI_FONTFRAMEVERT);
FillRect(dis->hDC, &rc, hbrBack);
@@ -910,10 +910,10 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, {
RECT rc;
HBRUSH hbrTmp;
- SetRect(&rc,
- dis->rcItem.left+FSUI_COLORBOXLEFT,
- dis->rcItem.top+FSUI_FONTFRAMEVERT,
- dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH,
+ SetRect(&rc,
+ dis->rcItem.left+FSUI_COLORBOXLEFT,
+ dis->rcItem.top+FSUI_FONTFRAMEVERT,
+ dis->rcItem.left+FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH,
dis->rcItem.bottom-FSUI_FONTFRAMEVERT);
hbrTmp = CreateSolidBrush(clText);
@@ -1311,7 +1311,7 @@ int OptInit(WPARAM wParam, LPARAM) odp.flags = ODPF_BOLDGROUPS;
odp.nIDBottomSimpleControl = 0;
odp.pfnDlgProc = DlgProcLogOptions;
- CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+ CallService( MS_OPT_ADDPAGE, wParam, ( LPARAM )&odp );
return 0;
}
@@ -1479,7 +1479,7 @@ int FontsModernOptInit(WPARAM wParam, LPARAM lParam) {
static int iBoldControls[] =
{
- IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
+ IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
};
diff --git a/src/modules/fonts/FontService.cpp b/src/modules/fonts/FontService.cpp index f8e977f9b3..7b19e962f4 100644 --- a/src/modules/fonts/FontService.cpp +++ b/src/modules/fonts/FontService.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/modules/fonts/FontService.h b/src/modules/fonts/FontService.h index 4f665ae6d3..5d9a3f10a2 100644 --- a/src/modules/fonts/FontService.h +++ b/src/modules/fonts/FontService.h @@ -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.
@@ -46,7 +46,7 @@ struct TFontID char prefix[32]; // this is prepended to the settings used to store this font's data in the db
DWORD flags; // bitwise OR of the FIDF_* flags above
TFontSettings deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID
- int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
+ int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
// they will be ordered alphabetically by name)
TCHAR backgroundGroup[64];
TCHAR backgroundName[64];
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index 09e465c59a..0a00198d66 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -115,7 +115,7 @@ static void GetDefaultFontSetting(LOGFONT* lf, COLORREF* colour) lf->lfHeight = 10;
HDC hdc = GetDC(0);
- lf->lfHeight = -MulDiv(lf->lfHeight,GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
ReleaseDC(0, hdc);
}
@@ -174,7 +174,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR if (lf->lfHeight > 0) {
HDC hdc = GetDC(0);
if (flags & FIDF_SAVEPOINTSIZE) {
- lf->lfHeight = -MulDiv(lf->lfHeight,GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ lf->lfHeight = -MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
} else { // assume SAVEACTUALHEIGHT
TEXTMETRIC tm;
HFONT hFont = CreateFontIndirect(lf);
@@ -236,8 +236,8 @@ void UpdateFontSettings(TFontID* font_id, TFontSettings* fontsettings) static COLORREF sttMixColor(COLORREF cl1, COLORREF cl2, int q)
{
return RGB(
- (GetRValue(cl1) * q + GetRValue(cl2) * (255 - q)) / 255,
- (GetGValue(cl1) * q + GetGValue(cl2) * (255 - q)) / 255,
+ (GetRValue(cl1) * q + GetRValue(cl2) * (255 - q)) / 255,
+ (GetGValue(cl1) * q + GetGValue(cl2) * (255 - q)) / 255,
(GetBValue(cl1) * q + GetBValue(cl2) * (255 - q)) / 255
);
}
@@ -255,10 +255,10 @@ COLORREF GetColorFromDefault(COLORREF cl) case MIRCOLOR_BTNHALF: return sttMixColor(GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNTEXT), 128);
case MIRCOLOR_WNDHALF: return sttMixColor(GetSysColor(COLOR_WINDOW), GetSysColor(COLOR_WINDOWTEXT), 128);
case MIRCOLOR_SELHALF: return sttMixColor(GetSysColor(COLOR_HIGHLIGHT), GetSysColor(COLOR_HIGHLIGHTTEXT), 128);
- case MIRCOLOR_INBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0,0,255), 245);
+ case MIRCOLOR_INBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0, 0, 255), 245);
case MIRCOLOR_INTEXT: return GetSysColor(COLOR_WINDOWTEXT);
case MIRCOLOR_INHALF: return sttMixColor(GetColorFromDefault(MIRCOLOR_INBACK), GetColorFromDefault(MIRCOLOR_INTEXT), 128);
- case MIRCOLOR_OUTBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0,255,0), 245);
+ case MIRCOLOR_OUTBACK: return sttMixColor(GetSysColor(COLOR_WINDOW), RGB(0, 255, 0), 245);
case MIRCOLOR_OUTTEXT: return GetSysColor(COLOR_WINDOWTEXT);
case MIRCOLOR_OUTHALF: return sttMixColor(GetColorFromDefault(MIRCOLOR_OUTBACK), GetColorFromDefault(MIRCOLOR_OUTTEXT), 128);
}
diff --git a/src/modules/help/about.cpp b/src/modules/help/about.cpp index b3594c4dc0..d1dc8bac5c 100644 --- a/src/modules/help/about.cpp +++ b/src/modules/help/about.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.
@@ -40,25 +40,25 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar UINT blockSize;
PVOID pVerInfo;
- GetModuleFileName(NULL,filename,SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename,&unused);
+ GetModuleFileName(NULL, filename, SIZEOF(filename));
+ verInfoSize=GetFileVersionInfoSize(filename, &unused);
pVerInfo=mir_alloc(verInfoSize);
- GetFileVersionInfo(filename,0,verInfoSize,pVerInfo);
- VerQueryValue(pVerInfo,_T("\\StringFileInfo\\000004b0\\LegalCopyright"),(LPVOID*)&productCopyright,&blockSize);
- SetDlgItemText(hwndDlg,IDC_DEVS,productCopyright);
+ GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
+ VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\LegalCopyright"), (LPVOID*)&productCopyright, &blockSize);
+ SetDlgItemText(hwndDlg, IDC_DEVS, productCopyright);
mir_free(pVerInfo);
}
{ char productVersion[56], *p;
int isAnsi = 0;
TCHAR str[64];
- CallService(MS_SYSTEM_GETVERSIONTEXT,SIZEOF(productVersion),(LPARAM)productVersion);
+ CallService(MS_SYSTEM_GETVERSIONTEXT, SIZEOF(productVersion), (LPARAM)productVersion);
// Hide Unicode from version text as it is assumed at this point
p = strstr(productVersion, " Unicode");
if (p)
*p = '\0';
else
isAnsi = 1;
- mir_sntprintf(str,SIZEOF(str),_T(STR_VERSION_FORMAT), TranslateT("v"), productVersion, isAnsi?" ANSI":"");
+ mir_sntprintf(str, SIZEOF(str), _T(STR_VERSION_FORMAT), TranslateT("v"), productVersion, isAnsi?" ANSI":"");
{
TCHAR oldTitle[256], newTitle[256];
GetDlgItemText( hwndDlg, IDC_HEADERBAR, oldTitle, SIZEOF( oldTitle ));
@@ -66,14 +66,14 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SetDlgItemText( hwndDlg, IDC_HEADERBAR, newTitle );
}
- mir_sntprintf(str,SIZEOF(str),TranslateT("Built %s %s"),_T(__DATE__),_T(__TIME__));
- SetDlgItemText(hwndDlg,IDC_BUILDTIME,str);
+ mir_sntprintf(str, SIZEOF(str), TranslateT("Built %s %s"), _T(__DATE__), _T(__TIME__));
+ SetDlgItemText(hwndDlg, IDC_BUILDTIME, str);
}
ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE);
{
- HRSRC hResInfo = FindResource(hMirandaInst,MAKEINTRESOURCE(IDR_CREDITS),_T("TEXT"));
- DWORD ResSize = SizeofResource(hMirandaInst,hResInfo);
- HGLOBAL hRes = LoadResource(hMirandaInst,hResInfo);
+ HRSRC hResInfo = FindResource(hMirandaInst, MAKEINTRESOURCE(IDR_CREDITS), _T("TEXT"));
+ DWORD ResSize = SizeofResource(hMirandaInst, hResInfo);
+ HGLOBAL hRes = LoadResource(hMirandaInst, hResInfo);
char* pszMsg = (char*)LockResource(hRes);
if (pszMsg)
{
@@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case IDC_BUILDTIME:
case IDC_CREDITSFILE:
case IDC_DEVS:
- SetTextColor((HDC)wParam,GetSysColor(COLOR_WINDOWTEXT));
+ SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
break;
default:
return FALSE;
@@ -138,8 +138,8 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case WM_DESTROY:
Window_FreeIcon_IcoLib( hwndDlg );
{
- HFONT hFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_VERSION,WM_GETFONT,0,0);
- SendDlgItemMessage(hwndDlg,IDC_VERSION,WM_SETFONT,SendDlgItemMessage(hwndDlg,IDOK,WM_GETFONT,0,0),0);
+ HFONT hFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_GETFONT, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0), 0);
DeleteObject(hFont);
}
break;
diff --git a/src/modules/help/help.cpp b/src/modules/help/help.cpp index 32c6a8528d..d6035957b7 100644 --- a/src/modules/help/help.cpp +++ b/src/modules/help/help.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -27,26 +27,26 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar HWND hAboutDlg=NULL;
static HANDLE hBugEvent = NULL;
-static INT_PTR AboutCommand(WPARAM wParam,LPARAM)
+static INT_PTR AboutCommand(WPARAM wParam, LPARAM)
{
if (IsWindow(hAboutDlg)) {
SetForegroundWindow(hAboutDlg);
SetFocus(hAboutDlg);
return 0;
}
- hAboutDlg=CreateDialog(hMirandaInst,MAKEINTRESOURCE(IDD_ABOUT),(HWND)wParam,DlgProcAbout);
+ hAboutDlg=CreateDialog(hMirandaInst, MAKEINTRESOURCE(IDD_ABOUT), (HWND)wParam, DlgProcAbout);
return 0;
}
static INT_PTR IndexCommand(WPARAM, LPARAM)
{
- CallService(MS_UTILS_OPENURL,1,(LPARAM)Translate("http://wiki.miranda-im.org/"));
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)Translate("http://wiki.miranda-im.org/"));
return 0;
}
static INT_PTR WebsiteCommand(WPARAM, LPARAM)
{
- CallService(MS_UTILS_OPENURL,1,(LPARAM)"http://www.miranda-im.org");
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://www.miranda-im.org");
return 0;
}
@@ -54,7 +54,7 @@ static int BugCommandEvent(WPARAM wParam, LPARAM lParam) { char *szUrl = (char*)lParam;
if (szUrl) {
- CallService(MS_UTILS_OPENURL,1,(LPARAM)szUrl);
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)szUrl);
}
return 0;
}
@@ -75,12 +75,12 @@ int ShutdownHelpModule(WPARAM, LPARAM) int LoadHelpModule(void)
{
- HookEvent(ME_SYSTEM_PRESHUTDOWN,ShutdownHelpModule);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownHelpModule);
- CreateServiceFunction("Help/AboutCommand",AboutCommand);
- CreateServiceFunction("Help/IndexCommand",IndexCommand);
- CreateServiceFunction("Help/WebsiteCommand",WebsiteCommand);
- CreateServiceFunction("Help/BugCommand",BugCommand);
+ CreateServiceFunction("Help/AboutCommand", AboutCommand);
+ CreateServiceFunction("Help/IndexCommand", IndexCommand);
+ CreateServiceFunction("Help/WebsiteCommand", WebsiteCommand);
+ CreateServiceFunction("Help/BugCommand", BugCommand);
hBugEvent = CreateHookableEvent(ME_HELP_BUGREPORT);
SetHookDefaultForHookableEvent(hBugEvent, BugCommandEvent);
@@ -94,24 +94,24 @@ int LoadHelpModule(void) mi.position = 2000090000;
mi.pszName = LPGEN("&About...");
mi.pszService = "Help/AboutCommand";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_HELP);
mi.position = -500050000;
mi.pszName = LPGEN("&Support");
mi.pszService = "Help/IndexCommand";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_MIRANDAWEB);
mi.position = 2000050000;
mi.pszName = LPGEN("&Miranda IM Homepage");
mi.pszService = "Help/WebsiteCommand";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
mi.icolibItem = GetSkinIconHandle(SKINICON_EVENT_URL);
mi.position = 2000040000;
mi.pszName = LPGEN("&Report Bug");
mi.pszService = "Help/BugCommand";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/src/modules/history/history.cpp b/src/modules/history/history.cpp index 6e502790b9..ee3f039624 100644 --- a/src/modules/history/history.cpp +++ b/src/modules/history/history.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -33,19 +33,19 @@ static HANDLE hWindowList=0; static INT_PTR UserHistoryCommand(WPARAM wParam, LPARAM)
{
- HWND hwnd = WindowList_Find( hWindowList,( HANDLE )wParam );
+ HWND hwnd = WindowList_Find( hWindowList, ( HANDLE )wParam );
if ( hwnd ) {
SetForegroundWindow(hwnd);
SetFocus(hwnd);
return 0;
}
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_HISTORY),NULL,DlgProcHistory,wParam);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_HISTORY), NULL, DlgProcHistory, wParam);
return 0;
}
static int HistoryContactDelete(WPARAM wParam, LPARAM)
{
- HWND hwnd = WindowList_Find(hWindowList,(HANDLE)wParam);
+ HWND hwnd = WindowList_Find(hWindowList, (HANDLE)wParam);
if ( hwnd != NULL )
DestroyWindow(hwnd);
return 0;
@@ -54,7 +54,7 @@ static int HistoryContactDelete(WPARAM wParam, LPARAM) int PreShutdownHistoryModule(WPARAM, LPARAM)
{
if (hWindowList)
- WindowList_BroadcastAsync(hWindowList,WM_DESTROY,0,0);
+ WindowList_BroadcastAsync(hWindowList, WM_DESTROY, 0, 0);
return 0;
}
@@ -67,12 +67,12 @@ int LoadHistoryModule(void) mi.icolibItem = GetSkinIconHandle( SKINICON_OTHER_HISTORY );
mi.pszName = LPGEN("View &History");
mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
- CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY,UserHistoryCommand);
- hWindowList=(HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
- HookEvent(ME_DB_CONTACT_DELETED,HistoryContactDelete);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,PreShutdownHistoryModule);
+ CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, UserHistoryCommand);
+ hWindowList=(HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ HookEvent(ME_DB_CONTACT_DELETED, HistoryContactDelete);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdownHistoryModule);
return 0;
}
@@ -195,42 +195,42 @@ static void FillHistoryThread(void* param) TCHAR str[200], eventText[256], strdatetime[64];
HANDLE hDbEvent;
DBEVENTINFO dbei;
- int newBlobSize,oldBlobSize,i;
+ int newBlobSize, oldBlobSize, i;
HWND hwndList;
THistoryThread *hInfo = ( THistoryThread* )param;
- SendDlgItemMessage(hInfo->hwnd,IDC_LIST,LB_RESETCONTENT,0,0);
- i=CallService(MS_DB_EVENT_GETCOUNT,(WPARAM)hInfo->hContact,0);
- SendDlgItemMessage(hInfo->hwnd,IDC_LIST,LB_INITSTORAGE,i,i*40);
+ SendDlgItemMessage(hInfo->hwnd, IDC_LIST, LB_RESETCONTENT, 0, 0);
+ i=CallService(MS_DB_EVENT_GETCOUNT, (WPARAM)hInfo->hContact, 0);
+ SendDlgItemMessage(hInfo->hwnd, IDC_LIST, LB_INITSTORAGE, i, i*40);
- ZeroMemory(&dbei,sizeof(dbei));
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
oldBlobSize=0;
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDLAST,(WPARAM)hInfo->hContact,0);
- hwndList = GetDlgItem(hInfo->hwnd,IDC_LIST);
+ hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hInfo->hContact, 0);
+ hwndList = GetDlgItem(hInfo->hwnd, IDC_LIST);
while ( hDbEvent != NULL ) {
if ( !IsWindow( hInfo->hwnd ))
break;
- newBlobSize=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)hDbEvent,0);
+ newBlobSize=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
if (newBlobSize>oldBlobSize) {
- dbei.pBlob=(PBYTE)mir_realloc(dbei.pBlob,newBlobSize);
+ dbei.pBlob=(PBYTE)mir_realloc(dbei.pBlob, newBlobSize);
oldBlobSize=newBlobSize;
}
dbei.cbBlob = oldBlobSize;
CallService( MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei );
- GetObjectSummary(&dbei,str,SIZEOF(str));
+ GetObjectSummary(&dbei, str, SIZEOF(str));
if (str[0]) {
tmi.printTimeStamp(NULL, dbei.timestamp, _T("d t"), strdatetime, SIZEOF(strdatetime), 0);
mir_sntprintf( eventText, SIZEOF(eventText), _T("%s: %s"), strdatetime, str );
i = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)eventText );
SendMessage(hwndList, LB_SETITEMDATA, i, (LPARAM)hDbEvent);
}
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV,(WPARAM)hDbEvent,0);
+ hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0);
}
mir_free(dbei.pBlob);
- SendDlgItemMessage(hInfo->hwnd,IDC_LIST,LB_SETCURSEL,0,0);
- SendMessage(hInfo->hwnd,WM_COMMAND,MAKEWPARAM(IDC_LIST,LBN_SELCHANGE),0);
+ SendDlgItemMessage(hInfo->hwnd, IDC_LIST, LB_SETCURSEL, 0, 0);
+ SendMessage(hInfo->hwnd, WM_COMMAND, MAKEWPARAM(IDC_LIST, LBN_SELCHANGE), 0);
EnableWindow(GetDlgItem(hInfo->hwnd, IDC_LIST), TRUE);
mir_free(hInfo);
}
@@ -255,22 +255,22 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
HANDLE hContact;
- hContact=(HANDLE)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ hContact=(HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)lParam);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
hContact = (HANDLE)lParam;
- WindowList_Add(hWindowList,hwndDlg,hContact);
- Utils_RestoreWindowPosition(hwndDlg,hContact,"History","");
+ WindowList_Add(hWindowList, hwndDlg, hContact);
+ Utils_RestoreWindowPosition(hwndDlg, hContact, "History", "");
{
TCHAR* contactName, str[200];
contactName = cli.pfnGetContactDisplayName( hContact, 0 );
- mir_sntprintf(str,SIZEOF(str),TranslateT("History for %s"),contactName);
- SetWindowText(hwndDlg,str);
+ mir_sntprintf(str, SIZEOF(str), TranslateT("History for %s"), contactName);
+ SetWindowText(hwndDlg, str);
}
Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_HISTORY);
- SendMessage(hwndDlg,DM_HREBUILD,0,0);
+ SendMessage(hwndDlg, DM_HREBUILD, 0, 0);
return TRUE;
case DM_HREBUILD:
@@ -285,8 +285,8 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- Utils_SaveWindowPosition(hwndDlg,hContact,"History","");
- WindowList_Remove(hWindowList,hwndDlg);
+ Utils_SaveWindowPosition(hwndDlg, hContact, "History", "");
+ WindowList_Remove(hWindowList, hwndDlg);
return TRUE;
case WM_GETMINMAXINFO:
@@ -302,7 +302,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP urd.lpTemplate=MAKEINTRESOURCEA(IDD_HISTORY);
urd.lParam=(LPARAM)NULL;
urd.pfnResizer=HistoryDlgResizer;
- CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd);
+ CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
return TRUE;
}
case WM_COMMAND:
@@ -319,37 +319,37 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_DELETEHISTORY:
{
HANDLE hDbevent;
- int index = SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETCURSEL,0,0);
+ int index = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
if ( index == LB_ERR )
break;
- if ( MessageBox(hwndDlg,TranslateT("Are you sure you want to delete this history item?"),TranslateT("Delete History"),MB_YESNO|MB_ICONQUESTION) == IDYES) {
- hDbevent = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETITEMDATA,index,0);
- CallService(MS_DB_EVENT_DELETE,(WPARAM)hContact,(LPARAM)hDbevent);
- SendMessage(hwndDlg,DM_HREBUILD,0,0);
+ if ( MessageBox(hwndDlg, TranslateT("Are you sure you want to delete this history item?"), TranslateT("Delete History"), MB_YESNO|MB_ICONQUESTION) == IDYES) {
+ hDbevent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
+ CallService(MS_DB_EVENT_DELETE, (WPARAM)hContact, (LPARAM)hDbevent);
+ SendMessage(hwndDlg, DM_HREBUILD, 0, 0);
}
return TRUE;
}
case IDC_LIST:
if ( HIWORD(wParam) == LBN_SELCHANGE ) {
- TCHAR str[8192],*contactName;
+ TCHAR str[8192], *contactName;
HANDLE hDbEvent;
DBEVENTINFO dbei;
int sel;
- sel=SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETCURSEL,0,0);
- if (sel == LB_ERR) { EnableWindow(GetDlgItem(hwndDlg,IDC_DELETEHISTORY),FALSE); break; }
- EnableWindow(GetDlgItem(hwndDlg,IDC_DELETEHISTORY),TRUE);
+ sel=SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
+ if (sel == LB_ERR) { EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), FALSE); break; }
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), TRUE);
contactName = cli.pfnGetContactDisplayName( hContact, 0 );
- hDbEvent=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETITEMDATA,sel,0);
- ZeroMemory(&dbei,sizeof(dbei));
+ hDbEvent=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0);
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)hDbEvent,0);
+ dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
if ((int)dbei.cbBlob != -1)
{
dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
- if (CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei) == 0)
+ if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei) == 0)
{
- GetObjectDescription(&dbei,str,SIZEOF(str));
+ GetObjectDescription(&dbei, str, SIZEOF(str));
if ( str[0] )
SetDlgItemText(hwndDlg, IDC_EDIT, str);
}
@@ -362,39 +362,39 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_FINDNEXT:
{
TCHAR str[1024];
- HANDLE hDbEvent,hDbEventStart;
+ HANDLE hDbEvent, hDbEventStart;
DBEVENTINFO dbei;
- int newBlobSize,oldBlobSize;
+ int newBlobSize, oldBlobSize;
- int index = SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETCURSEL,0,0);
+ int index = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
if ( index == LB_ERR )
break;
- hDbEventStart=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETITEMDATA,index,0);
- ZeroMemory(&dbei,sizeof(dbei));
+ hDbEventStart=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
dbei.pBlob=NULL;
oldBlobSize=0;
for (;;) {
- hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,LB_GETITEMDATA,++index,0);
+ hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, ++index, 0);
if (hDbEvent == ( HANDLE )LB_ERR) {
index = -1;
continue;
}
if (hDbEvent == hDbEventStart) break;
- newBlobSize=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)hDbEvent,0);
+ newBlobSize=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
if (newBlobSize>oldBlobSize) {
- dbei.pBlob=(PBYTE)mir_realloc(dbei.pBlob,newBlobSize);
+ dbei.pBlob=(PBYTE)mir_realloc(dbei.pBlob, newBlobSize);
oldBlobSize=newBlobSize;
}
dbei.cbBlob=oldBlobSize;
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- GetObjectDescription(&dbei,str,SIZEOF(str));
+ CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
+ GetObjectDescription(&dbei, str, SIZEOF(str));
if (str[0]) {
- CharUpperBuff(str,lstrlen(str));
- if ( _tcsstr(str,(const TCHAR*)lParam) != NULL) {
- SendDlgItemMessage(hwndDlg,IDC_LIST,LB_SETCURSEL,index,0);
- SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_LIST,LBN_SELCHANGE),0);
+ CharUpperBuff(str, lstrlen(str));
+ if ( _tcsstr(str, (const TCHAR*)lParam) != NULL) {
+ SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, index, 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LIST, LBN_SELCHANGE), 0);
break;
} } }
@@ -420,8 +420,8 @@ static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam TCHAR str[128];
HWND hwndParent = ( HWND )GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FINDWHAT, str, SIZEOF(str));
- CharUpperBuff(str,lstrlen(str));
- SendMessage(hwndParent,DM_FINDNEXT,0,(LPARAM)str);
+ CharUpperBuff(str, lstrlen(str));
+ SendMessage(hwndParent, DM_FINDNEXT, 0, (LPARAM)str);
return TRUE;
}
case IDCANCEL:
diff --git a/src/modules/icolib/IcoLib.h b/src/modules/icolib/IcoLib.h index 72e3aa4122..29bd85905b 100644 --- a/src/modules/icolib/IcoLib.h +++ b/src/modules/icolib/IcoLib.h @@ -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.
diff --git a/src/modules/icolib/extracticon.cpp b/src/modules/icolib/extracticon.cpp index fae0a073fd..06025ad843 100644 --- a/src/modules/icolib/extracticon.cpp +++ b/src/modules/icolib/extracticon.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -253,7 +253,7 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC return 0;
// failed to read file signature
- if ( !ReadFile(hFile,&magic, sizeof(magic), &read, NULL ) || (read != sizeof(magic))) {
+ if ( !ReadFile(hFile, &magic, sizeof(magic), &read, NULL ) || (read != sizeof(magic))) {
CloseHandle(hFile);
return 0;
}
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 5000607aaa..10e1ef58dc 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -29,7 +29,7 @@ static BOOL bModuleInitialized = FALSE; static HANDLE hIcons2ChangedEvent, hIconsChangedEvent;
static HICON hIconBlank = NULL;
-HANDLE hIcoLib_AddNewIcon, hIcoLib_RemoveIcon, hIcoLib_GetIcon, hIcoLib_GetIcon2,
+HANDLE hIcoLib_AddNewIcon, hIcoLib_RemoveIcon, hIcoLib_GetIcon, hIcoLib_GetIcon2,
hIcoLib_GetIconHandle, hIcoLib_IsManaged, hIcoLib_AddRef, hIcoLib_ReleaseIcon;
static int iconEventActive = 0;
@@ -363,7 +363,7 @@ IconSourceItem* GetIconSourceItemFromPath( const TCHAR* path, int cxIcon, int cy return NULL;
lstrcpyn( file, path, SIZEOF( file ));
- comma = _tcsrchr( file, ',' );
+ comma = _tcsrchr( file, ', ' );
if ( !comma )
n = 0;
else {
@@ -429,7 +429,7 @@ static HICON ExtractIconFromPath( const TCHAR *path, int cxIcon, int cyIcon ) return (HICON)NULL;
lstrcpyn( file, path, SIZEOF( file ));
- comma = _tcsrchr( file, ',' );
+ comma = _tcsrchr( file, ', ' );
if ( !comma )
n = 0;
else {
@@ -955,7 +955,7 @@ static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive) HICON hIcon;
int indx;
- mir_sntprintf( path, SIZEOF(path), _T("%s,"), filename );
+ mir_sntprintf( path, SIZEOF(path), _T("%s, "), filename );
suffIndx = lstrlen( path );
EnterCriticalSection( &csIconList );
@@ -1067,28 +1067,28 @@ static int OpenPopupMenu(HWND hwndDlg) static TCHAR* OpenFileDlg( HWND hParent, const TCHAR* szFile, BOOL bAll )
{
OPENFILENAME ofn = {0};
- TCHAR filter[512],*pfilter,file[MAX_PATH*2];
+ TCHAR filter[512], *pfilter, file[MAX_PATH*2];
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hParent;
- lstrcpy(filter,TranslateT("Icon Sets"));
+ lstrcpy(filter, TranslateT("Icon Sets"));
if (bAll)
- lstrcat(filter,_T(" (*.dll;*.icl;*.exe;*.ico)"));
+ lstrcat(filter, _T(" (*.dll;*.icl;*.exe;*.ico)"));
else
- lstrcat(filter,_T(" (*.dll)"));
+ lstrcat(filter, _T(" (*.dll)"));
pfilter=filter+lstrlen(filter)+1;
if (bAll)
- lstrcpy(pfilter,_T("*.DLL;*.ICL;*.EXE;*.ICO"));
+ lstrcpy(pfilter, _T("*.DLL;*.ICL;*.EXE;*.ICO"));
else
- lstrcpy(pfilter,_T("*.DLL"));
+ lstrcpy(pfilter, _T("*.DLL"));
pfilter += lstrlen(pfilter) + 1;
lstrcpy(pfilter, TranslateT("All Files"));
- lstrcat(pfilter,_T(" (*)"));
+ lstrcat(pfilter, _T(" (*)"));
pfilter += lstrlen(pfilter) + 1;
- lstrcpy(pfilter,_T("*"));
+ lstrcpy(pfilter, _T("*"));
pfilter += lstrlen(pfilter) + 1;
*pfilter='\0';
@@ -1199,9 +1199,9 @@ static int IconDlg_Resize(HWND, LPARAM, UTILRESIZECONTROL *urc) INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static HWND hwndParent,hwndDragOver;
+ static HWND hwndParent, hwndDragOver;
static int dragging;
- static int dragItem,dropHiLite;
+ static int dragItem, dropHiLite;
static HWND hPreview = NULL;
switch (msg) {
@@ -1210,37 +1210,37 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hwndParent = (HWND)lParam;
hPreview = GetDlgItem(hwndDlg, IDC_PREVIEW);
dragging = dragItem = 0;
- ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,0,100), LVSIL_NORMAL);
+ ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32|ILC_MASK, 0, 100), LVSIL_NORMAL);
ListView_SetIconSpacing(hPreview, 56, 67);
{
RECT rcThis, rcParent;
int cxScreen = GetSystemMetrics(SM_CXSCREEN);
- GetWindowRect(hwndDlg,&rcThis);
- GetWindowRect(hwndParent,&rcParent);
- OffsetRect(&rcThis,rcParent.right-rcThis.left,0);
- OffsetRect(&rcThis,0,rcParent.top-rcThis.top);
- GetWindowRect(GetParent(hwndParent),&rcParent);
+ GetWindowRect(hwndDlg, &rcThis);
+ GetWindowRect(hwndParent, &rcParent);
+ OffsetRect(&rcThis, rcParent.right-rcThis.left, 0);
+ OffsetRect(&rcThis, 0, rcParent.top-rcThis.top);
+ GetWindowRect(GetParent(hwndParent), &rcParent);
if (rcThis.right > cxScreen) {
- OffsetRect(&rcParent,cxScreen-rcThis.right,0);
- OffsetRect(&rcThis,cxScreen-rcThis.right,0);
- MoveWindow(GetParent(hwndParent),rcParent.left,rcParent.top,rcParent.right-rcParent.left,rcParent.bottom-rcParent.top,TRUE);
+ OffsetRect(&rcParent, cxScreen-rcThis.right, 0);
+ OffsetRect(&rcThis, cxScreen-rcThis.right, 0);
+ MoveWindow(GetParent(hwndParent), rcParent.left, rcParent.top, rcParent.right-rcParent.left, rcParent.bottom-rcParent.top, TRUE);
}
- MoveWindow(hwndDlg,rcThis.left,rcThis.top,rcThis.right-rcThis.left,rcThis.bottom-rcThis.top,FALSE);
+ MoveWindow(hwndDlg, rcThis.left, rcThis.top, rcThis.right-rcThis.left, rcThis.bottom-rcThis.top, FALSE);
GetClientRect(hwndDlg, &rcThis);
SendMessage(hwndDlg, WM_SIZE, 0, MAKELPARAM(rcThis.right-rcThis.left, rcThis.bottom-rcThis.top));
}
- if (shAutoComplete) shAutoComplete(GetDlgItem(hwndDlg,IDC_ICONSET), 1);
- SetDlgItemText(hwndDlg,IDC_ICONSET,_T("icons.dll"));
+ if (shAutoComplete) shAutoComplete(GetDlgItem(hwndDlg, IDC_ICONSET), 1);
+ SetDlgItemText(hwndDlg, IDC_ICONSET, _T("icons.dll"));
return TRUE;
case DM_REBUILDICONSPREVIEW:
{
LVITEM lvi;
- TCHAR filename[MAX_PATH],caption[64];
+ TCHAR filename[MAX_PATH], caption[64];
HIMAGELIST hIml;
- int count,i;
+ int count, i;
HICON hIcon;
MySetCursor(IDC_WAIT);
@@ -1249,14 +1249,14 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ImageList_RemoveAll(hIml);
GetDlgItemText(hwndDlg, IDC_ICONSET, filename, SIZEOF(filename));
{
- RECT rcPreview,rcGroup;
+ RECT rcPreview, rcGroup;
GetWindowRect(hPreview, &rcPreview);
- GetWindowRect(GetDlgItem(hwndDlg,IDC_IMPORTMULTI),&rcGroup);
- //SetWindowPos(hPreview,0,0,0,rcPreview.right-rcPreview.left,rcGroup.bottom-rcPreview.top,SWP_NOZORDER|SWP_NOMOVE);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_IMPORTMULTI), &rcGroup);
+ //SetWindowPos(hPreview, 0, 0, 0, rcPreview.right-rcPreview.left, rcGroup.bottom-rcPreview.top, SWP_NOZORDER|SWP_NOMOVE);
}
- if (_taccess(filename,0) != 0) {
+ if (_taccess(filename, 0) != 0) {
MySetCursor(IDC_ARROW);
break;
}
@@ -1264,12 +1264,12 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.mask = LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM;
lvi.iSubItem = 0;
lvi.iItem = 0;
- count = (int)_ExtractIconEx( filename, -1, 16,16, NULL, LR_DEFAULTCOLOR );
+ count = (int)_ExtractIconEx( filename, -1, 16, 16, NULL, LR_DEFAULTCOLOR );
for (i = 0; i < count; lvi.iItem++, i++) {
mir_sntprintf(caption, SIZEOF(caption), _T("%d"), i+1);
lvi.pszText = caption;
//hIcon = ExtractIcon(hMirandaInst, filename, i);
- _ExtractIconEx( filename, i, 16,16, &hIcon, LR_DEFAULTCOLOR );
+ _ExtractIconEx( filename, i, 16, 16, &hIcon, LR_DEFAULTCOLOR );
lvi.iImage = ImageList_AddIcon(hIml, hIcon);
DestroyIcon(hIcon);
lvi.lParam = i;
@@ -1286,9 +1286,9 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR str[MAX_PATH];
TCHAR *file;
- GetDlgItemText(hwndDlg,IDC_ICONSET,str,SIZEOF(str));
+ GetDlgItemText(hwndDlg, IDC_ICONSET, str, SIZEOF(str));
if (!(file = OpenFileDlg(GetParent(hwndDlg), str, TRUE))) break;
- SetDlgItemText(hwndDlg,IDC_ICONSET,file);
+ SetDlgItemText(hwndDlg, IDC_ICONSET, file);
SAFE_FREE(( void** )&file );
}
break;
@@ -1358,7 +1358,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ImageList_EndDrag();
dragging = 0;
if (dropHiLite != -1) {
- TCHAR path[MAX_PATH],fullPath[MAX_PATH],filename[MAX_PATH];
+ TCHAR path[MAX_PATH], fullPath[MAX_PATH], filename[MAX_PATH];
LVITEM lvi;
GetDlgItemText(hwndDlg, IDC_ICONSET, fullPath, SIZEOF(fullPath));
@@ -1366,7 +1366,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.mask=LVIF_PARAM;
lvi.iItem = dragItem; lvi.iSubItem = 0;
ListView_GetItem(hPreview, &lvi);
- mir_sntprintf(path, MAX_PATH, _T("%s,%d"), filename, (int)lvi.lParam);
+ mir_sntprintf(path, MAX_PATH, _T("%s, %d"), filename, (int)lvi.lParam);
SendMessage(hwndParent, DM_CHANGEICON, dropHiLite, (LPARAM)path);
ListView_SetItemState(GetDlgItem(hwndParent, IDC_PREVIEW), dropHiLite, 0, LVIS_DROPHILITED);
} }
@@ -1399,7 +1399,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_CLOSE:
DestroyWindow(hwndDlg);
- EnableWindow(GetDlgItem(hwndParent,IDC_IMPORT),TRUE);
+ EnableWindow(GetDlgItem(hwndParent, IDC_IMPORT), TRUE);
break;
case WM_SIZE:
@@ -1499,7 +1499,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //
ListView_SetUnicodeFormat(hPreview, TRUE);
ListView_SetExtendedListViewStyleEx(hPreview, LVS_EX_INFOTIP, LVS_EX_INFOTIP);
- ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,0,30), LVSIL_NORMAL);
+ ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32|ILC_MASK, 0, 30), LVSIL_NORMAL);
ListView_SetIconSpacing(hPreview, 56, 67);
SendMessage(hwndDlg, DM_REBUILD_CTREE, 0, 0);
@@ -1790,7 +1790,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if ( item->temp_file )
_tcsncpy( pInfoTip->pszText, item->temp_file, pInfoTip->cchTextMax );
else if ( item->default_file )
- mir_sntprintf( pInfoTip->pszText, pInfoTip->cchTextMax, _T("%s,%d"), item->default_file, item->default_indx );
+ mir_sntprintf( pInfoTip->pszText, pInfoTip->cchTextMax, _T("%s, %d"), item->default_file, item->default_indx );
}
}
if ( bNeedRebuild ) {
@@ -1857,7 +1857,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM static UINT iconsExpertOnlyControls[]={IDC_IMPORT};
-static int SkinOptionsInit( WPARAM wParam,LPARAM )
+static int SkinOptionsInit( WPARAM wParam, LPARAM )
{
OPTIONSDIALOGPAGE odp = {0};
@@ -1916,7 +1916,7 @@ int LoadIcoLibModule(void) {
bModuleInitialized = TRUE;
- hIconBlank = LoadIconEx(NULL, MAKEINTRESOURCE(IDI_BLANK),0);
+ hIconBlank = LoadIconEx(NULL, MAKEINTRESOURCE(IDI_BLANK), 0);
InitializeCriticalSection(&csIconList);
hIcoLib_AddNewIcon = CreateServiceFunction(MS_SKIN2_ADDICON, sttIcoLib_AddNewIcon);
diff --git a/src/modules/idle/idle.cpp b/src/modules/idle/idle.cpp index 8ac510b29a..96c71161da 100644 --- a/src/modules/idle/idle.cpp +++ b/src/modules/idle/idle.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2005 Miranda ICQ/IM project,
+Copyright 2000-2005 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IdleObject_SetIdle(obj) (obj->state|=0x1)
#define IdleObject_ClearIdle(obj) (obj->state&=~0x1)
-// either use meth 0,1 or figure out which one
+// either use meth 0, 1 or figure out which one
#define IdleObject_UseMethod0(obj) (obj->state&=~0x2)
#define IdleObject_UseMethod1(obj) (obj->state|=0x2)
#define IdleObject_GetMethod(obj) (obj->state&0x2)
@@ -84,23 +84,23 @@ typedef enum _WTS_CONNECTSTATE_CLASS { typedef enum _WTS_INFO_CLASS {
- WTSInitialProgram,
- WTSApplicationName,
- WTSWorkingDirectory,
- WTSOEMId,
- WTSSessionId,
- WTSUserName,
- WTSWinStationName,
- WTSDomainName,
- WTSConnectState,
- WTSClientBuildNumber,
- WTSClientName,
- WTSClientDirectory,
- WTSClientProductId,
- WTSClientHardwareId,
- WTSClientAddress,
- WTSClientDisplay,
- WTSClientProtocolType,
+ WTSInitialProgram,
+ WTSApplicationName,
+ WTSWorkingDirectory,
+ WTSOEMId,
+ WTSSessionId,
+ WTSUserName,
+ WTSWinStationName,
+ WTSDomainName,
+ WTSConnectState,
+ WTSClientBuildNumber,
+ WTSClientName,
+ WTSClientDirectory,
+ WTSClientProductId,
+ WTSClientHardwareId,
+ WTSClientAddress,
+ WTSClientDisplay,
+ WTSClientProtocolType,
} WTS_INFO_CLASS;
#endif
@@ -208,7 +208,7 @@ static int IdleObject_IsUserIdle(IdleObject * obj) if ( MyGetLastInputInfo != NULL ) {
LASTINPUTINFO ii;
- ZeroMemory(&ii,sizeof(ii));
+ ZeroMemory(&ii, sizeof(ii));
ii.cbSize=sizeof(ii);
if ( MyGetLastInputInfo(&ii) )
return GetTickCount() - ii.dwTime > (obj->minutes * 60 * 1000);
@@ -349,23 +349,23 @@ static INT_PTR CALLBACK IdleOptsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
{
int j;
- int method = DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLEMETHOD, 0);
+ int method = DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLEMETHOD, 0);
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_IDLESHORT, DBGetContactSettingByte(NULL,IDLEMOD,IDL_USERIDLECHECK,0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLESHORT, DBGetContactSettingByte(NULL, IDLEMOD, IDL_USERIDLECHECK, 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_IDLEONWINDOWS, method == 0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_IDLEONMIRANDA, method ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SCREENSAVER, DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLEONSAVER,0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_FULLSCREEN, DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLEONFULLSCR,0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_LOCKED, DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLEONLOCK,0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IDLEPRIVATE, DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLEPRIVATE,0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IDLESTATUSLOCK, DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLESTATUSLOCK,0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SCREENSAVER, DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLEONSAVER, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_FULLSCREEN, DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLEONFULLSCR, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_LOCKED, DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLEONLOCK, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLEPRIVATE, DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLEPRIVATE, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLESTATUSLOCK, DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLESTATUSLOCK, 0) ? BST_CHECKED : BST_UNCHECKED);
if ( !bIsWTSApiPresent )
EnableWindow( GetDlgItem( hwndDlg, IDC_IDLETERMINAL ), FALSE );
else
- CheckDlgButton(hwndDlg, IDC_IDLETERMINAL, DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLEONTSDC,0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLETERMINAL, DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLEONTSDC, 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_IDLE1STTIME), 0);
SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETRANGE32, 1, 60);
- SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETPOS, 0, MAKELONG((short) DBGetContactSettingByte(NULL,IDLEMOD,IDL_IDLETIME1ST, 10), 0));
+ SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETPOS, 0, MAKELONG((short) DBGetContactSettingByte(NULL, IDLEMOD, IDL_IDLETIME1ST, 10), 0));
SendDlgItemMessage(hwndDlg, IDC_IDLE1STTIME, EM_LIMITTEXT, (WPARAM)2, 0);
CheckDlgButton(hwndDlg, IDC_AASHORTIDLE, DBGetContactSettingByte(NULL, IDLEMOD, IDL_AAENABLE, 0) ? BST_CHECKED:BST_UNCHECKED);
@@ -476,7 +476,7 @@ static int IdleModernOptInit(WPARAM wParam, LPARAM) {
static const int iBoldControls[] =
{
- IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
+ IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
};
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 17c62f00cd..2c3ca8ba78 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.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.
@@ -24,84 +24,84 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IGNOREEVENT_MAX 7
-static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX]={PF1_IMRECV,PF1_URLRECV,PF1_FILERECV,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF};
-static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX]={0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,PF4_SUPPORTTYPING};
+static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX]={PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
+static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX]={0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING};
static DWORD GetMask(HANDLE hContact)
{
- DWORD mask=DBGetContactSettingDword(hContact,"Ignore","Mask1",(DWORD)(-1));
+ DWORD mask=DBGetContactSettingDword(hContact, "Ignore", "Mask1", (DWORD)(-1));
if (mask == (DWORD)(-1)) {
if (hContact == NULL) mask=0;
else {
- if (DBGetContactSettingByte(hContact,"CList","Hidden",0) || DBGetContactSettingByte(hContact,"CList","NotOnList",0))
- mask=DBGetContactSettingDword(NULL,"Ignore","Mask1",0);
+ if (DBGetContactSettingByte(hContact, "CList", "Hidden", 0) || DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ mask=DBGetContactSettingDword(NULL, "Ignore", "Mask1", 0);
else
- mask=DBGetContactSettingDword(NULL,"Ignore","Default1",0);
+ mask=DBGetContactSettingDword(NULL, "Ignore", "Default1", 0);
}
}
return mask;
}
-static void SetListGroupIcons(HWND hwndList,HANDLE hFirstItem,HANDLE hParentItem,int *groupChildCount)
+static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount)
{
int typeOfFirst;
- int iconOn[IGNOREEVENT_MAX]={1,1,1,1,1,1,1};
- int childCount[IGNOREEVENT_MAX]={0,0,0,0,0,0,0},i;
+ int iconOn[IGNOREEVENT_MAX]={1, 1, 1, 1, 1, 1, 1};
+ int childCount[IGNOREEVENT_MAX]={0, 0, 0, 0, 0, 0, 0}, i;
int iImage;
- HANDLE hItem,hChildItem;
+ HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if (hChildItem) SetListGroupIcons(hwndList,hChildItem,hItem,childCount);
+ hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hChildItem) SetListGroupIcons(hwndList, hChildItem, hItem, childCount);
for (i=0; i < SIZEOF(iconOn); i++)
- if (iconOn[i] && SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i) == 0) iconOn[i]=0;
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i]=0;
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
for ( i=0; i < SIZEOF(iconOn); i++ ) {
- iImage=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i);
+ iImage=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
if (iconOn[i] && iImage == 0) iconOn[i]=0;
if (iImage != 0xFF) childCount[i]++;
}
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
for ( i=0; i < SIZEOF(iconOn); i++ ) {
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hParentItem,MAKELPARAM(i,childCount[i]?(iconOn[i]?i+3:0):0xFF));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+3:0):0xFF));
if (groupChildCount) groupChildCount[i]+=childCount[i];
}
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hParentItem,MAKELPARAM(IGNOREEVENT_MAX,1));
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hParentItem,MAKELPARAM(IGNOREEVENT_MAX+1,2));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(IGNOREEVENT_MAX, 1));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
}
-static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iImage)
+static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage)
{
- int typeOfFirst,iOldIcon;
- HANDLE hItem,hChildItem;
+ int typeOfFirst, iOldIcon;
+ HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if (hChildItem) SetAllChildIcons(hwndList,hChildItem,iColumn,iImage);
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hChildItem) SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
- iOldIcon=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ iOldIcon=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
@@ -109,37 +109,37 @@ static void ResetListOptions(HWND hwndList) {
int i;
- SendMessage(hwndList,CLM_SETBKBITMAP,0,(LPARAM)(HBITMAP)NULL);
- SendMessage(hwndList,CLM_SETBKCOLOR,GetSysColor(COLOR_WINDOW),0);
- SendMessage(hwndList,CLM_SETGREYOUTFLAGS,0,0);
- SendMessage(hwndList,CLM_SETLEFTMARGIN,4,0);
- SendMessage(hwndList,CLM_SETINDENT,10,0);
- SendMessage(hwndList,CLM_SETHIDEEMPTYGROUPS,1,0);
+ SendMessage(hwndList, CLM_SETBKBITMAP, 0, (LPARAM)(HBITMAP)NULL);
+ SendMessage(hwndList, CLM_SETBKCOLOR, GetSysColor(COLOR_WINDOW), 0);
+ SendMessage(hwndList, CLM_SETGREYOUTFLAGS, 0, 0);
+ SendMessage(hwndList, CLM_SETLEFTMARGIN, 4, 0);
+ SendMessage(hwndList, CLM_SETINDENT, 10, 0);
+ SendMessage(hwndList, CLM_SETHIDEEMPTYGROUPS, 1, 0);
for (i=0;i<=FONTID_MAX;i++)
- SendMessage(hwndList,CLM_SETTEXTCOLOR,i,GetSysColor(COLOR_WINDOWTEXT));
+ SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
}
-static void SetIconsForColumn(HWND hwndList,HANDLE hItem,HANDLE hItemAll,int iColumn,int iImage)
+static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int iColumn, int iImage)
{
int itemType;
- itemType=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hItem,0);
+ itemType=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
if (itemType == CLCIT_CONTACT) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != 0xFF&&oldiImage != iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
}
else if (itemType == CLCIT_INFO) {
- if (hItem == hItemAll) SetAllChildIcons(hwndList,hItem,iColumn,iImage);
- else SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage)); //hItemUnknown
+ if (hItem == hItemAll) SetAllChildIcons(hwndList, hItem, iColumn, iImage);
+ else SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage)); //hItemUnknown
}
else if (itemType == CLCIT_GROUP) {
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if (hItem) SetAllChildIcons(hwndList,hItem,iColumn,iImage);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hItem) SetAllChildIcons(hwndList, hItem, iColumn, iImage);
}
}
-static void InitialiseItem(HWND hwndList,HANDLE hContact,HANDLE hItem,DWORD proto1Caps,DWORD proto4Caps)
+static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD proto1Caps, DWORD proto4Caps)
{
DWORD mask;
int i;
@@ -147,51 +147,51 @@ static void InitialiseItem(HWND hwndList,HANDLE hContact,HANDLE hItem,DWORD prot mask=GetMask(hContact);
for (i=0;i<IGNOREEVENT_MAX;i++)
if ((ignoreIdToPf1[i] == 0xFFFFFFFF&&ignoreIdToPf4[i] == 0xFFFFFFFF) || (proto1Caps&ignoreIdToPf1[i]||proto4Caps&ignoreIdToPf4[i]))
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,mask&(1<<i)?i+3:0));
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(IGNOREEVENT_MAX,1));
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(IGNOREEVENT_MAX+1,2));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, mask&(1<<i)?i+3:0));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 1));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
}
-static void SaveItemMask(HWND hwndList,HANDLE hContact,HANDLE hItem,const char *pszSetting)
+static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const char *pszSetting)
{
DWORD mask;
- int i,iImage;
+ int i, iImage;
mask=0;
for (i=0;i<IGNOREEVENT_MAX;i++) {
- iImage=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0));
+ iImage=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
if (iImage && iImage != 0xFF) mask|=1<<i;
}
- DBWriteContactSettingDword(hContact,"Ignore",pszSetting,mask);
+ DBWriteContactSettingDword(hContact, "Ignore", pszSetting, mask);
}
static void SetAllContactIcons(HWND hwndList)
{
- HANDLE hContact,hItem;
+ HANDLE hContact, hItem;
DWORD proto1Caps, proto4Caps;
char *szProto;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem && SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(IGNOREEVENT_MAX,0)) == 0xFF) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == 0xFF) {
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) proto1Caps=proto4Caps=0;
else {
- proto1Caps=CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0);
- proto4Caps=CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_4,0);
+ proto1Caps=CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ proto4Caps=CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0);
}
- InitialiseItem(hwndList,hContact,hItem,proto1Caps,proto4Caps);
- if (!DBGetContactSettingByte(hContact,"CList","Hidden",0))
- SendMessage(hwndList,CLM_SETCHECKMARK,(WPARAM)hItem,1);
+ InitialiseItem(hwndList, hContact, hItem, proto1Caps, proto4Caps);
+ if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
+ SendMessage(hwndList, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
}
static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
static HICON hIcons[IGNOREEVENT_MAX+2];
- static HANDLE hItemAll,hItemUnknown;
+ static HANDLE hItemAll, hItemUnknown;
switch (msg)
{
@@ -199,57 +199,57 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM TranslateDialogDefault(hwndDlg);
{ HIMAGELIST hIml;
int i;
- hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),(IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,3+IGNOREEVENT_MAX,3+IGNOREEVENT_MAX);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_FILLEDBLOB);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_EMPTYBLOB);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_EVENT_MESSAGE);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_EVENT_URL);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_EVENT_FILE);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_USERONLINE);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_MIRANDA);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_ADDCONTACT);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_TYPING);
-
- SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_SETEXTRAIMAGELIST,0,(LPARAM)hIml);
+ hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3+IGNOREEVENT_MAX, 3+IGNOREEVENT_MAX);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_FILLEDBLOB);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_EMPTYBLOB);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_EVENT_MESSAGE);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_EVENT_URL);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_EVENT_FILE);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_USERONLINE);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_MIRANDA);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_ADDCONTACT);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_TYPING);
+
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
for ( i=0; i < SIZEOF(hIcons); i++ )
- hIcons[i]=ImageList_GetIcon(hIml,1+i,ILD_NORMAL);
+ hIcons[i]=ImageList_GetIcon(hIml, 1+i, ILD_NORMAL);
}
- SendDlgItemMessage(hwndDlg,IDC_ALLICON,STM_SETICON,(WPARAM)hIcons[0],0);
- SendDlgItemMessage(hwndDlg,IDC_NONEICON,STM_SETICON,(WPARAM)hIcons[1],0);
- SendDlgItemMessage(hwndDlg,IDC_MSGICON,STM_SETICON,(WPARAM)hIcons[2],0);
- SendDlgItemMessage(hwndDlg,IDC_URLICON,STM_SETICON,(WPARAM)hIcons[3],0);
- SendDlgItemMessage(hwndDlg,IDC_FILEICON,STM_SETICON,(WPARAM)hIcons[4],0);
- SendDlgItemMessage(hwndDlg,IDC_ONLINEICON,STM_SETICON,(WPARAM)hIcons[5],0);
- SendDlgItemMessage(hwndDlg,IDC_AUTHICON,STM_SETICON,(WPARAM)hIcons[6],0);
- SendDlgItemMessage(hwndDlg,IDC_ADDED,STM_SETICON,(WPARAM)hIcons[7],0);
- SendDlgItemMessage(hwndDlg,IDC_TYPINGICON,STM_SETICON,(WPARAM)hIcons[8],0);
-
- if (!SendMessage(GetParent(hwndDlg),PSM_ISEXPERT,0,0)) {
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_LIST),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_LIST),GWL_STYLE)&~(CLS_CHECKBOXES|CLS_GROUPCHECKBOXES|CLS_SHOWHIDDEN));
- SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_AUTOREBUILD,0,0);
+ SendDlgItemMessage(hwndDlg, IDC_ALLICON, STM_SETICON, (WPARAM)hIcons[0], 0);
+ SendDlgItemMessage(hwndDlg, IDC_NONEICON, STM_SETICON, (WPARAM)hIcons[1], 0);
+ SendDlgItemMessage(hwndDlg, IDC_MSGICON, STM_SETICON, (WPARAM)hIcons[2], 0);
+ SendDlgItemMessage(hwndDlg, IDC_URLICON, STM_SETICON, (WPARAM)hIcons[3], 0);
+ SendDlgItemMessage(hwndDlg, IDC_FILEICON, STM_SETICON, (WPARAM)hIcons[4], 0);
+ SendDlgItemMessage(hwndDlg, IDC_ONLINEICON, STM_SETICON, (WPARAM)hIcons[5], 0);
+ SendDlgItemMessage(hwndDlg, IDC_AUTHICON, STM_SETICON, (WPARAM)hIcons[6], 0);
+ SendDlgItemMessage(hwndDlg, IDC_ADDED, STM_SETICON, (WPARAM)hIcons[7], 0);
+ SendDlgItemMessage(hwndDlg, IDC_TYPINGICON, STM_SETICON, (WPARAM)hIcons[8], 0);
+
+ if (!SendMessage(GetParent(hwndDlg), PSM_ISEXPERT, 0, 0)) {
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LIST), GWL_STYLE)&~(CLS_CHECKBOXES|CLS_GROUPCHECKBOXES|CLS_SHOWHIDDEN));
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_AUTOREBUILD, 0, 0);
}
- ResetListOptions(GetDlgItem(hwndDlg,IDC_LIST));
- SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_SETEXTRACOLUMNS,IGNOREEVENT_MAX+2,0);
+ ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, IGNOREEVENT_MAX+2, 0);
{ CLCINFOITEM cii={0};
cii.cbSize=sizeof(cii);
cii.flags=CLCIIF_GROUPFONT;
cii.pszText=TranslateT("** All contacts **");
- hItemAll=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_ADDINFOITEM,0,(LPARAM)&cii);
+ hItemAll=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
cii.pszText=TranslateT("** Unknown contacts **");
- hItemUnknown=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_ADDINFOITEM,0,(LPARAM)&cii);
- InitialiseItem(GetDlgItem(hwndDlg,IDC_LIST),NULL,hItemUnknown,0xFFFFFFFF,0xFFFFFFFF);
+ hItemUnknown=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
+ InitialiseItem(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, 0xFFFFFFFF, 0xFFFFFFFF);
}
- SetAllContactIcons(GetDlgItem(hwndDlg,IDC_LIST));
- SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
+ SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
return TRUE;
case WM_SETFOCUS:
- SetFocus(GetDlgItem(hwndDlg,IDC_LIST));
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST));
break;
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
@@ -258,13 +258,13 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM {
case CLN_NEWCONTACT:
case CLN_LISTREBUILT:
- SetAllContactIcons(GetDlgItem(hwndDlg,IDC_LIST));
+ SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
//fall through
case CLN_CONTACTMOVED:
- SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
break;
case CLN_OPTIONSCHANGED:
- ResetListOptions(GetDlgItem(hwndDlg,IDC_LIST));
+ ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
break;
case CLN_CHECKCHANGED:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -276,24 +276,24 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM int iImage;
if (nm->iColumn == -1) break;
- hItem=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
+ hItem=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
if (hItem == NULL) break;
if (!(hitFlags&CLCHT_ONITEMEXTRA)) break;
if (nm->iColumn == IGNOREEVENT_MAX) { //ignore all
for (iImage=0;iImage<IGNOREEVENT_MAX;iImage++)
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_LIST),hItem,hItemAll,iImage,iImage+3);
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, iImage+3);
}
else if (nm->iColumn == IGNOREEVENT_MAX+1) { //ignore none
for (iImage=0;iImage<IGNOREEVENT_MAX;iImage++)
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_LIST),hItem,hItemAll,iImage,0);
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, 0);
}
else {
- iImage=SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ iImage=SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
if (iImage == 0) iImage=nm->iColumn+3;
else if (iImage != 0xFF) iImage=0;
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_LIST),hItem,hItemAll,nm->iColumn,iImage);
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, nm->iColumn, iImage);
}
- SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
@@ -303,24 +303,24 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
- { HANDLE hContact,hItem;
+ { HANDLE hContact, hItem;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem) SaveItemMask(GetDlgItem(hwndDlg,IDC_LIST),hContact,hItem,"Mask1");
- if (SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETCHECKMARK,(WPARAM)hItem,0))
- DBDeleteContactSetting(hContact,"CList","Hidden");
+ hItem=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem) SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
+ if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
+ DBDeleteContactSetting(hContact, "CList", "Hidden");
else
- DBWriteContactSettingByte(hContact,"CList","Hidden",1);
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
- SaveItemMask(GetDlgItem(hwndDlg,IDC_LIST),NULL,hItemAll,"Default1");
- SaveItemMask(GetDlgItem(hwndDlg,IDC_LIST),NULL,hItemUnknown,"Mask1");
+ DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
+ SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, "Mask1");
return TRUE;
}
case PSN_EXPERTCHANGED:
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_LIST),GWL_STYLE,((PSHNOTIFY*)lParam)->lParam?GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_LIST),GWL_STYLE)|CLS_CHECKBOXES|CLS_GROUPCHECKBOXES|CLS_SHOWHIDDEN:GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_LIST),GWL_STYLE)&~(CLS_CHECKBOXES|CLS_GROUPCHECKBOXES|CLS_SHOWHIDDEN));
- SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_AUTOREBUILD,0,0);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LIST), GWL_STYLE, ((PSHNOTIFY*)lParam)->lParam?GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LIST), GWL_STYLE)|CLS_CHECKBOXES|CLS_GROUPCHECKBOXES|CLS_SHOWHIDDEN:GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LIST), GWL_STYLE)&~(CLS_CHECKBOXES|CLS_GROUPCHECKBOXES|CLS_SHOWHIDDEN));
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_AUTOREBUILD, 0, 0);
break;
}
break;
@@ -331,7 +331,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM HIMAGELIST hIml;
for ( i=0; i < SIZEOF(hIcons); i++ )
DestroyIcon(hIcons[i]);
- hIml=(HIMAGELIST)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGELIST,0,0);
+ hIml=(HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
break;
}
@@ -357,61 +357,61 @@ static int IgnoreOptInitialise(WPARAM wParam, LPARAM) return 0;
}
-static INT_PTR IsIgnored(WPARAM wParam,LPARAM lParam)
+static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam)
{
DWORD mask=GetMask((HANDLE)wParam);
if (lParam<1 || lParam>IGNOREEVENT_MAX) return 1;
return (mask>>(lParam-1))&1;
}
-static INT_PTR Ignore(WPARAM wParam,LPARAM lParam)
+static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
{
DWORD mask=GetMask((HANDLE)wParam);
if ((lParam<1 || lParam>IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL) return 1;
if (lParam == IGNOREEVENT_ALL) mask=(1<<IGNOREEVENT_MAX)-1;
else mask|=1<<(lParam-1);
- DBWriteContactSettingDword((HANDLE)wParam,"Ignore","Mask1",mask);
+ DBWriteContactSettingDword((HANDLE)wParam, "Ignore", "Mask1", mask);
return 0;
}
-static INT_PTR Unignore(WPARAM wParam,LPARAM lParam)
+static INT_PTR Unignore(WPARAM wParam, LPARAM lParam)
{
DWORD mask=GetMask((HANDLE)wParam);
if ((lParam<1 || lParam>IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL) return 1;
if (lParam == IGNOREEVENT_ALL) mask=0;
else mask&=~(1<<(lParam-1));
- DBWriteContactSettingDword((HANDLE)wParam,"Ignore","Mask1",mask);
+ DBWriteContactSettingDword((HANDLE)wParam, "Ignore", "Mask1", mask);
return 0;
}
static int IgnoreContactAdded(WPARAM wParam, LPARAM)
{
- CallService(MS_PROTO_ADDTOCONTACT,wParam,(LPARAM)"Ignore");
+ CallService(MS_PROTO_ADDTOCONTACT, wParam, (LPARAM)"Ignore");
return 0;
}
-static INT_PTR IgnoreRecvMessage(WPARAM wParam,LPARAM lParam)
+static INT_PTR IgnoreRecvMessage(WPARAM wParam, LPARAM lParam)
{
- if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact,IGNOREEVENT_MESSAGE)) return 1;
- return CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_MESSAGE)) return 1;
+ return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
}
-static INT_PTR IgnoreRecvUrl(WPARAM wParam,LPARAM lParam)
+static INT_PTR IgnoreRecvUrl(WPARAM wParam, LPARAM lParam)
{
- if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact,IGNOREEVENT_URL)) return 1;
- return CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_URL)) return 1;
+ return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
}
-static INT_PTR IgnoreRecvFile(WPARAM wParam,LPARAM lParam)
+static INT_PTR IgnoreRecvFile(WPARAM wParam, LPARAM lParam)
{
- if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact,IGNOREEVENT_FILE)) return 1;
- return CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_FILE)) return 1;
+ return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
}
-static INT_PTR IgnoreRecvAuth(WPARAM wParam,LPARAM lParam)
+static INT_PTR IgnoreRecvAuth(WPARAM wParam, LPARAM lParam)
{
- if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact,IGNOREEVENT_AUTHORIZATION)) return 1;
- return CallService(MS_PROTO_CHAINRECV,wParam,lParam);
+ if (IsIgnored((WPARAM)((CCSDATA*)lParam)->hContact, IGNOREEVENT_AUTHORIZATION)) return 1;
+ return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
}
static int IgnoreAddedNotify(WPARAM, LPARAM lParam)
@@ -421,7 +421,7 @@ static int IgnoreAddedNotify(WPARAM, LPARAM lParam) HANDLE hContact;
hContact=*((PHANDLE)(dbei->pBlob+sizeof(DWORD)));
- if (CallService(MS_DB_CONTACT_IS,(WPARAM)hContact,0) && IsIgnored((WPARAM)hContact,IGNOREEVENT_YOUWEREADDED))
+ if (CallService(MS_DB_CONTACT_IS, (WPARAM)hContact, 0) && IsIgnored((WPARAM)hContact, IGNOREEVENT_YOUWEREADDED))
return 1;
}
return 0;
@@ -431,7 +431,7 @@ static int IgnoreModernOptInit(WPARAM wParam, LPARAM) {
static int iBoldControls[] =
{
- IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
+ IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
};
@@ -456,26 +456,26 @@ int LoadIgnoreModule(void) pd.cbSize=sizeof(pd);
pd.szName="Ignore";
pd.type=PROTOTYPE_IGNORE;
- CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
+ CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while ( hContact != NULL ) {
- if (!CallService(MS_PROTO_ISPROTOONCONTACT,(WPARAM)hContact,(LPARAM)"Ignore"))
- CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)"Ignore");
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)"Ignore"))
+ CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)"Ignore");
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
- CreateServiceFunction("Ignore"PSR_MESSAGE,IgnoreRecvMessage);
- CreateServiceFunction("Ignore"PSR_URL,IgnoreRecvUrl);
- CreateServiceFunction("Ignore"PSR_FILE,IgnoreRecvFile);
- CreateServiceFunction("Ignore"PSR_AUTH,IgnoreRecvAuth);
- CreateServiceFunction(MS_IGNORE_ISIGNORED,IsIgnored);
- CreateServiceFunction(MS_IGNORE_IGNORE,Ignore);
- CreateServiceFunction(MS_IGNORE_UNIGNORE,Unignore);
+ CreateServiceFunction("Ignore"PSR_MESSAGE, IgnoreRecvMessage);
+ CreateServiceFunction("Ignore"PSR_URL, IgnoreRecvUrl);
+ CreateServiceFunction("Ignore"PSR_FILE, IgnoreRecvFile);
+ CreateServiceFunction("Ignore"PSR_AUTH, IgnoreRecvAuth);
+ CreateServiceFunction(MS_IGNORE_ISIGNORED, IsIgnored);
+ CreateServiceFunction(MS_IGNORE_IGNORE, Ignore);
+ CreateServiceFunction(MS_IGNORE_UNIGNORE, Unignore);
- HookEvent(ME_DB_CONTACT_ADDED,IgnoreContactAdded);
- HookEvent(ME_DB_EVENT_FILTER_ADD,IgnoreAddedNotify);
+ HookEvent(ME_DB_CONTACT_ADDED, IgnoreContactAdded);
+ HookEvent(ME_DB_EVENT_FILTER_ADD, IgnoreAddedNotify);
HookEvent(ME_MODERNOPT_INITIALIZE, IgnoreModernOptInit);
- HookEvent(ME_OPT_INITIALISE,IgnoreOptInitialise);
+ HookEvent(ME_OPT_INITIALISE, IgnoreOptInitialise);
return 0;
}
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp index 5013361393..71b0dddaf9 100644 --- a/src/modules/langpack/langpack.cpp +++ b/src/modules/langpack/langpack.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -153,7 +153,7 @@ unsigned int __fastcall hashstrW(const char * key) return hash(buf, len);
}
-static int SortLangPackHashesProc(LangPackEntry *arg1,LangPackEntry *arg2)
+static int SortLangPackHashesProc(LangPackEntry *arg1, LangPackEntry *arg2)
{
if (arg1->englishHash < arg2->englishHash) return -1;
if (arg1->englishHash > arg2->englishHash) return 1;
@@ -333,7 +333,7 @@ static int LoadLangPack(const TCHAR *szLangPack) if ( p )
p[1] = 0;
- FILE *fp = _tfopen(szLangPack,_T("rt"));
+ FILE *fp = _tfopen(szLangPack, _T("rt"));
if ( fp == NULL )
return 1;
@@ -367,17 +367,17 @@ static int LoadLangPack(const TCHAR *szLangPack) if ( line[0] == '[' || line[0] == '#' )
break;
- char* pszColon = strchr( line,':' );
+ char* pszColon = strchr( line, ':' );
if ( pszColon == NULL ) {
fclose( fp );
return 3;
}
*pszColon++ = 0;
- if (!lstrcmpA(line,"Language")) {mir_snprintf(langPack.language,sizeof(langPack.language),"%s",pszColon); lrtrim(langPack.language);}
- else if (!lstrcmpA(line,"Last-Modified-Using")) {mir_snprintf(langPack.lastModifiedUsing,sizeof(langPack.lastModifiedUsing),"%s",pszColon); lrtrim(langPack.lastModifiedUsing);}
- else if (!lstrcmpA(line,"Authors")) {mir_snprintf(langPack.authors,sizeof(langPack.authors),"%s",pszColon); lrtrim(langPack.authors);}
- else if (!lstrcmpA(line,"Author-email")) {mir_snprintf(langPack.authorEmail,sizeof(langPack.authorEmail),"%s",pszColon); lrtrim(langPack.authorEmail);}
+ if (!lstrcmpA(line, "Language")) {mir_snprintf(langPack.language, sizeof(langPack.language), "%s", pszColon); lrtrim(langPack.language);}
+ else if (!lstrcmpA(line, "Last-Modified-Using")) {mir_snprintf(langPack.lastModifiedUsing, sizeof(langPack.lastModifiedUsing), "%s", pszColon); lrtrim(langPack.lastModifiedUsing);}
+ else if (!lstrcmpA(line, "Authors")) {mir_snprintf(langPack.authors, sizeof(langPack.authors), "%s", pszColon); lrtrim(langPack.authors);}
+ else if (!lstrcmpA(line, "Author-email")) {mir_snprintf(langPack.authorEmail, sizeof(langPack.authorEmail), "%s", pszColon); lrtrim(langPack.authorEmail);}
else if (!lstrcmpA(line, "Locale")) {
char szBuf[20], *stopped;
@@ -399,13 +399,13 @@ static int LoadLangPack(const TCHAR *szLangPack) LoadLangPackFile( fp, line, fileCp );
fclose(fp);
- qsort(langPack.entry,langPack.entryCount,sizeof(LangPackEntry),(int(*)(const void*,const void*))SortLangPackHashesProc);
+ qsort(langPack.entry, langPack.entryCount, sizeof(LangPackEntry), (int(*)(const void*, const void*))SortLangPackHashesProc);
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
-static int SortLangPackHashesProc2(LangPackEntry *arg1,LangPackEntry *arg2)
+static int SortLangPackHashesProc2(LangPackEntry *arg1, LangPackEntry *arg2)
{
if (arg1->englishHash < arg2->englishHash) return -1;
if (arg1->englishHash > arg2->englishHash) return 1;
@@ -417,9 +417,9 @@ char *LangPackTranslateString(LangPackMuuid* pUuid, const char *szEnglish, const if ( langPack.entryCount == 0 || szEnglish == NULL )
return (char*)szEnglish;
- LangPackEntry key,*entry;
+ LangPackEntry key, *entry;
key.englishHash = W ? hashstrW(szEnglish) : hashstr(szEnglish);
- entry = (LangPackEntry*)bsearch(&key, langPack.entry, langPack.entryCount, sizeof(LangPackEntry), (int(*)(const void*,const void*))SortLangPackHashesProc2 );
+ entry = (LangPackEntry*)bsearch(&key, langPack.entry, langPack.entryCount, sizeof(LangPackEntry), (int(*)(const void*, const void*))SortLangPackHashesProc2 );
if ( entry == NULL )
return (char*)szEnglish;
@@ -511,7 +511,7 @@ void LangPackDropUnusedItems( void ) if ( bSortNeeded ) {
langPack.entryCount = ( int )( d - langPack.entry );
- qsort(langPack.entry,langPack.entryCount,sizeof(LangPackEntry),(int(*)(const void*,const void*))SortLangPackHashesProc);
+ qsort(langPack.entry, langPack.entryCount, sizeof(LangPackEntry), (int(*)(const void*, const void*))SortLangPackHashesProc);
}
}
@@ -525,7 +525,7 @@ int LoadLangPackModule(void) bModuleInitialized = TRUE;
- ZeroMemory(&langPack,sizeof(langPack));
+ ZeroMemory(&langPack, sizeof(langPack));
LoadLangPackServices();
pathToAbsoluteT(_T("langpack_*.txt"), szSearch, NULL);
hFind = FindFirstFile( szSearch, &fd );
diff --git a/src/modules/langpack/lpservices.cpp b/src/modules/langpack/lpservices.cpp index 69d416330b..0de43ecb6a 100644 --- a/src/modules/langpack/lpservices.cpp +++ b/src/modules/langpack/lpservices.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.
@@ -33,7 +33,7 @@ int LangPackMarkPluginLoaded( PLUGININFOEX* pInfo ); /////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR TranslateString(WPARAM wParam,LPARAM lParam)
+static INT_PTR TranslateString(WPARAM wParam, LPARAM lParam)
{
return (INT_PTR)LangPackTranslateString( LangPackLookupUuid(wParam), (const char *)lParam, (wParam & LANG_UNICODE) ? 1 : 0);
}
@@ -80,11 +80,11 @@ static void TranslateWindow( LangPackMuuid* pUuid, HWND hwnd ) SetWindowText(hwnd, result );
} }
-static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd,LPARAM lParam)
+static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
{
LANGPACKTRANSLATEDIALOG *lptd = (LANGPACKTRANSLATEDIALOG*)lParam;
TCHAR szClass[32];
- int i,id = GetDlgCtrlID( hwnd );
+ int i, id = GetDlgCtrlID( hwnd );
if ( lptd->ignoreControls != NULL )
for ( i=0; lptd->ignoreControls[i]; i++ )
@@ -94,10 +94,10 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd,LPARAM lParam) LangPackMuuid* uuid = LangPackLookupUuid( lptd->flags );
GetClassName( hwnd, szClass, SIZEOF(szClass));
- if (!lstrcmpi(szClass,_T("static")) || !lstrcmpi(szClass,_T("hyperlink")) || !lstrcmpi(szClass,_T("button")) || !lstrcmpi(szClass,_T("MButtonClass")) || !lstrcmpi(szClass,_T("MHeaderbarCtrl")))
+ if (!lstrcmpi(szClass, _T("static")) || !lstrcmpi(szClass, _T("hyperlink")) || !lstrcmpi(szClass, _T("button")) || !lstrcmpi(szClass, _T("MButtonClass")) || !lstrcmpi(szClass, _T("MHeaderbarCtrl")))
TranslateWindow( uuid, hwnd );
- else if ( !lstrcmpi( szClass,_T("edit"))) {
- if ( lptd->flags & LPTDF_NOIGNOREEDIT || GetWindowLongPtr(hwnd,GWL_STYLE) & ES_READONLY )
+ else if ( !lstrcmpi( szClass, _T("edit"))) {
+ if ( lptd->flags & LPTDF_NOIGNOREEDIT || GetWindowLongPtr(hwnd, GWL_STYLE) & ES_READONLY )
TranslateWindow( uuid, hwnd );
}
return TRUE;
@@ -126,7 +126,7 @@ static INT_PTR LPRegister(WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR GetDefaultCodePage(WPARAM,LPARAM)
+static INT_PTR GetDefaultCodePage(WPARAM, LPARAM)
{
return LangPackGetDefaultCodePage();
}
@@ -166,14 +166,14 @@ INT_PTR ReloadLangpack(WPARAM wParam, LPARAM lParam); int LoadLangPackServices(void)
{
- CreateServiceFunction(MS_LANGPACK_TRANSLATESTRING,TranslateString);
- CreateServiceFunction(MS_LANGPACK_TRANSLATEMENU,TranslateMenu);
- CreateServiceFunction(MS_LANGPACK_TRANSLATEDIALOG,TranslateDialog);
- CreateServiceFunction(MS_LANGPACK_GETCODEPAGE,GetDefaultCodePage);
- CreateServiceFunction(MS_LANGPACK_GETLOCALE,GetDefaultLocale);
- CreateServiceFunction(MS_LANGPACK_PCHARTOTCHAR,PcharToTchar);
- CreateServiceFunction(MS_LANGPACK_REGISTER,LPRegister);
- CreateServiceFunction(MS_LANGPACK_RELOAD,ReloadLangpack);
+ CreateServiceFunction(MS_LANGPACK_TRANSLATESTRING, TranslateString);
+ CreateServiceFunction(MS_LANGPACK_TRANSLATEMENU, TranslateMenu);
+ CreateServiceFunction(MS_LANGPACK_TRANSLATEDIALOG, TranslateDialog);
+ CreateServiceFunction(MS_LANGPACK_GETCODEPAGE, GetDefaultCodePage);
+ CreateServiceFunction(MS_LANGPACK_GETLOCALE, GetDefaultLocale);
+ CreateServiceFunction(MS_LANGPACK_PCHARTOTCHAR, PcharToTchar);
+ CreateServiceFunction(MS_LANGPACK_REGISTER, LPRegister);
+ CreateServiceFunction(MS_LANGPACK_RELOAD, ReloadLangpack);
return 0;
}
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp index 80e005ad7a..cb46c6d14d 100644 --- a/src/modules/netlib/netlib.cpp +++ b/src/modules/netlib/netlib.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -55,7 +55,7 @@ void NetlibInitializeNestedCS(struct NetlibNestedCriticalSection *nlncs) {
nlncs->dwOwningThreadId= 0;
nlncs->lockCount=0;
- nlncs->hMutex=CreateMutex(NULL,FALSE,NULL);
+ nlncs->hMutex=CreateMutex(NULL, FALSE, NULL);
}
void NetlibDeleteNestedCS(struct NetlibNestedCriticalSection *nlncs)
@@ -63,12 +63,12 @@ void NetlibDeleteNestedCS(struct NetlibNestedCriticalSection *nlncs) CloseHandle(nlncs->hMutex);
}
-int NetlibEnterNestedCS(struct NetlibConnection *nlc,int which)
+int NetlibEnterNestedCS(struct NetlibConnection *nlc, int which)
{
struct NetlibNestedCriticalSection *nlncs;
DWORD dwCurrentThreadId=GetCurrentThreadId();
- WaitForSingleObject(hConnectionHeaderMutex,INFINITE);
+ WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
if (nlc == NULL || nlc->handleType != NLH_CONNECTION) {
ReleaseMutex(hConnectionHeaderMutex);
SetLastError(ERROR_INVALID_PARAMETER);
@@ -83,7 +83,7 @@ int NetlibEnterNestedCS(struct NetlibConnection *nlc,int which) InterlockedIncrement(&nlc->dontCloseNow);
ResetEvent(nlc->hOkToCloseEvent);
ReleaseMutex(hConnectionHeaderMutex);
- WaitForSingleObject(nlncs->hMutex,INFINITE);
+ WaitForSingleObject(nlncs->hMutex, INFINITE);
nlncs->dwOwningThreadId=dwCurrentThreadId;
nlncs->lockCount=1;
if (InterlockedDecrement(&nlc->dontCloseNow) == 0)
@@ -99,22 +99,22 @@ void NetlibLeaveNestedCS(struct NetlibNestedCriticalSection *nlncs) }
}
-static INT_PTR GetNetlibUserSettingInt(const char *szUserModule,const char *szSetting,int defValue)
+static INT_PTR GetNetlibUserSettingInt(const char *szUserModule, const char *szSetting, int defValue)
{
DBVARIANT dbv;
- if (DBGetContactSetting(NULL,szUserModule,szSetting,&dbv)
- && DBGetContactSetting(NULL,"Netlib",szSetting,&dbv))
+ if (DBGetContactSetting(NULL, szUserModule, szSetting, &dbv)
+ && DBGetContactSetting(NULL, "Netlib", szSetting, &dbv))
return defValue;
if (dbv.type == DBVT_BYTE) return dbv.bVal;
if (dbv.type == DBVT_WORD) return dbv.wVal;
return dbv.dVal;
}
-static char *GetNetlibUserSettingString(const char *szUserModule,const char *szSetting,int decode)
+static char *GetNetlibUserSettingString(const char *szUserModule, const char *szSetting, int decode)
{
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL,szUserModule,szSetting,&dbv)
- && DBGetContactSettingString(NULL,"Netlib",szSetting,&dbv)) {
+ if (DBGetContactSettingString(NULL, szUserModule, szSetting, &dbv)
+ && DBGetContactSettingString(NULL, "Netlib", szSetting, &dbv)) {
return NULL;
}
else {
@@ -127,7 +127,7 @@ static char *GetNetlibUserSettingString(const char *szUserModule,const char *szS }
}
-static INT_PTR NetlibRegisterUser(WPARAM,LPARAM lParam)
+static INT_PTR NetlibRegisterUser(WPARAM, LPARAM lParam)
{
NETLIBUSER *nlu=(NETLIBUSER*)lParam;
struct NetlibUser *thisUser;
@@ -170,28 +170,28 @@ static INT_PTR NetlibRegisterUser(WPARAM,LPARAM lParam) thisUser->user.szHttpGatewayHello=NULL;
thisUser->settings.cbSize=sizeof(NETLIBUSERSETTINGS);
- thisUser->settings.useProxy=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLUseProxy",0);
- thisUser->settings.proxyType=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLProxyType",PROXYTYPE_SOCKS5);
+ thisUser->settings.useProxy=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLUseProxy", 0);
+ thisUser->settings.proxyType=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLProxyType", PROXYTYPE_SOCKS5);
if (thisUser->user.flags&NUF_NOHTTPSOPTION && thisUser->settings.proxyType == PROXYTYPE_HTTPS)
thisUser->settings.proxyType=PROXYTYPE_HTTP;
if (!(thisUser->user.flags&(NUF_HTTPCONNS|NUF_HTTPGATEWAY)) && thisUser->settings.proxyType == PROXYTYPE_HTTP) {
thisUser->settings.useProxy=0;
thisUser->settings.proxyType=PROXYTYPE_SOCKS5;
}
- thisUser->settings.szProxyServer=GetNetlibUserSettingString(thisUser->user.szSettingsModule,"NLProxyServer",0);
- thisUser->settings.wProxyPort=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLProxyPort",1080);
- thisUser->settings.useProxyAuth=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLUseProxyAuth",0);
- thisUser->settings.szProxyAuthUser=GetNetlibUserSettingString(thisUser->user.szSettingsModule,"NLProxyAuthUser",0);
- thisUser->settings.szProxyAuthPassword=GetNetlibUserSettingString(thisUser->user.szSettingsModule,"NLProxyAuthPassword",1);
- thisUser->settings.dnsThroughProxy=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLDnsThroughProxy",1);
- thisUser->settings.specifyIncomingPorts=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLSpecifyIncomingPorts",0);
- thisUser->settings.szIncomingPorts=GetNetlibUserSettingString(thisUser->user.szSettingsModule,"NLIncomingPorts",0);
- thisUser->settings.specifyOutgoingPorts=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLSpecifyOutgoingPorts",0);
- thisUser->settings.szOutgoingPorts=GetNetlibUserSettingString(thisUser->user.szSettingsModule,"NLOutgoingPorts",0);
- thisUser->settings.enableUPnP=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLEnableUPnP",1); //default to on
- thisUser->settings.validateSSL=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLValidateSSL",0);
-
- thisUser->toLog=GetNetlibUserSettingInt(thisUser->user.szSettingsModule,"NLlog",1);
+ thisUser->settings.szProxyServer=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyServer", 0);
+ thisUser->settings.wProxyPort=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLProxyPort", 1080);
+ thisUser->settings.useProxyAuth=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLUseProxyAuth", 0);
+ thisUser->settings.szProxyAuthUser=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyAuthUser", 0);
+ thisUser->settings.szProxyAuthPassword=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLProxyAuthPassword", 1);
+ thisUser->settings.dnsThroughProxy=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLDnsThroughProxy", 1);
+ thisUser->settings.specifyIncomingPorts=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLSpecifyIncomingPorts", 0);
+ thisUser->settings.szIncomingPorts=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLIncomingPorts", 0);
+ thisUser->settings.specifyOutgoingPorts=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLSpecifyOutgoingPorts", 0);
+ thisUser->settings.szOutgoingPorts=GetNetlibUserSettingString(thisUser->user.szSettingsModule, "NLOutgoingPorts", 0);
+ thisUser->settings.enableUPnP=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLEnableUPnP", 1); //default to on
+ thisUser->settings.validateSSL=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLValidateSSL", 0);
+
+ thisUser->toLog=GetNetlibUserSettingInt(thisUser->user.szSettingsModule, "NLlog", 1);
EnterCriticalSection(&csNetlibUser);
netlibUser.insert(thisUser);
@@ -199,7 +199,7 @@ static INT_PTR NetlibRegisterUser(WPARAM,LPARAM lParam) return (INT_PTR)thisUser;
}
-static INT_PTR NetlibGetUserSettings(WPARAM wParam,LPARAM lParam)
+static INT_PTR NetlibGetUserSettings(WPARAM wParam, LPARAM lParam)
{
NETLIBUSERSETTINGS *nlus=(NETLIBUSERSETTINGS*)lParam;
struct NetlibUser *nlu=(struct NetlibUser*)wParam;
@@ -212,7 +212,7 @@ static INT_PTR NetlibGetUserSettings(WPARAM wParam,LPARAM lParam) return 1;
}
-static INT_PTR NetlibSetUserSettings(WPARAM wParam,LPARAM lParam)
+static INT_PTR NetlibSetUserSettings(WPARAM wParam, LPARAM lParam)
{
NETLIBUSERSETTINGS *nlus=(NETLIBUSERSETTINGS*)lParam;
struct NetlibUser *nlu=(struct NetlibUser*)wParam;
@@ -221,7 +221,7 @@ static INT_PTR NetlibSetUserSettings(WPARAM wParam,LPARAM lParam) SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
- NetlibSaveUserSettingsStruct(nlu->user.szSettingsModule,nlus);
+ NetlibSaveUserSettingsStruct(nlu->user.szSettingsModule, nlus);
return 1;
}
@@ -267,7 +267,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM) HANDLE waitHandles[4];
DWORD waitResult;
- WaitForSingleObject(hConnectionHeaderMutex,INFINITE);
+ WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
if (nlc->usingHttpGateway)
{
HttpGatewayRemovePacket(nlc, -1);
@@ -286,7 +286,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM) waitHandles[1]=nlc->hOkToCloseEvent;
waitHandles[2]=nlc->ncsRecv.hMutex;
waitHandles[3]=nlc->ncsSend.hMutex;
- waitResult=WaitForMultipleObjects( SIZEOF(waitHandles),waitHandles,TRUE,INFINITE);
+ waitResult=WaitForMultipleObjects( SIZEOF(waitHandles), waitHandles, TRUE, INFINITE);
if (waitResult<WAIT_OBJECT_0 || waitResult >= WAIT_OBJECT_0 + SIZEOF(waitHandles)) {
ReleaseMutex(hConnectionHeaderMutex);
SetLastError(ERROR_INVALID_PARAMETER); //already been closed
@@ -304,7 +304,7 @@ INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM) CloseHandle(nlc->hOkToCloseEvent);
DeleteCriticalSection(&nlc->csHttpSequenceNums);
ReleaseMutex(hConnectionHeaderMutex);
- NetlibLogf(nlc->nlu,"(%p:%u) Connection closed",nlc,nlc->s);
+ NetlibLogf(nlc->nlu, "(%p:%u) Connection closed", nlc, nlc->s);
break;
}
case NLH_BOUNDPORT:
@@ -332,7 +332,7 @@ static INT_PTR NetlibGetSocket(WPARAM wParam, LPARAM) }
else
{
- WaitForSingleObject(hConnectionHeaderMutex,INFINITE);
+ WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
switch (GetNetlibHandleType(wParam))
{
case NLH_CONNECTION:
@@ -384,7 +384,7 @@ INT_PTR NetlibShutdown(WPARAM wParam, LPARAM) {
if (wParam)
{
- WaitForSingleObject(hConnectionHeaderMutex,INFINITE);
+ WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
switch(GetNetlibHandleType(wParam)) {
case NLH_CONNECTION:
{
@@ -409,29 +409,29 @@ INT_PTR NetlibShutdown(WPARAM wParam, LPARAM) }
static const char szHexDigits[]="0123456789ABCDEF";
-INT_PTR NetlibHttpUrlEncode(WPARAM,LPARAM lParam)
+INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam)
{
- unsigned char *szOutput,*szInput=(unsigned char*)lParam;
- unsigned char *pszIn,*pszOut;
+ unsigned char *szOutput, *szInput=(unsigned char*)lParam;
+ unsigned char *pszIn, *pszOut;
int outputLen;
if (szInput == NULL) {
SetLastError(ERROR_INVALID_PARAMETER);
return (INT_PTR)(char*)NULL;
}
- for (outputLen=0,pszIn=szInput;*pszIn;pszIn++) {
+ for (outputLen=0, pszIn=szInput;*pszIn;pszIn++) {
if ( (48 <= *pszIn && *pszIn <= 57) ||//0-9
(65 <= *pszIn && *pszIn <= 90) ||//ABC...XYZ
(97 <= *pszIn && *pszIn <= 122) ||//abc...xyz
*pszIn == '-' || *pszIn == '_' || *pszIn == '.' || *pszIn == ' ') outputLen++;
else outputLen+=3;
}
- szOutput=(unsigned char*)HeapAlloc(GetProcessHeap(),0,outputLen+1);
+ szOutput=(unsigned char*)HeapAlloc(GetProcessHeap(), 0, outputLen+1);
if (szOutput == NULL) {
SetLastError(ERROR_OUTOFMEMORY);
return (INT_PTR)(unsigned char*)NULL;
}
- for (pszOut=szOutput,pszIn=szInput;*pszIn;pszIn++) {
+ for (pszOut=szOutput, pszIn=szInput;*pszIn;pszIn++) {
if ( (48 <= *pszIn && *pszIn <= 57) ||
(65 <= *pszIn && *pszIn <= 90) ||
(97 <= *pszIn && *pszIn <= 122) ||
@@ -464,7 +464,7 @@ INT_PTR NetlibBase64Encode(WPARAM, LPARAM lParam) return 0;
}
nlb64->cchEncoded=Netlib_GetBase64EncodedBufferSize(nlb64->cbDecoded);
- for (iIn=0,pbIn=nlb64->pbDecoded,pszOut=nlb64->pszEncoded;iIn<nlb64->cbDecoded;iIn+=3,pbIn+=3,pszOut+=4) {
+ for (iIn=0, pbIn=nlb64->pbDecoded, pszOut=nlb64->pszEncoded;iIn<nlb64->cbDecoded;iIn+=3, pbIn+=3, pszOut+=4) {
pszOut[0]=base64chars[pbIn[0]>>2];
if (nlb64->cbDecoded-iIn == 1) {
pszOut[1]=base64chars[(pbIn[0]&3)<<4];
@@ -503,7 +503,7 @@ INT_PTR NetlibBase64Decode(WPARAM, LPARAM lParam) NETLIBBASE64 *nlb64=(NETLIBBASE64*)lParam;
char *pszIn;
PBYTE pbOut;
- BYTE b1,b2,b3,b4;
+ BYTE b1, b2, b3, b4;
int iIn;
if (nlb64 == NULL || nlb64->pszEncoded == NULL || nlb64->pbDecoded == NULL) {
@@ -519,7 +519,7 @@ INT_PTR NetlibBase64Decode(WPARAM, LPARAM lParam) return 0;
}
nlb64->cbDecoded=Netlib_GetBase64DecodedBufferSize(nlb64->cchEncoded);
- for (iIn=0,pszIn=nlb64->pszEncoded,pbOut=nlb64->pbDecoded;iIn<nlb64->cchEncoded;iIn+=4,pszIn+=4,pbOut+=3) {
+ for (iIn=0, pszIn=nlb64->pszEncoded, pbOut=nlb64->pbDecoded;iIn<nlb64->cchEncoded;iIn+=4, pszIn+=4, pbOut+=3) {
b1=Base64CharToInt(pszIn[0]);
b2=Base64CharToInt(pszIn[1]);
b3=Base64CharToInt(pszIn[2]);
@@ -571,12 +571,12 @@ int LoadNetlibModule(void) bModuleInitialized = TRUE;
- WSAStartup(MAKEWORD(2,2), &wsadata);
+ WSAStartup(MAKEWORD(2, 2), &wsadata);
- HookEvent(ME_OPT_INITIALISE,NetlibOptInitialise);
+ HookEvent(ME_OPT_INITIALISE, NetlibOptInitialise);
InitializeCriticalSection(&csNetlibUser);
- hConnectionHeaderMutex=CreateMutex(NULL,FALSE,NULL);
+ hConnectionHeaderMutex=CreateMutex(NULL, FALSE, NULL);
NetlibLogInit();
connectionTimeout = 0;
@@ -629,38 +629,38 @@ int LoadNetlibModule(void) }
}
- hConnectionOpenMutex = connectionTimeout ? CreateMutex(NULL,FALSE,NULL) : NULL;
+ hConnectionOpenMutex = connectionTimeout ? CreateMutex(NULL, FALSE, NULL) : NULL;
g_LastConnectionTick = GetTickCount();
- CreateServiceFunction(MS_NETLIB_REGISTERUSER,NetlibRegisterUser);
- CreateServiceFunction(MS_NETLIB_GETUSERSETTINGS,NetlibGetUserSettings);
- CreateServiceFunction(MS_NETLIB_SETUSERSETTINGS,NetlibSetUserSettings);
- CreateServiceFunction(MS_NETLIB_CLOSEHANDLE,NetlibCloseHandle);
- CreateServiceFunction(MS_NETLIB_BINDPORT,NetlibBindPort);
- CreateServiceFunction(MS_NETLIB_OPENCONNECTION,NetlibOpenConnection);
- CreateServiceFunction(MS_NETLIB_SETHTTPPROXYINFO,NetlibHttpGatewaySetInfo);
- CreateServiceFunction(MS_NETLIB_SETSTICKYHEADERS,NetlibHttpSetSticky);
- CreateServiceFunction(MS_NETLIB_GETSOCKET,NetlibGetSocket);
- CreateServiceFunction(MS_NETLIB_URLENCODE,NetlibHttpUrlEncode);
- CreateServiceFunction(MS_NETLIB_BASE64ENCODE,NetlibBase64Encode);
- CreateServiceFunction(MS_NETLIB_BASE64DECODE,NetlibBase64Decode);
- CreateServiceFunction(MS_NETLIB_SENDHTTPREQUEST,NetlibHttpSendRequest);
- CreateServiceFunction(MS_NETLIB_RECVHTTPHEADERS,NetlibHttpRecvHeaders);
- CreateServiceFunction(MS_NETLIB_FREEHTTPREQUESTSTRUCT,NetlibHttpFreeRequestStruct);
- CreateServiceFunction(MS_NETLIB_HTTPTRANSACTION,NetlibHttpTransaction);
- CreateServiceFunction(MS_NETLIB_SEND,NetlibSend);
- CreateServiceFunction(MS_NETLIB_RECV,NetlibRecv);
- CreateServiceFunction(MS_NETLIB_SELECT,NetlibSelect);
- CreateServiceFunction(MS_NETLIB_SELECTEX,NetlibSelectEx);
- CreateServiceFunction(MS_NETLIB_SHUTDOWN,NetlibShutdown);
- CreateServiceFunction(MS_NETLIB_CREATEPACKETRECVER,NetlibPacketRecverCreate);
- CreateServiceFunction(MS_NETLIB_GETMOREPACKETS,NetlibPacketRecverGetMore);
- CreateServiceFunction(MS_NETLIB_SETPOLLINGTIMEOUT,NetlibHttpSetPollingTimeout);
- CreateServiceFunction(MS_NETLIB_STARTSSL,NetlibStartSsl);
- CreateServiceFunction(MS_NETLIB_STARINGTOADDRESS,NetlibStringToAddressSrv);
- CreateServiceFunction(MS_NETLIB_ADDRESSTOSTRING,NetlibAddressToStringSrv);
- CreateServiceFunction(MS_NETLIB_GETCONNECTIONINFO,NetlibGetConnectionInfoSrv);
- CreateServiceFunction(MS_NETLIB_GETMYIP,NetlibGetMyIp);
+ CreateServiceFunction(MS_NETLIB_REGISTERUSER, NetlibRegisterUser);
+ CreateServiceFunction(MS_NETLIB_GETUSERSETTINGS, NetlibGetUserSettings);
+ CreateServiceFunction(MS_NETLIB_SETUSERSETTINGS, NetlibSetUserSettings);
+ CreateServiceFunction(MS_NETLIB_CLOSEHANDLE, NetlibCloseHandle);
+ CreateServiceFunction(MS_NETLIB_BINDPORT, NetlibBindPort);
+ CreateServiceFunction(MS_NETLIB_OPENCONNECTION, NetlibOpenConnection);
+ CreateServiceFunction(MS_NETLIB_SETHTTPPROXYINFO, NetlibHttpGatewaySetInfo);
+ CreateServiceFunction(MS_NETLIB_SETSTICKYHEADERS, NetlibHttpSetSticky);
+ CreateServiceFunction(MS_NETLIB_GETSOCKET, NetlibGetSocket);
+ CreateServiceFunction(MS_NETLIB_URLENCODE, NetlibHttpUrlEncode);
+ CreateServiceFunction(MS_NETLIB_BASE64ENCODE, NetlibBase64Encode);
+ CreateServiceFunction(MS_NETLIB_BASE64DECODE, NetlibBase64Decode);
+ CreateServiceFunction(MS_NETLIB_SENDHTTPREQUEST, NetlibHttpSendRequest);
+ CreateServiceFunction(MS_NETLIB_RECVHTTPHEADERS, NetlibHttpRecvHeaders);
+ CreateServiceFunction(MS_NETLIB_FREEHTTPREQUESTSTRUCT, NetlibHttpFreeRequestStruct);
+ CreateServiceFunction(MS_NETLIB_HTTPTRANSACTION, NetlibHttpTransaction);
+ CreateServiceFunction(MS_NETLIB_SEND, NetlibSend);
+ CreateServiceFunction(MS_NETLIB_RECV, NetlibRecv);
+ CreateServiceFunction(MS_NETLIB_SELECT, NetlibSelect);
+ CreateServiceFunction(MS_NETLIB_SELECTEX, NetlibSelectEx);
+ CreateServiceFunction(MS_NETLIB_SHUTDOWN, NetlibShutdown);
+ CreateServiceFunction(MS_NETLIB_CREATEPACKETRECVER, NetlibPacketRecverCreate);
+ CreateServiceFunction(MS_NETLIB_GETMOREPACKETS, NetlibPacketRecverGetMore);
+ CreateServiceFunction(MS_NETLIB_SETPOLLINGTIMEOUT, NetlibHttpSetPollingTimeout);
+ CreateServiceFunction(MS_NETLIB_STARTSSL, NetlibStartSsl);
+ CreateServiceFunction(MS_NETLIB_STARINGTOADDRESS, NetlibStringToAddressSrv);
+ CreateServiceFunction(MS_NETLIB_ADDRESSTOSTRING, NetlibAddressToStringSrv);
+ CreateServiceFunction(MS_NETLIB_GETCONNECTIONINFO, NetlibGetConnectionInfoSrv);
+ CreateServiceFunction(MS_NETLIB_GETMYIP, NetlibGetMyIp);
hRecvEvent = CreateHookableEvent(ME_NETLIB_FASTRECV);
hSendEvent = CreateHookableEvent(ME_NETLIB_FASTSEND);
diff --git a/src/modules/netlib/netlib.h b/src/modules/netlib/netlib.h index 8939e7fafc..88a1db2284 100644 --- a/src/modules/netlib/netlib.h +++ b/src/modules/netlib/netlib.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -74,7 +74,7 @@ struct NetlibConnection CRITICAL_SECTION csHttpSequenceNums;
HANDLE hOkToCloseEvent;
LONG dontCloseNow;
- struct NetlibNestedCriticalSection ncsSend,ncsRecv;
+ struct NetlibNestedCriticalSection ncsSend, ncsRecv;
HSSL hSsl;
struct NetlibHTTPProxyPacketQueue * pHttpProxyPacketQueue;
char *szNewUrl;
@@ -107,16 +107,16 @@ struct NetlibPacketRecver { //netlib.c
void NetlibFreeUserSettingsStruct(NETLIBUSERSETTINGS *settings);
void NetlibDoClose(NetlibConnection *nlc, bool noShutdown = false);
-INT_PTR NetlibCloseHandle(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibCloseHandle(WPARAM wParam, LPARAM lParam);
void NetlibInitializeNestedCS(struct NetlibNestedCriticalSection *nlncs);
void NetlibDeleteNestedCS(struct NetlibNestedCriticalSection *nlncs);
#define NLNCS_SEND 0
#define NLNCS_RECV 1
-int NetlibEnterNestedCS(struct NetlibConnection *nlc,int which);
+int NetlibEnterNestedCS(struct NetlibConnection *nlc, int which);
void NetlibLeaveNestedCS(struct NetlibNestedCriticalSection *nlncs);
-INT_PTR NetlibBase64Encode(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibBase64Decode(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibHttpUrlEncode(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibBase64Encode(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibBase64Decode(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibHttpUrlEncode(WPARAM wParam, LPARAM lParam);
extern CRITICAL_SECTION csNetlibUser;
extern LIST<NetlibUser> netlibUser;
@@ -129,62 +129,62 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps); //netlibbind.c
int NetlibFreeBoundPort(struct NetlibBoundPort *nlbp);
-INT_PTR NetlibBindPort(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam);
bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn);
//netlibhttp.c
-INT_PTR NetlibHttpSendRequest(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibHttpRecvHeaders(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibHttpFreeRequestStruct(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibHttpTransaction(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibHttpFreeRequestStruct(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam);
void NetlibHttpSetLastErrorUsingHttpResult(int result);
NETLIBHTTPREQUEST* NetlibHttpRecv(NetlibConnection* nlc, DWORD hflags, DWORD dflags, bool isConnect = false);
void NetlibConnFromUrl(const char* szUrl, bool secur, NETLIBOPENCONNECTION &nloc);
//netlibhttpproxy.c
-int NetlibInitHttpConnection(struct NetlibConnection *nlc,struct NetlibUser *nlu,NETLIBOPENCONNECTION *nloc);
-int NetlibHttpGatewayRecv(struct NetlibConnection *nlc,char *buf,int len,int flags);
-int NetlibHttpGatewayPost(struct NetlibConnection *nlc,const char *buf,int len,int flags);
+int NetlibInitHttpConnection(struct NetlibConnection *nlc, struct NetlibUser *nlu, NETLIBOPENCONNECTION *nloc);
+int NetlibHttpGatewayRecv(struct NetlibConnection *nlc, char *buf, int len, int flags);
+int NetlibHttpGatewayPost(struct NetlibConnection *nlc, const char *buf, int len, int flags);
void HttpGatewayRemovePacket(NetlibConnection *nlc, int pck);
-INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibHttpSetPollingTimeout(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibHttpSetPollingTimeout(WPARAM wParam, LPARAM lParam);
INT_PTR NetlibHttpSetSticky(WPARAM wParam, LPARAM lParam);
//netliblog.c
void NetlibLogShowOptions(void);
-void NetlibDumpData(struct NetlibConnection *nlc,PBYTE buf,int len,int sent,int flags);
+void NetlibDumpData(struct NetlibConnection *nlc, PBYTE buf, int len, int sent, int flags);
void NetlibLogf(NetlibUser* nlu, const char *fmt, ...);
void NetlibLogInit(void);
void NetlibLogShutdown(void);
//netlibopenconn.c
-DWORD DnsLookup(struct NetlibUser *nlu,const char *szHost);
-int WaitUntilReadable(SOCKET s,DWORD dwTimeout, bool check = false);
-int WaitUntilWritable(SOCKET s,DWORD dwTimeout);
+DWORD DnsLookup(struct NetlibUser *nlu, const char *szHost);
+int WaitUntilReadable(SOCKET s, DWORD dwTimeout, bool check = false);
+int WaitUntilWritable(SOCKET s, DWORD dwTimeout);
bool NetlibDoConnect(NetlibConnection *nlc);
bool NetlibReconnect(NetlibConnection *nlc);
-INT_PTR NetlibOpenConnection(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibOpenConnection(WPARAM wParam, LPARAM lParam);
INT_PTR NetlibStartSsl(WPARAM wParam, LPARAM lParam);
//netlibopts.c
-int NetlibOptInitialise(WPARAM wParam,LPARAM lParam);
-void NetlibSaveUserSettingsStruct(const char *szSettingsModule,NETLIBUSERSETTINGS *settings);
+int NetlibOptInitialise(WPARAM wParam, LPARAM lParam);
+void NetlibSaveUserSettingsStruct(const char *szSettingsModule, NETLIBUSERSETTINGS *settings);
//netlibpktrecver.c
-INT_PTR NetlibPacketRecverCreate(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibPacketRecverGetMore(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibPacketRecverCreate(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibPacketRecverGetMore(WPARAM wParam, LPARAM lParam);
//netlibsock.c
#define NL_SELECT_READ 0x0001
#define NL_SELECT_WRITE 0x0002
#define NL_SELECT_ALL (NL_SELECT_READ+NL_SELECT_WRITE)
-INT_PTR NetlibSend(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibRecv(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibSelect(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibSelectEx(WPARAM wParam,LPARAM lParam);
-INT_PTR NetlibShutdown(WPARAM wParam,LPARAM lParam);
+INT_PTR NetlibSend(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibRecv(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibSelect(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibSelectEx(WPARAM wParam, LPARAM lParam);
+INT_PTR NetlibShutdown(WPARAM wParam, LPARAM lParam);
bool NetlibStringToAddress(const char* str, SOCKADDR_INET_M* addr);
char* NetlibAddressToString(SOCKADDR_INET_M* addr);
@@ -192,7 +192,7 @@ void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo); NETLIBIPLIST* GetMyIp(unsigned flags);
//netlibupnp.c
-bool NetlibUPnPAddPortMapping(WORD intport, char *proto,
+bool NetlibUPnPAddPortMapping(WORD intport, char *proto,
WORD *extport, DWORD *extip, bool search);
void NetlibUPnPDeletePortMapping(WORD extport, char* proto);
void NetlibUPnPCleanup(void*);
@@ -211,11 +211,11 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge bool http, unsigned& complete);
-static __inline INT_PTR NLSend(struct NetlibConnection *nlc,const char *buf,int len,int flags) {
- NETLIBBUFFER nlb={(char*)buf,len,flags};
- return NetlibSend((WPARAM)nlc,(LPARAM)&nlb);
+static __inline INT_PTR NLSend(struct NetlibConnection *nlc, const char *buf, int len, int flags) {
+ NETLIBBUFFER nlb={(char*)buf, len, flags};
+ return NetlibSend((WPARAM)nlc, (LPARAM)&nlb);
}
-static __inline INT_PTR NLRecv(struct NetlibConnection *nlc,char *buf,int len,int flags) {
- NETLIBBUFFER nlb={buf,len,flags};
- return NetlibRecv((WPARAM)nlc,(LPARAM)&nlb);
+static __inline INT_PTR NLRecv(struct NetlibConnection *nlc, char *buf, int len, int flags) {
+ NETLIBBUFFER nlb={buf, len, flags};
+ return NetlibRecv((WPARAM)nlc, (LPARAM)&nlb);
}
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp index 21f841ff3c..a3164216cd 100644 --- a/src/modules/netlib/netlibautoproxy.cpp +++ b/src/modules/netlib/netlibautoproxy.cpp @@ -1,7 +1,7 @@ /*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2010-2011 Miranda ICQ/IM project,
+Copyright 2010-2011 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -10,7 +10,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.
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////
// ResolveHostName (a helper function)
/////////////////////////////////////////////////////////////////////
-DWORD __stdcall ResolveHostName(LPSTR lpszHostName,
+DWORD __stdcall ResolveHostName(LPSTR lpszHostName,
LPSTR lpszIPAddress, LPDWORD lpdwIPAddressSize)
{
if (*lpdwIPAddressSize < 17 || lpszIPAddress == NULL)
@@ -99,13 +99,13 @@ BOOL __stdcall IsInNet(LPSTR lpszIPAddress, LPSTR lpszDest, LPSTR lpszMask) static const AutoProxyHelperVtbl OurVtbl =
{
- IsResolvable,
- GetIPAddress,
- ResolveHostName,
- IsInNet,
- NULL,
- NULL,
- NULL,
+ IsResolvable,
+ GetIPAddress,
+ ResolveHostName,
+ IsInNet,
+ NULL,
+ NULL,
+ NULL,
NULL
};
diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp index 5e8d76d464..7e5724994d 100644 --- a/src/modules/netlib/netlibbind.cpp +++ b/src/modules/netlib/netlibbind.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -55,7 +55,7 @@ bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn) for (psz=szPorts;*psz;)
{
- while (*psz == ' ' || *psz == ',') psz++;
+ while (*psz == ' ' || *psz == ', ') psz++;
portMin = strtol(psz, &pszEnd, 0);
if (pszEnd == psz) break;
while (*pszEnd == ' ') pszEnd++;
@@ -122,7 +122,7 @@ int NetlibFreeBoundPort(struct NetlibBoundPort *nlbp) {
closesocket(nlbp->s);
closesocket(nlbp->s6);
- WaitForSingleObject(nlbp->hThread,INFINITE);
+ WaitForSingleObject(nlbp->hThread, INFINITE);
CloseHandle(nlbp->hThread);
NetlibLogf(nlbp->nlu, "(%u) Port %u closed for incoming connections", nlbp->s, nlbp->wPort);
mir_free(nlbp);
@@ -213,7 +213,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) nlbp->pExtra = (nlb->cbSize != NETLIBBIND_SIZEOF_V1) ? nlb->pExtra : NULL;
if (nlbp->s == INVALID_SOCKET && nlbp->s6 == INVALID_SOCKET)
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"socket",WSAGetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "socket", WSAGetLastError());
mir_free(nlbp);
return 0;
}
@@ -238,7 +238,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) be asking for whatever was in nlb->wPort*/
if (nlb->wPort != 0)
{
- NetlibLogf(nlu,"%s %d: trying to bind port %d, this 'feature' can be abused, please be sure you want to allow it.",__FILE__,__LINE__,nlb->wPort);
+ NetlibLogf(nlu, "%s %d: trying to bind port %d, this 'feature' can be abused, please be sure you want to allow it.", __FILE__, __LINE__, nlb->wPort);
sin.sin_port = htons(nlb->wPort);
sin6.sin6_port = htons(nlb->wPort);
}
@@ -256,7 +256,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) }
if (!foundPort)
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"bind",WSAGetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "bind", WSAGetLastError());
closesocket(nlbp->s);
closesocket(nlbp->s6);
mir_free(nlbp);
@@ -265,7 +265,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) if (nlbp->s != INVALID_SOCKET && listen(nlbp->s, 5))
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"listen",WSAGetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "listen", WSAGetLastError());
closesocket(nlbp->s);
closesocket(nlbp->s6);
mir_free(nlbp);
@@ -274,7 +274,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) if (nlbp->s6 != INVALID_SOCKET && listen(nlbp->s6, 5))
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"listen",WSAGetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "listen", WSAGetLastError());
closesocket(nlbp->s);
closesocket(nlbp->s6);
mir_free(nlbp);
@@ -293,7 +293,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) nlb->wPort = ntohs(sin.Ipv6.sin6_port);
else
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"getsockname",WSAGetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "getsockname", WSAGetLastError());
closesocket(nlbp->s);
closesocket(nlbp->s6);
mir_free(nlbp);
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index fb027366bc..6c6c58a481 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -398,14 +398,14 @@ static int HttpPeekFirstResponseLine(NetlibConnection *nlc, DWORD dwTimeoutTime, return 1;
}
-static int SendHttpRequestAndData(struct NetlibConnection *nlc,struct ResizableCharBuffer *httpRequest,NETLIBHTTPREQUEST *nlhr,int sendContentLengthHeader)
+static int SendHttpRequestAndData(struct NetlibConnection *nlc, struct ResizableCharBuffer *httpRequest, NETLIBHTTPREQUEST *nlhr, int sendContentLengthHeader)
{
bool sendData = (nlhr->requestType == REQUEST_POST || nlhr->requestType == REQUEST_PUT);
if (sendContentLengthHeader && sendData)
- AppendToCharBuffer(httpRequest,"Content-Length: %d\r\n\r\n", nlhr->dataLength);
+ AppendToCharBuffer(httpRequest, "Content-Length: %d\r\n\r\n", nlhr->dataLength);
else
- AppendToCharBuffer(httpRequest,"\r\n");
+ AppendToCharBuffer(httpRequest, "\r\n");
DWORD hflags = (nlhr->flags & NLHRF_DUMPASTEXT ? MSG_DUMPASTEXT : 0) |
(nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND | NLHRF_NODUMPHEADERS) ?
@@ -420,7 +420,7 @@ static int SendHttpRequestAndData(struct NetlibConnection *nlc,struct ResizableC MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) |
(nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0);
- int sendResult = NLSend(nlc,nlhr->pData,nlhr->dataLength, sflags);
+ int sendResult = NLSend(nlc, nlhr->pData, nlhr->dataLength, sflags);
bytesSent = sendResult != SOCKET_ERROR ? bytesSent + sendResult : SOCKET_ERROR;
}
@@ -611,7 +611,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) DWORD dwTimeOutTime = hdrTimeout < 0 ? -1 : GetTickCount() + hdrTimeout;
if (!HttpPeekFirstResponseLine(nlc, dwTimeOutTime, fflags, &resultCode, NULL, NULL))
{
- NetlibLogf(nlc->nlu, "%s %d: %s Failed (%u %u)",__FILE__,__LINE__,"HttpPeekFirstResponseLine",GetLastError(), count);
+ NetlibLogf(nlc->nlu, "%s %d: %s Failed (%u %u)", __FILE__, __LINE__, "HttpPeekFirstResponseLine", GetLastError(), count);
DWORD err = GetLastError();
if (err == ERROR_TIMEOUT || err == ERROR_BAD_FORMAT || err == ERROR_BUFFER_OVERFLOW ||
lastFirstLineFail || nlc->termRequested || nlhr->requestType == REQUEST_CONNECT)
@@ -839,7 +839,7 @@ INT_PTR NetlibHttpFreeRequestStruct(WPARAM, LPARAM lParam) return 1;
}
-INT_PTR NetlibHttpRecvHeaders(WPARAM wParam,LPARAM lParam)
+INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam)
{
struct NetlibConnection *nlc = (struct NetlibConnection*)wParam;
NETLIBHTTPREQUEST *nlhr;
@@ -850,7 +850,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam,LPARAM lParam) int headersCount = 0, bufferSize = 8192;
bool headersCompleted = false;
- if (!NetlibEnterNestedCS(nlc,NLNCS_RECV))
+ if (!NetlibEnterNestedCS(nlc, NLNCS_RECV))
return 0;
dwRequestTimeoutTime = GetTickCount() + HTTPRECVDATATIMEOUT;
@@ -859,7 +859,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam,LPARAM lParam) nlhr->nlc = nlc; // Needed to id connection in the protocol HTTP gateway wrapper functions
nlhr->requestType = REQUEST_RESPONSE;
- if (!HttpPeekFirstResponseLine(nlc, dwRequestTimeoutTime, lParam | MSG_PEEK,
+ if (!HttpPeekFirstResponseLine(nlc, dwRequestTimeoutTime, lParam | MSG_PEEK,
&nlhr->resultCode, &nlhr->szResultDescr, &firstLineLength))
{
NetlibLeaveNestedCS(&nlc->ncsRecv);
@@ -992,13 +992,13 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) }
if (!doneUserAgentHeader)
{
- char *pspace,szMirandaVer[64];
+ char *pspace, szMirandaVer[64];
nlhrSend.headers[nlhrSend.headersCount].szName = "User-Agent";
nlhrSend.headers[nlhrSend.headersCount].szValue = szUserAgent;
++nlhrSend.headersCount;
- CallService(MS_SYSTEM_GETVERSIONTEXT,SIZEOF(szMirandaVer),(LPARAM)szMirandaVer);
- pspace=strchr(szMirandaVer,' ');
+ CallService(MS_SYSTEM_GETVERSIONTEXT, SIZEOF(szMirandaVer), (LPARAM)szMirandaVer);
+ pspace=strchr(szMirandaVer, ' ');
if (pspace)
{
*pspace++ = '\0';
@@ -1220,14 +1220,14 @@ next: for (;;)
{
recvResult = RecvWithTimeoutTime(nlc, GetTickCount() + HTTPRECVDATATIMEOUT,
- nlhrReply->pData + nlhrReply->dataLength,
+ nlhrReply->pData + nlhrReply->dataLength,
dataBufferAlloced - nlhrReply->dataLength - 1,
dflags | (cenctype ? MSG_NODUMP : 0));
if (recvResult == 0) break;
if (recvResult == SOCKET_ERROR)
{
- NetlibHttpFreeRequestStruct(0,(LPARAM)nlhrReply);
+ NetlibHttpFreeRequestStruct(0, (LPARAM)nlhrReply);
return NULL;
}
nlhrReply->dataLength += recvResult;
diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp index a760aee43d..6b48894d34 100644 --- a/src/modules/netlib/netlibhttpproxy.cpp +++ b/src/modules/netlib/netlibhttpproxy.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -25,10 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef enum
{
- reqHelloGet,
- reqOldGet,
- reqOldPost,
- reqNewPost,
+ reqHelloGet,
+ reqOldGet,
+ reqOldPost,
+ reqNewPost,
}
RequestType;
@@ -151,7 +151,7 @@ static bool NetlibHttpGatewaySend(struct NetlibConnection *nlc, RequestType reqT // nlhrSend.headers[3].szName = "Accept-Encoding";
// nlhrSend.headers[3].szValue = "deflate, gzip";
- return NetlibHttpSendRequest((WPARAM)nlc,(LPARAM)&nlhrSend) != SOCKET_ERROR;
+ return NetlibHttpSendRequest((WPARAM)nlc, (LPARAM)&nlhrSend) != SOCKET_ERROR;
}
static bool NetlibHttpGatewayStdPost(NetlibConnection *nlc, int& numPackets)
@@ -476,7 +476,7 @@ int NetlibInitHttpConnection(struct NetlibConnection *nlc, struct NetlibUser *nl return 1;
}
-INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam,LPARAM lParam)
+INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam, LPARAM lParam)
{
NETLIBHTTPPROXYINFO *nlhpi=(NETLIBHTTPPROXYINFO*)lParam;
struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 92496eaa5c..586d160baf 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -42,8 +42,8 @@ struct { TCHAR* szUserFile;
int timeFormat;
int showUser;
- int dumpSent,dumpRecv,dumpProxy,dumpSsl;
- int textDumps,autoDetectText;
+ int dumpSent, dumpRecv, dumpProxy, dumpSsl;
+ int textDumps, autoDetectText;
CRITICAL_SECTION cs;
int save;
} logOptions = {0};
@@ -53,44 +53,44 @@ typedef struct { const char* pszMsg;
} LOGMSG;
-static __int64 mirandaStartTime,perfCounterFreq;
+static __int64 mirandaStartTime, perfCounterFreq;
static int bIsActive = TRUE;
static HANDLE hLogEvent = NULL;
static const TCHAR* szTimeFormats[] =
{
- _T( "No times" ),
- _T( "Standard hh:mm:ss times" ),
- _T( "Times in milliseconds" ),
+ _T( "No times" ),
+ _T( "Standard hh:mm:ss times" ),
+ _T( "Times in milliseconds" ),
_T( "Times in microseconds" )
};
-static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_INITDIALOG:
logOptions.hwndOpts=hwndDlg;
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg,IDC_DUMPRECV,logOptions.dumpRecv?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_DUMPSENT,logOptions.dumpSent?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_DUMPPROXY,logOptions.dumpProxy?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_DUMPSSL,logOptions.dumpSsl?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TEXTDUMPS,logOptions.textDumps?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_AUTODETECTTEXT,logOptions.autoDetectText?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DUMPRECV, logOptions.dumpRecv?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DUMPSENT, logOptions.dumpSent?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DUMPPROXY, logOptions.dumpProxy?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DUMPSSL, logOptions.dumpSsl?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TEXTDUMPS, logOptions.textDumps?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTODETECTTEXT, logOptions.autoDetectText?BST_CHECKED:BST_UNCHECKED);
{ int i;
for ( i=0; i < SIZEOF(szTimeFormats); i++ )
- SendDlgItemMessage(hwndDlg,IDC_TIMEFORMAT,CB_ADDSTRING,0,(LPARAM)TranslateTS( szTimeFormats[i] ));
+ SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateTS( szTimeFormats[i] ));
}
- SendDlgItemMessage(hwndDlg,IDC_TIMEFORMAT,CB_SETCURSEL,logOptions.timeFormat,0);
- CheckDlgButton(hwndDlg,IDC_SHOWNAMES,logOptions.showUser?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TOOUTPUTDEBUGSTRING,logOptions.toOutputDebugString?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TOFILE,logOptions.toFile?BST_CHECKED:BST_UNCHECKED);
- SetDlgItemText(hwndDlg,IDC_FILENAME,logOptions.szUserFile);
- SetDlgItemText(hwndDlg,IDC_PATH,logOptions.szFile);
- CheckDlgButton(hwndDlg,IDC_SHOWTHISDLGATSTART,DBGetContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart",0)?BST_CHECKED:BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_SETCURSEL, logOptions.timeFormat, 0);
+ CheckDlgButton(hwndDlg, IDC_SHOWNAMES, logOptions.showUser?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOOUTPUTDEBUGSTRING, logOptions.toOutputDebugString?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOFILE, logOptions.toFile?BST_CHECKED:BST_UNCHECKED);
+ SetDlgItemText(hwndDlg, IDC_FILENAME, logOptions.szUserFile);
+ SetDlgItemText(hwndDlg, IDC_PATH, logOptions.szFile);
+ CheckDlgButton(hwndDlg, IDC_SHOWTHISDLGATSTART, DBGetContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart", 0)?BST_CHECKED:BST_UNCHECKED);
{ DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL, "Netlib", "RunAtStart",&dbv)) {
- SetDlgItemTextA(hwndDlg,IDC_RUNATSTART,dbv.pszVal);
+ if (!DBGetContactSettingString(NULL, "Netlib", "RunAtStart", &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_RUNATSTART, dbv.pszVal);
DBFreeVariant(&dbv);
}
}
@@ -98,7 +98,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara {
TVINSERTSTRUCT tvis = {0};
int i;
- HWND hwndFilter = GetDlgItem(hwndDlg,IDC_FILTER);
+ HWND hwndFilter = GetDlgItem(hwndDlg, IDC_FILTER);
SetWindowLongPtr(hwndFilter, GWL_STYLE, GetWindowLongPtr(hwndFilter, GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
@@ -139,7 +139,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara case IDC_FILENAME:
if (HIWORD(wParam) != EN_CHANGE) break;
if ((HWND)lParam == GetFocus())
- CheckDlgButton(hwndDlg,IDC_TOFILE,BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOFILE, BST_CHECKED);
{
TCHAR path[MAX_PATH];
@@ -155,9 +155,9 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara case IDC_RUNATSTARTBROWSE:
{ TCHAR str[MAX_PATH+2];
OPENFILENAME ofn={0};
- TCHAR filter[512],*pfilter;
+ TCHAR filter[512], *pfilter;
- GetWindowText(GetWindow((HWND)lParam,GW_HWNDPREV),str,SIZEOF(str));
+ GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, SIZEOF(str));
ofn.lStructSize=OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner=hwndDlg;
ofn.Flags=OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
@@ -167,10 +167,10 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara ofn.Flags|=OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
ofn.lpstrTitle=TranslateT("Select program to be run");
}
- _tcscpy(filter,TranslateT("All Files"));
- _tcscat(filter,_T(" (*)"));
+ _tcscpy(filter, TranslateT("All Files"));
+ _tcscat(filter, _T(" (*)"));
pfilter=filter+lstrlen(filter)+1;
- _tcscpy(pfilter,_T("*"));
+ _tcscpy(pfilter, _T("*"));
pfilter=pfilter+lstrlen(pfilter)+1;
*pfilter='\0';
ofn.lpstrFilter=filter;
@@ -182,21 +182,21 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara } else {
if (!GetOpenFileName(&ofn)) return 1;
}
- if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str,' ') != NULL) {
- MoveMemory(str+1,str,SIZEOF(str)-2);
+ if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str, ' ') != NULL) {
+ MoveMemory(str+1, str, SIZEOF(str)-2);
str[0]='"';
- lstrcat(str,_T("\""));
+ lstrcat(str, _T("\""));
}
- SetWindowText(GetWindow((HWND)lParam,GW_HWNDPREV),str);
+ SetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str);
break;
}
case IDC_RUNNOW:
{ TCHAR str[MAX_PATH+1];
STARTUPINFO si={0};
PROCESS_INFORMATION pi;
- GetDlgItemText(hwndDlg,IDC_RUNATSTART,str,MAX_PATH);
+ GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, MAX_PATH);
si.cb=sizeof(si);
- if (str[0]) CreateProcess(NULL,str,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
+ if (str[0]) CreateProcess(NULL, str, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
break;
case IDC_SAVE:
@@ -207,29 +207,29 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara TCHAR str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, MAX_PATH);
- DBWriteContactSettingTString(NULL, "Netlib", "RunAtStart",str);
- DBWriteContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWTHISDLGATSTART));
+ DBWriteContactSettingTString(NULL, "Netlib", "RunAtStart", str);
+ DBWriteContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTHISDLGATSTART));
EnterCriticalSection(&logOptions.cs);
mir_free(logOptions.szUserFile);
- GetWindowText(GetDlgItem(hwndDlg,IDC_FILENAME), str, MAX_PATH );
+ GetWindowText(GetDlgItem(hwndDlg, IDC_FILENAME), str, MAX_PATH );
logOptions.szUserFile = mir_tstrdup(str);
mir_free(logOptions.szFile);
- GetWindowText(GetDlgItem(hwndDlg,IDC_PATH), str, MAX_PATH );
+ GetWindowText(GetDlgItem(hwndDlg, IDC_PATH), str, MAX_PATH );
logOptions.szFile = mir_tstrdup(str);
- logOptions.dumpRecv=IsDlgButtonChecked(hwndDlg,IDC_DUMPRECV);
- logOptions.dumpSent=IsDlgButtonChecked(hwndDlg,IDC_DUMPSENT);
- logOptions.dumpProxy=IsDlgButtonChecked(hwndDlg,IDC_DUMPPROXY);
- logOptions.dumpSsl=IsDlgButtonChecked(hwndDlg,IDC_DUMPSSL);
- logOptions.textDumps=IsDlgButtonChecked(hwndDlg,IDC_TEXTDUMPS);
- logOptions.autoDetectText=IsDlgButtonChecked(hwndDlg,IDC_AUTODETECTTEXT);
- logOptions.timeFormat=SendDlgItemMessage(hwndDlg,IDC_TIMEFORMAT,CB_GETCURSEL,0,0);
- logOptions.showUser=IsDlgButtonChecked(hwndDlg,IDC_SHOWNAMES);
- logOptions.toOutputDebugString=IsDlgButtonChecked(hwndDlg,IDC_TOOUTPUTDEBUGSTRING);
- logOptions.toFile=IsDlgButtonChecked(hwndDlg,IDC_TOFILE);
+ logOptions.dumpRecv=IsDlgButtonChecked(hwndDlg, IDC_DUMPRECV);
+ logOptions.dumpSent=IsDlgButtonChecked(hwndDlg, IDC_DUMPSENT);
+ logOptions.dumpProxy=IsDlgButtonChecked(hwndDlg, IDC_DUMPPROXY);
+ logOptions.dumpSsl=IsDlgButtonChecked(hwndDlg, IDC_DUMPSSL);
+ logOptions.textDumps=IsDlgButtonChecked(hwndDlg, IDC_TEXTDUMPS);
+ logOptions.autoDetectText=IsDlgButtonChecked(hwndDlg, IDC_AUTODETECTTEXT);
+ logOptions.timeFormat=SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_GETCURSEL, 0, 0);
+ logOptions.showUser=IsDlgButtonChecked(hwndDlg, IDC_SHOWNAMES);
+ logOptions.toOutputDebugString=IsDlgButtonChecked(hwndDlg, IDC_TOOUTPUTDEBUGSTRING);
+ logOptions.toFile=IsDlgButtonChecked(hwndDlg, IDC_TOFILE);
LeaveCriticalSection(&logOptions.cs);
}
@@ -243,36 +243,36 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara while (tvi.hItem)
{
- TreeView_GetItem(hwndFilter,&tvi);
+ TreeView_GetItem(hwndFilter, &tvi);
checked = ((tvi.state&TVIS_STATEIMAGEMASK)>>12 == 2);
if (tvi.lParam == -1) {
logOptions.toLog = checked;
if ( logOptions.save )
- DBWriteContactSettingDword(NULL, "Netlib", "NLlog",checked);
+ DBWriteContactSettingDword(NULL, "Netlib", "NLlog", checked);
}
else
if (tvi.lParam < netlibUser.getCount()) {
netlibUser[tvi.lParam]->toLog = checked;
if ( logOptions.save )
- DBWriteContactSettingDword(NULL,netlibUser[tvi.lParam]->user.szSettingsModule,"NLlog",checked);
+ DBWriteContactSettingDword(NULL, netlibUser[tvi.lParam]->user.szSettingsModule, "NLlog", checked);
}
- tvi.hItem=TreeView_GetNextSibling(hwndFilter,tvi.hItem);
+ tvi.hItem=TreeView_GetNextSibling(hwndFilter, tvi.hItem);
}
}
if ( logOptions.save ) {
- DBWriteContactSettingByte(NULL, "Netlib", "DumpRecv",(BYTE)logOptions.dumpRecv);
- DBWriteContactSettingByte(NULL, "Netlib", "DumpSent",(BYTE)logOptions.dumpSent);
- DBWriteContactSettingByte(NULL, "Netlib", "DumpProxy",(BYTE)logOptions.dumpProxy);
- DBWriteContactSettingByte(NULL, "Netlib", "DumpSsl",(BYTE)logOptions.dumpSsl);
- DBWriteContactSettingByte(NULL, "Netlib", "TextDumps",(BYTE)logOptions.textDumps);
- DBWriteContactSettingByte(NULL, "Netlib", "AutoDetectText",(BYTE)logOptions.autoDetectText);
- DBWriteContactSettingByte(NULL, "Netlib", "TimeFormat",(BYTE)logOptions.timeFormat);
- DBWriteContactSettingByte(NULL, "Netlib", "ShowUser",(BYTE)logOptions.showUser);
- DBWriteContactSettingByte(NULL, "Netlib", "ToOutputDebugString",(BYTE)logOptions.toOutputDebugString);
- DBWriteContactSettingByte(NULL, "Netlib", "ToFile",(BYTE)logOptions.toFile);
+ DBWriteContactSettingByte(NULL, "Netlib", "DumpRecv", (BYTE)logOptions.dumpRecv);
+ DBWriteContactSettingByte(NULL, "Netlib", "DumpSent", (BYTE)logOptions.dumpSent);
+ DBWriteContactSettingByte(NULL, "Netlib", "DumpProxy", (BYTE)logOptions.dumpProxy);
+ DBWriteContactSettingByte(NULL, "Netlib", "DumpSsl", (BYTE)logOptions.dumpSsl);
+ DBWriteContactSettingByte(NULL, "Netlib", "TextDumps", (BYTE)logOptions.textDumps);
+ DBWriteContactSettingByte(NULL, "Netlib", "AutoDetectText", (BYTE)logOptions.autoDetectText);
+ DBWriteContactSettingByte(NULL, "Netlib", "TimeFormat", (BYTE)logOptions.timeFormat);
+ DBWriteContactSettingByte(NULL, "Netlib", "ShowUser", (BYTE)logOptions.showUser);
+ DBWriteContactSettingByte(NULL, "Netlib", "ToOutputDebugString", (BYTE)logOptions.toOutputDebugString);
+ DBWriteContactSettingByte(NULL, "Netlib", "ToFile", (BYTE)logOptions.toFile);
DBWriteContactSettingTString(NULL, "Netlib", "File", logOptions.szFile ? logOptions.szUserFile: _T(""));
logOptions.save = 0;
}
@@ -299,7 +299,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg,UINT message,WPARAM wPara void NetlibLogShowOptions(void)
{
if (logOptions.hwndOpts == NULL)
- logOptions.hwndOpts=CreateDialog(hMirandaInst,MAKEINTRESOURCE(IDD_NETLIBLOGOPTS),NULL,LogOptionsDlgProc);
+ logOptions.hwndOpts=CreateDialog(hMirandaInst, MAKEINTRESOURCE(IDD_NETLIBLOGOPTS), NULL, LogOptionsDlgProc);
SetForegroundWindow(logOptions.hwndOpts);
}
@@ -354,7 +354,7 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) case TIMEFORMAT_MICROSECONDS:
QueryPerformanceCounter(&liTimeNow);
liTimeNow.QuadPart -= mirandaStartTime;
- mir_snprintf(szTime, SIZEOF(szTime), "%I64u.%06I64u", liTimeNow.QuadPart / perfCounterFreq,
+ mir_snprintf(szTime, SIZEOF(szTime), "%I64u.%06I64u", liTimeNow.QuadPart / perfCounterFreq,
1000000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq);
break;
@@ -364,7 +364,7 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) }
if (logOptions.timeFormat || logOptions.showUser)
mir_snprintf(szHead, SIZEOF(szHead) - 1, "[%s%s%s] ", szTime,
- (logOptions.showUser && logOptions.timeFormat) ? " " : "",
+ (logOptions.showUser && logOptions.timeFormat) ? " " : "",
logOptions.showUser ? nlu->user.szSettingsModule : "");
else
szHead[0]=0;
@@ -391,7 +391,7 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) if (fp)
{
size_t len = strlen(pszMsg);
- fprintf(fp,"%s%s%s", szHead, pszMsg, pszMsg[len-1] == '\n' ? "" : "\r\n");
+ fprintf(fp, "%s%s%s", szHead, pszMsg, pszMsg[len-1] == '\n' ? "" : "\r\n");
fclose(fp);
}
LeaveCriticalSection(&logOptions.cs);
@@ -429,7 +429,7 @@ void NetlibLogf(NetlibUser* nlu, const char *fmt, ...) va_list va;
char szText[1024];
- va_start(va,fmt);
+ va_start(va, fmt);
mir_vsnprintf(szText, sizeof(szText), fmt, va);
va_end(va);
@@ -437,7 +437,7 @@ void NetlibLogf(NetlibUser* nlu, const char *fmt, ...) }
-void NetlibDumpData(struct NetlibConnection *nlc,PBYTE buf,int len,int sent,int flags)
+void NetlibDumpData(struct NetlibConnection *nlc, PBYTE buf, int len, int sent, int flags)
{
int isText=1;
char szTitleLine[128];
@@ -526,8 +526,8 @@ void NetlibDumpData(struct NetlibConnection *nlc,PBYTE buf,int len,int sent,int if (colsInLine == 16) {
PBYTE p = buf + line;
pszBuf += wsprintfA(
- pszBuf, "%08X: %02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X ",
- line, p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15] );
+ pszBuf, "%08X: %02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X ",
+ line, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15] );
}
else {
pszBuf += wsprintfA(pszBuf, "%08X: ", line);
@@ -555,7 +555,7 @@ void NetlibDumpData(struct NetlibConnection *nlc,PBYTE buf,int len,int sent,int *pszBuf = '\0';
}
- NetlibLog((WPARAM)nlu,(LPARAM)szBuf);
+ NetlibLog((WPARAM)nlu, (LPARAM)szBuf);
if (!useStack) mir_free(szBuf);
}
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp index 0be23f2da1..5cc1e7635e 100644 --- a/src/modules/netlib/netlibopenconn.cpp +++ b/src/modules/netlib/netlibopenconn.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.
@@ -32,7 +32,7 @@ static int iUPnPCleanup = 0; #define RECV_DEFAULT_TIMEOUT 60000
//returns in network byte order
-DWORD DnsLookup(struct NetlibUser *nlu,const char *szHost)
+DWORD DnsLookup(struct NetlibUser *nlu, const char *szHost)
{
HOSTENT* host;
DWORD ip = inet_addr(szHost);
@@ -45,7 +45,7 @@ DWORD DnsLookup(struct NetlibUser *nlu,const char *szHost) if ( host )
return *(u_long*)host->h_addr_list[0];
- NetlibLogf(nlu,"%s %d: %s() for host %s failed (%u)",__FILE__,__LINE__,"gethostbyname", szHost, WSAGetLastError());
+ NetlibLogf(nlu, "%s %d: %s() for host %s failed (%u)", __FILE__, __LINE__, "gethostbyname", szHost, WSAGetLastError());
}
__except(EXCEPTION_EXECUTE_HANDLER) {}
@@ -70,7 +70,7 @@ int WaitUntilReadable(SOCKET s, DWORD dwTimeout, bool check) return result;
}
-int WaitUntilWritable(SOCKET s,DWORD dwTimeout)
+int WaitUntilWritable(SOCKET s, DWORD dwTimeout)
{
fd_set writefd;
TIMEVAL tv;
@@ -138,14 +138,14 @@ static int NetlibInitSocks4Connection(NetlibConnection *nlc, NetlibUser *nlu, NE if (NLSend(nlc, pInit, (int)len, MSG_DUMPPROXY) == SOCKET_ERROR)
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
return 0;
}
char reply[8];
if (!RecvUntilTimeout(nlc, reply, sizeof(reply), MSG_DUMPPROXY, RECV_DEFAULT_TIMEOUT))
{
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError());
return 0;
}
@@ -157,35 +157,35 @@ static int NetlibInitSocks4Connection(NetlibConnection *nlc, NetlibUser *nlu, NE case 93: SetLastError(ERROR_INVALID_ACCESS); break;
default: SetLastError(ERROR_INVALID_DATA); break;
}
- NetlibLogf(nlu,"%s %d: Proxy connection failed (%x %u)",__FILE__,__LINE__, (BYTE)reply[1], GetLastError());
+ NetlibLogf(nlu, "%s %d: Proxy connection failed (%x %u)", __FILE__, __LINE__, (BYTE)reply[1], GetLastError());
return 0;
}
-static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct NetlibUser *nlu,NETLIBOPENCONNECTION *nloc)
+static int NetlibInitSocks5Connection(struct NetlibConnection *nlc, struct NetlibUser *nlu, NETLIBOPENCONNECTION *nloc)
{ //rfc1928
BYTE buf[258];
buf[0]=5; //yep, socks5
buf[1]=1; //one auth method
buf[2]=nlu->settings.useProxyAuth?2:0;
- if (NLSend(nlc,(char*)buf,3,MSG_DUMPPROXY) == SOCKET_ERROR) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+ if (NLSend(nlc, (char*)buf, 3, MSG_DUMPPROXY) == SOCKET_ERROR) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
return 0;
}
//confirmation of auth method
- if (!RecvUntilTimeout(nlc,(char*)buf,2,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+ if (!RecvUntilTimeout(nlc, (char*)buf, 2, MSG_DUMPPROXY, RECV_DEFAULT_TIMEOUT)) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError());
return 0;
}
if ((buf[1] != 0 && buf[1] != 2)) {
SetLastError(ERROR_INVALID_ID_AUTHORITY);
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLRecv",GetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLRecv", GetLastError());
return 0;
}
if (buf[1] == 2) { //rfc1929
- int nUserLen,nPassLen;
+ int nUserLen, nPassLen;
PBYTE pAuthBuf;
nUserLen=lstrlenA(nlu->settings.szProxyAuthUser);
@@ -193,23 +193,23 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib pAuthBuf=(PBYTE)mir_alloc(3+nUserLen+nPassLen);
pAuthBuf[0]=1; //auth version
pAuthBuf[1]=nUserLen;
- memcpy(pAuthBuf+2,nlu->settings.szProxyAuthUser,nUserLen);
+ memcpy(pAuthBuf+2, nlu->settings.szProxyAuthUser, nUserLen);
pAuthBuf[2+nUserLen]=nPassLen;
- memcpy(pAuthBuf+3+nUserLen,nlu->settings.szProxyAuthPassword,nPassLen);
- if (NLSend(nlc,(char*)pAuthBuf,3+nUserLen+nPassLen,MSG_DUMPPROXY) == SOCKET_ERROR) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+ memcpy(pAuthBuf+3+nUserLen, nlu->settings.szProxyAuthPassword, nPassLen);
+ if (NLSend(nlc, (char*)pAuthBuf, 3+nUserLen+nPassLen, MSG_DUMPPROXY) == SOCKET_ERROR) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
mir_free(pAuthBuf);
return 0;
}
mir_free(pAuthBuf);
- if (!RecvUntilTimeout(nlc,(char*)buf,2,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+ if (!RecvUntilTimeout(nlc, (char*)buf, 2, MSG_DUMPPROXY, RECV_DEFAULT_TIMEOUT)) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError());
return 0;
}
if (buf[1]) {
SetLastError(ERROR_ACCESS_DENIED);
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError());
return 0;
}
}
@@ -228,7 +228,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib }
else
{
- hostIP = DnsLookup(nlu,nloc->szHost);
+ hostIP = DnsLookup(nlu, nloc->szHost);
if (hostIP == 0)
return 0;
nHostLen = 4;
@@ -240,23 +240,23 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib if (hostIP == INADDR_NONE) { //DNS lookup through proxy
pInit[3]=3;
pInit[4]=nHostLen-1;
- memcpy(pInit+5,nloc->szHost,nHostLen-1);
+ memcpy(pInit+5, nloc->szHost, nHostLen-1);
}
else {
pInit[3]=1;
*(PDWORD)(pInit+4)=hostIP;
}
*(PWORD)(pInit+4+nHostLen)=htons(nloc->wPort);
- if (NLSend(nlc,(char*)pInit,6+nHostLen,MSG_DUMPPROXY) == SOCKET_ERROR) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
+ if (NLSend(nlc, (char*)pInit, 6+nHostLen, MSG_DUMPPROXY) == SOCKET_ERROR) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "NLSend", GetLastError());
mir_free(pInit);
return 0;
}
mir_free(pInit);
}
- if (!RecvUntilTimeout(nlc,(char*)buf,5,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+ if (!RecvUntilTimeout(nlc, (char*)buf, 5, MSG_DUMPPROXY, RECV_DEFAULT_TIMEOUT)) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError());
return 0;
}
@@ -279,7 +279,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib default: SetLastError(ERROR_INVALID_DATA); break;
}
}
- NetlibLogf(nlu,"%s %d: Proxy conection failed. %s.",__FILE__,__LINE__, err);
+ NetlibLogf(nlu, "%s %d: Proxy conection failed. %s.", __FILE__, __LINE__, err);
return 0;
}
{
@@ -295,11 +295,11 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib nRecvSize = 17;
break;
default:
- NetlibLogf(nlu,"%s %d: %s() unknown address type (%u)",__FILE__,__LINE__,"NetlibInitSocks5Connection",(int)buf[3]);
+ NetlibLogf(nlu, "%s %d: %s() unknown address type (%u)", __FILE__, __LINE__, "NetlibInitSocks5Connection", (int)buf[3]);
return 0;
}
- if (!RecvUntilTimeout(nlc,(char*)buf,nRecvSize,MSG_DUMPPROXY,RECV_DEFAULT_TIMEOUT)) {
- NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
+ if (!RecvUntilTimeout(nlc, (char*)buf, nRecvSize, MSG_DUMPPROXY, RECV_DEFAULT_TIMEOUT)) {
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError());
return 0;
}
}
@@ -348,7 +348,7 @@ static bool NetlibInitHttpsConnection(struct NetlibConnection *nlc, struct Netli }
NetlibHttpSetLastErrorUsingHttpResult(nlhrReply->resultCode);
- NetlibLogf(nlu,"%s %d: %s request failed (%u %s)",__FILE__,__LINE__,nlu->settings.proxyType == PROXYTYPE_HTTP?"HTTP":"HTTPS",nlhrReply->resultCode,nlhrReply->szResultDescr);
+ NetlibLogf(nlu, "%s %d: %s request failed (%u %s)", __FILE__, __LINE__, nlu->settings.proxyType == PROXYTYPE_HTTP?"HTTP":"HTTPS", nlhrReply->resultCode, nlhrReply->szResultDescr);
NetlibHttpFreeRequestStruct(0, (LPARAM)nlhrReply);
return 0;
}
@@ -407,9 +407,9 @@ static bool my_connectIPv4(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) if (!nlc->szProxyServer) return false;
if (nloc)
- NetlibLogf(nlc->nlu,"(%p) Connecting to proxy %s:%d for %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort, nloc->szHost, nloc->wPort);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to proxy %s:%d for %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort, nloc->szHost, nloc->wPort);
else
- NetlibLogf(nlc->nlu,"(%p) Connecting to proxy %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to proxy %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort);
sin.sin_port = htons(nlc->wProxyPort);
he = gethostbyname(nlc->szProxyServer);
@@ -417,7 +417,7 @@ static bool my_connectIPv4(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) else
{
if (!nloc || !nloc->szHost || nloc->szHost[0] == '[' || strchr(nloc->szHost, ':')) return false;
- NetlibLogf(nlc->nlu,"(%p) Connecting to server %s:%d....", nlc, nloc->szHost, nloc->wPort);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to server %s:%d....", nlc, nloc->szHost, nloc->wPort);
sin.sin_port = htons(nloc->wPort);
he = gethostbyname(nloc->szHost);
@@ -428,7 +428,7 @@ static bool my_connectIPv4(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) sin.sin_addr.s_addr = *(u_long*)*har;
char* szIp = NetlibAddressToString((SOCKADDR_INET_M*)&sin);
- NetlibLogf(nlc->nlu,"(%p) Connecting to ip %s ....", nlc, szIp);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to ip %s ....", nlc, szIp);
mir_free(szIp);
retry:
@@ -441,7 +441,7 @@ retry: if (nlc->nlu->settings.specifyOutgoingPorts && nlc->nlu->settings.szOutgoingPorts && nlc->nlu->settings.szOutgoingPorts[0])
{
if (!BindSocketToPort(nlc->nlu->settings.szOutgoingPorts, nlc->s, INVALID_SOCKET, &nlc->nlu->inportnum))
- NetlibLogf(nlc->nlu,"Netlib connect: Not enough ports for outgoing connections specified");
+ NetlibLogf(nlc->nlu, "Netlib connect: Not enough ports for outgoing connections specified");
}
// try a connect
@@ -576,27 +576,27 @@ static bool my_connectIPv6(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) if (!nlc->szProxyServer) return false;
if (nloc)
- NetlibLogf(nlc->nlu,"(%p) Connecting to proxy %s:%d for %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort, nloc->szHost, nloc->wPort);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to proxy %s:%d for %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort, nloc->szHost, nloc->wPort);
else
- NetlibLogf(nlc->nlu,"(%p) Connecting to proxy %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to proxy %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort);
_itoa(nlc->wProxyPort, szPort, 10);
if (MyGetaddrinfo(nlc->szProxyServer, szPort, &hints, &air))
{
- NetlibLogf(nlc->nlu,"%s %d: %s() for host %s failed (%u)",__FILE__,__LINE__,"getaddrinfo", nlc->szProxyServer, WSAGetLastError());
+ NetlibLogf(nlc->nlu, "%s %d: %s() for host %s failed (%u)", __FILE__, __LINE__, "getaddrinfo", nlc->szProxyServer, WSAGetLastError());
return false;
}
}
else
{
if (!nloc || !nloc->szHost) return false;
- NetlibLogf(nlc->nlu,"(%p) Connecting to server %s:%d....", nlc, nloc->szHost, nloc->wPort);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to server %s:%d....", nlc, nloc->szHost, nloc->wPort);
_itoa(nlc->nloc.wPort, szPort, 10);
if (MyGetaddrinfo(nlc->nloc.szHost, szPort, &hints, &air))
{
- NetlibLogf(nlc->nlu,"%s %d: %s() for host %s failed (%u)",__FILE__,__LINE__,"getaddrinfo", nlc->nloc.szHost, WSAGetLastError());
+ NetlibLogf(nlc->nlu, "%s %d: %s() for host %s failed (%u)", __FILE__, __LINE__, "getaddrinfo", nlc->nloc.szHost, WSAGetLastError());
return false;
}
}
@@ -604,7 +604,7 @@ static bool my_connectIPv6(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) for (ai = air; ai && !Miranda_Terminated(); ai = ai->ai_next)
{
char* szIp = NetlibAddressToString((SOCKADDR_INET_M*)ai->ai_addr);
- NetlibLogf(nlc->nlu,"(%p) Connecting to ip %s ....", nlc, szIp);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to ip %s ....", nlc, szIp);
mir_free(szIp);
retry:
nlc->s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
@@ -618,7 +618,7 @@ retry: SOCKET s = ai->ai_family == AF_INET ? nlc->s : INVALID_SOCKET;
SOCKET s6 = ai->ai_family == AF_INET6 ? nlc->s : INVALID_SOCKET;
if (!BindSocketToPort(nlc->nlu->settings.szOutgoingPorts, s, s6, &nlc->nlu->inportnum))
- NetlibLogf(nlc->nlu,"Netlib connect: Not enough ports for outgoing connections specified");
+ NetlibLogf(nlc->nlu, "Netlib connect: Not enough ports for outgoing connections specified");
}
// try a connect
@@ -721,7 +721,7 @@ static int NetlibHttpFallbackToDirect(struct NetlibConnection *nlc, struct Netli {
NetlibDoClose(nlc, true);
- NetlibLogf(nlu,"Fallback to direct connection");
+ NetlibLogf(nlu, "Fallback to direct connection");
nlc->proxyAuthNeeded = false;
nlc->proxyType = 0;
@@ -854,7 +854,7 @@ retry: nlc->usingDirectHttpGateway = true;
}
- NetlibLogf(nlu,"(%d) Connected to %s:%d", nlc->s, nloc->szHost, nloc->wPort);
+ NetlibLogf(nlu, "(%d) Connected to %s:%d", nlc->s, nloc->szHost, nloc->wPort);
if (NLOCF_SSL & nloc->flags)
{
@@ -904,13 +904,13 @@ bool NetlibReconnect(NetlibConnection *nlc) return true;
}
-INT_PTR NetlibOpenConnection(WPARAM wParam,LPARAM lParam)
+INT_PTR NetlibOpenConnection(WPARAM wParam, LPARAM lParam)
{
NETLIBOPENCONNECTION *nloc = (NETLIBOPENCONNECTION*)lParam;
struct NetlibUser *nlu = (struct NetlibUser*)wParam;
struct NetlibConnection *nlc;
- NetlibLogf(nlu,"Connection request to %s:%d (Flags %x)....", nloc->szHost, nloc->wPort, nloc->flags);
+ NetlibLogf(nlu, "Connection request to %s:%d (Flags %x)....", nloc->szHost, nloc->wPort, nloc->flags);
if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_OUTGOING) || nloc == NULL ||
(nloc->cbSize != NETLIBOPENCONNECTION_V1_SIZE && nloc->cbSize != sizeof(NETLIBOPENCONNECTION)) ||
@@ -929,7 +929,7 @@ INT_PTR NetlibOpenConnection(WPARAM wParam,LPARAM lParam) nlc->dnsThroughProxy = nlu->settings.dnsThroughProxy != 0;
InitializeCriticalSection(&nlc->csHttpSequenceNums);
- nlc->hOkToCloseEvent = CreateEvent(NULL,TRUE,TRUE,NULL);
+ nlc->hOkToCloseEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
nlc->dontCloseNow = 0;
NetlibInitializeNestedCS(&nlc->ncsSend);
NetlibInitializeNestedCS(&nlc->ncsRecv);
@@ -966,7 +966,7 @@ INT_PTR NetlibStartSsl(WPARAM wParam, LPARAM lParam) nlc->hSsl = si.connect(nlc->s, szHost, nlc->nlu->settings.validateSSL);
if (nlc->hSsl == NULL)
- NetlibLogf(nlc->nlu,"(%d %s) Failure to negotiate SSL connection", nlc->s, szHost);
+ NetlibLogf(nlc->nlu, "(%d %s) Failure to negotiate SSL connection", nlc->s, szHost);
else
NetlibLogf(nlc->nlu, "(%d %s) SSL negotiation successful", nlc->s, szHost);
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 48d4f4c291..7649ab4ab1 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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,64 +34,64 @@ static LIST <NetlibTempSettings> tempSettings(5); static const UINT outgoingConnectionsControls[] =
{
- IDC_STATIC12,
- IDC_USEPROXY,
- IDC_STATIC21,IDC_PROXYTYPE,
- IDC_STATIC22,IDC_PROXYHOST,IDC_STATIC23,IDC_PROXYPORT,IDC_STOFTENPORT,
- IDC_PROXYAUTH,
- IDC_STATIC31,IDC_PROXYUSER,IDC_STATIC32,IDC_PROXYPASS,
- IDC_PROXYDNS,
- IDC_SPECIFYPORTSO,
- IDC_PORTSRANGEO,
- IDC_STATIC54,
+ IDC_STATIC12,
+ IDC_USEPROXY,
+ IDC_STATIC21, IDC_PROXYTYPE,
+ IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT,
+ IDC_PROXYAUTH,
+ IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS,
+ IDC_PROXYDNS,
+ IDC_SPECIFYPORTSO,
+ IDC_PORTSRANGEO,
+ IDC_STATIC54,
IDC_VALIDATESSL};
static const UINT useProxyControls[]={
- IDC_STATIC21,IDC_PROXYTYPE,
- IDC_STATIC22,IDC_PROXYHOST,IDC_STATIC23,IDC_PROXYPORT,IDC_STOFTENPORT,
- IDC_PROXYAUTH,
- IDC_STATIC31,IDC_PROXYUSER,IDC_STATIC32,IDC_PROXYPASS,
+ IDC_STATIC21, IDC_PROXYTYPE,
+ IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT,
+ IDC_PROXYAUTH,
+ IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS,
IDC_PROXYDNS};
static const UINT specifyOPortsControls[]={
- IDC_PORTSRANGEO,
+ IDC_PORTSRANGEO,
IDC_STATIC54
};
static const UINT incomingConnectionsControls[]={
- IDC_STATIC43,
- IDC_SPECIFYPORTS,
- IDC_PORTSRANGE,
- IDC_STATIC52,
+ IDC_STATIC43,
+ IDC_SPECIFYPORTS,
+ IDC_PORTSRANGE,
+ IDC_STATIC52,
IDC_ENABLEUPNP};
static const UINT specifyPortsControls[]={
- IDC_PORTSRANGE,
+ IDC_PORTSRANGE,
IDC_STATIC52};
-static const TCHAR* szProxyTypes[]={_T("<mixed>"),_T("SOCKS4"),_T("SOCKS5"),_T("HTTP"),_T("HTTPS"),_T("Internet Explorer")};
-static const WORD oftenProxyPorts[]={1080,1080,1080,8080,8080,8080};
+static const TCHAR* szProxyTypes[]={_T("<mixed>"), _T("SOCKS4"), _T("SOCKS5"), _T("HTTP"), _T("HTTPS"), _T("Internet Explorer")};
+static const WORD oftenProxyPorts[]={1080, 1080, 1080, 8080, 8080, 8080};
#define M_REFRESHALL (WM_USER+100)
#define M_REFRESHENABLING (WM_USER+101)
-static void ShowMultipleControls(HWND hwndDlg,const UINT *controls,int cControls,int state)
+static void ShowMultipleControls(HWND hwndDlg, const UINT *controls, int cControls, int state)
{
int i;
- for (i=0;i<cControls;i++) ShowWindow(GetDlgItem(hwndDlg,controls[i]),state);
+ for (i=0;i<cControls;i++) ShowWindow(GetDlgItem(hwndDlg, controls[i]), state);
}
-static void EnableMultipleControls(HWND hwndDlg,const UINT *controls,int cControls,int state)
+static void EnableMultipleControls(HWND hwndDlg, const UINT *controls, int cControls, int state)
{
int i;
- for (i=0;i<cControls;i++) EnableWindow(GetDlgItem(hwndDlg,controls[i]),state);
+ for (i=0;i<cControls;i++) EnableWindow(GetDlgItem(hwndDlg, controls[i]), state);
}
-static void AddProxyTypeItem(HWND hwndDlg,int type,int selectType)
+static void AddProxyTypeItem(HWND hwndDlg, int type, int selectType)
{
int i;
- i = SendDlgItemMessage(hwndDlg,IDC_PROXYTYPE,CB_ADDSTRING,0,(LPARAM)(type == 0?TranslateTS(szProxyTypes[type]):szProxyTypes[type]));
+ i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0?TranslateTS(szProxyTypes[type]):szProxyTypes[type]));
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETITEMDATA, i, type);
if (type == selectType) SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETCURSEL, i, 0);
}
-static void CopySettingsStruct(NETLIBUSERSETTINGS *dest,NETLIBUSERSETTINGS *source)
+static void CopySettingsStruct(NETLIBUSERSETTINGS *dest, NETLIBUSERSETTINGS *source)
{
*dest=*source;
if (dest->szIncomingPorts) dest->szIncomingPorts=mir_strdup(dest->szIncomingPorts);
@@ -101,26 +101,26 @@ static void CopySettingsStruct(NETLIBUSERSETTINGS *dest,NETLIBUSERSETTINGS *sour if (dest->szProxyServer) dest->szProxyServer=mir_strdup(dest->szProxyServer);
}
-static void CombineSettingsStrings(char **dest,char **source)
+static void CombineSettingsStrings(char **dest, char **source)
{
- if (*dest != NULL && (*source == NULL || lstrcmpiA(*dest,*source))) {mir_free(*dest); *dest=NULL;}
+ if (*dest != NULL && (*source == NULL || lstrcmpiA(*dest, *source))) {mir_free(*dest); *dest=NULL;}
}
-static void CombineSettingsStructs(NETLIBUSERSETTINGS *dest,DWORD *destFlags,NETLIBUSERSETTINGS *source,DWORD sourceFlags)
+static void CombineSettingsStructs(NETLIBUSERSETTINGS *dest, DWORD *destFlags, NETLIBUSERSETTINGS *source, DWORD sourceFlags)
{
if (sourceFlags&NUF_OUTGOING) {
if (*destFlags&NUF_OUTGOING) {
if (dest->validateSSL != source->validateSSL) dest->validateSSL=2;
if (dest->useProxy != source->useProxy) dest->useProxy=2;
if (dest->proxyType != source->proxyType) dest->proxyType=0;
- CombineSettingsStrings(&dest->szProxyServer,&source->szProxyServer);
+ CombineSettingsStrings(&dest->szProxyServer, &source->szProxyServer);
if (dest->wProxyPort != source->wProxyPort) dest->wProxyPort=0;
if (dest->useProxyAuth != source->useProxyAuth) dest->useProxyAuth=2;
- CombineSettingsStrings(&dest->szProxyAuthUser,&source->szProxyAuthUser);
- CombineSettingsStrings(&dest->szProxyAuthPassword,&source->szProxyAuthPassword);
+ CombineSettingsStrings(&dest->szProxyAuthUser, &source->szProxyAuthUser);
+ CombineSettingsStrings(&dest->szProxyAuthPassword, &source->szProxyAuthPassword);
if (dest->dnsThroughProxy != source->dnsThroughProxy) dest->dnsThroughProxy=2;
if (dest->specifyOutgoingPorts != source->specifyOutgoingPorts) dest->specifyOutgoingPorts=2;
- CombineSettingsStrings(&dest->szOutgoingPorts,&source->szOutgoingPorts);
+ CombineSettingsStrings(&dest->szOutgoingPorts, &source->szOutgoingPorts);
}
else {
dest->validateSSL=source->validateSSL;
@@ -144,7 +144,7 @@ static void CombineSettingsStructs(NETLIBUSERSETTINGS *dest,DWORD *destFlags,NET if (*destFlags&NUF_INCOMING) {
if (dest->enableUPnP != source->enableUPnP) dest->enableUPnP=2;
if (dest->specifyIncomingPorts != source->specifyIncomingPorts) dest->specifyIncomingPorts=2;
- CombineSettingsStrings(&dest->szIncomingPorts,&source->szIncomingPorts);
+ CombineSettingsStrings(&dest->szIncomingPorts, &source->szIncomingPorts);
}
else {
dest->enableUPnP=source->enableUPnP;
@@ -158,12 +158,12 @@ static void CombineSettingsStructs(NETLIBUSERSETTINGS *dest,DWORD *destFlags,NET else *destFlags|=sourceFlags;
}
-static void ChangeSettingIntByCheckbox(HWND hwndDlg,UINT ctrlId,int iUser,int memberOffset)
+static void ChangeSettingIntByCheckbox(HWND hwndDlg, UINT ctrlId, int iUser, int memberOffset)
{
- int newValue,i;
+ int newValue, i;
- newValue=IsDlgButtonChecked(hwndDlg,ctrlId) != BST_CHECKED;
- CheckDlgButton(hwndDlg,ctrlId,newValue?BST_CHECKED:BST_UNCHECKED);
+ newValue=IsDlgButtonChecked(hwndDlg, ctrlId) != BST_CHECKED;
+ CheckDlgButton(hwndDlg, ctrlId, newValue?BST_CHECKED:BST_UNCHECKED);
if (iUser == -1)
{
for (i=0; i<tempSettings.getCount(); i++)
@@ -171,17 +171,17 @@ static void ChangeSettingIntByCheckbox(HWND hwndDlg,UINT ctrlId,int iUser,int me *(int*)(((PBYTE)&tempSettings[i]->settings) + memberOffset) = newValue;
}
else *(int*)(((PBYTE)&tempSettings[iUser]->settings) + memberOffset)=newValue;
- SendMessage(hwndDlg,M_REFRESHENABLING,0,0);
+ SendMessage(hwndDlg, M_REFRESHENABLING, 0, 0);
}
-static void ChangeSettingStringByEdit(HWND hwndDlg,UINT ctrlId,int iUser,int memberOffset)
+static void ChangeSettingStringByEdit(HWND hwndDlg, UINT ctrlId, int iUser, int memberOffset)
{
- int i,newValueLen;
- char *szNewValue,**ppszNew;
+ int i, newValueLen;
+ char *szNewValue, **ppszNew;
- newValueLen=GetWindowTextLength(GetDlgItem(hwndDlg,ctrlId));
+ newValueLen=GetWindowTextLength(GetDlgItem(hwndDlg, ctrlId));
szNewValue=(char*)mir_alloc(newValueLen+1);
- GetDlgItemTextA(hwndDlg,ctrlId,szNewValue,newValueLen+1);
+ GetDlgItemTextA(hwndDlg, ctrlId, szNewValue, newValueLen+1);
if (iUser == -1)
{
for (i=0; i<tempSettings.getCount(); ++i)
@@ -200,32 +200,32 @@ static void ChangeSettingStringByEdit(HWND hwndDlg,UINT ctrlId,int iUser,int mem }
}
-static void WriteSettingsStructToDb(const char *szSettingsModule,NETLIBUSERSETTINGS *settings,DWORD flags)
+static void WriteSettingsStructToDb(const char *szSettingsModule, NETLIBUSERSETTINGS *settings, DWORD flags)
{
if (flags&NUF_OUTGOING) {
char szEncodedPassword[512];
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLValidateSSL",(BYTE)settings->validateSSL);
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLUseProxy",(BYTE)settings->useProxy);
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLProxyType",(BYTE)settings->proxyType);
- DBWriteContactSettingString(NULL,szSettingsModule,"NLProxyServer",settings->szProxyServer?settings->szProxyServer:"");
- DBWriteContactSettingWord(NULL,szSettingsModule,"NLProxyPort",(WORD)settings->wProxyPort);
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLUseProxyAuth",(BYTE)settings->useProxyAuth);
- DBWriteContactSettingString(NULL,szSettingsModule,"NLProxyAuthUser",settings->szProxyAuthUser?settings->szProxyAuthUser:"");
- lstrcpynA(szEncodedPassword,settings->szProxyAuthPassword?settings->szProxyAuthPassword:"",SIZEOF(szEncodedPassword));
- CallService(MS_DB_CRYPT_ENCODESTRING,SIZEOF(szEncodedPassword),(LPARAM)szEncodedPassword);
- DBWriteContactSettingString(NULL,szSettingsModule,"NLProxyAuthPassword",szEncodedPassword);
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLDnsThroughProxy",(BYTE)settings->dnsThroughProxy);
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLSpecifyOutgoingPorts",(BYTE)settings->specifyOutgoingPorts);
- DBWriteContactSettingString(NULL,szSettingsModule,"NLOutgoingPorts",settings->szOutgoingPorts?settings->szOutgoingPorts:"");
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLValidateSSL", (BYTE)settings->validateSSL);
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLUseProxy", (BYTE)settings->useProxy);
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLProxyType", (BYTE)settings->proxyType);
+ DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyServer", settings->szProxyServer?settings->szProxyServer:"");
+ DBWriteContactSettingWord(NULL, szSettingsModule, "NLProxyPort", (WORD)settings->wProxyPort);
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLUseProxyAuth", (BYTE)settings->useProxyAuth);
+ DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyAuthUser", settings->szProxyAuthUser?settings->szProxyAuthUser:"");
+ lstrcpynA(szEncodedPassword, settings->szProxyAuthPassword?settings->szProxyAuthPassword:"", SIZEOF(szEncodedPassword));
+ CallService(MS_DB_CRYPT_ENCODESTRING, SIZEOF(szEncodedPassword), (LPARAM)szEncodedPassword);
+ DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyAuthPassword", szEncodedPassword);
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLDnsThroughProxy", (BYTE)settings->dnsThroughProxy);
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLSpecifyOutgoingPorts", (BYTE)settings->specifyOutgoingPorts);
+ DBWriteContactSettingString(NULL, szSettingsModule, "NLOutgoingPorts", settings->szOutgoingPorts?settings->szOutgoingPorts:"");
}
if (flags&NUF_INCOMING) {
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLEnableUPnP",(BYTE)settings->enableUPnP);
- DBWriteContactSettingByte(NULL,szSettingsModule,"NLSpecifyIncomingPorts",(BYTE)settings->specifyIncomingPorts);
- DBWriteContactSettingString(NULL,szSettingsModule,"NLIncomingPorts",settings->szIncomingPorts?settings->szIncomingPorts:"");
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLEnableUPnP", (BYTE)settings->enableUPnP);
+ DBWriteContactSettingByte(NULL, szSettingsModule, "NLSpecifyIncomingPorts", (BYTE)settings->specifyIncomingPorts);
+ DBWriteContactSettingString(NULL, szSettingsModule, "NLIncomingPorts", settings->szIncomingPorts?settings->szIncomingPorts:"");
}
}
-void NetlibSaveUserSettingsStruct(const char *szSettingsModule,NETLIBUSERSETTINGS *settings)
+void NetlibSaveUserSettingsStruct(const char *szSettingsModule, NETLIBUSERSETTINGS *settings)
{
int i;
NETLIBUSERSETTINGS combinedSettings={0};
@@ -259,7 +259,7 @@ void NetlibSaveUserSettingsStruct(const char *szSettingsModule,NETLIBUSERSETTING if (combinedSettings.dnsThroughProxy == 2) combinedSettings.dnsThroughProxy=1;
if (combinedSettings.enableUPnP == 2) combinedSettings.enableUPnP=1;
if (combinedSettings.specifyIncomingPorts == 2) combinedSettings.specifyIncomingPorts=0;
- WriteSettingsStructToDb("Netlib",&combinedSettings,flags);
+ WriteSettingsStructToDb("Netlib", &combinedSettings, flags);
NetlibFreeUserSettingsStruct(&combinedSettings);
LeaveCriticalSection(&csNetlibUser);
}
@@ -269,12 +269,12 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, switch (msg)
{
case WM_INITDIALOG:
- { int iUser,iItem;
+ { int iUser, iItem;
TranslateDialogDefault(hwndDlg);
- iItem=SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_ADDSTRING,0,(LPARAM)TranslateT("<All connections>"));
- SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_SETITEMDATA,iItem,(LPARAM)-1);
- SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_SETCURSEL,iItem,0);
+ iItem=SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_ADDSTRING, 0, (LPARAM)TranslateT("<All connections>"));
+ SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_SETITEMDATA, iItem, (LPARAM)-1);
+ SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_SETCURSEL, iItem, 0);
EnterCriticalSection(&csNetlibUser);
for (iUser = 0; iUser < netlibUser.getCount(); ++iUser)
@@ -288,15 +288,15 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (netlibUser[iUser]->user.flags & NUF_NOOPTIONS) continue;
iItem = SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_ADDSTRING, 0,
(LPARAM)netlibUser[iUser]->user.ptszDescriptiveName);
- SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS,CB_SETITEMDATA, iItem, iUser);
+ SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_SETITEMDATA, iItem, iUser);
}
LeaveCriticalSection(&csNetlibUser);
- SendMessage(hwndDlg,M_REFRESHALL,0,0);
+ SendMessage(hwndDlg, M_REFRESHALL, 0, 0);
return TRUE;
}
case M_REFRESHALL:
- { int iUser=SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_GETCURSEL,0,0),0);
+ { int iUser=SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_GETCURSEL, 0, 0), 0);
NETLIBUSERSETTINGS settings = {0};
DWORD flags;
@@ -316,46 +316,46 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CopySettingsStruct(&settings, &tempSettings[iUser]->settings);
flags = tempSettings[iUser]->flags;
}
- ShowMultipleControls(hwndDlg,outgoingConnectionsControls,SIZEOF(outgoingConnectionsControls),flags&NUF_OUTGOING?SW_SHOW:SW_HIDE);
- CheckDlgButton(hwndDlg,IDC_USEPROXY,settings.useProxy);
- SendDlgItemMessage(hwndDlg,IDC_PROXYTYPE,CB_RESETCONTENT,0,0);
- if (settings.proxyType == 0) AddProxyTypeItem(hwndDlg,0,settings.proxyType);
+ ShowMultipleControls(hwndDlg, outgoingConnectionsControls, SIZEOF(outgoingConnectionsControls), flags&NUF_OUTGOING?SW_SHOW:SW_HIDE);
+ CheckDlgButton(hwndDlg, IDC_USEPROXY, settings.useProxy);
+ SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_RESETCONTENT, 0, 0);
+ if (settings.proxyType == 0) AddProxyTypeItem(hwndDlg, 0, settings.proxyType);
AddProxyTypeItem(hwndDlg, PROXYTYPE_SOCKS4, settings.proxyType);
AddProxyTypeItem(hwndDlg, PROXYTYPE_SOCKS5, settings.proxyType);
- if (flags & (NUF_HTTPCONNS | NUF_HTTPGATEWAY)) AddProxyTypeItem(hwndDlg,PROXYTYPE_HTTP,settings.proxyType);
- if (!(flags & NUF_NOHTTPSOPTION)) AddProxyTypeItem(hwndDlg,PROXYTYPE_HTTPS,settings.proxyType);
+ if (flags & (NUF_HTTPCONNS | NUF_HTTPGATEWAY)) AddProxyTypeItem(hwndDlg, PROXYTYPE_HTTP, settings.proxyType);
+ if (!(flags & NUF_NOHTTPSOPTION)) AddProxyTypeItem(hwndDlg, PROXYTYPE_HTTPS, settings.proxyType);
if (flags & (NUF_HTTPCONNS | NUF_HTTPGATEWAY) || !(flags & NUF_NOHTTPSOPTION))
- AddProxyTypeItem(hwndDlg,PROXYTYPE_IE,settings.proxyType);
- SetDlgItemTextA(hwndDlg,IDC_PROXYHOST,settings.szProxyServer?settings.szProxyServer:"");
- if (settings.wProxyPort) SetDlgItemInt(hwndDlg,IDC_PROXYPORT,settings.wProxyPort,FALSE);
- else SetDlgItemTextA(hwndDlg,IDC_PROXYPORT,"");
- CheckDlgButton(hwndDlg,IDC_PROXYAUTH,settings.useProxyAuth);
- SetDlgItemTextA(hwndDlg,IDC_PROXYUSER,settings.szProxyAuthUser?settings.szProxyAuthUser:"");
- SetDlgItemTextA(hwndDlg,IDC_PROXYPASS,settings.szProxyAuthPassword?settings.szProxyAuthPassword:"");
- CheckDlgButton(hwndDlg,IDC_PROXYDNS,settings.dnsThroughProxy);
- CheckDlgButton(hwndDlg,IDC_VALIDATESSL,settings.validateSSL);
+ AddProxyTypeItem(hwndDlg, PROXYTYPE_IE, settings.proxyType);
+ SetDlgItemTextA(hwndDlg, IDC_PROXYHOST, settings.szProxyServer?settings.szProxyServer:"");
+ if (settings.wProxyPort) SetDlgItemInt(hwndDlg, IDC_PROXYPORT, settings.wProxyPort, FALSE);
+ else SetDlgItemTextA(hwndDlg, IDC_PROXYPORT, "");
+ CheckDlgButton(hwndDlg, IDC_PROXYAUTH, settings.useProxyAuth);
+ SetDlgItemTextA(hwndDlg, IDC_PROXYUSER, settings.szProxyAuthUser?settings.szProxyAuthUser:"");
+ SetDlgItemTextA(hwndDlg, IDC_PROXYPASS, settings.szProxyAuthPassword?settings.szProxyAuthPassword:"");
+ CheckDlgButton(hwndDlg, IDC_PROXYDNS, settings.dnsThroughProxy);
+ CheckDlgButton(hwndDlg, IDC_VALIDATESSL, settings.validateSSL);
- ShowMultipleControls(hwndDlg,incomingConnectionsControls,SIZEOF(incomingConnectionsControls),flags&NUF_INCOMING?SW_SHOW:SW_HIDE);
- CheckDlgButton(hwndDlg,IDC_SPECIFYPORTS,settings.specifyIncomingPorts);
- SetDlgItemTextA(hwndDlg,IDC_PORTSRANGE,settings.szIncomingPorts?settings.szIncomingPorts:"");
+ ShowMultipleControls(hwndDlg, incomingConnectionsControls, SIZEOF(incomingConnectionsControls), flags&NUF_INCOMING?SW_SHOW:SW_HIDE);
+ CheckDlgButton(hwndDlg, IDC_SPECIFYPORTS, settings.specifyIncomingPorts);
+ SetDlgItemTextA(hwndDlg, IDC_PORTSRANGE, settings.szIncomingPorts?settings.szIncomingPorts:"");
- CheckDlgButton(hwndDlg,IDC_SPECIFYPORTSO,settings.specifyOutgoingPorts);
- SetDlgItemTextA(hwndDlg,IDC_PORTSRANGEO,settings.szOutgoingPorts?settings.szOutgoingPorts:"");
+ CheckDlgButton(hwndDlg, IDC_SPECIFYPORTSO, settings.specifyOutgoingPorts);
+ SetDlgItemTextA(hwndDlg, IDC_PORTSRANGEO, settings.szOutgoingPorts?settings.szOutgoingPorts:"");
- CheckDlgButton(hwndDlg,IDC_ENABLEUPNP,settings.enableUPnP);
+ CheckDlgButton(hwndDlg, IDC_ENABLEUPNP, settings.enableUPnP);
NetlibFreeUserSettingsStruct(&settings);
- SendMessage(hwndDlg,M_REFRESHENABLING,0,0);
+ SendMessage(hwndDlg, M_REFRESHENABLING, 0, 0);
break;
}
case M_REFRESHENABLING:
{ int selectedProxyType;
TCHAR str[80];
- selectedProxyType=SendDlgItemMessage(hwndDlg,IDC_PROXYTYPE,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_PROXYTYPE,CB_GETCURSEL,0,0),0);
- mir_sntprintf(str, SIZEOF(str), TranslateT("(often %d)"),oftenProxyPorts[selectedProxyType]);
- SetDlgItemText(hwndDlg,IDC_STOFTENPORT,str);
- if (IsDlgButtonChecked(hwndDlg,IDC_USEPROXY) != BST_UNCHECKED)
+ selectedProxyType=SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0);
+ mir_sntprintf(str, SIZEOF(str), TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]);
+ SetDlgItemText(hwndDlg, IDC_STOFTENPORT, str);
+ if (IsDlgButtonChecked(hwndDlg, IDC_USEPROXY) != BST_UNCHECKED)
{
int enableAuth = 0, enableUser = 0, enablePass = 0, enableServer = 1;
EnableMultipleControls(hwndDlg, useProxyControls, SIZEOF(useProxyControls), TRUE);
@@ -386,29 +386,29 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
if (selectedProxyType == PROXYTYPE_IE) enableServer=0;
enableAuth=1;
- if (IsDlgButtonChecked(hwndDlg,IDC_PROXYAUTH) != BST_UNCHECKED)
+ if (IsDlgButtonChecked(hwndDlg, IDC_PROXYAUTH) != BST_UNCHECKED)
enableUser = enablePass = 1;
}
}
- EnableWindow(GetDlgItem(hwndDlg,IDC_PROXYAUTH), enableAuth);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC31), enableUser);
- EnableWindow(GetDlgItem(hwndDlg,IDC_PROXYUSER), enableUser);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC32), enablePass);
- EnableWindow(GetDlgItem(hwndDlg,IDC_PROXYPASS), enablePass);
- EnableWindow(GetDlgItem(hwndDlg,IDC_PROXYHOST), enableServer);
- EnableWindow(GetDlgItem(hwndDlg,IDC_PROXYPORT), enableServer);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROXYAUTH), enableAuth);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC31), enableUser);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROXYUSER), enableUser);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC32), enablePass);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROXYPASS), enablePass);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROXYHOST), enableServer);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROXYPORT), enableServer);
}
- else EnableMultipleControls(hwndDlg,useProxyControls,SIZEOF(useProxyControls),FALSE);
- EnableMultipleControls(hwndDlg,specifyPortsControls,SIZEOF(specifyPortsControls),IsDlgButtonChecked(hwndDlg,IDC_SPECIFYPORTS) != BST_UNCHECKED);
- EnableMultipleControls(hwndDlg,specifyOPortsControls,SIZEOF(specifyOPortsControls),IsDlgButtonChecked(hwndDlg,IDC_SPECIFYPORTSO) != BST_UNCHECKED);
+ else EnableMultipleControls(hwndDlg, useProxyControls, SIZEOF(useProxyControls), FALSE);
+ EnableMultipleControls(hwndDlg, specifyPortsControls, SIZEOF(specifyPortsControls), IsDlgButtonChecked(hwndDlg, IDC_SPECIFYPORTS) != BST_UNCHECKED);
+ EnableMultipleControls(hwndDlg, specifyOPortsControls, SIZEOF(specifyOPortsControls), IsDlgButtonChecked(hwndDlg, IDC_SPECIFYPORTSO) != BST_UNCHECKED);
break;
}
case WM_COMMAND:
- { int iUser=SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_NETLIBUSERS,CB_GETCURSEL,0,0),0);
+ { int iUser=SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_NETLIBUSERS, CB_GETCURSEL, 0, 0), 0);
switch(LOWORD(wParam))
{
case IDC_NETLIBUSERS:
- if (HIWORD(wParam) == CBN_SELCHANGE) SendMessage(hwndDlg,M_REFRESHALL,0,0);
+ if (HIWORD(wParam) == CBN_SELCHANGE) SendMessage(hwndDlg, M_REFRESHALL, 0, 0);
return 0;
case IDC_LOGOPTIONS:
@@ -417,8 +417,8 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_PROXYTYPE:
if (HIWORD(wParam) != CBN_SELCHANGE) return 0;
- { int newValue,i;
- newValue = SendDlgItemMessage(hwndDlg,IDC_PROXYTYPE,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_PROXYTYPE,CB_GETCURSEL,0,0),0);
+ { int newValue, i;
+ newValue = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0);
if (iUser == -1)
{
if (newValue == 0) return 0;
@@ -436,39 +436,39 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, else
{
tempSettings[iUser]->settings.proxyType = newValue;
- SendMessage(hwndDlg,M_REFRESHENABLING,0,0);
+ SendMessage(hwndDlg, M_REFRESHENABLING, 0, 0);
}
}
break;
case IDC_USEPROXY:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,useProxy));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, useProxy));
break;
case IDC_PROXYAUTH:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,useProxyAuth));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, useProxyAuth));
break;
case IDC_PROXYDNS:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,dnsThroughProxy));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, dnsThroughProxy));
break;
case IDC_SPECIFYPORTS:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,specifyIncomingPorts));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, specifyIncomingPorts));
break;
case IDC_SPECIFYPORTSO:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,specifyOutgoingPorts));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, specifyOutgoingPorts));
break;
case IDC_ENABLEUPNP:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,enableUPnP));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, enableUPnP));
break;
case IDC_VALIDATESSL:
- ChangeSettingIntByCheckbox(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,validateSSL));
+ ChangeSettingIntByCheckbox(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, validateSSL));
break;
case IDC_PROXYHOST:
if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0;
- ChangeSettingStringByEdit(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,szProxyServer));
+ ChangeSettingStringByEdit(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, szProxyServer));
break;
case IDC_PROXYPORT:
if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0;
- { int newValue,i;
- newValue=GetDlgItemInt(hwndDlg,LOWORD(wParam),NULL,FALSE);
+ { int newValue, i;
+ newValue=GetDlgItemInt(hwndDlg, LOWORD(wParam), NULL, FALSE);
if (iUser == -1)
{
for (i = 0; i < tempSettings.getCount(); ++i)
@@ -480,23 +480,23 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, break;
case IDC_PROXYUSER:
if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0;
- ChangeSettingStringByEdit(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,szProxyAuthUser));
+ ChangeSettingStringByEdit(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, szProxyAuthUser));
break;
case IDC_PROXYPASS:
if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0;
- ChangeSettingStringByEdit(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,szProxyAuthPassword));
+ ChangeSettingStringByEdit(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, szProxyAuthPassword));
break;
case IDC_PORTSRANGE:
if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0;
- ChangeSettingStringByEdit(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,szIncomingPorts));
+ ChangeSettingStringByEdit(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, szIncomingPorts));
break;
case IDC_PORTSRANGEO:
if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0;
- ChangeSettingStringByEdit(hwndDlg,LOWORD(wParam),iUser,offsetof(NETLIBUSERSETTINGS,szOutgoingPorts));
+ ChangeSettingStringByEdit(hwndDlg, LOWORD(wParam), iUser, offsetof(NETLIBUSERSETTINGS, szOutgoingPorts));
break;
}
- ShowWindow(GetDlgItem(hwndDlg,IDC_RECONNECTREQD),SW_SHOW);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_RECONNECTREQD), SW_SHOW);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
case WM_NOTIFY:
@@ -531,7 +531,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
static UINT expertOnlyControls[]={IDC_LOGOPTIONS};
-int NetlibOptInitialise(WPARAM wParam,LPARAM)
+int NetlibOptInitialise(WPARAM wParam, LPARAM)
{
int optionsCount = 0;
EnterCriticalSection(&csNetlibUser);
diff --git a/src/modules/netlib/netlibpktrecver.cpp b/src/modules/netlib/netlibpktrecver.cpp index 401e545792..56f9b8ffae 100644 --- a/src/modules/netlib/netlibpktrecver.cpp +++ b/src/modules/netlib/netlibpktrecver.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h"
#include "netlib.h"
-INT_PTR NetlibPacketRecverCreate(WPARAM wParam,LPARAM lParam)
+INT_PTR NetlibPacketRecverCreate(WPARAM wParam, LPARAM lParam)
{
struct NetlibConnection *nlc=(struct NetlibConnection*)wParam;
struct NetlibPacketRecver *nlpr;
@@ -47,7 +47,7 @@ INT_PTR NetlibPacketRecverCreate(WPARAM wParam,LPARAM lParam) return (INT_PTR)nlpr;
}
-INT_PTR NetlibPacketRecverGetMore(WPARAM wParam,LPARAM lParam)
+INT_PTR NetlibPacketRecverGetMore(WPARAM wParam, LPARAM lParam)
{
struct NetlibPacketRecver *nlpr=(struct NetlibPacketRecver*)wParam;
NETLIBPACKETRECVER *nlprParam=(NETLIBPACKETRECVER*)lParam;
@@ -65,20 +65,20 @@ INT_PTR NetlibPacketRecverGetMore(WPARAM wParam,LPARAM lParam) if (nlprParam->bytesUsed == 0) {
if (nlpr->packetRecver.bytesAvailable == nlpr->packetRecver.bufferSize) {
nlpr->packetRecver.bytesAvailable=0;
- NetlibLogf(nlpr->nlc->nlu,"Packet recver: packet overflowed buffer, ditching");
+ NetlibLogf(nlpr->nlc->nlu, "Packet recver: packet overflowed buffer, ditching");
}
}
else {
- MoveMemory(nlpr->packetRecver.buffer,nlpr->packetRecver.buffer+nlprParam->bytesUsed,nlpr->packetRecver.bytesAvailable-nlprParam->bytesUsed);
+ MoveMemory(nlpr->packetRecver.buffer, nlpr->packetRecver.buffer+nlprParam->bytesUsed, nlpr->packetRecver.bytesAvailable-nlprParam->bytesUsed);
nlpr->packetRecver.bytesAvailable-=nlprParam->bytesUsed;
}
if (nlprParam->dwTimeout != INFINITE) {
- if (!si.pending(nlpr->nlc->hSsl) && WaitUntilReadable(nlpr->nlc->s,nlprParam->dwTimeout) <= 0) {
+ if (!si.pending(nlpr->nlc->hSsl) && WaitUntilReadable(nlpr->nlc->s, nlprParam->dwTimeout) <= 0) {
*nlprParam=nlpr->packetRecver;
return SOCKET_ERROR;
}
}
- recvResult=NLRecv(nlpr->nlc, (char*)nlpr->packetRecver.buffer+nlpr->packetRecver.bytesAvailable,nlpr->packetRecver.bufferSize-nlpr->packetRecver.bytesAvailable,0);
+ recvResult=NLRecv(nlpr->nlc, (char*)nlpr->packetRecver.buffer+nlpr->packetRecver.bytesAvailable, nlpr->packetRecver.bufferSize-nlpr->packetRecver.bytesAvailable, 0);
if (recvResult>0) nlpr->packetRecver.bytesAvailable+=recvResult;
*nlprParam=nlpr->packetRecver;
return recvResult;
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index a8da8af514..c97ee97c30 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -1,7 +1,7 @@ /*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -10,7 +10,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.
@@ -67,7 +67,7 @@ static HANDLE hSecMutex; static void ReportSecError(SECURITY_STATUS scRet, int line)
{
char szMsgBuf[256];
- FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, SIZEOF(szMsgBuf), NULL);
char *p = strchr(szMsgBuf, 13); if (p) *p = 0;
@@ -197,8 +197,8 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls SecBuffer inBuffers[2] =
{
- { sizeof(inDataBuffer), SECBUFFER_DATA, inDataBuffer },
- { chlsz, SECBUFFER_STREAM, szChallenge },
+ { sizeof(inDataBuffer), SECBUFFER_DATA, inDataBuffer },
+ { chlsz, SECBUFFER_STREAM, szChallenge },
};
SecBufferDesc inBuffersDesc = { SECBUFFER_VERSION, 2, inBuffers };
@@ -229,8 +229,8 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls SecBuffer outBuffers[3] =
{
- { sizes.cbSecurityTrailer, SECBUFFER_TOKEN, tokenBuffer },
- { sizeof(outDataBuffer), SECBUFFER_DATA, outDataBuffer },
+ { sizes.cbSecurityTrailer, SECBUFFER_TOKEN, tokenBuffer },
+ { sizeof(outDataBuffer), SECBUFFER_DATA, outDataBuffer },
{ sizes.cbBlockSize, SECBUFFER_PADDING, paddingBuffer }
};
SecBufferDesc outBuffersDesc = { SECBUFFER_VERSION, 3, outBuffers };
@@ -259,7 +259,7 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls nlb64.pbDecoded = response;
nlb64.cchEncoded = Netlib_GetBase64EncodedBufferSize(nlb64.cbDecoded);
nlb64.pszEncoded = (char*)alloca(nlb64.cchEncoded);
- if (!NetlibBase64Encode(0,(LPARAM)&nlb64)) return NULL;
+ if (!NetlibBase64Encode(0, (LPARAM)&nlb64)) return NULL;
return mir_strdup(nlb64.pszEncoded);
}
@@ -268,8 +268,8 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, bool http, unsigned& complete)
{
SECURITY_STATUS sc;
- SecBufferDesc outputBufferDescriptor,inputBufferDescriptor;
- SecBuffer outputSecurityToken,inputSecurityToken;
+ SecBufferDesc outputBufferDescriptor, inputBufferDescriptor;
+ SecBuffer outputSecurityToken, inputSecurityToken;
TimeStamp tokenExpiration;
ULONG contextAttributes;
NETLIBBASE64 nlb64 = { 0 };
@@ -422,10 +422,10 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, outputSecurityToken.cbBuffer = hNtlm->cbMaxToken;
outputSecurityToken.pvBuffer = alloca(outputSecurityToken.cbBuffer);
- sc = g_pSSPI->InitializeSecurityContext(&hNtlm->hClientCredential,
- hasChallenge ? &hNtlm->hClientContext : NULL,
- hNtlm->szPrincipal, isGSSAPI ? ISC_REQ_MUTUAL_AUTH | ISC_REQ_STREAM : 0, 0, SECURITY_NATIVE_DREP,
- hasChallenge ? &inputBufferDescriptor : NULL, 0, &hNtlm->hClientContext,
+ sc = g_pSSPI->InitializeSecurityContext(&hNtlm->hClientCredential,
+ hasChallenge ? &hNtlm->hClientContext : NULL,
+ hNtlm->szPrincipal, isGSSAPI ? ISC_REQ_MUTUAL_AUTH | ISC_REQ_STREAM : 0, 0, SECURITY_NATIVE_DREP,
+ hasChallenge ? &inputBufferDescriptor : NULL, 0, &hNtlm->hClientContext,
&outputBufferDescriptor, &contextAttributes, &tokenExpiration);
complete = (sc != SEC_I_COMPLETE_AND_CONTINUE && sc != SEC_I_CONTINUE_NEEDED);
@@ -454,7 +454,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, size_t authLen = strlen(szLogin) + strlen(szPassw) + 5;
char *szAuth = (char*)alloca(authLen);
- nlb64.cbDecoded = mir_snprintf(szAuth, authLen,"%s:%s", szLogin, szPassw);
+ nlb64.cbDecoded = mir_snprintf(szAuth, authLen, "%s:%s", szLogin, szPassw);
nlb64.pbDecoded=(PBYTE)szAuth;
complete = true;
@@ -464,7 +464,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, nlb64.cchEncoded = Netlib_GetBase64EncodedBufferSize(nlb64.cbDecoded);
nlb64.pszEncoded = (char*)alloca(nlb64.cchEncoded);
- if (!NetlibBase64Encode(0,(LPARAM)&nlb64)) return NULL;
+ if (!NetlibBase64Encode(0, (LPARAM)&nlb64)) return NULL;
char* result;
if (http)
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index 251d95e0fd..c2f5094aac 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -117,14 +117,14 @@ static int ConnectionListToSocketList(HANDLE *hConns, fd_set *fd, int& pending) SetLastError(ERROR_INVALID_DATA);
return 0;
}
- FD_SET(nlcCheck->s,fd);
+ FD_SET(nlcCheck->s, fd);
if (si.pending(nlcCheck->hSsl))
pending++;
}
return 1;
}
-INT_PTR NetlibSelect(WPARAM,LPARAM lParam)
+INT_PTR NetlibSelect(WPARAM, LPARAM lParam)
{
NETLIBSELECT *nls = (NETLIBSELECT*)lParam;
if (nls == NULL || nls->cbSize != sizeof(NETLIBSELECT))
@@ -197,19 +197,19 @@ INT_PTR NetlibSelectEx(WPARAM, LPARAM lParam) if (conn->usingHttpGateway && conn->nlhpi.szHttpGetUrl == NULL && conn->dataBuffer == NULL)
nls->hReadStatus[j] = (conn->pHttpProxyPacketQueue != NULL);
else
- nls->hReadStatus[j] = FD_ISSET(conn->s,&readfd);
+ nls->hReadStatus[j] = FD_ISSET(conn->s, &readfd);
}
for (j = 0; j < FD_SETSIZE; j++)
{
conn = (NetlibConnection*)nls->hWriteConns[j];
if (conn == NULL || conn == INVALID_HANDLE_VALUE) break;
- nls->hWriteStatus[j] = FD_ISSET(conn->s,&writefd);
+ nls->hWriteStatus[j] = FD_ISSET(conn->s, &writefd);
}
for (j = 0; j < FD_SETSIZE; j++)
{
conn = (NetlibConnection*)nls->hExceptConns[j];
if (conn == NULL || conn == INVALID_HANDLE_VALUE) break;
- nls->hExceptStatus[j] = FD_ISSET(conn->s,&exceptfd);
+ nls->hExceptStatus[j] = FD_ISSET(conn->s, &exceptfd);
}
ReleaseMutex(hConnectionHeaderMutex);
return rc;
diff --git a/src/modules/netlib/netlibssl.cpp b/src/modules/netlib/netlibssl.cpp index d533bc1236..76c663d5ba 100644 --- a/src/modules/netlib/netlibssl.cpp +++ b/src/modules/netlib/netlibssl.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -54,8 +54,8 @@ static pfnCertVerifyCertificateChainPolicy fnCertVerifyCertificateChainPolicy; typedef enum
{
- sockOpen,
- sockClosed,
+ sockOpen,
+ sockClosed,
sockError
} SocketState;
@@ -96,7 +96,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool showPopup = fal break;
default:
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, SIZEOF(szMsgBuf), NULL);
}
@@ -133,7 +133,7 @@ static bool AcquireCredentials(void) &SchannelCred, // Package specific data
NULL, // Pointer to GetKey() func
NULL, // Value to pass to GetKey()
- &hCreds, // (out) Cred Handle
+ &hCreds, // (out) Cred Handle
&tsExpiry); // (out) Lifetime (optional)
ReportSslError(scRet, __LINE__);
@@ -207,8 +207,8 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF static LPSTR rgszUsages[] =
{
- szOID_PKIX_KP_SERVER_AUTH,
- szOID_SERVER_GATED_CRYPTO,
+ szOID_PKIX_KP_SERVER_AUTH,
+ szOID_SERVER_GATED_CRYPTO,
szOID_SGC_NETSCAPE
};
@@ -222,7 +222,7 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF PWSTR pwszServerName = mir_a2u(pszServerName);
- scRet = g_pSSPI->QueryContextAttributesA(&ssl->hContext,
+ scRet = g_pSSPI->QueryContextAttributesA(&ssl->hContext,
SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pServerCert);
if (scRet != SEC_E_OK)
goto cleanup;
@@ -255,7 +255,7 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF PolicyStatus.cbSize = sizeof(PolicyStatus);
- if (!fnCertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, pChainContext,
+ if (!fnCertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, pChainContext,
&PolicyPara, &PolicyStatus))
{
scRet = GetLastError();
@@ -386,17 +386,17 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
- &hCreds,
- &ssl->hContext,
- NULL,
- dwSSPIFlags,
- 0,
- SECURITY_NATIVE_DREP,
- &InBuffer,
- 0,
- NULL,
- &OutBuffer,
- &dwSSPIOutFlags,
+ &hCreds,
+ &ssl->hContext,
+ NULL,
+ dwSSPIFlags,
+ 0,
+ SECURITY_NATIVE_DREP,
+ &InBuffer,
+ 0,
+ NULL,
+ &OutBuffer,
+ &dwSSPIOutFlags,
&tsExpiry);
// If success (or if the error was one of the special extended ones),
@@ -431,8 +431,8 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) // Store remaining data for further use
if (InBuffers[1].BufferType == SECBUFFER_EXTRA)
{
- memmove(ssl->pbIoBuffer,
- ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
+ memmove(ssl->pbIoBuffer,
+ ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
InBuffers[1].cbBuffer);
ssl->cbIoBuffer = InBuffers[1].cbBuffer;
}
@@ -460,8 +460,8 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) // Copy any leftover data from the buffer, and go around again.
if (InBuffers[1].BufferType == SECBUFFER_EXTRA)
{
- memmove(ssl->pbIoBuffer,
- ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
+ memmove(ssl->pbIoBuffer,
+ ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
InBuffers[1].cbBuffer);
ssl->cbIoBuffer = InBuffers[1].cbBuffer;
@@ -518,17 +518,17 @@ static bool ClientConnect(SslHandle *ssl, const char *host) OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
- &hCreds,
- NULL,
- (SEC_CHAR*)host,
- dwSSPIFlags,
- 0,
- SECURITY_NATIVE_DREP,
- NULL,
- 0,
- &ssl->hContext,
- &OutBuffer,
- &dwSSPIOutFlags,
+ &hCreds,
+ NULL,
+ (SEC_CHAR*)host,
+ dwSSPIFlags,
+ 0,
+ SECURITY_NATIVE_DREP,
+ NULL,
+ 0,
+ &ssl->hContext,
+ &OutBuffer,
+ &dwSSPIOutFlags,
&tsExpiry);
if (scRet != SEC_I_CONTINUE_NEEDED)
@@ -631,17 +631,17 @@ void NetlibSslShutdown(SslHandle *ssl) OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
- &hCreds,
- &ssl->hContext,
- NULL,
- dwSSPIFlags,
- 0,
- SECURITY_NATIVE_DREP,
- NULL,
- 0,
- &ssl->hContext,
- &OutBuffer,
- &dwSSPIOutFlags,
+ &hCreds,
+ &ssl->hContext,
+ NULL,
+ dwSSPIFlags,
+ 0,
+ SECURITY_NATIVE_DREP,
+ NULL,
+ 0,
+ &ssl->hContext,
+ &OutBuffer,
+ &dwSSPIOutFlags,
&tsExpiry);
if (FAILED(scRet)) return;
@@ -953,10 +953,10 @@ static INT_PTR GetSslApi(WPARAM, LPARAM lParam) if (si->cbSize != sizeof(SSL_API))
return FALSE;
- si->connect = (HSSL (__cdecl *)(SOCKET,const char *,int))NetlibSslConnect;
+ si->connect = (HSSL (__cdecl *)(SOCKET, const char *, int))NetlibSslConnect;
si->pending = (BOOL (__cdecl *)(HSSL))NetlibSslPending;
- si->read = (int (__cdecl *)(HSSL,char *,int,int))NetlibSslRead;
- si->write = (int (__cdecl *)(HSSL,const char *,int))NetlibSslWrite;
+ si->read = (int (__cdecl *)(HSSL, char *, int, int))NetlibSslRead;
+ si->write = (int (__cdecl *)(HSSL, const char *, int))NetlibSslWrite;
si->shutdown = (void (__cdecl *)(HSSL))NetlibSslShutdown;
si->sfree = (void (__cdecl *)(HSSL))NetlibSslFree;
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index 655bb781eb..12e0345c27 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -115,12 +115,12 @@ static char szCtlUrl[256], szDev[256]; typedef enum
{
- DeviceGetReq,
- ControlAction,
+ DeviceGetReq,
+ ControlAction,
ControlQuery
} ReqType;
-static bool txtParseParam(char* szData, char* presearch,
+static bool txtParseParam(char* szData, char* presearch,
char* start, char* finish, char* param, size_t size)
{
char *cp, *cp1;
@@ -156,14 +156,14 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) char *ppath, *phost, *pport;
int sz;
- phost = strstr(szUrl,"://");
+ phost = strstr(szUrl, "://");
if (phost == NULL) phost = szUrl;
else phost += 3;
- ppath = strchr(phost,'/');
+ ppath = strchr(phost, '/');
if (ppath == NULL) ppath = phost + strlen(phost);
- pport = strchr(phost,':');
+ pport = strchr(phost, ':');
if (pport == NULL) pport = ppath;
if (szHost != NULL)
@@ -272,11 +272,11 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction char szData1[1024];
szReq = mir_strdup(szResult);
- sz = mir_snprintf (szData1, sizeof(szData1),
+ sz = mir_snprintf (szData1, sizeof(szData1),
soap_action, szActionName, szDev, szReq, szActionName);
- sz = mir_snprintf (szData, 4096,
- szPostHdr, szPath, szHost, sPort,
+ sz = mir_snprintf (szData, 4096,
+ szPostHdr, szPath, szHost, sPort,
sz, szDev, szActionName, szData1);
}
break;
@@ -285,11 +285,11 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction {
char szData1[1024];
- sz = mir_snprintf (szData1, sizeof(szData1),
+ sz = mir_snprintf (szData1, sizeof(szData1),
soap_query, szActionName);
- sz = mir_snprintf (szData, 4096,
- szPostHdr, szPath, szHost, sPort,
+ sz = mir_snprintf (szData, 4096,
+ szPostHdr, szPath, szHost, sPort,
sz, "urn:schemas-upnp-org:control-1-0", "QueryStateVariable", szData1);
}
break;
@@ -742,7 +742,7 @@ bool NetlibUPnPAddPortMapping(WORD intport, char *proto, WORD *extport, DWORD *e do
{
++*extport;
- mir_snprintf(szData, 4096, add_port_mapping,
+ mir_snprintf(szData, 4096, add_port_mapping,
*extport, proto, intport, inet_ntoa(locIP.sin_addr));
res = httpTransact(szCtlUrl, szData, 4096, "AddPortMapping", ControlAction);
txtParseParam(szData, NULL, "<errorCode>", "</errorCode>", szExtIP, sizeof(szExtIP));
@@ -795,7 +795,7 @@ void NetlibUPnPDeletePortMapping(WORD extport, char* proto) void NetlibUPnPCleanup(void*)
{
- if (DBGetContactSettingByte(NULL,"Netlib","NLEnableUPnP",1) == 0)
+ if (DBGetContactSettingByte(NULL, "Netlib", "NLEnableUPnP", 1) == 0)
// upnp is disabled globally, no need for a cleanup
return;
diff --git a/src/modules/options/descbutton.cpp b/src/modules/options/descbutton.cpp index 2b5a270271..08538fc41c 100644 --- a/src/modules/options/descbutton.cpp +++ b/src/modules/options/descbutton.cpp @@ -3,7 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
Copyright 2007 Artem Shpynov
-Copyright 2000-2007 Miranda ICQ/IM project,
+Copyright 2000-2007 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -13,7 +13,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.
@@ -130,8 +130,8 @@ static void MDescButton_DrawGradient(HDC hdc, int x, int y, int width, int heigh RECT rc; SetRect(&rc, x, 0, x+width, 0);
for (int i=y+height; --i >= y; ) {
COLORREF color = RGB(
- ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
- ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
+ ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
+ ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height);
rc.top = rc.bottom = i;
++rc.bottom;
@@ -150,13 +150,13 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg RECT temprc;
HFONT hfntSave;
- HDC hdc=BeginPaint(hwndDlg,&ps);
+ HDC hdc=BeginPaint(hwndDlg, &ps);
HDC tempDC=CreateCompatibleDC(hdc);
SIZE titleSize = {0};
- hBmp=CreateCompatibleBitmap(hdc,dat->width, dat->height);
- hOldBmp=(HBITMAP)SelectObject(tempDC,hBmp);
+ hBmp=CreateCompatibleBitmap(hdc, dat->width, dat->height);
+ hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp);
temprc.left=0;
temprc.right=dat->width;
@@ -212,11 +212,11 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg SelectObject(tempDC, hfntSave);
//Copy to output
- BitBlt(hdc,dat->rc.left,dat->rc.top,dat->width,dat->height,tempDC,0,0,SRCCOPY);
- SelectObject(tempDC,hOldBmp);
+ BitBlt(hdc, dat->rc.left, dat->rc.top, dat->width, dat->height, tempDC, 0, 0, SRCCOPY);
+ SelectObject(tempDC, hOldBmp);
DeleteObject(hBmp);
DeleteDC(tempDC);
- EndPaint(hwndDlg,&ps);
+ EndPaint(hwndDlg, &ps);
return TRUE;
}
@@ -240,7 +240,7 @@ static LRESULT CALLBACK MDescButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wPara break;
case WM_SIZE:
- GetClientRect(hwndDlg,&dat->rc);
+ GetClientRect(hwndDlg, &dat->rc);
dat->width=dat->rc.right-dat->rc.left;
dat->height=dat->rc.bottom-dat->rc.top;
return TRUE;
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index 0088220266..3e003d720e 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -50,7 +50,7 @@ INT_PTR CALLBACK DlgProcOptSearch(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_ENABLE_KEYWORDFILTERING:
- SendMessage(GetParent(hWnd), PSM_CHANGED,0,0);
+ SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
break;
}
break;
@@ -151,7 +151,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) AddFilterString(key, title);
TCHAR szClass[64];
- GetClassName(hWndDlg,szClass, SIZEOF(szClass));
+ GetClassName(hWndDlg, szClass, SIZEOF(szClass));
if (lstrcmpi(szClass, _T("SysTreeView32")) == 0) {
HTREEITEM hItem = TreeView_GetRoot(hWndDlg);
@@ -194,7 +194,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) AddFilterString(key, title);
} } } } } } }
-static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd,LPARAM lParam)
+static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam)
{
AddDialogString(hWnd, lParam);
diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h index 3db823fcdf..fc15074502 100644 --- a/src/modules/options/filter.h +++ b/src/modules/options/filter.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp index 4a6f11cba5..f47047ad19 100644 --- a/src/modules/options/headerbar.cpp +++ b/src/modules/options/headerbar.cpp @@ -3,7 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
Copyright 2007 Artem Shpynov
-Copyright 2000-2007 Miranda ICQ/IM project,
+Copyright 2000-2007 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -13,7 +13,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.
@@ -129,8 +129,8 @@ static void MHeaderbar_DrawGradient(HDC hdc, int x, int y, int width, int height for (i=y+height; --i >= y; )
{
COLORREF color = RGB(
- ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
- ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
+ ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
+ ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height);
rc.top = rc.bottom = i;
++rc.bottom;
@@ -155,7 +155,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, TCHAR *szSubTitle = _tcschr(szTitle, _T('\n'));
if (szSubTitle) *szSubTitle++ = 0;
- HDC hdc=BeginPaint(hwndDlg,&ps);
+ HDC hdc=BeginPaint(hwndDlg, &ps);
HDC tempDC=CreateCompatibleDC(hdc);
BITMAPINFO bmi;
@@ -167,7 +167,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, bmi.bmiHeader.biCompression = BI_RGB;
hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- hOldBmp=(HBITMAP)SelectObject(tempDC,hBmp);
+ hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp);
if (IsAeroMode()) {
RECT temprc;
@@ -177,7 +177,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, temprc.bottom=mit->width;
FillRect(tempDC, &temprc, (HBRUSH)GetStockObject(BLACK_BRUSH));
- MARGINS margins = {0,0,mit->height,0};
+ MARGINS margins = {0, 0, mit->height, 0};
dwmExtendFrameIntoClientArea(GetParent(hwndDlg), &margins);
WTA_OPTIONS opts;
@@ -275,19 +275,19 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg, CombineRgn(hRgn, hRgn, hRgnTmp, RGN_DIFF);
DeleteObject(hRgnTmp);
}
- SelectClipRgn(hdc,hRgn);
+ SelectClipRgn(hdc, hRgn);
DeleteObject(hRgn);
}
- BitBlt(hdc,mit->rc.left,mit->rc.top,mit->width,mit->height,tempDC,0,0,SRCCOPY);
+ BitBlt(hdc, mit->rc.left, mit->rc.top, mit->width, mit->height, tempDC, 0, 0, SRCCOPY);
- SelectClipRgn(hdc,NULL);
+ SelectClipRgn(hdc, NULL);
- SelectObject(tempDC,hOldBmp);
+ SelectObject(tempDC, hOldBmp);
DeleteObject(hBmp);
DeleteDC(tempDC);
- EndPaint(hwndDlg,&ps);
+ EndPaint(hwndDlg, &ps);
return TRUE;
}
@@ -332,7 +332,7 @@ static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam break;
case WM_SIZE:
- GetClientRect(hwndDlg,&itc->rc);
+ GetClientRect(hwndDlg, &itc->rc);
itc->width=itc->rc.right-itc->rc.left;
itc->height=itc->rc.bottom-itc->rc.top;
return TRUE;
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp index b31ba45bba..8499f3d470 100644 --- a/src/modules/options/iconheader.cpp +++ b/src/modules/options/iconheader.cpp @@ -3,7 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
Copyright 2007 Artem Shpynov
-Copyright 2000-2007 Miranda ICQ/IM project,
+Copyright 2000-2007 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -13,7 +13,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.
@@ -171,8 +171,8 @@ static void MIcoTab_DrawGradient(HDC hdc, int x, int y, int width, int height, R RECT rc; SetRect(&rc, x, 0, x+width, 0);
for ( int i=y+height; --i >= y; ) {
COLORREF color = RGB(
- ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
- ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
+ ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height,
+ ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height,
((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height);
rc.top = rc.bottom = i;
++rc.bottom;
@@ -244,7 +244,7 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, textRect.right=itemX+dat->itemWidth;
textRect.top=textTop;
textRect.bottom=iconTop+dat->itemHeight;
- DrawIcon(hdc,itemX+dat->itemWidth/2-16, iconTop, tab->hIcon);
+ DrawIcon(hdc, itemX+dat->itemWidth/2-16, iconTop, tab->hIcon);
if (IsVSMode()) {
DTTOPTS dto = {0};
@@ -257,7 +257,7 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab, mir_free(tcsNameW);
closeThemeData(hTheme);
}
- else DrawText(hdc,tab->tcsName,-1,&textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS);
+ else DrawText(hdc, tab->tcsName, -1, &textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS);
if (hFntSave)
DeleteObject(SelectObject(hdc, hFntSave));
@@ -270,7 +270,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM RECT temprc;
int i;
- HDC hdc=BeginPaint(hwndDlg,&ps);
+ HDC hdc=BeginPaint(hwndDlg, &ps);
HDC tempDC=CreateCompatibleDC(hdc);
HFONT hFont = 0;
@@ -284,7 +284,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM bmi.bmiHeader.biCompression = BI_RGB;
hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- hOldBmp=(HBITMAP)SelectObject(tempDC,hBmp);
+ hOldBmp=(HBITMAP)SelectObject(tempDC, hBmp);
if (IsAeroMode()) {
temprc.left=0;
@@ -295,7 +295,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM }
else {
if (mit->hBkgBmp)
- StretchBlt(tempDC,0,0,mit->width,mit->height,mit->hBkgDC,0,0,mit->BkgSize.cx,mit->BkgSize.cy,SRCCOPY);
+ StretchBlt(tempDC, 0, 0, mit->width, mit->height, mit->hBkgDC, 0, 0, mit->BkgSize.cx, mit->BkgSize.cy, SRCCOPY);
else {
if (IsVSMode())
MIcoTab_FillRect(tempDC, 0, 0, mit->width, mit->height, GetSysColor(COLOR_WINDOW));
@@ -308,8 +308,8 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM //Draw Items
hFont = mit->hFont;
- SelectObject(tempDC,hFont);
- SetBkMode(tempDC,TRANSPARENT);
+ SelectObject(tempDC, hFont);
+ SetBkMode(tempDC, TRANSPARENT);
for (i=0; i<mit->pList.getCount(); i++) {
MIcoTab *tab = (MIcoTab *)mit->pList[i];
@@ -317,12 +317,12 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM }
//Copy to output
- BitBlt(hdc,mit->rc.left,mit->rc.top,mit->width,mit->height,tempDC,0,0,SRCCOPY);
- SelectObject(tempDC,hOldBmp);
+ BitBlt(hdc, mit->rc.left, mit->rc.top, mit->width, mit->height, tempDC, 0, 0, SRCCOPY);
+ SelectObject(tempDC, hOldBmp);
DeleteObject(hBmp);
DeleteDC(tempDC);
- EndPaint(hwndDlg,&ps);
+ EndPaint(hwndDlg, &ps);
return TRUE;
}
@@ -342,7 +342,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (IsAeroMode()) {
RECT rc; GetWindowRect(hwndDlg, &rc);
- MARGINS margins = {0,0,rc.bottom-rc.top,0};
+ MARGINS margins = {0, 0, rc.bottom-rc.top, 0};
dwmExtendFrameIntoClientArea(GetParent(hwndDlg), &margins);
}
@@ -353,7 +353,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case WM_SIZE:
- GetClientRect(hwndDlg,&itc->rc);
+ GetClientRect(hwndDlg, &itc->rc);
itc->width=itc->rc.right-itc->rc.left;
itc->height=itc->rc.bottom-itc->rc.top;
@@ -397,8 +397,8 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L itc->nSelectedIdx = itc->nHotIdx;
SetWindowText(hwndDlg, itc->pList[itc->nSelectedIdx]->tcsName);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE);
- SendMessage(GetParent(hwndDlg), WM_COMMAND,
- MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED),
+ SendMessage(GetParent(hwndDlg), WM_COMMAND,
+ MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED),
itc->nSelectedIdx);
}
return 0;
@@ -454,8 +454,8 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L itc->nSelectedIdx = newIdx;
SetWindowText(hwndDlg, itc->pList[itc->nSelectedIdx]->tcsName);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE);
- SendMessage(GetParent(hwndDlg), WM_COMMAND,
- MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGEDKBD),
+ SendMessage(GetParent(hwndDlg), WM_COMMAND,
+ MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGEDKBD),
itc->nSelectedIdx);
}
return 0;
@@ -518,8 +518,8 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L itc->nSelectedIdx = wParam;
SetWindowText(hwndDlg, itc->pList[itc->nSelectedIdx]->tcsName);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE);
- SendMessage(GetParent(hwndDlg), WM_COMMAND,
- MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED),
+ SendMessage(GetParent(hwndDlg), WM_COMMAND,
+ MAKEWPARAM(GetWindowLongPtr(hwndDlg, GWL_ID), ITCN_SELCHANGED),
itc->nSelectedIdx);
}
return TRUE;
@@ -537,7 +537,7 @@ static LRESULT CALLBACK MIcoTabWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SelectObject(itc->hBkgDC, itc->hBkgOldBmp);
DeleteDC(itc->hBkgDC);
}
- li_ListDestruct(itc->pList,MITListDestructor);
+ li_ListDestruct(itc->pList, MITListDestructor);
delete itc;
return TRUE;
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 0b6c2d583d..c417b4b6e4 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -1483,7 +1483,7 @@ static int OptModulesLoaded(WPARAM, LPARAM) mi.position = 1900000000;
mi.pszName = LPGEN("&Options...");
mi.pszService = "Options/OptionsCommand";
- CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index f8067579ba..5dc90a2750 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -854,7 +854,7 @@ static int UnloadPluginDynamically(PluginListItemData* dat) return TRUE;
}
-static LRESULT CALLBACK PluginListWndProc(HWND hwnd,UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_LBUTTONDOWN) {
LVHITTESTINFO hi;
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index e865450967..f2706ddb08 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp index f5ebd92fb1..0960aa34f0 100644 --- a/src/modules/protocols/protochains.cpp +++ b/src/modules/protocols/protochains.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_protomod.h>
//Protocol chain is list of integers "0".."n", with network protocol named "p"
-INT_PTR Proto_CallContactService(WPARAM wParam,LPARAM lParam)
+INT_PTR Proto_CallContactService(WPARAM wParam, LPARAM lParam)
//note that this is ChainSend() too, due to a quirk of function definitions
{
CCSDATA *ccs=(CCSDATA*)lParam;
@@ -68,7 +68,7 @@ INT_PTR Proto_CallContactService(WPARAM wParam,LPARAM lParam) return ret;
}
-static INT_PTR CallRecvChain(WPARAM wParam,LPARAM lParam)
+static INT_PTR CallRecvChain(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs=(CCSDATA*)lParam;
int i;
@@ -121,10 +121,10 @@ static INT_PTR CallRecvChain(WPARAM wParam,LPARAM lParam) return ret;
}
-static INT_PTR Proto_ChainRecv(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_ChainRecv(WPARAM wParam, LPARAM lParam)
{
/* this will switch threads just like before */
- return CallServiceSync(MS_PROTO_CHAINRECV "ThreadSafe",wParam,lParam);
+ return CallServiceSync(MS_PROTO_CHAINRECV "ThreadSafe", wParam, lParam);
}
PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact)
@@ -157,7 +157,7 @@ static INT_PTR Proto_GetContactBaseAccount(WPARAM wParam, LPARAM) return (INT_PTR)(pa ? pa->szModuleName : NULL);
}
-static INT_PTR Proto_IsProtoOnContact(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_IsProtoOnContact(WPARAM wParam, LPARAM lParam)
{
int i;
char str[10];
@@ -165,17 +165,17 @@ static INT_PTR Proto_IsProtoOnContact(WPARAM wParam,LPARAM lParam) if (!lParam) return 0;
- if (!DBGetContactSettingString((HANDLE)wParam,"Protocol","p",&dbv)) {
- if (!_stricmp((char*)lParam,dbv.pszVal)) {
+ if (!DBGetContactSettingString((HANDLE)wParam, "Protocol", "p", &dbv)) {
+ if (!_stricmp((char*)lParam, dbv.pszVal)) {
mir_free(dbv.pszVal);
return -1;
}
mir_free(dbv.pszVal);
}
for (i=0;;i++) {
- _itoa(i,str,10);
- if (DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) break;
- if (!strcmp((char*)lParam,dbv.pszVal)) {
+ _itoa(i, str, 10);
+ if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) break;
+ if (!strcmp((char*)lParam, dbv.pszVal)) {
mir_free(dbv.pszVal);
return i+1;
}
@@ -184,33 +184,33 @@ static INT_PTR Proto_IsProtoOnContact(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
{
- PROTOCOLDESCRIPTOR *pd,*pdCompare;
+ PROTOCOLDESCRIPTOR *pd, *pdCompare;
pd = Proto_IsProtocolLoaded(( char* )lParam );
if ( pd == NULL ) {
PROTOACCOUNT* pa = Proto_GetAccount(( char* )lParam );
if ( pa ) {
- DBWriteContactSettingString((HANDLE)wParam,"Protocol","p",(char*)lParam);
+ DBWriteContactSettingString((HANDLE)wParam, "Protocol", "p", (char*)lParam);
return 0;
}
return 1;
}
if ( pd->type == PROTOTYPE_PROTOCOL ) {
- DBWriteContactSettingString((HANDLE)wParam,"Protocol","p",(char*)lParam);
+ DBWriteContactSettingString((HANDLE)wParam, "Protocol", "p", (char*)lParam);
return 0;
}
- if (Proto_IsProtoOnContact(wParam,lParam)) return 1;
+ if (Proto_IsProtoOnContact(wParam, lParam)) return 1;
{ /* v:0.3.3 + PROTO FILTERS ARE NOW KEPT IN THEIR OWN DB MODULE! */
int i;
- char str[10],*lastProto;
+ char str[10], *lastProto;
DBVARIANT dbv;
for (i=0;;i++) {
- _itoa(i,str,10);
- if (DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) break;
+ _itoa(i, str, 10);
+ if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) break;
pdCompare = Proto_IsProtocolLoaded(( char* )dbv.pszVal );
mir_free(dbv.pszVal);
if (pdCompare == NULL) continue;
@@ -219,13 +219,13 @@ static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam) //put the new module at position i
lastProto=mir_strdup((char*)lParam);
for (;;i++) {
- _itoa(i,str,10);
- if (DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) {
- DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,lastProto);
+ _itoa(i, str, 10);
+ if (DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) {
+ DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, lastProto);
mir_free(lastProto);
break;
}
- DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,lastProto);
+ DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, lastProto);
mir_free(lastProto);
lastProto=dbv.pszVal;
}
@@ -233,26 +233,26 @@ static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR Proto_RemoveFromContact(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_RemoveFromContact(WPARAM wParam, LPARAM lParam)
{
int i;
DBVARIANT dbv;
char str[10];
- i = Proto_IsProtoOnContact(wParam,lParam);
+ i = Proto_IsProtoOnContact(wParam, lParam);
if (!i) return 1;
if (i == -1)
- DBDeleteContactSetting((HANDLE)wParam,"Protocol","p");
+ DBDeleteContactSetting((HANDLE)wParam, "Protocol", "p");
else {
for (i--;;i++) { //we have to decrease i, as Proto_IsOnContact returns +1 more number than read from database
- _itoa(i+1,str,10);
- if (0 != DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) {
- _itoa(i,str,10);
- DBDeleteContactSetting((HANDLE)wParam,"_Filter",str);
+ _itoa(i+1, str, 10);
+ if (0 != DBGetContactSettingString((HANDLE)wParam, "_Filter", str, &dbv)) {
+ _itoa(i, str, 10);
+ DBDeleteContactSetting((HANDLE)wParam, "_Filter", str);
break;
}
- _itoa(i,str,10);
- DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,dbv.pszVal);
+ _itoa(i, str, 10);
+ DBWriteContactSettingString((HANDLE)wParam, "_Filter", str, dbv.pszVal);
mir_free(dbv.pszVal);
}
}
@@ -261,14 +261,14 @@ static INT_PTR Proto_RemoveFromContact(WPARAM wParam,LPARAM lParam) int LoadProtoChains(void)
{
- CreateServiceFunction(MS_PROTO_CALLCONTACTSERVICE,Proto_CallContactService);
- CreateServiceFunction(MS_PROTO_CHAINSEND,Proto_CallContactService);
- CreateServiceFunction(MS_PROTO_CHAINRECV,Proto_ChainRecv);
- CreateServiceFunction(MS_PROTO_CHAINRECV "ThreadSafe",CallRecvChain);
- CreateServiceFunction(MS_PROTO_GETCONTACTBASEPROTO,Proto_GetContactBaseProto);
- CreateServiceFunction(MS_PROTO_GETCONTACTBASEACCOUNT,Proto_GetContactBaseAccount);
- CreateServiceFunction(MS_PROTO_ISPROTOONCONTACT,Proto_IsProtoOnContact);
- CreateServiceFunction(MS_PROTO_ADDTOCONTACT,Proto_AddToContact);
- CreateServiceFunction(MS_PROTO_REMOVEFROMCONTACT,Proto_RemoveFromContact);
+ CreateServiceFunction(MS_PROTO_CALLCONTACTSERVICE, Proto_CallContactService);
+ CreateServiceFunction(MS_PROTO_CHAINSEND, Proto_CallContactService);
+ CreateServiceFunction(MS_PROTO_CHAINRECV, Proto_ChainRecv);
+ CreateServiceFunction(MS_PROTO_CHAINRECV "ThreadSafe", CallRecvChain);
+ CreateServiceFunction(MS_PROTO_GETCONTACTBASEPROTO, Proto_GetContactBaseProto);
+ CreateServiceFunction(MS_PROTO_GETCONTACTBASEACCOUNT, Proto_GetContactBaseAccount);
+ CreateServiceFunction(MS_PROTO_ISPROTOONCONTACT, Proto_IsProtoOnContact);
+ CreateServiceFunction(MS_PROTO_ADDTOCONTACT, Proto_AddToContact);
+ CreateServiceFunction(MS_PROTO_REMOVEFROMCONTACT, Proto_RemoveFromContact);
return 0;
}
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index ed1e7c14f2..1da7f0b4dd 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -26,7 +26,7 @@ int LoadProtoChains(void); int LoadProtoOptions( void );
HANDLE hAccListChanged;
-static HANDLE hAckEvent,hTypeEvent;
+static HANDLE hAckEvent, hTypeEvent;
static BOOL bModuleInitialized = FALSE;
typedef struct
@@ -86,7 +86,7 @@ INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam) return (INT_PTR)Proto_GetAccount(( char* )lParam );
}
-INT_PTR Proto_EnumProtocols(WPARAM wParam,LPARAM lParam)
+INT_PTR Proto_EnumProtocols(WPARAM wParam, LPARAM lParam)
{
*( int* )wParam = protos.getCount();
*( PROTOCOLDESCRIPTOR*** )lParam = protos.getArray();
@@ -144,7 +144,7 @@ static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
// Basic core services
-static INT_PTR Proto_RecvFile(WPARAM,LPARAM lParam)
+static INT_PTR Proto_RecvFile(WPARAM, LPARAM lParam)
{
CCSDATA* ccs = ( CCSDATA* )lParam;
PROTORECVEVENT* pre = ( PROTORECVEVENT* )ccs->lParam;
@@ -195,7 +195,7 @@ static void sttRecvCreateBlob( DBEVENTINFO& dbei, int fileCount, char** pszFiles strcpy(( char* )p, ( szDescr == NULL ) ? "" : szDescr );
}
-static INT_PTR Proto_RecvFileT(WPARAM,LPARAM lParam)
+static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
{
CCSDATA* ccs = ( CCSDATA* )lParam;
PROTORECVFILET* pre = ( PROTORECVFILET* )ccs->lParam;
@@ -230,7 +230,7 @@ static INT_PTR Proto_RecvFileT(WPARAM,LPARAM lParam) return 0;
}
-static INT_PTR Proto_RecvMessage(WPARAM,LPARAM lParam)
+static INT_PTR Proto_RecvMessage(WPARAM, LPARAM lParam)
{
CCSDATA *ccs = ( CCSDATA* )lParam;
PROTORECVEVENT *pre = ( PROTORECVEVENT* )ccs->lParam;
@@ -262,10 +262,10 @@ static int Proto_ValidTypingContact(HANDLE hContact, char *szProto) if ( !hContact || !szProto )
return 0;
- return ( CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_4,0) & PF4_SUPPORTTYPING ) ? 1 : 0;
+ return ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_SUPPORTTYPING ) ? 1 : 0;
}
-static INT_PTR Proto_SelfIsTyping(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
{
if ( lParam == PROTOTYPE_SELFTYPING_OFF || lParam == PROTOTYPE_SELFTYPING_ON ) {
char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
@@ -279,7 +279,7 @@ static INT_PTR Proto_SelfIsTyping(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR Proto_ContactIsTyping(WPARAM wParam,LPARAM lParam)
+static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
int type = (int)lParam;
char *szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index 0acabb84a2..ccad4701d6 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -30,7 +30,7 @@ INT_PTR __fastcall MyCallProtoService( const char *szModule, const char *szServi {
char str[MAXMODULELABELLENGTH];
mir_snprintf( str, sizeof(str), "%s%s", szModule, szService );
- return CallService(str,wParam,lParam);
+ return CallService(str, wParam, lParam);
}
struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
@@ -180,7 +180,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE }
int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList )
- { CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags,nContacts), (LPARAM)hContactsList };
+ { CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
return ( int )MyCallProtoService( m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs );
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 4fcb5b7e18..ccf68482ee 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -69,7 +69,7 @@ typedef struct }
AccFormDlgParam;
-static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch( message ) {
case WM_INITDIALOG:
@@ -277,7 +277,7 @@ static LRESULT CALLBACK sttEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
}
-static LRESULT CALLBACK AccListWndProc(HWND hwnd,UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct TAccListData *dat = (struct TAccListData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if ( !dat )
@@ -461,7 +461,7 @@ static void sttUpdateAccountInfo(HWND hwndDlg, struct TAccMgrData *dat) SetWindowText(GetDlgItem(hwndDlg, IDC_TXT_INFO), TranslateT(welcomeMsg));
}
-INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
struct TAccMgrData *dat = (struct TAccMgrData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -783,8 +783,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM else {
DWORD dwStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
if (dwStatus >= ID_STATUS_ONLINE) {
- if (IDCANCEL == ::MessageBox(hwndDlg,
- TranslateT("Account is online. Disable account?"),
+ if (IDCANCEL == ::MessageBox(hwndDlg,
+ TranslateT("Account is online. Disable account?"),
TranslateT("Accounts"), MB_OKCANCEL)) {
pa->bIsEnabled = 1; //stay enabled
}
@@ -852,7 +852,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg,UINT message, WPARAM wParam, LPARAM TCHAR buf[ 200 ];
mir_sntprintf( buf, SIZEOF(buf), TranslateT( "Account %s is being deleted" ), pa->tszAccountName );
if (pa->bOldProto) {
- MessageBox( NULL, TranslateT( "You need to disable plugin to delete this account" ), buf,
+ MessageBox( NULL, TranslateT( "You need to disable plugin to delete this account" ), buf,
MB_ICONERROR | MB_OK );
break;
}
@@ -1041,7 +1041,7 @@ int OptProtosLoaded(WPARAM, LPARAM) mi.position = 1900000000;
mi.pszName = LPGEN("&Accounts...");
mi.pszService = MS_PROTO_SHOWACCMGR;
- CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index 1d3c0cdd6b..018411d7a1 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -215,7 +215,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) item->DefHotkey = desc->DefHotKey & ~HKF_MIRANDA_LOCAL;
item->Hotkey = DBGetContactSettingWord(NULL, DBMODULENAME, item->pszName, item->DefHotkey);
item->type = item->pszService ?
- ( THotkeyType )DBGetContactSettingByte(NULL, DBMODULENAME "Types", item->pszName,
+ ( THotkeyType )DBGetContactSettingByte(NULL, DBMODULENAME "Types", item->pszName,
(desc->DefHotKey & HKF_MIRANDA_LOCAL) ? HKT_LOCAL : HKT_GLOBAL) : HKT_MANUAL;
item->lParam = desc->lParam;
@@ -403,11 +403,11 @@ static TCHAR *sttHokeyVkToName(WORD vkKey) void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key)
{
- mir_sntprintf(buf, size, _T("%s%s%s%s%s"),
- (shift & HOTKEYF_CONTROL) ? _T("Ctrl + ") : _T(""),
- (shift & HOTKEYF_ALT) ? _T("Alt + ") : _T(""),
- (shift & HOTKEYF_SHIFT) ? _T("Shift + ") : _T(""),
- (shift & HOTKEYF_EXT) ? _T("Win + ") : _T(""),
+ mir_sntprintf(buf, size, _T("%s%s%s%s%s"),
+ (shift & HOTKEYF_CONTROL) ? _T("Ctrl + ") : _T(""),
+ (shift & HOTKEYF_ALT) ? _T("Alt + ") : _T(""),
+ (shift & HOTKEYF_SHIFT) ? _T("Shift + ") : _T(""),
+ (shift & HOTKEYF_EXT) ? _T("Win + ") : _T(""),
sttHokeyVkToName(key));
}
@@ -853,7 +853,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, szSetting = mir_t2a(lvi.pszText);
- ListView_SetCheckState(hwndHotkey, lvi.iItem,
+ ListView_SetCheckState(hwndHotkey, lvi.iItem,
DBGetContactSettingByte(NULL, DBMODULENAME "UI", szSetting, TRUE));
mir_free(szSetting);
@@ -891,7 +891,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, szSetting = mir_t2a(lvi.pszText);
- DBWriteContactSettingByte(NULL, DBMODULENAME "UI", szSetting,
+ DBWriteContactSettingByte(NULL, DBMODULENAME "UI", szSetting,
(BYTE) ListView_GetCheckState(hwndHotkey, lvi.iItem));
mir_free(szSetting);
@@ -1060,10 +1060,10 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (item->type != HKT_MANUAL) {
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
AppendMenu(hMenu, MF_STRING|
- ((item->OptType == HKT_GLOBAL) ? MF_CHECKED : 0),
+ ((item->OptType == HKT_GLOBAL) ? MF_CHECKED : 0),
(UINT_PTR)MI_SYSTEM, TranslateT("System scope"));
AppendMenu(hMenu, MF_STRING|
- ((item->OptType == HKT_LOCAL) ? MF_CHECKED : 0),
+ ((item->OptType == HKT_LOCAL) ? MF_CHECKED : 0),
(UINT_PTR)MI_LOCAL, TranslateT("Miranda scope"));
}
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index b8febacf3a..8dd3d47a68 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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,66 +34,66 @@ struct StandardIconDescription static const struct StandardIconDescription mainIcons[] =
{
- { SKINICON_OTHER_MIRANDA, LPGEN("Miranda IM"), -IDI_MIRANDA },
- { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG },
- { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL },
- { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE },
- { SKINICON_OTHER_USERONLINE, LPGEN("User Online"), -IDI_USERONLINE },
- { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (Open)"), -IDI_GROUPOPEN },
- { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (Closed)"), -IDI_GROUPSHUT },
- { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD },
- { SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact"), -IDI_ADDCONTACT },
- { SKINICON_OTHER_USERDETAILS, LPGEN("User Details"), -IDI_USERDETAILS },
- { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY },
- { SKINICON_OTHER_DOWNARROW, LPGEN("Down Arrow"), -IDI_DOWNARROW },
- { SKINICON_OTHER_FINDUSER, LPGEN("Find User"), -IDI_FINDUSER },
- { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS },
- { SKINICON_OTHER_SENDEMAIL, LPGEN("Send E-mail"), -IDI_SENDEMAIL },
- { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE },
- { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME },
- { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS },
- { SKINICON_OTHER_SEARCHALL, LPGEN("Search All"), -IDI_SEARCHALL },
- { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK },
- { SKINICON_OTHER_NOTICK, LPGEN("No Tick"), -IDI_NOTICK },
- { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP },
- { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda Website"), -IDI_MIRANDAWEBSITE },
- { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING },
- { SKINICON_OTHER_SMALLDOT, LPGEN("Small Dot"), -IDI_SMALLDOT },
- { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled Blob"), -IDI_FILLEDBLOB },
- { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty Blob"), -IDI_EMPTYBLOB },
- { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE },
- { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI },
- { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED },
- { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED },
- { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO },
- { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW },
- { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS },
- { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR },
- { SKINICON_OTHER_SHOWHIDE, LPGEN("ShowHide"), -IDI_SHOWHIDE },
- { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT },
- { SKINICON_OTHER_MAINMENU, LPGEN("Main Menu"), -IDI_MIRANDA },
- { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE },
- { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT },
- { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT },
- { SKINICON_OTHER_GROUP, LPGEN("Move to Group"), -IDI_MOVETOGROUP },
- { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON },
- { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF },
- { SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, "Status Icons" },
+ { SKINICON_OTHER_MIRANDA, LPGEN("Miranda IM"), -IDI_MIRANDA },
+ { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG },
+ { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL },
+ { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE },
+ { SKINICON_OTHER_USERONLINE, LPGEN("User Online"), -IDI_USERONLINE },
+ { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (Open)"), -IDI_GROUPOPEN },
+ { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (Closed)"), -IDI_GROUPSHUT },
+ { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD },
+ { SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact"), -IDI_ADDCONTACT },
+ { SKINICON_OTHER_USERDETAILS, LPGEN("User Details"), -IDI_USERDETAILS },
+ { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY },
+ { SKINICON_OTHER_DOWNARROW, LPGEN("Down Arrow"), -IDI_DOWNARROW },
+ { SKINICON_OTHER_FINDUSER, LPGEN("Find User"), -IDI_FINDUSER },
+ { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS },
+ { SKINICON_OTHER_SENDEMAIL, LPGEN("Send E-mail"), -IDI_SENDEMAIL },
+ { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE },
+ { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME },
+ { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS },
+ { SKINICON_OTHER_SEARCHALL, LPGEN("Search All"), -IDI_SEARCHALL },
+ { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK },
+ { SKINICON_OTHER_NOTICK, LPGEN("No Tick"), -IDI_NOTICK },
+ { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP },
+ { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda Website"), -IDI_MIRANDAWEBSITE },
+ { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING },
+ { SKINICON_OTHER_SMALLDOT, LPGEN("Small Dot"), -IDI_SMALLDOT },
+ { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled Blob"), -IDI_FILLEDBLOB },
+ { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty Blob"), -IDI_EMPTYBLOB },
+ { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE },
+ { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI },
+ { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED },
+ { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED },
+ { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO },
+ { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW },
+ { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS },
+ { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR },
+ { SKINICON_OTHER_SHOWHIDE, LPGEN("ShowHide"), -IDI_SHOWHIDE },
+ { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT },
+ { SKINICON_OTHER_MAINMENU, LPGEN("Main Menu"), -IDI_MIRANDA },
+ { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE },
+ { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT },
+ { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT },
+ { SKINICON_OTHER_GROUP, LPGEN("Move to Group"), -IDI_MOVETOGROUP },
+ { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON },
+ { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF },
+ { SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, "Status Icons" },
};
HANDLE hMainIcons[SIZEOF(mainIcons)];
static const struct StandardIconDescription statusIcons[] =
{
- { ID_STATUS_OFFLINE, LPGEN("Offline"), -IDI_OFFLINE, 0xFFFFFFFF },
- { ID_STATUS_ONLINE, LPGEN("Online"), -IDI_ONLINE, PF2_ONLINE },
- { ID_STATUS_AWAY, LPGEN("Away"), -IDI_AWAY, PF2_SHORTAWAY },
- { ID_STATUS_NA, LPGEN("NA"), -IDI_NA, PF2_LONGAWAY },
- { ID_STATUS_OCCUPIED, LPGEN("Occupied"), -IDI_OCCUPIED, PF2_LIGHTDND },
- { ID_STATUS_DND, LPGEN("DND"), -IDI_DND, PF2_HEAVYDND },
- { ID_STATUS_FREECHAT, LPGEN("Free for chat"), -IDI_FREE4CHAT, PF2_FREECHAT },
- { ID_STATUS_INVISIBLE, LPGEN("Invisible"), -IDI_INVISIBLE, PF2_INVISIBLE },
- { ID_STATUS_ONTHEPHONE, LPGEN("On the phone"), -IDI_ONTHEPHONE, PF2_ONTHEPHONE },
+ { ID_STATUS_OFFLINE, LPGEN("Offline"), -IDI_OFFLINE, 0xFFFFFFFF },
+ { ID_STATUS_ONLINE, LPGEN("Online"), -IDI_ONLINE, PF2_ONLINE },
+ { ID_STATUS_AWAY, LPGEN("Away"), -IDI_AWAY, PF2_SHORTAWAY },
+ { ID_STATUS_NA, LPGEN("NA"), -IDI_NA, PF2_LONGAWAY },
+ { ID_STATUS_OCCUPIED, LPGEN("Occupied"), -IDI_OCCUPIED, PF2_LIGHTDND },
+ { ID_STATUS_DND, LPGEN("DND"), -IDI_DND, PF2_HEAVYDND },
+ { ID_STATUS_FREECHAT, LPGEN("Free for chat"), -IDI_FREE4CHAT, PF2_FREECHAT },
+ { ID_STATUS_INVISIBLE, LPGEN("Invisible"), -IDI_INVISIBLE, PF2_INVISIBLE },
+ { ID_STATUS_ONTHEPHONE, LPGEN("On the phone"), -IDI_ONTHEPHONE, PF2_ONTHEPHONE },
{ ID_STATUS_OUTTOLUNCH, LPGEN("Out to lunch"), -IDI_OUTTOLUNCH, PF2_OUTTOLUNCH }
};
@@ -114,7 +114,7 @@ const char* protoIconsFmt = LPGEN("%s Icons"); static HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName)
{
int cx = GetSystemMetrics(SM_CXSMICON);
- return ( HICON )LoadImage( hInstance, lpIconName, IMAGE_ICON,cx, cx, LR_DEFAULTCOLOR | LR_SHARED );
+ return ( HICON )LoadImage( hInstance, lpIconName, IMAGE_ICON, cx, cx, LR_DEFAULTCOLOR | LR_SHARED );
}
// load small icon (not shared) it IS NEED to be destroyed
@@ -131,11 +131,11 @@ static HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName) // load small icon from hInstance
HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
{
- HICON hResIcon = bShared ? LoadSmallIcon(hInstance,lpIconName) : LoadSmallIconShared(hInstance,lpIconName);
+ HICON hResIcon = bShared ? LoadSmallIcon(hInstance, lpIconName) : LoadSmallIconShared(hInstance, lpIconName);
if ( !hResIcon ) { //Icon not found in hInstance lets try to load it from core
HINSTANCE hCoreInstance=hMirandaInst;
if ( hCoreInstance != hInstance )
- hResIcon = bShared ? LoadSmallIcon(hCoreInstance,lpIconName) : LoadSmallIconShared(hCoreInstance,lpIconName);
+ hResIcon = bShared ? LoadSmallIcon(hCoreInstance, lpIconName) : LoadSmallIconShared(hCoreInstance, lpIconName);
}
return hResIcon;
}
@@ -152,7 +152,7 @@ int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId) {
HICON hIcon = LoadSkinIcon( iconId );
int res = ImageList_AddIcon(hIml, hIcon);
- IconLib_ReleaseIcon(hIcon,0);
+ IconLib_ReleaseIcon(hIcon, 0);
return res;
}
@@ -160,7 +160,7 @@ int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char* szProto, i {
HICON hIcon = LoadSkinProtoIcon( szProto, iconId );
int res = ImageList_AddIcon(hIml, hIcon);
- IconLib_ReleaseIcon(hIcon,0);
+ IconLib_ReleaseIcon(hIcon, 0);
return res;
}
@@ -174,8 +174,8 @@ int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInst int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon)
{
- int res = ImageList_ReplaceIcon(hIml,nIndex, hIcon);
- IconLib_ReleaseIcon(hIcon,0);
+ int res = ImageList_ReplaceIcon(hIml, nIndex, hIcon);
+ IconLib_ReleaseIcon(hIcon, 0);
return res;
}
@@ -208,7 +208,7 @@ void Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, const char* too void Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId)
{
HICON hIcon = ( HICON )SendDlgItemMessage(hwndDlg, itemId, BM_SETIMAGE, IMAGE_ICON, 0 );
- IconLib_ReleaseIcon(hIcon,0);
+ IconLib_ReleaseIcon(hIcon, 0);
}
//
@@ -220,7 +220,7 @@ HICON LoadSkinProtoIcon( const char* szProto, int status, bool big ) int i, statusIndx = -1;
char iconName[MAX_PATH];
HICON hIcon;
- DWORD caps2 = ( szProto == NULL ) ? ( DWORD )-1 : CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_2,0);
+ DWORD caps2 = ( szProto == NULL ) ? ( DWORD )-1 : CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0);
if ( status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES ) {
mir_snprintf( iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, 7 );
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index b629958a0d..d9fb7fbb8e 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -53,7 +53,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM, LPARAM lParam) DBVARIANT dbv;
DWORD dwFlags = ( ssd->cbSize == sizeof(SKINSOUNDDESCEX)) ? ssd->dwFlags : 0;
- soundList=(struct SoundItem*)mir_realloc(soundList,sizeof(struct SoundItem)*(soundCount+1));
+ soundList=(struct SoundItem*)mir_realloc(soundList, sizeof(struct SoundItem)*(soundCount+1));
SoundItem* item = &soundList[soundCount++];
item->name = mir_strdup( ssd->pszName );
item->tempFile = NULL;
@@ -93,7 +93,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM, LPARAM lParam) static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
char * pszFile = (char *) lParam;
- if ( pszFile && (DBGetContactSettingByte(NULL,"Skin","UseSound",0) || (int)wParam == 1))
+ if ( pszFile && (DBGetContactSettingByte(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySoundA(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOWAIT);
return 0;
@@ -156,7 +156,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
hwndTree = GetDlgItem(hwndDlg, IDC_SOUNDTREE);
- SetWindowLongPtr(hwndTree,GWL_STYLE,GetWindowLongPtr(hwndTree,GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
+ SetWindowLongPtr(hwndTree, GWL_STYLE, GetWindowLongPtr(hwndTree, GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
SendMessage(hwndDlg, DM_REBUILD_STREE, 0, 0);
TreeView_SetItemState(hwndTree, 0, TVIS_SELECTED, TVIS_SELECTED);
@@ -188,7 +188,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TreeView_SetItem( hwndTree, &tvis.item );
}
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK(!DBGetContactSettingByte(NULL,"SkinSoundsOff",soundList[i].name,0)?2:1);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK(!DBGetContactSettingByte(NULL, "SkinSoundsOff", soundList[i].name, 0)?2:1);
tvis.item.lParam = i;
tvis.item.pszText = soundList[i].description;
TreeView_InsertItem( hwndTree, &tvis );
@@ -201,7 +201,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if ( tvi.lParam == -1 )
TreeView_SetItemState(hwndTree, tvi.hItem, INDEXTOSTATEIMAGEMASK(0), TVIS_STATEIMAGEMASK);
- tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
+ tvi.hItem=TreeView_GetNextSibling(hwndTree, tvi.hItem);
} }
ShowWindow(hwndTree, SW_SHOW);
@@ -245,8 +245,8 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TVITEM tvi;
HTREEITEM hti;
- ZeroMemory(&tvi,sizeof(tvi));
- ZeroMemory(&hti,sizeof(hti));
+ ZeroMemory(&tvi, sizeof(tvi));
+ ZeroMemory(&hti, sizeof(hti));
hti=TreeView_GetSelection(hwndTree);
if (hti == NULL) break;
tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT;
@@ -257,7 +257,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM NotifyEventHooks(hPlayEvent, 1, (LPARAM)soundList[tvi.lParam].tempFile);
else {
DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL,"SkinSounds",soundList[tvi.lParam].name,&dbv)) {
+ if (!DBGetContactSettingString(NULL, "SkinSounds", soundList[tvi.lParam].name, &dbv)) {
char szPathFull[MAX_PATH];
pathToAbsolute(dbv.pszVal, szPathFull, NULL);
@@ -272,8 +272,8 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TVITEM tvi;
HTREEITEM hti;
- ZeroMemory(&tvi,sizeof(tvi));
- ZeroMemory(&hti,sizeof(hti));
+ ZeroMemory(&tvi, sizeof(tvi));
+ ZeroMemory(&hti, sizeof(hti));
hti=TreeView_GetSelection(hwndTree);
if (hti == NULL) break;
tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT;
@@ -316,7 +316,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemTextA(hwndDlg, IDC_LOCATION, strFull);
}
if (LOWORD(wParam) == IDC_GETMORE) {
- CallService(MS_UTILS_OPENURL,1,(LPARAM)"http://addons.miranda-im.org/index.php?action=display&id=5");
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://addons.miranda-im.org/index.php?action=display&id=5");
break;
}
if (LOWORD(wParam) == IDC_LOCATION) {
@@ -334,9 +334,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DBWriteContactSettingByte(NULL, "Skin", "UseSound", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS));
for ( i=0; i < soundCount; i++ )
if ( soundList[i].tempFile )
- DBWriteContactSettingString(NULL,"SkinSounds",soundList[i].name,soundList[i].tempFile);
+ DBWriteContactSettingString(NULL, "SkinSounds", soundList[i].name, soundList[i].tempFile);
{
- TVITEM tvi,tvic;
+ TVITEM tvi, tvic;
tvi.hItem = TreeView_GetRoot(hwndTree);
while ( tvi.hItem != NULL ) {
tvi.mask = TVIF_PARAM | TVIF_HANDLE | TVIF_STATE;
@@ -350,13 +350,13 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DBCONTACTGETSETTING cgs;
cgs.szModule = "SkinSoundsOff";
cgs.szSetting = soundList[tvic.lParam].name;
- CallService(MS_DB_CONTACT_DELETESETTING,(WPARAM)(HANDLE)NULL,(LPARAM)&cgs);
+ CallService(MS_DB_CONTACT_DELETESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cgs);
}
- else DBWriteContactSettingByte(NULL,"SkinSoundsOff",soundList[tvic.lParam].name,1);
- tvic.hItem=TreeView_GetNextSibling(hwndTree,tvic.hItem);
+ else DBWriteContactSettingByte(NULL, "SkinSoundsOff", soundList[tvic.lParam].name, 1);
+ tvic.hItem=TreeView_GetNextSibling(hwndTree, tvic.hItem);
} }
- tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
+ tvi.hItem=TreeView_GetNextSibling(hwndTree, tvi.hItem);
} }
return TRUE;
}
@@ -379,7 +379,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(hwndDlg, IDC_NAMEVAL, buf);
if (soundList[tvi.lParam].tempFile)
SetDlgItemTextA(hwndDlg, IDC_LOCATION, soundList[tvi.lParam].tempFile);
- else if (!DBGetContactSettingString(NULL,"SkinSounds",soundList[tvi.lParam].name,&dbv)) {
+ else if (!DBGetContactSettingString(NULL, "SkinSounds", soundList[tvi.lParam].name, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_LOCATION, dbv.pszVal);
DBFreeVariant(&dbv);
}
@@ -401,8 +401,8 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TVHITTESTINFO hti;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
if (hti.flags&TVHT_ONITEM)
if (hti.flags&TVHT_ONITEMSTATEICON)
if (TreeView_GetParent(hwndTree, hti.hItem) != NULL)
@@ -435,7 +435,7 @@ static int SkinOptionsInit(WPARAM wParam, LPARAM) static int SkinSystemModulesLoaded(WPARAM, LPARAM)
{
- HookEvent(ME_OPT_INITIALISE,SkinOptionsInit);
+ HookEvent(ME_OPT_INITIALISE, SkinOptionsInit);
return 0;
}
@@ -445,9 +445,9 @@ int LoadSkinSounds(void) soundList=NULL;
soundCount=0;
- CreateServiceFunction(MS_SKIN_ADDNEWSOUND,ServiceSkinAddNewSound);
- CreateServiceFunction(MS_SKIN_PLAYSOUND,ServiceSkinPlaySound);
- HookEvent(ME_SYSTEM_MODULESLOADED,SkinSystemModulesLoaded);
+ CreateServiceFunction(MS_SKIN_ADDNEWSOUND, ServiceSkinAddNewSound);
+ CreateServiceFunction(MS_SKIN_PLAYSOUND, ServiceSkinPlaySound);
+ HookEvent(ME_SYSTEM_MODULESLOADED, SkinSystemModulesLoaded);
hPlayEvent=CreateHookableEvent(ME_SKIN_PLAYINGSOUND);
SetHookDefaultForHookableEvent(hPlayEvent, SkinPlaySoundDefault);
return 0;
diff --git a/src/modules/srauth/auth.cpp b/src/modules/srauth/auth.cpp index 4b0c02cca6..44fca593c4 100644 --- a/src/modules/srauth/auth.cpp +++ b/src/modules/srauth/auth.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.
@@ -30,14 +30,14 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR ShowReqWindow(WPARAM, LPARAM lParam)
{
- CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_AUTHREQ), NULL, DlgProcAuthReq,
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_AUTHREQ), NULL, DlgProcAuthReq,
(LPARAM)((CLISTEVENT *)lParam)->hDbEvent);
return 0;
}
INT_PTR ShowAddedWindow(WPARAM, LPARAM lParam)
{
- CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_ADDED), NULL, DlgProcAdded,
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_ADDED), NULL, DlgProcAdded,
(LPARAM)((CLISTEVENT *)lParam)->hDbEvent);
return 0;
}
@@ -50,7 +50,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
- CallService(MS_DB_EVENT_GET,(WPARAM)lParam,(LPARAM)&dbei);
+ CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&dbei);
if (dbei.flags & (DBEF_SENT | DBEF_READ) ||
(dbei.eventType != EVENTTYPE_AUTHREQUEST && dbei.eventType != EVENTTYPE_ADDED))
return 0;
diff --git a/src/modules/srauth/authdialogs.cpp b/src/modules/srauth/authdialogs.cpp index 367c8790ac..8d3e90a836 100644 --- a/src/modules/srauth/authdialogs.cpp +++ b/src/modules/srauth/authdialogs.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.
@@ -41,7 +41,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar //blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
- dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)hDbEvent,0);
+ dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
@@ -115,7 +115,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar HANDLE hContact = (HANDLE)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA);
if ((hContact == INVALID_HANDLE_VALUE) || !DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
- ShowWindow(GetDlgItem(hwndDlg,IDC_ADD),FALSE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE);
break;
}
case IDC_DETAILS:
@@ -141,8 +141,8 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar break;
case WM_DESTROY:
- Button_FreeIcon_IcoLib(hwndDlg,IDC_ADD);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_DETAILS);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_ADD);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_DETAILS);
DestroyIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_BIG, 0));
DestroyIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, 0));
break;
@@ -164,13 +164,13 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
DBEVENTINFO dbei = {0};
DWORD uin;
- char *nick,*first,*last,*email,*reason;
+ char *nick, *first, *last, *email, *reason;
HANDLE hContact;
hDbEvent = (HANDLE)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- //blob is: uin(DWORD),hcontact(HANDLE),nick(ASCIIZ),first(ASCIIZ),last(ASCIIZ),email(ASCIIZ),reason(ASCIIZ)
+ //blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
@@ -234,7 +234,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE);
SendDlgItemMessage(hwndDlg, IDC_DENYREASON, EM_LIMITTEXT, 255, 0);
- if (CallProtoService(dbei.szModule, PS_GETCAPS,PFLAGNUM_4, 0) & PF4_NOAUTHDENYREASON)
+ if (CallProtoService(dbei.szModule, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_NOAUTHDENYREASON)
{
EnableWindow(GetDlgItem(hwndDlg, IDC_DENYREASON), FALSE);
SetDlgItemText(hwndDlg, IDC_DENYREASON, TranslateT("Feature is not supported by protocol"));
@@ -267,7 +267,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
- CallProtoService(dbei.szModule, PS_AUTHALLOW, (WPARAM)hDbEvent,0);
+ CallProtoService(dbei.szModule, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
if (IsDlgButtonChecked(hwndDlg, IDC_ADDCHECK))
{
@@ -302,8 +302,8 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case WM_DESTROY:
- Button_FreeIcon_IcoLib(hwndDlg,IDC_ADD);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_DETAILS);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_ADD);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_DETAILS);
DestroyIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_BIG, 0));
DestroyIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, 0));
break;
diff --git a/src/modules/srawaymsg/awaymsg.cpp b/src/modules/srawaymsg/awaymsg.cpp index 2657ab5564..f1c8bbc46e 100644 --- a/src/modules/srawaymsg/awaymsg.cpp +++ b/src/modules/srawaymsg/awaymsg.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -99,8 +99,8 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP #endif
SetDlgItemTextA(hwndDlg, IDC_MSG, (const char*)ack->lParam);
- ShowWindow(GetDlgItem(hwndDlg,IDC_RETRIEVING), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_MSG), SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_RETRIEVING), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_MSG), SW_SHOW);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
break;
}
@@ -121,8 +121,8 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP case WM_DESTROY:
if (dat->hAwayMsgEvent) UnhookEvent(dat->hAwayMsgEvent);
- Utils_SaveWindowPosition(hwndDlg,dat->hContact,"SRAway","AwayMsgDlg");
- WindowList_Remove(hWindowList,hwndDlg);
+ Utils_SaveWindowPosition(hwndDlg, dat->hContact, "SRAway", "AwayMsgDlg");
+ WindowList_Remove(hWindowList, hwndDlg);
Window_FreeIcon_IcoLib(hwndDlg);
mir_free(dat);
break;
@@ -133,11 +133,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM)
{
HWND hwnd;
- if (hwnd=WindowList_Find(hWindowList,(HANDLE)wParam)) {
+ if (hwnd=WindowList_Find(hWindowList, (HANDLE)wParam)) {
SetForegroundWindow(hwnd);
SetFocus(hwnd);
}
- else CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_READAWAYMSG),NULL,ReadAwayMsgDlgProc,wParam);
+ else CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_READAWAYMSG), NULL, ReadAwayMsgDlgProc, wParam);
return 0;
}
@@ -147,15 +147,15 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM) TCHAR str[128];
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
- ZeroMemory(&clmi,sizeof(clmi));
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ ZeroMemory(&clmi, sizeof(clmi));
clmi.cbSize = sizeof(clmi);
clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;
if ( szProto != NULL ) {
int chatRoom = szProto ? DBGetContactSettingByte((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
if ( !chatRoom ) {
- int status = DBGetContactSettingWord((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE);
+ int status = DBGetContactSettingWord((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
mir_sntprintf( str, SIZEOF(str), TranslateT("Re&ad %s Message"), cli.pfnGetStatusModeDescription( status, 0 ));
clmi.ptszName = str;
if ( CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_1, 0 ) & PF1_MODEMSGRECV ) {
@@ -165,13 +165,13 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM) } } } }
CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hAwayMsgMenuItem, ( LPARAM )&clmi );
- IconLib_ReleaseIcon(clmi.hIcon,0);
+ IconLib_ReleaseIcon(clmi.hIcon, 0);
return 0;
}
static int AwayMsgPreShutdown(WPARAM, LPARAM)
{
- if (hWindowList) WindowList_BroadcastAsync(hWindowList,WM_CLOSE,0,0);
+ if (hWindowList) WindowList_BroadcastAsync(hWindowList, WM_CLOSE, 0, 0);
return 0;
}
@@ -179,16 +179,16 @@ int LoadAwayMsgModule(void) {
CLISTMENUITEM mi = { 0 };
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
- CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG,GetMessageCommand);
+ hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
mi.cbSize = sizeof(mi);
mi.position = -2000005000;
mi.flags = CMIF_NOTOFFLINE;
mi.pszName = LPGEN("Re&ad Status Message");
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
- hAwayMsgMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU,AwayMsgPreBuildMenu);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,AwayMsgPreShutdown);
+ hAwayMsgMenuItem = Menu_AddContactMenuItem(&mi);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, AwayMsgPreBuildMenu);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, AwayMsgPreShutdown);
return LoadAwayMessageSending();
}
diff --git a/src/modules/srawaymsg/sendmsg.cpp b/src/modules/srawaymsg/sendmsg.cpp index 0e5b4c5ff2..015fdce3f8 100644 --- a/src/modules/srawaymsg/sendmsg.cpp +++ b/src/modules/srawaymsg/sendmsg.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -79,7 +79,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) if (DBGetContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Ignore"), 0))
return NULL;
- if (DBGetContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(statusMode, "UsePrev"),0))
+ if (DBGetContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(statusMode, "UsePrev"), 0))
{
if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Msg"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(statusMode));
@@ -87,7 +87,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) else {
int i;
TCHAR substituteStr[128];
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(statusMode,"Default"), &dbv))
+ if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Default"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(statusMode));
for (i=0; dbv.ptszVal[i]; i++)
@@ -126,7 +126,7 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto) static WNDPROC OldMessageEditProc;
-static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
@@ -182,7 +182,7 @@ void ChangeAllProtoMessages(char *szProto, int statusMode, TCHAR *msg) }
}
else
- CallProtoService(szProto, PS_SETAWAYMSGT, statusMode,(LPARAM)msg);
+ CallProtoService(szProto, PS_SETAWAYMSGT, statusMode, (LPARAM)msg);
}
struct SetAwayMsgData
@@ -217,7 +217,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa dat->szProto = newdat->szProto;
mir_free(newdat);
SendDlgItemMessage(hwndDlg, IDC_MSG, EM_LIMITTEXT, 1024, 0);
- OldMessageEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MSG), GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc);
+ OldMessageEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc);
{
TCHAR str[256], format[128];
GetWindowText(hwndDlg, format, SIZEOF(format));
@@ -233,7 +233,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa dat->countdown = 6;
SendMessage(hwndDlg, WM_TIMER, 0, 0);
Window_SetProtoIcon_IcoLib(hwndDlg, dat->szProto, dat->statusMode);
- Utils_RestoreWindowPosition(hwndDlg,NULL,"SRAway","AwayMsgDlg");
+ Utils_RestoreWindowPosition(hwndDlg, NULL, "SRAway", "AwayMsgDlg");
SetTimer(hwndDlg, 1, 1000, 0);
dat->hPreshutdown = HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, DM_SRAWAY_SHUTDOWN);
}
@@ -294,11 +294,11 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa break;
case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg,NULL,"SRAway","AwayMsgDlg");
+ Utils_SaveWindowPosition(hwndDlg, NULL, "SRAway", "AwayMsgDlg");
KillTimer(hwndDlg, 1);
UnhookEvent(dat->hPreshutdown);
Window_FreeIcon_IcoLib(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MSG), GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)OldMessageEditProc);
mir_free(dat);
hwndStatusMsg = NULL;
break;
@@ -323,7 +323,7 @@ static int StatusModeChange(WPARAM wParam, LPARAM lParam) else
{
// If its a single protocol check the PFLAGNUM_3 for the single protocol
- if (!(CallProtoService(szProto, PS_GETCAPS,PFLAGNUM_1, 0) & PF1_MODEMSGSEND) ||
+ if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) ||
!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(statusMode)))
return 0;
}
@@ -346,7 +346,7 @@ static int StatusModeChange(WPARAM wParam, LPARAM lParam) newdat->statusMode = statusMode;
if (hwndStatusMsg)
DestroyWindow(hwndStatusMsg);
- hwndStatusMsg = CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_SETAWAYMSG),
+ hwndStatusMsg = CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_SETAWAYMSG),
NULL, SetAwayMsgDlgProc, (LPARAM)newdat);
}
return 0;
@@ -354,8 +354,8 @@ static int StatusModeChange(WPARAM wParam, LPARAM lParam) static const int statusModes[] =
{
- ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND,
- ID_STATUS_FREECHAT,ID_STATUS_INVISIBLE,ID_STATUS_OUTTOLUNCH,ID_STATUS_ONTHEPHONE, ID_STATUS_IDLE
+ ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND,
+ ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_OUTTOLUNCH, ID_STATUS_ONTHEPHONE, ID_STATUS_IDLE
};
struct AwayMsgInfo
@@ -377,7 +377,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam HWND hLst = GetDlgItem(hwndDlg, IDC_LST_STATUS);
- dat=(struct AwayMsgDlgData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ dat=(struct AwayMsgDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
@@ -480,7 +480,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam CheckDlgButton(hwndDlg, IDC_USEPREVIOUS, i < 0 ? 0 : dat->info[i].usePrevious);
CheckDlgButton(hwndDlg, IDC_USESPECIFIC, i < 0 ? 0 : !dat->info[i].usePrevious);
- SetDlgItemText(hwndDlg,IDC_MSG, i < 0 ? _T("") : dat->info[i].msg);
+ SetDlgItemText(hwndDlg, IDC_MSG, i < 0 ? _T("") : dat->info[i].msg);
EnableWindow(GetDlgItem(hwndDlg, IDC_NODIALOG), i < 0 ? 0 : !dat->info[i].ignore);
EnableWindow(GetDlgItem(hwndDlg, IDC_USEPREVIOUS), i < 0 ? 0 : !dat->info[i].ignore);
@@ -493,7 +493,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam case IDC_DONTREPLY:
case IDC_USEPREVIOUS:
case IDC_USESPECIFIC:
- SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_STATUS, CBN_SELCHANGE), 0);
break;
case IDC_MSG:
@@ -511,7 +511,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam {
case PSN_APPLY:
{ int i, status;
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE), 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_STATUS, CBN_SELCHANGE), 0);
i = hLst ?
(SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_GETCOUNT, 0, 0) - 1) :
(SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_GETCOUNT, 0, 0) - 1);
@@ -520,10 +520,10 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam status = hLst ?
SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_GETITEMDATA, i, 0):
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_GETITEMDATA, i, 0);
- DBWriteContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(status,"Ignore"), (BYTE)dat->info[i].ignore);
- DBWriteContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(status,"NoDlg"), (BYTE)dat->info[i].noDialog);
- DBWriteContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(status,"UsePrev"),(BYTE)dat->info[i].usePrevious);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(status,"Default"), dat->info[i].msg);
+ DBWriteContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(status, "Ignore"), (BYTE)dat->info[i].ignore);
+ DBWriteContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), (BYTE)dat->info[i].noDialog);
+ DBWriteContactSettingByte(NULL, "SRAway", StatusModeToDbSetting(status, "UsePrev"), (BYTE)dat->info[i].usePrevious);
+ DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
}
return TRUE;
}
@@ -564,7 +564,7 @@ static int AwayMsgSendModernOptInit(WPARAM wParam, LPARAM) static const int iBoldControls[] =
{
- IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
+ IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3,
MODERNOPT_CTRL_LAST
};
@@ -624,7 +624,7 @@ static INT_PTR sttGetAwayMessage(WPARAM wParam, LPARAM lParam) int LoadAwayMessageSending(void)
{
- HookEvent(ME_SYSTEM_MODULESLOADED,AwayMsgSendModulesLoaded);
+ HookEvent(ME_SYSTEM_MODULESLOADED, AwayMsgSendModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, AwayMsgSendAccountsChanged);
#ifdef UNICODE
diff --git a/src/modules/sremail/email.cpp b/src/modules/sremail/email.cpp index 38a1e0eb11..db8893b570 100644 --- a/src/modules/sremail/email.cpp +++ b/src/modules/sremail/email.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -26,29 +26,29 @@ static HANDLE hEMailMenuItem; void SendEmailThread(void *szUrl)
{
- ShellExecuteA(NULL,"open",( char* )szUrl,"","",SW_SHOW);
+ ShellExecuteA(NULL, "open", ( char* )szUrl, "", "", SW_SHOW);
mir_free(szUrl);
return;
}
-static INT_PTR SendEMailCommand(WPARAM wParam,LPARAM lParam)
+static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
char *szUrl;
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
- if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam,szProto,"e-mail",&dbv)) {
- if (DBGetContactSettingString((HANDLE)wParam,"UserInfo","Mye-mail0",&dbv)) {
- MessageBox((HWND)lParam,TranslateT("User has not registered an e-mail address"),TranslateT("Send e-mail"),MB_OK);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", &dbv)) {
+ if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) {
+ MessageBox((HWND)lParam, TranslateT("User has not registered an e-mail address"), TranslateT("Send e-mail"), MB_OK);
return 1;
}
}
szUrl=(char*)mir_alloc(lstrlenA(dbv.pszVal)+8);
- lstrcpyA(szUrl,"mailto:");
- lstrcatA(szUrl,dbv.pszVal);
+ lstrcpyA(szUrl, "mailto:");
+ lstrcatA(szUrl, dbv.pszVal);
mir_free(dbv.pszVal);
- forkthread(SendEmailThread,0,szUrl);
+ forkthread(SendEmailThread, 0, szUrl);
return 0;
}
@@ -58,12 +58,12 @@ static int EMailPreBuildMenu(WPARAM wParam, LPARAM) DBVARIANT dbv = { 0 };
char *szProto;
- ZeroMemory(&mi,sizeof(mi));
+ ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.flags = CMIM_FLAGS;
szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
- if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail",& dbv))
+ if (szProto == NULL || DBGetContactSettingString((HANDLE)wParam, szProto, "e-mail", & dbv))
if (DBGetContactSettingString((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
@@ -81,7 +81,7 @@ int LoadSendRecvEMailModule(void) mi.icolibItem = GetSkinIconHandle( SKINICON_OTHER_SENDEMAIL );
mi.pszName = LPGEN("&E-mail");
mi.pszService = MS_EMAIL_SENDEMAIL;
- hEMailMenuItem = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi);
+ hEMailMenuItem = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(MS_EMAIL_SENDEMAIL, SendEMailCommand);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, EMailPreBuildMenu);
diff --git a/src/modules/srfile/file.cpp b/src/modules/srfile/file.cpp index 6073dd7a8a..3a39014162 100644 --- a/src/modules/srfile/file.cpp +++ b/src/modules/srfile/file.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -33,11 +33,11 @@ static INT_PTR SendFileCommand(WPARAM wParam, LPARAM) struct FileSendData fsd;
fsd.hContact=(HANDLE)wParam;
fsd.ppFiles=NULL;
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILESEND),NULL,DlgProcSendFile,(LPARAM)&fsd);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
return 0;
}
-static INT_PTR SendSpecificFiles(WPARAM wParam,LPARAM lParam)
+static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam)
{
FileSendData fsd;
fsd.hContact=(HANDLE)wParam;
@@ -54,7 +54,7 @@ static INT_PTR SendSpecificFiles(WPARAM wParam,LPARAM lParam) #else
fsd.ppFiles=(const char**)lParam;
#endif
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILESEND),NULL,DlgProcSendFile,(LPARAM)&fsd);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
#if defined( _UNICODE )
for ( int j=0; j < count; j++ )
mir_free(( void* )fsd.ppFiles[j] );
@@ -62,28 +62,28 @@ static INT_PTR SendSpecificFiles(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR SendSpecificFilesT(WPARAM wParam,LPARAM lParam)
+static INT_PTR SendSpecificFilesT(WPARAM wParam, LPARAM lParam)
{
FileSendData fsd;
fsd.hContact=(HANDLE)wParam;
fsd.ppFiles=(const TCHAR**)lParam;
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILESEND),NULL,DlgProcSendFile,(LPARAM)&fsd);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
return 0;
}
-static INT_PTR GetReceivedFilesFolder(WPARAM wParam,LPARAM lParam)
+static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam)
{
TCHAR buf[MAX_PATH];
- GetContactReceivedFilesDir((HANDLE)wParam,buf,MAX_PATH,TRUE);
+ GetContactReceivedFilesDir((HANDLE)wParam, buf, MAX_PATH, TRUE);
char* dir = mir_t2a(buf);
- lstrcpynA((char*)lParam,dir,MAX_PATH);
+ lstrcpynA((char*)lParam, dir, MAX_PATH);
mir_free(dir);
return 0;
}
static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam)
{
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILERECV),NULL,DlgProcRecvFile,lParam);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_FILERECV), NULL, DlgProcRecvFile, lParam);
return 0;
}
@@ -94,23 +94,23 @@ void PushFileEvent( HANDLE hContact, HANDLE hdbe, LPARAM lParam ) cle.hContact = hContact;
cle.hDbEvent = hdbe;
cle.lParam = lParam;
- if ( DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) && !DBGetContactSettingByte(hContact,"CList","NotOnList",0)) {
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILERECV),NULL,DlgProcRecvFile,(LPARAM)&cle);
+ if ( DBGetContactSettingByte(NULL, "SRFile", "AutoAccept", 0) && !DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)) {
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_FILERECV), NULL, DlgProcRecvFile, (LPARAM)&cle);
}
else {
SkinPlaySound("RecvFile");
TCHAR szTooltip[256];
- mir_sntprintf(szTooltip,SIZEOF(szTooltip),TranslateT("File from %s"), cli.pfnGetContactDisplayName( hContact, 0 ));
+ mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("File from %s"), cli.pfnGetContactDisplayName( hContact, 0 ));
cle.ptszTooltip = szTooltip;
cle.flags |= CLEF_TCHAR;
cle.hIcon = LoadSkinIcon( SKINICON_EVENT_FILE );
cle.pszService = "SRFile/RecvFile";
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
} }
-static int FileEventAdded(WPARAM wParam,LPARAM lParam)
+static int FileEventAdded(WPARAM wParam, LPARAM lParam)
{
DWORD dwSignature;
@@ -126,15 +126,15 @@ static int FileEventAdded(WPARAM wParam,LPARAM lParam) return 0;
}
-int SRFile_GetRegValue(HKEY hKeyBase,const TCHAR *szSubKey,const TCHAR *szValue,TCHAR *szOutput,int cbOutput)
+int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput)
{
HKEY hKey;
DWORD cbOut=cbOutput;
- if ( RegOpenKeyEx( hKeyBase,szSubKey,0,KEY_QUERY_VALUE,&hKey ) != ERROR_SUCCESS)
+ if ( RegOpenKeyEx( hKeyBase, szSubKey, 0, KEY_QUERY_VALUE, &hKey ) != ERROR_SUCCESS)
return 0;
- if ( RegQueryValueEx( hKey,szValue,NULL,NULL,(PBYTE)szOutput, &cbOut ) != ERROR_SUCCESS ) {
+ if ( RegQueryValueEx( hKey, szValue, NULL, NULL, (PBYTE)szOutput, &cbOut ) != ERROR_SUCCESS ) {
RegCloseKey(hKey);
return 0;
}
@@ -143,7 +143,7 @@ int SRFile_GetRegValue(HKEY hKeyBase,const TCHAR *szSubKey,const TCHAR *szValue, return 1;
}
-void GetSensiblyFormattedSize(__int64 size,TCHAR *szOut,int cchOut,int unitsOverride,int appendUnits,int *unitsUsed)
+void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed)
{
if (!unitsOverride) {
if (size<1000) unitsOverride=UNITS_BYTES;
@@ -154,11 +154,11 @@ void GetSensiblyFormattedSize(__int64 size,TCHAR *szOut,int cchOut,int unitsOver }
if (unitsUsed) *unitsUsed=unitsOverride;
switch(unitsOverride) {
- case UNITS_BYTES: mir_sntprintf(szOut,cchOut,_T("%u%s%s"),(int)size,appendUnits?_T(" "):_T(""),appendUnits?TranslateT("bytes"):_T("")); break;
- case UNITS_KBPOINT1: mir_sntprintf(szOut,cchOut,_T("%.1lf%s"),size/1024.0,appendUnits?_T(" KB"):_T("")); break;
- case UNITS_KBPOINT0: mir_sntprintf(szOut,cchOut,_T("%u%s"),(int)(size/1024),appendUnits?_T(" KB"):_T("")); break;
- case UNITS_GBPOINT3: mir_sntprintf(szOut,cchOut,_T("%.3f%s"),(size >> 20)/1024.0,appendUnits?_T(" GB"):_T("")); break;
- default: mir_sntprintf(szOut,cchOut,_T("%.2lf%s"),size/1048576.0,appendUnits?_T(" MB"):_T("")); break;
+ case UNITS_BYTES: mir_sntprintf(szOut, cchOut, _T("%u%s%s"), (int)size, appendUnits?_T(" "):_T(""), appendUnits?TranslateT("bytes"):_T("")); break;
+ case UNITS_KBPOINT1: mir_sntprintf(szOut, cchOut, _T("%.1lf%s"), size/1024.0, appendUnits?_T(" KB"):_T("")); break;
+ case UNITS_KBPOINT0: mir_sntprintf(szOut, cchOut, _T("%u%s"), (int)(size/1024), appendUnits?_T(" KB"):_T("")); break;
+ case UNITS_GBPOINT3: mir_sntprintf(szOut, cchOut, _T("%.3f%s"), (size >> 20)/1024.0, appendUnits?_T(" GB"):_T("")); break;
+ default: mir_sntprintf(szOut, cchOut, _T("%.2lf%s"), size/1048576.0, appendUnits?_T(" MB"):_T("")); break;
}
}
@@ -263,20 +263,20 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void)
{
DBEVENTINFO dbei={0};
- HANDLE hDbEvent,hContact;
+ HANDLE hDbEvent, hContact;
dbei.cbSize=sizeof(dbei);
- 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_FILE)
- CallService(MS_DB_EVENT_MARKREAD,(WPARAM)hContact,(LPARAM)hDbEvent);
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
+ CallService(MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDbEvent);
+ 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);
}
}
@@ -288,8 +288,8 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM) char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto != NULL) {
- if ( CallProtoService(szProto, PS_GETCAPS,PFLAGNUM_1, 0 ) & PF1_FILESEND) {
- if ( CallProtoService(szProto, PS_GETCAPS,PFLAGNUM_4, 0 ) & PF4_OFFLINEFILES )
+ if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0 ) & PF1_FILESEND) {
+ if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0 ) & PF4_OFFLINEFILES )
mi.flags = CMIM_FLAGS;
else if ( DBGetContactSettingWord(( HANDLE )wParam, szProto, "Status", ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
mi.flags = CMIM_FLAGS;
@@ -308,7 +308,7 @@ static int SRFileModulesLoaded(WPARAM, LPARAM) mi.pszName = LPGEN("&File");
mi.pszService = MS_FILE_SENDFILE;
mi.flags = CMIF_ICONFROMICOLIB;
- hSRFileMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ hSRFileMenuItem = Menu_AddContactMenuItem(&mi);
RemoveUnreadFileEvents();
return 0;
@@ -324,7 +324,7 @@ INT_PTR openContRecDir(WPARAM wparam, LPARAM) {
TCHAR szContRecDir[MAX_PATH];
HANDLE hContact = (HANDLE)wparam;
- GetContactReceivedFilesDir(hContact, szContRecDir, SIZEOF(szContRecDir),TRUE);
+ GetContactReceivedFilesDir(hContact, szContRecDir, SIZEOF(szContRecDir), TRUE);
ShellExecute(0, _T("open"), szContRecDir, 0, 0, SW_SHOW);
return 0;
}
@@ -348,21 +348,21 @@ int LoadSendRecvFileModule(void) mi.position = 1900000000;
mi.pszName = LPGEN("File &Transfers...");
mi.pszService = "FtMgr/Show"; //MS_PROTO_SHOWFTMGR;
- CallService( MS_CLIST_ADDMAINMENUITEM, 0, ( LPARAM )&mi );
+ Menu_AddMainMenuItem(&mi);
- HookEvent(ME_SYSTEM_MODULESLOADED,SRFileModulesLoaded);
- HookEvent(ME_DB_EVENT_ADDED,FileEventAdded);
- HookEvent(ME_OPT_INITIALISE,FileOptInitialise);
+ HookEvent(ME_SYSTEM_MODULESLOADED, SRFileModulesLoaded);
+ HookEvent(ME_DB_EVENT_ADDED, FileEventAdded);
+ HookEvent(ME_OPT_INITIALISE, FileOptInitialise);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SRFilePreBuildMenu);
- CreateServiceFunction(MS_FILE_SENDFILE,SendFileCommand);
- CreateServiceFunction(MS_FILE_SENDSPECIFICFILES,SendSpecificFiles);
- CreateServiceFunction(MS_FILE_SENDSPECIFICFILEST,SendSpecificFilesT);
- CreateServiceFunction(MS_FILE_GETRECEIVEDFILESFOLDER,GetReceivedFilesFolder);
- CreateServiceFunction("SRFile/RecvFile",RecvFileCommand);
+ CreateServiceFunction(MS_FILE_SENDFILE, SendFileCommand);
+ CreateServiceFunction(MS_FILE_SENDSPECIFICFILES, SendSpecificFiles);
+ CreateServiceFunction(MS_FILE_SENDSPECIFICFILEST, SendSpecificFilesT);
+ CreateServiceFunction(MS_FILE_GETRECEIVEDFILESFOLDER, GetReceivedFilesFolder);
+ CreateServiceFunction("SRFile/RecvFile", RecvFileCommand);
- CreateServiceFunction("SRFile/OpenContRecDir",openContRecDir);
- CreateServiceFunction("SRFile/OpenRecDir",openRecDir);
+ CreateServiceFunction("SRFile/OpenContRecDir", openContRecDir);
+ CreateServiceFunction("SRFile/OpenRecDir", openRecDir);
SkinAddNewSoundEx("RecvFile", "File", "Incoming");
SkinAddNewSoundEx("FileDone", "File", "Complete");
diff --git a/src/modules/srfile/file.h b/src/modules/srfile/file.h index 8ee9048eb9..f4e9a63336 100644 --- a/src/modules/srfile/file.h +++ b/src/modules/srfile/file.h @@ -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.
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define VIRUSSCAN_DURINGDL 2
#define FILERESUME_ASK 0
-//1,2,3,4: resume, overwrite, rename, skip: from proto library
+//1, 2, 3, 4: resume, overwrite, rename, skip: from proto library
#define FILERESUMEF_ALL 0x80
#define FILERESUME_RESUMEALL (FILERESUME_RESUME|FILERESUMEF_ALL)
#define FILERESUME_OVERWRITEALL (FILERESUME_OVERWRITE|FILERESUMEF_ALL)
@@ -72,21 +72,21 @@ struct FileDlgData { #define UNITS_MBPOINT2 4 // 1024*1024<=size: "%.2f MB"
#define UNITS_GBPOINT3 5 // 1024*1024*1024<=size: "%.3f GB"
-void GetSensiblyFormattedSize(__int64 size,TCHAR *szOut,int cchOut,int unitsOverride,int appendUnits,int *unitsUsed);
+void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed);
void FreeFilesMatrix(TCHAR ***files); //loving that triple indirection
void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts);
-void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest,PROTOFILETRANSFERSTATUS *src);
-void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest,PROTOFILETRANSFERSTATUS *src);
-int SRFile_GetRegValue(HKEY hKeyBase,const TCHAR *szSubKey,const TCHAR *szValue,TCHAR *szOutput,int cbOutput);
+void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src);
+void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src);
+int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput);
//filesenddlg.c
INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//filerecv.c
INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void RemoveInvalidFilenameChars(TCHAR *tszString);
void RemoveInvalidPathChars(TCHAR *tszString);
-void GetContactReceivedFilesDir(HANDLE hContact,TCHAR *szDir,int cchDir,BOOL substVars);
-void GetReceivedFilesDir(TCHAR *szDir,int cchDir);
-int BrowseForFolder(HWND hwnd,TCHAR *szPath);
+void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL substVars);
+void GetReceivedFilesDir(TCHAR *szDir, int cchDir);
+int BrowseForFolder(HWND hwnd, TCHAR *szPath);
//fileexistsdlg.c
struct TDlgProcFileExistsParam
{
@@ -97,7 +97,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //filexferdlg.c
INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//fileopts.c
-int FileOptInitialise(WPARAM wParam,LPARAM lParam);
+int FileOptInitialise(WPARAM wParam, LPARAM lParam);
//ftmanager.c
#define WM_FT_ADD (WM_USER+701)
#define WM_FT_RESIZE (WM_USER+702)
diff --git a/src/modules/srfile/fileexistsdlg.cpp b/src/modules/srfile/fileexistsdlg.cpp index 23bc8b0877..a6b5dfd3c2 100644 --- a/src/modules/srfile/fileexistsdlg.cpp +++ b/src/modules/srfile/fileexistsdlg.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.
@@ -31,16 +31,16 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime) LARGE_INTEGER liFiletime;
FILETIME filetime;
SYSTEMTIME st;
- char szTime[64],szDate[64],szOutput[128];
+ char szTime[64], szDate[64], szOutput[128];
liFiletime.QuadPart=(BIGI(11644473600)+(__int64)unixTime)*10000000;
filetime.dwHighDateTime=liFiletime.HighPart;
filetime.dwLowDateTime=liFiletime.LowPart;
- FileTimeToSystemTime(&filetime,&st);
- GetTimeFormatA(LOCALE_USER_DEFAULT,0,&st,NULL,szTime,SIZEOF(szTime));
- GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&st,NULL,szDate,SIZEOF(szDate));
- mir_snprintf(szOutput, SIZEOF(szOutput), "%s %s",szDate,szTime);
- SetDlgItemTextA(hwndDlg,idCtrl,szOutput);
+ FileTimeToSystemTime(&filetime, &st);
+ GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, szTime, SIZEOF(szTime));
+ GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szDate, SIZEOF(szDate));
+ mir_snprintf(szOutput, SIZEOF(szOutput), "%s %s", szDate, szTime);
+ SetDlgItemTextA(hwndDlg, idCtrl, szOutput);
}
#define C_CONTEXTMENU 0
@@ -49,7 +49,7 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime) #ifndef CMF_EXTENDEDVERBS
#define CMF_EXTENDEDVERBS 0x00000100
#endif
-static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POINT *ptCursor)
+static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd, POINT *ptCursor)
{
IShellFolder *pDesktopFolder;
if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR) {
@@ -58,26 +58,26 @@ static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POI WCHAR* wszFilename = ( LPWSTR )szFilename;
#else
WCHAR wszFilename[MAX_PATH];
- MultiByteToWideChar(CP_ACP,0,szFilename,-1,wszFilename,SIZEOF(wszFilename));
+ MultiByteToWideChar(CP_ACP, 0, szFilename, -1, wszFilename, SIZEOF(wszFilename));
#endif
- if (pDesktopFolder->ParseDisplayName(NULL,NULL,wszFilename,NULL,&pCurrentIdl,NULL) == NOERROR) {
+ if (pDesktopFolder->ParseDisplayName(NULL, NULL, wszFilename, NULL, &pCurrentIdl, NULL) == NOERROR) {
if (pCurrentIdl->mkid.cb) {
- ITEMIDLIST *pidl,*pidlNext,*pidlFilename;
+ ITEMIDLIST *pidl, *pidlNext, *pidlFilename;
IShellFolder *pFileFolder;
for (pidl=pCurrentIdl;;) {
pidlNext=(ITEMIDLIST*)((PBYTE)pidl+pidl->mkid.cb);
if (pidlNext->mkid.cb == 0) {
pidlFilename = (ITEMIDLIST*)CoTaskMemAlloc(pidl->mkid.cb+sizeof(pidl->mkid.cb));
- CopyMemory(pidlFilename,pidl,pidl->mkid.cb+sizeof(pidl->mkid.cb));
+ CopyMemory(pidlFilename, pidl, pidl->mkid.cb+sizeof(pidl->mkid.cb));
pidl->mkid.cb=0;
break;
}
pidl=pidlNext;
}
- if (pDesktopFolder->BindToObject(pCurrentIdl,NULL,IID_IShellFolder,(void**)&pFileFolder) == NOERROR) {
+ if (pDesktopFolder->BindToObject(pCurrentIdl, NULL, IID_IShellFolder, (void**)&pFileFolder) == NOERROR) {
IContextMenu *pContextMenu;
- if (pFileFolder->GetUIObjectOf(NULL,1,(LPCITEMIDLIST*)&pidlFilename,IID_IContextMenu,NULL,(void**)&pContextMenu) == NOERROR) {
+ if (pFileFolder->GetUIObjectOf(NULL, 1, (LPCITEMIDLIST*)&pidlFilename, IID_IContextMenu, NULL, (void**)&pContextMenu) == NOERROR) {
switch(cmd) {
case C_PROPERTIES:
{ CMINVOKECOMMANDINFO ici={0};
@@ -91,9 +91,9 @@ static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POI case C_CONTEXTMENU:
{ HMENU hMenu;
hMenu=CreatePopupMenu();
- if (SUCCEEDED(pContextMenu->QueryContextMenu(hMenu,0,1000,65535,(GetKeyState(VK_SHIFT)&0x8000?CMF_EXTENDEDVERBS:0)|CMF_NORMAL))) {
+ if (SUCCEEDED(pContextMenu->QueryContextMenu(hMenu, 0, 1000, 65535, (GetKeyState(VK_SHIFT)&0x8000?CMF_EXTENDEDVERBS:0)|CMF_NORMAL))) {
int cmd;
- cmd=TrackPopupMenu(hMenu,TPM_RETURNCMD,ptCursor->x,ptCursor->y,0,hwnd,NULL);
+ cmd=TrackPopupMenu(hMenu, TPM_RETURNCMD, ptCursor->x, ptCursor->y, 0, hwnd, NULL);
if (cmd) {
CMINVOKECOMMANDINFO ici={0};
ici.cbSize=sizeof(ici);
@@ -122,11 +122,11 @@ static void DoAnnoyingShellCommand(HWND hwnd,const TCHAR *szFilename,int cmd,POI static WNDPROC pfnIconWindowProc;
static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- PROTOFILETRANSFERSTATUS* pft = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(GetParent(hwnd),GWLP_USERDATA);
+ PROTOFILETRANSFERSTATUS* pft = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
switch(msg) {
case WM_LBUTTONDBLCLK:
- ShellExecute(hwnd,NULL,pft->tszCurrentFile,NULL,NULL,SW_SHOW);
+ ShellExecute(hwnd, NULL, pft->tszCurrentFile, NULL, NULL, SW_SHOW);
break;
case WM_RBUTTONUP:
{ POINT pt;
@@ -136,7 +136,7 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return 0;
}
}
- return CallWindowProc(pfnIconWindowProc,hwnd,msg,wParam,lParam);
+ return CallWindowProc(pfnIconWindowProc, hwnd, msg, wParam, lParam);
}
struct loadiconsstartinfo {
@@ -148,12 +148,12 @@ void __cdecl LoadIconsAndTypesThread(void* param) loadiconsstartinfo *info = ( loadiconsstartinfo* )param;
SHFILEINFO fileInfo;
- if ( SHGetFileInfo( info->szFilename, 0, &fileInfo, sizeof(fileInfo),SHGFI_TYPENAME|SHGFI_ICON|SHGFI_LARGEICON)) {
- TCHAR *pszExtension,*pszFilename;
+ if ( SHGetFileInfo( info->szFilename, 0, &fileInfo, sizeof(fileInfo), SHGFI_TYPENAME|SHGFI_ICON|SHGFI_LARGEICON)) {
+ TCHAR *pszExtension, *pszFilename;
TCHAR szExtension[64];
TCHAR szIconFile[MAX_PATH];
- pszFilename = _tcsrchr(info->szFilename,'\\');
+ pszFilename = _tcsrchr(info->szFilename, '\\');
if ( pszFilename == NULL )
pszFilename = info->szFilename;
@@ -166,28 +166,28 @@ void __cdecl LoadIconsAndTypesThread(void* param) }
CharUpper(szExtension);
if ( fileInfo.szTypeName[0] == '\0' )
- mir_sntprintf( fileInfo.szTypeName, SIZEOF(fileInfo.szTypeName), TranslateT("%s File"),szExtension);
- SetDlgItemText(info->hwndDlg,IDC_EXISTINGTYPE,fileInfo.szTypeName);
- SetDlgItemText(info->hwndDlg,IDC_NEWTYPE,fileInfo.szTypeName);
- SendDlgItemMessage(info->hwndDlg,IDC_EXISTINGICON,STM_SETICON,(WPARAM)fileInfo.hIcon,0);
+ mir_sntprintf( fileInfo.szTypeName, SIZEOF(fileInfo.szTypeName), TranslateT("%s File"), szExtension);
+ SetDlgItemText(info->hwndDlg, IDC_EXISTINGTYPE, fileInfo.szTypeName);
+ SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName);
+ SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0);
szIconFile[0]='\0';
if ( !lstrcmp( szExtension, _T("EXE"))) {
- SRFile_GetRegValue(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"),_T("2"),szIconFile,SIZEOF(szIconFile));
+ SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("2"), szIconFile, SIZEOF(szIconFile));
}
else {
TCHAR szTypeName[MAX_PATH];
- if (SRFile_GetRegValue(HKEY_CLASSES_ROOT,pszExtension,NULL,szTypeName,SIZEOF(szTypeName))) {
- lstrcat(szTypeName,_T("\\DefaultIcon"));
- if (SRFile_GetRegValue(HKEY_CLASSES_ROOT,szTypeName,NULL,szIconFile,SIZEOF(szIconFile))) {
+ if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, SIZEOF(szTypeName))) {
+ lstrcat(szTypeName, _T("\\DefaultIcon"));
+ if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, SIZEOF(szIconFile))) {
if ( _tcsstr( szIconFile, _T("%1")))
- SRFile_GetRegValue(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"),_T("0"),szIconFile,SIZEOF(szIconFile));
+ SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, SIZEOF(szIconFile));
else szIconFile[0]='\0';
} } }
if ( szIconFile[0]) {
int iconIndex;
HICON hIcon;
- TCHAR *pszComma = _tcsrchr(szIconFile,',');
+ TCHAR *pszComma = _tcsrchr(szIconFile, ', ');
if ( pszComma == NULL )
iconIndex=0;
else {
@@ -197,7 +197,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) if ( hIcon )
fileInfo.hIcon = hIcon;
}
- SendDlgItemMessage(info->hwndDlg,IDC_NEWICON,STM_SETICON,(WPARAM)fileInfo.hIcon,0);
+ SendDlgItemMessage(info->hwndDlg, IDC_NEWICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0);
}
mir_free(info->szFilename);
mir_free(info);
@@ -207,7 +207,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
PROTOFILETRANSFERSTATUS *fts;
- fts=(PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ fts=(PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch(msg) {
case WM_INITDIALOG:
{
@@ -216,37 +216,37 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HWND hwndFocus;
struct TDlgProcFileExistsParam *dat = (struct TDlgProcFileExistsParam *)lParam;
- SetPropA(hwndDlg,"Miranda.Preshutdown",HookEventMessage(ME_SYSTEM_PRESHUTDOWN,hwndDlg,M_PRESHUTDOWN));
- SetPropA(hwndDlg,"Miranda.ParentWnd",dat->hwndParent);
+ SetPropA(hwndDlg, "Miranda.Preshutdown", HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN));
+ SetPropA(hwndDlg, "Miranda.ParentWnd", dat->hwndParent);
TranslateDialogDefault(hwndDlg);
fts=(PROTOFILETRANSFERSTATUS*)mir_alloc(sizeof(PROTOFILETRANSFERSTATUS));
- CopyProtoFileTransferStatus(fts,dat->fts);
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)fts);
- SetDlgItemText(hwndDlg,IDC_FILENAME,fts->tszCurrentFile);
- SetControlToUnixTime(hwndDlg,IDC_NEWDATE,fts->currentFileTime);
- GetSensiblyFormattedSize(fts->currentFileSize,szSize,SIZEOF(szSize),0,1,NULL);
- SetDlgItemText(hwndDlg,IDC_NEWSIZE,szSize);
+ CopyProtoFileTransferStatus(fts, dat->fts);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)fts);
+ SetDlgItemText(hwndDlg, IDC_FILENAME, fts->tszCurrentFile);
+ SetControlToUnixTime(hwndDlg, IDC_NEWDATE, fts->currentFileTime);
+ GetSensiblyFormattedSize(fts->currentFileSize, szSize, SIZEOF(szSize), 0, 1, NULL);
+ SetDlgItemText(hwndDlg, IDC_NEWSIZE, szSize);
- pfnIconWindowProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXISTINGICON),GWLP_WNDPROC,(LONG_PTR)IconCtrlSubclassProc);
+ pfnIconWindowProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc);
- hwndFocus=GetDlgItem(hwndDlg,IDC_RESUME);
- if ( _tstati64(fts->tszCurrentFile,&statbuf) == 0) {
- SetControlToUnixTime(hwndDlg,IDC_EXISTINGDATE,statbuf.st_mtime);
- GetSensiblyFormattedSize(statbuf.st_size,szSize,SIZEOF(szSize),0,1,NULL);
- SetDlgItemText(hwndDlg,IDC_EXISTINGSIZE,szSize);
+ hwndFocus=GetDlgItem(hwndDlg, IDC_RESUME);
+ if ( _tstati64(fts->tszCurrentFile, &statbuf) == 0) {
+ SetControlToUnixTime(hwndDlg, IDC_EXISTINGDATE, statbuf.st_mtime);
+ GetSensiblyFormattedSize(statbuf.st_size, szSize, SIZEOF(szSize), 0, 1, NULL);
+ SetDlgItemText(hwndDlg, IDC_EXISTINGSIZE, szSize);
if (statbuf.st_size>(int)fts->currentFileSize) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_RESUME),FALSE);
- hwndFocus=GetDlgItem(hwndDlg,IDC_OVERWRITE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RESUME), FALSE);
+ hwndFocus=GetDlgItem(hwndDlg, IDC_OVERWRITE);
} }
loadiconsstartinfo *lisi = ( loadiconsstartinfo* )mir_alloc(sizeof(loadiconsstartinfo));
lisi->hwndDlg=hwndDlg;
lisi->szFilename = mir_tstrdup(fts->tszCurrentFile);
//can be a little slow, so why not?
- forkthread(LoadIconsAndTypesThread,0,lisi);
+ forkthread(LoadIconsAndTypesThread, 0, lisi);
SetFocus(hwndFocus);
- SetWindowLongPtr(hwndFocus,GWL_STYLE,GetWindowLongPtr(hwndFocus,GWL_STYLE)|BS_DEFPUSHBUTTON);
+ SetWindowLongPtr(hwndFocus, GWL_STYLE, GetWindowLongPtr(hwndFocus, GWL_STYLE)|BS_DEFPUSHBUTTON);
return FALSE;
}
case WM_COMMAND:
@@ -264,11 +264,11 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR* pszLastBackslash = _tcsrchr( szFile, '\\' );
if ( pszLastBackslash )
*pszLastBackslash = '\0';
- ShellExecute(hwndDlg,NULL,szFile,NULL,NULL,SW_SHOW);
+ ShellExecute(hwndDlg, NULL, szFile, NULL, NULL, SW_SHOW);
return FALSE;
}
case IDC_PROPERTIES:
- DoAnnoyingShellCommand(hwndDlg,fts->tszCurrentFile,C_PROPERTIES,NULL);
+ DoAnnoyingShellCommand(hwndDlg, fts->tszCurrentFile, C_PROPERTIES, NULL);
return FALSE;
case IDC_RESUME:
pfr.action=FILERESUME_RESUME;
@@ -290,7 +290,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_SAVEAS:
{
OPENFILENAME ofn={0};
- TCHAR filter[512],*pfilter;
+ TCHAR filter[512], *pfilter;
TCHAR str[MAX_PATH];
lstrcpyn( str, fts->tszCurrentFile, SIZEOF(str));
@@ -325,27 +325,27 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
{ PROTOFILERESUME *pfrCopy;
pfrCopy=(PROTOFILERESUME*)mir_alloc(sizeof(pfr));
- CopyMemory(pfrCopy,&pfr,sizeof(pfr));
- PostMessage((HWND)GetPropA(hwndDlg,"Miranda.ParentWnd"),M_FILEEXISTSDLGREPLY,(WPARAM)mir_tstrdup(fts->tszCurrentFile),(LPARAM)pfrCopy);
+ CopyMemory(pfrCopy, &pfr, sizeof(pfr));
+ PostMessage((HWND)GetPropA(hwndDlg, "Miranda.ParentWnd"), M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfrCopy);
DestroyWindow(hwndDlg);
}
break;
}
case WM_CLOSE:
- PostMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDCANCEL,BN_CLICKED),(LPARAM)GetDlgItem(hwndDlg,IDCANCEL));
+ PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDCANCEL));
break;
case M_PRESHUTDOWN:
- PostMessage(hwndDlg,WM_CLOSE,0,0);
+ PostMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
case WM_DESTROY:
- UnhookEvent(GetPropA(hwndDlg,"Miranda.Preshutdown")); // GetProp() will return NULL if it couldnt find anything
- RemovePropA(hwndDlg,"Miranda.Preshutdown");
- RemovePropA(hwndDlg,"Miranda.ParentWnd");
- DestroyIcon((HICON)SendDlgItemMessage(hwndDlg,IDC_EXISTINGICON,STM_GETICON,0,0));
- DestroyIcon((HICON)SendDlgItemMessage(hwndDlg,IDC_NEWICON,STM_GETICON,0,0));
+ UnhookEvent(GetPropA(hwndDlg, "Miranda.Preshutdown")); // GetProp() will return NULL if it couldnt find anything
+ RemovePropA(hwndDlg, "Miranda.Preshutdown");
+ RemovePropA(hwndDlg, "Miranda.ParentWnd");
+ DestroyIcon((HICON)SendDlgItemMessage(hwndDlg, IDC_EXISTINGICON, STM_GETICON, 0, 0));
+ DestroyIcon((HICON)SendDlgItemMessage(hwndDlg, IDC_NEWICON, STM_GETICON, 0, 0));
FreeProtoFileTransferStatus(fts);
mir_free(fts);
break;
diff --git a/src/modules/srfile/fileopts.cpp b/src/modules/srfile/fileopts.cpp index ca22961ece..e0189fc56f 100644 --- a/src/modules/srfile/fileopts.cpp +++ b/src/modules/srfile/fileopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -36,16 +36,16 @@ struct virusscannerinfo { };
static const struct virusscannerinfo virusScanners[]={
- {_T("Network Associates/McAfee VirusScan"),_T("SOFTWARE\\McAfee\\VirusScan"),_T("Scan32EXE"),_T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")},
- {_T("Dr Solomon's VirusScan (Network Associates)"),_T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"),_T("szScannerExe"),_T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")},
- {_T("Norton AntiVirus"),_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"),NULL,_T("\"%s\" %%f /b- /m- /s+ /noresults")},
- {_T("Computer Associates/Inoculate IT"),_T("Software\\Antivirus"),_T("ImageFilename"),_T("\"%s\" %%f /display=progress /exit")},
- {_T("Computer Associates eTrust"),_T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"),_T("VetPath"),_T("\"%s\" %%f /display=progress /exit")},
- {_T("Kaspersky Anti-Virus"),_T("SOFTWARE\\KasperskyLab\\Components\\101"),_T("EXEName"),_T("\"%s\" /S /Q %%f")},
- {_T("Kaspersky Anti-Virus"),_T("SOFTWARE\\KasperskyLab\\SetupFolders"),_T("KAV8"),_T("\"%savp.exe\" SCAN %%f")},
- {_T("Kaspersky Anti-Virus"),_T("SOFTWARE\\KasperskyLab\\SetupFolders"),_T("KAV9"),_T("\"%savp.exe\" SCAN %%f")},
- {_T("AntiVir PersonalEdition Classic"),_T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"),_T("Path"),_T("\"%savscan.exe\" /GUIMODE=2 /PATH=\"%%f\"")},
- {_T("ESET NOD32 Antivirus"),_T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"),_T("InstallDir"),_T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action=clean \"%%f\"")},
+ {_T("Network Associates/McAfee VirusScan"), _T("SOFTWARE\\McAfee\\VirusScan"), _T("Scan32EXE"), _T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")},
+ {_T("Dr Solomon's VirusScan (Network Associates)"), _T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"), _T("szScannerExe"), _T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")},
+ {_T("Norton AntiVirus"), _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"), NULL, _T("\"%s\" %%f /b- /m- /s+ /noresults")},
+ {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display=progress /exit")},
+ {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display=progress /exit")},
+ {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\Components\\101"), _T("EXEName"), _T("\"%s\" /S /Q %%f")},
+ {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV8"), _T("\"%savp.exe\" SCAN %%f")},
+ {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV9"), _T("\"%savp.exe\" SCAN %%f")},
+ {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE=2 /PATH=\"%%f\"")},
+ {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action=clean \"%%f\"")},
};
#define M_UPDATEENABLING (WM_USER+100)
@@ -67,74 +67,74 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
TCHAR str[MAX_PATH];
- GetContactReceivedFilesDir(NULL,str,SIZEOF(str),FALSE);
- SetDlgItemText(hwndDlg,IDC_FILEDIR,str);
+ GetContactReceivedFilesDir(NULL, str, SIZEOF(str), FALSE);
+ SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
}
- CheckDlgButton(hwndDlg, IDC_AUTOACCEPT, DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOMIN, DBGetContactSettingByte(NULL,"SRFile","AutoMin",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, DBGetContactSettingByte(NULL,"SRFile","AutoClose",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLEAR, DBGetContactSettingByte(NULL,"SRFile","AutoClear",1) ? BST_CHECKED : BST_UNCHECKED);
- switch(DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE)) {
+ CheckDlgButton(hwndDlg, IDC_AUTOACCEPT, DBGetContactSettingByte(NULL, "SRFile", "AutoAccept", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOMIN, DBGetContactSettingByte(NULL, "SRFile", "AutoMin", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, DBGetContactSettingByte(NULL, "SRFile", "AutoClose", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLEAR, DBGetContactSettingByte(NULL, "SRFile", "AutoClear", 1) ? BST_CHECKED : BST_UNCHECKED);
+ switch(DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE)) {
case VIRUSSCAN_AFTERDL: CheckDlgButton(hwndDlg, IDC_SCANAFTERDL, BST_CHECKED); break;
case VIRUSSCAN_DURINGDL: CheckDlgButton(hwndDlg, IDC_SCANDURINGDL, BST_CHECKED); break;
default: CheckDlgButton(hwndDlg, IDC_NOSCANNER, BST_CHECKED); break;
}
- CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, DBGetContactSettingByte(NULL,"SRFile","WarnBeforeOpening",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, DBGetContactSettingByte(NULL, "SRFile", "WarnBeforeOpening", 1) ? BST_CHECKED : BST_UNCHECKED);
{ TCHAR szScanExe[MAX_PATH];
- int i,iItem;
+ int i, iItem;
for ( i=0; i < SIZEOF(virusScanners); i++ ) {
- if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[i].szExeRegPath,virusScanners[i].szExeRegValue,szScanExe,SIZEOF(szScanExe))) {
- iItem=SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_ADDSTRING,0,(LPARAM)virusScanners[i].szProductName);
- SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETITEMDATA,iItem,i);
+ if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[i].szExeRegPath, virusScanners[i].szExeRegValue, szScanExe, SIZEOF(szScanExe))) {
+ iItem=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName);
+ SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, i);
}
}
- if ( SendDlgItemMessageA(hwndDlg,IDC_SCANCMDLINE,CB_GETCOUNT,0,0) == 0 )
+ if ( SendDlgItemMessageA(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0) == 0 )
{
- iItem = SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_ADDSTRING,0,(LPARAM)_T("") );
- SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETITEMDATA,iItem, (LPARAM)-1);
+ iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)_T("") );
+ SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, (LPARAM)-1);
}
}
DBVARIANT dbv;
- if (DBGetContactSettingTString(NULL,"SRFile","ScanCmdLine",&dbv) == 0) {
- SetDlgItemText(hwndDlg,IDC_SCANCMDLINE,dbv.ptszVal);
+ if (DBGetContactSettingTString(NULL, "SRFile", "ScanCmdLine", &dbv) == 0) {
+ SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.ptszVal);
DBFreeVariant(&dbv);
}
else {
- if (SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCOUNT,0,0)) {
- SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETCURSEL,0,0);
- PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
+ if (SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0)) {
+ SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETCURSEL, 0, 0);
+ PostMessage(hwndDlg, M_SCANCMDLINESELCHANGE, 0, 0);
}
}
- switch(DBGetContactSettingByte(NULL,"SRFile","IfExists",FILERESUME_ASK)) {
+ switch(DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK)) {
case FILERESUME_RESUMEALL: CheckDlgButton(hwndDlg, IDC_RESUME, BST_CHECKED); break;
case FILERESUME_OVERWRITEALL: CheckDlgButton(hwndDlg, IDC_OVERWRITE, BST_CHECKED); break;
case FILERESUME_RENAMEALL: CheckDlgButton(hwndDlg, IDC_RENAME, BST_CHECKED); break;
default: CheckDlgButton(hwndDlg, IDC_ASK, BST_CHECKED); break;
}
- SendMessage(hwndDlg,M_UPDATEENABLING,0,0);
+ SendMessage(hwndDlg, M_UPDATEENABLING, 0, 0);
return TRUE;
}
case M_UPDATEENABLING:
- { int on=!IsDlgButtonChecked(hwndDlg,IDC_NOSCANNER);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ST_CMDLINE),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SCANCMDLINE),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SCANCMDLINEBROWSE),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ST_CMDLINEHELP),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOMIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOACCEPT));
+ { int on=!IsDlgButtonChecked(hwndDlg, IDC_NOSCANNER);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ST_CMDLINE), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINE), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINEBROWSE), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ST_CMDLINEHELP), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOMIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
break;
}
case M_SCANCMDLINESELCHANGE:
{ TCHAR str[512];
TCHAR szScanExe[MAX_PATH];
- int iScanner=SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCURSEL,0,0),0);
+ int iScanner=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0);
if (iScanner >= SIZEOF(virusScanners) || iScanner<0) break;
str[0]='\0';
- if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[iScanner].szExeRegPath,virusScanners[iScanner].szExeRegValue,szScanExe,SIZEOF(szScanExe)))
- mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine,szScanExe);
- SetDlgItemText(hwndDlg,IDC_SCANCMDLINE,str);
+ if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[iScanner].szExeRegPath, virusScanners[iScanner].szExeRegValue, szScanExe, SIZEOF(szScanExe)))
+ mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine, szScanExe);
+ SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str);
break;
}
case WM_COMMAND:
@@ -144,19 +144,19 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case IDC_FILEDIRBROWSE:
{ TCHAR str[MAX_PATH];
- GetDlgItemText(hwndDlg,IDC_FILEDIR,str,SIZEOF(str));
- if (BrowseForFolder(hwndDlg,str))
- SetDlgItemText(hwndDlg,IDC_FILEDIR,str);
+ GetDlgItemText(hwndDlg, IDC_FILEDIR, str, SIZEOF(str));
+ if (BrowseForFolder(hwndDlg, str))
+ SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
break;
}
case IDC_AUTOACCEPT:
case IDC_NOSCANNER:
case IDC_SCANAFTERDL:
case IDC_SCANDURINGDL:
- SendMessage(hwndDlg,M_UPDATEENABLING,0,0);
+ SendMessage(hwndDlg, M_UPDATEENABLING, 0, 0);
break;
case IDC_SCANCMDLINE:
- if (HIWORD(wParam) == CBN_SELCHANGE) PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
+ if (HIWORD(wParam) == CBN_SELCHANGE) PostMessage(hwndDlg, M_SCANCMDLINESELCHANGE, 0, 0);
else if (HIWORD(wParam) != CBN_EDITCHANGE) return 0;
break;
case IDC_SCANCMDLINEBROWSE:
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
- _tcscpy(filter,TranslateT("Executable Files"));
+ _tcscpy(filter, TranslateT("Executable Files"));
_tcscat(filter, _T(" (*.exe)"));
pfilter = filter + _tcslen(filter) + 1;
_tcscpy(pfilter, _T("*.exe"));
@@ -211,16 +211,16 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L { TCHAR str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, SIZEOF(str));
RemoveInvalidPathChars(str);
- DBWriteContactSettingTString(NULL,"SRFile","RecvFilesDirAdv",str);
- DBWriteContactSettingByte(NULL,"SRFile","AutoAccept",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOACCEPT));
- DBWriteContactSettingByte(NULL,"SRFile","AutoMin",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOMIN));
- DBWriteContactSettingByte(NULL,"SRFile","AutoClose",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOCLOSE));
- DBWriteContactSettingByte(NULL,"SRFile","AutoClear",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOCLEAR));
- DBWriteContactSettingByte(NULL,"SRFile","UseScanner",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_SCANAFTERDL)?VIRUSSCAN_AFTERDL:(IsDlgButtonChecked(hwndDlg,IDC_SCANDURINGDL)?VIRUSSCAN_DURINGDL:VIRUSSCAN_DISABLE)));
+ DBWriteContactSettingTString(NULL, "SRFile", "RecvFilesDirAdv", str);
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoAccept", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoMin", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoClear", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAR));
+ DBWriteContactSettingByte(NULL, "SRFile", "UseScanner", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCANAFTERDL)?VIRUSSCAN_AFTERDL:(IsDlgButtonChecked(hwndDlg, IDC_SCANDURINGDL)?VIRUSSCAN_DURINGDL:VIRUSSCAN_DISABLE)));
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, SIZEOF(str));
- DBWriteContactSettingTString(NULL,"SRFile","ScanCmdLine",str);
- DBWriteContactSettingByte(NULL,"SRFile","WarnBeforeOpening",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_WARNBEFOREOPENING));
- DBWriteContactSettingByte(NULL,"SRFile","IfExists",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_ASK)?FILERESUME_ASK:(IsDlgButtonChecked(hwndDlg,IDC_RESUME)?FILERESUME_RESUMEALL:(IsDlgButtonChecked(hwndDlg,IDC_OVERWRITE)?FILERESUME_OVERWRITEALL:FILERESUME_RENAMEALL))));
+ DBWriteContactSettingTString(NULL, "SRFile", "ScanCmdLine", str);
+ DBWriteContactSettingByte(NULL, "SRFile", "WarnBeforeOpening", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WARNBEFOREOPENING));
+ DBWriteContactSettingByte(NULL, "SRFile", "IfExists", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ASK)?FILERESUME_ASK:(IsDlgButtonChecked(hwndDlg, IDC_RESUME)?FILERESUME_RESUMEALL:(IsDlgButtonChecked(hwndDlg, IDC_OVERWRITE)?FILERESUME_OVERWRITEALL:FILERESUME_RENAMEALL))));
return TRUE;
}
}
diff --git a/src/modules/srfile/filerecvdlg.cpp b/src/modules/srfile/filerecvdlg.cpp index 4de076e0fe..35ed892544 100644 --- a/src/modules/srfile/filerecvdlg.cpp +++ b/src/modules/srfile/filerecvdlg.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -27,22 +27,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static BOOL CALLBACK ClipSiblingsChildEnumProc(HWND hwnd, LPARAM)
{
- SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)|WS_CLIPSIBLINGS);
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE)|WS_CLIPSIBLINGS);
return TRUE;
}
-static void GetLowestExistingDirName(const TCHAR *szTestDir,TCHAR *szExistingDir,int cchExistingDir)
+static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDir, int cchExistingDir)
{
DWORD dwAttributes;
TCHAR *pszLastBackslash;
- lstrcpyn(szExistingDir,szTestDir,cchExistingDir);
+ lstrcpyn(szExistingDir, szTestDir, cchExistingDir);
while ((dwAttributes=GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
- pszLastBackslash=_tcsrchr(szExistingDir,'\\');
+ pszLastBackslash=_tcsrchr(szExistingDir, '\\');
if (pszLastBackslash == NULL) {*szExistingDir='\0'; break;}
*pszLastBackslash='\0';
}
- if (szExistingDir[0] == '\0') GetCurrentDirectory(cchExistingDir,szExistingDir);
+ if (szExistingDir[0] == '\0') GetCurrentDirectory(cchExistingDir, szExistingDir);
}
static const TCHAR InvalidFilenameChars[] = _T("\\/:*?\"<>|");
@@ -50,7 +50,7 @@ void RemoveInvalidFilenameChars(TCHAR *tszString) {
size_t i;
if (tszString) {
- for (i=_tcscspn(tszString,InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1,InvalidFilenameChars)+1)
+ for (i=_tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1)
if (tszString[i] >= 0)
tszString[i] = _T('_');
}
@@ -61,7 +61,7 @@ void RemoveInvalidPathChars(TCHAR *tszString) {
size_t i;
if (tszString) {
- for (i=_tcscspn(tszString,InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1,InvalidPathChars)+1)
+ for (i=_tcscspn(tszString, InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidPathChars)+1)
if (tszString[i] >= 0)
tszString[i] = _T('_');
}
@@ -75,14 +75,14 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
break;
case BFFM_SELCHANGED:
- if (SHGetPathFromIDList((LPITEMIDLIST) lp ,szDir))
- SendMessage(hwnd,BFFM_SETSTATUSTEXT,0,(LPARAM)szDir);
+ if (SHGetPathFromIDList((LPITEMIDLIST) lp , szDir))
+ SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szDir);
break;
}
return 0;
}
-int BrowseForFolder(HWND hwnd,TCHAR *szPath)
+int BrowseForFolder(HWND hwnd, TCHAR *szPath)
{
BROWSEINFO bi={0};
LPITEMIDLIST pidlResult;
@@ -96,8 +96,8 @@ int BrowseForFolder(HWND hwnd,TCHAR *szPath) pidlResult=SHBrowseForFolder(&bi);
if (pidlResult) {
- SHGetPathFromIDList(pidlResult,szPath);
- lstrcat(szPath,_T("\\"));
+ SHGetPathFromIDList(pidlResult, szPath);
+ lstrcat(szPath, _T("\\"));
CoTaskMemFree(pidlResult);
}
return pidlResult != NULL;
@@ -105,9 +105,9 @@ int BrowseForFolder(HWND hwnd,TCHAR *szPath) static REPLACEVARSARRAY sttVarsToReplace[] =
{
- { ( TCHAR* )"///", ( TCHAR* )"//" },
- { ( TCHAR* )"//", ( TCHAR* )"/" },
- { ( TCHAR* )"()", ( TCHAR* )"" },
+ { ( TCHAR* )"///", ( TCHAR* )"//" },
+ { ( TCHAR* )"//", ( TCHAR* )"/" },
+ { ( TCHAR* )"()", ( TCHAR* )"" },
{ NULL, NULL }
};
@@ -156,7 +156,7 @@ void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL rvaVarsToReplace[1].lptzKey = _T("userid");
rvaVarsToReplace[1].lptzValue = GetContactID(hContact);
rvaVarsToReplace[2].lptzKey = _T("proto");
- rvaVarsToReplace[2].lptzValue = mir_a2t((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact,0));
+ rvaVarsToReplace[2].lptzValue = mir_a2t((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
rvaVarsToReplace[3].lptzKey = NULL;
rvaVarsToReplace[3].lptzValue = NULL;
for (int i=0; i < (SIZEOF(rvaVarsToReplace)-1);i++)
@@ -208,7 +208,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l {
struct FileDlgData *dat;
- dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG: {
TCHAR *contactName;
@@ -218,13 +218,13 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwndDlg);
dat=(struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData));
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hContact = cle->hContact;
dat->hDbEvent = cle->hDbEvent;
- dat->hPreshutdownEvent = HookEventMessage(ME_SYSTEM_PRESHUTDOWN,hwndDlg,M_PRESHUTDOWN);
+ dat->hPreshutdownEvent = HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN);
dat->dwTicks = GetTickCount();
- EnumChildWindows(hwndDlg,ClipSiblingsChildEnumProc,0);
+ EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0);
Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact Permanently to List"));
@@ -233,43 +233,43 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User Menu"));
contactName = cli.pfnGetContactDisplayName( dat->hContact, 0 );
- SetDlgItemText(hwndDlg,IDC_FROM,contactName);
- GetContactReceivedFilesDir(dat->hContact,szPath,SIZEOF(szPath),TRUE);
- SetDlgItemText(hwndDlg,IDC_FILEDIR,szPath);
+ SetDlgItemText(hwndDlg, IDC_FROM, contactName);
+ GetContactReceivedFilesDir(dat->hContact, szPath, SIZEOF(szPath), TRUE);
+ SetDlgItemText(hwndDlg, IDC_FILEDIR, szPath);
{
int i;
char idstr[32];
DBVARIANT dbv;
if (shAutoComplete)
- shAutoComplete(GetWindow(GetDlgItem(hwndDlg,IDC_FILEDIR),GW_CHILD),1);
+ shAutoComplete(GetWindow(GetDlgItem(hwndDlg, IDC_FILEDIR), GW_CHILD), 1);
for (i=0;i<MAX_MRU_DIRS;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d",i);
- if (DBGetContactSettingTString(NULL,"SRFile",idstr,&dbv)) break;
- SendDlgItemMessage(hwndDlg,IDC_FILEDIR,CB_ADDSTRING,0,(LPARAM)dbv.ptszVal);
+ mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
+ if (DBGetContactSettingTString(NULL, "SRFile", idstr, &dbv)) break;
+ SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
DBFreeVariant(&dbv);
}
}
- CallService(MS_DB_EVENT_MARKREAD,(WPARAM)dat->hContact,(LPARAM)dat->hDbEvent);
+ CallService(MS_DB_EVENT_MARKREAD, (WPARAM)dat->hContact, (LPARAM)dat->hDbEvent);
{
DBEVENTINFO dbei={0};
TCHAR datetimestr[64];
char buf[540];
dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)dat->hDbEvent,0);
+ dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0);
dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
- CallService(MS_DB_EVENT_GET,(WPARAM)dat->hDbEvent,(LPARAM)&dbei);
+ CallService(MS_DB_EVENT_GET, (WPARAM)dat->hDbEvent, (LPARAM)&dbei);
dat->fs = cle->lParam ? (HANDLE)cle->lParam : (HANDLE)*(PDWORD)dbei.pBlob;
- lstrcpynA(buf, (char*)dbei.pBlob+4, min(dbei.cbBlob+1,SIZEOF(buf)));
+ lstrcpynA(buf, (char*)dbei.pBlob+4, min(dbei.cbBlob+1, SIZEOF(buf)));
TCHAR* ptszFileName = DbGetEventStringT( &dbei, buf );
- SetDlgItemText(hwndDlg,IDC_FILENAMES,ptszFileName);
+ SetDlgItemText(hwndDlg, IDC_FILENAMES, ptszFileName);
mir_free(ptszFileName);
- lstrcpynA(buf, (char*)dbei.pBlob+4+strlen((char*)dbei.pBlob+4)+1, min((int)(dbei.cbBlob-4-strlen((char*)dbei.pBlob+4)),SIZEOF(buf)));
+ lstrcpynA(buf, (char*)dbei.pBlob+4+strlen((char*)dbei.pBlob+4)+1, min((int)(dbei.cbBlob-4-strlen((char*)dbei.pBlob+4)), SIZEOF(buf)));
TCHAR* ptszDescription = DbGetEventStringT( &dbei, buf );
- SetDlgItemText(hwndDlg,IDC_MSG,ptszDescription);
+ SetDlgItemText(hwndDlg, IDC_MSG, ptszDescription);
mir_free(ptszDescription);
mir_free(dbei.pBlob);
@@ -282,13 +282,13 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CONTACTINFO ci;
int hasName = 0;
char buf[128];
- ZeroMemory(&ci,sizeof(ci));
+ ZeroMemory(&ci, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = dat->hContact;
ci.szProto = szProto;
ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
switch(ci.type) {
case CNFT_ASCIIZ:
hasName = 1;
@@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf),"%u",ci.dVal);
+ mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
break;
} }
if (hasName)
@@ -306,97 +306,97 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_NAME, contactName);
} }
- if (DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) {
- RECT rcBtn1,rcBtn2,rcDateCtrl;
- GetWindowRect(GetDlgItem(hwndDlg,IDC_ADD),&rcBtn1);
- GetWindowRect(GetDlgItem(hwndDlg,IDC_USERMENU),&rcBtn2);
- GetWindowRect(GetDlgItem(hwndDlg,IDC_DATE),&rcDateCtrl);
- SetWindowPos(GetDlgItem(hwndDlg,IDC_DATE),0,0,0,rcDateCtrl.right-rcDateCtrl.left-(rcBtn2.left-rcBtn1.left),rcDateCtrl.bottom-rcDateCtrl.top,SWP_NOZORDER|SWP_NOMOVE);
+ if (DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) {
+ RECT rcBtn1, rcBtn2, rcDateCtrl;
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_ADD), &rcBtn1);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rcBtn2);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_DATE), &rcDateCtrl);
+ SetWindowPos(GetDlgItem(hwndDlg, IDC_DATE), 0, 0, 0, rcDateCtrl.right-rcDateCtrl.left-(rcBtn2.left-rcBtn1.left), rcDateCtrl.bottom-rcDateCtrl.top, SWP_NOZORDER|SWP_NOMOVE);
}
- else if (DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0)) {
+ else if (DBGetContactSettingByte(NULL, "SRFile", "AutoAccept", 0)) {
//don't check auto-min here to fix BUG#647620
- PostMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(hwndDlg,IDOK));
+ PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDOK));
}
- if (!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0))
- ShowWindow(GetDlgItem(hwndDlg, IDC_ADD),SW_HIDE);
+ if (!DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0))
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
return TRUE;
}
case WM_MEASUREITEM:
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
{ LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
HICON hIcon;
- hIcon=(HICON)CallProtoService(szProto,PS_LOADICON,PLI_PROTOCOL|PLIF_SMALL,0);
+ hIcon=(HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
- DrawIconEx(dis->hDC,dis->rcItem.left,dis->rcItem.top,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
+ DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon(hIcon);
} } } }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
case WM_COMMAND:
- if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU), (LPARAM)dat->hContact ))
+ if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact ))
break;
switch ( LOWORD( wParam )) {
case IDC_FILEDIRBROWSE:
{
- TCHAR szDirName[MAX_PATH],szExistingDirName[MAX_PATH];
+ TCHAR szDirName[MAX_PATH], szExistingDirName[MAX_PATH];
- GetDlgItemText(hwndDlg,IDC_FILEDIR,szDirName,SIZEOF(szDirName));
- GetLowestExistingDirName(szDirName,szExistingDirName,SIZEOF(szExistingDirName));
- if (BrowseForFolder(hwndDlg,szExistingDirName))
- SetDlgItemText(hwndDlg,IDC_FILEDIR,szExistingDirName);
+ GetDlgItemText(hwndDlg, IDC_FILEDIR, szDirName, SIZEOF(szDirName));
+ GetLowestExistingDirName(szDirName, szExistingDirName, SIZEOF(szExistingDirName));
+ if (BrowseForFolder(hwndDlg, szExistingDirName))
+ SetDlgItemText(hwndDlg, IDC_FILEDIR, szExistingDirName);
}
break;
case IDOK:
{ //most recently used directories
- TCHAR szRecvDir[MAX_PATH],szDefaultRecvDir[MAX_PATH];
- GetDlgItemText(hwndDlg,IDC_FILEDIR,szRecvDir,SIZEOF(szRecvDir));
+ TCHAR szRecvDir[MAX_PATH], szDefaultRecvDir[MAX_PATH];
+ GetDlgItemText(hwndDlg, IDC_FILEDIR, szRecvDir, SIZEOF(szRecvDir));
RemoveInvalidPathChars(szRecvDir);
- GetContactReceivedFilesDir(NULL,szDefaultRecvDir,SIZEOF(szDefaultRecvDir),TRUE);
- if (_tcsnicmp(szRecvDir,szDefaultRecvDir,lstrlen(szDefaultRecvDir))) {
+ GetContactReceivedFilesDir(NULL, szDefaultRecvDir, SIZEOF(szDefaultRecvDir), TRUE);
+ if (_tcsnicmp(szRecvDir, szDefaultRecvDir, lstrlen(szDefaultRecvDir))) {
char idstr[32];
int i;
DBVARIANT dbv;
for (i=MAX_MRU_DIRS-2;i>=0;i--) {
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d",i);
- if (DBGetContactSettingTString(NULL,"SRFile",idstr,&dbv)) continue;
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d",i+1);
- DBWriteContactSettingTString(NULL,"SRFile",idstr,dbv.ptszVal);
+ mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
+ if (DBGetContactSettingTString(NULL, "SRFile", idstr, &dbv)) continue;
+ mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i+1);
+ DBWriteContactSettingTString(NULL, "SRFile", idstr, dbv.ptszVal);
DBFreeVariant(&dbv);
}
- DBWriteContactSettingTString(NULL,"SRFile",idstr,szRecvDir);
+ DBWriteContactSettingTString(NULL, "SRFile", idstr, szRecvDir);
}
}
- EnableWindow(GetDlgItem(hwndDlg,IDC_FILENAMES),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MSG),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_FILEDIR),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_FILEDIRBROWSE),FALSE);
-
- GetDlgItemText(hwndDlg,IDC_FILEDIR,dat->szSavePath,SIZEOF(dat->szSavePath));
- GetDlgItemText(hwndDlg,IDC_FILE,dat->szFilenames,SIZEOF(dat->szFilenames));
- GetDlgItemText(hwndDlg,IDC_MSG,dat->szMsg,SIZEOF(dat->szMsg));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAMES), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MSG), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILEDIR), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILEDIRBROWSE), FALSE);
+
+ GetDlgItemText(hwndDlg, IDC_FILEDIR, dat->szSavePath, SIZEOF(dat->szSavePath));
+ GetDlgItemText(hwndDlg, IDC_FILE, dat->szFilenames, SIZEOF(dat->szFilenames));
+ GetDlgItemText(hwndDlg, IDC_MSG, dat->szMsg, SIZEOF(dat->szMsg));
dat->hwndTransfer = FtMgr_AddTransfer(dat);
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, 0);
//check for auto-minimize here to fix BUG#647620
- if (DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) && DBGetContactSettingByte(NULL,"SRFile","AutoMin",0)) {
- ShowWindow(hwndDlg,SW_HIDE);
- ShowWindow(hwndDlg,SW_SHOWMINNOACTIVE);
+ if (DBGetContactSettingByte(NULL, "SRFile", "AutoAccept", 0) && DBGetContactSettingByte(NULL, "SRFile", "AutoMin", 0)) {
+ ShowWindow(hwndDlg, SW_HIDE);
+ ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
}
DestroyWindow(hwndDlg);
break;
case IDCANCEL:
- if (dat->fs) CallContactService(dat->hContact,PSS_FILEDENYT,(WPARAM)dat->fs,(LPARAM)TranslateT("Cancelled"));
+ if (dat->fs) CallContactService(dat->hContact, PSS_FILEDENYT, (WPARAM)dat->fs, (LPARAM)TranslateT("Cancelled"));
dat->fs=NULL; /* the protocol will free the handle */
DestroyWindow(hwndDlg);
break;
@@ -407,37 +407,37 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l acs.handle=dat->hContact;
acs.handleType=HANDLE_CONTACT;
acs.szProto="";
- CallService(MS_ADDCONTACT_SHOW,(WPARAM)hwndDlg,(LPARAM)&acs);
- if (!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0))
- ShowWindow(GetDlgItem(hwndDlg,IDC_ADD), SW_HIDE);
+ CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
+ if (!DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0))
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
}
break;
case IDC_USERMENU:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)dat->hContact,0);
- GetWindowRect((HWND)lParam,&rc);
- TrackPopupMenu(hMenu,0,rc.left,rc.bottom,0,hwndDlg,NULL);
+ HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ GetWindowRect((HWND)lParam, &rc);
+ TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
}
break;
case IDC_DETAILS:
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)dat->hContact,0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)dat->hContact, 0);
break;
case IDC_HISTORY:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY,(WPARAM)dat->hContact,0);
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)dat->hContact, 0);
break;
}
break;
case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_ADD);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_DETAILS);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_HISTORY);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_USERMENU);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_ADD);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_DETAILS);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_HISTORY);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_USERMENU);
if ( dat ) FreeFileDlgData( dat );
break;
diff --git a/src/modules/srfile/filesenddlg.cpp b/src/modules/srfile/filesenddlg.cpp index 8567003f91..228fc18059 100644 --- a/src/modules/srfile/filesenddlg.cpp +++ b/src/modules/srfile/filesenddlg.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -25,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <sys/stat.h>
#include "file.h"
-static void SetFileListAndSizeControls(HWND hwndDlg,struct FileDlgData *dat)
+static void SetFileListAndSizeControls(HWND hwndDlg, struct FileDlgData *dat)
{
- int fileCount=0,dirCount=0,totalSize=0,i;
+ int fileCount=0, dirCount=0, totalSize=0, i;
struct _stat statbuf;
TCHAR str[64];
@@ -40,25 +40,25 @@ static void SetFileListAndSizeControls(HWND hwndDlg,struct FileDlgData *dat) totalSize += statbuf.st_size;
} }
- GetSensiblyFormattedSize(totalSize,str,SIZEOF(str),0,1,NULL);
- SetDlgItemText(hwndDlg,IDC_TOTALSIZE,str);
+ GetSensiblyFormattedSize(totalSize, str, SIZEOF(str), 0, 1, NULL);
+ SetDlgItemText(hwndDlg, IDC_TOTALSIZE, str);
if (i>1) {
TCHAR szFormat[32];
if (fileCount && dirCount) {
- mir_sntprintf(szFormat,SIZEOF(szFormat),_T("%s, %s"),TranslateTS(fileCount == 1?_T("%d file"):_T("%d files")),TranslateTS(dirCount == 1?_T("%d directory"):_T("%d directories")));
- mir_sntprintf(str,SIZEOF(str),szFormat,fileCount,dirCount);
+ mir_sntprintf(szFormat, SIZEOF(szFormat), _T("%s, %s"), TranslateTS(fileCount == 1?_T("%d file"):_T("%d files")), TranslateTS(dirCount == 1?_T("%d directory"):_T("%d directories")));
+ mir_sntprintf(str, SIZEOF(str), szFormat, fileCount, dirCount);
}
else if (fileCount) {
- lstrcpy(szFormat,TranslateT("%d files"));
- mir_sntprintf(str,SIZEOF(str),szFormat,fileCount);
+ lstrcpy(szFormat, TranslateT("%d files"));
+ mir_sntprintf(str, SIZEOF(str), szFormat, fileCount);
}
else {
- lstrcpy(szFormat,TranslateT("%d directories"));
- mir_sntprintf(str,SIZEOF(str),szFormat,dirCount);
+ lstrcpy(szFormat, TranslateT("%d directories"));
+ mir_sntprintf(str, SIZEOF(str), szFormat, dirCount);
}
- SetDlgItemText(hwndDlg,IDC_FILE,str);
+ SetDlgItemText(hwndDlg, IDC_FILE, str);
}
- else SetDlgItemText(hwndDlg,IDC_FILE,dat->files[0]);
+ else SetDlgItemText(hwndDlg, IDC_FILE, dat->files[0]);
EnableWindow(GetDlgItem(hwndDlg, IDOK), fileCount || dirCount);
}
@@ -168,53 +168,53 @@ void __cdecl ChooseFilesThread(void* param) PostMessage( hwndDlg, M_FILECHOOSEDONE, 0, ( LPARAM )( TCHAR* )NULL );
} } }
-static BOOL CALLBACK ClipSiblingsChildEnumProc(HWND hwnd,LPARAM)
+static BOOL CALLBACK ClipSiblingsChildEnumProc(HWND hwnd, LPARAM)
{
- SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)|WS_CLIPSIBLINGS);
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE)|WS_CLIPSIBLINGS);
return TRUE;
}
static WNDPROC OldSendEditProc;
-static LRESULT CALLBACK SendEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK SendEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
case WM_CHAR:
if (wParam == '\n' && GetKeyState(VK_CONTROL)&0x8000) {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
break;
case WM_SYSCHAR:
if ((wParam == 's' || wParam == 'S') && GetKeyState(VK_MENU)&0x8000) {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
break;
}
- return CallWindowProc(OldSendEditProc,hwnd,msg,wParam,lParam);
+ return CallWindowProc(OldSendEditProc, hwnd, msg, wParam, lParam);
}
INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct FileDlgData *dat;
- dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
{
struct FileSendData *fsd=(struct FileSendData*)lParam;
dat=(struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData));
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hContact=fsd->hContact;
dat->send=1;
- dat->hPreshutdownEvent=HookEventMessage(ME_SYSTEM_PRESHUTDOWN,hwndDlg,M_PRESHUTDOWN);
+ dat->hPreshutdownEvent=HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN);
dat->fs=NULL;
dat->dwTicks=GetTickCount();
TranslateDialogDefault(hwndDlg);
- EnumChildWindows(hwndDlg,ClipSiblingsChildEnumProc,0);
- OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MSG),GWLP_WNDPROC,(LONG_PTR)SendEditSubclassProc);
+ EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0);
+ OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View User's Details"));
@@ -224,31 +224,31 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
if (fsd->ppFiles != NULL && fsd->ppFiles[0] != NULL) {
- int totalCount,i;
+ int totalCount, i;
for (totalCount=0;fsd->ppFiles[totalCount];totalCount++);
dat->files = ( TCHAR** )mir_alloc( sizeof(TCHAR*)*(totalCount+1)); // Leaks
for (i=0;i<totalCount;i++)
dat->files[i] = mir_tstrdup( fsd->ppFiles[i] );
dat->files[totalCount]=NULL;
- SetFileListAndSizeControls(hwndDlg,dat);
+ SetFileListAndSizeControls(hwndDlg, dat);
}
{
char *szProto;
TCHAR* contactName = cli.pfnGetContactDisplayName( dat->hContact, 0 );
- SetDlgItemText(hwndDlg,IDC_TO,contactName);
+ SetDlgItemText(hwndDlg, IDC_TO, contactName);
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
CONTACTINFO ci;
int hasName = 0;
char buf[128];
- ZeroMemory(&ci,sizeof(ci));
+ ZeroMemory(&ci, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = dat->hContact;
ci.szProto = szProto;
ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
switch(ci.type) {
case CNFT_ASCIIZ:
hasName = 1;
@@ -257,26 +257,26 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf),"%u",ci.dVal);
+ mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
break;
} }
if ( hasName )
- SetDlgItemTextA(hwndDlg,IDC_NAME,buf);
+ SetDlgItemTextA(hwndDlg, IDC_NAME, buf);
else
- SetDlgItemText(hwndDlg,IDC_NAME,contactName);
+ SetDlgItemText(hwndDlg, IDC_NAME, contactName);
} }
if ( fsd->ppFiles == NULL ) {
EnableWindow(hwndDlg, FALSE);
dat->closeIfFileChooseCancelled=1;
- PostMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_CHOOSE,BN_CLICKED),(LPARAM)GetDlgItem(hwndDlg,IDC_CHOOSE));
+ PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_CHOOSE, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDC_CHOOSE));
}
return TRUE;
}
case WM_MEASUREITEM:
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
{
@@ -284,14 +284,14 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
- HICON hIcon = (HICON)CallProtoService(szProto,PS_LOADICON,PLI_PROTOCOL|PLIF_SMALL,0);
+ HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
- DrawIconEx(dis->hDC,dis->rcItem.left,dis->rcItem.top,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
+ DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon(hIcon);
} } } }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
case M_FILECHOOSEDONE:
if ( lParam != 0 ) {
@@ -300,27 +300,27 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l dat->closeIfFileChooseCancelled = 0;
}
else if (dat->closeIfFileChooseCancelled) DestroyWindow(hwndDlg);
- EnableWindow(hwndDlg,TRUE);
+ EnableWindow(hwndDlg, TRUE);
break;
case WM_COMMAND:
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU),(LPARAM)dat->hContact))
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))
break;
switch (LOWORD(wParam))
{
case IDC_CHOOSE:
- EnableWindow(hwndDlg,FALSE);
+ EnableWindow(hwndDlg, FALSE);
//GetOpenFileName() creates its own message queue which prevents any incoming events being processed
- forkthread(ChooseFilesThread,0,hwndDlg);
+ forkthread(ChooseFilesThread, 0, hwndDlg);
break;
case IDOK:
- EnableWindow(GetDlgItem(hwndDlg,IDC_FILENAME),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MSG),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CHOOSE),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAME), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MSG), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSE), FALSE);
- GetDlgItemText(hwndDlg,IDC_FILEDIR,dat->szSavePath,SIZEOF(dat->szSavePath));
- GetDlgItemText(hwndDlg,IDC_FILE,dat->szFilenames,SIZEOF(dat->szFilenames));
- GetDlgItemText(hwndDlg,IDC_MSG,dat->szMsg,SIZEOF(dat->szMsg));
+ GetDlgItemText(hwndDlg, IDC_FILEDIR, dat->szSavePath, SIZEOF(dat->szSavePath));
+ GetDlgItemText(hwndDlg, IDC_FILE, dat->szFilenames, SIZEOF(dat->szFilenames));
+ GetDlgItemText(hwndDlg, IDC_MSG, dat->szMsg, SIZEOF(dat->szMsg));
dat->hwndTransfer = FtMgr_AddTransfer(dat);
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, 0);
DestroyWindow(hwndDlg);
@@ -332,31 +332,31 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_USERMENU:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)dat->hContact,0);
- GetWindowRect((HWND)lParam,&rc);
- TrackPopupMenu(hMenu,0,rc.left,rc.bottom,0,hwndDlg,NULL);
+ HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ GetWindowRect((HWND)lParam, &rc);
+ TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
break;
}
case IDC_DETAILS:
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)dat->hContact,0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)dat->hContact, 0);
return TRUE;
case IDC_HISTORY:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY,(WPARAM)dat->hContact,0);
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)dat->hContact, 0);
return TRUE;
}
break;
case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_DETAILS);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_HISTORY);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_USERMENU);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_DETAILS);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_HISTORY);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_USERMENU);
if ( dat )
FreeFileDlgData( dat );
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MSG),GWLP_WNDPROC,(LONG_PTR)OldSendEditProc);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)OldSendEditProc);
return TRUE;
}
return FALSE;
diff --git a/src/modules/srfile/filexferdlg.cpp b/src/modules/srfile/filexferdlg.cpp index 7c7adf8281..ab7090166b 100644 --- a/src/modules/srfile/filexferdlg.cpp +++ b/src/modules/srfile/filexferdlg.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2010 Miranda ICQ/IM project,
+Copyright 2000-2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -26,13 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define HM_RECVEVENT (WM_USER+10)
-static int CheckVirusScanned(HWND hwnd,struct FileDlgData *dat,int i)
+static int CheckVirusScanned(HWND hwnd, struct FileDlgData *dat, int i)
{
if (dat->send) return 1;
if (dat->fileVirusScanned == NULL) return 0;
if (dat->fileVirusScanned[i]) return 1;
- if (DBGetContactSettingByte(NULL,"SRFile","WarnBeforeOpening",1) == 0) return 1;
- return IDYES == MessageBox(hwnd,TranslateT("This file has not yet been scanned for viruses. Are you certain you want to open it?"),TranslateT("File Received"),MB_YESNO|MB_DEFBUTTON2);
+ if (DBGetContactSettingByte(NULL, "SRFile", "WarnBeforeOpening", 1) == 0) return 1;
+ return IDYES == MessageBox(hwnd, TranslateT("This file has not yet been scanned for viruses. Are you certain you want to open it?"), TranslateT("File Received"), MB_YESNO|MB_DEFBUTTON2);
}
#define M_VIRUSSCANDONE (WM_USER+100)
@@ -88,15 +88,15 @@ int PFTS_CompareWithTchar( PROTOFILETRANSFERSTATUS* ft, const PROTOCHAR* s, TCHA #endif
}
-static void SetOpenFileButtonStyle(HWND hwndButton,int enabled)
+static void SetOpenFileButtonStyle(HWND hwndButton, int enabled)
{
- EnableWindow(hwndButton,enabled);
+ EnableWindow(hwndButton, enabled);
}
void FillSendData( FileDlgData* dat, DBEVENTINFO& dbei )
{
dbei.cbSize = sizeof(dbei);
- dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_SENT;
dbei.timestamp = time(NULL);
@@ -110,8 +110,8 @@ void FillSendData( FileDlgData* dat, DBEVENTINFO& dbei ) dbei.cbBlob = sizeof(DWORD) + lstrlenA(szFileNames)+lstrlenA(szMsg)+2;
dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
*(PDWORD)dbei.pBlob=0;
- lstrcpyA((char*)dbei.pBlob+sizeof(DWORD),szFileNames);
- lstrcpyA((char*)dbei.pBlob+sizeof(DWORD)+lstrlenA(szFileNames)+1,szMsg);
+ lstrcpyA((char*)dbei.pBlob+sizeof(DWORD), szFileNames);
+ lstrcpyA((char*)dbei.pBlob+sizeof(DWORD)+lstrlenA(szFileNames)+1, szMsg);
#if defined( _UNICODE )
mir_free( szFileNames ), mir_free( szMsg );
@@ -125,7 +125,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) DBVARIANT dbv;
TCHAR szCmdLine[768];
- if (!DBGetContactSettingTString(NULL,"SRFile", "ScanCmdLine", &dbv))
+ if (!DBGetContactSettingTString(NULL, "SRFile", "ScanCmdLine", &dbv))
{
if (dbv.ptszVal[0])
{
@@ -140,9 +140,9 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) mir_sntprintf(szCmdLine, SIZEOF(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace+2);
}
else lstrcpyn(szCmdLine, dbv.ptszVal, SIZEOF(szCmdLine));
- if (CreateProcess(NULL,szCmdLine,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)) {
- if (WaitForSingleObject(pi.hProcess,3600*1000) == WAIT_OBJECT_0)
- PostMessage(info->hwndReply,M_VIRUSSCANDONE,info->returnCode,0);
+ if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+ if (WaitForSingleObject(pi.hProcess, 3600*1000) == WAIT_OBJECT_0)
+ PostMessage(info->hwndReply, M_VIRUSSCANDONE, info->returnCode, 0);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
@@ -169,8 +169,8 @@ static void SetFilenameControls(HWND hwndDlg, struct FileDlgData *dat, PROTOFILE if (dat->hIcon) DestroyIcon(dat->hIcon); dat->hIcon = NULL;
if (fn && (fts->totalFiles > 1)) {
- mir_sntprintf(msg, SIZEOF(msg), _T("%s: %s (%d %s %d)"),
- cli.pfnGetContactDisplayName( fts->hContact, 0 ),
+ mir_sntprintf(msg, SIZEOF(msg), _T("%s: %s (%d %s %d)"),
+ cli.pfnGetContactDisplayName( fts->hContact, 0 ),
fn, fts->currentFileNumber+1, TranslateT("of"), fts->totalFiles);
SHGetFileInfo(fn, FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES|SHGFI_ICON|SHGFI_SMALLICON);
@@ -198,13 +198,13 @@ static void SetFilenameControls(HWND hwndDlg, struct FileDlgData *dat, PROTOFILE enum { FTS_TEXT, FTS_PROGRESS, FTS_OPEN };
static void SetFtStatus(HWND hwndDlg, TCHAR *text, int mode)
{
- SetDlgItemText(hwndDlg,IDC_STATUS,TranslateTS(text));
- SetDlgItemText(hwndDlg,IDC_TRANSFERCOMPLETED,TranslateTS(text));
+ SetDlgItemText(hwndDlg, IDC_STATUS, TranslateTS(text));
+ SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateTS(text));
- ShowWindow(GetDlgItem(hwndDlg,IDC_STATUS), (mode == FTS_TEXT)?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_ALLFILESPROGRESS), (mode == FTS_PROGRESS)?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_TRANSFERCOMPLETED), (mode == FTS_OPEN)?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_FILEICON), (mode == FTS_OPEN)?SW_SHOW:SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STATUS), (mode == FTS_TEXT)?SW_SHOW:SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ALLFILESPROGRESS), (mode == FTS_PROGRESS)?SW_SHOW:SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_TRANSFERCOMPLETED), (mode == FTS_OPEN)?SW_SHOW:SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_FILEICON), (mode == FTS_OPEN)?SW_SHOW:SW_HIDE);
}
static void HideProgressControls(HWND hwndDlg)
@@ -262,12 +262,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TranslateDialogDefault(hwndDlg);
dat = (FileDlgData*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hNotifyEvent=HookEventMessage(ME_PROTO_ACK,hwndDlg,HM_RECVEVENT);
+ dat->hNotifyEvent=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_RECVEVENT);
dat->transferStatus.currentFileNumber = -1;
if (dat->send) {
- dat->fs=(HANDLE)CallContactService(dat->hContact,PSS_FILET,(WPARAM)dat->szMsg,(LPARAM)dat->files);
+ dat->fs=(HANDLE)CallContactService(dat->hContact, PSS_FILET, (WPARAM)dat->szMsg, (LPARAM)dat->files);
SetFtStatus(hwndDlg, LPGENT("Request sent, waiting for acceptance..."), FTS_TEXT);
- SetOpenFileButtonStyle(GetDlgItem(hwndDlg,IDC_OPENFILE),1);
+ SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1);
dat->waitingForAcceptance=1;
// hide "open" button since it may cause potential access violations...
ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFILE), SW_HIDE);
@@ -275,10 +275,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
else { //recv
CreateDirectoryTreeT(dat->szSavePath);
- dat->fs=(HANDLE)CallContactService(dat->hContact,PSS_FILEALLOWT,(WPARAM)dat->fs,(LPARAM)dat->szSavePath);
+ dat->fs=(HANDLE)CallContactService(dat->hContact, PSS_FILEALLOWT, (WPARAM)dat->fs, (LPARAM)dat->szSavePath);
dat->transferStatus.tszWorkingDir = mir_tstrdup(dat->szSavePath);
- if (DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) dat->resumeBehaviour=FILERESUME_ASK;
- else dat->resumeBehaviour=DBGetContactSettingByte(NULL,"SRFile","IfExists",FILERESUME_ASK);
+ if (DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour=FILERESUME_ASK;
+ else dat->resumeBehaviour=DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK);
SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT);
}
{
@@ -290,11 +290,11 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
{ LOGFONT lf;
HFONT hFont;
- hFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_CONTACTNAME,WM_GETFONT,0,0);
- GetObject(hFont,sizeof(lf),&lf);
+ hFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_GETFONT, 0, 0);
+ GetObject(hFont, sizeof(lf), &lf);
lf.lfWeight=FW_BOLD;
hFont=CreateFontIndirect(&lf);
- SendDlgItemMessage(hwndDlg,IDC_CONTACTNAME,WM_SETFONT,(WPARAM)hFont,0);
+ SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_SETFONT, (WPARAM)hFont, 0);
}
{ SHFILEINFO shfi = {0};
@@ -304,7 +304,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->hIcon = NULL;
- SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON,
+ SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON,
(LPARAM)LoadSkinnedProtoIcon((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0), ID_STATUS_ONLINE));
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Contact menu"), 0);
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BUTTONSETASFLATBTN, 0, 0);
@@ -320,10 +320,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetDlgItemText(hwndDlg, IDC_CONTACTNAME, cli.pfnGetContactDisplayName( dat->hContact, 0 ));
- if (!dat->waitingForAcceptance) SetTimer(hwndDlg,1,1000,NULL);
+ if (!dat->waitingForAcceptance) SetTimer(hwndDlg, 1, 1000, NULL);
return TRUE;
case WM_TIMER:
- MoveMemory(dat->bytesRecvedHistory+1,dat->bytesRecvedHistory,sizeof(dat->bytesRecvedHistory)-sizeof(dat->bytesRecvedHistory[0]));
+ MoveMemory(dat->bytesRecvedHistory+1, dat->bytesRecvedHistory, sizeof(dat->bytesRecvedHistory)-sizeof(dat->bytesRecvedHistory[0]));
dat->bytesRecvedHistory[0]=dat->transferStatus.totalProgress;
if ( dat->bytesRecvedHistorySize < SIZEOF(dat->bytesRecvedHistory))
dat->bytesRecvedHistorySize++;
@@ -333,32 +333,32 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ULARGE_INTEGER li;
FILETIME ft;
- GetSensiblyFormattedSize((dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1])/dat->bytesRecvedHistorySize,szSpeed,SIZEOF(szSpeed),0,1,NULL);
+ GetSensiblyFormattedSize((dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1])/dat->bytesRecvedHistorySize, szSpeed, SIZEOF(szSpeed), 0, 1, NULL);
if (dat->bytesRecvedHistory[0] == dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1])
- lstrcpy(szTime,_T("??:??:??"));
+ lstrcpy(szTime, _T("??:??:??"));
else {
li.QuadPart=BIGI(10000000)*(dat->transferStatus.currentFileSize-dat->transferStatus.currentFileProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]);
ft.dwHighDateTime=li.HighPart; ft.dwLowDateTime=li.LowPart;
- FileTimeToSystemTime(&ft,&st);
- GetTimeFormat(LOCALE_USER_DEFAULT,TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER,&st,NULL,szTime,SIZEOF(szTime));
+ FileTimeToSystemTime(&ft, &st);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &st, NULL, szTime, SIZEOF(szTime));
}
if (dat->bytesRecvedHistory[0] != dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]) {
li.QuadPart=BIGI(10000000)*(dat->transferStatus.totalBytes-dat->transferStatus.totalProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]);
ft.dwHighDateTime=li.HighPart; ft.dwLowDateTime=li.LowPart;
- FileTimeToSystemTime(&ft,&st);
- GetTimeFormat(LOCALE_USER_DEFAULT,TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER,&st,NULL,szTime,SIZEOF(szTime));
+ FileTimeToSystemTime(&ft, &st);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &st, NULL, szTime, SIZEOF(szTime));
}
- mir_sntprintf(szDisplay,SIZEOF(szDisplay),_T("%s/%s (%s %s)"),szSpeed,TranslateT("sec"),szTime,TranslateT("remaining"));
- SetDlgItemText(hwndDlg,IDC_ALLSPEED,szDisplay);
+ mir_sntprintf(szDisplay, SIZEOF(szDisplay), _T("%s/%s (%s %s)"), szSpeed, TranslateT("sec"), szTime, TranslateT("remaining"));
+ SetDlgItemText(hwndDlg, IDC_ALLSPEED, szDisplay);
}
break;
case WM_MEASUREITEM:
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
case WM_FT_CLEANUP:
if (!dat->fs)
@@ -369,7 +369,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break;
case WM_COMMAND:
- if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU), (LPARAM)dat->hContact ))
+ if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact ))
break;
switch (LOWORD(wParam))
@@ -382,9 +382,9 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_CONTACT:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)dat->hContact,0);
- GetWindowRect((HWND)lParam,&rc);
- TrackPopupMenu(hMenu,0,rc.left,rc.bottom,0,hwndDlg,NULL);
+ HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ GetWindowRect((HWND)lParam, &rc);
+ TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
break;
}
@@ -432,7 +432,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (files && *files)
{
int i, limit;
- TCHAR *pszFilename,*pszNewFileName;
+ TCHAR *pszFilename, *pszNewFileName;
if (dat->send)
limit = dat->transferStatus.totalFiles;
@@ -492,12 +492,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case M_FILEEXISTSDLGREPLY:
{ PROTOFILERESUME *pfr=(PROTOFILERESUME*)lParam;
TCHAR *szOriginalFilename=(TCHAR*)wParam;
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
- EnableWindow(hwndDlg,TRUE);
+ EnableWindow(hwndDlg, TRUE);
switch(pfr->action) {
case FILERESUME_CANCEL:
- if (dat->fs) CallContactService(dat->hContact,PSS_FILECANCEL,(WPARAM)dat->fs,0);
+ if (dat->fs) CallContactService(dat->hContact, PSS_FILECANCEL, (WPARAM)dat->fs, 0);
dat->fs=NULL;
mir_free(szOriginalFilename);
if (pfr->szFilename) mir_free((char*)pfr->szFilename);
@@ -510,22 +510,22 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break;
case FILERESUME_RENAMEALL:
pfr->action=FILERESUME_RENAME;
- { TCHAR *pszExtension,*pszFilename;
+ { TCHAR *pszExtension, *pszFilename;
int i;
- if ((pszFilename = _tcsrchr(szOriginalFilename,'\\')) == NULL) pszFilename=szOriginalFilename;
- if ((pszExtension = _tcsrchr(pszFilename+1,'.')) == NULL) pszExtension=pszFilename+lstrlen(pszFilename);
+ if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename=szOriginalFilename;
+ if ((pszExtension = _tcsrchr(pszFilename+1, '.')) == NULL) pszExtension=pszFilename+lstrlen(pszFilename);
if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*((pszExtension-szOriginalFilename)+21+lstrlen(pszExtension)));
for (i=1;;i++) {
- _stprintf((TCHAR*)pfr->szFilename,_T("%.*s (%u)%s"),pszExtension-szOriginalFilename,szOriginalFilename,i,pszExtension);
- if (_taccess(pfr->szFilename,0) != 0)
+ _stprintf((TCHAR*)pfr->szFilename, _T("%.*s (%u)%s"), pszExtension-szOriginalFilename, szOriginalFilename, i, pszExtension);
+ if (_taccess(pfr->szFilename, 0) != 0)
break;
}
}
break;
}
mir_free(szOriginalFilename);
- CallProtoService(szProto,PS_FILERESUMET,(WPARAM)dat->fs,(LPARAM)pfr);
+ CallProtoService(szProto, PS_FILERESUMET, (WPARAM)dat->fs, (LPARAM)pfr);
if (pfr->szFilename) mir_free((char*)pfr->szFilename);
mir_free(pfr);
break;
@@ -537,7 +537,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (ack->type != ACKTYPE_FILE) break;
if (dat->waitingForAcceptance) {
- SetTimer(hwndDlg,1,1000,NULL);
+ SetTimer(hwndDlg, 1, 1000, NULL);
dat->waitingForAcceptance=0;
}
switch(ack->result) {
@@ -549,19 +549,19 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case ACKRESULT_INITIALISING: SetFtStatus(hwndDlg, LPGENT("Initialising..."), FTS_TEXT); break;
case ACKRESULT_NEXTFILE:
SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT);
- SetDlgItemTextA(hwndDlg,IDC_FILENAME,"");
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, "");
if (dat->transferStatus.currentFileNumber == 1 && dat->transferStatus.totalFiles>1 && !dat->send)
- SetOpenFileButtonStyle(GetDlgItem(hwndDlg,IDC_OPENFILE),1);
- if (dat->transferStatus.currentFileNumber != -1 && dat->files && !dat->send && DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE) == VIRUSSCAN_DURINGDL) {
+ SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1);
+ if (dat->transferStatus.currentFileNumber != -1 && dat->files && !dat->send && DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE) == VIRUSSCAN_DURINGDL) {
if (GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY)
- PostMessage(hwndDlg,M_VIRUSSCANDONE,dat->transferStatus.currentFileNumber,0);
+ PostMessage(hwndDlg, M_VIRUSSCANDONE, dat->transferStatus.currentFileNumber, 0);
else {
virusscanthreadstartinfo *vstsi;
vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
vstsi->hwndReply = hwndDlg;
vstsi->szFile = mir_tstrdup(dat->files[dat->transferStatus.currentFileNumber]);
vstsi->returnCode = dat->transferStatus.currentFileNumber;
- forkthread((void (*)(void*))RunVirusScannerThread,0,vstsi);
+ forkthread((void (*)(void*))RunVirusScannerThread, 0, vstsi);
}
}
break;
@@ -578,24 +578,24 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetFtStatus(hwndDlg, LPGENT("File already exists"), FTS_TEXT);
if (dat->resumeBehaviour == FILERESUME_ASK) {
TDlgProcFileExistsParam param = { hwndDlg, fts };
- ShowWindow(hwndDlg,SW_SHOWNORMAL);
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_FILEEXISTS),hwndDlg,DlgProcFileExists,(LPARAM)¶m);
- EnableWindow(hwndDlg,FALSE);
+ ShowWindow(hwndDlg, SW_SHOWNORMAL);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_FILEEXISTS), hwndDlg, DlgProcFileExists, (LPARAM)¶m);
+ EnableWindow(hwndDlg, FALSE);
}
else {
PROTOFILERESUME *pfr;
pfr=(PROTOFILERESUME*)mir_alloc(sizeof(PROTOFILERESUME));
pfr->action = dat->resumeBehaviour;
pfr->szFilename = NULL;
- PostMessage(hwndDlg,M_FILEEXISTSDLGREPLY,(WPARAM)mir_tstrdup(fts->tszCurrentFile),(LPARAM)pfr);
+ PostMessage(hwndDlg, M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfr);
}
- SetWindowLongPtr(hwndDlg,DWLP_MSGRESULT,1);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, 1);
return TRUE;
}
case ACKRESULT_DATA:
{
PROTOFILETRANSFERSTATUS *fts=(PROTOFILETRANSFERSTATUS*)ack->lParam;
- TCHAR str[64], str2[64], szSizeDone[32], szSizeTotal[32];//,*contactName;
+ TCHAR str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName;
int units;
if ( dat->fileVirusScanned == NULL )
@@ -649,10 +649,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR {
HideProgressControls(hwndDlg);
- KillTimer(hwndDlg,1);
+ KillTimer(hwndDlg, 1);
if (!dat->send)
- SetOpenFileButtonStyle(GetDlgItem(hwndDlg,IDC_OPENFILE),1);
- SetDlgItemText(hwndDlg,IDCANCEL,TranslateT("Close"));
+ SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1);
+ SetDlgItemText(hwndDlg, IDCANCEL, TranslateT("Close"));
if (dat->hNotifyEvent)
UnhookEvent(dat->hNotifyEvent);
dat->hNotifyEvent=NULL;
@@ -676,19 +676,19 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR DBEVENTINFO dbei={0};
FillSendData( dat, dbei );
- CallService(MS_DB_EVENT_ADD,(WPARAM)dat->hContact,(LPARAM)&dbei);
+ CallService(MS_DB_EVENT_ADD, (WPARAM)dat->hContact, (LPARAM)&dbei);
if (dbei.pBlob)
mir_free(dbei.pBlob);
dat->files=NULL; //protocol library frees this
} else {
- SetFtStatus(hwndDlg,
+ SetFtStatus(hwndDlg,
(dat->transferStatus.totalFiles == 1) ?
LPGENT("Transfer completed, open file.") :
- LPGENT("Transfer completed, open folder."),
+ LPGENT("Transfer completed, open folder."),
FTS_OPEN);
- int useScanner=DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE);
+ int useScanner=DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE);
if (useScanner != VIRUSSCAN_DISABLE) {
struct virusscanthreadstartinfo *vstsi;
vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo));
@@ -696,7 +696,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (useScanner == VIRUSSCAN_DURINGDL) {
vstsi->returnCode=dat->transferStatus.currentFileNumber;
if ( GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY) {
- PostMessage(hwndDlg,M_VIRUSSCANDONE,vstsi->returnCode,0);
+ PostMessage(hwndDlg, M_VIRUSSCANDONE, vstsi->returnCode, 0);
mir_free(vstsi);
vstsi=NULL;
}
@@ -707,7 +707,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR vstsi->returnCode = -1;
}
SetFtStatus(hwndDlg, LPGENT("Scanning for viruses..."), FTS_TEXT);
- if (vstsi) forkthread((void (*)(void*))RunVirusScannerThread,0,vstsi);
+ if (vstsi) forkthread((void (*)(void*))RunVirusScannerThread, 0, vstsi);
} else {
dat->fs=NULL; /* protocol will free structure */
}
@@ -723,7 +723,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } // switch ack->result
} break; // case HM_RECVEVENT
case M_VIRUSSCANDONE:
- { int done=1,i;
+ { int done=1, i;
if ((int)wParam == -1) {
for (i=0;i<dat->transferStatus.totalFiles;i++) dat->fileVirusScanned[i]=1;
}
@@ -746,7 +746,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR urd.hInstance=hMirandaInst;
urd.lpTemplate=MAKEINTRESOURCEA(IDD_FILETRANSFERINFO);
urd.pfnResizer=FileTransferDlgResizer;
- CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd);
+ CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
RedrawWindow(GetDlgItem(hwndDlg, IDC_ALLTRANSFERRED), NULL, NULL, RDW_INVALIDATE|RDW_NOERASE);
RedrawWindow(GetDlgItem(hwndDlg, IDC_ALLSPEED), NULL, NULL, RDW_INVALIDATE|RDW_NOERASE);
@@ -757,7 +757,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case WM_DESTROY:
KillTimer(hwndDlg, 1);
- HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg,IDC_CONTACTNAME,WM_GETFONT,0,0);
+ HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_GETFONT, 0, 0);
DeleteObject(hFont);
Button_FreeIcon_IcoLib(hwndDlg, IDC_CONTACT);
@@ -773,7 +773,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR void FreeFileDlgData( FileDlgData* dat )
{
if (dat->fs)
- CallContactService(dat->hContact,PSS_FILECANCEL,(WPARAM)dat->fs,0);
+ CallContactService(dat->hContact, PSS_FILECANCEL, (WPARAM)dat->fs, 0);
dat->fs = NULL;
if (dat->hPreshutdownEvent) UnhookEvent(dat->hPreshutdownEvent);
diff --git a/src/modules/srfile/ftmanager.cpp b/src/modules/srfile/ftmanager.cpp index 4199c5b255..0b321ee16c 100644 --- a/src/modules/srfile/ftmanager.cpp +++ b/src/modules/srfile/ftmanager.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -179,7 +179,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA if (i == dat->wnds->realCount)
PostMessage(GetParent(hwnd), WM_TIMER, 1, NULL);
- if (dat->runningCount == 0 && (int)wParam == ACKRESULT_SUCCESS && DBGetContactSettingByte(NULL,"SRFile","AutoClose",0))
+ if (dat->runningCount == 0 && (int)wParam == ACKRESULT_SUCCESS && DBGetContactSettingByte(NULL, "SRFile", "AutoClose", 0))
ShowWindow(hwndFtMgr, SW_HIDE);
break;
}
@@ -532,7 +532,7 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HWND FtMgr_Show(bool bForceActivate, bool bFromMenu)
{
- bool bAutoMin = DBGetContactSettingByte(NULL,"SRFile","AutoMin",0) != 0; /* lqbe */
+ bool bAutoMin = DBGetContactSettingByte(NULL, "SRFile", "AutoMin", 0) != 0; /* lqbe */
bool bJustCreated = (hwndFtMgr == NULL);
if (bJustCreated)
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;
}
diff --git a/src/modules/srurl/url.h b/src/modules/srurl/url.h index 98c5566f53..4e00c38c56 100644 --- a/src/modules/srurl/url.h +++ b/src/modules/srurl/url.h @@ -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.
diff --git a/src/modules/srurl/urldialogs.cpp b/src/modules/srurl/urldialogs.cpp index 6fcef0b088..54ef22c5cc 100644 --- a/src/modules/srurl/urldialogs.cpp +++ b/src/modules/srurl/urldialogs.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.
@@ -29,23 +29,23 @@ extern HANDLE hUrlWindowList; static void sttUpdateTitle( HWND hwndDlg, HANDLE hContact )
{
- TCHAR newtitle[256],oldtitle[256];
+ TCHAR newtitle[256], oldtitle[256];
TCHAR *szStatus, *contactName, *pszNewTitleStart = TranslateT("Send URL to");
char *szProto;
if ( hContact ) {
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if ( szProto ) {
CONTACTINFO ci;
int hasName = 0;
char buf[128];
- ZeroMemory(&ci,sizeof(ci));
+ ZeroMemory(&ci, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
ci.szProto = szProto;
ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
switch(ci.type) {
case CNFT_ASCIIZ:
hasName = 1;
@@ -54,7 +54,7 @@ static void sttUpdateTitle( HWND hwndDlg, HANDLE hContact ) break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf),"%u",ci.dVal);
+ mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
break;
} }
@@ -101,22 +101,22 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR* contactName;
TCHAR msg[128];
- ZeroMemory(&dbei,sizeof(dbei));
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)dat->hDbEvent,0);
+ dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0);
dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob);
- CallService(MS_DB_EVENT_GET,(WPARAM)dat->hDbEvent,(LPARAM)&dbei);
- SetDlgItemTextA(hwndDlg,IDC_URL,(char*)dbei.pBlob);
- SetDlgItemTextA(hwndDlg,IDC_MSG,(char*)dbei.pBlob+lstrlenA((char*)dbei.pBlob)+1);
+ CallService(MS_DB_EVENT_GET, (WPARAM)dat->hDbEvent, (LPARAM)&dbei);
+ SetDlgItemTextA(hwndDlg, IDC_URL, (char*)dbei.pBlob);
+ SetDlgItemTextA(hwndDlg, IDC_MSG, (char*)dbei.pBlob+lstrlenA((char*)dbei.pBlob)+1);
mir_free(dbei.pBlob);
- CallService(MS_DB_EVENT_MARKREAD,(WPARAM)dat->hContact,(LPARAM)dat->hDbEvent);
+ CallService(MS_DB_EVENT_MARKREAD, (WPARAM)dat->hContact, (LPARAM)dat->hDbEvent);
contactName = cli.pfnGetContactDisplayName( dat->hContact, 0 );
- mir_sntprintf(msg,SIZEOF(msg),TranslateT("URL from %s"),contactName);
- SetWindowText(hwndDlg,msg);
- SetDlgItemText(hwndDlg,IDC_FROM,contactName);
- SendDlgItemMessage(hwndDlg,IDOK,BUTTONSETARROW,1,0);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("URL from %s"), contactName);
+ SetWindowText(hwndDlg, msg);
+ SetDlgItemText(hwndDlg, IDC_FROM, contactName);
+ SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETARROW, 1, 0);
{ TCHAR str[128];
tmi.printTimeStamp(NULL, dbei.timestamp, _T("t d"), str, SIZEOF(str), 0);
SetDlgItemText(hwndDlg, IDC_DATE, str);
@@ -126,14 +126,14 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (!DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
- SendMessage(hwndDlg,DM_UPDATETITLE,0,0);
+ SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0);
// From message dlg end
- Utils_RestoreWindowPositionNoSize(hwndDlg,NULL,"SRUrl","recv");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, "SRUrl", "recv");
return TRUE;
case WM_MEASUREITEM:
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
{
@@ -141,16 +141,16 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
char *szProto;
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
HICON hIcon;
- hIcon = ( HICON )CallProtoService(szProto,PS_LOADICON,PLI_PROTOCOL|PLIF_SMALL,0);
+ hIcon = ( HICON )CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
- DrawIconEx(dis->hDC,dis->rcItem.left,dis->rcItem.top,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
+ DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon( hIcon );
} } } }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
case DM_UPDATETITLE:
sttUpdateTitle( hwndDlg, dat->hContact );
@@ -158,34 +158,34 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_COMMAND:
if (dat)
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU),(LPARAM)dat->hContact))
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))
break;
switch(LOWORD(wParam)) {
case IDOK:
- { HMENU hMenu,hSubMenu;
+ { HMENU hMenu, hSubMenu;
RECT rc;
char url[256];
- hMenu=LoadMenu(hMirandaInst,MAKEINTRESOURCE(IDR_CONTEXT));
- hSubMenu=GetSubMenu(hMenu,6);
- CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)hSubMenu,0);
+ hMenu=LoadMenu(hMirandaInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ hSubMenu=GetSubMenu(hMenu, 6);
+ CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hSubMenu, 0);
GetWindowRect((HWND)lParam, &rc);
GetDlgItemTextA(hwndDlg, IDC_URL, url, SIZEOF(url));
- switch(TrackPopupMenu(hSubMenu,TPM_RETURNCMD,rc.left,rc.bottom,0,hwndDlg,NULL)) {
+ switch(TrackPopupMenu(hSubMenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL)) {
case IDM_OPENNEW:
- CallService(MS_UTILS_OPENURL,1,(LPARAM)url);
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)url);
break;
case IDM_OPENEXISTING:
- CallService(MS_UTILS_OPENURL,0,(LPARAM)url);
+ CallService(MS_UTILS_OPENURL, 0, (LPARAM)url);
break;
case IDM_COPYLINK:
{ HGLOBAL hData;
if (!OpenClipboard(hwndDlg)) break;
EmptyClipboard();
- hData=GlobalAlloc(GMEM_MOVEABLE,lstrlenA(url)+1);
- lstrcpyA((char*)GlobalLock(hData),url);
+ hData=GlobalAlloc(GMEM_MOVEABLE, lstrlenA(url)+1);
+ lstrcpyA((char*)GlobalLock(hData), url);
GlobalUnlock(hData);
- SetClipboardData(CF_TEXT,hData);
+ SetClipboardData(CF_TEXT, hData);
CloseClipboard();
break;
}
@@ -197,19 +197,19 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_USERMENU:
{
RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)dat->hContact,0);
- GetWindowRect(GetDlgItem(hwndDlg,IDC_USERMENU),&rc);
- TrackPopupMenu(hMenu,0,rc.left,rc.bottom,0,hwndDlg,NULL);
+ HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rc);
+ TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
}
break;
case IDC_HISTORY:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY,(WPARAM)dat->hContact,0);
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)dat->hContact, 0);
break;
case IDC_DETAILS:
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)dat->hContact,0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)dat->hContact, 0);
break;
case IDC_ADD:
@@ -219,15 +219,15 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP acs.handle=dat->hContact;
acs.handleType=HANDLE_CONTACT;
acs.szProto=0;
- CallService(MS_ADDCONTACT_SHOW,(WPARAM)hwndDlg,(LPARAM)&acs);
+ CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
}
- if (!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) {
- ShowWindow(GetDlgItem(hwndDlg,IDC_ADD),FALSE);
+ if (!DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE);
}
break;
case IDC_REPLY:
- CallService(MS_MSG_SENDMESSAGE,(WPARAM)dat->hContact,0);
+ CallService(MS_MSG_SENDMESSAGE, (WPARAM)dat->hContact, 0);
//fall through
case IDCANCEL:
DestroyWindow(hwndDlg);
@@ -237,24 +237,24 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_ADD);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_DETAILS);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_HISTORY);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_USERMENU);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_ADD);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_DETAILS);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_HISTORY);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_USERMENU);
WindowList_Remove(hUrlWindowList, hwndDlg);
mir_free(dat);
- Utils_SaveWindowPosition(hwndDlg,NULL,"SRUrl","recv");
+ Utils_SaveWindowPosition(hwndDlg, NULL, "SRUrl", "recv");
break;
}
return FALSE;
}
-static int ddeAcked,ddeData;
+static int ddeAcked, ddeData;
static ATOM hSzDdeData;
static HWND hwndDde;
static HGLOBAL hGlobalDdeData;
-static LRESULT DdeMessage(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT DdeMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
UINT_PTR hSzItem;
@@ -265,7 +265,7 @@ static LRESULT DdeMessage(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) break;
case WM_DDE_DATA:
- UnpackDDElParam(msg,lParam,(PUINT_PTR)&hGlobalDdeData,(PUINT_PTR)&hSzItem);
+ UnpackDDElParam(msg, lParam, (PUINT_PTR)&hGlobalDdeData, (PUINT_PTR)&hSzItem);
ddeData = 1;
if ( hGlobalDdeData ) {
DDEDATA* data = ( DDEDATA* )GlobalLock( hGlobalDdeData );
@@ -282,21 +282,21 @@ static LRESULT DdeMessage(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) return 0;
}
-static HGLOBAL DoDdeRequest(const char *szItemName,HWND hwndDlg)
+static HGLOBAL DoDdeRequest(const char *szItemName, HWND hwndDlg)
{
ATOM hSzItemName;
- DWORD timeoutTick,thisTick;
+ DWORD timeoutTick, thisTick;
MSG msg;
hSzItemName=GlobalAddAtomA(szItemName);
- if (!PostMessage(hwndDde,WM_DDE_REQUEST,(WPARAM)hwndDlg,MAKELPARAM(CF_TEXT,hSzItemName))) {
+ if (!PostMessage(hwndDde, WM_DDE_REQUEST, (WPARAM)hwndDlg, MAKELPARAM(CF_TEXT, hSzItemName))) {
GlobalDeleteAtom(hSzItemName);
return NULL;
}
timeoutTick=GetTickCount()+5000;
ddeData=0; ddeAcked=0;
do {
- if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -304,7 +304,7 @@ static HGLOBAL DoDdeRequest(const char *szItemName,HWND hwndDlg) thisTick=GetTickCount();
if (thisTick>timeoutTick) break;
}
- while (MsgWaitForMultipleObjects(0,NULL,FALSE,timeoutTick-thisTick,QS_ALLINPUT) == WAIT_OBJECT_0);
+ while (MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutTick-thisTick, QS_ALLINPUT) == WAIT_OBJECT_0);
if (!ddeData) {
GlobalDeleteAtom(hSzItemName);
@@ -325,23 +325,23 @@ static void FreeDdeRequestData(HGLOBAL hData) else GlobalUnlock(hData);
}
-static void AddBrowserPageToCombo(char *url,HWND hwndCombo)
+static void AddBrowserPageToCombo(char *url, HWND hwndCombo)
{
- char *title,*frame,*end;
+ char *title, *frame, *end;
if (url[0] != '"') return;
url++;
- title=strchr(url,'"');
+ title=strchr(url, '"');
if (title == NULL) return;
*title='\0'; title++;
if (*title) {
title+=2;
- frame=strchr(title,'"');
+ frame=strchr(title, '"');
if (frame == NULL) return;
*frame='\0'; frame++;
if (*frame) {
frame+=2;
- end=strchr(frame,'"');
+ end=strchr(frame, '"');
if (end == NULL) return;
*end='\0';
}
@@ -353,23 +353,23 @@ static void AddBrowserPageToCombo(char *url,HWND hwndCombo) int i;
char szExistingUrl[1024];
- for (i=SendMessage(hwndCombo,CB_GETCOUNT,0,0)-1;i>=0;i--) {
- if (SendMessage(hwndCombo,CB_GETLBTEXTLEN,i,0) >= SIZEOF(szExistingUrl))
+ for (i=SendMessage(hwndCombo, CB_GETCOUNT, 0, 0)-1;i>=0;i--) {
+ if (SendMessage(hwndCombo, CB_GETLBTEXTLEN, i, 0) >= SIZEOF(szExistingUrl))
continue;
- SendMessageA(hwndCombo,CB_GETLBTEXT,i,(LPARAM)szExistingUrl);
- if (!lstrcmpA(szExistingUrl,url)) return;
+ SendMessageA(hwndCombo, CB_GETLBTEXT, i, (LPARAM)szExistingUrl);
+ if (!lstrcmpA(szExistingUrl, url)) return;
}
- i=SendMessageA(hwndCombo,CB_ADDSTRING,0,(LPARAM)url);
+ i=SendMessageA(hwndCombo, CB_ADDSTRING, 0, (LPARAM)url);
szItemData=mir_strdup(title);
- SendMessage(hwndCombo,CB_SETITEMDATA,i,(LPARAM)szItemData);
+ SendMessage(hwndCombo, CB_SETITEMDATA, i, (LPARAM)szItemData);
}
}
//see Q160957 and http://developer.netscape.com/docs/manuals/communicator/DDE/index.htm
-static void GetOpenBrowserUrlsForBrowser(const char *szBrowser,HWND hwndDlg,HWND hwndCombo)
+static void GetOpenBrowserUrlsForBrowser(const char *szBrowser, HWND hwndDlg, HWND hwndCombo)
{
- ATOM hSzBrowser,hSzTopic;
- int windowCount,i;
+ ATOM hSzBrowser, hSzTopic;
+ int windowCount, i;
DWORD *windowId;
DWORD dwResult;
HGLOBAL hData;
@@ -380,31 +380,31 @@ static void GetOpenBrowserUrlsForBrowser(const char *szBrowser,HWND hwndDlg,HWND hSzTopic=GlobalAddAtomA("WWW_ListWindows");
ddeAcked=0;
- if (!SendMessageTimeout(HWND_BROADCAST,WM_DDE_INITIATE,(WPARAM)hwndDlg,MAKELPARAM(hSzBrowser,hSzTopic),SMTO_ABORTIFHUNG|SMTO_NORMAL,DDEMESSAGETIMEOUT,(PDWORD_PTR)&dwResult)
+ if (!SendMessageTimeout(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndDlg, MAKELPARAM(hSzBrowser, hSzTopic), SMTO_ABORTIFHUNG|SMTO_NORMAL, DDEMESSAGETIMEOUT, (PDWORD_PTR)&dwResult)
|| !ddeAcked) {
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
return;
}
- hData=DoDdeRequest("WWW_ListWindows",hwndDlg);
+ hData=DoDdeRequest("WWW_ListWindows", hwndDlg);
if (hData == NULL) {
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
return;
}
- dataLength=GlobalSize(hData)-offsetof(DDEDATA,Value);
+ dataLength=GlobalSize(hData)-offsetof(DDEDATA, Value);
data=(DDEDATA*)GlobalLock(hData);
windowCount=dataLength/sizeof(DWORD);
windowId=(PDWORD)mir_alloc(sizeof(DWORD)*windowCount);
- memcpy(windowId,data->Value,windowCount*sizeof(DWORD));
+ memcpy(windowId, data->Value, windowCount*sizeof(DWORD));
GlobalUnlock(hData);
FreeDdeRequestData(hData);
- PostMessage(hwndDde,WM_DDE_TERMINATE,(WPARAM)hwndDlg,0);
+ PostMessage(hwndDde, WM_DDE_TERMINATE, (WPARAM)hwndDlg, 0);
GlobalDeleteAtom(hSzTopic);
hSzTopic=GlobalAddAtomA("WWW_GetWindowInfo");
ddeAcked=0;
- if (!SendMessageTimeout(HWND_BROADCAST,WM_DDE_INITIATE,(WPARAM)hwndDlg,MAKELPARAM(hSzBrowser,hSzTopic),SMTO_ABORTIFHUNG|SMTO_NORMAL,DDEMESSAGETIMEOUT,(PDWORD_PTR)&dwResult)
+ if (!SendMessageTimeout(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndDlg, MAKELPARAM(hSzBrowser, hSzTopic), SMTO_ABORTIFHUNG|SMTO_NORMAL, DDEMESSAGETIMEOUT, (PDWORD_PTR)&dwResult)
|| !ddeAcked) {
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
@@ -414,53 +414,53 @@ static void GetOpenBrowserUrlsForBrowser(const char *szBrowser,HWND hwndDlg,HWND for (i=0;i<windowCount;i++) {
if (windowId[i] == 0) break;
{ char str[16];
- mir_snprintf(str, SIZEOF(str), "%d",windowId[i]);
- hData=DoDdeRequest(str,hwndDlg);
+ mir_snprintf(str, SIZEOF(str), "%d", windowId[i]);
+ hData=DoDdeRequest(str, hwndDlg);
}
if (hData != NULL) {
- dataLength=GlobalSize(hData)-offsetof(DDEDATA,Value);
+ dataLength=GlobalSize(hData)-offsetof(DDEDATA, Value);
data=(DDEDATA*)GlobalLock(hData);
- AddBrowserPageToCombo((char*)data->Value,hwndCombo);
+ AddBrowserPageToCombo((char*)data->Value, hwndCombo);
GlobalUnlock(hData);
FreeDdeRequestData(hData);
}
}
- PostMessage(hwndDde,WM_DDE_TERMINATE,(WPARAM)hwndDlg,0);
+ PostMessage(hwndDde, WM_DDE_TERMINATE, (WPARAM)hwndDlg, 0);
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
mir_free(windowId);
}
-static void GetOpenBrowserUrls(HWND hwndDlg,HWND hwndCombo)
+static void GetOpenBrowserUrls(HWND hwndDlg, HWND hwndCombo)
{
- GetOpenBrowserUrlsForBrowser("opera",hwndDlg,hwndCombo);
- GetOpenBrowserUrlsForBrowser("netscape",hwndDlg,hwndCombo);
- GetOpenBrowserUrlsForBrowser("iexplore",hwndDlg,hwndCombo);
+ GetOpenBrowserUrlsForBrowser("opera", hwndDlg, hwndCombo);
+ GetOpenBrowserUrlsForBrowser("netscape", hwndDlg, hwndCombo);
+ GetOpenBrowserUrlsForBrowser("iexplore", hwndDlg, hwndCombo);
}
static WNDPROC OldSendEditProc;
-static LRESULT CALLBACK SendEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK SendEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
case WM_CHAR:
if (wParam == '\n' && GetKeyState(VK_CONTROL)&0x8000) {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
break;
case WM_SYSCHAR:
if ((wParam == 's' || wParam == 'S') && GetKeyState(VK_MENU)&0x8000) {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
break;
}
- return CallWindowProc(OldSendEditProc,hwnd,msg,wParam,lParam);
+ return CallWindowProc(OldSendEditProc, hwnd, msg, wParam, lParam);
}
INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct UrlSendData* dat = (struct UrlSendData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ struct UrlSendData* dat = (struct UrlSendData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -472,7 +472,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, 450, 0);
dat=(struct UrlSendData*)mir_alloc(sizeof(struct UrlSendData));
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hContact=(HANDLE)lParam;
dat->hAckEvent=NULL;
dat->hSendId=NULL;
@@ -481,94 +481,94 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP WindowList_Add(hUrlWindowList, hwndDlg, dat->hContact);
{
TCHAR *str = cli.pfnGetContactDisplayName( dat->hContact, 0 );
- SetDlgItemText(hwndDlg,IDC_NAME,str);
+ SetDlgItemText(hwndDlg, IDC_NAME, str);
}
- GetOpenBrowserUrls(hwndDlg,GetDlgItem(hwndDlg,IDC_URLS));
+ GetOpenBrowserUrls(hwndDlg, GetDlgItem(hwndDlg, IDC_URLS));
SendDlgItemMessage(hwndDlg, IDC_URLS, CB_SETCURSEL, 0, 0);
- if (SendDlgItemMessage(hwndDlg,IDC_URLS,CB_GETCOUNT,0,0))SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_URLS,CBN_SELCHANGE),0);
+ if (SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCOUNT, 0, 0))SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_URLS, CBN_SELCHANGE), 0);
EnableWindow(GetDlgItem(hwndDlg, IDOK), (SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCURSEL, 0, 0) == CB_ERR)?FALSE:TRUE);
- Utils_RestoreWindowPositionNoSize(hwndDlg,NULL,"SRUrl","send");
- OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MESSAGE),GWLP_WNDPROC,(LONG_PTR)SendEditSubclassProc);
- OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg,IDC_URLS),GW_CHILD),GWLP_WNDPROC,(LONG_PTR)SendEditSubclassProc);
+ Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, "SRUrl", "send");
+ OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MESSAGE), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
+ OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg, IDC_URLS), GW_CHILD), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc);
// From message dlg
if (!DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
- SendMessage(hwndDlg,DM_UPDATETITLE,0,0);
+ SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0);
// From message dlg end
return TRUE;
case WM_DDE_DATA:
case WM_DDE_ACK:
- return DdeMessage(hwndDlg,msg,wParam,lParam);
+ return DdeMessage(hwndDlg, msg, wParam, lParam);
case WM_TIMER:
if ( wParam == 0 ) {
//ICQ sendurl timed out
- KillTimer(hwndDlg,0);
- MessageBox(hwndDlg,TranslateT("Send timed out"),_T(""),MB_OK);
- EnableWindow(GetDlgItem(hwndDlg,IDOK),TRUE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_URLS),TRUE);
- SendDlgItemMessage(hwndDlg,IDC_MESSAGE,EM_SETREADONLY,FALSE,0);
+ KillTimer(hwndDlg, 0);
+ MessageBox(hwndDlg, TranslateT("Send timed out"), _T(""), MB_OK);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_URLS), TRUE);
+ SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETREADONLY, FALSE, 0);
}
break;
case WM_MEASUREITEM:
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT dis = ( LPDRAWITEMSTRUCT )lParam;
if ( dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ char *szProto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
if (szProto) {
- HICON hIcon = (HICON)CallProtoService(szProto,PS_LOADICON,PLI_PROTOCOL|PLIF_SMALL,0);
+ HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if ( hIcon ) {
- DrawIconEx(dis->hDC,dis->rcItem.left,dis->rcItem.top,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
+ DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
DestroyIcon(hIcon);
} } } }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
case DM_UPDATETITLE:
sttUpdateTitle( hwndDlg, dat->hContact );
break;
case WM_COMMAND:
- if (CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU),(LPARAM)dat->hContact))
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact))
break;
switch (LOWORD(wParam))
{
case IDOK:
{
- char *body,*url;
- int bodySize,urlSize;
+ char *body, *url;
+ int bodySize, urlSize;
- urlSize=GetWindowTextLength(GetDlgItem(hwndDlg,IDC_URLS))+1;
+ urlSize=GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URLS))+1;
url=(char*)mir_alloc(urlSize);
- GetDlgItemTextA(hwndDlg,IDC_URLS,url,urlSize);
+ GetDlgItemTextA(hwndDlg, IDC_URLS, url, urlSize);
if (url[0] == 0) {
mir_free(url);
break;
}
- bodySize=GetWindowTextLength(GetDlgItem(hwndDlg,IDC_MESSAGE))+1;
+ bodySize=GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE))+1;
body=(char*)mir_alloc(bodySize);
- GetDlgItemTextA(hwndDlg,IDC_MESSAGE,body,bodySize);
+ GetDlgItemTextA(hwndDlg, IDC_MESSAGE, body, bodySize);
- dat->sendBuffer=(char*)mir_realloc(dat->sendBuffer,lstrlenA(url)+lstrlenA(body)+2);
- lstrcpyA(dat->sendBuffer,url);
- lstrcpyA(dat->sendBuffer+lstrlenA(url)+1,body);
- dat->hAckEvent=HookEventMessage(ME_PROTO_ACK,hwndDlg,HM_EVENTSENT);
- dat->hSendId=(HANDLE)CallContactService(dat->hContact,PSS_URL,0,(LPARAM)dat->sendBuffer);
+ dat->sendBuffer=(char*)mir_realloc(dat->sendBuffer, lstrlenA(url)+lstrlenA(body)+2);
+ lstrcpyA(dat->sendBuffer, url);
+ lstrcpyA(dat->sendBuffer+lstrlenA(url)+1, body);
+ dat->hAckEvent=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
+ dat->hSendId=(HANDLE)CallContactService(dat->hContact, PSS_URL, 0, (LPARAM)dat->sendBuffer);
mir_free(url);
mir_free(body);
//create a timeout timer
- SetTimer(hwndDlg,0,TIMEOUT_URLSEND,NULL);
- EnableWindow(GetDlgItem(hwndDlg,IDOK),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_URLS),FALSE);
- SendDlgItemMessage(hwndDlg,IDC_MESSAGE,EM_SETREADONLY,TRUE,0);
+ SetTimer(hwndDlg, 0, TIMEOUT_URLSEND, NULL);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_URLS), FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETREADONLY, TRUE, 0);
return TRUE;
}
@@ -580,30 +580,30 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (HIWORD(wParam) == CBN_SELCHANGE) {
int i, urlSize;
char *title;
- i=SendDlgItemMessage(hwndDlg,IDC_URLS,CB_GETCURSEL,0,0);
- title=(char*)SendDlgItemMessage(hwndDlg,IDC_URLS,CB_GETITEMDATA,(WPARAM)i,0);
- SetDlgItemTextA(hwndDlg,IDC_MESSAGE,title);
- urlSize=SendDlgItemMessage(hwndDlg,IDC_URLS,CB_GETLBTEXTLEN,(WPARAM)i,0);
- EnableWindow(GetDlgItem(hwndDlg,IDOK), (urlSize>0));
+ i=SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCURSEL, 0, 0);
+ title=(char*)SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETITEMDATA, (WPARAM)i, 0);
+ SetDlgItemTextA(hwndDlg, IDC_MESSAGE, title);
+ urlSize=SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETLBTEXTLEN, (WPARAM)i, 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), (urlSize>0));
}
else if (HIWORD(wParam) == CBN_EDITCHANGE) {
- int urlSize = GetWindowTextLength(GetDlgItem(hwndDlg,IDC_URLS));
- EnableWindow(GetDlgItem(hwndDlg,IDOK), (urlSize>0));
+ int urlSize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URLS));
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), (urlSize>0));
}
break;
case IDC_USERMENU:
{ RECT rc;
- HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)dat->hContact,0);
- GetWindowRect(GetDlgItem(hwndDlg,IDC_USERMENU),&rc);
- TrackPopupMenu(hMenu,0,rc.left,rc.bottom,0,hwndDlg,NULL);
+ HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rc);
+ TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL);
DestroyMenu(hMenu);
}
break;
case IDC_HISTORY:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY,(WPARAM)dat->hContact,0);
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)dat->hContact, 0);
break;
case IDC_DETAILS:
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)dat->hContact,0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)dat->hContact, 0);
break;
case IDC_ADD:
{ ADDCONTACTSTRUCT acs={0};
@@ -611,10 +611,10 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP acs.handle=dat->hContact;
acs.handleType=HANDLE_CONTACT;
acs.szProto=0;
- CallService(MS_ADDCONTACT_SHOW,(WPARAM)hwndDlg,(LPARAM)&acs);
+ CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
}
- if (!DBGetContactSettingByte(dat->hContact,"CList","NotOnList",0)) {
- ShowWindow(GetDlgItem(hwndDlg,IDC_ADD),FALSE);
+ if (!DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE);
}
break;
}
@@ -626,36 +626,36 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (ack->hContact != dat->hContact) break;
if (ack->type != ACKTYPE_URL || ack->result != ACKRESULT_SUCCESS) break;
- ZeroMemory(&dbei,sizeof(dbei));
+ ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize=sizeof(dbei);
dbei.eventType=EVENTTYPE_URL;
dbei.flags=DBEF_SENT;
- dbei.szModule=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
+ dbei.szModule=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
dbei.timestamp=time(NULL);
dbei.cbBlob=(DWORD)(strlen(dat->sendBuffer)+strlen(dat->sendBuffer+strlen(dat->sendBuffer)+1)+2);
dbei.pBlob=(PBYTE)dat->sendBuffer;
- CallService(MS_DB_EVENT_ADD,(WPARAM)dat->hContact,(LPARAM)&dbei);
- KillTimer(hwndDlg,0);
+ CallService(MS_DB_EVENT_ADD, (WPARAM)dat->hContact, (LPARAM)&dbei);
+ KillTimer(hwndDlg, 0);
DestroyWindow(hwndDlg);
break;
}
case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_ADD);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_DETAILS);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_HISTORY);
- Button_FreeIcon_IcoLib(hwndDlg,IDC_USERMENU);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_ADD);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_DETAILS);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_HISTORY);
+ Button_FreeIcon_IcoLib(hwndDlg, IDC_USERMENU);
WindowList_Remove(hUrlWindowList, hwndDlg);
- SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg,IDC_URLS),GW_CHILD),GWLP_WNDPROC,(LONG_PTR)OldSendEditProc);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_MESSAGE),GWLP_WNDPROC,(LONG_PTR)OldSendEditProc);
+ SetWindowLongPtr(GetWindow(GetDlgItem(hwndDlg, IDC_URLS), GW_CHILD), GWLP_WNDPROC, (LONG_PTR)OldSendEditProc);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MESSAGE), GWLP_WNDPROC, (LONG_PTR)OldSendEditProc);
if (dat->hAckEvent) UnhookEvent(dat->hAckEvent);
if (dat->sendBuffer != NULL) mir_free(dat->sendBuffer);
mir_free(dat);
- Utils_SaveWindowPosition(hwndDlg,NULL,"SRUrl","send");
+ Utils_SaveWindowPosition(hwndDlg, NULL, "SRUrl", "send");
{ int i;
- for (i=SendDlgItemMessage(hwndDlg,IDC_URLS,CB_GETCOUNT,0,0)-1;i>=0;i--)
- mir_free((char*)SendDlgItemMessage(hwndDlg,IDC_URLS,CB_GETITEMDATA,i,0));
+ for (i=SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETCOUNT, 0, 0)-1;i>=0;i--)
+ mir_free((char*)SendDlgItemMessage(hwndDlg, IDC_URLS, CB_GETITEMDATA, i, 0));
}
break;
}
diff --git a/src/modules/updatenotify/updatenotify.cpp b/src/modules/updatenotify/updatenotify.cpp index 123903c937..910b168687 100644 --- a/src/modules/updatenotify/updatenotify.cpp +++ b/src/modules/updatenotify/updatenotify.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -116,7 +116,7 @@ int LoadUpdateNotifyModule(void) { mi.position = 2000030000;
mi.pszName = LPGEN("Check for Update");
mi.pszService = "UpdateNotify/UpdateCommand";
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
hHookModules = HookEvent(ME_SYSTEM_MODULESLOADED, UpdateNotifyModulesLoaded);
hHookPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, UpdateNotifyPreShutdown);
@@ -163,7 +163,7 @@ static INT_PTR UpdateNotifyMenuCommand(WPARAM, LPARAM) { DBWriteContactSettingDword(NULL, UN_MOD, UN_CURRENTVERSIONFND, und.reqTime);
}
und.isManual = 1;
- DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc,(LPARAM)&und);
+ DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc, (LPARAM)&und);
hwndManualUpdateDlg = 0;
return 0;
}
@@ -207,7 +207,7 @@ static VOID CALLBACK UpdateNotifyTimerCheck(HWND, UINT, UINT_PTR, DWORD) }
static DWORD UpdateNotifyMakeVersion(char *str) {
- DWORD a1,a2,a3,a4;
+ DWORD a1, a2, a3, a4;
if (!str)
return 0;
sscanf(str, "%u.%u.%u.%u", &a1, &a2, &a3, &a4);
@@ -274,8 +274,8 @@ static int UpdateNotifyMakeRequest(UpdateNotifyData *und) { isBetaCheck = DBGetContactSettingByte(NULL, UN_MOD, UN_NOTIFYTYPE, UN_NOTIFYTYPE_DEF) == UN_NOTIFYTYPE_BETA?1:0;
isAlphaCheck = DBGetContactSettingByte(NULL, UN_MOD, UN_NOTIFYTYPE, UN_NOTIFYTYPE_DEF) == UN_NOTIFYTYPE_ALPHA?1:0;
dwVersion = CallService(MS_SYSTEM_GETVERSION, 0, 0);
- mir_snprintf(szVersion, sizeof(szVersion), "%d.%d.%d.%d",
- HIBYTE(HIWORD(dwVersion)), LOBYTE(HIWORD(dwVersion)),
+ mir_snprintf(szVersion, sizeof(szVersion), "%d.%d.%d.%d",
+ HIBYTE(HIWORD(dwVersion)), LOBYTE(HIWORD(dwVersion)),
HIBYTE(LOWORD(dwVersion)), LOBYTE(LOWORD(dwVersion)));
if (!DBGetContactSettingString(NULL, UN_MOD, UN_CUSTOMXMLURL, &dbv)) {
mir_snprintf(szUrl, sizeof(szUrl), "%s", dbv.pszVal?dbv.pszVal:UN_URLXML);
@@ -535,7 +535,7 @@ static void UpdateNotifyPerform(void *) if (notify) {
DBWriteContactSettingString(NULL, UN_MOD, UN_CURRENTVERSION, und.versionReal);
DBWriteContactSettingDword(NULL, UN_MOD, UN_CURRENTVERSIONFND, und.reqTime);
- DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc,(LPARAM)&und);
+ DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_UPDATE_NOTIFY), 0, UpdateNotifyProc, (LPARAM)&und);
hwndUpdateDlg = 0;
}
}
diff --git a/src/modules/userinfo/contactinfo.cpp b/src/modules/userinfo/contactinfo.cpp index 8b8c7ae66d..42658c8fd1 100644 --- a/src/modules/userinfo/contactinfo.cpp +++ b/src/modules/userinfo/contactinfo.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -29,22 +29,22 @@ static INT_PTR CALLBACK EditUserEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
switch(msg) {
case WM_INITDIALOG:
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)lParam);
- if (*(char*)lParam) SetWindowText(hwndDlg,TranslateT("Edit E-Mail Address"));
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+ if (*(char*)lParam) SetWindowText(hwndDlg, TranslateT("Edit E-Mail Address"));
TranslateDialogDefault(hwndDlg);
- SetDlgItemTextA(hwndDlg,IDC_EMAIL,(char*)lParam);
- EnableWindow(GetDlgItem(hwndDlg,IDOK),*(char*)lParam);
+ SetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)lParam);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), *(char*)lParam);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
- GetDlgItemTextA(hwndDlg,IDC_EMAIL,(char*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA),256);
+ GetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA), 256);
//fall through
case IDCANCEL:
- EndDialog(hwndDlg,wParam);
+ EndDialog(hwndDlg, wParam);
case IDC_EMAIL:
if (HIWORD(wParam) == EN_CHANGE)
- EnableWindow(GetDlgItem(hwndDlg,IDOK),GetWindowTextLength(GetDlgItem(hwndDlg,IDC_EMAIL)));
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_EMAIL)));
break;
}
break;
@@ -59,57 +59,57 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar switch(msg) {
case WM_INITDIALOG:
{ char *szText=(char*)lParam;
- int i,item,countryCount;
+ int i, item, countryCount;
struct CountryListEntry *countries;
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)lParam);
- if (szText[0]) SetWindowText(hwndDlg,TranslateT("Edit Phone Number"));
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+ if (szText[0]) SetWindowText(hwndDlg, TranslateT("Edit Phone Number"));
TranslateDialogDefault(hwndDlg);
- if (lstrlenA(szText)>4 && !lstrcmpA(szText+lstrlenA(szText)-4," SMS")) {
- CheckDlgButton(hwndDlg,IDC_SMS,BST_CHECKED);
+ if (lstrlenA(szText)>4 && !lstrcmpA(szText+lstrlenA(szText)-4, " SMS")) {
+ CheckDlgButton(hwndDlg, IDC_SMS, BST_CHECKED);
szText[lstrlenA(szText)-4]='\0';
}
- EnableWindow(GetDlgItem(hwndDlg,IDOK),szText[0]);
- SendDlgItemMessage(hwndDlg,IDC_AREA,EM_LIMITTEXT,31,0);
- SendDlgItemMessage(hwndDlg,IDC_NUMBER,EM_LIMITTEXT,63,0);
- CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&countryCount,(LPARAM)&countries);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), szText[0]);
+ SendDlgItemMessage(hwndDlg, IDC_AREA, EM_LIMITTEXT, 31, 0);
+ SendDlgItemMessage(hwndDlg, IDC_NUMBER, EM_LIMITTEXT, 63, 0);
+ CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries);
for (i=0;i<countryCount;i++) {
if (countries[i].id == 0 || countries[i].id == 0xFFFF) continue;
- item=SendDlgItemMessageA(hwndDlg,IDC_COUNTRY,CB_ADDSTRING,0,(LPARAM)Translate(countries[i].szName));
- SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_SETITEMDATA,item,countries[i].id);
+ item=SendDlgItemMessageA(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)Translate(countries[i].szName));
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETITEMDATA, item, countries[i].id);
}
- SetDlgItemTextA(hwndDlg,IDC_PHONE,szText);
+ SetDlgItemTextA(hwndDlg, IDC_PHONE, szText);
return TRUE;
}
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
- { char *szText=(char*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ { char *szText=(char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
int isValid=1;
- GetDlgItemTextA(hwndDlg,IDC_PHONE,szText,252);
+ GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, 252);
if (lstrlenA(szText)<7 || szText[0] != '+') isValid=0;
- if (isValid) isValid=(lstrlenA(szText+1) == (int)strspn(szText+1,"0123456789 ()-"));
+ if (isValid) isValid=(lstrlenA(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
if (!isValid) {
- MessageBox(hwndDlg,TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."),TranslateT("Invalid Phone Number"),MB_OK);
+ MessageBox(hwndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid Phone Number"), MB_OK);
break;
}
- if (IsDlgButtonChecked(hwndDlg,IDC_SMS)) lstrcatA(szText," SMS");
+ if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) lstrcatA(szText, " SMS");
}
//fall through
case IDCANCEL:
- EndDialog(hwndDlg,wParam);
+ EndDialog(hwndDlg, wParam);
case IDC_COUNTRY:
if (HIWORD(wParam) != CBN_SELCHANGE) break;
case IDC_AREA:
case IDC_NUMBER:
if (LOWORD(wParam) != IDC_COUNTRY && HIWORD(wParam) != EN_CHANGE) break;
if (noRecursion) break;
- EnableWindow(GetDlgItem(hwndDlg,IDOK),TRUE);
- { char szPhone[96],szArea[32],szNumber[64];
- GetDlgItemTextA(hwndDlg,IDC_AREA,szArea,SIZEOF(szArea));
- GetDlgItemTextA(hwndDlg,IDC_NUMBER,szNumber,SIZEOF(szNumber));
- mir_snprintf(szPhone,SIZEOF(szPhone),"+%u (%s) %s",SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_GETCURSEL,0,0),0),szArea,szNumber);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
+ { char szPhone[96], szArea[32], szNumber[64];
+ GetDlgItemTextA(hwndDlg, IDC_AREA, szArea, SIZEOF(szArea));
+ GetDlgItemTextA(hwndDlg, IDC_NUMBER, szNumber, SIZEOF(szNumber));
+ mir_snprintf(szPhone, SIZEOF(szPhone), "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber);
noRecursion=1;
- SetDlgItemTextA(hwndDlg,IDC_PHONE,szPhone);
+ SetDlgItemTextA(hwndDlg, IDC_PHONE, szPhone);
noRecursion=0;
}
break;
@@ -118,9 +118,9 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar if (noRecursion) break;
noRecursion=1;
{
- char szText[256],*pText=NULL,*pArea,*pNumber;
+ char szText[256], *pText=NULL, *pArea, *pNumber;
int isValid=1;
- GetDlgItemTextA(hwndDlg,IDC_PHONE,szText,SIZEOF(szText));
+ GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, SIZEOF(szText));
if (szText[0] != '+')
isValid=0;
@@ -130,8 +130,8 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar isValid = 0;
else {
for ( i = SendDlgItemMessage( hwndDlg, IDC_COUNTRY, CB_GETCOUNT, 0, 0 )-1; i >= 0; i-- )
- if ( country == SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_GETITEMDATA,i,0)) {
- SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_SETCURSEL,i,0);
+ if ( country == SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, i, 0)) {
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, i, 0);
break;
}
if ( i < 0 )
@@ -139,23 +139,23 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar }
}
if ( isValid ) {
- pArea = pText+strcspn(pText,"0123456789");
- pText = pArea+strspn(pArea,"0123456789");
+ pArea = pText+strcspn(pText, "0123456789");
+ pText = pArea+strspn(pArea, "0123456789");
if (*pText) {
*pText='\0';
- pNumber = pText+1+strcspn(pText+1,"0123456789");
- SetDlgItemTextA(hwndDlg,IDC_NUMBER,pNumber);
+ pNumber = pText+1+strcspn(pText+1, "0123456789");
+ SetDlgItemTextA(hwndDlg, IDC_NUMBER, pNumber);
}
- SetDlgItemTextA(hwndDlg,IDC_AREA,pArea);
+ SetDlgItemTextA(hwndDlg, IDC_AREA, pArea);
}
if ( !isValid ) {
- SendDlgItemMessage(hwndDlg,IDC_COUNTRY,CB_SETCURSEL,-1,0);
- SetDlgItemTextA(hwndDlg,IDC_AREA,"");
- SetDlgItemTextA(hwndDlg,IDC_NUMBER,"");
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, -1, 0);
+ SetDlgItemTextA(hwndDlg, IDC_AREA, "");
+ SetDlgItemTextA(hwndDlg, IDC_NUMBER, "");
}
}
noRecursion=0;
- EnableWindow(GetDlgItem(hwndDlg,IDOK),GetWindowTextLength(GetDlgItem(hwndDlg,IDC_PHONE)));
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_PHONE)));
break;
}
break;
@@ -163,7 +163,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar return FALSE;
}
-static int IsOverEmail(HWND hwndDlg,TCHAR* szEmail,int cchEmail)
+static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
{
RECT rc;
HWND hwndEmails;
@@ -172,23 +172,23 @@ static int IsOverEmail(HWND hwndDlg,TCHAR* szEmail,int cchEmail) SIZE textSize;
LVHITTESTINFO hti;
- hwndEmails=GetDlgItem(hwndDlg,IDC_EMAILS);
+ hwndEmails=GetDlgItem(hwndDlg, IDC_EMAILS);
GetCursorPos(&hti.pt);
- ScreenToClient(hwndEmails,&hti.pt);
- GetClientRect(hwndEmails,&rc);
- if (!PtInRect(&rc,hti.pt)) return 0;
- if (ListView_SubItemHitTest(hwndEmails,&hti) == -1) return 0;
+ ScreenToClient(hwndEmails, &hti.pt);
+ GetClientRect(hwndEmails, &rc);
+ if (!PtInRect(&rc, hti.pt)) return 0;
+ if (ListView_SubItemHitTest(hwndEmails, &hti) == -1) return 0;
if (hti.iSubItem != 1) return 0;
if (!(hti.flags&LVHT_ONITEMLABEL)) return 0;
- ListView_GetSubItemRect(hwndEmails,hti.iItem,1,LVIR_LABEL,&rc);
+ ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc);
szText[0] = 0;
- ListView_GetItemText(hwndEmails,hti.iItem,1,szText,SIZEOF(szText));
+ ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, SIZEOF(szText));
hdc=GetDC(hwndEmails);
- SelectObject(hdc,hEmailFont);
- GetTextExtentPoint32(hdc,szText,lstrlen(szText),&textSize);
- ReleaseDC(hwndEmails,hdc);
+ SelectObject(hdc, hEmailFont);
+ GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textSize);
+ ReleaseDC(hwndEmails, hdc);
if (hti.pt.x<rc.left+textSize.cx) {
- if (szEmail && cchEmail) lstrcpyn(szEmail,szText,cchEmail);
+ if (szEmail && cchEmail) lstrcpyn(szEmail, szText, cchEmail);
return 1;
}
return 0;
@@ -199,40 +199,40 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
switch(msg) {
case WM_INITDIALOG:
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)lParam);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
if (hEmailFont) DeleteObject(hEmailFont);
{ LOGFONT lf;
- hEmailFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_EMAILS,WM_GETFONT,0,0);
- GetObject(hEmailFont,sizeof(lf),&lf);
+ hEmailFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_EMAILS, WM_GETFONT, 0, 0);
+ GetObject(hEmailFont, sizeof(lf), &lf);
lf.lfUnderline=1;
hEmailFont=CreateFontIndirect(&lf);
}
if (hHandCursor == NULL) {
- if (IsWinVer2000Plus()) hHandCursor=LoadCursor(NULL,IDC_HAND);
- else hHandCursor=LoadCursor(hMirandaInst,MAKEINTRESOURCE(IDC_HYPERLINKHAND));
+ if (IsWinVer2000Plus()) hHandCursor=LoadCursor(NULL, IDC_HAND);
+ else hHandCursor=LoadCursor(hMirandaInst, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
}
TranslateDialogDefault(hwndDlg);
{ LVCOLUMN lvc;
RECT rc;
- GetClientRect(GetDlgItem(hwndDlg,IDC_EMAILS),&rc);
+ GetClientRect(GetDlgItem(hwndDlg, IDC_EMAILS), &rc);
rc.right-=GetSystemMetrics(SM_CXVSCROLL);
lvc.mask=LVCF_WIDTH;
- ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg,IDC_EMAILS), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
- ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg,IDC_PHONES), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
+ ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_EMAILS), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
+ ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_PHONES), LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
lvc.cx=rc.right/4;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_EMAILS),0,&lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PHONES),0,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 0, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 0, &lvc);
lvc.cx=rc.right-rc.right/4-40;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_EMAILS),1,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 1, &lvc);
lvc.cx=rc.right-rc.right/4-90;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PHONES),1,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 1, &lvc);
lvc.cx=50;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PHONES),2,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 2, &lvc);
lvc.cx=20;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_EMAILS),2,&lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_EMAILS),3,&lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PHONES),3,&lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PHONES),4,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 2, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_EMAILS), 3, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 3, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PHONES), 4, &lvc);
}
break;
case M_REMAKELISTS:
@@ -242,116 +242,116 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP char idstr[33];
TCHAR idstr2[33];
DBVARIANT dbv;
- HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
//e-mails
- ListView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_EMAILS));
+ ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS));
lvi.mask=LVIF_TEXT|LVIF_PARAM;
lvi.lParam=(LPARAM)(-1);
lvi.iSubItem=0;
lvi.iItem=0;
for (i=-1;;i++) {
if (i == -1) {
- if (DBGetContactSettingTString(hContact,szProto,"e-mail",&dbv))
+ if (DBGetContactSettingTString(hContact, szProto, "e-mail", &dbv))
continue;
lvi.pszText=TranslateT("Primary");
}
else {
mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i );
- if (DBGetContactSettingTString(hContact,szProto,idstr,&dbv))
+ if (DBGetContactSettingTString(hContact, szProto, idstr, &dbv))
break;
lvi.pszText=idstr2;
- mir_sntprintf(idstr2, SIZEOF(idstr2), _T("%d"),i+2);
+ mir_sntprintf(idstr2, SIZEOF(idstr2), _T("%d"), i+2);
}
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_EMAILS),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_EMAILS),lvi.iItem,1,dbv.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
lvi.iSubItem=0;
for (i=0;;i++) {
lvi.lParam=i;
- mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d",i);
- if (DBGetContactSettingTString(hContact,"UserInfo",idstr,&dbv))
+ mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
+ if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText=idstr2;
- mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"),i+1);
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_EMAILS),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_EMAILS),lvi.iItem,1,dbv.ptszVal);
+ mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
lvi.mask=LVIF_PARAM;
lvi.lParam=(LPARAM)(-2);
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_EMAILS),&lvi);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
//phones
- ListView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_PHONES));
+ ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PHONES));
lvi.mask=LVIF_TEXT|LVIF_PARAM;
lvi.lParam=(LPARAM)(-1);
lvi.iSubItem=0;
lvi.iItem=0;
- if (!DBGetContactSettingTString(hContact,szProto,"Phone",&dbv)) {
+ if (!DBGetContactSettingTString(hContact, szProto, "Phone", &dbv)) {
lvi.pszText=TranslateT("Primary");
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,1,dbv.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
- if (!DBGetContactSettingTString(hContact,szProto,"Fax",&dbv)) {
+ if (!DBGetContactSettingTString(hContact, szProto, "Fax", &dbv)) {
lvi.pszText=TranslateT("Fax");
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,1,dbv.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
- if (!DBGetContactSettingTString(hContact,szProto,"Cellular",&dbv)) {
+ if (!DBGetContactSettingTString(hContact, szProto, "Cellular", &dbv)) {
lvi.pszText=TranslateT("Mobile");
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
- if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4," SMS")) {
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,2,_T("y"));
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) {
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
dbv.ptszVal[lstrlen(dbv.ptszVal)-4]='\0';
}
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,1,dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
- if (!DBGetContactSettingTString(hContact,szProto,"CompanyPhone",&dbv)) {
+ if (!DBGetContactSettingTString(hContact, szProto, "CompanyPhone", &dbv)) {
lvi.pszText=TranslateT("Work Phone");
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,1,dbv.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
- if (!DBGetContactSettingTString(hContact,szProto,"CompanyFax",&dbv)) {
+ if (!DBGetContactSettingTString(hContact, szProto, "CompanyFax", &dbv)) {
lvi.pszText=TranslateT("Work Fax");
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,1,dbv.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
lvi.iSubItem=0;
for (i=0;;i++) {
lvi.lParam=i;
- mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d",i);
- if (DBGetContactSettingTString(hContact,"UserInfo",idstr,&dbv))
+ mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
+ if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText=idstr2;
- mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"),i+1);
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
- if (lstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+lstrlen(dbv.ptszVal)-4,_T(" SMS"))) {
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,2,_T("y"));
+ mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
+ if (lstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+lstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
dbv.ptszVal[lstrlen(dbv.ptszVal)-4]='\0';
}
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PHONES),lvi.iItem,1,dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
DBFreeVariant(&dbv);
lvi.iItem++;
}
lvi.mask=LVIF_PARAM;
lvi.lParam=(LPARAM)(-2);
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PHONES),&lvi);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
}
break;
}
@@ -360,7 +360,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
- SendMessage(hwndDlg,M_REMAKELISTS,0,0);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
break;
}
break;
@@ -372,21 +372,21 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch(nm->nmcd.dwDrawStage) {
case CDDS_PREPAINT:
case CDDS_ITEMPREPAINT:
- SetWindowLongPtr(hwndDlg,DWLP_MSGRESULT,CDRF_NOTIFYSUBITEMDRAW);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NOTIFYSUBITEMDRAW);
return TRUE;
case CDDS_SUBITEM|CDDS_ITEMPREPAINT:
{
RECT rc;
- ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom,nm->nmcd.dwItemSpec,nm->iSubItem,LVIR_LABEL,&rc);
+ ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) {
HFONT hoFont;
TCHAR szText[256] = {0};
- ListView_GetItemText(nm->nmcd.hdr.hwndFrom,nm->nmcd.dwItemSpec,nm->iSubItem,szText,SIZEOF(szText));
- hoFont=(HFONT)SelectObject(nm->nmcd.hdc,hEmailFont);
- SetTextColor(nm->nmcd.hdc,RGB(0,0,255));
- DrawText(nm->nmcd.hdc,szText,-1,&rc,DT_END_ELLIPSIS|DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
- SelectObject(nm->nmcd.hdc,hoFont);
- SetWindowLongPtr(hwndDlg,DWLP_MSGRESULT,CDRF_SKIPDEFAULT);
+ ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
+ hoFont=(HFONT)SelectObject(nm->nmcd.hdc, hEmailFont);
+ SetTextColor(nm->nmcd.hdc, RGB(0, 0, 255));
+ DrawText(nm->nmcd.hdc, szText, -1, &rc, DT_END_ELLIPSIS|DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
+ SelectObject(nm->nmcd.hdc, hoFont);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
return TRUE;
}
@@ -394,18 +394,18 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (nm->nmcd.lItemlParam == (LPARAM)(-2) && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES))
hIcon = LoadSkinIcon( SKINICON_OTHER_ADDCONTACT );
else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != (LPARAM)(-1) && nm->nmcd.lItemlParam != (LPARAM)(-2)) {
- static int iconResources[3]={SKINICON_OTHER_RENAME,SKINICON_OTHER_DELETE};
+ static int iconResources[3]={SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE};
if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
TCHAR szText[2];
- ListView_GetItemText(nm->nmcd.hdr.hwndFrom,nm->nmcd.dwItemSpec,nm->iSubItem,szText,SIZEOF(szText));
+ ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText));
if (szText[0]) hIcon = LoadSkinIcon( SKINICON_OTHER_SMS );
}
else hIcon = LoadSkinIcon( iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)] );
}
else break;
- DrawIconEx(nm->nmcd.hdc,(rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2,(rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
+ DrawIconEx(nm->nmcd.hdc, (rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2, (rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
IconLib_ReleaseIcon(hIcon, 0);
- SetWindowLongPtr(hwndDlg,DWLP_MSGRESULT,CDRF_SKIPDEFAULT);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
return TRUE;
}
}
@@ -415,41 +415,41 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP { NMLISTVIEW *nm=(NMLISTVIEW*)lParam;
LVITEM lvi;
TCHAR szEmail[256];
- HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ HANDLE hContact=(HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char *szIdTemplate=nm->hdr.idFrom == IDC_PHONES?"MyPhone%d":"Mye-mail%d";
LVHITTESTINFO hti;
- if (IsOverEmail(hwndDlg,szEmail,SIZEOF(szEmail))) {
+ if (IsOverEmail(hwndDlg, szEmail, SIZEOF(szEmail))) {
TCHAR szExec[264];
mir_sntprintf(szExec, SIZEOF(szExec), _T("mailto:%s"), szEmail);
- ShellExecute(hwndDlg,_T("open"),szExec,NULL,NULL,SW_SHOW);
+ ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW);
break;
}
if (nm->iSubItem<2) break;
hti.pt.x=(short)LOWORD(GetMessagePos());
hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(nm->hdr.hwndFrom,&hti.pt);
- if (ListView_SubItemHitTest(nm->hdr.hwndFrom,&hti) == -1) break;
+ ScreenToClient(nm->hdr.hwndFrom, &hti.pt);
+ if (ListView_SubItemHitTest(nm->hdr.hwndFrom, &hti) == -1) break;
lvi.mask=LVIF_PARAM;
lvi.iItem=hti.iItem;
lvi.iSubItem=0;
- ListView_GetItem(nm->hdr.hwndFrom,&lvi);
+ ListView_GetItem(nm->hdr.hwndFrom, &lvi);
if (lvi.lParam == (LPARAM)(-1)) break;
if (lvi.lParam == (LPARAM)(-2)) {
if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) {
//add
- char szNewData[256]="",idstr[33];
+ char szNewData[256]="", idstr[33];
int i;
DBVARIANT dbv;
- if (IDOK != DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL),hwndDlg,nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc,(LPARAM)szNewData))
+ if (IDOK != DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szNewData))
break;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate,i);
- if (DBGetContactSettingString(hContact,"UserInfo",idstr,&dbv)) break;
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
DBFreeVariant(&dbv);
}
- DBWriteContactSettingString(hContact,"UserInfo",idstr,szNewData);
- SendMessage(hwndDlg,M_REMAKELISTS,0,0);
+ DBWriteContactSettingString(hContact, "UserInfo", idstr, szNewData);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
}
else {
@@ -459,28 +459,28 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP char idstr[33];
DBVARIANT dbv;
for (i=lvi.lParam;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate,i+1);
- if (DBGetContactSettingString(hContact,"UserInfo",idstr,&dbv)) break;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate,i);
- DBWriteContactSettingString(hContact,"UserInfo",idstr,dbv.pszVal);
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
+ if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ DBWriteContactSettingString(hContact, "UserInfo", idstr, dbv.pszVal);
DBFreeVariant(&dbv);
}
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate,i);
- DBDeleteContactSetting(hContact,"UserInfo",idstr);
- SendMessage(hwndDlg,M_REMAKELISTS,0,0);
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ DBDeleteContactSetting(hContact, "UserInfo", idstr);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
else if (hti.iSubItem-2 == (nm->hdr.idFrom == IDC_PHONES)) {
//edit
- char szText[256],idstr[33];
+ char szText[256], idstr[33];
DBVARIANT dbv;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate,lvi.lParam);
- if (DBGetContactSettingString(hContact,"UserInfo",idstr,&dbv)) break;
- lstrcpynA(szText,dbv.pszVal,SIZEOF(szText));
+ mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
+ if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ lstrcpynA(szText, dbv.pszVal, SIZEOF(szText));
DBFreeVariant(&dbv);
- if (IDOK != DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL),hwndDlg,nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc,(LPARAM)szText))
+ if (IDOK != DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szText))
break;
- DBWriteContactSettingString(hContact,"UserInfo",idstr,szText);
- SendMessage(hwndDlg,M_REMAKELISTS,0,0);
+ DBWriteContactSettingString(hContact, "UserInfo", idstr, szText);
+ SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
}
break;
@@ -494,19 +494,19 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (GetForegroundWindow() == GetParent(hwndDlg)) {
POINT pt;
GetCursorPos(&pt);
- ScreenToClient(hwndDlg,&pt);
-// SetFocus(ChildWindowFromPoint(hwndDlg,pt)); //ugly hack because listviews ignore their first click
+ ScreenToClient(hwndDlg, &pt);
+// SetFocus(ChildWindowFromPoint(hwndDlg, pt)); //ugly hack because listviews ignore their first click
}
- if (IsOverEmail(hwndDlg,NULL,0)) {
+ if (IsOverEmail(hwndDlg, NULL, 0)) {
SetCursor(hHandCursor);
- SetWindowLongPtr(hwndDlg,DWLP_MSGRESULT,TRUE);
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
return TRUE;
}
break;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
break;
}
break;
diff --git a/src/modules/userinfo/stdinfo.cpp b/src/modules/userinfo/stdinfo.cpp index 7af6334a9b..be7863f358 100644 --- a/src/modules/userinfo/stdinfo.cpp +++ b/src/modules/userinfo/stdinfo.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -33,12 +33,12 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP #define SVS_SIGNED 6
#define SVS_TIMEZONE 7
-static int Proto_GetContactInfoSetting(HANDLE hContact,const char *szProto,const char *szModule,const char *szSetting,DBVARIANT *dbv, const int nType)
+static int Proto_GetContactInfoSetting(HANDLE hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType)
{
- DBCONTACTGETSETTING cgs={szModule,szSetting,dbv};
+ DBCONTACTGETSETTING cgs={szModule, szSetting, dbv};
dbv->type=(BYTE)nType;
- return CallProtoService(szProto,PS_GETINFOSETTING,(WPARAM)hContact,(LPARAM)&cgs);
+ return CallProtoService(szProto, PS_GETINFOSETTING, (WPARAM)hContact, (LPARAM)&cgs);
}
static void Proto_FreeInfoVariant(DBVARIANT *dbv)
@@ -62,10 +62,10 @@ static void Proto_FreeInfoVariant(DBVARIANT *dbv) dbv->type=0;
}
-static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char *szSetting,int special)
+static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, char *szSetting, int special)
{
DBVARIANT dbv = { 0 };
- char str[80],*pstr = NULL;
+ char str[80], *pstr = NULL;
TCHAR* ptstr = NULL;
int unspecified=0;
char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -73,8 +73,8 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char dbv.type=DBVT_DELETED;
if (szModule == NULL) unspecified=1;
- else if (proto_service) unspecified=Proto_GetContactInfoSetting(hContact,szProto,szModule,szSetting,&dbv,0);
- else unspecified=DBGetContactSettingW(hContact,szModule,szSetting,&dbv);
+ else if (proto_service) unspecified=Proto_GetContactInfoSetting(hContact, szProto, szModule, szSetting, &dbv, 0);
+ else unspecified=DBGetContactSettingW(hContact, szModule, szSetting, &dbv);
if (!unspecified) {
switch(dbv.type) {
case DBVT_BYTE:
@@ -86,7 +86,7 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char else if (special == SVS_MONTH) {
if (dbv.bVal>0 && dbv.bVal<=12) {
pstr=str;
- GetLocaleInfoA(LOCALE_USER_DEFAULT,LOCALE_SABBREVMONTHNAME1-1+dbv.bVal,str,SIZEOF(str));
+ GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1-1+dbv.bVal, str, SIZEOF(str));
}
else unspecified=1;
}
@@ -94,12 +94,12 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char if (dbv.cVal == -100) unspecified=1;
else {
pstr=str;
- mir_snprintf(str, SIZEOF(str), dbv.cVal?"UTC%+d:%02d":"UTC",-dbv.cVal/2,(dbv.cVal&1)*30);
+ mir_snprintf(str, SIZEOF(str), dbv.cVal?"UTC%+d:%02d":"UTC", -dbv.cVal/2, (dbv.cVal&1)*30);
}
}
else {
unspecified=(special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
- pstr=_itoa(special == SVS_SIGNED?dbv.cVal:dbv.bVal,str,10);
+ pstr=_itoa(special == SVS_SIGNED?dbv.cVal:dbv.bVal, str, 10);
}
break;
case DBVT_WORD:
@@ -108,19 +108,19 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char if (wSave == ( WORD )-1) {
char szSettingName[100];
mir_snprintf( szSettingName, SIZEOF(szSettingName), "%sName", szSetting );
- if ( !DBGetContactSettingTString(hContact,szModule,szSettingName,&dbv)) {
+ if ( !DBGetContactSettingTString(hContact, szModule, szSettingName, &dbv)) {
ptstr = dbv.ptszVal;
unspecified = false;
break;
}
}
- pstr = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,wSave,0));
+ pstr = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, wSave, 0));
unspecified=pstr == NULL;
}
else {
unspecified=(special == SVS_ZEROISUNSPEC && dbv.wVal == 0);
- pstr=_itoa(special == SVS_SIGNED?dbv.sVal:dbv.wVal,str,10);
+ pstr=_itoa(special == SVS_SIGNED?dbv.sVal:dbv.wVal, str, 10);
}
break;
case DBVT_DWORD:
@@ -131,7 +131,7 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char pstr=inet_ntoa(ia);
if (dbv.dVal == 0) unspecified=1;
}
- else pstr=_itoa(special == SVS_SIGNED?dbv.lVal:dbv.dVal,str,10);
+ else pstr=_itoa(special == SVS_SIGNED?dbv.lVal:dbv.dVal, str, 10);
break;
case DBVT_ASCIIZ:
unspecified=(special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
@@ -151,7 +151,7 @@ static void SetValue(HWND hwndDlg,int idCtrl,HANDLE hContact,char *szModule,char pstr=dbv.pszVal;
Utf8Decode( dbv.pszVal, NULL );
break;
- default: pstr=str; lstrcpyA(str,"???"); break;
+ default: pstr=str; lstrcpyA(str, "???"); break;
} }
if (unspecified)
@@ -185,18 +185,18 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP { char *szProto;
HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
- SetValue(hwndDlg,IDC_NICK,hContact,szProto,"Nick",0);
- SetValue(hwndDlg,IDC_FIRSTNAME,hContact,szProto,"FirstName",0);
- SetValue(hwndDlg,IDC_LASTNAME,hContact,szProto,"LastName",0);
- SetValue(hwndDlg,IDC_EMAIL,hContact,szProto,"e-mail",0);
- SetValue(hwndDlg,IDC_AGE,hContact,szProto,"Age",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_GENDER,hContact,szProto,"Gender",SVS_GENDER);
- SetValue(hwndDlg,IDC_DOBDAY,hContact,szProto,"BirthDay",0);
- SetValue(hwndDlg,IDC_DOBMONTH,hContact,szProto,"BirthMonth",SVS_MONTH);
- SetValue(hwndDlg,IDC_DOBYEAR,hContact,szProto,"BirthYear",0);
- SetValue(hwndDlg,IDC_MARITAL,hContact,szProto,"MaritalStatus",0);
+ SetValue(hwndDlg, IDC_NICK, hContact, szProto, "Nick", 0);
+ SetValue(hwndDlg, IDC_FIRSTNAME, hContact, szProto, "FirstName", 0);
+ SetValue(hwndDlg, IDC_LASTNAME, hContact, szProto, "LastName", 0);
+ SetValue(hwndDlg, IDC_EMAIL, hContact, szProto, "e-mail", 0);
+ SetValue(hwndDlg, IDC_AGE, hContact, szProto, "Age", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_GENDER, hContact, szProto, "Gender", SVS_GENDER);
+ SetValue(hwndDlg, IDC_DOBDAY, hContact, szProto, "BirthDay", 0);
+ SetValue(hwndDlg, IDC_DOBMONTH, hContact, szProto, "BirthMonth", SVS_MONTH);
+ SetValue(hwndDlg, IDC_DOBYEAR, hContact, szProto, "BirthYear", 0);
+ SetValue(hwndDlg, IDC_MARITAL, hContact, szProto, "MaritalStatus", 0);
} }
break;
}
@@ -204,10 +204,10 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
break;
case IDC_EMAIL:
- if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_EMAIL))) {
+ if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) {
TCHAR szExec[264], szEmail[256];
GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, SIZEOF(szEmail));
mir_sntprintf(szExec, SIZEOF(szExec), _T("mailto:%s"), szEmail);
@@ -225,12 +225,12 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L switch(msg) {
case WM_INITDIALOG:
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,lParam);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
TranslateDialogDefault(hwndDlg);
- SetTimer(hwndDlg,1,1000,NULL);
+ SetTimer(hwndDlg, 1, 1000, NULL);
tmi.prepareList((HANDLE)lParam, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB);
- SendMessage(hwndDlg,WM_TIMER,0,0);
+ SendMessage(hwndDlg, WM_TIMER, 0, 0);
break;
case WM_TIMER:
@@ -243,12 +243,12 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (tmi.printDateTimeByContact(hContact, _T("s"), szTime, SIZEOF(szTime), TZF_KNOWNONLY))
{
- EnableWindow(GetDlgItem(hwndDlg,IDC_LOCALTIME),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOCALTIME), FALSE);
SetDlgItemText(hwndDlg, IDC_LOCALTIME, TranslateT("<not specified>"));
}
else
{
- EnableWindow(GetDlgItem(hwndDlg,IDC_LOCALTIME), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOCALTIME), TRUE);
SetDlgItemText(hwndDlg, IDC_LOCALTIME, szTime);
}
}
@@ -261,17 +261,17 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L { char *szProto;
HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
- SetValue(hwndDlg,IDC_STREET,hContact,szProto,"Street",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_CITY,hContact,szProto,"City",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_STATE,hContact,szProto,"State",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_ZIP,hContact,szProto,"ZIP",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_COUNTRY,hContact,szProto,"Country",SVS_COUNTRY);
- SetValue(hwndDlg,IDC_LANGUAGE1,hContact,szProto,"Language1",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_LANGUAGE2,hContact,szProto,"Language2",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_LANGUAGE3,hContact,szProto,"Language3",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_TIMEZONE,hContact,szProto,"Timezone",SVS_TIMEZONE);
+ SetValue(hwndDlg, IDC_STREET, hContact, szProto, "Street", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_CITY, hContact, szProto, "City", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_STATE, hContact, szProto, "State", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_ZIP, hContact, szProto, "ZIP", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_COUNTRY, hContact, szProto, "Country", SVS_COUNTRY);
+ SetValue(hwndDlg, IDC_LANGUAGE1, hContact, szProto, "Language1", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_LANGUAGE2, hContact, szProto, "Language2", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_LANGUAGE3, hContact, szProto, "Language3", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_TIMEZONE, hContact, szProto, "Timezone", SVS_TIMEZONE);
}
}
break;
@@ -280,13 +280,13 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
break;
case IDC_TIMEZONESELECT:
if (HIWORD(wParam) == CBN_SELCHANGE) {
HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED, 0,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
tmi.storeListResults(hContact, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB);
}
break;
@@ -309,17 +309,17 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA { char *szProto;
HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
- SetValue(hwndDlg,IDC_COMPANY,hContact,szProto,"Company",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_DEPARTMENT,hContact,szProto,"CompanyDepartment",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_POSITION,hContact,szProto,"CompanyPosition",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_STREET,hContact,szProto,"CompanyStreet",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_CITY,hContact,szProto,"CompanyCity",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_STATE,hContact,szProto,"CompanyState",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_ZIP,hContact,szProto,"CompanyZIP",SVS_ZEROISUNSPEC);
- SetValue(hwndDlg,IDC_COUNTRY,hContact,szProto,"CompanyCountry",SVS_COUNTRY);
- SetValue(hwndDlg,IDC_WEBPAGE,hContact,szProto,"CompanyHomepage",SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_COMPANY, hContact, szProto, "Company", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_DEPARTMENT, hContact, szProto, "CompanyDepartment", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_POSITION, hContact, szProto, "CompanyPosition", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_STREET, hContact, szProto, "CompanyStreet", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_CITY, hContact, szProto, "CompanyCity", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_STATE, hContact, szProto, "CompanyState", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_ZIP, hContact, szProto, "CompanyZIP", SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_COUNTRY, hContact, szProto, "CompanyCountry", SVS_COUNTRY);
+ SetValue(hwndDlg, IDC_WEBPAGE, hContact, szProto, "CompanyHomepage", SVS_ZEROISUNSPEC);
} }
break;
}
@@ -327,13 +327,13 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
break;
case IDC_WEBPAGE:
- if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_WEBPAGE))) {
+ if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_WEBPAGE))) {
char szPage[256];
- GetDlgItemTextA(hwndDlg,IDC_WEBPAGE,szPage,SIZEOF(szPage));
- CallService(MS_UTILS_OPENURL,1,(LPARAM)szPage);
+ GetDlgItemTextA(hwndDlg, IDC_WEBPAGE, szPage, SIZEOF(szPage));
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)szPage);
}
break;
}
@@ -359,18 +359,18 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, TranslateDialogDefault(hwndDlg);
{ LVCOLUMN lvc;
RECT rc;
- GetClientRect(GetDlgItem(hwndDlg,IDC_PAST),&rc);
+ GetClientRect(GetDlgItem(hwndDlg, IDC_PAST), &rc);
rc.right-=GetSystemMetrics(SM_CXVSCROLL);
lvc.mask=LVCF_WIDTH;
lvc.cx=rc.right/3;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PAST),0,&lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_INTERESTS),0,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PAST), 0, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_INTERESTS), 0, &lvc);
lvc.cx=rc.right-rc.right/3;
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_PAST),1,&lvc);
- ListView_InsertColumn(GetDlgItem(hwndDlg,IDC_INTERESTS),1,&lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_PAST), 1, &lvc);
+ ListView_InsertColumn(GetDlgItem(hwndDlg, IDC_INTERESTS), 1, &lvc);
}
- ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg,IDC_PAST),LVS_EX_LABELTIP,LVS_EX_LABELTIP);
- ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg,IDC_INTERESTS),LVS_EX_LABELTIP,LVS_EX_LABELTIP);
+ ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_PAST), LVS_EX_LABELTIP, LVS_EX_LABELTIP);
+ ListView_SetExtendedListViewStyleEx(GetDlgItem(hwndDlg, IDC_INTERESTS), LVS_EX_LABELTIP, LVS_EX_LABELTIP);
break;
case WM_NOTIFY:
@@ -380,31 +380,31 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, { LVITEM lvi;
int i;
char idstr[33];
- DBVARIANT dbv,dbvText;
+ DBVARIANT dbv, dbvText;
HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
bool proto_service = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) == PF4_INFOSETTINGSVC;
- SetValue(hwndDlg,IDC_WEBPAGE,hContact,szProto,"Homepage",SVS_ZEROISUNSPEC);
+ SetValue(hwndDlg, IDC_WEBPAGE, hContact, szProto, "Homepage", SVS_ZEROISUNSPEC);
//past
- ListView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_PAST));
+ ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PAST));
lvi.mask=LVIF_TEXT;
lvi.iSubItem=0;
lvi.iItem=0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Past%d",i);
- if ((proto_service && Proto_GetContactInfoSetting(hContact,szProto,szProto,idstr,&dbv,DBVT_TCHAR)) ||
- (!proto_service && DBGetContactSettingTString(hContact,szProto,idstr,&dbv)))
+ mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i);
+ if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
+ (!proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Past%dText",i);
- if (DBGetContactSettingTString(hContact,szProto,idstr,&dbvText))
+ mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i);
+ if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
lvi.pszText=dbv.ptszVal;
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PAST),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PAST),lvi.iItem,1,dbvText.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PAST), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PAST), lvi.iItem, 1, dbvText.ptszVal);
DBFreeVariant(&dbvText);
if (proto_service)
Proto_FreeInfoVariant(&dbv);
@@ -415,15 +415,15 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%d", i);
- if ((proto_service && Proto_GetContactInfoSetting(hContact,szProto,szProto,idstr,&dbv,DBVT_TCHAR)) ||
- (!proto_service && DBGetContactSettingTString(hContact,szProto,idstr,&dbv)))
+ if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
+ (!proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText",i);
- if (DBGetContactSettingTString(hContact,szProto,idstr,&dbvText))
+ mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i);
+ if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
lvi.pszText=dbv.ptszVal;
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_PAST),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_PAST),lvi.iItem,1,dbvText.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PAST), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PAST), lvi.iItem, 1, dbvText.ptszVal);
DBFreeVariant(&dbvText);
if (proto_service)
Proto_FreeInfoVariant(&dbv);
@@ -432,24 +432,24 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, lvi.iItem++;
}
- ResizeColumns(GetDlgItem(hwndDlg,IDC_PAST));
+ ResizeColumns(GetDlgItem(hwndDlg, IDC_PAST));
//interests
- ListView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_INTERESTS));
+ ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_INTERESTS));
lvi.mask=LVIF_TEXT;
lvi.iSubItem=0;
lvi.iItem=0;
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i);
- if ((proto_service && Proto_GetContactInfoSetting(hContact,szProto,szProto,idstr,&dbv,DBVT_TCHAR)) ||
- (!proto_service && DBGetContactSettingTString(hContact,szProto,idstr,&dbv)))
+ if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
+ (!proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv)))
break;
mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i);
- if (DBGetContactSettingTString(hContact,szProto,idstr,&dbvText))
+ if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
lvi.pszText=dbv.ptszVal;
- ListView_InsertItem(GetDlgItem(hwndDlg,IDC_INTERESTS),&lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg,IDC_INTERESTS),lvi.iItem,1,dbvText.ptszVal);
+ ListView_InsertItem(GetDlgItem(hwndDlg, IDC_INTERESTS), &lvi);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_INTERESTS), lvi.iItem, 1, dbvText.ptszVal);
DBFreeVariant(&dbvText);
if (proto_service)
Proto_FreeInfoVariant(&dbv);
@@ -457,7 +457,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, DBFreeVariant(&dbv);
lvi.iItem++;
}
- ResizeColumns(GetDlgItem(hwndDlg,IDC_INTERESTS));
+ ResizeColumns(GetDlgItem(hwndDlg, IDC_INTERESTS));
} }
break;
}
@@ -465,13 +465,13 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDCANCEL:
- SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
break;
case IDC_WEBPAGE:
- if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_WEBPAGE))) {
+ if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_WEBPAGE))) {
char szPage[256];
- GetDlgItemTextA(hwndDlg,IDC_WEBPAGE,szPage,SIZEOF(szPage));
- CallService(MS_UTILS_OPENURL,1,(LPARAM)szPage);
+ GetDlgItemTextA(hwndDlg, IDC_WEBPAGE, szPage, SIZEOF(szPage));
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)szPage);
}
break;
}
@@ -508,12 +508,12 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0));
- if (!DBGetContactSettingString((HANDLE)lParam,"UserInfo","MyNotes",&dbv)) {
- SetDlgItemTextA(hwndDlg,IDC_MYNOTES,dbv.pszVal);
+ if (!DBGetContactSettingString((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_MYNOTES, dbv.pszVal);
DBFreeVariant(&dbv);
}
}
- SendDlgItemMessage(hwndDlg,IDC_MYNOTES,EM_LIMITTEXT,2048,0);
+ SendDlgItemMessage(hwndDlg, IDC_MYNOTES, EM_LIMITTEXT, 2048, 0);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
@@ -523,20 +523,20 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR { char *szProto;
HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) break;
- SetValue(hwndDlg,IDC_ABOUT,hContact,szProto,"About",0);
+ SetValue(hwndDlg, IDC_ABOUT, hContact, szProto, "About", 0);
}
break;
}
case PSN_APPLY:
{ HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam;
- if (GetWindowTextLength(GetDlgItem(hwndDlg,IDC_MYNOTES))) {
+ if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) {
char text[2048];
- GetDlgItemTextA(hwndDlg,IDC_MYNOTES,text,SIZEOF(text));
- DBWriteContactSettingString(hContact,"UserInfo","MyNotes",text);
+ GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text));
+ DBWriteContactSettingString(hContact, "UserInfo", "MyNotes", text);
}
- else DBDeleteContactSetting(hContact,"UserInfo","MyNotes");
+ else DBDeleteContactSetting(hContact, "UserInfo", "MyNotes");
break;
}
}
@@ -544,10 +544,10 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
break;
case WM_COMMAND:
- if (wParam == MAKEWPARAM(IDC_MYNOTES,EN_CHANGE))
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+ if (wParam == MAKEWPARAM(IDC_MYNOTES, EN_CHANGE))
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
else if (LOWORD(wParam) == IDCANCEL)
- SendMessage(GetParent(hwndDlg),msg,wParam,lParam);
+ SendMessage(GetParent(hwndDlg), msg, wParam, lParam);
break;
case WM_DESTROY:
{
@@ -559,7 +559,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE;
}
-int DetailsInit(WPARAM wParam,LPARAM lParam)
+int DetailsInit(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE odp;
diff --git a/src/modules/userinfo/userinfo.cpp b/src/modules/userinfo/userinfo.cpp index 7dd3a1a121..0f07ea5ba3 100644 --- a/src/modules/userinfo/userinfo.cpp +++ b/src/modules/userinfo/userinfo.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h"
#define UPDATEANIMFRAMES 20
-int DetailsInit(WPARAM wParam,LPARAM lParam);
+int DetailsInit(WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static HANDLE hWindowList=NULL;
static HANDLE hDetailsInitEvent;
@@ -58,7 +58,7 @@ struct DetailsData { int *infosUpdated;
};
-static int PageSortProc(OPTIONSDIALOGPAGE *item1,OPTIONSDIALOGPAGE *item2)
+static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
{
int res;
if (!lstrcmp(item1->ptszTitle, TranslateT("Summary"))) return -1;
@@ -72,14 +72,14 @@ static int PageSortProc(OPTIONSDIALOGPAGE *item1,OPTIONSDIALOGPAGE *item2) return lstrcmp(item1->ptszTab, item2->ptszTab);
}
-static INT_PTR ShowDetailsDialogCommand(WPARAM wParam,LPARAM)
+static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM)
{
HWND hwnd;
PROPSHEETHEADER psh;
struct DetailsPageInit opi;
int i;
- if (hwnd=WindowList_Find(hWindowList,(HANDLE)wParam)) {
+ if (hwnd=WindowList_Find(hWindowList, (HANDLE)wParam)) {
SetForegroundWindow(hwnd);
SetFocus(hwnd);
return 0;
@@ -87,11 +87,11 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam,LPARAM) opi.pageCount=0;
opi.odp=NULL;
- NotifyEventHooks(hDetailsInitEvent,(WPARAM)&opi,wParam);
+ NotifyEventHooks(hDetailsInitEvent, (WPARAM)&opi, wParam);
if (opi.pageCount == 0) return 0;
- qsort(opi.odp,opi.pageCount,sizeof(OPTIONSDIALOGPAGE),(int (*)(const void*,const void*))PageSortProc);
+ qsort(opi.odp, opi.pageCount, sizeof(OPTIONSDIALOGPAGE), (int (*)(const void*, const void*))PageSortProc);
- ZeroMemory(&psh,sizeof(psh));
+ ZeroMemory(&psh, sizeof(psh));
psh.dwSize = sizeof(psh);
psh.dwFlags = PSH_PROPSHEETPAGE|PSH_NOAPPLYNOW;
psh.hwndParent = NULL;
@@ -100,7 +100,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam,LPARAM) psh.pszCaption = (TCHAR*)wParam; //more abuses of structure: this is hContact
psh.ppsp = (PROPSHEETPAGE*)opi.odp; //blatent misuse of the structure, but what the hell
- CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProcDetails, (LPARAM)&psh);
+ CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProcDetails, (LPARAM)&psh);
for (i=0;i<opi.pageCount;i++) {
//cleanup moved to WM_DESTROY
//mir_free((char*)opi.odp[i].pszTitle);
@@ -112,7 +112,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam,LPARAM) return 0;
}
-static INT_PTR AddDetailsPage(WPARAM wParam,LPARAM lParam)
+static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE *odp=(OPTIONSDIALOGPAGE*)lParam, *dst;
struct DetailsPageInit *opi=(struct DetailsPageInit*)wParam;
@@ -123,7 +123,7 @@ static INT_PTR AddDetailsPage(WPARAM wParam,LPARAM lParam) && odp->cbSize != OPTIONPAGE_OLD_SIZE3)
return 1;
- opi->odp=(OPTIONSDIALOGPAGE*)mir_realloc(opi->odp,sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount+1));
+ opi->odp=(OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount+1));
dst = opi->odp + opi->pageCount;
dst->cbSize = sizeof(OPTIONSDIALOGPAGE);
dst->hInstance = odp->hInstance;
@@ -178,11 +178,11 @@ static void CreateDetailsTabs( HWND hwndDlg, struct DetailsData* dat, struct Det tie.pszText = TranslateTS(dat->opd[i].ptszTab);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
- if (!lstrcmp(dat->opd[i].ptszTab,ppg->ptszTab))
+ if (!lstrcmp(dat->opd[i].ptszTab, ppg->ptszTab))
sel = pages;
pages++;
}
- TabCtrl_SetCurSel(hwndTab,sel);
+ TabCtrl_SetCurSel(hwndTab, sel);
LONG style = GetWindowLongPtr(hwndTab, GWL_STYLE);
SetWindowLongPtr(hwndTab, GWL_STYLE, pages > 1 ? style | WS_TABSTOP : style & ~WS_TABSTOP);
@@ -191,7 +191,7 @@ static void CreateDetailsTabs( HWND hwndDlg, struct DetailsData* dat, struct Det static void CreateDetailsPageWindow( HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg )
{
RECT *rc = ppg->ptszTab ? &dat->rcDisplayTab : &dat->rcDisplay;
- ppg->hwnd=CreateDialogIndirectParam(ppg->hInst,ppg->pTemplate,hwndDlg,ppg->dlgProc,(LPARAM)dat->hContact);
+ ppg->hwnd=CreateDialogIndirectParam(ppg->hInst, ppg->pTemplate, hwndDlg, ppg->dlgProc, (LPARAM)dat->hContact);
ThemeDialogBackground(ppg->hwnd);
SetWindowPos(ppg->hwnd, HWND_TOP, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, 0);
SetWindowPos(ppg->hwnd, HWND_TOP, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, 0);
@@ -201,20 +201,20 @@ static void CreateDetailsPageWindow( HWND hwndDlg, struct DetailsData* dat, stru pshn.hdr.hwndFrom = ppg->hwnd;
pshn.hdr.idFrom = 0;
pshn.lParam = (LPARAM)ppg->dlgParam;
- SendMessage(ppg->hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(ppg->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
pshn.hdr.code=PSN_INFOCHANGED;
pshn.hdr.hwndFrom=ppg->hwnd;
pshn.hdr.idFrom=0;
pshn.lParam=(LPARAM)dat->hContact;
- SendMessage(ppg->hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(ppg->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
}
-static int UserInfoContactDelete(WPARAM wParam,LPARAM)
+static int UserInfoContactDelete(WPARAM wParam, LPARAM)
{
HWND hwnd;
- hwnd=WindowList_Find(hWindowList,(HANDLE)wParam);
+ hwnd=WindowList_Find(hWindowList, (HANDLE)wParam);
if (hwnd != NULL) DestroyWindow(hwnd);
return 0;
}
@@ -223,7 +223,7 @@ static int UserInfoContactDelete(WPARAM wParam,LPARAM) #define M_CHECKONLINE (WM_USER+11)
static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct DetailsData *dat =(struct DetailsData*)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ struct DetailsData *dat =(struct DetailsData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
@@ -234,8 +234,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat = (DetailsData*)mir_calloc(sizeof(DetailsData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->hContact = (HANDLE)psh->pszCaption;
- dat->hProtoAckEvent = HookEventMessage(ME_PROTO_ACK,hwndDlg,HM_PROTOACK);
- WindowList_Add(hWindowList,hwndDlg,dat->hContact);
+ dat->hProtoAckEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_PROTOACK);
+ WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
TCHAR *name, oldTitle[256], newTitle[256];
if (dat->hContact == NULL)
@@ -252,11 +252,11 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemText( hwndDlg, IDC_HEADERBAR, newTitle );
}
{ LOGFONT lf;
- HFONT hNormalFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_NAME,WM_GETFONT,0,0);
- GetObject(hNormalFont,sizeof(lf),&lf);
+ HFONT hNormalFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_NAME, WM_GETFONT, 0, 0);
+ GetObject(hNormalFont, sizeof(lf), &lf);
lf.lfWeight=FW_BOLD;
dat->hBoldFont=CreateFontIndirect(&lf);
- SendDlgItemMessage(hwndDlg,IDC_NAME,WM_SETFONT,(WPARAM)dat->hBoldFont,0);
+ SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, (WPARAM)dat->hBoldFont, 0);
}
{ OPTIONSDIALOGPAGE *odp;
int i;
@@ -273,7 +273,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP odp = (OPTIONSDIALOGPAGE*)psh->ppsp;
for ( i=0; i < dat->pageCount; i++ ) {
- dat->opd[i].pTemplate = (LPDLGTEMPLATE)LockResource(LoadResource(odp[i].hInstance,
+ dat->opd[i].pTemplate = (LPDLGTEMPLATE)LockResource(LoadResource(odp[i].hInstance,
FindResourceA(odp[i].hInstance, odp[i].pszTemplate, MAKEINTRESOURCEA(5))));
dat->opd[i].dlgProc = odp[i].pfnDlgProc;
dat->opd[i].dlgParam = odp[i].dwInitParam;
@@ -309,11 +309,11 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP tci.mask = TCIF_TEXT | TCIF_IMAGE;
tci.iImage = -1;
tci.pszText = _T("X");
- TabCtrl_InsertItem(hwndTab,0,&tci);
+ TabCtrl_InsertItem(hwndTab, 0, &tci);
GetWindowRect(hwndTab, &dat->rcDisplayTab);
TabCtrl_AdjustRect(hwndTab, FALSE, &dat->rcDisplayTab);
- { POINT pt={0,0};
+ { POINT pt={0, 0};
ClientToScreen(hwndDlg, &pt);
OffsetRect(&dat->rcDisplayTab, -pt.x, -pt.y);
}
@@ -322,7 +322,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetWindowRect(hwndTab, &dat->rcDisplay);
TabCtrl_AdjustRect(hwndTab, FALSE, &dat->rcDisplay);
- { POINT pt={0,0};
+ { POINT pt={0, 0};
ClientToScreen(hwndDlg, &pt);
OffsetRect(&dat->rcDisplay, -pt.x, -pt.y);
} }
@@ -330,13 +330,13 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_PAGETREE), dat->opd[dat->currentPage].hItem);
dat->updateAnimFrame = 0;
- GetDlgItemText(hwndDlg,IDC_UPDATING,dat->szUpdating,SIZEOF(dat->szUpdating));
- SendMessage(hwndDlg,M_CHECKONLINE,0,0);
- if (!CallContactService(dat->hContact,PSS_GETINFO,SGIF_ONOPEN,0)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE);
- SetTimer(hwndDlg,1,100,NULL);
+ GetDlgItemText(hwndDlg, IDC_UPDATING, dat->szUpdating, SIZEOF(dat->szUpdating));
+ SendMessage(hwndDlg, M_CHECKONLINE, 0, 0);
+ if (!CallContactService(dat->hContact, PSS_GETINFO, SGIF_ONOPEN, 0)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
+ SetTimer(hwndDlg, 1, 100, NULL);
} else
- ShowWindow(GetDlgItem(hwndDlg,IDC_UPDATING),SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_UPDATING), SW_HIDE);
SetFocus(GetDlgItem(hwndDlg, IDC_PAGETREE));
@@ -345,8 +345,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER:
{
TCHAR str[128];
- mir_sntprintf(str,SIZEOF(str), _T("%.*s%s%.*s"),dat->updateAnimFrame%10,_T("........."),dat->szUpdating,dat->updateAnimFrame%10,_T("........."));
- SetDlgItemText(hwndDlg,IDC_UPDATING,str);
+ mir_sntprintf(str, SIZEOF(str), _T("%.*s%s%.*s"), dat->updateAnimFrame%10, _T("........."), dat->szUpdating, dat->updateAnimFrame%10, _T("........."));
+ SetDlgItemText(hwndDlg, IDC_UPDATING, str);
if (++dat->updateAnimFrame == UPDATEANIMFRAMES) dat->updateAnimFrame=0;
break;
}
@@ -357,20 +357,20 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
case IDC_UPDATING:
{
- COLORREF textCol,bgCol,newCol;
+ COLORREF textCol, bgCol, newCol;
int ratio;
textCol=GetSysColor(COLOR_BTNTEXT);
bgCol=GetSysColor(COLOR_3DFACE);
ratio=abs(UPDATEANIMFRAMES/2-dat->updateAnimFrame)*510/UPDATEANIMFRAMES;
- newCol=RGB(GetRValue(bgCol)+(GetRValue(textCol)-GetRValue(bgCol))*ratio/256,
- GetGValue(bgCol)+(GetGValue(textCol)-GetGValue(bgCol))*ratio/256,
+ newCol=RGB(GetRValue(bgCol)+(GetRValue(textCol)-GetRValue(bgCol))*ratio/256,
+ GetGValue(bgCol)+(GetGValue(textCol)-GetGValue(bgCol))*ratio/256,
GetBValue(bgCol)+(GetBValue(textCol)-GetBValue(bgCol))*ratio/256);
- SetTextColor((HDC)wParam,newCol);
- SetBkColor((HDC)wParam,GetSysColor(COLOR_3DFACE));
+ SetTextColor((HDC)wParam, newCol);
+ SetBkColor((HDC)wParam, GetSysColor(COLOR_3DFACE));
return (INT_PTR)GetSysColorBrush(COLOR_3DFACE);
}
default:
- SetBkMode((HDC)wParam,TRANSPARENT);
+ SetBkMode((HDC)wParam, TRANSPARENT);
return (INT_PTR)GetStockObject(NULL_BRUSH);
}
break;
@@ -389,7 +389,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (i=0;i<dat->pageCount;i++) {
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
if (dat->opd[i].hwnd != NULL)
- SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
break;
}
@@ -397,10 +397,10 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
char *szProto;
if (dat->hContact != NULL) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)dat->hContact,0);
- if (szProto == NULL) {EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE); break;}
- if (CallProtoService(szProto,PS_GETSTATUS,0,0)<ID_STATUS_ONLINE) EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE);
- else EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),!IsWindowVisible(GetDlgItem(hwndDlg,IDC_UPDATING)));
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
+ if (szProto == NULL) {EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE); break;}
+ if (CallProtoService(szProto, PS_GETSTATUS, 0, 0)<ID_STATUS_ONLINE) EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
+ else EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), !IsWindowVisible(GetDlgItem(hwndDlg, IDC_UPDATING)));
}
break;
}
@@ -410,17 +410,17 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP int i;
if (ack->hContact == NULL && ack->type == ACKTYPE_STATUS) {
- SendMessage(hwndDlg,M_CHECKONLINE,0,0);
+ SendMessage(hwndDlg, M_CHECKONLINE, 0, 0);
break;
}
if (ack->hContact != dat->hContact) break;
if (ack->type != ACKTYPE_GETINFO) break;
- SendMessage(hwndDlg,PSM_FORCECHANGED,0,0);
+ SendMessage(hwndDlg, PSM_FORCECHANGED, 0, 0);
/* if they're not gonna send any more ACK's don't let that mean we should crash */
if (!ack->hProcess && !ack->lParam) {
- ShowWindow(GetDlgItem(hwndDlg,IDC_UPDATING),SW_HIDE);
- KillTimer(hwndDlg,1);
- SendMessage(hwndDlg,M_CHECKONLINE,0,0);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_UPDATING), SW_HIDE);
+ KillTimer(hwndDlg, 1);
+ SendMessage(hwndDlg, M_CHECKONLINE, 0, 0);
break;
} //if
if (dat->infosUpdated == NULL) dat->infosUpdated=(int*)mir_calloc(sizeof(int)*(INT_PTR)ack->hProcess);
@@ -428,9 +428,9 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (i=0;i<(int)ack->hProcess;i++)
if (dat->infosUpdated[i] == 0) break;
if (i == (int)ack->hProcess) {
- ShowWindow(GetDlgItem(hwndDlg,IDC_UPDATING),SW_HIDE);
- KillTimer(hwndDlg,1);
- SendMessage(hwndDlg,M_CHECKONLINE,0,0);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_UPDATING), SW_HIDE);
+ KillTimer(hwndDlg, 1);
+ SendMessage(hwndDlg, M_CHECKONLINE, 0, 0);
} }
break;
@@ -470,10 +470,10 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &tie);
dat->currentPage = tie.lParam;
- tvi.hItem = TreeView_GetNextItem(GetDlgItem(hwndDlg,IDC_PAGETREE), NULL, TVGN_CARET);
+ tvi.hItem = TreeView_GetNextItem(GetDlgItem(hwndDlg, IDC_PAGETREE), NULL, TVGN_CARET);
tvi.mask = TVIF_PARAM;
tvi.lParam = dat->currentPage;
- TreeView_SetItem(GetDlgItem(hwndDlg,IDC_PAGETREE), &tvi);
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
if (dat->currentPage != -1)
{
@@ -520,7 +520,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (i=0;i<dat->pageCount;i++) {
if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn);
+ SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
}
DestroyWindow(hwndDlg);
break;
@@ -534,7 +534,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat->currentPage != -1) {
pshn.hdr.code=PSN_KILLACTIVE;
pshn.hdr.hwndFrom=dat->opd[dat->currentPage].hwnd;
- if (SendMessage(dat->opd[dat->currentPage].hwnd,WM_NOTIFY,0,(LPARAM)&pshn))
+ if (SendMessage(dat->opd[dat->currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
break;
}
@@ -542,11 +542,11 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (i=0;i<dat->pageCount;i++) {
if (dat->opd[i].hwnd == NULL || !dat->opd[i].changed) continue;
pshn.hdr.hwndFrom=dat->opd[i].hwnd;
- if (SendMessage(dat->opd[i].hwnd,WM_NOTIFY,0,(LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
- TreeView_Select(GetDlgItem(hwndDlg,IDC_PAGETREE), dat->opd[i].hItem, TVGN_CARET);
- if (dat->currentPage != -1) ShowWindow(dat->opd[dat->currentPage].hwnd,SW_HIDE);
+ if (SendMessage(dat->opd[i].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
+ TreeView_Select(GetDlgItem(hwndDlg, IDC_PAGETREE), dat->opd[i].hItem, TVGN_CARET);
+ if (dat->currentPage != -1) ShowWindow(dat->opd[dat->currentPage].hwnd, SW_HIDE);
dat->currentPage=i;
- ShowWindow(dat->opd[dat->currentPage].hwnd,SW_SHOW);
+ ShowWindow(dat->opd[dat->currentPage].hwnd, SW_SHOW);
return 0;
}
}
@@ -556,10 +556,10 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_UPDATE:
if (dat->infosUpdated != NULL) {mir_free(dat->infosUpdated); dat->infosUpdated=NULL;}
if (dat->hContact != NULL) {
- if (!CallContactService(dat->hContact,PSS_GETINFO,0,0)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_UPDATE),FALSE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_UPDATING),SW_SHOW);
- SetTimer(hwndDlg,1,100,NULL);
+ if (!CallContactService(dat->hContact, PSS_GETINFO, 0, 0)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_UPDATING), SW_SHOW);
+ SetTimer(hwndDlg, 1, 100, NULL);
}
}
break;
@@ -567,7 +567,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_CLOSE:
- SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)GetDlgItem(hwndDlg,IDOK));
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDOK));
break;
case WM_DESTROY:
@@ -579,12 +579,12 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP tvi.pszText=name;
tvi.cchTextMax=SIZEOF(name);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
- DBWriteContactSettingTString(NULL,"UserInfo","LastTab", name);
+ DBWriteContactSettingTString(NULL, "UserInfo", "LastTab", name);
}
Window_FreeIcon_IcoLib(hwndDlg);
- SendDlgItemMessage(hwndDlg,IDC_NAME,WM_SETFONT,SendDlgItemMessage(hwndDlg,IDC_WHITERECT,WM_GETFONT,0,0),0);
+ SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_WHITERECT, WM_GETFONT, 0, 0), 0);
DeleteObject(dat->hBoldFont);
- WindowList_Remove(hWindowList,hwndDlg);
+ WindowList_Remove(hWindowList, hwndDlg);
UnhookEvent(dat->hProtoAckEvent);
{ int i;
for (i=0;i<dat->pageCount;i++)
@@ -604,7 +604,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP int ShutdownUserInfo(WPARAM, LPARAM)
{
- WindowList_BroadcastAsync(hWindowList,WM_DESTROY,0,0);
+ WindowList_BroadcastAsync(hWindowList, WM_DESTROY, 0, 0);
return 0;
}
@@ -612,12 +612,12 @@ int LoadUserInfoModule(void) {
CLISTMENUITEM mi = { 0 };
- CreateServiceFunction(MS_USERINFO_SHOWDIALOG,ShowDetailsDialogCommand);
+ CreateServiceFunction(MS_USERINFO_SHOWDIALOG, ShowDetailsDialogCommand);
hDetailsInitEvent=CreateHookableEvent(ME_USERINFO_INITIALISE);
- HookEvent(ME_USERINFO_INITIALISE,DetailsInit);
- HookEvent(ME_DB_CONTACT_DELETED,UserInfoContactDelete);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,ShutdownUserInfo);
- CreateServiceFunction(MS_USERINFO_ADDPAGE,AddDetailsPage);
+ HookEvent(ME_USERINFO_INITIALISE, DetailsInit);
+ HookEvent(ME_DB_CONTACT_DELETED, UserInfoContactDelete);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownUserInfo);
+ CreateServiceFunction(MS_USERINFO_ADDPAGE, AddDetailsPage);
mi.cbSize = sizeof(mi);
mi.flags = CMIF_ICONFROMICOLIB;
@@ -625,12 +625,12 @@ int LoadUserInfoModule(void) mi.icolibItem = GetSkinIconHandle( SKINICON_OTHER_USERDETAILS );
mi.pszName = LPGEN("User &Details");
mi.pszService = MS_USERINFO_SHOWDIALOG;
- CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi);
+ Menu_AddContactMenuItem(&mi);
mi.position = 500050000;
mi.pszName = LPGEN("View/Change My &Details...");
- CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
+ Menu_AddMainMenuItem(&mi);
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
+ hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
return 0;
}
diff --git a/src/modules/useronline/useronline.cpp b/src/modules/useronline/useronline.cpp index 5fec748a17..c3a4562ae4 100644 --- a/src/modules/useronline/useronline.cpp +++ b/src/modules/useronline/useronline.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.
@@ -24,24 +24,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int uniqueEventId=0;
-static int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam)
+static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- int newStatus,oldStatus;
+ int newStatus, oldStatus;
- if ((HANDLE)wParam == NULL || strcmp(cws->szSetting,"Status")) return 0;
+ if ((HANDLE)wParam == NULL || strcmp(cws->szSetting, "Status")) return 0;
newStatus=cws->value.wVal;
- oldStatus=DBGetContactSettingWord((HANDLE)wParam,"UserOnline","OldStatus",ID_STATUS_OFFLINE);
- DBWriteContactSettingWord((HANDLE)wParam,"UserOnline","OldStatus",(WORD)newStatus);
- if (CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE)) return 0;
- if (DBGetContactSettingByte((HANDLE)wParam,"CList","Hidden",0)) return 0;
+ oldStatus=DBGetContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
+ DBWriteContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", (WORD)newStatus);
+ if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0;
+ if (DBGetContactSettingByte((HANDLE)wParam, "CList", "Hidden", 0)) return 0;
if (newStatus == ID_STATUS_OFFLINE&&oldStatus != ID_STATUS_OFFLINE) {
// Remove the event from the queue if it exists since they are now offline
- int lastEvent = (int)DBGetContactSettingDword((HANDLE)wParam,"UserOnline","LastEvent",0);
+ int lastEvent = (int)DBGetContactSettingDword((HANDLE)wParam, "UserOnline", "LastEvent", 0);
if (lastEvent) {
- CallService(MS_CLIST_REMOVEEVENT,wParam,(LPARAM)lastEvent);
- DBWriteContactSettingDword((HANDLE)wParam,"UserOnline", "LastEvent", 0);
+ CallService(MS_CLIST_REMOVEEVENT, wParam, (LPARAM)lastEvent);
+ DBWriteContactSettingDword((HANDLE)wParam, "UserOnline", "LastEvent", 0);
}
}
if ((newStatus == ID_STATUS_ONLINE || newStatus == ID_STATUS_FREECHAT) &&
@@ -53,18 +53,18 @@ static int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam) CLISTEVENT cle;
TCHAR tooltip[256];
- ZeroMemory(&cle,sizeof(cle));
+ ZeroMemory(&cle, sizeof(cle));
cle.cbSize=sizeof(cle);
cle.flags=CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact=(HANDLE)wParam;
cle.hDbEvent=(HANDLE)(uniqueEventId++);
cle.hIcon = LoadSkinIcon( SKINICON_OTHER_USERONLINE, false );
cle.pszService="UserOnline/Description";
- mir_sntprintf(tooltip,SIZEOF(tooltip),TranslateT("%s is Online"), cli.pfnGetContactDisplayName(( HANDLE )wParam, 0 ));
+ mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is Online"), cli.pfnGetContactDisplayName(( HANDLE )wParam, 0 ));
cle.ptszTooltip=tooltip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
IconLib_ReleaseIcon( cle.hIcon, 0 );
- DBWriteContactSettingDword(cle.hContact,"UserOnline", "LastEvent", (DWORD)cle.hDbEvent);
+ DBWriteContactSettingDword(cle.hContact, "UserOnline", "LastEvent", (DWORD)cle.hDbEvent);
SkinPlaySound("UserOnline");
}
}
@@ -108,10 +108,10 @@ static int UserOnlineAccountsChanged( WPARAM eventCode, LPARAM lParam ) int LoadUserOnlineModule(void)
{
- HookEvent(ME_DB_CONTACT_SETTINGCHANGED,UserOnlineSettingChanged);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UserOnlineSettingChanged);
HookEvent(ME_PROTO_ACK, UserOnlineAck);
HookEvent(ME_SYSTEM_MODULESLOADED, UserOnlineModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, UserOnlineAccountsChanged);
- SkinAddNewSoundEx("UserOnline","Alerts","Online");
+ SkinAddNewSoundEx("UserOnline", "Alerts", "Online");
return 0;
}
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp index 1ea930baf9..5dbf37b12f 100644 --- a/src/modules/utils/bmpfilter.cpp +++ b/src/modules/utils/bmpfilter.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.
@@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR sttBitmapLoader( const TCHAR* ptszFileName )
{
IPicture *pic;
- HBITMAP hBmp,hBmpCopy;
+ HBITMAP hBmp, hBmpCopy;
HBITMAP hOldBitmap, hOldBitmap2;
BITMAP bmpInfo;
- HDC hdc,hdcMem1,hdcMem2;
+ HDC hdc, hdcMem1, hdcMem2;
short picType;
TCHAR szFilename[MAX_PATH];
@@ -103,21 +103,21 @@ static INT_PTR sttBitmapLoader( const TCHAR* ptszFileName ) OLE_HANDLE hOleBmp;
pic->get_Handle(&hOleBmp);
hBmp = (HBITMAP)hOleBmp;
- GetObject(hBmp,sizeof(bmpInfo),&bmpInfo);
+ GetObject(hBmp, sizeof(bmpInfo), &bmpInfo);
//need to copy bitmap so we can free the IPicture
hdc=GetDC(NULL);
hdcMem1=CreateCompatibleDC(hdc);
hdcMem2=CreateCompatibleDC(hdc);
- hOldBitmap=( HBITMAP )SelectObject(hdcMem1,hBmp);
- hBmpCopy=CreateCompatibleBitmap(hdcMem1,bmpInfo.bmWidth,bmpInfo.bmHeight);
- hOldBitmap2=( HBITMAP )SelectObject(hdcMem2,hBmpCopy);
- BitBlt(hdcMem2,0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,hdcMem1,0,0,SRCCOPY);
- SelectObject(hdcMem1,hOldBitmap);
- SelectObject(hdcMem2,hOldBitmap2);
+ hOldBitmap=( HBITMAP )SelectObject(hdcMem1, hBmp);
+ hBmpCopy=CreateCompatibleBitmap(hdcMem1, bmpInfo.bmWidth, bmpInfo.bmHeight);
+ hOldBitmap2=( HBITMAP )SelectObject(hdcMem2, hBmpCopy);
+ BitBlt(hdcMem2, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, hdcMem1, 0, 0, SRCCOPY);
+ SelectObject(hdcMem1, hOldBitmap);
+ SelectObject(hdcMem2, hOldBitmap2);
DeleteDC(hdcMem2);
DeleteDC(hdcMem1);
- ReleaseDC(NULL,hdc);
+ ReleaseDC(NULL, hdc);
DeleteObject(hBmp);
pic->Release();
@@ -138,45 +138,45 @@ static INT_PTR BmpFilterLoadBitmapW(WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR BmpFilterGetStrings(WPARAM wParam,LPARAM lParam)
+static INT_PTR BmpFilterGetStrings(WPARAM wParam, LPARAM lParam)
{
int bytesLeft=wParam;
- char *filter=(char*)lParam,*pfilter;
+ char *filter=(char*)lParam, *pfilter;
- lstrcpynA(filter,Translate("All Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(filter);
- strncat(filter," (*.bmp;*.jpg;*.gif;*.png)",bytesLeft);
+ lstrcpynA(filter, Translate("All Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(filter);
+ strncat(filter, " (*.bmp;*.jpg;*.gif;*.png)", bytesLeft);
pfilter=filter+lstrlenA(filter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,"*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG",bytesLeft);
+ lstrcpynA(pfilter, "*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,Translate("Windows Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter);
- strncat(pfilter," (*.bmp;*.rle)",bytesLeft);
+ lstrcpynA(pfilter, Translate("Windows Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ strncat(pfilter, " (*.bmp;*.rle)", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,"*.BMP;*.RLE",bytesLeft);
+ lstrcpynA(pfilter, "*.BMP;*.RLE", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,Translate("JPEG Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter);
- strncat(pfilter," (*.jpg;*.jpeg)",bytesLeft);
+ lstrcpynA(pfilter, Translate("JPEG Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ strncat(pfilter, " (*.jpg;*.jpeg)", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,"*.JPG;*.JPEG",bytesLeft);
+ lstrcpynA(pfilter, "*.JPG;*.JPEG", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,Translate("GIF Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter);
- strncat(pfilter," (*.gif)",bytesLeft);
+ lstrcpynA(pfilter, Translate("GIF Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ strncat(pfilter, " (*.gif)", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,"*.GIF",bytesLeft);
+ lstrcpynA(pfilter, "*.GIF", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,Translate("PNG Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter);
- strncat(pfilter," (*.png)",bytesLeft);
+ lstrcpynA(pfilter, Translate("PNG Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ strncat(pfilter, " (*.png)", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,"*.PNG",bytesLeft);
+ lstrcpynA(pfilter, "*.PNG", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,Translate("All Files"),bytesLeft); bytesLeft-=lstrlenA(pfilter);
- strncat(pfilter," (*)",bytesLeft);
+ lstrcpynA(pfilter, Translate("All Files"), bytesLeft); bytesLeft-=lstrlenA(pfilter);
+ strncat(pfilter, " (*)", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpynA(pfilter,"*",bytesLeft);
+ lstrcpynA(pfilter, "*", bytesLeft);
pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
if (bytesLeft) *pfilter='\0';
@@ -184,45 +184,45 @@ static INT_PTR BmpFilterGetStrings(WPARAM wParam,LPARAM lParam) }
#if defined( _UNICODE )
-static INT_PTR BmpFilterGetStringsW(WPARAM wParam,LPARAM lParam)
+static INT_PTR BmpFilterGetStringsW(WPARAM wParam, LPARAM lParam)
{
int bytesLeft=wParam;
- TCHAR *filter=(TCHAR*)lParam,*pfilter;
+ TCHAR *filter=(TCHAR*)lParam, *pfilter;
- lstrcpyn(filter,TranslateT("All Bitmaps"),bytesLeft); bytesLeft-=lstrlen(filter);
+ lstrcpyn(filter, TranslateT("All Bitmaps"), bytesLeft); bytesLeft-=lstrlen(filter);
_tcsncat(filter, _T(" (*.bmp;*.jpg;*.gif;*.png)"), bytesLeft );
pfilter=filter+lstrlen(filter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,_T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"),bytesLeft);
+ lstrcpyn(pfilter, _T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,TranslateT("Windows Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter);
- _tcsncat(pfilter,_T(" (*.bmp;*.rle)"),bytesLeft);
+ lstrcpyn(pfilter, TranslateT("Windows Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ _tcsncat(pfilter, _T(" (*.bmp;*.rle)"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,_T("*.BMP;*.RLE"),bytesLeft);
+ lstrcpyn(pfilter, _T("*.BMP;*.RLE"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,TranslateT("JPEG Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter);
- _tcsncat(pfilter,_T(" (*.jpg;*.jpeg)"),bytesLeft);
+ lstrcpyn(pfilter, TranslateT("JPEG Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ _tcsncat(pfilter, _T(" (*.jpg;*.jpeg)"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,_T("*.JPG;*.JPEG"),bytesLeft);
+ lstrcpyn(pfilter, _T("*.JPG;*.JPEG"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,TranslateT("GIF Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter);
- _tcsncat(pfilter,_T(" (*.gif)"),bytesLeft);
+ lstrcpyn(pfilter, TranslateT("GIF Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ _tcsncat(pfilter, _T(" (*.gif)"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,_T("*.GIF"),bytesLeft);
+ lstrcpyn(pfilter, _T("*.GIF"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,TranslateT("PNG Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter);
- _tcsncat(pfilter,_T(" (*.png)"),bytesLeft);
+ lstrcpyn(pfilter, TranslateT("PNG Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ _tcsncat(pfilter, _T(" (*.png)"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,_T("*.PNG"),bytesLeft);
+ lstrcpyn(pfilter, _T("*.PNG"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,TranslateT("All Files"),bytesLeft); bytesLeft-=lstrlen(pfilter);
- _tcsncat(pfilter,_T(" (*)"),bytesLeft);
+ lstrcpyn(pfilter, TranslateT("All Files"), bytesLeft); bytesLeft-=lstrlen(pfilter);
+ _tcsncat(pfilter, _T(" (*)"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
- lstrcpyn(pfilter,_T("*"),bytesLeft);
+ lstrcpyn(pfilter, _T("*"), bytesLeft);
pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter);
if (bytesLeft) *pfilter='\0';
@@ -232,11 +232,11 @@ static INT_PTR BmpFilterGetStringsW(WPARAM wParam,LPARAM lParam) int InitBitmapFilter(void)
{
- CreateServiceFunction(MS_UTILS_LOADBITMAP,BmpFilterLoadBitmap);
- CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGS,BmpFilterGetStrings);
+ CreateServiceFunction(MS_UTILS_LOADBITMAP, BmpFilterLoadBitmap);
+ CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGS, BmpFilterGetStrings);
#if defined( _UNICODE )
- CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGSW,BmpFilterGetStringsW);
- CreateServiceFunction(MS_UTILS_LOADBITMAPW,BmpFilterLoadBitmapW);
+ CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGSW, BmpFilterGetStringsW);
+ CreateServiceFunction(MS_UTILS_LOADBITMAPW, BmpFilterLoadBitmapW);
#endif
return 0;
}
diff --git a/src/modules/utils/colourpicker.cpp b/src/modules/utils/colourpicker.cpp index 29d25a175f..731f61f1e1 100644 --- a/src/modules/utils/colourpicker.cpp +++ b/src/modules/utils/colourpicker.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.
@@ -22,44 +22,44 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "..\..\core\commonheaders.h"
-static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_CREATE:
- SetWindowLongPtr(hwnd,0,0);
- SetWindowLongPtr(hwnd,sizeof(COLORREF),0);
+ SetWindowLongPtr(hwnd, 0, 0);
+ SetWindowLongPtr(hwnd, sizeof(COLORREF), 0);
break;
case CPM_SETDEFAULTCOLOUR:
- SetWindowLongPtr(hwnd,sizeof(COLORREF),lParam);
+ SetWindowLongPtr(hwnd, sizeof(COLORREF), lParam);
break;
case CPM_GETDEFAULTCOLOUR:
- return GetWindowLongPtr(hwnd,sizeof(COLORREF));
+ return GetWindowLongPtr(hwnd, sizeof(COLORREF));
case CPM_SETCOLOUR:
- SetWindowLongPtr(hwnd,0,lParam);
- InvalidateRect(hwnd,NULL,FALSE);
+ SetWindowLongPtr(hwnd, 0, lParam);
+ InvalidateRect(hwnd, NULL, FALSE);
break;
case CPM_GETCOLOUR:
- return GetWindowLongPtr(hwnd,0);
+ return GetWindowLongPtr(hwnd, 0);
case WM_LBUTTONUP:
{
CHOOSECOLOR cc={0};
COLORREF custColours[16]={0};
- custColours[0]=GetWindowLongPtr(hwnd,sizeof(COLORREF));
+ custColours[0]=GetWindowLongPtr(hwnd, sizeof(COLORREF));
cc.lStructSize=sizeof(CHOOSECOLOR);
cc.hwndOwner=hwnd;
cc.hInstance=(HWND)hMirandaInst;
- cc.rgbResult=GetWindowLongPtr(hwnd,0);
+ cc.rgbResult=GetWindowLongPtr(hwnd, 0);
cc.lpCustColors=custColours;
cc.Flags=CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
if (ChooseColor(&cc)) {
- SetWindowLongPtr(hwnd,0,cc.rgbResult);
- SendMessage(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(hwnd),CPN_COLOURCHANGED),(LPARAM)hwnd);
- InvalidateRect(hwnd,NULL,FALSE);
+ SetWindowLongPtr(hwnd, 0, cc.rgbResult);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), CPN_COLOURCHANGED), (LPARAM)hwnd);
+ InvalidateRect(hwnd, NULL, FALSE);
}
break;
}
case WM_ENABLE:
- InvalidateRect(hwnd,NULL,FALSE);
+ InvalidateRect(hwnd, NULL, FALSE);
break;
case WM_NCPAINT:
case WM_PAINT:
@@ -68,24 +68,24 @@ static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd,UINT message,WPARAM wParam RECT rc;
HBRUSH hBrush;
- hdc1=BeginPaint(hwnd,&ps);
- GetClientRect(hwnd,&rc);
- DrawEdge(hdc1,&rc,EDGE_ETCHED,BF_RECT);
- InflateRect(&rc,-2,-2);
+ hdc1=BeginPaint(hwnd, &ps);
+ GetClientRect(hwnd, &rc);
+ DrawEdge(hdc1, &rc, EDGE_ETCHED, BF_RECT);
+ InflateRect(&rc, -2, -2);
if (IsWindowEnabled(hwnd))
- hBrush=CreateSolidBrush(GetWindowLongPtr(hwnd,0));
+ hBrush=CreateSolidBrush(GetWindowLongPtr(hwnd, 0));
else
- hBrush=CreateHatchBrush(HS_BDIAGONAL,GetSysColor(COLOR_GRAYTEXT));
- SetBkColor(hdc1,GetSysColor(COLOR_BTNFACE));
- FillRect(hdc1,&rc,hBrush);
+ hBrush=CreateHatchBrush(HS_BDIAGONAL, GetSysColor(COLOR_GRAYTEXT));
+ SetBkColor(hdc1, GetSysColor(COLOR_BTNFACE));
+ FillRect(hdc1, &rc, hBrush);
DeleteObject(hBrush);
- EndPaint(hwnd,&ps);
+ EndPaint(hwnd, &ps);
break;
}
case WM_DESTROY:
break;
}
- return DefWindowProc(hwnd,message,wParam,lParam);
+ return DefWindowProc(hwnd, message, wParam, lParam);
}
int InitColourPicker(void)
diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp index 8100fe1f48..bde00a35ef 100644 --- a/src/modules/utils/hyperlink.cpp +++ b/src/modules/utils/hyperlink.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.
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h"
struct HyperlinkWndData {
- HFONT hEnableFont,hDisableFont;
+ HFONT hEnableFont, hDisableFont;
RECT rcText;
COLORREF enableColor, disableColor, focusColor;
BYTE flags; /* see HLKF_* */
@@ -37,18 +37,18 @@ struct HyperlinkWndData { #define HLK_MEASURETEXT (WM_USER+1)
#define HLK_INVALIDATE (WM_USER+2)
-static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct HyperlinkWndData *dat=(struct HyperlinkWndData*)GetWindowLongPtr(hwnd,0);
+ struct HyperlinkWndData *dat=(struct HyperlinkWndData*)GetWindowLongPtr(hwnd, 0);
switch(msg) {
case WM_NCCREATE:
dat=(struct HyperlinkWndData*)mir_calloc(sizeof(struct HyperlinkWndData));
if (dat == NULL) return FALSE; /* fail creation */
- SetWindowLongPtr(hwnd,0,(LONG_PTR)dat); /* always succeeds */
+ SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat); /* always succeeds */
/* fall thru */
case WM_SYSCOLORCHANGE:
if (!(dat->flags&HLKF_HASENABLECOLOR)) {
- if (GetSysColorBrush(COLOR_HOTLIGHT) == NULL) dat->enableColor=RGB(0,0,255);
+ if (GetSysColorBrush(COLOR_HOTLIGHT) == NULL) dat->enableColor=RGB(0, 0, 255);
else dat->enableColor=GetSysColor(COLOR_HOTLIGHT);
dat->focusColor = RGB(GetRValue(dat->enableColor) / 2, GetGValue(dat->enableColor) / 2, GetBValue(dat->enableColor) / 2);
}
@@ -92,7 +92,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
case VK_SPACE:
case VK_RETURN:
- SendMessage(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(hwnd),STN_CLICKED),(LPARAM)hwnd);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), STN_CLICKED), (LPARAM)hwnd);
break;
}
return 0;
@@ -100,9 +100,9 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case WM_LBUTTONDOWN:
{ POINT pt;
- POINTSTOPOINT(pt,MAKEPOINTS(lParam));
- if (!PtInRect(&dat->rcText,pt)) break;
- SendMessage(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(hwnd),STN_CLICKED),(LPARAM)hwnd);
+ POINTSTOPOINT(pt, MAKEPOINTS(lParam));
+ if (!PtInRect(&dat->rcText, pt)) break;
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), STN_CLICKED), (LPARAM)hwnd);
return 0;
}
case WM_SETFONT:
@@ -112,14 +112,14 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM dat->hEnableFont=dat->hDisableFont=NULL;
return 0;
}
- if (GetObject((HFONT)wParam,sizeof(lf),&lf)) {
+ if (GetObject((HFONT)wParam, sizeof(lf), &lf)) {
lf.lfUnderline=1;
hFont=CreateFontIndirect(&lf);
if (hFont != NULL) {
dat->hEnableFont=hFont;
dat->hDisableFont=(HFONT)wParam;
- if (LOWORD(lParam)) SendMessage(hwnd,HLK_INVALIDATE,0,0);
- SendMessage(hwnd,HLK_MEASURETEXT,0,0);
+ if (LOWORD(lParam)) SendMessage(hwnd, HLK_INVALIDATE, 0, 0);
+ SendMessage(hwnd, HLK_MEASURETEXT, 0, 0);
}
}
return 0;
@@ -131,17 +131,17 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM { RECT rcWnd;
POINT pt;
HWND hwndParent;
- if (!GetWindowRect(hwnd,&rcWnd)) break;
+ if (!GetWindowRect(hwnd, &rcWnd)) break;
pt.x=rcWnd.left;
pt.y=rcWnd.top;
hwndParent=GetParent(hwnd);
if (hwndParent == NULL) hwndParent=hwnd;
- if (!ScreenToClient(hwndParent,&pt)) break;
+ if (!ScreenToClient(hwndParent, &pt)) break;
rcWnd.right=pt.x+(rcWnd.right-rcWnd.left);
rcWnd.bottom=pt.y+(rcWnd.bottom-rcWnd.top);
rcWnd.left=pt.x;
rcWnd.top=pt.y;
- InvalidateRect(hwndParent,&rcWnd,TRUE);
+ InvalidateRect(hwndParent, &rcWnd, TRUE);
return 0;
}
case WM_GETFONT:
@@ -149,7 +149,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case WM_CREATE:
case HLK_MEASURETEXT:
{ TCHAR szText[256];
- if (!GetWindowText(hwnd,szText,SIZEOF(szText))) return 0;
+ if (!GetWindowText(hwnd, szText, SIZEOF(szText))) return 0;
lParam=(LPARAM)szText;
/* fall thru */
case WM_SETTEXT:
@@ -161,35 +161,35 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM BOOL fMeasured=FALSE;
hdc=GetDC(hwnd);
if (hdc == NULL) return 0; /* text change failed */
- if (dat->hEnableFont != NULL) hPrevFont=(HFONT)SelectObject(hdc,dat->hEnableFont);
+ if (dat->hEnableFont != NULL) hPrevFont=(HFONT)SelectObject(hdc, dat->hEnableFont);
if (dat->hEnableFont == NULL || hPrevFont != NULL) /* select failed? */
- if (GetTextExtentPoint32(hdc,(TCHAR*)lParam,lstrlen((TCHAR*)lParam),&textSize))
- if (GetClientRect(hwnd,&rc)) {
+ if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, lstrlen((TCHAR*)lParam), &textSize))
+ if (GetClientRect(hwnd, &rc)) {
dat->rcText.top=0;
dat->rcText.bottom=dat->rcText.top+textSize.cy;
- style=GetWindowLongPtr(hwnd,GWL_STYLE);
+ style=GetWindowLongPtr(hwnd, GWL_STYLE);
if (style&SS_CENTER) dat->rcText.left=(rc.right-textSize.cx)/2;
else if (style&SS_RIGHT) dat->rcText.left=rc.right-textSize.cx;
else dat->rcText.left=0;
dat->rcText.right=dat->rcText.left+textSize.cx;
fMeasured=TRUE;
}
- if (dat->hEnableFont != NULL && hPrevFont != NULL) SelectObject(hdc,hPrevFont);
- ReleaseDC(hwnd,hdc);
+ if (dat->hEnableFont != NULL && hPrevFont != NULL) SelectObject(hdc, hPrevFont);
+ ReleaseDC(hwnd, hdc);
if (!fMeasured) return 0; /* text change failed */
- SendMessage(hwnd,HLK_INVALIDATE,0,0);
+ SendMessage(hwnd, HLK_INVALIDATE, 0, 0);
break;
}}
case WM_SETCURSOR:
{ POINT pt;
HCURSOR hCursor;
if (!GetCursorPos(&pt)) return FALSE;
- if (!ScreenToClient(hwnd,&pt)) return FALSE;
- if (PtInRect(&dat->rcText,pt)) {
- hCursor=(HCURSOR)GetClassLongPtr(hwnd,GCLP_HCURSOR);
- if (hCursor == NULL) hCursor=LoadCursor(NULL,IDC_HAND); /* Win2000+ */
+ if (!ScreenToClient(hwnd, &pt)) return FALSE;
+ if (PtInRect(&dat->rcText, pt)) {
+ hCursor=(HCURSOR)GetClassLongPtr(hwnd, GCLP_HCURSOR);
+ if (hCursor == NULL) hCursor=LoadCursor(NULL, IDC_HAND); /* Win2000+ */
}
- else hCursor=LoadCursor(NULL,IDC_ARROW);
+ else hCursor=LoadCursor(NULL, IDC_ARROW);
SetCursor(hCursor);
return TRUE;
}
@@ -217,16 +217,16 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM PAINTSTRUCT ps;
HDC hdc;
- hdc=BeginPaint(hwnd,&ps);
+ hdc=BeginPaint(hwnd, &ps);
if (hdc != NULL) {
if (IsWindowEnabled(hwnd)) {
- hPrevFont=(HFONT)SelectObject(hdc,dat->hEnableFont);
+ hPrevFont=(HFONT)SelectObject(hdc, dat->hEnableFont);
textColor = (GetFocus() == hwnd) ? dat->focusColor : dat->enableColor;
} else {
- hPrevFont=(HFONT)SelectObject(hdc,dat->hDisableFont);
+ hPrevFont=(HFONT)SelectObject(hdc, dat->hDisableFont);
textColor=dat->disableColor;
}
- if (GetClientRect(hwnd,&rc) && GetWindowText(hwnd,szText,SIZEOF(szText))) {
+ if (GetClientRect(hwnd, &rc) && GetWindowText(hwnd, szText, SIZEOF(szText))) {
if (drawThemeParentBackground && IsWinVerXPPlus())
{
BOOL fSmoothing;
@@ -236,13 +236,13 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM if (fSmoothing && fSmoothingType == FE_FONTSMOOTHINGCLEARTYPE)
drawThemeParentBackground(hwnd, hdc, &rc);
}
- SetBkMode(hdc,TRANSPARENT);
- SetTextColor(hdc,textColor);
- alignFlag=(GetWindowLongPtr(hwnd,GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT));
- DrawText(hdc,szText,-1,&rc,alignFlag|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
+ SetBkMode(hdc, TRANSPARENT);
+ SetTextColor(hdc, textColor);
+ alignFlag=(GetWindowLongPtr(hwnd, GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT));
+ DrawText(hdc, szText, -1, &rc, alignFlag|DT_NOPREFIX|DT_SINGLELINE|DT_TOP);
}
- if (hPrevFont != NULL) SelectObject(hdc,hPrevFont);
- EndPaint(hwnd,&ps);
+ if (hPrevFont != NULL) SelectObject(hdc, hPrevFont);
+ EndPaint(hwnd, &ps);
}
return 0;
}
@@ -251,7 +251,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM mir_free(dat);
break;
}
- return DefWindowProc(hwnd,msg,wParam,lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
}
int InitHyperlink(void)
@@ -263,7 +263,7 @@ int InitHyperlink(void) wcl.cbWndExtra=sizeof(struct HyperlinkWndData*);
wcl.hInstance=hMirandaInst;
if (IsWinVer2000Plus()) wcl.hCursor=NULL;
- else wcl.hCursor=LoadCursor(wcl.hInstance,MAKEINTRESOURCE(IDC_HYPERLINKHAND));
+ else wcl.hCursor=LoadCursor(wcl.hInstance, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
wcl.lpszClassName=WNDCLASS_HYPERLINK;
wcl.hbrBackground=NULL;
wcl.hIcon=NULL;
diff --git a/src/modules/utils/imgconv.cpp b/src/modules/utils/imgconv.cpp index 431ae3343d..118ffc3acb 100644 --- a/src/modules/utils/imgconv.cpp +++ b/src/modules/utils/imgconv.cpp @@ -10,7 +10,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.
diff --git a/src/modules/utils/md5.cpp b/src/modules/utils/md5.cpp index 3fb835abdd..241aa2270f 100644 --- a/src/modules/utils/md5.cpp +++ b/src/modules/utils/md5.cpp @@ -5,7 +5,7 @@ warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
- Permission is granted to anyone to use this software for any purpose,
+ Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
@@ -126,7 +126,7 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]*/)
{
mir_md5_word_t
- a = pms->abcd[0], b = pms->abcd[1],
+ a = pms->abcd[0], b = pms->abcd[1],
c = pms->abcd[2], d = pms->abcd[3];
mir_md5_word_t t;
/* Define storage for little-endian or both types of CPUs. */
@@ -175,10 +175,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 1. */
/* Let [abcd k s i] denote the operation
- a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
+ a = b + ((a + F(b, c, d) + X[k] + T[i]) <<< s). */
#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
#define SET1(a, b, c, d, k, s, Ti)\
- t = a + F(b,c,d) + X[k] + Ti;\
+ t = a + F(b, c, d) + X[k] + Ti;\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET1(a, b, c, d, 0, 7, T1);
@@ -200,10 +200,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 2. */
/* Let [abcd k s i] denote the operation
- a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
+ a = b + ((a + G(b, c, d) + X[k] + T[i]) <<< s). */
#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
#define SET2(a, b, c, d, k, s, Ti)\
- t = a + G(b,c,d) + X[k] + Ti;\
+ t = a + G(b, c, d) + X[k] + Ti;\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET2(a, b, c, d, 1, 5, T17);
@@ -225,10 +225,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 3. */
/* Let [abcd k s t] denote the operation
- a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
+ a = b + ((a + H(b, c, d) + X[k] + T[i]) <<< s). */
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define SET3(a, b, c, d, k, s, Ti)\
- t = a + H(b,c,d) + X[k] + Ti;\
+ t = a + H(b, c, d) + X[k] + Ti;\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET3(a, b, c, d, 5, 4, T33);
@@ -250,10 +250,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 4. */
/* Let [abcd k s t] denote the operation
- a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
+ a = b + ((a + I(b, c, d) + X[k] + T[i]) <<< s). */
#define I(x, y, z) ((y) ^ ((x) | ~(z)))
#define SET4(a, b, c, d, k, s, Ti)\
- t = a + I(b,c,d) + X[k] + Ti;\
+ t = a + I(b, c, d) + X[k] + Ti;\
a = ROTATE_LEFT(t, s) + b
/* Do the following 16 operations. */
SET4(a, b, c, d, 0, 6, T49);
@@ -331,9 +331,9 @@ void md5_append(mir_md5_state_t *pms, const mir_md5_byte_t *data, int nbytes) void md5_finish(mir_md5_state_t *pms, mir_md5_byte_t digest[16])
{
static const mir_md5_byte_t pad[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
mir_md5_byte_t data[8];
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp index fb10c5f43c..46e95f954e 100644 --- a/src/modules/utils/openurl.cpp +++ b/src/modules/utils/openurl.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.
@@ -27,24 +27,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define WNDCLASS_DDEMSGWINDOW _T("MirandaDdeMsgWindow")
struct DdeMsgWindowData {
- int fAcked,fData;
+ int fAcked, fData;
HWND hwndDde;
};
-static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct DdeMsgWindowData *dat;
ATOM hSzItem;
HGLOBAL hDdeData;
- dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwnd,0);
+ dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwnd, 0);
switch(msg) {
case WM_DDE_ACK:
dat->fAcked=1;
dat->hwndDde=(HWND)wParam;
return 0;
case WM_DDE_DATA:
- UnpackDDElParam(msg,lParam,(PUINT_PTR)&hDdeData,(PUINT_PTR)&hSzItem);
+ UnpackDDElParam(msg, lParam, (PUINT_PTR)&hDdeData, (PUINT_PTR)&hSzItem);
dat->fData=1;
if (hDdeData) {
DDEDATA *data;
@@ -52,7 +52,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM data=(DDEDATA*)GlobalLock(hDdeData);
if (data->fAckReq) {
DDEACK ack={0};
- PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,PackDDElParam(WM_DDE_ACK,*(PUINT)&ack,(UINT)hSzItem));
+ PostMessage((HWND)wParam, WM_DDE_ACK, (WPARAM)hwnd, PackDDElParam(WM_DDE_ACK, *(PUINT)&ack, (UINT)hSzItem));
}
else GlobalDeleteAtom(hSzItem);
release=data->fRelease;
@@ -62,32 +62,32 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM else GlobalDeleteAtom(hSzItem);
return 0;
}
- return DefWindowProc(hwnd,msg,wParam,lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
}
-static int DoDdeRequest(const char *szItemName,HWND hwndDdeMsg)
+static int DoDdeRequest(const char *szItemName, HWND hwndDdeMsg)
{
ATOM hSzItemName;
- DWORD timeoutTick,thisTick;
+ DWORD timeoutTick, thisTick;
MSG msg;
- struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg,0);
+ struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg, 0);
hSzItemName=GlobalAddAtomA(szItemName);
- if (!PostMessage(dat->hwndDde,WM_DDE_REQUEST,(WPARAM)hwndDdeMsg,MAKELPARAM(CF_TEXT,hSzItemName))) {
+ if (!PostMessage(dat->hwndDde, WM_DDE_REQUEST, (WPARAM)hwndDdeMsg, MAKELPARAM(CF_TEXT, hSzItemName))) {
GlobalDeleteAtom(hSzItemName);
return 1;
}
timeoutTick=GetTickCount()+5000;
dat->fData=0; dat->fAcked=0;
do {
- if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (dat->fData || dat->fAcked) break;
thisTick=GetTickCount();
if (thisTick>timeoutTick) break;
- } while (MsgWaitForMultipleObjects(0,NULL,FALSE,timeoutTick-thisTick,QS_ALLINPUT) == WAIT_OBJECT_0);
+ } while (MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutTick-thisTick, QS_ALLINPUT) == WAIT_OBJECT_0);
if (!dat->fData) {
GlobalDeleteAtom(hSzItemName);
@@ -97,31 +97,31 @@ static int DoDdeRequest(const char *szItemName,HWND hwndDdeMsg) }
//see Q160957 and http://developer.netscape.com/docs/manuals/communicator/DDE/index.htm
-static int DdeOpenUrl(const char *szBrowser,char *szUrl,int newWindow,HWND hwndDdeMsg)
+static int DdeOpenUrl(const char *szBrowser, char *szUrl, int newWindow, HWND hwndDdeMsg)
{
- ATOM hSzBrowser,hSzTopic;
+ ATOM hSzBrowser, hSzTopic;
DWORD_PTR dwResult;
char *szItemName;
- struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg,0);
+ struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg, 0);
hSzBrowser=GlobalAddAtomA(szBrowser);
hSzTopic=GlobalAddAtomA("WWW_OpenURL");
dat->fAcked=0;
- if (!SendMessageTimeout(HWND_BROADCAST,WM_DDE_INITIATE,(WPARAM)hwndDdeMsg,MAKELPARAM(hSzBrowser,hSzTopic),SMTO_ABORTIFHUNG|SMTO_NORMAL,DDEMESSAGETIMEOUT,&dwResult)
+ if (!SendMessageTimeout(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndDdeMsg, MAKELPARAM(hSzBrowser, hSzTopic), SMTO_ABORTIFHUNG|SMTO_NORMAL, DDEMESSAGETIMEOUT, &dwResult)
|| !dat->fAcked) {
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
return 1;
}
szItemName=(char*)mir_alloc(lstrlenA(szUrl)+7);
- wsprintfA(szItemName,"\"%s\",,%d",szUrl,newWindow?0:-1);
- if (DoDdeRequest(szItemName,hwndDdeMsg)) {
+ wsprintfA(szItemName, "\"%s\", , %d", szUrl, newWindow?0:-1);
+ if (DoDdeRequest(szItemName, hwndDdeMsg)) {
mir_free(szItemName);
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
return 1;
}
- PostMessage(dat->hwndDde,WM_DDE_TERMINATE,(WPARAM)hwndDdeMsg,0);
+ PostMessage(dat->hwndDde, WM_DDE_TERMINATE, (WPARAM)hwndDdeMsg, 0);
GlobalDeleteAtom(hSzTopic);
GlobalDeleteAtom(hSzBrowser);
mir_free(szItemName);
@@ -147,25 +147,25 @@ static void OpenURLThread(void *arg) int success=0;
if (!hUrlInfo->szUrl) return;
- hwndDdeMsg=CreateWindow(WNDCLASS_DDEMSGWINDOW,_T(""),0,0,0,0,0,NULL,NULL,hMirandaInst,NULL);
- SetWindowLongPtr(hwndDdeMsg,0,(LONG_PTR)&msgWndData);
+ hwndDdeMsg=CreateWindow(WNDCLASS_DDEMSGWINDOW, _T(""), 0, 0, 0, 0, 0, NULL, NULL, hMirandaInst, NULL);
+ SetWindowLongPtr(hwndDdeMsg, 0, (LONG_PTR)&msgWndData);
- if (!_strnicmp(hUrlInfo->szUrl,"ftp:",4) || !_strnicmp(hUrlInfo->szUrl,"ftp.",4)) pszProtocol="ftp";
- if (!_strnicmp(hUrlInfo->szUrl,"mailto:",7)) pszProtocol="mailto";
- if (!_strnicmp(hUrlInfo->szUrl,"news:",5)) pszProtocol="news";
+ if (!_strnicmp(hUrlInfo->szUrl, "ftp:", 4) || !_strnicmp(hUrlInfo->szUrl, "ftp.", 4)) pszProtocol="ftp";
+ if (!_strnicmp(hUrlInfo->szUrl, "mailto:", 7)) pszProtocol="mailto";
+ if (!_strnicmp(hUrlInfo->szUrl, "news:", 5)) pszProtocol="news";
else pszProtocol="http";
- wsprintfA(szSubkey,"%s\\shell\\open\\command",pszProtocol);
- if (RegOpenKeyExA(HKEY_CURRENT_USER,szSubkey,0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS
- || RegOpenKeyExA(HKEY_CLASSES_ROOT,szSubkey,0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS) {
+ wsprintfA(szSubkey, "%s\\shell\\open\\command", pszProtocol);
+ if (RegOpenKeyExA(HKEY_CURRENT_USER, szSubkey, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS
+ || RegOpenKeyExA(HKEY_CLASSES_ROOT, szSubkey, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
dataLength=SIZEOF(szCommandName);
- if (RegQueryValueEx(hKey,NULL,NULL,NULL,(PBYTE)szCommandName,&dataLength) == ERROR_SUCCESS) {
+ if (RegQueryValueEx(hKey, NULL, NULL, NULL, (PBYTE)szCommandName, &dataLength) == ERROR_SUCCESS) {
_strlwr(szCommandName);
- if (strstr(szCommandName,"mozilla") || strstr(szCommandName,"netscape"))
- success=(DdeOpenUrl("mozilla",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg) == 0 || DdeOpenUrl("netscape",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg) == 0);
- else if (strstr(szCommandName,"iexplore") || strstr(szCommandName,"msimn"))
- success=0 == DdeOpenUrl("iexplore",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg);
- else if (strstr(szCommandName,"opera"))
- success=0 == DdeOpenUrl("opera",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg);
+ if (strstr(szCommandName, "mozilla") || strstr(szCommandName, "netscape"))
+ success=(DdeOpenUrl("mozilla", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg) == 0 || DdeOpenUrl("netscape", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg) == 0);
+ else if (strstr(szCommandName, "iexplore") || strstr(szCommandName, "msimn"))
+ success=0 == DdeOpenUrl("iexplore", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg);
+ else if (strstr(szCommandName, "opera"))
+ success=0 == DdeOpenUrl("opera", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg);
//opera's the default anyway
}
RegCloseKey(hKey);
@@ -177,20 +177,20 @@ static void OpenURLThread(void *arg) //wack a protocol on it
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') {
szResult=(char*)mir_alloc(lstrlenA(hUrlInfo->szUrl)+9);
- wsprintfA(szResult,"file:///%s",hUrlInfo->szUrl);
+ wsprintfA(szResult, "file:///%s", hUrlInfo->szUrl);
}
else {
int i;
for (i=0;isalpha(hUrlInfo->szUrl[i]);i++);
if (hUrlInfo->szUrl[i] == ':') szResult=mir_strdup(hUrlInfo->szUrl);
else {
- if (!_strnicmp(hUrlInfo->szUrl,"ftp.",4)) {
+ if (!_strnicmp(hUrlInfo->szUrl, "ftp.", 4)) {
szResult=(char*)mir_alloc(lstrlenA(hUrlInfo->szUrl)+7);
- wsprintfA(szResult,"ftp://%s",hUrlInfo->szUrl);
+ wsprintfA(szResult, "ftp://%s", hUrlInfo->szUrl);
}
else {
szResult=(char*)mir_alloc(lstrlenA(hUrlInfo->szUrl)+8);
- wsprintfA(szResult,"http://%s",hUrlInfo->szUrl);
+ wsprintfA(szResult, "http://%s", hUrlInfo->szUrl);
}
}
}
@@ -201,7 +201,7 @@ static void OpenURLThread(void *arg) return;
}
-static INT_PTR OpenURL(WPARAM wParam,LPARAM lParam) {
+static INT_PTR OpenURL(WPARAM wParam, LPARAM lParam) {
TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)mir_alloc(sizeof(TOpenUrlInfo));
hUrlInfo->szUrl = (char*)lParam?mir_strdup((char*)lParam):NULL;
hUrlInfo->newWindow = (int)wParam;
@@ -223,6 +223,6 @@ int InitOpenUrl(void) wcl.lpszMenuName=NULL;
wcl.style=0;
RegisterClass(&wcl);
- CreateServiceFunction(MS_UTILS_OPENURL,OpenURL);
+ CreateServiceFunction(MS_UTILS_OPENURL, OpenURL);
return 0;
}
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index ed29b7fa24..49e5ae8bf4 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.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.
@@ -231,7 +231,7 @@ static INT_PTR createDirTreeW(WPARAM, LPARAM lParam) int InitPathUtilsW(void)
{
GetModuleFileName(hMirandaInst, szMirandaPathW, SIZEOF(szMirandaPathW));
- TCHAR *p = _tcsrchr(szMirandaPathW,'\\');
+ TCHAR *p = _tcsrchr(szMirandaPathW, '\\');
if ( p )
p[1] = 0;
mir_sntprintf(szMirandaPathWLower, SIZEOF(szMirandaPathWLower), _T("%s"), szMirandaPathW);
@@ -457,7 +457,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) if (!_xcscmp(theKey, XSTR(key, "nick")))
theValue = GetContactNickX(key, hContact);
else if (!_xcscmp(theKey, XSTR(key, "proto")))
- theValue = mir_a2x(key, (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact,0));
+ theValue = mir_a2x(key, (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
else if (!_xcscmp(theKey, XSTR(key, "userid")))
theValue = GetContactIDX(key, hContact);
}
@@ -478,11 +478,11 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) else if (!_xcscmp(theKey, XSTR(key, "username")))
theValue = GetUserNameX(key);
else if (!_xcscmp(theKey, XSTR(key, "miranda_avatarcache")))
- theValue = GetPathVarX(key,1);
+ theValue = GetPathVarX(key, 1);
else if (!_xcscmp(theKey, XSTR(key, "miranda_logpath")))
- theValue = GetPathVarX(key,2);
+ theValue = GetPathVarX(key, 2);
else if (!_xcscmp(theKey, XSTR(key, "miranda_userdata")))
- theValue = GetPathVarX(key,3);
+ theValue = GetPathVarX(key, 3);
}
if (!theValue)
@@ -583,7 +583,7 @@ int InitPathUtils(void) {
char *p = 0;
GetModuleFileNameA(hMirandaInst, szMirandaPath, SIZEOF(szMirandaPath));
- p = strrchr(szMirandaPath,'\\');
+ p = strrchr(szMirandaPath, '\\');
if ( p )
p[1] = 0;
mir_snprintf(szMirandaPathLower, MAX_PATH, "%s", szMirandaPath);
diff --git a/src/modules/utils/resizer.cpp b/src/modules/utils/resizer.cpp index b68e874753..1ddfa3fb75 100644 --- a/src/modules/utils/resizer.cpp +++ b/src/modules/utils/resizer.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.
@@ -59,10 +59,10 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) START_OF_DLGTEMPLATEEX *pTemplateEx;
UTILRESIZECONTROL urc;
int procResult;
- int extendedDlg,itemCount;
+ int extendedDlg, itemCount;
if (urd == NULL||urd->cbSize != sizeof(UTILRESIZEDIALOG)) return 1;
- pTemplate=(DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance,FindResourceA(urd->hInstance,urd->lpTemplate,MAKEINTRESOURCEA(5))));
+ pTemplate=(DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance, FindResourceA(urd->hInstance, urd->lpTemplate, MAKEINTRESOURCEA(5))));
pTemplateEx=(START_OF_DLGTEMPLATEEX*)pTemplate;
extendedDlg=pTemplateEx->signature == 0xFFFF;
if (extendedDlg && pTemplateEx->dlgVer != 1)
@@ -75,7 +75,7 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) while (*pWord++); //title
if (extendedDlg) {
if (pTemplateEx->style&DS_SETFONT) {
- pWord+=3; //font size,weight,italic
+ pWord+=3; //font size, weight, italic
while (*pWord++); //font name
}
}
@@ -90,9 +90,9 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) rc.left=0; rc.top=0;
if (extendedDlg) {rc.right=pTemplateEx->cx; rc.bottom=pTemplateEx->cy;}
else {rc.right=pTemplate->cx; rc.bottom=pTemplate->cy;}
- MapDialogRect(urd->hwndDlg,&rc);
+ MapDialogRect(urd->hwndDlg, &rc);
urc.dlgOriginalSize.cx=rc.right; urc.dlgOriginalSize.cy=rc.bottom;
- GetClientRect(urd->hwndDlg,&rc);
+ GetClientRect(urd->hwndDlg, &rc);
urc.dlgNewSize.cx=rc.right; urc.dlgNewSize.cy=rc.bottom;
if (extendedDlg) itemCount=pTemplateEx->cDlgItems;
@@ -123,8 +123,8 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) if (urc.wId == 65535) continue; //using this breaks the dwp, so just ignore it
- MapDialogRect(urd->hwndDlg,&urc.rcItem);
- procResult=(urd->pfnResizer)(urd->hwndDlg,urd->lParam,&urc);
+ MapDialogRect(urd->hwndDlg, &urc.rcItem);
+ procResult=(urd->pfnResizer)(urd->hwndDlg, urd->lParam, &urc);
if (procResult&RD_ANCHORX_RIGHT) {
urc.rcItem.left+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
urc.rcItem.right+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
@@ -145,7 +145,7 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) urc.rcItem.top+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2;
urc.rcItem.bottom+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2;
}
- hDwp = DeferWindowPos(hDwp,GetDlgItem(urd->hwndDlg,extendedDlg?pItemEx->id:pItem->id),0,urc.rcItem.left,urc.rcItem.top,urc.rcItem.right-urc.rcItem.left,urc.rcItem.bottom-urc.rcItem.top,SWP_NOZORDER);
+ hDwp = DeferWindowPos(hDwp, GetDlgItem(urd->hwndDlg, extendedDlg?pItemEx->id:pItem->id), 0, urc.rcItem.left, urc.rcItem.top, urc.rcItem.right-urc.rcItem.left, urc.rcItem.bottom-urc.rcItem.top, SWP_NOZORDER);
}
EndDeferWindowPos(hDwp);
return 0;
diff --git a/src/modules/utils/sha1.cpp b/src/modules/utils/sha1.cpp index 3900d67fff..3d71239bab 100644 --- a/src/modules/utils/sha1.cpp +++ b/src/modules/utils/sha1.cpp @@ -6,7 +6,7 @@ * the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
- * Software distributed under the License is distributed on an "AS IS" basis,
+ * Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
@@ -22,7 +22,7 @@ *
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
@@ -119,11 +119,11 @@ void shaBlock(mir_sha1_byte_t *dataIn, int len, mir_sha1_byte_t hashout[20]) { }
-#define SHA_ROTL(X,n) (((X) << (n)) | ((X) >> (32-(n))))
+#define SHA_ROTL(X, n) (((X) << (n)) | ((X) >> (32-(n))))
static void shaHashBlock(mir_sha1_ctx *ctx) {
int t;
- unsigned long A,B,C,D,E,TEMP;
+ unsigned long A, B, C, D, E, TEMP;
for (t = 16; t <= 79; t++)
ctx->W[t] =
@@ -136,19 +136,19 @@ static void shaHashBlock(mir_sha1_ctx *ctx) { E = ctx->H[4];
for (t = 0; t <= 19; t++) {
- TEMP = SHA_ROTL(A,5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999L;
+ TEMP = SHA_ROTL(A, 5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999L;
E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP;
}
for (t = 20; t <= 39; t++) {
- TEMP = SHA_ROTL(A,5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1L;
+ TEMP = SHA_ROTL(A, 5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1L;
E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP;
}
for (t = 40; t <= 59; t++) {
- TEMP = SHA_ROTL(A,5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdcL;
+ TEMP = SHA_ROTL(A, 5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdcL;
E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP;
}
for (t = 60; t <= 79; t++) {
- TEMP = SHA_ROTL(A,5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6L;
+ TEMP = SHA_ROTL(A, 5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6L;
E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP;
}
diff --git a/src/modules/utils/timeutils.cpp b/src/modules/utils/timeutils.cpp index 0b39d47ea9..cea409ef82 100644 --- a/src/modules/utils/timeutils.cpp +++ b/src/modules/utils/timeutils.cpp @@ -1,7 +1,7 @@ /*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2010 Miranda ICQ/IM project,
+Copyright 2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -10,7 +10,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.
@@ -93,16 +93,16 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, int if (iso)
{
- dateTimeStrLen = mir_sntprintf(dateTimeStr, SIZEOF(dateTimeStr),
+ dateTimeStrLen = mir_sntprintf(dateTimeStr, SIZEOF(dateTimeStr),
_T("%d-%02d-%02dT%02d:%02d:%02dZ"),
st->wYear, st->wMonth, st->wDay,
st->wHour, st->wMinute, st->wSecond) + 1;
}
else if (date)
- dateTimeStrLen = GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL,
+ dateTimeStrLen = GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL,
dateTimeStr, SIZEOF(dateTimeStr));
else
- dateTimeStrLen = GetTimeFormat(LOCALE_USER_DEFAULT, fmt, st, NULL,
+ dateTimeStrLen = GetTimeFormat(LOCALE_USER_DEFAULT, fmt, st, NULL,
dateTimeStr, SIZEOF(dateTimeStr));
if (dateTimeStrLen) --dateTimeStrLen;
@@ -158,7 +158,7 @@ void ConvertToAbsolute (const SYSTEMTIME * pstLoc, const SYSTEMTIME * pstDst, SY // Now iDay is a day of the month ranging from 1 to 7.
// Recall that the wDay field of the structure can range
- // from 1 to 5, 1 meaning "first", 2 meaning "second",
+ // from 1 to 5, 1 meaning "first", 2 meaning "second",
// and 5 meaning "last".
// So, increase iDay so it's the proper day of the month.
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index b7947d6e98..1fe186d633 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -1,7 +1,7 @@ /*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2010 Miranda ICQ/IM project,
+Copyright 2010 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -10,7 +10,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.
diff --git a/src/modules/utils/utf.cpp b/src/modules/utils/utf.cpp index 670f9f5edf..4c86e1c4ee 100644 --- a/src/modules/utils/utf.cpp +++ b/src/modules/utils/utf.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -14,7 +14,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.
@@ -29,14 +29,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* number of following bytes in sequence based on first byte value (for bytes above 0x7f) */
static const char utf8_length[128] =
{
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80-0x8f */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90-0x9f */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xa0-0xaf */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xb0-0xbf */
- 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0xc0-0xcf */
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0xd0-0xdf */
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, /* 0xe0-0xef */
- 3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0 /* 0xf0-0xff */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80-0x8f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90-0x9f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0-0xaf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0-0xbf */
+ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xc0-0xcf */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xd0-0xdf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xe0-0xef */
+ 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* 0xf0-0xff */
};
/* first byte mask depending on UTF-8 sequence length */
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index 2e113f877a..de49be7ab1 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "..\..\core\commonheaders.h"
-INT_PTR ResizeDialog(WPARAM wParam,LPARAM lParam);
+INT_PTR ResizeDialog(WPARAM wParam, LPARAM lParam);
int InitOpenUrl(void);
int InitWindowList(void);
void FreeWindowList(void);
@@ -39,262 +39,262 @@ INT_PTR GetSHA1Interface(WPARAM, LPARAM); static BOOL bModuleInitialized = FALSE;
static struct CountryListEntry countries[]={
- {0 ,"Unspecified"},
- {9999,"Other"},
- {0xFFFF,"Unknown"},
- {93 ,"Afghanistan"},
- {355 ,"Albania"},
- {213 ,"Algeria"},
- {376 ,"Andorra"},
- {244 ,"Angola"},
- {1264,"Anguilla"}, /* change county code to NANP (from 101) */
- {1268,"Antigua and Barbuda"}, /* change county code to NANP (from 1021) */
-// {5902,"Antilles"}, /* removed: it is not a country, it's a group of islands from diffrent countries (all are included in the list)*/
- {54 ,"Argentina"},
- {374 ,"Armenia"},
- {297 ,"Aruba"},
- {247 ,"Ascension Island"},
- {61 ,"Australia"},
- {6720 ,"Australia, Antarctic Territory"}, /* added country code 672(0)*/
- {614 ,"Australia, Christmas Island"}, /* rename (from Christmas Island) and change to official county code 61(4) (from 672) */
- {61891,"Australia, Cocos (Keeling) Islands"}, /* rename and change to official county code 61(891) (from 6102) */
- {6723 ,"Australia, Norfolk Island"}, /* rename (from Norfolk Island) and change to official county code 672(3) (from 6722) */
- {43 ,"Austria"},
- {994 ,"Azerbaijan"},
- {1242,"Bahamas"}, /* change county code to NANP (from 103) */
- {973 ,"Bahrain"},
- {880 ,"Bangladesh"},
- {1246,"Barbados"}, /* change county code to NANP (from 103) */
-// {120 ,"Barbuda"}, /* removed: it is not a country and no special island, see Antigua and Barbuda*/
- {375 ,"Belarus"},
- {32 ,"Belgium"},
- {501 ,"Belize"},
- {229 ,"Benin"},
- {1441,"Bermuda"}, /* change county code to NANP (from 105) */
- {975 ,"Bhutan"},
- {591 ,"Bolivia"},
- {387 ,"Bosnia and Herzegovina"},
- {267 ,"Botswana"},
- {55 ,"Brazil"},
- {673 ,"Brunei"},
- {359 ,"Bulgaria"},
- {226 ,"Burkina Faso"},
- {257 ,"Burundi"},
- {855 ,"Cambodia"},
- {237 ,"Cameroon"},
- {1002,"Canada"}, /* change county code to NANP (from 107 to virtual 1(002) -> reflect NANP*/
- {238 ,"Cape Verde Islands"},
- {1345,"Cayman Islands"}, /* change county code to NANP (from 108) */
- {236 ,"Central African Republic"},
- {235 ,"Chad"},
- {56 ,"Chile, Republic of"},
- {86 ,"China"},
-// {6101,"Cocos-Keeling Islands"}, /* removed (double): see Australia, Cocos (Keeling) Islands */
- {57 ,"Colombia"},
- {269 ,"Comoros"}, /* change county code (from 2691) */
- {243 ,"Congo, Democratic Republic of (Zaire)"},
- {242 ,"Congo, Republic of the"},
- {682 ,"Cook Islands"},
- {506 ,"Costa Rica"},
- {225 ,"Cote d'Ivoire (Ivory Coast)"},
- {385 ,"Croatia"},
- {53 ,"Cuba"},
- {357 ,"Greek, Republic of South Cyprus"}, /* rename coz Turkey, Republic of Northern Cyprus */
- {420 ,"Czech Republic"},
- {45 ,"Denmark"},
- {246 ,"Diego Garcia"},
- {253 ,"Djibouti"},
- {1767,"Dominica"}, /* change county code to NANP (from 109) */
- {1809,"Dominican Republic"}, /* change county code to NANP 809, 829, 849 (from 110) */
- {593 ,"Ecuador"},
- {20 ,"Egypt"},
- {503 ,"El Salvador"},
- {240 ,"Equatorial Guinea"},
- {291 ,"Eritrea"},
- {372 ,"Estonia"},
- {251 ,"Ethiopia"},
- {3883,"Europe"}, /* add county code +388 3 official European Telephony Numbering Space*/
- {298 ,"Faeroe Islands"},
- {500 ,"Falkland Islands"},
- {679 ,"Fiji"},
- {358 ,"Finland"},
- {33 ,"France"},
- {5901,"French Antilles"},
- {594 ,"French Guiana"},
- {689 ,"French Polynesia"},
- {241 ,"Gabon"},
- {220 ,"Gambia"},
- {995 ,"Georgia"},
- {49 ,"Germany"},
- {233 ,"Ghana"},
- {350 ,"Gibraltar"},
- {30 ,"Greece"},
- {299 ,"Greenland"},
- {1473,"Grenada"}, /* change county code to NANP (from 111) */
- {590 ,"Guadeloupe"},
- {1671,"Guam, US Territory of"}, /* change county code to NANP (from 671) */
- {502 ,"Guatemala"},
- {224 ,"Guinea"},
- {245 ,"Guinea-Bissau"},
- {592 ,"Guyana"},
- {509 ,"Haiti"},
- {504 ,"Honduras"},
- {852 ,"Hong Kong"},
- {36 ,"Hungary"},
- {354 ,"Iceland"},
- {91 ,"India"},
- {62 ,"Indonesia"},
- {98 ,"Iran (Islamic Republic of)"},
- {964 ,"Iraq"},
- {353 ,"Ireland"},
- {972 ,"Israel"},
- {39 ,"Italy"},
- {1876,"Jamaica"}, /* change county code to NANP (from 112) */
- {81 ,"Japan"},
- {962 ,"Jordan"},
- {705 ,"Kazakhstan"},
- {254 ,"Kenya"},
- {686 ,"Kiribati"},
- {850 ,"Korea, North"},
- {82 ,"Korea, South"},
- {965 ,"Kuwait"},
- {996 ,"Kyrgyzstan"}, /* change county code (from 706) */
- {856 ,"Laos"},
- {371 ,"Latvia"},
- {961 ,"Lebanon"},
- {266 ,"Lesotho"},
- {231 ,"Liberia"},
- {218 ,"Libyan Arab Jamahiriya"},
- {423 ,"Liechtenstein"}, /* change county code (from 4101) */
- {370 ,"Lithuania"},
- {352 ,"Luxembourg"},
- {853 ,"Macau"},
- {389 ,"Macedonia, Republic of"}, /* rename coz war */
- {261 ,"Madagascar"},
- {265 ,"Malawi"},
- {60 ,"Malaysia"},
- {960 ,"Maldives"},
- {223 ,"Mali"},
- {356 ,"Malta"},
- {692 ,"Marshall Islands"},
- {596 ,"Martinique"},
- {222 ,"Mauritania"},
- {230 ,"Mauritius"},
- {262 ,"Mayotte Island"}, /* change county code coz bug (from 269) */
- {52 ,"Mexico"},
- {691 ,"Micronesia, Federated States of"},
- {373 ,"Moldova, Republic of"},
- {377 ,"Monaco"},
- {976 ,"Mongolia"},
- {1664,"Montserrat"}, /* change county code to NANP (from 113) */
- {212 ,"Morocco"},
- {258 ,"Mozambique"},
- {95 ,"Myanmar"},
- {264 ,"Namibia"},
- {674 ,"Nauru"},
- {977 ,"Nepal"},
- {31 ,"Netherlands"},
- {599 ,"Netherlands Antilles"}, /* dissolved 2010 */
- {5995 ,"St. Maarten"}, /* add new country in 2010 (from Netherlands Antilles) */
- {5999 ,"Curacao"}, /* add new country in 2010 (from Netherlands Antilles) */
- {5997 ,"Netherlands (Bonaire Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */
- {59946,"Netherlands (Saba Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */
- {59938,"Netherlands (St. Eustatius Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */
- // {114 ,"Nevis"}, /* removed: it is not a country, it's part of Saint Kitts and Nevis*/
- {687 ,"New Caledonia"},
- {64 ,"New Zealand"},
- {505 ,"Nicaragua"},
- {227 ,"Niger"},
- {234 ,"Nigeria"},
- {683 ,"Niue"},
- {1670,"Northern Mariana Islands, US Territory of"}, /* added NANP */
- {47 ,"Norway"},
- {968 ,"Oman"},
- {92 ,"Pakistan"},
- {680 ,"Palau"},
- {507 ,"Panama"},
- {675 ,"Papua New Guinea"},
- {595 ,"Paraguay"},
- {51 ,"Peru"},
- {63 ,"Philippines"},
- {48 ,"Poland"},
- {351 ,"Portugal"},
- {1939,"Puerto Rico"}, /* change county code to NANP 939, 787 (from 121) */
- {974 ,"Qatar"},
- {262 ,"Reunion Island"},
- {40 ,"Romania"},
-// {6701,"Rota Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */
- {7 ,"Russia"},
- {250 ,"Rwanda"},
- {1684,"Samoa (USA)"}, /* rename (from American Samoa) change county code to NANP (from 684) */
- {685 ,"Samoa, Western"}, /* rename (from Western Samoa) */
- {290 ,"Saint Helena"},
-// {115 ,"Saint Kitts"}, /* removed: it is not a country it is part of Saint Kitts and Nevis*/
- {1869,"Saint Kitts and Nevis"}, /* change county code to NANP (from 1141) */
- {1758,"Saint Lucia"}, /* change county code to NANP (from 122) */
- {508 ,"Saint Pierre and Miquelon"},
- {1784,"Saint Vincent and the Grenadines"}, /* change county code to NANP (from 116) */
-// {670 ,"Saipan Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */
- {378 ,"San Marino"},
- {239 ,"Sao Tome and Principe"},
- {966 ,"Saudi Arabia"},
- {442 ,"Scotland"},
- {221 ,"Senegal"},
- {248 ,"Seychelles"},
- {232 ,"Sierra Leone"},
- {65 ,"Singapore"},
- {421 ,"Slovakia"},
- {386 ,"Slovenia"},
- {677 ,"Solomon Islands"},
- {252 ,"Somalia"},
- {27 ,"South Africa"},
- {34 ,"Spain"},
- {3492,"Spain, Canary Islands"}, /*rename and change county code to 34(92) spain + canary code*/
- {94 ,"Sri Lanka"},
- {249 ,"Sudan"},
- {597 ,"Suriname"},
- {268 ,"Swaziland"},
- {46 ,"Sweden"},
- {41 ,"Switzerland"},
- {963 ,"Syrian Arab Republic"},
- {886 ,"Taiwan"},
- {992 ,"Tajikistan"}, /* change county code (from 708) */
- {255 ,"Tanzania"},
- {66 ,"Thailand"},
-// {6702,"Tinian Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */
- {670 ,"Timor, East"}, /* added (is part off Northern Mariana Islands but not US Territory*/
- {228 ,"Togo"},
- {690 ,"Tokelau"},
- {676 ,"Tonga"},
- {1868,"Trinidad and Tobago"}, /* change county code to NANP (from 1141) */
- {216 ,"Tunisia"},
- {90 ,"Turkey"},
- {90392,"Turkey, Republic of Northern Cyprus"}, /* added (is diffrent from Greek part)*/
- {993 ,"Turkmenistan"}, /* change county code (from 709) */
- {1649,"Turks and Caicos Islands"}, /* change county code to NANP (from 118) */
- {688 ,"Tuvalu"},
- {256 ,"Uganda"},
- {380 ,"Ukraine"},
- {971 ,"United Arab Emirates"},
- {44 ,"United Kingdom"},
- {598 ,"Uruguay"},
- {1 ,"USA"},
- {998 ,"Uzbekistan"}, /* change county code (from 711) */
- {678 ,"Vanuatu"},
- {379 ,"Vatican City"},
- {58 ,"Venezuela"},
- {84 ,"Vietnam"},
- {1284,"Virgin Islands (UK)"}, /* change county code to NANP (from 105) - rename coz Virgin Islands (USA) */
- {1340,"Virgin Islands (USA)"}, /* change county code to NANP (from 123) */
- {441 ,"Wales"},
- {681 ,"Wallis and Futuna Islands"},
- {967 ,"Yemen"},
- {38 ,"Yugoslavia"}, /* added for old values like birth-country */
- {381 ,"Serbia, Republic of"}, /* rename need (from Yugoslavia)*/
- {383 ,"Kosovo, Republic of"}, /*change country code (from 3811), rename need (from Yugoslavia - Serbia) */
- {382 ,"Montenegro, Republic of"}, /* rename need (from Yugoslavia - Montenegro) */
- {260 ,"Zambia"},
- {263 ,"Zimbabwe"},
+ {0 , "Unspecified"},
+ {9999, "Other"},
+ {0xFFFF, "Unknown"},
+ {93 , "Afghanistan"},
+ {355 , "Albania"},
+ {213 , "Algeria"},
+ {376 , "Andorra"},
+ {244 , "Angola"},
+ {1264, "Anguilla"}, /* change county code to NANP (from 101) */
+ {1268, "Antigua and Barbuda"}, /* change county code to NANP (from 1021) */
+// {5902, "Antilles"}, /* removed: it is not a country, it's a group of islands from diffrent countries (all are included in the list)*/
+ {54 , "Argentina"},
+ {374 , "Armenia"},
+ {297 , "Aruba"},
+ {247 , "Ascension Island"},
+ {61 , "Australia"},
+ {6720 , "Australia, Antarctic Territory"}, /* added country code 672(0)*/
+ {614 , "Australia, Christmas Island"}, /* rename (from Christmas Island) and change to official county code 61(4) (from 672) */
+ {61891, "Australia, Cocos (Keeling) Islands"}, /* rename and change to official county code 61(891) (from 6102) */
+ {6723 , "Australia, Norfolk Island"}, /* rename (from Norfolk Island) and change to official county code 672(3) (from 6722) */
+ {43 , "Austria"},
+ {994 , "Azerbaijan"},
+ {1242, "Bahamas"}, /* change county code to NANP (from 103) */
+ {973 , "Bahrain"},
+ {880 , "Bangladesh"},
+ {1246, "Barbados"}, /* change county code to NANP (from 103) */
+// {120 , "Barbuda"}, /* removed: it is not a country and no special island, see Antigua and Barbuda*/
+ {375 , "Belarus"},
+ {32 , "Belgium"},
+ {501 , "Belize"},
+ {229 , "Benin"},
+ {1441, "Bermuda"}, /* change county code to NANP (from 105) */
+ {975 , "Bhutan"},
+ {591 , "Bolivia"},
+ {387 , "Bosnia and Herzegovina"},
+ {267 , "Botswana"},
+ {55 , "Brazil"},
+ {673 , "Brunei"},
+ {359 , "Bulgaria"},
+ {226 , "Burkina Faso"},
+ {257 , "Burundi"},
+ {855 , "Cambodia"},
+ {237 , "Cameroon"},
+ {1002, "Canada"}, /* change county code to NANP (from 107 to virtual 1(002) -> reflect NANP*/
+ {238 , "Cape Verde Islands"},
+ {1345, "Cayman Islands"}, /* change county code to NANP (from 108) */
+ {236 , "Central African Republic"},
+ {235 , "Chad"},
+ {56 , "Chile, Republic of"},
+ {86 , "China"},
+// {6101, "Cocos-Keeling Islands"}, /* removed (double): see Australia, Cocos (Keeling) Islands */
+ {57 , "Colombia"},
+ {269 , "Comoros"}, /* change county code (from 2691) */
+ {243 , "Congo, Democratic Republic of (Zaire)"},
+ {242 , "Congo, Republic of the"},
+ {682 , "Cook Islands"},
+ {506 , "Costa Rica"},
+ {225 , "Cote d'Ivoire (Ivory Coast)"},
+ {385 , "Croatia"},
+ {53 , "Cuba"},
+ {357 , "Greek, Republic of South Cyprus"}, /* rename coz Turkey, Republic of Northern Cyprus */
+ {420 , "Czech Republic"},
+ {45 , "Denmark"},
+ {246 , "Diego Garcia"},
+ {253 , "Djibouti"},
+ {1767, "Dominica"}, /* change county code to NANP (from 109) */
+ {1809, "Dominican Republic"}, /* change county code to NANP 809, 829, 849 (from 110) */
+ {593 , "Ecuador"},
+ {20 , "Egypt"},
+ {503 , "El Salvador"},
+ {240 , "Equatorial Guinea"},
+ {291 , "Eritrea"},
+ {372 , "Estonia"},
+ {251 , "Ethiopia"},
+ {3883, "Europe"}, /* add county code +388 3 official European Telephony Numbering Space*/
+ {298 , "Faeroe Islands"},
+ {500 , "Falkland Islands"},
+ {679 , "Fiji"},
+ {358 , "Finland"},
+ {33 , "France"},
+ {5901, "French Antilles"},
+ {594 , "French Guiana"},
+ {689 , "French Polynesia"},
+ {241 , "Gabon"},
+ {220 , "Gambia"},
+ {995 , "Georgia"},
+ {49 , "Germany"},
+ {233 , "Ghana"},
+ {350 , "Gibraltar"},
+ {30 , "Greece"},
+ {299 , "Greenland"},
+ {1473, "Grenada"}, /* change county code to NANP (from 111) */
+ {590 , "Guadeloupe"},
+ {1671, "Guam, US Territory of"}, /* change county code to NANP (from 671) */
+ {502 , "Guatemala"},
+ {224 , "Guinea"},
+ {245 , "Guinea-Bissau"},
+ {592 , "Guyana"},
+ {509 , "Haiti"},
+ {504 , "Honduras"},
+ {852 , "Hong Kong"},
+ {36 , "Hungary"},
+ {354 , "Iceland"},
+ {91 , "India"},
+ {62 , "Indonesia"},
+ {98 , "Iran (Islamic Republic of)"},
+ {964 , "Iraq"},
+ {353 , "Ireland"},
+ {972 , "Israel"},
+ {39 , "Italy"},
+ {1876, "Jamaica"}, /* change county code to NANP (from 112) */
+ {81 , "Japan"},
+ {962 , "Jordan"},
+ {705 , "Kazakhstan"},
+ {254 , "Kenya"},
+ {686 , "Kiribati"},
+ {850 , "Korea, North"},
+ {82 , "Korea, South"},
+ {965 , "Kuwait"},
+ {996 , "Kyrgyzstan"}, /* change county code (from 706) */
+ {856 , "Laos"},
+ {371 , "Latvia"},
+ {961 , "Lebanon"},
+ {266 , "Lesotho"},
+ {231 , "Liberia"},
+ {218 , "Libyan Arab Jamahiriya"},
+ {423 , "Liechtenstein"}, /* change county code (from 4101) */
+ {370 , "Lithuania"},
+ {352 , "Luxembourg"},
+ {853 , "Macau"},
+ {389 , "Macedonia, Republic of"}, /* rename coz war */
+ {261 , "Madagascar"},
+ {265 , "Malawi"},
+ {60 , "Malaysia"},
+ {960 , "Maldives"},
+ {223 , "Mali"},
+ {356 , "Malta"},
+ {692 , "Marshall Islands"},
+ {596 , "Martinique"},
+ {222 , "Mauritania"},
+ {230 , "Mauritius"},
+ {262 , "Mayotte Island"}, /* change county code coz bug (from 269) */
+ {52 , "Mexico"},
+ {691 , "Micronesia, Federated States of"},
+ {373 , "Moldova, Republic of"},
+ {377 , "Monaco"},
+ {976 , "Mongolia"},
+ {1664, "Montserrat"}, /* change county code to NANP (from 113) */
+ {212 , "Morocco"},
+ {258 , "Mozambique"},
+ {95 , "Myanmar"},
+ {264 , "Namibia"},
+ {674 , "Nauru"},
+ {977 , "Nepal"},
+ {31 , "Netherlands"},
+ {599 , "Netherlands Antilles"}, /* dissolved 2010 */
+ {5995 , "St. Maarten"}, /* add new country in 2010 (from Netherlands Antilles) */
+ {5999 , "Curacao"}, /* add new country in 2010 (from Netherlands Antilles) */
+ {5997 , "Netherlands (Bonaire Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */
+ {59946, "Netherlands (Saba Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */
+ {59938, "Netherlands (St. Eustatius Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */
+ // {114 , "Nevis"}, /* removed: it is not a country, it's part of Saint Kitts and Nevis*/
+ {687 , "New Caledonia"},
+ {64 , "New Zealand"},
+ {505 , "Nicaragua"},
+ {227 , "Niger"},
+ {234 , "Nigeria"},
+ {683 , "Niue"},
+ {1670, "Northern Mariana Islands, US Territory of"}, /* added NANP */
+ {47 , "Norway"},
+ {968 , "Oman"},
+ {92 , "Pakistan"},
+ {680 , "Palau"},
+ {507 , "Panama"},
+ {675 , "Papua New Guinea"},
+ {595 , "Paraguay"},
+ {51 , "Peru"},
+ {63 , "Philippines"},
+ {48 , "Poland"},
+ {351 , "Portugal"},
+ {1939, "Puerto Rico"}, /* change county code to NANP 939, 787 (from 121) */
+ {974 , "Qatar"},
+ {262 , "Reunion Island"},
+ {40 , "Romania"},
+// {6701, "Rota Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */
+ {7 , "Russia"},
+ {250 , "Rwanda"},
+ {1684, "Samoa (USA)"}, /* rename (from American Samoa) change county code to NANP (from 684) */
+ {685 , "Samoa, Western"}, /* rename (from Western Samoa) */
+ {290 , "Saint Helena"},
+// {115 , "Saint Kitts"}, /* removed: it is not a country it is part of Saint Kitts and Nevis*/
+ {1869, "Saint Kitts and Nevis"}, /* change county code to NANP (from 1141) */
+ {1758, "Saint Lucia"}, /* change county code to NANP (from 122) */
+ {508 , "Saint Pierre and Miquelon"},
+ {1784, "Saint Vincent and the Grenadines"}, /* change county code to NANP (from 116) */
+// {670 , "Saipan Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */
+ {378 , "San Marino"},
+ {239 , "Sao Tome and Principe"},
+ {966 , "Saudi Arabia"},
+ {442 , "Scotland"},
+ {221 , "Senegal"},
+ {248 , "Seychelles"},
+ {232 , "Sierra Leone"},
+ {65 , "Singapore"},
+ {421 , "Slovakia"},
+ {386 , "Slovenia"},
+ {677 , "Solomon Islands"},
+ {252 , "Somalia"},
+ {27 , "South Africa"},
+ {34 , "Spain"},
+ {3492, "Spain, Canary Islands"}, /*rename and change county code to 34(92) spain + canary code*/
+ {94 , "Sri Lanka"},
+ {249 , "Sudan"},
+ {597 , "Suriname"},
+ {268 , "Swaziland"},
+ {46 , "Sweden"},
+ {41 , "Switzerland"},
+ {963 , "Syrian Arab Republic"},
+ {886 , "Taiwan"},
+ {992 , "Tajikistan"}, /* change county code (from 708) */
+ {255 , "Tanzania"},
+ {66 , "Thailand"},
+// {6702, "Tinian Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */
+ {670 , "Timor, East"}, /* added (is part off Northern Mariana Islands but not US Territory*/
+ {228 , "Togo"},
+ {690 , "Tokelau"},
+ {676 , "Tonga"},
+ {1868, "Trinidad and Tobago"}, /* change county code to NANP (from 1141) */
+ {216 , "Tunisia"},
+ {90 , "Turkey"},
+ {90392, "Turkey, Republic of Northern Cyprus"}, /* added (is diffrent from Greek part)*/
+ {993 , "Turkmenistan"}, /* change county code (from 709) */
+ {1649, "Turks and Caicos Islands"}, /* change county code to NANP (from 118) */
+ {688 , "Tuvalu"},
+ {256 , "Uganda"},
+ {380 , "Ukraine"},
+ {971 , "United Arab Emirates"},
+ {44 , "United Kingdom"},
+ {598 , "Uruguay"},
+ {1 , "USA"},
+ {998 , "Uzbekistan"}, /* change county code (from 711) */
+ {678 , "Vanuatu"},
+ {379 , "Vatican City"},
+ {58 , "Venezuela"},
+ {84 , "Vietnam"},
+ {1284, "Virgin Islands (UK)"}, /* change county code to NANP (from 105) - rename coz Virgin Islands (USA) */
+ {1340, "Virgin Islands (USA)"}, /* change county code to NANP (from 123) */
+ {441 , "Wales"},
+ {681 , "Wallis and Futuna Islands"},
+ {967 , "Yemen"},
+ {38 , "Yugoslavia"}, /* added for old values like birth-country */
+ {381 , "Serbia, Republic of"}, /* rename need (from Yugoslavia)*/
+ {383 , "Kosovo, Republic of"}, /*change country code (from 3811), rename need (from Yugoslavia - Serbia) */
+ {382 , "Montenegro, Republic of"}, /* rename need (from Yugoslavia - Montenegro) */
+ {260 , "Zambia"},
+ {263 , "Zimbabwe"},
};
static INT_PTR GetCountryByNumber(WPARAM wParam, LPARAM)
@@ -306,7 +306,7 @@ static INT_PTR GetCountryByNumber(WPARAM wParam, LPARAM) return (INT_PTR)NULL;
}
-static INT_PTR GetCountryList(WPARAM wParam,LPARAM lParam)
+static INT_PTR GetCountryList(WPARAM wParam, LPARAM lParam)
{
*(int*)wParam = SIZEOF(countries);
*(struct CountryListEntry**)lParam=countries;
@@ -322,15 +322,15 @@ static INT_PTR SaveWindowPosition(WPARAM, LPARAM lParam) char szSettingName[64];
wp.length=sizeof(wp);
- GetWindowPlacement(swp->hwnd,&wp);
+ GetWindowPlacement(swp->hwnd, &wp);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.left);
+ DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.left);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.top);
+ DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.top);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.right-wp.rcNormalPosition.left);
+ DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
+ DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
return 0;
}
@@ -375,30 +375,30 @@ static INT_PTR AssertInsideScreen(WPARAM wParam, LPARAM lParam) }
-static INT_PTR RestoreWindowPosition(WPARAM wParam,LPARAM lParam)
+static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam)
{
SAVEWINDOWPOS *swp=(SAVEWINDOWPOS*)lParam;
WINDOWPLACEMENT wp;
char szSettingName[64];
- int x,y;
+ int x, y;
wp.length=sizeof(wp);
- GetWindowPlacement(swp->hwnd,&wp);
+ GetWindowPlacement(swp->hwnd, &wp);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
- x=DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1);
+ x=DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix);
- y=(int)DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1);
+ y=(int)DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
if (x == -1) return 1;
if (wParam&RWPF_NOSIZE) {
- OffsetRect(&wp.rcNormalPosition,x-wp.rcNormalPosition.left,y-wp.rcNormalPosition.top);
+ OffsetRect(&wp.rcNormalPosition, x-wp.rcNormalPosition.left, y-wp.rcNormalPosition.top);
}
else {
wp.rcNormalPosition.left=x;
wp.rcNormalPosition.top=y;
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix);
- wp.rcNormalPosition.right=wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1);
+ wp.rcNormalPosition.right=wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix);
- wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1);
+ wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
}
wp.flags=0;
if (wParam & RWPF_HIDDEN)
@@ -409,7 +409,7 @@ static INT_PTR RestoreWindowPosition(WPARAM wParam,LPARAM lParam) if (!(wParam & RWPF_NOMOVE))
AssertInsideScreen((WPARAM) &wp.rcNormalPosition, 0);
- SetWindowPlacement(swp->hwnd,&wp);
+ SetWindowPlacement(swp->hwnd, &wp);
return 0;
}
@@ -558,16 +558,16 @@ int LoadUtilsModule(void) {
bModuleInitialized = TRUE;
- CreateServiceFunction(MS_UTILS_RESIZEDIALOG,ResizeDialog);
- CreateServiceFunction(MS_UTILS_SAVEWINDOWPOSITION,SaveWindowPosition);
- CreateServiceFunction(MS_UTILS_RESTOREWINDOWPOSITION,RestoreWindowPosition);
- CreateServiceFunction(MS_UTILS_ASSERTINSIDESCREEN,AssertInsideScreen);
- CreateServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER,GetCountryByNumber);
- CreateServiceFunction(MS_UTILS_GETCOUNTRYLIST,GetCountryList);
- CreateServiceFunction(MS_UTILS_GETRANDOM,GenerateRandom);
- CreateServiceFunction(MS_SYSTEM_RESTART,RestartMiranda);
- CreateServiceFunction(MS_SYSTEM_GET_MD5I,GetMD5Interface);
- CreateServiceFunction(MS_SYSTEM_GET_SHA1I,GetSHA1Interface);
+ CreateServiceFunction(MS_UTILS_RESIZEDIALOG, ResizeDialog);
+ CreateServiceFunction(MS_UTILS_SAVEWINDOWPOSITION, SaveWindowPosition);
+ CreateServiceFunction(MS_UTILS_RESTOREWINDOWPOSITION, RestoreWindowPosition);
+ CreateServiceFunction(MS_UTILS_ASSERTINSIDESCREEN, AssertInsideScreen);
+ CreateServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER, GetCountryByNumber);
+ CreateServiceFunction(MS_UTILS_GETCOUNTRYLIST, GetCountryList);
+ CreateServiceFunction(MS_UTILS_GETRANDOM, GenerateRandom);
+ CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda);
+ CreateServiceFunction(MS_SYSTEM_GET_MD5I, GetMD5Interface);
+ CreateServiceFunction(MS_SYSTEM_GET_SHA1I, GetSHA1Interface);
InitOpenUrl();
InitWindowList();
InitHyperlink();
diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp index e67f13c5e8..059d3dd1d7 100644 --- a/src/modules/utils/windowlist.cpp +++ b/src/modules/utils/windowlist.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
@@ -33,24 +33,24 @@ static INT_PTR AllocWindowList(WPARAM, LPARAM) static INT_PTR AddToWindowList(WPARAM, LPARAM lParam)
{
- windowList=(WINDOWLISTENTRY*)mir_realloc(windowList,sizeof(WINDOWLISTENTRY)*(windowListCount+1));
+ windowList=(WINDOWLISTENTRY*)mir_realloc(windowList, sizeof(WINDOWLISTENTRY)*(windowListCount+1));
windowList[windowListCount++]=*(WINDOWLISTENTRY*)lParam;
return 0;
}
-static INT_PTR RemoveFromWindowList(WPARAM wParam,LPARAM lParam)
+static INT_PTR RemoveFromWindowList(WPARAM wParam, LPARAM lParam)
{
int i;
for (i=0;i<windowListCount;i++)
if (windowList[i].hwnd == (HWND)lParam && windowList[i].hList == (HANDLE)wParam) {
- MoveMemory(&windowList[i],&windowList[i+1],sizeof(WINDOWLISTENTRY)*(windowListCount-i-1));
+ MoveMemory(&windowList[i], &windowList[i+1], sizeof(WINDOWLISTENTRY)*(windowListCount-i-1));
windowListCount--;
return 0;
}
return 1;
}
-static INT_PTR FindInWindowList(WPARAM wParam,LPARAM lParam)
+static INT_PTR FindInWindowList(WPARAM wParam, LPARAM lParam)
{
int i;
for (i=0;i<windowListCount;i++)
@@ -59,34 +59,34 @@ static INT_PTR FindInWindowList(WPARAM wParam,LPARAM lParam) return (INT_PTR)(HWND)NULL;
}
-static INT_PTR BroadcastToWindowList(WPARAM wParam,LPARAM lParam)
+static INT_PTR BroadcastToWindowList(WPARAM wParam, LPARAM lParam)
{
int i;
MSG *msg=(MSG*)lParam;
for (i=0;i<windowListCount;i++)
if (windowList[i].hList == (HANDLE)wParam)
- SendMessage(windowList[i].hwnd,msg->message,msg->wParam,msg->lParam);
+ SendMessage(windowList[i].hwnd, msg->message, msg->wParam, msg->lParam);
return 0;
}
-static INT_PTR BroadcastToWindowListAsync(WPARAM wParam,LPARAM lParam)
+static INT_PTR BroadcastToWindowListAsync(WPARAM wParam, LPARAM lParam)
{
int i;
MSG *msg=(MSG*)lParam;
for (i=0;i<windowListCount;i++)
if (windowList[i].hList == (HANDLE)wParam)
- PostMessage(windowList[i].hwnd,msg->message,msg->wParam,msg->lParam);
+ PostMessage(windowList[i].hwnd, msg->message, msg->wParam, msg->lParam);
return 0;
}
int InitWindowList(void)
{
- CreateServiceFunction(MS_UTILS_ALLOCWINDOWLIST,AllocWindowList);
- CreateServiceFunction(MS_UTILS_ADDTOWINDOWLIST,AddToWindowList);
- CreateServiceFunction(MS_UTILS_REMOVEFROMWINDOWLIST,RemoveFromWindowList);
- CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST,BroadcastToWindowList);
- CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC,BroadcastToWindowListAsync);
- CreateServiceFunction(MS_UTILS_FINDWINDOWINLIST,FindInWindowList);
+ CreateServiceFunction(MS_UTILS_ALLOCWINDOWLIST, AllocWindowList);
+ CreateServiceFunction(MS_UTILS_ADDTOWINDOWLIST, AddToWindowList);
+ CreateServiceFunction(MS_UTILS_REMOVEFROMWINDOWLIST, RemoveFromWindowList);
+ CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST, BroadcastToWindowList);
+ CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, BroadcastToWindowListAsync);
+ CreateServiceFunction(MS_UTILS_FINDWINDOWINLIST, FindInWindowList);
return 0;
}
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp index 5d5719bfd7..f3b581947c 100644 --- a/src/modules/visibility/visibility.cpp +++ b/src/modules/visibility/visibility.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.
@@ -22,64 +22,64 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "..\..\core\commonheaders.h"
-static void SetListGroupIcons(HWND hwndList,HANDLE hFirstItem,HANDLE hParentItem,int *groupChildCount)
+static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount)
{
int typeOfFirst;
- int iconOn[2]={1,1};
- int childCount[2]={0,0},i;
+ int iconOn[2]={1, 1};
+ int childCount[2]={0, 0}, i;
int iImage;
- HANDLE hItem,hChildItem;
+ HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if (hChildItem) SetListGroupIcons(hwndList,hChildItem,hItem,childCount);
+ hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hChildItem) SetListGroupIcons(hwndList, hChildItem, hItem, childCount);
for ( i=0; i < SIZEOF(iconOn); i++)
- if (iconOn[i] && SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i) == 0) iconOn[i]=0;
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i]=0;
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
for ( i=0; i < SIZEOF(iconOn); i++) {
- iImage=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,i);
+ iImage=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
if (iconOn[i] && iImage == 0) iconOn[i]=0;
if (iImage != 0xFF) childCount[i]++;
}
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
for ( i=0; i < SIZEOF(iconOn); i++) {
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hParentItem,MAKELPARAM(i,childCount[i]?(iconOn[i]?i+1:0):0xFF));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+1:0):0xFF));
if (groupChildCount) groupChildCount[i]+=childCount[i];
}
}
-static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iImage)
+static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage)
{
- int typeOfFirst,iOldIcon;
- HANDLE hItem,hChildItem;
+ int typeOfFirst, iOldIcon;
+ HANDLE hItem, hChildItem;
- typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ typeOfFirst=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
//check groups
if (typeOfFirst == CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
- hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if (hChildItem) SetAllChildIcons(hwndList,hChildItem,iColumn,iImage);
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ hChildItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
+ if (hChildItem) SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
//check contacts
if (typeOfFirst == CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
+ else hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
- iOldIcon=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ iOldIcon=SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
+ hItem=(HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
@@ -87,48 +87,48 @@ static void ResetListOptions(HWND hwndList) {
int i;
- SendMessage(hwndList,CLM_SETBKBITMAP,0,(LPARAM)(HBITMAP)NULL);
- SendMessage(hwndList,CLM_SETBKCOLOR,GetSysColor(COLOR_WINDOW),0);
- SendMessage(hwndList,CLM_SETGREYOUTFLAGS,0,0);
- SendMessage(hwndList,CLM_SETLEFTMARGIN,2,0);
- SendMessage(hwndList,CLM_SETINDENT,10,0);
+ SendMessage(hwndList, CLM_SETBKBITMAP, 0, (LPARAM)(HBITMAP)NULL);
+ SendMessage(hwndList, CLM_SETBKCOLOR, GetSysColor(COLOR_WINDOW), 0);
+ SendMessage(hwndList, CLM_SETGREYOUTFLAGS, 0, 0);
+ SendMessage(hwndList, CLM_SETLEFTMARGIN, 2, 0);
+ SendMessage(hwndList, CLM_SETINDENT, 10, 0);
for (i=0;i<=FONTID_MAX;i++)
- SendMessage(hwndList,CLM_SETTEXTCOLOR,i,GetSysColor(COLOR_WINDOWTEXT));
- SetWindowLongPtr(hwndList,GWL_STYLE,GetWindowLongPtr(hwndList,GWL_STYLE)|CLS_SHOWHIDDEN);
+ SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
+ SetWindowLongPtr(hwndList, GWL_STYLE, GetWindowLongPtr(hwndList, GWL_STYLE)|CLS_SHOWHIDDEN);
}
static void SetAllContactIcons(HWND hwndList)
{
- HANDLE hContact,hItem;
+ HANDLE hContact, hItem;
char *szProto;
DWORD flags;
WORD status;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,(WPARAM)hContact,0);
+ hItem=(HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) {flags=0; status=0;}
else {
- flags=CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0);
- status=DBGetContactSettingWord(hContact,szProto,"ApparentMode",0);
+ flags=CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ status=DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
}
if (flags&PF1_INVISLIST) {
- if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,0)) == 0xFF)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,status == ID_STATUS_ONLINE?1:0));
+ if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, 0)) == 0xFF)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, status == ID_STATUS_ONLINE?1:0));
}
if (flags&PF1_VISLIST) {
- if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(1,0)) == 0xFF)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(1,status == ID_STATUS_OFFLINE?2:0));
+ if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, 0)) == 0xFF)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, status == ID_STATUS_OFFLINE?2:0));
}
}
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
}
static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
- static HICON hVisibleIcon,hInvisibleIcon;
+ static HICON hVisibleIcon, hInvisibleIcon;
static HANDLE hItemAll;
switch (msg)
@@ -136,32 +136,32 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{ HIMAGELIST hIml;
- hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),(IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,3,3);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_STATUS_INVISIBLE);
- ImageList_AddIcon_IconLibLoaded(hIml,SKINICON_STATUS_OFFLINE);
- SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_SETEXTRAIMAGELIST,0,(LPARAM)hIml);
- hVisibleIcon=ImageList_GetIcon(hIml,1,ILD_NORMAL);
- SendDlgItemMessage(hwndDlg,IDC_VISIBLEICON,STM_SETICON,(WPARAM)hVisibleIcon,0);
- hInvisibleIcon=ImageList_GetIcon(hIml,2,ILD_NORMAL);
- SendDlgItemMessage(hwndDlg,IDC_INVISIBLEICON,STM_SETICON,(WPARAM)hInvisibleIcon,0);
+ hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3, 3);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_STATUS_INVISIBLE);
+ ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_STATUS_OFFLINE);
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
+ hVisibleIcon=ImageList_GetIcon(hIml, 1, ILD_NORMAL);
+ SendDlgItemMessage(hwndDlg, IDC_VISIBLEICON, STM_SETICON, (WPARAM)hVisibleIcon, 0);
+ hInvisibleIcon=ImageList_GetIcon(hIml, 2, ILD_NORMAL);
+ SendDlgItemMessage(hwndDlg, IDC_INVISIBLEICON, STM_SETICON, (WPARAM)hInvisibleIcon, 0);
}
- ResetListOptions(GetDlgItem(hwndDlg,IDC_LIST));
- SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_SETEXTRACOLUMNS,2,0);
+ ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, 2, 0);
{ CLCINFOITEM cii={0};
cii.cbSize=sizeof(cii);
cii.flags=CLCIIF_GROUPFONT;
cii.pszText=TranslateT("** All contacts **");
- hItemAll=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_ADDINFOITEM,0,(LPARAM)&cii);
+ hItemAll=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
- SetAllContactIcons(GetDlgItem(hwndDlg,IDC_LIST));
- SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
+ SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
return TRUE;
case WM_SETFOCUS:
- SetFocus(GetDlgItem(hwndDlg,IDC_LIST));
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST));
break;
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
@@ -170,13 +170,13 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP {
case CLN_NEWCONTACT:
case CLN_LISTREBUILT:
- SetAllContactIcons(GetDlgItem(hwndDlg,IDC_LIST));
+ SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
//fall through
case CLN_CONTACTMOVED:
- SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
break;
case CLN_OPTIONSCHANGED:
- ResetListOptions(GetDlgItem(hwndDlg,IDC_LIST));
+ ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
break;
case NM_CLICK:
{ HANDLE hItem;
@@ -190,7 +190,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP break;
// Find clicked item
- hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x,nm->pt.y));
+ hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
// Nothing was clicked
if (hItem == NULL) break;
// It was not a visbility icon
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP // Update list, making sure that the options are mutually exclusive
if (itemType == CLCIT_CONTACT) { // A contact
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, iImage));
- if (iImage && SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn?0:1,0)) != 0xFF)
+ if (iImage && SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0)) != 0xFF)
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0));
}
else if (itemType == CLCIT_INFO) { // All Contacts
@@ -239,25 +239,25 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
- { HANDLE hContact,hItem;
- int set,i,iImage;
+ { HANDLE hContact, hItem;
+ int set, i, iImage;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
do {
- hItem=(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_FINDCONTACT,(WPARAM)hContact,0);
+ hItem=(HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
set=0;
for (i=0;i<2;i++) {
- iImage=SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0));
+ iImage=SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
if (iImage == i+1) {
- CallContactService(hContact,PSS_SETAPPARENTMODE,iImage == 1?ID_STATUS_ONLINE:ID_STATUS_OFFLINE,0);
+ CallContactService(hContact, PSS_SETAPPARENTMODE, iImage == 1?ID_STATUS_ONLINE:ID_STATUS_OFFLINE, 0);
set=1;
break;
}
}
- if (!set) CallContactService(hContact,PSS_SETAPPARENTMODE,0,0);
+ if (!set) CallContactService(hContact, PSS_SETAPPARENTMODE, 0, 0);
}
- } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
return TRUE;
}
}
@@ -267,7 +267,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP case WM_DESTROY:
DestroyIcon(hVisibleIcon);
DestroyIcon(hInvisibleIcon);
- { HIMAGELIST hIml=(HIMAGELIST)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGELIST,0,0);
+ { HIMAGELIST hIml=(HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
}
break;
@@ -292,6 +292,6 @@ static int VisibilityOptInitialise(WPARAM wParam, LPARAM) int LoadVisibilityModule(void)
{
- HookEvent(ME_OPT_INITIALISE,VisibilityOptInitialise);
+ HookEvent(ME_OPT_INITIALISE, VisibilityOptInitialise);
return 0;
}
diff --git a/src/modules/xml/xmlApi.cpp b/src/modules/xml/xmlApi.cpp index 45acae2381..16cb936090 100644 --- a/src/modules/xml/xmlApi.cpp +++ b/src/modules/xml/xmlApi.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -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.
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp index 2ff53f005b..c718b9c46c 100644 --- a/src/modules/xml/xmlParser.cpp +++ b/src/modules/xml/xmlParser.cpp @@ -77,12 +77,12 @@ inline int mmin( const int t1, const int t2 ) { return t1 < t2 ? t1 : t2; } typedef struct { XMLCSTR lpszOpen; int openTagLen; XMLCSTR lpszClose;} ALLXMLClearTag;
static ALLXMLClearTag XMLClearTags[] =
{
- { _CXML("<![CDATA["),9, _CXML("]]>") },
- { _CXML("<!DOCTYPE"),9, _CXML(">") },
- { _CXML("<!--") ,4, _CXML("-->") },
- { _CXML("<PRE>") ,5, _CXML("</PRE>") },
- // { _CXML("<Script>") ,8, _CXML("</Script>")},
- { NULL ,0, NULL }
+ { _CXML("<![CDATA["), 9, _CXML("]]>") },
+ { _CXML("<!DOCTYPE"), 9, _CXML(">") },
+ { _CXML("<!--") , 4, _CXML("-->") },
+ { _CXML("<PRE>") , 5, _CXML("</PRE>") },
+ // { _CXML("<Script>") , 8, _CXML("</Script>")},
+ { NULL , 0, NULL }
};
// You can modify the initialization of the variable "XMLEntities" below
@@ -92,15 +92,15 @@ static ALLXMLClearTag XMLClearTags[] = typedef struct { XMLCSTR s; int l; XMLCHAR c;} XMLCharacterEntity;
static XMLCharacterEntity XMLEntities[] =
{
- { _CXML("&" ), 5, _CXML('&' )},
- { _CXML("<" ), 4, _CXML('<' )},
- { _CXML(">" ), 4, _CXML('>' )},
- { _CXML("""), 6, _CXML('\"')},
- { _CXML("'"), 6, _CXML('\'')},
+ { _CXML("&" ), 5, _CXML('&' )},
+ { _CXML("<" ), 4, _CXML('<' )},
+ { _CXML(">" ), 4, _CXML('>' )},
+ { _CXML("""), 6, _CXML('\"')},
+ { _CXML("'"), 6, _CXML('\'')},
{ NULL , 0, '\0' }
};
-// When rendering the XMLNode to a string (using the "createXMLString" function),
+// When rendering the XMLNode to a string (using the "createXMLString" function),
// you can ask for a beautiful formatting. This formatting is using the
// following indentation character:
#define INDENTCHAR _CXML('\t')
@@ -142,7 +142,7 @@ XMLCSTR XMLNode::getError(XMLError xerror) /////////////////////////////////////////////////////////////////////////
// Here is an abstraction layer to access some common string manipulation functions.
-// The abstraction layer is currently working for gcc, Microsoft Visual Studio 6.0,
+// The abstraction layer is currently working for gcc, Microsoft Visual Studio 6.0,
// Microsoft Visual Studio .NET, CC (sun compiler) and Borland C++.
// If you plan to "port" the library to a new system/compiler, all you have to do is
// to edit the following lines.
@@ -165,14 +165,14 @@ char myIsTextWideChar(const void *b, int len) // inspired by the Wine API: RtlIs if (len&1) return FALSE;
/* only checks the first 256 characters */
- len=mmin(256,len/sizeof(wchar_t));
+ len=mmin(256, len/sizeof(wchar_t));
// Check for the special byte order:
if (*((unsigned short*)s) == 0xFFFE) return TRUE; // IS_TEXT_UNICODE_REVERSE_SIGNATURE;
if (*((unsigned short*)s) == 0xFEFF) return TRUE; // IS_TEXT_UNICODE_SIGNATURE
// checks for ASCII characters in the UNICODE stream
- int i,stats=0;
+ int i, stats=0;
for (i=0; i<len; i++) if (s[i]<=(unsigned short)255) stats++;
if (stats>len/2) return TRUE;
@@ -182,7 +182,7 @@ char myIsTextWideChar(const void *b, int len) // inspired by the Wine API: RtlIs return FALSE;
}
#else
-char myIsTextWideChar(const void *b,int l) { return (char)IsTextUnicode((CONST LPVOID)b,l,NULL); }
+char myIsTextWideChar(const void *b, int l) { return (char)IsTextUnicode((CONST LPVOID)b, l, NULL); }
#endif
#endif
@@ -192,22 +192,22 @@ char myIsTextWideChar(const void *b,int l) { return (char)IsTextUnicode((CONST L wchar_t *myMultiByteToWideChar(const char *s, XMLNode::XMLCharEncoding ce)
{
int i;
- if (ce == XMLNode::char_encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8,0 ,s,-1,NULL,0);
- else i=(int)MultiByteToWideChar(CP_ACP ,MB_PRECOMPOSED,s,-1,NULL,0);
+ if (ce == XMLNode::char_encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8, 0 , s, -1, NULL, 0);
+ else i=(int)MultiByteToWideChar(CP_ACP , MB_PRECOMPOSED, s, -1, NULL, 0);
if (i<0) return NULL;
wchar_t *d=(wchar_t *)malloc((i+1)*sizeof(XMLCHAR));
- if (ce == XMLNode::char_encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8,0 ,s,-1,d,i);
- else i=(int)MultiByteToWideChar(CP_ACP ,MB_PRECOMPOSED,s,-1,d,i);
+ if (ce == XMLNode::char_encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8, 0 , s, -1, d, i);
+ else i=(int)MultiByteToWideChar(CP_ACP , MB_PRECOMPOSED, s, -1, d, i);
d[i]=0;
return d;
}
-static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return _wfopen(filename,mode); }
+static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return _wfopen(filename, mode); }
static inline int xstrlen(XMLCSTR c) { return (int)wcslen(c); }
-static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _wcsnicmp(c1,c2,l);}
-static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1,c2,l);}
-static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _wcsicmp(c1,c2); }
-static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1,c2); }
-static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1,c2); }
+static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _wcsnicmp(c1, c2, l);}
+static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1, c2, l);}
+static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _wcsicmp(c1, c2); }
+static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1, c2); }
+static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1, c2); }
#else
char *myWideCharToMultiByte(const wchar_t *s)
{
@@ -235,18 +235,18 @@ char *myWideCharToMultiByte(const wchar_t *s) d[i]=0;
return d;
}
-static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return fopen(filename,mode); }
+static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return fopen(filename, mode); }
static inline int xstrlen(XMLCSTR c) { return (int)strlen(c); }
#ifdef __BORLANDC__
-static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strnicmp(c1,c2,l);}
-static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return stricmp(c1,c2); }
+static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strnicmp(c1, c2, l);}
+static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return stricmp(c1, c2); }
#else
-static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _strnicmp(c1,c2,l);}
-static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _stricmp(c1,c2); }
+static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _strnicmp(c1, c2, l);}
+static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _stricmp(c1, c2); }
#endif
-static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1,c2,l);}
-static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1,c2); }
-static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1,c2); }
+static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1, c2, l);}
+static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1, c2); }
+static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1, c2); }
#endif
#else
// for gcc and CC
@@ -256,10 +256,10 @@ char *myWideCharToMultiByte(const wchar_t *s) { return NULL; } char *myWideCharToMultiByte(const wchar_t *s)
{
const wchar_t *ss=s;
- int i=(int)wcsrtombs(NULL,&ss,0,NULL);
+ int i=(int)wcsrtombs(NULL, &ss, 0, NULL);
if (i<0) return NULL;
char *d=(char *)malloc(i+1);
- wcsrtombs(d,&s,i,NULL);
+ wcsrtombs(d, &s, i, NULL);
d[i]=0;
return d;
}
@@ -268,10 +268,10 @@ char *myWideCharToMultiByte(const wchar_t *s) wchar_t *myMultiByteToWideChar(const char *s, XMLNode::XMLCharEncoding ce)
{
const char *ss=s;
- int i=(int)mbsrtowcs(NULL,&ss,0,NULL);
+ int i=(int)mbsrtowcs(NULL, &ss, 0, NULL);
if (i<0) return NULL;
wchar_t *d=(wchar_t *)malloc((i+1)*sizeof(wchar_t));
- mbsrtowcs(d,&s,i,NULL);
+ mbsrtowcs(d, &s, i, NULL);
d[i]=0;
return d;
}
@@ -279,21 +279,21 @@ int xstrlen(XMLCSTR c) { return wcslen(c); } #ifdef sun
// for CC
#include <widec.h>
-static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncasecmp(c1,c2,l);}
-static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncmp(c1,c2,l);}
-static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wscasecmp(c1,c2); }
+static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncasecmp(c1, c2, l);}
+static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncmp(c1, c2, l);}
+static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wscasecmp(c1, c2); }
#else
-static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1,c2,l);}
+static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1, c2, l);}
#ifdef __linux__
// for gcc/linux
-static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncasecmp(c1,c2,l);}
-static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wcscasecmp(c1,c2); }
+static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncasecmp(c1, c2, l);}
+static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wcscasecmp(c1, c2); }
#else
#include <wctype.h>
// for gcc/non-linux (MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Cygwin, mingw)
static inline int xstricmp(XMLCSTR c1, XMLCSTR c2)
{
- wchar_t left,right;
+ wchar_t left, right;
do
{
left=towlower(*c1++); right=towlower(*c2++);
@@ -302,7 +302,7 @@ static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) }
static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l)
{
- wchar_t left,right;
+ wchar_t left, right;
while (l--)
{
left=towlower(*c1++); right=towlower(*c2++);
@@ -312,32 +312,32 @@ static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) }
#endif
#endif
-static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1,c2); }
-static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1,c2); }
-static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode)
+static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1, c2); }
+static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1, c2); }
+static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode)
{
char *filenameAscii=myWideCharToMultiByte(filename);
FILE *f;
- if (mode[0] == _CXML('r')) f=fopen(filenameAscii,"rb");
- else f=fopen(filenameAscii,"wb");
+ if (mode[0] == _CXML('r')) f=fopen(filenameAscii, "rb");
+ else f=fopen(filenameAscii, "wb");
free(filenameAscii);
return f;
}
#else
-static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return fopen(filename,mode); }
+static inline FILE *xfopen(XMLCSTR filename, XMLCSTR mode) { return fopen(filename, mode); }
static inline int xstrlen(XMLCSTR c) { return strlen(c); }
-static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncasecmp(c1,c2,l);}
-static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1,c2,l);}
-static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return strcasecmp(c1,c2); }
-static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1,c2); }
-static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1,c2); }
+static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncasecmp(c1, c2, l);}
+static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1, c2, l);}
+static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return strcasecmp(c1, c2); }
+static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1, c2); }
+static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1, c2); }
#endif
-static inline int _strnicmp(const char *c1,const char *c2, int l) { return strncasecmp(c1,c2,l);}
+static inline int _strnicmp(const char *c1, const char *c2, int l) { return strncasecmp(c1, c2, l);}
#endif
///////////////////////////////////////////////////////////////////////////////
-// the "xmltoc,xmltob,xmltoi,xmltol,xmltof,xmltoa" functions //
+// the "xmltoc, xmltob, xmltoi, xmltol, xmltof, xmltoa" functions //
///////////////////////////////////////////////////////////////////////////////
// These 6 functions are not used inside the XMLparser.
// There are only here as "convenience" functions for the user.
@@ -345,33 +345,33 @@ static inline int _strnicmp(const char *c1,const char *c2, int l) { return strnc #ifdef _XMLWIDECHAR
#ifdef _XMLWINDOWS
// for Microsoft Visual Studio 6.0 and Microsoft Visual Studio .NET and Borland C++ Builder 6.0
-char xmltob(XMLCSTR t,char v) { if (t&&(*t)) return (char)_wtoi(t); return v; }
-int xmltoi(XMLCSTR t,int v) { if (t&&(*t)) return _wtoi(t); return v; }
-long xmltol(XMLCSTR t,long v) { if (t&&(*t)) return _wtol(t); return v; }
-double xmltof(XMLCSTR t,double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; }
+char xmltob(XMLCSTR t, char v) { if (t&&(*t)) return (char)_wtoi(t); return v; }
+int xmltoi(XMLCSTR t, int v) { if (t&&(*t)) return _wtoi(t); return v; }
+long xmltol(XMLCSTR t, long v) { if (t&&(*t)) return _wtol(t); return v; }
+double xmltof(XMLCSTR t, double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; }
#else
#ifdef sun
// for CC
#include <widec.h>
-char xmltob(XMLCSTR t,char v) { if (t) return (char)wstol(t,NULL,10); return v; }
-int xmltoi(XMLCSTR t,int v) { if (t) return (int)wstol(t,NULL,10); return v; }
-long xmltol(XMLCSTR t,long v) { if (t) return wstol(t,NULL,10); return v; }
+char xmltob(XMLCSTR t, char v) { if (t) return (char)wstol(t, NULL, 10); return v; }
+int xmltoi(XMLCSTR t, int v) { if (t) return (int)wstol(t, NULL, 10); return v; }
+long xmltol(XMLCSTR t, long v) { if (t) return wstol(t, NULL, 10); return v; }
#else
// for gcc
-char xmltob(XMLCSTR t,char v) { if (t) return (char)wcstol(t,NULL,10); return v; }
-int xmltoi(XMLCSTR t,int v) { if (t) return (int)wcstol(t,NULL,10); return v; }
-long xmltol(XMLCSTR t,long v) { if (t) return wcstol(t,NULL,10); return v; }
+char xmltob(XMLCSTR t, char v) { if (t) return (char)wcstol(t, NULL, 10); return v; }
+int xmltoi(XMLCSTR t, int v) { if (t) return (int)wcstol(t, NULL, 10); return v; }
+long xmltol(XMLCSTR t, long v) { if (t) return wcstol(t, NULL, 10); return v; }
#endif
-double xmltof(XMLCSTR t,double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; }
+double xmltof(XMLCSTR t, double v) { if (t&&(*t)) swscanf(t, L"%lf", &v); /*v=_wtof(t);*/ return v; }
#endif
#else
-char xmltob(XMLCSTR t,char v) { if (t&&(*t)) return (char)atoi(t); return v; }
-int xmltoi(XMLCSTR t,int v) { if (t&&(*t)) return atoi(t); return v; }
-long xmltol(XMLCSTR t,long v) { if (t&&(*t)) return atol(t); return v; }
-double xmltof(XMLCSTR t,double v) { if (t&&(*t)) return atof(t); return v; }
+char xmltob(XMLCSTR t, char v) { if (t&&(*t)) return (char)atoi(t); return v; }
+int xmltoi(XMLCSTR t, int v) { if (t&&(*t)) return atoi(t); return v; }
+long xmltol(XMLCSTR t, long v) { if (t&&(*t)) return atol(t); return v; }
+double xmltof(XMLCSTR t, double v) { if (t&&(*t)) return atof(t); return v; }
#endif
-XMLCSTR xmltoa(XMLCSTR t,XMLCSTR v) { if (t) return t; return v; }
-XMLCHAR xmltoc(XMLCSTR t,const XMLCHAR v) { if (t&&(*t)) return *t; return v; }
+XMLCSTR xmltoa(XMLCSTR t, XMLCSTR v) { if (t) return t; return v; }
+XMLCHAR xmltoc(XMLCSTR t, const XMLCHAR v) { if (t&&(*t)) return *t; return v; }
/////////////////////////////////////////////////////////////////////////
// the "openFileHelper" function //
@@ -383,38 +383,38 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag) {
// guess the value of the global parameter "characterEncoding"
// (the guess is based on the first 200 bytes of the file).
- FILE *f=xfopen(filename,_CXML("rb"));
+ FILE *f=xfopen(filename, _CXML("rb"));
if (f)
{
char bb[205];
- int l=(int)fread(bb,1,200,f);
- setGlobalOptions(guessCharEncoding(bb,l),guessWideCharChars,dropWhiteSpace,removeCommentsInMiddleOfText);
+ int l=(int)fread(bb, 1, 200, f);
+ setGlobalOptions(guessCharEncoding(bb, l), guessWideCharChars, dropWhiteSpace, removeCommentsInMiddleOfText);
fclose(f);
}
// parse the file
XMLResults pResults;
- XMLNode xnode=XMLNode::parseFile(filename,tag,&pResults);
+ XMLNode xnode=XMLNode::parseFile(filename, tag, &pResults);
// display error message (if any)
if (pResults.error != eXMLErrorNone)
{
// create message
- char message[2000],*s1=(char*)"",*s3=(char*)""; XMLCSTR s2=_CXML("");
+ char message[2000], *s1=(char*)"", *s3=(char*)""; XMLCSTR s2=_CXML("");
if (pResults.error == eXMLErrorFirstTagNotFound) { s1=(char*)"First Tag should be '"; s2=tag; s3=(char*)"'.\n"; }
- sprintf(message,
+ sprintf(message,
#ifdef _XMLWIDECHAR
"XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s"
#else
"XML Parsing error inside file '%s'.\n%s\nAt line %i, column %i.\n%s%s%s"
#endif
- ,filename,XMLNode::getError(pResults.error),pResults.nLine,pResults.nColumn,s1,s2,s3);
+ , filename, XMLNode::getError(pResults.error), pResults.nLine, pResults.nColumn, s1, s2, s3);
// display message
#if defined(_XMLWINDOWS) && !defined(UNDER_CE) && !defined(_XMLPARSER_NO_MESSAGEBOX_)
- MessageBoxA(NULL,message,"XML Parsing error",MB_OK|MB_ICONERROR|MB_TOPMOST);
+ MessageBoxA(NULL, message, "XML Parsing error", MB_OK|MB_ICONERROR|MB_TOPMOST);
#else
- printf("%s",message);
+ printf("%s", message);
#endif
exit(255);
}
@@ -437,91 +437,91 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag) static const char XML_utf8ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
- 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70 End of ASCII range
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x80 0x80 to 0xc1 invalid
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x90
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xa0
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xb0
- 1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0 0xc2 to 0xdf 2 byte
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,// 0xe0 0xe0 to 0xef 3 byte
- 4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0
+ 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte
+ 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid
};
static const char XML_legacyByteTable[256] =
{
- 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
static const char XML_sjisByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
- 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70
- 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x80 0x81 to 0x9F 2 bytes
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x90
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xa0
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xb0
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xc0
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xd0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0 0xe0 to 0xef 2 bytes
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 // 0xf0
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0x80 0x81 to 0x9F 2 bytes
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0x90
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xc0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xd0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xe0 0xe0 to 0xef 2 bytes
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0
};
static const char XML_gb2312ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
- 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x80
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x90
- 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xa0 0xa1 to 0xf7 2 bytes
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xb0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0
- 2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1 // 0xf0
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xa0 0xa1 to 0xf7 2 bytes
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xb0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xe0
+ 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0
};
static const char XML_gbk_big5_ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
- 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70
- 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x80 0x81 to 0xfe 2 bytes
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x90
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xa0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xb0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1 // 0xf0
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0x80 0x81 to 0xfe 2 bytes
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0x90
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xa0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xb0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xe0
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 // 0xf0
};
static const char *XML_ByteTable=(const char *)XML_utf8ByteTable; // the default is "characterEncoding=XMLNode::encoding_UTF8"
#endif
@@ -534,15 +534,15 @@ XMLAttribute XMLNode::emptyXMLAttribute={ NULL, NULL}; // Enumeration used to decipher what type a token is
typedef enum XMLTokenTypeTag
{
- eTokenText = 0,
- eTokenQuotedText,
+ eTokenText = 0,
+ eTokenQuotedText,
eTokenTagStart, /* "<" */
eTokenTagEnd, /* "</" */
eTokenCloseTag, /* ">" */
eTokenEquals, /* "=" */
eTokenDeclaration, /* "<?" */
eTokenShortHandClose, /* "/>" */
- eTokenClear,
+ eTokenClear,
eTokenError
} XMLTokenType;
@@ -551,7 +551,7 @@ typedef struct XML {
XMLCSTR lpXML;
XMLCSTR lpszText;
- int nIndex,nIndexMissigEndTag;
+ int nIndex, nIndexMissigEndTag;
enum XMLError error;
XMLCSTR lpEndTag;
int cbEndTag;
@@ -569,8 +569,8 @@ typedef struct // Enumeration used when parsing attributes
typedef enum Attrib
{
- eAttribName = 0,
- eAttribEquals,
+ eAttribName = 0,
+ eAttribEquals,
eAttribValue
} Attrib;
@@ -578,25 +578,25 @@ typedef enum Attrib // inside a tag
typedef enum XMLStatus
{
- eInsideTag = 0,
+ eInsideTag = 0,
eOutsideTag
} XMLStatus;
XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nFormat) const
{
if (!d) return eXMLErrorNone;
- FILE *f=xfopen(filename,_CXML("wb"));
+ FILE *f=xfopen(filename, _CXML("wb"));
if (!f) return eXMLErrorCannotOpenWriteFile;
#ifdef _XMLWIDECHAR
unsigned char h[2]={ 0xFF, 0xFE };
- if (!fwrite(h,2,1,f))
+ if (!fwrite(h, 2, 1, f))
{
fclose(f);
return eXMLErrorCannotWriteFile;
}
if ((!isDeclaration())&&((d->lpszName)||(!getChildNode().isDeclaration())))
{
- if (!fwrite(L"<?xml version=\"1.0\" encoding=\"utf-16\"?>\n",sizeof(wchar_t)*40,1,f))
+ if (!fwrite(L"<?xml version=\"1.0\" encoding=\"utf-16\"?>\n", sizeof(wchar_t)*40, 1, f))
{
fclose(f);
return eXMLErrorCannotWriteFile;
@@ -608,8 +608,8 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm if (characterEncoding == char_encoding_UTF8)
{
// header so that windows recognize the file as UTF-8:
- unsigned char h[3]={0xEF,0xBB,0xBF};
- if (!fwrite(h,3,1,f))
+ unsigned char h[3]={0xEF, 0xBB, 0xBF};
+ if (!fwrite(h, 3, 1, f))
{
fclose(f);
return eXMLErrorCannotWriteFile;
@@ -618,7 +618,7 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm } else if (characterEncoding == char_encoding_ShiftJIS) encoding="SHIFT-JIS";
if (!encoding) encoding="ISO-8859-1";
- if (fprintf(f,"<?xml version=\"1.0\" encoding=\"%s\"?>\n",encoding)<0)
+ if (fprintf(f, "<?xml version=\"1.0\" encoding=\"%s\"?>\n", encoding)<0)
{
fclose(f);
return eXMLErrorCannotWriteFile;
@@ -627,8 +627,8 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm {
if (characterEncoding == char_encoding_UTF8)
{
- unsigned char h[3]={0xEF,0xBB,0xBF};
- if (!fwrite(h,3,1,f))
+ unsigned char h[3]={0xEF, 0xBB, 0xBF};
+ if (!fwrite(h, 3, 1, f))
{
fclose(f);
return eXMLErrorCannotWriteFile;
@@ -637,8 +637,8 @@ XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nForm }
#endif
int i;
- XMLSTR t=createXMLString(nFormat,&i);
- if (!fwrite(t,sizeof(XMLCHAR)*i,1,f))
+ XMLSTR t=createXMLString(nFormat, &i);
+ if (!fwrite(t, sizeof(XMLCHAR)*i, 1, f))
{
free(t);
fclose(f);
@@ -669,7 +669,7 @@ XMLSTR stringDup(XMLCSTR lpszData, int cbData) return lpszNew;
}
-XMLSTR ToXMLStringTool::toXMLUnSafe(XMLSTR dest,XMLCSTR source)
+XMLSTR ToXMLStringTool::toXMLUnSafe(XMLSTR dest, XMLCSTR source)
{
XMLSTR dd=dest;
XMLCHAR ch;
@@ -679,7 +679,7 @@ XMLSTR ToXMLStringTool::toXMLUnSafe(XMLSTR dest,XMLCSTR source) entity=XMLEntities;
do
{
- if (ch == entity->c) {xstrcpy(dest,entity->s); dest+=entity->l; source++; goto out_of_loop1; }
+ if (ch == entity->c) {xstrcpy(dest, entity->s); dest+=entity->l; source++; goto out_of_loop1; }
entity++;
} while (entity->s);
#ifdef _XMLWIDECHAR
@@ -737,7 +737,7 @@ XMLSTR ToXMLStringTool::toXML(XMLCSTR source) }
int l=lengthXMLString(source)+1;
if (l>buflen) { freeBuffer(); buflen=l; buf=(XMLSTR)malloc(l*sizeof(XMLCHAR)); }
- return toXMLUnSafe(buf,source);
+ return toXMLUnSafe(buf, source);
}
// private:
@@ -745,14 +745,14 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML) {
// This function is the opposite of the function "toXMLString". It decodes the escape
// sequences &, ", ', <, > and replace them by the characters
- // &,",',<,>. This function is used internally by the XML Parser. All the calls to
+ // &, ", ', <, >. This function is used internally by the XML Parser. All the calls to
// the XML library will always gives you back "decoded" strings.
//
// in: string (s) and length (lo) of string
// out: new allocated string converted from xml
if (!s) return NULL;
- int ll=0,j;
+ int ll=0, j;
XMLSTR d;
XMLCSTR ss=s;
XMLCharacterEntity *entity;
@@ -776,7 +776,7 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML) entity=XMLEntities;
do
{
- if ((lo>=entity->l)&&(xstrnicmp(s,entity->s,entity->l) == 0)) { s+=entity->l; lo-=entity->l; break; }
+ if ((lo>=entity->l)&&(xstrnicmp(s, entity->s, entity->l) == 0)) { s+=entity->l; lo-=entity->l; break; }
entity++;
} while (entity->s);
if (!entity->s)
@@ -834,7 +834,7 @@ XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML) entity=XMLEntities;
do
{
- if (xstrnicmp(ss,entity->s,entity->l) == 0) { *(d++)=entity->c; ss+=entity->l; break; }
+ if (xstrnicmp(ss, entity->s, entity->l) == 0) { *(d++)=entity->c; ss+=entity->l; break; }
entity++;
} while (entity->s);
}
@@ -902,7 +902,7 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT NextToken result;
XMLCHAR ch;
XMLCHAR chTemp;
- int indexStart,nFoundMatch,nIsText=FALSE;
+ int indexStart, nFoundMatch, nIsText=FALSE;
result.pClr=NULL; // prevent warning
// Find next non-white space character
@@ -975,7 +975,7 @@ static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pT ctag++;
} while (ctag->lpszOpen);
- // Peek at the next character to see if we have an end tag '</',
+ // Peek at the next character to see if we have an end tag '</',
// or an xml declaration '<?'
chTemp = pXML->lpXML[pXML->nIndex];
@@ -1109,8 +1109,8 @@ XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration) }
}
-XMLNode XMLNode::createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration) { return XMLNode(NULL,lpszName,isDeclaration); }
-XMLNode XMLNode::createXMLTopNode(XMLCSTR lpszName, char isDeclaration) { return XMLNode(NULL,stringDup(lpszName),isDeclaration); }
+XMLNode XMLNode::createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration) { return XMLNode(NULL, lpszName, isDeclaration); }
+XMLNode XMLNode::createXMLTopNode(XMLCSTR lpszName, char isDeclaration) { return XMLNode(NULL, stringDup(lpszName), isDeclaration); }
#define MEMORYINCREASE 50
@@ -1118,7 +1118,7 @@ static inline void myFree(void *p) { if (p) free(p); } static inline void *myRealloc(void *p, int newsize, int memInc, int sizeofElem)
{
if (p == NULL) { if (memInc) return malloc(memInc*sizeofElem); return malloc(sizeofElem); }
- if ((memInc == 0)||((newsize%memInc) == 0)) p=realloc(p,(newsize+memInc)*sizeofElem);
+ if ((memInc == 0)||((newsize%memInc) == 0)) p=realloc(p, (newsize+memInc)*sizeofElem);
// if (!p)
// {
// printf("XMLParser Error: Not enough memory! Aborting...\n"); exit(220);
@@ -1130,32 +1130,32 @@ static inline void *myRealloc(void *p, int newsize, int memInc, int sizeofElem) XMLElementPosition XMLNode::findPosition(XMLNodeData *d, int index, XMLElementType xxtype)
{
if (index<0) return -1;
- int i=0,j=(int)((index<<2)+xxtype),*o=d->pOrder; while (o[i] != j) i++; return i;
+ int i=0, j=(int)((index<<2)+xxtype), *o=d->pOrder; while (o[i] != j) i++; return i;
}
// private:
// update "order" information when deleting a content of a XMLNode
int XMLNode::removeOrderElement(XMLNodeData *d, XMLElementType t, int index)
{
- int n=d->nChild+d->nText+d->nClear, *o=d->pOrder,i=findPosition(d,index,t);
+ int n=d->nChild+d->nText+d->nClear, *o=d->pOrder, i=findPosition(d, index, t);
memmove(o+i, o+i+1, (n-i)*sizeof(int));
for (;i<n;i++)
if ((o[i]&3) == (int)t) o[i]-=4;
// We should normally do:
- // d->pOrder=(int)realloc(d->pOrder,n*sizeof(int));
+ // d->pOrder=(int)realloc(d->pOrder, n*sizeof(int));
// but we skip reallocation because it's too time consuming.
// Anyway, at the end, it will be free'd completely at once.
return i;
}
-void *XMLNode::addToOrder(int memoryIncrease,int *_pos, int nc, void *p, int size, XMLElementType xtype)
+void *XMLNode::addToOrder(int memoryIncrease, int *_pos, int nc, void *p, int size, XMLElementType xtype)
{
// in: *_pos is the position inside d->pOrder ("-1" means "EndOf")
// out: *_pos is the index inside p
- p=myRealloc(p,(nc+1),memoryIncrease,size);
+ p=myRealloc(p, (nc+1), memoryIncrease, size);
int n=d->nChild+d->nText+d->nClear;
- d->pOrder=(int*)myRealloc(d->pOrder,n+1,memoryIncrease*3,sizeof(int));
- int pos=*_pos,*o=d->pOrder;
+ d->pOrder=(int*)myRealloc(d->pOrder, n+1, memoryIncrease*3, sizeof(int));
+ int pos=*_pos, *o=d->pOrder;
if ((pos<0)||(pos>=n)) { *_pos=nc; o[n]=(int)((nc<<2)+xtype); return p; }
@@ -1169,7 +1169,7 @@ void *XMLNode::addToOrder(int memoryIncrease,int *_pos, int nc, void *p, int siz for (i=pos+1;i<=n;i++) if ((o[i]&3) == (int)xtype) o[i]+=4;
*_pos=pos=o[pos]>>2;
- memmove(((char*)p)+(pos+1)*size,((char*)p)+pos*size,(nc-pos)*size);
+ memmove(((char*)p)+(pos+1)*size, ((char*)p)+pos*size, (nc-pos)*size);
return p;
}
@@ -1178,20 +1178,20 @@ void *XMLNode::addToOrder(int memoryIncrease,int *_pos, int nc, void *p, int siz XMLNode XMLNode::addChild_priv(int memoryIncrease, XMLSTR lpszName, char isDeclaration, int pos)
{
if (!lpszName) return emptyXMLNode;
- d->pChild=(XMLNode*)addToOrder(memoryIncrease,&pos,d->nChild,d->pChild,sizeof(XMLNode),eNodeChild);
+ d->pChild=(XMLNode*)addToOrder(memoryIncrease, &pos, d->nChild, d->pChild, sizeof(XMLNode), eNodeChild);
d->pChild[pos].d=NULL;
- d->pChild[pos]=XMLNode(d,lpszName,isDeclaration);
+ d->pChild[pos]=XMLNode(d, lpszName, isDeclaration);
d->nChild++;
return d->pChild[pos];
}
// Add an attribute to an element.
-XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease,XMLSTR lpszName, XMLSTR lpszValuev)
+XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease, XMLSTR lpszName, XMLSTR lpszValuev)
{
if (!lpszName) return &emptyXMLAttribute;
if (!d) { myFree(lpszName); myFree(lpszValuev); return &emptyXMLAttribute; }
int nc=d->nAttribute;
- d->pAttribute=(XMLAttribute*)myRealloc(d->pAttribute,(nc+1),memoryIncrease,sizeof(XMLAttribute));
+ d->pAttribute=(XMLAttribute*)myRealloc(d->pAttribute, (nc+1), memoryIncrease, sizeof(XMLAttribute));
XMLAttribute *pAttr=d->pAttribute+nc;
pAttr->lpszName = lpszName;
pAttr->lpszValue = lpszValuev;
@@ -1211,7 +1211,7 @@ XMLCSTR XMLNode::addText_priv(int memoryIncrease, XMLSTR lpszValue, int pos) if (!lpszValue) return NULL;
if (!d) { myFree(lpszValue); return NULL; }
invalidateInnerText();
- d->pText=(XMLCSTR*)addToOrder(memoryIncrease,&pos,d->nText,d->pText,sizeof(XMLSTR),eNodeText);
+ d->pText=(XMLCSTR*)addToOrder(memoryIncrease, &pos, d->nText, d->pText, sizeof(XMLSTR), eNodeText);
d->pText[pos]=lpszValue;
d->nText++;
return lpszValue;
@@ -1223,7 +1223,7 @@ XMLClear *XMLNode::addClear_priv(int memoryIncrease, XMLSTR lpszValue, XMLCSTR l if (!lpszValue) return &emptyXMLClear;
if (!d) { myFree(lpszValue); return &emptyXMLClear; }
invalidateInnerText();
- d->pClear=(XMLClear *)addToOrder(memoryIncrease,&pos,d->nClear,d->pClear,sizeof(XMLClear),eNodeClear);
+ d->pClear=(XMLClear *)addToOrder(memoryIncrease, &pos, d->nClear, d->pClear, sizeof(XMLClear), eNodeClear);
XMLClear *pNewClear=d->pClear+pos;
pNewClear->lpszValue = lpszValue;
if (!lpszOpen) lpszOpen=XMLClearTags->lpszOpen;
@@ -1252,7 +1252,7 @@ char XMLNode::parseClearTag(void *px, void *_pClear) XMLCSTR pCh=lpXML;
while (*pCh)
{
- if (*pCh == _CXML('<')) { pClear.lpszClose=docTypeEnd; lpszTemp=xstrstr(lpXML,docTypeEnd); break; }
+ if (*pCh == _CXML('<')) { pClear.lpszClose=docTypeEnd; lpszTemp=xstrstr(lpXML, docTypeEnd); break; }
else if (*pCh == _CXML('>')) { lpszTemp=pCh; break; }
#ifdef _XMLWIDECHAR
pCh++;
@@ -1270,7 +1270,7 @@ char XMLNode::parseClearTag(void *px, void *_pClear) pXML->nIndex += cbTemp+(int)xstrlen(pClear.lpszClose);
// Add the clear node to the current element
- addClear_priv(MEMORYINCREASE,cbTemp?stringDup(lpXML,cbTemp):NULL, pClear.lpszOpen, pClear.lpszClose,-1);
+ addClear_priv(MEMORYINCREASE, cbTemp?stringDup(lpXML, cbTemp):NULL, pClear.lpszOpen, pClear.lpszClose, -1);
return 0;
}
@@ -1281,11 +1281,11 @@ char XMLNode::parseClearTag(void *px, void *_pClear) void XMLNode::exactMemory(XMLNodeData *d)
{
- if (d->pOrder) d->pOrder=(int*)realloc(d->pOrder,(d->nChild+d->nText+d->nClear)*sizeof(int));
- if (d->pChild) d->pChild=(XMLNode*)realloc(d->pChild,d->nChild*sizeof(XMLNode));
- if (d->pAttribute) d->pAttribute=(XMLAttribute*)realloc(d->pAttribute,d->nAttribute*sizeof(XMLAttribute));
- if (d->pText) d->pText=(XMLCSTR*)realloc(d->pText,d->nText*sizeof(XMLSTR));
- if (d->pClear) d->pClear=(XMLClear *)realloc(d->pClear,d->nClear*sizeof(XMLClear));
+ if (d->pOrder) d->pOrder=(int*)realloc(d->pOrder, (d->nChild+d->nText+d->nClear)*sizeof(int));
+ if (d->pChild) d->pChild=(XMLNode*)realloc(d->pChild, d->nChild*sizeof(XMLNode));
+ if (d->pAttribute) d->pAttribute=(XMLAttribute*)realloc(d->pAttribute, d->nAttribute*sizeof(XMLAttribute));
+ if (d->pText) d->pText=(XMLCSTR*)realloc(d->pText, d->nText*sizeof(XMLSTR));
+ if (d->pClear) d->pClear=(XMLClear *)realloc(d->pClear, d->nClear*sizeof(XMLClear));
}
char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr)
@@ -1298,14 +1298,14 @@ char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr) if (!cbText) { pXML->lpszText=NULL; return 0; }
if (dropWhiteSpace) { cbText--; while ((cbText)&&XML_isSPACECHAR(lpszText[cbText])) cbText--; cbText++; }
if (!cbText) { pXML->lpszText=NULL; return 0; }
- XMLSTR lpt=fromXMLString(lpszText,cbText,pXML);
+ XMLSTR lpt=fromXMLString(lpszText, cbText, pXML);
if (!lpt) return 1;
pXML->lpszText=NULL;
if (removeCommentsInMiddleOfText && d->nText && d->nClear)
{
// if the previous insertion was a comment (<!-- -->) AND
// if the previous previous insertion was a text then, delete the comment and append the text
- int n=d->nChild+d->nText+d->nClear-1,*o=d->pOrder;
+ int n=d->nChild+d->nText+d->nClear-1, *o=d->pOrder;
if (((o[n]&3) == eNodeClear)&&((o[n-1]&3) == eNodeText))
{
int i=o[n]>>2;
@@ -1315,15 +1315,15 @@ char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr) i=o[n-1]>>2;
n=xstrlen(d->pText[i]);
int n2=xstrlen(lpt)+1;
- d->pText[i]=(XMLSTR)realloc((void*)d->pText[i],(n+n2)*sizeof(XMLCHAR));
+ d->pText[i]=(XMLSTR)realloc((void*)d->pText[i], (n+n2)*sizeof(XMLCHAR));
if (!d->pText[i]) return 1;
- memcpy((void*)(d->pText[i]+n),lpt,n2*sizeof(XMLCHAR));
+ memcpy((void*)(d->pText[i]+n), lpt, n2*sizeof(XMLCHAR));
free(lpt);
return 0;
}
}
}
- addText_priv(MEMORYINCREASE,lpt,-1);
+ addText_priv(MEMORYINCREASE, lpt, -1);
return 0;
}
// private:
@@ -1389,7 +1389,7 @@ int XMLNode::ParseXMLElement(void *pa) nDeclaration = (xtype == eTokenDeclaration);
// If we have node text then add this to the element
- if (maybeAddTxT(pXML,token.pStr)) return FALSE;
+ if (maybeAddTxT(pXML, token.pStr)) return FALSE;
// Find the name of the tag
token = GetNextToken(pXML, &cbToken, &xtype);
@@ -1420,7 +1420,7 @@ int XMLNode::ParseXMLElement(void *pa) // If the name of the new element differs from the name of
// the current element we need to add the new element to
// the current one and recurse
- pNew = addChild_priv(MEMORYINCREASE,stringDup(token.pStr,cbToken), nDeclaration,-1);
+ pNew = addChild_priv(MEMORYINCREASE, stringDup(token.pStr, cbToken), nDeclaration, -1);
while (!pNew.isEmpty())
{
@@ -1474,7 +1474,7 @@ int XMLNode::ParseXMLElement(void *pa) }
// Add the new element and recurse
- pNew = addChild_priv(MEMORYINCREASE,stringDup(pXML->lpNewElement,pXML->cbNewElement),0,-1);
+ pNew = addChild_priv(MEMORYINCREASE, stringDup(pXML->lpNewElement, pXML->cbNewElement), 0, -1);
pXML->cbNewElement = 0;
}
else
@@ -1492,7 +1492,7 @@ int XMLNode::ParseXMLElement(void *pa) case eTokenTagEnd:
// If we have node text then add this to the element
- if (maybeAddTxT(pXML,token.pStr)) return FALSE;
+ if (maybeAddTxT(pXML, token.pStr)) return FALSE;
// Find the name of the end tag
token = GetNextToken(pXML, &cbTemp, &xtype);
@@ -1552,7 +1552,7 @@ LBL_Error: // If we found a clear (unformatted) token
case eTokenClear:
// If we have node text then add this to the element
- if (maybeAddTxT(pXML,token.pStr)) return FALSE;
+ if (maybeAddTxT(pXML, token.pStr)) return FALSE;
if (parseClearTag(pXML, token.pClr)) return FALSE;
pXML->lpszText=pXML->lpXML+pXML->nIndex;
break;
@@ -1622,7 +1622,7 @@ LBL_Error: // Eg. 'Attribute AnotherAttribute'
case eTokenText:
// Add the unvalued attribute to the list
- addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp), NULL);
+ addAttribute_priv(MEMORYINCREASE, stringDup(lpszTemp, cbTemp), NULL);
// Cache the token then indicate. We are next to
// look for the equals attribute
lpszTemp = token.pStr;
@@ -1647,7 +1647,7 @@ LBL_Error: if (cbTemp)
{
// Add the unvalued attribute to the list
- addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp), NULL);
+ addAttribute_priv(MEMORYINCREASE, stringDup(lpszTemp, cbTemp), NULL);
}
// If this is the end of the tag then return to the caller
@@ -1706,10 +1706,10 @@ LBL_Error: XMLSTR attrVal=(XMLSTR)token.pStr;
if (attrVal)
{
- attrVal=fromXMLString(attrVal,cbToken,pXML);
+ attrVal=fromXMLString(attrVal, cbToken, pXML);
if (!attrVal) return FALSE;
}
- addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp),attrVal);
+ addAttribute_priv(MEMORYINCREASE, stringDup(lpszTemp, cbTemp), attrVal);
}
// Indicate we are searching for a new attribute
@@ -1744,7 +1744,7 @@ LBL_Error: #endif
pXML->nIndexMissigEndTag=pXML->nIndex;
}
- maybeAddTxT(pXML,pXML->lpXML+pXML->nIndex);
+ maybeAddTxT(pXML, pXML->lpXML+pXML->nIndex);
return FALSE;
}
}
@@ -1757,7 +1757,7 @@ static void CountLinesAndColumns(XMLCSTR lpXML, int nUpto, XMLResults *pResults) assert(lpXML);
assert(pResults);
- struct XML xml={ lpXML,lpXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
+ struct XML xml={ lpXML, lpXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
pResults->nLine = 1;
pResults->nColumn = 1;
@@ -1787,7 +1787,7 @@ XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults) return emptyXMLNode;
}
- XMLNode xnode(NULL,NULL,FALSE);
+ XMLNode xnode(NULL, NULL, FALSE);
struct XML xml={ lpszXML, lpszXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
// Create header element
@@ -1800,7 +1800,7 @@ XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults) if ((error == eXMLErrorNone)||(error == eXMLErrorMissingEndTag)||(error == eXMLErrorNoXMLTagFound))
{
XMLCSTR name=xnode.getName();
- if (tag&&(*tag)&&((!name)||(xstricmp(name,tag))))
+ if (tag&&(*tag)&&((!name)||(xstricmp(name, tag))))
{
xnode=xnode.getChildNode(tag);
if (xnode.isEmpty())
@@ -1843,24 +1843,24 @@ XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults) XMLNode XMLNode::parseFile(XMLCSTR filename, XMLCSTR tag, XMLResults *pResults)
{
if (pResults) { pResults->nLine=0; pResults->nColumn=0; }
- FILE *f=xfopen(filename,_CXML("rb"));
+ FILE *f=xfopen(filename, _CXML("rb"));
if (f == NULL) { if (pResults) pResults->error=eXMLErrorFileNotFound; return emptyXMLNode; }
- fseek(f,0,SEEK_END);
- int l=(int)ftell(f),headerSz=0;
+ fseek(f, 0, SEEK_END);
+ int l=(int)ftell(f), headerSz=0;
if (!l) { if (pResults) pResults->error=eXMLErrorEmpty; fclose(f); return emptyXMLNode; }
- fseek(f,0,SEEK_SET);
+ fseek(f, 0, SEEK_SET);
unsigned char *buf=(unsigned char*)malloc(l+4);
- l=(int)fread(buf,1,l,f);
+ l=(int)fread(buf, 1, l, f);
fclose(f);
buf[l]=0;buf[l+1]=0;buf[l+2]=0;buf[l+3]=0;
#ifdef _XMLWIDECHAR
if (guessWideCharChars)
{
- if (!myIsTextWideChar(buf,l))
+ if (!myIsTextWideChar(buf, l))
{
XMLNode::XMLCharEncoding ce=XMLNode::char_encoding_legacy;
if ((buf[0] == 0xef)&&(buf[1] == 0xbb)&&(buf[2] == 0xbf)) { headerSz=3; ce=XMLNode::char_encoding_UTF8; }
- XMLSTR b2=myMultiByteToWideChar((const char*)(buf+headerSz),ce);
+ XMLSTR b2=myMultiByteToWideChar((const char*)(buf+headerSz), ce);
if (!b2)
{
// todo: unable to convert
@@ -1880,7 +1880,7 @@ XMLNode XMLNode::parseFile(XMLCSTR filename, XMLCSTR tag, XMLResults *pResults) #else
if (guessWideCharChars)
{
- if (myIsTextWideChar(buf,l))
+ if (myIsTextWideChar(buf, l))
{
if ((buf[0] == 0xef)&&(buf[1] == 0xff)) headerSz=2;
if ((buf[0] == 0xff)&&(buf[1] == 0xfe)) headerSz=2;
@@ -1899,12 +1899,12 @@ XMLNode XMLNode::parseFile(XMLCSTR filename, XMLCSTR tag, XMLResults *pResults) #endif
if (!buf) { if (pResults) pResults->error=eXMLErrorCharConversionError; return emptyXMLNode; }
- XMLNode x=parseString((XMLSTR)(buf+headerSz),tag,pResults);
+ XMLNode x=parseString((XMLSTR)(buf+headerSz), tag, pResults);
free(buf);
return x;
}
-static inline void charmemset(XMLSTR dest,XMLCHAR c,int l) { while (l--) *(dest++)=c; }
+static inline void charmemset(XMLSTR dest, XMLCHAR c, int l) { while (l--) *(dest++)=c; }
// private:
// Creates an user friendly XML string from a given element with
// appropriate white space and carriage returns.
@@ -1918,7 +1918,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma int cbElement;
int nChildFormat=-1;
int nElementI=pEntry->nChild+pEntry->nText+pEntry->nClear;
- int i,j;
+ int i, j;
if ((nFormat>=0)&&(nElementI == 1)&&(pEntry->nText == 1)&&(!pEntry->isDeclaration)) nFormat=-2;
assert(pEntry);
@@ -1965,7 +1965,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma {
lpszMarker[nResult]=_CXML('=');
lpszMarker[nResult+1]=_CXML('"');
- if (cb) ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+2],pAttr->lpszValue);
+ if (cb) ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+2], pAttr->lpszValue);
lpszMarker[nResult+cb+2]=_CXML('"');
}
nResult+=cb+3;
@@ -2028,8 +2028,8 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma {
if (lpszMarker)
{
- charmemset(&lpszMarker[nResult],INDENTCHAR,nFormat+1);
- ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+nFormat+1],pChild);
+ charmemset(&lpszMarker[nResult], INDENTCHAR, nFormat+1);
+ ToXMLStringTool::toXMLUnSafe(&lpszMarker[nResult+nFormat+1], pChild);
lpszMarker[nResult+nFormat+1+cb]=_CXML('\n');
}
nResult+=cb+nFormat+2;
@@ -2112,7 +2112,7 @@ int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nForma {
if (nFormat >=0)
{
- charmemset(&lpszMarker[nResult], INDENTCHAR,nFormat);
+ charmemset(&lpszMarker[nResult], INDENTCHAR, nFormat);
nResult+=nFormat;
}
@@ -2188,9 +2188,9 @@ int XMLNode::detachFromParent(XMLNodeData *d) int i=0;
while (((void*)(pa[i].d)) != ((void*)d)) i++;
d->pParent->nChild--;
- if (d->pParent->nChild) memmove(pa+i,pa+i+1,(d->pParent->nChild-i)*sizeof(XMLNode));
+ if (d->pParent->nChild) memmove(pa+i, pa+i+1, (d->pParent->nChild-i)*sizeof(XMLNode));
else { free(pa); d->pParent->pChild=NULL; }
- return removeOrderElement(d->pParent,eNodeChild,i);
+ return removeOrderElement(d->pParent, eNodeChild, i);
}
XMLNode::~XMLNode()
@@ -2276,7 +2276,7 @@ XMLNode::XMLNode(const XMLNode &A) XMLNode XMLNode::deepCopy() const
{
if (!d) return XMLNode::emptyXMLNode;
- XMLNode x(NULL,stringDup(d->lpszName),d->isDeclaration);
+ XMLNode x(NULL, stringDup(d->lpszName), d->isDeclaration);
XMLNodeData *p=x.d;
int n=d->nAttribute;
if (n)
@@ -2290,7 +2290,7 @@ XMLNode XMLNode::deepCopy() const }
if (d->pOrder)
{
- n=(d->nChild+d->nText+d->nClear)*sizeof(int); p->pOrder=(int*)malloc(n); memcpy(p->pOrder,d->pOrder,n);
+ n=(d->nChild+d->nText+d->nClear)*sizeof(int); p->pOrder=(int*)malloc(n); memcpy(p->pOrder, d->pOrder, n);
}
n=d->nText;
if (n)
@@ -2333,7 +2333,7 @@ XMLNode XMLNode::addChild(XMLNode childNode, int pos) int j=pos;
while (dc->nChild)
{
- addChild(dc->pChild[0],j);
+ addChild(dc->pChild[0], j);
if (pos>=0) j++;
}
return childNode;
@@ -2341,8 +2341,8 @@ XMLNode XMLNode::addChild(XMLNode childNode, int pos) if (dc->pParent) { if ((detachFromParent(dc)<=pos)&&(dc->pParent == d)) pos--; } else dc->ref_count++;
dc->pParent=d;
// int nc=d->nChild;
- // d->pChild=(XMLNode*)myRealloc(d->pChild,(nc+1),memoryIncrease,sizeof(XMLNode));
- d->pChild=(XMLNode*)addToOrder(0,&pos,d->nChild,d->pChild,sizeof(XMLNode),eNodeChild);
+ // d->pChild=(XMLNode*)myRealloc(d->pChild, (nc+1), memoryIncrease, sizeof(XMLNode));
+ d->pChild=(XMLNode*)addToOrder(0, &pos, d->nChild, d->pChild, sizeof(XMLNode), eNodeChild);
d->pChild[pos].d=dc;
d->nChild++;
return childNode;
@@ -2355,23 +2355,23 @@ void XMLNode::deleteAttribute(int i) XMLAttribute *p=d->pAttribute+i;
free((void*)p->lpszName);
if (p->lpszValue) free((void*)p->lpszValue);
- if (d->nAttribute) memmove(p,p+1,(d->nAttribute-i)*sizeof(XMLAttribute)); else { free(p); d->pAttribute=NULL; }
+ if (d->nAttribute) memmove(p, p+1, (d->nAttribute-i)*sizeof(XMLAttribute)); else { free(p); d->pAttribute=NULL; }
}
void XMLNode::deleteAttribute(XMLAttribute *a) { if (a) deleteAttribute(a->lpszName); }
void XMLNode::deleteAttribute(XMLCSTR lpszName)
{
int j=0;
- getAttribute(lpszName,&j);
+ getAttribute(lpszName, &j);
if (j) deleteAttribute(j-1);
}
-XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,int i)
+XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, int i)
{
if (!d) { if (lpszNewValue) free(lpszNewValue); if (lpszNewName) free(lpszNewName); return NULL; }
if (i>=d->nAttribute)
{
- if (lpszNewName) return addAttribute_WOSD(lpszNewName,lpszNewValue);
+ if (lpszNewName) return addAttribute_WOSD(lpszNewName, lpszNewValue);
return NULL;
}
XMLAttribute *p=d->pAttribute+i;
@@ -2383,26 +2383,26 @@ XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewN XMLAttribute *XMLNode::updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute)
{
- if (oldAttribute) return updateAttribute_WOSD((XMLSTR)newAttribute->lpszValue,(XMLSTR)newAttribute->lpszName,oldAttribute->lpszName);
- return addAttribute_WOSD((XMLSTR)newAttribute->lpszName,(XMLSTR)newAttribute->lpszValue);
+ if (oldAttribute) return updateAttribute_WOSD((XMLSTR)newAttribute->lpszValue, (XMLSTR)newAttribute->lpszName, oldAttribute->lpszName);
+ return addAttribute_WOSD((XMLSTR)newAttribute->lpszName, (XMLSTR)newAttribute->lpszValue);
}
-XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName)
+XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, XMLCSTR lpszOldName)
{
int j=0;
- getAttribute(lpszOldName,&j);
- if (j) return updateAttribute_WOSD(lpszNewValue,lpszNewName,j-1);
+ getAttribute(lpszOldName, &j);
+ if (j) return updateAttribute_WOSD(lpszNewValue, lpszNewName, j-1);
else
{
- if (lpszNewName) return addAttribute_WOSD(lpszNewName,lpszNewValue);
- else return addAttribute_WOSD(stringDup(lpszOldName),lpszNewValue);
+ if (lpszNewName) return addAttribute_WOSD(lpszNewName, lpszNewValue);
+ else return addAttribute_WOSD(stringDup(lpszOldName), lpszNewValue);
}
}
int XMLNode::indexText(XMLCSTR lpszValue) const
{
if (!d) return -1;
- int i,l=d->nText;
+ int i, l=d->nText;
if (!lpszValue) { if (l) return 0; return -1; }
XMLCSTR *p=d->pText;
for (i=0; i<l; i++) if (lpszValue == p[i]) return i;
@@ -2416,8 +2416,8 @@ void XMLNode::deleteText(int i) d->nText--;
XMLCSTR *p=d->pText+i;
free((void*)*p);
- if (d->nText) memmove(p,p+1,(d->nText-i)*sizeof(XMLCSTR)); else { free(p); d->pText=NULL; }
- removeOrderElement(d,eNodeText,i);
+ if (d->nText) memmove(p, p+1, (d->nText-i)*sizeof(XMLCSTR)); else { free(p); d->pText=NULL; }
+ removeOrderElement(d, eNodeText, i);
}
void XMLNode::deleteText(XMLCSTR lpszValue) { deleteText(indexText(lpszValue)); }
@@ -2436,7 +2436,7 @@ XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue) {
if (!d) { if (lpszNewValue) free(lpszNewValue); return NULL; }
int i=indexText(lpszOldValue);
- if (i>=0) return updateText_WOSD(lpszNewValue,i);
+ if (i>=0) return updateText_WOSD(lpszNewValue, i);
return addText_WOSD(lpszNewValue);
}
@@ -2447,14 +2447,14 @@ void XMLNode::deleteClear(int i) d->nClear--;
XMLClear *p=d->pClear+i;
free((void*)p->lpszValue);
- if (d->nClear) memmove(p,p+1,(d->nClear-i)*sizeof(XMLClear)); else { free(p); d->pClear=NULL; }
- removeOrderElement(d,eNodeClear,i);
+ if (d->nClear) memmove(p, p+1, (d->nClear-i)*sizeof(XMLClear)); else { free(p); d->pClear=NULL; }
+ removeOrderElement(d, eNodeClear, i);
}
int XMLNode::indexClear(XMLCSTR lpszValue) const
{
if (!d) return -1;
- int i,l=d->nClear;
+ int i, l=d->nClear;
if (!lpszValue) { if (l) return 0; return -1; }
XMLClear *p=d->pClear;
for (i=0; i<l; i++) if (lpszValue == p[i].lpszValue) return i;
@@ -2478,20 +2478,20 @@ XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, XMLCSTR lpszOldValue) {
if (!d) { if (lpszNewContent) free(lpszNewContent); return NULL; }
int i=indexClear(lpszOldValue);
- if (i>=0) return updateClear_WOSD(lpszNewContent,i);
+ if (i>=0) return updateClear_WOSD(lpszNewContent, i);
return addClear_WOSD(lpszNewContent);
}
-XMLClear *XMLNode::updateClear_WOSD(XMLClear *newP,XMLClear *oldP)
+XMLClear *XMLNode::updateClear_WOSD(XMLClear *newP, XMLClear *oldP)
{
- if (oldP) return updateClear_WOSD((XMLSTR)newP->lpszValue,(XMLSTR)oldP->lpszValue);
+ if (oldP) return updateClear_WOSD((XMLSTR)newP->lpszValue, (XMLSTR)oldP->lpszValue);
return NULL;
}
int XMLNode::nChildNode(XMLCSTR name) const
{
if (!d) return 0;
- int i,j=0,n=d->nChild;
+ int i, j=0, n=d->nChild;
XMLNode *pc=d->pChild;
for (i=0; i<n; i++)
{
@@ -2504,7 +2504,7 @@ int XMLNode::nChildNode(XMLCSTR name) const XMLNode XMLNode::getChildNode(XMLCSTR name, int *j) const
{
if (!d) return emptyXMLNode;
- int i=0,n=d->nChild;
+ int i=0, n=d->nChild;
if (j) i=*j;
XMLNode *pc=d->pChild+i;
for (; i<n; i++)
@@ -2525,11 +2525,11 @@ XMLNode XMLNode::getChildNode(XMLCSTR name, int j) const if (j>=0)
{
int i=0;
- while (j-->0) getChildNode(name,&i);
- return getChildNode(name,&i);
+ while (j-->0) getChildNode(name, &i);
+ return getChildNode(name, &i);
}
int i=d->nChild;
- while (i--) if (!xstricmp(name,d->pChild[i].d->lpszName)) break;
+ while (i--) if (!xstricmp(name, d->pChild[i].d->lpszName)) break;
if (i<0) return emptyXMLNode;
return getChildNode(i);
}
@@ -2539,7 +2539,7 @@ XMLNode XMLNode::getNextNode() const if (!d) return emptyXMLNode;
XMLNodeDataTag *par=d->pParent;
if (!par) return emptyXMLNode;
- int i,n=par->nChild;
+ int i, n=par->nChild;
for (i=0; i<n; ++i)
{
if (par->pChild[i].d == d) break;
@@ -2550,7 +2550,7 @@ XMLNode XMLNode::getNextNode() const XMLNode XMLNode::getChildNodeByPath(XMLCSTR _path, char createMissing, XMLCHAR sep)
{
XMLSTR path=stringDup(_path);
- XMLNode x=getChildNodeByPathNonConst(path,createMissing,sep);
+ XMLNode x=getChildNodeByPathNonConst(path, createMissing, sep);
if (path) free(path);
return x;
}
@@ -2558,9 +2558,9 @@ XMLNode XMLNode::getChildNodeByPath(XMLCSTR _path, char createMissing, XMLCHAR s XMLNode XMLNode::getChildNodeByPathNonConst(XMLSTR path, char createIfMissing, XMLCHAR sep)
{
if ((!path)||(!(*path))) return *this;
- XMLNode xn,xbase=*this;
- XMLCHAR *tend1,sepString[2]; sepString[0]=sep; sepString[1]=0;
- tend1=xstrstr(path,sepString);
+ XMLNode xn, xbase=*this;
+ XMLCHAR *tend1, sepString[2]; sepString[0]=sep; sepString[1]=0;
+ tend1=xstrstr(path, sepString);
while (tend1)
{
*tend1=0;
@@ -2573,16 +2573,16 @@ XMLNode XMLNode::getChildNodeByPathNonConst(XMLSTR path, char createIfMissing, X *tend1=sep;
xbase=xn;
path=tend1+1;
- tend1=xstrstr(path,sepString);
+ tend1=xstrstr(path, sepString);
}
xn=xbase.getChildNode(path);
if (xn.isEmpty()&&createIfMissing) xn=xbase.addChild(path);
return xn;
}
-XMLElementPosition XMLNode::positionOfText (int i) const { if (i>=d->nText ) i=d->nText-1; return findPosition(d,i,eNodeText ); }
-XMLElementPosition XMLNode::positionOfClear (int i) const { if (i>=d->nClear) i=d->nClear-1; return findPosition(d,i,eNodeClear); }
-XMLElementPosition XMLNode::positionOfChildNode(int i) const { if (i>=d->nChild) i=d->nChild-1; return findPosition(d,i,eNodeChild); }
+XMLElementPosition XMLNode::positionOfText (int i) const { if (i>=d->nText ) i=d->nText-1; return findPosition(d, i, eNodeText ); }
+XMLElementPosition XMLNode::positionOfClear (int i) const { if (i>=d->nClear) i=d->nClear-1; return findPosition(d, i, eNodeClear); }
+XMLElementPosition XMLNode::positionOfChildNode(int i) const { if (i>=d->nChild) i=d->nChild-1; return findPosition(d, i, eNodeChild); }
XMLElementPosition XMLNode::positionOfText (XMLCSTR lpszValue) const { return positionOfText (indexText (lpszValue)); }
XMLElementPosition XMLNode::positionOfClear(XMLCSTR lpszValue) const { return positionOfClear(indexClear(lpszValue)); }
XMLElementPosition XMLNode::positionOfClear(XMLClear *a) const { if (a) return positionOfClear(a->lpszValue); return positionOfClear(); }
@@ -2592,26 +2592,26 @@ XMLElementPosition XMLNode::positionOfChildNode(XMLNode x) const XMLNodeData *dd=x.d;
XMLNode *pc=d->pChild;
int i=d->nChild;
- while (i--) if (pc[i].d == dd) return findPosition(d,i,eNodeChild);
+ while (i--) if (pc[i].d == dd) return findPosition(d, i, eNodeChild);
return -1;
}
XMLElementPosition XMLNode::positionOfChildNode(XMLCSTR name, int count) const
{
if (!name) return positionOfChildNode(count);
int j=0;
- do { getChildNode(name,&j); if (j<0) return -1; } while (count--);
- return findPosition(d,j-1,eNodeChild);
+ do { getChildNode(name, &j); if (j<0) return -1; } while (count--);
+ return findPosition(d, j-1, eNodeChild);
}
-XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name,XMLCSTR attributeName,XMLCSTR attributeValue, int *k) const
+XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name, XMLCSTR attributeName, XMLCSTR attributeValue, int *k) const
{
- int i=0,j;
+ int i=0, j;
if (k) i=*k;
XMLNode x;
XMLCSTR t;
do
{
- x=getChildNode(name,&i);
+ x=getChildNode(name, &i);
if (!x.isEmpty())
{
if (attributeValue)
@@ -2619,8 +2619,8 @@ XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name,XMLCSTR attributeName,XM j=0;
do
{
- t=x.getAttribute(attributeName,&j);
- if (t&&(xstricmp(attributeValue,t) == 0)) { if (k) *k=i; return x; }
+ t=x.getAttribute(attributeName, &j);
+ if (t&&(xstricmp(attributeValue, t) == 0)) { if (k) *k=i; return x; }
} while (t);
} else
{
@@ -2635,7 +2635,7 @@ XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name,XMLCSTR attributeName,XM XMLCSTR XMLNode::getAttribute(XMLCSTR lpszAttrib, int *j) const
{
if (!d) return NULL;
- int i=0,n=d->nAttribute;
+ int i=0, n=d->nAttribute;
if (j) i=*j;
XMLAttribute *pAttr=d->pAttribute+i;
for (; i<n; i++)
@@ -2653,7 +2653,7 @@ XMLCSTR XMLNode::getAttribute(XMLCSTR lpszAttrib, int *j) const char XMLNode::isAttributeSet(XMLCSTR lpszAttrib) const
{
if (!d) return FALSE;
- int i,n=d->nAttribute;
+ int i, n=d->nAttribute;
XMLAttribute *pAttr=d->pAttribute;
for (i=0; i<n; i++)
{
@@ -2670,8 +2670,8 @@ XMLCSTR XMLNode::getAttribute(XMLCSTR name, int j) const {
if (!d) return NULL;
int i=0;
- while (j-->0) getAttribute(name,&i);
- return getAttribute(name,&i);
+ while (j-->0) getAttribute(name, &i);
+ return getAttribute(name, &i);
}
XMLNodeContents XMLNode::enumContents(int i) const
@@ -2756,41 +2756,41 @@ char XMLNode::isEmpty ( ) const { return (d == NULL); } XMLNode XMLNode::emptyNode ( ) { return XMLNode::emptyXMLNode; }
XMLNode XMLNode::addChild(XMLCSTR lpszName, char isDeclaration, XMLElementPosition pos)
-{ return addChild_priv(0,stringDup(lpszName),isDeclaration,pos); }
+{ return addChild_priv(0, stringDup(lpszName), isDeclaration, pos); }
XMLNode XMLNode::addChild_WOSD(XMLSTR lpszName, char isDeclaration, XMLElementPosition pos)
-{ return addChild_priv(0,lpszName,isDeclaration,pos); }
+{ return addChild_priv(0, lpszName, isDeclaration, pos); }
XMLAttribute *XMLNode::addAttribute(XMLCSTR lpszName, XMLCSTR lpszValue)
-{ return addAttribute_priv(0,stringDup(lpszName),stringDup(lpszValue)); }
+{ return addAttribute_priv(0, stringDup(lpszName), stringDup(lpszValue)); }
XMLAttribute *XMLNode::addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValuev)
-{ return addAttribute_priv(0,lpszName,lpszValuev); }
+{ return addAttribute_priv(0, lpszName, lpszValuev); }
XMLCSTR XMLNode::addText(XMLCSTR lpszValue, XMLElementPosition pos)
-{ return addText_priv(0,stringDup(lpszValue),pos); }
+{ return addText_priv(0, stringDup(lpszValue), pos); }
XMLCSTR XMLNode::addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos)
-{ return addText_priv(0,lpszValue,pos); }
+{ return addText_priv(0, lpszValue, pos); }
XMLClear *XMLNode::addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, XMLElementPosition pos)
-{ return addClear_priv(0,stringDup(lpszValue),lpszOpen,lpszClose,pos); }
+{ return addClear_priv(0, stringDup(lpszValue), lpszOpen, lpszClose, pos); }
XMLClear *XMLNode::addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, XMLElementPosition pos)
-{ return addClear_priv(0,lpszValue,lpszOpen,lpszClose,pos); }
+{ return addClear_priv(0, lpszValue, lpszOpen, lpszClose, pos); }
XMLCSTR XMLNode::updateName(XMLCSTR lpszName)
{ return updateName_WOSD(stringDup(lpszName)); }
XMLAttribute *XMLNode::updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute)
-{ return updateAttribute_WOSD(stringDup(newAttribute->lpszValue),stringDup(newAttribute->lpszName),oldAttribute->lpszName); }
-XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,int i)
-{ return updateAttribute_WOSD(stringDup(lpszNewValue),stringDup(lpszNewName),i); }
-XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName)
-{ return updateAttribute_WOSD(stringDup(lpszNewValue),stringDup(lpszNewName),lpszOldName); }
+{ return updateAttribute_WOSD(stringDup(newAttribute->lpszValue), stringDup(newAttribute->lpszName), oldAttribute->lpszName); }
+XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName, int i)
+{ return updateAttribute_WOSD(stringDup(lpszNewValue), stringDup(lpszNewName), i); }
+XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName, XMLCSTR lpszOldName)
+{ return updateAttribute_WOSD(stringDup(lpszNewValue), stringDup(lpszNewName), lpszOldName); }
XMLCSTR XMLNode::updateText(XMLCSTR lpszNewValue, int i)
-{ return updateText_WOSD(stringDup(lpszNewValue),i); }
+{ return updateText_WOSD(stringDup(lpszNewValue), i); }
XMLCSTR XMLNode::updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue)
-{ return updateText_WOSD(stringDup(lpszNewValue),lpszOldValue); }
+{ return updateText_WOSD(stringDup(lpszNewValue), lpszOldValue); }
XMLClear *XMLNode::updateClear(XMLCSTR lpszNewContent, int i)
-{ return updateClear_WOSD(stringDup(lpszNewContent),i); }
+{ return updateClear_WOSD(stringDup(lpszNewContent), i); }
XMLClear *XMLNode::updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue)
-{ return updateClear_WOSD(stringDup(lpszNewValue),lpszOldValue); }
-XMLClear *XMLNode::updateClear(XMLClear *newP,XMLClear *oldP)
-{ return updateClear_WOSD(stringDup(newP->lpszValue),oldP->lpszValue); }
+{ return updateClear_WOSD(stringDup(lpszNewValue), lpszOldValue); }
+XMLClear *XMLNode::updateClear(XMLClear *newP, XMLClear *oldP)
+{ return updateClear_WOSD(stringDup(newP->lpszValue), oldP->lpszValue); }
-char XMLNode::setGlobalOptions(XMLCharEncoding _characterEncoding, char _guessWideCharChars,
+char XMLNode::setGlobalOptions(XMLCharEncoding _characterEncoding, char _guessWideCharChars,
char _dropWhiteSpace, char _removeCommentsInMiddleOfText)
{
guessWideCharChars=_guessWideCharChars; dropWhiteSpace=_dropWhiteSpace; removeCommentsInMiddleOfText=_removeCommentsInMiddleOfText;
@@ -2811,13 +2811,13 @@ char XMLNode::setGlobalOptions(XMLCharEncoding _characterEncoding, char _guessWi return 0;
}
-XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf,int l, char useXMLEncodingAttribute)
+XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf, int l, char useXMLEncodingAttribute)
{
#ifdef _XMLWIDECHAR
return (XMLCharEncoding)0;
#else
if (l<25) return (XMLCharEncoding)0;
- if (guessWideCharChars&&(myIsTextWideChar(buf,l))) return (XMLCharEncoding)0;
+ if (guessWideCharChars&&(myIsTextWideChar(buf, l))) return (XMLCharEncoding)0;
unsigned char *b=(unsigned char*)buf;
if ((b[0] == 0xef)&&(b[1] == 0xbb)&&(b[2] == 0xbf)) return char_encoding_UTF8;
@@ -2837,29 +2837,29 @@ XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf,int l, char useXML // if encoding is specified and different from utf-8 than it's non-utf8
// otherwise it's utf-8
char bb[201];
- l=mmin(l,200);
- memcpy(bb,buf,l); // copy buf into bb to be able to do "bb[l]=0"
+ l=mmin(l, 200);
+ memcpy(bb, buf, l); // copy buf into bb to be able to do "bb[l]=0"
bb[l]=0;
- b=(unsigned char*)strstr(bb,"encoding");
+ b=(unsigned char*)strstr(bb, "encoding");
if (!b) return bestGuess;
b+=8; while XML_isSPACECHAR(*b) b++; if (*b != '=') return bestGuess;
b++; while XML_isSPACECHAR(*b) b++; if ((*b != '\'')&&(*b != '"')) return bestGuess;
b++; while XML_isSPACECHAR(*b) b++;
- if ((xstrnicmp((char*)b,"utf-8",5) == 0)||
- (xstrnicmp((char*)b,"utf8",4) == 0))
+ if ((xstrnicmp((char*)b, "utf-8", 5) == 0)||
+ (xstrnicmp((char*)b, "utf8", 4) == 0))
{
if (bestGuess == char_encoding_legacy) return char_encoding_error;
return char_encoding_UTF8;
}
- if ((xstrnicmp((char*)b,"shiftjis",8) == 0)||
- (xstrnicmp((char*)b,"shift-jis",9) == 0)||
- (xstrnicmp((char*)b,"sjis",4) == 0)) return char_encoding_ShiftJIS;
+ if ((xstrnicmp((char*)b, "shiftjis", 8) == 0)||
+ (xstrnicmp((char*)b, "shift-jis", 9) == 0)||
+ (xstrnicmp((char*)b, "sjis", 4) == 0)) return char_encoding_ShiftJIS;
- if (xstrnicmp((char*)b,"GB2312",6) == 0) return char_encoding_GB2312;
- if (xstrnicmp((char*)b,"Big5",4) == 0) return char_encoding_Big5;
- if (xstrnicmp((char*)b,"GBK",3) == 0) return char_encoding_GBK;
+ if (xstrnicmp((char*)b, "GB2312", 6) == 0) return char_encoding_GB2312;
+ if (xstrnicmp((char*)b, "Big5", 4) == 0) return char_encoding_Big5;
+ if (xstrnicmp((char*)b, "GBK", 3) == 0) return char_encoding_GBK;
return char_encoding_legacy;
#endif
@@ -2878,15 +2878,15 @@ XMLCSTR base64EncodeTable=_CXML("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu // Decode Table gives the index of any valid base64 character in the Base64 table]
// 96: '=' - 97: space char - 98: illegal char - 99: end of string
const unsigned char base64DecodeTable[] = {
- 99,98,98,98,98,98,98,98,98,97, 97,98,98,97,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, //00 -29
- 98,98,97,98,98,98,98,98,98,98, 98,98,98,62,98,98,98,63,52,53, 54,55,56,57,58,59,60,61,98,98, //30 -59
- 98,96,98,98,98, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, 15,16,17,18,19,20,21,22,23,24, //60 -89
- 25,98,98,98,98,98,98,26,27,28, 29,30,31,32,33,34,35,36,37,38, 39,40,41,42,43,44,45,46,47,48, //90 -119
- 49,50,51,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, //120 -149
- 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, //150 -179
- 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, //180 -209
- 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98,98,98,98,98, //210 -239
- 98,98,98,98,98,98,98,98,98,98, 98,98,98,98,98,98 //240 -255
+ 99, 98, 98, 98, 98, 98, 98, 98, 98, 97, 97, 98, 98, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, //00 -29
+ 98, 98, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 62, 98, 98, 98, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 98, 98, //30 -59
+ 98, 96, 98, 98, 98, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, //60 -89
+ 25, 98, 98, 98, 98, 98, 98, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, //90 -119
+ 49, 50, 51, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, //120 -149
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, //150 -179
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, //180 -209
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, //210 -239
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98 //240 -255
};
XMLParserBase64Tool::~XMLParserBase64Tool() { freeBuffer(); }
@@ -2902,7 +2902,7 @@ int XMLParserBase64Tool::encodeLength(int inlen, char formatted) XMLSTR XMLParserBase64Tool::encode(unsigned char *inbuf, unsigned int inlen, char formatted)
{
- int i=encodeLength(inlen,formatted),k=17,eLen=inlen/3,j;
+ int i=encodeLength(inlen, formatted), k=17, eLen=inlen/3, j;
alloc(i*sizeof(XMLCHAR));
XMLSTR curr=(XMLSTR)buf;
for (i=0;i<eLen;i++)
@@ -2935,7 +2935,7 @@ XMLSTR XMLParserBase64Tool::encode(unsigned char *inbuf, unsigned int inlen, cha return (XMLSTR)buf;
}
-unsigned int XMLParserBase64Tool::decodeSize(XMLCSTR data,XMLError *xe)
+unsigned int XMLParserBase64Tool::decodeSize(XMLCSTR data, XMLError *xe)
{
if (!data) return 0;
if (xe) *xe=eXMLErrorNone;
@@ -2962,8 +2962,8 @@ unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int {
if (!data) return 0;
if (xe) *xe=eXMLErrorNone;
- int i=0,p=0;
- unsigned char d,c;
+ int i=0, p=0;
+ unsigned char d, c;
for (;;)
{
@@ -3022,18 +3022,18 @@ unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int void XMLParserBase64Tool::alloc(int newsize)
{
if ((!buf)&&(newsize)) { buf=malloc(newsize); buflen=newsize; return; }
- if (newsize>buflen) { buf=realloc(buf,newsize); buflen=newsize; }
+ if (newsize>buflen) { buf=realloc(buf, newsize); buflen=newsize; }
}
unsigned char *XMLParserBase64Tool::decode(XMLCSTR data, int *outlen, XMLError *xe)
{
if (xe) *xe=eXMLErrorNone;
if (!data) { *outlen=0; return (unsigned char*)""; }
- unsigned int len=decodeSize(data,xe);
+ unsigned int len=decodeSize(data, xe);
if (outlen) *outlen=len;
if (!len) return NULL;
alloc(len+1);
- if(!decode(data,(unsigned char*)buf,len,xe)) { return NULL; }
+ if(!decode(data, (unsigned char*)buf, len, xe)) { return NULL; }
return (unsigned char*)buf;
}
diff --git a/src/modules/xml/xmlParser.h b/src/modules/xml/xmlParser.h index 55a3dca61a..5c13e603c0 100644 --- a/src/modules/xml/xmlParser.h +++ b/src/modules/xml/xmlParser.h @@ -66,7 +66,7 @@ * problem, during all the debugging session, I am now using a very fast DLL version of the
* XMLParser Library (the DLL is compiled in release mode). Using the DLL version of
* the XMLParser Library allows me to have lightening XML parsing speed even in debug!
- * Other than that, the DLL version is useless: In the release version of my tool,
+ * Other than that, the DLL version is useless: In the release version of my tool,
* I always use the normal, ".cpp"-based, XMLParser Library (I simply include the
* <a href="../../xmlParser.cpp">xmlParser.cpp</a> and
* <a href="../../xmlParser.h">xmlParser.h</a> files into the project).
@@ -156,27 +156,27 @@ /// Enumeration for XML parse errors.
typedef enum XMLError
{
- eXMLErrorNone = 0,
- eXMLErrorMissingEndTag,
- eXMLErrorNoXMLTagFound,
- eXMLErrorEmpty,
- eXMLErrorMissingTagName,
- eXMLErrorMissingEndTagName,
- eXMLErrorUnmatchedEndTag,
- eXMLErrorUnmatchedEndClearTag,
- eXMLErrorUnexpectedToken,
- eXMLErrorNoElements,
- eXMLErrorFileNotFound,
- eXMLErrorFirstTagNotFound,
- eXMLErrorUnknownCharacterEntity,
- eXMLErrorCharacterCodeAbove255,
- eXMLErrorCharConversionError,
- eXMLErrorCannotOpenWriteFile,
- eXMLErrorCannotWriteFile,
-
- eXMLErrorBase64DataSizeIsNotMultipleOf4,
- eXMLErrorBase64DecodeIllegalCharacter,
- eXMLErrorBase64DecodeTruncatedData,
+ eXMLErrorNone = 0,
+ eXMLErrorMissingEndTag,
+ eXMLErrorNoXMLTagFound,
+ eXMLErrorEmpty,
+ eXMLErrorMissingTagName,
+ eXMLErrorMissingEndTagName,
+ eXMLErrorUnmatchedEndTag,
+ eXMLErrorUnmatchedEndClearTag,
+ eXMLErrorUnexpectedToken,
+ eXMLErrorNoElements,
+ eXMLErrorFileNotFound,
+ eXMLErrorFirstTagNotFound,
+ eXMLErrorUnknownCharacterEntity,
+ eXMLErrorCharacterCodeAbove255,
+ eXMLErrorCharConversionError,
+ eXMLErrorCannotOpenWriteFile,
+ eXMLErrorCannotWriteFile,
+
+ eXMLErrorBase64DataSizeIsNotMultipleOf4,
+ eXMLErrorBase64DecodeIllegalCharacter,
+ eXMLErrorBase64DecodeTruncatedData,
eXMLErrorBase64DecodeBufferTooSmall
} XMLError;
@@ -184,10 +184,10 @@ typedef enum XMLError /// Enumeration used to manage type of data. Use in conjunction with structure XMLNodeContents
typedef enum XMLElementType
{
- eNodeChild=0,
- eNodeAttribute=1,
- eNodeText=2,
- eNodeClear=3,
+ eNodeChild=0,
+ eNodeAttribute=1,
+ eNodeText=2,
+ eNodeClear=3,
eNodeNULL=4
} XMLElementType;
@@ -195,7 +195,7 @@ typedef enum XMLElementType typedef struct XMLResults
{
enum XMLError error;
- int nLine,nColumn,nChars;
+ int nLine, nColumn, nChars;
} XMLResults;
/// Structure for XML clear (unformatted) node (usually comments)
@@ -298,8 +298,8 @@ public: * with appropriate white spaces and carriage returns. if pnSize is given it returns the size in character of the string. */
/// Save the content of an xmlNode inside a file
- XMLError writeToFile(XMLCSTR filename,
- const char *encoding=NULL,
+ XMLError writeToFile(XMLCSTR filename,
+ const char *encoding=NULL,
char nFormat=1) const;
/**< If nFormat == 0, no formatting is required otherwise this returns an user friendly XML string from a given element with appropriate white spaces and carriage returns.
* If the global parameter "characterEncoding == encoding_UTF8", then the "encoding" parameter is ignored and always set to "utf-8".
@@ -319,9 +319,9 @@ public: XMLNode getChildNode(int i=0) const; ///< return ith child node
XMLNode getChildNode(XMLCSTR name, int i) const; ///< return ith child node with specific name (return an empty node if failing). If i == -1, this returns the last XMLNode with the given name.
XMLNode getChildNode(XMLCSTR name, int *i=NULL) const; ///< return next child node with specific name (return an empty node if failing)
- XMLNode getChildNodeWithAttribute(XMLCSTR tagName,
- XMLCSTR attributeName,
- XMLCSTR attributeValue=NULL,
+ XMLNode getChildNodeWithAttribute(XMLCSTR tagName,
+ XMLCSTR attributeName,
+ XMLCSTR attributeValue=NULL,
int *i=NULL) const; ///< return child node with specific name/attribute (return an empty node if failing)
XMLNode getChildNodeByPath(XMLSTR path, char createNodeIfMissing=0, XMLCHAR sep='/');
///< return the first child node with specific path. WARNING: the value of the parameter "path" is destroyed!
@@ -342,7 +342,7 @@ public: int nAttribute() const; ///< nbr of attribute
XMLClear getClear(int i=0) const; ///< return ith clear field (comments)
int nClear() const; ///< nbr of clear field
- XMLNodeContents enumContents(XMLElementPosition i) const; ///< enumerate all the different contents (attribute,child,text, clear) of the current XMLNode. The order is reflecting the order of the original file/string. NOTE: 0 <= i < nElement();
+ XMLNodeContents enumContents(XMLElementPosition i) const; ///< enumerate all the different contents (attribute, child, text, clear) of the current XMLNode. The order is reflecting the order of the original file/string. NOTE: 0 <= i < nElement();
int nElement() const; ///< nbr of different contents for current node
char isEmpty() const; ///< is this node Empty?
char isDeclaration() const; ///< is this node a declaration <? .... ?>
@@ -397,12 +397,12 @@ public: */
XMLCSTR updateName(XMLCSTR lpszName); ///< change node's name
XMLAttribute *updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName, XMLCSTR lpszOldName);///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
XMLCSTR updateText(XMLCSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added
XMLCSTR updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added
XMLClear *updateClear(XMLCSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added
- XMLClear *updateClear(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
+ XMLClear *updateClear(XMLClear *newP, XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
XMLClear *updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the clearTag to update is missing, a new one will be added
/** @} */
@@ -431,14 +431,14 @@ public: * will be free'd by the XMLNode class. For example, it means that this is incorrect:
* \code
* xNode.addText_WOSD("foo");
- * xNode.updateAttribute_WOSD("#newcolor" ,NULL,"color");
+ * xNode.updateAttribute_WOSD("#newcolor" , NULL, "color");
* \endcode
* In opposition, this is correct:
* \code
* xNode.addText("foo");
* xNode.addText_WOSD(stringDup("foo"));
- * xNode.updateAttribute("#newcolor" ,NULL,"color");
- * xNode.updateAttribute_WOSD(stringDup("#newcolor"),NULL,"color");
+ * xNode.updateAttribute("#newcolor" , NULL, "color");
+ * xNode.updateAttribute_WOSD(stringDup("#newcolor"), NULL, "color");
* \endcode
* Typically, you will never do:
* \code
@@ -461,12 +461,12 @@ public: XMLCSTR updateName_WOSD(XMLSTR lpszName); ///< change node's name
XMLAttribute *updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL,int i=0); ///< if the attribute to update is missing, a new one will be added
- XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL, int i=0); ///< if the attribute to update is missing, a new one will be added
+ XMLAttribute *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName, XMLCSTR lpszOldName); ///< set lpszNewName=NULL if you don't want to change the name of the attribute if the attribute to update is missing, a new one will be added
XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, int i=0); ///< if the text to update is missing, a new one will be added
XMLCSTR updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the text to update is missing, a new one will be added
XMLClear *updateClear_WOSD(XMLSTR lpszNewContent, int i=0); ///< if the clearTag to update is missing, a new one will be added
- XMLClear *updateClear_WOSD(XMLClear *newP,XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
+ XMLClear *updateClear_WOSD(XMLClear *newP, XMLClear *oldP); ///< if the clearTag to update is missing, a new one will be added
XMLClear *updateClear_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue); ///< if the clearTag to update is missing, a new one will be added
/** @} */
@@ -489,12 +489,12 @@ public: /// Enumeration for XML character encoding.
typedef enum XMLCharEncoding
{
- char_encoding_error=0,
- char_encoding_UTF8=1,
- char_encoding_legacy=2,
- char_encoding_ShiftJIS=3,
- char_encoding_GB2312=4,
- char_encoding_Big5=5,
+ char_encoding_error=0,
+ char_encoding_UTF8=1,
+ char_encoding_legacy=2,
+ char_encoding_ShiftJIS=3,
+ char_encoding_GB2312=4,
+ char_encoding_Big5=5,
char_encoding_GBK=6 // this is actually the same as Big5
} XMLCharEncoding;
@@ -502,7 +502,7 @@ public: * @{ */
/// Sets the global options for the conversions
- static char setGlobalOptions(XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8, char guessWideCharChars=1,
+ static char setGlobalOptions(XMLCharEncoding characterEncoding=XMLNode::char_encoding_UTF8, char guessWideCharChars=1,
char dropWhiteSpace=1, char removeCommentsInMiddleOfText=1);
/**< The "setGlobalOptions" function allows you to change four global parameters that affect string & file
* parsing. First of all, you most-probably will never have to change these 3 global parameters.
@@ -519,7 +519,7 @@ public: *
* @param characterEncoding This parameter is only meaningful when compiling in char* mode (multibyte character mode).
* In wchar_t* (wide char mode), this parameter is ignored. This parameter should be one of the
- * three currently recognized encodings: XMLNode::encoding_UTF8, XMLNode::encoding_ascii,
+ * three currently recognized encodings: XMLNode::encoding_UTF8, XMLNode::encoding_ascii,
* XMLNode::encoding_ShiftJIS.
*
* @param dropWhiteSpace In most situations, text fields containing only white spaces (and carriage returns)
@@ -532,7 +532,7 @@ public: *
* @param removeCommentsInMiddleOfText To explain this parameter, let's consider this code:
* \code
- * XMLNode x=XMLNode::parseString("<a>foo<!-- hello -->bar<!DOCTYPE world >chu</a>","a");
+ * XMLNode x=XMLNode::parseString("<a>foo<!-- hello -->bar<!DOCTYPE world >chu</a>", "a");
* \endcode
* If removeCommentsInMiddleOfText=0, then we will have:
* \code
@@ -585,7 +585,7 @@ private: XMLCSTR *pText; // Array of text fields
XMLClear *pClear; // Array of clear fields
XMLAttribute *pAttribute; // Array of attributes
- int *pOrder; // order of the child_nodes,text_fields,clear_fields
+ int *pOrder; // order of the child_nodes, text_fields, clear_fields
int ref_count; // for garbage collection (smart pointers)
XMLSTR pInnerText; // cached value of inner text, for memory manadgement purposes
} XMLNodeData;
@@ -597,10 +597,10 @@ private: void *addToOrder(int memInc, int *_pos, int nc, void *p, int size, XMLElementType xtype);
int indexText(XMLCSTR lpszValue) const;
int indexClear(XMLCSTR lpszValue) const;
- XMLNode addChild_priv(int,XMLSTR,char,int);
- XMLAttribute *addAttribute_priv(int,XMLSTR,XMLSTR);
- XMLCSTR addText_priv(int,XMLSTR,int);
- XMLClear *addClear_priv(int,XMLSTR,XMLCSTR,XMLCSTR,int);
+ XMLNode addChild_priv(int, XMLSTR, char, int);
+ XMLAttribute *addAttribute_priv(int, XMLSTR, XMLSTR);
+ XMLCSTR addText_priv(int, XMLSTR, int);
+ XMLClear *addClear_priv(int, XMLSTR, XMLCSTR, XMLCSTR, int);
void emptyTheNode(char force);
void invalidateInnerText();
static inline XMLElementPosition findPosition(XMLNodeData *d, int index, XMLElementType xtype);
@@ -646,21 +646,21 @@ XMLDLLENTRY void freeXMLString(XMLSTR t); // {free(t);} * delete them without any trouble.
*
* @{ */
-XMLDLLENTRY char xmltob(XMLCSTR xmlString,char defautValue=0);
-XMLDLLENTRY int xmltoi(XMLCSTR xmlString,int defautValue=0);
-XMLDLLENTRY long xmltol(XMLCSTR xmlString,long defautValue=0);
-XMLDLLENTRY double xmltof(XMLCSTR xmlString,double defautValue=.0);
-XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString,XMLCSTR defautValue=_CXML(""));
-XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString,const XMLCHAR defautValue=_CXML('\0'));
+XMLDLLENTRY char xmltob(XMLCSTR xmlString, char defautValue=0);
+XMLDLLENTRY int xmltoi(XMLCSTR xmlString, int defautValue=0);
+XMLDLLENTRY long xmltol(XMLCSTR xmlString, long defautValue=0);
+XMLDLLENTRY double xmltof(XMLCSTR xmlString, double defautValue=.0);
+XMLDLLENTRY XMLCSTR xmltoa(XMLCSTR xmlString, XMLCSTR defautValue=_CXML(""));
+XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString, const XMLCHAR defautValue=_CXML('\0'));
/** @} */
-/** @defgroup ToXMLStringTool Helper class to create XML files using "printf", "fprintf", "cout",... functions.
+/** @defgroup ToXMLStringTool Helper class to create XML files using "printf", "fprintf", "cout", ... functions.
* @ingroup XMLParserGeneral
* @{ */
-/// Helper class to create XML files using "printf", "fprintf", "cout",... functions.
-/** The ToXMLStringTool class helps you creating XML files using "printf", "fprintf", "cout",... functions.
+/// Helper class to create XML files using "printf", "fprintf", "cout", ... functions.
+/** The ToXMLStringTool class helps you creating XML files using "printf", "fprintf", "cout", ... functions.
* The "ToXMLStringTool" class is processing strings so that all the characters
-* &,",',<,> are replaced by their XML equivalent:
+* &, ", ', <, > are replaced by their XML equivalent:
* \verbatim &, ", ', <, > \endverbatim
* Using the "ToXMLStringTool class" and the "fprintf function" is THE most efficient
* way to produce VERY large XML documents VERY fast.
@@ -670,7 +670,7 @@ XMLDLLENTRY XMLCHAR xmltoc(XMLCSTR xmlString,const XMLCHAR defautValue=_CXML('\0 typedef struct XMLDLLENTRY ToXMLStringTool
{
public:
- ToXMLStringTool(): buf(NULL),buflen(0) {}
+ ToXMLStringTool(): buf(NULL), buflen(0) {}
~ToXMLStringTool();
void freeBuffer();///<call this function when you have finished using this object to release memory used by the internal buffer.
@@ -679,7 +679,7 @@ public: /** The "toXMLUnSafe" function is deprecated because there is a possibility of
* "destination-buffer-overflow". It converts the string
* "source" to the string "dest". */
- static XMLSTR toXMLUnSafe(XMLSTR dest,XMLCSTR source); ///< deprecated: use "toXML" instead
+ static XMLSTR toXMLUnSafe(XMLSTR dest, XMLCSTR source); ///< deprecated: use "toXML" instead
static int lengthXMLString(XMLCSTR source); ///< deprecated: use "toXML" instead
private:
@@ -692,7 +692,7 @@ private: * @ingroup XMLParserGeneral
* @{ */
/// Helper class to include binary data inside XML strings using "Base64 encoding".
-/** The "XMLParserBase64Tool" class allows you to include any binary data (images, sounds,...)
+/** The "XMLParserBase64Tool" class allows you to include any binary data (images, sounds, ...)
* into an XML document using "Base64 encoding". This class is completely
* separated from the rest of the xmlParser library and can be removed without any problem.
* To include some binary data into an XML file, you must convert the binary data into
@@ -703,7 +703,7 @@ private: typedef struct XMLDLLENTRY XMLParserBase64Tool
{
public:
- XMLParserBase64Tool(): buf(NULL),buflen(0) {}
+ XMLParserBase64Tool(): buf(NULL), buflen(0) {}
~XMLParserBase64Tool();
void freeBuffer();///< Call this function when you have finished using this object to release memory used by the internal buffer.
diff --git a/src/resource.rc b/src/resource.rc index db0eaf0522..83b8f3bdc8 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -30,14 +30,14 @@ IDD_ACCFORM DIALOGEX 0, 0, 205, 119 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Enter account name (for example, My Google)",IDC_STATIC,7,7,191,9
- EDITTEXT IDC_ACCNAME,7,18,191,12,ES_AUTOHSCROLL
- LTEXT "Choose the protocol type",IDC_STATIC,7,35,191,11
- COMBOBOX IDC_PROTOTYPECOMBO,7,46,191,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- LTEXT "Specify the internal account name (optional)",IDC_STATIC,7,65,191,8
- EDITTEXT IDC_ACCINTERNALNAME,7,76,191,12,ES_AUTOHSCROLL
- PUSHBUTTON "OK",IDOK,92,98,50,14
- PUSHBUTTON "Cancel",IDCANCEL,148,98,50,14
+ LTEXT "Enter account name (for example, My Google)", IDC_STATIC, 7, 7, 191, 9
+ EDITTEXT IDC_ACCNAME, 7, 18, 191, 12, ES_AUTOHSCROLL
+ LTEXT "Choose the protocol type", IDC_STATIC, 7, 35, 191, 11
+ COMBOBOX IDC_PROTOTYPECOMBO, 7, 46, 191, 60, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Specify the internal account name (optional)", IDC_STATIC, 7, 65, 191, 8
+ EDITTEXT IDC_ACCINTERNALNAME, 7, 76, 191, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "OK", IDOK, 92, 98, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 148, 98, 50, 14
END
IDD_AUTHREQ DIALOGEX 0, 0, 271, 197
@@ -46,16 +46,16 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Authorization Request"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_HEADERBAR,"MHeaderbarCtrl",0x0,0,0,271,25
- DEFPUSHBUTTON "&Authorize",IDOK,17,176,50,14
- PUSHBUTTON "&Deny",IDCANCEL,97,176,50,14
- PUSHBUTTON "Decide &Later",IDC_DECIDELATER,175,176,74,14
- CONTROL "&I",IDC_DETAILS,"MButtonClass",WS_TABSTOP,248,29,16,14,WS_EX_NOACTIVATE | 0x10000000L
- LTEXT "Reason:",IDC_STATIC,7,39,101,10,SS_CENTERIMAGE
- EDITTEXT IDC_REASON,7,50,257,54,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL,WS_EX_STATICEDGE
- LTEXT "Denial Reason:",IDC_STATIC,7,111,89,10,SS_CENTERIMAGE | SS_REALSIZECONTROL
- EDITTEXT IDC_DENYREASON,7,124,257,32,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
- CONTROL "Add to contact list if authorized",IDC_ADDCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,162,239,10
+ CONTROL "", IDC_HEADERBAR, "MHeaderbarCtrl", 0x0, 0, 0, 271, 25
+ DEFPUSHBUTTON "&Authorize", IDOK, 17, 176, 50, 14
+ PUSHBUTTON "&Deny", IDCANCEL, 97, 176, 50, 14
+ PUSHBUTTON "Decide &Later", IDC_DECIDELATER, 175, 176, 74, 14
+ CONTROL "&I", IDC_DETAILS, "MButtonClass", WS_TABSTOP, 248, 29, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ LTEXT "Reason:", IDC_STATIC, 7, 39, 101, 10, SS_CENTERIMAGE
+ EDITTEXT IDC_REASON, 7, 50, 257, 54, ES_MULTILINE | ES_READONLY | NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL, WS_EX_STATICEDGE
+ LTEXT "Denial Reason:", IDC_STATIC, 7, 111, 89, 10, SS_CENTERIMAGE | SS_REALSIZECONTROL
+ EDITTEXT IDC_DENYREASON, 7, 124, 257, 32, ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_BORDER, WS_EX_STATICEDGE
+ CONTROL "Add to contact list if authorized", IDC_ADDCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 18, 162, 239, 10
END
IDD_ADDCONTACT DIALOGEX 0, 0, 230, 151
@@ -64,17 +64,17 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Add %s"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "&Add",IDOK,20,130,72,14
- PUSHBUTTON "&Cancel",IDCANCEL,139,130,71,14
- EDITTEXT IDC_MYHANDLE,6,16,90,12,ES_AUTOHSCROLL
- COMBOBOX IDC_GROUP,112,16,110,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Send ""You were added""",IDC_ADDED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,46,204,10
- CONTROL "Send authorization request",IDC_AUTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,60,204,10
- LTEXT "Custom name:",IDC_STATIC,6,4,70,10
- LTEXT "Group:",IDC_STATIC,112,4,70,10
- GROUPBOX "Options",IDC_STATIC,7,33,216,43
- GROUPBOX "Authorization Request",IDC_AUTHGB,7,79,216,45
- EDITTEXT IDC_AUTHREQ,13,89,204,29,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ DEFPUSHBUTTON "&Add", IDOK, 20, 130, 72, 14
+ PUSHBUTTON "&Cancel", IDCANCEL, 139, 130, 71, 14
+ EDITTEXT IDC_MYHANDLE, 6, 16, 90, 12, ES_AUTOHSCROLL
+ COMBOBOX IDC_GROUP, 112, 16, 110, 60, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Send ""You were added""", IDC_ADDED, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 11, 46, 204, 10
+ CONTROL "Send authorization request", IDC_AUTH, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 11, 60, 204, 10
+ LTEXT "Custom name:", IDC_STATIC, 6, 4, 70, 10
+ LTEXT "Group:", IDC_STATIC, 112, 4, 70, 10
+ GROUPBOX "Options", IDC_STATIC, 7, 33, 216, 43
+ GROUPBOX "Authorization Request", IDC_AUTHGB, 7, 79, 216, 45
+ EDITTEXT IDC_AUTHREQ, 13, 89, 204, 29, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
END
IDD_ADDED DIALOGEX 0, 0, 241, 70
@@ -83,10 +83,10 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "You Were Added"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_HEADERBAR,"MHeaderbarCtrl",0x0,0,0,241,25
- PUSHBUTTON "&Close",IDCANCEL,90,51,60,14
- CONTROL "&I",IDC_DETAILS,"MButtonClass",WS_TABSTOP,217,29,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&U",IDC_ADD,"MButtonClass",WS_TABSTOP,197,29,16,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "", IDC_HEADERBAR, "MHeaderbarCtrl", 0x0, 0, 0, 241, 25
+ PUSHBUTTON "&Close", IDCANCEL, 90, 51, 60, 14
+ CONTROL "&I", IDC_DETAILS, "MButtonClass", WS_TABSTOP, 217, 29, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&U", IDC_ADD, "MButtonClass", WS_TABSTOP, 197, 29, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
END
IDD_ABOUT DIALOGEX 0, 0, 212, 131
@@ -95,14 +95,14 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "About Miranda IM"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "Miranda IM\n%s",IDC_HEADERBAR,"MHeaderbarCtrl",WS_TABSTOP,0,0,212,25
- LTEXT "",IDC_WHITERECT,0,25,213,81
- DEFPUSHBUTTON "OK",IDOK,152,112,55,14
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,106,213,1
- LTEXT "",IDC_DEVS,5,32,202,42
- EDITTEXT IDC_BUILDTIME,4,91,146,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- PUSHBUTTON "Credits >",IDC_CONTRIBLINK,5,112,55,14
- EDITTEXT IDC_CREDITSFILE,4,32,202,67,ES_CENTER | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
+ CONTROL "Miranda IM\n%s", IDC_HEADERBAR, "MHeaderbarCtrl", WS_TABSTOP, 0, 0, 212, 25
+ LTEXT "", IDC_WHITERECT, 0, 25, 213, 81
+ DEFPUSHBUTTON "OK", IDOK, 152, 112, 55, 14
+ CONTROL "", IDC_STATIC, "Static", SS_ETCHEDHORZ, 0, 106, 213, 1
+ LTEXT "", IDC_DEVS, 5, 32, 202, 42
+ EDITTEXT IDC_BUILDTIME, 4, 91, 146, 12, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ PUSHBUTTON "Credits >", IDC_CONTRIBLINK, 5, 112, 55, 14
+ EDITTEXT IDC_CREDITSFILE, 4, 32, 202, 67, ES_CENTER | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
END
IDD_DELETECONTACT DIALOGEX 0, 0, 294, 93
@@ -111,13 +111,13 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Delete Contact"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- PUSHBUTTON "&Yes",IDYES,58,38,65,14
- DEFPUSHBUTTON "&No",IDNO,172,38,65,14
- CONTROL "Hide from list only, in order to keep their history and ignore/visibility settings",IDC_HIDE,
- "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,65,270,9
- LTEXT "Use Options->Ignore (expert mode) to unhide contacts.",IDC_STATIC,20,78,257,8
- CONTROL "Are you sure you want to delete %s?",IDC_TOPLINE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,7,7,270,8
- LTEXT "This will erase all history and settings for this contact!",IDC_STATIC,7,18,239,14
+ PUSHBUTTON "&Yes", IDYES, 58, 38, 65, 14
+ DEFPUSHBUTTON "&No", IDNO, 172, 38, 65, 14
+ CONTROL "Hide from list only, in order to keep their history and ignore/visibility settings", IDC_HIDE,
+ "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 7, 65, 270, 9
+ LTEXT "Use Options->Ignore (expert mode) to unhide contacts.", IDC_STATIC, 20, 78, 257, 8
+ CONTROL "Are you sure you want to delete %s?", IDC_TOPLINE, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 7, 7, 270, 8
+ LTEXT "This will erase all history and settings for this contact!", IDC_STATIC, 7, 18, 239, 14
END
IDD_OPT_CONTACT DIALOGEX 0, 0, 199, 147
@@ -125,9 +125,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Contact Display Options",IDC_STATIC,13,7,176,133
- LTEXT "Instead of displaying contacts by their nickname, drag to choose another order:",IDC_STATIC,19,17,165,27
- CONTROL "Tree1",IDC_NAMEORDER,"SysTreeView32",TVS_NOTOOLTIPS | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,19,48,164,86
+ GROUPBOX "Contact Display Options", IDC_STATIC, 13, 7, 176, 133
+ LTEXT "Instead of displaying contacts by their nickname, drag to choose another order:", IDC_STATIC, 19, 17, 165, 27
+ CONTROL "Tree1", IDC_NAMEORDER, "SysTreeView32", TVS_NOTOOLTIPS | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP, 19, 48, 164, 86
END
IDD_PROFILEMANAGER DIALOGEX 0, 0, 400, 211
@@ -135,12 +135,12 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | CAPTION "Miranda IM Profile Manager"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_NAME,"MHeaderbarCtrl",0x0,0,0,400,25
- CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK | WS_TABSTOP,4,31,393,160
- PUSHBUTTON "&Run",IDOK,298,194,48,14
- PUSHBUTTON "&Exit",IDCANCEL,348,194,48,14
- RTEXT "Start in Service Mode with",IDC_SM_LABEL,10,196,106,10
- COMBOBOX IDC_SM_COMBO,120,195,123,12,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "", IDC_NAME, "MHeaderbarCtrl", 0x0, 0, 0, 400, 25
+ CONTROL "Tab1", IDC_TABS, "SysTabControl32", TCS_HOTTRACK | WS_TABSTOP, 4, 31, 393, 160
+ PUSHBUTTON "&Run", IDOK, 298, 194, 48, 14
+ PUSHBUTTON "&Exit", IDCANCEL, 348, 194, 48, 14
+ RTEXT "Start in Service Mode with", IDC_SM_LABEL, 10, 196, 106, 10
+ COMBOBOX IDC_SM_COMBO, 120, 195, 123, 12, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDD_FINDADD DIALOGEX 0, 0, 427, 257
@@ -149,34 +149,34 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Find/Add Contacts"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Search:",IDC_STATIC,5,32,37,8
- CONTROL "",IDC_PROTOLIST,"ComboBoxEx32",CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,42,30,80,88
- GROUPBOX "",IDC_PROTOIDGROUP,5,46,117,32
- CONTROL "",IDC_BYPROTOID,"Button",BS_AUTORADIOBUTTON,11,46,85,10
- EDITTEXT IDC_PROTOID,11,59,105,12,ES_AUTOHSCROLL
- GROUPBOX "",IDC_EMAILGROUP,5,83,117,32
- CONTROL "E-mail address",IDC_BYEMAIL,"Button",BS_AUTORADIOBUTTON,11,83,80,10
- EDITTEXT IDC_EMAIL,11,96,105,12,ES_AUTOHSCROLL
- GROUPBOX "",IDC_NAMEGROUP,5,120,117,59
- CONTROL "Name",IDC_BYNAME,"Button",BS_AUTORADIOBUTTON,11,120,49,10
- LTEXT "Nick:",IDC_STNAMENICK,11,135,31,8,NOT WS_GROUP
- EDITTEXT IDC_NAMENICK,42,134,74,12,ES_AUTOHSCROLL
- LTEXT "First:",IDC_STNAMEFIRST,11,150,31,8,NOT WS_GROUP
- EDITTEXT IDC_NAMEFIRST,42,147,74,12,ES_AUTOHSCROLL
- LTEXT "Last:",IDC_STNAMELAST,11,163,31,8,NOT WS_GROUP
- EDITTEXT IDC_NAMELAST,42,161,74,12,ES_AUTOHSCROLL
- GROUPBOX "",IDC_ADVANCEDGROUP,5,184,117,32
- CONTROL "Advanced",IDC_BYADVANCED,"Button",BS_AUTORADIOBUTTON,11,184,62,10
- CONTROL "Advanced >>",IDC_ADVANCED,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,11,196,105,14
- GROUPBOX "",IDC_TINYEXTENDEDGROUP,5,190,117,25
- DEFPUSHBUTTON "&Search",IDOK,5,222,117,17
- CONTROL "List1",IDC_RESULTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,129,30,293,191
- CONTROL "More options",IDC_MOREOPTIONS,"MButtonClass",WS_DISABLED | WS_TABSTOP,272,225,77,14,WS_EX_NOACTIVATE | 0x10000000L
- PUSHBUTTON "Add to list",IDC_ADD,354,225,68,14,WS_DISABLED
- CONTROL "",IDC_STATUSBAR,"msctls_statusbar32",WS_TABSTOP | 0x100,0,244,427,10
- CONTROL "Custom",IDC_BYCUSTOM,"Button",BS_AUTORADIOBUTTON,11,190,89,10
- CONTROL "Find/Add Contacts\nHere you can add contacts to your contact list",IDC_HEADERBAR,
- "MHeaderbarCtrl",0x0,0,0,427,25
+ LTEXT "Search:", IDC_STATIC, 5, 32, 37, 8
+ CONTROL "", IDC_PROTOLIST, "ComboBoxEx32", CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP, 42, 30, 80, 88
+ GROUPBOX "", IDC_PROTOIDGROUP, 5, 46, 117, 32
+ CONTROL "", IDC_BYPROTOID, "Button", BS_AUTORADIOBUTTON, 11, 46, 85, 10
+ EDITTEXT IDC_PROTOID, 11, 59, 105, 12, ES_AUTOHSCROLL
+ GROUPBOX "", IDC_EMAILGROUP, 5, 83, 117, 32
+ CONTROL "E-mail address", IDC_BYEMAIL, "Button", BS_AUTORADIOBUTTON, 11, 83, 80, 10
+ EDITTEXT IDC_EMAIL, 11, 96, 105, 12, ES_AUTOHSCROLL
+ GROUPBOX "", IDC_NAMEGROUP, 5, 120, 117, 59
+ CONTROL "Name", IDC_BYNAME, "Button", BS_AUTORADIOBUTTON, 11, 120, 49, 10
+ LTEXT "Nick:", IDC_STNAMENICK, 11, 135, 31, 8, NOT WS_GROUP
+ EDITTEXT IDC_NAMENICK, 42, 134, 74, 12, ES_AUTOHSCROLL
+ LTEXT "First:", IDC_STNAMEFIRST, 11, 150, 31, 8, NOT WS_GROUP
+ EDITTEXT IDC_NAMEFIRST, 42, 147, 74, 12, ES_AUTOHSCROLL
+ LTEXT "Last:", IDC_STNAMELAST, 11, 163, 31, 8, NOT WS_GROUP
+ EDITTEXT IDC_NAMELAST, 42, 161, 74, 12, ES_AUTOHSCROLL
+ GROUPBOX "", IDC_ADVANCEDGROUP, 5, 184, 117, 32
+ CONTROL "Advanced", IDC_BYADVANCED, "Button", BS_AUTORADIOBUTTON, 11, 184, 62, 10
+ CONTROL "Advanced >>", IDC_ADVANCED, "Button", BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP, 11, 196, 105, 14
+ GROUPBOX "", IDC_TINYEXTENDEDGROUP, 5, 190, 117, 25
+ DEFPUSHBUTTON "&Search", IDOK, 5, 222, 117, 17
+ CONTROL "List1", IDC_RESULTS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP, 129, 30, 293, 191
+ CONTROL "More options", IDC_MOREOPTIONS, "MButtonClass", WS_DISABLED | WS_TABSTOP, 272, 225, 77, 14, WS_EX_NOACTIVATE | 0x10000000L
+ PUSHBUTTON "Add to list", IDC_ADD, 354, 225, 68, 14, WS_DISABLED
+ CONTROL "", IDC_STATUSBAR, "msctls_statusbar32", WS_TABSTOP | 0x100, 0, 244, 427, 10
+ CONTROL "Custom", IDC_BYCUSTOM, "Button", BS_AUTORADIOBUTTON, 11, 190, 89, 10
+ CONTROL "Find/Add Contacts\nHere you can add contacts to your contact list", IDC_HEADERBAR,
+ "MHeaderbarCtrl", 0x0, 0, 0, 427, 25
END
IDD_OPTIONS DIALOGEX 0, 0, 428, 303
@@ -185,16 +185,16 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Options"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- COMBOBOX IDC_KEYWORD_FILTER,336,6,88,79,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CONTROL "Options\nConfigure your Miranda Instant Messenger options",IDC_HEADERBAR,
- "MHeaderbarCtrl",0x0,0,0,428,25
- DEFPUSHBUTTON "OK",IDOK,265,283,50,14
- PUSHBUTTON "Cancel",IDCANCEL,319,283,50,14
- PUSHBUTTON "Apply",IDC_APPLY,374,283,50,14
- CONTROL "Tree1",IDC_PAGETREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,4,30,102,249
- CONTROL "",IDC_TAB,"SysTabControl32",NOT WS_VISIBLE | WS_TABSTOP,111,30,313,249
- CONTROL "Show expert options",IDC_EXPERT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,284,102,10
- CTEXT "Please select a subentry from the list",IDC_STNOPAGE,111,30,313,251,SS_CENTERIMAGE
+ COMBOBOX IDC_KEYWORD_FILTER, 336, 6, 88, 79, CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Options\nConfigure your Miranda Instant Messenger options", IDC_HEADERBAR,
+ "MHeaderbarCtrl", 0x0, 0, 0, 428, 25
+ DEFPUSHBUTTON "OK", IDOK, 265, 283, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 319, 283, 50, 14
+ PUSHBUTTON "Apply", IDC_APPLY, 374, 283, 50, 14
+ CONTROL "Tree1", IDC_PAGETREE, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP, 4, 30, 102, 249
+ CONTROL "", IDC_TAB, "SysTabControl32", NOT WS_VISIBLE | WS_TABSTOP, 111, 30, 313, 249
+ CONTROL "Show expert options", IDC_EXPERT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 5, 284, 102, 10
+ CTEXT "Please select a subentry from the list", IDC_STNOPAGE, 111, 30, 313, 251, SS_CENTERIMAGE
END
IDD_OPTIONSPAGE DIALOGEX 0, 0, 321, 303
@@ -203,16 +203,16 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Options"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- COMBOBOX IDC_KEYWORD_FILTER,336,37,88,79,CBS_DROPDOWN | CBS_SORT | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
- CONTROL "Options\nConfigure your Miranda Instant Messenger options",IDC_HEADERBAR,
- "MHeaderbarCtrl",0x0,0,0,325,25
- DEFPUSHBUTTON "OK",IDOK,158,283,50,14
- PUSHBUTTON "Cancel",IDCANCEL,212,283,50,14
- PUSHBUTTON "Apply",IDC_APPLY,267,283,50,14
- CONTROL "",IDC_TAB,"SysTabControl32",NOT WS_VISIBLE | WS_TABSTOP,4,32,313,249
- CONTROL "Show expert options",IDC_EXPERT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,347,254,62,10
- CTEXT "Please select a subentry from the list",IDC_STNOPAGE,4,30,313,251,SS_CENTERIMAGE
- CONTROL "",IDC_PAGETREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_NOHSCROLL | NOT WS_VISIBLE | WS_BORDER | WS_TABSTOP,347,86,52,137
+ COMBOBOX IDC_KEYWORD_FILTER, 336, 37, 88, 79, CBS_DROPDOWN | CBS_SORT | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Options\nConfigure your Miranda Instant Messenger options", IDC_HEADERBAR,
+ "MHeaderbarCtrl", 0x0, 0, 0, 325, 25
+ DEFPUSHBUTTON "OK", IDOK, 158, 283, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 212, 283, 50, 14
+ PUSHBUTTON "Apply", IDC_APPLY, 267, 283, 50, 14
+ CONTROL "", IDC_TAB, "SysTabControl32", NOT WS_VISIBLE | WS_TABSTOP, 4, 32, 313, 249
+ CONTROL "Show expert options", IDC_EXPERT, "Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, 347, 254, 62, 10
+ CTEXT "Please select a subentry from the list", IDC_STNOPAGE, 4, 30, 313, 251, SS_CENTERIMAGE
+ CONTROL "", IDC_PAGETREE, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_NOHSCROLL | NOT WS_VISIBLE | WS_BORDER | WS_TABSTOP, 347, 86, 52, 137
END
IDD_READAWAYMSG DIALOGEX 0, 0, 187, 72
@@ -221,9 +221,9 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "%s Message for %s"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "&Cancel",IDOK,69,53,50,14
- CTEXT "Retrieving %s message...",IDC_RETRIEVING,5,21,177,8,SS_NOPREFIX
- EDITTEXT IDC_MSG,5,5,177,43,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_VISIBLE | WS_VSCROLL
+ DEFPUSHBUTTON "&Cancel", IDOK, 69, 53, 50, 14
+ CTEXT "Retrieving %s message...", IDC_RETRIEVING, 5, 21, 177, 8, SS_NOPREFIX
+ EDITTEXT IDC_MSG, 5, 5, 177, 43, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_VISIBLE | WS_VSCROLL
END
IDD_SETAWAYMSG DIALOGEX 0, 0, 187, 72
@@ -232,8 +232,8 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Change %s Message"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "Closing in %d",IDOK,61,53,65,14
- EDITTEXT IDC_MSG,5,5,177,43,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ DEFPUSHBUTTON "Closing in %d", IDOK, 61, 53, 65, 14
+ EDITTEXT IDC_MSG, 5, 5, 177, 43, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
END
IDD_DETAILS DIALOGEX 0, 0, 318, 210
@@ -242,13 +242,13 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "%s: User Details"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "%s\nView personal user details and more",IDC_HEADERBAR,
- "MHeaderbarCtrl",0x0,0,0,318,25
- CONTROL "",IDC_PAGETREE,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_NONEVENHEIGHT | WS_HSCROLL | WS_TABSTOP,3,30,76,176,WS_EX_STATICEDGE
- CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK | TCS_MULTILINE | WS_TABSTOP,85,29,228,158
- PUSHBUTTON "Update Now",IDC_UPDATE,85,191,55,14,WS_DISABLED
- CTEXT "Updating",IDC_UPDATING,145,194,113,8,SS_NOPREFIX | SS_CENTERIMAGE
- DEFPUSHBUTTON "OK",IDOK,263,191,50,14
+ CONTROL "%s\nView personal user details and more", IDC_HEADERBAR,
+ "MHeaderbarCtrl", 0x0, 0, 0, 318, 25
+ CONTROL "", IDC_PAGETREE, "SysTreeView32", TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_NONEVENHEIGHT | WS_HSCROLL | WS_TABSTOP, 3, 30, 76, 176, WS_EX_STATICEDGE
+ CONTROL "Tab1", IDC_TABS, "SysTabControl32", TCS_HOTTRACK | TCS_MULTILINE | WS_TABSTOP, 85, 29, 228, 158
+ PUSHBUTTON "Update Now", IDC_UPDATE, 85, 191, 55, 14, WS_DISABLED
+ CTEXT "Updating", IDC_UPDATING, 145, 194, 113, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ DEFPUSHBUTTON "OK", IDOK, 263, 191, 50, 14
END
IDD_INFO_SUMMARY DIALOGEX 0, 0, 222, 132
@@ -256,24 +256,24 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Nickname:",IDC_STATIC,5,5,46,8
- EDITTEXT IDC_NICK,51,5,166,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "First name:",IDC_STATIC,5,18,46,8
- EDITTEXT IDC_FIRSTNAME,51,18,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Gender:",IDC_STATIC,126,18,44,8
- EDITTEXT IDC_GENDER,170,18,47,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Last name:",IDC_STATIC,5,31,46,8
- EDITTEXT IDC_LASTNAME,51,31,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Age:",IDC_STATIC,126,31,44,8
- EDITTEXT IDC_AGE,170,31,47,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "E-mail:",IDC_STATIC,5,44,46,8
- CONTROL "",IDC_EMAIL,"Hyperlink",WS_TABSTOP,51,44,166,8
- LTEXT "Date of birth:",IDC_STATIC,5,58,59,8
- EDITTEXT IDC_DOBDAY,66,58,8,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_DOBMONTH,76,58,16,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_DOBYEAR,94,58,20,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Marital status:",IDC_STATIC,5,71,76,8
- EDITTEXT IDC_MARITAL,83,71,87,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Nickname:", IDC_STATIC, 5, 5, 46, 8
+ EDITTEXT IDC_NICK, 51, 5, 166, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "First name:", IDC_STATIC, 5, 18, 46, 8
+ EDITTEXT IDC_FIRSTNAME, 51, 18, 74, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Gender:", IDC_STATIC, 126, 18, 44, 8
+ EDITTEXT IDC_GENDER, 170, 18, 47, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Last name:", IDC_STATIC, 5, 31, 46, 8
+ EDITTEXT IDC_LASTNAME, 51, 31, 74, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Age:", IDC_STATIC, 126, 31, 44, 8
+ EDITTEXT IDC_AGE, 170, 31, 47, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "E-mail:", IDC_STATIC, 5, 44, 46, 8
+ CONTROL "", IDC_EMAIL, "Hyperlink", WS_TABSTOP, 51, 44, 166, 8
+ LTEXT "Date of birth:", IDC_STATIC, 5, 58, 59, 8
+ EDITTEXT IDC_DOBDAY, 66, 58, 8, 8, ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_DOBMONTH, 76, 58, 16, 8, ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_DOBYEAR, 94, 58, 20, 8, ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Marital status:", IDC_STATIC, 5, 71, 76, 8
+ EDITTEXT IDC_MARITAL, 83, 71, 87, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
END
IDD_INFO_CONTACT DIALOGEX 0, 0, 222, 132
@@ -281,10 +281,10 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "E-mail:",IDC_STATIC,5,5,212,8
- CONTROL "List1",IDC_EMAILS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,14,212,50
- LTEXT "Phone:",IDC_STATIC,5,68,212,8
- CONTROL "List1",IDC_PHONES,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,77,212,50
+ LTEXT "E-mail:", IDC_STATIC, 5, 5, 212, 8
+ CONTROL "List1", IDC_EMAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 5, 14, 212, 50
+ LTEXT "Phone:", IDC_STATIC, 5, 68, 212, 8
+ CONTROL "List1", IDC_PHONES, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 5, 77, 212, 50
END
IDD_INFO_BACKGROUND DIALOGEX 0, 0, 222, 132
@@ -292,12 +292,12 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Web page:",IDC_STATIC,5,5,44,8
- CONTROL "",IDC_WEBPAGE,"Hyperlink",WS_TABSTOP,49,5,168,8
- LTEXT "Past background:",IDC_STATIC,5,18,212,8
- CONTROL "List1",IDC_PAST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,27,212,44
- LTEXT "Interests:",IDC_STATIC,5,74,212,8
- CONTROL "List1",IDC_INTERESTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,83,212,44
+ LTEXT "Web page:", IDC_STATIC, 5, 5, 44, 8
+ CONTROL "", IDC_WEBPAGE, "Hyperlink", WS_TABSTOP, 49, 5, 168, 8
+ LTEXT "Past background:", IDC_STATIC, 5, 18, 212, 8
+ CONTROL "List1", IDC_PAST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 5, 27, 212, 44
+ LTEXT "Interests:", IDC_STATIC, 5, 74, 212, 8
+ CONTROL "List1", IDC_INTERESTS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOLABELWRAP | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 5, 83, 212, 44
END
IDD_INFO_NOTES DIALOGEX 0, 0, 222, 132
@@ -305,10 +305,10 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "About:",IDC_STATIC,5,5,212,8
- EDITTEXT IDC_ABOUT,5,13,212,45,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
- LTEXT "My notes:",IDC_STATIC,5,61,212,8
- EDITTEXT IDC_MYNOTES,5,69,212,58,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ LTEXT "About:", IDC_STATIC, 5, 5, 212, 8
+ EDITTEXT IDC_ABOUT, 5, 13, 212, 45, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
+ LTEXT "My notes:", IDC_STATIC, 5, 61, 212, 8
+ EDITTEXT IDC_MYNOTES, 5, 69, 212, 58, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
END
IDD_INFO_LOCATION DIALOGEX 0, 0, 222, 147
@@ -316,26 +316,26 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Street:",IDC_STATIC,5,5,51,8
- EDITTEXT IDC_STREET,56,5,161,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "City:",IDC_STATIC,5,22,51,8
- EDITTEXT IDC_CITY,56,22,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "State:",IDC_STATIC,5,33,51,8
- EDITTEXT IDC_STATE,56,33,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Postal code:",IDC_STATIC,5,44,51,8
- EDITTEXT IDC_ZIP,56,44,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Country:",IDC_STATIC,5,55,51,8
- EDITTEXT IDC_COUNTRY,56,55,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Spoken languages:",IDC_STATIC,5,70,51,16
- EDITTEXT IDC_LANGUAGE1,56,70,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_LANGUAGE2,56,78,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_LANGUAGE3,56,86,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Timezone:",IDC_STATIC,5,97,51,8
- EDITTEXT IDC_TIMEZONE,56,97,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Local time:",IDC_STATIC,5,108,51,8
- EDITTEXT IDC_LOCALTIME,56,108,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- COMBOBOX IDC_TIMEZONESELECT,4,132,214,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Set custom time zone",IDC_STATIC,5,121,212,8
+ LTEXT "Street:", IDC_STATIC, 5, 5, 51, 8
+ EDITTEXT IDC_STREET, 56, 5, 161, 16, ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "City:", IDC_STATIC, 5, 22, 51, 8
+ EDITTEXT IDC_CITY, 56, 22, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "State:", IDC_STATIC, 5, 33, 51, 8
+ EDITTEXT IDC_STATE, 56, 33, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Postal code:", IDC_STATIC, 5, 44, 51, 8
+ EDITTEXT IDC_ZIP, 56, 44, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Country:", IDC_STATIC, 5, 55, 51, 8
+ EDITTEXT IDC_COUNTRY, 56, 55, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Spoken languages:", IDC_STATIC, 5, 70, 51, 16
+ EDITTEXT IDC_LANGUAGE1, 56, 70, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_LANGUAGE2, 56, 78, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_LANGUAGE3, 56, 86, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Timezone:", IDC_STATIC, 5, 97, 51, 8
+ EDITTEXT IDC_TIMEZONE, 56, 97, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Local time:", IDC_STATIC, 5, 108, 51, 8
+ EDITTEXT IDC_LOCALTIME, 56, 108, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ COMBOBOX IDC_TIMEZONESELECT, 4, 132, 214, 46, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Set custom time zone", IDC_STATIC, 5, 121, 212, 8
END
IDD_INFO_WORK DIALOGEX 0, 0, 222, 132
@@ -343,24 +343,24 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Company:",IDC_STATIC,5,5,51,8
- EDITTEXT IDC_COMPANY,56,5,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Department:",IDC_STATIC,5,17,51,8
- EDITTEXT IDC_DEPARTMENT,56,17,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Position:",IDC_STATIC,5,28,51,8
- EDITTEXT IDC_POSITION,56,28,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Street:",IDC_STATIC,5,48,51,8
- EDITTEXT IDC_STREET,56,48,161,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "City:",IDC_STATIC,5,65,51,8
- EDITTEXT IDC_CITY,56,65,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "State:",IDC_STATIC,5,76,51,8
- EDITTEXT IDC_STATE,56,76,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Postal code:",IDC_STATIC,5,87,51,8
- EDITTEXT IDC_ZIP,56,87,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Country:",IDC_STATIC,5,98,51,8
- EDITTEXT IDC_COUNTRY,56,98,161,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Website:",IDC_STATIC,5,109,51,8
- CONTROL "",IDC_WEBPAGE,"Hyperlink",WS_TABSTOP,57,109,160,8
+ LTEXT "Company:", IDC_STATIC, 5, 5, 51, 8
+ EDITTEXT IDC_COMPANY, 56, 5, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Department:", IDC_STATIC, 5, 17, 51, 8
+ EDITTEXT IDC_DEPARTMENT, 56, 17, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Position:", IDC_STATIC, 5, 28, 51, 8
+ EDITTEXT IDC_POSITION, 56, 28, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Street:", IDC_STATIC, 5, 48, 51, 8
+ EDITTEXT IDC_STREET, 56, 48, 161, 16, ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "City:", IDC_STATIC, 5, 65, 51, 8
+ EDITTEXT IDC_CITY, 56, 65, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "State:", IDC_STATIC, 5, 76, 51, 8
+ EDITTEXT IDC_STATE, 56, 76, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Postal code:", IDC_STATIC, 5, 87, 51, 8
+ EDITTEXT IDC_ZIP, 56, 87, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Country:", IDC_STATIC, 5, 98, 51, 8
+ EDITTEXT IDC_COUNTRY, 56, 98, 161, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Website:", IDC_STATIC, 5, 109, 51, 8
+ CONTROL "", IDC_WEBPAGE, "Hyperlink", WS_TABSTOP, 57, 109, 160, 8
END
IDD_ADDEMAIL DIALOGEX 0, 0, 187, 42
@@ -369,9 +369,9 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Add E-Mail Address"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- EDITTEXT IDC_EMAIL,5,5,177,12,ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,36,23,50,14
- PUSHBUTTON "Cancel",IDCANCEL,102,23,50,14
+ EDITTEXT IDC_EMAIL, 5, 5, 177, 12, ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK", IDOK, 36, 23, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 102, 23, 50, 14
END
IDD_ADDPHONE DIALOGEX 0, 0, 210, 91
@@ -380,15 +380,15 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Add Phone Number"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Enter country, area code and phone number:",IDC_STATIC,5,5,200,8
- COMBOBOX IDC_COUNTRY,21,15,66,120,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_AREA,91,15,36,12,ES_AUTOHSCROLL | ES_NUMBER
- EDITTEXT IDC_NUMBER,131,15,74,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Or enter a full international number:",IDC_STATIC,5,30,200,8
- EDITTEXT IDC_PHONE,21,40,184,12,ES_AUTOHSCROLL
- CONTROL "Phone can receive SMS text messages",IDC_SMS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,56,200,10
- DEFPUSHBUTTON "OK",IDOK,47,72,50,14
- PUSHBUTTON "Cancel",IDCANCEL,113,72,50,14
+ LTEXT "Enter country, area code and phone number:", IDC_STATIC, 5, 5, 200, 8
+ COMBOBOX IDC_COUNTRY, 21, 15, 66, 120, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_AREA, 91, 15, 36, 12, ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_NUMBER, 131, 15, 74, 12, ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Or enter a full international number:", IDC_STATIC, 5, 30, 200, 8
+ EDITTEXT IDC_PHONE, 21, 40, 184, 12, ES_AUTOHSCROLL
+ CONTROL "Phone can receive SMS text messages", IDC_SMS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 5, 56, 200, 10
+ DEFPUSHBUTTON "OK", IDOK, 47, 72, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 113, 72, 50, 14
END
IDD_INSTALLINI DIALOGEX 0, 0, 213, 103
@@ -397,14 +397,14 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Install Database Settings"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "Yes",IDOK,26,84,50,14
- PUSHBUTTON "No",IDCANCEL,81,84,50,14
- LTEXT "A file containing new database settings has been placed in the Miranda IM directory.",IDC_STATIC,5,5,203,16
- LTEXT "Do you want to import the settings now?",IDC_STATIC,5,69,203,8
- PUSHBUTTON "No to all",IDC_NOTOALL,136,84,50,14
- LTEXT "",IDC_ININAME,5,24,143,16,SS_NOPREFIX | SS_CENTERIMAGE
- PUSHBUTTON "&View contents",IDC_VIEWINI,150,25,58,14
- LTEXT "Security systems to prevent malicious changes are in place and you will be warned before changes that are not known to be safe.",IDC_SECURITYINFO,5,43,203,24
+ DEFPUSHBUTTON "Yes", IDOK, 26, 84, 50, 14
+ PUSHBUTTON "No", IDCANCEL, 81, 84, 50, 14
+ LTEXT "A file containing new database settings has been placed in the Miranda IM directory.", IDC_STATIC, 5, 5, 203, 16
+ LTEXT "Do you want to import the settings now?", IDC_STATIC, 5, 69, 203, 8
+ PUSHBUTTON "No to all", IDC_NOTOALL, 136, 84, 50, 14
+ LTEXT "", IDC_ININAME, 5, 24, 143, 16, SS_NOPREFIX | SS_CENTERIMAGE
+ PUSHBUTTON "&View contents", IDC_VIEWINI, 150, 25, 58, 14
+ LTEXT "Security systems to prevent malicious changes are in place and you will be warned before changes that are not known to be safe.", IDC_SECURITYINFO, 5, 43, 203, 24
END
IDD_WARNINICHANGE DIALOGEX 0, 0, 187, 113
@@ -413,19 +413,19 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Database Setting Change"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Database settings are being imported from",IDC_STATIC,5,5,177,8
- CONTROL "",IDC_ININAME,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,5,13,177,8
- LTEXT "This file wishes to change the setting",IDC_STATIC,5,24,177,8
- CONTROL "",IDC_SETTINGNAME,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,12,33,170,8
- LTEXT "to the value",IDC_STATIC,5,42,177,8
- CONTROL "",IDC_NEWVALUE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,12,51,170,8
- LTEXT "",IDC_SECURITYINFO,5,60,177,8
- LTEXT "Do you want to allow this change?",IDC_STATIC,5,71,177,8
- CONTROL "&Allow all further changes to this section",IDC_WARNNOMORE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,80,169,10
- DEFPUSHBUTTON "&Yes",IDYES,5,94,50,14
- PUSHBUTTON "&No",IDNO,59,94,50,14
- PUSHBUTTON "Cancel Import",IDCANCEL,123,94,59,14
+ LTEXT "Database settings are being imported from", IDC_STATIC, 5, 5, 177, 8
+ CONTROL "", IDC_ININAME, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 5, 13, 177, 8
+ LTEXT "This file wishes to change the setting", IDC_STATIC, 5, 24, 177, 8
+ CONTROL "", IDC_SETTINGNAME, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 12, 33, 170, 8
+ LTEXT "to the value", IDC_STATIC, 5, 42, 177, 8
+ CONTROL "", IDC_NEWVALUE, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 12, 51, 170, 8
+ LTEXT "", IDC_SECURITYINFO, 5, 60, 177, 8
+ LTEXT "Do you want to allow this change?", IDC_STATIC, 5, 71, 177, 8
+ CONTROL "&Allow all further changes to this section", IDC_WARNNOMORE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 80, 169, 10
+ DEFPUSHBUTTON "&Yes", IDYES, 5, 94, 50, 14
+ PUSHBUTTON "&No", IDNO, 59, 94, 50, 14
+ PUSHBUTTON "Cancel Import", IDCANCEL, 123, 94, 59, 14
END
IDD_INIIMPORTDONE DIALOGEX 0, 0, 186, 73
@@ -434,14 +434,14 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Database Import Complete"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "The import has completed from",IDC_STATIC,5,5,176,8
- CONTROL "",IDC_ININAME,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,5,13,176,8
- LTEXT "What do you want to do with the file now?",IDC_STATIC,5,24,176,8
- PUSHBUTTON "&Recycle",IDC_RECYCLE,5,36,50,14
- PUSHBUTTON "&Delete",IDC_DELETE,68,36,50,14
- EDITTEXT IDC_NEWNAME,5,55,117,12,ES_AUTOHSCROLL
- PUSHBUTTON "&Move/Rename",IDC_MOVE,124,54,57,14
- PUSHBUTTON "&Leave",IDC_LEAVE,131,36,50,14
+ LTEXT "The import has completed from", IDC_STATIC, 5, 5, 176, 8
+ CONTROL "", IDC_ININAME, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 5, 13, 176, 8
+ LTEXT "What do you want to do with the file now?", IDC_STATIC, 5, 24, 176, 8
+ PUSHBUTTON "&Recycle", IDC_RECYCLE, 5, 36, 50, 14
+ PUSHBUTTON "&Delete", IDC_DELETE, 68, 36, 50, 14
+ EDITTEXT IDC_NEWNAME, 5, 55, 117, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "&Move/Rename", IDC_MOVE, 124, 54, 57, 14
+ PUSHBUTTON "&Leave", IDC_LEAVE, 131, 36, 50, 14
END
IDD_NETLIBLOGOPTS DIALOGEX 0, 0, 314, 259
@@ -450,32 +450,32 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Netlib Log Options"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Show",IDC_STATIC,6,2,302,118
- CONTROL "Tree1",IDC_FILTER,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,14,13,160,81
- CONTROL "Received bytes",IDC_DUMPRECV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,13,122,10
- CONTROL "Sent bytes",IDC_DUMPSENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,26,122,10
- CONTROL "Additional data due to proxy communication",IDC_DUMPPROXY,
- "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,181,39,122,18
- CONTROL "Text dumps where available",IDC_TEXTDUMPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,69,122,10
- CONTROL "Auto-detect text",IDC_AUTODETECTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,83,122,10
- CONTROL "Calling modules' names",IDC_SHOWNAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,96,122,10
- COMBOBOX IDC_TIMEFORMAT,14,100,160,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Log to",IDC_STATIC,6,122,302,66
- CONTROL "OutputDebugString()",IDC_TOOUTPUTDEBUGSTRING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,132,122,10
- CONTROL "File",IDC_TOFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,146,44,10
- EDITTEXT IDC_FILENAME,14,159,270,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_FILENAMEBROWSE,288,159,15,12
- LTEXT "",IDC_PATH,14,174,294,10
- GROUPBOX "Run programm when Miranda IM starts (eg tail -f, dbgview, etc):",IDC_STATIC,6,188,302,32
- EDITTEXT IDC_RUNATSTART,14,200,203,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_RUNATSTARTBROWSE,220,200,15,12
- PUSHBUTTON "Run now",IDC_RUNNOW,241,200,60,12
- CONTROL "Show this dialog box when Miranda IM starts",IDC_SHOWTHISDLGATSTART,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,226,294,10
- PUSHBUTTON "Save as default",IDC_SAVE,6,241,79,14
- DEFPUSHBUTTON "Ok",IDOK,173,241,54,14
- PUSHBUTTON "Cancel",IDCANCEL,249,241,54,14
- CONTROL "SSL Traffic",IDC_DUMPSSL,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,181,56,122,10
+ GROUPBOX "Show", IDC_STATIC, 6, 2, 302, 118
+ CONTROL "Tree1", IDC_FILTER, "SysTreeView32", TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_HSCROLL | WS_TABSTOP, 14, 13, 160, 81
+ CONTROL "Received bytes", IDC_DUMPRECV, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 181, 13, 122, 10
+ CONTROL "Sent bytes", IDC_DUMPSENT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 181, 26, 122, 10
+ CONTROL "Additional data due to proxy communication", IDC_DUMPPROXY,
+ "Button", BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP, 181, 39, 122, 18
+ CONTROL "Text dumps where available", IDC_TEXTDUMPS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 181, 69, 122, 10
+ CONTROL "Auto-detect text", IDC_AUTODETECTTEXT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 181, 83, 122, 10
+ CONTROL "Calling modules' names", IDC_SHOWNAMES, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 181, 96, 122, 10
+ COMBOBOX IDC_TIMEFORMAT, 14, 100, 160, 69, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Log to", IDC_STATIC, 6, 122, 302, 66
+ CONTROL "OutputDebugString()", IDC_TOOUTPUTDEBUGSTRING, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 132, 122, 10
+ CONTROL "File", IDC_TOFILE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 146, 44, 10
+ EDITTEXT IDC_FILENAME, 14, 159, 270, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDC_FILENAMEBROWSE, 288, 159, 15, 12
+ LTEXT "", IDC_PATH, 14, 174, 294, 10
+ GROUPBOX "Run programm when Miranda IM starts (eg tail -f, dbgview, etc):", IDC_STATIC, 6, 188, 302, 32
+ EDITTEXT IDC_RUNATSTART, 14, 200, 203, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDC_RUNATSTARTBROWSE, 220, 200, 15, 12
+ PUSHBUTTON "Run now", IDC_RUNNOW, 241, 200, 60, 12
+ CONTROL "Show this dialog box when Miranda IM starts", IDC_SHOWTHISDLGATSTART,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 226, 294, 10
+ PUSHBUTTON "Save as default", IDC_SAVE, 6, 241, 79, 14
+ DEFPUSHBUTTON "Ok", IDOK, 173, 241, 54, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 249, 241, 54, 14
+ CONTROL "SSL Traffic", IDC_DUMPSSL, "Button", BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP, 181, 56, 122, 10
END
IDD_HISTORY_FIND DIALOGEX 0, 0, 230, 46
@@ -484,10 +484,10 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Find"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- EDITTEXT IDC_FINDWHAT,48,11,115,12,ES_AUTOHSCROLL
- DEFPUSHBUTTON "&Find Next",IDOK,173,7,50,14
- PUSHBUTTON "Cancel",IDCANCEL,173,24,50,14
- LTEXT "Find What:",IDC_STATIC,7,13,39,9
+ EDITTEXT IDC_FINDWHAT, 48, 11, 115, 12, ES_AUTOHSCROLL
+ DEFPUSHBUTTON "&Find Next", IDOK, 173, 7, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 173, 24, 50, 14
+ LTEXT "Find What:", IDC_STATIC, 7, 13, 39, 9
END
IDD_FILESEND DIALOGEX 0, 0, 256, 177
@@ -496,22 +496,22 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Send File(s)"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- EDITTEXT IDC_MSG,6,102,245,46,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
- DEFPUSHBUTTON "&Send",IDOK,67,157,50,15
- PUSHBUTTON "Cancel",IDCANCEL,140,157,50,15
- LTEXT "To:",IDC_STATIC,6,23,24,9,SS_CENTERIMAGE
- CONTROL "",IDC_TO,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,43,24,159,9
- LTEXT "File(s):",IDC_STATIC,7,39,30,8
- EDITTEXT IDC_FILE,38,38,213,31,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY
- PUSHBUTTON "&Choose Again...",IDC_CHOOSE,39,74,77,14
- RTEXT "Total size:",IDC_STATIC,119,76,68,8
- CONTROL "",IDC_TOTALSIZE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,191,76,58,8
- LTEXT "Description:",IDC_STATIC,6,93,96,8
- CONTROL "6",IDC_USERMENU,"MButtonClass",WS_TABSTOP,195,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&D",IDC_DETAILS,"MButtonClass",WS_TABSTOP,213,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&H",IDC_HISTORY,"MButtonClass",WS_TABSTOP,231,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "",IDC_PROTOCOL,"Button",BS_OWNERDRAW | WS_TABSTOP,5,7,12,12
- LTEXT "",IDC_NAME,19,7,151,9,SS_NOPREFIX | SS_CENTERIMAGE
+ EDITTEXT IDC_MSG, 6, 102, 245, 46, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ DEFPUSHBUTTON "&Send", IDOK, 67, 157, 50, 15
+ PUSHBUTTON "Cancel", IDCANCEL, 140, 157, 50, 15
+ LTEXT "To:", IDC_STATIC, 6, 23, 24, 9, SS_CENTERIMAGE
+ CONTROL "", IDC_TO, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 43, 24, 159, 9
+ LTEXT "File(s):", IDC_STATIC, 7, 39, 30, 8
+ EDITTEXT IDC_FILE, 38, 38, 213, 31, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY
+ PUSHBUTTON "&Choose Again...", IDC_CHOOSE, 39, 74, 77, 14
+ RTEXT "Total size:", IDC_STATIC, 119, 76, 68, 8
+ CONTROL "", IDC_TOTALSIZE, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 191, 76, 58, 8
+ LTEXT "Description:", IDC_STATIC, 6, 93, 96, 8
+ CONTROL "6", IDC_USERMENU, "MButtonClass", WS_TABSTOP, 195, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&D", IDC_DETAILS, "MButtonClass", WS_TABSTOP, 213, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&H", IDC_HISTORY, "MButtonClass", WS_TABSTOP, 231, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "", IDC_PROTOCOL, "Button", BS_OWNERDRAW | WS_TABSTOP, 5, 7, 12, 12
+ LTEXT "", IDC_NAME, 19, 7, 151, 9, SS_NOPREFIX | SS_CENTERIMAGE
END
IDD_FILERECV DIALOGEX 0, 0, 256, 174
@@ -520,25 +520,25 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Incoming File Transfer"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "A&ccept",IDOK,68,155,50,14
- PUSHBUTTON "&Decline",IDCANCEL,138,155,50,14
- LTEXT "From:",IDC_STATIC,6,20,24,9,SS_CENTERIMAGE
- CONTROL "",IDC_FROM,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,39,21,159,9
- LTEXT "Date:",IDC_STATIC,6,35,28,9,SS_CENTERIMAGE
- CONTROL "",IDC_DATE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,39,34,159,9
- LTEXT "Files:",IDC_STATIC,6,50,28,8
- EDITTEXT IDC_FILENAMES,39,50,210,16,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Description:",IDC_STATIC,6,69,64,8
- EDITTEXT IDC_MSG,6,79,243,45,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY
- LTEXT "Save to:",IDC_STATIC,6,131,34,8
- PUSHBUTTON "...",IDC_FILEDIRBROWSE,235,130,14,10
- COMBOBOX IDC_FILEDIR,45,129,187,108,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- CONTROL "&A",IDC_ADD,"MButtonClass",WS_TABSTOP,177,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "6",IDC_USERMENU,"MButtonClass",WS_TABSTOP,195,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&D",IDC_DETAILS,"MButtonClass",WS_TABSTOP,213,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&H",IDC_HISTORY,"MButtonClass",WS_TABSTOP,231,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "",IDC_PROTOCOL,"Button",BS_OWNERDRAW | WS_TABSTOP,5,7,12,12
- LTEXT "",IDC_NAME,19,7,151,9,SS_NOPREFIX | SS_CENTERIMAGE
+ DEFPUSHBUTTON "A&ccept", IDOK, 68, 155, 50, 14
+ PUSHBUTTON "&Decline", IDCANCEL, 138, 155, 50, 14
+ LTEXT "From:", IDC_STATIC, 6, 20, 24, 9, SS_CENTERIMAGE
+ CONTROL "", IDC_FROM, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 39, 21, 159, 9
+ LTEXT "Date:", IDC_STATIC, 6, 35, 28, 9, SS_CENTERIMAGE
+ CONTROL "", IDC_DATE, "Static", SS_SIMPLE | SS_NOPREFIX | WS_GROUP, 39, 34, 159, 9
+ LTEXT "Files:", IDC_STATIC, 6, 50, 28, 8
+ EDITTEXT IDC_FILENAMES, 39, 50, 210, 16, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Description:", IDC_STATIC, 6, 69, 64, 8
+ EDITTEXT IDC_MSG, 6, 79, 243, 45, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY
+ LTEXT "Save to:", IDC_STATIC, 6, 131, 34, 8
+ PUSHBUTTON "...", IDC_FILEDIRBROWSE, 235, 130, 14, 10
+ COMBOBOX IDC_FILEDIR, 45, 129, 187, 108, CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "&A", IDC_ADD, "MButtonClass", WS_TABSTOP, 177, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "6", IDC_USERMENU, "MButtonClass", WS_TABSTOP, 195, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&D", IDC_DETAILS, "MButtonClass", WS_TABSTOP, 213, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&H", IDC_HISTORY, "MButtonClass", WS_TABSTOP, 231, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "", IDC_PROTOCOL, "Button", BS_OWNERDRAW | WS_TABSTOP, 5, 7, 12, 12
+ LTEXT "", IDC_NAME, 19, 7, 151, 9, SS_NOPREFIX | SS_CENTERIMAGE
END
IDD_FILETRANSFERINFO DIALOGEX 0, 0, 256, 44
@@ -546,20 +546,20 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "Contact menu",IDC_CONTACT,"MButtonClass",WS_TABSTOP,5,1,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "",IDC_CONTACTNAME,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_WORDELLIPSIS | WS_GROUP,25,1,174,14
- CONTROL "Open...",IDC_OPENFILE,"MButtonClass",WS_DISABLED | WS_TABSTOP,203,1,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "Open folder",IDC_OPENFOLDER,"MButtonClass",WS_TABSTOP,219,1,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "Cancel",IDCANCEL,"MButtonClass",WS_TABSTOP,235,1,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "",IDC_ALLFILESPROGRESS,"msctls_progress32",PBS_SMOOTH | NOT WS_VISIBLE | WS_DISABLED,25,16,190,12
- CONTROL "",IDC_STATUS,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX | WS_GROUP,25,17,190,10
- ICON "",IDC_FILEICON,25,15,16,14,SS_CENTERIMAGE | SS_REALSIZEIMAGE
- CONTROL "Transfer completed, open file(s).",IDC_TRANSFERCOMPLETED,
- "Hyperlink",NOT WS_VISIBLE | WS_TABSTOP,42,17,173,10
- LTEXT "No data transferred",IDC_ALLTRANSFERRED,25,29,226,14,SS_NOPREFIX | SS_CENTERIMAGE
- RTEXT "",IDC_ALLSPEED,25,29,226,14,SS_NOPREFIX | SS_CENTERIMAGE
- LTEXT "",IDC_ALLPRECENTS,218,14,33,14,SS_CENTERIMAGE
- CONTROL "",IDC_FRAME,"Static",SS_ETCHEDHORZ,1,43,254,1
+ CONTROL "Contact menu", IDC_CONTACT, "MButtonClass", WS_TABSTOP, 5, 1, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "", IDC_CONTACTNAME, "Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_WORDELLIPSIS | WS_GROUP, 25, 1, 174, 14
+ CONTROL "Open...", IDC_OPENFILE, "MButtonClass", WS_DISABLED | WS_TABSTOP, 203, 1, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "Open folder", IDC_OPENFOLDER, "MButtonClass", WS_TABSTOP, 219, 1, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "Cancel", IDCANCEL, "MButtonClass", WS_TABSTOP, 235, 1, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "", IDC_ALLFILESPROGRESS, "msctls_progress32", PBS_SMOOTH | NOT WS_VISIBLE | WS_DISABLED, 25, 16, 190, 12
+ CONTROL "", IDC_STATUS, "Static", SS_LEFTNOWORDWRAP | SS_NOPREFIX | WS_GROUP, 25, 17, 190, 10
+ ICON "", IDC_FILEICON, 25, 15, 16, 14, SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ CONTROL "Transfer completed, open file(s).", IDC_TRANSFERCOMPLETED,
+ "Hyperlink", NOT WS_VISIBLE | WS_TABSTOP, 42, 17, 173, 10
+ LTEXT "No data transferred", IDC_ALLTRANSFERRED, 25, 29, 226, 14, SS_NOPREFIX | SS_CENTERIMAGE
+ RTEXT "", IDC_ALLSPEED, 25, 29, 226, 14, SS_NOPREFIX | SS_CENTERIMAGE
+ LTEXT "", IDC_ALLPRECENTS, 218, 14, 33, 14, SS_CENTERIMAGE
+ CONTROL "", IDC_FRAME, "Static", SS_ETCHEDHORZ, 1, 43, 254, 1
END
IDD_FILEEXISTS DIALOGEX 0, 0, 288, 181
@@ -568,35 +568,35 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "File Already Exists"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- PUSHBUTTON "Resume",IDC_RESUME,5,144,65,14
- PUSHBUTTON "Resume all",IDC_RESUMEALL,5,162,65,14
- PUSHBUTTON "Overwrite",IDC_OVERWRITE,76,144,65,14
- PUSHBUTTON "Overwrite all",IDC_OVERWRITEALL,76,162,65,14
- PUSHBUTTON "Save as...",IDC_SAVEAS,147,144,65,14
- PUSHBUTTON "Auto rename",IDC_AUTORENAME,147,162,65,14
- PUSHBUTTON "Skip",IDC_SKIP,218,144,65,14
- PUSHBUTTON "Cancel transfer",IDCANCEL,218,162,65,14
- LTEXT "You are about to receive the file",IDC_STATIC,5,5,278,8
- EDITTEXT IDC_FILENAME,15,16,268,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- GROUPBOX "Existing file",IDC_STATIC,5,29,278,61
- ICON "",IDC_EXISTINGICON,14,45,20,20,SS_NOTIFY
- LTEXT "Size:",IDC_STATIC,40,42,27,8
- LTEXT "",IDC_EXISTINGSIZE,67,42,35,8
- RTEXT "Last modified:",IDC_STATIC,103,42,58,8
- LTEXT "",IDC_EXISTINGDATE,166,42,115,8
- LTEXT "Type:",IDC_STATIC,40,55,27,8
- LTEXT "",IDC_EXISTINGTYPE,67,55,214,8
- PUSHBUTTON "Open file",IDC_OPENFILE,12,70,62,13
- PUSHBUTTON "Open folder",IDC_OPENFOLDER,82,70,62,13
- PUSHBUTTON "File properties",IDC_PROPERTIES,201,70,74,13
- GROUPBOX "File being received",IDC_STATIC,5,95,278,42
- ICON "",IDC_NEWICON,14,110,20,20,SS_NOTIFY
- LTEXT "Size:",IDC_STATIC,40,108,27,8
- LTEXT "",IDC_NEWSIZE,67,108,35,8
- RTEXT "Last modified:",IDC_STATIC,103,108,58,8
- LTEXT "",IDC_NEWDATE,166,108,115,8
- LTEXT "Type:",IDC_STATIC,40,121,27,8
- LTEXT "",IDC_NEWTYPE,67,121,214,8
+ PUSHBUTTON "Resume", IDC_RESUME, 5, 144, 65, 14
+ PUSHBUTTON "Resume all", IDC_RESUMEALL, 5, 162, 65, 14
+ PUSHBUTTON "Overwrite", IDC_OVERWRITE, 76, 144, 65, 14
+ PUSHBUTTON "Overwrite all", IDC_OVERWRITEALL, 76, 162, 65, 14
+ PUSHBUTTON "Save as...", IDC_SAVEAS, 147, 144, 65, 14
+ PUSHBUTTON "Auto rename", IDC_AUTORENAME, 147, 162, 65, 14
+ PUSHBUTTON "Skip", IDC_SKIP, 218, 144, 65, 14
+ PUSHBUTTON "Cancel transfer", IDCANCEL, 218, 162, 65, 14
+ LTEXT "You are about to receive the file", IDC_STATIC, 5, 5, 278, 8
+ EDITTEXT IDC_FILENAME, 15, 16, 268, 8, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ GROUPBOX "Existing file", IDC_STATIC, 5, 29, 278, 61
+ ICON "", IDC_EXISTINGICON, 14, 45, 20, 20, SS_NOTIFY
+ LTEXT "Size:", IDC_STATIC, 40, 42, 27, 8
+ LTEXT "", IDC_EXISTINGSIZE, 67, 42, 35, 8
+ RTEXT "Last modified:", IDC_STATIC, 103, 42, 58, 8
+ LTEXT "", IDC_EXISTINGDATE, 166, 42, 115, 8
+ LTEXT "Type:", IDC_STATIC, 40, 55, 27, 8
+ LTEXT "", IDC_EXISTINGTYPE, 67, 55, 214, 8
+ PUSHBUTTON "Open file", IDC_OPENFILE, 12, 70, 62, 13
+ PUSHBUTTON "Open folder", IDC_OPENFOLDER, 82, 70, 62, 13
+ PUSHBUTTON "File properties", IDC_PROPERTIES, 201, 70, 74, 13
+ GROUPBOX "File being received", IDC_STATIC, 5, 95, 278, 42
+ ICON "", IDC_NEWICON, 14, 110, 20, 20, SS_NOTIFY
+ LTEXT "Size:", IDC_STATIC, 40, 108, 27, 8
+ LTEXT "", IDC_NEWSIZE, 67, 108, 35, 8
+ RTEXT "Last modified:", IDC_STATIC, 103, 108, 58, 8
+ LTEXT "", IDC_NEWDATE, 166, 108, 115, 8
+ LTEXT "Type:", IDC_STATIC, 40, 121, 27, 8
+ LTEXT "", IDC_NEWTYPE, 67, 121, 214, 8
END
IDD_URLSEND DIALOGEX 0, 0, 215, 126
@@ -604,18 +604,18 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- COMBOBOX IDC_URLS,5,30,205,92,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_MESSAGE,5,57,205,44,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
- DEFPUSHBUTTON "&Send",IDOK,54,107,50,14
- PUSHBUTTON "&Cancel",IDCANCEL,113,107,50,14
- CONTROL "",IDC_PROTOCOL,"Button",BS_OWNERDRAW | WS_TABSTOP,5,7,12,12
- LTEXT "",IDC_NAME,19,7,118,9,SS_NOPREFIX | SS_CENTERIMAGE
- CONTROL "&A",IDC_ADD,"MButtonClass",WS_TABSTOP,140,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "6",IDC_USERMENU,"MButtonClass",WS_TABSTOP,158,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&D",IDC_DETAILS,"MButtonClass",WS_TABSTOP,176,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&H",IDC_HISTORY,"MButtonClass",WS_TABSTOP,194,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- LTEXT "Enter URL:",IDC_ST_ENTERURL,5,20,205,8
- LTEXT "Enter description:",IDC_ST_ENTERMSG,5,47,205,8
+ COMBOBOX IDC_URLS, 5, 30, 205, 92, CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_MESSAGE, 5, 57, 205, 44, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ DEFPUSHBUTTON "&Send", IDOK, 54, 107, 50, 14
+ PUSHBUTTON "&Cancel", IDCANCEL, 113, 107, 50, 14
+ CONTROL "", IDC_PROTOCOL, "Button", BS_OWNERDRAW | WS_TABSTOP, 5, 7, 12, 12
+ LTEXT "", IDC_NAME, 19, 7, 118, 9, SS_NOPREFIX | SS_CENTERIMAGE
+ CONTROL "&A", IDC_ADD, "MButtonClass", WS_TABSTOP, 140, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "6", IDC_USERMENU, "MButtonClass", WS_TABSTOP, 158, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&D", IDC_DETAILS, "MButtonClass", WS_TABSTOP, 176, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&H", IDC_HISTORY, "MButtonClass", WS_TABSTOP, 194, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ LTEXT "Enter URL:", IDC_ST_ENTERURL, 5, 20, 205, 8
+ LTEXT "Enter description:", IDC_ST_ENTERMSG, 5, 47, 205, 8
END
IDD_URLRECV DIALOGEX 0, 0, 215, 140
@@ -624,21 +624,21 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "URL Received"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "&Open URL",IDOK,"MButtonClass",WS_TABSTOP,11,120,57,14,WS_EX_NOACTIVATE | 0x10000000L
- PUSHBUTTON "&Reply",IDC_REPLY,82,120,50,14
- PUSHBUTTON "&Close",IDCANCEL,148,120,50,14
- CONTROL "",IDC_PROTOCOL,"Button",BS_OWNERDRAW | WS_TABSTOP,5,7,12,12
- LTEXT "",IDC_NAME,19,7,118,9,SS_NOPREFIX | SS_CENTERIMAGE
- CONTROL "&A",IDC_ADD,"MButtonClass",WS_TABSTOP,140,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "6",IDC_USERMENU,"MButtonClass",WS_TABSTOP,158,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&D",IDC_DETAILS,"MButtonClass",WS_TABSTOP,176,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&H",IDC_HISTORY,"MButtonClass",WS_TABSTOP,194,5,16,14,WS_EX_NOACTIVATE | 0x10000000L
- LTEXT "Date:",IDC_STATIC,5,21,29,8
- EDITTEXT IDC_DATE,34,21,176,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "URL:",IDC_STATIC,5,33,205,8
- EDITTEXT IDC_URL,5,43,205,12,ES_AUTOHSCROLL | ES_READONLY
- LTEXT "Description:",IDC_ST_ENTERMSG,5,60,205,8
- EDITTEXT IDC_MSG,5,70,205,44,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
+ CONTROL "&Open URL", IDOK, "MButtonClass", WS_TABSTOP, 11, 120, 57, 14, WS_EX_NOACTIVATE | 0x10000000L
+ PUSHBUTTON "&Reply", IDC_REPLY, 82, 120, 50, 14
+ PUSHBUTTON "&Close", IDCANCEL, 148, 120, 50, 14
+ CONTROL "", IDC_PROTOCOL, "Button", BS_OWNERDRAW | WS_TABSTOP, 5, 7, 12, 12
+ LTEXT "", IDC_NAME, 19, 7, 118, 9, SS_NOPREFIX | SS_CENTERIMAGE
+ CONTROL "&A", IDC_ADD, "MButtonClass", WS_TABSTOP, 140, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "6", IDC_USERMENU, "MButtonClass", WS_TABSTOP, 158, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&D", IDC_DETAILS, "MButtonClass", WS_TABSTOP, 176, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&H", IDC_HISTORY, "MButtonClass", WS_TABSTOP, 194, 5, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ LTEXT "Date:", IDC_STATIC, 5, 21, 29, 8
+ EDITTEXT IDC_DATE, 34, 21, 176, 12, ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "URL:", IDC_STATIC, 5, 33, 205, 8
+ EDITTEXT IDC_URL, 5, 43, 205, 12, ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Description:", IDC_ST_ENTERMSG, 5, 60, 205, 8
+ EDITTEXT IDC_MSG, 5, 70, 205, 44, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
END
IDD_HISTORY DIALOGEX 0, 0, 296, 166
@@ -647,11 +647,11 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Message History"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- DEFPUSHBUTTON "Close",IDOK,239,144,50,14
- EDITTEXT IDC_EDIT,7,83,282,52,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
- LISTBOX IDC_LIST,7,7,282,72,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "&Find...",IDC_FIND,7,144,50,14
- PUSHBUTTON "Delete",IDC_DELETEHISTORY,66,144,50,14
+ DEFPUSHBUTTON "Close", IDOK, 239, 144, 50, 14
+ EDITTEXT IDC_EDIT, 7, 83, 282, 52, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
+ LISTBOX IDC_LIST, 7, 7, 282, 72, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "&Find...", IDC_FIND, 7, 144, 50, 14
+ PUSHBUTTON "Delete", IDC_DELETEHISTORY, 66, 144, 50, 14
END
IDD_OPT_SOUND DIALOGEX 0, 0, 285, 240
@@ -659,17 +659,17 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Sounds",IDC_STATIC,4,4,277,154
- PUSHBUTTON "&Change...",IDC_CHANGE,16,213,50,14
- PUSHBUTTON "&Preview",IDC_PREVIEW,70,213,50,14
- CONTROL "Download more sounds",IDC_GETMORE,"Hyperlink",WS_TABSTOP | 0x2,127,216,137,8
- CONTROL "Tree1",IDC_SOUNDTREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,12,33,261,119
- GROUPBOX "Sound Information",IDC_SGROUP,4,162,277,71
- LTEXT "Location:",IDC_SLOC,17,190,40,9
- EDITTEXT IDC_LOCATION,65,190,208,13,ES_AUTOHSCROLL | ES_READONLY
- LTEXT "Name:",IDC_NAME,17,174,39,9
- LTEXT "",IDC_NAMEVAL,64,174,209,9
- CONTROL "Enable sound events",IDC_ENABLESOUNDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,17,261,10
+ GROUPBOX "Sounds", IDC_STATIC, 4, 4, 277, 154
+ PUSHBUTTON "&Change...", IDC_CHANGE, 16, 213, 50, 14
+ PUSHBUTTON "&Preview", IDC_PREVIEW, 70, 213, 50, 14
+ CONTROL "Download more sounds", IDC_GETMORE, "Hyperlink", WS_TABSTOP | 0x2, 127, 216, 137, 8
+ CONTROL "Tree1", IDC_SOUNDTREE, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP, 12, 33, 261, 119
+ GROUPBOX "Sound Information", IDC_SGROUP, 4, 162, 277, 71
+ LTEXT "Location:", IDC_SLOC, 17, 190, 40, 9
+ EDITTEXT IDC_LOCATION, 65, 190, 208, 13, ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Name:", IDC_NAME, 17, 174, 39, 9
+ LTEXT "", IDC_NAMEVAL, 64, 174, 209, 9
+ CONTROL "Enable sound events", IDC_ENABLESOUNDS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 12, 17, 261, 10
END
IDD_OPT_ICONS DIALOGEX 0, 0, 257, 193
@@ -677,14 +677,14 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Icons",IDC_STICONSGROUP,4,4,248,185
- LTEXT "Show category:",IDC_STATIC,12,18,66,16
- LISTBOX IDC_CATEGORYLIST,114,17,129,41,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- CONTROL "List1",IDC_PREVIEW,"SysListView32",LVS_SINGLESEL | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,12,66,231,83
- PUSHBUTTON "&Load icon set...",IDC_LOADICONS,12,158,94,13
- PUSHBUTTON "&Import icons >>",IDC_IMPORT,154,158,89,13
- CONTROL "Download more icons",IDC_GETMORE,"Hyperlink",WS_TABSTOP | 0x1,12,178,232,8
- LTEXT "",IDC_STSIMPLERIGHT,200,104,8,32,NOT WS_VISIBLE
+ GROUPBOX "Icons", IDC_STICONSGROUP, 4, 4, 248, 185
+ LTEXT "Show category:", IDC_STATIC, 12, 18, 66, 16
+ LISTBOX IDC_CATEGORYLIST, 114, 17, 129, 41, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "List1", IDC_PREVIEW, "SysListView32", LVS_SINGLESEL | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP, 12, 66, 231, 83
+ PUSHBUTTON "&Load icon set...", IDC_LOADICONS, 12, 158, 94, 13
+ PUSHBUTTON "&Import icons >>", IDC_IMPORT, 154, 158, 89, 13
+ CONTROL "Download more icons", IDC_GETMORE, "Hyperlink", WS_TABSTOP | 0x1, 12, 178, 232, 8
+ LTEXT "", IDC_STSIMPLERIGHT, 200, 104, 8, 32, NOT WS_VISIBLE
END
IDD_OPT_IGNORE DIALOGEX 0, 0, 313, 240
@@ -692,28 +692,28 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "The following events are being ignored:",IDC_STATIC,8,14,297,8
- ICON IDI_RECVMSG,IDC_MSGICON,8,172,20,20,SS_CENTERIMAGE
- LTEXT "Messages",IDC_STATIC,28,178,70,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_URL,IDC_URLICON,8,187,20,20,SS_CENTERIMAGE
- LTEXT "URLs",IDC_STATIC,28,193,70,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_FILE,IDC_FILEICON,8,202,20,20,SS_CENTERIMAGE
- LTEXT "Files",IDC_STATIC,28,208,70,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_USERONLINE,IDC_ONLINEICON,96,172,20,20,SS_CENTERIMAGE
- LTEXT "Online Notification",IDC_STATIC,116,178,107,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_MIRANDA,IDC_AUTHICON,96,187,20,20,SS_CENTERIMAGE
- LTEXT "Auth Requests",IDC_STATIC,116,193,107,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_FILLEDBLOB,IDC_ALLICON,221,187,20,20,SS_CENTERIMAGE
- LTEXT "All Events",IDC_STATIC,241,193,66,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_EMPTYBLOB,IDC_NONEICON,221,202,20,20,SS_CENTERIMAGE
- LTEXT "None",IDC_STATIC,241,208,66,8,SS_NOPREFIX | SS_CENTERIMAGE
- CTEXT "Only the ticked contacts will be shown on the main contact list",IDC_STCHECKMARKS,8,227,297,8
- CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x3da,8,26,297,146,WS_EX_CLIENTEDGE
- GROUPBOX "Ignore",IDC_STATIC,0,0,313,240
- ICON IDI_ADDCONTACT,IDC_ADDED,96,202,20,20,SS_CENTERIMAGE
- LTEXT "Added Notification",IDC_STATIC,116,208,107,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_TYPING,IDC_TYPINGICON,221,172,20,20,SS_CENTERIMAGE
- LTEXT "Typing",IDC_STATIC,241,178,66,8,SS_NOPREFIX | SS_CENTERIMAGE
+ LTEXT "The following events are being ignored:", IDC_STATIC, 8, 14, 297, 8
+ ICON IDI_RECVMSG, IDC_MSGICON, 8, 172, 20, 20, SS_CENTERIMAGE
+ LTEXT "Messages", IDC_STATIC, 28, 178, 70, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_URL, IDC_URLICON, 8, 187, 20, 20, SS_CENTERIMAGE
+ LTEXT "URLs", IDC_STATIC, 28, 193, 70, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_FILE, IDC_FILEICON, 8, 202, 20, 20, SS_CENTERIMAGE
+ LTEXT "Files", IDC_STATIC, 28, 208, 70, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_USERONLINE, IDC_ONLINEICON, 96, 172, 20, 20, SS_CENTERIMAGE
+ LTEXT "Online Notification", IDC_STATIC, 116, 178, 107, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_MIRANDA, IDC_AUTHICON, 96, 187, 20, 20, SS_CENTERIMAGE
+ LTEXT "Auth Requests", IDC_STATIC, 116, 193, 107, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_FILLEDBLOB, IDC_ALLICON, 221, 187, 20, 20, SS_CENTERIMAGE
+ LTEXT "All Events", IDC_STATIC, 241, 193, 66, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_EMPTYBLOB, IDC_NONEICON, 221, 202, 20, 20, SS_CENTERIMAGE
+ LTEXT "None", IDC_STATIC, 241, 208, 66, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ CTEXT "Only the ticked contacts will be shown on the main contact list", IDC_STCHECKMARKS, 8, 227, 297, 8
+ CONTROL "", IDC_LIST, "CListControl", WS_TABSTOP | 0x3da, 8, 26, 297, 146, WS_EX_CLIENTEDGE
+ GROUPBOX "Ignore", IDC_STATIC, 0, 0, 313, 240
+ ICON IDI_ADDCONTACT, IDC_ADDED, 96, 202, 20, 20, SS_CENTERIMAGE
+ LTEXT "Added Notification", IDC_STATIC, 116, 208, 107, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_TYPING, IDC_TYPINGICON, 221, 172, 20, 20, SS_CENTERIMAGE
+ LTEXT "Typing", IDC_STATIC, 241, 178, 66, 8, SS_NOPREFIX | SS_CENTERIMAGE
END
IDD_OPT_VISIBILITY DIALOGEX 0, 0, 313, 240
@@ -721,12 +721,12 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Visibility",IDC_STATIC,0,0,313,240
- CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x1d0,8,14,297,183,WS_EX_CLIENTEDGE
- ICON IDI_ONLINE,IDC_VISIBLEICON,8,203,20,20,SS_CENTERIMAGE
- LTEXT "You are visible to this person even when in invisible mode",IDC_STATIC,26,209,279,8,SS_NOPREFIX | SS_CENTERIMAGE
- ICON IDI_INVISIBLE,IDC_INVISIBLEICON,8,218,20,20,SS_CENTERIMAGE
- LTEXT "You are never visible to this person",IDC_STATIC,26,224,279,8,SS_NOPREFIX | SS_CENTERIMAGE
+ GROUPBOX "Visibility", IDC_STATIC, 0, 0, 313, 240
+ CONTROL "", IDC_LIST, "CListControl", WS_TABSTOP | 0x1d0, 8, 14, 297, 183, WS_EX_CLIENTEDGE
+ ICON IDI_ONLINE, IDC_VISIBLEICON, 8, 203, 20, 20, SS_CENTERIMAGE
+ LTEXT "You are visible to this person even when in invisible mode", IDC_STATIC, 26, 209, 279, 8, SS_NOPREFIX | SS_CENTERIMAGE
+ ICON IDI_INVISIBLE, IDC_INVISIBLEICON, 8, 218, 20, 20, SS_CENTERIMAGE
+ LTEXT "You are never visible to this person", IDC_STATIC, 26, 224, 279, 8, SS_NOPREFIX | SS_CENTERIMAGE
END
IDD_OPT_AWAYMSG DIALOGEX 0, 0, 263, 151
@@ -734,17 +734,17 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Status Messages",IDC_STATIC,4,5,255,142
- COMBOBOX IDC_STATUS,12,19,240,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Do not reply to requests for this message",IDC_DONTREPLY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,37,227,10
- CONTROL "Do not pop up dialog asking for new message",IDC_NODIALOG,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,50,227,10
- CONTROL "By default, use the same message as last time",IDC_USEPREVIOUS,
- "Button",BS_AUTORADIOBUTTON,23,65,227,10
- CONTROL "By default, use this message:",IDC_USESPECIFIC,"Button",BS_AUTORADIOBUTTON,23,78,227,10
- EDITTEXT IDC_MSG,33,91,219,38,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
- LTEXT "Use %time% for the current time, %date% for the current date",IDC_STATIC,33,131,219,8
+ GROUPBOX "Status Messages", IDC_STATIC, 4, 5, 255, 142
+ COMBOBOX IDC_STATUS, 12, 19, 240, 97, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Do not reply to requests for this message", IDC_DONTREPLY,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 37, 227, 10
+ CONTROL "Do not pop up dialog asking for new message", IDC_NODIALOG,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 24, 50, 227, 10
+ CONTROL "By default, use the same message as last time", IDC_USEPREVIOUS,
+ "Button", BS_AUTORADIOBUTTON, 23, 65, 227, 10
+ CONTROL "By default, use this message:", IDC_USESPECIFIC, "Button", BS_AUTORADIOBUTTON, 23, 78, 227, 10
+ EDITTEXT IDC_MSG, 33, 91, 219, 38, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ LTEXT "Use %time% for the current time, %date% for the current date", IDC_STATIC, 33, 131, 219, 8
END
IDD_ICONINDEX DIALOGEX 0, 0, 219, 197
@@ -753,18 +753,18 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Icon Index"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- RTEXT "Icon library:",IDC_STATIC,4,6,54,8
- EDITTEXT IDC_ICONSET,60,4,139,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_BROWSE,201,5,14,10
- LTEXT "Drag icons to main list to assign them:",IDC_STATIC,4,18,211,8
- CONTROL "List1",IDC_PREVIEW,"SysListView32",LVS_SINGLESEL | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,4,27,211,82
- GROUPBOX "Import multiple",IDC_IMPORTMULTI,4,122,211,61
- CONTROL "To main icons",IDC_TOMAIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,132,74,12
- CONTROL "To",IDC_TOPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,165,25,12
- COMBOBOX IDC_PROTOLIST,34,164,79,58,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "<< &Import",IDC_IMPORT,164,164,48,14,WS_DISABLED
- CONTROL "Download more icons",IDC_GETMORE,"Hyperlink",WS_TABSTOP | 0x1,4,185,211,8
- CONTROL "To default status icons",IDC_TODEFICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,148,123,12
+ RTEXT "Icon library:", IDC_STATIC, 4, 6, 54, 8
+ EDITTEXT IDC_ICONSET, 60, 4, 139, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDC_BROWSE, 201, 5, 14, 10
+ LTEXT "Drag icons to main list to assign them:", IDC_STATIC, 4, 18, 211, 8
+ CONTROL "List1", IDC_PREVIEW, "SysListView32", LVS_SINGLESEL | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP, 4, 27, 211, 82
+ GROUPBOX "Import multiple", IDC_IMPORTMULTI, 4, 122, 211, 61
+ CONTROL "To main icons", IDC_TOMAIN, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 132, 74, 12
+ CONTROL "To", IDC_TOPROTO, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 165, 25, 12
+ COMBOBOX IDC_PROTOLIST, 34, 164, 79, 58, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "<< &Import", IDC_IMPORT, 164, 164, 48, 14, WS_DISABLED
+ CONTROL "Download more icons", IDC_GETMORE, "Hyperlink", WS_TABSTOP | 0x1, 4, 185, 211, 8
+ CONTROL "To default status icons", IDC_TODEFICON, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 148, 123, 12
END
IDD_OPT_NETLIB DIALOGEX 0, 0, 313, 235
@@ -772,34 +772,34 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- COMBOBOX IDC_NETLIBUSERS,0,1,231,110,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Logging...",IDC_LOGOPTIONS,241,1,60,13
- GROUPBOX "Outgoing Connections",IDC_STATIC12,0,18,313,148
- CONTROL "Use proxy server",IDC_USEPROXY,"Button",BS_3STATE | WS_TABSTOP,7,29,159,9
- LTEXT "Type:",IDC_STATIC21,19,43,57,8,WS_DISABLED
- COMBOBOX IDC_PROXYTYPE,80,40,86,62,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
- LTEXT "Host:",IDC_STATIC22,19,58,57,8,WS_DISABLED
- EDITTEXT IDC_PROXYHOST,80,56,86,12,ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Port:",IDC_STATIC23,177,58,35,8,WS_DISABLED
- EDITTEXT IDC_PROXYPORT,213,56,35,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
- LTEXT "(often %d)",IDC_STOFTENPORT,258,57,48,8,WS_DISABLED
- CONTROL "Use Custom Login (Domain login picked up automatically)",IDC_PROXYAUTH,
- "Button",BS_3STATE | WS_DISABLED | WS_TABSTOP,20,80,286,10
- LTEXT "Username:",IDC_STATIC31,32,94,47,8,WS_DISABLED
- EDITTEXT IDC_PROXYUSER,80,92,86,12,ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Password:",IDC_STATIC32,177,94,49,8,WS_DISABLED
- EDITTEXT IDC_PROXYPASS,232,92,74,12,ES_PASSWORD | ES_AUTOHSCROLL | WS_DISABLED
- CONTROL "Resolve hostnames through proxy",IDC_PROXYDNS,"Button",BS_3STATE | WS_DISABLED | WS_TABSTOP,20,115,202,10
- CONTROL "Port Range:",IDC_SPECIFYPORTSO,"Button",BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,7,130,72,9
- EDITTEXT IDC_PORTSRANGEO,80,129,142,12,ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Example: 1050-1070, 2000-2010, 2500",IDC_STATIC54,80,144,196,8,WS_DISABLED
- CONTROL "Validate SSL certificates",IDC_VALIDATESSL,"Button",BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,7,154,299,9
- GROUPBOX "Incoming Connections",IDC_STATIC43,0,167,313,52
- CONTROL "Port Range:",IDC_SPECIFYPORTS,"Button",BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,7,179,72,9
- EDITTEXT IDC_PORTSRANGE,80,178,142,12,ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Example: 1050-1070, 2000-2010, 2500",IDC_STATIC52,80,193,196,8,WS_DISABLED
- CONTROL "Enable UPnP port mapping",IDC_ENABLEUPNP,"Button",BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,7,204,299,9
- CTEXT "You will need to reconnect for the changes you have made on this page to take effect.",IDC_RECONNECTREQD,4,224,307,8,NOT WS_VISIBLE
+ COMBOBOX IDC_NETLIBUSERS, 0, 1, 231, 110, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Logging...", IDC_LOGOPTIONS, 241, 1, 60, 13
+ GROUPBOX "Outgoing Connections", IDC_STATIC12, 0, 18, 313, 148
+ CONTROL "Use proxy server", IDC_USEPROXY, "Button", BS_3STATE | WS_TABSTOP, 7, 29, 159, 9
+ LTEXT "Type:", IDC_STATIC21, 19, 43, 57, 8, WS_DISABLED
+ COMBOBOX IDC_PROXYTYPE, 80, 40, 86, 62, CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Host:", IDC_STATIC22, 19, 58, 57, 8, WS_DISABLED
+ EDITTEXT IDC_PROXYHOST, 80, 56, 86, 12, ES_AUTOHSCROLL | WS_DISABLED
+ LTEXT "Port:", IDC_STATIC23, 177, 58, 35, 8, WS_DISABLED
+ EDITTEXT IDC_PROXYPORT, 213, 56, 35, 12, ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
+ LTEXT "(often %d)", IDC_STOFTENPORT, 258, 57, 48, 8, WS_DISABLED
+ CONTROL "Use Custom Login (Domain login picked up automatically)", IDC_PROXYAUTH,
+ "Button", BS_3STATE | WS_DISABLED | WS_TABSTOP, 20, 80, 286, 10
+ LTEXT "Username:", IDC_STATIC31, 32, 94, 47, 8, WS_DISABLED
+ EDITTEXT IDC_PROXYUSER, 80, 92, 86, 12, ES_AUTOHSCROLL | WS_DISABLED
+ LTEXT "Password:", IDC_STATIC32, 177, 94, 49, 8, WS_DISABLED
+ EDITTEXT IDC_PROXYPASS, 232, 92, 74, 12, ES_PASSWORD | ES_AUTOHSCROLL | WS_DISABLED
+ CONTROL "Resolve hostnames through proxy", IDC_PROXYDNS, "Button", BS_3STATE | WS_DISABLED | WS_TABSTOP, 20, 115, 202, 10
+ CONTROL "Port Range:", IDC_SPECIFYPORTSO, "Button", BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP, 7, 130, 72, 9
+ EDITTEXT IDC_PORTSRANGEO, 80, 129, 142, 12, ES_AUTOHSCROLL | WS_DISABLED
+ LTEXT "Example: 1050-1070, 2000-2010, 2500", IDC_STATIC54, 80, 144, 196, 8, WS_DISABLED
+ CONTROL "Validate SSL certificates", IDC_VALIDATESSL, "Button", BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP, 7, 154, 299, 9
+ GROUPBOX "Incoming Connections", IDC_STATIC43, 0, 167, 313, 52
+ CONTROL "Port Range:", IDC_SPECIFYPORTS, "Button", BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP, 7, 179, 72, 9
+ EDITTEXT IDC_PORTSRANGE, 80, 178, 142, 12, ES_AUTOHSCROLL | WS_DISABLED
+ LTEXT "Example: 1050-1070, 2000-2010, 2500", IDC_STATIC52, 80, 193, 196, 8, WS_DISABLED
+ CONTROL "Enable UPnP port mapping", IDC_ENABLEUPNP, "Button", BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP, 7, 204, 299, 9
+ CTEXT "You will need to reconnect for the changes you have made on this page to take effect.", IDC_RECONNECTREQD, 4, 224, 307, 8, NOT WS_VISIBLE
END
IDD_OPT_FILETRANSFER DIALOGEX 0, 0, 313, 232
@@ -807,37 +807,37 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Receiving files",IDC_STATIC,0,0,313,90
- LTEXT "Received files folder:",IDC_STATIC,8,15,82,8
- EDITTEXT IDC_FILEDIR,92,13,190,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_FILEDIRBROWSE,287,14,15,11
- LTEXT "Variables Allowed: %userid%, %nick%, %proto%, %miranda_path%, %userprofile%",IDC_STATIC,8,27,294,11,WS_DISABLED
- CONTROL "Auto-accept incoming files from people on my contact list",IDC_AUTOACCEPT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,39,294,10
- CONTROL "Minimize the file transfer window",IDC_AUTOMIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,52,285,10
- CONTROL "Close window when transfer completes",IDC_AUTOCLOSE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,65,294,10
- CONTROL "Clear completed transfers on window closing",IDC_AUTOCLEAR,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,76,294,10
- GROUPBOX "Virus scanner",IDC_VIRUSSCANNERGROUP,0,90,313,93
- LTEXT "Scan files:",IDC_STATIC,8,102,43,9,SS_CENTERIMAGE
- CONTROL "Never, do not use virus scanning",IDC_NOSCANNER,"Button",BS_AUTORADIOBUTTON,52,102,250,10
- CONTROL "When all files have been downloaded",IDC_SCANAFTERDL,
- "Button",BS_AUTORADIOBUTTON,52,114,250,10
- CONTROL "As each file finishes downloading",IDC_SCANDURINGDL,
- "Button",BS_AUTORADIOBUTTON,52,126,250,10
- LTEXT "Command line:",IDC_ST_CMDLINE,7,142,62,8
- COMBOBOX IDC_SCANCMDLINE,70,141,213,71,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "...",IDC_SCANCMDLINEBROWSE,287,142,15,11
- LTEXT "%f will be replaced by the file or folder name to be scanned",IDC_ST_CMDLINEHELP,70,155,232,8
- CONTROL "Warn me before opening a file that has not been scanned",IDC_WARNBEFOREOPENING,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,168,294,10
- GROUPBOX "If incoming files already exist",IDC_STATIC,0,187,313,41
- CONTROL "Ask me",IDC_ASK,"Button",BS_AUTORADIOBUTTON,8,200,73,10
- CONTROL "Resume",IDC_RESUME,"Button",BS_AUTORADIOBUTTON,82,200,125,10
- CONTROL "Overwrite",IDC_OVERWRITE,"Button",BS_AUTORADIOBUTTON,8,212,73,10
- CONTROL "Rename (append "" (1)"", etc.)",IDC_RENAME,"Button",BS_AUTORADIOBUTTON,82,212,125,10
- LTEXT "You will always be asked about files from people not on your contact list",IDC_STATIC,212,198,90,24
+ GROUPBOX "Receiving files", IDC_STATIC, 0, 0, 313, 90
+ LTEXT "Received files folder:", IDC_STATIC, 8, 15, 82, 8
+ EDITTEXT IDC_FILEDIR, 92, 13, 190, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDC_FILEDIRBROWSE, 287, 14, 15, 11
+ LTEXT "Variables Allowed: %userid%, %nick%, %proto%, %miranda_path%, %userprofile%", IDC_STATIC, 8, 27, 294, 11, WS_DISABLED
+ CONTROL "Auto-accept incoming files from people on my contact list", IDC_AUTOACCEPT,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 39, 294, 10
+ CONTROL "Minimize the file transfer window", IDC_AUTOMIN, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 17, 52, 285, 10
+ CONTROL "Close window when transfer completes", IDC_AUTOCLOSE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 65, 294, 10
+ CONTROL "Clear completed transfers on window closing", IDC_AUTOCLEAR,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 76, 294, 10
+ GROUPBOX "Virus scanner", IDC_VIRUSSCANNERGROUP, 0, 90, 313, 93
+ LTEXT "Scan files:", IDC_STATIC, 8, 102, 43, 9, SS_CENTERIMAGE
+ CONTROL "Never, do not use virus scanning", IDC_NOSCANNER, "Button", BS_AUTORADIOBUTTON, 52, 102, 250, 10
+ CONTROL "When all files have been downloaded", IDC_SCANAFTERDL,
+ "Button", BS_AUTORADIOBUTTON, 52, 114, 250, 10
+ CONTROL "As each file finishes downloading", IDC_SCANDURINGDL,
+ "Button", BS_AUTORADIOBUTTON, 52, 126, 250, 10
+ LTEXT "Command line:", IDC_ST_CMDLINE, 7, 142, 62, 8
+ COMBOBOX IDC_SCANCMDLINE, 70, 141, 213, 71, CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "...", IDC_SCANCMDLINEBROWSE, 287, 142, 15, 11
+ LTEXT "%f will be replaced by the file or folder name to be scanned", IDC_ST_CMDLINEHELP, 70, 155, 232, 8
+ CONTROL "Warn me before opening a file that has not been scanned", IDC_WARNBEFOREOPENING,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 168, 294, 10
+ GROUPBOX "If incoming files already exist", IDC_STATIC, 0, 187, 313, 41
+ CONTROL "Ask me", IDC_ASK, "Button", BS_AUTORADIOBUTTON, 8, 200, 73, 10
+ CONTROL "Resume", IDC_RESUME, "Button", BS_AUTORADIOBUTTON, 82, 200, 125, 10
+ CONTROL "Overwrite", IDC_OVERWRITE, "Button", BS_AUTORADIOBUTTON, 8, 212, 73, 10
+ CONTROL "Rename (append "" (1)"", etc.)", IDC_RENAME, "Button", BS_AUTORADIOBUTTON, 82, 212, 125, 10
+ LTEXT "You will always be asked about files from people not on your contact list", IDC_STATIC, 212, 198, 90, 24
END
IDD_OPT_IDLE DIALOGEX 0, 0, 312, 190
@@ -845,29 +845,29 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "Become idle if the following is left unattended:",IDC_IDLESHORT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,18,259,9
- CONTROL "Windows",IDC_IDLEONWINDOWS,"Button",BS_AUTORADIOBUTTON,45,31,104,9
- CONTROL "Miranda",IDC_IDLEONMIRANDA,"Button",BS_AUTORADIOBUTTON,45,43,103,9
- EDITTEXT IDC_IDLE1STTIME,59,59,27,14,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "Spin2",IDC_IDLESPIN,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,71,55,12,23
- CONTROL "Become idle if the screen saver is active",IDC_SCREENSAVER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,83,265,9
- CONTROL "Become idle if the computer is locked (2000/XP+ only)",IDC_LOCKED,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,105,265,9
- CONTROL "Become idle if a terminal session is disconnected",IDC_IDLETERMINAL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,116,265,10
- CONTROL "Do not let protocols report any idle information",IDC_IDLEPRIVATE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,131,251,9
- LTEXT "minute(s)",IDC_STATIC,91,61,76,9
- RTEXT "for",IDC_STATIC,12,59,41,9
- COMBOBOX IDC_AASTATUS,161,146,64,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Change my status mode to:",IDC_AASHORTIDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,147,132,11
- CONTROL "Do not set status back to online when returning from idle",IDC_IDLESTATUSLOCK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,164,254,10
- GROUPBOX "Idle Options",IDC_STATIC,3,3,304,182
- CONTROL "Become idle if application full screen",IDC_FULLSCREEN,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,94,265,9
+ CONTROL "Become idle if the following is left unattended:", IDC_IDLESHORT,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 18, 259, 9
+ CONTROL "Windows", IDC_IDLEONWINDOWS, "Button", BS_AUTORADIOBUTTON, 45, 31, 104, 9
+ CONTROL "Miranda", IDC_IDLEONMIRANDA, "Button", BS_AUTORADIOBUTTON, 45, 43, 103, 9
+ EDITTEXT IDC_IDLE1STTIME, 59, 59, 27, 14, ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "Spin2", IDC_IDLESPIN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK, 71, 55, 12, 23
+ CONTROL "Become idle if the screen saver is active", IDC_SCREENSAVER,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 83, 265, 9
+ CONTROL "Become idle if the computer is locked (2000/XP+ only)", IDC_LOCKED,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 105, 265, 9
+ CONTROL "Become idle if a terminal session is disconnected", IDC_IDLETERMINAL,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 116, 265, 10
+ CONTROL "Do not let protocols report any idle information", IDC_IDLEPRIVATE,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 131, 251, 9
+ LTEXT "minute(s)", IDC_STATIC, 91, 61, 76, 9
+ RTEXT "for", IDC_STATIC, 12, 59, 41, 9
+ COMBOBOX IDC_AASTATUS, 161, 146, 64, 50, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Change my status mode to:", IDC_AASHORTIDLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 147, 132, 11
+ CONTROL "Do not set status back to online when returning from idle", IDC_IDLESTATUSLOCK,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 35, 164, 254, 10
+ GROUPBOX "Idle Options", IDC_STATIC, 3, 3, 304, 182
+ CONTROL "Become idle if application full screen", IDC_FULLSCREEN,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 25, 94, 265, 9
END
IDD_PROFILE_SELECTION DIALOGEX 0, 0, 386, 142
@@ -875,7 +875,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP,3,2,382,137
+ CONTROL "List1", IDC_PROFILELIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP, 3, 2, 382, 137
END
IDD_PROFILE_NEW DIALOGEX 0, 0, 386, 142
@@ -883,15 +883,15 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Please complete the following form to create a new user profile",IDC_STATIC,7,7,231,16
- EDITTEXT IDC_PROFILENAME,67,27,75,12,ES_AUTOHSCROLL
- COMBOBOX IDC_PROFILEDRIVERS,67,72,75,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Profile",IDC_STATIC,20,28,40,9
- LTEXT "e.g. Workplace",IDC_STATIC,161,28,77,11
- LTEXT "You can select a different profile driver from the default, it may offer more features or abilities, if in doubt use the default.",IDC_STATIC,7,49,231,17
- LTEXT "e.g. Miranda Database",IDC_STATIC,154,73,84,11
- LTEXT "Driver",IDC_STATIC,20,74,43,9
- LTEXT "Problem: Unable to find any database drivers, this means you can not create a new profile, you need to get dbx_3x.dll",IDC_NODBDRIVERS,7,113,231,22,NOT WS_VISIBLE
+ LTEXT "Please complete the following form to create a new user profile", IDC_STATIC, 7, 7, 231, 16
+ EDITTEXT IDC_PROFILENAME, 67, 27, 75, 12, ES_AUTOHSCROLL
+ COMBOBOX IDC_PROFILEDRIVERS, 67, 72, 75, 56, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Profile", IDC_STATIC, 20, 28, 40, 9
+ LTEXT "e.g. Workplace", IDC_STATIC, 161, 28, 77, 11
+ LTEXT "You can select a different profile driver from the default, it may offer more features or abilities, if in doubt use the default.", IDC_STATIC, 7, 49, 231, 17
+ LTEXT "e.g. Miranda Database", IDC_STATIC, 154, 73, 84, 11
+ LTEXT "Driver", IDC_STATIC, 20, 74, 43, 9
+ LTEXT "Problem: Unable to find any database drivers, this means you can not create a new profile, you need to get dbx_3x.dll", IDC_NODBDRIVERS, 7, 113, 231, 22, NOT WS_VISIBLE
END
IDD_OPT_PLUGINS DIALOGEX 0, 0, 315, 252
@@ -899,22 +899,22 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "List1",IDC_PLUGLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,4,306,110
- CONTROL "Download more plugins",IDC_GETMOREPLUGINS,"Hyperlink",WS_TABSTOP,4,116,306,8
- GROUPBOX "",IDC_PLUGININFOFRAME,4,125,307,125,BS_RIGHT
- EDITTEXT IDC_PLUGINLONGINFO,50,136,253,25,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- EDITTEXT IDC_PLUGINAUTHOR,50,165,253,18,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- CONTROL "",IDC_PLUGINEMAIL,"Hyperlink",WS_TABSTOP,50,188,208,10
- CONTROL "",IDC_PLUGINURL,"Hyperlink",WS_TABSTOP,50,201,254,10
- EDITTEXT IDC_PLUGINPID,50,214,254,12,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- EDITTEXT IDC_PLUGINCPYR,50,227,254,12,ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- RTEXT "Description:",IDC_STATIC,8,136,38,10
- RTEXT "Author(s):",IDC_STATIC,8,165,38,10
- RTEXT "E-mail:",IDC_STATIC,8,188,38,10
- RTEXT "Homepage:",IDC_STATIC,10,200,38,9
- RTEXT "Unique ID:",IDC_STATIC,7,214,38,10
- RTEXT "Copyright:",IDC_STATIC,8,227,38,10
- CTEXT "Please restart Miranda IM for your changes to take effect.",IDC_RESTART,14,240,288,8,NOT WS_VISIBLE
+ CONTROL "List1", IDC_PLUGLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 4, 4, 306, 110
+ CONTROL "Download more plugins", IDC_GETMOREPLUGINS, "Hyperlink", WS_TABSTOP, 4, 116, 306, 8
+ GROUPBOX "", IDC_PLUGININFOFRAME, 4, 125, 307, 125, BS_RIGHT
+ EDITTEXT IDC_PLUGINLONGINFO, 50, 136, 253, 25, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ EDITTEXT IDC_PLUGINAUTHOR, 50, 165, 253, 18, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ CONTROL "", IDC_PLUGINEMAIL, "Hyperlink", WS_TABSTOP, 50, 188, 208, 10
+ CONTROL "", IDC_PLUGINURL, "Hyperlink", WS_TABSTOP, 50, 201, 254, 10
+ EDITTEXT IDC_PLUGINPID, 50, 214, 254, 12, ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ EDITTEXT IDC_PLUGINCPYR, 50, 227, 254, 12, ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ RTEXT "Description:", IDC_STATIC, 8, 136, 38, 10
+ RTEXT "Author(s):", IDC_STATIC, 8, 165, 38, 10
+ RTEXT "E-mail:", IDC_STATIC, 8, 188, 38, 10
+ RTEXT "Homepage:", IDC_STATIC, 10, 200, 38, 9
+ RTEXT "Unique ID:", IDC_STATIC, 7, 214, 38, 10
+ RTEXT "Copyright:", IDC_STATIC, 8, 227, 38, 10
+ CTEXT "Please restart Miranda IM for your changes to take effect.", IDC_RESTART, 14, 240, 288, 8, NOT WS_VISIBLE
END
IDD_OPT_FONTS DIALOGEX 0, 0, 316, 251
@@ -922,20 +922,20 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Fonts and Colors",IDC_STATIC,0,0,315,250
- CONTROL "Tree1",IDC_FONTGROUP,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,4,10,102,235
- LISTBOX IDC_FONTLIST,109,10,201,186,LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
- CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,196,199,30,14
- CONTROL "...",IDC_EFFECT,"MButtonClass",NOT WS_VISIBLE | WS_TABSTOP,196,199,30,14
- CONTROL "",IDC_FONTCOLOUR,"ColourPicker",WS_TABSTOP,196,215,30,14
- CONTROL "...",IDC_CHOOSEFONT,"MButtonClass",WS_TABSTOP,196,231,30,14
- PUSHBUTTON "Undo",IDC_BTN_UNDO,109,199,73,14
- PUSHBUTTON "Reset",IDC_BTN_RESET,109,215,73,14
- PUSHBUTTON "Export...",IDC_BTN_EXPORT,109,231,73,14
- LTEXT "Color/Background",IDC_BKGCOLOUR_STATIC,231,199,79,14,SS_CENTERIMAGE
- LTEXT "Text Effect",IDC_EFFECT_STATIC,231,199,79,14,SS_CENTERIMAGE | NOT WS_VISIBLE
- LTEXT "Text Color",IDC_STATIC,231,215,79,14,SS_CENTERIMAGE
- LTEXT "Choose Font",IDC_STATIC,231,231,79,14,SS_CENTERIMAGE
+ GROUPBOX "Fonts and Colors", IDC_STATIC, 0, 0, 315, 250
+ CONTROL "Tree1", IDC_FONTGROUP, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP, 4, 10, 102, 235
+ LISTBOX IDC_FONTLIST, 109, 10, 201, 186, LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "", IDC_BKGCOLOUR, "ColourPicker", WS_TABSTOP, 196, 199, 30, 14
+ CONTROL "...", IDC_EFFECT, "MButtonClass", NOT WS_VISIBLE | WS_TABSTOP, 196, 199, 30, 14
+ CONTROL "", IDC_FONTCOLOUR, "ColourPicker", WS_TABSTOP, 196, 215, 30, 14
+ CONTROL "...", IDC_CHOOSEFONT, "MButtonClass", WS_TABSTOP, 196, 231, 30, 14
+ PUSHBUTTON "Undo", IDC_BTN_UNDO, 109, 199, 73, 14
+ PUSHBUTTON "Reset", IDC_BTN_RESET, 109, 215, 73, 14
+ PUSHBUTTON "Export...", IDC_BTN_EXPORT, 109, 231, 73, 14
+ LTEXT "Color/Background", IDC_BKGCOLOUR_STATIC, 231, 199, 79, 14, SS_CENTERIMAGE
+ LTEXT "Text Effect", IDC_EFFECT_STATIC, 231, 199, 79, 14, SS_CENTERIMAGE | NOT WS_VISIBLE
+ LTEXT "Text Color", IDC_STATIC, 231, 215, 79, 14, SS_CENTERIMAGE
+ LTEXT "Choose Font", IDC_STATIC, 231, 231, 79, 14, SS_CENTERIMAGE
END
IDD_CUSTOM_FONT DIALOGEX 13, 54, 287, 196
@@ -943,27 +943,27 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CONTEXTHELP | WS CAPTION "Font"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "&Font:",1088,7,7,40,9
- COMBOBOX 1136,7,16,98,76,CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
- LTEXT "Font st&yle:",1089,110,7,44,9
- COMBOBOX 1137,110,16,74,76,CBS_SIMPLE | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- LTEXT "\nStyles and effects are disabled for this font.",1095,110,16,74,76
- LTEXT "&Size:",1090,189,7,30,9
- COMBOBOX 1138,190,16,36,76,CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Effects",1072,7,97,98,72,WS_GROUP
- CONTROL "Stri&keout",1040,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,110,49,10
- CONTROL "&Underline",1041,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,123,51,10
- LTEXT "&Color:",1091,13,136,30,9,NOT WS_VISIBLE
- COMBOBOX 1139,13,146,82,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_HASSTRINGS | NOT WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Sample",1073,110,97,116,43,WS_GROUP
- CTEXT "AaBbYyZz",1092,118,111,100,23,SS_NOPREFIX | NOT WS_VISIBLE
- LTEXT "",1093,7,172,219,20,SS_NOPREFIX | NOT WS_GROUP
- LTEXT "Sc&ript:",1094,110,147,30,9
- COMBOBOX 1140,110,157,116,30,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "OK",IDOK,231,16,45,14,WS_GROUP
- PUSHBUTTON "Cancel",IDCANCEL,231,32,45,14,WS_GROUP
- PUSHBUTTON "&Apply",1026,231,48,45,14,WS_GROUP
- PUSHBUTTON "&Help",1038,231,64,45,14,WS_GROUP
+ LTEXT "&Font:", 1088, 7, 7, 40, 9
+ COMBOBOX 1136, 7, 16, 98, 76, CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Font st&yle:", 1089, 110, 7, 44, 9
+ COMBOBOX 1137, 110, 16, 74, 76, CBS_SIMPLE | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ LTEXT "\nStyles and effects are disabled for this font.", 1095, 110, 16, 74, 76
+ LTEXT "&Size:", 1090, 189, 7, 30, 9
+ COMBOBOX 1138, 190, 16, 36, 76, CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Effects", 1072, 7, 97, 98, 72, WS_GROUP
+ CONTROL "Stri&keout", 1040, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 110, 49, 10
+ CONTROL "&Underline", 1041, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 13, 123, 51, 10
+ LTEXT "&Color:", 1091, 13, 136, 30, 9, NOT WS_VISIBLE
+ COMBOBOX 1139, 13, 146, 82, 100, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_HASSTRINGS | NOT WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Sample", 1073, 110, 97, 116, 43, WS_GROUP
+ CTEXT "AaBbYyZz", 1092, 118, 111, 100, 23, SS_NOPREFIX | NOT WS_VISIBLE
+ LTEXT "", 1093, 7, 172, 219, 20, SS_NOPREFIX | NOT WS_GROUP
+ LTEXT "Sc&ript:", 1094, 110, 147, 30, 9
+ COMBOBOX 1140, 110, 157, 116, 30, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "OK", IDOK, 231, 16, 45, 14, WS_GROUP
+ PUSHBUTTON "Cancel", IDCANCEL, 231, 32, 45, 14, WS_GROUP
+ PUSHBUTTON "&Apply", 1026, 231, 48, 45, 14, WS_GROUP
+ PUSHBUTTON "&Help", 1038, 231, 64, 45, 14, WS_GROUP
END
IDD_OPT_ICOLIB DIALOGEX 0, 0, 316, 251
@@ -971,12 +971,12 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Icons",IDC_STICONSGROUP,0,0,315,250
- CONTROL "List1",IDC_PREVIEW,"SysListView32",LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,109,10,201,207
- PUSHBUTTON "&Load icon set...",IDC_LOADICONS,116,220,94,13
- PUSHBUTTON "&Import icons >>",IDC_IMPORT,215,220,89,13
- CONTROL "Download more icons",IDC_GETMORE,"Hyperlink",WS_TABSTOP | 0x1,109,237,201,8
- CONTROL "Tree1",IDC_CATEGORYLIST,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,4,10,102,235
+ GROUPBOX "Icons", IDC_STICONSGROUP, 0, 0, 315, 250
+ CONTROL "List1", IDC_PREVIEW, "SysListView32", LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP, 109, 10, 201, 207
+ PUSHBUTTON "&Load icon set...", IDC_LOADICONS, 116, 220, 94, 13
+ PUSHBUTTON "&Import icons >>", IDC_IMPORT, 215, 220, 89, 13
+ CONTROL "Download more icons", IDC_GETMORE, "Hyperlink", WS_TABSTOP | 0x1, 109, 237, 201, 8
+ CONTROL "Tree1", IDC_CATEGORYLIST, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP, 4, 10, 102, 235
END
IDD_ICOLIB_IMPORT DIALOGEX 0, 0, 217, 194
@@ -985,11 +985,11 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CONTROLPARENT CAPTION "Icon Index"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- RTEXT "Icon library:",IDC_STATIC,5,6,44,8
- EDITTEXT IDC_ICONSET,53,4,127,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_BROWSE,186,5,14,10
- LTEXT "Drag icons to main list to assign them:",IDC_STATIC,4,18,207,8
- CONTROL "List1",IDC_PREVIEW,"SysListView32",LVS_SINGLESEL | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,4,27,208,163
+ RTEXT "Icon library:", IDC_STATIC, 5, 6, 44, 8
+ EDITTEXT IDC_ICONSET, 53, 4, 127, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDC_BROWSE, 186, 5, 14, 10
+ LTEXT "Drag icons to main list to assign them:", IDC_STATIC, 4, 18, 207, 8
+ CONTROL "List1", IDC_PREVIEW, "SysListView32", LVS_SINGLESEL | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP, 4, 27, 208, 163
END
IDD_OPT_GENMENU DIALOGEX 0, 0, 316, 254
@@ -997,23 +997,23 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Menu Objects",IDC_STATIC,5,2,140,99
- CONTROL "Tree2",IDC_MENUOBJECTS,"SysTreeView32",TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,11,13,128,82
- GROUPBOX "Menu Items",IDC_STATIC,149,2,161,248
- CONTROL "Tree1",IDC_MENUITEMS,"SysTreeView32",TVS_SHOWSELALWAYS | WS_DISABLED | WS_BORDER | WS_HSCROLL | WS_TABSTOP,156,13,148,212
- GROUPBOX "Protocol menus",IDC_STATIC,5,100,140,37
- CONTROL "Move to the main menu",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,11,111,128,8
- CONTROL "Move to the status bar",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,11,123,130,8
- LTEXT "Warning!\r\nThis MenuObject not support user defined options.",IDC_NOTSUPPORTWARNING,10,140,136,32,NOT WS_VISIBLE
- PUSHBUTTON "Insert separator",IDC_INSERTSEPARATOR,39,180,97,14,WS_DISABLED
- LTEXT "Service:",IDC_STATIC,4,201,29,8
- EDITTEXT IDC_GENMENU_SERVICE,36,199,108,14,ES_AUTOHSCROLL | ES_READONLY
- LTEXT "Name:",IDC_STATIC,4,218,29,8
- EDITTEXT IDC_GENMENU_CUSTOMNAME,36,215,108,14,ES_AUTOHSCROLL | WS_DISABLED
- PUSHBUTTON "Default",IDC_GENMENU_DEFAULT,18,234,55,15,WS_DISABLED
- PUSHBUTTON "Set",IDC_GENMENU_SET,78,234,55,15,WS_DISABLED
- CONTROL "Disable icons",IDC_DISABLEMENUICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,234,91,10
- PUSHBUTTON "Reset",IDC_RESETMENU,254,230,50,14
+ GROUPBOX "Menu Objects", IDC_STATIC, 5, 2, 140, 99
+ CONTROL "Tree2", IDC_MENUOBJECTS, "SysTreeView32", TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP, 11, 13, 128, 82
+ GROUPBOX "Menu Items", IDC_STATIC, 149, 2, 161, 248
+ CONTROL "Tree1", IDC_MENUITEMS, "SysTreeView32", TVS_SHOWSELALWAYS | WS_DISABLED | WS_BORDER | WS_HSCROLL | WS_TABSTOP, 156, 13, 148, 212
+ GROUPBOX "Protocol menus", IDC_STATIC, 5, 100, 140, 37
+ CONTROL "Move to the main menu", IDC_RADIO1, "Button", BS_AUTORADIOBUTTON, 11, 111, 128, 8
+ CONTROL "Move to the status bar", IDC_RADIO2, "Button", BS_AUTORADIOBUTTON, 11, 123, 130, 8
+ LTEXT "Warning!\r\nThis MenuObject not support user defined options.", IDC_NOTSUPPORTWARNING, 10, 140, 136, 32, NOT WS_VISIBLE
+ PUSHBUTTON "Insert separator", IDC_INSERTSEPARATOR, 39, 180, 97, 14, WS_DISABLED
+ LTEXT "Service:", IDC_STATIC, 4, 201, 29, 8
+ EDITTEXT IDC_GENMENU_SERVICE, 36, 199, 108, 14, ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Name:", IDC_STATIC, 4, 218, 29, 8
+ EDITTEXT IDC_GENMENU_CUSTOMNAME, 36, 215, 108, 14, ES_AUTOHSCROLL | WS_DISABLED
+ PUSHBUTTON "Default", IDC_GENMENU_DEFAULT, 18, 234, 55, 15, WS_DISABLED
+ PUSHBUTTON "Set", IDC_GENMENU_SET, 78, 234, 55, 15, WS_DISABLED
+ CONTROL "Disable icons", IDC_DISABLEMENUICONS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 156, 234, 91, 10
+ PUSHBUTTON "Reset", IDC_RESETMENU, 254, 230, 50, 14
END
IDD_OPT_PROTOCOLORDER DIALOGEX 0, 0, 300, 211
@@ -1021,11 +1021,11 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CTEXT "Note: Miranda IM will have to be restarted for changes to take effect.",IDC_PROTOCOLORDERWARNING,5,190,289,14,NOT WS_VISIBLE
- GROUPBOX "Account Order && Visibility",IDC_STATIC,75,0,147,185
- CONTROL "Tree1",IDC_PROTOCOLORDER,"SysTreeView32",TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP,85,40,132,95
- LTEXT "Show protocols in the following order, drag to choose another order:",IDC_STATIC,85,15,132,20
- PUSHBUTTON "Reset",IDC_RESETPROTOCOLDATA,120,140,50,14,BS_NOTIFY
+ CTEXT "Note: Miranda IM will have to be restarted for changes to take effect.", IDC_PROTOCOLORDERWARNING, 5, 190, 289, 14, NOT WS_VISIBLE
+ GROUPBOX "Account Order && Visibility", IDC_STATIC, 75, 0, 147, 185
+ CONTROL "Tree1", IDC_PROTOCOLORDER, "SysTreeView32", TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP, 85, 40, 132, 95
+ LTEXT "Show protocols in the following order, drag to choose another order:", IDC_STATIC, 85, 15, 132, 20
+ PUSHBUTTON "Reset", IDC_RESETPROTOCOLDATA, 120, 140, 50, 14, BS_NOTIFY
END
IDD_UPDATE_NOTIFY DIALOGEX 0, 0, 259, 103
@@ -1033,15 +1033,15 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIB CAPTION "Miranda IM v%s Now Available"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "A new version of Miranda IM is now available. Click the download button to download this new update.",IDC_MESSAGE,7,7,245,21
- LTEXT "Latest Version:",IDC_NEWVERSIONLABEL,7,47,65,8
- LTEXT "Your Version:",IDC_STATIC,7,32,65,8
- LTEXT "",IDC_CURRENTVERSION,77,32,97,8
- CONTROL "",IDC_VERSION,"Hyperlink",WS_TABSTOP,77,47,97,8
- LTEXT "",IDC_UPDATE,77,47,97,8
- PUSHBUTTON "&Download Now",IDC_DOWNLOAD,7,61,66,15
- DEFPUSHBUTTON "&Close",IDOK,202,84,50,15
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,80,245,1
+ LTEXT "A new version of Miranda IM is now available. Click the download button to download this new update.", IDC_MESSAGE, 7, 7, 245, 21
+ LTEXT "Latest Version:", IDC_NEWVERSIONLABEL, 7, 47, 65, 8
+ LTEXT "Your Version:", IDC_STATIC, 7, 32, 65, 8
+ LTEXT "", IDC_CURRENTVERSION, 77, 32, 97, 8
+ CONTROL "", IDC_VERSION, "Hyperlink", WS_TABSTOP, 77, 47, 97, 8
+ LTEXT "", IDC_UPDATE, 77, 47, 97, 8
+ PUSHBUTTON "&Download Now", IDC_DOWNLOAD, 7, 61, 66, 15
+ DEFPUSHBUTTON "&Close", IDOK, 202, 84, 50, 15
+ CONTROL "", IDC_STATIC, "Static", SS_ETCHEDHORZ, 7, 80, 245, 1
END
IDD_OPT_UPDATENOTIFY DIALOGEX 0, 0, 268, 94
@@ -1049,13 +1049,13 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Update Notification Options",IDC_STATIC,2,0,265,94
- CONTROL "Automatically check for new versions of Miranda IM",IDC_ENABLEUPDATES,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,13,237,10
- LTEXT "Check for updates for the following:",IDC_STATIC,12,32,230,8
- CONTROL "Stable releases",IDC_ENABLESTABLE,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,25,46,230,10
- CONTROL "Preview releases (beta)",IDC_ENABLEBETA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,25,61,230,10
- CONTROL "Development releases (alpha)",IDC_ENABLEALPHA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,25,76,230,10
+ GROUPBOX "Update Notification Options", IDC_STATIC, 2, 0, 265, 94
+ CONTROL "Automatically check for new versions of Miranda IM", IDC_ENABLEUPDATES,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 11, 13, 237, 10
+ LTEXT "Check for updates for the following:", IDC_STATIC, 12, 32, 230, 8
+ CONTROL "Stable releases", IDC_ENABLESTABLE, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 25, 46, 230, 10
+ CONTROL "Preview releases (beta)", IDC_ENABLEBETA, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 25, 61, 230, 10
+ CONTROL "Development releases (alpha)", IDC_ENABLEALPHA, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 25, 76, 230, 10
END
IDD_OPT_KEYBINDINGS DIALOGEX 0, 0, 316, 251
@@ -1063,16 +1063,16 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Key Bindings",IDC_STATIC,0,0,315,250
- CONTROL "Tree1",IDC_CATEGORYLIST,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,4,10,102,235
- LTEXT "Shortcut:",IDC_STATIC,109,10,146,12
- EDITTEXT IDC_PREVIEW,109,21,146,12
- CONTROL "Add",IDC_ADD,"MButtonClass",WS_TABSTOP,260,19,50,14
- LTEXT "",IDC_MESSAGE,109,37,201,41
- LISTBOX IDC_LIST,109,80,146,52,WS_VSCROLL | WS_TABSTOP
- CONTROL "Remove",IDC_DELETE,"MButtonClass",WS_TABSTOP,260,80,50,14
- PUSHBUTTON "Undo Changes",IDC_BTN_UNDO,109,140,96,14
- PUSHBUTTON "Reset To Default",IDC_BTN_RESET,214,140,96,14
+ GROUPBOX "Key Bindings", IDC_STATIC, 0, 0, 315, 250
+ CONTROL "Tree1", IDC_CATEGORYLIST, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP, 4, 10, 102, 235
+ LTEXT "Shortcut:", IDC_STATIC, 109, 10, 146, 12
+ EDITTEXT IDC_PREVIEW, 109, 21, 146, 12
+ CONTROL "Add", IDC_ADD, "MButtonClass", WS_TABSTOP, 260, 19, 50, 14
+ LTEXT "", IDC_MESSAGE, 109, 37, 201, 41
+ LISTBOX IDC_LIST, 109, 80, 146, 52, WS_VSCROLL | WS_TABSTOP
+ CONTROL "Remove", IDC_DELETE, "MButtonClass", WS_TABSTOP, 260, 80, 50, 14
+ PUSHBUTTON "Undo Changes", IDC_BTN_UNDO, 109, 140, 96, 14
+ PUSHBUTTON "Reset To Default", IDC_BTN_RESET, 214, 140, 96, 14
END
IDD_OPT_HOTKEYS DIALOGEX 0, 0, 316, 251
@@ -1080,11 +1080,11 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Hotkeys",IDC_STICONSGROUP,0,0,315,250
- CONTROL "List1",IDC_LV_HOTKEYS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,10,306,202
- EDITTEXT IDC_HOTKEY,192,205,118,14,ES_CENTER | ES_AUTOHSCROLL | NOT WS_VISIBLE
- CONTROL "",IDC_CANVAS,"Static",SS_OWNERDRAW,4,217,306,14,WS_EX_TRANSPARENT
- CONTROL "",IDC_CANVAS2,"Static",SS_OWNERDRAW,4,231,306,14,WS_EX_TRANSPARENT
+ GROUPBOX "Hotkeys", IDC_STICONSGROUP, 0, 0, 315, 250
+ CONTROL "List1", IDC_LV_HOTKEYS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 4, 10, 306, 202
+ EDITTEXT IDC_HOTKEY, 192, 205, 118, 14, ES_CENTER | ES_AUTOHSCROLL | NOT WS_VISIBLE
+ CONTROL "", IDC_CANVAS, "Static", SS_OWNERDRAW, 4, 217, 306, 14, WS_EX_TRANSPARENT
+ CONTROL "", IDC_CANVAS2, "Static", SS_OWNERDRAW, 4, 231, 306, 14, WS_EX_TRANSPARENT
END
IDD_ACCMGR DIALOGEX 0, 0, 350, 245
@@ -1092,21 +1092,21 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTI CAPTION "Accounts"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- CONTROL "Accounts\nConfigure your IM accounts",IDC_HEADERBAR,
- "MHeaderbarCtrl",0x0,0,0,350,25
- LISTBOX IDC_ACCLIST,7,32,130,187,LBS_SORT | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- LTEXT "Account information:",IDC_TXT_ACCOUNT,142,32,201,8
- LTEXT "Welcome to Miranda IM's account manager!\nHere you can set up your IM accounts.\n\nSelect an account from the list on the left to see the available options. Alternatively, just click on the Plus sign underneath the list to set up a new IM account.",IDC_TXT_INFO,157,45,186,134
- LTEXT "Additional:",IDC_TXT_ADDITIONAL,142,184,201,8
- CONTROL "Configure network...",IDC_LNK_NETWORK,"Hyperlink",WS_TABSTOP,157,197,186,11
- CONTROL "Get more protocols...",IDC_LNK_ADDONS,"Hyperlink",WS_TABSTOP,157,208,186,11
- CONTROL "&Add...",IDC_ADD,"MButtonClass",WS_TABSTOP,7,224,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Edit",IDC_EDIT,"MButtonClass",WS_TABSTOP,26,224,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Options",IDC_OPTIONS,"MButtonClass",WS_TABSTOP,45,224,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Upgrade",IDC_UPGRADE,"MButtonClass",WS_TABSTOP,64,224,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Remove...",IDC_REMOVE,"MButtonClass",WS_TABSTOP,83,224,16,14,WS_EX_NOACTIVATE | 0x10000000L
- DEFPUSHBUTTON "OK",IDOK,239,224,50,14
- PUSHBUTTON "Cancel",IDCANCEL,293,224,50,14
+ CONTROL "Accounts\nConfigure your IM accounts", IDC_HEADERBAR,
+ "MHeaderbarCtrl", 0x0, 0, 0, 350, 25
+ LISTBOX IDC_ACCLIST, 7, 32, 130, 187, LBS_SORT | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Account information:", IDC_TXT_ACCOUNT, 142, 32, 201, 8
+ LTEXT "Welcome to Miranda IM's account manager!\nHere you can set up your IM accounts.\n\nSelect an account from the list on the left to see the available options. Alternatively, just click on the Plus sign underneath the list to set up a new IM account.", IDC_TXT_INFO, 157, 45, 186, 134
+ LTEXT "Additional:", IDC_TXT_ADDITIONAL, 142, 184, 201, 8
+ CONTROL "Configure network...", IDC_LNK_NETWORK, "Hyperlink", WS_TABSTOP, 157, 197, 186, 11
+ CONTROL "Get more protocols...", IDC_LNK_ADDONS, "Hyperlink", WS_TABSTOP, 157, 208, 186, 11
+ CONTROL "&Add...", IDC_ADD, "MButtonClass", WS_TABSTOP, 7, 224, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Edit", IDC_EDIT, "MButtonClass", WS_TABSTOP, 26, 224, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Options", IDC_OPTIONS, "MButtonClass", WS_TABSTOP, 45, 224, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Upgrade", IDC_UPGRADE, "MButtonClass", WS_TABSTOP, 64, 224, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Remove...", IDC_REMOVE, "MButtonClass", WS_TABSTOP, 83, 224, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ DEFPUSHBUTTON "OK", IDOK, 239, 224, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 293, 224, 50, 14
END
IDD_WAITRESTART DIALOGEX 0, 0, 167, 70
@@ -1115,9 +1115,9 @@ EXSTYLE WS_EX_TOOLWINDOW CAPTION "Miranda IM"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "Miranda IM is being restarted.\nPlease wait...",IDC_STATIC,7,7,153,18
- CONTROL "",IDC_PROGRESSBAR,"msctls_progress32",WS_BORDER,7,30,153,14
- PUSHBUTTON "Close",IDCANCEL,110,49,50,14
+ LTEXT "Miranda IM is being restarted.\nPlease wait...", IDC_STATIC, 7, 7, 153, 18
+ CONTROL "", IDC_PROGRESSBAR, "msctls_progress32", WS_BORDER, 7, 30, 153, 14
+ PUSHBUTTON "Close", IDCANCEL, 110, 49, 50, 14
END
IDD_FTMGR DIALOGEX 0, 0, 276, 255
@@ -1125,9 +1125,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPT CAPTION "File Transfers"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,7,262,224
- PUSHBUTTON "Clear completed",IDC_CLEAR,7,234,100,14
- PUSHBUTTON "Close",IDCANCEL,219,234,50,14
+ CONTROL "", IDC_TABS, "SysTabControl32", 0x0, 7, 7, 262, 224
+ PUSHBUTTON "Clear completed", IDC_CLEAR, 7, 234, 100, 14
+ PUSHBUTTON "Close", IDCANCEL, 219, 234, 50, 14
END
IDD_FTPAGE DIALOGEX 0, 0, 320, 183
@@ -1142,9 +1142,9 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- CONTROL "Enable keyword search in options dialog",IDC_ENABLE_KEYWORDFILTERING,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,4,243,10
- LTEXT "If this option is checked it allows you to search for option pages that contain the search string or plugin name.",IDC_STATIC,4,20,243,49,NOT WS_GROUP
+ CONTROL "Enable keyword search in options dialog", IDC_ENABLE_KEYWORDFILTERING,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 4, 4, 243, 10
+ LTEXT "If this option is checked it allows you to search for option pages that contain the search string or plugin name.", IDC_STATIC, 4, 20, 243, 49, NOT WS_GROUP
END
IDD_ERROR_LIST DIALOGEX 0, 0, 312, 209
@@ -1153,7 +1153,7 @@ EXSTYLE WS_EX_CONTROLPARENT CAPTION "Error Console"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LISTBOX IDC_LST_ERRORS,5,5,301,198,LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ LISTBOX IDC_LST_ERRORS, 5, 5, 301, 198, LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
END
IDD_OPT_ERRORS DIALOGEX 0, 0, 316, 251
@@ -1161,8 +1161,8 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Error notifications",IDC_STATIC,0,0,315,250
- CONTROL "",IDC_LV_ERRORS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,10,306,235
+ GROUPBOX "Error notifications", IDC_STATIC, 0, 0, 315, 250
+ CONTROL "", IDC_LV_ERRORS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 4, 10, 306, 235
END
IDD_MODERNOPT_FONTS DIALOGEX 0, 0, 260, 210
@@ -1170,18 +1170,18 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LTEXT "Headers:",IDC_TXT_TITLE1,0,0,259,8
- PUSHBUTTON "...",IDC_CHOOSEFONTHEADER,244,30,16,14
- LTEXT "This font is used to display main section titles or text elements.",IDC_STATIC,10,11,249,16,SS_CENTERIMAGE
- LTEXT "Normal text:",IDC_TXT_TITLE2,0,55,259,8
- PUSHBUTTON "...",IDC_CHOOSEFONTGENERAL,244,84,16,14
- LTEXT "This font is used to display most text element or section bodies.",IDC_STATIC,10,66,249,16,SS_CENTERIMAGE
- LTEXT "Minor notes:",IDC_TXT_TITLE3,0,109,259,8
- PUSHBUTTON "...",IDC_CHOOSEFONTSMALL,244,139,16,14
- LTEXT "This font is used to display various addtional notes.",IDC_STATIC,10,120,249,16,SS_CENTERIMAGE
- CONTROL "",IDC_PREVIEWSMALL,"Static",SS_OWNERDRAW,10,139,229,15,WS_EX_STATICEDGE
- CONTROL "",IDC_PREVIEWGENERAL,"Static",SS_OWNERDRAW,10,84,229,15,WS_EX_STATICEDGE
- CONTROL "",IDC_PREVIEWHEADER,"Static",SS_OWNERDRAW,10,30,229,15,WS_EX_STATICEDGE
+ LTEXT "Headers:", IDC_TXT_TITLE1, 0, 0, 259, 8
+ PUSHBUTTON "...", IDC_CHOOSEFONTHEADER, 244, 30, 16, 14
+ LTEXT "This font is used to display main section titles or text elements.", IDC_STATIC, 10, 11, 249, 16, SS_CENTERIMAGE
+ LTEXT "Normal text:", IDC_TXT_TITLE2, 0, 55, 259, 8
+ PUSHBUTTON "...", IDC_CHOOSEFONTGENERAL, 244, 84, 16, 14
+ LTEXT "This font is used to display most text element or section bodies.", IDC_STATIC, 10, 66, 249, 16, SS_CENTERIMAGE
+ LTEXT "Minor notes:", IDC_TXT_TITLE3, 0, 109, 259, 8
+ PUSHBUTTON "...", IDC_CHOOSEFONTSMALL, 244, 139, 16, 14
+ LTEXT "This font is used to display various addtional notes.", IDC_STATIC, 10, 120, 249, 16, SS_CENTERIMAGE
+ CONTROL "", IDC_PREVIEWSMALL, "Static", SS_OWNERDRAW, 10, 139, 229, 15, WS_EX_STATICEDGE
+ CONTROL "", IDC_PREVIEWGENERAL, "Static", SS_OWNERDRAW, 10, 84, 229, 15, WS_EX_STATICEDGE
+ CONTROL "", IDC_PREVIEWHEADER, "Static", SS_OWNERDRAW, 10, 30, 229, 15, WS_EX_STATICEDGE
END
IDD_MODERNOPT_ACCOUNTS DIALOGEX 0, 0, 368, 210
@@ -1189,17 +1189,17 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LISTBOX IDC_ACCLIST,0,0,162,192,LBS_SORT | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
- LTEXT "Account information:",IDC_TXT_ACCOUNT,167,0,201,8
- LTEXT "Welcome to Miranda IM's account manager!\nHere you can set up your IM accounts.\n\nSelect an account from the list on the left to see the available options. Alternatively, just click on the ""New"" button underneath the list to set up a new IM account.",IDC_TXT_INFO,182,13,186,134
- CONTROL "&Add...",IDC_ADD,"MButtonClass",WS_TABSTOP,0,196,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Edit",IDC_EDIT,"MButtonClass",WS_TABSTOP,22,196,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Options",IDC_OPTIONS,"MButtonClass",WS_TABSTOP,38,196,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Upgrade",IDC_UPGRADE,"MButtonClass",WS_TABSTOP,54,196,16,14,WS_EX_NOACTIVATE | 0x10000000L
- CONTROL "&Remove...",IDC_REMOVE,"MButtonClass",WS_TABSTOP,76,196,16,14,WS_EX_NOACTIVATE | 0x10000000L
- LTEXT "Additional:",IDC_TXT_ADDITIONAL,167,157,201,8
- CONTROL "Configure network...",IDC_LNK_NETWORK,"Hyperlink",WS_TABSTOP,183,170,186,11
- CONTROL "Get more protocols...",IDC_LNK_ADDONS,"Hyperlink",WS_TABSTOP,183,181,186,11
+ LISTBOX IDC_ACCLIST, 0, 0, 162, 192, LBS_SORT | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Account information:", IDC_TXT_ACCOUNT, 167, 0, 201, 8
+ LTEXT "Welcome to Miranda IM's account manager!\nHere you can set up your IM accounts.\n\nSelect an account from the list on the left to see the available options. Alternatively, just click on the ""New"" button underneath the list to set up a new IM account.", IDC_TXT_INFO, 182, 13, 186, 134
+ CONTROL "&Add...", IDC_ADD, "MButtonClass", WS_TABSTOP, 0, 196, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Edit", IDC_EDIT, "MButtonClass", WS_TABSTOP, 22, 196, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Options", IDC_OPTIONS, "MButtonClass", WS_TABSTOP, 38, 196, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Upgrade", IDC_UPGRADE, "MButtonClass", WS_TABSTOP, 54, 196, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "&Remove...", IDC_REMOVE, "MButtonClass", WS_TABSTOP, 76, 196, 16, 14, WS_EX_NOACTIVATE | 0x10000000L
+ LTEXT "Additional:", IDC_TXT_ADDITIONAL, 167, 157, 201, 8
+ CONTROL "Configure network...", IDC_LNK_NETWORK, "Hyperlink", WS_TABSTOP, 183, 170, 186, 11
+ CONTROL "Get more protocols...", IDC_LNK_ADDONS, "Hyperlink", WS_TABSTOP, 183, 181, 186, 11
END
IDD_MODERNOPT_MODULES DIALOGEX 0, 0, 369, 210
@@ -1207,17 +1207,17 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- EDITTEXT IDC_PLUGINLONGINFO,65,133,304,25,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- EDITTEXT IDC_PLUGINAUTHOR,65,160,304,12,ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- CONTROL "",IDC_PLUGINEMAIL,"Hyperlink",WS_TABSTOP,65,172,304,10
- CONTROL "",IDC_PLUGINURL,"Hyperlink",WS_TABSTOP,65,184,304,10
- EDITTEXT IDC_PLUGINCPYR,65,197,304,12,ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
- RTEXT "Description:",IDC_TXT_TITLE1,-1,133,60,10
- RTEXT "Author(s):",IDC_TXT_TITLE2,0,160,60,10
- RTEXT "E-mail:",IDC_TXT_TITLE3,0,172,60,10
- RTEXT "Homepage:",IDC_TXT_TITLE4,0,184,60,9
- RTEXT "Copyright:",IDC_TXT_TITLE6,0,197,60,10
- CONTROL "",IDC_PLUGLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,0,0,369,128
+ EDITTEXT IDC_PLUGINLONGINFO, 65, 133, 304, 25, ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ EDITTEXT IDC_PLUGINAUTHOR, 65, 160, 304, 12, ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ CONTROL "", IDC_PLUGINEMAIL, "Hyperlink", WS_TABSTOP, 65, 172, 304, 10
+ CONTROL "", IDC_PLUGINURL, "Hyperlink", WS_TABSTOP, 65, 184, 304, 10
+ EDITTEXT IDC_PLUGINCPYR, 65, 197, 304, 12, ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER
+ RTEXT "Description:", IDC_TXT_TITLE1, -1, 133, 60, 10
+ RTEXT "Author(s):", IDC_TXT_TITLE2, 0, 160, 60, 10
+ RTEXT "E-mail:", IDC_TXT_TITLE3, 0, 172, 60, 10
+ RTEXT "Homepage:", IDC_TXT_TITLE4, 0, 184, 60, 9
+ RTEXT "Copyright:", IDC_TXT_TITLE6, 0, 197, 60, 10
+ CONTROL "", IDC_PLUGLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 0, 0, 369, 128
END
IDD_MODERNOPT_STATUS DIALOGEX 0, 0, 369, 113
@@ -1225,18 +1225,18 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- COMBOBOX IDC_STATUS,2,54,16,97,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
- CONTROL "Do not reply to requests for this message",IDC_DONTREPLY,
- "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,0,33,10,10
- CONTROL "Do not pop up dialog asking for new message",IDC_NODIALOG,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,105,93,264,10
- CONTROL "By default, use the same message as last time",IDC_USEPREVIOUS,
- "Button",BS_AUTORADIOBUTTON,105,13,227,10
- CONTROL "By default, use this message:",IDC_USESPECIFIC,"Button",BS_AUTORADIOBUTTON,105,26,227,10
- EDITTEXT IDC_MSG,125,39,244,38,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
- CTEXT "Use %time% for the current time, %date% for the current date",IDC_STATIC,125,78,244,8,SS_CENTERIMAGE
- LTEXT "Status messages:",IDC_TXT_TITLE1,0,0,246,8
- LISTBOX IDC_LST_STATUS,10,13,90,95,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_STATUS, 2, 54, 16, 97, CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Do not reply to requests for this message", IDC_DONTREPLY,
+ "Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, 0, 33, 10, 10
+ CONTROL "Do not pop up dialog asking for new message", IDC_NODIALOG,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 105, 93, 264, 10
+ CONTROL "By default, use the same message as last time", IDC_USEPREVIOUS,
+ "Button", BS_AUTORADIOBUTTON, 105, 13, 227, 10
+ CONTROL "By default, use this message:", IDC_USESPECIFIC, "Button", BS_AUTORADIOBUTTON, 105, 26, 227, 10
+ EDITTEXT IDC_MSG, 125, 39, 244, 38, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ CTEXT "Use %time% for the current time, %date% for the current date", IDC_STATIC, 125, 78, 244, 8, SS_CENTERIMAGE
+ LTEXT "Status messages:", IDC_TXT_TITLE1, 0, 0, 246, 8
+ LISTBOX IDC_LST_STATUS, 10, 13, 90, 95, LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
END
IDD_MODERNOPT_IDLE DIALOGEX 0, 0, 369, 64
@@ -1244,26 +1244,26 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- CONTROL "Become idle if computer is left unattended for:",IDC_IDLESHORT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,171,9
- CONTROL "Windows",IDC_IDLEONWINDOWS,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,325,25,26,9
- CONTROL "Miranda",IDC_IDLEONMIRANDA,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,287,37,15,9
- EDITTEXT IDC_IDLE1STTIME,181,11,27,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_IDLESPIN,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,193,7,11,23
- CONTROL "Become idle if the screen saver is active",IDC_SCREENSAVER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,268,9
- CONTROL "Become idle if the computer is locked (2000/XP+ only)",IDC_LOCKED,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,249,9
- CONTROL "Become idle if a terminal session is disconnected",IDC_IDLETERMINAL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,49,265,10
- CONTROL "Do not let protocols report any idle information",IDC_IDLEPRIVATE,
- "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,303,13,22,9
- LTEXT "minute(s)",IDC_STATIC,213,13,76,9,SS_CENTERIMAGE
- COMBOBOX IDC_AASTATUS,325,46,23,50,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
- CONTROL "Change my status mode to:",IDC_AASHORTIDLE,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,334,11,23,11
- CONTROL "Do not set status back to online when returning from idle",IDC_IDLESTATUSLOCK,
- "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,299,24,16,10
- LTEXT "Idle (auto-away):",IDC_TXT_TITLE1,0,0,246,8
+ CONTROL "Become idle if computer is left unattended for:", IDC_IDLESHORT,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 13, 171, 9
+ CONTROL "Windows", IDC_IDLEONWINDOWS, "Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE, 325, 25, 26, 9
+ CONTROL "Miranda", IDC_IDLEONMIRANDA, "Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE, 287, 37, 15, 9
+ EDITTEXT IDC_IDLE1STTIME, 181, 11, 27, 12, ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "", IDC_IDLESPIN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK, 193, 7, 11, 23
+ CONTROL "Become idle if the screen saver is active", IDC_SCREENSAVER,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 25, 268, 9
+ CONTROL "Become idle if the computer is locked (2000/XP+ only)", IDC_LOCKED,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 37, 249, 9
+ CONTROL "Become idle if a terminal session is disconnected", IDC_IDLETERMINAL,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 49, 265, 10
+ CONTROL "Do not let protocols report any idle information", IDC_IDLEPRIVATE,
+ "Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, 303, 13, 22, 9
+ LTEXT "minute(s)", IDC_STATIC, 213, 13, 76, 9, SS_CENTERIMAGE
+ COMBOBOX IDC_AASTATUS, 325, 46, 23, 50, CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Change my status mode to:", IDC_AASHORTIDLE, "Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, 334, 11, 23, 11
+ CONTROL "Do not set status back to online when returning from idle", IDC_IDLESTATUSLOCK,
+ "Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, 299, 24, 16, 10
+ LTEXT "Idle (auto-away):", IDC_TXT_TITLE1, 0, 0, 246, 8
END
IDD_MODERNOPT_IGNORE DIALOGEX 0, 0, 369, 210
@@ -1271,10 +1271,10 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x3da,10,13,358,135,WS_EX_CLIENTEDGE
- LTEXT "Event icon legend:",IDC_TXT_TITLE2,0,153,119,8
- LTEXT "Choose events you wish to ingonre:",IDC_TXT_TITLE1,0,0,246,8
- CONTROL "",IDC_LV_LEGEND,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,10,166,358,43
+ CONTROL "", IDC_LIST, "CListControl", WS_TABSTOP | 0x3da, 10, 13, 358, 135, WS_EX_CLIENTEDGE
+ LTEXT "Event icon legend:", IDC_TXT_TITLE2, 0, 153, 119, 8
+ LTEXT "Choose events you wish to ingonre:", IDC_TXT_TITLE1, 0, 0, 246, 8
+ CONTROL "", IDC_LV_LEGEND, "SysListView32", LVS_LIST | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP, 10, 166, 358, 43
END
IDD_CHOOSE_FONT_EFFECT DIALOGEX 13, 54, 226, 103
@@ -1282,20 +1282,20 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CONTEXTHELP | WS CAPTION "Font Effect"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Effect:",IDC_STATIC,12,12,66,12,SS_CENTERIMAGE
- COMBOBOX IDC_EFFECT_COMBO,84,12,126,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
- LTEXT "Base colour:",IDC_STATIC,12,30,66,12,SS_CENTERIMAGE
- CONTROL "",IDC_EFFECT_COLOUR1,"ColourPicker",WS_TABSTOP,84,30,30,12
- LTEXT "opacity:",IDC_STATIC,126,30,42,12,SS_CENTERIMAGE
- EDITTEXT IDC_EFFECT_COLOUR_TEXT1,168,30,42,12,ES_NUMBER
- CONTROL "",IDC_EFFECT_COLOUR_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,200,30,11,12
- LTEXT "Secondary colour:",IDC_STATIC,12,48,66,12,SS_CENTERIMAGE
- CONTROL "",IDC_EFFECT_COLOUR2,"ColourPicker",WS_TABSTOP,84,48,30,12
- LTEXT "opacity:",IDC_STATIC,126,48,42,12,SS_CENTERIMAGE
- EDITTEXT IDC_EFFECT_COLOUR_TEXT2,168,48,42,12,ES_NUMBER
- CONTROL "",IDC_EFFECT_COLOUR_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,200,48,11,12
- DEFPUSHBUTTON "OK",IDOK,114,78,45,14,WS_GROUP
- PUSHBUTTON "Cancel",IDCANCEL,168,78,45,14,WS_GROUP
+ LTEXT "Effect:", IDC_STATIC, 12, 12, 66, 12, SS_CENTERIMAGE
+ COMBOBOX IDC_EFFECT_COMBO, 84, 12, 126, 30, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Base colour:", IDC_STATIC, 12, 30, 66, 12, SS_CENTERIMAGE
+ CONTROL "", IDC_EFFECT_COLOUR1, "ColourPicker", WS_TABSTOP, 84, 30, 30, 12
+ LTEXT "opacity:", IDC_STATIC, 126, 30, 42, 12, SS_CENTERIMAGE
+ EDITTEXT IDC_EFFECT_COLOUR_TEXT1, 168, 30, 42, 12, ES_NUMBER
+ CONTROL "", IDC_EFFECT_COLOUR_SPIN1, "msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK, 200, 30, 11, 12
+ LTEXT "Secondary colour:", IDC_STATIC, 12, 48, 66, 12, SS_CENTERIMAGE
+ CONTROL "", IDC_EFFECT_COLOUR2, "ColourPicker", WS_TABSTOP, 84, 48, 30, 12
+ LTEXT "opacity:", IDC_STATIC, 126, 48, 42, 12, SS_CENTERIMAGE
+ EDITTEXT IDC_EFFECT_COLOUR_TEXT2, 168, 48, 42, 12, ES_NUMBER
+ CONTROL "", IDC_EFFECT_COLOUR_SPIN2, "msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK, 200, 48, 11, 12
+ DEFPUSHBUTTON "OK", IDOK, 114, 78, 45, 14, WS_GROUP
+ PUSHBUTTON "Cancel", IDCANCEL, 168, 78, 45, 14, WS_GROUP
END
|