From 393c8dd0345138e00b6a5a1e13b06f60c83e02e8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Jun 2014 17:50:10 +0000 Subject: ansi popups dead git-svn-id: http://svn.miranda-ng.org/main/trunk@9433 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/mTextControl/src/main.cpp | 19 --------- plugins/mTextControl/src/services.cpp | 78 +++++++++-------------------------- plugins/mTextControl/src/services.h | 2 - 3 files changed, 20 insertions(+), 79 deletions(-) (limited to 'plugins/mTextControl/src') diff --git a/plugins/mTextControl/src/main.cpp b/plugins/mTextControl/src/main.cpp index a3573b27da..da32323cb0 100644 --- a/plugins/mTextControl/src/main.cpp +++ b/plugins/mTextControl/src/main.cpp @@ -48,9 +48,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRe return TRUE; } -static HANDLE hModulesLoaded = 0; -static int ModulesLoaded(WPARAM wParam,LPARAM lParam); - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfoEx; @@ -72,36 +69,20 @@ extern "C" __declspec(dllexport) int Load(void) GetProcAddress(hMsfteditDll, "CreateTextServices"); } -// LoadFancy(); LoadEmfCache(); LoadRichEdit(); LoadTextUsers(); LoadServices(); - //LoadOptions(); MTextControl_RegisterClass(); - hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); - return 0; -} - -static int ModulesLoaded(WPARAM wParam,LPARAM lParam) -{ -// char fn[MAX_PATH+1]; -// GetModuleFileName(hInst, fn, MAX_PATH); -// InitFancy(); -// InitIcons(icons, fn, iconCount); return 0; } extern "C" __declspec(dllexport) int Unload(void) { - UnhookEvent(hModulesLoaded); -// UnloadOptions(); - UnloadServices(); UnloadTextUsers(); UnloadRichEdit(); UnloadEmfCache(); -// UnloadFancy(); FreeLibrary(hMsfteditDll); return 0; } diff --git a/plugins/mTextControl/src/services.cpp b/plugins/mTextControl/src/services.cpp index 14ecd04c26..109431f846 100644 --- a/plugins/mTextControl/src/services.cpp +++ b/plugins/mTextControl/src/services.cpp @@ -116,29 +116,6 @@ INT_PTR MText_Register(WPARAM wParam, LPARAM lParam) return (INT_PTR)MTI_TextUserAdd(userTitle, userOptions); } -//--------------------------------------------------------------------------- -// allocate text object -HANDLE DLL_CALLCONV -MTI_MTextCreate (HANDLE userHandle, char *text) { - TextObject *result = new TextObject; - result->options = TextUserGetOptions(userHandle); - result->ftd = new CFormattedTextDraw; - result->ftd->Create(); - InitRichEdit(result->ftd->getTextService()); - - MText_InitFormatting0(result->ftd, result->options); - result->ftd->putTextA(text); - MText_InitFormatting1(result); - - return (HANDLE)result; -} - -INT_PTR MText_Create(WPARAM wParam, LPARAM lParam) { - //HANDLE userHandle = (HANDLE)wParam; - //char *text = (char *)lParam; - return (INT_PTR)MTI_MTextCreate ((HANDLE)wParam, (char *)lParam); -} - //--------------------------------------------------------------------------- // allocate text object (unicode) HANDLE DLL_CALLCONV @@ -332,18 +309,16 @@ INT_PTR MText_GetInterface(WPARAM wParam, LPARAM lParam) { if ( MText == NULL ) return CALLSERVICE_NOTFOUND; - MText->version = pluginInfoEx.version; - MText->Register = MTI_TextUserAdd; - MText->Create = MTI_MTextCreate; - MText->CreateW = MTI_MTextCreateW; -// MText->CreateT = defined inside api - MText->CreateEx = MTI_MTextCreateEx; - MText->Measure = MTI_MTextMeasure; - MText->Display = MTI_MTextDisplay; - MText->SetParent = MTI_MTextSetParent; - MText->SendMsg = MTI_MTextSendMessage; - MText->CreateProxy = MTI_MTextCreateProxy; - MText->Destroy = MTI_MTextDestroy; + MText->version = pluginInfoEx.version; + MText->Register = MTI_TextUserAdd; + MText->Create = MTI_MTextCreateW; + MText->CreateEx = MTI_MTextCreateEx; + MText->Measure = MTI_MTextMeasure; + MText->Display = MTI_MTextDisplay; + MText->SetParent = MTI_MTextSetParent; + MText->SendMsg = MTI_MTextSendMessage; + MText->CreateProxy = MTI_MTextCreateProxy; + MText->Destroy = MTI_MTextDestroy; return S_OK; } @@ -352,27 +327,14 @@ INT_PTR MText_GetInterface(WPARAM wParam, LPARAM lParam) { // Load / Unload services void LoadServices() { - int nService = 0; - hService[nService++] = CreateServiceFunction(MS_TEXT_REGISTER, MText_Register); - hService[nService++] = CreateServiceFunction(MS_TEXT_CREATE, MText_Create); -#ifdef UNICODE - hService[nService++] = CreateServiceFunction(MS_TEXT_CREATEW, MText_CreateW); -#endif - hService[nService++] = CreateServiceFunction(MS_TEXT_CREATEEX, MText_CreateEx); - hService[nService++] = CreateServiceFunction(MS_TEXT_MEASURE, MText_Measure); - hService[nService++] = CreateServiceFunction(MS_TEXT_DISPLAY, MText_Display); - hService[nService++] = CreateServiceFunction(MS_TEXT_SETPARENT, MText_SetParent); - hService[nService++] = CreateServiceFunction(MS_TEXT_SENDMESSAGE, MText_SendMessage); - hService[nService++] = CreateServiceFunction(MS_TEXT_CREATEPROXY, MText_CreateProxy); - hService[nService++] = CreateServiceFunction(MS_TEXT_DESTROY, MText_Destroy); - hService[nService++] = CreateServiceFunction(MS_TEXT_GETINTERFACE, MText_GetInterface); + CreateServiceFunction(MS_TEXT_REGISTER, MText_Register); + CreateServiceFunction(MS_TEXT_CREATEW, MText_CreateW); + CreateServiceFunction(MS_TEXT_CREATEEX, MText_CreateEx); + CreateServiceFunction(MS_TEXT_MEASURE, MText_Measure); + CreateServiceFunction(MS_TEXT_DISPLAY, MText_Display); + CreateServiceFunction(MS_TEXT_SETPARENT, MText_SetParent); + CreateServiceFunction(MS_TEXT_SENDMESSAGE, MText_SendMessage); + CreateServiceFunction(MS_TEXT_CREATEPROXY, MText_CreateProxy); + CreateServiceFunction(MS_TEXT_DESTROY, MText_Destroy); + CreateServiceFunction(MS_TEXT_GETINTERFACE, MText_GetInterface); } - -void UnloadServices() -{ - int nService = sizeof(hService)/sizeof(*hService); - while (nService--) - if (hService[nService]) - DestroyServiceFunction(hService[nService]); -} - diff --git a/plugins/mTextControl/src/services.h b/plugins/mTextControl/src/services.h index 7b7faac6ff..78a6793d1d 100644 --- a/plugins/mTextControl/src/services.h +++ b/plugins/mTextControl/src/services.h @@ -21,9 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define __services_h__ void LoadServices(); -void UnloadServices(); -__declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreate (HANDLE userHandle, char *text); __declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreateW (HANDLE userHandle, WCHAR *text); __declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreateEx (HANDLE userHandle, MCONTACT hContact, void *text, DWORD flags); __declspec(dllexport) int DLL_CALLCONV MTI_MTextMeasure (HDC dc, SIZE *sz, HANDLE text); -- cgit v1.2.3