summaryrefslogtreecommitdiff
path: root/plugins/IEHistory
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/IEHistory')
-rw-r--r--plugins/IEHistory/src/dlgHandlers.cpp12
-rw-r--r--plugins/IEHistory/src/dlgHandlers.h4
-rw-r--r--plugins/IEHistory/src/utils.cpp29
-rw-r--r--plugins/IEHistory/src/utils.h6
4 files changed, 25 insertions, 26 deletions
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp
index df09f1ecf2..ddee342acf 100644
--- a/plugins/IEHistory/src/dlgHandlers.cpp
+++ b/plugins/IEHistory/src/dlgHandlers.cpp
@@ -38,14 +38,14 @@ int LoadIEView(HWND hWnd);
int MoveIEView(HWND hWnd);
int DestroyIEView(HWND hWnd);
int LoadEvents(HWND hWnd);
-int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long readCount, int direction);
+int LoadPage(HWND hWnd, MEVENT hFirstEvent, long index, long shiftCount, long readCount, int direction);
int LoadNext(HWND hWnd);
int LoadPrev(HWND hWnd);
int ScrollToBottom(HWND hWnd);
void RefreshButtonStates(HWND hWnd);
-HANDLE GetNeededEvent(HANDLE hLastFirstEvent, int num, int direction);
+MEVENT GetNeededEvent(MEVENT hLastFirstEvent, int num, int direction);
int CalcIEViewPos(IEVIEWWINDOW *ieWnd, HWND hMainWindow)
{
@@ -163,7 +163,7 @@ DWORD WINAPI WorkerThread(LPVOID lpvData)
int i;
IEVIEWEVENTDATA ieData[LOAD_COUNT] = { 0 };
PBYTE messages[LOAD_COUNT] = { 0 };
- HANDLE dbEvent = data->ieEvent.hDbEventFirst;
+ MEVENT dbEvent = data->ieEvent.hDbEventFirst;
for (i = 0; i < LOAD_COUNT; i++) {
ieData[i].cbSize = sizeof(IEVIEWEVENTDATA); //set the cbsize here, no need to do it every time
ieData[i].next = &ieData[i + 1]; //it's a vector, so v[i]'s next element is v[i + 1]
@@ -263,7 +263,7 @@ int LoadEvents(HWND hWnd)
ieEvent.hContact = data->contact;
ieEvent.count = (data->itemsPerPage <= 0) ? count : data->itemsPerPage;
- HANDLE hFirstEvent = db_event_first(data->contact);
+ MEVENT hFirstEvent = db_event_first(data->contact);
int num = 0;
if ((data->itemsPerPage > 0) && (bLastFirst)) {
num = data->count - data->itemsPerPage;
@@ -279,7 +279,7 @@ int LoadEvents(HWND hWnd)
return 0;
}
-int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long readCount, int direction)
+int LoadPage(HWND hWnd, MEVENT hFirstEvent, long index, long shiftCount, long readCount, int direction)
{
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
int count = shiftCount;
@@ -303,7 +303,7 @@ int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long re
}
}
data->index = newIndex;
- HANDLE hEvent = GetNeededEvent(hFirstEvent, count, direction);
+ MEVENT hEvent = GetNeededEvent(hFirstEvent, count, direction);
data->hLastFirstEvent = hEvent;
ieEvent.hDbEventFirst = hEvent;
ieEvent.count = readCount;
diff --git a/plugins/IEHistory/src/dlgHandlers.h b/plugins/IEHistory/src/dlgHandlers.h
index f0696a0abc..bf492a5bbf 100644
--- a/plugins/IEHistory/src/dlgHandlers.h
+++ b/plugins/IEHistory/src/dlgHandlers.h
@@ -33,14 +33,14 @@ struct HistoryWindowData{
int itemsPerPage;
int bEnableRTL;
HWND hIEView;
- HANDLE hLastFirstEvent;
+ MEVENT hLastFirstEvent;
};
struct SearchWindowData{
long index;
MCONTACT contact;
HWND hHistoryWindow;
- HANDLE hLastFoundEvent;
+ MEVENT hLastFoundEvent;
};
INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp
index 2b676f8235..e460e3d78d 100644
--- a/plugins/IEHistory/src/utils.cpp
+++ b/plugins/IEHistory/src/utils.cpp
@@ -198,32 +198,31 @@ void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst)
SystemTimeToTzSpecificLocalTime(NULL, &st, pst);
}
-HANDLE GetNeededEvent(HANDLE hEvent, int num, int direction)
+MEVENT GetNeededEvent(MEVENT hEvent, int num, int direction)
{
int i;
- typedef HANDLE (__stdcall *db_event_step_t)(MCONTACT hContact,HANDLE hDbEvent);
+ typedef MEVENT (__stdcall *db_event_step_t)(MCONTACT hContact, MEVENT hDbEvent);
db_event_step_t db_event_step;
- if(direction==DIRECTION_BACK){
- db_event_step=db_event_prev;
- }else{
- db_event_step=db_event_next;
- }
+ if(direction == DIRECTION_BACK)
+ db_event_step = db_event_prev;
+ else
+ db_event_step = db_event_next;
- for (i = 0; i < num; ++i){
- hEvent = db_event_step(0,hEvent);
- }
+ for (i = 0; i < num; ++i)
+ hEvent = db_event_step(0, hEvent);
+
return hEvent;
}
-SearchResult SearchHistory(MCONTACT contact, HANDLE hFirstEvent, void *searchData, int direction, int type)
+SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchData, int direction, int type)
{
if (hFirstEvent == NULL){
- typedef HANDLE (__stdcall *db_event_start_t)(MCONTACT contact);
- db_event_start_t db_event_start=(direction==DIRECTION_BACK) ? db_event_last : db_event_first;
- hFirstEvent=db_event_start(contact);
+ typedef MEVENT (__stdcall *db_event_start_t)(MCONTACT contact);
+ db_event_start_t db_event_start = (direction == DIRECTION_BACK) ? db_event_last : db_event_first;
+ hFirstEvent = db_event_start(contact);
}
int index = 0;
- HANDLE hEvent = hFirstEvent;
+ MEVENT hEvent = hFirstEvent;
void *buffer = NULL;
TCHAR *search;
bool found = false;
diff --git a/plugins/IEHistory/src/utils.h b/plugins/IEHistory/src/utils.h
index 2d7605b7b1..7cdf8186f6 100644
--- a/plugins/IEHistory/src/utils.h
+++ b/plugins/IEHistory/src/utils.h
@@ -54,7 +54,7 @@ struct TimeSearchData{
struct SearchResult{
long index;
- HANDLE hEvent;
+ MEVENT hEvent;
};
#ifdef _DEBUG
@@ -75,8 +75,8 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos,
void UnixTimeToFileTime(time_t t, LPFILETIME pft);
void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst);
-HANDLE GetNeededEvent(HANDLE hLastFirstEvent, int num, int direction);
-SearchResult SearchHistory(MCONTACT contact, HANDLE hFirstEvent, void *searchData, int direction, int type);
+MEVENT GetNeededEvent(MEVENT hLastFirstEvent, int num, int direction);
+SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchData, int direction, int type);
/*
static __inline int mir_snprintf(char *buffer, size_t count, const char* fmt, ...) {