Commit 1e039cff authored by darin's avatar darin

* khtml/rendering/render_text.cpp:

        (TextSlave::printSelection): Add comments to APPLE_CHANGES.
        (TextSlave::printDecoration): Add comments to APPLE_CHANGES.
        (TextSlave::checkSelectionPoint): Add comments to APPLE_CHANGES.

        * khtml/xml/dom_stringimpl.cpp: Add comments to APPLE_CHANGES.

        * khtml/xml/xml_tokenizer.cpp: (XMLTokenizer::end): Remove APPLE_CHANGES.
        * kwq/KWQsignals.mm: Add a new signal dummy function.

        * kwq/WebCoreJavaScript.h: Fix header.
        * kwq/WebCoreJavaScript.mm: Fix header.

        * kwq/WebCoreSettings.h: Added. Not used yet.
        * kwq/WebCoreSettings.m: Added. Not used yet.
        * WebCore.pbproj/project.pbxproj: Added WebCoreSettings.h and .m.

        * English.lproj/InfoPlist.strings: Fixed a spelling error.

        * kwq/WebCoreTextRendererFactory.h: Tweak.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0e3dadfe
2002-07-22 Darin Adler <darin@apple.com>
* khtml/rendering/render_text.cpp:
(TextSlave::printSelection): Add comments to APPLE_CHANGES.
(TextSlave::printDecoration): Add comments to APPLE_CHANGES.
(TextSlave::checkSelectionPoint): Add comments to APPLE_CHANGES.
* khtml/xml/dom_stringimpl.cpp: Add comments to APPLE_CHANGES.
* khtml/xml/xml_tokenizer.cpp: (XMLTokenizer::end): Remove APPLE_CHANGES.
* kwq/KWQsignals.mm: Add a new signal dummy function.
* kwq/WebCoreJavaScript.h: Fix header.
* kwq/WebCoreJavaScript.mm: Fix header.
* kwq/WebCoreSettings.h: Added. Not used yet.
* kwq/WebCoreSettings.m: Added. Not used yet.
* WebCore.pbproj/project.pbxproj: Added WebCoreSettings.h and .m.
* English.lproj/InfoPlist.strings: Fixed a spelling error.
* kwq/WebCoreTextRendererFactory.h: Tweak.
2002-07-22 Maciej Stachowiak <mjs@apple.com>
Fixed Radar 3004897 - assert at mapquest
......
2002-07-22 Darin Adler <darin@apple.com>
* khtml/rendering/render_text.cpp:
(TextSlave::printSelection): Add comments to APPLE_CHANGES.
(TextSlave::printDecoration): Add comments to APPLE_CHANGES.
(TextSlave::checkSelectionPoint): Add comments to APPLE_CHANGES.
* khtml/xml/dom_stringimpl.cpp: Add comments to APPLE_CHANGES.
* khtml/xml/xml_tokenizer.cpp: (XMLTokenizer::end): Remove APPLE_CHANGES.
* kwq/KWQsignals.mm: Add a new signal dummy function.
* kwq/WebCoreJavaScript.h: Fix header.
* kwq/WebCoreJavaScript.mm: Fix header.
* kwq/WebCoreSettings.h: Added. Not used yet.
* kwq/WebCoreSettings.m: Added. Not used yet.
* WebCore.pbproj/project.pbxproj: Added WebCoreSettings.h and .m.
* English.lproj/InfoPlist.strings: Fixed a spelling error.
* kwq/WebCoreTextRendererFactory.h: Tweak.
2002-07-22 Maciej Stachowiak <mjs@apple.com>
Fixed Radar 3004897 - assert at mapquest
......
2002-07-22 Darin Adler <darin@apple.com>
* khtml/rendering/render_text.cpp:
(TextSlave::printSelection): Add comments to APPLE_CHANGES.
(TextSlave::printDecoration): Add comments to APPLE_CHANGES.
(TextSlave::checkSelectionPoint): Add comments to APPLE_CHANGES.
* khtml/xml/dom_stringimpl.cpp: Add comments to APPLE_CHANGES.
* khtml/xml/xml_tokenizer.cpp: (XMLTokenizer::end): Remove APPLE_CHANGES.
* kwq/KWQsignals.mm: Add a new signal dummy function.
* kwq/WebCoreJavaScript.h: Fix header.
* kwq/WebCoreJavaScript.mm: Fix header.
* kwq/WebCoreSettings.h: Added. Not used yet.
* kwq/WebCoreSettings.m: Added. Not used yet.
* WebCore.pbproj/project.pbxproj: Added WebCoreSettings.h and .m.
* English.lproj/InfoPlist.strings: Fixed a spelling error.
* kwq/WebCoreTextRendererFactory.h: Tweak.
2002-07-22 Maciej Stachowiak <mjs@apple.com>
Fixed Radar 3004897 - assert at mapquest
......
B/* Localized versions of Info.plist keys */
......
......@@ -484,6 +484,7 @@
F505847602E0934D018635CE,
F5B2A4FE02E2220F018635CB,
F5B2A52D02E22573018635CB,
F565AE8702ECA583018635CA,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -708,6 +709,7 @@
F5B2A52E02E22573018635CB,
F54A61D402E3523B01A80180,
F57B0EE102EBC78B018635CA,
F565AE8802ECA583018635CA,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -3585,6 +3587,31 @@
settings = {
};
};
F565AE8502ECA583018635CA = {
isa = PBXFileReference;
path = WebCoreSettings.h;
refType = 4;
};
F565AE8602ECA583018635CA = {
isa = PBXFileReference;
path = WebCoreSettings.m;
refType = 4;
};
F565AE8702ECA583018635CA = {
fileRef = F565AE8502ECA583018635CA;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
Private,
);
};
};
F565AE8802ECA583018635CA = {
fileRef = F565AE8602ECA583018635CA;
isa = PBXBuildFile;
settings = {
};
};
F57B0EE002EBC78B018635CA = {
isa = PBXFileReference;
path = KWQStyle.mm;
......@@ -5172,6 +5199,8 @@
F5B2A52B02E22573018635CB,
F5B2A52C02E22573018635CB,
F587855002DE375901EA4122,
F565AE8502ECA583018635CA,
F565AE8602ECA583018635CA,
F587855102DE375901EA4122,
F587855202DE375901EA4122,
F587855302DE375901EA4122,
......
......@@ -45,11 +45,11 @@ void TextSlave::printSelection(const Font *f, RenderText *text, QPainter *p, Ren
p->save();
#ifdef APPLE_CHANGES
// Macintosh-style text highlighting is to draw with a particular background color, not invert.
QColor textColor = style->color();
QColor c = QPainter::selectedTextBackgroundColor();
if (textColor == c)
c = QColor (0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
c = QColor(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
p->setPen(style->color());
#else
QColor c = style->color();
......@@ -77,6 +77,7 @@ void TextSlave::printDecoration( QPainter *pt, RenderText* p, int _tx, int _ty,
width -= p->paddingRight() + p->borderRight();
#ifdef APPLE_CHANGES
// Use a special function for underlines to get the positioning exactly right.
if(deco & UNDERLINE) {
QConstString s(p->str->s + m_start, m_len);
pt->drawUnderlineForText(_tx, _ty + m_baseline, s.string());
......@@ -160,6 +161,7 @@ FindSelectionResult TextSlave::checkSelectionPoint(int _x, int _y, int _tx, int
}
#ifdef APPLE_CHANGES
// Floating point version needed for best results with Mac OS X text.
float delta = _x - (_tx + m_x);
//kdDebug(6040) << "TextSlave::checkSelectionPoint delta=" << delta << endl;
int pos = 0;
......
......@@ -31,10 +31,9 @@
using namespace DOM;
using namespace khtml;
#ifdef APPLE_CHANGES
namespace DOM {
using khtml::Fixed;
#endif
DOMStringImpl::DOMStringImpl(const char *str)
{
......@@ -190,6 +189,7 @@ khtml::Length* DOMStringImpl::toLengthArray(int& len) const
// make sure not to break percentage or relative widths
// ### what about "auto" ?
#ifdef APPLE_CHANGES
// This alternate version works around a limitation in our QString implementation.
QChar spacified[l];
QChar space(' ');
for(unsigned int i=0; i < l; i++) {
......@@ -277,6 +277,4 @@ DOMStringImpl *DOMStringImpl::capitalize()
return c;
}
#ifdef APPLE_CHANGES
} // namespace DOM
#endif
......@@ -318,9 +318,7 @@ void XMLTokenizer::write( const QString &str, bool /*appendData*/ )
void XMLTokenizer::end()
{
#ifndef APPLE_CHANGES
emit finishedParsing();
#endif
}
void XMLTokenizer::finish()
......
......@@ -25,15 +25,9 @@
#import <khtmlview.h>
#import <loader.h>
#import <xml_tokenizer.h>
void KHTMLView::cleared()
{
}
void khtml::Loader::requestDone( khtml::DocLoader *, khtml::CachedObject *obj )
{
}
void khtml::Loader::requestFailed( khtml::DocLoader *, khtml::CachedObject *obj )
{
}
void KHTMLView::cleared() { }
void khtml::Loader::requestDone(khtml::DocLoader *, khtml::CachedObject *) { }
void khtml::Loader::requestFailed(khtml::DocLoader *, khtml::CachedObject *) { }
void Tokenizer::finishedParsing() { }
......@@ -25,15 +25,9 @@
#import <khtmlview.h>
#import <loader.h>
#import <xml_tokenizer.h>
void KHTMLView::cleared()
{
}
void khtml::Loader::requestDone( khtml::DocLoader *, khtml::CachedObject *obj )
{
}
void khtml::Loader::requestFailed( khtml::DocLoader *, khtml::CachedObject *obj )
{
}
void KHTMLView::cleared() { }
void khtml::Loader::requestDone(khtml::DocLoader *, khtml::CachedObject *) { }
void khtml::Loader::requestFailed(khtml::DocLoader *, khtml::CachedObject *) { }
void Tokenizer::finishedParsing() { }
//
// WebCoreJavaScript.h
// WebCore
//
// Created by Darin Adler on Sun Jul 14 2002.
// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
/*
* Copyright (C) 2002 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.
*/
#import <Foundation/Foundation.h>
......
//
// WebCoreJavaScript.m
// WebCore
//
// Created by Darin Adler on Sun Jul 14 2002.
// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
/*
* Copyright (C) 2002 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.
*/
#import "WebCoreJavaScript.h"
......
/*
* Copyright (C) 2002 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.
*/
#import <Foundation/Foundation.h>
@interface WebCoreSettings : NSObject
{
NSString *standardFontFamily;
NSString *fixedFontFamily;
NSString *serifFontFamily;
NSString *sansSerifFontFamily;
NSString *cursiveFontFamily;
NSString *fantasyFontFamily;
float minimumFontSize;
float mediumFontSize;
BOOL JavaEnabled;
BOOL pluginsEnabled;
BOOL JavaScriptEnabled;
BOOL JavaScriptCanOpenWindowsAutomatically;
}
+ (WebCoreSettings *)sharedSettings;
- (void)setStandardFontFamily:(NSString *)family;
- (NSString *)standardFontFamily;
- (void)setFixedFontFamily:(NSString *)family;
- (NSString *)fixedFontFamily;
- (void)setSerifFontFamily:(NSString *)family;
- (NSString *)serifFontFamily;
- (void)setSansSerifFontFamily:(NSString *)family;
- (NSString *)sansSerifFontFamily;
- (void)setCursiveFontFamily:(NSString *)family;
- (NSString *)cursiveFontFamily;
- (void)setFantasyFontFamily:(NSString *)family;
- (NSString *)fantasyFontFamily;
- (void)setMinimumFontSize:(float)size;
- (float)minimumFontSize;
- (void)setMediumFontSize:(float)size;
- (float)mediumFontSize;
- (void)setJavaEnabled:(BOOL)enabled;
- (BOOL)JavaEnabled;
- (void)setPluginsEnabled:(BOOL)enabled;
- (BOOL)pluginsEnabled;
- (void)setJavaScriptEnabled:(BOOL)enabled;
- (BOOL)JavaScriptEnabled;
- (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)enabled;
- (BOOL)JavaScriptCanOpenWindowsAutomatically;
@end
/*
* Copyright (C) 2002 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.
*/
#import "WebCoreSettings.h"
@implementation WebCoreSettings
+ (WebCoreSettings *)sharedSettings
{
static WebCoreSettings *shared;
if (!shared) {
shared = [[WebCoreSettings alloc] init];
}
return shared;
}
- (void)dealloc
{
[standardFontFamily release];
[fixedFontFamily release];
[serifFontFamily release];
[sansSerifFontFamily release];
[cursiveFontFamily release];
[fantasyFontFamily release];
[super dealloc];
}
- (void)setStandardFontFamily:(NSString *)s
{
NSString *c = [s copy];
[standardFontFamily release];
standardFontFamily = c;
}
- (NSString *)standardFontFamily
{
return standardFontFamily;
}
- (void)setFixedFontFamily:(NSString *)s
{
NSString *c = [s copy];
[fixedFontFamily release];
fixedFontFamily = c;
}
- (NSString *)fixedFontFamily
{
return fixedFontFamily;
}
- (void)setSerifFontFamily:(NSString *)s
{
NSString *c = [s copy];
[serifFontFamily release];
serifFontFamily = c;
}
- (NSString *)serifFontFamily
{
return serifFontFamily;
}
- (void)setSansSerifFontFamily:(NSString *)s
{
NSString *c = [s copy];
[sansSerifFontFamily release];
sansSerifFontFamily = c;
}
- (NSString *)sansSerifFontFamily
{
return sansSerifFontFamily;
}
- (void)setCursiveFontFamily:(NSString *)s
{
NSString *c = [s copy];
[cursiveFontFamily release];
cursiveFontFamily = c;
}
- (NSString *)cursiveFontFamily
{
return cursiveFontFamily;
}
- (void)setFantasyFontFamily:(NSString *)s
{
NSString *c = [s copy];
[fantasyFontFamily release];
fantasyFontFamily = c;
}
- (NSString *)fantasyFontFamily
{
return fantasyFontFamily;
}
- (void)setMinimumFontSize:(float)size
{
minimumFontSize = size;
}
- (float)minimumFontSize
{
return minimumFontSize;
}
- (void)setMediumFontSize:(float)size
{
mediumFontSize = size;
}
- (float)mediumFontSize
{
return mediumFontSize;
}
- (void)setJavaEnabled:(BOOL)enabled
{
JavaEnabled = enabled;
}
- (BOOL)JavaEnabled
{
return JavaEnabled;
}
- (void)setPluginsEnabled:(BOOL)enabled
{
pluginsEnabled = enabled;
}
- (BOOL)pluginsEnabled
{
return pluginsEnabled;
}
- (void)setJavaScriptEnabled:(BOOL)enabled
{
JavaScriptEnabled = enabled;
}
- (BOOL)JavaScriptEnabled
{
return JavaScriptEnabled;
}
- (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)enabled
{
JavaScriptCanOpenWindowsAutomatically = enabled;
}
- (BOOL)JavaScriptCanOpenWindowsAutomatically
{
return JavaScriptCanOpenWindowsAutomatically;
}
@end
......@@ -32,7 +32,6 @@
}
+ (WebCoreTextRendererFactory *)sharedFactory;
- init;
- (id <WebCoreTextRenderer>)rendererWithFamily:(NSString *)family traits:(NSFontTraitMask)traits size:(float)size;
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment