summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-25 14:32:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-25 14:32:41 +0000
commit497153f11a96cd336e8dadeeaa50c29e2c1bc2af (patch)
tree7b9c2097d8407988467a0e2c37c11ad9a63af2a7 /plugins/Clist_mw
parent9554d6d4d701beb6e3f4bbcf83d34baa30e7186b (diff)
- fix for the clist services creation order
- Clist Nicer's options adapted for the extraicons plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@1651 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp13
-rw-r--r--plugins/Clist_mw/src/clc.cpp19
-rw-r--r--plugins/Clist_mw/src/clistopts.cpp17
-rw-r--r--plugins/Clist_mw/src/init.cpp114
4 files changed, 83 insertions, 80 deletions
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 11af1f62b2..b8d21480e0 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -2886,17 +2886,6 @@ static int CLUIFrameOnModulesUnload(WPARAM wParam,LPARAM lParam)
return 0;
}
-static INT_PTR CLUIGetCapsService(WPARAM wParam,LPARAM lParam)
-{
- switch (wParam) {
- case CLUICAPS_FLAGS1:
- return CLUIF_HIDEEMPTYGROUPS | CLUIF_DISABLEGROUPS | CLUIF_HASONTOPOPTION | CLUIF_HASAUTOHIDEOPTION;
- case CLUICAPS_FLAGS2:
- return MAKELONG(EXTRACOLUMNCOUNT,1);
- }
- return 0;
-}
-
int LoadCLUIFramesModule(void)
{
WNDCLASS wndclass;
@@ -2954,8 +2943,6 @@ int LoadCLUIFramesModule(void)
CreateServiceFunction(MS_CLIST_FRAMES_UCOLLFRAME,CLUIFramesCollapseUnCollapseFrame);
CreateServiceFunction(MS_CLIST_FRAMES_SETUNBORDER,CLUIFramesSetUnSetBorder);
- CreateServiceFunction(MS_CLUI_GETCAPS,CLUIGetCapsService);
-
CreateServiceFunction(CLUIFRAMESSETALIGN,CLUIFramesSetAlign);
CreateServiceFunction(CLUIFRAMESMOVEUPDOWN,CLUIFramesMoveUpDown);
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp
index 40eddc02eb..305a9a9ded 100644
--- a/plugins/Clist_mw/src/clc.cpp
+++ b/plugins/Clist_mw/src/clc.cpp
@@ -292,3 +292,22 @@ int LoadCLCModule(void)
HookEvent(ME_SYSTEM_SHUTDOWN,ClcShutdown);
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static INT_PTR CLUIGetCapsService(WPARAM wParam,LPARAM lParam)
+{
+ switch (wParam) {
+ case CLUICAPS_FLAGS1:
+ return CLUIF_HIDEEMPTYGROUPS | CLUIF_DISABLEGROUPS | CLUIF_HASONTOPOPTION | CLUIF_HASAUTOHIDEOPTION;
+ case CLUICAPS_FLAGS2:
+ return MAKELONG(MAXEXTRACOLUMNS,1);
+ }
+ return 0;
+}
+
+int PreloadCLCModule()
+{
+ CreateServiceFunction(MS_CLUI_GETCAPS, CLUIGetCapsService);
+ return 0;
+}
diff --git a/plugins/Clist_mw/src/clistopts.cpp b/plugins/Clist_mw/src/clistopts.cpp
index b845c5a0a0..dfca53a5cd 100644
--- a/plugins/Clist_mw/src/clistopts.cpp
+++ b/plugins/Clist_mw/src/clistopts.cpp
@@ -99,7 +99,8 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CheckDlgButton(hwndDlg, IDC_AUTOHIDE, DBGetContactSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- { DWORD caps = CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
+ {
+ DWORD caps = CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
if (!(caps&CLUIF_HIDEEMPTYGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_HIDEEMPTYGROUPS),SW_HIDE);
if (!(caps&CLUIF_DISABLEGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_DISABLEGROUPS),SW_HIDE);
if (caps&CLUIF_HASONTOPOPTION) ShowWindow(GetDlgItem(hwndDlg,IDC_ONTOP),SW_HIDE);
@@ -191,18 +192,18 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
- switch (((LPNMHDR)lParam)->code)
- {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
DBWriteContactSettingByte(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE));
- { DWORD caps = CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
- if (caps&CLUIF_HIDEEMPTYGROUPS) DBWriteContactSettingByte(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
- if (caps&CLUIF_DISABLEGROUPS) DBWriteContactSettingByte(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
- if (!(caps&CLUIF_HASONTOPOPTION)) {
+ {
+ DWORD caps = CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
+ if (caps & CLUIF_HIDEEMPTYGROUPS) DBWriteContactSettingByte(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
+ if (caps & CLUIF_DISABLEGROUPS) DBWriteContactSettingByte(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
+ if ( !(caps & CLUIF_HASONTOPOPTION)) {
DBWriteContactSettingByte(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
SetWindowPos(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
- if (!(caps&CLUIF_HASAUTOHIDEOPTION)) {
+ if ( !(caps & CLUIF_HASAUTOHIDEOPTION)) {
DBWriteContactSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
}
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp
index 19e2ef96a4..2144ab6eb8 100644
--- a/plugins/Clist_mw/src/init.cpp
+++ b/plugins/Clist_mw/src/init.cpp
@@ -104,6 +104,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
int LoadContactListModule(void);
+int PreloadCLCModule(void);
int LoadCLCModule(void);
int LoadCLUIModule();
int InitSkinHotKeys();
@@ -150,69 +151,64 @@ extern "C" int __declspec(dllexport) CListInitialise()
{
int rc = 0;
- // get the internal malloc/free()
- __try {
+ OutputDebugStringA("CListInitialise ClistMW\r\n");
+ mir_getLP( &pluginInfo );
- OutputDebugStringA("CListInitialise ClistMW\r\n");
- mir_getLP( &pluginInfo );
+ PreloadCLCModule();
- pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst);
- if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) {
+ pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst);
+ if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) {
LBL_Error:
- MessageBoxA( NULL, "This version of plugin requires Miranda IM 0.8.0.9 or later", "Fatal error", MB_OK );
- return 1;
- }
- if ( pcli->version < 6 )
- goto LBL_Error;
-
- pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu;
- pcli->pfnCalcEipPosition = CalcEipPosition;
- pcli->pfnCheckCacheItem = CheckPDNCE;
- pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
- pcli->pfnCompareContacts = CompareContacts;
- pcli->pfnCreateClcContact = fnCreateClcContact;
- pcli->pfnCreateCacheItem = fnCreateCacheItem;
- pcli->pfnFindItem = FindItem;
- pcli->pfnFreeCacheItem = FreeDisplayNameCacheItem;
- pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting;
- pcli->pfnGetRowsPriorTo = GetRowsPriorTo;
- pcli->pfnGetRowByIndex = GetRowByIndex;
- pcli->pfnHitTest = HitTest;
- pcli->pfnPaintClc = PaintClc;
- pcli->pfnRebuildEntireList = RebuildEntireList;
- pcli->pfnRecalcScrollBar = RecalcScrollBar;
- pcli->pfnScrollTo = ScrollTo;
-
- saveIconFromStatusMode = pcli->pfnIconFromStatusMode;
- pcli->pfnIconFromStatusMode = cli_IconFromStatusMode;
-
- saveAddGroup = pcli->pfnAddGroup; pcli->pfnAddGroup = AddGroup;
- saveAddInfoItemToGroup = pcli->pfnAddInfoItemToGroup; pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup;
- saveAddItemToGroup = pcli->pfnAddItemToGroup; pcli->pfnAddItemToGroup = AddItemToGroup;
- saveRemoveItemFromGroup = pcli->pfnRemoveItemFromGroup; pcli->pfnRemoveItemFromGroup = RemoveItemFromGroup;
- saveFreeContact = pcli->pfnFreeContact; pcli->pfnFreeContact = FreeContact;
- saveFreeGroup = pcli->pfnFreeGroup; pcli->pfnFreeGroup = FreeGroup;
- saveContactListControlWndProc = pcli->pfnContactListControlWndProc; pcli->pfnContactListControlWndProc = ContactListControlWndProc;
- saveTrayIconProcessMessage = pcli->pfnTrayIconProcessMessage; pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage;
- saveContactListWndProc = pcli->pfnContactListWndProc; pcli->pfnContactListWndProc = ContactListWndProc;
- saveLoadClcOptions = pcli->pfnLoadClcOptions; pcli->pfnLoadClcOptions = LoadClcOptions;
- saveSortCLC = pcli->pfnSortCLC; pcli->pfnSortCLC = SortCLC;
-
- memset(&SED,0,sizeof(SED));
- CreateServiceFunction(CLUI_SetDrawerService,SetDrawer);
-
- rc = LoadContactListModule();
- if (rc == 0) rc = LoadCLCModule();
-
- HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- BGModuleLoad();
-
- OutputDebugStringA("CListInitialise ClistMW...Done\r\n");
- }
- __except (exceptFunction(GetExceptionInformation()))
- {
- return 0;
+ MessageBoxA( NULL, "This version of plugin requires Miranda IM 0.8.0.9 or later", "Fatal error", MB_OK );
+ return 1;
}
+ if ( pcli->version < 6 )
+ goto LBL_Error;
+
+ pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu;
+ pcli->pfnCalcEipPosition = CalcEipPosition;
+ pcli->pfnCheckCacheItem = CheckPDNCE;
+ pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
+ pcli->pfnCompareContacts = CompareContacts;
+ pcli->pfnCreateClcContact = fnCreateClcContact;
+ pcli->pfnCreateCacheItem = fnCreateCacheItem;
+ pcli->pfnFindItem = FindItem;
+ pcli->pfnFreeCacheItem = FreeDisplayNameCacheItem;
+ pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting;
+ pcli->pfnGetRowsPriorTo = GetRowsPriorTo;
+ pcli->pfnGetRowByIndex = GetRowByIndex;
+ pcli->pfnHitTest = HitTest;
+ pcli->pfnPaintClc = PaintClc;
+ pcli->pfnRebuildEntireList = RebuildEntireList;
+ pcli->pfnRecalcScrollBar = RecalcScrollBar;
+ pcli->pfnScrollTo = ScrollTo;
+
+ saveIconFromStatusMode = pcli->pfnIconFromStatusMode;
+ pcli->pfnIconFromStatusMode = cli_IconFromStatusMode;
+
+ saveAddGroup = pcli->pfnAddGroup; pcli->pfnAddGroup = AddGroup;
+ saveAddInfoItemToGroup = pcli->pfnAddInfoItemToGroup; pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup;
+ saveAddItemToGroup = pcli->pfnAddItemToGroup; pcli->pfnAddItemToGroup = AddItemToGroup;
+ saveRemoveItemFromGroup = pcli->pfnRemoveItemFromGroup; pcli->pfnRemoveItemFromGroup = RemoveItemFromGroup;
+ saveFreeContact = pcli->pfnFreeContact; pcli->pfnFreeContact = FreeContact;
+ saveFreeGroup = pcli->pfnFreeGroup; pcli->pfnFreeGroup = FreeGroup;
+ saveContactListControlWndProc = pcli->pfnContactListControlWndProc; pcli->pfnContactListControlWndProc = ContactListControlWndProc;
+ saveTrayIconProcessMessage = pcli->pfnTrayIconProcessMessage; pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage;
+ saveContactListWndProc = pcli->pfnContactListWndProc; pcli->pfnContactListWndProc = ContactListWndProc;
+ saveLoadClcOptions = pcli->pfnLoadClcOptions; pcli->pfnLoadClcOptions = LoadClcOptions;
+ saveSortCLC = pcli->pfnSortCLC; pcli->pfnSortCLC = SortCLC;
+
+ memset(&SED,0,sizeof(SED));
+ CreateServiceFunction(CLUI_SetDrawerService,SetDrawer);
+
+ rc = LoadContactListModule();
+ if (rc == 0)
+ rc = LoadCLCModule();
+
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ BGModuleLoad();
+
+ OutputDebugStringA("CListInitialise ClistMW...Done\r\n");
return rc;
}