diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-06-12 19:25:54 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-06-12 19:25:54 +0000 |
commit | b1a65d2ed1a74b0c4700f61e93232a3b0a32d3aa (patch) | |
tree | 95d73acbdee7c1f0632a6506b590062b6d9b8488 /plugins/SmileyAdd | |
parent | e74411f50d715f467a378ae77d8feee11d03a1a2 (diff) |
Smileyadd deprecated header moved
git-svn-id: http://svn.miranda-ng.org/main/trunk@9440 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd')
-rw-r--r-- | plugins/SmileyAdd/src/general.h | 1 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/main.cpp | 4 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/services.cpp | 131 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/smileyroutines.cpp | 2 |
4 files changed, 9 insertions, 129 deletions
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h index 5abb9aeddd..7497c25396 100644 --- a/plugins/SmileyAdd/src/general.h +++ b/plugins/SmileyAdd/src/general.h @@ -64,7 +64,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_metacontacts.h>
#include <m_smileyadd.h>
-#include <m_smileyadd_deprecated.h>
#include <m_folders.h>
#include "regexp\wcpattern.h"
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 82e90f56bc..30d45f33fc 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -107,18 +107,14 @@ extern "C" __declspec(dllexport) int Load(void) //create the smiley services
CreateServiceFunction(MS_SMILEYADD_REPLACESMILEYS, ReplaceSmileysCommand);
- CreateServiceFunction(MS_SMILEYADD_GETSMILEYICON, GetSmileyIconCommand);
CreateServiceFunction(MS_SMILEYADD_SHOWSELECTION, ShowSmileySelectionCommand);
- CreateServiceFunction(MS_SMILEYADD_GETINFO, GetInfoCommand);
CreateServiceFunction(MS_SMILEYADD_GETINFO2, GetInfoCommand2);
- CreateServiceFunction(MS_SMILEYADD_PARSE, ParseText);
CreateServiceFunction(MS_SMILEYADD_REGISTERCATEGORY, RegisterPack);
CreateServiceFunction(MS_SMILEYADD_BATCHPARSE, ParseTextBatch);
CreateServiceFunction(MS_SMILEYADD_BATCHFREE, FreeTextBatch);
CreateServiceFunction(MS_SMILEYADD_CUSTOMCATMENU, CustomCatMenu);
CreateServiceFunction(MS_SMILEYADD_RELOAD, ReloadPack);
CreateServiceFunction(MS_SMILEYADD_LOADCONTACTSMILEYS, LoadContactSmileys);
- CreateServiceFunction(MS_SMILEYADD_PARSEW, ParseTextW);
return 0;
}
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 776c07415e..0a591ae1ab 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -73,7 +73,7 @@ SmileyPackType* GetSmileyPack(const char* proto, MCONTACT hContact, SmileyPackCT INT_PTR ReplaceSmileysCommand(WPARAM, LPARAM lParam)
{
SMADD_RICHEDIT3* smre = (SMADD_RICHEDIT3*) lParam;
- if (smre == NULL || smre->cbSize < SMADD_RICHEDIT_SIZE_V1)
+ if (smre == NULL)
return FALSE;
SMADD_RICHEDIT3 smrec = {0};
@@ -98,9 +98,9 @@ INT_PTR ShowSmileySelectionCommand(WPARAM, LPARAM lParam) {
SMADD_SHOWSEL3* smaddInfo = (SMADD_SHOWSEL3*) lParam;
- if (smaddInfo == NULL || smaddInfo->cbSize < SMADD_SHOWSEL_SIZE_V1) return FALSE;
- HWND parent = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V1 ? smaddInfo->hwndParent : NULL;
- MCONTACT hContact = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V2 ? smaddInfo->hContact : NULL;
+ if (smaddInfo == NULL) return FALSE;
+ HWND parent = smaddInfo->hwndParent;
+ MCONTACT hContact = smaddInfo->hContact;
SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
stwp->pSmileyPack = GetSmileyPack(smaddInfo->Protocolname, hContact);
@@ -119,43 +119,11 @@ INT_PTR ShowSmileySelectionCommand(WPARAM, LPARAM lParam) return TRUE;
}
-INT_PTR GetSmileyIconCommand(WPARAM, LPARAM lParam)
-{
- SMADD_GETICON* smre = (SMADD_GETICON*) lParam;
-
- if (smre == NULL || smre->cbSize < sizeof(SMADD_GETICON)) return FALSE;
-
- SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname);
-
- if (SmileyPack == NULL || IsBadStringPtrA(smre->SmileySequence, MAX_SMILEY_LENGTH)) {
- smre->SmileyIcon = NULL;
- smre->Smileylength = 0;
- return FALSE;
- }
-
- unsigned start, size;
- SmileyType* sml;
- FindSmileyInText(SmileyPack, A2T_SM(smre->SmileySequence), start, size, &sml);
-
- if (size == 0 || start != 0)
- {
- smre->SmileyIcon = NULL;
- smre->Smileylength = 0;
- }
- else
- {
- smre->SmileyIcon = sml->GetIcon();
- smre->Smileylength = size;
- }
-
- return TRUE;
-}
-
static int GetInfoCommandE(SMADD_INFO2* smre, bool retDup)
{
- if (smre == NULL || smre->cbSize < SMADD_INFO_SIZE_V1) return FALSE;
- MCONTACT hContact = smre->cbSize > SMADD_INFO_SIZE_V1 ? smre->hContact : NULL;
+ if (smre == NULL) return FALSE;
+ MCONTACT hContact = smre->hContact;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact);
@@ -193,96 +161,13 @@ INT_PTR GetInfoCommand2(WPARAM, LPARAM lParam) }
-INT_PTR ParseText(WPARAM, LPARAM lParam)
-{
- SMADD_PARSE* smre = (SMADD_PARSE*) lParam;
-
- if (smre == NULL || smre->cbSize < sizeof(SMADD_PARSE)) return FALSE;
-
- SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname);
-
- if (SmileyPack == NULL)
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- unsigned strtChrOff = smre->startChar + smre->size;
- char* workstr = smre->str + strtChrOff;
-
- if (strtChrOff > 1024 || IsBadStringPtrA(workstr, 10))
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- SmileyType* sml;
- FindSmileyInText(SmileyPack, A2T_SM(workstr), smre->startChar, smre->size, &sml);
-
- if (smre->size == 0)
- {
- smre->SmileyIcon = NULL;
- }
- else
- {
- smre->SmileyIcon = sml->GetIconDup();
- smre->startChar += strtChrOff;
- }
-
- return TRUE;
-}
-
-
-INT_PTR ParseTextW(WPARAM, LPARAM lParam)
-{
- SMADD_PARSEW* smre = (SMADD_PARSEW*) lParam;
-
- if (smre == NULL || smre->cbSize < sizeof(SMADD_PARSEW)) return FALSE;
-
- SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname);
-
- if (SmileyPack == NULL)
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- unsigned strtChrOff = smre->startChar + smre->size;
- wchar_t* workstr = smre->str + strtChrOff;
-
- if (strtChrOff > 1024 || IsBadStringPtrW(workstr, 10))
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- SmileyType* sml;
- FindSmileyInText(SmileyPack, workstr, smre->startChar, smre->size, &sml);
-
- if (smre->size == 0)
- {
- smre->SmileyIcon = NULL;
- }
- else
- {
- smre->SmileyIcon = sml->GetIconDup();
- smre->startChar += strtChrOff;
- }
-
- return TRUE;
-}
-
INT_PTR ParseTextBatch(WPARAM, LPARAM lParam)
{
SMADD_BATCHPARSE2* smre = (SMADD_BATCHPARSE2*) lParam;
- if (smre == NULL || smre->cbSize < SMADD_BATCHPARSE_SIZE_V1) return FALSE;
- MCONTACT hContact = smre->cbSize > SMADD_BATCHPARSE_SIZE_V1 ? smre->hContact : NULL;
+ if (smre == NULL) return FALSE;
+ MCONTACT hContact = smre->hContact;
SmileyPackCType* smcp = NULL;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact,
diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp index cdabaa712a..268a65cef4 100644 --- a/plugins/SmileyAdd/src/smileyroutines.cpp +++ b/plugins/SmileyAdd/src/smileyroutines.cpp @@ -67,7 +67,7 @@ void LookupAllSmileys(SmileyPackType* smileyPack, SmileyPackCType* smileyCPack, memset(csmlit, 0, smlsz * sizeof(int));
long numCharsSoFar = 0;
- int smloff = 0;
+ size_t smloff = 0;
while (true) {
int firstSml = -1;
|