diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-23 19:43:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-23 19:43:21 +0000 |
commit | aa387fa04aa096d163932d3f5f9711a2f146c6f0 (patch) | |
tree | 7efe5dabf5bf5b9a78f8f991522487814bfc8cb0 /protocols/IcqOscarJ/src | |
parent | 139c2c1a61d9f765704a2001199c2712d6587fb4 (diff) |
- PROTO_INTERFACE::GetIcon removed and replaced with the standard implementation;
- PS_LOADICON also replaced with the standard function;
- ProtoConstructor() & ProtoDestructor() macroses are introduced to simplify protocols' code;
- GetIcon() method implementation removed from all protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@3739 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src')
-rw-r--r-- | protocols/IcqOscarJ/src/UI/loginpassword.cpp | 4 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_firstrun.cpp | 4 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_popups.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.cpp | 38 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.h | 2 |
5 files changed, 8 insertions, 42 deletions
diff --git a/protocols/IcqOscarJ/src/UI/loginpassword.cpp b/protocols/IcqOscarJ/src/UI/loginpassword.cpp index be7c4717bb..0699a686b4 100644 --- a/protocols/IcqOscarJ/src/UI/loginpassword.cpp +++ b/protocols/IcqOscarJ/src/UI/loginpassword.cpp @@ -41,8 +41,8 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ppro = (CIcqProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hIconProtocol, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hIconProtocol));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
{
DWORD dwUin = ppro->getContactUin(NULL);
diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp index a80557cba4..9903719a22 100644 --- a/protocols/IcqOscarJ/src/icq_firstrun.cpp +++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp @@ -57,8 +57,8 @@ INT_PTR CALLBACK icq_FirstRunDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ppro = (CIcqProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hIconProtocol, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hIconProtocol));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
SendDlgItemMessage(hwndDlg, IDC_PW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index cee5509a7c..fe2337daca 100644 --- a/protocols/IcqOscarJ/src/icq_popups.cpp +++ b/protocols/IcqOscarJ/src/icq_popups.cpp @@ -251,7 +251,7 @@ int CIcqProto::ShowPopUpMsg(HANDLE hContact, const char *szTitle, const char *sz return -1;
}
if (!getSettingByte(NULL, "PopupsSysIcons", DEFAULT_POPUPS_SYS_ICONS))
- ppd.lchIcon = Skin_GetIconByHandle(m_hIconProtocol);
+ ppd.lchIcon = Skin_GetIconByHandle(m_hProtoIcon);
else
ppd.lchIcon = (HICON)LoadImage( NULL, rsIcon, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
if (getSettingByte(NULL, "PopupsWinColors", DEFAULT_POPUPS_WIN_COLORS))
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index e00ed256f2..cf2d9bf790 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -77,11 +77,8 @@ expectedFileRecvs(10, CompareFT), contactsCache(10, CompareContactsCache),
cheekySearchId( -1 )
{
- m_iVersion = 2;
- m_iStatus = ID_STATUS_OFFLINE;
- m_tszUserName = mir_tstrdup( aUserName );
- m_szModuleName = mir_strdup( aProtoName );
- m_szProtoName = mir_strdup( aProtoName );
+ ProtoConstructor(this, aProtoName, aUserName);
+ m_szProtoName = mir_strdup(aProtoName);
_strlwr( m_szProtoName );
m_szProtoName[0] = toupper( m_szProtoName[0] );
NetLog_Server( "Setting protocol/module name to '%s/%s'", m_szProtoName, m_szModuleName );
@@ -165,8 +162,6 @@ cheekySearchId( -1 ) CreateProtoService(PS_ICQ_ADDCAPABILITY, &CIcqProto::IcqAddCapability);
CreateProtoService(PS_ICQ_CHECKCAPABILITY, &CIcqProto::IcqCheckCapability);
- m_hIconProtocol = (HANDLE)CallService(MS_SKIN2_ISMANAGEDICON, (WPARAM)LoadSkinnedProtoIcon(m_szModuleName, ID_STATUS_ONLINE), 0);
-
// Reset a bunch of session specific settings
UpdateGlobalSettings();
ResetSettingsOnLoad();
@@ -271,14 +266,10 @@ CIcqProto::~CIcqProto() SAFE_FREE(&m_modeMsgs.szDnd);
SAFE_FREE(&m_modeMsgs.szFfc);
- // Remove account icons
- Skin_RemoveIconHandle(m_hIconProtocol);
-
NetLog_Server("%s: Protocol instance '%s' destroyed.", ICQ_PROTOCOL_NAME, m_szModuleName);
mir_free( m_szProtoName );
- mir_free( m_szModuleName );
- mir_free( m_tszUserName );
+ ProtoDestructor(this);
}
@@ -788,29 +779,6 @@ DWORD_PTR __cdecl CIcqProto::GetCaps( int type, HANDLE hContact ) }
////////////////////////////////////////////////////////////////////////////////////////
-// GetIcon - loads an icon for the contact list
-
-HICON __cdecl CIcqProto::GetIcon( int iconIndex )
-{
- if (LOWORD(iconIndex) == PLI_PROTOCOL)
- {
- if (iconIndex & PLIF_ICOLIBHANDLE)
- return (HICON)m_hIconProtocol;
-
- bool big = (iconIndex & PLIF_SMALL) == 0;
- HICON hIcon = Skin_GetIconByHandle(m_hIconProtocol, big);
-
- if (iconIndex & PLIF_ICOLIB)
- return hIcon;
-
- HICON hIconNew = CopyIcon(hIcon);
- Skin_ReleaseIcon(hIcon);
- return hIconNew;
- }
- return NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
int __cdecl CIcqProto::GetInfo(HANDLE hContact, int infoType)
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 5fdf411387..11a880884f 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -76,7 +76,6 @@ struct CIcqProto : public PROTO_INTERFACE, public MZeroedObject virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL );
- virtual HICON __cdecl GetIcon( int iconIndex );
virtual int __cdecl GetInfo( HANDLE hContact, int infoType );
virtual HANDLE __cdecl SearchBasic( const PROTOCHAR *id );
@@ -153,7 +152,6 @@ struct CIcqProto : public PROTO_INTERFACE, public MZeroedObject int __cdecl OnPreBuildStatusMenu( WPARAM, LPARAM );
//====| Data |========================================================================
- HANDLE m_hIconProtocol;
HANDLE m_hServerNetlibUser, m_hDirectNetlibUser;
BYTE m_bGatewayMode;
|