summaryrefslogtreecommitdiff
path: root/plugins/Boltun/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Boltun/src')
-rw-r--r--plugins/Boltun/src/Engine/CriticalSection.h2
-rw-r--r--plugins/Boltun/src/Engine/Mind.cpp10
-rw-r--r--plugins/Boltun/src/Engine/Mind.h2
-rw-r--r--plugins/Boltun/src/Engine/MyCodeCvt.cpp2
-rw-r--r--plugins/Boltun/src/Engine/MyCodeCvt.h4
-rw-r--r--plugins/Boltun/src/Engine/PerContactData.h4
-rw-r--r--plugins/Boltun/src/Engine/TalkEngine.cpp4
-rw-r--r--plugins/Boltun/src/Engine/UnrecentChooser.cpp18
-rw-r--r--plugins/Boltun/src/Engine/UnrecentChooser.h5
-rw-r--r--plugins/Boltun/src/Engine/ValueChooser.h3
-rw-r--r--plugins/Boltun/src/Engine/WordsList.cpp2
-rw-r--r--plugins/Boltun/src/Engine/WordsList.h4
-rw-r--r--plugins/Boltun/src/actionQueue.h2
-rw-r--r--plugins/Boltun/src/boltun.cpp23
-rw-r--r--plugins/Boltun/src/boltun.h44
-rw-r--r--plugins/Boltun/src/config.h2
-rw-r--r--plugins/Boltun/src/stdafx.cpp18
17 files changed, 66 insertions, 83 deletions
diff --git a/plugins/Boltun/src/Engine/CriticalSection.h b/plugins/Boltun/src/Engine/CriticalSection.h
index 59bc91beb9..550aa32696 100644
--- a/plugins/Boltun/src/Engine/CriticalSection.h
+++ b/plugins/Boltun/src/Engine/CriticalSection.h
@@ -21,8 +21,6 @@
#ifndef CriticalSectionH
#define CriticalSectionH
-#include <windows.h>
-
class CriticalSection
{
CRITICAL_SECTION csQueue;
diff --git a/plugins/Boltun/src/Engine/Mind.cpp b/plugins/Boltun/src/Engine/Mind.cpp
index fc4520de55..6f558e002b 100644
--- a/plugins/Boltun/src/Engine/Mind.cpp
+++ b/plugins/Boltun/src/Engine/Mind.cpp
@@ -18,15 +18,7 @@
//
//***********************************************************
-#include "Mind.h"
-#include <fstream>
-#include <algorithm>
-#include "tstring.h"
-#include "assert.h"
-
-#include <windows.h>
-
-#include "MyCodeCvt.h"
+#include "..\boltun.h"
using namespace std;
diff --git a/plugins/Boltun/src/Engine/Mind.h b/plugins/Boltun/src/Engine/Mind.h
index 23e0a41bd3..cdee200002 100644
--- a/plugins/Boltun/src/Engine/Mind.h
+++ b/plugins/Boltun/src/Engine/Mind.h
@@ -21,12 +21,10 @@
#ifndef MindH
#define MindH
-#include <string>
#include <vector>
#include <map>
#include <set>
#include "WordsList.h"
-#include <tchar.h>
#include "tstring.h"
diff --git a/plugins/Boltun/src/Engine/MyCodeCvt.cpp b/plugins/Boltun/src/Engine/MyCodeCvt.cpp
index 5d7baf4d88..e34575f811 100644
--- a/plugins/Boltun/src/Engine/MyCodeCvt.cpp
+++ b/plugins/Boltun/src/Engine/MyCodeCvt.cpp
@@ -18,7 +18,7 @@
//
//***********************************************************
-#include "MyCodeCvt.h"
+#include "..\boltun.h"
using namespace std;
diff --git a/plugins/Boltun/src/Engine/MyCodeCvt.h b/plugins/Boltun/src/Engine/MyCodeCvt.h
index b4508c66de..40ca093795 100644
--- a/plugins/Boltun/src/Engine/MyCodeCvt.h
+++ b/plugins/Boltun/src/Engine/MyCodeCvt.h
@@ -21,10 +21,6 @@
#ifndef MYCODECVT_H
#define MYCODECVT_H
-#include <locale>
-#include <xlocale>
-#include <cwchar>
-
typedef std::codecvt<wchar_t, char, std::mbstate_t> MyCodeCvtBase;
class MyCodeCvt
diff --git a/plugins/Boltun/src/Engine/PerContactData.h b/plugins/Boltun/src/Engine/PerContactData.h
index 14b17784b9..d130a03838 100644
--- a/plugins/Boltun/src/Engine/PerContactData.h
+++ b/plugins/Boltun/src/Engine/PerContactData.h
@@ -21,10 +21,6 @@
#ifndef PerContactDataH
#define PerContactDataH
-#include <map>
-#include <time.h>
-#include <assert.h>
-
#include "CriticalSection.h"
static std::map<unsigned, void*> perContactDataObjects;
diff --git a/plugins/Boltun/src/Engine/TalkEngine.cpp b/plugins/Boltun/src/Engine/TalkEngine.cpp
index 550aac66cf..0c711ab652 100644
--- a/plugins/Boltun/src/Engine/TalkEngine.cpp
+++ b/plugins/Boltun/src/Engine/TalkEngine.cpp
@@ -18,9 +18,7 @@
//
//***********************************************************
-#include "TalkEngine.h"
-#include <fstream>
-#include <windows.h>
+#include "..\boltun.h"
#ifdef _DEBUG
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.cpp b/plugins/Boltun/src/Engine/UnrecentChooser.cpp
index b2e5303f5a..d11806503b 100644
--- a/plugins/Boltun/src/Engine/UnrecentChooser.cpp
+++ b/plugins/Boltun/src/Engine/UnrecentChooser.cpp
@@ -18,12 +18,12 @@
//
//***********************************************************
-#include "UnrecentChooser.h"
+#include "..\boltun.h"
using namespace std;
UnRecentChooser::UnRecentChooser()
- :last(-1), min(-1), newItemsPrio(-1), maxOldPrio(-1)
+ :last(-1), minimum(-1), newItemsPrio(-1), maxOldPrio(-1)
{
}
@@ -34,8 +34,8 @@ void UnRecentChooser::AddChoice(tstring value, float prio)
int val = (int)items[value];
oldItems.insert(make_pair(val, value));
oldPrios.insert(make_pair(value, prio));
- if (min > val || min == -1)
- min = val;
+ if (minimum > val || minimum == -1)
+ minimum = val;
if (maxOldPrio < prio)
maxOldPrio = prio;
}
@@ -59,17 +59,17 @@ tstring UnRecentChooser::Choose()
res = newItems[num];
}
else
- if (min == -1)
+ if (minimum == -1)
res = _T("");
else
{
float minprio = maxOldPrio / 1.5F;
- while (oldPrios[oldItems[min]] < minprio)
- min++;
- res = oldItems[min];
+ while (oldPrios[oldItems[minimum]] < minprio)
+ minimum++;
+ res = oldItems[minimum];
}
//Clean items
- min = -1;
+ minimum = -1;
newItemsPrio = -1;
maxOldPrio = -1;
oldItems.clear();
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.h b/plugins/Boltun/src/Engine/UnrecentChooser.h
index 91a961e307..e815a6ec96 100644
--- a/plugins/Boltun/src/Engine/UnrecentChooser.h
+++ b/plugins/Boltun/src/Engine/UnrecentChooser.h
@@ -21,9 +21,6 @@
#ifndef UnRecentChooserH
#define UnRecentChooserH
-#include <map>
-#include <vector>
-#include <string>
#include "tstring.h"
class UnRecentChooser
@@ -35,7 +32,7 @@ class UnRecentChooser
std::map<size_t, tstring> oldItems;
std::map<tstring, float> oldPrios;
size_t last;
- int min;
+ int minimum;
static const size_t maxItems = 100;
public:
UnRecentChooser();
diff --git a/plugins/Boltun/src/Engine/ValueChooser.h b/plugins/Boltun/src/Engine/ValueChooser.h
index 219a55a8f2..8a3add430a 100644
--- a/plugins/Boltun/src/Engine/ValueChooser.h
+++ b/plugins/Boltun/src/Engine/ValueChooser.h
@@ -21,9 +21,6 @@
#ifndef StringChooserH
#define StringChooserH
-#include <vector>
-#include <string>
-
template<class container = std::vector<tstring> >
class ValueChooser
{
diff --git a/plugins/Boltun/src/Engine/WordsList.cpp b/plugins/Boltun/src/Engine/WordsList.cpp
index 3209bf2db6..08cd150aaf 100644
--- a/plugins/Boltun/src/Engine/WordsList.cpp
+++ b/plugins/Boltun/src/Engine/WordsList.cpp
@@ -18,7 +18,7 @@
//
//***********************************************************
-#include "WordsList.h"
+#include "..\boltun.h"
using namespace std;
diff --git a/plugins/Boltun/src/Engine/WordsList.h b/plugins/Boltun/src/Engine/WordsList.h
index bd74b2007b..b6e0792101 100644
--- a/plugins/Boltun/src/Engine/WordsList.h
+++ b/plugins/Boltun/src/Engine/WordsList.h
@@ -21,10 +21,6 @@
#ifndef WordsListH
#define WordsListH
-#include <set>
-#include <vector>
-#include <string>
-#include "tchar.h"
#include "tstring.h"
class WordsList
diff --git a/plugins/Boltun/src/actionQueue.h b/plugins/Boltun/src/actionQueue.h
index 78f6ce5f9e..780bbde97a 100644
--- a/plugins/Boltun/src/actionQueue.h
+++ b/plugins/Boltun/src/actionQueue.h
@@ -21,8 +21,6 @@
#ifndef ACTIONQUEUE_H
#define ACTIONQUEUE_H
-#include <windows.h>
-
void AnswerToContact(HANDLE hContact, const TCHAR* messageToAnswer);
void StartChatting(HANDLE hContact);
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 81362c33c8..99eb76ef2b 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -18,30 +18,7 @@
//
//***********************************************************
-#include "Engine/TalkEngine.h"
-
-#include <windows.h>
-#include <time.h>
-#include <string>
-
-#include "newpluginapi.h"
-#include "m_clist.h"
-#include "m_skin.h"
-#include "m_database.h"
-#include "m_system.h"
-#include "m_protosvc.h"
-#include "m_options.h"
-#include "m_langpack.h"
-#include "resource.h"
-
-#include "resource.h"
-#include "version.h"
-
#include "boltun.h"
-#include "config.h"
-#include "actionQueue.h"
-
-//#define DEBUG_LOAD_TIME
int hLangpack;
diff --git a/plugins/Boltun/src/boltun.h b/plugins/Boltun/src/boltun.h
index c6782e8f6b..6dc05b9f88 100644
--- a/plugins/Boltun/src/boltun.h
+++ b/plugins/Boltun/src/boltun.h
@@ -21,11 +21,35 @@
#ifndef _BOLTUN_H
#define _BOLTUN_H
-//Should use different keys in UNICODE and ANSI builds, because usage of plugin
-//with old (another) configs will cause crashes.
+#define _CRT_SECURE_NO_WARNINGS
-#define BOLTUN_KEY "Boltun"
+#include <windows.h>
+#include <time.h>
+#include <fstream>
+#include <algorithm>
+#include "assert.h"
+
+#include "newpluginapi.h"
+#include "m_clist.h"
+#include "m_skin.h"
+#include "m_database.h"
+#include "m_system.h"
+#include "m_protosvc.h"
+#include "m_options.h"
+#include "m_langpack.h"
+
+#include "resource.h"
+#include "version.h"
+#include "config.h"
+#include "actionQueue.h"
+#include "Engine/TalkEngine.h"
+#include "Engine/WordsList.h"
+#include "Engine/UnrecentChooser.h"
+#include "Engine/MyCodeCvt.h"
+#include "Engine/Mind.h"
+#include "Engine/tstring.h"
+#define BOLTUN_KEY "Boltun"
//Service names
#define SERV_CONTACT_AUTO_CHAT "Boltun/ContactAutoChat"
@@ -35,13 +59,13 @@
//Database keys
#define DB_CONTACT_BOLTUN_NOT_TO_CHAT "BoltunNotToChat"
#define DB_CONTACT_BOLTUN_AUTO_CHAT "BoltunAutoChat"
-#define DB_CONTACT_WARNED "Warned"
-
-//Plugin group in settings
-#define BOLTUN_GROUP LPGEN("Message sessions")
-
-//Filename depends on UNICODE
-#define DEFAULT_MIND_FILE _T("boltun.mindw")
+#define DB_CONTACT_WARNED "Warned"
+
+//Plugin group in settings
+#define BOLTUN_GROUP LPGEN("Message sessions")
+
+//Filename depends on UNICODE
+#define DEFAULT_MIND_FILE _T("boltun.mindw")
//===============================================
// These are strings for translation:
diff --git a/plugins/Boltun/src/config.h b/plugins/Boltun/src/config.h
index c5bb20e700..a51240ad70 100644
--- a/plugins/Boltun/src/config.h
+++ b/plugins/Boltun/src/config.h
@@ -21,8 +21,6 @@
#ifndef _CONFIG_H
#define _CONFIG_H
-#include <tchar.h>
-
class BoltunConfig;
template <class T, class BaseClass>
diff --git a/plugins/Boltun/src/stdafx.cpp b/plugins/Boltun/src/stdafx.cpp
new file mode 100644
index 0000000000..acd7a27bd5
--- /dev/null
+++ b/plugins/Boltun/src/stdafx.cpp
@@ -0,0 +1,18 @@
+/*
+Copyright (C) 2012-13 Miranda NG Project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+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
+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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "boltun.h" \ No newline at end of file