summaryrefslogtreecommitdiff
path: root/plugins/IEView
diff options
context:
space:
mode:
authorKirill Volinsky <Mataes2007@gmail.com>2018-05-17 11:42:46 +0300
committerKirill Volinsky <Mataes2007@gmail.com>2018-05-17 11:43:07 +0300
commit73d93114e2c4d4c1c259fa1474a5c6bd723b92ee (patch)
tree328603e0b26a88e74aca6e728a1fe0c28bf094ec /plugins/IEView
parentad103f4be37b7082bcca7106b77b7606e4173920 (diff)
IEView, IgnoreState, Import: cmplugin adaptation
Diffstat (limited to 'plugins/IEView')
-rw-r--r--plugins/IEView/src/IEView.cpp42
-rw-r--r--plugins/IEView/src/Options.cpp296
-rw-r--r--plugins/IEView/src/ieview_main.cpp10
-rw-r--r--plugins/IEView/src/stdafx.h10
4 files changed, 178 insertions, 180 deletions
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp
index 4fa21b9e8a..480d6eb554 100644
--- a/plugins/IEView/src/IEView.cpp
+++ b/plugins/IEView/src/IEView.cpp
@@ -39,11 +39,11 @@ static LRESULT CALLBACK IEViewServerWindowProcedure(HWND hwnd, UINT message, WPA
if (LOWORD(wParam) == VK_ESCAPE && !(GetKeyState(VK_SHIFT) & 0x8000) && !(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_MENU) & 0x8000))
SendMessage(GetParent(GetParent(GetParent(hwnd))), WM_COMMAND, IDCANCEL, 0);
break;
-
+
case WM_KEYDOWN:
view->translateAccelerator(message, wParam, lParam);
break;
-
+
case WM_SETFOCUS:
RECT rcWindow;
POINT cursor;
@@ -55,7 +55,7 @@ static LRESULT CALLBACK IEViewServerWindowProcedure(HWND hwnd, UINT message, WPA
if (view->setFocus((HWND)wParam))
return TRUE;
break;
-
+
case WM_LBUTTONDOWN:
POINT pt;
pt.x = LOWORD(lParam);
@@ -201,7 +201,7 @@ void IEViewSink::FileDownload(VARIANT_BOOL*) {}
static void __cdecl StartThread(void *vptr)
{
- IEView *iev = (IEView *) vptr;
+ IEView *iev = (IEView *)vptr;
iev->waitWhileBusy();
return;
}
@@ -417,12 +417,12 @@ STDMETHODIMP IEView::GetTypeInfoCount(UINT *pctinfo)
*pctinfo = 4;
return S_OK;
}
-STDMETHODIMP IEView::GetTypeInfo(UINT, LCID, LPTYPEINFO*)
-{
- return S_OK;
+STDMETHODIMP IEView::GetTypeInfo(UINT, LCID, LPTYPEINFO*)
+{
+ return S_OK;
}
STDMETHODIMP IEView::GetIDsOfNames(REFIID /*riid*/, LPOLESTR *rgszNames, UINT cNames, LCID /*lcid*/, DISPID *rgDispId)
-{
+{
HRESULT retval = S_OK;
for (size_t i = 0; i < cNames; i++)
{
@@ -450,17 +450,17 @@ STDMETHODIMP IEView::GetIDsOfNames(REFIID /*riid*/, LPOLESTR *rgszNames, UINT cN
retval = DISP_E_UNKNOWNNAME;
}
}
- return retval;
+ return retval;
}
STDMETHODIMP IEView::Invoke(DISPID dispIdMember,
- REFIID /*riid*/,
- LCID /*lcid*/,
- WORD /*wFlags*/,
- DISPPARAMS *pDispParams,
- VARIANT *pVarResult,
- EXCEPINFO * /*pExcepInfo*/,
- UINT * /*puArgErr*/)
+ REFIID /*riid*/,
+ LCID /*lcid*/,
+ WORD /*wFlags*/,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO * /*pExcepInfo*/,
+ UINT * /*puArgErr*/)
{
switch (dispIdMember)
@@ -628,7 +628,7 @@ STDMETHODIMP IEView::ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdTarge
HWND hSPWnd;
pOleWindow->GetWindow(&hSPWnd);
- HMENU hMenu = GetSubMenu(LoadMenu(hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU)), 0);
+ HMENU hMenu = GetSubMenu(LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CONTEXTMENU)), 0);
TranslateMenu(hMenu);
if (dwID == 5) // anchor
EnableMenuItem(hMenu, ID_MENU_COPYLINK, MF_BYCOMMAND | MF_ENABLED);
@@ -849,7 +849,7 @@ void IEView::scrollToBottom()
}
}
}
-
+
CComPtr<IHTMLWindow2> pWindow;
if (SUCCEEDED(document->get_parentWindow(&pWindow)) && pWindow != nullptr)
pWindow->scrollBy(-0x0000FFFF, 0x0000FFFF);
@@ -934,7 +934,7 @@ void IEView::appendEvent(IEVIEWEVENT *event)
clear(event);
if (event->eventData == nullptr)
- return;
+ return;
if (builder != nullptr)
builder->appendEventNew(this, event);
@@ -959,7 +959,7 @@ void IEView::clear(IEVIEWEVENT *event)
else {
document->close();
VARIANT open_name, open_features, open_replace;
-
+
VariantInit(&open_name);
open_name.vt = VT_BSTR;
open_name.bstrVal = SysAllocString(L"_self");
@@ -1043,7 +1043,7 @@ WCHAR* IEView::getSelection()
BSTR text = nullptr;
if (FAILED(pRange->get_text(&text)))
return nullptr;
-
+
WCHAR *res = mir_wstrdup(text);
::SysFreeString(text);
return res;
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp
index 67584dad16..242222a2f9 100644
--- a/plugins/IEView/src/Options.cpp
+++ b/plugins/IEView/src/Options.cpp
@@ -338,7 +338,7 @@ static void RefreshProtoIcons()
HICON hIcon = nullptr;
if (i > 0) {
hIcon = (HICON)CallProtoService(proto->getProtocolName(), PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
- if (hIcon == nullptr) {
+ if (hIcon == nullptr) {
hIcon = (HICON)CallProtoService(proto->getProtocolName(), PS_LOADICON, PLI_PROTOCOL, 0);
}
ImageList_AddIcon(hProtocolImageList, hIcon);
@@ -436,7 +436,7 @@ static bool BrowseFile(HWND hwndDlg, char *filter, char *defExt, char *path, int
int IEViewOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.szGroup.w = LPGENW("Message sessions");
odp.szTitle.w = LPGENW("IEView");
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
@@ -519,22 +519,22 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
return TRUE;
case WM_COMMAND:
- {
- switch (LOWORD(wParam)) {
- case IDC_ENABLE_BBCODES:
- case IDC_ENABLE_FLASH:
- case IDC_SMILEYS_IN_NAMES:
- case IDC_NO_BORDER:
- case IDC_EMBED_SIZE:
- MarkChanges(1, hwndDlg);
- break;
- case IDC_ENABLE_EMBED:
- MarkChanges(1, hwndDlg);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
- break;
- }
+ {
+ switch (LOWORD(wParam)) {
+ case IDC_ENABLE_BBCODES:
+ case IDC_ENABLE_FLASH:
+ case IDC_SMILEYS_IN_NAMES:
+ case IDC_NO_BORDER:
+ case IDC_EMBED_SIZE:
+ MarkChanges(1, hwndDlg);
+ break;
+ case IDC_ENABLE_EMBED:
+ MarkChanges(1, hwndDlg);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
+ break;
}
- break;
+ }
+ break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
@@ -570,112 +570,112 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
char path[MAX_PATH], filter[MAX_PATH];
switch (msg) {
case WM_INITDIALOG:
- {
- MarkInitialized(2);
- TranslateDialogDefault(hwndDlg);
- srmmCurrentProtoItem = nullptr;
- RefreshProtoList(hwndDlg, 0, true);
- return TRUE;
- }
+ {
+ MarkInitialized(2);
+ TranslateDialogDefault(hwndDlg);
+ srmmCurrentProtoItem = nullptr;
+ RefreshProtoList(hwndDlg, 0, true);
+ return TRUE;
+ }
case WM_COMMAND:
- {
- switch (LOWORD(wParam)) {
- case IDC_BACKGROUND_IMAGE_FILENAME:
- case IDC_EXTERNALCSS_FILENAME:
- case IDC_EXTERNALCSS_FILENAME_RTL:
- case IDC_TEMPLATES_FILENAME:
- if ((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)
- MarkChanges(2, hwndDlg);
- break;
- case IDC_SCROLL_BACKGROUND_IMAGE:
- case IDC_LOG_SHOW_NICKNAMES:
- case IDC_LOG_SHOW_TIME:
- case IDC_LOG_SHOW_DATE:
- case IDC_LOG_SHOW_SECONDS:
- case IDC_LOG_LONG_DATE:
- case IDC_LOG_RELATIVE_DATE:
- case IDC_LOG_GROUP_MESSAGES:
+ {
+ switch (LOWORD(wParam)) {
+ case IDC_BACKGROUND_IMAGE_FILENAME:
+ case IDC_EXTERNALCSS_FILENAME:
+ case IDC_EXTERNALCSS_FILENAME_RTL:
+ case IDC_TEMPLATES_FILENAME:
+ if ((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)
MarkChanges(2, hwndDlg);
- break;
- case IDC_BACKGROUND_IMAGE:
- bChecked = IsDlgButtonChecked(hwndDlg, IDC_MODE_COMPATIBLE) && IsDlgButtonChecked(hwndDlg, IDC_BACKGROUND_IMAGE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME), bChecked);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE_BACKGROUND_IMAGE), bChecked);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL_BACKGROUND_IMAGE), bChecked);
+ break;
+ case IDC_SCROLL_BACKGROUND_IMAGE:
+ case IDC_LOG_SHOW_NICKNAMES:
+ case IDC_LOG_SHOW_TIME:
+ case IDC_LOG_SHOW_DATE:
+ case IDC_LOG_SHOW_SECONDS:
+ case IDC_LOG_LONG_DATE:
+ case IDC_LOG_RELATIVE_DATE:
+ case IDC_LOG_GROUP_MESSAGES:
+ MarkChanges(2, hwndDlg);
+ break;
+ case IDC_BACKGROUND_IMAGE:
+ bChecked = IsDlgButtonChecked(hwndDlg, IDC_MODE_COMPATIBLE) && IsDlgButtonChecked(hwndDlg, IDC_BACKGROUND_IMAGE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE_BACKGROUND_IMAGE), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL_BACKGROUND_IMAGE), bChecked);
+ MarkChanges(2, hwndDlg);
+ break;
+ case IDC_BROWSE_TEMPLATES:
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
+ UpdateTemplateIcons(hwndDlg, path);
MarkChanges(2, hwndDlg);
- break;
- case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
- SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
- UpdateTemplateIcons(hwndDlg, path);
- MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
- SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
- MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
- SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
- MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
- SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
- MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_MODE_COMPATIBLE:
- case IDC_MODE_CSS:
- case IDC_MODE_TEMPLATE:
- UpdateControlsState(hwndDlg);
+ }
+ break;
+ case IDC_BROWSE_BACKGROUND_IMAGE:
+ mir_snprintf(filter, "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
+ MarkChanges(2, hwndDlg);
+ }
+ break;
+ case IDC_BROWSE_EXTERNALCSS:
+ mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(2, hwndDlg);
- break;
- case IDC_GETTEMPLATES:
- Utils_OpenUrl("https://miranda-ng.org/addons/category/16");
- break;
}
+ break;
+ case IDC_BROWSE_EXTERNALCSS_RTL:
+ mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
+ MarkChanges(2, hwndDlg);
+ }
+ break;
+ case IDC_MODE_COMPATIBLE:
+ case IDC_MODE_CSS:
+ case IDC_MODE_TEMPLATE:
+ UpdateControlsState(hwndDlg);
+ MarkChanges(2, hwndDlg);
+ break;
+ case IDC_GETTEMPLATES:
+ Utils_OpenUrl("https://miranda-ng.org/addons/category/16");
+ break;
}
- break;
+ }
+ break;
case UM_CHECKSTATECHANGE:
- {
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
- if (proto != nullptr)
- if (strcmpi(proto->getProtocolName(), "_default_"))
- proto->setSRMMEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
-
- if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam))
- TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
- else
- UpdateSRMMProtoInfo(hwndDlg, proto);
+ {
+ ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
+ if (proto != nullptr)
+ if (strcmpi(proto->getProtocolName(), "_default_"))
+ proto->setSRMMEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
- MarkChanges(2, hwndDlg);
- }
- break;
+ if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam))
+ TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
+ else
+ UpdateSRMMProtoInfo(hwndDlg, proto);
+
+ MarkChanges(2, hwndDlg);
+ }
+ break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == IDC_PROTOLIST) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
- {
- TVHITTESTINFO ht = { 0 };
- DWORD dwpos = GetMessagePos();
- POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
- MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
- TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
- if (TVHT_ONITEMSTATEICON & ht.flags) {
- PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
- return FALSE;
- }
+ {
+ TVHITTESTINFO ht = { 0 };
+ DWORD dwpos = GetMessagePos();
+ POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
+ MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
+ TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
+ if (TVHT_ONITEMSTATEICON & ht.flags) {
+ PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
+ return FALSE;
}
- break;
+ }
+ break;
case TVN_KEYDOWN:
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
@@ -683,7 +683,7 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
break;
case TVN_SELCHANGED:
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)nullptr);
+ ProtocolSettings * proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)nullptr);
SaveSRMMProtoSettings(hwndDlg, srmmCurrentProtoItem);
UpdateSRMMProtoInfo(hwndDlg, proto);
break;
@@ -797,18 +797,18 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
if (((LPNMHDR)lParam)->idFrom == IDC_PROTOLIST) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
- {
- TVHITTESTINFO ht = { 0 };
- DWORD dwpos = GetMessagePos();
- POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
- MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
- TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
- if (TVHT_ONITEMSTATEICON & ht.flags) {
- PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
- return FALSE;
- }
+ {
+ TVHITTESTINFO ht = { 0 };
+ DWORD dwpos = GetMessagePos();
+ POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
+ MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
+ TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
+ if (TVHT_ONITEMSTATEICON & ht.flags) {
+ PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
+ return FALSE;
}
- break;
+ }
+ break;
case TVN_KEYDOWN:
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
@@ -816,7 +816,7 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
break;
case TVN_SELCHANGED:
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)nullptr);
+ ProtocolSettings * proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)nullptr);
SaveHistoryProtoSettings(hwndDlg, historyCurrentProtoItem);
UpdateHistoryProtoInfo(hwndDlg, proto);
break;
@@ -911,38 +911,38 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA
break;
case UM_CHECKSTATECHANGE:
- {
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
- if (proto != nullptr)
- if (strcmpi(proto->getProtocolName(), "_default_"))
- proto->setChatEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
+ {
+ ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
+ if (proto != nullptr)
+ if (strcmpi(proto->getProtocolName(), "_default_"))
+ proto->setChatEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
- if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam)) {
- TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
- }
- else {
- UpdateChatProtoInfo(hwndDlg, proto);
- }
- MarkChanges(8, hwndDlg);
+ if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam)) {
+ TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
}
- break;
+ else {
+ UpdateChatProtoInfo(hwndDlg, proto);
+ }
+ MarkChanges(8, hwndDlg);
+ }
+ break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == IDC_PROTOLIST) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
- {
- TVHITTESTINFO ht = { 0 };
- DWORD dwpos = GetMessagePos();
- POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
- MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
- TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
- if (TVHT_ONITEMSTATEICON & ht.flags) {
- PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
- return FALSE;
- }
+ {
+ TVHITTESTINFO ht = { 0 };
+ DWORD dwpos = GetMessagePos();
+ POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
+ MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
+ TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
+ if (TVHT_ONITEMSTATEICON & ht.flags) {
+ PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
+ return FALSE;
}
- break;
+ }
+ break;
case TVN_KEYDOWN:
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
@@ -950,7 +950,7 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA
break;
case TVN_SELCHANGED:
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)nullptr);
+ ProtocolSettings * proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)nullptr);
SaveChatProtoSettings(hwndDlg, chatCurrentProtoItem);
UpdateChatProtoInfo(hwndDlg, proto);
break;
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp
index 2653da6948..544f3a1382 100644
--- a/plugins/IEView/src/ieview_main.cpp
+++ b/plugins/IEView/src/ieview_main.cpp
@@ -20,10 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "stdafx.h"
-HINSTANCE hInstance;
CLIST_INTERFACE *pcli;
char *workingDirUtf8;
+CMPlugin g_plugin;
int hLangpack;
PLUGININFOEX pluginInfoEx = {
@@ -39,12 +39,6 @@ PLUGININFOEX pluginInfoEx = {
{ 0x0495171b, 0x7137, 0x4ded, { 0x97, 0xf8, 0xce, 0x6f, 0xed, 0x67, 0xd6, 0x91 } }
};
-BOOL WINAPI DllMain(HINSTANCE hModule, DWORD, LPVOID)
-{
- hInstance = hModule;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
@@ -84,7 +78,7 @@ extern "C" int __declspec(dllexport) Load(void)
CreateServiceFunction(MS_IEVIEW_NAVIGATE, HandleIENavigate);
CreateServiceFunction("IEView/ReloadOptions", ReloadOptions);
hHookOptionsChanged = CreateHookableEvent(ME_IEVIEW_OPTIONSCHANGED);
- Icon_Register(hInstance, ieviewModuleName, iconList, _countof(iconList), ieviewModuleName);
+ Icon_Register(g_plugin.getInst(), ieviewModuleName, iconList, _countof(iconList), ieviewModuleName);
return 0;
}
diff --git a/plugins/IEView/src/stdafx.h b/plugins/IEView/src/stdafx.h
index 6faffa62fd..e80200df80 100644
--- a/plugins/IEView/src/stdafx.h
+++ b/plugins/IEView/src/stdafx.h
@@ -36,8 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <io.h>
#include <fcntl.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <newpluginapi.h>
#include <m_clistint.h>
#include <m_langpack.h>
@@ -76,7 +74,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ieviewModuleName "IEVIEW"
-extern HINSTANCE hInstance;
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(ieviewModuleName)
+ {}
+};
+
extern IEView *debugView;
extern char *workingDirUtf8;
extern HANDLE hHookOptionsChanged;