From 31acde69d1404355f9f871242a4d0a50e437c07e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 19 Jul 2015 13:21:48 +0000 Subject: [PATCH] [HHCTRL.OCX] Sync with Wine Staging 1.7.47. CORE-9924 svn path=/trunk/; revision=68432 --- reactos/dll/win32/hhctrl.ocx/help.c | 16 +- reactos/dll/win32/hhctrl.ocx/hhctrl.c | 1 - reactos/dll/win32/hhctrl.ocx/hhctrl.h | 19 +- reactos/dll/win32/hhctrl.ocx/lang/Cs.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Da.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/De.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/El.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/En.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Es.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Fi.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Fr.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/He.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Hu.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/It.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Ja.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Ko.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Lt.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Nl.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/No.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Pl.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Pt.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Ro.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Ru.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Si.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Sq.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Sv.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Tr.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Uk.rc | 26 +++ reactos/dll/win32/hhctrl.ocx/lang/Zh.rc | 28 +++ reactos/dll/win32/hhctrl.ocx/resource.h | 8 + reactos/dll/win32/hhctrl.ocx/webbrowser.c | 239 ++++++++++++---------- reactos/media/doc/README.WINE | 2 +- 32 files changed, 840 insertions(+), 123 deletions(-) diff --git a/reactos/dll/win32/hhctrl.ocx/help.c b/reactos/dll/win32/hhctrl.ocx/help.c index c7ad4e744ad..17f1eecf7bb 100644 --- a/reactos/dll/win32/hhctrl.ocx/help.c +++ b/reactos/dll/win32/hhctrl.ocx/help.c @@ -54,7 +54,7 @@ struct html_encoded_symbol { * Table mapping the conversion between HTML encoded symbols and their ANSI code page equivalent. * Note: Add additional entries in proper alphabetical order (a binary search is used on this table). */ -struct html_encoded_symbol html_encoded_symbols[] = +static struct html_encoded_symbol html_encoded_symbols[] = { {"AElig", 0xC6}, {"Aacute", 0xC1}, @@ -189,7 +189,7 @@ static HRESULT navigate_url(HHInfo *info, LPCWSTR surl) V_VT(&url) = VT_BSTR; V_BSTR(&url) = SysAllocString(surl); - hres = IWebBrowser2_Navigate2(info->web_browser, &url, 0, 0, 0, 0); + hres = IWebBrowser2_Navigate2(info->web_browser->web_browser, &url, 0, 0, 0, 0); VariantClear(&url); @@ -261,7 +261,7 @@ static void DoSync(HHInfo *info) HRESULT hres; BSTR url; - hres = IWebBrowser2_get_LocationURL(info->web_browser, &url); + hres = IWebBrowser2_get_LocationURL(info->web_browser->web_browser, &url); if (FAILED(hres)) { @@ -867,22 +867,22 @@ static void TB_OnClick(HWND hWnd, DWORD dwID) switch (dwID) { case IDTB_STOP: - DoPageAction(info, WB_STOP); + DoPageAction(info->web_browser, WB_STOP); break; case IDTB_REFRESH: - DoPageAction(info, WB_REFRESH); + DoPageAction(info->web_browser, WB_REFRESH); break; case IDTB_BACK: - DoPageAction(info, WB_GOBACK); + DoPageAction(info->web_browser, WB_GOBACK); break; case IDTB_HOME: NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszHome); break; case IDTB_FORWARD: - DoPageAction(info, WB_GOFORWARD); + DoPageAction(info->web_browser, WB_GOFORWARD); break; case IDTB_PRINT: - DoPageAction(info, WB_PRINT); + DoPageAction(info->web_browser, WB_PRINT); break; case IDTB_EXPAND: case IDTB_CONTRACT: diff --git a/reactos/dll/win32/hhctrl.ocx/hhctrl.c b/reactos/dll/win32/hhctrl.ocx/hhctrl.c index 5e97c8cbdd8..89cda1f96af 100644 --- a/reactos/dll/win32/hhctrl.ocx/hhctrl.c +++ b/reactos/dll/win32/hhctrl.ocx/hhctrl.c @@ -26,7 +26,6 @@ HINSTANCE hhctrl_hinstance; BOOL hh_process = FALSE; -extern struct list window_list; BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved) { diff --git a/reactos/dll/win32/hhctrl.ocx/hhctrl.h b/reactos/dll/win32/hhctrl.ocx/hhctrl.h index 60ed3308d3d..34a9153407c 100644 --- a/reactos/dll/win32/hhctrl.ocx/hhctrl.h +++ b/reactos/dll/win32/hhctrl.ocx/hhctrl.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -175,9 +176,20 @@ struct wintype_stringsA { }; typedef struct { - IOleClientSite *client_site; + IOleClientSite IOleClientSite_iface; + IOleInPlaceSite IOleInPlaceSite_iface; + IOleInPlaceFrame IOleInPlaceFrame_iface; + IDocHostUIHandler IDocHostUIHandler_iface; + + LONG ref; + + IOleObject *ole_obj; IWebBrowser2 *web_browser; - IOleObject *wb_object; + HWND hwndWindow; +} WebBrowserContainer; + +typedef struct { + WebBrowserContainer *web_browser; HH_WINTYPEW WinType; @@ -203,7 +215,7 @@ typedef struct { BOOL InitWebBrowser(HHInfo*,HWND) DECLSPEC_HIDDEN; void ReleaseWebBrowser(HHInfo*) DECLSPEC_HIDDEN; void ResizeWebBrowser(HHInfo*,DWORD,DWORD) DECLSPEC_HIDDEN; -void DoPageAction(HHInfo*,DWORD) DECLSPEC_HIDDEN; +void DoPageAction(WebBrowserContainer*,DWORD) DECLSPEC_HIDDEN; void InitContent(HHInfo*) DECLSPEC_HIDDEN; void ReleaseContent(HHInfo*) DECLSPEC_HIDDEN; @@ -220,6 +232,7 @@ IStream *GetChmStream(CHMInfo*,LPCWSTR,ChmPath*) DECLSPEC_HIDDEN; LPWSTR FindContextAlias(CHMInfo*,DWORD) DECLSPEC_HIDDEN; WCHAR *GetDocumentTitle(CHMInfo*,LPCWSTR) DECLSPEC_HIDDEN; +extern struct list window_list DECLSPEC_HIDDEN; HHInfo *CreateHelpViewer(HHInfo*,LPCWSTR,HWND) DECLSPEC_HIDDEN; void ReleaseHelpViewer(HHInfo*) DECLSPEC_HIDDEN; BOOL NavigateToUrl(HHInfo*,LPCWSTR) DECLSPEC_HIDDEN; diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Cs.rc b/reactos/dll/win32/hhctrl.ocx/lang/Cs.rc index 857f0f086e4..5d6bf545b4f 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Cs.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Cs.rc @@ -64,3 +64,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Da.rc b/reactos/dll/win32/hhctrl.ocx/lang/Da.rc index f6cf753574a..c775b341250 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Da.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Da.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/De.rc b/reactos/dll/win32/hhctrl.ocx/lang/De.rc index 6086bfd9e10..e24593d1124 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/De.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/De.rc @@ -62,3 +62,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/El.rc b/reactos/dll/win32/hhctrl.ocx/lang/El.rc index 26f706522c2..08a441a8f56 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/El.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/El.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/En.rc b/reactos/dll/win32/hhctrl.ocx/lang/En.rc index 5b6d06dae7c..bad46bdf247 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/En.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/En.rc @@ -61,3 +61,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Es.rc b/reactos/dll/win32/hhctrl.ocx/lang/Es.rc index fb19bfbd1ba..e407f9cbaa0 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Es.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Es.rc @@ -63,3 +63,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Fi.rc b/reactos/dll/win32/hhctrl.ocx/lang/Fi.rc index ec2bf44eff0..606406bd880 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Fi.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Fi.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Fr.rc b/reactos/dll/win32/hhctrl.ocx/lang/Fr.rc index 1546945eeef..e6f3f98f47a 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Fr.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Fr.rc @@ -63,3 +63,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/He.rc b/reactos/dll/win32/hhctrl.ocx/lang/He.rc index 8010c0ceaae..4a537c52006 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/He.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/He.rc @@ -62,3 +62,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Hu.rc b/reactos/dll/win32/hhctrl.ocx/lang/Hu.rc index 2ddc8800608..3d3a61309ee 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Hu.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Hu.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/It.rc b/reactos/dll/win32/hhctrl.ocx/lang/It.rc index 8679fe4cfbb..5db3638f9ae 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/It.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/It.rc @@ -64,3 +64,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Ja.rc b/reactos/dll/win32/hhctrl.ocx/lang/Ja.rc index ba3f3be09e8..15bee5d0c7b 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Ja.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Ja.rc @@ -64,3 +64,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Ko.rc b/reactos/dll/win32/hhctrl.ocx/lang/Ko.rc index 44759999ff2..976cb126d43 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Ko.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Ko.rc @@ -61,3 +61,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Lt.rc b/reactos/dll/win32/hhctrl.ocx/lang/Lt.rc index f88b5804d75..a296a587edd 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Lt.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Lt.rc @@ -63,3 +63,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Nl.rc b/reactos/dll/win32/hhctrl.ocx/lang/Nl.rc index daf3afabe90..c9ae349d959 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Nl.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Nl.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/No.rc b/reactos/dll/win32/hhctrl.ocx/lang/No.rc index f20d4f39c0c..7530d27ee41 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/No.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/No.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Pl.rc b/reactos/dll/win32/hhctrl.ocx/lang/Pl.rc index 4859187756b..12528eb3726 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Pl.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Pl.rc @@ -61,3 +61,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Pt.rc b/reactos/dll/win32/hhctrl.ocx/lang/Pt.rc index a8f9f16c836..fc55b82738e 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Pt.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Pt.rc @@ -47,6 +47,32 @@ MENU_POPUP MENU } } +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} + LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN STRINGTABLE diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Ro.rc b/reactos/dll/win32/hhctrl.ocx/lang/Ro.rc index eae92f223ab..4ffa2cbe115 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Ro.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Ro.rc @@ -64,3 +64,29 @@ MENU_POPUP MENU MENUITEM "I&mprimă…", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Ru.rc b/reactos/dll/win32/hhctrl.ocx/lang/Ru.rc index 5226e4ba3fe..f1bbb8fe1ce 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Ru.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Ru.rc @@ -63,3 +63,29 @@ MENU_POPUP MENU MENUITEM "&Печать...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Si.rc b/reactos/dll/win32/hhctrl.ocx/lang/Si.rc index 0fa95924720..a4959dd7a53 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Si.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Si.rc @@ -62,3 +62,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Sq.rc b/reactos/dll/win32/hhctrl.ocx/lang/Sq.rc index b1944056640..1eacfe2c2f9 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Sq.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Sq.rc @@ -63,3 +63,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Sv.rc b/reactos/dll/win32/hhctrl.ocx/lang/Sv.rc index b140fa346bf..74f04bb6a2c 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Sv.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Sv.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc b/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc index b7d08a83ab4..16d639b7a7f 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc @@ -60,3 +60,29 @@ MENU_POPUP MENU MENUITEM "Y&azdır...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Uk.rc b/reactos/dll/win32/hhctrl.ocx/lang/Uk.rc index 2f2bb8fd6b4..46414c469d5 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Uk.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Uk.rc @@ -65,3 +65,29 @@ MENU_POPUP MENU MENUITEM "&Print...", IDTB_PRINT } } + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Zh.rc b/reactos/dll/win32/hhctrl.ocx/lang/Zh.rc index 158f6948a03..6b5f049dd4c 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Zh.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Zh.rc @@ -21,6 +21,34 @@ /* Chinese text is encoded in UTF-8 */ #pragma code_page(65001) +LANGUAGE LANG_CHINESE, SUBLANG_NEUTRAL + +MENU_WEBBROWSER MENU +{ + POPUP "" + { + MENUITEM "&Back", IDTB_BACK + MENUITEM "&Forward", IDTB_FORWARD + MENUITEM SEPARATOR + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM SEPARATOR + MENUITEM "&View Source", MIID_VIEWSOURCE + MENUITEM SEPARATOR + MENUITEM "&Print...", IDTB_PRINT + MENUITEM "&Refresh", IDTB_REFRESH + MENUITEM SEPARATOR + MENUITEM "Proper&ties", MIID_PROPERTIES + } + POPUP "" + { + MENUITEM "Cu&t", MIID_CUT + MENUITEM "&Copy", MIID_COPY + MENUITEM "Paste", MIID_PASTE + MENUITEM "Select &All", MIID_SELECTALL + MENUITEM "&Print", IDTB_PRINT + } +} + LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED STRINGTABLE diff --git a/reactos/dll/win32/hhctrl.ocx/resource.h b/reactos/dll/win32/hhctrl.ocx/resource.h index b825a3262ed..1a1ca0ed221 100644 --- a/reactos/dll/win32/hhctrl.ocx/resource.h +++ b/reactos/dll/win32/hhctrl.ocx/resource.h @@ -28,6 +28,7 @@ #define IDS_SHOWTABS 6 #define MENU_POPUP 1 +#define MENU_WEBBROWSER 2 #define IDB_HHTOOLBAR 1000 /* IDB_HHTOOLBAR bitmaps: */ @@ -39,6 +40,13 @@ #define HHTB_EXPAND 5 #define HHTB_NUMBITMAPS HHTB_EXPAND +#define MIID_SELECTALL 10 +#define MIID_VIEWSOURCE 11 +#define MIID_PROPERTIES 12 +#define MIID_CUT 13 +#define MIID_COPY 14 +#define MIID_PASTE 15 + #define IDB_HHTREEVIEW 1001 /* IDB_HHTREEVIEW bitmaps: */ #define HHTV_DOCUMENT 0 diff --git a/reactos/dll/win32/hhctrl.ocx/webbrowser.c b/reactos/dll/win32/hhctrl.ocx/webbrowser.c index afa213d8bc9..0ffc69898bb 100644 --- a/reactos/dll/win32/hhctrl.ocx/webbrowser.c +++ b/reactos/dll/win32/hhctrl.ocx/webbrowser.c @@ -22,31 +22,14 @@ #include -typedef struct IOleClientSiteImpl +static inline WebBrowserContainer *impl_from_IOleClientSite(IOleClientSite *iface) { - IOleClientSite IOleClientSite_iface; - IOleInPlaceSite IOleInPlaceSite_iface; - IOleInPlaceFrame IOleInPlaceFrame_iface; - IDocHostUIHandler IDocHostUIHandler_iface; - - /* IOleClientSiteImpl data */ - IOleObject *pBrowserObject; - LONG ref; - - /* IOleInPlaceFrame data */ - HWND hwndWindow; -} IOleClientSiteImpl; - -static inline IOleClientSiteImpl *impl_from_IOleClientSite(IOleClientSite *iface) -{ - return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleClientSite_iface); + return CONTAINING_RECORD(iface, WebBrowserContainer, IOleClientSite_iface); } static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppvObj) { - IOleClientSiteImpl *This = impl_from_IOleClientSite(iface); - - *ppvObj = NULL; + WebBrowserContainer *This = impl_from_IOleClientSite(iface); if (IsEqualIID(riid, &IID_IUnknown)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppvObj); @@ -65,6 +48,7 @@ static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFI *ppvObj = &This->IDocHostUIHandler_iface; }else { TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj); + *ppvObj = NULL; return E_NOINTERFACE; } @@ -74,7 +58,7 @@ static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFI static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface) { - IOleClientSiteImpl *This = impl_from_IOleClientSite(iface); + WebBrowserContainer *This = impl_from_IOleClientSite(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -84,13 +68,18 @@ static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface) static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite *iface) { - IOleClientSiteImpl *This = impl_from_IOleClientSite(iface); + WebBrowserContainer *This = impl_from_IOleClientSite(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); - if(!ref) + if(!ref) { + if(This->ole_obj) + IOleObject_Release(This->ole_obj); + if(This->web_browser) + IWebBrowser2_Release(This->web_browser); heap_free(This); + } return ref; } @@ -127,7 +116,7 @@ static HRESULT STDMETHODCALLTYPE Site_RequestNewObjectLayout(IOleClientSite *ifa return E_NOTIMPL; } -static const IOleClientSiteVtbl MyIOleClientSiteTable = +static const IOleClientSiteVtbl OleClientSiteVtbl = { Site_QueryInterface, Site_AddRef, @@ -140,34 +129,87 @@ static const IOleClientSiteVtbl MyIOleClientSiteTable = Site_RequestNewObjectLayout }; -static inline IOleClientSiteImpl *impl_from_IDocHostUIHandler(IDocHostUIHandler *iface) +static inline WebBrowserContainer *impl_from_IDocHostUIHandler(IDocHostUIHandler *iface) { - return CONTAINING_RECORD(iface, IOleClientSiteImpl, IDocHostUIHandler_iface); + return CONTAINING_RECORD(iface, WebBrowserContainer, IDocHostUIHandler_iface); } static HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler *iface, REFIID riid, LPVOID *ppvObj) { - IOleClientSiteImpl *This = impl_from_IDocHostUIHandler(iface); + WebBrowserContainer *This = impl_from_IDocHostUIHandler(iface); return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); } static ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler *iface) { - IOleClientSiteImpl *This = impl_from_IDocHostUIHandler(iface); + WebBrowserContainer *This = impl_from_IDocHostUIHandler(iface); return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler * iface) { - IOleClientSiteImpl *This = impl_from_IDocHostUIHandler(iface); + WebBrowserContainer *This = impl_from_IDocHostUIHandler(iface); return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved) { + WebBrowserContainer *This = impl_from_IDocHostUIHandler(iface); + DWORD cmdid, menu_id = 0; + HMENU menu, submenu; + + TRACE("(%p)->(%d %s)\n", This, dwID, wine_dbgstr_point(ppt)); + + menu = LoadMenuW(hhctrl_hinstance, MAKEINTRESOURCEW(MENU_WEBBROWSER)); + if (!menu) + return S_OK; + + /* FIXME: Support more menu types. */ + if(dwID == CONTEXT_MENU_TEXTSELECT) + menu_id = 1; + + submenu = GetSubMenu(menu, menu_id); + + cmdid = TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, + ppt->x, ppt->y, 0, This->hwndWindow, NULL); + DestroyMenu(menu); + + switch(cmdid) { + case IDTB_BACK: + DoPageAction(This, WB_GOBACK); + break; + case IDTB_FORWARD: + DoPageAction(This, WB_GOFORWARD); + break; + case MIID_SELECTALL: + IWebBrowser2_ExecWB(This->web_browser, OLECMDID_SELECTALL, 0, NULL, NULL); + break; + case MIID_VIEWSOURCE: + FIXME("View source\n"); + break; + case IDTB_PRINT: + DoPageAction(This, WB_PRINT); + break; + case IDTB_REFRESH: + DoPageAction(This, WB_REFRESH); + break; + case MIID_PROPERTIES: + FIXME("Properties\n"); + break; + case MIID_COPY: + IWebBrowser2_ExecWB(This->web_browser, OLECMDID_COPY, 0, NULL, NULL); + break; + case MIID_PASTE: + IWebBrowser2_ExecWB(This->web_browser, OLECMDID_PASTE, 0, NULL, NULL); + break; + case MIID_CUT: + IWebBrowser2_ExecWB(This->web_browser, OLECMDID_CUT, 0, NULL, NULL); + break; + } + return S_OK; } @@ -248,7 +290,7 @@ static HRESULT STDMETHODCALLTYPE UI_FilterDataObject(IDocHostUIHandler *iface, I return S_FALSE; } -static const IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable = +static const IDocHostUIHandlerVtbl DocHostUIHandlerVtbl = { UI_QueryInterface, UI_AddRef, @@ -270,37 +312,37 @@ static const IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable = UI_FilterDataObject }; -static inline IOleClientSiteImpl *impl_from_IOleInPlaceSite(IOleInPlaceSite *iface) +static inline WebBrowserContainer *impl_from_IOleInPlaceSite(IOleInPlaceSite *iface) { - return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleInPlaceSite_iface); + return CONTAINING_RECORD(iface, WebBrowserContainer, IOleInPlaceSite_iface); } static HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite *iface, REFIID riid, LPVOID *ppvObj) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); } static ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite *iface) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite *iface) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite *iface, HWND *lphwnd) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - *lphwnd = This->hwndWindow; + WebBrowserContainer *This = impl_from_IOleInPlaceSite(iface); + *lphwnd = This->hwndWindow; return S_OK; } @@ -326,7 +368,7 @@ static HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite *iface) static HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite *iface, LPOLEINPLACEFRAME *lplpFrame, LPOLEINPLACEUIWINDOW *lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceSite(iface); *lplpFrame = &This->IOleInPlaceFrame_iface; IOleInPlaceFrame_AddRef(&This->IOleInPlaceFrame_iface); @@ -368,10 +410,10 @@ static HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite *ifac static HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite *iface, LPCRECT lprcPosRect) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceSite(iface); IOleInPlaceObject *inplace; - if (IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject, + if (IOleObject_QueryInterface(This->ole_obj, &IID_IOleInPlaceObject, (void **)&inplace) == S_OK) { IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect); @@ -381,7 +423,7 @@ static HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite *iface, return S_OK; } -static const IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable = +static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = { InPlace_QueryInterface, InPlace_AddRef, @@ -400,37 +442,37 @@ static const IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable = InPlace_OnPosRectChange }; -static inline IOleClientSiteImpl *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface) +static inline WebBrowserContainer *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface) { - return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleInPlaceFrame_iface); + return CONTAINING_RECORD(iface, WebBrowserContainer, IOleInPlaceFrame_iface); } static HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, LPVOID *ppvObj) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceFrame(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceFrame(iface); return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); } static ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame *iface) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceFrame(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceFrame(iface); return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame *iface) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceFrame(iface); + WebBrowserContainer *This = impl_from_IOleInPlaceFrame(iface); return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame *iface, HWND *lphwnd) { - IOleClientSiteImpl *This = impl_from_IOleInPlaceFrame(iface); - *lphwnd = This->hwndWindow; + WebBrowserContainer *This = impl_from_IOleInPlaceFrame(iface); + *lphwnd = This->hwndWindow; return S_OK; } @@ -489,7 +531,7 @@ static HRESULT STDMETHODCALLTYPE Frame_TranslateAccelerator(IOleInPlaceFrame *if return E_NOTIMPL; } -static const IOleInPlaceFrameVtbl MyIOleInPlaceFrameTable = +static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = { Frame_QueryInterface, Frame_AddRef, @@ -624,97 +666,76 @@ static IStorage MyIStorage = { &MyIStorageTable }; BOOL InitWebBrowser(HHInfo *info, HWND hwndParent) { - IOleClientSiteImpl *iOleClientSiteImpl; + WebBrowserContainer *container; IOleInPlaceObject *inplace; - IOleObject *browserObject; - IWebBrowser2 *webBrowser2; HRESULT hr; RECT rc; - iOleClientSiteImpl = heap_alloc_zero(sizeof(IOleClientSiteImpl)); - if (!iOleClientSiteImpl) + container = heap_alloc_zero(sizeof(*container)); + if (!container) return FALSE; - iOleClientSiteImpl->ref = 1; - iOleClientSiteImpl->IOleClientSite_iface.lpVtbl = &MyIOleClientSiteTable; - iOleClientSiteImpl->IOleInPlaceSite_iface.lpVtbl = &MyIOleInPlaceSiteTable; - iOleClientSiteImpl->IOleInPlaceFrame_iface.lpVtbl = &MyIOleInPlaceFrameTable; - iOleClientSiteImpl->hwndWindow = hwndParent; - iOleClientSiteImpl->IDocHostUIHandler_iface.lpVtbl = &MyIDocHostUIHandlerTable; + container->IOleClientSite_iface.lpVtbl = &OleClientSiteVtbl; + container->IOleInPlaceSite_iface.lpVtbl = &OleInPlaceSiteVtbl; + container->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl; + container->IDocHostUIHandler_iface.lpVtbl = &DocHostUIHandlerVtbl; + container->ref = 1; + container->hwndWindow = hwndParent; - hr = OleCreate(&CLSID_WebBrowser, &IID_IOleObject, OLERENDER_DRAW, 0, - &iOleClientSiteImpl->IOleClientSite_iface, &MyIStorage, - (void **)&browserObject); + info->web_browser = container; - info->client_site = &iOleClientSiteImpl->IOleClientSite_iface; - info->wb_object = browserObject; + hr = OleCreate(&CLSID_WebBrowser, &IID_IOleObject, OLERENDER_DRAW, 0, + &container->IOleClientSite_iface, &MyIStorage, + (void **)&container->ole_obj); if (FAILED(hr)) goto error; - /* make the browser object accessible to the IOleClientSite implementation */ - iOleClientSiteImpl->pBrowserObject = browserObject; - GetClientRect(hwndParent, &rc); - hr = OleSetContainedObject((struct IUnknown *)browserObject, TRUE); + hr = OleSetContainedObject((struct IUnknown *)container->ole_obj, TRUE); if (FAILED(hr)) goto error; - hr = IOleObject_DoVerb(browserObject, OLEIVERB_SHOW, NULL, - &iOleClientSiteImpl->IOleClientSite_iface, - -1, hwndParent, &rc); + hr = IOleObject_DoVerb(container->ole_obj, OLEIVERB_SHOW, NULL, + &container->IOleClientSite_iface, -1, hwndParent, &rc); if (FAILED(hr)) goto error; - hr = IOleObject_QueryInterface(browserObject, &IID_IOleInPlaceObject, (void**)&inplace); + hr = IOleObject_QueryInterface(container->ole_obj, &IID_IOleInPlaceObject, (void**)&inplace); if (FAILED(hr)) goto error; IOleInPlaceObject_SetObjectRects(inplace, &rc, &rc); IOleInPlaceObject_Release(inplace); - hr = IOleObject_QueryInterface(browserObject, &IID_IWebBrowser2, - (void **)&webBrowser2); + hr = IOleObject_QueryInterface(container->ole_obj, &IID_IWebBrowser2, (void **)&container->web_browser); if (SUCCEEDED(hr)) - { - info->web_browser = webBrowser2; return TRUE; - } error: ReleaseWebBrowser(info); - heap_free(iOleClientSiteImpl); - return FALSE; } void ReleaseWebBrowser(HHInfo *info) { + WebBrowserContainer *container = info->web_browser; HRESULT hres; - if (info->web_browser) - { - IWebBrowser2_Release(info->web_browser); - info->web_browser = NULL; - } - - if (info->client_site) - { - IOleClientSite_Release(info->client_site); - info->client_site = NULL; - } + if(!container) + return; - if(info->wb_object) { + if(container->ole_obj) { IOleInPlaceSite *inplace; - hres = IOleObject_QueryInterface(info->wb_object, &IID_IOleInPlaceSite, (void**)&inplace); + hres = IOleObject_QueryInterface(container->ole_obj, &IID_IOleInPlaceSite, (void**)&inplace); if(SUCCEEDED(hres)) { IOleInPlaceSite_OnInPlaceDeactivate(inplace); IOleInPlaceSite_Release(inplace); } - IOleObject_SetClientSite(info->wb_object, NULL); - - IOleObject_Release(info->wb_object); - info->wb_object = NULL; + IOleObject_SetClientSite(container->ole_obj, NULL); } + + info->web_browser = NULL; + IOleClientSite_Release(&container->IOleClientSite_iface); } void ResizeWebBrowser(HHInfo *info, DWORD dwWidth, DWORD dwHeight) @@ -722,39 +743,37 @@ void ResizeWebBrowser(HHInfo *info, DWORD dwWidth, DWORD dwHeight) if (!info->web_browser) return; - IWebBrowser2_put_Width(info->web_browser, dwWidth); - IWebBrowser2_put_Height(info->web_browser, dwHeight); + IWebBrowser2_put_Width(info->web_browser->web_browser, dwWidth); + IWebBrowser2_put_Height(info->web_browser->web_browser, dwHeight); } -void DoPageAction(HHInfo *info, DWORD dwAction) +void DoPageAction(WebBrowserContainer *container, DWORD dwAction) { - IWebBrowser2 *pWebBrowser2 = info->web_browser; - - if (!pWebBrowser2) + if (!container || !container->web_browser) return; switch (dwAction) { case WB_GOBACK: - IWebBrowser2_GoBack(pWebBrowser2); + IWebBrowser2_GoBack(container->web_browser); break; case WB_GOFORWARD: - IWebBrowser2_GoForward(pWebBrowser2); + IWebBrowser2_GoForward(container->web_browser); break; case WB_GOHOME: - IWebBrowser2_GoHome(pWebBrowser2); + IWebBrowser2_GoHome(container->web_browser); break; case WB_SEARCH: - IWebBrowser2_GoSearch(pWebBrowser2); + IWebBrowser2_GoSearch(container->web_browser); break; case WB_REFRESH: - IWebBrowser2_Refresh(pWebBrowser2); + IWebBrowser2_Refresh(container->web_browser); break; case WB_STOP: - IWebBrowser2_Stop(pWebBrowser2); + IWebBrowser2_Stop(container->web_browser); break; case WB_PRINT: - IWebBrowser2_ExecWB(pWebBrowser2, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); + IWebBrowser2_ExecWB(container->web_browser, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); break; } } diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index d27234550da..a5c27276d24 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -71,7 +71,7 @@ reactos/dll/win32/faultrep # Synced to WineStaging-1.7.37 reactos/dll/win32/fltlib # Synced to WineStaging-1.7.47 reactos/dll/win32/fusion # Synced to WineStaging-1.7.47 reactos/dll/win32/gdiplus # Synced to WineStaging-1.7.37 -reactos/dll/win32/hhctrl.ocx # Synced to WineStaging-1.7.37 +reactos/dll/win32/hhctrl.ocx # Synced to WineStaging-1.7.47 reactos/dll/win32/hlink # Synced to WineStaging-1.7.37 reactos/dll/win32/hnetcfg # Synced to WineStaging-1.7.37 reactos/dll/win32/httpapi # Synced to WineStaging-1.7.37 -- 2.17.1