summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Dbx_kyoto/src/commonheaders.h58
-rw-r--r--plugins/Dbx_kyoto/src/dbintf.cpp18
-rw-r--r--plugins/Dbx_kyoto/src/ui.cpp31
3 files changed, 54 insertions, 53 deletions
diff --git a/plugins/Dbx_kyoto/src/commonheaders.h b/plugins/Dbx_kyoto/src/commonheaders.h
index d6063ec1e3..93e4468c6a 100644
--- a/plugins/Dbx_kyoto/src/commonheaders.h
+++ b/plugins/Dbx_kyoto/src/commonheaders.h
@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma warning(disable:4509)
+#define SIZEOF(x) _countof(x)
+
#include <windows.h>
#include <time.h>
#include <process.h>
@@ -43,6 +45,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_metacontacts.h>
#include <m_protocols.h>
#include <m_netlib.h>
+#include <m_skin.h>
+#include <m_icolib.h>
#define OWN_CACHED_CONTACT
#include <m_db_int.h>
@@ -54,33 +58,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HINSTANCE g_hInst;
extern LIST<CDbxKyoto> g_Dbs;
-struct VisitorCopy : public TreeDB::Visitor
-{
- __forceinline explicit VisitorCopy() : kbuf_(NULL), ksiz_(0) {}
-
- const char* visit_full(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz, size_t* sp)
- {
- kbuf_ = kbuf;
- ksiz_ = ksiz;
- return NOP;
- }
- const char* kbuf_;
- size_t ksiz_;
-};
-
-struct VisitorCopyRec : public TreeDB::Visitor
-{
- __forceinline explicit VisitorCopyRec() : vbuf_(NULL), vsiz_(0) {}
-
- const char* visit_full(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz, size_t* sp)
- {
- vbuf_ = vbuf;
- vsiz_ = vsiz;
- return NOP;
- }
- const char* vbuf_;
- size_t vsiz_;
-};
+struct VisitorCopy : public TreeDB::Visitor
+{
+ __forceinline explicit VisitorCopy() : kbuf_(NULL), ksiz_(0) {}
+
+ const char* visit_full(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz, size_t* sp)
+ {
+ kbuf_ = kbuf;
+ ksiz_ = ksiz;
+ return NOP;
+ }
+ const char* kbuf_;
+ size_t ksiz_;
+};
+
+struct VisitorCopyRec : public TreeDB::Visitor
+{
+ __forceinline explicit VisitorCopyRec() : vbuf_(NULL), vsiz_(0) {}
+
+ const char* visit_full(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz, size_t* sp)
+ {
+ vbuf_ = vbuf;
+ vsiz_ = vsiz;
+ return NOP;
+ }
+ const char* vbuf_;
+ size_t vsiz_;
+};
class cursor_ptr
{
diff --git a/plugins/Dbx_kyoto/src/dbintf.cpp b/plugins/Dbx_kyoto/src/dbintf.cpp
index c6ed23d54f..ea51b273b0 100644
--- a/plugins/Dbx_kyoto/src/dbintf.cpp
+++ b/plugins/Dbx_kyoto/src/dbintf.cpp
@@ -30,21 +30,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct SettingsComparator : public Comparator
{
SettingsComparator() {}
- virtual int32_t compare(const char *akbuf, size_t, const char *bkbuf, size_t)
- {
+ virtual int32_t compare(const char *akbuf, size_t, const char *bkbuf, size_t)
+ {
DBSettingSortingKey *k1 = (DBSettingSortingKey*)akbuf, *k2 = (DBSettingSortingKey*)bkbuf;
CMP_UINT32(k1->dwContactID, k2->dwContactID);
CMP_UINT32(k1->dwOfsModule, k2->dwOfsModule);
return strcmp(k1->szSettingName, k2->szSettingName);
- }
+ }
}
static _settingsComparator;
struct EventsComparator : public Comparator
{
EventsComparator() {}
- virtual int32_t compare(const char *akbuf, size_t, const char *bkbuf, size_t)
- {
+ virtual int32_t compare(const char *akbuf, size_t, const char *bkbuf, size_t)
+ {
DBEventSortingKey *k1 = (DBEventSortingKey*)akbuf, *k2 = (DBEventSortingKey*)bkbuf;
CMP_UINT32(k1->dwContactId, k2->dwContactId);
CMP_UINT32(k1->ts, k2->ts);
@@ -57,11 +57,11 @@ static _eventsComparator;
struct LongComparator : public Comparator
{
LongComparator() {}
- virtual int32_t compare(const char *akbuf, size_t, const char *bkbuf, size_t)
+ virtual int32_t compare(const char *akbuf, size_t, const char *bkbuf, size_t)
{
return *(LONG*)akbuf - *(LONG*)bkbuf;
- }
-}
+ }
+}
static _longComparator;
static int ModCompare(const ModuleName *mn1, const ModuleName *mn2)
@@ -91,7 +91,7 @@ CDbxKyoto::CDbxKyoto(const TCHAR *tszFileName, int iMode) :
m_tszProfileName = mir_tstrdup(tszFileName);
InitDbInstance(this);
- m_codePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ m_codePage = Langpack_GetDefaultCodePage();
m_hModHeap = HeapCreate(0, 0, 0);
}
diff --git a/plugins/Dbx_kyoto/src/ui.cpp b/plugins/Dbx_kyoto/src/ui.cpp
index 3839c171ba..892ab5ed2e 100644
--- a/plugins/Dbx_kyoto/src/ui.cpp
+++ b/plugins/Dbx_kyoto/src/ui.cpp
@@ -160,7 +160,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam
switch (uMsg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_HEADERBAR, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(iconList[0].hIcolib, true));
+ SendDlgItemMessage(hwndDlg, IDC_HEADERBAR, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(iconList[0].hIcolib, true));
param = (DlgChangePassParam*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
@@ -230,7 +230,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam
case WM_DESTROY:
KillTimer(hwndDlg, 1);
- Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
}
return FALSE;
@@ -300,11 +300,7 @@ static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM)
void CDbxKyoto::UpdateMenuItem()
{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_NAME;
- mi.icolibItem = iconList[1].hIcolib;
- mi.pszName = GetMenuTitle();
- Menu_ModifyItem(hSetPwdMenu, &mi);
+ Menu_ModifyItem(hSetPwdMenu, _A2T(GetMenuTitle()), iconList[1].hIcolib);
}
static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM)
@@ -316,16 +312,17 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM)
HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db);
// main menu item
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.pszName = LPGEN("Database");
- mi.position = 500000000;
- mi.flags = CMIF_ROOTHANDLE;
- mi.icolibItem = iconList[0].hIcolib;
- HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
-
- mi.icolibItem = iconList[1].hIcolib;
- mi.pszName = db->GetMenuTitle();
- mi.hParentMenu = hMenuRoot;
+ CMenuItem mi;
+
+ // main menu item
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500000000, iconList[0].hIcolib);
+ Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
+
+ SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
+ mi.flags = CMIF_TCHAR;
+ mi.hIcolibItem = iconList[1].hIcolib;
+ _A2T tszTitle(db->GetMenuTitle());
+ mi.name.t = tszTitle;
mi.pszService = MS_DB_CHANGEPASSWORD;
hSetPwdMenu = Menu_AddMainMenuItem(&mi);
return 0;