diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-01 16:59:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-01 16:59:23 +0000 |
commit | 803b51d1a61b8c13badf6ac1f361b4d577f03cda (patch) | |
tree | 6d74775edd57e8b73797420ecab031a2d7c719d3 /plugins | |
parent | ebdb188abf6ca1ee5e047c70b9e2be0d47ce67f1 (diff) |
Clist Modern own extra icons support removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@2138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Clist_modern/res/resource.rc | 28 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_clist.h | 26 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_clui.h | 1 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_commonprototypes.h | 3 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistopts.cpp | 296 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 81 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_extraimage.cpp | 469 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_skineditor.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_modern/src/resource.h | 3 |
10 files changed, 81 insertions, 835 deletions
diff --git a/plugins/Clist_modern/res/resource.rc b/plugins/Clist_modern/res/resource.rc index fe91229a29..1c6c032288 100644 --- a/plugins/Clist_modern/res/resource.rc +++ b/plugins/Clist_modern/res/resource.rc @@ -344,15 +344,6 @@ BEGIN CONTROL "",IDC_OFFSETSPIN_RIGHT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,261,201,10,12
END
-IDD_OPT_ITEM_EXTRAICONS DIALOGEX 0, 0, 222, 162
-STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- GROUPBOX "Contact List Extra Icons",IDC_STATIC,7,19,205,131
- CONTROL "",IDC_EXTRAORDER,"SysTreeView32",TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP,18,36,182,107
-END
-
IDD_DELETECONTACT DIALOGEX 0, 0, 284, 90
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
@@ -887,16 +878,6 @@ BEGIN HORZGUIDE, 19
END
- IDD_OPT_ITEM_EXTRAICONS, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 212
- VERTGUIDE, 18
- VERTGUIDE, 200
- TOPMARGIN, 5
- BOTTOMMARGIN, 155
- END
-
IDD_DELETECONTACT, DIALOG
BEGIN
LEFTMARGIN, 7
@@ -1168,7 +1149,7 @@ END IDD_OPT_CLUI_2 DLGINIT
BEGIN
IDC_HIDEMETHOD, 0x403, 9, 0
-0x6f63, 0x706d, 0x656c, 0x6574, "\000"
+0x6f63, 0x706d, 0x656c, 0x6574, "\000"
0
END
@@ -1179,19 +1160,19 @@ END // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"..\\src\\resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include <winresrc.h>\r\n"
"#include ""..\\src\\hdr\\modern_statusmodes.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -1213,4 +1194,3 @@ END /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/Clist_modern/src/hdr/modern_clist.h b/plugins/Clist_modern/src/hdr/modern_clist.h index 82f473d390..512b19509c 100644 --- a/plugins/Clist_modern/src/hdr/modern_clist.h +++ b/plugins/Clist_modern/src/hdr/modern_clist.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
@@ -43,14 +43,14 @@ extern pfnMyGetMonitorInfo MyGetMonitorInfo; ///////////////////////////////////////////////////////////////////////////////
class CSmileyString
-{
+{
public:
SortedList* plText;
int iMaxSmileyHeight;
CSmileyString() : plText( NULL ), iMaxSmileyHeight( 0 ) {};
CSmileyString( const CSmileyString& ssIn )
- {
+ {
_CopySmileyList( ssIn.plText );
iMaxSmileyHeight = ssIn.iMaxSmileyHeight;
}
@@ -70,7 +70,7 @@ public: void ReplaceSmileys(struct SHORTDATA *dat, struct ClcCacheEntry *pdnce, TCHAR *szText, BOOL replace_smileys);
- /** Destroy smiley list */
+ /** Destroy smiley list */
void DestroySmileyList();
/** Copy Smiley List */
void _CopySmileyList( SortedList *plInput );
@@ -114,18 +114,6 @@ typedef ClcCacheEntry *pClcCacheEntry, *PDNCE; ///////////////////////////////////////////////////////////////////////////////
-typedef struct tagEXTRASLOTINFO
-{
- union
- {
- TCHAR * ptszSlotName; // one of this string should be given
- char * pszSlotName;
- };
- char * pszSlotID;
- BOOL fUnicode;
- BYTE iSlot; // the slot 10-16 are available, do not use
-} EXTRASLOTINFO;
-
#define CLVM_FILTER_PROTOS 1
#define CLVM_FILTER_GROUPS 2
#define CLVM_FILTER_STATUS 4
@@ -160,6 +148,6 @@ typedef struct tagEXTRASLOTINFO #define CLVM_MODULE "CLVM"
#endif
-#define GROUPF_SHOWOFFLINE 0x40
+#define GROUPF_SHOWOFFLINE 0x40
-#endif
\ No newline at end of file +#endif
diff --git a/plugins/Clist_modern/src/hdr/modern_clui.h b/plugins/Clist_modern/src/hdr/modern_clui.h index eb353f4609..75d348e547 100644 --- a/plugins/Clist_modern/src/hdr/modern_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_clui.h @@ -52,7 +52,6 @@ public: EVENTHOOK( OnEvent_ModulesLoaded );
EVENTHOOK( OnEvent_ContactMenuPreBuild );
- EVENTHOOK( OnEvent_DBSettingChanging );
EVENTHOOK( OnEvent_FontReload );
SERVICE( Service_ShowMainMenu );
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index a0238b6d6d..120457fcab 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -230,7 +230,6 @@ int GetStatusForContact(HANDLE hContact,char *szProto); int InitCustomMenus(void); //clistmenus.c
int InitFramesMenus(void); //framesmenus.c
int LoadMoveToGroup(); //movetogroup.c
-int LoadPositionsFromDB(BYTE * OrderPos); //clistopts.c
int LoadStatusBarData(); //modern_statusbar.c
int MenuModulesLoaded(WPARAM wParam,LPARAM lParam); //clistmenu.c
int MenuModulesShutdown(WPARAM wParam,LPARAM lParam); //clistmenu.c
@@ -258,7 +257,6 @@ void FreeRowCell(); //Ro void InitGdiPlus(); //gdiplus.cpp
void InitTray(); //clisttray.c
void InvalidateDNCEbyPointer(HANDLE hContact,pClcCacheEntry pdnce,int SettingType); //clistsettings.c
-void ReAssignExtraIcons(); //extraimage.c
void ShutdownGdiPlus(); //gdiplus.cpp
void TextOutWithGDIp(HDC hDestDC, int x, int y, LPCTSTR lpString, int nCount); //gdiplus.cpp
void UninitCustomMenus(); //clistmenus.c
@@ -269,7 +267,6 @@ void UpdateAllAvatars(struct ClcData *dat); //cluiframes.c
void gtaRenewText(HANDLE hContact);
int ExtraImage_ExtraIDToColumnNum(int extra);
-int ExtraImage_ColumnNumToExtraID(int column);
int LoadSkinButtonModule();
void UninitSkinHotKeys();
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index b38f99efde..346fa70f2c 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1784,10 +1784,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP static LRESULT clcOnIntmApparentModeChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int lResult = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if ( !ServiceExists("ExtraIcon/Register"))
- ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return lResult;
+ return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
static LRESULT clcOnIntmStatusMsgChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -1930,9 +1927,6 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) pcli->clcProto[i].dwStatus = (WORD) ack->lParam;
if (pcli->clcProto[i].dwStatus >= ID_STATUS_OFFLINE)
pcli->pfnTrayIconUpdateBase(pcli->clcProto[i].szProto);
- if ( !ServiceExists("ExtraIcon/Register"))
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE) != -1)
- ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)NULL);
return 0;
}
}
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index de26c3b2be..fe5ac2dc86 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -450,9 +450,7 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara if ( !IsDlgButtonChecked(hwndDlg,IDC_HIDE_ICON_ON_AVATAR))
EnableWindow(GetDlgItem(hwndDlg,IDC_DRAW_ON_AVATAR_SPACE),FALSE);
- if (ServiceExists("ExtraIcon/Register"))
- ShowWindow(GetDlgItem(hwndDlg, IDC_ALWAYS_VISIBLEICON), SW_HIDE);
-
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ALWAYS_VISIBLEICON), SW_HIDE);
break;
case WM_COMMAND:
@@ -944,293 +942,6 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM return 0;
}
-/* Extra icons settings */
-typedef struct _OrderTreeData
-{
- BYTE ID;
- TCHAR * Name;
- BYTE Position;
- char * KeyName;
- BOOL Visible;
- BOOL fReserved;
-} *pOrderTreeData, TOrderTreeData;
-
-static TOrderTreeData OrderTreeData[] =
-{
- {EXTRA_ICON_VISMODE, _T("Visibility/Chat activity"), EXTRA_ICON_VISMODE, "EXTRA_ICON_VISMODE", SETTING_EXTRA_ICON_VISMODE_DEFAULT,0},
- {EXTRA_ICON_EMAIL, _T("E-mail"), EXTRA_ICON_EMAIL, "EXTRA_ICON_EMAIL", SETTING_EXTRA_ICON_EMAIL_DEFAULT, 0},
- {EXTRA_ICON_PROTO, _T("Protocol"), EXTRA_ICON_PROTO, "EXTRA_ICON_PROTO", SETTING_EXTRA_ICON_PROTO_DEFAULT, 0},
- {EXTRA_ICON_SMS, _T("Phone/SMS"), EXTRA_ICON_SMS, "EXTRA_ICON_SMS", SETTING_EXTRA_ICON_SMS_DEFAULT, 0},
- {EXTRA_ICON_WEB, _T("Web page"), EXTRA_ICON_WEB, "EXTRA_ICON_WEB", SETTING_EXTRA_ICON_WEB_DEFAULT, 0},
- {EXTRA_ICON_CLIENT, _T("Client (fingerprint.dll is required)"), EXTRA_ICON_CLIENT,"EXTRA_ICON_CLIENT", SETTING_EXTRA_ICON_CLIENT_DEFAULT, 0},
- {EXTRA_ICON_ADV1, _T("Advanced #1"), EXTRA_ICON_ADV1, "EXTRA_ICON_ADV1", SETTING_EXTRA_ICON_ADV1_DEFAULT, 0},
- {EXTRA_ICON_ADV2, _T("Advanced #2"), EXTRA_ICON_ADV2, "EXTRA_ICON_ADV2", SETTING_EXTRA_ICON_ADV2_DEFAULT, 0},
- {EXTRA_ICON_ADV3, _T("Advanced #3"), EXTRA_ICON_ADV3, "EXTRA_ICON_ADV3", SETTING_EXTRA_ICON_ADV3_DEFAULT, 0},
- {EXTRA_ICON_ADV4, _T("Advanced #4"), EXTRA_ICON_ADV4, "EXTRA_ICON_ADV4", SETTING_EXTRA_ICON_ADV4_DEFAULT, 0}
-};
-
-#define PrVer 4
-
-static char **settingname;
-static int nArrayLen;
-
-static int OrderEnumProc (const char *szSetting,LPARAM lParam)
-{
- if (szSetting == NULL) return 0;
- if ( !wildcmp((char*) szSetting,(char *) lParam,0)) return 0;
- nArrayLen++;
- settingname = (char **)realloc(settingname,nArrayLen*sizeof(char *));
- settingname[nArrayLen-1] = _strdup(szSetting);
- return 0;
-};
-
-static int DeleteAllSettingInOrder()
-{
- DBCONTACTENUMSETTINGS dbces;
- nArrayLen = 0;
-
- dbces.pfnEnumProc = OrderEnumProc;
- dbces.szModule = CLUIFrameModule;
- dbces.ofsSettings = 0;
- dbces.lParam = (LPARAM)"ORDER_EXTRA_*";
-
- CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
-
- //delete all settings
- if (nArrayLen == 0)
- return 0;
-
- for (int i=0; i < nArrayLen; i++) {
- db_unset(0, CLUIFrameModule, settingname[i]);
- free(settingname[i]);
- }
- free(settingname);
- settingname = NULL;
-
- return 0;
-}
-
-static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
-{
- pOrderTreeData A = (pOrderTreeData)lParam1;
- pOrderTreeData B = (pOrderTreeData)lParam2;
- return (int)(A->Position)-(int)(B->Position);
-}
-
-static int FillOrderTree(HWND hwndDlg, HWND Tree)
-{
- TVINSERTSTRUCT tvis = {0};
- TreeView_DeleteAllItems(Tree);
- tvis.hParent = NULL;
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- if (db_get_b(NULL,CLUIFrameModule,"ExtraCountStored",0) != SIZEOF(OrderTreeData)) {
- DeleteAllSettingInOrder();
- db_set_b(NULL,CLUIFrameModule,"ExtraCountStored",SIZEOF(OrderTreeData));
- }
-
- for (int i=0; i < SIZEOF(OrderTreeData); i++) {
- char buf[256];
- sprintf(buf,"ORDER_%s",OrderTreeData[i].KeyName);
- OrderTreeData[i].Position = (BYTE)db_get_b(NULL,CLUIFrameModule,buf,i);
- OrderTreeData[i].Visible = (BOOL)db_get_b(NULL,CLUIFrameModule,OrderTreeData[i].KeyName,1);
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.lParam = (LPARAM)(&(OrderTreeData[i]));
- tvis.item.pszText = TranslateTS(OrderTreeData[i].Name);
- tvis.item.iImage = tvis.item.iSelectedImage = OrderTreeData[i].Visible;
- TreeView_InsertItem(Tree,&tvis);
- }
-
- TVSORTCB sort = {0};
- sort.hParent = NULL;
- sort.lParam = 0;
- sort.lpfnCompare = CompareFunc;
- TreeView_SortChildrenCB(Tree,&sort,0);
- return 0;
-}
-
-static int SaveOrderTree(HWND hwndDlg, HWND Tree)
-{
- HTREEITEM ht;
- BYTE pos = 0;
- TVITEMA tvi = {0};
- tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- ht = TreeView_GetRoot(Tree);
- do {
- TOrderTreeData * it = NULL;
- tvi.hItem = ht;
- TreeView_GetItemA(Tree,&tvi);
- it = (TOrderTreeData*)(tvi.lParam);
- {
- char buf[250];
- sprintf(buf,"ORDER_%s",it->KeyName);
- db_set_b(NULL,CLUIFrameModule,buf,pos);
- db_set_b(NULL,CLUIFrameModule,it->KeyName, it->Visible);
- }
- ht = TreeView_GetNextSibling(Tree,ht);
- pos++;
- }
- while (ht);
-
- return 0;
-}
-
-int LoadPositionsFromDB(BYTE * OrderPos)
-{
- if (db_get_b(NULL,CLUIFrameModule,"ExtraCountStored",0) != SIZEOF(OrderTreeData)) {
- DeleteAllSettingInOrder();
- db_set_b(NULL,CLUIFrameModule,"ExtraCountStored",SIZEOF(OrderTreeData));
- }
-
- for (int i=0; i < SIZEOF(OrderTreeData); i++) {
- char buf[256];
- sprintf(buf,"ORDER_%s",OrderTreeData[i].KeyName);
- OrderPos[OrderTreeData[i].ID-1] = (BYTE)db_get_b(NULL,CLUIFrameModule,buf,i);
- }
- return 0;
-}
-
-static int dragging = 0;
-static HANDLE hDragItem = NULL;
-
-INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXTRAORDER),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXTRAORDER),GWL_STYLE)|TVS_NOHSCROLL);
- {
- HIMAGELIST himlCheckBoxes;
- himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
- ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_NOTICK)));
- ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_TICK)));
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_EXTRAORDER),himlCheckBoxes,TVSIL_NORMAL);
- }
- FillOrderTree(hwndDlg,GetDlgItem(hwndDlg,IDC_EXTRAORDER));
- return TRUE;
-
- case WM_COMMAND:
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- break;
-
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_APPLY:
- SaveOrderTree(hwndDlg,GetDlgItem(hwndDlg,IDC_EXTRAORDER));
- ReAssignExtraIcons();
- CLUI_ReloadCLUIOptions();
- ClcOptionsChanged();
- return TRUE;
- }
- break;
-
- case IDC_EXTRAORDER:
- switch (((LPNMHDR)lParam)->code) {
- case NM_CLICK:
- {
- 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))
- if (hti.flags & TVHT_ONITEMICON)
- {
- TVITEMA tvi;
- tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem = hti.hItem;
- TreeView_GetItemA(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
- ((TOrderTreeData *)tvi.lParam)->Visible = tvi.iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- break;
-
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
- SetCapture(hwndDlg);
- dragging = 1;
- hDragItem = ((LPNMTREEVIEWA)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- break;
- }
- }
- break;
-
- case WM_MOUSEMOVE:
- if ( dragging) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(lParam);
- hti.pt.y = (short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti.pt);
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if (hti.flags & (TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
- HTREEITEM it = hti.hItem;
- hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- //TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
- if ( !(hti.flags&TVHT_ABOVE))
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
- else
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),it,0);
- }
- else {
- if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
- if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
- }
- }
- break;
-
- case WM_LBUTTONUP:
- if ( dragging) {
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
- 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_EXTRAORDER),&hti.pt);
- hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if (hDragItem == hti.hItem) break;
- if (hti.flags&TVHT_ABOVE) hti.hItem = TVI_FIRST;
- tvi.mask = TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem = (HTREEITEM)hDragItem;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvi);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
- TVINSERTSTRUCT tvis;
- TCHAR name[128];
- tvis.item.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask = 0xFFFFFFFF;
- tvis.item.pszText = name;
- tvis.item.cchTextMax = sizeof(name);
- tvis.item.hItem = (HTREEITEM)hDragItem;
- tvis.item.iImage = tvis.item.iSelectedImage = ((TOrderTreeData *)tvi.lParam)->Visible;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis.item);
- TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- tvis.hParent = NULL;
- tvis.hInsertAfter = hti.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis));
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- break;
-
- case WM_DESTROY:
- ImageList_Destroy(TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,TVSIL_NORMAL));
- break;
- }
- return FALSE;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
struct
@@ -1251,7 +962,6 @@ static row_opt_items[] = { LPGEN("Text"), IDD_OPT_ITEM_TEXT, DlgProcItemTextOpts },
{ LPGEN("Second Line"), IDD_OPT_ITEM_SECOND_LINE, DlgProcItemSecondLineOpts },
{ LPGEN("Third Line"), IDD_OPT_ITEM_THIRD_LINE, DlgProcItemThirdLineOpts },
- { LPGEN("Extra Icons"), IDD_OPT_ITEM_EXTRAICONS, DlgProcExtraIconsOpts}
};
int CListOptInit(WPARAM wParam,LPARAM lParam)
@@ -1265,11 +975,7 @@ int CListOptInit(WPARAM wParam,LPARAM lParam) odp.pszTitle = LPGEN("Row items");
odp.flags = ODPF_BOLDGROUPS;
- BOOL hasExtraIconsService = ServiceExists("ExtraIcon/Register");
for (int i=0; i < SIZEOF(row_opt_items); i++) {
- if (hasExtraIconsService && row_opt_items[i].id == IDD_OPT_ITEM_EXTRAICONS)
- continue;
-
odp.pszTemplate = MAKEINTRESOURCEA(row_opt_items[i].id);
odp.pszTab = row_opt_items[i].name;
odp.pfnDlgProc = row_opt_items[i].wnd_proc;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index eb3219fee1..b86d2431e9 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -166,27 +166,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) return 0;
}
-int CLUI::OnEvent_DBSettingChanging(WPARAM wParam,LPARAM lParam)
-{
- if (ServiceExists("ExtraIcon/Register"))
- return 0;
-
- DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *)lParam;
- if (wParam == 0) return 0;
- if (dbcws == NULL) return(0);
- if (MirandaExiting()) return 0;
- if (( dbcws->value.type == DBVT_WORD && !mir_strcmp(dbcws->szSetting,"ApparentMode")) ||
- ( dbcws->value.type == DBVT_ASCIIZ &&
- (( !mir_strcmp(dbcws->szSetting,"e-mail") ||
- !mir_strcmp(dbcws->szSetting,"Mye-mail0") ||
- !mir_strcmp(dbcws->szSetting,"Cellular")) ||
- ( !mir_strcmp(dbcws->szModule,"UserInfo") &&
- ( !mir_strcmp(dbcws->szSetting,"MyPhone0") ||
- !mir_strcmp(dbcws->szSetting,"Mye-mail0"))))))
- ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return(0);
-};
INT_PTR CLUI::Service_ShowMainMenu(WPARAM wParam,LPARAM lParam)
{
HMENU hMenu;
@@ -196,6 +176,7 @@ INT_PTR CLUI::Service_ShowMainMenu(WPARAM wParam,LPARAM lParam) TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y,0,pcli->hwndContactList,NULL);
return 0;
}
+
INT_PTR CLUI::Service_ShowStatusMenu(WPARAM wParam,LPARAM lParam)
{
HMENU hMenu;
@@ -448,7 +429,6 @@ HRESULT CLUI::CreateCLC() mutex_bDisableAutoUpdate = 0;
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
- HookEvent(ME_DB_CONTACT_SETTINGCHANGED,CLUI::OnEvent_DBSettingChanging);
return S_OK;
};
@@ -2824,55 +2804,20 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) DWORD hitFlags;
HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(pnmc->pt.x,pnmc->pt.y));
- if (hitFlags&CLCHT_ONITEMEXTRA)
- {
- if ( !IsHContactGroup(hItem) && !IsHContactInfo(hItem))
- {
+ if (hitFlags & CLCHT_ONITEMEXTRA) {
+ if ( !IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(pnmc->hItem);
- if (pdnce == NULL) return 0;
-
- int extra = ExtraImage_ColumnNumToExtraID(pnmc->iColumn);
- NotifyEventHooks(g_CluiData.hEventExtraClick, (WPARAM)pnmc->hItem, extra);
-
- if ( !ServiceExists("ExtraIcon/Register"))
- {
- int v,e,w;
- v = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
- e = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
- w = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB);
-
- if (pnmc->iColumn == v) {
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)pnmc->hItem,0);
- };
- if (pnmc->iColumn == e)
- {
- char *email = db_get_sa(pnmc->hItem,"UserInfo", "Mye-mail0");
- if ( !email)
- email = db_get_sa(pnmc->hItem, pdnce->m_cache_cszProto, "e-mail");
- if (email) {
- char buf[4096];
- sprintf(buf,"mailto:%s",email);
- mir_free(email);
- ShellExecuteA(m_hWnd,"open",buf,NULL,NULL,SW_SHOW);
- }
- };
- if (pnmc->iColumn == w) {
- char *homepage = db_get_sa(pdnce->hContact,"UserInfo", "Homepage");
- if ( !homepage)
- homepage = db_get_sa(pdnce->hContact,pdnce->m_cache_cszProto, "Homepage");
- if (homepage != NULL)
- {
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)homepage);
- mir_free(homepage);
- }
- }
- }
+ if (pdnce)
+ NotifyEventHooks(g_CluiData.hEventExtraClick, (WPARAM)pnmc->hItem, pnmc->iColumn+1);
}
- };
- if (hItem && !(hitFlags&CLCHT_NOWHERE))
+ }
+
+ if (hItem && !(hitFlags & CLCHT_NOWHERE))
return DefCluiWndProc( WM_NOTIFY, 0, (LPARAM)pnmc );
- if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS)) == 0)
+
+ if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
return DefCluiWndProc( WM_NOTIFY, 0, (LPARAM)pnmc );
+
if (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
int res;
@@ -2881,10 +2826,10 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) res = PostMessage(m_hWnd, WM_SYSCOMMAND, SC_MOVE|HTCAPTION,MAKELPARAM(pt.x,pt.y));
return res;
}
- /*== == == == == == == == == = */
+
if (db_get_b(NULL,"CLUI","DragToScroll",SETTING_DRAGTOSCROLL_DEFAULT) && !db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT))
return ClcEnterDragToScroll(pcli->hwndContactTree,pnmc->pt.y);
- /*== == == == == == == == == = */
+
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_extraimage.cpp b/plugins/Clist_modern/src/modern_extraimage.cpp index df51e1c126..98fe4f177e 100644 --- a/plugins/Clist_modern/src/modern_extraimage.cpp +++ b/plugins/Clist_modern/src/modern_extraimage.cpp @@ -1,13 +1,8 @@ #include "hdr/modern_commonheaders.h"
#include "hdr/modern_commonprototypes.h"
-
-
#define ExtraImageIconsIndexCount 6
-bool visar[EXTRACOLUMNCOUNT];
-int ExtraImageIconsIndex[ExtraImageIconsIndexCount];
-int EnabledColumnCount = 0;
BOOL g_mutex_bSetAllExtraIconsCycle = 0;
static HIMAGELIST hExtraImageList = NULL;
@@ -15,136 +10,14 @@ static HIMAGELIST hWideExtraImageList = NULL; void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact);
-void ClearExtraIcons();
-
bool ImageCreated = FALSE;
-BYTE ExtraOrder[] =
-{
- 1, // EXTRA_ICON_EMAIL
- 2, // EXTRA_ICON_PROTO
- 3, // EXTRA_ICON_SMS
- 4, // EXTRA_ICON_ADV1
- 5, // EXTRA_ICON_ADV2
- 6, // EXTRA_ICON_WEB
- 7, // EXTRA_ICON_CLIENT
- 0, // EXTRA_ICON_VISMODE
- 8, // EXTRA_ICON_ADV3
- 9, // EXTRA_ICON_ADV4
-};
-
-BOOL HasExtraIconsService()
-{
- return ServiceExists("ExtraIcon/Register");
-}
-
-bool isColumnVisible(int extra)
-{
- if (HasExtraIconsService())
- return true;
-
- int i=0;
- for (i=0; i < sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
- if (ExtraOrder[i] == extra)
- {
- switch(i+1)
- {
- case EXTRA_ICON_EMAIL: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",SETTING_EXTRA_ICON_EMAIL_DEFAULT) != 0;
- case EXTRA_ICON_PROTO: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",SETTING_EXTRA_ICON_PROTO_DEFAULT) != 0;
- case EXTRA_ICON_SMS: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",SETTING_EXTRA_ICON_SMS_DEFAULT) != 0;
- case EXTRA_ICON_ADV1: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",SETTING_EXTRA_ICON_ADV1_DEFAULT) != 0;
- case EXTRA_ICON_ADV2: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",SETTING_EXTRA_ICON_ADV2_DEFAULT) != 0;
- case EXTRA_ICON_WEB: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",SETTING_EXTRA_ICON_WEB_DEFAULT) != 0;
- case EXTRA_ICON_CLIENT: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_CLIENT",SETTING_EXTRA_ICON_CLIENT_DEFAULT) != 0;
- case EXTRA_ICON_VISMODE: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_VISMODE",SETTING_EXTRA_ICON_VISMODE_DEFAULT) != 0;
- case EXTRA_ICON_ADV3: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV3",SETTING_EXTRA_ICON_ADV3_DEFAULT) != 0;
- case EXTRA_ICON_ADV4: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV4",SETTING_EXTRA_ICON_ADV4_DEFAULT) != 0;
- }
- break;
- }
- return(FALSE);
-}
-
-void GetVisColumns()
-{
- visar[0] = isColumnVisible(0);
- visar[1] = isColumnVisible(1);
- visar[2] = isColumnVisible(2);
- visar[3] = isColumnVisible(3);
- visar[4] = isColumnVisible(4);
- visar[5] = isColumnVisible(5);
- visar[6] = isColumnVisible(6);
- visar[7] = isColumnVisible(7);
- visar[8] = isColumnVisible(8);
- visar[9] = isColumnVisible(9);
-};
-
-__inline int bti(bool b)
-{
- return(b?1:0);
-};
-int colsum(int from,int to)
-{
- int i,sum;
- if (from < 0 || from >= EXTRACOLUMNCOUNT){return(-1);};
- if (to < 0 || to >= EXTRACOLUMNCOUNT){return(-1);};
- if (to < from){return(-1);};
-
- sum = 0;
- for (i = from;i <= to;i++)
- {
- sum += bti(visar[i]);
- };
- return(sum);
-};
-
-
-
int ExtraImage_ExtraIDToColumnNum(int extra)
{
- if (HasExtraIconsService())
- {
- if (extra < 1 || extra > EXTRACOLUMNCOUNT)
- return -1;
- else
- return extra-1;
- }
-
- int ord = ExtraOrder[extra-1];
- if ( !visar[ord]) return -1;
- return (colsum(0,ord)-1);
-};
-
-int ExtraImage_ColumnNumToExtraID(int column)
-{
- if (HasExtraIconsService())
- return column+1;
-
- for (int i=0; i < EXTRA_ICON_COUNT; i++)
- if (ExtraImage_ExtraIDToColumnNum(i) == column)
- return i;
-
- return -1;
-}
-
-INT_PTR SetIconForExtraColumn(WPARAM wParam,LPARAM lParam)
-{
- pIconExtraColumn piec;
- int icol;
- HANDLE hItem;
-
- if (pcli->hwndContactTree == 0){return(-1);};
- if (wParam == 0 || lParam == 0){return(-1);};
- piec = (pIconExtraColumn)lParam;
-
- if (piec->cbSize != sizeof(IconExtraColumn)){return(-1);};
- icol = ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
- if (icol == -1){return(-1);};
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem == 0){return(-1);};
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
- return(0);
+ if (extra < 1 || extra > EXTRACOLUMNCOUNT)
+ return -1;
+ else
+ return extra-1;
}
//wparam = hIcon
@@ -160,316 +33,93 @@ INT_PTR AddIconToExtraImageList(WPARAM wParam,LPARAM lParam) void SetNewExtraColumnCount()
{
- LoadPositionsFromDB(ExtraOrder);
- GetVisColumns();
-
- int newcount = colsum(0,EXTRACOLUMNCOUNT-1);
- db_set_b(NULL,CLUIFrameModule,"EnabledColumnCount",(BYTE)newcount);
- EnabledColumnCount = newcount;
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
+ db_set_b(NULL, CLUIFrameModule, "EnabledColumnCount", (BYTE)EXTRACOLUMNCOUNT);
+ SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
}
void ExtraImage_ReloadExtraIcons()
{
- int count,i;
- PROTOACCOUNT **accs;
- HICON hicon;
- BOOL needFree;
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNSSPACE,db_get_b(NULL,"CLUI","ExtraColumnSpace",18),0);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,(LPARAM)NULL);
- if (hExtraImageList){ImageList_Destroy(hExtraImageList);};
- if (hWideExtraImageList){ImageList_Destroy(hWideExtraImageList);};
+ SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNSSPACE,db_get_b(NULL,"CLUI","ExtraColumnSpace",18),0);
+ SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,(LPARAM)NULL);
+ if (hExtraImageList)
+ ImageList_Destroy(hExtraImageList);
+ if (hWideExtraImageList)
+ ImageList_Destroy(hWideExtraImageList);
hExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
hWideExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
- if ( !HasExtraIconsService()) {
- //loading icons
- HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL);
- ExtraImageIconsIndex[0] = ImageList_AddIcon(hExtraImageList, hIcon);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
- ExtraImageIconsIndex[1] = ImageList_AddIcon(hExtraImageList, hIcon);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- hIcon = LoadSkinnedIcon(SKINICON_EVENT_URL);
- ExtraImageIconsIndex[2] = ImageList_AddIcon(hExtraImageList, hIcon);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
-
- //calc only needed protocols
- //adding protocol icons
- ProtoEnumAccounts( &count, &accs );
- for (i=0;i < count;i++) {
- if ( !IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS,PFLAGNUM_2, 0 ) == 0)
- continue;
-
- hIcon = LoadSkinnedProtoIcon(accs[i]->szModuleName,ID_STATUS_ONLINE);
- ImageList_AddIcon(hExtraImageList, hIcon);
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- }
-
- hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",5,TRUE,TRUE,"AlwaysVis","Contact List",Translate("Always Visible"),-IDI_ALWAYSVIS,&needFree);
- if ( !hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_ALWAYSVIS));needFree = TRUE;}
- ExtraImageIconsIndex[3] = ImageList_AddIcon(hExtraImageList,hicon );
- if (needFree) DestroyIcon_protect(hicon);
-
- hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",6,TRUE,TRUE,"NeverVis","Contact List",Translate("Never Visible"),-IDI_NEVERVIS,&needFree);
- if ( !hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_NEVERVIS));needFree = TRUE;}
- ExtraImageIconsIndex[4] = ImageList_AddIcon(hExtraImageList,hicon );
- if (needFree) DestroyIcon_protect(hicon);
-
- hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",7,TRUE,TRUE,"ChatActivity","Contact List",Translate("Chat Activity"),-IDI_CHAT,&needFree);
- if ( !hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_CHAT));needFree = TRUE;}
- ExtraImageIconsIndex[5] = ImageList_AddIcon(hExtraImageList,hicon );
- if (needFree) DestroyIcon_protect(hicon);
- }
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,(WPARAM)hWideExtraImageList,(LPARAM)hExtraImageList);
- //ExtraImage_SetAllExtraIcons(hImgList);
+ SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,(WPARAM)hWideExtraImageList,(LPARAM)hExtraImageList);
SetNewExtraColumnCount();
NotifyEventHooks(g_CluiData.hEventExtraImageListRebuilding,0,0);
ImageCreated = TRUE;
}
-void ReAssignExtraIcons()
-{
- ClearExtraIcons();
- SetNewExtraColumnCount();
- ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,0);
- SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
-}
-
-void ClearExtraIcons()
-{
- SetNewExtraColumnCount();
-
- HANDLE hContact = db_find_first();
- do {
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem == 0)
- continue;
-
- for (int i=0;i < EnabledColumnCount;i++)
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
- }
- while(hContact = db_find_next(hContact));
-};
-
void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
{
- HANDLE hItem;
- int locApparentMode = 0;
- char * locApparentModeProto = NULL;
- bool hcontgiven = FALSE;
- char *szProto;
- char *(ImgIndex[64]);
- int maxpr,count,i;
- PROTOACCOUNT **accs;
- pClcCacheEntry pdnce;
- int em,pr,sms,a1,a2,w1,c1;
- int tick = 0;
+ if (pcli->hwndContactTree == 0)
+ return;
+
g_mutex_bSetAllExtraIconsCycle = 1;
- hcontgiven = (hContact != 0);
+ bool hcontgiven = (hContact != 0);
- if (pcli->hwndContactTree == 0){return;};
- tick = GetTickCount();
- if (ImageCreated == FALSE) ExtraImage_ReloadExtraIcons();
+ if (ImageCreated == FALSE)
+ ExtraImage_ReloadExtraIcons();
SetNewExtraColumnCount();
- BOOL hasExtraIconsService = HasExtraIconsService();
- if ( !hasExtraIconsService)
- {
- em = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
- pr = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
- sms = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS);
- a1 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_ADV1);
- a2 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_ADV2);
- w1 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB);
- c1 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_CLIENT);
-
- memset( ImgIndex, 0, sizeof( ImgIndex ));
- ProtoEnumAccounts( &count, &accs );
- maxpr = 0;
- //calc only needed protocols
- for (i=0;i < count;i++) {
- if ( !IsAccountEnabled( accs[i] ) || CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0) == 0) continue;
- ImgIndex[maxpr] = accs[i]->szModuleName;
- maxpr++;
- }
- }
-
if (hContact == NULL)
- {
hContact = db_find_first();
- }
do {
+ char *szProto = NULL;
+ HANDLE hItem = hContact;
+ if (hItem == 0)
+ continue;
+
+ pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(hItem);
+ if (pdnce == NULL)
+ continue;
- szProto = NULL;
- hItem = hContact;
- if (hItem == 0){continue;};
- pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(hItem);
- if (pdnce == NULL) {continue;};
-
- // szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
szProto = pdnce->m_cache_cszProto;
-
- if ( !hasExtraIconsService)
- {
- {
- bool showweb;
- showweb = FALSE;
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB) != -1)
- {
-
- if (szProto != NULL)
- {
- char *homepage;
- homepage = db_get_sa(pdnce->hContact,"UserInfo", "Homepage");
- if ( !homepage)
- homepage = db_get_sa(pdnce->hContact,pdnce->m_cache_cszProto, "Homepage");
- if (homepage != NULL)
- {
- showweb = TRUE;
- mir_free(homepage);
- }
- }
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB),(showweb)?2:0xFF));
- }
- }
- {
- DBVARIANT dbv = {0};
- bool showemail;
- showemail = TRUE;
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL) != -1)
- {
-
- if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "e-mail",&dbv))
- {
- db_free(&dbv);
- if (DBGetContactSettingString(hContact, "UserInfo", "Mye-mail0", &dbv))
- showemail = FALSE;
- }
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL),(showemail)?0:0xFF));
- db_free(&dbv);
- }
- }
-
- {
- DBVARIANT dbv = {0};
- bool showsms;
- showsms = TRUE;
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS) != -1)
- {
- if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "Cellular",&dbv))
- {
- db_free(&dbv);
- if (DBGetContactSettingString(hContact, "UserInfo", "MyPhone0", &dbv))
- showsms = FALSE;
- }
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS),(showsms)?1:0xFF));
- db_free(&dbv);
- }
- }
-
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO) != -1)
- {
- for (i=0;i < maxpr;i++)
- {
- if ( !mir_strcmp(ImgIndex[i],szProto))
- {
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO),i+3));
- break;
- };
- };
- };
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE) != -1)
- {
- BYTE iconIndex = 0xFF;
- if (szProto != NULL)
- {
- if ( !db_get_b(hContact, szProto, "ChatRoom", 0))
- {
- if (pdnce->ApparentMode == ID_STATUS_OFFLINE)
- iconIndex = ExtraImageIconsIndex[4];
- else if (pdnce->ApparentMode == ID_STATUS_ONLINE)
- {
- if (szProto != locApparentModeProto)
- {
- locApparentModeProto = szProto;
- locApparentMode = CallProtoService(locApparentModeProto,PS_GETSTATUS,0,0);
- }
- if (locApparentMode == ID_STATUS_INVISIBLE || db_get_b(NULL,"CList","AlwaysShowAlwaysVisIcon",SETTING_ALWAYSVISICON_DEFAULT) == 1)
- iconIndex = ExtraImageIconsIndex[3]; }
- }
- else
- {
- if (pdnce->ApparentMode == ID_STATUS_OFFLINE)
- iconIndex = ExtraImageIconsIndex[5];
- else iconIndex = 255;
- }
- }
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE),iconIndex));
- }
- }
- NotifyEventHooks(g_CluiData.hEventExtraImageApplying,(WPARAM)hContact,0);
+ NotifyEventHooks(g_CluiData.hEventExtraImageApplying, (WPARAM)hContact, 0);
if (hcontgiven) break;
Sleep(0);
- } while(hContact = db_find_next(hContact));
+ }
+ while(hContact = db_find_next(hContact));
- tick = GetTickCount()-tick;
g_mutex_bSetAllExtraIconsCycle = 0;
CLUI__cliInvalidateRect(hwndList,NULL,FALSE);
Sleep(0);
}
-HWND SetToolTip(HWND hwnd, TCHAR * tip);
-
-HWND tipHWND = NULL;
-
-static int ehhShowExtraInfoTip(WPARAM wParam, LPARAM lParam)
-{
- CLCEXTRAINFOTIP * eit = (CLCEXTRAINFOTIP *)lParam;
- //tipHWND = SetToolTip(eit->hwnd,_T("TEST"));
- //SendMessage(tipHWND,TTM_ACTIVATE,1,0);
- //SendMessage(tipHWND,TTM_POPUP,0,0);
- return 1;
-
-}
-
-int ehhHideExtraInfoTip(WPARAM wParam, LPARAM lParam)
-{
-
- //SendMessage(tipHWND,TTM_ACTIVATE,0,0);
- return 0;
-
-}
-
INT_PTR WideSetIconForExtraColumn(WPARAM wParam,LPARAM lParam)
{
- pIconExtraColumn piec;
- int icol;
- HANDLE hItem;
+ if (pcli->hwndContactTree == 0 || wParam == 0 || lParam == 0)
+ return -1;
- if (pcli->hwndContactTree == 0){return(-1);};
- if (wParam == 0 || lParam == 0){return(-1);};
- piec = (pIconExtraColumn)lParam;
+ pIconExtraColumn piec = (pIconExtraColumn)lParam;
+ if (piec->cbSize != sizeof(IconExtraColumn))
+ return -1;
- if (piec->cbSize != sizeof(IconExtraColumn)){return(-1);};
- icol = ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
- if (icol == -1){return(-1);};
+ int icol = ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
+ if (icol == -1)
+ return -1;
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem == 0){return(-1);};
- if (piec->hImage == (HANDLE)0xFF) piec->hImage = (HANDLE)0xFFFF;
+ HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
+ if (hItem == 0)
+ return -1;
+
+ if (piec->hImage == (HANDLE)0xFF)
+ piec->hImage = (HANDLE)0xFFFF;
- SendMessage(pcli->hwndContactTree,CLM_SETWIDEEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
- return(0);
+ SendMessage(pcli->hwndContactTree,CLM_SETWIDEEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
+ return 0;
};
//wparam = hIcon
//return hImage on success,-1 on failure
+
INT_PTR WideAddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
{
if (hWideExtraImageList == 0 || wParam == 0){return(-1);};
@@ -478,31 +128,20 @@ INT_PTR WideAddIconToExtraImageList(WPARAM wParam,LPARAM lParam) if (res>0xFFFE) return -1;
return res;
};
+
static int ehhExtraImage_UnloadModule(WPARAM wParam,LPARAM lParam)
{
- if (hExtraImageList) { ImageList_Destroy(hExtraImageList); };
- if (hWideExtraImageList) { ImageList_Destroy(hWideExtraImageList); };
+ if (hExtraImageList)
+ ImageList_Destroy(hExtraImageList);
+ if (hWideExtraImageList)
+ ImageList_Destroy(hWideExtraImageList);
return 0;
}
void ExtraImage_LoadModule()
{
- CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON,WideSetIconForExtraColumn);
- CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON,WideAddIconToExtraImageList);
-
- //CreateServiceFunction(MS_CLIST_EXTRA2_SET_ICON,WideSetIconForExtraColumn);
- //CreateServiceFunction(MS_CLIST_EXTRA2_ADD_ICON,WideAddIconToExtraImageList);
-
+ CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON, WideSetIconForExtraColumn);
+ CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, WideAddIconToExtraImageList);
-
- //HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
-
- HookEvent(ME_CLC_SHOWEXTRAINFOTIP, ehhShowExtraInfoTip );
- HookEvent(ME_CLC_HIDEINFOTIP, ehhHideExtraInfoTip );
HookEvent(ME_SYSTEM_SHUTDOWN, ehhExtraImage_UnloadModule );
};
-
-
-
-
-
diff --git a/plugins/Clist_modern/src/modern_skineditor.cpp b/plugins/Clist_modern/src/modern_skineditor.cpp index 5ab53c9af9..b567fd59b9 100644 --- a/plugins/Clist_modern/src/modern_skineditor.cpp +++ b/plugins/Clist_modern/src/modern_skineditor.cpp @@ -85,7 +85,6 @@ int TreeAddObject(HWND hwndDlg, int ID, OPT_OBJECT_DATA * data) ptrE = path;
do
{
-
while (*ptrE != '/' && *ptrE != '\0') ptrE++;
if (*ptrE == '/')
{
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index 9d9426fe00..29a9f73c9b 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -141,7 +141,6 @@ #define IDI_ICON5 455
#define IDI_CHAT 455
#define IDI_LISTENING_TO 456
-#define IDD_OPT_ITEM_EXTRAICONS 461
#define IDD_OPT_CLCBKG 462
#define IDI_FAVORITE_0 500
#define IDI_FAVORITE_1 501
@@ -1043,7 +1042,7 @@ #define IDC_STATIC -1
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 509
|