* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/BrowserExtensionMac.mm:
(WebCore::BrowserExtensionMac::createNewWindow):
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::createFrame):
* bridge/mac/FrameViewMac.mm:
(WebCore::FrameView::passMousePressEventToScrollbar):
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge installInFrame:]):
* bridge/mac/WebCoreFrameView.h:
* platform/ScrollBar.cpp:
* platform/Widget.h:
* platform/mac/PlatformScrollBar.h:
* platform/mac/PlatformScrollBarMac.mm:
(NSControlSizeForScrollBarControlSize):
(-[WebCoreScrollBar initWithPlatformScrollbar:]):
(-[WebCoreScrollBar detachPlatformScrollbar]):
(-[WebCoreScrollBar scroll:]):
(-[WebCoreScrollBar widget]):
(WebCore::PlatformScrollbar::PlatformScrollbar):
(WebCore::PlatformScrollbar::~PlatformScrollbar):
(WebCore::PlatformScrollbar::updateThumbPosition):
(WebCore::PlatformScrollbar::updateThumbProportion):
(WebCore::PlatformScrollbar::scrollbarHit):
(WebCore::PlatformScrollbar::width):
(WebCore::PlatformScrollbar::height):
(WebCore::PlatformScrollbar::setRect):
(WebCore::PlatformScrollbar::setEnabled):
(WebCore::PlatformScrollbar::paint):
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::setVScrollbarMode):
(WebCore::ScrollView::setHScrollbarMode):
(WebCore::ScrollView::setScrollbarsMode):
(WebCore::ScrollView::vScrollbarMode):
(WebCore::ScrollView::hScrollbarMode):
(WebCore::ScrollView::suppressScrollbars):
(WebCore::ScrollView::scrollbarUnderMouse):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::removeFromParent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::destroyScrollbar):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16830
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-05 Geoffrey Garen <ggaren@apple.com>
+
+ build fix.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/mac/BrowserExtensionMac.mm:
+ (WebCore::BrowserExtensionMac::createNewWindow):
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::createFrame):
+ * bridge/mac/FrameViewMac.mm:
+ (WebCore::FrameView::passMousePressEventToScrollbar):
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge installInFrame:]):
+ * bridge/mac/WebCoreFrameView.h:
+ * platform/ScrollBar.cpp:
+ * platform/Widget.h:
+ * platform/mac/PlatformScrollBar.h:
+ * platform/mac/PlatformScrollBarMac.mm:
+ (NSControlSizeForScrollBarControlSize):
+ (-[WebCoreScrollBar initWithPlatformScrollbar:]):
+ (-[WebCoreScrollBar detachPlatformScrollbar]):
+ (-[WebCoreScrollBar scroll:]):
+ (-[WebCoreScrollBar widget]):
+ (WebCore::PlatformScrollbar::PlatformScrollbar):
+ (WebCore::PlatformScrollbar::~PlatformScrollbar):
+ (WebCore::PlatformScrollbar::updateThumbPosition):
+ (WebCore::PlatformScrollbar::updateThumbProportion):
+ (WebCore::PlatformScrollbar::scrollbarHit):
+ (WebCore::PlatformScrollbar::width):
+ (WebCore::PlatformScrollbar::height):
+ (WebCore::PlatformScrollbar::setRect):
+ (WebCore::PlatformScrollbar::setEnabled):
+ (WebCore::PlatformScrollbar::paint):
+ * platform/mac/ScrollViewMac.mm:
+ (WebCore::ScrollView::setVScrollbarMode):
+ (WebCore::ScrollView::setHScrollbarMode):
+ (WebCore::ScrollView::setScrollbarsMode):
+ (WebCore::ScrollView::vScrollbarMode):
+ (WebCore::ScrollView::hScrollbarMode):
+ (WebCore::ScrollView::suppressScrollbars):
+ (WebCore::ScrollView::scrollbarUnderMouse):
+ * platform/mac/WidgetMac.mm:
+ (WebCore::Widget::removeFromParent):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::destroyScrollbar):
+
+2006-10-05 Geoffrey Garen <ggaren@apple.com>
+
+ build fix.
+
+ * platform/Widget.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::destroyScrollbar):
+
2006-10-06 Mitz Pettel <mitz@webkit.org>
http://bugs.webkit.org/show_bug.cgi?id=8276
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
- shouldCheckCompatibility = 1;
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
[frameBridge setToolbarsVisible:winArgs.toolBarVisible || winArgs.locationBarVisible];
[frameBridge setStatusbarVisible:winArgs.statusBarVisible];
- [frameBridge setScrollbarsVisible:winArgs.scrollBarsVisible];
+ [frameBridge setScrollbarsVisible:winArgs.scrollbarsVisible];
[frameBridge setWindowIsResizable:winArgs.resizable];
NSRect windowRect = [pageBridge impl]->windowRect();
#import "Logging.h"
#import "MouseEventWithHitTestResults.h"
#import "PlatformKeyboardEvent.h"
-#import "PlatformScrollBar.h"
+#import "PlatformScrollbar.h"
#import "PlatformWheelEvent.h"
#import "Plugin.h"
#import "RegularExpression.h"
int marginHeight = -1;
if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag)) {
HTMLFrameElement* o = static_cast<HTMLFrameElement*>(ownerElement);
- allowsScrolling = o->scrollingMode() != ScrollBarAlwaysOff;
+ allowsScrolling = o->scrollingMode() != ScrollbarAlwaysOff;
marginWidth = o->getMarginWidth();
marginHeight = o->getMarginHeight();
}
return Mac(m_frame.get())->passWheelEventToWidget(subframe->view());
}
-bool FrameView::passMousePressEventToScrollbar(MouseEventWithHitTestResults& mev, PlatformScrollBar* scrollbar)
+bool FrameView::passMousePressEventToScrollbar(MouseEventWithHitTestResults& mev, PlatformScrollbar* scrollbar)
{
return Mac(m_frame.get())->passMouseDownEventToWidget(scrollbar);
}
// Now the render part owns the view, so we don't any more.
}
- m_frame->view()->initScrollBars();
+ m_frame->view()->initScrollbars();
}
- (void)setActivationEventNumber:(int)num
// scroll view is resized.
typedef enum {
- WebCoreScrollBarAuto,
- WebCoreScrollBarAlwaysOff,
- WebCoreScrollBarAlwaysOn
-} WebCoreScrollBarMode;
+ WebCoreScrollbarAuto,
+ WebCoreScrollbarAlwaysOff,
+ WebCoreScrollbarAlwaysOn
+} WebCoreScrollbarMode;
@protocol WebCoreFrameView
-- (void)setHorizontalScrollingMode:(WebCoreScrollBarMode)mode;
-- (void)setVerticalScrollingMode:(WebCoreScrollBarMode)mode;
-- (void)setScrollingMode:(WebCoreScrollBarMode)mode;
+- (void)setHorizontalScrollingMode:(WebCoreScrollbarMode)mode;
+- (void)setVerticalScrollingMode:(WebCoreScrollbarMode)mode;
+- (void)setScrollingMode:(WebCoreScrollbarMode)mode;
-- (WebCoreScrollBarMode)horizontalScrollingMode;
-- (WebCoreScrollBarMode)verticalScrollingMode;
+- (WebCoreScrollbarMode)horizontalScrollingMode;
+- (WebCoreScrollbarMode)verticalScrollingMode;
- (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint;
*/
#include "config.h"
-#include "ScrollBar.h"
+#include "Scrollbar.h"
namespace WebCore {
class IntRect;
class IntSize;
class PlatformMouseEvent;
+ class ScrollView;
class WidgetClient;
class WidgetPrivate;
virtual bool isFrameView() const;
+ virtual void removeFromParent();
+
#if PLATFORM(WIN)
void setContainingWindow(HWND);
HWND containingWindow() const;
- void setParent(Widget*);
- Widget* parent() const;
+ void setParent(ScrollView*);
+ ScrollView* parent() const;
virtual void scrolled() const {};
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PlatformScrollBar_h
-#define PlatformScrollBar_h
+#ifndef PlatformScrollbar_h
+#define PlatformScrollbar_h
#include "Widget.h"
#include "ScrollBar.h"
namespace WebCore {
-class PlatformScrollBar : public Widget, public ScrollBar {
+class PlatformScrollbar : public Widget, public Scrollbar {
public:
- PlatformScrollBar(ScrollBarClient*, ScrollBarOrientation, ScrollBarControlSize);
- virtual ~PlatformScrollBar();
+ PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+ virtual ~PlatformScrollbar();
virtual bool isWidget() const { return true; }
}
-#endif // PlatformScrollBar_h
+#endif // PlatformScrollbar_h
@interface WebCoreScrollBar : NSScroller <WebCoreWidgetHolder>
{
- PlatformScrollBar* scrollBar;
+ PlatformScrollbar* scrollbar;
}
-- (id)initWithPlatformScrollBar:(PlatformScrollBar*)s;
-- (void)detachPlatformScrollBar;
+- (id)initWithPlatformScrollbar:(PlatformScrollbar*)s;
+- (void)detachPlatformScrollbar;
@end
@implementation WebCoreScrollBar
-static NSControlSize NSControlSizeForScrollBarControlSize(ScrollBarControlSize size)
+static NSControlSize NSControlSizeForScrollBarControlSize(ScrollbarControlSize size)
{
- if (size == SmallScrollBar)
+ if (size == SmallScrollbar)
return NSSmallControlSize;
- if (size == MiniScrollBar)
+ if (size == MiniScrollbar)
return NSMiniControlSize;
return NSRegularControlSize;
}
-- (id)initWithPlatformScrollBar:(PlatformScrollBar*)s
+- (id)initWithPlatformScrollbar:(PlatformScrollbar*)s
{
// Cocoa scrollbars just set their orientation by examining their own
// dimensions, so we have to do this unsavory hack.
NSRect orientation;
orientation.origin.x = orientation.origin.y = 0;
- if (s->orientation() == VerticalScrollBar) {
+ if (s->orientation() == VerticalScrollbar) {
orientation.size.width = [NSScroller scrollerWidth];
orientation.size.height = 100;
} else {
}
self = [self initWithFrame:orientation];
- scrollBar = s;
+ scrollbar = s;
[self setEnabled:YES];
[self setTarget:self];
return self;
}
-- (void)detachPlatformScrollBar
+- (void)detachPlatformScrollbar
{
[self setTarget:nil];
- scrollBar = 0;
+ scrollbar = 0;
}
- (IBAction)scroll:(NSScroller*)sender
{
- if (scrollBar)
- scrollBar->scrollbarHit([sender hitPart]);
+ if (scrollbar)
+ scrollbar->scrollbarHit([sender hitPart]);
}
- (Widget *)widget
{
- return scrollBar;
+ return scrollbar;
}
- (void)mouseDown:(NSEvent *)event
namespace WebCore
{
-PlatformScrollBar::PlatformScrollBar(ScrollBarClient* client, ScrollBarOrientation orientation, ScrollBarControlSize controlSize)
- : ScrollBar(client, orientation, controlSize)
+PlatformScrollbar::PlatformScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+ : Scrollbar(client, orientation, controlSize)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- WebCoreScrollBar *bar = [[WebCoreScrollBar alloc] initWithPlatformScrollBar:this];
+ WebCoreScrollBar *bar = [[WebCoreScrollBar alloc] initWithPlatformScrollbar:this];
setView(bar);
[bar release];
END_BLOCK_OBJC_EXCEPTIONS;
}
-PlatformScrollBar::~PlatformScrollBar()
+PlatformScrollbar::~PlatformScrollbar()
{
WebCoreScrollBar* bar = (WebCoreScrollBar*)getView();
- [bar detachPlatformScrollBar];
+ [bar detachPlatformScrollbar];
// Widget should probably do this for all widgets.
// But we don't need it for form elements, and for frames it doesn't work
// well because of the way the NSViews are created in WebKit. So for now,
- // we'll just do it explictly for ScrollBar.
+ // we'll just do it explictly for Scrollbar.
removeFromSuperview();
}
-void PlatformScrollBar::updateThumbPosition()
+void PlatformScrollbar::updateThumbPosition()
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
WebCoreScrollBar *bar = (WebCoreScrollBar *)getView();
END_BLOCK_OBJC_EXCEPTIONS;
}
-void PlatformScrollBar::updateThumbProportion()
+void PlatformScrollbar::updateThumbProportion()
{
float val = (float)m_visibleSize/m_totalSize;
END_BLOCK_OBJC_EXCEPTIONS;
}
-bool PlatformScrollBar::scrollbarHit(NSScrollerPart hitPart)
+bool PlatformScrollbar::scrollbarHit(NSScrollerPart hitPart)
{
int maxPos = m_totalSize - m_visibleSize;
if (maxPos <= 0)
return setValue(newPos);
}
-int PlatformScrollBar::width() const
+int PlatformScrollbar::width() const
{
return Widget::width();
}
-int PlatformScrollBar::height() const
+int PlatformScrollbar::height() const
{
return Widget::height();
}
-void PlatformScrollBar::setRect(const IntRect& rect)
+void PlatformScrollbar::setRect(const IntRect& rect)
{
setFrameGeometry(rect);
}
-void PlatformScrollBar::setEnabled(bool enabled)
+void PlatformScrollbar::setEnabled(bool enabled)
{
Widget::setEnabled(enabled);
}
-void PlatformScrollBar::paint(GraphicsContext* graphicsContext, const IntRect& damageRect)
+void PlatformScrollbar::paint(GraphicsContext* graphicsContext, const IntRect& damageRect)
{
Widget::paint(graphicsContext, damageRect);
}
END_BLOCK_OBJC_EXCEPTIONS;
}
-void ScrollView::setVScrollBarMode(ScrollBarMode vMode)
+void ScrollView::setVScrollbarMode(ScrollbarMode vMode)
{
NSView* view = getView();
BEGIN_BLOCK_OBJC_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- [frameView setVerticalScrollingMode: (WebCoreScrollBarMode)vMode];
+ [frameView setVerticalScrollingMode: (WebCoreScrollbarMode)vMode];
}
END_BLOCK_OBJC_EXCEPTIONS;
}
-void ScrollView::setHScrollBarMode(ScrollBarMode hMode)
+void ScrollView::setHScrollbarMode(ScrollbarMode hMode)
{
NSView* view = getView();
BEGIN_BLOCK_OBJC_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- [frameView setHorizontalScrollingMode: (WebCoreScrollBarMode)hMode];
+ [frameView setHorizontalScrollingMode: (WebCoreScrollbarMode)hMode];
}
END_BLOCK_OBJC_EXCEPTIONS;
}
-void ScrollView::setScrollBarsMode(ScrollBarMode mode)
+void ScrollView::setScrollbarsMode(ScrollbarMode mode)
{
NSView* view = getView();
BEGIN_BLOCK_OBJC_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- [frameView setScrollingMode: (WebCoreScrollBarMode)mode];
+ [frameView setScrollingMode: (WebCoreScrollbarMode)mode];
}
END_BLOCK_OBJC_EXCEPTIONS;
}
-ScrollBarMode ScrollView::vScrollBarMode() const
+ScrollbarMode ScrollView::vScrollbarMode() const
{
NSView* view = getView();
BEGIN_BLOCK_OBJC_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- return (ScrollBarMode)[frameView verticalScrollingMode];
+ return (ScrollbarMode)[frameView verticalScrollingMode];
}
END_BLOCK_OBJC_EXCEPTIONS;
- return ScrollBarAuto;
+ return ScrollbarAuto;
}
-ScrollBarMode ScrollView::hScrollBarMode() const
+ScrollbarMode ScrollView::hScrollbarMode() const
{
NSView* view = getView();
BEGIN_BLOCK_OBJC_EXCEPTIONS;
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
NSView<WebCoreFrameView>* frameView = (NSView<WebCoreFrameView>*)view;
- return (ScrollBarMode)[frameView horizontalScrollingMode];
+ return (ScrollbarMode)[frameView horizontalScrollingMode];
}
END_BLOCK_OBJC_EXCEPTIONS;
- return ScrollBarAuto;
+ return ScrollbarAuto;
}
-void ScrollView::suppressScrollBars(bool suppressed, bool repaintOnUnsuppress)
+void ScrollView::suppressScrollbars(bool suppressed, bool repaintOnUnsuppress)
{
NSView* view = getView();
return nil;
}
-PlatformScrollBar* ScrollView::scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent)
+PlatformScrollbar* ScrollView::scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent)
{
// On Mac, the ScrollView is really the "document", so events will never flow into it to get to the scrollers.
return 0;
return data->client;
}
+void Widget::removeFromParent()
+{
+}
+
}
void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
{
RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar : m_vBar;
-
if (scrollbar) {
- if (scrollbar->isWidget()) {
- PlatformScrollbar* scrollbarWidget = static_cast<PlatformScrollbar*>(scrollbar.get());
- if (scrollbarWidget->parent()->isFrameView())
- static_cast<FrameView*>(scrollbarWidget->parent())->removeChild(scrollbarWidget);
- scrollbarWidget->setParent(0);
- }
- // FIXME: Destroy the engine scrollbar.
+ if (scrollbar->isWidget())
+ static_cast<PlatformScrollbar*>(scrollbar.get())->removeFromParent();
+ // FIXME: Destroy the engine scrollbar.
scrollbar = 0;
}
}