Reviewed by justin
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::paintCustomHighlight):
* bridge/mac/WebCoreFrameBridge.h:
* platform/mac/ClipboardMac.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintCustomHighlight):
* rendering/InlineTextBox.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14766
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-07 David Hyatt <hyatt@apple.com>
+
+ Add support for custom highlighting. This is all ifdefed to be Mac-only.
+
+ Reviewed by justin
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::paintCustomHighlight):
+ * bridge/mac/WebCoreFrameBridge.h:
+ * platform/mac/ClipboardMac.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+ (WebCore::InlineTextBox::paintCustomHighlight):
+ * rendering/InlineTextBox.h:
+
2006-06-07 Adele Peterson <adele@apple.com>
Reviewed by Hyatt
FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
/* End PBXBuildFile section */
+/* Begin PBXBuildStyle section */
+ BCC0C2960A3792E6008CD7AD /* Development */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ };
+ name = Development;
+ };
+ BCC0C2970A3792E6008CD7AD /* Deployment */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ };
+ name = Deployment;
+ };
+/* End PBXBuildStyle section */
+
/* Begin PBXContainerItemProxy section */
DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+ buildSettings = {
+ };
+ buildStyles = (
+ BCC0C2960A3792E6008CD7AD /* Development */,
+ BCC0C2970A3792E6008CD7AD /* Deployment */,
+ );
hasScannedForEncodings = 1;
knownRegions = (
English,
virtual bool canUndo() const;
virtual void print();
+ void paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text);
+
protected:
virtual void startRedirectionTimer();
virtual void stopRedirectionTimer();
[Mac(this)->bridge() setNeedsReapplyStyles];
}
+void FrameMac::paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text)
+{
+ [bridge() paintCustomHighlight:type forBox:boxRect onLine:lineRect behindText:text];
+}
+
}
- (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
+- (void)paintCustomHighlight:(NSString*)type forBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text;
+
- (void)handledOnloadEvents;
- (WebCoreKeyboardUIMode)keyboardUIMode;
#else
class NSImage;
class NSPasteboard;
+typedef unsigned int NSDragOperation;
#endif
class DeprecatedStringList;
#include "RenderArena.h"
#include <wtf/AlwaysInline.h>
+#if PLATFORM(MAC)
+#include "FrameMac.h"
+#endif
+
using namespace std;
namespace WebCore {
// 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
// and marked text.
if (i.phase != PaintPhaseSelection && !isPrinting) {
+#if PLATFORM(MAC)
+ // Custom highlighters go behind everything else.
+ if (styleToUse->highlight() != nullAtom)
+ paintCustomHighlight(tx, ty, styleToUse->highlight());
+#endif
+
if (haveMarkedText && !markedTextUsesUnderlines)
paintMarkedTextBackground(i.p, tx, ty, styleToUse, font, markedTextRange->startOffset(exception), markedTextRange->endOffset(exception));
p->restore();
}
+#if PLATFORM(MAC)
+void InlineTextBox::paintCustomHighlight(int tx, int ty, const AtomicString& type)
+{
+ RootInlineBox* r = root();
+ FloatRect rootRect(tx + r->xPos(), ty + r->selectionTop(), r->width(), r->selectionHeight());
+ FloatRect textRect(tx + xPos(), rootRect.y(), width(), rootRect.height());
+
+ Mac(object()->document()->frame())->paintCustomHighlight(type, textRect, rootRect, true);
+}
+#endif
+
void InlineTextBox::paintDecoration(GraphicsContext *pt, int _tx, int _ty, int deco)
{
_tx += m_x;
void paintSpellingMarker(GraphicsContext*, int tx, int ty, DocumentMarker);
void paintTextMatchMarker(GraphicsContext*, int tx, int ty, DocumentMarker, RenderStyle*, const Font*);
void paintMarkedTextUnderline(GraphicsContext*, int tx, int ty, MarkedTextUnderline&);
+#if PLATFORM(MAC)
+ void paintCustomHighlight(int tx, int ty, const AtomicString& type);
+#endif
virtual int caretMinOffset() const;
virtual int caretMaxOffset() const;
virtual unsigned caretMaxRenderedOffset() const;