summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-04-07 14:36:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-04-07 14:36:22 +0300
commitc46f4344f007d814131d25fa5aec6fdb4c7a049d (patch)
tree2728e27c52e2e12bcadcf2f5606196229607c7af /plugins/Scriver
parent77f05f77b497b1d69e8107caefd6d19fa9c609ab (diff)
Windows-specific code moved to mir_core
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/src/chat_window.cpp1
-rw-r--r--plugins/Scriver/src/msgdialog.cpp3
-rw-r--r--plugins/Scriver/src/msgoptions.cpp1
-rw-r--r--plugins/Scriver/src/msgs.cpp96
-rw-r--r--plugins/Scriver/src/msgs.h28
-rw-r--r--plugins/Scriver/src/stdafx.h3
6 files changed, 1 insertions, 131 deletions
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp
index 40ed6a6db3..e8536333e9 100644
--- a/plugins/Scriver/src/chat_window.cpp
+++ b/plugins/Scriver/src/chat_window.cpp
@@ -235,7 +235,6 @@ void CChatRoomDlg::OnInitDialog()
int mask = (int)m_log.SendMsg(EM_GETEVENTMASK, 0, 0);
m_log.SendMsg(EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
m_log.SendMsg(EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0);
- m_log.SendMsg(EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
m_log.SendMsg(EM_AUTOURLDETECT, 1, 0);
if (db_get_b(0, CHAT_MODULE, "UseIEView", 0)) {
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 4709a0a2e6..18e8100153 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -276,15 +276,14 @@ void CSrmmWindow::OnInitDialog()
Srmm_CreateToolbarIcons(m_hwnd, BBBF_ISIMBUTTON);
SendMessage(m_hwnd, DM_CHANGEICONS, 0, 0);
- m_log.SendMsg(EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
m_log.SendMsg(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_LINK | ENM_KEYEVENTS);
m_log.SendMsg(EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
m_log.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_log.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST));
m_log.SendMsg(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
m_log.SendMsg(EM_AUTOURLDETECT, TRUE, 0);
+ m_message.SetReadOnly(false);
m_message.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_message.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
- m_message.SendMsg(EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback2);
m_message.SendMsg(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE);
if (m_hContact && m_szProto) {
int nMax = CallProtoService(m_szProto, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, m_hContact);
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index ab9309f5af..e5511c842a 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -680,7 +680,6 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_AUTOURLDETECT, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
}
ShowPreview(hwndDlg);
return TRUE;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index de7091340f..3c56bc9a2f 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -678,99 +678,3 @@ int OnLoadModule(void)
Chat_Load();
return 0;
}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////
-
-CREOleCallback reOleCallback;
-CREOleCallback2 reOleCallback2;
-
-STDMETHODIMP CREOleCallback::QueryInterface(REFIID riid, LPVOID * ppvObj)
-{
- if (IsEqualIID(riid, IID_IRichEditOleCallback)) {
- *ppvObj = this;
- AddRef();
- return S_OK;
- }
- *ppvObj = nullptr;
- return E_NOINTERFACE;
-}
-
-STDMETHODIMP_(ULONG) CREOleCallback::AddRef()
-{
- if (refCount == 0)
- StgCreateDocfile(nullptr, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &pictStg);
-
- return ++refCount;
-}
-
-STDMETHODIMP_(ULONG) CREOleCallback::Release()
-{
- if (--refCount == 0) {
- if (pictStg) {
- pictStg->Release();
- pictStg = nullptr;
- }
- }
- return refCount;
-}
-
-STDMETHODIMP CREOleCallback::ContextSensitiveHelp(BOOL)
-{
- return S_OK;
-}
-
-STDMETHODIMP CREOleCallback::DeleteObject(LPOLEOBJECT)
-{
- return S_OK;
-}
-
-STDMETHODIMP CREOleCallback::GetClipboardData(CHARRANGE*, DWORD, LPDATAOBJECT*)
-{
- return E_NOTIMPL;
-}
-
-STDMETHODIMP CREOleCallback::GetContextMenu(WORD, LPOLEOBJECT, CHARRANGE*, HMENU*)
-{
- return E_INVALIDARG;
-}
-
-STDMETHODIMP CREOleCallback::GetDragDropEffect(BOOL, DWORD, LPDWORD)
-{
- return S_OK;
-}
-
-STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEUIWINDOW*, LPOLEINPLACEFRAMEINFO)
-{
- return E_INVALIDARG;
-}
-
-STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
-{
- wchar_t sztName[64];
- mir_snwprintf(sztName, L"s%u", nextStgId++);
- if (pictStg == nullptr)
- return STG_E_MEDIUMFULL;
- return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
-}
-
-STDMETHODIMP CREOleCallback::QueryAcceptData(LPDATAOBJECT, CLIPFORMAT*, DWORD, BOOL, HGLOBAL)
-{
- return S_OK;
-}
-
-STDMETHODIMP CREOleCallback::QueryInsertObject(LPCLSID, LPSTORAGE, LONG)
-{
- return S_OK;
-}
-
-STDMETHODIMP CREOleCallback::ShowContainerUI(BOOL)
-{
- return S_OK;
-}
-
-STDMETHODIMP CREOleCallback2::QueryAcceptData(LPDATAOBJECT, CLIPFORMAT *lpcfFormat, DWORD, BOOL, HGLOBAL)
-{
- *lpcfFormat = CF_UNICODETEXT;
- return S_OK;
-}
-
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index 3ecd32a47a..ff758a3416 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -275,34 +275,6 @@ public:
#define EVENTTYPE_JABBER_CHATSTATES 2000
#define EVENTTYPE_JABBER_PRESENCE 2001
-struct CREOleCallback : public IRichEditOleCallback
-{
- CREOleCallback() : refCount(0), nextStgId(0), pictStg(nullptr) {}
- unsigned refCount;
- IStorage *pictStg;
- int nextStgId;
-
- STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR *lplpObj);
- STDMETHOD_(ULONG,AddRef)(THIS);
- STDMETHOD_(ULONG,Release)(THIS);
-
- STDMETHOD(ContextSensitiveHelp) (BOOL fEnterMode);
- STDMETHOD(GetNewStorage) (LPSTORAGE FAR *lplpstg);
- STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME FAR *lplpFrame, LPOLEINPLACEUIWINDOW FAR *lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo);
- STDMETHOD(ShowContainerUI) (BOOL fShow);
- STDMETHOD(QueryInsertObject) (LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp);
- STDMETHOD(DeleteObject) (LPOLEOBJECT lpoleobj);
- STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
- STDMETHOD(GetClipboardData) (CHARRANGE FAR *lpchrg, DWORD reco, LPDATAOBJECT FAR *lplpdataobj);
- STDMETHOD(GetDragDropEffect) (BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect);
- STDMETHOD(GetContextMenu) (WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR *lpchrg, HMENU FAR *lphmenu);
-};
-
-struct CREOleCallback2 : public CREOleCallback
-{
- STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
-};
-
INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int DbEventIsShown(DBEVENTINFO &dbei);
int DbEventIsCustomForMsgWindow(DBEVENTINFO *dbei);
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h
index 7100a13efb..d6ff0fed26 100644
--- a/plugins/Scriver/src/stdafx.h
+++ b/plugins/Scriver/src/stdafx.h
@@ -120,7 +120,4 @@ int StatusIconPressed(WPARAM wParam, LPARAM lParam);
extern GlobalMessageData g_dat;
-extern CREOleCallback reOleCallback;
-extern CREOleCallback2 reOleCallback2;
-
#endif