From 25221b7d2afb70f82eb3805330fd39a6f6708049 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jun 2012 23:41:55 +0000 Subject: mk: removed all LIST_INTERFACE, MI_INTERFACE & UTF8_INTERFACE instances. all related functions moved to mir_core. git-svn-id: http://svn.miranda-ng.org/main/trunk@644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/QuickMessages/Utils.cpp | 18 ++++++++--------- plugins/QuickMessages/main.cpp | 37 +++++++++++++++-------------------- plugins/QuickMessages/options.cpp | 6 +++--- plugins/QuickMessages/quickmessages.h | 5 ----- 4 files changed, 28 insertions(+), 38 deletions(-) (limited to 'plugins/QuickMessages') diff --git a/plugins/QuickMessages/Utils.cpp b/plugins/QuickMessages/Utils.cpp index 01b020228c..9531268524 100644 --- a/plugins/QuickMessages/Utils.cpp +++ b/plugins/QuickMessages/Utils.cpp @@ -58,7 +58,7 @@ void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor) int i=0; if (!pList) return; for (i=0; irealCount; i++) pItemDestructor(pList->items[i]); - li.List_Destroy(pList); + List_Destroy(pList); mir_free(pList); } @@ -67,13 +67,13 @@ void li_RemoveDestruct(SortedList *pList, int index, ItemDestuctor pItemDestruct if (index>=0 && indexrealCount) { pItemDestructor(pList->items[index]); - li.List_Remove(pList, index); + List_Remove(pList, index); } } void li_RemovePtrDestruct(SortedList *pList, void * ptr, ItemDestuctor pItemDestructor) { - if (li.List_RemovePtr(pList, ptr)) + if (List_RemovePtr(pList, ptr)) pItemDestructor(ptr); } @@ -105,7 +105,7 @@ void li_ZeroQuickList(SortedList *pList) qd->bIsService=0; qd->ptszValue=NULL; qd->ptszValueName=NULL; - li.List_Remove(pList, i); + List_Remove(pList, i); i--; } } @@ -269,7 +269,7 @@ DWORD BalanceButtons(int buttonsWas,int buttonsNow) void InitButtonsList() { int i,j,k=0; - QuickList=li.List_Create(0,1); + QuickList=List_Create(0,1); for(i=0;isl=li.List_Create(0,1); + ld->sl=List_Create(0,1); ld->ptszQValue=ld->ptszOPQValue=getMenuEntry(i,0,2); ld->ptszButtonName=pszBName; ld->dwPos=ld->dwOPPos=i; @@ -309,9 +309,9 @@ void InitButtonsList() qd->dwPos=k++; qd->ptszValue=bd->pszValue; qd->ptszValueName=bd->pszName; - li.List_InsertPtr(QuickList,qd); + List_InsertPtr(QuickList,qd); } - li.List_InsertPtr((SortedList*)ld->sl,bd); + List_InsertPtr((SortedList*)ld->sl,bd); } } @@ -333,7 +333,7 @@ while(ButtonsList[i]) if(QuickList) { li_ZeroQuickList(QuickList); - li.List_Destroy(QuickList); + List_Destroy(QuickList); } } diff --git a/plugins/QuickMessages/main.cpp b/plugins/QuickMessages/main.cpp index a4c6684b10..da0171a8f2 100644 --- a/plugins/QuickMessages/main.cpp +++ b/plugins/QuickMessages/main.cpp @@ -28,15 +28,12 @@ hEventDbPreShutdown; HICON hIcon; int g_iButtonsCount=0; -int g_bShutDown=0; +int g_bShutDown=0; int g_bStartup=0; BOOL g_bRClickAuto=0; BOOL g_bLClickAuto=0; BOOL g_bQuickMenu=0; -struct MM_INTERFACE mmi; -struct LIST_INTERFACE li; - PLUGINLINK *pluginLink; int hLangpack; @@ -50,13 +47,13 @@ PLUGININFOEX pluginInfo = { "© 2008 Danil Mozhar", "http://miranda.radicaled.ru/index.php?plugin=3", UNICODE_AWARE, - 0, + 0, // {37ED754B-6CF9-40ed-9EB6-0FEF8E822475} { 0x37ed754b, 0x6cf9, 0x40ed, { 0x9e, 0xb6, 0xf, 0xef, 0x8e, 0x82, 0x24, 0x75 } } }; int PreShutdown(WPARAM wparam,LPARAM lparam) -{ +{ g_bShutDown=1; DestructButtonsList(); @@ -83,7 +80,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam) InsertMenu((HMENU)mwpd->hMenu,6,MF_STRING|MF_POPUP|MF_BYPOSITION,(UINT_PTR)hSubMenu,TranslateT("Quick Messages")); InsertMenu((HMENU)mwpd->hMenu,7,MF_SEPARATOR|MF_BYPOSITION,0,0); - qsort(QuickList->items,QuickList->realCount,sizeof(QuickData *),sstQuickSortButtons); + qsort(QuickList->items,QuickList->realCount,sizeof(QuickData *),sstQuickSortButtons); for(i=0;irealCount;i++) { QuickData* qd= (QuickData *)QuickList->items[i]; @@ -110,7 +107,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam) if(IsClipboardFormatAvailable(CF_TEXT)) { if (OpenClipboard(mwpd->hwnd)) { HANDLE hData=NULL; - TCHAR* chBuffer=NULL; + TCHAR* chBuffer=NULL; int textLength=0; hData= GetClipboardData(CF_UNICODETEXT); @@ -122,10 +119,10 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam) CloseClipboard(); } } - - SendMessage(mwpd->hwnd, EM_EXGETSEL, 0, (LPARAM)&cr); + + SendMessage(mwpd->hwnd, EM_EXGETSEL, 0, (LPARAM)&cr); textlenght=cr.cpMax-cr.cpMin; - + if(textlenght) { pszText = (TCHAR *)mir_alloc((textlenght+10)*sizeof(TCHAR)); @@ -177,7 +174,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) if(strcmp(cbcd->pszModule,PLGNAME)) return 0; if (!ButtonsList[cbcd->dwButtonId]) return 1; - + sl=ButtonsList[cbcd->dwButtonId]->sl; if (!sl) return 1; @@ -185,7 +182,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) if(IsClipboardFormatAvailable(CF_TEXT)) { if (OpenClipboard(cbcd->hwndFrom)) { HANDLE hData=NULL; - TCHAR* chBuffer=NULL; + TCHAR* chBuffer=NULL; int textLength=0; hData= GetClipboardData(CF_UNICODETEXT); @@ -201,13 +198,13 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) - qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstSortButtons); + qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstSortButtons); hEdit=GetDlgItem(cbcd->hwndFrom,IDC_MESSAGE); if (!hEdit) hEdit=GetDlgItem(cbcd->hwndFrom,IDC_CHATMESSAGE); cr.cpMin = cr.cpMax = 0; - SendMessage(hEdit, EM_EXGETSEL, 0, (LPARAM)&cr); + SendMessage(hEdit, EM_EXGETSEL, 0, (LPARAM)&cr); textlenght=cr.cpMax-cr.cpMin; if(textlenght) @@ -221,7 +218,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) state=1; else if(sl->realCount==1) state=2; - else + else state=3; @@ -244,7 +241,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) if ((bIsService=bd->bIsServName)&&ptszQValue) CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0); - + } } break; @@ -308,7 +305,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) } free(ptszQValue); } - + if(pszText) mir_free(pszText); if(pszCBText) mir_free(pszCBText); @@ -320,7 +317,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) { g_bStartup=1; hEventDbOptionsInit=HookEvent(ME_OPT_INITIALISE,OptionsInit); - hEventCBButtonPressed=HookEvent(ME_MSG_BUTTONPRESSED,CustomButtonPressed); + hEventCBButtonPressed=HookEvent(ME_MSG_BUTTONPRESSED,CustomButtonPressed); hEventCBInit=HookEvent(ME_MSG_TOOLBARLOADED,RegisterCustomButton); hEventInputMenu=HookEvent(ME_MSG_WINDOWPOPUP,InputMenuPopup); @@ -375,8 +372,6 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) { pluginLink=link; - mir_getMMI(&mmi); - mir_getLI(&li); mir_getLP(&pluginInfo); hEventDbPluginsLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,PluginInit); diff --git a/plugins/QuickMessages/options.cpp b/plugins/QuickMessages/options.cpp index ab369abfd0..4527e1c858 100644 --- a/plugins/QuickMessages/options.cpp +++ b/plugins/QuickMessages/options.cpp @@ -321,7 +321,7 @@ void SaveMenuTree(HWND hdlg) qd->bIsService=bd->bIsServName; qd->ptszValue=bd->pszValue; qd->ptszValueName=bd->pszName; - li.List_InsertPtr(QuickList,qd); + List_InsertPtr(QuickList,qd); } SaveModuleSettings(iBl,bd); @@ -1003,7 +1003,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) ld = (ListData *)mir_alloc(sizeof(ListData)); ButtonsList[g_iOPButtonsCount++]=ld; - ld->sl=li.List_Create(0,1); + ld->sl=List_Create(0,1); ld->dwOPFlags=QMF_NEW; ld->bIsOpServName=0; ld->ptszButtonName=NULL; @@ -1079,7 +1079,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) sl=((ListData*)tvi.lParam)->sl; - li.List_InsertPtr(sl,bd); + List_InsertPtr(sl,bd); tvis.hParent = NULL; tvis.hInsertAfter = TVI_LAST; diff --git a/plugins/QuickMessages/quickmessages.h b/plugins/QuickMessages/quickmessages.h index 51f5f247d5..5de5f0eb52 100644 --- a/plugins/QuickMessages/quickmessages.h +++ b/plugins/QuickMessages/quickmessages.h @@ -49,7 +49,6 @@ along with this program. If not, see . #define MODULENAME "Quick Messages" #define PLGNAME "QuickMessages" -extern struct LIST_INTERFACE li; extern HINSTANCE hinstance; extern HICON hIcon; extern ListData* ButtonsList[100]; @@ -85,7 +84,3 @@ int OptionsInit(WPARAM,LPARAM); #define QMESSAGES_UPDATE_URL "http://miranda.radicaled.ru/public/quickmessages/"QMESSAGES_NAME".zip" #define QMESSAGES_VERSION_PREFIX "QuickMessages " - - - - -- cgit v1.2.3