Commit fee2e824 authored by aroben's avatar aroben

Merge WindowsMerge to trunk

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3473d7d3
!if !defined(BUILDSTYLE)
BUILDSTYLE=Release
!ENDIF
install:
set BuildBot=1
set WebKitSDKDir="$(SRCROOT)\AppleInternal"
set WebKitOutputDir=$(OBJROOT)
devenv "JavaScriptCore.sln" /rebuild $(BUILDSTYLE)
xcopy "$(OBJROOT)\bin\*" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
xcopy "$(OBJROOT)\include\*" "$(DSTROOT)\AppleInternal\include\" /e/v/i/h/y
xcopy "$(OBJROOT)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
!if !defined(BUILDSTYLE)
BUILDSTYLE=Release
!ENDIF
install:
set BuildBot=1
set WebKitSDKDir=$(SRCROOT)\AppleInternal
set WebKitOutputDir=$(OBJROOT)
devenv "WebCore.submit.sln" /rebuild $(BUILDSTYLE)
xcopy "$(OBJROOT)\include\*" "$(DSTROOT)\AppleInternal\include\" /e/v/i/h/y
xcopy "$(OBJROOT)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCore", "WebCore.submit.vcproj", "{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Debug|Win32.ActiveCfg = Debug_Internal|Win32
{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Debug|Win32.Build.0 = Debug_Internal|Win32
{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Release|Win32.ActiveCfg = Release|Win32
{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
#!/usr/bin/bash
NUMCPUS=`../../../Tools/Scripts/num-cpus`
if [ -e "../../../../OpenSource/WebCore" ]; then
XSRCROOT="`pwd`/../../../../OpenSource/WebCore"
else
XSRCROOT="`pwd`/.."
fi
XSRCROOT=`realpath "$XSRCROOT"`
# Do a little dance to get the path into 8.3 form to make it safe for gnu make
# http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
XSRCROOT=`cygpath -m -s "$XSRCROOT"`
XSRCROOT=`cygpath -u "$XSRCROOT"`
export XSRCROOT
export SOURCE_ROOT=$XSRCROOT
XDSTROOT="$1"
export XDSTROOT
# Do a little dance to get the path into 8.3 form to make it safe for gnu make
# http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
XDSTROOT=`cygpath -m -s "$XDSTROOT"`
XDSTROOT=`cygpath -u "$XDSTROOT"`
export XDSTROOT
SDKROOT="$2"
export SDKROOT
# Do a little dance to get the path into 8.3 form to make it safe for gnu make
# http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
SDKROOT=`cygpath -m -s "$SDKROOT"`
SDKROOT=`cygpath -u "$SDKROOT"`
export SDKROOT
export BUILT_PRODUCTS_DIR="$XDSTROOT/obj/WebCore"
if [ -e "$XDSTROOT/include/JavaScriptCore/create_hash_table" ]; then
export CREATE_HASH_TABLE="$XDSTROOT/include/JavaScriptCore/create_hash_table"
else
export CREATE_HASH_TABLE="$SDKROOT/include/JavaScriptCore/create_hash_table"
fi
mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources"
cd "${BUILT_PRODUCTS_DIR}/DerivedSources"
export WebCore="${XSRCROOT}"
export ENCODINGS_FILE="${WebCore}/platform/win/win-encodings.txt";
export ENCODINGS_PREFIX=""
# FIXME: Should make XPath Support configurable someday on Win32.
export FEATURE_DEFINES="ENABLE_XPATH ENABLE_SVG"
make -f "$WebCore/DerivedSources.make" -j ${NUMCPUS} || exit 1
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="debug"
>
<UserMacro
Name="WebKitConfigSuffix"
Value="_debug"
PerformEnvironmentSet="true"
/>
</VisualStudioPropertySheet>
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="debug_internal"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="USE_DEBUG_SAFARI_THEME"
/>
<UserMacro
Name="WebKitConfigSuffix"
Value="_debug"
PerformEnvironmentSet="true"
/>
</VisualStudioPropertySheet>
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="release"
>
<UserMacro
Name="WebKitConfigSuffix"
Value=""
PerformEnvironmentSet="true"
/>
</VisualStudioPropertySheet>
/*
* Copyright (C) 2007 Apple 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 "WebCorePrefix.h"
/*
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
* Copyright (C) 2004, 2005, 2006, 2007 Apple Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -18,8 +18,8 @@
*
*/
/* This prefix file is for use on Mac OS X only. It should contain only:
* 1) files to precompile on Mac OS X for faster builds
/* This prefix file is for use on Mac OS X and Windows only. It should contain only:
* 1) files to precompile on Mac OS X and Windows for faster builds
* 2) in one case at least: OS-X-specific performance bug workarounds
* 3) the special trick to catch us using new or delete without including "config.h"
* The project should be able to build without this header, although we rarely test that.
......@@ -28,17 +28,44 @@
/* Things that need to be defined globally should go into "config.h". */
#if defined(__APPLE__)
#ifdef __cplusplus
#define NULL __null
#else
#define NULL ((void *)0)
#endif
#endif
#if defined(WIN32) || defined(_WIN32)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
#ifndef WINVER
#define WINVER 0x0500
#endif
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
#endif
// If we don't define these, they get defined in windef.h.
// We want to use std::min and std::max
#ifdef __cplusplus
#define max max
#define min min
#endif
#endif // defined(WIN32) || defined(_WIN32)
#include <ctype.h>
#include <sys/types.h>
#include <fcntl.h>
#include <pthread.h>
#if defined(__APPLE__)
#include <regex.h>
#endif
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
......@@ -47,7 +74,9 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#if defined(__APPLE__)
#include <unistd.h>
#endif
#ifdef __cplusplus
......@@ -57,6 +86,7 @@
/* Work around bug 3553309 by re-including <ctype.h>. */
#include <cctype>
#if defined(__APPLE__)
#define isalnum(c) __istype((c), (_CTYPE_A|_CTYPE_D))
#define isalpha(c) __istype((c), _CTYPE_A)
#define iscntrl(c) __istype((c), _CTYPE_C)
......@@ -70,14 +100,19 @@
#define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */
#define tolower(c) __tolower(c)
#define toupper(c) __toupper(c)
#endif
#endif
#include <sys/types.h>
#if defined(__APPLE__)
#include <sys/param.h>
#endif
#include <sys/stat.h>
#if defined(__APPLE__)
#include <sys/time.h>
#include <sys/resource.h>
#endif
#include <time.h>
......@@ -86,9 +121,11 @@
#include <AvailabilityMacros.h>
#if defined(__APPLE__)
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
#define BUILDING_ON_TIGER 1
#endif
#endif
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
......@@ -100,5 +137,7 @@
#endif
/* Work around bug with C++ library that screws up Objective-C++ when exception support is disabled. */
#if defined(__APPLE__)
#undef try
#undef catch
#endif
/*
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -27,96 +26,175 @@
#include "config.h"
#include "FrameWin.h"
#include "TextResourceDecoder.h"
#include <winsock2.h>
#include <windows.h>
#include "AffineTransform.h"
#include "FloatRect.h"
#include "Document.h"
#include "EditorClient.h"
#include "FrameLoader.h"
#include "FrameLoadRequest.h"
#include "FramePrivate.h"
#include "FrameView.h"
#include "Settings.h"
#include "PlatformKeyboardEvent.h"
#include "HTMLIFrameElement.h"
#include "HTMLNames.h"
#include "HTMLTableCellElement.h"
#include "KeyboardEvent.h"
#include "NP_jsobject.h"
#include "Page.h"
#include "Plugin.h"
#include "PluginDatabaseWin.h"
#include "PluginViewWin.h"
#include "RegularExpression.h"
#include "RenderFrame.h"
#include "RenderTableCell.h"
#include "RenderView.h"
#include "ResourceHandle.h"
#include <windows.h>
#include "TextResourceDecoder.h"
#include "kjs_proxy.h"
#include "kjs_window.h"
#include "npruntime_impl.h"
#include "runtime_root.h"
#include "GraphicsContext.h"
#include "Settings.h"
#if PLATFORM(CG)
#include <CoreGraphics/CoreGraphics.h>
#endif
using std::min;
using namespace KJS::Bindings;
namespace WebCore {
FrameWin::FrameWin(Page* page, HTMLFrameOwnerElement* ownerElement, FrameWinClient* client, FrameLoaderClient* loaderClient)
: Frame(page, ownerElement, loaderClient)
, m_client(client)
using namespace HTMLNames;
void Frame::cleanupPlatformScriptObjects()
{
Settings* settings = new Settings();
settings->setLoadsImagesAutomatically(true);
settings->setDefaultFixedFontSize(13);
settings->setDefaultFontSize(16);
settings->setSerifFontFamily("Times New Roman");
settings->setFixedFontFamily("Courier New");
settings->setSansSerifFontFamily("Arial");
settings->setStandardFontFamily("Times New Roman");
settings->setJavaScriptEnabled(true);
setSettings(settings);
}
FrameWin::~FrameWin()
KJS::Bindings::Instance* Frame::createScriptInstanceForWidget(Widget* widget)
{
setView(0);
loader()->clearRecordedFormValues();
// FIXME: Ideally we'd have an isPluginView() here but we can't add that to the open source tree right now.
if (widget->isFrameView())
return 0;
return static_cast<PluginViewWin*>(widget)->bindingInstance();
}
void FrameWin::runJavaScriptAlert(String const& message)
Vector<IntRect> computePageRectsForFrame(Frame* frame, const IntRect& printRect, float userScaleFactor)
{
String text = message;
text.replace('\\', backslashAsCurrencySymbol());
UChar nullChar = 0;
text += String(&nullChar, 1);
MessageBox(view()->containingWindow(), text.characters(), L"JavaScript Alert", MB_OK);
ASSERT(frame);
Vector<IntRect> pages;
if (!frame->document() || !frame->view()|| !frame->document()->renderer()) return pages;
RenderView* root = static_cast<RenderView *>(frame->document()->renderer());
if (!root) {
LOG_ERROR("document to be printed has no renderer");
return pages;
}
if (userScaleFactor <= 0) {
LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor);
return pages;
}
float ratio = (float)printRect.height() / (float)printRect.width();
float pageWidth = (float) root->docWidth();
float pageHeight = pageWidth * ratio;
if (pageHeight <= 0) {
LOG_ERROR("pageHeight has bad value %.2f", pageHeight);
return pages;
}
float currPageHeight = pageHeight / userScaleFactor;
float docHeight = root->layer()->height();
float docWidth = root->layer()->width();
float currPageWidth = pageWidth / userScaleFactor;
for (float i = 0; i < docHeight; i += currPageHeight) {
float proposedBottom = min(docHeight, i + pageHeight);
frame->adjustPageHeight(&proposedBottom, i, proposedBottom, i);
currPageHeight = max(1.0f, proposedBottom - i);
int x = 0;
int y = i;
int wide = currPageWidth;
int high = currPageHeight;
IntRect pageRect(x, y, wide, high);
pages.append(pageRect);
}
return pages;
}
bool FrameWin::runJavaScriptConfirm(String const& message)
static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext* gc)
{
String text = message;
text.replace('\\', backslashAsCurrencySymbol());
UChar nullChar = 0;
text += String(&nullChar, 1);
return MessageBox(view()->containingWindow(), text.characters(), L"JavaScript Alert", MB_OKCANCEL) == IDOK;
IntSize offset = view->scrollOffset();
rect.move(-offset.width(), -offset.height());
rect = view->convertToContainingWindow(rect);
gc->concatCTM(AffineTransform().translate(-rect.x(), -rect.y()));
view->paint(gc, rect);
}
// FIXME: This needs to be unified with the keyPress method on FrameMac
bool FrameWin::keyPress(const PlatformKeyboardEvent& keyEvent)
HBITMAP imageFromSelection(Frame* frame, bool forceWhiteText)
{
bool result;
// Check for cases where we are too early for events -- possible unmatched key up
// from pressing return in the location bar.
Document *doc = document();
if (!doc)
return false;
Node *node = doc->focusedNode();
if (!node) {
if (doc->isHTMLDocument())
node = doc->body();
else
node = doc->documentElement();
if (!node)
return false;
}
frame->setPaintRestriction(forceWhiteText ? PaintRestrictionSelectionOnlyWhiteText : PaintRestrictionSelectionOnly);
FloatRect fr = frame->selectionRect();
IntRect ir((int)fr.x(), (int)fr.y(),(int)fr.width(),(int)fr.height());
#ifdef MULTIPLE_FORM_SUBMISSION_PROTECTION
if (!keyEvent.isKeyUp())
loader()->resetMultipleFormSubmissionProtection();
#endif
void* bits;
HDC hdc = CreateCompatibleDC(0);
int w = ir.width();
int h = ir.height();
BITMAPINFO bmp = { { sizeof(BITMAPINFOHEADER), w, h, 1, 32 } };
result = !EventTargetNodeCast(node)->dispatchKeyEvent(keyEvent);
HBITMAP hbmp = CreateDIBSection(0, &bmp, DIB_RGB_COLORS, (void**)&bits, 0, 0);
HBITMAP hbmpOld = (HBITMAP)SelectObject(hdc, hbmp);
CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate((void*)bits, w, h,
8, w * sizeof(RGBQUAD), deviceRGB, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
CGColorSpaceRelease(deviceRGB);
CGContextSaveGState(context);
GraphicsContext gc(context);
drawRectIntoContext(ir, frame->view(), &gc);
CGContextRelease(context);
SelectObject(hdc, hbmpOld);
DeleteDC(hdc);
frame->setPaintRestriction(PaintRestrictionNone);
return hbmp;
}
bool Frame::isCharacterSmartReplaceExempt(UChar, bool)
{
// no smart replace
return true;
}
// FIXME: FrameMac has a keyDown/keyPress hack here which we are not copying.
DragImageRef Frame::dragImageForSelection()
{
if (selectionController()->isRange())
return imageFromSelection(this, false);
return result;
return 0;
}
FrameWinClient* FrameWin::client() const
void Frame::dashboardRegionsChanged()
{
return m_client;
}
} // namespace WebCore
/*
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)