From 25451e77f82086f283b9b3e1be64c7fef31bdf78 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 26 Jul 2015 07:40:03 +0000 Subject: NewXstatusNotify: common project git-svn-id: http://svn.miranda-ng.org/main/trunk@14709 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewXstatusNotify/src/common.h | 158 ------------------------------- plugins/NewXstatusNotify/src/indsnd.cpp | 2 +- plugins/NewXstatusNotify/src/main.cpp | 2 +- plugins/NewXstatusNotify/src/options.cpp | 2 +- plugins/NewXstatusNotify/src/popup.cpp | 2 +- plugins/NewXstatusNotify/src/stdafx.cpp | 18 ---- plugins/NewXstatusNotify/src/stdafx.cxx | 18 ++++ plugins/NewXstatusNotify/src/stdafx.h | 157 ++++++++++++++++++++++++++++++ plugins/NewXstatusNotify/src/utils.cpp | 2 +- plugins/NewXstatusNotify/src/xstatus.cpp | 2 +- 10 files changed, 181 insertions(+), 182 deletions(-) delete mode 100644 plugins/NewXstatusNotify/src/common.h delete mode 100644 plugins/NewXstatusNotify/src/stdafx.cpp create mode 100644 plugins/NewXstatusNotify/src/stdafx.cxx create mode 100644 plugins/NewXstatusNotify/src/stdafx.h (limited to 'plugins/NewXstatusNotify/src') diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h deleted file mode 100644 index eb7e6b5a85..0000000000 --- a/plugins/NewXstatusNotify/src/common.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - NewXstatusNotify YM - Plugin for Miranda IM - Copyright (c) 2001-2004 Luca Santarelli - Copyright (c) 2005-2007 Vasilich - Copyright (c) 2007-2011 yaho - - 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; either version 2 of the License, or - (at your option) any later version. - - 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, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef COMMON_H -#define COMMON_H - -#pragma once - -#define STRICT -#define _CRT_SECURE_NO_WARNINGS - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "resource.h" -#include "indsnd.h" -#include "options.h" -#include "popup.h" -#include "utils.h" -#include "version.h" -#include "xstatus.h" - -#define MODULE "NewStatusNotify" - -#define MAX_STATUSTEXT 36 -#define MAX_STANDARDTEXT 36 -#define MAX_SKINSOUNDNAME 36 -#define MAX_SKINSOUNDDESC 36 - -#define GENDER_UNSPECIFIED 0 -#define GENDER_MALE 1 -#define GENDER_FEMALE 2 - -#define ID_STATUS_FROMOFFLINE 0 -#define ID_STATUS_SMSGREMOVED 1 -#define ID_STATUS_SMSGCHANGED 2 -#define ID_STATUS_XREMOVED 3 -#define ID_STATUS_XCHANGED 4 -#define ID_STATUS_XMSGCHANGED 5 -#define ID_STATUS_XMSGREMOVED 6 -#define ID_STATUSEX_MAX 6 -#define STATUSEX_COUNT ID_STATUSEX_MAX + 1 -#define ID_STATUS_EXTRASTATUS 40081 -#define ID_STATUS_STATUSMSG 40082 -#define ID_STATUS_MIN ID_STATUS_OFFLINE -#define ID_STATUS_MAX ID_STATUS_OUTTOLUNCH -#define ID_STATUS_MAX2 ID_STATUS_STATUSMSG -#define STATUS_COUNT ID_STATUS_MAX2 - ID_STATUS_MIN + 1 -#define Index(ID_STATUS) ID_STATUS - ID_STATUS_OFFLINE - -#define COLOR_BG_AVAILDEFAULT RGB(173,206,247) -#define COLOR_BG_NAVAILDEFAULT RGB(255,189,189) -#define COLOR_TX_DEFAULT RGB(0,0,0) - -#define ICO_NOTIFICATION_OFF "notification_off" -#define ICO_NOTIFICATION_ON "notification_on" - -#define JS_PARSE_XMPP_URI "/ParseXmppURI" - -#define COMPARE_SAME 0 -#define COMPARE_DIFF 1 -#define COMPARE_DEL 2 - -typedef struct tagSTATUS -{ - TCHAR lpzMStatusText[MAX_STATUSTEXT]; - TCHAR lpzFStatusText[MAX_STATUSTEXT]; - TCHAR lpzUStatusText[MAX_STATUSTEXT]; - TCHAR lpzStandardText[MAX_STANDARDTEXT]; - char lpzSkinSoundName[MAX_SKINSOUNDNAME]; - TCHAR lpzSkinSoundDesc[MAX_SKINSOUNDDESC]; - TCHAR lpzSkinSoundFile[MAX_PATH]; - COLORREF colorBack; - COLORREF colorText; -} STATUS; - -typedef struct { - MCONTACT hContact; - TCHAR *oldstatusmsg; - TCHAR *newstatusmsg; - char *proto; - int compare; -} STATUSMSGINFO; - -/* -MCONTACT hContact = wParam; -WORD oldStatus = LOWORD(lParam); -WORD newStatus = HIWORD(lParam); -oldStatus is the status the contact was before the change. -newStatus is the status the contact is now. -Cast them to (int) if you need them that way. -*/ -#define ME_STATUSCHANGE_CONTACTSTATUSCHANGED "Miranda/StatusChange/ContactStatusChanged" - -#define MS_STATUSCHANGE_MENUCOMMAND "NewStatusNotify/EnableDisableMenuCommand" - -extern OPTIONS opt; -extern LIST eventListXStatus; -extern LIST eventListStatus; -extern LIST eventListSMsg; -extern TEMPLATES templates; -extern HINSTANCE hInst; -extern HGENMENU hEnableDisableMenu; -extern STATUS StatusList[STATUS_COUNT]; -extern STATUS StatusListEx[STATUSEX_COUNT]; - -TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt); -void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt); -void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText); -void PlayChangeSound(MCONTACT hContact, const char *name); -#endif //COMMON_H diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 0a541b7662..1f81d2ec3a 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common.h" +#include "stdafx.h" void PreviewSound(HWND hList) { diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index b9e9943437..e04e6739e5 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common.h" +#include "stdafx.h" CLIST_INTERFACE *pcli; diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index f1a078ec3d..9096d049ba 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common.h" +#include "stdafx.h" OPTIONS opt = { 0 }; TEMPLATES templates = { 0 }; diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index d92a93f525..98de23ac0b 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common.h" +#include "stdafx.h" void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR *stzText, PLUGINDATA *pdp) { diff --git a/plugins/NewXstatusNotify/src/stdafx.cpp b/plugins/NewXstatusNotify/src/stdafx.cpp deleted file mode 100644 index c5fe5abaad..0000000000 --- a/plugins/NewXstatusNotify/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 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 . -*/ - -#include "common.h" \ No newline at end of file diff --git a/plugins/NewXstatusNotify/src/stdafx.cxx b/plugins/NewXstatusNotify/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/NewXstatusNotify/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 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 . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/plugins/NewXstatusNotify/src/stdafx.h b/plugins/NewXstatusNotify/src/stdafx.h new file mode 100644 index 0000000000..5b6218084f --- /dev/null +++ b/plugins/NewXstatusNotify/src/stdafx.h @@ -0,0 +1,157 @@ +/* + NewXstatusNotify YM - Plugin for Miranda IM + Copyright (c) 2001-2004 Luca Santarelli + Copyright (c) 2005-2007 Vasilich + Copyright (c) 2007-2011 yaho + + 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; either version 2 of the License, or + (at your option) any later version. + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef COMMON_H +#define COMMON_H + +#pragma once + +#define STRICT + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "resource.h" +#include "indsnd.h" +#include "options.h" +#include "popup.h" +#include "utils.h" +#include "version.h" +#include "xstatus.h" + +#define MODULE "NewStatusNotify" + +#define MAX_STATUSTEXT 36 +#define MAX_STANDARDTEXT 36 +#define MAX_SKINSOUNDNAME 36 +#define MAX_SKINSOUNDDESC 36 + +#define GENDER_UNSPECIFIED 0 +#define GENDER_MALE 1 +#define GENDER_FEMALE 2 + +#define ID_STATUS_FROMOFFLINE 0 +#define ID_STATUS_SMSGREMOVED 1 +#define ID_STATUS_SMSGCHANGED 2 +#define ID_STATUS_XREMOVED 3 +#define ID_STATUS_XCHANGED 4 +#define ID_STATUS_XMSGCHANGED 5 +#define ID_STATUS_XMSGREMOVED 6 +#define ID_STATUSEX_MAX 6 +#define STATUSEX_COUNT ID_STATUSEX_MAX + 1 +#define ID_STATUS_EXTRASTATUS 40081 +#define ID_STATUS_STATUSMSG 40082 +#define ID_STATUS_MIN ID_STATUS_OFFLINE +#define ID_STATUS_MAX ID_STATUS_OUTTOLUNCH +#define ID_STATUS_MAX2 ID_STATUS_STATUSMSG +#define STATUS_COUNT ID_STATUS_MAX2 - ID_STATUS_MIN + 1 +#define Index(ID_STATUS) ID_STATUS - ID_STATUS_OFFLINE + +#define COLOR_BG_AVAILDEFAULT RGB(173,206,247) +#define COLOR_BG_NAVAILDEFAULT RGB(255,189,189) +#define COLOR_TX_DEFAULT RGB(0,0,0) + +#define ICO_NOTIFICATION_OFF "notification_off" +#define ICO_NOTIFICATION_ON "notification_on" + +#define JS_PARSE_XMPP_URI "/ParseXmppURI" + +#define COMPARE_SAME 0 +#define COMPARE_DIFF 1 +#define COMPARE_DEL 2 + +typedef struct tagSTATUS +{ + TCHAR lpzMStatusText[MAX_STATUSTEXT]; + TCHAR lpzFStatusText[MAX_STATUSTEXT]; + TCHAR lpzUStatusText[MAX_STATUSTEXT]; + TCHAR lpzStandardText[MAX_STANDARDTEXT]; + char lpzSkinSoundName[MAX_SKINSOUNDNAME]; + TCHAR lpzSkinSoundDesc[MAX_SKINSOUNDDESC]; + TCHAR lpzSkinSoundFile[MAX_PATH]; + COLORREF colorBack; + COLORREF colorText; +} STATUS; + +typedef struct { + MCONTACT hContact; + TCHAR *oldstatusmsg; + TCHAR *newstatusmsg; + char *proto; + int compare; +} STATUSMSGINFO; + +/* +MCONTACT hContact = wParam; +WORD oldStatus = LOWORD(lParam); +WORD newStatus = HIWORD(lParam); +oldStatus is the status the contact was before the change. +newStatus is the status the contact is now. +Cast them to (int) if you need them that way. +*/ +#define ME_STATUSCHANGE_CONTACTSTATUSCHANGED "Miranda/StatusChange/ContactStatusChanged" + +#define MS_STATUSCHANGE_MENUCOMMAND "NewStatusNotify/EnableDisableMenuCommand" + +extern OPTIONS opt; +extern LIST eventListXStatus; +extern LIST eventListStatus; +extern LIST eventListSMsg; +extern TEMPLATES templates; +extern HINSTANCE hInst; +extern HGENMENU hEnableDisableMenu; +extern STATUS StatusList[STATUS_COUNT]; +extern STATUS StatusListEx[STATUSEX_COUNT]; + +TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt); +void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt); +void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText); +void PlayChangeSound(MCONTACT hContact, const char *name); +#endif //COMMON_H diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 7dd1e9dc58..8e592a5121 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common.h" +#include "stdafx.h" // From NewEventNotify :-) bool CheckMsgWnd(MCONTACT hContact) diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index dcc0640267..e910f3155a 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "common.h" +#include "stdafx.h" XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText) { -- cgit v1.2.3