From 48540940b6c28bb4378abfeb500ec45a625b37b6 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Tue, 15 May 2012 10:38:20 +0000 Subject: initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/QuickReplies/Icons/qicon.ico | Bin 0 -> 2038 bytes plugins/QuickReplies/common.h | 76 ++++ plugins/QuickReplies/events.cpp | 196 +++++++++ plugins/QuickReplies/options.cpp | 213 ++++++++++ plugins/QuickReplies/quickreplies.cpp | 80 ++++ plugins/QuickReplies/quickreplies_10.sln | 25 ++ plugins/QuickReplies/quickreplies_10.vcxproj | 311 ++++++++++++++ .../QuickReplies/quickreplies_10.vcxproj.filters | 49 +++ plugins/QuickReplies/quickreplies_9.vcproj | 464 +++++++++++++++++++++ plugins/QuickReplies/resource.h | 29 ++ plugins/QuickReplies/resources.rc | 129 ++++++ plugins/QuickReplies/version.h | 24 ++ plugins/QuickReplies/version.rc | 113 +++++ 13 files changed, 1709 insertions(+) create mode 100644 plugins/QuickReplies/Icons/qicon.ico create mode 100644 plugins/QuickReplies/common.h create mode 100644 plugins/QuickReplies/events.cpp create mode 100644 plugins/QuickReplies/options.cpp create mode 100644 plugins/QuickReplies/quickreplies.cpp create mode 100644 plugins/QuickReplies/quickreplies_10.sln create mode 100644 plugins/QuickReplies/quickreplies_10.vcxproj create mode 100644 plugins/QuickReplies/quickreplies_10.vcxproj.filters create mode 100644 plugins/QuickReplies/quickreplies_9.vcproj create mode 100644 plugins/QuickReplies/resource.h create mode 100644 plugins/QuickReplies/resources.rc create mode 100644 plugins/QuickReplies/version.h create mode 100644 plugins/QuickReplies/version.rc (limited to 'plugins/QuickReplies') diff --git a/plugins/QuickReplies/Icons/qicon.ico b/plugins/QuickReplies/Icons/qicon.ico new file mode 100644 index 0000000000..23c3765fd9 Binary files /dev/null and b/plugins/QuickReplies/Icons/qicon.ico differ diff --git a/plugins/QuickReplies/common.h b/plugins/QuickReplies/common.h new file mode 100644 index 0000000000..d21be3466f --- /dev/null +++ b/plugins/QuickReplies/common.h @@ -0,0 +1,76 @@ +/* +Copyright (C) 2010 Unsane + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __QUICK_REPLY_H__ +#define __QUICK_REPLY_H__ + +#define MIRANDA_VER 0x0900 +#define MIRANDA_CUSTOM_LP + +#include +#include +#include + +#include "tchar.h" + +#include +#include +#include +#include +#include +#include + +#include "m_msg_buttonsbar.h" +#include "m_variables.h" + +#include "resource.h" +#include "version.h" + +#define MODULE_NAME __INTERNAL_NAME +#define TEXT_LIMIT 2048 +#define IDC_MESSAGE 1002 +#define IDC_CHATMESSAGE 1009 + +#define MS_QUICKREPLIES_SERVICE MODULE_NAME"/Service" + +extern HINSTANCE hInstance; + +extern BYTE iNumber; + +extern HANDLE hOnOptInitialized; +extern HANDLE hOnButtonPressed; +extern HANDLE hQuickRepliesService; +extern HANDLE hOnModulesLoaded; +extern HANDLE hOnPreShutdown; + +#ifdef _UNICODE + typedef std::wstring tString; +#else + typedef std::string tString; +#endif //_UNICODE + +INT_PTR QuickRepliesService(WPARAM wParam, LPARAM lParam); + +INT_PTR OnModulesLoaded(WPARAM wParam, LPARAM lParam); +INT_PTR OnOptInitialized(WPARAM wParam, LPARAM lParam); +INT_PTR OnButtonPressed(WPARAM wParam, LPARAM lParam); +INT_PTR OnPreShutdown(WPARAM wParam, LPARAM lParam); + +#endif //__QUICK_REPLY_H__ \ No newline at end of file diff --git a/plugins/QuickReplies/events.cpp b/plugins/QuickReplies/events.cpp new file mode 100644 index 0000000000..1dfa8c898d --- /dev/null +++ b/plugins/QuickReplies/events.cpp @@ -0,0 +1,196 @@ +/* +Copyright (C) 2010 Unsane + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + +#include "common.h" + +using namespace std; + +BYTE iNumber; + +HANDLE hOnOptInitialized; +HANDLE hOnButtonPressed; +HANDLE hQuickRepliesService; + +INT_PTR QuickRepliesService(WPARAM, LPARAM) +{ + return TRUE; +} + +INT_PTR OnModulesLoaded(WPARAM wParam, LPARAM lParam) +{ + UnhookEvent(hOnModulesLoaded); + HICON hIcon = NULL; + char buttonName[32]; + + if (!ServiceExists(MS_QUICKREPLIES_SERVICE)) + { + iNumber = 0; + hQuickRepliesService = CreateServiceFunction(MS_QUICKREPLIES_SERVICE, QuickRepliesService); + } + else + iNumber = DBGetContactSettingByte(NULL, MODULE_NAME, "InstancesCount", 0); + DBWriteContactSettingByte(NULL, MODULE_NAME, "InstancesCount", iNumber + 1); + + hOnOptInitialized = HookEvent(ME_OPT_INITIALISE, OnOptInitialized); + hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); + + if (ServiceExists(MS_SKIN2_ADDICON)) + { + char buttonNameTranslated[32]; + mir_snprintf(buttonName, SIZEOF(buttonName), "Button %x", iNumber + 1); + mir_snprintf(buttonNameTranslated, SIZEOF(buttonNameTranslated), "%s %x",Translate("Button"), iNumber + 1); + + SKINICONDESC sid = {0}; + sid.cbSize = sizeof(SKINICONDESC); + sid.pszSection = "TabSRMM/Quick Replies"; + sid.cx = sid.cy = 16; + sid.pszDescription = buttonNameTranslated; + sid.pszName = buttonName; + sid.hDefaultIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON)); + + hIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); + } + else + hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON)); + + if (ServiceExists(MS_BB_ADDBUTTON)) + { + mir_snprintf(buttonName, SIZEOF(buttonName), MODULE_NAME" %x", iNumber + 1); + + BBButton bbd = {0}; + bbd.cbSize = sizeof(BBButton); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON; + bbd.pszModuleName = buttonName; + bbd.ptszTooltip = _T("Quick Replies\r\nLeft button - open menu\r\nRight button - options page"); + bbd.hIcon = (HANDLE)hIcon; + bbd.dwButtonID = iNumber; + bbd.dwDefPos = 220; + + CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); + } + + DestroyIcon(hIcon); + + return 0; +} + +INT_PTR OnButtonPressed(WPARAM wParam, LPARAM lParam) +{ + char key[64]; + int index = 0; + int count = 0; + HMENU hMenu = NULL; + char buttonName[32]; + tString replies = _T(""); + vector replyList; + CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam; + + mir_snprintf(buttonName, SIZEOF(buttonName), MODULE_NAME" %x", iNumber + 1); + if (strcmp(cbcd->pszModule, buttonName)) + return 0; + + if (cbcd->dwButtonId != iNumber) + return 1; + + mir_snprintf(key, 64, "RepliesCount_%x", iNumber); + count = DBGetContactSettingWord(NULL, MODULE_NAME, key, 0); + + { + if (count == 0 || cbcd->flags & BBCF_RIGHTBUTTON) + { + mir_snprintf(buttonName, SIZEOF(buttonName), "Button %x", iNumber + 1); + + OPENOPTIONSDIALOG ood = {0}; + ood.cbSize = sizeof(ood); + ood.pszGroup = "Message Sessions"; + ood.pszPage = "Quick Replies"; + ood.pszTab = buttonName; + + CallService(MS_OPT_OPENOPTIONS, NULL, (LPARAM)&ood); + + return 0; + } + + hMenu = CreatePopupMenu(); + + DBVARIANT dbv = {0}; + + for (int i = 0; i < count; i++) + { + mir_snprintf(key, 64, "Reply_%x_%x", iNumber, i); + DBGetContactSettingTString(NULL, MODULE_NAME, key, &dbv); + + if (dbv.ptszVal == NULL) + replyList.push_back(_T("")); + else + replyList.push_back((TCHAR*)variables_parsedup(dbv.ptszVal, 0, (HANDLE)wParam)); + + if (_tcscmp(dbv.ptszVal, _T("---"))) + AppendMenu((HMENU)hMenu, MF_STRING, i + 1, replyList[i].c_str()); + else + AppendMenu((HMENU)hMenu, MF_SEPARATOR, i + 1, NULL); + } + + DBFreeVariant(&dbv); + } + + { + int index = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, NULL); + if (index > 0) + { + if (_tcscmp(replyList.at(index - 1).c_str(), _T(""))) + { + HWND hEdit = GetDlgItem(cbcd->hwndFrom, IDC_MESSAGE); + if (!hEdit) hEdit = GetDlgItem(cbcd->hwndFrom, IDC_CHATMESSAGE); + + SendMessage(hEdit, EM_REPLACESEL, TRUE, (LPARAM)replyList.at(index - 1).c_str()); + + mir_snprintf(key, 64, "ImmediatelySend_%x", iNumber); + if ((BYTE)DBGetContactSettingByte(NULL, MODULE_NAME, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED) + SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0); + } + } + } + + for (std::vector::reverse_iterator item = replyList.rbegin(); item != replyList.rend(); ++item) + ((tString)*item).clear(); + replyList.clear(); + + return 1; +} + +INT_PTR OnPreShutdown(WPARAM wParam, LPARAM lParam) +{ + if (ServiceExists(MS_BB_REMOVEBUTTON)) + { + char buttonName[32]; + mir_snprintf(buttonName, SIZEOF(buttonName), MODULE_NAME" %x", iNumber + 1); + + BBButton bbd = {0}; + bbd.cbSize = sizeof(BBButton); + bbd.pszModuleName = buttonName; + bbd.dwButtonID = iNumber; + + CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd); + } + UnhookEvent(hOnButtonPressed); + UnhookEvent(hOnOptInitialized); + UnhookEvent(hOnPreShutdown); + return 0; +} \ No newline at end of file diff --git a/plugins/QuickReplies/options.cpp b/plugins/QuickReplies/options.cpp new file mode 100644 index 0000000000..36776884ae --- /dev/null +++ b/plugins/QuickReplies/options.cpp @@ -0,0 +1,213 @@ +/* +Copyright (C) 2010 Unsane + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + +#include "common.h" + +static WNDPROC OldMessageEditProc; + +static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) +{ + switch(msg) + { + case WM_CHAR: + { + if (wParam == 1 && GetKeyState(VK_CONTROL) & 0x8000) + { // ctrl-a + SendMessage(hwnd, EM_SETSEL, 0, -1); + return 0; + } + + if (wParam == 26 && GetKeyState(VK_CONTROL) & 0x8000) + { // ctrl-z + SendMessage(hwnd, EM_UNDO, 0, 0); + return 0; + } + + if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) + { // ctrl-backspace + DWORD start, end; + WCHAR text[1024]; + + SendMessage(hwnd, EM_GETSEL, (WPARAM) & end, (LPARAM) (PDWORD) NULL); + SendMessage(hwnd, WM_KEYDOWN, VK_LEFT, 0); + SendMessage(hwnd, EM_GETSEL, (WPARAM) & start, (LPARAM) (PDWORD) NULL); + GetWindowText(hwnd, text, 1024); + MoveMemory(text + start, text + end, sizeof(WCHAR) * (wcslen(text) + 1 - end)); + SetWindowText(hwnd, text); + //SAFE_FREE((void**)&text); + SendMessage(hwnd, EM_SETSEL, start, start); + SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd); + return 0; + } + } + break; + } + + return CallWindowProc(OldMessageEditProc, hwnd, msg, wParam, lParam); +} + +BOOL CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + { + char key[64]; + int count = 0; + DBVARIANT dbv = {0}; + tString replies = _T(""); + + TranslateDialogDefault(hwndDlg); + variables_skin_helpbutton(hwndDlg, IDC_VARIABLES); + + SendDlgItemMessage(hwndDlg, IDC_REPLIES, EM_LIMITTEXT, TEXT_LIMIT, 0); + OldMessageEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_REPLIES), GWLP_WNDPROC, (LONG_PTR)MessageEditSubclassProc); + + mir_snprintf(key, 64, "ImmediatelySend_%x", iNumber); + CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, (BYTE)DBGetContactSettingWord(NULL, MODULE_NAME, key, 1)); + + mir_snprintf(key, 64, "RepliesCount_%x", iNumber); + count = DBGetContactSettingWord(NULL, MODULE_NAME, key, 0); + + for (int i = 0; i < count; i++) + { + mir_snprintf(key, 64, "Reply_%x_%x", iNumber, i); + if (!DBGetContactSettingTString(NULL, MODULE_NAME, key, &dbv)) + if(dbv.ptszVal != NULL) + replies.append(dbv.ptszVal); + if (i < count - 1) + replies.append(_T("\r\n")); + } + SetDlgItemText(hwndDlg, IDC_REPLIES, replies.c_str()); + + DBFreeVariant(&dbv); + + return TRUE; + } + break; + + case WM_COMMAND: + { + if (HIWORD(wParam) == BN_CLICKED) + { + switch(LOWORD(wParam)) + { + case IDC_VARIABLES: + { + variables_showhelp(hwndDlg, IDC_REPLIES, VHF_SIMPLEDLG, NULL, NULL); + } + break; + + case IDC_IMMEDIATELY: + { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + break; + } + } + } + break; + + case WM_NOTIFY: + { + NMHDR *p = ((LPNMHDR)lParam); + + switch (p->code) + { + case PSN_APPLY: + { + char key[64]; + int count = 0; + TCHAR tszReplies[TEXT_LIMIT]; + + mir_snprintf(key, 64, "RepliesCount_%x", iNumber); + count = DBGetContactSettingByte(NULL, MODULE_NAME, key, 0); + + for (int i = 0; i < count; i++) + { + mir_snprintf(key, 64, "Reply_%x_%x", iNumber, i); + DBDeleteContactSetting(NULL, MODULE_NAME, key); + } + + GetDlgItemText(hwndDlg, IDC_REPLIES, tszReplies, TEXT_LIMIT); + { + tString replies = tszReplies; + + if (replies.length() > 0) + replies.append(_T("\r\n")); + + count = 0; + tString::size_type pos = tString::npos; + while ((pos = replies.find(_T("\r\n"))) != tString::npos) + { + mir_snprintf(key, 64, "Reply_%x_%x", iNumber, count++); + DBWriteContactSettingTString(NULL, MODULE_NAME, key, replies.substr(0, pos).c_str()); + replies = replies.substr(pos + 2); + } + } + + mir_snprintf(key, 64, "RepliesCount_%x", iNumber); + DBWriteContactSettingWord(NULL, MODULE_NAME, key, count); + + mir_snprintf(key, 64, "ImmediatelySend_%x", iNumber); + DBWriteContactSettingByte(NULL, MODULE_NAME, key, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY)); + + mir_free(key); + + return TRUE; + } + break; + } + } + break; + } + + if (HIWORD(wParam) == EN_CHANGE && GetFocus() == (HWND)lParam) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + return FALSE; +} + +static UINT expertOnlyControls[] = { IDC_VARIABLES, IDC_VARIABLES_HINT }; + +INT_PTR OnOptInitialized(WPARAM wParam, LPARAM lParam) +{ + TCHAR tabName[32]; + mir_sntprintf(tabName, SIZEOF(tabName), _T("Button %x"), iNumber + 1); + + OPTIONSDIALOGPAGE odp = {0}; + + odp.cbSize = sizeof(odp); + odp.ptszGroup = _T("Message Sessions"); + odp.ptszTitle = _T("Quick Replies"); + odp.ptszTab = tabName; + odp.position = iNumber; + odp.hInstance = hInstance; + odp.flags = ODPF_TCHAR; + + odp.expertOnlyControls = expertOnlyControls; + odp.nExpertOnlyControls = SIZEOF(expertOnlyControls); + + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_PAGE); + odp.pfnDlgProc = DlgProcOptionsPage; + + CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); + + return 0; +} \ No newline at end of file diff --git a/plugins/QuickReplies/quickreplies.cpp b/plugins/QuickReplies/quickreplies.cpp new file mode 100644 index 0000000000..441e4bf863 --- /dev/null +++ b/plugins/QuickReplies/quickreplies.cpp @@ -0,0 +1,80 @@ +/* +Copyright (C) 2010 Unsane + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + +#include "common.h" + +HINSTANCE hInstance = NULL; +PLUGINLINK *pluginLink; +struct MM_INTERFACE mmi; +int hLangpack; + +HANDLE hOnModulesLoaded; +HANDLE hOnPreShutdown; + +PLUGININFOEX pluginInfoEx = { + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + 0, + // {A6A031B6-D32F-4842-98C6-EC716C576B77} + {0xa6a031b6, 0xd32f, 0x4842, {0x98, 0xc6, 0xec, 0x71, 0x6c, 0x57, 0x6b, 0x77}} +}; + +BOOL WINAPI DllMain(HINSTANCE hInstanceDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + hInstance = hInstanceDLL; + + return TRUE; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfoEx; +} + +static const MUUID interfaces[] = {{0xa6a031b6, 0xd32f, 0x4842, {0x98, 0xc6, 0xec, 0x71, 0x6c, 0x57, 0x6b, 0x77}} , MIID_LAST}; + +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + +extern "C" __declspec(dllexport) int Load(PLUGINLINK* link) +{ + pluginLink = link; + mir_getLP(&pluginInfoEx); + mir_getMMI(&mmi); + + hOnModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + hOnPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown); + + return 0; +} + +extern "C" __declspec(dllexport) int Unload(void) +{ + DestroyServiceFunction(hQuickRepliesService); + return 0; +} diff --git a/plugins/QuickReplies/quickreplies_10.sln b/plugins/QuickReplies/quickreplies_10.sln new file mode 100644 index 0000000000..c1313f98e6 --- /dev/null +++ b/plugins/QuickReplies/quickreplies_10.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuickReplies", "quickreplies_10.vcxproj", "{27CA5499-B3F2-4FB6-8414-651819B0B96C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Unicode|Win32 = Debug Unicode|Win32 + Debug Unicode|x64 = Debug Unicode|x64 + Release Unicode|Win32 = Release Unicode|Win32 + Release Unicode|x64 = Release Unicode|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 + {27CA5499-B3F2-4FB6-8414-651819B0B96C}.Release Unicode|x64.Build.0 = Release Unicode|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/plugins/QuickReplies/quickreplies_10.vcxproj b/plugins/QuickReplies/quickreplies_10.vcxproj new file mode 100644 index 0000000000..62235849e7 --- /dev/null +++ b/plugins/QuickReplies/quickreplies_10.vcxproj @@ -0,0 +1,311 @@ +п»ї + + + + Debug Unicode + Win32 + + + Debug Unicode + x64 + + + Release Unicode + Win32 + + + Release Unicode + x64 + + + + QuickReplies + {27CA5499-B3F2-4FB6-8414-651819B0B96C} + quickreplies + + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + true + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + true + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release_Unicode/quickreplies.tlb + + + + + Full + OnlyExplicitInline + Size + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;quickreplies_EXPORTS;UNICODE;%(PreprocessorDefinitions) + true + false + true + Fast + false + + + + + + + Level3 + ProgramDatabase + CompileAsCpp + 4996;%(DisableSpecificWarnings) + MultiThreadedDLL + + + NDEBUG;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + + + comctl32.lib;gdiplus.lib;%(AdditionalDependencies) + %(AdditionalManifestDependencies) + true + true + UseLinkTimeCodeGeneration + false + + + $(IntDir)$(TargetName).lib + MachineX86 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug_Unicode/quickreplies.tlb + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;quickreplies_EXPORTS;UNICODE;_UNICODE;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + true + Fast + + + + + + + Level3 + EditAndContinue + Default + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + + + comctl32.lib;gdiplus.lib;%(AdditionalDependencies) + true + + + false + + + $(IntDir)$(TargetName).lib + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Release_Unicode/quickreplies.tlb + + + + + Full + OnlyExplicitInline + Size + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;quickreplies_EXPORTS;UNICODE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + Fast + false + + + + + Level3 + true + ProgramDatabase + Default + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + 0x0809 + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + comctl32.lib;%(AdditionalDependencies) + type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) + true + true + true + UseLinkTimeCodeGeneration + false + + + $(IntDir)$(TargetName).lib + MachineX64 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug_Unicode/quickreplies.tlb + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;quickreplies_EXPORTS;UNICODE;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + true + Fast + + + $(IntDir)$(ProjectName).pch + + + Level3 + true + ProgramDatabase + Default + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0809 + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + comctl32.lib;%(AdditionalDependencies) + true + true + $(TargetDir)$(TargetName).pdb + false + + + false + + + $(IntDir)$(TargetName).lib + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/QuickReplies/quickreplies_10.vcxproj.filters b/plugins/QuickReplies/quickreplies_10.vcxproj.filters new file mode 100644 index 0000000000..82b24be170 --- /dev/null +++ b/plugins/QuickReplies/quickreplies_10.vcxproj.filters @@ -0,0 +1,49 @@ +п»ї + + + + {b59c4868-4031-48be-9ce9-7b3effd29e79} + + + {2307a1e4-a748-425a-a1c0-507e67a7c56c} + + + {932f4aef-ade7-474a-b8b5-fb53c8195ca0} + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/plugins/QuickReplies/quickreplies_9.vcproj b/plugins/QuickReplies/quickreplies_9.vcproj new file mode 100644 index 0000000000..76d07c2934 --- /dev/null +++ b/plugins/QuickReplies/quickreplies_9.vcproj @@ -0,0 +1,464 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/QuickReplies/resource.h b/plugins/QuickReplies/resource.h new file mode 100644 index 0000000000..a27459012f --- /dev/null +++ b/plugins/QuickReplies/resource.h @@ -0,0 +1,29 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resources.rc +// +#define IDD_OPTIONS_PAGE 101 +#define IDI_QICON 102 +#define IDC_THEMELIST 1001 +#define IDC_RELOAD 1002 +#define IDC_TITLE 1003 +#define IDC_DESCRIPTION 1004 +#define IDC_CONTACTS 1005 +#define IDC_PREVIEW 1006 +#define IDC_NOPREVIEW 1007 +#define IDC_AUTHORS 1008 +#define IDC_IMMEDIATELY 1009 +#define IDC_REPLIES 1010 +#define IDC_VARIABLES 1011 +#define IDC_VARIABLES_HINT 1013 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1014 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/plugins/QuickReplies/resources.rc b/plugins/QuickReplies/resources.rc new file mode 100644 index 0000000000..2ef1204ff2 --- /dev/null +++ b/plugins/QuickReplies/resources.rc @@ -0,0 +1,129 @@ +// 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) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1251) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_OPTIONS_PAGE DIALOGEX 0, 0, 300, 230 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "Send replies immediately",IDC_IMMEDIATELY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,177,182,13 + EDITTEXT IDC_REPLIES,48,79,204,94,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL + LTEXT "- Add your replies, one per line.",IDC_STATIC,54,44,198,10 + CONTROL "Variables",IDC_VARIABLES,"MButtonClass",WS_TABSTOP,236,176,16,14 + LTEXT "Hints:",IDC_STATIC,48,35,204,8 + LTEXT "- Add ""---"" for separator.",IDC_STATIC,54,55,198,10 + LTEXT "- Press [v] button for variable's help.",IDC_VARIABLES_HINT,54,66,198,10 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_OPTIONS_PAGE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 293 + VERTGUIDE, 48 + VERTGUIDE, 54 + VERTGUIDE, 230 + VERTGUIDE, 236 + VERTGUIDE, 252 + TOPMARGIN, 7 + BOTTOMMARGIN, 223 + HORZGUIDE, 44 + HORZGUIDE, 190 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_QICON ICON "Icons\\qicon.ico" +#endif // нейтральный resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// русский resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +#ifdef _WIN32 +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +#pragma code_page(1251) +#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 // русский resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/QuickReplies/version.h b/plugins/QuickReplies/version.h new file mode 100644 index 0000000000..d94c3418cf --- /dev/null +++ b/plugins/QuickReplies/version.h @@ -0,0 +1,24 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 8 +#define __RELEASE_NUM 1 +#define __BUILD_NUM 0 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM +#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM + +#define __STRINGIFY_IMPL(x) #x +#define __STRINGIFY(x) __STRINGIFY_IMPL(x) +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS) + +#if defined (_UNICODE) +#define __PLUGIN_NAME "Quick Replies (Unicode)" +#else +#define __PLUGIN_NAME "Quick Replies" +#endif +#define __INTERNAL_NAME "QuickReplies" +#define __FILENAME "quickreplies.dll" +#define __DESCRIPTION "Plugin for quick insert (or sending) pre-defined messages in message input area." +#define __AUTHOR "Unsane" +#define __AUTHOREMAIL "" +#define __AUTHORWEB "http://www.miranda-im.org" +#define __COPYRIGHT "© 2010 Unsane" diff --git a/plugins/QuickReplies/version.rc b/plugins/QuickReplies/version.rc new file mode 100644 index 0000000000..cf9a9f4b32 --- /dev/null +++ b/plugins/QuickReplies/version.rc @@ -0,0 +1,113 @@ +// Microsoft Visual C++ generated resource script. +// +#include "version.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) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1251) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "FileVersion", __VERSION_STRING + VALUE "InternalName", __INTERNAL_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + VALUE "ProductVersion", __VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + +#endif // нейтральный resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// русский resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +#ifdef _WIN32 +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +#pragma code_page(1251) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "version.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 + -- cgit v1.2.3