diff options
author | Cary Clark <> | 2009-04-14 06:33:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-14 06:33:00 -0700 |
commit | 563af33bc48281d19dce701398dbb88cb54fd7ec (patch) | |
tree | 395b4502f029dea8b25b342d66dc06b5d8f99985 /WebKitTools/WinLauncher | |
parent | 5cfedfef172691d0f4bcf2be5ca3cddd8c9a47f4 (diff) | |
download | external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.zip external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.gz external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.bz2 |
AI 146110: add missing files to webkit
brings it in sync with webkit svn cl 42046
Automated import of CL 146110
Diffstat (limited to 'WebKitTools/WinLauncher')
-rw-r--r-- | WebKitTools/WinLauncher/WinLauncher.cpp | 409 | ||||
-rw-r--r-- | WebKitTools/WinLauncher/WinLauncher.h | 109 | ||||
-rw-r--r-- | WebKitTools/WinLauncher/WinLauncher.ico | bin | 0 -> 23558 bytes | |||
-rw-r--r-- | WebKitTools/WinLauncher/WinLauncher.rc | 136 | ||||
-rw-r--r-- | WebKitTools/WinLauncher/WinLauncher.vcproj | 343 | ||||
-rw-r--r-- | WebKitTools/WinLauncher/resource.h | 27 | ||||
-rw-r--r-- | WebKitTools/WinLauncher/small.ico | bin | 0 -> 23558 bytes | |||
-rw-r--r-- | WebKitTools/WinLauncher/stdafx.cpp | 33 | ||||
-rw-r--r-- | WebKitTools/WinLauncher/stdafx.h | 69 |
9 files changed, 1126 insertions, 0 deletions
diff --git a/WebKitTools/WinLauncher/WinLauncher.cpp b/WebKitTools/WinLauncher/WinLauncher.cpp new file mode 100644 index 0000000..035077d --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.cpp @@ -0,0 +1,409 @@ +/* + * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "stdafx.h" +#include "WinLauncher.h" +#include "WebKit.h" + +#include <commctrl.h> +#include <objbase.h> +#include <shlwapi.h> +#include <wininet.h> + +#define MAX_LOADSTRING 100 +#define URLBAR_HEIGHT 24 + +// Global Variables: +HINSTANCE hInst; // current instance +HWND hMainWnd; +HWND hURLBarWnd; +long DefEditProc; +IWebView* gWebView = 0; +HWND gViewWindow = 0; +WinLauncherWebHost* gWebHost = 0; +TCHAR szTitle[MAX_LOADSTRING]; // The title bar text +TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE hInstance); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK MyEditProc(HWND, UINT, WPARAM, LPARAM); + +static void loadURL(BSTR urlBStr); + +HRESULT WinLauncherWebHost::updateAddressBar(IWebView* webView) +{ + IWebFrame* mainFrame = 0; + IWebDataSource* dataSource = 0; + IWebMutableURLRequest* request = 0; + BSTR frameURL = 0; + + HRESULT hr = S_OK; + + hr = webView->mainFrame(&mainFrame); + if (FAILED(hr)) + goto exit; + + hr = mainFrame->dataSource(&dataSource); + if (FAILED(hr) || !dataSource) + hr = mainFrame->provisionalDataSource(&dataSource); + if (FAILED(hr) || !dataSource) + goto exit; + + hr = dataSource->request(&request); + if (FAILED(hr) || !request) + goto exit; + + hr = request->mainDocumentURL(&frameURL); + if (FAILED(hr)) + goto exit; + + SendMessage(hURLBarWnd, (UINT)WM_SETTEXT, 0, (LPARAM)frameURL); + +exit: + if (mainFrame) + mainFrame->Release(); + if (dataSource) + dataSource->Release(); + if (request) + request->Release(); + SysFreeString(frameURL); + return 0; +} + +HRESULT STDMETHODCALLTYPE WinLauncherWebHost::QueryInterface(REFIID riid, void** ppvObject) +{ + *ppvObject = 0; + if (IsEqualGUID(riid, IID_IUnknown)) + *ppvObject = static_cast<IWebFrameLoadDelegate*>(this); + else if (IsEqualGUID(riid, IID_IWebFrameLoadDelegate)) + *ppvObject = static_cast<IWebFrameLoadDelegate*>(this); + else + return E_NOINTERFACE; + + AddRef(); + return S_OK; +} + +ULONG STDMETHODCALLTYPE WinLauncherWebHost::AddRef(void) +{ + return ++m_refCount; +} + +ULONG STDMETHODCALLTYPE WinLauncherWebHost::Release(void) +{ + ULONG newRef = --m_refCount; + if (!newRef) + delete(this); + + return newRef; +} + +static void resizeSubViews() +{ + RECT rcClient; + GetClientRect(hMainWnd, &rcClient); + MoveWindow(hURLBarWnd, 0, 0, rcClient.right, URLBAR_HEIGHT, TRUE); + MoveWindow(gViewWindow, 0, URLBAR_HEIGHT, rcClient.right, rcClient.bottom - URLBAR_HEIGHT, TRUE); +} + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ +#ifdef _CRTDBG_MAP_ALLOC + _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); +#endif + + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + // TODO: Place code here. + MSG msg; + HACCEL hAccelTable; + + INITCOMMONCONTROLSEX InitCtrlEx; + + InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitCtrlEx.dwICC = 0x00004000; //ICC_STANDARD_CLASSES; + InitCommonControlsEx(&InitCtrlEx); + + // Initialize global strings + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_WINLAUNCHER, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance); + + // Perform application initialization: + if (!InitInstance (hInstance, nCmdShow)) + return FALSE; + + // Init COM + OleInitialize(NULL); + + hURLBarWnd = CreateWindow(L"EDIT", 0, + WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, + 0, 0, 0, 0, + hMainWnd, + 0, + hInstance, 0); + + DefEditProc = GetWindowLong(hURLBarWnd, GWL_WNDPROC); + SetWindowLong(hURLBarWnd, GWL_WNDPROC,(long)MyEditProc); + SetFocus(hURLBarWnd); + + HRESULT hr = CoCreateInstance(CLSID_WebView, 0, CLSCTX_ALL, IID_IWebView, (void**)&gWebView); + if (FAILED(hr)) + goto exit; + + gWebHost = new WinLauncherWebHost(); + gWebHost->AddRef(); + hr = gWebView->setFrameLoadDelegate(gWebHost); + if (FAILED(hr)) + goto exit; + + hr = gWebView->setHostWindow((OLE_HANDLE) hMainWnd); + if (FAILED(hr)) + goto exit; + + RECT clientRect; + GetClientRect(hMainWnd, &clientRect); + hr = gWebView->initWithFrame(clientRect, 0, 0); + if (FAILED(hr)) + goto exit; + + IWebFrame* frame; + hr = gWebView->mainFrame(&frame); + if (FAILED(hr)) + goto exit; + static BSTR defaultHTML = 0; + if (!defaultHTML) + defaultHTML = SysAllocString(TEXT("<p style=\"background-color: #00FF00\">Testing</p><img src=\"http://webkit.org/images/icon-gold.png\" alt=\"Face\"><div style=\"border: solid blue\" contenteditable=\"true\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>")); + frame->loadHTMLString(defaultHTML, 0); + frame->Release(); + + IWebViewPrivate* viewExt; + hr = gWebView->QueryInterface(IID_IWebViewPrivate, (void**)&viewExt); + if (FAILED(hr)) + goto exit; + hr = viewExt->viewWindow((OLE_HANDLE*) &gViewWindow); + viewExt->Release(); + if (FAILED(hr) || !gViewWindow) + goto exit; + + resizeSubViews(); + + ShowWindow(gViewWindow, nCmdShow); + UpdateWindow(gViewWindow); + + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINLAUNCHER)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + +exit: + gWebView->Release(); + shutDownWebKit(); +#ifdef _CRTDBG_MAP_ALLOC + _CrtDumpMemoryLeaks(); +#endif + + // Shut down COM. + OleUninitialize(); + + return (int) msg.wParam; +} + +ATOM MyRegisterClass(HINSTANCE hInstance) +{ + WNDCLASSEX wcex; + + wcex.cbSize = sizeof(WNDCLASSEX); + + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINLAUNCHER)); + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = 0; + wcex.lpszMenuName = MAKEINTRESOURCE(IDC_WINLAUNCHER); + wcex.lpszClassName = szWindowClass; + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + + return RegisterClassEx(&wcex); +} + +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + hInst = hInstance; // Store instance handle in our global variable + + hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); + + if (!hMainWnd) + return FALSE; + + ShowWindow(hMainWnd, nCmdShow); + UpdateWindow(hMainWnd); + + return TRUE; +} + +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + switch (message) { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) { + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_DESTROY: + PostQuitMessage(0); + break; + case WM_SIZE: + if (!gWebView) + break; + resizeSubViews(); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + + +#define MAX_URL_LENGTH 1024 + +LRESULT CALLBACK MyEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_CHAR: + if( wParam == 13 ) { // Enter Key + wchar_t strPtr[MAX_URL_LENGTH]; + *((LPWORD)strPtr) = MAX_URL_LENGTH; + int strLen = SendMessage(hDlg, EM_GETLINE, 0, (LPARAM)strPtr); + + BSTR bstr = SysAllocStringLen(strPtr, strLen); + loadURL(bstr); + SysFreeString(bstr); + + return 0; + } else + return (LRESULT)CallWindowProc((WNDPROC)DefEditProc,hDlg,message,wParam,lParam); + break; + default: + return (LRESULT)CallWindowProc((WNDPROC)DefEditProc,hDlg,message,wParam,lParam); + break; + } + return 0; +} + + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + switch (message) { + case WM_INITDIALOG: + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} + +static void loadURL(BSTR urlBStr) +{ + IWebFrame* frame = 0; + IWebMutableURLRequest* request = 0; + static BSTR methodBStr = 0; + + if (!methodBStr) + methodBStr = SysAllocString(TEXT("GET")); + + if (urlBStr && urlBStr[0] && (PathFileExists(urlBStr) || PathIsUNC(urlBStr))) { + TCHAR fileURL[INTERNET_MAX_URL_LENGTH]; + DWORD fileURLLength = sizeof(fileURL)/sizeof(fileURL[0]); + if (SUCCEEDED(UrlCreateFromPath(urlBStr, fileURL, &fileURLLength, 0))) + urlBStr = fileURL; + } + + HRESULT hr = gWebView->mainFrame(&frame); + if (FAILED(hr)) + goto exit; + + hr = CoCreateInstance(CLSID_WebMutableURLRequest, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request); + if (FAILED(hr)) + goto exit; + + hr = request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 60); + if (FAILED(hr)) + goto exit; + + hr = request->setHTTPMethod(methodBStr); + if (FAILED(hr)) + goto exit; + + hr = frame->loadRequest(request); + if (FAILED(hr)) + goto exit; + + SetFocus(gViewWindow); + +exit: + if (frame) + frame->Release(); + if (request) + request->Release(); +} diff --git a/WebKitTools/WinLauncher/WinLauncher.h b/WebKitTools/WinLauncher/WinLauncher.h new file mode 100644 index 0000000..1f57bff --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include "resource.h" +#include "WebKit.h" + +class WinLauncherWebHost : public IWebFrameLoadDelegate +{ +public: + WinLauncherWebHost() : m_refCount(1) {} + + // IUnknown + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); + virtual ULONG STDMETHODCALLTYPE AddRef(void); + virtual ULONG STDMETHODCALLTYPE Release(void); + + // IWebFrameLoadDelegate + virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( + /* [in] */ IWebView* webView, + /* [in] */ IWebFrame* /*frame*/) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( + /* [in] */ IWebView *webView, + /* [in] */ IWebError *error, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return updateAddressBar(webView); } + + virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( + /* [in] */ IWebView *webView, + /* [in] */ BSTR title, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( + /* [in] */ IWebView *webView, + /* [in] */ OLE_HANDLE hBitmap, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( + /* [in] */ IWebView* webView, + /* [in] */ IWebFrame* /*frame*/) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( + /* [in] */ IWebView *webView, + /* [in] */ IWebError *error, + /* [in] */ IWebFrame *forFrame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( + /* [in] */ IWebView *webView, + /* [in] */ BSTR url, + /* [in] */ double delaySeconds, + /* [in] */ DATE fireDate, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE willCloseFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( + /* [in] */ IWebView *webView, + /* [in] */ JSContextRef context, + /* [in] */ JSObjectRef windowScriptObject) { return S_OK; } + + // WinLauncherWebHost + +protected: + HRESULT updateAddressBar(IWebView* webView); + +protected: + ULONG m_refCount; +}; diff --git a/WebKitTools/WinLauncher/WinLauncher.ico b/WebKitTools/WinLauncher/WinLauncher.ico Binary files differnew file mode 100644 index 0000000..d551aa3 --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.ico diff --git a/WebKitTools/WinLauncher/WinLauncher.rc b/WebKitTools/WinLauncher/WinLauncher.rc new file mode 100644 index 0000000..f4b2cd4 --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.rc @@ -0,0 +1,136 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_WINLAUNCHER ICON "WinLauncher.ico" +IDI_SMALL ICON "small.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDC_WINLAUNCHER MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "E&xit", IDM_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About ...", IDM_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_WINLAUNCHER ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOGEX 22, 17, 230, 75 +STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "About" +FONT 8, "System", 0, 0, 0x0 +BEGIN + ICON IDI_WINLAUNCHER,IDC_MYICON,14,9,20,20 + LTEXT "WinLauncher Version 1.1",IDC_STATIC,49,10,119,8,SS_NOPREFIX + LTEXT "Copyright (C) 2008",IDC_STATIC,49,20,119,8 + DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_APP_TITLE "WinLauncher" + IDC_WINLAUNCHER "WINLAUNCHER" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/WebKitTools/WinLauncher/WinLauncher.vcproj b/WebKitTools/WinLauncher/WinLauncher.vcproj new file mode 100644 index 0000000..d1002ea --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.vcproj @@ -0,0 +1,343 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WinLauncher"
+ ProjectGUID="{114FCA11-216B-4C8C-957E-30A75AE80443}"
+ RootNamespace="WinLauncher"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(ProjectDir)\..";"$(ProjectDir)";"$(IntDir)\Include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="false"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkLibraryDependencies="false"
+ AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(ProjectDir)\..\..\..\""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_WINNT=0x501"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="false"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkLibraryDependencies="false"
+ AdditionalOptions="
"
+ AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(ProjectDir)\..\..\..\""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Internal|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(ProjectDir)\..";"$(ProjectDir)";"$(IntDir)\Include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="false"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkLibraryDependencies="false"
+ AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(ProjectDir)\..\..\..\""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\WinLauncher.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\Resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WinLauncher.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\small.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\WinLauncher.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\WinLauncher.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/WinLauncher/resource.h b/WebKitTools/WinLauncher/resource.h new file mode 100644 index 0000000..6a21684 --- /dev/null +++ b/WebKitTools/WinLauncher/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by WinLauncher.rc +// +#define IDC_MYICON 2 +#define IDD_WINLAUNCHER_DIALOG 102 +#define IDS_APP_TITLE 103 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_WINLAUNCHER 107 +#define IDI_SMALL 108 +#define IDC_WINLAUNCHER 109 +#define IDR_MAINFRAME 128 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/WebKitTools/WinLauncher/small.ico b/WebKitTools/WinLauncher/small.ico Binary files differnew file mode 100644 index 0000000..d551aa3 --- /dev/null +++ b/WebKitTools/WinLauncher/small.ico diff --git a/WebKitTools/WinLauncher/stdafx.cpp b/WebKitTools/WinLauncher/stdafx.cpp new file mode 100644 index 0000000..541dcb1 --- /dev/null +++ b/WebKitTools/WinLauncher/stdafx.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// stdafx.cpp : source file that includes just the standard includes +// Spinneret.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/WebKitTools/WinLauncher/stdafx.h b/WebKitTools/WinLauncher/stdafx.h new file mode 100644 index 0000000..86f76cc --- /dev/null +++ b/WebKitTools/WinLauncher/stdafx.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Allow use of features specific to Windows XP or later. +#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. +#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. +#endif + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if 0 +// Visual Studio Leak Detection +// <http://msdn2.microsoft.com/en-US/library/e5ewb1h3.aspx> +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include <stdlib.h> +#include <crtdbg.h> +#endif +#endif |