summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_proto.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-09 08:07:07 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-09 08:07:07 +0000
commit2e80e1093ab6de23c33fbc1f258ce281f1e4dae6 (patch)
tree89e211f022d52ae4ec1c6e0f4f53459045c36069 /protocols/Tox/src/tox_proto.h
parent986b1be299498ba4f46c7346f99728e31369f631 (diff)
Tox:
- added pooling thread - added test code to check connection git-svn-id: http://svn.miranda-ng.org/main/trunk@10133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_proto.h')
-rw-r--r--protocols/Tox/src/tox_proto.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index 37fee20593..5319744a2f 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -71,36 +71,40 @@ public:
static void UninitInstances();
private:
+ Tox *tox;
+ mir_cs tox_lock;
+ HANDLE poolingThread;
+ bool isTerminated;
// instances
static LIST<CToxProto> instanceList;
static int CompareProtos(const CToxProto *p1, const CToxProto *p2);
- static void CALLBACK TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD);
-
- // Instance data:
- Tox *_tox;
- UINT_PTR _timer;
-
//services
INT_PTR __cdecl CreateAccMgrUI(WPARAM, LPARAM);
//events
+ void __cdecl PollingThread(void*);
+
static void OnFriendRequest(Tox *tox, const uint8_t *userId, const uint8_t *message, const uint16_t messageSize, void *arg);
- static void OnFriendMessage(Tox *tox, const int friendId, const uint8_t *message, const uint16_t messageSize, void *arg);
- static void OnFriendNameChange(Tox *tox, const int friendId, const uint8_t *name, const uint16_t nameSize, void *arg);
- static void OnStatusMessageChanged(Tox *tox, const int friendId, const uint8_t* message, const uint16_t messageSize, void *arg);
+ static void OnFriendMessage(Tox *tox, const int friendId, const uint8_t *message, const uint16_t messageSize, void *arg);
+ static void OnFriendNameChange(Tox *tox, const int friendId, const uint8_t *name, const uint16_t nameSize, void *arg);
+ static void OnStatusMessageChanged(Tox *tox, const int friendId, const uint8_t* message, const uint16_t messageSize, void *arg);
static void OnUserStatusChanged(Tox *tox, int32_t friendnumber, uint8_t TOX_USERSTATUS, void *userdata);
- static void OnConnectionStatusChanged(Tox *tox, const int friendId, const uint8_t status, void *arg);
- static void OnAction(Tox *tox, const int friendId, const uint8_t *message, const uint16_t messageSize, void *arg);
+ static void OnConnectionStatusChanged(Tox *tox, const int friendId, const uint8_t status, void *arg);
+ static void OnAction(Tox *tox, const int friendId, const uint8_t *message, const uint16_t messageSize, void *arg);
// contacts
bool IsProtoContact(MCONTACT hContact);
MCONTACT GetContactByUserId(const wchar_t *userId);
MCONTACT CToxProto::AddContact(const wchar_t*userId, const wchar_t *nick, bool isHidden = false);
-
+
void __cdecl SearchByUidAsync(void* arg);
+ // utils
+ uint8_t *HexToBinString(char *hex_string);
+ char *BinToHexString(uint8_t *bin_string);
+
// dialogs
static INT_PTR CALLBACK AccountManagerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
};