mirror of https://github.com/BOINC/boinc.git
HTMLGFX: Remove obsolete source files
This commit is contained in:
parent
39d2870860
commit
ad9616e143
|
@ -1,194 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2012 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define _ATL_FREE_THREADED
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
|
||||
#include <AtlBase.h>
|
||||
#include <AtlCom.h>
|
||||
#include <AtlCtl.h>
|
||||
#include <AtlWin.h>
|
||||
#include <AtlStr.h>
|
||||
#include <AtlFile.h>
|
||||
#include <AtlTypes.h>
|
||||
#include <exdisp.h>
|
||||
#include <exdispid.h>
|
||||
#include <string>
|
||||
#include "win_util.h"
|
||||
#include "version.h"
|
||||
#include "boinc_api.h"
|
||||
#include "diagnostics.h"
|
||||
#include "filesys.h"
|
||||
#include "vboxhtmlgfx_win.h"
|
||||
#include "vboxlogging.h"
|
||||
#include "vboxcheckpoint.h"
|
||||
#include "browserctrl_win.h"
|
||||
|
||||
|
||||
CWndClassInfo& CHTMLBrowserHost::GetWndClassInfo()
|
||||
{
|
||||
static CWndClassInfo wc =
|
||||
{
|
||||
{ sizeof(WNDCLASSEX), 0, StartWindowProc, 0, 0, 0, 0, 0, (HBRUSH)(COLOR_WINDOW + 1), 0, NULL, 0 },
|
||||
NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
|
||||
};
|
||||
return wc;
|
||||
}
|
||||
|
||||
HWND CHTMLBrowserHost::Create(
|
||||
HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, LPVOID lpCreateParam
|
||||
){
|
||||
HWND hWnd;
|
||||
|
||||
ATOM atom = GetWndClassInfo().Register(&m_pfnSuperWindowProc);
|
||||
if (!atom)
|
||||
return NULL;
|
||||
|
||||
// Allocate the thunk structure here, where we can fail gracefully.
|
||||
BOOL result = m_thunk.Init(NULL,NULL);
|
||||
if (result == FALSE)
|
||||
{
|
||||
SetLastError(ERROR_OUTOFMEMORY);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_AtlWinModule.AddCreateWndData(&m_thunk.cd, this);
|
||||
|
||||
dwStyle = GetWndStyle(dwStyle);
|
||||
dwExStyle = GetWndExStyle(dwExStyle);
|
||||
|
||||
// set caption
|
||||
if (szWindowName == NULL)
|
||||
{
|
||||
szWindowName = GetWndCaption();
|
||||
}
|
||||
|
||||
// create window
|
||||
hWnd = CWindow::Create((LPCTSTR)atom, hWndParent, rect, szWindowName, dwStyle, dwExStyle, MenuOrID, lpCreateParam);
|
||||
|
||||
// register external dispatch
|
||||
SetExternalDispatch((IHTMLBrowserHostUI*)this);
|
||||
|
||||
return hWnd;
|
||||
}
|
||||
|
||||
void CHTMLBrowserHost::FinalRelease()
|
||||
{
|
||||
SetExternalDispatch(NULL);
|
||||
ReleaseAll();
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP CHTMLBrowserHost::Log(
|
||||
VARIANT* pvaLog
|
||||
){
|
||||
vboxlog_msg("%S", pvaLog->bstrVal);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CHTMLBrowserHost::ShowMessage(
|
||||
HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT *plResult
|
||||
){
|
||||
vboxlog_msg(
|
||||
"Show Message:\n"
|
||||
" Caption: %S\n"
|
||||
" Text: %S\n",
|
||||
lpstrCaption,
|
||||
lpstrText
|
||||
);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CHTMLBrowserHost::ShowHelp(
|
||||
HWND hwnd, LPOLESTR pszHelpFile, UINT uCommand, DWORD dwData, POINT ptMouse, IDispatch *pDispatchObjectHit
|
||||
){
|
||||
return S_OK;
|
||||
};
|
||||
|
||||
STDMETHODIMP CHTMLBrowserHost::QueryStatus(
|
||||
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText
|
||||
){
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
STDMETHODIMP CHTMLBrowserHost::Exec(
|
||||
const GUID* pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG* pvaIn, VARIANTARG* pvaOut
|
||||
){
|
||||
HRESULT hr = S_OK;
|
||||
if (pguidCmdGroup && IsEqualGUID(*pguidCmdGroup, CGID_DocHostCommandHandler))
|
||||
{
|
||||
switch (nCmdID)
|
||||
{
|
||||
case OLECMDID_SHOWSCRIPTERROR:
|
||||
{
|
||||
CComPtr<IHTMLDocument2> pDoc;
|
||||
CComPtr<IHTMLWindow2> pWindow;
|
||||
CComPtr<IHTMLEventObj> pEventObj;
|
||||
CComBSTR rgwszNames[5] =
|
||||
{ L"errorLine", L"errorCharacter", L"errorCode", L"errorMessage", L"errorUrl" };
|
||||
CComVariant rgvaEventInfo[5];
|
||||
DISPID rgDispIDs[5];
|
||||
DISPPARAMS params;
|
||||
|
||||
params.cArgs = 0;
|
||||
params.cNamedArgs = 0;
|
||||
|
||||
// Get the document that is currently being viewed.
|
||||
hr = pvaIn->punkVal->QueryInterface(IID_IHTMLDocument2, (void **) &pDoc);
|
||||
// Get document.parentWindow.
|
||||
hr = pDoc->get_parentWindow(&pWindow);
|
||||
// Get the window.event object.
|
||||
hr = pWindow->get_event(&pEventObj);
|
||||
// Get the error info from the window.event object.
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
// Get the property's dispID.
|
||||
hr = pEventObj->GetIDsOfNames(IID_NULL, &rgwszNames[i], 1, LOCALE_SYSTEM_DEFAULT, &rgDispIDs[i]);
|
||||
// Get the value of the property.
|
||||
hr = pEventObj->Invoke(rgDispIDs[i], IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, ¶ms, &rgvaEventInfo[i], NULL, NULL);
|
||||
SysFreeString(rgwszNames[i]);
|
||||
}
|
||||
|
||||
vboxlog_msg(
|
||||
"Show Script Error:\n"
|
||||
" URL: %S\n"
|
||||
" Message: %S\n"
|
||||
" Error Code: %d\n"
|
||||
" Error Line: %d\n"
|
||||
" Error Position: %d",
|
||||
rgvaEventInfo[4].bstrVal,
|
||||
rgvaEventInfo[3].bstrVal,
|
||||
rgvaEventInfo[2].uiVal,
|
||||
rgvaEventInfo[0].uiVal,
|
||||
rgvaEventInfo[1].uiVal
|
||||
);
|
||||
|
||||
// Stop running scripts on the page.
|
||||
(*pvaOut).vt = VT_BOOL;
|
||||
(*pvaOut).boolVal = VARIANT_FALSE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
hr = OLECMDERR_E_NOTSUPPORTED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = OLECMDERR_E_UNKNOWNGROUP;
|
||||
}
|
||||
return hr;
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2015 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef _BROWSERCTRL_WIN_H_
|
||||
#define _BROWSERCTRL_WIN_H_
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// IBrowserHostUI interface
|
||||
|
||||
MIDL_INTERFACE("A7275E6E-DE3D-4107-B34F-C4C28411A6F0")
|
||||
IHTMLBrowserHostUI : public IDispatch
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE Log(VARIANT* pvaLog) = 0;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CHTMLBrowserHost class
|
||||
|
||||
class ATL_NO_VTABLE CHTMLBrowserHost :
|
||||
public CAxHostWindow,
|
||||
public IDocHostShowUI,
|
||||
public IOleCommandTarget,
|
||||
public IDispatchImpl<IHTMLBrowserHostUI>
|
||||
{
|
||||
public:
|
||||
DECLARE_NO_REGISTRY()
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
DECLARE_POLY_AGGREGATABLE(CHTMLBrowserHost)
|
||||
DECLARE_GET_CONTROLLING_UNKNOWN()
|
||||
|
||||
BEGIN_COM_MAP(CHTMLBrowserHost)
|
||||
COM_INTERFACE_ENTRY(IHTMLBrowserHostUI)
|
||||
COM_INTERFACE_ENTRY(IDocHostShowUI)
|
||||
COM_INTERFACE_ENTRY(IOleCommandTarget)
|
||||
COM_INTERFACE_ENTRY_CHAIN(CAxHostWindow)
|
||||
END_COM_MAP()
|
||||
|
||||
|
||||
static CWndClassInfo& GetWndClassInfo();
|
||||
|
||||
|
||||
HWND Create(HWND hWndParent, _U_RECT rect = NULL, LPCTSTR szWindowName = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, _U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL);
|
||||
void FinalRelease();
|
||||
|
||||
|
||||
// COM Interface - IHTMLBrowserHostUI
|
||||
// Provide a basic set of services to HTML based applications
|
||||
//
|
||||
STDMETHOD(Log)(VARIANT* pvaLog);
|
||||
|
||||
|
||||
// COM Interface - IDocHostShowUI
|
||||
// http://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx
|
||||
//
|
||||
STDMETHOD(ShowMessage)(HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT *plResult);
|
||||
STDMETHOD(ShowHelp)(HWND hwnd, LPOLESTR pszHelpFile, UINT uCommand, DWORD dwData, POINT ptMouse, IDispatch *pDispatchObjectHit);
|
||||
|
||||
|
||||
// COM Interface - IOleCommandTarget
|
||||
// http://support.microsoft.com/kb/261003
|
||||
//
|
||||
STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText);
|
||||
STDMETHOD(Exec)(const GUID* pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG* pvaIn, VARIANTARG* pvaOut);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,183 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2012 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define _ATL_FREE_THREADED
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
|
||||
#include <AtlBase.h>
|
||||
#include <AtlCom.h>
|
||||
#include <AtlCtl.h>
|
||||
#include <AtlWin.h>
|
||||
#include <AtlStr.h>
|
||||
#include <AtlFile.h>
|
||||
#include <AtlTypes.h>
|
||||
#include <exdisp.h>
|
||||
#include <exdispid.h>
|
||||
#include <string>
|
||||
#include "win_util.h"
|
||||
#include "version.h"
|
||||
#include "boinc_api.h"
|
||||
#include "diagnostics.h"
|
||||
#include "filesys.h"
|
||||
#include "vboxhtmlgfx_win.h"
|
||||
#include "vboxlogging.h"
|
||||
#include "vboxcheckpoint.h"
|
||||
#include "browserctrl_win.h"
|
||||
#include "browserwnd_win.h"
|
||||
#include "browsermain_win.h"
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
|
||||
CBrowserModule::CBrowserModule()
|
||||
{
|
||||
m_pWnd = NULL;
|
||||
m_bFullscreen = false;
|
||||
}
|
||||
|
||||
HRESULT CBrowserModule::InitializeCom() throw()
|
||||
{
|
||||
return ::OleInitialize(NULL);
|
||||
}
|
||||
|
||||
void CBrowserModule::UninitializeCom() throw()
|
||||
{
|
||||
::OleUninitialize();
|
||||
}
|
||||
|
||||
HRESULT CBrowserModule::PreMessageLoop(int nShowCmd) throw()
|
||||
{
|
||||
RECT rc = {0, 0, 0, 0};
|
||||
DWORD dwExStyle = 0;
|
||||
DWORD dwStyle = 0;
|
||||
APP_INIT_DATA aid;
|
||||
char szWindowTitle[256];
|
||||
|
||||
|
||||
HRESULT hr = __super::PreMessageLoop(nShowCmd);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Initialize ATL Window Classes
|
||||
//
|
||||
AtlAxWinInit();
|
||||
|
||||
// Prepare environment for detecting system conditions
|
||||
//
|
||||
boinc_parse_init_data_file();
|
||||
boinc_get_init_data(aid);
|
||||
|
||||
// Construct the window caption
|
||||
if (aid.app_version) {
|
||||
snprintf(
|
||||
szWindowTitle, sizeof(szWindowTitle),
|
||||
"%s version %.2f [workunit: %s]",
|
||||
aid.app_name, aid.app_version/100.0, aid.wu_name
|
||||
);
|
||||
} else {
|
||||
snprintf(
|
||||
szWindowTitle, sizeof(szWindowTitle),
|
||||
"%s [workunit: %s]",
|
||||
aid.app_name, aid.wu_name
|
||||
);
|
||||
}
|
||||
|
||||
if (m_bFullscreen) {
|
||||
|
||||
HDC dc = GetDC(NULL);
|
||||
rc.left = 0;
|
||||
rc.top = 0;
|
||||
rc.right = GetDeviceCaps(dc, HORZRES);
|
||||
rc.bottom = GetDeviceCaps(dc, VERTRES);
|
||||
ReleaseDC(NULL, dc);
|
||||
|
||||
dwStyle = WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_POPUP;
|
||||
dwExStyle = WS_EX_APPWINDOW|WS_EX_TOPMOST;
|
||||
while(ShowCursor(false) >= 0);
|
||||
|
||||
} else {
|
||||
|
||||
rc.left = 0;
|
||||
rc.top = 0;
|
||||
rc.right = 800;
|
||||
rc.bottom = 600;
|
||||
|
||||
dwStyle = WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_OVERLAPPEDWINDOW;
|
||||
dwExStyle = WS_EX_APPWINDOW|WS_EX_WINDOWEDGE;
|
||||
while(ShowCursor(true) < 0);
|
||||
|
||||
}
|
||||
|
||||
m_pWnd = new CHTMLBrowserWnd();
|
||||
if (m_pWnd == NULL)
|
||||
{
|
||||
__super::PostMessageLoop();
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
m_pWnd->Create(GetDesktopWindow(), rc, szWindowTitle, dwStyle, dwExStyle);
|
||||
m_pWnd->ShowWindow(nShowCmd);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBrowserModule::PostMessageLoop() throw()
|
||||
{
|
||||
if (m_pWnd)
|
||||
{
|
||||
delete m_pWnd;
|
||||
m_pWnd = NULL;
|
||||
}
|
||||
|
||||
AtlAxWinTerm();
|
||||
|
||||
return __super::PostMessageLoop();
|
||||
}
|
||||
|
||||
int CBrowserModule::BOINCParseCommandLine(int argc, char** argv) {
|
||||
for (int i=1; i<argc; i++) {
|
||||
if (!strcmp(argv[i], "--fullscreen")) {
|
||||
vboxlog_msg("Fullscreen mode requested.");
|
||||
m_bFullscreen = true;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
CBrowserModule _AtlModule;
|
||||
|
||||
|
||||
int run(int argc, char** argv) {
|
||||
_AtlModule.BOINCParseCommandLine(argc, argv);
|
||||
return _AtlModule.WinMain(SW_SHOWDEFAULT);
|
||||
}
|
||||
|
||||
|
||||
extern int main(int, char**);
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) {
|
||||
LPSTR command_line;
|
||||
char* argv[100];
|
||||
int argc;
|
||||
|
||||
command_line = GetCommandLine();
|
||||
argc = parse_command_line(command_line, argv);
|
||||
return main(argc, argv);
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2015 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef _BROWSERMAIN_WIN_H_
|
||||
#define _BROWSERMAIN_WIN_H_
|
||||
|
||||
|
||||
class CHTMLBrowserWnd;
|
||||
|
||||
|
||||
class CBrowserModule : public ATL::CAtlExeModuleT<CBrowserModule>
|
||||
{
|
||||
public:
|
||||
|
||||
CBrowserModule();
|
||||
|
||||
static HRESULT InitializeCom() throw();
|
||||
static void UninitializeCom() throw();
|
||||
|
||||
HRESULT PreMessageLoop(int nShowCmd) throw();
|
||||
HRESULT PostMessageLoop() throw();
|
||||
int BOINCParseCommandLine(int argc, char** argv);
|
||||
|
||||
bool m_bFullscreen;
|
||||
CHTMLBrowserWnd* m_pWnd;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -1,114 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2012 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define _ATL_FREE_THREADED
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
|
||||
#include <AtlBase.h>
|
||||
#include <AtlCom.h>
|
||||
#include <AtlCtl.h>
|
||||
#include <AtlWin.h>
|
||||
#include <AtlStr.h>
|
||||
#include <AtlFile.h>
|
||||
#include <AtlTypes.h>
|
||||
#include <exdisp.h>
|
||||
#include <exdispid.h>
|
||||
#include <string>
|
||||
#include "win_util.h"
|
||||
#include "version.h"
|
||||
#include "boinc_api.h"
|
||||
#include "diagnostics.h"
|
||||
#include "filesys.h"
|
||||
#include "vboxhtmlgfx_win.h"
|
||||
#include "vboxlogging.h"
|
||||
#include "vboxcheckpoint.h"
|
||||
#include "browserctrl_win.h"
|
||||
#include "browserwnd_win.h"
|
||||
|
||||
|
||||
CHTMLBrowserWnd::CHTMLBrowserWnd()
|
||||
{
|
||||
m_pBrowserHost = NULL;
|
||||
}
|
||||
|
||||
CHTMLBrowserWnd::~CHTMLBrowserWnd()
|
||||
{
|
||||
}
|
||||
|
||||
LRESULT CHTMLBrowserWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
HRESULT hr;
|
||||
RECT rcClient;
|
||||
CComPtr<IUnknown> pCtrl;
|
||||
CComVariant v;
|
||||
|
||||
|
||||
// Create Control Host
|
||||
hr = CComObject<CHTMLBrowserHost>::CreateInstance(&m_pBrowserHost);
|
||||
ATLASSERT(SUCCEEDED(hr));
|
||||
|
||||
// Create Control Window
|
||||
GetClientRect(&rcClient);
|
||||
m_pBrowserHost->Create(m_hWnd, rcClient, NULL, WS_CHILD | WS_VISIBLE);
|
||||
ATLASSERT(m_pBrowserHost->m_hWnd != NULL);
|
||||
|
||||
// Create Control
|
||||
m_pBrowserHost->CreateControlEx(
|
||||
L"Shell.Explorer",
|
||||
m_pBrowserHost->m_hWnd,
|
||||
NULL,
|
||||
&pCtrl,
|
||||
__uuidof(DWebBrowserEvents2),
|
||||
(IUnknown*)(IDispEventImpl<1, CHTMLBrowserWnd, &__uuidof(DWebBrowserEvents2), &LIBID_SHDocVw, 1, 1>*)this
|
||||
);
|
||||
|
||||
// Get an IWebBrowser2 interface on the control and navigate to a page.
|
||||
m_pBrowserCtrl = pCtrl;
|
||||
|
||||
if (m_pBrowserCtrl) {
|
||||
m_pBrowserCtrl->Navigate(CComBSTR("http://www.romwnet.org/"), &v, &v, &v, &v);
|
||||
}
|
||||
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CHTMLBrowserWnd::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
DestroyWindow();
|
||||
::PostQuitMessage(0);
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CHTMLBrowserWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT CHTMLBrowserWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
m_pBrowserHost->MoveWindow(0, 0, LOWORD(lParam), HIWORD(lParam));
|
||||
bHandled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CHTMLBrowserWnd::OnNavigateComplete(IDispatch* pDisp, VARIANT* URL)
|
||||
{
|
||||
vboxlog_msg("URL Change Detected. (%S)", URL->bstrVal);
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2015 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef _BROWSERWND_WIN_H_
|
||||
#define _BROWSERWND_WIN_H_
|
||||
|
||||
class CHTMLBrowserWnd :
|
||||
public CWindowImpl<CHTMLBrowserWnd, CWindow, CNullTraits>,
|
||||
public IDispEventImpl<1, CHTMLBrowserWnd, &__uuidof(DWebBrowserEvents2), &LIBID_SHDocVw, 1, 1>
|
||||
{
|
||||
public:
|
||||
DECLARE_WND_CLASS_EX(_T("BOINC_app"), 0, 0);
|
||||
DECLARE_NO_REGISTRY();
|
||||
|
||||
BEGIN_SINK_MAP(CHTMLBrowserWnd)
|
||||
SINK_ENTRY_EX(1, __uuidof(DWebBrowserEvents2), DISPID_NAVIGATECOMPLETE2, OnNavigateComplete)
|
||||
END_SINK_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CHTMLBrowserWnd)
|
||||
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
||||
MESSAGE_HANDLER(WM_CLOSE, OnClose)
|
||||
MESSAGE_HANDLER(WM_TIMER, OnTimer)
|
||||
MESSAGE_HANDLER(WM_SIZE, OnSize)
|
||||
END_MSG_MAP()
|
||||
|
||||
CHTMLBrowserWnd();
|
||||
~CHTMLBrowserWnd();
|
||||
|
||||
// Generic Window Events
|
||||
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||
|
||||
// HTML Browser Events
|
||||
void OnNavigateComplete(IDispatch* pDisp, VARIANT* URL);
|
||||
|
||||
|
||||
CComObject<CHTMLBrowserHost>* m_pBrowserHost;
|
||||
CComQIPtr<IWebBrowser2> m_pBrowserCtrl;
|
||||
|
||||
bool m_bScreensaverMode;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,57 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2012 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "boinc_win.h"
|
||||
#include "win_util.h"
|
||||
#else
|
||||
#include <vector>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "version.h"
|
||||
#include "boinc_api.h"
|
||||
#include "diagnostics.h"
|
||||
#include "vboxlogging.h"
|
||||
|
||||
|
||||
extern int run(int, char**);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int retval = 0;
|
||||
|
||||
// Initialize diagnostic system
|
||||
//
|
||||
boinc_init_graphics_diagnostics(BOINC_DIAG_DEFAULTS);
|
||||
|
||||
// Log banner
|
||||
//
|
||||
vboxlog_msg("vboxhtmlgfx (%d.%d.%d): starting", BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, VBOXWRAPPER_RELEASE);
|
||||
|
||||
retval = run(argc, argv);
|
||||
|
||||
boinc_finish_diag();
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2010-2012 University of California
|
||||
//
|
||||
// BOINC is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// BOINC is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef _VBOXHTMLGFX_H_
|
||||
#define _VBOXHTMLGFX_H_
|
||||
|
||||
#endif
|
|
@ -1,19 +0,0 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by vboxhtmlgfx_win.rc
|
||||
//
|
||||
|
||||
#define IDD_BROWSER 101
|
||||
#define IDC_IE 1000
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
||||
#define _APS_NEXT_COMMAND_VALUE 40000
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
|
@ -1,99 +0,0 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "vboxhtmlgfx_win.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winresrc.h"
|
||||
#include "version.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
// Helpful macros to convert version to string notation
|
||||
#define TOSTR(s) #s
|
||||
#define VER_TOSTR(maj,min,rel) TOSTR(maj) "." TOSTR(min) "." TOSTR(rel) "\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,VBOXWRAPPER_RELEASE,0
|
||||
PRODUCTVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,VBOXWRAPPER_RELEASE,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Space Sciences Laboratory"
|
||||
VALUE "FileDescription", "BOINC VirtualBox Wrapper Graphics"
|
||||
VALUE "FileVersion", VER_TOSTR(BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, WRAPPER_RELEASE)
|
||||
VALUE "InternalName", "vboxhtmlgfx"
|
||||
VALUE "LegalCopyright", "© 2011-2014 University of California"
|
||||
VALUE "OriginalFilename", "vboxhtmlgfx.exe"
|
||||
VALUE "ProductName", "BOINC VirtualBox Wrapper Graphics"
|
||||
VALUE "ProductVersion", VER_TOSTR(BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, WRAPPER_RELEASE)
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_BROWSER DIALOGEX 0, 0, 327, 199
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "BOINC Application"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "",IDC_IE,"{8856F961-340A-11D0-A96B-00C04FD705A2}",
|
||||
WS_GROUP | WS_TABSTOP,0,0,198,106
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue