summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r--plugins/SmileyAdd/src/customsmiley.cpp4
-rw-r--r--plugins/SmileyAdd/src/customsmiley.h4
-rw-r--r--plugins/SmileyAdd/src/dlgboxsubclass.cpp8
-rw-r--r--plugins/SmileyAdd/src/general.cpp6
-rw-r--r--plugins/SmileyAdd/src/general.h4
-rw-r--r--plugins/SmileyAdd/src/options.cpp4
-rw-r--r--plugins/SmileyAdd/src/options.h4
-rw-r--r--plugins/SmileyAdd/src/richcall.cpp4
-rw-r--r--plugins/SmileyAdd/src/services.cpp19
-rw-r--r--plugins/SmileyAdd/src/services.h2
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp10
-rw-r--r--plugins/SmileyAdd/src/smileys.h4
-rw-r--r--plugins/SmileyAdd/src/smltool.cpp6
-rw-r--r--plugins/SmileyAdd/src/smltool.h2
14 files changed, 40 insertions, 41 deletions
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp
index 053028aaaa..e9efd4ddee 100644
--- a/plugins/SmileyAdd/src/customsmiley.cpp
+++ b/plugins/SmileyAdd/src/customsmiley.cpp
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
SmileyPackCListType g_SmileyPackCStore;
-bool SmileyPackCListType::AddSmileyPack(HANDLE hContact, TCHAR* dir)
+bool SmileyPackCListType::AddSmileyPack(HCONTACT hContact, TCHAR* dir)
{
bool res = true;
if (GetSmileyPack(hContact) == NULL) {
@@ -38,7 +38,7 @@ bool SmileyPackCListType::AddSmileyPack(HANDLE hContact, TCHAR* dir)
}
-bool SmileyPackCListType::AddSmiley(HANDLE hContact, TCHAR* path)
+bool SmileyPackCListType::AddSmiley(HCONTACT hContact, TCHAR* path)
{
SmileyPackCType *smpack = GetSmileyPack(hContact);
if (smpack == NULL) {
diff --git a/plugins/SmileyAdd/src/customsmiley.h b/plugins/SmileyAdd/src/customsmiley.h
index c613b5dc75..fc8e0dff02 100644
--- a/plugins/SmileyAdd/src/customsmiley.h
+++ b/plugins/SmileyAdd/src/customsmiley.h
@@ -69,8 +69,8 @@ private:
public:
int NumberOfSmileyPacks(void) { return m_SmileyPacks.getCount(); }
- bool AddSmileyPack(HANDLE hContact, TCHAR* dir);
- bool AddSmiley(HANDLE hContact, TCHAR* path);
+ bool AddSmileyPack(HCONTACT hContact, TCHAR* dir);
+ bool AddSmiley(HCONTACT hContact, TCHAR* path);
void ClearAndFreeAll(void) { m_SmileyPacks.destroy(); }
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
index aed46dc9c6..d46eb2da72 100644
--- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp
+++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// we are not supposed to use this object, so be aware
typedef struct NewMessageWindowLParam
{
- HANDLE hContact;
+ HCONTACT hContact;
int isSend;
const char *szInitialText;
}
@@ -56,7 +56,7 @@ public:
mutable HBITMAP hSmlBmp;
mutable HICON hSmlIco;
int idxLastChar;
- HANDLE hContact;
+ HCONTACT hContact;
bool doSmileyReplace;
bool doSmileyButton;
bool OldButtonPlace;
@@ -290,7 +290,7 @@ static MsgWndData* IsMsgWnd(HWND hwnd)
}
-static void MsgWndDetect(HWND hwndDlg, HANDLE hContact, msgData* datm)
+static void MsgWndDetect(HWND hwndDlg, HCONTACT hContact, msgData* datm)
{
MsgWndData dat;
@@ -303,7 +303,7 @@ static void MsgWndDetect(HWND hwndDlg, HANDLE hContact, msgData* datm)
else dat.hContact = hContact;
// Get the protocol for this contact to display correct smileys.
- char *protonam = GetContactProto( DecodeMetaContact(dat.hContact));
+ char *protonam = GetContactProto(DecodeMetaContact(dat.hContact));
if (protonam) {
strncpy(dat.ProtocolName, protonam, sizeof(dat.ProtocolName));
dat.ProtocolName[sizeof(dat.ProtocolName)-1] = 0;
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp
index b10c77cdae..91050e25cd 100644
--- a/plugins/SmileyAdd/src/general.cpp
+++ b/plugins/SmileyAdd/src/general.cpp
@@ -211,11 +211,11 @@ void DestroyGdiPlus(void)
}
}
-HANDLE DecodeMetaContact(HANDLE hContact)
+HCONTACT DecodeMetaContact(HCONTACT hContact)
{
if (hContact == NULL) return NULL;
- HANDLE hReal = (HANDLE) CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
- if (hReal == NULL || hReal == (HANDLE)CALLSERVICE_NOTFOUND)
+ HCONTACT hReal = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ if (hReal == NULL || hReal == (HCONTACT)CALLSERVICE_NOTFOUND)
hReal = hContact;
return hReal;
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h
index 489bd06b3a..f9c255e3fc 100644
--- a/plugins/SmileyAdd/src/general.h
+++ b/plugins/SmileyAdd/src/general.h
@@ -164,7 +164,7 @@ bool IsOldSrmm(void);
int CalculateTextHeight(HDC hdc, CHARFORMAT2* chf);
const TCHAR* GetImageExt(CMString &fname);
-HANDLE DecodeMetaContact(HANDLE hContact);
+HCONTACT DecodeMetaContact(HCONTACT hContact);
bool IsSmileyProto(char* proto);
HICON ImageList_GetIconFixed (HIMAGELIST himl, INT i, UINT fStyle);
@@ -180,7 +180,7 @@ HICON GetDefaultIcon(bool copy = true);
void CloseRichCallback(HWND hwnd);
void CloseRichOwnerCallback(HWND hwnd);
-bool SetRichCallback(HWND hwnd, HANDLE hContact, bool subany, bool subnew);
+bool SetRichCallback(HWND hwnd, HCONTACT hContact, bool subany, bool subnew);
void SetRichOwnerCallback(HWND hwnd, HWND hwndInput, HWND hwndLog);
void ProcessAllInputAreas(bool restoreText);
void RichEditData_Destroy(void);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index 2da19f7c31..7fb45de5f0 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -633,7 +633,7 @@ void OptionsType::WriteCustomCategories(const CMString& cats)
}
-void OptionsType::ReadContactCategory(HANDLE hContact, CMString& cats)
+void OptionsType::ReadContactCategory(HCONTACT hContact, CMString& cats)
{
DBVARIANT dbv;
INT_PTR res = db_get_ts(hContact, "SmileyAdd", "CustomCategory", &dbv);
@@ -644,7 +644,7 @@ void OptionsType::ReadContactCategory(HANDLE hContact, CMString& cats)
}
-void OptionsType::WriteContactCategory(HANDLE hContact, const CMString& cats)
+void OptionsType::WriteContactCategory(HCONTACT hContact, const CMString& cats)
{
if (cats.IsEmpty())
db_unset(hContact, "SmileyAdd", "CustomCategory");
diff --git a/plugins/SmileyAdd/src/options.h b/plugins/SmileyAdd/src/options.h
index 349fe2f9dd..ed953c5760 100644
--- a/plugins/SmileyAdd/src/options.h
+++ b/plugins/SmileyAdd/src/options.h
@@ -48,10 +48,10 @@ public:
static void ReadPackFileName(CMString& filename, const CMString& name,
const CMString& defaultFilename);
static void ReadCustomCategories(CMString& cats);
- static void ReadContactCategory(HANDLE hContact, CMString& cats);
+ static void ReadContactCategory(HCONTACT hContact, CMString& cats);
static void WritePackFileName(const CMString& filename, const CMString& name);
static void WriteCustomCategories(const CMString& cats);
- static void WriteContactCategory(HANDLE hContact, const CMString& cats);
+ static void WriteContactCategory(HCONTACT hContact, const CMString& cats);
};
extern OptionsType opt;
diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp
index 8ddc79d4a3..73579c0be9 100644
--- a/plugins/SmileyAdd/src/richcall.cpp
+++ b/plugins/SmileyAdd/src/richcall.cpp
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct RichEditData
{
HWND hwnd;
- HANDLE hContact;
+ HCONTACT hContact;
HWND hToolTip;
int tipActive;
bool inputarea;
@@ -312,7 +312,7 @@ static LRESULT CALLBACK RichEditSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, LP
return result;
}
-bool SetRichCallback(HWND hwnd, HANDLE hContact, bool subany, bool subnew)
+bool SetRichCallback(HWND hwnd, HCONTACT hContact, bool subany, bool subnew)
{
RichEditData* rdt = g_RichEditList.find((RichEditData*)&hwnd);
if (rdt == NULL) {
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index 00f27437c6..f7db0a0b94 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -23,7 +23,7 @@ LIST<void> menuHandleArray(5);
//implementation of service functions
-SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact, SmileyPackCType** smlc)
+SmileyPackType* GetSmileyPack(const char* proto, HCONTACT hContact, SmileyPackCType** smlc)
{
hContact = DecodeMetaContact(hContact);
if (smlc)
@@ -100,7 +100,7 @@ INT_PTR ShowSmileySelectionCommand(WPARAM, LPARAM lParam)
if (smaddInfo == NULL || smaddInfo->cbSize < SMADD_SHOWSEL_SIZE_V1) return FALSE;
HWND parent = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V1 ? smaddInfo->hwndParent : NULL;
- HANDLE hContact = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V2 ? smaddInfo->hContact : NULL;
+ HCONTACT hContact = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V2 ? smaddInfo->hContact : NULL;
SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
stwp->pSmileyPack = GetSmileyPack(smaddInfo->Protocolname, hContact);
@@ -155,7 +155,7 @@ INT_PTR GetSmileyIconCommand(WPARAM, LPARAM lParam)
static int GetInfoCommandE(SMADD_INFO2* smre, bool retDup)
{
if (smre == NULL || smre->cbSize < SMADD_INFO_SIZE_V1) return FALSE;
- HANDLE hContact = smre->cbSize > SMADD_INFO_SIZE_V1 ? smre->hContact : NULL;
+ HCONTACT hContact = smre->cbSize > SMADD_INFO_SIZE_V1 ? smre->hContact : NULL;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact);
@@ -282,7 +282,7 @@ INT_PTR ParseTextBatch(WPARAM, LPARAM lParam)
SMADD_BATCHPARSE2* smre = (SMADD_BATCHPARSE2*) lParam;
if (smre == NULL || smre->cbSize < SMADD_BATCHPARSE_SIZE_V1) return FALSE;
- HANDLE hContact = smre->cbSize > SMADD_BATCHPARSE_SIZE_V1 ? smre->hContact : NULL;
+ HCONTACT hContact = smre->cbSize > SMADD_BATCHPARSE_SIZE_V1 ? smre->hContact : NULL;
SmileyPackCType* smcp = NULL;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact,
@@ -356,7 +356,7 @@ INT_PTR RegisterPack(WPARAM, LPARAM lParam)
INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
if (lParam != 0)
{
SmileyCategoryType* smct = g_SmileyCategories.GetSmileyCategory((unsigned)lParam - 3);
@@ -382,7 +382,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
{
SmileyCategoryListType::SmileyCategoryVectorType& smc = *g_SmileyCategories.GetSmileyCategoryList();
- char* protnam = GetContactProto((HANDLE)wParam);
+ char* protnam = GetContactProto((HCONTACT)wParam);
bool haveMenu = IsSmileyProto(protnam);
if (haveMenu && opt.UseOneForAll) {
unsigned cnt = 0;
@@ -399,7 +399,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
if (haveMenu) {
CMString cat;
- opt.ReadContactCategory((HANDLE)wParam, cat);
+ opt.ReadContactCategory((HCONTACT)wParam, cat);
CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hContactMenuItem;
@@ -473,8 +473,7 @@ INT_PTR LoadContactSmileys(WPARAM, LPARAM lParam)
SMADD_CONT* cont = (SMADD_CONT*)lParam;
- switch (cont->type)
- {
+ switch (cont->type) {
case 0:
g_SmileyPackCStore.AddSmileyPack(cont->hContact, cont->path);
NotifyEventHooks(hEvent1, (WPARAM)cont->hContact, 0);
@@ -541,7 +540,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam)
int DbSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL) return 0;
diff --git a/plugins/SmileyAdd/src/services.h b/plugins/SmileyAdd/src/services.h
index 992f921479..21ee912e79 100644
--- a/plugins/SmileyAdd/src/services.h
+++ b/plugins/SmileyAdd/src/services.h
@@ -38,7 +38,7 @@ INT_PTR LoadContactSmileys(WPARAM, LPARAM lParam);
int AccountListChanged(WPARAM wParam, LPARAM lParam);
int DbSettingChanged(WPARAM wParam, LPARAM lParam);
-SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact = NULL, SmileyPackCType** smlc = NULL);
+SmileyPackType* GetSmileyPack(const char* proto, HCONTACT hContact = NULL, SmileyPackCType** smlc = NULL);
#endif // SMILEYADD_SERVICES_H_
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index abcfe7b7aa..51e1fafb8d 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -152,7 +152,7 @@ SmileyType* SmileyPackType::GetSmiley(unsigned index)
}
-static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param)
+static DWORD_PTR ConvertServiceParam(HCONTACT hContact, const TCHAR *param)
{
DWORD_PTR ret;
if (param == NULL)
@@ -168,7 +168,7 @@ static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param)
}
-void SmileyType::CallSmileyService(HANDLE hContact)
+void SmileyType::CallSmileyService(HCONTACT hContact)
{
_TPattern * srvsplit = _TPattern::compile(_T("(.*)\\|(.*)\\|(.*)"));
_TMatcher * m0 = srvsplit->createTMatcher(GetTriggerText());
@@ -856,7 +856,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
{
CMString tname(A2T_SM(acc->szModuleName));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char* proto = GetContactProto(hContact);
if (proto == NULL)
continue;
@@ -878,7 +878,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
}
}
-void SmileyCategoryListType::AddContactTransportAsCategory(HANDLE hContact, const CMString& defaultFile)
+void SmileyCategoryListType::AddContactTransportAsCategory(HCONTACT hContact, const CMString& defaultFile)
{
char* proto = GetContactProto(hContact);
if (proto == NULL) return;
@@ -944,7 +944,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void)
for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
AddContactTransportAsCategory(hContact, defaultFile);
CMString cats;
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h
index b654b32ff3..4e7d95f6fa 100644
--- a/plugins/SmileyAdd/src/smileys.h
+++ b/plugins/SmileyAdd/src/smileys.h
@@ -76,7 +76,7 @@ public:
HICON GetIconDup(void);
HBITMAP GetBitmap(COLORREF bkgClr, int sizeX, int sizeY);
- void CallSmileyService(HANDLE hContact);
+ void CallSmileyService(HCONTACT hContact);
void SetHidden(bool hid) { SetFlagsBit(HiddenSmiley, hid); }
void SetRegEx(bool regex) { SetFlagsBit(RegExSmiley, regex); }
@@ -291,7 +291,7 @@ public:
void AddAndLoad(const CMString& name, const CMString& displayName);
void AddAllProtocolsAsCategory(void);
void AddAccountAsCategory(PROTOACCOUNT *acc, const CMString& defaultFile);
- void AddContactTransportAsCategory(HANDLE hContact, const CMString& defaultFile);
+ void AddContactTransportAsCategory(HCONTACT hContact, const CMString& defaultFile);
void ClearAndLoadAll(void);
void ClearAll(void)
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp
index 821a0bc3d9..821173887b 100644
--- a/plugins/SmileyAdd/src/smltool.cpp
+++ b/plugins/SmileyAdd/src/smltool.cpp
@@ -45,7 +45,7 @@ private:
int m_Direction;
UINT m_TargetMessage;
WPARAM m_TargetWParam;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
int rowSel;
bool m_Choosing;
@@ -171,10 +171,10 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP
struct smlsrvstruct
{
- smlsrvstruct(SmileyType *tsml, HANDLE thContact)
+ smlsrvstruct(SmileyType *tsml, HCONTACT thContact)
: sml(tsml), hContact(thContact) {}
SmileyType *sml;
- HANDLE hContact;
+ HCONTACT hContact;
};
void CALLBACK smileyServiceCallback(void* arg)
diff --git a/plugins/SmileyAdd/src/smltool.h b/plugins/SmileyAdd/src/smltool.h
index 89fb786862..ccdab2511e 100644
--- a/plugins/SmileyAdd/src/smltool.h
+++ b/plugins/SmileyAdd/src/smltool.h
@@ -32,7 +32,7 @@ struct SmileyToolWindowParam
HWND hWndParent;
UINT targetMessage;
WPARAM targetWParam;
- HANDLE hContact;
+ HCONTACT hContact;
};