diff options
Diffstat (limited to 'plugins/IEView')
-rw-r--r-- | plugins/IEView/SRMMHTMLBuilder.cpp | 10 | ||||
-rw-r--r-- | plugins/IEView/Template.cpp | 13 | ||||
-rw-r--r-- | plugins/IEView/TemplateHTMLBuilder.cpp | 43 | ||||
-rw-r--r-- | plugins/IEView/ieview_common.h | 20 |
4 files changed, 36 insertions, 50 deletions
diff --git a/plugins/IEView/SRMMHTMLBuilder.cpp b/plugins/IEView/SRMMHTMLBuilder.cpp index 303cae44e1..fd3ca560de 100644 --- a/plugins/IEView/SRMMHTMLBuilder.cpp +++ b/plugins/IEView/SRMMHTMLBuilder.cpp @@ -1,7 +1,7 @@ /*
IEView Plugin for Miranda IM
-Copyright (C) 2005-2008 Piotr Piastucki
+Copyright (C) 2005-2008 Piotr Piastucki
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -10,12 +10,12 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "SRMMHTMLBuilder.h"
@@ -143,7 +143,7 @@ void SRMMHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { bkgColor= (((bkgColor & 0xFF) << 16) | (bkgColor & 0xFF00) | ((bkgColor & 0xFF0000) >> 16));
inColor = outColor = bkgColor;
if (protoSettings->getSRMMFlags() & Options::LOG_IMAGE_ENABLED) {
- Utils::appendText(&output, &outputSize, ".body {margin: 0px; text-align: left; background-attachment: %s; background-color: #%06X; background-image: url('%s'); overflow: auto;}\n",
+ Utils::appendText(&output, &outputSize, ".body {margin: 0px; text-align: left; background-attachment: %s; background-color: #%06X; background-image: url('%s'); overflow: auto;}\n",
protoSettings->getSRMMFlags() & Options::LOG_IMAGE_SCROLL ? "scroll" : "fixed", (int) bkgColor, protoSettings->getSRMMBackgroundFilename());
} else {
Utils::appendText(&output, &outputSize, ".body {margin: 0px; text-align: left; background-color: #%06X; overflow: auto;}\n",
@@ -163,7 +163,7 @@ void SRMMHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { Utils::appendText(&output, &outputSize, "%s {font-family: %s; font-size: %dpt; font-weight: %s; color: #%06X; %s }\n",
classNames[i],
lf.lfFaceName,
- abs((signed char)lf.lfHeight) * 74 /logPixelSY ,
+ abs((signed char)lf.lfHeight) * 74 /logPixelSY ,
lf.lfWeight >= FW_BOLD ? "bold" : "normal",
(int)(((color & 0xFF) << 16) | (color & 0xFF00) | ((color & 0xFF0000) >> 16)),
lf.lfItalic ? "font-style: italic;" : "");
diff --git a/plugins/IEView/Template.cpp b/plugins/IEView/Template.cpp index 9d6ce5246e..940efa8bfd 100644 --- a/plugins/IEView/Template.cpp +++ b/plugins/IEView/Template.cpp @@ -1,7 +1,7 @@ /*
IEView Plugin for Miranda IM
-Copyright (C) 2005-2010 Piotr Piastucki
+Copyright (C) 2005-2010 Piotr Piastucki
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -10,12 +10,12 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "Template.h"
@@ -321,7 +321,6 @@ static TokenDef templateNames[] = { TokenDef("<!--hMessageOutGroupEndRTL-->")
};
-
TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, bool onlyInfo) {
FILE* fh;
char lastTemplate[1024], tmp2[1024];
@@ -367,11 +366,11 @@ TemplateMap* TemplateMap::loadTemplateFile(const char *id, const char *filename, } else if (wasTemplate) {
Utils::appendText(&templateText, &templateTextSize, "%s", store);
}
- }
- if (wasTemplate) {
+ }
+ if (wasTemplate) {
tmap->addTemplate(lastTemplate, templateText);
}
- fclose(fh);
+ fclose(fh);
static const char *groupTemplates[] = {"MessageInGroupStart", "MessageInGroupInner",
"hMessageInGroupStart", "hMessageInGroupInner",
"MessageOutGroupStart", "MessageOutGroupInner",
diff --git a/plugins/IEView/TemplateHTMLBuilder.cpp b/plugins/IEView/TemplateHTMLBuilder.cpp index 7c8ce86562..11892151b0 100644 --- a/plugins/IEView/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/TemplateHTMLBuilder.cpp @@ -1,7 +1,7 @@ /*
IEView Plugin for Miranda IM
-Copyright (C) 2005-2010 Piotr Piastucki
+Copyright (C) 2005-2010 Piotr Piastucki
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -10,21 +10,16 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "TemplateHTMLBuilder.h"
-#include <io.h>
-#include <fcntl.h>
-#include "Utils.h"
-#include "m_avatars.h"
-
#define EVENTTYPE_STATUSCHANGE 25368
TemplateHTMLBuilder::TemplateHTMLBuilder() {
@@ -52,7 +47,7 @@ char *TemplateHTMLBuilder::getAvatar(HANDLE hContact, const char * szProto) { TCHAR *result = NULL;
if (Options::getAvatarServiceFlags() == Options::AVATARSERVICE_PRESENT) {
- struct avatarCacheEntry *ace = NULL;
+ struct avatarCacheEntry *ace = NULL;
if (hContact == NULL) {
ace = (struct avatarCacheEntry *)CallService(MS_AV_GETMYAVATAR, (WPARAM)0, (LPARAM)szProto);
} else {
@@ -106,7 +101,7 @@ const char *TemplateHTMLBuilder::getFlashAvatar(const TCHAR *file, int index) { _close(src);
urlBuf = strstr(pBuf, "<URL>");
if(urlBuf) {
- flashAvatars[index] = Utils::dupString(strtok(urlBuf + 5, "<\t\n\r"));
+ flashAvatars[index] = Utils::dupString(strtok(urlBuf + 5, "<\t\n\r"));
}
}
}
@@ -285,7 +280,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr }
if (tokenVal != NULL) {
if (token->getEscape()) {
- char *escapedToken = Utils::escapeString(tokenVal);
+ char *escapedToken = Utils::escapeString(tokenVal);
Utils::appendText(&output, &outputSize, "%s", escapedToken);
delete escapedToken;
} else {
@@ -418,11 +413,11 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, char *output;
output = NULL;
if (eventData->iType == IEED_EVENT_MESSAGE || eventData->iType == IEED_EVENT_STATUSCHANGE || eventData->iType == IEED_EVENT_FILE || eventData->iType == IEED_EVENT_URL || eventData->iType == IEED_EVENT_SYSTEM) {
- int isSent = (eventData->dwFlags & IEEDF_SENT);
- int isRTL = (eventData->dwFlags & IEEDF_RTL) && tmpm->isRTL();
- int isHistory = (eventData->time < (DWORD)getStartedTime() && (eventData->dwFlags & IEEDF_READ || eventData->dwFlags & IEEDF_SENT));
- int isGroupBreak = TRUE;
- if ((getFlags(protoSettings) & Options::LOG_GROUP_MESSAGES) && eventData->dwFlags == LOWORD(getLastEventType())
+ bool isSent = (eventData->dwFlags & IEEDF_SENT) != 0;
+ bool isRTL = (eventData->dwFlags & IEEDF_RTL) && tmpm->isRTL();
+ bool isHistory = (eventData->time < (DWORD)getStartedTime() && (eventData->dwFlags & IEEDF_READ || eventData->dwFlags & IEEDF_SENT));
+ bool isGroupBreak = TRUE;
+ if ((getFlags(protoSettings) & Options::LOG_GROUP_MESSAGES) && eventData->dwFlags == LOWORD(getLastEventType())
&& eventData->iType == IEED_EVENT_MESSAGE && HIWORD(getLastEventType()) == IEED_EVENT_MESSAGE
&& (isSameDate(eventData->time, getLastEventTime()))
// && ((eventData->time < today) == (getLastEventTime() < today))
@@ -451,12 +446,12 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, }
if (eventData->dwFlags & IEEDF_UNICODE_TEXT) {
szText = encodeUTF8(event->hContact, szRealProto, eventData->pszTextW, eventData->iType == IEED_EVENT_MESSAGE ? ENF_ALL : 0, isSent);
- } else {
+ } else {
szText = encodeUTF8(event->hContact, szRealProto, eventData->pszText, event->codepage, eventData->iType == IEED_EVENT_MESSAGE ? ENF_ALL : 0, isSent);
}
if (eventData->dwFlags & IEEDF_UNICODE_TEXT2) {
szFileDesc = encodeUTF8(event->hContact, szRealProto, eventData->pszText2W, 0, isSent);
- } else {
+ } else {
szFileDesc = encodeUTF8(event->hContact, szRealProto, eventData->pszText2, event->codepage, 0, isSent);
}
if ((eventData->iType == IEED_EVENT_MESSAGE)) {
@@ -532,13 +527,13 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, tokenVal = " ";
}
break;
- case Token::TEXT:
+ case Token::TEXT:
tokenVal = szText;
break;
- case Token::AVATAR:
+ case Token::AVATAR:
tokenVal = szAvatar;
break;
- case Token::CID:
+ case Token::CID:
tokenVal = szCID;
break;
case Token::BASE:
@@ -599,7 +594,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, }
if (tokenVal != NULL) {
if (token->getEscape()) {
- char *escapedToken = Utils::escapeString(tokenVal);
+ char *escapedToken = Utils::escapeString(tokenVal);
Utils::appendText(&output, &outputSize, "%s", escapedToken);
delete escapedToken;
} else {
@@ -637,6 +632,4 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, time_t TemplateHTMLBuilder::getStartedTime() {
return startedTime;
-}
-
-
+}
\ No newline at end of file diff --git a/plugins/IEView/ieview_common.h b/plugins/IEView/ieview_common.h index a403121279..e2dac48cee 100644 --- a/plugins/IEView/ieview_common.h +++ b/plugins/IEView/ieview_common.h @@ -19,13 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifdef __MINGW32__
- #define WINVER 0x500
- #define _WIN32_IE 0x500
- #define __try
- #define __except(a)
-#endif
-
#ifndef IEVIEW_COMMON_H
#define IEVIEW_COMMON_H
@@ -39,13 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <process.h>
#include <shlguid.h>
#include <oleauto.h>
-#ifdef __MINGW32__
- #include <exdisp.h>
- #include <servprov.h>
-#endif
#include <mshtml.h>
-
-#include <win2k.h>
+#include <io.h>
+#include <fcntl.h>
#include <newpluginapi.h>
#include <m_utils.h>
@@ -59,9 +48,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_skin.h>
#include <m_message.h>
#include <m_contacts.h>
+#include <win2k.h>
+#include "m_avatars.h"
+
#include "m_smileyadd.h"
#include "m_ieview.h"
+
#include "IEView.h"
+#include "Utils.h"
extern HINSTANCE hInstance;
extern IEView *debugView;
|