summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/mac
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/mac')
-rw-r--r--WebCore/platform/mac/LocalizedStringsMac.mm55
-rw-r--r--WebCore/platform/mac/ScrollViewMac.mm6
-rw-r--r--WebCore/platform/mac/ScrollbarThemeMac.mm2
-rw-r--r--WebCore/platform/mac/ThemeMac.mm33
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.h6
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.mm6
-rw-r--r--WebCore/platform/mac/WidgetMac.mm57
7 files changed, 146 insertions, 19 deletions
diff --git a/WebCore/platform/mac/LocalizedStringsMac.mm b/WebCore/platform/mac/LocalizedStringsMac.mm
index 261347f..c438d6b 100644
--- a/WebCore/platform/mac/LocalizedStringsMac.mm
+++ b/WebCore/platform/mac/LocalizedStringsMac.mm
@@ -747,5 +747,60 @@ String localizedMediaTimeDescription(float time)
return String();
}
+String validationMessageValueMissingText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessageValueMissingText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String validationMessageTypeMismatchText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessageTypeMismatchText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String validationMessagePatternMismatchText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessagePatternMismatchText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String validationMessageTooLongText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessageTooLongText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String validationMessageRangeUnderflowText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessageRangeUnderflowText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String validationMessageRangeOverflowText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessageRangeOverflowText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String validationMessageStepMismatchText()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] validationMessageStepMismatchText];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
}
diff --git a/WebCore/platform/mac/ScrollViewMac.mm b/WebCore/platform/mac/ScrollViewMac.mm
index 202d49e..f31b301 100644
--- a/WebCore/platform/mac/ScrollViewMac.mm
+++ b/WebCore/platform/mac/ScrollViewMac.mm
@@ -57,6 +57,8 @@ NSView *ScrollView::documentView() const
return nil;
}
+#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
+
void ScrollView::platformAddChild(Widget* child)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
@@ -203,4 +205,6 @@ bool ScrollView::platformIsOffscreen() const
return ![platformWidget() window] || ![[platformWidget() window] isVisible];
}
-}
+#endif // !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
+
+} // namespace WebCore
diff --git a/WebCore/platform/mac/ScrollbarThemeMac.mm b/WebCore/platform/mac/ScrollbarThemeMac.mm
index 0a20e2f..b4b8f62 100644
--- a/WebCore/platform/mac/ScrollbarThemeMac.mm
+++ b/WebCore/platform/mac/ScrollbarThemeMac.mm
@@ -396,7 +396,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
return true;
HIThemeDrawTrack(&trackInfo, 0, imageBuffer->context()->platformContext(), kHIThemeOrientationNormal);
- context->drawImage(imageBuffer->image(), scrollbar->frameRect().location());
+ context->drawImage(imageBuffer->image(), DeviceColorSpace, scrollbar->frameRect().location());
}
return true;
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index fd2f944..a95fee4 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -173,9 +173,9 @@ static LengthSize checkboxSize(const Font& font, const LengthSize& zoomedSize, f
return sizeFromFont(font, zoomedSize, zoomFactor, checkboxSizes());
}
-static NSButtonCell* checkbox(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+static NSButtonCell *checkbox(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
{
- static NSButtonCell* checkboxCell;
+ static NSButtonCell *checkboxCell;
if (!checkboxCell) {
checkboxCell = [[NSButtonCell alloc] init];
[checkboxCell setButtonType:NSSwitchButton];
@@ -199,7 +199,7 @@ static void paintCheckbox(ControlStates states, GraphicsContext* context, const
BEGIN_BLOCK_OBJC_EXCEPTIONS
// Determine the width and height needed for the control and prepare the cell for painting.
- NSButtonCell* checkboxCell = checkbox(states, zoomedRect, zoomFactor);
+ NSButtonCell *checkboxCell = checkbox(states, zoomedRect, zoomFactor);
context->save();
@@ -254,9 +254,9 @@ static LengthSize radioSize(const Font& font, const LengthSize& zoomedSize, floa
return sizeFromFont(font, zoomedSize, zoomFactor, radioSizes());
}
-static NSButtonCell* radio(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+static NSButtonCell *radio(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
{
- static NSButtonCell* radioCell;
+ static NSButtonCell *radioCell;
if (!radioCell) {
radioCell = [[NSButtonCell alloc] init];
[radioCell setButtonType:NSRadioButton];
@@ -276,7 +276,7 @@ static NSButtonCell* radio(ControlStates states, const IntRect& zoomedRect, floa
static void paintRadio(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
{
// Determine the width and height needed for the control and prepare the cell for painting.
- NSButtonCell* radioCell = radio(states, zoomedRect, zoomFactor);
+ NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor);
context->save();
@@ -330,14 +330,14 @@ static const int* buttonMargins(NSControlSize controlSize)
return margins[controlSize];
}
-static NSButtonCell* button(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+static void setupButtonCell(NSButtonCell *&buttonCell, ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
{
- static NSButtonCell *buttonCell;
- static bool defaultButton;
if (!buttonCell) {
buttonCell = [[NSButtonCell alloc] init];
[buttonCell setTitle:nil];
[buttonCell setButtonType:NSMomentaryPushInButton];
+ if (states & DefaultState)
+ [buttonCell setKeyEquivalent:@"\r"];
}
// Set the control size based off the rectangle we're painting into.
@@ -357,15 +357,16 @@ static NSButtonCell* button(ControlPart part, ControlStates states, const IntRec
setControlSize(buttonCell, buttonSizes(), zoomedRect.size(), zoomFactor);
- if (defaultButton != (states & DefaultState)) {
- defaultButton = !defaultButton;
- [buttonCell setKeyEquivalent:(defaultButton ? @"\r" : @"")];
- }
-
// Update the various states we respond to.
updateStates(buttonCell, states);
+}
- return buttonCell;
+static NSButtonCell *button(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+{
+ bool isDefault = states & DefaultState;
+ static NSButtonCell *cells[2];
+ setupButtonCell(cells[isDefault], part, states, zoomedRect, zoomFactor);
+ return cells[isDefault];
}
static void paintButton(ControlPart part, ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
@@ -408,7 +409,7 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext*
NSWindow *window = [view window];
NSButtonCell *previousDefaultButtonCell = [window defaultButtonCell];
- if ((states & DefaultState) && [window isKeyWindow]) {
+ if (states & DefaultState) {
[window setDefaultButtonCell:buttonCell];
wkAdvanceDefaultButtonPulseAnimation(buttonCell);
} else if ([previousDefaultButtonCell isEqual:buttonCell])
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h
index 768899e..917ab0b 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -117,6 +117,7 @@ extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
extern BOOL (*wkHitTestMediaUIPart)(int part, int themeStyle, CGRect bounds, CGPoint point);
extern void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
+extern BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
extern int (*wkQTMovieDataRate)(QTMovie*);
@@ -124,6 +125,8 @@ extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
extern float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
extern int (*wkQTMovieGetType)(QTMovie* movie);
+extern BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
+extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
@@ -136,6 +139,9 @@ extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
extern unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
+extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
+extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
+extern CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
extern BOOL (*wkIsLatchingWheelEvent)(NSEvent *);
#ifndef BUILDING_ON_TIGER
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm
index d0e276f..3a9c011 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -44,6 +44,7 @@ void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect
BOOL (*wkHitTestMediaUIPart)(int part, int themeStyle, CGRect bounds, CGPoint point);
void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
+BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
NSString* (*wkGetMIMETypeForExtension)(NSString*);
@@ -58,6 +59,8 @@ float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
int (*wkQTMovieGetType)(QTMovie* movie);
+BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
+void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
@@ -80,6 +83,9 @@ void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
id (*wkCreateNSURLConnectionDelegateProxy)(void);
unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
+void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
+void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
+CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
BOOL (*wkIsLatchingWheelEvent)(NSEvent *);
#ifndef BUILDING_ON_TIGER
diff --git a/WebCore/platform/mac/WidgetMac.mm b/WebCore/platform/mac/WidgetMac.mm
index 8653a03..ebb47dc 100644
--- a/WebCore/platform/mac/WidgetMac.mm
+++ b/WebCore/platform/mac/WidgetMac.mm
@@ -44,6 +44,8 @@
#import "WebCoreView.h"
#import <wtf/RetainPtr.h>
+#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
+
@interface NSWindow (WebWindowDetails)
- (BOOL)_needsToResetDragMargins;
- (void)_setNeedsToResetDragMargins:(BOOL)needs;
@@ -54,8 +56,12 @@
- (void)webPlugInSetIsSelected:(BOOL)isSelected;
@end
+#endif
+
namespace WebCore {
+#if !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
+
class WidgetPrivate {
public:
bool mustStayInWindow;
@@ -78,7 +84,7 @@ static void safeRemoveFromSuperview(NSView *view)
[window _setNeedsToResetDragMargins:resetDragMargins];
}
-Widget::Widget(NSView* view)
+Widget::Widget(NSView *view)
: m_data(new WidgetPrivate)
{
init(view);
@@ -341,5 +347,54 @@ void Widget::retainPlatformWidget()
HardRetain(m_widget);
}
+#else // ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
+
+Widget::Widget(PlatformWidget widget)
+{
+ init(widget);
+}
+
+Widget::~Widget()
+{
+ ASSERT(!parent());
+}
+
+void Widget::show()
+{
+}
+
+void Widget::hide()
+{
}
+void Widget::setCursor(const Cursor&)
+{
+ notImplemented();
+}
+
+void Widget::paint(GraphicsContext*, const IntRect&)
+{
+}
+
+void Widget::setFocus()
+{
+}
+
+void Widget::setIsSelected(bool)
+{
+}
+
+IntRect Widget::frameRect() const
+{
+ return m_frame;
+}
+
+void Widget::setFrameRect(const IntRect& rect)
+{
+ m_frame = rect;
+}
+
+#endif
+
+} // namespace WebCore
+