diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-05-15 10:38:20 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-05-15 10:38:20 +0000 |
commit | 48540940b6c28bb4378abfeb500ec45a625b37b6 (patch) | |
tree | 2ef294c0763e802f91d868bdef4229b6868527de /plugins/Popup | |
parent | 5c350913f011e119127baeb32a6aedeb4f0d33bc (diff) |
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup')
120 files changed, 24729 insertions, 0 deletions
diff --git a/plugins/Popup/Deprecated/notify_imp.cpp b/plugins/Popup/Deprecated/notify_imp.cpp new file mode 100644 index 0000000000..071fb5d7ec --- /dev/null +++ b/plugins/Popup/Deprecated/notify_imp.cpp @@ -0,0 +1,296 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+*/
+
+#include "headers.h"
+
+static HANDLE hhkShow=0, hhkUpdate=0, hhkRemove=0;
+
+//static void PopupThread(void *arg);
+static INT_PTR Popup2Show(WPARAM wParam, LPARAM lParam);
+static INT_PTR Popup2Update(WPARAM wParam, LPARAM lParam);
+static INT_PTR Popup2Remove(WPARAM wParam, LPARAM lParam);
+static INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam);
+static INT_PTR __stdcall PopupNotifyWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+void LoadNotifyImp()
+{
+ hhkShow = HookEvent(ME_NOTIFY_SHOW, (MIRANDAHOOK)Popup2Show);
+ hhkUpdate = HookEvent(ME_NOTIFY_UPDATE, (MIRANDAHOOK)Popup2Update);
+ hhkRemove = HookEvent(ME_NOTIFY_REMOVE, (MIRANDAHOOK)Popup2Remove);
+
+ CreateServiceFunction("Popup2/DefaultActions", svcPopup2DefaultActions);
+
+ CreateServiceFunction(MS_POPUP2_SHOW, Popup2Show);
+ CreateServiceFunction(MS_POPUP2_UPDATE, Popup2Update);
+ CreateServiceFunction(MS_POPUP2_REMOVE, Popup2Remove);
+}
+
+void UnloadNotifyImp()
+{
+ UnhookEvent(hhkShow);
+ UnhookEvent(hhkUpdate);
+ UnhookEvent(hhkRemove);
+}
+
+static INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam)
+{
+ HWND hwnd = (HWND)MNotifyGetDWord((HANDLE)lParam, "Popup2/hwnd", (DWORD)NULL);
+ if (!hwnd) return 0;
+
+ HANDLE hNotify = (HANDLE)PUGetPluginData(hwnd);
+ if (!hNotify || (hNotify == INVALID_HANDLE_VALUE)) return 0;
+
+ switch (wParam)
+ {
+ case 0:
+ { // send message
+ if (HANDLE hContact = (HANDLE)MNotifyGetDWord(hNotify, NFOPT_CONTACT, 0))
+ CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
+ SendMessage(hwnd, UM_DESTROYPOPUP, 0, 0);
+ break;
+ }
+ case 1:
+ { // dismiss popup
+ SendMessage(hwnd, UM_DESTROYPOPUP, 0, 0);
+ break;
+ }
+ }
+ return 0;
+}
+
+static INT_PTR __stdcall PopupNotifyWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hNotify = (HANDLE)PUGetPluginData(hwnd);
+
+ if (!hNotify || (hNotify == INVALID_HANDLE_VALUE))
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+
+ switch (msg)
+ {
+ case UM_INITPOPUP:
+ {
+ MNotifyAddRef(hNotify);
+ MNotifySetDWord(hNotify, "Popup2/hwnd", (DWORD)hwnd);
+ break;
+ }
+ case UM_FREEPLUGINDATA:
+ {
+ int result = 0;
+ if (WNDPROC PluginWndProc = (WNDPROC)MNotifyGetDWord(hNotify, NFOPT_POPUP2_WNDPROC, NULL))
+ result = PluginWndProc(hwnd, msg, wParam, lParam);
+ result = DefWindowProc(hwnd, msg, wParam, lParam);
+
+ MNotifySetDWord(hNotify, "Popup2/hwnd", (DWORD)NULL);
+ MNotifyRelease(hNotify);
+
+ return result;
+ }
+
+ case WM_LBUTTONDOWN:
+ {
+ const char *service = MNotifyGetString(hNotify, NFOPT_POPUP2_LCLICKSVC, "Popup2/DefaultActions");
+ DWORD cookie = MNotifyGetDWord(hNotify, NFOPT_POPUP2_LCLICKCOOKIE, 0);
+ CallService(service, cookie, (LPARAM)hNotify);
+ break;
+ }
+ case WM_RBUTTONDOWN:
+ {
+ const char *service = MNotifyGetString(hNotify, NFOPT_POPUP2_LCLICKSVC, "Popup2/DefaultActions");
+ DWORD cookie = MNotifyGetDWord(hNotify, NFOPT_POPUP2_LCLICKCOOKIE, 1);
+ CallService(service, cookie, (LPARAM)hNotify);
+ break;
+ }
+ }
+
+ if (WNDPROC PluginWndProc = (WNDPROC)MNotifyGetDWord(hNotify, NFOPT_POPUP2_WNDPROC, NULL))
+ return PluginWndProc(hwnd, msg, wParam, lParam);
+
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+}
+
+static INT_PTR Popup2Show(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ HANDLE hNotify = (HANDLE)lParam;
+ if (!hNotify) return -1;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = 0;
+ ppd2.lchContact = (HANDLE)MNotifyGetDWord(hNotify, NFOPT_CONTACT, NULL);;
+ ppd2.lchEvent = (HANDLE)MNotifyGetDWord(hNotify, NFOPT_CONTACT, NULL);
+ ppd2.lchIcon = (HICON)MNotifyGetDWord(hNotify, NFOPT_ICON, (DWORD)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+
+ if (PopUpOptions.UseWinColors)
+ {
+ ppd2.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd2.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ } else
+ {
+ ppd2.colorBack = fonts.clBack;
+ ppd2.colorText = fonts.clText;
+ }
+ ppd2.colorBack = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, MNotifyGetDWord(hNotify, NFOPT_BACKCOLOR, ppd2.colorBack));
+ ppd2.colorText = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, MNotifyGetDWord(hNotify, NFOPT_TEXTCOLOR, ppd2.colorText));
+ ppd2.PluginWindowProc = (WNDPROC)MNotifyGetDWord(hNotify, NFOPT_POPUP2_WNDPROC, NULL);
+ ppd2.PluginData = (LPVOID)MNotifyGetDWord(hNotify, NFOPT_POPUP2_PLUGINDATA, NULL);
+ ppd2.iSeconds = (int)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TIMEOUT, MNotifyGetDWord(hNotify, NFOPT_TIMEOUT, PopUpOptions.Seconds));
+
+ WCHAR *lpwzTitle, *lpwzText;
+ char *lpzTitle, *lpzText;
+ lpwzTitle = (WCHAR *)MNotifyGetWString(hNotify, NFOPT_TITLEW, NULL);
+ lpzTitle = (char *)MNotifyGetString(hNotify, NFOPT_TITLE, NULL);
+ lpwzText = (WCHAR *)MNotifyGetWString(hNotify, NFOPT_TEXTW, NULL);
+ lpzText = (char *)MNotifyGetString(hNotify, NFOPT_TEXT, NULL);
+ if (lpwzTitle && lpwzText)
+ {
+ ppd2.lpwzTitle = lpwzTitle;
+ ppd2.lpwzText = lpwzText;
+ ppd2.flags |= PU2_UNICODE;
+ } else
+ if (lpzTitle && lpzText)
+ {
+ ppd2.lpzTitle = lpzTitle;
+ ppd2.lpzText = lpzText;
+ ppd2.flags |= PU2_ANSI;
+ } else
+ {
+ ppd2.lpzText = ppd2.lpzTitle = Translate("<empty>");
+ ppd2.flags |= PU2_ANSI;
+ }
+
+ DWORD dwStatusMode = MNotifyGetDWord(hNotify, NFOPT_POPUP2_STATUSMODE, 0x3ff);
+
+ DWORD dwFlags = APF_RETURN_HWND;
+ switch (PopUpOptions.CurrentStatus)
+ {
+ case ID_STATUS_OFFLINE: if (!(dwStatusMode&0x001)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_ONLINE: if (!(dwStatusMode&0x002)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_AWAY: if (!(dwStatusMode&0x004)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_DND: if (!(dwStatusMode&0x008)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_NA: if (!(dwStatusMode&0x010)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_OCCUPIED: if (!(dwStatusMode&0x020)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_FREECHAT: if (!(dwStatusMode&0x040)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_INVISIBLE: if (!(dwStatusMode&0x080)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_ONTHEPHONE: if (!(dwStatusMode&0x100)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_OUTTOLUNCH: if (!(dwStatusMode&0x200)) dwFlags |= APF_NO_POPUP; break;
+ }
+
+ ppd2.PluginData = hNotify;
+ ppd2.PluginWindowProc = (WNDPROC)PopupNotifyWndProc;
+
+ return PopUp_AddPopUp2((WPARAM)&ppd2, dwFlags);
+}
+
+static INT_PTR Popup2Update(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ HANDLE hNotify = (HANDLE)lParam;
+ if (!hNotify) return -1;
+
+ HWND hwnd = (HWND)MNotifyGetDWord(hNotify, "Popup2/hwnd", 0);
+ if (!hwnd) return -1;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = 0;
+ ppd2.lchContact = (HANDLE)MNotifyGetDWord(hNotify, NFOPT_CONTACT, NULL);;
+ ppd2.lchEvent = (HANDLE)MNotifyGetDWord(hNotify, NFOPT_CONTACT, NULL);
+ ppd2.lchIcon = (HICON)MNotifyGetDWord(hNotify, NFOPT_ICON, (DWORD)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+
+ if (PopUpOptions.UseWinColors)
+ {
+ ppd2.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd2.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ } else
+ {
+ ppd2.colorBack = fonts.clBack;
+ ppd2.colorText = fonts.clText;
+ }
+ ppd2.colorBack = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, MNotifyGetDWord(hNotify, NFOPT_BACKCOLOR, ppd2.colorBack));
+ ppd2.colorText = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, MNotifyGetDWord(hNotify, NFOPT_TEXTCOLOR, ppd2.colorText));
+ ppd2.PluginWindowProc = (WNDPROC)MNotifyGetDWord(hNotify, NFOPT_POPUP2_WNDPROC, NULL);
+ ppd2.PluginData = (LPVOID)MNotifyGetDWord(hNotify, NFOPT_POPUP2_PLUGINDATA, NULL);
+ ppd2.iSeconds = (int)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TIMEOUT, MNotifyGetDWord(hNotify, NFOPT_TIMEOUT, PopUpOptions.Seconds));
+
+ WCHAR *lpwzTitle, *lpwzText;
+ char *lpzTitle, *lpzText;
+ lpwzTitle = (WCHAR *)MNotifyGetWString(hNotify, NFOPT_TITLEW, NULL);
+ lpzTitle = (char *)MNotifyGetString(hNotify, NFOPT_TITLE, NULL);
+ lpwzText = (WCHAR *)MNotifyGetWString(hNotify, NFOPT_TEXTW, NULL);
+ lpzText = (char *)MNotifyGetString(hNotify, NFOPT_TEXT, NULL);
+ if (lpwzTitle && lpwzText)
+ {
+ ppd2.lpwzTitle = lpwzTitle;
+ ppd2.lpwzText = lpwzText;
+ ppd2.flags |= PU2_UNICODE;
+ } else
+ if (lpzTitle && lpzText)
+ {
+ ppd2.lpzTitle = lpzTitle;
+ ppd2.lpzText = lpzText;
+ ppd2.flags |= PU2_ANSI;
+ } else
+ {
+ ppd2.lpzText = ppd2.lpzTitle = Translate("<empty>");
+ ppd2.flags |= PU2_ANSI;
+ }
+
+ DWORD dwStatusMode = MNotifyGetDWord(hNotify, NFOPT_POPUP2_STATUSMODE, 0x3ff);
+
+ DWORD dwFlags = 0;
+ switch (PopUpOptions.CurrentStatus)
+ {
+ case ID_STATUS_OFFLINE: if (!(dwStatusMode&0x001)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_ONLINE: if (!(dwStatusMode&0x002)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_AWAY: if (!(dwStatusMode&0x004)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_DND: if (!(dwStatusMode&0x008)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_NA: if (!(dwStatusMode&0x010)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_OCCUPIED: if (!(dwStatusMode&0x020)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_FREECHAT: if (!(dwStatusMode&0x040)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_INVISIBLE: if (!(dwStatusMode&0x080)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_ONTHEPHONE: if (!(dwStatusMode&0x100)) dwFlags |= APF_NO_POPUP; break;
+ case ID_STATUS_OUTTOLUNCH: if (!(dwStatusMode&0x200)) dwFlags |= APF_NO_POPUP; break;
+ }
+
+ ppd2.PluginData = hNotify;
+ ppd2.PluginWindowProc = (WNDPROC)PopupNotifyWndProc;
+
+ return PopUp_Change2((WPARAM)hwnd, (LPARAM)&ppd2);
+}
+
+static INT_PTR Popup2Remove(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ HANDLE hNotify = (HANDLE)lParam;
+ if (!hNotify) return -1;
+
+ HWND hwnd = (HWND)MNotifyGetDWord(hNotify, "Popup2/hwnd", 0);
+ if (!hwnd) return -1;
+
+ SendMessage(hwnd, UM_DESTROYPOPUP, 0, 0);
+ return 0;
+}
diff --git a/plugins/Popup/Deprecated/notify_imp.h b/plugins/Popup/Deprecated/notify_imp.h new file mode 100644 index 0000000000..b7463cddf4 --- /dev/null +++ b/plugins/Popup/Deprecated/notify_imp.h @@ -0,0 +1,39 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/Deprecated/notify_imp.h $
+Revision : $Revision: 1615 $
+Last change on : $Date: 2010-06-23 01:47:57 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __notify_imp_h__
+#define __notify_imp_h__
+
+void LoadNotifyImp();
+void UnloadNotifyImp();
+
+#endif // __notify_imp_h__
diff --git a/plugins/Popup/Deprecated/opt_notify.cpp b/plugins/Popup/Deprecated/opt_notify.cpp new file mode 100644 index 0000000000..e54f2de584 --- /dev/null +++ b/plugins/Popup/Deprecated/opt_notify.cpp @@ -0,0 +1,446 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/Deprecated/opt_notify.cpp $
+Revision : $Revision: 1615 $
+Last change on : $Date: 2010-06-23 01:47:57 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+INT_PTR CALLBACK DlgProcPopUps(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hNotify = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ SendDlgItemMessage(hwnd, IDC_SALL, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SALL, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SALL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_POPUP_ON,0));
+
+ SendDlgItemMessage(hwnd, IDC_SOFFLINE, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SOFFLINE, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SOFFLINE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_OFFLINE));
+
+ SendDlgItemMessage(hwnd, IDC_SONLINE, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SONLINE, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SONLINE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_ONLINE));
+
+ SendDlgItemMessage(hwnd, IDC_SAWAY, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SAWAY, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SAWAY, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_AWAY));
+
+ SendDlgItemMessage(hwnd, IDC_SNA, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SNA, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SNA, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_NA));
+
+ SendDlgItemMessage(hwnd, IDC_SOCCUPIED, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SOCCUPIED, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SOCCUPIED, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_OCCUPIED));
+
+ SendDlgItemMessage(hwnd, IDC_SDND, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SDND, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SDND, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_DND));
+
+ SendDlgItemMessage(hwnd, IDC_SFREE4CHAT, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SFREE4CHAT, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SFREE4CHAT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_FREE4CHAT));
+
+ SendDlgItemMessage(hwnd, IDC_SINVISIBLE, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SINVISIBLE, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SINVISIBLE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_INVISIBLE));
+
+ SendDlgItemMessage(hwnd, IDC_SPHONE, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SPHONE, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SPHONE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_ONTHEPHONE));
+
+ SendDlgItemMessage(hwnd, IDC_SLUNCH, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SLUNCH, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SLUNCH, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_STATUS_OUTTOLUNCH));
+
+ return TRUE;
+ }
+
+ case UM_MNOTIFY_CHECK:
+ {
+ if (wParam != 1)
+ {
+ SetWindowLong(hwnd, DWLP_MSGRESULT, FALSE);
+ return 0;
+ }
+
+ hNotify = *(HANDLE *)lParam;
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)hNotify);
+
+ EnableWindow(GetDlgItem(hwnd, IDC_TIMEOUT), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_USEBACKCOLOR), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_USETEXTCOLOR), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_USETIMEOUT), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_LACTION), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_RACTION), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SALL), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SONLINE), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SOFFLINE), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SAWAY), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SNA), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SOCCUPIED), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SDND), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SFREE4CHAT), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SINVISIBLE), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPHONE), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_SLUNCH), lParam);
+ EnableWindow(GetDlgItem(hwnd, IDC_PREVIEW), lParam);
+
+ DWORD dwStatusMode = MNotifyGetDWord(hNotify, NFOPT_POPUP2_STATUSMODE, 0x03ff);
+ CheckDlgButton(hwnd, IDC_SALL, dwStatusMode==0x3ff ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SOFFLINE, dwStatusMode & 0x001 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SONLINE, dwStatusMode & 0x002 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SAWAY, dwStatusMode & 0x004 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SNA, dwStatusMode & 0x008 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SOCCUPIED, dwStatusMode & 0x010 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SDND, dwStatusMode & 0x020 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SFREE4CHAT, dwStatusMode & 0x040 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SINVISIBLE, dwStatusMode & 0x080 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SPHONE, dwStatusMode & 0x100 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SLUNCH, dwStatusMode & 0x200 ? TRUE : FALSE);
+
+ COLORREF cl;
+ if ((cl = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, MNotifyGetDWord(hNotify, NFOPT_BACKCOLOR, 0))) != (COLORREF)-1)
+ {
+ CheckDlgButton(hwnd, IDC_USEBACKCOLOR, BST_UNCHECKED);
+ SendDlgItemMessage(hwnd, IDC_BACKCOLOR, CPM_SETCOLOUR, 0, (LPARAM)cl);
+ EnableWindow(GetDlgItem(hwnd, IDC_BACKCOLOR), TRUE);
+ } else
+ {
+ CheckDlgButton(hwnd, IDC_USEBACKCOLOR, BST_CHECKED);
+ SendDlgItemMessage(hwnd, IDC_BACKCOLOR, CPM_SETCOLOUR, 0, (LPARAM)cl);
+ EnableWindow(GetDlgItem(hwnd, IDC_BACKCOLOR), FALSE);
+ }
+ if ((cl = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, MNotifyGetDWord(hNotify, NFOPT_TEXTCOLOR, 0))) != (COLORREF)-1)
+ {
+ CheckDlgButton(hwnd, IDC_USETEXTCOLOR, BST_UNCHECKED);
+ SendDlgItemMessage(hwnd, IDC_TEXTCOLOR, CPM_SETCOLOUR, 0, (LPARAM)cl);
+ EnableWindow(GetDlgItem(hwnd, IDC_TEXTCOLOR), TRUE);
+ } else
+ {
+ CheckDlgButton(hwnd, IDC_USETEXTCOLOR, BST_CHECKED);
+ SendDlgItemMessage(hwnd, IDC_TEXTCOLOR, CPM_SETCOLOUR, 0, (LPARAM)cl);
+ EnableWindow(GetDlgItem(hwnd, IDC_TEXTCOLOR), FALSE);
+ }
+
+ HWND hwndCombo = GetDlgItem(hwnd, IDC_TIMEOUT);
+ ComboBox_ResetContent(hwndCombo);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "Default"), 0);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "1 second"), 1);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "2 seconds"), 2);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "3 seconds"), 3);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "4 seconds"), 4);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "5 seconds"), 5);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "7 seconds"), 7);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "10 seconds"), 10);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "15 seconds"), 15);
+ ComboBox_SetItemData(hwndCombo, ComboBox_AddString(hwndCombo, "Infinite"), -1);
+
+ int timeout = (int)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TIMEOUT, MNotifyGetDWord(hNotify, NFOPT_TIMEOUT, 0));
+// if (!timeout)
+// {
+// CheckDlgButton(hwnd, IDC_USETIMEOUT, BST_CHECKED);
+// EnableWindow(GetDlgItem(hwnd, IDC_TIMEOUT), FALSE);
+// } else
+ if (timeout < 0)
+ {
+ SetDlgItemText(hwnd, IDC_TIMEOUT, "Infinite");
+ } else
+ {
+ switch (timeout)
+ {
+ case 0: SetDlgItemText(hwnd, IDC_TIMEOUT, "Default"); break;
+ case 1: SetDlgItemText(hwnd, IDC_TIMEOUT, "1 second"); break;
+ case 2: SetDlgItemText(hwnd, IDC_TIMEOUT, "2 seconds"); break;
+ case 3: SetDlgItemText(hwnd, IDC_TIMEOUT, "3 seconds"); break;
+ case 4: SetDlgItemText(hwnd, IDC_TIMEOUT, "4 seconds"); break;
+ case 5: SetDlgItemText(hwnd, IDC_TIMEOUT, "5 seconds"); break;
+ case 7: SetDlgItemText(hwnd, IDC_TIMEOUT, "7 seconds"); break;
+ case 10: SetDlgItemText(hwnd, IDC_TIMEOUT, "10 seconds"); break;
+ case 15: SetDlgItemText(hwnd, IDC_TIMEOUT, "15 seconds"); break;
+ default: SetDlgItemInt(hwnd, IDC_TIMEOUT, timeout, TRUE);
+ }
+ }
+
+ const char *svcLAction = MNotifyGetString(hNotify, NFOPT_POPUP2_LCLICKSVC, "Popup2/DefaultActions");
+ DWORD cookieLAction = MNotifyGetDWord(hNotify, NFOPT_POPUP2_LCLICKCOOKIE, (DWORD)-1);
+ const char *svcRAction = MNotifyGetString(hNotify, NFOPT_POPUP2_RCLICKSVC, "Popup2/DefaultActions");
+ DWORD cookieRAction = MNotifyGetDWord(hNotify, NFOPT_POPUP2_RCLICKCOOKIE, (DWORD)-1);
+
+ int idItem, idRAction=0, idLAction=0;
+ int nActions = MNotifyGetActions(hNotify, 0);
+ HWND hwndLCombo = GetDlgItem(hwnd, IDC_LACTION);
+ HWND hwndRCombo = GetDlgItem(hwnd, IDC_RACTION);
+ ComboBox_ResetContent(hwndLCombo);
+ ComboBox_ResetContent(hwndRCombo);
+ ComboBox_SetItemData(hwndLCombo, ComboBox_AddString(hwndLCombo, "Basic Actions:"), -4);
+ ComboBox_SetItemData(hwndRCombo, ComboBox_AddString(hwndRCombo, "Basic Actions:"), -4);
+ ComboBox_SetItemData(hwndLCombo, idItem = ComboBox_AddString(hwndLCombo, " Send Message"), -1);
+ if (!idLAction && !strcmp(svcLAction, "Popup2/DefaultActions") && cookieLAction==0) idLAction=idItem;
+ ComboBox_SetItemData(hwndRCombo, idItem = ComboBox_AddString(hwndRCombo, " Send Message"), -1);
+ if (!idRAction && !strcmp(svcRAction, "Popup2/DefaultActions") && cookieRAction==0) idRAction=idItem;
+ ComboBox_SetItemData(hwndLCombo, idItem = ComboBox_AddString(hwndLCombo, " Dismiss Popup"), -2);
+ if (!idLAction && !strcmp(svcLAction, "Popup2/DefaultActions") && cookieLAction==1) idLAction=idItem;
+ ComboBox_SetItemData(hwndRCombo, idItem = ComboBox_AddString(hwndRCombo, " Dismiss Popup"), -2);
+ if (!idRAction && !strcmp(svcRAction, "Popup2/DefaultActions") && cookieRAction==1) idRAction=idItem;
+ ComboBox_SetItemData(hwndLCombo, idItem = ComboBox_AddString(hwndLCombo, " Do Nothing"), -3);
+ if (!idLAction && !strcmp(svcLAction, "Popup2/DefaultActions") && cookieLAction==2) idLAction=idItem;
+ ComboBox_SetItemData(hwndRCombo, idItem = ComboBox_AddString(hwndRCombo, " Do Nothing"), -3);
+ if (!idRAction && !strcmp(svcRAction, "Popup2/DefaultActions") && cookieRAction==2) idRAction=idItem;
+ if (nActions)
+ {
+ MNOTIFYACTIONINFO *actions = new MNOTIFYACTIONINFO[nActions];
+ MNotifyGetActions(hNotify, actions);
+ ComboBox_SetItemData(hwndLCombo, ComboBox_AddString(hwndLCombo, "Advanced Actions:"), -3);
+ ComboBox_SetItemData(hwndRCombo, ComboBox_AddString(hwndRCombo, "Advanced Actions:"), -3);
+ for (int i = 0; i < nActions; i++)
+ {
+ char buf[64];
+ wsprintf(buf, " %64s", actions[i].name);
+ ComboBox_SetItemData(hwndLCombo, idItem = ComboBox_AddString(hwndLCombo, buf), i);
+ if (!idLAction && !strcmp(svcLAction, actions[i].service) && cookieLAction==actions[i].cookie) idLAction=idItem;
+ ComboBox_SetItemData(hwndRCombo, idItem = ComboBox_AddString(hwndRCombo, buf), i);
+ if (!idRAction && !strcmp(svcRAction, actions[i].service) && cookieRAction==actions[i].cookie) idRAction=idItem;
+ }
+ delete [] actions;
+ }
+ ComboBox_SetCurSel(hwndLCombo, idLAction?idLAction:1);
+ ComboBox_SetCurSel(hwndRCombo, idRAction?idRAction:2);
+
+ SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE);
+ return TRUE;
+ }
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDC_PREVIEW:
+ {
+ HANDLE hNotifyObj = MNotifyCreate(hNotify);
+ MNotifySetString(hNotifyObj, NFOPT_TITLE, "Popup2");
+ MNotifySetString(hNotifyObj, NFOPT_TEXT, "The new preview :)");
+ MPopup2Show(hNotifyObj);
+ break;
+ }
+ case IDC_USEBACKCOLOR:
+ {
+ if (IsDlgButtonChecked(hwnd, IDC_USEBACKCOLOR))
+ {
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR"/Save",
+ MNotifyGetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, 0));
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, (DWORD)-1);
+ EnableWindow(GetDlgItem(hwnd, IDC_BACKCOLOR), FALSE);
+ } else
+ {
+ COLORREF cl = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR"/Save", 0);
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, (DWORD)cl);
+ SendDlgItemMessage(hwnd, IDC_BACKCOLOR, CPM_SETCOLOUR, 0, (LPARAM)cl);
+ EnableWindow(GetDlgItem(hwnd, IDC_BACKCOLOR), TRUE);
+ }
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ break;
+ }
+ case IDC_USETEXTCOLOR:
+ {
+ if (IsDlgButtonChecked(hwnd, IDC_USETEXTCOLOR))
+ {
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR"/Save",
+ MNotifyGetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, 0));
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, (DWORD)-1);
+ EnableWindow(GetDlgItem(hwnd, IDC_TEXTCOLOR), FALSE);
+ } else
+ {
+ COLORREF cl = (COLORREF)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR"/Save", 0);
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, (DWORD)cl);
+ SendDlgItemMessage(hwnd, IDC_TEXTCOLOR, CPM_SETCOLOUR, 0, (LPARAM)cl);
+ EnableWindow(GetDlgItem(hwnd, IDC_TEXTCOLOR), TRUE);
+ }
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ break;
+ };
+ case IDC_BACKCOLOR:
+ case IDC_TEXTCOLOR:
+ {
+ if (HIWORD(wParam) == CPN_COLOURCHANGED)
+ {
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_BACKCOLOR, (DWORD)SendDlgItemMessage(hwnd,IDC_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_TEXTCOLOR, (DWORD)SendDlgItemMessage(hwnd,IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ }
+ break;
+ }
+ case IDC_TIMEOUT:
+ {
+ int timeout=-2;
+ int idItem;
+ if ((idItem = ComboBox_GetCurSel(GetDlgItem(hwnd, IDC_TIMEOUT))) != CB_ERR)
+ {
+ timeout = (int)ComboBox_GetItemData(GetDlgItem(hwnd, IDC_TIMEOUT), idItem);
+ } else
+ {
+ char buf[64];
+ ComboBox_GetText(GetDlgItem(hwnd, IDC_TIMEOUT), buf, 64);
+ if (*buf >= '0' && *buf <= '9')
+ timeout = atoi(buf);
+ }
+ if (timeout>-2)
+ {
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_TIMEOUT, (DWORD)timeout);
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ } else
+ {
+ timeout = (int)MNotifyGetDWord(hNotify, NFOPT_POPUP2_TIMEOUT, 0);
+ if (timeout < 0) SetDlgItemText(hwnd, IDC_TIMEOUT, "Infinite");
+ else
+ {
+ switch (timeout)
+ {
+ case 0: SetDlgItemText(hwnd, IDC_TIMEOUT, "Default"); break;
+ case 1: SetDlgItemText(hwnd, IDC_TIMEOUT, "1 second"); break;
+ case 2: SetDlgItemText(hwnd, IDC_TIMEOUT, "2 seconds"); break;
+ case 3: SetDlgItemText(hwnd, IDC_TIMEOUT, "3 seconds"); break;
+ case 4: SetDlgItemText(hwnd, IDC_TIMEOUT, "4 seconds"); break;
+ case 5: SetDlgItemText(hwnd, IDC_TIMEOUT, "5 seconds"); break;
+ case 7: SetDlgItemText(hwnd, IDC_TIMEOUT, "7 seconds"); break;
+ case 10: SetDlgItemText(hwnd, IDC_TIMEOUT, "10 seconds"); break;
+ case 15: SetDlgItemText(hwnd, IDC_TIMEOUT, "15 seconds"); break;
+ default: SetDlgItemInt(hwnd, IDC_TIMEOUT, timeout, TRUE);
+ }
+ }
+ }
+ break;
+ }
+ case IDC_LACTION:
+ case IDC_RACTION:
+ {
+ int idCtrl = LOWORD(wParam);
+ HWND hwndCombo = GetDlgItem(hwnd, idCtrl);
+ int idItem;
+ if ((idItem = ComboBox_GetCurSel(hwndCombo)) == CB_ERR)
+ break;
+
+ char *svc=0; DWORD cookie=0;
+ MNOTIFYACTIONINFO *actions=0;
+ int idAction = (int)ComboBox_GetItemData(hwndCombo, idItem);
+ if (idAction == -1)
+ { // message
+ svc = "Popup2/DefaultActions";
+ cookie = 0;
+ } else
+ if (idAction == -2)
+ { // dismiss
+ svc = "Popup2/DefaultActions";
+ cookie = 1;
+ } else
+ if (idAction == -3)
+ { // do nothing
+ svc = "Popup2/DefaultActions";
+ cookie = 2;
+ } else
+ if (idAction >= 0)
+ {
+ int nActions = MNotifyGetActions(hNotify, 0);
+ if (nActions)
+ {
+ actions = new MNOTIFYACTIONINFO[nActions];
+ MNotifyGetActions(hNotify, actions);
+ svc = actions[idAction].service;
+ cookie = actions[idAction].cookie;
+ }
+ } else
+ { // do nothing
+ ComboBox_SetCurSel(hwndCombo, 3);
+ }
+
+ if (svc)
+ {
+ MNotifySetString(hNotify,
+ idCtrl==IDC_LACTION ? NFOPT_POPUP2_LCLICKSVC : NFOPT_POPUP2_RCLICKSVC,
+ svc);
+ MNotifySetDWord(hNotify,
+ idCtrl==IDC_LACTION ? NFOPT_POPUP2_LCLICKCOOKIE : NFOPT_POPUP2_RCLICKCOOKIE,
+ cookie);
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ }
+ if (actions) delete [] actions;
+ break;
+ }
+ case IDC_SALL:
+ {
+ DWORD dwStatusMode = IsDlgButtonChecked(hwnd, IDC_SALL) ? 0x3ff : 0;
+ CheckDlgButton(hwnd, IDC_SOFFLINE, dwStatusMode & 0x001 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SONLINE, dwStatusMode & 0x002 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SAWAY, dwStatusMode & 0x004 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SNA, dwStatusMode & 0x008 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SOCCUPIED, dwStatusMode & 0x010 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SDND, dwStatusMode & 0x020 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SFREE4CHAT, dwStatusMode & 0x040 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SINVISIBLE, dwStatusMode & 0x080 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SPHONE, dwStatusMode & 0x100 ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_SLUNCH, dwStatusMode & 0x200 ? TRUE : FALSE);
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_STATUSMODE, dwStatusMode);
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ break;
+ }
+ case IDC_SOFFLINE:
+ case IDC_SONLINE:
+ case IDC_SAWAY:
+ case IDC_SNA:
+ case IDC_SOCCUPIED:
+ case IDC_SDND:
+ case IDC_SFREE4CHAT:
+ case IDC_SINVISIBLE:
+ case IDC_SPHONE:
+ case IDC_SLUNCH:
+ {
+ DWORD dwStatusMode=0; // = MNotifyGetDWord(hNotify, NFOPT_POPUP2_STATUSMODE, 0x03ff);
+ if (IsDlgButtonChecked(hwnd, IDC_SOFFLINE)) dwStatusMode |= 0x001;
+ if (IsDlgButtonChecked(hwnd, IDC_SONLINE)) dwStatusMode |= 0x002;
+ if (IsDlgButtonChecked(hwnd, IDC_SAWAY)) dwStatusMode |= 0x004;
+ if (IsDlgButtonChecked(hwnd, IDC_SNA)) dwStatusMode |= 0x008;
+ if (IsDlgButtonChecked(hwnd, IDC_SOCCUPIED)) dwStatusMode |= 0x010;
+ if (IsDlgButtonChecked(hwnd, IDC_SDND)) dwStatusMode |= 0x020;
+ if (IsDlgButtonChecked(hwnd, IDC_SFREE4CHAT)) dwStatusMode |= 0x040;
+ if (IsDlgButtonChecked(hwnd, IDC_SINVISIBLE)) dwStatusMode |= 0x080;
+ if (IsDlgButtonChecked(hwnd, IDC_SPHONE)) dwStatusMode |= 0x100;
+ if (IsDlgButtonChecked(hwnd, IDC_SLUNCH)) dwStatusMode |= 0x200;
+ CheckDlgButton(hwnd, IDC_SALL, dwStatusMode==0x3ff ? TRUE : FALSE);
+ MNotifySetDWord(hNotify, NFOPT_POPUP2_STATUSMODE, dwStatusMode);
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ break;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
diff --git a/plugins/Popup/Deprecated/opt_notify.h b/plugins/Popup/Deprecated/opt_notify.h new file mode 100644 index 0000000000..2b3618360d --- /dev/null +++ b/plugins/Popup/Deprecated/opt_notify.h @@ -0,0 +1,38 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/Deprecated/opt_notify.h $
+Revision : $Revision: 1615 $
+Last change on : $Date: 2010-06-23 01:47:57 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_notify_h__
+#define __opt_notify_h__
+
+INT_PTR CALLBACK DlgProcPopUps(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif // __opt_notify_h__
diff --git a/plugins/Popup/Deprecated/opt_old.cpp b/plugins/Popup/Deprecated/opt_old.cpp new file mode 100644 index 0000000000..909cddb040 --- /dev/null +++ b/plugins/Popup/Deprecated/opt_old.cpp @@ -0,0 +1,87 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_old.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+
+void RestartNeeded_adv(HWND hwndDlg){
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ICO_RESTART), SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_TXT_RESTART), SW_SHOW);
+}
+
+void LoadOption_OldOpts() {
+}
+
+INT_PTR CALLBACK DlgProcPopUpOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+ switch (msg) {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+
+ return TRUE;
+ }
+ //End WM_INITDIALOG
+ case WM_COMMAND: {
+ WORD idCtrl = LOWORD(wParam), wNotifyCode = HIWORD(wParam);
+ if (wNotifyCode == BN_KILLFOCUS || wNotifyCode == BN_SETFOCUS) return TRUE;
+ //These are simple clicks: we don't save, but we tell the Options Page to enable the "Apply" button.
+ switch(idCtrl) {
+ case IDC_PREVIEW:
+ PopUpPreview();
+ break;
+ } //End switch(WM_COMMAND)
+ break;
+ //End WM_COMMAND
+ }
+ case WM_NOTIFY: { //Here we have pressed either the OK or the APPLY button.
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ //Restore the options stored in memory.
+ LoadOption_OldOpts();
+ return TRUE;
+ case PSN_APPLY: {
+ return TRUE;
+ } //case PSN_APPLY
+ } // switch code
+ break;
+ } //switch idFrom
+ break; //End WM_NOTIFY
+ }
+ case UM_SETDLGITEMINT:
+ SetDlgItemInt(hwndDlg, (int)wParam, (int)lParam, FALSE);
+ break;
+ } //switch message
+ return FALSE;
+}
+
diff --git a/plugins/Popup/Deprecated/opt_old.h b/plugins/Popup/Deprecated/opt_old.h new file mode 100644 index 0000000000..5572558b4d --- /dev/null +++ b/plugins/Popup/Deprecated/opt_old.h @@ -0,0 +1,39 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_old.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_old_h__
+#define __opt_old_h__
+
+void LoadOption_OldOpts();
+INT_PTR CALLBACK DlgProcPopUpOpts(HWND, UINT, WPARAM, LPARAM);
+
+#endif // __opt_old_h__
diff --git a/plugins/Popup/Deprecated/res_notify.h b/plugins/Popup/Deprecated/res_notify.h new file mode 100644 index 0000000000..bcd3b779ee --- /dev/null +++ b/plugins/Popup/Deprecated/res_notify.h @@ -0,0 +1,36 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDD_OPT_POPUPS 171
+#define IDC_PREVIEW 1033
+#define IDC_USEBACKCOLOR 1091
+#define IDC_USETEXTCOLOR 1092
+#define IDC_USETIMEOUT 1094
+#define IDC_LACTION 1096
+#define IDC_RACTION 1097
+#define IDC_SOFFLINE 1099
+#define IDC_SONLINE 1100
+#define IDC_SAWAY 1101
+#define IDC_SNA 1102
+#define IDC_SOCCUPIED 1103
+#define IDC_SDND 1104
+#define IDC_SFREE4CHAT 1105
+#define IDC_SINVISIBLE 1106
+#define IDC_SPHONE 1107
+#define IDC_SLUNCH 1108
+#define IDC_SALL 1109
+#define IDC_TIMEOUT 1110
+#define IDC_BACKCOLOR 1111
+#define IDC_TEXTCOLOR 1112
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 224
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1218
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/Popup/Deprecated/res_notify.rc b/plugins/Popup/Deprecated/res_notify.rc new file mode 100644 index 0000000000..d2f3e505f8 --- /dev/null +++ b/plugins/Popup/Deprecated/res_notify.rc @@ -0,0 +1,135 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "res_notify.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_POPUPS DIALOGEX 0, 0, 207, 217
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ COMBOBOX IDC_LACTION,55,84,142,55,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_RACTION,55,103,142,55,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Left Click:",IDC_STATIC,8,84,42,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ LTEXT "Right Click:",IDC_STATIC,8,103,42,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ PUSHBUTTON "Preview",IDC_PREVIEW,145,200,57,12,WS_DISABLED
+ CONTROL "",IDC_SOFFLINE,"MButtonClass",WS_DISABLED | WS_TABSTOP,37,137,16,14
+ CONTROL "",IDC_SONLINE,"MButtonClass",WS_DISABLED | WS_TABSTOP,53,137,16,14
+ CONTROL "",IDC_SAWAY,"MButtonClass",WS_DISABLED | WS_TABSTOP,69,137,16,14
+ CONTROL "",IDC_SNA,"MButtonClass",WS_DISABLED | WS_TABSTOP,85,137,16,14
+ CONTROL "",IDC_SOCCUPIED,"MButtonClass",WS_DISABLED | WS_TABSTOP,101,137,16,14
+ CONTROL "",IDC_SDND,"MButtonClass",WS_DISABLED | WS_TABSTOP,117,137,16,14
+ CONTROL "",IDC_SFREE4CHAT,"MButtonClass",WS_DISABLED | WS_TABSTOP,133,137,16,14
+ CONTROL "",IDC_SINVISIBLE,"MButtonClass",WS_DISABLED | WS_TABSTOP,149,137,16,14
+ CONTROL "",IDC_SPHONE,"MButtonClass",WS_DISABLED | WS_TABSTOP,165,137,16,14
+ CONTROL "",IDC_SLUNCH,"MButtonClass",WS_DISABLED | WS_TABSTOP,181,137,16,14
+ CONTROL "A",IDC_SALL,"MButtonClass",WS_TABSTOP,16,137,16,14
+ GROUPBOX "Style",IDC_STATIC,4,5,198,63
+ CONTROL "",IDC_BACKCOLOR,"ColourPicker",WS_DISABLED | WS_TABSTOP,55,15,48,12
+ LTEXT "Background:",IDC_STATIC,8,15,42,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ CONTROL "",IDC_TEXTCOLOR,"ColourPicker",WS_DISABLED | WS_TABSTOP,55,32,48,12
+ LTEXT "Text:",IDC_STATIC,8,32,42,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ CONTROL "Use Default",IDC_USEBACKCOLOR,"Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_DISABLED | WS_TABSTOP,108,15,89,12
+ CONTROL "Use Default",IDC_USETEXTCOLOR,"Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_DISABLED | WS_TABSTOP,108,32,89,12
+ LTEXT "Timeout:",IDC_STATIC,8,49,42,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ CONTROL "Use Default",IDC_USETIMEOUT,"Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,108,49,89,12
+ GROUPBOX "Interaction",IDC_STATIC,4,73,198,48
+ GROUPBOX "Display when",IDC_STATIC,4,126,198,31
+ COMBOBOX IDC_TIMEOUT,55,49,48,126,CBS_DROPDOWN | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_OPT_POPUPS DLGINIT
+BEGIN
+ IDC_LACTION, 0x403, 13, 0
+0x6553, 0x646e, 0x4d20, 0x7365, 0x6173, 0x6567, "\000"
+ IDC_LACTION, 0x403, 14, 0
+0x6944, 0x6d73, 0x7369, 0x2073, 0x6f50, 0x7570, 0x0070,
+ IDC_RACTION, 0x403, 13, 0
+0x6553, 0x646e, 0x4d20, 0x7365, 0x6173, 0x6567, "\000"
+ IDC_RACTION, 0x403, 14, 0
+0x6944, 0x6d73, 0x7369, 0x2073, 0x6f50, 0x7570, 0x0070,
+ 0
+END
+
+#endif // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Italienisch (Italien) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
+#ifdef _WIN32
+LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Italienisch (Italien) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/Popup/PopUp.dsp b/plugins/Popup/PopUp.dsp new file mode 100644 index 0000000000..9531d30e12 --- /dev/null +++ b/plugins/Popup/PopUp.dsp @@ -0,0 +1,628 @@ +# Microsoft Developer Studio Project File - Name="PopUp" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=PopUp - Win32 Debug Unicode
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "PopUp.mak".
+!MESSAGE
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "PopUp.mak" CFG="PopUp - Win32 Debug Unicode"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "PopUp - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "PopUp - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "PopUp - Win32 Debug Unicode" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "PopUp - Win32 Release Unicode" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "PopUp - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release/Obj"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W2 /GX /Zi /O2 /I "../../include" /I "../../include_API" /I "./include_API" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /Yu"headers.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /win32
+# SUBTRACT MTL /mktyplib203
+# ADD BASE RSC /l 0x410 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+# SUBTRACT RSC /x
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib gdiplus.lib comdlg32.lib comctl32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib msimg32.lib /nologo /base:"0x55550000" /dll /debug /machine:I386 /nodefaultlib:"LIBC"
+# SUBTRACT LINK32 /pdb:none /map
+
+!ELSEIF "$(CFG)" == "PopUp - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug/Obj"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W2 /Gm /Gi /GX /ZI /Od /I "../../include" /I "../../include_API" /I "./include_API" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /Fr /Yu"headers.h" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x410 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo /o"Debug/obj/PopUp.bsc"
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 msimg32.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib comdlg32.lib comctl32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib msimg32.lib /nologo /base:"0x55550000" /dll /debug /machine:I386 /pdbtype:sept /mapinfo:exports /mapinfo:lines
+# SUBTRACT LINK32 /pdb:none /map /nodefaultlib
+
+!ELSEIF "$(CFG)" == "PopUp - Win32 Debug Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "PopUp___Win32_Debug_Unicode"
+# PROP BASE Intermediate_Dir "PopUp___Win32_Debug_Unicode"
+# PROP BASE Ignore_Export_Lib 1
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_Unicode"
+# PROP Intermediate_Dir "Debug_Unicode/Obj"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W2 /Gm /Gi /GX /ZI /Od /I "../../include" /I "../../include_API" /I "./include_API" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /Fr /Yu"headers.h" /FD /c
+# ADD CPP /nologo /MTd /W2 /Gm /Gi /GX /ZI /Od /I "../../include" /I "../../include_API" /I "./include_API" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /D "_UNICODE" /D "UNICODE" /Fr /Yu"headers.h" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG" /d "_UNICODE" /d "UNICODE"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo /o"Debug/obj/PopUp.bsc"
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 msimg32.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib comdlg32.lib comctl32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x55550000" /dll /debug /machine:I386 /pdbtype:sept /mapinfo:exports /mapinfo:lines
+# SUBTRACT BASE LINK32 /pdb:none /map /nodefaultlib
+# ADD LINK32 msimg32.lib kernel32.lib user32.lib gdi32.lib gdiplus.lib comdlg32.lib comctl32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib msimg32.lib /nologo /base:"0x55550000" /dll /debug /machine:I386 /out:"Debug_Unicode/PopUpW.dll" /pdbtype:sept /mapinfo:exports /mapinfo:lines
+# SUBTRACT LINK32 /pdb:none /map /nodefaultlib
+
+!ELSEIF "$(CFG)" == "PopUp - Win32 Release Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "PopUp___Win32_Release_Unicode"
+# PROP BASE Intermediate_Dir "PopUp___Win32_Release_Unicode"
+# PROP BASE Ignore_Export_Lib 1
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_Unicode"
+# PROP Intermediate_Dir "Release_Unicode/Obj"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W2 /GX /Zi /O2 /I "../../include" /I "../../include_API" /I "./include_API" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /Yu"headers.h" /FD /c
+# SUBTRACT BASE CPP /Fr
+# ADD CPP /nologo /MD /W2 /GX /Zi /O2 /I "../../include" /I "../../include_API" /I "./include_API" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "POPUP_EXPORTS" /D "_UNICODE" /D "UNICODE" /Fr /Yu"headers.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# SUBTRACT BASE MTL /mktyplib203
+# ADD MTL /nologo /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /win32
+# SUBTRACT MTL /mktyplib203
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# SUBTRACT BASE RSC /x
+# ADD RSC /l 0x409 /d "NDEBUG" /d "_UNICODE" /d "UNICODE"
+# SUBTRACT RSC /x
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib gdiplus.lib comdlg32.lib comctl32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x55550000" /dll /debug /machine:I386 /nodefaultlib:"LIBC"
+# SUBTRACT BASE LINK32 /pdb:none /map
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib gdiplus.lib comdlg32.lib comctl32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib msimg32.lib /nologo /base:"0x55550000" /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"Release_Unicode/PopUpW.dll"
+# SUBTRACT LINK32 /pdb:none /map
+
+!ENDIF
+
+# Begin Target
+
+# Name "PopUp - Win32 Release"
+# Name "PopUp - Win32 Debug"
+# Name "PopUp - Win32 Debug Unicode"
+# Name "PopUp - Win32 Release Unicode"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\actions.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars_flash.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars_gif.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars_simple.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\bitmap_funcs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\config.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\effects.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\font.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\formula.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\headers.cpp
+# ADD CPP /Yc"headers.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\history.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\icons.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\main.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\notifications.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\popup_gdiplus.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\popup_thread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\popup_wnd2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\services.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\skin.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\srmm_menu.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\src\actions.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars_flash.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars_gif.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\avatars_simple.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\bitmap_funcs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\effects.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\font.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\formula.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\history.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\icons.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\notifications.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\popup_gdiplus.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\popup_thread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\popup_wnd2.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\services.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\skin.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\srmm_menu.h
+# End Source File
+# End Group
+# Begin Group "defs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\def_settings.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\defs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\headers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\m_avatars.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_folders.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\m_fontservice.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_ieview.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\api\m_MathModule.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_nconvers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_notify_popup.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\m_popup.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\api\m_popup2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_smileyadd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_text.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_ticker.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_toolbar.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_toptoolbar.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include_API\m_updater.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\add.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\auto.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\avatar.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\block.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Check_off.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Check_on.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\classic.popupskin
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\close.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\error.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\favorite.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\fullscreen.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\img.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\info.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\menu.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\message.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\notify.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\ok.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\pin.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\pinned.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup_fav.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup_fs.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup_group.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup_history.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup_no.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\popup_plus.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Radio_off.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Radio_on.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\reload.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\reply.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res_vc6.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\resize.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\warning.ico
+# End Source File
+# End Group
+# Begin Group "docs"
+
+# PROP Default_Filter "txt"
+# Begin Source File
+
+SOURCE=.\docs\Changelog.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\whatsnew.txt
+# End Source File
+# End Group
+# Begin Group "Option Pages"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\opt_adv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_adv.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_class.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_class.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_contacts.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_contacts.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_gen.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_gen.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_old.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_old.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_skins.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opt_skins.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opttree.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\opttree.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\src\common.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\version.h
+# End Source File
+# End Target
+# End Project
diff --git a/plugins/Popup/PopUp.dsw b/plugins/Popup/PopUp.dsw new file mode 100644 index 0000000000..b486c357b6 --- /dev/null +++ b/plugins/Popup/PopUp.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "PopUp"=".\PopUp.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/plugins/Popup/PopUp_10.sln b/plugins/Popup/PopUp_10.sln new file mode 100644 index 0000000000..896b278d98 --- /dev/null +++ b/plugins/Popup/PopUp_10.sln @@ -0,0 +1,38 @@ +
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PopUp", "PopUp_10.vcxproj", "{726460C7-E1F1-4C37-B64F-DA8A8DD26D70}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug 2in1|Win32 = Debug 2in1|Win32
+ Debug 2in1|x64 = Debug 2in1|x64
+ Debug Unicode|Win32 = Debug Unicode|Win32
+ Debug Unicode|x64 = Debug Unicode|x64
+ Release 2in1|Win32 = Release 2in1|Win32
+ Release 2in1|x64 = Release 2in1|x64
+ Release Unicode|Win32 = Release Unicode|Win32
+ Release Unicode|x64 = Release Unicode|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug 2in1|Win32.ActiveCfg = Debug 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug 2in1|Win32.Build.0 = Debug 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug 2in1|x64.ActiveCfg = Debug 2in1|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug 2in1|x64.Build.0 = Debug 2in1|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug Unicode|x64.Build.0 = Debug Unicode|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release 2in1|Win32.ActiveCfg = Release 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release 2in1|Win32.Build.0 = Release 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release 2in1|x64.ActiveCfg = Release 2in1|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release 2in1|x64.Build.0 = Release 2in1|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release Unicode|x64.ActiveCfg = Release Unicode|x64
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release Unicode|x64.Build.0 = Release Unicode|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/plugins/Popup/PopUp_10.vcxproj b/plugins/Popup/PopUp_10.vcxproj new file mode 100644 index 0000000000..5625360832 --- /dev/null +++ b/plugins/Popup/PopUp_10.vcxproj @@ -0,0 +1,585 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug 2in1|Win32">
+ <Configuration>Debug 2in1</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug 2in1|x64">
+ <Configuration>Debug 2in1</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug Unicode|Win32">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug Unicode|x64">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release 2in1|Win32">
+ <Configuration>Release 2in1</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release 2in1|x64">
+ <Configuration>Release 2in1</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|Win32">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|x64">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>PopUp</ProjectName>
+ <ProjectGuid>{726460C7-E1F1-4C37-B64F-DA8A8DD26D70}</ProjectGuid>
+ <RootNamespace>PopUp</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pch%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)%3b$(TargetDir)$(ProjectName).*%3b$(TargetDir)$(RootNamespace).*</ExtensionsToDeleteOnClean>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">true</IgnoreImportLibrary>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pch%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)%3b$(TargetDir)$(ProjectName).*%3b$(TargetDir)$(RootNamespace).*</ExtensionsToDeleteOnClean>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">true</IgnoreImportLibrary>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pch%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)%3b$(TargetDir)$(ProjectName).*%3b$(TargetDir)$(RootNamespace).*</ExtensionsToDeleteOnClean>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">true</IgnoreImportLibrary>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pch%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)%3b$(TargetDir)$(ProjectName).*%3b$(TargetDir)$(RootNamespace).*</ExtensionsToDeleteOnClean>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">true</IgnoreImportLibrary>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">false</LinkIncremental>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(ProjectName)W</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(ProjectName)W</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">$(ProjectName)</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">$(ProjectName)</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(ProjectName)W</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(ProjectName)W</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Release/PopUp.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(RootNamespace).dll</OutputFile>
+ <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <MapFileName>$(TargetDir)$(TargetName).map</MapFileName>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformationFile>$(IntDir)</BrowseInformationFile>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0410</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(TargetDir)$(TargetName).map</MapFileName>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformationFile>$(IntDir)</BrowseInformationFile>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0410</Culture>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(TargetDir)$(TargetName).map</MapFileName>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>.\Release/PopUp.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>headers.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(RootNamespace)W.dll</OutputFile>
+ <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <MapFileName>$(TargetDir)$(TargetName).map</MapFileName>
+ <BaseAddress>0x55550000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="src\actions.cpp" />
+ <ClCompile Include="src\avatars.cpp" />
+ <ClCompile Include="src\avatars_flash.cpp" />
+ <ClCompile Include="src\avatars_gif.cpp" />
+ <ClCompile Include="src\avatars_simple.cpp" />
+ <ClCompile Include="src\bitmap_funcs.cpp" />
+ <ClCompile Include="src\config.cpp" />
+ <ClCompile Include="src\effects.cpp" />
+ <ClCompile Include="src\font.cpp" />
+ <ClCompile Include="src\formula.cpp" />
+ <ClCompile Include="src\headers.cpp" />
+ <ClCompile Include="src\history.cpp" />
+ <ClCompile Include="src\icons.cpp" />
+ <ClCompile Include="src\main.cpp">
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release 2in1|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug 2in1|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release 2in1|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="src\notifications.cpp" />
+ <ClCompile Include="src\popup_gdiplus.cpp" />
+ <ClCompile Include="src\popup_thread.cpp" />
+ <ClCompile Include="src\popup_wnd2.cpp" />
+ <ClCompile Include="src\services.cpp" />
+ <ClCompile Include="src\skin.cpp" />
+ <ClCompile Include="src\srmm_menu.cpp" />
+ <ClCompile Include="src\opt_adv.cpp" />
+ <ClCompile Include="src\opt_class.cpp" />
+ <ClCompile Include="src\opt_contacts.cpp" />
+ <ClCompile Include="src\opt_gen.cpp" />
+ <ClCompile Include="src\opt_skins.cpp" />
+ <ClCompile Include="src\opttree.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\actions.h" />
+ <ClInclude Include="src\avatars.h" />
+ <ClInclude Include="src\avatars_flash.h" />
+ <ClInclude Include="src\avatars_gif.h" />
+ <ClInclude Include="src\avatars_simple.h" />
+ <ClInclude Include="src\bitmap_funcs.h" />
+ <ClInclude Include="src\effects.h" />
+ <ClInclude Include="src\font.h" />
+ <ClInclude Include="src\formula.h" />
+ <ClInclude Include="src\history.h" />
+ <ClInclude Include="src\icons.h" />
+ <ClInclude Include="src\notifications.h" />
+ <ClInclude Include="src\popup_gdiplus.h" />
+ <ClInclude Include="src\popup_thread.h" />
+ <ClInclude Include="src\popup_wnd2.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="src\services.h" />
+ <ClInclude Include="src\skin.h" />
+ <ClInclude Include="src\srmm_menu.h" />
+ <ClInclude Include="src\config.h" />
+ <ClInclude Include="src\def_settings.h" />
+ <ClInclude Include="src\defs.h" />
+ <ClInclude Include="src\headers.h" />
+ <ClInclude Include="src\opt_adv.h" />
+ <ClInclude Include="src\opt_class.h" />
+ <ClInclude Include="src\opt_contacts.h" />
+ <ClInclude Include="src\opt_gen.h" />
+ <ClInclude Include="src\opt_skins.h" />
+ <ClInclude Include="src\opttree.h" />
+ <ClInclude Include="src\common.h" />
+ <ClInclude Include="version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\add.ico" />
+ <None Include="res\auto.ico" />
+ <None Include="res\avatar.bmp" />
+ <None Include="res\block.ico" />
+ <None Include="res\Check_off.ico" />
+ <None Include="res\Check_on.ico" />
+ <None Include="res\classic.popupskin" />
+ <None Include="res\close.ico" />
+ <None Include="res\error.ico" />
+ <None Include="res\favorite.ico" />
+ <None Include="res\fullscreen.ico" />
+ <None Include="res\img.ico" />
+ <None Include="res\info.ico" />
+ <None Include="res\menu.ico" />
+ <None Include="res\message.ico" />
+ <None Include="res\notify.ico" />
+ <None Include="res\ok.ico" />
+ <None Include="res\pin.ico" />
+ <None Include="res\pinned.ico" />
+ <None Include="res\popup.ico" />
+ <None Include="res\popup_fav.ico" />
+ <None Include="res\popup_fs.ico" />
+ <None Include="res\popup_group.ico" />
+ <None Include="res\popup_history.ico" />
+ <None Include="res\popup_no.ico" />
+ <None Include="res\popup_plus.ico" />
+ <None Include="res\Radio_off.ico" />
+ <None Include="res\Radio_on.ico" />
+ <None Include="res\reload.ico" />
+ <None Include="res\reply.ico" />
+ <None Include="res\resize.ico" />
+ <None Include="res\warning.ico" />
+ <None Include="docs\Changelog.txt" />
+ <None Include="docs\todo.txt" />
+ <None Include="res\whatsnew.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc" />
+ <ResourceCompile Include="version.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/Popup/PopUp_10.vcxproj.filters b/plugins/Popup/PopUp_10.vcxproj.filters new file mode 100644 index 0000000000..e65196d25e --- /dev/null +++ b/plugins/Popup/PopUp_10.vcxproj.filters @@ -0,0 +1,323 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{61f0630d-a9c2-4602-8ca0-6a2efe952820}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{58b87470-6530-4485-8a11-2b34996c3d54}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="defs">
+ <UniqueIdentifier>{0fd67b29-f530-424d-a3c6-9cff1c322fe9}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{19999220-077c-4521-b4e8-e28baf26ea12}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ <Filter Include="docs">
+ <UniqueIdentifier>{2c54b55f-1f99-474e-99ef-34c8f4210772}</UniqueIdentifier>
+ <Extensions>txt</Extensions>
+ </Filter>
+ <Filter Include="Deprecatet">
+ <UniqueIdentifier>{1316908b-5179-4ca2-abc4-3ba591f6489c}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Option Pages">
+ <UniqueIdentifier>{529f787f-6a3b-402b-8451-73ab712c2fd5}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="src\actions.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\avatars.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\avatars_flash.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\avatars_gif.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\avatars_simple.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\bitmap_funcs.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\config.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\effects.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\font.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\formula.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\headers.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\history.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\icons.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\notifications.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\popup_gdiplus.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\popup_thread.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\popup_wnd2.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\services.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\skin.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\srmm_menu.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\opt_adv.cpp">
+ <Filter>Option Pages</Filter>
+ </ClCompile>
+ <ClCompile Include="src\opt_class.cpp">
+ <Filter>Option Pages</Filter>
+ </ClCompile>
+ <ClCompile Include="src\opt_contacts.cpp">
+ <Filter>Option Pages</Filter>
+ </ClCompile>
+ <ClCompile Include="src\opt_gen.cpp">
+ <Filter>Option Pages</Filter>
+ </ClCompile>
+ <ClCompile Include="src\opt_skins.cpp">
+ <Filter>Option Pages</Filter>
+ </ClCompile>
+ <ClCompile Include="src\opttree.cpp">
+ <Filter>Option Pages</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\actions.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\avatars.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\avatars_flash.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\avatars_gif.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\avatars_simple.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\bitmap_funcs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\effects.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\font.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\formula.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\history.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\icons.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\notifications.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\popup_gdiplus.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\popup_thread.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\popup_wnd2.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\services.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\skin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\srmm_menu.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\config.h">
+ <Filter>defs</Filter>
+ </ClInclude>
+ <ClInclude Include="src\def_settings.h">
+ <Filter>defs</Filter>
+ </ClInclude>
+ <ClInclude Include="src\defs.h">
+ <Filter>defs</Filter>
+ </ClInclude>
+ <ClInclude Include="src\headers.h">
+ <Filter>defs</Filter>
+ </ClInclude>
+ <ClInclude Include="src\opt_adv.h">
+ <Filter>Option Pages</Filter>
+ </ClInclude>
+ <ClInclude Include="src\opt_class.h">
+ <Filter>Option Pages</Filter>
+ </ClInclude>
+ <ClInclude Include="src\opt_contacts.h">
+ <Filter>Option Pages</Filter>
+ </ClInclude>
+ <ClInclude Include="src\opt_gen.h">
+ <Filter>Option Pages</Filter>
+ </ClInclude>
+ <ClInclude Include="src\opt_skins.h">
+ <Filter>Option Pages</Filter>
+ </ClInclude>
+ <ClInclude Include="src\opttree.h">
+ <Filter>Option Pages</Filter>
+ </ClInclude>
+ <ClInclude Include="src\common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\add.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\auto.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\avatar.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\block.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Check_off.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Check_on.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\classic.popupskin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\close.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\error.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\favorite.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\fullscreen.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\img.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\info.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\menu.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\message.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\notify.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\ok.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\pin.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\pinned.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup_fav.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup_fs.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup_group.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup_history.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup_no.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\popup_plus.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Radio_off.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Radio_on.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\reload.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\reply.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\resize.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\warning.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="docs\Changelog.txt">
+ <Filter>docs</Filter>
+ </None>
+ <None Include="docs\todo.txt">
+ <Filter>docs</Filter>
+ </None>
+ <None Include="res\whatsnew.txt">
+ <Filter>docs</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/Popup/PopUp_8.sln b/plugins/Popup/PopUp_8.sln new file mode 100644 index 0000000000..eb405fb731 --- /dev/null +++ b/plugins/Popup/PopUp_8.sln @@ -0,0 +1,24 @@ +
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PopUpPlus", "PopUp_8.vcproj", "{726460C7-E1F1-4C37-B64F-DA8A8DD26D70}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug 2in1|Win32 = Debug 2in1|Win32
+ Debug Unicode|Win32 = Debug Unicode|Win32
+ Release 2in1|Win32 = Release 2in1|Win32
+ Release Unicode|Win32 = Release Unicode|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug 2in1|Win32.ActiveCfg = Debug 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug 2in1|Win32.Build.0 = Debug 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release 2in1|Win32.ActiveCfg = Release 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release 2in1|Win32.Build.0 = Release 2in1|Win32
+ {726460C7-E1F1-4C37-B64F-DA8A8DD26D70}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/plugins/Popup/PopUp_8.vcproj b/plugins/Popup/PopUp_8.vcproj new file mode 100644 index 0000000000..2c87fedb02 --- /dev/null +++ b/plugins/Popup/PopUp_8.vcproj @@ -0,0 +1,1659 @@ +<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="PopUpPlus"
+ ProjectGUID="{726460C7-E1F1-4C37-B64F-DA8A8DD26D70}"
+ RootNamespace="PopUp"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release 2in1|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/PopUp.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace).dll"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="LIBC"
+ GenerateDebugInformation="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug 2in1|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1040"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace).dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;_UNICODE;UNICODE"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1040"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace)W.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/PopUp.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;_UNICODE;UNICODE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace)W.dll"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="LIBC"
+ GenerateDebugInformation="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath=".\src\actions.cpp"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\avatars_flash.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\avatars_gif.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\avatars_simple.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\bitmap_funcs.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\config.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\effects.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\font.cpp"
+ >
+ </File>
+ <File
+ RelativePath="src\formula.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\headers.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\history.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\icons.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\main.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\notifications.cpp"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_gdiplus.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\popup_thread.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\popup_wnd2.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\services.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\skin.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\srmm_menu.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\src\actions.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars_flash.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars_gif.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars_simple.h"
+ >
+ </File>
+ <File
+ RelativePath="src\bitmap_funcs.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\effects.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\font.h"
+ >
+ </File>
+ <File
+ RelativePath="src\formula.h"
+ >
+ </File>
+ <File
+ RelativePath="src\history.h"
+ >
+ </File>
+ <File
+ RelativePath="src\icons.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\notifications.h"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_gdiplus.h"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_thread.h"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_wnd2.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath="src\services.h"
+ >
+ </File>
+ <File
+ RelativePath="src\skin.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\srmm_menu.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="defs"
+ >
+ <File
+ RelativePath="src\config.h"
+ >
+ </File>
+ <File
+ RelativePath="src\def_settings.h"
+ >
+ </File>
+ <File
+ RelativePath="src\defs.h"
+ >
+ </File>
+ <File
+ RelativePath="src\headers.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\m_avatars.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_folders.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\m_fontservice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_ieview.h"
+ >
+ </File>
+ <File
+ RelativePath="api\m_MathModule.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_nconvers.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_notify_popup.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\m_popup.h"
+ >
+ </File>
+ <File
+ RelativePath="api\m_popup2.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_smileyadd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_text.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_ticker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_toolbar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_toptoolbar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_updater.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath=".\res\add.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\auto.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\avatar.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\res\block.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Check_off.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Check_on.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\classic.popupskin"
+ >
+ </File>
+ <File
+ RelativePath=".\res\close.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\error.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\favorite.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\fullscreen.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\img.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\info.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\menu.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\message.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\notify.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\ok.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\pin.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\pinned.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_fav.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_fs.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_group.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_history.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_no.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_plus.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Radio_off.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Radio_on.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\reload.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\reply.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\resize.ico"
+ >
+ </File>
+ <File
+ RelativePath="resource.rc"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\res\warning.ico"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="docs"
+ Filter="txt"
+ >
+ <File
+ RelativePath=".\docs\Changelog.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\docs\todo.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\res\whatsnew.txt"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Deprecatet"
+ >
+ <File
+ RelativePath="..\..\include_API\m_notify.h"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\notify_imp.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\notify_imp.h"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\opt_notify.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\opt_notify.h"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Option Pages"
+ >
+ <File
+ RelativePath=".\src\opt_adv.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_adv.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_class.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_class.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_contacts.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_contacts.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_gen.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_gen.h"
+ >
+ </File>
+ <File
+ RelativePath="src\opt_skins.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\opt_skins.h"
+ >
+ </File>
+ <File
+ RelativePath="src\opttree.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\opttree.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="src\common.h"
+ >
+ </File>
+ <File
+ RelativePath="version.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/Popup/PopUp_9.vcproj b/plugins/Popup/PopUp_9.vcproj new file mode 100644 index 0000000000..d21c1bc96a --- /dev/null +++ b/plugins/Popup/PopUp_9.vcproj @@ -0,0 +1,2788 @@ +<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="PopUpPlus"
+ ProjectGUID="{726460C7-E1F1-4C37-B64F-DA8A8DD26D70}"
+ RootNamespace="PopUp"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release 2in1|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/PopUp.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace).dll"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="LIBC"
+ GenerateDebugInformation="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release 2in1|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace).dll"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="LIBC"
+ GenerateDebugInformation="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug 2in1|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1040"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace).dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug 2in1|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1040"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace).dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE"
+ Culture="1040"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace)W.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE"
+ Culture="1040"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace)W.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace)W.dll"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="LIBC"
+ GenerateDebugInformation="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pch;*.pgc;*.pgd;*.meta;$(TargetPath);$(TargetDir)$(ProjectName).*;$(TargetDir)$(RootNamespace).*"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/PopUp.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUP_EXPORTS;MTEXT_NOHELPERS;_UNICODE;UNICODE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="headers.h"
+ AssemblerListingLocation="$(IntDir)/"
+ ObjectFile="$(IntDir)/"
+ ProgramDataBaseFileName="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="msimg32.lib gdiplus.lib comctl32.lib"
+ OutputFile="$(OutDir)\$(RootNamespace)W.dll"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="LIBC"
+ GenerateDebugInformation="true"
+ MapFileName="$(TargetDir)$(TargetName).map"
+ BaseAddress="0x55550000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath=".\src\actions.cpp"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\avatars_flash.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\avatars_gif.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\avatars_simple.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\bitmap_funcs.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\config.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\effects.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\font.cpp"
+ >
+ </File>
+ <File
+ RelativePath="src\formula.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\headers.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\history.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\icons.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\main.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\notifications.cpp"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_gdiplus.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\popup_thread.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\popup_wnd2.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\services.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\skin.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\src\srmm_menu.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\src\actions.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars_flash.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars_gif.h"
+ >
+ </File>
+ <File
+ RelativePath="src\avatars_simple.h"
+ >
+ </File>
+ <File
+ RelativePath="src\bitmap_funcs.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\effects.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\font.h"
+ >
+ </File>
+ <File
+ RelativePath="src\formula.h"
+ >
+ </File>
+ <File
+ RelativePath="src\history.h"
+ >
+ </File>
+ <File
+ RelativePath="src\icons.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\notifications.h"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_gdiplus.h"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_thread.h"
+ >
+ </File>
+ <File
+ RelativePath="src\popup_wnd2.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath="src\services.h"
+ >
+ </File>
+ <File
+ RelativePath="src\skin.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\srmm_menu.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="defs"
+ >
+ <File
+ RelativePath="src\config.h"
+ >
+ </File>
+ <File
+ RelativePath="src\def_settings.h"
+ >
+ </File>
+ <File
+ RelativePath="src\defs.h"
+ >
+ </File>
+ <File
+ RelativePath="src\headers.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\m_avatars.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_folders.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\m_fontservice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_ieview.h"
+ >
+ </File>
+ <File
+ RelativePath="api\m_MathModule.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_nconvers.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_notify_popup.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\m_popup.h"
+ >
+ </File>
+ <File
+ RelativePath="api\m_popup2.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_smileyadd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_text.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_ticker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_toolbar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_toptoolbar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include_API\m_updater.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath=".\res\add.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\auto.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\avatar.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\res\block.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Check_off.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Check_on.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\classic.popupskin"
+ >
+ </File>
+ <File
+ RelativePath=".\res\close.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\error.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\favorite.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\fullscreen.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\img.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\info.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\menu.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\message.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\notify.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\ok.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\pin.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\pinned.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_fav.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_fs.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_group.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_history.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_no.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\popup_plus.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Radio_off.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Radio_on.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\reload.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\reply.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\resize.ico"
+ >
+ </File>
+ <File
+ RelativePath="resource.rc"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\res\warning.ico"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="docs"
+ Filter="txt"
+ >
+ <File
+ RelativePath=".\docs\Changelog.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\docs\todo.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\res\whatsnew.txt"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Deprecatet"
+ >
+ <File
+ RelativePath="..\..\include_API\m_notify.h"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\notify_imp.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\notify_imp.h"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\opt_notify.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\Deprecated\opt_notify.h"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Option Pages"
+ >
+ <File
+ RelativePath=".\src\opt_adv.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_adv.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_class.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_class.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_contacts.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_contacts.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_gen.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\opt_gen.h"
+ >
+ </File>
+ <File
+ RelativePath="src\opt_skins.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\opt_skins.h"
+ >
+ </File>
+ <File
+ RelativePath="src\opttree.cpp"
+ >
+ <FileConfiguration
+ Name="Release 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug 2in1|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="src\opttree.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="src\common.h"
+ >
+ </File>
+ <File
+ RelativePath="version.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/Popup/docs/Changelog.txt b/plugins/Popup/docs/Changelog.txt new file mode 100644 index 0000000000..de46d15d50 --- /dev/null +++ b/plugins/Popup/docs/Changelog.txt @@ -0,0 +1,67 @@ +Popup Plus: 2.1.1.6
++added support for custom langpacks
++added hotkey to open popup history
++added action copy to clipboard
+-removed old PLUGININFO support
+*some typos
+*fixed errors with ansi plugins
+*fixed destroying all of popups windows before unloading
+*added destroing functions on exit
+*background can now be changed together with font in font options
+*link to skins section in options page
+*unhook events on exit and resource optimization
+*Fullscreen detection from core
+*Skins tab moved to Skins-PopUps
+*fixes re-enabling the "reorder popups" option
+
+2.1.1.5
++ support new mtextcontrol interface (need new mtextcontrol.dll 0.8.0.1 or later)
+- support mtextcontrol by miranda service call
++ seperate x64 unicode release PopUpW.dll
++ seperate unicode release PopUpW.dll
+* move svn to http://svn.miranda.im/mainrepo/popup
++ support Popup classes API
+* strong cleanup/fixes in code and redesigned options
+! multimonitor setting for hotswap
++ unicode support for quickreply
++ support for autoexec.ini in notificatione
+! multi "Popups" menu (!!!other plugins should wait for modulsloaded to add submenu!!!)
+! large action icon fix (default actions)
+* hiostory size setting applied without restart
+
+2.1.1.3:
+! missing show default button (contact options)
++ debug setting
+* notification options
+ -> deltete default notification
+ -> layout cleanup
+ -> tab hidden when no notification registered
+* changes/cleanup in option
+* translate left/right mouse action in notifications
+* Test effect renamed to Sqare fading
+* moved options from customize > popups to popups (thanks to mataes)
+* small changes+fixes
+
+2.1.1.2 (RC2):
+reworked changes from RC1 doe to lost code. check if it works as before.
+
+2.1.1.1 (RC1):
+! middle mouse calles right mouse button as well
+! override with contact actions only for contacts (prevents some freeze)
++ option dialog for override
++ added pin action for override
++ Hotkeysupport to toogle Popups
+* try to solve multiple popup menus
+* default skin folder %miranda%/skins/popup
+
+2.1.1.0 (BETA):
+! prevent sending empty messages
+* deleted unused test actions + small cleanup
+* tray notification not mounted by default
+* quickreply listed in action (can turn off)
+* default skin folder %miranda%/customize/skins/popup
+* root menu item shows current status
++ override left/right mouse action ------------- (change by DB value)
++ added middle mouse action ------------- (change by DB value)
++ toolbar button added
++ PopUp/GetStatus as new service to get real status of plugin (couldnt override PopUp/ModuleIsEnabeled)
\ No newline at end of file diff --git a/plugins/Popup/docs/changelog_popup.txt b/plugins/Popup/docs/changelog_popup.txt new file mode 100644 index 0000000000..c044db186f --- /dev/null +++ b/plugins/Popup/docs/changelog_popup.txt @@ -0,0 +1,50 @@ +popup plus 2.0.3.96 RC1 internal, 05-11-28, 00:44
+ [-] Fixed line breaks
+
+popup plus 2.0.3.96 RC1 internal, 05-11-27, 01:07
+ [-] Single-window mode is now back again... Implementation is completely new now
+ [-] Fixed fade out bug with disabled sliding and enabled transparency
+ [-] Multithreading fix (should help with cross-popup text mess)
+ [-] Other small fixes
+
+popup plus 2.0.3.96 RC1 internal, 05-11-19, 02:55
+ [!] Fixed memory corruption on window destruction
+ [-] Fixed fade out bug with disabled sliding
+ [-] Fixed some bugs in render (probably multiple reported statup crashes)
+ [-] Fixed proportional image measuring bug (mainly avatars, thanx theMIRon)
+
+popup plus 2.0.3.96 RC1 internal, 05-11-17, 00:49
+ [*] Fixed animation bug (jumping windows)
+ [-] Metacontact support (thanx pescuma for details)
+ [-] Small text render fix (some pixels were transparent)
+
+popup plus 2.0.3.96 RC1 internal, 05-11-16, 00:22
+ [*] Fixed timing issues in popup reordering
+ [-] Fixed animation on win9x systems
+
+popup plus 2.0.3.96 RC1 internal, 05-11-11, 01:06
+ [-] Fixed memory leak in multithreading code (I hope so!)
+ [-] Fixed GDI leak (one object per popup, or so...)
+
+popup plus 2.0.3.96 RC1 internal, 05-11-02, 13:09
+ [-] Fixed some crashes
+ [-] Some code cleanings
+
+popup plus 2.0.3.96 RC1 internal, 05-10-22, 01:31
+ [-] Fixed crash on preview without Avatar Service installed
+ [*] Cosmetic changes in preview
+
+popup plus 2.0.3.96 RC1 internal, 05-10-21, 23:00
+ [-] Fixed animation speed
+ [-] Fixed popup sizing issue
+ [*] Avatars hidden on contact list are not visible in popups too
+ [*] New preview item with random avatar and multiline title, this is useful for skin designers.
+
+older parts will be here later :)
+
+--------------------------------------------------------------------------------
+Legend:
+ [!] important note
+ [+] added feature
+ [*] improved/changed feature
+ [-] bug fixed
diff --git a/plugins/Popup/docs/faq_popup.txt b/plugins/Popup/docs/faq_popup.txt new file mode 100644 index 0000000000..43a7d31eb6 --- /dev/null +++ b/plugins/Popup/docs/faq_popup.txt @@ -0,0 +1,125 @@ +===============================================================================
+ PopUp - Frequently Asked Questions
+===============================================================================
+
+Hi everybody,
+this is a collection of frequently asked questions: please read them, all of
+them.
+99% of the times I receive questions which already have an answer here. :-)
+
+I will try to explain myself easily, so that NON-SPEAKING ENGLISH users will
+understand too.
+
+I last updated this file when I released version: 1.0.1.9
+===============================================================================
+
+[1.0.1.9] Q: The plugin is good, but I don't see the popups when a message
+arrives.
+
+A: This is normal, because PopUp plugin makes the popups only when a plugin
+asks for them.
+NewStatusNotify plugin asks PopUp plugin a popup when a contact changes his
+status.
+NewEventNotify plugin asks PopUp plugin a popup when a message, file or url is
+received.
+WinampNotify does it when a new song is played in your Winamp 2.x/3.x
+MSN does it when you receive an hotmail message.
+EmotIcon does it when your received message contains an emoticon it recognizes.
+NotifyAnything lets you configure the popups on many circumstances. :-)
+===============================================================================
+
+[1.0.1.3] Q: What's the deal with "Concurrent Popups"?
+
+A: with this option ON, PopUp will create a new thread for every popup which
+needs to be created.
+The main effect on this is that fade and "animate" effects can happen at the
+same time on multiple plugins, instead of animating one at a time.
+If you use fading/animations, I suggest you keep it ON.
+If you don't use them, you don't need it. You can turn it OFF if you wish.
+It will cause no harm, though, so it's ON by default.
+
+IMPORTANT: don't play "ON-OFF-ON-OFF" with popups on your screen. If you do,
+your Miranda could be closed in the place of a popup, and you'll lose any
+unsaved changes.
+===============================================================================
+
+[1.0.0.4] Q: I've checked "AM/PM", but I don't get any AM/PM, what's wrong?
+
+A: Check your international settings (your locale). There should be an option
+page where you can configure the AM and PM symbol, and maybe they're "void" by
+default, as it was on my machines ^__^ so just write "AM" and "PM" or whatever
+you like.
+
+Q2: "I don't want to mess around with my OS! Make them translatable!"
+
+A: You're not going to *mess around* with anything. You only need to
+*configure* your OS which *IS NOT* properly configured by *DEFAULT*.
+Since AM/PM is part of the Operating System, my plugin has nothing to do with
+its translation. Blame Microsoft if they don't put a default AM/PM value!!
+===============================================================================
+
+[1.0.0.7] Q: I've noticed some strange memory leaks... can you fix them?
+
+A: I've fixed them in 1.0.0.5, so grab the latest version of PopUp plugin :-))
+===============================================================================
+
+[1.0.0.0] Q: Hey, remove XXX and add YYY to the plugin!
+
+A: Write to hrk@users.sourceforge.net explaining "why" in an intelligent way.
+If you convince me, I'll do what you ask.
+
+Examples of "asked things" are: Dynamically resizing popups; Background colour;
+Bold font for name; Fade in/out; AM/PM...
+===============================================================================
+
+[1.0.0.0] Q: The popups don't show on my system. Can you find the problem?
+
+A: Open the "Options" and click on "Preview": if you see PopUps, the plugin
+works.
+
+If the preview does not work, then there is a problem.
+I need a bug report. :)
+Get VersionInfo plugin and send me its output informations too.
+I can make you a special debug build to see if we can find out the problem.
+===============================================================================
+
+[1.0.0.0] Q: If I use MS Sans Serif as font for the popups, either my name or
+the date gets cut. Can you fix it?
+
+A: No :/ I can't fix it.
+This happens with every font of "Serif" family, so it happens with MS Sans
+Serif, MS Serif, some kind of "Lucida" and so on.
+I don't know why, but it happens.
+You can do two things:
+1) Use a font of another family.
+2) Enable "Enlarge PopUps by" and select a percentage you like. 120% should be
+good, but you can choose any value in the range 100% (no change) ~ 200% (double
+size).
+If you put 105%, you'll see no big difference in popup size (so it will not
+become huge!) and you will have a readable text.
+
+A2: It seems it's a problem related to "Latin" fonts. I cannot understand
+what's wrong so you'll have to use the workaround written above. :-)
+===============================================================================
+
+[1.0.0.0] Q: Hey, I can't stand the second line, can't I disable it?
+
+A: Yes: uncheck "Show second line".
+===============================================================================
+
+[1.0.0.0] Q: Thank for your work! Your plugin rocks, I'd like to give you
+something!
+
+A: You're welcome $_$. Anyway, my plugin is released both as freeware and Open
+Source, so you don't have to pay for it, as you don't have to pay for Miranda,
+and you can read its source code as you can read Miranda's source code. [Hmmm...
+if I were you I would not read my source code very finely, because I'm ashamed
+on how chaotic it is. :) Sooner or later I'll write it again from scratch,
+making a well organized code. Anyway, as of today it's fully commented, so it
+can be useful nevertheless.]
+
+By the way, should you feel like you want to compensate me in some way... in
+the event you upgrade your computer and have some old pieces you *won't use
+anymore*, which are *completely useless* and you don't *need them at all*...
+email me at hrk@users.sourceforge.net, because maybe I can use them. :-)
+===============================================================================
\ No newline at end of file diff --git a/plugins/Popup/docs/license_popup.txt b/plugins/Popup/docs/license_popup.txt new file mode 100644 index 0000000000..bda2bc214e --- /dev/null +++ b/plugins/Popup/docs/license_popup.txt @@ -0,0 +1,348 @@ +Popup Plus is released under GNU General Plublic License version 2. +Please note that due to this, distribution of Popup Plus as part of +products not licensed under GPL (or ones that violate GPL, like +custom Miranda IM packs with non-GPL plugins inside) is prohibited. +
+ Victor Pavlychko
+
+ ------------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/plugins/Popup/docs/popupplus_translate.txt b/plugins/Popup/docs/popupplus_translate.txt new file mode 100644 index 0000000000..9a3af4f79a --- /dev/null +++ b/plugins/Popup/docs/popupplus_translate.txt @@ -0,0 +1,149 @@ +;
+;Group
+;
+[PopUp]
+
+;
+;General Options
+;
+;[General Options]
+
+;[PopUp Options]
+
+;[Sample text]
+
+;[Set &Font]
+
+;[Contents]
+
+;[Use &bold font for nick]
+
+;[Display &Time]
+
+;[Show s&econd line]
+
+;[Size]
+
+;[En&large PopUps by]
+
+;[You cannot specify a value lower than %d and higher than %d.]
+
+;[&Dynamically resize the popups]
+
+;[Effects]
+
+;[A&nimate PopUps (98/ME/2000/XP)]
+
+;[Fade &in/out (2000/XP)]
+
+;[Use Tr&ansparency]
+
+;[Transparency options (2000/XP)]
+
+;[Transparent] => THIS WAS REMOVED IN 1.0.1.8
+
+;[Opaque] => THIS WAS REMOVED IN 1.0.1.8
+
+;[Start windows in the...]
+
+;[... upper left corner]
+
+;[... lower left corner]
+
+;[... lower right corner]
+
+;[... upper right corner]
+
+;[... center]
+
+;[Spread...]
+
+;[... horizontally]
+
+;[... vertically]
+
+;[Use a...]
+
+;[... beveled style]
+
+;[... flat style]
+
+;[Miscellanea]
+
+;[PopUp Delay (seconds)]
+
+;[Background]
+
+;[Text]
+
+;[&Use Windows colours]
+
+;[Previe&w]
+
+;[Hey, this is a status message!]
+
+;[Hey, this is a... real message!]
+
+;1.0.0.2
+;[Reorder PopUps]
+
+;1.0.0.4
+;[&Minimum width]
+
+;1.0.0.5
+;[This is a notifying message (for developers)]
+;[This is a warning message (for developers)]
+
+;1.0.0.6
+;[Ok, something went wrong in the "%s" setting. Report back this error value: %d] => NOT NEEDED ANYMORE.
+
+;1.0.0.7
+;[Ok, something went wrong in the "%s" setting. Report back the following values:\nFacility: %X\nError code: %X\nLine number: %d]
+;[Ma&ximum width]
+;[pixels]
+
+;[Advanced Options]
+;[Multimonitor (98/ME/2000/XP)]
+;[Start the popups in the monitor that contains]
+;[Miranda's window]
+;[the active window]
+
+;1.0.1.2
+;[Disable &popup module]
+;[Enable &popup module]
+
+;[Concurrent PopUps]
+;[Use multiple threads]
+;[Note: this option may (and may not) cause some unexpected crashes, be sure to disable it before reporting a bug.]
+
+;1.0.1.4
+;New:
+;[Multiline &popups]
+;This one changed: [Hey, this is a... real message!] it's now:
+;[Hey, this is a two lined message!\nCool, isn't it?]
+
+;1.0.1.9
+;This one was missing:
+;[opacity: %d%%]
+
+;PopUp Plus 2.0.3.5
+;New:
+;[...skin for popup windows]
+;[Fast halftones]
+;[MathModule support]
+;[BBCodes (like [b]..[/b] for bold)]
+;[Emoticons]
+;[Select emoticon package type:]
+;[Select emoticon package file:]
+;[SmileyAdd 0.1.3.2 workaround]
+;Page in preferences:
+;[Plus]
+;[Disable emoticons]
+;[Use SmileyAdd settings]
+;[nConvers emoticon file (*.xep)]
+;Open file fialog title:
+;[Select emoticon pack file]
+;This probably will be changed in each version:
+;[Hey, this is a multilined message!\nCool, isn't it? Also you can use:\n- BBCodes for [b]bold[/b], [i]italic[/i] & [u]underlined[/u] text;\n- emoticons from SmileyAdd or nConvers :-)\n- MathModule formulas like this: [Math]e^i\\pi=-1[Math]]
+;[Smileys! ;-)]
+
diff --git a/plugins/Popup/docs/readme_popup.txt b/plugins/Popup/docs/readme_popup.txt new file mode 100644 index 0000000000..b22e0fb6a9 --- /dev/null +++ b/plugins/Popup/docs/readme_popup.txt @@ -0,0 +1,276 @@ +PopUp plugin, v.1.0.1.9
+ by Luca "Hrk" Santarelli
+ hrk@users.sf.net
+
+- IMPORTANT -
+
+Developers, read m_popup.h. It's both in the source and in the binary package.
+
+
+- SUPPORTED PLUGINS -
+
+PLEASE, read here!
+
+PluginName Minimum Required Version
+NewStatusNotify 1.1.1.5
+Winamp Notify 1.5
+NewEventNotify x.x.x.x
+WhoIsReading[...]Notify x.x.x.x
+EmotIcon x.x.x.x
+YAHOO protocol x.x.x.x
+modified MSN protocol x.x.x.x
+Weather x.x.x.x
+NotifyAnything x.x.x.x
+... x.x.x.x
+
+- LATEST CHANGE -
+
+1.0.1.9 New: plugins can choose a custom timeout or no timeout at all (using
+ the new POPUPDATAEX structure and MS_POPUP_ADDPOPUPEX function).
+ New: PopUp plugin can be totally disabled depending on status (thanks
+ to MatriX's help).
+ Fix: Delphi/Pascal headers (m_popup_inc) had a mistake which caused
+ Access Violations. It has now be fixed. :-)
+ Change: "General Options" has been moved to "PopUps" page.
+ Fix: some sentences were missing in the langpack (andreas)
+ New: added support for Miranda Installer/Wassup by Tornado.
+
+
+- KNOWN BUGs -
+
+There are NO known bugs.
+Oh well... except for the multithreading issue ("Concurrent PopUps").
+If you get strange crashes with "Concurrent PopUps" on, disable it.
+
+
+- INFORMATIONS (you can skip this, but you can read it too!) -
+
+Hi :-)
+
+This plugin is the son of NewStatusNotify.
+You can use it even if you don't use NewStatusNotify, and probably you're here
+because some other plugin has "PopUp Plugin" as requirement. :-)
+
+This lets you have all the popups at the same place, being them status
+notifications, previewed messages, WinAmp song titles or whatever the plugin
+you installed does. :-)
+
+Should I feel that way, I'll make it so that you can have popups of different
+plugins in different places but... do you really need it?
+
+
+- USAGE -
+
+Open the options page and make your choices. You can choose:
+-> where to have the popup Window. Either one of the corners or the center of
+ the screen, but in this case the windows will appear cascaded (like the
+ old SplitMsgDialog Plugin or StatusFloater) instead of spreading.
+ You can spread them vertically or horizontally.
+
+-> Display hour and minute in the popup (thanks to the author of StatusFloater
+ for the cool idea!). You can have an "AM/PM" style too.
+
+-> Choose which style the popup should have. Border, size, second line...
+
+-> Set the interval for the popup windows to live (;-)).
+
+-> Choose the font used in the popups, and if you wish the name to be in bold
+ or not. Oh, you can choose the colour too.
+
+-> Color of the background too, obviously.
+
+-> And the default Windows' color too, obviously :-)
+
+-> Choose to have a fixed size popup, or a dynamically sizing popup: this means
+ that if the contact shown has a small nick and status text, the popup will be
+ small. If the contact shown has a long nick or long status text, the popup
+ will be large enough for the text not to be cut/clipped! :-)
+ No more clipped text! [except for "Latin"/"Serif" fonts like MS Sans Serif]
+
+-> If you enabled the resizing of PopUps, but sometimes they're too small for
+ your tastes, you can choose to have a "Minimum width", which will avoid too
+ small PopUps. Same goes with "Maximum width".
+
+-> Plugin works with "Large Fonts" systems and "Other..." systems too. It has
+ problems with "Serif" family fonts :-( (they get cut sometimes) but...
+
+-> ... you can nevertheless enlarge the PopUps by a choosen % value, avoiding
+ this annoying thing. :) [suggested is 105%, but read FAQ]
+
+-> Transparency. Should I add more? ;-) "Just slide the slider!"
+
+-> Animations, Fade in, Fade out! :-)
+
+
+- ROADMAP - (or: gee, what's next?)
+
+* Anything you think useful. :-)
+
+
+- TRANSLATION -
+
+The strings you can translate are in a separate file, made for people who don't
+use a langpack file. Just copy what you need. :)
+
+
+- CHANGES -
+
+1.0.1.9 New: plugins can choose a custom timeout or no timeout at all (using
+ the new POPUPDATAEX structure and MS_POPUP_ADDPOPUPEX function).
+ Fix: Delphi/Pascal headers (m_popup_inc) had a mistake which caused
+ Access Violations. It has now be fixed. :-)
+ Change: "General Options" has been moved to "PopUps" page.
+ Fix: some sentences were missing in the langpack (andreas)
+ New: added support for Miranda Installer/Wassup by Tornado.
+
+1.0.1.8 Fix: PopUps still running when Miranda is closed will now be cleanly
+ destroyed and memory freed. (This could prevent some crashes and could
+ just do nothing...)
+ New: Custom fade in and out delays.
+ Change: transparency percentage acts now like Miranda's one (thus
+ showing opacity and not transparency).
+ Fix: maximum width and minimum width were loaded wrongly.
+
+1.0.1.7 Fix: maximum and minimum width were saved wrongly.
+ Source will not be released due to lazyness. :)
+
+1.0.1.6 Fix: position, style and spreading option bug. Configure them again,
+ the old values had to be deleted.
+
+1.0.1.5 Fix: bug of wrong resize of popups when AM/PM is enabled.
+ Source for will not be released (I won't ever forget this bugfix...)
+
+1.0.1.4 New: multiline popups. :-)
+ Change: reordered general options dialog.
+ Fix: threads weren't killed if too much popups were created.
+ Change: PopUpList_Show() consumes less memory.
+ Change/Fix: made PUShowMessage() work better with single lined popups.
+ Change: translators, something changed. :)
+1.0.1.3 Fix: concurrent popups should work fine. They do here. :)
+ Fix: removed some debug code left in 1.0.1.2
+
+1.0.1.2 New: added a menu item to enable/disable every popup depending on PopUp
+ plugin. Note that this will not affect other plugins, but will only
+ disable *popups*. If you don't want to get status notification (as
+ example) and you have NewStatusNotify, you have to disable
+ NewStatusNotify too or you'll see no popups but you will hear the
+ sounds!
+ New: MS_POPUP_QUERY service for developers. You can enable/disable
+ every popup with it.
+ New: added an advanced option to enable/disable Concurrent PopUps. Open
+ FAQ.txt and read the documentation. :-)
+ Fix: some crashes should be fixed even if "Concurrent PopUps" is on.
+ Fix: some names weren't shown due to a bug in CreateWindow() API. It
+ has been fixed thanks to Vassily Goissa (vgoissa).
+ New: added a m_popup.inc for Delphi developers. Thanks to egodust.
+
+1.0.1.1 Fix: thanks to Tornado and BGMonster a memory leak has been removed.
+
+1.0.1.0 New/Fix: while working on multiline popups, when the text will be two
+ lines (or more) long, a "..." will be appended to the first line, and
+ the popup will be rightly sized. Just try it with NewEventNotify or
+ NewStatusNotify.
+ Fix: MultiMonitor was broken in latest release, it now works again. [If
+ you need UNICODE support, recompile the plugin with #define UNICODE]
+
+1.0.0.9 Fix: plugin will now load under WinNT and Win95. Problem was related to MultiMonitor options.
+ Fix: MultiMonitor options will now be enabled only if there is a multimonitor setup. :-)
+ Fix: "RegOpenKeyEx()" error fixed in NT platforms (9x weren't affected).
+ Fix: custom maximum width and minimum width weren't properly saved.
+ New: PUChangeText() resizes plugin (if dinamic resize is enabled).
+ This means you'll get a resizing popup with NewStatusNotify and
+ automatic read of away messages.
+ Change: many small changes, don't ask me to remember them :-)
+
+1.0.0.8 Bug fix release.
+ Fix: \r\n are not displayed correctly (which means not displayed!!)
+ Fix: threads not being killed :-)
+ Fix: Use Windows Colours wasn't working outisde of preview.
+ Fix: Default colours weren't saved on Miranda close.
+ Fix: custom maximum width wasn't saved on Miranda close.
+
+1.0.0.7 Fix: no more crashes on "Always on Top" failing (I hope).
+ Change: the new translation string (the error message) has been changed
+ a little, excuse me. :-) This time is final, though.
+ New: option to specify custom minimum width in popups.
+ New: option to specify a custom maximum width in popups (NewEventNotify
+ can show very large popups!)
+ New: multimonitor support. (wheee!)
+ New: new service added (for developers) MS_POPUP_CHANGETEXT. :-) This
+ will come in use to NewStatusNotify as soon as I code the preview of
+ away messages. Oh, what a lame, I've already done it :-P Check out
+ NSN 1.1.0.8
+ New: new message added (for developers) UM_INITPOPUP. This is sent when
+ a popup has completely been created, so your PluginData will be
+ available to you.
+ New: (for developers) some quick functions to avoid typing
+ CallService(...) ;-)
+ Fix: if the second line text is not given, but the popups are to have a
+ second line, a blank one will be drawn (currently the popup shows with
+ one line only)
+
+1.0.0.6 Fix: Reorder PopUps wasn't working due to a mistake in the fixing of
+ "Always on top". :-) Donwload this update because it could fix other
+ bugs in the showing of PopUps.
+ Change: the new translation string (the error message) has been changed
+ a little, excuse me. :-)
+
+1.0.0.5 New: (for developers) a new service function: PUShowMessage(), read
+ the documentation. Oh, read it nevertheless, since I slightly modified
+ the code examples. Be sure not to malloc() your POPUPDATA structure!
+ Fix: Thread & Handles memory leaks are now gone. There's a 2KB leak
+ sometimes, but I don't know if it's related to PopUp plugin or
+ something else. (Thanks to Kenneth)
+ Fix: popups are always on top for the two people who had problems too.
+ :-) (thanks to wintime98)
+ Change: small tweaks here and there.
+ Change: GUI improvements 8-) Options are less cluttered now... (thanks
+ Lynlimz)
+
+1.0.0.4 Fix: "always on top" was not working during fade in, but only after the
+ fade had completed. (Strange, it caused troubles in the old days of
+ NewStatusNotify, now it just works fine :-/ bah...)
+ Improvement: decreased CPU usage during fadings (in/out)... open Task
+ Manager and relax ;-) (thanks to Alex Sanyukovitch for the Sleep() hint).
+ Improvement: decreased memory usage and leaks, but there seems to be a
+ memory leak I can't fix (read readme_popup.txt && faq_popup.txt)
+ New: minimum width option to avoid too small PopUps.
+ Change: buttons and checkboxes now reflect Miranda standard ones.
+ Fix: Sample text font bug (it showed incorrectly sometimes).
+
+1.0.0.3 Fixed an issue related to Winamp Notify (my fault, not his), please
+ update NSN and WAN as soon as a new release is available.
+ Fixed "Reorder PopUps" option not being correctly saved.
+
+1.0.0.2 Users: MultiThreading now works! :-) PopUps are now concurrent. :-)
+ Developers: you'll need to compile your plugins with the new m_popup.h
+ Users: added the option to have "fixed position" popups, which means
+ they will not be reordered as every one dies.
+ Developers:Added a service (MS_POPUP_ISSECONDLINESHOWN)
+
+1.0.0.1 Fixed a GDI leak (thanks to Alex Sanyukovitch)
+ Removed the "MultiThreaded" checkbox. It's not yet the right time :-)
+
+1.0.0.0 Initial release. This plugin is "son" of NewStatusNotify. Developers,
+ you don't need to download the source code. Anyway, it's available.
+
+
+- DISCLAIMER -
+
+This plugin works just fine on my machine, it should work just fine on yours
+withouth conflicting with other plugins. Should you have any trouble, write me
+at hrk@users.sf.net where "sf" must be changed to "sourceforge".
+Anyway, if you are a smart programmer, give a look at the code and tell me
+the changes you'd make. If I like them, I'll put them inside giving you the
+right credit! :-)
+
+This plugin is released under the GPL license, I'm too lazy to copy it, though.
+Anyway, if you do have Miranda (and you should, otherwise this plugin is
+pretty useless) you already have a file called GPL.txt with tis license.
+Being GPLed you are free to modify or change the source code (you can find it
+here: http://nortiq.com/miranda/ and look for the source section) but you
+cannot sell it.
+As I already wrote: if you do modify it, notify me, I don't see a good reason
+not to share the improvements with the Miranda community. :-)
+
+Yes, I have made a quite long disclaimer, I can save the file now. :-)
\ No newline at end of file diff --git a/plugins/Popup/docs/rebase_popup.txt b/plugins/Popup/docs/rebase_popup.txt new file mode 100644 index 0000000000..1a3cbb1a13 --- /dev/null +++ b/plugins/Popup/docs/rebase_popup.txt @@ -0,0 +1,32 @@ +=§= TO PLUGIN DEVELOPERS =§=
+
+This plugin has its Base Address set to:
+0x25020000
+
+Please, avoid using this BaseAddress for your plugins: using the same addresses will slow Miranda.
+Read "pluginguidelines.txt" under miranda0100/miranda32/doc/ in the CVS.
+
+This Base Address is built this way:
+
+0x25 020000
+^^^^ ^^^^^^
+My radix Incremental value related to my plugins.
+
+Range for base address is 0x10000000 to 0x50000000, so 0x25000000 fits well there.
+
+020000 is an incremental value which represents PopUp
+[Note: 000000 is used for RePosition, 020000 for PopUp, 030000 for PicPlugin and so on.]
+
+Why do I call 0x25 "My radix"?
+
+HRK = H + R + K
+H = 8th letter in the english alphabet.
+R = 18th letter in the english alphabet.
+K = 11th letter in the english alphabet.
+
+8 + 18 + 11 = 37.
+37(dec) = 25(Hex)
+
+Base Address can be found/configured:
+§ MSVC++ 6.0
+ Project->Settings->Link->Output->Base Address
\ No newline at end of file diff --git a/plugins/Popup/docs/road_map.txt b/plugins/Popup/docs/road_map.txt new file mode 100644 index 0000000000..f171688db8 --- /dev/null +++ b/plugins/Popup/docs/road_map.txt @@ -0,0 +1,11 @@ +skin related classes:
+- PopUpSkin
+- Skin
+- Skins
+
+formatting-related classes:
+- Lexer
+- ChunkedText
+
+misc classes:
+- Logger
diff --git a/plugins/Popup/docs/skin_popup.txt b/plugins/Popup/docs/skin_popup.txt new file mode 100644 index 0000000000..ee20d2d845 --- /dev/null +++ b/plugins/Popup/docs/skin_popup.txt @@ -0,0 +1,87 @@ +Object properties
+
+Popup skin files are used to define popup layout. Each popup consists of several objects such as bitmaps, text, title
+
+and icon. Each object is defined using object..end blocks as below:
+
+Code:
+object
+ property1
+ property2
+ property3
+end
+
+Also there are two global properties w and h used to describe popup how window size should calculated.
+
+Syntax of each property is "property value" or simply "property". Note that each property shoud be placed in separate line. Let's take a look at possible properties:
+
+Object properties
+
+type. Type can be "bitmap", "icon", "avatar", "clock", "text" or "title"
+
+x. default: 0
+- Positive or zero values mean x-coordinate of object's upper-left corner.
+- Negative value means distance form object's upper-left corner to window's right side (applicable only for bitmaps and
+
+avatars)
+
+y. default: 0
+- Positive or zero values mean y-coordinate of object's upper-left corner.
+- Negative values mean distance form object's upper-left corner to windows bottom (applicable only for bitmaps and
+
+avatars)
+
+w. default: 0
+- Positive values mean object's width.
+- Negative values mean distance form object's bottom-right corner to window's right side.
+- zero value means actual width of bitmap.
+Note: this is applicable only for bitmaps and avatars
+
+h. default: 0
+- Positive or zero values mean object's height.
+- Negative values mean distance form object's bottom-right corner to windows bottom.
+- Zero value means actual height of bitmap.
+Note: this is applicable only for bitmaps and avatars
+
+color
+- Three numbers 0..255 separated with spaces. This defines red, green and blue values of text/title's color. This may cause crashes when aplied to something different from text/title.
+
+mono
+No parameters required. Mono means that bitmap should me treated monochromatic. E.g. bitmap shoud be colorized with
+
+popup background color. When this option is on gray (0x808080) color is mapped to popup color set in options, black and white colors are left unchaned.
+
+source
+Source is used to specify bitmap file used by bitmap and clock objects
+
+clocksize
+When applied to clock object, this means widths of various clock parts:
+- left edge
+- time separator (the ':' symbol)
+- ten digits
+- am and pm marks (not used at the moment but you can provide btter compatability for your skin)
+- right edge
+
+proportional
+edit:
+usage: proportional 1
+
+When applied to bitmap or avatar object, this means that popup should keep objects proportions. With this options you can easily avoid ugly avatrs ;)
+
+layer
+Applied to a bitmap object this means that bitmap must be blended with the background.
+
+Formulas
+
+You may use formulas to define x, y, w, h properties. Each formula is a simple arithmetic expression which may use 5 basic operations ('+', '-', '*', '/' and '%'), two 'conditional' operations ('>' means "maximum" and '<' for "minimum").
+
+Also you may use some variables: icon.width, icon.height, title.width, title.height, text.width, text.height, avatar.width, avatar.height, window.maxwidth, window.width, window.height, clock.width, clock.height.
+
+A few words on how and when variables are defined and formulas are evaluated:
+1) window.width and window.maxwidth are set to maximum width defined in options
+2) Popup looks through all objects and evauates their widths and heights. Value of undefined variable (including width or height of object that is not defined yet) is supposed to be zero.
+3) window.width and window.height are evaluated using global 'w' and 'h' definitions (it they are present, otherwise popup chooses minimal suitable width)
+4) Popup looks through all objects once more to evauates their positions.
+
+Post Scriptum
+Look into 'minimal' skin supplied with preview 8, I hope this description will help you to understand what's going on ;) Also feel free to ask your questions here.
\ No newline at end of file diff --git a/plugins/Popup/docs/translation_popup.txt b/plugins/Popup/docs/translation_popup.txt new file mode 100644 index 0000000000..3ee8740a1e --- /dev/null +++ b/plugins/Popup/docs/translation_popup.txt @@ -0,0 +1,127 @@ +;
+;Group
+;
+[PopUp]
+
+;
+;General Options
+;
+;[General Options]
+
+;[PopUp Options]
+
+;[Sample text]
+
+;[Set &Font]
+
+;[Contents]
+
+;[Use &bold font for nick]
+
+;[Display &Time]
+
+;[Show s&econd line]
+
+;[Size]
+
+;[En&large PopUps by]
+
+;[You cannot specify a value lower than %d and higher than %d.]
+
+;[&Dynamically resize the popups]
+
+;[Effects]
+
+;[A&nimate PopUps (98/ME/2000/XP)]
+
+;[Fade &in/out (2000/XP)]
+
+;[Use Tr&ansparency]
+
+;[Transparency options (2000/XP)]
+
+;[Transparent] => THIS WAS REMOVED IN 1.0.1.8
+
+;[Opaque] => THIS WAS REMOVED IN 1.0.1.8
+
+;[Start windows in the...]
+
+;[... upper left corner]
+
+;[... lower left corner]
+
+;[... lower right corner]
+
+;[... upper right corner]
+
+;[... center]
+
+;[Spread...]
+
+;[... horizontally]
+
+;[... vertically]
+
+;[Use a...]
+
+;[... beveled style]
+
+;[... flat style]
+
+;[Miscellanea]
+
+;[PopUp Delay (seconds)]
+
+;[Background]
+
+;[Text]
+
+;[&Use Windows colours]
+
+;[Previe&w]
+
+;[Hey, this is a status message!]
+
+;[Hey, this is a... real message!]
+
+;1.0.0.2
+;[Reorder PopUps]
+
+;1.0.0.4
+;[&Minimum width]
+
+;1.0.0.5
+;[This is a notifying message (for developers)]
+;[This is a warning message (for developers)]
+
+;1.0.0.6
+;[Ok, something went wrong in the "%s" setting. Report back this error value: %d] => NOT NEEDED ANYMORE.
+
+;1.0.0.7
+;[Ok, something went wrong in the "%s" setting. Report back the following values:\nFacility: %X\nError code: %X\nLine number: %d]
+;[Ma&ximum width]
+;[pixels]
+
+;[Advanced Options]
+;[Multimonitor (98/ME/2000/XP)]
+;[Start the popups in the monitor that contains]
+;[Miranda's window]
+;[the active window]
+
+;1.0.1.2
+;[Disable &popup module]
+;[Enable &popup module]
+
+;[Concurrent PopUps]
+;[Use multiple threads]
+;[Note: this option may (and may not) cause some unexpected crashes, be sure to disable it before reporting a bug.]
+
+;1.0.1.4
+;New:
+;[Multiline &popups]
+;This one changed: [Hey, this is a... real message!] it's now:
+;[Hey, this is a two lined message!\nCool, isn't it?]
+
+;1.0.1.9
+;This one was missing:
+;[opacity: %d%%]
\ No newline at end of file diff --git a/plugins/Popup/res/Check_off.ico b/plugins/Popup/res/Check_off.ico Binary files differnew file mode 100644 index 0000000000..7cb0afddd9 --- /dev/null +++ b/plugins/Popup/res/Check_off.ico diff --git a/plugins/Popup/res/Check_on.ico b/plugins/Popup/res/Check_on.ico Binary files differnew file mode 100644 index 0000000000..5a2b81aeed --- /dev/null +++ b/plugins/Popup/res/Check_on.ico diff --git a/plugins/Popup/res/Radio_off.ico b/plugins/Popup/res/Radio_off.ico Binary files differnew file mode 100644 index 0000000000..ee1dc67c3d --- /dev/null +++ b/plugins/Popup/res/Radio_off.ico diff --git a/plugins/Popup/res/Radio_on.ico b/plugins/Popup/res/Radio_on.ico Binary files differnew file mode 100644 index 0000000000..63e6a06167 --- /dev/null +++ b/plugins/Popup/res/Radio_on.ico diff --git a/plugins/Popup/res/add.ico b/plugins/Popup/res/add.ico Binary files differnew file mode 100644 index 0000000000..f4a6b2b837 --- /dev/null +++ b/plugins/Popup/res/add.ico diff --git a/plugins/Popup/res/avatar.bmp b/plugins/Popup/res/avatar.bmp Binary files differnew file mode 100644 index 0000000000..96bdb0fd83 --- /dev/null +++ b/plugins/Popup/res/avatar.bmp diff --git a/plugins/Popup/res/block.ico b/plugins/Popup/res/block.ico Binary files differnew file mode 100644 index 0000000000..2c0a508e79 --- /dev/null +++ b/plugins/Popup/res/block.ico diff --git a/plugins/Popup/res/classic.popupskin b/plugins/Popup/res/classic.popupskin new file mode 100644 index 0000000000..2fb9d3b65f --- /dev/null +++ b/plugins/Popup/res/classic.popupskin @@ -0,0 +1,167 @@ +options
+ #option id val title
+ option 1 1 Draw gradient background
+ option 2 1 Flat borders
+ option 3 1 Enable avatars
+end
+
+padding-right 4
+padding-bottom 4
+w (text.width+(25>(avatar.width+4+4))+4)>(25+title.width+4+clock.width+4)
+
+# background
+object
+ type bitmap
+ ifnotset 1
+ source pixel:808080
+ mono
+ x 0
+ y 0
+ w -1
+ h -1
+end
+
+object
+ type bitmap
+ ifset 1
+ source gradient:v/707070/909090
+ mono
+ x 0
+ y 0
+ w -1
+ h -1
+end
+
+# 3d border
+object
+ type bitmap
+ ifnotset 2
+ source pixel:d0d0d0
+ mono
+ x 0
+ y 0
+ w -1
+end
+
+object
+ type bitmap
+ ifnotset 2
+ source pixel:d0d0d0
+ mono
+ x 0
+ y 0
+ h -1
+end
+
+object
+ type bitmap
+ ifnotset 2
+ source pixel:303030
+ mono
+ x 0
+ y -1
+ w -1
+end
+
+object
+ type bitmap
+ ifnotset 2
+ source pixel:303030
+ mono
+ x -1
+ y 0
+ h -1
+end
+
+object
+ type bitmap
+ ifnotset 2
+ source pixel:303030
+ mono
+ x -1
+ y -1
+end
+
+# flat border
+object
+ type bitmap
+ ifset 2
+ source pixel:000000
+ x 0
+ y 0
+ w -1
+end
+
+object
+ type bitmap
+ ifset 2
+ source pixel:000000
+ x 0
+ y 0
+ h -1
+end
+
+object
+ type bitmap
+ ifset 2
+ source pixel:000000
+ y -1
+ w -1
+end
+
+object
+ type bitmap
+ ifset 2
+ source pixel:000000
+ x -1
+ y 0
+ h -1
+end
+
+object
+ type bitmap
+ ifset 2
+ source pixel:000000
+ x -1
+ y -1
+end
+
+# popup icon
+object
+ type icon
+ x 5
+ y 3
+end
+
+# popup title
+object
+ type title
+ x 25
+ y 4
+ w window.width-25-4-clock.width-4
+end
+
+# avatar
+object
+ type avatar
+ ifset 3
+ x 4
+ y title.height+4+4
+ w options.avatarsize<(options.avatarsize*avatarbitmap.width/avatarbitmap.height)
+ proportional 1
+end
+
+# popup text
+object
+ type text
+ x 25>(avatar.width+4+4)
+ y title.height+4+4
+ w window.width-(25>(avatar.width+4+4))-4
+end
+
+#clock
+object
+ type clock
+ x window.width-4-clock.width
+ y 4
+end
diff --git a/plugins/Popup/res/close.ico b/plugins/Popup/res/close.ico Binary files differnew file mode 100644 index 0000000000..753e3c356f --- /dev/null +++ b/plugins/Popup/res/close.ico diff --git a/plugins/Popup/res/copy.ico b/plugins/Popup/res/copy.ico Binary files differnew file mode 100644 index 0000000000..9dab230ffc --- /dev/null +++ b/plugins/Popup/res/copy.ico diff --git a/plugins/Popup/res/error.ico b/plugins/Popup/res/error.ico Binary files differnew file mode 100644 index 0000000000..583fd3b661 --- /dev/null +++ b/plugins/Popup/res/error.ico diff --git a/plugins/Popup/res/favorite.ico b/plugins/Popup/res/favorite.ico Binary files differnew file mode 100644 index 0000000000..6d282f9a10 --- /dev/null +++ b/plugins/Popup/res/favorite.ico diff --git a/plugins/Popup/res/fullscreen.ico b/plugins/Popup/res/fullscreen.ico Binary files differnew file mode 100644 index 0000000000..59a331fe16 --- /dev/null +++ b/plugins/Popup/res/fullscreen.ico diff --git a/plugins/Popup/res/img.ico b/plugins/Popup/res/img.ico Binary files differnew file mode 100644 index 0000000000..fef70bdd1e --- /dev/null +++ b/plugins/Popup/res/img.ico diff --git a/plugins/Popup/res/info.ico b/plugins/Popup/res/info.ico Binary files differnew file mode 100644 index 0000000000..e66f079830 --- /dev/null +++ b/plugins/Popup/res/info.ico diff --git a/plugins/Popup/res/menu.ico b/plugins/Popup/res/menu.ico Binary files differnew file mode 100644 index 0000000000..260972a67e --- /dev/null +++ b/plugins/Popup/res/menu.ico diff --git a/plugins/Popup/res/message.ico b/plugins/Popup/res/message.ico Binary files differnew file mode 100644 index 0000000000..6ec8d7301d --- /dev/null +++ b/plugins/Popup/res/message.ico diff --git a/plugins/Popup/res/notify.ico b/plugins/Popup/res/notify.ico Binary files differnew file mode 100644 index 0000000000..814706ee0b --- /dev/null +++ b/plugins/Popup/res/notify.ico diff --git a/plugins/Popup/res/ok.ico b/plugins/Popup/res/ok.ico Binary files differnew file mode 100644 index 0000000000..2ddfe5dcb0 --- /dev/null +++ b/plugins/Popup/res/ok.ico diff --git a/plugins/Popup/res/pin.ico b/plugins/Popup/res/pin.ico Binary files differnew file mode 100644 index 0000000000..9b49259e01 --- /dev/null +++ b/plugins/Popup/res/pin.ico diff --git a/plugins/Popup/res/pinned.ico b/plugins/Popup/res/pinned.ico Binary files differnew file mode 100644 index 0000000000..543ad4069c --- /dev/null +++ b/plugins/Popup/res/pinned.ico diff --git a/plugins/Popup/res/popup.ico b/plugins/Popup/res/popup.ico Binary files differnew file mode 100644 index 0000000000..da4e6af1c0 --- /dev/null +++ b/plugins/Popup/res/popup.ico diff --git a/plugins/Popup/res/popup_fav.ico b/plugins/Popup/res/popup_fav.ico Binary files differnew file mode 100644 index 0000000000..b64df3b318 --- /dev/null +++ b/plugins/Popup/res/popup_fav.ico diff --git a/plugins/Popup/res/popup_fs.ico b/plugins/Popup/res/popup_fs.ico Binary files differnew file mode 100644 index 0000000000..cb43fbdd40 --- /dev/null +++ b/plugins/Popup/res/popup_fs.ico diff --git a/plugins/Popup/res/popup_group.ico b/plugins/Popup/res/popup_group.ico Binary files differnew file mode 100644 index 0000000000..6a3cedcbda --- /dev/null +++ b/plugins/Popup/res/popup_group.ico diff --git a/plugins/Popup/res/popup_history.ico b/plugins/Popup/res/popup_history.ico Binary files differnew file mode 100644 index 0000000000..caeb840715 --- /dev/null +++ b/plugins/Popup/res/popup_history.ico diff --git a/plugins/Popup/res/popup_no.ico b/plugins/Popup/res/popup_no.ico Binary files differnew file mode 100644 index 0000000000..5df846b34e --- /dev/null +++ b/plugins/Popup/res/popup_no.ico diff --git a/plugins/Popup/res/popup_plus.ico b/plugins/Popup/res/popup_plus.ico Binary files differnew file mode 100644 index 0000000000..37ddc85035 --- /dev/null +++ b/plugins/Popup/res/popup_plus.ico diff --git a/plugins/Popup/res/reload.ico b/plugins/Popup/res/reload.ico Binary files differnew file mode 100644 index 0000000000..3eba98d2b3 --- /dev/null +++ b/plugins/Popup/res/reload.ico diff --git a/plugins/Popup/res/reply.ico b/plugins/Popup/res/reply.ico Binary files differnew file mode 100644 index 0000000000..ae7e9a3c06 --- /dev/null +++ b/plugins/Popup/res/reply.ico diff --git a/plugins/Popup/res/resize.ico b/plugins/Popup/res/resize.ico Binary files differnew file mode 100644 index 0000000000..1016097904 --- /dev/null +++ b/plugins/Popup/res/resize.ico diff --git a/plugins/Popup/res/warning.ico b/plugins/Popup/res/warning.ico Binary files differnew file mode 100644 index 0000000000..fab156ac34 --- /dev/null +++ b/plugins/Popup/res/warning.ico diff --git a/plugins/Popup/res/whatsnew.txt b/plugins/Popup/res/whatsnew.txt new file mode 100644 index 0000000000..63b0bd2abf --- /dev/null +++ b/plugins/Popup/res/whatsnew.txt @@ -0,0 +1,15 @@ +The new Popup Team welcomes you.
+Due to the huge amount of changes we advice you to use the "Reset" button below.
+
+Your advantages from new version:
+- seperate unicode release
+- seperate x64 unicode release
+- skins moved to official folder (%miranda%/skins/popup)
+- reworked/fixed option pages
+- fixes in quickreply (unicode and empty messages)
+- user color for avatar border
+- support to customize/overwrite the 3 main mouse buttons
+- Hotkey and ModernToolbar support
+- be ready for updates in other plugins
+
+Many more changes have been done on programmer side. Checkout the changelog for details.
\ No newline at end of file diff --git a/plugins/Popup/res_vc6.rc b/plugins/Popup/res_vc6.rc new file mode 100644 index 0000000000..7989eaa16b --- /dev/null +++ b/plugins/Popup/res_vc6.rc @@ -0,0 +1,2 @@ +#include "resource.rc"
+#include "version.rc"
diff --git a/plugins/Popup/resource.h b/plugins/Popup/resource.h new file mode 100644 index 0000000000..9585f9e793 --- /dev/null +++ b/plugins/Popup/resource.h @@ -0,0 +1,196 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDD_OPT_POPUP 101
+#define IDD_OPT_POPUP_ADVANCED 102
+#define IDD_OPT_SKIN2 103
+#define IDD_OPT_ACTIONS 104
+#define IDD_OPT_NOTIFICATIONS 105
+#define IDD_OPT_CONTACTS 106
+#define IDD_OPT_POPUP_GENERAL 107
+#define IDD_HISTORY 108
+#define IDD_POSITION 109
+#define IDB_NOAVATAR 110
+#define IDR_WHATSNEW 111
+#define IDI_POPUP 118
+#define IDI_NOPOPUP 120
+#define IDI_HISTORY 184
+#define IDI_RELOAD 185
+#define IDI_MB_STOP 189
+#define IDI_MB_INFO 191
+#define IDI_MB_WARN 194
+#define IDI_RESIZE 196
+#define IDI_OPT_CHECK_OFF 198
+#define IDI_OPT_CHECK_ON 199
+#define IDI_OPT_RADIO_OFF 200
+#define IDI_OPT_RADIO_ON 201
+#define IDI_ACT_INFO 203
+#define IDI_ACT_MENU 204
+#define IDI_ACT_MESSAGE 205
+#define IDI_ACT_OK 206
+#define IDI_ACT_ADD 207
+#define IDI_ACT_CLOSE 208
+#define IDI_ACT_PINNED 209
+#define IDI_ACT_PIN 210
+#define IDI_ACT_COPY 211
+#define IDI_OPT_GROUP 213
+#define IDI_OPT_FULLSCREEN 215
+#define IDI_OPT_BLOCK 216
+#define IDI_OPT_FAVORITE 217
+#define IDI_OPT_AUTO 218
+#define IDI_ACT_REPLY 219
+#define IDI_PU_FULLSCREEN 221
+#define IDI_PU_FAVOURITE 222
+#define IDC_USEANIMATIONS 1005
+#define IDC_EFFECT_TXT 1006
+#define IDC_EFFECT 1007
+#define IDC_FADEIN_TXT1 1008
+#define IDC_FADEIN 1009
+#define IDC_FADEIN_SPIN 1010
+#define IDC_FADEIN_TXT2 1011
+#define IDC_FADEOUT_TXT1 1012
+#define IDC_FADEOUT 1013
+#define IDC_FADEOUT_SPIN 1014
+#define IDC_FADEOUT_TXT2 1015
+#define IDC_PREVIEW 1033
+#define IDC_DEBUG 1034
+#define IDC_GRP_MULTIMONITOR 1035
+#define IDC_MULTIMONITOR_DESC 1036
+#define IDC_MIRANDAWND 1037
+#define IDC_ACTIVEWND 1038
+#define IDC_AVT_BORDER 1050
+#define IDC_AVT_PNGBORDER 1051
+#define IDC_AVT_RADIUS 1053
+#define IDC_AVT_RADIUS_SPIN 1054
+#define IDC_AVT_SIZE_SLIDE 1057
+#define IDC_AVT_SIZE 1058
+#define IDC_AVT_REQUEST 1059
+#define IDC_TRANS_9X 1062
+#define IDC_TRANS 1063
+#define IDC_TRANS_TXT1 1064
+#define IDC_TRANS_SLIDER 1065
+#define IDC_TRANS_PERCENT 1066
+#define IDC_TRANS_OPAQUEONHOVER 1067
+#define IDC_CHECKWINDOW 1095
+#define IDC_LACTION 1096
+#define IDC_RACTION 1097
+#define IDC_SOFFLINE 1099
+#define IDC_SONLINE 1100
+#define IDC_SAWAY 1101
+#define IDC_SNA 1102
+#define IDC_SOCCUPIED 1103
+#define IDC_SDND 1104
+#define IDC_SFREE4CHAT 1105
+#define IDC_SINVISIBLE 1106
+#define IDC_SPHONE 1107
+#define IDC_SLUNCH 1108
+#define IDC_TIMEOUT 1110
+#define IDC_SOFFLINE2 1111
+#define IDC_SONLINE2 1112
+#define IDC_SAWAY2 1113
+#define IDC_SNA2 1114
+#define IDC_SOCCUPIED2 1115
+#define IDC_SDND2 1116
+#define IDC_TREE1 1117
+#define IDC_SKINLIST 1118
+#define IDC_SINVISIBLE2 1119
+#define IDC_SPHONE2 1120
+#define IDC_SLUNCH2 1121
+#define IDC_TXT_TIMEOUT_SEC 1122
+#define IDC_PREVIEWBOX 1123
+#define IDC_TXT_TIMEOUT_INFINITE 1124
+#define IDC_SFREE4CHAT2 1125
+#define IDC_TXT_TIMEOUT_DEFAULT 1126
+#define IDC_POPUP_LIST 1134
+#define IDC_SHOWHISTORY 1135
+#define IDC_ENABLE_HISTORY 1137
+#define IDC_HPPLOG 1138
+#define IDC_BTN_RELOAD 1144
+#define IDC_MAXPOPUPS 1145
+#define IDC_HISTORY_STATIC1 1147
+#define IDC_HISTORY_STATIC2 1148
+#define IDC_HISTORYSIZE 1149
+#define IDC_TITLE 1150
+#define IDC_TXT_TOP 1163
+#define IDC_TIMEOUT_SPIN 1164
+#define IDC_TXT_LEFT 1165
+#define IDC_TXT_RIGHT 1166
+#define IDC_TXT_BOTTOM 1167
+#define IDC_TXT_SPACING 1168
+#define IDC_LIST 1169
+#define IDC_ACTIONS 1170
+#define IDC_CHK_ENABLEACTIONS 1175
+#define IDC_CHK_IMCONTACTSONLY 1176
+#define IDC_CHK_LARGEICONS 1177
+#define IDC_CHK_CONTACTSONLY 1178
+#define IDC_CHK_DONTCLOSE 1179
+#define IDC_RD_TEXT 1180
+#define IDC_RD_RIGHTICONS 1181
+#define IDC_RD_LEFTICONS 1182
+#define IDC_ICO_INFO 1183
+#define IDC_GRP_CUSTOMACTIONS 1185
+#define IDC_GRP_SIZEPOSITION 1186
+#define IDC_GRP_ACTIONS 1187
+#define IDC_TXT_CUSTOMACTIONS 1189
+#define IDC_TXT_POSITION 1190
+#define IDC_ICO_RESTART 1191
+#define IDC_MORE 1193
+#define IDC_TXT_TITLE1 1194
+#define IDC_TXT_POSITION2 1195
+#define IDC_TXT_TITLE3 1196
+#define IDC_TXT_TITLE4 1197
+#define IDC_ENABLE 1198
+#define IDC_TXT_TIMEOUT 1199
+#define IDC_TXT_LACTION 1200
+#define IDC_TXT_RACTION 1201
+#define IDC_TXT_COLORS 1202
+#define IDC_ICO_FAVORITE 1203
+#define IDC_ICO_FULLSCREEN 1204
+#define IDC_ICO_BLOCK 1205
+#define IDC_ICO_AUTO 1206
+#define IDC_GRP_SIZEPOSITION2 1207
+#define IDC_ICO_OK 1208
+#define IDC_CB_RIGHT 1213
+#define IDC_CB_MIDDLE 1214
+#define IDC_CB_LEFT 1215
+#define IDC_TXT_MIDDLE 1216
+#define IDC_SKIN_LIST_OPT 1217
+#define IDC_INFINITEDELAY 1218
+#define IDC_SECONDS_STATIC1 1219
+#define IDC_SECONDS 1220
+#define IDC_SECONDS_SPIN 1221
+#define IDC_SECONDS_STATIC2 1222
+#define IDC_LEAVEHOVERED 1223
+#define IDC_DYNAMICRESIZE 1225
+#define IDC_USEMINIMUMWIDTH 1226
+#define IDC_MINIMUMWIDTH 1227
+#define IDC_MINIMUMWIDTH_SPIN 1228
+#define IDC_USEMAXIMUMWIDTH 1229
+#define IDC_MAXIMUMWIDTH 1230
+#define IDC_MAXIMUMWIDTH_SPIN 1231
+#define IDC_WHERE 1233
+#define IDC_CUSTOMPOS 1234
+#define IDC_LAYOUT 1236
+#define IDC_REORDERPOPUPS 1238
+#define IDC_POPUPENABLED 1240
+#define IDC_DISABLEINFS 1241
+#define IDC_STATUSES 1242
+#define IDC_GETSKINS 1243
+#define IDC_CHK_OFFLINE 40071
+#define IDC_CHK_ONLINE 40072
+#define IDC_CHK_NA 40075
+#define IDC_CHK_OCCUPIED 40076
+#define IDC_CHK_ONTHEPHONE 40079
+#define IDC_CHK_OUTTOLUNCH 40080
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 224
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1244
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/Popup/resource.rc b/plugins/Popup/resource.rc new file mode 100644 index 0000000000..8b950e3b77 --- /dev/null +++ b/plugins/Popup/resource.rc @@ -0,0 +1,425 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Íåéòðàëüíûé resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1251)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_POPUP ICON "res\\popup.ico"
+IDI_PU_FULLSCREEN ICON "res\\popup_fs.ico"
+IDI_PU_FAVOURITE ICON "res\\popup_fav.ico"
+IDI_NOPOPUP ICON "res\\popup_no.ico"
+IDI_HISTORY ICON "res\\popup_history.ico"
+IDI_RELOAD ICON "res\\reload.ico"
+IDI_OPT_CHECK_OFF ICON "res\\Check_off.ico"
+IDI_OPT_CHECK_ON ICON "res\\Check_on.ico"
+IDI_OPT_RADIO_OFF ICON "res\\Radio_off.ico"
+IDI_OPT_RADIO_ON ICON "res\\Radio_on.ico"
+IDI_ACT_INFO ICON "res\\info.ico"
+IDI_ACT_MENU ICON "res\\menu.ico"
+IDI_ACT_MESSAGE ICON "res\\message.ico"
+IDI_ACT_OK ICON "res\\ok.ico"
+IDI_ACT_ADD ICON "res\\add.ico"
+IDI_ACT_CLOSE ICON "res\\close.ico"
+IDI_ACT_PINNED ICON "res\\pinned.ico"
+IDI_ACT_PIN ICON "res\\pin.ico"
+IDI_RESIZE ICON "res\\resize.ico"
+IDI_MB_STOP ICON "res\\error.ico"
+IDI_MB_INFO ICON "res\\notify.ico"
+IDI_MB_WARN ICON "res\\warning.ico"
+IDI_OPT_GROUP ICON "res\\popup_group.ico"
+IDI_OPT_FULLSCREEN ICON "res\\fullscreen.ico"
+IDI_OPT_BLOCK ICON "res\\block.ico"
+IDI_OPT_FAVORITE ICON "res\\favorite.ico"
+IDI_ACT_REPLY ICON "res\\reply.ico"
+IDI_ACT_COPY ICON "res\\copy.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_POPUP DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Content && Style",IDC_STATIC,3,3,143,151
+ LTEXT "Go to Customize > Fonts && Colors for fonts and colors options",IDC_STATIC,28,60,113,18
+ GROUPBOX "Miscellaneous",IDC_STATIC,3,159,143,38
+ GROUPBOX "Effects",IDC_STATIC,151,84,146,113
+ PUSHBUTTON "Live Preview",IDC_PREVIEW,219,203,73,14
+ ICON IDI_MB_INFO,IDC_ICO_INFO,5,59,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ GROUPBOX "Size && Position",IDC_STATIC,151,3,146,80
+END
+
+IDD_OPT_POPUP_ADVANCED DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "History",IDC_STATIC,3,3,143,56
+ CONTROL "Enable popup history",IDC_ENABLE_HISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,15,134,8
+ RTEXT "Store last",IDC_HISTORY_STATIC1,8,25,58,12,SS_CENTERIMAGE
+ EDITTEXT IDC_HISTORYSIZE,68,25,26,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "events",IDC_HISTORY_STATIC2,99,25,42,12,SS_CENTERIMAGE
+ CONTROL "",IDC_SHOWHISTORY,"MButtonClass",WS_TABSTOP,9,37,16,15
+ CONTROL "Use History++ to render log",IDC_HPPLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,40,111,8
+ GROUPBOX "Avatars",IDC_STATIC,3,63,143,84
+ CONTROL "Draw avatar borders",IDC_AVT_BORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,74,134,8
+ CONTROL "Draw borders for semitransparent avatars too",IDC_AVT_PNGBORDER,
+ "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_TOP | BS_MULTILINE | WS_TABSTOP,21,85,118,18
+ LTEXT "Round corners by",IDC_STATIC,9,103,74,12,SS_CENTERIMAGE
+ EDITTEXT IDC_AVT_RADIUS,83,103,39,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_AVT_RADIUS_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,112,103,11,14
+ LTEXT "pixels",IDC_STATIC,125,103,18,12,SS_CENTERIMAGE
+ LTEXT "Avatar size:",IDC_STATIC,9,116,44,12,SS_CENTERIMAGE
+ CONTROL "",IDC_AVT_SIZE_SLIDE,"msctls_trackbar32",WS_TABSTOP,53,116,72,12
+ CTEXT "32",IDC_AVT_SIZE,125,116,17,12,SS_CENTERIMAGE | NOT WS_GROUP
+ CONTROL "Enable avatar updates",IDC_AVT_REQUEST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,132,134,8
+ GROUPBOX "Multimonitor (98/ME/2000/XP)",IDC_GRP_MULTIMONITOR,3,151,143,46
+ LTEXT "Start the popups in the monitor with",IDC_MULTIMONITOR_DESC,8,161,134,8,SS_NOPREFIX
+ CONTROL "Miranda's window",IDC_MIRANDAWND,"Button",BS_AUTORADIOBUTTON,21,172,115,10
+ CONTROL "the active window",IDC_ACTIVEWND,"Button",BS_AUTORADIOBUTTON,21,183,115,10
+ GROUPBOX "Transparency",IDC_STATIC,151,3,146,56
+ CONTROL "Enable Win 9x/Me transparency",IDC_TRANS_9X,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,15,136,8
+ CONTROL "Use transparency (Windows 2000+)",IDC_TRANS,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,157,15,136,8
+ RTEXT "opacity:",IDC_TRANS_TXT1,157,25,59,12,SS_CENTERIMAGE
+ CONTROL "",IDC_TRANS_SLIDER,"msctls_trackbar32",WS_TABSTOP,218,25,56,12
+ LTEXT "100%",IDC_TRANS_PERCENT,274,25,20,12,SS_CENTERIMAGE | NOT WS_GROUP
+ CONTROL "Opaque popups under cursor",IDC_TRANS_OPAQUEONHOVER,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,175,40,118,8
+ GROUPBOX "Effects",IDC_STATIC,151,63,146,84
+ CONTROL "Slide Popup",IDC_USEANIMATIONS,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,157,79,136,8
+ LTEXT "Effect:",IDC_EFFECT_TXT,157,90,33,12,SS_CENTERIMAGE
+ COMBOBOX IDC_EFFECT,191,91,78,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Time (in):",IDC_FADEIN_TXT1,157,107,69,12,SS_CENTERIMAGE
+ EDITTEXT IDC_FADEIN,230,107,39,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_FADEIN_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,257,107,11,14
+ LTEXT "ms",IDC_FADEIN_TXT2,274,107,20,12,SS_CENTERIMAGE
+ RTEXT "Time (out):",IDC_FADEOUT_TXT1,157,122,69,12,SS_CENTERIMAGE
+ EDITTEXT IDC_FADEOUT,230,122,39,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_FADEOUT_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,257,121,11,14
+ LTEXT "ms",IDC_FADEOUT_TXT2,274,122,20,12,SS_CENTERIMAGE
+ LTEXT "Limit window amount to:",IDC_STATIC,154,159,96,12,SS_CENTERIMAGE
+ EDITTEXT IDC_MAXPOPUPS,255,159,26,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ ICON IDI_MB_WARN,IDC_ICO_RESTART,8,201,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE | NOT WS_VISIBLE
+ PUSHBUTTON "Live Preview",IDC_PREVIEW,219,203,73,14
+END
+
+IDD_OPT_SKIN2 DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Skins",IDC_STATIC,3,3,98,219
+ LISTBOX IDC_SKINLIST,8,13,88,185,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "R",IDC_BTN_RELOAD,"MButtonClass",WS_TABSTOP,8,201,16,16
+ RTEXT "* - built-in skins",IDC_STATIC,41,203,52,14,SS_CENTERIMAGE
+ GROUPBOX "Skin options",IDC_STATIC,106,3,191,134
+ CONTROL "",IDC_SKIN_LIST_OPT,"SysTreeView32",WS_BORDER | WS_HSCROLL | WS_TABSTOP,112,13,180,119
+ GROUPBOX "Preview",IDC_STATIC,106,140,191,82
+ CONTROL "",IDC_PREVIEWBOX,"Static",SS_BLACKRECT,112,150,180,48,WS_EX_TRANSPARENT
+ PUSHBUTTON "Live Preview",IDC_PREVIEW,219,203,73,14
+ CONTROL "Download more skins",IDC_GETSKINS,"Hyperlink",WS_TABSTOP,109,203,100,16
+END
+
+IDD_HISTORY DIALOG 0, 0, 293, 236
+STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "Popup History"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LISTBOX IDC_POPUP_LIST,5,5,283,226,LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_POSITION DIALOGEX 0, 0, 190, 128
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP
+EXSTYLE WS_EX_TOOLWINDOW
+CLASS "PopupPlusDlgBox"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME,0,0,190,128,WS_EX_TRANSPARENT
+ CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME,5,20,179,102,WS_EX_TRANSPARENT
+ CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME,40,44,110,55,WS_EX_TRANSPARENT
+ EDITTEXT IDC_TXT_TOP,83,26,25,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_TXT_LEFT,10,70,25,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_TXT_RIGHT,155,70,25,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_TXT_BOTTOM,83,105,25,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Desktop",IDC_STATIC,10,25,71,8
+ LTEXT "Popup Area",IDC_STATIC,44,48,99,8
+ LTEXT "pixel(s)",IDC_STATIC,112,25,38,14,SS_CENTERIMAGE
+ LTEXT "pixel(s)",IDC_STATIC,112,104,38,14,SS_CENTERIMAGE
+ CTEXT "pixel(s)",IDC_STATIC,10,84,25,8
+ CTEXT "pixel(s)",IDC_STATIC,155,84,25,8
+ EDITTEXT IDC_TXT_SPACING,83,70,25,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "pixel(s)",IDC_STATIC,112,70,35,12,SS_CENTERIMAGE
+ LTEXT "Distance between popups",IDC_STATIC,44,56,99,8,SS_CENTERIMAGE
+ LTEXT "Configure popup area",IDC_TITLE,5,5,144,13,SS_CENTERIMAGE
+ CONTROL "Close",IDCANCEL,"MButtonClass",WS_TABSTOP,170,5,14,13
+ CONTROL "Close",IDOK,"MButtonClass",WS_TABSTOP,155,5,14,13
+END
+
+IDD_OPT_ACTIONS DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "General",IDC_STATIC,3,3,143,45
+ CONTROL "Enable popup actions",IDC_CHK_ENABLEACTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,14,136,10
+ ICON IDI_MB_INFO,IDC_ICO_INFO,6,23,21,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ LTEXT "Popup Actions are those tiny buttons below notification text.",IDC_STATIC,27,24,116,22
+ GROUPBOX "Common Actions",IDC_GRP_CUSTOMACTIONS,3,51,143,71
+ LTEXT "Please choose in what cases default actions should be added:",IDC_TXT_CUSTOMACTIONS,8,61,136,17
+ CONTROL "Add info && menu for IM contacts only",IDC_CHK_IMCONTACTSONLY,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,82,136,10
+ CONTROL "Add default actions for contacts only",IDC_CHK_CONTACTSONLY,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,95,136,10
+ CONTROL "Don't close popups on default actions",IDC_CHK_DONTCLOSE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,107,136,10
+ GROUPBOX "Size && Position",IDC_GRP_SIZEPOSITION,3,125,143,72
+ CONTROL "Use large icons",IDC_CHK_LARGEICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,135,136,10
+ LTEXT "Popup actions will be displayed as:",IDC_TXT_POSITION,8,147,136,8
+ CONTROL "Icons and labels below text",IDC_RD_TEXT,"Button",BS_AUTORADIOBUTTON,26,159,117,10
+ CONTROL "Icons on the left",IDC_RD_LEFTICONS,"Button",BS_AUTORADIOBUTTON,26,171,117,10
+ CONTROL "Icons aligned to the right",IDC_RD_RIGHTICONS,"Button",BS_AUTORADIOBUTTON,26,183,117,10
+ GROUPBOX "Show Actions: (requires apply)",IDC_GRP_ACTIONS,151,3,146,134
+ CONTROL "",IDC_ACTIONS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,156,13,136,118
+ GROUPBOX "Mouse Actions Overwrite",IDC_GRP_SIZEPOSITION2,151,141,146,56
+ CONTROL "LeftButton",IDC_TXT_POSITION2,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,157,152,64,12
+ COMBOBOX IDC_CB_LEFT,223,152,69,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "MiddleButton",IDC_TXT_MIDDLE,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,157,166,64,12
+ COMBOBOX IDC_CB_MIDDLE,223,166,69,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "RightButton",IDC_TXT_RIGHT,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,157,180,64,12
+ COMBOBOX IDC_CB_RIGHT,223,180,69,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Live Preview",IDC_PREVIEW,219,203,73,14
+END
+
+IDD_OPT_NOTIFICATIONS DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Notifications",IDC_STATIC,3,3,294,194
+ CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_INFOTIP | WS_BORDER | WS_HSCROLL | WS_TABSTOP,8,13,99,179
+ LTEXT "General options",IDC_TXT_TITLE1,112,13,180,8
+ CONTROL "Enable this notification",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_TABSTOP,122,26,170,8
+ RTEXT "Popup timeout:",IDC_TXT_TIMEOUT,112,42,62,8,SS_CENTERIMAGE
+ LTEXT "Left click action:",IDC_TXT_LACTION,111,59,62,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ COMBOBOX IDC_LACTION,179,59,113,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Right click action:",IDC_TXT_RACTION,111,77,62,12,SS_CENTERIMAGE | NOT WS_GROUP,WS_EX_RIGHT
+ COMBOBOX IDC_RACTION,179,77,113,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Disable when global status is...",IDC_TXT_TITLE3,112,107,180,8
+ CONTROL "",IDC_SOFFLINE,"MButtonClass",WS_TABSTOP,132,120,15,14
+ CONTROL "",IDC_SONLINE,"MButtonClass",WS_TABSTOP,148,120,15,14
+ CONTROL "",IDC_SAWAY,"MButtonClass",WS_TABSTOP,164,120,15,14
+ CONTROL "",IDC_SNA,"MButtonClass",WS_TABSTOP,180,120,15,14
+ CONTROL "",IDC_SOCCUPIED,"MButtonClass",WS_TABSTOP,196,120,15,14
+ CONTROL "",IDC_SDND,"MButtonClass",WS_TABSTOP,212,120,15,14
+ CONTROL "",IDC_SFREE4CHAT,"MButtonClass",WS_TABSTOP,228,120,15,14
+ CONTROL "",IDC_SINVISIBLE,"MButtonClass",WS_TABSTOP,244,120,15,14
+ CONTROL "",IDC_SPHONE,"MButtonClass",WS_TABSTOP,260,120,15,14
+ CONTROL "",IDC_SLUNCH,"MButtonClass",WS_TABSTOP,276,120,16,14
+ LTEXT "Disable when relevant protocol's status is...",IDC_TXT_TITLE4,112,138,180,8
+ CONTROL "",IDC_SOFFLINE2,"MButtonClass",WS_TABSTOP,132,151,15,14
+ CONTROL "",IDC_SONLINE2,"MButtonClass",WS_TABSTOP,148,151,15,14
+ CONTROL "",IDC_SAWAY2,"MButtonClass",WS_TABSTOP,164,151,15,14
+ CONTROL "",IDC_SNA2,"MButtonClass",WS_TABSTOP,180,151,15,14
+ CONTROL "",IDC_SOCCUPIED2,"MButtonClass",WS_TABSTOP,196,151,15,14
+ CONTROL "",IDC_SDND2,"MButtonClass",WS_TABSTOP,212,151,15,14
+ CONTROL "",IDC_SFREE4CHAT2,"MButtonClass",WS_TABSTOP,228,151,15,14
+ CONTROL "",IDC_SINVISIBLE2,"MButtonClass",WS_TABSTOP,244,151,15,14
+ CONTROL "",IDC_SPHONE2,"MButtonClass",WS_TABSTOP,260,151,15,14
+ CONTROL "",IDC_SLUNCH2,"MButtonClass",WS_TABSTOP,276,151,16,14
+ ICON IDI_MB_INFO,IDC_ICO_INFO,112,170,21,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ LTEXT "Colors can be configured in\r\nCustomize > Fonts && Colors",IDC_TXT_COLORS,132,171,108,24
+ PUSHBUTTON "More...",IDC_MORE,242,176,50,14
+ PUSHBUTTON "Live Preview",IDC_PREVIEW,219,203,73,14
+ CONTROL "Disable if message window is open",IDC_CHECKWINDOW,
+ "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_TABSTOP,122,95,170,8
+ EDITTEXT IDC_TIMEOUT,179,41,33,12,ES_AUTOHSCROLL
+ CONTROL "",IDC_TIMEOUT_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,201,41,12,12
+ LTEXT "Sec",IDC_TXT_TIMEOUT_SEC,217,43,18,8
+ LTEXT "0 = Default",IDC_TXT_TIMEOUT_DEFAULT,242,38,51,8
+ LTEXT "-1 = Infinite",IDC_TXT_TIMEOUT_INFINITE,239,48,54,8
+END
+
+IDD_OPT_CONTACTS DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Per-contact settings",IDC_STATIC,3,3,294,219
+ CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x1f2,8,13,284,184,WS_EX_CLIENTEDGE
+ ICON IDI_OPT_FAVORITE,IDC_ICO_FAVORITE,79,198,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ LTEXT "Show always",IDC_STATIC,101,198,49,20,SS_CENTERIMAGE
+ ICON IDI_OPT_FULLSCREEN,IDC_ICO_FULLSCREEN,150,198,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ LTEXT "Ignore fullscreen",IDC_STATIC,172,198,57,20,SS_CENTERIMAGE
+ ICON IDI_OPT_BLOCK,IDC_ICO_BLOCK,229,198,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ LTEXT "Never show",IDC_STATIC,251,198,41,20,SS_CENTERIMAGE
+ ICON IDI_ACT_OK,IDC_ICO_OK,8,198,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
+ LTEXT "Show default",IDC_STATIC,30,198,49,20,SS_CENTERIMAGE
+END
+
+IDD_OPT_POPUP_GENERAL DIALOGEX 0, 0, 304, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Default Timeout",IDC_STATIC,3,3,143,53
+ CONTROL "Infinite popup delay",IDC_INFINITEDELAY,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,9,15,133,8
+ LTEXT "Popup delay:",IDC_SECONDS_STATIC1,18,26,50,12,SS_CENTERIMAGE
+ EDITTEXT IDC_SECONDS,70,26,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SECONDS_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,92,25,11,12
+ LTEXT "seconds",IDC_SECONDS_STATIC2,107,26,35,12,SS_CENTERIMAGE
+ CONTROL "Do not close hovered popups",IDC_LEAVEHOVERED,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,18,41,124,8
+ GROUPBOX "Size && Position",IDC_STATIC,3,60,143,83
+ CONTROL "Dynamically resize the popups",IDC_DYNAMICRESIZE,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,9,71,133,8
+ CONTROL "Minimum width",IDC_USEMINIMUMWIDTH,"Button",BS_AUTOCHECKBOX | BS_VCENTER | BS_NOTIFY | WS_TABSTOP,7,81,88,12,WS_EX_RIGHT
+ EDITTEXT IDC_MINIMUMWIDTH,100,81,40,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_MINIMUMWIDTH_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,128,80,11,14
+ CONTROL "Maximum width",IDC_USEMAXIMUMWIDTH,"Button",BS_AUTOCHECKBOX | BS_VCENTER | BS_NOTIFY | WS_TABSTOP,7,95,88,12,WS_EX_RIGHT
+ EDITTEXT IDC_MAXIMUMWIDTH,100,95,40,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_MAXIMUMWIDTH_SPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,128,93,11,14
+ RTEXT "Position:",IDC_STATIC,7,110,34,12,SS_CENTERIMAGE
+ COMBOBOX IDC_WHERE,46,110,79,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "...",IDC_CUSTOMPOS,"MButtonClass",WS_TABSTOP,127,110,14,13
+ RTEXT "Layout:",IDC_STATIC,7,125,34,12,SS_CENTERIMAGE
+ COMBOBOX IDC_LAYOUT,46,125,94,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Miscellaneous",IDC_STATIC,3,147,143,50
+ CONTROL "Reorder Popups",IDC_REORDERPOPUPS,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,9,158,133,8
+ GROUPBOX "Disable when:",IDC_STATIC,151,3,146,194
+ CONTROL "Always (has priority)",IDC_POPUPENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,15,135,8
+ CONTROL "Fullscreen mode",IDC_DISABLEINFS,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,159,26,135,8
+ CONTROL "Tree1",IDC_STATUSES,"SysTreeView32",WS_BORDER | WS_HSCROLL | WS_TABSTOP,159,39,130,151
+ CONTROL "Debug",IDC_DEBUG,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,159,203,57,14
+ PUSHBUTTON "Live Preview",IDC_PREVIEW,219,203,73,14
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_OPT_NOTIFICATIONS DLGINIT
+BEGIN
+ IDC_LACTION, 0x403, 13, 0
+0x6553, 0x646e, 0x4d20, 0x7365, 0x6173, 0x6567, "\000"
+ IDC_LACTION, 0x403, 14, 0
+0x6944, 0x6d73, 0x7369, 0x2073, 0x6f50, 0x7570, 0x0070,
+ IDC_RACTION, 0x403, 13, 0
+0x6553, 0x646e, 0x4d20, 0x7365, 0x6173, 0x6567, "\000"
+ IDC_RACTION, 0x403, 14, 0
+0x6944, 0x6d73, 0x7369, 0x2073, 0x6f50, 0x7570, 0x0070,
+ 0
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// SKIN
+//
+
+CLASSIC.POPUPSKIN SKIN "res\\classic.popupskin"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_NOAVATAR BITMAP "res\\avatar.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXT
+//
+
+IDR_WHATSNEW TEXT "res\\whatsnew.txt"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_OPT_POPUP_GENERAL, DIALOG
+ BEGIN
+ HORZGUIDE, 203
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // Íåéòðàëüíûé resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Èòàëüÿíñêèé (Èòàëèÿ) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
+LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
+#pragma code_page(1252)
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Èòàëüÿíñêèé (Èòàëèÿ) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp new file mode 100644 index 0000000000..32ad120bcd --- /dev/null +++ b/plugins/Popup/src/actions.cpp @@ -0,0 +1,440 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/actions.cpp $
+Revision : $Revision: 1622 $
+Last change on : $Date: 2010-06-23 23:32:21 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+static int ActionsSortFunc(const POPUPACTION *p1, const POPUPACTION *p2)
+{
+ return lstrcmpA(p1->lpzTitle, p2->lpzTitle);
+}
+
+static LIST<POPUPACTION> gActions(3, ActionsSortFunc);
+
+// interface
+void LoadActions()
+{
+ POPUPACTION actions[] =
+ {
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_REPLY,0), "General/Quick reply", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_MESS,0), "General/Send message", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_INFO,0), "General/User details", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_MENU,0), "General/Contact menu", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_ADD,0), "General/Add permanently", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_PIN,0), "General/Pin popup", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE,0), "General/Dismiss popup", 0},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_COPY,0), "General/Copy to clipboard", 0},
+
+//remove popup action
+ #if defined(_DEBUG)
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_POPUP_ON,0), "Popup Plus/Test action", PAF_ENABLED},
+ { sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE,0), "Popup Plus/Second test action", 0},
+ { sizeof(POPUPACTION), LoadSkinnedIcon(SKINICON_OTHER_MIRANDA), "Popup Plus/One more action", PAF_ENABLED},
+ #endif
+
+ };
+
+ for (int i = 0; i < SIZEOF(actions); ++i)
+ RegisterAction(&actions[i]);
+}
+
+void UnloadActions()
+{
+// for (int i = 0; i < gActions.getCount(); ++i)
+// delete gActions[i];
+ gActions.destroy();
+}
+
+void RegisterAction(POPUPACTION *action)
+{
+ int index;
+ if ((index = gActions.getIndex(action)) >= 0)
+ {
+ DWORD flags = gActions[index]->flags;
+ *gActions[index] = *action;
+ gActions[index]->flags = flags;
+ } else
+ {
+ POPUPACTION *actionCopy = (POPUPACTION *)mir_alloc(sizeof(POPUPACTION));
+ *actionCopy = *action;
+ actionCopy->flags =
+ DBGetContactSettingByte(NULL, "PopUpActions", actionCopy->lpzTitle, actionCopy->flags & PAF_ENABLED) ?
+ PAF_ENABLED : 0;
+ gActions.insert(actionCopy);
+ }
+}
+
+bool IsActionEnabled(POPUPACTION *action)
+{
+ if (!(action->flags & PAF_ENABLED))
+ return false;
+
+ int index;
+ if ((index = gActions.getIndex(action)) >= 0)
+ if (!(gActions[index]->flags & PAF_ENABLED))
+ return false;
+
+ return true;
+}
+
+bool IsActionEnabled(char *name)
+{
+ POPUPACTION action = {0};
+ action.flags = PAF_ENABLED;
+ lstrcpyA(action.lpzTitle, name);
+ return IsActionEnabled(&action);
+}
+
+DWORD MouseOverride(HWND hCombo, int number)
+{
+ DWORD dwItem = 0;
+ DWORD ItemActive = 0;
+ if(number<0 || number >7)
+ number = 0;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("no overwrite"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 0);
+ if(number == 0)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Send message"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 1);
+ if(number == 1)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Quick reply"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 2);
+ if(number == 2)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("User details"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 3);
+ if(number == 3)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Contact menu"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 4);
+ if(number == 4)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Dismiss popup"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 5);
+ if(number == 5)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Pin popup"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 6);
+ if(number == 6)
+ ItemActive = dwItem;
+ dwItem = SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateT("Copy to clipboard"));
+ SendMessage(hCombo, CB_SETITEMDATA, dwItem, 7);
+ if(number == 7)
+ ItemActive = dwItem;
+ return ItemActive;
+}
+
+// options
+#if defined(_UNICODE)
+#define ListView_InsertItemW(hwnd, pitem) \
+ (int)SendMessageW((hwnd), LVM_INSERTITEMW, 0, (LPARAM)(const LVITEMW *)(pitem))
+#else
+#define ListView_InsertItemW(hwnd, pitem) \
+ (int)MySendMessageW((hwnd), LVM_INSERTITEMW, 0, (LPARAM)(const LVITEMW *)(pitem))
+#endif
+
+void LoadOption_Actions() {
+ PopUpOptions.actions = DBGetContactSettingDword(NULL, MODULNAME, "Actions",
+ ACT_ENABLE|ACT_RIGHTICONS|ACT_DEF_KEEPWND|ACT_DEF_IMONLY|
+ ACT_DEF_NOGLOBAL|ACT_DEF_MESSAGE|ACT_DEF_DETAILS|ACT_DEF_MENU|
+ ACT_DEF_ADD|ACT_DEF_DISMISS|ACT_DEF_PIN);
+ PopUpOptions.overrideLeft = DBGetContactSettingDword(NULL,MODULNAME, "OverrideLeft", 0);
+ PopUpOptions.overrideMiddle = DBGetContactSettingDword(NULL,MODULNAME, "OverrideMiddle", 0);
+ PopUpOptions.overrideRight = DBGetContactSettingDword(NULL,MODULNAME, "OverrideRight", 0);
+}
+
+INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static bool windowInitialized = false;
+
+ static UINT controls[] =
+ {
+ IDC_GRP_CUSTOMACTIONS,
+ IDC_TXT_CUSTOMACTIONS,
+ IDC_CHK_IMCONTACTSONLY,
+ IDC_CHK_CONTACTSONLY,
+ IDC_CHK_DONTCLOSE,
+ IDC_GRP_SIZEPOSITION,
+ IDC_CHK_LARGEICONS,
+ IDC_TXT_POSITION,
+ IDC_RD_TEXT,
+ IDC_RD_LEFTICONS,
+ IDC_RD_RIGHTICONS,
+ IDC_GRP_ACTIONS,
+ IDC_ACTIONS,
+ IDC_GRP_SIZEPOSITION2,
+ IDC_TXT_POSITION2,
+ IDC_CB_LEFT,
+ IDC_TXT_MIDDLE,
+ IDC_CB_MIDDLE,
+ IDC_TXT_RIGHT,
+ IDC_CB_RIGHT
+ };
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ int i;
+ windowInitialized = false;
+
+ TranslateDialogDefault(hwnd);
+
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_INFO), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY,0), 0);
+
+ CheckDlgButton(hwnd, IDC_CHK_ENABLEACTIONS, PopUpOptions.actions&ACT_ENABLE ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_CHK_IMCONTACTSONLY, PopUpOptions.actions&ACT_DEF_IMONLY ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_CHK_CONTACTSONLY, PopUpOptions.actions&ACT_DEF_NOGLOBAL ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_CHK_DONTCLOSE, PopUpOptions.actions&ACT_DEF_KEEPWND ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_CHK_LARGEICONS, PopUpOptions.actions&ACT_LARGE ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_RD_TEXT, PopUpOptions.actions&ACT_TEXT ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_RD_LEFTICONS, PopUpOptions.actions&ACT_LEFTICONS ? TRUE : FALSE);
+ CheckDlgButton(hwnd, IDC_RD_RIGHTICONS, PopUpOptions.actions&ACT_RIGHTICONS ? TRUE : FALSE);
+
+ {
+ DWORD dwActiveItem = 0;
+ HWND hCombo = GetDlgItem(hwnd, IDC_CB_LEFT);
+ dwActiveItem = MouseOverride(hCombo, PopUpOptions.overrideLeft);
+ SendDlgItemMessage(hwnd, IDC_CB_LEFT, CB_SETCURSEL, dwActiveItem, 0);
+
+ dwActiveItem = 0;
+ hCombo = GetDlgItem(hwnd, IDC_CB_MIDDLE);
+ dwActiveItem = MouseOverride(hCombo, PopUpOptions.overrideMiddle);
+ SendDlgItemMessage(hwnd, IDC_CB_MIDDLE, CB_SETCURSEL, dwActiveItem, 0);
+
+ dwActiveItem = 0;
+ hCombo = GetDlgItem(hwnd, IDC_CB_RIGHT);
+ dwActiveItem = MouseOverride(hCombo, PopUpOptions.overrideRight);
+ SendDlgItemMessage(hwnd, IDC_CB_RIGHT, CB_SETCURSEL, dwActiveItem, 0);
+ }
+
+ HWND hwndList = GetDlgItem(hwnd, IDC_ACTIONS);
+ ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES|LVS_EX_LABELTIP);
+ HIMAGELIST hImgList = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 10, 1);
+ ListView_SetImageList(hwndList, hImgList, LVSIL_SMALL);
+
+ LVCOLUMN column = {0};
+ column.mask = LVCF_TEXT|LVCF_WIDTH;
+ column.pszText = TranslateT("Action");
+ column.cx = 175;
+ ListView_InsertColumn(hwndList, 0, &column);
+
+ if (IsWinVerXPPlus())
+ ListView_EnableGroupView(hwndList, TRUE);
+
+ LIST<char> groups(1, strcmp);
+
+ for (i = 0; i < gActions.getCount(); ++i)
+ {
+ char szGroup[64];
+ char *szName = strchr(gActions[i]->lpzTitle, '/');
+ if (!szName) szName = gActions[i]->lpzTitle;
+ else ++szName;
+ lstrcpynA(szGroup, gActions[i]->lpzTitle, szName - gActions[i]->lpzTitle);
+
+ int grpId = 0;
+
+ if (IsWinVerXPPlus() && ((grpId = groups.getIndex(szGroup)) < 0))
+ {
+ LVGROUP group = {0};
+ group.cbSize = sizeof(group);
+ group.mask = LVGF_HEADER|LVGF_GROUPID;
+ LPWSTR wszGroup = mir_a2u(szGroup);
+ group.pszHeader = TranslateW(wszGroup);
+ group.cchHeader = lstrlenW(wszGroup);
+ grpId = group.iGroupId = groups.getCount();
+ int grpId = ListView_InsertGroup(hwndList, -1, &group);
+ mir_free(wszGroup);
+ groups.insert(mir_strdup(szGroup), groups.getCount());
+ }
+
+ if (g_popup.isOsUnicode)
+ {
+ LVITEMW item = {0};
+ item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_INDENT;
+ item.iItem = i;
+ LPWSTR wszName = mir_a2u(szName);
+ item.pszText = TranslateW(wszName);
+ item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
+ item.lParam = i;
+ if (IsWinVerXPPlus())
+ {
+ item.mask |= LVIF_GROUPID;
+ item.iGroupId = grpId;
+ }
+ item.iIndent = 0;
+ ListView_InsertItemW(hwndList, &item);
+ mir_free(wszName);
+ } else
+ {
+ LVITEMA item = {0};
+ item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_GROUPID|LVIF_INDENT;
+ item.iItem = i;
+ item.pszText = Translate(szName);
+ item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
+ item.lParam = i;
+ item.iGroupId = grpId;
+ item.iIndent = 0;
+ ListView_InsertItem(hwndList, &item);
+ }
+
+ ListView_SetItemState(hwndList, i, (gActions[i]->flags & PAF_ENABLED) ? 0x2000 : 0x1000, LVIS_STATEIMAGEMASK);
+ }
+
+ groups.destroy();
+
+ BOOL enabled = (PopUpOptions.actions&ACT_ENABLE) ? TRUE : FALSE;
+ for (i = 0; i < SIZEOF(controls); ++i)
+ EnableWindow(GetDlgItem(hwnd, controls[i]), enabled);
+
+ windowInitialized = true;
+ break;
+ }
+
+ case WM_COMMAND:
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDC_CHK_ENABLEACTIONS:
+ {
+ PopUpOptions.actions &= ~ACT_ENABLE;
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_ENABLEACTIONS) ? ACT_ENABLE : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+
+ BOOL enabled = (PopUpOptions.actions&ACT_ENABLE) ? TRUE : FALSE;
+ for (int i = 0; i < SIZEOF(controls); ++i)
+ EnableWindow(GetDlgItem(hwnd, controls[i]), enabled);
+ break;
+ }
+
+ case IDC_CHK_IMCONTACTSONLY:
+ PopUpOptions.actions &= ~ACT_DEF_IMONLY;
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_IMCONTACTSONLY) ? ACT_DEF_IMONLY : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_CHK_CONTACTSONLY:
+ PopUpOptions.actions &= ~ACT_DEF_NOGLOBAL;
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_CONTACTSONLY) ? ACT_DEF_NOGLOBAL : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_CHK_DONTCLOSE:
+ PopUpOptions.actions &= ~ACT_DEF_KEEPWND;
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_DONTCLOSE) ? ACT_DEF_KEEPWND : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_CHK_LARGEICONS:
+ PopUpOptions.actions &= ~ACT_LARGE;
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_LARGEICONS) ? ACT_LARGE : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_RD_TEXT:
+ PopUpOptions.actions &= ~(ACT_TEXT|ACT_LEFTICONS|ACT_RIGHTICONS);
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_ENABLEACTIONS) ? ACT_TEXT : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_RD_LEFTICONS:
+ PopUpOptions.actions &= ~(ACT_TEXT|ACT_LEFTICONS|ACT_RIGHTICONS);
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_RD_LEFTICONS) ? ACT_LEFTICONS : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_RD_RIGHTICONS:
+ PopUpOptions.actions &= ~(ACT_TEXT|ACT_LEFTICONS|ACT_RIGHTICONS);
+ PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_RD_RIGHTICONS) ? ACT_RIGHTICONS : 0;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ case IDC_PREVIEW:
+ PopUpPreview();
+ break;
+ case IDC_CB_LEFT:
+ case IDC_CB_MIDDLE:
+ case IDC_CB_RIGHT:
+ PopUpOptions.overrideLeft = SendDlgItemMessage(hwnd, IDC_CB_LEFT, CB_GETITEMDATA,
+ SendDlgItemMessage(hwnd, IDC_CB_LEFT, CB_GETCURSEL,0,0),0);
+ PopUpOptions.overrideMiddle = SendDlgItemMessage(hwnd, IDC_CB_MIDDLE, CB_GETITEMDATA,
+ SendDlgItemMessage(hwnd, IDC_CB_MIDDLE, CB_GETCURSEL,0,0),0);
+ PopUpOptions.overrideRight = SendDlgItemMessage(hwnd, IDC_CB_RIGHT, CB_GETITEMDATA,
+ SendDlgItemMessage(hwnd, IDC_CB_RIGHT, CB_GETCURSEL,0,0),0);
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ break;
+ }
+ break;
+ }
+
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_RESET:
+ LoadOption_Actions();
+ break;
+ case PSN_APPLY:
+ {
+ DBWriteContactSettingDword(NULL, MODULNAME, "Actions", PopUpOptions.actions);
+ HWND hwndList = GetDlgItem(hwnd, IDC_ACTIONS);
+ for (int i = 0; i < gActions.getCount(); ++i)
+ {
+ gActions[i]->flags = (ListView_GetItemState(hwndList, i, LVIS_STATEIMAGEMASK) == 0x2000) ? PAF_ENABLED : 0;
+ DBWriteContactSettingByte(NULL, "PopUpActions", gActions[i]->lpzTitle, (gActions[i]->flags&PAF_ENABLED) ? 1 : 0);
+ }
+ //overrideActions
+ DBWriteContactSettingDword(NULL, MODULNAME, "OverrideLeft", PopUpOptions.overrideLeft);
+ DBWriteContactSettingDword(NULL, MODULNAME, "OverrideMiddle", PopUpOptions.overrideMiddle);
+ DBWriteContactSettingDword(NULL, MODULNAME, "OverrideRight", PopUpOptions.overrideRight);
+ break;
+ }
+ }
+ break;
+ }
+
+ case IDC_ACTIONS:
+ {
+ NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
+ if (windowInitialized &&
+ nmlv && nmlv->hdr.code == LVN_ITEMCHANGED && nmlv->uOldState != 0 &&
+ (nmlv->uNewState == 0x1000 || nmlv->uNewState == 0x2000))
+ {
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ }
+ return FALSE;
+}
diff --git a/plugins/Popup/src/actions.h b/plugins/Popup/src/actions.h new file mode 100644 index 0000000000..7938f1ea92 --- /dev/null +++ b/plugins/Popup/src/actions.h @@ -0,0 +1,46 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/actions.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __actions_h__
+#define __actions_h__
+
+void LoadActions();
+void UnloadActions();
+
+void RegisterAction(POPUPACTION *action);
+bool IsActionEnabled(POPUPACTION *action);
+bool IsActionEnabled(char *name);
+
+void LoadOption_Actions();
+INT_PTR CALLBACK DlgProcPopupActions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif // __actions_h__
diff --git a/plugins/Popup/src/avatars.cpp b/plugins/Popup/src/avatars.cpp new file mode 100644 index 0000000000..68fbac58bb --- /dev/null +++ b/plugins/Popup/src/avatars.cpp @@ -0,0 +1,60 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright � 2002 Luca Santarelli,
+ � 2004-2007 Victor Pavlychko
+ � 2010 MPK
+ � 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+PopupAvatar *PopupAvatar::create(HANDLE hContact)
+{
+ if (hContact)
+ {
+ if (ServiceExists(MS_AV_GETAVATARBITMAP))
+ {
+ avatarCacheEntry *av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
+// MessageBox(NULL, _T("00"), _T(MODULNAME_LONG), MB_OK);
+ if (av && (_tcslen(av->szFilename) > 4))
+ {
+// MessageBox(NULL, _T("01"), _T(MODULNAME_LONG), MB_OK);
+ if (!_tcsicmp(av->szFilename+_tcslen(av->szFilename)-4, _T(".gif")))
+ {
+// MessageBox(NULL, _T("02"), _T(MODULNAME_LONG), MB_OK);
+ if (DBGetContactSettingByte(NULL, MODULNAME, "EnableGifAnimation", 1) && GDIPlus_IsAnimatedGIF(av->szFilename))
+ {
+// MessageBox(NULL, _T("03"), _T(MODULNAME_LONG), MB_OK);
+ return new GifAvatar(hContact);
+ }
+ }
+ }
+ }
+ }
+
+ return new SimpleAvatar(hContact);
+}
diff --git a/plugins/Popup/src/avatars.h b/plugins/Popup/src/avatars.h new file mode 100644 index 0000000000..77d2461fe0 --- /dev/null +++ b/plugins/Popup/src/avatars.h @@ -0,0 +1,57 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __avatars_h__
+#define __avatars_h__
+
+class PopupAvatar
+{
+protected:
+ int width, height;
+ bool bIsAnimated, bIsValid;
+
+public:
+ PopupAvatar(HANDLE hContact) {}
+ virtual ~PopupAvatar() {}
+ virtual int activeFrameDelay() = 0;
+ virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options) = 0;
+
+ inline bool isValid() { return bIsValid; }
+ inline void invalidate() { bIsValid = false; }
+ inline bool isAnimated() { return bIsAnimated; }
+ inline int getWidth() { return width; }
+ inline int getHeight() { return height; }
+
+ static PopupAvatar *create(HANDLE hContact);
+};
+
+#endif // __avatars_h__
diff --git a/plugins/Popup/src/avatars_flash.cpp b/plugins/Popup/src/avatars_flash.cpp new file mode 100644 index 0000000000..2cd95e2a8d --- /dev/null +++ b/plugins/Popup/src/avatars_flash.cpp @@ -0,0 +1,34 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars_flash.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
diff --git a/plugins/Popup/src/avatars_flash.h b/plugins/Popup/src/avatars_flash.h new file mode 100644 index 0000000000..9c5483064d --- /dev/null +++ b/plugins/Popup/src/avatars_flash.h @@ -0,0 +1,45 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars_flash.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __avatars_flash_h__
+#define __avatars_flash_h__
+
+class FlashAvatar: public PopupAvatar
+{
+public:
+ FlashAvatar(HANDLE hContact);
+ virtual ~FlashAvatar();
+ virtual int activeFrameDelay() = 0;
+ virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options) = 0;
+};
+
+#endif // __avatars_flash_h__
diff --git a/plugins/Popup/src/avatars_gif.cpp b/plugins/Popup/src/avatars_gif.cpp new file mode 100644 index 0000000000..24ee798e93 --- /dev/null +++ b/plugins/Popup/src/avatars_gif.cpp @@ -0,0 +1,143 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars_gif.cpp $
+Revision : $Revision: 1624 $
+Last change on : $Date: 2010-06-24 19:39:34 +0300 (Чт, 24 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+GifAvatar::GifAvatar(HANDLE hContact): PopupAvatar(hContact)
+{
+ av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
+ bIsAnimated = true;
+ bIsValid = true;
+ GDIPlus_GetGIFSize(av->szFilename, &this->width, &this->height);
+
+ hBitmap = NULL;
+ frameDelays = NULL;
+ frameCount = 0;
+ frameSize.cx = frameSize.cy = 0;
+
+ cachedHeight = cachedWidth = -1;
+
+ activeFrame = 0;
+}
+
+GifAvatar::~GifAvatar()
+{
+ if (frameDelays) {
+ mir_free(frameDelays);
+ frameDelays = NULL;
+ }
+ if (hBitmap) DeleteObject(hBitmap);
+}
+
+int GifAvatar::activeFrameDelay()
+{
+ if (!av || !frameCount || !frameDelays || !hBitmap || (activeFrame < 0) || (activeFrame >= frameCount))
+ return -1;
+ return frameDelays[activeFrame];
+}
+
+void GifAvatar::draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options)
+{
+ if (!av || (w <= 0) || (h <= 0)) return;
+
+ if (!frameCount || !frameDelays || !hBitmap || (cachedWidth != w) || (cachedHeight != h))
+ {
+ cachedWidth = w;
+ cachedHeight = h;
+ if (frameDelays) {
+ mir_free(frameDelays);
+ frameDelays = NULL;
+ }
+ if (hBitmap) DeleteObject(hBitmap);
+ GDIPlus_ExtractAnimatedGIF(av->szFilename, w, h, &hBitmap, &frameDelays, &frameCount, &frameSize);
+ }
+
+ if (!frameCount) return;
+
+ HRGN rgn;
+ if (options->avatarRadius)
+ {
+ rgn = CreateRoundRectRgn(x, y, x+w, y+h, 2 * options->avatarRadius, 2 * options->avatarRadius);
+ SelectClipRgn(bmp->getDC(), rgn);
+ } else
+ {
+ rgn = CreateRectRgn(x, y, x+w, y+h);
+ }
+
+ HDC hdcTmp = CreateCompatibleDC(bmp->getDC());
+ SelectObject(hdcTmp, hBitmap);
+ SetStretchBltMode(bmp->getDC(), HALFTONE);
+
+#if defined(_UNICODE)
+ if (av->dwFlags & AVS_PREMULTIPLIED)
+ {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ AlphaBlend(bmp->getDC(), x, y, w, h, hdcTmp, frameSize.cx*activeFrame, 0, frameSize.cx, frameSize.cy, bf);
+#else
+ if (MyAlphaBlend && (av->dwFlags & AVS_PREMULTIPLIED))
+ {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ MyAlphaBlend(bmp->getDC(), x, y, w, h, hdcTmp, frameSize.cx*activeFrame, 0, frameSize.cx, frameSize.cy, bf);
+#endif
+ if (options->avatarBorders && options->avatarPNGBorders)
+ {
+ HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder);
+ bmp->saveAlpha(x, y, w, h);
+ FrameRgn(bmp->getDC(), rgn, hbr, 1, 1);
+ DeleteObject(hbr);
+ bmp->restoreAlpha(x, y, w, h);
+ }
+ }
+ else {
+ bmp->saveAlpha(x, y, w, h);
+ StretchBlt(bmp->getDC(), x, y, w, h, hdcTmp, frameSize.cx*activeFrame, 0, frameSize.cx, frameSize.cy, SRCCOPY);
+ if (options->avatarBorders) {
+ HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder);
+ FrameRgn(bmp->getDC(), rgn, hbr, 1, 1);
+ DeleteObject(hbr);
+ }
+ bmp->restoreAlpha(x, y, w, h);
+ }
+ DeleteObject(rgn);
+ SelectClipRgn(bmp->getDC(), NULL);
+ DeleteDC(hdcTmp);
+
+ activeFrame = (activeFrame + 1) % frameCount;
+}
diff --git a/plugins/Popup/src/avatars_gif.h b/plugins/Popup/src/avatars_gif.h new file mode 100644 index 0000000000..e7ec9057e3 --- /dev/null +++ b/plugins/Popup/src/avatars_gif.h @@ -0,0 +1,55 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars_gif.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __avatars_gif_h__
+#define __avatars_gif_h__
+
+class GifAvatar: public PopupAvatar
+{
+protected:
+ avatarCacheEntry *av;
+ int cachedWidth, cachedHeight;
+ int activeFrame;
+
+ HBITMAP hBitmap;
+ int *frameDelays;
+ int frameCount;
+ SIZE frameSize;
+
+public:
+ GifAvatar(HANDLE hContact);
+ virtual ~GifAvatar();
+ virtual int activeFrameDelay();
+ virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options);
+};
+
+#endif // __avatars_gif_h__
diff --git a/plugins/Popup/src/avatars_simple.cpp b/plugins/Popup/src/avatars_simple.cpp new file mode 100644 index 0000000000..2c3b3341cb --- /dev/null +++ b/plugins/Popup/src/avatars_simple.cpp @@ -0,0 +1,149 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars_simple.cpp $
+Revision : $Revision: 1624 $
+Last change on : $Date: 2010-06-24 19:39:34 +0300 (Чт, 24 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+SimpleAvatar::SimpleAvatar(HANDLE hContact, bool bUseBitmap): PopupAvatar(bUseBitmap ? 0 : hContact)
+{
+ bIsAnimated = false;
+ bIsValid = true;
+
+ if (bUseBitmap)
+ {
+ BITMAP bmp;
+ GetObject((HBITMAP)hContact, sizeof(bmp), &bmp);
+ width = abs(bmp.bmWidth);
+ height = abs(bmp.bmHeight);
+
+ avNeedFree = true;
+ av = new avatarCacheEntry;
+ av->bmHeight = abs(bmp.bmHeight);
+ av->bmWidth = abs(bmp.bmWidth);
+ av->hbmPic = (HBITMAP)hContact;
+ av->dwFlags = AVS_BITMAP_VALID;
+ return;
+ }
+
+ if (hContact && ServiceExists(MS_AV_GETAVATARBITMAP))
+ {
+ avNeedFree = false;
+ av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
+ if (av)
+ {
+ if (av->hbmPic && (av->dwFlags&AVS_BITMAP_VALID) && !(av->dwFlags&AVS_HIDEONCLIST) && !(av->dwFlags&AVS_NOTREADY))
+ {
+ width = av->bmWidth;
+ height = av->bmHeight;
+ return;
+ }
+
+ if (av->dwFlags&AVS_NOTREADY)
+ bIsValid = false;
+ }
+ }
+
+ width = height = 0;
+ av = NULL;
+ avNeedFree = false;
+}
+
+SimpleAvatar::~SimpleAvatar()
+{
+ if (avNeedFree) delete av;
+}
+
+int SimpleAvatar::activeFrameDelay()
+{
+ return -1;
+}
+
+void SimpleAvatar::draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options)
+{
+ if (!av) return;
+
+ HRGN rgn;
+ if (options->avatarRadius)
+ {
+ rgn = CreateRoundRectRgn(x, y, x+w, y+h, 2 * options->avatarRadius, 2 * options->avatarRadius);
+ SelectClipRgn(bmp->getDC(), rgn);
+ } else
+ {
+ rgn = CreateRectRgn(x, y, x+w, y+h);
+ }
+
+ HDC hdcTmp = CreateCompatibleDC(bmp->getDC());
+ SelectObject(hdcTmp, av->hbmPic);
+ SetStretchBltMode(bmp->getDC(), HALFTONE);
+
+#if defined(_UNICODE)
+ if (av->dwFlags & AVS_HASTRANSPARENCY)
+ {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ AlphaBlend(bmp->getDC(), x, y, w, h, hdcTmp, 0, 0, av->bmWidth, av->bmHeight, bf);
+#else
+// if (MyAlphaBlend && (av->dwFlags & AVS_PREMULTIPLIED))
+ if (MyAlphaBlend && (av->dwFlags & AVS_HASTRANSPARENCY))
+ {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ MyAlphaBlend(bmp->getDC(), x, y, w, h, hdcTmp, 0, 0, av->bmWidth, av->bmHeight, bf);
+#endif
+ if (options->avatarBorders && options->avatarPNGBorders)
+ {
+ HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder);
+ bmp->saveAlpha(x, y, w, h);
+ FrameRgn(bmp->getDC(), rgn, hbr, 1, 1);
+ DeleteObject(hbr);
+ bmp->restoreAlpha(x, y, w, h);
+ }
+ }
+ else {
+ bmp->saveAlpha(x, y, w, h);
+ StretchBlt(bmp->getDC(), x, y, w, h, hdcTmp, 0, 0, av->bmWidth, av->bmHeight, SRCCOPY);
+ if (options->avatarBorders){
+ HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder);
+ FrameRgn(bmp->getDC(), rgn, hbr, 1, 1);
+ DeleteObject(hbr);
+ }
+ bmp->restoreAlpha(x, y, w, h);
+ }
+ DeleteObject(rgn);
+ SelectClipRgn(bmp->getDC(), NULL);
+ DeleteDC(hdcTmp);
+}
diff --git a/plugins/Popup/src/avatars_simple.h b/plugins/Popup/src/avatars_simple.h new file mode 100644 index 0000000000..5cc8037a58 --- /dev/null +++ b/plugins/Popup/src/avatars_simple.h @@ -0,0 +1,49 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/avatars_simple.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __avatars_simple_h__
+#define __avatars_simple_h__
+
+class SimpleAvatar: public PopupAvatar
+{
+private:
+ avatarCacheEntry *av;
+ bool avNeedFree;
+
+public:
+ SimpleAvatar(HANDLE hContact, bool bUseBitmap = false);
+ virtual ~SimpleAvatar();
+ virtual int activeFrameDelay();
+ virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options);
+};
+
+#endif // __avatars_simple_h__
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp new file mode 100644 index 0000000000..4cb013a378 --- /dev/null +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -0,0 +1,1019 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/bitmap_funcs.cpp $
+Revision : $Revision: 1627 $
+Last change on : $Date: 2010-06-29 10:34:46 +0300 (Вт, 29 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+#include "bitmap_funcs.h"
+
+#define PU_BMP_ACCURATE_ARITHMETICS
+
+#ifdef PU_BMP_ACCURATE_ARITHMETICS
+ #define PU_DIV255(x) ((x)/255)
+ #define PU_DIV128(x) ((x)/128)
+ typedef float pu_koef;
+#else
+ #define PU_DIV255(x) ((x)>>8)
+ #define PU_DIV128(x) ((x)>>7)
+ typedef long pu_koef;
+#endif
+
+MyBitmap::MyBitmap()
+{
+ dcBmp = 0;
+ hBmp = 0;
+ bits = 0;
+ width = height = 0;
+ bitsSave = 0;
+}
+
+MyBitmap::MyBitmap(int w, int h)
+{
+ dcBmp = 0;
+ hBmp = 0;
+ bits = 0;
+ width = height = 0;
+ bitsSave = 0;
+ allocate(w,h);
+}
+
+MyBitmap::MyBitmap(const char *fn, const char *fnAlpha)
+{
+ dcBmp = 0;
+ hBmp = 0;
+ bits = 0;
+ width = height = 0;
+ bitsSave = 0;
+ loadFromFile(fn, fnAlpha);
+}
+
+MyBitmap::~MyBitmap()
+{
+ if (bitsSave)
+ delete [] bitsSave;
+ free();
+}
+
+void MyBitmap::makeOpaque()
+{
+ if (!bits) return;
+
+ GdiFlush();
+ for (int i = 0; i < width*height; i++)
+ bits[i] |= 0xff000000;
+}
+
+void MyBitmap::makeOpaqueRect(int x1, int y1, int x2, int y2)
+{
+ if (!bits) return;
+
+ GdiFlush();
+ for (int i = y1; i < y2; i++)
+ for (int j = x1; j < x2; j++)
+ {
+ int idx = i * width + j;
+ bits[idx] |= 0xff000000;
+ }
+}
+
+void MyBitmap::saveAlpha(int x, int y, int w, int h)
+{
+ if (bitsSave)
+ delete [] bitsSave;
+
+ GdiFlush();
+
+ if (!w) w = width;
+ if (!h) h = height;
+ if (!w || !h)
+ return;
+ if (x < 0 || y < 0)
+ return;
+
+ bitsSave = new COLOR32[w*h];
+ COLOR32 *p1 = bitsSave;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ COLOR32 *p2 = bits + (y+i)*width + x;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ *p1++ = *p2++;
+ }
+ }
+}
+
+void MyBitmap::restoreAlpha(int x, int y, int w, int h)
+{
+ if (!bitsSave)
+ return;
+
+ GdiFlush();
+
+ if (!w) w = width;
+ if (!h) h = height;
+
+ COLOR32 *p1 = bitsSave;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ COLOR32 *p2 = bits + (y+i)*width + x;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ if ((*p1&0x00ffffff) != (*p2&0x00ffffff))
+ {
+ *p2 |= 0xff000000;
+ } else
+ {
+ *p2 = (*p2&0x00ffffff) | (*p1&0xff000000);
+ }
+ ++p1;
+ ++p2;
+ }
+ }
+
+ delete [] bitsSave;
+ bitsSave = 0;
+}
+
+void MyBitmap::DrawBits(COLOR32 *inbits, int inw, int inh, int x, int y, int w, int h)
+{
+ if (!(bits && inbits)) return;
+
+ GdiFlush();
+
+ float kx = (float)inw / w;
+ float ky = (float)inh / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ bits[(i+y)*width + (j+x)] = inbits[int(i*ky)*inw + int(j*kx)];
+ }
+ }
+}
+
+void MyBitmap::BlendBits(COLOR32 *inbits, int inw, int inh, int x, int y, int w, int h)
+{
+ if (!(bits && inbits)) return;
+
+ GdiFlush();
+
+ float kx = (float)inw / w;
+ float ky = (float)inh / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ COLOR32 src = inbits[int(i*ky)*inw + int(j*kx)];
+ COLOR32 dst = bits[(i+y)*width + (j+x)];
+ long alpha = geta(src);
+ bits[(i+y)*width + (j+x)] = rgba(
+ getr(src)+PU_DIV255((255-alpha)*getr(dst)),
+ getg(src)+PU_DIV255((255-alpha)*getg(dst)),
+ getb(src)+PU_DIV255((255-alpha)*getb(dst)),
+ geta(src)+PU_DIV255((255-alpha)*geta(dst))
+ );
+ }
+ }
+}
+
+void MyBitmap::Blend(MyBitmap *bmp, int x, int y, int w, int h)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+
+ GdiFlush();
+
+ if (!w) w = bmp->width;
+ if (!h) h = bmp->height;
+ float kx = (float)bmp->width / w;
+ float ky = (float)bmp->height / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ COLOR32 src = bmp->bits[int(i*ky)*bmp->width + int(j*kx)];
+ COLOR32 dst = bits[(i+y)*width + (j+x)];
+ long alpha = geta(src);
+ bits[(i+y)*width + (j+x)] = rgba(
+ getr(src)+PU_DIV255((255-alpha)*getr(dst)),
+ getg(src)+PU_DIV255((255-alpha)*getg(dst)),
+ getb(src)+PU_DIV255((255-alpha)*getb(dst)),
+ geta(src)+PU_DIV255((255-alpha)*geta(dst))
+ );
+ }
+ }
+}
+
+void MyBitmap::Draw(MyBitmap *bmp, int x, int y, int w, int h)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+
+ GdiFlush();
+
+ if (!w) w = bmp->width;
+ if (!h) h = bmp->height;
+
+ if (!x && !y && (w == width) && (h == height) && (w == bmp->width) && (h == bmp->height))
+ {
+ // fast bitmap copy is possible good for animated avatars
+ CopyMemory(bits, bmp->bits, width*height*sizeof(COLOR32));
+ return;
+ }
+
+ float kx = (float)bmp->width / w;
+ float ky = (float)bmp->height / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ bits[(i+y)*width + (j+x)] = bmp->bits[int(i*ky)*bmp->width + int(j*kx)];
+ }
+ }
+}
+
+void MyBitmap::BlendColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+
+ GdiFlush();
+
+ if (!w) w = bmp->width;
+ if (!h) h = bmp->height;
+ float kx = (float)bmp->width / w;
+ float ky = (float)bmp->height / h;
+
+ // we should swap B and R channels when working with win32 COLORREF
+ float koef1r = (255 - getb(color)) / 128.0;
+ float koef1g = (255 - getg(color)) / 128.0;
+ float koef1b = (255 - getr(color)) / 128.0;
+
+ int br = - 255 + 2 * getb(color);
+ int bg = - 255 + 2 * getg(color);
+ int bb = - 255 + 2 * getr(color);
+
+ float koef2r = (getb(color)) / 128.0;
+ float koef2g = (getg(color)) / 128.0;
+ float koef2b = (getr(color)) / 128.0;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+
+// COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+// bits[(i+y)*width + (j+x)] = (cl > 128) ?
+// rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])):
+// rgba(koef2r * cl, koef2g * cl, koef2b * cl, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]));
+
+ long alpha = geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+// COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+ COLOR32 cl = alpha ? getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])*255/alpha : 0;
+#pragma warning(push)
+#pragma warning(disable: 4244)
+ COLOR32 src = (cl > 128) ?
+ rgba(
+ PU_DIV255((koef1r * cl + br)*alpha),
+ PU_DIV255((koef1g * cl + bg)*alpha),
+ PU_DIV255((koef1b * cl + bb)*alpha),
+ alpha):
+ rgba(
+ PU_DIV255(koef2r * cl * alpha),
+ PU_DIV255(koef2g * cl * alpha),
+ PU_DIV255(koef2b * cl * alpha),
+ alpha);
+#pragma warning(pop)
+// COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+// COLOR32 src = (cl > 128) ?
+// rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, alpha):
+// rgba(koef2r * cl, koef2g * cl, koef2b * cl, alpha);
+ COLOR32 dst = bits[(i+y)*width + (j+x)];
+// long alpha = geta(src);
+ bits[(i+y)*width + (j+x)] = rgba(
+ getr(src)+PU_DIV255((255-alpha)*getr(dst)),
+ getg(src)+PU_DIV255((255-alpha)*getg(dst)),
+ getb(src)+PU_DIV255((255-alpha)*getb(dst)),
+ geta(src)+PU_DIV255((255-alpha)*geta(dst))
+ );
+
+ }
+ }
+}
+
+void MyBitmap::DrawColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+
+ GdiFlush();
+
+ if (!w) w = bmp->width;
+ if (!h) h = bmp->height;
+ float kx = (float)bmp->width / w;
+ float ky = (float)bmp->height / h;
+
+ // we should swap B and R channels when working with win32 COLORREF
+ float koef1r = (255 - getb(color)) / 128.0;
+ float koef1g = (255 - getg(color)) / 128.0;
+ float koef1b = (255 - getr(color)) / 128.0;
+
+ int br = - 255 + 2 * getb(color);
+ int bg = - 255 + 2 * getg(color);
+ int bb = - 255 + 2 * getr(color);
+
+ float koef2r = (getb(color)) / 128.0;
+ float koef2g = (getg(color)) / 128.0;
+ float koef2b = (getr(color)) / 128.0;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+
+ long alpha = geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+// COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+ COLOR32 cl = alpha ? getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])*255/alpha : 0;
+#pragma warning(push)
+#pragma warning(disable: 4244)
+ bits[(i+y)*width + (j+x)] = (cl > 128) ?
+ rgba(
+ PU_DIV255((koef1r * cl + br)*alpha),
+ PU_DIV255((koef1g * cl + bg)*alpha),
+ PU_DIV255((koef1b * cl + bb)*alpha),
+ alpha):
+ rgba(
+ PU_DIV255(koef2r * cl * alpha),
+ PU_DIV255(koef2g * cl * alpha),
+ PU_DIV255(koef2b * cl * alpha),
+ alpha);
+#pragma warning(pop)
+// bits[(i+y)*width + (j+x)] = (cl > 128) ?
+// rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])):
+// rgba(koef2r * cl, koef2g * cl, koef2b * cl, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]));
+ }
+ }
+}
+
+void MyBitmap::BlendPart(MyBitmap *bmp, int xin, int yin, int win, int hin, int x, int y, int w, int h)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+ if (!win || !hin) return;
+
+ GdiFlush();
+
+ if (!w) w = win;
+ if (!h) h = hin;
+ float kx = (float)win / w;
+ float ky = (float)hin / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ COLOR32 src = bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)];
+ COLOR32 dst = bits[(i+y)*width + (j+x)];
+ long alpha = geta(src);
+ bits[(i+y)*width + (j+x)] = rgba(
+ getr(src)+PU_DIV255((255-alpha)*getr(dst)),
+ getg(src)+PU_DIV255((255-alpha)*getg(dst)),
+ getb(src)+PU_DIV255((255-alpha)*getb(dst)),
+ geta(src)+PU_DIV255((255-alpha)*geta(dst))
+ );
+// bits[(i+y)*width + (j+x)] = bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)];
+ }
+ }
+}
+
+void MyBitmap::BlendPartColorized(MyBitmap *bmp, int xin, int yin, int win, int hin, int x, int y, int w, int h, COLOR32 color)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+ if (!win || !hin) return;
+
+ GdiFlush();
+
+ if (!w) w = win;
+ if (!h) h = hin;
+ float kx = (float)win / w;
+ float ky = (float)hin / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ // we should swap B and R channels when working with win32 COLORREF
+ float koef1r = (255 - getb(color)) / 128.0;
+ float koef1g = (255 - getg(color)) / 128.0;
+ float koef1b = (255 - getr(color)) / 128.0;
+
+ int br = - 255 + 2 * getb(color);
+ int bg = - 255 + 2 * getg(color);
+ int bb = - 255 + 2 * getr(color);
+
+ float koef2r = (getb(color)) / 128.0;
+ float koef2g = (getg(color)) / 128.0;
+ float koef2b = (getr(color)) / 128.0;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+
+ long alpha = geta(bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)]);
+// COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+ COLOR32 cl = alpha ? getr(bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)])*255/alpha : 0;
+#pragma warning(push)
+#pragma warning(disable: 4244)
+ COLOR32 src = (cl > 128) ?
+ rgba(
+ PU_DIV255((koef1r * cl + br)*alpha),
+ PU_DIV255((koef1g * cl + bg)*alpha),
+ PU_DIV255((koef1b * cl + bb)*alpha),
+ alpha):
+ rgba(
+ PU_DIV255(koef2r * cl * alpha),
+ PU_DIV255(koef2g * cl * alpha),
+ PU_DIV255(koef2b * cl * alpha),
+ alpha);
+#pragma warning(pop)
+// COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]);
+// COLOR32 src = (cl > 128) ?
+// rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, alpha):
+// rgba(koef2r * cl, koef2g * cl, koef2b * cl, alpha);
+ COLOR32 dst = bits[(i+y)*width + (j+x)];
+// long alpha = geta(src);
+ bits[(i+y)*width + (j+x)] = rgba(
+ getr(src)+PU_DIV255((255-alpha)*getr(dst)),
+ getg(src)+PU_DIV255((255-alpha)*getg(dst)),
+ getb(src)+PU_DIV255((255-alpha)*getb(dst)),
+ geta(src)+PU_DIV255((255-alpha)*geta(dst))
+ );
+
+/* COLOR32 src = bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)];
+ COLOR32 dst = bits[(i+y)*width + (j+x)];
+ long alpha = geta(src);
+ bits[(i+y)*width + (j+x)] = rgba(
+ getr(src)+(255-alpha)*getr(dst)/255,
+ getg(src)+(255-alpha)*getg(dst)/255,
+ getb(src)+(255-alpha)*getb(dst)/255,
+ geta(src)+(255-alpha)*geta(dst)/255
+ );*/
+// bits[(i+y)*width + (j+x)] = bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)];
+ }
+ }
+}
+
+void MyBitmap::DrawPart(MyBitmap *bmp, int xin, int yin, int win, int hin, int x, int y, int w, int h)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+ if (!win || !hin) return;
+
+ GdiFlush();
+
+ if (!w) w = win;
+ if (!h) h = hin;
+ float kx = (float)win / w;
+ float ky = (float)hin / h;
+
+ if (x+w >= this->getWidth())
+ w = this->getWidth() - x;
+ if (y+h >= this->getHeight())
+ h = this->getHeight() - y;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ bits[(i+y)*width + (j+x)] = bmp->bits[int(yin+i*ky)*bmp->width + int(xin+j*kx)];
+ }
+ }
+}
+
+void MyBitmap::DrawNoAlpha(MyBitmap *bmp, int x, int y, int w, int h)
+{
+ if (!(bits && bmp && bmp->bits)) return;
+
+ GdiFlush();
+
+ for (int i = 0; i < bmp->height; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= height) break;
+ for (int j = 0; j < bmp->width; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= width) break;
+ bits[(i+y)*width + (j+x)] = bmp->bits[i*bmp->width + j];
+ }
+ }
+}
+
+void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
+{
+ GdiFlush();
+
+ ICONINFO info;
+ GetIconInfo(hic, &info);
+
+ BITMAP bmpColor, bmpMask;
+ GetObject(info.hbmMask, sizeof(bmpMask), &bmpMask);
+ GetObject(info.hbmColor, sizeof(bmpColor), &bmpColor);
+
+ if (!w) w = abs(bmpMask.bmWidth);
+ if (!h) h = abs(bmpMask.bmHeight);
+
+ if (bmpColor.bmBitsPixel == 32)
+ {
+ if ((w != abs(bmpMask.bmWidth)) || (h != abs(bmpMask.bmHeight)))
+ {
+ DeleteObject(info.hbmColor);
+ DeleteObject(info.hbmMask);
+ HICON hicTmp = (HICON)CopyImage(hic,IMAGE_ICON,w,h,LR_COPYFROMRESOURCE);
+ GetIconInfo(hicTmp, &info);
+ GetObject(info.hbmMask, sizeof(bmpMask), &bmpMask);
+ GetObject(info.hbmColor, sizeof(bmpColor), &bmpColor);
+ DestroyIcon(hicTmp);
+ }
+
+ BYTE *cbit = new BYTE[bmpColor.bmWidthBytes*bmpColor.bmHeight];
+ BYTE *mbit = new BYTE[bmpMask.bmWidthBytes*bmpMask.bmHeight];
+ GetBitmapBits(info.hbmColor, bmpColor.bmWidthBytes*bmpColor.bmHeight, cbit);
+ GetBitmapBits(info.hbmMask, bmpMask.bmWidthBytes*bmpMask.bmHeight, mbit);
+
+ for (int i = 0; i < bmpColor.bmHeight; i++)
+ {
+ for (int j = 0; j < bmpColor.bmWidth; j++)
+ {
+ BYTE *pixel = cbit + i*bmpColor.bmWidthBytes + j*4;
+ if (!pixel[3])
+ {
+ pixel[3] = (*(mbit + i*bmpMask.bmWidthBytes + j*bmpMask.bmBitsPixel/8) & (1<<(7-j%8))) ? 0 : 255;
+ }
+
+ if (pixel[3] != 255)
+ {
+ pixel[0] = PU_DIV255(pixel[0] * pixel[3]);
+ pixel[1] = PU_DIV255(pixel[1] * pixel[3]);
+ pixel[2] = PU_DIV255(pixel[2] * pixel[3]);
+ }
+ }
+ }
+
+ this->BlendBits((COLOR32 *)cbit, bmpColor.bmWidth, bmpColor.bmHeight, x, y, w, h);
+
+ delete [] mbit;
+ delete [] cbit;
+ } else
+ {
+ this->saveAlpha(x,y,w,h);
+ DrawIconEx(this->getDC(), x, y, hic, w, h, 0, NULL, DI_NORMAL);
+ this->restoreAlpha(x,y,w,h);
+ }
+
+ DeleteObject(info.hbmColor);
+ DeleteObject(info.hbmMask);
+}
+
+void MyBitmap::Draw_TextA(char *str, int x, int y)
+{
+ GdiFlush();
+
+ SIZE sz; GetTextExtentPoint32A(this->getDC(), str, lstrlenA(str), &sz);
+ RECT rc; SetRect(&rc, x, y, x+10000, y+10000);
+ this->saveAlpha(x-2,y-2,sz.cx+2,sz.cy+2);
+ ::DrawTextA(this->getDC(), str, (int)strlen(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
+ this->restoreAlpha(x-2,y-2,sz.cx+2,sz.cy+2);
+ //(x,y,sz.cx,sz.cy);
+}
+
+void MyBitmap::Draw_TextW(WCHAR *str, int x, int y)
+{
+#if defined(_UNICODE)
+ SIZE sz; GetTextExtentPoint32W(this->getDC(), str, lstrlenW(str), &sz);
+ RECT rc; SetRect(&rc, x, y, x+10000, y+10000);
+ this->saveAlpha(x,y,sz.cx,sz.cy);
+ DrawTextW(this->getDC(), str, lstrlenW(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
+ this->restoreAlpha(x,y,sz.cx,sz.cy);
+#else
+ if (MyGetTextExtentPoint32W && MyDrawTextW)
+ {
+ SIZE sz; MyGetTextExtentPoint32W(this->getDC(), str, lstrlenW(str), &sz);
+ RECT rc; SetRect(&rc, x, y, x+10000, y+10000);
+ this->saveAlpha(x,y,sz.cx,sz.cy);
+ MyDrawTextW(this->getDC(), str, lstrlenW(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
+ this->restoreAlpha(x,y,sz.cx,sz.cy);
+ }
+#endif
+}
+
+// based on code by Yuriy Zaporozhets from:
+// http://www.codeproject.com/gdi/coolrgn.asp?df=100&forumid=739&exp=0&select=6341
+// slightly modified to integrate with MyBitmap class.
+HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque)
+{
+ GdiFlush();
+
+ const int addRectsCount = 64;
+ int rectsCount = addRectsCount;
+ PRGNDATA pRgnData = (PRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRECT pRects = (LPRECT)(&pRgnData->Buffer);
+
+ memset(pRgnData, 0, sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT));
+ pRgnData->rdh.dwSize = sizeof(RGNDATAHEADER);
+ pRgnData->rdh.iType = RDH_RECTANGLES;
+
+ int first = 0;
+ bool wasfirst = false;
+ bool ismask = false;
+ for (int i = 0; i < height; i++)
+ {
+ int j; // we will need j after the loop!
+ for (j = 0; j < width; j++)
+ {
+ ismask = opaque ? geta(this->getRow(i)[j]) > (DWORD)level : geta(this->getRow(i)[j]) < (DWORD)level;
+ if (wasfirst)
+ {
+ if (!ismask)
+ {
+ SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i+1);
+ if (pRgnData->rdh.nCount >= (DWORD) rectsCount)
+ {
+ rectsCount += addRectsCount;
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
+ delete pRgnData;
+ pRgnData = pRgnDataNew;
+ pRects = (LPRECT)(&pRgnData->Buffer);
+ }
+ wasfirst = false;
+ }
+ } else
+ if (ismask) // set wasfirst when mask is found
+ {
+ first = j;
+ wasfirst = true;
+ }
+ }
+
+ if (wasfirst && ismask)
+ {
+ SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i+1);
+ if (pRgnData->rdh.nCount >= (DWORD) rectsCount)
+ {
+ rectsCount += addRectsCount;
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
+ delete pRgnData;
+ pRgnData = pRgnDataNew;
+ pRects = (LPRECT)(&pRgnData->Buffer);
+ }
+ wasfirst = false;
+ }
+
+ }
+
+ HRGN hRgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData);
+ delete pRgnData;
+ return hRgn;
+}
+
+static int hex2dec(char hex)
+{
+ if ((hex >= '0') && (hex <= '9'))
+ return hex - '0';
+ if ((hex >= 'a') && (hex <= 'f'))
+ return hex - 'a' + 0xa;
+ if ((hex >= 'A') && (hex <= 'F'))
+ return hex - 'A' + 0xa;
+ return 0;
+}
+
+bool MyBitmap::loadFromFile_pixel(const char *fn, const char *fnAlpha)
+{
+ allocate(1,1);
+ int r, g, b, a=255;
+ const char *p = fn + lstrlenA("pixel:");
+ r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
+ g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
+ b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
+ *bits = rgba(r,g,b,a);
+ return true;
+}
+
+bool MyBitmap::loadFromFile_gradient(const char *fn, const char *fnAlpha)
+{
+ const char *p = fn + lstrlenA("gradient:");
+
+ if (*p == 'h') allocate(256,1);
+ else allocate(1,256);
+
+ int r, g, b, a=255;
+
+ p += 2;
+ r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
+ g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
+ b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
+ COLOR32 from = rgba(r,g,b,a);
+
+ p += 7;
+ r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
+ g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
+ b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
+ COLOR32 to = rgba(r,g,b,a);
+
+ for (int i = 0; i < 256; ++i)
+ {
+ bits[i] = rgba(
+ ((255-i) * getr(from) + i * getr(to)) / 255,
+ ((255-i) * getg(from) + i * getg(to)) / 255,
+ ((255-i) * getb(from) + i * getb(to)) / 255,
+ 255
+ );
+ }
+
+ return true;
+}
+
+bool MyBitmap::loadFromFile_png(const char *fn, const char *fnAlpha)
+{
+ if (ServiceExists(MS_PNG2DIB))
+ {
+ HANDLE hFile, hMap = 0;
+ BYTE *ppMap = 0;
+ long cbFileSize = 0;
+ BITMAPINFOHEADER *pDib;
+ BYTE *pDibBits;
+ if ((hFile = CreateFileA(fn, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE)
+ if ((hMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
+ if ((ppMap = (BYTE*)MapViewOfFile( hMap, FILE_MAP_READ, 0, 0, 0 )) != NULL)
+ cbFileSize = GetFileSize(hFile, NULL);
+ if (cbFileSize)
+ {
+ PNG2DIB param;
+ param.pSource = ppMap;
+ param.cbSourceSize = cbFileSize;
+ param.pResult = &pDib;
+ if (CallService(MS_PNG2DIB, 0, (LPARAM)¶m))
+ pDibBits = (BYTE*)(pDib+1);
+ else
+ cbFileSize = 0;
+ }
+
+ if (ppMap) UnmapViewOfFile(ppMap);
+ if (hMap) CloseHandle(hMap);
+ if (hFile) CloseHandle(hFile);
+
+ if (!cbFileSize) return false;
+
+ BITMAPINFO *bi=(BITMAPINFO*)pDib;
+ BYTE *pt=(BYTE*)bi;
+ pt+=bi->bmiHeader.biSize;
+
+ if (bi->bmiHeader.biBitCount != 32)
+ {
+ allocate(abs(bi->bmiHeader.biWidth), abs(bi->bmiHeader.biHeight));
+ HDC hdcTmp = CreateCompatibleDC(getDC());
+ HBITMAP hBitmap = CreateDIBitmap(getDC(), pDib, CBM_INIT, pDibBits, bi, DIB_PAL_COLORS);
+ SelectObject(hdcTmp, hBitmap);
+ BitBlt(this->getDC(), 0, 0, abs(bi->bmiHeader.biWidth), abs(bi->bmiHeader.biHeight), hdcTmp, 0, 0, SRCCOPY);
+ this->makeOpaque();
+ DeleteDC(hdcTmp);
+ DeleteObject(hBitmap);
+ } else
+ {
+ allocate(abs(bi->bmiHeader.biWidth), abs(bi->bmiHeader.biHeight));
+ BYTE *p2=(BYTE *)pt;
+ for (int y=0; y<bi->bmiHeader.biHeight; ++y)
+ {
+ BYTE *p1=(BYTE *)bits + (bi->bmiHeader.biHeight-y-1)*bi->bmiHeader.biWidth*4;
+ for (int x=0; x<bi->bmiHeader.biWidth; ++x)
+ {
+ p1[0]= p2[0];
+ p1[1]= p2[1];
+ p1[2]= p2[2];
+ p1[3]= p2[3];
+ p1 += 4;
+ p2 += 4;
+ }
+ }
+// memcpy(bits, pt, bi->bmiHeader.biSizeImage);
+ premultipleChannels();
+ }
+
+ GlobalFree(pDib);
+ return true;
+ } else
+ {
+// MSGERROR(TranslateT("You need the png2dib plugin v. 0.1.3.x or later to process PNG images");
+ return false;
+ }
+}
+
+bool MyBitmap::loadFromFile_default(const char *fn, const char *fnAlpha)
+{
+ SIZE sz;
+ HBITMAP hBmpLoaded = (HBITMAP)LoadImageA(NULL, fn, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+ if (!hBmpLoaded)
+ return false;
+
+ BITMAP bm; GetObject(hBmpLoaded, sizeof(bm), &bm);
+ SetBitmapDimensionEx(hBmpLoaded, bm.bmWidth, bm.bmHeight, NULL);
+
+ HDC dcTmp = CreateCompatibleDC(0);
+ GetBitmapDimensionEx(hBmpLoaded, &sz);
+ HBITMAP hBmpDcSave = (HBITMAP)SelectObject(dcTmp, hBmpLoaded);
+
+ allocate(sz.cx, sz.cy);
+ BitBlt(dcBmp, 0, 0, width, height, dcTmp, 0, 0, SRCCOPY);
+
+ DeleteObject(SelectObject(dcTmp, hBmpDcSave));
+ DeleteDC(dcTmp);
+
+ MyBitmap alpha;
+ if (fnAlpha && alpha.loadFromFile(fnAlpha) &&
+ (alpha.getWidth() == width) &&
+ (alpha.getHeight() == height) )
+ {
+ for (int i = 0; i < width*height; i++)
+ bits[i] = (bits[i] & 0x00ffffff) | ( (alpha.bits[i] & 0x000000ff) << 24 );
+ premultipleChannels();
+ } else
+ {
+ makeOpaque();
+ }
+ return true;
+}
+
+bool MyBitmap::loadFromFile(const char *fn, const char *fnAlpha)
+{
+ if (bits) free();
+
+ if (!strncmp(fn, "pixel:", lstrlenA("pixel:")))
+ {
+ return loadFromFile_pixel(fn, fnAlpha);
+ } else
+ if (!strncmp(fn, "gradient:", lstrlenA("gradient:")))
+ {
+ return loadFromFile_gradient(fn, fnAlpha);
+ } else
+ {
+ char ext[5];
+ memcpy(ext,fn+(strlen(fn)-4),5);
+ if (!lstrcmpiA(ext,".png"))
+ {
+ return loadFromFile_png(fn, fnAlpha);
+ } else
+ {
+ return loadFromFile_default(fn, fnAlpha);
+ }
+ }
+ // unreachable place
+ return false;
+}
+
+void MyBitmap::allocate(int w, int h)
+{
+ width = w;
+ height = h;
+
+ BITMAPINFO bi;
+
+ bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
+ bi.bmiHeader.biWidth = w;
+ bi.bmiHeader.biHeight = -h;
+ bi.bmiHeader.biPlanes = 1;
+ bi.bmiHeader.biBitCount = 32;
+ bi.bmiHeader.biCompression = BI_RGB;
+
+ if (dcBmp)
+ {
+ DeleteObject(SelectObject(dcBmp, hBmpSave));
+ DeleteDC(dcBmp);
+ }
+
+ hBmp = (HBITMAP)CreateDIBSection(0, &bi, DIB_RGB_COLORS, (void **)&bits, 0, 0);
+ dcBmp = CreateCompatibleDC(0);
+ hBmpSave = (HBITMAP)SelectObject(dcBmp, hBmp);
+
+ GdiFlush();
+}
+
+void MyBitmap::free()
+{
+ GdiFlush();
+
+ DeleteObject(SelectObject(dcBmp, hBmpSave));
+ DeleteDC(dcBmp);
+
+ dcBmp = 0;
+ hBmp = 0;
+ bits = 0;
+ width = height = 0;
+}
+
+void MyBitmap::premultipleChannels()
+{
+ GdiFlush();
+
+ for (int i = 0; i < width*height; i++)
+ bits[i] = rgba(getr(bits[i])*geta(bits[i])/255, getg(bits[i])*geta(bits[i])/255, getb(bits[i])*geta(bits[i])/255, geta(bits[i]));
+}
diff --git a/plugins/Popup/src/bitmap_funcs.h b/plugins/Popup/src/bitmap_funcs.h new file mode 100644 index 0000000000..8a66c30f85 --- /dev/null +++ b/plugins/Popup/src/bitmap_funcs.h @@ -0,0 +1,132 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/bitmap_funcs.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __bitmap_funcs_h__
+#define __bitmap_funcs_h__
+
+// This should make bitmap manipulations much easier...
+class MyBitmap
+{
+public:
+ typedef unsigned long COLOR32;
+ static inline COLOR32 RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0xff)
+ {
+ return (a << 24) | (r << 16) | (g << 8) | b;
+ };
+
+private:
+ HBITMAP hBmpSave, hBmp;
+ HDC dcBmp;
+ COLOR32 *bits;
+ COLOR32 *bitsSave;
+ int width, height;
+
+ void free();
+
+ bool loadFromFile_pixel(const char *fn, const char *fnAlpha = 0);
+ bool loadFromFile_gradient(const char *fn, const char *fnAlpha = 0);
+ bool loadFromFile_png(const char *fn, const char *fnAlpha = 0);
+ bool loadFromFile_default(const char *fn, const char *fnAlpha = 0);
+ void premultipleChannels();
+
+public:
+ MyBitmap();
+ MyBitmap(int w, int h);
+ MyBitmap(const char *fn, const char *fnAlpha = 0);
+ ~MyBitmap();
+ void allocate(int w, int h);
+
+ bool loadFromFile(const char *fn, const char *fnAlpha = 0);
+
+ int getWidth() { return width; }
+ int getHeight() { return height; }
+
+ HDC getDC() { return dcBmp; }
+ HBITMAP getBitmap() { return hBmp; }
+
+ void makeOpaque();
+ void makeOpaqueRect(int x1, int y1, int x2, int y2);
+ void makeOpaqueRect(RECT rc) { makeOpaqueRect(rc.left, rc.top, rc.right, rc.bottom); }
+
+ void saveAlpha(int x = 0, int y = 0, int w = 0, int h = 0);
+ void restoreAlpha(int x = 0, int y = 0, int w = 0, int h = 0);
+
+ void DrawBits(COLOR32 *inbits, int inw, int inh, int x, int y, int w, int h);
+ void BlendBits(COLOR32 *inbits, int inw, int inh, int x, int y, int w, int h);
+
+ void DrawNoAlpha(MyBitmap *bmp, int x, int y, int w, int h);
+
+ void Blend(MyBitmap *bmp, int x, int y, int w, int h);
+ void Draw(MyBitmap *bmp, int x, int y, int w, int h);
+
+ void BlendColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color);
+ void DrawColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color);
+
+ void BlendPart(MyBitmap *bmp, int xin, int yin, int win, int hin, int x, int y, int w, int h);
+ void BlendPartColorized(MyBitmap *bmp, int xin, int yin, int win, int hin, int x, int y, int w, int h, COLOR32 color);
+ void DrawPart(MyBitmap *bmp, int xin, int yin, int win, int hin, int x, int y, int w, int h);
+// void DrawPartNoAlpha(MyBitmap *bmp, int x, int y, int w, int h);
+// void DrawPartColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color);
+
+ void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
+ void Draw_TextA(char *str, int x, int y);
+ void Draw_TextW(WCHAR *str, int x, int y);
+
+ __forceinline COLOR32 *getBits() { return bits; }
+ __forceinline COLOR32 *getRow(int row) { return bits + row * width; }
+ __forceinline COLOR32 *operator[] (int row) { return bits + row * width; }
+
+ static __forceinline COLOR32 rgba(COLOR32 r, COLOR32 g, COLOR32 b, COLOR32 a)
+ {
+ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);
+ }
+ static __forceinline COLOR32 getr(COLOR32 c)
+ {
+ return (c >> 16) & 0xff;
+ }
+ static __forceinline COLOR32 getg(COLOR32 c)
+ {
+ return (c >> 8) & 0xff;
+ }
+ static __forceinline COLOR32 getb(COLOR32 c)
+ {
+ return c & 0xff;
+ }
+ static __forceinline COLOR32 geta(COLOR32 c)
+ {
+ return (c >> 24) & 0xff;
+ }
+
+ HRGN buildOpaqueRgn(int level = 64, bool opaque = true);
+};
+
+#endif // __bitmap_funcs_h__
\ No newline at end of file diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h new file mode 100644 index 0000000000..d975e0df0c --- /dev/null +++ b/plugins/Popup/src/common.h @@ -0,0 +1,296 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/common.h $
+Revision : $Revision: 1622 $
+Last change on : $Date: 2010-06-23 23:32:21 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef COMMON_H
+#define COMMON_H
+
+void PopUpPreview();
+
+#define MAX_POPUPS 48
+
+#define DB_READ_SUCCESS 0
+#define DB_READ_FAIL -1
+
+//===== Definitions =====
+#define LIGHTEN 24
+#define DARKEN 64
+
+inline void GetBmpSize(HBITMAP hbm, SIZE *sz)
+{
+ GetBitmapDimensionEx(hbm, sz);
+}
+
+inline void DebugMsg(LPTSTR msg){
+ if(PopUpOptions.debug){
+ MessageBox(NULL, msg, _T("debug"), MB_OK);
+ }
+}
+
+/* not used
+inline void GetDCBmpSize(HDC hdc, SIZE *sz)
+{
+ BITMAP bmp;
+ GetObject(GetCurrentObject(hdc, OBJ_BITMAP), sizeof(bmp), &bmp);
+ sz->cx = bmp.bmWidth;
+ sz->cy = bmp.bmHeight;
+}
+
+inline HBITMAP myLoadBitmap(LPCTSTR fn)
+{
+ HBITMAP res = (HBITMAP)LoadImage(NULL, fn, IMAGE_BITMAP, LR_DEFAULTSIZE, LR_DEFAULTSIZE, LR_LOADFROMFILE);
+
+ BITMAPFILEHEADER bfh;
+ BITMAPINFOHEADER bih;
+ FILE *f = _tfopen (fn, _T("rb"));
+ fread(&bfh, sizeof(bfh), 1, f);
+ fread(&bih, sizeof(bih), 1, f);
+ fclose(f);
+ SetBitmapDimensionEx(res, bih.biWidth, bih.biHeight, NULL);
+
+ return res;
+}
+*/
+
+//===== Percentile to Byte and viceversa =====
+inline int Byte2Percentile(int vByte) { return (vByte*100)/255; }
+inline int Percentile2Byte(int vPerc) { return (vPerc*255)/100; }
+
+//===== Strings & MirandaDB ==================
+inline char *DBGetContactSettingString(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default)
+{
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING dbcgs;
+ dbcgs.szModule = ModuleName;
+ dbcgs.pValue = &dbv;
+ dbcgs.szSetting = SettingName;
+
+ CallService(MS_DB_CONTACT_GETSETTING, (WPARAM)hContact, (LPARAM)&dbcgs);
+
+ char *result = 0;
+ if (dbv.type == DBVT_ASCIIZ)
+ {
+ result = mir_strdup(dbv.pszVal);
+ }
+ else if (Default)
+ {
+ result = mir_strdup(Default);
+ }
+
+ CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)&dbv);
+ return result;
+}
+
+inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default, const int retType)
+{
+ INT_PTR ret = NULL;
+ BOOL result = 0;
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING dbcgs;
+ dbcgs.szModule = ModuleName;
+ dbcgs.szSetting = SettingName;
+ dbcgs.pValue = &dbv;
+ dbv.type=(BYTE)retType;
+
+ result = CallService(MS_DB_CONTACT_GETSETTING_STR, (WPARAM)hContact, (LPARAM)&dbcgs);
+
+ switch(retType) {
+ case DBVT_ASCIIZ:
+ ret = (INT_PTR)mir_strdup(result ? Default : dbv.pszVal);
+ break;
+ case DBVT_WCHAR:
+ if(!result) {
+ ret = (INT_PTR)mir_wstrdup(dbv.pwszVal);
+ }
+ else {
+ ret = (INT_PTR)mir_a2u(Default);
+ }
+ break;
+ default:
+ break;
+ }
+ if(!result)
+ CallService(MS_DB_CONTACT_FREEVARIANT, 0, (LPARAM)&dbv);
+ return ret;
+}
+
+/* not used
+#if !defined(_UNICODE)
+inline void SetWindowTextTraslated(HWND hwnd, const char *text)
+{
+ if (!(hwnd && text)) return;
+ if (g_popup.isOsUnicode && IsWindowUnicode(hwnd) && MySetWindowTextW)
+ {
+ UINT codepage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+ int size = MultiByteToWideChar(codepage, 0, text, lstrlenA(text), 0, 0);
+ WCHAR *wtext = new WCHAR[size+1];
+ MultiByteToWideChar(codepage, 0, text, lstrlenA(text), wtext, size+1); wtext[size]=0;
+ MySetWindowTextW(hwnd, TranslateW(wtext));
+ delete [] wtext;
+ } else
+ {
+ SetWindowTextA(hwnd, Translate(text));
+ }
+}
+#endif
+*/
+/*/dedrecatet (tricky thing to minimize memory fragmentation)
+inline wchar_t* a2u( char* src )
+{
+ int codepage = CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 );
+
+ int cbLen = MultiByteToWideChar( codepage, 0, src, -1, NULL, 0 );
+ wchar_t* result = ( wchar_t* )mir_alloc( sizeof( wchar_t )*(cbLen+1));
+ if ( result == NULL )
+ return NULL;
+
+ MultiByteToWideChar( codepage, 0, src, -1, result, cbLen );
+ result[ cbLen ] = 0;
+ return result;
+}
+
+#define nb_a2u_init() \
+ int nb_a2u_codepage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); \
+ int nb_a2u_len = 0; \
+
+#define nb_a2u(dst, src) \
+ bool dst##_free = false; \
+ WCHAR *dst = NULL; \
+ nb_a2u_len = MultiByteToWideChar(nb_a2u_codepage, 0, src, -1, NULL, 0); \
+ __try \
+ { \
+ dst = (WCHAR *)_alloca(sizeof(WCHAR)*(nb_a2u_len+1)); \
+ } \
+ __except( EXCEPTION_EXECUTE_HANDLER ) \
+ { \
+ dst = (WCHAR *)mir_alloc(sizeof(WCHAR)*(nb_a2u_len+1)); \
+ dst##_free = true; \
+ } \
+ MultiByteToWideChar(nb_a2u_codepage, 0, src, -1, dst, nb_a2u_len); \
+ dst[nb_a2u_len] = 0;
+
+#define nb_a2u_free(dst) \
+ if (dst##_free) \
+ mir_free(dst);
+*/
+
+inline void AddTooltipTranslated(HWND hwndToolTip, HWND hwnd, int id, RECT rc, char *text)
+{
+#if defined(_UNICODE)
+ TOOLINFO ti = {0};
+ ti.cbSize = sizeof(TOOLINFO);
+
+ ti.hwnd = hwnd;
+ ti.uId = id;
+ SendMessage(hwndToolTip, TTM_DELTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
+
+ LPWSTR wtext = mir_a2u(text);
+
+ ti.uFlags = TTF_SUBCLASS;
+ ti.hwnd = hwnd;
+ ti.uId = id;
+ ti.hinst = hInst;
+ ti.lpszText = TranslateW(wtext);
+ ti.rect = rc;
+ SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
+
+ mir_free(wtext);
+
+#else
+ if (g_popup.isOsUnicode && MySendMessageW)
+ {
+ TOOLINFOW ti = {0};
+ ti.cbSize = sizeof(TOOLINFO);
+
+ ti.hwnd = hwnd;
+ ti.uId = id;
+ MySendMessageW(hwndToolTip, TTM_DELTOOLW, 0, (LPARAM) (LPTOOLINFOW) &ti);
+
+ LPWSTR wtext = mir_a2u(text);
+
+ ti.uFlags = TTF_SUBCLASS;
+ ti.hwnd = hwnd;
+ ti.uId = id;
+ ti.hinst = hInst;
+ ti.lpszText = TranslateW(wtext);
+ ti.rect = rc;
+ MySendMessageW(hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM) (LPTOOLINFOW) &ti);
+
+ mir_free(wtext);
+ } else
+ {
+ TOOLINFOA ti = {0};
+ ti.cbSize = sizeof(TOOLINFO);
+
+ ti.hwnd = hwnd;
+ ti.uId = id;
+ SendMessage(hwndToolTip, TTM_DELTOOLA, 0, (LPARAM) (LPTOOLINFOA) &ti);
+
+ ti.uFlags = TTF_SUBCLASS;
+ ti.hwnd = hwnd;
+ ti.uId = id;
+ ti.hinst = hInst;
+ ti.lpszText = Translate(text);
+ ti.rect = rc;
+ SendMessage(hwndToolTip, TTM_ADDTOOLA, 0, (LPARAM) (LPTOOLINFOA) &ti);
+ }
+#endif
+}
+
+/* not used
+inline UINT getCodepageFromCharset(BYTE charset)
+{
+ switch (charset)
+ {
+ case ANSI_CHARSET: return 1252;
+ case BALTIC_CHARSET: return 1257;
+ case CHINESEBIG5_CHARSET: return 950;
+ case DEFAULT_CHARSET: return CP_ACP;
+ case EASTEUROPE_CHARSET: return 1250;
+ case GB2312_CHARSET: return 936;
+ case GREEK_CHARSET: return 1253;
+ case HANGUL_CHARSET: return 949;
+ case MAC_CHARSET: return CP_MACCP;
+ case OEM_CHARSET: return CP_OEMCP;
+ case RUSSIAN_CHARSET: return 1251;
+ case SHIFTJIS_CHARSET: return 932;
+// case SYMBOL_CHARSET: return ;
+ case TURKISH_CHARSET: return 1254;
+ case VIETNAMESE_CHARSET: return 1258;
+ case JOHAB_CHARSET: return 1361;
+ case ARABIC_CHARSET: return 1256;
+ case HEBREW_CHARSET: return 1255;
+ default: return CP_ACP;
+ }
+}
+*/
+
+#endif //COMMON_H
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp new file mode 100644 index 0000000000..5831de512e --- /dev/null +++ b/plugins/Popup/src/config.cpp @@ -0,0 +1,210 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/config.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+//===== General Plugin =====
+HINSTANCE hInst;
+HANDLE hMainThread;
+//MNOTIFYLINK *notifyLink; //deprecatet
+PLUGINLINK *pluginLink;
+HANDLE hSemaphore;
+BOOL closing = FALSE;
+MM_INTERFACE mmi;
+LIST_INTERFACE li;
+UTF8_INTERFACE utfi;
+MTEXT_INTERFACE MText = {0};
+HANDLE folderId;
+BOOL gbPopupLoaded = FALSE;
+BOOL gbHppInstalled = FALSE;
+LPCSTR gszMetaProto = "";
+
+//===== Brushes, Colours and Fonts =====
+HBITMAP hbmNoAvatar;
+
+//===== Options =====
+POPUPOPTIONS PopUpOptions;
+//SKINELEMENT *skin;
+//SKINELEMENT *w_skin;
+//SKINELEMENT *n_skin;
+
+
+//===== Plugin information =====
+
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
+ POPUP_DISPLAYNAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM),
+ POPUP_DESCRIPTION,
+ POPUP_AUTHOR,
+ POPUP_EMAIL,
+ POPUP_COPYRIGHT,
+ POPUP_WEBPAGE,
+ 0,
+ 0,
+ POPUP_UUID
+};
+
+// MLU layer for ansi release
+#if !defined(_UNICODE)
+BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
+BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags);
+BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR hMonitor, LPMONITORINFO lpmi);
+BOOL (WINAPI *MyUpdateLayeredWindow)
+ (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
+ COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
+HMONITOR (WINAPI *MyMonitorFromWindow)(HWND hWnd, DWORD dwFlags);
+BOOL (WINAPI *MyTransparentBlt)(HDC, int, int, int, int, HDC, int, int, int, int, UINT);
+BOOL (WINAPI *MyAlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
+
+// gdi32.dll
+BOOL (WINAPI *MyGetTextExtentPoint32W)(HDC, LPCWSTR, int, LPSIZE);
+
+//user32.dll
+int (WINAPI *MyDrawTextW)(HDC, LPCWSTR, int, LPRECT, UINT);
+int (WINAPI *MyDrawTextExW)(HDC, LPCWSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS);
+BOOL (WINAPI *MySetWindowTextW)(HWND, LPCWSTR);
+LRESULT (WINAPI *MySendMessageW)(HWND, UINT, WPARAM, LPARAM);
+LRESULT (WINAPI *MyCallWindowProcW)(WNDPROC, HWND, UINT, WPARAM, LPARAM);
+HWND (WINAPI *MyCreateWindowExW)(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
+
+#endif
+
+HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
+
+//====== Common Vars ========================
+
+// common funcs
+void LoadOptions() {
+ ZeroMemory(&PopUpOptions, sizeof(PopUpOptions));
+ #if defined(_DEBUG)
+ PopUpOptions.debug = DBGetContactSettingByte(NULL, MODULNAME, "debug", FALSE);
+ #endif
+
+ //Load PopUp Options
+ if(!OptionLoaded){
+ LoadOption_General();
+ LoadOption_Skins();
+ LoadOption_Actions();
+ LoadOption_AdvOpts();
+ }
+ Check_ReorderPopUps();
+ OptionLoaded = true;
+ return;
+}
+
+void PopUpPreview()
+{
+ TCHAR *lptzTitle1Eng = TranslateT("The Jabberwocky");
+ TCHAR *lptzText1Eng = TranslateTS(
+ _T("`Twas brillig, and the slithy toves\r\n")
+ _T("Did gyre and gimble in the wabe:\r\n")
+ _T("All mimsy were the borogoves,\r\n")
+ _T("And the mome raths outgrabe.\r\n")
+ _T("\t[b][i]Lewis Carroll, 1855[/i][/b]")
+ );
+
+ TCHAR *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line...");
+ TCHAR *lptzText2 = TranslateTS(
+ _T("This is a special test preview for the popup ")
+ _T("plugin settings. The text and title are quite ")
+ _T("long so you can tweak your skin and plugin ")
+ _T("settings to best fit your needs :)")
+ );
+
+ POPUPDATA2 ppd = {0};
+
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.cbSize = sizeof(ppd);
+ ppd.flags = PU2_TCHAR;
+
+#if defined(_DEBUG)
+ // test per-contact popups
+ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ {
+ if (DBGetContactSettingDword(hContact, "ICQ", "UIN", 0) == 256771455)
+ {
+ ppd.lchContact = hContact;
+ break;
+ }
+ }
+#endif
+ ppd.lptzTitle = lptzTitle1Eng;
+ ppd.lptzText = lptzText1Eng;
+ ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
+ CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
+ if (PopUpOptions.UseAnimations || PopUpOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.cbSize = sizeof(ppd);
+ ppd.flags = PU2_TCHAR;
+ ppd.lptzTitle = lptzTitle2;
+ ppd.lptzText = lptzText2;
+ ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ ppd.hbmAvatar = hbmNoAvatar;
+#if defined(_DEBUG)
+//remove testactions
+ POPUPACTION actions[3];
+ actions[0].cbSize = sizeof(POPUPACTION);
+ actions[0].flags = PAF_ENABLED;
+ lstrcpyA(actions[0].lpzTitle, "Popup Plus/Test action");
+ actions[0].lchIcon = IcoLib_GetIcon(ICO_POPUP_ON,0);
+ actions[0].wParam = actions[0].lParam = -1;
+
+ actions[1].cbSize = sizeof(POPUPACTION);
+ actions[1].flags = PAF_ENABLED;
+ lstrcpyA(actions[1].lpzTitle, "Popup Plus/Second test action");
+ actions[1].lchIcon = IcoLib_GetIcon(ICO_ACT_CLOSE,0);
+ actions[1].wParam = actions[1].lParam = -1;
+
+ actions[2].cbSize = sizeof(POPUPACTION);
+ actions[2].flags = PAF_ENABLED;
+ lstrcpyA(actions[2].lpzTitle, "Popup Plus/One more action");
+ actions[2].lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ actions[2].wParam = actions[2].lParam = -1;
+
+ ppd.lpActions = actions;
+ ppd.actionCount = SIZEOF(actions);
+#endif
+ CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
+ if (PopUpOptions.UseAnimations || PopUpOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+
+ PUShowMessageT(TranslateT("This is a notification message"), (DWORD)SM_NOTIFY|0x80000000);
+ if (PopUpOptions.UseAnimations || PopUpOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+
+ PUShowMessageT(TranslateT("This is a warning message"), (DWORD)SM_WARNING|0x80000000);
+ if (PopUpOptions.UseAnimations || PopUpOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+
+ PUShowMessageT(TranslateT("This is an error message"), (DWORD)SM_ERROR|0x80000000);
+}
\ No newline at end of file diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h new file mode 100644 index 0000000000..6b293ba10d --- /dev/null +++ b/plugins/Popup/src/config.h @@ -0,0 +1,249 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/config.h $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __config_h__
+#define __config_h__
+
+typedef struct tagPOPUPOPTIONS {
+//==Page General====
+ //Timeout
+ BYTE InfiniteDelay;
+ int Seconds;
+ BYTE LeaveHovered;
+ //Size&Position
+ BYTE DynamicResize;
+ BYTE UseMinimumWidth;
+ WORD MinimumWidth;
+ BYTE UseMaximumWidth;
+ WORD MaximumWidth;
+ int Position;
+ int Spreading;
+ //position Popup
+ int gapTop;
+ int gapBottom;
+ int gapLeft;
+ int gapRight;
+ int spacing;
+ //Miscellaneous
+ BYTE ReorderPopUps;
+ BYTE ReorderPopUpsWarning;
+ //Disable when
+ BOOL ModuleIsEnabled;
+ BYTE DisableWhenFullscreen;
+ //others
+ BYTE debug;
+//==Page Skins====
+ LPTSTR SkinPack;
+ BYTE DisplayTime;
+ BYTE DropShadow;
+ BYTE EnableFreeformShadows;
+ BYTE EnableAeroGlass;
+ BYTE UseWinColors;
+ BYTE UseMText;
+//==Page Actions====
+ DWORD actions;
+ //Mouse Override
+ int overrideLeft;
+ int overrideRight;
+ int overrideMiddle;
+//==Page Advanced====
+ //History
+ BYTE EnableHistory;
+ WORD HistorySize;
+ BYTE UseHppHistoryLog;
+ //Avatars
+ BYTE avatarBorders;
+ BYTE avatarPNGBorders;
+ BYTE avatarRadius;
+ WORD avatarSize;
+ BYTE EnableAvatarUpdates;
+ //Monitor
+ BYTE Monitor;
+ //Transparency
+ BYTE Enable9xTransparency;
+ BYTE UseTransparency;
+ BYTE Alpha;
+ BYTE OpaqueOnHover;
+ //Effect
+ BYTE UseAnimations;
+ BYTE UseEffect;
+ LPTSTR Effect;
+ DWORD FadeIn;
+ DWORD FadeOut;
+ //Others
+ WORD MaxPopups;
+} POPUPOPTIONS;
+
+struct GLOBAL{
+ bool isOsUnicode;
+ bool isMirUnicode;
+ int MirVer;
+};
+extern GLOBAL g_popup;
+
+//===== User wnd class =====
+struct GLOBAL_WND_CLASSES{
+ ATOM cPopupWnd2;
+ ATOM cPopupEditBox;
+ ATOM cPopupMenuHostWnd;
+ ATOM cPopupThreadManagerWnd;
+ ATOM cPopupPreviewBoxWndclass;
+ ATOM cPopupPlusDlgBox;
+};
+extern GLOBAL_WND_CLASSES g_wndClass;
+
+#define ACT_ENABLE 0x00000001
+#define ACT_LARGE 0x00000002
+#define ACT_TEXT 0x00000004
+#define ACT_RIGHTICONS 0x00000008
+#define ACT_LEFTICONS 0x00000010
+#define ACT_DEF_NOGLOBAL 0x00000020
+#define ACT_DEF_KEEPWND 0x00000040
+#define ACT_DEF_IMONLY 0x00000080
+
+#define ACT_DEF_MESSAGE 0x00010000
+#define ACT_DEF_DETAILS 0x00020000
+#define ACT_DEF_MENU 0x00040000
+#define ACT_DEF_ADD 0x00080000
+#define ACT_DEF_DISMISS 0x00100000
+#define ACT_DEF_PIN 0x00200000
+#define ACT_DEF_REPLY 0x00400000
+#define ACT_DEF_COPY 0x00800000
+
+void LoadOptions();
+
+//===== General Plugin =====
+extern HINSTANCE hInst;
+extern HANDLE hMainThread;
+//extern MNOTIFYLINK *notifyLink; //deprecatet
+extern PLUGINLINK *pluginLink;
+extern HANDLE hSemaphore;
+extern BOOL closing;
+extern HANDLE folderId;
+extern UTF8_INTERFACE utfi;
+
+extern MTEXT_INTERFACE MText;
+extern HANDLE htuText;
+extern HANDLE htuTitle;
+
+extern BOOL gbPopupLoaded;
+extern BOOL gbHppInstalled;
+extern LPCSTR gszMetaProto;
+
+
+//===== Brushes, Colours and Fonts =====
+extern HBITMAP hbmNoAvatar;
+
+//===== Options =====
+extern POPUPOPTIONS PopUpOptions;
+extern bool OptionLoaded;
+//extern SKINELEMENT *skin;
+//extern SKINELEMENT *w_skin;
+//extern SKINELEMENT *n_skin;
+
+//===== Plugin informations struct =====
+extern PLUGININFOEX pluginInfoEx;
+
+//===== Transparency & APIs which are not supported by every OS =====
+#ifndef DWLP_MSGRESULT
+#define DWLP_MSGRESULT 0
+#endif
+#ifndef WS_EX_LAYERED
+#define WS_EX_LAYERED 0x00080000
+#endif
+#ifndef LWA_COLORKEY
+#define LWA_COLORKEY 0x00000001
+#endif
+#ifndef LWA_ALPHA
+#define LWA_ALPHA 0x00000002
+#endif
+#ifndef ULW_OPAQUE
+#define ULW_OPAQUE 0x00000004
+#endif
+#ifndef AC_SRC_ALPHA
+#define AC_SRC_ALPHA 0x01
+#endif
+#ifndef INVALID_FILE_ATTRIBUTES
+#define INVALID_FILE_ATTRIBUTES (DWORD (-1))
+#endif
+
+// MLU layer for ansi release
+#if !defined(_UNICODE)
+//===== DLLs =====
+extern HMODULE hUserDll;
+extern HMODULE hMsimgDll;
+extern HMODULE hKernelDll;
+extern HMODULE hGdiDll;
+extern HMODULE hDwmapiDll;
+
+extern BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
+extern BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags);
+extern BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR hMonitor, LPMONITORINFO lpmi);
+extern BOOL (WINAPI *MyUpdateLayeredWindow)
+ (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
+ COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
+extern HMONITOR (WINAPI* MyMonitorFromWindow)(HWND hWnd, DWORD dwFlags);
+extern BOOL (WINAPI *MyTransparentBlt)(HDC, int, int, int, int, HDC, int, int, int, int, UINT);
+extern BOOL (WINAPI *MyAlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
+
+extern BOOL (WINAPI *MyGetTextExtentPoint32W)(HDC, LPCWSTR, int, LPSIZE);
+extern int (WINAPI *MyDrawTextW)(HDC, LPCWSTR, int, LPRECT, UINT);
+extern int (WINAPI *MyDrawTextExW)(HDC, LPCWSTR, int, LPRECT, UINT, LPDRAWTEXTPARAMS);
+extern BOOL (WINAPI *MySetWindowTextW)(HWND, LPCWSTR);
+extern LRESULT (WINAPI *MySendMessageW)(HWND, UINT, WPARAM, LPARAM);
+extern LRESULT (WINAPI *MyCallWindowProcW)(WNDPROC, HWND, UINT, WPARAM, LPARAM);
+extern HWND (WINAPI *MyCreateWindowExW)(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
+
+#endif
+
+#define DWM_BB_ENABLE 0x00000001
+#define DWM_BB_BLURREGION 0x00000002
+#define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004
+struct DWM_BLURBEHIND
+{
+ DWORD dwFlags;
+ BOOL fEnable;
+ HRGN hRgnBlur;
+ BOOL fTransitionOnMaximized;
+};
+
+extern HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
+
+typedef struct TestStruct{
+ int cbSize;
+} TESTSIZE;
+
+// Generic Message Box for Errors
+#define MSGERROR(text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONERROR)
+#define MSGINFO (text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONINFORMATION)
+
+#endif // __config_h__
diff --git a/plugins/Popup/src/def_settings.h b/plugins/Popup/src/def_settings.h new file mode 100644 index 0000000000..9fa02ff13c --- /dev/null +++ b/plugins/Popup/src/def_settings.h @@ -0,0 +1,156 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+
+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 __def_settings_h__
+#define __def_settings_h__
+
+//===== Styles =====
+enum
+{
+ STYLE_FC_BEVELED,
+ STYLE_FC_FLAT,
+
+ //ranges:
+ STYLE_FC_MIN = STYLE_FC_BEVELED,
+ STYLE_FC_MAX = STYLE_FC_FLAT
+};
+
+//===== Sizes =====
+enum
+{
+ STYLE_SZ_GAP = 4,
+ STYLE_SZ_TEXTH = 14,
+ STYLE_SZ_NAMEH = 14,
+ STYLE_SZ_TIMEW = 35,
+ STYLE_SZ_TIMEH = 14,
+
+// STYLE_SZ_CLOCKH = 13,
+// STYLE_SZ_CLOCKW = 7,
+// STYLE_SZ_CLOCK = 2 + 3 + 4 * STYLE_SZ_CLOCKW + 2,
+
+ //Text and Name are style dependant.
+ STYLE_SZ_TEXTW_FLAT = 146,
+ STYLE_SZ_NAMEW_FLAT = 101,
+ STYLE_SZ_TEXTW_BEVELED = 125,
+ STYLE_SZ_NAMEW_BEVELED = 80,
+
+ // border size
+ STYLE_SZ_BORDER_BEVELED = 2,
+ STYLE_SZ_BORDER_FLAT = 2
+};
+
+//===== PopUp Positioning =====
+enum
+{
+ POS_UPPERLEFT,
+ POS_LOWERLEFT,
+ POS_LOWERRIGHT,
+ POS_UPPERRIGHT,
+ POS_CENTER,
+
+ //ranges
+ POS_MINVALUE = POS_UPPERLEFT,
+ POS_MAXVALUE = POS_CENTER
+};
+
+//===== Spreading =====
+enum
+{
+ SPREADING_HORIZONTAL,
+ SPREADING_VERTICAL,
+
+ SPREADING_MINVALUE = SPREADING_HORIZONTAL,
+ SPREADING_MAXVALUE = SPREADING_VERTICAL
+};
+
+//===== PopUp Options flags
+enum
+{
+ SPK_NONE,
+ SPK_SMILEYADD,
+ SPK_MSL,
+ SPK_XEP,
+ SPK_NCONVERS
+};
+enum
+{
+ TIMER_TIMETOLIVE = 26378, //My Birthday, send me something 8)
+ TIMER_TESTCHANGE = 60477, //You know who you are.
+
+ ANIM_TIME = 250,
+ FADE_TIME = (ANIM_TIME),
+ FADE_STEP = 10,
+
+ MN_MIRANDA = 0x01,
+ MN_ACTIVE = 0x02,
+
+ UM_SETDLGITEMINT = 5674
+};
+
+//Defaults:
+enum
+{
+ SETTING_BACKCOLOUR_DEFAULT = RGB(173,206,247),
+ SETTING_TEXTCOLOUR_DEFAULT = RGB(0,0,0),
+
+ SETTING_MONITOR_DEFAULT = MN_MIRANDA,
+ SETTING_USEMINIMUMWIDTH_DEFAULT = 1,
+ SETTING_USEMAXIMUMWIDTH_DEFAULT = 1,
+ SETTING_USINGTHREADS_DEFAULT = 1,
+ SETTING_MODULEISENABLED_DEFAULT = 1,
+ SETTING_MULTILINE_DEFAULT = 1,
+ SETTING_FADEINTIME_DEFAULT = (ANIM_TIME),
+ SETTING_FADEOUTTIME_DEFAULT = (ANIM_TIME),
+ SETTING_FADEOUTTIME_MIN = 0,
+ SETTING_FADEINTIME_MIN = 0,
+ SETTING_FADEOUTTIME_MAX = 10000,
+ SETTING_FADEINTIME_MAX = 10000,
+
+ SETTING_LIFETIME_MIN = 1,
+ SETTING_LIFETIME_MAX = 60,
+ SETTING_LIFETIME_DEFAULT = 4,
+ SETTING_LIFETIME_INFINITE = -1,
+
+ SETTING_ENLARGEMENT_MIN = 100,
+ SETTING_ENLARGEMENT_MAX = 200,
+ SETTING_ENLARGEMENT_DEFAULT = 120,
+
+ SETTING_HISTORYSIZE_MAX = 100,
+ SETTING_HISTORYSIZE_DEFAULT = 20,
+
+ SETTING_AVTSIZE_MIN = 16,
+ SETTING_AVTSIZE_MAX = 100,
+ SETTING_AVTSIZE_DEFAULT = 32,
+
+ SETTING_MINIMUMWIDTH_MIN = 80,
+ SETTING_MINIMUMWIDTH_MAX = 160,
+ SETTING_MINIMUMWIDTH_DEFAULT= 110,
+
+ SETTING_MAXIMUMWIDTH_MIN = 160,
+// SETTING_MAXIMUMWIDTH_MAX = 640,
+ SETTING_MAXIMUMWIDTH_DEFAULT= 310,
+
+ SETTING_SMILEPACKTYPE_DEFAULT = SPK_NONE
+};
+
+extern WORD SETTING_MAXIMUMWIDTH_MAX;
+
+#endif
diff --git a/plugins/Popup/src/defs.h b/plugins/Popup/src/defs.h new file mode 100644 index 0000000000..3ff8d09cdc --- /dev/null +++ b/plugins/Popup/src/defs.h @@ -0,0 +1,52 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/defs.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __defs_h__
+#define __defs_h__
+
+#ifdef __cplusplus
+ // in C++ files we should define everything inside extren "C"
+ #define EXTERNC extern "C"
+ #define BEGIN_EXTERNC extern "C" {
+ #define END_EXTERNC };
+
+ // in C++ all exported function must be extern "C"
+ #define MIRAPI extern "C" __declspec(dllexport)
+#else
+ #define EXTERNC
+ #define BEGIN_EXTERNC
+ #define END_EXTERNC
+
+ #define MIRAPI __declspec(dllexport)
+#endif
+
+#endif
\ No newline at end of file diff --git a/plugins/Popup/src/effects.cpp b/plugins/Popup/src/effects.cpp new file mode 100644 index 0000000000..64ac46b16f --- /dev/null +++ b/plugins/Popup/src/effects.cpp @@ -0,0 +1,94 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/effects.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+class MyTestEffect;
+HANDLE hSquareFad;
+
+class MyTestEffect: public IPopupPlusEffect
+{
+protected:
+ int w, h;
+ int alpha0, alpha1;
+ int frameCount;
+ int frame;
+
+ int stage;
+ int alpha;
+
+public:
+ virtual void beginEffect(int w, int h, int alpha0, int alpha1, int frameCount)
+ {
+ this->w = w;
+ this->h = h;
+ this->alpha0 = alpha0;
+ this->alpha1 = alpha1;
+ this->frameCount = frameCount;
+ }
+ virtual void beginFrame(int frame)
+ {
+ this->frame = frame;
+ stage = (frame*2 > frameCount) ? 1 : 0;
+ if (stage == 0)
+ {
+ alpha = alpha0 + (alpha1 - alpha0) * frame * 2 / frameCount;
+ } else
+ {
+ alpha = alpha0 + (alpha1 - alpha0) * (frame * 2 - frameCount) / frameCount;
+ }
+ }
+ virtual int getPixelAlpha(int x, int y)
+ {
+ if (stage == 0)
+ {
+ if ((x/16+y/16) % 2) return alpha0;
+ return alpha;
+ } else
+ {
+ if ((x/16+y/16) % 2) return alpha;
+ return alpha1;
+ }
+ }
+ virtual void endFrame() {}
+ virtual void endEffect() {}
+ virtual void destroy() { delete this; }
+};
+
+//template<class T> static int svcCreateEffect(WPARAM, LPARAM) { return (int)(new T); }
+static INT_PTR svcCreateEffect_MyTestEffect(WPARAM, LPARAM) { return (INT_PTR)(new MyTestEffect); }
+
+void PopupEfectsInitialize()
+{
+ hSquareFad = CreateServiceFunction(MS_POPUP_CREATEVFX "Square fading", svcCreateEffect_MyTestEffect);
+ CallService(MS_POPUP_REGISTERVFX, 0, (LPARAM)"Square fading");
+}
diff --git a/plugins/Popup/src/effects.h b/plugins/Popup/src/effects.h new file mode 100644 index 0000000000..6196719f3f --- /dev/null +++ b/plugins/Popup/src/effects.h @@ -0,0 +1,38 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/effects.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __effects_h__
+#define __effects_h__
+
+void PopupEfectsInitialize();
+
+#endif // __effects_h__
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp new file mode 100644 index 0000000000..d9502eadac --- /dev/null +++ b/plugins/Popup/src/font.cpp @@ -0,0 +1,154 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/font.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+PopupFonts fonts = {0};
+
+void InitFonts() {
+ // Fonts
+ FontIDT fid = {0};
+ fid.cbSize = sizeof(FontIDT);
+ lstrcpy(fid.group, _T(PU_FNT_AND_COLOR));
+ strcpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB);
+ fid.flags = FIDF_DEFAULTVALID;
+ fid.deffontsettings.charset = DEFAULT_CHARSET;
+ fid.deffontsettings.size = -11;
+ lstrcpy(fid.backgroundGroup,_T(PU_FNT_AND_COLOR));
+ lstrcpy(fid.backgroundName,_T(PU_COL_BACK_NAME));
+ lstrcpy(fid.deffontsettings.szFace, _T("Tahoma"));
+
+ lstrcpy(fid.name, _T(PU_FNT_NAME_TITLE));
+ mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
+ fid.deffontsettings.style = DBFONTF_BOLD;
+ fid.deffontsettings.colour = RGB(0,0,0);
+ FontRegisterT(&fid);
+
+ lstrcpy(fid.name, _T(PU_FNT_NAME_CLOCK));
+ mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
+ //fid.deffontsettings.style = DBFONTF_BOLD;
+ //fid.deffontsettings.colour = RGB(0,0,0);
+ FontRegisterT(&fid);
+
+ lstrcpy(fid.name, _T(PU_FNT_NAME_TEXT));
+ mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
+ fid.deffontsettings.style = 0;
+ //fid.deffontsettings.colour = RGB(0,0,0);
+ FontRegisterT(&fid);
+
+ lstrcpy(fid.name, _T("Action"));
+ mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, "Action");
+ //fid.deffontsettings.style = 0;
+ fid.deffontsettings.colour = RGB(0,0,255);
+ FontRegisterT(&fid);
+
+ lstrcpy(fid.name, _T("Hovered Action"));
+ mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, "Hovered Action");
+ fid.deffontsettings.style = DBFONTF_UNDERLINE;
+ //fid.deffontsettings.colour = RGB(0,0,255);
+ FontRegisterT(&fid);
+
+ ColourIDT cid = {0};
+ cid.cbSize = sizeof(ColourIDT);
+ lstrcpy(cid.group, _T(PU_FNT_AND_COLOR));
+ strcpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB);
+
+ lstrcpy(cid.name, _T(PU_COL_BACK_NAME));
+ strcpy(cid.setting, PU_COL_BACK_SETTING);
+ cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0);
+
+ lstrcpy(cid.name, _T(PU_COL_AVAT_NAME));
+ strcpy(cid.setting, PU_COL_AVAT_SETTING);
+ cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&cid, 0);
+
+ ReloadFonts();
+}
+
+
+void ReloadFonts()
+{
+ if (fonts.title) DeleteObject(fonts.title);
+ if (fonts.clock) DeleteObject(fonts.clock);
+ if (fonts.text) DeleteObject(fonts.text);
+ if (fonts.action) DeleteObject(fonts.action);
+ if (fonts.actionHover) DeleteObject(fonts.actionHover);
+
+ LOGFONT lf = {0};
+ FontIDT fid = {0};
+ fid.cbSize = sizeof(FontIDT);
+ lstrcpy(fid.group, _T(PU_FNT_AND_COLOR));
+
+ lstrcpy(fid.name, _T(PU_FNT_NAME_TITLE));
+ fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.title = CreateFontIndirect(&lf);
+
+ lstrcpy(fid.name, _T(PU_FNT_NAME_CLOCK));
+ fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.clock = CreateFontIndirect(&lf);
+
+ lstrcpy(fid.name, _T(PU_FNT_NAME_TEXT));
+ fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.text = CreateFontIndirect(&lf);
+
+ lstrcpy(fid.name, _T("Action"));
+ fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.action = CreateFontIndirect(&lf);
+
+ lstrcpy(fid.name, _T("Hovered Action"));
+ fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.actionHover = CreateFontIndirect(&lf);
+
+ ColourIDT cid = {0};
+ cid.cbSize = sizeof(ColourIDT);
+ lstrcpy(cid.group, _T(PU_FNT_AND_COLOR));
+ lstrcpy(cid.name, _T(PU_COL_BACK_NAME));
+ fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
+
+ lstrcpy(cid.group, _T(PU_FNT_AND_COLOR));
+ lstrcpy(cid.name, _T(PU_COL_AVAT_NAME));
+ fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
+
+ //update class popupps(only temp at this point, must rework)
+ char setting[256];
+ for(int i = 0; i < gTreeData.getCount(); i++) {
+ if(gTreeData[i]->typ == 2) {
+ mir_snprintf(setting, 256, "%s/TextCol", gTreeData[i]->pupClass.pszName);
+ gTreeData[i]->colorText = gTreeData[i]->pupClass.colorText =
+ (COLORREF)DBGetContactSettingDword(0, PU_MODULCLASS, setting, (DWORD)fonts.clText);
+ mir_snprintf(setting, 256, "%s/BgCol", gTreeData[i]->pupClass.pszName);
+ gTreeData[i]->colorBack = gTreeData[i]->pupClass.colorBack =
+ (COLORREF)DBGetContactSettingDword(0, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
+ }
+ }
+}
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h new file mode 100644 index 0000000000..db7b5d7dc1 --- /dev/null +++ b/plugins/Popup/src/font.h @@ -0,0 +1,81 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/font.h $
+Revision : $Revision: 1623 $
+Last change on : $Date: 2010-06-24 18:47:07 +0300 (Чт, 24 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __font_h__
+#define __font_h__
+
+//basic constants for all popup plugins
+#define PU_FNT_AND_COLOR "Popups" //common main group for customice\font&color
+#define PU_FNT_AND_COLOR_DB PU_COMMONMODUL //use eg strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
+
+#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
+#define PU_FNT_NAME_TITLE "Title" //use eg lstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
+#define PU_FNT_NAME_CLOCK "Clock"
+#define PU_FNT_NAME_TEXT "Text"
+
+#define PU_COL_BACK_NAME "Background"
+#define PU_COL_BACK_SETTING "ColourBg"
+#define PU_COL_BORD_NAME "Border"
+#define PU_COL_BORD_SETTING "ColourBorder"
+#define PU_COL_SIDE_NAME "Sidebar"
+#define PU_COL_SIDE_SETTING "ColourSidebar"
+#define PU_COL_LINE_NAME "Title underline"
+#define PU_COL_LINE_SETTING "ColourUnderline"
+#define PU_COL_AVAT_NAME "Avatar Border"
+#define PU_COL_AVAT_SETTING "ColourAvatarBorder"
+
+struct PopupFonts
+{
+ HFONT title;
+ HFONT text;
+ HFONT clock;
+ HFONT action;
+ HFONT actionHover;
+
+ COLORREF clTitle;
+ COLORREF clText;
+ COLORREF clClock;
+ COLORREF clBack;
+ COLORREF clAction;
+ COLORREF clActionHover;
+ COLORREF clAvatarBorder;
+
+};
+
+extern PopupFonts fonts;
+
+void InitFonts();
+
+void ReloadFonts();
+
+
+#endif // __font_h__
diff --git a/plugins/Popup/src/formula.cpp b/plugins/Popup/src/formula.cpp new file mode 100644 index 0000000000..37002c9d18 --- /dev/null +++ b/plugins/Popup/src/formula.cpp @@ -0,0 +1,177 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/formula.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+static inline bool myisspace(char ch)
+{
+ return (ch >= 0) && (ch <= 32);
+}
+
+int Formula::eval_neq(char *&s, Args *args, bool *vars) const
+{
+ int left = eval_sum(s, args, vars);
+ while (*s)
+ {
+ if (myisspace(*s))
+ {
+ ++s;
+ } else
+ if (*s == '<')
+ {
+ // this is needed due to side effects caused by min() macro...
+ int tmp = eval_sum(++s, args, vars);
+ left = min(left, tmp);
+ } else
+ if (*s == '>')
+ {
+ // this is needed due to side effects caused by max() macro...
+ int tmp = eval_sum(++s, args, vars);
+ left = max(left, tmp);
+ } else
+ {
+ break;
+ }
+ }
+ return left;
+}
+
+int Formula::eval_sum(char *&s, Args *args, bool *vars) const
+{
+ int left = eval_mul(s, args, vars);
+ while (*s)
+ {
+ if (myisspace(*s))
+ {
+ ++s;
+ } else
+ if (*s == '+')
+ {
+ left += eval_mul(++s, args, vars);
+ } else
+ if (*s == '-')
+ {
+ left -= eval_mul(++s, args, vars);
+ } else
+ {
+ break;
+ }
+ }
+ return left;
+}
+
+int Formula::eval_mul(char *&s, Args *args, bool *vars) const
+{
+ int left = eval_atom(s, args, vars);
+ while (*s)
+ {
+ if (myisspace(*s))
+ {
+ ++s;
+ } else
+ if(*s == '*')
+ {
+ left *= eval_atom(++s, args, vars);
+ } else
+ if(*s == '/')
+ {
+ if (int right = eval_atom(++s, args, vars))
+ left /= right;
+ } else
+ if(*s == '%')
+ {
+ if (int right = eval_atom(++s, args, vars))
+ left %= right;
+ } else
+ {
+ break;
+ }
+ }
+ return left;
+}
+
+int Formula::eval_atom(char *&s, Args *args, bool *vars) const
+{
+ while (*s)
+ {
+ if (myisspace(*s))
+ {
+ ++s;
+ } else
+ if (*s == '(')
+ {
+ int res = eval_neq(++s, args, vars);
+ if (*s == ')')
+ ++s;
+ return res;
+ } else
+ if ((*s == '+') || (*s == '-'))
+ {
+ int sign = 1;
+ if (*s == '-')
+ sign = -1;
+ return sign * eval_neq(++s, args, vars);
+ } else
+ if (*s == '!')
+ {
+ return !eval_neq(++s, args, vars);
+ } else
+ if ((*s >= '0') && (*s <= '9'))
+ {
+ int res = 0;
+ while ((*s >= '0') && (*s <= '9'))
+ res = res * 10 + *s++ - '0';
+ return res;
+ } else
+ {
+ if (!args)
+ return 0;
+ char buf[1024];
+ char *bufptr = buf;
+ while (((*s >= '0') && (*s <= '9')) || ((*s >= 'a') && (*s <= 'z')) || ((*s >= 'A') && (*s <= 'A')) || (*s == '_') || (*s == '.'))
+ *bufptr++ = *s++;
+ *bufptr = 0;
+ int res = args->get(buf);
+ if (vars) *vars = true;
+ return res;
+ }
+ }
+ return 0;
+}
+
+int Formula::eval(Args *args, bool *vars) const
+{
+ if (vars) *vars = false;
+ char *s = m_str;
+ int res = eval_neq(s, args, vars);
+ return res;
+}
diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h new file mode 100644 index 0000000000..b0239c5551 --- /dev/null +++ b/plugins/Popup/src/formula.h @@ -0,0 +1,98 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/formula.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __formula_h__
+#define __formula_h__
+
+class Formula
+{
+public:
+ class Args
+ {
+ private:
+ struct Item
+ {
+ char *name;
+ int value;
+ Item *next;
+
+ Item(char *aName, int aValue, Item *aNext): value(aValue), next(aNext) { name = aName ? mir_strdup(aName) : 0; }
+ ~Item() { if (name) mir_free(name); }
+ };
+ Item *items;
+ public:
+ Args():items(0){}
+ ~Args(){clear();}
+ void add(char *name, int value)
+ {
+ for (Item *p = items; p; p = p->next)
+ if (!lstrcmpA(p->name,name))
+ {
+ p->value = value;
+ return;
+ }
+ items = new Item(name, value, items);
+ }
+ int get(char *name)
+ {
+ for (Item *p = items; p; p = p->next)
+ if (!lstrcmpA(p->name,name))
+ return p->value;
+ return 0;
+ }
+ void clear()
+ {
+ while (items)
+ {
+ Item *p = items->next;
+ delete items;
+ items = p;
+ }
+ }
+ };
+
+private:
+ char *m_str;
+ int eval_neq (char *&s, Args *args, bool *vars) const;
+ int eval_sum (char *&s, Args *args, bool *vars) const;
+ int eval_mul (char *&s, Args *args, bool *vars) const;
+ int eval_atom(char *&s, Args *args, bool *vars) const;
+
+public:
+ Formula():m_str(mir_strdup("")){}
+ Formula(char *s):m_str(mir_strdup(s)){}
+ ~Formula() {mir_free(m_str);}
+ void set(char *s){mir_free(m_str);m_str=mir_strdup(s);}
+ int eval(Args *args, bool *vars = 0) const;
+};
+
+#endif // __formula_h__
\ No newline at end of file diff --git a/plugins/Popup/src/headers.cpp b/plugins/Popup/src/headers.cpp new file mode 100644 index 0000000000..abf3bad493 --- /dev/null +++ b/plugins/Popup/src/headers.cpp @@ -0,0 +1,34 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/headers.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
diff --git a/plugins/Popup/src/headers.h b/plugins/Popup/src/headers.h new file mode 100644 index 0000000000..217424579d --- /dev/null +++ b/plugins/Popup/src/headers.h @@ -0,0 +1,190 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+*/
+
+/*
+===============================================================================
+ PopUp plugin
+
+This plugin notifies you when a contact changes his/hers status with a PopUp.
+You can customize its look (style of popup, font, text...) and behaviour (the
+position in the screen, the time to live, the action on a mouse click).
+
+File name: "headers.h"
+This file has the purpose of becoming a precompiled header common to every
+project file.
+
+Written by: Hrk (Luca Santarelli)
+Updated by: Zazoo (Victor Pavlychko)
+
+Miranda IM can be found here:
+http://www.miranda-im.org/
+
+Miranda IM plugins and tools can be found here:
+http://addons.miranda-im.org/
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/headers.h $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef HEADERS_H
+#define HEADERS_H
+
+ // disable security warnings about "*_s" functions
+ #define _CRT_SECURE_NO_DEPRECATE
+
+ // disable warnings about underscore in stdc functions
+ #pragma warning(disable: 4996)
+
+ #define _WIN32_WINNT 0x0501
+ #define WINVER 0x0500
+ #define OEMRESOURCE
+
+ #include <windows.h>
+ #include <windowsx.h>
+ #include <winuser.h>
+
+ //Standard headers
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <malloc.h>
+
+ //Windows headers
+ #include <process.h>
+ #include <commctrl.h>
+ #include <commdlg.h>
+
+#ifdef ComboBox_SelectItemData
+ // use Workaround for MS bug ComboBox_SelectItemData;
+ #undef ComboBox_SelectItemData
+#endif
+
+ //Resources
+ #include "../resource.h"
+
+ #define NOWIN2K
+ #define MIRANDA_VER 0x0900
+ #define MIRANDA_CUSTOM_LP
+
+ //Miranda API (see Miranda svn)
+ #include <newpluginapi.h>
+ #include <win2k.h>
+ #include <m_system.h>
+ #include <m_plugins.h>
+ #include <m_clui.h>
+ #include <m_clist.h>
+ #include <m_options.h>
+ #include <m_skin.h>
+ #include <m_langpack.h>
+ #include <m_database.h>
+ #undef DBGetContactSettingString
+ #include <m_protocols.h>
+ #include <m_protosvc.h>
+ #include <m_utils.h>
+ #include <m_button.h>
+ #include <m_message.h>
+ #include <m_userinfo.h>
+ #include <m_addcontact.h>
+ #include <m_png.h>
+ #include <m_clc.h>
+ #include <m_icolib.h>
+ #include <m_hotkeys.h>
+ #include <m_fontservice.h>
+ #include <m_avatars.h>
+ #include <m_metacontacts.h>
+
+ #include <m_system_cpp.h>
+
+
+ // API for 3rd party plugins (\include_API folder)
+ // this folder contain always the latest API
+ #include <m_folders.h>
+ #include <m_hpp.h>
+ #include <m_ieview.h>
+ #include <m_nconvers.h>
+// #include <m_notify.h> //deprecatet
+ #include <m_notify_popup.h>
+ #include <m_smileyadd.h>
+ #ifndef MTEXT_NOHELPERS
+ #define MTEXT_NOHELPERS
+ #endif // MTEXT_NOHELPERS
+ #include <m_text.h>
+ #include <m_ticker.h>
+ #include <m_toolbar.h>
+ #include <m_toptoolbar.h>
+ #include <m_updater.h>
+ #include <m_popup.h> //core define see miranda\include\
+
+ // API for 3rd party plugins (.\api folder)
+ // this folder contain spetial edition API (not latest API !!!)
+ #include "m_mathmodule.h"
+ #include "m_popup2.h"
+
+ //PopUp common handlers
+ #include "defs.h"
+ #include "../version.h"
+ #include "config.h"
+ #include "common.h"
+ #include "def_settings.h"
+// #include "notify_imp.h" //deprecatet
+ #include "opttree.h"
+// #include "opt_old.h" //deprecatet
+ #include "opt_gen.h"
+// #include "opt_notify.h" //deprecatet
+ #include "opt_skins.h"
+ #include "opt_contacts.h"
+ #include "opt_adv.h"
+ #include "history.h"
+ #include "services.h"
+ #include "srmm_menu.h"
+ #include "bitmap_funcs.h"
+ #include "icons.h"
+ #include "font.h"
+ #include "formula.h"
+ #include "skin.h"
+ #include "popup_thread.h"
+ #include "actions.h"
+ #include "notifications.h"
+ #include "opt_class.h"
+ #include "popup_wnd2.h"
+ #include "effects.h"
+// #include "popup_queue.h"
+// #include "popup_list.h"
+
+ #include "avatars.h"
+ #include "avatars_simple.h"
+ #include "avatars_flash.h"
+ #include "avatars_gif.h"
+
+ #include "popup_gdiplus.h"
+
+INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM);
+extern HANDLE hSquareFad;
+
+#endif //HEADERS_H
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp new file mode 100644 index 0000000000..baf5e1797d --- /dev/null +++ b/plugins/Popup/src/history.cpp @@ -0,0 +1,550 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/history.cpp $
+Revision : $Revision: 1631 $
+Last change on : $Date: 2010-07-08 08:22:12 +0300 (Чт, 08 июл 2010) $
+Last change by : $Author: MPK $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+static POPUPDATA2 *popupHistory;
+static int popupHistoryStart = 0;
+static int popupHistorySize = 0;
+static int popupHistoryBuffer = 100;
+
+#define UM_RESIZELIST (WM_USER+100)
+#define UM_SELECTLAST (WM_USER+101)
+#define UM_ADDITEM (WM_USER+102)
+static HWND hwndHistory = NULL;
+
+static inline int getHistoryIndex(int idx)
+{
+ return (popupHistoryStart + idx) % popupHistoryBuffer;
+}
+
+static inline POPUPDATA2 *getHistoryItem(int idx)
+{
+ return popupHistory + (popupHistoryStart + idx) % popupHistoryBuffer;
+}
+
+static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+void PopupHistoryLoad()
+{
+ popupHistoryBuffer = DBGetContactSettingWord(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
+ popupHistory = new POPUPDATA2[popupHistoryBuffer];
+}
+
+void PopupHistoryResize()
+{
+ int i;
+ int toDelete = 0;
+ int toCopy = popupHistorySize;
+ if (popupHistoryBuffer == PopUpOptions.HistorySize) return;
+ if (hwndHistory) PostMessage(hwndHistory, WM_CLOSE, 0, 0);
+ POPUPDATA2 *oldPopupHistory = popupHistory;
+ int oldStart = popupHistoryStart;
+ int oldBuffer = popupHistoryBuffer;
+ popupHistory = new POPUPDATA2[PopUpOptions.HistorySize];
+ popupHistoryStart = 0;
+ popupHistoryBuffer = PopUpOptions.HistorySize;
+ if(PopUpOptions.HistorySize < popupHistorySize){ //if old history bigger new one
+ toDelete = popupHistorySize - PopUpOptions.HistorySize;
+ toCopy = PopUpOptions.HistorySize;
+ popupHistorySize = PopUpOptions.HistorySize;
+ }
+ for(i = 0; i < toCopy; ++i){ //copy needed
+ popupHistory[i] = oldPopupHistory[(oldStart + toDelete + i)%oldBuffer];
+ }
+ for(i = 0; i < toDelete; ++i){//free too old ones
+ POPUPDATA2 *ppd = &oldPopupHistory[(oldStart + i)%oldBuffer];
+ if (ppd->flags & PU2_UNICODE)
+ {
+ mir_free(ppd->lpwzTitle);
+ mir_free(ppd->lpwzText);
+ } else
+ {
+ mir_free(ppd->lpzTitle);
+ mir_free(ppd->lpzText);
+ }
+ if (ppd->lpzSkin) mir_free(ppd->lpzSkin);
+ }
+ delete [] oldPopupHistory;
+}
+
+void PopupHistoryUnload()
+{
+ for (int i = 0; i < popupHistorySize; ++i)
+ {
+ POPUPDATA2 *ppd = &popupHistory[getHistoryIndex(i)];
+ if (ppd->flags & PU2_UNICODE)
+ {
+ mir_free(ppd->lpwzTitle);
+ mir_free(ppd->lpwzText);
+ } else
+ {
+ mir_free(ppd->lpzTitle);
+ mir_free(ppd->lpzText);
+ }
+ if (ppd->lpzSkin) mir_free(ppd->lpzSkin);
+ }
+ delete [] popupHistory;
+ popupHistory = NULL;
+}
+
+void PopupHistoryAdd(POPUPDATA2 *ppdNew)
+{
+ if (!PopUpOptions.EnableHistory)
+ return;
+
+ POPUPDATA2 *ppd;
+ if (popupHistorySize < popupHistoryBuffer)
+ {
+ ++popupHistorySize;
+ ppd = &popupHistory[getHistoryIndex(popupHistorySize-1)];
+ } else
+ {
+ popupHistoryStart = (popupHistoryStart+1)%popupHistoryBuffer;
+ ppd = &popupHistory[getHistoryIndex(popupHistorySize-1)];
+ if (ppd->flags & PU2_UNICODE)
+ {
+ mir_free(ppd->lpwzTitle);
+ mir_free(ppd->lpwzText);
+ } else
+ {
+ mir_free(ppd->lpzTitle);
+ mir_free(ppd->lpzText);
+ }
+ if (ppd->lpzSkin) mir_free(ppd->lpzSkin);
+ }
+
+ *ppd = *ppdNew;
+ if (ppd->flags&PU2_UNICODE)
+ {
+ ppd->lpwzTitle = mir_wstrdup(ppd->lpwzTitle);
+ ppd->lpwzText = mir_wstrdup(ppd->lpwzText);
+ } else
+ {
+ ppd->lpzTitle = mir_strdup(ppd->lpzTitle);
+ ppd->lpzText = mir_strdup(ppd->lpzText);
+ }
+ if (ppd->lpzSkin)
+ {
+ ppd->lpzSkin = mir_strdup(ppd->lpzSkin);
+ } else
+ {
+ ppd->lpzSkin = NULL;
+ }
+ ppd->dwTimestamp = time(NULL);
+// GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL,"HH':'mm", ppd->lpzTime, sizeof(ppd->lpzTime));
+ if (hwndHistory)
+ PostMessage(hwndHistory, UM_ADDITEM, 0, (LPARAM)ppd);
+}
+
+void PopupHistoryShow()
+{
+ if (!PopUpOptions.EnableHistory){
+ MessageBox(NULL, TranslateT("Popup History is disabled"), TranslateT("Popup History message"), MB_OK);
+ return;
+ }
+
+ if (hwndHistory)
+ {
+ ShowWindow(hwndHistory, SW_SHOW);
+ SetForegroundWindow(hwndHistory);
+ SetFocus(hwndHistory);
+ SetActiveWindow(hwndHistory);
+ } else
+ {
+ hwndHistory = CreateDialog(hInst, MAKEINTRESOURCE(IDD_HISTORY), NULL, HistoryDlgProc);
+ SetWindowText(hwndHistory, TranslateT("Popup History"));
+ //ShowWindow(hwndHistory, SW_SHOW);
+ }
+}
+
+static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static int oldWidth = 0;
+ static int loadItem = -1;
+
+ static enum { LOG_NONE, LOG_DEFAULT, LOG_HPP } logType = LOG_NONE;
+ static HWND hwndLog = NULL;
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ oldWidth = 0;
+ HWND hwndList = GetDlgItem(hwnd, IDC_POPUP_LIST);
+ for (int i = 0; i < popupHistorySize; ++i)
+ ListBox_SetItemData(hwndList, ListBox_AddString(hwndList, _T("")), 0);
+ SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(ICO_HISTORY,0));
+ SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(ICO_HISTORY,1));
+
+ if (gbHppInstalled && PopUpOptions.UseHppHistoryLog)
+ {
+ logType = LOG_HPP;
+ ShowWindow(GetDlgItem(hwnd, IDC_POPUP_LIST), SW_HIDE);
+
+ IEVIEWWINDOW ieWindow;
+ ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ ieWindow.iType = IEW_CREATE;
+ ieWindow.dwFlags = 0;
+ ieWindow.dwMode = IEWM_MUCC;
+// ieWindow.dwMode = IEWM_CHAT;
+ ieWindow.parent = hwnd;
+ ieWindow.x = 0;
+ ieWindow.y = 0;
+ ieWindow.cx = 100;
+ ieWindow.cy = 100;
+ CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
+ hwndLog = ieWindow.hwnd;
+ ShowWindow(hwndLog, SW_SHOW);
+
+ RECT rcLst; GetWindowRect(hwndList, &rcLst);
+ POINT pt;
+ pt.x = rcLst.left;
+ pt.y = rcLst.top;
+ ScreenToClient(hwnd, &pt);
+
+ ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ ieWindow.iType = IEW_SETPOS;
+ ieWindow.parent = hwnd;
+ ieWindow.hwnd = hwndLog;
+ ieWindow.x = pt.x;
+ ieWindow.y = pt.y;
+ ieWindow.cx = rcLst.right-rcLst.left;
+ ieWindow.cy = rcLst.bottom-rcLst.top;
+ CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
+
+ IEVIEWEVENTDATA ieData;
+
+ IEVIEWEVENT ieEvent;
+ ieEvent.cbSize = sizeof(ieEvent);
+ ieEvent.iType = IEE_LOG_MEM_EVENTS;
+ ieEvent.dwFlags = 0;
+ ieEvent.hwnd = hwndLog;
+ ieEvent.eventData = &ieData;
+ ieEvent.count = 1;
+ ieEvent.codepage = 0;
+ ieEvent.pszProto = NULL;
+
+ for (int i = 0; i < popupHistorySize; ++i)
+ {
+ ieData.cbSize = sizeof(ieData);
+ ieData.iType = IEED_EVENT_SYSTEM;
+ ieData.dwFlags = 0;
+ ieData.color = getHistoryItem(i)->colorText;
+ if (getHistoryItem(i)->flags & PU2_UNICODE)
+ {
+ ieData.dwFlags |= IEEDF_UNICODE_TEXT|IEEDF_UNICODE_NICK;
+ ieData.pszNickW = getHistoryItem(i)->lpwzTitle;
+ ieData.pszTextW = getHistoryItem(i)->lpwzText;
+ ieData.pszText2W = NULL;
+ } else
+ {
+ ieData.dwFlags |= 0;
+ ieData.pszNick = getHistoryItem(i)->lpzTitle;
+ ieData.pszText = getHistoryItem(i)->lpzText;
+ ieData.pszText2 = NULL;
+ }
+ ieData.bIsMe = FALSE;
+ ieData.time = getHistoryItem(i)->dwTimestamp;
+ ieData.dwData = 0;
+ ieData.next = NULL;
+ CallService(MS_HPP_EG_EVENT, 0, (WPARAM)&ieEvent);
+ }
+ } else
+ {
+ logType = LOG_DEFAULT;
+ hwndLog = hwndList;
+
+ ShowWindow(hwndLog, SW_SHOW);
+ }
+
+ Utils_RestoreWindowPosition(hwnd, NULL, MODULNAME, "popupHistory_");
+
+ if (logType == LOG_DEFAULT)
+ {
+ SendMessage(hwnd, UM_RESIZELIST, 0, 0);
+ ListBox_SetTopIndex(hwndLog, popupHistorySize-1);
+ }
+
+ return TRUE;
+ }
+ case WM_MEASUREITEM:
+ {
+ if (logType != LOG_DEFAULT)
+ return TRUE;
+
+ LPMEASUREITEMSTRUCT lpmis;
+ lpmis = (LPMEASUREITEMSTRUCT) lParam;
+ if (lpmis->itemID == -1)
+ return FALSE;
+ lpmis->itemHeight = 50;
+ return TRUE;
+ }
+ case WM_DRAWITEM:
+ {
+ if (logType != LOG_DEFAULT)
+ return TRUE;
+
+ LPDRAWITEMSTRUCT lpdis;
+ lpdis = (LPDRAWITEMSTRUCT) lParam;
+ if (lpdis->itemID == -1)
+ return FALSE;
+
+ HWND hwndList = GetDlgItem(hwnd, lpdis->CtlID);
+ PopupWnd2 *wndPreview = (PopupWnd2 *)ListBox_GetItemData(hwndList, lpdis->itemID);
+
+ if (!wndPreview)
+ {
+ RECT rc; GetWindowRect(hwndLog, &rc);
+
+ if (rc.right-rc.left <= 30)
+ return FALSE;
+
+ POPUPOPTIONS customOptions = PopUpOptions;
+ customOptions.DynamicResize = FALSE;
+ customOptions.MinimumWidth = customOptions.MaximumWidth = rc.right-rc.left-30;
+
+ POPUPDATA2 *ppd = &popupHistory[getHistoryIndex(lpdis->itemID)];
+ wndPreview = new PopupWnd2(ppd, &customOptions, true);
+ wndPreview->buildMText();
+ wndPreview->update();
+
+ ListBox_SetItemData(hwndLog, lpdis->itemID, wndPreview);
+ ListBox_SetItemHeight(hwndLog, lpdis->itemID, wndPreview->getSize().cy+6);
+ }
+
+ if (wndPreview)
+ {
+ if (lpdis->itemState & ODS_SELECTED)
+ {
+ HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
+ FillRect(lpdis->hDC, &lpdis->rcItem, hbr);
+ DeleteObject(hbr);
+ } else
+ {
+ HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
+ FillRect(lpdis->hDC, &lpdis->rcItem, hbr);
+ DeleteObject(hbr);
+ }
+
+ int width = wndPreview->getContent()->getWidth();
+ int height = wndPreview->getContent()->getHeight();
+#if defined(_UNICODE)
+ {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ AlphaBlend(lpdis->hDC, lpdis->rcItem.left+5, lpdis->rcItem.top+3, width, height,
+ wndPreview->getContent()->getDC(),
+ 0, 0, width, height, bf);
+ }
+#else
+ if (MyAlphaBlend)
+ {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ MyAlphaBlend(lpdis->hDC, lpdis->rcItem.left+5, lpdis->rcItem.top+3, width, height,
+ wndPreview->getContent()->getDC(),
+ 0, 0, width, height, bf);
+ }
+ else {
+ BitBlt(lpdis->hDC,
+ lpdis->rcItem.left+5, lpdis->rcItem.top+5, lpdis->rcItem.left+5+width, lpdis->rcItem.top+3+height,
+ wndPreview->getContent()->getDC(),
+ 0, 0, SRCCOPY);
+ }
+#endif
+ }
+
+ return TRUE;
+ }
+ case WM_DELETEITEM:
+ {
+ if (logType != LOG_DEFAULT)
+ return TRUE;
+
+ DELETEITEMSTRUCT *lpdis = (DELETEITEMSTRUCT *)lParam;
+ PopupWnd2 *wnd = (PopupWnd2 *)ListBox_GetItemData(lpdis->hwndItem, lpdis->itemID);
+ if (wnd) delete wnd;
+ return TRUE;
+ }
+ case WM_SIZE:
+ {
+ RECT rcLst; GetClientRect(hwnd, &rcLst);
+ rcLst.left += 10;
+ rcLst.top += 10;
+ rcLst.right -= 10;
+ rcLst.bottom -= 10;
+ if (logType == LOG_HPP)
+ {
+// POINT pt;
+// pt.x = rcLst.left;
+// pt.y = rcLst.top;
+// ScreenToClient(hwnd, &pt);
+ SetWindowPos(hwndLog, NULL,
+ rcLst.left, rcLst.top, rcLst.right-rcLst.left, rcLst.bottom-rcLst.top,
+ SWP_NOZORDER|SWP_DEFERERASE|SWP_SHOWWINDOW);
+
+ IEVIEWWINDOW ieWindow;
+ ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ ieWindow.iType = IEW_SETPOS;
+ ieWindow.parent = hwnd;
+ ieWindow.hwnd = hwndLog;
+ ieWindow.x = rcLst.left;
+ ieWindow.y = rcLst.top;
+ ieWindow.cx = rcLst.right-rcLst.left;
+ ieWindow.cy = rcLst.bottom-rcLst.top;
+ CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
+ } else
+ if (logType == LOG_DEFAULT)
+ {
+ SetWindowPos(hwndLog, NULL,
+ rcLst.left, rcLst.top, rcLst.right-rcLst.left, rcLst.bottom-rcLst.top,
+ SWP_NOZORDER|SWP_DEFERERASE|SWP_SHOWWINDOW);
+ if (rcLst.right-rcLst.left != oldWidth)
+ {
+ oldWidth = rcLst.right-rcLst.left;
+ PostMessage(hwnd, UM_RESIZELIST, 0, 0);
+ }
+ }
+ return TRUE;
+ }
+ case UM_RESIZELIST:
+ {
+ if (logType != LOG_DEFAULT)
+ return TRUE;
+
+ RECT rc; GetWindowRect(GetDlgItem(hwnd, IDC_POPUP_LIST), &rc);
+
+ if (rc.right-rc.left <= 30)
+ return FALSE;
+
+ for (int i = 0; i < popupHistorySize; ++i)
+ {
+ PopupWnd2 *wndPreview = (PopupWnd2 *)ListBox_GetItemData(hwndLog, i);
+ if (wndPreview) delete wndPreview;
+
+ ListBox_SetItemData(hwndLog, i, 0);
+ ListBox_SetItemHeight(hwndLog, i, 50);
+ }
+ ScrollWindow(hwndLog, 0, 100000, NULL, NULL);
+ InvalidateRect(hwndLog, NULL, TRUE);
+
+ return TRUE;
+ }
+ case UM_ADDITEM:
+ {
+ if (logType == LOG_HPP)
+ {
+ POPUPDATA2 *ppd = (POPUPDATA2 *)lParam;
+
+ IEVIEWEVENTDATA ieData;
+
+ IEVIEWEVENT ieEvent;
+ ieEvent.cbSize = sizeof(ieEvent);
+ ieEvent.iType = IEE_LOG_MEM_EVENTS;
+ ieEvent.dwFlags = 0;
+ ieEvent.hwnd = hwndLog;
+ ieEvent.eventData = &ieData;
+ ieEvent.count = 1;
+ ieEvent.codepage = 0;
+ ieEvent.pszProto = NULL;
+
+ ieData.cbSize = sizeof(ieData);
+ ieData.dwFlags = 0;
+ ieData.iType = IEED_EVENT_SYSTEM;
+ ieData.color = ppd->colorText;
+ if (ppd->flags & PU2_UNICODE)
+ {
+ ieData.dwFlags |= IEEDF_UNICODE_TEXT|IEEDF_UNICODE_NICK;
+ ieData.pszNickW = ppd->lpwzTitle;
+ ieData.pszTextW = ppd->lpwzText;
+ ieData.pszText2W = NULL;
+ } else
+ {
+ ieData.dwFlags |= 0;
+ ieData.pszNick = ppd->lpzTitle;
+ ieData.pszText = ppd->lpzText;
+ ieData.pszText2 = NULL;
+ }
+ ieData.bIsMe = FALSE;
+ ieData.time = ppd->dwTimestamp;
+ ieData.dwData = 0;
+ ieData.next = NULL;
+ CallService(MS_HPP_EG_EVENT, 0, (WPARAM)&ieEvent);
+ } else
+ if(logType == LOG_DEFAULT)
+ {
+ if (popupHistorySize <= ListBox_GetCount(hwndLog))
+ {
+ loadItem = 0;
+ PostMessage(hwnd, UM_RESIZELIST, 0, 0);
+ return TRUE;
+ }
+ ListBox_SetItemData(hwndLog, ListBox_AddString(hwndLog, _T("")), 0);
+/* if (loadItem < 0)
+ {
+ loadItem = ListBox_GetCount(hwndList)-1;
+ SendMessage(hwnd, UM_RESIZEITEM, 0, 0);
+ }*/
+ }
+ return TRUE;
+ }
+ case WM_CLOSE:
+ {
+ Utils_SaveWindowPosition(hwnd, NULL, MODULNAME, "popupHistory_");
+ DestroyWindow(hwnd);
+ hwndHistory = NULL;
+ return TRUE;
+ }
+ case WM_DESTROY:
+ {
+ if (logType == LOG_HPP)
+ {
+ IEVIEWWINDOW ieWindow;
+ ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ ieWindow.iType = IEW_DESTROY;
+ ieWindow.dwFlags = 0;
+ ieWindow.dwMode = IEWM_TABSRMM;
+ ieWindow.parent = hwnd;
+ ieWindow.hwnd = hwndLog;
+ CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
+ }
+ }
+ }
+ return FALSE; //DefWindowProc(hwnd, msg, wParam, lParam);
+}
diff --git a/plugins/Popup/src/history.h b/plugins/Popup/src/history.h new file mode 100644 index 0000000000..ee7d4f4f8e --- /dev/null +++ b/plugins/Popup/src/history.h @@ -0,0 +1,43 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/history.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __history_h__
+#define __history_h__
+
+void PopupHistoryLoad();
+void PopupHistoryResize();
+void PopupHistoryUnload();
+
+void PopupHistoryAdd(POPUPDATA2 *ppd);
+void PopupHistoryShow();
+
+#endif // __history_h__
diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp new file mode 100644 index 0000000000..cb6e87dcc7 --- /dev/null +++ b/plugins/Popup/src/icons.cpp @@ -0,0 +1,145 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/icons.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+typedef struct _ICODESC
+{
+ LPSTR pszName;
+ LPTSTR ptszDesc;
+ LPTSTR ptszSection;
+ BOOL bfromIconPack;
+ WORD idResource;
+ LPSTR pszIcon;
+ int size;
+} ICODESC;
+
+static ICODESC icoDesc[] =
+{
+ //toolbar
+ { ICO_TB_POPUP_ON, _T("Popups are enabled"), _T(SECT_TOLBAR), 0, IDI_POPUP, NULL, 0 },
+ { ICO_TB_POPUP_OFF, _T("Popups are disabled"), _T(SECT_TOLBAR), 0, IDI_NOPOPUP, NULL, 0 },
+ //common popup
+ { ICO_POPUP_ON, _T("Popups are enabled"), _T(SECT_POPUP), 0, IDI_POPUP, NULL, 0 },
+ { ICO_POPUP_OFF, _T("Popups are disabled"), _T(SECT_POPUP), 0, IDI_NOPOPUP, NULL, 0 },
+ { ICO_FAV, _T("With \"favourite\" overlay"), _T(SECT_POPUP), 0, IDI_PU_FAVOURITE, NULL, 0 },
+ { ICO_FULLSCREEN, _T("With \"fullscreen\" overlay"), _T(SECT_POPUP), 0, IDI_PU_FULLSCREEN, NULL, 0 },
+ { ICO_HISTORY, _T("Popup History"), _T(SECT_POPUP), 0, IDI_HISTORY, NULL, -1 },
+ //misc (register is done inside notification service)
+ //{ ICO_MISC_NOTIFY, _T("Notification"), _T(SECT_POPUP) _T(SECT_POPUP_MISC), 0, IDI_MB_INFO, NULL, 0 },
+ //{ ICO_MISC_WARNING, _T("Warning"), _T(SECT_POPUP) _T(SECT_POPUP_MISC), 0, IDI_MB_WARN, NULL, 0 },
+ //{ ICO_MISC_ERROR, _T("Error"), _T(SECT_POPUP) _T(SECT_POPUP_MISC), 0, IDI_MB_STOP, NULL, 0 },
+ //option
+ { ICO_OPT_RELOAD, _T("Refresh skin list"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_RELOAD, NULL, 0 },
+ { ICO_OPT_RESIZE, _T("Popup Placement"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_RESIZE, NULL, 0 },
+ { ICO_OPT_OK, _T("OK"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_ACT_OK, NULL, 0 },
+ { ICO_OPT_CANCEL, _T("Cancel"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_ACT_CLOSE, NULL, 0 },
+ { ICO_OPT_GROUP, _T("Popup Group"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_OPT_GROUP, NULL, 0 },
+ { ICO_OPT_DEF, _T("Show default"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_ACT_OK, NULL, 0 },
+ { ICO_OPT_FAV, _T("Favorite Contact"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_OPT_FAVORITE, NULL, 0 },
+ { ICO_OPT_FULLSCREEN, _T("Show in Fullscreen"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_OPT_FULLSCREEN, NULL, 0 },
+ { ICO_OPT_BLOCK, _T("Blocked Contact"), _T(SECT_POPUP) _T(SECT_POPUP_OPT), 0, IDI_OPT_BLOCK, NULL, 0 },
+ //action
+ { ICO_ACT_REPLY, _T("Quick Reply"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_REPLY, NULL, -1 },
+ { ICO_ACT_PIN, _T("Pin Popup"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_PIN, NULL, -1 },
+ { ICO_ACT_PINNED, _T("Pinned Popup"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_PINNED, NULL, -1 },
+ { ICO_ACT_MESS, _T("Send Message"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_MESSAGE, NULL, -1 },
+ { ICO_ACT_INFO, _T("User Details"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_INFO, NULL, -1 },
+ { ICO_ACT_MENU, _T("Contact Menu"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_MENU, NULL, -1 },
+ { ICO_ACT_ADD, _T("Add Contact Permanently"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_ADD, NULL, -1 },
+ { ICO_ACT_CLOSE, _T("Dismiss Popup"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_CLOSE, NULL, -1 },
+ { ICO_ACT_COPY, _T("Copy to clipboard"), _T(SECT_POPUP) _T(SECT_POPUP_ACT), 0, IDI_ACT_COPY, NULL, -1 }
+
+};
+
+/**
+ * Returns a icon, identified by a name
+ * @param pszIcon - name of the icon
+ * @param big - bool big icon (default = false)
+ * @return: HICON if the icon is loaded, NULL otherwise
+ **/
+HICON IcoLib_GetIcon(LPCSTR pszIcon, bool big)
+{
+ return (pszIcon) ? (HICON)CallService(MS_SKIN2_GETICON, (WPARAM)big, (LPARAM) pszIcon) : NULL;
+}
+
+void InitIcons()
+{
+ SKINICONDESC sid;
+ ZeroMemory(&sid, sizeof(sid));
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_ALL_TCHAR;
+ TCHAR selfDLL[1024];
+ GetModuleFileName(hInst, selfDLL, 1024);
+
+ for(int i = 0; i < SIZEOF(icoDesc); i++){
+ sid.pszName = icoDesc[i].pszName;
+ sid.ptszDescription = icoDesc[i].ptszDesc; // [TRANSLATED-BY-CORE]
+ sid.ptszSection = icoDesc[i].ptszSection; //must be always untranslatet !!!!!
+
+ if(icoDesc[i].idResource==0){
+ //use icon from icon lib
+ sid.hDefaultIcon = (HICON)CallService(MS_SKIN2_GETICON,0 , (LPARAM)icoDesc[i].pszIcon);
+ sid.ptszDefaultFile = NULL;
+ sid.iDefaultIndex = 0;
+ }else{
+ //load and register from popup.dll
+ sid.hDefaultIcon = 0;
+ sid.ptszDefaultFile = selfDLL;
+ sid.iDefaultIndex = -icoDesc[i].idResource;
+ }
+
+ switch (icoDesc[i].size){
+ // small and big icons
+ case -1:{
+ sid.cx = sid.cy = 0;
+ break;
+ }
+ // small icons (16x16)
+ case 0:{
+ sid.cx = sid.cy = 16;
+ break;
+ }
+ // normal icons (32x32)
+ case 1:{
+ sid.cx = sid.cy = 32;
+ break;
+ }
+ // custom icon size
+ default:{
+ sid.cx = sid.cy = icoDesc[i].size;
+ break;
+ }
+ }
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ }
+}
\ No newline at end of file diff --git a/plugins/Popup/src/icons.h b/plugins/Popup/src/icons.h new file mode 100644 index 0000000000..532e7cecb4 --- /dev/null +++ b/plugins/Popup/src/icons.h @@ -0,0 +1,79 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/icons.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __icons_h__
+#define __icons_h__
+
+//ICONS
+#define SECT_TOLBAR "ToolBar"
+#define SECT_POPUP MODULNAME_PLU
+#define SECT_POPUP_ACT "/Actions"
+#define SECT_POPUP_OPT "/Options"
+#define SECT_POPUP_MISC "/Misc"
+
+#define ICO_TB_POPUP_ON "TBButton_popup_ToogleUp"
+#define ICO_TB_POPUP_OFF "TBButton_popup_ToogleDOWN"
+#define ICO_POPUP_ON MODULNAME"_enabled"
+#define ICO_POPUP_OFF MODULNAME"_disabled"
+#define ICO_FAV MODULNAME"_favourite"
+#define ICO_FULLSCREEN MODULNAME"_fullscreen"
+#define ICO_HISTORY MODULNAME"_history"
+
+#define ICO_MISC_NOTIFY MODULNAME"_Misc_Notification"
+#define ICO_MISC_WARNING MODULNAME"_Misc_Warning"
+#define ICO_MISC_ERROR MODULNAME"_Misc_Error"
+
+#define ICO_ACT_MESS MODULNAME"_act_message"
+#define ICO_ACT_INFO MODULNAME"_act_info"
+#define ICO_ACT_MENU MODULNAME"_act_menu"
+#define ICO_ACT_ADD MODULNAME"_act_add"
+#define ICO_ACT_REPLY MODULNAME"_act_reply"
+#define ICO_ACT_PIN MODULNAME"_act_pin"
+#define ICO_ACT_PINNED MODULNAME"_act_pinned"
+#define ICO_ACT_CLOSE MODULNAME"_act_close"
+#define ICO_ACT_COPY MODULNAME"_act_copy"
+
+#define ICO_OPT_RELOAD MODULNAME"_opt_reload"
+#define ICO_OPT_RESIZE MODULNAME"_opt_resize"
+#define ICO_OPT_GROUP MODULNAME"_opt_group"
+#define ICO_OPT_OK MODULNAME"_opt_ok"
+#define ICO_OPT_CANCEL MODULNAME"_opt_cancel"
+
+#define ICO_OPT_DEF MODULNAME"_opt_default"
+#define ICO_OPT_FAV MODULNAME"_opt_favorite"
+#define ICO_OPT_FULLSCREEN MODULNAME"_opt_fullscreen"
+#define ICO_OPT_BLOCK MODULNAME"_opt_block"
+
+void InitIcons();
+HICON IcoLib_GetIcon(LPCSTR pszIcon, bool big=false);
+
+#endif // __icons_h__
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp new file mode 100644 index 0000000000..41ad1b56ce --- /dev/null +++ b/plugins/Popup/src/main.cpp @@ -0,0 +1,743 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/main.cpp $
+Revision : $Revision: 1652 $
+Last change on : $Date: 2010-07-15 20:48:21 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+#include <shellapi.h>
+#include <malloc.h>
+
+WORD SETTING_MAXIMUMWIDTH_MAX = GetSystemMetrics(SM_CXSCREEN);
+
+#define MENUCOMMAND_HISTORY "PopUp/ShowHistory"
+#define MENUCOMMAND_SVC "PopUp/EnableDisableMenuCommand"
+
+
+//===== MessageBoxes =====
+//void MB(char*); //This one is for Debug purposes
+//void Log(char*); //This one is used to notify the user
+//void HigherLower(int, int); //Used for integer input boxes (out of bound values).
+//void NotifyError(DWORD, char*, int, char*); //Used to notify an error giving some error codes to report.
+
+//===== Options =====
+static int OptionsInitialize(WPARAM,LPARAM);
+
+//===== Initializations =====
+static int OkToExit(WPARAM,LPARAM);
+bool OptionLoaded = false;
+int hLangpack = 0;
+
+//===== Global variables =====
+//===== DLLs =====
+HMODULE hUserDll = 0;
+HMODULE hMsimgDll = 0;
+HMODULE hKernelDll = 0;
+HMODULE hGdiDll = 0;
+HMODULE hDwmapiDll = 0;
+
+//===== User wnd class =====
+GLOBAL_WND_CLASSES g_wndClass = {0};
+
+//===== MTextControl ====
+HANDLE htuText = NULL;
+HANDLE htuTitle = NULL;
+
+//===== Menu item =====
+HANDLE hMenuRoot = NULL;
+HANDLE hMenuItem = NULL;
+HANDLE hMenuItemHistory = NULL;
+
+//==== ServiceFunctions Handles ====
+HANDLE hShowHistory = NULL;
+HANDLE hTogglePopup = NULL;
+HANDLE hGetStatus = NULL;
+
+//===== Event Handles =====
+HANDLE hOptionsInitialize;
+//HANDLE hNotifyOptionsInitialize; deprecatet
+HANDLE hModulesLoaded;
+HANDLE hTTBLoaded;
+HANDLE hTBLoaded;
+HANDLE hOkToExit;
+HANDLE hIconsChanged, hFontsChanged;
+HANDLE hEventStatusChanged; //To automatically disable on status change.
+int hTTButton = -1;
+HANDLE hTButton = NULL;
+
+GLOBAL g_popup = {0};
+
+static struct {
+ char *name;
+ INT_PTR (*func)(WPARAM, LPARAM);
+ HANDLE handle;
+} popupServices[] =
+{
+ {MS_POPUP_ADDPOPUP, PopUp_AddPopUp, 0},
+ {MS_POPUP_ADDPOPUPEX, PopUp_AddPopUpEx, 0},
+ {MS_POPUP_ADDPOPUPW, PopUp_AddPopUpW, 0},
+ {MS_POPUP_ADDPOPUP2, PopUp_AddPopUp2, 0},
+
+ {MS_POPUP_CHANGETEXT, PopUp_ChangeText, 0},
+ {MS_POPUP_CHANGETEXTW, PopUp_ChangeTextW, 0},
+ {MS_POPUP_CHANGE, PopUp_Change, 0},
+ {MS_POPUP_CHANGEW, PopUp_ChangeW, 0},
+ {MS_POPUP_CHANGEPOPUP2, PopUp_Change2, 0},
+
+ {MS_POPUP_GETCONTACT, PopUp_GetContact, 0},
+ {MS_POPUP_GETPLUGINDATA, PopUp_GetPluginData, 0},
+ {MS_POPUP_ISSECONDLINESHOWN, PopUp_IsSecondLineShown, 0},
+
+ {MS_POPUP_SHOWMESSAGE, PopUp_ShowMessage, 0},
+ {MS_POPUP_SHOWMESSAGEW, PopUp_ShowMessageW, 0},
+ {MS_POPUP_QUERY, PopUp_Query, 0},
+
+ {MS_POPUP_REGISTERACTIONS, PopUp_RegisterActions, 0},
+ {MS_POPUP_REGISTERNOTIFICATION, PopUp_RegisterNotification, 0},
+
+ {MS_POPUP_UNHOOKEVENTASYNC, PopUp_UnhookEventAsync, 0},
+
+ {MS_POPUP_REGISTERVFX, PopUp_RegisterVfx, 0},
+
+ {MS_POPUP_REGISTERCLASS, PopUp_RegisterPopupClass, 0},
+ {MS_POPUP_ADDPOPUPCLASS, PopUp_CreateClassPopup, 0},
+
+};
+
+//===== Options pages =====
+static int OptionsInitialize(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.position = 100000000;
+ odp.groupPosition = 910000000;
+ odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS;
+ odp.ptszTitle = LPGENT(MODULNAME_PLU);
+
+ odp.ptszTab = LPGENT("General");
+ odp.pfnDlgProc = DlgProcPopUpGeneral;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP_GENERAL);
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.ptszTab = LPGENT("Classes");
+ odp.pfnDlgProc = DlgProcOptsClasses;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFICATIONS);
+ CallService( MS_OPT_ADDPAGE, wParam,(LPARAM)&odp );
+
+ odp.ptszTab = LPGENT("Actions");
+ odp.pfnDlgProc = DlgProcPopupActions;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACTIONS);
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.ptszTab = LPGENT("Contacts");
+ odp.pfnDlgProc = DlgProcContactOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTACTS);
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.ptszTab = LPGENT("Advanced");
+ odp.pfnDlgProc = DlgProcPopUpAdvOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP_ADVANCED);
+ odp.flags |= ODPF_EXPERTONLY;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ odp.ptszGroup = LPGENT("Skins");
+ odp.ptszTab = LPGENT(MODULNAME_PLU);
+ odp.pfnDlgProc = DlgProcPopSkinsOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN2);
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ //Test page
+ //odp.ptszTab = LPGEN("General (old)");
+ //odp.pfnDlgProc = DlgProcPopUpOpts;
+ //odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_POPUP);
+ //CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+
+ return 0;
+}
+
+static int FontsChanged(WPARAM wParam,LPARAM lParam)
+{
+ ReloadFonts();
+ return 0;
+}
+
+static int IconsChanged(WPARAM wParam,LPARAM lParam){
+ LoadActions();
+
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof(mi);
+
+ if (PopUpOptions.ModuleIsEnabled == TRUE) { //The module is enabled.
+ //The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
+ mi.hIcon = IcoLib_GetIcon(ICO_POPUP_ON,0);
+ }
+ else { //The module is disabled.
+ //The action to do is enable popups (show enabled), then write "disable popup" in the new item.
+ mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF,0);
+ }
+ mi.flags = CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuRoot,(LPARAM)&mi);
+
+ mi.hIcon = IcoLib_GetIcon(ICO_HISTORY,0);
+ mi.flags = CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItemHistory,(LPARAM)&mi);
+
+ if (hTTButton >= 0) {
+ TTBButtonV2 btn = {0};
+ btn.cbSize = sizeof(btn);
+ btn.pszServiceUp = btn.pszServiceDown = MENUCOMMAND_SVC;
+ btn.lParamUp = 1;
+ btn.lParamDown = 0;
+ btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ btn.name = Translate("Toggle Popups");
+ btn.tooltipUp = Translate("Popups are disabled");
+ btn.tooltipDn = Translate("Popups are enabled");
+ btn.hIconUp = IcoLib_GetIcon(ICO_POPUP_OFF,0);
+ btn.hIconDn = IcoLib_GetIcon(ICO_POPUP_ON,0);
+ hTTButton = CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_ALLDATA, hTTButton), (LPARAM)&btn);
+ }
+
+ return 0;
+}
+
+static int TTBLoaded(WPARAM wParam,LPARAM lParam){
+ if (hTTButton < 0) {
+ TTBButtonV2 btn = {0};
+ btn.cbSize = sizeof(btn);
+ btn.pszServiceUp = btn.pszServiceDown = MENUCOMMAND_SVC;
+ btn.lParamUp = 1;
+ btn.lParamDown = 0;
+ btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ btn.name = Translate("Toggle Popups");
+ btn.tooltipUp = Translate("Popups are disabled");
+ btn.tooltipDn = Translate("Popups are enabled");
+ btn.hIconUp = IcoLib_GetIcon(ICO_POPUP_OFF,0);
+ btn.hIconDn = IcoLib_GetIcon(ICO_POPUP_ON,0);
+ hTTButton = CallService(MS_TTB_ADDBUTTON, (WPARAM)&btn, 0);
+ }
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, PopUpOptions.ModuleIsEnabled?TTBST_RELEASED:TTBST_PUSHED);
+ return 0;
+}
+
+//register Modern Toolbarbutton
+static int ToolbarSet(WPARAM, LPARAM){
+ if (hTButton == NULL){
+ TBButton tbb = {0};
+ tbb.cbSize = sizeof(TBButton);
+ tbb.pszButtonID = "PopupToogle";
+ tbb.pszButtonName = Translate("Toggle Popups");
+ tbb.pszServiceName = MENUCOMMAND_SVC;
+ tbb.pszTooltipUp = Translate("Popups are disabled");
+ tbb.pszTooltipDn = Translate("Popups are enabled");
+ tbb.hPrimaryIconHandle = (HANDLE)CallService(MS_SKIN2_GETICONHANDLE, 0, (LPARAM)ICO_TB_POPUP_OFF);
+ tbb.hSecondaryIconHandle = (HANDLE)CallService(MS_SKIN2_GETICONHANDLE, 0, (LPARAM)ICO_TB_POPUP_ON);
+ tbb.tbbFlags = TBBF_VISIBLE;
+ tbb.defPos = 10000;
+ hTButton = (HANDLE)CallService(MS_TB_ADDBUTTON,0, (LPARAM)&tbb);
+ }
+ CallService(MS_TB_SETBUTTONSTATEBYID, (WPARAM)"PopupToogle", PopUpOptions.ModuleIsEnabled?TBST_PUSHED:TBST_RELEASED);
+ return 0;
+}
+
+//===== EnableDisableMenuCommand =====
+INT_PTR svcEnableDisableMenuCommand(WPARAM wp, LPARAM lp)
+{
+ int iResult = 0;
+ int iResultRoot = 0;
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof(mi);
+
+ if (PopUpOptions.ModuleIsEnabled)
+ { //The module is enabled.
+ //The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
+ PopUpOptions.ModuleIsEnabled = FALSE;
+ DBWriteContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", FALSE);
+ mi.ptszName = LPGENT("Enable &popup module");
+ mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF,0);
+ } else
+ { //The module is disabled.
+ //The action to do is enable popups (show enabled), then write "disable popup" in the new item.
+ PopUpOptions.ModuleIsEnabled = TRUE;
+ DBWriteContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", TRUE);
+ mi.ptszName = LPGENT("Disable &popup module");
+ mi.hIcon = IcoLib_GetIcon(ICO_POPUP_ON,0);
+ }
+ mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
+ iResult = CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
+ mi.flags = CMIM_ICON;
+ iResultRoot = CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuRoot,(LPARAM)&mi);
+ TTBLoaded(0,0);
+ ToolbarSet(0,0);
+ if(iResult && iResultRoot)
+ return 1;
+ else
+ return 0;
+}
+
+INT_PTR svcShowHistory(WPARAM, LPARAM)
+{
+ PopupHistoryShow();
+ return 0;
+}
+
+void InitMenuItems(void) {
+ CLISTMENUITEM mi={0};
+
+ // Common
+ mi.cbSize = sizeof(mi);
+ // support new genmenu style
+ mi.flags = CMIF_ROOTHANDLE|CMIF_TCHAR;
+ mi.hParentMenu = HGENMENU_ROOT;
+
+ // Build main menu
+ mi.position = -1000000000 /*1000001*/;
+ mi.ptszName = LPGENT(MODULNAME_PLU);
+ mi.hIcon = IcoLib_GetIcon(PopUpOptions.ModuleIsEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF ,0);
+ hMenuRoot = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+
+ // Add item to main menu
+ mi.hParentMenu = (HGENMENU)hMenuRoot;
+
+ hTogglePopup = CreateServiceFunction(MENUCOMMAND_SVC, svcEnableDisableMenuCommand);
+ mi.ptszName = PopUpOptions.ModuleIsEnabled ? LPGENT("Disable &popup module") : LPGENT("Enable &popup module");
+ mi.pszService = MENUCOMMAND_SVC;
+ hMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi);
+
+ // Popup History
+ hShowHistory = CreateServiceFunction(MENUCOMMAND_HISTORY, svcShowHistory);
+ mi.position = 1000000000;
+ mi.popupPosition = 1999990000;
+ mi.ptszName = LPGENT("Popup History");
+ mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
+ mi.pszService = MENUCOMMAND_HISTORY;
+ hMenuItemHistory = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi);
+
+}
+
+//===== GetStatus =====
+INT_PTR GetStatus(WPARAM wp, LPARAM lp)
+{
+ return PopUpOptions.ModuleIsEnabled;
+}
+
+//register Updatersupport
+void registerUpdate(){
+ Update update = {0};
+ char szVersion[16];
+ update.cbSize = sizeof(Update);
+ update.szComponentName = pluginInfoEx.shortName;
+ update.pbVersion = (BYTE *)CreateVersionStringPluginEx(&pluginInfoEx, szVersion);
+ update.cpbVersion = (int)strlen((char *)update.pbVersion);
+
+ update.szUpdateURL = __FLUpdateURL /*UPDATER_AUTOREGISTER*/;
+ update.szVersionURL = __FLVersionURL;
+ update.pbVersionPrefix = (BYTE *)__FLVersionPrefix;
+ update.cpbVersionPrefix = (int)strlen((char *)update.pbVersionPrefix);
+
+ update.szBetaUpdateURL = __BetaUpdateURL;
+ update.szBetaVersionURL = __BetaVersionURL;
+ // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ update.pbBetaVersionPrefix = (BYTE *)__BetaVersionPrefix;
+ update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix);
+
+ update.szBetaChangelogURL = __BetaChangelogURL;
+
+ CallService(MS_UPDATE_REGISTER, 0, (LPARAM) &update);
+}
+
+//register Hotkey
+void LoadHotkey(){
+ HOTKEYDESC hk = {0};
+ hk.cbSize = sizeof(hk);
+ hk.dwFlags = HKD_TCHAR;
+ hk.pszName = "Toggle Popups";
+ hk.ptszDescription = LPGENT("Toggle Popups");
+ hk.ptszSection = LPGENT(MODULNAME_PLU);
+ hk.pszService = MENUCOMMAND_SVC;
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM) &hk);
+
+ // 'Popup History' Hotkey
+ hk.pszName = "Popup History";
+ hk.ptszDescription = LPGENT("Popup History");
+ hk.pszService = MENUCOMMAND_HISTORY;
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM) &hk);
+}
+
+//menu
+//Function which makes the initializations
+static int ModulesLoaded(WPARAM wParam,LPARAM lParam)
+{
+ //check if 'Icon Library Manager' and 'FontService' exist (load icon and font later)
+ if (!ServiceExists(MS_FONT_REGISTER) || !ServiceExists(MS_SKIN2_ADDICON)) {
+ LPTSTR msg = TranslateTS(
+ _T("This version of Popup Plus requires\r\n")
+ _T("'Icon Library Manager' and 'FontService'\r\n")
+ _T("modules.\r\n")
+ _T("\r\n")
+ _T("You always can download them at\r\n")
+ _T("http://addons.miranda-im.org/\r\n")
+ _T("\r\n")
+ _T("Do you want to visit Miranda IM homepage now?\r\n") );
+ if (MessageBox(NULL, msg, _T("Popup Plus Error"), MB_YESNO|MB_ICONSTOP) == IDYES)
+ ShellExecute(NULL, _T("open"), _T("http://addons.miranda-im.org/"), NULL, NULL, SW_SHOWNORMAL);
+ return 0;
+ }
+
+ //check if History++ is installed
+ gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) &&
+ (CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112));
+ //check if MText plugin is installed
+ if (MText.Register) {
+ htuText = MText.Register("PopUp Plus/Text", MTEXT_FANCY_DEFAULT);
+ htuTitle = MText.Register("PopUp Plus/Title",MTEXT_FANCY_DEFAULT);
+ }
+ else {
+ htuTitle = htuText = NULL;
+ }
+ // init meta contacts
+ INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
+ if (ptr != CALLSERVICE_NOTFOUND) {
+ gszMetaProto = (LPCSTR)ptr;
+ }
+
+ //check if OptionLoaded
+ if(!OptionLoaded){
+ LoadOptions();
+ }
+/*/deprecatet stuff
+ notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK, 0, 0) : NULL;
+ LoadNotifyImp();
+ hNotifyOptionsInitialize = HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
+
+ HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInitialise);
+*/
+ //Uninstalling purposes
+ if (ServiceExists("PluginSweeper/Add")) {
+ CallService("PluginSweeper/Add",(WPARAM)Translate(MODULNAME),(LPARAM)MODULNAME);
+ }
+ //load fonts / create hook
+ InitFonts();
+ hFontsChanged = HookEvent(ME_FONT_RELOAD,FontsChanged);
+
+ //load actions and notifications
+ LoadActions();
+ LoadNotifications();
+ //hook TopToolBar
+ hTTBLoaded = HookEvent(ME_TTB_MODULELOADED, TTBLoaded);
+ //Folder plugin support
+ LPTSTR pszPath = mir_a2t(MIRANDA_PATH "\\Skins\\PopUp");
+ folderId = FoldersRegisterCustomPathT(MODULNAME_LONG, "Skins", pszPath);
+ mir_free(pszPath);
+ //load skin
+ skins.load(_T("dir"));
+ const PopupSkin *skin;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ mir_free(PopUpOptions.SkinPack);
+ PopUpOptions.SkinPack = mir_tstrdup(skin->getName());
+ skin->loadOpts();
+ }
+ //init PopupEfects
+ PopupEfectsInitialize();
+ //MessageAPI support
+ SrmmMenu_Load();
+ //Hotkey
+ LoadHotkey();
+ //Modern Toolbar support
+ if(ServiceExists(MS_TB_ADDBUTTON)) {
+ hTBLoaded = HookEvent(ME_TB_MODULELOADED, ToolbarSet);
+ ToolbarSet(0,0);
+ }
+ //Updater support
+ if(ServiceExists(MS_UPDATE_REGISTER)) registerUpdate();
+
+ gbPopupLoaded = TRUE;
+ return 0;
+}
+
+//=== DllMain =====
+//DLL entry point, Required to store the instance handle
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinstDLL;
+ return TRUE;
+}
+
+//===== MirandaPluginInfo =====
+//Called by Miranda to get the information associated to this plugin.
+//It only returns the PLUGININFOEX structure, without any test on the version
+//@param mirandaVersion - The version of the application calling this function
+MIRAPI PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ g_popup.MirVer = mirandaVersion;
+
+#if defined(_UNICODE)
+ pluginInfoEx.flags = UNICODE_AWARE;
+#else
+ if (GetProcAddress(GetModuleHandle(_T("user32")), "DrawTextExW"))
+ pluginInfoEx.flags = 1; // dynamic UNICODE_AWARE
+#endif
+
+ return &pluginInfoEx;
+}
+
+//Miranda PluginInterfaces
+MIRAPI const MUUID *MirandaPluginInterfaces(void)
+{
+ static const MUUID interfaces[] = { MIID_POPUPS, MIID_LAST };
+ return interfaces;
+}
+
+//ME_SYSTEM_OKTOEXIT event
+//called before the app goes into shutdown routine to make sure everyone is happy to exit
+static int OkToExit(WPARAM wParam, LPARAM lParam)
+{
+ closing = TRUE;
+ StopPopupThread();
+ return 0;
+}
+
+//===== Load =====
+//Initializes the services provided and the link to those needed
+//Called when the plugin is loaded into Miranda
+MIRAPI int Load(PLUGINLINK *link)
+{
+ char ver[1024];
+ pluginLink=link;
+
+ g_popup.isOsUnicode = (GetVersion() & 0x80000000) == 0;
+
+ CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(ver), (LPARAM) ver);
+ g_popup.isMirUnicode = strstr(ver, "Unicode") != NULL;
+
+ hGetStatus = CreateServiceFunction(MS_POPUP_GETSTATUS, GetStatus);
+
+ DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
+
+ mir_getLI (&li);
+ mir_getMMI (&mmi);
+ mir_getUTFI (&utfi);
+ mir_getMTI (&MText);
+ mir_getLP(&pluginInfoEx);
+
+ #if defined(_DEBUG)
+ PopUpOptions.debug = DBGetContactSettingByte(NULL, MODULNAME, "debug", FALSE);
+ #else
+ PopUpOptions.debug = false;
+ #endif
+ LoadGDIPlus();
+
+ //Transparent and animation routines
+ OSVERSIONINFO osvi = { 0 };
+ BOOL bResult = FALSE;
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ bResult = GetVersionEx(&osvi);
+
+// MLU layer for ansi release
+#if !defined(_UNICODE)
+ MySetLayeredWindowAttributes = 0;
+ MyUpdateLayeredWindow = 0;
+ MyAnimateWindow = 0;
+ MyDrawTextW = 0;
+ MyDrawTextExW = 0;
+ MySetWindowTextW = 0;
+ MySendMessageW = 0;
+ MyCallWindowProcW = 0;
+ MyCreateWindowExW = 0;
+
+ MyGetMonitorInfo = 0;
+ MyMonitorFromWindow = 0;
+
+ hUserDll = LoadLibrary(_T("user32.dll"));
+ if (hUserDll) {
+ MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
+ MyUpdateLayeredWindow = (BOOL (WINAPI *)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD))GetProcAddress(hUserDll, "UpdateLayeredWindow");
+ MyAnimateWindow = (BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow");
+ MyDrawTextW = (int (WINAPI *)(HDC, LPCWSTR, int, LPRECT, UINT))GetProcAddress(hUserDll,"DrawTextW");
+ MyDrawTextExW = (int (WINAPI*)(HDC,LPCWSTR,int,LPRECT,UINT,LPDRAWTEXTPARAMS))GetProcAddress(hUserDll,"DrawTextExW");
+ MySetWindowTextW = (BOOL (WINAPI*)(HWND, LPCWSTR))GetProcAddress(hUserDll,"SetWindowTextW");
+ MySendMessageW = (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM))GetProcAddress(hUserDll,"SendMessageW");
+ MyCallWindowProcW = (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM))GetProcAddress(hUserDll,"CallWindowProcW");
+ MyCreateWindowExW = (HWND (WINAPI*)(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID))GetProcAddress(hUserDll,"CreateWindowExW");
+
+ if (LOWORD(GetVersion())!=4) { //Windows 98, ME, 2000, XP, and later support multimonitor configuration.
+ if (bResult) {
+ if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ { //2000 or XP
+ #ifdef UNICODE
+ MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll,("GetMonitorInfoW"));
+ #else
+ MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll,("GetMonitorInfoA"));
+ #endif //UNICODE
+ } else
+ { //98 or ME
+ // attempt to fix multimonitor on 9x
+ MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll,("GetMonitorInfoA"));
+ if (!MyGetMonitorInfo)
+ MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll,("GetMonitorInfo"));
+ }
+ } //There's no need for an else branch.
+ if (MyGetMonitorInfo)
+ MyMonitorFromWindow = (HMONITOR (WINAPI*)(HWND,DWORD))GetProcAddress(hUserDll, ("MonitorFromWindow"));
+ }
+ }
+
+ hGdiDll = LoadLibrary(_T("gdi32.dll"));
+ if (hGdiDll) {
+ MyGetTextExtentPoint32W = (BOOL (WINAPI *)(HDC, LPCWSTR, int, LPSIZE))GetProcAddress(hGdiDll,"GetTextExtentPoint32W");
+ }
+ else{
+ MyGetTextExtentPoint32W = 0;
+ }
+ hMsimgDll = LoadLibrary(_T("msimg32.dll"));
+ MyAlphaBlend = 0;
+ MyTransparentBlt = 0;
+ if (hMsimgDll)
+ {
+ MyTransparentBlt = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, UINT))
+ GetProcAddress(hMsimgDll, "TransparentBlt");
+ MyAlphaBlend = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION))
+ GetProcAddress(hMsimgDll, "AlphaBlend");
+ }
+#endif
+
+ hDwmapiDll = LoadLibrary(_T("dwmapi.dll"));
+ MyDwmEnableBlurBehindWindow = 0;
+ if (hDwmapiDll) {
+ MyDwmEnableBlurBehindWindow = (HRESULT (WINAPI *)(HWND, DWM_BLURBEHIND *))
+ GetProcAddress(hDwmapiDll, "DwmEnableBlurBehindWindow");
+ }
+
+ PopupHistoryLoad();
+ LoadPopupThread();
+ if (!LoadPopupWnd2())
+ {
+ MessageBox(0, TranslateTS(
+ _T("Error: I could not register the PopUp Window class.\r\n")
+ _T("The plugin will not operate.")
+ ),
+ _T(MODULNAME_LONG), MB_ICONSTOP|MB_OK);
+ return 0; //We couldn't register our Window Class, don't hook any event: the plugin will act as if it was disabled.
+ }
+ RegisterOptPrevBox();
+
+ // Register in DBEditor++
+ DBVARIANT dbv;
+ if (DBGetContactSetting(NULL, "KnownModules", MODULNAME, &dbv))
+ DBWriteContactSettingString(NULL, "KnownModules", pluginInfoEx.shortName, MODULNAME);
+ DBFreeVariant(&dbv);
+
+ hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
+ hOkToExit = HookEvent(ME_SYSTEM_OKTOEXIT, OkToExit);
+// hEventStatusChanged = HookEvent(ME_CLIST_STATUSMODECHANGE,StatusModeChanged);
+
+ hbmNoAvatar = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_NOAVATAR));
+
+ if(!OptionLoaded){
+ LoadOptions();
+ }
+
+ //Service Functions
+ for (int i = SIZEOF(popupServices); i--; )
+ popupServices[i].handle = CreateServiceFunction(popupServices[i].name, popupServices[i].func);
+
+ //load icons / create hook
+ InitIcons();
+ hIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED,IconsChanged);
+ //add menu items
+ InitMenuItems();
+
+ return 0;
+}
+
+//===== Unload =====
+//Prepare the plugin to stop
+//Called by Miranda when it will exit or when the plugin gets deselected
+
+MIRAPI int Unload(void)
+{
+ int i;
+
+ for (i = SIZEOF(popupServices); i--; )
+ DestroyServiceFunction(popupServices[i].handle);
+
+ SrmmMenu_Unload();
+
+ UnhookEvent(hOptionsInitialize);
+ UnhookEvent(hModulesLoaded);
+ UnhookEvent(hOkToExit);
+ UnhookEvent(hEventStatusChanged);
+ UnhookEvent(hIconsChanged);
+ UnhookEvent(hFontsChanged);
+ UnhookEvent(hTBLoaded);
+
+ DestroyServiceFunction(hShowHistory);
+ DestroyServiceFunction(hTogglePopup);
+ DestroyServiceFunction(hGetStatus);
+ DestroyServiceFunction(hSquareFad);
+
+ DeleteObject(fonts.title);
+ DeleteObject(fonts.clock);
+ DeleteObject(fonts.text);
+ DeleteObject(fonts.action);
+ DeleteObject(fonts.actionHover);
+
+ DeleteObject(hbmNoAvatar);
+
+ FreeLibrary(hDwmapiDll);
+ FreeLibrary(hUserDll);
+ FreeLibrary(hMsimgDll);
+// FreeLibrary(hKernelDll);
+ FreeLibrary(hGdiDll);
+
+ if(PopUpOptions.SkinPack) mir_free(PopUpOptions.SkinPack);
+ mir_free(PopUpOptions.Effect);
+
+ OptAdv_UnregisterVfx();
+ UnloadPopupThread();
+ UnloadPopupWnd2();
+ PopupHistoryUnload();
+
+ UnregisterClass (MAKEINTATOM(g_wndClass.cPopupWnd2),hInst);
+ UnregisterClassW(L"PopupEditBox",hInst);
+ UnregisterClass (MAKEINTATOM(g_wndClass.cPopupMenuHostWnd),hInst);
+ UnregisterClass (MAKEINTATOM(g_wndClass.cPopupThreadManagerWnd),hInst);
+ UnregisterClass (MAKEINTATOM(g_wndClass.cPopupPreviewBoxWndclass),hInst);
+ UnregisterClass (MAKEINTATOM(g_wndClass.cPopupPlusDlgBox),hInst);
+
+ UnloadGDIPlus();
+
+ UnloadActions();
+
+ CloseHandle(hMainThread);
+
+ return 0;
+}
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp new file mode 100644 index 0000000000..89cf7d8991 --- /dev/null +++ b/plugins/Popup/src/notifications.cpp @@ -0,0 +1,349 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/notifications.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+HANDLE g_hntfError, g_hntfWarning, g_hntfNotification;
+
+#define PopupNotificationData_SIGNATURE 0x11BEDA1A
+
+
+int TreeDataSortFunc(const POPUPTREEDATA *p1, const POPUPTREEDATA *p2)
+{
+ if (int cmp = lstrcmp(p1->pszTreeRoot, p2->pszTreeRoot))
+ return cmp;
+ return lstrcmp(p1->pszDescription, p2->pszDescription);
+
+}
+
+LIST<POPUPTREEDATA> gTreeData(20, TreeDataSortFunc);
+
+// interface
+void LoadNotifications()
+{
+ POPUPNOTIFICATION notification = {0};
+ notification.cbSize = sizeof(notification);
+ notification.actionCount = 0;
+ notification.lpActions = 0;
+
+ lstrcpynA(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
+ lstrcpynA(notification.lpzName, "Warning", sizeof(notification.lpzName));
+ notification.lchIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MB_WARN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED);
+ notification.colorBack = RGB(210,210,150);
+ notification.colorText = RGB(0,0,0);
+ notification.iSeconds = 10;
+ g_hntfWarning = RegisterNotification(¬ification);
+
+ lstrcpynA(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
+ lstrcpynA(notification.lpzName, "Notification", sizeof(notification.lpzName));
+ notification.lchIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MB_INFO), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED);
+ notification.colorBack = RGB(230,230,230);
+ notification.colorText = RGB(0,0,0);
+ notification.iSeconds = 7;
+ g_hntfNotification = RegisterNotification(¬ification);
+
+ lstrcpynA(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
+ lstrcpynA(notification.lpzName, "Error", sizeof(notification.lpzName));
+ notification.lchIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MB_STOP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED);
+ notification.colorBack = RGB(191,0,0);
+ notification.colorText = RGB(255,245,225);
+ notification.iSeconds = -1;
+ g_hntfError = RegisterNotification(¬ification);
+}
+
+void UnloadTreeData()
+{
+ for (int i = 0; i < gTreeData.getCount(); ++i) {
+ if(gTreeData[i]->typ == 2) {
+ mir_free(gTreeData[i]->pupClass.pszName);
+ mir_free(gTreeData[i]->pupClass.pszDescription);
+ }
+ mir_free(gTreeData[i]->pszTreeRoot);
+ mir_free(gTreeData[i]->pszDescription);
+ }
+ gTreeData.destroy();
+}
+
+void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
+{
+ if(ptd->typ == 1) {
+ char setting[2*MAXMODULELABELLENGTH];
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}Timeout",
+ ptd->notification.lpzGroup,
+ ptd->notification.lpzName);
+ DBWriteContactSettingWord(NULL, szModul, setting, ptd->notification.iSeconds);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}enabled",
+ ptd->notification.lpzGroup,
+ ptd->notification.lpzName);
+ DBWriteContactSettingByte(NULL, szModul, setting, ptd->enabled);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}TimeoutVal",
+ ptd->notification.lpzGroup,
+ ptd->notification.lpzName);
+ DBWriteContactSettingWord(NULL, szModul, setting, ptd->timeoutValue);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}disableWhen",
+ ptd->notification.lpzGroup,
+ ptd->notification.lpzName);
+ DBWriteContactSettingByte(NULL, szModul, setting, ptd->disableWhen);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction",
+ ptd->notification.lpzGroup,
+ ptd->notification.lpzName);
+ DBWriteContactSettingString(NULL, szModul, setting, ptd->leftAction);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction",
+ ptd->notification.lpzGroup,
+ ptd->notification.lpzName);
+ DBWriteContactSettingString(NULL, szModul, setting, ptd->rightAction);
+
+ for (int i = 0; i < ptd->notification.actionCount; ++i)
+ {
+ if (!lstrcmpA(ptd->leftAction, ptd->notification.lpActions[i].lpzTitle))
+ {
+ DBCONTACTWRITESETTING dbcws = {0};
+ dbcws.szModule = ptd->notification.lpActions[i].lpzLModule;
+ dbcws.szModule = ptd->notification.lpActions[i].lpzLSetting;
+ dbcws.value = ptd->notification.lpActions[i].dbvLData;
+ CallService(MS_DB_CONTACT_WRITESETTING, 0, (LPARAM)&dbcws);
+ }
+ if (!lstrcmpA(ptd->rightAction, ptd->notification.lpActions[i].lpzTitle))
+ {
+ DBCONTACTWRITESETTING dbcws = {0};
+ dbcws.szModule = ptd->notification.lpActions[i].lpzRModule;
+ dbcws.szModule = ptd->notification.lpActions[i].lpzRSetting;
+ dbcws.value = ptd->notification.lpActions[i].dbvRData;
+ CallService(MS_DB_CONTACT_WRITESETTING, 0, (LPARAM)&dbcws);
+ }
+ }
+ }
+}
+
+void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
+{
+ if(ptd->typ == 1) {
+ char setting[2*MAXMODULELABELLENGTH];
+ char *szTmp = NULL;
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ ptd->enabled =
+ (signed char)DBGetContactSettingByte(NULL, szModul, setting, TRUE);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ ptd->notification.iSeconds =
+ (signed char)DBGetContactSettingWord(NULL, szModul, setting, ptd->notification.iSeconds);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ ptd->timeoutValue =
+ (signed char)DBGetContactSettingWord(NULL, szModul, setting,
+ ptd->notification.iSeconds ? ptd->notification.iSeconds : 0);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ ptd->disableWhen =
+ DBGetContactSettingByte(NULL, szModul, setting, 0);
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ szTmp = DBGetContactSettingString(NULL, szModul, setting, ptd->notification.lpzLAction);
+ lstrcpynA(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
+ mir_free(szTmp); szTmp = NULL;
+
+ mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ szTmp = DBGetContactSettingString(NULL, szModul, setting, ptd->notification.lpzRAction);
+ lstrcpynA(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
+ mir_free(szTmp); szTmp = NULL;
+ }
+}
+
+HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
+{
+ POPUPTREEDATA *ptd = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
+ ptd->signature = PopupNotificationData_SIGNATURE;
+ ptd->typ = 1;
+ ptd->pszTreeRoot = mir_a2t(notification->lpzGroup);
+ ptd->pszDescription = mir_a2t(notification->lpzName);
+ ptd->notification = *notification;
+ if (!ptd->notification.lpzLAction) ptd->notification.lpzLAction = POPUP_ACTION_NOTHING;
+ if (!ptd->notification.lpzRAction) ptd->notification.lpzRAction = POPUP_ACTION_DISMISS;
+ LoadNotificationSettings(ptd, "PopUpNotifications");
+
+ // ugly hack to make reset always possible
+ SaveNotificationSettings(ptd,"PopUpNotifications");
+
+ FontID fontid = {0};
+ fontid.cbSize = sizeof(fontid);
+ mir_snprintf(fontid.group, sizeof(fontid.group), "%s/%s", PU_FNT_AND_COLOR, notification->lpzGroup);
+ lstrcpyA(fontid.dbSettingsGroup, "PopUpNotifications");
+ fontid.flags = FIDF_DEFAULTVALID;
+ fontid.deffontsettings.charset = DEFAULT_CHARSET;
+ fontid.deffontsettings.colour = ptd->notification.colorText;
+ fontid.deffontsettings.size = -11;
+ lstrcpyA(fontid.deffontsettings.szFace, "MS Shell Dlg");
+ fontid.deffontsettings.style = 0;
+ mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", notification->lpzName);
+ mir_snprintf(fontid.prefix, SIZEOF(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName);
+ fontid.deffontsettings.style = 0;
+ CallService(MS_FONT_REGISTER, (WPARAM)&fontid, 0);
+
+ ColourID colourid = {0};
+ colourid.cbSize = sizeof(colourid);
+ mir_snprintf(colourid.group, sizeof(colourid.group), "%s/%s", PU_FNT_AND_COLOR, notification->lpzGroup);
+ lstrcpyA(colourid.dbSettingsGroup, "PopUpNotifications");
+ mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", notification->lpzName);
+ mir_snprintf(colourid.setting, SIZEOF(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
+ colourid.defcolour = ptd->notification.colorBack;
+ CallService(MS_COLOUR_REGISTER, (WPARAM)&colourid, 0);
+
+ char section[MAXMODULELABELLENGTH], setting[MAXMODULELABELLENGTH];
+ mir_snprintf(section, sizeof(section), "PopUps/%s", notification->lpzGroup);
+ mir_snprintf(setting, sizeof(setting), "%s_%s_%s", MODULNAME, notification->lpzGroup, notification->lpzName);
+
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.pszSection = section;
+ sid.cx = sid.cy = 16;
+ sid.pszName = setting;
+ sid.pszDescription = notification->lpzName;
+ sid.hDefaultIcon = notification->lchIcon;
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+
+ gTreeData.insert(ptd);
+ return (HANDLE)ptd;
+}
+
+HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ)
+{
+ for(int i = 0; i < gTreeData.getCount(); i++) {
+ if( gTreeData[i]->typ == typ &&
+ (!group || (_tcscmp(gTreeData[i]->pszTreeRoot, group) == 0)) &&
+ (!name || (_tcscmp(gTreeData[i]->pszDescription, name) == 0)) )
+ {
+ return gTreeData[i];
+ }
+ }
+ return NULL;
+}
+
+void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen)
+{
+ if (!IsValidNotification(ppd->lchNotification)) {
+ *disableWhen = 0;
+ return;
+ }
+
+ POPUPTREEDATA *ptd = (POPUPTREEDATA *)ppd->lchNotification;
+
+ ppd->iSeconds = ptd->timeoutValue;
+ *disableWhen = ptd->enabled ? ptd->disableWhen : 0xFFFFFFFF;
+
+ LOGFONTA lf; //dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
+ FontID fontid = {0}; //use ansi version of fontID coz POPUPNOTIFICATION use char
+ fontid.cbSize = sizeof(fontid);
+ mir_snprintf(fontid.group, sizeof(fontid.group), "%s/%s", PU_FNT_AND_COLOR, ptd->notification.lpzGroup);
+ mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", ptd->notification.lpzName);
+ ppd->colorText = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fontid, (LPARAM)&lf);
+
+ ColourID colourid = {0}; //use ansi version of ColourID coz POPUPNOTIFICATION use char
+ colourid.cbSize = sizeof(colourid);
+ mir_snprintf(colourid.group, sizeof(colourid.group), "%s/%s", PU_FNT_AND_COLOR, ptd->notification.lpzGroup);
+ mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", ptd->notification.lpzName);
+ ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
+
+ char setting[MAXMODULELABELLENGTH];
+ mir_snprintf(setting, sizeof(setting), "%s_%s_%s", MODULNAME, ptd->notification.lpzGroup, ptd->notification.lpzName);
+ ppd->lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)setting);
+}
+
+bool IsValidNotification(HANDLE hNotification)
+{
+ if (!hNotification) return false;
+
+ bool res = false;
+ __try
+ {
+ if (((POPUPTREEDATA *)hNotification)->signature == PopupNotificationData_SIGNATURE)
+ res = true;
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ res = false;
+ }
+ return res;
+}
+
+bool PerformAction(HANDLE hNotification, HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
+{
+ if (!IsValidNotification(hNotification))
+ return false;
+
+ POPUPTREEDATA *ptd = (POPUPTREEDATA *)hNotification;
+ char *lpzAction = NULL;
+ switch (message)
+ {
+ case WM_LBUTTONUP:
+ case WM_COMMAND:
+ lpzAction = ptd->leftAction;
+ break;
+
+ case WM_RBUTTONUP:
+ case WM_CONTEXTMENU:
+ lpzAction = ptd->rightAction;
+ break;
+
+ default:
+ return false;
+ }
+
+ if (!lstrcmpA(lpzAction, POPUP_ACTION_NOTHING))
+ return true;
+
+ if (!lstrcmpA(lpzAction, POPUP_ACTION_DISMISS))
+ {
+ PUDeletePopUp(hwnd);
+ return true;
+ }
+
+ for (int i = 0; i < ptd->notification.actionCount; ++i)
+ {
+ if (!(ptd->notification.lpActions[i].dwFlags&PNAF_CALLBACK))
+ continue;
+ if (lstrcmpA(ptd->notification.lpActions[i].lpzTitle, lpzAction))
+ continue;
+
+ ptd->notification.lpActions[i].pfnCallback(hwnd, message, wparam, lparam,
+ ptd->notification.lpActions[i].dwCookie);
+ return true;
+ }
+
+ return false;
+}
diff --git a/plugins/Popup/src/notifications.h b/plugins/Popup/src/notifications.h new file mode 100644 index 0000000000..24e6a63362 --- /dev/null +++ b/plugins/Popup/src/notifications.h @@ -0,0 +1,73 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/notifications.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __notifications_h__
+#define __notifications_h__
+
+struct POPUPTREEDATA
+{
+ int cbSize;
+ DWORD signature;
+ LPTSTR pszTreeRoot;
+ LPTSTR pszDescription;
+ BYTE typ;
+ union {
+ POPUPNOTIFICATION notification;
+ POPUPCLASS pupClass;
+ };
+ BYTE enabled;
+ DWORD disableWhen;
+ int timeoutValue;
+ char leftAction[MAXMODULELABELLENGTH];
+ char rightAction[MAXMODULELABELLENGTH];
+ COLORREF colorBack; //realy needet ??
+ COLORREF colorText; //realy needet ??
+};
+
+extern LIST<POPUPTREEDATA> gTreeData;
+extern HANDLE g_hntfError, g_hntfWarning, g_hntfNotification;
+
+int TreeDataSortFunc(const POPUPTREEDATA *p1, const POPUPTREEDATA *p2);
+HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ);
+void UnloadTreeData();
+
+void LoadNotifications();
+HANDLE RegisterNotification(POPUPNOTIFICATION *notification);
+
+void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen);
+bool PerformAction(HANDLE hNotification, HWND hwnd, UINT message, WPARAM wparal, LPARAM lparam);
+bool IsValidNotification(HANDLE hNotification);
+
+void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul);
+void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul);
+
+#endif // __notifications_h__
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp new file mode 100644 index 0000000000..f8fcd5f619 --- /dev/null +++ b/plugins/Popup/src/opt_adv.cpp @@ -0,0 +1,762 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_adv.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+HWND hwndBox = NULL;
+
+INT_PTR CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK AlphaTrackBarWndProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+//effekt name for drop down box
+LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
+void OptAdv_RegisterVfx(char *name) {
+ g_lstPopupVfx.insert(mir_a2t(name));
+}
+
+void OptAdv_UnregisterVfx() {
+ for (int i = 0; i < g_lstPopupVfx.getCount(); ++i)
+ mir_free(g_lstPopupVfx[i]);
+ g_lstPopupVfx.destroy();
+}
+
+//Main Dialog Proc
+void LoadOption_AdvOpts() {
+ //History
+ PopUpOptions.EnableHistory = DBGetContactSettingByte (NULL,MODULNAME, "EnableHistory", TRUE);
+ PopUpOptions.HistorySize = DBGetContactSettingWord (NULL,MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
+ PopUpOptions.UseHppHistoryLog = DBGetContactSettingByte (NULL,MODULNAME, "UseHppHistoryLog", TRUE);
+ //Avatars
+ PopUpOptions.avatarBorders = DBGetContactSettingByte (NULL,MODULNAME, "AvatarBorders", TRUE);
+ PopUpOptions.avatarPNGBorders = DBGetContactSettingByte (NULL,MODULNAME, "AvatarPNGBorders", FALSE);
+ PopUpOptions.avatarRadius = DBGetContactSettingByte (NULL,MODULNAME, "AvatarRadius", 2);
+ PopUpOptions.avatarSize = DBGetContactSettingWord (NULL,MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
+ PopUpOptions.EnableAvatarUpdates = DBGetContactSettingByte (NULL,MODULNAME, "EnableAvatarUpdates", FALSE);
+ //Monitor
+ PopUpOptions.Monitor = DBGetContactSettingByte (NULL,MODULNAME, "Monitor", SETTING_MONITOR_DEFAULT);
+ //Transparency
+ PopUpOptions.Enable9xTransparency = DBGetContactSettingByte (NULL,MODULNAME, "EnableRegionTransparency", TRUE);
+ PopUpOptions.UseTransparency = DBGetContactSettingByte (NULL,MODULNAME, "UseTransparency", TRUE);
+ PopUpOptions.Alpha = DBGetContactSettingByte (NULL,MODULNAME, "Alpha", SETTING_ALPHA_DEFAULT);
+ PopUpOptions.OpaqueOnHover = DBGetContactSettingByte (NULL,MODULNAME, "OpaqueOnHover", TRUE);
+ //Effects
+ PopUpOptions.UseAnimations = DBGetContactSettingByte (NULL,MODULNAME, "UseAnimations", TRUE);
+ PopUpOptions.UseEffect = DBGetContactSettingByte (NULL,MODULNAME, "Fade", TRUE);
+ PopUpOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL,MODULNAME, "Effect", "", DBVT_TCHAR);
+ PopUpOptions.FadeIn = DBGetContactSettingDword(NULL,MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
+ PopUpOptions.FadeOut = DBGetContactSettingDword(NULL,MODULNAME, "FadeOutTime",SETTING_FADEOUTTIME_DEFAULT);
+ //other old stuff
+ PopUpOptions.MaxPopups = DBGetContactSettingWord (NULL,MODULNAME, "MaxPopups", 20);
+}
+
+INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+ TCHAR tstr[64];
+ static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+
+ switch (msg) {
+ case WM_INITDIALOG: {
+ HWND hCtrl = NULL;
+
+ //Create preview box:
+ {
+ hwndBox = CreateWindowEx(
+ WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
+ _T(BOXPREVIEW_WNDCLASS), // Class name
+ NULL, // Title
+ DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
+ CW_USEDEFAULT, // x
+ CW_USEDEFAULT, // y
+ CW_USEDEFAULT, // Width
+ CW_USEDEFAULT, // Height
+ HWND_DESKTOP, // Parent
+ NULL, // menu handle
+ hInst, // Instance
+ (LPVOID)0);
+ ShowWindow(hwndBox, SW_HIDE);
+ }
+ //Group: History
+ {
+ CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopUpOptions.EnableHistory);
+ SetDlgItemInt (hwnd, IDC_HISTORYSIZE, PopUpOptions.HistorySize, FALSE);
+ CheckDlgButton(hwnd, IDC_HPPLOG, PopUpOptions.UseHppHistoryLog);
+
+ hCtrl = GetDlgItem(hwnd, IDC_SHOWHISTORY);
+ SendMessage(hCtrl, BUTTONSETASFLATBTN, 0, 0);
+ SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)Translate("Popup History"), 0);
+ SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_HISTORY,0));
+
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopUpOptions.EnableHistory && gbHppInstalled);
+ }
+ //Group: Avatars
+ {
+ //Borders
+ CheckDlgButton(hwnd, IDC_AVT_BORDER, PopUpOptions.avatarBorders);
+ CheckDlgButton(hwnd, IDC_AVT_PNGBORDER, PopUpOptions.avatarPNGBorders);
+ EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopUpOptions.avatarBorders);
+ //Radius
+ SetDlgItemInt(hwnd, IDC_AVT_RADIUS, PopUpOptions.avatarRadius, FALSE);
+ SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN,UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopUpOptions.avatarSize / 2),0));
+ //Size
+ SetWindowLongPtr(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), GWLP_USERDATA, GetWindowLongPtr(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), GWLP_WNDPROC));
+ SetWindowLongPtr(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), GWLP_WNDPROC, (LONG_PTR)AvatarTrackBarWndProc);
+
+ SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETRANGE,FALSE,
+ MAKELONG(SETTING_AVTSIZE_MIN, SETTING_AVTSIZE_MAX) );
+ SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETPOS, TRUE,
+ max(PopUpOptions.avatarSize, SETTING_AVTSIZE_MIN));
+ SetDlgItemInt(hwnd, IDC_AVT_SIZE, PopUpOptions.avatarSize, FALSE);
+ //Request avatars
+ CheckDlgButton(hwnd, IDC_AVT_REQUEST, PopUpOptions.EnableAvatarUpdates);
+ }
+ //Group: Monitor
+ {
+ BOOL bMonitor = 0;
+#if defined(_UNICODE)
+ bMonitor = GetSystemMetrics(SM_CMONITORS)>1;
+#else
+ if(MyGetMonitorInfo) {
+ //os support multimonitor, check if monitor > 1
+ bMonitor = GetSystemMetrics(SM_CMONITORS)>1;
+ }
+#endif
+ CheckDlgButton(hwnd, IDC_MIRANDAWND, bMonitor ? (PopUpOptions.Monitor == MN_MIRANDA) : TRUE);
+ CheckDlgButton(hwnd, IDC_ACTIVEWND, bMonitor ? (PopUpOptions.Monitor == MN_ACTIVE) : FALSE);
+ EnableWindow(GetDlgItem(hwnd, IDC_GRP_MULTIMONITOR), bMonitor);
+ EnableWindow(GetDlgItem(hwnd, IDC_MULTIMONITOR_DESC), bMonitor);
+ EnableWindow(GetDlgItem(hwnd, IDC_MIRANDAWND), bMonitor);
+ EnableWindow(GetDlgItem(hwnd, IDC_ACTIVEWND), bMonitor);
+ }
+ //Group: Transparency
+ {
+ //9x/ME
+ CheckDlgButton(hwnd, IDC_TRANS_9X, PopUpOptions.Enable9xTransparency);
+ //EnableWindow(GetDlgItem(hwnd, IDC_TRANS_9X), !IsWinVer2000Plus());
+ ShowWindow(GetDlgItem(hwnd, IDC_TRANS_9X), IsWinVer2000Plus() ? SW_HIDE : SW_SHOW);
+ //win2k+
+ CheckDlgButton(hwnd, IDC_TRANS, PopUpOptions.UseTransparency);
+ SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1,255));
+ SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopUpOptions.Alpha);
+ SetWindowLongPtr(GetDlgItem(hwnd, IDC_TRANS_SLIDER), GWLP_USERDATA, GetWindowLongPtr(GetDlgItem(hwnd, IDC_TRANS_SLIDER), GWLP_WNDPROC));
+ SetWindowLongPtr(GetDlgItem(hwnd, IDC_TRANS_SLIDER), GWLP_WNDPROC, (LONG_PTR)AlphaTrackBarWndProc);
+ wsprintf(tstr, _T("%d%%"), Byte2Percentile(PopUpOptions.Alpha));
+ SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
+ CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopUpOptions.OpaqueOnHover);
+ {
+#if defined(_UNICODE)
+ BOOL how = TRUE;
+#else
+ BOOL how = (BOOL)(MySetLayeredWindowAttributes);
+#endif
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS) ,how);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER) ,how && PopUpOptions.UseTransparency);
+ }
+ ShowWindow(GetDlgItem(hwnd, IDC_TRANS), IsWinVer2000Plus() ? SW_SHOW : SW_HIDE);
+ }
+ //Group: Effects
+ {
+ //Use Animations
+ CheckDlgButton(hwnd, IDC_USEANIMATIONS, PopUpOptions.UseAnimations);
+ //Fade
+ SetDlgItemInt (hwnd, IDC_FADEIN, PopUpOptions.FadeIn, FALSE);
+ SetDlgItemInt (hwnd, IDC_FADEOUT,PopUpOptions.FadeOut,FALSE);
+ UDACCEL aAccels[] = {{0,50},{1,100},{3,500}};
+ SendDlgItemMessage(hwnd, IDC_FADEIN_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_FADEINTIME_MAX, SETTING_FADEINTIME_MIN));
+ SendDlgItemMessage(hwnd, IDC_FADEIN_SPIN, UDM_SETACCEL, (WPARAM)SIZEOF(aAccels), (LPARAM)&aAccels);
+ SendDlgItemMessage(hwnd, IDC_FADEOUT_SPIN,UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_FADEOUTTIME_MAX,SETTING_FADEOUTTIME_MIN));
+ SendDlgItemMessage(hwnd, IDC_FADEOUT_SPIN,UDM_SETACCEL, (WPARAM)SIZEOF(aAccels), (LPARAM)&aAccels);
+
+ BOOL how = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), how);
+ //effects drop down
+ {
+ DWORD dwItem, dwActiveItem = 0;
+
+#if defined(_UNICODE)
+ BOOL how = TRUE;
+#else
+ BOOL how = (BOOL)(MySetLayeredWindowAttributes) /*&& !PopUpOptions.UseAnimations*/;
+#endif
+ EnableWindow(GetDlgItem(hwnd, IDC_EFFECT), how);
+ EnableWindow(GetDlgItem(hwnd, IDC_EFFECT_TXT), how);
+
+ hCtrl = GetDlgItem(hwnd, IDC_EFFECT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("No effect")) ,-2);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Fade in/out")) ,-1);
+ dwActiveItem = (DWORD)PopUpOptions.UseEffect;
+ for (int i = 0; i < g_lstPopupVfx.getCount(); ++i) {
+ dwItem = ComboBox_AddString(hCtrl, TranslateTS(g_lstPopupVfx[i]));
+ ComboBox_SetItemData(hCtrl, dwItem, i);
+ if (PopUpOptions.UseEffect && !lstrcmp(g_lstPopupVfx[i], PopUpOptions.Effect))
+ dwActiveItem = dwItem;
+ }
+ SendDlgItemMessage(hwnd, IDC_EFFECT, CB_SETCURSEL, dwActiveItem, 0);
+ }
+ }
+
+ //later check stuff
+ {
+ SetDlgItemInt(hwnd, IDC_MAXPOPUPS, PopUpOptions.MaxPopups, FALSE);
+ }
+
+ TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ bDlgInit = true;
+ }//end WM_INITDIALOG
+ return TRUE;
+ case WM_HSCROLL: {
+ UINT idCtrl = GetDlgCtrlID((HWND)lParam);
+ switch (idCtrl) {
+ case IDC_AVT_SIZE_SLIDE:
+ {
+ PopUpOptions.avatarSize = SendDlgItemMessage(hwnd,IDC_AVT_SIZE_SLIDE, TBM_GETPOS,0,0);
+ SetDlgItemInt(hwnd, IDC_AVT_SIZE ,PopUpOptions.avatarSize,FALSE);
+ SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN,UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopUpOptions.avatarSize / 2),0));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_TRANS_SLIDER:
+ {
+ PopUpOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd,IDC_TRANS_SLIDER, TBM_GETPOS, 0,0);
+ wsprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopUpOptions.Alpha));
+ SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ default:
+ break;
+ }// end switch idCtrl
+ }//end WM_HSCROLL
+ break;
+ case WM_COMMAND: {
+ UINT idCtrl = LOWORD(wParam);
+ switch (HIWORD(wParam)) {
+ case BN_CLICKED: //Button controls
+ switch(idCtrl) {
+ case IDC_ENABLE_HISTORY:
+ {
+ PopUpOptions.EnableHistory = !PopUpOptions.EnableHistory;
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopUpOptions.EnableHistory);
+ EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopUpOptions.EnableHistory && gbHppInstalled);
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_SHOWHISTORY:
+ {
+ PopupHistoryShow();
+ }
+ break;
+ case IDC_HPPLOG:
+ {
+ PopUpOptions.UseHppHistoryLog = !PopUpOptions.UseHppHistoryLog;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_AVT_BORDER:
+ {
+ PopUpOptions.avatarBorders = !PopUpOptions.avatarBorders;
+ EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopUpOptions.avatarBorders);
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_AVT_PNGBORDER:
+ {
+ PopUpOptions.avatarPNGBorders = !PopUpOptions.avatarPNGBorders;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_AVT_REQUEST:
+ {
+ PopUpOptions.EnableAvatarUpdates = !PopUpOptions.EnableAvatarUpdates;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_MIRANDAWND:
+ {
+ PopUpOptions.Monitor = MN_MIRANDA;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_ACTIVEWND:
+ {
+ PopUpOptions.Monitor = MN_ACTIVE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_TRANS_9X:
+ {
+ PopUpOptions.Enable9xTransparency = !PopUpOptions.Enable9xTransparency;
+ SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
+ }
+ break;
+ case IDC_TRANS:
+ {
+ PopUpOptions.UseTransparency = !PopUpOptions.UseTransparency;
+#if defined(_UNICODE)
+ BOOL how = TRUE;
+#else
+ BOOL how = (BOOL)(MySetLayeredWindowAttributes);
+#endif
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT) ,how && PopUpOptions.UseTransparency);
+ EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER) ,how && PopUpOptions.UseTransparency);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_TRANS_OPAQUEONHOVER:
+ {
+ PopUpOptions.OpaqueOnHover = !PopUpOptions.OpaqueOnHover;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_USEANIMATIONS:
+ {
+ PopUpOptions.UseAnimations = !PopUpOptions.UseAnimations;
+ BOOL enable = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), enable);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_PREVIEW:
+ {
+ PopUpPreview();
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case CBN_SELCHANGE: //ComboBox controls
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_EFFECT:
+ {
+ int iEffect = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
+ PopUpOptions.UseEffect = (iEffect != -2) ? TRUE : FALSE;
+ mir_free(PopUpOptions.Effect);
+ PopUpOptions.Effect = mir_tstrdup((iEffect >= 0) ? g_lstPopupVfx[iEffect] : _T(""));
+
+ BOOL enable = PopUpOptions.UseAnimations || PopUpOptions.UseEffect;
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT2), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT1), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), enable);
+ EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), enable);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case EN_CHANGE: //Edit controls change
+ if(!bDlgInit) break;
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_MAXPOPUPS:
+ {
+ int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if(maxPop > 0){
+ PopUpOptions.MaxPopups = maxPop;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_HISTORYSIZE:
+ {
+ int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if( histSize > 0 &&
+ histSize <= SETTING_HISTORYSIZE_MAX){
+ PopUpOptions.HistorySize = histSize;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_AVT_RADIUS:
+ {
+ int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if( avtRadius <= SETTING_AVTSIZE_MAX / 2 ){
+ PopUpOptions.avatarRadius = avtRadius;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_FADEIN:
+ {
+ int fadeIn = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if( fadeIn >= SETTING_FADEINTIME_MIN &&
+ fadeIn <= SETTING_FADEINTIME_MAX ){
+ PopUpOptions.FadeIn = fadeIn;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_FADEOUT:
+ {
+ int fadeOut = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if( fadeOut >= SETTING_FADEOUTTIME_MIN &&
+ fadeOut <= SETTING_FADEOUTTIME_MAX){
+ PopUpOptions.FadeOut = fadeOut;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ break;
+ case EN_KILLFOCUS: //Edit controls lost fokus
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_MAXPOPUPS:
+ {
+ int maxPop = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if(maxPop <= 0)
+ PopUpOptions.MaxPopups = 20;
+ if(maxPop != PopUpOptions.MaxPopups) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MaxPopups, FALSE);
+ //ErrorMSG(1);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_HISTORYSIZE:
+ {
+ int histSize = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if(histSize <= 0)
+ PopUpOptions.HistorySize = SETTING_HISTORYSIZE_DEFAULT;
+ else if(histSize > SETTING_HISTORYSIZE_MAX)
+ PopUpOptions.HistorySize = SETTING_HISTORYSIZE_MAX;
+ if(histSize != PopUpOptions.HistorySize) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.HistorySize, FALSE);
+ ErrorMSG(1, SETTING_HISTORYSIZE_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_AVT_RADIUS:
+ {
+ int avtRadius = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if(avtRadius > SETTING_AVTSIZE_MAX / 2)
+ PopUpOptions.avatarRadius = SETTING_AVTSIZE_MAX / 2;
+ if(avtRadius != PopUpOptions.avatarRadius) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.avatarRadius, FALSE);
+ ErrorMSG(0, SETTING_AVTSIZE_MAX / 2);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_FADEIN:
+ {
+ int fade = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if(fade < SETTING_FADEINTIME_MIN)
+ PopUpOptions.FadeIn = SETTING_FADEINTIME_MIN;
+ else if(fade > SETTING_FADEINTIME_MAX)
+ PopUpOptions.FadeIn = SETTING_FADEINTIME_MAX;
+ if(fade != PopUpOptions.FadeIn) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.FadeIn, FALSE);
+ ErrorMSG(SETTING_FADEINTIME_MIN, SETTING_FADEINTIME_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_FADEOUT:
+ {
+ int fade = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if(fade < SETTING_FADEOUTTIME_MIN)
+ PopUpOptions.FadeOut = SETTING_FADEOUTTIME_MIN;
+ else if(fade > SETTING_FADEOUTTIME_MAX)
+ PopUpOptions.FadeOut = SETTING_FADEOUTTIME_MAX;
+ if(fade != PopUpOptions.FadeOut) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.FadeOut, FALSE);
+ ErrorMSG(SETTING_FADEOUTTIME_MIN, SETTING_FADEOUTTIME_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ break;
+ default:
+ break;
+ }// end switch (HIWORD(wParam))
+ }//end WM_COMMAND
+ break;
+ case WM_NOTIFY: {
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0: {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOption_AdvOpts();
+ return TRUE;
+ case PSN_APPLY:
+ {
+ //History
+ DBWriteContactSettingByte (NULL,MODULNAME, "EnableHistory", (BYTE)PopUpOptions.EnableHistory);
+ DBWriteContactSettingWord (NULL,MODULNAME, "HistorySize", PopUpOptions.HistorySize);
+ PopupHistoryResize();
+ DBWriteContactSettingByte (NULL,MODULNAME, "UseHppHistoryLog", PopUpOptions.UseHppHistoryLog);
+ //Avatars
+ DBWriteContactSettingByte (NULL,MODULNAME, "AvatarBorders", PopUpOptions.avatarBorders);
+ DBWriteContactSettingByte (NULL,MODULNAME, "AvatarPNGBorders", PopUpOptions.avatarPNGBorders);
+ DBWriteContactSettingByte (NULL,MODULNAME, "AvatarRadius", PopUpOptions.avatarRadius);
+ DBWriteContactSettingWord (NULL,MODULNAME, "AvatarSize", PopUpOptions.avatarSize);
+ DBWriteContactSettingByte (NULL,MODULNAME, "EnableAvatarUpdates", PopUpOptions.EnableAvatarUpdates);
+ //Monitor
+ DBWriteContactSettingByte (NULL,MODULNAME, "Monitor", PopUpOptions.Monitor);
+ //Transparency
+ DBWriteContactSettingByte (NULL,MODULNAME, "EnableRegionTransparency", PopUpOptions.Enable9xTransparency);
+ DBWriteContactSettingByte (NULL,MODULNAME, "UseTransparency", PopUpOptions.UseTransparency);
+ DBWriteContactSettingByte (NULL,MODULNAME, "Alpha", PopUpOptions.Alpha);
+ DBWriteContactSettingByte (NULL,MODULNAME, "OpaqueOnHover", PopUpOptions.OpaqueOnHover);
+
+ //Effects
+ DBWriteContactSettingByte (NULL,MODULNAME, "UseAnimations", PopUpOptions.UseAnimations);
+ DBWriteContactSettingByte (NULL,MODULNAME, "Fade", PopUpOptions.UseEffect);
+ DBWriteContactSettingTString(NULL, MODULNAME, "Effect", PopUpOptions.Effect);
+ DBWriteContactSettingDword(NULL,MODULNAME, "FadeInTime", PopUpOptions.FadeIn);
+ DBWriteContactSettingDword(NULL,MODULNAME, "FadeOutTime", PopUpOptions.FadeOut);
+ //other old stuff
+ DBWriteContactSettingWord (NULL,MODULNAME, "MaxPopups", (BYTE)PopUpOptions.MaxPopups);
+ }
+ return TRUE;
+ default:
+ break;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }//end WM_NOTIFY
+ break;
+ case WM_DESTROY:
+ {
+ bDlgInit = false;
+ }//end WM_DESTROY
+ break;
+ default:
+ return FALSE;
+ }//end switch (msg)
+ return FALSE;
+}
+
+INT_PTR CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (!IsWindowEnabled(hwnd))
+ return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+
+ static int oldVal = -1;
+ switch (msg) {
+ case WM_MOUSEWHEEL:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ {
+ if (!IsWindowVisible(hwndBox))
+ break;
+ }
+ case WM_MOUSEMOVE:
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ tme.hwndTrack = hwnd;
+ _TrackMouseEvent(&tme);
+
+ int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ if (oldVal != newVal) {
+ if (oldVal < 0) {
+ SetWindowLongPtr(hwndBox, GWLP_USERDATA, 0);
+ }
+ RECT rc; GetWindowRect(hwnd, &rc);
+ SetWindowPos(hwndBox, NULL,
+ (rc.left+rc.right-newVal)/2, rc.bottom+2, newVal, newVal,
+ SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+
+ HRGN rgn = CreateRoundRectRgn(0, 0, newVal, newVal, 2 * PopUpOptions.avatarRadius, 2 * PopUpOptions.avatarRadius);
+ SetWindowRgn(hwndBox, rgn, TRUE);
+ InvalidateRect(hwndBox, NULL, FALSE);
+ oldVal = newVal;
+ }
+ }
+ break;
+ case WM_MOUSELEAVE:
+ {
+/*
+ SetWindowLongPtr(hwndBox, GWLP_USERDATA, 2);
+ SetWindowPos(hwndBox, NULL,
+ 0, 0, 201, 201,
+ SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+
+ HRGN hrgnWindow, hrgnTmp, hrgnTmp2;
+ hrgnWindow = CreateRectRgn(0, 0, 201, 201);
+ hrgnTmp = CreateEllipticRgn(-90, -90, 90, 90);
+ SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
+ hrgnTmp = CreateEllipticRgn(112, -90, 292, 90);
+ SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
+ hrgnTmp = CreateEllipticRgn(-90, 112, 90, 292);
+ SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
+ hrgnTmp = CreateEllipticRgn(112, 112, 292, 292);
+ SubtractRgn(hrgnWindow, hrgnWindow, hrgnTmp);
+
+ hrgnTmp = CreateRectRgn(5, 5, 196, 196);
+ hrgnTmp2 = CreateRoundRectRgn(89, 0, 113, 201, 8, 8);
+ UnionRgn(hrgnTmp, hrgnTmp, hrgnTmp2);
+ hrgnTmp2 = CreateRoundRectRgn(0, 89, 201, 113, 8, 8);
+ UnionRgn(hrgnTmp, hrgnTmp, hrgnTmp2);
+ IntersectRgn(hrgnWindow, hrgnWindow, hrgnTmp);
+
+ SetWindowRgn(hwndBox, hrgnWindow, FALSE);
+
+ if (MySetLayeredWindowAttributes)
+ {
+ SetWindowLong(hwndBox, GWL_EXSTYLE, GetWindowLong(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
+ MySetLayeredWindowAttributes(hwndBox, NULL, PopUpOptions.Alpha, LWA_ALPHA);
+ }
+*/
+ SetWindowRgn(hwndBox, NULL, TRUE);
+ ShowWindow(hwndBox, SW_HIDE);
+ oldVal = -1;
+ }
+ break;
+ default:
+ break;
+ }
+ return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+}
+
+INT_PTR CALLBACK AlphaTrackBarWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (!IsWindowEnabled(hwnd))
+ return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+
+ static int oldVal = -1;
+ switch (msg)
+ {
+ case WM_MOUSEWHEEL:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ {
+ if (!IsWindowVisible(hwndBox))
+ break;
+ }
+ case WM_MOUSEMOVE:
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ tme.hwndTrack = hwnd;
+ _TrackMouseEvent(&tme);
+
+ int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ if (oldVal != newVal)
+ {
+#if defined(_UNICODE)
+ if (oldVal < 0)
+ {
+ SetWindowLongPtr(hwndBox, GWLP_USERDATA, 1);
+ RECT rc; GetWindowRect(hwnd, &rc);
+ SetWindowPos(hwndBox, NULL,
+ (rc.left+rc.right-170)/2, rc.bottom+2, 170, 50,
+ SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ SetWindowRgn(hwndBox, NULL, TRUE);
+ }
+ SetWindowLong(hwndBox, GWL_EXSTYLE, GetWindowLong(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(hwndBox, NULL, newVal, LWA_ALPHA);
+#else
+ if (MySetLayeredWindowAttributes)
+ {
+ if (oldVal < 0)
+ {
+ SetWindowLongPtr(hwndBox, GWLP_USERDATA, 1);
+ RECT rc; GetWindowRect(hwnd, &rc);
+ SetWindowPos(hwndBox, NULL,
+ (rc.left+rc.right-170)/2, rc.bottom+2, 170, 50,
+ SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ SetWindowRgn(hwndBox, NULL, TRUE);
+ }
+ SetWindowLong(hwndBox, GWL_EXSTYLE, GetWindowLong(hwndBox, GWL_EXSTYLE) | WS_EX_LAYERED);
+ MySetLayeredWindowAttributes(hwndBox, NULL, newVal, LWA_ALPHA);
+ }
+#endif
+ oldVal = newVal;
+ }
+ break;
+ }
+ case WM_MOUSELEAVE:
+ {
+#if defined(_UNICODE)
+ SetWindowLong(hwndBox, GWL_EXSTYLE, GetWindowLong(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetLayeredWindowAttributes(hwndBox, NULL, 255, LWA_ALPHA);
+#else
+ if (MySetLayeredWindowAttributes) {
+ SetWindowLong(hwndBox, GWL_EXSTYLE, GetWindowLong(hwndBox, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ MySetLayeredWindowAttributes(hwndBox, NULL, 255, LWA_ALPHA);
+ }
+#endif
+ ShowWindow(hwndBox, SW_HIDE);
+ oldVal = -1;
+ break;
+ }
+ }
+ return CallWindowProc((WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
+}
+
diff --git a/plugins/Popup/src/opt_adv.h b/plugins/Popup/src/opt_adv.h new file mode 100644 index 0000000000..0e3a26a0da --- /dev/null +++ b/plugins/Popup/src/opt_adv.h @@ -0,0 +1,45 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_adv.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_adv_h__
+#define __opt_adv_h__
+
+extern HWND hwndBox;
+
+void OptAdv_RegisterVfx(char *name);
+void OptAdv_UnregisterVfx();
+
+void LoadOption_AdvOpts();
+INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND, UINT, WPARAM, LPARAM);
+
+
+#endif // __opt_adv_h__
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp new file mode 100644 index 0000000000..b6376b88c0 --- /dev/null +++ b/plugins/Popup/src/opt_class.cpp @@ -0,0 +1,603 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+part of this file is taken from SjE great YAPP plugin:
+https://server.scottellis.com.au/svn/mim_plugs/yapp/options.cpp
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_class.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+#include "headers.h"
+
+//---------------------------------------------------------------------------
+//Workaround for MS bug ComboBox_SelectItemData
+int ComboBox_SelectItem(HWND hwndCtl, int indexStart, char* data) {
+ int i = 0;
+ for ( i ; i < ComboBox_GetCount(hwndCtl); i++) {
+ if(strcmp(data, (char*)ComboBox_GetItemData(hwndCtl, i))==0) {
+ ComboBox_SetCurSel (hwndCtl,i);
+ return i;
+ }
+ }
+ return CB_ERR;
+}
+
+//---------------------------------------------------------------------------
+//some help function (not realy needed)
+#define ComboBox_AddStringW(hwndCtl, lpwsz) ((int)(DWORD)MySendMessageW((HWND)(hwndCtl), CB_ADDSTRING, 0L, (LPARAM)(LPCWSTR)(lpwsz)))
+#define ComboBox_SetTextW(hwndCtl, lpwsz) ((int)(DWORD)MySetWindowTextW((HWND)(hwndCtl), (LPCWSTR)(lpwsz)))
+
+//---------------------------------------------------------------------------
+//Dialog Proc
+INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+ static TVITEM tvi = {0};
+ static struct {
+ UINT idCtrl;
+ BYTE onTyp0;
+ BYTE onTyp1;
+ BYTE onTyp2;
+ } ctrlsAll[] = {
+ {IDC_TXT_TITLE1 ,0 ,1 ,1},
+ {IDC_ENABLE ,0 ,1 ,1},
+
+ {IDC_TXT_TIMEOUT ,0 ,1 ,1},
+ {IDC_TIMEOUT ,0 ,1 ,1},
+ {IDC_TIMEOUT_SPIN ,0 ,1 ,1},
+ {IDC_TXT_TIMEOUT_SEC ,0 ,1 ,1},
+ {IDC_TXT_TIMEOUT_DEFAULT ,0 ,1 ,1},
+ {IDC_TXT_TIMEOUT_INFINITE ,0 ,1 ,1},
+
+ {IDC_TXT_LACTION ,0 ,1 ,1},
+ {IDC_LACTION ,0 ,1 ,1},
+
+ {IDC_TXT_RACTION ,0 ,1 ,1},
+ {IDC_RACTION ,0 ,1 ,1},
+
+ {IDC_CHECKWINDOW ,0 ,0 ,0}, //may be delete ??
+
+ {IDC_TXT_TITLE3 ,0 ,1 ,0},
+ {IDC_SOFFLINE ,0 ,1 ,0},
+ {IDC_SONLINE ,0 ,1 ,0},
+ {IDC_SAWAY ,0 ,1 ,0},
+ {IDC_SNA ,0 ,1 ,0},
+ {IDC_SOCCUPIED ,0 ,1 ,0},
+ {IDC_SDND ,0 ,1 ,0},
+ {IDC_SFREE4CHAT ,0 ,1 ,0},
+ {IDC_SINVISIBLE ,0 ,1 ,0},
+ {IDC_SPHONE ,0 ,1 ,0},
+ {IDC_SLUNCH ,0 ,1 ,0},
+
+ {IDC_TXT_TITLE4 ,0 ,0 ,0},
+ {IDC_SOFFLINE2 ,0 ,0 ,0},
+ {IDC_SONLINE2 ,0 ,0 ,0},
+ {IDC_SAWAY2 ,0 ,0 ,0},
+ {IDC_SNA2 ,0 ,0 ,0},
+ {IDC_SOCCUPIED2 ,0 ,0 ,0},
+ {IDC_SDND2 ,0 ,0 ,0},
+ {IDC_SFREE4CHAT2 ,0 ,0 ,0},
+ {IDC_SINVISIBLE2 ,0 ,0 ,0},
+ {IDC_SPHONE2 ,0 ,0 ,0},
+ {IDC_SLUNCH2 ,0 ,0 ,0},
+
+ {IDC_ICO_INFO ,0 ,1 ,1},
+ {IDC_TXT_COLORS ,0 ,1 ,1},
+ {IDC_MORE ,0 ,1 ,1},
+
+ {IDC_PREVIEW ,0 ,1 ,1},
+ };
+
+ static UINT ctrlsClass[] = {
+ IDC_TXT_TITLE1, /*IDC_TXT_TITLE3,*/
+ IDC_TXT_TIMEOUT, IDC_TIMEOUT,
+ IDC_TIMEOUT_SPIN, IDC_TXT_TIMEOUT_SEC,
+ IDC_TXT_TIMEOUT_DEFAULT, IDC_TXT_TIMEOUT_INFINITE,
+ IDC_TXT_LACTION, IDC_LACTION,
+ IDC_TXT_RACTION, IDC_RACTION,
+ IDC_ICO_INFO, IDC_TXT_COLORS,
+ };
+
+ static UINT ctrlsEnable[] = {
+ IDC_TXT_TIMEOUT, IDC_TIMEOUT, IDC_TIMEOUT_SPIN,
+ IDC_TXT_TIMEOUT_SEC , IDC_TXT_TIMEOUT_DEFAULT, IDC_TXT_TIMEOUT_INFINITE,
+ IDC_TXT_LACTION, IDC_LACTION,
+ IDC_TXT_RACTION, IDC_RACTION,
+ /*IDC_CHECKWINDOW,*/ IDC_TXT_TITLE3, IDC_TXT_TITLE4,
+ IDC_ICO_INFO, IDC_TXT_COLORS, IDC_MORE,
+
+ IDC_SOFFLINE, IDC_SONLINE, IDC_SAWAY, IDC_SNA,
+ IDC_SOCCUPIED, IDC_SDND, IDC_SFREE4CHAT,
+ IDC_SINVISIBLE, IDC_SPHONE, IDC_SLUNCH,
+
+ IDC_SOFFLINE2, IDC_SONLINE2, IDC_SAWAY2, IDC_SNA2,
+ IDC_SOCCUPIED2, IDC_SDND2, IDC_SFREE4CHAT2,
+ IDC_SINVISIBLE2, IDC_SPHONE2, IDC_SLUNCH2,
+ };
+
+ static UINT ctrlsContact[] = {
+ /*IDC_CHECKWINDOW,*/ IDC_TXT_TITLE4,
+ IDC_SOFFLINE2, IDC_SONLINE2, IDC_SAWAY2, IDC_SNA2,
+ IDC_SOCCUPIED2, IDC_SDND2, IDC_SFREE4CHAT2,
+ IDC_SINVISIBLE2, IDC_SPHONE2, IDC_SLUNCH2,
+ };
+
+ static int titleIds[] = {
+ IDC_TXT_TITLE1,
+ IDC_TXT_TITLE3,
+ IDC_TXT_TITLE4,
+ };
+
+ static struct {
+ int idCtrl;
+ int iconId;
+ char *title;
+ DWORD statusFlag;
+ DWORD disableWhenFlag;
+ } statusButtons[] = {
+ {IDC_SOFFLINE, SKINICON_STATUS_OFFLINE, "Offline", PF2_IDLE, PF2_IDLE},
+ {IDC_SONLINE, SKINICON_STATUS_ONLINE, "Online", PF2_ONLINE, PF2_ONLINE},
+ {IDC_SAWAY, SKINICON_STATUS_AWAY, "Away", PF2_SHORTAWAY, PF2_SHORTAWAY},
+ {IDC_SNA, SKINICON_STATUS_NA, "NA", PF2_LONGAWAY, PF2_LONGAWAY},
+ {IDC_SOCCUPIED, SKINICON_STATUS_OCCUPIED, "Occupied", PF2_LIGHTDND, PF2_LIGHTDND},
+ {IDC_SDND, SKINICON_STATUS_DND, "DND", PF2_HEAVYDND, PF2_HEAVYDND},
+ {IDC_SFREE4CHAT, SKINICON_STATUS_FREE4CHAT, "Free for chat", PF2_FREECHAT, PF2_FREECHAT},
+ {IDC_SINVISIBLE, SKINICON_STATUS_INVISIBLE, "Invisible", PF2_INVISIBLE, PF2_INVISIBLE},
+ {IDC_SPHONE, SKINICON_STATUS_ONTHEPHONE, "On the phone", PF2_ONTHEPHONE, PF2_ONTHEPHONE},
+ {IDC_SLUNCH, SKINICON_STATUS_OUTTOLUNCH, "Out to lunch", PF2_OUTTOLUNCH, PF2_OUTTOLUNCH},
+
+ {IDC_SOFFLINE2, SKINICON_STATUS_OFFLINE, "Offline", PF2_IDLE, PF2_IDLE<<16},
+ {IDC_SONLINE2, SKINICON_STATUS_ONLINE, "Online", PF2_ONLINE, PF2_ONLINE<<16},
+ {IDC_SAWAY2, SKINICON_STATUS_AWAY, "Away", PF2_SHORTAWAY, PF2_SHORTAWAY<<16},
+ {IDC_SNA2, SKINICON_STATUS_NA, "NA", PF2_LONGAWAY, PF2_LONGAWAY<<16},
+ {IDC_SOCCUPIED2, SKINICON_STATUS_OCCUPIED, "Occupied", PF2_LIGHTDND, PF2_LIGHTDND<<16},
+ {IDC_SDND2, SKINICON_STATUS_DND, "DND", PF2_HEAVYDND, PF2_HEAVYDND<<16},
+ {IDC_SFREE4CHAT2, SKINICON_STATUS_FREE4CHAT, "Free for chat", PF2_FREECHAT, PF2_FREECHAT<<16},
+ {IDC_SINVISIBLE2, SKINICON_STATUS_INVISIBLE, "Invisible", PF2_INVISIBLE, PF2_INVISIBLE<<16},
+ {IDC_SPHONE2, SKINICON_STATUS_ONTHEPHONE, "On the phone", PF2_ONTHEPHONE, PF2_ONTHEPHONE<<16},
+ {IDC_SLUNCH2, SKINICON_STATUS_OUTTOLUNCH, "Out to lunch", PF2_OUTTOLUNCH, PF2_OUTTOLUNCH<<16},
+ };
+
+
+ switch ( msg ) {
+ case WM_INITDIALOG:
+ {
+ int i;
+ TranslateDialogDefault( hwnd );
+
+ //Treeview
+ HWND hwndTree = GetDlgItem(hwnd, IDC_TREE1);
+ {
+ int iconIndex = 0;
+ char iconName[MAXMODULELABELLENGTH];
+ TCHAR itemName[MAXMODULELABELLENGTH];
+ TreeView_DeleteAllItems(hwndTree);
+ //Treeview create image list
+ HIMAGELIST hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR|ILC_COLOR32|ILC_MASK, 5, num_classes+1);
+ ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(ICO_OPT_GROUP,0));
+ TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
+
+ for (i = 0; i < gTreeData.getCount(); ++i) {
+ switch (gTreeData[i]->typ) {
+ case 1: //Treeview part for typ 1 (notification)
+ mir_snprintf(iconName, sizeof(iconName), "%s_"TCHAR_STR_PARAM"_"TCHAR_STR_PARAM, MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
+ iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(iconName));
+ wsprintf(itemName, _T("%s/%s"), gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
+ break;
+ case 2: //Treeview part typ 2 (popup class api)
+ iconIndex = ImageList_ReplaceIcon(hImgLst, -1, gTreeData[i]->pupClass.hIcon);
+ wsprintf(itemName, _T("%s/%s"), _T("CLASS Plugins")/*gTreeData[i]->pszTreeRoot*/, gTreeData[i]->pszDescription);
+ break;
+ default:
+ break;
+ }
+ OptTree_AddItem(hwndTree, itemName, (LPARAM)gTreeData[i], iconIndex);
+ }
+ OptTree_Translate(hwndTree);
+ } // end Treeview
+
+ //Bold Title
+ for (i = 0; i < SIZEOF(titleIds); ++i)
+ {
+ LOGFONT lf;
+ GetObject((HFONT)SendDlgItemMessage(hwnd, titleIds[i], WM_GETFONT, 0, 0), sizeof(lf), &lf);
+ lf.lfWeight = FW_BOLD;
+ SendDlgItemMessage(hwnd, titleIds[i], WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);
+ }
+
+ //spindown for Timeout
+ SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_INFINITE));
+ SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)0, TRUE);
+ //status buttons
+ for (i = 0; i < SIZEOF(statusButtons); ++i)
+ {
+ SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONSETASPUSHBTN, 0, 0);
+ SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BM_SETIMAGE,
+ IMAGE_ICON, (LPARAM)LoadSkinnedIcon(statusButtons[i].iconId));
+ SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONADDTOOLTIP,
+ (WPARAM)Translate(statusButtons[i].title), 0);
+ }
+ //info icon
+ SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY,0), 0);
+ //more button
+ EnableWindow(GetDlgItem(hwnd, IDC_MORE), FALSE);
+ //preview button
+ ShowWindow(GetDlgItem(hwnd, IDC_CHECKWINDOW), SW_HIDE);
+
+ SendMessage(hwnd, WM_USER, 0, 0);
+
+ return TRUE;
+ }
+ case WM_USER:
+ {
+ int i;
+ HWND hTV = GetDlgItem(hwnd, IDC_TREE1);
+ //get TreeView selection
+ tvi.hItem = TreeView_GetSelection(hTV);
+ tvi.mask = TVIF_PARAM|TVIF_HANDLE|TVIF_TEXT;
+ if (tvi.hItem) TreeView_GetItem(hTV, &tvi);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, tvi.lParam);
+
+ if (tvi.lParam) {
+ POPUPTREEDATA* ptd = (POPUPTREEDATA *)tvi.lParam;
+ HWND hCtrl = 0;
+ LPTSTR psztSelect = NULL;
+ int index = 0;
+ //combo left action (default)
+ {
+ hCtrl = GetDlgItem(hwnd, IDC_LACTION);
+ ComboBox_ResetContent(hCtrl);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)),POPUP_ACTION_DISMISS);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)),POPUP_ACTION_NOTHING);
+ }
+ //combo right action (default)
+ {
+ hCtrl = GetDlgItem(hwnd, IDC_RACTION);
+ ComboBox_ResetContent(hCtrl);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)),POPUP_ACTION_DISMISS);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)),POPUP_ACTION_NOTHING);
+ }
+
+ //element typ1 (Notification)
+ if (ptd->typ == 1) {
+ LPTSTR psztAction = NULL;
+ //Timeout
+ SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
+ SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
+ //combo left action (EXTRA)
+ hCtrl = GetDlgItem(hwnd, IDC_LACTION);
+ for (i = 0; i < ptd->notification.actionCount; ++i) {
+ psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)),ptd->notification.lpActions[i].lpzTitle);
+ mir_free(psztAction); psztAction = NULL;
+ }
+ //combo right action (EXTRA)
+ hCtrl = GetDlgItem(hwnd, IDC_RACTION);
+ psztAction = NULL;
+ for (i = 0; i < ptd->notification.actionCount; ++i) {
+ psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)),ptd->notification.lpActions[i].lpzTitle);
+ mir_free(psztAction); psztAction = NULL;
+ }
+ //enable all controls
+ for (i = 0; i < SIZEOF(ctrlsAll); ++i){
+ ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1 ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1);
+ }
+ //enable or disable controls ctrlsEnable
+ for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
+ EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled ? TRUE : FALSE);
+ //show or hide controls ctrlsContact
+ for (i = 0; i < SIZEOF(ctrlsContact); ++i)
+ ShowWindow(GetDlgItem(hwnd, ctrlsContact[i]), ptd->notification.dwFlags&PNF_CONTACT ? SW_SHOW : SW_HIDE);
+ //statusButtons state
+ for (i = 0; i < SIZEOF(statusButtons); ++i)
+ CheckDlgButton(hwnd, statusButtons[i].idCtrl, ptd->disableWhen & statusButtons[i].disableWhenFlag ? TRUE : FALSE);
+ }
+ //element typ2 (CLASS Plugins)
+ else if (ptd->typ == 2) {
+ //Timeout
+ SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
+ SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
+ //enable ctrls
+ for (i = 0; i < SIZEOF(ctrlsAll); ++i){
+ ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2 ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2);
+ }
+ }
+ //checkbox enable notify
+ CheckDlgButton(hwnd, IDC_ENABLE, ptd->enabled ? TRUE : FALSE);
+ //combo left action (SELECT)
+ hCtrl = GetDlgItem(hwnd, IDC_LACTION);
+ ComboBox_SelectItem (hCtrl, -1, ptd->leftAction); //use Workaround for MS bug ComboBox_SelectItemData
+ //combo right action (SELECT)
+ hCtrl = GetDlgItem(hwnd, IDC_RACTION);
+ ComboBox_SelectItem (hCtrl, -1, ptd->rightAction); //use Workaround for MS bug ComboBox_SelectItemData
+ } //end if (tvi.lParam)
+ else {
+ //enable / disable controls
+ for (int i = 0; i < SIZEOF(ctrlsAll); ++i) {
+ ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0 ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0);
+ }
+ }
+ break;
+ }
+ case WM_COMMAND:
+ {
+ UINT idCtrl = LOWORD(wParam);
+ POPUPTREEDATA* ptd = (POPUPTREEDATA *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (!ptd) break;
+ switch (HIWORD(wParam)) {
+ int i;
+ case BN_CLICKED: //Button controls
+ switch(idCtrl) {
+ case IDC_ENABLE:
+ ptd->enabled = (BYTE)Button_GetCheck((HWND)lParam);
+ for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
+ EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_PREVIEW:
+ {
+ POPUPDATA2 ppd = {0};
+ ppd.cbSize = sizeof(ppd);
+ ppd.flags = PU2_TCHAR;
+ ppd.lptzTitle = ptd->pszDescription;
+ ppd.lptzText = TranslateT("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!");
+ ppd.iSeconds = ptd->timeoutValue;
+ ppd.colorBack = ptd->colorBack;
+ ppd.colorText = ptd->colorText;
+ POPUPTREEDATA *ptdPrev = NULL;
+ if(ptd->typ == 1) {
+ //we work with a copy for preview
+ ptdPrev = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
+ memcpy(ptdPrev, ptd, sizeof(POPUPTREEDATA));
+ ptdPrev->enabled = ptd->enabled;
+ ptdPrev->timeoutValue = ptd->timeoutValue;
+ strcpy(ptdPrev->leftAction , ptd->leftAction); //geht noch nicht??
+ strcpy(ptdPrev->rightAction , ptd->rightAction); //geht noch nicht??
+ ptdPrev->disableWhen = ptd->disableWhen;
+
+ ppd.lchNotification = (HANDLE)ptdPrev;
+ }
+ else if(ptd->typ == 2) {
+ ppd.lchIcon = ptd->pupClass.hIcon;
+ }
+ CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
+ mir_free(ptdPrev); ptdPrev = NULL;
+ }
+ break;
+ case IDC_MORE:
+ {
+ OPENOPTIONSDIALOG ood = {0};
+ ood.cbSize = sizeof(OPENOPTIONSDIALOG);
+ ood.pszGroup = "Customize";
+ ood.pszPage = "Fonts & Colors";
+ CallService(MS_OPT_OPENOPTIONS, 0, (LPARAM)&ood);
+ }
+ break;
+ case IDC_SOFFLINE: case IDC_SONLINE: case IDC_SAWAY: case IDC_SNA: case IDC_SOCCUPIED:
+ case IDC_SDND: case IDC_SFREE4CHAT: case IDC_SINVISIBLE: case IDC_SPHONE: case IDC_SLUNCH:
+ case IDC_SOFFLINE2: case IDC_SONLINE2: case IDC_SAWAY2: case IDC_SNA2: case IDC_SOCCUPIED2:
+ case IDC_SDND2: case IDC_SFREE4CHAT2: case IDC_SINVISIBLE2: case IDC_SPHONE2: case IDC_SLUNCH2:
+ {
+ ptd->disableWhen = 0;
+ for (i = 0; i < SIZEOF(statusButtons); ++i) {
+ if (IsDlgButtonChecked(hwnd, statusButtons[i].idCtrl))
+ ptd->disableWhen |= statusButtons[i].disableWhenFlag;
+ if (idCtrl == statusButtons[i].idCtrl)
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case CBN_SELCHANGE: //ComboBox controls
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_LACTION:
+ lstrcpynA(ptd->leftAction,
+ (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ sizeof(ptd->leftAction));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_RACTION:
+ lstrcpynA(ptd->rightAction,
+ (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ sizeof(ptd->rightAction));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ default:
+ break;
+ }
+ break;
+ case EN_CHANGE: //Edit controls
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_TIMEOUT:
+ {
+ int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
+ if ( seconds >= SETTING_LIFETIME_INFINITE &&
+ seconds <= SETTING_LIFETIME_MAX &&
+ seconds != ptd->timeoutValue) {
+ ptd->timeoutValue = seconds;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case EN_KILLFOCUS: //Edit controls lost fokus
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_TIMEOUT:
+ {
+ int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
+ if (seconds > SETTING_LIFETIME_MAX)
+ ptd->timeoutValue = SETTING_LIFETIME_MAX;
+ else if (seconds < SETTING_LIFETIME_INFINITE)
+ ptd->timeoutValue = SETTING_LIFETIME_INFINITE;
+ if(seconds != ptd->timeoutValue) {
+ SetDlgItemInt(hwnd, idCtrl, ptd->timeoutValue, TRUE);
+ ErrorMSG(SETTING_LIFETIME_INFINITE, SETTING_LIFETIME_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ {
+ for(int i = 0; i < gTreeData.getCount(); ++i) {
+ switch (gTreeData[i]->typ) {
+ case 1:
+ LoadNotificationSettings(gTreeData[i], "PopUpNotifications");
+ break;
+ case 2: //not finish
+ LoadClassSettings(gTreeData[i], PU_MODULCLASS);
+ gTreeData[i]->timeoutValue = gTreeData[i]->pupClass.iSeconds;
+ break;
+ default:
+ break;
+ }
+ }
+ return TRUE;
+ }
+ case PSN_APPLY:
+ {
+ for(int i = 0; i < gTreeData.getCount(); ++i) {
+ switch (gTreeData[i]->typ) {
+ case 1:
+ gTreeData[i]->notification.iSeconds = gTreeData[i]->timeoutValue;
+ SaveNotificationSettings(gTreeData[i],"PopUpNotifications");
+ break;
+ case 2: //not finish
+ gTreeData[i]->pupClass.iSeconds = gTreeData[i]->timeoutValue;
+ SaveClassSettings(gTreeData[i],"PopUpCLASS");
+ break;
+ default:
+ break;
+ }
+ }
+ return TRUE;
+ }
+ }
+ break;
+ }
+
+ case IDC_TREE1:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case TVN_SELCHANGEDA:
+ case TVN_SELCHANGEDW:
+ {
+ PostMessage(hwnd, WM_USER, 0, 0);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ case WM_DESTROY:
+ ZeroMemory(&tvi,sizeof(tvi));
+ break;
+
+ default:
+ return FALSE;
+ }
+ return FALSE;
+}
+
+void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
+{
+ char setting[2*MAXMODULELABELLENGTH];
+ char *szTmp = NULL;
+
+ mir_snprintf(setting, sizeof(setting), "%s/enabled", ptd->pupClass.pszName);
+ ptd->enabled =
+ (signed char)DBGetContactSettingByte(NULL, szModul, setting, TRUE);
+
+ mir_snprintf(setting, sizeof(setting), "%s/Timeout", ptd->pupClass.pszName);
+ ptd->pupClass.iSeconds =
+ (signed char)DBGetContactSettingWord(NULL, szModul, setting, 0);
+
+ mir_snprintf(setting, sizeof(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
+ ptd->timeoutValue =
+ (signed char)DBGetContactSettingWord(NULL, szModul, setting,
+ ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopUpOptions.Seconds);
+
+ mir_snprintf(setting, sizeof(setting), "%s/leftAction", ptd->pupClass.pszName);
+ szTmp = DBGetContactSettingString(NULL, szModul, setting, POPUP_ACTION_NOTHING); //standart ??
+ lstrcpynA(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
+ mir_free(szTmp); szTmp = NULL;
+
+ mir_snprintf(setting, sizeof(setting), "%s/rightAction", ptd->pupClass.pszName);
+ szTmp = DBGetContactSettingString(NULL, szModul, setting, POPUP_ACTION_DISMISS); //standart ??
+ lstrcpynA(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
+ mir_free(szTmp); szTmp = NULL;
+
+}
+void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul)
+{
+ char setting[2*MAXMODULELABELLENGTH];
+
+ mir_snprintf(setting, sizeof(setting), "%s/enabled", ptd->pupClass.pszName);
+ DBWriteContactSettingByte(NULL, szModul, setting, ptd->enabled);
+
+ mir_snprintf(setting, sizeof(setting), "%s/Timeout", ptd->pupClass.pszName);
+ DBWriteContactSettingWord(NULL, szModul, setting, ptd->pupClass.iSeconds);
+
+ mir_snprintf(setting, sizeof(setting), "%s/TimeoutVal",ptd->pupClass.pszName);
+ DBWriteContactSettingWord(NULL, szModul, setting, ptd->timeoutValue);
+
+ mir_snprintf(setting, sizeof(setting), "%s/leftAction",ptd->pupClass.pszName);
+ DBWriteContactSettingString(NULL, szModul, setting, ptd->leftAction);
+
+ mir_snprintf(setting, sizeof(setting), "%s/rightAction",ptd->pupClass.pszName);
+ DBWriteContactSettingString(NULL, szModul, setting, ptd->rightAction);
+}
diff --git a/plugins/Popup/src/opt_class.h b/plugins/Popup/src/opt_class.h new file mode 100644 index 0000000000..245409a07b --- /dev/null +++ b/plugins/Popup/src/opt_class.h @@ -0,0 +1,41 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_class.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_class_h__
+#define __opt_class_h__
+
+void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul);
+void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul);
+
+INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif // __opt_class_h__
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp new file mode 100644 index 0000000000..582a85ae77 --- /dev/null +++ b/plugins/Popup/src/opt_contacts.cpp @@ -0,0 +1,175 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_contacts.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+static void sttResetListOptions(HWND hwndList);
+static void sttSetAllContactIcons(HWND hwndList);
+
+INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwnd);
+
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_AUTO), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF,0), 0);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_FAVORITE), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV,0), 0);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_FULLSCREEN), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0);
+ SendMessage(GetDlgItem(hwnd, IDC_ICO_BLOCK), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0);
+
+ HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),
+ (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,5,5);
+ ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_DEF,0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FAV,0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0));
+ ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_BLOCK,0));
+ SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
+ SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 4 /*SIZEOF(sttIcons)*/, 0);
+ sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
+ sttSetAllContactIcons(GetDlgItem(hwnd, IDC_LIST));
+
+ break;
+ }
+
+ case WM_NOTIFY:
+ {
+ switch(((LPNMHDR)lParam)->idFrom)
+ {
+ case IDC_LIST:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case CLN_NEWCONTACT:
+ case CLN_LISTREBUILT:
+ sttSetAllContactIcons(GetDlgItem(hwnd,IDC_LIST));
+ break;
+ case CLN_OPTIONSCHANGED:
+ sttResetListOptions(GetDlgItem(hwnd,IDC_LIST));
+ break;
+ case NM_CLICK:
+ {
+ HANDLE hItem;
+ NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
+ DWORD hitFlags;
+ int iImage;
+
+ if(nm->iColumn==-1) break;
+ hItem=(HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
+ if(hItem==NULL) break;
+ if(!(hitFlags&CLCHT_ONITEMEXTRA)) break;
+
+ iImage=SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ if (iImage != 0xFF)
+ {
+ for (int i = 0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
+ //hIml element [0] = SKINICON_OTHER_SMALLDOT
+ //hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
+ SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (i==nm->iColumn)?i+1:0));
+ }
+/*
+ {
+ while (hItem=(HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem))
+ {
+ for (int i = 0; i < SIZEOF(sttIcons); ++i)
+ SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (i==nm->iColumn)?i+1:0));
+ hItem = (HANDLE)SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ }
+ }
+*/
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ }
+ }
+ break;
+ }
+
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ {
+ HWND hwndList = GetDlgItem(hwnd, IDC_LIST);
+ for (HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact;
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ for (int i = 0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
+ {
+ if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0)))
+ {
+ DBWriteContactSettingByte(hContact, MODULNAME, "ShowMode", i);
+ break;
+ }
+ }
+ }
+ return TRUE;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ return FALSE;
+}
+
+static void sttResetListOptions(HWND hwndList)
+{
+ SendMessage(hwndList,CLM_SETBKBITMAP,0,(LPARAM)(HBITMAP)NULL);
+ SendMessage(hwndList,CLM_SETBKCOLOR,GetSysColor(COLOR_WINDOW),0);
+ SendMessage(hwndList,CLM_SETGREYOUTFLAGS,0,0);
+ SendMessage(hwndList,CLM_SETLEFTMARGIN,4,0);
+ SendMessage(hwndList,CLM_SETINDENT,20,0);
+ SendMessage(hwndList,CLM_SETHIDEEMPTYGROUPS,1,0);
+ for(int i=0;i<=FONTID_MAX;i++)
+ SendMessage(hwndList,CLM_SETTEXTCOLOR,i,GetSysColor(COLOR_WINDOWTEXT));
+}
+
+static void sttSetAllContactIcons(HWND hwndList)
+{
+ for (HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact;
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ {
+ HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ DWORD dwMode = DBGetContactSettingByte(hContact, MODULNAME, "ShowMode", 0);
+ for (int i = 0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
+ //hIml element [0] = SKINICON_OTHER_SMALLDOT
+ //hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (dwMode==i)?i+1:0));
+ }
+}
diff --git a/plugins/Popup/src/opt_contacts.h b/plugins/Popup/src/opt_contacts.h new file mode 100644 index 0000000000..222b97c22a --- /dev/null +++ b/plugins/Popup/src/opt_contacts.h @@ -0,0 +1,46 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_contacts.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_contacts_h__
+#define __opt_contacts_h__
+
+enum
+{
+ PU_SHOWMODE_AUTO,
+ PU_SHOWMODE_FAVORITE,
+ PU_SHOWMODE_FULLSCREEN,
+ PU_SHOWMODE_BLOCK
+};
+
+INT_PTR CALLBACK DlgProcContactOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif // __opt_contacts_h__
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp new file mode 100644 index 0000000000..109598ee87 --- /dev/null +++ b/plugins/Popup/src/opt_gen.cpp @@ -0,0 +1,761 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_gen.cpp $
+Revision : $Revision: 1628 $
+Last change on : $Date: 2010-06-30 03:42:27 +0300 (Ср, 30 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+//Helper for Status Tree
+static int CountStatusModes(DWORD flags)
+{
+ int res = 0;
+ if (flags & PF2_ONLINE) ++res;
+ if (flags & PF2_INVISIBLE) ++res;
+ if (flags & PF2_SHORTAWAY) ++res;
+ if (flags & PF2_LONGAWAY) ++res;
+ if (flags & PF2_LIGHTDND) ++res;
+ if (flags & PF2_HEAVYDND) ++res;
+ if (flags & PF2_FREECHAT) ++res;
+ if (flags & PF2_OUTTOLUNCH) ++res;
+ if (flags & PF2_ONTHEPHONE) ++res;
+ if (res) ++res; // Offline
+ return res;
+}
+
+int AddStatusMode (OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
+{
+ if (!flag) return pos;
+ options[pos].dwFlag = flag;
+ options[pos].groupId = OPTTREE_CHECK;
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*lstrlen(prefix)+32);
+ options[pos].pszSettingName = mir_tstrdup(prefix);
+ options[pos].iconIndex = 0;
+
+ lstrcpy(options[pos].pszOptionName, prefix);
+ switch (flag)
+ {
+ case PF2_IDLE: lstrcat(options[pos].pszOptionName, _T("/Offline")); break;
+ case PF2_ONLINE: lstrcat(options[pos].pszOptionName, _T("/Online")); break;
+ case PF2_INVISIBLE: lstrcat(options[pos].pszOptionName, _T("/Invisible")); break;
+ case PF2_SHORTAWAY: lstrcat(options[pos].pszOptionName, _T("/Away")); break;
+ case PF2_LONGAWAY: lstrcat(options[pos].pszOptionName, _T("/NA")); break;
+ case PF2_LIGHTDND: lstrcat(options[pos].pszOptionName, _T("/Occupied")); break;
+ case PF2_HEAVYDND: lstrcat(options[pos].pszOptionName, _T("/DND")); break;
+ case PF2_FREECHAT: lstrcat(options[pos].pszOptionName, _T("/Free for chat")); break;
+ case PF2_OUTTOLUNCH:lstrcat(options[pos].pszOptionName, _T("/Out to lunch")); break;
+ case PF2_ONTHEPHONE:lstrcat(options[pos].pszOptionName, _T("/On the phone")); break;
+ }
+ return pos+1;
+}
+
+int AddStatusModes(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flags)
+{
+ pos = AddStatusMode(options, pos, prefix, PF2_IDLE);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_ONLINE);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_INVISIBLE);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_SHORTAWAY);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_LONGAWAY);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_LIGHTDND);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_HEAVYDND);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_FREECHAT);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_OUTTOLUNCH);
+ pos = AddStatusMode(options, pos, prefix, flags&PF2_ONTHEPHONE);
+ return pos;
+}
+
+
+//Main Dialog Proc
+void LoadOption_General() {
+ //Seconds
+ PopUpOptions.InfiniteDelay = DBGetContactSettingByte(NULL, MODULNAME, "InfiniteDelay", FALSE);
+ PopUpOptions.Seconds = DBGetContactSettingRangedWord(NULL, MODULNAME, "Seconds",
+ SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
+ PopUpOptions.LeaveHovered = DBGetContactSettingByte(NULL, MODULNAME, "LeaveHovered", TRUE);
+ //Dynamic Resize
+ PopUpOptions.DynamicResize = DBGetContactSettingByte(NULL, MODULNAME, "DynamicResize", FALSE);
+ PopUpOptions.UseMinimumWidth = DBGetContactSettingByte(NULL, MODULNAME, "UseMinimumWidth", TRUE);
+ PopUpOptions.MinimumWidth = DBGetContactSettingWord(NULL, MODULNAME, "MinimumWidth", 160);
+ PopUpOptions.UseMaximumWidth = DBGetContactSettingByte(NULL, MODULNAME, "UseMaximumWidth", TRUE);
+ PopUpOptions.MaximumWidth = DBGetContactSettingWord(NULL, MODULNAME, "MaximumWidth", 300);
+ //Position
+ PopUpOptions.Position = DBGetContactSettingRangedByte(NULL, MODULNAME, "Position",
+ POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
+ //Configure popup area
+ PopUpOptions.gapTop = DBGetContactSettingWord(NULL, MODULNAME, "gapTop", 5);
+ PopUpOptions.gapBottom = DBGetContactSettingWord(NULL, MODULNAME, "gapBottom", 5);
+ PopUpOptions.gapLeft = DBGetContactSettingWord(NULL, MODULNAME, "gapLeft", 5);
+ PopUpOptions.gapRight = DBGetContactSettingWord(NULL, MODULNAME, "gapRight", 5);
+ PopUpOptions.spacing = DBGetContactSettingWord(NULL, MODULNAME, "spacing", 5);
+ //Spreading
+ PopUpOptions.Spreading = DBGetContactSettingRangedByte(NULL, MODULNAME, "Spreading",
+ SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
+ //miscellaneous
+ PopUpOptions.ReorderPopUps = DBGetContactSettingByte(NULL, MODULNAME, "ReorderPopUps", TRUE);
+ PopUpOptions.ReorderPopUpsWarning = DBGetContactSettingByte(NULL, MODULNAME, "ReorderPopUpsWarning", TRUE);
+ //disable When
+ PopUpOptions.ModuleIsEnabled = DBGetContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", TRUE);
+ PopUpOptions.DisableWhenFullscreen = DBGetContactSettingByte(NULL, MODULNAME, "DisableWhenFullscreen", TRUE);
+ //new status options (done inside WM_INITDIALOG)
+ //Debug (done inside LoadOptions())
+}
+
+INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+ static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+
+ static OPTTREE_OPTION *statusOptions = NULL;
+ static int statusOptionsCount = 0;
+ if (statusOptions) {
+ int index;
+ if (OptTree_ProcessMessage(hwnd, msg, wParam, lParam, &index, IDC_STATUSES, statusOptions, statusOptionsCount))
+ return TRUE;
+ }
+
+ switch (msg) {
+ case WM_INITDIALOG: {
+ HWND hCtrl = NULL;
+
+ //Seconds of delay
+ {
+ CheckDlgButton(hwnd, IDC_INFINITEDELAY, PopUpOptions.InfiniteDelay);
+ CheckDlgButton(hwnd, IDC_LEAVEHOVERED, PopUpOptions.LeaveHovered);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopUpOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopUpOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopUpOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopUpOptions.InfiniteDelay);
+ SetDlgItemInt(hwnd, IDC_SECONDS, PopUpOptions.Seconds, FALSE);
+ SendDlgItemMessage(hwnd, IDC_SECONDS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_MIN));
+ }
+
+ //Dynamic Resize
+ {
+ CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopUpOptions.DynamicResize);
+ SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopUpOptions.DynamicResize ? _T("Maximum width"): _T("Width"));
+ //Minimum Width
+ CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopUpOptions.UseMinimumWidth);
+ SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(
+ SETTING_MAXIMUMWIDTH_MAX,
+ SETTING_MINIMUMWIDTH_MIN) );
+ SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
+ //Maximum Width
+ PopUpOptions.UseMaximumWidth = PopUpOptions.DynamicResize ? PopUpOptions.UseMaximumWidth : TRUE;
+ CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, PopUpOptions.UseMaximumWidth);
+ SendDlgItemMessage(hwnd, IDC_MAXIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(
+ SETTING_MAXIMUMWIDTH_MAX,
+ SETTING_MINIMUMWIDTH_MIN) );
+ SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
+ //And finally let's enable/disable them.
+ EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopUpOptions.DynamicResize);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopUpOptions.UseMaximumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopUpOptions.UseMaximumWidth);
+ }
+ //Position combobox.
+ {
+ hCtrl = GetDlgItem(hwnd, IDC_WHERE);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("upper left corner")) ,POS_UPPERLEFT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("lower left corner")) ,POS_LOWERLEFT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("lower right corner")) ,POS_LOWERRIGHT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("upper right corner")) ,POS_UPPERRIGHT);
+ SendDlgItemMessage(hwnd, IDC_WHERE, CB_SETCURSEL, (PopUpOptions.Position) , 0);
+ }
+ //Configure popup area
+ {
+ hCtrl = GetDlgItem(hwnd, IDC_CUSTOMPOS);
+ SendMessage(hCtrl, BUTTONSETASFLATBTN, 0, 0);
+ SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)_T("Popup Area"), BATF_TCHAR);
+ SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RESIZE,0));
+ }
+ //Spreading combobox
+ {
+ hCtrl = GetDlgItem(hwnd, IDC_LAYOUT);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("horizontal")) ,SPREADING_HORIZONTAL);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("vertical")) ,SPREADING_VERTICAL);
+ SendDlgItemMessage(hwnd, IDC_LAYOUT, CB_SETCURSEL, (PopUpOptions.Spreading), 0);
+ }
+ //miscellaneous
+ {
+ CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopUpOptions.ReorderPopUps);
+ }
+ //Popup enabled
+ {
+ CheckDlgButton(hwnd, IDC_POPUPENABLED, PopUpOptions.ModuleIsEnabled?BST_UNCHECKED:BST_CHECKED);
+ CheckDlgButton(hwnd, IDC_DISABLEINFS, PopUpOptions.DisableWhenFullscreen);
+ EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopUpOptions.ModuleIsEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopUpOptions.ModuleIsEnabled);
+ }
+ //new status options
+ {
+ int protocolCount = 0;
+ int i;
+ PROTOCOLDESCRIPTOR **protocols;
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protocolCount, (LPARAM)&protocols);
+ DWORD globalFlags = 0;
+ for (i = 0; i < protocolCount; ++i) {
+ if (protocols[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+ DWORD protoFlags = CallProtoService(protocols[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0);
+ globalFlags |= protoFlags;
+ statusOptionsCount += CountStatusModes(protoFlags);
+ }
+ statusOptionsCount += CountStatusModes(globalFlags);
+
+ statusOptions = new OPTTREE_OPTION[statusOptionsCount];
+
+ int pos = 0;
+ pos = AddStatusModes(statusOptions, pos, _T("Global Status"), globalFlags);
+ for (i = 0; i < protocolCount; ++i) {
+ if (protocols[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+ DWORD protoFlags = CallProtoService(protocols[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0);
+ if (!CountStatusModes(protoFlags))
+ continue;
+ TCHAR prefix[128];
+ wsprintf(prefix, _T("Protocol Status/%hs"), protocols[i]->szName);
+ pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
+ }
+
+ int index;
+ OptTree_ProcessMessage(hwnd, msg, wParam, lParam, &index, IDC_STATUSES, statusOptions, statusOptionsCount);
+
+ char prefix[128];
+ LPTSTR pszSettingName = NULL;
+ for (i = 0; i < protocolCount; ++i) {
+ if (protocols[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+ DWORD protoFlags = CallProtoService(protocols[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0);
+ if (!CountStatusModes(protoFlags))
+ continue;
+
+ mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szName);
+ pszSettingName = mir_a2t(prefix);
+ OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount,
+ DBGetContactSettingDword(NULL, MODULNAME, prefix, 0),
+ pszSettingName);
+ mir_free(pszSettingName); pszSettingName = NULL;
+ }
+ OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount,
+ DBGetContactSettingDword(NULL, MODULNAME, "Global Status", 0),
+ _T("Global Status"));
+ }
+ //Debug
+ {
+ #if defined(_DEBUG)
+ CheckDlgButton(hwnd, IDC_DEBUG, PopUpOptions.debug);
+ ShowWindow(GetDlgItem(hwnd, IDC_DEBUG), SW_SHOW);
+ #endif
+ }
+
+ TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ bDlgInit = true;
+ }//end WM_INITDIALOG
+ return TRUE;
+ case WM_COMMAND: {
+ UINT idCtrl = LOWORD(wParam);
+ switch (HIWORD(wParam)) {
+ case BN_CLICKED: //Button controls
+ switch(idCtrl) {
+ case IDC_INFINITEDELAY:
+ {
+ PopUpOptions.InfiniteDelay = !PopUpOptions.InfiniteDelay;
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS),!PopUpOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopUpOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopUpOptions.InfiniteDelay);
+ EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopUpOptions.InfiniteDelay);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_LEAVEHOVERED:
+ {
+ PopUpOptions.LeaveHovered = !PopUpOptions.LeaveHovered;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_DYNAMICRESIZE:
+ {
+ PopUpOptions.DynamicResize=!PopUpOptions.DynamicResize;
+ EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopUpOptions.DynamicResize);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopUpOptions.DynamicResize && PopUpOptions.UseMinimumWidth);
+ SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopUpOptions.DynamicResize ? TranslateT("Maximum width"): TranslateT("Width"));
+ if(!PopUpOptions.DynamicResize) {
+ PopUpOptions.UseMaximumWidth = TRUE;
+ CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, BST_CHECKED);
+ EnableWindow(GetDlgItem(hwnd, IDC_USEMAXIMUMWIDTH), TRUE);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), TRUE);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), TRUE);
+ }
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_USEMINIMUMWIDTH:
+ {
+ PopUpOptions.UseMinimumWidth= !PopUpOptions.UseMinimumWidth;
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopUpOptions.UseMinimumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopUpOptions.UseMinimumWidth);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_USEMAXIMUMWIDTH:
+ {
+ PopUpOptions.UseMaximumWidth= Button_GetCheck((HWND)lParam);
+ if(!PopUpOptions.DynamicResize) { //ugly - set always on if DynamicResize = off
+ CheckDlgButton(hwnd, idCtrl, BST_CHECKED);
+ PopUpOptions.UseMaximumWidth = TRUE;
+ }
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopUpOptions.UseMaximumWidth);
+ EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopUpOptions.UseMaximumWidth);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_CUSTOMPOS:
+ {
+ RECT rcButton, rcBox;
+ HWND hwndBox = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POSITION), NULL, PositionBoxDlgProc);
+ GetWindowRect((HWND)lParam, &rcButton);
+ GetWindowRect(hwndBox, &rcBox);
+ MoveWindow(hwndBox,
+ rcButton.right-(rcBox.right-rcBox.left) + 15,
+ rcButton.bottom + 3,
+ rcBox.right-rcBox.left,
+ rcBox.bottom-rcBox.top,
+ FALSE);
+#if defined(_UNICODE)
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)|WS_EX_LAYERED);
+ SetLayeredWindowAttributes(hwndBox, NULL, 0, LWA_ALPHA);
+ ShowWindow(hwndBox, SW_SHOW);
+ for (int i = 0; i <= 255; i += 15) {
+ SetLayeredWindowAttributes(hwndBox, NULL, i, LWA_ALPHA);
+ UpdateWindow(hwndBox);
+ Sleep(1);
+ }
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)&~WS_EX_LAYERED);
+#else
+ if (MySetLayeredWindowAttributes) {
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)|WS_EX_LAYERED);
+ MySetLayeredWindowAttributes(hwndBox, NULL, 0, LWA_ALPHA);
+ ShowWindow(hwndBox, SW_SHOW);
+ for (int i = 0; i <= 255; i += 15) {
+ MySetLayeredWindowAttributes(hwndBox, NULL, i, LWA_ALPHA);
+ UpdateWindow(hwndBox);
+ Sleep(1);
+ }
+ SetWindowLongPtr(hwndBox, GWL_EXSTYLE, GetWindowLongPtr(hwndBox, GWL_EXSTYLE)&~WS_EX_LAYERED);
+ }
+#endif
+ ShowWindow(hwndBox, SW_SHOW);
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_REORDERPOPUPS:
+ {
+ PopUpOptions.ReorderPopUps = !PopUpOptions.ReorderPopUps;
+ PopUpOptions.ReorderPopUpsWarning = PopUpOptions.ReorderPopUps ?
+ DBGetContactSettingByte(NULL, MODULNAME, "ReorderPopUpsWarning", TRUE) : TRUE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_POPUPENABLED:
+ {//PopUpOptions.ModuleIsEnabled is set and store by EnableDisable menu service !!!!!!
+ int chk = IsDlgButtonChecked(hwnd, IDC_POPUPENABLED);
+ if (PopUpOptions.ModuleIsEnabled&&chk || !PopUpOptions.ModuleIsEnabled&&!chk)
+ svcEnableDisableMenuCommand(0,0);
+ EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopUpOptions.ModuleIsEnabled);
+ EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopUpOptions.ModuleIsEnabled);
+ }
+ break;
+ case IDC_DISABLEINFS:
+ {
+ PopUpOptions.DisableWhenFullscreen = !PopUpOptions.DisableWhenFullscreen;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ break;
+ #if defined(_DEBUG) //DEBUG
+ case IDC_DEBUG:
+ PopUpOptions.debug = (BYTE)Button_GetCheck((HWND)lParam);
+ //The following line is dangerous, but useful for my debug purposes.
+ //MySetLayeredWindowAttributes = (BOOL)!MySetLayeredWindowAttributes;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ #endif //DEBUG
+ case IDC_PREVIEW:
+ {
+ PopUpPreview();
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case CBN_SELCHANGE: //ComboBox controls
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_WHERE:
+ PopUpOptions.Position = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_LAYOUT:
+ PopUpOptions.Spreading = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ default:
+ break;
+ }
+ break;
+ case EN_CHANGE: //Edit controls change
+ if(!bDlgInit) break;
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_SECONDS:
+ {
+ int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if ( seconds >= SETTING_LIFETIME_MIN &&
+ seconds <= SETTING_LIFETIME_MAX &&
+ seconds != PopUpOptions.Seconds) {
+ PopUpOptions.Seconds = seconds;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_MINIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, NULL, FALSE);
+ if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
+ temp <= SETTING_MAXIMUMWIDTH_MAX &&
+ temp != PopUpOptions.MinimumWidth) {
+ PopUpOptions.MinimumWidth = temp;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case IDC_MAXIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, NULL, FALSE);
+ if ( temp >= SETTING_MINIMUMWIDTH_MIN &&
+ temp <= SETTING_MAXIMUMWIDTH_MAX &&
+ temp != PopUpOptions.MaximumWidth) {
+ PopUpOptions.MaximumWidth = temp;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ break;
+ case EN_KILLFOCUS: //Edit controls lost fokus
+ switch(idCtrl) {
+ //lParam = Handle to the control
+ case IDC_SECONDS:
+ {
+ int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (seconds > SETTING_LIFETIME_MAX)
+ PopUpOptions.Seconds = SETTING_LIFETIME_MAX;
+ else if (seconds < SETTING_LIFETIME_MIN)
+ PopUpOptions.Seconds = SETTING_LIFETIME_MIN;
+ if(seconds != PopUpOptions.Seconds) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.Seconds, FALSE);
+ ErrorMSG(SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
+ SetFocus((HWND)lParam);
+ }
+ }
+ break;
+ case IDC_MINIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (temp < SETTING_MINIMUMWIDTH_MIN)
+ PopUpOptions.MinimumWidth = SETTING_MINIMUMWIDTH_MIN;
+ else if(temp > SETTING_MAXIMUMWIDTH_MAX)
+ PopUpOptions.MinimumWidth = SETTING_MAXIMUMWIDTH_MAX;
+ if(temp != PopUpOptions.MinimumWidth) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MinimumWidth, FALSE);
+ ErrorMSG(SETTING_MINIMUMWIDTH_MIN, SETTING_MAXIMUMWIDTH_MAX);
+ SetFocus((HWND)lParam);
+ break;
+ }
+ if (temp > PopUpOptions.MaximumWidth) {
+ PopUpOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
+ SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
+ }
+ }
+ break;
+ case IDC_MAXIMUMWIDTH:
+ {
+ int temp = GetDlgItemInt(hwnd, idCtrl, NULL, FALSE);
+ if (temp >= SETTING_MAXIMUMWIDTH_MAX)
+ PopUpOptions.MaximumWidth = SETTING_MAXIMUMWIDTH_MAX;
+ else if(temp < SETTING_MINIMUMWIDTH_MIN)
+ PopUpOptions.MaximumWidth = SETTING_MINIMUMWIDTH_MIN;
+ if(temp != PopUpOptions.MaximumWidth) {
+ SetDlgItemInt(hwnd, idCtrl, PopUpOptions.MaximumWidth, FALSE);
+ ErrorMSG(SETTING_MINIMUMWIDTH_MIN, SETTING_MAXIMUMWIDTH_MAX);
+ SetFocus((HWND)lParam);
+ break;
+ }
+ if (temp < PopUpOptions.MinimumWidth) {
+ PopUpOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
+ SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
+ }
+ }
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ break;
+ default:
+ break;
+ }// end switch (HIWORD(wParam))
+ }//end WM_COMMAND
+ break;
+ case WM_NOTIFY: {
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0: {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOption_General();
+ return TRUE;
+ case PSN_APPLY: {
+ //Seconds
+ DBWriteContactSettingByte(NULL, MODULNAME, "InfiniteDelay", PopUpOptions.InfiniteDelay);
+ DBWriteContactSettingWord(NULL, MODULNAME, "Seconds", (WORD)PopUpOptions.Seconds);
+ DBWriteContactSettingByte(NULL, MODULNAME, "LeaveHovered", PopUpOptions.LeaveHovered);
+ //Dynamic Resize
+ DBWriteContactSettingByte(NULL, MODULNAME, "DynamicResize", PopUpOptions.DynamicResize);
+ DBWriteContactSettingByte(NULL, MODULNAME, "UseMinimumWidth", PopUpOptions.UseMinimumWidth);
+ DBWriteContactSettingWord(NULL, MODULNAME, "MinimumWidth", PopUpOptions.MinimumWidth);
+ DBWriteContactSettingByte(NULL, MODULNAME, "UseMaximumWidth", PopUpOptions.UseMaximumWidth);
+ DBWriteContactSettingWord(NULL, MODULNAME, "MaximumWidth", PopUpOptions.MaximumWidth);
+ //Position
+ DBWriteContactSettingByte(NULL, MODULNAME, "Position", (BYTE)PopUpOptions.Position);
+ //Configure popup area
+ DBWriteContactSettingWord(NULL, MODULNAME, "gapTop", (WORD)PopUpOptions.gapTop);
+ DBWriteContactSettingWord(NULL, MODULNAME, "gapBottom", (WORD)PopUpOptions.gapBottom);
+ DBWriteContactSettingWord(NULL, MODULNAME, "gapLeft", (WORD)PopUpOptions.gapLeft);
+ DBWriteContactSettingWord(NULL, MODULNAME, "gapRight", (WORD)PopUpOptions.gapRight);
+ DBWriteContactSettingWord(NULL, MODULNAME, "spacing", (WORD)PopUpOptions.spacing);
+ //Spreading
+ DBWriteContactSettingByte(NULL, MODULNAME, "Spreading", (BYTE)PopUpOptions.Spreading);
+ //miscellaneous
+ //DBWriteContactSettingByte(NULL, MODULNAME, "ReorderPopUps", PopUpOptions.ReorderPopUps);
+ Check_ReorderPopUps(hwnd); //this save also PopUpOptions.ReorderPopUps
+ //disable When
+ DBWriteContactSettingByte(NULL, MODULNAME, "DisableWhenFullscreen", PopUpOptions.DisableWhenFullscreen);
+ //new status options
+ {
+ int protocolCount;
+ PROTOCOLDESCRIPTOR **protocols;
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protocolCount, (LPARAM)&protocols);
+
+ char prefix[128];
+ LPTSTR pszSettingName = NULL;
+ for (int i = 0; i < protocolCount; ++i)
+ {
+ if (protocols[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+
+ mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", protocols[i]->szName);
+ pszSettingName = mir_a2t(prefix);
+ DBWriteContactSettingDword(NULL, MODULNAME, prefix,
+ OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
+ mir_free(pszSettingName); pszSettingName = NULL;
+ }
+ DBWriteContactSettingDword(NULL, MODULNAME, "Global Status",
+ OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, _T("Global Status")));
+ }
+ //Debug
+ #if defined(_DEBUG)
+ DBWriteContactSettingByte(NULL, MODULNAME, "debug", PopUpOptions.debug);
+ #endif
+
+ }//end PSN_APPLY:
+ return TRUE;
+ default:
+ break;
+ }
+ }
+ break;
+ case IDC_MINIMUMWIDTH_SPIN:
+ {
+ LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
+ int temp = lpnmud->iPos + lpnmud->iDelta;
+ if (temp > PopUpOptions.MaximumWidth) {
+ PopUpOptions.MaximumWidth = min(temp, SETTING_MAXIMUMWIDTH_MAX);
+ SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopUpOptions.MaximumWidth, FALSE);
+ }
+ }
+ break;
+ case IDC_MAXIMUMWIDTH_SPIN:
+ {
+ LPNMUPDOWN lpnmud = (LPNMUPDOWN) lParam;
+ int temp = lpnmud->iPos + lpnmud->iDelta;
+ if (temp < PopUpOptions.MinimumWidth) {
+ PopUpOptions.MinimumWidth = max(temp, SETTING_MINIMUMWIDTH_MIN);
+ SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopUpOptions.MinimumWidth, FALSE);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }//end WM_NOTIFY
+ break;
+ case WM_DESTROY: {
+ if (statusOptions) {
+ for (int i = 0; i < statusOptionsCount; ++i) {
+ mir_free(statusOptions[i].pszOptionName);
+ mir_free(statusOptions[i].pszSettingName);
+ }
+ delete [] statusOptions;
+ statusOptions = NULL;
+ statusOptionsCount = 0;
+ bDlgInit = false;
+ }
+ }//end WM_DESTROY
+ break;
+ default:
+ return FALSE;
+ }//end switch (msg)
+ return FALSE;
+}
+
+void ErrorMSG(int minValue, int maxValue) {
+ TCHAR str[128];
+ wsprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
+ MSGERROR(str);
+}
+
+void Check_ReorderPopUps(HWND hwnd) {
+ if (!PopUpOptions.ReorderPopUps && PopUpOptions.ReorderPopUpsWarning)
+ {
+ int res = MessageBox(hwnd,
+ TranslateTS(
+ _T("'Reorder Popups' option is currently diabled.\r\n")
+ _T("This may cause misaligned popups when used with\r\n")
+ _T("avatars and text replacement (mainly NewStatusNotify).\r\n")
+ _T("\r\n")
+ _T("Do you want to enable popup reordering now?\r\n")
+ ),
+ TranslateT("Popup Plus Warning"), MB_ICONEXCLAMATION|MB_YESNOCANCEL);
+
+ switch (res)
+ {
+ case IDYES:
+ PopUpOptions.ReorderPopUps = TRUE;
+ //Reset warning for next option change !!!
+ PopUpOptions.ReorderPopUpsWarning = TRUE;
+ break;
+ case IDNO:
+ PopUpOptions.ReorderPopUps = FALSE;
+ PopUpOptions.ReorderPopUpsWarning = FALSE;
+ break;
+ default:
+ return;
+ }
+ }
+ DBWriteContactSettingByte(NULL, MODULNAME, "ReorderPopUps", PopUpOptions.ReorderPopUps);
+ DBWriteContactSettingByte(NULL, MODULNAME, "ReorderPopUpsWarning", PopUpOptions.ReorderPopUpsWarning);
+ if(hwnd) CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopUpOptions.ReorderPopUps);
+}
+
+void ThemeDialogBackground(HWND hwnd) {
+ if (IsWinVerXPPlus()) {
+ static HMODULE hThemeAPI = NULL;
+ if (!hThemeAPI) hThemeAPI = GetModuleHandleA("uxtheme");
+ if (hThemeAPI) {
+ HRESULT (STDAPICALLTYPE *MyEnableThemeDialogTexture)(HWND,DWORD) = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(hThemeAPI,"EnableThemeDialogTexture");
+ if (MyEnableThemeDialogTexture)
+ MyEnableThemeDialogTexture(hwnd,0x00000002|0x00000004); //0x00000002|0x00000004=ETDT_ENABLETAB
+ }
+ }
+}
+
+INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static HFONT hFontTitle = 0;
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ ThemeDialogBackground(hwndDlg);
+
+ LOGFONT lf;
+ GetObject((HFONT)SendMessage(GetDlgItem(hwndDlg, IDC_TITLE), WM_GETFONT, 0, 0), sizeof(lf), &lf);
+ lf.lfWeight = FW_BOLD;
+ lf.lfHeight *= 1.2;
+ hFontTitle = CreateFontIndirect(&lf);
+ SendMessage(GetDlgItem(hwndDlg, IDC_TITLE), WM_SETFONT, (WPARAM)hFontTitle, TRUE);
+
+ SendMessage(GetDlgItem(hwndDlg, IDOK), BUTTONSETASFLATBTN, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDOK), BUTTONADDTOOLTIP, (WPARAM)_T("OK"), BATF_TCHAR);
+ SendMessage(GetDlgItem(hwndDlg, IDOK), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_OK,0));
+
+ SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BUTTONSETASFLATBTN, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BUTTONADDTOOLTIP, (WPARAM)_T("Cancel"), BATF_TCHAR);
+ SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_CANCEL,0));
+
+ SetDlgItemInt(hwndDlg, IDC_TXT_TOP, PopUpOptions.gapTop, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_TXT_BOTTOM, PopUpOptions.gapBottom, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_TXT_LEFT, PopUpOptions.gapLeft, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_TXT_RIGHT, PopUpOptions.gapRight, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_TXT_SPACING, PopUpOptions.spacing, FALSE);
+
+ TranslateDialogDefault(hwndDlg);
+ break;
+ case WM_COMMAND:
+ if ((LOWORD(wParam)) == IDOK)
+ {
+ PopUpOptions.gapTop = GetDlgItemInt(hwndDlg, IDC_TXT_TOP, NULL, FALSE);
+ PopUpOptions.gapBottom = GetDlgItemInt(hwndDlg, IDC_TXT_BOTTOM, NULL, FALSE);
+ PopUpOptions.gapLeft = GetDlgItemInt(hwndDlg, IDC_TXT_LEFT, NULL, FALSE);
+ PopUpOptions.gapRight = GetDlgItemInt(hwndDlg, IDC_TXT_RIGHT, NULL, FALSE);
+ PopUpOptions.spacing = GetDlgItemInt(hwndDlg, IDC_TXT_SPACING, NULL, FALSE);
+ PostMessage(hwndDlg, WM_CLOSE, 0, 0);
+ } else
+ if ((LOWORD(wParam)) == IDCANCEL)
+ {
+ PostMessage(hwndDlg, WM_CLOSE, 0, 0);
+ }
+ break;
+ case WM_ACTIVATE:
+ if (wParam == WA_INACTIVE)
+ {
+ PostMessage(hwndDlg, WM_CLOSE, 0, 0);
+ }
+ break;
+ case WM_CLOSE:
+ DestroyWindow(hwndDlg);
+ break;
+ case WM_DESTROY:
+ DeleteObject(hFontTitle);
+ break;
+ }
+ return FALSE;
+}
diff --git a/plugins/Popup/src/opt_gen.h b/plugins/Popup/src/opt_gen.h new file mode 100644 index 0000000000..1f61f6b9a9 --- /dev/null +++ b/plugins/Popup/src/opt_gen.h @@ -0,0 +1,43 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_gen.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_gen_h__
+#define __opt_gen_h__
+
+void LoadOption_General();
+void Check_ReorderPopUps(HWND hwnd = 0);
+INT_PTR CALLBACK DlgProcPopUpGeneral(HWND, UINT, WPARAM, LPARAM);
+
+void ErrorMSG(int minValue, int maxValue);
+
+
+#endif // __opt_gen_h__
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp new file mode 100644 index 0000000000..d91efe5afd --- /dev/null +++ b/plugins/Popup/src/opt_skins.cpp @@ -0,0 +1,695 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_skins.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+static volatile bool gPreviewOk = false;
+static PopupWnd2 *wndPreview = NULL;
+
+INT_PTR CALLBACK BoxPreviewWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+void RegisterOptPrevBox()
+{
+ DWORD err;
+ WNDCLASSEX wcl;
+ wcl.cbSize = sizeof(wcl);
+ wcl.lpfnWndProc = (WNDPROC)BoxPreviewWndProc;
+ wcl.style = IsWinVerXPPlus() ? CS_DROPSHADOW : 0;
+ wcl.cbClsExtra = 0;
+ wcl.cbWndExtra = 0;
+ wcl.hInstance = hInst;
+ wcl.hIcon = NULL;
+ wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcl.hbrBackground = NULL; //(HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.lpszMenuName = NULL;
+ wcl.lpszClassName = _T(BOXPREVIEW_WNDCLASS);
+ wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+ g_wndClass.cPopupPreviewBoxWndclass = RegisterClassEx(&wcl);
+ err = GetLastError();
+ if (!g_wndClass.cPopupPreviewBoxWndclass) {
+ TCHAR msg[1024];
+ wsprintf(msg, TranslateT("Failed to register %s class."),wcl.lpszClassName);
+ MSGERROR(msg);
+ }
+
+ // register custom class for dialog box with drop-shadow attribute
+ // "#32770" stays for class name of default system dialog box
+ GetClassInfoEx(hInst, _T("#32770"), &wcl);
+ wcl.hInstance = hInst;
+ wcl.lpszClassName = _T("PopupPlusDlgBox");
+ wcl.style |= IsWinVerXPPlus() ? CS_DROPSHADOW : 0;
+ g_wndClass.cPopupPlusDlgBox = RegisterClassEx(&wcl);
+ err = GetLastError();
+ if (!g_wndClass.cPopupPlusDlgBox) {
+ TCHAR msg[1024];
+ wsprintf(msg, TranslateT("Failed to register %s class."),wcl.lpszClassName);
+ MSGERROR(msg);
+ }
+}
+
+static void updatePreviewImage(HWND hwndBox)
+{
+ gPreviewOk = false;
+
+ POPUPDATA2 ppd;
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.cbSize = sizeof(ppd);
+ ppd.flags = PU2_TCHAR;
+ ppd.lchIcon = LoadSkinnedIcon(SKINICON_STATUS_ONLINE);
+ ppd.lptzTitle = TranslateT("Skin preview");
+ ppd.lptzText = TranslateT("Just take a look at this skin... ;)");
+
+ POPUPOPTIONS customOptions = PopUpOptions;
+ customOptions.DynamicResize = FALSE;
+ customOptions.MinimumWidth = customOptions.MaximumWidth = 250;
+
+ if (wndPreview) delete wndPreview;
+ wndPreview = new PopupWnd2(&ppd, &customOptions, true);
+ wndPreview->buildMText();
+ wndPreview->update();
+ gPreviewOk = true;
+
+ InvalidateRect(hwndBox, NULL, TRUE);
+}
+
+static void DrawPreview(HWND hwnd, HDC hdc)
+{
+ RECT rc;
+ HBRUSH hbr;
+
+ BITMAPINFO bi;
+ bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
+ bi.bmiHeader.biWidth = 8;
+ bi.bmiHeader.biHeight = -8;
+ bi.bmiHeader.biPlanes = 1;
+ bi.bmiHeader.biBitCount = 32;
+ bi.bmiHeader.biCompression = BI_RGB;
+ HBITMAP hBmpBrush = (HBITMAP)CreateDIBSection(0, &bi, DIB_RGB_COLORS, 0, 0, 0);
+ HDC dcBmp = CreateCompatibleDC(0);
+ HBITMAP hBmpSave = (HBITMAP)SelectObject(dcBmp, hBmpBrush);
+ hbr = CreateSolidBrush(RGB(0xcc, 0xcc, 0xcc));
+ SetRect(&rc, 0, 0, 8, 8);
+ FillRect(dcBmp, &rc, hbr);
+ DeleteObject(hbr);
+ hbr = CreateSolidBrush(RGB(0xff, 0xff, 0xff));
+ SetRect(&rc, 4, 0, 8, 4);
+ FillRect(dcBmp, &rc, hbr);
+ SetRect(&rc, 0, 4, 4, 8);
+ FillRect(dcBmp, &rc, hbr);
+ DeleteObject(hbr);
+ SelectObject(dcBmp, hBmpSave);
+ DeleteDC(dcBmp);
+
+ GetClientRect(hwnd, &rc);
+ hbr = CreatePatternBrush(hBmpBrush);
+ SetBrushOrgEx(hdc, 1, 1, 0);
+ FillRect(hdc, &rc, hbr);
+ DeleteObject(hbr);
+ DeleteObject(hBmpBrush);
+
+ if (gPreviewOk)
+ {
+ int width = min(rc.right, wndPreview->getContent()->getWidth());
+ int height = min(rc.bottom, wndPreview->getContent()->getHeight());
+ int left = (rc.right - width) / 2;
+ int top = (rc.bottom - height) / 2;
+
+#if defined(_UNICODE)
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ AlphaBlend(hdc, left, top, width, height,
+ wndPreview->getContent()->getDC(),
+ 0, 0, width, height, bf);
+#else
+ if (MyAlphaBlend) {
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 255;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ MyAlphaBlend(hdc, left, top, width, height,
+ wndPreview->getContent()->getDC(),
+ 0, 0, width, height, bf);
+ }
+ else {
+ BitBlt(hdc,
+ left, top, left+width, top+height,
+ wndPreview->getContent()->getDC(),
+ 0, 0, SRCCOPY);
+ }
+#endif
+ }
+
+ FrameRect(hdc, &rc, GetStockBrush(LTGRAY_BRUSH));
+}
+
+static WNDPROC WndProcPreviewBoxSave;
+LRESULT CALLBACK WndProcPreviewBox(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (!wndPreview)
+ return CallWindowProc(WndProcPreviewBoxSave, hwnd, msg, wParam, lParam);
+
+ switch (msg)
+ {
+ case WM_PAINT:
+ {
+ if (GetUpdateRect(hwnd, 0, FALSE))
+ {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hwnd, &ps);
+ DrawPreview(hwnd, hdc);
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
+ }
+
+ case WM_PRINT:
+ case WM_PRINTCLIENT:
+ {
+ HDC hdc = (HDC)wParam;
+ DrawPreview(hwnd, hdc);
+ return 0;
+ }
+ }
+ return CallWindowProc(WndProcPreviewBoxSave, hwnd, msg, wParam, lParam);
+}
+
+int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions) {
+ const PopupSkin *skin = 0;
+ LPTSTR pszName = NULL;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ for (int i = 1; i <= 10; i++) {
+ if(!skin->getFlagName(i))
+ continue;
+ *OptionsCount += 1;
+ options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount));
+ options[pos].dwFlag = (DWORD)(1 << (i-1));
+ options[pos].groupId = OPTTREE_CHECK;
+ options[pos].iconIndex = 0;
+ options[pos].pszSettingName = mir_tstrdup(_T("Skin options"));
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ lstrlen(options[pos].pszSettingName)+
+ lstrlenA(skin->getFlagName(i)) +10 ));
+ wsprintf(options[pos].pszOptionName,_T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i));
+ options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
+ options[pos].Data = i; //skin flag index
+ *dwGlobalOptions |= skin->getFlag(i) ? (1 << (i-1)) : 0;
+ pos++;
+ }
+ }
+ return pos;
+}
+
+int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions) {
+ BOOL bCheck;
+ LPTSTR mainOption [] = {
+ LPGENT("Show clock"),
+ LPGENT("Drop shadow effect (Windows XP+)"),
+ LPGENT("Drop shadow effect (Windows XP+)/non rectangular"),
+ LPGENT("Enable Aero Glass (Vista+)"),
+ LPGENT("Use Windows colours"),
+ LPGENT("Use advanced text render")};
+ for (int i = 0; i < SIZEOF(mainOption); i++) {
+ bCheck = 0;
+ switch (i) {
+ case 0:
+ *dwGlobalOptions |= PopUpOptions.DisplayTime ? (1 << i) : 0;
+ bCheck = PopUpOptions.DisplayTime;
+ break;
+ case 1:
+ if(!IsWinVerXPPlus()) continue;
+ *dwGlobalOptions |= PopUpOptions.DropShadow ? (1 << i) : 0;
+ bCheck = PopUpOptions.DropShadow;
+ break;
+ case 2:
+ if(!IsWinVerXPPlus()) continue;
+ *dwGlobalOptions |= PopUpOptions.EnableFreeformShadows ? (1 << i) : 0;
+ bCheck = PopUpOptions.EnableFreeformShadows;
+ break;
+ case 3:
+ if(!MyDwmEnableBlurBehindWindow) continue;
+ *dwGlobalOptions |= PopUpOptions.EnableAeroGlass ? (1 << i) : 0;
+ bCheck = PopUpOptions.EnableAeroGlass;
+ break;
+ case 4:
+ *dwGlobalOptions |= PopUpOptions.UseWinColors ? (1 << i) : 0;
+ bCheck = PopUpOptions.UseWinColors;
+ break;
+ case 5:
+ if(!(htuText&&htuTitle)) continue;
+ *dwGlobalOptions |= PopUpOptions.UseMText ? (1 << i) : 0;
+ bCheck = PopUpOptions.UseMText;
+ break;
+ default:
+ break;
+ }
+ *OptionsCount += 1;
+ options = (OPTTREE_OPTION*)mir_realloc(options,sizeof(OPTTREE_OPTION)*(*OptionsCount));
+ options[pos].dwFlag = (1 << i);
+ options[pos].groupId = OPTTREE_CHECK;
+ options[pos].iconIndex = 0;
+ options[pos].pszSettingName = mir_tstrdup(_T("Global settings"));
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ lstrlen(options[pos].pszSettingName)+
+ lstrlen(mainOption[i]) + 10));
+ wsprintf(options[pos].pszOptionName,_T("%s/%s"), options[pos].pszSettingName, mainOption[i]);
+ options[pos].bState = bCheck;
+ pos++;
+ }
+ return pos;
+}
+
+bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hwndDlg) {
+ if (options) {
+ int index = -1;
+ OptTree_ProcessMessage(hwndDlg, WM_DESTROY, 0, 0, &index, IDC_SKIN_LIST_OPT, options, *OptionsCount);
+ for (int i = 0; i < *OptionsCount; ++i) {
+ mir_free(options[i].pszOptionName);
+ mir_free(options[i].pszSettingName);
+ }
+ mir_free(options);
+ options = NULL;
+ *OptionsCount = 0;
+ }
+ int pos = 0;
+ //add "Global options"
+ DWORD dwGlobalOptions = 0;
+ pos = SkinOptionList_AddMain(options, OptionsCount, pos, &dwGlobalOptions);
+ //add "Skin options"
+ DWORD dwSkinOptions = 0;
+ pos = SkinOptionList_AddSkin(options, OptionsCount, pos, &dwSkinOptions);
+ //generate treeview
+ int index = -1;
+ OptTree_ProcessMessage(hwndDlg, WM_INITDIALOG, 0, 0, &index, IDC_SKIN_LIST_OPT, options, *OptionsCount);
+
+ //check "Skin options" state
+ char prefix[128];
+ mir_snprintf(prefix, sizeof(prefix),"skin."TCHAR_STR_PARAM, PopUpOptions.SkinPack);
+ OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
+ DBGetContactSettingDword(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
+
+ //check "Global Settings"
+ OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
+ dwGlobalOptions, _T("Global settings"));
+
+ return true;
+}
+
+void LoadOption_Skins() {
+ //skin pack
+ PopUpOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL,MODULNAME, "SkinPack", "* Popup Classic",DBVT_TCHAR);
+ //more Skin options
+ PopUpOptions.DisplayTime = DBGetContactSettingByte(NULL,MODULNAME, "DisplayTime", TRUE);
+ PopUpOptions.DropShadow = DBGetContactSettingByte(NULL,MODULNAME, "DropShadow", TRUE);
+ PopUpOptions.EnableFreeformShadows = DBGetContactSettingByte(NULL,MODULNAME, "EnableShadowRegion", 1);
+ PopUpOptions.EnableAeroGlass = DBGetContactSettingByte(NULL,MODULNAME, "EnableAeroGlass", 1);
+ PopUpOptions.UseWinColors = DBGetContactSettingByte(NULL,MODULNAME, "UseWinColors", FALSE);
+ PopUpOptions.UseMText = DBGetContactSettingByte(NULL,MODULNAME, "UseMText", TRUE);
+}
+
+INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+ static HANDLE hhkFontsReload = 0;
+ static OPTTREE_OPTION *skinOptions = NULL;
+ static int skinOptionsCount = 0;
+
+ if (skinOptions) {
+ int index = -1;
+ OptTree_ProcessMessage(hwndDlg, msg, wParam, lParam, &index, IDC_SKIN_LIST_OPT, skinOptions, skinOptionsCount);
+ if (index != -1) {
+ if(lstrcmp(skinOptions[index].pszSettingName, _T("Skin options")) == 0) {
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ skin->setFlag(skinOptions[index].Data, skinOptions[index].bState ? true : false);
+ }
+ }
+ else if (lstrcmp(skinOptions[index].pszSettingName, _T("Global settings")) == 0) {
+ switch (skinOptions[index].dwFlag) {
+ case (1 << 0):
+ PopUpOptions.DisplayTime = skinOptions[index].bState;
+ break;
+ case (1 << 1):
+ PopUpOptions.DropShadow = skinOptions[index].bState;
+ break;
+ case (1 << 2):
+ PopUpOptions.EnableFreeformShadows = skinOptions[index].bState;
+ break;
+ case (1 << 3):
+ PopUpOptions.EnableAeroGlass = skinOptions[index].bState;
+ break;
+ case (1 << 4):
+ PopUpOptions.UseWinColors = skinOptions[index].bState;
+ break;
+ case (1 << 5):
+ PopUpOptions.UseMText = skinOptions[index].bState;
+ break;
+ default:
+ break;
+ }
+ }
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ return FALSE;
+ }
+ }
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ {
+ HWND hCtrl = NULL;
+ DWORD dwIndex = 0;
+
+ //Skin List
+ hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
+ ListBox_ResetContent(hCtrl);
+ LPTSTR Temp = NULL;
+ for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
+ {
+ dwIndex = ListBox_AddString(hCtrl, sl->name);
+ ListBox_SetItemData(hCtrl, dwIndex, sl->name);
+ }
+ ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopUpOptions.SkinPack));
+
+ //Skin List reload button
+ SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONSETASFLATBTN, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD,0));
+ SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0);
+
+ //Skin Option List
+ SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
+
+ //PreviewBox
+ WndProcPreviewBoxSave = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), GWLP_WNDPROC, (LONG_PTR)WndProcPreviewBox);
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+
+ //hooks
+ hhkFontsReload = HookEventMessage(ME_FONT_RELOAD, hwndDlg, WM_USER);
+
+ TranslateDialogDefault(hwndDlg);
+ bDlgInit = true;
+ }
+ return TRUE;
+
+ case WM_USER:
+ {
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ }
+ return TRUE;
+
+ case WM_COMMAND: {
+ HWND hCtrl = NULL;
+ UINT idCtrl = LOWORD(wParam);
+ switch (HIWORD(wParam)) {
+ case BN_KILLFOCUS: //Button controls
+ case BN_SETFOCUS: //Button controls
+ return TRUE;
+ break;
+ case BN_CLICKED: //Button controls
+ switch(idCtrl)
+ {
+ case IDC_PREVIEW:
+ {
+ PopUpPreview();
+ }
+ break;
+ case IDC_BTN_RELOAD:
+ {
+ LPTSTR Temp = NULL;
+ DWORD dwIndex = 0;
+ TCHAR szNewSkin[128];
+ LPTSTR pszOldSkin = mir_tstrdup(PopUpOptions.SkinPack);
+ skins.load(_T(""));
+ hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
+ ListBox_ResetContent(hCtrl);
+ for (const Skins::SKINLIST *sl = skins.getSkinList(); sl; sl = sl->next)
+ {
+ dwIndex = ListBox_AddString(hCtrl, sl->name);
+ ListBox_SetItemData(hCtrl, dwIndex, sl->name);
+ }
+ ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopUpOptions.SkinPack));
+ //make shure we have select skin (ListBox_SetCurSel may be fail)
+ ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
+ if(lstrcmp(pszOldSkin, szNewSkin) != 0) {
+ mir_free(PopUpOptions.SkinPack);
+ PopUpOptions.SkinPack = mir_tstrdup(szNewSkin);
+ }
+ mir_free(pszOldSkin);
+
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ //update Skin Option List from reload SkinPack
+ bDlgInit = false;
+ bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
+ }
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }//end IDC_BTN_RELOAD:
+ break;
+ case IDC_GETSKINS:
+ CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://addons.miranda-im.org/index.php?action=display&id=72");
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ break;
+ case CBN_SELCHANGE: //combo box controls
+ switch(idCtrl) {
+ case IDC_SKINLIST: {
+ //Skin list change
+ mir_free(PopUpOptions.SkinPack);
+ PopUpOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
+ hwndDlg,
+ IDC_SKINLIST,
+ LB_GETITEMDATA,
+ (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SKINLIST, LB_GETCURSEL,(WPARAM)0,(LPARAM)0),
+ (LPARAM)0) );
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
+ mir_free(PopUpOptions.SkinPack);
+ PopUpOptions.SkinPack = mir_tstrdup(skin->getName());
+
+ //update Skin Option List
+ bDlgInit = false;
+ bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
+ }
+ updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ default:
+ break;
+ }//end switch(idCtrl)
+ break;
+ default:
+ break;
+ }//end switch (HIWORD(wParam))
+ break;
+ }// end WM_COMMAND
+ return FALSE;
+
+ case WM_NOTIFY: {
+ if(!bDlgInit) return FALSE;
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0: {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ LoadOption_Skins();
+ return TRUE;
+ case PSN_APPLY:
+ { //skin pack
+ DBWriteContactSettingTString(NULL, MODULNAME, "SkinPack", PopUpOptions.SkinPack);
+ //skin options
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopUpOptions.SkinPack))
+ skin->saveOpts();
+ skins.freeAllButActive();
+ //more Skin options
+ DBWriteContactSettingByte(NULL, MODULNAME, "DisplayTime", PopUpOptions.DisplayTime);
+ DBWriteContactSettingByte(NULL, MODULNAME, "DropShadow", PopUpOptions.DropShadow);
+ DBWriteContactSettingByte(NULL, MODULNAME, "EnableShadowRegion", PopUpOptions.EnableFreeformShadows);
+ DBWriteContactSettingByte(NULL, MODULNAME, "EnableAeroGlass", PopUpOptions.EnableAeroGlass);
+ DBWriteContactSettingByte(NULL, MODULNAME, "UseMText", PopUpOptions.UseMText);
+ }//end PSN_APPLY:
+ return TRUE;
+ default:
+ break;
+ }//switch (((LPNMHDR)lParam)->code)
+ }// end case 0:
+ break;
+ default:
+ break;
+ }//end switch (((LPNMHDR)lParam)->idFrom)
+ }//end WM_NOTIFY:
+ return FALSE;
+
+ case WM_DESTROY:
+ {
+ if (wndPreview) {
+ delete wndPreview;
+ wndPreview = NULL;
+ gPreviewOk = false;
+ }
+ if (hhkFontsReload) UnhookEvent(hhkFontsReload);
+ if (skinOptions) {
+ for (int i = 0; i < skinOptionsCount; ++i) {
+ mir_free(skinOptions[i].pszOptionName);
+ mir_free(skinOptions[i].pszSettingName);
+ }
+ mir_free(skinOptions);
+ skinOptions = NULL;
+ skinOptionsCount = 0;
+ }
+ }
+ return TRUE;
+
+ default:
+ break;
+ }//end switch (msg)
+ return FALSE;
+}
+
+static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
+{
+ switch (mode)
+ {
+ case 0:
+ { // Avatar
+ HDC hdcAvatar = CreateCompatibleDC(mydc);
+ HBITMAP hbmSave = (HBITMAP)SelectObject(hdcAvatar, hbmNoAvatar);
+ RECT rc;
+ GetClientRect(hwnd, &rc);
+ BITMAP bmp;
+ GetObject(hbmNoAvatar, sizeof(bmp), &bmp);
+ StretchBlt(mydc, 0, 0, rc.right, rc.bottom, hdcAvatar, 0, 0, abs(bmp.bmWidth), abs(bmp.bmHeight), SRCCOPY);
+ SelectObject(hdcAvatar, hbmSave);
+ DeleteDC(hdcAvatar);
+ HRGN rgn = CreateRoundRectRgn(0, 0, rc.right, rc.bottom, 2 * PopUpOptions.avatarRadius, 2 * PopUpOptions.avatarRadius);
+ FrameRgn(mydc, rgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
+ DeleteObject(rgn);
+ break;
+ }
+ case 1:
+ { // Opacity
+ RECT rc;
+ HBRUSH hbr = CreateSolidBrush(fonts.clBack);
+ HFONT hfnt = (HFONT)SelectObject(mydc, fonts.title);
+ GetClientRect(hwnd, &rc);
+ FillRect(mydc, &rc, hbr);
+ DrawIconEx(mydc, 10, (rc.bottom-rc.top-16)/2, IcoLib_GetIcon(ICO_POPUP_ON,0), 16, 16, 0, hbr, DI_NORMAL);
+ SetBkMode(mydc, TRANSPARENT);
+ GetClientRect(hwnd, &rc);
+ rc.left += 30; // 10+16+4 -- icon
+ rc.right -= (rc.right-rc.left)/3;
+ rc.bottom -= (rc.bottom-rc.top)/3;
+ DrawText(mydc, _T(MODULNAME_LONG), lstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ GetClientRect(hwnd, &rc);
+ rc.left += 30; // 10+16+4 -- icon
+ rc.left += (rc.right-rc.left)/3;
+ rc.top += (rc.bottom-rc.top)/3;
+ DrawText(mydc, _T(MODULNAME_LONG), lstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ GetClientRect(hwnd, &rc);
+ FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
+ SelectObject(mydc, hfnt);
+ DeleteObject(hbr);
+ break;
+ }
+ case 2:
+ { // Position
+ RECT rc;
+ HBRUSH hbr;
+ hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
+ GetClientRect(hwnd, &rc);
+ FillRect(mydc, &rc, hbr);
+ DeleteObject(hbr);
+
+ hbr = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
+ GetClientRect(hwnd, &rc);
+ rc.right -= 100;
+ rc.top += 100;
+ FillRect(mydc, &rc, hbr);
+ DeleteObject(hbr);
+
+ HPEN hpen = (HPEN)SelectObject(mydc, CreatePen(PS_DOT, 1, RGB(0,0,0)));
+ MoveToEx(mydc, 0, 100, NULL);
+ LineTo (mydc, 201, 100);
+ MoveToEx(mydc, 100, 0, NULL);
+ LineTo (mydc, 100, 201);
+ DeleteObject(SelectObject(mydc, hpen));
+
+ HRGN hrgn = CreateRectRgn(0,0,0,0);
+ GetWindowRgn(hwnd, hrgn);
+ FrameRgn(mydc, hrgn, (HBRUSH)GetStockObject(BLACK_BRUSH), 1, 1);
+ DeleteObject(hrgn);
+
+ break;
+ }
+ }
+}
+
+INT_PTR CALLBACK BoxPreviewWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_PAINT:
+ {
+ if (GetUpdateRect(hwnd, 0, FALSE))
+ {
+ PAINTSTRUCT ps;
+ HDC mydc = BeginPaint(hwnd, &ps);
+ BoxPreview_OnPaint(hwnd, mydc, GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ EndPaint(hwnd, &ps);
+ return TRUE;
+ }
+ break;
+ }
+
+ case WM_PRINT:
+ case WM_PRINTCLIENT:
+ {
+ HDC mydc = (HDC)wParam;
+ BoxPreview_OnPaint(hwnd, mydc, GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ return TRUE;
+ }
+
+ case WM_LBUTTONDOWN:
+ {
+ ReleaseCapture();
+ SendMessage(hwnd, WM_SYSCOMMAND, 0xF012 /*SC_DRAGMOVE*/, 0);
+ return TRUE;
+ }
+ }
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+}
diff --git a/plugins/Popup/src/opt_skins.h b/plugins/Popup/src/opt_skins.h new file mode 100644 index 0000000000..4e06893d65 --- /dev/null +++ b/plugins/Popup/src/opt_skins.h @@ -0,0 +1,46 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opt_skins.h $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opt_skins_h__
+#define __opt_skins_h__
+
+#ifndef CS_DROPSHADOW
+#define CS_DROPSHADOW 0x00020000
+#endif
+#define BOXPREVIEW_WNDCLASS "PopupPreviewBoxWndclass"
+
+void RegisterOptPrevBox();
+
+void LoadOption_Skins();
+INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND, UINT, WPARAM, LPARAM);
+
+#endif // __opt_skins_h__
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp new file mode 100644 index 0000000000..d6d81c8103 --- /dev/null +++ b/plugins/Popup/src/opttree.cpp @@ -0,0 +1,442 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opttree.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem)
+{
+ union
+ {
+ char ansi[128];
+ WCHAR unicode[64];
+ } buf;
+
+#if defined(_UNICODE)
+ TVITEMW tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_TEXT;
+ tvi.hItem = hItem;
+ tvi.pszText = buf.unicode;
+ tvi.cchTextMax = SIZEOF(buf.unicode);
+ SendMessageW(hwndTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
+ tvi.pszText = TranslateW(tvi.pszText);
+ tvi.cchTextMax = lstrlenW(tvi.pszText);
+ SendMessageW(hwndTree, TVM_SETITEMW, 0, (LPARAM)&tvi);
+
+#else
+ if (g_popup.isOsUnicode && MySendMessageW)
+ {
+ TVITEMW tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_TEXT;
+ tvi.hItem = hItem;
+ tvi.pszText = buf.unicode;
+ tvi.cchTextMax = SIZEOF(buf.unicode);
+ MySendMessageW(hwndTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
+ tvi.pszText = TranslateW(tvi.pszText);
+ tvi.cchTextMax = lstrlenW(tvi.pszText);
+ MySendMessageW(hwndTree, TVM_SETITEMW, 0, (LPARAM)&tvi);
+ }
+ else {
+ TVITEMA tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_TEXT;
+ tvi.hItem = hItem;
+ tvi.pszText = buf.ansi;
+ tvi.cchTextMax = SIZEOF(buf.ansi);
+ SendMessageA(hwndTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
+ tvi.pszText = Translate(tvi.pszText);
+ tvi.cchTextMax = lstrlenA(tvi.pszText);
+ SendMessageA(hwndTree, TVM_SETITEMA, 0, (LPARAM)&tvi);
+ }
+#endif
+}
+
+void OptTree_Translate(HWND hwndTree)
+{
+ HTREEITEM hItem = TreeView_GetRoot(hwndTree);
+ while (hItem)
+ {
+ OptTree_TranslateItem(hwndTree, hItem);
+
+ HTREEITEM hItemTmp = 0;
+ if (hItemTmp = TreeView_GetChild(hwndTree, hItem))
+ {
+ hItem = hItemTmp;
+ } else
+ if (hItemTmp = TreeView_GetNextSibling(hwndTree, hItem))
+ {
+ hItem = hItemTmp;
+ } else
+ {
+ while (1)
+ {
+ if (!(hItem = TreeView_GetParent(hwndTree, hItem))) break;
+ if (hItemTmp = TreeView_GetNextSibling(hwndTree, hItem))
+ {
+ hItem = hItemTmp;
+ break;
+ }
+ }
+ }
+ }
+}
+
+HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+{
+ TVITEM tvi = {0};
+ TCHAR str[MAX_PATH];
+
+ if (hItem)
+ tvi.hItem = TreeView_GetChild(hwndTree, hItem);
+ else
+ tvi.hItem = TreeView_GetRoot(hwndTree);
+
+ if (!name)
+ return tvi.hItem;
+
+ tvi.mask = TVIF_TEXT;
+ tvi.pszText = str;
+ tvi.cchTextMax = MAX_PATH;
+
+ while (tvi.hItem)
+ {
+ TreeView_GetItem(hwndTree, &tvi);
+
+ if (!lstrcmp(tvi.pszText, name))
+ return tvi.hItem;
+
+ tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
+ }
+ return NULL;
+}
+
+HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconIndex)
+{
+ TCHAR itemName[1024];
+
+ TCHAR* sectionName;
+ int sectionLevel = 0;
+
+ HTREEITEM hSection = NULL, result = NULL;
+ lstrcpy(itemName, name);
+ sectionName = itemName;
+
+ while (sectionName)
+ {
+ // allow multi-level tree
+ TCHAR* pItemName = sectionName;
+ HTREEITEM hItem;
+
+ if (sectionName = _tcschr(sectionName, '/'))
+ {
+ // one level deeper
+ *sectionName = 0;
+ sectionName++;
+ }
+
+ hItem = OptTree_FindNamedTreeItemAt(hwndTree, hSection, pItemName);
+ if (!sectionName || !hItem)
+ {
+ if (!hItem)
+ {
+ TVINSERTSTRUCT tvis = {0};
+
+ tvis.hParent = hSection;
+ tvis.hInsertAfter = TVI_LAST;//TVI_SORT;
+ tvis.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_STATE;
+ tvis.item.pszText = pItemName;
+ tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
+ if (sectionName)
+ {
+ tvis.item.lParam = 0;
+ tvis.item.iImage = tvis.item.iSelectedImage = -1;
+ } else
+ {
+ tvis.item.lParam = lParam;
+ tvis.item.iImage = tvis.item.iSelectedImage = iconIndex;
+ tvis.item.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ }
+ hItem = TreeView_InsertItem(hwndTree, &tvis);
+ if (!sectionName)
+ result = hItem;
+ }
+ }
+ sectionLevel++;
+ hSection = hItem;
+ }
+
+ return result;
+}
+
+BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, int *result, int idcTree, OPTTREE_OPTION *options, int optionCount)
+{
+ enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
+
+ HWND hwndTree = GetDlgItem(hwnd, idcTree);
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ int indx;
+ TCHAR itemName[1024];
+ HIMAGELIST hImgLst;
+
+ TreeView_SelectItem(hwndTree, NULL);
+ TreeView_DeleteAllItems(hwndTree);
+
+ hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR|ILC_COLOR32|ILC_MASK, 5, 1);
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED));
+ if (g_popup.MirVer >= PLUGIN_MAKE_VERSION(0,7,0,2))
+ {
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_TICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_TICK));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ } else
+ {
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_OPT_CHECK_ON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED)); // check buttons
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_OPT_CHECK_OFF), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED)); // check buttons
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_OPT_CHECK_ON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED)); // check buttons
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_OPT_CHECK_OFF), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED)); // check buttons
+// ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_OPT_RADIO_ON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED)); // radio buttons
+// ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_OPT_RADIO_OFF), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR|LR_SHARED)); // radio buttons
+ }
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN));
+ ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT));
+ TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
+
+ /* build options tree. based on code from IcoLib */
+ for (indx = 0; indx < optionCount; indx++)
+ {
+ TCHAR* sectionName;
+ int sectionLevel = 0;
+
+ HTREEITEM hSection = NULL;
+ lstrcpy(itemName, options[indx].pszOptionName);
+ sectionName = itemName;
+
+ while (sectionName)
+ {
+ // allow multi-level tree
+ TCHAR* pItemName = sectionName;
+ HTREEITEM hItem;
+
+ if (sectionName = _tcschr(sectionName, '/'))
+ {
+ // one level deeper
+ *sectionName = 0;
+ sectionName++;
+ }
+
+ hItem = OptTree_FindNamedTreeItemAt(hwndTree, hSection, pItemName);
+ if (!sectionName || !hItem)
+ {
+ if (!hItem)
+ {
+ TVINSERTSTRUCT tvis = {0};
+
+ tvis.hParent = hSection;
+ tvis.hInsertAfter = TVI_LAST;//TVI_SORT;
+ tvis.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_STATE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.pszText = pItemName;
+ tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
+ if (sectionName)
+ {
+ tvis.item.lParam = -1;
+ tvis.item.state |= TVIS_BOLD;
+ tvis.item.stateMask |= TVIS_BOLD;
+ tvis.item.iImage = tvis.item.iSelectedImage = IMG_GRPOPEN;
+ } else
+ {
+ tvis.item.lParam = indx;
+ if (options[indx].groupId == OPTTREE_CHECK)
+ {
+ tvis.item.iImage = tvis.item.iSelectedImage = IMG_NOCHECK;
+ } else
+ {
+ tvis.item.iImage = tvis.item.iSelectedImage = IMG_NORCHECK;
+ }
+ }
+ hItem = TreeView_InsertItem(hwndTree, &tvis);
+ if (!sectionName)
+ options[indx].hItem = hItem;
+ }
+ }
+ sectionLevel++;
+ hSection = hItem;
+ }
+ }
+
+ OptTree_Translate(hwndTree);
+ ShowWindow(hwndTree, SW_SHOW);
+ TreeView_SelectItem(hwndTree, OptTree_FindNamedTreeItemAt(hwndTree, 0, NULL));
+ break;
+ }
+
+ case WM_DESTROY:
+ {
+ ImageList_Destroy(TreeView_GetImageList(hwndTree, TVSIL_NORMAL));
+ break;
+ }
+
+ case WM_NOTIFY:
+ {
+ LPNMHDR lpnmhdr = (LPNMHDR)lparam;
+ if (lpnmhdr->idFrom != idcTree) break;
+ switch (lpnmhdr->code)
+ {
+ case NM_CLICK:
+ {
+ TVHITTESTINFO hti;
+ hti.pt.x=(short)LOWORD(GetMessagePos());
+ hti.pt.y=(short)HIWORD(GetMessagePos());
+ ScreenToClient(lpnmhdr->hwndFrom,&hti.pt);
+ if(TreeView_HitTest(lpnmhdr->hwndFrom,&hti))
+ {
+ if(hti.flags&TVHT_ONITEMICON)
+ {
+ TVITEM tvi;
+ tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.hItem=hti.hItem;
+ TreeView_GetItem(lpnmhdr->hwndFrom,&tvi);
+ switch (tvi.iImage)
+ {
+ case IMG_GRPOPEN:
+ tvi.iImage = tvi.iSelectedImage = IMG_GRPCLOSED;
+ TreeView_Expand(lpnmhdr->hwndFrom, tvi.hItem, TVE_COLLAPSE);
+ break;
+ case IMG_GRPCLOSED:
+ tvi.iImage = tvi.iSelectedImage = IMG_GRPOPEN;
+ TreeView_Expand(lpnmhdr->hwndFrom, tvi.hItem, TVE_EXPAND);
+ break;
+
+ case IMG_CHECK:
+ tvi.iImage = tvi.iSelectedImage = IMG_NOCHECK;
+ *result = tvi.lParam;
+ options[tvi.lParam].bState = FALSE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IMG_NOCHECK:
+ tvi.iImage = tvi.iSelectedImage = IMG_CHECK;
+ *result = tvi.lParam;
+ options[tvi.lParam].bState = TRUE;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ case IMG_NORCHECK:
+ {
+ int i;
+ for (i = 0; i < optionCount; ++i)
+ {
+ if (options[i].groupId == options[tvi.lParam].groupId)
+ {
+ TVITEM tvi_tmp;
+ tvi_tmp.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi_tmp.hItem = options[i].hItem;
+ tvi_tmp.iImage = tvi_tmp.iSelectedImage = IMG_NORCHECK;
+ TreeView_SetItem(lpnmhdr->hwndFrom, &tvi_tmp);
+ }
+ }
+ tvi.iImage = tvi.iSelectedImage = IMG_RCHECK;
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ break;
+ }
+ }
+ TreeView_SetItem(lpnmhdr->hwndFrom,&tvi);
+ }
+ }
+ break;
+ }
+
+ case TVN_ITEMEXPANDED:
+ {
+ LPNMTREEVIEW lpnmtv = (LPNMTREEVIEW)lparam;
+ TVITEM tvi;
+ tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.hItem = lpnmtv->itemNew.hItem;
+ tvi.iImage = tvi.iSelectedImage =
+ (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
+ TreeView_SetItem(lpnmhdr->hwndFrom,&tvi);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ return FALSE;
+}
+
+DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, LPTSTR pszSettingName)
+{
+ enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
+
+ HWND hwndTree = GetDlgItem(hwnd, idcTree);
+ DWORD result = 0;
+ int i;
+ for (i = 0; i < optionCount; ++i)
+ {
+ if ((!options[i].pszSettingName && !pszSettingName) ||
+ (options[i].pszSettingName && pszSettingName && !lstrcmp(options[i].pszSettingName, pszSettingName)))
+ {
+ TVITEM tvi;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE;
+ tvi.hItem = options[i].hItem;
+ TreeView_GetItem(hwndTree, &tvi);
+ if ((tvi.iImage == IMG_CHECK) || (tvi.iImage == IMG_RCHECK))
+ result |= options[i].dwFlag;
+ }
+ }
+ return result;
+}
+
+void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, DWORD dwOptions, LPTSTR pszSettingName)
+{
+ enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
+
+ HWND hwndTree = GetDlgItem(hwnd, idcTree);
+ int i;
+ for (i = 0; i < optionCount; ++i)
+ {
+ if ((!options[i].pszSettingName && !pszSettingName) ||
+ (options[i].pszSettingName && pszSettingName && !lstrcmp(options[i].pszSettingName, pszSettingName)))
+ {
+ TVITEM tvi;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.hItem = options[i].hItem;
+ if (options[i].groupId == OPTTREE_CHECK)
+ {
+ tvi.iImage = tvi.iSelectedImage = (dwOptions & options[i].dwFlag) ? IMG_CHECK : IMG_NOCHECK;
+ } else
+ {
+ tvi.iImage = tvi.iSelectedImage = (dwOptions & options[i].dwFlag) ? IMG_RCHECK : IMG_NORCHECK;
+ }
+ TreeView_SetItem(hwndTree, &tvi);
+ }
+ }
+}
diff --git a/plugins/Popup/src/opttree.h b/plugins/Popup/src/opttree.h new file mode 100644 index 0000000000..8718ca8cb1 --- /dev/null +++ b/plugins/Popup/src/opttree.h @@ -0,0 +1,57 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/opttree.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __opttree_h__
+#define __opttree_h__
+
+#define OPTTREE_CHECK 0
+
+typedef struct {
+ int iconIndex;
+ LPTSTR pszOptionName;
+ int groupId;
+ DWORD dwFlag;
+ HTREEITEM hItem;
+ LPTSTR pszSettingName;
+ BOOL bState;
+ int Data; //free for use (depend on data)
+} OPTTREE_OPTION;
+
+BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL *result, int idcTree, OPTTREE_OPTION *options, int optionCount);
+DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, LPTSTR pszSettingName = NULL);
+void OptTree_SetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, DWORD dwOptions, LPTSTR pszSettingName = NULL);
+
+void OptTree_Translate(HWND hwndTree);
+HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, LPCTSTR name);
+HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam = 0, int iconIndex = -1);
+
+#endif // __opttree_h__
diff --git a/plugins/Popup/src/popup_gdiplus.cpp b/plugins/Popup/src/popup_gdiplus.cpp new file mode 100644 index 0000000000..186fedb238 --- /dev/null +++ b/plugins/Popup/src/popup_gdiplus.cpp @@ -0,0 +1,223 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright � 2002 Luca Santarelli,
+ � 2004-2007 Victor Pavlychko
+ � 2010 MPK
+ � 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/popup_gdiplus.cpp $
+Revision : $Revision: 1622 $
+Last change on : $Date: 2010-06-23 23:32:21 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+/* 99% of this code was adopted from clist_modern by FYR */
+
+#include "headers.h"
+
+#undef Translate
+
+// fix for old SDK and new GDI+
+#define ULONG_PTR unsigned long
+
+#include "gdiplus.h"
+
+DWORD g_gdiplusToken;
+bool gbGdiPlusLoaded;
+
+void LoadGDIPlus()
+{
+ Gdiplus::GdiplusStartupInput gdiplusStartupInput;
+ gbGdiPlusLoaded = false;
+ __try {
+ if (g_gdiplusToken == 0)
+ Gdiplus::GdiplusStartup(&g_gdiplusToken, &gdiplusStartupInput, NULL);
+ }
+ __except ( EXCEPTION_EXECUTE_HANDLER ) {
+ gbGdiPlusLoaded = false;
+ }
+}
+
+void UnloadGDIPlus()
+{
+ Gdiplus::GdiplusStartupInput gdiplusStartupInput;
+ __try {
+ if (g_gdiplusToken && gbGdiPlusLoaded)
+ Gdiplus::GdiplusShutdown(g_gdiplusToken);
+ }
+ __except ( EXCEPTION_EXECUTE_HANDLER ) {
+ // do nothing
+ }
+ gbGdiPlusLoaded = true;
+ g_gdiplusToken = 0;
+}
+
+using namespace Gdiplus;
+
+/////////////////////////////////////////////////////////////////////////////////
+// GDIPlus_IsAnimatedGIF and GDIPlus_ExtractAnimatedGIF
+// based on routine from http://www.codeproject.com/vcpp/gdiplus/imageexgdi.asp
+//
+
+HBITMAP SkinEngine_CreateDIB32(int cx, int cy)
+{
+ BITMAPINFO RGB32BitsBITMAPINFO;
+ UINT * ptPixels;
+ HBITMAP DirectBitmap;
+
+ if ( cx < 0 || cy < 0 ) {
+ return NULL;
+ }
+
+ ZeroMemory(&RGB32BitsBITMAPINFO,sizeof(BITMAPINFO));
+ RGB32BitsBITMAPINFO.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+ RGB32BitsBITMAPINFO.bmiHeader.biWidth=cx;//bm.bmWidth;
+ RGB32BitsBITMAPINFO.bmiHeader.biHeight=cy;//bm.bmHeight;
+ RGB32BitsBITMAPINFO.bmiHeader.biPlanes=1;
+ RGB32BitsBITMAPINFO.bmiHeader.biBitCount=32;
+ // pointer used for direct Bitmap pixels access
+
+
+ DirectBitmap = CreateDIBSection(NULL,
+ (BITMAPINFO *)&RGB32BitsBITMAPINFO,
+ DIB_RGB_COLORS,
+ (void **)&ptPixels,
+ NULL, 0);
+ if ((DirectBitmap == NULL || ptPixels == NULL) && cx!= 0 && cy!=0)
+ {
+ ;
+ }
+ else
+ {
+ memset(ptPixels,0,cx*cy*4);
+ }
+ return DirectBitmap;
+}
+
+
+BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName)
+{
+ int nFrameCount=0;
+ Image image(szName);
+ UINT count = 0;
+
+ count = image.GetFrameDimensionsCount();
+ GUID* pDimensionIDs = new GUID[count];
+
+ // Get the list of frame dimensions from the Image object.
+ image.GetFrameDimensionsList(pDimensionIDs, count);
+
+ // Get the number of frames in the first dimension.
+ nFrameCount = image.GetFrameCount(&pDimensionIDs[0]);
+
+ delete []pDimensionIDs;
+
+ return (BOOL) (nFrameCount > 1) && image.GetWidth() && image.GetHeight();
+}
+
+void GDIPlus_GetGIFSize(TCHAR * szName, int * width, int * height)
+{
+ Image image(szName);
+
+ *width = image.GetWidth();
+ *height = image.GetHeight();
+}
+
+void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * pBitmap, int ** pframesDelay, int * pframesCount, SIZE * pSizeAvatar)
+{
+ int nFrameCount=0;
+ Bitmap image(szName);
+ PropertyItem * pPropertyItem;
+
+ UINT count = 0;
+
+ count = image.GetFrameDimensionsCount();
+ GUID* pDimensionIDs = new GUID[count];
+
+ // Get the list of frame dimensions from the Image object.
+ image.GetFrameDimensionsList(pDimensionIDs, count);
+
+ // Get the number of frames in the first dimension.
+ nFrameCount = image.GetFrameCount(&pDimensionIDs[0]);
+
+ // Assume that the image has a property item of type PropertyItemEquipMake.
+ // Get the size of that property item.
+ int nSize = image.GetPropertyItemSize(PropertyTagFrameDelay);
+
+ // Allocate a buffer to receive the property item.
+ pPropertyItem = (PropertyItem*) mir_alloc(nSize);
+
+ image.GetPropertyItem(PropertyTagFrameDelay, nSize, pPropertyItem);
+
+ int clipWidth;
+ int clipHeight;
+ int imWidth=image.GetWidth();
+ int imHeight=image.GetHeight();
+ float xscale=(float)width/imWidth;
+ float yscale=(float)height/imHeight;
+ xscale=min(xscale,yscale);
+ clipWidth=(int)(xscale*imWidth+.5);
+ clipHeight=(int)(xscale*imHeight+.5);
+
+ HBITMAP hBitmap=SkinEngine_CreateDIB32(clipWidth*nFrameCount, height);
+ HDC hdc=CreateCompatibleDC(NULL);
+ HBITMAP oldBmp=(HBITMAP)SelectObject(hdc,hBitmap);
+ Graphics graphics(hdc);
+ ImageAttributes attr;
+ ColorMatrix ClrMatrix =
+ {
+ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, ((float)255)/255, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f, 1.0f
+ };
+ //attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
+ graphics.SetInterpolationMode(InterpolationModeHighQualityBicubic);
+
+ int * delays=(int*)mir_alloc(nFrameCount*sizeof(int));
+ memset(delays,0,nFrameCount*sizeof(int));
+
+ for (int i=1; i<nFrameCount+1; i++)
+ {
+ GUID pageGuid = FrameDimensionTime;
+ RectF rect((float)(i-1)*clipWidth,(float)0,(float)clipWidth,(float)clipHeight);
+ graphics.DrawImage(&image, rect, (float)0, (float)0, (float)imWidth, (float)imHeight , UnitPixel, &attr, NULL, NULL);
+ image.SelectActiveFrame(&pageGuid, i);
+ long lPause = ((long*) pPropertyItem->value)[i-1] * 10;
+ delays[i-1]=(int)lPause;
+ }
+ SelectObject(hdc,oldBmp);
+ DeleteDC(hdc);
+ mir_free(pPropertyItem);
+ pPropertyItem = NULL;
+ delete []pDimensionIDs;
+ if (pBitmap && pframesDelay && pframesCount && pSizeAvatar)
+ {
+ *pBitmap=hBitmap;
+ *pframesDelay=delays;
+ *pframesCount=nFrameCount;
+ pSizeAvatar->cx=clipWidth;
+ pSizeAvatar->cy=clipHeight;
+ }
+ GdiFlush();
+}
diff --git a/plugins/Popup/src/popup_gdiplus.h b/plugins/Popup/src/popup_gdiplus.h new file mode 100644 index 0000000000..1214199940 --- /dev/null +++ b/plugins/Popup/src/popup_gdiplus.h @@ -0,0 +1,42 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright � 2002 Luca Santarelli,
+ � 2004-2007 Victor Pavlychko
+ � 2010 MPK
+ � 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/popup_gdiplus.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+#ifndef __popup_gdiplus_h__
+#define __popup_gdiplus_h__
+
+void LoadGDIPlus();
+void UnloadGDIPlus();
+
+BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName);
+void GDIPlus_GetGIFSize(TCHAR * szName, int * width, int * height);
+void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * pBitmap, int ** pframesDelay, int * pframesCount, SIZE * pSizeAvatar);
+
+#endif // __popup_gdiplus_h__
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp new file mode 100644 index 0000000000..2376653cba --- /dev/null +++ b/plugins/Popup/src/popup_thread.cpp @@ -0,0 +1,372 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/popup_thread.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+#include <process.h>
+//#include <list>
+
+// globals
+//static unsigned idPopupThread = 0;
+static int gIdleRequests = 0;
+static bool gTerminating = false;
+static HANDLE hThreadMutex = NULL;
+static HWND gHwndManager = 0;
+static int gLockCount = 0;
+static volatile int nPopups = 0;
+
+//typedef std::list<PopupWnd2 *> PopupList;
+typedef LIST<PopupWnd2> PopupList;
+static PopupList popupList(3);
+
+// forwards
+enum
+{ // message id's
+ UTM_PT_FIRST = WM_USER+1607,
+ UTM_STOP_THREAD,
+ UTM_ADD_WINDOW,
+ UTM_UPDATE_WINDOW,
+ UTM_REMOVE_WINDOW,
+ UTM_REQUEST_IDLE,
+ UTM_LOCK_QUEUE,
+ UTM_UNLOCK_QUEUE,
+ UTM_REQUEST_REMOVE
+};
+static void __cdecl PopupThread(void *arg);
+
+// interface
+void LoadPopupThread()
+{
+ hThreadMutex = CreateMutex(NULL, FALSE, NULL);
+ _beginthread(PopupThread, 0, NULL);
+// _beginthreadex(NULL, 0, PopupThread, NULL, 0, &idPopupThread);
+}
+
+void StopPopupThread()
+{
+ PostMessage(gHwndManager, UTM_STOP_THREAD, 0, 0);
+}
+
+void UnloadPopupThread()
+{
+// We won't waint for thread to exit, Miranda's thread unsind mechanism will do that for us.
+ WaitForSingleObject(hThreadMutex, INFINITE);
+ CloseHandle(hThreadMutex);
+}
+
+void PopupThreadLock()
+{
+ PostMessage(gHwndManager, UTM_LOCK_QUEUE, 0, 0);
+}
+
+void PopupThreadUnlock()
+{
+ PostMessage(gHwndManager, UTM_UNLOCK_QUEUE, 0, 0);
+}
+
+bool PopupThreadIsFull()
+{
+// char buf[128];
+// wsprintf(buf, "%d, %d", nPopups, PopUpOptions.MaxPopups);
+// MessageBoxA(NULL, buf, "Popup Plus", MB_OK);
+ return nPopups >= PopUpOptions.MaxPopups;
+}
+
+bool PopupThreadAddWindow(PopupWnd2 *wnd)
+{
+ PostMessage(gHwndManager, UTM_ADD_WINDOW, 0, (LPARAM)wnd);
+ return true;
+}
+
+bool PopupThreadRemoveWindow(PopupWnd2 *wnd)
+{
+ PostMessage(gHwndManager, UTM_REMOVE_WINDOW, 0, (LPARAM)wnd);
+ return true;
+}
+
+bool PopupThreadUpdateWindow(PopupWnd2 *wnd)
+{
+ PostMessage(gHwndManager, UTM_UPDATE_WINDOW, 0, (LPARAM)wnd);
+ return true;
+}
+
+bool PopupThreadRequestRemoveWindow(PopupWnd2 *wnd)
+{
+ PostMessage(gHwndManager, UTM_REQUEST_REMOVE, 0, (LPARAM)wnd);
+ return true;
+}
+
+bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd)
+{
+ if (!wnd) return false;
+ if (!PopUpOptions.ReorderPopUps && wnd->isPositioned()) return false;
+
+ int POPUP_SPACING = PopUpOptions.spacing;
+
+ POINT pos;
+ SIZE prevSize = {0}, curSize = wnd->getSize();
+ if (prev) prevSize = prev->getSize();
+
+ RECT rc;
+// SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
+
+#if !defined(_UNICODE)
+ //Win95 or NT don't have the support for multi monitor.
+ if (!MyGetMonitorInfo) {
+ SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0);
+ }
+ //Windows 98/ME/2000/XP do have it.
+ else
+#endif
+ if (GetSystemMetrics(SM_CMONITORS)==1) { //we have only one monitor (cant check it together with 1.if)
+ SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0);
+ }
+ else { //Multimonitor stuff (we have more then 1)
+ HMONITOR hMonitor = NULL;
+ HWND hWnd = NULL;
+ MONITORINFOEX mnti; // = { 0 };
+
+ if (PopUpOptions.Monitor == MN_MIRANDA)
+ hWnd = (HWND)CallService(MS_CLUI_GETHWND,0,0);
+ else // PopUpOptions.Monitor == MN_ACTIVE
+ hWnd = GetForegroundWindow();
+
+ mnti.cbSize = sizeof(MONITORINFOEX);
+
+#if defined(_UNICODE)
+ hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);
+ if (GetMonitorInfo(hMonitor, (LPMONITORINFO)&mnti) == TRUE) //It worked
+#else
+ hMonitor = MyMonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);
+ if (MyGetMonitorInfo(hMonitor, (LPMONITORINFO)&mnti) == TRUE) //It worked
+#endif
+ CopyMemory(&rc, &(mnti.rcWork), sizeof(RECT));
+ else
+ SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0);
+ }
+
+ rc.left += PopUpOptions.gapLeft - POPUP_SPACING;
+ rc.right -= PopUpOptions.gapRight - POPUP_SPACING;
+ rc.top += PopUpOptions.gapTop - POPUP_SPACING;
+ rc.bottom -= PopUpOptions.gapBottom - POPUP_SPACING;
+ if (PopUpOptions.Spreading == SPREADING_VERTICAL)
+ {
+ switch (PopUpOptions.Position)
+ {
+ case POS_UPPERLEFT:
+ pos.x = rc.left + POPUP_SPACING;
+ pos.y = (prev ? (prev->getPosition().y + prev->getSize().cy) : rc.top) + POPUP_SPACING;
+ break;
+ case POS_LOWERLEFT:
+ pos.x = rc.left + POPUP_SPACING;
+ pos.y = (prev ? prev->getPosition().y : rc.bottom) - wnd->getSize().cy - POPUP_SPACING;
+ break;
+ case POS_LOWERRIGHT:
+ pos.x = rc.right - wnd->getSize().cx - POPUP_SPACING;
+ pos.y = (prev ? prev->getPosition().y : rc.bottom) - wnd->getSize().cy - POPUP_SPACING;
+ break;
+ case POS_UPPERRIGHT:
+ pos.x = rc.right - wnd->getSize().cx - POPUP_SPACING;
+ pos.y = (prev ? (prev->getPosition().y + prev->getSize().cy) : rc.top) + POPUP_SPACING;
+ break;
+ }
+ } else
+ // if (PopUpOptions.Spreading == SPREADING_HORIZONTAL)
+ {
+ switch (PopUpOptions.Position)
+ {
+ case POS_UPPERLEFT:
+ pos.x = (prev ? (prev->getPosition().x + prev->getSize().cx) : rc.left) + POPUP_SPACING;
+ pos.y = rc.top + POPUP_SPACING;
+ break;
+ case POS_LOWERLEFT:
+ pos.x = (prev ? (prev->getPosition().x + prev->getSize().cx) : rc.left) + POPUP_SPACING;
+ pos.y = rc.bottom - wnd->getSize().cy - POPUP_SPACING;
+ break;
+ case POS_LOWERRIGHT:
+ pos.x = (prev ? prev->getPosition().x : rc.right) - wnd->getSize().cx - POPUP_SPACING;
+ pos.y = rc.bottom - wnd->getSize().cy - POPUP_SPACING;
+ break;
+ case POS_UPPERRIGHT:
+ pos.x = (prev ? prev->getPosition().x : rc.right) - wnd->getSize().cx - POPUP_SPACING;
+ pos.y = rc.top + POPUP_SPACING;
+ break;
+ }
+ }
+ wnd->setPosition(pos);
+ return true;
+}
+
+void RepositionPopups()
+{
+ PopupWnd2 *prev = 0;
+ if (PopUpOptions.ReorderPopUps)
+ {
+ for (int i = 0; i < popupList.getCount(); ++i)
+ {
+ UpdatePopupPosition(prev, popupList[i]);
+ prev = popupList[i];
+ }
+ }
+}
+
+static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ PopupWnd2 *wnd = NULL;
+ if (message == UTM_ADD_WINDOW ||
+ message == UTM_UPDATE_WINDOW ||
+ message == UTM_REMOVE_WINDOW ||
+ message == UTM_REQUEST_REMOVE)
+ {
+ if (!(wnd = (PopupWnd2 *)lParam))
+ return 0;
+ }
+ switch (message)
+ {
+ case UTM_STOP_THREAD:
+ {
+ gTerminating = true;
+ if (DBGetContactSettingByte(NULL, MODULNAME, "FastExit", 0))
+ for (int i = 0; i < popupList.getCount(); ++i)
+ PUDeletePopUp(popupList[i]->getHwnd());
+ PostQuitMessage(0);
+ break;
+ }
+ case UTM_ADD_WINDOW:
+ {
+ if (gTerminating) break;
+ UpdatePopupPosition(popupList.getCount() ? popupList[popupList.getCount()-1] : 0, wnd);
+ popupList.insert(wnd);
+ ++nPopups;
+ wnd->callMethodAsync(&PopupWnd2::m_show, 0);
+ break;
+ }
+ case UTM_UPDATE_WINDOW:
+ {
+ RepositionPopups();
+ break;
+ }
+ case UTM_REQUEST_REMOVE:
+ {
+ if ((PopUpOptions.LeaveHovered && gLockCount) || (wnd && wnd->isLocked()))
+ {
+ wnd->updateTimer();
+ } else
+ {
+ PostMessage(wnd->getHwnd(), WM_CLOSE, 0, 0);
+ }
+ break;
+ }
+ case UTM_REMOVE_WINDOW:
+ {
+ // popupList.remove(ptr) would be nicer, but it requires sortFunc :(
+ for (int i = 0; i < popupList.getCount(); ++i)
+ if (popupList[i] == wnd)
+ {
+ popupList.remove(i);
+ RepositionPopups();
+ --nPopups;
+ delete wnd;
+ break;
+ }
+ break;
+ }
+ case UTM_LOCK_QUEUE:
+ {
+ ++gLockCount;
+ break;
+ }
+ case UTM_UNLOCK_QUEUE:
+ {
+ if (--gLockCount < 0)
+ gLockCount = 0;
+ break;
+ }
+ }
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
+
+// thread func
+static void __cdecl PopupThread(void *arg)
+{
+ // grab the mutex
+ if (WaitForSingleObject(hThreadMutex, INFINITE) != WAIT_OBJECT_0)
+ { // other thread is already running
+ _endthread();
+ return;
+ }
+
+ // Increment Miranda thread counter
+ CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+
+ // Create manager window
+ DWORD err;
+ WNDCLASSEX wcl;
+ wcl.cbSize = sizeof(wcl);
+ wcl.lpfnWndProc = PopupThreadManagerWndProc;
+ wcl.style = 0;
+ wcl.cbClsExtra = 0;
+ wcl.cbWndExtra = 0;
+ wcl.hInstance = hInst;
+ wcl.hIcon = NULL;
+ wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.lpszMenuName = NULL;
+ wcl.lpszClassName = _T("PopupThreadManagerWnd");
+ wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+ g_wndClass.cPopupThreadManagerWnd = RegisterClassEx(&wcl);
+ err = GetLastError();
+ if (!g_wndClass.cPopupThreadManagerWnd) {
+ TCHAR msg[1024];
+ wsprintf(msg, TranslateT("Failed to register %s class."),wcl.lpszClassName);
+ MSGERROR(msg);
+ }
+
+ gHwndManager = CreateWindow(_T("PopupThreadManagerWnd"), NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
+ SetWindowPos(gHwndManager, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_HIDEWINDOW);
+
+ MSG msg;
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ ReleaseMutex(hThreadMutex);
+
+ // Decrement Miranda thread counter
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+
+ // Ok, now we can kill this thread
+ _endthread();
+
+ return;
+}
diff --git a/plugins/Popup/src/popup_thread.h b/plugins/Popup/src/popup_thread.h new file mode 100644 index 0000000000..98e9c75725 --- /dev/null +++ b/plugins/Popup/src/popup_thread.h @@ -0,0 +1,52 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/popup_thread.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __popup_thread_h__
+#define __popup_thread_h__
+
+void LoadPopupThread();
+void StopPopupThread();
+void UnloadPopupThread();
+
+void PopupThreadLock();
+void PopupThreadUnlock();
+
+class PopupWnd2;
+
+bool PopupThreadIsFull();
+bool PopupThreadAddWindow(PopupWnd2 *wnd);
+bool PopupThreadRemoveWindow(PopupWnd2 *wnd);
+bool PopupThreadUpdateWindow(PopupWnd2 *wnd);
+
+bool PopupThreadRequestRemoveWindow(PopupWnd2 *wnd);
+
+#endif // __popup_thread_h__
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp new file mode 100644 index 0000000000..785c0e706e --- /dev/null +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -0,0 +1,1945 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/popup_wnd2.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+#include "bitmap_funcs.h"
+#include <math.h>
+
+#define POPUP_WNDCLASS "PopupWnd2"
+
+#ifndef CS_DROPSHADOW
+#define CS_DROPSHADOW 0x00020000
+#endif
+
+#define ULW_ALPHA 0x00000002
+#define AC_SRC_ALPHA 0x01
+
+#define POPUP_TIMER 1607
+#define AVATAR_TIMER 1608
+#define CURSOR_TIMER 1609
+
+#define UM_AVATARCHANGED (WM_USER+0x300)
+#define UM_MENUDONE (WM_USER+0x301)
+#define UM_SHOWMENU (WM_USER+0x302)
+
+HWND ghwndMenuHost = NULL;
+
+void WindowThread(void *arg);
+
+LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
+
+bool LoadPopupWnd2()
+{
+ bool res = true;
+ DWORD err;
+
+ WNDCLASSEX wcl;
+ wcl.cbSize = sizeof(wcl);
+ wcl.lpfnWndProc = PopupWnd2::WindowProc;
+ wcl.style = 0;
+ wcl.cbClsExtra = 0;
+ wcl.cbWndExtra = 0;
+ wcl.hInstance = hInst;
+ wcl.hIcon = NULL;
+ wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.lpszMenuName = NULL;
+ wcl.lpszClassName = _T(POPUP_WNDCLASS);
+ wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+ g_wndClass.cPopupWnd2 = RegisterClassEx(&wcl);
+ err = GetLastError();
+ if (!g_wndClass.cPopupWnd2) {
+ res = false;
+ TCHAR msg[1024];
+ wsprintf(msg, TranslateT("Failed to register %s class."),wcl.lpszClassName);
+ MessageBox(NULL, msg, _T(MODULNAME_LONG), MB_ICONSTOP|MB_OK);
+ }
+
+ // register custom class for edit box with drop-shadow attribute
+ if (IsWinVerXPPlus())
+ {
+ #if defined(_UNICODE) || defined(_WIN64)
+ #define MyRegisterClassExW RegisterClassExW
+ #define MyGetClassInfoExW GetClassInfoExW
+ #else
+ ATOM (WINAPI *MyRegisterClassExW)(CONST WNDCLASSEXW *);
+ MyRegisterClassExW = (ATOM (WINAPI *)(CONST WNDCLASSEXW *))GetProcAddress(hUserDll, "RegisterClassExW");
+ BOOL (WINAPI *MyGetClassInfoExW)(HINSTANCE, LPCWSTR, LPWNDCLASSEXW);
+ MyGetClassInfoExW = (BOOL (WINAPI *)(HINSTANCE, LPCWSTR, LPWNDCLASSEXW))GetProcAddress(hUserDll, "GetClassInfoExW");
+ #endif
+ WNDCLASSEXW wclw = {0};
+ wclw.cbSize = sizeof(wclw);
+ if (!MyGetClassInfoExW(NULL, L"EDIT", &wclw))
+ MSGERROR(TranslateT("Failed to GetClassInfoExW from EDIT class."));
+ wclw.hInstance = hInst;
+ wclw.lpszClassName = L"PopupEditBox";
+ wclw.style |= CS_DROPSHADOW;
+ g_wndClass.cPopupEditBox = MyRegisterClassExW(&wclw);
+ err = GetLastError();
+ if (!g_wndClass.cPopupEditBox) {
+ TCHAR msg[2048];
+ wsprintf(msg, _T("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
+ wclw.cbSize, //UINT cbSize;
+ wclw.style, //UINT style;
+ wclw.lpfnWndProc, //WNDPROC lpfnWndProc;
+ wclw.cbClsExtra, //int cbClsExtra;
+ wclw.cbWndExtra, //int cbWndExtra;
+ wclw.hInstance, //HINSTANCE hInstance;
+ wclw.hIcon, //HICON hIcon;
+ wclw.hCursor, //HCURSOR hCursor;
+ wclw.hbrBackground, //HBRUSH hbrBackground;
+ wclw.lpszMenuName, //LPCWSTR lpszMenuName;
+ wclw.lpszClassName, //LPCWSTR lpszClassName;
+ wclw.hIconSm //HICON hIconSm;
+ );
+
+ MSGERROR(msg);
+ }
+ }
+
+ ZeroMemory(&wcl, sizeof(wcl));
+ wcl.cbSize = sizeof(wcl);
+ wcl.lpfnWndProc = MenuHostWndProc;
+ wcl.style = 0;
+ wcl.cbClsExtra = 0;
+ wcl.cbWndExtra = 0;
+ wcl.hInstance = hInst;
+ wcl.hIcon = NULL;
+ wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.lpszMenuName = NULL;
+ wcl.lpszClassName = _T("PopupMenuHostWnd");
+ wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+ g_wndClass.cPopupMenuHostWnd = RegisterClassEx(&wcl);
+ err = GetLastError();
+ if (!g_wndClass.cPopupMenuHostWnd) {
+ res = false;
+ TCHAR msg[1024];
+ wsprintf(msg, TranslateT("Failed to register %s class."),wcl.lpszClassName);
+ MSGERROR(msg);
+ }
+
+ ghwndMenuHost = CreateWindow(_T("PopupMenuHostWnd"), NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
+ SetWindowPos(ghwndMenuHost, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_HIDEWINDOW);
+
+ INITCOMMONCONTROLSEX iccex;
+ iccex.dwICC = ICC_WIN95_CLASSES;
+ iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ InitCommonControlsEx(&iccex);
+
+ res = res && ghwndMenuHost;
+
+ return res;
+}
+
+void UnloadPopupWnd2()
+{
+ DestroyWindow(ghwndMenuHost);
+}
+
+PopupWnd2::PopupWnd2(POPUPDATA2 *ppd, POPUPOPTIONS *theCustomOptions, bool renderOnly)
+{
+ m_signature = POPUP_OBJECT_SIGNARURE;
+
+ m_lockCount = 0;
+ m_hbmAvatar = NULL;
+ m_avatar = NULL;
+ m_textType = TT_NONE;
+ m_options = theCustomOptions ? theCustomOptions : &PopUpOptions;
+ m_lpzSkin = NULL;
+ m_customPopup = false;
+ m_lpwzTitle = m_lpwzText = NULL;
+ m_lpzTitle = m_lpzText = NULL;
+ m_mtTitle = m_mtText = NULL;
+ m_hfnText = fonts.text;
+ m_hfnTitle = fonts.title;
+ m_hwnd = m_hwndToolTip = NULL;
+ m_bPositioned = m_bIsHovered = /*m_bIdleRequested =*/ m_bWindowCreated = m_bFade = m_bSlide = m_bDestroy = false;
+ m_bmp = m_bmpBase = m_bmpAnimate = NULL;
+ m_avatarFrameDelay = 0;
+ m_hhkAvatarChanged = NULL;
+ m_actions = NULL;
+ m_actionCount = 0;
+ m_bIsPinned = false;
+ updateData(ppd);
+ if (!renderOnly)
+ startThread();
+}
+
+
+PopupWnd2::~PopupWnd2()
+{
+ m_signature = 0;
+
+ if (m_lpzSkin) mir_free(m_lpzSkin);
+ if (m_hwnd) SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
+ if (m_bmp) delete m_bmp;
+ if (m_bmpBase) delete m_bmpBase;
+ if (m_bmpAnimate) delete m_bmpAnimate;
+ mir_free(m_lpzText); mir_free(m_lpzTitle);
+ mir_free(m_lpwzText); mir_free(m_lpwzTitle);
+ if (m_mtText) MText.Destroy(m_mtText);
+ if (m_mtTitle) MText.Destroy(m_mtTitle);
+ if (m_avatar) delete m_avatar;
+ if (m_actions) delete [] m_actions;
+}
+
+void PopupWnd2::startThread()
+{
+ _beginthread(WindowThread, 0, this);
+}
+
+void PopupWnd2::create()
+{
+ m_hwnd = CreateWindowEx(
+ WS_EX_TRANSPARENT| // prevents unwanted clicks
+ WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
+ _T(POPUP_WNDCLASS), // Class name
+ NULL, // Title
+ DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
+ CW_USEDEFAULT, // x
+ CW_USEDEFAULT, // y
+ CW_USEDEFAULT, // Width
+ CW_USEDEFAULT, // Height
+ HWND_DESKTOP, // Parent
+ NULL, // menu handle
+ hInst, // Instance
+ (LPVOID)this);
+
+ // Shadows
+ if (IsWinVerXPPlus())
+ {
+ ULONG_PTR style = GetClassLongPtr(m_hwnd, GCL_STYLE);
+ if (m_options->DropShadow && !(style & CS_DROPSHADOW)) {
+ style |= CS_DROPSHADOW;
+ }
+ else if (!m_options->DropShadow && (style & CS_DROPSHADOW)){
+ style &= ~CS_DROPSHADOW;
+ }
+ SetClassLongPtr(m_hwnd, GCL_STYLE, style);
+ }
+
+ // tooltips
+ m_hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
+ WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ m_hwnd, NULL, hInst, NULL);
+ SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
+ m_bWindowCreated = true;
+ update();
+}
+
+void PopupWnd2::updateLayered(BYTE opacity)
+{
+ if (!m_hwnd) return;
+#if defined(_UNICODE)
+ if (SetWindowLong(m_hwnd, GWL_EXSTYLE, GetWindowLong(m_hwnd, GWL_EXSTYLE) | WS_EX_LAYERED)) {
+ RECT rc; GetWindowRect(m_hwnd, &rc);
+ POINT ptDst = {rc.left, rc.top};
+ POINT ptSrc = {0, 0};
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = opacity; //m_options->UseTransparency ? opacity : 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ UpdateLayeredWindow(m_hwnd, NULL, &ptDst, &m_sz,
+ m_bmpAnimate ? m_bmpAnimate->getDC() : m_bmp->getDC(),
+ &ptSrc, 0xffffffff, &blend, ULW_ALPHA);
+
+ UpdateWindow(m_hwnd);
+ }
+#else
+ if (MyUpdateLayeredWindow) {
+ if (SetWindowLong(m_hwnd, GWL_EXSTYLE, GetWindowLong(m_hwnd, GWL_EXSTYLE) | WS_EX_LAYERED))
+ {
+ RECT rc; GetWindowRect(m_hwnd, &rc);
+ POINT ptDst = {rc.left, rc.top};
+ POINT ptSrc = {0, 0};
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = opacity; //m_options->UseTransparency ? opacity : 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ MyUpdateLayeredWindow(m_hwnd, NULL, &ptDst, &m_sz,
+ m_bmpAnimate ? m_bmpAnimate->getDC() : m_bmp->getDC(),
+ &ptSrc, 0xffffffff, &blend, ULW_ALPHA);
+
+ UpdateWindow(m_hwnd);
+ }
+ }
+#endif
+}
+
+SIZE PopupWnd2::measure()
+{
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin?m_lpzSkin:m_options->SkinPack);
+ if (!skin) return m_sz;
+
+ MyBitmap bmpTmp(1,1);
+ skin->measure(bmpTmp.getDC(), this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options);
+ return m_sz;
+}
+
+void PopupWnd2::update()
+{
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin?m_lpzSkin:m_options->SkinPack);
+ if (!skin) return;
+
+ // update avatar
+ fixAvatar();
+
+ // destroy content bitmap so animate() can reallocate it if needed
+ if (m_bmp)
+ {
+ delete m_bmp;
+ m_bmp = NULL;
+ }
+
+ // measure popup
+ if (m_bmpBase) delete m_bmpBase;
+ if (m_bmpAnimate) delete m_bmpAnimate;
+ m_bmpBase = new MyBitmap(1,1);
+ skin->measure(m_bmpBase->getDC(), this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options);
+
+ // render popup
+ m_bmpBase->allocate(m_sz.cx, m_sz.cy);
+ HDC hdc = m_bmpBase->getDC();
+ if (!skin) return;
+ SetBkMode(hdc, TRANSPARENT);
+ skin->display(m_bmpBase, this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options,
+ PopupSkin::DF_STATIC);
+ if (*m_time && skin->useInternalClock())
+ {
+ SetTextColor(hdc, m_clClock);
+ HFONT hfnSave = (HFONT)SelectObject(m_bmpBase->getDC(), fonts.clock);
+ SIZE sz; GetTextExtentPoint32A(m_bmpBase->getDC(), m_time, lstrlenA(m_time), &sz);
+ m_bmpBase->Draw_TextA(m_time, this->m_sz.cx - sz.cx - STYLE_SZ_GAP - skin->getRightGap(), STYLE_SZ_GAP);
+ SelectObject(m_bmpBase->getDC(), hfnSave);
+ }
+
+ m_bReshapeWindow = true;
+
+ animate();
+}
+
+void PopupWnd2::animate()
+{
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin?m_lpzSkin:m_options->SkinPack);
+ if (!skin) return;
+
+ if (m_avatar->isAnimated() || m_actionCount)
+ {
+ if (!m_bmp) m_bmp = new MyBitmap(m_bmpBase->getWidth(), m_bmpBase->getHeight());
+ m_bmp->Draw(m_bmpBase, 0, 0, m_bmpBase->getWidth(), m_bmpBase->getHeight());
+ skin->display(m_bmp, this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options, PopupSkin::DF_ANIMATE);
+ } else
+ if (m_bmpBase)
+ {
+ if (m_bmp) delete m_bmp;
+ m_bmp = m_bmpBase;
+ m_bmpBase = NULL;
+ }
+
+ // update layered window if supported
+ updateLayered((m_options->UseTransparency && !(m_bIsHovered && m_options->OpaqueOnHover)) ? m_options->Alpha : 255);
+
+ if (m_bReshapeWindow)
+ {
+ m_bReshapeWindow = false;
+#if defined(_UNICODE)
+ if (m_hwnd && m_bmp && m_options->DropShadow && PopUpOptions.EnableFreeformShadows /*DoWeNeedRegionForThisSkin()*/)
+ SetWindowRgn(m_hwnd, m_bmp->buildOpaqueRgn(skin->getShadowRegionOpacity()), FALSE);
+#else
+ if (!MyUpdateLayeredWindow && m_hwnd && m_bmp && PopUpOptions.Enable9xTransparency)
+ SetWindowRgn(m_hwnd, m_bmp->buildOpaqueRgn(skin->getLegacyRegionOpacity()), FALSE);
+
+ if (MyUpdateLayeredWindow && m_hwnd && m_bmp && m_options->DropShadow && PopUpOptions.EnableFreeformShadows /*DoWeNeedRegionForThisSkin()*/)
+ SetWindowRgn(m_hwnd, m_bmp->buildOpaqueRgn(skin->getShadowRegionOpacity()), FALSE);
+#endif
+
+ if (MyDwmEnableBlurBehindWindow && PopUpOptions.EnableAeroGlass)
+ {
+ DWM_BLURBEHIND bb = {0};
+ bb.dwFlags = DWM_BB_ENABLE|DWM_BB_BLURREGION;
+ bb.fEnable = TRUE;
+ bb.hRgnBlur = m_bmp->buildOpaqueRgn(254, false);
+ MyDwmEnableBlurBehindWindow(m_hwnd, &bb);
+ }
+
+ // update tooltips
+ for (int i = 0; i < m_actionCount; ++i)
+ {
+ char *title = strchr(m_actions[i].actionA.lpzTitle, '/');
+ if (title) title++;
+ else title = m_actions[i].actionA.lpzTitle;
+ AddTooltipTranslated(m_hwndToolTip, m_hwnd, i, m_actions[i].rc, title);
+ }
+
+// if (!customPopup && hwnd /*&& IsWindowVisible(hwnd)*/)
+// PopupThreadUpdateWindow(this);
+ }
+}
+
+void PopupWnd2::show()
+{
+ if ((m_options->UseEffect || (m_options->UseAnimations && !m_customPopup)) && m_options->FadeIn)
+ {
+ IPopupPlusEffect *effect = NULL;
+ m_bSlide = m_bFade = false;
+ DWORD dwTime, dwTime0 = GetTickCount();
+ DWORD dwTime1 = dwTime0 + m_options->FadeIn;
+ if (m_options->UseEffect)
+ {
+ m_bFade = true;
+ m_btAlpha0 = 0;
+ m_btAlpha1 = m_options->UseTransparency ? m_options->Alpha : 255;
+ updateLayered(m_btAlpha0);
+
+ if (*PopUpOptions.Effect)
+ {
+ char vfxService[128];
+ mir_snprintf(vfxService, sizeof(vfxService), "PopUp/Vfx/"TCHAR_STR_PARAM, PopUpOptions.Effect);
+ if (ServiceExists(vfxService))
+ if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0))
+ {
+ effect->beginEffect(m_bmp->getWidth(), m_bmp->getHeight(), m_btAlpha0, m_btAlpha1, dwTime1-dwTime0);
+ m_bmpAnimate = new MyBitmap(m_bmp->getWidth(), m_bmp->getHeight());
+ }
+ }
+ } else
+ {
+ updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
+ }
+ if (m_options->UseAnimations && !m_customPopup)
+ {
+ m_bSlide = true;
+ m_ptPosition0 = m_pos;
+ m_ptPosition1 = m_pos;
+ if (m_options->Position == POS_LOWERLEFT || m_options->Position == POS_UPPERLEFT)
+ m_ptPosition0.x -= m_sz.cx + 2 * 5;
+ else
+ m_ptPosition0.x += m_sz.cx + 2 * 5;
+ SetWindowPos(m_hwnd, 0, m_ptPosition0.x, m_ptPosition0.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ } else
+ {
+ SetWindowPos(m_hwnd, 0, m_pos.x, m_pos.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ }
+ while ((dwTime = GetTickCount()) < dwTime1)
+ {
+ if (m_bFade)
+ {
+ if (effect)
+ {
+ effect->beginFrame(dwTime - dwTime0);
+ m_bmpAnimate->Draw(m_bmp, 0, 0, m_bmp->getWidth(), m_bmp->getHeight());
+ for (int row = 0; row < m_bmpAnimate->getHeight(); ++row)
+ {
+ unsigned char *pixel = (unsigned char *)m_bmpAnimate->getRow(row);
+ for (int col = 0; col < m_bmpAnimate->getWidth(); ++col)
+ {
+ WORD alphaLevel = effect->getPixelAlpha(col, row);
+ pixel[0] = (pixel[0] * alphaLevel) >> 8;
+ pixel[1] = (pixel[1] * alphaLevel) >> 8;
+ pixel[2] = (pixel[2] * alphaLevel) >> 8;
+ pixel[3] = (pixel[3] * alphaLevel) >> 8;
+ pixel += 4;
+ }
+ }
+ effect->endFrame();
+ updateLayered(255);
+ } else
+ {
+ updateLayered(m_btAlpha0 + (m_btAlpha1 - m_btAlpha0) * int(dwTime - dwTime0) / m_options->FadeIn);
+ }
+ }
+ if (m_bSlide)
+ SetWindowPos(m_hwnd, 0,
+ (int)m_ptPosition0.x + ((int)m_ptPosition1.x - (int)m_ptPosition0.x) * int(dwTime - dwTime0) / (int)m_options->FadeIn,
+ (int)m_ptPosition0.y + ((int)m_ptPosition1.y - (int)m_ptPosition0.y) * int(dwTime - dwTime0) / (int)m_options->FadeIn,
+ 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ UpdateWindow(m_hwnd);
+ Sleep(1);
+ }
+
+ if (effect)
+ {
+ effect->endEffect();
+ effect->destroy();
+ delete m_bmpAnimate;
+ m_bmpAnimate = NULL;
+ }
+ }
+
+ m_bSlide = m_bFade = false;
+
+ updateLayered((m_options->UseTransparency && !(m_bIsHovered && m_options->OpaqueOnHover)) ? m_options->Alpha : 255);
+ //updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
+ SetWindowPos(m_hwnd, 0, m_pos.x, m_pos.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+}
+
+void PopupWnd2::hide()
+{
+ if ((m_options->UseEffect || (m_options->UseAnimations && !m_customPopup)) && m_options->FadeOut)
+ {
+ m_bDestroy = true;
+ IPopupPlusEffect *effect = NULL;
+ m_bFade = m_bSlide = false;
+ DWORD dwTime, dwTime0 = GetTickCount();
+ DWORD dwTime1 = dwTime0 + m_options->FadeOut;
+ if (m_options->UseEffect)
+ {
+ m_bFade = true;
+ m_btAlpha0 = m_options->UseTransparency ? m_options->Alpha : 255;
+ m_btAlpha1 = 0;
+ updateLayered(m_btAlpha0);
+
+ if (*PopUpOptions.Effect)
+ {
+ char vfxService[128];
+ mir_snprintf(vfxService, sizeof(vfxService), "PopUp/Vfx/"TCHAR_STR_PARAM, PopUpOptions.Effect);
+ if (ServiceExists(vfxService))
+ if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0))
+ {
+ effect->beginEffect(m_bmp->getWidth(), m_bmp->getHeight(), m_btAlpha0, m_btAlpha1, dwTime1-dwTime0);
+ m_bmpAnimate = new MyBitmap(m_bmp->getWidth(), m_bmp->getHeight());
+ }
+ }
+ }
+ if (m_options->UseAnimations && !m_customPopup)
+ {
+ m_bSlide = true;
+ m_ptPosition0 = m_pos;
+ m_ptPosition1 = m_pos;
+ if (m_options->Position == POS_LOWERLEFT || m_options->Position == POS_UPPERLEFT)
+ m_ptPosition1.x -= m_sz.cx + 2 * 5;
+ else
+ m_ptPosition1.x += m_sz.cx + 2 * 5;
+ SetWindowPos(m_hwnd, 0, m_ptPosition0.x, m_ptPosition0.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ }
+ while ((dwTime = GetTickCount()) < dwTime1)
+ {
+ if (m_bFade)
+ {
+ if (effect)
+ {
+ effect->beginFrame(dwTime - dwTime0);
+ m_bmpAnimate->Draw(m_bmp, 0, 0, m_bmp->getWidth(), m_bmp->getHeight());
+ for (int row = 0; row < m_bmpAnimate->getHeight(); ++row)
+ {
+ unsigned char *pixel = (unsigned char *)m_bmpAnimate->getRow(row);
+ for (int col = 0; col < m_bmpAnimate->getWidth(); ++col)
+ {
+ WORD alphaLevel = effect->getPixelAlpha(col, row);
+ pixel[0] = (pixel[0] * alphaLevel) >> 8;
+ pixel[1] = (pixel[1] * alphaLevel) >> 8;
+ pixel[2] = (pixel[2] * alphaLevel) >> 8;
+ pixel[3] = (pixel[3] * alphaLevel) >> 8;
+ pixel += 4;
+ }
+ }
+ effect->endFrame();
+ updateLayered(255);
+ } else
+ {
+ updateLayered((int)m_btAlpha0 + ((int)m_btAlpha1 - (int)m_btAlpha0) * int(dwTime - dwTime0) / (int)m_options->FadeOut);
+ }
+ }
+ if (m_bSlide)
+ SetWindowPos(m_hwnd, 0,
+ (int)m_ptPosition0.x + ((int)m_ptPosition1.x - (int)m_ptPosition0.x) * int(dwTime - dwTime0) / (int)m_options->FadeOut,
+ (int)m_ptPosition0.y + ((int)m_ptPosition1.y - (int)m_ptPosition0.y) * int(dwTime - dwTime0) / (int)m_options->FadeOut,
+ 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
+ UpdateWindow(m_hwnd);
+ Sleep(1);
+ }
+
+ if (effect)
+ {
+ effect->endEffect();
+ effect->destroy();
+ delete m_bmpAnimate;
+ m_bmpAnimate = NULL;
+ }
+ }
+
+ SetWindowPos(m_hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_HIDEWINDOW);
+ DestroyWindow(m_hwnd);
+// hwnd = 0;
+}
+
+bool __forceinline isTextEmpty(char *text)
+{
+ if (!text)
+ return true;
+ while (*text)
+ if (!isspace(BYTE(*text++)))
+ return false;
+ return true;
+}
+
+bool __forceinline isTextEmpty(WCHAR *text)
+{
+ if (!text)
+ return true;
+ while (*text)
+ if (!iswspace(*text++))
+ return false;
+ return true;
+}
+
+void PopupWnd2::fixDefaults()
+{
+ if (m_options->UseWinColors)
+ {
+ m_clBack = GetSysColor(COLOR_BTNFACE);
+ m_clText = GetSysColor(COLOR_WINDOWTEXT);
+ m_clTitle = GetSysColor(COLOR_WINDOWTEXT);
+ m_clClock = GetSysColor(COLOR_WINDOWTEXT);
+ } else
+ if ((m_clBack == (COLORREF)NULL) && (m_clText == (COLORREF)NULL))
+ {
+ m_clTitle = fonts.clTitle;
+ m_clBack = fonts.clBack;
+ m_clText = fonts.clText;
+ m_clClock = fonts.clClock;
+ } else
+ {
+ m_clClock = m_clTitle;
+ }
+
+ if (!m_iTimeout)
+ {
+ m_iTimeout = m_options->InfiniteDelay ? -1 : m_options->Seconds;
+ }
+
+ m_hContactPassed = m_hContact;
+ if (m_hContact)
+ {
+ if (!CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)m_hContact, 0))
+ m_hContact = NULL;
+ }
+
+ switch (m_textType)
+ {
+ case TT_ANSI:
+ m_bTextEmpty = ::isTextEmpty(m_lpzText);
+ break;
+
+ case TT_UNICODE:
+ m_bTextEmpty = ::isTextEmpty(m_lpwzText);
+ break;
+
+ default:
+ m_bTextEmpty = false;
+ break;
+ }
+}
+
+void PopupWnd2::fixAvatar()
+{
+ if (m_avatar && !m_avatar->isValid())
+ delete m_avatar;
+
+ if (m_hbmAvatar)
+ {
+ m_avatar = new SimpleAvatar(m_hbmAvatar, true);
+ } else
+ {
+ m_avatar = PopupAvatar::create(m_hContact);
+ }
+}
+
+int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
+{
+ bool isIm = (m_hContact &&
+ (CallProtoService(
+ (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)m_hContact, 0),
+ PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
+
+// bool enableDefault = (isIm || !(PopUpOptions.actions&ACT_DEF_IMONLY)) ? true : false;
+ bool enableDefaultGen = (m_hContact || !(PopUpOptions.actions&ACT_DEF_NOGLOBAL)) ? true : false;
+ bool enableDefaultUsr = (isIm || m_hContact && !(PopUpOptions.actions&ACT_DEF_IMONLY)) ? true : false;
+ bool iconSize = PopUpOptions.actions&ACT_LARGE ? TRUE : FALSE;
+
+ if (PopUpOptions.actions&ACT_ENABLE)
+ {
+ if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply")) ++m_actionCount;
+ if (enableDefaultUsr && isIm && IsActionEnabled("General/Send message")) ++m_actionCount;
+ if (enableDefaultUsr && IsActionEnabled("General/User details")) ++m_actionCount;
+ if (enableDefaultUsr && IsActionEnabled("General/Contact menu")) ++m_actionCount;
+ if (enableDefaultUsr && DBGetContactSettingByte(m_hContact, "CList", "NotOnList", 0) && IsActionEnabled("General/Add permanently")) ++m_actionCount;
+ if (enableDefaultGen && (m_iTimeout != -1) && IsActionEnabled("General/Pin popup")) ++m_actionCount;
+ if (enableDefaultGen && IsActionEnabled("General/Dismiss popup")) ++m_actionCount;
+ if (enableDefaultGen && IsActionEnabled("General/Copy to clipboard")) ++m_actionCount;
+
+ int iAction = fixActions(theActions, count, m_actionCount);
+
+ if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_REPLY,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Quick reply");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_REPLY;
+ ++iAction;
+ }
+ if (enableDefaultUsr && isIm && IsActionEnabled("General/Send message"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_MESS,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Send message");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_MESSAGE;
+ ++iAction;
+ }
+ if (enableDefaultUsr && IsActionEnabled("General/User details"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_INFO,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/User details");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_DETAILS;
+ ++iAction;
+ }
+ if (enableDefaultUsr && IsActionEnabled("General/Contact menu"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_MENU,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Contact menu");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_MENU;
+ ++iAction;
+ }
+ if (enableDefaultUsr && DBGetContactSettingByte(m_hContact, "CList", "NotOnList", 0) && IsActionEnabled("General/Add permanently"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_ADD,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Add permanently");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_ADD;
+ ++iAction;
+ }
+ if (enableDefaultGen && (m_iTimeout != -1) && IsActionEnabled("General/Pin popup"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = m_bIsPinned ? IcoLib_GetIcon(ICO_ACT_PINNED,iconSize) : IcoLib_GetIcon(ICO_ACT_PIN,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Pin popup");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_PIN;
+ ++iAction;
+ }
+ if (enableDefaultGen && IsActionEnabled("General/Dismiss popup"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_CLOSE,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Dismiss popup");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_DISMISS;
+ ++iAction;
+ }
+ if (enableDefaultGen && IsActionEnabled("General/Copy to clipboard"))
+ {
+ m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
+ m_actions[iAction].actionA.lchIcon = IcoLib_GetIcon(ICO_ACT_COPY,iconSize);
+ lstrcpyA(m_actions[iAction].actionA.lpzTitle, "General/Copy to clipboard");
+ m_actions[iAction].actionA.wParam = 0;
+ m_actions[iAction].actionA.lParam = ACT_DEF_COPY;
+ ++iAction;
+ }
+ }
+
+ return m_actionCount;
+}
+
+int PopupWnd2::fixActions(POPUPACTION *theActions, int count, int additional)
+{
+ m_actionCount = 0;
+ if (m_actions) delete [] m_actions;
+ m_actions = NULL;
+
+ int i;
+
+ m_actionCount = additional;
+ for (i = 0; i < count; ++i)
+ if ((theActions[i].flags&PAF_ENABLED) && IsActionEnabled(&theActions[i]))
+ ++m_actionCount;
+
+ m_actions = new ActionInfo[m_actionCount];
+ int iAction = 0;
+
+ for (i = 0; i < count; ++i)
+ if ((theActions[i].flags&PAF_ENABLED) && IsActionEnabled(&theActions[i]))
+ {
+ m_actions[iAction].actionA = theActions[i];
+ ++iAction;
+ }
+
+ return iAction;
+}
+
+void PopupWnd2::updateData(POPUPDATA *ppd)
+{
+ m_hContact = ppd->lchContact;
+
+ m_clBack = ppd->colorBack;
+ m_clClock = m_clTitle = m_clText = ppd->colorText;
+ m_iTimeout = m_options->DisplayTime;
+
+ mir_free(m_lpzText); mir_free(m_lpzTitle);
+ mir_free(m_lpwzText); mir_free(m_lpwzTitle);
+ if (m_textType == TT_NONE) m_textType = TT_ANSI;
+ m_lpzTitle = mir_strdup(ppd->lpzContactName);
+ m_lpzText = mir_strdup(ppd->lpzText);
+ m_lpwzTitle = m_lpwzText = NULL;
+// mtTitle = mtText = NULL;
+ // hfnTitle, hfnText;
+ m_hIcon = ppd->lchIcon;
+
+ m_PluginData = ppd->PluginData;
+ m_PluginWindowProc = ppd->PluginWindowProc;
+
+ if (m_options->DisplayTime)
+ GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL,"HH':'mm", m_time, SIZEOF(m_time));
+ else m_time[0] = 0;
+
+ fixDefaults();
+
+ if (m_textType == TT_MTEXT) buildMText();
+}
+
+void PopupWnd2::updateData(POPUPDATAEX_V2 *ppd)
+{
+ m_hContact = ppd->lchContact;
+
+ m_clBack = ppd->colorBack;
+ m_clClock = m_clTitle = m_clText = ppd->colorText;
+ m_iTimeout = ppd->iSeconds ? ppd->iSeconds : m_options->Seconds;
+
+ if (m_textType == TT_NONE) m_textType = TT_ANSI;
+ mir_free(m_lpzText); mir_free(m_lpzTitle);
+ mir_free(m_lpwzText); mir_free(m_lpwzTitle);
+ m_lpzTitle = mir_strdup(ppd->lpzContactName);
+ m_lpzText = mir_strdup(ppd->lpzText);
+ m_lpwzTitle = m_lpwzText = NULL;
+// mtTitle = mtText = NULL;
+ // hfnTitle, hfnText;
+ m_hIcon = ppd->lchIcon;
+ m_hNotification = ppd->hNotification;
+
+ m_PluginData = ppd->PluginData;
+ m_PluginWindowProc = ppd->PluginWindowProc;
+
+ if (m_options->DisplayTime)
+ GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL,"HH':'mm", m_time, SIZEOF(m_time));
+ else m_time[0] = 0;
+
+ fixDefaults();
+ fixActions(ppd->lpActions, ppd->actionCount);
+
+ if (m_textType == TT_MTEXT) buildMText();
+}
+
+void PopupWnd2::updateData(POPUPDATAW_V2 *ppd)
+{
+ m_hContact = ppd->lchContact;
+
+ m_clBack = ppd->colorBack;
+ m_clClock = m_clTitle = m_clText = ppd->colorText;
+ m_iTimeout = ppd->iSeconds ? ppd->iSeconds : m_options->Seconds;
+
+ if (m_textType == TT_NONE) m_textType = TT_UNICODE;
+ mir_free(m_lpzText); mir_free(m_lpzTitle);
+ mir_free(m_lpwzText); mir_free(m_lpwzTitle);
+ m_lpzTitle = m_lpzText = NULL;
+ m_lpwzTitle = mir_wstrdup(ppd->lpwzContactName);
+ m_lpwzText = mir_wstrdup(ppd->lpwzText);
+// mtTitle = mtText = NULL;
+ // hfnTitle, hfnText;
+ m_hIcon = ppd->lchIcon;
+ m_hNotification = ppd->hNotification;
+
+ m_PluginData = ppd->PluginData;
+ m_PluginWindowProc = ppd->PluginWindowProc;
+
+ if (m_options->DisplayTime)
+ GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL,"HH':'mm", m_time, SIZEOF(m_time));
+ else m_time[0] = 0;
+
+ fixDefaults();
+ fixActions(ppd->lpActions, ppd->actionCount);
+
+ if (m_textType == TT_MTEXT) buildMText();
+}
+
+void PopupWnd2::updateData(POPUPDATA2 *ppd)
+{
+ m_hContact = ppd->lchContact;
+
+ m_clBack = ppd->colorBack;
+ m_clClock = m_clTitle = m_clText = ppd->colorText;
+ m_iTimeout = ppd->iSeconds;
+
+ mir_free(m_lpzText); mir_free(m_lpzTitle);
+ mir_free(m_lpwzText); mir_free(m_lpwzTitle);
+ if (ppd->flags&PU2_UNICODE)
+ {
+ if (m_textType == TT_NONE) m_textType = TT_UNICODE;
+ m_lpzTitle = m_lpzText = NULL;
+ m_lpwzTitle = mir_wstrdup(ppd->lpwzTitle);
+ m_lpwzText = mir_wstrdup(ppd->lpwzText);
+ m_lpzTitle = m_lpzText = NULL;
+ } else
+ {
+ if (m_textType == TT_NONE) m_textType = TT_ANSI;
+ m_lpzTitle = mir_strdup(ppd->lpzTitle);
+ m_lpzText = mir_strdup(ppd->lpzText);
+ m_lpwzTitle = m_lpwzText = NULL;
+ }
+
+ m_hIcon = ppd->lchIcon;
+ m_hNotification = ppd->lchNotification;
+
+ m_PluginData = ppd->PluginData;
+ m_PluginWindowProc = ppd->PluginWindowProc;
+ m_customPopup = (ppd->flags & PU2_CUSTOM_POPUP)!= 0;
+
+ m_hbmAvatar = ppd->hbmAvatar;
+ m_lpzSkin = mir_a2t(ppd->lpzSkin);
+
+ if (m_options->DisplayTime)
+ {
+ if (ppd->dwTimestamp)
+ {
+ DBTIMETOSTRING dbtts;
+ dbtts.szFormat = "t";
+ dbtts.szDest = m_time;
+ dbtts.cbDest = SIZEOF(m_time);
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRING, (WPARAM)ppd->dwTimestamp, (LPARAM)&dbtts);
+ } else
+ {
+ GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL,"HH':'mm", m_time, SIZEOF(m_time));
+ }
+ }
+ else m_time[0] = 0;
+
+ fixDefaults();
+ fixActions(ppd->lpActions, ppd->actionCount);
+
+ if (m_textType == TT_MTEXT) buildMText();
+}
+
+void PopupWnd2::buildMText()
+{
+ if (!(htuText && htuTitle && PopUpOptions.UseMText))
+ return;
+
+ if (m_mtText) MText.Destroy(m_mtText);
+ if (m_mtTitle)MText.Destroy(m_mtTitle);
+ m_mtText = m_mtTitle = NULL;
+
+ if (m_lpwzText && m_lpwzTitle) {
+ m_textType = TT_MTEXT;
+ m_mtText = MText.CreateW(htuText, m_lpwzText);
+ m_mtTitle = MText.CreateW(htuTitle,m_lpwzTitle);
+ }
+ else if (m_lpzText && m_lpzTitle) {
+ m_textType = TT_MTEXT;
+ if (ServiceExists(MS_TEXT_CREATEW)) {
+ LOGFONT lf;
+ LPWSTR lpwzBuf = NULL;
+
+ GetObject(m_hfnText, sizeof(lf), &lf);
+ lpwzBuf = mir_a2u(m_lpzText);
+ m_mtText = MText.CreateW(htuText, lpwzBuf);
+ mir_free(lpwzBuf); lpwzBuf = NULL;
+
+ GetObject(m_hfnTitle, sizeof(lf), &lf);
+ lpwzBuf = mir_a2u(m_lpzTitle);
+ m_mtTitle = MText.CreateW(htuTitle, lpwzBuf);
+ mir_free(lpwzBuf); lpwzBuf = NULL;
+ }
+ else {
+ m_mtText = MText.Create(htuText, m_lpzText);
+ m_mtTitle = MText.Create(htuTitle,m_lpzTitle);
+ }
+ }
+}
+
+void PopupWnd2::updateText(char *text)
+{
+ if (m_lpzText)
+ {
+ mir_free(m_lpzText);
+ m_lpzText = mir_strdup(text);
+ if (m_textType == TT_MTEXT)
+ buildMText();
+ }
+ m_bTextEmpty = ::isTextEmpty(m_lpzText);
+}
+
+void PopupWnd2::updateText(WCHAR *text)
+{
+ if (m_lpwzText)
+ {
+ mir_free(m_lpwzText);
+ m_lpwzText = mir_wstrdup(text);
+ if (m_textType == TT_MTEXT)
+ buildMText();
+ }
+ m_bTextEmpty = ::isTextEmpty(m_lpwzText);
+}
+
+void PopupWnd2::updateTitle(char *title)
+{
+ if (m_lpzTitle)
+ {
+ mir_free(m_lpzTitle);
+ m_lpzTitle = mir_strdup(title);
+ if (m_textType == TT_MTEXT)
+ buildMText();
+ }
+}
+
+void PopupWnd2::updateTitle(WCHAR *title)
+{
+ if (m_lpwzTitle)
+ {
+ mir_free(m_lpwzTitle);
+ m_lpwzTitle = mir_wstrdup(title);
+ if (m_textType == TT_MTEXT)
+ buildMText();
+ }
+}
+
+void PopupWnd2::updateTimer()
+{
+ KillTimer(m_hwnd, POPUP_TIMER);
+ if (m_iTimeout > 0)
+ SetTimer(m_hwnd, POPUP_TIMER, 1000, 0);
+}
+
+LRESULT CALLBACK NullWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message)
+ {
+ case WM_COMMAND:
+ case WM_CONTEXTMENU:
+ PUDeletePopUp(hwnd);
+ break;
+ }
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
+
+struct ReplyEditData
+{
+ HWND hwndPopup;
+ HANDLE hContact;
+ WNDPROC oldWndProc;
+};
+
+bool IsMsgServiceNameW(HANDLE hContact) {
+ if (g_popup.isMirUnicode) {
+ char szServiceName[100];
+ char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ if (szProto == NULL)
+ return false;
+
+ mir_snprintf(szServiceName, sizeof(szServiceName), "%s%sW", szProto, PSS_MESSAGE);
+ if (ServiceExists(szServiceName))
+ return true;
+ }
+ return false;
+}
+
+BOOL IsUtfSendAvailable(HANDLE hContact)
+{
+ char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ if(szProto == NULL) return FALSE;
+ //check for MetaContact and get szProto from subcontact
+ if(strcmp(szProto, gszMetaProto)==0) {
+ HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
+ if(!hSubContact) return FALSE;
+ szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hSubContact, 0);
+ }
+ return(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF) ? TRUE : FALSE;
+}
+
+void AddMessageToDB(HANDLE hContact, char *msg, int flag/*bool utf*/)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.flags = DBEF_SENT | ((flag&PREF_UTF)==PREF_UTF ? DBEF_UTF : 0);
+ dbei.szModule = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ dbei.timestamp = time(NULL);
+ if(g_popup.isOsUnicode && !((flag&PREF_UTF)==PREF_UTF) && (flag&PREF_UNICODE)==PREF_UNICODE)
+ dbei.cbBlob = (lstrlenW((LPWSTR)msg) + 1)*sizeof(WCHAR/*TCHAR*/);
+ else
+ dbei.cbBlob = lstrlenA(msg) + 1;
+ dbei.pBlob = (PBYTE)msg;
+ CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
+}
+
+LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ ReplyEditData *dat = (ReplyEditData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ WNDPROC oldWndProc = dat ? dat->oldWndProc : NULL;
+
+ switch (message)
+ {
+/*
+ case WM_ERASEBKGND:
+ {
+ HDC hdc = (HDC)wParam;
+ RECT rc; GetClientRect(hwnd, &rc);
+ FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
+ SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
+ DrawText(hdc, "Quick Reply", -1, &rc, DT_BOTTOM|DT_RIGHT|DT_SINGLELINE);
+ return TRUE;
+ }
+*/
+ case WM_KEYDOWN:
+ {
+ switch (wParam)
+ {
+ case VK_RETURN:
+ {
+ char *buf = NULL;
+ int flag = 0;
+ bool bSendW = IsMsgServiceNameW(dat->hContact);
+ //if (g_popup.isMirUnicode)
+ if (IsWindowUnicode(hwnd))
+ {
+ WCHAR msg[2048];
+ LPWSTR bufW = NULL;
+#if defined(_UNICODE)
+ SendMessageW(hwnd, WM_GETTEXT, SIZEOF(msg), (LPARAM)msg);
+#else
+ MySendMessageW(hwnd, WM_GETTEXT, SIZEOF(msg), (LPARAM)msg);
+#endif
+ if(wcslen(msg)==0){
+ DestroyWindow(hwnd);
+ return 0;
+ }
+ // we have unicode message, check if it is possible and reasonable to send it as unicode
+ if (IsUtfSendAvailable(dat->hContact)) {
+ buf = mir_utf8encodeW(msg);
+ flag = PREF_UTF;
+ }
+ else if(bSendW){
+ bufW = mir_wstrdup(msg) /*mir_tstrdup(msg)*/;
+ buf = (char*)bufW;
+ flag = PREF_UNICODE /*PREF_TCHAR*/;
+ }
+ else {
+ buf = mir_u2a(msg);
+ flag = 0;
+ }
+ }
+ else {
+ char msg[2048];
+ GetWindowTextA(hwnd, msg, SIZEOF(msg));
+ if(strlen(msg)==0){
+ DestroyWindow(hwnd);
+ return 0;
+ }
+ // we have message, check if it is possible and reasonable to send it as unicode
+ if ( IsUtfSendAvailable( dat->hContact )) {
+ buf = mir_utf8encode(msg);
+ flag = PREF_UTF;
+ }
+ else {
+ buf = mir_strdup(msg) /*mir_tstrdup(msg)*/;
+ flag = 0 /*PREF_TCHAR*/;
+ }
+ }
+
+ CallContactService(dat->hContact, bSendW ? (PSS_MESSAGE"W"):PSS_MESSAGE, flag, (LPARAM)buf);
+ AddMessageToDB(dat->hContact, buf, flag);
+ mir_free(buf);
+
+ DestroyWindow(hwnd);
+ return 0;
+ }
+ case VK_ESCAPE:
+ {
+ DestroyWindow(hwnd);
+ return 0;
+ }
+ }
+ break;
+ }
+
+ case WM_ACTIVATE:
+ if (wParam == WA_INACTIVE)
+ DestroyWindow(hwnd);
+ break;
+
+ case WM_DESTROY:
+ PopupThreadUnlock();
+ if (!(PopUpOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopUp(dat->hwndPopup);
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->oldWndProc);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
+ mir_free(dat);
+ }
+
+ if (oldWndProc)
+ {
+#if defined(_UNICODE)
+ return CallWindowProcW(oldWndProc, hwnd, message, wParam, lParam);
+#else
+ if (IsWindowUnicode(hwnd) && MyCallWindowProcW)
+ return MyCallWindowProcW(oldWndProc, hwnd, message, wParam, lParam);
+ return CallWindowProc(oldWndProc, hwnd, message, wParam, lParam);
+#endif
+ }
+
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
+
+LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message)
+ {
+ case WM_CREATE:
+ {
+// show();
+ return DefWindowProc(m_hwnd, message, wParam, lParam);
+ break;
+ }
+
+ case UM_INITPOPUP:
+ {
+ if (!m_customPopup) PopupThreadAddWindow(this);
+ if (m_iTimeout > 0) SetTimer(m_hwnd, POPUP_TIMER, m_iTimeout*1000, 0);
+ if (m_hContact && !m_hbmAvatar && PopUpOptions.EnableAvatarUpdates)
+ m_hhkAvatarChanged = HookEventMessage(ME_AV_AVATARCHANGED, m_hwnd, UM_AVATARCHANGED);
+ if (m_avatar->activeFrameDelay() > 0) SetTimer(m_hwnd, AVATAR_TIMER, m_avatar->activeFrameDelay(), 0);
+
+ // prevent unwanted clicks, but allow wanted :)
+ GetCursorPos(&m_ptPrevCursor);
+ SetTimer(m_hwnd, CURSOR_TIMER, 500, NULL);
+
+ break;
+ }
+
+ case UM_POPUPSHOW:
+ {
+ POINT pt; pt.x = wParam; pt.y = lParam;
+ setPosition(pt);
+ show();
+ break;
+ }
+
+ case UM_AVATARCHANGED:
+ {
+ if ((HANDLE)wParam == m_hContact)
+ {
+ m_avatar->invalidate();
+ update();
+ if (m_avatar->activeFrameDelay() > 0) SetTimer(m_hwnd, AVATAR_TIMER, m_avatar->activeFrameDelay(), 0);
+ }
+ break;
+ }
+
+ case UM_POPUPACTION:
+ {
+ if (wParam != 0) break;
+ switch (lParam)
+ {
+ case ACT_DEF_MESSAGE:
+ CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)m_hContact, 0);
+ if (!(PopUpOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopUp(m_hwnd);
+ break;
+
+ case ACT_DEF_REPLY:
+ {
+ if (!m_customPopup) PopupThreadLock();
+ //RECT rc = renderInfo.textRect;
+ //MapWindowPoints(hwnd, NULL, (LPPOINT)&rc, 2);
+ RECT rc; GetWindowRect(m_hwnd, &rc);
+#if defined(_UNICODE)
+ HWND hwndEditBox = CreateWindowExW(WS_EX_TOOLWINDOW|WS_EX_TOPMOST,
+ g_wndClass.cPopupEditBox ? L"PopupEditBox" : L"EDIT",
+ NULL,
+ WS_BORDER|WS_POPUP|WS_VISIBLE|ES_AUTOVSCROLL|ES_LEFT|ES_MULTILINE|ES_NOHIDESEL|ES_WANTRETURN,
+ rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, hInst, NULL);
+#else
+ HWND hwndEditBox = 0;
+ if(MyCreateWindowExW && g_popup.isMirUnicode) {
+ //create unicode window only if miranda is unicode
+ //coz many protocol make trouble with unicode text on utf8 send inside ansi release
+ hwndEditBox = MyCreateWindowExW(WS_EX_TOOLWINDOW|WS_EX_TOPMOST,
+ g_wndClass.cPopupEditBox ? L"PopupEditBox" : L"EDIT",
+ NULL,
+ WS_BORDER|WS_POPUP|WS_VISIBLE|ES_AUTOVSCROLL|ES_LEFT|ES_MULTILINE|ES_NOHIDESEL|ES_WANTRETURN,
+ rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, hInst, NULL);
+ }
+ else {
+ hwndEditBox = CreateWindowExA(WS_EX_TOOLWINDOW|WS_EX_TOPMOST,
+ g_wndClass.cPopupEditBox ? "PopupEditBox" : "EDIT",
+ NULL,
+ WS_BORDER|WS_POPUP|WS_VISIBLE|ES_AUTOVSCROLL|ES_LEFT|ES_MULTILINE|ES_NOHIDESEL|ES_WANTRETURN,
+ rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, hInst, NULL);
+ }
+#endif
+ ReplyEditData *dat = (ReplyEditData *)mir_alloc(sizeof(ReplyEditData));
+ dat->oldWndProc = (WNDPROC)GetWindowLongPtr(hwndEditBox, (LONG_PTR)GWLP_WNDPROC);
+ dat->hwndPopup = m_hwnd;
+ dat->hContact = m_hContact;
+ if(IsWindowUnicode(hwndEditBox)) {
+#if defined(_UNICODE)
+ SendMessageW(hwndEditBox, WM_SETFONT, (WPARAM)fonts.text, TRUE);
+#else
+ MySendMessageW(hwndEditBox, WM_SETFONT, (WPARAM)fonts.text, TRUE);
+#endif
+ SetWindowLongPtrW(hwndEditBox, GWLP_USERDATA, (LONG_PTR)dat);
+ SetWindowLongPtrW(hwndEditBox, GWLP_WNDPROC, (LONG_PTR)ReplyEditWndProc);
+ }
+ else {
+ SendMessageA(hwndEditBox, WM_SETFONT, (WPARAM)fonts.text, TRUE);
+ SetWindowLongPtrA(hwndEditBox, GWLP_USERDATA, (LONG_PTR)dat);
+ SetWindowLongPtrA(hwndEditBox, GWLP_WNDPROC, (LONG_PTR)ReplyEditWndProc);
+ }
+ SetFocus(hwndEditBox);
+ break;
+ }
+
+ case ACT_DEF_DETAILS:
+ CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)m_hContact, 0);
+ if (!(PopUpOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopUp(m_hwnd);
+ break;
+ case ACT_DEF_MENU:
+ {
+ lock();
+ PostMessage(ghwndMenuHost, UM_SHOWMENU, (WPARAM)m_hwnd, (LPARAM)m_hContact);
+ break;
+ }
+ case ACT_DEF_ADD:
+ {
+ ADDCONTACTSTRUCT acs = {0};
+ acs.handle = m_hContact;
+ acs.handleType = HANDLE_CONTACT;
+ acs.szProto = 0;
+ CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
+ if (!(PopUpOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopUp(m_hwnd);
+ break;
+ }
+ case ACT_DEF_PIN:
+ {
+ if (m_bIsPinned)
+ {
+ SetTimer(m_hwnd, POPUP_TIMER, m_iTimeout*1000, NULL);
+ } else
+ {
+ KillTimer(m_hwnd, POPUP_TIMER);
+ }
+ m_bIsPinned = !m_bIsPinned;
+ bool iconSize = PopUpOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ PUModifyActionIcon(m_hwnd, wParam, lParam, m_bIsPinned ? IcoLib_GetIcon(ICO_ACT_PINNED,iconSize) : IcoLib_GetIcon(ICO_ACT_PIN,iconSize));
+ break;
+ }
+ case ACT_DEF_DISMISS:
+ PUDeletePopUp(m_hwnd);
+ break;
+ case ACT_DEF_COPY:
+ {
+ #ifdef UNICODE
+ #define CF_TCHAR CF_UNICODETEXT
+ #else
+ #define CF_TCHAR CF_TEXT
+ #endif
+ HGLOBAL clipbuffer;
+ static TCHAR * buffer, *text;
+ char* sztext;
+ if ((this->m_lpwzText) || (this->m_lpwzTitle))
+ {
+ text = (TCHAR*)mir_alloc((_tcslen(this->m_lpwzText) + _tcslen(this->m_lpwzTitle)+3)*sizeof(TCHAR));
+ mir_sntprintf(text, _tcslen(this->m_lpwzText) + _tcslen(this->m_lpwzTitle)+3, _T("%s\n\n%s"), this->m_lpwzTitle, this->m_lpwzText);
+ }
+ else if ((this->m_lpzText) || (this->m_lpzTitle))
+ {
+ sztext = (char*)mir_alloc((lstrlenA(this->m_lpzText) + lstrlenA(this->m_lpzTitle)+3)*sizeof(char));
+ mir_snprintf(sztext, lstrlenA(this->m_lpzText) + lstrlenA(this->m_lpzTitle)+3, "%s\n\n%s", this->m_lpzTitle, this->m_lpzText);
+ text = mir_a2t(sztext);
+ }
+ OpenClipboard(m_hwnd);
+ EmptyClipboard();
+ clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (lstrlen(text)+1) * sizeof(TCHAR));
+ buffer = (TCHAR *)GlobalLock(clipbuffer);
+ lstrcpy(buffer, text);
+ GlobalUnlock(clipbuffer);
+ SetClipboardData(CF_TCHAR, clipbuffer);
+ CloseClipboard();
+ if (sztext)
+ mir_free(text);
+ PUDeletePopUp(m_hwnd);
+ break;
+ }
+ }
+ break;
+ }
+
+ case UM_POPUPMODIFYACTIONICON:
+ {
+ LPPOPUPACTIONID actionId = (LPPOPUPACTIONID)wParam;
+ for (int i = 0; i < m_actionCount; ++i)
+ if ((m_actions[i].actionA.wParam == actionId->wParam) &&
+ (m_actions[i].actionA.lParam == actionId->lParam))
+ {
+ m_actions[i].actionA.lchIcon = (HICON)lParam;
+ animate();
+ break;
+ }
+
+ break;
+ }
+
+ case UM_MENUDONE:
+ {
+ unlock();
+ if (!(PopUpOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopUp(m_hwnd);
+ break;
+ }
+/*
+ case WM_WINDOWPOSCHANGED:
+ {
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ if (!bIsHovered)
+ {
+ RECT rc; SetRect(&rc, wp->x, wp->y, wp->x + wp->cx, wp->y + wp->cy);
+ GetCursorPos(&ptPrevCursor);
+
+ if (PtInRect(&rc, ptPrevCursor))
+ {
+ SetWindowLongPtr(hwnd, GWLP_EXSTYLE, GetWindowLongPtr(hwnd, GWLP_EXSTYLE) | WS_EX_TRANSPARENT);
+ SetTimer(hwnd, CURSOR_TIMER, 500, NULL);
+ }
+ }
+ break;
+ }
+*/
+ case WM_LBUTTONUP:
+ {
+ int i;
+ for (i = 0; i < m_actionCount; ++i)
+ if (m_actions[i].hover)
+ {
+ SendMessage(m_hwnd, UM_POPUPACTION, m_actions[i].actionA.wParam, m_actions[i].actionA.lParam);
+ break;
+ }
+
+ if (i == m_actionCount)
+ {
+ if(PopUpOptions.overrideLeft!=false && (m_hContact!=NULL || PopUpOptions.overrideLeft == 5 || PopUpOptions.overrideLeft == 6)){
+ switch (PopUpOptions.overrideLeft){
+ default:
+ case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break;
+ case 2:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_REPLY); break;
+ case 3:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_DETAILS); break;
+ case 4:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MENU); break;
+ case 5:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_DISMISS); break;
+ case 6:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_PIN); break;
+ case 7:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_COPY); break;
+ }
+ }else{
+ lock();
+ if (!PerformAction(m_hNotification, m_hwnd, message, wParam, lParam))
+ SendMessage(m_hwnd, WM_COMMAND, 0, 0);
+ unlock();
+ }
+ }
+ break;
+ }
+
+ case WM_MBUTTONUP:
+ {
+ if(PopUpOptions.overrideMiddle!=false && (m_hContact!=NULL || PopUpOptions.overrideMiddle == 5 || PopUpOptions.overrideMiddle == 6)){
+ switch (PopUpOptions.overrideMiddle){
+ default:
+ case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break;
+ case 2:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_REPLY); break;
+ case 3:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_DETAILS); break;
+ case 4:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MENU); break;
+ case 5:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_DISMISS); break;
+ case 6:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_PIN); break;
+ case 7:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_COPY); break;
+ }
+ }
+ break;
+ }
+
+ case WM_CONTEXTMENU:
+ {
+ if(PopUpOptions.overrideRight!=false && (m_hContact!=NULL || PopUpOptions.overrideRight == 5 || PopUpOptions.overrideRight == 6)){
+ switch (PopUpOptions.overrideRight){
+ default:
+ case 1:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MESSAGE); break;
+ case 2:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_REPLY); break;
+ case 3:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_DETAILS); break;
+ case 4:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_MENU); break;
+ case 5:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_DISMISS); break;
+ case 6:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_PIN); break;
+ case 7:SendMessage(m_hwnd, UM_POPUPACTION,0, ACT_DEF_COPY); break;
+ }
+ return TRUE;
+ }else{
+ lock();
+ if (PerformAction(m_hNotification, m_hwnd, message, wParam, lParam))
+ {
+ unlock();
+ return TRUE;
+ }
+ unlock();
+ }
+ }
+/*
+ case WM_RBUTTONUP:
+ {
+ SendMessage(hwnd, WM_CONTEXTMENU, 0, 0);
+ break;
+ }
+*/
+ case WM_TIMER:
+ {
+ switch (wParam)
+ {
+ case POPUP_TIMER:
+ {
+ KillTimer(m_hwnd, POPUP_TIMER);
+ if (!m_customPopup)
+ {
+ PopupThreadRequestRemoveWindow(this);
+ } else
+ {
+ if (isLocked())
+ {
+ updateTimer();
+ } else
+ {
+ PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ }
+ }
+ break;
+ }
+
+ case AVATAR_TIMER:
+ {
+ int newDelay = m_avatar->activeFrameDelay();
+ animate();
+ if ((newDelay <= 0) || (newDelay != m_avatarFrameDelay)) KillTimer(m_hwnd, AVATAR_TIMER);
+ if (newDelay > 0) {
+ SetTimer(m_hwnd, AVATAR_TIMER, newDelay, 0);
+ m_avatarFrameDelay = newDelay;
+ }
+ break;
+ }
+
+ case CURSOR_TIMER:
+ {
+ POINT pt; GetCursorPos(&pt);
+ if (abs(pt.x-m_ptPrevCursor.x) + abs(pt.y-m_ptPrevCursor.y) > 4)
+ {
+ SetWindowLong(m_hwnd, GWL_EXSTYLE, GetWindowLong(m_hwnd, GWL_EXSTYLE) & ~WS_EX_TRANSPARENT);
+ KillTimer(m_hwnd, CURSOR_TIMER);
+ }
+ break;
+ }
+ }
+
+ break;
+ }
+
+ case UM_DESTROYPOPUP:
+ {
+ KillTimer(m_hwnd, POPUP_TIMER);
+ KillTimer(m_hwnd, AVATAR_TIMER);
+ KillTimer(m_hwnd, CURSOR_TIMER);
+ PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ break;
+ }
+
+ case UM_CHANGEPOPUP:
+ {
+ switch (wParam)
+ {
+ case CPT_TEXT: updateText((char *)lParam); mir_free((void *)lParam); break;
+ case CPT_TEXTW: updateText((WCHAR *)lParam); mir_free((void *)lParam); break;
+ case CPT_TITLE: updateTitle((char *)lParam); mir_free((void *)lParam); break;
+ case CPT_TITLEW: updateTitle((WCHAR *)lParam); mir_free((void *)lParam); break;
+ case CPT_DATA: updateData((POPUPDATA *)lParam); mir_free((void *)lParam); break;
+ case CPT_DATAEX: updateData((POPUPDATAEX_V2 *)lParam); mir_free((void *)lParam); break;
+ case CPT_DATAW: updateData((POPUPDATAW_V2 *)lParam); mir_free((void *)lParam); break;
+ }
+ update();
+ break;
+ }
+
+ case UM_CALLMETHOD:
+ {
+ MethodPtr *method_copy = (MethodPtr *)wParam;
+ (this->*(*method_copy))(lParam);
+ delete method_copy;
+ break;
+ }
+
+ case WM_PAINT:
+ {
+ if (GetUpdateRect(m_hwnd, 0, FALSE))
+ {
+ PAINTSTRUCT ps;
+ HDC mydc = BeginPaint(m_hwnd, &ps);
+ BitBlt(mydc, 0, 0, m_sz.cx, m_sz.cy, m_bmp->getDC(), 0, 0, SRCCOPY);
+ EndPaint(m_hwnd, &ps);
+ return 0;
+ }
+ break;
+ }
+
+ case WM_PRINT:
+ case WM_PRINTCLIENT:
+ {
+ HDC mydc = (HDC)wParam;
+ BitBlt(mydc, 0, 0, m_sz.cx, m_sz.cy, m_bmp->getDC(), 0, 0, SRCCOPY);
+ break;
+ }
+
+ case WM_MOUSEMOVE:
+ {
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin?m_lpzSkin:m_options->SkinPack);
+ if (skin)
+ if (skin->onMouseMove(this, LOWORD(lParam), HIWORD(lParam)))
+ animate();
+
+ if (m_bIsHovered) break;
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ tme.hwndTrack = m_hwnd;
+ _TrackMouseEvent(&tme);
+ if (!m_customPopup) PopupThreadLock();
+#if defined(_UNICODE)
+ if (m_options->OpaqueOnHover)
+ updateLayered(255);
+#else
+ if (MySetLayeredWindowAttributes && m_options->OpaqueOnHover)
+ updateLayered(255);
+#endif
+ m_bIsHovered = true;
+ break;
+ }
+ case WM_MOUSELEAVE:
+ {
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin?m_lpzSkin:m_options->SkinPack);
+ if (skin)
+ if (skin->onMouseMove(this, LOWORD(lParam), HIWORD(lParam)))
+ animate();
+
+ if (!m_bIsHovered) break;
+#if defined(_UNICODE)
+ if (m_options->OpaqueOnHover)
+ updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
+#else
+ if (MySetLayeredWindowAttributes && m_options->OpaqueOnHover)
+ updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
+#endif
+ if (!m_customPopup) PopupThreadUnlock();
+ m_bIsHovered = false;
+ break;
+ }
+
+ case WM_CLOSE:
+ {
+ hide();
+ return TRUE;
+ }
+
+ case WM_DESTROY:
+ {
+ if (m_bIsHovered)
+ {
+ if (!m_customPopup) PopupThreadUnlock();
+ m_bIsHovered = false;
+ }
+ if (m_hhkAvatarChanged)
+ PopUp_UnhookEventAsync((WPARAM)m_hwnd, (LPARAM)m_hhkAvatarChanged);
+ SendMessage(m_hwnd, UM_FREEPLUGINDATA, 0, 0);
+ SetWindowLongPtr(m_hwnd, GWLP_USERDATA, 0);
+ m_hwnd = 0;
+
+ DestroyWindow(m_hwndToolTip);
+
+ if (!m_customPopup)
+ {
+ // we can't access "this" pointer after followint line!
+ PopupThreadRemoveWindow(this);
+ } else
+ {
+ delete this;
+ }
+
+ PostQuitMessage(0);
+ return TRUE;
+ }
+/*
+ case WM_WINDOWPOSCHANGING:
+// case WM_WINDOWPOSCHANGED:
+ {
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ wp->flags |= SWP_NOACTIVATE; // block focus stealing
+
+ if (!(wp->flags & SWP_NOZORDER))
+ {
+ if ((wp->hwndInsertAfter == HWND_BOTTOM) ||
+ (wp->hwndInsertAfter == HWND_NOTOPMOST) ||
+ (wp->hwndInsertAfter == HWND_TOP))
+ {
+ wp->hwndInsertAfter == HWND_TOPMOST;
+ } else
+ if (wp->hwndInsertAfter != HWND_TOPMOST)
+ {
+ HWND hwndAbove = GetWindow(wp->hwndInsertAfter, GW_HWNDPREV);
+ if (hwndAbove)
+ {
+ char buf[64];
+ GetClassName(hwndAbove, buf, sizeof(buf));
+ buf[sizeof(buf)-1] = 0;
+
+ if (lstrcmp(buf, POPUP_WNDCLASS))
+ wp->hwndInsertAfter == HWND_TOPMOST;
+ }
+ }
+ }
+
+ // this allows us to reduce message traffic
+ return 0;
+ }
+*/
+ }
+
+ if (m_PluginWindowProc && !closing)
+ {
+ lock();
+
+ // some plugins use cdecl instead of stdcall
+ // this is an attempt to fix them
+ BOOL result;
+
+ result = m_PluginWindowProc(this->m_hwnd, message, wParam, lParam);
+/*
+ DWORD esp_in, esp_out, esp_fixed;
+ __asm
+ {
+ push ecx
+ mov [esp_in], esp
+ push [lParam]
+ push [wParam]
+ push [message]
+ mov ecx, [this]
+ push [ecx+hwnd]
+ call [ecx+PluginWindowProc]
+ mov [result], eax
+ mov [esp_out], esp
+ cmp esp, [esp_in] ; check it
+ jz lbl_stack_fix_end
+ pop ecx ; fix stack
+ pop ecx
+ pop ecx
+ pop ecx
+lbl_stack_fix_end: ; end of stack fix hack
+ mov [esp_fixed], esp
+ pop ecx
+ }
+
+#ifndef POPUP_NO_STACK_WARNING
+ if (esp_in != esp_out)
+ {
+ HANDLE hBadModule = 0;
+ char szBadModule[64] = {0};
+
+ // plugin enumeration from the core
+ char exe[MAX_PATH];
+ char search[MAX_PATH];
+ char *p = 0;
+ // get miranda's exe path
+ GetModuleFileNameA(NULL, exe, SIZEOF(exe));
+ // find the last \ and null it out, this leaves no trailing slash
+ p = strrchr(exe, '\\');
+ if ( p ) *p=0;
+ // create the search filter
+ mir_snprintf(search,SIZEOF(search),"%s\\Plugins\\*.dll", exe);
+ {
+ // FFFN will return filenames for things like dot dll+ or dot dllx
+ HANDLE hFind=INVALID_HANDLE_VALUE;
+ WIN32_FIND_DATAA ffd;
+ hFind = FindFirstFileA(search, &ffd);
+ if ( hFind != INVALID_HANDLE_VALUE )
+ {
+ do
+ {
+ if ( !(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ HMODULE hModule = GetModuleHandleA(ffd.cFileName);
+ if (((char *)PluginWindowProc > (char *)hModule) &&
+ (((char *)PluginWindowProc - (char *)hModule) < ((char *)PluginWindowProc - (char *)hBadModule)))
+ {
+ hBadModule = hModule;
+ lstrcpynA(szBadModule, ffd.cFileName, sizeof(szBadModule));
+ }
+ }
+ } while ( FindNextFileA(hFind, &ffd) );
+ FindClose(hFind);
+ }
+ }
+
+#ifdef POPUP_STACK_WARNING_MSGBOX
+ char buf[256];
+ mir_snprintf(buf, sizeof(buf),
+ "Some plugin passed callback with invalid calling\r\n"
+ "convention and caused stack corruption\r\n"
+ "Module name: %s\r\n"
+ "PluginWindowProc: %x\r\n"
+ "ESP Before: %d\r\n"
+ "ESP After: %d\r\n"
+ "ESP Fixed: %d",
+ szBadModule,
+ PluginWindowProc,
+ esp_in, esp_out, esp_fixed);
+
+ MessageBox(NULL, buf, _T("Popup Plus stack check"), MB_ICONSTOP|MB_OK);
+#else
+ strcat(exe, "\\popup_stack.log");
+ FILE *f = fopen(exe,"a");
+ fprintf(f,
+ "Module name: %s; PluginWindowProc: 0x%x; ESP Before: %d; ESP After: %d; ESP Fixed: %d\n",
+ szBadModule,
+ PluginWindowProc,
+ esp_in, esp_out, esp_fixed);
+ fclose(f);
+#endif // _DEBUG
+ }
+#endif // POPUP_NO_STACK_WARNING
+*/
+ unlock();
+ return result;
+ }
+
+ return NullWindowProc(this->m_hwnd, message, wParam, lParam);
+}
+
+LRESULT CALLBACK PopupWnd2::WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ PopupWnd2 *wnd = 0;
+ if (message == WM_CREATE)
+ {
+ LPCREATESTRUCT cs = (LPCREATESTRUCT)lParam;
+ wnd = (PopupWnd2 *)cs->lpCreateParams;
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wnd);
+ } else
+ {
+ wnd = (PopupWnd2 *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ }
+ if (wnd) return wnd->WindowProc(message, wParam, lParam);
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
+
+void WindowThread(void *arg)
+{
+ CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+ OleInitialize(NULL); // we may need OLE in this thread for smiley substitution
+
+ PopupWnd2 *wnd = (PopupWnd2 *)arg;
+ wnd->buildMText();
+ wnd->create();
+ PostMessage(wnd->getHwnd(), UM_INITPOPUP, 0, 0);
+
+ MSG msg;
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ _endthread();
+}
+
+// Menu Host
+LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ static HANDLE hContact = NULL;
+
+ switch (message)
+ {
+ case UM_SHOWMENU:
+ {
+ hContact = (HANDLE)lParam;
+ POINT pt = {0};
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)hContact,0);
+ GetCursorPos(&pt);
+ HWND hwndSave = GetForegroundWindow();
+ SetForegroundWindow(hwnd);
+ TrackPopupMenu(hMenu, 0, pt.x, pt.y, 0, hwnd, NULL);
+ SetForegroundWindow(hwndSave);
+ DestroyMenu(hMenu);
+ PostMessage((HWND)wParam, UM_MENUDONE, 0, 0);
+ break;
+ }
+
+ case WM_COMMAND:
+ {
+ // do not call PluginWindowProc if menu item was clicked. prevent auto-closing...
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)hContact))
+ return DefWindowProc(hwnd, message, wParam, lParam);
+ break;
+ }
+
+ case WM_MEASUREITEM:
+ return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+
+ case WM_DRAWITEM:
+ return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
+ }
+
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h new file mode 100644 index 0000000000..8c5fd963e3 --- /dev/null +++ b/plugins/Popup/src/popup_wnd2.h @@ -0,0 +1,273 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/popup_wnd2.h $
+Revision : $Revision: 1620 $
+Last change on : $Date: 2010-06-23 21:31:05 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __popup_wnd2_h__
+#define __popup_wnd2_h__
+
+#define UM_CALLMETHOD (WM_USER+2048)
+
+class PopupAvatar;
+
+#define POPUP_OBJECT_SIGNARURE 0x0B1A11BE
+
+class PopupWnd2
+{
+public:
+ typedef LRESULT (PopupWnd2::*MethodPtr)(LPARAM lParam);
+ enum TextType {TT_NONE, TT_ANSI, TT_UNICODE, TT_MTEXT};
+
+ struct ActionInfo
+ {
+ POPUPACTION actionA;
+ RECT rc;
+ bool hover;
+
+ ActionInfo(): hover(false) {}
+ };
+
+ DWORD m_signature;
+
+private:
+ // style
+ COLORREF m_clBack, m_clText, m_clTitle, m_clClock;
+ int m_iTimeout;
+
+ // content
+ TextType m_textType;
+ char *m_lpzTitle, *m_lpzText;
+ WCHAR *m_lpwzTitle, *m_lpwzText;
+ HANDLE m_mtTitle, m_mtText;
+ bool m_bTextEmpty;
+ HFONT m_hfnTitle, m_hfnText;
+ HICON m_hIcon;
+ HBITMAP m_hbmAvatar;
+ char m_time[2+1+2+1];
+ ActionInfo* m_actions;
+ int m_actionCount;
+ HANDLE m_hNotification;
+
+ // other data
+ Formula::Args m_args;
+ HANDLE m_hContact, m_hContactPassed;
+ WNDPROC m_PluginWindowProc;
+ void *m_PluginData;
+
+ // the window
+ LPTSTR m_lpzSkin;
+ bool m_customPopup;
+ HWND m_hwnd, m_hwndToolTip;
+ bool m_bPositioned;
+ POINT m_pos;
+ SIZE m_sz;
+ MyBitmap *m_bmpBase, *m_bmp, *m_bmpAnimate;
+ PopupAvatar *m_avatar;
+ int m_avatarFrameDelay;
+ bool m_bReshapeWindow;
+ HANDLE m_hhkAvatarChanged;
+ bool m_bIsPinned;
+
+ // show & hide
+// bool m_bIdleRequested;
+ bool m_bFade;
+// DWORD m_dwTmFade0, m_dwTmFade1;
+ BYTE m_btAlpha0, m_btAlpha1;
+ bool m_bSlide;
+// DWORD m_dwTmSlide0, m_dwTmSlide1;
+ POINT m_ptPosition0, m_ptPosition1;
+ bool m_bDestroy;
+ bool m_bIsHovered;
+
+ // prevent unwanted clicks
+ POINT m_ptPrevCursor;
+
+ // system
+ POPUPOPTIONS *m_options;
+ DWORD m_lockCount;
+
+ PopupSkin::RenderInfo m_renderInfo;
+
+ void fixDefaults();
+ void fixAvatar();
+ int fixActions(POPUPACTION *theActions, int count);
+ int fixActions(POPUPACTION *theActions, int count, int additional);
+
+public:
+// PopupWnd2(POPUPDATA *ppd, POPUPOPTIONS *theCustomOptions=NULL, bool renderOnly=false);
+// PopupWnd2(POPUPDATAEX_V2 *ppd, POPUPOPTIONS *theCustomOptions=NULL, bool renderOnly=false);
+// PopupWnd2(POPUPDATAW_V2 *ppd, POPUPOPTIONS *theCustomOptions=NULL, bool renderOnly=false);
+ PopupWnd2(POPUPDATA2 *ppd, POPUPOPTIONS *theCustomOptions=NULL, bool renderOnly=false);
+// PopupWnd2(HANDLE hNtf, POPUPOPTIONS *theCustomOptions=NULL, bool renderOnly=false);
+ ~PopupWnd2();
+
+ void startThread();
+
+ void create();
+ void updateLayered(BYTE opacity);
+ SIZE measure();
+ void update();
+ void animate();
+
+ void show();
+ void hide();
+ void idle();
+
+ DWORD lock() { return ++m_lockCount; }
+ DWORD unlock() { return m_lockCount = m_lockCount ? m_lockCount-1 : 0; }
+ bool isLocked() { return m_lockCount != 0; }
+
+ void updateData(POPUPDATA *ppd);
+ void updateData(POPUPDATAEX_V2 *ppd);
+ void updateData(POPUPDATAW_V2 *ppd);
+ void updateData(POPUPDATA2 *ppd);
+// void updateData(HANDLE hNtf);
+ void buildMText();
+ void updateText(char *text);
+ void updateText(WCHAR *text);
+ void updateTitle(char *title);
+ void updateTitle(WCHAR *title);
+
+ void updateTimer();
+
+ MyBitmap *getContent() { return m_bmp; }
+
+ COLORREF getTextColor() { return m_clText; }
+ COLORREF getTitleColor() { return m_clTitle; }
+ COLORREF getClockColor() { return m_clClock; }
+ COLORREF getBackColor() { return m_clBack; }
+
+ bool isTextEmpty() { return m_bTextEmpty; }
+ TextType getTextType() { return m_textType; }
+ char *getTextA() { return m_lpzText; }
+ WCHAR *getTextW() { return m_lpwzText; }
+ HANDLE getTextM() { return m_mtText; }
+ char *getTitleA() { return m_lpzTitle; }
+ WCHAR *getTitleW() { return m_lpwzTitle; }
+ HANDLE getTitleM() { return m_mtTitle; }
+
+ int getActionCount() { return m_actionCount; }
+ ActionInfo *getActions() { return m_actions; }
+
+ char *getTime() { return m_time; }
+ HICON getIcon() { return m_hIcon; }
+ HANDLE getContact() { return m_hContact; }
+ HANDLE getContactPassed() { return m_hContactPassed; }
+ int getTimeout() { return m_iTimeout; }
+// HBITMAP getAvatar() { return hbmAvatar; }
+ PopupAvatar *getAvatar() { return m_avatar; }
+ HWND getHwnd() { return m_hwnd; }
+ void *getData() { return m_PluginData; }
+
+ Formula::Args *getArgs() { return &m_args; }
+ PopupSkin::RenderInfo *getRenderInfo() { return &m_renderInfo; }
+
+ SIZE getSize() { return m_sz; }
+ void setSize(SIZE sz)
+ {
+ this->m_sz = sz;
+ if (m_hwnd)
+ {
+ SetWindowPos(m_hwnd, 0, 0, 0, sz.cx, sz.cy, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING);
+ if (!m_customPopup)
+ PopupThreadUpdateWindow(this);
+ }
+ }
+ bool isPositioned() { return m_bPositioned; }
+ POINT getPosition() { return m_pos; }
+ POINT getRealPosition() { return POINT(); }
+ void setPosition(POINT pt)
+ {
+ m_bPositioned = true;
+ m_pos = pt;
+ if (m_bSlide)
+ {
+ m_ptPosition1 = pt;
+ } else
+ {
+ SetWindowPos(m_hwnd, 0, pt.x, pt.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING);
+ }
+ }
+
+ // Thread-related methods
+ void callMethodAsync(MethodPtr method, LPARAM lParam)
+ {
+ // we can't pass MethodPtr via WPARAM because it's size can differ! well, it's still 4 bytes on msvc but
+ // on gcc we will get 8 bytes...
+ MethodPtr *method_copy = new MethodPtr; *method_copy = method;
+ PostMessage(m_hwnd, UM_CALLMETHOD, (WPARAM)method_copy, (LPARAM)lParam);
+ }
+ void callMethodSync(MethodPtr method, LPARAM lParam)
+ {
+ // we can't pass MethodPtr via WPARAM because it's size can differ! well, it's still 4 bytes on msvc but
+ // on gcc we will get 8 bytes...
+ MethodPtr *method_copy = new MethodPtr; *method_copy = method;
+ SendMessage(m_hwnd, UM_CALLMETHOD, (WPARAM)method_copy, (LPARAM)lParam);
+ }
+
+ LRESULT m_updateData_POPUPDATA(LPARAM arg) { updateData((POPUPDATA *)arg); update(); return 0; }
+ LRESULT m_updateData_POPUPDATAEX_V2(LPARAM arg) { updateData((POPUPDATAEX_V2 *)arg); update(); return 0; }
+ LRESULT m_updateData_POPUPDATAW_V2(LPARAM arg) { updateData((POPUPDATAW_V2 *)arg); update(); return 0; }
+ LRESULT m_updateData_POPUPDATA2(LPARAM arg) { updateData((POPUPDATA2 *)arg); update(); return 0; }
+// LRESULT m_updateData_HNOTIFY(LPARAM arg) { updateData((HANDLE)arg); update(); return 0; }
+ LRESULT m_updateText(LPARAM arg) { updateText((char *)arg); update(); return 0; }
+ LRESULT m_updateTextW(LPARAM arg) { updateText((WCHAR *)arg); update(); return 0; }
+ LRESULT m_updateTitle(LPARAM arg) { updateTitle((char *)arg); update(); return 0; }
+ LRESULT m_updateTitleW(LPARAM arg) { updateTitle((WCHAR *)arg); update(); return 0; }
+ LRESULT m_show(LPARAM arg) { show(); return 0; }
+ LRESULT m_hide(LPARAM arg) { hide(); return 0; }
+
+ // window related stuff
+ LRESULT CALLBACK WindowProc(UINT, WPARAM, LPARAM);
+ static LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM);
+
+ // window creation flag
+ volatile bool m_bWindowCreated;
+};
+
+bool LoadPopupWnd2();
+void UnloadPopupWnd2();
+
+static inline bool IsValidPopupObject(PopupWnd2 *wnd)
+{
+ bool res = false;
+ __try
+ {
+ if (wnd->m_signature == POPUP_OBJECT_SIGNARURE)
+ res = true;
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ res = false;
+ }
+ return res;
+}
+
+#endif // __popup_wnd2_h__
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp new file mode 100644 index 0000000000..48f1919d12 --- /dev/null +++ b/plugins/Popup/src/services.cpp @@ -0,0 +1,675 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/services.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+int num_classes = 0; //for core class api support
+
+// isWorkstationLocked() code from core
+bool isWorkstationLocked()
+{
+ bool rc = false;
+
+ if (OpenInputDesktop != NULL) {
+ HDESK hDesk = OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP);
+ if (hDesk == NULL)
+ rc = true;
+ else if (CloseDesktop != NULL)
+ CloseDesktop(hDesk);
+ }
+ return rc;
+}
+
+// isFullScreen() code from core
+static bool isFullScreen()
+{
+ RECT rcScreen = {0};
+
+ rcScreen.right = GetSystemMetrics(SM_CXSCREEN);
+ rcScreen.bottom = GetSystemMetrics(SM_CYSCREEN);
+
+ if (MonitorFromWindow != NULL)
+ {
+ HMONITOR hMon = MonitorFromWindow(GetForegroundWindow(), MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (GetMonitorInfo(hMon, &mi))
+ rcScreen = mi.rcMonitor;
+ }
+
+ HWND hWndDesktop = GetDesktopWindow();
+ HWND hWndShell = GetShellWindow();
+
+ // check foregroundwindow
+ HWND hWnd = GetForegroundWindow();
+ if (hWnd && hWnd != hWndDesktop && hWnd != hWndShell)
+ {
+ TCHAR tszClassName[128] = _T("");
+ GetClassName(hWnd, tszClassName, SIZEOF(tszClassName));
+ if (_tcscmp(tszClassName, _T("WorkerW")))
+ {
+ RECT rect, rectw, recti;
+ GetWindowRect(hWnd, &rectw);
+
+ GetClientRect(hWnd, &rect);
+ ClientToScreen(hWnd, (LPPOINT)&rect);
+ ClientToScreen(hWnd, (LPPOINT)&rect.right);
+
+ if (EqualRect(&rect, &rectw) && IntersectRect(&recti, &rect, &rcScreen) &&
+ EqualRect(&recti, &rcScreen))
+ return true;
+ }
+ }
+
+ return false;
+}
+
+//===== PopUp/AddPopUp
+INT_PTR PopUp_AddPopUp(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ POPUPDATA *ppd = (POPUPDATA*)wParam;
+ if (!ppd) return -1;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = PU2_ANSI;
+ ppd2.lchContact = ppd->lchContact;
+ ppd2.lchIcon = ppd->lchIcon;
+ ppd2.lpzTitle = ppd->lpzContactName;
+ ppd2.lpzText = ppd->lpzText;
+ ppd2.colorBack = ppd->colorBack;
+ ppd2.colorText = ppd->colorText;
+ ppd2.PluginWindowProc = ppd->PluginWindowProc;
+ ppd2.PluginData = ppd->PluginData;
+ ppd2.iSeconds = PopUpOptions.Seconds;
+ return PopUp_AddPopUp2((WPARAM)&ppd2, lParam);
+/*
+ PopupWnd2 *wnd = new PopupWnd2(ppd);
+
+ if (lParam & APF_RETURN_HWND)
+ {
+ while (!wnd->bWindowCreated) Sleep(1);
+ return (int)wnd->getHwnd();
+ }
+
+ return 1;
+*/
+}
+
+//===== PopUp/AddPopUpEx
+INT_PTR PopUp_AddPopUpEx(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ POPUPDATAEX_V2 *ppd = (POPUPDATAEX_V2*)wParam;
+ if (!ppd) return -1;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = PU2_ANSI;
+ ppd2.lchContact = ppd->lchContact;
+ ppd2.lchIcon = ppd->lchIcon;
+ ppd2.lpzTitle = ppd->lpzContactName;
+ ppd2.lpzText = ppd->lpzText;
+ ppd2.colorBack = ppd->colorBack;
+ ppd2.colorText = ppd->colorText;
+ ppd2.PluginWindowProc = ppd->PluginWindowProc;
+ ppd2.PluginData = ppd->PluginData;
+ ppd2.iSeconds = ppd->iSeconds;
+
+ if (lParam&APF_NEWDATA)
+ {
+ ppd2.lchNotification = ppd->hNotification;
+ ppd2.actionCount = ppd->actionCount;
+ ppd2.lpActions = ppd->lpActions;
+// ppd2.hbmAvatar = ppd->hbmAvatar;
+ }
+
+ return PopUp_AddPopUp2((WPARAM)&ppd2, lParam);
+
+/*
+ if (lParam & APF_RETURN_HWND)
+ {
+ while (!wnd->bWindowCreated) Sleep(1);
+ return (int)wnd->getHwnd();
+ }
+
+ return 1;
+*/
+}
+
+//===== PopUp/AddPopupW
+INT_PTR PopUp_AddPopUpW(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ POPUPDATAW_V2 *ppd = (POPUPDATAW_V2*)wParam;
+ if (!ppd) return -1;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = PU2_UNICODE;
+ ppd2.lchContact = ppd->lchContact;
+ ppd2.lchIcon = ppd->lchIcon;
+ ppd2.lpwzTitle = ppd->lpwzContactName;
+ ppd2.lpwzText = ppd->lpwzText;
+ ppd2.colorBack = ppd->colorBack;
+ ppd2.colorText = ppd->colorText;
+ ppd2.PluginWindowProc = ppd->PluginWindowProc;
+ ppd2.PluginData = ppd->PluginData;
+ ppd2.iSeconds = ppd->iSeconds;
+ ppd2.lchNotification = ppd->hNotification;
+
+ if (lParam&APF_NEWDATA)
+ {
+ ppd2.actionCount = ppd->actionCount;
+ ppd2.lpActions = ppd->lpActions;
+// ppd2.hbmAvatar = ppd->hbmAvatar;
+ }
+
+ return PopUp_AddPopUp2((WPARAM)&ppd2, lParam);
+
+/*
+ if (lParam & APF_RETURN_HWND)
+ {
+ while (!wnd->bWindowCreated) Sleep(1);
+ return (int)wnd->getHwnd();
+ }
+
+ return 1;
+*/
+}
+
+//===== PopUp/AddPopup2
+static __forceinline DWORD Proto_Status2Flag_My(DWORD status)
+{
+ if (DWORD res = Proto_Status2Flag(status))
+ return res;
+ return PF2_IDLE;
+}
+
+INT_PTR PopUp_AddPopUp2(WPARAM wParam, LPARAM lParam)
+{
+ /* NOTE: we will return 0 instead of -1 since tabSRMM stops using popup after first failure :/ */
+
+ if (!gbPopupLoaded) return -1;
+
+ POPUPDATA2 *ppdIn = (POPUPDATA2 *)wParam;
+ if (!ppdIn) return -1;
+
+ POPUPDATA2 ppdFixed = {0};
+ POPUPDATA2 *ppd = &ppdFixed;
+ CopyMemory(ppd, ppdIn, min(ppdIn->cbSize, sizeof(POPUPDATA2)));
+
+ DWORD disableWhen;
+ FillNotificationData(ppd, &disableWhen);
+
+ if (!(lParam&APF_NO_HISTORY))
+ PopupHistoryAdd(ppd);
+
+ if (PopupThreadIsFull())
+ return -1;
+
+ #ifdef _DEBUG
+ char temp[128];
+ OutputDebugStringA("isWorkstationLocked: \t");
+ OutputDebugStringA(isWorkstationLocked() ? "true":"false");
+ OutputDebugStringA("\n");
+ #endif
+
+ if (isWorkstationLocked())
+ return -1;
+
+ // Check if contact handle is valid.
+ char *proto = NULL;
+ if (ppd->lchContact)
+ proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ppd->lchContact, 0);
+
+ BYTE bShowMode = proto ? DBGetContactSettingByte(ppd->lchContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
+
+ if (bShowMode == PU_SHOWMODE_BLOCK)
+ return -1;
+
+ if (bShowMode != PU_SHOWMODE_FAVORITE)
+ {
+ if (!PopUpOptions.ModuleIsEnabled)
+ return -1;
+ #ifdef _DEBUG
+ itoa(PopUpOptions.DisableWhenFullscreen,temp,10);
+ OutputDebugStringA("PopUpOptions.DisableWhenFullscreen: \t");
+ OutputDebugStringA(temp);
+ OutputDebugStringA("\n");
+ itoa(bShowMode,temp,10);
+ OutputDebugStringA("bShowMode: \t");
+ OutputDebugStringA(temp);
+ OutputDebugStringA("\n");
+ OutputDebugStringA("isFullScreen: \t");
+ OutputDebugStringA(isFullScreen() ? "true":"false");
+ OutputDebugStringA("\n");
+ #endif
+
+ if (PopUpOptions.DisableWhenFullscreen && (bShowMode != PU_SHOWMODE_FULLSCREEN) && isFullScreen())
+ return -1;
+
+ if (DBGetContactSettingDword(NULL, MODULNAME, "Global Status", 0) &
+ Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0)))
+ return -1;
+
+ if ((disableWhen & 0x0000FFFF) & Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0)))
+ return -1;
+
+ if (proto)
+ {
+ char prefix[128];
+ mir_snprintf(prefix, sizeof(prefix), "Protocol Status/%s", (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ppd->lchContact, 0));
+ if (DBGetContactSettingDword(NULL, MODULNAME, prefix, 0) &
+ Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
+ return -1;
+ if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
+ return -1;
+ }
+ }
+
+ if (lParam&APF_CUSTOM_POPUP)
+ ppd->flags |= PU2_CUSTOM_POPUP;
+ PopupWnd2 *wnd = new PopupWnd2(ppd, NULL, false);
+
+ if (lParam & APF_RETURN_HWND)
+ {
+ while (!wnd->m_bWindowCreated) Sleep(1);
+ return (INT_PTR)wnd->getHwnd();
+ }
+
+ return 0;
+}
+
+//===== PopUp/GetContact
+INT_PTR PopUp_GetContact(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ HWND hwnd = (HWND)wParam;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (wnd && IsValidPopupObject(wnd)) return (INT_PTR)wnd->getContactPassed();
+ return (INT_PTR)(-1);
+}
+
+//===== PopUp/GetPluginData
+INT_PTR PopUp_GetPluginData(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ HWND hwnd = (HWND)wParam;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (wnd && IsValidPopupObject(wnd)) return (INT_PTR)wnd->getData();
+ return (INT_PTR)(-1);
+}
+
+//===== PopUp/IsSecondLineShown
+INT_PTR PopUp_IsSecondLineShown(WPARAM wParam, LPARAM lParam)
+{
+ return 1;
+}
+
+//===== PopUp/ChangeText
+INT_PTR PopUp_ChangeText(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ if (!wParam) return -1;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ if (!wnd || !IsValidPopupObject(wnd)) return -1;
+ wnd->callMethodSync(&PopupWnd2::m_updateText, lParam);
+/*
+ char *str = (char *)mir_alloc(sizeof(char) * (strlen((char *)lParam) + 1));
+ strcpy(str, (char *)lParam);
+ PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_TEXT, (LPARAM)str);
+*/
+ return 0;
+}
+
+//===== PopUp/ChangeTextW
+INT_PTR PopUp_ChangeTextW(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ if (!wParam) return -1;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ if (!wnd || !IsValidPopupObject(wnd)) return -1;
+ wnd->callMethodSync(&PopupWnd2::m_updateTextW, lParam);
+/*
+ WCHAR *str = (WCHAR *)mir_alloc(sizeof(WCHAR) * (wcslen((WCHAR *)lParam) + 1));
+ wcscpy(str, (WCHAR *)lParam);
+ PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_TEXTW, (LPARAM)str);
+*/
+ return 0;
+}
+
+//===== PopUp/Change
+INT_PTR PopUp_Change(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ if (!wParam) return -1;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ if (!wnd || !IsValidPopupObject(wnd)) return -1;
+ wnd->callMethodSync(&PopupWnd2::m_updateData_POPUPDATAEX_V2, lParam);
+/*
+ POPUPDATAEX_V2 *ppdx = (POPUPDATAEX_V2 *)mir_alloc(sizeof(POPUPDATAEX_V2));
+ memcpy(ppdx, (POPUPDATAEX_V2 *)lParam, sizeof(POPUPDATAEX_V2));
+ PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_DATA, (LPARAM)ppdx);
+*/
+ return 0;
+}
+
+//===== PopUp/ChangeW
+INT_PTR PopUp_ChangeW(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ if (!wParam) return -1;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ if (!wnd || !IsValidPopupObject(wnd)) return -1;
+ wnd->callMethodSync(&PopupWnd2::m_updateData_POPUPDATAW_V2, lParam);
+/*
+ POPUPDATAW_V2 *ppdw = (POPUPDATAW_V2 *)mir_alloc(sizeof(POPUPDATAW_V2));
+ memcpy(ppdw, (POPUPDATAW_V2 *)lParam, sizeof(POPUPDATAW_V2));
+ PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_DATA, (LPARAM)ppdw);
+*/
+ return 0;
+}
+
+//===== PopUp/Change2
+INT_PTR PopUp_Change2(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ if (!wParam) return -1;
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ if (!wnd || IsValidPopupObject(wnd)) return -1;
+ wnd->callMethodSync(&PopupWnd2::m_updateData_POPUPDATA2, lParam);
+ return 0;
+}
+
+//===== PopUp/ShowMessage
+INT_PTR PopUp_ShowMessage(WPARAM wParam, LPARAM lParam) {
+ if(!gbPopupLoaded || !wParam || !lParam) return -1;
+ if(closing) return 0;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = PU2_ANSI;
+ ppd2.lpzText = (char*)wParam;
+ switch (lParam&0x7fffffff) {
+ case SM_ERROR:
+ ppd2.lchIcon = IcoLib_GetIcon(ICO_MISC_ERROR,0);
+ ppd2.colorBack = RGB(191,0,0);
+ ppd2.colorText = RGB(255,245,225);
+ ppd2.lchNotification = g_hntfError;
+ ppd2.lpzTitle = Translate("Error");
+ break;
+ case SM_WARNING:
+ ppd2.lchIcon = IcoLib_GetIcon(ICO_MISC_WARNING,0);
+ ppd2.colorBack = RGB(210,210,150);
+ ppd2.colorText = RGB(0,0,0);
+ ppd2.lchNotification = g_hntfWarning;
+ ppd2.lpzTitle = Translate("Warning");
+ break;
+ case SM_NOTIFY:
+ ppd2.lchIcon = IcoLib_GetIcon(ICO_MISC_NOTIFY,0);
+ ppd2.colorBack = RGB(230,230,230);
+ ppd2.colorText = RGB(0,0,0);
+ ppd2.lchNotification = g_hntfNotification;
+ ppd2.lpzTitle = Translate("Notify");
+ break;
+ default: //No no no... you must give me a good value.
+ return -1;
+ }
+ return PopUp_AddPopUp2((WPARAM)&ppd2, (LPARAM)((lParam&0x80000000)?APF_NO_HISTORY:0));
+}
+
+INT_PTR PopUp_ShowMessageW(WPARAM wParam, LPARAM lParam) {
+ if(!gbPopupLoaded || !wParam || !lParam) return -1;
+ if(closing) return 0;
+
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(ppd2);
+ ppd2.flags = PU2_UNICODE;
+ ppd2.lpwzText = (WCHAR*)wParam;
+ switch (lParam&0x7fffffff) {
+ case SM_ERROR:
+ ppd2.lchIcon = IcoLib_GetIcon(ICO_MISC_ERROR,0);
+ ppd2.colorBack = RGB(191,0,0);
+ ppd2.colorText = RGB(255,245,225);
+ ppd2.lchNotification = g_hntfError;
+ ppd2.lpwzTitle = TranslateW(L"Error");
+ break;
+ case SM_WARNING:
+ ppd2.lchIcon = IcoLib_GetIcon(ICO_MISC_WARNING,0);
+ ppd2.colorBack = RGB(210,210,150);
+ ppd2.colorText = RGB(0,0,0);
+ ppd2.lchNotification = g_hntfWarning;
+ ppd2.lpwzTitle = TranslateW(L"Warning");
+ break;
+ case SM_NOTIFY:
+ ppd2.lchIcon = IcoLib_GetIcon(ICO_MISC_NOTIFY,0);
+ ppd2.colorBack = RGB(230,230,230);
+ ppd2.colorText = RGB(0,0,0);
+ ppd2.lchNotification = g_hntfNotification;
+ ppd2.lpwzTitle = TranslateW(L"Notify");
+ break;
+ default: //No no no... you must give me a good value.
+ return -1;
+ }
+ return PopUp_AddPopUp2((WPARAM)&ppd2, (LPARAM)((lParam&0x80000000)?APF_NO_HISTORY:0));
+}
+
+//===== PopUp/Query
+INT_PTR PopUp_Query(WPARAM wParam, LPARAM lParam)
+{
+ if (!gbPopupLoaded) return -1;
+
+ if (closing)
+ return 0;
+
+ switch (wParam) {
+ case PUQS_ENABLEPOPUPS: {
+ if (PopUpOptions.ModuleIsEnabled) return 1; //They're already ON!!!
+ else { //Module was disabled.
+ svcEnableDisableMenuCommand(0,0);
+ return 0;
+ }
+ }
+ case PUQS_DISABLEPOPUPS: {
+ if (!(PopUpOptions.ModuleIsEnabled)) return 1; //They're already OFF!!!
+ else {
+ svcEnableDisableMenuCommand(0,0);
+ return 0;
+ }
+ }
+ case PUQS_GETSTATUS:
+ return (PopUpOptions.ModuleIsEnabled);
+ default:
+ return -1;
+ }
+ return 0;
+}
+
+
+//===== PopUp/RegisterActions
+INT_PTR PopUp_RegisterActions(WPARAM wParam, LPARAM lParam)
+{
+ LPPOPUPACTION actions = (LPPOPUPACTION)wParam;
+ for (int i = 0; i < lParam; ++i)
+ RegisterAction(&actions[i]);
+ return 0;
+}
+
+
+INT_PTR PopUp_RegisterNotification(WPARAM wParam, LPARAM lParam)
+{
+ return (INT_PTR)RegisterNotification((LPPOPUPNOTIFICATION)wParam);
+}
+
+
+//===== PopUp/UnhookEventAsync
+struct SafeUnhookEventParam
+{
+ HWND hwndPopup;
+ HANDLE hEvent;
+};
+
+static void CALLBACK SafeUnhookEventFunc(ULONG_PTR dwParam)
+{
+ UnhookEvent(((SafeUnhookEventParam *)dwParam)->hEvent);
+ PostMessage(((SafeUnhookEventParam *)dwParam)->hwndPopup, UM_POPUPUNHOOKCOMPLETE, 0,
+ (LPARAM)((SafeUnhookEventParam *)dwParam)->hEvent);
+ delete (SafeUnhookEventParam *)dwParam;
+}
+
+INT_PTR PopUp_UnhookEventAsync(WPARAM wParam, LPARAM lParam)
+{
+ SafeUnhookEventParam *param = new SafeUnhookEventParam;
+ param->hwndPopup = (HWND)wParam;
+ param->hEvent = (HANDLE)lParam;
+ QueueUserAPC(SafeUnhookEventFunc, hMainThread, (ULONG_PTR)param);
+ return 0;
+}
+
+//===== PopUp/RegisterVfx (effekt name for drop down box)
+INT_PTR PopUp_RegisterVfx(WPARAM wParam, LPARAM lParam)
+{
+ OptAdv_RegisterVfx((char *)lParam);
+ return 0;
+}
+
+//===== PopUp/RegisterClass (for core class api support)
+INT_PTR PopUp_RegisterPopupClass(WPARAM wParam, LPARAM lParam) {
+ char setting[256];
+ POPUPCLASS *pc = (POPUPCLASS *)lParam;
+ POPUPTREEDATA *ptd = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
+ memset(ptd,0,sizeof(POPUPTREEDATA));
+ ptd->cbSize = sizeof(POPUPTREEDATA);
+ ptd->signature = 0/*PopupNotificationData_SIGNATURE*/;
+ ptd->typ = 2;
+ memcpy(&ptd->pupClass, pc, sizeof(POPUPCLASS));
+ ptd->pszTreeRoot = mir_a2t(pc->pszName);
+ ptd->pupClass.pszName = mir_strdup(pc->pszName);
+ if(pc->flags & PCF_UNICODE) {
+ ptd->pupClass.pwszDescription = mir_wstrdup(pc->pwszDescription);
+ ptd->pszDescription = mir_u2t(pc->pwszDescription);
+ }
+ else {
+ ptd->pupClass.pszDescription = mir_strdup (pc->pszDescription);
+ ptd->pszDescription = mir_a2t(pc->pszDescription);
+ }
+ LoadClassSettings(ptd, PU_MODULCLASS);
+
+ //we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
+ mir_snprintf(setting, 256, "%s/TextCol", ptd->pupClass.pszName);
+ ptd->pupClass.colorText = (COLORREF)DBGetContactSettingDword(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
+ FontID fid = {0};
+ fid.cbSize = sizeof(FontID);
+ mir_snprintf(fid.group, sizeof(fid.group), "%s/%s", PU_FNT_AND_COLOR, ptd->pupClass.pszName);
+ strcpy(fid.dbSettingsGroup, PU_MODULCLASS);
+ fid.flags = FIDF_DEFAULTVALID;
+ fid.deffontsettings.charset = DEFAULT_CHARSET;
+ fid.deffontsettings.size = -11;
+ strcpy(fid.deffontsettings.szFace, "Verdana");
+ strcpy(fid.name, PU_FNT_NAME_TEXT);
+ strcpy(fid.prefix, setting);
+ mir_snprintf(fid.prefix, sizeof(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
+ fid.deffontsettings.style = 0;
+ fid.deffontsettings.colour = fonts.clText;
+ CallService(MS_FONT_REGISTER, (WPARAM)&fid, 0);
+
+ //we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
+ mir_snprintf(setting, 256, "%s/BgCol", ptd->pupClass.pszName);
+ ptd->pupClass.colorBack = (COLORREF)DBGetContactSettingDword(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
+ ColourID cid = {0};
+ cid.cbSize = sizeof(ColourID);
+ mir_snprintf(cid.group, sizeof(cid.group), "%s/%s", PU_FNT_AND_COLOR, ptd->pupClass.pszName);
+ strcpy(cid.dbSettingsGroup, PU_MODULCLASS);
+ strcpy(cid.name, PU_COL_BACK_NAME);
+ mir_snprintf(cid.setting, sizeof(cid.setting), "%s/BgCol", ptd->pupClass.pszName);
+ cid.defcolour = fonts.clBack;
+ CallService(MS_COLOUR_REGISTER, (WPARAM)&cid, 0);
+
+ gTreeData.insert(ptd);
+ num_classes++;
+
+ return 0;
+}
+
+//===== PopUp/AddPopupClass (for core class api support)
+INT_PTR PopUp_CreateClassPopup(WPARAM wParam, LPARAM lParam) {
+ int ret = 1;
+ POPUPDATACLASS *pdc = (POPUPDATACLASS *)lParam;
+ if(pdc->cbSize != sizeof(POPUPDATACLASS)) return ret;
+
+ POPUPCLASS *pc = NULL;
+ POPUPTREEDATA *ptd = NULL;
+
+ if(wParam) pc = (POPUPCLASS *)wParam;
+ else {
+ LPTSTR group = mir_a2t(pdc->pszClassName);
+ ptd = (POPUPTREEDATA *)FindTreeData(group, NULL, 2);
+ if(ptd) pc = &ptd->pupClass;
+ }
+ if(pc) {
+ POPUPDATA2 ppd2 = {0};
+ ppd2.cbSize = sizeof(POPUPDATA2);
+ ppd2.colorBack = pc->colorBack;
+ ppd2.colorText = pc->colorText;
+ ppd2.lchIcon = pc->hIcon;
+ ppd2.iSeconds = pc->iSeconds;
+ ppd2.PluginWindowProc = pc->PluginWindowProc;
+ if(pc->flags & PCF_UNICODE) {
+ ppd2.flags = PU2_UNICODE;
+ ppd2.lpwzTitle = (WCHAR*)pdc->pwszTitle;
+ ppd2.lpwzText = (WCHAR*)pdc->pwszText;
+ }
+ else {
+ ppd2.flags = PU2_ANSI;
+ ppd2.lpzTitle = (char *)pdc->pszTitle;
+ ppd2.lpzText = (char *)pdc->pszText;
+ }
+ ppd2.lchContact = pdc->hContact;
+ ppd2.PluginData = pdc->PluginData;
+
+ ret = PopUp_AddPopUp2((WPARAM)&ppd2, 0);
+ }
+ return ret!=0 ? 1 : 0;
+}
+
diff --git a/plugins/Popup/src/services.h b/plugins/Popup/src/services.h new file mode 100644 index 0000000000..462d20345c --- /dev/null +++ b/plugins/Popup/src/services.h @@ -0,0 +1,67 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/services.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __services_h__
+#define __services_h__
+
+extern int num_classes; //for core class api support
+
+INT_PTR PopUp_AddPopUp(WPARAM, LPARAM);
+INT_PTR PopUp_AddPopUpW(WPARAM, LPARAM);
+
+INT_PTR PopUp_AddPopUpEx(WPARAM, LPARAM);
+INT_PTR PopUp_AddPopUp2(WPARAM, LPARAM);
+
+INT_PTR PopUp_GetContact(WPARAM, LPARAM);
+INT_PTR PopUp_IsSecondLineShown(WPARAM, LPARAM);
+
+INT_PTR PopUp_ChangeText(WPARAM, LPARAM);
+INT_PTR PopUp_ChangeTextW(WPARAM, LPARAM);
+
+INT_PTR PopUp_Change(WPARAM, LPARAM);
+INT_PTR PopUp_ChangeW(WPARAM, LPARAM);
+INT_PTR PopUp_Change2(WPARAM, LPARAM);
+
+INT_PTR PopUp_ShowMessage(WPARAM, LPARAM);
+INT_PTR PopUp_ShowMessageW(WPARAM, LPARAM);
+
+INT_PTR PopUp_Query(WPARAM, LPARAM);
+INT_PTR PopUp_GetPluginData(WPARAM, LPARAM);
+INT_PTR PopUp_RegisterActions(WPARAM wParam, LPARAM lParam);
+INT_PTR PopUp_RegisterNotification(WPARAM wParam, LPARAM lParam);
+INT_PTR PopUp_UnhookEventAsync(WPARAM wParam, LPARAM lParam);
+INT_PTR PopUp_RegisterVfx(WPARAM wParam, LPARAM lParam);
+
+INT_PTR PopUp_RegisterPopupClass(WPARAM wParam, LPARAM lParam);
+INT_PTR PopUp_CreateClassPopup(WPARAM wParam, LPARAM lParam);
+
+#endif // __services_h__
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp new file mode 100644 index 0000000000..d3847f6f7c --- /dev/null +++ b/plugins/Popup/src/skin.cpp @@ -0,0 +1,1518 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/skin.cpp $
+Revision : $Revision: 1651 $
+Last change on : $Date: 2010-07-15 20:31:06 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+#include <stdio.h>
+#include <fstream>
+#include <sstream>
+
+// PopupSkin
+PopupSkin::PopupSkin(LPCTSTR aName)
+{
+ for (int i = 0; i < 32; i++)
+ m_flag_names[i] = NULL;
+ m_elements = 0;
+ m_name = aName ? mir_tstrdup(aName) : NULL;
+}
+
+PopupSkin::~PopupSkin()
+{
+ if (m_name) mir_free(m_name);
+ for (int i = 0; i < 32; i++)
+ mir_free(m_flag_names[i]);
+ freeSkin(m_elements);
+}
+
+SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const
+{
+ SIZE sz = {0};
+ if (!(PopUpOptions.actions&ACT_ENABLE))
+ return sz;
+
+ if (PopUpOptions.actions&ACT_LARGE)
+ {
+ sz.cx = sz.cy = 32;
+ } else
+ {
+ sz.cx = sz.cy = 16;
+ }
+
+ if (PopUpOptions.actions&ACT_TEXT)
+ {
+ char *name = strchr(act->lpzTitle, '/');
+ if (!name) name = act->lpzTitle;
+ else ++name;
+
+ SIZE szText, szSpace;
+
+#if defined(_UNICODE)
+ LPWSTR wname = mir_a2u(name);
+ WCHAR *str = TranslateW(wname);
+ GetTextExtentPoint32W(hdc, str, lstrlenW(str), &szText);
+ mir_free(wname);
+ GetTextExtentPoint32W(hdc, L" ", 1, &szSpace);
+#else
+ if (g_popup.isOsUnicode && MyGetTextExtentPoint32W) {
+ LPWSTR wname = mir_a2u(name);
+ WCHAR *str = TranslateW(wname);
+ MyGetTextExtentPoint32W(hdc, str, lstrlenW(str), &szText);
+ mir_free(wname);
+ }
+ else {
+ char *str = Translate(name);
+ GetTextExtentPoint32A(hdc, str, lstrlenA(str), &szText);
+ }
+ GetTextExtentPoint32A(hdc, " ", 1, &szSpace);
+#endif
+ sz.cy = max(sz.cy, szText.cy);
+ sz.cx += szSpace.cx;
+ sz.cx += szText.cx;
+ sz.cy += 2;
+ } else
+ {
+ sz.cx += 4;
+ sz.cy += 4;
+ }
+
+ return sz;
+}
+
+SIZE PopupSkin::measureActionBar(HDC hdc, PopupWnd2 *wnd) const
+{
+ SIZE sz = {0};
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.action);
+ for (int i = 0; i < wnd->getActionCount(); ++i)
+ {
+ SIZE szAction = measureAction(hdc, &wnd->getActions()[i].actionA);
+
+ if (PopUpOptions.actions & ACT_TEXT)
+ {
+ sz.cx = max(sz.cx, szAction.cx);
+ sz.cy += szAction.cy;
+ } else
+ {
+ sz.cx += szAction.cx;
+ sz.cy = max(sz.cy, szAction.cy);
+ }
+ }
+ SelectObject(hdc, hFntSave);
+ return sz;
+}
+
+void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool hover) const
+{
+ if (!(PopUpOptions.actions&ACT_ENABLE))
+ return;
+
+ bmp->DrawIcon(act->lchIcon,
+ (PopUpOptions.actions&ACT_TEXT) ? x : (x+2),
+ y+2,
+ (PopUpOptions.actions&ACT_LARGE) ? 32 : 16,
+ (PopUpOptions.actions&ACT_LARGE) ? 32 : 16);
+
+ if (PopUpOptions.actions&ACT_TEXT)
+ {
+ char *name = strchr(act->lpzTitle, '/');
+ if (!name) name = act->lpzTitle;
+ else ++name;
+
+ SIZE szText, szSpace;
+
+ HFONT hFntSave = (HFONT)SelectObject(bmp->getDC(), hover ? fonts.actionHover : fonts.action);
+ SetTextColor(bmp->getDC(), hover ? fonts.clActionHover : fonts.clAction);
+ SetBkMode(bmp->getDC(), TRANSPARENT);
+
+ GetTextExtentPoint32A(bmp->getDC(), " ", 1, &szSpace);
+
+#if defined(_UNICODE)
+ LPWSTR wname = mir_a2u(name);
+ WCHAR *str = TranslateW(wname);
+ GetTextExtentPoint32W(bmp->getDC(), str, lstrlenW(str), &szText);
+ bmp->Draw_TextW(str,
+ (PopUpOptions.actions&ACT_LARGE) ? (x+szSpace.cx+32) : (x+szSpace.cx+16),
+ max(
+ y+2,
+ y+2 + (((PopUpOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy)/2
+ ));
+ mir_free(wname);
+#else
+ if (g_popup.isOsUnicode && MyGetTextExtentPoint32W)
+ {
+ LPWSTR wname = mir_a2u(name);
+ WCHAR *str = TranslateW(wname);
+ MyGetTextExtentPoint32W(bmp->getDC(), str, lstrlenW(str), &szText);
+ bmp->Draw_TextW(str,
+ (PopUpOptions.actions&ACT_LARGE) ? (x+szSpace.cx+32) : (x+szSpace.cx+16),
+ max(
+ y+2,
+ y+2 + (((PopUpOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy)/2
+ ));
+ mir_free(wname);
+ }
+ else {
+ char *str = Translate(name);
+ GetTextExtentPoint32A(bmp->getDC(), str, lstrlenA(str), &szText);
+ bmp->Draw_TextA(str,
+ (PopUpOptions.actions&ACT_LARGE) ? (x+szSpace.cx+32) : (x+szSpace.cx+16),
+ max(
+ y+2,
+ y+2 + (((PopUpOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy)/2
+ ));
+ }
+#endif
+ SelectObject(bmp->getDC(), hFntSave);
+ }
+ else {
+ if (hover)
+ {
+ RECT rc;
+ rc.left = x;
+ rc.top = y;
+ rc.right = x + ((PopUpOptions.actions&ACT_LARGE) ? 32 : 16) + 4;
+ rc.bottom = y + ((PopUpOptions.actions&ACT_LARGE) ? 32 : 16) + 4;
+ bmp->saveAlpha(rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
+ HBRUSH hbr = CreateSolidBrush(fonts.clActionHover);
+ FrameRect(bmp->getDC(), &rc, hbr);
+ DeleteObject(hbr);
+ bmp->restoreAlpha(rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
+ }
+ }
+}
+
+void PopupSkin::drawActionBar(MyBitmap *bmp, PopupWnd2 *wnd, int x, int y) const
+{
+ for (int i = 0; i < wnd->getActionCount(); ++i)
+ {
+ SIZE szAction = measureAction(bmp->getDC(), &wnd->getActions()[i].actionA);
+ drawAction(bmp, &wnd->getActions()[i].actionA, x, y, wnd->getActions()[i].hover);
+
+ wnd->getActions()[i].rc.left = x;
+ wnd->getActions()[i].rc.top = y;
+ wnd->getActions()[i].rc.right = x + szAction.cx;
+ wnd->getActions()[i].rc.bottom = y + szAction.cy;
+
+ if (PopUpOptions.actions & ACT_TEXT)
+ {
+ y += szAction.cy;
+ } else
+ {
+ x += szAction.cx;
+ }
+ }
+}
+
+void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options) const
+{
+ if (!m_elements) return;
+
+ SKINELEMENT *head = NULL;
+
+ int STYLE_SZ_CLOCK = 0;
+ if (!this->useInternalClock())
+ for (head = m_elements; head; head = head->next)
+ if ((head->type&ST_TYPEMASK) == ST_CLOCK)
+ break;
+ if (head && head->myBmp)
+ {//layerd clock
+ SIZE szNew;
+ szNew.cx = head->clocksize[CLOCK_LEFT]+head->clocksize[CLOCK_RIGHT];
+ szNew.cy = head->myBmp->getHeight();
+ for (char *p = wnd->getTime(); *p; p++)
+ {
+ if (*p == ':')
+ {
+ szNew.cx += head->clocksize[CLOCK_SEPARATOR];
+ } else
+ if ((*p >= '0') && (*p <= '9'))
+ {
+ szNew.cx += head->clocksize[CLOCK_DIGITS+*p-'0'];
+ }
+ }
+ wnd->getArgs()->add("clock.width",szNew.cx);
+ wnd->getArgs()->add("clock.height",szNew.cy);
+ STYLE_SZ_CLOCK = szNew.cx;
+ } else
+ {//normal clock
+ HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
+ SIZE sz; GetTextExtentPoint32A(hdc, wnd->getTime(), lstrlenA(wnd->getTime()), &sz);
+ SelectObject(hdc, hfnSave);
+ wnd->getArgs()->add("clock.width",sz.cx+2*STYLE_SZ_GAP);
+ wnd->getArgs()->add("clock.height",sz.cy);
+ STYLE_SZ_CLOCK = sz.cx+2*STYLE_SZ_GAP;
+ }
+
+ wnd->getArgs()->clear();
+ wnd->getArgs()->add("options.avatarsize", PopUpOptions.avatarSize);
+ wnd->getArgs()->add("window.width", maxw);
+ wnd->getArgs()->add("window.maxwidth", maxw);
+
+ for (int i = 0; i < 32; ++i)
+ {
+ char buf[10];
+ wsprintfA(buf, "opt%d", i);
+ wnd->getArgs()->add(buf, (m_flags&(1L<<i)) ? 1 : 0);
+ }
+
+ SIZE sz;
+ sz.cx = sz.cy = 0;
+ head = m_elements;
+ while (head)
+ {
+ if ((m_flags & head->flag_mask) != (head->flags & head->flag_mask))
+ {
+ head = head->next;
+ continue;
+ }
+
+ SIZE szNew = {0,0};
+ switch (head->type & ST_TYPEMASK)
+ {
+ case ST_TEXT:
+ {
+ int tmp = head->fw.eval(wnd->getArgs());
+ // this is used to measure and layout text
+ wnd->getRenderInfo()->textw = tmp ? tmp : (maxw - head->fx.eval(wnd->getArgs()));
+ szNew.cx = wnd->getRenderInfo()->textw;
+ if (wnd->isTextEmpty())
+ {
+ szNew.cx = szNew.cy = 0;
+ } else
+ {
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.text);
+ switch (wnd->getTextType())
+ {
+ case PopupWnd2::TT_ANSI:
+ {
+ RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
+ DrawTextExA(hdc, wnd->getTextA(), lstrlenA(wnd->getTextA()), &rc,
+ DT_CALCRECT|DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ szNew.cx = rc.right;
+ szNew.cy = rc.bottom;
+ break;
+ }
+ case PopupWnd2::TT_UNICODE:
+ {
+#if defined(_UNICODE)
+ RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
+ DrawTextExW(hdc, wnd->getTextW(), lstrlenW(wnd->getTextW()), &rc,
+ DT_CALCRECT|DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ szNew.cx = rc.right;
+ szNew.cy = rc.bottom;
+#else
+ if (g_popup.isOsUnicode && MyDrawTextExW)
+ {
+ RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
+ MyDrawTextExW(hdc, wnd->getTextW(), lstrlenW(wnd->getTextW()), &rc,
+ DT_CALCRECT|DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ szNew.cx = rc.right;
+ szNew.cy = rc.bottom;
+ }
+#endif
+ break;
+ }
+ case PopupWnd2::TT_MTEXT:
+ {
+ MText.Measure(hdc, &szNew, wnd->getTextM());
+ break;
+ }
+ }
+ SelectObject(hdc, hFntSave);
+ }
+
+ wnd->getRenderInfo()->texth = szNew.cy;
+
+ SIZE szActions = measureActionBar(hdc, wnd);
+ wnd->getRenderInfo()->actw = szActions.cx;
+ if (szActions.cy)
+ {
+ szNew.cx = max(szNew.cx, szActions.cx);
+ szNew.cy += szActions.cy;
+ szNew.cy += 3;
+ }
+
+ wnd->getRenderInfo()->realtextw = szNew.cx;
+
+ if (szNew.cx > maxw - head->fx.eval(wnd->getArgs()))
+ szNew.cx = maxw - head->fx.eval(wnd->getArgs());
+ wnd->getArgs()->add("text.width", szNew.cx);
+ wnd->getArgs()->add("text.height", szNew.cy);
+
+ break;
+ }
+
+ case ST_TITLE:
+ {
+ int tmp = head->fw.eval(wnd->getArgs());
+ // this is used to measure and layout text
+ wnd->getRenderInfo()->titlew = tmp ? tmp : (maxw - head->fx.eval(wnd->getArgs()) - STYLE_SZ_CLOCK);
+ szNew.cx = wnd->getRenderInfo()->titlew;
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
+ switch (wnd->getTextType())
+ {
+ case PopupWnd2::TT_ANSI:
+ {
+ RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
+ DrawTextExA(hdc, wnd->getTitleA(), lstrlenA(wnd->getTitleA()), &rc,
+ DT_CALCRECT|DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ szNew.cx = rc.right;
+ szNew.cy = rc.bottom;
+ break;
+ }
+ case PopupWnd2::TT_UNICODE:
+ {
+#if defined(_UNICODE)
+ RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
+ DrawTextExW(hdc, wnd->getTitleW(), lstrlenW(wnd->getTitleW()), &rc,
+ DT_CALCRECT|DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ szNew.cx = rc.right;
+ szNew.cy = rc.bottom;
+#else
+ if (g_popup.isOsUnicode && MyDrawTextExW)
+ {
+ RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
+ MyDrawTextExW(hdc, wnd->getTitleW(), lstrlenW(wnd->getTitleW()), &rc,
+ DT_CALCRECT|DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ szNew.cx = rc.right;
+ szNew.cy = rc.bottom;
+ }
+#endif
+ break;
+ }
+ case PopupWnd2::TT_MTEXT:
+ {
+ MText.Measure(hdc, &szNew, wnd->getTitleM());
+ break;
+ }
+ }
+ SelectObject(hdc, hFntSave);
+ if (szNew.cx > maxw - head->fx.eval(wnd->getArgs()) - STYLE_SZ_CLOCK)
+ szNew.cx = maxw - head->fx.eval(wnd->getArgs()) - STYLE_SZ_CLOCK;
+ szNew.cx += STYLE_SZ_CLOCK;
+ wnd->getArgs()->add("title.width", szNew.cx);
+ wnd->getArgs()->add("title.height", szNew.cy);
+ break;
+ }
+
+ case ST_ICON:
+ szNew.cx = szNew.cy = 16;
+ wnd->getArgs()->add("icon.width",16);
+ wnd->getArgs()->add("icon.height",16);
+ break;
+
+ case ST_BITMAP:
+// szNew.cx = szNew.cy = 0;
+ GetBmpSize(head->hbm, &szNew);
+ break;
+
+ case ST_MYBITMAP:
+ szNew.cx = head->myBmp->getWidth();
+ szNew.cy = head->myBmp->getHeight();
+ break;
+
+ case ST_AVATAR:
+ wnd->getRenderInfo()->hasAvatar = false;
+ szNew.cx = szNew.cy = 0;
+ if (wnd->getAvatar())
+ {
+ szNew.cx = wnd->getAvatar()->getWidth();
+ szNew.cy = wnd->getAvatar()->getHeight();
+ wnd->getArgs()->add("avatarbitmap.width",max(1,szNew.cx));
+ wnd->getArgs()->add("avatarbitmap.height",max(1,szNew.cy));
+ wnd->getRenderInfo()->hasAvatar = true;
+ }
+ break;
+
+ case ST_CLOCK:
+ if (head && head->myBmp)
+ {
+ szNew.cx = head->clocksize[CLOCK_LEFT]+head->clocksize[CLOCK_RIGHT];
+ szNew.cy = head->myBmp->getHeight();
+ for (char *p = wnd->getTime(); *p; p++)
+ {
+ if (*p == ':')
+ {
+ szNew.cx += head->clocksize[CLOCK_SEPARATOR];
+ } else
+ if ((*p >= '0') && (*p <= '9'))
+ {
+ szNew.cx += head->clocksize[CLOCK_DIGITS+*p-'0'];
+ }
+ }
+ wnd->getArgs()->add("clock.width",szNew.cx);
+ wnd->getArgs()->add("clock.height",szNew.cy);
+ } else
+ {
+ HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
+ SIZE sz; GetTextExtentPoint32A(hdc, wnd->getTime(), lstrlenA(wnd->getTime()), &sz);
+ SelectObject(hdc, hfnSave);
+ wnd->getArgs()->add("clock.width",sz.cx+2*STYLE_SZ_GAP);
+ wnd->getArgs()->add("clock.height",sz.cy);
+ }
+ break;
+ }
+
+ if (head->proportional && szNew.cx && szNew.cy && (((head->fw.eval(wnd->getArgs()) > 0) && !head->fh.eval(wnd->getArgs())) || (!head->fw.eval(wnd->getArgs()) && (head->fh.eval(wnd->getArgs()) > 0))))
+ {
+ if (head->fw.eval(wnd->getArgs()))
+ {
+ szNew.cy = szNew.cy * head->fw.eval(wnd->getArgs()) / szNew.cx;
+ szNew.cx = head->fw.eval(wnd->getArgs());
+ } else
+ {
+ szNew.cx = szNew.cx * head->fh.eval(wnd->getArgs()) / szNew.cy;
+ szNew.cy = head->fh.eval(wnd->getArgs());
+// szNew.cx = head->fx.eval(wnd->getArgs()) + szNew.cx * head->fh.eval(wnd->getArgs()) / szNew.cy;
+// szNew.cy = head->fy.eval(wnd->getArgs()) + head->fh.eval(wnd->getArgs());
+ }
+ }
+
+ if ((head->type & ST_TYPEMASK) == ST_AVATAR)
+ {
+ wnd->getArgs()->add("avatar.width",szNew.cx);
+ wnd->getArgs()->add("avatar.height",szNew.cy);
+
+ szNew.cy += 2;
+ }
+
+ if (!head->fw.eval(wnd->getArgs()))
+ szNew.cx += head->fx.eval(wnd->getArgs());
+ else
+ if (head->fw.eval(wnd->getArgs()) > 0)
+ szNew.cx = head->fx.eval(wnd->getArgs()) + head->fw.eval(wnd->getArgs());
+ else
+ szNew.cx = 0;
+
+ if (!head->fh.eval(wnd->getArgs()))
+ szNew.cy += head->fy.eval(wnd->getArgs());
+ else
+ if (head->fh.eval(wnd->getArgs()) > 0)
+ szNew.cy = head->fy.eval(wnd->getArgs()) + head->fh.eval(wnd->getArgs());
+ else
+ szNew.cy = 0;
+
+ if (head->fx.eval(wnd->getArgs()) >= 0 && szNew.cx > sz.cx) sz.cx = szNew.cx;
+ if (head->fy.eval(wnd->getArgs()) >= 0 && szNew.cy > sz.cy) sz.cy = szNew.cy;
+
+ head = head->next;
+ }
+// if (pw->title_height > 20)
+// sz.cy += pw->title_height - 20;
+
+ sz.cx += m_right_gap;
+ sz.cy += m_bottom_gap;
+
+ int tmp;
+
+ if (tmp = m_fw.eval(wnd->getArgs())) sz.cx = tmp;
+ if (tmp = m_fh.eval(wnd->getArgs())) sz.cy = tmp;
+
+ if (options->DynamicResize)
+ {
+ if (options->UseMinimumWidth && sz.cx < options->MinimumWidth)
+ sz.cx = options->MinimumWidth;
+ } else
+ {
+ sz.cx = options->MaximumWidth;
+ }
+
+ wnd->getArgs()->add("window.width",sz.cx);
+ wnd->getArgs()->add("window.height",sz.cy);
+ wnd->setSize(sz);
+}
+
+void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options, DWORD drawFlags) const
+{
+ if (!m_elements) return;
+
+ HDC hdc = bmp->getDC();
+ SKINELEMENT *head = NULL;
+
+ int STYLE_SZ_CLOCK = 0;
+ if (!this->useInternalClock())
+ for (head = m_elements; head; head = head->next)
+ if ((head->type&ST_TYPEMASK) == ST_CLOCK)
+ break;
+ if (head && head->myBmp)
+ {
+ SIZE szNew;
+ szNew.cx = head->clocksize[CLOCK_LEFT]+head->clocksize[CLOCK_RIGHT];
+ szNew.cy = head->myBmp->getHeight();
+ for (char *p = wnd->getTime(); *p; p++)
+ {
+ if (*p == ':')
+ {
+ szNew.cx += head->clocksize[CLOCK_SEPARATOR];
+ } else
+ if ((*p >= '0') && (*p <= '9'))
+ {
+ szNew.cx += head->clocksize[CLOCK_DIGITS+*p-'0'];
+ }
+ }
+ STYLE_SZ_CLOCK = szNew.cx;
+ } else
+ {
+ HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
+ SIZE sz; GetTextExtentPoint32A(hdc, wnd->getTime(), lstrlenA(wnd->getTime()), &sz);
+ SelectObject(hdc, hfnSave);
+ STYLE_SZ_CLOCK = sz.cx + 2*STYLE_SZ_GAP;
+ }
+
+
+ head = m_elements;
+
+ SIZE sz;
+ SIZE szWnd = wnd->getSize();
+ SIZE pos;
+ bool actionsRendered = false;
+ while (head)
+ {
+ if ((head->type&ST_TYPEMASK) == ST_AVATAR)
+ {
+ if (wnd->getAvatar()->isAnimated() && !(drawFlags&DF_ANIMATE))
+ {
+ head = head->next;
+ continue;
+ }
+ if (!wnd->getAvatar()->isAnimated() && !(drawFlags&DF_STATIC))
+ {
+ head = head->next;
+ continue;
+ }
+ } else
+ if ((head->type&ST_TYPEMASK) == ST_TEXT)
+ {
+ if (!wnd->getActionCount() && !(drawFlags&DF_STATIC))
+ {
+ head = head->next;
+ continue;
+ }
+ } else
+ if (!(drawFlags&DF_STATIC))
+ {
+ head = head->next;
+ continue;
+ }
+
+ if ((head->type&ST_BADPOS) || ((m_flags & head->flag_mask) != (head->flags & head->flag_mask)))
+ {
+ head = head->next;
+ continue;
+ }
+
+ int hShift = 0;
+ switch (head->type & ST_TYPEMASK)
+ {
+ case ST_TEXT:
+ {
+ if (head->textColor != (COLORREF)0xffffffff)
+ SetTextColor(hdc, head->textColor);
+ else
+ SetTextColor(hdc, wnd->getTextColor());
+
+ POINT pos;
+ pos.x = head->fx.eval(wnd->getArgs());
+ pos.y = head->fy.eval(wnd->getArgs());
+ SIZE sz;
+ sz.cx = wnd->getRenderInfo()->textw;
+ sz.cy = 1000;
+
+ SetRect(&wnd->getRenderInfo()->textRect, pos.x, pos.y,
+ pos.x + wnd->getRenderInfo()->realtextw,
+ pos.y + wnd->getRenderInfo()->texth);
+
+ if ((drawFlags&DF_STATIC) && !wnd->isTextEmpty())
+ {
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.text);
+ bmp->saveAlpha();
+ switch (wnd->getTextType())
+ {
+ case PopupWnd2::TT_ANSI:
+ {
+ RECT rc; SetRect(&rc, pos.x, pos.y, pos.x+sz.cx, pos.y+sz.cy);
+ DrawTextExA(hdc, wnd->getTextA(), lstrlenA(wnd->getTextA()), &rc,
+ DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ break;
+ }
+ case PopupWnd2::TT_UNICODE:
+ {
+#if defined(_UNICODE)
+ RECT rc; SetRect(&rc, pos.x, pos.y, pos.x+sz.cx, pos.y+sz.cy);
+ DrawTextExW(hdc, wnd->getTextW(), lstrlenW(wnd->getTextW()), &rc,
+ DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+#else
+ if (g_popup.isOsUnicode && MyDrawTextExW)
+ {
+ RECT rc; SetRect(&rc, pos.x, pos.y, pos.x+sz.cx, pos.y+sz.cy);
+ MyDrawTextExW(hdc, wnd->getTextW(), lstrlenW(wnd->getTextW()), &rc,
+ DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ }
+#endif
+ break;
+ }
+ case PopupWnd2::TT_MTEXT:
+ {
+ MText.Display(hdc, pos, sz, wnd->getTextM());
+ break;
+ }
+ }
+ SelectObject(hdc, hFntSave);
+ bmp->restoreAlpha();
+ }
+
+ if (!actionsRendered && (drawFlags&DF_ANIMATE))
+ {
+ int textAreaWidth = head->fw.eval(wnd->getArgs());
+ if (textAreaWidth <= 0) textAreaWidth = wnd->getRenderInfo()->realtextw;
+
+ drawActionBar(bmp, wnd,
+ DBGetContactSettingByte(NULL, MODULNAME, "CenterActions", 0) ?
+ (pos.x + (textAreaWidth - wnd->getRenderInfo()->actw)/2) :
+ (PopUpOptions.actions&ACT_RIGHTICONS) ?
+ (pos.x + textAreaWidth - wnd->getRenderInfo()->actw) :
+ // else
+ pos.x,
+ pos.y + wnd->getRenderInfo()->texth + 3);
+
+ actionsRendered = true;
+ }
+
+
+ break;
+ }
+
+ case ST_TITLE:
+ {
+ if (head->textColor != (COLORREF)0xffffffff)
+ SetTextColor(hdc, head->textColor);
+ else
+ SetTextColor(hdc, wnd->getTitleColor());
+
+ bmp->saveAlpha();
+ POINT pos;
+ pos.x = head->fx.eval(wnd->getArgs());
+ pos.y = head->fy.eval(wnd->getArgs());
+ SIZE sz;
+ sz.cx = wnd->getRenderInfo()->titlew;
+ sz.cy = 1000;
+
+ switch (wnd->getTextType())
+ {
+ case PopupWnd2::TT_ANSI:
+ {
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
+ RECT rc; SetRect(&rc, pos.x, pos.y, pos.x+sz.cx, pos.y+sz.cy);
+ DrawTextExA(hdc, wnd->getTitleA(), lstrlenA(wnd->getTitleA()), &rc,
+ DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ SelectObject(hdc, hFntSave);
+ break;
+ }
+ case PopupWnd2::TT_UNICODE:
+ {
+#if defined(_UNICODE)
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
+ RECT rc; SetRect(&rc, pos.x, pos.y, pos.x+sz.cx, pos.y+sz.cy);
+ DrawTextExW(hdc, wnd->getTitleW(), lstrlenW(wnd->getTitleW()), &rc,
+ DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ SelectObject(hdc, hFntSave);
+#else
+ if (g_popup.isOsUnicode && MyDrawTextExW)
+ {
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
+ RECT rc; SetRect(&rc, pos.x, pos.y, pos.x+sz.cx, pos.y+sz.cy);
+ MyDrawTextExW(hdc, wnd->getTitleW(), lstrlenW(wnd->getTitleW()), &rc,
+ DT_EXPANDTABS|DT_LEFT|DT_NOPREFIX|DT_TOP|DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
+ SelectObject(hdc, hFntSave);
+ }
+#endif
+ break;
+ }
+ case PopupWnd2::TT_MTEXT:
+ {
+ HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
+ MText.Display(hdc, pos, sz, wnd->getTitleM());
+ SelectObject(hdc, hFntSave);
+ break;
+ }
+ }
+
+ bmp->restoreAlpha();
+ break;
+ }
+
+ case ST_ICON:
+ bmp->DrawIcon(wnd->getIcon(), head->fx.eval(wnd->getArgs()), head->fy.eval(wnd->getArgs()), 16, 16);
+ break;
+
+ case ST_MYBITMAP:
+ sz.cx = head->myBmp->getWidth();
+ sz.cy = head->myBmp->getHeight();
+/*
+ if (head->fh.eval(wnd->getArgs()) > 0)
+ sz.cy = head->fh.eval(wnd->getArgs());
+ else
+ if (head->fh.eval(wnd->getArgs()) < 0)
+ sz.cy = szWnd.cy - head->fy.eval(wnd->getArgs()) + head->fh.eval(wnd->getArgs());
+
+ if (head->fw.eval(wnd->getArgs()) > 0)
+ sz.cx = head->fw.eval(wnd->getArgs());
+ else
+ if (head->fw.eval(wnd->getArgs()) < 0)
+ sz.cx = szWnd.cx - head->fx.eval(wnd->getArgs()) + head->fw.eval(wnd->getArgs());
+*/
+ if (head->proportional && sz.cx && sz.cy && (((head->fw.eval(wnd->getArgs()) > 0) && !head->fh.eval(wnd->getArgs())) || (!head->fw.eval(wnd->getArgs()) && (head->fh.eval(wnd->getArgs()) > 0))))
+ {
+ if (head->fw.eval(wnd->getArgs()))
+ {
+ sz.cy = sz.cy * head->fw.eval(wnd->getArgs()) / sz.cx;
+ sz.cx = head->fw.eval(wnd->getArgs());
+ } else
+ {
+ sz.cx = sz.cx * head->fh.eval(wnd->getArgs()) / sz.cy;
+ sz.cy = head->fh.eval(wnd->getArgs());
+ }
+ } else
+ {
+ if (head->fh.eval(wnd->getArgs()) > 0)
+ sz.cy = head->fh.eval(wnd->getArgs());
+ else
+ if (head->fh.eval(wnd->getArgs()) < 0)
+ sz.cy = szWnd.cy - head->fy.eval(wnd->getArgs()) + head->fh.eval(wnd->getArgs()) + 1;
+ if (head->fw.eval(wnd->getArgs()) > 0)
+ sz.cx = head->fw.eval(wnd->getArgs());
+ else
+ if (head->fw.eval(wnd->getArgs()) < 0)
+ sz.cx = szWnd.cx - head->fx.eval(wnd->getArgs()) + head->fw.eval(wnd->getArgs()) + 1;
+ }
+
+ bool vars;
+ pos.cx = ((head->fx.eval(wnd->getArgs(), &vars) < 0) && !vars) ? szWnd.cx + head->fx.eval(wnd->getArgs()) : head->fx.eval(wnd->getArgs());
+ pos.cy = ((head->fy.eval(wnd->getArgs(), &vars) < 0) && !vars) ? szWnd.cy + head->fy.eval(wnd->getArgs()) : head->fy.eval(wnd->getArgs());
+
+ if (head->type & ST_MONO)
+ {
+ COLORREF back = wnd->getBackColor();
+ if (head->type & ST_BLEND)
+ {
+ bmp->BlendColorized(head->myBmp, pos.cx, pos.cy, sz.cx, sz.cy, back);
+ } else
+ {
+ bmp->DrawColorized(head->myBmp, pos.cx, pos.cy, sz.cx, sz.cy, back);
+ }
+ } else
+ {
+ if (head->type & ST_BLEND)
+ {
+ bmp->Blend(head->myBmp, pos.cx, pos.cy, sz.cx ,sz.cy);
+ } else
+ {
+ bmp->Draw(head->myBmp, pos.cx, pos.cy, sz.cx ,sz.cy);
+ }
+ }
+ break;
+
+ case ST_AVATAR:
+ {
+ if (!wnd->getAvatar()) break;
+
+ sz.cx = wnd->getAvatar()->getWidth();
+ sz.cy = wnd->getAvatar()->getHeight();
+
+ if (head->proportional && sz.cx && sz.cy && (((head->fw.eval(wnd->getArgs()) > 0) && !head->fh.eval(wnd->getArgs())) || (!head->fw.eval(wnd->getArgs()) && (head->fh.eval(wnd->getArgs()) > 0))))
+ {
+ if (head->fw.eval(wnd->getArgs()))
+ {
+ sz.cy = sz.cy * head->fw.eval(wnd->getArgs()) / sz.cx;
+ sz.cx = head->fw.eval(wnd->getArgs());
+ } else
+ {
+ sz.cx = sz.cx * head->fh.eval(wnd->getArgs()) / sz.cy;
+ sz.cy = head->fh.eval(wnd->getArgs());
+ }
+ } else
+ {
+ if (head->fh.eval(wnd->getArgs()) > 0)
+ sz.cy = head->fh.eval(wnd->getArgs());
+ else
+ if (head->fh.eval(wnd->getArgs()) < 0)
+ sz.cy = szWnd.cy - head->fy.eval(wnd->getArgs()) + head->fh.eval(wnd->getArgs());
+
+ if (head->fw.eval(wnd->getArgs()) > 0)
+ sz.cx = head->fw.eval(wnd->getArgs());
+ else
+ if (head->fw.eval(wnd->getArgs()) < 0)
+ sz.cx = szWnd.cx - head->fx.eval(wnd->getArgs()) + head->fw.eval(wnd->getArgs());
+ }
+
+ pos.cx = head->fx.eval(wnd->getArgs()) < 0 ? szWnd.cx + head->fx.eval(wnd->getArgs()) - sz.cx : head->fx.eval(wnd->getArgs());
+ pos.cy = head->fy.eval(wnd->getArgs()) < 0 ? szWnd.cy + head->fy.eval(wnd->getArgs()) - sz.cy : head->fy.eval(wnd->getArgs());
+
+ wnd->getAvatar()->draw(bmp, pos.cx, pos.cy, sz.cx, sz.cy, options);
+ break;
+ }
+
+ case ST_CLOCK:
+ {
+ if (!options->DisplayTime)
+ break;
+
+ COLORREF back = wnd->getBackColor();
+ int x = head->fx.eval(wnd->getArgs());
+ int y = head->fy.eval(wnd->getArgs());
+ if (head->myBmp)
+ {
+ int sy = head->myBmp->getHeight();
+ if (head->type & ST_MONO)
+ bmp->BlendPartColorized(head->myBmp, head->clockstart[CLOCK_LEFT], 0, head->clocksize[CLOCK_LEFT], sy, x, y, head->clocksize[CLOCK_LEFT], sy, back);
+ else
+ bmp->BlendPart(head->myBmp, head->clockstart[CLOCK_LEFT], 0, head->clocksize[CLOCK_LEFT], sy, x, y, head->clocksize[CLOCK_LEFT], sy);
+ x += head->clocksize[CLOCK_LEFT];
+ for (char *p = wnd->getTime(); *p; p++)
+ {
+ int clock_idx = -1;
+ if (*p == ':')
+ {
+ clock_idx = CLOCK_SEPARATOR;
+ } else
+ if ((*p >= '0') && (*p <= '9'))
+ {
+ clock_idx = CLOCK_DIGITS + *p - '0';
+ }
+
+ if (clock_idx >= 0)
+ {
+ if (head->type & ST_MONO)
+ bmp->BlendPartColorized(head->myBmp, head->clockstart[clock_idx], 0, head->clocksize[clock_idx], sy, x, y, head->clocksize[clock_idx], sy, back);
+ else
+ bmp->BlendPart(head->myBmp, head->clockstart[clock_idx], 0, head->clocksize[clock_idx], sy, x, y, head->clocksize[clock_idx], sy);
+ x += head->clocksize[clock_idx];
+ }
+ }
+ if (head->type & ST_MONO)
+ bmp->BlendPartColorized(head->myBmp, head->clockstart[CLOCK_RIGHT], 0, head->clocksize[CLOCK_RIGHT], sy, x, y, head->clocksize[CLOCK_RIGHT], sy, back);
+ else
+ bmp->BlendPart(head->myBmp, head->clockstart[CLOCK_RIGHT], 0, head->clocksize[CLOCK_RIGHT], sy, x, y, head->clocksize[CLOCK_RIGHT], sy);
+ x += head->clocksize[CLOCK_RIGHT];
+ } else
+ {
+ SetTextColor(hdc, wnd->getClockColor());
+ HFONT hfnSave = (HFONT)SelectObject(bmp->getDC(), fonts.clock);
+ SIZE sz; GetTextExtentPoint32A(bmp->getDC(), wnd->getTime(), lstrlenA(wnd->getTime()), &sz);
+ bmp->Draw_TextA(wnd->getTime(), x, y);
+ SelectObject(bmp->getDC(), hfnSave);
+ }
+ break;
+ }
+ }
+ head = head->next;
+ }
+
+}
+
+bool PopupSkin::onMouseMove(PopupWnd2 *wnd, int x, int y) const
+{
+ POINT pt;
+ pt.x = x;
+ pt.y = y;
+
+ bool res = false;
+ bool hovered = false;
+
+ for (int i = 0; i < wnd->getActionCount(); ++i)
+ {
+ bool hover = PtInRect(&wnd->getActions()[i].rc, pt) ? true : false;
+ hovered |= hover;
+ if (wnd->getActions()[i].hover != hover)
+ {
+ wnd->getActions()[i].hover = hover;
+ res = true;
+ }
+ }
+
+ SetCursor(LoadCursor(NULL, hovered ? IDC_HAND : IDC_ARROW));
+
+ return res;
+}
+
+bool PopupSkin::onMouseLeave(PopupWnd2 *wnd) const
+{
+ bool res = false;
+
+ for (int i = 0; i < wnd->getActionCount(); ++i)
+ {
+ if (wnd->getActions()[i].hover)
+ {
+ wnd->getActions()[i].hover = false;
+ res = true;
+ }
+ }
+
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
+
+ return res;
+}
+
+void PopupSkin::loadOptions(std::istream &f)
+{
+ char *buf = new char[1024];
+ while (!f.eof())
+ {
+ f >> buf;
+ if (*buf == '#')
+ {
+ f.ignore(1024, '\n');
+ continue;
+ }
+ if (!strcmp(buf, "option"))
+ {
+ int id, val;
+ f >> id >> val;
+ f.getline(buf, 1024);
+ id--;
+ if (m_flag_names[id])
+ mir_free(m_flag_names[id]);
+ char *p = buf;
+ while (isspace(*p))
+ p++;
+ char *q = p + lstrlenA(p) - 1;
+ while ((q >= p) && isspace(*q))
+ *q-- = 0;
+ m_flag_names[id] = mir_strdup(p);
+ if (val)
+ m_flags |= 1 << id;
+ else
+ m_flags &= ~(1 << id);
+ } else
+ if (!strcmp(buf, "end"))
+ {
+ break;
+ }
+ }
+ delete [] buf;
+}
+
+bool PopupSkin::load(LPCTSTR dir)
+{
+ for (int i = 0; i < 32; i++)
+ {
+ if (m_flag_names[i])
+ {
+ mir_free(m_flag_names[i]);
+ m_flag_names[i] = NULL;
+ }
+ }
+ m_flags = 0;
+
+ if (!_tcsncmp(_T("res:"), dir, 4))
+ { // resource
+ loadSkin(dir+4, _T("Skin"));
+ } else
+ { // filesystem
+ // skin info
+ TCHAR dir_save[1024];
+ GetCurrentDirectory(1024, dir_save);
+ SetCurrentDirectory(dir);
+
+ std::ifstream theFile;
+ theFile.open("popupskin.config", std::ios::in);
+ if (theFile)
+ {
+ loadOptions(theFile);
+ theFile.close();
+ }
+
+ WIN32_FIND_DATA ffd;
+ HANDLE hFind = FindFirstFile(_T("*.popupskin"), &ffd);
+ while (hFind != INVALID_HANDLE_VALUE)
+ {
+ loadSkin(ffd.cFileName);
+ break;
+ if (!FindNextFile(hFind, &ffd))
+ break;
+ }
+ FindClose(hFind);
+
+ SetCurrentDirectory(dir_save);
+ }
+
+ loadOpts();
+
+ return true;
+}
+
+void PopupSkin::loadSkin(std::istream &f)
+{
+ m_bottom_gap = m_right_gap = 0;
+ m_legacy_region_opacity = 64;
+ m_shadow_region_opacity = 1;
+ m_popup_version = 0;
+ m_internalClock = true;
+
+ SKINELEMENT *head = new SKINELEMENT;
+ m_elements = head;
+ head->type = ST_NOTHING;
+ head->next = NULL;
+
+ while (!f.eof())
+ {
+ char buf[1024];
+ f >> buf;
+// fscanf(f, "%s", buf);
+
+ if (!*buf)
+ continue;
+
+ if (*buf == '#' || *buf == ';')
+ {
+ f.ignore(1024, '\n');
+ continue;
+ }
+
+ if (!lstrcmpA(buf,"popup-version"))
+ {
+ f >> m_popup_version;
+ m_popup_version = PLUGIN_MAKE_VERSION((m_popup_version/1000000)%100, (m_popup_version/10000)%100, (m_popup_version/100)%100, (m_popup_version/1)%100);
+ if (!isCompatible())
+ break;
+ } else
+ if (!lstrcmpA(buf,"padding-right"))
+ {
+ f >> m_right_gap;
+ } else
+ if (!lstrcmpA(buf,"padding-bottom"))
+ {
+ f >> m_bottom_gap;
+ } else
+ if (!lstrcmpA(buf,"shadow-region-opacity"))
+ {
+ f >> m_shadow_region_opacity;
+ } else
+ if (!lstrcmpA(buf,"legacy-region-opacity"))
+ {
+ f >> m_legacy_region_opacity;
+ } else
+ if (!lstrcmpA(buf,"w"))
+ {
+ f.getline(buf, 1024);
+ m_fw.set(buf);
+ } else
+ if (!lstrcmpA(buf,"h"))
+ {
+ f.getline(buf, 1024);
+ m_fh.set(buf);
+ } else
+ if (!lstrcmpA(buf,"object"))
+ {
+ head->next = loadObject(f);
+ if (head->next && ((head->next->type & ST_TYPEMASK) == ST_CLOCK))
+ m_internalClock = false;
+ head = head->next;
+ head->next = NULL;
+ } else
+ if (!lstrcmpA(buf,"options"))
+ {
+ loadOptions(f);
+ }
+ }
+
+
+ head = m_elements;
+ m_elements = m_elements->next;
+ delete head;
+}
+
+void PopupSkin::loadSkin(LPCTSTR fn)
+{
+ if(!fn) return;
+#if defined (_UNICODE) && _MSC_VER <= 1200
+ char* temp= mir_t2a(fn);
+ std::ifstream theFile;
+ theFile.open(temp, std::ios::in);
+ mir_free(temp);
+#else
+ std::ifstream theFile;
+ theFile.open(fn, std::ios::in);
+#endif
+ if (!theFile) return;
+ loadSkin(theFile);
+ theFile.close();
+}
+
+void PopupSkin::loadSkin(LPCTSTR lpName, LPCTSTR lpType)
+{
+ HRSRC hRes = FindResource(hInst, lpName, lpType);
+// DWORD ResSize = SizeofResource(hInst,hRes);
+ HRSRC hResLoad = (HRSRC)LoadResource(hInst, hRes);
+ char *lpResLock = (char *)LockResource(hResLoad);
+// lpResLock [ResSize] = 0;
+ std::istringstream stream(lpResLock);
+ loadSkin(stream);
+ UnlockResource(lpResLock);
+ FreeResource(hRes);
+}
+
+PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::istream &f)
+{
+// char pth[1024];
+// GetSkinPath(pth,1024);
+
+ SKINELEMENT *element = new SKINELEMENT;
+// element->x = element->y = element->w = element->h = 0;
+ element->proportional = 0;
+ element->type = ST_NOTHING|ST_BADPOS;
+ element->next = NULL;
+ element->flag_mask = 0;
+ element->flags = 0;
+ element->myBmp = NULL;
+
+ while (!f.eof())
+ {
+ char buf[1024];
+ f >> buf;
+
+ if (!*buf)
+ continue;
+
+ if (*buf == '#' || *buf == ';')
+ {
+ f.ignore(1024, '\n');
+ continue;
+ }
+
+ if (!lstrcmpA(buf,"type"))
+ {
+ f >> buf;
+ if (!lstrcmpA(buf,"icon"))
+ element->type = ( element->type & ~ST_TYPEMASK ) | ST_ICON;
+ else
+ if (!lstrcmpA(buf,"bitmap"))
+ element->type = ( element->type & ~ST_TYPEMASK ) | ST_MYBITMAP;
+ else
+ if (!lstrcmpA(buf,"text"))
+ {
+ element->type = ( element->type & ~ST_TYPEMASK ) | ST_TEXT;
+ element->textColor = (COLORREF)0xffffffff;
+ element->hfn = 0;
+ }
+ else
+ if (!lstrcmpA(buf,"title"))
+ {
+ element->type = ( element->type & ~ST_TYPEMASK ) | ST_TITLE;
+ element->textColor = (COLORREF)0xffffffff;
+ element->hfn = 0;
+ } else
+ if (!lstrcmpA(buf,"avatar"))
+ {
+ element->type = ( element->type & ~ST_TYPEMASK ) | ST_AVATAR;
+ } else
+ if (!lstrcmpA(buf,"clock"))
+ {
+ element->type = ( element->type & ~ST_TYPEMASK ) | ST_CLOCK;
+ }
+ } else
+ if (!lstrcmpA(buf,"source"))
+ {
+ f >> buf;
+// fscanf(f, "%*[\x01-\x20]%[^\n]", buf);
+// if ( (element->type & ST_TYPEMASK ) == ST_BITMAP)
+// element->hbm = LoadImageFromFile(buf);
+// else
+ if (((element->type & ST_TYPEMASK) == ST_MYBITMAP) || ((element->type & ST_TYPEMASK) == ST_CLOCK))
+ {
+ char *alpha = mir_strdup(buf);
+ alpha[strlen(alpha)-1] = 'a';
+ element->myBmp = new MyBitmap(buf,alpha);
+ mir_free(alpha);
+ }
+ } else
+ if (!lstrcmpA(buf,"mono"))
+ {
+ element->type |= ST_MONO;
+ } else
+ if (!lstrcmpA(buf,"layer"))
+ {
+ element->type |= ST_BLEND;
+ } else
+ if (!lstrcmpA(buf,"proportional"))
+ {
+ f >> element->proportional;
+ } else
+ if (!lstrcmpA(buf,"x"))
+ {
+ f.getline(buf, 1024);
+ element->fx.set(buf);
+ element->type &= ~ST_BADPOS;
+ } else
+ if (!lstrcmpA(buf,"y"))
+ {
+ f.getline(buf, 1024);
+ element->fy.set(buf);
+ element->type &= ~ST_BADPOS;
+ } else
+ if (!lstrcmpA(buf,"w"))
+ {
+ f.getline(buf, 1024);
+ element->fw.set(buf);
+ } else
+ if (!lstrcmpA(buf,"h"))
+ {
+ f.getline(buf, 1024);
+ element->fh.set(buf);
+ } else
+ if (!lstrcmpA(buf,"ifset"))
+ {
+ int id;
+ f >> id; id--;
+ element->flag_mask |= 1 << id;
+ element->flags |= 1 << id;
+ } else
+ if (!lstrcmpA(buf,"ifnotset"))
+ {
+ int id;
+ f >> id; id--;
+ element->flag_mask |= 1 << id;
+ element->flags &= ~(1 << id);
+ } else
+ if (!lstrcmpA(buf,"color"))
+ {
+ if (((element->type & ST_TYPEMASK) != ST_TEXT) &&
+ ((element->type & ST_TYPEMASK) != ST_TITLE)) continue;
+
+ int r,g,b;
+ f >> r >> g >> b;
+ element->textColor = RGB(r,g,b);
+ } else
+ if (!lstrcmpA(buf,"clocksize"))
+ {
+ element->clockstart[0]=0;
+ f >> element->clocksize[0];
+ for (int i = 1; i < CLOCK_ITEMS; i++)
+ {
+ element->clockstart[i]=element->clockstart[i-1]+element->clocksize[i-1];
+ f >> element->clocksize[i];
+ }
+ } else
+ if (!lstrcmpA(buf,"end"))
+ {
+ break;
+ }
+ }
+ return element;
+}
+
+void PopupSkin::freeSkin(SKINELEMENT *head)
+{
+ while (head)
+ {
+ SKINELEMENT *next = head->next;
+
+ if ((head->type & ST_TYPEMASK) == ST_BITMAP)
+ DeleteObject(head->hbm);
+ if ((head->type & ST_TYPEMASK) == ST_MYBITMAP)
+ delete head->myBmp;
+ if (((head->type & ST_TYPEMASK) == ST_CLOCK) && head->myBmp)
+ delete head->myBmp;
+
+ delete head;
+ head = next;
+ }
+}
+
+void PopupSkin::saveOpts() const
+{
+ char buf[128];
+#if defined( _UNICODE )
+ mir_snprintf(buf, sizeof(buf), "skin.%.120S", m_name);
+#else
+ mir_snprintf(buf, sizeof(buf), "skin.%.120s", m_name);
+#endif
+ DBWriteContactSettingDword(NULL, MODULNAME, buf, m_flags);
+}
+
+void PopupSkin::loadOpts() const
+{
+ char buf[128];
+#if defined( _UNICODE )
+ mir_snprintf(buf, sizeof(buf), "skin.%.120S", m_name);
+#else
+ mir_snprintf(buf, sizeof(buf), "skin.%.120s", m_name);
+#endif
+ m_flags = DBGetContactSettingDword(NULL, MODULNAME, buf, m_flags);
+}
+
+// Skins
+Skins skins;
+
+Skins::Skins()
+{
+ m_skins = 0;
+}
+
+Skins::~Skins()
+{
+ while (m_skins)
+ {
+ SKINLIST *next = m_skins->next;
+ delete m_skins->skin;
+ delete [] m_skins->dir;
+ mir_free(m_skins->name); // this is allocated with mir_strdup()
+ delete m_skins;
+ m_skins = next;
+ }
+}
+
+bool Skins::load(LPCTSTR dir1)
+{
+ while (m_skins)
+ {
+ SKINLIST *next = m_skins->next;
+ mir_free(m_skins->name);
+ delete [] m_skins->dir;
+ delete m_skins->skin;
+ delete m_skins;
+ m_skins = next;
+ }
+
+ SKINLIST *skin = new SKINLIST;
+ skin->next = m_skins;
+ m_skins = skin;
+ m_skins->name = mir_tstrdup(_T("* Popup Classic"));
+ m_skins->dir = new TCHAR[1024];
+ lstrcpy(m_skins->dir, _T("res:classic.popupskin"));
+ m_skins->skin = 0;
+
+ TCHAR dir[1024]={'\0'};
+
+ if (ServiceExists(MS_FOLDERS_GET_PATH)) {
+ if (FoldersGetCustomPathT(folderId, dir, 1024, NULL) != 0)
+ return false;
+ }
+ else {
+ GetModuleFileName(hInst,dir,1024);
+ dir[lstrlen(dir)-18] = 0;
+ lstrcat(dir,_T("\\skins\\popup"));
+ DWORD fa = GetFileAttributes(dir);
+ if ((fa==INVALID_FILE_ATTRIBUTES) || !(fa&FILE_ATTRIBUTE_DIRECTORY))
+ return false;
+ }
+
+ TCHAR dir_save[1024];
+ GetCurrentDirectory(1024, dir_save);
+ SetCurrentDirectory(dir);
+
+ WIN32_FIND_DATA ffd;
+ HANDLE hFind = FindFirstFile(_T("*.*"), &ffd);
+ while (hFind != INVALID_HANDLE_VALUE)
+ {
+ if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && lstrcmp(_T("."), ffd.cFileName) && lstrcmp(_T(".."), ffd.cFileName))
+ {
+ SetCurrentDirectory(ffd.cFileName);
+
+ SKINLIST *skin = new SKINLIST;
+ skin->next = m_skins;
+ m_skins = skin;
+ m_skins->name = mir_tstrdup(ffd.cFileName);
+ m_skins->dir = new TCHAR[1024];
+ GetCurrentDirectory(1024, m_skins->dir);
+ m_skins->skin = 0;
+
+ SetCurrentDirectory(_T(".."));
+ }
+
+ if (!FindNextFile(hFind, &ffd))
+ break;
+ }
+ FindClose(hFind);
+
+ SetCurrentDirectory(dir_save);
+
+ return true;
+}
+
+const PopupSkin *Skins::getSkin(LPCTSTR name)
+{
+ SKINLIST *any = 0;
+ for (SKINLIST *p = m_skins; p; p = p->next)
+ {
+ if (!lstrcmp(p->name, _T("* Popup Classic")) || !any)
+ any = p;
+ if (!lstrcmpi(p->name, name))
+ {
+ any = p;
+ break;
+ }
+ }
+
+ if (any && any->skin)
+ return any->skin;
+ if (!any)
+ return 0;
+
+ any->skin = new PopupSkin(any->name);
+ any->skin->load(any->dir);
+
+ if (!any->skin->isCompatible())
+ MessageBox(NULL,
+ TranslateTS(
+ _T("The skin you are trying to load is designed\r\n")
+ _T("for newer version of Popup Plus. And will not\r\n")
+ _T("display properly.\r\n")
+ _T("\r\n")
+ _T("Please choose another skin.") ),
+ _T(MODULNAME_LONG), MB_ICONSTOP|MB_OK);
+
+ return any->skin;
+}
+
+void Skins::loadActiveSkin()
+{
+ for (SKINLIST *p = m_skins; p; p = p->next)
+ if (!lstrcmpi(p->name, PopUpOptions.SkinPack))
+ {
+ if (p->skin)
+ break;
+
+ p->skin = new PopupSkin(p->name);
+ p->skin->load(p->dir);
+ break;
+ }
+}
+
+void Skins::freeAllButActive()
+{
+ for (SKINLIST *p = m_skins; p; p = p->next)
+ if (lstrcmpi(p->name, PopUpOptions.SkinPack))
+ {
+ delete p->skin;
+ p->skin = NULL;
+ }
+}
diff --git a/plugins/Popup/src/skin.h b/plugins/Popup/src/skin.h new file mode 100644 index 0000000000..8cc7171e01 --- /dev/null +++ b/plugins/Popup/src/skin.h @@ -0,0 +1,203 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/skin.h $
+Revision : $Revision: 1620 $
+Last change on : $Date: 2010-06-23 21:31:05 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __skin_h__
+#define __skin_h__
+
+#include <stdio.h>
+#include <fstream>
+
+class MyBitmap;
+class PopupWnd2;
+
+class PopupSkin
+{
+public:
+ enum
+ {
+ ST_TYPEMASK = 0x07,
+ ST_NOTHING = 0x00,
+ ST_ICON = 0x01,
+ ST_TEXT = 0x02,
+ ST_TITLE = 0x03,
+ ST_BITMAP = 0x04,
+ ST_MYBITMAP = 0x05,
+ ST_AVATAR = 0x06,
+ ST_CLOCK = 0x07,
+
+ ST_STRETCH = 0x08,
+ ST_MONO = 0x10,
+ ST_BLEND = 0x20,
+ ST_BADPOS = 0x40
+ };
+
+ enum
+ {
+ DF_STATIC = 0x01,
+ DF_ANIMATE = 0x02,
+ DF_ALL = 0xff
+ };
+
+ enum
+ {
+ // left, separator, digits, am/pm, right
+ CLOCK_LEFT = 0,
+ CLOCK_SEPARATOR = 1,
+ CLOCK_DIGITS = 2,
+ CLOCK_AM = 12,
+ CLOCK_PM = 13,
+ CLOCK_RIGHT = 14,
+ CLOCK_ITEMS = 1+1+10+2+1
+ };
+
+ struct SKINELEMENT
+ {
+ int type;
+ union
+ {
+ HICON hic;
+ HBITMAP hbm;
+ MyBitmap *myBmp;
+ struct
+ {
+ COLORREF textColor;
+ HFONT hfn;
+// int textw;
+ };
+ };
+ unsigned long flags;
+ unsigned long flag_mask;
+ Formula fx, fy, fw, fh;
+ int clocksize[CLOCK_ITEMS];
+ int clockstart[CLOCK_ITEMS];
+ int proportional;
+ SKINELEMENT *next;
+ };
+
+ struct RenderInfo
+ {
+ bool hasAvatar;
+ int titlew, textw;
+ int realtextw, texth;
+ int actw;
+ RECT textRect;
+ };
+
+private:
+ LPTSTR m_name;
+ int m_bottom_gap, m_right_gap;
+ int m_legacy_region_opacity, m_shadow_region_opacity;
+ int m_popup_version;
+ bool m_internalClock;
+ Formula m_fw, m_fh;
+ SKINELEMENT *m_elements;
+ char *m_flag_names[32];
+ mutable unsigned long m_flags;
+
+ void loadOptions(std::istream &f);
+ SKINELEMENT *loadObject(std::istream &f);
+ void loadSkin(std::istream &f);
+ void loadSkin(LPCTSTR fn);
+ void loadSkin(LPCTSTR lpName, LPCTSTR lpType);
+
+ void freeSkin(SKINELEMENT *head);
+
+ SIZE measureAction(HDC hdc, POPUPACTION *act) const;
+ SIZE measureActionBar(HDC hdc, PopupWnd2 *wnd) const;
+ void drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool hover) const;
+ void drawActionBar(MyBitmap *bmp, PopupWnd2 *wnd, int x, int y) const;
+
+public:
+ PopupSkin(LPCTSTR aName = 0);
+ ~PopupSkin();
+
+ void measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options) const;
+ void display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options, DWORD drawFlags=DF_ALL) const;
+ bool onMouseMove(PopupWnd2 *wnd, int x, int y) const;
+ bool onMouseLeave(PopupWnd2 *wnd) const;
+
+ bool load(LPCTSTR dir); // load skin from current directory
+
+ SKINELEMENT *getSubSkin() { return m_elements; }
+ int getBottomGap() const { return m_bottom_gap; }
+ int getRightGap() const { return m_right_gap; }
+ int useInternalClock() const { return m_internalClock; }
+ int getLegacyRegionOpacity() const { return m_legacy_region_opacity; }
+ int getShadowRegionOpacity() const { return m_shadow_region_opacity; }
+ bool isCompatible() const { return (DWORD) m_popup_version <= (DWORD) pluginInfoEx.version; }
+
+ const LPTSTR getName() const { return m_name; }
+
+ const char *getFlagName(int id) const { return m_flag_names[id-1]; }
+ bool getFlag(int id) const { return (m_flags & (1 << (id-1))) != 0; }
+ void setFlag(int id, bool val) const
+ {
+ if (val)
+ m_flags |= 1 << (id-1);
+ else
+ m_flags &= ~(1 << (id-1));
+ }
+
+ void saveOpts() const;
+ void loadOpts() const;
+};
+
+class Skins
+{
+public:
+ struct SKINLIST
+ {
+ PopupSkin *skin;
+ LPTSTR dir;
+ LPTSTR name;
+ SKINLIST *next;
+ };
+
+private:
+ SKINLIST *m_skins;
+
+public:
+ Skins();
+ ~Skins();
+
+ bool load(LPCTSTR dir);
+ const PopupSkin *getSkin(LPCTSTR name);
+
+ const SKINLIST *getSkinList() const { return m_skins; }
+
+ void loadActiveSkin();
+ void freeAllButActive();
+};
+
+extern Skins skins;
+
+#endif
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp new file mode 100644 index 0000000000..398d500e81 --- /dev/null +++ b/plugins/Popup/src/srmm_menu.cpp @@ -0,0 +1,171 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/srmm_menu.cpp $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#include "headers.h"
+
+/*************************************************************************************
+ === how does this work ===
+ We have four icons -- one for each mode. and we do hide/show them depending
+ on current active mode for user.
+*************************************************************************************/
+
+static HANDLE hDialogsList = NULL;
+static HANDLE hIconPressed=0,hWindowEvent=0;
+
+static int SrmmMenu_ProcessEvent(WPARAM wParam, LPARAM lParam);
+static int SrmmMenu_ProcessIconClick(WPARAM wParam, LPARAM lParam);
+
+
+void SrmmMenu_Load()
+{
+ if (ServiceExists(MS_MSG_ADDICON))
+ {
+ StatusIconData sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.szModule = MODULNAME;
+ sid.flags = 0;
+
+ sid.dwId = 0;
+ sid.szTooltip = Translate("Popup Mode: Auto");
+ sid.hIcon = sid.hIconDisabled = IcoLib_GetIcon(ICO_POPUP_ON,0);
+ CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
+
+ sid.dwId = 1;
+ sid.szTooltip = Translate("Popup Mode: Favourite");
+ sid.hIcon = sid.hIconDisabled = IcoLib_GetIcon(ICO_FAV,0);
+ CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
+
+ sid.dwId = 2;
+ sid.szTooltip = Translate("Popup Mode: Ignore fullscreen");
+ sid.hIcon = sid.hIconDisabled = IcoLib_GetIcon(ICO_FULLSCREEN,0);
+ CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
+
+ sid.dwId = 3;
+ sid.szTooltip = Translate("Popup Mode: Block contact");
+ sid.hIcon = sid.hIconDisabled = IcoLib_GetIcon(ICO_POPUP_OFF,0);
+ CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
+
+ hIconPressed = HookEvent(ME_MSG_ICONPRESSED, SrmmMenu_ProcessIconClick);
+ hWindowEvent = HookEvent(ME_MSG_WINDOWEVENT, SrmmMenu_ProcessEvent);
+/*
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ SrmmMenu_UpdateIcon(hContact);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+*/
+ }
+}
+
+void SrmmMenu_Unload()
+{
+ UnhookEvent(hIconPressed);
+ UnhookEvent(hWindowEvent);
+}
+
+static void SrmmMenu_UpdateIcon(HANDLE hContact)
+{
+ if (!hContact) return;
+
+ int mode = DBGetContactSettingByte(hContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO);
+
+ StatusIconData sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.szModule = MODULNAME;
+
+ for (int i = 0; i < 4; ++i)
+ {
+ sid.dwId = i;
+ sid.flags = (i == mode) ? 0 : MBF_HIDDEN;
+ CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ }
+}
+
+static int SrmmMenu_ProcessEvent(WPARAM wParam, LPARAM lParam)
+{
+ MessageWindowEventData *event = (MessageWindowEventData *)lParam;
+
+ if ( event->uType == MSG_WINDOW_EVT_OPEN )
+ {
+ if (!hDialogsList)
+ hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+
+ WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
+ SrmmMenu_UpdateIcon(event->hContact);
+ }
+ else if ( event->uType == MSG_WINDOW_EVT_CLOSING )
+ {
+ if (hDialogsList)
+ WindowList_Remove(hDialogsList, event->hwndWindow);
+ }
+
+ return 0;
+}
+
+static int SrmmMenu_ProcessIconClick(WPARAM wParam, LPARAM lParam)
+{
+ StatusIconClickData *sicd = (StatusIconClickData *)lParam;
+ if (lstrcmpA(sicd->szModule, MODULNAME)) return 0;
+
+ HANDLE hContact = (HANDLE)wParam;
+ if (!hContact) return 0;
+
+ int mode = DBGetContactSettingByte(hContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO);
+
+ if (sicd->flags&MBCF_RIGHTBUTTON)
+ {
+ HMENU hMenu = CreatePopupMenu();
+
+ AppendMenu(hMenu, MF_STRING, 1+PU_SHOWMODE_AUTO, TranslateT("Auto"));
+ AppendMenu(hMenu, MF_STRING, 1+PU_SHOWMODE_FAVORITE, TranslateT("Favourite"));
+ AppendMenu(hMenu, MF_STRING, 1+PU_SHOWMODE_FULLSCREEN, TranslateT("Ignore fullscreen"));
+ AppendMenu(hMenu, MF_STRING, 1+PU_SHOWMODE_BLOCK, TranslateT("Block"));
+
+ CheckMenuItem(hMenu, 1+mode, MF_BYCOMMAND|MF_CHECKED);
+
+ mode = TrackPopupMenu(hMenu, TPM_RETURNCMD, sicd->clickLocation.x, sicd->clickLocation.y, 0, WindowList_Find(hDialogsList, hContact), NULL);
+
+ if (mode)
+ {
+ DBWriteContactSettingByte(hContact, MODULNAME, "ShowMode", mode-1);
+ SrmmMenu_UpdateIcon(hContact);
+ }
+ } else
+ {
+ DBWriteContactSettingByte(hContact, MODULNAME, "ShowMode",
+ (mode == PU_SHOWMODE_AUTO) ? PU_SHOWMODE_BLOCK : PU_SHOWMODE_AUTO);
+ SrmmMenu_UpdateIcon(hContact);
+ }
+
+ return 0;
+}
diff --git a/plugins/Popup/src/srmm_menu.h b/plugins/Popup/src/srmm_menu.h new file mode 100644 index 0000000000..e9e8ef4966 --- /dev/null +++ b/plugins/Popup/src/srmm_menu.h @@ -0,0 +1,39 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/src/srmm_menu.h $
+Revision : $Revision: 1610 $
+Last change on : $Date: 2010-06-23 00:55:13 +0300 (Ср, 23 июн 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+
+#ifndef __srmm_menu_h__
+#define __srmm_menu_h__
+
+void SrmmMenu_Load();
+void SrmmMenu_Unload();
+
+#endif // __srmm_menu_h__
diff --git a/plugins/Popup/version.h b/plugins/Popup/version.h new file mode 100644 index 0000000000..7b49620019 --- /dev/null +++ b/plugins/Popup/version.h @@ -0,0 +1,86 @@ +/*
+Popup Plus plugin for Miranda IM
+
+Copyright © 2002 Luca Santarelli,
+ © 2004-2007 Victor Pavlychko
+ © 2010 MPK
+ © 2010 Merlin_de
+
+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.
+
+===============================================================================
+
+File name : $HeadURL: http://svn.miranda.im/mainrepo/popup/trunk/version.h $
+Revision : $Revision: 1650 $
+Last change on : $Date: 2010-07-15 19:03:34 +0300 (Чт, 15 июл 2010) $
+Last change by : $Author: Merlin_de $
+
+===============================================================================
+*/
+ #define PU_COMMONMODUL "PopUp" //common DB modul name for all Popup plugins
+ #define PU_MODULNAME "PopUpPlus" //DB modul for this plugin
+ #define PU_MODULCLASS "PopUpCLASS" //temp DB modul for this plugin
+ #define MODULNAME "PopUp"
+ #define MODULNAME_LONG "Popup Plus" //dont use "PopUp Plus" coz notify register use "Popup Plus"
+ #define MODULNAME_PLU "PopUps"
+ #ifdef _UNICODE
+ #define POPUP_FILENAME "PopUpW.dll"
+ #ifdef _WIN64
+ #define POPUP_DISPLAYNAME "PopUp Plus (Unicode x64)"
+ #define __FLVersionURL "http://addons.miranda-im.org/details.php?action=viewfile&id=4293"
+ #define __FLVersionPrefix "<span class=\"fileNameHeader\">PopUp Plus (Unicode x64) "
+ #define __FLUpdateURL "http://addons.miranda-im.org/feed.php?dlfile=4293" //.zip
+ #define __BetaUpdateURL "http://merlins-miranda.googlecode.com/files/PopUpW_x64.zip"
+ #else
+ #define POPUP_DISPLAYNAME "PopUp Plus (Unicode)"
+ #define __FLVersionURL "http://addons.miranda-im.org/details.php?action=viewfile&id=4292"
+ #define __FLVersionPrefix "<span class=\"fileNameHeader\">PopUp Plus (Unicode) "
+ #define __FLUpdateURL "http://addons.miranda-im.org/feed.php?dlfile=4292" //.zip
+ #define __BetaUpdateURL "http://merlins-miranda.googlecode.com/files/PopUpW_x32.zip"
+ #endif //_WIN64
+ #else
+ #define POPUP_DISPLAYNAME "PopUp Plus (2in1)"
+ #define POPUP_FILENAME "PopUp.dll"
+ #define __FLVersionURL "http://addons.miranda-im.org/details.php?action=viewfile&id=4294"
+ #define __FLVersionPrefix "<span class=\"fileNameHeader\">PopUp Plus (2in1) "
+ #define __FLUpdateURL "http://addons.miranda-im.org/feed.php?dlfile=4294" //.zip
+ #define __BetaUpdateURL "http://merlins-miranda.googlecode.com/files/PopUp_2in1.zip"
+ #endif //_UNICODE
+ #define __BetaVersionURL "http://svn.miranda.im/mainrepo/popup/trunk/docs/Changelog.txt"
+ #define __BetaVersionPrefix "beta: "
+ #define __BetaChangelogURL "http://svn.miranda.im/mainrepo/popup/trunk/docs/Changelog.txt"
+
+ #define __MAJOR_VERSION 2
+ #define __MINOR_VERSION 1
+ #define __RELEASE_NUM 1
+ #define __BUILD_NUM 6
+
+ #define __STRINGIFY(x) #x
+ #define __STRINGIFY2(x) __STRINGIFY(x)
+ #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+ #define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
+
+ #define __VERSION_STRING __STRINGIFY2(__FILEVERSION_STRING)
+ #define __VERSION_STRING_DOT __STRINGIFY2(__FILEVERSION_STRING_DOTS)
+
+ #define POPUP_DESCRIPT "Provides popup notification services for different plugins."
+ #define POPUP_DESCRIPTION POPUP_DESCRIPT " [Built " __DATE__ " " __TIME__ "]"
+ #define POPUP_AUTHOR "MPK, Merlin_de (Luca Santarelli, Victor Pavlychko)"
+ #define POPUP_EMAIL "mp-king@web.de"
+ #define POPUP_COPYRIGHT "©2002 Luca Santarelli, ©2004-2007 Victor Pavlychko, ©2010 MPK, Merlin_de"
+ #define POPUP_WEBPAGE "http://www.miranda-im.org/"
+ #define POPUP_UUID {0x26a9125d, 0x7863, 0x4e01, {0xaf, 0xe, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54}}
+ #define POPUP_PID 0x12a3fdbdecd273ee67dbc4d6d00e9268
+
diff --git a/plugins/Popup/version.rc b/plugins/Popup/version.rc new file mode 100644 index 0000000000..615bdf2182 --- /dev/null +++ b/plugins/Popup/version.rc @@ -0,0 +1,40 @@ +#include <windows.h> // include for version info constants
+#include "version.h"
+
+//
+// TO CHANGE VERSION INFORMATION, EDIT PROJECT OPTIONS...
+//
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+ PRODUCTVERSION __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x21L
+#else
+ FILEFLAGS 0x20L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "Comments", POPUP_DESCRIPT
+ VALUE "CompanyName", "MPK"
+ VALUE "FileDescription", "Popup Plus plugin for Miranda IM"
+ VALUE "FileVersion", __VERSION_STRING_DOT
+ VALUE "InternalName", MODULNAME
+ VALUE "LegalCopyright", POPUP_COPYRIGHT
+ VALUE "OriginalFilename", POPUP_FILENAME
+ VALUE "ProductName", POPUP_DISPLAYNAME
+ VALUE "ProductVersion", __VERSION_STRING_DOT
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
+
|