summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-08 19:44:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-08 19:44:51 +0300
commit290518a76e3dbed5f3452f9e210c90246c8875d4 (patch)
treefd88db301fa85e98d9c3a3771676e1464f392b5b /plugins/SmileyAdd
parentf9e9f87fe527ef131e10518ed19b5cd071299c9b (diff)
merge of recent SRMM-related fixes
Diffstat (limited to 'plugins/SmileyAdd')
-rw-r--r--plugins/SmileyAdd/SmileyAdd.vcxproj3
-rw-r--r--plugins/SmileyAdd/SmileyAdd.vcxproj.filters104
-rw-r--r--plugins/SmileyAdd/res/resource.rc10
-rw-r--r--plugins/SmileyAdd/src/dlgboxsubclass.cpp57
-rw-r--r--plugins/SmileyAdd/src/options.cpp13
-rw-r--r--plugins/SmileyAdd/src/options.h3
-rw-r--r--plugins/SmileyAdd/src/resource.h5
-rw-r--r--plugins/SmileyAdd/src/stdafx.h1
-rw-r--r--plugins/SmileyAdd/src/version.h4
9 files changed, 124 insertions, 76 deletions
diff --git a/plugins/SmileyAdd/SmileyAdd.vcxproj b/plugins/SmileyAdd/SmileyAdd.vcxproj
index 87eb21f46b..ad138c55fd 100644
--- a/plugins/SmileyAdd/SmileyAdd.vcxproj
+++ b/plugins/SmileyAdd/SmileyAdd.vcxproj
@@ -35,6 +35,9 @@
<Project>{5D14CFF3-0D17-4528-99EA-DE9DCA47CC2E}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <Image Include="res\smiley.ICO" />
+ </ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4458;%(DisableSpecificWarnings)</DisableSpecificWarnings>
diff --git a/plugins/SmileyAdd/SmileyAdd.vcxproj.filters b/plugins/SmileyAdd/SmileyAdd.vcxproj.filters
index de5ad9f66c..3444de9894 100644
--- a/plugins/SmileyAdd/SmileyAdd.vcxproj.filters
+++ b/plugins/SmileyAdd/SmileyAdd.vcxproj.filters
@@ -1,4 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
+ <ItemGroup>
+ <ClCompile Include="src\stdafx.cxx">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\*.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="src\*.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="res\*.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="res\*.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="res\smiley.ICO">
+ <Filter>Resource Files</Filter>
+ </Image>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/plugins/SmileyAdd/res/resource.rc b/plugins/SmileyAdd/res/resource.rc
index 27357ba49b..4d0e2c94c6 100644
--- a/plugins/SmileyAdd/res/resource.rc
+++ b/plugins/SmileyAdd/res/resource.rc
@@ -13,7 +13,7 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Нейтральный resources
+// Neutral resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
@@ -67,9 +67,8 @@ BEGIN
CONTROL "Enable smileys",IDC_INPUTSMILEYS,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,15,226,130,8
CONTROL "Don't replace at cursor",IDC_DCURSORSMILEY,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,15,237,130,8
GROUPBOX "Built-in message dialog support",IDC_STATIC,155,213,162,36
- CONTROL "Enable",IDC_PLUGENABLED,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,240,222,69,12
- COMBOBOX IDC_SMLBUT,159,233,60,35,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- LTEXT "Smiley button",IDC_STATIC,161,223,72,8
+ LTEXT "Smiley button",IDC_STATIC,161,226,72,8
+ COMBOBOX IDC_SMLBUT,249,226,60,35,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Surround inserted smiley with spaces",IDC_APPENDSPACES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,170,220,11
CONTROL "Use first smiley for selection size",IDC_SCALEALLSMILEYS,
@@ -107,6 +106,7 @@ END
// remains consistent on all systems.
IDI_SMILINGICON ICON "smiley.ICO"
+
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
@@ -132,7 +132,7 @@ END
#endif // APSTUDIO_INVOKED
-#endif // Нейтральный resources
+#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
index 884b323837..e082e5f94e 100644
--- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp
+++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp
@@ -50,8 +50,6 @@ struct MsgWndData : public MZeroedObject
bbd.pszModuleName = MODULENAME;
if (!doSmileyButton)
bbd.bbbFlags = BBBF_DISABLED;
- else if (!opt.PluginSupportEnabled)
- bbd.bbbFlags = BBBF_HIDDEN;
Srmm_SetButtonState(hContact, &bbd);
}
};
@@ -86,59 +84,18 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam,
if (dat == nullptr)
return 0;
- switch (uMsg) {
- case DM_OPTIONSAPPLIED:
+ if (uMsg == DM_OPTIONSAPPLIED)
dat->CreateSmileyButton();
- break;
-
- case DM_APPENDTOLOG:
- if (opt.PluginSupportEnabled) {
- // get length of text now before things can get added...
- GETTEXTLENGTHEX gtl;
- gtl.codepage = 1200;
- gtl.flags = GTL_PRECISE | GTL_NUMCHARS;
- dat->idxLastChar = (int)SendMessage(dat->hwndLog, EM_GETTEXTLENGTHEX, (WPARAM)&gtl, 0);
- }
- break;
- }
LRESULT result = mir_callNextSubclass(hwnd, MessageDlgSubclass, uMsg, wParam, lParam);
- if (!opt.PluginSupportEnabled)
- return result;
-
- switch (uMsg) {
- case WM_DESTROY:
- {
- mir_cslock lck(csWndList);
- int ind = g_MsgWndList.getIndex((MsgWndData*)&hwnd);
- if (ind != -1) {
- delete g_MsgWndList[ind];
- g_MsgWndList.remove(ind);
- }
- }
- break;
- case DM_APPENDTOLOG:
- if (dat->doSmileyReplace) {
- SmileyPackCType *smcp;
- SmileyPackType *SmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact, &smcp);
- if (SmileyPack != nullptr) {
- const CHARRANGE sel = { dat->idxLastChar, LONG_MAX };
- ReplaceSmileys(dat->hwndLog, SmileyPack, smcp, sel, false, false, false);
- }
+ if (uMsg == WM_DESTROY) {
+ mir_cslock lck(csWndList);
+ int ind = g_MsgWndList.getIndex((MsgWndData*)&hwnd);
+ if (ind != -1) {
+ delete g_MsgWndList[ind];
+ g_MsgWndList.remove(ind);
}
- break;
-
- case DM_REMAKELOG:
- if (dat->doSmileyReplace) {
- SmileyPackCType *smcp;
- SmileyPackType *SmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact, &smcp);
- if (SmileyPack != nullptr) {
- static const CHARRANGE sel = { 0, LONG_MAX };
- ReplaceSmileys(dat->hwndLog, SmileyPack, smcp, sel, false, false, false);
- }
- }
- break;
}
return result;
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index de31cf1b8a..4708ccf2dc 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -104,14 +104,6 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
- case IDC_PLUGENABLED:
- if (HIWORD(wParam) == BN_CLICKED) {
- BOOL en = IsDlgButtonChecked(m_hwndDialog, IDC_PLUGENABLED) == BST_CHECKED;
- EnableWindow(GetDlgItem(m_hwndDialog, IDC_SMLBUT), en);
- SetChanged();
- }
- break;
-
case IDC_ADDCATEGORY:
if (HIWORD(wParam) == BN_CLICKED)
AddCategory();
@@ -350,7 +342,6 @@ void OptionsDialogType::InitDialog(void)
{
TranslateDialogDefault(m_hwndDialog);
- CheckDlgButton(m_hwndDialog, IDC_PLUGENABLED, opt.PluginSupportEnabled ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwndDialog, IDC_SPACES, opt.EnforceSpaces ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwndDialog, IDC_SCALETOTEXTHEIGHT, opt.ScaleToTextheight ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwndDialog, IDC_USESTDPACK, opt.UseOneForAll ? BST_UNCHECKED : BST_CHECKED);
@@ -370,7 +361,6 @@ void OptionsDialogType::InitDialog(void)
SendDlgItemMessage(m_hwndDialog, IDC_SMLBUT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Show"));
SendDlgItemMessage(m_hwndDialog, IDC_SMLBUT, CB_SETCURSEL, opt.ButtonStatus, 0);
- EnableWindow(GetDlgItem(m_hwndDialog, IDC_SMLBUT), opt.PluginSupportEnabled);
EnableWindow(GetDlgItem(m_hwndDialog, IDC_USEPHYSPROTO), !opt.UseOneForAll);
SendDlgItemMessage(m_hwndDialog, IDC_MAXCUSTSPIN, UDM_SETRANGE32, 0, 99);
@@ -420,7 +410,6 @@ void OptionsDialogType::ApplyChanges(void)
ProcessAllInputAreas(true);
CloseSmileys();
- opt.PluginSupportEnabled = IsDlgButtonChecked(m_hwndDialog, IDC_PLUGENABLED) == BST_CHECKED;
opt.EnforceSpaces = IsDlgButtonChecked(m_hwndDialog, IDC_SPACES) == BST_CHECKED;
opt.ScaleToTextheight = IsDlgButtonChecked(m_hwndDialog, IDC_SCALETOTEXTHEIGHT) == BST_CHECKED;
opt.UseOneForAll = IsDlgButtonChecked(m_hwndDialog, IDC_USESTDPACK) == BST_UNCHECKED;
@@ -543,7 +532,6 @@ void OptionsDialogType::ShowSmileyPreview(void)
void OptionsType::Save(void)
{
- db_set_b(NULL, MODULENAME, "PluginSupportEnabled", PluginSupportEnabled);
db_set_b(NULL, MODULENAME, "EnforceSpaces", EnforceSpaces);
db_set_b(NULL, MODULENAME, "ScaleToTextheight", ScaleToTextheight);
db_set_b(NULL, MODULENAME, "UseOneForAll", UseOneForAll);
@@ -565,7 +553,6 @@ void OptionsType::Save(void)
void OptionsType::Load(void)
{
- PluginSupportEnabled = db_get_b(NULL, MODULENAME, "PluginSupportEnabled", TRUE) != 0;
EnforceSpaces = db_get_b(NULL, MODULENAME, "EnforceSpaces", FALSE) != 0;
ScaleToTextheight = db_get_b(NULL, MODULENAME, "ScaleToTextheight", FALSE) != 0;
UseOneForAll = db_get_b(NULL, MODULENAME, "UseOneForAll", TRUE) != 0;
diff --git a/plugins/SmileyAdd/src/options.h b/plugins/SmileyAdd/src/options.h
index 130493177e..7ffa3f0b94 100644
--- a/plugins/SmileyAdd/src/options.h
+++ b/plugins/SmileyAdd/src/options.h
@@ -26,7 +26,6 @@ int SmileysOptionsInitialize(WPARAM wParam, LPARAM lParam);
class OptionsType
{
public:
- bool PluginSupportEnabled;
bool EnforceSpaces;
bool ScaleToTextheight;
bool UseOneForAll;
@@ -39,7 +38,7 @@ public:
bool InputSmileys;
bool DCursorSmiley;
bool DisableCustom;
- bool HQScaling;
+ bool HQScaling;
bool HorizontalSorting;
unsigned ButtonStatus;
unsigned SelWndBkgClr;
diff --git a/plugins/SmileyAdd/src/resource.h b/plugins/SmileyAdd/src/resource.h
index 98bf81d17e..533c9326ee 100644
--- a/plugins/SmileyAdd/src/resource.h
+++ b/plugins/SmileyAdd/src/resource.h
@@ -1,11 +1,10 @@
//{{NO_DEPENDENCIES}}
-// Включаемый файл, созданный в Microsoft Visual C++.
-// Используется D:\Others\SVN\MirandaNG\trunk\plugins\SmileyAdd\res\resource.rc
+// Microsoft Visual C++ generated include file.
+// Used by w:\miranda-ng\plugins\SmileyAdd\res\resource.rc
//
#define IDI_SMILINGICON 124
#define IDD_OPT_SMILEYS 245
#define IDC_CATEGORYLIST 1017
-#define IDC_PLUGENABLED 1019
#define IDC_INPUTSMILEYS 1020
#define IDC_DCURSORSMILEY 1021
#define IDC_LIBNAME 1023
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h
index db2cc70b63..996aebe9a4 100644
--- a/plugins/SmileyAdd/src/stdafx.h
+++ b/plugins/SmileyAdd/src/stdafx.h
@@ -99,7 +99,6 @@ extern LIST<void> menuHandleArray;
#define DM_REMAKELOG (WM_USER + 11)
#define DM_OPTIONSAPPLIED (WM_USER + 14)
-#define DM_APPENDTOLOG (WM_USER + 17)
#define WM_REMAKERICH (WM_USER + 0x3457)
diff --git a/plugins/SmileyAdd/src/version.h b/plugins/SmileyAdd/src/version.h
index 486043ea5f..9c84ae074d 100644
--- a/plugins/SmileyAdd/src/version.h
+++ b/plugins/SmileyAdd/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 3
-#define __RELEASE_NUM 0
-#define __BUILD_NUM 2
+#define __RELEASE_NUM 1
+#define __BUILD_NUM 0
#include <stdver.h>