-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a14e8a3
Showing
561 changed files
with
677,310 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
#pragma once | ||
|
||
class CFBEView; | ||
class TDocHostUIHandler : public IDocHostUIHandler | ||
{ | ||
public: | ||
TDocHostUIHandler(); | ||
~TDocHostUIHandler(); | ||
|
||
bool AttachToBrowser(CFBEView* view); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID classid, void** intf); | ||
virtual ULONG STDMETHODCALLTYPE AddRef(); | ||
virtual ULONG STDMETHODCALLTYPE Release(); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE ShowContextMenu( | ||
/* [in] */ DWORD dwID, | ||
/* [in] */ POINT __RPC_FAR *ppt, | ||
/* [in] */ IUnknown __RPC_FAR *pcmdtReserved, | ||
/* [in] */ IDispatch __RPC_FAR *pdispReserved); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE GetHostInfo( | ||
/* [out][in] */ DOCHOSTUIINFO __RPC_FAR *pInfo); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE ShowUI( | ||
/* [in] */ DWORD dwID, | ||
/* [in] */ IOleInPlaceActiveObject __RPC_FAR *pActiveObject, | ||
/* [in] */ IOleCommandTarget __RPC_FAR *pCommandTarget, | ||
/* [in] */ IOleInPlaceFrame __RPC_FAR *pFrame, | ||
/* [in] */ IOleInPlaceUIWindow __RPC_FAR *pDoc); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE HideUI(void); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE UpdateUI(void); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE EnableModeless( | ||
/* [in] */ BOOL fEnable); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE OnDocWindowActivate( | ||
/* [in] */ BOOL fActivate); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE OnFrameWindowActivate( | ||
/* [in] */ BOOL fActivate); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE ResizeBorder( | ||
/* [in] */ LPCRECT prcBorder, | ||
/* [in] */ IOleInPlaceUIWindow __RPC_FAR *pUIWindow, | ||
/* [in] */ BOOL fRameWindow); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator( | ||
/* [in] */ LPMSG lpMsg, | ||
/* [in] */ const GUID __RPC_FAR *pguidCmdGroup, | ||
/* [in] */ DWORD nCmdID); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE GetOptionKeyPath( | ||
/* [out] */ LPOLESTR __RPC_FAR *pchKey, | ||
/* [in] */ DWORD dw); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE GetDropTarget( | ||
/* [in] */ IDropTarget __RPC_FAR *pDropTarget, | ||
/* [out] */ IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE GetExternal( | ||
/* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDispatch); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE TranslateUrl( | ||
/* [in] */ DWORD dwTranslate, | ||
/* [in] */ OLECHAR __RPC_FAR *pchURLIn, | ||
/* [out] */ OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE FilterDataObject( | ||
/* [in] */ IDataObject __RPC_FAR *pDO, | ||
/* [out] */ IDataObject __RPC_FAR *__RPC_FAR *ppDORet); | ||
|
||
private: | ||
long refcount; | ||
CFBEView* m_view; | ||
}; | ||
|
||
class TOleCommandTarget : public IOleCommandTarget | ||
{ | ||
public: | ||
TOleCommandTarget(); | ||
~TOleCommandTarget(); | ||
|
||
// IUnknown | ||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID classid, void** intf); | ||
virtual ULONG STDMETHODCALLTYPE AddRef(); | ||
virtual ULONG STDMETHODCALLTYPE Release(); | ||
|
||
// IOleCommandTarget | ||
virtual HRESULT STDMETHODCALLTYPE QueryStatus( | ||
/*[in]*/ const GUID *pguidCmdGroup, | ||
/*[in]*/ ULONG cCmds, | ||
/*[in,out][size_is(cCmds)]*/ OLECMD *prgCmds, | ||
/*[in,out]*/ OLECMDTEXT *pCmdText); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE Exec( | ||
/*[in]*/ const GUID *pguidCmdGroup, | ||
/*[in]*/ DWORD nCmdID, | ||
/*[in]*/ DWORD nCmdExecOpt, | ||
/*[in]*/ VARIANTARG *pvaIn, | ||
/*[in,out]*/ VARIANTARG *pvaOut); | ||
|
||
private: | ||
long refcount; | ||
}; | ||
|
||
|
||
class IBrowserExternal | ||
{ | ||
public: | ||
IBrowserExternal(CFBEView* view):m_view(view) {}; | ||
~IBrowserExternal() {}; | ||
|
||
// our stuff | ||
virtual void STDMETHODCALLTYPE BeginUndoUnit(IDispatch* doc, BSTR name); | ||
virtual void STDMETHODCALLTYPE EndUndoUnit(IDispatch* doc); | ||
virtual bool STDMETHODCALLTYPE SaveBinary(BSTR path, BSTR data); | ||
virtual int STDMETHODCALLTYPE GetBinarySize(BSTR data); | ||
virtual BSTR STDMETHODCALLTYPE GetUUID(); | ||
virtual void STDMETHODCALLTYPE InflateParagraphs(IDispatch* elem); | ||
virtual void STDMETHODCALLTYPE MsgBox(BSTR message); | ||
virtual bool STDMETHODCALLTYPE AskYesNo(BSTR message); | ||
virtual bool STDMETHODCALLTYPE inflateBlock(IDispatch* element); | ||
virtual BSTR STDMETHODCALLTYPE GetStylePath(); | ||
// Ýòà ôóíêöèÿ ðåàëüíî íå èñïîëüçóåòñÿ â ñêðèïòàõ | ||
//virtual BSTR STDMETHODCALLTYPE GenrePopup(IHTMLDocument2Ptr doc); | ||
private: | ||
CFBEView* m_view; | ||
}; | ||
class TExternalDispatch : public IDispatch | ||
{ | ||
public: | ||
TExternalDispatch(CFBEView* view); | ||
~TExternalDispatch(); | ||
|
||
// IUnknown | ||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID classid, void** intf); | ||
virtual ULONG STDMETHODCALLTYPE AddRef(); | ||
virtual ULONG STDMETHODCALLTYPE Release(); | ||
|
||
//IDispatch | ||
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT* pctinfo); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(/* [in] */ UINT iTInfo, | ||
/* [in] */ LCID lcid, | ||
/* [out] */ ITypeInfo** ppTInfo); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( | ||
/* [in] */ REFIID riid, | ||
/* [size_is][in] */ LPOLESTR *rgszNames, | ||
/* [in] */ UINT cNames, | ||
/* [in] */ LCID lcid, | ||
/* [size_is][out] */ DISPID *rgDispId); | ||
|
||
virtual HRESULT STDMETHODCALLTYPE Invoke( | ||
/* [in] */ DISPID dispIdMember, | ||
/* [in] */ REFIID riid, | ||
/* [in] */ LCID lcid, | ||
/* [in] */ WORD wFlags, | ||
/* [out][in] */ DISPPARAMS *pDispParams, | ||
/* [out] */ VARIANT *pVarResult, | ||
/* [out] */ EXCEPINFO *pExcepInfo, | ||
/* [out] */ UINT *puArgErr); | ||
|
||
private: | ||
long refcount; | ||
CFBEView* m_view; | ||
IBrowserExternal* BrowserExternal; | ||
ITypeInfo* TypeInfo; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef CONTAINERWND_H | ||
#define CONTAINERWND_H | ||
|
||
#if _MSC_VER >= 1000 | ||
#pragma once | ||
#endif // _MSC_VER >= 1000 | ||
|
||
typedef CWinTraits<WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,WS_EX_CLIENTEDGE> | ||
CContainerWndTraits; | ||
|
||
class CContainerWnd : public CWindowImpl<CContainerWnd,CWindow,CContainerWndTraits> | ||
{ | ||
public: | ||
DECLARE_WND_CLASS_EX(NULL, CS_DBLCLKS, COLOR_WINDOW) | ||
|
||
typedef CWindowImpl<CContainerWnd,CWindow,CContainerWndTraits> baseClass; | ||
BEGIN_MSG_MAP(CContainerWnd) | ||
MESSAGE_HANDLER(WM_ERASEBKGND, OnErase) | ||
MESSAGE_HANDLER(WM_SIZE,OnSize) | ||
MESSAGE_HANDLER(WM_SETFOCUS,OnFocus) | ||
{ | ||
bHandled = TRUE; | ||
lResult = ForwardNotifications(uMsg, wParam, lParam, bHandled); | ||
} | ||
REFLECT_NOTIFICATIONS() | ||
END_MSG_MAP() | ||
|
||
static BOOL CALLBACK SizeProc(HWND hWnd,LPARAM lParam) { | ||
RECT *rc=(RECT*)lParam; | ||
::MoveWindow(hWnd,0,0,rc->right-rc->left,rc->bottom-rc->top, | ||
TRUE); | ||
return TRUE; | ||
} | ||
|
||
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&) { | ||
RECT rc; | ||
GetClientRect(&rc); | ||
::EnumChildWindows(*this,SizeProc,(LPARAM)&rc); | ||
return 0; | ||
} | ||
|
||
LRESULT OnFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&) { | ||
HWND hWnd=GetActiveWnd(); | ||
if (hWnd!=NULL) | ||
::SetFocus(hWnd); | ||
return 0; | ||
} | ||
|
||
LRESULT OnErase(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&) { | ||
return 1; | ||
} | ||
|
||
static BOOL CALLBACK FindProc(HWND hWnd,LPARAM lParam) { | ||
if (::IsWindowVisible(hWnd)) { | ||
*(HWND*)lParam=hWnd; | ||
return FALSE; | ||
} | ||
return TRUE; | ||
} | ||
|
||
HWND GetActiveWnd() { | ||
HWND hWnd=NULL; | ||
::EnumChildWindows(*this,FindProc,(LPARAM)&hWnd); | ||
if (hWnd==NULL) | ||
hWnd=GetWindow(GW_CHILD); | ||
return hWnd; | ||
} | ||
|
||
void HideActiveWnd() { | ||
HWND hWnd=GetActiveWnd(); | ||
if (hWnd!=NULL) | ||
::ShowWindow(hWnd,SW_HIDE); | ||
} | ||
|
||
void ActivateWnd(HWND hWnd) { | ||
HWND hActive=GetActiveWnd(); | ||
if (hActive!=hWnd && hActive!=NULL) | ||
::ShowWindow(hActive,SW_HIDE); | ||
::ShowWindow(hWnd,SW_SHOW); | ||
} | ||
|
||
void AttachWnd(HWND hWnd) { | ||
::ShowWindow(hWnd,SW_HIDE); | ||
RECT rc; | ||
GetClientRect(&rc); | ||
::MoveWindow(hWnd,rc.left,rc.top, | ||
rc.right-rc.left,rc.bottom-rc.top, | ||
TRUE); | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// CustomStatic.cpp : Implementation of CCustomStatic | ||
#include "stdafx.h" | ||
#include "CustomStatic.h" | ||
|
||
|
||
// CCustomStatic |
Oops, something went wrong.